enuminator 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +50 -0
- data/Rakefile +36 -0
- data/lib/base.rb +9 -0
- data/lib/enuminator.rb +8 -0
- data/lib/generators/enuminator/install/USAGE +8 -0
- data/lib/generators/enuminator/install/install_generator.rb +19 -0
- data/lib/generators/enuminator/install/templates/application_enumeration.rb +4 -0
- metadata +78 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 8978af85c5d807586326e9cf0b686b9daeeb44c88d51acfd47c35ec80c8e1cec
|
4
|
+
data.tar.gz: edc34f5458455299075f7d1b627c0b772772e7083279aa0f37dcb774b0a3f3d7
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e9ed0dd77b6b8266c144ef0c88d87e726a25147b4a5d687e90b2cd3a49a396dc0e9cac43f18044eb5d82dc0345d33339370abdb512edb4104f22eefbdc59cc35
|
7
|
+
data.tar.gz: '05449d389a0958471ba825cb2987f7c3164cfe2989c3ff3eee4950ca8c673a3f44b9eeaa1904be52964861f554ebba53d205b5e0358fbfed2d5195dd28ae53a7'
|
data/README.md
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
# Enuminator is a EnumerateIt Extension
|
2
|
+
|
3
|
+
Enumerations for Ruby or Rails inspired in [EnumerateIt](https://github.com/lucascaton/enumerate_it) with some magic powers! 🎩
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
```bash
|
8
|
+
bundle add enuminator
|
9
|
+
```
|
10
|
+
|
11
|
+
## Using with Rails
|
12
|
+
|
13
|
+
```bash
|
14
|
+
bundle add enuminator
|
15
|
+
```
|
16
|
+
|
17
|
+
OR
|
18
|
+
|
19
|
+
```bash
|
20
|
+
gem "enuminator", "~> 0.0.1"
|
21
|
+
```
|
22
|
+
|
23
|
+
And run in console
|
24
|
+
|
25
|
+
```bash
|
26
|
+
bundle install
|
27
|
+
```
|
28
|
+
|
29
|
+
## Generate ApplicationEnumeration
|
30
|
+
|
31
|
+
You can use a Rails generator to create `ApplicationEnumeration`:
|
32
|
+
|
33
|
+
```bash
|
34
|
+
rails g enuminator:install
|
35
|
+
```
|
36
|
+
|
37
|
+
## References
|
38
|
+
|
39
|
+
- [Creating enumerations](https://github.com/lucascaton/enumerate_it#creating-enumerations)
|
40
|
+
- [Sorting enumerations](https://github.com/lucascaton/enumerate_it#sorting-enumerations)
|
41
|
+
- [Using enumerations](https://github.com/lucascaton/enumerate_it#using-enumerations)
|
42
|
+
- [FAQ](https://github.com/lucascaton/enumerate_it#faq)
|
43
|
+
- [I18n](https://github.com/lucascaton/enumerate_it#i18n)
|
44
|
+
- [Translate a name-spaced enumeration](https://github.com/lucascaton/enumerate_it#translate-a-name-spaced-enumeration)
|
45
|
+
- [Handling a legacy database](https://github.com/lucascaton/enumerate_it#handling-a-legacy-database)
|
46
|
+
- [Changelog](https://github.com/lucascaton/enumerate_it#changelog)
|
47
|
+
|
48
|
+
## Contributing
|
49
|
+
|
50
|
+
Bug reports and merge requests are welcome on GitHub at https://github.com/[USERNAME]/enuminator.
|
data/Rakefile
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
begin
|
5
|
+
require "bundler/setup"
|
6
|
+
rescue LoadError
|
7
|
+
puts "You must `gem install bundler` and `bundle install` to run rake tasks"
|
8
|
+
end
|
9
|
+
begin
|
10
|
+
require "rdoc/task"
|
11
|
+
rescue LoadError
|
12
|
+
require "rdoc/rdoc"
|
13
|
+
require "rake/rdoctask"
|
14
|
+
RDoc::Task = Rake::RDocTask
|
15
|
+
end
|
16
|
+
|
17
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
18
|
+
rdoc.rdoc_dir = "rdoc"
|
19
|
+
rdoc.title = "Enuminator"
|
20
|
+
rdoc.options << "--line-numbers"
|
21
|
+
rdoc.rdoc_files.include("README.rdoc")
|
22
|
+
rdoc.rdoc_files.include("lib/**/*.rb")
|
23
|
+
end
|
24
|
+
|
25
|
+
Bundler::GemHelper.install_tasks
|
26
|
+
|
27
|
+
require "rake/testtask"
|
28
|
+
|
29
|
+
Rake::TestTask.new(:test) do |t|
|
30
|
+
t.libs << "lib"
|
31
|
+
t.libs << "test"
|
32
|
+
t.pattern = "test/**/*_test.rb"
|
33
|
+
t.verbose = false
|
34
|
+
end
|
35
|
+
|
36
|
+
task default: :test
|
data/lib/base.rb
ADDED
data/lib/enuminator.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Enuminator
|
4
|
+
class InstallGenerator < Rails::Generators::Base
|
5
|
+
source_root File.expand_path("templates", __dir__)
|
6
|
+
|
7
|
+
desc "Generates a application query."
|
8
|
+
|
9
|
+
def create_application_query
|
10
|
+
copy_file("application_enumeration.rb", application_query_path)
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def application_query_path
|
16
|
+
Rails.root.join("app/enumerations/application_enumeration.rb")
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
metadata
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: enuminator
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Walmir Neto
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2023-03-04 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: enumerate_it
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.1.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.1.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rails
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3.1'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3.1'
|
41
|
+
description:
|
42
|
+
email:
|
43
|
+
- owalmirneto@gmail.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- README.md
|
49
|
+
- Rakefile
|
50
|
+
- lib/base.rb
|
51
|
+
- lib/enuminator.rb
|
52
|
+
- lib/generators/enuminator/install/USAGE
|
53
|
+
- lib/generators/enuminator/install/install_generator.rb
|
54
|
+
- lib/generators/enuminator/install/templates/application_enumeration.rb
|
55
|
+
homepage: http://github.com/owalmirneto/enuminator
|
56
|
+
licenses: []
|
57
|
+
metadata:
|
58
|
+
rubygems_mfa_required: 'true'
|
59
|
+
post_install_message:
|
60
|
+
rdoc_options: []
|
61
|
+
require_paths:
|
62
|
+
- lib
|
63
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '2.7'
|
68
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
69
|
+
requirements:
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: '0'
|
73
|
+
requirements: []
|
74
|
+
rubygems_version: 3.4.7
|
75
|
+
signing_key:
|
76
|
+
specification_version: 4
|
77
|
+
summary: Enuminator is a extension for gem enumerate_it
|
78
|
+
test_files: []
|