andparcel 0.3.0 → 0.3.2

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/TODO CHANGED
@@ -1,5 +0,0 @@
1
- generate gem, confirm gem works in a VBox image
2
- push gem; commit, tag as v0.3.0
3
- update docs & republish
4
- blog; comment/close issues
5
- add issue: integrate -v/--version with git tags
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
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.0"
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-05-31}
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}
@@ -5,8 +5,9 @@ module AndParcel
5
5
  def self.[](base)
6
6
  files=[]
7
7
 
8
- # files += Dir[File.join(base, '*')].collect {|x| FileRef.new(x, base)}
9
- files += Dir[File.join(base, '**', '*')].collect {|x| FileRef.new(x, base)}
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
@@ -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.0
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-05-31 00:00:00 -04:00
12
+ date: 2010-06-01 00:00:00 -04:00
13
13
  default_executable: parcel
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency