bashly 0.9.4 → 0.9.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 810dfb8f0b25029420a1479aa38d682a79787716112d9b5f9c816533fc3e97ea
4
- data.tar.gz: c6782bd0bf01a475b137487dcdec634645484c877386b1ccaaa8432d53831595
3
+ metadata.gz: 34993542fcfa09d73fa8a1e0a0dceff571612efd1fa93211d3656279301c6f95
4
+ data.tar.gz: '04218807cb6464dd9cfb5bcf2d8e3b442b67885cd44d91942b5e3f900a3c29b6'
5
5
  SHA512:
6
- metadata.gz: 3c6cb7413b619b50cd76ecfa66d704623780f05f3316e1e9bcb9e7a3c02a4a3b9a9215759e928e32e4d6492993fb5b5cbcb6ba0379bd0fe638f6ab1182b791a4
7
- data.tar.gz: e83491e2a1ab364701351a74bbef05377bbe479521fe907b8f9b1dc3fa567be4f5b53f87c4f4d4dd4313e9fff16ab84e07dd5cbfae5ed7ff0f4c2d44b98d69bd
6
+ metadata.gz: f03c2c3cb8a8fa45c12fcc9a06c5d12a21303b2917c0ada24b60e6895606eac42b5fcfb411702aa24e8bc0885e454f7ad8f4b874294888fb673b323178bbcd81
7
+ data.tar.gz: 1c1e28ac06bbc58d573d9b4e2270cde6628059af9ac4377c4c1c8393f488646ccfcb3cc2d8abc8b1e2332219720a8340b2f15b6e829f66725a27024d772e3d5e
data/README.md CHANGED
@@ -13,7 +13,7 @@ Create feature-rich bash scripts using simple YAML configuration
13
13
 
14
14
  ---
15
15
 
16
- ![demo](demo/cast.svg)
16
+ ![demo](demo/cast.gif)
17
17
 
18
18
  </div>
19
19
 
data/bin/bashly CHANGED
@@ -12,6 +12,6 @@ rescue Bashly::Interrupt
12
12
  exit 1
13
13
  rescue => e
14
14
  puts e.backtrace.reverse if ENV['DEBUG']
15
- say! "!undred!#{e.class}!txtrst!\n#{e.message}"
15
+ say! "rib` #{e.class} `\n#{e.message}"
16
16
  exit 1
17
17
  end
data/lib/bashly/cli.rb CHANGED
@@ -7,7 +7,7 @@ module Bashly
7
7
  def self.runner
8
8
  runner = MisterBin::Runner.new version: Bashly::VERSION,
9
9
  header: 'Bashly - Bash CLI Generator',
10
- footer: "Help: !txtpur!bashly COMMAND --help!txtrst!\nDocs: !undblu!https://bashly.dannyb.co"
10
+ footer: "Help: m`bashly COMMAND --help`\nDocs: bu`https://bashly.dannyb.co`"
11
11
 
12
12
  runner.route 'init', to: Commands::Init
13
13
  runner.route 'preview', to: Commands::Preview
@@ -124,18 +124,18 @@ module Bashly
124
124
  def safe_write(path, content)
125
125
  if !skip_src_check && !Dir.exist?(Settings.source_dir)
126
126
  raise InitError, <<~ERROR
127
- Directory !txtgrn!#{Settings.source_dir}!txtrst! does not exist
128
- Run !txtpur!bashly init!txtrst! first
127
+ Directory g`#{Settings.source_dir}` does not exist
128
+ Run m`bashly init` first
129
129
  ERROR
130
130
  end
131
131
 
132
132
  if File.exist?(path) && !args['--force']
133
- say "!txtblu!skipped!txtrst! #{path} (exists)"
133
+ say "b`skipped` #{path} (exists)"
134
134
  false
135
135
 
136
136
  else
137
137
  File.deep_write path, content
138
- say "!txtgrn!created!txtrst! #{path}"
138
+ say "g`created` #{path}"
139
139
  true
140
140
 
141
141
  end
@@ -35,27 +35,27 @@ module Bashly
35
35
  end
36
36
 
37
37
  def show_key(key)
38
- say "!txtgrn!#{key}"
38
+ say "g`#{key}`"
39
39
  say ''
40
40
  end
41
41
 
42
42
  def show_url(url)
43
- say " See !undblu!#{url}"
43
+ say " See bu`#{url}`"
44
44
  say ''
45
45
  end
46
46
 
47
47
  def show_example(example)
48
48
  example = word_wrap " #{example}"
49
- example.gsub!(/^(\s*- )?(\s*\w+):/, '\1!txtblu!\2!txtrst!:')
50
- example.gsub!(/^(\s*- )/, '!txtylw!\1!txtrst!')
51
- example.gsub!(/^(\s*#.+)/, '!txtpur!\1!txtrst!')
49
+ example.gsub!(/^(\s*- )?(\s*\w+):/, '\1b`\2`:')
50
+ example.gsub!(/^(\s*- )/, 'y`\1`')
51
+ example.gsub!(/^(\s*#.+)/, 'm`\1`')
52
52
  say example
53
53
  say ''
54
54
  end
55
55
 
56
56
  def show_help(help)
57
57
  help = word_wrap " #{help}"
58
- help.gsub!(/`([^`]+)`/, '!txtgrn!\1!txtrst!')
58
+ help.gsub!(/`([^`]+)`/, 'g`\1`')
59
59
  say help
60
60
  say ''
61
61
  end
@@ -63,7 +63,7 @@ module Bashly
63
63
  def data
64
64
  return raw_data unless args['SEARCH']
65
65
 
66
- result = raw_data.select { |k, _v| k.== args['SEARCH'] }
66
+ result = raw_data.select { |k, _v| k == args['SEARCH'] }
67
67
  return result if result.any?
68
68
 
69
69
  result = raw_data.select { |k, _v| k.include? args['SEARCH'] }
@@ -52,25 +52,25 @@ module Bashly
52
52
  private
53
53
 
54
54
  def watch
55
- quiet_say "!txtgrn!watching!txtrst! #{Settings.source_dir}\n"
55
+ quiet_say "g`watching` #{Settings.source_dir}\n"
56
56
 
57
57
  Filewatcher.new([Settings.source_dir]).watch do
58
58
  reset
59
59
  generate
60
60
 
61
61
  rescue Bashly::ConfigurationError => e
62
- say! "!undred!#{e.class}!txtrst!\n#{e.message}"
62
+ say! "rib` #{e.class} `\n#{e.message}"
63
63
 
64
64
  ensure
65
- quiet_say "!txtgrn!waiting\n"
65
+ quiet_say "g`waiting`\n"
66
66
  end
67
67
  end
68
68
 
69
69
  def generate
70
70
  with_valid_config do
71
- quiet_say 'creating !txtgrn!production!txtrst! version' if Settings.production?
71
+ quiet_say 'creating g`production` version' if Settings.production?
72
72
  generate_all_files
73
- quiet_say "run !txtpur!#{master_script_path} --help!txtrst! to test your bash script" unless watching
73
+ quiet_say "run m`#{master_script_path} --help` to test your bash script" unless watching
74
74
  end
75
75
  end
76
76
 
@@ -110,7 +110,7 @@ module Bashly
110
110
  if Library.exist? library_name
111
111
  upgrade! existing_file, library_name, *args
112
112
  else
113
- quiet_say "!txtred!warning!txtrst! not upgrading !txtcyn!#{existing_file}!txtrst!, " \
113
+ quiet_say "r`warning` not upgrading c`#{existing_file}`, " \
114
114
  "unknown library '#{library_name}'"
115
115
  end
116
116
  end
@@ -121,14 +121,14 @@ module Bashly
121
121
 
122
122
  if file
123
123
  File.deep_write file[:path], file[:content]
124
- quiet_say "!txtcyn!updated!txtrst! #{file[:path]}"
124
+ quiet_say "c`updated` #{file[:path]}"
125
125
  else
126
- quiet_say "!txtred!warning!txtrst! not upgrading !txtcyn!#{existing_file}!txtrst!, path mismatch"
126
+ quiet_say "r`warning` not upgrading c`#{existing_file}`, path mismatch"
127
127
  end
128
128
  end
129
129
 
130
130
  def create_user_files
131
- quiet_say "creating user files in !txtgrn!#{Settings.source_dir}"
131
+ quiet_say "creating user files in g`#{Settings.source_dir}`"
132
132
 
133
133
  create_file "#{Settings.source_dir}/initialize.#{Settings.partials_extension}",
134
134
  command.render(:default_initialize_script)
@@ -156,17 +156,17 @@ module Bashly
156
156
 
157
157
  def create_file(file, content)
158
158
  if File.exist?(file) && !args['--force']
159
- quiet_say "!txtblu!skipped!txtrst! #{file} (exists)"
159
+ quiet_say "b`skipped` #{file} (exists)"
160
160
  else
161
161
  File.deep_write file, content
162
- quiet_say "!txtgrn!created!txtrst! #{file}"
162
+ quiet_say "g`created` #{file}"
163
163
  end
164
164
  end
165
165
 
166
166
  def create_master_script
167
167
  File.write master_script_path, script.code(tab_indent: Settings.tab_indent)
168
168
  FileUtils.chmod '+x', master_script_path
169
- quiet_say "!txtgrn!created!txtrst! #{master_script_path}"
169
+ quiet_say "g`created` #{master_script_path}"
170
170
  end
171
171
 
172
172
  def script
@@ -13,13 +13,13 @@ module Bashly
13
13
 
14
14
  def run
15
15
  if Dir.exist?(target_dir) && !Dir.empty?(target_dir)
16
- raise InitError, "Directory !txtgrn!#{target_dir}!txtrst! already exists and is not empty"
16
+ raise InitError, "Directory g`#{target_dir}` already exists and is not empty"
17
17
  end
18
18
 
19
19
  FileUtils.mkdir_p target_dir
20
20
  File.write "#{target_dir}/bashly.yml", yaml_content
21
- say "!txtgrn!created!txtrst! #{target_dir}/bashly.yml"
22
- say 'run !txtpur!bashly generate!txtrst! to create the bash script'
21
+ say "g`created` #{target_dir}/bashly.yml"
22
+ say 'run m`bashly generate` to create the bash script'
23
23
  end
24
24
 
25
25
  private
@@ -22,9 +22,9 @@ module Bashly
22
22
  show_deprecations
23
23
  deprecations = config_validator.deprecations
24
24
  if deprecations.empty?
25
- say '!txtgrn!OK'
25
+ say 'g`OK`'
26
26
  else
27
- say "!txtred!WARNING!txtrst! Found #{deprecations.count} deprecations"
27
+ say "r`WARNING` Found #{deprecations.count} deprecations"
28
28
  end
29
29
  end
30
30
  end
@@ -9,11 +9,11 @@ module Bashly
9
9
  end
10
10
 
11
11
  def message
12
- result = ['Deprecation Warning:', "!txtred!#{old}!txtrst! is deprecated"]
13
- result.push "use !txtgrn!#{replacement}!txtrst! instead" if replacement
14
- result.push "see !undblu!#{reference}!txtrst!" if reference
12
+ result = ['Deprecation Warning:', "r`#{old}` is deprecated"]
13
+ result.push "use g`#{replacement}` instead" if replacement
14
+ result.push "see bu`#{reference}`" if reference
15
15
 
16
- result.map { |line| "!txtred!▐!txtrst! #{line}" }.join("\n")
16
+ result.map { |line| "r`▐` #{line}" }.join("\n")
17
17
  end
18
18
 
19
19
  def to_h
@@ -12,11 +12,11 @@ module Bashly
12
12
 
13
13
  def post_install_message
14
14
  <<~MESSAGE
15
- In order to enable completions in your script, create a command or a flag (for example: !txtgrn!#{command.name} completions!txtrst! or !txtgrn!#{command.name} --completions!txtrst!) that calls the !txtgrn!#{function_name}!txtrst! function.
15
+ In order to enable completions in your script, create a command or a flag (for example: g`#{command.name} completions` or g`#{command.name} --completions`) that calls the g`#{function_name}` function.
16
16
 
17
17
  Your users can then run something like this to enable completions:
18
18
 
19
- !txtpur!$ eval "$(#{command.name} completions)"
19
+ m`$ eval "$(#{command.name} completions)"`
20
20
  MESSAGE
21
21
  end
22
22
 
@@ -14,7 +14,7 @@ module Bashly
14
14
  <<~MESSAGE
15
15
  In order to enable completions, run:
16
16
 
17
- !txtpur!$ source #{target_path}
17
+ m`$ source #{target_path}`
18
18
  MESSAGE
19
19
  end
20
20
 
@@ -12,7 +12,7 @@ module Bashly
12
12
 
13
13
  def post_install_message
14
14
  <<~MESSAGE
15
- This file can be converted to a completions script using the !txtgrn!completely!txtrst! gem.
15
+ This file can be converted to a completions script using the g`completely` gem.
16
16
  MESSAGE
17
17
  end
18
18
 
@@ -16,12 +16,12 @@ module Bashly
16
16
  <<~MESSAGE
17
17
  Add this as a command to your bashly.yml:
18
18
 
19
- !txtgrn!commands:
20
- !txtgrn!- name: !txtpur!help
21
- !txtgrn! help: !txtpur!Show help about a command
22
- !txtgrn! args:
23
- !txtgrn!- name: !txtpur!command
24
- !txtgrn! help: !txtpur!Help subject
19
+ g`commands`:
20
+ g`- name`: m`help`
21
+ g` help`: m`Show help about a command`
22
+ g` args`:
23
+ g`- name`: m`command`
24
+ g` help`: m`Help subject`
25
25
 
26
26
  MESSAGE
27
27
  end
@@ -37,11 +37,11 @@ test:
37
37
  target: "%{user_target_dir}/test/approve"
38
38
 
39
39
  post_install_message: |
40
- Edit your tests in !txtgrn!test/approve!txtrst! and then run:
40
+ Edit your tests in g`test/approve` and then run:
41
41
 
42
- !txtpur!$ test/approve!txtrst!
42
+ m`$ test/approve`
43
43
 
44
- Docs: !undblu!https://github.com/DannyBen/approvals.bash
44
+ Docs: bu`https://github.com/DannyBen/approvals.bash`
45
45
 
46
46
  validations:
47
47
  files:
@@ -25,9 +25,9 @@ module ComposeRefinements
25
25
  loaded = YAML.properly_load_file path
26
26
  return loaded if loaded.is_a?(Array) || loaded.is_a?(Hash)
27
27
 
28
- raise Bashly::ConfigurationError, "Cannot find a valid YAML in !txtgrn!#{path}"
28
+ raise Bashly::ConfigurationError, "Cannot find a valid YAML in g`#{path}`"
29
29
  rescue Errno::ENOENT
30
- raise Bashly::ConfigurationError, "Cannot find import file !txtgrn!#{path}"
30
+ raise Bashly::ConfigurationError, "Cannot find import file g`#{path}`"
31
31
  end
32
32
  end
33
33
 
@@ -1,3 +1,3 @@
1
1
  module Bashly
2
- VERSION = '0.9.4'
2
+ VERSION = '0.9.5'
3
3
  end
metadata CHANGED
@@ -1,71 +1,77 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bashly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.4
4
+ version: 0.9.5
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-12-31 00:00:00.000000000 Z
11
+ date: 2023-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: completely
14
+ name: colsole
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.5.1
19
+ version: 0.8.1
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '2'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
- version: 0.5.1
29
+ version: 0.8.1
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '2'
27
33
  - !ruby/object:Gem::Dependency
28
- name: gtx
34
+ name: completely
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
31
37
  - - "~>"
32
38
  - !ruby/object:Gem::Version
33
- version: 0.1.0
39
+ version: '0.5'
34
40
  type: :runtime
35
41
  prerelease: false
36
42
  version_requirements: !ruby/object:Gem::Requirement
37
43
  requirements:
38
44
  - - "~>"
39
45
  - !ruby/object:Gem::Version
40
- version: 0.1.0
46
+ version: '0.5'
41
47
  - !ruby/object:Gem::Dependency
42
- name: colsole
48
+ name: filewatcher
43
49
  requirement: !ruby/object:Gem::Requirement
44
50
  requirements:
45
51
  - - "~>"
46
52
  - !ruby/object:Gem::Version
47
- version: '0.7'
53
+ version: '2.0'
48
54
  type: :runtime
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
51
57
  requirements:
52
58
  - - "~>"
53
59
  - !ruby/object:Gem::Version
54
- version: '0.7'
60
+ version: '2.0'
55
61
  - !ruby/object:Gem::Dependency
56
- name: filewatcher
62
+ name: gtx
57
63
  requirement: !ruby/object:Gem::Requirement
58
64
  requirements:
59
65
  - - "~>"
60
66
  - !ruby/object:Gem::Version
61
- version: '2.0'
67
+ version: '0.1'
62
68
  type: :runtime
63
69
  prerelease: false
64
70
  version_requirements: !ruby/object:Gem::Requirement
65
71
  requirements:
66
72
  - - "~>"
67
73
  - !ruby/object:Gem::Version
68
- version: '2.0'
74
+ version: '0.1'
69
75
  - !ruby/object:Gem::Dependency
70
76
  name: lp
71
77
  requirement: !ruby/object:Gem::Requirement
@@ -86,14 +92,14 @@ dependencies:
86
92
  requirements:
87
93
  - - "~>"
88
94
  - !ruby/object:Gem::Version
89
- version: 0.7.2
95
+ version: '0.7'
90
96
  type: :runtime
91
97
  prerelease: false
92
98
  version_requirements: !ruby/object:Gem::Requirement
93
99
  requirements:
94
100
  - - "~>"
95
101
  - !ruby/object:Gem::Version
96
- version: 0.7.2
102
+ version: '0.7'
97
103
  - !ruby/object:Gem::Dependency
98
104
  name: requires
99
105
  requirement: !ruby/object:Gem::Requirement
@@ -252,7 +258,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
252
258
  - !ruby/object:Gem::Version
253
259
  version: '0'
254
260
  requirements: []
255
- rubygems_version: 3.4.0
261
+ rubygems_version: 3.4.5
256
262
  signing_key:
257
263
  specification_version: 4
258
264
  summary: Bash Command Line Tool Generator