ensure_subdomain 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.
- data/README.md +41 -2
- data/ensure_subdomain-0.0.2.gem +0 -0
- data/ensure_subdomain.gemspec +2 -2
- data/lib/ensure_subdomain/version.rb +7 -1
- metadata +3 -4
data/README.md
CHANGED
@@ -1,4 +1,43 @@
|
|
1
|
-
ensure_subdomain
|
2
|
-
=============
|
1
|
+
# ensure_subdomain
|
3
2
|
|
4
3
|
an ActionDispatch extension to handle subdomain redirects
|
4
|
+
|
5
|
+
#### Warning: There aren't any tests yet, so this is probably not suitable for production. If you'd like to contribute, I wouldn't be opposed.
|
6
|
+
|
7
|
+
Let's say you believe that [using the www subdomain is dumb](http://no-www.org).
|
8
|
+
Ensuring your rails app doesn't use this subdomain is pretty easy, but now it's easier.
|
9
|
+
|
10
|
+
# Gemfile
|
11
|
+
gem 'ensure_subdomain'
|
12
|
+
|
13
|
+
# Preferred terminal
|
14
|
+
`bundle install`
|
15
|
+
|
16
|
+
# config/routes.rb
|
17
|
+
My::Application.routes.draw do
|
18
|
+
ensure_no_www
|
19
|
+
|
20
|
+
# The rest of my cool routes
|
21
|
+
end
|
22
|
+
|
23
|
+
GETting http://www.my-app.dev/ will redirect to http://my-app.dev
|
24
|
+
Simple as that.
|
25
|
+
|
26
|
+
Conversely, if you are wrong and think you should use www, there's a method for that.
|
27
|
+
|
28
|
+
# config/routes.rb
|
29
|
+
My::Application.routes.draw do
|
30
|
+
ensure_www
|
31
|
+
end
|
32
|
+
|
33
|
+
GETting http://www.my-app.dev/ will redirect to http://my-app.dev
|
34
|
+
|
35
|
+
|
36
|
+
Finally, if you've got some other domain, there's a method for that too.
|
37
|
+
|
38
|
+
# config/routes.rb
|
39
|
+
My::Application.routes.draw do
|
40
|
+
ensure_subdomain 'blog'
|
41
|
+
end
|
42
|
+
|
43
|
+
GETting http://my-app.dev/ will redirect to http://blog.my-app.dev
|
Binary file
|
data/ensure_subdomain.gemspec
CHANGED
@@ -4,9 +4,9 @@ require File.expand_path('../lib/ensure_subdomain/version', __FILE__)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = 'ensure_subdomain'
|
7
|
-
s.version = EnsureSubdomain::VERSION
|
7
|
+
s.version = EnsureSubdomain::VERSION::STRING
|
8
8
|
s.platform = Gem::Platform::RUBY
|
9
|
-
s.authors =
|
9
|
+
s.authors = "Jacob Evan Shreve"
|
10
10
|
s.email = %w(jacob@shreve.ly)
|
11
11
|
s.summary = 'Ensure requests are going to the right subdomain.'
|
12
12
|
s.description = 'Ensure requests are going to the right subdomain to avoid competing with yourself for dem SERPs. Adds a couple methods to ActionDispatch for routes.'
|
metadata
CHANGED
@@ -1,13 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ensure_subdomain
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
|
-
- Jacob
|
9
|
-
- Evan
|
10
|
-
- Shreve
|
8
|
+
- Jacob Evan Shreve
|
11
9
|
autorequire:
|
12
10
|
bindir: bin
|
13
11
|
cert_chain: []
|
@@ -39,6 +37,7 @@ extra_rdoc_files: []
|
|
39
37
|
files:
|
40
38
|
- LICENSE
|
41
39
|
- README.md
|
40
|
+
- ensure_subdomain-0.0.2.gem
|
42
41
|
- ensure_subdomain.gemspec
|
43
42
|
- lib/ensure_subdomain.rb
|
44
43
|
- lib/ensure_subdomain/version.rb
|