confetti 0.9.14 → 0.9.15
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/confetti/config.rb +9 -1
- data/lib/confetti/version.rb +1 -1
- data/spec/config/config_feature_spec.rb +14 -0
- data/spec/fixtures/config-features.xml +16 -0
- metadata +6 -4
data/lib/confetti/config.rb
CHANGED
@@ -115,7 +115,14 @@ module Confetti
|
|
115
115
|
@plist_icon_set << attr["src"]
|
116
116
|
|
117
117
|
when "feature"
|
118
|
-
|
118
|
+
feature = Feature.new(attr["name"], attr["required"])
|
119
|
+
|
120
|
+
ele.each_element( 'param' ) do |param|
|
121
|
+
p_attr = param.attributes
|
122
|
+
feature.param_set << Param.new(p_attr["name"], p_attr["value"])
|
123
|
+
end
|
124
|
+
|
125
|
+
@feature_set << feature
|
119
126
|
|
120
127
|
when "preference"
|
121
128
|
@preference_set << Preference.new(attr["name"], attr["value"],
|
@@ -376,6 +383,7 @@ module Confetti
|
|
376
383
|
"name" => feature.name,
|
377
384
|
"required" => feature.required,
|
378
385
|
})
|
386
|
+
|
379
387
|
features << feat
|
380
388
|
end
|
381
389
|
|
data/lib/confetti/version.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Confetti::Config::Feature do
|
4
|
+
include HelpfulPaths
|
5
|
+
|
4
6
|
before do
|
5
7
|
@feature = Confetti::Config::Feature.new("Geolocation", nil)
|
6
8
|
end
|
@@ -39,4 +41,16 @@ describe Confetti::Config::Feature do
|
|
39
41
|
"required" => true
|
40
42
|
}
|
41
43
|
end
|
44
|
+
|
45
|
+
context "with a config.xml" do
|
46
|
+
|
47
|
+
before :each do
|
48
|
+
@config = Confetti::Config.new "#{ fixture_dir }/config-features.xml"
|
49
|
+
end
|
50
|
+
|
51
|
+
it "should read the feature's param set" do
|
52
|
+
feature = @config.feature_set.detect{ | f | f.name == "notification" }
|
53
|
+
feature.param_set.length.should == 2
|
54
|
+
end
|
55
|
+
end
|
42
56
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
|
3
|
+
<widget xmlns = "http://www.w3.org/ns/widgets"
|
4
|
+
xmlns:gap = "http://phonegap.com/ns/1.0"
|
5
|
+
id = "com.example.www"
|
6
|
+
version = "0.0.4">
|
7
|
+
|
8
|
+
<feature name="http://api.phonegap.com/1.0/geolocation"/>
|
9
|
+
<feature name="http://api.phonegap.com/1.0/network"/>
|
10
|
+
<feature name="http://api.phonegap.com/1.0/notification"/>
|
11
|
+
|
12
|
+
<feature name="notification" required="true">
|
13
|
+
<param name="badges" value="yes"/>
|
14
|
+
<param name="alerts" value="no"/>
|
15
|
+
</feature>
|
16
|
+
</widget>
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: confetti
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 37
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 9
|
9
|
-
-
|
10
|
-
version: 0.9.
|
9
|
+
- 15
|
10
|
+
version: 0.9.15
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Andrew Lunny
|
@@ -17,7 +17,7 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2013-
|
20
|
+
date: 2013-06-18 00:00:00 Z
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
23
23
|
name: mustache
|
@@ -126,6 +126,7 @@ files:
|
|
126
126
|
- spec/fixtures/blackberry/blackberry_widget_config_no_version_or_id.xml
|
127
127
|
- spec/fixtures/blackberry/blackberry_widget_config_spec.xml
|
128
128
|
- spec/fixtures/blackberry/blackberry_widget_config_spec_with_expected_orientation.xml
|
129
|
+
- spec/fixtures/config-features.xml
|
129
130
|
- spec/fixtures/config-icons-custom-attribs-extended.xml
|
130
131
|
- spec/fixtures/config-icons-custom-attribs.xml
|
131
132
|
- spec/fixtures/config-icons.xml
|
@@ -231,6 +232,7 @@ test_files:
|
|
231
232
|
- spec/fixtures/blackberry/blackberry_widget_config_no_version_or_id.xml
|
232
233
|
- spec/fixtures/blackberry/blackberry_widget_config_spec.xml
|
233
234
|
- spec/fixtures/blackberry/blackberry_widget_config_spec_with_expected_orientation.xml
|
235
|
+
- spec/fixtures/config-features.xml
|
234
236
|
- spec/fixtures/config-icons-custom-attribs-extended.xml
|
235
237
|
- spec/fixtures/config-icons-custom-attribs.xml
|
236
238
|
- spec/fixtures/config-icons.xml
|