confetti 0.9.11 → 0.9.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- confetti (0.9.10)
4
+ confetti (0.9.12)
5
5
  mustache (~> 0.11.2)
6
6
 
7
7
  GEM
@@ -180,7 +180,9 @@ module Confetti
180
180
  def preference name
181
181
  pref = preference_obj(name)
182
182
 
183
- pref && pref.value && pref.value.to_sym
183
+ if pref && pref.value && !pref.value.empty?
184
+ pref.value.to_sym
185
+ end
184
186
  end
185
187
 
186
188
  # mostly an internal method to help with weird cases
@@ -46,9 +46,12 @@ module Confetti
46
46
 
47
47
  def devices
48
48
  nibs = ["NSMainNibFile"]
49
+
49
50
  @config.preference_set.each do |preference|
50
- nibs << "NSMainNibFile~ipad" if preference.name.match /^universal$/
51
+ next unless preference.name
52
+ nibs << "NSMainNibFile~ipad" if preference.name.match /^universal$/
51
53
  end
54
+
52
55
  nibs
53
56
  end
54
57
 
@@ -1,3 +1,3 @@
1
1
  module Confetti
2
- VERSION = "0.9.11"
2
+ VERSION = "0.9.12"
3
3
  end
@@ -208,6 +208,12 @@ describe Confetti::Config do
208
208
  }.should raise_error Confetti::Config::EncodingError
209
209
  end
210
210
 
211
+ it "should handle blank values in preference tags" do
212
+ lambda {
213
+ @config.populate_from_xml("#{ fixture_dir }/config_empty_value.xml")
214
+ }.should_not raise_error
215
+ end
216
+
211
217
  describe "when setting attributes from config.xml" do
212
218
  before do
213
219
  @config.populate_from_xml(fixture_dir + "/config.xml")
@@ -592,6 +598,13 @@ describe Confetti::Config do
592
598
 
593
599
  @config.preference(:privacy).should be_nil
594
600
  end
601
+
602
+ it "should be nil when the preference has an empty string as the value" do
603
+ pref = Confetti::Config::Preference.new "nonsense", ""
604
+ @config.preference_set << pref
605
+
606
+ @config.preference(:nonsense).should be_nil
607
+ end
595
608
  end
596
609
 
597
610
  describe "feature accessor" do
