seed_report 0.2.0 → 0.3.0

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: b975180e7b04edee01234d95b3d5ebc98c36bf76
4
- data.tar.gz: 885872b4a4fdf5b9a424cfd7bebcfa27fb7c2977
3
+ metadata.gz: 019532d49673814af6985ed6064dc8e37de51333
4
+ data.tar.gz: f19dfc85044ede21163f536b9e5e745142958b75
5
5
  SHA512:
6
- metadata.gz: cfd31a7c910da20dddf52ce92355dfe3c2ef8a78f52a17eb6ffa88b9dcd56838865bddc7860162e6afb9dbf89b821d2fe58f727bc774318f659bc2b618fbca6e
7
- data.tar.gz: 0b1891a361cac6c9a27a4983a0f52a40de7e7a1fab8222af8a58fbd9bfa3de0e0b2590d94c3640ff2c6e26fafc89d424cd0e37266e06061b326fcffa2fcb1756
6
+ metadata.gz: a8d3576986076e0d6818581748f34f94e606312789b695acc80312e72cc358ff62aee3e17f1d6fba3e5f53bd240af775dbbecf9827f3b71fb72554137d0facc2
7
+ data.tar.gz: 0f8fcda82f36e1b28cd0f48b5e6cd5d6a1921946ccc8f7f29e6a9453bb5b7c01e63ae1d563a006a41c2a3e9201fe917cb62a53bdebf98b56c31fe1ef8fd35db2
@@ -1,3 +1,3 @@
1
1
  module SeedReport
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
data/lib/seed_report.rb CHANGED
@@ -3,20 +3,21 @@ require "seed_report/version"
3
3
  module SeedReport
4
4
  class << self
5
5
  def for_model(model, &block)
6
- print "#{heading(model)} #{initial_count_display(model)}"
7
6
  initial_count = model.count
7
+ print "#{heading(model)} #{initial_count_display(initial_count)}"
8
+
8
9
  block.call
10
+
9
11
  increase = model.count - initial_count
10
12
  puts final_count_display(increase)
11
13
  end
12
14
 
13
15
  def heading(model)
14
- class_name = "#{model.table_name.gsub('_',' ').titleize}..."
15
- sprintf(" %-19s", class_name)
16
+ sprintf(" %-19s", model.name)
16
17
  end
17
18
 
18
- def initial_count_display(model)
19
- "initial count: #{sprintf("%3d", model.count)}"
19
+ def initial_count_display(count)
20
+ "initial count: #{sprintf("%3d", count)}"
20
21
  end
21
22
 
22
23
  def final_count_display(amount)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seed_report
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robb Shecter
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-10-08 00:00:00.000000000 Z
11
+ date: 2015-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler