spitball 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,9 @@
1
1
  source :rubygems
2
2
 
3
- gem 'mysql'
4
- gem 'json'
3
+ group "native" do
4
+ gem 'mysql'
5
+ gem 'json'
6
+ end
5
7
 
6
8
  gem 'activesupport'
7
9
 
File without changes
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
@@ -20,6 +20,10 @@ opts = OptionParser.new do |opts|
20
20
  args[:port] = port
21
21
  end
22
22
 
23
+ opts.on('--without a,b,c', Array, 'Excluded groups in the tarball. Does not apply to remote spitballs') do |without|
24
+ args[:without] = without
25
+ end
26
+
23
27
  opts.on('--version') do
24
28
  puts Spitball::VERSION
25
29
  exit 0
@@ -46,6 +50,6 @@ gemfile = File.read(args[:gemfile])
46
50
 
47
51
  ball = args[:host] ?
48
52
  Spitball::Remote.new(gemfile, args[:host], (args[:port] || 8080).to_i) :
49
- Spitball.new(gemfile)
53
+ Spitball.new(gemfile, :without => args[:without])
50
54
 
51
55
  ball.copy_to args[:destination]
@@ -15,10 +15,11 @@ class Spitball
15
15
  include Spitball::Digest
16
16
  include Spitball::FileLock
17
17
 
18
- attr_reader :gemfile
18
+ attr_reader :gemfile, :options
19
19
 
20
- def initialize(gemfile)
20
+ def initialize(gemfile, options = {})
21
21
  @gemfile = gemfile
22
+ @options = options
22
23
  end
23
24
 
24
25
  def copy_to(dest)
@@ -50,7 +51,7 @@ class Spitball
50
51
  File.open(gemfile_path, 'w') {|f| f.write gemfile }
51
52
  FileUtils.mkdir_p bundle_path
52
53
 
53
- if system "bundle install #{bundle_path} --gemfile=#{gemfile_path} --disable-shared-gems > /dev/null"
54
+ if system "bundle install #{bundle_path} --gemfile=#{gemfile_path} --disable-shared-gems #{without_clause} > /dev/null"
54
55
  FileUtils.rm_rf File.join(bundle_path, "cache")
55
56
 
56
57
  system "tar czf #{tarball_path}.#{Process.pid} -C #{bundle_path} ."
@@ -64,6 +65,13 @@ class Spitball
64
65
  FileUtils.rm_rf bundle_path
65
66
  end
66
67
 
68
+ def without_clause
69
+ without = options[:without] || []
70
+ return '' if without.empty?
71
+
72
+ "--without=#{without.join(',')}"
73
+ end
74
+
67
75
  # Paths
68
76
 
69
77
  def bundle_path(extension = nil)
@@ -2,7 +2,7 @@ require 'digest/sha1'
2
2
 
3
3
  module Spitball::Digest
4
4
  def digest
5
- @digest ||= ::Digest::SHA1.hexdigest gemfile
5
+ @digest ||= ::Digest::SHA1.hexdigest "#{options.to_a.sort}:#{gemfile}"
6
6
  end
7
7
 
8
8
  def hash
@@ -5,21 +5,21 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{spitball}
8
- s.version = "0.1.2"
8
+ s.version = "0.1.3"
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"]
12
- s.date = %q{2010-07-16}
12
+ s.date = %q{2010-07-19}
13
13
  s.description = %q{Use bundler to generate gem tarball packages.}
14
14
  s.email = %q{freels@twitter.com}
15
15
  s.executables = ["spitball", "spitball-server"]
16
16
  s.extra_rdoc_files = [
17
- "README"
17
+ "README.md"
18
18
  ]
19
19
  s.files = [
20
20
  ".gitignore",
21
21
  "Gemfile.sample",
22
- "README",
22
+ "README.md",
23
23
  "Rakefile",
24
24
  "VERSION",
25
25
  "bin/spitball",
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
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Matt Freels
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-07-16 00:00:00 -07:00
19
+ date: 2010-07-19 00:00:00 -07:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -86,11 +86,11 @@ executables:
86
86
  extensions: []
87
87
 
88
88
  extra_rdoc_files:
89
- - README
89
+ - README.md
90
90
  files:
91
91
  - .gitignore
92
92
  - Gemfile.sample
93
- - README
93
+ - README.md
94
94
  - Rakefile
95
95
  - VERSION
96
96
  - bin/spitball