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
@@ -19,6 +19,7 @@ require 'torquebox/configuration'
19
19
 
20
20
  module TorqueBox
21
21
  module Configuration
22
+ # @api private
22
23
  class Validator
23
24
 
24
25
  def initialize(ruleset, entry, options_to_validate)
@@ -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
Binary file
@@ -1,6 +1,6 @@
1
1
  module TorqueboxConfigure
2
- VERSION = '2.1.2'
3
- MAVEN_VERSION = '2.1.2'
2
+ VERSION = '2.2.0'
3
+ MAVEN_VERSION = '2.2.0'
4
4
  end
5
5
  begin
6
6
  require 'java'
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.1.2
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 2.2.0
6
6
  platform: java
7
- authors:
8
- - The TorqueBox Team
9
- autorequire:
7
+ authors:
8
+ - The TorqueBox Team
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2012-09-24 00:00:00 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: blankslate
17
- prerelease: false
18
- requirement: &id001 !ruby/object:Gem::Requirement
19
- none: false
20
- requirements:
21
- - - "="
22
- - !ruby/object:Gem::Version
23
- version: 2.1.2.4
24
- type: :runtime
25
- version_requirements: *id001
26
- - !ruby/object:Gem::Dependency
27
- name: rspec
28
- prerelease: false
29
- requirement: &id002 !ruby/object:Gem::Requirement
30
- none: false
31
- requirements:
32
- - - "="
33
- - !ruby/object:Gem::Version
34
- version: 2.7.0
35
- type: :development
36
- version_requirements: *id002
37
- description: ""
38
- email:
39
- - torquebox-dev@torquebox.org
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
- files:
47
- - licenses/lgpl-2.1.txt
48
- - lib/torquebox-configure.jar
49
- - lib/torquebox-configure.rb
50
- - lib/gem_hook.rb
51
- - lib/torquebox/configuration.rb
52
- - lib/torquebox/configure.rb
53
- - lib/torquebox/configuration/validator.rb
54
- - lib/torquebox/configuration/global.rb
55
- - spec/global_spec.rb
56
- - spec/options_macros.rb
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
- - lgpl
61
- post_install_message:
65
+ licenses:
66
+ - lgpl
67
+ post_install_message:
62
68
  rdoc_options: []
63
-
64
- require_paths:
65
- - lib
66
- required_ruby_version: !ruby/object:Gem::Requirement
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
- requirements:
69
- - - ">="
70
- - !ruby/object:Gem::Version
71
- version: "0"
72
- required_rubygems_version: !ruby/object:Gem::Requirement
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
- - spec/global_spec.rb
87
- - spec/validator_spec.rb
91
+ test_files:
92
+ - spec/global_spec.rb
93
+ - spec/validator_spec.rb