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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 10ed7a3b93d835a5c218b8ef5580105f2f9fbe66
4
- data.tar.gz: 5999f91ecf1e906886a602191f10e59d8604cf76
3
+ metadata.gz: 164e0310820f37082baac4f72a59d049d18941e2
4
+ data.tar.gz: 3794e12c72ceeb19bfd57424de895ac136b64649
5
5
  SHA512:
6
- metadata.gz: 6c80afb2dc07f5aded681535d1f355682517016a6a0730f9a9bc79401cc3a7283a6135d55db7ea9c1b545df2c30b8fcda01f248ee315da7b73146bb3f347c1bf
7
- data.tar.gz: 4174272fab1d6528bf87efb8fd970d309a5f893ed8f7b4a5b289b60164dfe305edad6ef3ef78975b4a83fe32b3080bc67880b8420e3e91a3f7299d559bcfb969
6
+ metadata.gz: fb123dbc341c771de5c3693464feaa0ea097e5a4ffd5c5518db53ac0af89dd4a95d7307065bac392c30402b0ce3032964b174f2d6993ba50f56f118d376f1070
7
+ data.tar.gz: e88a76a17285572b71896c5e907e64a3f508e0fe32c5db371a7552cf6d94b3c4c098cb20b413baabe5d5b665c76d99e7fdd455360db25ad06e28ec4c26bc680a
@@ -0,0 +1,2 @@
1
+ service_name: travis-ci
2
+ repo_token: vcTVuxiU3wTdLBNzwOihUCGEyZQk7ITCO
@@ -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
@@ -1,4 +1,7 @@
1
1
  language: ruby
2
2
  cache: bundler
3
- rvm: 2.1.3
3
+ rvm:
4
+ - 2.1.8
5
+ - 2.2.2
6
+ - 2.2.3
4
7
  script: bundle exec rspec
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
 
@@ -0,0 +1,12 @@
1
+ require 'bundler'
2
+ require 'bundler/gem_tasks'
3
+ require 'rspec/core/rake_task'
4
+
5
+ RSpec::Core::RakeTask.new :spec
6
+
7
+ task default: %i(lint spec)
8
+
9
+ desc 'Run linter'
10
+ task 'lint' do
11
+ sh 'bundle exec rubocop'
12
+ end
@@ -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.3'
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
@@ -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.gsub '"', ''}
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!(h)
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].kind_of? Hash
30
+ symbolize_keys_deep! h[ks] if h[ks].is_a? Hash
31
31
  end
32
32
  end
33
33
 
@@ -0,0 +1,5 @@
1
+ inherit_from: ../.rubocop.yml
2
+
3
+
4
+ Style/EmptyLinesAroundBlockBody:
5
+ Enabled: false
@@ -7,10 +7,10 @@ describe Kappamaki do
7
7
  test_data = {
8
8
 
9
9
  attributes_from_sentence: {
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"}
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({ one: 'two', alpha: 'beta' })
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({ one: { alpha: 'beta' }})
51
+ expect(actual).to eq one: { alpha: 'beta' }
52
52
  end
53
+
53
54
  end
54
55
  end
55
-
@@ -1,3 +1,8 @@
1
+ if ENV['CI']
2
+ require 'coveralls'
3
+ Coveralls.wear!
4
+ end
5
+
1
6
  require 'bundler/setup'
2
7
  Bundler.setup
3
8
  require 'kappamaki'
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.3
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: 2014-09-26 00:00:00.000000000 Z
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.2.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