public
Fork of drnic/ruby-on-rails-tmbundle
Description: Ruby on Rails TextMate bundle [master branch is svn trunk; patches to drnicwilliams@gmail.com]
Homepage: http://macromates.com
Clone URL: git://github.com/Infininight/ruby-on-rails-tmbundle.git
Search Repo:
Change rhtml defaults to html.erb [thanks to Nic Williams]

git-svn-id: 
http://macromates.com/svn/Bundles/trunk/Bundles/Ruby%20on%20Rails.tmbundle
@8560 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
canadaduane (author)
Tue Nov 27 15:33:51 -0800 2007
commit  1dbbb0b6add8f3cce5ef654a905d95d6c32a1db0
tree    6077d00c0403dcd9ab858f36ddced740b3b5714d
parent  9f5b63bf08a6f5019523ee1761f6c6caef641a5a
...
3
4
5
6
 
7
8
9
...
3
4
5
 
6
7
8
9
0
@@ -3,7 +3,7 @@
0
 <plist version="1.0">
0
 <dict>
0
   <key>content</key>
0
- <string>assert_redirected_to :action =&gt; "${1:index}"</string>
0
+ <string>assert_redirected_to ${2::action =&gt; "${1:index}"}</string>
0
   <key>name</key>
0
   <string>assert_redirected_to</string>
0
   <key>scope</key>
...
3
4
5
6
 
7
8
9
...
3
4
5
 
6
7
8
9
0
@@ -3,7 +3,7 @@
0
 <plist version="1.0">
0
 <dict>
0
   <key>content</key>
0
- <string>assert_response :${1:success}</string>
0
+ <string>assert_response :${1:success}, @response.body$0</string>
0
   <key>name</key>
0
   <string>assert_response</string>
0
   <key>scope</key>
...
22
23
24
25
 
26
27
28
29
30
 
31
32
33
...
73
74
75
76
 
77
78
79
...
22
23
24
 
25
26
27
28
29
 
30
31
32
33
...
73
74
75
 
76
77
78
79
0
@@ -22,12 +22,12 @@
0
 if TextMate.selected_text
0
   partial_name =
0
     TextMate.input(
0
- "Name of the new partial: (omit the _ and .rhtml)",
0
+ "Name of the new partial: (omit the _ and .html.erb)",
0
       "partial", :title => "Create a partial from the selected text")
0
 
0
   if partial_name
0
     path = current_file.dirname
0
- partial = File.join(path, "_#{partial_name}.rhtml")
0
+ partial = File.join(path, "_#{partial_name}.html.erb")
0
   
0
     # Create the partial file
0
     if File.exist?(partial)
0
@@ -73,7 +73,7 @@
0
           modules = pieces
0
         end
0
 
0
- partial = File.join(current_file.rails_root, 'app', 'views', modules, "_#{partial_name}.rhtml")
0
+ partial = File.join(current_file.rails_root, 'app', 'views', modules, "_#{partial_name}.html.erb")
0
 
0
         text << "<!-- [[ Partial '#{partial}' Begin ]] -->\n"
0
         text << IO.read(partial).gsub("\r\n", "\n")
...
40
41
42
43
 
44
45
46
...
40
41
42
 
43
44
45
46
0
@@ -40,7 +40,7 @@
0
       modules = pieces
0
     end
0
 
0
- partial = File.join(current_file.rails_root, 'app', 'views', modules, "_#{partial_name}.rhtml")
0
+ partial = File.join(current_file.rails_root, 'app', 'views', modules, "_#{partial_name}.html.erb")
0
     TextMate.open(partial)
0
 
0
   # Example: render :action => 'login'
...
47
48
49
50
 
51
52
53
...
56
57
58
59
 
60
61
62
...
85
86
87
88
 
89
90
91
...
203
204
205
206
 
207
208
209
...
47
48
49
 
50
51
52
53
...
56
57
58
 
59
60
61
62
...
85
86
87
 
88
89
90
91
...
203
204
205
 