@@ -0,0 +1,53 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <widget xmlns = "http://www.w3.org/ns/widgets"
3
+ xmlns:gap = "http://phonegap.com/ns/1.0"
4
+ id = "com.alunny.confetti"
5
+ version = "1.0.0">
6
+
7
+ <name>Confetti Sample App</name>
8
+
9
+ <description>
10
+ This is a sample config.xml for integration testing with Confetti
11
+ </description>
12
+
13
+ <license href="http://www.opensource.org/licenses/mit-license.php">The MIT License
14
+
15
+ Copyright (c) 2011 Andrew Lunny
16
+
17
+ Permission is hereby granted, free of charge, to any person obtaining a copy
18
+ of this software and associated documentation files (the &quot;Software&quot;), to deal
19
+ in the Software without restriction, including without limitation the rights
20
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
21
+ copies of the Software, and to permit persons to whom the Software is
22
+ furnished to do so, subject to the following conditions:
23
+
24
+ The above copyright notice and this permission notice shall be included in
25
+ all copies or substantial portions of the Software.
26
+
27
+ THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
28
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
29
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
30
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
31
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
32
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
33
+ THE SOFTWARE.</license>
34
+
35
+ <author href="http://alunny.github.com"
36
+ email="alunny@gmail.com">
37
+ Andrew Lunny
38
+ </author>
39
+
40
+ <icon src="icon.png" height="150" width="200" />
41
+
42
+ <gap:splash src="mainsplash.png" height="480" width="360" />
43
+
44
+ <preference name="universal" value="true"/>
45
+ <preference name="phonegap-version" value="1.3.0"/>
46
+ <preference />
47
+
48
+ <feature name="http://api.phonegap.com/1.0/geolocation" required="true"/>
49
+ <feature name="http://api.phonegap.com/1.0/camera" required="true"/>
50
+ <feature name="http://api.phonegap.com/1.0/notification" required="true"/>
51
+
52
+ <access origin="*" />
53
+ </widget>
@@ -0,0 +1,52 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <widget xmlns = "http://www.w3.org/ns/widgets"
3
+ xmlns:gap = "http://phonegap.com/ns/1.0"
4
+ id = "com.alunny.confetti"
5
+ version = "1.0.0">
6
+
7
+ <name>Confetti Sample App</name>
8
+
9
+ <description>
10
+ This is a sample config.xml for integration testing with Confetti
11
+ </description>
12
+
13
+ <license href="http://www.opensource.org/licenses/mit-license.php">The MIT License
14
+
15
+ Copyright (c) 2011 Andrew Lunny
16
+
17
+ Permission is hereby granted, free of charge, to any person obtaining a copy
18
+ of this software and associated documentation files (the &quot;Software&quot;), to deal
19
+ in the Software without restriction, including without limitation the rights
20
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
21
+ copies of the Software, and to permit persons to whom the Software is
22
+ furnished to do so, subject to the following conditions:
23
+
24
+ The above copyright notice and this permission notice shall be included in
25
+ all copies or substantial portions of the Software.
26
+
27
+ THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
28
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
29
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
30
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
31
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
32
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
33
+ THE SOFTWARE.</license>
34
+
35
+ <author href="http://alunny.github.com"
36
+ email="alunny@gmail.com">
37
+ Andrew Lunny
38
+ </author>
39
+
40
+ <icon src="icon.png" height="150" width="200" />
41
+
42
+ <gap:splash src="mainsplash.png" height="480" width="360" />
43
+
44
+ <preference name="universal" value="true"/>
45
+ <preference name="phonegap-version" value=""/>
46
+
47
+ <feature name="http://api.phonegap.com/1.0/geolocation" required="true"/>
48
+ <feature name="http://api.phonegap.com/1.0/camera" required="true"/>
49
+ <feature name="http://api.phonegap.com/1.0/notification" required="true"/>
50
+
51
+ <access origin="*" />
52
+ </widget>
@@ -213,4 +213,12 @@ describe Confetti::Template::IosInfo do
213
213
  end
214
214
  end
215
215
  end
216
+
217
+ describe "devices" do
218
+ it "should not raise error with an empty preference" do
219
+ config = Confetti::Config.new("#{ fixture_dir }/config_empty_pref.xml")
220
+ template = @template_class.new(config)
221
+ lambda { template.devices }.should_not raise_error
222
+ end
223
+ end
216
224
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 9
8
- - 11
9
- version: 0.9.11
8
+ - 12
9
+ version: 0.9.12
10
10
  platform: ruby
11
11
  authors:
12
12
  - Andrew Lunny
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2012-10-31 00:00:00 -07:00
19
+ date: 2012-12-16 00:00:00 -08:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -127,6 +127,8 @@ files:
127
127
  - spec/fixtures/config-plugins.xml
128
128
  - spec/fixtures/config-to_xml.xml
129
129
  - spec/fixtures/config.xml
130
+ - spec/fixtures/config_empty_pref.xml
131
+ - spec/fixtures/config_empty_value.xml
130
132
  - spec/fixtures/config_fullscreen.xml
131
133
  - spec/fixtures/config_legacy.xml
132
134
  - spec/fixtures/config_with_access.xml
@@ -224,6 +226,8 @@ test_files:
224
226
  - spec/fixtures/config-plugins.xml
225
227
  - spec/fixtures/config-to_xml.xml
226
228
  - spec/fixtures/config.xml
229
+ - spec/fixtures/config_empty_pref.xml
230
+ - spec/fixtures/config_empty_value.xml
227
231
  - spec/fixtures/config_fullscreen.xml
228
232
  - spec/fixtures/config_legacy.xml
229
233
  - spec/fixtures/config_with_access.xml