adhearsion 2.0.0.alpha2 → 2.0.0.alpha3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. data/.gitignore +16 -14
  2. data/CHANGELOG.md +17 -1
  3. data/adhearsion.gemspec +14 -13
  4. data/features/cli_basic.feature +30 -0
  5. data/features/cli_create.feature +24 -0
  6. data/features/cli_daemon.feature +21 -0
  7. data/features/cli_generate.feature +9 -0
  8. data/features/cli_start.feature +33 -0
  9. data/features/cli_stop.feature +38 -0
  10. data/features/controller_generator.feature +19 -0
  11. data/features/plugin_generator.feature +55 -0
  12. data/lib/adhearsion.rb +5 -1
  13. data/lib/adhearsion/call.rb +57 -51
  14. data/lib/adhearsion/call_controller.rb +4 -20
  15. data/lib/adhearsion/call_controller/dial.rb +34 -4
  16. data/lib/adhearsion/calls.rb +4 -1
  17. data/lib/adhearsion/cli_commands.rb +31 -6
  18. data/lib/adhearsion/configuration.rb +2 -6
  19. data/lib/adhearsion/console.rb +56 -17
  20. data/lib/adhearsion/generators.rb +53 -2
  21. data/lib/adhearsion/generators/app/app_generator.rb +2 -24
  22. data/lib/adhearsion/generators/app/templates/config/adhearsion.rb +1 -1
  23. data/lib/adhearsion/generators/controller/controller_generator.rb +18 -0
  24. data/lib/adhearsion/generators/controller/templates/lib/controller.rb +4 -0
  25. data/lib/adhearsion/generators/controller/templates/spec/controller_spec.rb +3 -0
  26. data/lib/adhearsion/generators/generator.rb +77 -0
  27. data/lib/adhearsion/generators/plugin/plugin_generator.rb +33 -0
  28. data/lib/adhearsion/generators/plugin/templates/.gitignore +9 -0
  29. data/lib/adhearsion/generators/plugin/templates/Gemfile.tt +4 -0
  30. data/lib/adhearsion/generators/plugin/templates/README.md.tt +2 -0
  31. data/lib/adhearsion/generators/plugin/templates/Rakefile.tt +1 -0
  32. data/lib/adhearsion/generators/plugin/templates/lib/plugin-template.rb.tt +5 -0
  33. data/lib/adhearsion/generators/plugin/templates/lib/plugin-template/controller_methods.rb.tt +10 -0
  34. data/lib/adhearsion/generators/plugin/templates/lib/plugin-template/plugin.rb.tt +29 -0
  35. data/lib/adhearsion/generators/plugin/templates/lib/plugin-template/version.rb.tt +3 -0
  36. data/lib/adhearsion/generators/plugin/templates/plugin-template.gemspec.tt +35 -0
  37. data/lib/adhearsion/generators/plugin/templates/spec/plugin-template/controller_methods_spec.rb.tt +26 -0
  38. data/lib/adhearsion/generators/plugin/templates/spec/spec_helper.rb.tt +13 -0
  39. data/lib/adhearsion/initializer.rb +14 -22
  40. data/lib/adhearsion/logging.rb +25 -16
  41. data/lib/adhearsion/outbound_call.rb +3 -3
  42. data/lib/adhearsion/plugin.rb +14 -0
  43. data/lib/adhearsion/punchblock_plugin.rb +6 -1
  44. data/lib/adhearsion/punchblock_plugin/initializer.rb +8 -8
  45. data/lib/adhearsion/tasks/configuration.rb +1 -1
  46. data/lib/adhearsion/version.rb +1 -1
  47. data/spec/adhearsion/call_controller/dial_spec.rb +108 -17
  48. data/spec/adhearsion/call_controller_spec.rb +7 -64
  49. data/spec/adhearsion/call_spec.rb +48 -29
  50. data/spec/adhearsion/calls_spec.rb +7 -0
  51. data/spec/adhearsion/configuration_spec.rb +14 -14
  52. data/spec/adhearsion/console_spec.rb +124 -4
  53. data/spec/adhearsion/generators_spec.rb +17 -0
  54. data/spec/adhearsion/initializer_spec.rb +22 -18
  55. data/spec/adhearsion/logging_spec.rb +78 -48
  56. data/spec/adhearsion/outbound_call_spec.rb +6 -15
  57. data/spec/adhearsion/plugin_spec.rb +18 -0
  58. data/spec/adhearsion/process_spec.rb +10 -1
  59. data/spec/adhearsion/punchblock_plugin/initializer_spec.rb +8 -6
  60. data/spec/spec_helper.rb +5 -2
  61. data/spec/support/call_controller_test_helpers.rb +1 -1
  62. data/spec/support/initializer_stubs.rb +1 -1
  63. metadata +106 -66
  64. data/features/cli.feature +0 -108
  65. data/lib/adhearsion/initializer/logging.rb +0 -33
  66. data/spec/adhearsion/initializer/logging_spec.rb +0 -55
@@ -10,7 +10,7 @@ describe Adhearsion::Initializer do
10
10
  describe "#start" do
11
11
  before do
12
12
  Adhearsion::Logging.reset
13
- flexmock(Adhearsion::Initializer::Logging).should_receive(:start).once.and_return('')
13
+ flexmock(Adhearsion::Logging).should_receive(:start).once.and_return('')
14
14
  flexmock(::Logging::Appenders::File).should_receive(:assert_valid_logfile).and_return(true)
15
15
  flexmock(::Logging::Appenders).should_receive(:file).and_return(nil)
16
16
  Adhearsion.config = nil
@@ -22,7 +22,7 @@ describe Adhearsion::Initializer do
22
22
 
23
23
  after :all do
24
24
  Adhearsion::Logging.reset
25
- Adhearsion::Initializer::Logging.start
25
+ Adhearsion::Logging.start
26
26
  Adhearsion::Logging.silence!
