inheritable_fixtures 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d5cf907d5ad4f16706ce69b5387408bda6502b68
4
- data.tar.gz: 866cd601138e6a7b7600a33cbdec62fabde391f7
3
+ metadata.gz: 9cc89a34c526032c1edfd84d12ae2466dae3e882
4
+ data.tar.gz: 7a784856afb626b8e8a530d8158699f22a6a33c8
5
5
  SHA512:
6
- metadata.gz: 6dcb8a183bc6229184e90fc2c9de532021dc3d8ee4606452f52c3fa7511b4ae18446795a3001537f703e994df91e4753a364ac508940362f01fcd11cb612d134
7
- data.tar.gz: b6dc384607561a236fc7f54e612088669c68df89bce4c8fbdb23e91f9bab4f0b7e1ce29c2273a8ad46d24726a6740641720839052abb91b0be6541d87a5c9556
6
+ metadata.gz: dced53ba7d393d636c97aec29199f87e2c2c3cb876dc30deb3b432a71c31d9931630d1d724b8acf94cf5fa1635af19229a2a8eb7095c70169602f6f8bf476042
7
+ data.tar.gz: d05ea42b1f1785b4bf65f7ba22276a7ff04b50fd21a0198a25cb95be0a51aa8813957dc70e81972e82943ef4f79ed92fe622cc5c5083f04c60b4e32d3acc5887
data/README.md CHANGED
@@ -3,9 +3,7 @@
3
3
  [![GitHub version](https://badge.fury.io/gh/appfolio%2Finheritable_fixtures.svg)](http://badge.fury.io/gh/appfolio%2Finheritable_fixtures)
4
4
  [![Build Status](https://travis-ci.org/appfolio/inheritable_fixtures.svg?branch=master)](https://travis-ci.org/appfolio/inheritable_fixtures)
5
5
 
6
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/inheritable_fixtures`. To experiment with that code, run `bin/console` for an interactive prompt.
7
-
8
- TODO: Delete this and the text above, and describe your gem
6
+ Allows Rails' engines to contain fixtures for their models and for those fixtures to be automatically used in the downstream engines. This is very much in line with Rails' engines containing db migrations for their models and for those migrations to be automatically used by the downstream engines (as described [here]( http://pivotallabs.com/leave-your-migrations-in-your-rails-engines/)).
9
7
 
10
8
  ## Installation
11
9
 
@@ -19,19 +17,23 @@ And then execute:
19
17
 
20
18
  $ bundle
21
19
 
22
- Or install it yourself as:
20
+ ## Usage
21
+
22
+ This gem introduces a configuration option called `Rails.application.config.fixtures_paths`, which is by default empty. The list of fixtures is determined by traversing all the `fixtures_paths` looking for fixture files. Note, `<rails root>/test/fixtures` is always prepended to the list and thus it has the highest precedence.
23
23
 
24
- $ gem install inheritable_fixtures
24
+ When the application initializes, each engine adds `todo` to the list (if that path exists).
25
25
 
26
- ## Usage
26
+ ### fixtures :all
27
27
 
28
- TODO: Write usage instructions here
28
+ Tests use `fixtures :all` or `fixtures :users, :addresses` to initial the database with necessary test data. The `fixtures` will now search for the fixtures in all `fixtures_paths` in addition to the usual `Rails.root.join('test/fixtures')`.
29
+
30
+ ### fixtures\_file\_upload
29
31
 
30
- ## Development
32
+ The `fixture_file_upload` is a handy utility provided by Rails' for creating `Rack::Test::UploadedFile` out of a fixture file. The `fixture_file_upload` will now look for the fixture in all `fixtures_paths` in addition to the usual `Rails.root.join('test/fixtures')`.
31
33
 
32
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
34
+ ### rake db:fixtures:load
33
35
 
34
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
36
+ The `db:fixtures:load` task is used to populate a database with the fixtures. This task will now load all fixtures from `fixtures_paths` in addition to the usual `Rails.root.join('test/fixtures')`.
35
37
 
36
38
  ## Contributing
37
39
 
@@ -6,7 +6,6 @@ module InheritableFixtures
6
6
  end
7
7
 
8
8
  require 'inheritable_fixtures/rails_extensions/engine'
9
- require 'inheritable_fixtures/rails_extensions/engine_configuration'
10
9
  require 'inheritable_fixtures/rails_extensions/test_fixtures'
11
10
  require 'inheritable_fixtures/rails_extensions/test_process'
12
11
  require 'inheritable_fixtures/engine'
@@ -30,6 +29,5 @@ module ActionDispatch
30
29
  end
31
30
  end
32
31
 
33
- Rails::Engine::Configuration.prepend(::InheritableFixtures::RailsExtensions::EngineConfiguration)
34
- Rails::Engine.include(::InheritableFixtures::RailsExtensions::Engine)
32
+ Rails::Engine::Configuration.prepend(::InheritableFixtures::RailsExtensions::Engine)
35
33
 
@@ -1,3 +1,3 @@
1
1
  module InheritableFixtures
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inheritable_fixtures
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Kmiec
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-07-14 00:00:00.000000000 Z
11
+ date: 2015-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -48,7 +48,6 @@ files:
48
48
  - lib/inheritable_fixtures/engine.rb
49
49
  - lib/inheritable_fixtures/rails_extensions/db_fixtures.rake
50
50
  - lib/inheritable_fixtures/rails_extensions/engine.rb
51
- - lib/inheritable_fixtures/rails_extensions/engine_configuration.rb
52
51
  - lib/inheritable_fixtures/rails_extensions/test_fixtures.rb
53
52
  - lib/inheritable_fixtures/rails_extensions/test_process.rb
54
53
  - lib/inheritable_fixtures/version.rb
@@ -1,15 +0,0 @@
1
- module InheritableFixtures
2
- module RailsExtensions
3
- module EngineConfiguration
4
- def paths
5
- @paths ||= begin
6
- paths = super
7
- paths.add("lib/test/fixtures")
8
- paths
9
- end
10
- end
11
- end
12
- end
13
- end
14
-
15
-