combination-extractor 0.9.1 → 0.9.2

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: 4a10193e2d21d04c508a551cb538bbe2449afdf3
4
- data.tar.gz: c95e458acf5d7c2d598f70fd72697831b730c1a1
3
+ metadata.gz: 5933ab17120480d9f3d60cf0bf60e83f5f267f71
4
+ data.tar.gz: b49edc85ec116d58b90aef4a499bd26fa606ddc7
5
5
  SHA512:
6
- metadata.gz: 3b71399bf0140bf4c2fc8db1bebd2ff6350487f9f7c297d6010829dfa15250135316e3ae5526eef439bba51a07a3351b89b04897495e7abdbe522b0bd45477c8
7
- data.tar.gz: 12ed18d5e9ee73546eb0770441332d589e2636fd34c5b8882be6f5eb31060e2fc4cde841218e6592198801aa3d6ce9db6fbde1bf8fcfa0ad8a70c3d0bc5f2cec
6
+ metadata.gz: b7fc0664276e0538b812b682188f7bc739b1de5813ef8249d173f00ed73ba4a46ca920b061dbb76ff49f11a94bdef62c6d0f89b2dc8d59e202af64903118bb00
7
+ data.tar.gz: 8bebd92c13d8dd09936ef3753c7e52c6ce9f6d16859f6d8199f88d8639bdaf5aa3986716e47afc98f9474c7780b9506f78aa4b84962847c8dcce31e8fdef95e2
@@ -0,0 +1 @@
1
+ 2.4.1
@@ -0,0 +1,7 @@
1
+ ## 0.9.2
2
+
3
+ - Add `#name_for` method.
4
+
5
+ ## 0.9.1
6
+
7
+ - first release.
@@ -1,12 +1,18 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- combination-extractor (0.9.1)
4
+ combination-extractor (0.9.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
+ ast (2.4.0)
9
10
  diff-lcs (1.2.5)
11
+ parallel (1.12.1)
12
+ parser (2.5.0.4)
13
+ ast (~> 2.4.0)
14
+ powerpack (0.1.1)
15
+ rainbow (3.0.0)
10
16
  rake (10.5.0)
11
17
  rspec (3.4.0)
12
18
  rspec-core (~> 3.4.0)
@@ -21,6 +27,15 @@ GEM
21
27
  diff-lcs (>= 1.2.0, < 2.0)
22
28
  rspec-support (~> 3.4.0)
23
29
  rspec-support (3.4.1)
30
+ rubocop (0.53.0)
31
+ parallel (~> 1.10)
32
+ parser (>= 2.5)
33
+ powerpack (~> 0.1)
34
+ rainbow (>= 2.2.2, < 4.0)
35
+ ruby-progressbar (~> 1.7)
36
+ unicode-display_width (~> 1.0, >= 1.0.1)
37
+ ruby-progressbar (1.9.0)
38
+ unicode-display_width (1.3.0)
24
39
 
25
40
  PLATFORMS
26
41
  ruby
@@ -29,7 +44,8 @@ DEPENDENCIES
29
44
  bundler (~> 1.10)
30
45
  combination-extractor!
31
46
  rake (~> 10.0)
32
- rspec (~> 3.4.0)
47
+ rspec (~> 3.4)
48
+ rubocop (~> 0.53)
33
49
 
34
50
  BUNDLED WITH
35
- 1.10.6
51
+ 1.16.1
data/Rakefile CHANGED
@@ -3,4 +3,4 @@ require 'rspec/core/rake_task'
3
3
 
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
6
- task :default => :spec
6
+ task default: :spec
@@ -1,5 +1,5 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
1
+
2
+ lib = File.expand_path('lib', __dir__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'combination_extractor'
5
5
 
@@ -22,4 +22,5 @@ Gem::Specification.new do |spec|
22
22
  spec.add_development_dependency 'bundler', '~> 1.10'
23
23
  spec.add_development_dependency 'rake', '~> 10.0'
24
24
  spec.add_development_dependency 'rspec', '~> 3.4'
25
+ spec.add_development_dependency 'rubocop', '~> 0.53'
25
26
  end
@@ -1,6 +1,6 @@
1
1
 
2
2
  module CombinationExtractor
3
- VERSION = '0.9.1'
3
+ VERSION = '0.9.2'.freeze
4
4
 
5
5
  # Exctract keyed patterns hash to combination keyed hash.
6
6
  # @param key_to_pattern key: title for values, value: [Array] various value to use making combination.
@@ -11,10 +11,18 @@ module CombinationExtractor
11
11
  # {:fruit=>"orange", :city=>"NewYork"}, {:fruit=>"orange", :city=>"London"}, {:fruit=>"orange", :city=>"Tokyo"}]
12
12
  def self.extract(key_to_pattern)
13
13
  return nil unless key_to_pattern
14
- extracted = [nil].product(*(key_to_pattern.values))
14
+ extracted = [nil].product(*key_to_pattern.values)
15
15
  extracted.map do |pattern|
16
16
  pattern.shift
17
17
  Hash[key_to_pattern.keys.zip(pattern)]
18
18
  end
19
19
  end
20
+
21
+ # Generate a name from combination
22
+ # @param combination[Hash] based combination
23
+ # @return [String] the name of combination
24
+ def self.name_for(combination)
25
+ return nil unless combination
26
+ combination.map { |k, v| "#{k}=#{v.inspect}" }.join(', ')
27
+ end
20
28
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: combination-extractor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroki Akiyama
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-03-22 00:00:00.000000000 Z
11
+ date: 2018-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.4'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.53'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.53'
55
69
  description: Extract patterns array to hash list for combination.
56
70
  email:
57
71
  - akiyama@akiroom.com
@@ -61,7 +75,9 @@ extra_rdoc_files: []
61
75
  files:
62
76
  - ".gitignore"
63
77
  - ".rspec"
78
+ - ".ruby-version"
64
79
  - ".travis.yml"
80
+ - CHANGELOG.md
65
81
  - Gemfile
66
82
  - Gemfile.lock
67
83
  - LICENSE.txt
@@ -91,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
107
  version: '0'
92
108
  requirements: []
93
109
  rubyforge_project:
94
- rubygems_version: 2.4.5.1
110
+ rubygems_version: 2.6.12
95
111
  signing_key:
96
112
  specification_version: 4
97
113
  summary: Extract array to combination hash list.