lazy_names 0.1.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.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.lazy_names.tt.yml +4 -0
- data/.rspec +3 -0
- data/.rubocop.yml +44 -0
- data/.ruby-version +1 -0
- data/.travis.yml +7 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +43 -0
- data/LICENSE.txt +21 -0
- data/README.md +106 -0
- data/Rakefile +6 -0
- data/bin/console +7 -0
- data/bin/setup +8 -0
- data/lazy_names.gemspec +31 -0
- data/lib/lazy_names.rb +21 -0
- data/lib/lazy_names/config.rb +40 -0
- data/lib/lazy_names/config_loader.rb +73 -0
- data/lib/lazy_names/config_validator.rb +59 -0
- data/lib/lazy_names/definer.rb +13 -0
- data/lib/lazy_names/find_namespace.rb +12 -0
- data/lib/lazy_names/logger.rb +48 -0
- data/lib/lazy_names/version.rb +3 -0
- metadata +123 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2f594a6fa241dd756a103b41fe2a92eadfb43b0089146ae1f4499d89525a474c
|
4
|
+
data.tar.gz: f17a91f20eb4d7d044f682c15a1644d7da450a92b96f9902702df073ef73418b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 110cf094aaf3b4e2b726813e6c5ffb99901b020198cfa2a23bf9688661d5d5c92c561d0e37a06d453046bb64fa326c9fbe084cdfca4c4e624e792e6aa6c72295
|
7
|
+
data.tar.gz: 8de69d4970c6e4e2370be4803e66b0881f05df8204b0e8eb5142783877fa6e64d15ed042b57afb59329e3fddf6c7b21519a1e0486cc7b55570566f96e5d5567d
|
data/.gitignore
ADDED
data/.lazy_names.tt.yml
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
Style/FrozenStringLiteralComment:
|
2
|
+
Enabled: false
|
3
|
+
|
4
|
+
# Good documentation welcome, but not required
|
5
|
+
Style/Documentation:
|
6
|
+
Enabled: false
|
7
|
+
|
8
|
+
Lint/StructNewOverride:
|
9
|
+
Enabled: true
|
10
|
+
|
11
|
+
Style/HashEachMethods:
|
12
|
+
Enabled: true
|
13
|
+
|
14
|
+
Style/HashTransformKeys:
|
15
|
+
Enabled: false
|
16
|
+
|
17
|
+
Style/HashTransformValues:
|
18
|
+
Enabled: false
|
19
|
+
|
20
|
+
Security/Eval:
|
21
|
+
Enabled: false
|
22
|
+
|
23
|
+
Style/LambdaCall:
|
24
|
+
Enabled:
|
25
|
+
EnforcedStyle: braces
|
26
|
+
|
27
|
+
Style/RedundantSelf:
|
28
|
+
Enabled: false
|
29
|
+
|
30
|
+
Style/MultilineMethodCallIndentation:
|
31
|
+
Enabled:
|
32
|
+
EnforcedStyle: indented
|
33
|
+
|
34
|
+
Layout/LineLength:
|
35
|
+
Enabled:
|
36
|
+
max: 100
|
37
|
+
|
38
|
+
Metrics/BlockLength:
|
39
|
+
Exclude:
|
40
|
+
- spec/**/*.rb
|
41
|
+
|
42
|
+
Metrics/AbcSize:
|
43
|
+
Exclude:
|
44
|
+
- lib/lazy_names.rb
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.3.3
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
lazy_names (0.0.1)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
coderay (1.1.3)
|
10
|
+
diff-lcs (1.3)
|
11
|
+
fakefs (1.2.1)
|
12
|
+
method_source (1.0.0)
|
13
|
+
pry (0.13.1)
|
14
|
+
coderay (~> 1.1)
|
15
|
+
method_source (~> 1.0)
|
16
|
+
rake (10.5.0)
|
17
|
+
rspec (3.8.0)
|
18
|
+
rspec-core (~> 3.8.0)
|
19
|
+
rspec-expectations (~> 3.8.0)
|
20
|
+
rspec-mocks (~> 3.8.0)
|
21
|
+
rspec-core (3.8.0)
|
22
|
+
rspec-support (~> 3.8.0)
|
23
|
+
rspec-expectations (3.8.2)
|
24
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
25
|
+
rspec-support (~> 3.8.0)
|
26
|
+
rspec-mocks (3.8.0)
|
27
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
28
|
+
rspec-support (~> 3.8.0)
|
29
|
+
rspec-support (3.8.0)
|
30
|
+
|
31
|
+
PLATFORMS
|
32
|
+
ruby
|
33
|
+
|
34
|
+
DEPENDENCIES
|
35
|
+
bundler (~> 1.16)
|
36
|
+
fakefs (~> 1.2)
|
37
|
+
lazy_names!
|
38
|
+
pry (~> 0.13)
|
39
|
+
rake (~> 10.0)
|
40
|
+
rspec (~> 3.0)
|
41
|
+
|
42
|
+
BUNDLED WITH
|
43
|
+
1.16.3
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2020 Zhdanov
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,106 @@
|
|
1
|
+
# lazy_names
|
2
|
+
|
3
|
+
LazyNames helps programmer to type faster very-long classes names, constants by defining them on a shorter version.
|
4
|
+
If you are lazy like me typing many times a day in console long constant then this gem will ease your development process.
|
5
|
+
|
6
|
+
## Why
|
7
|
+
|
8
|
+
Consider this example from pry terminal session.
|
9
|
+

