rubenum 1.0.0 → 1.0.1

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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +12 -6
  3. data/lib/rubenum.rb +7 -7
  4. data/rubenum.gemspec +2 -2
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f7cf05cb7fbb00f4b92af49a1d9f217b8214221288c895c9ab3c5f7bcc616386
4
- data.tar.gz: a239697d833132e9d93830527610c3b02fe83750f00e8e7d4dd5b94e65979248
3
+ metadata.gz: 061f383d10f635d645558b3687ccdf3fb2f8ba506a97f139b0522da9448c52fb
4
+ data.tar.gz: 672eac3c62691e1a83f58246909a70c13396150bf9f9b1b2019c054e792f8bc9
5
5
  SHA512:
6
- metadata.gz: 8ea675efc270202e3a61f6cb7ee551ea2ad30c04769c150eaecbd1993657385b0624d254b9357c53623716feeb04edacd6703d5f56a12ce59c3dd7cce28794d0
7
- data.tar.gz: 1c6b87567a2a1cccc0b08503663dd74223e3ce146220fa2e4973b8f88914e0d37d88a05ad2bac8746c715ce58d6dcf55a958a2b2553e08ee5eef833bd4940cf0
6
+ metadata.gz: 46ea4101ab8079d5e1a5582575c9babc42edbec332ddec5f09e79882b705ee4720c6c00cf479407eda498ef67a9cd0ed465df23ed0f3eebbce400e34f6f73184
7
+ data.tar.gz: 8cf40f30d6ca4d5a13f04b4506ce6739d18db5fc1d443675381d70d4aaa3a7b64ef3031510b5f14f84267de4c424faacade5ae6a45a0c90db58c275a12a3cdb1
data/README.md CHANGED
@@ -1,15 +1,21 @@
1
1
  # Rubenum
2
2
 
3
- Enum implementation for Ruby.
3
+ Rubenum allows you to create simple enumerations in Ruby.
4
4
 
5
- Create an enum from an array of strings with `Rubenum.new`.
5
+ ## Installation
6
+
7
+ You can install the Rubenum gem via `gem install rubenum`.
8
+
9
+ ## Usage
10
+
11
+ Create an enumeration from an array of strings with `Rubenum.new`.
6
12
  Only valid Ruby identifiers are accepted.
7
- Every element will be capitalized in order to make them Ruby constants.
13
+ By default, every element will be capitalized in order to make valid Ruby constant identifiers.
8
14
 
9
15
  ### Arguments
10
- - elements (array of string) : array containing the elements of the enum
11
- - upcase (boolean optional default:false) : true to upcase elements instead of capitalize them
12
- - binary_values (boolean optional default:false) : true to use binary values (1 2 4 8 16 ...) instead of incremental values (1 2 3 4 5 ...)
16
+ - elements (array of string) : array containing the elements of the enumeration
17
+ - upcase (optional boolean (default:false)) : true => upcase elements' name instead of capitalizing them
18
+ - binary_values (optional boolean (default:false)) : true => use binary values (1 2 4 8 16 ...) instead of incremental values (1 2 3 4 5 ...)
13
19
 
14
20
  ### Example
15
21
  e = Rubenum.new(%w[red orange green])
data/lib/rubenum.rb CHANGED
@@ -1,13 +1,13 @@
1
- # Enum implementation for Ruby.
1
+ # Rubenum allows you to create simple enumerations in Ruby.
2
2
  module Rubenum
3
- # Create an enum from an array of strings.
4
- # Only valid Ruby identifiers are accepted.
5
- # Every element will be capitalized in order to make them Ruby constants.
3
+ # Create an enumeration from an array of strings with `Rubenum.new`.
4
+ # Only valid Ruby identifiers are accepted.
5
+ # By default, every element will be capitalized in order to make valid Ruby constant identifiers.
6
6
  #
7
7
  # Arguments :
8
- # - elements (array of string) : array containing the elements of the enum
9
- # - upcase (boolean optional default:false) : true to upcase elements instead of capitalize them
10
- # - binary_values (boolean optional default:false) : true to use binary values(1 2 4 8 16 ...) instead of incremental values (1 2 3 4 5 ...)
8
+ # - elements (array of string) : array containing the elements of the enumeration
9
+ # - upcase (optional boolean (default:false)) : true => upcase elements' name instead of capitalizing them
10
+ # - binary_values (optional boolean (default:false)) : true => use binary values (1 2 4 8 16 ...) instead of incremental values (1 2 3 4 5 ...)
11
11
  #
12
12
  # Example :
13
13
  # e = Rubenum.new(%w[red orange green])
data/rubenum.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'rubenum'
3
- s.version = '1.0.0'
4
- s.summary = "Enum implementation for Ruby."
3
+ s.version = '1.0.1'
4
+ s.summary = "Rubenum allows you to create simple enumerations in Ruby."
5
5
  s.author = 'Jérémy Blain'
6
6
  s.files = Dir['lib/**/*'] + Dir['test/**/*']
7
7
  s.files += ['LICENSE', 'README.md', 'Rakefile', 'rubenum.gemspec']
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubenum
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jérémy Blain
@@ -46,5 +46,5 @@ requirements: []
46
46
  rubygems_version: 3.0.3
47
47
  signing_key:
48
48
  specification_version: 4
49
- summary: Enum implementation for Ruby.
49
+ summary: Rubenum allows you to create simple enumerations in Ruby.
50
50
  test_files: []