unicorn-cuba-base 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YjRkM2RlMWNmNWY2ZGM4ZjE1ZGUyOWE5MmJjODk1ZDEyM2NiOTdhMQ==
5
+ data.tar.gz: !binary |-
6
+ OTg2NGM2ZTRhYTY3NDBiMDRkZGUzMDM2MzZjY2U3NDEzMDA5MzQ0OQ==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ ZWYzNDEyNWU2ZmUxYTk5ZTZlNTY1Y2QxMGJjZGQyOGU2NDk5MmY2NjUyY2Uz
10
+ ODEzOWU0ZjI3ZDZmNTdiOTNmZTg4MzdmZGFhNDcxMzRkYjZkYzE0MzQxYTAw
11
+ NTc5ZTdjOWNlNjA0NjBjNmJmOWUwMTBiOWRjMmZkYTNmOTZlMWM=
12
+ data.tar.gz: !binary |-
13
+ YzZlMDA0ODAxY2U4YTZjZTcxYWY5MGVhYTYzMjEyZWY5MDRiZTI0N2RjMmZi
14
+ ZWFiZGQzMzIzYTZiNGM1M2Q2MDlkYTk0M2EzMjEwNDM4M2ZjMjJjMTcwMzVm
15
+ OWQwYjI4MTA2YWVhYTExNjAwMjE5ZmJkYWIyYWM4OWIzYjkwOGU=
data/Gemfile CHANGED
@@ -6,7 +6,7 @@ gem "cuba", "~> 3.0"
6
6
  gem "unicorn", ">= 4.6.2"
7
7
  gem "raindrops", "~> 0.11"
8
8
  gem "cli", "~> 1.3"
9
- gem "facter", "~> 1.6.11"
9
+ gem "facter", ">= 1.6.11"
10
10
  gem "ruby-ip", "~> 0.9"
11
11
 
12
12
  # Add dependencies to develop your gem here.
@@ -14,6 +14,6 @@ gem "ruby-ip", "~> 0.9"
14
14
  group :development do
15
15
  gem "rspec", "~> 2.13"
16
16
  gem "rdoc", "~> 3.9"
17
- gem "jeweler", "~> 1.8.4"
17
+ gem "jeweler", "~> 1.8.8"
18
18
  gem "capture-output", "~> 1.0"
19
19
  end
data/Gemfile.lock CHANGED
@@ -1,23 +1,51 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
+ addressable (2.3.6)
5
+ builder (3.2.2)
4
6
  capture-output (1.0.0)
5
7
  cli (1.3.1)
6
8
  cuba (3.1.0)
7
9
  rack
8
10
  diff-lcs (1.2.4)
9
11
  facter (1.6.18)
10
- git (1.2.5)
11
- jeweler (1.8.4)
12
+ faraday (0.8.9)
13
+ multipart-post (~> 1.2.0)
14
+ git (1.2.8)
15
+ github_api (0.10.1)
16
+ addressable
17
+ faraday (~> 0.8.1)
18
+ hashie (>= 1.2)
19
+ multi_json (~> 1.4)
20
+ nokogiri (~> 1.5.2)
21
+ oauth2
22
+ hashie (3.3.1)
23
+ highline (1.7.1)
24
+ jeweler (1.8.8)
25
+ builder
12
26
  bundler (~> 1.0)
13
27
  git (>= 1.2.5)
28
+ github_api (= 0.10.1)
29
+ highline (>= 1.6.15)
30
+ nokogiri (= 1.5.10)
14
31
  rake
15
32
  rdoc
16
33
  json (1.7.7)
34
+ jwt (1.0.0)
17
35
  kgio (2.8.0)
36
+ multi_json (1.10.1)
37
+ multi_xml (0.5.5)
38
+ multipart-post (1.2.0)
39
+ nokogiri (1.5.10)
40
+ oauth2 (1.0.0)
41
+ faraday (>= 0.8, < 0.10)
42
+ jwt (~> 1.0)
43
+ multi_json (~> 1.3)
44
+ multi_xml (~> 0.5)
45
+ rack (~> 1.2)
18
46
  rack (1.5.2)
19
47
  raindrops (0.11.0)
20
- rake (10.0.4)
48
+ rake (10.3.2)
21
49
  rdoc (3.12.2)
22
50
  json (~> 1.4)
23
51
  rspec (2.13.0)