|
10
|
+
|
11
|
+
## Installation
|
12
|
+
|
13
|
+
1. Add this line to your application's Gemfile:
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
group :development do
|
17
|
+
gem 'lazy_names'
|
18
|
+
end
|
19
|
+
```
|
20
|
+
2. Setup your console to automatically load lazy names
|
21
|
+
|
22
|
+
- If you are using pry, add this line to `~/.pryrc` or per project `myproject/.pryrc`
|
23
|
+
|
24
|
+
```ruby
|
25
|
+
if defined?(LazyNames)
|
26
|
+
Pry.config.hooks.add_hook(:when_started, :lazy_names) do
|
27
|
+
LazyNames.load_definitions!
|
28
|
+
end
|
29
|
+
end
|
30
|
+
```
|
31
|
+
|
32
|
+
- If you are using irb, add this line to `~/.irbrc` or per project `myproject/.irbrc`
|
33
|
+
|
34
|
+
```ruby
|
35
|
+
if defined?(LazyNames)
|
36
|
+
LazyNames.load_definitions!
|
37
|
+
end
|
38
|
+
```
|
39
|
+
|
40
|
+
3. And then execute:
|
41
|
+
```bash
|
42
|
+
bundle
|
43
|
+
```
|
44
|
+
|
45
|
+
4. Create your own lazy_names config where you define constants
|
46
|
+
```bash
|
47
|
+
cp .lazy_names.tt.yml ~/.lazy_names.yml
|
48
|
+
```
|
49
|
+
|
50
|
+
5. Login into your rails or non-rails console
|
51
|
+
```bash
|
52
|
+
$ bundle exec rails c # or bin/console
|
53
|
+
# your shorter version of constants are available now, enjoy!
|
54
|
+
```
|
55
|
+
|
56
|
+
## Configuration
|
57
|
+
Take a look onto `lazy_names.tt.yml` it has very basic template for you to start.
|
58
|
+
|
59
|
+
```yml
|
60
|
+
---
|
61
|
+
my_awesome_project:
|
62
|
+
definitions:
|
63
|
+
'Models::Users::CreditCard': 'MUCC'
|
64
|
+
```
|
65
|
+
`my_awesome_project` should be you project/folder name
|
66
|
+
|
67
|
+
So consider this example:
|
68
|
+
```sh
|
69
|
+
$ pwd
|
70
|
+
/Users/name/my_awesome_project
|
71
|
+
```
|
72
|
+
The last folder name of you ruby project must match the same one in your configuration.
|
73
|
+
After **definitions** sections you can actually redefine your long constants.
|
74
|
+
So in this example `Models::Users::CreditCard` is your real project constant and
|
75
|
+
`MUCC` will be your short variant of it, so you can access `Models::Users::CreditCard`
|
76
|
+
from `MUCC`. `MUCC` and any other right hand side can be any value, you define the best-suitable names.
|
77
|
+
|
78
|
+
You can define as many constants as you want. The same rule applies for projects.
|
79
|
+
Your config can have multiple constant definitions per namespace.
|
80
|
+
```yml
|
81
|
+
---
|
82
|
+
my_awesome_project:
|
83
|
+
definitions:
|
84
|
+
'Models::Users::CreditCard': 'MUCC'
|
85
|
+
my_another_project:
|
86
|
+
definitions:
|
87
|
+
'OtherLongConst': 'Short'
|
88
|
+
```
|
89
|
+
|
90
|
+
However you can put your `.lazy_names.yml` config directly to project folder, it will be looked up firstly from project.
|
91
|
+
Just do not forget to put in your `.gitignore`. I believe every developer defines shorter versions of constants by his own opinion.
|
92
|
+
If project folder doesn't contain any `.lazy_names.yml`, it will fallback to home directory.
|
93
|
+
|
94
|
+
## Development
|
95
|
+
|
96
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
97
|
+
|
98
|
+
To install this gem onto your local machine, run `bundle exec rake install`.
|
99
|
+
|
100
|
+
## Contributing
|
101
|
+
|
102
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/zhisme/lazy_names.
|
103
|
+
|
104
|
+
## License
|
105
|
+
|
106
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
data/bin/setup
ADDED
data/lazy_names.gemspec
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require 'lazy_names/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = 'lazy_names'
|
7
|
+
spec.version = LazyNames::VERSION
|
8
|
+
spec.authors = ['zhisme']
|
9
|
+
spec.email = ['evdev34@gmail.com']
|
10
|
+
|
11
|
+
spec.description = <<~DESC
|
12
|
+
lazy_names is ruby programmer friend. You can save your time not typing long
|
13
|
+
error-phone constants/classes but defining short and nice versions of them.
|
14
|
+
DESC
|
15
|
+
spec.summary = 'Define short constants to frequently used classes/constants'
|
16
|
+
spec.homepage = 'https://github.com/zhisme/lazy_names'
|
17
|
+
spec.license = 'MIT'
|
18
|
+
|
19
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
20
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
21
|
+
end
|
22
|
+
spec.bindir = 'exe'
|
23
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
|
+
spec.require_paths = ['lib']
|
25
|
+
|
26
|
+
spec.add_development_dependency 'bundler', '~> 1.16'
|
27
|
+
spec.add_development_dependency 'pry', '~> 0.13'
|
28
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
29
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
30
|
+
spec.required_ruby_version = '>= 2.3.3'
|
31
|
+
end
|
data/lib/lazy_names.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'lazy_names/version'
|
2
|
+
require 'lazy_names/find_namespace'
|
3
|
+
require 'lazy_names/config_loader'
|
4
|
+
require 'lazy_names/config'
|
5
|
+
require 'lazy_names/config_validator'
|
6
|
+
require 'lazy_names/definer'
|
7
|
+
require 'lazy_names/logger'
|
8
|
+
|
9
|
+
module LazyNames
|
10
|
+
def self.load_definitions!(top_level_binding = TOPLEVEL_BINDING)
|
11
|
+
basic_config = LazyNames::ConfigLoader
|
12
|
+
.(namespace: LazyNames::FindNamespace.())
|
13
|
+
config = LazyNames::Config.new(basic_config.definitions, basic_config.path)
|
14
|
+
config.validate!
|
15
|
+
LazyNames::Definer.(config, top_level_binding)
|
16
|
+
|
17
|
+
LazyNames::Logger.warn_undefined(config.errors.undefined, config.path)
|
18
|
+
LazyNames::Logger.warn_duplicate_definition(config.errors.already_defined, config.path)
|
19
|
+
LazyNames::Logger.warn_empty_definitions(config.constants.to_a.empty?, config.path)
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module LazyNames
|
2
|
+
class Config
|
3
|
+
extend Forwardable
|
4
|
+
|
5
|
+
attr_reader :path, :validator
|
6
|
+
|
7
|
+
def_delegator :@validator, :errors
|
8
|
+
|
9
|
+
def initialize(definitions, path)
|
10
|
+
@definitions = definitions
|
11
|
+
@path = path
|
12
|
+
@validator = ConfigValidator.new(definitions.values, definitions.keys)
|
13
|
+
end
|
14
|
+
|
15
|
+
def constants
|
16
|
+
definitions.keys
|
17
|
+
end
|
18
|
+
|
19
|
+
def lazy_names
|
20
|
+
definitions.values
|
21
|
+
end
|
22
|
+
|
23
|
+
def lazy_name(name)
|
24
|
+
definitions[name]
|
25
|
+
end
|
26
|
+
|
27
|
+
def validate!
|
28
|
+
validator.()
|
29
|
+
remove_invalid_definitions!
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
34
|
+
def remove_invalid_definitions!
|
35
|
+
errors.undefined.each { |name| definitions.delete(name) }
|
36
|
+
end
|
37
|
+
|
38
|
+
attr_reader :definitions
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
|
3
|
+
module LazyNames
|
4
|
+
class ConfigLoader
|
5
|
+
class NoConfig < StandardError; end
|
6
|
+
class ConfigNotResolved < StandardError; end
|
7
|
+
class NamespaceNotFound < StandardError; end
|
8
|
+
|
9
|
+
class << self
|
10
|
+
BasicConfig = Struct.new(:path, :definitions)
|
11
|
+
HOME_PATH = '~/.lazy_names.yml'.freeze
|
12
|
+
|
13
|
+
def call(namespace:, path: nil)
|
14
|
+
return read_from_path(namespace, path) if path
|
15
|
+
|
16
|
+
config = read_from_project(namespace)
|
17
|
+
config ||= read_from_home_dir(namespace)
|
18
|
+
|
19
|
+
config
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def read_from_path(namespace, path)
|
25
|
+
definitions = find_definitions(path, namespace)
|
26
|
+
|
27
|
+
BasicConfig.new(path, definitions)
|
28
|
+
rescue Errno::ENOENT, Errno::ENOTDIR
|
29
|
+
raise NoConfig, "No config found by given path: #{path}"
|
30
|
+
end
|
31
|
+
|
32
|
+
def read_from_home_dir(namespace)
|
33
|
+
definitions = find_definitions(home_path, namespace)
|
34
|
+
|
35
|
+
BasicConfig.new(home_path, definitions)
|
36
|
+
rescue Errno::ENOENT
|
37
|
+
raise NoConfig, 'No config found in your home directory. ' \
|
38
|
+
'Create ~/.lazy_names.yml'
|
39
|
+
end
|
40
|
+
|
41
|
+
def read_from_project(namespace)
|
42
|
+
return false unless config_in_project_path?
|
43
|
+
|
44
|
+
definitions = find_definitions(project_path, namespace)
|
45
|
+
|
46
|
+
BasicConfig.new(project_path, definitions)
|
47
|
+
end
|
48
|
+
|
49
|
+
def find_definitions(path, namespace)
|
50
|
+
read_config(path)[namespace]['definitions'].to_h
|
51
|
+
|
52
|
+
rescue NoMethodError
|
53
|
+
raise NamespaceNotFound
|
54
|
+
end
|
55
|
+
|
56
|
+
def config_in_project_path?
|
57
|
+
File.exist?(project_path)
|
58
|
+
end
|
59
|
+
|
60
|
+
def read_config(path)
|
61
|
+
YAML.safe_load(File.read(path))
|
62
|
+
end
|
63
|
+
|
64
|
+
def project_path
|
65
|
+
File.expand_path(Pathname.new(Dir.pwd).join('.lazy_names.yml'))
|
66
|
+
end
|
67
|
+
|
68
|
+
def home_path
|
69
|
+
File.expand_path(HOME_PATH)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
module LazyNames
|
2
|
+
class ConfigValidator
|
3
|
+
attr_reader :errors
|
4
|
+
|
5
|
+
Errors = Struct.new(:undefined, :already_defined)
|
6
|
+
|
7
|
+
def initialize(lazy_names, constants)
|
8
|
+
@errors = Errors.new([], [])
|
9
|
+
@constants = constants
|
10
|
+
@lazy_names = lazy_names
|
11
|
+
end
|
12
|
+
|
13
|
+
def call
|
14
|
+
validate_constants!
|
15
|
+
validate_lazy_names!
|
16
|
+
|
17
|
+
self
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
attr_reader :lazy_names, :constants
|
23
|
+
|
24
|
+
def validate_constants!
|
25
|
+
constants.each do |c|
|
26
|
+
begin
|
27
|
+
resolve_const_in_project(c)
|
28
|
+
rescue NameError
|
29
|
+
self.errors.undefined << c
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def validate_lazy_names!
|
35
|
+
a = lazy_names.uniq
|
36
|
+
b = lazy_names
|
37
|
+
|
38
|
+
diff = difference(b, a)
|
39
|
+
|
40
|
+
return unless diff
|
41
|
+
|
42
|
+
diff.each { |name| self.errors.already_defined << name }
|
43
|
+
end
|
44
|
+
|
45
|
+
def resolve_const_in_project(const)
|
46
|
+
Module.const_get(const)
|
47
|
+
end
|
48
|
+
|
49
|
+
def difference(arr, other)
|
50
|
+
copy = arr.dup
|
51
|
+
other.each do |e|
|
52
|
+
i = copy.rindex(e)
|
53
|
+
copy.delete_at(i) if i
|
54
|
+
end
|
55
|
+
|
56
|
+
copy
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module LazyNames
|
2
|
+
class Definer
|
3
|
+
class << self
|
4
|
+
def call(config, top_level_binding)
|
5
|
+
config.constants.each do |origin|
|
6
|
+
eval <<-RUBY, top_level_binding, __FILE__, __LINE__ + 1
|
7
|
+
#{config.lazy_name(origin)} = #{origin}
|
8
|
+
RUBY
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
module LazyNames
|
2
|
+
class Logger
|
3
|
+
class << self
|
4
|
+
def warn_undefined(errors, config_path)
|
5
|
+
return if errors.empty?
|
6
|
+
|
7
|
+
message = <<~MSG
|
8
|
+
Error loading lazy_names gem.
|
9
|
+
Found #{errors.size} undefined constants.
|
10
|
+
Please check spelling for #{errors.join(', ')}
|
11
|
+
#{config_path}
|
12
|
+
\n
|
13
|
+
MSG
|
14
|
+
|
15
|
+
warn(message)
|
16
|
+
end
|
17
|
+
|
18
|
+
def warn_duplicate_definition(errors, config_path)
|
19
|
+
return if errors.empty?
|
20
|
+
|
21
|
+
message = <<~MSG
|
22
|
+
Error loading lazy_names gem.
|
23
|
+
Found #{errors.size} already defined constants.
|
24
|
+
Using same lazy names for different constants may lead to unexpected results
|
25
|
+
Avoid duplications in your config file.
|
26
|
+
#{config_path}
|
27
|
+
\n
|
28
|
+
MSG
|
29
|
+
|
30
|
+
warn(message)
|
31
|
+
end
|
32
|
+
|
33
|
+
def warn_empty_definitions(errors, config_path)
|
34
|
+
return unless errors
|
35
|
+
|
36
|
+
message = <<~MSG
|
37
|
+
Error loading lazy_names gem.
|
38
|
+
Seems like you misspelled namespace in config.
|
39
|
+
#{config_path}
|
40
|
+
Please ensure word definitions exists in config
|
41
|
+
or check .lazy_names.tt.yml for consistency.
|
42
|
+
MSG
|
43
|
+
|
44
|
+
warn(message)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
metadata
ADDED
@@ -0,0 +1,123 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: lazy_names
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- zhisme
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-11-30 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.16'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.16'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: pry
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.13'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0.13'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.0'
|
69
|
+
description: |
|
70
|
+
lazy_names is ruby programmer friend. You can save your time not typing long
|
71
|
+
error-phone constants/classes but defining short and nice versions of them.
|
72
|
+
email:
|
73
|
+
- evdev34@gmail.com
|
74
|
+
executables: []
|
75
|
+
extensions: []
|
76
|
+
extra_rdoc_files: []
|
77
|
+
files:
|
78
|
+
- ".gitignore"
|
79
|
+
- ".lazy_names.tt.yml"
|
80
|
+
- ".rspec"
|
81
|
+
- ".rubocop.yml"
|
82
|
+
- ".ruby-version"
|
83
|
+
- ".travis.yml"
|
84
|
+
- Gemfile
|
85
|
+
- Gemfile.lock
|
86
|
+
- LICENSE.txt
|
87
|
+
- README.md
|
88
|
+
- Rakefile
|
89
|
+
- bin/console
|
90
|
+
- bin/setup
|
91
|
+
- lazy_names.gemspec
|
92
|
+
- lib/lazy_names.rb
|
93
|
+
- lib/lazy_names/config.rb
|
94
|
+
- lib/lazy_names/config_loader.rb
|
95
|
+
- lib/lazy_names/config_validator.rb
|
96
|
+
- lib/lazy_names/definer.rb
|
97
|
+
- lib/lazy_names/find_namespace.rb
|
98
|
+
- lib/lazy_names/logger.rb
|
99
|
+
- lib/lazy_names/version.rb
|
100
|
+
homepage: https://github.com/zhisme/lazy_names
|
101
|
+
licenses:
|
102
|
+
- MIT
|
103
|
+
metadata: {}
|
104
|
+
post_install_message:
|
105
|
+
rdoc_options: []
|
106
|
+
require_paths:
|
107
|
+
- lib
|
108
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
109
|
+
requirements:
|
110
|
+
- - ">="
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: 2.3.3
|
113
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
requirements: []
|
119
|
+
rubygems_version: 3.0.3
|
120
|
+
signing_key:
|
121
|
+
specification_version: 4
|
122
|
+
summary: Define short constants to frequently used classes/constants
|
123
|
+
test_files: []
|