path_rewrite 0.0.1 → 0.0.2
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 +4 -4
- data/app/controllers/path_rewrite/path_controller.rb +0 -2
- data/app/models/path_rewrite/path_translation.rb +3 -0
- data/config/routes.rb +1 -1
- data/db/migrate/20150618003028_create_path_rewrite_path_translations.rb +2 -0
- data/lib/path_rewrite/configuration.rb +6 -2
- data/lib/path_rewrite/version.rb +1 -1
- data/spec/models/path_rewrite/path_translation_spec.rb +15 -0
- data/spec/routing/routes_spec.rb +17 -0
- data/spec/test_app/db/development.sqlite3 +0 -0
- data/spec/test_app/db/schema.rb +2 -0
- data/spec/test_app/log/development.log +22 -0
- data/spec/test_app/log/test.log +437 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 611389922508364ac291b846224bae90a8ce931a
|
4
|
+
data.tar.gz: 04895ef52d0db6bfcf625bb2b42d968ca70d6b1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65dcfe9f3ff4821d5d26d862036a3c7cf95aa713a4e3b7c3b2de78c2467e210daf24b3472839e2e4b4e7362eb87359b02bba7d0abd370d241c64686c5c1faccc
|
7
|
+
data.tar.gz: 8cb2450da3af1aaf4a9e3877bcdf7e262d9954dfba3445a1f4f66e6ea079d2cbfe907ca6d0b6e045c486aa68e0f1ce91a34c57af297b236eb6a6f813a484dc55
|
data/config/routes.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
PathRewrite::Engine.routes.draw do
|
2
2
|
get "*path", to: "path#rewrite", constraints: -> (req) do
|
3
|
-
PathRewrite.configuration.check_redirect? &&
|
3
|
+
PathRewrite.configuration.check_redirect?(req) &&
|
4
4
|
PathRewrite::PathTranslation.find_by(old_path: "/#{req.params["path"]}").present?
|
5
5
|
end
|
6
6
|
|
@@ -5,10 +5,14 @@ module PathRewrite
|
|
5
5
|
@check_redirect = value
|
6
6
|
end
|
7
7
|
|
8
|
-
def check_redirect?
|
8
|
+
def check_redirect?(request=nil)
|
9
9
|
return @check_redirect unless @check_redirect.respond_to?(:call)
|
10
10
|
|
11
|
-
@check_redirect.
|
11
|
+
if @check_redirect.arity == 0
|
12
|
+
@check_redirect.call
|
13
|
+
else
|
14
|
+
@check_redirect.call request
|
15
|
+
end
|
12
16
|
end
|
13
17
|
|
14
18
|
end
|
data/lib/path_rewrite/version.rb
CHANGED
@@ -0,0 +1,15 @@
|
|
1
|
+
module PathRewrite
|
2
|
+
describe PathTranslation do
|
3
|
+
|
4
|
+
context "validation" do
|
5
|
+
|
6
|
+
before { PathTranslation.create!(old_path: "from", new_path: "to") }
|
7
|
+
|
8
|
+
it "enforces unique FROM path" do
|
9
|
+
expect{PathTranslation.create!(old_path: "from", new_path: "to")}.to raise_error(ActiveRecord::RecordInvalid)
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
data/spec/routing/routes_spec.rb
CHANGED
@@ -4,6 +4,23 @@ describe "routes", :type => :routing do
|
|
4
4
|
|
5
5
|
before { PathRewrite.configuration.check_redirect = true }
|
6
6
|
|
7
|
+
context "check_redirect? is a lambda that accepts a parameter" do
|
8
|
+
|
9
|
+
before do
|
10
|
+
PathRewrite.configuration.check_redirect = -> (request) do
|
11
|
+
expect(request).to be_a ActionDispatch::Request
|
12
|
+
return false # will make the request non-routable by this engine
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
after { PathRewrite.configuration.check_redirect = true }
|
17
|
+
|
18
|
+
it "passes request object to the check_redirect? lambda" do
|
19
|
+
expect(get: "/test").not_to be_routable
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
7
24
|
context "when check_redirect is configured to allow rewrites" do
|
8
25
|
|
9
26
|
context "and a matching route exists" do
|
Binary file
|
data/spec/test_app/db/schema.rb
CHANGED
@@ -119,3 +119,25 @@ ActionController::RoutingError (No route matches [GET] "/some_path"):
|
|
119
119
|
Rendered /Users/mtucker/.rvm/gems/ruby-2.2.2/gems/actionpack-4.2.2/lib/action_dispatch/middleware/templates/routes/_table.html.erb (1.1ms)
|
120
120
|
Rendered /Users/mtucker/.rvm/gems/ruby-2.2.2/gems/actionpack-4.2.2/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.1ms)
|
121
121
|
Rendered /Users/mtucker/.rvm/gems/ruby-2.2.2/gems/actionpack-4.2.2/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb within rescues/layout (67.6ms)
|
122
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
123
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
124
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
125
|
+
[1m[36m (7.0ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
126
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
127
|
+
[1m[36m (0.9ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
128
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
129
|
+
Migrating to CreatePathRewritePathTranslations (20150618003028)
|
130
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
131
|
+
[1m[35m (0.6ms)[0m CREATE TABLE "path_rewrite_path_translations" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "old_path" varchar, "new_path" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
132
|
+
[1m[36m (0.1ms)[0m [1mCREATE INDEX "index_path_rewrite_path_translations_on_old_path" ON "path_rewrite_path_translations" ("old_path")[0m
|
133
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150618003028"]]
|
134
|
+
[1m[36m (1.0ms)[0m [1mcommit transaction[0m
|
135
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
136
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
137
|
+
FROM sqlite_master
|
138
|
+
WHERE name='index_path_rewrite_path_translations_on_old_path' AND type='index'
|
139
|
+
UNION ALL
|
140
|
+
SELECT sql
|
141
|
+
FROM sqlite_temp_master
|
142
|
+
WHERE name='index_path_rewrite_path_translations_on_old_path' AND type='index'
|
143
|
+
[0m
|
data/spec/test_app/log/test.log
CHANGED
@@ -758,3 +758,440 @@ Redirecting /test to /captured from request http://test.host/test
|
|
758
758
|
Redirected to http://test.host/captured
|
759
759
|
Completed 301 Moved Permanently in 1ms (ActiveRecord: 0.1ms)
|
760
760
|
[1m[36m (0.4ms)[0m [1mrollback transaction[0m
|
761
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
762
|
+
[1m[35m (0.2ms)[0m begin transaction
|
763
|
+
[1m[36mPathRewrite::PathTranslation Load (0.2ms)[0m [1mSELECT "path_rewrite_path_translations".* FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = ? LIMIT 1[0m [["old_path", "/test"]]
|
764
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
765
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
766
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
767
|
+
[1m[36mSQL (0.5ms)[0m [1mINSERT INTO "path_rewrite_path_translations" ("old_path", "new_path", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["old_path", "/test"], ["new_path", "/redirected"], ["created_at", "2015-06-25 16:34:23.629564"], ["updated_at", "2015-06-25 16:34:23.629564"]]
|
768
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
769
|
+
[1m[36mPathRewrite::PathTranslation Load (0.2ms)[0m [1mSELECT "path_rewrite_path_translations".* FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = ? LIMIT 1[0m [["old_path", "/test"]]
|
770
|
+
[1m[35m (6.7ms)[0m rollback transaction
|
771
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
772
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
773
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
774
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
775
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
776
|
+
Processing by PathRewrite::PathController#rewrite as HTML
|
777
|
+
Parameters: {"path"=>"non_translated_path"}
|
778
|
+
[1m[35mPathRewrite::PathTranslation Load (0.2ms)[0m SELECT "path_rewrite_path_translations".* FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = ? LIMIT 1 [["old_path", "/non_translated_path"]]
|
779
|
+
Completed 404 Not Found in 1ms (ActiveRecord: 0.2ms)
|
780
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
781
|
+
[1m[35m (0.1ms)[0m begin transaction
|
782
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
783
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "path_rewrite_path_translations" ("old_path", "new_path", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["old_path", "/test"], ["new_path", "/captured"], ["created_at", "2015-06-25 16:34:27.989343"], ["updated_at", "2015-06-25 16:34:27.989343"]]
|
784
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
785
|
+
Processing by PathRewrite::PathController#rewrite as HTML
|
786
|
+
Parameters: {"path"=>"test"}
|
787
|
+
[1m[35mPathRewrite::PathTranslation Load (0.2ms)[0m SELECT "path_rewrite_path_translations".* FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = ? LIMIT 1 [["old_path", "/test"]]
|
788
|
+
Redirecting /test to /captured from request http://test.host/test
|
789
|
+
Redirected to http://test.host/captured
|
790
|
+
Completed 301 Moved Permanently in 2ms (ActiveRecord: 0.2ms)
|
791
|
+
[1m[36m (0.6ms)[0m [1mrollback transaction[0m
|
792
|
+
[1m[35m (0.1ms)[0m begin transaction
|
793
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
794
|
+
[1m[35m (0.1ms)[0m begin transaction
|
795
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
796
|
+
[1m[35m (0.1ms)[0m begin transaction
|
797
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
798
|
+
[1m[35m (0.1ms)[0m begin transaction
|
799
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
800
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
801
|
+
[1m[35m (0.2ms)[0m begin transaction
|
802
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
803
|
+
[1m[35m (0.1ms)[0m begin transaction
|
804
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
805
|
+
[1m[35m (0.1ms)[0m begin transaction
|
806
|
+
[1m[36m (0.2ms)[0m [1mrollback transaction[0m
|
807
|
+
[1m[35m (0.2ms)[0m begin transaction
|
808
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
809
|
+
[1m[35m (0.1ms)[0m begin transaction
|
810
|
+
[1m[36mPathRewrite::PathTranslation Load (0.3ms)[0m [1mSELECT "path_rewrite_path_translations".* FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = ? LIMIT 1[0m [["old_path", "/test"]]
|
811
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
812
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
813
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
814
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "path_rewrite_path_translations" ("old_path", "new_path", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["old_path", "/test"], ["new_path", "/redirected"], ["created_at", "2015-06-25 16:35:45.289267"], ["updated_at", "2015-06-25 16:35:45.289267"]]
|
815
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
816
|
+
[1m[36mPathRewrite::PathTranslation Load (0.1ms)[0m [1mSELECT "path_rewrite_path_translations".* FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = ? LIMIT 1[0m [["old_path", "/test"]]
|
817
|
+
[1m[35m (6.5ms)[0m rollback transaction
|
818
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
819
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
820
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
821
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
822
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
823
|
+
Processing by PathRewrite::PathController#rewrite as HTML
|
824
|
+
Parameters: {"path"=>"non_translated_path"}
|
825
|
+
[1m[35mPathRewrite::PathTranslation Load (0.2ms)[0m SELECT "path_rewrite_path_translations".* FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = ? LIMIT 1 [["old_path", "/non_translated_path"]]
|
826
|
+
Completed 404 Not Found in 1ms (ActiveRecord: 0.2ms)
|
827
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
828
|
+
[1m[35m (0.1ms)[0m begin transaction
|
829
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
830
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "path_rewrite_path_translations" ("old_path", "new_path", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["old_path", "/test"], ["new_path", "/captured"], ["created_at", "2015-06-25 16:35:45.334884"], ["updated_at", "2015-06-25 16:35:45.334884"]]
|
831
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
832
|
+
Processing by PathRewrite::PathController#rewrite as HTML
|
833
|
+
Parameters: {"path"=>"test"}
|
834
|
+
[1m[35mPathRewrite::PathTranslation Load (0.1ms)[0m SELECT "path_rewrite_path_translations".* FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = ? LIMIT 1 [["old_path", "/test"]]
|
835
|
+
Redirecting /test to /captured from request http://test.host/test
|
836
|
+
Redirected to http://test.host/captured
|
837
|
+
Completed 301 Moved Permanently in 2ms (ActiveRecord: 0.1ms)
|
838
|
+
[1m[36m (0.7ms)[0m [1mrollback transaction[0m
|
839
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
840
|
+
[1m[35m (0.1ms)[0m begin transaction
|
841
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
842
|
+
[1m[35m (0.0ms)[0m begin transaction
|
843
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
844
|
+
[1m[35m (0.0ms)[0m begin transaction
|
845
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
846
|
+
[1m[35m (0.0ms)[0m begin transaction
|
847
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
848
|
+
[1m[35m (0.0ms)[0m begin transaction
|
849
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
850
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "path_rewrite_path_translations" ("old_path", "new_path", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["old_path", "/test"], ["new_path", "/captured"], ["created_at", "2015-06-25 16:35:55.901344"], ["updated_at", "2015-06-25 16:35:55.901344"]]
|
851
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
852
|
+
Processing by PathRewrite::PathController#rewrite as HTML
|
853
|
+
Parameters: {"path"=>"test"}
|
854
|
+
[1m[35mPathRewrite::PathTranslation Load (0.1ms)[0m SELECT "path_rewrite_path_translations".* FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = ? LIMIT 1 [["old_path", "/test"]]
|
855
|
+
Redirecting /test to /captured from request http://test.host/test
|
856
|
+
Redirected to http://test.host/captured
|
857
|
+
Completed 301 Moved Permanently in 4ms (ActiveRecord: 0.1ms)
|
858
|
+
[1m[36m (6.5ms)[0m [1mrollback transaction[0m
|
859
|
+
[1m[35m (0.0ms)[0m begin transaction
|
860
|
+
Processing by PathRewrite::PathController#rewrite as HTML
|
861
|
+
Parameters: {"path"=>"non_translated_path"}
|
862
|
+
[1m[36mPathRewrite::PathTranslation Load (0.1ms)[0m [1mSELECT "path_rewrite_path_translations".* FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = ? LIMIT 1[0m [["old_path", "/non_translated_path"]]
|
863
|
+
Completed 404 Not Found in 0ms (ActiveRecord: 0.1ms)
|
864
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
865
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
866
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
867
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "path_rewrite_path_translations" ("old_path", "new_path", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["old_path", "/test"], ["new_path", "/redirected"], ["created_at", "2015-06-25 16:35:55.922878"], ["updated_at", "2015-06-25 16:35:55.922878"]]
|
868
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
869
|
+
[1m[36mPathRewrite::PathTranslation Load (0.0ms)[0m [1mSELECT "path_rewrite_path_translations".* FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = ? LIMIT 1[0m [["old_path", "/test"]]
|
870
|
+
[1m[35m (0.4ms)[0m rollback transaction
|
871
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
872
|
+
[1m[35mPathRewrite::PathTranslation Load (0.1ms)[0m SELECT "path_rewrite_path_translations".* FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = ? LIMIT 1 [["old_path", "/test"]]
|
873
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
874
|
+
[1m[35m (0.0ms)[0m begin transaction
|
875
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
876
|
+
[1m[35m (0.0ms)[0m begin transaction
|
877
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
878
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
879
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
880
|
+
[1m[35m (0.1ms)[0m begin transaction
|
881
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
882
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "path_rewrite_path_translations" ("old_path", "new_path", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["old_path", "/test"], ["new_path", "/redirected"], ["created_at", "2015-06-25 16:45:23.680110"], ["updated_at", "2015-06-25 16:45:23.680110"]]
|
883
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
884
|
+
[1m[35mPathRewrite::PathTranslation Load (0.1ms)[0m SELECT "path_rewrite_path_translations".* FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = ? LIMIT 1 [["old_path", "/test"]]
|
885
|
+
[1m[36m (4.9ms)[0m [1mrollback transaction[0m
|
886
|
+
[1m[35m (0.1ms)[0m begin transaction
|
887
|
+
[1m[36mPathRewrite::PathTranslation Load (0.1ms)[0m [1mSELECT "path_rewrite_path_translations".* FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = ? LIMIT 1[0m [["old_path", "/test"]]
|
888
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
889
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
890
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
891
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
892
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
893
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
894
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
895
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
896
|
+
[1m[35m (0.2ms)[0m begin transaction
|
897
|
+
[1m[36mPathRewrite::PathTranslation Load (0.2ms)[0m [1mSELECT "path_rewrite_path_translations".* FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = ? LIMIT 1[0m [["old_path", "/test"]]
|
898
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
899
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
900
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
901
|
+
[1m[36mSQL (0.5ms)[0m [1mINSERT INTO "path_rewrite_path_translations" ("old_path", "new_path", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["old_path", "/test"], ["new_path", "/redirected"], ["created_at", "2015-06-25 16:45:42.037110"], ["updated_at", "2015-06-25 16:45:42.037110"]]
|
902
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
903
|
+
[1m[36mPathRewrite::PathTranslation Load (0.1ms)[0m [1mSELECT "path_rewrite_path_translations".* FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = ? LIMIT 1[0m [["old_path", "/test"]]
|
904
|
+
[1m[35m (6.5ms)[0m rollback transaction
|
905
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
906
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
907
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
908
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
909
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
910
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
911
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
912
|
+
[1m[35m (0.2ms)[0m begin transaction
|
913
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
914
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
915
|
+
[1m[35m (0.2ms)[0m begin transaction
|
916
|
+
[1m[36m (0.3ms)[0m [1mrollback transaction[0m
|
917
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
918
|
+
[1m[35m (0.1ms)[0m begin transaction
|
919
|
+
[1m[36m (0.2ms)[0m [1mrollback transaction[0m
|
920
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
921
|
+
[1m[35m (0.2ms)[0m begin transaction
|
922
|
+
[1m[36m (0.2ms)[0m [1mrollback transaction[0m
|
923
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
924
|
+
[1m[35m (0.2ms)[0m begin transaction
|
925
|
+
[1m[36m (0.2ms)[0m [1mrollback transaction[0m
|
926
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
927
|
+
[1m[35m (0.1ms)[0m begin transaction
|
928
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
929
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
930
|
+
[1m[35m (0.1ms)[0m begin transaction
|
931
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
932
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
933
|
+
[1m[35m (0.2ms)[0m begin transaction
|
934
|
+
[1m[36m (0.2ms)[0m [1mrollback transaction[0m
|
935
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
936
|
+
[1m[35m (0.2ms)[0m begin transaction
|
937
|
+
[1m[36m (0.2ms)[0m [1mrollback transaction[0m
|
938
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
939
|
+
[1m[35m (0.1ms)[0m begin transaction
|
940
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
941
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
942
|
+
[1m[35m (0.2ms)[0m begin transaction
|
943
|
+
[1m[36m (0.2ms)[0m [1mrollback transaction[0m
|
944
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
945
|
+
[1m[35m (0.2ms)[0m begin transaction
|
946
|
+
[1m[36m (0.2ms)[0m [1mrollback transaction[0m
|
947
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
948
|
+
[1m[35m (0.2ms)[0m begin transaction
|
949
|
+
[1m[36m (0.2ms)[0m [1mrollback transaction[0m
|
950
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
951
|
+
[1m[35m (0.2ms)[0m begin transaction
|
952
|
+
[1m[36m (0.2ms)[0m [1mrollback transaction[0m
|
953
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
954
|
+
[1m[35m (0.2ms)[0m begin transaction
|
955
|
+
[1m[36mPathRewrite::PathTranslation Load (0.3ms)[0m [1mSELECT "path_rewrite_path_translations".* FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = ? LIMIT 1[0m [["old_path", "/test"]]
|
956
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
957
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
958
|
+
[1m[35m (0.2ms)[0m begin transaction
|
959
|
+
[1m[36mPathRewrite::PathTranslation Load (0.2ms)[0m [1mSELECT "path_rewrite_path_translations".* FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = ? LIMIT 1[0m [["old_path", "/test"]]
|
960
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
961
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
962
|
+
[1m[35m (0.1ms)[0m begin transaction
|
963
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
964
|
+
[1m[35mPathRewrite::PathTranslation Exists (0.1ms)[0m SELECT 1 AS one FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = '/test' LIMIT 1
|
965
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "path_rewrite_path_translations" ("old_path", "new_path", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["old_path", "/test"], ["new_path", "/captured"], ["created_at", "2015-06-25 17:12:59.636609"], ["updated_at", "2015-06-25 17:12:59.636609"]]
|
966
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
967
|
+
Processing by PathRewrite::PathController#rewrite as HTML
|
968
|
+
Parameters: {"path"=>"test"}
|
969
|
+
[1m[36mPathRewrite::PathTranslation Load (0.1ms)[0m [1mSELECT "path_rewrite_path_translations".* FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = ? LIMIT 1[0m [["old_path", "/test"]]
|
970
|
+
Redirecting /test to /captured from request http://test.host/test
|
971
|
+
Redirected to http://test.host/captured
|
972
|
+
Completed 301 Moved Permanently in 4ms (ActiveRecord: 0.1ms)
|
973
|
+
[1m[35m (0.4ms)[0m rollback transaction
|
974
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
975
|
+
Processing by PathRewrite::PathController#rewrite as HTML
|
976
|
+
Parameters: {"path"=>"non_translated_path"}
|
977
|
+
[1m[35mPathRewrite::PathTranslation Load (0.1ms)[0m SELECT "path_rewrite_path_translations".* FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = ? LIMIT 1 [["old_path", "/non_translated_path"]]
|
978
|
+
Completed 404 Not Found in 1ms (ActiveRecord: 0.1ms)
|
979
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
980
|
+
[1m[35m (0.0ms)[0m begin transaction
|
981
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
982
|
+
[1m[35m (0.0ms)[0m begin transaction
|
983
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
984
|
+
[1m[35m (0.0ms)[0m begin transaction
|
985
|
+
[1m[36mPathRewrite::PathTranslation Load (0.1ms)[0m [1mSELECT "path_rewrite_path_translations".* FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = ? LIMIT 1[0m [["old_path", "/test"]]
|
986
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
987
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
988
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
989
|
+
[1m[36mPathRewrite::PathTranslation Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = '/test' LIMIT 1[0m
|
990
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "path_rewrite_path_translations" ("old_path", "new_path", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["old_path", "/test"], ["new_path", "/redirected"], ["created_at", "2015-06-25 17:12:59.655604"], ["updated_at", "2015-06-25 17:12:59.655604"]]
|
991
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
992
|
+
[1m[35mPathRewrite::PathTranslation Load (0.0ms)[0m SELECT "path_rewrite_path_translations".* FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = ? LIMIT 1 [["old_path", "/test"]]
|
993
|
+
[1m[36m (0.4ms)[0m [1mrollback transaction[0m
|
994
|
+
[1m[35m (0.0ms)[0m begin transaction
|
995
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
996
|
+
[1m[35m (0.0ms)[0m begin transaction
|
997
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
998
|
+
[1m[35m (0.0ms)[0m begin transaction
|
999
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1000
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1001
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1002
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1003
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1004
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1005
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1006
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
1007
|
+
[1m[35mPathRewrite::PathTranslation Exists (0.1ms)[0m SELECT 1 AS one FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = 'from' LIMIT 1
|
1008
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "path_rewrite_path_translations" ("old_path", "new_path", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["old_path", "from"], ["new_path", "to"], ["created_at", "2015-06-25 17:14:54.847654"], ["updated_at", "2015-06-25 17:14:54.847654"]]
|
1009
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1010
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1011
|
+
[1m[35mPathRewrite::PathTranslation Exists (0.1ms)[0m SELECT 1 AS one FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = 'from' LIMIT 1
|
1012
|
+
[1m[36m (0.0ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m
|
1013
|
+
[1m[35m (0.3ms)[0m rollback transaction
|
1014
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1015
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1016
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
1017
|
+
[1m[35mPathRewrite::PathTranslation Exists (0.1ms)[0m SELECT 1 AS one FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = 'from' LIMIT 1
|
1018
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "path_rewrite_path_translations" ("old_path", "new_path", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["old_path", "from"], ["new_path", "to"], ["created_at", "2015-06-25 17:15:16.824704"], ["updated_at", "2015-06-25 17:15:16.824704"]]
|
1019
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1020
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1021
|
+
[1m[35mPathRewrite::PathTranslation Exists (0.1ms)[0m SELECT 1 AS one FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = 'from' LIMIT 1
|
1022
|
+
[1m[36m (0.0ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m
|
1023
|
+
[1m[35m (0.5ms)[0m rollback transaction
|
1024
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1025
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1026
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
1027
|
+
[1m[35mPathRewrite::PathTranslation Exists (0.1ms)[0m SELECT 1 AS one FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = 'from' LIMIT 1
|
1028
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "path_rewrite_path_translations" ("old_path", "new_path", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["old_path", "from"], ["new_path", "to"], ["created_at", "2015-06-25 17:15:33.705204"], ["updated_at", "2015-06-25 17:15:33.705204"]]
|
1029
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1030
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1031
|
+
[1m[35mPathRewrite::PathTranslation Exists (0.1ms)[0m SELECT 1 AS one FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = 'from' LIMIT 1
|
1032
|
+
[1m[36m (0.0ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m
|
1033
|
+
[1m[35m (0.5ms)[0m rollback transaction
|
1034
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1035
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1036
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1037
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1038
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1039
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1040
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1041
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1042
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1043
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1044
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
1045
|
+
[1m[35mPathRewrite::PathTranslation Exists (0.1ms)[0m SELECT 1 AS one FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = 'from' LIMIT 1
|
1046
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "path_rewrite_path_translations" ("old_path", "new_path", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["old_path", "from"], ["new_path", "to"], ["created_at", "2015-06-25 17:18:06.170025"], ["updated_at", "2015-06-25 17:18:06.170025"]]
|
1047
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1048
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1049
|
+
[1m[35mPathRewrite::PathTranslation Exists (0.1ms)[0m SELECT 1 AS one FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = 'from' LIMIT 1
|
1050
|
+
[1m[36m (0.0ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m
|
1051
|
+
[1m[35m (0.3ms)[0m rollback transaction
|
1052
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1053
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1054
|
+
[1m[36mPathRewrite::PathTranslation Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = '/test' LIMIT 1[0m
|
1055
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "path_rewrite_path_translations" ("old_path", "new_path", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["old_path", "/test"], ["new_path", "/captured"], ["created_at", "2015-06-25 17:18:06.183554"], ["updated_at", "2015-06-25 17:18:06.183554"]]
|
1056
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1057
|
+
Processing by PathRewrite::PathController#rewrite as HTML
|
1058
|
+
Parameters: {"path"=>"test"}
|
1059
|
+
[1m[35mPathRewrite::PathTranslation Load (0.1ms)[0m SELECT "path_rewrite_path_translations".* FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = ? LIMIT 1 [["old_path", "/test"]]
|
1060
|
+
Redirecting /test to /captured from request http://test.host/test
|
1061
|
+
Redirected to http://test.host/captured
|
1062
|
+
Completed 301 Moved Permanently in 4ms (ActiveRecord: 0.1ms)
|
1063
|
+
[1m[36m (0.4ms)[0m [1mrollback transaction[0m
|
1064
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1065
|
+
Processing by PathRewrite::PathController#rewrite as HTML
|
1066
|
+
Parameters: {"path"=>"non_translated_path"}
|
1067
|
+
[1m[36mPathRewrite::PathTranslation Load (0.1ms)[0m [1mSELECT "path_rewrite_path_translations".* FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = ? LIMIT 1[0m [["old_path", "/non_translated_path"]]
|
1068
|
+
Completed 404 Not Found in 0ms (ActiveRecord: 0.1ms)
|
1069
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1070
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1071
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1072
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1073
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1074
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1075
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1076
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1077
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1078
|
+
[1m[36mPathRewrite::PathTranslation Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = '/test' LIMIT 1[0m
|
1079
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "path_rewrite_path_translations" ("old_path", "new_path", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["old_path", "/test"], ["new_path", "/redirected"], ["created_at", "2015-06-25 17:18:06.204942"], ["updated_at", "2015-06-25 17:18:06.204942"]]
|
1080
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1081
|
+
[1m[35mPathRewrite::PathTranslation Load (0.1ms)[0m SELECT "path_rewrite_path_translations".* FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = ? LIMIT 1 [["old_path", "/test"]]
|
1082
|
+
[1m[36m (0.4ms)[0m [1mrollback transaction[0m
|
1083
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1084
|
+
[1m[36mPathRewrite::PathTranslation Load (0.1ms)[0m [1mSELECT "path_rewrite_path_translations".* FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = ? LIMIT 1[0m [["old_path", "/test"]]
|
1085
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1086
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1087
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1088
|
+
[1m[36m (1.2ms)[0m [1mCREATE TABLE "path_rewrite_path_translations" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "old_path" varchar, "new_path" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
1089
|
+
[1m[35m (1.0ms)[0m CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
|
1090
|
+
[1m[36m (0.1ms)[0m [1mselect sqlite_version(*)[0m
|
1091
|
+
[1m[35m (0.8ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
1092
|
+
[1m[36m (0.1ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
1093
|
+
[1m[35m (0.8ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20150618003028')
|
1094
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1095
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1096
|
+
[1m[36mPathRewrite::PathTranslation Load (0.3ms)[0m [1mSELECT "path_rewrite_path_translations".* FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = ? LIMIT 1[0m [["old_path", "/test"]]
|
1097
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1098
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1099
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
1100
|
+
[1m[36mPathRewrite::PathTranslation Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = '/test' LIMIT 1[0m
|
1101
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "path_rewrite_path_translations" ("old_path", "new_path", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["old_path", "/test"], ["new_path", "/redirected"], ["created_at", "2015-06-25 17:28:16.565257"], ["updated_at", "2015-06-25 17:28:16.565257"]]
|
1102
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1103
|
+
[1m[35mPathRewrite::PathTranslation Load (0.0ms)[0m SELECT "path_rewrite_path_translations".* FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = ? LIMIT 1 [["old_path", "/test"]]
|
1104
|
+
[1m[36m (0.5ms)[0m [1mrollback transaction[0m
|
1105
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1106
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1107
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1108
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1109
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1110
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1111
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1112
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1113
|
+
[1m[35mPathRewrite::PathTranslation Exists (0.1ms)[0m SELECT 1 AS one FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = 'from' LIMIT 1
|
1114
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "path_rewrite_path_translations" ("old_path", "new_path", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["old_path", "from"], ["new_path", "to"], ["created_at", "2015-06-25 17:28:16.575342"], ["updated_at", "2015-06-25 17:28:16.575342"]]
|
1115
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1116
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1117
|
+
[1m[35mPathRewrite::PathTranslation Exists (0.1ms)[0m SELECT 1 AS one FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = 'from' LIMIT 1
|
1118
|
+
[1m[36m (0.1ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m
|
1119
|
+
[1m[35m (0.5ms)[0m rollback transaction
|
1120
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1121
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1122
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1123
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1124
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1125
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1126
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1127
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1128
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1129
|
+
Processing by PathRewrite::PathController#rewrite as HTML
|
1130
|
+
Parameters: {"path"=>"non_translated_path"}
|
1131
|
+
[1m[35mPathRewrite::PathTranslation Load (0.1ms)[0m SELECT "path_rewrite_path_translations".* FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = ? LIMIT 1 [["old_path", "/non_translated_path"]]
|
1132
|
+
Completed 404 Not Found in 1ms (ActiveRecord: 0.1ms)
|
1133
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1134
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1135
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
1136
|
+
[1m[35mPathRewrite::PathTranslation Exists (0.1ms)[0m SELECT 1 AS one FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = '/test' LIMIT 1
|
1137
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "path_rewrite_path_translations" ("old_path", "new_path", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["old_path", "/test"], ["new_path", "/captured"], ["created_at", "2015-06-25 17:28:16.596803"], ["updated_at", "2015-06-25 17:28:16.596803"]]
|
1138
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1139
|
+
Processing by PathRewrite::PathController#rewrite as HTML
|
1140
|
+
Parameters: {"path"=>"test"}
|
1141
|
+
[1m[36mPathRewrite::PathTranslation Load (0.0ms)[0m [1mSELECT "path_rewrite_path_translations".* FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = ? LIMIT 1[0m [["old_path", "/test"]]
|
1142
|
+
Redirecting /test to /captured from request http://test.host/test
|
1143
|
+
Redirected to http://test.host/captured
|
1144
|
+
Completed 301 Moved Permanently in 1ms (ActiveRecord: 0.0ms)
|
1145
|
+
[1m[35m (0.5ms)[0m rollback transaction
|
1146
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1147
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1148
|
+
[1m[36mPathRewrite::PathTranslation Load (0.1ms)[0m [1mSELECT "path_rewrite_path_translations".* FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = ? LIMIT 1[0m [["old_path", "/test"]]
|
1149
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1150
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1151
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1152
|
+
[1m[36mPathRewrite::PathTranslation Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = '/test' LIMIT 1[0m
|
1153
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "path_rewrite_path_translations" ("old_path", "new_path", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["old_path", "/test"], ["new_path", "/redirected"], ["created_at", "2015-06-25 17:29:00.402749"], ["updated_at", "2015-06-25 17:29:00.402749"]]
|
1154
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1155
|
+
[1m[35mPathRewrite::PathTranslation Load (0.0ms)[0m SELECT "path_rewrite_path_translations".* FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = ? LIMIT 1 [["old_path", "/test"]]
|
1156
|
+
[1m[36m (6.5ms)[0m [1mrollback transaction[0m
|
1157
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1158
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1159
|
+
[1m[35m (0.5ms)[0m begin transaction
|
1160
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1161
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1162
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1163
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1164
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1165
|
+
[1m[35mPathRewrite::PathTranslation Exists (0.1ms)[0m SELECT 1 AS one FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = 'from' LIMIT 1
|
1166
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "path_rewrite_path_translations" ("old_path", "new_path", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["old_path", "from"], ["new_path", "to"], ["created_at", "2015-06-25 17:29:00.419485"], ["updated_at", "2015-06-25 17:29:00.419485"]]
|
1167
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1168
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1169
|
+
[1m[35mPathRewrite::PathTranslation Exists (0.1ms)[0m SELECT 1 AS one FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = 'from' LIMIT 1
|
1170
|
+
[1m[36m (0.1ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m
|
1171
|
+
[1m[35m (0.4ms)[0m rollback transaction
|
1172
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1173
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1174
|
+
[1m[36mPathRewrite::PathTranslation Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = '/test' LIMIT 1[0m
|
1175
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "path_rewrite_path_translations" ("old_path", "new_path", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["old_path", "/test"], ["new_path", "/captured"], ["created_at", "2015-06-25 17:29:00.430758"], ["updated_at", "2015-06-25 17:29:00.430758"]]
|
1176
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1177
|
+
Processing by PathRewrite::PathController#rewrite as HTML
|
1178
|
+
Parameters: {"path"=>"test"}
|
1179
|
+
[1m[35mPathRewrite::PathTranslation Load (0.1ms)[0m SELECT "path_rewrite_path_translations".* FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = ? LIMIT 1 [["old_path", "/test"]]
|
1180
|
+
Redirecting /test to /captured from request http://test.host/test
|
1181
|
+
Redirected to http://test.host/captured
|
1182
|
+
Completed 301 Moved Permanently in 1ms (ActiveRecord: 0.1ms)
|
1183
|
+
[1m[36m (0.5ms)[0m [1mrollback transaction[0m
|
1184
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1185
|
+
Processing by PathRewrite::PathController#rewrite as HTML
|
1186
|
+
Parameters: {"path"=>"non_translated_path"}
|
1187
|
+
[1m[36mPathRewrite::PathTranslation Load (0.1ms)[0m [1mSELECT "path_rewrite_path_translations".* FROM "path_rewrite_path_translations" WHERE "path_rewrite_path_translations"."old_path" = ? LIMIT 1[0m [["old_path", "/non_translated_path"]]
|
1188
|
+
Completed 404 Not Found in 0ms (ActiveRecord: 0.1ms)
|
1189
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1190
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1191
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1192
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1193
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1194
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1195
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1196
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1197
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: path_rewrite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Tucker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -115,6 +115,7 @@ files:
|
|
115
115
|
- lib/tasks/path_rewrite_tasks.rake
|
116
116
|
- spec/controllers/path_rewrite/path_controller_spec.rb
|
117
117
|
- spec/lib/path_rewrite/configuration_spec.rb
|
118
|
+
- spec/models/path_rewrite/path_translation_spec.rb
|
118
119
|
- spec/rails_helper.rb
|
119
120
|
- spec/rcov_exclude_list.rb
|
120
121
|
- spec/routing/routes_spec.rb
|
@@ -186,6 +187,7 @@ summary: Mountable engine to support dynamic registration of application paths f
|
|
186
187
|
test_files:
|
187
188
|
- spec/controllers/path_rewrite/path_controller_spec.rb
|
188
189
|
- spec/lib/path_rewrite/configuration_spec.rb
|
190
|
+
- spec/models/path_rewrite/path_translation_spec.rb
|
189
191
|
- spec/rails_helper.rb
|
190
192
|
- spec/rcov_exclude_list.rb
|
191
193
|
- spec/routing/routes_spec.rb
|