easy_app_helper 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +48 -47
- data/Gemfile +4 -4
- data/LICENSE.txt +22 -22
- data/README.md +498 -498
- data/Rakefile +8 -1
- data/easy_app_helper.gemspec +27 -26
- data/lib/easy_app_helper.rb +20 -20
- data/lib/easy_app_helper/core/base.rb +168 -141
- data/lib/easy_app_helper/core/config.rb +213 -203
- data/lib/easy_app_helper/core/logger.rb +111 -111
- data/lib/easy_app_helper/core/merge_policies.rb +37 -37
- data/lib/easy_app_helper/core/places.rb +51 -51
- data/lib/easy_app_helper/module_manager.rb +67 -67
- data/lib/easy_app_helper/version.rb +10 -10
- data/spec/config_spec.rb +128 -0
- data/spec/logger_spec.rb +33 -0
- data/test/test.yml +7 -7
- data/test/test2_app.rb +33 -33
- data/test/test3_app.rb +90 -90
- data/test/test4_app.rb +35 -35
- data/test/test_app.rb +55 -55
- metadata +20 -3
data/test/test_app.rb
CHANGED
@@ -1,56 +1,56 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
|
4
|
-
require 'easy_app_helper'
|
5
|
-
|
6
|
-
|
7
|
-
class Pipo
|
8
|
-
include EasyAppHelper
|
9
|
-
|
10
|
-
|
11
|
-
def toto
|
12
|
-
puts_and_logs "Now from a second class"
|
13
|
-
puts_and_logs config.to_hash
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
class TestApp
|
20
|
-
include EasyAppHelper
|
21
|
-
|
22
|
-
def initialize
|
23
|
-
#config.script_filename = File.basename $0
|
24
|
-
config.app_name = 'Test application'
|
25
|
-
#config.app_description = 'Best app to test the framework'
|
26
|
-
#config.app_version = '1.0.0'
|
27
|
-
puts_and_logs "Hello World"
|
28
|
-
p = Pipo.new.toto
|
29
|
-
config.script_filename = 'batch_audio_convert'
|
30
|
-
puts config.to_hash
|
31
|
-
config.internal_configs.each do |layer|
|
32
|
-
puts layer
|
33
|
-
end
|
34
|
-
add_cmd_line_options
|
35
|
-
puts config.help
|
36
|
-
logger.error "INTARG: #{config[:intarg]}"
|
37
|
-
|
38
|
-
# puts config.help
|
39
|
-
end
|
40
|
-
|
41
|
-
def add_cmd_line_options
|
42
|
-
config.add_command_line_section do |slop|
|
43
|
-
slop.on :u, :useless, 'Stupid option', :argument => false
|
44
|
-
slop.on :anint, 'Stupid option with integer argument', :argument => true, :as => Integer
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
end
|
49
|
-
|
50
|
-
t = TestApp.new
|
51
|
-
include EasyAppHelper
|
52
|
-
logger.warn "Yeah"
|
53
|
-
EasyAppHelper.logger.error "Groovy baby !"
|
54
|
-
puts_and_logs "Hey man"
|
55
|
-
#puts config.inspect
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
|
4
|
+
require 'easy_app_helper'
|
5
|
+
|
6
|
+
|
7
|
+
class Pipo
|
8
|
+
include EasyAppHelper
|
9
|
+
|
10
|
+
|
11
|
+
def toto
|
12
|
+
puts_and_logs "Now from a second class"
|
13
|
+
puts_and_logs config.to_hash
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
class TestApp
|
20
|
+
include EasyAppHelper
|
21
|
+
|
22
|
+
def initialize
|
23
|
+
#config.script_filename = File.basename $0
|
24
|
+
config.app_name = 'Test application'
|
25
|
+
#config.app_description = 'Best app to test the framework'
|
26
|
+
#config.app_version = '1.0.0'
|
27
|
+
puts_and_logs "Hello World"
|
28
|
+
p = Pipo.new.toto
|
29
|
+
config.script_filename = 'batch_audio_convert'
|
30
|
+
puts config.to_hash
|
31
|
+
config.internal_configs.each do |layer|
|
32
|
+
puts layer
|
33
|
+
end
|
34
|
+
add_cmd_line_options
|
35
|
+
puts config.help
|
36
|
+
logger.error "INTARG: #{config[:intarg]}"
|
37
|
+
|
38
|
+
# puts config.help
|
39
|
+
end
|
40
|
+
|
41
|
+
def add_cmd_line_options
|
42
|
+
config.add_command_line_section do |slop|
|
43
|
+
slop.on :u, :useless, 'Stupid option', :argument => false
|
44
|
+
slop.on :anint, 'Stupid option with integer argument', :argument => true, :as => Integer
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
t = TestApp.new
|
51
|
+
include EasyAppHelper
|
52
|
+
logger.warn "Yeah"
|
53
|
+
EasyAppHelper.logger.error "Groovy baby !"
|
54
|
+
puts_and_logs "Hey man"
|
55
|
+
#puts config.inspect
|
56
56
|
puts "bye"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easy_app_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- L.Briais
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: slop
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -87,6 +101,8 @@ files:
|
|
87
101
|
- lib/easy_app_helper/core/places.rb
|
88
102
|
- lib/easy_app_helper/module_manager.rb
|
89
103
|
- lib/easy_app_helper/version.rb
|
104
|
+
- spec/config_spec.rb
|
105
|
+
- spec/logger_spec.rb
|
90
106
|
- test/test.yml
|
91
107
|
- test/test2_app.rb
|
92
108
|
- test/test3_app.rb
|
@@ -112,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
112
128
|
version: '0'
|
113
129
|
requirements: []
|
114
130
|
rubyforge_project:
|
115
|
-
rubygems_version: 2.0.2
|
131
|
+
rubygems_version: 2.0.0.rc.2
|
116
132
|
signing_key:
|
117
133
|
specification_version: 4
|
118
134
|
summary: Provides cool helpers to your application, including configuration and logging
|
@@ -123,3 +139,4 @@ test_files:
|
|
123
139
|
- test/test3_app.rb
|
124
140
|
- test/test4_app.rb
|
125
141
|
- test/test_app.rb
|
142
|
+
has_rdoc:
|