hoosegow 1.2.2 → 1.2.3

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: ceed4f5d348d898d233966dfc25bf9fac28a6940
4
- data.tar.gz: bc31af907f34fb7cebf7e17634a3ed3b95395e6c
3
+ metadata.gz: 5236254c19caca40ddba281a7b4881ed849885c4
4
+ data.tar.gz: 7f266fd4654f08680b084fbe5ff6daf86b3e5f48
5
5
  SHA512:
6
- metadata.gz: d02daa560bdfa44dcc50c79998d57886d5502843cd8de6d49d1f0cf39ba8f3f4f1908e1478c61ca0ca2246c6df6e5ce5d867d13d42acfe1e2bf978fa60e842ac
7
- data.tar.gz: 7fdef10365911b536da35c20c83c21e63590a844cc413194f70edac6d75c80041e97397cae9de93e62862096aa86a26985b928623e2042d51f99a689660a021f
6
+ metadata.gz: 612bd862bbdb713fafabf7605d8b98136f121bf8321437e71c55fb86946209c8cc06a945b7bb508eef90fd1329e0f7d502827aeb75875c960fa666334da1ac0e
7
+ data.tar.gz: 66a72c410f73b9aa21238568e21d5eccef15b48f6bf35f1de94838db2f98579b1238cf5cce9fdce6c5835e836dc2d714e29ca7b1a95af9beae493dc6cb93973a
data/Rakefile CHANGED
@@ -1,5 +1,6 @@
1
1
  require_relative 'lib/hoosegow'
2
2
 
3
+ require 'bundler/gem_tasks'
3
4
  require 'rspec/core/rake_task'
4
5
 
5
6
  begin
@@ -2,7 +2,7 @@ require 'rake'
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'hoosegow'
5
- s.version = '1.2.2'
5
+ s.version = '1.2.3'
6
6
  s.summary = "A Docker jail for ruby code"
7
7
  s.description = "Hoosegow provides an RPC layer on top of Docker containers so that you can isolate unsafe parts of your application."
8
8
  s.authors = ["Ben Toews", "Matt Burke"]
@@ -24,7 +24,7 @@ Gem::Specification.new do |s|
24
24
  s.executables = ['hoosegow']
25
25
  s.homepage = 'https://github.com/github/hoosegow'
26
26
  s.required_ruby_version = ">= 1.9.3"
27
- s.add_development_dependency 'rake', '>= 10.3.2', '~> 10.3'
27
+ s.add_development_dependency 'rake'
28
28
  s.add_development_dependency 'rspec', '>= 2.14.1', '~> 2.14'
29
29
  s.add_runtime_dependency 'msgpack', '>= 0.5.6', '~> 0.5'
30
30
  s.add_runtime_dependency 'yajl-ruby', '>= 1.1.0', '~> 1.1'
@@ -127,6 +127,8 @@ class Hoosegow
127
127
  def delete_container
128
128
  return unless @container
129
129
  @container.delete
130
+ rescue ::Docker::Error::ServerError => e
131
+ $stderr.puts "Docker could not delete #{@container.id}: #{e}"
130
132
  end
131
133
 
132
134
  # Public: Build a new image.
@@ -1,2 +1,2 @@
1
1
  #!/bin/bash
2
- bundle install -j4
2
+ bundle install -j4 --path .bundle --binstubs bundler-bin
@@ -106,4 +106,26 @@ describe Hoosegow::Docker do
106
106
  expect(docker.image_exist?("not_there")).to eq(false)
107
107
  end
108
108
  end
109
+
110
+ context "delete_container" do
111
+ let(:docker) { Hoosegow::Docker.new CONFIG }
112
+ let(:container) { Object.new }
113
+ before do
114
+ docker.instance_variable_set(:@container, container)
115
+ allow(container).to receive(:id).and_return("1234")
116
+ $old_stderr = $stderr
117
+ $stderr = StringIO.new
118
+ end
119
+ after do
120
+ $stderr = $old_stderr
121
+ end
122
+
123
+ it "rescues error and prints when error is raised" do
124
+ allow(container).to receive(:delete).
125
+ and_raise(::Docker::Error::ServerError, "device or resource busy")
126
+ docker.delete_container
127
+ $stderr.rewind
128
+ expect($stderr.read).to eql("Docker could not delete 1234: device or resource busy\n")
129
+ end
130
+ end
109
131
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hoosegow
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Toews
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-11-24 00:00:00.000000000 Z
12
+ date: 2016-01-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -17,20 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: 10.3.2
21
- - - "~>"
22
- - !ruby/object:Gem::Version
23
- version: '10.3'
20
+ version: '0'
24
21
  type: :development
25
22
  prerelease: false
26
23
  version_requirements: !ruby/object:Gem::Requirement
27
24
  requirements:
28
25
  - - ">="
29
26
  - !ruby/object:Gem::Version
30
- version: 10.3.2
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '10.3'
27
+ version: '0'
34
28
  - !ruby/object:Gem::Dependency
35
29
  name: rspec
36
30
  requirement: !ruby/object:Gem::Requirement