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
@@ -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
|
data/lib/confetti/version.rb
CHANGED
@@ -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
|
-
-
|
9
|
-
version: 0.6.
|
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
|
+
date: 2012-03-20 00:00:00 -07:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|