condition 0.0.21 → 0.0.22
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 +3 -0
- data/lib/condition/reader/convert_sheet.rb +4 -1
- data/lib/condition/version.rb +1 -1
- data/spec/condition_spec.rb +9 -0
- data/spec/files2/param1.ods +0 -0
- data/spec/files2/param2.ods +0 -0
- data/spec/spec_helper.rb +1 -0
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd4ad5d88a883c7a944b79bddf2cc0fb318e5922
|
4
|
+
data.tar.gz: 43b8c994d97fbaa1567c78c42696524bdc9708d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d1d789909da05bbaa084c0f9d5463b130e05a8eedb396c99985d26d74c4904bbde12a72d1557e9680e9b08941755d864edc38821545e1082533bfc7def8de88
|
7
|
+
data.tar.gz: 5e8a11ce990e6c6cb22ac73bc177417338eca5f49617495c8fa371bdd32399d3b1c53df1c6e6f32f289f6c01a979bdf9c8a9733950d76a19633426d24fdf8558
|
data/README.md
CHANGED
@@ -26,10 +26,13 @@ module Condition
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
-
def convert_dir(path, with_dir_name: true)
|
29
|
+
def convert_dir(path, with_dir_name: true, file_name: nil)
|
30
30
|
basename = File.basename(path)
|
31
31
|
Dir::entries(path).each do |f|
|
32
32
|
next if "." == f || ".." == f || /^\.~lock\.[^.]+\.ods.$/ =~ f
|
33
|
+
if !file_name.nil?
|
34
|
+
next if f != file_name
|
35
|
+
end
|
33
36
|
prefix = with_dir_name ? basename : nil
|
34
37
|
convert_file("#{path}/#{f}", prefix: prefix)
|
35
38
|
end
|
data/lib/condition/version.rb
CHANGED
data/spec/condition_spec.rb
CHANGED
@@ -142,4 +142,13 @@ describe Condition do
|
|
142
142
|
expect(item.options.length).to eq(4)
|
143
143
|
end
|
144
144
|
|
145
|
+
it 'read sheet file' do
|
146
|
+
REDIS.del("files2_param1_params")
|
147
|
+
REDIS.del("files2_param2_params")
|
148
|
+
converter = Condition::Reader::ConvertSheet.new(REDIS)
|
149
|
+
converter.convert_dir(FILES2, file_name: 'param1.ods')
|
150
|
+
expect(REDIS.get("files2_param1_params")).not_to be_nil
|
151
|
+
expect(REDIS.get("files2_param2_params")).to be_nil
|
152
|
+
end
|
153
|
+
|
145
154
|
end
|
Binary file
|
Binary file
|
data/spec/spec_helper.rb
CHANGED
@@ -12,6 +12,7 @@ require 'condition/reader/redis_reader'
|
|
12
12
|
require 'condition/reader/convert_sheet'
|
13
13
|
|
14
14
|
FILES = File.dirname(__FILE__) + "/files"
|
15
|
+
FILES2 = File.dirname(__FILE__) + "/files2"
|
15
16
|
DB = Sequel.connect('postgres://localhost:5432/test?user=aoyagikouhei')
|
16
17
|
MONGO = Mongo::MongoClient.new('localhost', 27017)['test']
|
17
18
|
REDIS = Redis.new
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: condition
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- aoyagikouhei
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -175,6 +175,8 @@ files:
|
|
175
175
|
- spec/condition_spec.rb
|
176
176
|
- spec/files/mongo.ods
|
177
177
|
- spec/files/t_user.ods
|
178
|
+
- spec/files2/param1.ods
|
179
|
+
- spec/files2/param2.ods
|
178
180
|
- spec/spec_helper.rb
|
179
181
|
homepage: https://github.com/aoyagikouhei/condition
|
180
182
|
licenses:
|
@@ -196,7 +198,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
196
198
|
version: '0'
|
197
199
|
requirements: []
|
198
200
|
rubyforge_project:
|
199
|
-
rubygems_version: 2.1.
|
201
|
+
rubygems_version: 2.1.11
|
200
202
|
signing_key:
|
201
203
|
specification_version: 4
|
202
204
|
summary: Condition Test
|
@@ -204,4 +206,6 @@ test_files:
|
|
204
206
|
- spec/condition_spec.rb
|
205
207
|
- spec/files/mongo.ods
|
206
208
|
- spec/files/t_user.ods
|
209
|
+
- spec/files2/param1.ods
|
210
|
+
- spec/files2/param2.ods
|
207
211
|
- spec/spec_helper.rb
|