climatic 0.2.26

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 (64) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +14 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +5 -0
  5. data/CODE_OF_CONDUCT.md +74 -0
  6. data/Gemfile +4 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +52 -0
  9. data/Rakefile +6 -0
  10. data/bin/console +14 -0
  11. data/bin/setup +8 -0
  12. data/climatic.gemspec +28 -0
  13. data/example/simple_app/.gitignore +12 -0
  14. data/example/simple_app/.rspec +2 -0
  15. data/example/simple_app/.ruby-version +1 -0
  16. data/example/simple_app/.travis.yml +5 -0
  17. data/example/simple_app/CODE_OF_CONDUCT.md +74 -0
  18. data/example/simple_app/Gemfile +6 -0
  19. data/example/simple_app/LICENSE.txt +21 -0
  20. data/example/simple_app/README.md +43 -0
  21. data/example/simple_app/Rakefile +6 -0
  22. data/example/simple_app/bin/console +14 -0
  23. data/example/simple_app/bin/setup +8 -0
  24. data/example/simple_app/etc/command_line.yml +52 -0
  25. data/example/simple_app/exe/user +57 -0
  26. data/example/simple_app/lib/tst_climatic/version.rb +3 -0
  27. data/example/simple_app/lib/tst_climatic.rb +5 -0
  28. data/example/simple_app/spec/spec_helper.rb +14 -0
  29. data/example/simple_app/spec/tst_climatic_spec.rb +11 -0
  30. data/example/simple_app/tst_climatic.gemspec +39 -0
  31. data/lib/climatic/config_layers/command_line_layer.rb +46 -0
  32. data/lib/climatic/config_layers/command_line_manager_binder.rb +84 -0
  33. data/lib/climatic/config_layers/env_layer.rb +41 -0
  34. data/lib/climatic/config_layers/executable_gem_layer.rb +45 -0
  35. data/lib/climatic/config_layers/gem_layer.rb +50 -0
  36. data/lib/climatic/config_layers/generic_layer.rb +62 -0
  37. data/lib/climatic/config_layers/global_layer.rb +28 -0
  38. data/lib/climatic/config_layers/program_description_helper.rb +94 -0
  39. data/lib/climatic/config_layers/project_layer.rb +61 -0
  40. data/lib/climatic/config_layers/provided_config_file_layer.rb +26 -0
  41. data/lib/climatic/config_layers/source_helper.rb +48 -0
  42. data/lib/climatic/config_layers/system_layer.rb +37 -0
  43. data/lib/climatic/config_layers/user_layer.rb +40 -0
  44. data/lib/climatic/initializer.rb +87 -0
  45. data/lib/climatic/layers_manager.rb +81 -0
  46. data/lib/climatic/logger/accumulator.rb +49 -0
  47. data/lib/climatic/logger/manager.rb +50 -0
  48. data/lib/climatic/logger/wrapper.rb +12 -0
  49. data/lib/climatic/processes/base.rb +51 -0
  50. data/lib/climatic/processes/command.rb +15 -0
  51. data/lib/climatic/processes/synchronous.rb +51 -0
  52. data/lib/climatic/processes/time_management.rb +21 -0
  53. data/lib/climatic/proxy.rb +27 -0
  54. data/lib/climatic/script/base.rb +65 -0
  55. data/lib/climatic/script/simple.rb +31 -0
  56. data/lib/climatic/script/unimplemented_processor.rb +19 -0
  57. data/lib/climatic/script.rb +4 -0
  58. data/lib/climatic/utils/error.rb +5 -0
  59. data/lib/climatic/utils/input.rb +65 -0
  60. data/lib/climatic/utils/safe_exec.rb +28 -0
  61. data/lib/climatic/utils/script_helper.rb +18 -0
  62. data/lib/climatic/version.rb +3 -0
  63. data/lib/climatic.rb +45 -0
  64. metadata +162 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6da5a90686eb0f2a7407b2eb3a225ee98647e8de
