kiosk 0.3.5 → 0.3.6
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/MIT-LICENSE +1 -1
- data/lib/kiosk/cdn.rb +13 -2
- data/lib/kiosk/version.rb +1 -1
- metadata +3 -3
data/MIT-LICENSE
CHANGED
data/lib/kiosk/cdn.rb
CHANGED
|
@@ -4,10 +4,15 @@ module Kiosk
|
|
|
4
4
|
|
|
5
5
|
def initialize(config = {})
|
|
6
6
|
@host = config['host']
|
|
7
|
+
|
|
8
|
+
unless @host.nil? || @host.empty?
|
|
9
|
+
@uri = URI.parse(@host)
|
|
10
|
+
@host_only = @uri.scheme.nil? && @uri.host.nil?
|
|
11
|
+
end
|
|
7
12
|
end
|
|
8
13
|
|
|
9
14
|
def configured?
|
|
10
|
-
|
|
15
|
+
!@uri.nil?
|
|
11
16
|
end
|
|
12
17
|
|
|
13
18
|
def rewrite_node(node)
|
|
@@ -20,7 +25,13 @@ module Kiosk
|
|
|
20
25
|
|
|
21
26
|
def rewrite_uri(uri)
|
|
22
27
|
if configured?
|
|
23
|
-
|
|
28
|
+
if @host_only
|
|
29
|
+
uri.host = @host
|
|
30
|
+
else
|
|
31
|
+
uri.scheme = @uri.scheme
|
|
32
|
+
uri.host = @uri.host
|
|
33
|
+
uri.path = "#{@uri.path.sub(/\/$/, '')}#{uri.path}" unless @uri.path.empty? || @uri.path == '/'
|
|
34
|
+
end
|
|
24
35
|
end
|
|
25
36
|
uri
|
|
26
37
|
end
|
data/lib/kiosk/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kiosk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.6
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date:
|
|
12
|
+
date: 2013-10-10 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: nokogiri
|
|
@@ -170,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
170
170
|
version: '0'
|
|
171
171
|
requirements: []
|
|
172
172
|
rubyforge_project:
|
|
173
|
-
rubygems_version: 1.8.
|
|
173
|
+
rubygems_version: 1.8.25
|
|
174
174
|
signing_key:
|
|
175
175
|
specification_version: 3
|
|
176
176
|
summary: Simple WordPress integration for Ruby applications.
|