spitball 0.6.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml ADDED
@@ -0,0 +1,6 @@
1
+ language: ruby
2
+ rvm:
3
+ - ree
4
+ - 1.8.7
5
+ - 1.9.3
6
+ - 2.0.0
data/Gemfile CHANGED
@@ -1,3 +1,3 @@
1
- source :rubygems
1
+ source 'https://rubygems.org'
2
2
 
3
- gemspec :name => 'spitball-server'
3
+ gemspec :name => 'spitball-server'
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- ## spitball
1
+ ## spitball [![Build Status](https://secure.travis-ci.org/twitter/spitball.png?branch=master)](http://travis-ci.org/twitter/spitball) [![Code Climate](https://codeclimate.com/github/twitter/spitball.png)](https://codeclimate.com/github/twitter/spitball)
2
2
 
3
3
  A very simple gem package generation tool built on `bundler`. Pass it a
4
4
  gem file, it spits out a tarball of the generated gem
data/lib/spitball.rb CHANGED
@@ -3,6 +3,8 @@ require 'digest/md5'
3
3
  require 'ext/bundler_lockfile_parser'
4
4
  require 'ext/bundler_fake_dsl'
5
5
 
6
+ $pwd = Dir.pwd
7
+
6
8
  class Spitball
7
9
  require 'spitball/client_common'
8
10
  require 'spitball/digest'
@@ -33,7 +35,7 @@ class Spitball
33
35
  @gemfile = gemfile
34
36
  @gemfile_lock = gemfile_lock
35
37
  @options = options
36
- @without = (options[:without] || []).map{|w| w.to_sym}
38
+ @without = options[:without].is_a?(Enumerable) ? options[:without].map(&:to_sym) : (options[:without] ? [options[:without].to_sym] : [])
37
39
  @parsed_lockfile, @dsl = Bundler::FakeLockfileParser.new(gemfile_lock), Bundler::FakeDsl.new(gemfile)
38
40
  raise "You need to run bundle install before you can use spitball" unless (@parsed_lockfile.dependencies.map{|d| d.name}.uniq.sort == @dsl.__gem_names.uniq.sort)
39
41
  @groups_to_install = @dsl.__groups.keys - @without
@@ -74,7 +76,7 @@ class Spitball
74
76
 
75
77
  Dir.chdir(Repo.gemcache_path) do
76
78
  @dsl.__gem_names.each do |spec|
77
- spec_name = spec.first
79
+ spec_name = spec
78
80
  if @groups_to_install.any?{|group| @dsl.__groups[group].include?(spec_name)}
79
81
  if found_spec = @parsed_lockfile.specs.find {|spec| spec.name == spec_name}
80
82
  install_gem(found_spec)
@@ -119,7 +121,10 @@ class Spitball
119
121
  cache_dir = File.join(Repo.gemcache_path, "#{name}-#{::Digest::MD5.hexdigest([name, version, sources_opt(@parsed_lockfile.sources)].join('/'))}")
120
122
  unless File.exist?(cache_dir)
121
123
  FileUtils.mkdir_p(cache_dir)
122
- out = `#{Spitball.gem_cmd} install #{name} -v'#{version}' --no-rdoc --no-ri --ignore-dependencies -i#{cache_dir} #{sources_opt(@parsed_lockfile.sources)} 2>&1`
124
+ out = ""
125
+ Dir.chdir($pwd) do
126
+ out = `#{Spitball.gem_cmd} install #{name} -v'#{version}' --no-rdoc --no-ri --ignore-dependencies -i#{cache_dir} #{sources_opt(@parsed_lockfile.sources)} 2>&1`
127
+ end
123
128
  if $? == 0
124
129
  puts out
125
130
  else
@@ -133,7 +138,7 @@ class Spitball
133
138
  end
134
139
 
135
140
  def sources_opt(sources)
