csv_monster 0.1.0 → 0.1.1

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.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- csv_monster (0.0.1)
4
+ csv_monster (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,3 +1,3 @@
1
1
  class CSVMonster
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/lib/csv_monster.rb CHANGED
@@ -41,11 +41,12 @@ class CSVMonster
41
41
  end
42
42
 
43
43
  def split split_count
44
- header, *tail = self.content
44
+ header, *entries = self.content
45
45
  splits = []
46
46
 
47
- tail.each_with_index do |row, i|
48
- if (i % (tail.length / split_count)).zero? && split_count > splits.length
47
+ entries.each_with_index do |row, i|
48
+ if (i % (entries.length / split_count)).zero? &&
49
+ split_count > splits.length
49
50
  splits << self.class.new
50
51
  splits.last.content << header
51
52
  end
@@ -64,7 +65,7 @@ class CSVMonster
64
65
  end
65
66
  end
66
67
 
67
- puts "wrote #{content.length} rows to #{outfile}"
68
+ outfile
68
69
  end
69
70
 
70
71
  private
@@ -205,6 +205,10 @@ describe CSVMonster do
205
205
 
206
206
  subject { csv_monster.write! outfile }
207
207
 
208
+ it "returns the file path it wrote to" do
209
+ expect(subject).to eq outfile
210
+ end
211
+
208
212
  it "writes the file to the specified location" do
209
213
  expect(File.exists? outfile).to be_false
210
214
  subject
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: csv_monster
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -88,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
88
  version: '0'
89
89
  requirements: []
90
90
  rubyforge_project:
91
- rubygems_version: 1.8.21
91
+ rubygems_version: 1.8.24
92
92
  signing_key:
93
93
  specification_version: 3
94
94
  summary: A monster of a CSV util