27
27
  end
28
28
 
@@ -145,7 +145,7 @@ describe Adhearsion::Initializer do
145
145
 
146
146
  after :all do
147
147
  Adhearsion::Logging.reset
148
- Adhearsion::Initializer::Logging.start
148
+ Adhearsion::Logging.start
149
149
  Adhearsion::Logging.silence!
150
150
  Adhearsion::Events.reinitialize_queue!
151
151
  end
@@ -153,7 +153,7 @@ describe Adhearsion::Initializer do
153
153
  it "should start logging with valid parameters" do
154
154
  stub_behavior_for_initializer_with_no_path_changing_behavior do
155
155
  flexmock(File).should_receive(:open).with(File.join(path, 'adhearsion.pid'), 'w', Proc).at_least.once
156
- flexmock(Adhearsion::Initializer::Logging).should_receive(:start).once.with(Array, :info, nil).and_return('')
156
+ flexmock(Adhearsion::Logging).should_receive(:start).once.with(Array, :info, nil).and_return('')
157
157
  Adhearsion::Initializer.start :pid_file => true
158
158
  end
159
159
  end
@@ -192,7 +192,7 @@ describe "Updating RAILS_ENV variable" do
192
192
 
193
193
  before do
194
194
  Adhearsion::Logging.reset
195
- flexmock(Adhearsion::Initializer::Logging).should_receive(:start).once.and_return('')
195
+ flexmock(Adhearsion::Logging).should_receive(:start).once.and_return('')
196
196
  flexmock(::Logging::Appenders::File).should_receive(:assert_valid_logfile).and_return(true)
197
197
  flexmock(::Logging::Appenders).should_receive(:file).and_return(nil)
198
198
  Adhearsion.config = nil
@@ -227,23 +227,27 @@ describe "Updating RAILS_ENV variable" do
227
227
  ENV['RAILS_ENV'] = "test"
228
228
  end
229
229
 
230
- it "should preserve the RAILS_ENV value if AHN_ENV is unset" do
231
- ahn = nil
232
- stub_behavior_for_initializer_with_no_path_changing_behavior do
233
- ahn = Adhearsion::Initializer.start
230
+ context "if AHN_ENV is set" do
231
+ it "should preserve the RAILS_ENV value" do
232
+ ENV['AHN_ENV'] = "production"
233
+ ahn = nil
234
+ stub_behavior_for_initializer_with_no_path_changing_behavior do
235
+ ahn = Adhearsion::Initializer.start
236
+ end
237
+ ahn.update_rails_env_var
238
+ ENV['RAILS_ENV'].should == "test"
234
239
  end
235
- ahn.update_rails_env_var
236
- ENV['RAILS_ENV'].should == "test"
237
240
  end
238
241
 
239
- it "should update the RAILS_ENV value with the AHN_ENV value" do
240
- ENV['AHN_ENV'] = "production"
241
- ahn = nil
242
- stub_behavior_for_initializer_with_no_path_changing_behavior do
243
- ahn = Adhearsion::Initializer.start
242
+ context "if AHN_ENV is unset" do
243
+ it "should preserve the RAILS_ENV value" do
244
+ ahn = nil
245
+ stub_behavior_for_initializer_with_no_path_changing_behavior do
246
+ ahn = Adhearsion::Initializer.start
247
+ end
248
+ ahn.update_rails_env_var
249
+ ENV['RAILS_ENV'].should == "test"
244
250
  end
245
- ahn.update_rails_env_var
246
- ENV['RAILS_ENV'].should == "production"
247
251
  end
248
252
  end
249
253
 
@@ -2,9 +2,18 @@ require 'spec_helper'
2
2
 
3
3
  describe Adhearsion::Logging do
4
4
 
5
+ before :all do
6
+ ::Logging.shutdown
7
+ Adhearsion::Logging.reset
8
+ Adhearsion::Logging.init
9
+ end
10
+
5
11
  before do
6
- defined?(Logging) and Logging.reset
7
- Adhearsion::Initializer::Logging.start
12
+ Adhearsion::Logging.start
13
+ Adhearsion::Logging.silence!
14
+ end
15
+
16
+ after :all do
8
17
  Adhearsion::Logging.silence!
9
18
  end
10
19
 
@@ -12,12 +21,12 @@ describe Adhearsion::Logging do
12
21
  Foo.should respond_to(:logger)
13
22
  end
14
23
 
15
- it 'should created the predefined set of log levels' do
16
- ::Logging::LEVELS.length.should eql(Adhearsion::Logging::LOG_LEVELS.length)
24
+ it 'should be added to any Object instance' do
25
+ Foo.new.should respond_to :logger
17
26
  end
18
27
 
19
- it 'should be added to any Object instance' do
20
- Foo.new.should respond_to(:logger)
28
+ it 'should create the predefined set of log levels' do
29
+ ::Logging::LEVELS.keys.should == Adhearsion::Logging::LOG_LEVELS.map(&:downcase)
21
30
  end
22
31
 
23
32
  it "should log to the Object logger when given arguments" do
@@ -41,60 +50,81 @@ describe Adhearsion::Logging do
41
50
  ::Logging::Repository.instance[FooBar].should_not be_nil
42
51
  end
43
52
 
44
- end
45
-
46
- # Essential for running the tests
47
- describe 'Logger level changing' do
48
-
49
- before do
50
- defined?(Logging) and Logging.reset
51
- Adhearsion::Initializer::Logging.start
53
+ it "initializes properly a Logging object" do
54
+ ::Logging.logger.root.appenders.length.should eql(1)
55
+ ::Logging.logger.root.appenders.select{|a| a.is_a?(::Logging::Appenders::Stdout)}.length.should eql(1)
52
56
  end
53
57
 
