railsbuilder 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/railsbuilder.rb +22 -8
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7a53d1909bcb338048d8b383aebdbcc35752e8fc
|
|
4
|
+
data.tar.gz: 0ff37fdb31bc77ccbe6386fb39de773db624d9fa
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c4423924292843ca4037390cfac3235be78272ef916a5314369959d2e7c53f7a469f303fd8f6aab68f02e13f202904d2a0810dfff1483fda342fa5bba6ca748f
|
|
7
|
+
data.tar.gz: e548f193a35ed8356174bad133e2ca8f840aaa14a6ec0e2d941c630ac5b7583bd55d249108988c07f78db0844796525a6036321abe2e2b828396dfcbac9e44eb
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/lib/railsbuilder.rb
CHANGED
|
@@ -23,7 +23,7 @@ class RailsBuilder
|
|
|
23
23
|
[:model, ':class_name', :model_class],
|
|
24
24
|
[:model_class, /(\w+):\s*(string|text)/, :class_attribute],
|
|
25
25
|
[:resource, /controller \+ views/, :resource_cv],
|
|
26
|
-
[:resource_cv, /(\w+)(?:\s+[av]{1,2})?/, :resource_cv_av],
|
|
26
|
+
[:resource_cv, /(\w+)(?:\s+([av]{1,2}))?/, :resource_cv_av],
|
|
27
27
|
[:all, /^\s*#/, :comment]
|
|
28
28
|
]
|
|
29
29
|
|
|
@@ -137,8 +137,8 @@ class RailsBuilder
|
|
|
137
137
|
command = "rake db:migrate"
|
|
138
138
|
|
|
139
139
|
puts ":: preparing to execute shell command: `#{command}`"
|
|
140
|
-
puts 'Are you sure you want to commit this
|
|
141
|
-
|
|
140
|
+
puts 'Are you sure you want to commit this ' \
|
|
141
|
+
+ 'database operation? (Y/n)'
|
|
142
142
|
shell command
|
|
143
143
|
|
|
144
144
|
when :resource_cv
|
|
@@ -178,16 +178,31 @@ class RailsBuilder
|
|
|
178
178
|
File.write controller_file, buffer
|
|
179
179
|
puts ':: updated ' + controller
|
|
180
180
|
end
|
|
181
|
+
|
|
182
|
+
av_type = av.attributes[:captures1]
|
|
183
|
+
next unless av_type
|
|
184
|
+
|
|
185
|
+
if av_type[/v/] then
|
|
186
|
+
|
|
187
|
+
page = action + '.html.erb'
|
|
188
|
+
view_file = File.join('app','views', resource, page)
|
|
189
|
+
|
|
190
|
+
unless File.exists? view_file then
|
|
191
|
+
File.write view_file, ''
|
|
192
|
+
puts ':: created ' + page
|
|
193
|
+
end
|
|
194
|
+
end
|
|
181
195
|
end
|
|
182
196
|
|
|
183
197
|
else
|
|
184
198
|
|
|
185
199
|
unless File.exists? view_file then
|
|
186
200
|
|
|
187
|
-
command = "rails generate controller %s %s" %
|
|
201
|
+
command = "rails generate controller %s %s" %
|
|
202
|
+
[resource, action]
|
|
188
203
|
puts ":: preparing to execute shell command: `#{command}`"
|
|
189
|
-
puts 'Are you sure you want to generate a
|
|
190
|
-
|
|
204
|
+
puts 'Are you sure you want to generate a ' \
|
|
205
|
+
+ 'controller action? (Y/n)'
|
|
191
206
|
shell command
|
|
192
207
|
end
|
|
193
208
|
end
|
|
@@ -233,8 +248,7 @@ EOF
|
|
|
233
248
|
end
|
|
234
249
|
|
|
235
250
|
@config = s
|
|
236
|
-
@lp = LineParser.new(patterns)
|
|
237
|
-
@lp.parse s
|
|
251
|
+
@lp = LineParser.new(patterns, s)
|
|
238
252
|
|
|
239
253
|
end
|
|
240
254
|
|
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: railsbuilder
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- James Robertson
|
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
|
31
31
|
bNcCWso1cJhifoTCytPAyf9YVuyU4HjqC3eqx3p00NCg0VoELwMEkyhkpvYOGz2l
|
|
32
32
|
NSkTRB6yCN+xzQ==
|
|
33
33
|
-----END CERTIFICATE-----
|
|
34
|
-
date: 2014-03-
|
|
34
|
+
date: 2014-03-13 00:00:00.000000000 Z
|
|
35
35
|
dependencies:
|
|
36
36
|
- !ruby/object:Gem::Dependency
|
|
37
37
|
name: rails
|
metadata.gz.sig
CHANGED
|
Binary file
|