james 0.0.2-universal-darwin-10 → 0.0.3-universal-darwin-10

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.
data/lib/james.rb CHANGED
@@ -11,8 +11,14 @@ require File.expand_path '../james/controller', __FILE__
11
11
 
12
12
  module James
13
13
 
14
+ # Start a new controller and listen.
15
+ #
16
+ # Will not listen again if already listening.
17
+ #
14
18
  def self.listen
15
- Controller.new.listen
19
+ return if @controller && @controller.listening?
20
+ @controller ||= Controller.new
21
+ @controller.listen
16
22
  end
17
23
 
18
24
  end
@@ -110,6 +110,11 @@ module James
110
110
 
111
111
  app.run
112
112
  end
113
+ # Simply put, if there is a controller, it is listening.
114
+ #
115
+ def listening?
116
+ true
117
+ end
113
118
 
114
119
  end
115
120
 
@@ -0,0 +1,15 @@
1
+ # encoding: utf-8
2
+ #
3
+ require File.expand_path '../../../../lib/james/controller', __FILE__
4
+
5
+ describe James::Controller do
6
+
7
+ # let(:controller) { described_class.new }
8
+ #
9
+ # describe 'listening?' do
10
+ # it 'is correct' do
11
+ # controller.listening?.should == true
12
+ # end
13
+ # end
14
+
15
+ end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 2
9
- version: 0.0.2
8
+ - 3
9
+ version: 0.0.3
10
10
  platform: universal-darwin-10
11
11
  authors:
12
12
  - Florian Hanke
@@ -91,6 +91,7 @@ specification_version: 3
91
91
  summary: 'James: Modular Electronic Butler.'
92
92
  test_files:
93
93
  - spec/integration/test_dialogue_spec.rb
94
+ - spec/lib/james/controller_spec.rb
94
95
  - spec/lib/james/dialogue_spec.rb
95
96
  - spec/lib/james/state_spec.rb
96
97
  - spec/lib/james/visitor_spec.rb