bashly 1.4.0.rc2 → 2.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/lib/bashly/commands/completions.rb +3 -41
  3. data/lib/bashly/completions/README.md +3 -7
  4. data/lib/bashly/completions/bashly-completions.bash +178 -382
  5. data/lib/bashly/completions/completely.yaml +2 -4
  6. data/lib/bashly/config_validator.rb +55 -5
  7. data/lib/bashly/docs/arg.yml +12 -6
  8. data/lib/bashly/docs/command.yml +0 -12
  9. data/lib/bashly/docs/flag.yml +29 -5
  10. data/lib/bashly/libraries/libraries.yml +0 -15
  11. data/lib/bashly/libraries/settings/settings.yml +9 -1
  12. data/lib/bashly/script/argument.rb +12 -0
  13. data/lib/bashly/script/command.rb +1 -2
  14. data/lib/bashly/script/flag.rb +48 -11
  15. data/lib/bashly/script/introspection/commands.rb +5 -0
  16. data/lib/bashly/script/wrapper.rb +1 -1
  17. data/lib/bashly/settings.rb +28 -3
  18. data/lib/bashly/version.rb +1 -1
  19. data/lib/bashly/views/argument/completion.gtx +31 -0
  20. data/lib/bashly/views/argument/completion_filter.gtx +1 -0
  21. data/lib/bashly/views/command/completion_argument_candidates.gtx +11 -0
  22. data/lib/bashly/views/command/completion_argument_filter.gtx +25 -0
  23. data/lib/bashly/views/command/completion_command_candidates.gtx +3 -0
  24. data/lib/bashly/views/command/completion_flag_candidates.gtx +21 -0
  25. data/lib/bashly/views/command/completion_function.gtx +24 -0
  26. data/lib/bashly/views/command/completion_script.gtx +21 -0
  27. data/lib/bashly/views/command/completion_script_bash.gtx +63 -0
  28. data/lib/bashly/views/command/completion_script_zsh.gtx +52 -0
  29. data/lib/bashly/views/command/completion_word_filter.gtx +44 -0
  30. data/lib/bashly/views/command/completions.gtx +81 -0
  31. data/lib/bashly/views/command/inspect_args.gtx +3 -3
  32. data/lib/bashly/views/command/master_script.gtx +1 -0
  33. data/lib/bashly/views/command/start.gtx +9 -0
  34. data/lib/bashly/views/flag/argfile_case.gtx +8 -1
  35. data/lib/bashly/views/flag/case.gtx +9 -1
  36. data/lib/bashly/views/flag/completion.gtx +1 -0
  37. data/lib/bashly/views/flag/completion_filter.gtx +7 -0
  38. data/lib/bashly/views/flag/completion_filter_arg.gtx +10 -0
  39. data/lib/bashly/views/flag/completion_filter_block.gtx +8 -0
  40. data/lib/bashly/views/flag/completion_filter_no_arg.gtx +2 -0
  41. data/lib/bashly/views/flag/completion_value_candidates.gtx +31 -0
  42. data/lib/bashly.rb +2 -5
  43. metadata +22 -37
  44. data/lib/bashly/completion_builder.rb +0 -231
  45. data/lib/bashly/concerns/completions.rb +0 -48
  46. data/lib/bashly/libraries/completions/completions_function.rb +0 -37
  47. data/lib/bashly/libraries/completions/completions_script.rb +0 -28
  48. data/lib/bashly/libraries/completions/completions_yaml.rb +0 -26
  49. /data/lib/bashly/views/wrapper/{bash3_bouncer.gtx → bash_version_bouncer.gtx} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 77fc095074710d1003657f7ee7360e06e6864c9142d283d8bab88a9776fc737f
4
- data.tar.gz: fae57e0c6bdf23a09d83bb280a4161b2e4b0de0e46518a44a1c36f902f9993cb
3
+ metadata.gz: 6e96439b1894f3097d9c8ea8d49b42254075a41bf02b233aa7d57674030e2d7f
4
+ data.tar.gz: 14963288238d456e105ce739fdc076d0bb950f497a234851725ba3f887a4a982
5
5
  SHA512:
6
- metadata.gz: a23dd4c92491a97aef54990418b930ae38ce826ede3bf1352c18f99ac8c53d5391e613eef113f5996c2757a60d5c9ebf96fe7e277e69a6a07456d02df35c2b28
7
- data.tar.gz: 369a787f5851da5ac1b07afe6f7ddb985ebd64fc3ffe08aa5379376b3f8ddbc53e313dc31ba832096361a15ebf5aa973d6fd4dabfe64d7f8c6249799a9a7e1f9
6
+ metadata.gz: 474e72b43adcba1b0860f123be0584dbf8d7d7d14797f44018603f6f805e6a792b92282201d7930383e40ff48d771094e339e0c279c12940558a17d07dc09f06
7
+ data.tar.gz: 343351f0dbcb3d182ef2050e99a22f2ff39a1839ba11b208712c3cb85178f44678628f05ac1d2b2a4370e2dc77055f66972d16e94f5a4122dff409b937d9e956
@@ -1,55 +1,17 @@
1
- require 'completely'
2
-
3
1
  module Bashly
4
2
  module Commands
5
3
  class Completions < Base
6
- summary 'Install bash completions for bashly itself'
7
- help 'Display the bash completions script or install it directly to your bash completions directory'
4
+ summary 'Display bash completions for bashly itself'
8
5
 
9
- usage 'bashly completions [--install|--uninstall]'
6
+ usage 'bashly completions'
10
7
  usage 'bashly completions (-h|--help)'
11
8
 
12
- option '-i --install', 'Install the completions script to your bash completions directory'
13
- option '-u --uninstall', 'Uninstall the completions script from your bash completions directory'
14
-
15
9
  def run
16
- if args['--install']
17
- install_completions
18
- elsif args['--uninstall']
19
- uninstall_completions
20
- else
21
- puts script
22
- end
23
- end
24
-
25
- def installer
26
- @installer ||= Completely::Installer.new program: 'bashly', script_path: script_path
10
+ puts script
27
11
  end
28
12
 
29
13
  private
30
14
 
31
- def install_completions
32
- success = installer.install force: true
33
- raise Error, "Failed running command:\nnb`#{installer.install_command_string}`" unless success
34
-
35
- say 'Completions installed'
36
- say "Source: m`#{installer.script_path}`"
37
- say "Target: m`#{installer.target_path}`"
38
- say 'Restart your session for the changes to take effect'
39
- end
40
-
41
- def uninstall_completions
42
- success = installer.uninstall
43
- raise Error, "Failed running command:\nnb`#{installer.uninstall_command_string}`" unless success
44
-
45
- say 'Completions uninstalled'
46
- say 'Restart your session for the changes to take effect'
47
- end
48
-
49
- def script_path
50
- @script_path ||= asset('completions/bashly-completions.bash')
51
- end
52
-
53
15
  def script
54
16
  @script ||= asset_content('completions/bashly-completions.bash')
55
17
  end
@@ -15,10 +15,6 @@ Note that for production use, only the `bashly-completions.bash` is used.
15
15
 
16
16
  ## For users
17
17
 
18
- Install completions in one of two ways:
19
-
20
- 1. Run `bashly completions --install`. This will make a best effort to copy
21
- the completions script to your completions directory.
22
- 2. If the above fails, run `bashly completions > out.bash`, then copy the file
23
- manually to your completions directory (or simply get the
24
- `bashly-completions.bash` from this directory).
18
+ Run `bashly completions > out.bash`, then copy the file manually to your
19
+ completions directory (or simply get the `bashly-completions.bash` from this
20
+ directory).