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 +0 -1
- data/.irbrc +7 -1
- data/.travis.yml +0 -1
- data/CHANGELOG.rdoc +4 -0
- data/Gemfile.lock +57 -0
- data/README.rdoc +1 -10
- data/karotz.gemspec +1 -2
- data/lib/karotz.rb +0 -2
- data/lib/karotz/client.rb +18 -1
- data/lib/karotz/color.rb +4 -0
- data/lib/karotz/language.rb +5 -1
- data/lib/karotz/multimedia.rb +5 -1
- data/lib/karotz/version.rb +1 -1
- metadata +24 -36
- data/lib/karotz/rails/karotz.rake +0 -30
- data/lib/karotz/rails/railtie.rb +0 -9
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 =
|
14
|
+
@client = create
|
15
|
+
|
16
|
+
at_exit { @client.stop }
|
data/.travis.yml
CHANGED
data/CHANGELOG.rdoc
CHANGED
data/Gemfile.lock
ADDED
@@ -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
|
data/README.rdoc
CHANGED
@@ -12,7 +12,7 @@ Supported methods:
|
|
12
12
|
|
13
13
|
* ears
|
14
14
|
* led
|
15
|
-
* tts (text to
|
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.
|
data/karotz.gemspec
CHANGED
@@ -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"
|
data/lib/karotz.rb
CHANGED
data/lib/karotz/client.rb
CHANGED
@@ -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 =>
|
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
|
data/lib/karotz/color.rb
CHANGED
data/lib/karotz/language.rb
CHANGED
data/lib/karotz/multimedia.rb
CHANGED
data/lib/karotz/version.rb
CHANGED
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.
|
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-
|
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: &
|
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: *
|
24
|
+
version_requirements: *70307092168320
|
36
25
|
- !ruby/object:Gem::Dependency
|
37
26
|
name: rake
|
38
|
-
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: *
|
35
|
+
version_requirements: *70307092167800
|
47
36
|
- !ruby/object:Gem::Dependency
|
48
37
|
name: pry
|
49
|
-
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: *
|
46
|
+
version_requirements: *70307092167260
|
58
47
|
- !ruby/object:Gem::Dependency
|
59
48
|
name: guard-rspec
|
60
|
-
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: *
|
57
|
+
version_requirements: *70307092166760
|
69
58
|
- !ruby/object:Gem::Dependency
|
70
59
|
name: rspec
|
71
|
-
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: *
|
68
|
+
version_requirements: *70307092166320
|
80
69
|
- !ruby/object:Gem::Dependency
|
81
70
|
name: webmock
|
82
|
-
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: *
|
79
|
+
version_requirements: *70307092165880
|
91
80
|
- !ruby/object:Gem::Dependency
|
92
81
|
name: vcr
|
93
|
-
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:
|
87
|
+
version: 1.11.3
|
99
88
|
type: :development
|
100
89
|
prerelease: false
|
101
|
-
version_requirements: *
|
90
|
+
version_requirements: *70307092165340
|
102
91
|
- !ruby/object:Gem::Dependency
|
103
92
|
name: httpi
|
104
|
-
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: *
|
101
|
+
version_requirements: *70307092164820
|
113
102
|
- !ruby/object:Gem::Dependency
|
114
103
|
name: crack
|
115
|
-
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: *
|
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.
|
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
|