enuminator 0.0.2 → 0.0.3

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
  SHA256:
3
- metadata.gz: 5b7ed6befea8e3577287b433b709c8c104d23062c15eba1e846453e12ed37e4a
4
- data.tar.gz: 0a55ed83cdefbd768e3f7794a913259957fec5b628ba3ecc7824be23933a11f7
3
+ metadata.gz: a158e8531b8b06c8b30d57a6d9c2dbaa835912595b3928deaf84a825d29f9b29
4
+ data.tar.gz: cdc1bc4469d65be099c83d0babf6e950087b9f50944b83339d626925917788c3
5
5
  SHA512:
6
- metadata.gz: 7c6a0837d70d450c18238a9a41bdd45da47fd4bdb80cf6c7c767ee659f74b3b9317b1c28e00e02c06ce80007cbca7acadb1825a1d02a5eb1690ce51d903d9115
7
- data.tar.gz: 7a28dc4a4ffa6dbe5364fcb9ff2f7a3195b1585268d60abf33234bce476f4cf3814255d518e0acebe24e62ca6a1810a69af6965d90ec269d80e18ae3e792705d
6
+ metadata.gz: aae228445453ed72d03ba17be9349a501f2f5a6bf0845804c54cf0e99c62bd83b9ebb70a6aae13a27c340bae20b3d870f056cd505370d0c4c0937406a5aee104
7
+ data.tar.gz: b3356d90f3acbe66d00000bbd4f5402886bd0c042a135e95e0fef80709fa8f85090f46d4cb83cb878db509965a7269c012c2e064662a92d27c9a2f9265979083
data/README.md CHANGED
@@ -26,15 +26,40 @@ And run in console
26
26
  bundle install
27
27
  ```
28
28
 
29
- ## Generate ApplicationEnumeration
29
+ ## Generators
30
30
 
31
- You can use a Rails generator to create `ApplicationEnumeration`:
31
+ You can use a Rails generator to create `ApplicationEnumeration`, because you need this main class to use enumerations:
32
32
 
33
33
  ```bash
34
- rails g enuminator:install
34
+ bin/rails g enuminator:install
35
35
  ```
36
36
 
37
- ## References
37
+ This command will create this file:
38
+
39
+ ```ruby
40
+ # /app/enumerations/application_controller.rb
41
+ class ApplicationEnumeration < Enuminator::Base
42
+ end
43
+ ```
44
+
45
+ You can use a Rails generator to create a specific enumeration:
46
+
47
+ ```bash
48
+ bin/rails g enuminator:enum relationship_status single married divorced
49
+ ```
50
+
51
+ This command will create this file:
52
+
53
+ ```ruby
54
+ # /app/enumerations/application_controller.rb
55
+ class RelationshipStatus < ApplicationEnumeration
56
+ associate_values(:single, :married, :divorced)
57
+ end
58
+ ```
59
+
60
+ From now you could follow the EnumerateIt references =)
61
+
62
+ ## EnumerateIt References
38
63
 
39
64
  - [Creating enumerations](https://github.com/lucascaton/enumerate_it#creating-enumerations)
40
65
  - [Sorting enumerations](https://github.com/lucascaton/enumerate_it#sorting-enumerations)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Enuminator
4
- VERSION = "0.0.2"
4
+ VERSION = "0.0.3"
5
5
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Enuminator
4
- class CreateGenerator < Rails::Generators::Base
4
+ class EnumGenerator < Rails::Generators::Base
5
5
  source_root File.expand_path('templates', __dir__)
6
6
 
7
7
  argument :attributes, type: :hash
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class <%= class_name %>Enumeration < ApplicationEnumeration
3
+ class <%= class_name %> < ApplicationEnumeration
4
4
  associate_values(<%= current_values %>)
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enuminator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Walmir Neto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-04 00:00:00.000000000 Z
11
+ date: 2023-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: enumerate_it
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.1.0
19
+ version: 3.2.4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 0.1.0
26
+ version: 3.2.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rails
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -51,11 +51,9 @@ files:
51
51
  - lib/enuminator/base.rb
52
52
  - lib/enuminator/engine.rb
53
53
  - lib/enuminator/version.rb
54
- - lib/generators/enuminator/create/USAGE
55
- - lib/generators/enuminator/create/create_generator.rb
56
- - lib/generators/enuminator/create/templates/enumeration.rb
57
- - lib/generators/enuminator/create/templates/enumeration.yml
58
- - lib/generators/enuminator/install/USAGE
54
+ - lib/generators/enuminator/enum/enum_generator.rb
55
+ - lib/generators/enuminator/enum/templates/enumeration.rb
56
+ - lib/generators/enuminator/enum/templates/enumeration.yml
59
57
  - lib/generators/enuminator/install/install_generator.rb
60
58
  - lib/generators/enuminator/install/templates/application_enumeration.rb
61
59
  homepage: http://github.com/owalmirneto/enuminator
@@ -1,8 +0,0 @@
1
- Description:
2
- Explain the generator
3
-
4
- Example:
5
- rails g enuminator:install
6
-
7
- This will create:
8
- /app/enumerations/application_enumeration.rb
@@ -1,8 +0,0 @@
1
- Description:
2
- Explain the generator
3
-
4
- Example:
5
- rails g enuminator:install
6
-
7
- This will create:
8
- /app/enumerations/application_enumeration.rb