egalite 1.5.19 → 1.5.20

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
  SHA256:
3
- metadata.gz: 0a5518c119d01106dbf902bcae84dc6e18241358aef8efc0ac1eae593ef1109a
4
- data.tar.gz: 112bbd3f2874cfa616fe3e802685cda5aac6f60cad32045f3ec2deaa348e8611
3
+ metadata.gz: a36f8f66154a178a6662295979f6cecc7a4b1b28d8a96af7d189950668063d09
4
+ data.tar.gz: a98099e7e8918e70a8be4b4aa9b52e8137322f720ce3aa9c1667fbf979c60990
5
5
  SHA512:
6
- metadata.gz: 4869ffa87129c414c49c6109b349752c2a8fc07d1e6c3f1743bc9bda2b4e6998e80d0c05b386ea07dd7e40bb5b8789e678ac991fc9d1d286d4ae7496c0be07a5
7
- data.tar.gz: 1e32a1f91d17f9e7cb0b61baf89e8498e596dbbeef38673d8c8df39667eeb79f52eb050bd164552a9c0409023ad29d1e7a34efc8f54a181236dba796c2ac557f
6
+ metadata.gz: 6625fd9dce4ba14e8325083b60dcfd41e85c3d765d1de59895d5e007585ecd35a1b4b284b7c5fd49b5f58ebfd7a3170e83e103ba86e59e3697135bd1c7c50fd1
7
+ data.tar.gz: d199ddadc1282e7d56dd827527f4a13e1628e9070d3ae0ebbb3f2fcfdcead7ca52f11f433cdec4922c5b449d0014952abb3781df4aedc5ec9ef8ec8edce8ed74
@@ -1,3 +1,3 @@
1
1
  module Egalite
2
- VERSION = "1.5.19"
2
+ VERSION = "1.5.20"
3
3
  end
data/lib/egalite.rb CHANGED
@@ -459,6 +459,11 @@ class Handler
459
459
  [302,{'Location' => url}, [url]]
460
460
  end
461
461
  def get_controller(controllername,action, method)
462
+ # HTTPメソッドと一致するアクション名は却下する(メソッド名で受け付けるべき)
463
+ # /controller/get みたいな名前でgetがパスパラメータとして渡るべき
464
+ # といいつつ後方互換性を考慮してとりあえずget/postだけ却下
465
+ return nil if %w[get post].include?(action&.downcase)
466
+
462
467
  action = method if action.blank?
463
468
  action.downcase!
464
469
  action.gsub!(/[^0-9a-z_]/,'')
@@ -470,7 +475,8 @@ class Handler
470
475
  controllername ||= ''
471
476
  controllername = controllername.split('/').map { |c|
472
477
  c.downcase!
473
- c.gsub!(/[^0-9a-z]/,'')
478
+ # 英数字以外が含まれるものはコントローラーとはみなさない。
479
+ return nil if c =~ /[^0-9a-z]/
474
480
  c.capitalize
475
481
  }.join
476
482
  controllername = 'Default' if controllername.blank?
data/test/test_helper.rb CHANGED
@@ -205,7 +205,7 @@ class T_FormHelper < Test::Unit::TestCase
205
205
  assert_equal("Foo", i.attributes["value"])
206
206
  assert_equal("radio", i.attributes["type"])
207
207
  assert_equal("foo", i.attributes["name"])
208
- assert_equal("selected", i.attributes["selected"])
208
+ assert_equal("checked", i.attributes["checked"])
209
209
  end
210
210
 
211
211
  def test_radio_should_not_be_checked_if_choice_mismatch
data/test/test_route.rb CHANGED
@@ -188,5 +188,11 @@ class T_Route < Test::Unit::TestCase
188
188
  get "/NoControllerNoAction2"
189
189
  assert last_response.ok?
190
190
  assert last_response.body == "/route/pathtest"
191
+ get "/route/get"
192
+ assert last_response.ok?
193
+ assert last_response.body == "get"
194
+ get "/route/-"
195
+ assert last_response.ok?
196
+ assert last_response.body == "-"
191
197
  end
192
198
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: egalite
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.19
4
+ version: 1.5.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shunichi Arai
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-29 00:00:00.000000000 Z
11
+ date: 2022-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler