condition 0.0.21 → 0.0.22

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: a35a3befff8b198904309c0b89f9aefd3e7882f4
4
- data.tar.gz: 4464c12614d73dd49721c9feb5db1ac28efd1f02
3
+ metadata.gz: cd4ad5d88a883c7a944b79bddf2cc0fb318e5922
4
+ data.tar.gz: 43b8c994d97fbaa1567c78c42696524bdc9708d9
5
5
  SHA512:
6
- metadata.gz: 2a6c22a9ec01f890b6b1b987a2990064cee78700963088bdf44c6b3e79f03ba14607b6382f1fa213bc7b72572b8ce30c72da6c602cfcf2858a821e5ee6c6a171
7
- data.tar.gz: cf32216dd84543a2ed579050a222ac3d30bf0b7f48fef5e6abee7d97c081e272892bd95e1e06dc0471b034edf1defe1b96a8f0d7be4834bcaf0e731ba8629aad
6
+ metadata.gz: 2d1d789909da05bbaa084c0f9d5463b130e05a8eedb396c99985d26d74c4904bbde12a72d1557e9680e9b08941755d864edc38821545e1082533bfc7def8de88
7
+ data.tar.gz: 5e8a11ce990e6c6cb22ac73bc177417338eca5f49617495c8fa371bdd32399d3b1c53df1c6e6f32f289f6c01a979bdf9c8a9733950d76a19633426d24fdf8558
data/README.md CHANGED
@@ -30,6 +30,9 @@ TODO: Write usage instructions here
30
30
 
31
31
  ## Changes
32
32
 
33
+ 2013-12-20 0.0.22
34
+ add redis dir read specific file
35
+
33
36
  2013-12-13 0.0.21
34
37
  bugfix options array
35
38
  bugfix check_line over or lack
@@ -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
@@ -1,5 +1,5 @@
1
1
  # coding: utf-8
2
2
 
3
3
  module Condition
4
- VERSION = "0.0.21"
4
+ VERSION = "0.0.22"
5
5
  end
@@ -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.21
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-13 00:00:00.000000000 Z
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.9
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