bixby-client 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7c5e642d613d7e0e206da3e078ee17f54d5e1f4d
4
- data.tar.gz: d9640168edf4f63989d498d9a442840a4c20de60
3
+ metadata.gz: 342a2bdbd9cca476b783cf533eb5c6f3a3d8e73a
4
+ data.tar.gz: d1e26d76f70f67c03843db52df19a4857f5ea6db
5
5
  SHA512:
6
- metadata.gz: 48370186e4329161f1949b49586f4e6e90f7fe5cba3ef5697a9b831835656850d4ffb3a5c222c6ec352ae1c8b4ea41836375c4ee5bf9f94f78b09f204e6282d8
7
- data.tar.gz: f8ac2fff1b61d1b3ee551e0f87a4cc8a940110f75fa1c360ed08beaae9428a51b0e3c67080b33bda205ec7e470eae22a8b522343c07e3643a804307b1f220f64
6
+ metadata.gz: f9b071a63eda0e7dfcbc7ec14adea9e0b281d9ab02d5b025c7ad6f186f2cbd464f6af87fa92a0253c67f831837b420f0b880f0a5824e0ec09a8a1f43aa63491d
7
+ data.tar.gz: d3740d5b4bec3ac8cb91d9ec42df549c4a59cca201fd424f9ea5130798f9db3b258aa72421f5a6254e73f628d0ca985b975767a18c6a2fb842c32f49e0a91cb4
data/Gemfile CHANGED
@@ -19,12 +19,12 @@ group :development do
19
19
  gem "bundler"
20
20
  gem "jeweler", :git => "https://github.com/chetan/jeweler.git", :branch => "bixby"
21
21
  gem "pry"
22
- gem "debugger", :platforms => :mri_19
23
- gem "debugger-pry", :require => "debugger/pry", :platforms => :mri_19
22
+ gem "debugger", :platforms => [:mri_19, :mri_20]
23
+ gem "debugger-pry", :require => "debugger/pry", :platforms => [:mri_19, :mri_20]
24
24
 
25
- gem "simplecov", :platforms => [:mri_19, :rbx], :git => "https://github.com/chetan/simplecov.git", :branch => "inline_nocov"
25
+ gem "simplecov", :platforms => [:mri_19, :mri_20, :rbx], :git => "https://github.com/chetan/simplecov.git", :branch => "inline_nocov"
26
+ gem "micron", :github => "chetan/micron"
26
27
 
27
- gem "minitest", "~> 4.7", :platforms => [:mri_19, :rbx]
28
28
  gem "webmock", :require => false
29
29
  gem "mocha", :require => false
30
30
 
@@ -1,6 +1,15 @@
1
+ GIT
2
+ remote: git://github.com/chetan/micron.git
3
+ revision: e1a12a19e9d1f3f0e27bcec4cad4007e2a1c3d1a
4
+ specs:
5
+ micron (0.1.0)
6
+ colorize
7
+ easycov
8
+ hitimes
9
+
1
10
  GIT
2
11
  remote: https://github.com/chetan/api_auth.git
3
- revision: eea13ad54cca87de133c80be6aff96cb21a21601
12
+ revision: 86a79ca157402bd1c12d683a6b9948564b493443
4
13
  branch: bixby
5
14
  specs:
6
15
  api-auth (1.0.3)
@@ -31,12 +40,10 @@ GIT
31
40
 
32
41
  GIT
33
42
  remote: https://github.com/chetan/test_guard.git
34
- revision: 7d069b2d7e46fcbecd7a52966fda7d2d1945e2c9
43
+ revision: 72fade8f2fda1747ece442aee40be53d5cb293c9
35
44
  specs:
36
45
  test_guard (0.2.1)
37
46
  awesome_print
38
- debugger
39
- debugger-pry
40
47
  growl
41
48
  listen
42
49
  simplecov
@@ -49,8 +56,8 @@ GEM
49
56
  specs:
50
57
  addressable (2.3.5)
51
58
  ansi (1.4.3)
52
- awesome_print (1.1.0)
53
- bixby-common (0.4.1)
59
+ awesome_print (1.2.0)
60
+ bixby-common (0.4.5)
54
61
  api-auth
55
62
  faye-websocket
56
63
  httpi
@@ -58,7 +65,7 @@ GEM
58
65
  multi_json
59
66
  builder (3.2.2)
60
67
  coderay (1.0.9)
61
- colorize (0.5.8)
68
+ colorize (0.6.0)
62
69
  columnize (0.3.6)
63
70
  crack (0.4.1)
64
71
  safe_yaml (~> 0.9.0)
@@ -72,12 +79,15 @@ GEM
72
79
  debugger (~> 1)
73
80
  pry (>= 0.9.9)
74
81
  debugger-ruby_core_source (1.2.3)
82
+ easycov (0.1.1)
83
+ multi_json
84
+ simplecov
75
85
  eventmachine (1.0.3)
76
86
  faraday (0.8.8)
77
87
  multipart-post (~> 1.2.0)
78
- faye-websocket (0.6.3)
88
+ faye-websocket (0.7.0)
79
89
  eventmachine (>= 0.12.0)
80
- websocket-driver (>= 0.2.0)
90
+ websocket-driver (>= 0.3.0)
81
91
  ffi (1.9.0)
82
92
  git (1.2.6)
83
93
  github_api (0.10.1)
@@ -91,6 +101,7 @@ GEM
91
101
  hashie (2.0.5)
92
102
  highline (1.6.19)
93
103
  hirb (0.7.1)
104
+ hitimes (1.2.1)
94
105
  httpauth (0.2.0)
95
106
  httpi (2.1.0)
96
107
  rack
@@ -98,7 +109,7 @@ GEM
98
109
  json (1.8.0)
99
110
  jwt (0.1.8)
100
111
  multi_json (>= 1.5)
101
- listen (1.3.0)
112
+ listen (1.3.1)
102
113
  rb-fsevent (>= 0.9.3)
103
114
  rb-inotify (>= 0.9)
104
115
  rb-kqueue (>= 0.2)
@@ -108,11 +119,10 @@ GEM
108
119
  multi_json (>= 1.3.6)
109
120
  metaclass (0.0.1)
110
121
  method_source (0.8.2)
111
- minitest (4.7.5)
112
122
  mixlib-shellout (1.2.0)
113
123
  mocha (0.14.0)
114
124
  metaclass (~> 0.0.1)
115
- multi_json (1.7.9)
125
+ multi_json (1.8.0)
116
126
  multi_xml (0.5.5)
117
127
  multipart-post (1.2.0)
118
128
  nokogiri (1.5.10)
@@ -133,7 +143,7 @@ GEM
133
143
  rb-fchange (0.0.6)
134
144
  ffi
135
145
  rb-fsevent (0.9.3)
136
- rb-inotify (0.9.1)
146
+ rb-inotify (0.9.2)
137
147
  ffi (>= 0.5.0)
138
148
  rb-kqueue (0.2.0)
139
149
  ffi (>= 0.5.0)
@@ -155,7 +165,7 @@ GEM
155
165
  webmock (1.13.0)
156
166
  addressable (>= 2.2.7)
157
167
  crack (>= 0.3.2)
158
- websocket-driver (0.2.3)
168
+ websocket-driver (0.3.0)
159
169
  yard (0.8.7)
160
170
 
161
171
  PLATFORMS
@@ -170,7 +180,7 @@ DEPENDENCIES
170
180
  debugger-pry
171
181
  httpi
172
182
  jeweler!
173
- minitest (~> 4.7)
183
+ micron!
174
184
  mixlib-shellout
175
185
  mocha
176
186
  multi_json
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
@@ -2,14 +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-client 0.2.2 ruby lib
5
6
 
6
7
  Gem::Specification.new do |s|
7
8
  s.name = "bixby-client"
8
- s.version = "0.2.1"
9
+ s.version = "0.2.2"
9
10
 
10
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
12
  s.authors = ["Chetan Sarva"]
12
- s.date = "2013-08-29"
13
+ s.date = "2013-09-26"
13
14
  s.description = "Bixby Client"
14
15
  s.email = "chetan@pixelcop.net"
15
16
  s.executables = ["bixby"]
@@ -45,16 +46,23 @@ Gem::Specification.new do |s|
45
46
  "test/bixby-client/test_command.rb",
46
47
  "test/bixby-client/test_platform_util.rb",
47
48
  "test/helper.rb",
49
+ "test/patch/test_shellout.rb",
48
50
  "test/support/root_dir/etc/bixby.yml",
49
51
  "test/support/root_dir/etc/id_rsa",
50
52
  "test/support/root_dir/etc/server",
51
53
  "test/support/root_dir/etc/server.pub",
52
- "test/test_bixby-client.rb"
54
+ "test/support/root_dir/repo/vendor/test_bundle/bin/cat",
55
+ "test/support/root_dir/repo/vendor/test_bundle/bin/echo",
56
+ "test/support/root_dir/repo/vendor/test_bundle/digest",
57
+ "test/support/root_dir/repo/vendor/test_bundle/lib/test_bundle.rb",
58
+ "test/support/root_dir/repo/vendor/test_bundle/manifest.json",
59
+ "test/test_bixby-client.rb",
60
+ "test/test_script_util.rb"
53
61
  ]
54
62
  s.homepage = "http://github.com/chetan/bixby-client"
55
63
  s.licenses = ["MIT"]
56
64
  s.require_paths = ["lib"]
57
- s.rubygems_version = "2.0.3"
65
+ s.rubygems_version = "2.1.0"
58
66
  s.summary = "Bixby Client"
59
67
 
60
68
  if s.respond_to? :specification_version then
@@ -76,7 +84,7 @@ Gem::Specification.new do |s|
76
84
  s.add_development_dependency(%q<debugger>, [">= 0"])
77
85
  s.add_development_dependency(%q<debugger-pry>, [">= 0"])
78
86
  s.add_development_dependency(%q<simplecov>, [">= 0"])
79
- s.add_development_dependency(%q<minitest>, ["~> 4.7"])
87
+ s.add_development_dependency(%q<micron>, [">= 0"])
80
88
  s.add_development_dependency(%q<webmock>, [">= 0"])
81
89
  s.add_development_dependency(%q<mocha>, [">= 0"])
82
90
  s.add_development_dependency(%q<test_guard>, [">= 0"])
@@ -99,7 +107,7 @@ Gem::Specification.new do |s|
99
107
  s.add_dependency(%q<debugger>, [">= 0"])
100
108
  s.add_dependency(%q<debugger-pry>, [">= 0"])
101
109
  s.add_dependency(%q<simplecov>, [">= 0"])
102
- s.add_dependency(%q<minitest>, ["~> 4.7"])
110
+ s.add_dependency(%q<micron>, [">= 0"])
103
111
  s.add_dependency(%q<webmock>, [">= 0"])
104
112
  s.add_dependency(%q<mocha>, [">= 0"])
105
113
  s.add_dependency(%q<test_guard>, [">= 0"])
@@ -123,7 +131,7 @@ Gem::Specification.new do |s|
123
131
  s.add_dependency(%q<debugger>, [">= 0"])
124
132
  s.add_dependency(%q<debugger-pry>, [">= 0"])
125
133
  s.add_dependency(%q<simplecov>, [">= 0"])
126
- s.add_dependency(%q<minitest>, ["~> 4.7"])
134
+ s.add_dependency(%q<micron>, [">= 0"])
127
135
  s.add_dependency(%q<webmock>, [">= 0"])
128
136
  s.add_dependency(%q<mocha>, [">= 0"])
129
137
  s.add_dependency(%q<test_guard>, [">= 0"])
@@ -20,52 +20,15 @@ module Bixby
20
20
  return res.data
21
21
  end
22
22
 
23
- # Download the given list of files
23
+ # Download the given command file
24
24
  #
25
25
  # @param [CommandSpec] cmd CommandSpec representing the Bundle to which the files belong
26
26
  # @param [Hash] files Hash, returned from #list_files
27
- def self.download_files(cmd, files)
28
- return if files.nil? or files.empty?
29
-
30
- local_path = cmd.bundle_dir
31
- digest = cmd.load_digest
32
- files.each do |f|
33
-
34
- fetch = true
35
- if not digest then
36
- fetch = true
37
- elsif df = digest["files"].find{ |h| h["file"] == f["file"] } then
38
- # compare digest w/ stored one if we have it
39
- fetch = (df["digest"] != f["digest"])
40
- else
41
- fetch = true
42
- end
43
-
44
- if not fetch then
45
- debug { "skipping: #{f}" }
46
- next
47
- end
48
-
49
- debug { "fetching: #{f}"}
50
-
51
- params = cmd.to_hash
52
- params.delete(:digest)
53
-
54
- filename = File.join(local_path, f['file'])
55
- path = File.dirname(filename)
56
- if not File.exist? path then
57
- FileUtils.mkdir_p(path)
58
- end
59
-
60
- req = JsonRequest.new("provisioning:fetch_file", [ params, f['file'] ])
61
- Bixby.client.exec_api_download(req, filename)
62
- if f['file'] =~ /^bin/ then
63
- # correct permissions for executables
64
- FileUtils.chmod(0755, filename)
65
- end
66
- end # files.each
67
-
68
- cmd.update_digest
27
+ def self.fetch_file(cmd, file, dest)
28
+ params = cmd.to_hash
29
+ params.delete(:digest)
30
+ req = JsonRequest.new("provisioning:fetch_file", [params, file])
31
+ Bixby.client.exec_api_download(req, dest)
69
32
  end
70
33
 
71
34
 
@@ -21,7 +21,8 @@ module Bixby
21
21
  end
22
22
  end
23
23
  end
24
- end
24
+
25
+ end # UseBundle
25
26
 
26
27
  include UseBundle
27
28
 
@@ -1,15 +1,5 @@
1
1
 
2
- require 'rake/testtask'
3
- Rake::TestTask.new(:test) do |test|
4
- test.libs << 'lib' << 'test'
5
- test.pattern = 'test/**/test_*.rb'
2
+ require "micron/rake"
3
+ Micron::Rake.new do |task|
6
4
  end
7
-
8
5
  task :default => :test
9
-
10
- begin
11
- require 'single_test/tasks'
12
-
13
- rescue LoadError
14
- warn "single_test not available"
15
- end
@@ -1,14 +1,23 @@
1
1
 
2
2
  module Bixby
3
- class TestCase < MiniTest::Unit::TestCase
3
+ class TestCase < Micron::TestCase
4
4
 
5
5
  def setup
6
6
  super
7
- ENV["BIXBY_HOME"] = File.expand_path(File.join(File.dirname(__FILE__), "support", "root_dir"))
7
+ setup_agent_dir()
8
8
  end
9
9
 
10
10
  def teardown
11
11
  super
12
+ `rm -rf /tmp/bixby_client_test_agent`
13
+ ENV["BIXBY_HOME"] = nil
14
+ end
15
+
16
+ def setup_agent_dir
17
+ template = File.expand_path(File.join(File.dirname(__FILE__), "support", "root_dir"))
18
+ ENV["BIXBY_HOME"] = "/tmp/bixby_client_test_agent"
19
+ FileUtils.mkdir_p(Bixby.root)
20
+ `cp -a #{template}/* #{Bixby.root}/`
12
21
  end
13
22
 
14
23
  end
@@ -8,8 +8,9 @@ rescue Bundler::BundlerError => e
8
8
  exit e.status_code
9
9
  end
10
10
 
11
- require 'test_guard'
12
- TestGuard.load_simplecov()
11
+ require "awesome_print"
12
+ require "micron"
13
+ require "micron/minitest"
13
14
 
14
15
  # Load any HTTP clients before webmock so they can be stubbed
15
16
  # require 'curb'
@@ -24,4 +25,7 @@ ENV["RUBYLIB"] = $:.first
24
25
  require "bixby-client"
25
26
  require "base"
26
27
 