206
207
208
209
0
@@ -47,7 +47,7 @@
0
 
0
 def find_or_name_view_file(filename, current_file)
0
   # Look for a view file with any of the following extensions
0
- extensions = %w(rhtml rxhtml rxml rjs)
0
+ extensions = %w(html.erb xml.builder rhtml rxhtml rxml rjs)
0
   file_exists = false
0
   extensions.each do |e|
0
     filename_with_extension = filename + "." + e
0
@@ -56,7 +56,7 @@
0
   end
0
   
0
   # No view files found, so ask for the name of a new one
0
- if filename = TextMate.input("Enter the name of the new view file:", filename + '.rhtml')
0
+ if filename = TextMate.input("Enter the name of the new view file:", filename + '.html.erb')
0
     view_file = File.join(current_file.rails_root, 'app', 'views', current_file.modules, current_file.controller_name, filename)
0
     # Create the file and notify TextMate of its existence
0
     f = File.open(view_file, "w"); f.close
0
@@ -85,7 +85,7 @@
0
       modules = pieces
0
     end
0
 
0
- partial = File.join(current_file.rails_root, 'app', 'views', modules, current_file.controller_name, "_#{partial_name}.rhtml")
0
+ partial = File.join(current_file.rails_root, 'app', 'views', modules, current_file.controller_name, "_#{partial_name}.html.erb")
0
     TextMate.open(partial)
0
 
0
   # Example: render :action => 'login'
0
@@ -203,7 +203,7 @@
0
     elsif current_file.file_type == :model
0
       if current_file.buffer.text.include?("ActionMailer::Base")
0
         if result = current_file.buffer.find_method(:direction => :backwards)
0
- full_path = File.join(current_file.rails_root, 'app', 'views', current_file.model_name, result[0] + ".rhtml")
0
+ full_path = File.join(current_file.rails_root, 'app', 'views', current_file.model_name, result[0] + ".html.erb")
0
           TextMate.open full_path
0
         else
0
           TextMate.message "No action found"
...
198
199
200
201
 
202
203
204
...
198
199
200
 
201
202
203
204
0
@@ -198,7 +198,7 @@
0
     case type
0
     when :javascript then '.js'
0
     when :stylesheet then '.css'
0
- when :view then '.rhtml'
0
+ when :view then '.html.erb'
0
     else '.rb'
0
     end
0
   end
...
353
354
355
 
356
357
358
...
378
379
380
 
 
 
381
382
383
...
353
354
355
356
357
358
359
...
379
380
381
382
383
384
385
386
387
0
@@ -353,6 +353,7 @@
0
     <string>C3ED4A88-B9CF-4F2B-B195-3C582ED58C5F</string>
0
     <string>20375601-B13F-4314-B8E4-362706566636</string>
0
     <string>2BD82DCB-1F19-4C8F-BC70-C0BBB06A2138</string>
0
+ <string>4BC406AE-6554-4E83-9031-672855495460</string>
0
     <string>CD60F800-850D-47CF-BE32-3DE665DD5C68</string>
0
     <string>B8F08BD7-6160-482C-8A3D-CBC6BD2079A4</string>
0
     <string>2AC3AC1F-743B-4A33-863C-C37885073806</string>
0
@@ -378,6 +379,9 @@
0
     <string>54D6E91E-8F31-11D9-90C5-0011242E4184</string>
0
     <string>45D7E1FC-7D0B-4105-A1A2-3D10BB555A5C</string>
0
     <string>D54FBDED-5481-4CC7-B75F-66465A499882</string>
0
+ <string>EC605540-C431-4FD0-AD91-D913118DACA7</string>
0
+ <string>EDB6B7B9-E2BA-44EE-A344-24117C636D96</string>
0
+ <string>7FE6D718-C64A-4D15-9CDA-E2E3F752F109</string>
0
   </array>
0
   <key>uuid</key>
0
   <string>467A60E0-6227-11D9-BFB1-000D93589AF6</string>

Comments

    No one has commented yet.