54
- after do
55
- Adhearsion::Logging.logging_level = :info
58
+ it "initializes properly a Logging object with appenders as parameter" do
59
+ Adhearsion::Logging.start([::Logging.appenders.stdout, ::Logging.appenders.file('example.log')])
60
+ ::Logging.logger.root.appenders.length.should eql(2)
61
+ ::Logging.logger.root.appenders.select{|a| a.is_a?(::Logging::Appenders::Stdout)}.length.should eql(1)
62
+ ::Logging.logger.root.appenders.select{|a| a.is_a?(::Logging::Appenders::File)}.length.should eql(1)
56
63
  end
57
64
 
58
- after :all do
59
- Adhearsion::Logging.logging_level = :fatal # Silence them again
65
+ it "initializes properly a Logging object with appenders and log level as parameter" do
66
+ Adhearsion::Logging.start([::Logging.appenders.stdout, ::Logging.appenders.file('example.log')], :debug)
67
+ ::Logging.logger.root.appenders.length.should eql(2)
68
+ ::Logging.logger.root.appenders.select{|a| a.is_a?(::Logging::Appenders::Stdout)}.length.should eql(1)
69
+ ::Logging.logger.root.appenders.select{|a| a.is_a?(::Logging::Appenders::File)}.length.should eql(1)
70
+ ::Logging.logger.root.level.should eql(::Logging::LEVELS["debug"])
60
71
  end
61
72
 
62
- it 'changing the logging level should affect all loggers' do
63
- loggers = [::Foo.logger, ::Foo::Bar.logger]
64
- loggers.map(&:level).should_not == [::Logging::LEVELS["debug"]] * 2
65
- loggers.map(&:level).should == [::Logging::LEVELS["info"]] * 2
66
- Adhearsion::Logging.logging_level = :warn
67
- loggers.map(&:level).should == [::Logging::LEVELS["warn"]] * 2
73
+ it "should create only a Logging object per Class (reuse per all the instances)" do
74
+ _logger = Foo.new.logger
75
+ 10.times do
76
+ Foo.new.logger.object_id.should eql(_logger.object_id)
77
+ end
68
78
  end
69
79
 
70
- it 'changing the logging level, using level=, should affect all loggers' do
71
- loggers = [Foo.logger, ::Foo::Bar.logger]
72
- loggers.map(&:level).should_not == [::Logging::LEVELS["debug"]] * 2
73
- loggers.map(&:level).should == [::Logging::LEVELS["info"]] * 2
74
- Adhearsion::Logging.level = :warn
75
- loggers.map(&:level).should == [::Logging::LEVELS["warn"]] * 2
80
+ it "should reuse a Logging instance in all Class instances but not with child instances" do
81
+ _foo_logger = Foo.new.logger
82
+ _bar_logger = Foo::Bar.new.logger
83
+ _foo_logger.object_id.should_not eql(_bar_logger)
76
84
  end
77
85
 
78
- it 'should change all the Logger instance level' do
79
- Foo.logger.level.should be Adhearsion::Logging::INFO
80
- Adhearsion::Logging.logging_level = :fatal
81
- Foo.logger.level.should be Adhearsion::Logging::FATAL
82
- end
86
+ describe 'level changing' do
83
87
 
84
- it 'a new logger should have the :root logging level' do
85
- Foo.logger.level.should be Adhearsion::Logging::INFO
86
- Adhearsion::Logging.logging_level = :fatal
87
- Foo::Bar.logger.level.should be Adhearsion::Logging::FATAL
88
- end
88
+ before { Adhearsion::Logging.unsilence! }
89
+ after { Adhearsion::Logging.unsilence! }
89
90
 
90
- it '#silence!() should change the level to be FATAL' do
91
- Adhearsion::Logging.silence!
92
- Adhearsion::Logging.logging_level.should be(Adhearsion::Logging::FATAL)
93
- end
91
+ it 'changing the logging level should affect all loggers' do
92
+ loggers = [::Foo.logger, ::Foo::Bar.logger]
93
+ loggers.map(&:level).should_not == [Adhearsion::Logging::DEBUG] * 2
94
+ loggers.map(&:level).should == [Adhearsion::Logging::INFO] * 2
95
+ Adhearsion::Logging.logging_level = :warn
96
+ loggers.map(&:level).should == [Adhearsion::Logging::WARN] * 2
97
+ end
94
98
 
95
- it '#unsilence!() should change the level to be INFO' do
96
- Adhearsion::Logging.unsilence!
97
- Adhearsion::Logging.logging_level.should be(Adhearsion::Logging::INFO)
98
- end
99
+ it 'changing the logging level, using level=, should affect all loggers' do
100
+ loggers = [Foo.logger, ::Foo::Bar.logger]
101
+ loggers.map(&:level).should_not == [::Logging::LEVELS["debug"]] * 2
102
+ loggers.map(&:level).should == [::Logging::LEVELS["info"]] * 2
103
+ Adhearsion::Logging.level = :warn
104
+ loggers.map(&:level).should == [::Logging::LEVELS["warn"]] * 2
105
+ end
99
106
 
107
+ it 'should change all the Logger instance level' do
108
+ Foo.logger.level.should be Adhearsion::Logging::INFO
109
+ Adhearsion::Logging.logging_level = :fatal
110
+ Foo.logger.level.should be Adhearsion::Logging::FATAL
111
+ end
112
+
113
+ it 'a new logger should have the :root logging level' do
114
+ Foo.logger.level.should be Adhearsion::Logging::INFO
115
+ Adhearsion::Logging.logging_level = :fatal
116
+ Foo::Bar.logger.level.should be Adhearsion::Logging::FATAL
117
+ end
118
+
119
+ it '#silence! should change the level to be FATAL' do
120
+ Adhearsion::Logging.silence!
121
+ Adhearsion::Logging.logging_level.should be(Adhearsion::Logging::FATAL)
122
+ end
123
+
124
+ it '#unsilence! should change the level to be INFO' do
125
+ Adhearsion::Logging.unsilence!
126
+ Adhearsion::Logging.logging_level.should be(Adhearsion::Logging::INFO)
127
+ end
128
+
129
+ end
100
130
  end
