sums_up 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: e7e0c128cef808336972ac4b012e8d7d7c4fafa6
4
- data.tar.gz: 777387cbd3a186d93e81f24e0190ee031ab6415a
2
+ SHA256:
3
+ metadata.gz: e2abe6b0d49df01a5e9c588600079c91e3927c81501eb7816a0e6615a0579e00
4
+ data.tar.gz: 9d18cf08079f9508c53a41e8fc97707346de0e36ab2d27c55089322e61b84bed
5
5
  SHA512:
6
- metadata.gz: 2083e37f3b61a5240fb6d42769ce946f6b36dbaa2da7fe4c2f5c9392cb62c2c5956c834637717ec3ba9c54f6bb4f3303709acc691ffff4423d2cf35f1fdb0c4c
7
- data.tar.gz: 49596b05073fc5d42365efb07c750403fa8db6f4a2544f3a9bab999cafd05ab279c6b1ea8efe250ab89139bf383d8a1a5de86ff4f7c8647f5a44aa1d6364527c
6
+ metadata.gz: 3efb1c7fd3c3e0c92f17aa0f2d92fa344f802be872785836e401c5a9f88f1d090b135542c11cd9a23aa1b158c0072b789eee47bf56aae328198395358f08223b
7
+ data.tar.gz: 74c83c4a9f6efa3ba3a6466da3f02f9a064af367ee59b94ba6566cb270f1d4a7cdeea6b54c8d9af1d60038accf258cbf9426bf3d262e3a623b0758e8313ded27
data/.gitignore CHANGED
@@ -11,3 +11,4 @@
11
11
  .rspec_status
12
12
 
13
13
  /Gemfile.lock
14
+ *.gem
data/.rubocop.yml CHANGED
@@ -1,7 +1,10 @@
1
1
  AllCops:
2
2
  NewCops: enable
3
3
  SuggestExtensions: false
4
- TargetRubyVersion: 2.4.10
4
+ TargetRubyVersion: 2.5.0
5
+
6
+ Gemspec/RequiredRubyVersion:
7
+ Enabled: False
5
8
 
6
9
  Layout/LineLength:
7
10
  Max: 80
@@ -17,3 +20,7 @@ Metrics/BlockLength:
17
20
 
18
21
  Metrics/MethodLength:
19
22
  Enabled: false
23
+
24
+ # Disabling for now to support Ruby 2.3.
25
+ Style/HashTransformValues:
26
+ Enabled: false
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.4.10
1
+ 3.0.0
data/.travis.yml CHANGED
@@ -2,9 +2,11 @@
2
2
  language: ruby
3
3
  cache: bundler
4
4
  rvm:
5
+ - 2.3.0
6
+ - 2.3.8
5
7
  - 2.4.10
6
8
  - 2.5.8
7
9
  - 2.6.6
8
10
  - 2.7.2
9
11
  - 3.0.0
10
- before_install: gem install bundler -v 2.1.2
12
+ before_install: gem install bundler -v '< 3'
data/Gemfile CHANGED
@@ -4,3 +4,6 @@ source 'https://rubygems.org'
4
4
 
5
5
  # Specify your gem's dependencies in sums_up.gemspec
6
6
  gemspec
7
+
8
+ # Only run rubocop on rubies >= 2.5; see Rakfeile for more details.
9
+ gem 'rubocop', '~> 1.1' unless /\A2\.[34]./.match(RUBY_VERSION)
data/README.md CHANGED
@@ -2,7 +2,8 @@
2
2
 
