spitball 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.4
1
+ 0.2.5
data/bin/spitball-server CHANGED
@@ -58,7 +58,12 @@ post '/create' do
58
58
  pid = open("|-")
59
59
 
60
60
  if pid == nil # child
61
- ball.cache!
61
+ begin
62
+ ball.cache!
63
+ rescue Object => e
64
+ puts "#{e.class}: #{e}", e.backtrace.map{|l| "\t#{l}" }
65
+ exit! 1
66
+ end
62
67
  exit!
63
68
  end
64
69
 
data/lib/spitball.rb CHANGED
@@ -53,15 +53,17 @@ class Spitball
53
53
 
54
54
  File.open(gemfile_path, 'w') {|f| f.write gemfile }
55
55
 
56
- if system "cd #{bundle_path} && bundle install #{bundle_path} --disable-shared-gems #{without_clause}"
56
+ if system "cd #{bundle_path} && bundle install #{bundle_path} --disable-shared-gems #{without_clause} 2>&1"
57
57
 
58
58
  # rewrite bang lines to #!/usr/bin/env ruby
59
59
  # in serious lameness, OS X sed (more posix compliant?) requires
60
60
  # a slightly different sed incantation for in place editing
61
- if RUBY_PLATFORM =~ /linux/
62
- system "cd #{bundle_path} && find bin/* -exec sed -i'' '1,1 s|^#!/.*/ruby[ ]*|#!/usr/bin/env ruby|' {} \;"
63
- else
64
- system "cd #{bundle_path} && find bin/* -exec sed -i '' '1,1 s|^#!/.*/ruby[ ]*|#!/usr/bin/env ruby|' {} \;"
61
+ if Dir["#{bundle_path}/bin/*"].length > 0
62
+ if RUBY_PLATFORM =~ /linux/
63
+ system "cd #{bundle_path} && find bin/* -exec sed -i'' '1,1 s|^#!/.*/ruby[ ]*|#!/usr/bin/env ruby|' {} \\;"
64
+ else
65
+ system "cd #{bundle_path} && find bin/* -exec sed -i '' '1,1 s|^#!/.*/ruby[ ]*|#!/usr/bin/env ruby|' {} \\;"
66
+ end
65
67
  end
66
68
 
67
69
  system "tar czf #{tarball_path}.#{Process.pid} -C #{bundle_path} ."
@@ -3,8 +3,6 @@ require 'uri'
3
3
 
4
4
  class Spitball::Remote
5
5
 
6
- WAIT_SECONDS = 240
7
-
8
6
  def initialize(gemfile, host, port)
9
7
  @gemfile = gemfile
10
8
  @host = host
@@ -46,14 +44,10 @@ class Spitball::Remote
46
44
  def get_tarball_data(location)
47
45
  uri = URI.parse(location)
48
46
 
49
- (WAIT_SECONDS / 2).times do
50
- if (res = Net::HTTP.get_response(uri)).code == '200'
51
- return res.body
52
- else
53
- sleep 2
54
- end
47
+ if (res = Net::HTTP.get_response(uri)).code == '200'
48
+ return res.body
49
+ else
50
+ raise Spitball::ServerFailure, "Spitball download failed."
55
51
  end
56
-
57
- raise Spitball::ServerFailure, "Spitball download timed out."
58
52
  end
59
53
  end
data/spitball.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{spitball}
8
- s.version = "0.2.4"
8
+ s.version = "0.2.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Matt Freels", "Brandon Mitchell"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spitball
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 4
10
- version: 0.2.4
9
+ - 5
10
+ version: 0.2.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Matt Freels