@@ -20,27 +20,18 @@ module Adhearsion
20
20
 
21
21
  let(:mock_call) { OutboundCall.new }
22
22
 
23
- def mock_dial
24
- flexmock(OutboundCall).new_instances.should_receive(:dial).and_return true
25
- end
26
-
27
- it "should create a new call and return it" do
28
- mock_dial
29
- OutboundCall.originate(to).should be_a OutboundCall
30
- end
31
-
32
- it "should dial the call to the correct endpoint" do
23
+ it "should dial the call to the correct endpoint and return it" do
33
24
  mock_call
34
25
  flexmock(OutboundCall).should_receive(:new).and_return mock_call
35
- flexmock(mock_call).should_receive(:dial).with(to, :from => 'foo').once
36
- OutboundCall.originate to, :from => 'foo'
26
+ flexmock(mock_call.wrapped_object).should_receive(:dial).with(to, :from => 'foo').once
27
+ OutboundCall.originate(to, :from => 'foo').should be mock_call
37
28
  end
38
29
 
39
30
  it "should run through the router when the call is answered" do
40
31
  mock_call
41
32
 
42
33
  flexmock(OutboundCall).should_receive(:new).and_return mock_call
43
- flexmock(mock_call).should_receive(:dial).once
34
+ flexmock(mock_call.wrapped_object).should_receive(:dial).once
44
35
 
45
36
  mock_dispatcher = flexmock 'dispatcher'
46
37
  mock_dispatcher.should_receive(:call).once.with mock_call
@@ -66,7 +57,7 @@ module Adhearsion
66
57
 
67
58
  describe "#dial" do
68
59
  def expect_message_waiting_for_response(message)
69
- flexmock(subject).should_receive(:write_and_await_response).once.with(message, 60).and_return do
60
+ flexmock(subject.wrapped_object).should_receive(:write_and_await_response).once.with(message, 60).and_return do
70
61
  message.call_id = call_id
71
62
  message
72
63
  end
@@ -115,7 +106,7 @@ module Adhearsion
115
106
 
116
107
  describe "basic control commands" do
117
108
  def expect_no_message_waiting_for_response
118
- flexmock(subject).should_receive(:write_and_await_response).never
109
+ flexmock(subject.wrapped_object).should_receive(:write_and_await_response).never
119
110
  end
120
111
 
121
112
  describe '#accept' do
@@ -376,4 +376,22 @@ describe Adhearsion::Plugin do
376
376
 
377
377
  end
378
378
 
379
+ describe "registering generators" do
380
+ TestGenerator1 = Class.new Adhearsion::Generators::Generator
381
+ TestGenerator2 = Class.new Adhearsion::Generators::Generator
382
+
383
+ after do
384
+ defined?(FooBar) and Object.send(:remove_const, :"FooBar")
385
+ end
386
+
387
+ it "should add the generator to the index" do
388
+ FooBar = Class.new Adhearsion::Plugin do
389
+ generators :gen1 => TestGenerator1, :gen2 => TestGenerator2
390
+ end
391
+
392
+ Adhearsion::Generators.mappings[:gen1].should be TestGenerator1
393
+ Adhearsion::Generators.mappings[:gen2].should be TestGenerator2
394
+ end
395
+ end
396
+
379
397
  end
@@ -2,6 +2,10 @@ require 'spec_helper'
2
2
 
3
3
  module Adhearsion
4
4
  describe Adhearsion::Process do
5
+ before :all do
6
+ Adhearsion.active_calls.clear!
7
+ end
8
+
5
9
  before :each do
6
10
  Adhearsion::Process.reset
7
11
  end
@@ -23,7 +27,12 @@ module Adhearsion
23
27
  flexmock(Adhearsion).should_receive(:active_calls).and_return calls
24
28
  flexmock(Adhearsion::Process.instance).should_receive(:final_shutdown).once
25
29
  calls = []
26
- 3.times { calls << Thread.new { sleep 1; calls.pop } }
30
+ 3.times do
31
+ calls << Thread.new do
32
+ sleep 1
33
+ calls.pop
34
+ end
35
+ end
27
36
  Adhearsion::Process.stop_when_zero_calls
28
37
  calls.each { |thread| thread.join }
29
38
  end
@@ -37,7 +37,7 @@ module Adhearsion
37
37
  config.reconnect_timer = options[:reconnect_timer] if options.has_key?(:reconnect_timer)
38
38
  end
39
39
 
40
- Initializer.start
40
+ Initializer.init
41
41
  Adhearsion.config[:punchblock]
42
42
  end
43
43
 
@@ -105,7 +105,7 @@ module Adhearsion
105
105
  mock_connection.should_receive(:register_event_handler).once
106
106
  flexmock(::Punchblock::Client).should_receive(:new).once.and_return mock_connection
107
107
  flexmock(mock_connection).should_receive(:run).once
108
- t = Thread.new { Initializer.start }
108
+ t = Thread.new { Initializer.init; Initializer.run }
109
109
  t.join 5
110
110
  t.status.should == "sleep"
111
111
  Events.trigger_immediately :punchblock, ::Punchblock::Connection::Connected.new
@@ -191,6 +191,10 @@ module Adhearsion
191
191
  context "when when Adhearsion::Process is in :running" do
192
192
  let(:process_state) { :running }
193
193
 
194
+ it "should accept the call" do
195
+ mock_call.should_receive(:accept).once
196
+ end
197
+
194
198
  it "should execute the dispatcher provided by the router" do
195
199
  controller = Class.new