136
- Array(ENV['SOURCE_OVERRIDE'] ||
141
+ Array(ENV['SOURCE_OVERRIDE'] ||
137
142
  sources.
138
143
  map{|s| s.remotes}.flatten.
139
144
  map{|s| s.to_s}.
@@ -160,4 +165,4 @@ class Spitball
160
165
  def tarball_path
161
166
  Repo.bundle_path(digest, 'tgz')
162
167
  end
163
- end
168
+ end
@@ -1,3 +1,3 @@
1
1
  class Spitball
2
- VERSION = '0.6.1' unless const_defined?(:VERSION)
2
+ VERSION = '0.7.0' unless const_defined?(:VERSION)
3
3
  end
@@ -1,4 +1,4 @@
1
- require 'spec/spec_helper'
1
+ require './spec/spec_helper'
2
2
 
3
3
  describe Spitball do
4
4
  before do
@@ -124,7 +124,7 @@ describe Spitball do
124
124
  activerecord
125
125
  end_lockfile
126
126
  end
127
-
127
+
128
128
  it "should use without" do
129
129
  @spitball = Spitball.new(@gemfile, @lockfile)
130
130
  mock(@spitball).install_and_copy_spec(anything, anything).times(9)
@@ -288,4 +288,4 @@ describe Spitball do
288
288
  end
289
289
  end
290
290
  end
291
- end
291
+ end
@@ -18,6 +18,7 @@ Gem::Specification.new do |s|
18
18
  s.executables = ['spitball-server', 'spitball-cache-cleanup']
19
19
  s.require_paths = ["lib"]
20
20
 
21
+ s.add_dependency 'json'
21
22
  s.add_dependency 'sinatra', '~> 1.2.0'
22
23
  s.add_development_dependency 'rspec', "~> 1.3.0"
23
24
  s.add_development_dependency 'diff-lcs'
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: 5
4
+ hash: 3
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 6
9
- - 1
10
- version: 0.6.1
8
+ - 7
9
+ - 0
10
+ version: 0.7.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Matt Freels
@@ -17,12 +17,10 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2011-07-30 00:00:00 -07:00
21
- default_executable:
20
+ date: 2013-11-12 00:00:00 Z
22
21
  dependencies:
23
22
  - !ruby/object:Gem::Dependency
24
- prerelease: false
25
- version_requirements: &id001 !ruby/object:Gem::Requirement
23
+ requirement: &id001 !ruby/object:Gem::Requirement
26
24
  none: false
27
25
  requirements:
28
26
  - - ~>
@@ -33,12 +31,12 @@ dependencies:
33
31
  - 3
34
32
  - 0
35
33
  version: 1.3.0
36
- requirement: *id001
37
34
  name: rspec
35
+ prerelease: false
38
36
  type: :development
37
+ version_requirements: *id001
39
38
  - !ruby/object:Gem::Dependency
40
- prerelease: false
41
- version_requirements: &id002 !ruby/object:Gem::Requirement
39
+ requirement: &id002 !ruby/object:Gem::Requirement
42
40
  none: false
43
41
  requirements:
44
42
  - - ">="
@@ -47,12 +45,12 @@ dependencies:
47
45
  segments:
48
46
  - 0
49
47
  version: "0"
50
- requirement: *id002
51
48
  name: diff-lcs
49
+ prerelease: false
52
50
  type: :development
51
+ version_requirements: *id002
53
52
  - !ruby/object:Gem::Dependency
54
- prerelease: false
55
- version_requirements: &id003 !ruby/object:Gem::Requirement
53
+ requirement: &id003 !ruby/object:Gem::Requirement
56
54
  none: false
57
55
  requirements:
58
56
  - - ">="
@@ -61,12 +59,12 @@ dependencies:
61
59
  segments:
62
60
  - 0
63
61
  version: "0"
64
- requirement: *id003
65
62
  name: rr
63
+ prerelease: false
66
64
  type: :development
65
+ version_requirements: *id003
67
66
  - !ruby/object:Gem::Dependency
68
- prerelease: false
69
- version_requirements: &id004 !ruby/object:Gem::Requirement
67
+ requirement: &id004 !ruby/object:Gem::Requirement
70
68
  none: false
71
69
  requirements:
72
70
  - - "="
@@ -77,12 +75,12 @@ dependencies:
77
75
  - 8
78
76
  - 7
79
77
  version: 0.8.7
80
- requirement: *id004
81
78
  name: rake
79
+ prerelease: false
82
80
  type: :development
81
+ version_requirements: *id004
83
82
  - !ruby/object:Gem::Dependency
84
- prerelease: false
85
- version_requirements: &id005 !ruby/object:Gem::Requirement
83
+ requirement: &id005 !ruby/object:Gem::Requirement
86
84
  none: false
87
85
  requirements:
88
86
  - - ">="
@@ -91,9 +89,10 @@ dependencies:
91
89
  segments:
92
90
  - 0
93
91
  version: "0"
94
- requirement: *id005
95
92
  name: phocus
93
+ prerelease: false
96
94
  type: :development
95
+ version_requirements: *id005
97
96
  description: Use bundler to generate gem tarball packages.
98
97
  email: freels@twitter.com
99
98
  executables:
@@ -104,6 +103,7 @@ extra_rdoc_files:
104
103
  - README.md
105
104
  files:
106
105
  - .gitignore
106
+ - .travis.yml
107
107
  - Gemfile
108
108
  - README.md
109
109
  - Rakefile
@@ -124,7 +124,6 @@ files:
124
124
  - spec/spitball_spec.rb
125
125
  - spitball-server.gemspec
126
126
  - spitball.gemspec
127
- has_rdoc: true
128
127
  homepage: http://rubygems.org/gems/spitball
129
128
  licenses: []
130
129
 
@@ -154,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
153
  requirements: []
155
154
 
156
155
  rubyforge_project: spitball
157
- rubygems_version: 1.6.2
156
+ rubygems_version: 1.8.3
158
157
  signing_key:
159
158
  specification_version: 3
160
159
  summary: Use bundler to generate gem tarball packages