openteam-commons 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
@@ -6,51 +6,68 @@ module OpenteamCommons
|
|
6
6
|
isolate_namespace OpenteamCommons
|
7
7
|
|
8
8
|
config.before_configuration do
|
9
|
-
|
9
|
+
define_settings
|
10
|
+
end
|
11
|
+
|
12
|
+
config.before_initialize do
|
13
|
+
setup_airbrake
|
14
|
+
end
|
15
|
+
|
16
|
+
config.after_initialize do
|
17
|
+
setup_locale
|
18
|
+
setup_log_level
|
19
|
+
setup_secret
|
20
|
+
end
|
10
21
|
|
11
|
-
|
12
|
-
|
22
|
+
private
|
23
|
+
def define_settings
|
24
|
+
Settings.read(Rails.root.join('config', 'settings.yml')) if Rails.root.join('config', 'settings.yml').exist?
|
13
25
|
|
14
|
-
|
15
|
-
|
26
|
+
Settings.defaults Settings.extract!(Rails.env)[Rails.env] || {}
|
27
|
+
Settings.extract!(:test, :development, :production)
|
16
28
|
|
17
|
-
|
18
|
-
|
29
|
+
Settings.define 'app.secret', :env_var => 'APP_SECRET'
|
30
|
+
Settings.define 'app.url', :env_var => 'APP_URL'
|
19
31
|
|
20
|
-
|
32
|
+
Settings.define 'errors.key', :env_var => 'ERRORS_KEY'
|
33
|
+
Settings.define 'errors.url', :env_var => 'ERRORS_URL'
|
21
34
|
|
22
|
-
|
23
|
-
Settings.define 'sso.secret', :env_var => 'SSO_SECRET'
|
24
|
-
Settings.define 'sso.url', :env_var => 'SSO_URL'
|
35
|
+
Settings.define 'solr.url', :env_var => 'SOLR_URL'
|
25
36
|
|
26
|
-
|
37
|
+
Settings.define 'sso.key', :env_var => 'SSO_KEY'
|
38
|
+
Settings.define 'sso.secret', :env_var => 'SSO_SECRET'
|
39
|
+
Settings.define 'sso.url', :env_var => 'SSO_URL'
|
27
40
|
|
28
|
-
|
29
|
-
Settings.define 'unicorn.timeout', :env_var => 'UNICORN_TIMEOUT'
|
30
|
-
end
|
41
|
+
Settings.define 'storage.url', :env_var => 'STORAGE_URL'
|
31
42
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
config.
|
40
|
-
|
43
|
+
Settings.define 'unicorn.workers', :env_var => 'UNICORN_WORKERS'
|
44
|
+
Settings.define 'unicorn.timeout', :env_var => 'UNICORN_TIMEOUT'
|
45
|
+
end
|
46
|
+
|
47
|
+
def setup_airbrake
|
48
|
+
if Settings['errors.key'].present?
|
49
|
+
Airbrake.configure do |config|
|
50
|
+
config.api_key = Settings['errors.key']
|
51
|
+
|
52
|
+
URI.parse(Settings['errors.url']).tap do | url |
|
53
|
+
config.host = url.host
|
54
|
+
config.port = url.port
|
55
|
+
config.secure = url.scheme.inquiry.https?
|
56
|
+
end
|
41
57
|
end
|
42
58
|
end
|
43
59
|
end
|
44
|
-
end
|
45
60
|
|
46
|
-
|
47
|
-
|
48
|
-
|
61
|
+
def setup_secret
|
62
|
+
Rails.application.config.secret_token = Settings['app.secret']
|
63
|
+
end
|
49
64
|
|
50
|
-
|
51
|
-
|
65
|
+
def setup_locale
|
66
|
+
I18n.locale = I18n.default_locale
|
67
|
+
end
|
52
68
|
|
53
|
-
|
54
|
-
|
69
|
+
def setup_log_level
|
70
|
+
Rails.logger.level = ActiveSupport::BufferedLogger::Severity::WARN if Rails.env.production?
|
71
|
+
end
|
55
72
|
end
|
56
73
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openteam-commons
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-03-
|
12
|
+
date: 2012-03-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: airbrake
|
16
|
-
requirement: &
|
16
|
+
requirement: &3639040 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *3639040
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: configliere
|
27
|
-
requirement: &
|
27
|
+
requirement: &3638420 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *3638420
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rails
|
38
|
-
requirement: &
|
38
|
+
requirement: &3637760 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *3637760
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: unicorn
|
49
|
-
requirement: &
|
49
|
+
requirement: &3637080 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,7 +54,7 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *3637080
|
58
58
|
description: Description of OpenteamCommons.
|
59
59
|
email:
|
60
60
|
- mail@openteam.ru
|
@@ -90,7 +90,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
90
90
|
version: '0'
|
91
91
|
segments:
|
92
92
|
- 0
|
93
|
-
hash:
|
93
|
+
hash: 676470959250906476
|
94
94
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
95
|
none: false
|
96
96
|
requirements:
|
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
99
|
version: '0'
|
100
100
|
segments:
|
101
101
|
- 0
|
102
|
-
hash:
|
102
|
+
hash: 676470959250906476
|
103
103
|
requirements: []
|
104
104
|
rubyforge_project:
|
105
105
|
rubygems_version: 1.8.16
|