196
200
  Adhearsion.router do
@@ -236,7 +240,6 @@ module Adhearsion
236
240
 
237
241
  describe "dispatching a call event" do
238
242
  let(:mock_event) { flexmock 'Event', :call_id => call_id }
239
- let(:latch) { CountDownLatch.new 1 }
240
243
 
241
244
  describe "with an active call" do
242
245
  before do
@@ -250,9 +253,8 @@ module Adhearsion
250
253
  end
251
254
 
252
255
  it "should place the event in the call's inbox" do
253
- mock_call.should_receive(:<<).once.with(mock_event)
254
- Initializer.dispatch_call_event mock_event, latch
255
- latch.wait(10).should be_true
256
+ mock_call.should_receive(:deliver_message!).once.with(mock_event)
257
+ Initializer.dispatch_call_event mock_event
256
258
  end
257
259
  end
258
260
 
@@ -46,7 +46,6 @@ end
46
46
 
47
47
  Adhearsion::Logging.silence!
48
48
 
49
-
50
49
  # Test modules for #mixin methods
51
50
  module TestBiscuit
52
51
  def throwadogabone
@@ -58,4 +57,8 @@ module MarmaladeIsBetterThanJam
58
57
  def sobittersweet
59
58
  true
60
59
  end
61
- end
60
+ end
61
+
62
+ def new_uuid
63
+ UUID.new.generate.to_s
64
+ end
@@ -2,7 +2,7 @@ module CallControllerTestHelpers
2
2
  include FlexMock::ArgumentTypes
3
3
 
4
4
  def self.included(test_case)
5
- test_case.let(:call_id) { rand }
5
+ test_case.let(:call_id) { new_uuid }
6
6
  test_case.let(:call) { Adhearsion::Call.new }
7
7
  test_case.let(:block) { nil }
8
8
 
@@ -1,6 +1,6 @@
1
1
  module InitializerStubs
2
2
  UNWANTED_BEHAVIOR = {
3
- Adhearsion::Initializer => [:initialize_log_paths, :update_rails_env_var, :daemonize!, :require, :init_plugins, :load_lib_folder]
3
+ Adhearsion::Initializer => [:initialize_log_paths, :update_rails_env_var, :daemonize!, :require, :init_plugins, :run_plugins, :load_lib_folder]
4
4
  } unless defined? UNWANTED_BEHAVIOR
5
5
 
6
6
  def stub_behavior_for_initializer_with_no_path_changing_behavior
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adhearsion
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.alpha2
4
+ version: 2.0.0.alpha3
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -12,11 +12,11 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2012-01-30 00:00:00.000000000 Z
15
+ date: 2012-02-21 00:00:00.000000000Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: bundler
19
- requirement: &2156512600 !ruby/object:Gem::Requirement
19
+ requirement: &2171040300 !ruby/object:Gem::Requirement
20
20
  none: false
21
21
  requirements:
22
22
  - - ! '>='
@@ -24,10 +24,10 @@ dependencies:
24
24
  version: 1.0.10
25
25
  type: :runtime
26
26
  prerelease: false
27
- version_requirements: *2156512600
27
+ version_requirements: *2171040300
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: punchblock
30
- requirement: &2156510520 !ruby/object:Gem::Requirement
30
+ requirement: &2171038740 !ruby/object:Gem::Requirement
31
31
  none: false
32
32
  requirements:
33
33
  - - ! '>='
@@ -35,10 +35,10 @@ dependencies:
35
35
  version: 0.9.1
36
36
  type: :runtime
37
37
  prerelease: false
38
- version_requirements: *2156510520
38
+ version_requirements: *2171038740
39
39
  - !ruby/object:Gem::Dependency
40
40
  name: logging
41
- requirement: &2156507840 !ruby/object:Gem::Requirement
41
+ requirement: &2171037040 !ruby/object:Gem::Requirement
42
42
  none: false
43
43
  requirements:
44
44
  - - ! '>='
@@ -46,10 +46,10 @@ dependencies:
46
46
  version: 1.6.1
47
47
  type: :runtime
48
48
  prerelease: false
49
- version_requirements: *2156507840
49
+ version_requirements: *2171037040
50
50
  - !ruby/object:Gem::Dependency
51
51
  name: adhearsion-loquacious
52
- requirement: &2156520680 !ruby/object:Gem::Requirement
52
+ requirement: &2171035680 !ruby/object:Gem::Requirement
53
53
  none: false
54
54
  requirements:
55
55
  - - ! '>='
@@ -57,10 +57,10 @@ dependencies:
57
57
  version: 1.9.0
58
58
  type: :runtime
59
59
  prerelease: false
60
- version_requirements: *2156520680
60
+ version_requirements: *2171035680
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: activesupport
63
- requirement: &2156519300 !ruby/object:Gem::Requirement
63
+ requirement: &2171033860 !ruby/object:Gem::Requirement
64
64
  none: false
65
65
  requirements:
66
66
  - - ! '>='
@@ -68,10 +68,10 @@ dependencies:
68
68
  version: 3.0.10
69
69
  type: :runtime
70
70
  prerelease: false
71
- version_requirements: *2156519300
71
+ version_requirements: *2171033860
72
72
  - !ruby/object:Gem::Dependency
73
73
  name: i18n
74
- requirement: &2156517360 !ruby/object:Gem::Requirement
74
+ requirement: &2171032700 !ruby/object:Gem::Requirement
75
75
  none: false
76
76
  requirements:
77
77
  - - ! '>='
@@ -79,10 +79,10 @@ dependencies:
79
79
  version: 0.5.0
80
80
  type: :runtime
81
81
  prerelease: false
82
- version_requirements: *2156517360
82
+ version_requirements: *2171032700
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: json
85
- requirement: &2156515880 !ruby/object:Gem::Requirement
85
+ requirement: &2171031740 !ruby/object:Gem::Requirement
86
86
  none: false