@@ -41,8 +69,8 @@ DEPENDENCIES
41
69
  capture-output (~> 1.0)
42
70
  cli (~> 1.3)
43
71
  cuba (~> 3.0)
44
- facter (~> 1.6.11)
45
- jeweler (~> 1.8.4)
72
+ facter (>= 1.6.11)
73
+ jeweler (~> 1.8.8)
46
74
  raindrops (~> 0.11)
47
75
  rdoc (~> 3.9)
48
76
  rspec (~> 2.13)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.0
1
+ 1.4.0
@@ -27,6 +27,8 @@ require_relative 'unicorn-cuba-base/stats_reporter'
27
27
  require_relative 'unicorn-cuba-base/default_error_reporter'
28
28
 
29
29
  class Application
30
+ include ClassLogging
31
+
30
32
  def cli(&block)
31
33
  @cli_setup = block
32
34
  end
@@ -44,7 +46,7 @@ class Application
44
46
  end
45
47
 
46
48
  def initialize(program_name, defaults = {}, &block)
47
- instance_eval &block
49
+ instance_eval(&block)
48
50
 
49
51
  @cli = setup_cli(program_name, defaults, @cli_setup) or fail 'no cli defined'
50
52
  @settings = @settings_setup ? setup_settings(@settings_setup) : @cli.parse!
@@ -95,6 +97,9 @@ class Application
95
97
  Controller.plugin Plugin::ResponseHelpers
96
98
  Controller.plugin Plugin::MemoryLimit
97
99
 
100
+ self.class.logger = root_logger.logger_for(self.class)
101
+ log.info "#{program_name} starting up; pid: #{Process.pid}"
102
+
98
103
  @main_setup or fail 'no main controller provided'
99
104
  main_controller = setup_main(@main_setup) or fail 'no main controller class returned'
100
105
 
@@ -117,7 +122,7 @@ class Application
117
122
 
118
123
  def setup_cli(program_name, defaults, block)
119
124
  CLI.new do
120
- instance_eval &block
125
+ instance_eval(&block)
121
126
  option :log_file,
122
127
  short: :l,
123
128
  cast: Pathname,
@@ -58,25 +58,25 @@ describe RootLogger do
58
58
  describe 'meta data' do
59
59
  it 'should log with metadata in RFC5424 format' do
60
60
  subject.with_meta(type: 'access-log').info 'GET /asdfas'
61
- log_out.string.should include 'type="access-log"'
61
+ log_out.string.should include '"type":"access-log"'
62
62
 
63
63
  subject.info 'GET /asdfas'
64
- log_out.string.lines.to_a.last.should_not include 'type="access-log"'
64
+ log_out.string.lines.to_a.last.should_not include '"type":"access-log"'
65
65
  end
66
66
 
67
67
  it 'should work with chaining' do
68
68
  subject.with_meta(type: 'access-log').with_meta(blah: 'xxx').info 'GET /asdfas'
69
- log_out.string.should include 'type="access-log" blah="xxx"'
69
+ log_out.string.should include '"type":"access-log","blah":"xxx"'
70
70
  end
71
71
 
72
72
  it 'should log with metadata context' do
73
73
  subject.with_meta_context(type: 'app-log') do
74
74
  subject.info 'GET /asdfas'
75
75
  end
76
- log_out.string.should include 'type="app-log"'
76
+ log_out.string.should include '"type":"app-log"'
77
77
 
78
78
  subject.info 'GET /asdfas'
79
- log_out.string.lines.to_a.last.should_not include 'type="app-log"'
79
+ log_out.string.lines.to_a.last.should_not include '"type":"app-log"'
80
80
  end
81
81
  end
82
82
  end
@@ -146,7 +146,7 @@ describe RootSyslogLogger do
146
146
  end
147
147
 
148
148
  it 'should allow use of meta data' do
149
- Capture.stderr{subject.with_meta('type' => 'access-log').write "hello world"}.should include 'type="access-log"'
149
+ Capture.stderr{subject.with_meta('type' => 'access-log').write "hello world"}.should include '"type":"access-log"'
150
150
  end
151
151
  end
152
152
  end
@@ -2,14 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
+ # stub: unicorn-cuba-base 1.4.0 ruby lib
5
6
 
6
7
  Gem::Specification.new do |s|
7
8
  s.name = "unicorn-cuba-base"
8
- s.version = "1.3.0"
9
+ s.version = "1.4.0"
9
10
 
10
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib"]
11
13
  s.authors = ["Jakub Pastuszek"]
12
- s.date = "2014-10-02"
14
+ s.date = "2015-05-06"
13
15
  s.description = "web application base powered by Unicorn HTTP server and based on Cuba framework extended with additional Rack middleware and Cuba plugins"
14
16
  s.email = "jpastuszek@gmail.com"
15
17
  s.extra_rdoc_files = [
@@ -48,34 +50,33 @@ Gem::Specification.new do |s|
48
50
  ]
49
51
  s.homepage = "http://github.com/jpastuszek/unicorn-cuba-base"
50
52
  s.licenses = ["MIT"]
51
- s.require_paths = ["lib"]
52
- s.rubygems_version = "1.8.23"
53
+ s.rubygems_version = "2.2.2"
53
54
  s.summary = "web appliaction base powered by Unicorn and Cuba"
54
55
 
55
56
  if s.respond_to? :specification_version then
56
- s.specification_version = 3
57
+ s.specification_version = 4
57
58
 
58
59
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
59
60
  s.add_runtime_dependency(%q<cuba>, ["~> 3.0"])
60
61
  s.add_runtime_dependency(%q<unicorn>, [">= 4.6.2"])
61
62
  s.add_runtime_dependency(%q<raindrops>, ["~> 0.11"])
62
63
  s.add_runtime_dependency(%q<cli>, ["~> 1.3"])
63
- s.add_runtime_dependency(%q<facter>, ["~> 1.6.11"])
64
+ s.add_runtime_dependency(%q<facter>, [">= 1.6.11"])
64
65
  s.add_runtime_dependency(%q<ruby-ip>, ["~> 0.9"])
65
66
  s.add_development_dependency(%q<rspec>, ["~> 2.13"])
66
67
  s.add_development_dependency(%q<rdoc>, ["~> 3.9"])
67
- s.add_development_dependency(%q<jeweler>, ["~> 1.8.4"])
68
+ s.add_development_dependency(%q<jeweler>, ["~> 1.8.8"])
68
69
  s.add_development_dependency(%q<capture-output>, ["~> 1.0"])
69
70
  else
70
71
  s.add_dependency(%q<cuba>, ["~> 3.0"])
71
72
  s.add_dependency(%q<unicorn>, [">= 4.6.2"])
72
73
  s.add_dependency(%q<raindrops>, ["~> 0.11"])
73
74
  s.add_dependency(%q<cli>, ["~> 1.3"])
74
- s.add_dependency(%q<facter>, ["~> 1.6.11"])
75
+ s.add_dependency(%q<facter>, [">= 1.6.11"])
75
76
  s.add_dependency(%q<ruby-ip>, ["~> 0.9"])
76
77
  s.add_dependency(%q<rspec>, ["~> 2.13"])
77
78
  s.add_dependency(%q<rdoc>, ["~> 3.9"])
78
- s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
79
+ s.add_dependency(%q<jeweler>, ["~> 1.8.8"])
79
80
  s.add_dependency(%q<capture-output>, ["~> 1.0"])
80
81
  end
81
82
  else
@@ -83,11 +84,11 @@ Gem::Specification.new do |s|
83
84
  s.add_dependency(%q<unicorn>, [">= 4.6.2"])
84
85
  s.add_dependency(%q<raindrops>, ["~> 0.11"])
85
86
  s.add_dependency(%q<cli>, ["~> 1.3"])
86
- s.add_dependency(%q<facter>, ["~> 1.6.11"])
87
+ s.add_dependency(%q<facter>, [">= 1.6.11"])
87
88
  s.add_dependency(%q<ruby-ip>, ["~> 0.9"])
88
89
  s.add_dependency(%q<rspec>, ["~> 2.13"])
89
90
  s.add_dependency(%q<rdoc>, ["~> 3.9"])
90
- s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
91
+ s.add_dependency(%q<jeweler>, ["~> 1.8.8"])
91
92
  s.add_dependency(%q<capture-output>, ["~> 1.0"])
92
93
  end
93
94
  end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unicorn-cuba-base
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
5
- prerelease:
4
+ version: 1.4.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Jakub Pastuszek
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-10-02 00:00:00.000000000 Z
11
+ date: 2015-05-06 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: cuba
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: unicorn
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ! '>='
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ! '>='
44
39
  - !ruby/object:Gem::Version
