spitball-server 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 +6 -0
- data/Gemfile +2 -2
- data/README.md +1 -1
- data/lib/spitball/version.rb +1 -1
- data/lib/spitball.rb +10 -5
- data/spec/spitball_spec.rb +3 -3
- data/spitball-server.gemspec +1 -0
- metadata +38 -25
data/.travis.yml
ADDED
data/Gemfile
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
source
|
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/version.rb
CHANGED
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 =
|
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
|
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 =
|
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
|
data/spec/spitball_spec.rb
CHANGED
@@ -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
|
data/spitball-server.gemspec
CHANGED
@@ -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-server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 3
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 7
|
9
|
+
- 0
|
10
|
+
version: 0.7.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Matt Freels
|
@@ -17,12 +17,24 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date:
|
21
|
-
default_executable:
|
20
|
+
date: 2013-11-12 00:00:00 Z
|
22
21
|
dependencies:
|
23
22
|
- !ruby/object:Gem::Dependency
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 3
|
29
|
+
segments:
|
30
|
+
- 0
|
31
|
+
version: "0"
|
32
|
+
name: json
|
24
33
|
prerelease: false
|
25
|
-
|
34
|
+
type: :runtime
|
35
|
+
version_requirements: *id001
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
26
38
|
none: false
|
27
39
|
requirements:
|
28
40
|
- - ~>
|
@@ -33,12 +45,12 @@ dependencies:
|
|
33
45
|
- 2
|
34
46
|
- 0
|
35
47
|
version: 1.2.0
|
36
|
-
requirement: *id001
|
37
48
|
name: sinatra
|
49
|
+
prerelease: false
|
38
50
|
type: :runtime
|
51
|
+
version_requirements: *id002
|
39
52
|
- !ruby/object:Gem::Dependency
|
40
|
-
|
41
|
-
version_requirements: &id002 !ruby/object:Gem::Requirement
|
53
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
42
54
|
none: false
|
43
55
|
requirements:
|
44
56
|
- - ~>
|
@@ -49,12 +61,12 @@ dependencies:
|
|
49
61
|
- 3
|
50
62
|
- 0
|
51
63
|
version: 1.3.0
|
52
|
-
requirement: *id002
|
53
64
|
name: rspec
|
65
|
+
prerelease: false
|
54
66
|
type: :development
|
67
|
+
version_requirements: *id003
|
55
68
|
- !ruby/object:Gem::Dependency
|
56
|
-
|
57
|
-
version_requirements: &id003 !ruby/object:Gem::Requirement
|
69
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
58
70
|
none: false
|
59
71
|
requirements:
|
60
72
|
- - ">="
|
@@ -63,12 +75,12 @@ dependencies:
|
|
63
75
|
segments:
|
64
76
|
- 0
|
65
77
|
version: "0"
|
66
|
-
requirement: *id003
|
67
78
|
name: diff-lcs
|
79
|
+
prerelease: false
|
68
80
|
type: :development
|
81
|
+
version_requirements: *id004
|
69
82
|
- !ruby/object:Gem::Dependency
|
70
|
-
|
71
|
-
version_requirements: &id004 !ruby/object:Gem::Requirement
|
83
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
72
84
|
none: false
|
73
85
|
requirements:
|
74
86
|
- - ">="
|
@@ -77,12 +89,12 @@ dependencies:
|
|
77
89
|
segments:
|
78
90
|
- 0
|
79
91
|
version: "0"
|
80
|
-
requirement: *id004
|
81
92
|
name: rr
|
93
|
+
prerelease: false
|
82
94
|
type: :development
|
95
|
+
version_requirements: *id005
|
83
96
|
- !ruby/object:Gem::Dependency
|
84
|
-
|
85
|
-
version_requirements: &id005 !ruby/object:Gem::Requirement
|
97
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
86
98
|
none: false
|
87
99
|
requirements:
|
88
100
|
- - "="
|
@@ -93,12 +105,12 @@ dependencies:
|
|
93
105
|
- 8
|
94
106
|
- 7
|
95
107
|
version: 0.8.7
|
96
|
-
requirement: *id005
|
97
108
|
name: rake
|
109
|
+
prerelease: false
|
98
110
|
type: :development
|
111
|
+
version_requirements: *id006
|
99
112
|
- !ruby/object:Gem::Dependency
|
100
|
-
|
101
|
-
version_requirements: &id006 !ruby/object:Gem::Requirement
|
113
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
102
114
|
none: false
|
103
115
|
requirements:
|
104
116
|
- - ">="
|
@@ -107,9 +119,10 @@ dependencies:
|
|
107
119
|
segments:
|
108
120
|
- 0
|
109
121
|
version: "0"
|
110
|
-
requirement: *id006
|
111
122
|
name: phocus
|
123
|
+
prerelease: false
|
112
124
|
type: :development
|
125
|
+
version_requirements: *id007
|
113
126
|
description: Use bundler to generate gem tarball packages - server!
|
114
127
|
email: freels@twitter.com
|
115
128
|
executables:
|
@@ -121,6 +134,7 @@ extra_rdoc_files: []
|
|
121
134
|
|
122
135
|
files:
|
123
136
|
- .gitignore
|
137
|
+
- .travis.yml
|
124
138
|
- Gemfile
|
125
139
|
- README.md
|
126
140
|
- Rakefile
|
@@ -141,7 +155,6 @@ files:
|
|
141
155
|
- spec/spitball_spec.rb
|
142
156
|
- spitball-server.gemspec
|
143
157
|
- spitball.gemspec
|
144
|
-
has_rdoc: true
|
145
158
|
homepage: ""
|
146
159
|
licenses: []
|
147
160
|
|
@@ -171,7 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
171
184
|
requirements: []
|
172
185
|
|
173
186
|
rubyforge_project: spitball-server
|
174
|
-
rubygems_version: 1.
|
187
|
+
rubygems_version: 1.8.3
|
175
188
|
signing_key:
|
176
189
|
specification_version: 3
|
177
190
|
summary: Use bundler to generate gem tarball packages -- server!
|