4
+ data.tar.gz: b7feab17b0feafeaea9dba5a5c8cbcb0794be25a
5
+ SHA512:
6
+ metadata.gz: fc9cf100ef26ca849d0ec5939c37a1d1e3c540e1bb97217ddde6d8d75bec1666d630b3ce59aad1b3857108c1233bb2a45d04cf576a34df47ad6ac7ed66da88d2
7
+ data.tar.gz: 0ae71755a74e54495cfb4a9b70a6d83a2853b097c8f9c6666010f385839fd66aff13e78507ab78e90f02cf09f6484f5b404c5c435c5a1c0059475b1640f4cfa9
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+
11
+ # rspec failure tracking
12
+ .rspec_status
13
+ /.idea/
14
+ /.ruby-version
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.3.1
5
+ before_install: gem install bundler -v 1.15.1
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at lbnetid+gh@gmail.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in climatic.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017 Laurent B.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,52 @@
1
+ CLImatic
2
+ ========
3
+
4
+ Basically `CLImatic` is the successor of [easy_app_helper]. Most of the documentation in [easy_app_helper] remains valid, but `CLImatic` introduces:
5
+
6
+ - sub-commands _à-la-git_
7
+ - a brand new mechanism so that command line options can be defined using YAML files (see the [YAML example]).
8
+ - command line definition could be contextual to the folder you're in, thanks to a new layer introduced compared to [easy_app_helper], the [ProjectLayer].
9
+
10
+
11
+ ## Installation
12
+
13
+ Add this line to your application's Gemfile:
14
+
15
+ ```ruby
16
+ gem 'climatic'
17
+ ```
18
+
19
+ And then execute:
20
+
21
+ $ bundle
22
+
23
+ Or install it yourself as:
24
+
25
+ $ gem install climatic
26
+
27
+ ## Usage
28
+
29
+ Specific documentation will come, for the time being I'am afraid you may have to read the code and more specifically the tests...
30
+
31
+ ## Development
32
+
33
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
34
+
35
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
36
+
37
+ ## Contributing
38
+
39
+ Bug reports and pull requests are welcome on GitHub at https://gitlab.com/lbriais/climatic. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
40
+
41
+ ## License
42
+
43
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
44
+
45
+ ## Code of Conduct
46
+
47
+ Everyone interacting in the Climatic project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://gitlab.com/lbriais/climatic/blob/master/CODE_OF_CONDUCT.md).
48
+
49
+ [easy_app_helper]: https://github.com/lbriais/easy_app_helper "Could be seen as the legacy Climatic"
50
+ [YAML example]: example/simple_app/etc/command_line.yml "A YAML example to define command line"
51
+ [example application]: example/simple_app "An example application using Climatic"
52
+ [ProjectLayer]: lib/climatic/config_layers/project_layer.rb "A layer to have the command options diffrent if you are within a specific project"
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bundler/setup'
4
+ require 'climatic'
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require 'irb'
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/climatic.gemspec ADDED
@@ -0,0 +1,28 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'climatic/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'climatic'
8
+ spec.version = Climatic::VERSION
9
+ spec.authors = ['Laurent B.']
10
+ spec.email = ['lbnetid+gh@gmail.com']
11
+
12
+ spec.summary = %q{A CLI framework to ease command-line tools creation.}
13
+ spec.description = %q{A CLI framework to ease command-line tools creation.}
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
17
+ f.match(%r{^(test|spec|features)/})
18
+ end
19
+ spec.bindir = 'exe'
20
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
+ spec.require_paths = ['lib']
22
+
23
+ spec.add_development_dependency 'bundler', '~> 2.0'
24
+ spec.add_development_dependency 'rake', '~> 10.0'
25
+ spec.add_development_dependency 'rspec', '~> 3.0'
26
+
27
+ spec.add_dependency 'ultra_command_line', '~> 0.4'
28
+ end
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+
11
+ # rspec failure tracking
12
+ .rspec_status
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
@@ -0,0 +1 @@
1
+ 2.3.1
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.3.1
5
+ before_install: gem install bundler -v 1.15.1
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at lbnetid+gh@gmail.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
@@ -0,0 +1,6 @@
1
+ source "https://gems.nanonet"
2
+
3
+ # Specify your gem's dependencies in tst_climatic.gemspec
4
+ gemspec
5
+ gem 'climatic', path: File.expand_path(File.join('..', '..', '..'), __FILE__)
6
+ # gem 'slop_wrapper', path: File.expand_path(File.join('..', '..', 'slop_wrapper'), __FILE__)
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017 Laurent B.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,43 @@
1
+ # TstClimatic
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/tst_climatic`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'tst_climatic'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install tst_climatic
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/tst_climatic. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
+
37
+ ## License
38
+
39
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
40
+
41
+ ## Code of Conduct
42
+
43
+ Everyone interacting in the TstClimatic project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/tst_climatic/blob/master/CODE_OF_CONDUCT.md).
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "tst_climatic"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,52 @@
1
+ :options:
2
+ verbose:
3
+ :type: bool
4
+ :summary: Enables verbose mode.
5
+ :global: true
6
+ :short_aliases:
7
+ - v
8
+ help:
9
+ :type: bool
10
+ :summary: Displays this help.
11
+ :global: true
12
+ :short_aliases:
13
+ - h
14
+ version:
15
+ :type: bool
16
+ :summary: Displays program version.
17
+ :short_aliases:
18
+ - V
19
+ :long_aliases:
20
+ - program-version
21
+ debug:
22
+ :type: bool
23
+ :summary: Debug mode
24
+ :global: true
25
+ debug-on-stderr:
26
+ :type: bool
27
+ :global: true
28
+ :summary: Debugging to SDTERR
29
+ :long_aliases:
30
+ - debug-on-err
31
+ :dependencies:
32
+ - debug
33
+ log-level:
34
+ :global: true
35
+ :dependencies:
36
+ - debug
37
+ :type: integer
38
+ :summary: Defines the level of logging (0 to 5).
39
+
40
+ :banner: |
41
+ This is the banner for the root command.
42
+ Obviously it can be multiline...
43
+
44
+ :subcommands:
45
+ test:
46
+ :options:
47
+ pipo:
48
+ :type: bool
49
+ :summary: A stupid option
50
+ :banner: |
51
+ This is the banner for the subcommand "test".
52
+ And it is multiline too...
@@ -0,0 +1,57 @@
1
+ #!/usr/bin/env ruby
2
+ # coding: utf-8
3
+ # This file has been generated by easy_app_helper Gem on the <%= current_date %>
4
+ # See 'https://rubygems.org/gems/easy_app_helper'
5
+
6
+ require 'rubygems'
7
+ require 'bundler/setup'
8
+
9
+ $DO_NOT_AUTOSTART_CLIMATIC = true
10
+ require 'climatic'
11
+ # Patch as it is launched as an example
12
+ class Climatic::ConfigLayers::ExecutableGemLayer
13
+ def self.executable_gem_config_root
14
+ return File.expand_path File.join('..', '..'), __FILE__
15
+ end
16
+ end
17
+ Climatic.bootstrap
18
+ puts '-' * 80
19
+ require 'climatic/script'
20
+
21
+ #
22
+ # c = Climatic::LayersManager.new
23
+ #
24
+ # # puts c.detailed_config_files_info.to_yaml
25
+ # #
26
+ # # puts c.detailed_layers_info
27
+ #
28
+ # puts "Options: #{c[].inspect}"
29
+ #
30
+ #
31
+ # puts "Extra parameters: #{c.command_line_layer.extra_parameters.inspect}"
32
+
33
+
34
+
35
+ class MyScript < Climatic::Script::Simple
36
+
37
+ def check_params(command_params)
38
+ puts "Validating params: '#{command_params.inspect}'"
39
+ cmd_line_mngr = Climatic.config.command_line_layer.command_line_manager
40
+ puts "Validating command params: '#{cmd_line_mngr.cmd_line_args_for_command cmd_line_mngr.command}'"
41
+ puts "Validating config: '#{Climatic.config[].inspect}'"
42
+ true
43
+ end
44
+
45
+ def execute
46
+ puts "Config: #{Climatic.config[].inspect}"
47
+ puts "Logger: #{Climatic.logger.inspect}"
48
+ cmd = Climatic.config.command_line_layer.command_line_manager.command
49
+ puts "Running command #{cmd.name.empty? ? 'ROOT' : cmd.name}"
50
+ Climatic::Logger::Accumulator::STACK_OPS.each do |log_op|
51
+ Climatic.logger.send log_op, "Yo ! (logged using #{log_op.to_s} mode)."
52
+ end
53
+ end
54
+ end
55
+
56
+ MyScript.new.run
57
+
@@ -0,0 +1,3 @@
1
+ module TstClimatic
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,5 @@
1
+ require "tst_climatic/version"
2
+
3
+ module TstClimatic
4
+ # Your code goes here...
5
+ end
@@ -0,0 +1,14 @@
1
+ require "bundler/setup"
2
+ require "tst_climatic"
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,11 @@
1
+ require "spec_helper"
2
+
3
+ RSpec.describe TstClimatic do
4
+ it "has a version number" do
5
+ expect(TstClimatic::VERSION).not_to be nil
6
+ end
7
+
8
+ it "does something useful" do
9
+ expect(false).to eq(true)
10
+ end
11
+ end
@@ -0,0 +1,39 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "tst_climatic/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "tst_climatic"
8
+ spec.version = TstClimatic::VERSION
9
+ spec.authors = ["Laurent B."]
10
+ spec.email = ["lbnetid+gh@gmail.com"]
11
+
12
+ spec.summary = %q{ Write a short summary, because Rubygems requires one.}
13
+ spec.description = %q{ Write a longer description or delete this line.}
14
+ # spec.homepage = "Put your gem's website or public repo URL here."
15
+ spec.license = "MIT"
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
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
27
+ f.match(%r{^(test|spec|features)/})
28
+ end
29
+ spec.bindir = "exe"
30
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
+ spec.require_paths = ["lib"]
32
+
33
+ spec.add_development_dependency "bundler", "~> 1.15"
34
+ spec.add_development_dependency "rake", "~> 10.0"
35
+ spec.add_development_dependency "rspec", "~> 3.0"
36
+
37
+ spec.add_dependency 'slop_wrapper'
38
+ spec.add_dependency 'climatic'
39
+ end