bashly 0.7.2 → 0.7.3
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 +4 -4
- data/lib/bashly/commands/generate.rb +2 -2
- data/lib/bashly/config_validator.rb +7 -0
- data/lib/bashly/script/base.rb +2 -2
- data/lib/bashly/script/command.rb +1 -1
- data/lib/bashly/version.rb +1 -1
- data/lib/bashly/views/command/default_root_script.erb +1 -1
- data/lib/bashly/views/command/root_command.erb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a68036595993a9c9661c283bcb30d0b89941d15930cba9b821e2500d53087178
|
4
|
+
data.tar.gz: d8d50d5c8f91f95a46a94116d3f7ffe5a66f7c2a994e87524036f91292b707f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7ad12eef82213a5ed61673d205dafb5626028516efe0768986dc64cf527ae346e0fa868019cb7c23b8366a277edc7f9414149ece6f2ab8178f5f0b20beedb77
|
7
|
+
data.tar.gz: 3db2a86f70fb882bc63f615f25dc2e70aa818f1c5b9af9c13ce1d4d1d2c681dd1e7c5919c93422ccf1d0d440f018efefc3e8901e4af2b43a092fd652d503fee8
|
@@ -82,7 +82,7 @@ module Bashly
|
|
82
82
|
end
|
83
83
|
|
84
84
|
def create_root_command_file
|
85
|
-
create_file "#{Settings.source_dir}
|
85
|
+
create_file "#{Settings.source_dir}/#{command.filename}", command.render(:default_root_script)
|
86
86
|
end
|
87
87
|
|
88
88
|
def create_all_command_files
|
@@ -98,7 +98,7 @@ module Bashly
|
|
98
98
|
if File.exist? file and !args['--force']
|
99
99
|
quiet_say "!txtblu!skipped!txtrst! #{file} (exists)"
|
100
100
|
else
|
101
|
-
File.
|
101
|
+
File.deep_write file, content
|
102
102
|
quiet_say "!txtgrn!created!txtrst! #{file}"
|
103
103
|
end
|
104
104
|
end
|
@@ -81,6 +81,8 @@ module Bashly
|
|
81
81
|
assert_boolean "#{key}.required", value['required']
|
82
82
|
|
83
83
|
assert_array "#{key}.allowed", value['allowed'], of: :string
|
84
|
+
|
85
|
+
refute value['name'].match(/^-/), "#{key}.name must not start with '-'"
|
84
86
|
end
|
85
87
|
|
86
88
|
def assert_flag(key, value)
|
@@ -96,6 +98,10 @@ module Bashly
|
|
96
98
|
|
97
99
|
assert_boolean "#{key}.required", value['required']
|
98
100
|
assert_array "#{key}.allowed", value['allowed'], of: :string
|
101
|
+
|
102
|
+
assert value['long'].match(/^--[a-zA-Z0-9_\-]+$/), "#{key}.long must be in the form of '--name'" if value['long']
|
103
|
+
assert value['short'].match(/^-[a-zA-Z0-9]$/), "#{key}.short must be in the form of '-n'" if value['short']
|
104
|
+
refute value['arg'].match(/^-/), "#{key}.arg must not start with '-'" if value['arg']
|
99
105
|
end
|
100
106
|
|
101
107
|
def assert_env_var(key, value)
|
@@ -117,6 +123,7 @@ module Bashly
|
|
117
123
|
assert_optional_string "#{key}.help", value['help']
|
118
124
|
assert_optional_string "#{key}.footer", value['footer']
|
119
125
|
assert_optional_string "#{key}.group", value['group']
|
126
|
+
assert_optional_string "#{key}.filename", value['filename']
|
120
127
|
|
121
128
|
assert_boolean "#{key}.default", value['default']
|
122
129
|
assert_version "#{key}.version", value['version']
|
data/lib/bashly/script/base.rb
CHANGED
@@ -53,9 +53,9 @@ module Bashly
|
|
53
53
|
respond_to?(method_name) ? options[key] : super
|
54
54
|
end
|
55
55
|
|
56
|
-
def
|
56
|
+
def respond_to_missing?(method_name, include_private = false)
|
57
57
|
OPTION_KEYS.include?(method_name) || super
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|
61
|
-
end
|
61
|
+
end
|
@@ -55,7 +55,7 @@ module Bashly
|
|
55
55
|
# Returns the bash filename that is expected to hold the user code
|
56
56
|
# for this command
|
57
57
|
def filename
|
58
|
-
"#{action_name.to_underscore}_command.sh"
|
58
|
+
options["filename"] || "#{action_name.to_underscore}_command.sh"
|
59
59
|
end
|
60
60
|
|
61
61
|
# Returns an array of Flags
|
data/lib/bashly/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bashly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Danny Ben Shitrit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colsole
|
@@ -188,7 +188,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
188
188
|
- !ruby/object:Gem::Version
|
189
189
|
version: '0'
|
190
190
|
requirements: []
|
191
|
-
rubygems_version: 3.
|
191
|
+
rubygems_version: 3.3.6
|
192
192
|
signing_key:
|
193
193
|
specification_version: 4
|
194
194
|
summary: Bash Command Line Tool Generator
|