rbcli 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +3 -1
  3. data/README.md +50 -6
  4. data/exe/rbcli +81 -32
  5. data/lib/rbcli/configuration/config.rb +6 -6
  6. data/lib/rbcli/configuration/configurate.rb +1 -1
  7. data/lib/rbcli/engine/load_project.rb +19 -0
  8. data/lib/rbcli/engine/parser.rb +2 -2
  9. data/lib/rbcli/logging/logging.rb +7 -4
  10. data/lib/rbcli/stateful_systems/state_storage.rb +4 -0
  11. data/lib/rbcli/version.rb +1 -1
  12. data/lib/rbcli-tool/erb_renderer.rb +43 -0
  13. data/lib/rbcli-tool/mdless_fix.rb +386 -0
  14. data/lib/rbcli-tool/project.rb +87 -0
  15. data/lib/rbcli-tool.rb +16 -0
  16. data/lib/rbcli.rb +11 -10
  17. data/rbcli.gemspec +1 -0
  18. data/skeletons/micro/executable +123 -0
  19. data/skeletons/mini/executable +241 -0
  20. data/skeletons/project/.gitignore +11 -0
  21. data/skeletons/project/.rbcli +0 -0
  22. data/skeletons/project/.rspec +3 -0
  23. data/skeletons/project/CODE_OF_CONDUCT.md +74 -0
  24. data/skeletons/project/Gemfile +6 -0
  25. data/skeletons/project/README.md +31 -0
  26. data/skeletons/project/Rakefile +6 -0
  27. data/skeletons/project/application/commands/command.rb +31 -0
  28. data/skeletons/project/application/commands/scripts/script.sh +23 -0
  29. data/skeletons/project/application/options.rb +30 -0
  30. data/skeletons/project/config/autoupdate.rb +32 -0
  31. data/skeletons/project/config/logging.rb +19 -0
  32. data/skeletons/project/config/storage.rb +34 -0
  33. data/skeletons/project/config/userspace.rb +28 -0
  34. data/skeletons/project/config/version.rb +3 -0
  35. data/skeletons/project/default_user_configs/user_defaults.yml +6 -0
  36. data/skeletons/project/exe/executable +54 -0
  37. data/skeletons/project/hooks/default_action.rb +16 -0
  38. data/skeletons/project/hooks/first_run.rb +16 -0
  39. data/skeletons/project/hooks/post_execution.rb +14 -0
  40. data/skeletons/project/hooks/pre_execution.rb +14 -0
  41. data/skeletons/project/spec/spec_helper.rb +14 -0
  42. data/skeletons/project/spec/untitled_spec.rb +9 -0
  43. data/skeletons/project/untitled.gemspec +40 -0
  44. metadata +47 -2
@@ -0,0 +1,16 @@
1
+ Rbcli::Configurate.me do
2
+ ####
3
+ # HOOKS
4
+ ###
5
+ # Here you can set hooks that will be run at specified points in the execution chain.
6
+ # Global CLI options are made available to many of the hooks, but command parameters and lineitems are not.
7
+ ###
8
+
9
+ ## Default Action -- (Optional) -- The default code to execute when no subcommand is given.
10
+ # If not present, the help is shown (same as -h)
11
+
12
+ default_action do |opts|
13
+ puts "Hello, #{opts[:name]}."
14
+ puts "To see the help, use -h"
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ Rbcli::Configurate.me do
2
+ ####
3
+ # HOOKS
4
+ ###
5
+ # Here you can set hooks that will be run at specified points in the execution chain.
6
+ # Global CLI options are made available to many of the hooks, but command parameters and lineitems are not.
7
+ ###
8
+
9
+ ## First-Run Hook -- (Optional) -- Allows providing a block of code that executes the first time that the application is run on a given system.
10
+ # If `halt_after_running` is set to `true` then parsing will not continue after this code is executed. All subsequent runs will not execute this code.
11
+ # This feature is dependent on the Local State Storage system, and will not run without it.
12
+
13
+ first_run halt_after_running: false do
14
+ puts "This is the first time the mytool command is run! Don't forget to generate a config file with the `-g` option before continuing."
15
+ end
16
+ end
@@ -0,0 +1,14 @@
1
+ Rbcli::Configurate.me do
2
+ ####
3
+ # HOOKS
4
+ ###
5
+ # Here you can set hooks that will be run at specified points in the execution chain.
6
+ # Global CLI options are made available to many of the hooks, but command parameters and lineitems are not.
7
+ ###
8
+
9
+ ## Post-Execution Hook -- (Optional) -- Allows providing a block of code that runs _after_ all commands
10
+
11
+ post_hook do |opts|
12
+ puts 'This is a post-command hook. It executes after the command.'
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ Rbcli::Configurate.me do
2
+ ####
3
+ # HOOKS
4
+ ###
5
+ # Here you can set hooks that will be run at specified points in the execution chain.
6
+ # Global CLI options are made available to many of the hooks, but command parameters and lineitems are not.
7
+ ###
8
+
9
+ ## Pre-Execution Hook -- (Optional) -- Allows providing a block of code that runs _before_ all commands
10
+
11
+ pre_hook do |opts|
12
+ puts 'This is a pre-command hook. It executes before the command.'
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ require "bundler/setup"
2
+ require "untitled"
3
+
4
+ RSpec.configure do |config|
5
+ # Enable flags like --only-failures and --next-failure
6
+ config.example_status_persistence_file_path = ".rspec_status"
7
+
8
+ # Disable RSpec exposing methods globally on `Module` and `main`
9
+ config.disable_monkey_patching!
10
+
11
+ config.expect_with :rspec do |c|
12
+ c.syntax = :expect
13
+ end
14
+ end
@@ -0,0 +1,9 @@
1
+ RSpec.describe Project do
2
+ it "has a version number" do
3
+ expect(Project::VERSION).not_to be nil
4
+ end
5
+
6
+ it "does something useful" do
7
+ expect(false).to eq(true)
8
+ end
9
+ end
@@ -0,0 +1,40 @@
1
+
2
+ config = File.expand_path("../config", __FILE__)
3
+ $LOAD_PATH.unshift(config) unless $LOAD_PATH.include?(config)
4
+ require 'config/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "<%= @vars[:cmdname] %>"
8
+ spec.version = Project::VERSION
9
+ spec.authors = ["TODO: Your Name Here"]
10
+ spec.email = ["TODO: Your Email Here"]
11
+
12
+ spec.summary = %q{TODO: Write a short summary, because RubyGems requires one.}
13
+ spec.description = %q{TODO: Write a longer description or delete this line.}
14
+ spec.homepage = "TODO: Put your gem's website or public repo URL here."
15
+ spec.license = nil
16
+
17
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
19
+ if spec.respond_to?(:metadata)
20
+ spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
21
+ else
22
+ raise "RubyGems 2.0 or newer is required to protect against " \
23
+ "public gem pushes."
24
+ end
25
+
26
+ # Specify which files should be added to the gem when it is released.
27
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
28
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
29
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
30
+ end
31
+ spec.bindir = "exe"
32
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
33
+ spec.require_paths = ["application", "config", "default_user_configs", "hooks"]
34
+
35
+ spec.add_development_dependency "bundler", "~> 1.16"
36
+ spec.add_development_dependency "rake", "~> 10.0"
37
+ spec.add_development_dependency "rspec", "~> 3.0"
38
+
39
+ spec.add_dependency "rbcli", ">= <%= @vars[:rbcli_version] %>"
40
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbcli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Khoury
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-06-12 00:00:00.000000000 Z
11
+ date: 2018-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -136,6 +136,20 @@ dependencies:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
138
  version: '4.9'
