fixtures_dump 0.1.0 → 0.2.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d38260f856c462de97c1bbdd091b6d2822b4f2ddcf27251eca865a98133be7bb
4
- data.tar.gz: 51c4dc6298a1107a80df5911dfb91cd77996ab4f84357dd327a2e3955048c467
3
+ metadata.gz: 35c8233282c86adc1caec5f616b5fd195f9b3d997891bea70a15ee7b70d2efc8
4
+ data.tar.gz: 27b66b17ceca46cb019ed1586c11e24798a488d8cec45a61e37353bc556b334e
5
5
  SHA512:
6
- metadata.gz: ad13c28d483029d3da785ed39d22bfc2b6261cfda505ad7e2f1fb7dff19eb4b4686ed5408e3ca2c5e0dc9430924d5b1e2e512831a898f0d11b1838e1570c4d15
7
- data.tar.gz: 5214539e2870725880aea0bb99dcc751cd3f17ee0182d06845cbda1a5317c6fcc24e0e73ada3f0935c847cc0553ed225d69dcead00d2b5483b3daed6ba1d4cb2
6
+ metadata.gz: 843dba5ed32b5f109c35fc40a5d15793ecd34facbfe34ccefe72e081d3277937324af28669a78d528c72023158fa7c1f3775684a47a58f20f62fb667e2aa4b01
7
+ data.tar.gz: 510e2d769d14474fd26454703ae05a95b6047c99e80bff53c1bac46fd10aa28e9288ff7977142ab098d77b41e1847abd32cdc69df5ba615244648be307e8df77
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
+ fixtures_dump-*.gem
1
2
  /.bundle/
2
3
  /.yardoc
3
4
  /_yardoc/
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # FixturesDump
2
2
 
3
- 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/fixtures_dump`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ A rake task to allow exporting the current database as fixture files (in the Yaml format).
6
4
 
7
5
  ## Installation
8
6
 
@@ -22,7 +20,21 @@ Or install it yourself as:
22
20
 
23
21
  ## Usage
24
22
 
25
- TODO: Write usage instructions here
23
+ ### General usage:
24
+
25
+ bundle exec rake db:fixtures:dump
26
+
27
+ It defaults to using _'test/fixtures'_ as the fixture folder. This can be customized with the environmental variable _FIXTURES_PATH_
28
+
29
+ FIXTURES_PATH=spec/fixtures bundle exec rake db:fixtures:dump
30
+
31
+ You can either dump all models (with no configuration), or you can whitelist the desired models with the _REQUIRED_ environmental variable.
32
+
33
+ REQUIRED=RequiredModel bundle exec rake db:fixtures:dump
34
+
35
+ You can also download all the models that descend from _ActiveRecord::Base.descendants_ except for some:
36
+
37
+ EXCLUDED=ExcludeThis bundle exec rake db:fixtures:dump
26
38
 
27
39
  ## Development
28
40
 
@@ -32,7 +44,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
32
44
 
33
45
  ## Contributing
34
46
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/fixtures_dump. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
47
+ Bug reports and pull requests are welcome on GitHub at https://github.com/cionescu/fixtures_dump. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
48
 
37
49
  ## License
38
50
 
@@ -40,4 +52,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
40
52
 
41
53
  ## Code of Conduct
42
54
 
43
- Everyone interacting in the FixturesDump project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/fixtures_dump/blob/master/CODE_OF_CONDUCT.md).
55
+ Everyone interacting in the FixturesDump project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/cionescu/fixtures_dump/blob/master/CODE_OF_CONDUCT.md).
@@ -1,3 +1,3 @@
1
1
  module FixturesDump
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -31,7 +31,7 @@ namespace 'db:fixtures' do
31
31
  "#{model.to_s.underscore}_#{r.id}"
32
32
  end
33
33
  attributes = r.attributes.except(:password_digest).delete_if{|k,v| v.nil?}
34
- hash[key] = attributes
34
+ hash[key.underscore] = attributes
35
35
  end
36
36
  file.write hash.to_yaml
37
37
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fixtures_dump
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Catalin Ionescu
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-11-20 00:00:00.000000000 Z
11
+ date: 2019-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -95,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
95
  version: '0'
96
96
  requirements: []
97
97
  rubyforge_project:
98
- rubygems_version: 2.7.2
98
+ rubygems_version: 2.7.6
99
99
  signing_key:
100
100
  specification_version: 4
101
101
  summary: Fixture Generator