letterpress 0.0.6 → 0.0.7
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/README.md
CHANGED
@@ -91,6 +91,26 @@ Or install it yourself as:
|
|
91
91
|
end
|
92
92
|
```
|
93
93
|
|
94
|
+
## Rspec
|
95
|
+
Don't put the blueprint file in the support directory, if you do, the blueprint file will be required to early.
|
96
|
+
It should be placed directly in the spec folder: `spec/blueprint.rb`
|
97
|
+
If you do step 3 and 4. Letterpress will add the blueprint file at the right place.
|
98
|
+
|
99
|
+
3. Update config/application.rb
|
100
|
+
|
101
|
+
```ruby
|
102
|
+
ruby
|
103
|
+
config.generators do |g|
|
104
|
+
g.test_framework :rspec, :fixture_replacement => :letterpress
|
105
|
+
end
|
106
|
+
```
|
107
|
+
|
108
|
+
4. Generate (test|spec)/blueprint.rb file
|
109
|
+
|
110
|
+
```ruby
|
111
|
+
rails generate letterpress:install
|
112
|
+
```
|
113
|
+
|
94
114
|
|
95
115
|
## Blueprint Class
|
96
116
|
A blueprint for a model is defined inside the Letterpress module; the class name of the blueprint
|
@@ -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', '
|
10
|
-
"spec/
|
9
|
+
elsif File.exists?(File.join(Rails.root, 'spec', 'blueprint.rb'))
|
10
|
+
"spec/blueprint.rb"
|
11
11
|
else
|
12
12
|
raise "Cannot find the blueprint file"
|
13
13
|
end
|
data/lib/letterpress/railtie.rb
CHANGED
@@ -2,7 +2,7 @@ module Letterpress
|
|
2
2
|
class Railtie < Rails::Railtie
|
3
3
|
config.after_initialize do
|
4
4
|
blueprints = [ File.join(Rails.root, 'test', 'blueprint'),
|
5
|
-
File.join(Rails.root, 'spec', '
|
5
|
+
File.join(Rails.root, 'spec', 'blueprint')]
|
6
6
|
blueprints.each do |path|
|
7
7
|
if File.exists?("#{path}.rb")
|
8
8
|
load("#{path}.rb")
|
data/lib/letterpress/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: letterpress
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-05-
|
12
|
+
date: 2012-05-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|