easy_app_helper 1.0.14 → 2.0.2
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/.gitignore +48 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/README.md +90 -447
- data/Rakefile +1 -8
- data/easy_app_helper.gemspec +6 -6
- data/lib/easy_app_helper/config/compatibility.rb +22 -0
- data/lib/easy_app_helper/config/initializer.rb +15 -0
- data/lib/easy_app_helper/config.rb +11 -0
- data/lib/easy_app_helper/logger/initializer.rb +46 -0
- data/lib/easy_app_helper/logger/wrapper.rb +12 -0
- data/lib/easy_app_helper/managed_logger.rb +9 -0
- data/lib/easy_app_helper/version.rb +1 -8
- data/lib/easy_app_helper.rb +23 -14
- data/spec/config_spec.rb +18 -188
- data/spec/easy_app_helper_spec.rb +28 -0
- data/spec/logger_spec.rb +8 -27
- data/spec/spec_helper.rb +92 -0
- metadata +27 -18
- data/etc/test_internal.conf +0 -3
- data/lib/easy_app_helper/core/base.rb +0 -228
- data/lib/easy_app_helper/core/config.rb +0 -220
- data/lib/easy_app_helper/core/logger.rb +0 -111
- data/lib/easy_app_helper/core/merge_policies.rb +0 -40
- data/lib/easy_app_helper/core/places.rb +0 -87
- data/lib/easy_app_helper/module_manager.rb +0 -68
- data/test/test.yml +0 -7
@@ -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
|