goodsheet 0.2.1 → 0.2.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.
- checksums.yaml +4 -4
- data/README.md +18 -3
- data/lib/goodsheet/spreadsheet.rb +4 -1
- data/lib/goodsheet/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c5b7ba40c72803a5496d2c8138e45c0d12b48e0
|
4
|
+
data.tar.gz: 2fe40921757862d1c4e1920bb88f91716d4294cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 823e26db17139b66e83446d6ad5df5b527bd743cebedf68d87e78039738d7f217ff06226c7992fc2239682e7d7395d37dba3ecb0cdc67d8264db7ce30b3c665f
|
7
|
+
data.tar.gz: a2e4a6b75ccf0d84fdb243e5c47c795ecdcc171186d8d0f8ab8b93d19dd19982b9f5bc4351f5b35b5b6a508aa2192de64ce4c39008672d26256644e2dfa2c153
|
data/README.md
CHANGED
@@ -33,7 +33,7 @@ res = ss.read do
|
|
33
33
|
end
|
34
34
|
|
35
35
|
res.valid? # => true
|
36
|
-
res.values # => {:a => [1.0, 1.0, 1.4], :b => []}
|
36
|
+
res.values # => {:a => [1.0, 1.0, 1.4], :b => [0.0, 3.7, 10.9]}
|
37
37
|
```
|
38
38
|
|
39
39
|
By default:
|
@@ -42,9 +42,24 @@ By default:
|
|
42
42
|
|
43
43
|
Pass your validation rules into the block passed to the read method, together with the column_names method that define the position (or index) and the name of the columns you want to read.
|
44
44
|
|
45
|
-
###
|
45
|
+
### More information on usage
|
46
46
|
|
47
|
-
|
47
|
+
You can select the desired sheet by index (starting from zero) or by name:
|
48
|
+
```ruby
|
49
|
+
ss = Goodsheet::Spreadsheet.new("my_data.xlsx")
|
50
|
+
ss.sheet(2) # select the third sheet
|
51
|
+
ss.sheet("holydays")
|
52
|
+
ss.sheets # get the sheet names array
|
53
|
+
```
|
54
|
+
Get the
|
55
|
+
|
56
|
+
|
57
|
+
```ruby
|
58
|
+
|
59
|
+
|
60
|
+
```
|
61
|
+
|
62
|
+
The +read+ method include the +validate+ method, that can be invoke
|
48
63
|
|
49
64
|
|
50
65
|
|
@@ -5,6 +5,10 @@ module Goodsheet
|
|
5
5
|
class Spreadsheet < Roo::Spreadsheet
|
6
6
|
attr_reader :time_zone, :skip, :header_row, :max_errors, :row_limit
|
7
7
|
|
8
|
+
# Initialize a Goodsheet object
|
9
|
+
#
|
10
|
+
# @param filename [String] the spreadsheet filename you want to read
|
11
|
+
# @param [String] filename the spreadsheet filename you want to read
|
8
12
|
# Valid options:
|
9
13
|
# :skip : number of rows to skip (default: 1)
|
10
14
|
# :header_row : header's row index (0 based, default: 0)
|
@@ -127,4 +131,3 @@ module Goodsheet
|
|
127
131
|
end
|
128
132
|
end
|
129
133
|
|
130
|
-
|
data/lib/goodsheet/version.rb
CHANGED