esp-commons 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/config/initializers/errbit.rb +1 -0
- data/config/initializers/rsolr_utf8_queries.rb +7 -11
- data/config/locales/commons.ru.yml +5 -0
- data/config/locales/datetime.ru.yml +18 -0
- data/lib/esp-commons/engine.rb +21 -11
- data/lib/esp-commons/version.rb +1 -1
- metadata +148 -14
@@ -1,14 +1,10 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
opts =
|
7
|
-
if opts[:headers].try(:[], 'Content-Type') == 'application/x-www-form-urlencoded'
|
8
|
-
opts[:headers]['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8'
|
9
|
-
end
|
10
|
-
opts
|
1
|
+
class RSolr::Client
|
2
|
+
alias :build_request_without_utf8 :build_request
|
3
|
+
def build_request(path, opts)
|
4
|
+
opts = build_request_without_utf8(path,opts)
|
5
|
+
if opts[:headers].try(:[], 'Content-Type') == 'application/x-www-form-urlencoded'
|
6
|
+
opts[:headers]['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8'
|
11
7
|
end
|
8
|
+
opts
|
12
9
|
end
|
13
|
-
rescue LoadError
|
14
10
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
ru:
|
2
|
+
date:
|
3
|
+
formats:
|
4
|
+
default: "%d.%m.%Y"
|
5
|
+
short: "%d %b"
|
6
|
+
long: "%d %B %Y"
|
7
|
+
|
8
|
+
time:
|
9
|
+
# Форматы времени
|
10
|
+
formats:
|
11
|
+
default: "%d.%m.%Y %H:%M"
|
12
|
+
short: "%d %b, %H:%M"
|
13
|
+
long: "%d %B %Y, %H:%M"
|
14
|
+
|
15
|
+
# am/pm решено перевести как "утра/вечера" :)
|
16
|
+
am: "утра"
|
17
|
+
pm: "вечера"
|
18
|
+
|
data/lib/esp-commons/engine.rb
CHANGED
@@ -1,27 +1,24 @@
|
|
1
|
-
require 'configliere'
|
2
|
-
require 'airbrake'
|
3
|
-
require 'russian'
|
4
|
-
|
5
1
|
module EspCommons
|
6
2
|
class Engine < ::Rails::Engine
|
7
3
|
isolate_namespace EspCommons
|
8
4
|
|
9
5
|
config.before_configuration do
|
6
|
+
require 'configliere'
|
10
7
|
Settings.read(Rails.root.join('config', 'settings.yml')) if Rails.root.join('config', 'settings.yml').exist?
|
11
8
|
Settings.defaults Settings.extract!(Rails.env)[Rails.env] || {}
|
12
9
|
Settings.extract!(:test, :development, :production)
|
13
10
|
Settings.define 'app.secret', :env_var => 'APP_SECRET'
|
11
|
+
Settings.define 'appeals.url', :env_var => 'APPEALS_URL'
|
12
|
+
Settings.define 'blue-pages.url', :env_var => 'BLUE_PAGES_URL'
|
13
|
+
Settings.define 'cms.url', :env_var => 'CMS_URL'
|
14
14
|
Settings.define 'errors.key', :env_var => 'ERRORS_KEY'
|
15
15
|
Settings.define 'errors.url', :env_var => 'ERRORS_URL'
|
16
|
+
Settings.define 'news.url', :env_var => 'NEWS_URL'
|
16
17
|
Settings.define 'solr.url', :env_var => 'SOLR_URL'
|
18
|
+
Settings.define 'sso.key', :env_var => 'SSO_KEY'
|
19
|
+
Settings.define 'sso.secret', :env_var => 'SSO_SECRET'
|
17
20
|
Settings.define 'sso.url', :env_var => 'SSO_URL'
|
18
|
-
Settings.define '
|
19
|
-
Settings.define 'sso_secret', :env_var => 'SSO_SECRET'
|
20
|
-
Settings.define 'cms.url', :env_var => 'CMS_URL'
|
21
|
-
Settings.define 'blue-pages.url', :env_var => 'BLUE_PAGES_URL'
|
22
|
-
Settings.define 'news.url', :env_var => 'NEWS_URL'
|
23
|
-
Settings.define 'vfs.url', :env_var => 'VFS_URL'
|
24
|
-
Settings.define 'appeals.url', :env_var => 'APPEALS_URL'
|
21
|
+
Settings.define 'storage.url', :env_var => 'STORAGE_URL'
|
25
22
|
end
|
26
23
|
|
27
24
|
config.before_configuration do
|
@@ -31,6 +28,19 @@ module EspCommons
|
|
31
28
|
end
|
32
29
|
end
|
33
30
|
|
31
|
+
config.before_initialize do
|
32
|
+
require 'ancestry'
|
33
|
+
require 'default_value_for'
|
34
|
+
require 'formtastic'
|
35
|
+
require 'has_enum'
|
36
|
+
require 'has_scope'
|
37
|
+
require 'has_searcher'
|
38
|
+
require 'kaminari'
|
39
|
+
require 'inherited_resources'
|
40
|
+
require 'russian'
|
41
|
+
require 'sunspot/rails'
|
42
|
+
end
|
43
|
+
|
34
44
|
config.after_initialize do
|
35
45
|
Rails.logger.level = ActiveSupport::BufferedLogger::Severity::WARN if Rails.env.production?
|
36
46
|
end
|
data/lib/esp-commons/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: esp-commons
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
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-02-
|
12
|
+
date: 2012-02-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: airbrake
|
16
|
-
requirement: &
|
16
|
+
requirement: &16535720 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,43 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *16535720
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: ancestry
|
27
|
+
requirement: &16535280 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *16535280
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: annotate
|
38
|
+
requirement: &16533940 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 2.4.1.beta1
|
44
|
+
type: :runtime
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *16533940
|
25
47
|
- !ruby/object:Gem::Dependency
|
26
48
|
name: configliere
|
27
|
-
requirement: &
|
49
|
+
requirement: &16533120 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
type: :runtime
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *16533120
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: default_value_for
|
60
|
+
requirement: &16532300 !ruby/object:Gem::Requirement
|
28
61
|
none: false
|
29
62
|
requirements:
|
30
63
|
- - ! '>='
|
@@ -32,10 +65,65 @@ dependencies:
|
|
32
65
|
version: '0'
|
33
66
|
type: :runtime
|
34
67
|
prerelease: false
|
35
|
-
version_requirements: *
|
68
|
+
version_requirements: *16532300
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: formtastic
|
71
|
+
requirement: &16531240 !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
73
|
+
requirements:
|
74
|
+
- - ! '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: 2.1.0.beta1
|
77
|
+
type: :runtime
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: *16531240
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: has_enum
|
82
|
+
requirement: &16530560 !ruby/object:Gem::Requirement
|
83
|
+
none: false
|
84
|
+
requirements:
|
85
|
+
- - ! '>='
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
type: :runtime
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: *16530560
|
91
|
+
- !ruby/object:Gem::Dependency
|
92
|
+
name: has_searcher
|
93
|
+
requirement: &16529420 !ruby/object:Gem::Requirement
|
94
|
+
none: false
|
95
|
+
requirements:
|
96
|
+
- - ! '>='
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
99
|
+
type: :runtime
|
100
|
+
prerelease: false
|
101
|
+
version_requirements: *16529420
|
102
|
+
- !ruby/object:Gem::Dependency
|
103
|
+
name: inherited_resources
|
104
|
+
requirement: &16528540 !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
type: :runtime
|
111
|
+
prerelease: false
|
112
|
+
version_requirements: *16528540
|
113
|
+
- !ruby/object:Gem::Dependency
|
114
|
+
name: kaminari
|
115
|
+
requirement: &16527000 !ruby/object:Gem::Requirement
|
116
|
+
none: false
|
117
|
+
requirements:
|
118
|
+
- - ! '>='
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: '0'
|
121
|
+
type: :runtime
|
122
|
+
prerelease: false
|
123
|
+
version_requirements: *16527000
|
36
124
|
- !ruby/object:Gem::Dependency
|
37
125
|
name: rails
|
38
|
-
requirement: &
|
126
|
+
requirement: &16526180 !ruby/object:Gem::Requirement
|
39
127
|
none: false
|
40
128
|
requirements:
|
41
129
|
- - ! '>='
|
@@ -43,10 +131,21 @@ dependencies:
|
|
43
131
|
version: '0'
|
44
132
|
type: :runtime
|
45
133
|
prerelease: false
|
46
|
-
version_requirements: *
|
134
|
+
version_requirements: *16526180
|
47
135
|
- !ruby/object:Gem::Dependency
|
48
136
|
name: russian
|
49
|
-
requirement: &
|
137
|
+
requirement: &16525280 !ruby/object:Gem::Requirement
|
138
|
+
none: false
|
139
|
+
requirements:
|
140
|
+
- - ! '>='
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: '0'
|
143
|
+
type: :runtime
|
144
|
+
prerelease: false
|
145
|
+
version_requirements: *16525280
|
146
|
+
- !ruby/object:Gem::Dependency
|
147
|
+
name: sunspot_rails
|
148
|
+
requirement: &16523800 !ruby/object:Gem::Requirement
|
50
149
|
none: false
|
51
150
|
requirements:
|
52
151
|
- - ! '>='
|
@@ -54,10 +153,43 @@ dependencies:
|
|
54
153
|
version: '0'
|
55
154
|
type: :runtime
|
56
155
|
prerelease: false
|
57
|
-
version_requirements: *
|
156
|
+
version_requirements: *16523800
|
157
|
+
- !ruby/object:Gem::Dependency
|
158
|
+
name: unicorn
|
159
|
+
requirement: &16522860 !ruby/object:Gem::Requirement
|
160
|
+
none: false
|
161
|
+
requirements:
|
162
|
+
- - ! '>='
|
163
|
+
- !ruby/object:Gem::Version
|
164
|
+
version: '0'
|
165
|
+
type: :runtime
|
166
|
+
prerelease: false
|
167
|
+
version_requirements: *16522860
|
168
|
+
- !ruby/object:Gem::Dependency
|
169
|
+
name: pg
|
170
|
+
requirement: &16522220 !ruby/object:Gem::Requirement
|
171
|
+
none: false
|
172
|
+
requirements:
|
173
|
+
- - ! '>='
|
174
|
+
- !ruby/object:Gem::Version
|
175
|
+
version: '0'
|
176
|
+
type: :runtime
|
177
|
+
prerelease: false
|
178
|
+
version_requirements: *16522220
|
179
|
+
- !ruby/object:Gem::Dependency
|
180
|
+
name: compass-rails
|
181
|
+
requirement: &16521380 !ruby/object:Gem::Requirement
|
182
|
+
none: false
|
183
|
+
requirements:
|
184
|
+
- - ! '>='
|
185
|
+
- !ruby/object:Gem::Version
|
186
|
+
version: 1.0.0.rc2
|
187
|
+
type: :runtime
|
188
|
+
prerelease: false
|
189
|
+
version_requirements: *16521380
|
58
190
|
- !ruby/object:Gem::Dependency
|
59
191
|
name: sqlite3
|
60
|
-
requirement: &
|
192
|
+
requirement: &16520740 !ruby/object:Gem::Requirement
|
61
193
|
none: false
|
62
194
|
requirements:
|
63
195
|
- - ! '>='
|
@@ -65,7 +197,7 @@ dependencies:
|
|
65
197
|
version: '0'
|
66
198
|
type: :development
|
67
199
|
prerelease: false
|
68
|
-
version_requirements: *
|
200
|
+
version_requirements: *16520740
|
69
201
|
description: Description of EspCommons.
|
70
202
|
email:
|
71
203
|
- mail@openteam.ru
|
@@ -76,6 +208,8 @@ files:
|
|
76
208
|
- config/initializers/rsolr_utf8_queries.rb
|
77
209
|
- config/initializers/errbit.rb
|
78
210
|
- config/initializers/sunspot.rb
|
211
|
+
- config/locales/datetime.ru.yml
|
212
|
+
- config/locales/commons.ru.yml
|
79
213
|
- lib/generators/esp_commons/install/install_generator.rb
|
80
214
|
- lib/generators/esp_commons/install/bin/start_site
|
81
215
|
- lib/generators/esp_commons/install/config/schedule.rb
|
@@ -100,7 +234,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
100
234
|
version: '0'
|
101
235
|
segments:
|
102
236
|
- 0
|
103
|
-
hash:
|
237
|
+
hash: 1432847869569284366
|
104
238
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
105
239
|
none: false
|
106
240
|
requirements:
|
@@ -109,7 +243,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
243
|
version: '0'
|
110
244
|
segments:
|
111
245
|
- 0
|
112
|
-
hash:
|
246
|
+
hash: 1432847869569284366
|
113
247
|
requirements: []
|
114
248
|
rubyforge_project:
|
115
249
|
rubygems_version: 1.8.15
|