139
+ - !ruby/object:Gem::Dependency
140
+ name: mdless
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '0.0'
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '0.0'
139
153
  description: RBCli is a framework to quickly develop command-line tools.
140
154
  email:
141
155
  - akhoury@live.com
@@ -158,6 +172,10 @@ files:
158
172
  - examples/myscript.sh
159
173
  - examples/mytool
160
174
  - exe/rbcli
175
+ - lib/rbcli-tool.rb
176
+ - lib/rbcli-tool/erb_renderer.rb
177
+ - lib/rbcli-tool/mdless_fix.rb
178
+ - lib/rbcli-tool/project.rb
161
179
  - lib/rbcli.rb
162
180
  - lib/rbcli/autoupdate/autoupdate.rb
163
181
  - lib/rbcli/autoupdate/gem_updater.rb
@@ -165,6 +183,7 @@ files:
165
183
  - lib/rbcli/configuration/config.rb
166
184
  - lib/rbcli/configuration/configurate.rb
167
185
  - lib/rbcli/engine/command.rb
186
+ - lib/rbcli/engine/load_project.rb
168
187
  - lib/rbcli/engine/parser.rb
169
188
  - lib/rbcli/logging/logging.rb
170
189
  - lib/rbcli/scriptwrapping/scriptwrapper.rb
@@ -178,6 +197,32 @@ files:
178
197
  - lib/rbcli/util/trollop.rb
179
198
  - lib/rbcli/version.rb
180
199
  - rbcli.gemspec
200
+ - skeletons/micro/executable
201
+ - skeletons/mini/executable
202
+ - skeletons/project/.gitignore
203
+ - skeletons/project/.rbcli
204
+ - skeletons/project/.rspec
205
+ - skeletons/project/CODE_OF_CONDUCT.md
206
+ - skeletons/project/Gemfile
207
+ - skeletons/project/README.md
208
+ - skeletons/project/Rakefile
209
+ - skeletons/project/application/commands/command.rb
210
+ - skeletons/project/application/commands/scripts/script.sh
211
+ - skeletons/project/application/options.rb
212
+ - skeletons/project/config/autoupdate.rb
213
+ - skeletons/project/config/logging.rb
214
+ - skeletons/project/config/storage.rb
215
+ - skeletons/project/config/userspace.rb
216
+ - skeletons/project/config/version.rb
217
+ - skeletons/project/default_user_configs/user_defaults.yml
218
+ - skeletons/project/exe/executable
219
+ - skeletons/project/hooks/default_action.rb
220
+ - skeletons/project/hooks/first_run.rb
221
+ - skeletons/project/hooks/post_execution.rb
222
+ - skeletons/project/hooks/pre_execution.rb
223
+ - skeletons/project/spec/spec_helper.rb
224
+ - skeletons/project/spec/untitled_spec.rb
225
+ - skeletons/project/untitled.gemspec
181
226
  homepage: https://github.com/akhoury6/rbcli
182
227
  licenses:
183
228
  - MIT