public
Description: TextMate bundle - Amplified Mate Productivity
Homepage: http://code.leadmediapartners.com/tools/rubyamp
Clone URL: git://github.com/timcharper/rubyamp.git
RubyAMP::Config (ability to specify port)
timcharper (author)
Thu Sep 25 12:27:18 -0700 2008
commit  2a05a8c0ae81c3ed5a8b4d67058d7bd185dfc856
tree    5984c4d76bfaf678205f5bf7f9ad4ef139b559d8
parent  b6a996517714c1a0fce5774a40a517d573823895
...
8
9
10
 
11
12
13
14
15
16
 
17
18
19
...
8
9
10
11
12
13
14
15
16
 
17
18
19
20
0
@@ -8,12 +8,13 @@
0
   <string>255629A2-F227-467B-91B3-21D145908E78</string>
0
   <key>command</key>
0
   <string>cat &lt;&lt;'RUBYEOF' &gt; /tmp/ruby-amp-$$.rb
0
+require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/ruby_amp.rb"
0
 require 'rubygems'
0
 require 'appscript'
0
 include Appscript
0
 term = app("Terminal")
0
 term.activate
0
-term.do_script "cd #{ENV['TM_PROJECT_DIRECTORY']} &amp;&amp; script/server; exit"
0
+term.do_script "cd #{ENV['TM_PROJECT_DIRECTORY']} &amp;&amp; script/server -p #{RubyAMP::Config[:port]}; exit"
0
 
0
 RUBYEOF
0
 
...
5
6
7
8
 
9
10
11
...
18
19
20
21
 
22
23
24
...
5
6
7
 
8
9
10
11
...
18
19
20
 
21
22
23
24
0
@@ -5,7 +5,7 @@
0
   <key>beforeRunningCommand</key>
0
   <string>nop</string>
0
   <key>command</key>
0
- <string>cat &lt;&lt;'RUBYEOF' &gt; /tmp/ruby-amp-$$.rb
0
+ <string>cat &lt;&lt;'RUBYEOF' &gt; /tmp/ruby-amp-$$.rb
0
 require "#{ENV['TM_BUNDLE_SUPPORT']}/lib/ruby_amp.rb"
0
 
0
 project_directory = ENV['TM_PROJECT_DIRECTORY']
0
@@ -18,7 +18,7 @@ run_file = RubyAMP::RemoteDebugger.prepare_debug_wrapper &lt;&lt;-EOF
0
   load #{file_to_load.inspect}
0
 EOF
0
 
0
-RubyAMP::Launcher.open_debug_process_in_terminal(run_file)
0
+RubyAMP::Launcher.open_debug_process_in_terminal(run_file, " -p #{RubyAMP::Config[:server_port]}")
0
 sleep 0.25
0
 RubyAMP::Launcher.open_controller_terminal
0
 
...
7
8
9
 
10
11
12
 
 
 
 
13
14
15
...
17
18
19
20
 
21
22
23
...
7
8
9
10
11
12
13
14
15
16
17
18
19
20
...
22
23
24
 
25
26
27
28
0
@@ -7,9 +7,14 @@ module RubyAMP
0
     :Launcher => 'launcher.rb',
0
     :RemoteDebugger => 'remote_debugger.rb',
0
     :Inspect => 'inspect.rb',
0
+ :Config => 'config.rb',
0
     :PrettyAlign => 'pretty_align.rb'
0
   }
0
   
0
+ def self.project_path
0
+ ENV['TM_PROJECT_DIRECTORY'] || ( ENV['TM_FILEPATH'] && File.dirname(ENV['TM_FILEPATH']) )
0
+ end
0
+
0
   def self.const_missing(name)
0
     @looked_for ||= {}
0
     raise "Class not found: #{name}" if @looked_for[name]
0
@@ -17,7 +22,7 @@ module RubyAMP
0
     return super unless AUTO_LOAD[name]
0
     @looked_for[name] = true
0
     
0
- require File.join(RUBYAMP_ROOT, AUTO_LOAD[name])
0
+ load File.join(RUBYAMP_ROOT, AUTO_LOAD[name])
0
     const_get(name)
0
   end
0
 end
...
9
10
11
12
 
13
14
15
 
16
17
18
...
9
10
11
 
12
13
14
 
15
16
17
18
0
@@ -9,10 +9,10 @@ module RubyAMP
0
       term.do_script "cd #{ENV['TM_PROJECT_DIRECTORY'].to_s.inspect} && sleep 0.25 && rdebug -c; exit"
0
     end
0
 
0
- def open_debug_process_in_terminal(file_to_run)
0
+ def open_debug_process_in_terminal(file_to_run, args = "")
0
       term = Appscript::app("Terminal")
0
       term.activate
0
- term.do_script "cd #{ENV['TM_PROJECT_DIRECTORY'].to_s.inspect} && rdebug -s #{file_to_run}; exit"
0
+ term.do_script "cd #{ENV['TM_PROJECT_DIRECTORY'].to_s.inspect} && rdebug -s #{file_to_run} -- #{args}; exit"
0
     end
0
 
0
     def open_debug_process_in_html_dialog(file_to_run)
...
2
3
4
 
5
6
7
...
2
3
4
5
6
7
8
0
@@ -2,6 +2,7 @@
0
 # Author: Tim Harper with Lead Media Partners.
0
 # http://code.google.com/p/productivity-bundle/
0
 
0
+require "#{ENV['TM_SUPPORT_PATH']}/lib/escape.rb"
0
 
0
 def exit_discard
0
   exit 200;
...
1
 
 
 
 
 
 
 
2
...
1
2
3
4
5
6
7
8
9
0
@@ -1 +1,8 @@
0
 require File.dirname(__FILE__) + "/../lib/ruby_amp.rb"
0
+
0
+module RubyAMP
0
+ def self.unload(const)
0
+ RubyAMP.send(:remove_const, "Config")
0
+ @looked_for.delete(const.to_sym)
0
+ end
0
+end
0
\ No newline at end of file
...
121
122
123
 
 
124
125
126
...
121
122
123
124
125
126
127
128
0
@@ -121,6 +121,8 @@
0
     <string>325F93B3-F7BA-40BC-AFD0-A668EE8F9B8F</string>
0
     <string>DAC6CEE2-DD88-4803-86D8-793201742DDB</string>
0
     <string>45747523-F19F-46BF-A30F-30977654D27D</string>
0
+ <string>8D27E812-E9BE-4E83-95AE-483D1761CA40</string>
0
+ <string>54B9D5CA-1056-4B05-809E-0189987A88E2</string>
0
   </array>
0
   <key>uuid</key>
0
   <string>90A97C0D-E305-4C84-93E4-DCFB2113820E</string>

Comments

    No one has commented yet.