tabry 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +7 -0
  2. data/bin/tabry-bash +48 -0
  3. data/bin/tabry-help +17 -0
  4. data/bin/tabry-test-options +9 -0
  5. data/bin/tabry-test-parse +20 -0
  6. data/lib/tabry/cli/arg_proxy.rb +71 -0
  7. data/lib/tabry/cli/base.rb +34 -0
  8. data/lib/tabry/cli/builder.rb +104 -0
  9. data/lib/tabry/cli/flag_proxy.rb +45 -0
  10. data/lib/tabry/cli/internals.rb +10 -0
  11. data/lib/tabry/cli/util/config.rb +48 -0
  12. data/lib/tabry/cli/util.rb +51 -0
  13. data/lib/tabry/config_loader.rb +55 -0
  14. data/lib/tabry/core_ext/string/colors.rb +91 -0
  15. data/lib/tabry/machine.rb +124 -0
  16. data/lib/tabry/models/arg.rb +43 -0
  17. data/lib/tabry/models/arg_base.rb +10 -0
  18. data/lib/tabry/models/arg_include.rb +9 -0
  19. data/lib/tabry/models/arg_includes.rb +14 -0
  20. data/lib/tabry/models/args_list.rb +31 -0
  21. data/lib/tabry/models/config.rb +44 -0
  22. data/lib/tabry/models/config_error.rb +8 -0
  23. data/lib/tabry/models/config_list.rb +48 -0
  24. data/lib/tabry/models/config_object.rb +78 -0
  25. data/lib/tabry/models/config_string_hash.rb +44 -0
  26. data/lib/tabry/models/const_option.rb +17 -0
  27. data/lib/tabry/models/dir_option.rb +25 -0
  28. data/lib/tabry/models/file_option.rb +25 -0
  29. data/lib/tabry/models/flag.rb +55 -0
  30. data/lib/tabry/models/flags_list.rb +47 -0
  31. data/lib/tabry/models/include_arg.rb +18 -0
  32. data/lib/tabry/models/include_flag.rb +18 -0
  33. data/lib/tabry/models/include_option.rb +22 -0
  34. data/lib/tabry/models/include_sub.rb +18 -0
  35. data/lib/tabry/models/option.rb +33 -0
  36. data/lib/tabry/models/option_base.rb +20 -0
  37. data/lib/tabry/models/option_includes.rb +14 -0
  38. data/lib/tabry/models/options_list.rb +18 -0
  39. data/lib/tabry/models/shell_option.rb +13 -0
  40. data/lib/tabry/models/sub.rb +59 -0
  41. data/lib/tabry/models/subs_list.rb +28 -0
  42. data/lib/tabry/options_finder.rb +87 -0
  43. data/lib/tabry/result.rb +110 -0
  44. data/lib/tabry/runner.rb +27 -0
  45. data/lib/tabry/state.rb +14 -0
  46. data/lib/tabry/usage_generator.rb +137 -0
  47. data/lib/tabry/util.rb +15 -0
  48. data/sh/tabry_bash.sh +61 -0
  49. data/sh/tabry_bash_help.sh +7 -0
  50. data/spec/fixtures/basiccli.json +1 -0
  51. data/spec/fixtures/basiccli.tabry +5 -0
  52. data/spec/fixtures/basiccli2.tabry +5 -0
  53. data/spec/fixtures/basiccli2.yml +7 -0
  54. data/spec/fixtures/vehicles.tabry +60 -0
  55. data/spec/fixtures/vehicles.yaml +135 -0
  56. data/spec/spec_helper.rb +10 -0
  57. data/spec/tabry/cli/arg_proxy_spec.rb +76 -0
  58. data/spec/tabry/cli/builder_spec.rb +226 -0
  59. data/spec/tabry/config_loader_spec.rb +69 -0
  60. data/spec/tabry/machine_spec.rb +109 -0
  61. data/spec/tabry/models/args_list_spec.rb +36 -0
  62. data/spec/tabry/models/config_spec.rb +62 -0
  63. data/spec/tabry/models/const_option_spec.rb +17 -0
  64. data/spec/tabry/models/dir_option_spec.rb +16 -0
  65. data/spec/tabry/models/file_option_spec.rb +16 -0
  66. data/spec/tabry/models/options_list_spec.rb +47 -0
  67. data/spec/tabry/models/shell_option_spec.rb +19 -0
  68. data/spec/tabry/models/subs_list_spec.rb +24 -0
  69. data/spec/tabry/options_finder_spec.rb +91 -0
  70. data/spec/tabry/result_spec.rb +236 -0
  71. data/spec/tabry/runner_spec.rb +35 -0
  72. data/spec/tabry/usage_generator_spec.rb +67 -0
  73. data/tabry.gemspec +27 -0
  74. metadata +189 -0
