kappamaki 1.0.0 → 1.1.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 164e0310820f37082baac4f72a59d049d18941e2
4
- data.tar.gz: 3794e12c72ceeb19bfd57424de895ac136b64649
2
+ SHA256:
3
+ metadata.gz: f70299e68a03ca40f132bb49a60f2fa3795118ca12a39e79d018957e434febcc
4
+ data.tar.gz: b462b40eec165b8a2cc909c9c7a4b8dc75a3e4abfde52204e1ccbc0479de4b5e
5
5
  SHA512:
6
- metadata.gz: fb123dbc341c771de5c3693464feaa0ea097e5a4ffd5c5518db53ac0af89dd4a95d7307065bac392c30402b0ce3032964b174f2d6993ba50f56f118d376f1070
7
- data.tar.gz: e88a76a17285572b71896c5e907e64a3f508e0fe32c5db371a7552cf6d94b3c4c098cb20b413baabe5d5b665c76d99e7fdd455360db25ad06e28ec4c26bc680a
6
+ metadata.gz: 273a3d2b356ec902cd30238d2b53da839d982124c9157056507cfbf5ed4a0efdfa2807e65d760bcf9c55eaccd5dccd3e6d2bf79a9b62f957ab9f635b2c6b3190
7
+ data.tar.gz: 46cdaf4f025c4ea8e00d73b3df5c359865ab2fe9aef960a01869c75f26f3e5613460d802bd56e1ebf3fb5167436d42db98b01ded1d098991a6cc033b4777054f
@@ -0,0 +1,28 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: ["main"]
6
+ pull_request:
7
+ branches: ["main"]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ test:
14
+ runs-on: ubuntu-latest
15
+ strategy:
16
+ matrix:
17
+ ruby-version: ["3.4"]
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+ - uses: dprint/check@v2.2
21
+ - uses: ruby/setup-ruby@v1
22
+ with:
23
+ ruby-version: ${{ matrix.ruby-version }}
24
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
25
+ - run: bundle exec rake
26
+ - run: bundle exec rake fix
27
+ - run: git diff HEAD --exit-code --color
28
+ - uses: coverallsapp/github-action@v2
data/.rubocop.yml CHANGED
@@ -1,41 +1,16 @@
1
1
  AllCops:
2
-
2
+ NewCops: enable
3
3
  DisplayCopNames: true
4
-
5
4
  DisplayStyleGuide: true
6
-
7
5
  Include:
8
- - '**/Rakefile'
9
-
6
+ - "**/Rakefile"
7
+ SuggestExtensions: false
10
8
 
11
- Lint/Eval:
12
- Enabled: false
13
-
14
-
15
- Metrics/LineLength:
9
+ Layout/LineLength:
16
10
  Max: 100
17
11
 
