bashly 0.7.0 → 0.7.4

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/lib/bashly/cli.rb +1 -0
  3. data/lib/bashly/commands/add.rb +14 -25
  4. data/lib/bashly/commands/generate.rb +20 -19
  5. data/lib/bashly/commands/validate.rb +19 -0
  6. data/lib/bashly/concerns/command_scopes.rb +68 -0
  7. data/lib/bashly/config_validator.rb +143 -0
  8. data/lib/bashly/extensions/string.rb +4 -0
  9. data/lib/bashly/libraries/base.rb +19 -0
  10. data/lib/bashly/libraries/completions.rb +14 -0
  11. data/lib/bashly/{library → libraries}/completions_function.rb +18 -6
  12. data/lib/bashly/libraries/completions_script.rb +29 -0
  13. data/lib/bashly/libraries/completions_yaml.rb +27 -0
  14. data/lib/bashly/libraries.yml +39 -0
  15. data/lib/bashly/library.rb +63 -0
  16. data/lib/bashly/refinements/compose_refinements.rb +45 -0
  17. data/lib/bashly/script/base.rb +5 -3
  18. data/lib/bashly/script/catch_all.rb +49 -0
  19. data/lib/bashly/script/command.rb +9 -111
  20. data/lib/bashly/version.rb +1 -1
  21. data/lib/bashly/views/command/catch_all_filter.erb +2 -2
  22. data/lib/bashly/views/command/command_filter.erb +1 -1
  23. data/lib/bashly/views/command/default_assignments.erb +2 -2
  24. data/lib/bashly/views/command/default_initialize_script.erb +6 -6
  25. data/lib/bashly/views/command/default_root_script.erb +1 -1
  26. data/lib/bashly/views/command/environment_variables_filter.erb +1 -1
  27. data/lib/bashly/views/command/fixed_flags_filter.erb +1 -1
  28. data/lib/bashly/views/command/initialize.erb +1 -1
  29. data/lib/bashly/views/command/parse_requirements.erb +1 -0
  30. data/lib/bashly/views/command/parse_requirements_case.erb +2 -2
  31. data/lib/bashly/views/command/parse_requirements_while.erb +2 -2
  32. data/lib/bashly/views/command/root_command.erb +1 -1
  33. data/lib/bashly/views/command/run.erb +4 -4
  34. data/lib/bashly/views/command/usage.erb +1 -1
  35. data/lib/bashly/views/command/usage_args.erb +3 -3
  36. data/lib/bashly/views/command/usage_commands.erb +1 -1
  37. data/lib/bashly/views/command/user_filter.erb +11 -0
  38. data/lib/bashly.rb +2 -1
  39. metadata +18 -16
  40. data/lib/bashly/library/base.rb +0 -57
  41. data/lib/bashly/library/colors.rb +0 -9
  42. data/lib/bashly/library/completions.rb +0 -28
  43. data/lib/bashly/library/completions_script.rb +0 -17
  44. data/lib/bashly/library/completions_yaml.rb +0 -15
  45. data/lib/bashly/library/config.rb +0 -9
  46. data/lib/bashly/library/sample.rb +0 -9
  47. data/lib/bashly/library/strings.rb +0 -12
  48. data/lib/bashly/library/validations.rb +0 -9
  49. data/lib/bashly/library/yaml.rb +0 -9
@@ -1,28 +0,0 @@
1
- module Bashly
2
- module Library
3
- class Completions < Base
4
- def content
5
- { path: target_path, content: file_content }
6
- end
7
-
8
- def file_content
9
- raise NotImplementedError, "Please implement #file_content"
10
- end
11
-
12
- protected
13
-
14
- def completions
15
- @completions ||= command.completion_data
16
- end
17
-
18
- def config
19
- @config ||= Bashly::Config.new "#{Settings.source_dir}/bashly.yml"
20
- end
21
-
22
- def command
23
- @command ||= Script::Command.new config
24
- end
25
-
26
- end
27
- end
28
- end
@@ -1,17 +0,0 @@
1
- module Bashly
2
- module Library
3
- class CompletionsScript < Completions
4
- def file_content
5
- command.completion_script
6
- end
7
-
8
- def post_install_message
9
- <<~EOF
10
- In order to enable completions, run:
11
-
12
- !txtpur!$ source #{target_path}
13
- EOF
14
- end
15
- end
16
- end
17
- end
@@ -1,15 +0,0 @@
1
- module Bashly
2
- module Library
3
- class CompletionsYAML < Completions
4
- def file_content
5
- completions.to_yaml
6
- end
7
-
8
- def post_install_message
9
- <<~EOF
10
- This file can be converted to a completions script using the !txtgrn!completely!txtrst! gem.
11
- EOF
12
- end
13
- end
14
- end
15
- end
@@ -1,9 +0,0 @@
1
- module Bashly
2
- module Library
3
- class Config < Base
4
- def content
5
- "config.sh"
6
- end
7
- end
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- module Bashly
2
- module Library
3
- class Sample < Base
4
- def content
5
- "sample_function.sh"
6
- end
7
- end
8
- end
9
- end
@@ -1,12 +0,0 @@
1
- module Bashly
2
- module Library
3
- class Strings < Base
4
- def content
5
- {
6
- path: "#{target_path}/bashly-strings.yml",
7
- content: asset_content("templates/strings.yml")
8
- }
9
- end
10
- end
11
- end
12
- end
@@ -1,9 +0,0 @@
1
- module Bashly
2
- module Library
3
- class Validations < Base
4
- def content
5
- "validations"
6
- end
7
- end
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- module Bashly
2
- module Library
3
- class YAML < Base
4
- def content
5
- "yaml.sh"
6
- end
7
- end
8
- end
9
- end