simplify_redirector 1.0.1

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.
Files changed (53) hide show
  1. checksums.yaml +7 -0
  2. data/HISTORY +37 -0
  3. data/MIT-LICENSE +20 -0
  4. data/README.md +119 -0
  5. data/Rakefile +22 -0
  6. data/app/models/redirect_rule.rb +86 -0
  7. data/app/models/request_environment_rule.rb +23 -0
  8. data/db/migrate/20120815212612_create_redirect_rules.rb +16 -0
  9. data/db/migrate/20120823163756_create_request_environment_rules.rb +13 -0
  10. data/lib/redirector.rb +16 -0
  11. data/lib/redirector/engine.rb +20 -0
  12. data/lib/redirector/middleware.rb +95 -0
  13. data/lib/redirector/regex_attribute.rb +38 -0
  14. data/lib/redirector/version.rb +3 -0
  15. data/redirector.gemspec +33 -0
  16. data/spec/dummy/README.rdoc +261 -0
  17. data/spec/dummy/Rakefile +7 -0
  18. data/spec/dummy/app/assets/javascripts/application.js +15 -0
  19. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  20. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  21. data/spec/dummy/app/controllers/news_controller.rb +9 -0
  22. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  23. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  24. data/spec/dummy/config.ru +4 -0
  25. data/spec/dummy/config/application.rb +59 -0
  26. data/spec/dummy/config/boot.rb +6 -0
  27. data/spec/dummy/config/database.travis.yml +26 -0
  28. data/spec/dummy/config/database.yml.example +17 -0
  29. data/spec/dummy/config/environment.rb +5 -0
  30. data/spec/dummy/config/environments/development.rb +39 -0
  31. data/spec/dummy/config/environments/production.rb +67 -0
  32. data/spec/dummy/config/environments/test.rb +39 -0
  33. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  34. data/spec/dummy/config/initializers/inflections.rb +15 -0
  35. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  36. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  37. data/spec/dummy/config/initializers/session_store.rb +8 -0
  38. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  39. data/spec/dummy/config/locales/en.yml +5 -0
  40. data/spec/dummy/config/routes.rb +3 -0
  41. data/spec/dummy/db/schema.rb +43 -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/features/middleware_spec.rb +74 -0
  50. data/spec/models/redirect_rule_spec.rb +194 -0
  51. data/spec/models/request_environment_rule_spec.rb +58 -0
  52. data/spec/spec_helper.rb +32 -0
  53. metadata +287 -0
