gem_tools 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +3 -0
- data/lib/gem_tools/version.rb +1 -1
- data/lib/gem_tools.rb +5 -5
- metadata +1 -1
data/History.txt
CHANGED
data/lib/gem_tools/version.rb
CHANGED
data/lib/gem_tools.rb
CHANGED
@@ -11,8 +11,8 @@ module GemTools
|
|
11
11
|
def setup
|
12
12
|
require 'fileutils'
|
13
13
|
dest_file = File.join(ARGV[1], '/config/gems.yml')
|
14
|
-
if File.exist?(dest_file) && !
|
15
|
-
puts "#{dest_file} already exists.\n\ngemtools
|
14
|
+
if File.exist?(dest_file) && ! OPTIONS.has_key?(:force)
|
15
|
+
puts "#{dest_file} already exists.\n\ngemtools setup #{ARGV[1]} --force\n\nto overwrite"
|
16
16
|
exit 1
|
17
17
|
else
|
18
18
|
FileUtils.copy(File.join(File.dirname(__FILE__), '../config/gems.template.yml'), dest_file)
|
@@ -36,7 +36,7 @@ module GemTools
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def help
|
39
|
-
puts
|
39
|
+
puts OPTS
|
40
40
|
end
|
41
41
|
|
42
42
|
def load_config
|
@@ -76,7 +76,7 @@ module GemTools
|
|
76
76
|
|
77
77
|
unless gems.nil?
|
78
78
|
docs = ''
|
79
|
-
unless
|
79
|
+
unless OPTIONS.has_key?(:docs)
|
80
80
|
docs << '--no-rdoc ' unless (`rdoc --version`).nil?
|
81
81
|
docs << '--no-ri ' unless (`ri --version`).nil?
|
82
82
|
end
|
@@ -90,7 +90,7 @@ module GemTools
|
|
90
90
|
# or the spec version doesn't match the required version
|
91
91
|
# or require_gem returns false
|
92
92
|
# (return false also happens if the gem has already been loaded)
|
93
|
-
if
|
93
|
+
if OPTIONS.has_key?(:force) || !spec || (! loaded || version != gem['version'])
|
94
94
|
gem_config = gem['config'] ? " -- #{gem['config']}" : ''
|
95
95
|
source = gem['source'] || config['source'] || nil
|
96
96
|
source = "--source #{source}" if source
|