route_downcaser 1.1.0 → 1.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 80487f0b652b00f07ebcf03598a66e2c03f97540
4
- data.tar.gz: 10c96abacc02b01dbefa2867133a7a6a0460fec1
3
+ metadata.gz: b26ae8faec0db78c6d9c0d42bd00713aa46aaf29
4
+ data.tar.gz: 275a22996315b7ad780ae17189b881cbdf3c084a
5
5
  SHA512:
6
- metadata.gz: f3d0aa4181a49067a556d33b0f3ebf3ddace5e25a0adf4c714b2162f5b34c144191b4139f8d09a8dd7a306e0c5f729bbf43c3840d68c5ffedaa254aac33eaead
7
- data.tar.gz: 3129784c5b341d4aedc92f03cf08a3d5e71614f55acc12b8f293995f005bb982fae5054e11a5f90ceb28cd7b88f4ee074a375bb9424191b38136b90416fa6b4d
6
+ metadata.gz: e7ace53756b3c51d5d0c913f461b85199b18bcc2409834f90134e4d8d4b7aa73a8d47a24a5c1e2e5a5c7170368c01b6e8a89aa7790d3fbde4743edfddc044012
7
+ data.tar.gz: 48b07797685a748f86ac4b94fed2a78f2dcf03210e7e666ad4dbad43022fb0a12c123b9f748a6a6839b19eccfa80c55461a221c9a905f06f837b551ca7503738
data/README.rdoc CHANGED
@@ -100,6 +100,10 @@ All it really does is to take the path and downcase it before dispatching. Query
100
100
 
101
101
  == Changelog
102
102
 
