letterpress 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -8,7 +8,7 @@ module Letterpress
8
8
 
9
9
  def blueprints_file
10
10
  if rspec?
11
- copy_file "blueprint.rb", "spec/support/blueprint.rb"
11
+ copy_file "blueprint.rb", "spec/blueprint.rb"
12
12
  else
13
13
  copy_file "blueprint.rb", "test/blueprint.rb"
14
14
  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', 'support', 'blueprint.rb'))
10
- "spec/support/blueprint.rb"
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
@@ -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', 'support', 'blueprint')]
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")
@@ -1,3 +1,3 @@
1
1
  module Letterpress
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
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.6
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-26 00:00:00.000000000 Z
12
+ date: 2012-05-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord