bashly 0.9.4 → 1.0.0.rc1

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.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/bin/bashly +1 -1
  4. data/lib/bashly/cli.rb +1 -1
  5. data/lib/bashly/commands/add.rb +42 -90
  6. data/lib/bashly/commands/base.rb +1 -9
  7. data/lib/bashly/commands/doc.rb +7 -7
  8. data/lib/bashly/commands/generate.rb +28 -33
  9. data/lib/bashly/commands/init.rb +3 -5
  10. data/lib/bashly/commands/preview.rb +0 -2
  11. data/lib/bashly/commands/validate.rb +1 -9
  12. data/lib/bashly/concerns/validation_helpers.rb +0 -8
  13. data/lib/bashly/config_validator.rb +1 -9
  14. data/lib/bashly/docs/command.yml +1 -1
  15. data/lib/bashly/docs/env.yml +1 -1
  16. data/lib/bashly/docs/flag.yml +11 -1
  17. data/lib/bashly/libraries/base.rb +1 -1
  18. data/lib/bashly/{templates/lib → libraries/colors}/colors.sh +0 -0
  19. data/lib/bashly/libraries/{completions_function.rb → completions/completions_function.rb} +2 -2
  20. data/lib/bashly/libraries/{completions_script.rb → completions/completions_script.rb} +1 -1
  21. data/lib/bashly/libraries/{completions_yaml.rb → completions/completions_yaml.rb} +1 -1
  22. data/lib/bashly/{templates/lib → libraries/config}/config.sh +0 -0
  23. data/lib/bashly/libraries/{help.rb → help/help.rb} +7 -7
  24. data/lib/bashly/{templates → libraries}/help/help_command.sh +0 -0
  25. data/lib/bashly/{templates → libraries}/lib/sample_function.sh +0 -0
  26. data/lib/bashly/libraries/libraries.yml +85 -0
  27. data/lib/bashly/{templates → libraries/settings}/settings.yml +7 -1
  28. data/lib/bashly/{templates → libraries/strings}/strings.yml +0 -0
  29. data/lib/bashly/{templates → libraries}/test/approvals.bash +0 -0
  30. data/lib/bashly/{templates → libraries}/test/approve +0 -0
  31. data/lib/bashly/{templates/lib → libraries}/validations/validate_dir_exists.sh +0 -0
  32. data/lib/bashly/{templates/lib → libraries}/validations/validate_file_exists.sh +0 -0
  33. data/lib/bashly/{templates/lib → libraries}/validations/validate_integer.sh +0 -0
  34. data/lib/bashly/{templates/lib → libraries}/validations/validate_not_empty.sh +0 -0
  35. data/lib/bashly/{templates/lib → libraries/yaml}/yaml.sh +0 -0
  36. data/lib/bashly/library.rb +14 -25
  37. data/lib/bashly/library_source.rb +84 -0
  38. data/lib/bashly/message_strings.rb +1 -1
  39. data/lib/bashly/refinements/compose_refinements.rb +2 -2
  40. data/lib/bashly/script/command.rb +10 -4
  41. data/lib/bashly/script/flag.rb +1 -1
  42. data/lib/bashly/settings.rb +21 -4
  43. data/lib/bashly/version.rb +1 -1
  44. data/lib/bashly/views/command/long_usage.gtx +2 -2
  45. data/lib/bashly/views/command/usage_environment_variables.gtx +1 -1
  46. data/lib/bashly/views/command/usage_flags.gtx +1 -1
  47. metadata +46 -40
  48. data/lib/bashly/deprecation.rb +0 -27
  49. data/lib/bashly/libraries.yml +0 -60
@@ -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
@@ -29,7 +29,7 @@ module Bashly
29
29
  private
30
30
 
31
31
  def help_command
32
- asset_content('templates/help/help_command.sh') % { name: command.name }
32
+ asset_content('libraries/help/help_command.sh') % { name: command.name }
33
33
  end
34
34
  end
35
35
  end
@@ -0,0 +1,85 @@
1
+ colors:
2
+ help: Add standard functions for printing colorful and formatted text to the lib directory.
3
+ files:
4
+ - source: "colors/colors.sh"
5
+ target: "%{user_lib_dir}/colors.%{user_ext}"
6
+
7
+ completions:
8
+ help: Generate a bash completions function.
9
+ usage: '[PATH]'
10
+ handler: Bashly::Libraries::CompletionsFunction
11
+
12
+ completions_script:
13
+ help: Generate a standalone bash completions script.
14
+ usage: '[PATH]'
15
+ handler: Bashly::Libraries::CompletionsScript
16
+
17
+ completions_yaml:
18
+ help: Generate a completions YAML configuration for Completely.
19
+ usage: '[PATH]'
20
+ handler: Bashly::Libraries::CompletionsYAML
21
+
22
+ config:
23
+ help: Add standard functions for handling INI files to the lib directory.
24
+ files:
25
+ - source: "config/config.sh"
26
+ target: "%{user_lib_dir}/config.%{user_ext}"
27
+
28
+ help:
29
+ help: Add a help command, in addition to the standard --help flag.
30
+ handler: Bashly::Libraries::Help
31
+
32
+ lib:
33
+ help: |-
34
+ Create the lib directory for any additional user scripts.
35
+ All *.sh scripts in this directory will be included in the final bash script.
36
+ Note that if you configured a different partials_extension, then the extensions of the files in this directory need to match.
37
+ files:
38
+ - source: "lib/sample_function.sh"
39
+ target: "%{user_lib_dir}/sample_function.%{user_ext}"
40
+
41
+ settings:
42
+ help: Copy a sample settings.yml file to your project, allowing you to customize some bashly options.
43
+ skip_src_check: true
44
+ files:
45
+ - source: "settings/settings.yml"
46
+ target: "settings.yml"
47
+
48
+ strings:
49
+ help: Copy an additional configuration file to your project, allowing you to customize all the tips and error strings.
50
+ files:
51
+ - source: "strings/strings.yml"
52
+ target: "%{user_source_dir}/bashly-strings.yml"
53
+
54
+ test:
55
+ help: Add approval testing.
56
+ files:
57
+ - source: "test/approvals.bash"
58
+ target: "%{user_target_dir}/test/approvals.bash"
59
+ - source: "test/approve"
60
+ target: "%{user_target_dir}/test/approve"
61
+
62
+ post_install_message: |
63
+ Edit your tests in g`test/approve` and then run:
64
+
65
+ m`$ test/approve`
66
+
67
+ Docs: bu`https://github.com/DannyBen/approvals.bash`
68
+
69
+ validations:
70
+ help: Add argument validation functions to the lib directory.
71
+ files:
72
+ - source: "validations/validate_dir_exists.sh"
73
+ target: "%{user_lib_dir}/validations/validate_dir_exists.%{user_ext}"
74
+ - source: "validations/validate_file_exists.sh"
75
+ target: "%{user_lib_dir}/validations/validate_file_exists.%{user_ext}"
76
+ - source: "validations/validate_integer.sh"
77
+ target: "%{user_lib_dir}/validations/validate_integer.%{user_ext}"
78
+ - source: "validations/validate_not_empty.sh"
79
+ target: "%{user_lib_dir}/validations/validate_not_empty.%{user_ext}"
80
+
81
+ yaml:
82
+ help: Add standard functions for reading YAML files.
83
+ files:
84
+ - source: "yaml/yaml.sh"
85
+ target: "%{user_lib_dir}/yaml.%{user_ext}"
@@ -5,10 +5,16 @@
5
5
  # When setting environment variables, you can use:
6
6
  # - "0", "false" or "no" to represent false
7
7
  # - "1", "true" or "yes" to represent true
8
+ #
9
+ # If you wish to change the path to this file, set the environment variable
10
+ # BASHLY_SETTINGS_PATH.
8
11
 
9
- # The path containing the bashly configuration and source files
12
+ # The path containing the bashly source files
10
13
  source_dir: src
11
14
 
15
+ # Tha path to bashly.yml
16
+ config_path: "%{source_dir}/bashly.yml"
17
+
12
18
  # The path to use for creating the bash script
13
19
  target_dir: .
14
20
 
File without changes
@@ -1,25 +1,12 @@
1
1
  module Bashly
2
2
  class Library
3
- class << self
4
- def exist?(name)
5
- config.has_key? name.to_s
6
- end
7
-
8
- def config
9
- @config ||= YAML.properly_load_file config_path
10
- end
11
-
12
- def config_path
13
- @config_path ||= File.expand_path 'libraries.yml', __dir__
14
- end
15
- end
16
-
17
- include AssetHelper
18
- attr_reader :name, :args
3
+ attr_reader :path, :config, :upgrade_string
4
+ attr_accessor :args
19
5
 
20
- def initialize(name, *args)
21
- @name = name.to_s
22
- @args = args
6
+ def initialize(path, config, upgrade_string: nil)
7
+ @path = path.to_s
8
+ @config = config
9
+ @upgrade_string = upgrade_string
23
10
  end
24
11
 
25
12
  def files
@@ -28,8 +15,10 @@ module Bashly
28
15
 
29
16
  else
30
17
  config['files'].map do |file|
31
- { path: file['target'] % target_file_args,
32
- content: asset_content(file['source']) }
18
+ {
19
+ path: file['target'] % target_file_args,
20
+ content: file_contents("#{path}/#{file['source']}"),
21
+ }
33
22
  end
34
23
  end
35
24
  end
@@ -49,13 +38,13 @@ module Bashly
49
38
  private
50
39
 
51
40
  def custom_handler
52
- return nil unless config.is_a? Symbol
41
+ return nil unless config['handler']
53
42
 
54
- @custom_handler ||= Bashly::Libraries.const_get(config).new(*args)
43
+ @custom_handler ||= Module.const_get(config['handler']).new(*args)
55
44
  end
56
45
 
57
- def config
58
- @config ||= self.class.config[name]
46
+ def file_contents(path)
47
+ File.read(path).sub('[@bashly-upgrade]', "[@bashly-upgrade #{upgrade_string}]")
59
48
  end
60
49
 
61
50
  def target_file_args
@@ -0,0 +1,84 @@
1
+ require 'fileutils'
2
+
3
+ module Bashly
4
+ class LibrarySource
5
+ attr_reader :uri
6
+
7
+ def initialize(uri = nil)
8
+ @uri = uri || File.expand_path('libraries', __dir__)
9
+ transform_github_uri if /^github(:|-)/.match? @uri
10
+ end
11
+
12
+ def git?
13
+ /^(git|github|github-ssh):/.match? uri
14
+ end
15
+
16
+ def config
17
+ @config ||= YAML.properly_load_file config_path
18
+ end
19
+
20
+ def libraries
21
+ config.to_h do |name, spec|
22
+ upgrade_string = "#{uri};#{name}"
23
+ [name.to_sym, Library.new(path, spec, upgrade_string: upgrade_string)]
24
+ end
25
+ end
26
+
27
+ def config_path
28
+ @config_path ||= if File.exist?("#{path}/libraries.yml")
29
+ "#{path}/libraries.yml"
30
+ else
31
+ raise "Cannot find #{path}/libraries.yml"
32
+ end
33
+ end
34
+
35
+ def cleanup
36
+ FileUtils.rm_rf(File.join(Dir.tmpdir, 'bashly-libs-*'))
37
+ end
38
+
39
+ private
40
+
41
+ def path
42
+ @path ||= if uri.start_with? 'git:'
43
+ git_clone
44
+ else
45
+ uri
46
+ end
47
+ end
48
+
49
+ def git_clone
50
+ dir = Dir.mktmpdir 'bashly-libs-'
51
+ safe_run "git clone --quiet #{git_specs[:url]} #{dir}"
52
+ safe_run %[git -C "#{dir}" checkout --quiet #{git_specs[:ref]}] if git_specs[:ref]
53
+
54
+ "#{dir}#{git_specs[:path]}"
55
+ end
56
+
57
+ def git_specs
58
+ @git_specs ||= begin
59
+ parts = uri.match(%r{git:(?<url>.*\.git)(?:/)?(?<path>/[^@]+)?@?(?<ref>.*)})
60
+ raise 'Invalid source' unless parts
61
+
62
+ url = parts[:url]
63
+ raise 'Invalid git URL' unless url
64
+
65
+ path = parts[:path]
66
+ ref = parts[:ref].empty? ? nil : parts[:ref]
67
+
68
+ { url: url, path: path, ref: ref }
69
+ end
70
+ end
71
+
72
+ def safe_run(cmd)
73
+ raise "Failed running command:\nm`#{cmd}`" unless system cmd
74
+ end
75
+
76
+ def transform_github_uri
77
+ if (matches = uri.match(%r{github-ssh:(?<user>[^/]+)/(?<repo>[^/]+)(?<rest>.*)}))
78
+ @uri = "git:git@github.com:#{matches[:user]}/#{matches[:repo]}.git#{matches[:rest]}"
79
+ elsif (matches = uri.match(%r{github:(?<user>[^/]+)/(?<repo>[^/]+)(?<rest>.*)}))
80
+ @uri = "git:https://github.com/#{matches[:user]}/#{matches[:repo]}.git#{matches[:rest]}"
81
+ end
82
+ end
83
+ end
84
+ end
@@ -13,7 +13,7 @@ module Bashly
13
13
  private
14
14
 
15
15
  def values!
16
- defaults = YAML.properly_load_file asset('templates/strings.yml')
16
+ defaults = YAML.properly_load_file asset('libraries/strings/strings.yml')
17
17
  defaults.merge project_strings
18
18
  end
19
19
 
@@ -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
 
@@ -11,9 +11,7 @@ module Bashly
11
11
  extensible expose filename filters flags
12
12
  footer function group help name
13
13
  private version
14
- short
15
14
  ]
16
- # DEPRECATION 0.8.0
17
15
  end
18
16
  end
19
17
 
@@ -36,8 +34,6 @@ module Bashly
36
34
 
37
35
  # Returns an array of alternative aliases if any
38
36
  def alt
39
- # DEPRECATION 0.8.0
40
- options['alias'] ||= options['short']
41
37
  return [] unless options['alias']
42
38
 
43
39
  options['alias'].is_a?(String) ? [options['alias']] : options['alias']
@@ -217,6 +213,16 @@ module Bashly
217
213
  commands.reject(&:private)
218
214
  end
219
215
 
216
+ # Returns only environment variables that are not private
217
+ def public_environment_variables
218
+ environment_variables.reject(&:private)
219
+ end
220
+
221
+ # Returns only flags that are not private
222
+ def public_flags
223
+ flags.reject(&:private)
224
+ end
225
+
220
226
  # Returns true if one of the args is repeatable
221
227
  def repeatable_arg_exist?
222
228
  args.select(&:repeatable).any?
@@ -7,7 +7,7 @@ module Bashly
7
7
  def option_keys
8
8
  @option_keys ||= %i[
9
9
  allowed arg completions conflicts default help long repeatable
10
- required short validate
10
+ required short validate private
11
11
  ]
12
12
  end
13
13
  end
@@ -3,13 +3,26 @@ module Bashly
3
3
  class << self
4
4
  include AssetHelper
5
5
 
6
- attr_writer :compact_short_flags, :lib_dir, :partials_extension,
7
- :source_dir, :strict, :tab_indent, :target_dir, :usage_colors
6
+ attr_writer(
7
+ :compact_short_flags,
8
+ :config_path,
9
+ :lib_dir,
10
+ :partials_extension,
11
+ :source_dir,
12
+ :strict,
13
+ :tab_indent,
14
+ :target_dir,
15
+ :usage_colors
16
+ )
8
17
 
9
18
  def compact_short_flags
10
19
  @compact_short_flags ||= get :compact_short_flags
11
20
  end
12
21
 
22
+ def config_path
23
+ @config_path ||= get(:config_path) % { source_dir: source_dir }
24
+ end
25
+
13
26
  def env
14
27
  @env ||= get(:env)&.to_sym
15
28
  end
@@ -74,7 +87,11 @@ module Bashly
74
87
  end
75
88
 
76
89
  def user_settings
77
- @user_settings ||= File.exist?('settings.yml') ? Config.new('settings.yml') : {}
90
+ @user_settings ||= File.exist?(user_settings_path) ? Config.new(user_settings_path) : {}
91
+ end
92
+
93
+ def user_settings_path
94
+ ENV['BASHLY_SETTINGS_PATH'] || 'settings.yml'
78
95
  end
79
96
 
80
97
  def defsult_settings
@@ -82,7 +99,7 @@ module Bashly
82
99
  end
83
100
 
84
101
  def default_settings_path
85
- asset 'templates/settings.yml'
102
+ asset 'libraries/settings/settings.yml'
86
103
  end
87
104
  end
88
105
  end
@@ -1,3 +1,3 @@
1
1
  module Bashly
2
- VERSION = '0.9.4'
2
+ VERSION = '1.0.0.rc1'
3
3
  end
@@ -3,10 +3,10 @@
3
3
  > if [[ -n $long_usage ]]; then
4
4
  > printf "%s\n" "{{ strings[:options].color(:caption) }}"
5
5
  >
6
+ = render(:usage_flags).indent 2 if public_flags.any?
6
7
  = render(:usage_fixed_flags).indent 2
7
- = render(:usage_flags).indent 2 if flags.any?
8
8
  = render(:usage_args).indent 2 if args.any? or catch_all.help
9
- = render(:usage_environment_variables).indent 2 if environment_variables.any?
9
+ = render(:usage_environment_variables).indent 2 if public_environment_variables.any?
10
10
  = render(:usage_examples).indent 2 if examples
11
11
  = render(:footer).indent 2 if footer
12
12
  >
@@ -3,7 +3,7 @@
3
3
  > printf "%s\n" "{{ strings[:environment_variables].color(:caption) }}"
4
4
  >
5
5
 
6
- environment_variables.reject(&:private).each do |env_var|
6
+ public_environment_variables.each do |env_var|
7
7
  = env_var.render :usage
8
8
  end
9
9
 
@@ -1,6 +1,6 @@
1
1
  = view_marker
2
2
 
3
- flags.each do |flag|
3
+ public_flags.each do |flag|
4
4
  = flag.render :usage
5
5
  end
6
6
 
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: 1.0.0.rc1
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-02-12 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
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 0.8.1
30
+ - - "<"
25
31
  - !ruby/object:Gem::Version
26
- version: 0.5.1
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
@@ -132,7 +138,6 @@ files:
132
138
  - lib/bashly/concerns/validation_helpers.rb
133
139
  - lib/bashly/config.rb
134
140
  - lib/bashly/config_validator.rb
135
- - lib/bashly/deprecation.rb
136
141
  - lib/bashly/docs/arg.yml
137
142
  - lib/bashly/docs/command.yml
138
143
  - lib/bashly/docs/env.yml
@@ -142,13 +147,27 @@ files:
142
147
  - lib/bashly/extensions/file.rb
143
148
  - lib/bashly/extensions/string.rb
144
149
  - lib/bashly/extensions/yaml.rb
145
- - lib/bashly/libraries.yml
146
150
  - lib/bashly/libraries/base.rb
147
- - lib/bashly/libraries/completions_function.rb
148
- - lib/bashly/libraries/completions_script.rb
149
- - lib/bashly/libraries/completions_yaml.rb
150
- - lib/bashly/libraries/help.rb
151
+ - lib/bashly/libraries/colors/colors.sh
152
+ - lib/bashly/libraries/completions/completions_function.rb
153
+ - lib/bashly/libraries/completions/completions_script.rb
154
+ - lib/bashly/libraries/completions/completions_yaml.rb
155
+ - lib/bashly/libraries/config/config.sh
156
+ - lib/bashly/libraries/help/help.rb
157
+ - lib/bashly/libraries/help/help_command.sh
158
+ - lib/bashly/libraries/lib/sample_function.sh
159
+ - lib/bashly/libraries/libraries.yml
160
+ - lib/bashly/libraries/settings/settings.yml
161
+ - lib/bashly/libraries/strings/strings.yml
162
+ - lib/bashly/libraries/test/approvals.bash
163
+ - lib/bashly/libraries/test/approve
164
+ - lib/bashly/libraries/validations/validate_dir_exists.sh
165
+ - lib/bashly/libraries/validations/validate_file_exists.sh
166
+ - lib/bashly/libraries/validations/validate_integer.sh
167
+ - lib/bashly/libraries/validations/validate_not_empty.sh
168
+ - lib/bashly/libraries/yaml/yaml.sh
151
169
  - lib/bashly/library.rb
170
+ - lib/bashly/library_source.rb
152
171
  - lib/bashly/message_strings.rb
153
172
  - lib/bashly/refinements/compose_refinements.rb
154
173
  - lib/bashly/script/argument.rb
@@ -160,20 +179,7 @@ files:
160
179
  - lib/bashly/script/wrapper.rb
161
180
  - lib/bashly/settings.rb
162
181
  - lib/bashly/templates/bashly.yml
163
- - lib/bashly/templates/help/help_command.sh
164
- - lib/bashly/templates/lib/colors.sh
165
- - lib/bashly/templates/lib/config.sh
166
- - lib/bashly/templates/lib/sample_function.sh
167
- - lib/bashly/templates/lib/validations/validate_dir_exists.sh
168
- - lib/bashly/templates/lib/validations/validate_file_exists.sh
169
- - lib/bashly/templates/lib/validations/validate_integer.sh
170
- - lib/bashly/templates/lib/validations/validate_not_empty.sh
171
- - lib/bashly/templates/lib/yaml.sh
172
182
  - lib/bashly/templates/minimal.yml
173
- - lib/bashly/templates/settings.yml
174
- - lib/bashly/templates/strings.yml
175
- - lib/bashly/templates/test/approvals.bash
176
- - lib/bashly/templates/test/approve
177
183
  - lib/bashly/version.rb
178
184
  - lib/bashly/views/README.md
179
185
  - lib/bashly/views/argument/usage.gtx
@@ -248,11 +254,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
248
254
  version: 2.7.0
249
255
  required_rubygems_version: !ruby/object:Gem::Requirement
250
256
  requirements:
251
- - - ">="
257
+ - - ">"
252
258
  - !ruby/object:Gem::Version
253
- version: '0'
259
+ version: 1.3.1
254
260
  requirements: []
255
- rubygems_version: 3.4.0
261
+ rubygems_version: 3.4.6
256
262
  signing_key:
257
263
  specification_version: 4
258
264
  summary: Bash Command Line Tool Generator
@@ -1,27 +0,0 @@
1
- module Bashly
2
- class Deprecation
3
- attr_reader :old, :replacement, :reference
4
-
5
- def initialize(old, replacement: nil, reference: nil)
6
- @old = old
7
- @replacement = replacement
8
- @reference = reference
9
- end
10
-
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
15
-
16
- result.map { |line| "!txtred!▐!txtrst! #{line}" }.join("\n")
17
- end
18
-
19
- def to_h
20
- {
21
- old: old,
22
- replacement: replacement,
23
- reference: reference,
24
- }
25
- end
26
- end
27
- end