27
- MiniTest::Unit.autorun
28
+ EasyCov.path = "coverage"
29
+ EasyCov.filters << EasyCov::IGNORE_GEMS << EasyCov::IGNORE_STDLIB << EasyCov::IGNORE_TESTS
30
+
31
+ EasyCov.start
@@ -0,0 +1,21 @@
1
+
2
+ require 'helper'
3
+
4
+ module Bixby
5
+ module Test
6
+ module Patch
7
+
8
+ class TestShellout < TestCase
9
+
10
+ def test_patches
11
+ cmd = Mixlib::ShellOut.new("dir")
12
+ cmd.run_command
13
+ assert cmd.success?
14
+ refute cmd.fail?
15
+ end
16
+
17
+ end
18
+
19
+ end # Pach
20
+ end # Test
21
+ end # Bixby
@@ -0,0 +1,2 @@
1
+ #!/bin/bash
2
+ cat -
@@ -0,0 +1,2 @@
1
+ #!/bin/sh
2
+ echo $*
@@ -0,0 +1,17 @@
1
+ {
2
+ "digest": "c1af0e59a74367e83492a7501f6bdd7ed33de005c3f727a302c5ddfafa8c6f70",
3
+ "files": [
4
+ {
5
+ "file": "bin/cat",
6
+ "digest": "6d14ab63802f3ef51bdc16db1cfeb6df93167fe7a2aa09a6c737293d42c118b2"
7
+ },
8
+ {
9
+ "file": "bin/echo",
10
+ "digest": "5ca36fa0f9bd59e8169cc379215e6a481363df5b1e745f0442170fe6a56e1118"
11
+ },
12
+ {
13
+ "file": "manifest.json",
14
+ "digest": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
15
+ }
16
+ ]
17
+ }
@@ -0,0 +1,37 @@
1
+
2
+ require 'helper'
3
+
4
+ module Bixby
5
+ module Test
6
+
7
+ class TestScriptUtil < TestCase
8
+
9
+ include Bixby::ScriptUtil
10
+
11
+ def setup
12
+ super
13
+ @old_require_paths = $:.dup
14
+ end
15
+
16
+ def teardown
17
+ super
18
+ $:.reject!{ |s| !@old_require_paths.include?(s) }
19
+ end
20
+
21
+ def test_use_bundle
22
+ use_bundle "test_bundle"
23
+ assert $:.find{ |s| s =~ %r(test_bundle/lib) }
24
+ assert Module.const_defined?(:TestBundle)
25
+ end
26
+
27
+ def test_systemu
28
+ cmd = systemu("dir")
29
+ assert cmd
30
+ assert cmd.success?
31
+ refute cmd.fail?
32
+ end
33
+
34
+ end
35
+
36
+ end # Test
37
+ end # Bixby
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bixby-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
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-08-29 00:00:00.000000000 Z
11
+ date: 2013-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bixby-common
@@ -221,19 +221,19 @@ dependencies:
221
221
  - !ruby/object:Gem::Version
222
222
  version: '0'
223
223
  - !ruby/object:Gem::Dependency
224
- name: minitest
224
+ name: micron
225
225
  requirement: !ruby/object:Gem::Requirement
226
226
  requirements:
227
- - - ~>
227
+ - - '>='
228
228
  - !ruby/object:Gem::Version
229
- version: '4.7'
229
+ version: '0'
230
230
  type: :development
231
231
  prerelease: false
232
232
  version_requirements: !ruby/object:Gem::Requirement
233
233
  requirements:
234
- - - ~>
234
+ - - '>='
235
235
  - !ruby/object:Gem::Version
236
- version: '4.7'
236
+ version: '0'
237
237
  - !ruby/object:Gem::Dependency
238
238
  name: webmock
239
239
  requirement: !ruby/object:Gem::Requirement
@@ -354,11 +354,18 @@ files:
354
354
  - test/bixby-client/test_command.rb
355
355
  - test/bixby-client/test_platform_util.rb
356
356
  - test/helper.rb
357
+ - test/patch/test_shellout.rb
357
358
  - test/support/root_dir/etc/bixby.yml
358
359
  - test/support/root_dir/etc/id_rsa
359
360
  - test/support/root_dir/etc/server
360
361
  - test/support/root_dir/etc/server.pub
362
+ - test/support/root_dir/repo/vendor/test_bundle/bin/cat
363
+ - test/support/root_dir/repo/vendor/test_bundle/bin/echo
364
+ - test/support/root_dir/repo/vendor/test_bundle/digest
365
+ - test/support/root_dir/repo/vendor/test_bundle/lib/test_bundle.rb
366
+ - test/support/root_dir/repo/vendor/test_bundle/manifest.json
361
367
  - test/test_bixby-client.rb
368
+ - test/test_script_util.rb
362
369
  homepage: http://github.com/chetan/bixby-client
363
370
  licenses:
364
371
  - MIT
@@ -379,7 +386,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
379
386
  version: '0'
380
387
  requirements: []
381
388
  rubyforge_project:
382
- rubygems_version: 2.0.3
389
+ rubygems_version: 2.1.0
383
390
  signing_key:
384
391
  specification_version: 4
385
392
  summary: Bixby Client