bixby-common 0.4.5 → 0.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +5 -5
- data/Gemfile.lock +36 -26
- data/Rakefile +2 -26
- data/VERSION +1 -1
- data/bixby-common.gemspec +14 -17
- data/lib/bixby-common/bixby.rb +3 -3
- data/lib/bixby-common/command_spec.rb +38 -6
- data/test/helper.rb +5 -3
- data/test/{test_handler.rb → sample_handler.rb} +1 -1
- data/test/util/log_test.rb +3 -3
- data/test/websocket/api_channel_test.rb +4 -4
- metadata +23 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39054170ed94e55cc974daac3898201a2fe14e0d
|
4
|
+
data.tar.gz: 4c7a6620976a1ca301468fa0b551adf60882855b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84cd88d7c9475996325333466a1e8b7a720d3c247d895db729fc5bece1300166b42242b19888b15fdb693fa3f474dd156376537fcf774aaad6445ac7106f733b
|
7
|
+
data.tar.gz: 08c5799164a9d47049d5b077232d9ca7cc8155d957f9c7405476dbd3847dd3f40a35e92d1621f5206268cbcd904ae1fbf50112fb2bd87b301d24ed6eb7be7174
|
data/Gemfile
CHANGED
@@ -7,6 +7,8 @@ gem "logging"
|
|
7
7
|
|
8
8
|
gem "api-auth", :git => "https://github.com/chetan/api_auth.git", :branch => "bixby"
|
9
9
|
|
10
|
+
gem "semver2"
|
11
|
+
|
10
12
|
group :development do
|
11
13
|
|
12
14
|
# for some tests
|
@@ -18,16 +20,14 @@ group :development do
|
|
18
20
|
gem "pry"
|
19
21
|
|
20
22
|
gem "simplecov", :platforms => [:mri_19, :mri_20, :rbx], :git => "https://github.com/chetan/simplecov.git", :branch => "inline_nocov"
|
21
|
-
gem "rcov", :platforms => :mri_18
|
22
23
|
|
23
|
-
gem "minitest", "~> 4.0", :platforms => [:mri_19, :mri_20, :rbx]
|
24
|
-
gem "test-unit", :platforms => :mri_18
|
25
24
|
gem "webmock", :require => false
|
26
25
|
gem "mocha", :require => false
|
27
26
|
|
28
|
-
gem "turn"
|
29
|
-
|
30
27
|
gem "test_guard", :git => "https://github.com/chetan/test_guard.git"
|
28
|
+
gem "easycov", :github => "chetan/easycov"
|
29
|
+
gem "micron", :github => "chetan/micron"
|
30
|
+
|
31
31
|
gem 'rb-inotify', :require => false
|
32
32
|
gem 'rb-fsevent', :require => false
|
33
33
|
gem 'rb-fchange', :require => false
|
data/Gemfile.lock
CHANGED
@@ -1,3 +1,20 @@
|
|
1
|
+
GIT
|
2
|
+
remote: git://github.com/chetan/easycov.git
|
3
|
+
revision: 875b981d5cded29263e07a3410845dc56a5dfa30
|
4
|
+
specs:
|
5
|
+
easycov (0.2.0)
|
6
|
+
multi_json
|
7
|
+
simplecov
|
8
|
+
|
9
|
+
GIT
|
10
|
+
remote: git://github.com/chetan/micron.git
|
11
|
+
revision: 14442584d89b503d6691ac15e0dba38b207b100a
|
12
|
+
specs:
|
13
|
+
micron (0.1.0)
|
14
|
+
colorize
|
15
|
+
easycov
|
16
|
+
hitimes
|
17
|
+
|
1
18
|
GIT
|
2
19
|
remote: https://github.com/chetan/api_auth.git
|
3
20
|
revision: 86a79ca157402bd1c12d683a6b9948564b493443
|
@@ -31,37 +48,35 @@ GIT
|
|
31
48
|
|
32
49
|
GIT
|
33
50
|
remote: https://github.com/chetan/test_guard.git
|
34
|
-
revision:
|
51
|
+
revision: 9c2fdd4ba874d8593ad4d70c0f2dd6b141061fed
|
35
52
|
specs:
|
36
53
|
test_guard (0.2.1)
|
37
54
|
awesome_print
|
55
|
+
easycov
|
38
56
|
growl
|
39
57
|
listen
|
40
58
|
simplecov
|
41
59
|
simplecov-console
|
42
|
-
single_test
|
43
|
-
turn
|
44
60
|
|
45
61
|
GEM
|
46
62
|
remote: https://rubygems.org/
|
47
63
|
specs:
|
48
64
|
addressable (2.3.5)
|
49
|
-
|
50
|
-
awesome_print (1.1.0)
|
65
|
+
awesome_print (1.2.0)
|
51
66
|
bouncy-castle-java (1.5.0147)
|
52
67
|
builder (3.2.2)
|
53
68
|
coderay (1.0.9)
|
54
|
-
colorize (0.
|
69
|
+
colorize (0.6.0)
|
55
70
|
crack (0.4.1)
|
56
71
|
safe_yaml (~> 0.9.0)
|
57
|
-
curb (0.8.
|
72
|
+
curb (0.8.5)
|
58
73
|
eventmachine (1.0.3)
|
59
74
|
eventmachine (1.0.3-java)
|
60
75
|
faraday (0.8.8)
|
61
76
|
multipart-post (~> 1.2.0)
|
62
|
-
faye-websocket (0.
|
77
|
+
faye-websocket (0.7.0)
|
63
78
|
eventmachine (>= 0.12.0)
|
64
|
-
websocket-driver (>= 0.
|
79
|
+
websocket-driver (>= 0.3.0)
|
65
80
|
ffi (1.9.0)
|
66
81
|
ffi (1.9.0-java)
|
67
82
|
git (1.2.6)
|
@@ -76,12 +91,14 @@ GEM
|
|
76
91
|
hashie (2.0.5)
|
77
92
|
highline (1.6.19)
|
78
93
|
hirb (0.7.1)
|
94
|
+
hitimes (1.2.1)
|
95
|
+
hitimes (1.2.1-java)
|
79
96
|
httpauth (0.2.0)
|
80
97
|
httpclient (2.3.4.1)
|
81
98
|
httpi (2.1.0)
|
82
99
|
rack
|
83
100
|
rubyntlm (~> 0.3.2)
|
84
|
-
jruby-openssl (0.
|
101
|
+
jruby-openssl (0.9.2)
|
85
102
|
bouncy-castle-java (>= 1.5.0147)
|
86
103
|
json (1.8.0)
|
87
104
|
json (1.8.0-java)
|
@@ -97,7 +114,6 @@ GEM
|
|
97
114
|
multi_json (>= 1.3.6)
|
98
115
|
metaclass (0.0.1)
|
99
116
|
method_source (0.8.2)
|
100
|
-
minitest (4.7.5)
|
101
117
|
mixlib-shellout (1.2.0)
|
102
118
|
mocha (0.14.0)
|
103
119
|
metaclass (~> 0.0.1)
|
@@ -132,30 +148,25 @@ GEM
|
|
132
148
|
ffi (>= 0.5.0)
|
133
149
|
rb-kqueue (0.2.0)
|
134
150
|
ffi (>= 0.5.0)
|
135
|
-
rcov (1.0.0)
|
136
151
|
rdoc (4.0.1)
|
137
152
|
json (~> 1.4)
|
138
153
|
rubyntlm (0.3.4)
|
139
|
-
safe_yaml (0.9.
|
154
|
+
safe_yaml (0.9.7)
|
155
|
+
semver2 (3.3.2)
|
140
156
|
simplecov-console (0.1.1)
|
141
157
|
colorize
|
142
158
|
hirb
|
143
159
|
simplecov
|
144
160
|
simplecov-html (0.7.1)
|
145
|
-
single_test (0.6.0)
|
146
|
-
rake
|
147
161
|
slop (3.4.6)
|
148
162
|
spoon (0.0.4)
|
149
163
|
ffi
|
150
|
-
|
151
|
-
turn (0.9.6)
|
152
|
-
ansi
|
153
|
-
webmock (1.13.0)
|
164
|
+
webmock (1.14.0)
|
154
165
|
addressable (>= 2.2.7)
|
155
166
|
crack (>= 0.3.2)
|
156
|
-
websocket-driver (0.
|
157
|
-
websocket-driver (0.
|
158
|
-
yard (0.8.7)
|
167
|
+
websocket-driver (0.3.0)
|
168
|
+
websocket-driver (0.3.0-java)
|
169
|
+
yard (0.8.7.2)
|
159
170
|
|
160
171
|
PLATFORMS
|
161
172
|
java
|
@@ -165,6 +176,7 @@ DEPENDENCIES
|
|
165
176
|
api-auth!
|
166
177
|
bundler (~> 1.1)
|
167
178
|
curb
|
179
|
+
easycov!
|
168
180
|
faye-websocket
|
169
181
|
httpclient
|
170
182
|
httpi
|
@@ -172,7 +184,7 @@ DEPENDENCIES
|
|
172
184
|
jruby-openssl
|
173
185
|
json
|
174
186
|
logging
|
175
|
-
|
187
|
+
micron!
|
176
188
|
mixlib-shellout
|
177
189
|
mocha
|
178
190
|
multi_json
|
@@ -181,10 +193,8 @@ DEPENDENCIES
|
|
181
193
|
rb-fchange
|
182
194
|
rb-fsevent
|
183
195
|
rb-inotify
|
184
|
-
|
196
|
+
semver2
|
185
197
|
simplecov!
|
186
|
-
test-unit
|
187
198
|
test_guard!
|
188
|
-
turn
|
189
199
|
webmock
|
190
200
|
yard (~> 0.8)
|
data/Rakefile
CHANGED
@@ -25,34 +25,10 @@ Jeweler::RubygemsDotOrgTasks.new
|
|
25
25
|
|
26
26
|
Dir['tasks/**/*.rake'].each { |rake| load rake }
|
27
27
|
|
28
|
-
require
|
29
|
-
Rake
|
30
|
-
test.libs << 'lib' << 'test'
|
31
|
-
test.pattern = 'test/**/*_test.rb'
|
32
|
-
test.verbose = true
|
28
|
+
require "micron/rake"
|
29
|
+
Micron::Rake.new do |task|
|
33
30
|
end
|
34
|
-
|
35
|
-
if Module.const_defined? :Rcov then
|
36
|
-
begin
|
37
|
-
require 'rcov/rcovtask'
|
38
|
-
Rcov::RcovTask.new do |test|
|
39
|
-
test.libs << 'test'
|
40
|
-
test.pattern = 'test/**/*_test.rb'
|
41
|
-
test.verbose = true
|
42
|
-
test.rcov_opts << '--exclude "gems/*"'
|
43
|
-
end
|
44
|
-
rescue Exception => ex
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
31
|
task :default => :test
|
49
32
|
|
50
|
-
begin
|
51
|
-
require 'single_test/tasks'
|
52
|
-
|
53
|
-
rescue LoadError
|
54
|
-
warn "single_test not available"
|
55
|
-
end
|
56
|
-
|
57
33
|
require 'yard'
|
58
34
|
YARD::Rake::YardocTask.new
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.6
|
data/bixby-common.gemspec
CHANGED
@@ -2,15 +2,15 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: bixby-common 0.4.
|
5
|
+
# stub: bixby-common 0.4.6 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "bixby-common"
|
9
|
-
s.version = "0.4.
|
9
|
+
s.version = "0.4.6"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.authors = ["Chetan Sarva"]
|
13
|
-
s.date = "2013-
|
13
|
+
s.date = "2013-10-03"
|
14
14
|
s.description = "Bixby Common files/libs"
|
15
15
|
s.email = "chetan@pixelcop.net"
|
16
16
|
s.extra_rdoc_files = [
|
@@ -58,13 +58,13 @@ Gem::Specification.new do |s|
|
|
58
58
|
"test/command_response_test.rb",
|
59
59
|
"test/command_spec_test.rb",
|
60
60
|
"test/helper.rb",
|
61
|
+
"test/sample_handler.rb",
|
61
62
|
"test/side_effect.rb",
|
62
63
|
"test/support/repo/vendor/test_bundle/bin/cat",
|
63
64
|
"test/support/repo/vendor/test_bundle/bin/cat.json",
|
64
65
|
"test/support/repo/vendor/test_bundle/bin/echo",
|
65
66
|
"test/support/repo/vendor/test_bundle/digest",
|
66
67
|
"test/support/repo/vendor/test_bundle/manifest.json",
|
67
|
-
"test/test_handler.rb",
|
68
68
|
"test/util/crypto_util_test.rb",
|
69
69
|
"test/util/http_client_test.rb",
|
70
70
|
"test/util/jsonify_test.rb",
|
@@ -77,7 +77,7 @@ Gem::Specification.new do |s|
|
|
77
77
|
s.homepage = "http://github.com/chetan/bixby-common"
|
78
78
|
s.licenses = ["MIT"]
|
79
79
|
s.require_paths = ["lib"]
|
80
|
-
s.rubygems_version = "2.1.
|
80
|
+
s.rubygems_version = "2.1.5"
|
81
81
|
s.summary = "Bixby Common"
|
82
82
|
|
83
83
|
if s.respond_to? :specification_version then
|
@@ -89,19 +89,18 @@ Gem::Specification.new do |s|
|
|
89
89
|
s.add_runtime_dependency(%q<httpi>, [">= 0"])
|
90
90
|
s.add_runtime_dependency(%q<logging>, [">= 0"])
|
91
91
|
s.add_runtime_dependency(%q<api-auth>, [">= 0"])
|
92
|
+
s.add_runtime_dependency(%q<semver2>, [">= 0"])
|
92
93
|
s.add_development_dependency(%q<mixlib-shellout>, [">= 0"])
|
93
94
|
s.add_development_dependency(%q<yard>, ["~> 0.8"])
|
94
95
|
s.add_development_dependency(%q<bundler>, ["~> 1.1"])
|
95
96
|
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
96
97
|
s.add_development_dependency(%q<pry>, [">= 0"])
|
97
98
|
s.add_development_dependency(%q<simplecov>, [">= 0"])
|
98
|
-
s.add_development_dependency(%q<rcov>, [">= 0"])
|
99
|
-
s.add_development_dependency(%q<minitest>, ["~> 4.0"])
|
100
|
-
s.add_development_dependency(%q<test-unit>, [">= 0"])
|
101
99
|
s.add_development_dependency(%q<webmock>, [">= 0"])
|
102
100
|
s.add_development_dependency(%q<mocha>, [">= 0"])
|
103
|
-
s.add_development_dependency(%q<turn>, [">= 0"])
|
104
101
|
s.add_development_dependency(%q<test_guard>, [">= 0"])
|
102
|
+
s.add_development_dependency(%q<easycov>, [">= 0"])
|
103
|
+
s.add_development_dependency(%q<micron>, [">= 0"])
|
105
104
|
s.add_development_dependency(%q<rb-inotify>, [">= 0"])
|
106
105
|
s.add_development_dependency(%q<rb-fsevent>, [">= 0"])
|
107
106
|
s.add_development_dependency(%q<rb-fchange>, [">= 0"])
|
@@ -116,19 +115,18 @@ Gem::Specification.new do |s|
|
|
116
115
|
s.add_dependency(%q<httpi>, [">= 0"])
|
117
116
|
s.add_dependency(%q<logging>, [">= 0"])
|
118
117
|
s.add_dependency(%q<api-auth>, [">= 0"])
|
118
|
+
s.add_dependency(%q<semver2>, [">= 0"])
|
119
119
|
s.add_dependency(%q<mixlib-shellout>, [">= 0"])
|
120
120
|
s.add_dependency(%q<yard>, ["~> 0.8"])
|
121
121
|
s.add_dependency(%q<bundler>, ["~> 1.1"])
|
122
122
|
s.add_dependency(%q<jeweler>, [">= 0"])
|
123
123
|
s.add_dependency(%q<pry>, [">= 0"])
|
124
124
|
s.add_dependency(%q<simplecov>, [">= 0"])
|
125
|
-
s.add_dependency(%q<rcov>, [">= 0"])
|
126
|
-
s.add_dependency(%q<minitest>, ["~> 4.0"])
|
127
|
-
s.add_dependency(%q<test-unit>, [">= 0"])
|
128
125
|
s.add_dependency(%q<webmock>, [">= 0"])
|
129
126
|
s.add_dependency(%q<mocha>, [">= 0"])
|
130
|
-
s.add_dependency(%q<turn>, [">= 0"])
|
131
127
|
s.add_dependency(%q<test_guard>, [">= 0"])
|
128
|
+
s.add_dependency(%q<easycov>, [">= 0"])
|
129
|
+
s.add_dependency(%q<micron>, [">= 0"])
|
132
130
|
s.add_dependency(%q<rb-inotify>, [">= 0"])
|
133
131
|
s.add_dependency(%q<rb-fsevent>, [">= 0"])
|
134
132
|
s.add_dependency(%q<rb-fchange>, [">= 0"])
|
@@ -144,19 +142,18 @@ Gem::Specification.new do |s|
|
|
144
142
|
s.add_dependency(%q<httpi>, [">= 0"])
|
145
143
|
s.add_dependency(%q<logging>, [">= 0"])
|
146
144
|
s.add_dependency(%q<api-auth>, [">= 0"])
|
145
|
+
s.add_dependency(%q<semver2>, [">= 0"])
|
147
146
|
s.add_dependency(%q<mixlib-shellout>, [">= 0"])
|
148
147
|
s.add_dependency(%q<yard>, ["~> 0.8"])
|
149
148
|
s.add_dependency(%q<bundler>, ["~> 1.1"])
|
150
149
|
s.add_dependency(%q<jeweler>, [">= 0"])
|
151
150
|
s.add_dependency(%q<pry>, [">= 0"])
|
152
151
|
s.add_dependency(%q<simplecov>, [">= 0"])
|
153
|
-
s.add_dependency(%q<rcov>, [">= 0"])
|
154
|
-
s.add_dependency(%q<minitest>, ["~> 4.0"])
|
155
|
-
s.add_dependency(%q<test-unit>, [">= 0"])
|
156
152
|
s.add_dependency(%q<webmock>, [">= 0"])
|
157
153
|
s.add_dependency(%q<mocha>, [">= 0"])
|
158
|
-
s.add_dependency(%q<turn>, [">= 0"])
|
159
154
|
s.add_dependency(%q<test_guard>, [">= 0"])
|
155
|
+
s.add_dependency(%q<easycov>, [">= 0"])
|
156
|
+
s.add_dependency(%q<micron>, [">= 0"])
|
160
157
|
s.add_dependency(%q<rb-inotify>, [">= 0"])
|
161
158
|
s.add_dependency(%q<rb-fsevent>, [">= 0"])
|
162
159
|
s.add_dependency(%q<rb-fchange>, [">= 0"])
|
data/lib/bixby-common/bixby.rb
CHANGED
@@ -3,9 +3,10 @@ module Bixby
|
|
3
3
|
class << self
|
4
4
|
attr_accessor :manager_uri
|
5
5
|
|
6
|
-
def
|
7
|
-
path("repo")
|
6
|
+
def repo(*args)
|
7
|
+
path("repo", *args)
|
8
8
|
end
|
9
|
+
alias_method :repo_path, :repo
|
9
10
|
|
10
11
|
# Path to BIXBY_HOME
|
11
12
|
def root
|
@@ -18,6 +19,5 @@ module Bixby
|
|
18
19
|
File.expand_path(File.join(root, *args))
|
19
20
|
end
|
20
21
|
|
21
|
-
|
22
22
|
end
|
23
23
|
end
|
@@ -10,7 +10,8 @@ class CommandSpec
|
|
10
10
|
include Jsonify
|
11
11
|
include Hashify
|
12
12
|
|
13
|
-
attr_accessor :
|
13
|
+
attr_accessor :digest, :repo, :bundle, :command, :args, :stdin, :env,
|
14
|
+
:user, :group
|
14
15
|
|
15
16
|
# Create new CommandSpec
|
16
17
|
#
|
@@ -63,34 +64,58 @@ class CommandSpec
|
|
63
64
|
File.join(@repo, @bundle)
|
64
65
|
end
|
65
66
|
|
67
|
+
# Check if the bundle described by this CommandSpec exists
|
68
|
+
#
|
69
|
+
# @return [Boolean]
|
66
70
|
def bundle_exists?
|
67
71
|
File.exists? self.bundle_dir
|
68
72
|
end
|
69
73
|
|
74
|
+
# Absolute command filename
|
75
|
+
#
|
76
|
+
# @return [String]
|
70
77
|
def command_file
|
71
78
|
path("bin", @command)
|
72
79
|
end
|
73
80
|
|
81
|
+
# Check if the command file exists
|
82
|
+
#
|
83
|
+
# @return [Boolean]
|
74
84
|
def command_exists?
|
75
85
|
File.exists? self.command_file
|
76
86
|
end
|
77
87
|
|
78
|
-
|
88
|
+
# Command manifest filename
|
89
|
+
#
|
90
|
+
# @return [String]
|
91
|
+
def manifest_file
|
79
92
|
command_file + ".json"
|
80
93
|
end
|
94
|
+
alias_method :config_file, :manifest_file
|
81
95
|
|
82
|
-
|
83
|
-
|
84
|
-
|
96
|
+
# Retrieve the command's Manifest, loading it from disk if necessary
|
97
|
+
# If no Manifest is available, returns an empty hash
|
98
|
+
#
|
99
|
+
# @return [Hash]
|
100
|
+
def manifest
|
101
|
+
if File.exists?(manifest_file) && File.readable?(manifest_file) then
|
102
|
+
MultiJson.load(File.read(manifest_file))
|
85
103
|
else
|
86
104
|
{}
|
87
105
|
end
|
88
106
|
end
|
107
|
+
alias_method :load_config, :manifest
|
89
108
|
|
109
|
+
# Bundle digest filename
|
110
|
+
#
|
111
|
+
# @return [String] path to bundle digest file
|
90
112
|
def digest_file
|
91
113
|
path("digest")
|
92
114
|
end
|
93
115
|
|
116
|
+
# Retrieve the bundle digest
|
117
|
+
#
|
118
|
+
# @return [Hash]
|
94
119
|
def load_digest
|
95
120
|
begin
|
96
121
|
return MultiJson.load(File.read(digest_file))
|
@@ -99,13 +124,17 @@ class CommandSpec
|
|
99
124
|
nil
|
100
125
|
end
|
101
126
|
|
102
|
-
|
127
|
+
# Retrieve the bundle manifest
|
128
|
+
#
|
129
|
+
# @return [Hash]
|
130
|
+
def load_bundle_manifest
|
103
131
|
begin
|
104
132
|
return MultiJson.load(File.read(path("manifest.json")))
|
105
133
|
rescue => ex
|
106
134
|
end
|
107
135
|
nil
|
108
136
|
end
|
137
|
+
alias_method :load_manifest, :load_bundle_manifest
|
109
138
|
|
110
139
|
# Create and return an absolute pathname pointing to the given file
|
111
140
|
#
|
@@ -116,6 +145,7 @@ class CommandSpec
|
|
116
145
|
File.join(self.bundle_dir, *relative)
|
117
146
|
end
|
118
147
|
|
148
|
+
# Update the digest hashes for this bundle
|
119
149
|
def update_digest
|
120
150
|
|
121
151
|
path = self.bundle_dir
|
@@ -148,6 +178,8 @@ class CommandSpec
|
|
148
178
|
s << " bundle: #{self.bundle}"
|
149
179
|
s << " command: #{self.command}"
|
150
180
|
s << " args: #{self.args}"
|
181
|
+
s << " user: #{self.user}"
|
182
|
+
s << " group: #{self.group}"
|
151
183
|
s << " env: " + MultiJson.dump(self.env)
|
152
184
|
s << " stdin: " + Debug.pretty_str(stdin)
|
153
185
|
s.join("\n")
|
data/test/helper.rb
CHANGED
@@ -9,7 +9,7 @@ rescue Bundler::BundlerError => e
|
|
9
9
|
end
|
10
10
|
|
11
11
|
require 'test_guard'
|
12
|
-
|
12
|
+
require 'micron/minitest'
|
13
13
|
|
14
14
|
begin
|
15
15
|
require 'curb'
|
@@ -30,9 +30,11 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
30
30
|
require 'bixby-common'
|
31
31
|
|
32
32
|
require "base"
|
33
|
-
require "
|
33
|
+
require "sample_handler"
|
34
34
|
require "side_effect"
|
35
35
|
|
36
36
|
Dir.glob(File.dirname(__FILE__) + "/../lib/**/*.rb").each{ |f| require f }
|
37
37
|
|
38
|
-
|
38
|
+
EasyCov.path = "coverage"
|
39
|
+
EasyCov.filters << EasyCov::IGNORE_GEMS << EasyCov::IGNORE_STDLIB
|
40
|
+
EasyCov.start
|
data/test/util/log_test.rb
CHANGED
@@ -32,13 +32,13 @@ class TestLog < TestCase
|
|
32
32
|
begin
|
33
33
|
raise "foo"
|
34
34
|
rescue => ex
|
35
|
-
assert filter.format_obj(ex) =~ /
|
35
|
+
assert filter.format_obj(ex) =~ /micron/
|
36
36
|
|
37
37
|
# filter out all turn lines
|
38
38
|
filter.set_filter do |ex|
|
39
|
-
ex.backtrace.reject{ |s| s =~ /
|
39
|
+
ex.backtrace.reject{ |s| s =~ /micron/ }
|
40
40
|
end
|
41
|
-
refute filter.format_obj(ex) =~ /
|
41
|
+
refute filter.format_obj(ex) =~ /micron/
|
42
42
|
|
43
43
|
end
|
44
44
|
end
|
@@ -22,7 +22,7 @@ class TestAPIChannel < TestCase
|
|
22
22
|
def setup
|
23
23
|
@em_thread = Thread.new { EM.run{} }
|
24
24
|
@ws = mock()
|
25
|
-
@api_chan = Bixby::WebSocket::APIChannel.new(ws,
|
25
|
+
@api_chan = Bixby::WebSocket::APIChannel.new(ws, SampleHandler)
|
26
26
|
end
|
27
27
|
|
28
28
|
def test_open
|
@@ -50,7 +50,7 @@ class TestAPIChannel < TestCase
|
|
50
50
|
|
51
51
|
event = mock()
|
52
52
|
event.expects(:data).once.returns(req.to_wire)
|
53
|
-
|
53
|
+
SampleHandler.any_instance.expects(:handle).with{ |r| r == json_req }.returns(json_res)
|
54
54
|
ws.expects(:send).once.with { |str|
|
55
55
|
res = Bixby::WebSocket::Message.from_wire(str)
|
56
56
|
!res.nil? && res.json_response.to_wire == json_res.to_wire
|
@@ -82,14 +82,14 @@ class TestAPIChannel < TestCase
|
|
82
82
|
|
83
83
|
event = mock()
|
84
84
|
event.expects(:data).once.returns(req.to_wire)
|
85
|
-
|
85
|
+
SampleHandler.any_instance.expects(:connect).with(json_req, api_chan)
|
86
86
|
api_chan.message(event)
|
87
87
|
end
|
88
88
|
|
89
89
|
def test_close
|
90
90
|
# close
|
91
91
|
api_chan.open(nil)
|
92
|
-
|
92
|
+
SampleHandler.any_instance.expects(:disconnect).with(api_chan).once()
|
93
93
|
api_chan.close(nil)
|
94
94
|
|
95
95
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bixby-common
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chetan Sarva
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faye-websocket
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - '>='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: semver2
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: mixlib-shellout
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -165,35 +179,7 @@ dependencies:
|
|
165
179
|
- !ruby/object:Gem::Version
|
166
180
|
version: '0'
|
167
181
|
- !ruby/object:Gem::Dependency
|
168
|
-
name:
|
169
|
-
requirement: !ruby/object:Gem::Requirement
|
170
|
-
requirements:
|
171
|
-
- - '>='
|
172
|
-
- !ruby/object:Gem::Version
|
173
|
-
version: '0'
|
174
|
-
type: :development
|
175
|
-
prerelease: false
|
176
|
-
version_requirements: !ruby/object:Gem::Requirement
|
177
|
-
requirements:
|
178
|
-
- - '>='
|
179
|
-
- !ruby/object:Gem::Version
|
180
|
-
version: '0'
|
181
|
-
- !ruby/object:Gem::Dependency
|
182
|
-
name: minitest
|
183
|
-
requirement: !ruby/object:Gem::Requirement
|
184
|
-
requirements:
|
185
|
-
- - ~>
|
186
|
-
- !ruby/object:Gem::Version
|
187
|
-
version: '4.0'
|
188
|
-
type: :development
|
189
|
-
prerelease: false
|
190
|
-
version_requirements: !ruby/object:Gem::Requirement
|
191
|
-
requirements:
|
192
|
-
- - ~>
|
193
|
-
- !ruby/object:Gem::Version
|
194
|
-
version: '4.0'
|
195
|
-
- !ruby/object:Gem::Dependency
|
196
|
-
name: test-unit
|
182
|
+
name: webmock
|
197
183
|
requirement: !ruby/object:Gem::Requirement
|
198
184
|
requirements:
|
199
185
|
- - '>='
|
@@ -207,7 +193,7 @@ dependencies:
|
|
207
193
|
- !ruby/object:Gem::Version
|
208
194
|
version: '0'
|
209
195
|
- !ruby/object:Gem::Dependency
|
210
|
-
name:
|
196
|
+
name: mocha
|
211
197
|
requirement: !ruby/object:Gem::Requirement
|
212
198
|
requirements:
|
213
199
|
- - '>='
|
@@ -221,7 +207,7 @@ dependencies:
|
|
221
207
|
- !ruby/object:Gem::Version
|
222
208
|
version: '0'
|
223
209
|
- !ruby/object:Gem::Dependency
|
224
|
-
name:
|
210
|
+
name: test_guard
|
225
211
|
requirement: !ruby/object:Gem::Requirement
|
226
212
|
requirements:
|
227
213
|
- - '>='
|
@@ -235,7 +221,7 @@ dependencies:
|
|
235
221
|
- !ruby/object:Gem::Version
|
236
222
|
version: '0'
|
237
223
|
- !ruby/object:Gem::Dependency
|
238
|
-
name:
|
224
|
+
name: easycov
|
239
225
|
requirement: !ruby/object:Gem::Requirement
|
240
226
|
requirements:
|
241
227
|
- - '>='
|
@@ -249,7 +235,7 @@ dependencies:
|
|
249
235
|
- !ruby/object:Gem::Version
|
250
236
|
version: '0'
|
251
237
|
- !ruby/object:Gem::Dependency
|
252
|
-
name:
|
238
|
+
name: micron
|
253
239
|
requirement: !ruby/object:Gem::Requirement
|
254
240
|
requirements:
|
255
241
|
- - '>='
|
@@ -422,13 +408,13 @@ files:
|
|
422
408
|
- test/command_response_test.rb
|
423
409
|
- test/command_spec_test.rb
|
424
410
|
- test/helper.rb
|
411
|
+
- test/sample_handler.rb
|
425
412
|
- test/side_effect.rb
|
426
413
|
- test/support/repo/vendor/test_bundle/bin/cat
|
427
414
|
- test/support/repo/vendor/test_bundle/bin/cat.json
|
428
415
|
- test/support/repo/vendor/test_bundle/bin/echo
|
429
416
|
- test/support/repo/vendor/test_bundle/digest
|
430
417
|
- test/support/repo/vendor/test_bundle/manifest.json
|
431
|
-
- test/test_handler.rb
|
432
418
|
- test/util/crypto_util_test.rb
|
433
419
|
- test/util/http_client_test.rb
|
434
420
|
- test/util/jsonify_test.rb
|
@@ -457,7 +443,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
457
443
|
version: '0'
|
458
444
|
requirements: []
|
459
445
|
rubyforge_project:
|
460
|
-
rubygems_version: 2.1.
|
446
|
+
rubygems_version: 2.1.5
|
461
447
|
signing_key:
|
462
448
|
specification_version: 4
|
463
449
|
summary: Bixby Common
|