vanity-routes 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +29 -0
- data/Rakefile +1 -0
- data/lib/generators/vanity-routes/config/vanity-routes.rb +0 -0
- data/lib/generators/vanity-routes/install/install_generator.rb +8 -0
- data/lib/vanity-routes.rb +18 -0
- data/lib/vanity-routes/errors.rb +7 -0
- data/lib/vanity-routes/overrides.rb +10 -0
- data/lib/vanity-routes/routes.rb +5 -0
- data/lib/vanity-routes/setup.rb +13 -0
- data/lib/vanity-routes/version.rb +5 -0
- data/vanity-routes.gemspec +19 -0
- metadata +59 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Nick Soto
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
Vanity Routes
|
2
|
+
=============
|
3
|
+
|
4
|
+
Create a VanityRoutes Table and Model:
|
5
|
+
--------------------------------------
|
6
|
+
|
7
|
+
class CreateVanityRoutes < ActiveRecord::Migration
|
8
|
+
def change
|
9
|
+
create_table :vanity_routes do |t|
|
10
|
+
t.string :path
|
11
|
+
t.integer :show_id
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
|
17
|
+
class VanityRoute < ActiveRecord::Base
|
18
|
+
end
|
19
|
+
|
20
|
+
|
21
|
+
Create a VanityRoutes initializer:
|
22
|
+
----------------------------------
|
23
|
+
|
24
|
+
Vanity::Setup.config do |c|
|
25
|
+
c.controller = "messages" #controller that handles the route
|
26
|
+
end
|
27
|
+
|
28
|
+
|
29
|
+
[TODO] create table and model from generator
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
File without changes
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require "vanity-routes/version"
|
2
|
+
require "vanity-routes/setup"
|
3
|
+
require "vanity-routes/errors"
|
4
|
+
require "vanity-routes/overrides"
|
5
|
+
|
6
|
+
module Vanity
|
7
|
+
module Routes
|
8
|
+
class Engine < Rails::Engine
|
9
|
+
initializer 'my_engine.vanity_routes', after: :add_routing_paths do |app|
|
10
|
+
raise Vanity::NoConfigurationError if Vanity::Setup.opts.controller.nil?
|
11
|
+
raise Vanity::NoVanityRoutesTableError if !ActiveRecord::Base.connection.table_exists? "vanity_routes"
|
12
|
+
|
13
|
+
ActionDispatch::Routing::RouteSet.send(:include, Vanity::Overrides)
|
14
|
+
app.routes_reloader.paths << File.expand_path('../vanity-routes/routes.rb',__FILE__)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'vanity-routes/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = "vanity-routes"
|
8
|
+
gem.version = Vanity::Routes::VERSION
|
9
|
+
gem.authors = ["Nick Soto"]
|
10
|
+
gem.email = ["nickesoto@gmail.com"]
|
11
|
+
gem.description = "vanity routes"
|
12
|
+
gem.summary = "it makes vanity routes"
|
13
|
+
gem.homepage = ""
|
14
|
+
|
15
|
+
gem.files = `git ls-files`.split($/)
|
16
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
|
+
gem.require_paths = ["lib"]
|
19
|
+
end
|
metadata
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: vanity-routes
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Nick Soto
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-12-19 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
14
|
+
description: vanity routes
|
15
|
+
email:
|
16
|
+
- nickesoto@gmail.com
|
17
|
+
executables: []
|
18
|
+
extensions: []
|
19
|
+
extra_rdoc_files: []
|
20
|
+
files:
|
21
|
+
- .gitignore
|
22
|
+
- Gemfile
|
23
|
+
- LICENSE.txt
|
24
|
+
- README.md
|
25
|
+
- Rakefile
|
26
|
+
- lib/generators/vanity-routes/config/vanity-routes.rb
|
27
|
+
- lib/generators/vanity-routes/install/install_generator.rb
|
28
|
+
- lib/vanity-routes.rb
|
29
|
+
- lib/vanity-routes/errors.rb
|
30
|
+
- lib/vanity-routes/overrides.rb
|
31
|
+
- lib/vanity-routes/routes.rb
|
32
|
+
- lib/vanity-routes/setup.rb
|
33
|
+
- lib/vanity-routes/version.rb
|
34
|
+
- vanity-routes.gemspec
|
35
|
+
homepage: ''
|
36
|
+
licenses: []
|
37
|
+
post_install_message:
|
38
|
+
rdoc_options: []
|
39
|
+
require_paths:
|
40
|
+
- lib
|
41
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ! '>='
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
47
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
48
|
+
none: false
|
49
|
+
requirements:
|
50
|
+
- - ! '>='
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '0'
|
53
|
+
requirements: []
|
54
|
+
rubyforge_project:
|
55
|
+
rubygems_version: 1.8.24
|
56
|
+
signing_key:
|
57
|
+
specification_version: 3
|
58
|
+
summary: it makes vanity routes
|
59
|
+
test_files: []
|