james 0.3.0-universal-darwin-10 → 0.4.0-universal-darwin-10

Sign up to get free protection for your applications and to get access to all the features.
@@ -46,7 +46,9 @@ module James
46
46
  def transition phrase
47
47
  state_or_lambda = current.next_for phrase
48
48
  if state_or_lambda.respond_to?(:call)
49
- current.__transition__ &state_or_lambda # Don't transition.
49
+ result = current.__transition__ &state_or_lambda # Don't transition.
50
+ yield result if result && block_given?
51
+ result
50
52
  else
51
53
  self.current = state_or_lambda
52
54
  end
@@ -63,7 +65,7 @@ module James
63
65
  def process phrase, &block
64
66
  exit_text = exit &block
65
67
  last_context = current.context
66
- transition phrase
68
+ transition phrase, &block
67
69
  check &block
68
70
  into_text = enter &block
69
71
  last_context != current.context
@@ -15,7 +15,12 @@ module James
15
15
 
16
16
  # Say the given text out loud.
17
17
  #
18
+ # Waits for the last text to be finished
19
+ #
18
20
  def say text
21
+ while @output.isSpeaking
22
+ sleep 0.1
23
+ end
19
24
  @output.startSpeakingString text
20
25
  end
21
26
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: james
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.3.0
5
+ version: 0.4.0
6
6
  platform: universal-darwin-10
7
7
  authors:
8
8
  - Florian Hanke