torquebox-configure 2.1.2-java → 2.2.0-java
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.
@@ -20,6 +20,7 @@ require 'torquebox/configuration'
|
|
20
20
|
|
21
21
|
module TorqueBox
|
22
22
|
module Configuration
|
23
|
+
# @api private
|
23
24
|
class GlobalConfiguration < TorqueBox::Configuration::Configuration
|
24
25
|
def self.load_configuration(file)
|
25
26
|
config = new
|
@@ -62,6 +63,7 @@ module TorqueBox
|
|
62
63
|
:optional => [
|
63
64
|
:concurrency,
|
64
65
|
{ :disabled => [true, false] },
|
66
|
+
{ :durable => [true, false] },
|
65
67
|
:default_message_encoding
|
66
68
|
]
|
67
69
|
}),
|
@@ -108,7 +110,7 @@ module TorqueBox
|
|
108
110
|
|
109
111
|
:topic => destination_entry,
|
110
112
|
:web => OptionsEntry.with_settings(:validate => {
|
111
|
-
:optional => [:context, :host, :rackup, :static, :'session-timeout' ]
|
113
|
+
:optional => [:context, :host, :rackup, :static, :'session-timeout', :session_timeout]
|
112
114
|
})
|
113
115
|
}
|
114
116
|
end.call
|
@@ -34,6 +34,7 @@ module TorqueBox
|
|
34
34
|
FakeConstant.new( name ).to_const
|
35
35
|
end
|
36
36
|
|
37
|
+
# @api private
|
37
38
|
class Entry < BlankSlate
|
38
39
|
def initialize(name, config, entry_map, options = { })
|
39
40
|
@name = name
|
@@ -133,6 +134,7 @@ module TorqueBox
|
|
133
134
|
end
|
134
135
|
end
|
135
136
|
|
137
|
+
# @api private
|
136
138
|
class OptionsEntry < Entry
|
137
139
|
def process_args(args)
|
138
140
|
hash = args.first || { }
|
@@ -141,6 +143,7 @@ module TorqueBox
|
|
141
143
|
end
|
142
144
|
end
|
143
145
|
|
146
|
+
# @api private
|
144
147
|
class ThingWithOptionsEntry < Entry
|
145
148
|
def process_args(args)
|
146
149
|
@thing, hash = args
|
@@ -157,19 +160,22 @@ module TorqueBox
|
|
157
160
|
end
|
158
161
|
end
|
159
162
|
|
163
|
+
# @api private
|
160
164
|
class ThingsEntry < Entry
|
161
165
|
def process_args(args)
|
162
166
|
@entry_options = args.map(&:to_s)
|
163
167
|
local_config
|
164
168
|
end
|
165
169
|
end
|
166
|
-
|
170
|
+
|
171
|
+
# @api private
|
167
172
|
class Configuration < Hash
|
168
173
|
def initialize
|
169
174
|
super { |hash, key| hash[key] = { } }
|
170
175
|
end
|
171
176
|
end
|
172
177
|
|
178
|
+
# @api private
|
173
179
|
class FakeConstant
|
174
180
|
def initialize(name)
|
175
181
|
@name = name.to_s
|
data/lib/torquebox-configure.jar
CHANGED
Binary file
|
data/lib/torquebox-configure.rb
CHANGED
data/spec/global_spec.rb
CHANGED
@@ -166,9 +166,9 @@ describe "TorqueBox.configure using the GlobalConfiguration" do
|
|
166
166
|
describe '#web' do
|
167
167
|
before(:each) { @method = 'web' }
|
168
168
|
it_should_behave_like 'options'
|
169
|
-
|
169
|
+
|
170
170
|
it_should_not_allow_invalid_options { web :foo => :bar }
|
171
|
-
it_should_allow_valid_options { web :context => '', :host => '', :rackup => '', :static => '' }
|
171
|
+
it_should_allow_valid_options { web :context => '', :host => '', :rackup => '', :static => '', :session_timeout => '1s' }
|
172
172
|
end
|
173
173
|
|
174
174
|
describe '#pool' do
|
@@ -253,10 +253,10 @@ describe "TorqueBox.configure using the GlobalConfiguration" do
|
|
253
253
|
it_should_behave_like 'a thing with options'
|
254
254
|
|
255
255
|
it_should_not_allow_invalid_options { options_for 'a-name', :foo => :bar }
|
256
|
-
it_should_allow_valid_options { options_for 'a-name', :concurrency => 1, :disabled => true }
|
256
|
+
it_should_allow_valid_options { options_for 'a-name', :concurrency => 1, :disabled => true, :durable => true }
|
257
257
|
|
258
|
-
it_should_not_allow_invalid_option_values { options_for 'a-name', :disabled => :bacon }
|
259
|
-
it_should_allow_valid_option_values { options_for 'a-name', :disabled => false }
|
258
|
+
it_should_not_allow_invalid_option_values { options_for 'a-name', :disabled => :bacon, :durable => :bacon }
|
259
|
+
it_should_allow_valid_option_values { options_for 'a-name', :disabled => false, :durable => false }
|
260
260
|
end
|
261
261
|
|
262
262
|
describe "#service" do
|
@@ -430,7 +430,7 @@ describe "TorqueBox.configure using the GlobalConfiguration" do
|
|
430
430
|
:config => { :foo => :bar }
|
431
431
|
} ] ],
|
432
432
|
'options_for' => {
|
433
|
-
FakeConstant.new( 'Backgroundable' ) => { :concurrency => 42 },
|
433
|
+
FakeConstant.new( 'Backgroundable' ) => { :concurrency => 42, :durable => false },
|
434
434
|
'messaging' => { :default_message_encoding => :biscuit },
|
435
435
|
'jobs' => { :concurrency => 55 }
|
436
436
|
|
@@ -467,7 +467,8 @@ describe "TorqueBox.configure using the GlobalConfiguration" do
|
|
467
467
|
:client_id => 'client-id',
|
468
468
|
:config => { :foo => :bar } } ] ] } },
|
469
469
|
'web' => { :context => '/bacon',
|
470
|
-
:host => ['host1', 'host2']
|
470
|
+
:host => ['host1', 'host2'],
|
471
|
+
:session_timeout => '42m' }
|
471
472
|
}
|
472
473
|
|
473
474
|
@metadata = @config.to_metadata_hash
|
@@ -504,6 +505,7 @@ describe "TorqueBox.configure using the GlobalConfiguration" do
|
|
504
505
|
|
505
506
|
it "should properly set task options from options_for" do
|
506
507
|
@metadata['tasks']['Backgroundable']['concurrency'].should == 42
|
508
|
+
@metadata['tasks']['Backgroundable']['durable'].should == false
|
507
509
|
end
|
508
510
|
|
509
511
|
it "should properly set pooling" do
|
@@ -559,7 +561,9 @@ describe "TorqueBox.configure using the GlobalConfiguration" do
|
|
559
561
|
@metadata['web']['host'].to_a.should == ['host1', 'host2']
|
560
562
|
end
|
561
563
|
|
562
|
-
|
564
|
+
it "should properly set session_timeout" do
|
565
|
+
@metadata['web']['session_timeout'].should == '42m'
|
566
|
+
end
|
563
567
|
end
|
564
568
|
|
565
569
|
end
|
metadata
CHANGED
@@ -1,87 +1,93 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: torquebox-configure
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
version: 2.
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 2.2.0
|
6
6
|
platform: java
|
7
|
-
authors:
|
8
|
-
|
9
|
-
autorequire:
|
7
|
+
authors:
|
8
|
+
- The TorqueBox Team
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
12
|
+
date: 2012-12-06 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: blankslate
|
16
|
+
version_requirements: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - '='
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: 2.1.2.4
|
21
|
+
none: false
|
22
|
+
requirement: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 2.1.2.4
|
27
|
+
none: false
|
28
|
+
prerelease: false
|
29
|
+
type: :runtime
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rspec
|
32
|
+
version_requirements: !ruby/object:Gem::Requirement
|
33
|
+
requirements:
|
34
|
+
- - '='
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: 2.7.0
|
37
|
+
none: false
|
38
|
+
requirement: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - '='
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 2.7.0
|
43
|
+
none: false
|
44
|
+
prerelease: false
|
45
|
+
type: :development
|
46
|
+
description: ''
|
47
|
+
email:
|
48
|
+
- torquebox-dev@torquebox.org
|
40
49
|
executables: []
|
41
|
-
|
42
50
|
extensions: []
|
43
|
-
|
44
51
|
extra_rdoc_files: []
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
- spec/validator_spec.rb
|
52
|
+
files:
|
53
|
+
- licenses/lgpl-2.1.txt
|
54
|
+
- lib/torquebox-configure.jar
|
55
|
+
- lib/torquebox-configure.rb
|
56
|
+
- lib/gem_hook.rb
|
57
|
+
- lib/torquebox/configure.rb
|
58
|
+
- lib/torquebox/configuration.rb
|
59
|
+
- lib/torquebox/configuration/global.rb
|
60
|
+
- lib/torquebox/configuration/validator.rb
|
61
|
+
- spec/global_spec.rb
|
62
|
+
- spec/options_macros.rb
|
63
|
+
- spec/validator_spec.rb
|
58
64
|
homepage: http://torquebox.org/
|
59
|
-
licenses:
|
60
|
-
|
61
|
-
post_install_message:
|
65
|
+
licenses:
|
66
|
+
- lgpl
|
67
|
+
post_install_message:
|
62
68
|
rdoc_options: []
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
69
|
+
require_paths:
|
70
|
+
- lib
|
71
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ! '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: !binary |-
|
76
|
+
MA==
|
67
77
|
none: false
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
78
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ! '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: !binary |-
|
83
|
+
MA==
|
73
84
|
none: false
|
74
|
-
requirements:
|
75
|
-
- - ">="
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
version: "0"
|
78
85
|
requirements: []
|
79
|
-
|
80
|
-
rubyforge_project:
|
86
|
+
rubyforge_project:
|
81
87
|
rubygems_version: 1.8.24
|
82
|
-
signing_key:
|
88
|
+
signing_key:
|
83
89
|
specification_version: 3
|
84
90
|
summary: TorqueBox Configure Gem
|
85
|
-
test_files:
|
86
|
-
|
87
|
-
|
91
|
+
test_files:
|
92
|
+
- spec/global_spec.rb
|
93
|
+
- spec/validator_spec.rb
|