easy_app_helper 1.0.14 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,68 +0,0 @@
1
- ################################################################################
2
- # EasyAppHelper
3
- #
4
- # Copyright (c) 2013 L.Briais under MIT license
5
- # http://opensource.org/licenses/MIT
6
- ################################################################################
7
-
8
- module EasyAppHelper::Core
9
-
10
- end
11
-
12
- require 'easy_app_helper/core/logger'
13
- require 'easy_app_helper/core/base'
14
- require 'easy_app_helper/core/config'
15
-
16
- # This module contains the exposed methods of the framework
17
- # It is included and extended into EasyAppHelper
18
- module EasyAppHelper::ModuleManager
19
-
20
- # @return [EasyAppHelper::Core::Logger] The application logger
21
- def logger
22
- @@logger
23
- end
24
-
25
- # @return [EasyAppHelper::Core::Config] The application config
26
- def config
27
- @@config
28
- end
29
-
30
- # Convenient method that logs at info level, but also outputs the message to STDOUT if
31
- # verbose is set in the config.
32
- # @param [String] msg to be displayed
33
- def puts_and_logs(msg)
34
- @@logger.puts_and_logs msg
35
- end
36
-
37
- # Method to do something (expects a block) unless --simulate is specified on the command line.
38
- # See {EasyAppHelper::Core::Base#safely_exec original implementation}.
39
- def safely_exec(message, *args, &block)
40
- @@config.safely_exec message, *args, &block
41
- end
42
-
43
-
44
- def self.included(base)
45
- init_core_modules
46
- base.extend self
47
- end
48
-
49
- ################################################################################
50
- private
51
-
52
- def self.init_logger
53
- @@logger ||= EasyAppHelper::Core::Logger.instance
54
- @@logger
55
- end
56
-
57
- def self.init_config
58
- @@config ||= EasyAppHelper::Core::Config.new @@logger
59
- @@logger.set_app_config(@@config)
60
- @@config
61
- end
62
-
63
- def self.init_core_modules
64
- init_logger
65
- init_config
66
- end
67
-
68
- end
data/test/test.yml DELETED
@@ -1,7 +0,0 @@
1
- stupid_config: true
2
-
3
- pipo: bimbo
4
-
5
- hash_example:
6
- first: one
7
- second: two