12
+ Style/StringLiterals:
13
+ EnforcedStyle: double_quotes
18
14
 
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
15
+ Style/SymbolArray:
16
+ EnforcedStyle: brackets
data/CHANGELOG.md ADDED
@@ -0,0 +1,23 @@
1
+ # Changelog
2
+
3
+ ## 1.1.0 (2025-11-04)
4
+
5
+ - Update minimum Ruby version to 3.2
6
+ - The `symbolize_keys` function is now more generic
7
+ - Verifies argument types (#25)
8
+
9
+ ## 1.0.0 (2015-12-22)
10
+
11
+ - Stable release
12
+
13
+ ## 0.0.3 (2014-09-26)
14
+
15
+ - added the `symbolize_keys_deep!` method
16
+
17
+ ## 0.0.2 (2014-09-23)
18
+
19
+ - Require at least Ruby 1.9.3
20
+
21
+ ## 0.0.1 (2014-09-23)
22
+
23
+ - Basic functionality for deep symbolizing hash keys
data/DEVELOPMENT.md ADDED
@@ -0,0 +1,13 @@
1
+ # Development handbook
2
+
3
+ - run all tests: `bundle exec rake`
4
+ - auto-fix all fixable issues: `bundle exec fix`
5
+ - update dependencies: `bundle update`
6
+
7
+ ## Release a new version to RubyGems
8
+
9
+ - in a branch:
10
+ - update CHANGELOG.md
11
+ - search and replace all occurrences of `1.1.0`
12
+ - ship this branch
13
+ - push a new version to Rubygems: `rake release`
data/Gemfile CHANGED
@@ -1,4 +1,10 @@
1
- source 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in kappamaki.gemspec
4
4
  gemspec
5
+
6
+ gem "bundler"
7
+ gem "rake"
8
+ gem "rspec"
9
+ gem "rubocop"
10
+ gem "simplecov"
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014 Originate
1
+ Copyright (c) 2014 Kevin Goslar
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -1,17 +1,11 @@
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)
1
+ [![CI](https://github.com/kevgo/kappamaki/actions/workflows/ruby.yml/badge.svg)](https://github.com/kevgo/kappamaki/actions/workflows/ruby.yml)
2
+ [![Coverage Status](https://coveralls.io/repos/github/kevgo/kappamaki/badge.svg?branch=main)](https://coveralls.io/github/kevgo/kappamaki?branch=main)
2
3
 
3
- _Tools for natural, high-level, sophisticated Cucumber steps._
4
+ Inspired by the simplicity of a cucumber-filled sushi roll, Kappamaki provides
5
+ helper methods to implement Cucumber steps that define data using natural
6
+ language.
4
7
 
5
- The name comes from the sushi roll filled with pieces of cucumber,
6
- which adds naturalness and freshness to a meal.
7
-
8
-
9
- ## Usage
10
-
11
- Kappamaki provides a number of helper methods that can be used directly
12
- in your Cucumber step definitions.
13
-
14
- ### from_sentence
8
+ ## from_sentence
15
9
 
16
10
  Parses a list of values from a sentence.
17
11
 
@@ -19,26 +13,25 @@ Parses a list of values from a sentence.
19
13
  Given the restaurant offers cucumber rolls, philadelphia rolls, and avocado rolls
20
14
  ```
21
15
 
22
- Your step definition would look like this:
16
+ Your implementation of this Cucumber step would look like this:
23
17
 
24
18
  ```ruby
25
19
  Given /^the restaurant offers (.+)$/ do |menu_list|
26
20
 
27
21
  # menu_list is this string:
28
- 'cucumber rolls, philadelphia rolls, and avocado rolls'
22
+ # "cucumber rolls, philadelphia rolls, and avocado rolls"
29
23
 
30
- # Let's parse this into an array
24
+ # let's parse this string into an array
31
25
  menu = Kappamaki.from_sentence menu_list
32
26
 
33
- # The result, menu, is this array:
34
- ['cucumber rolls', 'philadelphia rolls', 'avocado rolls']
27
+ # the result (the variable menu) is this array:
28
+ # ["cucumber rolls", "philadelphia rolls", "avocado rolls"]
35
29
 
36
30
  # Now we can set up our menu here...
37
31
  end
38
32
  ```
39
33
 
40
-
41
- ### attributes_from_sentence
34
+ ## attributes_from_sentence
42
35
 
43
36
  Parses key-value pairs from natural sentences.
44
37
 
@@ -52,22 +45,23 @@ Your step definition would look like this:
52
45
  When /^I order a dinner with (.+)$/ do |order_items|
53
46
 
54
47
  # order_items is this string:
55
- 'starter: "miso soup" and entree: "cucumber rolls"'
48
+ # 'starter: "miso soup" and entree: "cucumber rolls"'
56
49
 
57
- # Let's parse that string using Kappamaki
58
- order_data = Kappamaki.attributes_from_sentence(order_items)
50
+ # Let's parse this string using Kappamaki
51
+ order_data = Kappamaki.attributes_from_sentence order_items
59
52
 
60
53
  # The result, order_data, is this hash:
61
- { starter: "miso soup",
62
- entree: "cucumber rolls" }
54
+ # {
55
+ # starter: "miso soup",
56
+ # entree: "cucumber rolls"
57
+ # }
63
58
 
64
59
  # now we can set up our order...
65
60
  create :order, order_data
66
61
  end
67
62
  ```
68
63
 
69
-
70
- ### symbolize_keys_deep
64
+ ## symbolize_keys_deep
71
65
 
72
66
  Converts the keys of a hash into symbols.
73
67
 
@@ -81,17 +75,17 @@ Then I am served these items
81
75
  Your step definition would look like this:
82
76
 
83
77
  ```ruby
84
- Then ^I am served these items do |entrees|
78
+ Then /^I am served these items$/ do |entrees|
85
79
  entrees.hashes.each do |entree|
86
80
 
87
81
  # entree is this hash:
88
- { 'name' => 'miso soup', 'count' => '1' }
82
+ # { "name" => "miso soup", "count" => "1" }
89
83
 
90
84
  # Let's convert the keys to symbols.
91
85
  Kappamaki.symbolize_keys_deep! entree
92
86
 
93
87
  # Now entree is this hash:
94
- { name: 'miso soup', count: '1' }
88
+ # { name: "miso soup", count: "1" }
95
89
 
96
90
  # Now we can use this hash in places that expect hashes with symbols
97
91
  expect(order).to include entree
@@ -99,18 +93,8 @@ Then ^I am served these items do |entrees|
99
93
  end
100
94
  ```
101
95
 
102
-
103
96
  ## Installation
104
97
 
105
- * add `gem 'kappamaki'` to your application's Gemfile
106
- * run `bundle install`
107
- * add `require 'kappamaki'` to your `/features/support/env.rb` file
108
-
109
-
110
- ## Contributing
111
-
112
- 1. Fork it ( https://github.com/Originate/kappamaki/fork )
113
- 2. Create your feature branch (`git checkout -b my-new-feature`)
114
- 3. Commit your changes (`git commit -am 'Add some feature'`)
115
- 4. Push to the branch (`git push origin my-new-feature`)
116
- 5. Create a new Pull Request
98
+ - add `gem "kappamaki"` to your application's Gemfile
99
+ - run `bundle install`
100
+ - add `require 'kappamaki'` to your `/features/support/env.rb` file
data/Rakefile CHANGED
@@ -1,12 +1,21 @@
1
- require 'bundler'
2
- require 'bundler/gem_tasks'
3
- require 'rspec/core/rake_task'
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler"
4
+ require "bundler/gem_tasks"
5
+ require "rspec/core/rake_task"
4
6
 
5
7
  RSpec::Core::RakeTask.new :spec
6
8
 
7
- task default: %i(lint spec)
9
+ task default: [:lint, :spec]
10
+
11
+ desc "Fix all auto-fixable issues"
12
+ task "fix" do
13
+ sh "bundle exec rubocop -A"
14
+ sh "dprint fmt"
15
+ end
8
16
 
9
- desc 'Run linter'
10
- task 'lint' do
11
- sh 'bundle exec rubocop'
17
+ desc "Run linter"
18
+ task "lint" do
19
+ sh "bundle exec rubocop"
20
+ sh "dprint check"
12
21
  end
data/dprint.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "markdown": {
3
+ "textWrap": "always"
4
+ },
5
+ "yaml": { },
6
+ "excludes": ["vendor"],
7
+ "plugins": [
8
+ "https://plugins.dprint.dev/markdown-0.18.0.wasm",
9
+ "https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.0.wasm"
10
+ ]
11
+ }
data/kappamaki.gemspec CHANGED
@@ -1,29 +1,23 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
1
+ lib = File.expand_path("lib", __dir__)
3
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
3
 
5
- Gem::Specification.new do |spec|
6
- spec.name = 'kappamaki'
7
- spec.version = '1.0.0'
8
- spec.authors = ['Kevin Goslar']
9
- spec.email = ['kevin.goslar@originate.com']
10
- spec.summary = 'Tools for natural, high-level, sophisticated Cucumber steps'
11
- spec.homepage = 'https://github.com/Originate/kappamaki'
12
- spec.license = 'MIT'
13
- spec.description = <<-EOF
4
+ Gem::Specification.new do |gem|
5
+ gem.name = "kappamaki"
6
+ gem.version = "1.1.0"
7
+ gem.authors = ["Kevin Goslar"]
8
+ gem.email = ["kevin.goslar@gmail.com"]
9
+ gem.summary = "Tools for defining data using natural language in Cucumber steps"
10
+ gem.homepage = "https://github.com/kevgo/kappamaki"
11
+ gem.license = "MIT"
12
+ gem.description = <<-DESC
14
13
  Kappamaki is a collection of string manipulation methods
15
- that make parsing high-lever cucumber steps easier.
16
- EOF
14
+ that make parsing high-level cucumber steps easier.
15
+ DESC
17
16
 
18
- spec.files = `git ls-files -z`.split("\x0")
19
- spec.executables = []
20
- spec.test_files = spec.files.grep('spec')
21
- spec.require_paths = ['lib']
17
+ gem.files = `git ls-files -z`.split("\x0")
18
+ gem.executables = []
19
+ gem.require_paths = ["lib"]
22
20
 
23
- spec.add_development_dependency 'bundler'
24
- spec.add_development_dependency 'rspec'
25
- spec.add_development_dependency 'rubocop'
26
- spec.add_development_dependency 'coveralls'
27
-
28
- spec.required_ruby_version = '>= 1.9.3'
21
+ gem.required_ruby_version = ">= 3.2"
22
+ gem.metadata["rubygems_mfa_required"] = "true"
29
23
  end
data/lib/kappamaki.rb CHANGED
@@ -1,34 +1,57 @@
1
+ # Kappamaki provides helper methods to implement Cucumber steps
2
+ # that define data using natural language.
1
3
  module Kappamaki
2
-
3
4
  # Parses a given string containing key-value pairs into a Hash
4
5
  #
5
6
  # Values must be delimited by double-quotes, like this:
6
7
  # key: "value"
7
- def self.attributes_from_sentence sentence
8
- attributes = Kappamaki.from_sentence(sentence)
9
- .map { |piece| piece.split ': ' }
10
- .map { |key, value| [key.to_sym, value] }
11
- .flatten
12
- Hash[*attributes]
8
+ #
9
+ # @param sentence [String] the sentence to parse
10
+ # @return [Hash] the parsed key-value pairs
11
+ # @raise [ArgumentError] if sentence is not a String
12
+ def self.attributes_from_sentence(sentence)
13
+ raise ArgumentError, "sentence must be a String" unless sentence.is_a?(String)
14
+
15
+ Kappamaki.from_sentence(sentence)
16
+ .map { |piece| piece.split(": ") }
17
+ .to_h { |key, value| [key.to_sym, value] }
13
18
  end
14
19
 
20
+ # Reverse of ActiveSupport's "to_sentence" method
21
+ #
22
+ # @param sentence [String] the sentence to parse
23
+ # @return [Array<String>] the parsed array of items
24
+ # @raise [ArgumentError] if sentence is not a String
25
+ def self.from_sentence(sentence)
26
+ raise ArgumentError, "sentence must be a String" unless sentence.is_a?(String)
15
27
 
16
- # Reverse of Rails' to_sentence method
17
- def self.from_sentence sentence
18
- sentence.gsub(', and ', ', ')
19
- .gsub(' and ', ', ')
20
- .split(', ')
21
- .map { |s| s.delete '"' }
28
+ sentence.gsub(", and ", ", ")
29
+ .gsub(" and ", ", ")
30
+ .split(", ")
31
+ .map { |s| s.delete('"') }
22
32
  end
23
33
 
24
-
25
34
  # Converts all keys in the given hash to symbols
26
- def self.symbolize_keys_deep! h
27
- h.keys.each do |k|
28
- ks = k.to_sym
29
- h[ks] = h.delete k
30
- symbolize_keys_deep! h[ks] if h[ks].is_a? Hash
35
+ #
36
+ # @param hash [Hash] the hash to modify
37
+ # @return [Hash] the modified hash with symbolized keys
38
+ # @raise [ArgumentError] if hash is not a Hash
39
+ def self.symbolize_keys_deep!(hash)
40
+ raise ArgumentError, "hash must be a Hash" unless hash.is_a?(Hash)
41
+
42
+ hash.keys.each do |key|
43
+ key_sym = key.to_sym
44
+ value = hash.delete(key)
45
+ hash[key_sym] = case value
46
+ when Hash
47
+ symbolize_keys_deep!(value)
48
+ when Array
49
+ value.map { |item| item.is_a?(Hash) ? symbolize_keys_deep!(item) : item }
50
+ else
51
+ value
52
+ end
31
53
  end
32
- end
33
54
 
55
+ hash
56
+ end
34
57
  end
@@ -1,55 +1,96 @@
1
- require 'spec_helper'
2
- require 'kappamaki'
3
-
1
+ require "spec_helper"
2
+ require "kappamaki"
4
3
 
5
4
  describe Kappamaki do
5
+ describe ".attributes_from_sentence" do
6
+ test_data = {
7
+ 'name: "Foo"' => { name: "Foo" },
8
+ 'name: "Foo" and body: "Bar"' => { name: "Foo", body: "Bar" },
9
+ 'name: "Foo", body: "Bar" and title: "Baz"' => { name: "Foo", body: "Bar", title: "Baz" },
10
+ 'name: "Foo", body: "Bar", and title: "Baz"' => { name: "Foo", body: "Bar", title: "Baz" }
11
+ }
12
+ test_data.each do |sentence, expected_result|
13
+ it "parses '#{sentence}' into '#{expected_result}'" do
14
+ expect(Kappamaki.attributes_from_sentence(sentence)).to eql expected_result
15
+ end
16
+ end
6
17
 
7
- test_data = {
8
-
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' }
14
- },
15
-
16
- from_sentence: {
17
- 'one' => ['one'],
18
- '"one"' => ['one'],
19
- 'one and two' => ['one', 'two'],
20
- '"one" and "two"' => ['one', 'two'],
21
- 'one, two and three' => ['one', 'two', 'three'],
22
- '"one", "two" and "three"' => ['one', 'two', 'three'],
23
- 'one, two, and three' => ['one', 'two', 'three'],
24
- 'one, two, three and four' => ['one', 'two', 'three', 'four'],
25
- '"one", "two", "three" and "four"' => ['one', 'two', 'three', 'four']
18
+ it "raises ArgumentError when given non-string input" do
19
+ expect { Kappamaki.attributes_from_sentence(nil) }.to raise_error(ArgumentError, "sentence must be a String")
20
+ expect { Kappamaki.attributes_from_sentence(123) }.to raise_error(ArgumentError, "sentence must be a String")
21
+ end
22
+ end
23
+
24
+ describe ".from_sentence" do
25
+ test_data = {
26
+ "one" => ["one"],
27
+ '"one"' => ["one"],
28
+ "one and two" => %w[one two],
29
+ '"one" and "two"' => %w[one two],
30
+ "one, two and three" => %w[one two three],
31
+ '"one", "two" and "three"' => %w[one two three],
32
+ "one, two, and three" => %w[one two three],
33
+ "one, two, three and four" => %w[one two three four],
34
+ '"one", "two", "three" and "four"' => %w[one two three four]
26
35
  }
27
- }
28
-
29
- test_data.each do |method_name, expected|
30
- describe method_name do
31
- expected.each do |sentence, expected_result|
32
- it "parses '#{sentence}' into '#{expected_result}'" do
33
- expect(Kappamaki.send method_name, sentence).to eql expected_result
34
- end
36
+ test_data.each do |sentence, expected_result|
37
+ it "parses '#{sentence}' into '#{expected_result}'" do
38
+ expect(Kappamaki.from_sentence(sentence)).to eql expected_result
35
39
  end
36
40
  end
41
+
42
+ it "handles empty string" do
43
+ expect(Kappamaki.from_sentence("")).to eq []
44
+ end
45
+
46
+ it "raises ArgumentError when given non-string input" do
47
+ expect { Kappamaki.from_sentence(nil) }.to raise_error(ArgumentError, "sentence must be a String")
48
+ expect { Kappamaki.from_sentence([]) }.to raise_error(ArgumentError, "sentence must be a String")
49
+ end
37
50
  end
38
51
 
52
+ describe ".symbolize_keys_deep!" do
53
+ it "converts string keys to symbols" do
54
+ actual = { "one" => "two", "alpha" => "beta" }
55
+ Kappamaki.symbolize_keys_deep!(actual)
56
+ expect(actual).to eq one: "two", alpha: "beta"
57
+ end
39
58
 
40
- describe 'symbolize_keys_deep!' do
59
+ it "converts nested keys" do
60
+ actual = { "one" => { "alpha" => "beta" } }
61
+ Kappamaki.symbolize_keys_deep!(actual)
62
+ expect(actual).to eq one: { alpha: "beta" }
63
+ end
41
64
 
42
- it 'converts string keys to symbols' do
43
- actual = { 'one' => 'two', 'alpha' => 'beta' }
44
- Kappamaki.symbolize_keys_deep! actual
45
- expect(actual).to eq one: 'two', alpha: 'beta'
65
+ it "handles arrays containing hashes" do
66
+ actual = { "items" => [{ "name" => "foo" }, { "name" => "bar" }] }
67
+ Kappamaki.symbolize_keys_deep!(actual)
68
+ expect(actual).to eq items: [{ name: "foo" }, { name: "bar" }]
46
69
  end
47
70
 
48
- it 'converts nested keys' do
49
- actual = { 'one' => { 'alpha' => 'beta' } }
50
- Kappamaki.symbolize_keys_deep! actual
51
- expect(actual).to eq one: { alpha: 'beta' }
71
+ it "handles arrays containing non-hash values" do
72
+ actual = { "items" => ["foo", "bar", 123] }
73
+ Kappamaki.symbolize_keys_deep!(actual)
74
+ expect(actual).to eq items: ["foo", "bar", 123]
52
75
  end
53
76
 
77
+ it "handles empty hash" do
78
+ actual = {}
79
+ result = Kappamaki.symbolize_keys_deep!(actual)
80
+ expect(result).to eq({})
81
+ expect(actual).to eq({})
82
+ end
83
+
84
+ it "returns the modified hash" do
85
+ actual = { "one" => "two" }
86
+ result = Kappamaki.symbolize_keys_deep!(actual)
87
+ expect(result).to eq one: "two"
88
+ expect(result).to be(actual)
89
+ end
90
+
91
+ it "raises ArgumentError when given non-hash input" do
92
+ expect { Kappamaki.symbolize_keys_deep!(nil) }.to raise_error(ArgumentError, "hash must be a Hash")
93
+ expect { Kappamaki.symbolize_keys_deep!("string") }.to raise_error(ArgumentError, "hash must be a Hash")
94
+ end
54
95
  end
55
96
  end
data/spec/spec_helper.rb CHANGED
@@ -1,14 +1,14 @@
1
- if ENV['CI']
2
- require 'coveralls'
3
- Coveralls.wear!
1
+ if ENV["CI"]
2
+ require "simplecov"
3
+ SimpleCov.start
4
4
  end
5
5
 
6
- require 'bundler/setup'
6
+ require "bundler/setup"
7
7
  Bundler.setup
8
- require 'kappamaki'
8
+ require "kappamaki"
9
9
 
10
10
  RSpec.configure do |config|
11
11
  config.color = true
12
- config.order = 'random'
13
- config.formatter = 'documentation'
12
+ config.order = "random"
13
+ config.formatter = "documentation"
14
14
  end
metadata CHANGED
@@ -1,98 +1,42 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kappamaki
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Goslar
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2015-12-22 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
- - !ruby/object:Gem::Dependency
28
- name: rspec
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
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'
10
+ date: 2025-11-04 00:00:00.000000000 Z
11
+ dependencies: []
69
12
  description: |2
70
13
  Kappamaki is a collection of string manipulation methods
71
- that make parsing high-lever cucumber steps easier.
14
+ that make parsing high-level cucumber steps easier.
72
15
  email:
73
- - kevin.goslar@originate.com
16
+ - kevin.goslar@gmail.com
74
17
  executables: []
75
18
  extensions: []
76
19
  extra_rdoc_files: []
77
20
  files:
78
- - ".coveralls.yml"
21
+ - ".github/workflows/ruby.yml"
79
22
  - ".gitignore"
80
23
  - ".rubocop.yml"
81
- - ".travis.yml"
24
+ - CHANGELOG.md
25
+ - DEVELOPMENT.md
82
26
  - Gemfile
83
27
  - LICENSE.txt
84
28
  - README.md
85
29
  - Rakefile
30
+ - dprint.json
86
31
  - kappamaki.gemspec
87
32
  - lib/kappamaki.rb
88
- - spec/.rubocop.yml
89
33
  - spec/kappamaki_spec.rb
90
34
  - spec/spec_helper.rb
91
- homepage: https://github.com/Originate/kappamaki
35
+ homepage: https://github.com/kevgo/kappamaki
92
36
  licenses:
93
37
  - MIT
94
- metadata: {}
95
- post_install_message:
38
+ metadata:
39
+ rubygems_mfa_required: 'true'
96
40
  rdoc_options: []
97
41
  require_paths:
98
42
  - lib
@@ -100,16 +44,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
100
44
  requirements:
101
45
  - - ">="
102
46
  - !ruby/object:Gem::Version
103
- version: 1.9.3
47
+ version: '3.2'
104
48
  required_rubygems_version: !ruby/object:Gem::Requirement
105
49
  requirements:
106
50
  - - ">="
107
51
  - !ruby/object:Gem::Version
108
52
  version: '0'
109
53
  requirements: []
110
- rubyforge_project:
111
- rubygems_version: 2.4.5.1
112
- signing_key:
54
+ rubygems_version: 3.6.2
113
55
  specification_version: 4
114
- summary: Tools for natural, high-level, sophisticated Cucumber steps
56
+ summary: Tools for defining data using natural language in Cucumber steps
115
57
  test_files: []
data/.coveralls.yml DELETED
@@ -1,2 +0,0 @@
1
- service_name: travis-ci
2
- repo_token: vcTVuxiU3wTdLBNzwOihUCGEyZQk7ITCO
data/.travis.yml DELETED
@@ -1,7 +0,0 @@
1
- language: ruby
2
- cache: bundler
3
- rvm:
4
- - 2.1.8
5
- - 2.2.2
6
- - 2.2.3
7
- script: bundle exec rspec
data/spec/.rubocop.yml DELETED
@@ -1,5 +0,0 @@
1
- inherit_from: ../.rubocop.yml
2
-
3
-
4
- Style/EmptyLinesAroundBlockBody:
5
- Enabled: false