safe-enum 0.3.0 → 0.3.1

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
- SHA1:
3
- metadata.gz: b01a24ce4b8682ef047734ceda2a6d42f7f20654
4
- data.tar.gz: 344c9fbee4e130f694c287e4a8a2a5e29e063126
2
+ SHA256:
3
+ metadata.gz: 670e321a5a7e1961b6c4c940f720887a7b6dca7725f890cc27777aff7f0f2e17
4
+ data.tar.gz: 739fc2f8c14ccf50bb0265f6c748be615971ddb3e20128886e7c5562c31bd4b3
5
5
  SHA512:
6
- metadata.gz: f57bf5d384b5d282486dacd279fd14380acd61dc04f76e871c93d93ecdb5f3bec5e6f6772744c307c2e5b140b73c712e9a0f2eb7d3476609d955aef611884508
7
- data.tar.gz: db9c679dcbfbcd4f785d732b903daf73fb8b73f691c212404a9dbd95ac4366879f1c3119e2746bdf3c7dd23c339ac171a21ba80cf8cc0c4523f8f1a0d6bed0ba
6
+ metadata.gz: cebfd3861390ba72e8740dc40b300a8b93920f3258832d08ba1c54074caa1ea93c9f4a3b68fada7a427cec76290e37212971483765a920b8ebe0f22f458997e6
7
+ data.tar.gz: 1938ac3742948d2936e951c8a66191ba06406e83ce2e351ac0c8cf29a6c08303f088f94103d77625c520249b80005b9eaf7b4d8f8049949e03cd560754127d36
data/README.md CHANGED
@@ -1,4 +1,3 @@
1
- ![Travis](https://travis-ci.org/mezuka/enum.svg)
2
1
  # Enum
3
2
 
4
3
  This is a very basic implementation of enums in Ruby. The cornerstone of the library is **safety**.
data/lib/enum/base.rb CHANGED
@@ -66,7 +66,7 @@ module Enum
66
66
  def translate(token, options = {})
67
67
  I18n.t(token, scope: "enum.#{self}", exception_handler: proc do
68
68
  if superclass == Enum::Base
69
- I18n.t(token, options.merge(scope: "enum.#{self}"))
69
+ I18n.t(token, **options.merge(scope: "enum.#{self}"))
70
70
  else
71
71
  superclass.translate(token, exception_handler: proc do
72
72
  I18n.t(token, scope: "enum.#{self}")
data/lib/enum/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Enum
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.1'
3
3
  end
data/lib/enum.rb CHANGED
@@ -2,3 +2,11 @@ require 'enum/version'
2
2
  require 'enum/token_not_found_error'
3
3
  require 'enum/base'
4
4
  require 'enum/predicates'
5
+
6
+ module Enum
7
+ def self.[](*ary)
8
+ Class.new(Base) do
9
+ values(*ary)
10
+ end
11
+ end
12
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: safe-enum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Koleshko
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-04-17 00:00:00.000000000 Z
11
+ date: 2022-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -94,7 +94,7 @@ homepage: https://github.com/mezuka/enum
94
94
  licenses:
95
95
  - MIT
96
96
  metadata: {}
97
- post_install_message:
97
+ post_install_message:
98
98
  rdoc_options: []
99
99
  require_paths:
100
100
  - lib
@@ -109,10 +109,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  requirements: []
112
- rubyforge_project:
113
- rubygems_version: 2.5.1
114
- signing_key:
112
+ rubygems_version: 3.1.2
113
+ signing_key:
115
114
  specification_version: 4
116
115
  summary: Enum implementation
117
116
  test_files: []
118
- has_rdoc: