shoulda_machinist_generator 0.1.4 → 0.1.5
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.
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.5
|
@@ -19,7 +19,7 @@ class ShouldaModelGenerator < Rails::Generator::NamedBase
|
|
19
19
|
:migration_name => "Create#{class_name.pluralize.gsub(/::/, '')}"
|
20
20
|
}, :migration_file_name => "create_#{file_path.gsub(/\//, '_').pluralize}"
|
21
21
|
end
|
22
|
-
|
22
|
+
|
23
23
|
m.template 'blueprints.rb', File.join('test', "blueprints.rb")
|
24
24
|
m.blueprint_resources class_name
|
25
25
|
end
|
@@ -39,13 +39,13 @@ class ShouldaModelGenerator < Rails::Generator::NamedBase
|
|
39
39
|
opt.separator 'Options:'
|
40
40
|
opt.on("--skip-timestamps",
|
41
41
|
"Don't add timestamps to the migration file for this model") { |v| options[:skip_timestamps] = v }
|
42
|
-
opt.on("--skip-migration",
|
42
|
+
opt.on("--skip-migration",
|
43
43
|
"Don't generate a migration file for this model") { |v| options[:skip_migration] = v }
|
44
44
|
opt.on("--skip-factory",
|
45
45
|
"Don't generation a fixture file for this model") { |v| options[:skip_factory] = v}
|
46
46
|
end
|
47
|
-
|
48
|
-
# This inserts the routing declarations into the engine's routes file.
|
47
|
+
|
48
|
+
# This inserts the routing declarations into the engine's routes file.
|
49
49
|
# Copied from Rails::Generator::Commands and modified to make it do what we want.
|
50
50
|
#
|
51
51
|
def blueprint_resources(class_name)
|
@@ -53,9 +53,9 @@ class ShouldaModelGenerator < Rails::Generator::NamedBase
|
|
53
53
|
#
|
54
54
|
sentinel = '# Model class blueprints'
|
55
55
|
gsub_file File.join('test', 'blueprints.rb'), /(#{Regexp.escape(sentinel)})/mi do |match|
|
56
|
-
"\n#{match}\n#{class_name}.blueprint do\nend"
|
56
|
+
"\n#{match}\n#{class_name}.blueprint do\nend\n\n"
|
57
57
|
end
|
58
|
-
|
58
|
+
|
59
59
|
end
|
60
60
|
|
61
61
|
|
@@ -68,3 +68,4 @@ class ShouldaModelGenerator < Rails::Generator::NamedBase
|
|
68
68
|
File.open(path, File::RDWR|File::CREAT) { |file| file.write(content) }
|
69
69
|
end
|
70
70
|
end
|
71
|
+
|