87
87
  requirements:
88
88
  - - ! '>='
@@ -90,10 +90,10 @@ dependencies:
90
90
  version: '0'
91
91
  type: :runtime
92
92
  prerelease: false
93
- version_requirements: *2156515880
93
+ version_requirements: *2171031740
94
94
  - !ruby/object:Gem::Dependency
95
95
  name: thor
96
- requirement: &2156515300 !ruby/object:Gem::Requirement
96
+ requirement: &2171030940 !ruby/object:Gem::Requirement
97
97
  none: false
98
98
  requirements:
99
99
  - - ! '>='
@@ -101,10 +101,10 @@ dependencies:
101
101
  version: '0'
102
102
  type: :runtime
103
103
  prerelease: false
104
- version_requirements: *2156515300
104
+ version_requirements: *2171030940
105
105
  - !ruby/object:Gem::Dependency
106
106
  name: rake
107
- requirement: &2156513900 !ruby/object:Gem::Requirement
107
+ requirement: &2171029980 !ruby/object:Gem::Requirement
108
108
  none: false
109
109
  requirements:
110
110
  - - ! '>='
@@ -112,10 +112,10 @@ dependencies:
112
112
  version: '0'
113
113
  type: :runtime
114
114
  prerelease: false
115
- version_requirements: *2156513900
115
+ version_requirements: *2171029980
116
116
  - !ruby/object:Gem::Dependency
117
117
  name: pry
118
- requirement: &2156526580 !ruby/object:Gem::Requirement
118
+ requirement: &2171029320 !ruby/object:Gem::Requirement
119
119
  none: false
120
120
  requirements:
121
121
  - - ! '>='
@@ -123,10 +123,10 @@ dependencies:
123
123
  version: '0'
124
124
  type: :runtime
125
125
  prerelease: false
126
- version_requirements: *2156526580
126
+ version_requirements: *2171029320
127
127
  - !ruby/object:Gem::Dependency
128
128
  name: uuid
129
- requirement: &2156524260 !ruby/object:Gem::Requirement
129
+ requirement: &2171028220 !ruby/object:Gem::Requirement
130
130
  none: false
131
131
  requirements:
132
132
  - - ! '>='
@@ -134,10 +134,10 @@ dependencies:
134
134
  version: '0'
135
135
  type: :runtime
136
136
  prerelease: false
137
- version_requirements: *2156524260
137
+ version_requirements: *2171028220
138
138
  - !ruby/object:Gem::Dependency
139
139
  name: future-resource
140
- requirement: &2156522060 !ruby/object:Gem::Requirement
140
+ requirement: &2171026980 !ruby/object:Gem::Requirement
141
141
  none: false
142
142
  requirements:
143
143
  - - ! '>='
@@ -145,10 +145,10 @@ dependencies:
145
145
  version: 0.0.2
146
146
  type: :runtime
147
147
  prerelease: false
148
- version_requirements: *2156522060
148
+ version_requirements: *2171026980
149
149
  - !ruby/object:Gem::Dependency
150
150
  name: ruby_speech
151
- requirement: &2156535940 !ruby/object:Gem::Requirement
151
+ requirement: &2171025760 !ruby/object:Gem::Requirement
152
152
  none: false
153
153
  requirements:
154
154
  - - ! '>='
@@ -156,10 +156,10 @@ dependencies:
156
156
  version: 0.4.0
157
157
  type: :runtime
158
158
  prerelease: false
159
- version_requirements: *2156535940
159
+ version_requirements: *2171025760
160
160
  - !ruby/object:Gem::Dependency
161
161
  name: countdownlatch
162
- requirement: &2156531620 !ruby/object:Gem::Requirement
162
+ requirement: &2171024940 !ruby/object:Gem::Requirement
163
163
  none: false
164
164
  requirements:
165
165
  - - ! '>='
@@ -167,10 +167,10 @@ dependencies:
167
167
  version: '0'
168
168
  type: :runtime
169
169
  prerelease: false
170
- version_requirements: *2156531620
170
+ version_requirements: *2171024940
171
171
  - !ruby/object:Gem::Dependency
172
172
  name: has-guarded-handlers
173
- requirement: &2156548760 !ruby/object:Gem::Requirement
173
+ requirement: &2171023680 !ruby/object:Gem::Requirement
174
174
  none: false
175
175
  requirements:
176
176
  - - ! '>='
@@ -178,10 +178,10 @@ dependencies:
178
178
  version: 1.1.0
179
179
  type: :runtime
180
180
  prerelease: false
181
- version_requirements: *2156548760
181
+ version_requirements: *2171023680
182
182
  - !ruby/object:Gem::Dependency
183
183
  name: girl_friday
184
- requirement: &2156546880 !ruby/object:Gem::Requirement
184
+ requirement: &2171022800 !ruby/object:Gem::Requirement
185
185
  none: false
186
186
  requirements:
187
187
  - - ! '>='
@@ -189,10 +189,10 @@ dependencies:
189
189
  version: '0'
190
190
  type: :runtime
191
191
  prerelease: false
192
- version_requirements: *2156546880
192
+ version_requirements: *2171022800
193
193
  - !ruby/object:Gem::Dependency
194
194
  name: ffi
195
- requirement: &2156544980 !ruby/object:Gem::Requirement
195
+ requirement: &2171019620 !ruby/object:Gem::Requirement
196
196
  none: false
197
197
  requirements:
198
198
  - - ! '>='
@@ -200,10 +200,21 @@ dependencies:
200
200
  version: 1.0.11
201
201
  type: :runtime
202
202
  prerelease: false
