andparcel 0.3.0 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/TODO +0 -5
- data/VERSION +1 -1
- data/andparcel.gemspec +2 -2
- data/lib/andparcel/fileref.rb +3 -2
- data/lib/andparcel/parcel.rb +2 -2
- data/test/test_package.rb +30 -0
- metadata +2 -2
data/TODO
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.2
|
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.3.
|
8
|
+
s.version = "0.3.2"
|
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-
|
12
|
+
s.date = %q{2010-06-01}
|
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/lib/andparcel/fileref.rb
CHANGED
@@ -5,8 +5,9 @@ module AndParcel
|
|
5
5
|
def self.[](base)
|
6
6
|
files=[]
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
if File.exists?(base)
|
9
|
+
files += Dir[File.join(base, '**', '*')].collect {|x| FileRef.new(x, base)}
|
10
|
+
end
|
10
11
|
|
11
12
|
files
|
12
13
|
end
|
data/lib/andparcel/parcel.rb
CHANGED
@@ -178,7 +178,7 @@ module AndParcel
|
|
178
178
|
files=AndParcel.glob(opts[:assets], opts[:project])
|
179
179
|
|
180
180
|
files.each do |fr|
|
181
|
-
zf.add(File.join('assets', fr.relative), fr.local)
|
181
|
+
zf.add(File.join('assets', fr.relative), fr.local) if File.exists?(fr.local)
|
182
182
|
end
|
183
183
|
end
|
184
184
|
|
@@ -528,7 +528,7 @@ module AndParcel
|
|
528
528
|
end
|
529
529
|
|
530
530
|
AndParcel.glob(opts[:assets], opts[:project]).each do |fr|
|
531
|
-
if fr.local.split('').last!='~'
|
531
|
+
if fr.local.split('').last!='~' && File.exists?(fr.local)
|
532
532
|
do_simple_resource(fr)
|
533
533
|
end
|
534
534
|
end
|
data/test/test_package.rb
CHANGED
@@ -136,6 +136,36 @@ Protest.context("when packaging a parcel") do
|
|
136
136
|
end
|
137
137
|
end
|
138
138
|
|
139
|
+
test "should support a parcel with no assets in the project" do
|
140
|
+
begin
|
141
|
+
FileUtils.mkdir 'tmp'
|
142
|
+
FileUtils.mkdir 'tmp2'
|
143
|
+
FileUtils.cp_r 'test/ParcelToPackage', 'tmp2'
|
144
|
+
FileUtils.rm_rf 'tmp2/ParcelToPackage/assets'
|
145
|
+
target=AndParcel::Parcel.package('tmp2/ParcelToPackage/parcel.json',
|
146
|
+
:dir=>'tmp')
|
147
|
+
assert target=='tmp/andParcel-test_0.1.0.zip'
|
148
|
+
assert File.exists?(target)
|
149
|
+
config=load_config(target)
|
150
|
+
config_assert(config)
|
151
|
+
|
152
|
+
matches=0
|
153
|
+
|
154
|
+
Zip::ZipFile.open(target) do |zf|
|
155
|
+
zf.entries.each do |entry|
|
156
|
+
if ('assets/andParcel_test_foo.txt'==entry.name ||
|
157
|
+
'assets/bar/andParcel_test_goo.txt'==entry.name)
|
158
|
+
matches+=1
|
159
|
+
end
|
160
|
+
end
|
161
|
+
end
|
162
|
+
assert matches==0
|
163
|
+
ensure
|
164
|
+
FileUtils.rm_rf 'tmp'
|
165
|
+
FileUtils.rm_rf 'tmp2'
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
139
169
|
test "should support a parcel with all sorts of stuff" do
|
140
170
|
begin
|
141
171
|
FileUtils.mkdir 'tmp'
|
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.3.
|
4
|
+
version: 0.3.2
|
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-
|
12
|
+
date: 2010-06-01 00:00:00 -04:00
|
13
13
|
default_executable: parcel
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|