103
+ === 1.1.1
104
+
105
+ Fixed {issue #17}[https://github.com/carstengehling/route_downcaser/issues/17]. Thanks go to {TkiTDO}[https://github.com/TikiTDO]
106
+
103
107
  === 1.1.0
104
108
 
105
109
  Refactored main code and tests for much better structure
@@ -10,8 +10,7 @@ module RouteDowncaser
10
10
 
11
11
  # Don't touch anything, if uri/path is part of exclude_patterns
12
12
  if exclude_patterns_match?(new_env['REQUEST_URI']) or exclude_patterns_match?(new_env['PATH_INFO'])
13
- @app.call(new_env)
14
- return
13
+ return @app.call(new_env)
15
14
  end
16
15
 
17
16
  # Downcase request_uri and/or path_info if applicable
@@ -1,3 +1,3 @@
1
1
  module RouteDowncaser
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
@@ -4433,3 +4433,228 @@ RouteDowncaserTest::RedirectTrueExcludePatternsTests: test_when_redirect_is_true
4433
4433
  --------------------------------------------------------------------------------------------------------------------------------------------
4434
4434
  RouteDowncaserTest::RedirectTrueExcludePatternsTests: test_when_redirect_is_true_it_does_not_redirect,_if_REQUEST_URI_match_exclude_patterns
4435
4435
  --------------------------------------------------------------------------------------------------------------------------------------------
4436
+ ------------------------------------------------------------------------------------------------------------------------------------------
4437
+ RouteDowncaserTest::RedirectTrueExcludePatternsTests: test_when_redirect_is_true_it_does_not_redirect,_if_PATH_INFO_match_exclude_patterns
4438
+ ------------------------------------------------------------------------------------------------------------------------------------------
4439
+ --------------------------------------------------------------------------------------------------------------------------------------------
4440
+ RouteDowncaserTest::RedirectTrueExcludePatternsTests: test_when_redirect_is_true_it_does_not_redirect,_if_REQUEST_URI_match_exclude_patterns
4441
+ --------------------------------------------------------------------------------------------------------------------------------------------
4442
+ ------------------------------------------------------------------------------------------------------
4443
+ RouteDowncaserTest::ExcludePatternsTests: test_when_PATH_INFO_is_found_in_exclude_patterns,_do_nothing
4444
+ ------------------------------------------------------------------------------------------------------
4445
+ --------------------------------------------------------------------------------------------------------
4446
+ RouteDowncaserTest::ExcludePatternsTests: test_when_REQUEST_URI_is_found_in_exclude_patterns,_do_nothing
4447
+ --------------------------------------------------------------------------------------------------------
4448
+ -------------------------------------------------------------
4449
+ RouteMiddlewareTest: test_Middleware_is_installed_and_working
4450
+ -------------------------------------------------------------
4451
+ Started GET "/HELLO/WORLD" for 127.0.0.1 at 2015-05-28 05:40:11 +0200
4452
+ Processing by HelloController#world as HTML
4453
+ Rendered text template (0.0ms)
4454
+ Completed 200 OK in 4ms (Views: 3.5ms)
4455
+ -----------------------------------------------------------------------
4456
+ RouteDowncaserTest::BasicTests: test_REQUEST_URI_path-part_is_downcased
4457
+ -----------------------------------------------------------------------
4458
+ ---------------------------------------------------------------------------------------
4459
+ RouteDowncaserTest::BasicTests: test_REQUEST_URI_querystring_parameters_are_not_touched
4460
+ ---------------------------------------------------------------------------------------
4461
+ ------------------------------------------------------------------
4462
+ RouteDowncaserTest::BasicTests: test_entire_PATH_INFO_is_downcased
4463
+ ------------------------------------------------------------------
4464
+ ----------------------------------------------------------------------------------------
4465
+ RouteDowncaserTest::RedirectTrueTests: test_when_redirect_is_true_it_redirects_PATH_INFO
4466
+ ----------------------------------------------------------------------------------------
4467
+ ------------------------------------------------------------------------------------------
4468
+ RouteDowncaserTest::RedirectTrueTests: test_when_redirect_is_true_it_redirects_REQUEST_URI
4469
+ ------------------------------------------------------------------------------------------
4470
+ ------------------------------------------------------------------------------------------------------------------------------------------
4471
+ RouteDowncaserTest::RedirectTrueExcludePatternsTests: test_when_redirect_is_true_it_does_not_redirect,_if_PATH_INFO_match_exclude_patterns
4472
+ ------------------------------------------------------------------------------------------------------------------------------------------
4473
+ --------------------------------------------------------------------------------------------------------------------------------------------
4474
+ RouteDowncaserTest::RedirectTrueExcludePatternsTests: test_when_redirect_is_true_it_does_not_redirect,_if_REQUEST_URI_match_exclude_patterns
4475
+ --------------------------------------------------------------------------------------------------------------------------------------------
4476
+ -------------------------------------------------------------
4477
+ RouteMiddlewareTest: test_Middleware_is_installed_and_working
4478
+ -------------------------------------------------------------
4479
+ Started GET "/HELLO/WORLD" for 127.0.0.1 at 2015-05-28 05:50:41 +0200
4480
+ Processing by HelloController#world as HTML
4481
+ Rendered text template (0.0ms)
4482
+ Completed 200 OK in 7ms (Views: 6.3ms)
4483
+ -----------------------------------------------------------------------
4484
+ RouteDowncaserTest::BasicTests: test_REQUEST_URI_path-part_is_downcased
4485
+ -----------------------------------------------------------------------
4486
+ ---------------------------------------------------------------------------------------
4487
+ RouteDowncaserTest::BasicTests: test_REQUEST_URI_querystring_parameters_are_not_touched
4488
+ ---------------------------------------------------------------------------------------
4489
+ ------------------------------------------------------------------
4490
+ RouteDowncaserTest::BasicTests: test_entire_PATH_INFO_is_downcased
4491
+ ------------------------------------------------------------------
4492
+ ------------------------------------------------------------------------------------------------------
4493
+ RouteDowncaserTest::ExcludePatternsTests: test_when_PATH_INFO_is_found_in_exclude_patterns,_do_nothing
4494
+ ------------------------------------------------------------------------------------------------------
4495
+ --------------------------------------------------------------------------------------------------------
4496
+ RouteDowncaserTest::ExcludePatternsTests: test_when_REQUEST_URI_is_found_in_exclude_patterns,_do_nothing
4497
+ --------------------------------------------------------------------------------------------------------
4498
+ ----------------------------------------------------------------------------------------
4499
+ RouteDowncaserTest::RedirectTrueTests: test_when_redirect_is_true_it_redirects_PATH_INFO
4500
+ ----------------------------------------------------------------------------------------
4501
+ ------------------------------------------------------------------------------------------
4502
+ RouteDowncaserTest::RedirectTrueTests: test_when_redirect_is_true_it_redirects_REQUEST_URI
4503
+ ------------------------------------------------------------------------------------------
4504
+ -----------------------------------------------------------------------
4505
+ RouteDowncaserTest::BasicTests: test_REQUEST_URI_path-part_is_downcased
4506
+ -----------------------------------------------------------------------
4507
+ ---------------------------------------------------------------------------------------
4508
+ RouteDowncaserTest::BasicTests: test_REQUEST_URI_querystring_parameters_are_not_touched
4509
+ ---------------------------------------------------------------------------------------
4510
+ ------------------------------------------------------------------
4511
+ RouteDowncaserTest::BasicTests: test_entire_PATH_INFO_is_downcased
4512
+ ------------------------------------------------------------------
4513
+ -------------------------------------------------
4514
+ RouteDowncaserTest::BasicTests: test_return_value
4515
+ -------------------------------------------------
4516
+ -------------------------------------------------------------
4517
+ RouteMiddlewareTest: test_Middleware_is_installed_and_working
4518
+ -------------------------------------------------------------
4519
+ Started GET "/HELLO/WORLD" for 127.0.0.1 at 2015-05-28 05:58:12 +0200
4520
+ Processing by HelloController#world as HTML
4521
+ Rendered text template (0.0ms)
4522
+ Completed 200 OK in 3ms (Views: 3.2ms)
4523
+ ------------------------------------------------------------------------------------------------------------------------------------------
4524
+ RouteDowncaserTest::RedirectTrueExcludePatternsTests: test_when_redirect_is_true_it_does_not_redirect,_if_PATH_INFO_match_exclude_patterns
4525
+ ------------------------------------------------------------------------------------------------------------------------------------------
4526
+ --------------------------------------------------------------------------------------------------------------------------------------------
4527
+ RouteDowncaserTest::RedirectTrueExcludePatternsTests: test_when_redirect_is_true_it_does_not_redirect,_if_REQUEST_URI_match_exclude_patterns
4528
+ --------------------------------------------------------------------------------------------------------------------------------------------
4529
+ ----------------------------------------------------------------------------------------
4530
+ RouteDowncaserTest::RedirectTrueTests: test_when_redirect_is_true_it_redirects_PATH_INFO
4531
+ ----------------------------------------------------------------------------------------
4532
+ ------------------------------------------------------------------------------------------
4533
+ RouteDowncaserTest::RedirectTrueTests: test_when_redirect_is_true_it_redirects_REQUEST_URI
4534
+ ------------------------------------------------------------------------------------------
4535
+ ------------------------------------------------------------------------------------------------------
4536
+ RouteDowncaserTest::ExcludePatternsTests: test_when_PATH_INFO_is_found_in_exclude_patterns,_do_nothing
4537
+ ------------------------------------------------------------------------------------------------------
4538
+ --------------------------------------------------------------------------------------------------------
4539
+ RouteDowncaserTest::ExcludePatternsTests: test_when_REQUEST_URI_is_found_in_exclude_patterns,_do_nothing
4540
+ --------------------------------------------------------------------------------------------------------
4541
+ ----------------------------------------------------------------------------------------
4542
+ RouteDowncaserTest::RedirectTrueTests: test_when_redirect_is_true_it_redirects_PATH_INFO
4543
+ ----------------------------------------------------------------------------------------
4544
+ ------------------------------------------------------------------------------------------
4545
+ RouteDowncaserTest::RedirectTrueTests: test_when_redirect_is_true_it_redirects_REQUEST_URI
4546
+ ------------------------------------------------------------------------------------------
4547
+ -------------------------------------------------------------
4548
+ RouteMiddlewareTest: test_Middleware_is_installed_and_working
4549
+ -------------------------------------------------------------
4550
+ Started GET "/HELLO/WORLD" for 127.0.0.1 at 2015-05-28 06:04:01 +0200
4551
+ Processing by HelloController#world as HTML
4552
+ Rendered text template (0.0ms)
4553
+ Completed 200 OK in 6ms (Views: 5.9ms)
4554
+ -----------------------------------------------------------------------
4555
+ RouteDowncaserTest::BasicTests: test_REQUEST_URI_path-part_is_downcased
4556
+ -----------------------------------------------------------------------
4557
+ ---------------------------------------------------------------------------------------
4558
+ RouteDowncaserTest::BasicTests: test_REQUEST_URI_querystring_parameters_are_not_touched
4559
+ ---------------------------------------------------------------------------------------
4560
+ ------------------------------------------------------------------
4561
+ RouteDowncaserTest::BasicTests: test_entire_PATH_INFO_is_downcased
4562
+ ------------------------------------------------------------------
4563
+ -----------------------------------------------------------------------------------
4564
+ RouteDowncaserTest::BasicTests: test_the_call_environment_should_always_be_returned
4565
+ -----------------------------------------------------------------------------------
4566
+ ------------------------------------------------------------------------------------------------------------------------------------------
4567
+ RouteDowncaserTest::RedirectTrueExcludePatternsTests: test_when_redirect_is_true_it_does_not_redirect,_if_PATH_INFO_match_exclude_patterns
4568
+ ------------------------------------------------------------------------------------------------------------------------------------------
4569
+ --------------------------------------------------------------------------------------------------------------------------------------------
4570
+ RouteDowncaserTest::RedirectTrueExcludePatternsTests: test_when_redirect_is_true_it_does_not_redirect,_if_REQUEST_URI_match_exclude_patterns
4571
+ --------------------------------------------------------------------------------------------------------------------------------------------
4572
+ ---------------------------------------------------------------------------------------------
4573
+ RouteDowncaserTest::ExcludePatternsTests: test_the_call_environment_should_always_be_returned
4574
+ ---------------------------------------------------------------------------------------------
4575
+ ------------------------------------------------------------------------------------------------------
4576
+ RouteDowncaserTest::ExcludePatternsTests: test_when_PATH_INFO_is_found_in_exclude_patterns,_do_nothing
4577
+ ------------------------------------------------------------------------------------------------------
4578
+ --------------------------------------------------------------------------------------------------------
4579
+ RouteDowncaserTest::ExcludePatternsTests: test_when_REQUEST_URI_is_found_in_exclude_patterns,_do_nothing
4580
+ --------------------------------------------------------------------------------------------------------
4581
+ ------------------------------------------------------------------------------------------------------------------------------------------
4582
+ RouteDowncaserTest::RedirectTrueExcludePatternsTests: test_when_redirect_is_true_it_does_not_redirect,_if_PATH_INFO_match_exclude_patterns
4583
+ ------------------------------------------------------------------------------------------------------------------------------------------
4584
+ --------------------------------------------------------------------------------------------------------------------------------------------
4585
+ RouteDowncaserTest::RedirectTrueExcludePatternsTests: test_when_redirect_is_true_it_does_not_redirect,_if_REQUEST_URI_match_exclude_patterns
4586
+ --------------------------------------------------------------------------------------------------------------------------------------------
4587
+ ---------------------------------------------------------------------------------------------
4588
+ RouteDowncaserTest::ExcludePatternsTests: test_the_call_environment_should_always_be_returned
4589
+ ---------------------------------------------------------------------------------------------
4590
+ ------------------------------------------------------------------------------------------------------
4591
+ RouteDowncaserTest::ExcludePatternsTests: test_when_PATH_INFO_is_found_in_exclude_patterns,_do_nothing
4592
+ ------------------------------------------------------------------------------------------------------
4593
+ --------------------------------------------------------------------------------------------------------
4594
+ RouteDowncaserTest::ExcludePatternsTests: test_when_REQUEST_URI_is_found_in_exclude_patterns,_do_nothing
4595
+ --------------------------------------------------------------------------------------------------------
4596
+ ----------------------------------------------------------------------------------------
4597
+ RouteDowncaserTest::RedirectTrueTests: test_when_redirect_is_true_it_redirects_PATH_INFO
4598
+ ----------------------------------------------------------------------------------------
4599
+ ------------------------------------------------------------------------------------------
4600
+ RouteDowncaserTest::RedirectTrueTests: test_when_redirect_is_true_it_redirects_REQUEST_URI
4601
+ ------------------------------------------------------------------------------------------
4602
+ -----------------------------------------------------------------------
4603
+ RouteDowncaserTest::BasicTests: test_REQUEST_URI_path-part_is_downcased
4604
+ -----------------------------------------------------------------------
4605
+ ---------------------------------------------------------------------------------------
4606
+ RouteDowncaserTest::BasicTests: test_REQUEST_URI_querystring_parameters_are_not_touched
4607
+ ---------------------------------------------------------------------------------------
4608
+ ------------------------------------------------------------------
4609
+ RouteDowncaserTest::BasicTests: test_entire_PATH_INFO_is_downcased
4610
+ ------------------------------------------------------------------
4611
+ -----------------------------------------------------------------------------------
4612
+ RouteDowncaserTest::BasicTests: test_the_call_environment_should_always_be_returned
4613
+ -----------------------------------------------------------------------------------
4614
+ -------------------------------------------------------------
4615
+ RouteMiddlewareTest: test_Middleware_is_installed_and_working
4616
+ -------------------------------------------------------------
4617
+ Started GET "/HELLO/WORLD" for 127.0.0.1 at 2015-05-28 06:05:05 +0200
4618
+ Processing by HelloController#world as HTML
4619
+ Rendered text template (0.0ms)
4620
+ Completed 200 OK in 3ms (Views: 2.9ms)
4621
+ -----------------------------------------------------------------------
4622
+ RouteDowncaserTest::BasicTests: test_REQUEST_URI_path-part_is_downcased
4623
+ -----------------------------------------------------------------------
4624
+ ---------------------------------------------------------------------------------------
4625
+ RouteDowncaserTest::BasicTests: test_REQUEST_URI_querystring_parameters_are_not_touched
4626
+ ---------------------------------------------------------------------------------------
4627
+ ------------------------------------------------------------------
4628
+ RouteDowncaserTest::BasicTests: test_entire_PATH_INFO_is_downcased
4629
+ ------------------------------------------------------------------
4630
+ -----------------------------------------------------------------------------------
4631
+ RouteDowncaserTest::BasicTests: test_the_call_environment_should_always_be_returned
4632
+ -----------------------------------------------------------------------------------
4633
+ ------------------------------------------------------------------------------------------------------------------------------------------
4634
+ RouteDowncaserTest::RedirectTrueExcludePatternsTests: test_when_redirect_is_true_it_does_not_redirect,_if_PATH_INFO_match_exclude_patterns
4635
+ ------------------------------------------------------------------------------------------------------------------------------------------
4636
+ --------------------------------------------------------------------------------------------------------------------------------------------
4637
+ RouteDowncaserTest::RedirectTrueExcludePatternsTests: test_when_redirect_is_true_it_does_not_redirect,_if_REQUEST_URI_match_exclude_patterns
4638
+ --------------------------------------------------------------------------------------------------------------------------------------------
4639
+ ---------------------------------------------------------------------------------------------
4640
+ RouteDowncaserTest::ExcludePatternsTests: test_the_call_environment_should_always_be_returned
4641
+ ---------------------------------------------------------------------------------------------
4642
+ ------------------------------------------------------------------------------------------------------
4643
+ RouteDowncaserTest::ExcludePatternsTests: test_when_PATH_INFO_is_found_in_exclude_patterns,_do_nothing
4644
+ ------------------------------------------------------------------------------------------------------
4645
+ --------------------------------------------------------------------------------------------------------
4646
+ RouteDowncaserTest::ExcludePatternsTests: test_when_REQUEST_URI_is_found_in_exclude_patterns,_do_nothing
4647
+ --------------------------------------------------------------------------------------------------------
4648
+ ----------------------------------------------------------------------------------------
4649
+ RouteDowncaserTest::RedirectTrueTests: test_when_redirect_is_true_it_redirects_PATH_INFO
4650
+ ----------------------------------------------------------------------------------------
4651
+ ------------------------------------------------------------------------------------------
4652
+ RouteDowncaserTest::RedirectTrueTests: test_when_redirect_is_true_it_redirects_REQUEST_URI
4653
+ ------------------------------------------------------------------------------------------
4654
+ -------------------------------------------------------------
4655
+ RouteMiddlewareTest: test_Middleware_is_installed_and_working
4656
+ -------------------------------------------------------------
4657
+ Started GET "/HELLO/WORLD" for 127.0.0.1 at 2015-05-28 06:05:20 +0200
4658
+ Processing by HelloController#world as HTML
4659
+ Rendered text template (0.0ms)
4660
+ Completed 200 OK in 4ms (Views: 3.4ms)
@@ -39,6 +39,12 @@ class RouteDowncaserTest < ActiveSupport::TestCase
39
39
  RouteDowncaser::DowncaseRouteMiddleware.new(@app).call(callenv)
40
40
  assert_equal("hello/world", @app.env['PATH_INFO'])
41
41
  end
42
+
43
+ test "the call environment should always be returned" do
44
+ callenv = { 'PATH_INFO' => "HELLO/WORLD" }
45
+ retval = RouteDowncaser::DowncaseRouteMiddleware.new(@app).call(callenv)
46
+ assert_equal({ 'PATH_INFO' => "hello/world" }, retval)
47
+ end
42
48
  end
43
49
 
44
50
 
@@ -62,6 +68,12 @@ class RouteDowncaserTest < ActiveSupport::TestCase
62
68
  RouteDowncaser::DowncaseRouteMiddleware.new(@app).call(callenv)
63
69
  assert_equal("ASSETS/IMAges/SpaceCat.jpeg", @app.env['REQUEST_URI'])
64
70
  end
71
+
72
+ test "the call environment should always be returned" do
73
+ callenv = { 'REQUEST_URI' => "ASSETS/IMAges/SpaceCat.jpeg" }
74
+ retval = RouteDowncaser::DowncaseRouteMiddleware.new(@app).call(callenv)
75
+ assert_equal(callenv, retval)
76
+ end
65
77
  end
66
78
 
67
79
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: route_downcaser
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carsten Gehling
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-11 00:00:00.000000000 Z
11
+ date: 2015-05-28 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: This gem hooks into the Rack middleware of Rails. This way all paths
14
14
  are downcased before dispatching to Rails' routing mechanism. Querystring parameters
@@ -71,17 +71,17 @@ require_paths:
71
71
  - lib
72
72
  required_ruby_version: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - '>='
74
+ - - ">="
75
75
  - !ruby/object:Gem::Version
76
76
  version: '0'
77
77
  required_rubygems_version: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - '>='
79
+ - - ">="
80
80
  - !ruby/object:Gem::Version
81
81
  version: '0'
82
82
  requirements: []
83
83
  rubyforge_project:
84
- rubygems_version: 2.4.5
84
+ rubygems_version: 2.4.7
85
85
  signing_key:
86
86
  specification_version: 4
87
87
  summary: Makes routing in Rails case-insensitive