railsbuilder 0.1.16 → 0.1.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/railsbuilder.rb +10 -6
- data.tar.gz.sig +0 -0
- metadata +1 -1
- 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: b24c03e8ac1c406a08b8c3591a3e49419df5d612
|
4
|
+
data.tar.gz: bc1b3623facea7eed81231ee0a2b474d9896f53e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2eedbcc52213f89f9c5103ae388cceadfc65115d0a27a447b5ac9547ffdd234dd729ed927e7af6008117956e85fba814d969d5ed05f8eaf95f169381aa88f6de
|
7
|
+
data.tar.gz: 169e888e78d54ef0bdb825dc5ebda64891595fb1864c84e146489410a0103fc7fea104c47054a3d6ba13bfb42df4cb0ff6eddf65fc3141c408dd6ac053c5763f
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/railsbuilder.rb
CHANGED
@@ -135,6 +135,7 @@ class RailsBuilder
|
|
135
135
|
case child.name.to_sym
|
136
136
|
|
137
137
|
when :model
|
138
|
+
puts 'inside :model'
|
138
139
|
|
139
140
|
# does the controller exitst?
|
140
141
|
|
@@ -154,12 +155,16 @@ class RailsBuilder
|
|
154
155
|
# if the model fields are defined let's generate the model
|
155
156
|
model = child.element('model_class')
|
156
157
|
next unless model
|
158
|
+
puts 'we have a model'
|
157
159
|
|
158
160
|
class_name = model.attributes[:class_name]
|
159
161
|
next unless class_name
|
162
|
+
puts 'we have a class name'
|
160
163
|
|
161
164
|
attributes = model.xpath('.').map {|x| x.attributes.values}
|
162
|
-
|
165
|
+
puts 'attributes : ' + attributes.inspect
|
166
|
+
next if attributes.empty?
|
167
|
+
puts 'we have attributes'
|
163
168
|
|
164
169
|
s = class_name + ' ' + attributes.map{|x| x.join ':'}.join(' ')
|
165
170
|
|
@@ -170,8 +175,8 @@ class RailsBuilder
|
|
170
175
|
r = shell command
|
171
176
|
next if r == :abort
|
172
177
|
|
173
|
-
trigger = "config: a new model with associated entries has "
|
174
|
-
+ "been
|
178
|
+
trigger = "config: a new model with associated entries has "\
|
179
|
+
+ "been found"
|
175
180
|
activity = "file: created app/models/#{class_name.downcase}.rb"
|
176
181
|
@notifications << [trigger, activity]
|
177
182
|
|
@@ -180,12 +185,11 @@ class RailsBuilder
|
|
180
185
|
command = "rake db:migrate"
|
181
186
|
|
182
187
|
puts ":: preparing to execute shell command: `#{command}`"
|
183
|
-
puts 'Are you sure you want to commit this '
|
188
|
+
puts 'Are you sure you want to commit this '\
|
184
189
|
+ 'database operation? (Y/n)'
|
185
190
|
shell command
|
186
191
|
|
187
|
-
trigger = "
|
188
|
-
+ "been created"
|
192
|
+
trigger = "... continuation from previous trigger"
|
189
193
|
activity = "database: created"
|
190
194
|
@notifications << [trigger, activity]
|
191
195
|
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|