redirector 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. data/HISTORY +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +71 -0
  4. data/Rakefile +19 -0
  5. data/app/models/redirect_rule.rb +61 -0
  6. data/app/models/request_environment_rule.rb +23 -0
  7. data/db/migrate/20120815212612_create_redirect_rules.rb +14 -0
  8. data/db/migrate/20120823163756_create_request_environment_rules.rb +13 -0
  9. data/lib/redirector/engine.rb +7 -0
  10. data/lib/redirector/middleware.rb +66 -0
  11. data/lib/redirector/regex_attribute.rb +38 -0
  12. data/lib/redirector/version.rb +3 -0
  13. data/lib/redirector.rb +6 -0
  14. data/redirector.gemspec +29 -0
  15. data/spec/dummy/README.rdoc +261 -0
  16. data/spec/dummy/Rakefile +7 -0
  17. data/spec/dummy/app/assets/javascripts/application.js +15 -0
  18. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  19. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  20. data/spec/dummy/app/controllers/news_controller.rb +9 -0
  21. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  22. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  23. data/spec/dummy/config/application.rb +59 -0
  24. data/spec/dummy/config/boot.rb +10 -0
  25. data/spec/dummy/config/database.yml +17 -0
  26. data/spec/dummy/config/environment.rb +5 -0
  27. data/spec/dummy/config/environments/development.rb +37 -0
  28. data/spec/dummy/config/environments/production.rb +67 -0
  29. data/spec/dummy/config/environments/test.rb +37 -0
  30. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  31. data/spec/dummy/config/initializers/inflections.rb +15 -0
  32. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  33. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  34. data/spec/dummy/config/initializers/session_store.rb +8 -0
  35. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  36. data/spec/dummy/config/locales/en.yml +5 -0
  37. data/spec/dummy/config/routes.rb +3 -0
  38. data/spec/dummy/config.ru +4 -0
  39. data/spec/dummy/db/schema.rb +41 -0
  40. data/spec/dummy/log/development.log +128 -0
  41. data/spec/dummy/log/test.log +8699 -0
  42. data/spec/dummy/public/404.html +26 -0
  43. data/spec/dummy/public/422.html +26 -0
  44. data/spec/dummy/public/500.html +25 -0
  45. data/spec/dummy/public/favicon.ico +0 -0
  46. data/spec/dummy/script/rails +6 -0
  47. data/spec/factories/redirect_rules.rb +16 -0
  48. data/spec/factories/request_environment_rules.rb +15 -0
  49. data/spec/models/redirect_rule_spec.rb +153 -0
  50. data/spec/models/request_environment_rule_spec.rb +64 -0
  51. data/spec/requests/middleware_spec.rb +18 -0
  52. data/spec/spec_helper.rb +27 -0
  53. metadata +255 -0
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/404.html -->
21
+ <div class="dialog">
22
+ <h1>The page you were looking for doesn't exist.</h1>
23
+ <p>You may have mistyped the address or the page may have moved.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/422.html -->
21
+ <div class="dialog">
22
+ <h1>The change you wanted was rejected.</h1>
23
+ <p>Maybe you tried to change something you didn't have access to.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,25 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/500.html -->
21
+ <div class="dialog">
22
+ <h1>We're sorry, but something went wrong.</h1>
23
+ </div>
24
+ </body>
25
+ </html>
File without changes
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
@@ -0,0 +1,16 @@
1
+ # Read about factories at https://github.com/thoughtbot/factory_girl
2
+
3
+ FactoryGirl.define do
4
+ factory :redirect_rule do
5
+ active true
6
+ source_is_regex false
7
+ source '/catchy_thingy'
8
+ destination 'http://www.example.com/products/1'
9
+
10
+ factory :redirect_rule_regex do
11
+ source_is_regex true
12
+ source '[A-Za-z0-9_]+shiny\/([A-Za-z0-9_]+)'
13
+ destination 'http://www.example.com/news/$1'
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,15 @@
1
+ # Read about factories at https://github.com/thoughtbot/factory_girl
2
+
3
+ FactoryGirl.define do
4
+ factory :request_environment_rule do
5
+ redirect_rule
6
+ environment_key_name "SERVER_NAME"
7
+ environment_value "example.com"
8
+
9
+ factory :request_environment_rule_regex do
10
+ environment_key_name "QUERY_STRING"
11
+ environment_value "something=value"
12
+ environment_value_is_regex true
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,153 @@
1
+ require 'spec_helper'
2
+
3
+ describe RedirectRule do
4
+ subject { FactoryGirl.create(:redirect_rule) }
5
+ let!(:rule) { subject }
6
+
7
+ it { should have_many(:request_environment_rules) }
8
+
9
+ it { should allow_mass_assignment_of(:source) }
10
+ it { should allow_mass_assignment_of(:source_is_regex) }
11
+ it { should allow_mass_assignment_of(:destination) }
12
+ it { should allow_mass_assignment_of(:active) }
13
+ it { should allow_mass_assignment_of(:source_is_case_sensitive) }
14
+
15
+ it { should validate_presence_of(:source) }
16
+ it { should validate_presence_of(:destination) }
17
+ it { should validate_presence_of(:active) }
18
+
19
+ it { should allow_value('0').for(:source_is_regex) }
20
+ it { should allow_value('1').for(:source_is_regex) }
21
+ it { should allow_value(true).for(:source_is_regex) }
22
+ it { should allow_value(false).for(:source_is_regex) }
23
+
24
+ it { should allow_value('0').for(:source_is_case_sensitive) }
25
+ it { should allow_value('1').for(:source_is_case_sensitive) }
26
+ it { should allow_value(true).for(:source_is_case_sensitive) }
27
+ it { should allow_value(false).for(:source_is_case_sensitive) }
28
+
29
+ it 'should not allow an invalid regex' do
30
+ new_rule = RedirectRule.new(:source => '[', :source_is_regex => true,
31
+ :destination => 'http://www.example.com', :active => true)
32
+ new_rule.errors_on(:source).should == ['is an invalid regular expression']
33
+ end
34
+
35
+ describe '.match_for' do
36
+ it 'returns nil if there is no matching rule' do
37
+ RedirectRule.match_for('/someplace', {}).should be_nil
38
+ end
39
+
40
+ it 'returns the rule if there is a matching rule' do
41
+ RedirectRule.match_for('/catchy_thingy', {}).should == subject
42
+ end
43
+
44
+ context 'for a case sensitive regex match' do
45
+ let!(:regex_rule){ FactoryGirl.create(:redirect_rule_regex, :source_is_case_sensitive => true) }
46
+
47
+ it 'returns the rule if it matches the case' do
48
+ RedirectRule.match_for('/new_shiny/from_company', {}).should == regex_rule
49
+ end
50
+
51
+ it 'returns nil if it does not match the case' do
52
+ RedirectRule.match_for('/new_SHINY/from_company', {}).should be_nil
53
+ end
54
+ end
55
+
56
+ context 'for a case insensitive regex match' do
57
+ let!(:regex_rule){ FactoryGirl.create(:redirect_rule_regex) }
58
+
59
+ it 'returns the rule if it matches the case' do
60
+ RedirectRule.match_for('/new_shiny/from_company', {}).should == regex_rule
61
+ end
62
+
63
+ it 'returns the rule if it does not match the case' do
64
+ RedirectRule.match_for('/new_SHINY/from_company', {}).should == regex_rule
65
+ end
66
+ end
67
+
68
+ context 'with a rule with one environment condition' do
69
+ before do
70
+ FactoryGirl.create(:request_environment_rule, :redirect_rule => subject)
71
+ end
72
+
73
+ it 'should find the rule if it matches' do
74
+ RedirectRule.match_for('/catchy_thingy', {'SERVER_NAME' => 'example.com'}).should == subject
75
+ end
76
+
77
+ it 'should not find the rule if there is no match' do
78
+ RedirectRule.match_for('/catchy_thingy', {'SERVER_NAME' => 'example.ca'}).should be_nil
79
+ end
80
+ end
81
+
82
+ context 'with a rule with multiple environment conditions' do
83
+ before do
84
+ FactoryGirl.create(:request_environment_rule, :redirect_rule => subject)
85
+ FactoryGirl.create(:request_environment_rule_regex, :redirect_rule => subject)
86
+ end
87
+
88
+ it 'should find the rule if it matches' do
89
+ RedirectRule.match_for('/catchy_thingy', {'SERVER_NAME' => 'example.com',
90
+ 'QUERY_STRING' => 's=bogus&something=value'}).should == subject
91
+ end
92
+
93
+ it 'should not find the rule if there is no match' do
94
+ RedirectRule.match_for('/catchy_thingy', {'SERVER_NAME' => 'example.com',
95
+ "QUERY_STRING" => 's=bogus&something=wrong'}).should be_nil
96
+ end
97
+ end
98
+
99
+ context 'with multiple rules with multiple environment conditions' do
100
+ let!(:rule2){ FactoryGirl.create(:redirect_rule) }
101
+ before do
102
+ FactoryGirl.create(:request_environment_rule, :redirect_rule => subject)
103
+ FactoryGirl.create(:request_environment_rule_regex, :redirect_rule => subject)
104
+ FactoryGirl.create(:request_environment_rule, :redirect_rule => rule2)
105
+ FactoryGirl.create(:request_environment_rule_regex, :redirect_rule => rule2,
106
+ :environment_value => 'another=value')
107
+ end
108
+
109
+ it 'should find the rule if it matches' do
110
+ RedirectRule.match_for('/catchy_thingy', {'SERVER_NAME' => 'example.com',
111
+ 'QUERY_STRING' => 's=bogus&something=value'}).should == subject
112
+ end
113
+
114
+ it 'should find the other rule if it matches' do
115
+ RedirectRule.match_for('/catchy_thingy', {'SERVER_NAME' => 'example.com',
116
+ 'QUERY_STRING' => 's=bogus&another=value'}).should == rule2
117
+ end
118
+
119
+ it 'should not find the rule if there is no match' do
120
+ RedirectRule.match_for('/catchy_thingy', {'SERVER_NAME' => 'example.com',
121
+ "QUERY_STRING" => 's=bogus&something=wrong'}).should be_nil
122
+ end
123
+ end
124
+ end
125
+
126
+ describe '.destination_for' do
127
+ let!(:regex_rule) { FactoryGirl.create(:redirect_rule_regex) }
128
+
129
+ it 'should find a regex match' do
130
+ RedirectRule.destination_for('/new_shiny/from_company', {}).should == 'http://www.example.com/news/from_company'
131
+ end
132
+
133
+ it 'should find a string match' do
134
+ RedirectRule.destination_for('/catchy_thingy', {}).should == 'http://www.example.com/products/1'
135
+ end
136
+
137
+ it 'should return nil if there is no matching rule' do
138
+ RedirectRule.destination_for('/someplace', {}).should be_nil
139
+ end
140
+ end
141
+
142
+ describe '#evaluated_destination_for' do
143
+ let(:regex_rule) { FactoryGirl.create(:redirect_rule_regex) }
144
+
145
+ it 'returns the destination for a non regex rule' do
146
+ subject.evaluated_destination_for('/catchy_thingy').should == 'http://www.example.com/products/1'
147
+ end
148
+
149
+ it 'returns the evaluated destination for a regex rule' do
150
+ regex_rule.evaluated_destination_for('/new_shiny/from_company').should == 'http://www.example.com/news/from_company'
151
+ end
152
+ end
153
+ end
@@ -0,0 +1,64 @@
1
+ require 'spec_helper'
2
+
3
+ describe RequestEnvironmentRule do
4
+ subject { FactoryGirl.create(:request_environment_rule) }
5
+
6
+ it { should belong_to(:redirect_rule) }
7
+
8
+ it { should allow_mass_assignment_of(:redirect_rule_id) }
9
+ it { should allow_mass_assignment_of(:environment_key_name) }
10
+ it { should allow_mass_assignment_of(:environment_value) }
11
+ it { should allow_mass_assignment_of(:environment_value_is_regex) }
12
+ it { should allow_mass_assignment_of(:environment_value_is_case_sensitive) }
13
+
14
+ it { should validate_presence_of(:redirect_rule_id) }
15
+ it { should validate_presence_of(:environment_key_name) }
16
+ it { should validate_presence_of(:environment_value) }
17
+
18
+ it { should allow_value('0').for(:environment_value_is_regex) }
19
+ it { should allow_value('1').for(:environment_value_is_regex) }
20
+ it { should allow_value(true).for(:environment_value_is_regex) }
21
+ it { should allow_value(false).for(:environment_value_is_regex) }
22
+
23
+ it { should allow_value('0').for(:environment_value_is_case_sensitive) }
24
+ it { should allow_value('1').for(:environment_value_is_case_sensitive) }
25
+ it { should allow_value(true).for(:environment_value_is_case_sensitive) }
26
+ it { should allow_value(false).for(:environment_value_is_case_sensitive) }
27
+
28
+ it 'should not allow an invalid regex' do
29
+ rule = FactoryGirl.build(:request_environment_rule_regex, :environment_value => '[')
30
+ rule.errors_on(:environment_value).should == ['is an invalid regular expression']
31
+ end
32
+
33
+ it "should know if it's matched for a non-regex value" do
34
+ subject.matches?({'SERVER_NAME' => 'example.com'}).should be_true
35
+ subject.matches?({'HTTP_HOST' => 'www.example.com'}).should be_false
36
+ subject.matches?({'SERVER_NAME' => 'example.ca'}).should be_false
37
+ end
38
+
39
+ context 'with a case sensitive regex value' do
40
+ subject { FactoryGirl.create(:request_environment_rule_regex) }
41
+
42
+ it "should know if it's matched" do
43
+ subject.matches?({'QUERY_STRING' => 'something=value'}).should be_true
44
+ subject.matches?({'QUERY_STRING' => 'q=search&something=value'}).should be_true
45
+ subject.matches?({'QUERY_STRING' => 'q=search&something=VALUE'}).should be_false
46
+ subject.matches?({'QUERY_STRING' => 'q=search&something=bogus'}).should be_false
47
+ subject.matches?({'QUERY_STRING' => 'q=search'}).should be_false
48
+ subject.matches?({'SERVER_NAME' => 'example.ca'}).should be_false
49
+ end
50
+ end
51
+
52
+ context 'with a case insensitve regex value' do
53
+ subject { FactoryGirl.create(:request_environment_rule_regex, :environment_value_is_case_sensitive => false) }
54
+
55
+ it "should know if it's matched" do
56
+ subject.matches?({'QUERY_STRING' => 'something=value'}).should be_true
57
+ subject.matches?({'QUERY_STRING' => 'q=search&something=value'}).should be_true
58
+ subject.matches?({'QUERY_STRING' => 'q=search&something=VALUE'}).should be_true
59
+ subject.matches?({'QUERY_STRING' => 'q=search&something=bogus'}).should be_false
60
+ subject.matches?({'QUERY_STRING' => 'q=search'}).should be_false
61
+ subject.matches?({'SERVER_NAME' => 'example.ca'}).should be_false
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,18 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'Redirector middleware' do
4
+ before do
5
+ FactoryGirl.create(:redirect_rule, :destination => '/news/5', :source => '/my_custom_url')
6
+ FactoryGirl.create(:redirect_rule_regex, :destination => '/news/$1', :source => '/my_custom_url/([A-Za-z0-9_]+)')
7
+ end
8
+
9
+ it 'correctly redirects the visitor for an exact match rule' do
10
+ visit '/my_custom_url'
11
+ current_path.should == '/news/5'
12
+ end
13
+
14
+ it 'correctly redirects the visitor for a regex match rule' do
15
+ visit '/my_custom_url/20'
16
+ current_path.should == '/news/20'
17
+ end
18
+ end
@@ -0,0 +1,27 @@
1
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
2
+ ENV['RAILS_ENV'] ||= 'test'
3
+
4
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
+ require 'rspec/rails'
6
+ require 'rspec/autorun'
7
+ require 'shoulda-matchers'
8
+ require 'capybara/rails'
9
+ require 'capybara/rspec'
10
+ require 'database_cleaner'
11
+ require 'factory_girl_rails'
12
+
13
+ Rails.backtrace_cleaner.remove_silencers!
14
+
15
+ DatabaseCleaner.strategy = :truncation
16
+
17
+ RSpec.configure do |config|
18
+ config.mock_with :rspec
19
+ config.use_transactional_fixtures = true
20
+ config.infer_base_class_for_anonymous_controllers = false
21
+
22
+ config.after(:each, :type => :request) do
23
+ DatabaseCleaner.clean # Truncate the database
24
+ Capybara.reset_sessions! # Forget the (simulated) browser state
25
+ Capybara.use_default_driver # Revert Capybara.current_driver to Capybara.default_driver
26
+ end
27
+ end
metadata ADDED
@@ -0,0 +1,255 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: redirector
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Brian Landau
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-08-24 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rails
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: '3.1'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '3.1'
30
+ - !ruby/object:Gem::Dependency
31
+ name: mysql2
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: rspec-rails
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: shoulda-matchers
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ - !ruby/object:Gem::Dependency
79
+ name: capybara
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ - !ruby/object:Gem::Dependency
95
+ name: database_cleaner
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: factory_girl_rails
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ~>
116
+ - !ruby/object:Gem::Version
117
+ version: '1.7'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ~>
124
+ - !ruby/object:Gem::Version
125
+ version: '1.7'
126
+ description: A Rails engine that adds a piece of middleware to the top of your middleware
127
+ stack that looks for redirect rules stored in your database and redirects you accordingly.
128
+ email:
129
+ - brian.landau@viget.com
130
+ executables: []
131
+ extensions: []
132
+ extra_rdoc_files: []
133
+ files:
134
+ - app/models/redirect_rule.rb
135
+ - app/models/request_environment_rule.rb
136
+ - db/migrate/20120815212612_create_redirect_rules.rb
137
+ - db/migrate/20120823163756_create_request_environment_rules.rb
138
+ - lib/redirector/engine.rb
139
+ - lib/redirector/middleware.rb
140
+ - lib/redirector/regex_attribute.rb
141
+ - lib/redirector/version.rb
142
+ - lib/redirector.rb
143
+ - MIT-LICENSE
144
+ - Rakefile
145
+ - README.md
146
+ - redirector.gemspec
147
+ - HISTORY
148
+ - spec/dummy/README.rdoc
149
+ - spec/dummy/Rakefile
150
+ - spec/dummy/app/assets/javascripts/application.js
151
+ - spec/dummy/app/assets/stylesheets/application.css
152
+ - spec/dummy/app/controllers/application_controller.rb
153
+ - spec/dummy/app/controllers/news_controller.rb
154
+ - spec/dummy/app/helpers/application_helper.rb
155
+ - spec/dummy/app/views/layouts/application.html.erb
156
+ - spec/dummy/config/application.rb
157
+ - spec/dummy/config/boot.rb
158
+ - spec/dummy/config/database.yml
159
+ - spec/dummy/config/environment.rb
160
+ - spec/dummy/config/environments/development.rb
161
+ - spec/dummy/config/environments/production.rb
162
+ - spec/dummy/config/environments/test.rb
163
+ - spec/dummy/config/initializers/backtrace_silencers.rb
164
+ - spec/dummy/config/initializers/inflections.rb
165
+ - spec/dummy/config/initializers/mime_types.rb
166
+ - spec/dummy/config/initializers/secret_token.rb
167
+ - spec/dummy/config/initializers/session_store.rb
168
+ - spec/dummy/config/initializers/wrap_parameters.rb
169
+ - spec/dummy/config/locales/en.yml
170
+ - spec/dummy/config/routes.rb
171
+ - spec/dummy/config.ru
172
+ - spec/dummy/db/schema.rb
173
+ - spec/dummy/log/development.log
174
+ - spec/dummy/log/test.log
175
+ - spec/dummy/public/404.html
176
+ - spec/dummy/public/422.html
177
+ - spec/dummy/public/500.html
178
+ - spec/dummy/public/favicon.ico
179
+ - spec/dummy/script/rails
180
+ - spec/factories/redirect_rules.rb
181
+ - spec/factories/request_environment_rules.rb
182
+ - spec/models/redirect_rule_spec.rb
183
+ - spec/models/request_environment_rule_spec.rb
184
+ - spec/requests/middleware_spec.rb
185
+ - spec/spec_helper.rb
186
+ homepage: https://github.com/vigetlabs/redirector
187
+ licenses: []
188
+ post_install_message:
189
+ rdoc_options: []
190
+ require_paths:
191
+ - lib
192
+ required_ruby_version: !ruby/object:Gem::Requirement
193
+ none: false
194
+ requirements:
195
+ - - ! '>='
196
+ - !ruby/object:Gem::Version
197
+ version: '0'
198
+ segments:
199
+ - 0
200
+ hash: 3438278425952232537
201
+ required_rubygems_version: !ruby/object:Gem::Requirement
202
+ none: false
203
+ requirements:
204
+ - - ! '>='
205
+ - !ruby/object:Gem::Version
206
+ version: '0'
207
+ segments:
208
+ - 0
209
+ hash: 3438278425952232537
210
+ requirements: []
211
+ rubyforge_project:
212
+ rubygems_version: 1.8.21
213
+ signing_key:
214
+ specification_version: 3
215
+ summary: A Rails engine that adds a piece of middleware to the top of your middleware
216
+ stack that looks for redirect rules stored in your database and redirects you accordingly.
217
+ test_files:
218
+ - spec/dummy/README.rdoc
219
+ - spec/dummy/Rakefile
220
+ - spec/dummy/app/assets/javascripts/application.js
221
+ - spec/dummy/app/assets/stylesheets/application.css
222
+ - spec/dummy/app/controllers/application_controller.rb
223
+ - spec/dummy/app/controllers/news_controller.rb
224
+ - spec/dummy/app/helpers/application_helper.rb
225
+ - spec/dummy/app/views/layouts/application.html.erb
226
+ - spec/dummy/config/application.rb
227
+ - spec/dummy/config/boot.rb
228
+ - spec/dummy/config/database.yml
229
+ - spec/dummy/config/environment.rb
230
+ - spec/dummy/config/environments/development.rb
231
+ - spec/dummy/config/environments/production.rb
232
+ - spec/dummy/config/environments/test.rb
233
+ - spec/dummy/config/initializers/backtrace_silencers.rb
234
+ - spec/dummy/config/initializers/inflections.rb
235
+ - spec/dummy/config/initializers/mime_types.rb
236
+ - spec/dummy/config/initializers/secret_token.rb
237
+ - spec/dummy/config/initializers/session_store.rb
238
+ - spec/dummy/config/initializers/wrap_parameters.rb
239
+ - spec/dummy/config/locales/en.yml
240
+ - spec/dummy/config/routes.rb
241
+ - spec/dummy/config.ru
242
+ - spec/dummy/db/schema.rb
243
+ - spec/dummy/log/development.log
244
+ - spec/dummy/log/test.log
245
+ - spec/dummy/public/404.html
246
+ - spec/dummy/public/422.html
247
+ - spec/dummy/public/500.html
248
+ - spec/dummy/public/favicon.ico
249
+ - spec/dummy/script/rails
250
+ - spec/factories/redirect_rules.rb
251
+ - spec/factories/request_environment_rules.rb
252
+ - spec/models/redirect_rule_spec.rb
253
+ - spec/models/request_environment_rule_spec.rb
254
+ - spec/requests/middleware_spec.rb
255
+ - spec/spec_helper.rb