itsf_services 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generators/itsf/services/install/install_generator.rb +15 -0
- data/lib/generators/itsf/services/install/templates/initializer.rb +19 -0
- data/lib/itsf/services.rb +4 -1
- data/lib/itsf/services/configuration.rb +25 -0
- data/lib/itsf/services/v2/service/base.rb +1 -1
- data/lib/itsf/services/version.rb +1 -1
- data/lib/itsf_services.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74a981c75c7e8955def845fd9454ad0e691c6157
|
4
|
+
data.tar.gz: cc70b2a7599f0c6f6a9aee654a3f8473a7d52eb2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98c588ef74c47c494ac42d3d946a00067fc13a13cf1991e2a878354f4bb13caf31a0430927d45481eb3f8b33659c676af40dbae665d527a0e991c569680d2a71
|
7
|
+
data.tar.gz: ca180903df9fe060c284679ff38261301536fe271927d5efe4dccc28e6e5b496f827b017cc2a89860961c97938746a7abe9da86600c5257ebda3f3b89785252f
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Itsf
|
2
|
+
module Services
|
3
|
+
module Generators
|
4
|
+
class InstallGenerator < Rails::Generators::Base
|
5
|
+
desc 'Generates the initializer'
|
6
|
+
|
7
|
+
source_root File.expand_path('../templates', __FILE__)
|
8
|
+
|
9
|
+
def generate_initializer
|
10
|
+
copy_file 'initializer.rb', 'config/initializers/itsf_services.rb'
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
Itsf::Services.configure do |config|
|
2
|
+
# Set verbosity level by environment and level.
|
3
|
+
#
|
4
|
+
# Listed verbosity levels will be silenced and don't generate output.
|
5
|
+
#
|
6
|
+
# Default:
|
7
|
+
#
|
8
|
+
# config.silenced_levels = {
|
9
|
+
# test: [],
|
10
|
+
# development: [],
|
11
|
+
# production: []
|
12
|
+
# }
|
13
|
+
#
|
14
|
+
config.silenced_levels = {
|
15
|
+
test: [],
|
16
|
+
development: [],
|
17
|
+
production: []
|
18
|
+
}
|
19
|
+
end
|
data/lib/itsf/services.rb
CHANGED
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'active_support/core_ext/module/delegation'
|
2
|
+
require 'active_support/core_ext/module/attribute_accessors'
|
3
|
+
require 'active_support/hash_with_indifferent_access'
|
4
|
+
|
5
|
+
module Itsf
|
6
|
+
module Services
|
7
|
+
module Configuration
|
8
|
+
def configure
|
9
|
+
yield self
|
10
|
+
end
|
11
|
+
|
12
|
+
mattr_accessor :silenced_levels do
|
13
|
+
{
|
14
|
+
test: [],
|
15
|
+
development: [],
|
16
|
+
production: []
|
17
|
+
}
|
18
|
+
end
|
19
|
+
|
20
|
+
def silenced_levels=(silenced_levels)
|
21
|
+
@@silenced_levels = silenced_levels.with_indifferent_access
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -74,7 +74,7 @@ module Itsf
|
|
74
74
|
indent = options.delete(:indent)
|
75
75
|
level = options.delete(:level)
|
76
76
|
formatted_message = "[#{self.class.name}]: #{' ' * indent}#{message}"
|
77
|
-
puts formatted_message
|
77
|
+
puts formatted_message unless Itsf::Services.silenced_levels[Rails.env].include?(level)
|
78
78
|
@_messages << Services::V2::Message::Base.new(service_class: self.class, message: message, level: level, indent: indent)
|
79
79
|
true
|
80
80
|
end
|
data/lib/itsf_services.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: itsf_services
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roberto Vasquez Angel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -54,7 +54,10 @@ files:
|
|
54
54
|
- app/helpers/itsf/services/application_helper.rb
|
55
55
|
- app/views/layouts/itsf/services/application.html.erb
|
56
56
|
- config/routes.rb
|
57
|
+
- lib/generators/itsf/services/install/install_generator.rb
|
58
|
+
- lib/generators/itsf/services/install/templates/initializer.rb
|
57
59
|
- lib/itsf/services.rb
|
60
|
+
- lib/itsf/services/configuration.rb
|
58
61
|
- lib/itsf/services/engine.rb
|
59
62
|
- lib/itsf/services/v2/message/base.rb
|
60
63
|
- lib/itsf/services/v2/response/base.rb
|