excel-esv 0.0.5 → 0.0.6

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
  SHA1:
3
- metadata.gz: 5049cc83b275a96858474dff192d8a82d00482d8
4
- data.tar.gz: bd781b1577a1f3938f87f2d607e99a86792bf656
3
+ metadata.gz: b544865a37c01eed489d2e594669590524b26671
4
+ data.tar.gz: 45ec1bb9782dc87afa960fb5315d58db63cebaaa
5
5
  SHA512:
6
- metadata.gz: 5d875ee2efd7c203d1f2499d6da0155992453c06a1bb2bbb664e2c039b92a848a0df114c1f7d01069f15985afb42c67b4ae24b2d615f406e0e071102f7cdd593
7
- data.tar.gz: f04a30dac8cf0c0d8c83bd5d982e7d91a6af39619483036ea9b3b8b7d3d6909a36d811c3e38266972335d220c72f103605c0cb20d009e1f2ffb0abd2aee41008
6
+ metadata.gz: 850ee1d9dae6adb72d3613512b06326260979e6386a5fdde37e634f8c4f7d2764d76f4b7de2622855b1a9a4c21845155f11b4e4b4b1cfb3ff120d090e24a1682
7
+ data.tar.gz: b4db484b860bb6245d26023d32a4ce34438d8252adf578ba6fc18f830894607ba2c782ba02003e900ab88e0721daeb7fe6312d99d9854bd9dcb3702a22170743
data/README.md CHANGED
@@ -39,7 +39,19 @@ end
39
39
  require "esv"
40
40
 
41
41
  data = File.read("/tmp/test.xls")
42
- output = ESV.parse(data) # => [ [ "Name", "Dogs", … ], … ]
42
+ output = ESV.parse(data)
43
+ # => [ [ "Name", "Dogs", … ], … ]
44
+ ```
45
+
46
+ This assumes a file with a single worksheet and will raise otherwise.
47
+
48
+ ### Parse file
49
+
50
+ ``` ruby
51
+ require "esv"
52
+
53
+ output = ESV.parse_file("/tmp/test.xls")
54
+ # => [ [ "Name", "Dogs", … ], … ]
43
55
  ```
44
56
 
45
57
  This assumes a file with a single worksheet and will raise otherwise.
data/lib/esv/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module ESV
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
data/lib/esv.rb CHANGED
@@ -27,4 +27,8 @@ module ESV
27
27
 
28
28
  book.worksheet(0).to_a
29
29
  end
30
+
31
+ def self.parse_file(path)
32
+ parse File.read(path)
33
+ end
30
34
  end
data/spec/esv_spec.rb CHANGED
@@ -37,7 +37,7 @@ describe ESV, ".parse" do
37
37
  end
38
38
  end
39
39
 
40
- describe ESV, ".generate_file" do
40
+ describe ESV, ".generate_file and .parse_file" do
41
41
  before do
42
42
  @file = Tempfile.new("esv")
43
43
  end
@@ -50,8 +50,7 @@ describe ESV, ".generate_file" do
50
50
  esv << [ 1, 2 ]
51
51
  end
52
52
 
53
- data = File.read(path)
54
- output = ESV.parse(data)
53
+ output = ESV.parse_file(path)
55
54
 
56
55
  expect(output).to eq [
57
56
  [ "Dogs", "Cats" ],
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: excel-esv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henrik Nyh