seed_report 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +48 -13
  3. data/lib/seed_report/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5e8cbcbf933bc21f987d2cf450eebcd0356b5e5a
4
- data.tar.gz: d86414717bcd8be48961627e71869b50929aa4a8
3
+ metadata.gz: dff2ae5b1b58bec07b80303ab0df2f994296f045
4
+ data.tar.gz: b456b2f053872bb0d9476aec2dfb84fe2b3fa8fd
5
5
  SHA512:
6
- metadata.gz: ad980d6e94236f708258c6bace71533ee8cbf4ec948e278634f85a9856f84db14d90d3dd88593ca77bc29e9f6b0f758ce7337fb34b46c8e3fb79b43393b0aa88
7
- data.tar.gz: 795ddc6ebebf564d01e3ad236d3205e47f0300945ac0b5878302fa3506e7f07c32eba98d01980f5d04c04a85feeb2d4ac916f6103903ff1bb3605a3dbb2d1f2e
6
+ metadata.gz: aaf5f128af0b7db6cac145c037038a90261064e46f5d49cb6e8ce27b6aa7481d8d33da98e101450bd0e243a1fbec980ac99d37a16076ec1ff2814e548d63d89f
7
+ data.tar.gz: aed5a6f0f8ffa6e8d1741e599d89e16b5425c1a7b819ad5abdb1c8a6b5a64592b07cf3e91dc63c9ac3c329e2097a70ac4e2b38ca54249ff6f1430c71b4f69f07
data/README.md CHANGED
@@ -1,28 +1,64 @@
1
1
  # SeedReport
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/seed_report`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ ## The Deliverable
4
+ A readable summary of your Rails seed results, with minimal coding.
4
5
 
5
- TODO: Delete this and the text above, and describe your gem
6
+ **Step 1.** Wrap your model `create` and `save`'s with a request for a seed report:
6
7
 
7
- ## Installation
8
+ ```ruby
9
+ SeedReport.for_model Model_class do
10
+ # A block which creates the Model_class seed instances.
11
+ end
12
+ ```
8
13
 
9
- Add this line to your application's Gemfile:
14
+ For example:
10
15
 
11
16
  ```ruby
12
- gem 'seed_report'
17
+ SeedReport.for_model Country do
18
+ Country.find_or_create_by!(
19
+ name: 'United States',
20
+ alpha_2: 'us',
21
+ alpha_3: 'usa',
22
+ region_meta_name: 'state'
23
+ )
24
+ end
25
+
26
+ SeedReport.for_model Region do
27
+ us = Country.find_by! alpha_2: 'us'
28
+
29
+ Region.find_or_create_by!(
30
+ name: 'California',
31
+ slug: 'ca',
32
+ country: us
33
+ )
34
+ Region.find_or_create_by!(
35
+ name: 'Nevada',
36
+ slug: 'nv',
37
+ country: us
38
+ )
39
+ end
40
+
41
+ # etc.
13
42
  ```
14
43
 
15
- And then execute:
44
+ **Step 2.** Run your seeds with `rake db:reset` (my favorite), `rake db:setup`,
45
+ or `rake db:seed`.
16
46
 
17
- $ bundle
47
+ **Step 3.** Enjoy the simple summary output:
18
48
 
19
- Or install it yourself as:
49
+ ![seed-report](https://cloud.githubusercontent.com/assets/150670/10386234/4abc2098-6e09-11e5-909e-b538391de1d7.png)
20
50
 
21
- $ gem install seed_report
51
+ ## Installation
22
52
 
23
- ## Usage
53
+ Add this line to your Rails application's Gemfile:
24
54
 
25
- TODO: Write usage instructions here
55
+ ```ruby
56
+ gem 'seed_report', group: :development
57
+ ```
58
+
59
+ And then execute:
60
+
61
+ $ bundle
26
62
 
27
63
  ## Development
28
64
 
@@ -32,10 +68,9 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
32
68
 
33
69
  ## Contributing
34
70
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/seed_report.
71
+ Bug reports and pull requests are welcome on GitHub at https://github.com/dogweather/seed_report.
36
72
 
37
73
 
38
74
  ## License
39
75
 
40
76
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
41
-
@@ -1,3 +1,3 @@
1
1
  module SeedReport
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seed_report
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robb Shecter