confetti 0.5.5 → 0.6.0

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.5.5)
4
+ confetti (0.6.0)
5
5
  mustache (~> 0.11.2)
6
6
 
7
7
  GEM
@@ -14,7 +14,7 @@ module Confetti
14
14
  :height, :width, :plist_icon_set
15
15
  attr_reader :author, :viewmodes, :name, :license, :content,
16
16
  :icon_set, :feature_set, :preference_set, :xml_doc,
17
- :splash_set, :plist_icon_set, :plugin_set
17
+ :splash_set, :plist_icon_set, :access_set
18
18
 
19
19
  generate_and_write :android_manifest, :android_strings, :webos_appinfo,
20
20
  :ios_info, :symbian_wrt_info, :blackberry_widgets_config,
@@ -40,7 +40,7 @@ module Confetti
40
40
  Image = Class.new Struct.new(:src, :height, :width, :extras)
41
41
  Feature = Class.new Struct.new(:name, :required)
42
42
  Preference = Class.new Struct.new(:name, :value, :readonly)
43
- Plugin = Class.new Struct.new(:name, :value, :platforms)
43
+ Access = Class.new Struct.new(:origin, :subdomains)
44
44
 
45
45
  def initialize(*args)
46
46
  @author = Author.new
@@ -52,7 +52,7 @@ module Confetti
52
52
  @feature_set = TypedSet.new Feature
53
53
  @splash_set = TypedSet.new Image
54
54
  @preference_set = TypedSet.new Preference
55
- @plugin_set = TypedSet.new Plugin
55
+ @access_set = TypedSet.new Access
56
56
  @viewmodes = []
57
57
 
58
58
  if args.length > 0 && is_file?(args.first)
@@ -106,6 +106,10 @@ module Confetti
106
106
  @preference_set << Preference.new(attr["name"], attr["value"], attr["readonly"])
107
107
  when "license"
108
108
  @license = License.new(ele.text.nil? ? "" : ele.text.strip, attr["href"])
109
+ when "access"
110
+ sub = attr["subdomains"]
111
+ sub = sub.nil? ? true : (sub != 'false')
112
+ @access_set << Access.new(attr["origin"], sub)
109
113
  end
110
114
 
111
115
  # PhoneGap extensions (gap:)
@@ -115,10 +119,6 @@ module Confetti
115
119
  next if attr["src"].nil? or attr["src"].empty?
116
120
  extras = grab_extras attr
117
121
  @splash_set << Image.new(attr["src"], attr["height"], attr["width"], extras)
118
- when "plugin"
119
- plugin = Plugin.new(attr["name"], attr["value"])
120
- plugin.platforms = plugin_platforms(ele)
121
- @plugin_set << plugin
122
122
  end
123
123
  end
124
124
  end
@@ -165,14 +165,6 @@ module Confetti
165
165
  pref && pref.value && pref.value.to_sym
166
166
  end
167
167
 
168
- # retrieve the specified platforms as a list of lowercase symbols
169
- # extracted from children of ele
170
- def plugin_platforms ele
171
- ele.children.
172
- select { |e| e.respond_to?(:name) and e.name == "platform" }.
173
- map { |e| e.attributes["name"].downcase.to_sym }
174
- end
175
-
176
168
  # mostly an internal method to help with weird cases
177
169
  # in particular #phonegap_version
178
170
  def preference_obj name
@@ -1,3 +1,3 @@
1
1
  module Confetti
2
- VERSION = "0.5.5"
2
+ VERSION = "0.6.0"
3
3
  end
@@ -346,28 +346,32 @@ describe Confetti::Config do
346
346
  end
347
347
  end
348
348
 
349
- describe "plugins" do
350
- it "should append plugins to the plugin set" do
351
- @config.plugin_set.size.should be 1
349
+ describe "access" do
350
+ it "should append tags to the access set" do
351
+ @config.access_set.size.should be 2
352
352
  end
353
353
 
354
- describe "created object" do
354
+ describe "created access object" do
355
355
  before do
356
- @plugin = @config.plugin_set.first
356
+ @bar = @config.access_set.detect do |a|
357
+ a.origin == "http://bar.phonegap.com"
358
+ end
359
+ @foo = @config.access_set.detect do |a|
360
+ a.origin == "http://foo.phonegap.com"
361
+ end
357
362
  end
358
363
 
359
- it "should have the right name" do
360
- @plugin.name.should == "ChildBrowser"
364
+ it "should read the origins correctly" do
365
+ @foo.should be_true
366
+ @bar.should be_true # truthy (should exist)
361
367
  end
362
368
 
363
- it "should have the right value" do
364
- package = "com.phonegap.plugins.childBrowser.ChildBrowser"
365
- @plugin.value.should == package
369
+ it "should default subdomains to true" do
370
+ @foo.subdomains.should be_true
366
371
  end
367
372
 
368
- it "should have the right platforms" do
369
- @plugin.platforms.size.should be 1
370
- @plugin.platforms.first.should be :android
373
+ it "should allow subdomains to be set to false" do
374
+ @bar.subdomains.should be_false
371
375
  end
372
376
  end
373
377
  end
@@ -48,8 +48,6 @@ THE SOFTWARE.</license>
48
48
  <feature name="http://api.phonegap.com/1.0/camera" required="true"/>
49
49
  <feature name="http://api.phonegap.com/1.0/notification" required="true"/>
50
50
 
51
- <gap:plugin name="ChildBrowser"
52
- value="com.phonegap.plugins.childBrowser.ChildBrowser">
53
- <platform name="android" />
54
- </gap:plugin>
51
+ <access origin="http://foo.phonegap.com" />
52
+ <access origin="http://bar.phonegap.com" subdomains="false" />
55
53
  </widget>
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 5
8
- - 5
9
- version: 0.5.5
7
+ - 6
8
+ - 0
9
+ version: 0.6.0
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-03-16 00:00:00 -07:00
19
+ date: 2012-03-19 00:00:00 -07:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency