rack-root-apex 0.0.2 → 0.0.3
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.
- checksums.yaml +8 -8
- data/lib/rack/root-apex.rb +3 -3
- data/lib/rack/root-apex/version.rb +1 -1
- data/rack-root-apex.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
ZTA0ZmQ3NGU0Njc4ODY5YzIwNTg4NDY4NWMwODdlZTZiYzRlZGY0Yg==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
YTAzYjUzMjc3MDgzYjZkNTNlZThmZGM0YjZiNDlkNjViZjdkZmQ0NA==
|
|
7
7
|
!binary "U0hBNTEy":
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
NTg4ZTA5YjMyYTU2YjRkNTYzNmFiMzQ3ZGJhODZjNGZhMDIwYTlhYTc1YWFh
|
|
10
|
+
MjhkNjRkZTUyZTRmMzU3ZTY1MGRmNTUyMWMwMDg2NTAxYTk5ODc4MjU3MjA3
|
|
11
|
+
N2EwMTNjYmU2ZGIzZWJkZjcwMmJhNTJkNWUzMDZkMDNlYWIyYTk=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
Nzg0YWEwNjQwMzQ4MWI1ZGMxMTk4MDk4OGYwZGQwYzkyYjVkMTBhMjg4MmEw
|
|
14
|
+
YjM3NDVlZTRiYjBiMjEwOGVmMGNhNmIyNmMwNTA4NGU1MjMyZWM0YTRiODk0
|
|
15
|
+
OTczZTRhNjU2NTVjNjM5YmFlOTkzZmEyMGY4ZGMxOGM1MjdhYzk=
|
data/lib/rack/root-apex.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
require
|
|
1
|
+
require 'rack/root-apex/version'
|
|
2
2
|
|
|
3
3
|
module Rack
|
|
4
4
|
class RootApex
|
|
@@ -9,8 +9,8 @@ module Rack
|
|
|
9
9
|
def call(env)
|
|
10
10
|
request = Rack::Request.new(env)
|
|
11
11
|
|
|
12
|
-
if request.host.
|
|
13
|
-
[301, {
|
|
12
|
+
if request.host.start_with?('www.')
|
|
13
|
+
[301, { 'Location' => request.url.sub('//www.', '//') }, ["Moved Permanently\n"]]
|
|
14
14
|
else
|
|
15
15
|
@app.call(env)
|
|
16
16
|
end
|
data/rack-root-apex.gemspec
CHANGED
|
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
|
10
10
|
spec.email = ['evan.lecklider@gmail.com']
|
|
11
11
|
spec.description = 'Redirects all requests with a "www" in the hostname to the non-www host version.'
|
|
12
12
|
spec.summary = spec.description
|
|
13
|
-
spec.homepage = ''
|
|
13
|
+
spec.homepage = 'https://github.com/l3ck/rack-root-apex'
|
|
14
14
|
spec.license = 'MIT'
|
|
15
15
|
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rack-root-apex
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Evan Lecklider
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2013-06-
|
|
11
|
+
date: 2013-06-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rack
|
|
@@ -68,7 +68,7 @@ files:
|
|
|
68
68
|
- lib/rack/root-apex.rb
|
|
69
69
|
- lib/rack/root-apex/version.rb
|
|
70
70
|
- rack-root-apex.gemspec
|
|
71
|
-
homepage:
|
|
71
|
+
homepage: https://github.com/l3ck/rack-root-apex
|
|
72
72
|
licenses:
|
|
73
73
|
- MIT
|
|
74
74
|
metadata: {}
|