confetti 0.6.3 → 0.6.4

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/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- confetti (0.6.3)
4
+ confetti (0.6.4)
5
5
  mustache (~> 0.11.2)
6
6
 
7
7
  GEM
@@ -100,10 +100,15 @@ module Confetti
100
100
  end
101
101
 
102
102
  def access
103
- @config.access_set.map do |a|
103
+ @config.access_set.select { |a| valid_origin(a.origin) }.map do |a|
104
104
  { :subdomains => !!a.subdomains, :uri => a.origin }
105
105
  end
106
106
  end
107
+
108
+ def valid_origin o
109
+ # not nil and (wildcard or with scheme)
110
+ !o.nil? && (o == '*' || o.match(/^\w+:\/\//))
111
+ end
107
112
  end
108
113
  end
109
114
  end
@@ -1,3 +1,3 @@
1
1
  module Confetti
2
- VERSION = "0.6.3"
2
+ VERSION = "0.6.4"
3
3
  end
@@ -221,4 +221,22 @@ describe Confetti::Template::BlackberryWidgetsConfig do
221
221
  end
222
222
 
223
223
  end
224
+
225
+ describe "#access" do
226
+ before do
227
+ @config = Confetti::Config.new
228
+ @template = @template_class.new(@config)
229
+ end
230
+
231
+ it "should be empty if there's only a nil tag" do
232
+ @config.access_set << Confetti::Config::Access.new(nil)
233
+ @template.access.should be_empty
234
+ end
235
+
236
+ it "should not allow entries with no schemes" do
237
+ @config.access_set << Confetti::Config::Access.new("http://debug.phonegap.com")
238
+ @config.access_set << Confetti::Config::Access.new("docs.phonegap.com")
239
+ @template.access.length.should be 1
240
+ end
241
+ end
224
242
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 6
8
- - 3
9
- version: 0.6.3
8
+ - 4
9
+ version: 0.6.4
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-19 00:00:00 -07:00
19
+ date: 2012-03-20 00:00:00 -07:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency