thor-addons 0.1.6 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +18 -0
- data/.ruby-version +1 -0
- data/.travis.yml +5 -2
- data/CHANGELOG.md +8 -0
- data/Dockerfile +1 -1
- data/Gemfile +2 -0
- data/README.md +7 -6
- data/Rakefile +3 -1
- data/lib/ext/string.rb +32 -0
- data/lib/thor-addons/helpers/defaults.rb +34 -0
- data/lib/thor-addons/helpers/option_type.rb +39 -0
- data/lib/thor-addons/helpers/options_config_file.rb +55 -0
- data/lib/thor-addons/helpers/options_env.rb +26 -0
- data/lib/thor-addons/helpers/options_hash.rb +23 -0
- data/lib/thor-addons/options.rb +37 -107
- data/lib/thor-addons/version.rb +3 -1
- data/lib/thor-addons.rb +10 -3
- data/thor-addons.gemspec +12 -6
- metadata +58 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0805d43eb2a94a29a350e4d325f786627dbf24aea71e8d7bf481519901a9698a'
|
4
|
+
data.tar.gz: 89c2db5f9e7c866da3c40beec05e670b74d7a72a8bebfadc3d9dbd73621da1db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7147d625670b7c69be63866b31d5a09a73e54521786c7af166704ceb7067988def0dacf97bb440dd2175243fe865e096efe3e73c1422c45078444036f3d59c79
|
7
|
+
data.tar.gz: 3af249f36fee8007549a23ba780d1bb184e64996fc4117a7b6a6734d66495f4d86ac2efc332e99606a4b8803c756aa3f2eee6dc15bb77689cbb83081bcdceb33
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
Style/StringLiterals:
|
2
|
+
EnforcedStyle: double_quotes
|
3
|
+
|
4
|
+
Layout/MultilineMethodCallIndentation:
|
5
|
+
EnforcedStyle: indented
|
6
|
+
|
7
|
+
Naming/FileName:
|
8
|
+
Exclude:
|
9
|
+
- lib/thor-addons.rb
|
10
|
+
- spec/lib/thor-addons_spec.rb
|
11
|
+
|
12
|
+
# disable for now
|
13
|
+
Style/Documentation:
|
14
|
+
Enabled: false
|
15
|
+
|
16
|
+
Metrics/BlockLength:
|
17
|
+
Exclude:
|
18
|
+
- "spec/**/*"
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.5.1
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/Dockerfile
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -7,7 +7,7 @@ Extend [Thor](https://github.com/erikhuda/thor) with useful Add-ons
|
|
7
7
|
|
8
8
|
### Installation
|
9
9
|
|
10
|
-
```
|
10
|
+
```shell
|
11
11
|
gem install thor-addons
|
12
12
|
```
|
13
13
|
|
@@ -20,7 +20,7 @@ The `Options` module allows you to read the CLI options from a configuration fil
|
|
20
20
|
|
21
21
|
include the Options module to your Thor class.
|
22
22
|
|
23
|
-
```
|
23
|
+
```ruby
|
24
24
|
require 'thor'
|
25
25
|
require 'thor_addons'
|
26
26
|
|
@@ -39,7 +39,7 @@ end
|
|
39
39
|
|
40
40
|
In the example above the `--bar` option will be read from the configuration file `--config-file`
|
41
41
|
|
42
|
-
```
|
42
|
+
```ruby
|
43
43
|
foo:
|
44
44
|
bar: "zip"
|
45
45
|
```
|
@@ -48,7 +48,7 @@ and via the environment variable `BAR`
|
|
48
48
|
|
49
49
|
if you want to disable the configuration file you need to set in your class
|
50
50
|
|
51
|
-
```
|
51
|
+
```ruby
|
52
52
|
def with_config_file?
|
53
53
|
false
|
54
54
|
end
|
@@ -56,7 +56,7 @@ end
|
|
56
56
|
|
57
57
|
and for disabling the environment variables
|
58
58
|
|
59
|
-
```
|
59
|
+
```ruby
|
60
60
|
def with_env?
|
61
61
|
false
|
62
62
|
end
|
@@ -64,8 +64,9 @@ end
|
|
64
64
|
|
65
65
|
you can also have environment variables aliases, by setting
|
66
66
|
|
67
|
-
```
|
67
|
+
```ruby
|
68
68
|
def envs_aliases
|
69
|
+
# source => alias
|
69
70
|
{ "BAR" => "MY_BAR" }
|
70
71
|
end
|
71
72
|
```
|
data/Rakefile
CHANGED
data/lib/ext/string.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class String
|
4
|
+
TRUES = %w[t true on y yes 1].freeze
|
5
|
+
FALSES = %w[f false off n no 0].freeze
|
6
|
+
|
7
|
+
def to_b(invalid_value_behaviour: proc { nil })
|
8
|
+
value = strip.downcase
|
9
|
+
return true if TRUES.include?(value)
|
10
|
+
return false if FALSES.include?(value)
|
11
|
+
|
12
|
+
invalid_value_behaviour.call
|
13
|
+
end
|
14
|
+
|
15
|
+
def to_a(delimiter: " ")
|
16
|
+
split(delimiter)
|
17
|
+
end
|
18
|
+
|
19
|
+
def to_h(arr_sep: " ", key_sep: ":")
|
20
|
+
split(arr_sep).each_with_object({}) do |e, hsh|
|
21
|
+
key, value = e.split(key_sep)
|
22
|
+
|
23
|
+
hsh[key] = value
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def to_n
|
28
|
+
return to_f if self =~ /[0-9]+\.[0-9]+/
|
29
|
+
|
30
|
+
to_i
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ThorAddons
|
4
|
+
module Helpers
|
5
|
+
class Defaults
|
6
|
+
def self.load(klass, config)
|
7
|
+
options = klass.class_options.dup
|
8
|
+
options.merge!(config[:class_options]) if config[:class_options]
|
9
|
+
options.merge!(config[:command_options]) if config[:command_options]
|
10
|
+
|
11
|
+
options.each_with_object({}) do |(name, obj), hsh|
|
12
|
+
value = obj.respond_to?(:default) ? obj.default : nil
|
13
|
+
type = obj.respond_to?(:type) ? obj.type : :string
|
14
|
+
|
15
|
+
hsh[name] = { value: value, type: type }
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.add(hash, defaults)
|
20
|
+
hash.each_with_object({}) do |(k, v), hsh|
|
21
|
+
hsh[k] = v.nil? ? defaults[k][:value] : v
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.remove(hash, defaults)
|
26
|
+
hash.each_with_object({}) do |(k, v), hsh|
|
27
|
+
hsh[k] = nil
|
28
|
+
|
29
|
+
hsh[k] = v unless defaults[k][:value] == v
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ThorAddons
|
4
|
+
module Helpers
|
5
|
+
class OptionType
|
6
|
+
attr_reader :option, :type
|
7
|
+
|
8
|
+
def initialize(option, type)
|
9
|
+
@option = option
|
10
|
+
@type = type
|
11
|
+
|
12
|
+
raise TypeError, "Invalid type: '#{type}'" unless
|
13
|
+
TYPE_CLASS_MAP.keys.include?(type)
|
14
|
+
end
|
15
|
+
|
16
|
+
TYPE_CLASS_MAP = {
|
17
|
+
array: [Array],
|
18
|
+
boolean: [TrueClass, FalseClass],
|
19
|
+
hash: [Hash],
|
20
|
+
numeric: [Integer, Float],
|
21
|
+
string: [String]
|
22
|
+
}.freeze
|
23
|
+
|
24
|
+
def valid?
|
25
|
+
TYPE_CLASS_MAP[type].any? { |klass| option.is_a?(klass) }
|
26
|
+
end
|
27
|
+
|
28
|
+
def convert_string
|
29
|
+
case type
|
30
|
+
when :boolean then option.to_b
|
31
|
+
when :array then option.to_a
|
32
|
+
when :hash then option.to_h
|
33
|
+
when :numeric then option.to_n
|
34
|
+
else option
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ThorAddons
|
4
|
+
module Helpers
|
5
|
+
class OptionsConfigFile
|
6
|
+
def self.parse_config_file(config_file)
|
7
|
+
YAML.load_file(config_file) || {}
|
8
|
+
rescue Errno::ENOENT, Psych::SyntaxError
|
9
|
+
STDERR.puts("[WARN] Unable to parse 'config_file' '#{config_file}'.")
|
10
|
+
{}
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.extract_command_data(data, command)
|
14
|
+
data_hash = data["global"] || {}
|
15
|
+
|
16
|
+
return data_hash if command.nil? || data[command].nil?
|
17
|
+
|
18
|
+
data_hash.merge(data[command])
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.get_command_config_data(data, invocations, current_command_name)
|
22
|
+
invocations ||= {}
|
23
|
+
commands = (invocations.values.flatten << current_command_name)
|
24
|
+
|
25
|
+
command_options = extract_command_data(data, commands.shift)
|
26
|
+
|
27
|
+
commands.each do |cmd|
|
28
|
+
should_break = command_options[cmd].nil?
|
29
|
+
command_options.merge!(extract_command_data(command_options, cmd))
|
30
|
+
|
31
|
+
%W[#{cmd} global].each { |k| command_options.delete(k) }
|
32
|
+
|
33
|
+
break if should_break
|
34
|
+
end
|
35
|
+
|
36
|
+
command_options
|
37
|
+
end
|
38
|
+
|
39
|
+
def self.parse(config_file, invocations, current_command_name, defaults)
|
40
|
+
data = parse_config_file(config_file)
|
41
|
+
opts = get_command_config_data(data, invocations, current_command_name)
|
42
|
+
|
43
|
+
config_opts = opts.each_with_object({}) do |(key, value), hsh|
|
44
|
+
if defaults.keys.map(&:to_s).include?(key.to_s)
|
45
|
+
hsh[key] = value
|
46
|
+
else
|
47
|
+
STDERR.puts("[WARN] rejecting invalid config file option: '#{key}'")
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
OptionsHash.new(config_opts)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ThorAddons
|
4
|
+
module Helpers
|
5
|
+
class OptionsENV
|
6
|
+
private_class_method def self.get_from_env_or_alias(env, envs_aliases)
|
7
|
+
return ENV[env] unless ENV[env].nil? && envs_aliases.keys.include?(env)
|
8
|
+
|
9
|
+
ENV[envs_aliases[env]]
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.parse(defaults, envs_aliases)
|
13
|
+
opts = defaults.keys.each_with_object({}) do |option, hsh|
|
14
|
+
value = get_from_env_or_alias(option.to_s.upcase, envs_aliases)
|
15
|
+
|
16
|
+
next if value.nil?
|
17
|
+
|
18
|
+
hsh[option] = OptionType.new(value, defaults[option][:type])
|
19
|
+
.convert_string
|
20
|
+
end
|
21
|
+
|
22
|
+
OptionsHash.new(opts)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ThorAddons
|
4
|
+
module Helpers
|
5
|
+
class OptionsHash < ::SymbolizedHash
|
6
|
+
private def value_empty?(value)
|
7
|
+
value.is_a?(NilClass) || (value.respond_to?(:empty?) && value.empty?)
|
8
|
+
end
|
9
|
+
|
10
|
+
def merge(new_hash)
|
11
|
+
new_hash.each_with_object(dup) do |(key, value), self_dup|
|
12
|
+
next if value_empty?(value) || !value_empty?(self_dup[key])
|
13
|
+
|
14
|
+
self_dup[key] = value
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def merge!(options)
|
19
|
+
replace(merge(options))
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/thor-addons/options.rb
CHANGED
@@ -1,13 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module ThorAddons
|
2
4
|
module Options
|
3
|
-
attr_reader :
|
5
|
+
attr_reader :defaults, :invocations, :current_command_name
|
4
6
|
|
5
7
|
def initialize(args = [], local_options = {}, config = {})
|
6
|
-
@
|
7
|
-
@defaults = load_defaults(config.dup)
|
8
|
-
@invoked_via_subcommand = config[:invoked_via_subcommand]
|
8
|
+
@defaults = Helpers::Defaults.load(self.class, config.dup)
|
9
9
|
@invocations = config[:invocations]
|
10
10
|
|
11
|
+
if config[:current_command].respond_to?(:name)
|
12
|
+
@current_command_name = config[:current_command].name
|
13
|
+
end
|
14
|
+
|
11
15
|
super(args, local_options, config)
|
12
16
|
end
|
13
17
|
|
@@ -19,126 +23,52 @@ module ThorAddons
|
|
19
23
|
true
|
20
24
|
end
|
21
25
|
|
22
|
-
def options
|
23
|
-
original = hash_with_indifferent_access(super)
|
24
|
-
config_file = original[:config_file]
|
25
|
-
|
26
|
-
return original unless with_env? || with_config_file?
|
27
|
-
|
28
|
-
new_options = remove_defaults(original)
|
29
|
-
|
30
|
-
if with_config_file? && !config_file.nil?
|
31
|
-
merge(new_options, options_from_config(config_file))
|
32
|
-
end
|
33
|
-
|
34
|
-
if with_env?
|
35
|
-
merge(new_options, options_from_env)
|
36
|
-
end
|
37
|
-
|
38
|
-
hash_with_indifferent_access(add_defaults(new_options))
|
39
|
-
end
|
40
|
-
|
41
|
-
private
|
42
|
-
|
43
|
-
def merge(options_a, options_b)
|
44
|
-
options_b.each do |key, value|
|
45
|
-
next if value.to_s.empty? || !options_a[key].to_s.empty?
|
46
|
-
|
47
|
-
options_a[key] = value
|
48
|
-
end
|
49
|
-
|
50
|
-
options_a
|
51
|
-
end
|
52
|
-
|
53
26
|
def envs_aliases
|
54
27
|
{}
|
55
28
|
end
|
56
29
|
|
57
|
-
def
|
58
|
-
|
59
|
-
defaults.keys.inject({}) do |memo, option|
|
60
|
-
env = option.to_s.upcase
|
61
|
-
opts[option] = ENV[env] unless ENV[env].nil?
|
62
|
-
|
63
|
-
next unless envs_aliases.keys.include?(env) && opts[option].nil? && ENV[envs_aliases[env]]
|
64
|
-
|
65
|
-
opts[option] = ENV[envs_aliases[env]]
|
66
|
-
end
|
67
|
-
|
68
|
-
hash_with_indifferent_access(opts)
|
69
|
-
end
|
70
|
-
|
71
|
-
def options_from_config(config_file)
|
72
|
-
unless File.file?(config_file)
|
73
|
-
STDERR.puts("[WARNING] Unable to read 'config_file' '#{config_file}' not found.")
|
74
|
-
return {}
|
75
|
-
end
|
76
|
-
|
77
|
-
data = YAML.load_file(config_file)
|
78
|
-
command_options = {}
|
79
|
-
global = data["global"] || {}
|
80
|
-
|
81
|
-
return hash_with_indifferent_access(global) if current_command_name.nil?
|
82
|
-
|
83
|
-
if invoked_via_subcommand
|
84
|
-
first_invoked, *remaining_invoked = invocations.values.flatten
|
85
|
-
command_options = data[first_invoked] unless data[first_invoked].nil?
|
30
|
+
def options
|
31
|
+
original = Helpers::OptionsHash.new(super)
|
86
32
|
|
87
|
-
|
88
|
-
break if command_options[subcommand].nil?
|
33
|
+
return original unless with_env? || with_config_file?
|
89
34
|
|
90
|
-
|
35
|
+
new_options = Helpers::Defaults.remove(original, defaults)
|
36
|
+
update_options!(new_options, original[:config_file])
|
91
37
|
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
else
|
96
|
-
command_options = data[current_command_name] unless data[current_command_name].nil?
|
97
|
-
end
|
38
|
+
opts = Helpers::OptionsHash.new(
|
39
|
+
Helpers::Defaults.add(new_options, defaults)
|
40
|
+
)
|
98
41
|
|
99
|
-
|
42
|
+
validate_options(opts)
|
100
43
|
end
|
101
44
|
|
102
|
-
def
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
memo
|
107
|
-
end
|
45
|
+
private def update_options!(opts, cfg_file)
|
46
|
+
update_config_options!(opts, cfg_file) if with_config_file? && cfg_file
|
47
|
+
update_env_options!(opts) if with_env?
|
108
48
|
end
|
109
49
|
|
110
|
-
def
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
end
|
50
|
+
private def update_config_options!(opts, cfg_file)
|
51
|
+
opts.merge!(
|
52
|
+
Helpers::OptionsConfigFile.parse(
|
53
|
+
cfg_file,
|
54
|
+
invocations,
|
55
|
+
current_command_name,
|
56
|
+
defaults
|
57
|
+
)
|
58
|
+
)
|
120
59
|
end
|
121
60
|
|
122
|
-
def
|
123
|
-
|
124
|
-
|
125
|
-
parse_options.merge!(config[:command_options]) if config[:command_options]
|
61
|
+
private def update_env_options!(opts)
|
62
|
+
opts.merge!(Helpers::OptionsENV.parse(defaults, envs_aliases))
|
63
|
+
end
|
126
64
|
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
memo[key] = nil
|
132
|
-
end
|
65
|
+
private def validate_options(opts)
|
66
|
+
opts.each do |key, value|
|
67
|
+
type = defaults[key][:type]
|
68
|
+
is_valid = Helpers::OptionType.new(value, type).valid?
|
133
69
|
|
134
|
-
|
70
|
+
raise TypeError, "'#{key}' should be a #{type}" unless is_valid
|
135
71
|
end
|
136
|
-
|
137
|
-
hash_with_indifferent_access(options_hash)
|
138
|
-
end
|
139
|
-
|
140
|
-
def hash_with_indifferent_access(hash)
|
141
|
-
::SymbolizedHash.new(hash)
|
142
72
|
end
|
143
73
|
end
|
144
74
|
end
|
data/lib/thor-addons/version.rb
CHANGED
data/lib/thor-addons.rb
CHANGED
@@ -1,7 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "yaml"
|
2
|
-
require "thor"
|
3
|
-
require "thor"
|
4
4
|
require "symbolized"
|
5
|
+
require "thor"
|
5
6
|
|
6
|
-
require "
|
7
|
+
require "ext/string"
|
8
|
+
require "thor-addons/helpers/defaults"
|
9
|
+
require "thor-addons/helpers/option_type"
|
10
|
+
require "thor-addons/helpers/options_config_file"
|
11
|
+
require "thor-addons/helpers/options_env"
|
12
|
+
require "thor-addons/helpers/options_hash"
|
7
13
|
require "thor-addons/options"
|
14
|
+
require "thor-addons/version"
|
data/thor-addons.gemspec
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path("lib", __dir__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
5
|
require "thor-addons/version"
|
5
6
|
|
@@ -9,18 +10,23 @@ Gem::Specification.new do |spec|
|
|
9
10
|
spec.authors = ["Jacopo Scrinzi"]
|
10
11
|
spec.email = ["scrinzi.jcopo@gmail.com"]
|
11
12
|
|
12
|
-
spec.summary =
|
13
|
-
spec.description =
|
13
|
+
spec.summary = "Thor CLI Add-ons"
|
14
|
+
spec.description = "Useful Add-ons Thor CLI"
|
14
15
|
spec.homepage = "https://github.com/eredi93/thor-addons"
|
15
16
|
spec.license = "MIT"
|
16
17
|
|
17
|
-
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
|
-
spec.
|
20
|
+
spec.files = `git ls-files -z`.split("\x0")
|
21
|
+
.reject { |f| f.match(%r{^(test|spec|features)/}) }
|
22
|
+
|
21
23
|
spec.add_dependency "symbolized", "~> 0.0.1"
|
24
|
+
spec.add_dependency "thor", "~> 0.19"
|
22
25
|
|
23
26
|
spec.add_development_dependency "bundler"
|
27
|
+
spec.add_development_dependency "climate_control"
|
28
|
+
spec.add_development_dependency "gem-release"
|
24
29
|
spec.add_development_dependency "rake"
|
25
30
|
spec.add_development_dependency "rspec"
|
31
|
+
spec.add_development_dependency "rubocop"
|
26
32
|
end
|
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thor-addons
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jacopo Scrinzi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: symbolized
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 0.0.1
|
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:
|
26
|
+
version: 0.0.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: thor
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: '0.19'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: '0.19'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,6 +52,34 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: climate_control
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: gem-release
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
55
83
|
- !ruby/object:Gem::Dependency
|
56
84
|
name: rake
|
57
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,6 +108,20 @@ dependencies:
|
|
80
108
|
- - ">="
|
81
109
|
- !ruby/object:Gem::Version
|
82
110
|
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rubocop
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
83
125
|
description: Useful Add-ons Thor CLI
|
84
126
|
email:
|
85
127
|
- scrinzi.jcopo@gmail.com
|
@@ -88,6 +130,8 @@ extensions: []
|
|
88
130
|
extra_rdoc_files: []
|
89
131
|
files:
|
90
132
|
- ".gitignore"
|
133
|
+
- ".rubocop.yml"
|
134
|
+
- ".ruby-version"
|
91
135
|
- ".travis.yml"
|
92
136
|
- CHANGELOG.md
|
93
137
|
- CONTRIBUTING.md
|
@@ -96,7 +140,13 @@ files:
|
|
96
140
|
- LICENSE.md
|
97
141
|
- README.md
|
98
142
|
- Rakefile
|
143
|
+
- lib/ext/string.rb
|
99
144
|
- lib/thor-addons.rb
|
145
|
+
- lib/thor-addons/helpers/defaults.rb
|
146
|
+
- lib/thor-addons/helpers/option_type.rb
|
147
|
+
- lib/thor-addons/helpers/options_config_file.rb
|
148
|
+
- lib/thor-addons/helpers/options_env.rb
|
149
|
+
- lib/thor-addons/helpers/options_hash.rb
|
100
150
|
- lib/thor-addons/options.rb
|
101
151
|
- lib/thor-addons/version.rb
|
102
152
|
- thor-addons.gemspec
|