@@ -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,74 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'Redirector middleware', :type => :feature do
4
+ before do
5
+ create(:redirect_rule, :destination => '/news/5', :source => '/my_custom_url')
6
+ create(:redirect_rule_regex, :destination => '/news/$1', :source => '/my_custom_url/([A-Za-z0-9_]+)')
7
+ create(:redirect_rule_regex, :destination => '/news', :source => 'categoryID=12345')
8
+ end
9
+
10
+ it 'correctly redirects the visitor for an exact match rule' do
11
+ visit '/my_custom_url'
12
+ current_path.should == '/news/5'
13
+ end
14
+
15
+ it 'correctly redirects the visitor for a regex match rule' do
16
+ visit '/my_custom_url/20'
17
+ current_path.should == '/news/20'
18
+ end
19
+
20
+ it 'should not do the query string match if the Redirector.include_query_in_source is false' do
21
+ visit '/my_old_url?categoryID=12345'
22
+ current_path.should == '/my_old_url'
23
+ end
24
+
25
+ it 'should do the query string match if the Redirector.include_query_in_source is true' do
26
+ original_option = Redirector.include_query_in_source
27
+ Redirector.include_query_in_source = true
28
+ visit '/my_old_url?categoryID=12345'
29
+ current_path.should == '/news'
30
+ Redirector.include_query_in_source = original_option
31
+ end
32
+
33
+ it 'should preserve the query string if the Redirector.preserve_query is true' do
34
+ original_option = Redirector.preserve_query
35
+ Redirector.preserve_query = true
36
+ visit '/my_custom_url/20?categoryID=43257'
37
+ uri = URI.parse(current_url)
38
+ uri.query.should == 'categoryID=43257'
39
+ current_path.should == '/news/20'
40
+ Redirector.preserve_query = original_option
41
+ end
42
+
43
+ it 'should stil work with silenced ActiveRecord logs' do
44
+ original_option = Redirector.silence_sql_logs
45
+ Redirector.silence_sql_logs = true
46
+ visit '/my_custom_url/20'
47
+ current_path.should == '/news/20'
48
+ Redirector.preserve_query = original_option
49
+ end
50
+
51
+ it 'handles requests with or without a port specified' do
52
+ Capybara.app_host = 'http://example.com'
53
+
54
+ visit '/my_custom_url'
55
+ current_url.should == 'http://example.com/news/5'
56
+
57
+ Capybara.app_host = 'http://example.com:3000'
58
+
59
+ visit '/my_custom_url'
60
+ current_url.should == 'http://example.com:3000/news/5'
61
+ end
62
+
63
+ unless Rails.version =~ /\A4\.2\.\d\z/
64
+ it 'handles invalid URIs properly' do
65
+ bad_rule = create(:redirect_rule_regex, :destination => 'http://www.example.com$1', :source => '^/custom(.*)$')
66
+
67
+ begin
68
+ visit '/custom)e2'
69
+ rescue Redirector::RuleError => e
70
+ e.message.should == "RedirectRule #{bad_rule.id} generated the bad destination: http://www.example.com)e2"
71
+ end
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,194 @@
1
+ require 'spec_helper'
2
+
3
+ describe RedirectRule do
4
+ subject { create(:redirect_rule) }
5
+ let!(:rule) { subject }
6
+
7
+ it { should have_many(:request_environment_rules) }
8
+
9
+ it { should accept_nested_attributes_for(:request_environment_rules) }
10
+
11
+ it { should validate_presence_of(:source) }
12
+ it { should validate_presence_of(:destination) }
13
+
14
+ it { should allow_value('0').for(:active) }
15
+ it { should allow_value('1').for(:active) }
16
+ it { should allow_value(true).for(:active) }
17
+ it { should allow_value(false).for(: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 'strip_source_whitespace before_save callback' do
36
+ it 'strips leading and trailing whitespace when saved' do
37
+ subject = FactoryGirl.build(:redirect_rule, :source => ' /needs-stripping ')
38
+
39
+ subject.save
40
+ subject.reload.source.should == '/needs-stripping'
41
+ end
42
+ end
43
+
44
+ describe '.match_for' do
45
+ it 'returns nil if there is no matching rule' do
46
+ RedirectRule.match_for('/someplace', {}).should be_nil
47
+ end
48
+
49
+ it 'returns the rule if there is a matching rule' do
50
+ RedirectRule.match_for('/catchy_thingy', {}).should == subject
51
+ end
52
+
53
+ context 'for a case sensitive match' do
54
+ let!(:case_sensitive_rule) { create(:redirect_rule, :source_is_case_sensitive => true, :source => '/Case-Does-Matter') }
55
+
56
+ it 'returns the rule if it matches the case' do
57
+ RedirectRule.match_for('/Case-Does-Matter', {}).should == case_sensitive_rule
58
+ end
59
+
60
+ it 'returns nil if it does not match the case' do
61
+ RedirectRule.match_for('/case-does-matter', {}).should be_nil
62
+ end
63
+ end
64
+
65
+ context 'for a case insensitive match' do
66
+ let!(:case_insensitive_rule) { create(:redirect_rule, :source_is_case_sensitive => false, :source => '/Case-Does-Not-Matter') }
67
+
68
+ it 'returns the rule if it matches the case' do
69
+ RedirectRule.match_for('/Case-Does-Not-Matter', {}).should == case_insensitive_rule
70
+ end
71
+
72
+ it 'returns the rule if it does not match the case' do
73
+ RedirectRule.match_for('/case-does-not-matter', {}).should == case_insensitive_rule
74
+ end
75
+ end
76
+
77
+ context 'for a case sensitive regex match' do
78
+ let!(:regex_rule){ create(:redirect_rule_regex, :source_is_case_sensitive => true) }
79
+
80
+ it 'returns the rule if it matches the case' do
81
+ RedirectRule.match_for('/new_shiny/from_company', {}).should == regex_rule
82
+ end
83
+
84
+ it 'returns nil if it does not match the case' do
85
+ RedirectRule.match_for('/new_SHINY/from_company', {}).should be_nil
86
+ end
87
+ end
88
+
89
+ context 'for a case insensitive regex match' do
90
+ let!(:regex_rule){ create(:redirect_rule_regex) }
91
+
92
+ it 'returns the rule if it matches the case' do
93
+ RedirectRule.match_for('/new_shiny/from_company', {}).should == regex_rule
94
+ end
95
+
96
+ it 'returns the rule if it does not match the case' do
97
+ RedirectRule.match_for('/new_SHINY/from_company', {}).should == regex_rule
98
+ end
99
+ end
100
+
101
+ context 'with a rule with one environment condition' do
102
+ before do
103
+ create(:request_environment_rule, :redirect_rule => subject)
104
+ end
105
+
106
+ it 'should find the rule if it matches' do
107
+ RedirectRule.match_for('/catchy_thingy', {'SERVER_NAME' => 'example.com'}).should == subject
108
+ end
109
+
110
+ it 'should not find the rule if there is no match' do
111
+ RedirectRule.match_for('/catchy_thingy', {'SERVER_NAME' => 'example.ca'}).should be_nil
112
+ end
113
+ end
114
+
115
+ context 'with a rule with multiple environment conditions' do
116
+ before do
117
+ create(:request_environment_rule, :redirect_rule => subject)
118
+ create(:request_environment_rule_regex, :redirect_rule => subject)
119
+ end
120
+
121
+ it 'should find the rule if it matches' do
122
+ RedirectRule.match_for('/catchy_thingy', {'SERVER_NAME' => 'example.com',
123
+ 'QUERY_STRING' => 's=bogus&something=value'}).should == subject
124
+ end
125
+
126
+ it 'should not find the rule if there is no match' do
127
+ RedirectRule.match_for('/catchy_thingy', {'SERVER_NAME' => 'example.com',
128
+ "QUERY_STRING" => 's=bogus&something=wrong'}).should be_nil
129
+ end
130
+ end
131
+
132
+ context 'with multiple rules with multiple environment conditions' do
133
+ let!(:rule2){ create(:redirect_rule) }
134
+ before do
135
+ create(:request_environment_rule, :redirect_rule => subject)
136
+ create(:request_environment_rule_regex, :redirect_rule => subject)
137
+ create(:request_environment_rule, :redirect_rule => rule2)
138
+ create(:request_environment_rule_regex, :redirect_rule => rule2,
139
+ :environment_value => 'another=value')
140
+ end
141
+
142
+ it 'should find the rule if it matches' do
143
+ RedirectRule.match_for('/catchy_thingy', {'SERVER_NAME' => 'example.com',
144
+ 'QUERY_STRING' => 's=bogus&something=value'}).should == subject
145
+ end
146
+
147
+ it 'should find the other rule if it matches' do
148
+ RedirectRule.match_for('/catchy_thingy', {'SERVER_NAME' => 'example.com',
149
+ 'QUERY_STRING' => 's=bogus&another=value'}).should == rule2
150
+ end
151
+
152
+ it 'should not find the rule if there is no match' do
153
+ RedirectRule.match_for('/catchy_thingy', {'SERVER_NAME' => 'example.com',
154
+ "QUERY_STRING" => 's=bogus&something=wrong'}).should be_nil
155
+ end
156
+ end
157
+
158
+ context 'with a regex rule that also matches an exact string match' do
159
+ let!(:regex_rule){ create(:redirect_rule_regex, :source => '[A-Za-z0-9]_thingy') }
160
+
161
+ it 'should return the exact match' do
162
+ RedirectRule.match_for('/catchy_thingy', {}).should == subject
163
+ end
164
+ end
165
+ end
166
+
167
+ describe '.destination_for' do
168
+ let!(:regex_rule) { create(:redirect_rule_regex) }
169
+
170
+ it 'should find a regex match' do
171
+ RedirectRule.destination_for('/new_shiny/from_company', {}).should == 'http://www.example.com/news/from_company'
172
+ end
173
+
174
+ it 'should find a string match' do
175
+ RedirectRule.destination_for('/catchy_thingy', {}).should == 'http://www.example.com/products/1'
176
+ end
177
+
178
+ it 'should return nil if there is no matching rule' do
179
+ RedirectRule.destination_for('/someplace', {}).should be_nil
180
+ end
181
+ end
182
+
183
+ describe '#evaluated_destination_for' do
184
+ let(:regex_rule) { create(:redirect_rule_regex) }
185
+
186
+ it 'returns the destination for a non regex rule' do
187
+ subject.evaluated_destination_for('/catchy_thingy').should == 'http://www.example.com/products/1'
188
+ end
189
+
190
+ it 'returns the evaluated destination for a regex rule' do
191
+ regex_rule.evaluated_destination_for('/new_shiny/from_company').should == 'http://www.example.com/news/from_company'
192
+ end
193
+ end
194
+ end
@@ -0,0 +1,58 @@
1
+ require 'spec_helper'
2
+
3
+ describe RequestEnvironmentRule do
4
+ subject { create(:request_environment_rule) }
5
+
6
+ it { should belong_to(:redirect_rule) }
7
+
8
+ it { should validate_presence_of(:redirect_rule) }
9
+ it { should validate_presence_of(:environment_key_name) }
10
+ it { should validate_presence_of(:environment_value) }
11
+
12
+ it { should allow_value('0').for(:environment_value_is_regex) }
13
+ it { should allow_value('1').for(:environment_value_is_regex) }
14
+ it { should allow_value(true).for(:environment_value_is_regex) }
15
+ it { should allow_value(false).for(:environment_value_is_regex) }
16
+
17
+ it { should allow_value('0').for(:environment_value_is_case_sensitive) }
18
+ it { should allow_value('1').for(:environment_value_is_case_sensitive) }
19
+ it { should allow_value(true).for(:environment_value_is_case_sensitive) }
20
+ it { should allow_value(false).for(:environment_value_is_case_sensitive) }
21
+
22
+ it 'should not allow an invalid regex' do
23
+ rule = build(:request_environment_rule_regex, :environment_value => '[')
24
+ rule.errors_on(:environment_value).should == ['is an invalid regular expression']
25
+ end
26
+
27
+ it "should know if it's matched for a non-regex value" do
28
+ subject.matches?({'SERVER_NAME' => 'example.com'}).should be_true
29
+ subject.matches?({'HTTP_HOST' => 'www.example.com'}).should be_false
30
+ subject.matches?({'SERVER_NAME' => 'example.ca'}).should be_false
31
+ end
32
+
33
+ context 'with a case sensitive regex value' do
34
+ subject { create(:request_environment_rule_regex) }
35
+
36
+ it "should know if it's matched" do
37
+ subject.matches?({'QUERY_STRING' => 'something=value'}).should be_true
38
+ subject.matches?({'QUERY_STRING' => 'q=search&something=value'}).should be_true
39
+ subject.matches?({'QUERY_STRING' => 'q=search&something=VALUE'}).should be_false
40
+ subject.matches?({'QUERY_STRING' => 'q=search&something=bogus'}).should be_false
41
+ subject.matches?({'QUERY_STRING' => 'q=search'}).should be_false
42
+ subject.matches?({'SERVER_NAME' => 'example.ca'}).should be_false
43
+ end
44
+ end
45
+
46
+ context 'with a case insensitve regex value' do
47
+ subject { create(:request_environment_rule_regex, :environment_value_is_case_sensitive => false) }
48
+
49
+ it "should know if it's matched" do
50
+ subject.matches?({'QUERY_STRING' => 'something=value'}).should be_true
51
+ subject.matches?({'QUERY_STRING' => 'q=search&something=value'}).should be_true
52
+ subject.matches?({'QUERY_STRING' => 'q=search&something=VALUE'}).should be_true
53
+ subject.matches?({'QUERY_STRING' => 'q=search&something=bogus'}).should be_false
54
+ subject.matches?({'QUERY_STRING' => 'q=search'}).should be_false
55
+ subject.matches?({'SERVER_NAME' => 'example.ca'}).should be_false
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,32 @@
1
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
2
+ ENV['RAILS_ENV'] ||= 'test'
3
+ require 'simplecov'
4
+ require 'coveralls'
5
+ Coveralls.wear! 'rails'
6
+
7
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
8
+ require 'rspec/rails'
9
+ require 'rspec/autorun'
10
+ require 'shoulda-matchers'
11
+ require 'capybara/rails'
12
+ require 'capybara/rspec'
13
+ require 'database_cleaner'
14
+ require 'factory_girl_rails'
15
+
16
+ Rails.backtrace_cleaner.remove_silencers!
17
+
18
+ DatabaseCleaner.strategy = :truncation
19
+
20
+ RSpec.configure do |config|
21
+ config.include FactoryGirl::Syntax::Methods
22
+
23
+ config.mock_with :rspec
24
+ config.use_transactional_fixtures = true
25
+ config.infer_base_class_for_anonymous_controllers = false
26
+
27
+ config.after(:each, :type => :feature) do
28
+ DatabaseCleaner.clean # Truncate the database
29
+ Capybara.reset_sessions! # Forget the (simulated) browser state
30
+ Capybara.use_default_driver # Revert Capybara.current_driver to Capybara.default_driver
31
+ end
32
+ end
metadata ADDED
@@ -0,0 +1,287 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: simplify_redirector
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Brian Landau
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-01-26 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '3.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '3.1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: mysql2
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: pg
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec-rails
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 2.14.2
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 2.14.2
69
+ - !ruby/object:Gem::Dependency
70
+ name: shoulda-matchers
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: capybara
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '2.2'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '2.2'
97
+ - !ruby/object:Gem::Dependency
98
+ name: database_cleaner
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: factory_girl_rails
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '4.4'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '4.4'
125
+ - !ruby/object:Gem::Dependency
126
+ name: appraisal
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: rake
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: coveralls
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ description: A Rails engine that adds a piece of middleware to the top of your middleware
168
+ stack that looks for redirect rules stored in your database and redirects you accordingly.
169
+ email:
170
+ - brian.landau@viget.com
171
+ executables: []
172
+ extensions: []
173
+ extra_rdoc_files: []
174
+ files:
175
+ - HISTORY
176
+ - MIT-LICENSE
177
+ - README.md
178
+ - Rakefile
179
+ - app/models/redirect_rule.rb
180
+ - app/models/request_environment_rule.rb
181
+ - db/migrate/20120815212612_create_redirect_rules.rb
182
+ - db/migrate/20120823163756_create_request_environment_rules.rb
183
+ - lib/redirector.rb
184
+ - lib/redirector/engine.rb
185
+ - lib/redirector/middleware.rb
186
+ - lib/redirector/regex_attribute.rb
187
+ - lib/redirector/version.rb
188
+ - redirector.gemspec
189
+ - spec/dummy/README.rdoc
190
+ - spec/dummy/Rakefile
191
+ - spec/dummy/app/assets/javascripts/application.js
192
+ - spec/dummy/app/assets/stylesheets/application.css
193
+ - spec/dummy/app/controllers/application_controller.rb
194
+ - spec/dummy/app/controllers/news_controller.rb
195
+ - spec/dummy/app/helpers/application_helper.rb
196
+ - spec/dummy/app/views/layouts/application.html.erb
197
+ - spec/dummy/config.ru
198
+ - spec/dummy/config/application.rb
199
+ - spec/dummy/config/boot.rb
200
+ - spec/dummy/config/database.travis.yml
201
+ - spec/dummy/config/database.yml.example
202
+ - spec/dummy/config/environment.rb
203
+ - spec/dummy/config/environments/development.rb
204
+ - spec/dummy/config/environments/production.rb
205
+ - spec/dummy/config/environments/test.rb
206
+ - spec/dummy/config/initializers/backtrace_silencers.rb
207
+ - spec/dummy/config/initializers/inflections.rb
208
+ - spec/dummy/config/initializers/mime_types.rb
209
+ - spec/dummy/config/initializers/secret_token.rb
210
+ - spec/dummy/config/initializers/session_store.rb
211
+ - spec/dummy/config/initializers/wrap_parameters.rb
212
+ - spec/dummy/config/locales/en.yml
213
+ - spec/dummy/config/routes.rb
214
+ - spec/dummy/db/schema.rb
215
+ - spec/dummy/public/404.html
216
+ - spec/dummy/public/422.html
217
+ - spec/dummy/public/500.html
218
+ - spec/dummy/public/favicon.ico
219
+ - spec/dummy/script/rails
220
+ - spec/factories/redirect_rules.rb
221
+ - spec/factories/request_environment_rules.rb
222
+ - spec/features/middleware_spec.rb
223
+ - spec/models/redirect_rule_spec.rb
224
+ - spec/models/request_environment_rule_spec.rb
225
+ - spec/spec_helper.rb
226
+ homepage: https://github.com/vigetlabs/redirector
227
+ licenses: []
228
+ metadata: {}
229
+ post_install_message:
230
+ rdoc_options: []
231
+ require_paths:
232
+ - lib
233
+ required_ruby_version: !ruby/object:Gem::Requirement
234
+ requirements:
235
+ - - ">="
236
+ - !ruby/object:Gem::Version
237
+ version: '0'
238
+ required_rubygems_version: !ruby/object:Gem::Requirement
239
+ requirements:
240
+ - - ">="
241
+ - !ruby/object:Gem::Version
242
+ version: '0'
243
+ requirements: []
244
+ rubyforge_project:
245
+ rubygems_version: 2.5.1
246
+ signing_key:
247
+ specification_version: 4
248
+ summary: A Rails engine that adds a piece of middleware to the top of your middleware
249
+ stack that looks for redirect rules stored in your database and redirects you accordingly.
250
+ test_files:
251
+ - spec/dummy/app/assets/javascripts/application.js
252
+ - spec/dummy/app/assets/stylesheets/application.css
253
+ - spec/dummy/app/controllers/application_controller.rb
254
+ - spec/dummy/app/controllers/news_controller.rb
255
+ - spec/dummy/app/helpers/application_helper.rb
256
+ - spec/dummy/app/views/layouts/application.html.erb
257
+ - spec/dummy/config/application.rb
258
+ - spec/dummy/config/boot.rb
259
+ - spec/dummy/config/database.travis.yml
260
+ - spec/dummy/config/database.yml.example
261
+ - spec/dummy/config/environment.rb
262
+ - spec/dummy/config/environments/development.rb
263
+ - spec/dummy/config/environments/production.rb
264
+ - spec/dummy/config/environments/test.rb
265
+ - spec/dummy/config/initializers/backtrace_silencers.rb
266
+ - spec/dummy/config/initializers/inflections.rb
267
+ - spec/dummy/config/initializers/mime_types.rb
268
+ - spec/dummy/config/initializers/secret_token.rb
269
+ - spec/dummy/config/initializers/session_store.rb
270
+ - spec/dummy/config/initializers/wrap_parameters.rb
271
+ - spec/dummy/config/locales/en.yml
272
+ - spec/dummy/config/routes.rb
273
+ - spec/dummy/config.ru
274
+ - spec/dummy/db/schema.rb
275
+ - spec/dummy/public/404.html
276
+ - spec/dummy/public/422.html
277
+ - spec/dummy/public/500.html
278
+ - spec/dummy/public/favicon.ico
279
+ - spec/dummy/Rakefile
280
+ - spec/dummy/README.rdoc
281
+ - spec/dummy/script/rails
282
+ - spec/factories/redirect_rules.rb
283
+ - spec/factories/request_environment_rules.rb
284
+ - spec/features/middleware_spec.rb
285
+ - spec/models/redirect_rule_spec.rb
286
+ - spec/models/request_environment_rule_spec.rb
287
+ - spec/spec_helper.rb