203
- version_requirements: *2156544980
203
+ version_requirements: *2171019620
204
+ - !ruby/object:Gem::Dependency
205
+ name: celluloid
206
+ requirement: &2171018040 !ruby/object:Gem::Requirement
207
+ none: false
208
+ requirements:
209
+ - - ! '>='
210
+ - !ruby/object:Gem::Version
211
+ version: 0.9.0
212
+ type: :runtime
213
+ prerelease: false
214
+ version_requirements: *2171018040
204
215
  - !ruby/object:Gem::Dependency
205
216
  name: rspec
206
- requirement: &2156543340 !ruby/object:Gem::Requirement
217
+ requirement: &2171016200 !ruby/object:Gem::Requirement
207
218
  none: false
208
219
  requirements:
209
220
  - - ~>
@@ -211,10 +222,10 @@ dependencies:
211
222
  version: 2.7.0
212
223
  type: :development
213
224
  prerelease: false
214
- version_requirements: *2156543340
225
+ version_requirements: *2171016200
215
226
  - !ruby/object:Gem::Dependency
216
227
  name: flexmock
217
- requirement: &2156557680 !ruby/object:Gem::Requirement
228
+ requirement: &2171015400 !ruby/object:Gem::Requirement
218
229
  none: false
219
230
  requirements:
220
231
  - - ! '>='
@@ -222,10 +233,10 @@ dependencies:
222
233
  version: '0'
223
234
  type: :development
224
235
  prerelease: false
225
- version_requirements: *2156557680
236
+ version_requirements: *2171015400
226
237
  - !ruby/object:Gem::Dependency
227
238
  name: activerecord
228
- requirement: &2156555880 !ruby/object:Gem::Requirement
239
+ requirement: &2171014100 !ruby/object:Gem::Requirement
229
240
  none: false
230
241
  requirements:
231
242
  - - ! '>='
@@ -233,10 +244,10 @@ dependencies:
233
244
  version: 3.0.10
234
245
  type: :development
235
246
  prerelease: false
236
- version_requirements: *2156555880
247
+ version_requirements: *2171014100
237
248
  - !ruby/object:Gem::Dependency
238
249
  name: simplecov
239
- requirement: &2156554720 !ruby/object:Gem::Requirement
250
+ requirement: &2171012660 !ruby/object:Gem::Requirement
240
251
  none: false
241
252
  requirements:
242
253
  - - ! '>='
@@ -244,10 +255,10 @@ dependencies:
244
255
  version: '0'
245
256
  type: :development
246
257
  prerelease: false
247
- version_requirements: *2156554720
258
+ version_requirements: *2171012660
248
259
  - !ruby/object:Gem::Dependency
249
260
  name: simplecov-rcov
250
- requirement: &2156553700 !ruby/object:Gem::Requirement
261
+ requirement: &2171010880 !ruby/object:Gem::Requirement
251
262
  none: false
252
263
  requirements:
253
264
  - - ! '>='
@@ -255,10 +266,10 @@ dependencies:
255
266
  version: '0'
256
267
  type: :development
257
268
  prerelease: false
258
- version_requirements: *2156553700
269
+ version_requirements: *2171010880
259
270
  - !ruby/object:Gem::Dependency
260
271
  name: ci_reporter
261
- requirement: &2156551580 !ruby/object:Gem::Requirement
272
+ requirement: &2171010080 !ruby/object:Gem::Requirement
262
273
  none: false
263
274
  requirements:
264
275
  - - ! '>='
@@ -266,10 +277,10 @@ dependencies:
266
277
  version: '0'
267
278
  type: :development
268
279
  prerelease: false
269
- version_requirements: *2156551580
280
+ version_requirements: *2171010080
270
281
  - !ruby/object:Gem::Dependency
271
282
  name: yard
272
- requirement: &2156550720 !ruby/object:Gem::Requirement
283
+ requirement: &2171009420 !ruby/object:Gem::Requirement
273
284
  none: false
274
285
  requirements:
275
286
  - - ! '>='
@@ -277,10 +288,10 @@ dependencies:
277
288
  version: '0'
278
289
  type: :development
279
290
  prerelease: false
280
- version_requirements: *2156550720
291
+ version_requirements: *2171009420
281
292
  - !ruby/object:Gem::Dependency
282
293
  name: guard-rspec
283
- requirement: &2156568080 !ruby/object:Gem::Requirement
294
+ requirement: &2171008880 !ruby/object:Gem::Requirement
284
295
  none: false
285
296
  requirements:
286
297
  - - ! '>='
@@ -288,10 +299,10 @@ dependencies:
288
299
  version: '0'
289
300
  type: :development
290
301
  prerelease: false
291
- version_requirements: *2156568080
302
+ version_requirements: *2171008880
292
303
  - !ruby/object:Gem::Dependency
293
304
  name: guard-cucumber
294
- requirement: &2156562800 !ruby/object:Gem::Requirement
305
+ requirement: &2170971440 !ruby/object:Gem::Requirement
295
306
  none: false
296
307
  requirements:
297
308
  - - ! '>='
@@ -299,10 +310,10 @@ dependencies:
299
310
  version: '0'
300
311
  type: :development
301
312
  prerelease: false
302
- version_requirements: *2156562800
313
+ version_requirements: *2170971440
303
314
  - !ruby/object:Gem::Dependency
304
315
  name: ruby_gntp
305
- requirement: &2156587720 !ruby/object:Gem::Requirement
316
+ requirement: &2170970720 !ruby/object:Gem::Requirement
306
317
  none: false
307
318
  requirements:
308
319
  - - ! '>='
@@ -310,10 +321,10 @@ dependencies:
310
321
  version: '0'
311
322
  type: :development
312
323
  prerelease: false
313
- version_requirements: *2156587720
324
+ version_requirements: *2170970720
314
325
  - !ruby/object:Gem::Dependency
315
326
  name: cucumber
316
- requirement: &2156585660 !ruby/object:Gem::Requirement
327
+ requirement: &2170969740 !ruby/object:Gem::Requirement
317
328
  none: false
318
329
  requirements:
319
330
  - - ! '>='
@@ -321,10 +332,10 @@ dependencies:
321
332
  version: '0'
322
333
  type: :development
323
334
  prerelease: false
324
- version_requirements: *2156585660
335
+ version_requirements: *2170969740
325
336
  - !ruby/object:Gem::Dependency
326
337
  name: aruba
327
- requirement: &2156584040 !ruby/object:Gem::Requirement
338
+ requirement: &2170968180 !ruby/object:Gem::Requirement
328
339
  none: false
329
340
  requirements:
330
341
  - - ! '>='
@@ -332,7 +343,7 @@ dependencies:
332
343
  version: '0'
333
344
  type: :development
334
345
  prerelease: false
335
- version_requirements: *2156584040
346
+ version_requirements: *2170968180
336
347
  description: Adhearsion is an open-source telephony development framework
337
348
  email: dev&Adhearsion.com
338
349
  executables:
@@ -354,7 +365,14 @@ files:
354
365
  - bin/ahn
355
366
  - cucumber.yml
356
367
  - features/app_generator.feature
357
- - features/cli.feature
368
+ - features/cli_basic.feature
369
+ - features/cli_create.feature
370
+ - features/cli_daemon.feature
371
+ - features/cli_generate.feature
372
+ - features/cli_start.feature
373
+ - features/cli_stop.feature
374
+ - features/controller_generator.feature
375
+ - features/plugin_generator.feature
358
376
  - features/step_definitions/app_generator_steps.rb
359
377
  - features/step_definitions/cli_steps.rb
360
378
  - features/support/aruba_helper.rb
@@ -393,8 +411,23 @@ files:
393
411
  - lib/adhearsion/generators/app/templates/gitignore
394
412
  - lib/adhearsion/generators/app/templates/lib/simon_game.rb
395
413
  - lib/adhearsion/generators/app/templates/script/ahn
414
+ - lib/adhearsion/generators/controller/controller_generator.rb
415
+ - lib/adhearsion/generators/controller/templates/lib/controller.rb
416
+ - lib/adhearsion/generators/controller/templates/spec/controller_spec.rb
417
+ - lib/adhearsion/generators/generator.rb
418
+ - lib/adhearsion/generators/plugin/plugin_generator.rb
419
+ - lib/adhearsion/generators/plugin/templates/.gitignore
420
+ - lib/adhearsion/generators/plugin/templates/Gemfile.tt
421
+ - lib/adhearsion/generators/plugin/templates/README.md.tt
422
+ - lib/adhearsion/generators/plugin/templates/Rakefile.tt
423
+ - lib/adhearsion/generators/plugin/templates/lib/plugin-template.rb.tt
424
+ - lib/adhearsion/generators/plugin/templates/lib/plugin-template/controller_methods.rb.tt
425
+ - lib/adhearsion/generators/plugin/templates/lib/plugin-template/plugin.rb.tt
426
+ - lib/adhearsion/generators/plugin/templates/lib/plugin-template/version.rb.tt
427
+ - lib/adhearsion/generators/plugin/templates/plugin-template.gemspec.tt
428
+ - lib/adhearsion/generators/plugin/templates/spec/plugin-template/controller_methods_spec.rb.tt
429
+ - lib/adhearsion/generators/plugin/templates/spec/spec_helper.rb.tt
396
430
  - lib/adhearsion/initializer.rb
397
- - lib/adhearsion/initializer/logging.rb
398
431
  - lib/adhearsion/linux_proc_name.rb
399
432
  - lib/adhearsion/logging.rb
400
433
  - lib/adhearsion/menu_dsl.rb
@@ -433,7 +466,7 @@ files:
433
466
  - spec/adhearsion/configuration_spec.rb
434
467
  - spec/adhearsion/console_spec.rb
435
468
  - spec/adhearsion/events_spec.rb
436
- - spec/adhearsion/initializer/logging_spec.rb
469
+ - spec/adhearsion/generators_spec.rb
437
470
  - spec/adhearsion/initializer_spec.rb
438
471
  - spec/adhearsion/logging_spec.rb
439
472
  - spec/adhearsion/menu_dsl/calculated_match_collection_spec.rb
@@ -472,7 +505,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
472
505
  version: '0'
473
506
  segments:
474
507
  - 0
475
- hash: -2359996897687755183
508
+ hash: -1198285695907666216
476
509
  required_rubygems_version: !ruby/object:Gem::Requirement
477
510
  none: false
478
511
  requirements:
@@ -487,7 +520,14 @@ specification_version: 3
487
520
  summary: Adhearsion, open-source telephony development framework
488
521
  test_files:
489
522
  - features/app_generator.feature
490
- - features/cli.feature
523
+ - features/cli_basic.feature
524
+ - features/cli_create.feature
525
+ - features/cli_daemon.feature
526
+ - features/cli_generate.feature
527
+ - features/cli_start.feature
528
+ - features/cli_stop.feature
529
+ - features/controller_generator.feature
530
+ - features/plugin_generator.feature
491
531
  - features/step_definitions/app_generator_steps.rb
492
532
  - features/step_definitions/cli_steps.rb
493
533
  - features/support/aruba_helper.rb
@@ -504,7 +544,7 @@ test_files:
504
544
  - spec/adhearsion/configuration_spec.rb
505
545
  - spec/adhearsion/console_spec.rb
506
546
  - spec/adhearsion/events_spec.rb
507
- - spec/adhearsion/initializer/logging_spec.rb
547
+ - spec/adhearsion/generators_spec.rb
508
548
  - spec/adhearsion/initializer_spec.rb
509
549
  - spec/adhearsion/logging_spec.rb
510
550
  - spec/adhearsion/menu_dsl/calculated_match_collection_spec.rb