From 1d70e2e85b28b4a6f10d3bdfd91d498f8619f117 Mon Sep 17 00:00:00 2001 From: Corey Johnson & Nathan Sobo Date: Wed, 1 Aug 2012 17:16:01 -0700 Subject: [PATCH] Add bundles for coffeeScript and ruby --- .../CoffeeScriptBundle.tmbundle/.gitignore | 1 + .../Commands/Align Assignments.tmCommand | 159 + .../Commands/CoffeeScript.sublime-build | 6 + .../Commands/Compile and Display JS.tmCommand | 33 + .../Commands/Insert Heredoc comment.tmCommand | 34 + ...ert Heredoc triple double quotes.tmCommand | 34 + ...ert Heredoc triple single quotes.tmCommand | 34 + .../Commands/New Function.tmCommand | 27 + .../Commands/Run selected text.tmCommand | 25 + .../Commands/Run.tmCommand | 32 + .../Preferences/CoffeeScript.tmPreferences | 36 + .../Disable Indent Corrections.tmPreferences | 17 + .../Preferences/Indent.tmPreferences | 27 + .../Symbol List Method 2.tmPreferences | 19 + .../Symbol List Method.tmPreferences | 17 + .../README.markdown | 21 + .../Snippets/Array comprehension.tmSnippet | 17 + .../Snippets/Bound Function.tmSnippet | 17 + .../Snippets/Class.tmSnippet | 20 + .../Snippets/Else if.tmSnippet | 17 + .../Snippets/Function.tmSnippet | 19 + .../Snippets/If __ Else.tmSnippet | 19 + .../Snippets/If.tmSnippet | 17 + .../Snippets/Interpolated Code.tmSnippet | 18 + .../Snippets/Object comprehension.tmSnippet | 17 + .../Range comprehension (exclusive).tmSnippet | 17 + .../Range comprehension (inclusive).tmSnippet | 17 + .../Snippets/Raw javascript.tmSnippet | 16 + .../Snippets/Switch.tmSnippet | 18 + .../Snippets/Ternary If.tmSnippet | 16 + .../Snippets/Try __ Catch.tmSnippet | 19 + .../Snippets/Unless.tmSnippet | 16 + .../Snippets/h1.tmSnippet | 16 + .../Snippets/h2.tmSnippet | 16 + .../Snippets/h3.tmSnippet | 16 + .../Snippets/log.tmSnippet | 16 + .../Snippets/require.tmSnippet | 16 + .../Syntaxes/CoffeeScript.tmLanguage | 736 +++++ .../CoffeeScriptBundle.tmbundle/info.plist | 114 + .../Commands/Check ERB Syntax.plist | 27 + .../Commands/Check Ruby Syntax.plist | 28 + .../Completion: Ruby (rcodetools).tmCommand | 72 + .../Convert Ruby hash to 1_9 syntax.tmCommand | 29 + .../Enclose in * (RDoc comments).tmCommand | 33 + .../Enclose in + (RDoc comments).tmCommand | 33 + .../Enclose in _ (RDoc comments).tmCommand | 33 + .../Commands/Execute Line with Ruby.plist | 47 + .../Execute and Insert Results.tmCommand | 29 + .../Commands/Insert Missing Requires.plist | 51 + .../Commands/Lookup in Documentation.plist | 24 + .../Commands/Make Destructive Call.plist | 29 + .../ruby.tmbundle/Commands/New Method.plist | 39 + .../Commands/Omit from RDoc.tmCommand | 31 + .../Commands/Open Require.tmCommand | 65 + .../Commands/Run Rake Task.tmCommand | 27 + .../Commands/Run focused unit test.plist | 35 + bundles/ruby.tmbundle/Commands/Run.tmCommand | 29 + .../Commands/Show RDoc for this file.plist | 37 + .../Commands/Toggle ERb Tags.tmCommand | 59 + .../Commands/Toggle Quote Style.plist | 55 + .../Commands/Toggle String:Symbol.tmCommand | 35 + .../Toggle ‘do … end’ : ‘{ … }’.tmCommand | 150 + .../Commands/word_wrap() (worw).plist | 31 + .../Require Ruby File.tmDragCommand | 39 + .../Benchmark_bmbm(__) do __ end.tmMacro | 54 + .../Macros/Delete forward:backward.tmMacro | 25 + .../Macros/Overwrite } in #{ .. }.plist | 54 + .../Macros/PStore_new( __ ).tmMacro | 51 + .../Macros/YAML.dump(.., file) (Yd).plist | 57 + .../Macros/YAML.load(file) (Yl).plist | 57 + ...eClass .. initialize .. end (class).plist | 63 + .../each_char { |chr| .. } (eac).plist | 55 + .../each_cons(..) { |group| .. } (eac).plist | 55 + ...each_slice(..) { |group| .. } (eas).plist | 55 + .../Macros/extend Forwardable (Forw).plist | 55 + ...ap_with_index { |e, i| .. } (mapwi).plist | 55 + .../Macros/require_gem \"__\".tmMacro" | 51 + .../ruby.tmbundle/Macros/xmlread(__).tmMacro | 51 + .../Preferences/Block typing pairs.plist | 42 + .../ruby.tmbundle/Preferences/Comments.plist | 38 + ...Completion: ENV[…] variables.tmPreferences | 17 + .../Completion: require strings.tmPreferences | 22 + .../Preferences/Miscellaneous.plist | 44 + .../Preferences/Symbo List: Method.plist | 19 + ...ymbol List: No Function Call.tmPreferences | 17 + .../Snippets/# encoding: UTF-8.tmSnippet | 17 + .../Snippets/#!;usr;local;bin;ruby -w.plist | 17 + .../Snippets/060 ruby if else.plist | 20 + .../ruby.tmbundle/Snippets/070 ruby if.plist | 18 + .../Snippets/080 ruby case.plist | 19 + .../Snippets/:yields: RDoc comment.tmSnippet | 16 + .../Snippets/Add '# =>' Marker.tmSnippet | 16 + .../Array.new(10) { |i| .. } (Arr).plist | 16 + .../Benchmark_bmbm(__) do __ end.tmSnippet | 19 + ...lob(\"..\") do |file| .. end (Dir).plist" | 16 + .../Snippets/Dir[\"__\"].tmSnippet" | 16 + ...h (\"..\") do |line| .. end (File).plist" | 16 + ...File_open(\"__\") { |file| __ }.tmSnippet" | 16 + .../Snippets/File_read(\"__\").tmSnippet" | 16 + ... |hash, key| hash[key] = .. } (Has).plist | 16 + ...sert ERb's <% __ %> or <%= __ %>.tmSnippet | 16 + .../Marshal.dump(obj, file) (Md).plist | 16 + .../Snippets/Marshal.load(obj) (Ml).plist | 16 + .../Snippets/PStore_new( __ ).tmSnippet | 16 + .../RDoc documentation block.tmSnippet | 20 + .../Wrap in Begin … Rescue … End.plist | 23 + .../Snippets/YAML.dump(.., file) (Yd-).plist | 16 + .../Snippets/YAML.load(file) (Yl-).plist | 16 + .../ruby.tmbundle/Snippets/__END__.tmSnippet | 17 + .../Snippets/alias_method .. (am).plist | 16 + .../Snippets/all? { |e| .. } (all).plist | 16 + .../Snippets/any? { |e| .. } (any).plist | 16 + .../Snippets/application_code .. (app).plist | 18 + .../Snippets/assert(..) (as).plist | 16 + .../Snippets/assert_equal.tmSnippet | 16 + .../assert_in_delta(..) (asid).plist | 16 + .../assert_instance_of(..) (asio).plist | 16 + .../Snippets/assert_kind_of(..) (asko).plist | 16 + .../Snippets/assert_match(..) (asm).plist | 16 + .../Snippets/assert_nil(..) (asn).plist | 16 + .../assert_no_match(..) (asnm).plist | 16 + .../assert_not_equal(..) (asne).plist | 16 + .../Snippets/assert_not_nil(..) (asnn).plist | 16 + .../assert_not_same(..) (asns).plist | 16 + ...rt_nothing_raised(..) { .. } (asnr).plist | 16 + ...assert_nothing_thrown { .. } (asnt).plist | 16 + .../Snippets/assert_operator(..) (aso).plist | 16 + .../assert_raise(..) { .. } (asr).plist | 16 + .../assert_respond_to(..) (asrt).plist | 16 + .../Snippets/assert_same(..) (ass).plist | 16 + .../Snippets/assert_send(..) (ass).plist | 16 + .../assert_throws(..) { .. } (ast).plist | 16 + .../Snippets/attr_accessor .. (rw).plist | 16 + .../Snippets/attr_reader .. (r).plist | 16 + .../Snippets/attr_writer .. (w).plist | 16 + ...eClass .. initialize .. end (class).plist | 24 + .... < ParentClass .. initialize .. end.plist | 22 + ...ass .. < Struct .. initialize .. end.plist | 22 + ... < Test;;Unit;;TestCase .. end (tc).plist | 24 + .../Snippets/class .. end (cla).plist | 18 + .../Snippets/class .. initialize .. end.plist | 22 + ... undef .. initialize .. end (class).plist | 30 + .../Snippets/class << self __ end.tmSnippet | 18 + .../Snippets/class_from_name() (clafn).plist | 16 + .../classify { |e| .. } (clas).plist | 16 + .../Snippets/collect { |e| .. } (col).plist | 16 + .../Snippets/deep_copy(..) (dee).plist | 16 + bundles/ruby.tmbundle/Snippets/def end.plist | 18 + .../Snippets/def initialize __ end.tmSnippet | 18 + .../def method_missing .. end (mm).plist | 18 + .../Snippets/def self .. end (defs).plist | 18 + .../Snippets/def test_ .. end (t).plist | 18 + .../Snippets/def_delegator .. (defd).plist | 16 + .../Snippets/def_delegators .. (defds).plist | 16 + .../Snippets/define_method ___ end.tmSnippet | 18 + .../delete_if { |e| .. } (deli).plist | 16 + .../Snippets/detect { |e| .. } (det).plist | 16 + .../Snippets/directory().tmSnippet | 16 + .../Snippets/do |obj| .. end (doo).plist | 18 + .../downto(0) { |n| .. } (dow).plist | 16 + .../Snippets/each { |e| .. } (ea).plist | 16 + .../each_byte { |byte| .. } (eab).plist | 16 + .../each_char { |chr| .. } (eac-).plist | 16 + ...each_cons(..) { |group| .. } (eac-).plist | 16 + .../each_index { |i| .. } (eai).plist | 16 + .../each_key { |key| .. } (eak).plist | 16 + .../each_line { |line| .. } (eal).plist | 16 + .../each_pair { |name, val| .. } (eap).plist | 16 + .../each_slice { |group| .. } (eas).plist | 16 + .../each_value { |val| .. } (eav).plist | 16 + ...ach_with_index { |e, i| .. } (eawi).plist | 16 + .../Snippets/elsif ___.tmSnippet | 17 + .../Snippets/embed string variable.plist | 16 + .../Snippets/extend Forwardable (Forw).plist | 16 + .../fetch(name) { |key| .. } (fet).plist | 16 + .../fill(range) { |i| .. } (fil).plist | 16 + .../Snippets/find { |e| .. } (fin).plist | 16 + .../find_all { |e| .. } (fina).plist | 16 + .../Snippets/flatten_once (fla).plist | 16 + .../Snippets/flunk(..) (fl).plist | 16 + ...rep(;pattern;) { |match| .. } (gre).plist | 16 + .../gsub(;..;) { |match| .. } (gsu).plist | 16 + .../Snippets/hash pair (:).plist | 16 + .../ruby.tmbundle/Snippets/hash pointer.plist | 16 + .../include Comparable .. (Comp).plist | 20 + .../include Enumerable .. (Enum).plist | 20 + ...nject(init) { |mem, var| .. } (inj).plist | 16 + .../lambda { |args| .. } (lam).plist | 16 + .../Snippets/loop { __ }.tmSnippet | 16 + .../Snippets/map { |e| .. } (map).plist | 16 + ...ap_with_index { |e, i| .. } (mapwi).plist | 16 + .../Snippets/max { |a, b| .. } (max).plist | 16 + .../Snippets/min { |a, b| .. } (min).plist | 16 + .../module .. ClassMethods .. end.plist | 29 + .../Snippets/module .. end.plist | 18 + .../module .. module_function .. end.plist | 20 + .../namespace :__ do __ end.tmSnippet | 18 + .../Snippets/open yield block ({).plist | 16 + ...url\", \"w\") do |doc| .. end (ope).plist" | 16 + .../option_parse { .. } (optp).plist | 43 + .../partition { |e| .. } (par).plist | 16 + .../ruby.tmbundle/Snippets/pass(__).tmSnippet | 16 + .../Snippets/path_from_here( __ ).tmSnippet | 16 + .../Snippets/randomize (ran).plist | 16 + .../Snippets/reject { |e| .. } (rej).plist | 16 + .../Snippets/require \"..\" (req).plist" | 16 + .../require \"tc_..\" .. (ts).plist" | 20 + .../Snippets/require_gem \"__\".tmSnippet" | 16 + .../results_report(__) { __ }.tmSnippet | 16 + .../reverse_each { |e| .. } (rea).plist | 16 + .../scan(;..;) { |match| .. } (sca).plist | 16 + .../Snippets/select { |e| .. } (sel).plist | 16 + .../Snippets/singleton_class().tmSnippet | 16 + .../ruby.tmbundle/Snippets/skip(__).tmSnippet | 16 + .../Snippets/sort { |a, b| .. } (sor).plist | 16 + .../Snippets/sort_by { |e| .. } (sorb).plist | 16 + .../Snippets/step(2) { |e| .. } (ste).plist | 16 + .../sub(;..;) { |match| .. } (sub).plist | 16 + ...> [:dependent, :tasks] do __ end.tmSnippet | 19 + .../Snippets/times { |n| .. } (tim).plist | 16 + .../transaction( __ ) do __ end.tmSnippet | 16 + .../Snippets/unix_filter .. (uni).plist | 18 + .../Snippets/unless (unless).plist | 18 + .../Snippets/until ___ end.tmSnippet | 18 + bundles/ruby.tmbundle/Snippets/untitled.plist | 19 + .../upto(1.0;0.0) { |n| .. } (upt).plist | 16 + .../Snippets/usage_if() (usai).plist | 18 + .../Snippets/usage_unless() (usau).plist | 18 + bundles/ruby.tmbundle/Snippets/when.plist | 17 + .../Snippets/while ___ end.tmSnippet | 18 + .../Snippets/xmlread(__).tmSnippet | 16 + .../Snippets/xpath(__) { __ }.tmSnippet | 18 + .../zip(enums) { |row| .. } (zip).plist | 16 + .../Support/RakeMate/rake_mate.rb | 100 + .../Support/RakeMate/run_rake_task.rb | 47 + .../Support/RubyMate/catch_exception.rb | 41 + .../Support/RubyMate/run_script.rb | 133 + .../ruby.tmbundle/Support/RubyMate/test.rb | 19 + .../ruby.tmbundle/Support/RubyMate/todo.txt | 13 + .../Support/bin/insert_requires.rb | 104 + .../ruby.tmbundle/Support/bin/linked_ri.rb | 153 + .../Support/bin/make_destructive.rb | 18 + .../Support/bin/snippet_paren.rb | 10 + .../Support/lib/ruby_requires.rb | 26 + bundles/ruby.tmbundle/Support/vendor/README | 3 + .../Support/vendor/rcodetools/CHANGES | 70 + .../Support/vendor/rcodetools/README | 98 + .../Support/vendor/rcodetools/README.TDC | 158 + .../Support/vendor/rcodetools/README.emacs | 75 + .../Support/vendor/rcodetools/README.ja | 84 + .../vendor/rcodetools/README.method_analysis | 13 + .../Support/vendor/rcodetools/README.vim | 111 + .../vendor/rcodetools/README.xmpfilter | 287 ++ .../Support/vendor/rcodetools/Rakefile | 121 + .../rcodetools/Rakefile.method_analysis | 30 + .../Support/vendor/rcodetools/THANKS | 11 + .../vendor/rcodetools/anything-rcodetools.el | 151 + .../Support/vendor/rcodetools/bin/rbtest | 266 ++ .../vendor/rcodetools/bin/rct-complete | 45 + .../Support/vendor/rcodetools/bin/rct-doc | 52 + .../Support/vendor/rcodetools/bin/rct-fork | 6 + .../vendor/rcodetools/bin/rct-fork-client | 5 + .../vendor/rcodetools/bin/rct-meth-args | 442 +++ .../vendor/rcodetools/bin/ruby-toggle-file | 26 + .../Support/vendor/rcodetools/bin/xmpfilter | 85 + .../vendor/rcodetools/icicles-rcodetools.el | 35 + .../vendor/rcodetools/lib/method_analyzer.rb | 107 + .../rcodetools/lib/rcodetools/compat.rb | 14 + .../rcodetools/lib/rcodetools/completion.rb | 406 +++ .../vendor/rcodetools/lib/rcodetools/doc.rb | 168 + .../vendor/rcodetools/lib/rcodetools/fork.rb | 210 ++ .../rcodetools/lib/rcodetools/fork_config.rb | 26 + .../rcodetools/lib/rcodetools/options.rb | 136 + .../rcodetools/lib/rcodetools/xmpfilter.rb | 379 +++ .../lib/rcodetools/xmptestunitfilter.rb | 314 ++ .../vendor/rcodetools/lib/ruby_toggle_file.rb | 99 + .../Support/vendor/rcodetools/license.txt | 8 + .../Support/vendor/rcodetools/rcodetools.el | 430 +++ .../Support/vendor/rcodetools/rcodetools.elc | Bin 0 -> 14540 bytes .../Support/vendor/rcodetools/rcodetools.gif | Bin 0 -> 32432 bytes .../Support/vendor/rcodetools/rcodetools.sxmp | Bin 0 -> 4859 bytes .../Support/vendor/rcodetools/rcodetools.vim | 173 + .../Support/vendor/rcodetools/setup.rb | 1585 +++++++++ .../vendor/rcodetools/test/attic/test_run.rb | 45 + .../test/data/attic/add_markers-input.rb | 2 + .../test/data/attic/add_markers-output.rb | 2 + .../test/data/attic/bindings-input.rb | 26 + .../test/data/attic/bindings-output.rb | 31 + .../test/data/attic/completion-input.rb | 1 + .../test/data/attic/completion-output.rb | 2 + .../data/attic/completion_class_info-input.rb | 1 + .../attic/completion_class_info-output.rb | 10 + ...mpletion_class_info_no_candidates-input.rb | 1 + ...pletion_class_info_no_candidates-output.rb | 1 + .../attic/completion_detect_rbtest-input.rb | 7 + .../attic/completion_detect_rbtest-output.rb | 2 + .../attic/completion_detect_rbtest2-input.rb | 1 + .../attic/completion_detect_rbtest2-output.rb | 2 + .../test/data/attic/completion_emacs-input.rb | 1 + .../data/attic/completion_emacs-output.rb | 6 + .../attic/completion_emacs_icicles-input.rb | 1 + .../attic/completion_emacs_icicles-output.rb | 6 + .../data/attic/completion_in_method-input.rb | 3 + .../data/attic/completion_in_method-output.rb | 1 + .../data/attic/completion_in_method-test.rb | 6 + .../data/attic/completion_rbtest-input.rb | 7 + .../data/attic/completion_rbtest-output.rb | 2 + .../rcodetools/test/data/attic/doc-input.rb | 1 + .../rcodetools/test/data/attic/doc-output.rb | 1 + .../data/attic/doc_detect_rbtest-input.rb | 1 + .../data/attic/doc_detect_rbtest-output.rb | 1 + .../data/attic/doc_detect_rbtest2-input.rb | 7 + .../data/attic/doc_detect_rbtest2-output.rb | 1 + .../test/data/attic/doc_rbtest-input.rb | 7 + .../test/data/attic/doc_rbtest-output.rb | 1 + .../test/data/attic/no_warnings-input.rb | 3 + .../test/data/attic/no_warnings-output.rb | 4 + .../rcodetools/test/data/attic/refe-input.rb | 1 + .../rcodetools/test/data/attic/refe-output.rb | 1 + .../rcodetools/test/data/attic/ri-input.rb | 1 + .../rcodetools/test/data/attic/ri-output.rb | 1 + .../test/data/attic/ri_emacs-input.rb | 1 + .../test/data/attic/ri_emacs-output.rb | 1 + .../test/data/attic/ri_vim-input.rb | 1 + .../test/data/attic/ri_vim-output.rb | 1 + .../rcodetools/test/data/attic/rspec-input.rb | 48 + .../test/data/attic/rspec-output.rb | 52 + .../test/data/attic/rspec_poetry-input.rb | 48 + .../test/data/attic/rspec_poetry-output.rb | 52 + .../data/attic/simple_annotation-input.rb | 8 + .../data/attic/simple_annotation-output.rb | 8 + .../test/data/attic/unit_test-input.rb | 50 + .../test/data/attic/unit_test-output.rb | 52 + .../attic/unit_test_detect_rbtest-input.rb | 50 + .../attic/unit_test_detect_rbtest-output.rb | 52 + .../attic/unit_test_detect_rbtest2-input.rb | 6 + .../attic/unit_test_detect_rbtest2-output.rb | 6 + .../test/data/attic/unit_test_poetry-input.rb | 50 + .../data/attic/unit_test_poetry-output.rb | 52 + .../test/data/attic/unit_test_rbtest-input.rb | 6 + .../data/attic/unit_test_rbtest-output.rb | 6 + .../test/data/method_analyzer-data.rb | 33 + .../rcodetools/test/data/method_args.data.rb | 106 + .../completion_in_method__testmethod.taf | 17 + .../completion_in_method__testscript.taf | 17 + ...completion_in_method__wrong_testmethod.taf | 17 + .../test/data/rct-complete/completion.taf | 9 + .../rct-complete/completion_class_info.taf | 9 + .../completion_class_info_no_candidates.taf | 8 + .../rct-complete/completion_detect_rbtest.taf | 15 + .../completion_detect_rbtest2.taf | 9 + .../data/rct-complete/completion_emacs.taf | 13 + .../rct-complete/completion_emacs_icicles.taf | 13 + .../data/rct-complete/completion_rbtest.taf | 15 + .../rcodetools/test/data/rct-doc/doc.taf | 8 + .../test/data/rct-doc/doc_detect_rbtest.taf | 8 + .../test/data/rct-doc/doc_detect_rbtest2.taf | 14 + .../test/data/rct-doc/doc_rbtest.taf | 14 + .../rcodetools/test/data/rct-doc/refe.taf | 8 + .../rcodetools/test/data/rct-doc/ri.taf | 8 + .../rcodetools/test/data/rct-doc/ri_emacs.taf | 8 + .../rcodetools/test/data/rct-doc/ri_vim.taf | 8 + .../test/data/sample_test_script.rb | 9 + .../test/data/xmpfilter/add_markers.taf | 10 + .../test/data/xmpfilter/bindings.taf | 63 + .../test/data/xmpfilter/comment_out.taf | 22 + .../test/data/xmpfilter/exception.taf | 14 + .../test/data/xmpfilter/expectations.taf | 54 + .../test/data/xmpfilter/last_match.taf | 18 + .../rcodetools/test/data/xmpfilter/mult.rb | 9 + .../xmpfilter/multi_line_annotation_1.taf | 22 + .../xmpfilter/multi_line_annotation_2.taf | 24 + .../xmpfilter/multi_line_annotation_3.taf | 20 + .../xmpfilter/multi_line_annotation_4.taf | 22 + .../xmpfilter/multi_line_annotation_5.taf | 34 + .../xmpfilter/multi_line_annotation_6.taf | 12 + .../xmpfilter/multi_line_annotation_7.taf | 23 + .../test/data/xmpfilter/no_warnings.taf | 13 + .../test/data/xmpfilter/nospace.taf | 16 + .../rcodetools/test/data/xmpfilter/rspec.taf | 106 + .../test/data/xmpfilter/rspec_poetry.taf | 106 + .../test/data/xmpfilter/simple_annotation.taf | 22 + .../test/data/xmpfilter/unit_test.taf | 108 + .../xmpfilter/unit_test_detect_rbtest.taf | 108 + .../xmpfilter/unit_test_detect_rbtest2.taf | 18 + .../test/data/xmpfilter/unit_test_poetry.taf | 108 + .../test/data/xmpfilter/unit_test_rbtest.taf | 18 + .../rcodetools/test/data/xmpfilter/width.taf | 16 + .../vendor/rcodetools/test/test_completion.rb | 674 ++++ .../vendor/rcodetools/test/test_doc.rb | 446 +++ .../vendor/rcodetools/test/test_functional.rb | 47 + .../rcodetools/test/test_method_analyzer.rb | 107 + .../rcodetools/test/test_method_args.rb | 134 + .../vendor/rcodetools/test/test_options.rb | 33 + .../rcodetools/test/test_ruby_toggle_file.rb | 174 + .../vendor/rcodetools/test/test_xmpfilter.rb | 221 ++ .../rcodetools/test/test_xmptestunitfilter.rb | 86 + .../vendor/rcodetools/test/tmp_functional.rb | 162 + .../Support/vendor/rcodetools/test/tmp_run.rb | 66 + bundles/ruby.tmbundle/Syntaxes/Ruby.plist | 2853 +++++++++++++++++ .../ruby.tmbundle/Tests/division_ambiguity.rb | 88 + .../ruby.tmbundle/Tests/modulo_ambiguity1.rb | 76 + .../Tests/questionmark_ambiguity1.rb | 160 + bundles/ruby.tmbundle/Tests/rubylexer/COPYING | 510 +++ bundles/ruby.tmbundle/Tests/rubylexer/g.rb | 14 + .../Tests/rubylexer/newsyntax.rb | 18 + bundles/ruby.tmbundle/Tests/rubylexer/p.rb | 1122 +++++++ .../ruby.tmbundle/Tests/rubylexer/regtest.rb | 621 ++++ bundles/ruby.tmbundle/Tests/rubylexer/w.rb | 22 + bundles/ruby.tmbundle/Tests/test1.rb | 302 ++ bundles/ruby.tmbundle/info.plist | 636 ++++ 411 files changed, 23845 insertions(+) create mode 100644 bundles/CoffeeScriptBundle.tmbundle/.gitignore create mode 100644 bundles/CoffeeScriptBundle.tmbundle/Commands/Align Assignments.tmCommand create mode 100644 bundles/CoffeeScriptBundle.tmbundle/Commands/CoffeeScript.sublime-build create mode 100644 bundles/CoffeeScriptBundle.tmbundle/Commands/Compile and Display JS.tmCommand create mode 100644 bundles/CoffeeScriptBundle.tmbundle/Commands/Insert Heredoc comment.tmCommand create mode 100644 bundles/CoffeeScriptBundle.tmbundle/Commands/Insert Heredoc triple double quotes.tmCommand create mode 100644 bundles/CoffeeScriptBundle.tmbundle/Commands/Insert Heredoc triple single quotes.tmCommand create mode 100644 bundles/CoffeeScriptBundle.tmbundle/Commands/New Function.tmCommand create mode 100644 bundles/CoffeeScriptBundle.tmbundle/Commands/Run selected text.tmCommand create mode 100644 bundles/CoffeeScriptBundle.tmbundle/Commands/Run.tmCommand create mode 100644 bundles/CoffeeScriptBundle.tmbundle/Preferences/CoffeeScript.tmPreferences create mode 100644 bundles/CoffeeScriptBundle.tmbundle/Preferences/Disable Indent Corrections.tmPreferences create mode 100644 bundles/CoffeeScriptBundle.tmbundle/Preferences/Indent.tmPreferences create mode 100644 bundles/CoffeeScriptBundle.tmbundle/Preferences/Symbol List Method 2.tmPreferences create mode 100644 bundles/CoffeeScriptBundle.tmbundle/Preferences/Symbol List Method.tmPreferences create mode 100644 bundles/CoffeeScriptBundle.tmbundle/README.markdown create mode 100644 bundles/CoffeeScriptBundle.tmbundle/Snippets/Array comprehension.tmSnippet create mode 100644 bundles/CoffeeScriptBundle.tmbundle/Snippets/Bound Function.tmSnippet create mode 100644 bundles/CoffeeScriptBundle.tmbundle/Snippets/Class.tmSnippet create mode 100644 bundles/CoffeeScriptBundle.tmbundle/Snippets/Else if.tmSnippet create mode 100644 bundles/CoffeeScriptBundle.tmbundle/Snippets/Function.tmSnippet create mode 100644 bundles/CoffeeScriptBundle.tmbundle/Snippets/If __ Else.tmSnippet create mode 100644 bundles/CoffeeScriptBundle.tmbundle/Snippets/If.tmSnippet create mode 100644 bundles/CoffeeScriptBundle.tmbundle/Snippets/Interpolated Code.tmSnippet create mode 100644 bundles/CoffeeScriptBundle.tmbundle/Snippets/Object comprehension.tmSnippet create mode 100644 bundles/CoffeeScriptBundle.tmbundle/Snippets/Range comprehension (exclusive).tmSnippet create mode 100644 bundles/CoffeeScriptBundle.tmbundle/Snippets/Range comprehension (inclusive).tmSnippet create mode 100644 bundles/CoffeeScriptBundle.tmbundle/Snippets/Raw javascript.tmSnippet create mode 100644 bundles/CoffeeScriptBundle.tmbundle/Snippets/Switch.tmSnippet create mode 100644 bundles/CoffeeScriptBundle.tmbundle/Snippets/Ternary If.tmSnippet create mode 100644 bundles/CoffeeScriptBundle.tmbundle/Snippets/Try __ Catch.tmSnippet create mode 100644 bundles/CoffeeScriptBundle.tmbundle/Snippets/Unless.tmSnippet create mode 100644 bundles/CoffeeScriptBundle.tmbundle/Snippets/h1.tmSnippet create mode 100644 bundles/CoffeeScriptBundle.tmbundle/Snippets/h2.tmSnippet create mode 100644 bundles/CoffeeScriptBundle.tmbundle/Snippets/h3.tmSnippet create mode 100644 bundles/CoffeeScriptBundle.tmbundle/Snippets/log.tmSnippet create mode 100644 bundles/CoffeeScriptBundle.tmbundle/Snippets/require.tmSnippet create mode 100644 bundles/CoffeeScriptBundle.tmbundle/Syntaxes/CoffeeScript.tmLanguage create mode 100644 bundles/CoffeeScriptBundle.tmbundle/info.plist create mode 100644 bundles/ruby.tmbundle/Commands/Check ERB Syntax.plist create mode 100644 bundles/ruby.tmbundle/Commands/Check Ruby Syntax.plist create mode 100644 bundles/ruby.tmbundle/Commands/Completion: Ruby (rcodetools).tmCommand create mode 100644 bundles/ruby.tmbundle/Commands/Convert Ruby hash to 1_9 syntax.tmCommand create mode 100644 bundles/ruby.tmbundle/Commands/Enclose in * (RDoc comments).tmCommand create mode 100644 bundles/ruby.tmbundle/Commands/Enclose in + (RDoc comments).tmCommand create mode 100644 bundles/ruby.tmbundle/Commands/Enclose in _ (RDoc comments).tmCommand create mode 100644 bundles/ruby.tmbundle/Commands/Execute Line with Ruby.plist create mode 100644 bundles/ruby.tmbundle/Commands/Execute and Insert Results.tmCommand create mode 100644 bundles/ruby.tmbundle/Commands/Insert Missing Requires.plist create mode 100644 bundles/ruby.tmbundle/Commands/Lookup in Documentation.plist create mode 100644 bundles/ruby.tmbundle/Commands/Make Destructive Call.plist create mode 100644 bundles/ruby.tmbundle/Commands/New Method.plist create mode 100644 bundles/ruby.tmbundle/Commands/Omit from RDoc.tmCommand create mode 100644 bundles/ruby.tmbundle/Commands/Open Require.tmCommand create mode 100644 bundles/ruby.tmbundle/Commands/Run Rake Task.tmCommand create mode 100644 bundles/ruby.tmbundle/Commands/Run focused unit test.plist create mode 100644 bundles/ruby.tmbundle/Commands/Run.tmCommand create mode 100644 bundles/ruby.tmbundle/Commands/Show RDoc for this file.plist create mode 100644 bundles/ruby.tmbundle/Commands/Toggle ERb Tags.tmCommand create mode 100644 bundles/ruby.tmbundle/Commands/Toggle Quote Style.plist create mode 100644 bundles/ruby.tmbundle/Commands/Toggle String:Symbol.tmCommand create mode 100644 bundles/ruby.tmbundle/Commands/Toggle ‘do … end’ : ‘{ … }’.tmCommand create mode 100644 bundles/ruby.tmbundle/Commands/word_wrap() (worw).plist create mode 100644 bundles/ruby.tmbundle/DragCommands/Require Ruby File.tmDragCommand create mode 100644 bundles/ruby.tmbundle/Macros/Benchmark_bmbm(__) do __ end.tmMacro create mode 100644 bundles/ruby.tmbundle/Macros/Delete forward:backward.tmMacro create mode 100644 bundles/ruby.tmbundle/Macros/Overwrite } in #{ .. }.plist create mode 100644 bundles/ruby.tmbundle/Macros/PStore_new( __ ).tmMacro create mode 100644 bundles/ruby.tmbundle/Macros/YAML.dump(.., file) (Yd).plist create mode 100644 bundles/ruby.tmbundle/Macros/YAML.load(file) (Yl).plist create mode 100644 bundles/ruby.tmbundle/Macros/class .. < DelegateClass .. initialize .. end (class).plist create mode 100644 bundles/ruby.tmbundle/Macros/each_char { |chr| .. } (eac).plist create mode 100644 bundles/ruby.tmbundle/Macros/each_cons(..) { |group| .. } (eac).plist create mode 100644 bundles/ruby.tmbundle/Macros/each_slice(..) { |group| .. } (eas).plist create mode 100644 bundles/ruby.tmbundle/Macros/extend Forwardable (Forw).plist create mode 100644 bundles/ruby.tmbundle/Macros/map_with_index { |e, i| .. } (mapwi).plist create mode 100644 "bundles/ruby.tmbundle/Macros/require_gem \"__\".tmMacro" create mode 100644 bundles/ruby.tmbundle/Macros/xmlread(__).tmMacro create mode 100644 bundles/ruby.tmbundle/Preferences/Block typing pairs.plist create mode 100644 bundles/ruby.tmbundle/Preferences/Comments.plist create mode 100644 bundles/ruby.tmbundle/Preferences/Completion: ENV[…] variables.tmPreferences create mode 100644 bundles/ruby.tmbundle/Preferences/Completion: require strings.tmPreferences create mode 100644 bundles/ruby.tmbundle/Preferences/Miscellaneous.plist create mode 100644 bundles/ruby.tmbundle/Preferences/Symbo List: Method.plist create mode 100644 bundles/ruby.tmbundle/Preferences/Symbol List: No Function Call.tmPreferences create mode 100644 bundles/ruby.tmbundle/Snippets/# encoding: UTF-8.tmSnippet create mode 100644 bundles/ruby.tmbundle/Snippets/#!;usr;local;bin;ruby -w.plist create mode 100644 bundles/ruby.tmbundle/Snippets/060 ruby if else.plist create mode 100644 bundles/ruby.tmbundle/Snippets/070 ruby if.plist create mode 100644 bundles/ruby.tmbundle/Snippets/080 ruby case.plist create mode 100644 bundles/ruby.tmbundle/Snippets/:yields: RDoc comment.tmSnippet create mode 100644 bundles/ruby.tmbundle/Snippets/Add '# =>' Marker.tmSnippet create mode 100644 bundles/ruby.tmbundle/Snippets/Array.new(10) { |i| .. } (Arr).plist create mode 100644 bundles/ruby.tmbundle/Snippets/Benchmark_bmbm(__) do __ end.tmSnippet create mode 100644 "bundles/ruby.tmbundle/Snippets/Dir.glob(\"..\") do |file| .. end (Dir).plist" create mode 100644 "bundles/ruby.tmbundle/Snippets/Dir[\"__\"].tmSnippet" create mode 100644 "bundles/ruby.tmbundle/Snippets/File.foreach (\"..\") do |line| .. end (File).plist" create mode 100644 "bundles/ruby.tmbundle/Snippets/File_open(\"__\") { |file| __ }.tmSnippet" create mode 100644 "bundles/ruby.tmbundle/Snippets/File_read(\"__\").tmSnippet" create mode 100644 bundles/ruby.tmbundle/Snippets/Hash.new { |hash, key| hash[key] = .. } (Has).plist create mode 100644 bundles/ruby.tmbundle/Snippets/Insert ERb's <% __ %> or <%= __ %>.tmSnippet create mode 100644 bundles/ruby.tmbundle/Snippets/Marshal.dump(obj, file) (Md).plist create mode 100644 bundles/ruby.tmbundle/Snippets/Marshal.load(obj) (Ml).plist create mode 100644 bundles/ruby.tmbundle/Snippets/PStore_new( __ ).tmSnippet create mode 100644 bundles/ruby.tmbundle/Snippets/RDoc documentation block.tmSnippet create mode 100644 bundles/ruby.tmbundle/Snippets/Wrap in Begin … Rescue … End.plist create mode 100644 bundles/ruby.tmbundle/Snippets/YAML.dump(.., file) (Yd-).plist create mode 100644 bundles/ruby.tmbundle/Snippets/YAML.load(file) (Yl-).plist create mode 100644 bundles/ruby.tmbundle/Snippets/__END__.tmSnippet create mode 100644 bundles/ruby.tmbundle/Snippets/alias_method .. (am).plist create mode 100644 bundles/ruby.tmbundle/Snippets/all? { |e| .. } (all).plist create mode 100644 bundles/ruby.tmbundle/Snippets/any? { |e| .. } (any).plist create mode 100644 bundles/ruby.tmbundle/Snippets/application_code .. (app).plist create mode 100644 bundles/ruby.tmbundle/Snippets/assert(..) (as).plist create mode 100644 bundles/ruby.tmbundle/Snippets/assert_equal.tmSnippet create mode 100644 bundles/ruby.tmbundle/Snippets/assert_in_delta(..) (asid).plist create mode 100644 bundles/ruby.tmbundle/Snippets/assert_instance_of(..) (asio).plist create mode 100644 bundles/ruby.tmbundle/Snippets/assert_kind_of(..) (asko).plist create mode 100644 bundles/ruby.tmbundle/Snippets/assert_match(..) (asm).plist create mode 100644 bundles/ruby.tmbundle/Snippets/assert_nil(..) (asn).plist create mode 100644 bundles/ruby.tmbundle/Snippets/assert_no_match(..) (asnm).plist create mode 100644 bundles/ruby.tmbundle/Snippets/assert_not_equal(..) (asne).plist create mode 100644 bundles/ruby.tmbundle/Snippets/assert_not_nil(..) (asnn).plist create mode 100644 bundles/ruby.tmbundle/Snippets/assert_not_same(..) (asns).plist create mode 100644 bundles/ruby.tmbundle/Snippets/assert_nothing_raised(..) { .. } (asnr).plist create mode 100644 bundles/ruby.tmbundle/Snippets/assert_nothing_thrown { .. } (asnt).plist create mode 100644 bundles/ruby.tmbundle/Snippets/assert_operator(..) (aso).plist create mode 100644 bundles/ruby.tmbundle/Snippets/assert_raise(..) { .. } (asr).plist create mode 100644 bundles/ruby.tmbundle/Snippets/assert_respond_to(..) (asrt).plist create mode 100644 bundles/ruby.tmbundle/Snippets/assert_same(..) (ass).plist create mode 100644 bundles/ruby.tmbundle/Snippets/assert_send(..) (ass).plist create mode 100644 bundles/ruby.tmbundle/Snippets/assert_throws(..) { .. } (ast).plist create mode 100644 bundles/ruby.tmbundle/Snippets/attr_accessor .. (rw).plist create mode 100644 bundles/ruby.tmbundle/Snippets/attr_reader .. (r).plist create mode 100644 bundles/ruby.tmbundle/Snippets/attr_writer .. (w).plist create mode 100644 bundles/ruby.tmbundle/Snippets/class .. < DelegateClass .. initialize .. end (class).plist create mode 100644 bundles/ruby.tmbundle/Snippets/class .. < ParentClass .. initialize .. end.plist create mode 100644 bundles/ruby.tmbundle/Snippets/class .. < Struct .. initialize .. end.plist create mode 100644 bundles/ruby.tmbundle/Snippets/class .. < Test;;Unit;;TestCase .. end (tc).plist create mode 100644 bundles/ruby.tmbundle/Snippets/class .. end (cla).plist create mode 100644 bundles/ruby.tmbundle/Snippets/class .. initialize .. end.plist create mode 100644 bundles/ruby.tmbundle/Snippets/class .. instance_methods .. undef .. initialize .. end (class).plist create mode 100644 bundles/ruby.tmbundle/Snippets/class << self __ end.tmSnippet create mode 100644 bundles/ruby.tmbundle/Snippets/class_from_name() (clafn).plist create mode 100644 bundles/ruby.tmbundle/Snippets/classify { |e| .. } (clas).plist create mode 100644 bundles/ruby.tmbundle/Snippets/collect { |e| .. } (col).plist create mode 100644 bundles/ruby.tmbundle/Snippets/deep_copy(..) (dee).plist create mode 100644 bundles/ruby.tmbundle/Snippets/def end.plist create mode 100644 bundles/ruby.tmbundle/Snippets/def initialize __ end.tmSnippet create mode 100644 bundles/ruby.tmbundle/Snippets/def method_missing .. end (mm).plist create mode 100644 bundles/ruby.tmbundle/Snippets/def self .. end (defs).plist create mode 100644 bundles/ruby.tmbundle/Snippets/def test_ .. end (t).plist create mode 100644 bundles/ruby.tmbundle/Snippets/def_delegator .. (defd).plist create mode 100644 bundles/ruby.tmbundle/Snippets/def_delegators .. (defds).plist create mode 100644 bundles/ruby.tmbundle/Snippets/define_method ___ end.tmSnippet create mode 100644 bundles/ruby.tmbundle/Snippets/delete_if { |e| .. } (deli).plist create mode 100644 bundles/ruby.tmbundle/Snippets/detect { |e| .. } (det).plist create mode 100644 bundles/ruby.tmbundle/Snippets/directory().tmSnippet create mode 100644 bundles/ruby.tmbundle/Snippets/do |obj| .. end (doo).plist create mode 100644 bundles/ruby.tmbundle/Snippets/downto(0) { |n| .. } (dow).plist create mode 100644 bundles/ruby.tmbundle/Snippets/each { |e| .. } (ea).plist create mode 100644 bundles/ruby.tmbundle/Snippets/each_byte { |byte| .. } (eab).plist create mode 100644 bundles/ruby.tmbundle/Snippets/each_char { |chr| .. } (eac-).plist create mode 100644 bundles/ruby.tmbundle/Snippets/each_cons(..) { |group| .. } (eac-).plist create mode 100644 bundles/ruby.tmbundle/Snippets/each_index { |i| .. } (eai).plist create mode 100644 bundles/ruby.tmbundle/Snippets/each_key { |key| .. } (eak).plist create mode 100644 bundles/ruby.tmbundle/Snippets/each_line { |line| .. } (eal).plist create mode 100644 bundles/ruby.tmbundle/Snippets/each_pair { |name, val| .. } (eap).plist create mode 100644 bundles/ruby.tmbundle/Snippets/each_slice { |group| .. } (eas).plist create mode 100644 bundles/ruby.tmbundle/Snippets/each_value { |val| .. } (eav).plist create mode 100644 bundles/ruby.tmbundle/Snippets/each_with_index { |e, i| .. } (eawi).plist create mode 100644 bundles/ruby.tmbundle/Snippets/elsif ___.tmSnippet create mode 100644 bundles/ruby.tmbundle/Snippets/embed string variable.plist create mode 100644 bundles/ruby.tmbundle/Snippets/extend Forwardable (Forw).plist create mode 100644 bundles/ruby.tmbundle/Snippets/fetch(name) { |key| .. } (fet).plist create mode 100644 bundles/ruby.tmbundle/Snippets/fill(range) { |i| .. } (fil).plist create mode 100644 bundles/ruby.tmbundle/Snippets/find { |e| .. } (fin).plist create mode 100644 bundles/ruby.tmbundle/Snippets/find_all { |e| .. } (fina).plist create mode 100644 bundles/ruby.tmbundle/Snippets/flatten_once (fla).plist create mode 100644 bundles/ruby.tmbundle/Snippets/flunk(..) (fl).plist create mode 100644 bundles/ruby.tmbundle/Snippets/grep(;pattern;) { |match| .. } (gre).plist create mode 100644 bundles/ruby.tmbundle/Snippets/gsub(;..;) { |match| .. } (gsu).plist create mode 100644 bundles/ruby.tmbundle/Snippets/hash pair (:).plist create mode 100644 bundles/ruby.tmbundle/Snippets/hash pointer.plist create mode 100644 bundles/ruby.tmbundle/Snippets/include Comparable .. (Comp).plist create mode 100644 bundles/ruby.tmbundle/Snippets/include Enumerable .. (Enum).plist create mode 100644 bundles/ruby.tmbundle/Snippets/inject(init) { |mem, var| .. } (inj).plist create mode 100644 bundles/ruby.tmbundle/Snippets/lambda { |args| .. } (lam).plist create mode 100644 bundles/ruby.tmbundle/Snippets/loop { __ }.tmSnippet create mode 100644 bundles/ruby.tmbundle/Snippets/map { |e| .. } (map).plist create mode 100644 bundles/ruby.tmbundle/Snippets/map_with_index { |e, i| .. } (mapwi).plist create mode 100644 bundles/ruby.tmbundle/Snippets/max { |a, b| .. } (max).plist create mode 100644 bundles/ruby.tmbundle/Snippets/min { |a, b| .. } (min).plist create mode 100644 bundles/ruby.tmbundle/Snippets/module .. ClassMethods .. end.plist create mode 100644 bundles/ruby.tmbundle/Snippets/module .. end.plist create mode 100644 bundles/ruby.tmbundle/Snippets/module .. module_function .. end.plist create mode 100644 bundles/ruby.tmbundle/Snippets/namespace :__ do __ end.tmSnippet create mode 100644 bundles/ruby.tmbundle/Snippets/open yield block ({).plist create mode 100644 "bundles/ruby.tmbundle/Snippets/open(\"path;or;url\", \"w\") do |doc| .. end (ope).plist" create mode 100644 bundles/ruby.tmbundle/Snippets/option_parse { .. } (optp).plist create mode 100644 bundles/ruby.tmbundle/Snippets/partition { |e| .. } (par).plist create mode 100644 bundles/ruby.tmbundle/Snippets/pass(__).tmSnippet create mode 100644 bundles/ruby.tmbundle/Snippets/path_from_here( __ ).tmSnippet create mode 100644 bundles/ruby.tmbundle/Snippets/randomize (ran).plist create mode 100644 bundles/ruby.tmbundle/Snippets/reject { |e| .. } (rej).plist create mode 100644 "bundles/ruby.tmbundle/Snippets/require \"..\" (req).plist" create mode 100644 "bundles/ruby.tmbundle/Snippets/require \"tc_..\" .. (ts).plist" create mode 100644 "bundles/ruby.tmbundle/Snippets/require_gem \"__\".tmSnippet" create mode 100644 bundles/ruby.tmbundle/Snippets/results_report(__) { __ }.tmSnippet create mode 100644 bundles/ruby.tmbundle/Snippets/reverse_each { |e| .. } (rea).plist create mode 100644 bundles/ruby.tmbundle/Snippets/scan(;..;) { |match| .. } (sca).plist create mode 100644 bundles/ruby.tmbundle/Snippets/select { |e| .. } (sel).plist create mode 100644 bundles/ruby.tmbundle/Snippets/singleton_class().tmSnippet create mode 100644 bundles/ruby.tmbundle/Snippets/skip(__).tmSnippet create mode 100644 bundles/ruby.tmbundle/Snippets/sort { |a, b| .. } (sor).plist create mode 100644 bundles/ruby.tmbundle/Snippets/sort_by { |e| .. } (sorb).plist create mode 100644 bundles/ruby.tmbundle/Snippets/step(2) { |e| .. } (ste).plist create mode 100644 bundles/ruby.tmbundle/Snippets/sub(;..;) { |match| .. } (sub).plist create mode 100644 bundles/ruby.tmbundle/Snippets/task :task_name => [:dependent, :tasks] do __ end.tmSnippet create mode 100644 bundles/ruby.tmbundle/Snippets/times { |n| .. } (tim).plist create mode 100644 bundles/ruby.tmbundle/Snippets/transaction( __ ) do __ end.tmSnippet create mode 100644 bundles/ruby.tmbundle/Snippets/unix_filter .. (uni).plist create mode 100644 bundles/ruby.tmbundle/Snippets/unless (unless).plist create mode 100644 bundles/ruby.tmbundle/Snippets/until ___ end.tmSnippet create mode 100644 bundles/ruby.tmbundle/Snippets/untitled.plist create mode 100644 bundles/ruby.tmbundle/Snippets/upto(1.0;0.0) { |n| .. } (upt).plist create mode 100644 bundles/ruby.tmbundle/Snippets/usage_if() (usai).plist create mode 100644 bundles/ruby.tmbundle/Snippets/usage_unless() (usau).plist create mode 100644 bundles/ruby.tmbundle/Snippets/when.plist create mode 100644 bundles/ruby.tmbundle/Snippets/while ___ end.tmSnippet create mode 100644 bundles/ruby.tmbundle/Snippets/xmlread(__).tmSnippet create mode 100644 bundles/ruby.tmbundle/Snippets/xpath(__) { __ }.tmSnippet create mode 100644 bundles/ruby.tmbundle/Snippets/zip(enums) { |row| .. } (zip).plist create mode 100644 bundles/ruby.tmbundle/Support/RakeMate/rake_mate.rb create mode 100644 bundles/ruby.tmbundle/Support/RakeMate/run_rake_task.rb create mode 100644 bundles/ruby.tmbundle/Support/RubyMate/catch_exception.rb create mode 100755 bundles/ruby.tmbundle/Support/RubyMate/run_script.rb create mode 100644 bundles/ruby.tmbundle/Support/RubyMate/test.rb create mode 100644 bundles/ruby.tmbundle/Support/RubyMate/todo.txt create mode 100755 bundles/ruby.tmbundle/Support/bin/insert_requires.rb create mode 100755 bundles/ruby.tmbundle/Support/bin/linked_ri.rb create mode 100644 bundles/ruby.tmbundle/Support/bin/make_destructive.rb create mode 100755 bundles/ruby.tmbundle/Support/bin/snippet_paren.rb create mode 100644 bundles/ruby.tmbundle/Support/lib/ruby_requires.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/README create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/CHANGES create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/README create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/README.TDC create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/README.emacs create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/README.ja create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/README.method_analysis create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/README.vim create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/README.xmpfilter create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/Rakefile create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/Rakefile.method_analysis create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/THANKS create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/anything-rcodetools.el create mode 100755 bundles/ruby.tmbundle/Support/vendor/rcodetools/bin/rbtest create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/bin/rct-complete create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/bin/rct-doc create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/bin/rct-fork create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/bin/rct-fork-client create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/bin/rct-meth-args create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/bin/ruby-toggle-file create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/bin/xmpfilter create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/icicles-rcodetools.el create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/lib/method_analyzer.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/lib/rcodetools/compat.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/lib/rcodetools/completion.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/lib/rcodetools/doc.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/lib/rcodetools/fork.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/lib/rcodetools/fork_config.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/lib/rcodetools/options.rb create mode 100755 bundles/ruby.tmbundle/Support/vendor/rcodetools/lib/rcodetools/xmpfilter.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/lib/rcodetools/xmptestunitfilter.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/lib/ruby_toggle_file.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/license.txt create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/rcodetools.el create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/rcodetools.elc create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/rcodetools.gif create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/rcodetools.sxmp create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/rcodetools.vim create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/setup.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/attic/test_run.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/add_markers-input.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/add_markers-output.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/bindings-input.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/bindings-output.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion-input.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion-output.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_class_info-input.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_class_info-output.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_class_info_no_candidates-input.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_class_info_no_candidates-output.rb create mode 100755 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_detect_rbtest-input.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_detect_rbtest-output.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_detect_rbtest2-input.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_detect_rbtest2-output.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_emacs-input.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_emacs-output.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_emacs_icicles-input.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_emacs_icicles-output.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_in_method-input.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_in_method-output.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_in_method-test.rb create mode 100755 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_rbtest-input.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_rbtest-output.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/doc-input.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/doc-output.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/doc_detect_rbtest-input.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/doc_detect_rbtest-output.rb create mode 100755 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/doc_detect_rbtest2-input.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/doc_detect_rbtest2-output.rb create mode 100755 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/doc_rbtest-input.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/doc_rbtest-output.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/no_warnings-input.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/no_warnings-output.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/refe-input.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/refe-output.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/ri-input.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/ri-output.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/ri_emacs-input.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/ri_emacs-output.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/ri_vim-input.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/ri_vim-output.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/rspec-input.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/rspec-output.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/rspec_poetry-input.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/rspec_poetry-output.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/simple_annotation-input.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/simple_annotation-output.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test-input.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test-output.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test_detect_rbtest-input.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test_detect_rbtest-output.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test_detect_rbtest2-input.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test_detect_rbtest2-output.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test_poetry-input.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test_poetry-output.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test_rbtest-input.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test_rbtest-output.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/method_analyzer-data.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/method_args.data.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete-TDC/completion_in_method__testmethod.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete-TDC/completion_in_method__testscript.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete-TDC/completion_in_method__wrong_testmethod.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete/completion.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete/completion_class_info.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete/completion_class_info_no_candidates.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete/completion_detect_rbtest.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete/completion_detect_rbtest2.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete/completion_emacs.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete/completion_emacs_icicles.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete/completion_rbtest.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-doc/doc.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-doc/doc_detect_rbtest.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-doc/doc_detect_rbtest2.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-doc/doc_rbtest.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-doc/refe.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-doc/ri.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-doc/ri_emacs.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-doc/ri_vim.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/sample_test_script.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/add_markers.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/bindings.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/comment_out.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/exception.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/expectations.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/last_match.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/mult.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/multi_line_annotation_1.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/multi_line_annotation_2.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/multi_line_annotation_3.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/multi_line_annotation_4.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/multi_line_annotation_5.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/multi_line_annotation_6.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/multi_line_annotation_7.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/no_warnings.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/nospace.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/rspec.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/rspec_poetry.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/simple_annotation.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/unit_test.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/unit_test_detect_rbtest.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/unit_test_detect_rbtest2.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/unit_test_poetry.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/unit_test_rbtest.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/width.taf create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/test_completion.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/test_doc.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/test_functional.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/test_method_analyzer.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/test_method_args.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/test_options.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/test_ruby_toggle_file.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/test_xmpfilter.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/test_xmptestunitfilter.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/tmp_functional.rb create mode 100644 bundles/ruby.tmbundle/Support/vendor/rcodetools/test/tmp_run.rb create mode 100644 bundles/ruby.tmbundle/Syntaxes/Ruby.plist create mode 100644 bundles/ruby.tmbundle/Tests/division_ambiguity.rb create mode 100644 bundles/ruby.tmbundle/Tests/modulo_ambiguity1.rb create mode 100644 bundles/ruby.tmbundle/Tests/questionmark_ambiguity1.rb create mode 100644 bundles/ruby.tmbundle/Tests/rubylexer/COPYING create mode 100644 bundles/ruby.tmbundle/Tests/rubylexer/g.rb create mode 100644 bundles/ruby.tmbundle/Tests/rubylexer/newsyntax.rb create mode 100644 bundles/ruby.tmbundle/Tests/rubylexer/p.rb create mode 100644 bundles/ruby.tmbundle/Tests/rubylexer/regtest.rb create mode 100644 bundles/ruby.tmbundle/Tests/rubylexer/w.rb create mode 100644 bundles/ruby.tmbundle/Tests/test1.rb create mode 100644 bundles/ruby.tmbundle/info.plist diff --git a/bundles/CoffeeScriptBundle.tmbundle/.gitignore b/bundles/CoffeeScriptBundle.tmbundle/.gitignore new file mode 100644 index 000000000..f05fcdc11 --- /dev/null +++ b/bundles/CoffeeScriptBundle.tmbundle/.gitignore @@ -0,0 +1 @@ +*.cache \ No newline at end of file diff --git a/bundles/CoffeeScriptBundle.tmbundle/Commands/Align Assignments.tmCommand b/bundles/CoffeeScriptBundle.tmbundle/Commands/Align Assignments.tmCommand new file mode 100644 index 000000000..8c625724e --- /dev/null +++ b/bundles/CoffeeScriptBundle.tmbundle/Commands/Align Assignments.tmCommand @@ -0,0 +1,159 @@ + + + + + beforeRunningCommand + nop + command + #!/usr/bin/env ruby +# +# Based on (from Source.tmbundle): +# +# Assignment block tidier, version 0.1. +# +# Copyright Chris Poirier 2006. +# Licensed under the Academic Free License version 3.0. +# +# This script can be used as a command for TextMate to align all +# of the assignment signs within a block of text. When using it with +# TextMate, set the command input to "Selected Text" or "Document", +# and the output to "Replace Selected Text". Map it to a key +# equivalent, and any time you want to tidy up a block, either +# select it, or put your cursor somewhere within it; then hit the +# key equivalent. Voila. +# +# Note that this is the first version of the script, and it hasn't +# been heavily tested. You might encounter a bug or two. +# +# Note (by Dr Nic) - the "first version" seems to have worked for years. +# I hope the CoffeeScript version is as successful. +# +# Per the license, use of this script is ENTIRELY at your own risk. +# See the license for full details (they override anything I've +# said here). + +lines = STDIN.readlines() +selected_text = ENV.member?("TM_SELECTED_TEXT") + +relevant_line_pattern = /^[^:]+:/ +column_search_pattern = /[\t ]*:/ + +comments = [] + +begin + # + # If called on a selection, every assignment statement + # is in the block. If called on the document, we start on the + # current line and look up and down for the start and end of the + # block. + + if selected_text then + block_top = 1 + block_bottom = lines.length + else + + # + # We start looking on the current line. However, if the + # current line doesn't match the pattern, we may be just + # after or just before a block, and we should check. If + # neither, we are done. + + start_on = ENV["TM_LINE_NUMBER"].to_i + block_top = lines.length + 1 + block_bottom = 0 + search_top = 1 + search_bottom = lines.length + search_failed = false + + if lines[start_on - 1] !~ relevant_line_pattern then + if lines[start_on - 2] =~ relevant_line_pattern then + search_bottom = start_on = start_on - 1 + elsif lines[start_on] =~ relevant_line_pattern then + search_top = start_on = start_on + else + search_failed = true + end + end + + # + # Now with the search boundaries set, start looking for + # the block top and bottom. + + unless search_failed + start_on.downto(search_top) do |number| + if lines[number-1] =~ relevant_line_pattern then + block_top = number + else + break + end + end + + start_on.upto(search_bottom) do |number| + if lines[number-1] =~ relevant_line_pattern then + block_bottom = number + else + break + end + end + end + end + + # + # Now, iterate over the block and find the best column number + # for the = sign. The pattern will tell us the position of the + # first bit of whitespace before the equal sign. We put the + # equals sign to the right of the furthest-right one. Note that + # we cannot assume every line in the block is relevant. + + best_column = 0 + block_top.upto(block_bottom) do |number| + line = lines[number - 1] + if line =~ relevant_line_pattern then + m = column_search_pattern.match(line) + best_column = m.begin(0) if m.begin(0) > best_column + end + end + + + # + # Reformat the block. Again, we cannot assume all lines in the + # block are relevant. + + block_top.upto(block_bottom) do |number| + if lines[number-1] =~ relevant_line_pattern then + before, after = lines[number-1].split(/[\t ]*:[\t ]*/, 2) + # lines[number-1] = [before.ljust(best_column), after].join(after[0,1] == '>' ? ":" : ": ") + lines[number-1] = ["#{before}:".ljust(best_column + 2), after].join + end + end + + +rescue => e + comments << "Error: #{e.inspect}" + comments << e.backtrace +end + +# +# Output the replacement text + +lines.each do |line| + puts line +end + +comments.flatten.each { |c| puts "# #{c}" } + + + input + selection + keyEquivalent + ~@] + name + Align Assignments + output + replaceSelectedText + scope + source.coffee + uuid + EE3293A5-3761-40BD-9CA8-DAAA176AA19E + + diff --git a/bundles/CoffeeScriptBundle.tmbundle/Commands/CoffeeScript.sublime-build b/bundles/CoffeeScriptBundle.tmbundle/Commands/CoffeeScript.sublime-build new file mode 100644 index 000000000..7fa2c6c77 --- /dev/null +++ b/bundles/CoffeeScriptBundle.tmbundle/Commands/CoffeeScript.sublime-build @@ -0,0 +1,6 @@ +{ + "path": "$HOME/bin:/usr/local/bin:$PATH", + "cmd": ["coffee","-c","$file"], + "file_regex": "^(...*?):([0-9]*):?([0-9]*)", + "selector": "source.coffee" +} diff --git a/bundles/CoffeeScriptBundle.tmbundle/Commands/Compile and Display JS.tmCommand b/bundles/CoffeeScriptBundle.tmbundle/Commands/Compile and Display JS.tmCommand new file mode 100644 index 000000000..bacb8a846 --- /dev/null +++ b/bundles/CoffeeScriptBundle.tmbundle/Commands/Compile and Display JS.tmCommand @@ -0,0 +1,33 @@ + + + + + beforeRunningCommand + nop + command + #!/bin/bash + +function pre { + echo -n '<pre style="word-wrap: break-word;">' + perl -pe '$| = 1; s/&/&amp;/g; s/</&lt;/g; s/>/&gt;/g; s/$\\n/<br>/' + echo '</pre>' +} + +${TM_COFFEE:=coffee} -scp --bare | pre + + fallbackInput + document + input + selection + keyEquivalent + @b + name + Compile and Display JS + output + showAsHTML + scope + source.coffee + uuid + D749F761-1740-4918-9490-90DF376BA72E + + diff --git a/bundles/CoffeeScriptBundle.tmbundle/Commands/Insert Heredoc comment.tmCommand b/bundles/CoffeeScriptBundle.tmbundle/Commands/Insert Heredoc comment.tmCommand new file mode 100644 index 000000000..db50c48a5 --- /dev/null +++ b/bundles/CoffeeScriptBundle.tmbundle/Commands/Insert Heredoc comment.tmCommand @@ -0,0 +1,34 @@ + + + + + beforeRunningCommand + nop + command + #!/usr/bin/env ruby + +column_number = ENV['TM_COLUMN_NUMBER'] +whitespace = " " * (column_number.to_i - 1) + +print <<-EOS +### +#{whitespace}$0 +#{whitespace}### +EOS + + fallbackInput + line + input + none + keyEquivalent + ^# + name + Insert Heredoc """ comment + output + insertAsSnippet + scope + source.coffee + uuid + 68A86250-0280-11E0-A976-0800200C9A66 + + diff --git a/bundles/CoffeeScriptBundle.tmbundle/Commands/Insert Heredoc triple double quotes.tmCommand b/bundles/CoffeeScriptBundle.tmbundle/Commands/Insert Heredoc triple double quotes.tmCommand new file mode 100644 index 000000000..a3be8546b --- /dev/null +++ b/bundles/CoffeeScriptBundle.tmbundle/Commands/Insert Heredoc triple double quotes.tmCommand @@ -0,0 +1,34 @@ + + + + + beforeRunningCommand + nop + command + #!/usr/bin/env ruby + +column_number = ENV['TM_COLUMN_NUMBER'] +whitespace = " " * (column_number.to_i - 1) + +print <<-EOS +""" +#{whitespace}$0 +#{whitespace}""" +EOS + + fallbackInput + line + input + none + keyEquivalent + @" + name + Insert Heredoc """ quotes + output + insertAsSnippet + scope + source.coffee + uuid + F08537AF-4F02-4040-999D-F0785CF64C02 + + diff --git a/bundles/CoffeeScriptBundle.tmbundle/Commands/Insert Heredoc triple single quotes.tmCommand b/bundles/CoffeeScriptBundle.tmbundle/Commands/Insert Heredoc triple single quotes.tmCommand new file mode 100644 index 000000000..7584d19f5 --- /dev/null +++ b/bundles/CoffeeScriptBundle.tmbundle/Commands/Insert Heredoc triple single quotes.tmCommand @@ -0,0 +1,34 @@ + + + + + beforeRunningCommand + nop + command + #!/usr/bin/env ruby + +column_number = ENV['TM_COLUMN_NUMBER'] +whitespace = " " * (column_number.to_i - 1) + +print <<-EOS +''' +#{whitespace}$0 +#{whitespace}''' +EOS + + fallbackInput + line + input + none + keyEquivalent + @' + name + Insert Heredoc ''' quotes + output + insertAsSnippet + scope + source.coffee + uuid + C4F99E3D-1540-4BC1-8038-0A19D65BABC8 + + diff --git a/bundles/CoffeeScriptBundle.tmbundle/Commands/New Function.tmCommand b/bundles/CoffeeScriptBundle.tmbundle/Commands/New Function.tmCommand new file mode 100644 index 000000000..3833b4716 --- /dev/null +++ b/bundles/CoffeeScriptBundle.tmbundle/Commands/New Function.tmCommand @@ -0,0 +1,27 @@ + + + + + beforeRunningCommand + nop + command + cat <<SNIPPET +${TM_SELECTED_TEXT:-$TM_CURRENT_WORD} = (\${1:args}) -> + \$0 +SNIPPET + fallbackInput + word + input + selection + keyEquivalent + $ + name + New Function + output + insertAsSnippet + scope + source.coffee + uuid + 192428A1-8684-4172-8728-225B4C9E532F + + diff --git a/bundles/CoffeeScriptBundle.tmbundle/Commands/Run selected text.tmCommand b/bundles/CoffeeScriptBundle.tmbundle/Commands/Run selected text.tmCommand new file mode 100644 index 000000000..e1f72fda3 --- /dev/null +++ b/bundles/CoffeeScriptBundle.tmbundle/Commands/Run selected text.tmCommand @@ -0,0 +1,25 @@ + + + + + beforeRunningCommand + nop + command + #!/bin/bash + +${TM_COFFEE:=coffee} -s + + input + selection + keyEquivalent + @R + name + Run selected text + output + showAsTooltip + scope + source.coffee + uuid + 90424631-D00B-448C-B157-DAC92DFB2858 + + diff --git a/bundles/CoffeeScriptBundle.tmbundle/Commands/Run.tmCommand b/bundles/CoffeeScriptBundle.tmbundle/Commands/Run.tmCommand new file mode 100644 index 000000000..0e46226d5 --- /dev/null +++ b/bundles/CoffeeScriptBundle.tmbundle/Commands/Run.tmCommand @@ -0,0 +1,32 @@ + + + + + beforeRunningCommand + nop + command + #!/bin/bash + +function pre { + echo -n '<pre style="word-wrap: break-word;">' + perl -pe '$| = 1; s/&/&amp;/g; s/</&lt;/g; s/>/&gt;/g; s/$\\n/<br>/' + echo '</pre>' +} + + +${TM_COFFEE:=coffee} -s | pre + + input + selection + keyEquivalent + @r + name + Run + output + showAsHTML + scope + source.coffee + uuid + 30395DAB-44A6-44F7-99E1-02D64621303A + + diff --git a/bundles/CoffeeScriptBundle.tmbundle/Preferences/CoffeeScript.tmPreferences b/bundles/CoffeeScriptBundle.tmbundle/Preferences/CoffeeScript.tmPreferences new file mode 100644 index 000000000..1fdfb720d --- /dev/null +++ b/bundles/CoffeeScriptBundle.tmbundle/Preferences/CoffeeScript.tmPreferences @@ -0,0 +1,36 @@ + + + + + name + Comments + scope + source.coffee + settings + + shellVariables + + + name + TM_COMMENT_START + value + # + + + name + TM_COMMENT_START_2 + value + ### + + + name + TM_COMMENT_END_2 + value + ### + + + + uuid + 0A92C6F6-4D73-4859-B38C-4CC19CBC191F + + diff --git a/bundles/CoffeeScriptBundle.tmbundle/Preferences/Disable Indent Corrections.tmPreferences b/bundles/CoffeeScriptBundle.tmbundle/Preferences/Disable Indent Corrections.tmPreferences new file mode 100644 index 000000000..9974f05e5 --- /dev/null +++ b/bundles/CoffeeScriptBundle.tmbundle/Preferences/Disable Indent Corrections.tmPreferences @@ -0,0 +1,17 @@ + + + + + name + Disable Indent Corrections + scope + source.coffee + settings + + disableIndentCorrections + + + uuid + 5E57C0C3-77D5-4809-A131-F777EE264908 + + diff --git a/bundles/CoffeeScriptBundle.tmbundle/Preferences/Indent.tmPreferences b/bundles/CoffeeScriptBundle.tmbundle/Preferences/Indent.tmPreferences new file mode 100644 index 000000000..9ee782a1f --- /dev/null +++ b/bundles/CoffeeScriptBundle.tmbundle/Preferences/Indent.tmPreferences @@ -0,0 +1,27 @@ + + + + + name + Indent + scope + source.coffee + settings + + decreaseIndentPattern + ^\s*(\}|\]|else|catch|finally)$ + increaseIndentPattern + (?x) + ^\s* + (.*class + |[a-zA-Z\$_](\w|\$|:|\.)*\s*(?=\:(\s*\(.*\))?\s*((=|-)>\s*$)) # function that is not one line + |[a-zA-Z\$_](\w|\$|\.)*\s*(:|=)\s*((if|while)(?!.*?then)|for|$) # assignment using multiline if/while/for + |(if|while)\b(?!.*?then)|for\b + |(try|finally|catch\s+\S.*)\s*$ + |.*[-=]>$ + |.*[\{\[]$) + + uuid + C5D6C716-12FE-4CE8-A916-6CABEDE8AFE7 + + diff --git a/bundles/CoffeeScriptBundle.tmbundle/Preferences/Symbol List Method 2.tmPreferences b/bundles/CoffeeScriptBundle.tmbundle/Preferences/Symbol List Method 2.tmPreferences new file mode 100644 index 000000000..ff94bf216 --- /dev/null +++ b/bundles/CoffeeScriptBundle.tmbundle/Preferences/Symbol List Method 2.tmPreferences @@ -0,0 +1,19 @@ + + + + + name + Symbol List: Method + scope + source.coffee meta.function.coffee + settings + + showInSymbolList + 1 + symbolTransformation + s/^\s*([a-zA-Z\$_]+)\s*=/$2/ + + uuid + 419D24D8-0DD6-4D9A-8CA0-6D9CD740BEEC + + diff --git a/bundles/CoffeeScriptBundle.tmbundle/Preferences/Symbol List Method.tmPreferences b/bundles/CoffeeScriptBundle.tmbundle/Preferences/Symbol List Method.tmPreferences new file mode 100644 index 000000000..624eee22f --- /dev/null +++ b/bundles/CoffeeScriptBundle.tmbundle/Preferences/Symbol List Method.tmPreferences @@ -0,0 +1,17 @@ + + + + + name + Symbol List: Method Instance + scope + source.coffee entity.name.type.instance + settings + + showInSymbolList + 0 + + uuid + B087AF2F-8946-4EA9-8409-49E7C4A2EEF0 + + diff --git a/bundles/CoffeeScriptBundle.tmbundle/README.markdown b/bundles/CoffeeScriptBundle.tmbundle/README.markdown new file mode 100644 index 000000000..cd6fd7839 --- /dev/null +++ b/bundles/CoffeeScriptBundle.tmbundle/README.markdown @@ -0,0 +1,21 @@ +CoffeeScript.tmbundle +--------------------- + +A **TextMate Bundle** for the **CoffeeScript** programming language. + +Installation: +------------- + + cd ~/Library/Application\ Support/TextMate/Bundles (Textmate 1) + cd /Applications/TextMate.app/Contents/SharedSupport/Bundles (Textmate 1.5.10 & 2) + git clone git://github.com/jashkenas/coffee-script-tmbundle CoffeeScriptBundle.tmbundle + +The bundle includes syntax highlighting, the ability to compile or evaluate CoffeeScript inline, convenient symbol listing for functions, and a number of expando snippets. + +Patches for additions are always welcome. + +![screenshot](http://jashkenas.s3.amazonaws.com/images/coffeescript/textmate-highlighting.png) + +If your TextMate.app is having trouble finding the `coffee` command, remember that [TextMate doesn't inherit your regular PATH](http://wiki.macromates.com/Troubleshooting/TextMateAndThePath). + + diff --git a/bundles/CoffeeScriptBundle.tmbundle/Snippets/Array comprehension.tmSnippet b/bundles/CoffeeScriptBundle.tmbundle/Snippets/Array comprehension.tmSnippet new file mode 100644 index 000000000..826cb1264 --- /dev/null +++ b/bundles/CoffeeScriptBundle.tmbundle/Snippets/Array comprehension.tmSnippet @@ -0,0 +1,17 @@ + + + + + content + for ${1:name} in ${2:array} + ${0:# body...} + name + Array Comprehension + scope + source.coffee + tabTrigger + fora + uuid + 2D4AC0B4-47AA-4E38-9A11-09A48C2A9439 + + diff --git a/bundles/CoffeeScriptBundle.tmbundle/Snippets/Bound Function.tmSnippet b/bundles/CoffeeScriptBundle.tmbundle/Snippets/Bound Function.tmSnippet new file mode 100644 index 000000000..1e3fe0e2e --- /dev/null +++ b/bundles/CoffeeScriptBundle.tmbundle/Snippets/Bound Function.tmSnippet @@ -0,0 +1,17 @@ + + + + + content + (${1:args}) => + ${0:# body...} + name + Function (bound) + scope + source.coffee + tabTrigger + bfun + uuid + 20BDC055-ED67-4D0E-A47F-ADAA828EFF2B + + diff --git a/bundles/CoffeeScriptBundle.tmbundle/Snippets/Class.tmSnippet b/bundles/CoffeeScriptBundle.tmbundle/Snippets/Class.tmSnippet new file mode 100644 index 000000000..a666926fc --- /dev/null +++ b/bundles/CoffeeScriptBundle.tmbundle/Snippets/Class.tmSnippet @@ -0,0 +1,20 @@ + + + + + content + class ${1:ClassName}${2: extends ${3:Ancestor}} + + ${4:constructor: (${5:args}) -> + ${6:# body...}} + $7 + name + Class + scope + source.coffee + tabTrigger + cla + uuid + 765ACBD3-380A-4CF8-9111-345A36A0DAE7 + + diff --git a/bundles/CoffeeScriptBundle.tmbundle/Snippets/Else if.tmSnippet b/bundles/CoffeeScriptBundle.tmbundle/Snippets/Else if.tmSnippet new file mode 100644 index 000000000..6e2fd3688 --- /dev/null +++ b/bundles/CoffeeScriptBundle.tmbundle/Snippets/Else if.tmSnippet @@ -0,0 +1,17 @@ + + + + + content + else if ${1:condition} + ${0:# body...} + name + Else if + scope + source.coffee + tabTrigger + elif + uuid + EA8F5EDB-6E1E-4C36-9CA5-12B108F1A7C9 + + diff --git a/bundles/CoffeeScriptBundle.tmbundle/Snippets/Function.tmSnippet b/bundles/CoffeeScriptBundle.tmbundle/Snippets/Function.tmSnippet new file mode 100644 index 000000000..6e58a6a1c --- /dev/null +++ b/bundles/CoffeeScriptBundle.tmbundle/Snippets/Function.tmSnippet @@ -0,0 +1,19 @@ + + + + + content + (${1:args}) -> + ${0:# body...} + + + name + Function + scope + source.coffee + tabTrigger + fun + uuid + F2E2E79A-A85D-471D-9847-72AE40205942 + + diff --git a/bundles/CoffeeScriptBundle.tmbundle/Snippets/If __ Else.tmSnippet b/bundles/CoffeeScriptBundle.tmbundle/Snippets/If __ Else.tmSnippet new file mode 100644 index 000000000..409d0aa63 --- /dev/null +++ b/bundles/CoffeeScriptBundle.tmbundle/Snippets/If __ Else.tmSnippet @@ -0,0 +1,19 @@ + + + + + content + if ${1:condition} + ${2:# body...} +else + ${3:# body...} + name + If .. Else + scope + source.coffee + tabTrigger + ife + uuid + 2AD19F12-E499-4715-9A47-FC8D594BC550 + + diff --git a/bundles/CoffeeScriptBundle.tmbundle/Snippets/If.tmSnippet b/bundles/CoffeeScriptBundle.tmbundle/Snippets/If.tmSnippet new file mode 100644 index 000000000..734b5c2eb --- /dev/null +++ b/bundles/CoffeeScriptBundle.tmbundle/Snippets/If.tmSnippet @@ -0,0 +1,17 @@ + + + + + content + if ${1:condition} + ${0:# body...} + name + If + scope + source.coffee + tabTrigger + if + uuid + F4FDFB3A-71EF-48A4-93F4-178B949546B1 + + diff --git a/bundles/CoffeeScriptBundle.tmbundle/Snippets/Interpolated Code.tmSnippet b/bundles/CoffeeScriptBundle.tmbundle/Snippets/Interpolated Code.tmSnippet new file mode 100644 index 000000000..72c839f80 --- /dev/null +++ b/bundles/CoffeeScriptBundle.tmbundle/Snippets/Interpolated Code.tmSnippet @@ -0,0 +1,18 @@ + + + + + content + #{${1:$TM_SELECTED_TEXT}} + keyEquivalent + # + name + Interpolated Code + scope + (string.quoted.double.coffee) - string source, (string.quoted.double.heredoc.coffee) - string source + tabTrigger + # + uuid + C04ED189-6ACB-44E6-AD5B-911B760AD1CC + + diff --git a/bundles/CoffeeScriptBundle.tmbundle/Snippets/Object comprehension.tmSnippet b/bundles/CoffeeScriptBundle.tmbundle/Snippets/Object comprehension.tmSnippet new file mode 100644 index 000000000..faac99251 --- /dev/null +++ b/bundles/CoffeeScriptBundle.tmbundle/Snippets/Object comprehension.tmSnippet @@ -0,0 +1,17 @@ + + + + + content + for ${1:key}, ${2:value} of ${3:Object} + ${0:# body...} + name + Object comprehension + scope + source.coffee + tabTrigger + foro + uuid + 9D126CC5-EA14-4A40-B6D3-6A5FC1AC1420 + + diff --git a/bundles/CoffeeScriptBundle.tmbundle/Snippets/Range comprehension (exclusive).tmSnippet b/bundles/CoffeeScriptBundle.tmbundle/Snippets/Range comprehension (exclusive).tmSnippet new file mode 100644 index 000000000..9d26ddd69 --- /dev/null +++ b/bundles/CoffeeScriptBundle.tmbundle/Snippets/Range comprehension (exclusive).tmSnippet @@ -0,0 +1,17 @@ + + + + + content + for ${1:name} in [${2:start}...${3:finish}]${4: by ${5:step}} + ${0:# body...} + name + Range comprehension (exclusive) + scope + source.coffee + tabTrigger + forrex + uuid + FA6AB9BF-3444-4A8C-B010-C95C2CF5BAB3 + + diff --git a/bundles/CoffeeScriptBundle.tmbundle/Snippets/Range comprehension (inclusive).tmSnippet b/bundles/CoffeeScriptBundle.tmbundle/Snippets/Range comprehension (inclusive).tmSnippet new file mode 100644 index 000000000..991a15748 --- /dev/null +++ b/bundles/CoffeeScriptBundle.tmbundle/Snippets/Range comprehension (inclusive).tmSnippet @@ -0,0 +1,17 @@ + + + + + content + for ${1:name} in [${2:start}..${3:finish}]${4: by ${5:step}} + ${0:# body...} + name + Range comprehension (inclusive) + scope + source.coffee + tabTrigger + forr + uuid + E0F8E45A-9262-4DD6-ADFF-B5B9D6CE99C2 + + diff --git a/bundles/CoffeeScriptBundle.tmbundle/Snippets/Raw javascript.tmSnippet b/bundles/CoffeeScriptBundle.tmbundle/Snippets/Raw javascript.tmSnippet new file mode 100644 index 000000000..c51d264ec --- /dev/null +++ b/bundles/CoffeeScriptBundle.tmbundle/Snippets/Raw javascript.tmSnippet @@ -0,0 +1,16 @@ + + + + + content + \`${1:`pbpaste`}\` + keyEquivalent + ^j + name + Raw javascript + scope + source.coffee + uuid + 422A59E7-FC36-4E99-B01C-6353515BB544 + + diff --git a/bundles/CoffeeScriptBundle.tmbundle/Snippets/Switch.tmSnippet b/bundles/CoffeeScriptBundle.tmbundle/Snippets/Switch.tmSnippet new file mode 100644 index 000000000..6ebe7fb85 --- /dev/null +++ b/bundles/CoffeeScriptBundle.tmbundle/Snippets/Switch.tmSnippet @@ -0,0 +1,18 @@ + + + + + content + switch ${1:object} + when ${2:value} + ${0:# body...} + name + Switch + scope + source.coffee + tabTrigger + swi + uuid + 3931A7C6-F1FB-484F-82D1-26F5A8F779D0 + + diff --git a/bundles/CoffeeScriptBundle.tmbundle/Snippets/Ternary If.tmSnippet b/bundles/CoffeeScriptBundle.tmbundle/Snippets/Ternary If.tmSnippet new file mode 100644 index 000000000..4f2465d36 --- /dev/null +++ b/bundles/CoffeeScriptBundle.tmbundle/Snippets/Ternary If.tmSnippet @@ -0,0 +1,16 @@ + + + + + content + if ${1:condition} then ${2:value} else ${3:other} + name + Ternary If + scope + source.coffee + tabTrigger + ifte + uuid + CF0B4684-E4CB-4E10-8C25-4D15400C3385 + + diff --git a/bundles/CoffeeScriptBundle.tmbundle/Snippets/Try __ Catch.tmSnippet b/bundles/CoffeeScriptBundle.tmbundle/Snippets/Try __ Catch.tmSnippet new file mode 100644 index 000000000..1b2415357 --- /dev/null +++ b/bundles/CoffeeScriptBundle.tmbundle/Snippets/Try __ Catch.tmSnippet @@ -0,0 +1,19 @@ + + + + + content + try + $1 +catch ${2:error} + $3 + name + Try .. Catch + scope + source.coffee + tabTrigger + try + uuid + CAFB0DED-5E23-4A84-AC20-87FBAF22DBAC + + diff --git a/bundles/CoffeeScriptBundle.tmbundle/Snippets/Unless.tmSnippet b/bundles/CoffeeScriptBundle.tmbundle/Snippets/Unless.tmSnippet new file mode 100644 index 000000000..3691b0678 --- /dev/null +++ b/bundles/CoffeeScriptBundle.tmbundle/Snippets/Unless.tmSnippet @@ -0,0 +1,16 @@ + + + + + content + ${1:action} unless ${2:condition} + name + Unless + scope + source.coffee + tabTrigger + unl + uuid + E561AECD-5933-4F59-A6F7-FA96E1203606 + + diff --git a/bundles/CoffeeScriptBundle.tmbundle/Snippets/h1.tmSnippet b/bundles/CoffeeScriptBundle.tmbundle/Snippets/h1.tmSnippet new file mode 100644 index 000000000..0ef035cbf --- /dev/null +++ b/bundles/CoffeeScriptBundle.tmbundle/Snippets/h1.tmSnippet @@ -0,0 +1,16 @@ + + + + + content + # $1 +# ============================================================================== +$0 + name + Subheader + scope + source.coffee + tabTrigger + /1 + + diff --git a/bundles/CoffeeScriptBundle.tmbundle/Snippets/h2.tmSnippet b/bundles/CoffeeScriptBundle.tmbundle/Snippets/h2.tmSnippet new file mode 100644 index 000000000..ec571fef7 --- /dev/null +++ b/bundles/CoffeeScriptBundle.tmbundle/Snippets/h2.tmSnippet @@ -0,0 +1,16 @@ + + + + + content + # $1 +# ---------------------------------------------------------------------- +$0 + name + Subheader + scope + source.coffee + tabTrigger + /2 + + diff --git a/bundles/CoffeeScriptBundle.tmbundle/Snippets/h3.tmSnippet b/bundles/CoffeeScriptBundle.tmbundle/Snippets/h3.tmSnippet new file mode 100644 index 000000000..2bb8ad0a1 --- /dev/null +++ b/bundles/CoffeeScriptBundle.tmbundle/Snippets/h3.tmSnippet @@ -0,0 +1,16 @@ + + + + + content + # $1 +# ------------------------- +$0 + name + Subheader + scope + source.coffee + tabTrigger + /3 + + diff --git a/bundles/CoffeeScriptBundle.tmbundle/Snippets/log.tmSnippet b/bundles/CoffeeScriptBundle.tmbundle/Snippets/log.tmSnippet new file mode 100644 index 000000000..33e7add5e --- /dev/null +++ b/bundles/CoffeeScriptBundle.tmbundle/Snippets/log.tmSnippet @@ -0,0 +1,16 @@ + + + + + content + console.log $0 + name + log + scope + source.coffee + tabTrigger + log + uuid + FBC44B18-323A-4C00-A35B-15E41830C5AD + + diff --git a/bundles/CoffeeScriptBundle.tmbundle/Snippets/require.tmSnippet b/bundles/CoffeeScriptBundle.tmbundle/Snippets/require.tmSnippet new file mode 100644 index 000000000..27f7aa7a5 --- /dev/null +++ b/bundles/CoffeeScriptBundle.tmbundle/Snippets/require.tmSnippet @@ -0,0 +1,16 @@ + + + + + content + ${2/^.*?([\w_]+).*$/\L$1/} = require ${2:'${1:sys}'}$3 + name + require + scope + source.coffee + tabTrigger + req + uuid + 8A65E175-18F2-428F-A695-73E01139E41A + + diff --git a/bundles/CoffeeScriptBundle.tmbundle/Syntaxes/CoffeeScript.tmLanguage b/bundles/CoffeeScriptBundle.tmbundle/Syntaxes/CoffeeScript.tmLanguage new file mode 100644 index 000000000..461e86744 --- /dev/null +++ b/bundles/CoffeeScriptBundle.tmbundle/Syntaxes/CoffeeScript.tmLanguage @@ -0,0 +1,736 @@ + + + + + comment + CoffeeScript Syntax: version 1 + fileTypes + + coffee + Cakefile + coffee.erb + + firstLineMatch + ^#!.*\bcoffee + foldingStartMarker + ^\s*class\s+\S.*$|.*(->|=>)\s*$|.*[\[{]\s*$ + foldingStopMarker + ^\s*$|^\s*[}\]]\s*$ + keyEquivalent + ^~C + name + CoffeeScript + patterns + + + captures + + 1 + + name + variable.parameter.function.coffee + + 2 + + name + storage.type.function.coffee + + + comment + match stuff like: a -> … + match + (\([^()]*?\))\s*([=-]>) + name + meta.inline.function.coffee + + + captures + + 1 + + name + keyword.operator.new.coffee + + 2 + + name + entity.name.type.instance.coffee + + + match + (new)\s+(\w+(?:\.\w*)*) + name + meta.class.instance.constructor + + + begin + ''' + beginCaptures + + 0 + + name + punctuation.definition.string.begin.coffee + + + end + ''' + endCaptures + + 0 + + name + punctuation.definition.string.end.coffee + + + name + string.quoted.heredoc.coffee + + + begin + """ + beginCaptures + + 0 + + name + punctuation.definition.string.begin.coffee + + + end + """ + endCaptures + + 0 + + name + punctuation.definition.string.end.coffee + + + name + string.quoted.double.heredoc.coffee + patterns + + + match + \\. + name + constant.character.escape.coffee + + + include + #interpolated_coffee + + + + + begin + ` + beginCaptures + + 0 + + name + punctuation.definition.string.begin.coffee + + + end + ` + endCaptures + + 0 + + name + punctuation.definition.string.end.coffee + + + name + string.quoted.script.coffee + patterns + + + match + \\(x\h{2}|[0-2][0-7]{,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.) + name + constant.character.escape.coffee + + + + + begin + (?<!#)###(?!#) + captures + + 0 + + name + punctuation.definition.comment.coffee + + + end + ###(?:[ \t]*\n) + name + comment.block.coffee + patterns + + + match + @\w* + name + storage.type.annotation.coffeescript + + + + + captures + + 1 + + name + punctuation.definition.comment.coffee + + + match + (#)(?!\{).*$\n? + name + comment.line.number-sign.coffee + + + begin + /{3} + end + /{3}[imgy]{0,4} + name + string.regexp.coffee + patterns + + + include + #interpolated_coffee + + + include + #embedded_comment + + + + + match + /(?![\s=/*+{}?]).*?[^\\]/[igmy]{0,4}(?![a-zA-Z0-9]) + name + string.regexp.coffee + + + match + (?x) + \b(?<![\.\$])( + break|by|catch|continue|else|finally|for|in|of|if|return|switch| + then|throw|try|unless|when|while|until|loop|do|(?<=for)\s+own + )(?!\s*:)\b + + name + keyword.control.coffee + + + match + (?x) + and=|or=|!|%|&|\^|\*|\/|(\-)?\-(?!>)|\+\+|\+|~|==|=(?!>)|!=|<=|>=|<<=|>>=| + >>>=|<>|<|>|!|&&|\.\.(\.)?|\?|\||\|\||\:|\*=|(?<!\()/=|%=|\+=|\-=|&=| + \^=|\b(?<![\.\$])(instanceof|new|delete|typeof|and|or|is|isnt|not)\b + + name + keyword.operator.coffee + + + captures + + 1 + + name + variable.assignment.coffee + + 4 + + name + punctuation.separator.key-value + + 5 + + name + keyword.operator.coffee + + + match + ([a-zA-Z\$_](\w|\$|\.)*\s*(?!\::)((:)|(=))(?!(\s*\(.*\))?\s*((=|-)>))) + name + variable.assignment.coffee + + + begin + (?<=\s|^)([\[\{])(?=.*?[\]\}]\s+[:=]) + beginCaptures + + 0 + + name + keyword.operator.coffee + + + end + ([\]\}]\s*[:=]) + endCaptures + + 0 + + name + keyword.operator.coffee + + + name + meta.variable.assignment.destructured.coffee + patterns + + + include + #variable_name + + + include + #instance_variable + + + include + #single_quoted_string + + + include + #double_quoted_string + + + include + #numeric + + + + + captures + + 2 + + name + entity.name.function.coffee + + 3 + + name + entity.name.function.coffee + + 4 + + name + variable.parameter.function.coffee + + 5 + + name + storage.type.function.coffee + + + match + (?x) + (\s*) + (?=[a-zA-Z\$_]) + ( + [a-zA-Z\$_](\w|\$|:|\.)*\s* + (?=[:=](\s*\(.*\))?\s*([=-]>)) + ) + + name + meta.function.coffee + + + match + [=-]> + name + storage.type.function.coffee + + + match + \b(?<!\.)(true|on|yes)(?!\s*[:=])\b + name + constant.language.boolean.true.coffee + + + match + \b(?<!\.)(false|off|no)(?!\s*[:=])\b + name + constant.language.boolean.false.coffee + + + match + \b(?<!\.)null(?!\s*[:=])\b + name + constant.language.null.coffee + + + match + \b(?<!\.)(super|this|extends)(?!\s*[:=])\b + name + variable.language.coffee + + + captures + + 1 + + name + storage.type.class.coffee + + 2 + + name + entity.name.type.class.coffee + + 3 + + name + keyword.control.inheritance.coffee + + 4 + + name + entity.other.inherited-class.coffee + + + match + (class\b)\s+(@?[a-zA-Z\$_][\w\.]*)?(?:\s+(extends)\s+(@?[a-zA-Z\$\._][\w\.]*))? + name + meta.class.coffee + + + match + \b(debugger|\\)\b + name + keyword.other.coffee + + + match + (?x)\b( + Array|ArrayBuffer|Blob|Boolean|Date|document|event|Function| + Int(8|16|32|64)Array|Math|Map|Number| + Object|Proxy|RegExp|Set|String|WeakMap| + window|Uint(8|16|32|64)Array|XMLHttpRequest + )\b + name + support.class.coffee + + + match + \b(console)\b + name + entity.name.type.object.coffee + + + match + ((?<=console\.)(debug|warn|info|log|error|time|timeEnd|assert))\b + name + support.function.console.coffee + + + match + (?x)\b( + decodeURI(Component)?|encodeURI(Component)?|eval|parse(Float|Int)|require + )\b + name + support.function.coffee + + + match + (?x)((?<=\.)( + apply|call|concat|every|filter|forEach|from|hasOwnProperty|indexOf| + isPrototypeOf|join|lastIndexOf|map|of|pop|propertyIsEnumerable|push| + reduce(Right)?|reverse|shift|slice|some|sort|splice|to(Locale)?String| + unshift|valueOf + ))\b + name + support.function.method.array.coffee + + + match + (?x)((?<=Array\.)( + isArray + ))\b + name + support.function.static.array.coffee + + + match + (?x)((?<=Object\.)( + create|definePropert(ies|y)|freeze|getOwnProperty(Descriptors?|Names)| + getProperty(Descriptor|Names)|getPrototypeOf|is(Extensible|Frozen|Sealed)?| + isnt|keys|preventExtensions|seal + ))\b + name + support.function.static.object.coffee + + + match + (?x)((?<=Math\.)( + abs|acos|acosh|asin|asinh|atan|atan2|atanh|ceil|cos|cosh|exp|expm1|floor| + hypot|log|log10|log1p|log2|max|min|pow|random|round|sign|sin|sinh|sqrt| + tan|tanh|trunc + ))\b + name + support.function.static.math.coffee + + + match + (?x)((?<=Number\.)( + is(Finite|Integer|NaN)|toInteger + ))\b + name + support.function.static.number.coffee + + + match + \b(Infinity|NaN|undefined)\b + name + constant.language.coffee + + + match + \; + name + punctuation.terminator.statement.coffee + + + match + ,[ |\t]* + name + meta.delimiter.object.comma.coffee + + + match + \. + name + meta.delimiter.method.period.coffee + + + match + \{|\} + name + meta.brace.curly.coffee + + + match + \(|\) + name + meta.brace.round.coffee + + + match + \[|\]\s* + name + meta.brace.square.coffee + + + include + #instance_variable + + + include + #single_quoted_string + + + include + #double_quoted_string + + + include + #numeric + + + repository + + double_quoted_string + + patterns + + + begin + " + beginCaptures + + 0 + + name + punctuation.definition.string.begin.coffee + + + end + " + endCaptures + + 0 + + name + punctuation.definition.string.end.coffee + + + name + string.quoted.double.coffee + patterns + + + match + \\(x\h{2}|[0-2][0-7]{,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.) + name + constant.character.escape.coffee + + + include + #interpolated_coffee + + + + + + embedded_comment + + patterns + + + captures + + 1 + + name + punctuation.definition.comment.coffee + + + match + (?<!\\)(#).*$\n? + name + comment.line.number-sign.coffee + + + + instance_variable + + patterns + + + match + (@)([a-zA-Z_\$]\w*)? + name + variable.other.readwrite.instance.coffee + + + + interpolated_coffee + + patterns + + + begin + \#\{ + captures + + 0 + + name + punctuation.section.embedded.coffee + + + end + \} + name + source.coffee.embedded.source + patterns + + + include + $self + + + + + + numeric + + patterns + + + match + (?<!\$)\b((0([box])[0-9a-fA-F]+)|([0-9]+(\.[0-9]+)?(e[+\-]?[0-9]+)?))\b + name + constant.numeric.coffee + + + + single_quoted_string + + patterns + + + begin + ' + beginCaptures + + 0 + + name + punctuation.definition.string.begin.coffee + + + end + ' + endCaptures + + 0 + + name + punctuation.definition.string.end.coffee + + + name + string.quoted.single.coffee + patterns + + + match + \\(x\h{2}|[0-2][0-7]{,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.) + name + constant.character.escape.coffee + + + + + + variable_name + + patterns + + + captures + + 1 + + name + variable.assignment.coffee + + + match + ([a-zA-Z\$_]\w*(\.\w+)*) + name + variable.assignment.coffee + + + + + scopeName + source.coffee + uuid + 5B520980-A7D5-4E10-8582-1A4C889A8DE5 + + diff --git a/bundles/CoffeeScriptBundle.tmbundle/info.plist b/bundles/CoffeeScriptBundle.tmbundle/info.plist new file mode 100644 index 000000000..c2d0c4469 --- /dev/null +++ b/bundles/CoffeeScriptBundle.tmbundle/info.plist @@ -0,0 +1,114 @@ + + + + + mainMenu + + items + + D77D67C9-7BA6-4B42-A563-2E2416DEEB53 + E11D7545-67B4-4191-8012-756E2C9AD382 + 5786C9CC-C7ED-46FA-9D0B-069E52DAF268 + 1C7FD768-1DEA-4825-8220-FACA8D507E80 + + submenus + + 1C7FD768-1DEA-4825-8220-FACA8D507E80 + + items + + F08537AF-4F02-4040-999D-F0785CF64C02 + C4F99E3D-1540-4BC1-8038-0A19D65BABC8 + 68A86250-0280-11E0-A976-0800200C9A66 + EE3293A5-3761-40BD-9CA8-DAAA176AA19E + 422A59E7-FC36-4E99-B01C-6353515BB544 + 8A65E175-18F2-428F-A695-73E01139E41A + C04ED189-6ACB-44E6-AD5B-911B760AD1CC + FBC44B18-323A-4C00-A35B-15E41830C5AD + + name + Other + + 5786C9CC-C7ED-46FA-9D0B-069E52DAF268 + + items + + 192428A1-8684-4172-8728-225B4C9E532F + F2E2E79A-A85D-471D-9847-72AE40205942 + 20BDC055-ED67-4D0E-A47F-ADAA828EFF2B + 2D4AC0B4-47AA-4E38-9A11-09A48C2A9439 + 9D126CC5-EA14-4A40-B6D3-6A5FC1AC1420 + FA6AB9BF-3444-4A8C-B010-C95C2CF5BAB3 + E0F8E45A-9262-4DD6-ADFF-B5B9D6CE99C2 + 3931A7C6-F1FB-484F-82D1-26F5A8F779D0 + 765ACBD3-380A-4CF8-9111-345A36A0DAE7 + CAFB0DED-5E23-4A84-AC20-87FBAF22DBAC + + name + Constructs + + D77D67C9-7BA6-4B42-A563-2E2416DEEB53 + + items + + 30395DAB-44A6-44F7-99E1-02D64621303A + D749F761-1740-4918-9490-90DF376BA72E + 90424631-D00B-448C-B157-DAC92DFB2858 + + name + Run + + E11D7545-67B4-4191-8012-756E2C9AD382 + + items + + F4FDFB3A-71EF-48A4-93F4-178B949546B1 + 2AD19F12-E499-4715-9A47-FC8D594BC550 + EA8F5EDB-6E1E-4C36-9CA5-12B108F1A7C9 + CF0B4684-E4CB-4E10-8C25-4D15400C3385 + E561AECD-5933-4F59-A6F7-FA96E1203606 + + name + Control + + + + name + CoffeeScript + ordering + + 5B520980-A7D5-4E10-8582-1A4C889A8DE5 + 0A92C6F6-4D73-4859-B38C-4CC19CBC191F + 419D24D8-0DD6-4D9A-8CA0-6D9CD740BEEC + B087AF2F-8946-4EA9-8409-49E7C4A2EEF0 + C5D6C716-12FE-4CE8-A916-6CABEDE8AFE7 + EE3293A5-3761-40BD-9CA8-DAAA176AA19E + 192428A1-8684-4172-8728-225B4C9E532F + 30395DAB-44A6-44F7-99E1-02D64621303A + D749F761-1740-4918-9490-90DF376BA72E + 90424631-D00B-448C-B157-DAC92DFB2858 + F08537AF-4F02-4040-999D-F0785CF64C02 + C4F99E3D-1540-4BC1-8038-0A19D65BABC8 + F2E2E79A-A85D-471D-9847-72AE40205942 + 20BDC055-ED67-4D0E-A47F-ADAA828EFF2B + F4FDFB3A-71EF-48A4-93F4-178B949546B1 + 2AD19F12-E499-4715-9A47-FC8D594BC550 + EA8F5EDB-6E1E-4C36-9CA5-12B108F1A7C9 + CF0B4684-E4CB-4E10-8C25-4D15400C3385 + E561AECD-5933-4F59-A6F7-FA96E1203606 + 2D4AC0B4-47AA-4E38-9A11-09A48C2A9439 + 9D126CC5-EA14-4A40-B6D3-6A5FC1AC1420 + FA6AB9BF-3444-4A8C-B010-C95C2CF5BAB3 + E0F8E45A-9262-4DD6-ADFF-B5B9D6CE99C2 + 3931A7C6-F1FB-484F-82D1-26F5A8F779D0 + 765ACBD3-380A-4CF8-9111-345A36A0DAE7 + CAFB0DED-5E23-4A84-AC20-87FBAF22DBAC + 422A59E7-FC36-4E99-B01C-6353515BB544 + 8A65E175-18F2-428F-A695-73E01139E41A + C04ED189-6ACB-44E6-AD5B-911B760AD1CC + FBC44B18-323A-4C00-A35B-15E41830C5AD + + uuid + A46E4382-F1AC-405B-8F22-65FF470F34D7 + + diff --git a/bundles/ruby.tmbundle/Commands/Check ERB Syntax.plist b/bundles/ruby.tmbundle/Commands/Check ERB Syntax.plist new file mode 100644 index 000000000..56a3ec340 --- /dev/null +++ b/bundles/ruby.tmbundle/Commands/Check ERB Syntax.plist @@ -0,0 +1,27 @@ + + + + + beforeRunningCommand + nop + command + #!/usr/bin/env ruby +require ENV['TM_SUPPORT_PATH'] + '/lib/textmate' +puts "using ruby-" + RUBY_VERSION.to_s + ' / erb' +result = `"${TM_ERB:=erb}" -T - -x | "${TM_RUBY:=ruby}" -c 2>&1` +puts result +TextMate.go_to :line => $1 if result =~ /-:(\d+):/ + input + document + keyEquivalent + ^V + name + Validate Syntax (ERB) + output + showAsTooltip + scope + text.html.ruby, text.html source.ruby + uuid + 76FCF165-54CB-4213-BC55-BD60B9C6A3EC + + diff --git a/bundles/ruby.tmbundle/Commands/Check Ruby Syntax.plist b/bundles/ruby.tmbundle/Commands/Check Ruby Syntax.plist new file mode 100644 index 000000000..b95036fc2 --- /dev/null +++ b/bundles/ruby.tmbundle/Commands/Check Ruby Syntax.plist @@ -0,0 +1,28 @@ + + + + + beforeRunningCommand + nop + command + #!/usr/bin/env ruby +require ENV['TM_SUPPORT_PATH'] + '/lib/textmate' +puts `"${TM_RUBY:=ruby}" -e'puts "Using ruby-" + RUBY_VERSION.to_s'` +result = `"${TM_RUBY:=ruby}" -wc 2>&1` +puts result +TextMate.go_to :line => $1 if result =~ /-:(\d+):/ + + input + document + keyEquivalent + ^V + name + Validate Syntax + output + showAsTooltip + scope + source.ruby + uuid + EE5F19BA-6C02-11D9-92BA-0011242E4184 + + diff --git a/bundles/ruby.tmbundle/Commands/Completion: Ruby (rcodetools).tmCommand b/bundles/ruby.tmbundle/Commands/Completion: Ruby (rcodetools).tmCommand new file mode 100644 index 000000000..5cbf35c9c --- /dev/null +++ b/bundles/ruby.tmbundle/Commands/Completion: Ruby (rcodetools).tmCommand @@ -0,0 +1,72 @@ + + + + + beforeRunningCommand + nop + command + #!/usr/bin/env ruby + +require "#{ENV["TM_SUPPORT_PATH"]}/lib/exit_codes" +require "#{ENV["TM_SUPPORT_PATH"]}/lib/ui" + +require "pathname" + +TM_RUBY = ENV["TM_RUBY"] || "ruby" +RCODETOOLS = "#{ENV['TM_BUNDLE_SUPPORT']}/vendor/rcodetools" + +RAILS_DIR = nil +dir = File.dirname(ENV["TM_FILEPATH"]) rescue ENV["TM_PROJECT_DIRECTORY"] +if dir + dir = Pathname.new(dir) + loop do + if (dir + "config/environment.rb").exist? + Object.send(:remove_const, :RAILS_DIR) + RAILS_DIR = dir.to_s + break + end + + break if dir.to_s == "/" + + dir += ".." + end +end + +command = <<END_COMMAND.tr("\n", " ").strip +"#{TM_RUBY}" +-I "#{RCODETOOLS}/lib" +-- +"#{RCODETOOLS}/bin/rct-complete" +#{"-r \"#{RAILS_DIR}/config/environment.rb\"" if RAILS_DIR} +--line=#{ENV['TM_LINE_NUMBER']} +--column=#{ENV['TM_LINE_INDEX']} +2> /dev/null +END_COMMAND +completions = `#{command}`.split("\n").map { |l| l.strip }.select { |l| l =~ /\S/ } + +if not $?.success? + TextMate.exit_show_tool_tip "Parse error." +elsif completions.size == 1 + selected = completions.first +elsif completions.size > 1 + selected = completions[TextMate::UI.menu(completions)] rescue exit +else + TextMate.exit_show_tool_tip "No matches were found." +end + +print selected.sub(/\A#{Regexp.escape(ENV['TM_CURRENT_WORD'].to_s)}/, "") + + input + document + keyEquivalent + ~ + name + Completion: Ruby (rcodetools) + output + afterSelectedText + scope + source.ruby + uuid + 47D203ED-EB9B-4653-A07B-A897800CEB76 + + diff --git a/bundles/ruby.tmbundle/Commands/Convert Ruby hash to 1_9 syntax.tmCommand b/bundles/ruby.tmbundle/Commands/Convert Ruby hash to 1_9 syntax.tmCommand new file mode 100644 index 000000000..8f15d2b9d --- /dev/null +++ b/bundles/ruby.tmbundle/Commands/Convert Ruby hash to 1_9 syntax.tmCommand @@ -0,0 +1,29 @@ + + + + + beforeRunningCommand + nop + command + #!/usr/bin/env ruby + +print case str = STDIN.read + when /=>/; str.gsub(/:(\w+)[\s]+=>[\s]+/, '\1: ') + when /(\w+):/; str.gsub(/(\w+):(\s*(?:"(?:\\"|[^"])*"|'(?:\\'|[^'])*'|\w+\([^)]*\)|[^,]+))/, ":\\1 =>\\2") + else; str +end + + fallbackInput + line + input + selection + keyEquivalent + ^= + name + Toggle Ruby Hash 1.8/1.9 Syntax + output + replaceSelectedText + uuid + F4EEB2B6-07D8-402F-8FC3-79B7308D2576 + + diff --git a/bundles/ruby.tmbundle/Commands/Enclose in * (RDoc comments).tmCommand b/bundles/ruby.tmbundle/Commands/Enclose in * (RDoc comments).tmCommand new file mode 100644 index 000000000..6918b3a31 --- /dev/null +++ b/bundles/ruby.tmbundle/Commands/Enclose in * (RDoc comments).tmCommand @@ -0,0 +1,33 @@ + + + + + beforeRunningCommand + nop + command + #!/usr/bin/env ruby +s = STDIN.read +case s +when /^\w+$/ + print "*#{s}*$0" +when "" + print "*$1*$0" +else + print "<b>#{s}</b>" +end + fallbackInput + word + input + selection + keyEquivalent + @b + name + Bold + output + insertAsSnippet + scope + source.ruby comment + uuid + 931DD73E-615E-476E-9B0D-8341023AE730 + + diff --git a/bundles/ruby.tmbundle/Commands/Enclose in + (RDoc comments).tmCommand b/bundles/ruby.tmbundle/Commands/Enclose in + (RDoc comments).tmCommand new file mode 100644 index 000000000..3a7820e5a --- /dev/null +++ b/bundles/ruby.tmbundle/Commands/Enclose in + (RDoc comments).tmCommand @@ -0,0 +1,33 @@ + + + + + beforeRunningCommand + nop + command + #!/usr/bin/env ruby +s = STDIN.read +case s +when /^\w+$/ + print "+#{s}+$0" +when "" + print "+$1+$0" +else + print "<tt>#{s}</tt>" +end + fallbackInput + word + input + selection + keyEquivalent + @k + name + Typewriter + output + insertAsSnippet + scope + source.ruby comment + uuid + 2DDB6FE0-6111-4C40-A149-8E67E76F8272 + + diff --git a/bundles/ruby.tmbundle/Commands/Enclose in _ (RDoc comments).tmCommand b/bundles/ruby.tmbundle/Commands/Enclose in _ (RDoc comments).tmCommand new file mode 100644 index 000000000..5516b637d --- /dev/null +++ b/bundles/ruby.tmbundle/Commands/Enclose in _ (RDoc comments).tmCommand @@ -0,0 +1,33 @@ + + + + + beforeRunningCommand + nop + command + #!/usr/bin/env ruby +s = STDIN.read +case s +when /^\w+$/ + print "_#{s}_$0" +when "" + print "_$1_$0" +else + print "<em>#{s}</em>" +end + fallbackInput + word + input + selection + keyEquivalent + @i + name + Italic + output + insertAsSnippet + scope + source.ruby comment + uuid + DAA69A0C-FC1E-4509-9931-DFFB38B4D6AE + + diff --git a/bundles/ruby.tmbundle/Commands/Execute Line with Ruby.plist b/bundles/ruby.tmbundle/Commands/Execute Line with Ruby.plist new file mode 100644 index 000000000..87934745f --- /dev/null +++ b/bundles/ruby.tmbundle/Commands/Execute Line with Ruby.plist @@ -0,0 +1,47 @@ + + + + + beforeRunningCommand + nop + command + #!/usr/bin/env ruby + +# be smart, dont print something if we already have.. +$write_count = 0 +def STDOUT.write(what) + $write_count += 1 + super(what) +end + +# execure the code +begin + # insert a space if input was a selection, if it was a line insert \n + print(ENV['TM_SELECTED_TEXT'] ? " " : "\n") + r = eval(STDIN.read) +rescue Object + r = $!.class.to_s +end + +# try to_s, if it doesnt work use inspect +# Array and Hash are shown via inspect because they look better with formating +# do this just if the script did not print anything itself +if $write_count == 1 + print( (r.class != Hash and r.class != Array and not r.nil? and r.respond_to? :to_s) ? r.to_s : r.inspect ) + print( "\n" ) unless ENV.has_key?('TM_SELECTED_TEXT') +end + + fallbackInput + line + input + selection + keyEquivalent + ^E + name + Execute Line / Selection as Ruby + output + afterSelectedText + uuid + EE5F1FB2-6C02-11D9-92BA-0011242E4184 + + diff --git a/bundles/ruby.tmbundle/Commands/Execute and Insert Results.tmCommand b/bundles/ruby.tmbundle/Commands/Execute and Insert Results.tmCommand new file mode 100644 index 000000000..cab8b0d7c --- /dev/null +++ b/bundles/ruby.tmbundle/Commands/Execute and Insert Results.tmCommand @@ -0,0 +1,29 @@ + + + + + beforeRunningCommand + nop + command + export RUBYLIB="$TM_BUNDLE_SUPPORT/vendor/rcodetools/lib${RUBYLIB:+:$RUBYLIB}" +export TM_RUBY=$(which "${TM_RUBY:-ruby}") + + +"${TM_RUBY}" -r "${TM_SUPPORT_PATH}/lib/ruby1.9/add_1.8_features.rb" -- "$TM_BUNDLE_SUPPORT/vendor/rcodetools/bin/xmpfilter" + + fallbackInput + document + input + selection + keyEquivalent + ^@E + name + Execute and Update ‘# =>’ Markers + output + replaceSelectedText + scope + source.ruby + uuid + FBFC214F-B019-4967-95D2-028F374A3221 + + diff --git a/bundles/ruby.tmbundle/Commands/Insert Missing Requires.plist b/bundles/ruby.tmbundle/Commands/Insert Missing Requires.plist new file mode 100644 index 000000000..0da76b106 --- /dev/null +++ b/bundles/ruby.tmbundle/Commands/Insert Missing Requires.plist @@ -0,0 +1,51 @@ + + + + + beforeRunningCommand + nop + command + #!/usr/bin/env ruby +$: << "#{ENV['TM_SUPPORT_PATH']}/lib" + +require "escape" +require "open3" + +# make exceptions in the writing Thread kill the process so we don't hang +Thread.abort_on_exception = true + +CURSOR = [0xFFFC].pack("U").freeze +line, col = ENV["TM_LINE_NUMBER"].to_i - 1, ENV["TM_LINE_INDEX"].to_i + +stdin, stdout, stderr = Open3.popen3("/usr/bin/env", "ruby", "#{ENV['TM_BUNDLE_SUPPORT']}/bin/insert_requires.rb") +Thread.new do + code = STDIN.read.to_a + unless ENV.has_key?('TM_SELECTED_TEXT') + if code[line].nil? # if cursor was on the last line and it was blank + code << CURSOR + else + code[line][col...col] = CURSOR + end + end + stdin.write code.join + stdin.close +end + +print stdout.read.split(CURSOR).join('${0}') + + fallbackInput + document + input + selection + keyEquivalent + ^# + name + Insert Missing Requires + output + insertAsSnippet + scope + source.ruby + uuid + 9FB64639-F776-499B-BA6F-BB45F86F80FD + + diff --git a/bundles/ruby.tmbundle/Commands/Lookup in Documentation.plist b/bundles/ruby.tmbundle/Commands/Lookup in Documentation.plist new file mode 100644 index 000000000..fef94aaf5 --- /dev/null +++ b/bundles/ruby.tmbundle/Commands/Lookup in Documentation.plist @@ -0,0 +1,24 @@ + + + + + beforeRunningCommand + nop + command + "${TM_BUNDLE_SUPPORT}/bin/linked_ri.rb" + fallbackInput + word + input + selection + keyEquivalent + ^h + name + Documentation for Word / Selection + output + showAsTooltip + scope + source.ruby, source.ruby.rails + uuid + 63F3B3B7-CBE2-426B-B551-657733F3868B + + diff --git a/bundles/ruby.tmbundle/Commands/Make Destructive Call.plist b/bundles/ruby.tmbundle/Commands/Make Destructive Call.plist new file mode 100644 index 000000000..39eb6d1b6 --- /dev/null +++ b/bundles/ruby.tmbundle/Commands/Make Destructive Call.plist @@ -0,0 +1,29 @@ + + + + + beforeRunningCommand + nop + command + res=$(ruby "$TM_BUNDLE_SUPPORT/bin/make_destructive.rb") + +if [ "$res" = "" ] + then exit_show_tool_tip "Retry this command without a selection." + else echo -n "$res" +fi + fallbackInput + line + input + selection + keyEquivalent + ^! + name + Add ! to Method in Line / Selection + output + insertAsSnippet + scope + source.ruby + uuid + 7F79BC8D-8A4F-4570-973B-05DFEC25747F + + diff --git a/bundles/ruby.tmbundle/Commands/New Method.plist b/bundles/ruby.tmbundle/Commands/New Method.plist new file mode 100644 index 000000000..3cfd6dd1c --- /dev/null +++ b/bundles/ruby.tmbundle/Commands/New Method.plist @@ -0,0 +1,39 @@ + + + + + beforeRunningCommand + nop + command + #!/usr/bin/env ruby -wKU + +require "#{ENV['TM_SUPPORT_PATH']}/lib/exit_codes" +require "#{ENV['TM_SUPPORT_PATH']}/lib/escape" + +method_name = ENV["TM_SELECTED_TEXT"] || ENV["TM_CURRENT_WORD"] or + TextMate.exit_show_tool_tip( + "Please type the new function's name or use the def⇥ snippet." + ) + +print <<END_SNIPPET +def #{e_sn method_name}\${1/.+/(/}\${1:args}\${1/.+/)/} + \$0 +end +END_SNIPPET + + fallbackInput + word + input + selection + keyEquivalent + $ + name + New Method + output + insertAsSnippet + scope + source.ruby + uuid + 0275EF39-9357-408F-AF20-79E415CA9504 + + diff --git a/bundles/ruby.tmbundle/Commands/Omit from RDoc.tmCommand b/bundles/ruby.tmbundle/Commands/Omit from RDoc.tmCommand new file mode 100644 index 000000000..b9cc7aeb9 --- /dev/null +++ b/bundles/ruby.tmbundle/Commands/Omit from RDoc.tmCommand @@ -0,0 +1,31 @@ + + + + + beforeRunningCommand + nop + command + #!/usr/bin/env ruby +s = STDIN.read +puts "\#--" +if s== "" + puts "\# $0","\#++" +else + puts s, "\#++", "$0" +end + fallbackInput + line + input + selection + keyEquivalent + ^@O + name + Omit + output + insertAsSnippet + scope + source.ruby + uuid + BF4CA9F1-51CD-48D4-8357-852234F59046 + + diff --git a/bundles/ruby.tmbundle/Commands/Open Require.tmCommand b/bundles/ruby.tmbundle/Commands/Open Require.tmCommand new file mode 100644 index 000000000..aa4a63358 --- /dev/null +++ b/bundles/ruby.tmbundle/Commands/Open Require.tmCommand @@ -0,0 +1,65 @@ + + + + + beforeRunningCommand + nop + command + #!/usr/bin/env ruby + +require "#{ENV['TM_SUPPORT_PATH']}/lib/ui.rb" +require "#{ENV['TM_SUPPORT_PATH']}/lib/textmate.rb" + +REQUIRE_RE = /^\s*(?:require|load)\s*(['"])([^'"#]+?)(?:\.rb)?\1[ \t]*$/ + +gems_installed = begin + require 'rubygems' + true + rescue LoadError + false + end + +requires = if ENV['TM_CURRENT_LINE'].to_s =~ REQUIRE_RE + ["#{$2}.rb"] + else + $stdin.read.scan(REQUIRE_RE).map { |_, path| "#{path}.rb" } + end +abort 'No includes found.' if requires.empty? + +file = if requires.size > 1 + choice = TextMate::UI.menu(requires) or exit + requires[choice] + else + requires.pop + end +dir = $LOAD_PATH.find { |dir| File.exist? File.join(dir, file) } +if not dir and gems_installed and gem_spec = Gem::GemPathSearcher.new.find(file) + dir = File.join(gem_spec.full_gem_path, gem_spec.require_path) +end + +if file and dir + dir.sub!(%r{\A\.(?=/|\z)}, ENV['TM_DIRECTORY']) if ENV['TM_DIRECTORY'] + file_path = File.join(dir, file) +# puts file_path + TextMate.go_to :file => file_path + exit +else + puts "File not found: #{file}" +end + + fallbackInput + document + input + selection + keyEquivalent + @D + name + Open Require + output + showAsTooltip + scope + source.ruby + uuid + 8646378E-91F5-4771-AC7C-43FC49A93576 + + diff --git a/bundles/ruby.tmbundle/Commands/Run Rake Task.tmCommand b/bundles/ruby.tmbundle/Commands/Run Rake Task.tmCommand new file mode 100644 index 000000000..2d40b66f8 --- /dev/null +++ b/bundles/ruby.tmbundle/Commands/Run Rake Task.tmCommand @@ -0,0 +1,27 @@ + + + + + beforeRunningCommand + nop + command + export RUBYLIB="$TM_BUNDLE_SUPPORT/RakeMate${RUBYLIB:+:$RUBYLIB}" +export TM_RUBY=$(which "${TM_RUBY:-ruby}") +export TM_RAKE=$(which "${TM_RAKE:-rake}") + +"${TM_RUBY}" -- "$TM_BUNDLE_SUPPORT/RakeMate/rake_mate.rb" + + input + none + keyEquivalent + ^R + name + Run Rake Task + output + showAsHTML + scope + source.ruby + uuid + 569C9822-8C41-4907-94C7-1A8A0031B66D + + diff --git a/bundles/ruby.tmbundle/Commands/Run focused unit test.plist b/bundles/ruby.tmbundle/Commands/Run focused unit test.plist new file mode 100644 index 000000000..fe3e4ca14 --- /dev/null +++ b/bundles/ruby.tmbundle/Commands/Run focused unit test.plist @@ -0,0 +1,35 @@ + + + + + beforeRunningCommand + nop + captureFormatString + $0 + capturePattern + (/[^:]+):(\d+) + command + #!/bin/sh + +export RUBYLIB="$TM_BUNDLE_SUPPORT/RubyMate${RUBYLIB:+:$RUBYLIB}" + +/usr/bin/env ruby -KU -- "$TM_BUNDLE_SUPPORT/RubyMate/run_script.rb" --name= + + fileCaptureRegister + 1 + input + document + keyEquivalent + @R + lineCaptureRegister + 2 + name + Run Focused Unit Test + output + showAsHTML + scope + source.ruby + uuid + 5289EE40-86B8-11D9-A8D4-000A95E13C98 + + diff --git a/bundles/ruby.tmbundle/Commands/Run.tmCommand b/bundles/ruby.tmbundle/Commands/Run.tmCommand new file mode 100644 index 000000000..b2baaac21 --- /dev/null +++ b/bundles/ruby.tmbundle/Commands/Run.tmCommand @@ -0,0 +1,29 @@ + + + + + autoScrollOutput + + beforeRunningCommand + nop + command + #!/bin/sh + +export RUBYLIB="$TM_BUNDLE_SUPPORT/RubyMate${RUBYLIB:+:$RUBYLIB}" + +/usr/bin/env ruby -KU -- "$TM_BUNDLE_SUPPORT/RubyMate/run_script.rb" + + input + document + keyEquivalent + @r + name + Run + output + showAsHTML + scope + source.ruby + uuid + 35222962-C50D-4D58-A6AE-71E7AD980BE4 + + diff --git a/bundles/ruby.tmbundle/Commands/Show RDoc for this file.plist b/bundles/ruby.tmbundle/Commands/Show RDoc for this file.plist new file mode 100644 index 000000000..f9e0868d8 --- /dev/null +++ b/bundles/ruby.tmbundle/Commands/Show RDoc for this file.plist @@ -0,0 +1,37 @@ + + + + + beforeRunningCommand + saveActiveFile + command + if (( ${#TM_PROJECT_DIRECTORY} != 0 )); then + cd "$TM_PROJECT_DIRECTORY" + output="`basename "$TM_PROJECT_DIRECTORY"`" + input="." +else + cd "$TM_DIRECTORY" + output="$TM_FILENAME" + input="$TM_FILENAME" +fi + +output_dir="/tmp/rdoc_${output}" + +rm -rf "${output_dir}" + +rdoc -S -N -q -f html --op "${output_dir}" "$input" &>/dev/null + +echo "<html><head><meta http-equiv=\"refresh\" content=\"0;URL=tm-file://${output_dir}/index.html\"></head></html>" + + input + none + name + Show for Current File / Project + output + showAsHTML + scope + source.ruby + uuid + 1AD6A138-2E89-4D6A-AB3F-416BF9CE968D + + diff --git a/bundles/ruby.tmbundle/Commands/Toggle ERb Tags.tmCommand b/bundles/ruby.tmbundle/Commands/Toggle ERb Tags.tmCommand new file mode 100644 index 000000000..36dfed029 --- /dev/null +++ b/bundles/ruby.tmbundle/Commands/Toggle ERb Tags.tmCommand @@ -0,0 +1,59 @@ + + + + + beforeRunningCommand + nop + command + #!/usr/bin/env ruby -w + +require "#{ENV["TM_SUPPORT_PATH"]}/lib/escape" +require "enumerator" + +TAGS = %w[<%= <%# <%- <%].freeze + +# locate caret (Allan's code) +line = ENV['TM_LINE_NUMBER'].to_i - ENV['TM_INPUT_START_LINE'].to_i +col = ENV['TM_LINE_INDEX'].to_i +if ENV['TM_LINE_NUMBER'].to_i == ENV['TM_INPUT_START_LINE'].to_i + col -= ENV['TM_INPUT_START_LINE_INDEX'].to_i +end + +# read input +input = $stdin.read + +# snippetize output +lines = RUBY_VERSION < "1.9" ? input.to_a : input.lines.to_a +lines[line] = e_sn(lines[line][0...col]) + "${0}" + e_sn(lines[line][col..-1]) +enum = RUBY_VERSION < "1.9" ? lines.enum_with_index : + lines.each.with_index +output = enum.inject(String.new) do |out, (l, i)| + i == line ? out + l : out + e_sn(l) +end + +# swap ERb tags +result = output.sub(/\A<%[-#=]?/) { |match| TAGS[TAGS.index(match) - 1] } +if result[2] == ?- + result.sub!(/%>\Z/, "-%>") +else + result.sub!(/-%>\Z/, "%>") +end +print result + disableOutputAutoIndent + + fallbackInput + scope + input + selection + keyEquivalent + ^> + name + Toggle ERb Tags + output + insertAsSnippet + scope + source.ruby.embedded, source.ruby.rails.embedded, comment.block.erb, meta.erb + uuid + 835FAAC6-5431-436C-998B-241F7226B99B + + diff --git a/bundles/ruby.tmbundle/Commands/Toggle Quote Style.plist b/bundles/ruby.tmbundle/Commands/Toggle Quote Style.plist new file mode 100644 index 000000000..16de1a596 --- /dev/null +++ b/bundles/ruby.tmbundle/Commands/Toggle Quote Style.plist @@ -0,0 +1,55 @@ + + + + + beforeRunningCommand + nop + command + #!/usr/bin/env ruby + +class String + def escape(char) + gsub(/\\.|#{Regexp.quote(char)}/) { |match| match == char ? "\\#{char}" : match } + end + + def unescape(char) + gsub(/\\./) { |match| match == "\\#{char}" ? char : match } + end +end + +print case str = STDIN.read + # Handle standard quotes + when /\A"(.*)"\z/m; "'" + $1.unescape('"').escape("'") + "'" + when /\A'(.*)'\z/m; "%Q{" + $1.unescape("'").escape("}") + "}" + when /\A%[Qq]?\{(.*)\}\z/m; '"' + $1.unescape("}").escape('"') + '"' + + # Handle the more esoteric quote styles + when /\A%[Qq]?\[(.*)(\])\z/m, + /\A%[Qq]?\((.*)(\))\z/m, + /\A%[Qq]?<(.*)(>)\z/m; '"' + $1.unescape($2).escape('"') + '"' + when /\A%[Qq]?(.)(.*)\1\z/m; '"' + $2.unescape($1).escape('"') + '"' + + # Handle shell escapes + when /\A`(.*)`\z/m; "%x{" + $1.unescape("`").escape("}") + "}" + when /\A%x\{(.*)\}\z/m; "`" + $1.unescape("}").escape("`") + "`" + + # Default case + else str +end + + fallbackInput + scope + input + selection + keyEquivalent + ^" + name + Toggle Quote Style + output + replaceSelectedText + scope + source.ruby string.quoted.double, source.ruby string.quoted.single, source.ruby string + uuid + 6519CB08-8326-4B77-A251-54722FFBFC1F + + diff --git a/bundles/ruby.tmbundle/Commands/Toggle String:Symbol.tmCommand b/bundles/ruby.tmbundle/Commands/Toggle String:Symbol.tmCommand new file mode 100644 index 000000000..e97971296 --- /dev/null +++ b/bundles/ruby.tmbundle/Commands/Toggle String:Symbol.tmCommand @@ -0,0 +1,35 @@ + + + + + beforeRunningCommand + nop + bundleUUID + 467B298F-6227-11D9-BFB1-000D93589AF6 + command + #!/usr/bin/env ruby + +print case str = STDIN.read + # Handle standard quotes + when /\A["'](\w+)["']\z/ then ":" + $1 + when /\A:(\w+)\z/ then '"' + $1 + '"' + # Default case + else str +end + + fallbackInput + scope + input + selection + keyEquivalent + ^: + name + Toggle String / Symbol + output + replaceSelectedText + scope + source.ruby string.quoted, source.ruby constant.other.symbol.ruby + uuid + B297E4B8-A8FF-49CE-B9C4-6D4911724D43 + + diff --git a/bundles/ruby.tmbundle/Commands/Toggle ‘do … end’ : ‘{ … }’.tmCommand b/bundles/ruby.tmbundle/Commands/Toggle ‘do … end’ : ‘{ … }’.tmCommand new file mode 100644 index 000000000..29ef44b62 --- /dev/null +++ b/bundles/ruby.tmbundle/Commands/Toggle ‘do … end’ : ‘{ … }’.tmCommand @@ -0,0 +1,150 @@ + + + + + beforeRunningCommand + nop + command + #!/usr/bin/env ruby -KU +# encoding: UTF-8 + +require "rexml/text" +require "#{ENV["TM_SUPPORT_PATH"]}/lib/escape" + +# transform XML into normal and sanitized Ruby +ruby, safe_ruby, scope = "", "", [] +STDIN.read.scan(/<(.*?)>|([^<]+)/) do + if $1 + if $1[0] == ?/ + scope.pop + else + scope.push($1) + end + else + unescaped = REXML::Text.unnormalize($2) + ruby << unescaped + # strip strings, regexes, and comments from safe_ruby but leave byte count + if scope.any? { |s| s =~ /\A(?:string|comment)\b/ } + safe_ruby << " " * unescaped.length + else + safe_ruby << unescaped + end + end +end + +# find and mark the cursor +line_number = ENV["TM_LINE_NUMBER"].to_i +input_start_line = ENV["TM_INPUT_START_LINE"].to_i +row = line_number - input_start_line +col = ENV["TM_LINE_INDEX"].to_i +if line_number == input_start_line + col -= ENV["TM_INPUT_START_LINE_INDEX"].to_i +end +cursor = ruby[/\A(?:.*\n){#{row - 1}}.{#{col}}/].size +CURSOR = [0xFFFC].pack("U") +B = "(?:\\b|#{CURSOR})" # Note: /\w/u includes CURSOR +ruby[cursor, 0] = CURSOR +safe_ruby[cursor, 0] = CURSOR + +# find the block nearest to the cursor +block_start, block_length = nil, nil +loop do + block_start = safe_ruby.rindex( /(\{|#{B}do#{B})/, + block_start.nil? ? cursor : block_start - 1 ) + if block_start.nil? # block not found: give up and don't change the document + print e_sn(ruby).sub(CURSOR, "$0") + exit + end + block_length, nesting = 0, [] + if $1 == "{" + re, starts, stop = /\{|\}|[^{}]+/, ["{"], "}" + else + re, starts, stop = /#{B}do#{B}|#{B}end#{B}|./m, ["do"], "end" + end + safe_ruby[block_start..-1].scan(re) do |token| + block_length += token.length + token.sub!(/\A#{CURSOR}/, "") + token.sub!(/#{CURSOR}\z/, "") + case token + when *starts + nesting << token + when stop + if nesting.last.nil? + nesting << nil + break + else + nesting.pop + break if nesting.empty? + end + end + end + break if nesting.empty? and ruby[block_start, block_length].include? CURSOR +end +block = ruby[block_start, block_length] + +# toggle the block +if block[0] == ?{ + block = block[1..-2] + if block.include? "\n" + block[0, 0] = " " if block =~ /\A#{CURSOR}?[A-Za-z0-9_]/ + block << " " if block =~ /[A-Za-z0-9_]#{CURSOR}?\z/ + block = "do#{block}end" + else # expand the block + block.strip! + lines = %w[do] + if block.sub!(/\A(#{CURSOR}?(\s*)\|[^|]*\|)/, "") + lines.first << "#{' ' if $2.empty?}#{$1}" + end + indent = ruby[0...block_start][/^([ \t]*).*\Z/, 1] + tab = ( ENV["TM_SOFT_TABS"] == "YES" ? " " * ENV["TM_TAB_SIZE"].to_i : + "\t" ) + lines << "#{indent}#{tab}#{block.strip}" + lines << "#{indent}end" + block = lines.join("\n") + end +else + block = block[2..-4] + if block.include? "\n" # collapse the block + lines = block.send(block.respond_to?(:lines) ? :lines : :to_s).to_a + lines.first.send( + "#{'r' if lines.first =~ /\A\s*#{CURSOR}?\s*\|[^|]*\|/}strip!" + ) + lines[1..-1].each do |line| + line.strip! + end + lines.first << "; " unless lines.first =~ + /\A\s*#{CURSOR}?\s*(?:\|[^|]*\|)?\s*#{CURSOR}?\z/ + lines.first << " " unless lines.first =~ /\s\z/ + lines[1..-2].each do |line| + line << "; " + end + lines[-2].sub!(/; \z/, "") if lines.size > 2 and lines.last.empty? + cursor_by_end = lines.size > 2 && lines.last == CURSOR + lines[-2].sub!(/; \z/, " ") if cursor_by_end + block = "{#{lines.join}#{' ' unless cursor_by_end}}" + else + block = "{#{block}}" + end +end + +# replace document +print e_sn(ruby[0...block_start]) +print e_sn(block).sub(CURSOR, "$0") +print e_sn(ruby[(block_start + block_length)..-1]) + + input + selection + inputFormat + xml + keyEquivalent + ^{ + name + Toggle ‘do … end’ / ‘{ … }’ + output + insertAsSnippet + scope + source.ruby + uuid + 59E811FF-E722-46BE-8938-04713612FABB + + diff --git a/bundles/ruby.tmbundle/Commands/word_wrap() (worw).plist b/bundles/ruby.tmbundle/Commands/word_wrap() (worw).plist new file mode 100644 index 000000000..5cdad7504 --- /dev/null +++ b/bundles/ruby.tmbundle/Commands/word_wrap() (worw).plist @@ -0,0 +1,31 @@ + + + + + beforeRunningCommand + nop + command + #!/usr/bin/env ruby +$: << ENV['TM_SUPPORT_PATH'] + '/lib' +require "ui" +TextMate::UI.request_string(:title => "Wrap Size", + :prompt => "Enter a character width:", + :button1 => "Build Snippet") do |col| + col = col.to_i + print %Q{gsub!(/(.{1,#{col}}|\\S{#{col + 1},})(?: +|$\\n?)/, "\\\\1\\n")} +end + + input + none + name + word_wrap() + output + afterSelectedText + scope + source.ruby + tabTrigger + worw + uuid + 97054C4D-E4A3-45B1-9C00-B82DBCB30CAD + + diff --git a/bundles/ruby.tmbundle/DragCommands/Require Ruby File.tmDragCommand b/bundles/ruby.tmbundle/DragCommands/Require Ruby File.tmDragCommand new file mode 100644 index 000000000..f8ea01ea6 --- /dev/null +++ b/bundles/ruby.tmbundle/DragCommands/Require Ruby File.tmDragCommand @@ -0,0 +1,39 @@ + + + + + beforeRunningCommand + nop + command + #!/usr/bin/env ruby -wKU + +require 'pathname' + +require "#{ENV['TM_SUPPORT_PATH']}/lib/escape.rb" + +from_path = Pathname.new(ENV['TM_FILEPATH'] || '.').dirname.realpath +to_path = Pathname.new(ENV['TM_DROPPED_FILE']).realpath +begin + path = to_path.relative_path_from(from_path) +rescue ArgumentError + path = to_path +end +lib = path.to_s.sub(/\.rb\z/i, '') +puts %Q{require "#{e_sn(lib).gsub('"', '\"')}"} + + draggedFileExtensions + + rb + + input + selection + name + Require Ruby File + output + insertAsSnippet + scope + source.ruby + uuid + C122CD92-DDBE-4869-9C7A-CC2B254C9411 + + diff --git a/bundles/ruby.tmbundle/Macros/Benchmark_bmbm(__) do __ end.tmMacro b/bundles/ruby.tmbundle/Macros/Benchmark_bmbm(__) do __ end.tmMacro new file mode 100644 index 000000000..96fa6c082 --- /dev/null +++ b/bundles/ruby.tmbundle/Macros/Benchmark_bmbm(__) do __ end.tmMacro @@ -0,0 +1,54 @@ + + + + + commands + + + command + moveToBeginningOfDocumentAndModifySelection: + + + argument + + command + insert_requires.rb benchmark + input + selection + output + insertAsSnippet + + command + executeCommandWithOptions: + + + argument + + content + TESTS = ${1:10_000} +Benchmark.bmbm do |results| + $0 +end + name + Benchmark.bmbm do .. end + scope + source.ruby + tabTrigger + bm- + uuid + 942F20E2-C40A-44B8-A3F2-99AAC68CB534 + + command + insertSnippetWithOptions: + + + name + Benchmark.bmbm do .. end + scope + source.ruby + tabTrigger + bm + uuid + C649F945-DAB8-4DA2-B73C-2EFF9D7D34F3 + + diff --git a/bundles/ruby.tmbundle/Macros/Delete forward:backward.tmMacro b/bundles/ruby.tmbundle/Macros/Delete forward:backward.tmMacro new file mode 100644 index 000000000..0c8a71322 --- /dev/null +++ b/bundles/ruby.tmbundle/Macros/Delete forward:backward.tmMacro @@ -0,0 +1,25 @@ + + + + + commands + + + command + deleteBackward: + + + command + deleteForward: + + + keyEquivalent +  + name + Delete forward/backward + scope + source.ruby.embedded.source.empty + uuid + A83F68A9-F751-4BB4-AE16-56812878C16A + + diff --git a/bundles/ruby.tmbundle/Macros/Overwrite } in #{ .. }.plist b/bundles/ruby.tmbundle/Macros/Overwrite } in #{ .. }.plist new file mode 100644 index 000000000..4845d9652 --- /dev/null +++ b/bundles/ruby.tmbundle/Macros/Overwrite } in #{ .. }.plist @@ -0,0 +1,54 @@ + + + + + commands + + + command + moveRightAndModifySelection: + + + argument + + action + replaceAll + findInProjectIgnoreCase + + findString + ((?m:.){2,})|\}|([^}]) + ignoreCase + + regularExpression + + replaceAllScope + selection + replaceString + $1}$2 + wrapAround + + + command + findWithOptions: + + + command + moveLeft: + + + command + moveRight: + + + keyEquivalent + } + name + Overwrite '}' in #{ .. } + scope + source.ruby string.quoted source.ruby.embedded + scopeType + local + uuid + E5158F94-CC52-4424-A495-14EF9272653F + + diff --git a/bundles/ruby.tmbundle/Macros/PStore_new( __ ).tmMacro b/bundles/ruby.tmbundle/Macros/PStore_new( __ ).tmMacro new file mode 100644 index 000000000..c7604d0b3 --- /dev/null +++ b/bundles/ruby.tmbundle/Macros/PStore_new( __ ).tmMacro @@ -0,0 +1,51 @@ + + + + + commands + + + command + moveToBeginningOfDocumentAndModifySelection: + + + argument + + command + insert_requires.rb pstore + input + selection + output + insertAsSnippet + + command + executeCommandWithOptions: + + + argument + + content + PStore.new(${1:"${2:file_name.pstore}"}) + name + PStore.new( .. ) + scope + source.ruby + tabTrigger + Pn- + uuid + 5B46ECFD-23A4-4F0C-9951-F64C19C72C2B + + command + insertSnippetWithOptions: + + + name + PStore.new( .. ) + scope + source.ruby + tabTrigger + Pn + uuid + 5AE7CFB4-418E-4E00-AD76-06DB755EE876 + + diff --git a/bundles/ruby.tmbundle/Macros/YAML.dump(.., file) (Yd).plist b/bundles/ruby.tmbundle/Macros/YAML.dump(.., file) (Yd).plist new file mode 100644 index 000000000..0025b572b --- /dev/null +++ b/bundles/ruby.tmbundle/Macros/YAML.dump(.., file) (Yd).plist @@ -0,0 +1,57 @@ + + + + + commands + + + command + moveToBeginningOfDocumentAndModifySelection: + + + argument + + command + insert_requires.rb yaml + input + selection + output + insertAsSnippet + + command + executeCommandWithOptions: + + + argument + + bundlePath + /Users/james/Library/Application Support/TextMate/Bundles/Ruby Idioms.tmbundle + content + File.open(${1:"${2:path/to/file}.yaml"}, "w") { |${3:file}| YAML.dump(${4:obj}, ${3:file}) } + scope + source.ruby + supportPath + /Users/james/Library/Application Support/TextMate/Bundles/Ruby Idioms.tmbundle/Support + tabTrigger + Yd- + uuid + 3BA6762A-BB6B-489E-8006-F30F386AEF48 + + command + insertSnippetWithOptions: + + + keyEquivalent + + name + YAML.dump(.., file) + scope + source.ruby + scopeType + local + tabTrigger + Yd + uuid + 9460392B-C036-4A76-A5AE-1191F10E4B1B + + diff --git a/bundles/ruby.tmbundle/Macros/YAML.load(file) (Yl).plist b/bundles/ruby.tmbundle/Macros/YAML.load(file) (Yl).plist new file mode 100644 index 000000000..84b2534c8 --- /dev/null +++ b/bundles/ruby.tmbundle/Macros/YAML.load(file) (Yl).plist @@ -0,0 +1,57 @@ + + + + + commands + + + command + moveToBeginningOfDocumentAndModifySelection: + + + argument + + command + insert_requires.rb yaml + input + selection + output + insertAsSnippet + + command + executeCommandWithOptions: + + + argument + + bundlePath + /Users/james/Library/Application Support/TextMate/Bundles/Ruby Idioms.tmbundle + content + File.open(${1:"${2:path/to/file}.yaml"}) { |${3:file}| YAML.load(${3:file}) } + scope + source.ruby + supportPath + /Users/james/Library/Application Support/TextMate/Bundles/Ruby Idioms.tmbundle/Support + tabTrigger + Yl- + uuid + 8343ACF4-EEB7-44B5-B835-94826466D4D5 + + command + insertSnippetWithOptions: + + + keyEquivalent + + name + YAML.load(file) + scope + source.ruby + scopeType + local + tabTrigger + Yl + uuid + 2C07D4E7-D74F-4AE4-82BE-B0BA82247AFA + + diff --git a/bundles/ruby.tmbundle/Macros/class .. < DelegateClass .. initialize .. end (class).plist b/bundles/ruby.tmbundle/Macros/class .. < DelegateClass .. initialize .. end (class).plist new file mode 100644 index 000000000..e0cbb0f47 --- /dev/null +++ b/bundles/ruby.tmbundle/Macros/class .. < DelegateClass .. initialize .. end (class).plist @@ -0,0 +1,63 @@ + + + + + commands + + + command + moveToBeginningOfDocumentAndModifySelection: + + + argument + + command + insert_requires.rb delegate + input + selection + output + insertAsSnippet + + command + executeCommandWithOptions: + + + argument + + bundlePath + /Users/james/Library/Application Support/TextMate/Bundles/Ruby Idioms.tmbundle + content + class ${1:${TM_FILENAME/(?:\A|_)([A-Za-z0-9]+)(?:\.rb)?/(?2::\u$1)/g}} < DelegateClass(${2:ParentClass}) + def initialize${3/(^.*?\S.*)|.*/(?1:\()/}${3:args}${3/(^.*?\S.*)|.*/(?1:\))/} + super(${4:del_obj}) + + $0 + end + + +end + scope + source.ruby + supportPath + /Users/james/Library/Application Support/TextMate/Bundles/Ruby Idioms.tmbundle/Support + tabTrigger + class- + uuid + AFE1D078-EA16-45F5-AD8A-FAC1B523D861 + + command + insertSnippetWithOptions: + + + name + class .. < DelegateClass .. initialize .. end + scope + source.ruby + scopeType + local + tabTrigger + cla + uuid + 121B334B-2AA6-4E9A-A8B8-BF93B627982B + + diff --git a/bundles/ruby.tmbundle/Macros/each_char { |chr| .. } (eac).plist b/bundles/ruby.tmbundle/Macros/each_char { |chr| .. } (eac).plist new file mode 100644 index 000000000..de9c34445 --- /dev/null +++ b/bundles/ruby.tmbundle/Macros/each_char { |chr| .. } (eac).plist @@ -0,0 +1,55 @@ + + + + + commands + + + command + moveToBeginningOfDocumentAndModifySelection: + + + argument + + command + insert_requires.rb jcode + input + selection + output + insertAsSnippet + + command + executeCommandWithOptions: + + + argument + + bundlePath + /Users/james/Library/Application Support/TextMate/Bundles/Ruby Idioms.tmbundle + content + each_char { |${1:chr}| $0 } + scope + source.ruby + supportPath + /Users/james/Library/Application Support/TextMate/Bundles/Ruby Idioms.tmbundle/Support + tabTrigger + eac- + uuid + FDD73070-6D32-4301-A86A-C55B77C3D8ED + + command + insertSnippetWithOptions: + + + name + each_char { |chr| .. } + scope + source.ruby + scopeType + local + tabTrigger + eac + uuid + 7E084412-80E6-4B70-8092-C03D1ECE4CD2 + + diff --git a/bundles/ruby.tmbundle/Macros/each_cons(..) { |group| .. } (eac).plist b/bundles/ruby.tmbundle/Macros/each_cons(..) { |group| .. } (eac).plist new file mode 100644 index 000000000..3bec50ee6 --- /dev/null +++ b/bundles/ruby.tmbundle/Macros/each_cons(..) { |group| .. } (eac).plist @@ -0,0 +1,55 @@ + + + + + commands + + + command + moveToBeginningOfDocumentAndModifySelection: + + + argument + + command + insert_requires.rb enumerator + input + selection + output + insertAsSnippet + + command + executeCommandWithOptions: + + + argument + + bundlePath + /Users/james/Library/Application Support/TextMate/Bundles/Ruby Idioms.tmbundle + content + each_cons(${1:2}) { |${2:group}| $0 } + scope + source.ruby + supportPath + /Users/james/Library/Application Support/TextMate/Bundles/Ruby Idioms.tmbundle/Support + tabTrigger + eac- + uuid + 3C04589C-5127-478E-97B3-CA7DD2EA7ECD + + command + insertSnippetWithOptions: + + + name + each_cons(..) { |group| .. } + scope + source.ruby + scopeType + local + tabTrigger + eac + uuid + EC73D5CC-5F05-46B9-A6F4-82037E4A38C9 + + diff --git a/bundles/ruby.tmbundle/Macros/each_slice(..) { |group| .. } (eas).plist b/bundles/ruby.tmbundle/Macros/each_slice(..) { |group| .. } (eas).plist new file mode 100644 index 000000000..d9540b75a --- /dev/null +++ b/bundles/ruby.tmbundle/Macros/each_slice(..) { |group| .. } (eas).plist @@ -0,0 +1,55 @@ + + + + + commands + + + command + moveToBeginningOfDocumentAndModifySelection: + + + argument + + command + insert_requires.rb enumerator + input + selection + output + insertAsSnippet + + command + executeCommandWithOptions: + + + argument + + bundlePath + /Users/james/Library/Application Support/TextMate/Bundles/Ruby Idioms.tmbundle + content + each_slice(${1:2}) { |${2:group}| $0 } + scope + source.ruby + supportPath + /Users/james/Library/Application Support/TextMate/Bundles/Ruby Idioms.tmbundle/Support + tabTrigger + eas- + uuid + CD748479-D2A4-4AB5-95BD-4C89512BA210 + + command + insertSnippetWithOptions: + + + name + each_slice(..) { |group| .. } + scope + source.ruby + scopeType + local + tabTrigger + eas + uuid + 825B721D-4367-4DF7-98C0-F005695DF9E3 + + diff --git a/bundles/ruby.tmbundle/Macros/extend Forwardable (Forw).plist b/bundles/ruby.tmbundle/Macros/extend Forwardable (Forw).plist new file mode 100644 index 000000000..a2ea671eb --- /dev/null +++ b/bundles/ruby.tmbundle/Macros/extend Forwardable (Forw).plist @@ -0,0 +1,55 @@ + + + + + commands + + + command + moveToBeginningOfDocumentAndModifySelection: + + + argument + + command + insert_requires.rb forwardable + input + selection + output + insertAsSnippet + + command + executeCommandWithOptions: + + + argument + + bundlePath + /Users/james/Library/Application Support/TextMate/Bundles/Ruby Idioms.tmbundle + content + extend Forwardable + scope + source.ruby + supportPath + /Users/james/Library/Application Support/TextMate/Bundles/Ruby Idioms.tmbundle/Support + tabTrigger + Forw- + uuid + 7F46C90A-595B-4B83-A4F7-058F63CE4218 + + command + insertSnippetWithOptions: + + + name + extend Forwardable + scope + source.ruby + scopeType + local + tabTrigger + Forw + uuid + 58FDEA60-10AF-4C49-AA09-29B77030DB25 + + diff --git a/bundles/ruby.tmbundle/Macros/map_with_index { |e, i| .. } (mapwi).plist b/bundles/ruby.tmbundle/Macros/map_with_index { |e, i| .. } (mapwi).plist new file mode 100644 index 000000000..02fb7506b --- /dev/null +++ b/bundles/ruby.tmbundle/Macros/map_with_index { |e, i| .. } (mapwi).plist @@ -0,0 +1,55 @@ + + + + + commands + + + command + moveToBeginningOfDocumentAndModifySelection: + + + argument + + command + insert_requires.rb enumerator + input + selection + output + insertAsSnippet + + command + executeCommandWithOptions: + + + argument + + bundlePath + /Users/james/Library/Application Support/TextMate/Bundles/Ruby Idioms.tmbundle + content + enum_with_index.map { |${1:e}, ${2:i}| $0 } + scope + source.ruby + supportPath + /Users/james/Library/Application Support/TextMate/Bundles/Ruby Idioms.tmbundle/Support + tabTrigger + mapwi- + uuid + BD4CFD7B-1AC0-4569-9BDA-FD491F41F4E6 + + command + insertSnippetWithOptions: + + + name + map_with_index { |e, i| .. } + scope + source.ruby + scopeType + local + tabTrigger + mapwi + uuid + BFB65D1C-62F1-485D-8A67-3E5A2E55107C + + diff --git "a/bundles/ruby.tmbundle/Macros/require_gem \"__\".tmMacro" "b/bundles/ruby.tmbundle/Macros/require_gem \"__\".tmMacro" new file mode 100644 index 000000000..bc81569d2 --- /dev/null +++ "b/bundles/ruby.tmbundle/Macros/require_gem \"__\".tmMacro" @@ -0,0 +1,51 @@ + + + + + commands + + + command + moveToBeginningOfDocumentAndModifySelection: + + + argument + + command + insert_requires.rb rubygems + input + selection + output + insertAsSnippet + + command + executeCommandWithOptions: + + + argument + + content + require "$0" + name + require_gem ".." + scope + source.ruby + tabTrigger + reqg- + uuid + 34FEBB9F-73CD-4DD4-A0A3-1CF2A5E3DE78 + + command + insertSnippetWithOptions: + + + name + require_gem ".." + scope + source.ruby + tabTrigger + reqg + uuid + 33969819-62C5-4E03-B824-C2337205F364 + + diff --git a/bundles/ruby.tmbundle/Macros/xmlread(__).tmMacro b/bundles/ruby.tmbundle/Macros/xmlread(__).tmMacro new file mode 100644 index 000000000..6efb2ad33 --- /dev/null +++ b/bundles/ruby.tmbundle/Macros/xmlread(__).tmMacro @@ -0,0 +1,51 @@ + + + + + commands + + + command + moveToBeginningOfDocumentAndModifySelection: + + + argument + + command + insert_requires.rb rexml/document + input + selection + output + insertAsSnippet + + command + executeCommandWithOptions: + + + argument + + content + REXML::Document.new(File.read(${1:"${2:path/to/file}"})) + name + xmlread(..) + scope + source.ruby + tabTrigger + xml- + uuid + B904D4AA-D15D-48A4-8EB2-563BAF489332 + + command + insertSnippetWithOptions: + + + name + xmlread(..) + scope + source.ruby + tabTrigger + xml + uuid + F6BF907E-FDF7-4D9B-9E57-BE159561349D + + diff --git a/bundles/ruby.tmbundle/Preferences/Block typing pairs.plist b/bundles/ruby.tmbundle/Preferences/Block typing pairs.plist new file mode 100644 index 000000000..e13b89029 --- /dev/null +++ b/bundles/ruby.tmbundle/Preferences/Block typing pairs.plist @@ -0,0 +1,42 @@ + + + + + name + Typing Pairs: Block Opening + scope + keyword.control.start-block.ruby, meta.syntax.ruby.start-block + settings + + smartTypingPairs + + + " + " + + + ( + ) + + + { + } + + + [ + ] + + + + + + + | + | + + + + uuid + 6D75102B-6E51-4360-8F12-BE12327B6AE6 + + diff --git a/bundles/ruby.tmbundle/Preferences/Comments.plist b/bundles/ruby.tmbundle/Preferences/Comments.plist new file mode 100644 index 000000000..8e0a72e27 --- /dev/null +++ b/bundles/ruby.tmbundle/Preferences/Comments.plist @@ -0,0 +1,38 @@ + + + + + name + Comments + scope + source.ruby + settings + + shellVariables + + + name + TM_COMMENT_START + value + # + + + name + TM_COMMENT_START_2 + value + =begin + + + + name + TM_COMMENT_END_2 + value + =end + + + + + uuid + 1D26F26C-C6F7-434F-84F8-FEE895372E8A + + diff --git a/bundles/ruby.tmbundle/Preferences/Completion: ENV[…] variables.tmPreferences b/bundles/ruby.tmbundle/Preferences/Completion: ENV[…] variables.tmPreferences new file mode 100644 index 000000000..c0278fc83 --- /dev/null +++ b/bundles/ruby.tmbundle/Preferences/Completion: ENV[…] variables.tmPreferences @@ -0,0 +1,17 @@ + + + + + name + Completion: ENV[…] variables + scope + meta.environment-variable.ruby string.quoted + settings + + completionCommand + env|grep "^$TM_CURRENT_WORD"|sort|cut -d= -f1 + + uuid + 1A7701FA-D866-498C-AD4C-7846538DB535 + + diff --git a/bundles/ruby.tmbundle/Preferences/Completion: require strings.tmPreferences b/bundles/ruby.tmbundle/Preferences/Completion: require strings.tmPreferences new file mode 100644 index 000000000..60bdb4b76 --- /dev/null +++ b/bundles/ruby.tmbundle/Preferences/Completion: require strings.tmPreferences @@ -0,0 +1,22 @@ + + + + + name + Completion: require strings + scope + meta.require.ruby string.quoted + settings + + completionCommand + #!/usr/bin/env ruby + ptrn = /^#{Regexp.escape ENV["TM_CURRENT_WORD"].to_s}[^.]+\..+/ + puts( $LOAD_PATH.inject([]) do |res, path| + res << Dir.new(path).grep(ptrn) { |file| file[/^[^.]+/] } if File.exists?(path) + res + end.sort.uniq ) + + uuid + AEDD6A5F-417F-4177-8589-B07518ACA9DE + + diff --git a/bundles/ruby.tmbundle/Preferences/Miscellaneous.plist b/bundles/ruby.tmbundle/Preferences/Miscellaneous.plist new file mode 100644 index 000000000..81bd04023 --- /dev/null +++ b/bundles/ruby.tmbundle/Preferences/Miscellaneous.plist @@ -0,0 +1,44 @@ + + + + + name + Indent + scope + source.ruby + settings + + decreaseIndentPattern + ^\s*([}\]]\s*$|(end|rescue|ensure|else|elsif|when)\b) + increaseIndentPattern + (?x)^ + (\s* + (module|class|def + |unless|if|else|elsif + |case|when + |begin|rescue|ensure + |for|while|until + |(?= .*? \b(do|begin|case|if|unless)\b ) + # the look-ahead above is to quickly discard non-candidates + ( "(\\.|[^\\"])*+" # eat a double quoted string + | '(\\.|[^\\'])*+' # eat a single quoted string + | [^#"'] # eat all but comments and strings + )* + ( \s (do|begin|case) + | [-+=&|*/~%^<>~](?<!\$.) \s*+ (if|unless) + ) + )\b + (?! [^;]*+ ; .*? \bend\b ) + |( "(\\.|[^\\"])*+" # eat a double quoted string + | '(\\.|[^\\'])*+' # eat a single quoted string + | [^#"'] # eat all but comments and strings + )* + ( \{ (?! [^}]*+ \} ) + | \[ (?! [^\]]*+ \] ) + ) + ).*$ + + uuid + 6FEAF60F-F0F3-4618-9259-DE93285F50D1 + + diff --git a/bundles/ruby.tmbundle/Preferences/Symbo List: Method.plist b/bundles/ruby.tmbundle/Preferences/Symbo List: Method.plist new file mode 100644 index 000000000..53a5abea1 --- /dev/null +++ b/bundles/ruby.tmbundle/Preferences/Symbo List: Method.plist @@ -0,0 +1,19 @@ + + + + + name + Symbol List: Method + scope + source.ruby meta.function + settings + + showInSymbolList + 1 + symbolTransformation + s/^\s*def\s+/ / + + uuid + 92E190C9-A861-4025-92D4-D6B5A24C22D4 + + diff --git a/bundles/ruby.tmbundle/Preferences/Symbol List: No Function Call.tmPreferences b/bundles/ruby.tmbundle/Preferences/Symbol List: No Function Call.tmPreferences new file mode 100644 index 000000000..0b963aaec --- /dev/null +++ b/bundles/ruby.tmbundle/Preferences/Symbol List: No Function Call.tmPreferences @@ -0,0 +1,17 @@ + + + + + name + Symbol List: No Function Call + scope + source.ruby meta.function-call entity.name.function + settings + + showInSymbolList + 0 + + uuid + A5D50494-EB97-48DE-A2BE-322DF52A7A7A + + diff --git a/bundles/ruby.tmbundle/Snippets/# encoding: UTF-8.tmSnippet b/bundles/ruby.tmbundle/Snippets/# encoding: UTF-8.tmSnippet new file mode 100644 index 000000000..7282c80ec --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/# encoding: UTF-8.tmSnippet @@ -0,0 +1,17 @@ + + + + + content + # encoding: ${1:UTF-8} + + name + # encoding: UTF-8 + scope + source.ruby + tabTrigger + utf8 + uuid + B2C3ADE8-E19E-4B87-9C6C-593D490114C7 + + diff --git a/bundles/ruby.tmbundle/Snippets/#!;usr;local;bin;ruby -w.plist b/bundles/ruby.tmbundle/Snippets/#!;usr;local;bin;ruby -w.plist new file mode 100644 index 000000000..122046007 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/#!;usr;local;bin;ruby -w.plist @@ -0,0 +1,17 @@ + + + + + content + #!/usr/bin/env ruby${TM_RUBY_SWITCHES: -wKU} + + name + #!/usr/bin/env ruby -wKU + scope + source.ruby + tabTrigger + rb + uuid + A05CBDD6-845D-45EB-94FB-F8787F5456BE + + diff --git a/bundles/ruby.tmbundle/Snippets/060 ruby if else.plist b/bundles/ruby.tmbundle/Snippets/060 ruby if else.plist new file mode 100644 index 000000000..f72cb4abd --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/060 ruby if else.plist @@ -0,0 +1,20 @@ + + + + + content + if ${1:condition} + $2 +else + $3 +end + name + if … else … end + scope + source.ruby + tabTrigger + ife + uuid + 667082E6-62C3-11D9-B8CF-000D93589AF6 + + diff --git a/bundles/ruby.tmbundle/Snippets/070 ruby if.plist b/bundles/ruby.tmbundle/Snippets/070 ruby if.plist new file mode 100644 index 000000000..4267dc2e7 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/070 ruby if.plist @@ -0,0 +1,18 @@ + + + + + content + if ${1:condition} + $0 +end + name + if … end + scope + source.ruby + tabTrigger + if + uuid + 6670835F-62C3-11D9-B8CF-000D93589AF6 + + diff --git a/bundles/ruby.tmbundle/Snippets/080 ruby case.plist b/bundles/ruby.tmbundle/Snippets/080 ruby case.plist new file mode 100644 index 000000000..35ea34dc6 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/080 ruby case.plist @@ -0,0 +1,19 @@ + + + + + content + case ${1:object} +when ${2:condition} + $0 +end + name + case … end + scope + source.ruby + tabTrigger + case + uuid + 667083EE-62C3-11D9-B8CF-000D93589AF6 + + diff --git a/bundles/ruby.tmbundle/Snippets/:yields: RDoc comment.tmSnippet b/bundles/ruby.tmbundle/Snippets/:yields: RDoc comment.tmSnippet new file mode 100644 index 000000000..7032a491f --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/:yields: RDoc comment.tmSnippet @@ -0,0 +1,16 @@ + + + + + content + :yields: ${0:arguments} + name + :yields: + scope + source.ruby comment + tabTrigger + y + uuid + ED6368FB-A11D-4622-9F42-7879481094F1 + + diff --git a/bundles/ruby.tmbundle/Snippets/Add '# =>' Marker.tmSnippet b/bundles/ruby.tmbundle/Snippets/Add '# =>' Marker.tmSnippet new file mode 100644 index 000000000..527879fb1 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/Add '# =>' Marker.tmSnippet @@ -0,0 +1,16 @@ + + + + + content + # => + name + Add ‘# =>’ Marker + scope + source.ruby + tabTrigger + # + uuid + 88BC3896-DC39-4307-A271-21D33340F15A + + diff --git a/bundles/ruby.tmbundle/Snippets/Array.new(10) { |i| .. } (Arr).plist b/bundles/ruby.tmbundle/Snippets/Array.new(10) { |i| .. } (Arr).plist new file mode 100644 index 000000000..a407c1247 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/Array.new(10) { |i| .. } (Arr).plist @@ -0,0 +1,16 @@ + + + + + content + Array.new(${1:10}) { ${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}${2:i}${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:| )/}$0 } + name + Array.new(10) { |i| .. } + scope + source.ruby + tabTrigger + Array + uuid + DAE6A754-D906-4763-B816-CE67125CEF08 + + diff --git a/bundles/ruby.tmbundle/Snippets/Benchmark_bmbm(__) do __ end.tmSnippet b/bundles/ruby.tmbundle/Snippets/Benchmark_bmbm(__) do __ end.tmSnippet new file mode 100644 index 000000000..30d675513 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/Benchmark_bmbm(__) do __ end.tmSnippet @@ -0,0 +1,19 @@ + + + + + content + TESTS = ${1:10_000} +Benchmark.bmbm do |results| + $0 +end + name + Benchmark.bmbm do .. end + scope + source.ruby + tabTrigger + bm- + uuid + 942F20E2-C40A-44B8-A3F2-99AAC68CB534 + + diff --git "a/bundles/ruby.tmbundle/Snippets/Dir.glob(\"..\") do |file| .. end (Dir).plist" "b/bundles/ruby.tmbundle/Snippets/Dir.glob(\"..\") do |file| .. end (Dir).plist" new file mode 100644 index 000000000..78929d1da --- /dev/null +++ "b/bundles/ruby.tmbundle/Snippets/Dir.glob(\"..\") do |file| .. end (Dir).plist" @@ -0,0 +1,16 @@ + + + + + content + Dir.glob(${1:"${2:dir/glob/*}"}) { |${3:file}| $0 } + name + Dir.glob("..") { |file| .. } + scope + source.ruby + tabTrigger + Dir + uuid + 332AA973-AA71-48CB-AEE9-1D71E11019AC + + diff --git "a/bundles/ruby.tmbundle/Snippets/Dir[\"__\"].tmSnippet" "b/bundles/ruby.tmbundle/Snippets/Dir[\"__\"].tmSnippet" new file mode 100644 index 000000000..e583af9c0 --- /dev/null +++ "b/bundles/ruby.tmbundle/Snippets/Dir[\"__\"].tmSnippet" @@ -0,0 +1,16 @@ + + + + + content + Dir[${1:"${2:glob/**/*.rb}"}] + name + Dir[".."] + scope + source.ruby + tabTrigger + Dir + uuid + 8EBBB26F-980E-404E-8366-74E5772298F6 + + diff --git "a/bundles/ruby.tmbundle/Snippets/File.foreach (\"..\") do |line| .. end (File).plist" "b/bundles/ruby.tmbundle/Snippets/File.foreach (\"..\") do |line| .. end (File).plist" new file mode 100644 index 000000000..facee8f76 --- /dev/null +++ "b/bundles/ruby.tmbundle/Snippets/File.foreach (\"..\") do |line| .. end (File).plist" @@ -0,0 +1,16 @@ + + + + + content + File.foreach(${1:"${2:path/to/file}"}) { |${3:line}| $0 } + name + File.foreach ("..") { |line| .. } + scope + source.ruby + tabTrigger + File + uuid + 8F594E5E-6F46-4E98-B5FB-1C8F3BA9828F + + diff --git "a/bundles/ruby.tmbundle/Snippets/File_open(\"__\") { |file| __ }.tmSnippet" "b/bundles/ruby.tmbundle/Snippets/File_open(\"__\") { |file| __ }.tmSnippet" new file mode 100644 index 000000000..ec3258ccb --- /dev/null +++ "b/bundles/ruby.tmbundle/Snippets/File_open(\"__\") { |file| __ }.tmSnippet" @@ -0,0 +1,16 @@ + + + + + content + File.open(${1:"${2:path/to/file}"}${3/(^[rwab+]+$)|.*/(?1:, ")/}${3:w}${3/(^[rwab+]+$)|.*/(?1:")/}) { |${4:file}| $0 } + name + File.open("..") { |file| .. } + scope + source.ruby + tabTrigger + File + uuid + 397FA09F-A30F-4EE4-920C-318D5004EE97 + + diff --git "a/bundles/ruby.tmbundle/Snippets/File_read(\"__\").tmSnippet" "b/bundles/ruby.tmbundle/Snippets/File_read(\"__\").tmSnippet" new file mode 100644 index 000000000..1ee4856f7 --- /dev/null +++ "b/bundles/ruby.tmbundle/Snippets/File_read(\"__\").tmSnippet" @@ -0,0 +1,16 @@ + + + + + content + File.read(${1:"${2:path/to/file}"}) + name + File.read("..") + scope + source.ruby + tabTrigger + File + uuid + 50C56AC8-48F3-42A0-AF10-8164464AFAEF + + diff --git a/bundles/ruby.tmbundle/Snippets/Hash.new { |hash, key| hash[key] = .. } (Has).plist b/bundles/ruby.tmbundle/Snippets/Hash.new { |hash, key| hash[key] = .. } (Has).plist new file mode 100644 index 000000000..c15bdc603 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/Hash.new { |hash, key| hash[key] = .. } (Has).plist @@ -0,0 +1,16 @@ + + + + + content + Hash.new { |${1:hash}, ${2:key}| ${1:hash}[${2:key}] = $0 } + name + Hash.new { |hash, key| hash[key] = .. } + scope + source.ruby + tabTrigger + Hash + uuid + E16EE658-1CA0-4950-954B-B962E50B754F + + diff --git a/bundles/ruby.tmbundle/Snippets/Insert ERb's <% __ %> or <%= __ %>.tmSnippet b/bundles/ruby.tmbundle/Snippets/Insert ERb's <% __ %> or <%= __ %>.tmSnippet new file mode 100644 index 000000000..059584fbe --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/Insert ERb's <% __ %> or <%= __ %>.tmSnippet @@ -0,0 +1,16 @@ + + + + + content + <%= ${0:$TM_SELECTED_TEXT} %> + keyEquivalent + ^> + name + Insert ERb’s <% .. %> or <%= .. %> + scope + text.html, source.yaml, meta.erb + uuid + FDFABCB9-DF58-4469-AE11-5407A4FF4D70 + + diff --git a/bundles/ruby.tmbundle/Snippets/Marshal.dump(obj, file) (Md).plist b/bundles/ruby.tmbundle/Snippets/Marshal.dump(obj, file) (Md).plist new file mode 100644 index 000000000..63c6e644e --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/Marshal.dump(obj, file) (Md).plist @@ -0,0 +1,16 @@ + + + + + content + File.open(${1:"${2:path/to/file}.dump"}, "wb") { |${3:file}| Marshal.dump(${4:obj}, ${3:file}) } + name + Marshal.dump(.., file) + scope + source.ruby + tabTrigger + Md + uuid + 0CB48BCA-3F6E-4AE0-85BC-08A1D2508216 + + diff --git a/bundles/ruby.tmbundle/Snippets/Marshal.load(obj) (Ml).plist b/bundles/ruby.tmbundle/Snippets/Marshal.load(obj) (Ml).plist new file mode 100644 index 000000000..a9d2360c0 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/Marshal.load(obj) (Ml).plist @@ -0,0 +1,16 @@ + + + + + content + File.open(${1:"${2:path/to/file}.dump"}, "rb") { |${3:file}| Marshal.load(${3:file}) } + name + Marshal.load(obj) + scope + source.ruby + tabTrigger + Ml + uuid + 20AAD0BC-075D-4EC0-9057-E3E5E62C4125 + + diff --git a/bundles/ruby.tmbundle/Snippets/PStore_new( __ ).tmSnippet b/bundles/ruby.tmbundle/Snippets/PStore_new( __ ).tmSnippet new file mode 100644 index 000000000..1c0ece8b1 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/PStore_new( __ ).tmSnippet @@ -0,0 +1,16 @@ + + + + + content + PStore.new(${1:"${2:file_name.pstore}"}) + name + PStore.new( .. ) + scope + source.ruby + tabTrigger + Pn- + uuid + 5B46ECFD-23A4-4F0C-9951-F64C19C72C2B + + diff --git a/bundles/ruby.tmbundle/Snippets/RDoc documentation block.tmSnippet b/bundles/ruby.tmbundle/Snippets/RDoc documentation block.tmSnippet new file mode 100644 index 000000000..743328df6 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/RDoc documentation block.tmSnippet @@ -0,0 +1,20 @@ + + + + + content + `[[ $TM_LINE_INDEX != 0 ]] && echo; echo`=begin rdoc + $0 +=end + name + New Block + scope + source.ruby + tabTrigger + =b + uuid + 05984208-D559-4C04-A69C-2019361A985A + disableAutoIndent + + + diff --git a/bundles/ruby.tmbundle/Snippets/Wrap in Begin … Rescue … End.plist b/bundles/ruby.tmbundle/Snippets/Wrap in Begin … Rescue … End.plist new file mode 100644 index 000000000..3c3f8708b --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/Wrap in Begin … Rescue … End.plist @@ -0,0 +1,23 @@ + + + + + content + ${TM_SELECTED_TEXT/([\t ]*).*/$1/m}begin + ${3:${TM_SELECTED_TEXT/(\A.*)|(.+)|\n\z/(?1:$0:(?2:\t$0))/g}} +${TM_SELECTED_TEXT/([\t ]*).*/$1/m}rescue ${1:Exception}${2/.+/ => /}${2:e} +${TM_SELECTED_TEXT/([\t ]*).*/$1/m} $0 +${TM_SELECTED_TEXT/([\t ]*).*/$1/m}end + + keyEquivalent + ^W + name + begin … rescue … end + scope + source.ruby - comment + tabTrigger + begin + uuid + 0F940CBC-2173-49FF-B6FD-98A62863F8F2 + + diff --git a/bundles/ruby.tmbundle/Snippets/YAML.dump(.., file) (Yd-).plist b/bundles/ruby.tmbundle/Snippets/YAML.dump(.., file) (Yd-).plist new file mode 100644 index 000000000..2003b259e --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/YAML.dump(.., file) (Yd-).plist @@ -0,0 +1,16 @@ + + + + + content + File.open(${1:"${2:path/to/file}.yaml"}, "w") { |${3:file}| YAML.dump(${4:obj}, ${3:file}) } + name + YAML.dump(.., file) + scope + source.ruby + tabTrigger + Yd- + uuid + 3BA6762A-BB6B-489E-8006-F30F386AEF48 + + diff --git a/bundles/ruby.tmbundle/Snippets/YAML.load(file) (Yl-).plist b/bundles/ruby.tmbundle/Snippets/YAML.load(file) (Yl-).plist new file mode 100644 index 000000000..096fc834a --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/YAML.load(file) (Yl-).plist @@ -0,0 +1,16 @@ + + + + + content + File.open(${1:"${2:path/to/file}.yaml"}) { |${3:file}| YAML.load(${3:file}) } + name + YAML.load(file) + scope + source.ruby + tabTrigger + Yl- + uuid + 8343ACF4-EEB7-44B5-B835-94826466D4D5 + + diff --git a/bundles/ruby.tmbundle/Snippets/__END__.tmSnippet b/bundles/ruby.tmbundle/Snippets/__END__.tmSnippet new file mode 100644 index 000000000..eb9bf31f5 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/__END__.tmSnippet @@ -0,0 +1,17 @@ + + + + + content + __END__ + + name + __END__ + scope + source.ruby + tabTrigger + end + uuid + 451A0596-1F72-4AFB-AF2F-45900FABB0F7 + + diff --git a/bundles/ruby.tmbundle/Snippets/alias_method .. (am).plist b/bundles/ruby.tmbundle/Snippets/alias_method .. (am).plist new file mode 100644 index 000000000..0813d00aa --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/alias_method .. (am).plist @@ -0,0 +1,16 @@ + + + + + content + alias_method :${1:new_name}, :${0:old_name} + name + alias_method .. + scope + source.ruby + tabTrigger + am + uuid + 988C8AEF-FC71-4455-9C4F-9338C05685A4 + + diff --git a/bundles/ruby.tmbundle/Snippets/all? { |e| .. } (all).plist b/bundles/ruby.tmbundle/Snippets/all? { |e| .. } (all).plist new file mode 100644 index 000000000..223f2be88 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/all? { |e| .. } (all).plist @@ -0,0 +1,16 @@ + + + + + content + all? { |${1:e}| $0 } + name + all? { |e| .. } + scope + source.ruby + tabTrigger + all + uuid + 07D1F987-7CDB-4EAD-B64A-27A93051700E + + diff --git a/bundles/ruby.tmbundle/Snippets/any? { |e| .. } (any).plist b/bundles/ruby.tmbundle/Snippets/any? { |e| .. } (any).plist new file mode 100644 index 000000000..d6b21091e --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/any? { |e| .. } (any).plist @@ -0,0 +1,16 @@ + + + + + content + any? { |${1:e}| $0 } + name + any? { |e| .. } + scope + source.ruby + tabTrigger + any + uuid + A3B9B76B-2BC5-425C-AB24-9FAAFC375798 + + diff --git a/bundles/ruby.tmbundle/Snippets/application_code .. (app).plist b/bundles/ruby.tmbundle/Snippets/application_code .. (app).plist new file mode 100644 index 000000000..2aaca06f0 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/application_code .. (app).plist @@ -0,0 +1,18 @@ + + + + + content + if __FILE__ == \$PROGRAM_NAME + $0 +end + name + application { .. } + scope + source.ruby + tabTrigger + app + uuid + E16D24D2-CC7E-4786-BE0B-1725FC865D78 + + diff --git a/bundles/ruby.tmbundle/Snippets/assert(..) (as).plist b/bundles/ruby.tmbundle/Snippets/assert(..) (as).plist new file mode 100644 index 000000000..1305934e6 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/assert(..) (as).plist @@ -0,0 +1,16 @@ + + + + + content + assert`snippet_paren.rb`${1:test}, "${0:Failure message.}"`snippet_paren.rb end` + name + assert(..) + scope + source.ruby + tabTrigger + as + uuid + B32C147D-44A6-478A-9D5D-189D7831E9A7 + + diff --git a/bundles/ruby.tmbundle/Snippets/assert_equal.tmSnippet b/bundles/ruby.tmbundle/Snippets/assert_equal.tmSnippet new file mode 100644 index 000000000..c7f218443 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/assert_equal.tmSnippet @@ -0,0 +1,16 @@ + + + + + content + assert_equal`snippet_paren.rb`${1:expected}, ${0:actual}`snippet_paren.rb end` + name + assert_equal(..) + scope + source.ruby + tabTrigger + ase + uuid + 43A61A22-6BEE-4997-961C-1CDE739C05FE + + diff --git a/bundles/ruby.tmbundle/Snippets/assert_in_delta(..) (asid).plist b/bundles/ruby.tmbundle/Snippets/assert_in_delta(..) (asid).plist new file mode 100644 index 000000000..ac46529c7 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/assert_in_delta(..) (asid).plist @@ -0,0 +1,16 @@ + + + + + content + assert_in_delta`snippet_paren.rb`${1:expected_float}, ${2:actual_float}, ${0:2 ** -20}`snippet_paren.rb end` + name + assert_in_delta(..) + scope + source.ruby + tabTrigger + asid + uuid + 429D0EF5-580D-4166-8F79-713DE96B77F1 + + diff --git a/bundles/ruby.tmbundle/Snippets/assert_instance_of(..) (asio).plist b/bundles/ruby.tmbundle/Snippets/assert_instance_of(..) (asio).plist new file mode 100644 index 000000000..3d576c653 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/assert_instance_of(..) (asio).plist @@ -0,0 +1,16 @@ + + + + + content + assert_instance_of`snippet_paren.rb`${1:ExpectedClass}, ${0:actual_instance}`snippet_paren.rb end` + name + assert_instance_of(..) + scope + source.ruby + tabTrigger + asio + uuid + 0E831E03-67E1-4357-8323-C60685C23C4F + + diff --git a/bundles/ruby.tmbundle/Snippets/assert_kind_of(..) (asko).plist b/bundles/ruby.tmbundle/Snippets/assert_kind_of(..) (asko).plist new file mode 100644 index 000000000..3fb833290 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/assert_kind_of(..) (asko).plist @@ -0,0 +1,16 @@ + + + + + content + assert_kind_of`snippet_paren.rb`${1:ExpectedKind}, ${0:actual_instance}`snippet_paren.rb end` + name + assert_kind_of(..) + scope + source.ruby + tabTrigger + asko + uuid + 671F05E2-D9CC-485E-BB1B-B13EF20FAC65 + + diff --git a/bundles/ruby.tmbundle/Snippets/assert_match(..) (asm).plist b/bundles/ruby.tmbundle/Snippets/assert_match(..) (asm).plist new file mode 100644 index 000000000..e585b0634 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/assert_match(..) (asm).plist @@ -0,0 +1,16 @@ + + + + + content + assert_match`snippet_paren.rb`/${1:expected_pattern}/, ${0:actual_string}`snippet_paren.rb end` + name + assert_match(..) + scope + source.ruby + tabTrigger + asm + uuid + 711ED6C3-0F18-41FB-9A7D-3094BB319A85 + + diff --git a/bundles/ruby.tmbundle/Snippets/assert_nil(..) (asn).plist b/bundles/ruby.tmbundle/Snippets/assert_nil(..) (asn).plist new file mode 100644 index 000000000..39c214d2c --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/assert_nil(..) (asn).plist @@ -0,0 +1,16 @@ + + + + + content + assert_nil`snippet_paren.rb`${0:instance}`snippet_paren.rb end` + name + assert_nil(..) + scope + source.ruby + tabTrigger + asn + uuid + 4C79256C-480A-459C-BDE8-BB0D972811DB + + diff --git a/bundles/ruby.tmbundle/Snippets/assert_no_match(..) (asnm).plist b/bundles/ruby.tmbundle/Snippets/assert_no_match(..) (asnm).plist new file mode 100644 index 000000000..f116d07d0 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/assert_no_match(..) (asnm).plist @@ -0,0 +1,16 @@ + + + + + content + assert_no_match`snippet_paren.rb`/${1:unexpected_pattern}/, ${0:actual_string}`snippet_paren.rb end` + name + assert_no_match(..) + scope + source.ruby + tabTrigger + asnm + uuid + A072BB1E-1DD1-45D3-9346-8CA3BA21B364 + + diff --git a/bundles/ruby.tmbundle/Snippets/assert_not_equal(..) (asne).plist b/bundles/ruby.tmbundle/Snippets/assert_not_equal(..) (asne).plist new file mode 100644 index 000000000..683044778 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/assert_not_equal(..) (asne).plist @@ -0,0 +1,16 @@ + + + + + content + assert_not_equal`snippet_paren.rb`${1:unexpected}, ${0:actual}`snippet_paren.rb end` + name + assert_not_equal(..) + scope + source.ruby + tabTrigger + asne + uuid + A243E96F-DC21-4AA0-B340-13A7674F6AFF + + diff --git a/bundles/ruby.tmbundle/Snippets/assert_not_nil(..) (asnn).plist b/bundles/ruby.tmbundle/Snippets/assert_not_nil(..) (asnn).plist new file mode 100644 index 000000000..e5b690982 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/assert_not_nil(..) (asnn).plist @@ -0,0 +1,16 @@ + + + + + content + assert_not_nil`snippet_paren.rb`${0:instance}`snippet_paren.rb end` + name + assert_not_nil(..) + scope + source.ruby + tabTrigger + asnn + uuid + 79FEC3CC-2A40-4611-9A85-ECDB22FE0701 + + diff --git a/bundles/ruby.tmbundle/Snippets/assert_not_same(..) (asns).plist b/bundles/ruby.tmbundle/Snippets/assert_not_same(..) (asns).plist new file mode 100644 index 000000000..1751c2887 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/assert_not_same(..) (asns).plist @@ -0,0 +1,16 @@ + + + + + content + assert_not_same`snippet_paren.rb`${1:unexpected}, ${0:actual}`snippet_paren.rb end` + name + assert_not_same(..) + scope + source.ruby + tabTrigger + asns + uuid + F91C25EC-EC76-498B-BFB5-FDA8F57C5875 + + diff --git a/bundles/ruby.tmbundle/Snippets/assert_nothing_raised(..) { .. } (asnr).plist b/bundles/ruby.tmbundle/Snippets/assert_nothing_raised(..) { .. } (asnr).plist new file mode 100644 index 000000000..71e570377 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/assert_nothing_raised(..) { .. } (asnr).plist @@ -0,0 +1,16 @@ + + + + + content + assert_nothing_raised(${1:Exception}) { $0 } + name + assert_nothing_raised(..) { .. } + scope + source.ruby + tabTrigger + asnr + uuid + 82F8EEE0-2452-411E-8102-7BFDDBCA2E72 + + diff --git a/bundles/ruby.tmbundle/Snippets/assert_nothing_thrown { .. } (asnt).plist b/bundles/ruby.tmbundle/Snippets/assert_nothing_thrown { .. } (asnt).plist new file mode 100644 index 000000000..fde48e530 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/assert_nothing_thrown { .. } (asnt).plist @@ -0,0 +1,16 @@ + + + + + content + assert_nothing_thrown { $0 } + name + assert_nothing_thrown { .. } + scope + source.ruby + tabTrigger + asnt + uuid + 33639D7A-BD8C-4396-9C44-307B8AC87C9E + + diff --git a/bundles/ruby.tmbundle/Snippets/assert_operator(..) (aso).plist b/bundles/ruby.tmbundle/Snippets/assert_operator(..) (aso).plist new file mode 100644 index 000000000..63253f281 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/assert_operator(..) (aso).plist @@ -0,0 +1,16 @@ + + + + + content + assert_operator`snippet_paren.rb`${1:left}, :${2:operator}, ${0:right}`snippet_paren.rb end` + name + assert_operator(..) + scope + source.ruby + tabTrigger + aso + uuid + 1B925A4D-8EE4-442B-9254-293599F5717F + + diff --git a/bundles/ruby.tmbundle/Snippets/assert_raise(..) { .. } (asr).plist b/bundles/ruby.tmbundle/Snippets/assert_raise(..) { .. } (asr).plist new file mode 100644 index 000000000..80406001f --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/assert_raise(..) { .. } (asr).plist @@ -0,0 +1,16 @@ + + + + + content + assert_raise(${1:Exception}) { $0 } + name + assert_raise(..) { .. } + scope + source.ruby + tabTrigger + asr + uuid + 68B21F6F-5D89-41FA-A19C-F29C2F912B4E + + diff --git a/bundles/ruby.tmbundle/Snippets/assert_respond_to(..) (asrt).plist b/bundles/ruby.tmbundle/Snippets/assert_respond_to(..) (asrt).plist new file mode 100644 index 000000000..2fc09f114 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/assert_respond_to(..) (asrt).plist @@ -0,0 +1,16 @@ + + + + + content + assert_respond_to`snippet_paren.rb`${1:object}, :${0:method}`snippet_paren.rb end` + name + assert_respond_to(..) + scope + source.ruby + tabTrigger + asrt + uuid + 09A11FDA-49FC-4466-8787-8D1D5D111A89 + + diff --git a/bundles/ruby.tmbundle/Snippets/assert_same(..) (ass).plist b/bundles/ruby.tmbundle/Snippets/assert_same(..) (ass).plist new file mode 100644 index 000000000..f3191a9d4 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/assert_same(..) (ass).plist @@ -0,0 +1,16 @@ + + + + + content + assert_same`snippet_paren.rb`${1:expected}, ${0:actual}`snippet_paren.rb end` + name + assert_same(..) + scope + source.ruby + tabTrigger + ass + uuid + 29340695-E426-4F77-8CF7-C59360A549F4 + + diff --git a/bundles/ruby.tmbundle/Snippets/assert_send(..) (ass).plist b/bundles/ruby.tmbundle/Snippets/assert_send(..) (ass).plist new file mode 100644 index 000000000..c0082b615 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/assert_send(..) (ass).plist @@ -0,0 +1,16 @@ + + + + + content + assert_send`snippet_paren.rb`[${1:object}, :${2:message}, ${0:args}]`snippet_paren.rb end` + name + assert_send(..) + scope + source.ruby + tabTrigger + ass + uuid + 7850AD5C-A90D-4E2C-A931-EADFF8D3D9A3 + + diff --git a/bundles/ruby.tmbundle/Snippets/assert_throws(..) { .. } (ast).plist b/bundles/ruby.tmbundle/Snippets/assert_throws(..) { .. } (ast).plist new file mode 100644 index 000000000..a23e0672d --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/assert_throws(..) { .. } (ast).plist @@ -0,0 +1,16 @@ + + + + + content + assert_throws(:${1:expected}) { $0 } + name + assert_throws(..) { .. } + scope + source.ruby + tabTrigger + ast + uuid + 05655BD8-23C6-445F-BFD1-420BF25C3030 + + diff --git a/bundles/ruby.tmbundle/Snippets/attr_accessor .. (rw).plist b/bundles/ruby.tmbundle/Snippets/attr_accessor .. (rw).plist new file mode 100644 index 000000000..0b30409aa --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/attr_accessor .. (rw).plist @@ -0,0 +1,16 @@ + + + + + content + attr_accessor :${0:attr_names} + name + attr_accessor .. + scope + source.ruby + tabTrigger + rw + uuid + D7A7D3C9-1714-4C50-8CC0-D83A03883E8F + + diff --git a/bundles/ruby.tmbundle/Snippets/attr_reader .. (r).plist b/bundles/ruby.tmbundle/Snippets/attr_reader .. (r).plist new file mode 100644 index 000000000..22436476d --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/attr_reader .. (r).plist @@ -0,0 +1,16 @@ + + + + + content + attr_reader :${0:attr_names} + name + attr_reader .. + scope + source.ruby + tabTrigger + r + uuid + A150C2D8-25B3-4339-BC92-8A0160A70486 + + diff --git a/bundles/ruby.tmbundle/Snippets/attr_writer .. (w).plist b/bundles/ruby.tmbundle/Snippets/attr_writer .. (w).plist new file mode 100644 index 000000000..b23ab01ab --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/attr_writer .. (w).plist @@ -0,0 +1,16 @@ + + + + + content + attr_writer :${0:attr_names} + name + attr_writer .. + scope + source.ruby + tabTrigger + w + uuid + 3D383096-A03F-4EF8-9060-3C727045AB34 + + diff --git a/bundles/ruby.tmbundle/Snippets/class .. < DelegateClass .. initialize .. end (class).plist b/bundles/ruby.tmbundle/Snippets/class .. < DelegateClass .. initialize .. end (class).plist new file mode 100644 index 000000000..821541c30 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/class .. < DelegateClass .. initialize .. end (class).plist @@ -0,0 +1,24 @@ + + + + + content + class ${1:${TM_FILENAME/(?:\A|_)([A-Za-z0-9]+)(?:\.rb)?/(?2::\u$1)/g}} < DelegateClass(${2:ParentClass}) + def initialize${3/(^.*?\S.*)|.*/(?1:\()/}${3:args}${3/(^.*?\S.*)|.*/(?1:\))/} + super(${4:del_obj}) + + $0 + end + + +end + name + class .. < DelegateClass .. initialize .. end + scope + source.ruby + tabTrigger + cla- + uuid + AFE1D078-EA16-45F5-AD8A-FAC1B523D861 + + diff --git a/bundles/ruby.tmbundle/Snippets/class .. < ParentClass .. initialize .. end.plist b/bundles/ruby.tmbundle/Snippets/class .. < ParentClass .. initialize .. end.plist new file mode 100644 index 000000000..9a9deb158 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/class .. < ParentClass .. initialize .. end.plist @@ -0,0 +1,22 @@ + + + + + content + class ${1:${TM_FILENAME/(?:\A|_)([A-Za-z0-9]+)(?:\.rb)?/(?2::\u$1)/g}} < ${2:ParentClass} + def initialize${3/(^.*?\S.*)|.*/(?1:\()/}${3:args}${3/(^.*?\S.*)|.*/(?1:\))/} + $0 + end + + +end + name + class .. < ParentClass .. initialize .. end + scope + source.ruby + tabTrigger + cla + uuid + 0CCBE04E-F4E2-4E55-9506-7DE67ACF8388 + + diff --git a/bundles/ruby.tmbundle/Snippets/class .. < Struct .. initialize .. end.plist b/bundles/ruby.tmbundle/Snippets/class .. < Struct .. initialize .. end.plist new file mode 100644 index 000000000..9470cf480 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/class .. < Struct .. initialize .. end.plist @@ -0,0 +1,22 @@ + + + + + content + ${1:${TM_FILENAME/(?:\A|_)([A-Za-z0-9]+)(?:\.rb)?/(?2::\u$1)/g}} = Struct.new(:${2:attr_names}) do + def ${3:method_name} + $0 + end + + +end + name + ClassName = Struct .. do .. end + scope + source.ruby + tabTrigger + cla + uuid + 05DFF82C-5A29-4EBD-93FE-C165FFFB5EA8 + + diff --git a/bundles/ruby.tmbundle/Snippets/class .. < Test;;Unit;;TestCase .. end (tc).plist b/bundles/ruby.tmbundle/Snippets/class .. < Test;;Unit;;TestCase .. end (tc).plist new file mode 100644 index 000000000..6279a5736 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/class .. < Test;;Unit;;TestCase .. end (tc).plist @@ -0,0 +1,24 @@ + + + + + content + require "test/unit" + +require "${1:library_file_name}" + +class Test${2:${1/([\w&&[^_]]+)|./\u$1/g}} < Test::Unit::TestCase + def test_${3:case_name} + $0 + end +end + name + class .. < Test::Unit::TestCase .. end + scope + source.ruby + tabTrigger + tc + uuid + 31D1F145-33AB-4441-BA11-4D1C46928C4C + + diff --git a/bundles/ruby.tmbundle/Snippets/class .. end (cla).plist b/bundles/ruby.tmbundle/Snippets/class .. end (cla).plist new file mode 100644 index 000000000..8839f4cbf --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/class .. end (cla).plist @@ -0,0 +1,18 @@ + + + + + content + class ${1:${TM_FILENAME/(?:\A|_)([A-Za-z0-9]+)(?:\.rb)?/(?2::\u$1)/g}} + $0 +end + name + class .. end + scope + source.ruby + tabTrigger + cla + uuid + BF487539-8085-4FF4-8601-1AD20FABAEDC + + diff --git a/bundles/ruby.tmbundle/Snippets/class .. initialize .. end.plist b/bundles/ruby.tmbundle/Snippets/class .. initialize .. end.plist new file mode 100644 index 000000000..ac79e1eae --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/class .. initialize .. end.plist @@ -0,0 +1,22 @@ + + + + + content + class ${1:${TM_FILENAME/(?:\A|_)([A-Za-z0-9]+)(?:\.rb)?/(?2::\u$1)/g}} + def initialize${2/(^.*?\S.*)|.*/(?1:\()/}${2:args}${2/(^.*?\S.*)|.*/(?1:\))/} + $0 + end + + +end + name + class .. initialize .. end + scope + source.ruby + tabTrigger + cla + uuid + 83EED068-8C1C-4BAF-9893-902DC00616AB + + diff --git a/bundles/ruby.tmbundle/Snippets/class .. instance_methods .. undef .. initialize .. end (class).plist b/bundles/ruby.tmbundle/Snippets/class .. instance_methods .. undef .. initialize .. end (class).plist new file mode 100644 index 000000000..171b8c884 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/class .. instance_methods .. undef .. initialize .. end (class).plist @@ -0,0 +1,30 @@ + + + + + content + class ${1:BlankSlate} + instance_methods.each { |meth| undef_method(meth) unless meth =~ /\A__/ } + + def initialize${2/(^.*?\S.*)|.*/(?1:\()/}${2:args}${2/(^.*?\S.*)|.*/(?1:\))/} + @${3:delegate} = ${4:delegate_object} + + $0 + end + + def method_missing(meth, *args, &block) + @${3:delegate}.send(meth, *args, &block) + end + + +end + name + class BlankSlate .. initialize .. end + scope + source.ruby + tabTrigger + cla + uuid + E98FB8F9-7302-431D-8BF2-275A68A6126C + + diff --git a/bundles/ruby.tmbundle/Snippets/class << self __ end.tmSnippet b/bundles/ruby.tmbundle/Snippets/class << self __ end.tmSnippet new file mode 100644 index 000000000..9da605c5e --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/class << self __ end.tmSnippet @@ -0,0 +1,18 @@ + + + + + content + class << ${1:self} + $0 +end + name + class << self .. end + scope + source.ruby + tabTrigger + cla + uuid + C7AAAE45-487A-4B61-8962-D47675AAC05F + + diff --git a/bundles/ruby.tmbundle/Snippets/class_from_name() (clafn).plist b/bundles/ruby.tmbundle/Snippets/class_from_name() (clafn).plist new file mode 100644 index 000000000..01950c09c --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/class_from_name() (clafn).plist @@ -0,0 +1,16 @@ + + + + + content + split("::").inject(Object) { |par, const| par.const_get(const) } + name + class_from_name() + scope + source.ruby + tabTrigger + clafn + uuid + 2DBEE50B-3097-4A57-AB48-3586CF392D8B + + diff --git a/bundles/ruby.tmbundle/Snippets/classify { |e| .. } (clas).plist b/bundles/ruby.tmbundle/Snippets/classify { |e| .. } (clas).plist new file mode 100644 index 000000000..38d0140ea --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/classify { |e| .. } (clas).plist @@ -0,0 +1,16 @@ + + + + + content + classify { |${1:e}| $0 } + name + classify { |e| .. } + scope + source.ruby + tabTrigger + cl + uuid + 5DA9E1E8-2C54-420A-9B84-B040A1AF2B9E + + diff --git a/bundles/ruby.tmbundle/Snippets/collect { |e| .. } (col).plist b/bundles/ruby.tmbundle/Snippets/collect { |e| .. } (col).plist new file mode 100644 index 000000000..27a46f54e --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/collect { |e| .. } (col).plist @@ -0,0 +1,16 @@ + + + + + content + collect { |${1:e}| $0 } + name + collect { |e| .. } + scope + source.ruby + tabTrigger + col + uuid + 669A86AD-936F-4EDA-8E4E-6863804072DA + + diff --git a/bundles/ruby.tmbundle/Snippets/deep_copy(..) (dee).plist b/bundles/ruby.tmbundle/Snippets/deep_copy(..) (dee).plist new file mode 100644 index 000000000..13bdd5838 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/deep_copy(..) (dee).plist @@ -0,0 +1,16 @@ + + + + + content + Marshal.load(Marshal.dump(${0:obj_to_copy})) + name + deep_copy(..) + scope + source.ruby + tabTrigger + deec + uuid + 0BA2B2F1-E767-4A03-9791-0AC0183251F1 + + diff --git a/bundles/ruby.tmbundle/Snippets/def end.plist b/bundles/ruby.tmbundle/Snippets/def end.plist new file mode 100644 index 000000000..3908170ce --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/def end.plist @@ -0,0 +1,18 @@ + + + + + content + def ${1:method_name} + $0 +end + name + def … end + scope + source.ruby + tabTrigger + def + uuid + 4E9A7A73-875C-11D9-897C-000393CBCE2E + + diff --git a/bundles/ruby.tmbundle/Snippets/def initialize __ end.tmSnippet b/bundles/ruby.tmbundle/Snippets/def initialize __ end.tmSnippet new file mode 100644 index 000000000..129f13cae --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/def initialize __ end.tmSnippet @@ -0,0 +1,18 @@ + + + + + content + def initialize${1/.+/(/}${1:args}${1/.+/)/} + $0 +end + name + def initialize .. end + scope + source.ruby + tabTrigger + defi + uuid + 4E9D15B5-65D6-4A9A-9DEC-DE041D68C06F + + diff --git a/bundles/ruby.tmbundle/Snippets/def method_missing .. end (mm).plist b/bundles/ruby.tmbundle/Snippets/def method_missing .. end (mm).plist new file mode 100644 index 000000000..cdd874b6b --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/def method_missing .. end (mm).plist @@ -0,0 +1,18 @@ + + + + + content + def method_missing(meth, *args, &blk) + $0 +end + name + def method_missing .. end + scope + source.ruby + tabTrigger + defmm + uuid + 87D5F8AD-8DA6-4AED-A0D8-B51CAC980445 + + diff --git a/bundles/ruby.tmbundle/Snippets/def self .. end (defs).plist b/bundles/ruby.tmbundle/Snippets/def self .. end (defs).plist new file mode 100644 index 000000000..07c63bcd7 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/def self .. end (defs).plist @@ -0,0 +1,18 @@ + + + + + content + def self.${1:class_method_name} + $0 +end + name + def self .. end + scope + source.ruby + tabTrigger + defs + uuid + 7C6E88FA-CA0E-4110-8C75-A94E54286A75 + + diff --git a/bundles/ruby.tmbundle/Snippets/def test_ .. end (t).plist b/bundles/ruby.tmbundle/Snippets/def test_ .. end (t).plist new file mode 100644 index 000000000..9338f041e --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/def test_ .. end (t).plist @@ -0,0 +1,18 @@ + + + + + content + def test_${1:case_name} + $0 +end + name + def test_ .. end + scope + source.ruby + tabTrigger + deft + uuid + 00F66D41-25AF-4597-B67D-E540965A5222 + + diff --git a/bundles/ruby.tmbundle/Snippets/def_delegator .. (defd).plist b/bundles/ruby.tmbundle/Snippets/def_delegator .. (defd).plist new file mode 100644 index 000000000..eac1a966d --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/def_delegator .. (defd).plist @@ -0,0 +1,16 @@ + + + + + content + def_delegator :${1:@del_obj}, :${2:del_meth}, :${3:new_name} + name + def_delegator .. + scope + source.ruby + tabTrigger + defd + uuid + C44ED391-614F-4BA2-BB0F-87668EEA9954 + + diff --git a/bundles/ruby.tmbundle/Snippets/def_delegators .. (defds).plist b/bundles/ruby.tmbundle/Snippets/def_delegators .. (defds).plist new file mode 100644 index 000000000..e14ab54dd --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/def_delegators .. (defds).plist @@ -0,0 +1,16 @@ + + + + + content + def_delegators :${1:@del_obj}, :${0:del_methods} + name + def_delegators .. + scope + source.ruby + tabTrigger + defds + uuid + 4A6EFD6B-88E2-4822-AD48-03460EDBC796 + + diff --git a/bundles/ruby.tmbundle/Snippets/define_method ___ end.tmSnippet b/bundles/ruby.tmbundle/Snippets/define_method ___ end.tmSnippet new file mode 100644 index 000000000..3d9f84259 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/define_method ___ end.tmSnippet @@ -0,0 +1,18 @@ + + + + + content + define_method :${1:method_name} do${2/.+/ |/}${2:args}${2/.+/|/} + $0 +end + name + define_method ... end + scope + source.ruby + tabTrigger + defm + uuid + 7BC1E159-0C90-4B0D-8808-80165C11F59C + + diff --git a/bundles/ruby.tmbundle/Snippets/delete_if { |e| .. } (deli).plist b/bundles/ruby.tmbundle/Snippets/delete_if { |e| .. } (deli).plist new file mode 100644 index 000000000..fb90c95f7 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/delete_if { |e| .. } (deli).plist @@ -0,0 +1,16 @@ + + + + + content + delete_if { |${1:e}| $0 } + name + delete_if { |e| .. } + scope + source.ruby + tabTrigger + deli + uuid + 263C94DC-63CF-4BA3-9692-C5582CA8F1AB + + diff --git a/bundles/ruby.tmbundle/Snippets/detect { |e| .. } (det).plist b/bundles/ruby.tmbundle/Snippets/detect { |e| .. } (det).plist new file mode 100644 index 000000000..855fd0afa --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/detect { |e| .. } (det).plist @@ -0,0 +1,16 @@ + + + + + content + detect { |${1:e}| $0 } + name + detect { |e| .. } + scope + source.ruby + tabTrigger + det + uuid + 6C6B9849-9631-49FF-A9F9-F0E94A1512C5 + + diff --git a/bundles/ruby.tmbundle/Snippets/directory().tmSnippet b/bundles/ruby.tmbundle/Snippets/directory().tmSnippet new file mode 100644 index 000000000..635f5d2bb --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/directory().tmSnippet @@ -0,0 +1,16 @@ + + + + + content + File.dirname(__FILE__) + name + directory() + scope + source.ruby + tabTrigger + dir + uuid + 678BDB83-FBBD-4E8E-BE0B-E1A98AECB247 + + diff --git a/bundles/ruby.tmbundle/Snippets/do |obj| .. end (doo).plist b/bundles/ruby.tmbundle/Snippets/do |obj| .. end (doo).plist new file mode 100644 index 000000000..3e41d59d5 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/do |obj| .. end (doo).plist @@ -0,0 +1,18 @@ + + + + + content + do${1/(^(?<var>\s*[a-z_][a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1: |)/}${1:variable}${1/(^(?<var>\s*[a-z_][a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/} + $0 +end + name + Insert do |variable| … end + scope + source.ruby + tabTrigger + do + uuid + 4B72C5C3-6CA7-41AC-B2F9-51DEA25D469E + + diff --git a/bundles/ruby.tmbundle/Snippets/downto(0) { |n| .. } (dow).plist b/bundles/ruby.tmbundle/Snippets/downto(0) { |n| .. } (dow).plist new file mode 100644 index 000000000..01d7f7bbd --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/downto(0) { |n| .. } (dow).plist @@ -0,0 +1,16 @@ + + + + + content + downto(${1:0}) { ${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}${2:n}${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:| )/}$0 } + name + downto(0) { |n| .. } + scope + source.ruby + tabTrigger + dow + uuid + 4991BB86-736E-4758-B9B2-E4FA90B9368F + + diff --git a/bundles/ruby.tmbundle/Snippets/each { |e| .. } (ea).plist b/bundles/ruby.tmbundle/Snippets/each { |e| .. } (ea).plist new file mode 100644 index 000000000..ac3a07392 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/each { |e| .. } (ea).plist @@ -0,0 +1,16 @@ + + + + + content + each { |${1:e}| $0 } + name + each { |e| .. } + scope + source.ruby + tabTrigger + ea + uuid + ECBA4CA0-275F-460E-85BE-E82FEA2E2B26 + + diff --git a/bundles/ruby.tmbundle/Snippets/each_byte { |byte| .. } (eab).plist b/bundles/ruby.tmbundle/Snippets/each_byte { |byte| .. } (eab).plist new file mode 100644 index 000000000..ae60e0af6 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/each_byte { |byte| .. } (eab).plist @@ -0,0 +1,16 @@ + + + + + content + each_byte { |${1:byte}| $0 } + name + each_byte { |byte| .. } + scope + source.ruby + tabTrigger + eab + uuid + 338EC03D-3FF4-4435-94E8-1CEF20CEC75D + + diff --git a/bundles/ruby.tmbundle/Snippets/each_char { |chr| .. } (eac-).plist b/bundles/ruby.tmbundle/Snippets/each_char { |chr| .. } (eac-).plist new file mode 100644 index 000000000..7b08ce32d --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/each_char { |chr| .. } (eac-).plist @@ -0,0 +1,16 @@ + + + + + content + each_char { |${1:chr}| $0 } + name + each_char { |chr| .. } + scope + source.ruby + tabTrigger + eac- + uuid + FDD73070-6D32-4301-A86A-C55B77C3D8ED + + diff --git a/bundles/ruby.tmbundle/Snippets/each_cons(..) { |group| .. } (eac-).plist b/bundles/ruby.tmbundle/Snippets/each_cons(..) { |group| .. } (eac-).plist new file mode 100644 index 000000000..f8df1d2d7 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/each_cons(..) { |group| .. } (eac-).plist @@ -0,0 +1,16 @@ + + + + + content + each_cons(${1:2}) { |${2:group}| $0 } + name + each_cons(..) { |group| .. } + scope + source.ruby + tabTrigger + eac- + uuid + 3C04589C-5127-478E-97B3-CA7DD2EA7ECD + + diff --git a/bundles/ruby.tmbundle/Snippets/each_index { |i| .. } (eai).plist b/bundles/ruby.tmbundle/Snippets/each_index { |i| .. } (eai).plist new file mode 100644 index 000000000..5066fef0d --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/each_index { |i| .. } (eai).plist @@ -0,0 +1,16 @@ + + + + + content + each_index { |${1:i}| $0 } + name + each_index { |i| .. } + scope + source.ruby + tabTrigger + eai + uuid + 689120C9-AB40-4081-8268-9362E00FA4A0 + + diff --git a/bundles/ruby.tmbundle/Snippets/each_key { |key| .. } (eak).plist b/bundles/ruby.tmbundle/Snippets/each_key { |key| .. } (eak).plist new file mode 100644 index 000000000..8cd5e7a94 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/each_key { |key| .. } (eak).plist @@ -0,0 +1,16 @@ + + + + + content + each_key { |${1:key}| $0 } + name + each_key { |key| .. } + scope + source.ruby + tabTrigger + eak + uuid + E54F7077-3C33-4B53-A4F7-21E16132D3AD + + diff --git a/bundles/ruby.tmbundle/Snippets/each_line { |line| .. } (eal).plist b/bundles/ruby.tmbundle/Snippets/each_line { |line| .. } (eal).plist new file mode 100644 index 000000000..e205a4ba1 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/each_line { |line| .. } (eal).plist @@ -0,0 +1,16 @@ + + + + + content + each_line$1 { |${2:line}| $0 } + name + each_line { |line| .. } + scope + source.ruby + tabTrigger + eal + uuid + 02913388-EE8E-4C55-AC94-94F3D751F47E + + diff --git a/bundles/ruby.tmbundle/Snippets/each_pair { |name, val| .. } (eap).plist b/bundles/ruby.tmbundle/Snippets/each_pair { |name, val| .. } (eap).plist new file mode 100644 index 000000000..223292420 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/each_pair { |name, val| .. } (eap).plist @@ -0,0 +1,16 @@ + + + + + content + each_pair { |${1:name}, ${2:val}| $0 } + name + each_pair { |name, val| .. } + scope + source.ruby + tabTrigger + eap + uuid + 7A3CECED-452B-438E-A5C6-95B6BDC43243 + + diff --git a/bundles/ruby.tmbundle/Snippets/each_slice { |group| .. } (eas).plist b/bundles/ruby.tmbundle/Snippets/each_slice { |group| .. } (eas).plist new file mode 100644 index 000000000..c5797c88a --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/each_slice { |group| .. } (eas).plist @@ -0,0 +1,16 @@ + + + + + content + each_slice(${1:2}) { |${2:group}| $0 } + name + each_slice(..) { |group| .. } + scope + source.ruby + tabTrigger + eas- + uuid + CD748479-D2A4-4AB5-95BD-4C89512BA210 + + diff --git a/bundles/ruby.tmbundle/Snippets/each_value { |val| .. } (eav).plist b/bundles/ruby.tmbundle/Snippets/each_value { |val| .. } (eav).plist new file mode 100644 index 000000000..a42cb675f --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/each_value { |val| .. } (eav).plist @@ -0,0 +1,16 @@ + + + + + content + each_value { |${1:val}| $0 } + name + each_value { |val| .. } + scope + source.ruby + tabTrigger + eav + uuid + 844DBD70-BC23-4FBF-9C18-F4A610239DF2 + + diff --git a/bundles/ruby.tmbundle/Snippets/each_with_index { |e, i| .. } (eawi).plist b/bundles/ruby.tmbundle/Snippets/each_with_index { |e, i| .. } (eawi).plist new file mode 100644 index 000000000..6730e1e3b --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/each_with_index { |e, i| .. } (eawi).plist @@ -0,0 +1,16 @@ + + + + + content + each_with_index { |${1:e}, ${2:i}| $0 } + name + each_with_index { |e, i| .. } + scope + source.ruby + tabTrigger + eawi + uuid + 1DD13CF5-39C0-4F10-B655-56DACEBC7F94 + + diff --git a/bundles/ruby.tmbundle/Snippets/elsif ___.tmSnippet b/bundles/ruby.tmbundle/Snippets/elsif ___.tmSnippet new file mode 100644 index 000000000..9028eea1c --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/elsif ___.tmSnippet @@ -0,0 +1,17 @@ + + + + + content + elsif ${1:condition} + $0 + name + elsif ... + scope + source.ruby + tabTrigger + elsif + uuid + CD1609FA-47DA-4EE4-9C5B-5C56D953F5B1 + + diff --git a/bundles/ruby.tmbundle/Snippets/embed string variable.plist b/bundles/ruby.tmbundle/Snippets/embed string variable.plist new file mode 100644 index 000000000..397023a7e --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/embed string variable.plist @@ -0,0 +1,16 @@ + + + + + content + #{${1:$TM_SELECTED_TEXT}} + keyEquivalent + # + name + Embedded Code — #{…} + scope + (string.quoted.double.ruby|string.interpolated.ruby) - string source + uuid + EEE6D060-C5A0-400D-A2E0-0835013C5365 + + diff --git a/bundles/ruby.tmbundle/Snippets/extend Forwardable (Forw).plist b/bundles/ruby.tmbundle/Snippets/extend Forwardable (Forw).plist new file mode 100644 index 000000000..d10e907a5 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/extend Forwardable (Forw).plist @@ -0,0 +1,16 @@ + + + + + content + extend Forwardable + name + extend Forwardable + scope + source.ruby + tabTrigger + Forw- + uuid + 7F46C90A-595B-4B83-A4F7-058F63CE4218 + + diff --git a/bundles/ruby.tmbundle/Snippets/fetch(name) { |key| .. } (fet).plist b/bundles/ruby.tmbundle/Snippets/fetch(name) { |key| .. } (fet).plist new file mode 100644 index 000000000..7148ace4f --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/fetch(name) { |key| .. } (fet).plist @@ -0,0 +1,16 @@ + + + + + content + fetch(${1:name}) { ${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}${2:key}${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:| )/}$0 } + name + fetch(name) { |key| .. } + scope + source.ruby + tabTrigger + fet + uuid + 1F72122A-35AD-4BA1-AA01-889A10319666 + + diff --git a/bundles/ruby.tmbundle/Snippets/fill(range) { |i| .. } (fil).plist b/bundles/ruby.tmbundle/Snippets/fill(range) { |i| .. } (fil).plist new file mode 100644 index 000000000..3fc68b924 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/fill(range) { |i| .. } (fil).plist @@ -0,0 +1,16 @@ + + + + + content + fill(${1:range}) { ${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}${2:i}${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:| )/}$0 } + name + fill(range) { |i| .. } + scope + source.ruby + tabTrigger + fil + uuid + 6021BBDC-4AAD-447B-A0C2-A4BB31721558 + + diff --git a/bundles/ruby.tmbundle/Snippets/find { |e| .. } (fin).plist b/bundles/ruby.tmbundle/Snippets/find { |e| .. } (fin).plist new file mode 100644 index 000000000..6dc181a33 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/find { |e| .. } (fin).plist @@ -0,0 +1,16 @@ + + + + + content + find { |${1:e}| $0 } + name + find { |e| .. } + scope + source.ruby + tabTrigger + fin + uuid + E23FE534-8061-4828-98A5-46270B6910B0 + + diff --git a/bundles/ruby.tmbundle/Snippets/find_all { |e| .. } (fina).plist b/bundles/ruby.tmbundle/Snippets/find_all { |e| .. } (fina).plist new file mode 100644 index 000000000..a1435b71d --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/find_all { |e| .. } (fina).plist @@ -0,0 +1,16 @@ + + + + + content + find_all { |${1:e}| $0 } + name + find_all { |e| .. } + scope + source.ruby + tabTrigger + fina + uuid + 197709C5-8382-4A59-B6D7-31A0CC0F23B7 + + diff --git a/bundles/ruby.tmbundle/Snippets/flatten_once (fla).plist b/bundles/ruby.tmbundle/Snippets/flatten_once (fla).plist new file mode 100644 index 000000000..bda4f7778 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/flatten_once (fla).plist @@ -0,0 +1,16 @@ + + + + + content + inject(Array.new) { |${1:arr}, ${2:a}| ${1:arr}.push(*${2:a}) } + name + flatten_once() + scope + source.ruby + tabTrigger + flao + uuid + 3DDB99C4-486D-4C11-A217-5680FDD8EC19 + + diff --git a/bundles/ruby.tmbundle/Snippets/flunk(..) (fl).plist b/bundles/ruby.tmbundle/Snippets/flunk(..) (fl).plist new file mode 100644 index 000000000..14283b783 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/flunk(..) (fl).plist @@ -0,0 +1,16 @@ + + + + + content + flunk`snippet_paren.rb`"${1:Failure message.}"`snippet_paren.rb end`$0 + name + flunk(..) + scope + source.ruby + tabTrigger + flu + uuid + DB457094-1AC9-4856-AEFC-43A9576B6775 + + diff --git a/bundles/ruby.tmbundle/Snippets/grep(;pattern;) { |match| .. } (gre).plist b/bundles/ruby.tmbundle/Snippets/grep(;pattern;) { |match| .. } (gre).plist new file mode 100644 index 000000000..404abb822 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/grep(;pattern;) { |match| .. } (gre).plist @@ -0,0 +1,16 @@ + + + + + content + grep(${1:/${2:pattern}/}) { |${3:match}| $0 } + name + grep(/pattern/) { |match| .. } + scope + source.ruby + tabTrigger + gre + uuid + 9D9E7BA3-8C5D-4532-83EA-326358C2F5BB + + diff --git a/bundles/ruby.tmbundle/Snippets/gsub(;..;) { |match| .. } (gsu).plist b/bundles/ruby.tmbundle/Snippets/gsub(;..;) { |match| .. } (gsu).plist new file mode 100644 index 000000000..1808257be --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/gsub(;..;) { |match| .. } (gsu).plist @@ -0,0 +1,16 @@ + + + + + content + gsub(/${1:pattern}/) { ${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}${2:match}${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:| )/}$0 } + name + gsub(/../) { |match| .. } + scope + source.ruby + tabTrigger + gsu + uuid + 2514FC26-468C-4D08-A788-494A444C4286 + + diff --git a/bundles/ruby.tmbundle/Snippets/hash pair (:).plist b/bundles/ruby.tmbundle/Snippets/hash pair (:).plist new file mode 100644 index 000000000..f26adea4e --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/hash pair (:).plist @@ -0,0 +1,16 @@ + + + + + content + :${1:key} => ${2:"${3:value}"}${4:, } + name + Hash Pair — :key => "value" + scope + source.ruby + tabTrigger + : + uuid + 840B9C4C-7037-4C3B-9028-EB9DC75EDB3E + + diff --git a/bundles/ruby.tmbundle/Snippets/hash pointer.plist b/bundles/ruby.tmbundle/Snippets/hash pointer.plist new file mode 100644 index 000000000..f91e23a4a --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/hash pointer.plist @@ -0,0 +1,16 @@ + + + + + content + => + keyEquivalent + ^l + name + Hash Pointer — => + scope + source.ruby + uuid + B9E3A6DF-875D-11D9-897C-000393CBCE2E + + diff --git a/bundles/ruby.tmbundle/Snippets/include Comparable .. (Comp).plist b/bundles/ruby.tmbundle/Snippets/include Comparable .. (Comp).plist new file mode 100644 index 000000000..1fc98c2c4 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/include Comparable .. (Comp).plist @@ -0,0 +1,20 @@ + + + + + content + include Comparable + +def <=>(other) + $0 +end + name + include Comparable .. + scope + source.ruby + tabTrigger + Comp + uuid + 6C9D6B3D-D8E9-4606-9534-577C8D21FFF6 + + diff --git a/bundles/ruby.tmbundle/Snippets/include Enumerable .. (Enum).plist b/bundles/ruby.tmbundle/Snippets/include Enumerable .. (Enum).plist new file mode 100644 index 000000000..c35135fb5 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/include Enumerable .. (Enum).plist @@ -0,0 +1,20 @@ + + + + + content + include Enumerable + +def each(&block) + $0 +end + name + include Enumerable .. + scope + source.ruby + tabTrigger + Enum + uuid + AAD5D511-6BE7-41DA-8F2B-1593A48FBB08 + + diff --git a/bundles/ruby.tmbundle/Snippets/inject(init) { |mem, var| .. } (inj).plist b/bundles/ruby.tmbundle/Snippets/inject(init) { |mem, var| .. } (inj).plist new file mode 100644 index 000000000..d1af9bd85 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/inject(init) { |mem, var| .. } (inj).plist @@ -0,0 +1,16 @@ + + + + + content + inject${1/.+/(/}${1:init}${1/.+/)/} { |${2:mem}, ${3:var}| $0 } + name + inject(init) { |mem, var| .. } + scope + source.ruby + tabTrigger + inj + uuid + B563E0D7-513D-49B4-9733-1B04A6F25A74 + + diff --git a/bundles/ruby.tmbundle/Snippets/lambda { |args| .. } (lam).plist b/bundles/ruby.tmbundle/Snippets/lambda { |args| .. } (lam).plist new file mode 100644 index 000000000..5eaffa23d --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/lambda { |args| .. } (lam).plist @@ -0,0 +1,16 @@ + + + + + content + lambda { ${1/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}${1:args}${1/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:| )/}$0 } + name + lambda { |args| .. } + scope + source.ruby + tabTrigger + lam + uuid + 21E75321-0CF7-45E8-A297-BCC7C0DDDD15 + + diff --git a/bundles/ruby.tmbundle/Snippets/loop { __ }.tmSnippet b/bundles/ruby.tmbundle/Snippets/loop { __ }.tmSnippet new file mode 100644 index 000000000..08c78d83f --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/loop { __ }.tmSnippet @@ -0,0 +1,16 @@ + + + + + content + loop { $0 } + name + loop { .. } + scope + source.ruby + tabTrigger + loo + uuid + 567E3D18-BF2B-4379-8927-2777EC9F495E + + diff --git a/bundles/ruby.tmbundle/Snippets/map { |e| .. } (map).plist b/bundles/ruby.tmbundle/Snippets/map { |e| .. } (map).plist new file mode 100644 index 000000000..f151772de --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/map { |e| .. } (map).plist @@ -0,0 +1,16 @@ + + + + + content + map { |${1:e}| $0 } + name + map { |e| .. } + scope + source.ruby + tabTrigger + map + uuid + 5A3754FC-43A3-462B-AB42-E3E951872E6F + + diff --git a/bundles/ruby.tmbundle/Snippets/map_with_index { |e, i| .. } (mapwi).plist b/bundles/ruby.tmbundle/Snippets/map_with_index { |e, i| .. } (mapwi).plist new file mode 100644 index 000000000..47d8f3c9e --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/map_with_index { |e, i| .. } (mapwi).plist @@ -0,0 +1,16 @@ + + + + + content + enum_with_index.map { |${1:e}, ${2:i}| $0 } + name + map_with_index { |e, i| .. } + scope + source.ruby + tabTrigger + mapwi- + uuid + BD4CFD7B-1AC0-4569-9BDA-FD491F41F4E6 + + diff --git a/bundles/ruby.tmbundle/Snippets/max { |a, b| .. } (max).plist b/bundles/ruby.tmbundle/Snippets/max { |a, b| .. } (max).plist new file mode 100644 index 000000000..2dc65c4dd --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/max { |a, b| .. } (max).plist @@ -0,0 +1,16 @@ + + + + + content + max { |a, b| $0 } + name + max { |a, b| .. } + scope + source.ruby + tabTrigger + max + uuid + 98182B9E-7C61-4824-BE4C-9CD69C816037 + + diff --git a/bundles/ruby.tmbundle/Snippets/min { |a, b| .. } (min).plist b/bundles/ruby.tmbundle/Snippets/min { |a, b| .. } (min).plist new file mode 100644 index 000000000..6d746f9d3 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/min { |a, b| .. } (min).plist @@ -0,0 +1,16 @@ + + + + + content + min { |a, b| $0 } + name + min { |a, b| .. } + scope + source.ruby + tabTrigger + min + uuid + CB03D11A-7204-48D0-92C1-E109034403E7 + + diff --git a/bundles/ruby.tmbundle/Snippets/module .. ClassMethods .. end.plist b/bundles/ruby.tmbundle/Snippets/module .. ClassMethods .. end.plist new file mode 100644 index 000000000..440e60b0c --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/module .. ClassMethods .. end.plist @@ -0,0 +1,29 @@ + + + + + content + module ${1:${TM_FILENAME/(?:\A|_)([A-Za-z0-9]+)(?:\.rb)?/(?2::\u$1)/g}} + module ClassMethods + $0 + end + + module InstanceMethods + + end + + def self.included(receiver) + receiver.extend ClassMethods + receiver.send :include, InstanceMethods + end +end + name + module .. ClassMethods .. end + scope + source.ruby + tabTrigger + mod + uuid + A71A18CF-2D71-4BFF-AA0C-D9B8C59BC4EB + + diff --git a/bundles/ruby.tmbundle/Snippets/module .. end.plist b/bundles/ruby.tmbundle/Snippets/module .. end.plist new file mode 100644 index 000000000..50db6ee1f --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/module .. end.plist @@ -0,0 +1,18 @@ + + + + + content + module ${1:${TM_FILENAME/(?:\A|_)([A-Za-z0-9]+)(?:\.rb)?/(?2::\u$1)/g}} + $0 +end + name + module .. end + scope + source.ruby + tabTrigger + mod + uuid + 2B73EC5F-06D2-460C-A14F-6FA05AFCF0CC + + diff --git a/bundles/ruby.tmbundle/Snippets/module .. module_function .. end.plist b/bundles/ruby.tmbundle/Snippets/module .. module_function .. end.plist new file mode 100644 index 000000000..7a673972f --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/module .. module_function .. end.plist @@ -0,0 +1,20 @@ + + + + + content + module ${1:${TM_FILENAME/(?:\A|_)([A-Za-z0-9]+)(?:\.rb)?/(?2::\u$1)/g}} + module_function + + $0 +end + name + module .. module_function .. end + scope + source.ruby + tabTrigger + mod + uuid + 0E85EC81-2FAB-4648-B590-119CC1BB6E41 + + diff --git a/bundles/ruby.tmbundle/Snippets/namespace :__ do __ end.tmSnippet b/bundles/ruby.tmbundle/Snippets/namespace :__ do __ end.tmSnippet new file mode 100644 index 000000000..03d06c3b5 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/namespace :__ do __ end.tmSnippet @@ -0,0 +1,18 @@ + + + + + content + namespace :${1:${TM_FILENAME/\.\w+//}} do + $0 +end + name + namespace :.. do .. end + scope + source.ruby + tabTrigger + nam + uuid + 05EE1046-5ED7-48F5-8693-1F066163B2F4 + + diff --git a/bundles/ruby.tmbundle/Snippets/open yield block ({).plist b/bundles/ruby.tmbundle/Snippets/open yield block ({).plist new file mode 100644 index 000000000..febf9899a --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/open yield block ({).plist @@ -0,0 +1,16 @@ + + + + + content + { ${1/(^(?<var>\s*[a-z_][a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}${1:variable}${1/(^(?<var>\s*[a-z_][a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:| )/}${2:$TM_SELECTED_TEXT} + name + Insert { |variable| … } + scope + source.ruby - string - comment + tabTrigger + { + uuid + 855FC4EF-7B1E-48EE-AD4E-5ECB8ED79D1C + + diff --git "a/bundles/ruby.tmbundle/Snippets/open(\"path;or;url\", \"w\") do |doc| .. end (ope).plist" "b/bundles/ruby.tmbundle/Snippets/open(\"path;or;url\", \"w\") do |doc| .. end (ope).plist" new file mode 100644 index 000000000..4863ebb41 --- /dev/null +++ "b/bundles/ruby.tmbundle/Snippets/open(\"path;or;url\", \"w\") do |doc| .. end (ope).plist" @@ -0,0 +1,16 @@ + + + + + content + open(${1:"${2:path/or/url/or/pipe}"}${3/(^[rwab+]+$)|.*/(?1:, ")/}${3:w}${3/(^[rwab+]+$)|.*/(?1:")/}) { |${4:io}| $0 } + name + open("path/or/url", "w") { |io| .. } + scope + source.ruby + tabTrigger + ope + uuid + 418F1817-255F-430A-B09A-222964ED66A7 + + diff --git a/bundles/ruby.tmbundle/Snippets/option_parse { .. } (optp).plist b/bundles/ruby.tmbundle/Snippets/option_parse { .. } (optp).plist new file mode 100644 index 000000000..dc144ecb9 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/option_parse { .. } (optp).plist @@ -0,0 +1,43 @@ + + + + + content + require "optparse" + +options = {${1::default => "args"}} + +ARGV.options do |opts| + opts.banner = "Usage: #{File.basename(\$PROGRAM_NAME)} [OPTIONS]${2/^\s*$|(.*\S.*)/(?1: )/}${2:OTHER_ARGS}" + + opts.separator "" + opts.separator "Specific Options:" + + $0 + + opts.separator "Common Options:" + + opts.on( "-h", "--help", + "Show this message." ) do + puts opts + exit + end + + begin + opts.parse! + rescue + puts opts + exit + end +end + + name + option_parse { .. } + scope + source.ruby + tabTrigger + optp + uuid + C3C48948-4F49-484E-A8DE-DEB44723099E + + diff --git a/bundles/ruby.tmbundle/Snippets/partition { |e| .. } (par).plist b/bundles/ruby.tmbundle/Snippets/partition { |e| .. } (par).plist new file mode 100644 index 000000000..0f4195d9f --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/partition { |e| .. } (par).plist @@ -0,0 +1,16 @@ + + + + + content + partition { |${1:e}| $0 } + name + partition { |e| .. } + scope + source.ruby + tabTrigger + par + uuid + 52B8BF63-F09E-4789-8407-06168A8AE666 + + diff --git a/bundles/ruby.tmbundle/Snippets/pass(__).tmSnippet b/bundles/ruby.tmbundle/Snippets/pass(__).tmSnippet new file mode 100644 index 000000000..fdf055eb6 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/pass(__).tmSnippet @@ -0,0 +1,16 @@ + + + + + content + pass`snippet_paren.rb`"${1:Message.}"`snippet_paren.rb end`$0 + name + pass(..) + scope + source.ruby + tabTrigger + pas + uuid + F46A4687-E52D-40D2-9072-C215645EDBC6 + + diff --git a/bundles/ruby.tmbundle/Snippets/path_from_here( __ ).tmSnippet b/bundles/ruby.tmbundle/Snippets/path_from_here( __ ).tmSnippet new file mode 100644 index 000000000..810b0bbb4 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/path_from_here( __ ).tmSnippet @@ -0,0 +1,16 @@ + + + + + content + File.join(File.dirname(__FILE__), *%w[${1:rel path here}]) + name + path_from_here( .. ) + scope + source.ruby + tabTrigger + patfh + uuid + A4E89D97-D5ED-48BB-B5FF-1BFB79211FCD + + diff --git a/bundles/ruby.tmbundle/Snippets/randomize (ran).plist b/bundles/ruby.tmbundle/Snippets/randomize (ran).plist new file mode 100644 index 000000000..350e2cfbf --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/randomize (ran).plist @@ -0,0 +1,16 @@ + + + + + content + sort_by { rand } + name + randomize() + scope + source.ruby + tabTrigger + ran + uuid + B0CE57EC-FB2E-4482-8CCE-448DC2588715 + + diff --git a/bundles/ruby.tmbundle/Snippets/reject { |e| .. } (rej).plist b/bundles/ruby.tmbundle/Snippets/reject { |e| .. } (rej).plist new file mode 100644 index 000000000..4405e7f43 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/reject { |e| .. } (rej).plist @@ -0,0 +1,16 @@ + + + + + content + reject { |${1:e}| $0 } + name + reject { |e| .. } + scope + source.ruby + tabTrigger + rej + uuid + B79B9DAB-ABEF-44F6-BF7E-635E7BA11DFD + + diff --git "a/bundles/ruby.tmbundle/Snippets/require \"..\" (req).plist" "b/bundles/ruby.tmbundle/Snippets/require \"..\" (req).plist" new file mode 100644 index 000000000..ec8d2656e --- /dev/null +++ "b/bundles/ruby.tmbundle/Snippets/require \"..\" (req).plist" @@ -0,0 +1,16 @@ + + + + + content + require "$0" + name + require ".." + scope + source.ruby + tabTrigger + req + uuid + 97DE939B-D243-4D5C-B953-1C9090912E7C + + diff --git "a/bundles/ruby.tmbundle/Snippets/require \"tc_..\" .. (ts).plist" "b/bundles/ruby.tmbundle/Snippets/require \"tc_..\" .. (ts).plist" new file mode 100644 index 000000000..376ba0581 --- /dev/null +++ "b/bundles/ruby.tmbundle/Snippets/require \"tc_..\" .. (ts).plist" @@ -0,0 +1,20 @@ + + + + + content + require "test/unit" + +require "tc_${1:test_case_file}" +require "tc_${2:test_case_file}" + + name + require "tc_.." .. + scope + source.ruby + tabTrigger + ts + uuid + 5297FD0C-98B1-4514-BBD1-1516810BECA6 + + diff --git "a/bundles/ruby.tmbundle/Snippets/require_gem \"__\".tmSnippet" "b/bundles/ruby.tmbundle/Snippets/require_gem \"__\".tmSnippet" new file mode 100644 index 000000000..fb4ff9d06 --- /dev/null +++ "b/bundles/ruby.tmbundle/Snippets/require_gem \"__\".tmSnippet" @@ -0,0 +1,16 @@ + + + + + content + require "$0" + name + require_gem ".." + scope + source.ruby + tabTrigger + reqg- + uuid + 34FEBB9F-73CD-4DD4-A0A3-1CF2A5E3DE78 + + diff --git a/bundles/ruby.tmbundle/Snippets/results_report(__) { __ }.tmSnippet b/bundles/ruby.tmbundle/Snippets/results_report(__) { __ }.tmSnippet new file mode 100644 index 000000000..ece0ac97f --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/results_report(__) { __ }.tmSnippet @@ -0,0 +1,16 @@ + + + + + content + results.report("${1:name}:") { TESTS.times { $0 } } + name + results.report(..) { .. } + scope + source.ruby + tabTrigger + rep + uuid + 1C60D589-DD46-4109-90CA-6B34AEA2F298 + + diff --git a/bundles/ruby.tmbundle/Snippets/reverse_each { |e| .. } (rea).plist b/bundles/ruby.tmbundle/Snippets/reverse_each { |e| .. } (rea).plist new file mode 100644 index 000000000..79adc1533 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/reverse_each { |e| .. } (rea).plist @@ -0,0 +1,16 @@ + + + + + content + reverse_each { |${1:e}| $0 } + name + reverse_each { |e| .. } + scope + source.ruby + tabTrigger + reve + uuid + F3C5F719-EF03-4FF7-A777-4A8402FE3B6B + + diff --git a/bundles/ruby.tmbundle/Snippets/scan(;..;) { |match| .. } (sca).plist b/bundles/ruby.tmbundle/Snippets/scan(;..;) { |match| .. } (sca).plist new file mode 100644 index 000000000..c79bb9ac1 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/scan(;..;) { |match| .. } (sca).plist @@ -0,0 +1,16 @@ + + + + + content + scan(/${1:pattern}/) { |${2:match}| $0 } + name + scan(/../) { |match| .. } + scope + source.ruby + tabTrigger + sca + uuid + 66802933-B49F-479B-9DF9-1D898FF1FA90 + + diff --git a/bundles/ruby.tmbundle/Snippets/select { |e| .. } (sel).plist b/bundles/ruby.tmbundle/Snippets/select { |e| .. } (sel).plist new file mode 100644 index 000000000..a911413c0 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/select { |e| .. } (sel).plist @@ -0,0 +1,16 @@ + + + + + content + select { |${1:e}| $0 } + name + select { |e| .. } + scope + source.ruby + tabTrigger + sel + uuid + 4E409AA4-E7D4-46B7-A4E9-E32F992B33E9 + + diff --git a/bundles/ruby.tmbundle/Snippets/singleton_class().tmSnippet b/bundles/ruby.tmbundle/Snippets/singleton_class().tmSnippet new file mode 100644 index 000000000..29178d816 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/singleton_class().tmSnippet @@ -0,0 +1,16 @@ + + + + + content + class << self; self end + name + singleton_class() + scope + source.ruby + tabTrigger + sinc + uuid + B46D35B8-5DEB-4C10-A110-BA1965A2EB9C + + diff --git a/bundles/ruby.tmbundle/Snippets/skip(__).tmSnippet b/bundles/ruby.tmbundle/Snippets/skip(__).tmSnippet new file mode 100644 index 000000000..5e8da0f1e --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/skip(__).tmSnippet @@ -0,0 +1,16 @@ + + + + + content + skip`snippet_paren.rb`"${1:Message.}"`snippet_paren.rb end`$0 + name + skip(..) + scope + source.ruby + tabTrigger + ski + uuid + B186BAC0-D981-41AC-B8F4-34BAD2BC4EE6 + + diff --git a/bundles/ruby.tmbundle/Snippets/sort { |a, b| .. } (sor).plist b/bundles/ruby.tmbundle/Snippets/sort { |a, b| .. } (sor).plist new file mode 100644 index 000000000..91225fe37 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/sort { |a, b| .. } (sor).plist @@ -0,0 +1,16 @@ + + + + + content + sort { |a, b| $0 } + name + sort { |a, b| .. } + scope + source.ruby + tabTrigger + sor + uuid + 9E0B4D4B-2956-4B3A-800A-3D8CE54E66BF + + diff --git a/bundles/ruby.tmbundle/Snippets/sort_by { |e| .. } (sorb).plist b/bundles/ruby.tmbundle/Snippets/sort_by { |e| .. } (sorb).plist new file mode 100644 index 000000000..5fe80040d --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/sort_by { |e| .. } (sorb).plist @@ -0,0 +1,16 @@ + + + + + content + sort_by { |${1:e}| $0 } + name + sort_by { |e| .. } + scope + source.ruby + tabTrigger + sorb + uuid + BA9440C9-36C3-4031-BB61-67B581D5B179 + + diff --git a/bundles/ruby.tmbundle/Snippets/step(2) { |e| .. } (ste).plist b/bundles/ruby.tmbundle/Snippets/step(2) { |e| .. } (ste).plist new file mode 100644 index 000000000..53f711807 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/step(2) { |e| .. } (ste).plist @@ -0,0 +1,16 @@ + + + + + content + step(${1:2}) { ${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}${2:n}${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:| )/}$0 } + name + step(2) { |e| .. } + scope + source.ruby + tabTrigger + ste + uuid + 36853A11-0307-4AE7-B835-7CE6358717A5 + + diff --git a/bundles/ruby.tmbundle/Snippets/sub(;..;) { |match| .. } (sub).plist b/bundles/ruby.tmbundle/Snippets/sub(;..;) { |match| .. } (sub).plist new file mode 100644 index 000000000..664f79108 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/sub(;..;) { |match| .. } (sub).plist @@ -0,0 +1,16 @@ + + + + + content + sub(/${1:pattern}/) { ${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}${2:match}${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:| )/}$0 } + name + sub(/../) { |match| .. } + scope + source.ruby + tabTrigger + sub + uuid + 8021944C-CEA4-4983-8D1C-78D18D4004A1 + + diff --git a/bundles/ruby.tmbundle/Snippets/task :task_name => [:dependent, :tasks] do __ end.tmSnippet b/bundles/ruby.tmbundle/Snippets/task :task_name => [:dependent, :tasks] do __ end.tmSnippet new file mode 100644 index 000000000..a23be59df --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/task :task_name => [:dependent, :tasks] do __ end.tmSnippet @@ -0,0 +1,19 @@ + + + + + content + desc "${1:Task description}" +task :${2:${3:task_name} => ${4:[:${5:dependent, :tasks}]}} do + $0 +end + name + task :task_name => [:dependent, :tasks] do .. end + scope + source.ruby + tabTrigger + tas + uuid + A7BF14E6-59B1-42E5-8755-8A72BF13685E + + diff --git a/bundles/ruby.tmbundle/Snippets/times { |n| .. } (tim).plist b/bundles/ruby.tmbundle/Snippets/times { |n| .. } (tim).plist new file mode 100644 index 000000000..de5c52432 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/times { |n| .. } (tim).plist @@ -0,0 +1,16 @@ + + + + + content + times { ${1/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}${1:n}${1/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:| )/}$0 } + name + times { |n| .. } + scope + source.ruby + tabTrigger + tim + uuid + 206D54AF-E67A-4DF0-B7F4-3D42FEB81685 + + diff --git a/bundles/ruby.tmbundle/Snippets/transaction( __ ) do __ end.tmSnippet b/bundles/ruby.tmbundle/Snippets/transaction( __ ) do __ end.tmSnippet new file mode 100644 index 000000000..78506b545 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/transaction( __ ) do __ end.tmSnippet @@ -0,0 +1,16 @@ + + + + + content + transaction${1/(^.*?\S.*)|.*/(?1:\()/}${1:true}${1/(^.*?\S.*)|.*/(?1:\))/} { $0 } + name + transaction( .. ) { .. } + scope + source.ruby + tabTrigger + tra + uuid + 46BF99AD-E172-4D49-BCF7-072F4730E1D9 + + diff --git a/bundles/ruby.tmbundle/Snippets/unix_filter .. (uni).plist b/bundles/ruby.tmbundle/Snippets/unix_filter .. (uni).plist new file mode 100644 index 000000000..d6ede306a --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/unix_filter .. (uni).plist @@ -0,0 +1,18 @@ + + + + + content + ARGF.each_line$1 do |${2:line}| + $0 +end + name + unix_filter { .. } + scope + source.ruby + tabTrigger + unif + uuid + 8CEF9711-88D5-4202-AFB9-29EF4EFD25C1 + + diff --git a/bundles/ruby.tmbundle/Snippets/unless (unless).plist b/bundles/ruby.tmbundle/Snippets/unless (unless).plist new file mode 100644 index 000000000..44bd57732 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/unless (unless).plist @@ -0,0 +1,18 @@ + + + + + content + unless ${1:condition} + $0 +end + name + unless … end + scope + source.ruby + tabTrigger + unless + uuid + F53E098D-D08E-4CE2-990A-B0BD70E60614 + + diff --git a/bundles/ruby.tmbundle/Snippets/until ___ end.tmSnippet b/bundles/ruby.tmbundle/Snippets/until ___ end.tmSnippet new file mode 100644 index 000000000..7e0c91739 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/until ___ end.tmSnippet @@ -0,0 +1,18 @@ + + + + + content + until ${1:condition} + $0 +end + name + until ... end + scope + source.ruby + tabTrigger + until + uuid + 488B387C-50C0-4B2D-9260-5A7E7EAF9B42 + + diff --git a/bundles/ruby.tmbundle/Snippets/untitled.plist b/bundles/ruby.tmbundle/Snippets/untitled.plist new file mode 100644 index 000000000..6896806c8 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/untitled.plist @@ -0,0 +1,19 @@ + + + + + content + opts.on( "-${1:o}", "--${2:long-option-name}"${3/^\s*$|(.*\S.*)/(?1:, )/}${3:String}, + "${4:Option description.}" ) do |${6:opt}| + $0 +end + name + option(..) + scope + source.ruby + tabTrigger + opt + uuid + 209D5D73-7A77-4931-A158-3FB6D5B48A88 + + diff --git a/bundles/ruby.tmbundle/Snippets/upto(1.0;0.0) { |n| .. } (upt).plist b/bundles/ruby.tmbundle/Snippets/upto(1.0;0.0) { |n| .. } (upt).plist new file mode 100644 index 000000000..28bdae36c --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/upto(1.0;0.0) { |n| .. } (upt).plist @@ -0,0 +1,16 @@ + + + + + content + upto(${1:1.0/0.0}) { ${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}${2:n}${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:| )/}$0 } + name + upto(1.0/0.0) { |n| .. } + scope + source.ruby + tabTrigger + upt + uuid + 51954118-81D7-42B6-9A10-BE23D8B9FFE2 + + diff --git a/bundles/ruby.tmbundle/Snippets/usage_if() (usai).plist b/bundles/ruby.tmbundle/Snippets/usage_if() (usai).plist new file mode 100644 index 000000000..5926f3d1e --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/usage_if() (usai).plist @@ -0,0 +1,18 @@ + + + + + content + if ARGV.$1 + abort "Usage: #{\$PROGRAM_NAME} ${2:ARGS_GO_HERE}" +end + name + usage_if() + scope + source.ruby + tabTrigger + usai + uuid + 21C0D711-F32A-4665-AA0D-B136F9DD3945 + + diff --git a/bundles/ruby.tmbundle/Snippets/usage_unless() (usau).plist b/bundles/ruby.tmbundle/Snippets/usage_unless() (usau).plist new file mode 100644 index 000000000..7292cc24b --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/usage_unless() (usau).plist @@ -0,0 +1,18 @@ + + + + + content + unless ARGV.$1 + abort "Usage: #{\$PROGRAM_NAME} ${2:ARGS_GO_HERE}" +end + name + usage_unless() + scope + source.ruby + tabTrigger + usau + uuid + 49D69DEC-6991-49F4-8D9B-BA60BFDD3D17 + + diff --git a/bundles/ruby.tmbundle/Snippets/when.plist b/bundles/ruby.tmbundle/Snippets/when.plist new file mode 100644 index 000000000..0dd73244a --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/when.plist @@ -0,0 +1,17 @@ + + + + + content + when ${1:condition} + $0 + name + when … + scope + source.ruby + tabTrigger + when + uuid + 48D8E498-C9A5-4B1B-9A18-71A5860276FB + + diff --git a/bundles/ruby.tmbundle/Snippets/while ___ end.tmSnippet b/bundles/ruby.tmbundle/Snippets/while ___ end.tmSnippet new file mode 100644 index 000000000..700521895 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/while ___ end.tmSnippet @@ -0,0 +1,18 @@ + + + + + content + while ${1:condition} + $0 +end + name + while ... end + scope + source.ruby + tabTrigger + while + uuid + D121FC61-96A4-4B8F-8709-280EDA876FF3 + + diff --git a/bundles/ruby.tmbundle/Snippets/xmlread(__).tmSnippet b/bundles/ruby.tmbundle/Snippets/xmlread(__).tmSnippet new file mode 100644 index 000000000..c45ac9c7a --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/xmlread(__).tmSnippet @@ -0,0 +1,16 @@ + + + + + content + REXML::Document.new(File.read(${1:"${2:path/to/file}"})) + name + xmlread(..) + scope + source.ruby + tabTrigger + xml- + uuid + B904D4AA-D15D-48A4-8EB2-563BAF489332 + + diff --git a/bundles/ruby.tmbundle/Snippets/xpath(__) { __ }.tmSnippet b/bundles/ruby.tmbundle/Snippets/xpath(__) { __ }.tmSnippet new file mode 100644 index 000000000..93d3c3413 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/xpath(__) { __ }.tmSnippet @@ -0,0 +1,18 @@ + + + + + content + elements.each(${1:"${2://XPath}"}) do |${3:node}| + $0 +end + name + xpath(..) { .. } + scope + source.ruby + tabTrigger + xpa + uuid + CC300D44-6C3F-4F6C-A8AB-86F5A2DC57CF + + diff --git a/bundles/ruby.tmbundle/Snippets/zip(enums) { |row| .. } (zip).plist b/bundles/ruby.tmbundle/Snippets/zip(enums) { |row| .. } (zip).plist new file mode 100644 index 000000000..068a568e1 --- /dev/null +++ b/bundles/ruby.tmbundle/Snippets/zip(enums) { |row| .. } (zip).plist @@ -0,0 +1,16 @@ + + + + + content + zip(${1:enums}) { |${2:row}| $0 } + name + zip(enums) { |row| .. } + scope + source.ruby + tabTrigger + zip + uuid + FD010022-E0E7-44DB-827F-33F7D9310DA2 + + diff --git a/bundles/ruby.tmbundle/Support/RakeMate/rake_mate.rb b/bundles/ruby.tmbundle/Support/RakeMate/rake_mate.rb new file mode 100644 index 000000000..8a8ee2347 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/RakeMate/rake_mate.rb @@ -0,0 +1,100 @@ +#!/usr/bin/env ruby + +require "#{ENV["TM_SUPPORT_PATH"]}/lib/escape" +require "#{ENV["TM_SUPPORT_PATH"]}/lib/ui" +require "#{ENV["TM_SUPPORT_PATH"]}/lib/web_preview" + +require "run_rake_task" + +require "erb" +include ERB::Util +require "pstore" + +RAKEMATE_VERSION = "2.0.0".freeze +DEFAULT_TASK = "(default task)".freeze +RAKEFILE_DIR = (ENV["TM_PROJECT_DIRECTORY"] || ENV["TM_DIRECTORY"]).freeze + +def html_error(error) + puts error + puts "" + html_footer + exit +end + +html_header("RakeMate", "Rake") +puts <<-HTML +
RakeMate v#{RAKEMATE_VERSION} running on Ruby v#{RUBY_VERSION} (#{ENV["TM_RUBY"].strip})
+>>> #{RAKEFILE_DIR}/Rakefile
+
+HTML
+
+rake = ENV["TM_RAKE"]
+if rake.nil? or not File.exist? rake
+  html_error("Rake not found.  Please set TM_RAKE.")
+end
+
+prefs = PStore.new( File.expand_path( "~/Library/Preferences/" +
+                                      "com.macromates.textmate.run_rake" ) )
+
+Dir.chdir(RAKEFILE_DIR)
+tasks = fetch_rake_tasks
+
+unless $?.exited?
+  html_error("Could not fetch task list.")
+end
+if tasks.include? "No Rakefile found"
+  html_error("Could not locate a Rakefile in #{RAKEFILE_DIR}.")
+end
+
+tasks = [DEFAULT_TASK] + tasks.grep(/^rake\s+(\S+)/) { |t| t.split[1] }
+if last_task = tasks.index(prefs.transaction(true) { prefs[RAKEFILE_DIR] })
+  tasks.unshift(tasks.slice!(last_task))
+end
+
+if task = TextMate::UI.request_item( :title   => "Rake Tasks",
+                               :prompt  => "Select a task to execute:",
+                               :items   => tasks,
+                               :button1 => "Run Task")
+  prefs.transaction { prefs[RAKEFILE_DIR] = task }
+
+  testing = task =~ /test/i || task == DEFAULT_TASK
+  run_rake_task(task == DEFAULT_TASK ? nil : task) do |line, mode|
+    if testing and line =~ /^\d+ tests, \d+ assertions, (\d+) failures, (\d+) errors/
+      print "#{line.chomp}
" + elsif testing and line =~ /^(\s+)(\S.*?):(\d+)(?::in\s*`(.*?)')?/ and File.exist? $2 + indent, file, line, method = $1, $2, $3, $4 + + url, display_name = '', 'untitled document'; + unless file == "-" + url = '&url=file://' + e_url(File.expand_path(file)) + display_name = File.basename(file) + end + + print "#{indent}" + + (method ? "method #{h method}" : 'at top level') + + " in #{h display_name} at line #{line}
" + elsif mode == :char_by_char + if %w[. E F].include? line + print line.sub(/^[EF]$/, "\\&"), + "
" + else + print htmlize(line) + $stdout.flush + next :line_by_line + end + else + print htmlize(line) + end + $stdout.flush + if mode == :char_by_char or (testing and line =~ /^Started\s*/) + :char_by_char + else + :line_by_line + end + end +end + +puts "
" +html_footer diff --git a/bundles/ruby.tmbundle/Support/RakeMate/run_rake_task.rb b/bundles/ruby.tmbundle/Support/RakeMate/run_rake_task.rb new file mode 100644 index 000000000..04c6efcfd --- /dev/null +++ b/bundles/ruby.tmbundle/Support/RakeMate/run_rake_task.rb @@ -0,0 +1,47 @@ +#!/usr/bin/env ruby -w + +require "#{ENV["TM_SUPPORT_PATH"]}/lib/escape" + +class RakeTaskRunner + def initialize + @mode = :line_by_line + end + + def run(task = nil, *options, &block) + build_rake_command(task, *options) + + open(@command) do |rake_task| + if block.nil? + rake_task.read + else + loop do + break if rake_task.eof? + new_content = @mode == :char_by_char ? rake_task.getc.chr : + rake_task.gets + @mode = block.arity == 2 ? block[new_content, @mode] : + block[new_content] + end + end + end + end + + private + + def build_rake_command(task, *options) + @command = "|" + @command << ENV["TM_RAKE"] || "rake" + @command << " " << e_sh(task) unless task.nil? + unless options.empty? + @command << " " << options.map { |arg| e_sh(arg) }.join(" ") + end + @command << " 2>&1" + end +end + +def run_rake_task(*args, &block) + RakeTaskRunner.new.run(*args, &block) +end + +def fetch_rake_tasks(*args, &block) + RakeTaskRunner.new.run("--tasks", *args, &block) +end diff --git a/bundles/ruby.tmbundle/Support/RubyMate/catch_exception.rb b/bundles/ruby.tmbundle/Support/RubyMate/catch_exception.rb new file mode 100644 index 000000000..84e377eda --- /dev/null +++ b/bundles/ruby.tmbundle/Support/RubyMate/catch_exception.rb @@ -0,0 +1,41 @@ +# encoding: utf-8 + +STDOUT.sync = true +STDERR.sync = true + +require 'pathname' + +at_exit do + if (e = $!) && !e.instance_of?(SystemExit) + require "#{ENV['TM_SUPPORT_PATH']}/lib/escape" + require "cgi" + io = IO.for_fd(ENV['TM_ERROR_FD'].to_i) + + io.write "
\n" + io.write "

#{e.class.name}: #{CGI.escapeHTML e.message.sub(/`(\w+)'/, '‘\1’').sub(/ -- /, ' — ')}

\n" + + io.write "
\n" + + e.backtrace.each do |b| + if b =~ /(.*?):(\d+)(?::in\s*`(.*?)')?/ then + file, line, method = $1, $2, $3 + + url, display_name = '', 'untitled document'; + if file != '-' && File.exists?(file) && !ENV['TM_SCRIPT_IS_UNTITLED'] then + file = Pathname.new(file).realpath.to_s + url = '&url=file://' + e_url(file) + display_name = File.basename(file) + end + + io << "\n\n" + end + end + + io.write "
" + io << (method ? "method #{CGI::escapeHTML method}" : 'at top level') + io << "in #{CGI::escapeHTML display_name} at line #{line}
" + io.flush + + exit! + end +end diff --git a/bundles/ruby.tmbundle/Support/RubyMate/run_script.rb b/bundles/ruby.tmbundle/Support/RubyMate/run_script.rb new file mode 100755 index 000000000..d6c6e932d --- /dev/null +++ b/bundles/ruby.tmbundle/Support/RubyMate/run_script.rb @@ -0,0 +1,133 @@ +require ENV["TM_SUPPORT_PATH"] + "/lib/tm/executor" +require ENV["TM_SUPPORT_PATH"] + "/lib/tm/save_current_document" + +require 'pathname' + +TextMate.save_current_document + +# For Run focused unit test, find the name of the test the user wishes to run. +args = [ ] +if ARGV.first == "--name=" + n = ENV['TM_LINE_NUMBER'].to_i + + spec, context, name, test_name = nil, nil, nil + + File.open(ENV['TM_FILEPATH']) do |f| + # test/unit + lines = f.read.split("\n")[0...n].reverse + name = lines.find { |line| line =~ /^\s*def test[_a-z0-9]*[\?!]?/i }.to_s.sub(/^\s*def (.*?)\s*$/) { $1 } + # test helper + test_name = $2 || $3 if lines.find { |line| line =~ /^\s*test\s+('(.*)'|"(.*)")+\s*(\{|do)/ } + # test/spec. + spec = $3 || $4 if lines.find { |line| line =~ /^\s*(specify|it)\s+('(.*)'|"(.*)")+\s*(\{|do)/ } + context = $3 || $4 if lines.find { |line| line =~ /^\s*(context|describe)\s+('(.*)'|"(.*)")+\s*(\{|do)/ } + end + + if name and !name.empty? + args << "--name=#{name}" + elsif test_name and !test_name.empty? + args << "--name=test_#{test_name.gsub(/\s+/,'_')}" + elsif spec and !spec.empty? and context and !context.empty? + args << %Q{--name="/test_spec \\{.*#{context}\\} \\d{3} \\[#{spec}\\]/"} + else + puts "Error: This doesn't appear to be a TestCase or spec." + exit + end +end + +is_test_script = !(ENV["TM_FILEPATH"].match(/(?:\b|_)(?:tc|ts|test)(?:\b|_)/).nil? and + File.read(ENV["TM_FILEPATH"]).match(/\brequire\b.+(?:test\/unit|test_helper)/).nil?) + +cmd = [ENV['TM_RUBY'] || 'ruby', '-KU', '-rcatch_exception'] + +if is_test_script and not ENV['TM_FILE_IS_UNTITLED'] + path_ary = (ENV['TM_ORIG_FILEPATH'] || ENV['TM_FILEPATH']).split("/") + if index = path_ary.rindex("test") + test_path = "#{File.join(*path_ary[0..index])}:#{File.join(*path_ary[0..-2])}" + lib_path = File.join( *( path_ary[0..-2] + + [".."] * (path_ary.length - index - 1) ) + + ["lib"] ) + if File.exist? lib_path + cmd << "-I#{lib_path}:#{test_path}" + else + cmd << "-I#{test_path}" + end + end +end + +cmd << ENV["TM_FILEPATH"] + +def path_to_url_chunk(path) + unless path == "untitled" + prefix = '' + 2.times do + begin + file = Pathname.new(prefix + path).realpath.to_s + return "url=file://#{e_url(file)}&" + rescue Errno::ENOENT + # Hmm lets try to prefix with project directory + prefix = "#{ENV['TM_PROJECT_DIRECTORY']}/" + end + end + else + '' + end +end + +def actual_path_name(path) + prefix = '' + 2.times do + begin + file = Pathname.new(prefix + path).realpath.to_s + url = '&url=file://' + e_url(file) + display_name = File.basename(file) + return file, url, display_name + rescue Errno::ENOENT + # Hmm lets try to prefix with project directory + prefix = "#{ENV['TM_PROJECT_DIRECTORY']}/" + end + end + return path, '', path +end + +TextMate::Executor.run( cmd, :version_args => ["--version"], + :script_args => args ) do |line, type| + if is_test_script and type == :out + if line =~ /\A[.EF]+\Z/ + line.gsub!(/([.])/, "\\1") + line.gsub!(/([EF])/, "\\1") + line + "
\n" + else + if line =~ /^(\s+)(\S.*?):(\d+)(?::in\s*`(.*?)')?/ + indent, file, line, method = $1, $2, $3, $4 + url, display_name = '', 'untitled document'; + unless file == "untitled" + indent += " " if file.sub!(/^\[/, "") + if file == '(eval)' + display_name = file + else + file, url, display_name = actual_path_name(file) + end + end + out = indent + out += "" unless url.empty? + out += (method ? "method #{CGI::escapeHTML method}" : 'at top level') + out += "" unless url.empty? + out += " in #{CGI::escapeHTML display_name} at line #{line}
" + out + elsif line =~ /test\_(should\_[\w\_]+)\((\w+)\)\s+\[([\w\_\/\.]+)\:(\d+)\]\:/ # shoulda 2.11.3 output test_should_fulfill(SomeTest) [test/unit/some_test.rb:42]: + spec, mod, file, line = $1, $2, $3, $4 + spec.gsub!('_',' ') + "#{mod}: #{spec}:#{line}
" + elsif line =~ /(\[[^\]]+\]\([^)]+\))\s+\[([\w\_\/\.]+)\:(\d+)\]/ # [spec](file) some text [function_name:line_no] + spec, file, line = $1, $2, $3, $4 + "#{spec}:#{line}
" + elsif line =~ /([\w\_]+).*\[([\w\_\/\.]+)\:(\d+)\]/ # whatever_message....[function_name/.whatever:line_no] + method, file, line = $1, $2, $3 + "#{method}:#{line}
" + elsif line =~ /^\d+ tests, \d+ assertions, (\d+) failures, (\d+) errors\b.*/ + "
#{$&}
\n" + end + end + end +end diff --git a/bundles/ruby.tmbundle/Support/RubyMate/test.rb b/bundles/ruby.tmbundle/Support/RubyMate/test.rb new file mode 100644 index 000000000..a4d207cdf --- /dev/null +++ b/bundles/ruby.tmbundle/Support/RubyMate/test.rb @@ -0,0 +1,19 @@ +# encoding: utf-8 + +# p __FILE__, $PROGRAM_NAME + +at_exit { puts "I am the exit!" } +puts "that’s nice" +STDERR.write "this is my important stuff\n" + +system("echo 'bad!' 1>&2") + +require "erb" +foo = "bar" +p ERB.new("<%= foo %>").result + +def charlie + sheen +end + +charlie diff --git a/bundles/ruby.tmbundle/Support/RubyMate/todo.txt b/bundles/ruby.tmbundle/Support/RubyMate/todo.txt new file mode 100644 index 000000000..dfca7c101 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/RubyMate/todo.txt @@ -0,0 +1,13 @@ +Syntax Errors +============= +Syntax errors will be written to stderr. We should catch these and turn them into clickable links. + + +Exit Status +=========== +The exit code from the process we span is not shown. This is a limitation of popen3, but we could role a replacement for that. + + +Errors From Included Files +========================== +These could be shown differently to make them distinguishable. diff --git a/bundles/ruby.tmbundle/Support/bin/insert_requires.rb b/bundles/ruby.tmbundle/Support/bin/insert_requires.rb new file mode 100755 index 000000000..1baedf379 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/bin/insert_requires.rb @@ -0,0 +1,104 @@ +#!/usr/bin/env ruby + +$: << "#{ENV['TM_BUNDLE_SUPPORT']}/lib" if ENV.has_key?('TM_BUNDLE_SUPPORT') +require "ruby_requires" + +code = STDIN.read +if ARGV.empty? + REQUIRES = { "abbrev" => [/\babbrev\b/], + "base64" => [/\bBase64\b/], + "benchmark" => [/\bBenchmark\b/], + "bigdecimal" => [/\bBigDecimal\b/], + "bigdecimal/math" => [/\bBigMath\b/], + "cgi" => [/\bCGI\b/], + "complex" => [/\bComplex\b/], + "csv" => [/\bCSV\b/], + "curses" => [/\bCurses\b/], + "date" => [/\bDate(?:Time)?\b/], + "dbm" => [/\bDBM\b/], + "delegate" => [ /\bDelegateClass\b/, /\bDelegator\b/, + /\bSimpleDelegator\b/ ], + "digest" => [/\bMD5\b/, /\bSHA1\b/], + "dl" => [/\bDL\b/], + "enumerator" => [ /\b(?:enum|each)_(?:cons|slice)\b/, + /\benum_(?:for|with_index)\b/, + /\bto_enum\b/ ], + "erb" => [/\bERB\b/], + "etc" => [/\bEtc\b/], + "fcntl" => [/\bFcntl\b/], + "fileutils" => [/\bFileUtils\b/], + "find" => [/\bFind(?:\.|::)find\b/], + "forwardable" => [/\b(?:Single)?Forwardable\b/], + "gdbm" => [/\bGDBM\b/], + "generator" => [/\bGenerator\b/, /\bSyncEnumerator\b/], + "getoptlong" => [/\bGetoptLong\b/], + "gserver" => [/\bGServer\b/], + "iconv" => [/\bIconv\b/], + "ipaddr" => [/\bIpAddr\b/], + "logger" => [/\bLogger\b/], + "matrix" => [/\bMatrix\b/, /\bVector\b/], + "monitor" => [/\bMonitor(?:Mixin)?\b/], + "net/ftp" => [/\bNet::FTP\b/], + "net/http" => [/\bNet::HTTP\b/], + "net/imap" => [/\bNet::IMAP\b/], + "net/pop" => [/\bNet::(?:APOP|POP3)\b/], + "net/smtp" => [/\bNet::SMTP\b/], + "net/telnet" => [/\bNet::Telnet\b/], + "nkf" => [/\bNKF\b/], + "observer" => [/\bObservable\b/], + "open3" => [/\bOpen3\b/], + "optparse" => [/\bOptionParser\b/], + "ostruct" => [/\bOpenStruct\b/], + "pathname" => [/\bPathname\b/], + "ping" => [/\bPing\b/], + "pp" => [/\bpp\b/], + "pstore" => [/\bPStore\b/], + "rational" => [/\bRational\b/], + "rdoc/usage" => [/\bRDoc(?:\.|::)usage\b/], + "rdoc/markup/simple_markup" \ + => [/\bSM::SimpleMarkup\b/], + "rdoc/markup/simple_markup/to_html" \ + => [/\bSM::SimpleMarkup\b/], + "rdoc/usage" => [/\bRDoc(?:\.|::)usage\b/], + "resolv" => [/\bResolv\b/], + "rexml/document" => [/\bREXML\b/], + "rinda/tuplespace" => [/\bRinda::TupleSpace(?:Proxy)?\b/], + "rinda/ring" => [/\bRinda::Ring(?:Finger|Server)?\b/], + "rss" => [/\bRSS\b/], + "scanf" => [/\bscanf\b/], + "sdbm" => [/\bSDBM\b/], + "set" => [/\b(?:Sorted)?Set\b/], + "singleton" => [/\bSingleton\b/], + "soap" => [/\bSOAP\b/], + "socket" => [ /\b(?:TCP|UNIX)(?:Socket|Server)\b/, + /\b(?:UDP)?Socket\b/ ], + "stringio" => [/\bStringIO\b/], + "strscan" => [/\bStringScanner\b/], + "syslog" => [/\bSyslog\b/], + "tempfile" => [/\bTempfile\b/], + "test/unit" => [/\bTest::Unit\b/], + "thread" => [ /\bConditionVariable\b/, /\bMutex\b/, + /\b(?:Sized)?Queue\b/ ], + "time" => [/\bTime(?:\.|::)parse\b/], + "timeout" => [/\bTimeout(?:\.|::)timeout\b/], + "tk" => [/\bTK\b/], + "tmpdir" => [/\bDir(?:\.|::)tmpdir\b/], + "tracer" => [/\bTracer\b/], + "tsort" => [/\bTSort\b/], + "uri" => [/\bURI\b/], + "weakref" => [/\bWeakRef\b/], + "webrick" => [/\bWEBrick\b/], + "Win32API" => [/\bWin32(?:API)?\b/], + "win32ole" => [/\bWIN32OLE\b/], + "wsdl" => [/\bWSDL\b/], + "xmlrpc" => [/\bXMLRPC\b/], + "yaml" => [/\bYAML\b/], + "zlib" => [/\bZlib\b/] } + + libs = REQUIRES.select { |lib, usage| usage.any? { |test| code =~ test } }. + map { |kv| kv.first } + + print RubyRequires.add_requires(code, libs) +else + print RubyRequires.add_requires(code, ARGV) +end diff --git a/bundles/ruby.tmbundle/Support/bin/linked_ri.rb b/bundles/ruby.tmbundle/Support/bin/linked_ri.rb new file mode 100755 index 000000000..8e85d6093 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/bin/linked_ri.rb @@ -0,0 +1,153 @@ +#!/usr/bin/env ruby -w +# encoding: utf-8 + +# if we are not called directly from TM (e.g. JavaScript) the caller +# should ensure that RUBYLIB is set properly +$: << "#{ENV["TM_SUPPORT_PATH"]}/lib" if ENV.has_key? "TM_SUPPORT_PATH" +LINKED_RI = "#{ENV["TM_BUNDLE_SUPPORT"]}/bin/linked_ri.rb" + +require "exit_codes" +require "ui" +require "web_preview" + +require "erb" +include ERB::Util + +RI_EXE = [ ENV['TM_RUBY_RI'], 'qri', 'ri' ].find { |cmd| !cmd.to_s.empty? && (File.executable?(cmd) || ENV['PATH'].split(':').any? { |dir| File.executable? File.join(dir, cmd) }) ? cmd : false } + +term = ARGV.shift + +# first escape for use in the shell, then escape for use in a JS string +def e_js_sh(str) + (e_sh str).gsub("\\", "\\\\\\\\") +end + +def link_methods(prefix, methods) + methods.split(/(,\s*)/).map do |match| + match[0] == ?, ? + match : "#{match}" + end.join +end + +def htmlize_ri_output(text, term) + text = text.gsub(/&/, '&').gsub(/Class: " + $2.gsub(/([A-Z_]\w*)(\s+<)?/, "\\1\\2") + "\n
"
+  end
+
+  text.sub!(/\A(-+\s+)(([A-Z_]\w*::)*[A-Z_]\w*)((#|::|\.).*)$/) do
+    method    = $4
+    namespace = $2.split("::")
+    linked    = (0...namespace.size).map do |i|
+      "#{namespace[i]}"
+    end
+    "

#{linked.join("::")}#{method}

\n
"
+  end
+
+  text.sub!(/^(Includes:\s+-+\s+)(.+?)([ \t]*\n[ \t]*\n|\s*\Z)/m) do
+    head, meths, foot = $1, $2, $3
+    head + meths.gsub(/([A-Z_]\w*)\(([^)]*)\)/) do |match|
+      "#{$1}(" +
+      link_methods("#{$1}#", $2) + ")"
+    end + foot
+  end
+
+  text.sub!(/^(Class methods:\s+-+\s+)(.+?)([ \t]*\n[ \t]*\n|\s*\Z)/m) do
+    $1 + link_methods("#{term}::", $2) + $3
+  end
+
+  text.sub!(/^(Instance methods:\s+-+\s+)(.+?)([ \t]*\n[ \t]*\n|\s*\Z)/m) do
+    $1 + link_methods("#{term}#", $2) + $3
+  end
+
+  text.gsub!(/(?:\n+-+$)?\n+([\w\s]+)[:.]$\n-+\n+/, "
\n\n

\\1

\n
")
+  text.gsub!(/^-+$/, '
') + + text.chomp + "
" +end + +def ri(term) + documentation = `#{e_sh LINKED_RI} '#{term}' 'js' 2>&1` \ + rescue "

ri Command Error.

" + if documentation =~ /\ACouldn't open the index/ + TextMate.exit_show_tool_tip( + "Index needed by #{RI_EXE} not found.\n" + + "You may need to run:\n\n" + + " fastri-server -b" + ) + elsif documentation =~ /\ACouldn't initialize DRb and locate the Ring server./ + TextMate.exit_show_tool_tip("Your fastri-server is not running.") + elsif documentation =~ /Nothing known about / + TextMate.exit_show_tool_tip(documentation) + elsif documentation.sub!(/\A>>\s*/, "") + choices = documentation.split + choice = TextMate::UI.menu(choices) + exit if choice.nil? + ri(choices[choice]) + else + [term, documentation] + end +end + +mode = ARGV.shift +if mode.nil? then + + term = STDIN.read.strip + + if term.empty? + term = TextMate::UI.request_string( :title => "Ruby Documentation Search", + :prompt => "Enter a term to search for:", + :button1 => "search") + end + + TextMate.exit_show_tool_tip("Please select a term to look up.") if term.empty? + + term, documentation = ri(term) + + html_header("Documentation for ‘#{term}’", "RDoc", <<-HTML) + +HTML + puts <<-HTML + + +
#{documentation}
+HTML + html_footer + TextMate.exit_show_html +elsif mode == 'js' then + documentation = `#{e_sh RI_EXE} -T -f plain #{e_sh term}` \ + rescue "

ri Command Error.

" + + if documentation =~ /\A(?:\s*More than one method matched|-+\s+Multiple choices)/ + methods = documentation.split(/\n[ \t]*\n/).last. + strip.split(/(?:,\s*|\n)/).map { |m| m[/\S+/] }.compact + documentation = ">> #{methods.join(' ')}" + else + documentation = htmlize_ri_output(documentation, term) + end + + puts documentation +end diff --git a/bundles/ruby.tmbundle/Support/bin/make_destructive.rb b/bundles/ruby.tmbundle/Support/bin/make_destructive.rb new file mode 100644 index 000000000..153f20876 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/bin/make_destructive.rb @@ -0,0 +1,18 @@ +#!/usr/bin/env ruby + +require "escape" + +CURSOR = [0xFFFC].pack("U").freeze +line = STDIN.read +begin + line[ENV["TM_LINE_INDEX"].to_i, 0] = CURSOR +rescue + exit +end + +line.sub!(/\b(chomp|chop|collect|compact|delete|downcase|exit|flatten|gsub|lstrip|map|next|reject|reverse|rstrip|slice|sort|squeeze|strip|sub|succs|swapcase|tr|tr_s|uniq|upcase)\b(?!\!)/, "\\1!") + +line = e_sn(line) +line.sub!(CURSOR, "$0") + +print line diff --git a/bundles/ruby.tmbundle/Support/bin/snippet_paren.rb b/bundles/ruby.tmbundle/Support/bin/snippet_paren.rb new file mode 100755 index 000000000..6b4bbbd39 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/bin/snippet_paren.rb @@ -0,0 +1,10 @@ +#!/usr/bin/env ruby -wKU + +minimize = ENV["TM_MINIMIZE_PARENS"].to_s =~ /\byes\b/i + +case ARGV.shift.to_s =~ /\bend\b/i ? :end : :start +when :start + print(minimize ? " " : "(") +when :end + print ")" unless minimize +end diff --git a/bundles/ruby.tmbundle/Support/lib/ruby_requires.rb b/bundles/ruby.tmbundle/Support/lib/ruby_requires.rb new file mode 100644 index 000000000..c589000a6 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/lib/ruby_requires.rb @@ -0,0 +1,26 @@ +#!/usr/bin/env ruby + +$: << "#{ENV['TM_SUPPORT_PATH']}/lib" if ENV.has_key?('TM_SUPPORT_PATH') +require "escape" + +module RubyRequires + module_function + + def build_requires( code, libs ) + libs.reject { |lib| code =~ /require\s*(['"])#{lib}\1/ }. + map { |lib| "require \"#{lib}\"\n" }.join + end + + def place_requires( code, new_reqs ) + return code unless new_reqs =~ /\S/ + + code.dup.sub!(/(?:^[ \t]*require\s*(['"]).+?\1.*\n)+/, "\\&#{new_reqs}") || + code.sub(/\A(?:\s*(?:#.*)?\n)*/, "\\&#{new_reqs}\n") + end + + def add_requires( code, reqs ) + new_reqs = build_requires(code, reqs) + code = place_requires(code, new_reqs) + e_sn(code) + end +end diff --git a/bundles/ruby.tmbundle/Support/vendor/README b/bundles/ruby.tmbundle/Support/vendor/README new file mode 100644 index 000000000..8f9654a7c --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/README @@ -0,0 +1,3 @@ +Please remember that anything in this directory has a license of its own. + +These projects need to be chosen carefully, after ensuring that there license allows them to be bundled with TextMate, and all changes must comply with the project license. diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/CHANGES b/bundles/ruby.tmbundle/Support/vendor/rcodetools/CHANGES new file mode 100644 index 000000000..0b102fece --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/CHANGES @@ -0,0 +1,70 @@ +rcodetools history +================== +User-visible changes since 0.8.5 +-------------------------------- +* Fix DATA and __END__ handling in xmpfilter --tempfile (windows) + +User-visible changes since 0.8.4 +-------------------------------- +* OOPS, added missing files. + +User-visible changes since 0.8.0 +-------------------------------- +* xmpfilter: fixed multi-line annotation bugs + +User-visible changes since 0.7.0 +-------------------------------- +* Support Ruby 1.9! +* xmpfilter: multi-line annotation +* xmpfilter --expectations generates expectations by Jay Fields +* anything-rcodetools.el: new elisp +* --tmpfile, --tempfile: use temporary file instead of open3 on un*x +* rcodetools.el: smarter xmpfilter-command +* rcodetools.el: rct-fork interface +* rct-fork: require 'rubygems' initially +* rct-fork: more stable + +User-visible changes since 0.5.0 +-------------------------------- +* "test-driven completion" (TDC) support for Emacs and vim (see README.TDC) +* --test (-t), --filename options for rct-complete and rct-doc, allowing to + specify the test to be run for 100% accurate completion/documentation in the + corresponding implementation +* ruby-toggle-file: finds the test file corresponding to a given + implementation and vice versa +* rct-fork, rct-fork-client: allow to eliminate the overhead due to library + loading (esp. useful for Rails) +* rbtest: executes unit tests in a single Ruby script +* --fork, --rbtest, --detect-rbtest supported by several commands +* xmpfilter's --spec now autodetects the RSpec version and generates + specifications with the appropriate syntax + +User-visible changes since 0.4.1 +-------------------------------- +* --dev: adds project directories to $: +* --completion-class-info: list completion candidates and class info +* display completion candidates with description, both in emacs + and vim (using the menu+preview window). + +User-visible changes since 0.4.0 +-------------------------------- +* rct-meth-args: implemented -I +* many bug fixes + +xmpfilter was integrated into rcodetools as of 0.4.0. + +xmpfilter history +================= +User-visible changes since 0.3.1 (2006-10-17) +* implemented --debug +* --[no]-warnings +* --cd working_dir +* --rails +* --no-poetry +* more intelligent assertions: try to find which local variables hold the + values compared against in assertions/expectations +* editor-independent completion (-C, --completion-emacs, --completion-vim) +* quick method/class reference with -D (--refe, --ri*) + +User-visible changes since 0.3.0 (2006-10-16) +* xmpfilter.rb --spec works on win32 too diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/README b/bundles/ruby.tmbundle/Support/vendor/rcodetools/README new file mode 100644 index 000000000..036373fc4 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/README @@ -0,0 +1,98 @@ + + rcodetools http://eigenclass.org/hiki.rb?rcodetools + Copyright (c) 2005-2007 Mauricio Fernandez http://eigenclass.org + Copyright (c) 2006-2008 rubikitch http://www.rubyist.net/~rubikitch/ +Use and distribution subject to the terms of the Ruby license. + += Overview +rcodetools is a collection of Ruby code manipulation tools. +It includes xmpfilter and editor-independent Ruby development helper tools, +as well as emacs and vim interfaces. + +Currently, rcodetools comprises: +* xmpfilter: Automagic Test::Unit assertions/RSpec expectations and code annotations +* rct-complete: Accurate method/class/constant etc. completions +* rct-doc: Document browsing and code navigator +* rct-meth-args: Precise method info (meta-prog. aware) and TAGS generation +* rct-fork: Pre-load heavy library(Rails etc) and speed up rct-complete/rct-doc (server) +* rct-fork-client: Run Ruby programs from state the rct-fork server has +* ruby-toggle-file: Toggle implementation file and test file +* rbtest: Embedded Test::Unit for small scripts + +See also README.xmpfilter. + +Originally rct-complete and rct-doc were subcommands of xmpfilter. +Actually they use xmpfilter's code heavily. +But the relationship between xmpfilter (annotation) and completion/doc is not +intuitive, so I (rubikitch) split it into separate executables. + += Usage +xmpfilter, rct-complete and rct-doc take its input from stdin and write to +stdout. They can run in several modes; see + xmpfilter -h + rct-complete -h + rct-doc -h + rct-meth-args -h + rct-fork -h + rct-fork-client -h + ruby-toggle-file -h + rbtest -h +README.emacs and README.vim describe how to use rcodetools from your editor. + += Accurate Completion Internal and Caveat +rct-complete and rct-doc use xmpfilter engine, ie they get runtime information by executing code. +In Ruby (dynamic languages), type of any expressions except literals cannot be known without actually executing code. +Moreover Ruby has open classes and singleton methods. +Rcodetools asks `ruby' run-time informations, so we can get very accurate informations. +Completion and document browsing are essentially identical operations, +they both need the object value in question. +Therefore we discuss completion. + +rct-complete does: +(1) replaces target line with completion magic + (it calculates methods the target object has). +(2) executes modified script. +(3) once the control reaches completion magic, modified script exits. +(4) outputs in specified format. (list candidates, EmacsLisp...) + +But this methodology has two big drawbacks, side-effects and inability to get any informations of uncovered code! + +An extreme side-effect example: + File.unlink a_file + File. <- + +If you call rct-complete, it removes a_file (sends a mail, accesses DB ...). +So you must be careful to use, especially at TOPLEVEL. +I (rubikitch) often experiment at TOPLEVEL with rcodetools, I NEVER use irb(sh) since rcodetools! + +An uncovered code example: + def foo + 1. <- + end + +If the code does not call foo, we cannot do any completions. + +Useless eh? But we already have a way to elude the drawbacks, test scripts (unit tests)! +Test scripts are self-enclosed and expected to be executed, so side-effects are not problem. +Moreover tests call methods we write. +Because Ruby's Test::Unit has an ability to test only one test method, we can do lightning-fast completion. +Let's call it Test-Driven Completion (TDC). + +To support TDC, rct-complete has -t option. +With -t, it concatenate modified script and test/unit code. +If the control does not reach target line, test/unit code calls the line. + +How do we select test script and test method? +The editor selects recently selected buffer of test script as test script of TDC, +because the test-infected tend to go and return between test script and implementation script. +It considers files matching /test.*\.rb/ as test script. +It selects test method at the cursor position. + +TDC adds roles of test scripts. +Enjoy TDC magic! + +See also README.TDC. + + += License +rcodetools is licensed under the same terms as Ruby. diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/README.TDC b/bundles/ruby.tmbundle/Support/vendor/rcodetools/README.TDC new file mode 100644 index 000000000..5a413dab0 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/README.TDC @@ -0,0 +1,158 @@ + += Overview + +Ruby is very dynamic language, therefore it is impossible to do +accurate completion without executing script. While executing script +from start to cursor point is often dangerous, executing unit test +script covering current point is SAFE. I call this methodology +`Test-Driven Completion' (TDC). + +As I have already stated in README, browsing documentation of method +(rct-doc) is almost identical operation to completion. This +discussion is applicable to rct-doc. + += Why TDD Is Needed + +In the following code snippet: + + File.unlink a_file + File. <- + +If you complete after `File.', rct-complete actually deletes a_file. +Normally it is unpleasant. +In real-life development, side-effect is inevitable. + +In the foo method which are not called: + + def foo + 1. <- + end + +If the code does not call foo, rct-complete cannot do any completions. +Before TDC, if you want to do completion in methods, you have to write +method call and remove it after completion. Too useless!! + += Messianic Unit Test Script + +Recently Test-Driven Development (TDD) is widespread. Many developers +write unit tests. Fortunately Ruby's unit tester, Test::Unit, is +sophisticated enough to test one test method. Unit tests are +self-enclosed: they must tear down resources, so executing unit tests +are SAFE. TDC uses unit test to do completion. + += TDC Methodology + +(1) Switch to unit test script. +(2) Write a test for target method. +(3) Switch to implementation script. +(4) You can write target method WITH COMPLETION! +(5) Back to (1) + +TDC methodology is almost identical to TDD. TDC is very easy for TDDers. + += TDC With Example + +For simplicity, suppose that you are unfamiliar with Time class and +you want to write a method to format date string. + +The directory structure and file contents is following: + + /tmp/mylib0/ + /tmp/mylib0/lib/ + mylib0.rb + /tmp/mylib0/test/ + test_mylib0.rb + + List: mylib0.rb + # contrived example of long-runtime method + def mysleep(x) + sleep x + end + + def mytime(tm) + + end + + + List: test_mylib0.rb + require 'test/unit' + require 'mylib0' + class TestMylib0 < Test::Unit::TestCase + def test_0_mysleep + s = Time.now + mysleep 3.0 + e = Time.now + assert_in_delta 3.0, e-s, 0.01 + end + + def test_1_mytime + + end + end + +These sample files are in demo/ directory. + + +== Switch to unit test script. + +TDC starts with writing unit test as TDD does. +Open test_mylib0.rb. + +== Write a test for target method. + +Suppose that you want to write mytime method and test_1_mytime test +method, and that you want to experiment Time class first (before +forming an assertion). + +In TDC, you do not have to write an assertion first: just write only a +method call. If you are familiar with Time class, you are free to +write an assertion, of course. + + def test_1_mytime + mytime(Time.now) + end + +At this time, the cursor position is in test_1_mytime test method. + +== Switch to implementation script. + +Open mylib0.rb with the `ruby-toggle-file' script. For example, in Emacs use +the `ruby-toggle-buffer' command, and in vim the t (by default +\t) binding. Since in TDD/TDC you often switch between the test and the +implementation, it is much handier than typing the filename manually. + +The rct-complete uses latest-selected test script as TDC test script +and test method at cursor position as TDC test method. In this case, +test_mylib0.rb is TDC test script and test_1_mytime is TDC test +method. If the cursor position of test_mylib0.rb is at the top, +rct-complete executes whole test methods in test_mylib0.rb. Therefore +latency of completion is longer. + +== You can write target method WITH COMPLETION! + +Fill mytime method. + + def mytime(tm) + tm. + end + +Do completion after `tm.'. Here! Your editor is listing methods `tm' +accepts!! If your editor has help-on-candidate mechanism (eg. Emacs + +Icicles), you would see documentation of each listed method. + +Then you find `Time#strftime' method. Type `str' and do completion. + + def mytime(tm) + tm.strftime + end + +Usage is... use `rct-doc' (in Emacs, `rct-ri') after `strftime'. + +After you are familiar with Time class, switch to test script and write assertions. + += When Modifying Another Method + +If you want to modify already-written method, setting cursor position +of corresponding test script to corresponding test method is better. +It tells rct-complete new test script and test method, so you can do +completion in the new method. diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/README.emacs b/bundles/ruby.tmbundle/Support/vendor/rcodetools/README.emacs new file mode 100644 index 000000000..c3acff5d3 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/README.emacs @@ -0,0 +1,75 @@ + +rcodetools.el allows you to run rcodetools on a buffer. + +To eval the sexp, type C-e C-x C-e; `end-of-line' and `eval-last-sexp'. + +installation +============ + +If you use RI document feature, you must install ri-emacs first. + http://rubyforge.org/projects/ri-emacs/ + +If you feel RI and ri-emacs.rb startup is SLOW, you want to install FastRI. +FastRI offers ri-emacs compatible layer, so you can use it with ri-ruby.el. + http://eigenclass.org/hiki.rb?fastri + +Copy rcodetools.el to the appropriate directory, which is in load-path. +Then require it. + (require 'rcodetools) + +If you use icicles copy icicles-rcodetools.el too. +Then require it. + (require 'icicles-rcodetools) +It provides wonderful `help on candidate' feature, RI document on each candidate during completion. + +If you use anything.el copy anything-rcodetools.el too. +Then require it. + (require 'anything-rcodetools) +RI document on each candidate during completion. + +anything-show-completion.el shows selection (mehod) in buffer for completion. +It is available in: + http://www.emacswiki.org/cgi-bin/wiki/download/anything-show-completion.el + +I think anything-rcodetools is more convenient than icicles-rcodetools. +I'm addicted to anything! + http://www.emacswiki.org/cgi-bin/wiki/Anything + +xmpfilter on buffer +=================== + +# [EVAL IT] (describe-function 'xmp) + +If you want to add => marks, call comment-dwim twice. + +# [EVAL IT] (describe-function 'comment-dwim) + +method/class/constant completion +================================ + +# [EVAL IT] (describe-function 'rct-complete-symbol) + +If you use icicles-rcodetools or anything-rcodetools, you can browse RI document +for selected candidate by typing C-M-RET (icicles) or C-z (anything. +It is wonderful icicles and anything feature!! + +show RI document / jump to the definition +========================================= + +# [EVAL IT] (describe-function 'rct-ri) + +By default rct-ri asks for a TAGS file, which is generated by tag generator like rtags. +If there is a TAGS file, this command jumps to the definition of current method. +If use do not use this feature, evaluate: + (setq rct-find-tag-if-available nil) + +# [EVAL IT] (describe-variable 'rct-find-tag-if-available) + +speed-up xmpfilter and completion +================================= + +# [EVAL IT] (describe-function 'rct-fork) +# [EVAL IT] (describe-function 'rct-fork-kill) + +M-x rct-fork pre-loads heavy libraries (like rails). +You need not every time wait for loading them anymore! diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/README.ja b/bundles/ruby.tmbundle/Support/vendor/rcodetools/README.ja new file mode 100644 index 000000000..7a321169f --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/README.ja @@ -0,0 +1,84 @@ + + rcodetools http://eigenclass.org/hiki.rb?rcodetools + Copyright (c) 2005-2007 Mauricio Fernandez http://eigenclass.org + Copyright (c) 2006-2008 rubikitch http://www.rubyist.net/~rubikitch/ +Use and distribution subject to the terms of the Ruby license. + += +rcodetools Ruby Υɤ򰷤ġ뷲Ǥ +rcodetools ˤ xmpfilter ȥǥ˰¸ʤȯٱġ뤬ޤޤƤޤ +Emacs Vim Υ󥿡եѰդƤޤ + +* xmpfilter: Test::Unit assert* / RSpec should* ư +* rct-complete: ٥᥽å̾饹̾̾䴰 +* rct-doc: ɥȻȡɥʥӥ +* rct-meth-args: ٥᥽åɾꥹȡTAGS ե +* rct-fork: Rails Ť饤֥ͽɤ䴰®ʥС +* rct-fork-client: rct-fork Фݻ֤ Ruby ץȤ¹Ԥ +* ruby-toggle-file: ƥȥץȤȼץȤڤ괹 +* rbtest: ϥץȤΤ Test::Unit + + += Ȥ + +== +ͤɽԤ # => äޤ + + a, b = "foo", "baz" + a + b # => + a.size # => + +xmpfilter ̤ȲΤ褦˼ͤɽƤޤ + + a, b = "foo", "baz" + a + b # => "foobaz" + a.size # => 3 + + +== Test::Unit assert ʸ + +ǤˤǤäƤץΥƥȥץȤ񤯤ΤݤǤ͡ + + def test_insertion + @o.insert "bar" + @o.insert "baz" + @o.size # => + @o.last # => + @o.first # => + @o.complex_computation # => + @o.last(2) # => + end + +xmpfilter-u ץˤ֤ڸƤޤ + + def test_insertion + @o.insert "bar" + @o.insert "baz" + assert_equal(2, @o.size) + assert_equal("baz", @o.last) + assert_equal("bar", @o.first) + assert_in_delta(3.14159265358979, @o.complex_computation, 0.0001) + assert_equal(["baz", "bar"], @o.last(2)) + end + +RSpec ˤĤƤƱͤΤȤǤޤ-s ץ + +== 䴰ɥȻ + +ưˤ륹꡼󥷥åȤ򸫤Ƥ + +http://eigenclass.org/hiki.rb?rcodetools-screenshots + +== ܤȤ +-h ץĤȻѲǽʥץɽޤ + + xmpfilter -h + rct-complete -h + rct-doc -h + rct-meth-args -h + rct-fork -h + rct-fork-client -h + ruby-toggle-file -h + rbtest -h + +README.emacs README.vim ˥ǥǤλȤܤ񤤤Ƥޤ diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/README.method_analysis b/bundles/ruby.tmbundle/Support/vendor/rcodetools/README.method_analysis new file mode 100644 index 000000000..53a482d05 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/README.method_analysis @@ -0,0 +1,13 @@ + +method_analyzer.rb can be used to gather precise information about the exact +methods called in your code, allowing you to explore it better with rct-doc +(see README.emacs and README.vim for more information). This requires high +code coverage, since it can only record such data when the code is executed. + +rct-meth-args can be used to generate fairly complete TAGS files. It operates +by loading the specified files and tracking method definitions; therefore, it +is meta-programming aware, unlike other implementations. + +You can use them conveniently by adding the code shown in +Rakefile.method_analysis to your Rakefile. + diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/README.vim b/bundles/ruby.tmbundle/Support/vendor/rcodetools/README.vim new file mode 100644 index 000000000..ea7c7c59f --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/README.vim @@ -0,0 +1,111 @@ + +Copy rcodetools.vim to your plugin directory (typically $HOME/.vim/plugin) in +order to enable accurate code completion, quick RI execution and exact tag +jumping. + +Switching between implementation and test files +=============================================== +The t binding (by default \t) will call ruby-toggle-file to +switch from test to implementation and vice versa. Moreover, when you switch +from the test to the implementation, rcodetools will remember which test +you were editing (based on the cursor position), and call it as needed for +advanced code completion or precise RI documentation, as documented below. + +The actual binding can be changed in your .vimrc as follows: + let g:RCT_toggle_binding="" " use ^X^T to go test <=> implementation + +Code completion +=============== +rcodetools.vim redefines user-defined completion for Ruby programs, so you can +use the intelligent, 100%-accurate completion with in insert mode. +Note that this runs the code to obtain the exact candidate list. + +If you've set completeopt to menu,preview then rcodetools.vim can display +information about the completion candidates. The menu will show the synopsis +as given in the RI documentation, and the preview window will contain the full +RI documentation. + +This functionality relies on fri for quick lookups. It can be enabled by setting + + let g:rct_completion_use_fri = 1 " 0 by default (disabled) + +in your .vimrc (don't forget to run fastri-server too). +Obtaining the documentation for many candidates can be slow, so you can set +the threshold above which additional documentation will not be shown with + + " 20 by default, about a couple secs max wait on a normal machine + let g:rct_completion_info_max_len = 20 + +Quick RI documentation and exact tag jumping +============================================ +When you're editing a Ruby file, will jump to the definition of the +chosen element if found in the TAGS file; otherwise, it will call RI and show +the documentation in a new window. +You can specify the RI executable to use by adding something like + let g:RCT_ri_cmd = "ri -T -f plain " +to your .vimrc. (rcodetools.vim also honors b:RCT_RI_cmd and w:RCT_RI_cmd if set). +By default, "fri -f plain " will be used. fri (FastRI) is an improved RI +documentation browser, which features more intelligent search modes, gem +integration, vastly better performance... You can find it at +http://eigenclass.org/hiki.rb?fastri and it's also available in gem format +gem install fastri + +If you want to call RI for the word the cursor is on (instead of jumping to +the definition if found), you can use this binding: + r (\r by default if you haven't changed your localleader) +You can specify another binding in your .vimrc as follows: + let g:RCT_ri_binding="" " use ^X^R to call vim on current word + +Using xmpfilter +=============== +xmpfilter takes code from stdin and outputs to stdout so you can filter +your code with ! as usual. + +If you use xmpfilter often, you might want to use mappings like the +following, which allow you to: +* add annotations +* expand assertions +* insert/remove # => markers + + + +" plain annotations +map !xmpfilter -a +nmap V +imap a + +" Test::Unit assertions; use -s to generate RSpec expectations instead +map !xmpfilter -u +nmap V +imap a + +" Annotate the full buffer +" I actually prefer ggVG to %; it's a sort of poor man's visual bell +nmap mzggVG!xmpfilter -a'z +imap + +" assertions +nmap mzggVG!xmpfilter -u'z +imap a + +" Add # => markers +vmap !xmpfilter -m +nmap V +imap a + +" Remove # => markers +vmap ms:call RemoveRubyEval() +nmap V +imap a + + +function! RemoveRubyEval() range + let begv = a:firstline + let endv = a:lastline + normal Hmt + set lz + execute ":" . begv . "," . endv . 's/\s*# \(=>\|!!\).*$//e' + normal 'tzt`s + set nolz + redraw +endfunction diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/README.xmpfilter b/bundles/ruby.tmbundle/Support/vendor/rcodetools/README.xmpfilter new file mode 100644 index 000000000..1ea49dcb9 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/README.xmpfilter @@ -0,0 +1,287 @@ + +xmpfilter http://eigenclass.org/hiki.rb?xmpfilter +Copyright (c) 2005-2008 Mauricio Fernandez http://eigenclass.org + rubikitch +Use and distribution subject to the terms of the Ruby license. + +Overview +======== +xmpfilter is a small tool that can be used to +* generate Test::Unit assertions, RSpec expectations and + expectations blocks semi-automatically +* annotate source code with intermediate results (a bit like irb + --simple-prompt but only for the lines explicitly marked with # =>) + Very useful for example code (such as postings to ruby-talk). + +Usage +===== +xmpfilter takes its input from stdin and writes to stdout. It can run in +several modes (annotation, Test::Unit assertion expansion, RSpec expectation +generation, expectations expectations generation, marker insertion); see + xmpfilter -h +README.emacs and README.vim describe how to use xmpfilter from your editor. + +Example: code annotation +======================== +Just add "# =>" markers to the lines whose values you want to be shown: + + a, b = "foo", "baz" + a + b # => + a.size # => + +will be expanded to (in one keypress in a decent editor, see README.emacs and +README.vim) + + a, b = "foo", "baz" + a + b # => "foobaz" + a.size # => 3 + +This saves much cut&pasting when you're posting to ruby-list/ruby-talk/ruby-core +(We use it all the time). + + +Example: multi-line code annotation +=================================== +Just add "# =>" markers to the next lines whose values you want to be shown with pp: + +a = ["1111111111111111111111111111111111111111111111111111", 123334324234242342, + 1332333333,6,8 ] +1 # => +a +# => + +will be expanded to (in one keypress in a decent editor, see README.emacs and +README.vim) + +a = ["1111111111111111111111111111111111111111111111111111", 123334324234242342, + 1332333333,6,8 ] +1 # => 1 +a +# => ["1111111111111111111111111111111111111111111111111111", +# 123334324234242342, +# 1332333333, +# 6, +# 8] + + +Example: assertion generation +============================= + +xmpfilter can generate assertions based on the current behavior of the code +to be tested (iow. the current behavior is assumed to be correct and is used +to generate assertions which won't be modified by further runs of +xmpfilter), making it quite useful for regression testing. + +Imagine you have a ComplexClass you want to test. You might start with + + class TestComplexClass < Test::Unit::TestCase + def setup; @o = ComplexClass.new("foo", false) end + end + +and then want to add some tests: + + def test_insertion + @o.insert "bar" + @o.insert "baz" + # ... assertions here + end + +At this point, you want to add several assertions to verify that the values +returned by @o.size, @o.last, @o.first, @o.complex_computation and @o.last(2) +are correct. You can just write the following and feed the file to +xmpfilter in -u mode (the # => markers can also be inserted by +xmpfilter, see README.vim for more information: + + def test_insertion + @o.insert "bar" + @o.insert "baz" + @o.size # => + @o.last # => + @o.first # => + @o.complex_computation # => + @o.last(2) # => + end + +xmpfilter will run the test and remember what happened in each marked line, +and then rewrite the code so that it looks for instance like + + def test_insertion + @o.insert "bar" + @o.insert "baz" + assert_equal(2, @o.size) + assert_equal("baz", @o.last) + assert_equal("bar", @o.first) + assert_in_delta(3.14159265358979, @o.complex_computation, 0.0001) + assert_equal(["baz", "bar"], @o.last(2)) + end + +As you can see, it can save some typing. + +You can edit the generated assertions as you want: xmpfilter will not +modify lines without the "# =>" marker. xmpfilter can be used repeatedly as +you add more assertions. Imagine you want to verify that @o.last(3) raises an +ArgumentError. You can simply add one line marked with # => : + + ... + assert_in_delta(3.14159265358979, @o.complex_computation, 0.0001) + assert_equal(["baz", "bar"], @o.last(2)) + @o.last(3) # => + end + +and have it expanded by xmpfilter: + + ... + assert_in_delta(3.14159265358979, @o.complex_computation, 0.0001) + assert_equal(["baz", "bar"], @o.last(2)) + assert_raise(ArgumentError){ @o.last(3) } + end + + +Example: RSpec expectations +=========================== +Here's some code before and after filtering it with xmpfilter: + + class X + Y = Struct.new(:a) + def foo(b); b ? Y.new(2) : 2 end + def bar; raise "No good" end + def baz; nil end + def fubar(x); x ** 2.0 + 1 end + def babar; [1,2] end + A = 1 + A = 1 + end + + context "Testing xmpfilter's expectation expansion" do + setup do + @o = X.new + end + + specify "Should expand should_equal expectations" do + @o.foo(true) # => + @o.foo(true).a # => + @o.foo(false) # => + end + + specify "Should expand should_raise expectations" do + @o.bar # => + end + + specify "Should expand should_be_nil expectations" do + @o.baz # => + end + + specify "Should expand correct expectations for complex values" do + @o.babar # => + end + + specify "Should expand should_be_close expectations" do + @o.fubar(10) # => + end + end + + +after piping it to xmpfilter -s: + + class X + Y = Struct.new(:a) + def foo(b); b ? Y.new(2) : 2 end + def bar; raise "No good" end + def baz; nil end + def fubar(x); x ** 2.0 + 1 end + def babar; [1,2] end + A = 1 + A = 1 # !> already initialized constant A + end + + context "Testing xmpfilter's expectation expansion" do + setup do + @o = X.new + end + + specify "Should expand should_equal expectations" do + (@o.foo(true)).should_be_a_kind_of X::Y + (@o.foo(true).inspect).should_equal "#" + (@o.foo(true).a).should_equal 2 + (@o.foo(false)).should_equal 2 + end + + specify "Should expand should_raise expectations" do + lambda{(@o.bar)}.should_raise RuntimeError + end + + specify "Should expand should_be_nil expectations" do + (@o.baz).should_be_nil + end + + specify "Should expand correct expectations for complex values" do + (@o.babar).should_equal [1, 2] + end + + specify "Should expand should_be_close expectations" do + (@o.fubar(10)).should_be_close(101.0, 0.0001) + end + end + + +Example: expectations expectations +================================== +Expectations is a light-weight unit testing framework by Jay Fields. +(http://expectations.rubyforge.org) + +Here's some code before and after filtering it with xmpfilter: + + require 'rubygems' + require 'expectations' + + S = Struct.new :a + Expectations do + 1 + 1 # => + "a".length # => + [][1] # => + 1.hoge # => + 1.1 + 1.0 # => + S.new(1) # => + end + +after piping it to xmpfilter --expectations: + + require 'rubygems' + require 'expectations' + + S = Struct.new :a + Expectations do + expect 2 do + 1 + 1 + end + + expect 1 do + "a".length + end + + expect nil do + [][1] + end + + expect NoMethodError do + 1.hoge + end + + expect 2.0999..2.1001 do + 1.1 + 1.0 + end + + expect S do + S.new(1) + end + + expect "#" do + S.new(1).inspect + end + + end + + +License +======= +xmpfilter is licensed under the same terms as Ruby. diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/Rakefile b/bundles/ruby.tmbundle/Support/vendor/rcodetools/Rakefile new file mode 100644 index 000000000..7d2c227f8 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/Rakefile @@ -0,0 +1,121 @@ + +PKG_REVISION = ".0" + +$:.unshift "lib" if File.directory? "lib" +require 'rcodetools/xmpfilter' +require 'rake/testtask' +include Rcodetools +RCT_VERSION = XMPFilter::VERSION + +desc "Run the unit tests in pure-Ruby mode ." +Rake::TestTask.new(:test) do |t| + t.test_files = FileList['test/test*.rb'] + t.verbose = true +end + +begin + require 'rcov/rcovtask' + desc "Run rcov." + Rcov::RcovTask.new do |t| + t.rcov_opts << "--xrefs" # comment to disable cross-references + t.test_files = FileList['test/test_*.rb'].to_a - ["test/test_functional.rb"] + t.verbose = true + end + + desc "Save current coverage state for later comparisons." + Rcov::RcovTask.new(:rcovsave) do |t| + t.rcov_opts << "--save" + t.test_files = FileList['test/test_*.rb'].to_a - ["test/test_functional.rb"] + t.verbose = true + end +rescue LoadError + # rcov is not installed +end +task :default => :test + + +#{{{ Package tasks +PKG_FILES = FileList[ + "bin/xmpfilter", "bin/rct-*", "bin/ruby-toggle-file", "bin/rbtest", +"lib/**/*.rb", +"CHANGES", "rcodetools.*", "icicles-rcodetools.el", "anything-rcodetools.el", +"README", "README.*", "THANKS", +"Rakefile", "Rakefile.method_analysis", +"setup.rb", +"test/**/*.rb","test/**/*.taf" +] + +begin + require 'rake/gempackagetask' + Spec = Gem::Specification.new do |s| + s.name = "rcodetools" + s.version = RCT_VERSION + PKG_REVISION + s.summary = "rcodetools is a collection of Ruby code manipulation tools" + s.description = <, "Mauricio Fernandez" } + s.homepage = "http://eigenclass.org/hiki.rb?rcodetools" + s.bindir = "bin" + s.executables = %w[rct-complete rct-doc xmpfilter rct-meth-args] + s.has_rdoc = true + s.extra_rdoc_files = %w[README] + s.rdoc_options << "--main" << "README" << "--title" << 'rcodetools' + s.test_files = Dir["test/test_*.rb"] + s.post_install_message = < [:test] + Rake::GemPackageTask.new(Spec) do |p| + p.need_tar_gz = true + end + +rescue LoadError + # RubyGems not installed +end + +desc "install by setup.rb" +task :install do + sh "sudo ruby setup.rb install" +end + +desc "release in rubyforge (package is created)" +task :release_only do + sh "rubyforge login" + sh "rubyforge add_release rcodetools rcodetools #{RCT_VERSION} pkg/rcodetools-#{RCT_VERSION}.0.tar.gz " + sh "rubyforge add_file rcodetools rcodetools #{RCT_VERSION} pkg/rcodetools-#{RCT_VERSION}.0.gem " +end + +desc "release in rubyforge" +task :release => [:package, :release_only] + +# vim: set sw=2 ft=ruby: diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/Rakefile.method_analysis b/bundles/ruby.tmbundle/Support/vendor/rcodetools/Rakefile.method_analysis new file mode 100644 index 000000000..1dc8e0414 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/Rakefile.method_analysis @@ -0,0 +1,30 @@ + +# Rake tasks to generate TAGS and gather method analysis information. +# See README.method_analysis for more information. + +## my standard Rakefile +task :tags => "TAGS" + +desc "Generate method_analysis by ruby -rmethod_analyzer." +task :analyze => [:_prepare_method_analyze, :tags] do + at_exit { sh "ls -l method_analysis" } +end + +task :_prepare_method_analyze do + ENV['METHOD_ANALYZER_FORMAT']="marshal" + sh "rm -f method_analysis" + puts "generating method_analysis" +end + +## application-specific Rakefile (RTtool) +task :analyze do + sh "ruby -Ilib -rmethod_analyzer test/test.rb" + sh "ruby -Ilib -rmethod_analyzer test/test-rt2html-lib.rb" + sh "ruby -Ilib -rmethod_analyzer test/test-rtparser.rb" +end + +file "TAGS" => FileList["lib/rt/*.rb"] do + sh "rct-meth-args -t lib/rt/*.rb > TAGS" +end + + diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/THANKS b/bundles/ruby.tmbundle/Support/vendor/rcodetools/THANKS new file mode 100644 index 000000000..0ed1e3763 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/THANKS @@ -0,0 +1,11 @@ +Some names forgotten, tell me if you care :) -- mfp + +rubikitch +* expanded xmp3.rb (a previous version of xmpfilter.rb) to support RSpec expectations +* wrote the elisp magic to use xmpfilter.rb with emacs +* made the 100% accurate, editor-independent completion system +[rubikitch took xmpfilter and turned it into the much more powerful +rcodetools, so there are way too many things to list them here :)] + +Adagios +* found & fixed problem with rcodetools.vim plugin on win32 diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/anything-rcodetools.el b/bundles/ruby.tmbundle/Support/vendor/rcodetools/anything-rcodetools.el new file mode 100644 index 000000000..e21a743de --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/anything-rcodetools.el @@ -0,0 +1,151 @@ +;;; anything-rcodetools.el --- accurate Ruby method completion with anything +;; $Id: anything-rcodetools.el,v 1.13 2009/04/20 16:25:37 rubikitch Exp $ + +;;; Copyright (c) 2007 rubikitch + +;; Author: rubikitch +;; URL: http://www.emacswiki.org/cgi-bin/wiki/download/anything-rcodetools.el + +;;; Use and distribution subject to the terms of the Ruby license. + +;;; Commentary: + +;; (0) You need rcodetools, anything.el and FastRI. Note that you do not have to +;; configure anything.el if you use anything.el for this package. +;; (1) You need to add to .emacs: +;; (require 'anything) +;; (require 'anything-rcodetools) +;; ;; Command to get all RI entries. +;; (setq rct-get-all-methods-command "PAGER=cat fri -l") +;; ;; See docs +;; (define-key anything-map "\C-z" 'anything-execute-persistent-action) + +;;; Commands: +;; +;; Below are complete command list: +;; +;; +;;; Customizable Options: +;; +;; Below are customizable option list: +;; + +;;; History: + +;; $Log: anything-rcodetools.el,v $ +;; Revision 1.13 2009/04/20 16:25:37 rubikitch +;; Set anything-samewindow to nil +;; +;; Revision 1.12 2009/04/18 10:12:02 rubikitch +;; Adjust to change of `use-anything-show-completion' +;; +;; Revision 1.11 2009/04/17 20:21:47 rubikitch +;; * require anything +;; * require anything-show-completion.el if available +;; +;; Revision 1.10 2009/04/17 20:11:03 rubikitch +;; removed old code +;; +;; Revision 1.9 2009/04/17 20:07:52 rubikitch +;; * use --completion-emacs-anything option +;; * New implementation of `anything-c-source-complete-ruby-all' +;; +;; Revision 1.8 2009/04/15 10:25:25 rubikitch +;; Set `anything-execute-action-at-once-if-one' t +;; +;; Revision 1.7 2009/04/15 10:24:23 rubikitch +;; regexp bug fix +;; +;; Revision 1.6 2008/01/14 17:59:34 rubikitch +;; * uniform format (anything-c-source-complete-ruby, anything-c-source-complete-ruby-all) +;; * rename command: anything-c-ri -> anything-rct-ri +;; +;; Revision 1.5 2008/01/13 17:54:04 rubikitch +;; anything-current-buffer advice. +;; +;; Revision 1.4 2008/01/08 14:47:34 rubikitch +;; Added (require 'rcodetools). +;; Revised commentary. +;; +;; Revision 1.3 2008/01/04 09:32:29 rubikitch +;; *** empty log message *** +;; +;; Revision 1.2 2008/01/04 09:21:23 rubikitch +;; fixed typo +;; +;; Revision 1.1 2008/01/04 09:21:05 rubikitch +;; Initial revision +;; + +;;; Code: + +(require 'anything) +(require 'rcodetools) +(when (require 'anything-show-completion nil t) + (use-anything-show-completion 'rct-complete-symbol--anything + '(length pattern))) + +(defun anything-rct-ri (meth) + (ri (get-text-property 0 'desc meth))) + +(defun anything-rct-complete (meth) + (save-excursion + (set-buffer anything-current-buffer) + (search-backward pattern) + (delete-char (length pattern))) + (insert meth)) + +(setq rct-complete-symbol-function 'rct-complete-symbol--anything) +(defvar anything-c-source-complete-ruby + '((name . "Ruby Method Completion") + (candidates . rct-method-completion-table) + (init + . (lambda () + (condition-case x + (rct-exec-and-eval rct-complete-command-name "--completion-emacs-anything") + ((error) (setq rct-method-completion-table nil))))) + (action + ("Completion" . anything-rct-complete) + ("RI" . anything-rct-ri)) + (volatile) + (persistent-action . anything-rct-ri))) + +(defvar rct-get-all-methods-command "PAGER=cat fri -l") +(defvar anything-c-source-complete-ruby-all + '((name . "Ruby Method Completion (ALL)") + (init + . (lambda () + (unless (anything-candidate-buffer) + (with-current-buffer (anything-candidate-buffer 'global) + (call-process-shell-command rct-get-all-methods-command nil t) + (goto-char 1) + (while (re-search-forward "^.+[:#.]\\([^:#.]+\\)$" nil t) + (replace-match "\\1\t[\\&]")))))) + (candidates-in-buffer + . (lambda () + (let ((anything-pattern (format "^%s.*%s" (regexp-quote pattern) anything-pattern))) + (anything-candidates-in-buffer)))) + (display-to-real + . (lambda (line) + (if (string-match "\t\\[\\(.+\\)\\]$" line) + (propertize (substring line 0 (match-beginning 0)) + 'desc (match-string 1 line)) + line))) + (action + ("Completion" . anything-rct-complete) + ("RI" . anything-rct-ri)) + (persistent-action . anything-rct-ri))) + + +(defun rct-complete-symbol--anything () + (interactive) + (let ((anything-execute-action-at-once-if-one t) + anything-samewindow) + (anything '(anything-c-source-complete-ruby + anything-c-source-complete-ruby-all)))) + +(provide 'anything-rcodetools) + +;; How to save (DO NOT REMOVE!!) +;; (emacswiki-post "anything-rcodetools.el") +;;; install-elisp.el ends here diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/bin/rbtest b/bundles/ruby.tmbundle/Support/vendor/rcodetools/bin/rbtest new file mode 100755 index 000000000..ab51c9425 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/bin/rbtest @@ -0,0 +1,266 @@ +#! /usr/local/bin/ruby18 +# Copyright (c) 2006-2007 rubikitch +# +# Use and distribution subject to the terms of the Ruby license. + +USAGE = <<'XXX' +Usage: rbtest SCRIPT [-S RUBY_INTERPRETER] [Test::Unit OPTIONS] +Usage: rbtest [-h] [--help] [--example] + +I am rbtest, embedded Test::Unit executor for one-file scripts. +Splitting a small script into many files (executables, libraries and tests) is cumbersome. +And it is handy to put unit tests near implementations like D language, which has +built-in unittest keyword. + +Embedded Test::Unit is simpler than vanilla Test::Unit. +You do not have to define a Test::Unit::TestCase subclass, +it is automagically defined and executed by me. +Embedded Test::Unit uses =begin/=end comment blocks. + +"=begin TEST_METHOD_NAME" blocks define test methods, eg. "=begin test_foo". +"=begin rbtest" blocks define utility methods and setup/teardown methods. + +Of course, you MUST use "if __FILE__ ==$0" idiom to split executable and class/method/function. + +I am also an real-life example of rbtest usage. +Issue: + rbtest --example +to show me. + + +options: + -h, --help Print usage. + -S RUBY_INTERPRETER Use Ruby interpreter RUBY_INTERPRETER. + --example Print this file. + --output Print internally-generated test script (for debug). +XXX + + +def first_test(script_filename) + "require 'test/unit';" + + "load '#{script_filename}';" + + "class TestByRbtest < Test::Unit::TestCase;" +end + +=begin rbtest +def setup +end + +def unindent(s) + s.lines.map{|x| x[1..-1]}.join +end +=end + +=begin test_script_to_test_script +# indent is needed to avoid syntax error. +script = < http://eigenclass.org +# 2006-2007 rubikitch http://www.rubyist.net/~rubikitch/ +# +# Use and distribution subject to the same conditions as Ruby. + +require 'rcodetools/options' +include Rcodetools +$VERBOSE = nil +$__method_args_off = true + +if ARGV.empty? or ARGV.include? '-h' or ARGV.include? '--help' + puts < [ ...] + +-Idirectory specify $LOAD_PATH directory (same as ruby) +--dev Add this project's bin/ and lib/ to $LOAD_PATH. + A directory that has Rakefile is considered as project base direcotry. +-i omit instance methods defined in classes +-m omit instance methods defined in modules +-c omit class methods + +-n print the filename and line number with output lines +-t generate TAGS output +--summarize summary output sorted by method name + +The given files will be #require()d in order. +Examples: + rct-meth-args complex + rct-meth-args thread + rct-meth-args -c rubygems +EOF + exit # ' +end + +def debugprint(*args) + $stderr.puts(*args) if $DEBUG +end + +module MethodArgs + MAX_ARGS = 20 + + private + def needed_args(arity) + arity >= 0 ? arity : arity.abs - 1 + end + + def with_tracer + begin + set_trace_func @__trace_func + yield + ensure + set_trace_func nil + end + end + + module LineContents + # usage: Contents[filename][lineno] + Contents = Hash.new{ |h,k| + sum = 0 + # Unshift is needed because lineno starts with 1. + h[k] = File.readlines(k).map{ |line| [line.chomp, sum+=line.length] }.unshift nil + } + def content + Contents[filename][lineno.to_i][0] rescue "" + end + + def byte + Contents[filename][lineno.to_i-1][1] rescue 0 + end + + def arg_desc + # TODO + desc = content[ /\((.+)\)/] + desc.gsub!(/(\S),(\S)/, '\1, \2') + desc.gsub!(/(\S)=(\S)/, '\1 = \2') + desc + end + + FileNameCache = Hash.new{ |h,k| h[k] = File.expand_path(k) } + def full_filename + FileNameCache[filename] + end + end + + class Location < Struct.new(:filename, :lineno) + include LineContents + end + + class Printer + def method_info(io, x) + prefix = x[:location] ? "#{x[:location].filename}:#{x[:location].lineno}:" : "" + io.puts "#{prefix}#{x[:fullname]}#{x[:arg_desc]}" unless x[:klass].to_s == "" + end + + def included_location(io, x) + x[:callsite] and io.print "#{x[:callsite].filename}:#{x[:callsite].lineno}:" + io.puts([ x[:comment], x[:mod], x[:flag], x[:self] ].join(" ")) + end + end + + class SummarizePrinter + def initialize + @hash = Hash.new + at_exit { print_result } + end + + def method_info(io, x) + @io = io + prefix = x[:location] ? "#{x[:location].filename}:#{x[:location].lineno}:" : "" + (@hash[x[:meth]]||=[]) << "#{prefix}#{x[:fullname]}#{x[:arg_desc]}" unless x[:klass].to_s == "" + end + + def included_location(io, x) + # not implemented + end + + def print_result + @hash.keys.sort.each do |meth| + @io.puts meth + @hash[meth].each do |line| + @io.puts line + end + @io.puts + end + end + end + + class TagsPrinter + def initialize + @previous_filename = "" + end + + def output_filename(filename) + if @previous_filename != filename + @previous_filename = filename + puts "\cl" + puts "#{filename},0" + end + end + + def method_info(io, x) + return unless x[:location] + output_filename x[:location].full_filename + io.puts "#{x[:location].content}::#{x[:fullname]}#{x[:location].lineno},#{x[:location].byte}" + end + + def included_location(io, x) + return unless x[:callsite] + output_filename x[:callsite].full_filename + io.puts "#{x[:callsite].content}::#{x[:mod]}#{x[:callsite].lineno},#{x[:callsite].byte}" + end + end + + def _print_method_info(klass, is_singleton, meth, arg_desc=nil, location=nil, with_location=$__with_location, printer=$__printer) + arg_desc ||= "(...)" + arg_desc = " " + arg_desc unless arg_desc.empty? + flag = is_singleton ? "." : "#" + x = { :arg_desc => arg_desc, :klass => klass, + :meth => meth.to_s, + :fullname => [klass, flag, meth].join, + :location => with_location && location, + } + printer.method_info $>, x + end + + def output_attr_info(klass, object, meth, is_singleton, location) + arg_desc = meth.to_s =~ /=$/ ? "(value)" : "" + _print_method_info klass, is_singleton, meth, arg_desc, location + end + + def output_method_info(klass, object, meth, is_singleton = false, by_attr = nil, by_define_method = nil) + return if $__method_args_off + file = line = params = values = nil + location = nil + begin + unless %w[initialize].include?(meth.to_s) + if is_singleton + return if class << klass; private_instance_methods(true) end.include?(meth.to_s) + else + return if class << object; private_instance_methods(true) end.include?(meth.to_s) + end + end + rescue TypeError # no virtual class + end + + arity = is_singleton ? object.method(meth).arity : klass.instance_method(meth).arity + @__trace_func = lambda{|event, file, line, id, binding, classname| + begin + debugprint "!EVENT: #{event} #{classname}##{id}, #{file} #{line}" + debugprint "(#{self} #{meth})" + if event[/call/] && classname == self && id == meth + location = Location.new(file, line) if event == 'call' + debugprint "EVENT: #{event} #{classname}##{id}" + throw :done + end + rescue Exception + nil # rcov workaround + end + } + if by_define_method + _print_method_info klass, is_singleton, meth, nil, by_define_method + return + end + + if by_attr + output_attr_info klass, object, meth, is_singleton, by_attr + return + end + + catch(:done) do + begin + with_tracer { object.send(meth, *(0...needed_args(arity))) } + rescue Exception + nil # rcov workaround + end + end + + arg_desc = location.arg_desc + + _print_method_info klass, is_singleton, meth, arg_desc, location + rescue Exception + debugprint "GOT EXCEPTION while processing #{klass} #{meth}" + debugprint $!.class + debugprint $!.message + debugprint $!.backtrace + _print_method_info klass, is_singleton, meth, nil, location + ensure + set_trace_func(nil) + end +end + +class Object + include MethodArgs +end + +class Module + class CallSite # compatible with Location + include MethodArgs::LineContents + def initialize(caller_string) + @filename, @lineno, @in = caller_string.split(/:/) + end + attr_reader :filename, :lineno + end + + def _method_defined_with(ivar, caller, &block) + begin + instance_variable_set(ivar, caller) + yield + ensure + instance_variable_set(ivar, false) + end + end + + def with_attr(caller, &block) + _method_defined_with :@by_attr, caller, &block + end + + def with_define_method(caller, &block) + _method_defined_with :@by_define_method, caller, &block + end + + [ :attr, :attr_reader, :attr_writer, :attr_accessor ].each do |meth| + attr = instance_method(meth) + define_method(meth) do |*args| + with_attr(CallSite.new(caller(1)[0])){ attr.bind(self).call(*args) } + end + end + + alias :__define_method_orig :define_method + def define_method(*args, &body) + with_define_method(CallSite.new(caller(1)[0])){ __define_method_orig(*args, &body) } + end + +end + +new_args = [] +omissions = {} +$__with_location = false +$__printer = Printer.new +i_opt_p = false + +ARGV.each do |arg| + case arg + when "-n"; $__with_location = true + when "-t"; $__printer = TagsPrinter.new; $__with_location = true + when "--summarize"; $__printer = SummarizePrinter.new + when /-I(.+)$/; $:.unshift $1 + when "-I"; i_opt_p = true + when "--dev"; OptionHandler.auto_include_paths($:, Dir.pwd) + when /^-.$/; omissions[$&] = true + else + if i_opt_p + $:.unshift arg + i_opt_p = false + else + new_args << arg + end + end +end + +ARGV.replace new_args + +class Object + ALLOCATOR = Hash.new{|h,k| h[k] = k.allocate }.merge(Fixnum=>1, + Bignum=>10000000000000000, + Float=>1.1, + Symbol=>:method_args_tmp, + Binding=>binding, + UnboundMethod=>instance_method(:object_id), + Method=>method(:object_id), + Proc=>lambda{}, + Continuation=>callcc{|c|c}, + Thread=>Thread.new{}, + FalseClass=>false, + TrueClass=>true, + NilClass=>nil, + Struct=>Struct.new(:a).new(1)) + +# ABSTRACT_CLASSES = %w[Digest::Base ] + def self.method_added(meth) +# if ABSTRACT_CLASSES.include? self.to_s +# _print_method_info self, false, meth +# return +# end + begin + o = ALLOCATOR[self] + rescue Exception # for abstract classes + nil + end + output_method_info(self, o, meth, false, @by_attr, @by_define_method) + end +end unless omissions["-i"] + +class Module + method_added = instance_method(:method_added) + define_method(:method_added) do |meth| + begin + if instance_of? Module + o = Object.new + o.extend(self) + output_method_info(self, o, meth, false, @by_attr, @by_define_method) + end + method_added.bind(self).call(meth) + rescue Exception + _print_method_info self, false, meth + end + end +end unless omissions["-m"] + + +class Class + def singleton_method_added(meth) + by_attr = class << self; @by_attr; end + by_define_method = class << self; @by_define_method; end + output_method_info(self, self, meth, true, by_attr, by_define_method) + rescue Exception + _print_method_info self, true, meth + end +end unless omissions["-c"] + +#### include / extend +class Module + def _print_included_location(mod, caller_string, comment, flag, with_location=$__with_location, printer=$__printer) + if caller_string # nil when the class is defined by C + x = { :comment => comment, :mod => mod, :flag => flag, :self => self, + :callsite => with_location && CallSite.new(caller_string) + } + printer.included_location $>, x + end + end + + undef_method :included + def included(mod) + _print_included_location mod, caller(0)[1], "include", "<=" + end + + undef_method :extended + def extended(mod) + _print_included_location mod, caller(0)[1], "extend", "<-" if Module === mod + end +end + +#### inheritance +class Class + undef :inherited + def inherited(klass, caller_level=0) + _print_included_location klass, caller(caller_level)[1], "class", "<" unless self == Object + end +end + +#### Struct inspection +class << Struct + def to_s + orig = super + if orig =~ /" : "" + else + orig + end + end + + def inherited(klass) + if self == Struct + @inherited_delay = lambda{ super(klass, 3) } + else + super(klass, 1) + end + end + + @@struct_initializing = false + def method_added(meth) + super unless @@struct_initializing + end + + orig_new = instance_method(:new) + define_method(:new) do |*args| + begin + @@struct_initializing = true + orig_new.bind(self).call(*args) + ensure + @@struct_initializing = false + @inherited_delay[] + end + end + +end + +$__method_args_off = false + +ARGV.each{|x| + begin + require x + rescue LoadError + load x + end +} + +$__method_args_off = true +# END { puts "zzzz OK" } diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/bin/ruby-toggle-file b/bundles/ruby.tmbundle/Support/vendor/rcodetools/bin/ruby-toggle-file new file mode 100644 index 000000000..9adccc929 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/bin/ruby-toggle-file @@ -0,0 +1,26 @@ +#! /usr/local/bin/ruby18 +require 'ruby_toggle_file' +require 'optparse' + +USAGE = < markers.") do + klass = XMPAddMarkers + end + + opts.handle_interpreter options + + opts.separator "" + opts.separator "Specific options:" + opts.on("-l N", "--min-line-length N", Integer, "Align markers to N spaces.") do |min_codeline_size| + options[:min_codeline_size] = min_codeline_size + end + opts.on("--rails", "Setting appropriate for Rails.", + "(no warnings, find working directory,", + " Test::Unit assertions)") do + require 'rcodetools/xmptestunitfilter' + options[:warnings] = false + klass = XMPTestUnitFilter + rails_settings = true + end + opts.on("--[no-]poetry", "Whether to use extra parentheses.", + "(default: use them)") do |poetry_p| + options[:use_parentheses] = !poetry_p + end + opts.on("--[no-]warnings", "Whether to add warnings (# !>).", + "(default: enabled)") {|warnings_p| options[:warnings] = warnings_p } + opts.on("-q", "--quiet", "Supress standard output.") do + options[:output_stdout] = false + end + + opts.handle_misc options +end + +set_extra_opts options +opts.parse!(ARGV) + +if rails_settings && !options[:wd] + if File.exist? ARGF.path + options[:wd] = File.dirname(ARGF.path) + elsif File.exist? "test/unit" + options[:wd] = "test/unit" + elsif File.exist? "unit" + options[:wd] = "unit" + end +end +targetcode = ARGF.read +Dir.chdir options[:wd] if options[:wd] + +if XMPFilter.detect_rbtest(targetcode, options) + require 'rcodetools/xmptestunitfilter' + klass = XMPTestUnitFilter +end + +# Do the job. dispatched by klass. +puts klass.run(targetcode, options) diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/icicles-rcodetools.el b/bundles/ruby.tmbundle/Support/vendor/rcodetools/icicles-rcodetools.el new file mode 100644 index 000000000..a6de2ca6e --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/icicles-rcodetools.el @@ -0,0 +1,35 @@ +;;; icicles-rcodetools.el -- accurate completion with icicles + +;;; Copyright (c) 2006-2007 rubikitch +;;; +;;; Use and distribution subject to the terms of the Ruby license. + +(require 'icicles) +(require 'rcodetools) + +(setq rct-complete-symbol-function 'rct-complete-symbol--icicles) +(icicle-define-command rct-complete-symbol--icicles + "Perform ruby method and class completion on the text around point with icicles. +C-M-RET shows RI documentation on each candidate. +See also `rct-interactive'." + + (lambda (result) + (save-excursion + (search-backward pattern) + (setq beg (point))) + (delete-region beg end) + (insert result)) ;/function + "rct-complete: " ;prompt + rct-method-completion-table + nil nil pattern nil nil nil + ((end (point)) beg + (icicle-list-join-string "\t") + (icicle-list-use-nth-parts '(1)) + (icicle-point-position-in-candidate 'input-end) + pattern klass alist + (icicle-candidate-help-fn + (lambda (result) + (ri (cdr (assoc result alist)))))) ;bindings + (rct-exec-and-eval rct-complete-command-name "--completion-emacs-icicles")) + +(provide 'icicles-rcodetools) diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/lib/method_analyzer.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/lib/method_analyzer.rb new file mode 100644 index 000000000..4f71cc274 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/lib/method_analyzer.rb @@ -0,0 +1,107 @@ +class Module + remove_method :attr_reader + def attr_reader(*names) + names.each do |name| + module_eval "def #{name}() @#{name} end" + end + end + remove_method :attr_writer + def attr_writer(*names) + names.each do |name| + module_eval "def #{name}=(x) @#{name}=x end" + end + end + remove_method :attr_accessor + def attr_accessor(*names) + attr_reader(*names) + attr_writer(*names) + end + remove_method :attr + def attr(name, writer=false) + attr_reader name + attr_writer name if writer + end +end + + +module MethodAnalyzer + @@methods = Hash.new{ |h,k| h[k] = Hash.new{ |h,k| h[k] = []} } + @@whereis = [] + @@expand_path = Hash.new{ |h,k| h[k] = File.expand_path(k)} + + def self.trace_func(event, file, line, id, binding, klass, *rest) + return if file == __FILE__ + return if (event != 'call' and event != 'c-call') + return if klass == Class and id == :inherited + return if klass == Module and id == :method_added + return if klass == Kernel and id == :singleton_method_added + saved_crit = Thread.critical + Thread.critical = true + + the_self = eval("self",binding) + flag = Class === the_self ? "." : "#" + #klass = klass == Kernel ? Object : klass + fullname = "#{klass}#{flag}#{id}" + file.replace @@expand_path[file] + if event == 'call' + @@whereis << [file, line, fullname] if file !~ /\(eval\)$/ + file, line, rest = caller(4)[0].split(/:/) + file.replace @@expand_path[file] # DRY + p caller(0) if $DEBUG + line = line.to_i + end + @@methods[file][line] << fullname if event =~ /call/ + + Thread.critical = saved_crit + end + + def self.at_exit__output_marshal + at_exit do + set_trace_func nil + dbfile = "method_analysis" + old = Marshal.load(File.read(dbfile)) rescue {} + open(dbfile, "wb") do |io| + # Because Marshal.dump cannot handle hashes with default_proc + @@methods.default = nil + @@methods.each_value{ |v| v.default=nil; v.each_value{ |vv| vv.uniq! } } + Marshal.dump(@@methods.merge(old), io) + end + end + end + + + def self.at_exit__output_text + at_exit do + set_trace_func nil + puts "method fullnames" + @@methods.sort.each do |file, lines| + lines.sort.each do |line, methods| + printf "%s:%s:%s\n", file, line, methods.uniq.join(" ") + end + end + + puts + puts "method definitions" + @@whereis.sort.uniq.each do |file, line, fullname | + printf "%s:%s:%s\n", file, line, fullname + end + + end + end + + def self.set_at_exit + case ENV['METHOD_ANALYZER_FORMAT'] + when 'marshal' + at_exit__output_marshal + else + at_exit__output_text + end + end + + set_at_exit + set_trace_func method(:trace_func).to_proc +end + +if __FILE__ == $0 + load "./test/data/method_analyzer-data.rb" +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/lib/rcodetools/compat.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/lib/rcodetools/compat.rb new file mode 100644 index 000000000..13e50832b --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/lib/rcodetools/compat.rb @@ -0,0 +1,14 @@ +if RUBY_VERSION >= "1.9" + class String + alias :each :each_line + include Enumerable + end + + module Enumerable + alias :enum_with_index :each_with_index + end + + class Array + alias :to_s :join + end +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/lib/rcodetools/completion.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/lib/rcodetools/completion.rb new file mode 100644 index 000000000..ccc936a3c --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/lib/rcodetools/completion.rb @@ -0,0 +1,406 @@ +# Nearly 100% accurate completion for any editors!! +# by rubikitch + +require 'rcodetools/xmpfilter' +require 'enumerator' + +module Rcodetools + +# Common routines for XMPCompletionFilter/XMPDocFilter +module ProcessParticularLine + def fill_literal!(expr) + [ "\"", "'", "`" ].each do |q| + expr.gsub!(/#{q}(.+)#{q}/){ '"' + "x"*$1.length + '"' } + end + expr.gsub!(/(%([wWqQxrs])?(\W))(.+?)\3/){ + percent = $2 == 'x' ? '%'+$3 : $1 # avoid executing shell command + percent + "x"*$4.length + $3 + } + [ %w[( )], %w[{ }], %w![ ]!, %w[< >] ].each do |b,e| + rb, re = [b,e].map{ |x| Regexp.quote(x)} + expr.gsub!(/(%([wWqQxrs])?(#{rb}))(.+)#{re}/){ + percent = $2 == 'x' ? '%'+$3 : $1 # avoid executing shell command + percent + "x"*$4.length + e + } + end + end + + module ExpressionExtension + attr_accessor :eval_string + attr_accessor :meth + end + OPERATOR_CHARS = '\|^&<>=~\+\-\*\/%\[' + def set_expr_and_postfix!(expr, column, ®exp) + expr.extend ExpressionExtension + + @postfix = "" + expr_orig = expr.clone + column ||= expr.length + last_char = expr[column-1] + expr.replace expr[ regexp[column] ] + debugprint "expr_orig=#{expr_orig}", "expr(sliced)=#{expr}" + right_stripped = Regexp.last_match.post_match + _handle_do_end right_stripped + aref_or_aset = aref_or_aset? right_stripped, last_char + debugprint "aref_or_aset=#{aref_or_aset.inspect}" + set_last_word! expr, aref_or_aset + fill_literal! expr_orig + _handle_brackets expr_orig, expr + expr << aref_or_aset if aref_or_aset + _handle_keywords expr_orig, column + debugprint "expr(processed)=#{expr}" + expr + end + + def _handle_do_end(right_stripped) + right_stripped << "\n" + n_do = right_stripped.scan(/[\s\)]do\s/).length + n_end = right_stripped.scan(/\bend\b/).length + @postfix = ";begin" * (n_do - n_end) + end + + def _handle_brackets(expr_orig, expr) + [ %w[{ }], %w[( )], %w![ ]! ].each do |left, right| + n_left = expr_orig.count(left) - expr.count(left) + n_right = expr_orig.count(right) - expr.count(right) + n = n_left - n_right + @postfix << ";#{left}" * n if n >= 0 + end + end + + def _handle_keywords(expr_orig, column) + %w[if unless while until for].each do |keyw| + pos = expr_orig.index(/\b#{keyw}\b/) + @postfix << ";begin" if pos and pos < column # if * xxx + + pos = expr_orig.index(/;\s*#{keyw}\b/) + @postfix << ";begin" if pos and column < pos # * ; if xxx + end + end + + def aref_or_aset?(right_stripped, last_char) + if last_char == ?[ + case right_stripped + when /\]\s*=/ then "[]=" + when /\]/ then "[]" + end + end + end + + def set_last_word!(expr, aref_or_aset=nil) + debugprint "expr(before set_last_word)=#{expr}" + if aref_or_aset + opchars = "" + else + opchars = expr.slice!(/\s*[#{OPERATOR_CHARS}]+$/) + debugprint "expr(strip opchars)=#{expr}" + end + + expr.replace(if expr =~ /[\"\'\`]$/ # String operations + "''" + else + fill_literal! expr + phrase = current_phrase(expr) + if aref_or_aset + expr.eval_string = expr[0..-2] + expr.meth = aref_or_aset + elsif phrase.match( /^(.+)\.(.*)$/ ) + expr.eval_string, expr.meth = $1, $2 + elsif opchars != '' + expr + end + debugprint "expr.eval_string=#{expr.eval_string}", "expr.meth=#{expr.meth}" + phrase + end << (opchars || '')) # ` font-lock hack + debugprint "expr(after set_last_word)=#{expr}" + end + + def current_phrase(expr) + paren_level = 0 + start = 0 + (expr.length-1).downto(0) do |i| + c = expr[i,1] + if c =~ /[\)\}\]]/ + paren_level += 1 + next + end + if paren_level > 0 + next if c =~ /[, ]/ + else + break (start = i+1) if c =~ /[ ,\(\{\[]/ + end + if c =~ /[\(\{\[]/ + paren_level -= 1 + break (start = i+1) if paren_level < 0 + end + end + expr[start..-1] + end + + def add_BEGIN + <\\Z] )[1].sub(/\\A.*?\\((.*?)\\)(.*)\\Z/){ "\#{$1}\#{$2}" }.sub(/##/) { "\#{$1}." } + #{result} = #{v}.to_s + ".new" if #{result} == 'Class#new' and #{v}.private_method_defined?(:initialize) + #{result} = "Object#" + #{meth} if #{result} =~ /^Kernel#/ and Kernel.instance_methods(false).map{|x| x.to_s}.include? #{meth} + #{result} +EOC + end + +end + +# Nearly 100% accurate completion for any editors!! +# by rubikitch +class XMPCompletionFilter < XMPFilter + include ProcessParticularLine + + class << self + attr_accessor :candidates_with_description_flag + end + @candidates_with_description_flag = false + + # String completion begins with this. + attr :prefix + + def self.run(code, opts) + new(opts).completion_code(code, opts[:lineno], opts[:column]) + end + + def magic_help_code(recv, meth) + oneline_ize __magic_help_code("#{VAR}_result", recv, meth) + end + + def methods_map_code(recv) + # delimiter is \0 + m = "#{VAR}_m" + mhc = magic_help_code((recv), m) + %Q[map{|%s| "\#{%s}\\0" + %s}] % [m, m, mhc] + end + + def split_method_info(minfo) + minfo.split(/\0/,2) + end + + def prepare_line(expr, column) + set_expr_and_postfix!(expr, column){|c| /^.{#{c}}/ } + @prefix = expr + case expr + when /^\$\w*$/ # global variable + __prepare_line 'nil', 'global_variables', '%n' + when /^@@\w*$/ # class variable + __prepare_line 'nil', 'Module === self ? class_variables : self.class.class_variables', '%n' + when /^@\w*$/ # instance variable + __prepare_line 'nil', 'instance_variables', '%n' + when /^([A-Z].*)::([^.]*)$/ # nested constants / class methods + @prefix = $2 + __prepare_line $1, "#$1.constants | #$1.methods(true)", + %Q[#$1.constants + #$1.methods(true).#{methods_map_code($1)}] + when /^[A-Z]\w*$/ # normal constants + __prepare_line 'nil', 'Module.constants', '%n' + when /^(.*::.+)\.(.*)$/ # toplevel class methods + @prefix = $2 + __prepare_line $1, "#$1.methods", + %Q[%n.#{methods_map_code($1)}] + when /^(::.+)::(.*)$/ # toplevel nested constants + @prefix = $2 + __prepare_line $1, "#$1.constants | #$1.methods", + %Q[#$1.constants + #$1.methods.#{methods_map_code($1)}] + when /^::(.*)/ # toplevel constant + @prefix = $1 + __prepare_line 'nil', 'Object.constants', '%n' + when /^(:[^:.]*)$/ # symbol + __prepare_line 'nil', 'Symbol.all_symbols.map{|s| ":" + s.id2name}', '%n' + when /\.([^.]*)$/ # method call + @prefix = $1 + recv = Regexp.last_match.pre_match + __prepare_line recv, "(#{recv}).methods(true)", + %Q[%n.#{methods_map_code(recv)}] + else # bare words + __prepare_line 'self', "methods | private_methods | local_variables | self.class.constants", + %Q[(methods | private_methods).#{methods_map_code('self')} + local_variables | self.class.constants] + end + end + + def __prepare_line(recv, all_completion_expr, all_completion_expr_verbose) + if self.class.candidates_with_description_flag + ___prepare_line(recv, all_completion_expr_verbose.gsub(/%n/, '('+all_completion_expr+')')) + else + ___prepare_line(recv, all_completion_expr) + end + + end + + def ___prepare_line(recv, all_completion_expr) + v = "#{VAR}" + rcv = "#{VAR}_recv" + idx = 1 + oneline_ize(< " + #{rcv}.to_s + " " + #{v}.join(" ")) || #{v} +exit +EOC + end + + def candidates_with_class(code, lineno, column=nil) + klass, methods = runtime_data_with_class(code, lineno, column) rescue ["", ""] + raise NoCandidates, "No candidates." if methods.nil? or methods.empty? + [klass, methods.split(/ /).sort] + end + + # Array of completion candidates. + class NoCandidates < RuntimeError; end + def candidates(code, lineno, column=nil) + candidates_with_class(code, lineno, column)[1] + end + + # Completion code for editors. + def completion_code(code, lineno, column=nil) + candidates(code, lineno, column).join("\n") rescue "\n" + end +end + +# for debugging XMPCompletionEmacsFilter +class XMPCompletionVerboseFilter < XMPCompletionFilter + @candidates_with_description_flag = true +end + +class XMPCompletionClassInfoFilter < XMPCompletionFilter + @candidates_with_description_flag = true + + def completion_code(code, lineno, column=nil) + candidates(code, lineno, column).join("\n").tr("\0", "\t") + rescue NoCandidates + "" + end +end + +class XMPCompletionEmacsFilter < XMPCompletionFilter + @candidates_with_description_flag = true + + def completion_code(code, lineno, column=nil) + elisp = "(progn\n" + table = "(setq rct-method-completion-table '(" + alist = "(setq alist '(" + begin + candidates(code, lineno, column).sort.each do |minfo| + meth, description = split_method_info(minfo) + table << format('("%s") ', meth) + alist << format('("%s\\t[%s]") ', meth, description) + end + table << "))\n" + alist << "))\n" + rescue Exception => err + return error_code(err) + end + elisp << table << alist + elisp << %Q[(setq pattern "#{prefix}")\n] + elisp << %Q[(try-completion pattern rct-method-completion-table nil)\n] + elisp << ")" # /progn + end + + def error_code(err) + case err + when NoCandidates + %Q[(error "#{err.message}")] + else + %Q[(error "#{err.message}\n#{err.backtrace.join("\n")}")] + end + + end +end + +class XMPCompletionEmacsIciclesFilter < XMPCompletionEmacsFilter + @candidates_with_description_flag = true + + def completion_code(code, lineno, column=nil) + elisp = "(progn\n" + table = "(setq rct-method-completion-table '(" + help_alist = "(setq alist '(" + + begin + klass, cands = candidates_with_class(code, lineno, column) + cands.sort.each do |minfo| + meth, description = split_method_info(minfo) + table << format('("%s\\t[%s]") ', meth, description) + help_alist << format('("%s" . "%s")', meth, description) + end + table << "))\n" + help_alist << "))\n" + rescue Exception => err + return error_code(err) + end + elisp << table << help_alist + elisp << %Q[(setq pattern "#{prefix}")\n] + elisp << %Q[(setq klass "#{klass}")\n] + elisp << ")" # /progn + end +end + +class XMPCompletionEmacsAnythingFilter < XMPCompletionEmacsFilter + @candidates_with_description_flag = true + + def completion_code(code, lineno, column=nil) + elisp = "(progn\n" + table = "(setq rct-method-completion-table `(" + + begin + klass, cands = candidates_with_class(code, lineno, column) + cands.sort.each do |minfo| + meth, description = split_method_info(minfo) + table << format('("%s\\t[%s]" . ,(propertize "%s" \'desc "%s")) ', + meth, description, meth, description) + end + table << "))\n" + rescue Exception => err + return error_code(err) + end + elisp << table + elisp << %Q[(setq pattern "#{prefix}")\n] + elisp << %Q[(setq klass "#{klass}")\n] + elisp << ")" # /progn + end +end + +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/lib/rcodetools/doc.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/lib/rcodetools/doc.rb new file mode 100644 index 000000000..9a3e752db --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/lib/rcodetools/doc.rb @@ -0,0 +1,168 @@ +require 'rcodetools/completion' +# Call Ri for any editors!! +# by rubikitch +module Rcodetools + +class XMPDocFilter < XMPFilter + include ProcessParticularLine + + def initialize(opts = {}) + super + @filename = opts[:filename] + extend UseMethodAnalyzer if opts[:use_method_analyzer] + end + + def self.run(code, opts) + new(opts).doc(code, opts[:lineno], opts[:column]) + end + + def prepare_line(expr, column) + set_expr_and_postfix!(expr, column){|c| + withop_re = /^.{#{c-1}}[#{OPERATOR_CHARS}]+/ + if expr =~ withop_re + withop_re + else + /^.{#{c}}[\w#{OPERATOR_CHARS}]*/ + end + } + recv = expr + + # When expr already knows receiver and method, + return(__prepare_line :recv => expr.eval_string, :meth => expr.meth) if expr.eval_string + + case expr + when /^(?:::)?([A-Z].*)(?:::|\.)(.*)$/ # nested constants / class methods + __prepare_line :klass => $1, :meth_or_constant => $2 + when /^(?:::)?[A-Z]/ # normal constants + __prepare_line :klass => expr + when /\.([^.]*)$/ # method call + __prepare_line :recv => Regexp.last_match.pre_match, :meth => $1 + when /^(.+)(\[\]=?)$/ # [], []= + __prepare_line :recv => $1, :meth => $2 + when /[#{OPERATOR_CHARS}]+$/ # operator + __prepare_line :recv => Regexp.last_match.pre_match, :meth => $& + else # bare words + __prepare_line :recv => "self", :meth => expr + end + end + + def __prepare_line(x) + v = "#{VAR}" + result = "#{VAR}_result" + klass = "#{VAR}_klass" + flag = "#{VAR}_flag" + which_methods = "#{VAR}_methods" + ancestor_class = "#{VAR}_ancestor_class" + idx = 1 + recv = x[:recv] || x[:klass] || raise(ArgumentError, "need :recv or :klass") + meth = x[:meth_or_constant] || x[:meth] + debugprint "recv=#{recv}", "meth=#{meth}" + if meth + # imported from fastri/MagicHelp + code = <<-EOC +#{v} = (#{recv}) +$stderr.print("#{MARKER}[#{idx}] => " + #{v}.class.to_s + " ") + +if Module === #{v} and '#{meth}' =~ /^[A-Z]/ and #{v}.const_defined?('#{meth}') + #{result} = #{v}.to_s + "::#{meth}" +else + #{__magic_help_code result, v, meth.dump} +end + +$stderr.puts(#{result}) +exit + EOC + else + code = <<-EOC +#{v} = (#{recv}) +$stderr.print("#{MARKER}[#{idx}] => " + #{v}.class.to_s + " ") +$stderr.puts(#{v}.to_s) +exit + EOC + end + oneline_ize(code) + end + + # overridable by module + def _doc(code, lineno, column) + end + + def doc(code, lineno, column=nil) + _doc(code, lineno, column) or runtime_data(code, lineno, column).to_s + end + + module UseMethodAnalyzer + METHOD_ANALYSIS = "method_analysis" + def have_method_analysis + File.file? METHOD_ANALYSIS + end + + def find_method_analysis + here = Dir.pwd + oldpwd = here + begin + while ! have_method_analysis + Dir.chdir("..") + if Dir.pwd == here + return nil # not found + end + here = Dir.pwd + end + ensure + Dir.chdir oldpwd + end + yield(File.join(here, METHOD_ANALYSIS)) + end + + def _doc(code, lineno, column=nil) + find_method_analysis do |ma_file| + methods = open(ma_file, "rb"){ |f| Marshal.load(f)} + line = File.readlines(@filename)[lineno-1] + current_method = line[ /^.{#{column}}\w*/][ /\w+[\?!]?$/ ].sub(/:+/,'') + filename = @filename # FIXME + begin + methods[filename][lineno].grep(Regexp.new(Regexp.quote(current_method)))[0] + rescue NoMethodError + raise "doc/method_analyzer:cannot find #{current_method}" + end + + end + end + end + +end + +# ReFe is so-called `Japanese Ri'. +class XMPReFeFilter < XMPDocFilter + def doc(code, lineno, column=nil) + "refe '#{super}'" + end +end + +class XMPRiFilter < XMPDocFilter + def doc(code, lineno, column=nil) + "ri '#{super.sub(/\./, '::')}'" + end +end + +class XMPRiEmacsFilter < XMPDocFilter + def doc(code, lineno, column=nil) + begin + %!(rct-find-tag-or-ri "#{super}")! + rescue Exception => err + return %Q[(error "#{err.message}")] + end + end +end + +class XMPRiVimFilter < XMPDocFilter + def doc(code, lineno, column=nil) + begin + %{call RCT_find_tag_or_ri("#{super}")} + rescue Exception => err + return %Q[echo #{err.message.inspect}] + end + end +end + +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/lib/rcodetools/fork.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/lib/rcodetools/fork.rb new file mode 100644 index 000000000..87fc2645c --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/lib/rcodetools/fork.rb @@ -0,0 +1,210 @@ +## Rcodetools version of ruby_fork +# +# Based on ruby_fork.rb by Ryan Davis, Eric Hodel, Zen Spider Software +# +# (The MIT License) +# +# Copyright (c) 2006 Ryan Davis, Eric Hodel, Zen Spider Software +# 2007 rubikitch +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +require 'optparse' +require 'socket' +require 'rcodetools/fork_config' + +module Rcodetools +module Fork + + USAGE_HELP = < [], + :code => [], + :extra_paths => [], + :port => PORT, + } + + def self.add_env_args(opts, settings) + opts.separator '' + opts.separator 'Process environment options:' + + opts.separator '' + opts.on('-e CODE', 'Execute CODE in parent process.', + 'May be specified multiple times.') do |code| + settings[:code] << code + end + + opts.separator '' + opts.on('-I DIRECTORY', 'Adds DIRECTORY to $LOAD_PATH.', + 'May be specified multiple times.') do |dir| + settings[:extra_paths] << dir + end + + opts.separator '' + opts.on('-r LIBRARY', 'Require LIBRARY in the parent process.', + 'May be specified multiple times.') do |lib| + settings[:requires] << lib + end + end + + def self.parse_client_args(args) + settings = Marshal.load Marshal.dump(DEFAULT_SETTINGS) + + opts = OptionParser.new do |opts| + opts.banner = "Usage: #{$0} [options]\n#{USAGE_HELP}" + + opts.separator '' + opts.on('-p', '--port PORT', + 'Listen for connections on PORT.', + "Default: #{settings[:port]}") do |port| + settings[:port] = port.to_i + end + + opts.separator '' + opts.on('-h', '--help', 'You\'re looking at it.') do + $stderr.puts opts + exit 1 + end + + add_env_args opts, settings + end + + opts.parse! args + + return settings + end + + def self.parse_server_args(args) + settings = Marshal.load Marshal.dump(DEFAULT_SETTINGS) + + opts = OptionParser.new do |opts| + opts.banner = "Usage: #{$0} [options]\n#{USAGE_HELP}" + + opts.separator '' + opts.on('-p', '--port PORT', + 'Listen for connections on PORT.', + "Default: #{settings[:port]}") do |port| + settings[:port] = port.to_i + end + + opts.separator '' + opts.on('-h', '--help', 'You\'re looking at it.') do + $stderr.puts opts + exit 1 + end + + add_env_args opts, settings + end + + opts.parse! args + + return settings + end + + def self.start_client(args = ARGV) + trap 'INT' do exit 1 end # Exit gracefully + + settings = parse_client_args args + + args = Marshal.dump [settings, ARGV] + + socket = TCPSocket.new 'localhost', settings[:port] + + socket.puts args.length + socket.write args + socket.close_write + end + + def self.start_server(args = ARGV) + begin + require 'rubygems' + rescue LoadError + end + write_pwd + settings = parse_server_args args + setup_environment settings + + server = TCPServer.new 'localhost', settings[:port] + + $stderr.puts "#{$0} Running as PID #{$$} on #{settings[:port]}" + + loop do + Thread.new server.accept do |socket| + begin + args_length = socket.gets.to_i + args = socket.read args_length + settings, argv = Marshal.load args + fork do + ARGV.replace argv + setup_environment settings + socket.close + end + socket.close # close my copy. + rescue => e + socket.close if socket + end + end + end + rescue Interrupt, SystemExit + File.unlink PWD_FILE + rescue Exception => e + File.unlink PWD_FILE + puts "Failed to catch #{e.class}:#{e.message}" + puts "\t#{e.backtrace.join "\n\t"}" + end + + def self.setup_environment(settings) + settings[:extra_paths].map! { |dir| dir.split ':' } + settings[:extra_paths].flatten! + settings[:extra_paths].each { |dir| $:.unshift dir } + + begin + settings[:requires].each { |file| require file } + settings[:code].each { |code| eval code, TOPLEVEL_BINDING } + rescue Exception + $@.reject! {|s| s =~ %r!rcodetools/fork\.rb!} + raise + end + end + +end + +end + diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/lib/rcodetools/fork_config.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/lib/rcodetools/fork_config.rb new file mode 100644 index 000000000..e22b4cd1f --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/lib/rcodetools/fork_config.rb @@ -0,0 +1,26 @@ + +module Rcodetools + +module Fork + PORT = 9085 + # Contains $PWD of rct-fork server. Exists only while running. + PWD_FILE = File.expand_path "~/.rct-fork.pwd" + + def self.chdir_fork_directory + if run? + Dir.chdir File.read(PWD_FILE) + else + raise "rct-fork is not running." + end + end + + def self.write_pwd + open(PWD_FILE, "w"){|f| f.print Dir.pwd } + end + + def self.run? + File.file? PWD_FILE + end +end + +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/lib/rcodetools/options.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/lib/rcodetools/options.rb new file mode 100644 index 000000000..8ba920986 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/lib/rcodetools/options.rb @@ -0,0 +1,136 @@ +require 'optparse' + +module Rcodetools +# Domain specific OptionParser extensions +module OptionHandler + def set_banner + self.banner = "Usage: #{$0} [options] [inputfile] [-- cmdline args]" + end + + def handle_position(options) + separator "" + separator "Position options:" + on("--line=LINE", "Current line number.") do |n| + options[:lineno] = n.to_i + end + on("--column=COLUMN", "Current column number in BYTE.") do |n| + options[:column] = n.to_i + end + on("-t TEST", "--test=TEST", + "Execute test script. ", + "TEST is TESTSCRIPT, TESTSCRIPT@TESTMETHOD, or TESTSCRIPT@LINENO.", + "You must specify --filename option.") do |t| + options[:test_script], options[:test_method] = t.split(/@/) + end + on("--filename=FILENAME", "Filename of standard input.") do |f| + options[:filename] = f + end + end + + def handle_interpreter(options) + separator "" + separator "Interpreter options:" + on("-S FILE", "--interpreter FILE", "Use interpreter FILE.") do |interpreter| + options[:interpreter] = interpreter + end + on("-I PATH", "Add PATH to $LOAD_PATH") do |path| + options[:include_paths] << path + end + on("--dev", "Add this project's bin/ and lib/ to $LOAD_PATH.", + "A directory with a Rakefile is considered a project base directory.") do + auto_include_paths(options[:include_paths], Dir.pwd) + end + on("-r LIB", "Require LIB before execution.") do |lib| + options[:libs] << lib + end + on("-e EXPR", "--eval=EXPR", "--stub=EXPR", "Evaluate EXPR after execution.") do |expr| + options[:evals] << expr + end + on("--fork", "Use rct-fork-client if rct-fork is running.") do + options[:detect_rct_fork] = true + end + on("--rbtest", "Use rbtest.") do + options[:use_rbtest] = true + end + on("--detect-rbtest", "Use rbtest if '=begin test_*' blocks exist.") do + options[:detect_rbtest] = true + end + end + + def handle_misc(options) + separator "" + separator "Misc options:" + on("--cd DIR", "Change working directory to DIR.") do |dir| + options[:wd] = dir + end + on("--debug", "Write transformed source code to xmp-tmp.PID.rb.") do + options[:dump] = "xmp-tmp.#{Process.pid}.rb" + end + on("--tmpfile", "--tempfile", "Use tmpfile instead of open3. (non-windows)") do + options[:execute_ruby_tmpfile] = true + end + on("-w N", "--width N", Integer, "Set width of multi-line annotation. (xmpfilter only)") do |width| + options[:width] = width + end + separator "" + on("-h", "--help", "Show this message") do + puts self + exit + end + on("-v", "--version", "Show version information") do + puts "#{File.basename($0)} #{XMPFilter::VERSION}" + exit + end + end + + def auto_include_paths(include_paths, pwd) + if pwd =~ %r!^(.+)/(lib|bin)! + include_paths.unshift("#$1/lib").unshift("#$1/bin") + elsif File.file? "#{pwd}/Rakefile" or File.file? "#{pwd}/rakefile" + include_paths.unshift("#{pwd}/lib").unshift("#{pwd}/bin") + end + end + module_function :auto_include_paths + +end + +def set_extra_opts(options) + if idx = ARGV.index("--") + options[:options] = ARGV[idx+1..-1] + ARGV.replace ARGV[0...idx] + else + options[:options] = [] + end +end + +def check_opts(options) + if options[:test_script] + unless options[:filename] + $stderr.puts "You must specify --filename as well as -t(--test)." + exit 1 + end + end +end + +DEFAULT_OPTIONS = { + :interpreter => "ruby", + :options => ["hoge"], + :min_codeline_size => 50, + :width => 79, + :libs => [], + :evals => [], + :include_paths => [], + :dump => nil, + :wd => nil, + :warnings => true, + :use_parentheses => true, + :column => nil, + :output_stdout => true, + :test_script => nil, + :test_method => nil, + :detect_rct_fork => false, + :use_rbtest => false, + :detect_rbtest => false, + :execute_ruby_tmpfile => false, + } +end # /Rcodetools diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/lib/rcodetools/xmpfilter.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/lib/rcodetools/xmpfilter.rb new file mode 100755 index 000000000..a174b5180 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/lib/rcodetools/xmpfilter.rb @@ -0,0 +1,379 @@ +#!/usr/bin/env ruby +# Copyright (c) 2005-2008 Mauricio Fernandez http://eigenclass.org +# rubikitch +# Use and distribution subject to the terms of the Ruby license. + +# This is needed regexps cannot match with invalid-encoding strings. +# xmpfilter is unaware of script encoding. +Encoding.default_external = "ASCII-8BIT" if RUBY_VERSION >= "1.9" + +ENV['HOME'] ||= "#{ENV['HOMEDRIVE']}#{ENV['HOMEPATH']}" +require 'rcodetools/fork_config' +require 'rcodetools/compat' +require 'tmpdir' + +module Rcodetools + +class XMPFilter + VERSION = "0.8.7" + + MARKER = "!XMP#{Time.new.to_i}_#{Process.pid}_#{rand(1000000)}!" + XMP_RE = Regexp.new("^" + Regexp.escape(MARKER) + '\[([0-9]+)\] (=>|~>|==>) (.*)') + VAR = "_xmp_#{Time.new.to_i}_#{Process.pid}_#{rand(1000000)}" + WARNING_RE = /.*:([0-9]+): warning: (.*)/ + + RuntimeData = Struct.new(:results, :exceptions, :bindings) + + INITIALIZE_OPTS = {:interpreter => "ruby", :options => [], :libs => [], + :include_paths => [], :warnings => true, + :use_parentheses => true} + + def windows? + /win|mingw/ =~ RUBY_PLATFORM && /darwin/ !~ RUBY_PLATFORM + end + + Interpreter = Struct.new(:options, :execute_method, :accept_debug, :accept_include_paths, :chdir_proc) + INTERPRETER_RUBY = Interpreter.new(["-w"], + :execute_ruby, true, true, nil) + INTERPRETER_RBTEST = Interpreter.new(["-S", "rbtest"], + :execute_script, false, false, nil) + INTERPRETER_FORK = Interpreter.new(["-S", "rct-fork-client"], + :execute_tmpfile, false, true, + lambda { Fork::chdir_fork_directory }) + + def self.detect_rbtest(code, opts) + opts[:use_rbtest] ||= (opts[:detect_rbtest] and code =~ /^=begin test./) ? true : false + end + + # The processor (overridable) + def self.run(code, opts) + new(opts).annotate(code) + end + + def initialize(opts = {}) + options = INITIALIZE_OPTS.merge opts + @interpreter_info = INTERPRETER_RUBY + @interpreter = options[:interpreter] + @options = options[:options] + @libs = options[:libs] + @evals = options[:evals] || [] + @include_paths = options[:include_paths] + @output_stdout = options[:output_stdout] + @dump = options[:dump] + @warnings = options[:warnings] + @parentheses = options[:use_parentheses] + @ignore_NoMethodError = options[:ignore_NoMethodError] + test_script = options[:test_script] + test_method = options[:test_method] + filename = options[:filename] + @execute_ruby_tmpfile = options[:execute_ruby_tmpfile] + @postfix = "" + @stdin_path = nil + @width = options[:width] + + initialize_rct_fork if options[:detect_rct_fork] + initialize_rbtest if options[:use_rbtest] + initialize_for_test_script test_script, test_method, filename if test_script and !options[:use_rbtest] + end + + def initialize_rct_fork + if Fork::run? + @interpreter_info = INTERPRETER_FORK + end + end + + def initialize_rbtest + @interpreter_info = INTERPRETER_RBTEST + end + + def initialize_for_test_script(test_script, test_method, filename) + test_script.replace File.expand_path(test_script) + filename.replace File.expand_path(filename) + unless test_script == filename + basedir = common_path(test_script, filename) + relative_filename = filename[basedir.length+1 .. -1].sub(%r!^lib/!, '') + @evals << %Q!$LOADED_FEATURES << #{relative_filename.dump}! + @evals << safe_require_code('test/unit') + @evals << %Q!load #{test_script.dump}! + end + test_method = get_test_method_from_lineno(test_script, test_method.to_i) if test_method =~ /^\d/ + @evals << %Q!Test::Unit::AutoRunner.run(false, nil, ["-n", #{test_method.dump}])! if test_method + end + + def get_test_method_from_lineno(filename, lineno) + lines = File.readlines(filename) + (lineno-1).downto(0) do |i| + if lines[i] =~ /^ *def *(test_[A-Za-z0-9?!_]+)$/ + return $1 + end + end + nil + end + + def common_path(a, b) + (a.split(File::Separator) & b.split(File::Separator)).join(File::Separator) + end + + def add_markers(code, min_codeline_size = 50) + maxlen = code.map{|x| x.size}.max + maxlen = [min_codeline_size, maxlen + 2].max + ret = "" + code.each do |l| + l = l.chomp.gsub(/ # (=>|!>).*/, "").gsub(/\s*$/, "") + ret << (l + " " * (maxlen - l.size) + " # =>\n") + end + ret + end + + SINGLE_LINE_RE = /^(?!(?:\s+|(?:\s*#.+)?)# ?=>)(.*) # ?=>.*/ + MULTI_LINE_RE = /^(.*)\n(( *)# ?=>.*(?:\n|\z))(?: *# .*\n)*/ + def annotate(code) + idx = 0 + code = code.gsub(/ # !>.*/, '') + newcode = code.gsub(SINGLE_LINE_RE){ prepare_line($1, idx += 1) } + newcode.gsub!(MULTI_LINE_RE){ prepare_line($1, idx += 1, true)} + File.open(@dump, "w"){|f| f.puts newcode} if @dump + execute(newcode) do |stdout, stderr| + output = stderr.readlines + runtime_data = extract_data(output) + idx = 0 + annotated = code.gsub(SINGLE_LINE_RE) { |l| + expr = $1 + if /^\s*#/ =~ l + l + else + annotated_line(l, expr, runtime_data, idx += 1) + end + } + annotated.gsub!(/ # !>.*/, '') + annotated.gsub!(/# (>>|~>)[^\n]*\n/m, ""); + annotated.gsub!(MULTI_LINE_RE) { |l| + annotated_multi_line(l, $1, $3, runtime_data, idx += 1) + } + ret = final_decoration(annotated, output) + if @output_stdout and (s = stdout.read) != "" + ret << s.inject(""){|s,line| s + "# >> #{line}".chomp + "\n" } + end + ret + end + end + + def annotated_line(line, expression, runtime_data, idx) + "#{expression} # => " + (runtime_data.results[idx].map{|x| x[1]} || []).join(", ") + end + + def annotated_multi_line(line, expression, indent, runtime_data, idx) + pretty = (runtime_data.results[idx].map{|x| x[1]} || []).join(", ") + first, *rest = pretty.to_a + rest.inject("#{expression}\n#{indent}# => #{first || "\n"}") {|s, l| s << "#{indent}# " << l } + end + + def prepare_line_annotation(expr, idx, multi_line=false) + v = "#{VAR}" + blocal = "__#{VAR}" + blocal2 = "___#{VAR}" + lastmatch = "____#{VAR}" + if multi_line + pp = safe_require_code "pp" + result = "((begin; #{lastmatch} = $~; PP.pp(#{v}, '', #{@width-5}).gsub(/\\r?\\n/, 'PPPROTECT'); ensure; $~ = #{lastmatch} end))" + else + pp = '' + result = "#{v}.inspect" + end + oneline_ize(<<-EOF).chomp +#{pp} +#{v} = (#{expr}) +$stderr.puts("#{MARKER}[#{idx}] => " + #{v}.class.to_s + " " + #{result}) || begin + $stderr.puts local_variables + local_variables.each{|#{blocal}| + #{blocal2} = eval(#{blocal}) + if #{v} == #{blocal2} && #{blocal} != %#{expr}.strip + $stderr.puts("#{MARKER}[#{idx}] ==> " + #{blocal}) + elsif [#{blocal2}] == #{v} + $stderr.puts("#{MARKER}[#{idx}] ==> [" + #{blocal} + "]") + end + } + nil +rescue Exception + nil +end || #{v} + EOF + + end + alias_method :prepare_line, :prepare_line_annotation + + def safe_require_code(lib) + oldverbose = "$#{VAR}_old_verbose" + "#{oldverbose} = $VERBOSE; $VERBOSE = false; require '#{lib}'; $VERBOSE = #{oldverbose}" + end + private :safe_require_code + + def execute_ruby(code) + meth = (windows? or @execute_ruby_tmpfile) ? :execute_tmpfile : :execute_popen + __send__ meth, code + end + + def split_shbang(script) + ary = script.each_line.to_a + if ary[0] =~ /^#!/ and ary[1] =~ /^#.*coding/ + [ary[0..1], ary[2..-1]] + elsif ary[0] =~ /^#!|^#.*coding/ + [[ary[0]], ary[1..-1]] + else + [[], ary] + end + end + private :split_shbang + + def execute_tmpfile(code) + ios = %w[_ stdin stdout stderr] + stdin, stdout, stderr = (1..3).map do |i| + fname = if $DEBUG + "xmpfilter.tmpfile_#{ios[i]}.rb" + else + "xmpfilter.tmpfile_#{Process.pid}-#{i}.rb" + end + f = File.open(fname, "w+") + f + end + # stdin.puts code + # stdin.close + shbang_magic_comment, rest = split_shbang(code) + @stdin_path = File.expand_path stdin.path + stdin.print shbang_magic_comment + stdin.print <<-EOF.map{|l| l.strip}.join(";") + $stdout.reopen('#{File.expand_path(stdout.path)}', 'w') + $stderr.reopen('#{File.expand_path(stderr.path)}', 'w') + $0 = '#{File.expand_path(stdin.path)}' + ARGV.replace(#{@options.inspect}) + END { #{@evals.join(";")} } + EOF + stdin.print ";#{rest}" + + debugprint "execute command = #{(interpreter_command << stdin.path).join ' '}" + stdin.close + oldpwd = Dir.pwd + @interpreter_info.chdir_proc and @interpreter_info.chdir_proc.call + system(*(interpreter_command << stdin.path)) + Dir.chdir oldpwd + [stdout, stderr] + end + + def execute_popen(code) + require 'open3' + stdin, stdout, stderr = Open3::popen3(*interpreter_command) + stdin.puts code + @evals.each{|x| stdin.puts x } unless @evals.empty? + stdin.close + [stdout, stderr] + end + + def execute_script(code) + path = File.expand_path("xmpfilter.tmpfile_#{Process.pid}.rb", Dir.tmpdir) + File.open(path, "w"){|f| f.puts code} + at_exit { File.unlink path if File.exist? path} + stdout_path, stderr_path = (1..2).map do |i| + fname = "xmpfilter.tmpfile_#{Process.pid}-#{i}.rb" + File.expand_path(fname, Dir.tmpdir) + end + args = *(interpreter_command << %["#{path}"] << "2>" << + %["#{stderr_path}"] << ">" << %["#{stdout_path}"]) + system(args.join(" ")) + + [stdout_path, stderr_path].map do |fullname| + f = File.open(fullname, "r") + # at_exit { + # f.close unless f.closed? + # File.unlink fullname if File.exist? fullname + # } + f + end + end + + def execute(code) + stdout, stderr = __send__ @interpreter_info.execute_method, code + if block_given? + begin + yield stdout, stderr + ensure + for out in [stdout, stderr] + path = out.path rescue nil + out.close +# File.unlink path if path + end + end + else + [stdout, stderr] + end + end + + def interpreter_command + # BUG interpreter option arguments containing space are not + # accepted. But it seems to be rare case. + r = @interpreter.split + @interpreter_info.options + r << "-d" if $DEBUG and @interpreter_info.accept_debug + r << "-I#{@include_paths.join(":")}" if @interpreter_info.accept_include_paths and !@include_paths.empty? + @libs.each{|x| r << "-r#{x}" } unless @libs.empty? + (r << "-").concat @options unless @options.empty? + r + end + + def extract_data(output) + results = Hash.new{|h,k| h[k] = []} + exceptions = Hash.new{|h,k| h[k] = []} + bindings = Hash.new{|h,k| h[k] = []} + output.grep(XMP_RE).each do |line| + result_id, op, result = XMP_RE.match(line).captures + case op + when "=>" + klass, value = /(\S+)\s+(.*)/.match(result).captures + results[result_id.to_i] << [klass, value.gsub(/PPPROTECT/, "\n")] + when "~>" + exceptions[result_id.to_i] << result + when "==>" + bindings[result_id.to_i] << result unless result.index(VAR) + end + end + RuntimeData.new(results, exceptions, bindings) + end + + def final_decoration(code, output) + warnings = {} + output.join.grep(WARNING_RE).map do |x| + md = WARNING_RE.match(x) + warnings[md[1].to_i] = md[2] + end + idx = 0 + ret = code.map do |line| + w = warnings[idx+=1] + if @warnings + w ? (line.chomp + " # !> #{w}") : line + else + line + end + end + output = output.reject{|x| /^-:[0-9]+: warning/.match(x)} + if exception = /^-e?:[0-9]+:.*|^(?!!XMP)[^\n]+:[0-9]+:in .*/m.match(output.join) + err = exception[0] + err.gsub!(Regexp.union(@stdin_path), '-') if @stdin_path + ret << err.map{|line| "# ~> " + line } + end + ret + end + + def oneline_ize(code) + "((" + code.gsub(/\r?\n|\r/, ';') + "));#{@postfix}\n" + end + + def debugprint(*args) + $stderr.puts(*args) if $DEBUG + end +end # clas XMPFilter + +class XMPAddMarkers < XMPFilter + def self.run(code, opts) + new(opts).add_markers(code, opts[:min_codeline_size]) + end +end + +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/lib/rcodetools/xmptestunitfilter.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/lib/rcodetools/xmptestunitfilter.rb new file mode 100644 index 000000000..e3fe395f2 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/lib/rcodetools/xmptestunitfilter.rb @@ -0,0 +1,314 @@ +require 'rcodetools/xmpfilter' + +module Rcodetools + +FLOAT_TOLERANCE = 0.0001 +class XMPTestUnitFilter < XMPFilter + def initialize(opts = {}) + super + @output_stdout = false + mod = @parentheses ? :WithParentheses : :Poetry + extend self.class.const_get(mod) unless opts[:_no_extend_module] + end + + private + def annotated_line(line, expression, runtime_data, idx) + indent = /^\s*/.match(line)[0] + assertions(expression.strip, runtime_data, idx).map{|x| indent + x}.join("\n") + end + + def prepare_line(expr, idx) + basic_eval = prepare_line_annotation(expr, idx) + %|begin; #{basic_eval}; rescue Exception; $stderr.puts("#{MARKER}[#{idx}] ~> " + $!.class.to_s); end| + end + + def assertions(expression, runtime_data, index) + exceptions = runtime_data.exceptions + ret = [] + + unless (vars = runtime_data.bindings[index]).empty? + vars.each{|var| ret << equal_assertion(var, expression) } + end + if !(wanted = runtime_data.results[index]).empty? || !exceptions[index] + case (wanted[0][1] rescue 1) + when "nil" + ret.concat nil_assertion(expression) + else + case wanted.size + when 1 + ret.concat _value_assertions(wanted[0], expression) + else + # discard values from multiple runs + ret.concat(["#xmpfilter: WARNING!! extra values ignored"] + + _value_assertions(wanted[0], expression)) + end + end + else + ret.concat raise_assertion(expression, exceptions, index) + end + + ret + end + + OTHER = Class.new + def _value_assertions(klass_value_txt_pair, expression) + klass_txt, value_txt = klass_value_txt_pair + value = eval(value_txt) || OTHER.new + # special cases + value = nil if value_txt.strip == "nil" + value = false if value_txt.strip == "false" + value_assertions klass_txt, value_txt, value, expression + rescue Exception + return object_assertions(klass_txt, value_txt, expression) + end + + def raise_assertion(expression, exceptions, index) + ["assert_raise(#{exceptions[index][0]}){#{expression}}"] + end + + module WithParentheses + def nil_assertion(expression) + ["assert_nil(#{expression})"] + end + + def value_assertions(klass_txt, value_txt, value, expression) + case value + when Float + ["assert_in_delta(#{value.inspect}, #{expression}, #{FLOAT_TOLERANCE})"] + when Numeric, String, Hash, Array, Regexp, TrueClass, FalseClass, Symbol, NilClass + ["assert_equal(#{value_txt}, #{expression})"] + else + object_assertions(klass_txt, value_txt, expression) + end + end + + def object_assertions(klass_txt, value_txt, expression) + [ "assert_kind_of(#{klass_txt}, #{expression})", + "assert_equal(#{value_txt.inspect}, #{expression}.inspect)" ] + end + + def equal_assertion(expected, actual) + "assert_equal(#{expected}, #{actual})" + end + end + + module Poetry + def nil_assertion(expression) + ["assert_nil #{expression}"] + end + + def value_assertions(klass_txt, value_txt, value, expression) + case value + when Float + ["assert_in_delta #{value.inspect}, #{expression}, #{FLOAT_TOLERANCE}"] + when Numeric, String, Hash, Array, Regexp, TrueClass, FalseClass, Symbol, NilClass + ["assert_equal #{value_txt}, #{expression}"] + else + object_assertions klass_txt, value_txt, expression + end + end + + def object_assertions(klass_txt, value_txt, expression) + [ "assert_kind_of #{klass_txt}, #{expression} ", + "assert_equal #{value_txt.inspect}, #{expression}.inspect" ] + end + + def equal_assertion(expected, actual) + "assert_equal #{expected}, #{actual}" + end + end +end + +class XMPRSpecFilter < XMPTestUnitFilter + def initialize(x={}) + super(x.merge(:_no_extend_module => true)) + load_rspec + specver = (Spec::VERSION::STRING rescue "1.0.0") + api_module = specver >= "0.8.0" ? NewAPI : OldAPI + @interpreter_info.execute_method = :execute_script + mod = @parentheses ? :WithParentheses : :Poetry + extend api_module.const_get(mod) + extend api_module + end + + private + def load_rspec + begin + require 'spec/version' + rescue LoadError + require 'rubygems' + begin + require 'spec/version' + rescue LoadError # if rspec isn't available, use most recent conventions + end + end + end + +# alias :execute :execute_script + + def interpreter_command + [@interpreter] + @libs.map{|x| "-r#{x}"} + end + + module NewAPI + def raise_assertion(expression, exceptions, index) + ["lambda{#{expression}}.should raise_error(#{exceptions[index][0]})"] + end + + module WithParentheses + def nil_assertion(expression) + ["(#{expression}).should be_nil"] + end + + def value_assertions(klass_txt, value_txt, value, expression) + case value + when Float + ["(#{expression}).should be_close(#{value.inspect}, #{FLOAT_TOLERANCE})"] + when Numeric, String, Hash, Array, Regexp, TrueClass, FalseClass, Symbol, NilClass + ["(#{expression}).should == (#{value_txt})"] + else + object_assertions klass_txt, value_txt, expression + end + end + + def object_assertions(klass_txt, value_txt, expression) + [ "(#{expression}).should be_a_kind_of(#{klass_txt})", + "(#{expression}.inspect).should == (#{value_txt.inspect})" ] + end + + def equal_assertion(expected, actual) + "(#{actual}).should == (#{expected})" + end + end + + module Poetry + def nil_assertion(expression) + ["#{expression}.should be_nil"] + end + + def value_assertions(klass_txt, value_txt, value, expression) + case value + when Float + ["#{expression}.should be_close(#{value.inspect}, #{FLOAT_TOLERANCE})"] + when Numeric, String, Hash, Array, Regexp, TrueClass, FalseClass, Symbol, NilClass + ["#{expression}.should == #{value_txt}"] + else + object_assertions klass_txt, value_txt, expression + end + end + + def object_assertions(klass_txt, value_txt, expression) + [ "#{expression}.should be_a_kind_of(#{klass_txt})", + "#{expression}.inspect.should == #{value_txt.inspect}" ] + end + + def equal_assertion(expected, actual) + "#{actual}.should == #{expected}" + end + end + end + + module OldAPI + # old rspec, use deprecated syntax + def raise_assertion(expression, exceptions, index) + ["lambda{#{expression}}.should_raise_error(#{exceptions[index][0]})"] + end + + module WithParentheses + def nil_assertion(expression) + ["(#{expression}).should_be_nil"] + end + + def value_assertions(klass_txt, value_txt, value, expression) + case value + when Float + ["(#{expression}).should_be_close(#{value.inspect}, #{FLOAT_TOLERANCE})"] + when Numeric, String, Hash, Array, Regexp, TrueClass, FalseClass, Symbol, NilClass + ["(#{expression}).should_equal(#{value_txt})"] + else + object_assertions klass_txt, value_txt, expression + end + end + + def object_assertions(klass_txt, value_txt, expression) + [ "(#{expression}).should_be_a_kind_of(#{klass_txt})", + "(#{expression}.inspect).should_equal(#{value_txt.inspect})" ] + end + + def equal_assertion(expected, actual) + "(#{actual}).should_equal(#{expected})" + end + end + + module Poetry + def nil_assertion(expression) + ["#{expression}.should_be_nil"] + end + + def value_assertions(klass_txt, value_txt, value, expression) + case value + when Float + ["#{expression}.should_be_close #{value.inspect}, #{FLOAT_TOLERANCE}"] + when Numeric, String, Hash, Array, Regexp, TrueClass, FalseClass, Symbol, NilClass + ["#{expression}.should_equal #{value_txt}"] + else + object_assertions klass_txt, value_txt, expression + end + end + + def object_assertions(klass_txt, value_txt, expression) + [ "#{expression}.should_be_a_kind_of #{klass_txt}", + "#{expression}.inspect.should_equal #{value_txt.inspect}" ] + end + + def equal_assertion(expected, actual) + "#{actual}.should_equal #{expected}" + end + end + end + + +end + +class XMPExpectationsFilter < XMPTestUnitFilter + def initialize(x={}) + super(x.merge(:_no_extend_module => true)) + @warnings = false + end + + def expectation(expected, actual) + < 'unit', 'controllers' => 'functional' } + RAILS_TESTNAME2MVC = RAILS_MVC2TESTNAME.invert + def test_file_00_rails(implementation, basedir, dir, node) # rails + if m = %r!app/(models|controllers)/(.+)\.rb$!.match(implementation) + "%stest/%s/%s_test.rb" % [ m.pre_match, RAILS_MVC2TESTNAME[m[1]], m[2] ] + end + end + + def test_file_05_rails_lib(implementation, basedir, dir, node) + if basedir and File.directory?( File.join(basedir, "app") ) + "#{basedir}test/unit/test_#{node}.rb" + end + end + + def test_file_10_no_match(implementation, basedir, dir, node) + if [basedir, dir, node].all?{|x| x.nil?} + "#{File.dirname(implementation)}/test_#{File.basename(implementation)}" + end + end + + def test_file_20_simple(implementation, basedir, dir, node) # test/test_NODE.rb + exist "#{basedir}test/test_#{node}.rb" + end + + def test_file_30_flat(implementation, basedir, dir, node) # lib/XXX/NODE.rb -> test/test_NODE.rb + exist "#{basedir}test/test_#{node}.rb" if dir + end + + def test_file_99_autotest_default(implementation, basedir, dir, node) # lib/XXX/NODE.rb -> test/XXX/test_NODE.rb + "#{basedir}test/#{dir}test_#{node}.rb" + end + + def implementation_file_00_rails(test, basedir, dir, node) + if m = %r!test/(unit|functional)/(.+)_test.rb$!.match(test) + "%sapp/%s/%s.rb" % [ m.pre_match, RAILS_TESTNAME2MVC[m[1]], m[2] ] + end + end + + def implementation_file_10_no_match(test, basename, dir, node) + if dir == nil and node == nil and test =~ %r!/test_(.+)\.rb$! + test.sub("/test_", "/") + end + end + + def implementation_file_20(test, basedir, dir, node) + exist("#{basedir}lib/#{dir}#{node}.rb") + end + + def implementation_file_30_flat(test, basedir, dir, node) + Dir[ "#{basedir}lib/**/#{node}.rb" ].first + end + + def implementation_file_99_default(test, basedir, dir, node) + "#{basedir}lib/#{dir}#{node}.rb" + end + +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/license.txt b/bundles/ruby.tmbundle/Support/vendor/rcodetools/license.txt new file mode 100644 index 000000000..e2eb45cde --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/license.txt @@ -0,0 +1,8 @@ + + rcodetools http://eigenclass.org/hiki.rb?rcodetools + Copyright (c) 2005-2007 Mauricio Fernandez http://eigenclass.org + Copyright (c) 2006-2008 rubikitch http://www.rubyist.net/~rubikitch/ +Use and distribution subject to the terms of the Ruby license. + += License +rcodetools is licensed under the same terms as Ruby. diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/rcodetools.el b/bundles/ruby.tmbundle/Support/vendor/rcodetools/rcodetools.el new file mode 100644 index 000000000..e5c90af96 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/rcodetools.el @@ -0,0 +1,430 @@ +;;; rcodetools.el -- annotation / accurate completion / browsing documentation + +;;; Copyright (c) 2006-2008 rubikitch +;;; +;;; Use and distribution subject to the terms of the Ruby license. + +(defvar xmpfilter-command-name "ruby -S xmpfilter --dev --fork --detect-rbtest" + "The xmpfilter command name.") +(defvar rct-doc-command-name "ruby -S rct-doc --dev --fork --detect-rbtest" + "The rct-doc command name.") +(defvar rct-complete-command-name "ruby -S rct-complete --dev --fork --detect-rbtest" + "The rct-complete command name.") +(defvar ruby-toggle-file-command-name "ruby -S ruby-toggle-file" + "The ruby-toggle-file command name.") +(defvar rct-fork-command-name "ruby -S rct-fork") +(defvar rct-option-history nil) ;internal +(defvar rct-option-local nil) ;internal +(make-variable-buffer-local 'rct-option-local) +(defvar rct-debug nil + "If non-nil, output debug message into *Messages*.") +;; (setq rct-debug t) + +(defadvice comment-dwim (around rct-hack activate) + "If comment-dwim is successively called, add => mark." + (if (and (eq major-mode 'ruby-mode) + (eq last-command 'comment-dwim) + ;; TODO =>check + ) + (insert "=>") + ad-do-it)) +;; To remove this advice. +;; (progn (ad-disable-advice 'comment-dwim 'around 'rct-hack) (ad-update 'comment-dwim)) + +(defun rct-current-line () + "Return the vertical position of point..." + (+ (count-lines (point-min) (point)) + (if (= (current-column) 0) 1 0))) + +(defun rct-save-position (proc) + "Evaluate proc with saving current-line/current-column/window-start." + (let ((line (rct-current-line)) + (col (current-column)) + (wstart (window-start))) + (funcall proc) + (goto-char (point-min)) + (forward-line (1- line)) + (move-to-column col) + (set-window-start (selected-window) wstart))) + +(defun rct-interactive () + "All the rcodetools-related commands with prefix args read rcodetools' common option. And store option into buffer-local variable." + (list + (let ((option (or rct-option-local ""))) + (if current-prefix-arg + (setq rct-option-local + (read-from-minibuffer "rcodetools option: " option nil nil 'rct-option-history)) + option)))) + +(defun rct-shell-command (command &optional buffer) + "Replacement for `(shell-command-on-region (point-min) (point-max) command buffer t' because of encoding problem." + (let ((input-rb (concat (make-temp-name "xmptmp-in") ".rb")) + (output-rb (concat (make-temp-name "xmptmp-out") ".rb")) + (coding-system-for-read buffer-file-coding-system)) + (write-region (point-min) (point-max) input-rb nil 'nodisp) + (shell-command + (rct-debuglog (format "%s %s > %s" command input-rb output-rb)) + t " *rct-error*") + (with-current-buffer (or buffer (current-buffer)) + (insert-file-contents output-rb nil nil nil t)) + (delete-file input-rb) + (delete-file output-rb))) + +(defvar xmpfilter-command-function 'xmpfilter-command) +(defun xmp (&optional option) + "Run xmpfilter for annotation/test/spec on whole buffer. +See also `rct-interactive'. " + (interactive (rct-interactive)) + (rct-save-position + (lambda () + (rct-shell-command (funcall xmpfilter-command-function option))))) + +(defun xmpfilter-command (&optional option) + "The xmpfilter command line, DWIM." + (setq option (or option "")) + (flet ((in-block (beg-re) + (save-excursion + (goto-char (point-min)) + (when (re-search-forward beg-re nil t) + (let ((s (point)) e) + (when (re-search-forward "^end\n" nil t) + (setq e (point)) + (goto-char s) + (re-search-forward "# => *$" e t))))))) + (cond ((in-block "^class.+< Test::Unit::TestCase$") + (format "%s --unittest %s" xmpfilter-command-name option)) + ((in-block "^\\(describe\\|context\\).+do$") + (format "%s --spec %s" xmpfilter-command-name option)) + (t + (format "%s %s" xmpfilter-command-name option))))) + +;;;; Completion +(defvar rct-method-completion-table nil) ;internal +(defvar rct-complete-symbol-function 'rct-complete-symbol--normal + "Function to use rct-complete-symbol.") +;; (setq rct-complete-symbol-function 'rct-complete-symbol--icicles) +(defvar rct-use-test-script t + "Whether rct-complete/rct-doc use test scripts.") + +(defun rct-complete-symbol (&optional option) + "Perform ruby method and class completion on the text around point. +This command only calls a function according to `rct-complete-symbol-function'. +See also `rct-interactive', `rct-complete-symbol--normal', and `rct-complete-symbol--icicles'." + (interactive (rct-interactive)) + (call-interactively rct-complete-symbol-function)) + +(defun rct-complete-symbol--normal (&optional option) + "Perform ruby method and class completion on the text around point. +See also `rct-interactive'." + (interactive (rct-interactive)) + (let ((end (point)) beg + pattern alist + completion) + (setq completion (rct-try-completion)) ; set also pattern / completion + (save-excursion + (search-backward pattern) + (setq beg (point))) + (cond ((eq completion t) ;sole completion + (message "%s" "Sole completion")) + ((null completion) ;no completions + (message "Can't find completion for \"%s\"" pattern) + (ding)) + ((not (string= pattern completion)) ;partial completion + (delete-region beg end) ;delete word + (insert completion) + (message "")) + (t + (message "Making completion list...") + (with-output-to-temp-buffer "*Completions*" + (display-completion-list + (all-completions pattern alist))) + (message "Making completion list...%s" "done"))))) + +;; (define-key ruby-mode-map "\M-\C-i" 'rct-complete-symbol) + +(defun rct-debuglog (logmsg) + "if `rct-debug' is non-nil, output LOGMSG into *Messages*. Returns LOGMSG." + (if rct-debug + (message "%s" logmsg)) + logmsg) + +(defun rct-exec-and-eval (command opt) + "Execute rct-complete/rct-doc and evaluate the output." + (let ((eval-buffer (get-buffer-create " *rct-eval*"))) + ;; copy to temporary buffer to do completion at non-EOL. + (rct-shell-command + (format "%s %s %s --line=%d --column=%d %s" + command opt (or rct-option-local "") + (rct-current-line) + ;; specify column in BYTE + (string-bytes + (encode-coding-string + (buffer-substring (point-at-bol) (point)) + buffer-file-coding-system)) + (if rct-use-test-script (rct-test-script-option-string) "")) + eval-buffer) + (message "") + (eval (with-current-buffer eval-buffer + (goto-char 1) + (unwind-protect + (read (current-buffer)) + (unless rct-debug (kill-buffer eval-buffer))))))) + +(defun rct-test-script-option-string () + (if (null buffer-file-name) + "" + (let ((test-buf (rct-find-test-script-buffer)) + (bfn buffer-file-name) + bfn2 t-opt test-filename) + (if (and test-buf + (setq bfn2 (buffer-local-value 'buffer-file-name test-buf)) + (file-exists-p bfn2)) + ;; pass test script's filename and lineno + (with-current-buffer test-buf + (setq t-opt (format "%s@%s" buffer-file-name (rct-current-line))) + (format "-t %s --filename=%s" t-opt bfn)) + "")))) + +(require 'cl) + +(defun rct-find-test-script-buffer (&optional buffer-list) + "Find the latest used Ruby test script buffer." + (setq buffer-list (or buffer-list (buffer-list))) + (dolist (buf buffer-list) + (with-current-buffer buf + (if (and buffer-file-name (string-match "test.*\.rb$" buffer-file-name)) + (return buf))))) + +;; (defun rct-find-test-method (buffer) +;; "Find test method on point on BUFFER." +;; (with-current-buffer buffer +;; (save-excursion +;; (forward-line 1) +;; (if (re-search-backward "^ *def *\\(test_[A-Za-z0-9?!_]+\\)" nil t) +;; (match-string 1))))) + +(defun rct-try-completion () + "Evaluate the output of rct-complete." + (rct-exec-and-eval rct-complete-command-name "--completion-emacs")) + +;;;; TAGS or Ri +(autoload 'ri "ri-ruby" nil t) +(defvar rct-find-tag-if-available t + "If non-nil and the method location is in TAGS, go to the location instead of show documentation.") +(defun rct-ri (&optional option) + "Browse Ri document at the point. +If `rct-find-tag-if-available' is non-nil, search the definition using TAGS. + +See also `rct-interactive'. " + (interactive (rct-interactive)) + (rct-exec-and-eval + rct-doc-command-name + (concat "--ri-emacs --use-method-analyzer " + (if (buffer-file-name) + (concat "--filename=" (buffer-file-name)) + "")))) + +(defun rct-find-tag-or-ri (fullname) + (if (not rct-find-tag-if-available) + (ri fullname) + (condition-case err + (let () + (visit-tags-table-buffer) + (find-tag-in-order (concat "::" fullname) 'search-forward '(tag-exact-match-p) nil "containing" t)) + (error + (ri fullname))))) + +;;;; +(defun ruby-toggle-buffer () + "Open a related file to the current buffer. test<=>impl." + (interactive) + (find-file (shell-command-to-string + (format "%s %s" ruby-toggle-file-command-name buffer-file-name)))) + +;;;; rct-fork support +(defun rct-fork (options) + "Run rct-fork. +Rct-fork makes xmpfilter and completion MUCH FASTER because it pre-loads heavy libraries. +When rct-fork is running, the mode-line indicates it to avoid unnecessary run. +To kill rct-fork process, use \\[rct-fork-kill]. +" + (interactive (list + (read-string "rct-fork options (-e CODE -I LIBDIR -r LIB): " + (rct-fork-default-options)))) + (rct-fork-kill) + (rct-fork-minor-mode 1) + (start-process-shell-command + "rct-fork" "*rct-fork*" rct-fork-command-name options)) + +(defun rct-fork-default-options () + "Default options for rct-fork by collecting requires." + (mapconcat + (lambda (lib) (format "-r %s" lib)) + (save-excursion + (goto-char (point-min)) + (loop while (re-search-forward "\\ ['\"]\\([^'\"]+\\)['\"]" nil t) + collect (match-string-no-properties 1))) + " ")) + +(defun rct-fork-kill () + "Kill rct-fork process invoked by \\[rct-fork]." + (interactive) + (when rct-fork-minor-mode + (rct-fork-minor-mode -1) + (interrupt-process "rct-fork"))) +(define-minor-mode rct-fork-minor-mode + "This minor mode is turned on when rct-fork is run. +It is nothing but an indicator." + :lighter " " :global t) + +;;;; unit tests +(when (and (fboundp 'expectations)) + (require 'ruby-mode) + (require 'el-mock nil t) + (expectations + (desc "comment-dwim advice") + (expect "# =>" + (with-temp-buffer + (ruby-mode) + (setq last-command nil) + (call-interactively 'comment-dwim) + (setq last-command 'comment-dwim) + (call-interactively 'comment-dwim) + (buffer-string))) + (expect (regexp "^1 +# =>") + (with-temp-buffer + (ruby-mode) + (insert "1") + (setq last-command nil) + (call-interactively 'comment-dwim) + (setq last-command 'comment-dwim) + (call-interactively 'comment-dwim) + (buffer-string))) + + (desc "rct-current-line") + (expect 1 + (with-temp-buffer + (rct-current-line))) + (expect 1 + (with-temp-buffer + (insert "1") + (rct-current-line))) + (expect 2 + (with-temp-buffer + (insert "1\n") + (rct-current-line))) + (expect 2 + (with-temp-buffer + (insert "1\n2") + (rct-current-line))) + + (desc "rct-save-position") + (expect (mock (set-window-start * 7) => nil) + (stub window-start => 7) + (with-temp-buffer + (insert "abcdef\nghi") + (rct-save-position #'ignore))) + (expect 2 + (with-temp-buffer + (stub window-start => 1) + (stub set-window-start => nil) + (insert "abcdef\nghi") + (rct-save-position #'ignore) + (rct-current-line))) + (expect 3 + (with-temp-buffer + (stub window-start => 1) + (stub set-window-start => nil) + (insert "abcdef\nghi") + (rct-save-position #'ignore) + (current-column))) + + (desc "rct-interactive") + (expect '("read") + (let ((current-prefix-arg t)) + (stub read-from-minibuffer => "read") + (rct-interactive))) + (expect '("-S ruby19") + (let ((current-prefix-arg nil) + (rct-option-local "-S ruby19")) + (stub read-from-minibuffer => "read") + (rct-interactive))) + (expect '("") + (let ((current-prefix-arg nil) + (rct-option-local)) + (stub read-from-minibuffer => "read") + (rct-interactive))) + + (desc "rct-shell-command") + (expect "1+1 # => 2\n" + (with-temp-buffer + (insert "1+1 # =>\n") + (rct-shell-command "xmpfilter") + (buffer-string))) + + (desc "xmp") + + (desc "xmpfilter-command") + (expect "xmpfilter --rails" + (let ((xmpfilter-command-name "xmpfilter")) + (with-temp-buffer + (insert "class TestFoo < Test::Unit::TestCase\n") + (xmpfilter-command "--rails")))) + (expect "xmpfilter " + (let ((xmpfilter-command-name "xmpfilter")) + (with-temp-buffer + (insert "context 'foo' do\n") + (xmpfilter-command)))) + (expect "xmpfilter " + (let ((xmpfilter-command-name "xmpfilter")) + (with-temp-buffer + (insert "describe Array do\n") + (xmpfilter-command)))) + (expect "xmpfilter --unittest --rails" + (let ((xmpfilter-command-name "xmpfilter")) + (with-temp-buffer + (insert "class TestFoo < Test::Unit::TestCase\n" + " def test_0\n" + " 1 + 1 # =>\n" + " end\n" + "end\n") + (xmpfilter-command "--rails")))) + (expect "xmpfilter --spec " + (let ((xmpfilter-command-name "xmpfilter")) + (with-temp-buffer + (insert "context 'foo' do\n" + " specify \"foo\" do\n" + " 1 + 1 # =>\n" + " end\n" + "end\n") + (xmpfilter-command)))) + (expect "xmpfilter --spec " + (let ((xmpfilter-command-name "xmpfilter")) + (with-temp-buffer + (insert "describe Array do\n" + " it \"foo\" do\n" + " [1] + [1] # =>\n" + " end\n" + "end\n") + (xmpfilter-command)))) + (expect "xmpfilter " + (let ((xmpfilter-command-name "xmpfilter")) + (with-temp-buffer + (insert "1 + 2\n") + (xmpfilter-command)))) + + (desc "rct-fork") + (expect t + (stub start-process-shell-command => t) + (stub interrupt-process => t) + (rct-fork "-r activesupport") + rct-fork-minor-mode) + (expect nil + (stub start-process-shell-command => t) + (stub interrupt-process => t) + (rct-fork "-r activesupport") + (rct-fork-kill) + rct-fork-minor-mode) + )) + +(provide 'rcodetools) diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/rcodetools.elc b/bundles/ruby.tmbundle/Support/vendor/rcodetools/rcodetools.elc new file mode 100644 index 0000000000000000000000000000000000000000..a5c67c0ed7a63e2c7928fdd7125020fb8169e555 GIT binary patch literal 14540 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

&} zet$*pa$_Z&6&PZmYFNa2+@d3sYpvMDr=LqD@89A2M17Vdb<|fcq3Ewp2SvquI_iF! z`saT+A(gv7mUnNBMRM)r&k7PU;pH8v-u-u*YK{*IY4|PtQ1{Izd(TP#g>*MW_~*rM zZY}*awSd&~YE(EwHJ}FV7~x2t>hZI;b(s#m?agdcB@&H{Xv;=k;9mVL#ovFCj4s>E zTN4TOhG4l(LGm;brr{{W}o1;+pY literal 0 HcmV?d00001 diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/rcodetools.gif b/bundles/ruby.tmbundle/Support/vendor/rcodetools/rcodetools.gif new file mode 100644 index 0000000000000000000000000000000000000000..7c35fe78dc01862469a49c2476cbb5e5ffe2b050 GIT binary patch literal 32432 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 +" rcodetools support plugin +" + +if exists("loaded_rcodetools") + finish +endif + +let loaded_rcodetools = 1 +let s:save_cpo = &cpo +set cpo&vim + +"{{{ set s:sid + +map xx xx +let s:sid = maparg("xx") +unmap xx +let s:sid = substitute(s:sid, 'xx', '', '') + +"{{{ function: s:spellgetoption(name, default) +" grab a user-specified option to override the default provided. options are +" searched in the window, buffer, then global spaces. +function! s:GetOption(name, default) + if exists("w:{&filetype}_" . a:name) + execute "return w:{&filetype}_".a:name + elseif exists("w:" . a:name) + execute "return w:".a:name + elseif exists("b:{&filetype}_" . a:name) + execute "return b:{&filetype}_".a:name + elseif exists("b:" . a:name) + execute "return b:".a:name + elseif exists("g:{&filetype}_" . a:name) + execute "return g:{&filetype}_".a:name + elseif exists("g:" . a:name) + execute "return g:".a:name + else + return a:default + endif +endfunction + +"{{{ IsOptionSet +function! s:IsOptionSet(name) + let bogus_val = "df hdsoi3y98 hjsdfhdkj" + return s:GetOption(a:name, bogus_val) == bogus_val ? 0 : 1 +endfunction + + +"{{{ RCT_completion function + +let s:last_test_file = "" +let s:last_test_lineno = 0 + +let s:rct_completion_col = 0 +let s:rct_tmpfile = "" + +function! RCT_command_with_test_options(cmd) + if s:last_test_file != "" + return a:cmd . + \ "-" . "-filename='" . expand("%:p") . "' " . + \ "-t '" . s:last_test_file . "@" . s:last_test_lineno . "' " + endif + return a:cmd +endfunction + +function! RCT_completion(findstart, base) + if a:findstart + let s:rct_completion_col = col('.') - 1 + let s:rct_tmpfile = "tmp-rcodetools" . strftime("Y-%m-%d-%H-%M-%S.rb") + silent exec ":w " . s:rct_tmpfile + return strridx(getline('.'), '.', col('.')) + 1 + else + let line = line('.') + let column = s:rct_completion_col + + let command = "rct-complete --completion-class-info --dev --fork --line=" . + \ line . " --column=" . column . " " + let command = RCT_command_with_test_options(command) . s:rct_tmpfile + + let data = split(system(command), '\n') + + for dline in data + let parts = split(dline, "\t") + let name = get(parts, 0) + let selector = get(parts, 1) + echo name + echo selector + if s:GetOption('rct_completion_use_fri', 0) && s:GetOption('rct_completion_info_max_len', 20) >= len(data) + let fri_data = system('fri -f plain ' . "'" . selector . "'" . ' 2>/dev/null') + call complete_add({'word': name, + \ 'menu': get(split(fri_data), 2, ''), + \ 'info': fri_data } ) + else + call complete_add(name) + endif + if complete_check() + break + endif + endfor + + call delete(s:rct_tmpfile) + return [] + endif +endfunction + +"{{{ ri functions + +function! RCT_new_ri_window() + execute "new" + execute "set bufhidden=delete buftype=nofile noswapfile nobuflisted" + execute 'nmap 2u' + execute 'nmap :call' . s:sid . 'RCT_execute_ri(expand(""))' +endfunction + +function! RCT_execute_ri(query_term) + silent %delete _ + let term = matchstr(a:query_term, '\v[^,.;]+') + let cmd = s:GetOption("RCT_ri_cmd", "fri -f plain ") + let text = system(cmd . "'" . term . "'") + call append(0, split(text, "\n")) + normal gg +endfunction + +function! RCT_find_tag_or_ri(fullname) + " rubikitch: modified for rtags-compatible tags + let tagname = '::' . a:fullname + let tagresults = taglist(tagname) + if len(tagresults) != 0 + execute "tjump " . tagname + else + call RCT_new_ri_window() + call RCT_execute_ri(a:fullname) + endif +endfunction + +function! RCT_smart_ri() + let tmpfile = "tmp-rcodetools" . strftime("Y-%m-%d-%H-%M-%S.rb") + silent exec ":w " . tmpfile + + let line = line('.') + let column = col('.') - 1 + let command = "rct-doc --ri-vim --line=" . line . " --column=" . column . " " + let command = RCT_command_with_test_options(command) . tmpfile + "let term = matchstr(system(command), "\\v[^\n]+") + exec system(command) + call delete(tmpfile) + "call RCT_find_tag_or_ri(term) +endfunction + +function! RCT_ruby_toggle() + let curr_file = expand("%:p") + let cmd = "ruby -S ruby-toggle-file " . curr_file + if match(curr_file, '\v_test|test_') != -1 + let s:last_test_file = curr_file + let s:last_test_lineno = line(".") + endif + let dest = system(cmd) + silent exec ":w" + exec ("edit " . dest) + silent! normal g; +endfunction + +"{{{ bindings and au + +if v:version >= 700 + execute "au Filetype ruby setlocal completefunc=" . s:sid . "RCT_completion" +endif +execute 'au Filetype ruby nmap :exec "call ' . + \ 'RCT_find_tag_or_ri(''" . expand("") . "'')"' +execute 'au Filetype ruby nmap ' . s:GetOption("RCT_ri_binding", "r") . + \ ' :call ' . s:sid . 'RCT_smart_ri()' +execute 'au Filetype ruby nmap ' . s:GetOption("RCT_toggle_binding", "t") . + \ ' :call ' . s:sid . 'RCT_ruby_toggle()' +let &cpo = s:save_cpo diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/setup.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/setup.rb new file mode 100644 index 000000000..424a5f37c --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/setup.rb @@ -0,0 +1,1585 @@ +# +# setup.rb +# +# Copyright (c) 2000-2005 Minero Aoki +# +# This program is free software. +# You can distribute/modify this program under the terms of +# the GNU LGPL, Lesser General Public License version 2.1. +# + +unless Enumerable.method_defined?(:map) # Ruby 1.4.6 + module Enumerable + alias map collect + end +end + +unless File.respond_to?(:read) # Ruby 1.6 + def File.read(fname) + open(fname) {|f| + return f.read + } + end +end + +unless Errno.const_defined?(:ENOTEMPTY) # Windows? + module Errno + class ENOTEMPTY + # We do not raise this exception, implementation is not needed. + end + end +end + +def File.binread(fname) + open(fname, 'rb') {|f| + return f.read + } +end + +# for corrupted Windows' stat(2) +def File.dir?(path) + File.directory?((path[-1,1] == '/') ? path : path + '/') +end + + +class ConfigTable + + include Enumerable + + def initialize(rbconfig) + @rbconfig = rbconfig + @items = [] + @table = {} + # options + @install_prefix = nil + @config_opt = nil + @verbose = true + @no_harm = false + end + + attr_accessor :install_prefix + attr_accessor :config_opt + + attr_writer :verbose + + def verbose? + @verbose + end + + attr_writer :no_harm + + def no_harm? + @no_harm + end + + def [](key) + lookup(key).resolve(self) + end + + def []=(key, val) + lookup(key).set val + end + + def names + @items.map {|i| i.name } + end + + def each(&block) + @items.each(&block) + end + + def key?(name) + @table.key?(name) + end + + def lookup(name) + @table[name] or setup_rb_error "no such config item: #{name}" + end + + def add(item) + @items.push item + @table[item.name] = item + end + + def remove(name) + item = lookup(name) + @items.delete_if {|i| i.name == name } + @table.delete_if {|name, i| i.name == name } + item + end + + def load_script(path, inst = nil) + if File.file?(path) + MetaConfigEnvironment.new(self, inst).instance_eval File.read(path), path + end + end + + def savefile + '.config' + end + + def load_savefile + begin + File.foreach(savefile()) do |line| + k, v = *line.split(/=/, 2) + self[k] = v.strip + end + rescue Errno::ENOENT + setup_rb_error $!.message + "\n#{File.basename($0)} config first" + end + end + + def save + @items.each {|i| i.value } + File.open(savefile(), 'w') {|f| + @items.each do |i| + f.printf "%s=%s\n", i.name, i.value if i.value? and i.value + end + } + end + + def load_standard_entries + standard_entries(@rbconfig).each do |ent| + add ent + end + end + + def standard_entries(rbconfig) + c = rbconfig + + rubypath = File.join(c['bindir'], c['ruby_install_name'] + c['EXEEXT']) + + major = c['MAJOR'].to_i + minor = c['MINOR'].to_i + teeny = c['TEENY'].to_i + version = "#{major}.#{minor}" + + # ruby ver. >= 1.4.4? + newpath_p = ((major >= 2) or + ((major == 1) and + ((minor >= 5) or + ((minor == 4) and (teeny >= 4))))) + + if c['rubylibdir'] + # V > 1.6.3 + libruby = "#{c['prefix']}/lib/ruby" + librubyver = c['rubylibdir'] + librubyverarch = c['archdir'] + siteruby = c['sitedir'] + siterubyver = c['sitelibdir'] + siterubyverarch = c['sitearchdir'] + elsif newpath_p + # 1.4.4 <= V <= 1.6.3 + libruby = "#{c['prefix']}/lib/ruby" + librubyver = "#{c['prefix']}/lib/ruby/#{version}" + librubyverarch = "#{c['prefix']}/lib/ruby/#{version}/#{c['arch']}" + siteruby = c['sitedir'] + siterubyver = "$siteruby/#{version}" + siterubyverarch = "$siterubyver/#{c['arch']}" + else + # V < 1.4.4 + libruby = "#{c['prefix']}/lib/ruby" + librubyver = "#{c['prefix']}/lib/ruby/#{version}" + librubyverarch = "#{c['prefix']}/lib/ruby/#{version}/#{c['arch']}" + siteruby = "#{c['prefix']}/lib/ruby/#{version}/site_ruby" + siterubyver = siteruby + siterubyverarch = "$siterubyver/#{c['arch']}" + end + parameterize = lambda {|path| + path.sub(/\A#{Regexp.quote(c['prefix'])}/, '$prefix') + } + + if arg = c['configure_args'].split.detect {|arg| /--with-make-prog=/ =~ arg } + makeprog = arg.sub(/'/, '').split(/=/, 2)[1] + else + makeprog = 'make' + end + + [ + ExecItem.new('installdirs', 'std/site/home', + 'std: install under libruby; site: install under site_ruby; home: install under $HOME')\ + {|val, table| + case val + when 'std' + table['rbdir'] = '$librubyver' + table['sodir'] = '$librubyverarch' + when 'site' + table['rbdir'] = '$siterubyver' + table['sodir'] = '$siterubyverarch' + when 'home' + setup_rb_error '$HOME was not set' unless ENV['HOME'] + table['prefix'] = ENV['HOME'] + table['rbdir'] = '$libdir/ruby' + table['sodir'] = '$libdir/ruby' + end + }, + PathItem.new('prefix', 'path', c['prefix'], + 'path prefix of target environment'), + PathItem.new('bindir', 'path', parameterize.call(c['bindir']), + 'the directory for commands'), + PathItem.new('libdir', 'path', parameterize.call(c['libdir']), + 'the directory for libraries'), + PathItem.new('datadir', 'path', parameterize.call(c['datadir']), + 'the directory for shared data'), + PathItem.new('mandir', 'path', parameterize.call(c['mandir']), + 'the directory for man pages'), + PathItem.new('sysconfdir', 'path', parameterize.call(c['sysconfdir']), + 'the directory for system configuration files'), + PathItem.new('localstatedir', 'path', parameterize.call(c['localstatedir']), + 'the directory for local state data'), + PathItem.new('libruby', 'path', libruby, + 'the directory for ruby libraries'), + PathItem.new('librubyver', 'path', librubyver, + 'the directory for standard ruby libraries'), + PathItem.new('librubyverarch', 'path', librubyverarch, + 'the directory for standard ruby extensions'), + PathItem.new('siteruby', 'path', siteruby, + 'the directory for version-independent aux ruby libraries'), + PathItem.new('siterubyver', 'path', siterubyver, + 'the directory for aux ruby libraries'), + PathItem.new('siterubyverarch', 'path', siterubyverarch, + 'the directory for aux ruby binaries'), + PathItem.new('rbdir', 'path', '$siterubyver', + 'the directory for ruby scripts'), + PathItem.new('sodir', 'path', '$siterubyverarch', + 'the directory for ruby extentions'), + PathItem.new('rubypath', 'path', rubypath, + 'the path to set to #! line'), + ProgramItem.new('rubyprog', 'name', rubypath, + 'the ruby program using for installation'), + ProgramItem.new('makeprog', 'name', makeprog, + 'the make program to compile ruby extentions'), + SelectItem.new('shebang', 'all/ruby/never', 'ruby', + 'shebang line (#!) editing mode'), + BoolItem.new('without-ext', 'yes/no', 'no', + 'does not compile/install ruby extentions') + ] + end + private :standard_entries + + def load_multipackage_entries + multipackage_entries().each do |ent| + add ent + end + end + + def multipackage_entries + [ + PackageSelectionItem.new('with', 'name,name...', '', 'ALL', + 'package names that you want to install'), + PackageSelectionItem.new('without', 'name,name...', '', 'NONE', + 'package names that you do not want to install') + ] + end + private :multipackage_entries + + ALIASES = { + 'std-ruby' => 'librubyver', + 'stdruby' => 'librubyver', + 'rubylibdir' => 'librubyver', + 'archdir' => 'librubyverarch', + 'site-ruby-common' => 'siteruby', # For backward compatibility + 'site-ruby' => 'siterubyver', # For backward compatibility + 'bin-dir' => 'bindir', + 'bin-dir' => 'bindir', + 'rb-dir' => 'rbdir', + 'so-dir' => 'sodir', + 'data-dir' => 'datadir', + 'ruby-path' => 'rubypath', + 'ruby-prog' => 'rubyprog', + 'ruby' => 'rubyprog', + 'make-prog' => 'makeprog', + 'make' => 'makeprog' + } + + def fixup + ALIASES.each do |ali, name| + @table[ali] = @table[name] + end + @items.freeze + @table.freeze + @options_re = /\A--(#{@table.keys.join('|')})(?:=(.*))?\z/ + end + + def parse_opt(opt) + m = @options_re.match(opt) or setup_rb_error "config: unknown option #{opt}" + m.to_a[1,2] + end + + def dllext + @rbconfig['DLEXT'] + end + + def value_config?(name) + lookup(name).value? + end + + class Item + def initialize(name, template, default, desc) + @name = name.freeze + @template = template + @value = default + @default = default + @description = desc + end + + attr_reader :name + attr_reader :description + + attr_accessor :default + alias help_default default + + def help_opt + "--#{@name}=#{@template}" + end + + def value? + true + end + + def value + @value + end + + def resolve(table) + @value.gsub(%r<\$([^/]+)>) { table[$1] } + end + + def set(val) + @value = check(val) + end + + private + + def check(val) + setup_rb_error "config: --#{name} requires argument" unless val + val + end + end + + class BoolItem < Item + def config_type + 'bool' + end + + def help_opt + "--#{@name}" + end + + private + + def check(val) + return 'yes' unless val + case val + when /\Ay(es)?\z/i, /\At(rue)?\z/i then 'yes' + when /\An(o)?\z/i, /\Af(alse)\z/i then 'no' + else + setup_rb_error "config: --#{@name} accepts only yes/no for argument" + end + end + end + + class PathItem < Item + def config_type + 'path' + end + + private + + def check(path) + setup_rb_error "config: --#{@name} requires argument" unless path + path[0,1] == '$' ? path : File.expand_path(path) + end + end + + class ProgramItem < Item + def config_type + 'program' + end + end + + class SelectItem < Item + def initialize(name, selection, default, desc) + super + @ok = selection.split('/') + end + + def config_type + 'select' + end + + private + + def check(val) + unless @ok.include?(val.strip) + setup_rb_error "config: use --#{@name}=#{@template} (#{val})" + end + val.strip + end + end + + class ExecItem < Item + def initialize(name, selection, desc, &block) + super name, selection, nil, desc + @ok = selection.split('/') + @action = block + end + + def config_type + 'exec' + end + + def value? + false + end + + def resolve(table) + setup_rb_error "$#{name()} wrongly used as option value" + end + + undef set + + def evaluate(val, table) + v = val.strip.downcase + unless @ok.include?(v) + setup_rb_error "invalid option --#{@name}=#{val} (use #{@template})" + end + @action.call v, table + end + end + + class PackageSelectionItem < Item + def initialize(name, template, default, help_default, desc) + super name, template, default, desc + @help_default = help_default + end + + attr_reader :help_default + + def config_type + 'package' + end + + private + + def check(val) + unless File.dir?("packages/#{val}") + setup_rb_error "config: no such package: #{val}" + end + val + end + end + + class MetaConfigEnvironment + def initialize(config, installer) + @config = config + @installer = installer + end + + def config_names + @config.names + end + + def config?(name) + @config.key?(name) + end + + def bool_config?(name) + @config.lookup(name).config_type == 'bool' + end + + def path_config?(name) + @config.lookup(name).config_type == 'path' + end + + def value_config?(name) + @config.lookup(name).config_type != 'exec' + end + + def add_config(item) + @config.add item + end + + def add_bool_config(name, default, desc) + @config.add BoolItem.new(name, 'yes/no', default ? 'yes' : 'no', desc) + end + + def add_path_config(name, default, desc) + @config.add PathItem.new(name, 'path', default, desc) + end + + def set_config_default(name, default) + @config.lookup(name).default = default + end + + def remove_config(name) + @config.remove(name) + end + + # For only multipackage + def packages + raise '[setup.rb fatal] multi-package metaconfig API packages() called for single-package; contact application package vendor' unless @installer + @installer.packages + end + + # For only multipackage + def declare_packages(list) + raise '[setup.rb fatal] multi-package metaconfig API declare_packages() called for single-package; contact application package vendor' unless @installer + @installer.packages = list + end + end + +end # class ConfigTable + + +# This module requires: #verbose?, #no_harm? +module FileOperations + + def mkdir_p(dirname, prefix = nil) + dirname = prefix + File.expand_path(dirname) if prefix + $stderr.puts "mkdir -p #{dirname}" if verbose? + return if no_harm? + + # Does not check '/', it's too abnormal. + dirs = File.expand_path(dirname).split(%r<(?=/)>) + if /\A[a-z]:\z/i =~ dirs[0] + disk = dirs.shift + dirs[0] = disk + dirs[0] + end + dirs.each_index do |idx| + path = dirs[0..idx].join('') + Dir.mkdir path unless File.dir?(path) + end + end + + def rm_f(path) + $stderr.puts "rm -f #{path}" if verbose? + return if no_harm? + force_remove_file path + end + + def rm_rf(path) + $stderr.puts "rm -rf #{path}" if verbose? + return if no_harm? + remove_tree path + end + + def remove_tree(path) + if File.symlink?(path) + remove_file path + elsif File.dir?(path) + remove_tree0 path + else + force_remove_file path + end + end + + def remove_tree0(path) + Dir.foreach(path) do |ent| + next if ent == '.' + next if ent == '..' + entpath = "#{path}/#{ent}" + if File.symlink?(entpath) + remove_file entpath + elsif File.dir?(entpath) + remove_tree0 entpath + else + force_remove_file entpath + end + end + begin + Dir.rmdir path + rescue Errno::ENOTEMPTY + # directory may not be empty + end + end + + def move_file(src, dest) + force_remove_file dest + begin + File.rename src, dest + rescue + File.open(dest, 'wb') {|f| + f.write File.binread(src) + } + File.chmod File.stat(src).mode, dest + File.unlink src + end + end + + def force_remove_file(path) + begin + remove_file path + rescue + end + end + + def remove_file(path) + File.chmod 0777, path + File.unlink path + end + + def install(from, dest, mode, prefix = nil) + $stderr.puts "install #{from} #{dest}" if verbose? + return if no_harm? + + realdest = prefix ? prefix + File.expand_path(dest) : dest + realdest = File.join(realdest, File.basename(from)) if File.dir?(realdest) + str = File.binread(from) + if diff?(str, realdest) + verbose_off { + rm_f realdest if File.exist?(realdest) + } + File.open(realdest, 'wb') {|f| + f.write str + } + File.chmod mode, realdest + + File.open("#{objdir_root()}/InstalledFiles", 'a') {|f| + if prefix + f.puts realdest.sub(prefix, '') + else + f.puts realdest + end + } + end + end + + def diff?(new_content, path) + return true unless File.exist?(path) + new_content != File.binread(path) + end + + def command(*args) + $stderr.puts args.join(' ') if verbose? + system(*args) or raise RuntimeError, + "system(#{args.map{|a| a.inspect }.join(' ')}) failed" + end + + def ruby(*args) + command config('rubyprog'), *args + end + + def make(task = nil) + command(*[config('makeprog'), task].compact) + end + + def extdir?(dir) + File.exist?("#{dir}/MANIFEST") or File.exist?("#{dir}/extconf.rb") + end + + def files_of(dir) + Dir.open(dir) {|d| + return d.select {|ent| File.file?("#{dir}/#{ent}") } + } + end + + DIR_REJECT = %w( . .. CVS SCCS RCS CVS.adm .svn ) + + def directories_of(dir) + Dir.open(dir) {|d| + return d.select {|ent| File.dir?("#{dir}/#{ent}") } - DIR_REJECT + } + end + +end + + +# This module requires: #srcdir_root, #objdir_root, #relpath +module HookScriptAPI + + def get_config(key) + @config[key] + end + + alias config get_config + + # obsolete: use metaconfig to change configuration + def set_config(key, val) + @config[key] = val + end + + # + # srcdir/objdir (works only in the package directory) + # + + def curr_srcdir + "#{srcdir_root()}/#{relpath()}" + end + + def curr_objdir + "#{objdir_root()}/#{relpath()}" + end + + def srcfile(path) + "#{curr_srcdir()}/#{path}" + end + + def srcexist?(path) + File.exist?(srcfile(path)) + end + + def srcdirectory?(path) + File.dir?(srcfile(path)) + end + + def srcfile?(path) + File.file?(srcfile(path)) + end + + def srcentries(path = '.') + Dir.open("#{curr_srcdir()}/#{path}") {|d| + return d.to_a - %w(. ..) + } + end + + def srcfiles(path = '.') + srcentries(path).select {|fname| + File.file?(File.join(curr_srcdir(), path, fname)) + } + end + + def srcdirectories(path = '.') + srcentries(path).select {|fname| + File.dir?(File.join(curr_srcdir(), path, fname)) + } + end + +end + + +class ToplevelInstaller + + Version = '3.4.1' + Copyright = 'Copyright (c) 2000-2005 Minero Aoki' + + TASKS = [ + [ 'all', 'do config, setup, then install' ], + [ 'config', 'saves your configurations' ], + [ 'show', 'shows current configuration' ], + [ 'setup', 'compiles ruby extentions and others' ], + [ 'install', 'installs files' ], + [ 'test', 'run all tests in test/' ], + [ 'clean', "does `make clean' for each extention" ], + [ 'distclean',"does `make distclean' for each extention" ] + ] + + def ToplevelInstaller.invoke + config = ConfigTable.new(load_rbconfig()) + config.load_standard_entries + config.load_multipackage_entries if multipackage? + config.fixup + klass = (multipackage?() ? ToplevelInstallerMulti : ToplevelInstaller) + klass.new(File.dirname($0), config).invoke + end + + def ToplevelInstaller.multipackage? + File.dir?(File.dirname($0) + '/packages') + end + + def ToplevelInstaller.load_rbconfig + if arg = ARGV.detect {|arg| /\A--rbconfig=/ =~ arg } + ARGV.delete(arg) + load File.expand_path(arg.split(/=/, 2)[1]) + $".push 'rbconfig.rb' + else + require 'rbconfig' + end + ::Config::CONFIG + end + + def initialize(ardir_root, config) + @ardir = File.expand_path(ardir_root) + @config = config + # cache + @valid_task_re = nil + end + + def config(key) + @config[key] + end + + def inspect + "#<#{self.class} #{__id__()}>" + end + + def invoke + run_metaconfigs + case task = parsearg_global() + when nil, 'all' + parsearg_config + init_installers + exec_config + exec_setup + exec_install + else + case task + when 'config', 'test' + ; + when 'clean', 'distclean' + @config.load_savefile if File.exist?(@config.savefile) + else + @config.load_savefile + end + __send__ "parsearg_#{task}" + init_installers + __send__ "exec_#{task}" + end + end + + def run_metaconfigs + @config.load_script "#{@ardir}/metaconfig" + end + + def init_installers + @installer = Installer.new(@config, @ardir, File.expand_path('.')) + end + + # + # Hook Script API bases + # + + def srcdir_root + @ardir + end + + def objdir_root + '.' + end + + def relpath + '.' + end + + # + # Option Parsing + # + + def parsearg_global + while arg = ARGV.shift + case arg + when /\A\w+\z/ + setup_rb_error "invalid task: #{arg}" unless valid_task?(arg) + return arg + when '-q', '--quiet' + @config.verbose = false + when '--verbose' + @config.verbose = true + when '--help' + print_usage $stdout + exit 0 + when '--version' + puts "#{File.basename($0)} version #{Version}" + exit 0 + when '--copyright' + puts Copyright + exit 0 + else + setup_rb_error "unknown global option '#{arg}'" + end + end + nil + end + + def valid_task?(t) + valid_task_re() =~ t + end + + def valid_task_re + @valid_task_re ||= /\A(?:#{TASKS.map {|task,desc| task }.join('|')})\z/ + end + + def parsearg_no_options + unless ARGV.empty? + task = caller(0).first.slice(%r<`parsearg_(\w+)'>, 1) + setup_rb_error "#{task}: unknown options: #{ARGV.join(' ')}" + end + end + + alias parsearg_show parsearg_no_options + alias parsearg_setup parsearg_no_options + alias parsearg_test parsearg_no_options + alias parsearg_clean parsearg_no_options + alias parsearg_distclean parsearg_no_options + + def parsearg_config + evalopt = [] + set = [] + @config.config_opt = [] + while i = ARGV.shift + if /\A--?\z/ =~ i + @config.config_opt = ARGV.dup + break + end + name, value = *@config.parse_opt(i) + if @config.value_config?(name) + @config[name] = value + else + evalopt.push [name, value] + end + set.push name + end + evalopt.each do |name, value| + @config.lookup(name).evaluate value, @config + end + # Check if configuration is valid + set.each do |n| + @config[n] if @config.value_config?(n) + end + end + + def parsearg_install + @config.no_harm = false + @config.install_prefix = '' + while a = ARGV.shift + case a + when '--no-harm' + @config.no_harm = true + when /\A--prefix=/ + path = a.split(/=/, 2)[1] + path = File.expand_path(path) unless path[0,1] == '/' + @config.install_prefix = path + else + setup_rb_error "install: unknown option #{a}" + end + end + end + + def print_usage(out) + out.puts 'Typical Installation Procedure:' + out.puts " $ ruby #{File.basename $0} config" + out.puts " $ ruby #{File.basename $0} setup" + out.puts " # ruby #{File.basename $0} install (may require root privilege)" + out.puts + out.puts 'Detailed Usage:' + out.puts " ruby #{File.basename $0} " + out.puts " ruby #{File.basename $0} [] []" + + fmt = " %-24s %s\n" + out.puts + out.puts 'Global options:' + out.printf fmt, '-q,--quiet', 'suppress message outputs' + out.printf fmt, ' --verbose', 'output messages verbosely' + out.printf fmt, ' --help', 'print this message' + out.printf fmt, ' --version', 'print version and quit' + out.printf fmt, ' --copyright', 'print copyright and quit' + out.puts + out.puts 'Tasks:' + TASKS.each do |name, desc| + out.printf fmt, name, desc + end + + fmt = " %-24s %s [%s]\n" + out.puts + out.puts 'Options for CONFIG or ALL:' + @config.each do |item| + out.printf fmt, item.help_opt, item.description, item.help_default + end + out.printf fmt, '--rbconfig=path', 'rbconfig.rb to load',"running ruby's" + out.puts + out.puts 'Options for INSTALL:' + out.printf fmt, '--no-harm', 'only display what to do if given', 'off' + out.printf fmt, '--prefix=path', 'install path prefix', '' + out.puts + end + + # + # Task Handlers + # + + def exec_config + @installer.exec_config + @config.save # must be final + end + + def exec_setup + @installer.exec_setup + end + + def exec_install + @installer.exec_install + end + + def exec_test + @installer.exec_test + end + + def exec_show + @config.each do |i| + printf "%-20s %s\n", i.name, i.value if i.value? + end + end + + def exec_clean + @installer.exec_clean + end + + def exec_distclean + @installer.exec_distclean + end + +end # class ToplevelInstaller + + +class ToplevelInstallerMulti < ToplevelInstaller + + include FileOperations + + def initialize(ardir_root, config) + super + @packages = directories_of("#{@ardir}/packages") + raise 'no package exists' if @packages.empty? + @root_installer = Installer.new(@config, @ardir, File.expand_path('.')) + end + + def run_metaconfigs + @config.load_script "#{@ardir}/metaconfig", self + @packages.each do |name| + @config.load_script "#{@ardir}/packages/#{name}/metaconfig" + end + end + + attr_reader :packages + + def packages=(list) + raise 'package list is empty' if list.empty? + list.each do |name| + raise "directory packages/#{name} does not exist"\ + unless File.dir?("#{@ardir}/packages/#{name}") + end + @packages = list + end + + def init_installers + @installers = {} + @packages.each do |pack| + @installers[pack] = Installer.new(@config, + "#{@ardir}/packages/#{pack}", + "packages/#{pack}") + end + with = extract_selection(config('with')) + without = extract_selection(config('without')) + @selected = @installers.keys.select {|name| + (with.empty? or with.include?(name)) \ + and not without.include?(name) + } + end + + def extract_selection(list) + a = list.split(/,/) + a.each do |name| + setup_rb_error "no such package: #{name}" unless @installers.key?(name) + end + a + end + + def print_usage(f) + super + f.puts 'Inluded packages:' + f.puts ' ' + @packages.sort.join(' ') + f.puts + end + + # + # Task Handlers + # + + def exec_config + run_hook 'pre-config' + each_selected_installers {|inst| inst.exec_config } + run_hook 'post-config' + @config.save # must be final + end + + def exec_setup + run_hook 'pre-setup' + each_selected_installers {|inst| inst.exec_setup } + run_hook 'post-setup' + end + + def exec_install + run_hook 'pre-install' + each_selected_installers {|inst| inst.exec_install } + run_hook 'post-install' + end + + def exec_test + run_hook 'pre-test' + each_selected_installers {|inst| inst.exec_test } + run_hook 'post-test' + end + + def exec_clean + rm_f @config.savefile + run_hook 'pre-clean' + each_selected_installers {|inst| inst.exec_clean } + run_hook 'post-clean' + end + + def exec_distclean + rm_f @config.savefile + run_hook 'pre-distclean' + each_selected_installers {|inst| inst.exec_distclean } + run_hook 'post-distclean' + end + + # + # lib + # + + def each_selected_installers + Dir.mkdir 'packages' unless File.dir?('packages') + @selected.each do |pack| + $stderr.puts "Processing the package `#{pack}' ..." if verbose? + Dir.mkdir "packages/#{pack}" unless File.dir?("packages/#{pack}") + Dir.chdir "packages/#{pack}" + yield @installers[pack] + Dir.chdir '../..' + end + end + + def run_hook(id) + @root_installer.run_hook id + end + + # module FileOperations requires this + def verbose? + @config.verbose? + end + + # module FileOperations requires this + def no_harm? + @config.no_harm? + end + +end # class ToplevelInstallerMulti + + +class Installer + + FILETYPES = %w( bin lib ext data conf man ) + + include FileOperations + include HookScriptAPI + + def initialize(config, srcroot, objroot) + @config = config + @srcdir = File.expand_path(srcroot) + @objdir = File.expand_path(objroot) + @currdir = '.' + end + + def inspect + "#<#{self.class} #{File.basename(@srcdir)}>" + end + + def noop(rel) + end + + # + # Hook Script API base methods + # + + def srcdir_root + @srcdir + end + + def objdir_root + @objdir + end + + def relpath + @currdir + end + + # + # Config Access + # + + # module FileOperations requires this + def verbose? + @config.verbose? + end + + # module FileOperations requires this + def no_harm? + @config.no_harm? + end + + def verbose_off + begin + save, @config.verbose = @config.verbose?, false + yield + ensure + @config.verbose = save + end + end + + # + # TASK config + # + + def exec_config + exec_task_traverse 'config' + end + + alias config_dir_bin noop + alias config_dir_lib noop + + def config_dir_ext(rel) + extconf if extdir?(curr_srcdir()) + end + + alias config_dir_data noop + alias config_dir_conf noop + alias config_dir_man noop + + def extconf + ruby "#{curr_srcdir()}/extconf.rb", *@config.config_opt + end + + # + # TASK setup + # + + def exec_setup + exec_task_traverse 'setup' + end + + def setup_dir_bin(rel) + files_of(curr_srcdir()).each do |fname| + update_shebang_line "#{curr_srcdir()}/#{fname}" + end + end + + alias setup_dir_lib noop + + def setup_dir_ext(rel) + make if extdir?(curr_srcdir()) + end + + alias setup_dir_data noop + alias setup_dir_conf noop + alias setup_dir_man noop + + def update_shebang_line(path) + return if no_harm? + return if config('shebang') == 'never' + old = Shebang.load(path) + if old + $stderr.puts "warning: #{path}: Shebang line includes too many args. It is not portable and your program may not work." if old.args.size > 1 + new = new_shebang(old) + return if new.to_s == old.to_s + else + return unless config('shebang') == 'all' + new = Shebang.new(config('rubypath')) + end + $stderr.puts "updating shebang: #{File.basename(path)}" if verbose? + open_atomic_writer(path) {|output| + File.open(path, 'rb') {|f| + f.gets if old # discard + output.puts new.to_s + output.print f.read + } + } + end + + def new_shebang(old) + if /\Aruby/ =~ File.basename(old.cmd) + Shebang.new(config('rubypath'), old.args) + elsif File.basename(old.cmd) == 'env' and old.args.first == 'ruby' + Shebang.new(config('rubypath'), old.args[1..-1]) + else + return old unless config('shebang') == 'all' + Shebang.new(config('rubypath')) + end + end + + def open_atomic_writer(path, &block) + tmpfile = File.basename(path) + '.tmp' + begin + File.open(tmpfile, 'wb', &block) + File.rename tmpfile, File.basename(path) + ensure + File.unlink tmpfile if File.exist?(tmpfile) + end + end + + class Shebang + def Shebang.load(path) + line = nil + File.open(path) {|f| + line = f.gets + } + return nil unless /\A#!/ =~ line + parse(line) + end + + def Shebang.parse(line) + cmd, *args = *line.strip.sub(/\A\#!/, '').split(' ') + new(cmd, args) + end + + def initialize(cmd, args = []) + @cmd = cmd + @args = args + end + + attr_reader :cmd + attr_reader :args + + def to_s + "#! #{@cmd}" + (@args.empty? ? '' : " #{@args.join(' ')}") + end + end + + # + # TASK install + # + + def exec_install + rm_f 'InstalledFiles' + exec_task_traverse 'install' + end + + def install_dir_bin(rel) + install_files targetfiles(), "#{config('bindir')}/#{rel}", 0755 + end + + def install_dir_lib(rel) + install_files libfiles(), "#{config('rbdir')}/#{rel}", 0644 + end + + def install_dir_ext(rel) + return unless extdir?(curr_srcdir()) + install_files rubyextentions('.'), + "#{config('sodir')}/#{File.dirname(rel)}", + 0555 + end + + def install_dir_data(rel) + install_files targetfiles(), "#{config('datadir')}/#{rel}", 0644 + end + + def install_dir_conf(rel) + # FIXME: should not remove current config files + # (rename previous file to .old/.org) + install_files targetfiles(), "#{config('sysconfdir')}/#{rel}", 0644 + end + + def install_dir_man(rel) + install_files targetfiles(), "#{config('mandir')}/#{rel}", 0644 + end + + def install_files(list, dest, mode) + mkdir_p dest, @config.install_prefix + list.each do |fname| + install fname, dest, mode, @config.install_prefix + end + end + + def libfiles + glob_reject(%w(*.y *.output), targetfiles()) + end + + def rubyextentions(dir) + ents = glob_select("*.#{@config.dllext}", targetfiles()) + if ents.empty? + setup_rb_error "no ruby extention exists: 'ruby #{$0} setup' first" + end + ents + end + + def targetfiles + mapdir(existfiles() - hookfiles()) + end + + def mapdir(ents) + ents.map {|ent| + if File.exist?(ent) + then ent # objdir + else "#{curr_srcdir()}/#{ent}" # srcdir + end + } + end + + # picked up many entries from cvs-1.11.1/src/ignore.c + JUNK_FILES = %w( + core RCSLOG tags TAGS .make.state + .nse_depinfo #* .#* cvslog.* ,* .del-* *.olb + *~ *.old *.bak *.BAK *.orig *.rej _$* *$ + + *.org *.in .* + ) + + def existfiles + glob_reject(JUNK_FILES, (files_of(curr_srcdir()) | files_of('.'))) + end + + def hookfiles + %w( pre-%s post-%s pre-%s.rb post-%s.rb ).map {|fmt| + %w( config setup install clean ).map {|t| sprintf(fmt, t) } + }.flatten + end + + def glob_select(pat, ents) + re = globs2re([pat]) + ents.select {|ent| re =~ ent } + end + + def glob_reject(pats, ents) + re = globs2re(pats) + ents.reject {|ent| re =~ ent } + end + + GLOB2REGEX = { + '.' => '\.', + '$' => '\$', + '#' => '\#', + '*' => '.*' + } + + def globs2re(pats) + /\A(?:#{ + pats.map {|pat| pat.gsub(/[\.\$\#\*]/) {|ch| GLOB2REGEX[ch] } }.join('|') + })\z/ + end + + # + # TASK test + # + + TESTDIR = 'test' + + def exec_test + unless File.directory?('test') + $stderr.puts 'no test in this package' if verbose? + return + end + $stderr.puts 'Running tests...' if verbose? + begin + require 'test/unit' + rescue LoadError + setup_rb_error 'test/unit cannot loaded. You need Ruby 1.8 or later to invoke this task.' + end + runner = Test::Unit::AutoRunner.new(true) + runner.to_run << TESTDIR + runner.run + end + + # + # TASK clean + # + + def exec_clean + exec_task_traverse 'clean' + rm_f @config.savefile + rm_f 'InstalledFiles' + end + + alias clean_dir_bin noop + alias clean_dir_lib noop + alias clean_dir_data noop + alias clean_dir_conf noop + alias clean_dir_man noop + + def clean_dir_ext(rel) + return unless extdir?(curr_srcdir()) + make 'clean' if File.file?('Makefile') + end + + # + # TASK distclean + # + + def exec_distclean + exec_task_traverse 'distclean' + rm_f @config.savefile + rm_f 'InstalledFiles' + end + + alias distclean_dir_bin noop + alias distclean_dir_lib noop + + def distclean_dir_ext(rel) + return unless extdir?(curr_srcdir()) + make 'distclean' if File.file?('Makefile') + end + + alias distclean_dir_data noop + alias distclean_dir_conf noop + alias distclean_dir_man noop + + # + # Traversing + # + + def exec_task_traverse(task) + run_hook "pre-#{task}" + FILETYPES.each do |type| + if type == 'ext' and config('without-ext') == 'yes' + $stderr.puts 'skipping ext/* by user option' if verbose? + next + end + traverse task, type, "#{task}_dir_#{type}" + end + run_hook "post-#{task}" + end + + def traverse(task, rel, mid) + dive_into(rel) { + run_hook "pre-#{task}" + __send__ mid, rel.sub(%r[\A.*?(?:/|\z)], '') + directories_of(curr_srcdir()).each do |d| + traverse task, "#{rel}/#{d}", mid + end + run_hook "post-#{task}" + } + end + + def dive_into(rel) + return unless File.dir?("#{@srcdir}/#{rel}") + + dir = File.basename(rel) + Dir.mkdir dir unless File.dir?(dir) + prevdir = Dir.pwd + Dir.chdir dir + $stderr.puts '---> ' + rel if verbose? + @currdir = rel + yield + Dir.chdir prevdir + $stderr.puts '<--- ' + rel if verbose? + @currdir = File.dirname(rel) + end + + def run_hook(id) + path = [ "#{curr_srcdir()}/#{id}", + "#{curr_srcdir()}/#{id}.rb" ].detect {|cand| File.file?(cand) } + return unless path + begin + instance_eval File.read(path), path, 1 + rescue + raise if $DEBUG + setup_rb_error "hook #{path} failed:\n" + $!.message + end + end + +end # class Installer + + +class SetupError < StandardError; end + +def setup_rb_error(msg) + raise SetupError, msg +end + +if $0 == __FILE__ + begin + ToplevelInstaller.invoke + rescue SetupError + raise if $DEBUG + $stderr.puts $!.message + $stderr.puts "Try 'ruby #{$0} --help' for detailed usage." + exit 1 + end +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/attic/test_run.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/attic/test_run.rb new file mode 100644 index 000000000..37d83d5a5 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/attic/test_run.rb @@ -0,0 +1,45 @@ +require 'test/unit' +require 'rcodetools/xmpfilter' +require 'rcodetools/xmptestunitfilter' +require 'rcodetools/completion' +require 'rcodetools/doc' +require 'rcodetools/options' +require 'stringio' + +class TestRun < Test::Unit::TestCase + include Rcodetools + DIR = File.expand_path(File.dirname(__FILE__)) + + tests = { + :simple_annotation => {:klass => XMPFilter}, + :unit_test => {:klass => XMPTestUnitFilter}, + :rspec => {:klass => XMPRSpecFilter, :interpreter => "spec"}, + :rspec_poetry => {:klass => XMPRSpecFilter, :interpreter => "spec", :use_parentheses => false}, + :no_warnings => {:klass => XMPFilter, :warnings => false}, + :bindings => {:klass => XMPTestUnitFilter, :use_parentheses => false}, + :unit_test_poetry => {:klass => XMPTestUnitFilter, :use_parentheses => false}, + :add_markers => {:klass => XMPAddMarkers}, + + :completion => {:klass => XMPCompletionFilter, :lineno => 1}, + :completion_emacs => {:klass => XMPCompletionEmacsFilter, :lineno => 1}, + :completion_emacs_icicles => {:klass => XMPCompletionEmacsIciclesFilter, :lineno => 1}, + :completion_class_info => {:klass => XMPCompletionClassInfoFilter, :lineno => 1}, + :completion_class_info_no_candidates => {:klass => XMPCompletionClassInfoFilter, :lineno => 1}, + + :doc => {:klass => XMPDocFilter, :lineno => 1}, + :refe => {:klass => XMPReFeFilter, :lineno => 1}, + :ri => {:klass => XMPRiFilter, :lineno => 1}, + :ri_emacs => {:klass => XMPRiEmacsFilter, :lineno => 1}, + :ri_vim => {:klass => XMPRiVimFilter, :lineno => 1}, + + } + tests.each_pair do |test, opts| + define_method("test_#{test}") do + inputfile = "#{DIR}/data/#{test}-input.rb" + outputfile = "#{DIR}/data/#{test}-output.rb" + sio = StringIO.new + sio.puts opts[:klass].run(File.read(inputfile), DEFAULT_OPTIONS.merge(opts)) + assert_equal(File.read(outputfile), sio.string) + end + end +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/add_markers-input.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/add_markers-input.rb new file mode 100644 index 000000000..33a508e45 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/add_markers-input.rb @@ -0,0 +1,2 @@ +1+1 +2+3 diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/add_markers-output.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/add_markers-output.rb new file mode 100644 index 000000000..fe8fd61b4 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/add_markers-output.rb @@ -0,0 +1,2 @@ +1+1 # => +2+3 # => diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/bindings-input.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/bindings-input.rb new file mode 100644 index 000000000..90e97e27a --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/bindings-input.rb @@ -0,0 +1,26 @@ + +require 'test/unit' + +class TestFoo < Test::Unit::TestCase + def setup + @o = [] + end + + def test_foo + a = 1 + b = a + b # => + end + + def test_arr + last = 1 + @o << last + @o.last # => + end + + def test_bar + a = b = c = 1 + d = a + d # => + end +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/bindings-output.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/bindings-output.rb new file mode 100644 index 000000000..cbea3c07c --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/bindings-output.rb @@ -0,0 +1,31 @@ + +require 'test/unit' + +class TestFoo < Test::Unit::TestCase + def setup + @o = [] + end + + def test_foo + a = 1 + b = a + assert_equal a, b + assert_equal 1, b + end + + def test_arr + last = 1 + @o << last + assert_equal last, @o.last + assert_equal 1, @o.last + end + + def test_bar + a = b = c = 1 + d = a + assert_equal a, d + assert_equal b, d + assert_equal c, d + assert_equal 1, d + end +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion-input.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion-input.rb new file mode 100644 index 000000000..2dcaa3f08 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion-input.rb @@ -0,0 +1 @@ +Array.new(3).uni diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion-output.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion-output.rb new file mode 100644 index 000000000..9546ff3ac --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion-output.rb @@ -0,0 +1,2 @@ +uniq +uniq! diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_class_info-input.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_class_info-input.rb new file mode 100644 index 000000000..6ea236464 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_class_info-input.rb @@ -0,0 +1 @@ +Array.new(3).s \ No newline at end of file diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_class_info-output.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_class_info-output.rb new file mode 100644 index 000000000..8c604b3c0 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_class_info-output.rb @@ -0,0 +1,10 @@ +select Array#select +send Object#send +shift Array#shift +singleton_methods Object#singleton_methods +size Array#size +slice Array#slice +slice! Array#slice! +sort Array#sort +sort! Array#sort! +sort_by Enumerable#sort_by diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_class_info_no_candidates-input.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_class_info_no_candidates-input.rb new file mode 100644 index 000000000..4666cc05c --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_class_info_no_candidates-input.rb @@ -0,0 +1 @@ +Array.new(3).nonexisten \ No newline at end of file diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_class_info_no_candidates-output.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_class_info_no_candidates-output.rb new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_class_info_no_candidates-output.rb @@ -0,0 +1 @@ + diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_detect_rbtest-input.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_detect_rbtest-input.rb new file mode 100755 index 000000000..c4d92ca63 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_detect_rbtest-input.rb @@ -0,0 +1,7 @@ +#!/usr/bin/env ruby +=begin test_bar +assert_equal "BAR", bar("bar") +=end +def bar(s) + s.upca +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_detect_rbtest-output.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_detect_rbtest-output.rb new file mode 100644 index 000000000..c3d421a75 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_detect_rbtest-output.rb @@ -0,0 +1,2 @@ +upcase +upcase! diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_detect_rbtest2-input.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_detect_rbtest2-input.rb new file mode 100644 index 000000000..2dcaa3f08 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_detect_rbtest2-input.rb @@ -0,0 +1 @@ +Array.new(3).uni diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_detect_rbtest2-output.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_detect_rbtest2-output.rb new file mode 100644 index 000000000..9546ff3ac --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_detect_rbtest2-output.rb @@ -0,0 +1,2 @@ +uniq +uniq! diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_emacs-input.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_emacs-input.rb new file mode 100644 index 000000000..2dcaa3f08 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_emacs-input.rb @@ -0,0 +1 @@ +Array.new(3).uni diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_emacs-output.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_emacs-output.rb new file mode 100644 index 000000000..c83366a11 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_emacs-output.rb @@ -0,0 +1,6 @@ +(progn +(setq rct-method-completion-table '(("uniq") ("uniq!") )) +(setq alist '(("uniq\t[Array#uniq]") ("uniq!\t[Array#uniq!]") )) +(setq pattern "uni") +(try-completion pattern rct-method-completion-table nil) +) diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_emacs_icicles-input.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_emacs_icicles-input.rb new file mode 100644 index 000000000..aa062b7f9 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_emacs_icicles-input.rb @@ -0,0 +1 @@ +1.div diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_emacs_icicles-output.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_emacs_icicles-output.rb new file mode 100644 index 000000000..e4747ae36 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_emacs_icicles-output.rb @@ -0,0 +1,6 @@ +(progn +(setq rct-method-completion-table '(("div\t[Fixnum#div]") ("divmod\t[Fixnum#divmod]") )) +(setq alist '(("div" . "Fixnum#div")("divmod" . "Fixnum#divmod"))) +(setq pattern "div") +(setq klass "Fixnum") +) diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_in_method-input.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_in_method-input.rb new file mode 100644 index 000000000..164408012 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_in_method-input.rb @@ -0,0 +1,3 @@ +def fooz + [].lengt +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_in_method-output.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_in_method-output.rb new file mode 100644 index 000000000..7f5e3b64d --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_in_method-output.rb @@ -0,0 +1 @@ +length diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_in_method-test.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_in_method-test.rb new file mode 100644 index 000000000..1edef979e --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_in_method-test.rb @@ -0,0 +1,6 @@ +require 'test/unit' +class TestFooz < Test::Unit::TestCase + def test_fooz + assert_equal(0, fooz) + end +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_rbtest-input.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_rbtest-input.rb new file mode 100755 index 000000000..c4d92ca63 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_rbtest-input.rb @@ -0,0 +1,7 @@ +#!/usr/bin/env ruby +=begin test_bar +assert_equal "BAR", bar("bar") +=end +def bar(s) + s.upca +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_rbtest-output.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_rbtest-output.rb new file mode 100644 index 000000000..c3d421a75 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/completion_rbtest-output.rb @@ -0,0 +1,2 @@ +upcase +upcase! diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/doc-input.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/doc-input.rb new file mode 100644 index 000000000..624aca755 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/doc-input.rb @@ -0,0 +1 @@ +[].length diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/doc-output.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/doc-output.rb new file mode 100644 index 000000000..ca542dbcc --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/doc-output.rb @@ -0,0 +1 @@ +Array#length diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/doc_detect_rbtest-input.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/doc_detect_rbtest-input.rb new file mode 100644 index 000000000..624aca755 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/doc_detect_rbtest-input.rb @@ -0,0 +1 @@ +[].length diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/doc_detect_rbtest-output.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/doc_detect_rbtest-output.rb new file mode 100644 index 000000000..ca542dbcc --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/doc_detect_rbtest-output.rb @@ -0,0 +1 @@ +Array#length diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/doc_detect_rbtest2-input.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/doc_detect_rbtest2-input.rb new file mode 100755 index 000000000..bf97ffe15 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/doc_detect_rbtest2-input.rb @@ -0,0 +1,7 @@ +#!/usr/bin/env ruby +=begin test_bar +assert_equal "BAR", bar("bar") +=end +def bar(s) + s.upcase +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/doc_detect_rbtest2-output.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/doc_detect_rbtest2-output.rb new file mode 100644 index 000000000..579185024 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/doc_detect_rbtest2-output.rb @@ -0,0 +1 @@ +String#upcase diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/doc_rbtest-input.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/doc_rbtest-input.rb new file mode 100755 index 000000000..bf97ffe15 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/doc_rbtest-input.rb @@ -0,0 +1,7 @@ +#!/usr/bin/env ruby +=begin test_bar +assert_equal "BAR", bar("bar") +=end +def bar(s) + s.upcase +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/doc_rbtest-output.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/doc_rbtest-output.rb new file mode 100644 index 000000000..579185024 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/doc_rbtest-output.rb @@ -0,0 +1 @@ +String#upcase diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/no_warnings-input.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/no_warnings-input.rb new file mode 100644 index 000000000..514e18c0d --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/no_warnings-input.rb @@ -0,0 +1,3 @@ +A = 1 +A = 1 +p (1) diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/no_warnings-output.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/no_warnings-output.rb new file mode 100644 index 000000000..27a723858 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/no_warnings-output.rb @@ -0,0 +1,4 @@ +A = 1 +A = 1 +p (1) +# >> 1 diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/refe-input.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/refe-input.rb new file mode 100644 index 000000000..624aca755 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/refe-input.rb @@ -0,0 +1 @@ +[].length diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/refe-output.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/refe-output.rb new file mode 100644 index 000000000..8653c3d4b --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/refe-output.rb @@ -0,0 +1 @@ +refe 'Array#length' diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/ri-input.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/ri-input.rb new file mode 100644 index 000000000..624aca755 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/ri-input.rb @@ -0,0 +1 @@ +[].length diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/ri-output.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/ri-output.rb new file mode 100644 index 000000000..f1ba49e61 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/ri-output.rb @@ -0,0 +1 @@ +ri 'Array#length' diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/ri_emacs-input.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/ri_emacs-input.rb new file mode 100644 index 000000000..624aca755 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/ri_emacs-input.rb @@ -0,0 +1 @@ +[].length diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/ri_emacs-output.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/ri_emacs-output.rb new file mode 100644 index 000000000..5f7389fb3 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/ri_emacs-output.rb @@ -0,0 +1 @@ +(rct-find-tag-or-ri "Array#length") diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/ri_vim-input.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/ri_vim-input.rb new file mode 100644 index 000000000..624aca755 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/ri_vim-input.rb @@ -0,0 +1 @@ +[].length diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/ri_vim-output.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/ri_vim-output.rb new file mode 100644 index 000000000..8e71a9a5c --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/ri_vim-output.rb @@ -0,0 +1 @@ +call RCT_find_tag_or_ri("Array#length") diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/rspec-input.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/rspec-input.rb new file mode 100644 index 000000000..c57b23c47 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/rspec-input.rb @@ -0,0 +1,48 @@ + +class X + Y = Struct.new(:a) + def foo(b); b ? Y.new(2) : 2 end + def bar; raise "No good" end + def baz; nil end + def fubar(x); x ** 2.0 + 1 end + def babar; [1,2] end + A = 1 + A = 1 +end + + +describe "xmpfilter's expectation expansion" do + before do + @o = X.new + end + + it "should expand should == expectations" do + @o.foo(true) # => + @o.foo(true).a # => + @o.foo(false) # => + end + + it "should expand should raise_error expectations" do + @o.bar # => + end + + it "should expand should be_nil expectations" do + @o.baz # => + end + + it "should expand correct expectations for complex values" do + @o.babar # => + end + + it "should expand should be_close expectations" do + @o.fubar(10) # => + end +end + +describe "xmpfilter's automagic binding detection" do + it "should expand should == expectations" do + a = b = c = 1 + d = a + d # => + end +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/rspec-output.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/rspec-output.rb new file mode 100644 index 000000000..00abb887b --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/rspec-output.rb @@ -0,0 +1,52 @@ + +class X + Y = Struct.new(:a) + def foo(b); b ? Y.new(2) : 2 end + def bar; raise "No good" end + def baz; nil end + def fubar(x); x ** 2.0 + 1 end + def babar; [1,2] end + A = 1 + A = 1 # !> already initialized constant A +end + + +describe "xmpfilter's expectation expansion" do + before do + @o = X.new + end + + it "should expand should == expectations" do + (@o.foo(true)).should be_a_kind_of(X::Y) + (@o.foo(true).inspect).should == ("#") + (@o.foo(true).a).should == (2) + (@o.foo(false)).should == (2) + end + + it "should expand should raise_error expectations" do + lambda{@o.bar}.should raise_error(RuntimeError) + end + + it "should expand should be_nil expectations" do + (@o.baz).should be_nil + end + + it "should expand correct expectations for complex values" do + (@o.babar).should == ([1, 2]) + end + + it "should expand should be_close expectations" do + (@o.fubar(10)).should be_close(101.0, 0.0001) + end +end + +describe "xmpfilter's automagic binding detection" do + it "should expand should == expectations" do + a = b = c = 1 + d = a + (d).should == (a) + (d).should == (b) + (d).should == (c) + (d).should == (1) + end +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/rspec_poetry-input.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/rspec_poetry-input.rb new file mode 100644 index 000000000..c57b23c47 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/rspec_poetry-input.rb @@ -0,0 +1,48 @@ + +class X + Y = Struct.new(:a) + def foo(b); b ? Y.new(2) : 2 end + def bar; raise "No good" end + def baz; nil end + def fubar(x); x ** 2.0 + 1 end + def babar; [1,2] end + A = 1 + A = 1 +end + + +describe "xmpfilter's expectation expansion" do + before do + @o = X.new + end + + it "should expand should == expectations" do + @o.foo(true) # => + @o.foo(true).a # => + @o.foo(false) # => + end + + it "should expand should raise_error expectations" do + @o.bar # => + end + + it "should expand should be_nil expectations" do + @o.baz # => + end + + it "should expand correct expectations for complex values" do + @o.babar # => + end + + it "should expand should be_close expectations" do + @o.fubar(10) # => + end +end + +describe "xmpfilter's automagic binding detection" do + it "should expand should == expectations" do + a = b = c = 1 + d = a + d # => + end +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/rspec_poetry-output.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/rspec_poetry-output.rb new file mode 100644 index 000000000..907b30535 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/rspec_poetry-output.rb @@ -0,0 +1,52 @@ + +class X + Y = Struct.new(:a) + def foo(b); b ? Y.new(2) : 2 end + def bar; raise "No good" end + def baz; nil end + def fubar(x); x ** 2.0 + 1 end + def babar; [1,2] end + A = 1 + A = 1 # !> already initialized constant A +end + + +describe "xmpfilter's expectation expansion" do + before do + @o = X.new + end + + it "should expand should == expectations" do + @o.foo(true).should be_a_kind_of(X::Y) + @o.foo(true).inspect.should == "#" + @o.foo(true).a.should == 2 + @o.foo(false).should == 2 + end + + it "should expand should raise_error expectations" do + lambda{@o.bar}.should raise_error(RuntimeError) + end + + it "should expand should be_nil expectations" do + @o.baz.should be_nil + end + + it "should expand correct expectations for complex values" do + @o.babar.should == [1, 2] + end + + it "should expand should be_close expectations" do + @o.fubar(10).should be_close(101.0, 0.0001) + end +end + +describe "xmpfilter's automagic binding detection" do + it "should expand should == expectations" do + a = b = c = 1 + d = a + d.should == a + d.should == b + d.should == c + d.should == 1 + end +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/simple_annotation-input.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/simple_annotation-input.rb new file mode 100644 index 000000000..e4eb38504 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/simple_annotation-input.rb @@ -0,0 +1,8 @@ + +a = 1 +10.times do |i| + i ** 2 # => + a += i +end +A = 1 +A = 1 diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/simple_annotation-output.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/simple_annotation-output.rb new file mode 100644 index 000000000..41cd4c0cd --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/simple_annotation-output.rb @@ -0,0 +1,8 @@ + +a = 1 +10.times do |i| + i ** 2 # => 0, 1, 4, 9, 16, 25, 36, 49, 64, 81 + a += i +end +A = 1 +A = 1 # !> already initialized constant A diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test-input.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test-input.rb new file mode 100644 index 000000000..d9d02cdcd --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test-input.rb @@ -0,0 +1,50 @@ + +class X + Y = Struct.new(:a) + def foo(b); b ? Y.new(2) : 2 end + def bar; raise "No good" end + def baz; nil end + def fubar(x); x ** 2.0 + 1 end + def babar; [1,2] end + A = 1 + A = 1 + def difftype() [1, "s"] end +end + + +require 'test/unit' +class Test_X < Test::Unit::TestCase + def setup + @o = X.new + end + + def test_foo + @o.foo(true) # => + @o.foo(true).a # => + @o.foo(false) # => + end + + def test_bar + @o.bar # => + end + + def test_baz + @o.baz # => + end + + def test_babar + @o.babar # => + end + + def test_fubar + @o.fubar(10) # => + end + + def test_difftype + for x in @o.difftype + x # => + end + end + +end + diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test-output.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test-output.rb new file mode 100644 index 000000000..49f4e6314 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test-output.rb @@ -0,0 +1,52 @@ + +class X + Y = Struct.new(:a) + def foo(b); b ? Y.new(2) : 2 end + def bar; raise "No good" end + def baz; nil end + def fubar(x); x ** 2.0 + 1 end + def babar; [1,2] end + A = 1 + A = 1 # !> already initialized constant A + def difftype() [1, "s"] end +end + + +require 'test/unit' +class Test_X < Test::Unit::TestCase + def setup + @o = X.new + end + + def test_foo + assert_kind_of(X::Y, @o.foo(true)) + assert_equal("#", @o.foo(true).inspect) + assert_equal(2, @o.foo(true).a) + assert_equal(2, @o.foo(false)) + end + + def test_bar + assert_raise(RuntimeError){@o.bar} + end + + def test_baz + assert_nil(@o.baz) + end + + def test_babar + assert_equal([1, 2], @o.babar) + end + + def test_fubar + assert_in_delta(101.0, @o.fubar(10), 0.0001) + end + + def test_difftype + for x in @o.difftype + #xmpfilter: WARNING!! extra values ignored + assert_equal(1, x) + end + end + +end + diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test_detect_rbtest-input.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test_detect_rbtest-input.rb new file mode 100644 index 000000000..d9d02cdcd --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test_detect_rbtest-input.rb @@ -0,0 +1,50 @@ + +class X + Y = Struct.new(:a) + def foo(b); b ? Y.new(2) : 2 end + def bar; raise "No good" end + def baz; nil end + def fubar(x); x ** 2.0 + 1 end + def babar; [1,2] end + A = 1 + A = 1 + def difftype() [1, "s"] end +end + + +require 'test/unit' +class Test_X < Test::Unit::TestCase + def setup + @o = X.new + end + + def test_foo + @o.foo(true) # => + @o.foo(true).a # => + @o.foo(false) # => + end + + def test_bar + @o.bar # => + end + + def test_baz + @o.baz # => + end + + def test_babar + @o.babar # => + end + + def test_fubar + @o.fubar(10) # => + end + + def test_difftype + for x in @o.difftype + x # => + end + end + +end + diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test_detect_rbtest-output.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test_detect_rbtest-output.rb new file mode 100644 index 000000000..49f4e6314 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test_detect_rbtest-output.rb @@ -0,0 +1,52 @@ + +class X + Y = Struct.new(:a) + def foo(b); b ? Y.new(2) : 2 end + def bar; raise "No good" end + def baz; nil end + def fubar(x); x ** 2.0 + 1 end + def babar; [1,2] end + A = 1 + A = 1 # !> already initialized constant A + def difftype() [1, "s"] end +end + + +require 'test/unit' +class Test_X < Test::Unit::TestCase + def setup + @o = X.new + end + + def test_foo + assert_kind_of(X::Y, @o.foo(true)) + assert_equal("#", @o.foo(true).inspect) + assert_equal(2, @o.foo(true).a) + assert_equal(2, @o.foo(false)) + end + + def test_bar + assert_raise(RuntimeError){@o.bar} + end + + def test_baz + assert_nil(@o.baz) + end + + def test_babar + assert_equal([1, 2], @o.babar) + end + + def test_fubar + assert_in_delta(101.0, @o.fubar(10), 0.0001) + end + + def test_difftype + for x in @o.difftype + #xmpfilter: WARNING!! extra values ignored + assert_equal(1, x) + end + end + +end + diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test_detect_rbtest2-input.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test_detect_rbtest2-input.rb new file mode 100644 index 000000000..afb6ebba2 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test_detect_rbtest2-input.rb @@ -0,0 +1,6 @@ +=begin test_bar +bar("bar") # => +=end +def bar(s) + s.upcase +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test_detect_rbtest2-output.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test_detect_rbtest2-output.rb new file mode 100644 index 000000000..67ac1d924 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test_detect_rbtest2-output.rb @@ -0,0 +1,6 @@ +=begin test_bar +assert_equal("BAR", bar("bar")) +=end +def bar(s) + s.upcase +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test_poetry-input.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test_poetry-input.rb new file mode 100644 index 000000000..d9d02cdcd --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test_poetry-input.rb @@ -0,0 +1,50 @@ + +class X + Y = Struct.new(:a) + def foo(b); b ? Y.new(2) : 2 end + def bar; raise "No good" end + def baz; nil end + def fubar(x); x ** 2.0 + 1 end + def babar; [1,2] end + A = 1 + A = 1 + def difftype() [1, "s"] end +end + + +require 'test/unit' +class Test_X < Test::Unit::TestCase + def setup + @o = X.new + end + + def test_foo + @o.foo(true) # => + @o.foo(true).a # => + @o.foo(false) # => + end + + def test_bar + @o.bar # => + end + + def test_baz + @o.baz # => + end + + def test_babar + @o.babar # => + end + + def test_fubar + @o.fubar(10) # => + end + + def test_difftype + for x in @o.difftype + x # => + end + end + +end + diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test_poetry-output.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test_poetry-output.rb new file mode 100644 index 000000000..6278c2553 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test_poetry-output.rb @@ -0,0 +1,52 @@ + +class X + Y = Struct.new(:a) + def foo(b); b ? Y.new(2) : 2 end + def bar; raise "No good" end + def baz; nil end + def fubar(x); x ** 2.0 + 1 end + def babar; [1,2] end + A = 1 + A = 1 # !> already initialized constant A + def difftype() [1, "s"] end +end + + +require 'test/unit' +class Test_X < Test::Unit::TestCase + def setup + @o = X.new + end + + def test_foo + assert_kind_of X::Y, @o.foo(true) + assert_equal "#", @o.foo(true).inspect + assert_equal 2, @o.foo(true).a + assert_equal 2, @o.foo(false) + end + + def test_bar + assert_raise(RuntimeError){@o.bar} + end + + def test_baz + assert_nil @o.baz + end + + def test_babar + assert_equal [1, 2], @o.babar + end + + def test_fubar + assert_in_delta 101.0, @o.fubar(10), 0.0001 + end + + def test_difftype + for x in @o.difftype + #xmpfilter: WARNING!! extra values ignored + assert_equal 1, x + end + end + +end + diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test_rbtest-input.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test_rbtest-input.rb new file mode 100644 index 000000000..afb6ebba2 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test_rbtest-input.rb @@ -0,0 +1,6 @@ +=begin test_bar +bar("bar") # => +=end +def bar(s) + s.upcase +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test_rbtest-output.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test_rbtest-output.rb new file mode 100644 index 000000000..67ac1d924 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/attic/unit_test_rbtest-output.rb @@ -0,0 +1,6 @@ +=begin test_bar +assert_equal("BAR", bar("bar")) +=end +def bar(s) + s.upcase +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/method_analyzer-data.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/method_analyzer-data.rb new file mode 100644 index 000000000..82fca088e --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/method_analyzer-data.rb @@ -0,0 +1,33 @@ + +class A + def A.foo + 1 + end + + def a + 1+1 + end +end +class B < A + def initialize + end + attr_accessor :bb + + def b + "a".length + end +end +tm = Time.now +[tm.year, tm.month, tm.day] << 0 +a = A.new +a.a +b = B.new +b.a +b.b +[b.a,b.b] +z = b.a + b.b +A.foo +B.foo +b.bb=1 +b.bb + diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/method_args.data.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/method_args.data.rb new file mode 100644 index 000000000..b95fa8337 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/method_args.data.rb @@ -0,0 +1,106 @@ +# method_args.data.rb +class FixedArgsMethods + def self.singleton(a1) end + def initialize(arg) end + def f(a1) end + def b(a1,&block) end + define_method(:defmethod) {|a1|} + attr_accessor :by_attr_accessor + attr :by_attr_false + attr :by_attr_true, true + attr_reader :by_attr_reader_1, :by_attr_reader_2 + attr_writer :by_attr_writer + def private_meth(x) end + private :private_meth + class << self + attr_accessor :singleton_attr_accessor + define_method(:singleton_defmethod){|a2|} + end +end + +module VariableArgsMethods + def s(a1,*splat) end + def sb(a1,*splat, &block) end + def d(a1,default=nil) end + def ds(a1,default=nil,*splat) end + def dsb(a1,default=nil,*splat,&block) end + def db(a1,default=nil,&block) end +end + +class Fixnum + def method_in_Fixnum(arg1, arg2) end + def self.singleton_method_in_Fixnum(arg1, arg2) end +end +class Bignum + def method_in_Bignum(arg1, arg2) end +end +class Float + def method_in_Float(arg1, arg2) end +end +class Symbol + def method_in_Symbol(arg1, arg2) end +end +class Binding + def method_in_Binding(arg1, arg2) end +end +class UnboundMethod + def method_in_UnboundMethod(arg1, arg2) end +end +class Method + def method_in_Method(arg1, arg2) end +end +class Proc + def method_in_Proc(arg1, arg2) end +end +class Continuation + def method_in_Continuation(arg1, arg2) end +end +class Thread + def method_in_Thread(arg1, arg2) end +end +# FIXME mysterious +# class FalseClass +# def method_in_FalseClass(arg1, arg2) end +# end +class TrueClass + def method_in_TrueClass(arg1, arg2) end +end +class NilClass + def method_in_NilClass(arg1, arg2) end +end +class Struct + def method_in_Struct(arg1, arg2) end +end + +require 'digest' +class Digest::Base + def method_in_Digest_Base(arg1, arg2) end +end + +class AnAbstractClass + $__method_args_off = true + def self.allocate + raise NotImplementedError, "#{self} is an abstract class." + end + $__method_args_off = false + + def method_in_AnAbstractClass(arg1, arg2) + end + +end + +class AClass + include VariableArgsMethods + extend VariableArgsMethods +end + +class ASubClass < AClass +end + +StructA = Struct.new :a, :b +class SubclassOfStructA < StructA + attr :method_in_b +end +class StructSubclass < Struct.new(:c) + attr :method_in_c +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete-TDC/completion_in_method__testmethod.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete-TDC/completion_in_method__testmethod.taf new file mode 100644 index 000000000..dfa125677 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete-TDC/completion_in_method__testmethod.taf @@ -0,0 +1,17 @@ +========== +completion_in_method__testmethod +========== +rct-complete --filename %s --line 2 -t %s@test_fooz +========== +def fooz + [].lengt +end +========== +length +========== +require 'test/unit' +class TestFooz < Test::Unit::TestCase + def test_fooz + assert_equal(0, fooz) + end +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete-TDC/completion_in_method__testscript.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete-TDC/completion_in_method__testscript.taf new file mode 100644 index 000000000..f2de8add1 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete-TDC/completion_in_method__testscript.taf @@ -0,0 +1,17 @@ +========== +completion_in_method__testscript +========== +rct-complete --filename %s --line 2 -t %s +========== +def fooz + [].lengt +end +========== +length +========== +require 'test/unit' +class TestFooz < Test::Unit::TestCase + def test_fooz + assert_equal(0, fooz) + end +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete-TDC/completion_in_method__wrong_testmethod.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete-TDC/completion_in_method__wrong_testmethod.taf new file mode 100644 index 000000000..989c1f492 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete-TDC/completion_in_method__wrong_testmethod.taf @@ -0,0 +1,17 @@ +========== +completion_in_method__wrong_testmethod +========== +rct-complete --filename %s --line 2 -t %s@test_NOT_FOUND +========== +def fooz + [].lengt +end +========== + +========== +require 'test/unit' +class TestFooz < Test::Unit::TestCase + def test_fooz + assert_equal(0, fooz) + end +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete/completion.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete/completion.taf new file mode 100644 index 000000000..de08a22cf --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete/completion.taf @@ -0,0 +1,9 @@ +========== +completion +========== +rct-complete -C --line=1 +========== +Array.new(3).uni +========== +uniq +uniq! diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete/completion_class_info.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete/completion_class_info.taf new file mode 100644 index 000000000..40d82fc9f --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete/completion_class_info.taf @@ -0,0 +1,9 @@ +========== +completion_class_info +========== +rct-complete --completion-class-info --line=1 +========== +Array.new(3).sl +========== +slice Array#slice +slice! Array#slice! diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete/completion_class_info_no_candidates.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete/completion_class_info_no_candidates.taf new file mode 100644 index 000000000..f4e8959bc --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete/completion_class_info_no_candidates.taf @@ -0,0 +1,8 @@ +========== +completion_class_info_no_candidates +========== +rct-complete --completion-class-info --line=1 +========== +Array.new(3).nonexisten +========== + diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete/completion_detect_rbtest.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete/completion_detect_rbtest.taf new file mode 100644 index 000000000..e5405568d --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete/completion_detect_rbtest.taf @@ -0,0 +1,15 @@ +========== +completion_detect_rbtest +========== +rct-complete --detect-rbtest --line=6 +========== +#!/usr/bin/env ruby +=begin test_bar +assert_equal "BAR", bar("bar") +=end +def bar(s) + s.upca +end +========== +upcase +upcase! diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete/completion_detect_rbtest2.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete/completion_detect_rbtest2.taf new file mode 100644 index 000000000..49eaf171c --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete/completion_detect_rbtest2.taf @@ -0,0 +1,9 @@ +========== +completion_detect_rbtest2 +========== +rct-complete --detect-rbtest --line=1 +========== +Array.new(3).uni +========== +uniq +uniq! diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete/completion_emacs.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete/completion_emacs.taf new file mode 100644 index 000000000..9282ad09d --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete/completion_emacs.taf @@ -0,0 +1,13 @@ +========== +completion_emacs +========== +rct-complete --completion-emacs --line=1 +========== +Array.new(3).uni +========== +(progn +(setq rct-method-completion-table '(("uniq") ("uniq!") )) +(setq alist '(("uniq\t[Array#uniq]") ("uniq!\t[Array#uniq!]") )) +(setq pattern "uni") +(try-completion pattern rct-method-completion-table nil) +) diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete/completion_emacs_icicles.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete/completion_emacs_icicles.taf new file mode 100644 index 000000000..324a1cfa8 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete/completion_emacs_icicles.taf @@ -0,0 +1,13 @@ +========== +completion_emacs_icicles +========== +rct-complete --completion-emacs-icicles --line=1 +========== +1.div +========== +(progn +(setq rct-method-completion-table '(("div\t[Fixnum#div]") ("divmod\t[Fixnum#divmod]") )) +(setq alist '(("div" . "Fixnum#div")("divmod" . "Fixnum#divmod"))) +(setq pattern "div") +(setq klass "Fixnum") +) diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete/completion_rbtest.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete/completion_rbtest.taf new file mode 100644 index 000000000..e8c6cbe62 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-complete/completion_rbtest.taf @@ -0,0 +1,15 @@ +========== +completion_rbtest +========== +rct-complete --rbtest --line=6 +========== +#!/usr/bin/env ruby +=begin test_bar +assert_equal "BAR", bar("bar") +=end +def bar(s) + s.upca +end +========== +upcase +upcase! diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-doc/doc.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-doc/doc.taf new file mode 100644 index 000000000..aa017f636 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-doc/doc.taf @@ -0,0 +1,8 @@ +========== +doc +========== +rct-doc -D --line=1 +========== +[].length +========== +Array#length diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-doc/doc_detect_rbtest.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-doc/doc_detect_rbtest.taf new file mode 100644 index 000000000..28ac60836 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-doc/doc_detect_rbtest.taf @@ -0,0 +1,8 @@ +========== +doc_detect_rbtest +========== +rct-doc --detect-rbtest --line=1 +========== +[].length +========== +Array#length diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-doc/doc_detect_rbtest2.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-doc/doc_detect_rbtest2.taf new file mode 100644 index 000000000..043bea94d --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-doc/doc_detect_rbtest2.taf @@ -0,0 +1,14 @@ +========== +doc_detect_rbtest2 +========== +rct-doc --detect-rbtest --line=6 +========== +#!/usr/bin/env ruby +=begin test_bar +assert_equal "BAR", bar("bar") +=end +def bar(s) + s.upcase +end +========== +String#upcase diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-doc/doc_rbtest.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-doc/doc_rbtest.taf new file mode 100644 index 000000000..7da58ce76 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-doc/doc_rbtest.taf @@ -0,0 +1,14 @@ +========== +doc_rbtest +========== +rct-doc --rbtest --line=6 +========== +#!/usr/bin/env ruby +=begin test_bar +assert_equal "BAR", bar("bar") +=end +def bar(s) + s.upcase +end +========== +String#upcase diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-doc/refe.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-doc/refe.taf new file mode 100644 index 000000000..6f074037d --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-doc/refe.taf @@ -0,0 +1,8 @@ +========== +refe +========== +rct-doc --refe --line=1 +========== +[].length +========== +refe 'Array#length' diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-doc/ri.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-doc/ri.taf new file mode 100644 index 000000000..02f27d6a1 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-doc/ri.taf @@ -0,0 +1,8 @@ +========== +ri +========== +rct-doc --ri --line=1 +========== +[].length +========== +ri 'Array#length' diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-doc/ri_emacs.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-doc/ri_emacs.taf new file mode 100644 index 000000000..b41c7e373 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-doc/ri_emacs.taf @@ -0,0 +1,8 @@ +========== +ri_emacs +========== +rct-doc --ri-emacs --line=1 +========== +[].length +========== +(rct-find-tag-or-ri "Array#length") diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-doc/ri_vim.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-doc/ri_vim.taf new file mode 100644 index 000000000..11413ce40 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/rct-doc/ri_vim.taf @@ -0,0 +1,8 @@ +========== +ri_vim +========== +rct-doc --ri-vim --line=1 +========== +[].length +========== +call RCT_find_tag_or_ri("Array#length") diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/sample_test_script.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/sample_test_script.rb new file mode 100644 index 000000000..b368a8ca2 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/sample_test_script.rb @@ -0,0 +1,9 @@ +require 'test/unit' +class TestSample < Test::Unit::TestCase + def test_sample0 + assert(true) + end + + def test_sample1 + end +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/add_markers.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/add_markers.taf new file mode 100644 index 000000000..88e846131 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/add_markers.taf @@ -0,0 +1,10 @@ +========== +add_markers +========== +xmpfilter -m +========== +1+1 +2+3 +========== +1+1 # => +2+3 # => diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/bindings.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/bindings.taf new file mode 100644 index 000000000..bcd30560d --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/bindings.taf @@ -0,0 +1,63 @@ +========== +bindings +========== +xmpfilter --poetry -u +========== + +require 'test/unit' + +class TestFoo < Test::Unit::TestCase + def setup + @o = [] + end + + def test_foo + a = 1 + b = a + b # => + end + + def test_arr + last = 1 + @o << last + @o.last # => + end + + def test_bar + a = b = c = 1 + d = a + d # => + end +end +========== + +require 'test/unit' + +class TestFoo < Test::Unit::TestCase + def setup + @o = [] + end + + def test_foo + a = 1 + b = a + assert_equal a, b + assert_equal 1, b + end + + def test_arr + last = 1 + @o << last + assert_equal last, @o.last + assert_equal 1, @o.last + end + + def test_bar + a = b = c = 1 + d = a + assert_equal a, d + assert_equal b, d + assert_equal c, d + assert_equal 1, d + end +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/comment_out.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/comment_out.taf new file mode 100644 index 000000000..2520e79d7 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/comment_out.taf @@ -0,0 +1,22 @@ +========== +comment_out +========== +xmpfilter +========== + +# 1 # => +# 1 # => 2 +1 # => 12 +1 +# # => +# 1 +# # => +========== + +# 1 # => +# 1 # => 2 +1 # => 1 +1 +# # => +# 1 +# # => diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/exception.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/exception.taf new file mode 100644 index 000000000..3918c2e4d --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/exception.taf @@ -0,0 +1,14 @@ +========== +exception +========== +xmpfilter +========== +def foo + raise NameError, "ERR!!" rescue $@ # => +end +foo +========== +def foo + raise NameError, "ERR!!" rescue $@ # => ["-:2:in `foo'", "-:4"] +end +foo diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/expectations.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/expectations.taf new file mode 100644 index 000000000..ad244d7ea --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/expectations.taf @@ -0,0 +1,54 @@ +========== +expectations +========== +xmpfilter --expectations +========== + +require 'rubygems' +require 'expectations' + +S = Struct.new :a +Expectations do + 1 + 1 # => + "a".length # => + [][1] # => + 1.hoge # => + 1.1 + 1.0 # => + S.new(1) # => +end +========== + +require 'rubygems' +require 'expectations' + +S = Struct.new :a +Expectations do + expect 2 do + 1 + 1 + end + + expect 1 do + "a".length + end + + expect nil do + [][1] + end + + expect NoMethodError do + 1.hoge + end + + expect 2.0999..2.1001 do + 1.1 + 1.0 + end + + expect S do + S.new(1) + end + + expect "#" do + S.new(1).inspect + end + +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/last_match.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/last_match.taf new file mode 100644 index 000000000..56a086384 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/last_match.taf @@ -0,0 +1,18 @@ +========== +last_match +========== +xmpfilter +========== + +md = "abc".match(/(.)(.)./) +1 +# => +[$1, $2] # => +$1 # => +========== + +md = "abc".match(/(.)(.)./) +1 +# => 1 +[$1, $2] # => ["a", "b"] +$1 # => "a" diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/mult.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/mult.rb new file mode 100644 index 000000000..fa9025a07 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/mult.rb @@ -0,0 +1,9 @@ +a = ["1111111111111111111111111111111111111111111111111111", 123334324234242342, + 1332333333,6,8 ] +1 # => 1 +a +# => ["1111111111111111111111111111111111111111111111111111", +# 123334324234242342, +# 1332333333, +# 6, +# 8] diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/multi_line_annotation_1.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/multi_line_annotation_1.taf new file mode 100644 index 000000000..63a0a053d --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/multi_line_annotation_1.taf @@ -0,0 +1,22 @@ +========== +multi_line_annotation_1 +========== +xmpfilter +========== + +1+2 # => +a = ["1111111111111111111111111111111111111111111111111111", 123334324234242342, + 1332333333 ] +1+2 # => +a +# => +========== + +1+2 # => 3 +a = ["1111111111111111111111111111111111111111111111111111", 123334324234242342, + 1332333333 ] +1+2 # => 3 +a +# => ["1111111111111111111111111111111111111111111111111111", +# 123334324234242342, +# 1332333333] diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/multi_line_annotation_2.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/multi_line_annotation_2.taf new file mode 100644 index 000000000..d5027dbdf --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/multi_line_annotation_2.taf @@ -0,0 +1,24 @@ +========== +multi_line_annotation_2 +========== +xmpfilter +========== + +1+2 # => 32 +a = ["1111111111111111111111111111111111111111111111111111", 123334324234242342, + 55555555 ] +1+2 # => 300 +a +# => ["1111111111111111111111111111111111111111111111111111", +# 123334324234242342, +# 1332333333] +========== + +1+2 # => 3 +a = ["1111111111111111111111111111111111111111111111111111", 123334324234242342, + 55555555 ] +1+2 # => 3 +a +# => ["1111111111111111111111111111111111111111111111111111", +# 123334324234242342, +# 55555555] diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/multi_line_annotation_3.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/multi_line_annotation_3.taf new file mode 100644 index 000000000..2b5efef34 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/multi_line_annotation_3.taf @@ -0,0 +1,20 @@ +========== +multi_line_annotation_3 +========== +xmpfilter +========== + +a = ["1111111111111111111111111111111111111111111111111111", 123334324234242342, + 1332333333 ] +a +# => +1 # => +========== + +a = ["1111111111111111111111111111111111111111111111111111", 123334324234242342, + 1332333333 ] +a +# => ["1111111111111111111111111111111111111111111111111111", +# 123334324234242342, +# 1332333333] +1 # => 1 diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/multi_line_annotation_4.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/multi_line_annotation_4.taf new file mode 100644 index 000000000..e8adac712 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/multi_line_annotation_4.taf @@ -0,0 +1,22 @@ +========== +multi_line_annotation_4 +========== +xmpfilter +========== + +a = ["1111111111111111111111111111111111111111111111111111", 123334324234242342, + 55555555 ] +a +# => ["1111111111111111111111111111111111111111111111111111", +# 123334324234242342, +# 1332333333] +# not removed +========== + +a = ["1111111111111111111111111111111111111111111111111111", 123334324234242342, + 55555555 ] +a +# => ["1111111111111111111111111111111111111111111111111111", +# 123334324234242342, +# 55555555] +# not removed diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/multi_line_annotation_5.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/multi_line_annotation_5.taf new file mode 100644 index 000000000..af0cb8460 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/multi_line_annotation_5.taf @@ -0,0 +1,34 @@ +========== +multi_line_annotation_5 +========== +xmpfilter +========== + +def test + a = ["1111111111111111111111111111111111111111111111111111", 123334324234242342, + 55555555 ] + a + # => ["", + # 123334324234242342, + # 1332333333] + a + # => + # not removed +end +test +========== + +def test + a = ["1111111111111111111111111111111111111111111111111111", 123334324234242342, + 55555555 ] + a + # => ["1111111111111111111111111111111111111111111111111111", + # 123334324234242342, + # 55555555] + a + # => ["1111111111111111111111111111111111111111111111111111", + # 123334324234242342, + # 55555555] + # not removed +end +test diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/multi_line_annotation_6.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/multi_line_annotation_6.taf new file mode 100644 index 000000000..24c48e2b0 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/multi_line_annotation_6.taf @@ -0,0 +1,12 @@ +========== +multi_line_annotation_6 +========== +xmpfilter +========== + +1 + 2 # !> warning +# => +========== + +1 + 2 +# => 3 diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/multi_line_annotation_7.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/multi_line_annotation_7.taf new file mode 100644 index 000000000..21ed1daec --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/multi_line_annotation_7.taf @@ -0,0 +1,23 @@ +========== +multi_line_annotation_7 +========== +xmpfilter +========== + +[1,2] +# => +raise +[3,4] +# => +[5,6] +# => +========== + +[1,2] +# => [1, 2] +raise +[3,4] +# => +[5,6] +# => +# ~> -:2: unhandled exception diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/no_warnings.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/no_warnings.taf new file mode 100644 index 000000000..76cf8b021 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/no_warnings.taf @@ -0,0 +1,13 @@ +========== +no_warnings +========== +xmpfilter --no-warnings +========== +A = 1 +A = 1 +p (1) +========== +A = 1 +A = 1 +p (1) +# >> 1 diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/nospace.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/nospace.taf new file mode 100644 index 000000000..bb71aeae4 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/nospace.taf @@ -0,0 +1,16 @@ +========== +nospace_annotation +========== +xmpfilter +========== + +1 #=> +2 #=> 2 +3 +#=> +========== + +1 # => 1 +2 # => 2 +3 +# => 3 diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/rspec.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/rspec.taf new file mode 100644 index 000000000..6c3a3d666 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/rspec.taf @@ -0,0 +1,106 @@ +========== +rspec +========== +xmpfilter -s +========== + +class X + Y = Struct.new(:a) + def foo(b); b ? Y.new(2) : 2 end + def bar; raise "No good" end + def baz; nil end + def fubar(x); x ** 2.0 + 1 end + def babar; [1,2] end + A = 1 + A = 1 +end + + +describe "xmpfilter's expectation expansion" do + before do + @o = X.new + end + + it "should expand should == expectations" do + @o.foo(true) # => + @o.foo(true).a # => + @o.foo(false) # => + end + + it "should expand should raise_error expectations" do + @o.bar # => + end + + it "should expand should be_nil expectations" do + @o.baz # => + end + + it "should expand correct expectations for complex values" do + @o.babar # => + end + + it "should expand should be_close expectations" do + @o.fubar(10) # => + end +end + +describe "xmpfilter's automagic binding detection" do + it "should expand should == expectations" do + a = b = c = 1 + d = a + d # => + end +end +========== + +class X + Y = Struct.new(:a) + def foo(b); b ? Y.new(2) : 2 end + def bar; raise "No good" end + def baz; nil end + def fubar(x); x ** 2.0 + 1 end + def babar; [1,2] end + A = 1 + A = 1 # !> already initialized constant A +end + + +describe "xmpfilter's expectation expansion" do + before do + @o = X.new + end + + it "should expand should == expectations" do + (@o.foo(true)).should be_a_kind_of(X::Y) + (@o.foo(true).inspect).should == ("#") + (@o.foo(true).a).should == (2) + (@o.foo(false)).should == (2) + end + + it "should expand should raise_error expectations" do + lambda{@o.bar}.should raise_error(RuntimeError) + end + + it "should expand should be_nil expectations" do + (@o.baz).should be_nil + end + + it "should expand correct expectations for complex values" do + (@o.babar).should == ([1, 2]) + end + + it "should expand should be_close expectations" do + (@o.fubar(10)).should be_close(101.0, 0.0001) + end +end + +describe "xmpfilter's automagic binding detection" do + it "should expand should == expectations" do + a = b = c = 1 + d = a + (d).should == (a) + (d).should == (b) + (d).should == (c) + (d).should == (1) + end +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/rspec_poetry.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/rspec_poetry.taf new file mode 100644 index 000000000..0bcd6859a --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/rspec_poetry.taf @@ -0,0 +1,106 @@ +========== +rspec_poetry +========== +xmpfilter -s --poetry +========== + +class X + Y = Struct.new(:a) + def foo(b); b ? Y.new(2) : 2 end + def bar; raise "No good" end + def baz; nil end + def fubar(x); x ** 2.0 + 1 end + def babar; [1,2] end + A = 1 + A = 1 +end + + +describe "xmpfilter's expectation expansion" do + before do + @o = X.new + end + + it "should expand should == expectations" do + @o.foo(true) # => + @o.foo(true).a # => + @o.foo(false) # => + end + + it "should expand should raise_error expectations" do + @o.bar # => + end + + it "should expand should be_nil expectations" do + @o.baz # => + end + + it "should expand correct expectations for complex values" do + @o.babar # => + end + + it "should expand should be_close expectations" do + @o.fubar(10) # => + end +end + +describe "xmpfilter's automagic binding detection" do + it "should expand should == expectations" do + a = b = c = 1 + d = a + d # => + end +end +========== + +class X + Y = Struct.new(:a) + def foo(b); b ? Y.new(2) : 2 end + def bar; raise "No good" end + def baz; nil end + def fubar(x); x ** 2.0 + 1 end + def babar; [1,2] end + A = 1 + A = 1 # !> already initialized constant A +end + + +describe "xmpfilter's expectation expansion" do + before do + @o = X.new + end + + it "should expand should == expectations" do + @o.foo(true).should be_a_kind_of(X::Y) + @o.foo(true).inspect.should == "#" + @o.foo(true).a.should == 2 + @o.foo(false).should == 2 + end + + it "should expand should raise_error expectations" do + lambda{@o.bar}.should raise_error(RuntimeError) + end + + it "should expand should be_nil expectations" do + @o.baz.should be_nil + end + + it "should expand correct expectations for complex values" do + @o.babar.should == [1, 2] + end + + it "should expand should be_close expectations" do + @o.fubar(10).should be_close(101.0, 0.0001) + end +end + +describe "xmpfilter's automagic binding detection" do + it "should expand should == expectations" do + a = b = c = 1 + d = a + d.should == a + d.should == b + d.should == c + d.should == 1 + end +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/simple_annotation.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/simple_annotation.taf new file mode 100644 index 000000000..9aa82d54b --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/simple_annotation.taf @@ -0,0 +1,22 @@ +========== +simple_annotation +========== +xmpfilter +========== + +a = 1 +10.times do |i| + i ** 2 # => + a += i +end +A = 1 +A = 1 +========== + +a = 1 +10.times do |i| + i ** 2 # => 0, 1, 4, 9, 16, 25, 36, 49, 64, 81 + a += i +end +A = 1 +A = 1 # !> already initialized constant A diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/unit_test.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/unit_test.taf new file mode 100644 index 000000000..662ae861b --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/unit_test.taf @@ -0,0 +1,108 @@ +========== +unit_test +========== +xmpfilter -u +========== + +class X + Y = Struct.new(:a) + def foo(b); b ? Y.new(2) : 2 end + def bar; raise "No good" end + def baz; nil end + def fubar(x); x ** 2.0 + 1 end + def babar; [1,2] end + A = 1 + A = 1 + def difftype() [1, "s"] end +end + + +require 'test/unit' +class Test_X < Test::Unit::TestCase + def setup + @o = X.new + end + + def test_foo + @o.foo(true) # => + @o.foo(true).a # => + @o.foo(false) # => + end + + def test_bar + @o.bar # => + end + + def test_baz + @o.baz # => + end + + def test_babar + @o.babar # => + end + + def test_fubar + @o.fubar(10) # => + end + + def test_difftype + for x in @o.difftype + x # => + end + end + +end + +========== + +class X + Y = Struct.new(:a) + def foo(b); b ? Y.new(2) : 2 end + def bar; raise "No good" end + def baz; nil end + def fubar(x); x ** 2.0 + 1 end + def babar; [1,2] end + A = 1 + A = 1 # !> already initialized constant A + def difftype() [1, "s"] end +end + + +require 'test/unit' +class Test_X < Test::Unit::TestCase + def setup + @o = X.new + end + + def test_foo + assert_kind_of(X::Y, @o.foo(true)) + assert_equal("#", @o.foo(true).inspect) + assert_equal(2, @o.foo(true).a) + assert_equal(2, @o.foo(false)) + end + + def test_bar + assert_raise(RuntimeError){@o.bar} + end + + def test_baz + assert_nil(@o.baz) + end + + def test_babar + assert_equal([1, 2], @o.babar) + end + + def test_fubar + assert_in_delta(101.0, @o.fubar(10), 0.0001) + end + + def test_difftype + for x in @o.difftype + #xmpfilter: WARNING!! extra values ignored + assert_equal(1, x) + end + end + +end + diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/unit_test_detect_rbtest.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/unit_test_detect_rbtest.taf new file mode 100644 index 000000000..7cc5893e7 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/unit_test_detect_rbtest.taf @@ -0,0 +1,108 @@ +========== +unit_test_detect_rbtest +========== +xmpfilter -u --detect-rbtest +========== + +class X + Y = Struct.new(:a) + def foo(b); b ? Y.new(2) : 2 end + def bar; raise "No good" end + def baz; nil end + def fubar(x); x ** 2.0 + 1 end + def babar; [1,2] end + A = 1 + A = 1 + def difftype() [1, "s"] end +end + + +require 'test/unit' +class Test_X < Test::Unit::TestCase + def setup + @o = X.new + end + + def test_foo + @o.foo(true) # => + @o.foo(true).a # => + @o.foo(false) # => + end + + def test_bar + @o.bar # => + end + + def test_baz + @o.baz # => + end + + def test_babar + @o.babar # => + end + + def test_fubar + @o.fubar(10) # => + end + + def test_difftype + for x in @o.difftype + x # => + end + end + +end + +========== + +class X + Y = Struct.new(:a) + def foo(b); b ? Y.new(2) : 2 end + def bar; raise "No good" end + def baz; nil end + def fubar(x); x ** 2.0 + 1 end + def babar; [1,2] end + A = 1 + A = 1 # !> already initialized constant A + def difftype() [1, "s"] end +end + + +require 'test/unit' +class Test_X < Test::Unit::TestCase + def setup + @o = X.new + end + + def test_foo + assert_kind_of(X::Y, @o.foo(true)) + assert_equal("#", @o.foo(true).inspect) + assert_equal(2, @o.foo(true).a) + assert_equal(2, @o.foo(false)) + end + + def test_bar + assert_raise(RuntimeError){@o.bar} + end + + def test_baz + assert_nil(@o.baz) + end + + def test_babar + assert_equal([1, 2], @o.babar) + end + + def test_fubar + assert_in_delta(101.0, @o.fubar(10), 0.0001) + end + + def test_difftype + for x in @o.difftype + #xmpfilter: WARNING!! extra values ignored + assert_equal(1, x) + end + end + +end + diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/unit_test_detect_rbtest2.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/unit_test_detect_rbtest2.taf new file mode 100644 index 000000000..219b4a996 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/unit_test_detect_rbtest2.taf @@ -0,0 +1,18 @@ +========== +unit_test_detect_rbtest2 +========== +xmpfilter --detect-rbtest +========== +=begin test_bar +bar("bar") # => +=end +def bar(s) + s.upcase +end +========== +=begin test_bar +assert_equal("BAR", bar("bar")) +=end +def bar(s) + s.upcase +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/unit_test_poetry.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/unit_test_poetry.taf new file mode 100644 index 000000000..b7c24902f --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/unit_test_poetry.taf @@ -0,0 +1,108 @@ +========== +unit_test_poetry +========== +xmpfilter -u --poetry +========== + +class X + Y = Struct.new(:a) + def foo(b); b ? Y.new(2) : 2 end + def bar; raise "No good" end + def baz; nil end + def fubar(x); x ** 2.0 + 1 end + def babar; [1,2] end + A = 1 + A = 1 + def difftype() [1, "s"] end +end + + +require 'test/unit' +class Test_X < Test::Unit::TestCase + def setup + @o = X.new + end + + def test_foo + @o.foo(true) # => + @o.foo(true).a # => + @o.foo(false) # => + end + + def test_bar + @o.bar # => + end + + def test_baz + @o.baz # => + end + + def test_babar + @o.babar # => + end + + def test_fubar + @o.fubar(10) # => + end + + def test_difftype + for x in @o.difftype + x # => + end + end + +end + +========== + +class X + Y = Struct.new(:a) + def foo(b); b ? Y.new(2) : 2 end + def bar; raise "No good" end + def baz; nil end + def fubar(x); x ** 2.0 + 1 end + def babar; [1,2] end + A = 1 + A = 1 # !> already initialized constant A + def difftype() [1, "s"] end +end + + +require 'test/unit' +class Test_X < Test::Unit::TestCase + def setup + @o = X.new + end + + def test_foo + assert_kind_of X::Y, @o.foo(true) + assert_equal "#", @o.foo(true).inspect + assert_equal 2, @o.foo(true).a + assert_equal 2, @o.foo(false) + end + + def test_bar + assert_raise(RuntimeError){@o.bar} + end + + def test_baz + assert_nil @o.baz + end + + def test_babar + assert_equal [1, 2], @o.babar + end + + def test_fubar + assert_in_delta 101.0, @o.fubar(10), 0.0001 + end + + def test_difftype + for x in @o.difftype + #xmpfilter: WARNING!! extra values ignored + assert_equal 1, x + end + end + +end + diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/unit_test_rbtest.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/unit_test_rbtest.taf new file mode 100644 index 000000000..622f11828 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/unit_test_rbtest.taf @@ -0,0 +1,18 @@ +========== +unit_test_rbtest +========== +xmpfilter -u --rbtest +========== +=begin test_bar +bar("bar") # => +=end +def bar(s) + s.upcase +end +========== +=begin test_bar +assert_equal("BAR", bar("bar")) +=end +def bar(s) + s.upcase +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/width.taf b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/width.taf new file mode 100644 index 000000000..4fa436e02 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/data/xmpfilter/width.taf @@ -0,0 +1,16 @@ +========== +width +========== +xmpfilter -w 15 +========== + +a = ["abcdefg", 12345, Object] +a +# => +========== + +a = ["abcdefg", 12345, Object] +a +# => ["abcdefg", +# 12345, +# Object] diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/test_completion.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/test_completion.rb new file mode 100644 index 000000000..fce0fef1c --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/test_completion.rb @@ -0,0 +1,674 @@ +$: << ".." << "../lib" +require 'rcodetools/completion' +require 'test/unit' + +class TestXMPCompletionFilter < Test::Unit::TestCase + include Rcodetools + def doit(code, lineno, column=nil, options={}) + xmp = XMPCompletionFilter.new options + xmp.candidates(code, lineno, column).sort + end + + def test_complete_method__simple + assert_equal(["length"], doit('"a".lengt', 1)) + assert_equal(["length"], doit('`echo a`.lengt', 1)) + end + + def test_complete_method__in_arg + assert_equal(["length"], doit('print("a".lengt)', 1, 15)) + assert_equal(["length"], doit("print('a'.lengt)", 1, 15)) + assert_equal(["length"], doit("((a, b = 1 + 'a'.lengt))", 1, 22)) + end + + def test_complete_method__in_method + assert_equal(["length"], doit(<true)) + module X + xx # normally NoMethodError + module_funct + end +EOC + end + + # drawback of ignore_NoMethodError + def test_with_or_without_ignore_NoMethodError + code = <true) + end + end + + def test__syntax_error + assert_raise(ProcessParticularLine::NewCodeError) do + doit(< == === =~ > >= < <= << >> + + - * / % ** ~ + ].each do |op| + ancestors_re = Fixnum.ancestors.map{|x|x.to_s}.join('|') + assert_match(/^#{ancestors_re}##{Regexp.quote(op)}$/, doit("1 #{op} 2",1,2)) + end + end + + def test_aref_aset__Array + assert_equal("Array#[]", doit("[0][ 0 ]",1,4)) + assert_equal("Array#[]=", doit("[0][ 0 ]=10",1,4)) + assert_equal("Array#[]", doit("[0][0]",1,4)) + assert_equal("Array#[]=", doit("[0][0]=10",1,4)) + end + + def test_aref_aset__Object + assert_equal("Array#[]", doit("Array.new(3)[ 0 ]",1,13)) + assert_equal("Array#[]=", doit("Array.new(3)[ 0 ]=10",1,13)) + assert_equal("Array#[]", doit("Array.new(3)[0]",1,13)) + assert_equal("Array#[]=", doit("Array.new(3)[0]=10",1,13)) + end + + def test_aref_aset__Fixnum + assert_equal("Fixnum#[]", doit("0[ 0 ]",1,2)) + assert_equal("Fixnum#[]", doit("0[0]",1,2)) + end + + def test_aref_aset__String + assert_equal("String#[]", doit("'a' + '[0]'[ 0 ]",1,12)) + assert_equal("String#[]", doit("'[0]'[ 0 ]",1,6)) + assert_equal("String#[]=", doit("'0'[ 0 ]=10",1,4)) + assert_equal("String#[]", doit("'[0]'[0]",1,6)) + assert_equal("String#[]=", doit("'0'[0]=10",1,4)) + end + + def test_phrase + assert_equal("Array#uniq", doit('Array.new(3).uniq',1)) + assert_equal("Array#uniq", doit('Array.new(3).to_a.uniq',1)) + assert_equal("Array#uniq", doit('Array.new(3).map{|x| x.to_i}.uniq',1)) + assert_equal("Array#uniq", doit('[][0,(1+1)].uniq',1)) + end + + def test_percent__String + assert_equal("String#length", doit('%!foo!.length',1)) + assert_equal("String#length", doit('%q!foo!.length',1)) + assert_equal("String#length", doit('%Q!foo!.length',1)) + assert_equal("String#length", doit('%x!foo!.length',1)) + + assert_equal("String#length", doit('%{foo}.length',1)) + assert_equal("String#length", doit('%q{foo}.length',1)) + assert_equal("String#length", doit('%q!(!.length',1)) + assert_equal("String#length", doit('%Q!(!.length',1)) + assert_equal("String#length", doit('%x!(!.length',1)) + assert_equal("String#length", doit('%x{(}.length',1)) + + assert_equal("String#length", doit('%{f(o)o}.length',1)) + assert_equal("String#length", doit('%{f{o}o}.length',1)) + assert_equal("String#length", doit('(%{f{o}o}+%!}x!).length',1)) + end + + def test_percent__Array + assert_equal("Array#length", doit('%w!foo!.length',1)) + assert_equal("Array#length", doit('%W!foo!.length',1)) + + assert_equal("Array#length", doit('%w{foo}.length',1)) + assert_equal("Array#length", doit('%W{foo}.length',1)) + assert_equal("Array#length", doit('%w!(!.length',1)) + assert_equal("Array#length", doit('%W!(!.length',1)) + assert_equal("Array#length", doit('%w{(}.length',1)) + + assert_equal("Array#length", doit('%w{f(o)o}.length',1)) + assert_equal("Array#length", doit('%w{f{o}o}.length',1)) + assert_equal("Array#length", doit('(%W{f{o}o}+%w!}x!).length',1)) + end + + def test_percent__Regexp + assert_equal("Regexp#kcode", doit('%r!foo!.kcode',1)) + assert_equal("Regexp#kcode", doit('%r{foo}.kcode',1)) + assert_equal("Regexp#kcode", doit('%r!(!.kcode',1)) + assert_equal("Regexp#kcode", doit('%r[(].kcode',1)) + assert_equal("Regexp#kcode", doit('%r.kcode',1)) + end + + def test_percent__Symbol + assert_equal("Symbol#id2name", doit('%s!foo!.id2name',1)) + assert_equal("Symbol#id2name", doit('%s{foo}.id2name',1)) + assert_equal("Symbol#id2name", doit('%s!(!.id2name',1)) + assert_equal("Symbol#id2name", doit('%s{(}.id2name',1)) + assert_equal("Symbol#id2name", doit('%s(f(o)o).id2name',1)) + end + + def test_bare_word__with_NoMethodError + assert_equal("Module#module_function", doit(<true)) + module X + xx # normally NoMethodError + module_function + end +EOC + end + + def test__syntax_error + assert_raise(ProcessParticularLine::NewCodeError) do + doit(< < Struct +method_args.data.rb:101:class SubclassOfStructA < StructA +method_args.data.rb:102:SubclassOfStructA#method_in_b +method_args.data.rb:104:class < Struct +method_args.data.rb:104:class StructSubclass < +method_args.data.rb:105:StructSubclass#method_in_c +XXX + + # To avoid dependency of pwd. + module StripDir + def strip_dir! + slice! %r!^.*/! + self + end + end + + @@expected.each do |line| + begin + file_lineno_klass_meth, rest = line.split(/\s+/,2) + if file_lineno_klass_meth =~ /:/ + file, lineno, klass_meth = file_lineno_klass_meth.split(/:/) + klass_meth = rest if %w[class include extend].include? klass_meth + else # filename/lineno is unknown + klass_meth = file_lineno_klass_meth + end + + test_method_name = "test_" + klass_meth + define_method(test_method_name) do + actual = @@result.grep(/#{klass_meth}/)[0].extend(StripDir).strip_dir! + assert_equal line, actual + end + rescue Exception + end + end + + def test_all_tests + assert_equal @@expected.length, @@result.length, @@result.join("\n") + end + + def test_without_n_option + first_line = "FixedArgsMethods.singleton (a1)" + command_output = `ruby '#{SCRIPT}' '#{DATAFILE}'` + assert_match(/\A#{Regexp.quote(first_line)}\n/, command_output) + end +end + + +class TestTAGS < Test::Unit::TestCase + include MethodArgsScriptConfig + + @@TAGS = `ruby '#{SCRIPT}' -t '#{DATAFILE}'` + def test_filename + # check whether full path is passed. + assert_match %r!^\cl\n/.+method_args.data.rb,\d!, @@TAGS + end + + def test_singleton_method + # including line/byte test + assert @@TAGS.include?(" def self.singleton(a1) end::FixedArgsMethods.singleton3,45") + end + + def test_instance_method + assert @@TAGS.include?(" def initialize(arg) end::FixedArgsMethods#initialize4,74") + end + + def test_include + assert_match(/^ include VariableArgsMethods::AClass/, @@TAGS) + end + + def test_extend + assert_match(/^ extend VariableArgsMethods::AClass/, @@TAGS) + end + + def test_inheritance + assert_match(/^class ASubClass < AClass::ASubClass/, @@TAGS) + end +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/test_options.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/test_options.rb new file mode 100644 index 000000000..8751516f2 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/test_options.rb @@ -0,0 +1,33 @@ +$: << ".." << "../lib" +require 'rcodetools/options' +require 'test/unit' +require 'tmpdir' +require 'fileutils' + +class TestOptionHandler < Test::Unit::TestCase + include Rcodetools + include OptionHandler + + def include_paths_check + options = { :include_paths => [] } + auto_include_paths options[:include_paths], Dir.pwd + assert options[:include_paths].include?("#{@basedir}/lib") + assert options[:include_paths].include?("#{@basedir}/bin") + end + + def test_auto_include_paths + Dir.chdir(Dir.tmpdir) do + begin + FileUtils.mkdir_p ["project", "project/lib/project", "project/bin", "project/share"] + open("project/Rakefile","w"){} + @basedir = File.expand_path "project" + Dir.chdir("project/lib/project/") { include_paths_check } + Dir.chdir("project/lib/") { include_paths_check } + Dir.chdir("project/bin/") { include_paths_check } + Dir.chdir("project/") { include_paths_check } + ensure + FileUtils.rm_rf "project" + end + end + end +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/test_ruby_toggle_file.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/test_ruby_toggle_file.rb new file mode 100644 index 000000000..e7960f9a3 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/test_ruby_toggle_file.rb @@ -0,0 +1,174 @@ +require 'fileutils' +require 'test/unit' +require 'ruby_toggle_file' +require 'tmpdir' + +class TestRubyToggleFile < Test::Unit::TestCase + WORK_DIR = "#{Dir.tmpdir}/zdsfwfwejiotest".freeze + FileUtils.rm_rf WORK_DIR + + def teardown + FileUtils.rm_rf WORK_DIR + end + + def create(*files) + for file in files.map{|f| _(f) } + FileUtils.mkpath(File.dirname(file)) + open(file,"w"){} + end + end + + def _(path) # make full path + WORK_DIR + "/" + path + end + + ########################################################################### + # naming convention # + # test_METHOD__EXISTP__IMPLEMENTDIR_TESTDIR # + ########################################################################### + def test_test_file__exist__lib_test + create "lib/zero.rb", "test/test_zero.rb" + rtf = RubyToggleFile.new + assert_equal _("test/test_zero.rb"), rtf.ruby_toggle_file(_("lib/zero.rb")) + end + + def test_test_file__exist__libone_testone + create "lib/one/one.rb", "test/one/test_one.rb" + rtf = RubyToggleFile.new + assert_equal _("test/one/test_one.rb"), rtf.ruby_toggle_file(_("lib/one/one.rb")) + end + + def test_test_file__exist__libtwo_test + create "lib/two/two.rb", "test/test_two.rb" + rtf = RubyToggleFile.new + assert_equal _("test/test_two.rb"), rtf.ruby_toggle_file(_("lib/two/two.rb")) + end + + def test_test_file__exist__top_test + create "three.rb", "test_three.rb" + rtf = RubyToggleFile.new + assert_equal _("test_three.rb"), rtf.ruby_toggle_file(_("three.rb")) + end + + def test_test_file__not_exist__top + create "four.rb" + rtf = RubyToggleFile.new + assert_equal _("test_four.rb"), rtf.ruby_toggle_file(_("four.rb")) + end + + def test_test_file__not_exist__lib + create "lib/five.rb" + rtf = RubyToggleFile.new + assert_equal _("test/test_five.rb"), rtf.ruby_toggle_file(_("lib/five.rb")) + end + + def test_test_file__not_exist__libsixsix + create "lib/six/six/six.rb" + rtf = RubyToggleFile.new + assert_equal _("test/six/six/test_six.rb"), rtf.ruby_toggle_file(_("lib/six/six/six.rb")) + end + + def test_implementation_file__exist__lib_test + create "lib/zero.rb", "test/test_zero.rb" + rtf = RubyToggleFile.new + assert_equal _("lib/zero.rb"), rtf.ruby_toggle_file(_("test/test_zero.rb")) + end + + def test_implementation_file__exist__libone_testone + create "lib/one/one.rb", "test/one/test_one.rb" + rtf = RubyToggleFile.new + assert_equal _("lib/one/one.rb"), rtf.ruby_toggle_file(_("test/one/test_one.rb")) + end + + def test_implementation_file__exist__libtwo_test + create "lib/two/two.rb", "test/test_two.rb" + rtf = RubyToggleFile.new + assert_equal _("lib/two/two.rb"), rtf.ruby_toggle_file(_("test/test_two.rb")) + end + + def test_implementation_file__exist__top_test + create "three.rb", "test_three.rb" + rtf = RubyToggleFile.new + assert_equal _("three.rb"), rtf.ruby_toggle_file(_("test_three.rb")) + end + + def test_implementation_file__not_exist__none_top + create "test_seven.rb" + rtf = RubyToggleFile.new + assert_equal _("seven.rb"), rtf.ruby_toggle_file(_("test_seven.rb")) + end + + def test_implementation_file__not_exist__none_test + create "test/test_eight.rb" + rtf = RubyToggleFile.new + assert_equal _("lib/eight.rb"), rtf.ruby_toggle_file(_("test/test_eight.rb")) + end + + def test_implementation_file__not_exist__none_testninenine + create "test/nine/nine/nine.rb" + rtf = RubyToggleFile.new + assert_equal _("lib/nine/nine/nine.rb"), rtf.ruby_toggle_file(_("test/nine/nine/test_nine.rb")) + end + + ########################################################################### + # Rails test # + ########################################################################### + def test_test_file__rails_controllers + create "app/controllers/c.rb", "test/functional/c_test.rb" + rtf = RubyToggleFile.new + assert_equal _("test/functional/c_test.rb"), rtf.ruby_toggle_file(_("app/controllers/c.rb")) + end + + def test_test_file__rails_models + create "app/models/m.rb", "test/unit/m_test.rb" + rtf = RubyToggleFile.new + assert_equal _("test/unit/m_test.rb"), rtf.ruby_toggle_file(_("app/models/m.rb")) + end + + def test_test_file__rails_lib + create "lib/l.rb", "test/unit/test_l.rb", "app/models/m.rb" + rtf = RubyToggleFile.new + assert_equal _("test/unit/test_l.rb"), rtf.ruby_toggle_file(_("lib/l.rb")) + end + + + def test_implementation_file__rails_controllers + create "app/controllers/c.rb", "test/functional/c_test.rb" + rtf = RubyToggleFile.new + assert_equal _("app/controllers/c.rb"), rtf.ruby_toggle_file(_("test/functional/c_test.rb")) + end + + def test_implementation_file__rails_models + create "app/models/m.rb", "test/unit/m_test.rb" + rtf = RubyToggleFile.new + assert_equal _("app/models/m.rb"), rtf.ruby_toggle_file(_("test/unit/m_test.rb")) + end + + def test_implementation_file__rails_lib + create "lib/l.rb", "test/unit/test_l.rb", "app/models/m.rb" + rtf = RubyToggleFile.new + assert_equal _("lib/l.rb"), rtf.ruby_toggle_file(_("test/unit/test_l.rb")) + end +end + + +class TestRunHooksWithArgsUntilSuccess < Test::Unit::TestCase + def m001(x) nil end + private + def m002(x) false end + def m003(x) 100*x end + def m004(x) 200 end + + public + def test_run_hooks_with_args_until_success__m003 + assert_equal 1000, run_hooks_with_args_until_success(/^m\d+$/, 10) + end + + def test_run_hooks_with_args_until_success__m001 + assert_nil run_hooks_with_args_until_success(/^m001$/, 10) + end + + def test_run_hooks_with_args_until_success__m004 + assert_equal 200, run_hooks_with_args_until_success(/^m004$/, 10) + end +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/test_xmpfilter.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/test_xmpfilter.rb new file mode 100644 index 000000000..0ed9aa6b8 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/test_xmpfilter.rb @@ -0,0 +1,221 @@ + +require 'test/unit' +$: << ".." << "../lib" +require "rcodetools/xmpfilter" +require 'rubygems' +require 'mocha' + +class TestXMPFilter < Test::Unit::TestCase + include Rcodetools + def test_extract_data__results + marker = XMPFilter::MARKER + str = <<-EOF +#{marker}[1] => Fixnum 42 +#{marker}[1] => Fixnum 0 +#{marker}[1] ==> var +#{marker}[1] ==> var2 +#{marker}[4] ==> var3 +#{marker}[2] ~> some exception +#{marker}[10] => Fixnum 42 + EOF + xmp = XMPFilter.new + data = xmp.extract_data(str) + assert_equal([[1, [["Fixnum", "42"], ["Fixnum", "0"]]], [10, [["Fixnum", "42"]]]], data.results.sort) + end + + def test_extract_data__exceptions + marker = XMPFilter::MARKER + str = <<-EOF +#{marker}[1] => Fixnum 42 +#{marker}[1] => Fixnum 0 +#{marker}[1] ==> var +#{marker}[1] ==> var2 +#{marker}[4] ==> var3 +#{marker}[2] ~> some exception +#{marker}[10] => Fixnum 42 + EOF + xmp = XMPFilter.new + data = xmp.extract_data(str) + assert_equal([[2, ["some exception"]]], data.exceptions.sort) + end + + def test_extract_data__bindings + marker = XMPFilter::MARKER + str = <<-EOF +#{marker}[1] => Fixnum 42 +#{marker}[1] => Fixnum 0 +#{marker}[1] ==> var +#{marker}[1] ==> var2 +#{marker}[4] ==> var3 +#{marker}[2] ~> some exception +#{marker}[10] => Fixnum 42 + EOF + xmp = XMPFilter.new + data = xmp.extract_data(str) + assert_equal([[1, ["var", "var2"]], [4, ["var3"]]], data.bindings.sort) + end + + def test_interpreter_command + xmp = XMPFilter.new(:interpreter=>"ruby", :detect_rct_fork => false) + assert_equal(%w[ruby -w], xmp.interpreter_command) + end + + def test_interpreter_command_detect_rct_fork + Fork.stubs(:run?).returns true + xmp = XMPFilter.new(:interpreter=>"ruby", :detect_rct_fork => true) + assert_equal(%w[ruby -S rct-fork-client], xmp.interpreter_command) + end + + def test_interpreter_command_use_rbtest + xmp = XMPFilter.new(:interpreter=>"ruby", :use_rbtest => true) + assert_equal(%w[ruby -S rbtest], xmp.interpreter_command) + end + + def test_initialize__test_script_1 + XMPFilter.any_instance.stubs(:safe_require_code).returns("require 'test/unit'") + xmp = XMPFilter.new(:test_script=>"/path/to/test/test_ruby_toggle_file.rb", + :test_method=>"test_implementation_file_file_exist", + :filename=>"/path/to/lib/ruby_toggle_file.rb") + + evals_expected = [ + %q!$LOADED_FEATURES << "ruby_toggle_file.rb"!, + %q!require 'test/unit'!, + %q!load "/path/to/test/test_ruby_toggle_file.rb"!, + %q!Test::Unit::AutoRunner.run(false, nil, ["-n", "test_implementation_file_file_exist"])! + ] + assert_equal evals_expected, xmp.instance_variable_get(:@evals) + end + + def test_initialize__test_script_2 + XMPFilter.any_instance.stubs(:safe_require_code).returns("require 'test/unit'") + xmp = XMPFilter.new(:test_script=>"/path/to/test_ruby_toggle_file.rb", + :test_method=>"test_implementation_file_file_exist", + :filename=>"/path/to/ruby_toggle_file.rb") + + evals_expected = [ + %q!$LOADED_FEATURES << "ruby_toggle_file.rb"!, + %q!require 'test/unit'!, + %q!load "/path/to/test_ruby_toggle_file.rb"!, + %q!Test::Unit::AutoRunner.run(false, nil, ["-n", "test_implementation_file_file_exist"])! + ] + assert_equal evals_expected, xmp.instance_variable_get(:@evals) + end + + def test_initialize__test_script_3 + test_script = File.join(File.dirname(__FILE__), "data/sample_test_script.rb") + filename = File.join(File.dirname(__FILE__), "data/sample.rb") + XMPFilter.any_instance.stubs(:safe_require_code).returns("require 'test/unit'") + xmp = XMPFilter.new(:test_script=>test_script, :test_method=>"4", :filename=>filename) + + evals_expected = [ + %q!$LOADED_FEATURES << "sample.rb"!, + %q!require 'test/unit'!, + %Q!load #{test_script.dump}!, + %q!Test::Unit::AutoRunner.run(false, nil, ["-n", "test_sample0"])! + ] + assert_equal evals_expected, xmp.instance_variable_get(:@evals) + end + + def test_initialize__test_script__filename_eq_test_script + test_script = File.join(File.dirname(__FILE__), "data/sample_test_script.rb") + filename = test_script + xmp = XMPFilter.new(:test_script=>test_script, :test_method=>"4", :filename=>filename) + + evals_expected = [ + %q!Test::Unit::AutoRunner.run(false, nil, ["-n", "test_sample0"])! + ] + assert_equal evals_expected, xmp.instance_variable_get(:@evals) + end + + def test_get_test_method_from_lineno + file = File.join(File.dirname(__FILE__), "data/sample_test_script.rb") + xmp = XMPFilter.new + assert_equal("test_sample0", xmp.get_test_method_from_lineno(file, 4)) + assert_equal("test_sample1", xmp.get_test_method_from_lineno(file, 7)) + assert_equal("test_sample1", xmp.get_test_method_from_lineno(file, 8)) + assert_equal(nil, xmp.get_test_method_from_lineno(file, 1)) + end + + # Use methods to avoid confusing syntax highlighting + def beg() "=begin" end + def ed() "=end" end + + def test_s_detect_rbtest_1 + rbtest_script_1 = < true} + assert_equal true, XMPFilter.detect_rbtest(rbtest_script_1, opts) + assert_equal true, opts[:use_rbtest] + opts = {:detect_rbtest => false} + assert_equal false, XMPFilter.detect_rbtest(rbtest_script_1, opts) + assert_equal false, opts[:use_rbtest] + opts = {:detect_rbtest => false, :use_rbtest => true} + assert_equal true, XMPFilter.detect_rbtest(rbtest_script_1, opts) + assert_equal true, opts[:use_rbtest] + end + + def test_s_detect_rbtest_2 + rbtest_script_2 = < true} + assert_equal true, XMPFilter.detect_rbtest(rbtest_script_2, opts) + assert_equal true, opts[:use_rbtest] + opts = {:detect_rbtest => false} + assert_equal false, XMPFilter.detect_rbtest(rbtest_script_2, opts) + assert_equal false, opts[:use_rbtest] + end + + def test_s_detect_rbtest_3 + no_rbtest_script = < true} + assert_equal false, XMPFilter.detect_rbtest(no_rbtest_script, opts) + assert_equal false, opts[:use_rbtest] + opts = {:detect_rbtest => false} + assert_equal false, XMPFilter.detect_rbtest(no_rbtest_script, opts) + assert_equal false, opts[:use_rbtest] + end + +end + +class TestTempScript < Test::Unit::TestCase + def test(script) + Rcodetools::XMPFilter.new.__send__(:split_shbang,script) + end + + def test_none + assert_equal [[], ["1\n"]], test(< +arr.last # \=> +EOF + ANNOTATION_VAR_INFERENCE_OUTPUT = <]\", arr.inspect) +assert_equal(x, arr.last) +assert_kind_of(X, arr.last) +assert_equal(\"#\", arr.last.inspect) +EOF + + def test_annotation_var_inference + xmp = XMPTestUnitFilter.new + assert_equal(ANNOTATION_VAR_INFERENCE_OUTPUT, + xmp.annotate(ANNOTATION_VAR_INFERENCE_INPUT).join("")) + end + + def test_equality_assertions + xmp = XMPTestUnitFilter.new + assert_equal(["a = 1\n", "assert_equal(1, a)"], xmp.annotate("a = 1\na # \=>")) + assert_equal(["a = {1,2}\n", "assert_equal({1=>2}, a)"], + xmp.annotate("a = {1,2}\na # \=>")) + assert_equal(["a = [1,2]\n", "assert_equal([1, 2], a)"], + xmp.annotate("a = [1,2]\na # \=>")) + assert_equal(["a = 'foo'\n", "assert_equal(\"foo\", a)"], + xmp.annotate("a = 'foo'\na # \=>")) + assert_equal(["a = 1.0\n", "assert_in_delta(1.0, a, 0.0001)"], + xmp.annotate("a = 1.0\na # \=>")) + end + + def test_raise_assertion + code = < +EOF + xmp = XMPTestUnitFilter.new + assert_equal(["class NoGood < Exception; end\n", + "assert_raise(NoGood){raise NoGood}\n"], xmp.annotate(code)) + end + + def test_assert_nil + xmp = XMPTestUnitFilter.new + assert_equal(["a = nil\n", "assert_nil(a)"], xmp.annotate("a = nil\na # \=>")) + end + + def test_poetry_mode + code = < +a = 1.0 +a # \=> +raise "foo" # \=> +a = nil +a # \=> +EOF + output = < false) + assert_equal(output, xmp.annotate(code).join) + end +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/tmp_functional.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/tmp_functional.rb new file mode 100644 index 000000000..339fdfc2b --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/tmp_functional.rb @@ -0,0 +1,162 @@ +require 'test/unit' + +module TestFunctional + DIR = File.expand_path(File.dirname(__FILE__)) + LIBDIR = File.expand_path(DIR + '/../lib') + + module DefineFunctionalTests + def define_functional_tests(bin, exec, tests) + tests.each_pair do |test, opts| + define_method("test_#{test}") do + + output = `ruby -I#{LIBDIR} #{exec} #{opts.join(" ")} #{DIR}/data/#{test}-input.rb` + outputfile = "#{DIR}/data/#{test}-output.rb" + taffile = "#{DIR}/data/#{bin}/#{test}.taf" + open(taffile, "w") do |f| + f.puts "==========" + f.puts test + f.puts "==========" + f.puts bin + " " + opts.join(" ") + f.puts "==========" + f.puts File.read("#{DIR}/data/#{test}-input.rb") + f.puts "==========" + f.puts File.read("#{DIR}/data/#{test}-output.rb") + end +# assert_equal(File.read(outputfile), output) + end + end + end + end + + class TestXmpfilter < Test::Unit::TestCase + extend DefineFunctionalTests + tests = { + :simple_annotation => [], :unit_test => ["-u"], :rspec => ["-s"], + :no_warnings => ["--no-warnings"], :bindings => ["--poetry", "-u"], + :add_markers => ["-m"], :unit_test_rbtest => ["-u", "--rbtest"], + :unit_test_detect_rbtest => ["-u", "--detect-rbtest"], + :unit_test_detect_rbtest2 => ["--detect-rbtest"], + } + define_functional_tests "xmpfilter", File.expand_path(DIR + '/../bin/xmpfilter'), tests + end + + class TestRctComplete < Test::Unit::TestCase + extend DefineFunctionalTests + tests = { + :completion_rbtest => [ "--rbtest", "--line=6" ], + :completion_detect_rbtest => [ "--detect-rbtest", "--line=6" ], + :completion_detect_rbtest2 => [ "--detect-rbtest", "--line=1" ], + } + define_functional_tests "rct-complete", File.expand_path(DIR + '/../bin/rct-complete'), tests + end + + class TestRctDoc < Test::Unit::TestCase + extend DefineFunctionalTests + tests = { + :doc_rbtest => [ "--rbtest", "--line=6" ], + :doc_detect_rbtest => [ "--detect-rbtest", "--line=1" ], + :doc_detect_rbtest2 => [ "--detect-rbtest", "--line=6" ], + } + define_functional_tests "rct-doc", File.expand_path(DIR + '/../bin/rct-doc'), tests + end + + + # Other tests are in test_run.rb + class TestRctCompleteTDC < Test::Unit::TestCase + test = :completion_in_method + inputfile = "#{DIR}/data/#{test}-input.rb" + outputfile = "#{DIR}/data/#{test}-output.rb" + test_script = "#{DIR}/data/#{test}-test.rb" + common_opts = ["--filename #{inputfile}", "--line 2"] + right_output = File.read(outputfile) + wrong_output = "\n" + + tests = { + :completion_in_method__testscript => + [ common_opts + ["-t #{test_script}"], right_output ], + :completion_in_method__testmethod => + [ common_opts + ["-t #{test_script}@test_fooz"], right_output ], + :completion_in_method__wrong_testmethod => + [ common_opts + ["-t #{test_script}@test_NOT_FOUND"], wrong_output ], + } + exec = File.expand_path(DIR + '/../bin/rct-complete') +# tests.each_pair do |test, (opts, expected)| +# define_method("test_#{test}") do +# output = `ruby -I#{LIBDIR} #{exec} #{opts.join(" ")} #{inputfile}` + +# taffile = "#{DIR}/data/#{bin}/#{test}.taf" +# open(taffile, "w") do |f| +# f.puts "==========" +# f.puts test +# f.puts "==========" +# f.puts bin + " " + opts.join(" ") +# f.puts "==========" +# f.puts File.read("#{DIR}/data/#{test}-input.rb") +# f.puts "==========" +# f.puts File.read("#{DIR}/data/#{test}-output.rb") +# end +# end +# end + + test=:completion_in_method__testscript + define_method("test_#{test}") do + taffile = "#{DIR}/data/rct-complete-TDC/completion_in_method__testscript.taf" + open(taffile, "w") do |f| + opts = tests[test] + f.puts "==========" + f.puts test + f.puts "==========" + f.puts "rct-complete " + opts.join(" ") + f.puts "==========" + test0 = :completion_in_method + f.puts File.read("#{DIR}/data/#{test0}-input.rb") + f.puts "==========" + f.puts File.read("#{DIR}/data/#{test0}-output.rb") + f.puts "==========" + f.puts File.read("#{DIR}/data/#{test0}-test.rb") + end + + end + + test=:completion_in_method__testmethod + define_method("test_#{test}") do + taffile = "#{DIR}/data/rct-complete-TDC/completion_in_method__testmethod.taf" + open(taffile, "w") do |f| + opts = tests[test] + f.puts "==========" + f.puts test + f.puts "==========" + f.puts "rct-complete " + opts.join(" ") + f.puts "==========" + test0 = :completion_in_method + f.puts File.read("#{DIR}/data/#{test0}-input.rb") + f.puts "==========" + f.puts File.read("#{DIR}/data/#{test0}-output.rb") + f.puts "==========" + f.puts File.read("#{DIR}/data/#{test0}-test.rb") + end + + end + + test=:completion_in_method__wrong_testmethod + define_method("test_#{test}") do + taffile = "#{DIR}/data/rct-complete-TDC/completion_in_method__wrong_testmethod.taf" + open(taffile, "w") do |f| + opts = tests[test] + f.puts "==========" + f.puts test + f.puts "==========" + f.puts "rct-complete " + opts.join(" ") + f.puts "==========" + test0 = :completion_in_method + f.puts File.read("#{DIR}/data/#{test0}-input.rb") + f.puts "==========" + f.puts + f.puts "==========" + f.puts File.read("#{DIR}/data/#{test0}-test.rb") + end + + end + + end +end diff --git a/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/tmp_run.rb b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/tmp_run.rb new file mode 100644 index 000000000..b3bed0d01 --- /dev/null +++ b/bundles/ruby.tmbundle/Support/vendor/rcodetools/test/tmp_run.rb @@ -0,0 +1,66 @@ +require 'test/unit' +require 'rcodetools/xmpfilter' +require 'rcodetools/xmptestunitfilter' +require 'rcodetools/completion' +require 'rcodetools/doc' +require 'rcodetools/options' +require 'stringio' + +class TestRun < Test::Unit::TestCase + include Rcodetools + DIR = File.expand_path(File.dirname(__FILE__)) + + tests = { +# :rspec_poetry => {:klass => XMPRSpecFilter, :interpreter => "spec", :use_parentheses => false}, + :rspec_poetry => ["xmpfilter", "-s --poetry"], +# :unit_test_poetry => {:klass => XMPTestUnitFilter, :use_parentheses => false}, + :unit_test_poetry => ["xmpfilter", "-u --poetry"], + +# :completion => {:klass => XMPCompletionFilter, :lineno => 1}, + :completion => ["rct-complete", "-C --line=1"], +# :completion_emacs => {:klass => XMPCompletionEmacsFilter, :lineno => 1}, + :completion_emacs => ["rct-complete", "--completion-emacs --line=1"], +# :completion_emacs_icicles => {:klass => XMPCompletionEmacsIciclesFilter, :lineno => 1}, + :completion_emacs_icicles => ["rct-complete","--completion-emacs-icicles --line=1"], +# :completion_class_info => {:klass => XMPCompletionClassInfoFilter, :lineno => 1}, + :completion_class_info => ["rct-complete", "--completion-class-info --line=1"], +# :completion_class_info_no_candidates => {:klass => XMPCompletionClassInfoFilter, :lineno => 1}, + :completion_class_info_no_candidates => ["rct-complete", "--completion-class-info --line=1"], + +# :doc => {:klass => XMPDocFilter, :lineno => 1}, +# :refe => {:klass => XMPReFeFilter, :lineno => 1}, +# :ri => {:klass => XMPRiFilter, :lineno => 1}, +# :ri_emacs => {:klass => XMPRiEmacsFilter, :lineno => 1}, +# :ri_vim => {:klass => XMPRiVimFilter, :lineno => 1}, + :doc => ["rct-doc", "-D --line=1"], + :refe => ["rct-doc", "--refe --line=1"], + :ri => ["rct-doc", "--ri --line=1"], + :ri_emacs => ["rct-doc", "--ri-emacs --line=1"], + :ri_vim => ["rct-doc", "--ri-vim --line=1"], + + } + DIR = File.expand_path(File.dirname(__FILE__)) + LIBDIR = File.expand_path(DIR + '/../lib') + + tests.each_pair do |test, (bin,opts)| + define_method("test_#{test}") do + inputfile = "#{DIR}/data/#{test}-input.rb" + outputfile = "#{DIR}/data/#{test}-output.rb" + +# exec = File.expand_path(DIR + '/../bin/xmpfilter') +# output = `ruby -I#{LIBDIR} #{exec} #{opts} #{DIR}/data/#{test}-input.rb` +# outputfile = "#{DIR}/data/#{test}-output.rb" + taffile = "#{DIR}/data/#{bin}/#{test}.taf" + open(taffile, "w") do |f| + f.puts "==========" + f.puts test + f.puts "==========" + f.puts bin + " " + opts + f.puts "==========" + f.puts File.read("#{DIR}/data/#{test}-input.rb") + f.puts "==========" + f.puts File.read("#{DIR}/data/#{test}-output.rb") + end + end + end +end diff --git a/bundles/ruby.tmbundle/Syntaxes/Ruby.plist b/bundles/ruby.tmbundle/Syntaxes/Ruby.plist new file mode 100644 index 000000000..8070bb973 --- /dev/null +++ b/bundles/ruby.tmbundle/Syntaxes/Ruby.plist @@ -0,0 +1,2853 @@ + + + + + comment + + TODO: unresolved issues + + text: + "p << end + print me! + end" + symptoms: + not recognized as a heredoc + solution: + there is no way to distinguish perfectly between the << operator and the start + of a heredoc. Currently, we require assignment to recognize a heredoc. More + refinement is possible. + • Heredocs with indented terminators (<<-) are always distinguishable, however. + • Nested heredocs are not really supportable at present + + text: + print <<-'THERE' + This is single quoted. + The above used #{Time.now} + THERE + symtoms: + From Programming Ruby p306; should be a non-interpolated heredoc. + + text: + "a\332a" + symptoms: + '\332' is not recognized as slash3.. which should be octal 332. + solution: + plain regexp.. should be easy. + + text: + val?(a):p(b) + val?'a':'b' + symptoms: + ':p' is recognized as a symbol.. its 2 things ':' and 'p'. + :'b' has same problem. + solution: + ternary operator rule, precedence stuff, symbol rule. + but also consider 'a.b?(:c)' ?? + + fileTypes + + rb + rbx + rjs + Rakefile + rake + cgi + fcgi + gemspec + irbrc + capfile + + firstLineMatch + ^#!/.*\bruby + foldingStartMarker + (?x)^ + (\s*+ + (module|class|def(?!.*\bend\s*$) + |unless|if + |case + |begin + |for|while|until + |^=begin + |( "(\\.|[^"])*+" # eat a double quoted string + | '(\\.|[^'])*+' # eat a single quoted string + | [^#"'] # eat all but comments and strings + )* + ( \s (do|begin|case) + | (?<!\$)[-+=&|*/~%^<>~] \s*+ (if|unless) + ) + )\b + (?! [^;]*+ ; .*? \bend\b ) + |( "(\\.|[^"])*+" # eat a double quoted string + | '(\\.|[^'])*+' # eat a single quoted string + | [^#"'] # eat all but comments and strings + )* + ( \{ (?! [^}]*+ \} ) + | \[ (?! [^\]]*+ \] ) + ) + ).*$ + | [#] .*? \(fold\) \s*+ $ # Sune’s special marker + + foldingStopMarker + (?x) + ( (^|;) \s*+ end \s*+ ([#].*)? $ + | (^|;) \s*+ end \. .* $ + | ^ \s*+ [}\]] ,? \s*+ ([#].*)? $ + | [#] .*? \(end\) \s*+ $ # Sune’s special marker + | ^=end + ) + keyEquivalent + ^~R + name + Ruby + patterns + + + captures + + 1 + + name + keyword.control.class.ruby + + 2 + + name + entity.name.type.class.ruby + + 4 + + name + entity.other.inherited-class.ruby + + 5 + + name + punctuation.separator.inheritance.ruby + + 6 + + name + variable.other.object.ruby + + 7 + + name + punctuation.definition.variable.ruby + + + match + ^\s*(class)\s+(([.a-zA-Z0-9_:]+(\s*(<)\s*[.a-zA-Z0-9_:]+)?)|((<<)\s*[.a-zA-Z0-9_:]+)) + name + meta.class.ruby + + + captures + + 1 + + name + keyword.control.module.ruby + + 2 + + name + entity.name.type.module.ruby + + 3 + + name + entity.other.inherited-class.module.first.ruby + + 4 + + name + punctuation.separator.inheritance.ruby + + 5 + + name + entity.other.inherited-class.module.second.ruby + + 6 + + name + punctuation.separator.inheritance.ruby + + 7 + + name + entity.other.inherited-class.module.third.ruby + + 8 + + name + punctuation.separator.inheritance.ruby + + + match + ^\s*(module)\s+(([A-Z]\w*(::))?([A-Z]\w*(::))?([A-Z]\w*(::))*[A-Z]\w*) + name + meta.module.ruby + + + comment + else if is a common mistake carried over from other languages. it works if you put in a second end, but it’s never what you want. + match + (?<!\.)\belse(\s)+if\b + name + invalid.deprecated.ruby + + + comment + everything being a reserved word, not a value and needing a 'end' is a.. + match + (?<!\.)\b(BEGIN|begin|case|class|else|elsif|END|end|ensure|for|if|in|module|rescue|then|unless|until|when|while)\b(?![?!]) + name + keyword.control.ruby + + + comment + contextual smart pair support for block parameters + match + (?<!\.)\bdo\b\s* + name + keyword.control.start-block.ruby + + + comment + contextual smart pair support + match + (?<=\{)(\s+) + name + meta.syntax.ruby.start-block + + + comment + as above, just doesn't need a 'end' and does a logic operation + match + (?<!\.)\b(and|not|or)\b + name + keyword.operator.logical.ruby + + + comment + just as above but being not a logical operation + match + (?<!\.)\b(alias|alias_method|break|next|redo|retry|return|super|undef|yield)\b(?![?!])|\bdefined\?|\bblock_given\? + name + keyword.control.pseudo-method.ruby + + + match + \b(nil|true|false)\b(?![?!]) + name + constant.language.ruby + + + match + \b(__(FILE|LINE)__|self)\b(?![?!]) + name + variable.language.ruby + + + comment + everything being a method but having a special function is a.. + match + \b(initialize|new|loop|include|extend|raise|attr_reader|attr_writer|attr_accessor|attr|catch|throw|private|module_function|public|protected)\b(?![?!]) + name + keyword.other.special-method.ruby + + + begin + \b(require|gem)\b + captures + + 1 + + name + keyword.other.special-method.ruby + + + end + $|(?=#) + name + meta.require.ruby + patterns + + + include + $self + + + + + captures + + 1 + + name + punctuation.definition.variable.ruby + + + match + (@)[a-zA-Z_]\w* + name + variable.other.readwrite.instance.ruby + + + captures + + 1 + + name + punctuation.definition.variable.ruby + + + match + (@@)[a-zA-Z_]\w* + name + variable.other.readwrite.class.ruby + + + captures + + 1 + + name + punctuation.definition.variable.ruby + + + match + (\$)[a-zA-Z_]\w* + name + variable.other.readwrite.global.ruby + + + captures + + 1 + + name + punctuation.definition.variable.ruby + + + match + (\$)(!|@|&|`|'|\+|\d+|~|=|/|\\|,|;|\.|<|>|_|\*|\$|\?|:|"|-[0adFiIlpv]) + name + variable.other.readwrite.global.pre-defined.ruby + + + begin + \b(ENV)\[ + beginCaptures + + 1 + + name + variable.other.constant.ruby + + + end + \] + name + meta.environment-variable.ruby + patterns + + + include + $self + + + + + match + \b[A-Z]\w*(?=((\.|::)[A-Za-z]|\[)) + name + support.class.ruby + + + match + \b[A-Z]\w*\b + name + variable.other.constant.ruby + + + begin + (?x) + (?=def\b) # an optimization to help Oniguruma fail fast + (?<=^|\s)(def)\s+ # the def keyword + ( (?>[a-zA-Z_]\w*(?>\.|::))? # a method name prefix + (?>[a-zA-Z_]\w*(?>[?!]|=(?!>))? # the method name + |===?|>[>=]?|<=>|<[<=]?|[%&`/\|]|\*\*?|=?~|[-+]@?|\[\]=?) ) # …or an operator method + \s*(\() # the openning parenthesis for arguments + + beginCaptures + + 1 + + name + keyword.control.def.ruby + + 2 + + name + entity.name.function.ruby + + 3 + + name + punctuation.definition.parameters.ruby + + + comment + the method pattern comes from the symbol pattern, see there for a explaination + contentName + variable.parameter.function.ruby + end + \) + endCaptures + + 0 + + name + punctuation.definition.parameters.ruby + + + name + meta.function.method.with-arguments.ruby + patterns + + + include + $self + + + + + begin + (?x) + (?=def\b) # an optimization to help Oniguruma fail fast + (?<=^|\s)(def)\s+ # the def keyword + ( (?>[a-zA-Z_]\w*(?>\.|::))? # a method name prefix + (?>[a-zA-Z_]\w*(?>[?!]|=(?!>))? # the method name + |===?|>[>=]?|<=>|<[<=]?|[%&`/\|]|\*\*?|=?~|[-+]@?|\[\]=?) ) # …or an operator method + [ \t] # the space separating the arguments + (?=[ \t]*[^\s#;]) # make sure arguments and not a comment follow + + beginCaptures + + 1 + + name + keyword.control.def.ruby + + 2 + + name + entity.name.function.ruby + + + comment + same as the previous rule, but without parentheses around the arguments + contentName + variable.parameter.function.ruby + end + $ + name + meta.function.method.with-arguments.ruby + patterns + + + include + $self + + + + + captures + + 1 + + name + keyword.control.def.ruby + + 3 + + name + entity.name.function.ruby + + + comment + the optional name is just to catch the def also without a method-name + match + (?x) + (?=def\b) # an optimization to help Oniguruma fail fast + (?<=^|\s)(def)\b # the def keyword + ( \s+ # an optional group of whitespace followed by… + ( (?>[a-zA-Z_]\w*(?>\.|::))? # a method name prefix + (?>[a-zA-Z_]\w*(?>[?!]|=(?!>))? # the method name + |===?|>[>=]?|<=>|<[<=]?|[%&`/\|]|\*\*?|=?~|[-+]@?|\[\]=?) ) )? # …or an operator method + + name + meta.function.method.without-arguments.ruby + + + match + \b(0[xX]\h(?>_?\h)*|\d(?>_?\d)*(\.(?![^[:space:][:digit:]])(?>_?\d)*)?([eE][-+]?\d(?>_?\d)*)?|0[bB][01]+)\b + name + constant.numeric.ruby + + + begin + :' + captures + + 0 + + name + punctuation.definition.constant.ruby + + + end + ' + name + constant.other.symbol.single-quoted.ruby + patterns + + + match + \\['\\] + name + constant.character.escape.ruby + + + + + begin + :" + captures + + 0 + + name + punctuation.definition.constant.ruby + + + end + " + name + constant.other.symbol.double-quoted.ruby + patterns + + + include + #interpolated_ruby + + + include + #escaped_char + + + + + comment + Needs higher precidence than regular expressions. + match + (?<!\()/= + name + keyword.operator.assignment.augmented.ruby + + + begin + ' + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + single quoted string (does not allow interpolation) + end + ' + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.quoted.single.ruby + patterns + + + match + \\'|\\\\ + name + constant.character.escape.ruby + + + + + begin + " + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + double quoted string (allows for interpolation) + end + " + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.quoted.double.ruby + patterns + + + include + #interpolated_ruby + + + include + #escaped_char + + + + + begin + ` + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + execute string (allows for interpolation) + end + ` + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.interpolated.ruby + patterns + + + include + #interpolated_ruby + + + include + #escaped_char + + + + + begin + %x\{ + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + execute string (allow for interpolation) + end + \} + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.interpolated.ruby + patterns + + + include + #interpolated_ruby + + + include + #escaped_char + + + include + #nest_curly_i + + + + + begin + %x\[ + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + execute string (allow for interpolation) + end + \] + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.interpolated.ruby + patterns + + + include + #interpolated_ruby + + + include + #escaped_char + + + include + #nest_brackets_i + + + + + begin + %x\< + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + execute string (allow for interpolation) + end + \> + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.interpolated.ruby + patterns + + + include + #interpolated_ruby + + + include + #escaped_char + + + include + #nest_ltgt_i + + + + + begin + %x\( + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + execute string (allow for interpolation) + end + \) + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.interpolated.ruby + patterns + + + include + #interpolated_ruby + + + include + #escaped_char + + + include + #nest_parens_i + + + + + begin + %x([^\w]) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + execute string (allow for interpolation) + end + \1 + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.interpolated.ruby + patterns + + + include + #interpolated_ruby + + + include + #escaped_char + + + + + begin + (?x) + (?: + ^ # beginning of line + | (?<= # or look-behind on: + [=>~(?:\[,|&;] + | [\s;]if\s # keywords + | [\s;]elsif\s + | [\s;]while\s + | [\s;]unless\s + | [\s;]when\s + | [\s;]assert_match\s + | [\s;]or\s # boolean opperators + | [\s;]and\s + | [\s;]not\s + | [\s.]index\s # methods + | [\s.]scan\s + | [\s.]sub\s + | [\s.]sub!\s + | [\s.]gsub\s + | [\s.]gsub!\s + | [\s.]match\s + ) + | (?<= # or a look-behind with line anchor: + ^when\s # duplication necessary due to limits of regex + | ^if\s + | ^elsif\s + | ^while\s + | ^unless\s + ) + ) + \s*((/))(?![*+{}?]) + + captures + + 1 + + name + string.regexp.classic.ruby + + 2 + + name + punctuation.definition.string.ruby + + + comment + regular expressions (normal) + we only start a regexp if the character before it (excluding whitespace) + is what we think is before a regexp + + contentName + string.regexp.classic.ruby + end + ((/[eimnosux]*)) + patterns + + + include + #regex_sub + + + + + begin + %r\{ + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + regular expressions (literal) + end + \}[eimnosux]* + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.regexp.mod-r.ruby + patterns + + + include + #regex_sub + + + include + #nest_curly_r + + + + + begin + %r\[ + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + regular expressions (literal) + end + \][eimnosux]* + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.regexp.mod-r.ruby + patterns + + + include + #regex_sub + + + include + #nest_brackets_r + + + + + begin + %r\( + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + regular expressions (literal) + end + \)[eimnosux]* + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.regexp.mod-r.ruby + patterns + + + include + #regex_sub + + + include + #nest_parens_r + + + + + begin + %r\< + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + regular expressions (literal) + end + \>[eimnosux]* + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.regexp.mod-r.ruby + patterns + + + include + #regex_sub + + + include + #nest_ltgt_r + + + + + begin + %r([^\w]) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + regular expressions (literal) + end + \1[eimnosux]* + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.regexp.mod-r.ruby + patterns + + + include + #regex_sub + + + + + begin + %[QWSR]?\( + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + literal capable of interpolation () + end + \) + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.quoted.other.literal.upper.ruby + patterns + + + include + #interpolated_ruby + + + include + #escaped_char + + + include + #nest_parens_i + + + + + begin + %[QWSR]?\[ + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + literal capable of interpolation [] + end + \] + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.quoted.other.literal.upper.ruby + patterns + + + include + #interpolated_ruby + + + include + #escaped_char + + + include + #nest_brackets_i + + + + + begin + %[QWSR]?\< + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + literal capable of interpolation <> + end + \> + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.quoted.other.literal.upper.ruby + patterns + + + include + #interpolated_ruby + + + include + #escaped_char + + + include + #nest_ltgt_i + + + + + begin + %[QWSR]?\{ + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + literal capable of interpolation -- {} + end + \} + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.quoted.double.ruby.mod + patterns + + + include + #interpolated_ruby + + + include + #escaped_char + + + include + #nest_curly_i + + + + + begin + %[QWSR]([^\w]) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + literal capable of interpolation -- wildcard + end + \1 + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.quoted.other.literal.upper.ruby + patterns + + + include + #interpolated_ruby + + + include + #escaped_char + + + + + begin + %([^\w\s=]) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + literal capable of interpolation -- wildcard + end + \1 + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.quoted.other.literal.other.ruby + patterns + + + include + #interpolated_ruby + + + include + #escaped_char + + + + + begin + %[qws]\( + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + literal incapable of interpolation -- () + end + \) + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.quoted.other.literal.lower.ruby + patterns + + + match + \\\)|\\\\ + name + constant.character.escape.ruby + + + include + #nest_parens + + + + + begin + %[qws]\< + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + literal incapable of interpolation -- <> + end + \> + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.quoted.other.literal.lower.ruby + patterns + + + match + \\\>|\\\\ + name + constant.character.escape.ruby + + + include + #nest_ltgt + + + + + begin + %[qws]\[ + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + literal incapable of interpolation -- [] + end + \] + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.quoted.other.literal.lower.ruby + patterns + + + match + \\\]|\\\\ + name + constant.character.escape.ruby + + + include + #nest_brackets + + + + + begin + %[qws]\{ + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + literal incapable of interpolation -- {} + end + \} + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.quoted.other.literal.lower.ruby + patterns + + + match + \\\}|\\\\ + name + constant.character.escape.ruby + + + include + #nest_curly + + + + + begin + %[qws]([^\w]) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + literal incapable of interpolation -- wildcard + end + \1 + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.quoted.other.literal.lower.ruby + patterns + + + comment + Cant be named because its not neccesarily an escape. + match + \\. + + + + + captures + + 1 + + name + punctuation.definition.constant.ruby + + + comment + symbols + match + (?<!:)(:)(?>[a-zA-Z_]\w*(?>[?!]|=(?![>=]))?|===?|>[>=]?|<[<=]?|<=>|[%&`/\|]|\*\*?|=?~|[-+]@?|\[\]=?|@@?[a-zA-Z_]\w*) + name + constant.other.symbol.ruby + + + captures + + 1 + + name + punctuation.definition.constant.ruby + + + comment + symbols + match + (?>[a-zA-Z_]\w*(?>[?!])?)(:)(?!:) + name + constant.other.symbol.ruby.19syntax + + + begin + ^=begin + captures + + 0 + + name + punctuation.definition.comment.ruby + + + comment + multiline comments + end + ^=end + name + comment.block.documentation.ruby + + + captures + + 1 + + name + punctuation.definition.comment.ruby + + + match + (?:^[ \t]+)?(#).*$\n? + name + comment.line.number-sign.ruby + + + comment + + matches questionmark-letters. + + examples (1st alternation = hex): + ?\x1 ?\x61 + + examples (2nd alternation = octal): + ?\0 ?\07 ?\017 + + examples (3rd alternation = escaped): + ?\n ?\b + + examples (4th alternation = meta-ctrl): + ?\C-a ?\M-a ?\C-\M-\C-\M-a + + examples (4th alternation = normal): + ?a ?A ?0 + ?* ?" ?( + ?. ?# + + + the negative lookbehind prevents against matching + p(42.tainted?) + + match + (?<!\w)\?(\\(x\h{1,2}(?!\h)\b|0[0-7]{0,2}(?![0-7])\b|[^x0MC])|(\\[MC]-)+\w|[^\s\\]) + name + constant.numeric.ruby + + + begin + ^__END__\n + captures + + 0 + + name + string.unquoted.program-block.ruby + + + comment + __END__ marker + contentName + text.plain + end + (?=not)impossible + patterns + + + begin + (?=<?xml|<(?i:html\b)|!DOCTYPE (?i:html\b)) + end + (?=not)impossible + name + text.html.embedded.ruby + patterns + + + include + text.html.basic + + + + + + + begin + (?><<-("?)((?:[_\w]+_|)HTML)\b\1) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + heredoc with embedded HTML and indented terminator + contentName + text.html.embedded.ruby + end + \s*\2$ + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.unquoted.embedded.html.ruby + patterns + + + include + #heredoc + + + include + text.html.basic + + + include + #interpolated_ruby + + + include + #escaped_char + + + + + begin + (?><<-("?)((?:[_\w]+_|)SQL)\b\1) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + heredoc with embedded SQL and indented terminator + contentName + text.sql.embedded.ruby + end + \s*\2$ + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.unquoted.embedded.sql.ruby + patterns + + + include + #heredoc + + + include + source.sql + + + include + #interpolated_ruby + + + include + #escaped_char + + + + + begin + (?><<-("?)((?:[_\w]+_|)CSS)\b\1) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + heredoc with embedded css and intented terminator + contentName + text.css.embedded.ruby + end + \s*\2$ + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.unquoted.embedded.css.ruby + patterns + + + include + #heredoc + + + include + source.css + + + include + #interpolated_ruby + + + include + #escaped_char + + + + + begin + (?><<-("?)((?:[_\w]+_|)CPP)\b\1) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + heredoc with embedded c++ and intented terminator + contentName + text.c++.embedded.ruby + end + \s*\2$ + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.unquoted.embedded.cplusplus.ruby + patterns + + + include + #heredoc + + + include + source.c++ + + + include + #interpolated_ruby + + + include + #escaped_char + + + + + begin + (?><<-("?)((?:[_\w]+_|)C)\b\1) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + heredoc with embedded c++ and intented terminator + contentName + text.c.embedded.ruby + end + \s*\2$ + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.unquoted.embedded.c.ruby + patterns + + + include + #heredoc + + + include + source.c + + + include + #interpolated_ruby + + + include + #escaped_char + + + + + begin + (?><<-("?)((?:[_\w]+_|)(?:JS|JAVASCRIPT))\b\1) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + heredoc with embedded javascript and intented terminator + contentName + text.js.embedded.ruby + end + \s*\2$ + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.unquoted.embedded.js.ruby + patterns + + + include + #heredoc + + + include + source.js + + + include + #interpolated_ruby + + + include + #escaped_char + + + + + begin + (?><<-("?)((?:[_\w]+_|)JQUERY)\b\1) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + heredoc with embedded javascript and intented terminator + contentName + text.js.jquery.embedded.ruby + end + \s*\2$ + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.unquoted.embedded.js.jquery.ruby + patterns + + + include + #heredoc + + + include + source.js.jquery + + + include + #interpolated_ruby + + + include + #escaped_char + + + + + begin + (?><<-("?)((?:[_\w]+_|)(?:SH|SHELL))\b\1) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + heredoc with embedded shell and intented terminator + contentName + text.shell.embedded.ruby + end + \s*\2$ + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.unquoted.embedded.shell.ruby + patterns + + + include + #heredoc + + + include + source.shell + + + include + #interpolated_ruby + + + include + #escaped_char + + + + + begin + (?><<-("?)((?:[_\w]+_|)RUBY)\b\1) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + heredoc with embedded ruby and intented terminator + contentName + text.ruby.embedded.ruby + end + \s*\2$ + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.unquoted.embedded.ruby.ruby + patterns + + + include + #heredoc + + + include + source.ruby + + + include + #interpolated_ruby + + + include + #escaped_char + + + + + begin + (?>\=\s*<<(\w+)) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + end + ^\1$ + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.unquoted.heredoc.ruby + patterns + + + include + #heredoc + + + include + #interpolated_ruby + + + include + #escaped_char + + + + + begin + (?><<-(\w+)) + beginCaptures + + 0 + + name + punctuation.definition.string.begin.ruby + + + comment + heredoc with indented terminator + end + \s*\1$ + endCaptures + + 0 + + name + punctuation.definition.string.end.ruby + + + name + string.unquoted.heredoc.ruby + patterns + + + include + #heredoc + + + include + #interpolated_ruby + + + include + #escaped_char + + + + + begin + (?<=\{|do|\{\s|do\s)(\|) + captures + + 1 + + name + punctuation.separator.variable.ruby + + + end + (\|) + patterns + + + match + [_a-zA-Z][_a-zA-Z0-9]* + name + variable.other.block.ruby + + + match + , + name + punctuation.separator.variable.ruby + + + + + match + => + name + punctuation.separator.key-value + + + match + <<=|%=|&=|\*=|\*\*=|\+=|\-=|\^=|\|{1,2}=|<< + name + keyword.operator.assignment.augmented.ruby + + + match + <=>|<(?!<|=)|>(?!<|=|>)|<=|>=|===|==|=~|!=|!~|(?<=[ \t])\? + name + keyword.operator.comparison.ruby + + + match + (?<=[ \t])!+|\bnot\b|&&|\band\b|\|\||\bor\b|\^ + name + keyword.operator.logical.ruby + + + match + (%|&|\*\*|\*|\+|\-|/) + name + keyword.operator.arithmetic.ruby + + + match + = + name + keyword.operator.assignment.ruby + + + match + \||~|>> + name + keyword.operator.other.ruby + + + match + : + name + punctuation.separator.other.ruby + + + match + \; + name + punctuation.separator.statement.ruby + + + match + , + name + punctuation.separator.object.ruby + + + match + \.|:: + name + punctuation.separator.method.ruby + + + match + \{|\} + name + punctuation.section.scope.ruby + + + match + \[|\] + name + punctuation.section.array.ruby + + + match + \(|\) + name + punctuation.section.function.ruby + + + repository + + escaped_char + + match + \\(?:[0-7]{1,3}|x[\da-fA-F]{1,2}|.) + name + constant.character.escape.ruby + + heredoc + + begin + ^<<-?\w+ + end + $ + patterns + + + include + $self + + + + interpolated_ruby + + patterns + + + captures + + 0 + + name + punctuation.section.embedded.ruby + + 1 + + name + source.ruby.embedded.source.empty + + + match + #\{(\}) + name + source.ruby.embedded.source + + + begin + #\{ + captures + + 0 + + name + punctuation.section.embedded.ruby + + + end + \} + name + source.ruby.embedded.source + patterns + + + include + #nest_curly_and_self + + + include + $self + + + + + captures + + 1 + + name + punctuation.definition.variable.ruby + + + match + (#@)[a-zA-Z_]\w* + name + variable.other.readwrite.instance.ruby + + + captures + + 1 + + name + punctuation.definition.variable.ruby + + + match + (#@@)[a-zA-Z_]\w* + name + variable.other.readwrite.class.ruby + + + captures + + 1 + + name + punctuation.definition.variable.ruby + + + match + (#\$)[a-zA-Z_]\w* + name + variable.other.readwrite.global.ruby + + + + nest_brackets + + begin + \[ + captures + + 0 + + name + punctuation.section.scope.ruby + + + end + \] + patterns + + + include + #nest_brackets + + + + nest_brackets_i + + begin + \[ + captures + + 0 + + name + punctuation.section.scope.ruby + + + end + \] + patterns + + + include + #interpolated_ruby + + + include + #escaped_char + + + include + #nest_brackets_i + + + + nest_brackets_r + + begin + \[ + captures + + 0 + + name + punctuation.section.scope.ruby + + + end + \] + patterns + + + include + #regex_sub + + + include + #nest_brackets_r + + + + nest_curly + + begin + \{ + captures + + 0 + + name + punctuation.section.scope.ruby + + + end + \} + patterns + + + include + #nest_curly + + + + nest_curly_and_self + + patterns + + + begin + \{ + captures + + 0 + + name + punctuation.section.scope.ruby + + + end + \} + patterns + + + include + #nest_curly_and_self + + + + + include + $self + + + + nest_curly_i + + begin + \{ + captures + + 0 + + name + punctuation.section.scope.ruby + + + end + \} + patterns + + + include + #interpolated_ruby + + + include + #escaped_char + + + include + #nest_curly_i + + + + nest_curly_r + + begin + \{ + captures + + 0 + + name + punctuation.section.scope.ruby + + + end + \} + patterns + + + include + #regex_sub + + + include + #nest_curly_r + + + + nest_ltgt + + begin + \< + captures + + 0 + + name + punctuation.section.scope.ruby + + + end + \> + patterns + + + include + #nest_ltgt + + + + nest_ltgt_i + + begin + \< + captures + + 0 + + name + punctuation.section.scope.ruby + + + end + \> + patterns + + + include + #interpolated_ruby + + + include + #escaped_char + + + include + #nest_ltgt_i + + + + nest_ltgt_r + + begin + \< + captures + + 0 + + name + punctuation.section.scope.ruby + + + end + \> + patterns + + + include + #regex_sub + + + include + #nest_ltgt_r + + + + nest_parens + + begin + \( + captures + + 0 + + name + punctuation.section.scope.ruby + + + end + \) + patterns + + + include + #nest_parens + + + + nest_parens_i + + begin + \( + captures + + 0 + + name + punctuation.section.scope.ruby + + + end + \) + patterns + + + include + #interpolated_ruby + + + include + #escaped_char + + + include + #nest_parens_i + + + + nest_parens_r + + begin + \( + captures + + 0 + + name + punctuation.section.scope.ruby + + + end + \) + patterns + + + include + #regex_sub + + + include + #nest_parens_r + + + + regex_sub + + patterns + + + include + #interpolated_ruby + + + include + #escaped_char + + + captures + + 1 + + name + punctuation.definition.arbitrary-repitition.ruby + + 3 + + name + punctuation.definition.arbitrary-repitition.ruby + + + match + (\{)\d+(,\d+)?(\}) + name + string.regexp.arbitrary-repitition.ruby + + + begin + \[(?:\^?\])? + captures + + 0 + + name + punctuation.definition.character-class.ruby + + + end + \] + name + string.regexp.character-class.ruby + patterns + + + include + #escaped_char + + + + + begin + \( + captures + + 0 + + name + punctuation.definition.group.ruby + + + end + \) + name + string.regexp.group.ruby + patterns + + + include + #regex_sub + + + + + captures + + 1 + + name + punctuation.definition.comment.ruby + + + comment + We are restrictive in what we allow to go after the comment character to avoid false positives, since the availability of comments depend on regexp flags. + match + (?<=^|\s)(#)\s[[a-zA-Z0-9,. \t?!-][^\x{00}-\x{7F}]]*$ + name + comment.line.number-sign.ruby + + + + + scopeName + source.ruby + uuid + E00B62AC-6B1C-11D9-9B1F-000D93589AF6 + + diff --git a/bundles/ruby.tmbundle/Tests/division_ambiguity.rb b/bundles/ruby.tmbundle/Tests/division_ambiguity.rb new file mode 100644 index 000000000..a20e52a46 --- /dev/null +++ b/bundles/ruby.tmbundle/Tests/division_ambiguity.rb @@ -0,0 +1,88 @@ +# purpose: +# exercise constructs with division +# +# division itself 84 / 2 +# regexp /pattern/ +# +# +# + +def test(*obj) + p(*obj) +end +a, b = 4, 2 + +# ------------------------------------------- +# +# Testarea for division +# +# ------------------------------------------- + +# singleline numbers +test(84 / 2) + +# singleline symbols +test(a / b) + +# singleline symbols +test(a / b / 3) + + +test(Float(42) / Float(5)) + +# multiline with symbols +=begin # invalid +test(a +/ b) +=end + +# multiline with symbols +test(a / +b) + + +# ------------------------------------------- +# +# Testarea for regexp +# +# ------------------------------------------- + +# singleline +test( // ) +test( /abc/ ) +test( /a\/bc/ ) +test [/^F../] +p 'Foobar'[/^F../] +p '42' =~ /42/ +test(nil && /\\/ =~ '\\') +test(nil || /\\/ =~ '\\') +test(nil and /\\/ =~ '\\') +test(nil or /\\/ =~ '\\') +test(/a/x) +test(/x/.match('abx').to_s) +test((/x/).match('abx').to_s) +test(/a/,/b/,/c/) +test(/a/x,/b/x,/c/m) + + +# multiline +test( / +pattern +/x ) + + +# multiline +test( +/r +eg +e/x +) + +# multiline +test( +/1/,/2/,/3/ +) + +# regexp after keyword +res = case 'test';when /t..t/:1;else 0;end +test(res) \ No newline at end of file diff --git a/bundles/ruby.tmbundle/Tests/modulo_ambiguity1.rb b/bundles/ruby.tmbundle/Tests/modulo_ambiguity1.rb new file mode 100644 index 000000000..2b1b9f717 --- /dev/null +++ b/bundles/ruby.tmbundle/Tests/modulo_ambiguity1.rb @@ -0,0 +1,76 @@ +# purpose: +# exercise constructs with modulo +# +# modulo in math data%2 +# literals %(a b), %W[1 2] +# +# +# + +def test(v) + p v +end + +x, y = 42, 33 + + +# ------------------------------------------- +# +# Testarea for modulo +# +# ------------------------------------------- + +# value % value +test( 3%2 ) +test( 3 % 2 ) +test( 1234%(666) ) +test( (1234)%666 ) + +# var % value +test( x%2 ) +test( x%666 ) +test( x%(42) ) +test( x%-42-3 ) +test( x%+42+3 ) + +# value % var +test( 666%x ) +test( (42+4+2)%x ) + +# var % var +test( x % y ) +test( x%y ) + +# ------------------------------------------- +# +# Testarea for literals +# +# ------------------------------------------- + +# literal with nothing +test( %(a b c) ) +test( %(1 2 (3 4)) ) +test( %{TM rocks} ) + +# literal with 'w' +test( %W(1 2 3) ) +test( %W[1 2 3] ) +test( %W{1 2 3} ) +test( %W<1 2 3> ) + +# literal with 'w' (multiline) +test(%w(a +b)) + +# literal with 'q' +test( %q(1 2 3) ) +test( %Q(1 2 3) ) + +# literal with custom +test( %q"1 2 3" ) +test( %q'1 2 3' ) +test( %q#1 2 3# ) +test( %?X.tainted? ) +test( %q/1 2 3/ ) +test( %q|1 2 3| ) +test( %q\1 2 3\ ) diff --git a/bundles/ruby.tmbundle/Tests/questionmark_ambiguity1.rb b/bundles/ruby.tmbundle/Tests/questionmark_ambiguity1.rb new file mode 100644 index 000000000..d571673fa --- /dev/null +++ b/bundles/ruby.tmbundle/Tests/questionmark_ambiguity1.rb @@ -0,0 +1,160 @@ +# purpose: +# exercise constructs with questionmark +# +# numeric letters ?x +# ternary operator condition ? case1 : case2 +# +# +# + +def test(v) + puts "#{v.inspect} => #{v.chr}" +end +def z(v) + v +end + + + +# ------------------------------------------- +# +# Testarea for numeric letters +# +# ------------------------------------------- + +# begin of line +test( +?x) + +# normal letters +test( ?a ) +test( ?A ) +test( ?0 ) + +# misc symbols +test( ?* ) +test( ?**2 ) +test( ?: ) +test( ?) ) +test( ?( ) +test( ?' ) # im a comment, not a string +test( ?" ) # im a comment, not a string +test( ?/ ) # im a comment, not a regexp + +# symbol '.' +test( ?..succ ) +p ?...?..succ # im a .. range +p ?....?..succ # im a ... range +#p ?.....?..succ # invalid + +# symbol '#' +test( ?# ); p 'im not a comment' + +# space ' ' +#test( ? ) # invalid + +# tab ' ' +#test( ? ) # invalid + + +# symbol '?' +test( ?? ) +test(??) + +# symbol '\\' +test( ?\\ ) + +# escaped as hex +#test( ?\x ) # invalid +test( ?\x1 ) +test( ?\x61 ) +#test( ?\x612 ) # invalid +test( ?\X ) # valid.. but is not hex +#test( ?\X11 ) # invalid + +# escaped as octal +test( ?\0 ) +test( ?\07 ) +test( ?\017 ) +#test( ?\0173 ) # invalid +#test( ?\08 ) # invalid +#test( ?\09 ) # invalid +#test( ?\0a ) # invalid +test( ?\1 ) +test( ?\7 ) +test( ?\a ) +test( ?\f ) + +# standard escapings +test( ?\n ) # newline +test( ?\b ) # backspace + +# escaped misc letters/symbols +test( ?\8 ) +test( ?\9 ) +test( ?\_ ) + +# ctrl/meta escaped +test( ?\C-a ) +test( ?\C-g ) +test( ?\C-x ) +test( ?\C-A ) +test( ?\C-G ) +test( ?\c ) +test( ?\m ) +#test( ?\c-a ) # invalid +#test( ?\C ) # invalid +#test( ?\M ) # invalid +test( ?\M-a ) +test( ?\M-\C-a ) +test( ?\C-\C-\M-a ) +test( ?\C-\M-a ) +test( ?\C-\M-\M-a ) +test( ?\C-\M-\C-\M-a ) + +# misc tests +p 'abc'.include?(?z) + + + +# ------------------------------------------- +# +# Testarea for ternary operator +# +# ------------------------------------------- +a, b, val = 42, 24, true +p(val ? 0 : 2) + +p [ + val ? (a) : z(b) , + val ? 'a' : 'b' +] + + + + +# ------------------------------------------- +# +# Testarea for ternary operator and numeric letter +# +# ------------------------------------------- +p [ + +# very ugly +true ???:?? , +true ???:?: , +true ??::?: , +] + + + +# ------------------------------------------- +# +# Testarea for neiter ternary operator nor numeric letter +# +# ------------------------------------------- + +# not letters.. the questionmark is part of the methodname +p(42.tainted?, 42.frozen?) + + diff --git a/bundles/ruby.tmbundle/Tests/rubylexer/COPYING b/bundles/ruby.tmbundle/Tests/rubylexer/COPYING new file mode 100644 index 000000000..b124cf581 --- /dev/null +++ b/bundles/ruby.tmbundle/Tests/rubylexer/COPYING @@ -0,0 +1,510 @@ + + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations +below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it +becomes a de-facto standard. To achieve this, non-free programs must +be allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control +compilation and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at least + three years, to give the same user the materials specified in + Subsection 6a, above, for a charge no more than the cost of + performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply, and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License +may add an explicit geographical distribution limitation excluding those +countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms +of the ordinary General Public License). + + To apply these terms, attach the following notices to the library. +It is safest to attach them to the start of each source file to most +effectively convey the exclusion of warranty; and each file should +have at least the "copyright" line and a pointer to where the full +notice is found. + + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or +your school, if any, to sign a "copyright disclaimer" for the library, +if necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James + Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/bundles/ruby.tmbundle/Tests/rubylexer/g.rb b/bundles/ruby.tmbundle/Tests/rubylexer/g.rb new file mode 100644 index 000000000..16df18d19 --- /dev/null +++ b/bundles/ruby.tmbundle/Tests/rubylexer/g.rb @@ -0,0 +1,14 @@ +j=9;def i(n) [n ?"d" : "e" , n] end + +p(i ?") +p(j ?"d" : "e") + +def g(x=nil) x end +def gg(x=nil) g x end +p(gg :x) +p(g :y) +g=9 +p(gg :z) +# g :w #error + + diff --git a/bundles/ruby.tmbundle/Tests/rubylexer/newsyntax.rb b/bundles/ruby.tmbundle/Tests/rubylexer/newsyntax.rb new file mode 100644 index 000000000..2d06fe082 --- /dev/null +++ b/bundles/ruby.tmbundle/Tests/rubylexer/newsyntax.rb @@ -0,0 +1,18 @@ + +x, (*), z = [:x, :y, :z] +p x +p z + +x, (*y), z = [:x, :y, :z] +p x +p y +p z + +p($/ = ' '; Array( "i'm in your house" )) + +class Foou + public + def [] x=-100,&y=nil; p x; 100 end +end +p Foou.new.[]?9 #value +p Foou.new.[] ?9 #value diff --git a/bundles/ruby.tmbundle/Tests/rubylexer/p.rb b/bundles/ruby.tmbundle/Tests/rubylexer/p.rb new file mode 100644 index 000000000..90df69671 --- /dev/null +++ b/bundles/ruby.tmbundle/Tests/rubylexer/p.rb @@ -0,0 +1,1122 @@ +p(String *Class) +class String +class Class +end +end +#def String(x) x.to_s end #it's already built-in. duh! +def String.*(right) [self,right] end +def String.<<(right) [self,:<<,right] end +def String./(right) [self,:/,right] end +def String.[](right) [self,:[],right] end +p(String::Class) +p(String:: Class) +p(String ::Class) +p(String :: Class) +p(String< p +end + +q=9 +Q=99 + +p:p8 +false ? p: p8 +p :p8 +false ? p : p8 + +false ? q:p8 +false ? q: p8 +false ? q :p8 +false ? q : p8 + +#false ? Q:p8 #gives ruby indigestion +false ? Q: p8 +#false ? Q :p8 #gives ruby indigestion +false ? Q : p8 + +p?:p8 +false ? p?: p8 +p? :p8 +false ? p? : p8 + +P?:p8 +false ? P?: p8 +P? :p8 +false ? P? : p8 + +self.[]:p8 +false ? self.[]: p8 +self.[] :p8 +false ? self.[] : p8 + +self.<=>:p8 +false ? self.<=>: p8 +self.<=> :p8 +false ? self.<=> : p8 + +self <=>:p8 +#false ? self <=>: p8 #gives ruby indigestion +self <=> :p8 +#false ? self <=> : p8 #gives ruby indigestion +end + +p <2) + p(p >2) + p(p> 2) + p(p > 2) + +end + +module M34 + p(p~6) + p(p ~6) + p(p~ 6) + p(p ~ 6) + p(p*[1]) + p(p *[1]) + p(p* [1]) + p(p * [1]) + p(p&proc{}) + p(p &proc{}) + p(p& proc{}) + p(p & proc{}) + p(p !1) + p(p ?1) + p(p ! 1) + p(p ? 1 : 6) + p(p@a) + p(p @a) +# p(p@ a) #wont +# p(p @ a) #work + + p(p#a +) + p(p #a +) + p(p# a +) + p(p # a +) + p(p$a) + p(p $a) +# p(p$ a) #wont +# p(p $ a) #work + p(p%Q{:foo}) + p(p %Q{:foo}) + p(p% Q{:foo}) + p(p % Q{:foo}) + p(p^6) + p(p ^6) + p(p^ 6) + p(p ^ 6) + p(p&7) + p(p &proc{7}) + p(p& 7) + p(p & 7) + p(p(2)) + p(p (2)) + p(p( 2)) + p(p ( 2)) + p(p(p)) + p(p()) + p(p (p)) + p(p ()) + p(p ( p)) + p(p ( )) + p(p( p)) + p(p( )) + p(p) + p((p)) + p(p ) + p((p )) + p((p p)) + p((p p,p)) + p((p p)) + p((p p,p)) + p(p-0) + p(p -1) + p(p- 0) + p(p - 0) + p(p+9) + p(p +9) + p(p+ 9) + p(p + 9) + p(p[1]) + p(p [1]) + p(p[ 1]) + p(p [ 1]) + p(p{1}) + p(p {1}) + p(p{ 1}) + p(p { 1}) + p(p/1) + p(p /22/) + p(p/ 1) + p(p / 22) + p(p._) + p(p ._) + p(p. _) + p(p . _) + p(p:f) + p(p :f) + p(false ? p: f) + p(false ? p : f) + p((p;1)) + p((p ;1)) + p((p; 1)) + p((p ; 1)) + p(p<1) + p(p <1) + p(p< 1) + p(p < 1) + p(p<<1) + p(p <<1) +foobar +1 + p(p<< 1) + p(p << 1) + p(p'j') + p(p 'j') + p(p' j') + p(p ' j') + p(p"k") + p(p "k") + p(p" k") + p(p " k") + p(p|4) + p(p |4) + p(p| 4) + p(p | 4) + p(p>2) + p(p >2) + p(p> 2) + p(p > 2) + +end + + +def bob(x) x end +def bill(x) x end +p(bob %(22)) +for bob in [100] do p(bob %(22)) end +p(bob %(22)) +def %(n) to_s+"%#{n}" end +p(bill %(22)) +begin sdjkfsjkdfsd; rescue Object => bill; p(bill %(22)) end +p(bill %(22)) +undef % + +class Object + +public :` +def `(s) + print "bq: #{s}\n" +end +end + +69.`('what a world') + +79::`('what a word') + +p :` + +p{} +p {} +a=5 +p p +5 +p a +5 + +def nil.+(x) ~x end +def nil.[](*x) [x] end +p( p + 5 ) +p( p +5 ) +p( p+5 ) +p( p[] ) +p( p [] ) +p( p [ ] ) +class NilClass; undef +,[] end + +class Foou + public + def [] x=-100,&y; p x; 100 end +end +a0=8 +p Foou.new.[]!false #value +p Foou.new.[] !false #value +p Foou.new.[]~9 #value +p Foou.new.[] ~9 #value +p Foou.new.[]-9 #op +p Foou.new.[]+9 #op +p Foou.new.[] -9 #value +p Foou.new.[] +9 #value +p Foou.new.[]<<9 #op +p Foou.new.[] <<9 #value +foobar +9 +p Foou.new.[]%9 #op +p Foou.new.[]/9 #op +p Foou.new.[] %(9) #value +p Foou.new.[] /9/ #value +p Foou.new.[]$9 #value +p Foou.new.[]a0 #value +p Foou.new.[] $9 #value +p Foou.new.[] a0 #value +p Foou.new.[]{9} #lambda (op) +p Foou.new.[] {9} #lambda (op) + +if p then p end + +p({:foo=>:bar}) #why does this work? i'd think that ':foo=' would be 1 token +p EMPTY = 0 +p BLACK = 1 +p WHITE = - BLACK + + a=b=c=0 + a ? b:c + a ?b:c + + p(a ? b:c) + p(a ?b:c) + + +p~4 +p:f +p(~4){} +p(:f){} +h={} +h.default=:foo + +p def (h="foobar").default= v; p @v=v;v end +p h + +p h.default=:b + +x, (*y) = [:x, :y, :z] +p x +p y + +x, *y = [:x, :y, :z] +p x +p y + +x, * = [:x, :y, :z] +p x + + + +p Array("foo\nbar") + + + +p +(4) +p -(4) + +p :'\\' + +class Foop + def Foop.bar a,b + p a,b + end +end +Foop.bar 1,2 +Foop::bar 3,4 + + +class Foop + def Foop::baz a,b + p :baz,a,b + end +end +Foop.baz 5,6 +Foop::baz 7,8 + + + +without_creating=widgetname=nil + if without_creating && !widgetname #foo + fail ArgumentError, + "if set 'without_creating' to true, need to define 'widgetname'" + end + + + +=begin disable for now + +#class, module, and def should temporarily hide local variables +def mopsdfjskdf arg; arg*2 end +mopsdfjskdf=5 + class C + p mopsdfjskdf %(3) #calls method + end + +module M + p mopsdfjskdf %(4) #calls method +end + + def d + p mopsdfjskdf %(5) #calls method + end +p d +p mopsdfjskdf %(6) #reads variable +p proc{mopsdfjskdf %(7)}[] #reads variable + +#fancy symbols not supported yet +p %s{symbol} +=end + +#multiple assignment test +proc { + a,b,c,d,e,f,g,h,i,j,k=1,2,3,4,5,6,7,8,9,10,11 + p(b %(c)) + p(a %(c)) + p(k %(c)) + p(p %(c)) +}.call + + +=begin disable for now +p "#{<~m) + +p <(foo=100)} + p( foo %(5)) +}.call + + +p "#{<"PMK:njs;d| + +foobar0 + +p "#{<"PMK:njs;d| + +foobar1 +}" + +def foo(a=<>|\|\||\&\&)=|\&\&|\|\|)/) +p(:%) +p( { :class => class_=0}) +p cls_name = {}[:class] + + +p foo +p "#{$!.class}" +p :p +p(:p) +p(:"[]") +p :"[]" +p("\\") +p(/\\/) +p(/[\\]/) +p 0x80 +p ?p +p 0.1 +p 0.8 +p 0.9 +p(-1) +p %/p/ +p %Q[

  • ] +i=99 +p %Q[
  • #{i[0]+i[1]+(i[2])}\n] +p(:side=>:top) +p %w[a b c + d e f] +p %w[a b c\n + d e f] +p %w[\\] +p %w[\]] +p :+ +p 99 / 3 + +a=99;b=3 +p 1+(a / b) +p %Q[\"] +p %Q[ some [nested] text] + +if false + formatter.format_element(element) do + amrita_expand_and_format1(element, context, formatter) + end +end +if false + ret = <<-END + @@parts_template = #{template.to_ruby} + def parts_template + @@parts_template + end + + #{c.const_def_src.join("\n")} + def amrita_expand_and_format(element, context, formatter) + if element.tagname_symbol == :span and element.attrs.size == 0 + amrita_expand_and_format1(element, context, formatter) + else + formatter.format_element(element) do + amrita_expand_and_format1(element, context, formatter) + end + end + end + + def amrita_expand_and_format1(element, context, formatter) + #{method_src} + end + END + j=55 +end + +p ' +' +p '\n' +p " +" +p "\n" +p %w/ +/ +p %w/\n/ + +p %W/ +/ +p %W/\n/ +p(/ +/) +p(/\n/) +p proc { + p ` + ` + p `\n` +} + + + +p(%r[foo]i) +#breakpoint +p <:b), {:a=>:b} #=> true + assert_ene Reg(:a=>:b), {:a=>:c} #=> false + assert_ene Reg(:a=>:b), {} #=> false + h={} + h.default=:b + assert_eee Reg(:a=>:b), h #=> true + + assert_eee Reg(/^(a|b)$/=>33), {"a"=>33} #=> true + assert_eee Reg(/^(a|b)$/=>33), {"b"=>33} #=> true + assert_ene Reg(/^(a|b)$/=>33), {"a"=>133} #=> false + assert_ene Reg(/^(a|b)$/=>33), {"b"=>133} #=> false + + assert_ene Reg(/^(a|b)$/=>33), {"c"=>33} #=> false + + assert_eee Reg(/^(a|b)$/=>33), {"a"=>33,"b"=>33} #=> true + assert_ene Reg(/^(a|b)$/=>33), {"a"=>33,"b"=>133} #=> false + assert_ene Reg(/^(a|b)$/=>33), {"a"=>133,"b"=>33} #=> false + assert_ene Reg(/^(a|b)$/=>33), {"a"=>133,"b"=>133} #=> false + + + assert_eee Reg("a"=>33)|{"b"=>33}, {"a"=>33,"b"=>33} #=> true + assert_eee Reg("a"=>33)|{"b"=>33}, {"a"=>33,"b"=>133} #=> true + assert_ene Reg("a"=>33)|{"b"=>33}, {"a"=>133,"b"=>33} #=> false + assert_ene Reg("a"=>33)|{"b"=>33}, {"a"=>133,"b"=>133} #=> false + + assert_eee Reg("a"=>33)|{"b"=>33}, {"b"=>33} #=> true + + assert_eee Reg(:a.reg|:b => 44), {:a => 44} #=> true + assert_eee Reg(:a.reg|:b => 44), {:b => 44} #=> true + assert_ene Reg(:a.reg|:b => 44), {:a => 144} #=> false + assert_ene Reg(:a.reg|:b => 44), {:b => 144} #=> false + + print "\n" + end + + def assert_eee(left,right,message='assert_eee failed') + assert( + left===right, + message+" left=#{left.inspect} right=#{right.inspect}" + ) + print ".";$stdout.flush + end + + def assert_ene(left,right,message='assert_ene failed') + assert( + !(left===right), + message+" left=#{left.inspect} right=#{right.inspect}" + ) + print ",";$stdout.flush + end +end +end + srand;seed=srand + + opts=GetoptLong.new(["--seed", "-s", GetoptLong::REQUIRED_ARGUMENT]) + opts.each{|opt,arg| + opt=='--seed' or raise :impossible + seed=arg + } + + print "random seed is #{seed}\n" + srand seed + + +TC_Reg.test_reg diff --git a/bundles/ruby.tmbundle/Tests/rubylexer/w.rb b/bundles/ruby.tmbundle/Tests/rubylexer/w.rb new file mode 100644 index 000000000..56de46332 --- /dev/null +++ b/bundles/ruby.tmbundle/Tests/rubylexer/w.rb @@ -0,0 +1,22 @@ +p %r{\/$} +p %r~~m + +p [].push *[1,2,3] +p /\n/ + +$a=1 +@b=2 +@@c=3 +p(/\#$a \#@b \#@@c \#{$a+@b+@@c}/) + + +class Foo +attr :foo,true +end +f=Foo.new +p f.foo +p f.foo=9 +p f.foo =19 +p f.foo= 29 +p f.foo = 39 +p f.foo diff --git a/bundles/ruby.tmbundle/Tests/test1.rb b/bundles/ruby.tmbundle/Tests/test1.rb new file mode 100644 index 000000000..98a0965ba --- /dev/null +++ b/bundles/ruby.tmbundle/Tests/test1.rb @@ -0,0 +1,302 @@ +# Ruby syntax test file for stuff we've gotten wrong in the past or are currently getting wrong + +######### +#basics + +module samwi_78se + + class mysuperclassofdoom < someotherclass + + end +end + +class gallo_way8 < kni9_ght + + def sl_9ay(beast) + + end + + #These shouldn't capture the leading space before it + def my_method_of_doom(args) + 'yay' + rescue + 'whatever' + ensure + 'something else' + end + + def my_method_of_doom(args);'yay';rescue;'whatever';ensure;'something else';end + + #The indent here should not be broken + +end + + +def hot?(cold) + +end + +def w00t! + + unless l33t + sysbeep + end + +end + +########### +# method names + +# method names can be keywords and should not be highlighted if they appear as explicit method invocations +br = m.end(0) + b1 +x, y = b2vxay(m.begin(0) + b1) +stream.next +self.class + + +# keyword.operator + +var1 == var2 +var1 === var2 +var1 =~ var2 +var1 = var2 +var1 * var2 +var1 - var2 +var1 + var2 +var1 % var2 +var1 ^ var2 +var1 & var2 +var1 * var2 + +# Method +u.whatever + 'something' +u.whatever + ('something') +u.whatever +( 'something') +u.whatever+ 'something' +u.whatever+ ('something') +u.whatever+( 'something') + +u.whatever = 'something' +u.whatever = ('something') +u.whatever =( 'something') +u.whatever= 'something' +u.whatever= ('something') +u.whatever=( 'something') + +u.whatever = 12345 +u.whatever = (12345) +u.whatever =( 12345) +u.whatever= 12345 +u.whatever= (12345) +u.whatever=( 12345) +u.whatever =12345 +u.whatever=12345 + +u.whatever == 'something' +u.whatever == ('something') +u.whatever ==( 'something') +u.whatever== 'something' +u.whatever== ('something') +u.whatever==( 'something') + +u.whatever === 'something' +u.whatever === ('something') +u.whatever ===( 'something') +u.whatever=== 'something' +u.whatever=== ('something') +u.whatever===( 'something') + +u.password = 'something' +u.password = ('something') +u.password =( 'something') +u.password= 'something' +u.password= ('something') +u.password=( 'something') + +u.abort_on_exception = 'something' +u.abort_on_exception = ('something') +u.abort_on_exception =( 'something') +u.abort_on_exception= 'something' +u.abort_on_exception= ('something') +u.abort_on_exception=( 'something') + +u.success ? 'something' : 'something else' +u.success ? ('something') : ('something else') +u.success ?( 'something') :( 'something else') #?( shouldn't be scoped as constant.numeric +u.success? 'something' : 'something else' +u.success? ('something') : ('something else') +u.success?( 'something') :( 'something else') + +# Function +whatever = 'something' +whatever = ('something') +whatever =( 'something') +whatever= 'something' +whatever= ('something') +whatever=( 'something') + +password = 'something' +password = ('something') +password =( 'something') +password= 'something' +password= ('something') +password=( 'something') + + +# this Totally kills Ruby Experimental ATM (Mon Jan 29 10:38:00 EST 2007) + +fred( )fred() +fred( ) fred() +fred( ).fred() +fred() .fred() +fred.fred() + +# /kills + +# method calls no dot or round brackets +puts "shmoo" +foo {} +foo bar + +# Regular Variables +foo +bar +foo = 1 +foo = bar + + +############ +# numbers + +data += 0.chr +99.downto(0) + +0.9 # number +0.A # method invocation (0 -> A) +0.A() # method invocation (0 -> A) +0xCAFEBABE022409ad802046 # hex +23402 # integer +4.232 # decimal + + +########### +# strings + +'hello #{42} wor\'knjkld' # no interpolation or escapes except for slash-single-quote + +# double quoted string (allows for interpolation): +"hello #{42} world" #-> "hello 42 world" +"hello #@ivar world" #-> "hello 42 world" +"hello #@@cvar world" #-> "hello 42 world" +"hello #$gvar world" #-> "hello 42 world" + +'hello #@ivar world' +'hello #@@cvar world' +'hello #$gvar world' + +# escapes +"hello #$gvar \"world" #-> "hello 42 \"world" + +# execute string (allows for interpolation): +%x{ls #{dir}} #-> ".\n..\nREADME\nmain.rb" +`ls #{dir}` #-> ".\n..\nREADME\nmain.rb" + +%Q{dude #{hey}} +%Q!dude#{hey}! +%W(dude#{hey}) +%q!dude#{hey}! +%s{dude#{hey}} +%w{dude#{hey}} +%{woah#{hey}} +% woah#{hey} + +# mod operator should not be interpreted as a string operator +# (space as delimiter is legal Ruby: '% string ' => "string") +if (data.size % 2) == 1 +line << ('%3s ' % str) + + +########### +# regexp + +/matchmecaseinsensitive/i +/matchme/ +/ matchme / +%r{matchme} + +32/23 #division, not regexp + +32 / 32 #division, not regexp + +gsub!(/ +/, '') #regexp, not division + +########### +# symbols + +:BIG :aBC :AbC9 :symb :_asd :_9sd :__= :f00bar :abc! + :abc? :abc= :<< :< :>> :> :<=> :<= :>= :% :* :** + :+ :- :& :| :~ :=~ :== :=== :` :[]= :[] :/ :-@ + :+@ :@aaa :@@bbb + +# else clause of ternary logic should not highlight as symbol +val?(a):p(b) +val?'a':'b' +M[1]?(a+b):p(c+d) + +val ? (a) : p(b) +val ? 'a' : 'b' +M[1] ? (a+b) : p(c+d) + +# but we must also account for ? in method names +thing.fred?(:someone) +thing.fred? :someone +thing.fred? thing2, :someone + +begin = {"(?=\\w)\\s*\\?:"} + + +############ +#literal capable of interpolation: +%W(a b#{42}c) #-> ["a", "b42c"] +%W(ab c\nd \\\)ef) + +%(#{42}) #-> "42" + + +############ +# multiline comments + +=begin +stuff here +... def must_not_highlight_keywords_in_comments end; +stuff here too +=end + + +############ +#literal incapable of interpolation +%w(a b#{42}c) #-> ["a", "b#{42}c"]############ +%w(ab c\nd \\\)ef) # heredoc tests + +append << not_heredoc + +heredoc = < + + + + contactEmailRot13 + wnzrf@tenlcebqhpgvbaf.arg + contactName + James Edward Gray II + deleted + + 3988A501-119E-4C0E-A584-C5E75FC2D6C6 + 8C102BE9-6E49-11D9-A933-000D93589AF6 + EE5F1AE5-6C02-11D9-92BA-0011242E4184 + 8394EDEF-87E8-11D9-A6A3-000D93589AF6 + BE3B3E5E-733E-11D9-A833-000A95A89C98 + 66708792-62C3-11D9-B8CF-000D93589AF6 + 667089D2-62C3-11D9-B8CF-000D93589AF6 + 667080D9-62C3-11D9-B8CF-000D93589AF6 + 667081DE-62C3-11D9-B8CF-000D93589AF6 + 66708259-62C3-11D9-B8CF-000D93589AF6 + 66708052-62C3-11D9-B8CF-000D93589AF6 + 6670881E-62C3-11D9-B8CF-000D93589AF6 + 7990EE60-C850-4779-A8C0-7FD2C853B99B + + description + Support for the <a href="http://www.ruby-lang.org/">Ruby</a> programming language. + mainMenu + + excludedItems + + E5158F94-CC52-4424-A495-14EF9272653F + EEE6D060-C5A0-400D-A2E0-0835013C5365 + 76FCF165-54CB-4213-BC55-BD60B9C6A3EC + 6519CB08-8326-4B77-A251-54722FFBFC1F + 835FAAC6-5431-436C-998B-241F7226B99B + A83F68A9-F751-4BB4-AE16-56812878C16A + 47D203ED-EB9B-4653-A07B-A897800CEB76 + + items + + 35222962-C50D-4D58-A6AE-71E7AD980BE4 + 5289EE40-86B8-11D9-A8D4-000A95E13C98 + ------------------------------------ + 63F3B3B7-CBE2-426B-B551-657733F3868B + 6EA7AE06-3EA9-497D-A6DE-732DE43DA6E9 + ------------------------------------ + 8646378E-91F5-4771-AC7C-43FC49A93576 + EE5F19BA-6C02-11D9-92BA-0011242E4184 + ------------------------------------ + EE5F1FB2-6C02-11D9-92BA-0011242E4184 + FBFC214F-B019-4967-95D2-028F374A3221 + 88BC3896-DC39-4307-A271-21D33340F15A + ------------------------------------ + 9FB64639-F776-499B-BA6F-BB45F86F80FD + 7F79BC8D-8A4F-4570-973B-05DFEC25747F + B297E4B8-A8FF-49CE-B9C4-6D4911724D43 + FDFABCB9-DF58-4469-AE11-5407A4FF4D70 + ------------------------------------ + A1433C73-A475-4B9F-8B46-E182C588ED7D + D52AE6E7-DB75-46C9-94B0-F90B186BE1B2 + B32BD8CF-903E-42D9-B1D3-44F88F262134 + F120CD22-35C0-4E41-8F12-E3C41E04DAB3 + A2A5E4B3-D9C6-4C49-B4CB-8090D615485E + D94AD09E-ADF4-47C9-8236-C7B38B44804E + 803A6BDF-D74A-4B69-AFF0-98B824AB478D + 2765038A-1CFC-4BBD-B19C-6EB2B400D528 + C03F02B1-8BE3-49F5-B983-48C1BDE2657C + + submenus + + 1BE427C6-0071-4BFF-8CDA-1DC13534E7D8 + + items + + 931DD73E-615E-476E-9B0D-8341023AE730 + DAA69A0C-FC1E-4509-9931-DFFB38B4D6AE + 2DDB6FE0-6111-4C40-A149-8E67E76F8272 + + name + Format + + 2765038A-1CFC-4BBD-B19C-6EB2B400D528 + + items + + 2DBEE50B-3097-4A57-AB48-3586CF392D8B + 0BA2B2F1-E767-4A03-9791-0AC0183251F1 + B46D35B8-5DEB-4C10-A110-BA1965A2EB9C + 97054C4D-E4A3-45B1-9C00-B82DBCB30CAD + + name + Idioms + + 33312F8F-A75F-49E5-AC1B-B65944C1309C + + items + + 8021944C-CEA4-4983-8D1C-78D18D4004A1 + 2514FC26-468C-4D08-A788-494A444C4286 + ------------------------------------ + 66802933-B49F-479B-9DF9-1D898FF1FA90 + + name + Strings + + 42D15F0C-0A45-4580-944E-20229EB8C92E + + items + + 9E0B4D4B-2956-4B3A-800A-3D8CE54E66BF + BA9440C9-36C3-4031-BB61-67B581D5B179 + ------------------------------------ + B0CE57EC-FB2E-4482-8CCE-448DC2588715 + + name + Ordering + + 607DFBB6-D4BD-46B1-A221-698CC657143B + + items + + DAE6A754-D906-4763-B816-CE67125CEF08 + ------------------------------------ + 263C94DC-63CF-4BA3-9692-C5582CA8F1AB + 6021BBDC-4AAD-447B-A0C2-A4BB31721558 + 3DDB99C4-486D-4C11-A217-5680FDD8EC19 + FD010022-E0E7-44DB-827F-33F7D9310DA2 + + name + Arrays + + 6EA7AE06-3EA9-497D-A6DE-732DE43DA6E9 + + items + + 1AD6A138-2E89-4D6A-AB3F-416BF9CE968D + ------------------------------------ + 1BE427C6-0071-4BFF-8CDA-1DC13534E7D8 + ------------------------------------ + 05984208-D559-4C04-A69C-2019361A985A + BF4CA9F1-51CD-48D4-8357-852234F59046 + ------------------------------------ + ED6368FB-A11D-4622-9F42-7879481094F1 + + name + RDoc + + 803A6BDF-D74A-4B69-AFF0-98B824AB478D + + items + + 0CB48BCA-3F6E-4AE0-85BC-08A1D2508216 + 20AAD0BC-075D-4EC0-9057-E3E5E62C4125 + ------------------------------------ + 5AE7CFB4-418E-4E00-AD76-06DB755EE876 + 5B46ECFD-23A4-4F0C-9951-F64C19C72C2B + 46BF99AD-E172-4D49-BCF7-072F4730E1D9 + ------------------------------------ + 9460392B-C036-4A76-A5AE-1191F10E4B1B + 3BA6762A-BB6B-489E-8006-F30F386AEF48 + 2C07D4E7-D74F-4AE4-82BE-B0BA82247AFA + 8343ACF4-EEB7-44B5-B835-94826466D4D5 + ------------------------------------ + F6BF907E-FDF7-4D9B-9E57-BE159561349D + B904D4AA-D15D-48A4-8EB2-563BAF489332 + CC300D44-6C3F-4F6C-A8AB-86F5A2DC57CF + + name + Serialization + + 8D131E43-1245-410B-A7D8-E00222CE5412 + + items + + 07D1F987-7CDB-4EAD-B64A-27A93051700E + A3B9B76B-2BC5-425C-AB24-9FAAFC375798 + 5DA9E1E8-2C54-420A-9B84-B040A1AF2B9E + 669A86AD-936F-4EDA-8E4E-6863804072DA + 6C6B9849-9631-49FF-A9F9-F0E94A1512C5 + 1F72122A-35AD-4BA1-AA01-889A10319666 + E23FE534-8061-4828-98A5-46270B6910B0 + 197709C5-8382-4A59-B6D7-31A0CC0F23B7 + 9D9E7BA3-8C5D-4532-83EA-326358C2F5BB + 98182B9E-7C61-4824-BE4C-9CD69C816037 + CB03D11A-7204-48D0-92C1-E109034403E7 + 52B8BF63-F09E-4789-8407-06168A8AE666 + B79B9DAB-ABEF-44F6-BF7E-635E7BA11DFD + 4E409AA4-E7D4-46B7-A4E9-E32F992B33E9 + + name + Searching and Selection + + 9E56B46B-80D0-4397-91B1-E5BEF5FF2811 + + items + + ECBA4CA0-275F-460E-85BE-E82FEA2E2B26 + 338EC03D-3FF4-4435-94E8-1CEF20CEC75D + 7E084412-80E6-4B70-8092-C03D1ECE4CD2 + FDD73070-6D32-4301-A86A-C55B77C3D8ED + EC73D5CC-5F05-46B9-A6F4-82037E4A38C9 + 3C04589C-5127-478E-97B3-CA7DD2EA7ECD + 689120C9-AB40-4081-8268-9362E00FA4A0 + E54F7077-3C33-4B53-A4F7-21E16132D3AD + 02913388-EE8E-4C55-AC94-94F3D751F47E + 7A3CECED-452B-438E-A5C6-95B6BDC43243 + 825B721D-4367-4DF7-98C0-F005695DF9E3 + CD748479-D2A4-4AB5-95BD-4C89512BA210 + 844DBD70-BC23-4FBF-9C18-F4A610239DF2 + 1DD13CF5-39C0-4F10-B655-56DACEBC7F94 + F3C5F719-EF03-4FF7-A777-4A8402FE3B6B + ------------------------------------ + B563E0D7-513D-49B4-9733-1B04A6F25A74 + ------------------------------------ + 5A3754FC-43A3-462B-AB42-E3E951872E6F + BFB65D1C-62F1-485D-8A67-3E5A2E55107C + BD4CFD7B-1AC0-4569-9BDA-FD491F41F4E6 + + name + Each Element + + A1433C73-A475-4B9F-8B46-E182C588ED7D + + items + + 0275EF39-9357-408F-AF20-79E415CA9504 + ------------------------------------ + 0F940CBC-2173-49FF-B6FD-98A62863F8F2 + 667083EE-62C3-11D9-B8CF-000D93589AF6 + 48D8E498-C9A5-4B1B-9A18-71A5860276FB + 4E9A7A73-875C-11D9-897C-000393CBCE2E + 6670835F-62C3-11D9-B8CF-000D93589AF6 + 667082E6-62C3-11D9-B8CF-000D93589AF6 + CD1609FA-47DA-4EE4-9C5B-5C56D953F5B1 + F53E098D-D08E-4CE2-990A-B0BD70E60614 + D121FC61-96A4-4B8F-8709-280EDA876FF3 + 488B387C-50C0-4B2D-9260-5A7E7EAF9B42 + ------------------------------------ + E7A3BCF6-3594-453A-945D-4C5D81631CBF + B37B0E21-1B49-494A-BA56-367CF18DD0B2 + 451A0596-1F72-4AFB-AF2F-45900FABB0F7 + ------------------------------------ + A05CBDD6-845D-45EB-94FB-F8787F5456BE + B2C3ADE8-E19E-4B87-9C6C-593D490114C7 + 97DE939B-D243-4D5C-B953-1C9090912E7C + 33969819-62C5-4E03-B824-C2337205F364 + 34FEBB9F-73CD-4DD4-A0A3-1CF2A5E3DE78 + E16D24D2-CC7E-4786-BE0B-1725FC865D78 + 21C0D711-F32A-4665-AA0D-B136F9DD3945 + 49D69DEC-6991-49F4-8D9B-BA60BFDD3D17 + + name + Declarations + + A2A5E4B3-D9C6-4C49-B4CB-8090D615485E + + items + + 418F1817-255F-430A-B09A-222964ED66A7 + ------------------------------------ + 8F594E5E-6F46-4E98-B5FB-1C8F3BA9828F + 50C56AC8-48F3-42A0-AF10-8164464AFAEF + 397FA09F-A30F-4EE4-920C-318D5004EE97 + ------------------------------------ + 332AA973-AA71-48CB-AEE9-1D71E11019AC + 8EBBB26F-980E-404E-8366-74E5772298F6 + 678BDB83-FBBD-4E8E-BE0B-E1A98AECB247 + A4E89D97-D5ED-48BB-B5FF-1BFB79211FCD + ------------------------------------ + 8CEF9711-88D5-4202-AFB9-29EF4EFD25C1 + C3C48948-4F49-484E-A8DE-DEB44723099E + 209D5D73-7A77-4931-A158-3FB6D5B48A88 + + name + Files + + A2F24A2E-6791-4005-8E32-5D436AB075DB + + items + + 4991BB86-736E-4758-B9B2-E4FA90B9368F + 36853A11-0307-4AE7-B835-7CE6358717A5 + 206D54AF-E67A-4DF0-B7F4-3D42FEB81685 + 51954118-81D7-42B6-9A10-BE23D8B9FFE2 + ------------------------------------ + 567E3D18-BF2B-4379-8927-2777EC9F495E + + name + Counting + + B32BD8CF-903E-42D9-B1D3-44F88F262134 + + items + + 59E811FF-E722-46BE-8938-04713612FABB + ------------------------------------ + 855FC4EF-7B1E-48EE-AD4E-5ECB8ED79D1C + 4B72C5C3-6CA7-41AC-B2F9-51DEA25D469E + ------------------------------------ + 21E75321-0CF7-45E8-A297-BCC7C0DDDD15 + + name + Blocks + + B37B0E21-1B49-494A-BA56-367CF18DD0B2 + + items + + A150C2D8-25B3-4339-BC92-8A0160A70486 + 3D383096-A03F-4EF8-9060-3C727045AB34 + D7A7D3C9-1714-4C50-8CC0-D83A03883E8F + ------------------------------------ + AAD5D511-6BE7-41DA-8F2B-1593A48FBB08 + 6C9D6B3D-D8E9-4606-9534-577C8D21FFF6 + ------------------------------------ + 58FDEA60-10AF-4C49-AA09-29B77030DB25 + 7F46C90A-595B-4B83-A4F7-058F63CE4218 + ------------------------------------ + 7C6E88FA-CA0E-4110-8C75-A94E54286A75 + 4E9D15B5-65D6-4A9A-9DEC-DE041D68C06F + 87D5F8AD-8DA6-4AED-A0D8-B51CAC980445 + C44ED391-614F-4BA2-BB0F-87668EEA9954 + 4A6EFD6B-88E2-4822-AD48-03460EDBC796 + ------------------------------------ + 988C8AEF-FC71-4455-9C4F-9338C05685A4 + ------------------------------------ + 7BC1E159-0C90-4B0D-8808-80165C11F59C + + name + Methods + + C03F02B1-8BE3-49F5-B983-48C1BDE2657C + + items + + 569C9822-8C41-4907-94C7-1A8A0031B66D + ------------------------------------ + 05EE1046-5ED7-48F5-8693-1F066163B2F4 + A7BF14E6-59B1-42E5-8755-8A72BF13685E + + name + Rake + + D52AE6E7-DB75-46C9-94B0-F90B186BE1B2 + + items + + 607DFBB6-D4BD-46B1-A221-698CC657143B + A2F24A2E-6791-4005-8E32-5D436AB075DB + 9E56B46B-80D0-4397-91B1-E5BEF5FF2811 + 42D15F0C-0A45-4580-944E-20229EB8C92E + 8D131E43-1245-410B-A7D8-E00222CE5412 + 33312F8F-A75F-49E5-AC1B-B65944C1309C + + name + Iterators + + D94AD09E-ADF4-47C9-8236-C7B38B44804E + + items + + 31D1F145-33AB-4441-BA11-4D1C46928C4C + 00F66D41-25AF-4597-B67D-E540965A5222 + 5297FD0C-98B1-4514-BBD1-1516810BECA6 + ------------------------------------ + B32C147D-44A6-478A-9D5D-189D7831E9A7 + 43A61A22-6BEE-4997-961C-1CDE739C05FE + A243E96F-DC21-4AA0-B340-13A7674F6AFF + 429D0EF5-580D-4166-8F79-713DE96B77F1 + 0E831E03-67E1-4357-8323-C60685C23C4F + 671F05E2-D9CC-485E-BB1B-B13EF20FAC65 + 4C79256C-480A-459C-BDE8-BB0D972811DB + 79FEC3CC-2A40-4611-9A85-ECDB22FE0701 + 711ED6C3-0F18-41FB-9A7D-3094BB319A85 + A072BB1E-1DD1-45D3-9346-8CA3BA21B364 + 1B925A4D-8EE4-442B-9254-293599F5717F + 68B21F6F-5D89-41FA-A19C-F29C2F912B4E + 82F8EEE0-2452-411E-8102-7BFDDBCA2E72 + 09A11FDA-49FC-4466-8787-8D1D5D111A89 + 29340695-E426-4F77-8CF7-C59360A549F4 + F91C25EC-EC76-498B-BFB5-FDA8F57C5875 + 7850AD5C-A90D-4E2C-A931-EADFF8D3D9A3 + 05655BD8-23C6-445F-BFD1-420BF25C3030 + 33639D7A-BD8C-4396-9C44-307B8AC87C9E + ------------------------------------ + DB457094-1AC9-4856-AEFC-43A9576B6775 + B186BAC0-D981-41AC-B8F4-34BAD2BC4EE6 + F46A4687-E52D-40D2-9072-C215645EDBC6 + ------------------------------------ + C649F945-DAB8-4DA2-B73C-2EFF9D7D34F3 + 942F20E2-C40A-44B8-A3F2-99AAC68CB534 + 1C60D589-DD46-4109-90CA-6B34AEA2F298 + + name + Tests + + E7A3BCF6-3594-453A-945D-4C5D81631CBF + + items + + BF487539-8085-4FF4-8601-1AD20FABAEDC + 83EED068-8C1C-4BAF-9893-902DC00616AB + 0CCBE04E-F4E2-4E55-9506-7DE67ACF8388 + 05DFF82C-5A29-4EBD-93FE-C165FFFB5EA8 + E98FB8F9-7302-431D-8BF2-275A68A6126C + 121B334B-2AA6-4E9A-A8B8-BF93B627982B + AFE1D078-EA16-45F5-AD8A-FAC1B523D861 + C7AAAE45-487A-4B61-8962-D47675AAC05F + ------------------------------------ + 2B73EC5F-06D2-460C-A14F-6FA05AFCF0CC + 0E85EC81-2FAB-4648-B590-119CC1BB6E41 + A71A18CF-2D71-4BFF-AA0C-D9B8C59BC4EB + + name + Classes and Modules + + F120CD22-35C0-4E41-8F12-E3C41E04DAB3 + + items + + E16EE658-1CA0-4950-954B-B962E50B754F + ------------------------------------ + 840B9C4C-7037-4C3B-9028-EB9DC75EDB3E + B9E3A6DF-875D-11D9-897C-000393CBCE2E + ------------------------------------ + F4EEB2B6-07D8-402F-8FC3-79B7308D2576 + + name + Hashes + + + + name + Ruby + ordering + + 35222962-C50D-4D58-A6AE-71E7AD980BE4 + 5289EE40-86B8-11D9-A8D4-000A95E13C98 + 63F3B3B7-CBE2-426B-B551-657733F3868B + 1AD6A138-2E89-4D6A-AB3F-416BF9CE968D + 931DD73E-615E-476E-9B0D-8341023AE730 + DAA69A0C-FC1E-4509-9931-DFFB38B4D6AE + 2DDB6FE0-6111-4C40-A149-8E67E76F8272 + BF4CA9F1-51CD-48D4-8357-852234F59046 + 8646378E-91F5-4771-AC7C-43FC49A93576 + EE5F19BA-6C02-11D9-92BA-0011242E4184 + 76FCF165-54CB-4213-BC55-BD60B9C6A3EC + EE5F1FB2-6C02-11D9-92BA-0011242E4184 + FBFC214F-B019-4967-95D2-028F374A3221 + 9FB64639-F776-499B-BA6F-BB45F86F80FD + 7F79BC8D-8A4F-4570-973B-05DFEC25747F + B297E4B8-A8FF-49CE-B9C4-6D4911724D43 + 835FAAC6-5431-436C-998B-241F7226B99B + 0275EF39-9357-408F-AF20-79E415CA9504 + 59E811FF-E722-46BE-8938-04713612FABB + F4EEB2B6-07D8-402F-8FC3-79B7308D2576 + 97054C4D-E4A3-45B1-9C00-B82DBCB30CAD + 569C9822-8C41-4907-94C7-1A8A0031B66D + 6519CB08-8326-4B77-A251-54722FFBFC1F + 47D203ED-EB9B-4653-A07B-A897800CEB76 + C122CD92-DDBE-4869-9C7A-CC2B254C9411 + 121B334B-2AA6-4E9A-A8B8-BF93B627982B + 58FDEA60-10AF-4C49-AA09-29B77030DB25 + 33969819-62C5-4E03-B824-C2337205F364 + 7E084412-80E6-4B70-8092-C03D1ECE4CD2 + EC73D5CC-5F05-46B9-A6F4-82037E4A38C9 + 825B721D-4367-4DF7-98C0-F005695DF9E3 + BFB65D1C-62F1-485D-8A67-3E5A2E55107C + C649F945-DAB8-4DA2-B73C-2EFF9D7D34F3 + 5AE7CFB4-418E-4E00-AD76-06DB755EE876 + 9460392B-C036-4A76-A5AE-1191F10E4B1B + 2C07D4E7-D74F-4AE4-82BE-B0BA82247AFA + F6BF907E-FDF7-4D9B-9E57-BE159561349D + E5158F94-CC52-4424-A495-14EF9272653F + A83F68A9-F751-4BB4-AE16-56812878C16A + 05984208-D559-4C04-A69C-2019361A985A + ED6368FB-A11D-4622-9F42-7879481094F1 + 88BC3896-DC39-4307-A271-21D33340F15A + FDFABCB9-DF58-4469-AE11-5407A4FF4D70 + 0F940CBC-2173-49FF-B6FD-98A62863F8F2 + 667083EE-62C3-11D9-B8CF-000D93589AF6 + 48D8E498-C9A5-4B1B-9A18-71A5860276FB + 4E9A7A73-875C-11D9-897C-000393CBCE2E + 7BC1E159-0C90-4B0D-8808-80165C11F59C + 6670835F-62C3-11D9-B8CF-000D93589AF6 + 667082E6-62C3-11D9-B8CF-000D93589AF6 + CD1609FA-47DA-4EE4-9C5B-5C56D953F5B1 + F53E098D-D08E-4CE2-990A-B0BD70E60614 + D121FC61-96A4-4B8F-8709-280EDA876FF3 + 488B387C-50C0-4B2D-9260-5A7E7EAF9B42 + BF487539-8085-4FF4-8601-1AD20FABAEDC + 83EED068-8C1C-4BAF-9893-902DC00616AB + 0CCBE04E-F4E2-4E55-9506-7DE67ACF8388 + 05DFF82C-5A29-4EBD-93FE-C165FFFB5EA8 + E98FB8F9-7302-431D-8BF2-275A68A6126C + AFE1D078-EA16-45F5-AD8A-FAC1B523D861 + C7AAAE45-487A-4B61-8962-D47675AAC05F + 2B73EC5F-06D2-460C-A14F-6FA05AFCF0CC + 0E85EC81-2FAB-4648-B590-119CC1BB6E41 + A71A18CF-2D71-4BFF-AA0C-D9B8C59BC4EB + A150C2D8-25B3-4339-BC92-8A0160A70486 + 3D383096-A03F-4EF8-9060-3C727045AB34 + D7A7D3C9-1714-4C50-8CC0-D83A03883E8F + AAD5D511-6BE7-41DA-8F2B-1593A48FBB08 + 6C9D6B3D-D8E9-4606-9534-577C8D21FFF6 + 7F46C90A-595B-4B83-A4F7-058F63CE4218 + 7C6E88FA-CA0E-4110-8C75-A94E54286A75 + 87D5F8AD-8DA6-4AED-A0D8-B51CAC980445 + 4E9D15B5-65D6-4A9A-9DEC-DE041D68C06F + C44ED391-614F-4BA2-BB0F-87668EEA9954 + 4A6EFD6B-88E2-4822-AD48-03460EDBC796 + 988C8AEF-FC71-4455-9C4F-9338C05685A4 + 451A0596-1F72-4AFB-AF2F-45900FABB0F7 + A05CBDD6-845D-45EB-94FB-F8787F5456BE + B2C3ADE8-E19E-4B87-9C6C-593D490114C7 + 97DE939B-D243-4D5C-B953-1C9090912E7C + 34FEBB9F-73CD-4DD4-A0A3-1CF2A5E3DE78 + E16D24D2-CC7E-4786-BE0B-1725FC865D78 + 21C0D711-F32A-4665-AA0D-B136F9DD3945 + 49D69DEC-6991-49F4-8D9B-BA60BFDD3D17 + DAE6A754-D906-4763-B816-CE67125CEF08 + 263C94DC-63CF-4BA3-9692-C5582CA8F1AB + 6021BBDC-4AAD-447B-A0C2-A4BB31721558 + 3DDB99C4-486D-4C11-A217-5680FDD8EC19 + FD010022-E0E7-44DB-827F-33F7D9310DA2 + 4991BB86-736E-4758-B9B2-E4FA90B9368F + 36853A11-0307-4AE7-B835-7CE6358717A5 + 206D54AF-E67A-4DF0-B7F4-3D42FEB81685 + 51954118-81D7-42B6-9A10-BE23D8B9FFE2 + 567E3D18-BF2B-4379-8927-2777EC9F495E + ECBA4CA0-275F-460E-85BE-E82FEA2E2B26 + 338EC03D-3FF4-4435-94E8-1CEF20CEC75D + FDD73070-6D32-4301-A86A-C55B77C3D8ED + 3C04589C-5127-478E-97B3-CA7DD2EA7ECD + 689120C9-AB40-4081-8268-9362E00FA4A0 + E54F7077-3C33-4B53-A4F7-21E16132D3AD + 02913388-EE8E-4C55-AC94-94F3D751F47E + 7A3CECED-452B-438E-A5C6-95B6BDC43243 + CD748479-D2A4-4AB5-95BD-4C89512BA210 + 844DBD70-BC23-4FBF-9C18-F4A610239DF2 + 1DD13CF5-39C0-4F10-B655-56DACEBC7F94 + F3C5F719-EF03-4FF7-A777-4A8402FE3B6B + B563E0D7-513D-49B4-9733-1B04A6F25A74 + 5A3754FC-43A3-462B-AB42-E3E951872E6F + BD4CFD7B-1AC0-4569-9BDA-FD491F41F4E6 + 9E0B4D4B-2956-4B3A-800A-3D8CE54E66BF + BA9440C9-36C3-4031-BB61-67B581D5B179 + B0CE57EC-FB2E-4482-8CCE-448DC2588715 + 07D1F987-7CDB-4EAD-B64A-27A93051700E + A3B9B76B-2BC5-425C-AB24-9FAAFC375798 + 5DA9E1E8-2C54-420A-9B84-B040A1AF2B9E + 669A86AD-936F-4EDA-8E4E-6863804072DA + 6C6B9849-9631-49FF-A9F9-F0E94A1512C5 + 1F72122A-35AD-4BA1-AA01-889A10319666 + E23FE534-8061-4828-98A5-46270B6910B0 + 197709C5-8382-4A59-B6D7-31A0CC0F23B7 + 9D9E7BA3-8C5D-4532-83EA-326358C2F5BB + 98182B9E-7C61-4824-BE4C-9CD69C816037 + CB03D11A-7204-48D0-92C1-E109034403E7 + 52B8BF63-F09E-4789-8407-06168A8AE666 + B79B9DAB-ABEF-44F6-BF7E-635E7BA11DFD + 4E409AA4-E7D4-46B7-A4E9-E32F992B33E9 + 8021944C-CEA4-4983-8D1C-78D18D4004A1 + 2514FC26-468C-4D08-A788-494A444C4286 + 66802933-B49F-479B-9DF9-1D898FF1FA90 + 855FC4EF-7B1E-48EE-AD4E-5ECB8ED79D1C + 4B72C5C3-6CA7-41AC-B2F9-51DEA25D469E + 21E75321-0CF7-45E8-A297-BCC7C0DDDD15 + E16EE658-1CA0-4950-954B-B962E50B754F + 840B9C4C-7037-4C3B-9028-EB9DC75EDB3E + B9E3A6DF-875D-11D9-897C-000393CBCE2E + 418F1817-255F-430A-B09A-222964ED66A7 + 8F594E5E-6F46-4E98-B5FB-1C8F3BA9828F + 50C56AC8-48F3-42A0-AF10-8164464AFAEF + 397FA09F-A30F-4EE4-920C-318D5004EE97 + 332AA973-AA71-48CB-AEE9-1D71E11019AC + 8EBBB26F-980E-404E-8366-74E5772298F6 + 678BDB83-FBBD-4E8E-BE0B-E1A98AECB247 + A4E89D97-D5ED-48BB-B5FF-1BFB79211FCD + 8CEF9711-88D5-4202-AFB9-29EF4EFD25C1 + C3C48948-4F49-484E-A8DE-DEB44723099E + 209D5D73-7A77-4931-A158-3FB6D5B48A88 + 31D1F145-33AB-4441-BA11-4D1C46928C4C + 00F66D41-25AF-4597-B67D-E540965A5222 + 5297FD0C-98B1-4514-BBD1-1516810BECA6 + B32C147D-44A6-478A-9D5D-189D7831E9A7 + 43A61A22-6BEE-4997-961C-1CDE739C05FE + A243E96F-DC21-4AA0-B340-13A7674F6AFF + 429D0EF5-580D-4166-8F79-713DE96B77F1 + 0E831E03-67E1-4357-8323-C60685C23C4F + 671F05E2-D9CC-485E-BB1B-B13EF20FAC65 + 4C79256C-480A-459C-BDE8-BB0D972811DB + 79FEC3CC-2A40-4611-9A85-ECDB22FE0701 + 711ED6C3-0F18-41FB-9A7D-3094BB319A85 + A072BB1E-1DD1-45D3-9346-8CA3BA21B364 + 1B925A4D-8EE4-442B-9254-293599F5717F + 68B21F6F-5D89-41FA-A19C-F29C2F912B4E + 82F8EEE0-2452-411E-8102-7BFDDBCA2E72 + 09A11FDA-49FC-4466-8787-8D1D5D111A89 + 29340695-E426-4F77-8CF7-C59360A549F4 + F91C25EC-EC76-498B-BFB5-FDA8F57C5875 + 7850AD5C-A90D-4E2C-A931-EADFF8D3D9A3 + 05655BD8-23C6-445F-BFD1-420BF25C3030 + 33639D7A-BD8C-4396-9C44-307B8AC87C9E + DB457094-1AC9-4856-AEFC-43A9576B6775 + B186BAC0-D981-41AC-B8F4-34BAD2BC4EE6 + F46A4687-E52D-40D2-9072-C215645EDBC6 + 942F20E2-C40A-44B8-A3F2-99AAC68CB534 + 1C60D589-DD46-4109-90CA-6B34AEA2F298 + 0CB48BCA-3F6E-4AE0-85BC-08A1D2508216 + 20AAD0BC-075D-4EC0-9057-E3E5E62C4125 + 5B46ECFD-23A4-4F0C-9951-F64C19C72C2B + 46BF99AD-E172-4D49-BCF7-072F4730E1D9 + 3BA6762A-BB6B-489E-8006-F30F386AEF48 + 8343ACF4-EEB7-44B5-B835-94826466D4D5 + B904D4AA-D15D-48A4-8EB2-563BAF489332 + CC300D44-6C3F-4F6C-A8AB-86F5A2DC57CF + 2DBEE50B-3097-4A57-AB48-3586CF392D8B + 0BA2B2F1-E767-4A03-9791-0AC0183251F1 + B46D35B8-5DEB-4C10-A110-BA1965A2EB9C + 05EE1046-5ED7-48F5-8693-1F066163B2F4 + A7BF14E6-59B1-42E5-8755-8A72BF13685E + EEE6D060-C5A0-400D-A2E0-0835013C5365 + E00B62AC-6B1C-11D9-9B1F-000D93589AF6 + 1D26F26C-C6F7-434F-84F8-FEE895372E8A + 6FEAF60F-F0F3-4618-9259-DE93285F50D1 + 92E190C9-A861-4025-92D4-D6B5A24C22D4 + A5D50494-EB97-48DE-A2BE-322DF52A7A7A + 6D75102B-6E51-4360-8F12-BE12327B6AE6 + AEDD6A5F-417F-4177-8589-B07518ACA9DE + 1A7701FA-D866-498C-AD4C-7846538DB535 + + uuid + 467B298F-6227-11D9-BFB1-000D93589AF6 + +