andparcel 0.3.2 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/andparcel.gemspec +2 -2
- data/bin/parcel +5 -2
- data/lib/andparcel/parcel.rb +14 -6
- data/test/test_install.rb +16 -0
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.4.0
|
data/andparcel.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{andparcel}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.4.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Mark Murphy"]
|
12
|
-
s.date = %q{2010-06-
|
12
|
+
s.date = %q{2010-06-11}
|
13
13
|
s.default_executable = %q{parcel}
|
14
14
|
s.description = %q{Supplies the parcel command for packaging, installing, and removing parcels from an Android project}
|
15
15
|
s.email = %q{mmurphy@commonsware.com}
|
data/bin/parcel
CHANGED
@@ -18,7 +18,7 @@ require 'andparcel'
|
|
18
18
|
|
19
19
|
module AndParcel
|
20
20
|
def self.version
|
21
|
-
"0.
|
21
|
+
"0.4.0"
|
22
22
|
end
|
23
23
|
|
24
24
|
def self.commands
|
@@ -112,7 +112,10 @@ module AndParcel
|
|
112
112
|
|
113
113
|
class CatalogCommand < Command
|
114
114
|
def run
|
115
|
-
|
115
|
+
if ARGV.size==0
|
116
|
+
$stderr.puts "add/remove not provided"
|
117
|
+
exit(-1)
|
118
|
+
end
|
116
119
|
|
117
120
|
op=ARGV.shift.downcase
|
118
121
|
|
data/lib/andparcel/parcel.rb
CHANGED
@@ -245,13 +245,21 @@ module AndParcel
|
|
245
245
|
inject(dest)
|
246
246
|
elsif /(http|https):\/\/.+/.match(target)
|
247
247
|
install_from_url(target, dir)
|
248
|
-
else
|
249
|
-
|
250
|
-
|
251
|
-
if
|
252
|
-
|
248
|
+
else
|
249
|
+
candidate=Dir[target].sort.reverse.first
|
250
|
+
|
251
|
+
if candidate && File.exists?(candidate)
|
252
|
+
dest=File.join(dir, File.basename(candidate))
|
253
|
+
FileUtils.cp candidate, dest
|
254
|
+
inject(dest)
|
253
255
|
else
|
254
|
-
|
256
|
+
url=AndParcel.catalogs.find(target)
|
257
|
+
|
258
|
+
if url
|
259
|
+
install_from_url(url, dir)
|
260
|
+
else
|
261
|
+
raise "Could not find parcel #{target}"
|
262
|
+
end
|
255
263
|
end
|
256
264
|
end
|
257
265
|
end
|
data/test/test_install.rb
CHANGED
@@ -98,6 +98,22 @@ Protest.context("when installing a parcel into a project") do
|
|
98
98
|
end
|
99
99
|
end
|
100
100
|
|
101
|
+
test "should install a parcel via a wildcard" do
|
102
|
+
begin
|
103
|
+
clone_receiver
|
104
|
+
FileUtils.mkdir 'tmp'
|
105
|
+
target=AndParcel::Parcel.package('test/ParcelToPackage/parcel.json',
|
106
|
+
:dir=>'tmp')
|
107
|
+
assert target=='tmp/andParcel-test_0.1.0.zip'
|
108
|
+
AndParcel::Parcel.install('tmp/andParcel-test*',
|
109
|
+
:dir=>'tmp2')
|
110
|
+
assert_exists('tmp2/parcels/andParcel-test/andParcel-test_0.1.0.zip')
|
111
|
+
ensure
|
112
|
+
FileUtils.rm_rf 'tmp'
|
113
|
+
FileUtils.rm_rf 'tmp2'
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
101
117
|
test "should replace a parcel with all sorts of stuff" do
|
102
118
|
begin
|
103
119
|
opts={:res=>'res',
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: andparcel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Murphy
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-06-
|
12
|
+
date: 2010-06-11 00:00:00 -04:00
|
13
13
|
default_executable: parcel
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|