gemsync 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -5,7 +5,7 @@ begin
5
5
  require 'jeweler'
6
6
  Jeweler::Tasks.new do |gem|
7
7
  gem.name = "gemsync"
8
- gem.version = "0.1.4"
8
+ gem.version = "0.1.5"
9
9
  gem.summary = %Q{Small gem to sync multiple gem installations.}
10
10
  gem.description = %Q{Small gem to sync multiple gem installations. This can be done by pointing to a ruby installation or from a text file created by `gem list > file.txt`.}
11
11
  gem.email = "quest@mac.com"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.4
1
+ 0.1.5
data/bin/gemsync CHANGED
@@ -8,7 +8,7 @@ require 'trollop'
8
8
  # Setup arguments from the command line.
9
9
  # This uses the trollop library on github.
10
10
  opts = Trollop::options do
11
- version "gemsync 0.1.4 (c) 2010 Josh Ellithorpe"
11
+ version "gemsync 0.1.5 (c) 2010 Josh Ellithorpe"
12
12
  banner <<-EOS
13
13
  Small gem to sync multiple gem installations.
14
14
 
@@ -17,7 +17,7 @@ Usage: gemsync [options]
17
17
  Available Options:
18
18
  EOS
19
19
  opt :source, "Either the ruby installation directory, or a list of gems produced from 'gem list'. Ex: /usr or /path/to/gemlist.txt", :type => String, :required => true
20
- opt :destination, "Ruby installation directory you want to sync up. Ex: /opt/ruby-enterprise", :type => String, :required => true
20
+ opt :destination, "Ruby installation directory you want to sync up. Ex: /opt/ruby-enterprise", :type => String, :required => false
21
21
  opt :disable_sudo, "Disable sudo when installing gems", :default => false
22
22
  opt :build_docs, "Build documentation", :default => false
23
23
  end
@@ -33,14 +33,20 @@ else
33
33
  Trollop::die :source, "\n\t-- Binary '#{opts[:source]}/bin/gem' does not exist" unless File.exists?("#{opts[:source]}/bin/gem")
34
34
  end
35
35
 
36
- # Die if destination is set incorrectly
37
- Trollop::die :destination, "\n\t-- Directory '#{opts[:destination]}' does not exist" unless File.directory?(opts[:destination])
38
- Trollop::die :destination, "\n\t-- Binary '#{opts[:destination]}/bin/gem' does not exist" unless File.exists?("#{opts[:destination]}/bin/gem")
36
+ # Attempt to set default destination based upon location of 'gem' binary
37
+ if opts[:destination].nil?
38
+ guessed_destination_path = `which gem`.split('/')[0..-3].join('/')
39
+ Trollop::die :destination, "\n\t-- Destination was not set, and gemsync could not guess it" if (guessed_destination_path == opts[:source] || !File.directory?(guessed_destination_path))
40
+ else
41
+ # Die if destination is set incorrectly
42
+ Trollop::die :destination, "\n\t-- Directory '#{opts[:destination]}' does not exist" unless File.directory?(opts[:destination])
43
+ Trollop::die :destination, "\n\t-- Binary '#{opts[:destination]}/bin/gem' does not exist" unless File.exists?("#{opts[:destination]}/bin/gem")
44
+ end
39
45
 
40
46
  # Cleanup main and sync dir, they shouldn't end in a '/' so lets chomp it.
41
47
  # Couldn't use chomp! since opts are frozen.
42
48
  @main_dir = opts[:source].chomp('/')
43
- @sync_dir = opts[:destination].chomp('/')
49
+ @sync_dir = opts[:destination].nil? ? guessed_destination_path.chomp('/') : opts[:destination].chomp('/')
44
50
 
45
51
  # Setup additional flags
46
52
  @docstring = opts[:build_docs] ? '' : '--no-ri --no-rdoc'
@@ -128,10 +134,10 @@ for gem in gems
128
134
  # Also look for mysql5 type binaries that some package managers use
129
135
  mysql_config = `which mysql_config` || `which mysql_config5`
130
136
  mysql_dir = `which mysql` || `which mysql5`
131
- mysql_dir = mysql_dir.split('/')[0..-2].join('/')
137
+ mysql_dir = mysql_dir.split('/')[0..-3].join('/')
132
138
  system("#{@sudostring}#{@sync_dir}/bin/gem install #{gem_name} -v #{version} -- --with-mysql-dir=#{mysql_dir} --with-mysql-config=#{mysql_config} #{@docstring}")
133
139
  else
134
140
  system("#{@sudostring}#{@sync_dir}/bin/gem install #{gem_name} -v #{version} #{@docstring}")
135
141
  end
136
142
  end
137
- end
143
+ end
data/gemsync.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{gemsync}
8
- s.version = "0.1.4"
8
+ s.version = "0.1.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["quest"]
12
- s.date = %q{2010-09-20}
12
+ s.date = %q{2010-09-21}
13
13
  s.default_executable = %q{gemsync}
14
14
  s.description = %q{Small gem to sync multiple gem installations. This can be done by pointing to a ruby installation or from a text file created by `gem list > file.txt`.}
15
15
  s.email = %q{quest@mac.com}
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
26
26
  "VERSION",
27
27
  "bin/gemsync",
28
28
  "gemsync.gemspec",
29
- "pkg/gemsync-0.1.4.gem",
29
+ "pkg/gemsync-0.1.5.gem",
30
30
  "rdoc/created.rid",
31
31
  "rdoc/files/README_rdoc.html",
32
32
  "rdoc/fr_class_index.html",
Binary file
data/rdoc/created.rid CHANGED
@@ -1 +1 @@
1
- Sun, 19 Sep 2010 04:00:03 -0700
1
+ Tue, 21 Sep 2010 09:39:20 -0700
data/rdoc/index.html CHANGED
@@ -5,14 +5,12 @@
5
5
 
6
6
  <!--
7
7
 
8
- gemsync 0.1.3
9
-
8
+ gemsync 0.1.5
10
9
 
11
10
  -->
12
11
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
13
12
  <head>
14
- <title>gemsync 0.1.3
15
- </title>
13
+ <title>gemsync 0.1.5</title>
16
14
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
17
15
  </head>
18
16
  <frameset rows="20%, 80%">
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gemsync
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 4
10
- version: 0.1.4
9
+ - 5
10
+ version: 0.1.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - quest
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-20 00:00:00 -07:00
18
+ date: 2010-09-21 00:00:00 -07:00
19
19
  default_executable: gemsync
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -51,7 +51,7 @@ files:
51
51
  - VERSION
52
52
  - bin/gemsync
53
53
  - gemsync.gemspec
54
- - pkg/gemsync-0.1.4.gem
54
+ - pkg/gemsync-0.1.5.gem
55
55
  - rdoc/created.rid
56
56
  - rdoc/files/README_rdoc.html
57
57
  - rdoc/fr_class_index.html
Binary file