kappamaki 0.0.3 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.coveralls.yml +2 -0
- data/.rubocop.yml +41 -0
- data/.travis.yml +4 -1
- data/README.md +1 -1
- data/Rakefile +12 -0
- data/kappamaki.gemspec +3 -1
- data/lib/kappamaki.rb +5 -5
- data/spec/.rubocop.yml +5 -0
- data/spec/kappamaki_spec.rb +8 -8
- data/spec/spec_helper.rb +5 -0
- metadata +35 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 164e0310820f37082baac4f72a59d049d18941e2
|
4
|
+
data.tar.gz: 3794e12c72ceeb19bfd57424de895ac136b64649
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb123dbc341c771de5c3693464feaa0ea097e5a4ffd5c5518db53ac0af89dd4a95d7307065bac392c30402b0ce3032964b174f2d6993ba50f56f118d376f1070
|
7
|
+
data.tar.gz: e88a76a17285572b71896c5e907e64a3f508e0fe32c5db371a7552cf6d94b3c4c098cb20b413baabe5d5b665c76d99e7fdd455360db25ad06e28ec4c26bc680a
|
data/.coveralls.yml
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
AllCops:
|
2
|
+
|
3
|
+
DisplayCopNames: true
|
4
|
+
|
5
|
+
DisplayStyleGuide: true
|
6
|
+
|
7
|
+
Include:
|
8
|
+
- '**/Rakefile'
|
9
|
+
|
10
|
+
|
11
|
+
Lint/Eval:
|
12
|
+
Enabled: false
|
13
|
+
|
14
|
+
|
15
|
+
Metrics/LineLength:
|
16
|
+
Max: 100
|
17
|
+
|
18
|
+
|
19
|
+
Style/AccessModifierIndentation:
|
20
|
+
EnforcedStyle: outdent
|
21
|
+
|
22
|
+
Style/Documentation:
|
23
|
+
Enabled: false
|
24
|
+
|
25
|
+
Style/EmptyLines:
|
26
|
+
Enabled: false
|
27
|
+
|
28
|
+
Style/EmptyLinesAroundClassBody:
|
29
|
+
EnforcedStyle: empty_lines
|
30
|
+
|
31
|
+
Style/EmptyLinesAroundModuleBody:
|
32
|
+
EnforcedStyle: empty_lines
|
33
|
+
|
34
|
+
Style/MethodDefParentheses:
|
35
|
+
EnforcedStyle: require_no_parentheses
|
36
|
+
|
37
|
+
Style/MultilineOperationIndentation:
|
38
|
+
Enabled: false
|
39
|
+
|
40
|
+
Style/WordArray:
|
41
|
+
Enabled: false
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Kappamaki <a href="https://travis-ci.org/Originate/kappamaki" alt="Build Status" target="_blank"><img src="https://travis-ci.org/Originate/kappamaki.svg?branch=master"></a>
|
1
|
+
# Kappamaki <a href="https://travis-ci.org/Originate/kappamaki" alt="Build Status" target="_blank"><img src="https://travis-ci.org/Originate/kappamaki.svg?branch=master"></a> [![Code Climate](https://codeclimate.com/github/Originate/kappamaki/badges/gpa.svg)](https://codeclimate.com/github/Originate/kappamaki) [![Coverage Status](https://coveralls.io/repos/Originate/kappamaki/badge.svg?branch=master&service=github)](https://coveralls.io/github/Originate/kappamaki?branch=master)
|
2
2
|
|
3
3
|
_Tools for natural, high-level, sophisticated Cucumber steps._
|
4
4
|
|
data/Rakefile
ADDED
data/kappamaki.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'kappamaki'
|
7
|
-
spec.version = '0.0
|
7
|
+
spec.version = '1.0.0'
|
8
8
|
spec.authors = ['Kevin Goslar']
|
9
9
|
spec.email = ['kevin.goslar@originate.com']
|
10
10
|
spec.summary = 'Tools for natural, high-level, sophisticated Cucumber steps'
|
@@ -22,6 +22,8 @@ Gem::Specification.new do |spec|
|
|
22
22
|
|
23
23
|
spec.add_development_dependency 'bundler'
|
24
24
|
spec.add_development_dependency 'rspec'
|
25
|
+
spec.add_development_dependency 'rubocop'
|
26
|
+
spec.add_development_dependency 'coveralls'
|
25
27
|
|
26
28
|
spec.required_ruby_version = '>= 1.9.3'
|
27
29
|
end
|
data/lib/kappamaki.rb
CHANGED
@@ -6,8 +6,8 @@ module Kappamaki
|
|
6
6
|
# key: "value"
|
7
7
|
def self.attributes_from_sentence sentence
|
8
8
|
attributes = Kappamaki.from_sentence(sentence)
|
9
|
-
.map{|piece| piece.split ': '}
|
10
|
-
.map{|key, value| [key.to_sym, value]}
|
9
|
+
.map { |piece| piece.split ': ' }
|
10
|
+
.map { |key, value| [key.to_sym, value] }
|
11
11
|
.flatten
|
12
12
|
Hash[*attributes]
|
13
13
|
end
|
@@ -18,16 +18,16 @@ module Kappamaki
|
|
18
18
|
sentence.gsub(', and ', ', ')
|
19
19
|
.gsub(' and ', ', ')
|
20
20
|
.split(', ')
|
21
|
-
.map{|s| s.
|
21
|
+
.map { |s| s.delete '"' }
|
22
22
|
end
|
23
23
|
|
24
24
|
|
25
25
|
# Converts all keys in the given hash to symbols
|
26
|
-
def self.symbolize_keys_deep!
|
26
|
+
def self.symbolize_keys_deep! h
|
27
27
|
h.keys.each do |k|
|
28
28
|
ks = k.to_sym
|
29
29
|
h[ks] = h.delete k
|
30
|
-
symbolize_keys_deep! h[ks] if h[ks].
|
30
|
+
symbolize_keys_deep! h[ks] if h[ks].is_a? Hash
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
data/spec/.rubocop.yml
ADDED
data/spec/kappamaki_spec.rb
CHANGED
@@ -7,10 +7,10 @@ describe Kappamaki do
|
|
7
7
|
test_data = {
|
8
8
|
|
9
9
|
attributes_from_sentence: {
|
10
|
-
'name: "Foo"' => {name:
|
11
|
-
'name: "Foo" and body: "Bar"' => {name: 'Foo', body: 'Bar'},
|
12
|
-
'name: "Foo", body: "Bar" and title: "Baz"' => {name: 'Foo', body: 'Bar', title:
|
13
|
-
'name: "Foo", body: "Bar", and title: "Baz"' => {name: 'Foo', body: 'Bar', title:
|
10
|
+
'name: "Foo"' => { name: 'Foo' },
|
11
|
+
'name: "Foo" and body: "Bar"' => { name: 'Foo', body: 'Bar' },
|
12
|
+
'name: "Foo", body: "Bar" and title: "Baz"' => { name: 'Foo', body: 'Bar', title: 'Baz' },
|
13
|
+
'name: "Foo", body: "Bar", and title: "Baz"' => { name: 'Foo', body: 'Bar', title: 'Baz' }
|
14
14
|
},
|
15
15
|
|
16
16
|
from_sentence: {
|
@@ -42,14 +42,14 @@ describe Kappamaki do
|
|
42
42
|
it 'converts string keys to symbols' do
|
43
43
|
actual = { 'one' => 'two', 'alpha' => 'beta' }
|
44
44
|
Kappamaki.symbolize_keys_deep! actual
|
45
|
-
expect(actual).to eq
|
45
|
+
expect(actual).to eq one: 'two', alpha: 'beta'
|
46
46
|
end
|
47
47
|
|
48
48
|
it 'converts nested keys' do
|
49
|
-
actual = { 'one' => { 'alpha' => 'beta' }}
|
49
|
+
actual = { 'one' => { 'alpha' => 'beta' } }
|
50
50
|
Kappamaki.symbolize_keys_deep! actual
|
51
|
-
expect(actual).to eq
|
51
|
+
expect(actual).to eq one: { alpha: 'beta' }
|
52
52
|
end
|
53
|
+
|
53
54
|
end
|
54
55
|
end
|
55
|
-
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kappamaki
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Goslar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,6 +38,34 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rubocop
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: coveralls
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
41
69
|
description: |2
|
42
70
|
Kappamaki is a collection of string manipulation methods
|
43
71
|
that make parsing high-lever cucumber steps easier.
|
@@ -47,13 +75,17 @@ executables: []
|
|
47
75
|
extensions: []
|
48
76
|
extra_rdoc_files: []
|
49
77
|
files:
|
78
|
+
- ".coveralls.yml"
|
50
79
|
- ".gitignore"
|
80
|
+
- ".rubocop.yml"
|
51
81
|
- ".travis.yml"
|
52
82
|
- Gemfile
|
53
83
|
- LICENSE.txt
|
54
84
|
- README.md
|
85
|
+
- Rakefile
|
55
86
|
- kappamaki.gemspec
|
56
87
|
- lib/kappamaki.rb
|
88
|
+
- spec/.rubocop.yml
|
57
89
|
- spec/kappamaki_spec.rb
|
58
90
|
- spec/spec_helper.rb
|
59
91
|
homepage: https://github.com/Originate/kappamaki
|
@@ -76,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
76
108
|
version: '0'
|
77
109
|
requirements: []
|
78
110
|
rubyforge_project:
|
79
|
-
rubygems_version: 2.
|
111
|
+
rubygems_version: 2.4.5.1
|
80
112
|
signing_key:
|
81
113
|
specification_version: 4
|
82
114
|
summary: Tools for natural, high-level, sophisticated Cucumber steps
|