data/tabry.gemspec ADDED
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ # TODO: these 2 lines are cargo cult
4
+ lib = File.expand_path("lib", __dir__)
5
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
6
+
7
+ Gem::Specification.new do |s|
8
+ s.name = "tabry"
9
+ s.version = "0.1.0"
10
+ s.summary = "Tab completion and CLIs extraordinaire"
11
+ s.authors = ["Evan Battaglia"]
12
+ s.email = "battaglia.evan@gmail.com"
13
+ s.homepage = "https://github.com/evanbattaglia/tabry"
14
+ s.license = "MIT"
15
+
16
+ s.files = Dir.glob("{lib,bin,sh,spec}/**/*") + %w[tabry.gemspec]
17
+ # TODO: more cargo cult possibly:
18
+ s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+
21
+ s.add_development_dependency "pry-byebug", "~> 3.10"
22
+ s.add_development_dependency "rspec", "~> 3.10"
23
+ s.add_development_dependency "rubocop", "~> 1.22"
24
+ s.add_development_dependency "rubocop-rspec", "~> 2.6"
25
+ s.add_development_dependency "simplecov", "~> 0.12"
26
+ s.metadata["rubygems_mfa_required"] = "true"
27
+ end
metadata ADDED
@@ -0,0 +1,189 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: tabry
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Evan Battaglia
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2022-08-25 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: pry-byebug
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.10'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.10'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '3.10'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '3.10'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rubocop
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.22'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.22'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop-rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '2.6'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '2.6'
69
+ - !ruby/object:Gem::Dependency
70
+ name: simplecov
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0.12'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.12'
83
+ description:
84
+ email: battaglia.evan@gmail.com
85
+ executables:
86
+ - tabry-bash
87
+ - tabry-help
88
+ - tabry-test-options
89
+ - tabry-test-parse
90
+ extensions: []
91
+ extra_rdoc_files: []
92
+ files:
93
+ - bin/tabry-bash
94
+ - bin/tabry-help
95
+ - bin/tabry-test-options
96
+ - bin/tabry-test-parse
97
+ - lib/tabry/cli/arg_proxy.rb
98
+ - lib/tabry/cli/base.rb
99
+ - lib/tabry/cli/builder.rb
100
+ - lib/tabry/cli/flag_proxy.rb
101
+ - lib/tabry/cli/internals.rb
102
+ - lib/tabry/cli/util.rb
103
+ - lib/tabry/cli/util/config.rb
104
+ - lib/tabry/config_loader.rb
105
+ - lib/tabry/core_ext/string/colors.rb
106
+ - lib/tabry/machine.rb
107
+ - lib/tabry/models/arg.rb
108
+ - lib/tabry/models/arg_base.rb
109
+ - lib/tabry/models/arg_include.rb
110
+ - lib/tabry/models/arg_includes.rb
111
+ - lib/tabry/models/args_list.rb
112
+ - lib/tabry/models/config.rb
113
+ - lib/tabry/models/config_error.rb
114
+ - lib/tabry/models/config_list.rb
115
+ - lib/tabry/models/config_object.rb
116
+ - lib/tabry/models/config_string_hash.rb
117
+ - lib/tabry/models/const_option.rb
118
+ - lib/tabry/models/dir_option.rb
119
+ - lib/tabry/models/file_option.rb
120
+ - lib/tabry/models/flag.rb
121
+ - lib/tabry/models/flags_list.rb
122
+ - lib/tabry/models/include_arg.rb
123
+ - lib/tabry/models/include_flag.rb
124
+ - lib/tabry/models/include_option.rb
125
+ - lib/tabry/models/include_sub.rb
126
+ - lib/tabry/models/option.rb
127
+ - lib/tabry/models/option_base.rb
128
+ - lib/tabry/models/option_includes.rb
129
+ - lib/tabry/models/options_list.rb
130
+ - lib/tabry/models/shell_option.rb
131
+ - lib/tabry/models/sub.rb
132
+ - lib/tabry/models/subs_list.rb
133
+ - lib/tabry/options_finder.rb
134
+ - lib/tabry/result.rb
135
+ - lib/tabry/runner.rb
136
+ - lib/tabry/state.rb
137
+ - lib/tabry/usage_generator.rb
138
+ - lib/tabry/util.rb
139
+ - sh/tabry_bash.sh
140
+ - sh/tabry_bash_help.sh
141
+ - spec/fixtures/basiccli.json
142
+ - spec/fixtures/basiccli.tabry
143
+ - spec/fixtures/basiccli2.tabry
144
+ - spec/fixtures/basiccli2.yml
145
+ - spec/fixtures/vehicles.tabry
146
+ - spec/fixtures/vehicles.yaml
147
+ - spec/spec_helper.rb
148
+ - spec/tabry/cli/arg_proxy_spec.rb
149
+ - spec/tabry/cli/builder_spec.rb
150
+ - spec/tabry/config_loader_spec.rb
151
+ - spec/tabry/machine_spec.rb
152
+ - spec/tabry/models/args_list_spec.rb
153
+ - spec/tabry/models/config_spec.rb
154
+ - spec/tabry/models/const_option_spec.rb
155
+ - spec/tabry/models/dir_option_spec.rb
156
+ - spec/tabry/models/file_option_spec.rb
157
+ - spec/tabry/models/options_list_spec.rb
158
+ - spec/tabry/models/shell_option_spec.rb
159
+ - spec/tabry/models/subs_list_spec.rb
160
+ - spec/tabry/options_finder_spec.rb
161
+ - spec/tabry/result_spec.rb
162
+ - spec/tabry/runner_spec.rb
163
+ - spec/tabry/usage_generator_spec.rb
164
+ - tabry.gemspec
165
+ homepage: https://github.com/evanbattaglia/tabry
166
+ licenses:
167
+ - MIT
168
+ metadata:
169
+ rubygems_mfa_required: 'true'
170
+ post_install_message:
171
+ rdoc_options: []
172
+ require_paths:
173
+ - lib
174
+ required_ruby_version: !ruby/object:Gem::Requirement
175
+ requirements:
176
+ - - ">="
177
+ - !ruby/object:Gem::Version
178
+ version: '0'
179
+ required_rubygems_version: !ruby/object:Gem::Requirement
180
+ requirements:
181
+ - - ">="
182
+ - !ruby/object:Gem::Version
183
+ version: '0'
184
+ requirements: []
185
+ rubygems_version: 3.2.15
186
+ signing_key:
187
+ specification_version: 4
188
+ summary: Tab completion and CLIs extraordinaire
189
+ test_files: []