grabass 0.0.0 → 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/grabass +2 -2
- data/lib/grabass.rb +3 -3
- metadata +3 -3
data/bin/grabass
CHANGED
@@ -24,7 +24,7 @@ options = {}
|
|
24
24
|
optparse = OptionParser.new do |args|
|
25
25
|
options[:force] = false
|
26
26
|
args.on '-f', '--force', 'Replace existing files' do
|
27
|
-
|
27
|
+
options[:force] = true
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
@@ -43,7 +43,7 @@ elsif ARGV.length == 1
|
|
43
43
|
puts "Asset manifest \"#{ARGV[0]}\" not found."
|
44
44
|
end
|
45
45
|
elsif ARGV.length == 2
|
46
|
-
asset = Grabass::Asset.new
|
46
|
+
asset = Grabass::Asset.new ARGV[0], ARGV[1]
|
47
47
|
asset.fetch(options)
|
48
48
|
finished = Time.now
|
49
49
|
end
|
data/lib/grabass.rb
CHANGED
@@ -57,7 +57,7 @@ module Grabass
|
|
57
57
|
else
|
58
58
|
if download
|
59
59
|
unzip if mime_type.include? 'zip'
|
60
|
-
move_to_destination
|
60
|
+
move_to_destination options[:force]
|
61
61
|
else
|
62
62
|
puts Grabass::indent 'Download failed!', '!'
|
63
63
|
end
|
@@ -101,8 +101,8 @@ module Grabass
|
|
101
101
|
end
|
102
102
|
end
|
103
103
|
|
104
|
-
def move_to_destination
|
105
|
-
if File.exists? @destination and
|
104
|
+
def move_to_destination(force)
|
105
|
+
if File.exists? @destination and force
|
106
106
|
puts Grabass::indent "Replacing existing #{@destination}"
|
107
107
|
|
108
108
|
if Dir.exists? @destination
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grabass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-02-
|
12
|
+
date: 2012-02-25 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Grab static assets and put them somewhere
|
15
15
|
email: brian.carstensen@gmail.com
|
@@ -40,7 +40,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
40
40
|
version: '0'
|
41
41
|
requirements: []
|
42
42
|
rubyforge_project:
|
43
|
-
rubygems_version: 1.8.
|
43
|
+
rubygems_version: 1.8.10
|
44
44
|
signing_key:
|
45
45
|
specification_version: 3
|
46
46
|
summary: Grabass
|