3
3
  Sum types for Ruby with zero runtime dependencies. Inspired by [hojberg/sums-up](https://github.com/hojberg/sums-up).
4
4
 
5
- [![Build Status](https://travis-ci.org/nahiluhmot/sums_up.svg?branch=master)](https://travis-ci.org/nahiluhmot/sums_up)
5
+ [![Build Status](https://travis-ci.org/nahiluhmot/sums_up.svg?branch=main)](https://travis-ci.org/nahiluhmot/sums_up)
6
+ [![Gem Version](https://badge.fury.io/rb/sums_up.svg)](https://badge.fury.io/rb/sums_up)
6
7
 
7
8
  * [What is a Sum Type?](#what-is-a-sum-type)
8
9
  * [Quick Start](#quick-start)
@@ -300,7 +301,7 @@ def drink_size(drink)
300
301
  drink.match do |m|
301
302
  m.water Size.small
302
303
  m.lemonade { |size| size }
303
- m.temperature { |size, _temperature| size }
304
+ m.coffee { |size, _temperature| size }
304
305
  end
305
306
  end
306
307
 
@@ -804,7 +805,7 @@ To release a new version, update the version number in `version.rb`, and then ru
804
805
  ## Contributing
805
806
 
806
807
  Bug reports and pull requests are welcome on GitHub at https://github.com/nahiluhmot/sums_up.
807
- This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/nahiluhmot/sums_up/blob/master/CODE_OF_CONDUCT.md).
808
+ This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/nahiluhmot/sums_up/blob/main/CODE_OF_CONDUCT.md).
808
809
 
809
810
  ## License
810
811
 
@@ -812,4 +813,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
812
813
 
813
814
  ## Code of Conduct
814
815
 
815
- Everyone interacting in the SumsUp projects codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/nahiluhmot/sums_up/blob/master/CODE_OF_CONDUCT.md).
816
+ Everyone interacting in the SumsUp projects codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/nahiluhmot/sums_up/blob/main/CODE_OF_CONDUCT.md).
data/Rakefile CHANGED
@@ -2,10 +2,17 @@
2
2
 
3
3
  require 'bundler/gem_tasks'
4
4
  require 'rspec/core/rake_task'
5
- require 'rubocop/rake_task'
6
-
7
- RuboCop::RakeTask.new(:rubocop)
8
5
 
9
6
  RSpec::Core::RakeTask.new(:spec)
10
7
 
11
- task default: %i[spec rubocop]
8
+ # Rubocop targets rubies >= 2.5, so don't run it on lower versions.
9
+ # This allows us to test older versions on travis and feel better about lowering
10
+ # the required Ruby version to >= 2.3.
11
+ if /\A2\.[34]\./.match(RUBY_VERSION)
12
+ task default: %i[spec]
13
+ else
14
+ require 'rubocop/rake_task'
15
+ RuboCop::RakeTask.new(:rubocop)
16
+
17
+ task default: %i[spec rubocop]
18
+ end
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## v1.1.0
4
+
5
+ * Support rubies as low as 2.3
6
+
3
7
  ## v1.0.0
4
8
 
5
9
  * Initial release of the gem
@@ -18,7 +18,7 @@ module SumsUp
18
18
  no_arg_variants
19
19
  .map { |variant| [variant, []] }
20
20
  .to_h
21
- .merge(arg_variants.transform_values { |ary| [*ary] })
21
+ .merge(arg_variants.map { |key, ary| [key, [*ary]] }.to_h)
22
22
  end
23
23
 
24
24
  def validate_unique!(variant_names)
@@ -40,7 +40,7 @@ module SumsUp
40
40
  raise(VariantNameError, "Expected a Symbol, got: #{variant_name}")
41
41
  end
42
42
 
43
- return if LOWER_SNAKE_CASE_REGEXP.match?(variant_name.to_s)
43
+ return if LOWER_SNAKE_CASE_REGEXP.match(variant_name.to_s)
44
44
 
45
45
  raise(
46
46
  VariantNameError,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SumsUp
4
- VERSION = '1.0.0'
4
+ VERSION = '1.1.0'
5
5
  end
data/sums_up.gemspec CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
11
11
  spec.summary = 'Sum types for Ruby'
12
12
  spec.homepage = 'https://github.com/nahiluhmot/sums_up'
13
13
  spec.license = 'MIT'
14
- spec.required_ruby_version = Gem::Requirement.new('>= 2.4.0')
14
+ spec.required_ruby_version = Gem::Requirement.new('>= 2.3.0')
15
15
 
16
16
  spec.metadata['homepage_uri'] = spec.homepage
17
17
  spec.metadata['source_code_uri'] = spec.homepage
@@ -30,5 +30,4 @@ Gem::Specification.new do |spec|
30
30
  spec.add_development_dependency 'pry', '~> 0.13'
31
31
  spec.add_development_dependency 'rake', '~> 13.0'
32
32
  spec.add_development_dependency 'rspec', '~> 3.10'
33
- spec.add_development_dependency 'rubocop', '~> 1.1'
34
33
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sums_up
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
  - Tom Hulihan
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-09 00:00:00.000000000 Z
11
+ date: 2021-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -52,21 +52,7 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.10'
55
- - !ruby/object:Gem::Dependency
56
- name: rubocop
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '1.1'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '1.1'
69
- description:
55
+ description:
70
56
  email:
71
57
  - hulihan.tom159@gmail.com
72
58
  executables: []
@@ -105,7 +91,7 @@ metadata:
105
91
  homepage_uri: https://github.com/nahiluhmot/sums_up
106
92
  source_code_uri: https://github.com/nahiluhmot/sums_up
107
93
  changelog_uri: https://github.com/nahiluhmot/sums_up/CHANGELOG.md
108
- post_install_message:
94
+ post_install_message:
109
95
  rdoc_options: []
110
96
  require_paths:
111
97
  - lib
@@ -113,16 +99,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
113
99
  requirements:
114
100
  - - ">="
115
101
  - !ruby/object:Gem::Version
116
- version: 2.4.0
102
+ version: 2.3.0
117
103
  required_rubygems_version: !ruby/object:Gem::Requirement
118
104
  requirements:
119
105
  - - ">="
120
106
  - !ruby/object:Gem::Version
121
107
  version: '0'
122
108
  requirements: []
123
- rubyforge_project:
124
- rubygems_version: 2.6.14.4
125
- signing_key:
109
+ rubygems_version: 3.2.3
110
+ signing_key:
126
111
  specification_version: 4
127
112
  summary: Sum types for Ruby
128
113
  test_files: []