letterpress 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
data/README.md
CHANGED
@@ -34,13 +34,7 @@ Or install it yourself as:
|
|
34
34
|
|
35
35
|
$ bundle install
|
36
36
|
|
37
|
-
3.
|
38
|
-
|
39
|
-
|
40
|
-
$ rails generate letterpress:install
|
41
|
-
|
42
|
-
|
43
|
-
4. Update config/application.rb
|
37
|
+
3. Update config/application.rb
|
44
38
|
|
45
39
|
``` ruby
|
46
40
|
config.generators do |g|
|
@@ -48,6 +42,13 @@ Or install it yourself as:
|
|
48
42
|
end
|
49
43
|
```
|
50
44
|
|
45
|
+
4. Generate (test|spec)/blueprint.rb file
|
46
|
+
|
47
|
+
|
48
|
+
$ rails generate letterpress:install
|
49
|
+
|
50
|
+
|
51
|
+
|
51
52
|
5. Generate a model object with its factory
|
52
53
|
|
53
54
|
$ rails generate model Comment post_id:integer body:text
|
@@ -8,7 +8,7 @@ module Letterpress
|
|
8
8
|
|
9
9
|
def blueprints_file
|
10
10
|
if rspec?
|
11
|
-
copy_file "blueprint.rb", "spec/blueprint.rb"
|
11
|
+
copy_file "blueprint.rb", "spec/support/blueprint.rb"
|
12
12
|
else
|
13
13
|
copy_file "blueprint.rb", "test/blueprint.rb"
|
14
14
|
end
|
@@ -17,7 +17,7 @@ module Letterpress
|
|
17
17
|
private
|
18
18
|
|
19
19
|
def rspec?
|
20
|
-
options[:test_framework].to_sym == :rspec
|
20
|
+
options[:test_framework].to_s.to_sym == :rspec
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
@@ -6,8 +6,8 @@ module Letterpress
|
|
6
6
|
def create_blueprint
|
7
7
|
file_name = if File.exists?(File.join(Rails.root, 'test', 'blueprint.rb'))
|
8
8
|
"test/blueprint.rb"
|
9
|
-
elsif File.exists?(File.join(Rails.root, 'spec', 'blueprint.rb'))
|
10
|
-
"spec/blueprint.rb"
|
9
|
+
elsif File.exists?(File.join(Rails.root, 'spec', 'support', 'blueprint.rb'))
|
10
|
+
"spec/support/blueprint.rb"
|
11
11
|
else
|
12
12
|
raise "Cannot find the blueprint file"
|
13
13
|
end
|
data/lib/letterpress/version.rb
CHANGED