easy_app_helper 0.0.5 → 0.0.6
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.
- checksums.yaml +4 -4
- data/README.md +47 -10
- data/easy_app_helper.gemspec +4 -4
- data/lib/easy_app_helper/version.rb +1 -1
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50d87ed053be2fd95061ffa2437b85d54624733d
|
4
|
+
data.tar.gz: 49c874b9d20f77fbd39dd0b1e85dfe3ac6b59dd5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07a81b4154ce7c2325d64b7d471063e458fca4d14e161fa97ad612523dad0475b85dbb3d7e5988ce3136d6cacaea3b09c860bb81ef87daf67d480d121201b72d
|
7
|
+
data.tar.gz: 2b2d0d30cd08aa7d3e6a1d847734d2c60937b653d39f5498289e8e98dc9a07a0768bfd84066f205b996699126b5c70ba0d8c68cfb955e6dab6456e34f5e943bc
|
data/README.md
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
# EasyAppHelper
|
2
2
|
|
3
|
-
This gem provides a suite of helpers for command line applications.
|
4
|
-
The goal is to be as transparent as possible for application whilst providing consistent helpers that add dedidacted behaviours to your application.
|
5
3
|
|
6
|
-
|
4
|
+
This [gem] [1] provides a suite of helpers for command line applications.
|
5
|
+
The goal is to be as transparent as possible for the application whilst providing consistent helpers that add dedidacted behaviours to your application.
|
6
|
+
|
7
|
+
Currently the only runtime dependency is on the [Slop gem] [2].
|
7
8
|
|
8
9
|
|
9
10
|
|
@@ -25,28 +26,59 @@ Or install it yourself as:
|
|
25
26
|
|
26
27
|
To benefit from the different helpers. Once you installed the gem, the only thing you need to do is:
|
27
28
|
|
29
|
+
```ruby
|
28
30
|
require 'easy_app_helper'
|
31
|
+
```
|
29
32
|
|
30
33
|
and then in the "main class" of your application, include the modules you want to use and call init_app_helper in the initialize method. Then what you can do with each
|
31
34
|
module is defined by each module.
|
32
35
|
|
33
|
-
The basic behaviour (when you include EasyAppHelper), actually adds basic command line handling (actually handled by slop), and provides the mechanism to enable you
|
34
|
-
to add any other EasyAppHelper module.
|
36
|
+
The basic behaviour (when you include EasyAppHelper), actually adds basic command line handling (actually handled by slop), and provides the mechanism to enable you to add any other EasyAppHelper module.
|
35
37
|
|
36
38
|
ex:
|
37
39
|
|
40
|
+
```ruby
|
38
41
|
require 'easy_app_helper'
|
39
42
|
|
40
43
|
class MyApp
|
41
|
-
|
44
|
+
include EasyAppHelper
|
45
|
+
def initialize
|
46
|
+
init_app_helper "my_app"
|
47
|
+
end
|
48
|
+
end
|
49
|
+
```
|
50
|
+
|
51
|
+
This basically does... nothing. I mean the only behaviour it adds to your application is the ability to pass --help to the application to see the inline help (that it builds). On top of this you then have access to some other command line options like --auto, --simulate, --verbose, but for those it is up to your application to check their value using the app_config attribute which is available in your MyApp instance.
|
52
|
+
|
53
|
+
You could then do something like:
|
42
54
|
|
43
|
-
|
44
|
-
|
45
|
-
|
55
|
+
```ruby
|
56
|
+
require 'easy_app_helper'
|
57
|
+
|
58
|
+
class MyApp
|
59
|
+
include EasyAppHelper
|
60
|
+
def initialize
|
61
|
+
"my_app" init_app_helper "my_app", "My Super Application", "This is the application everybody was waiting for.", "v 1.0"
|
62
|
+
if app_config[:verbose]
|
63
|
+
puts "Waouh, hello World !!"
|
64
|
+
end
|
65
|
+
end
|
46
66
|
end
|
67
|
+
```
|
47
68
|
|
48
|
-
|
69
|
+
You can actually access any field from your application configuration through the app_config attribute.
|
49
70
|
|
71
|
+
### Other modules
|
72
|
+
Some other modules are provided:
|
73
|
+
|
74
|
+
* EasyAppHelper::Logger provides logging facilities and config line options including log-level, log-file etc...
|
75
|
+
* EasyAppHelper::Config provides easy YAML based configuration to your script with multiple level of override (admin wide -> system wide -> user -> command line options -> --config-file). All the configuration being accessible through the app_config hash attribute
|
76
|
+
|
77
|
+
See [classes documentation] [3] for more information.
|
78
|
+
|
79
|
+
### Debugging
|
80
|
+
|
81
|
+
If you want to debug what happens during the framework instanciation, you can use the DEBUG_EASY_MODULES environment variable.
|
50
82
|
|
51
83
|
## Contributing
|
52
84
|
|
@@ -55,3 +87,8 @@ This basically does... nothing.
|
|
55
87
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
56
88
|
4. Push to the branch (`git push origin my-new-feature`)
|
57
89
|
5. Create new Pull Request
|
90
|
+
|
91
|
+
|
92
|
+
[1]: https://rubygems.org/gems/easy_app_helper "EasyAppHelper gem"
|
93
|
+
[2]: https://rubygems.org/gems/slop "Slop gem"
|
94
|
+
[3]: http://rubydoc.info/github/lbriais/easy_app_helper/master/frames "EasyAppHelper documentation"
|
data/easy_app_helper.gemspec
CHANGED
@@ -8,9 +8,9 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = EasyAppHelper::VERSION
|
9
9
|
spec.authors = ["L.Briais"]
|
10
10
|
spec.email = ["lbnetid+rb@gmail.com"]
|
11
|
-
spec.description = %q{
|
12
|
-
spec.summary = %q{Provides cool helpers to your
|
13
|
-
spec.homepage = ""
|
11
|
+
spec.description = %q{Easy Application Helpers framework}
|
12
|
+
spec.summary = %q{Provides cool helpers to your application, including configuration and logging features}
|
13
|
+
spec.homepage = "https://github.com/lbriais/easy_app_helper"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_development_dependency "bundler"
|
21
|
+
spec.add_development_dependency "bundler"
|
22
22
|
spec.add_development_dependency "rake"
|
23
23
|
spec.add_development_dependency "pry"
|
24
24
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easy_app_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- L.Briais
|
@@ -14,16 +14,16 @@ dependencies:
|
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
- - '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
-
description:
|
69
|
+
description: Easy Application Helpers framework
|
70
70
|
email:
|
71
71
|
- lbnetid+rb@gmail.com
|
72
72
|
executables: []
|
@@ -85,7 +85,7 @@ files:
|
|
85
85
|
- lib/easy_app_helper/config.rb
|
86
86
|
- lib/easy_app_helper/logger.rb
|
87
87
|
- lib/easy_app_helper/version.rb
|
88
|
-
homepage:
|
88
|
+
homepage: https://github.com/lbriais/easy_app_helper
|
89
89
|
licenses:
|
90
90
|
- MIT
|
91
91
|
metadata: {}
|
@@ -108,6 +108,6 @@ rubyforge_project:
|
|
108
108
|
rubygems_version: 2.0.0.rc.2
|
109
109
|
signing_key:
|
110
110
|
specification_version: 4
|
111
|
-
summary: Provides cool helpers to your
|
112
|
-
|
111
|
+
summary: Provides cool helpers to your application, including configuration and logging
|
112
|
+
features
|
113
113
|
test_files: []
|