karotz 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,5 +1,4 @@
1
1
  *.gem
2
2
  *.zip
3
3
  .bundle
4
- Gemfile.lock
5
4
  pkg/*
data/.irbrc CHANGED
@@ -1,10 +1,16 @@
1
1
  $:.unshift 'lib'
2
2
  require 'karotz'
3
3
 
4
+ def create
5
+ Karotz::Client.create
6
+ end
7
+
4
8
  Karotz::Configuration.configure do |config|
5
9
  config.install_id = ENV['KAROTZ_INSTALL_ID']
6
10
  config.api_key = ENV['KAROTZ_API_KEY']
7
11
  config.secret = ENV['KAROTZ_SECRET']
8
12
  end
9
13
 
10
- @client = Karotz::Client.create
14
+ @client = create
15
+
16
+ at_exit { @client.stop }
@@ -4,7 +4,6 @@ rvm:
4
4
  - 1.9.2
5
5
  - 1.9.3
6
6
  - rbx
7
- - rbx-2.0
8
7
  - ree
9
8
  - ruby-head
10
9
  - jruby
@@ -1,3 +1,7 @@
1
+ == next
2
+
3
+ * remove rails railtie
4
+
1
5
  == 0.4.1
2
6
 
3
7
  * remove direct httpclient dependency
@@ -0,0 +1,57 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ karotz (0.4.2)
5
+ crack (~> 0.3)
6
+ httpi (~> 0.9)
7
+
8
+ GEM
9
+ remote: http://rubygems.org/
10
+ specs:
11
+ addressable (2.2.7)
12
+ coderay (1.0.5)
13
+ crack (0.3.1)
14
+ diff-lcs (1.1.3)
15
+ ffi (1.0.11)
16
+ guard (1.0.1)
17
+ ffi (>= 0.5.0)
18
+ thor (~> 0.14.6)
19
+ guard-rspec (0.6.0)
20
+ guard (>= 0.10.0)
21
+ httpclient (2.2.4)
22
+ httpi (0.9.6)
23
+ rack
24
+ method_source (0.7.1)
25
+ pry (0.9.8.4)
26
+ coderay (~> 1.0.5)
27
+ method_source (~> 0.7.1)
28
+ slop (>= 2.4.4, < 3)
29
+ rack (1.4.1)
30
+ rake (0.9.2.2)
31
+ rspec (2.8.0)
32
+ rspec-core (~> 2.8.0)
33
+ rspec-expectations (~> 2.8.0)
34
+ rspec-mocks (~> 2.8.0)
35
+ rspec-core (2.8.0)
36
+ rspec-expectations (2.8.0)
37
+ diff-lcs (~> 1.1.2)
38
+ rspec-mocks (2.8.0)
39
+ slop (2.4.4)
40
+ thor (0.14.6)
41
+ vcr (1.11.3)
42
+ webmock (1.8.2)
43
+ addressable (>= 2.2.7)
44
+ crack (>= 0.1.7)
45
+
46
+ PLATFORMS
47
+ ruby
48
+
49
+ DEPENDENCIES
50
+ guard-rspec
51
+ httpclient (~> 2.2)
52
+ karotz!
53
+ pry
54
+ rake
55
+ rspec
56
+ vcr (= 1.11.3)
57
+ webmock
@@ -12,7 +12,7 @@ Supported methods:
12
12
 
13
13
  * ears
14
14
  * led
15
- * tts (text to speach)
15
+ * tts (text to speech)
16
16
  * multimedia
17
17
  * asr (automated speach recognition)
18
18
  * webcam
@@ -61,15 +61,6 @@ via Bundler:
61
61
  [...]
62
62
  karotz.stop
63
63
 
64
- == Railtie
65
-
66
- The gem comes with two example Rake tasks, that are automatically included into your Rails application:
67
-
68
- rake karotz:build:failed
69
- rake karotz:build:normal
70
-
71
- Both Tasks are examples of how you could use your Karotz in a CI system like Jenkins.
72
-
73
64
  == Changes
74
65
 
75
66
  See CHANGELOG file.
@@ -17,14 +17,13 @@ Gem::Specification.new do |s|
17
17
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
18
18
  s.require_paths = ["lib"]
19
19
 
20
- s.add_development_dependency "rails", "~> 3.0"
21
20
  s.add_development_dependency "httpclient", "~> 2.2"
22
21
  s.add_development_dependency "rake"
23
22
  s.add_development_dependency "pry"
24
23
  s.add_development_dependency "guard-rspec"
25
24
  s.add_development_dependency "rspec"
26
25
  s.add_development_dependency "webmock"
27
- s.add_development_dependency "vcr"
26
+ s.add_development_dependency "vcr", "1.11.3"
28
27
 
29
28
  s.add_runtime_dependency "httpi", "~> 0.9"
30
29
  s.add_runtime_dependency "crack", "~> 0.3"
@@ -4,5 +4,3 @@ require "karotz/multimedia"
4
4
  require "karotz/color"
5
5
  require "karotz/language"
6
6
  require "karotz/client"
7
-
8
- require "karotz/rails/railtie.rb" if defined?(Rails)
@@ -57,6 +57,8 @@ module Karotz
57
57
  request :tts, interactive_id, {:action => :speak, :text => "test", :lang => Language::ENGLISH}.merge(params)
58
58
  end
59
59
  alias :speak :tts
60
+ alias :say :tts
61
+ alias :talk :tts
60
62
 
61
63
  #============ASR================
62
64
 
@@ -68,7 +70,7 @@ module Karotz
68
70
  #============MULTIMEDIA=========
69
71
 
70
72
  def multimedia(interactive_id, params={})
71
- request :multimedia, interactive_id, {:action => Karotz::Multimedia::PLAY, :url => "http://www.jimwalls.net/mp3/ATeam.mp3"}.merge(params)
73
+ request :multimedia, interactive_id, {:action => Multimedia::PLAY, :url => "http://www.jimwalls.net/mp3/ATeam.mp3"}.merge(params)
72
74
  end
73
75
  alias :play :multimedia
74
76
 
@@ -91,6 +93,21 @@ module Karotz
91
93
  answer["ConfigResponse"]
92
94
  end
93
95
 
96
+ #============FUN_STUFF=========
97
+
98
+ def king_of_the_jungle(interactive_id, params={})
99
+ colors = Color.all
100
+ play interactive_id, :url => 'http://soundjax.com/reddo/35463%5Eat_tarzan.mp3'
101
+ rand(50).times do |i| # do some pseudo random blinking and crazy ears
102
+ color = colors[(colors.size % (i + 1)) + 1]
103
+ sleep = rand
104
+ led interactive_id, :color => color, :period => (sleep * 1000).to_i
105
+ ears interactive_id, :left => i / 2, :right => i * -1
106
+ sleep(sleep)
107
+ end
108
+ end
109
+ alias :freak :king_of_the_jungle
110
+
94
111
  #============LIFE_CYCLE=========
95
112
 
96
113
  def start
@@ -10,5 +10,9 @@ module Karotz
10
10
  RED = "FF0000"
11
11
  YELLOW = "75FF00"
12
12
  WHITE = "4FFF68"
13
+
14
+ def self.all
15
+ @constants ||= constants.map { |const| const_get const }
16
+ end
13
17
  end
14
18
  end
@@ -4,5 +4,9 @@ module Karotz
4
4
  GERMAN = :DE
5
5
  FRENCH = :FR
6
6
  SPANISH = :ES
7
+
8
+ def self.all
9
+ @constants ||= constants.map { |const| const_get const }
10
+ end
7
11
  end
8
- end
12
+ end
@@ -11,5 +11,9 @@ module Karotz
11
11
  FOLDER = :folder
12
12
  ARTIST = :artist
13
13
  GENRE = :genre
14
+
15
+ def self.all
16
+ @constants ||= constants.map { |const| const_get const }
17
+ end
14
18
  end
15
- end
19
+ end
@@ -1,3 +1,3 @@
1
1
  module Karotz
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: karotz
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,22 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-14 00:00:00.000000000 Z
12
+ date: 2012-03-29 00:00:00.000000000 Z
13
13
  dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: rails
16
- requirement: &2168561760 !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ~>
20
- - !ruby/object:Gem::Version
21
- version: '3.0'
22
- type: :development
23
- prerelease: false
24
- version_requirements: *2168561760
25
14
  - !ruby/object:Gem::Dependency
26
15
  name: httpclient
27
- requirement: &2168577560 !ruby/object:Gem::Requirement
16
+ requirement: &70307092168320 !ruby/object:Gem::Requirement
28
17
  none: false
29
18
  requirements:
30
19
  - - ~>
@@ -32,10 +21,10 @@ dependencies:
32
21
  version: '2.2'
33
22
  type: :development
34
23
  prerelease: false
35
- version_requirements: *2168577560
24
+ version_requirements: *70307092168320
36
25
  - !ruby/object:Gem::Dependency
37
26
  name: rake
38
- requirement: &2168577180 !ruby/object:Gem::Requirement
27
+ requirement: &70307092167800 !ruby/object:Gem::Requirement
39
28
  none: false
40
29
  requirements:
41
30
  - - ! '>='
@@ -43,10 +32,10 @@ dependencies:
43
32
  version: '0'
44
33
  type: :development
45
34
  prerelease: false
46
- version_requirements: *2168577180
35
+ version_requirements: *70307092167800
47
36
  - !ruby/object:Gem::Dependency
48
37
  name: pry
49
- requirement: &2168576720 !ruby/object:Gem::Requirement
38
+ requirement: &70307092167260 !ruby/object:Gem::Requirement
50
39
  none: false
51
40
  requirements:
52
41
  - - ! '>='
@@ -54,10 +43,10 @@ dependencies:
54
43
  version: '0'
55
44
  type: :development
56
45
  prerelease: false
57
- version_requirements: *2168576720
46
+ version_requirements: *70307092167260
58
47
  - !ruby/object:Gem::Dependency
59
48
  name: guard-rspec
60
- requirement: &2168576180 !ruby/object:Gem::Requirement
49
+ requirement: &70307092166760 !ruby/object:Gem::Requirement
61
50
  none: false
62
51
  requirements:
63
52
  - - ! '>='
@@ -65,10 +54,10 @@ dependencies:
65
54
  version: '0'
66
55
  type: :development
67
56
  prerelease: false
68
- version_requirements: *2168576180
57
+ version_requirements: *70307092166760
69
58
  - !ruby/object:Gem::Dependency
70
59
  name: rspec
71
- requirement: &2168575320 !ruby/object:Gem::Requirement
60
+ requirement: &70307092166320 !ruby/object:Gem::Requirement
72
61
  none: false
73
62
  requirements:
74
63
  - - ! '>='
@@ -76,10 +65,10 @@ dependencies:
76
65
  version: '0'
77
66
  type: :development
78
67
  prerelease: false
79
- version_requirements: *2168575320
68
+ version_requirements: *70307092166320
80
69
  - !ruby/object:Gem::Dependency
81
70
  name: webmock
82
- requirement: &2168574880 !ruby/object:Gem::Requirement
71
+ requirement: &70307092165880 !ruby/object:Gem::Requirement
83
72
  none: false
84
73
  requirements:
85
74
  - - ! '>='
@@ -87,21 +76,21 @@ dependencies:
87
76
  version: '0'
88
77
  type: :development
89
78
  prerelease: false
90
- version_requirements: *2168574880
79
+ version_requirements: *70307092165880
91
80
  - !ruby/object:Gem::Dependency
92
81
  name: vcr
93
- requirement: &2168574400 !ruby/object:Gem::Requirement
82
+ requirement: &70307092165340 !ruby/object:Gem::Requirement
94
83
  none: false
95
84
  requirements:
96
- - - ! '>='
85
+ - - =
97
86
  - !ruby/object:Gem::Version
98
- version: '0'
87
+ version: 1.11.3
99
88
  type: :development
100
89
  prerelease: false
101
- version_requirements: *2168574400
90
+ version_requirements: *70307092165340
102
91
  - !ruby/object:Gem::Dependency
103
92
  name: httpi
104
- requirement: &2168573900 !ruby/object:Gem::Requirement
93
+ requirement: &70307092164820 !ruby/object:Gem::Requirement
105
94
  none: false
106
95
  requirements:
107
96
  - - ~>
@@ -109,10 +98,10 @@ dependencies:
109
98
  version: '0.9'
110
99
  type: :runtime
111
100
  prerelease: false
112
- version_requirements: *2168573900
101
+ version_requirements: *70307092164820
113
102
  - !ruby/object:Gem::Dependency
114
103
  name: crack
115
- requirement: &2168573360 !ruby/object:Gem::Requirement
104
+ requirement: &70307092164320 !ruby/object:Gem::Requirement
116
105
  none: false
117
106
  requirements:
118
107
  - - ~>
@@ -120,7 +109,7 @@ dependencies:
120
109
  version: '0.3'
121
110
  type: :runtime
122
111
  prerelease: false
123
- version_requirements: *2168573360
112
+ version_requirements: *70307092164320
124
113
  description: ruby bindings for karotz rest api
125
114
  email:
126
115
  - phoetmail@googlemail.com
@@ -136,6 +125,7 @@ files:
136
125
  - .travis.yml
137
126
  - CHANGELOG.rdoc
138
127
  - Gemfile
128
+ - Gemfile.lock
139
129
  - Guardfile
140
130
  - README.rdoc
141
131
  - Rakefile
@@ -147,8 +137,6 @@ files:
147
137
  - lib/karotz/configuration.rb
148
138
  - lib/karotz/language.rb
149
139
  - lib/karotz/multimedia.rb
150
- - lib/karotz/rails/karotz.rake
151
- - lib/karotz/rails/railtie.rb
152
140
  - lib/karotz/version.rb
153
141
  - spec/cassettes/karotz/client_automatic_speach_recognition_asr_should_listen_to_voice.yml
154
142
  - spec/cassettes/karotz/client_automatic_speach_recognition_asr_should_say_something.yml
@@ -193,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
193
181
  version: '0'
194
182
  requirements: []
195
183
  rubyforge_project: karotz
196
- rubygems_version: 1.8.10
184
+ rubygems_version: 1.8.16
197
185
  signing_key:
198
186
  specification_version: 3
199
187
  summary: ruby bindings for karotz rest api
@@ -1,30 +0,0 @@
1
- namespace :karotz do
2
- namespace :build do
3
- desc "build failed trigger"
4
- task :failed => :setup do
5
- Karotz::Client.session do |karotz|
6
- karotz.light :color => Karotz::Color::RED
7
- karotz.speak :text => "build failed"
8
- sleep(3) # kill session some time after talking
9
- end
10
- end
11
-
12
- desc "build normal trigger"
13
- task :normal => :setup do
14
- Karotz::Client.session do |karotz|
15
- karotz.light :color => Karotz::Color::GREEN
16
- karotz.speak :text => "build normal"
17
- sleep(3) # kill session some time after talking
18
- end
19
- end
20
-
21
- task :setup do
22
- Karotz::Configuration.configure do |config|
23
- config.install_id = ENV['KAROTZ_INSTALL_ID']
24
- config.api_key = ENV['KAROTZ_API_KEY']
25
- config.secret = ENV['KAROTZ_SECRET']
26
- config.proxy = ENV['KAROTZ_PROXY']
27
- end
28
- end
29
- end
30
- end
@@ -1,9 +0,0 @@
1
- module Karotz
2
- module Rails
3
- class Railtie < ::Rails::Railtie
4
- rake_tasks do
5
- load 'karotz/rails/karotz.rake'
6
- end
7
- end
8
- end
9
- end