@@ -46,7 +41,6 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: raindrops
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ~>
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - ~>
60
53
  - !ruby/object:Gem::Version
@@ -62,7 +55,6 @@ dependencies:
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: cli
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
59
  - - ~>
68
60
  - !ruby/object:Gem::Version
@@ -70,7 +62,6 @@ dependencies:
70
62
  type: :runtime
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
66
  - - ~>
76
67
  - !ruby/object:Gem::Version
@@ -78,23 +69,20 @@ dependencies:
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: facter
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ~>
73
+ - - ! '>='
84
74
  - !ruby/object:Gem::Version
85
75
  version: 1.6.11
86
76
  type: :runtime
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ~>
80
+ - - ! '>='
92
81
  - !ruby/object:Gem::Version
93
82
  version: 1.6.11
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: ruby-ip
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
87
  - - ~>
100
88
  - !ruby/object:Gem::Version
@@ -102,7 +90,6 @@ dependencies:
102
90
  type: :runtime
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
94
  - - ~>
108
95
  - !ruby/object:Gem::Version
@@ -110,7 +97,6 @@ dependencies:
110
97
  - !ruby/object:Gem::Dependency
111
98
  name: rspec
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
101
  - - ~>
116
102
  - !ruby/object:Gem::Version
@@ -118,7 +104,6 @@ dependencies:
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
108
  - - ~>
124
109
  - !ruby/object:Gem::Version
@@ -126,7 +111,6 @@ dependencies:
126
111
  - !ruby/object:Gem::Dependency
127
112
  name: rdoc
128
113
  requirement: !ruby/object:Gem::Requirement
129
- none: false
130
114
  requirements:
131
115
  - - ~>
132
116
  - !ruby/object:Gem::Version
@@ -134,7 +118,6 @@ dependencies:
134
118
  type: :development
135
119
  prerelease: false
136
120
  version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
121
  requirements:
139
122
  - - ~>
140
123
  - !ruby/object:Gem::Version
@@ -142,23 +125,20 @@ dependencies:
142
125
  - !ruby/object:Gem::Dependency
143
126
  name: jeweler
144
127
  requirement: !ruby/object:Gem::Requirement
145
- none: false
146
128
  requirements:
147
129
  - - ~>
148
130
  - !ruby/object:Gem::Version
149
- version: 1.8.4
131
+ version: 1.8.8
150
132
  type: :development
151
133
  prerelease: false
152
134
  version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
135
  requirements:
155
136
  - - ~>
156
137
  - !ruby/object:Gem::Version
157
- version: 1.8.4
138
+ version: 1.8.8
158
139
  - !ruby/object:Gem::Dependency
159
140
  name: capture-output
160
141
  requirement: !ruby/object:Gem::Requirement
161
- none: false
162
142
  requirements:
163
143
  - - ~>
164
144
  - !ruby/object:Gem::Version
@@ -166,7 +146,6 @@ dependencies:
166
146
  type: :development
167
147
  prerelease: false
168
148
  version_requirements: !ruby/object:Gem::Requirement
169
- none: false
170
149
  requirements:
171
150
  - - ~>
172
151
  - !ruby/object:Gem::Version
@@ -211,29 +190,25 @@ files:
211
190
  homepage: http://github.com/jpastuszek/unicorn-cuba-base
212
191
  licenses:
213
192
  - MIT
193
+ metadata: {}
214
194
  post_install_message:
215
195
  rdoc_options: []
216
196
  require_paths:
217
197
  - lib
218
198
  required_ruby_version: !ruby/object:Gem::Requirement
219
- none: false
220
199
  requirements:
221
200
  - - ! '>='
222
201
  - !ruby/object:Gem::Version
223
202
  version: '0'
224
- segments:
225
- - 0
226
- hash: 1636692029930670871
227
203
  required_rubygems_version: !ruby/object:Gem::Requirement
228
- none: false
229
204
  requirements:
230
205
  - - ! '>='
231
206
  - !ruby/object:Gem::Version
232
207
  version: '0'
233
208
  requirements: []
234
209
  rubyforge_project:
235
- rubygems_version: 1.8.23
210
+ rubygems_version: 2.2.2
236
211
  signing_key:
237
- specification_version: 3
212
+ specification_version: 4
238
213
  summary: web appliaction base powered by Unicorn and Cuba
239
214
  test_files: []