egalite 1.5.16 → 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
- ---
2
- SHA1:
3
- data.tar.gz: 06173227f95e00091fff07d444005762da8a09cb
4
- metadata.gz: a1a46e416239922d02970752ecfad422f65d07f4
5
- SHA512:
6
- data.tar.gz: bb7dc40e376c23a3af1ec864bf0a3e56ed2bffd6373ee1190dbb227218559fc46bbdf459ab80d696b81eb3f6149680557f4182eb901e46fc18dac4c031412138
7
- metadata.gz: 09b06a89aacb7a0098d474c82cc7f2b30c00ea6d353ecb35466285f8988c85f894fb7955bccd952f2661d263309ec1719213b5e82d9137a06cc7b8e484e5f160
1
+ ---
2
+ SHA256:
3
+ metadata.gz: a36f8f66154a178a6662295979f6cecc7a4b1b28d8a96af7d189950668063d09
4
+ data.tar.gz: a98099e7e8918e70a8be4b4aa9b52e8137322f720ce3aa9c1667fbf979c60990
5
+ SHA512:
6
+ metadata.gz: 6625fd9dce4ba14e8325083b60dcfd41e85c3d765d1de59895d5e007585ecd35a1b4b284b7c5fd49b5f58ebfd7a3170e83e103ba86e59e3697135bd1c7c50fd1
7
+ data.tar.gz: d199ddadc1282e7d56dd827527f4a13e1628e9070d3ae0ebbb3f2fcfdcead7ca52f11f433cdec4922c5b449d0014952abb3781df4aedc5ec9ef8ec8edce8ed74
data/.gitignore CHANGED
@@ -1,17 +1,17 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- doc/
11
- lib/bundler/man
12
- pkg
13
- rdoc
14
- spec/reports
15
- test/tmp
16
- test/version_tmp
17
- tmp
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in egalite.gemspec
4
- gemspec
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in egalite.gemspec
4
+ gemspec
data/LICENSE.txt CHANGED
@@ -1,22 +1,22 @@
1
- Copyright (c) 2013 Shunichi Arai
2
-
3
- MIT License
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ Copyright (c) 2013 Shunichi Arai
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile CHANGED
@@ -1 +1 @@
1
- require "bundler/gem_tasks"
1
+ require "bundler/gem_tasks"
data/egalite.gemspec CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_development_dependency "bundler", "~> 1.3"
21
+ spec.add_development_dependency "bundler", ">= 2.2.10"
22
22
  spec.add_development_dependency "rake"
23
23
  spec.add_dependency "rack"
24
24
  end
@@ -0,0 +1,22 @@
1
+
2
+ * Egaliteを更新する方法
3
+
4
+ Egaliteを更新する方法を以下に書きます。
5
+
6
+ 必要な修正を加えたら、まずlib/egalite/version.rbを書き換えてバージョン番号を上げます。Gemを差し替えるのにバージョンを上げる必要があるので。
7
+
8
+ 次にgit commit, pushを行います。
9
+
10
+ gem build egalite.gemspec
11
+ を実行するとegalite-x.x.xx.gemが作成されます。
12
+
13
+ https://rubygems.org/api/v1/api_key.yaml
14
+ にアクセスしてgem push用のyamlキーを取得します。rubygemsのアカウント作成については新井に聞いてください。
15
+
16
+ 取得したファイルをcredentialsという名前に変更し、~/.gem/credentialsにコピーします。
17
+
18
+ gem push egalite-x.x.xx.gem
19
+ を実行するとgemがpushされ、gem install / updateなどで取得できるようになります。
20
+
21
+ 利用している側では、gem update, bundle updateなどをしてapacheをreloadすると新しいバージョンを利用することができます。
22
+
@@ -191,10 +191,10 @@ class FormHelper
191
191
  end
192
192
  def radio(name, choice, opts = {})
193
193
  selected = (@data[name] == choice)
194
- selected = (opts[:default] == choice) || opts[:selected] if @data[name] == nil
194
+ selected = (opts[:default] == choice) || opts[:selected] || opts[:checked] if @data[name] == nil
195
195
 
196
196
  attrs = opt_as_hash(opts)
197
- attrs[:selected] = 'selected' if selected
197
+ attrs[:checked] = 'checked' if selected
198
198
  attrs[:name] = expand_name(name)
199
199
  attrs[:value] = choice
200
200
  attrs[:type] = 'radio'
data/lib/egalite/http.rb CHANGED
@@ -11,6 +11,21 @@ module Egalite
11
11
  http.use_ssl = true
12
12
  http.verify_mode = OpenSSL::SSL::VERIFY_NONE
13
13
  end
14
+ if options[:continue_timeout]
15
+ http.continue_timeout = options[:continue_timeout]
16
+ end
17
+ if options[:keep_alive_timeout]
18
+ http.keep_alive_timeout = options[:keep_alive_timeout]
19
+ end
20
+ if options[:open_timeout]
21
+ http.open_timeout = options[:open_timeout]
22
+ end
23
+ if options[:read_timeout]
24
+ http.read_timeout = options[:read_timeout]
25
+ end
26
+ if options[:ssl_timeout]
27
+ http.ssl_timeout = options[:ssl_timeout]
28
+ end
14
29
  [http, uri]
15
30
  end
16
31
  def self.parse_options(options)
@@ -33,8 +33,9 @@ module Sendmail
33
33
  end
34
34
  @force_dkim = false
35
35
  @mock = false
36
+ @override_server = nil
36
37
  class <<self
37
- attr_accessor :mock, :force_dkim
38
+ attr_accessor :mock, :force_dkim, :override_server
38
39
  attr_reader :lastmail
39
40
  def folding(h, s) # folding white space. see RFC5322, section 2.3.3 and 3.2.2.
40
41
  len = 78 - h.size - ": ".size
@@ -233,6 +234,7 @@ module Sendmail
233
234
  end
234
235
  envelope_from = _extract_addrspec(params[:envelope_from] || params[:sender] || params[:from])
235
236
  envelope_from = envelope_from[0] if envelope_from.is_a?(Array)
237
+ host = @override_server if host == 'localhost' and @override_server
236
238
  _send(
237
239
  text,
238
240
  envelope_from,
@@ -1,3 +1,3 @@
1
1
  module Egalite
2
- VERSION = "1.5.16"
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
@@ -203,5 +203,11 @@ EOS
203
203
  assert_match "cGl5bw==", Sendmail.lastmail[0]
204
204
  assert_match "--#{boundary}--", Sendmail.lastmail[0]
205
205
  end
206
+ def test_override_server
207
+ Sendmail.override_server = "example.com"
208
+ Sendmail.send("Hello",:from => "arai@example.com", :to => "to@example.com")
209
+ assert_match "example.com", Sendmail.lastmail[3]
210
+ Sendmail.override_server = nil
211
+ end
206
212
  end
207
213
 
metadata CHANGED
@@ -1,56 +1,65 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: egalite
3
- version: !ruby/object:Gem::Version
4
- version: 1.5.16
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.5.20
5
5
  platform: ruby
6
- authors:
6
+ authors:
7
7
  - Shunichi Arai
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
-
12
- date: 2017-05-08 00:00:00 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
11
+ date: 2022-02-10 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
15
14
  name: bundler
16
- prerelease: false
17
- requirement: &id001 !ruby/object:Gem::Requirement
18
- requirements:
19
- - - ~>
20
- - !ruby/object:Gem::Version
21
- version: "1.3"
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 2.2.10
22
20
  type: :development
23
- version_requirements: *id001
24
- - !ruby/object:Gem::Dependency
25
- name: rake
26
21
  prerelease: false
27
- requirement: &id002 !ruby/object:Gem::Requirement
28
- requirements:
29
- - &id003
30
- - ">="
31
- - !ruby/object:Gem::Version
32
- version: "0"
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 2.2.10
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
33
34
  type: :development
34
- version_requirements: *id002
35
- - !ruby/object:Gem::Dependency
36
- name: rack
37
35
  prerelease: false
38
- requirement: &id004 !ruby/object:Gem::Requirement
39
- requirements:
40
- - *id003
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: rack
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
41
48
  type: :runtime
42
- version_requirements: *id004
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
43
55
  description: Egalite - yet another web application framework. see description at https://github.com/araipiyo/egalite
44
- email:
56
+ email:
45
57
  - arai@mellowtone.co.jp
46
58
  executables: []
47
-
48
59
  extensions: []
49
-
50
60
  extra_rdoc_files: []
51
-
52
- files:
53
- - .gitignore
61
+ files:
62
+ - ".gitignore"
54
63
  - Gemfile
55
64
  - LICENSE.txt
56
65
  - README.md
@@ -62,6 +71,7 @@ files:
62
71
  - examples/simple/run_webrick.rb
63
72
  - examples/simple_db/example_db.rb
64
73
  - examples/simple_db/pages/edit.html
74
+ - how_to_gem_push.md
65
75
  - htmlbuilder.md
66
76
  - lib/egalite.rb
67
77
  - lib/egalite/auth/basic.rb
@@ -125,29 +135,29 @@ files:
125
135
  - test/test_stringify_hash.rb
126
136
  - test/test_template.rb
127
137
  homepage: https://github.com/araipiyo/egalite
128
- licenses:
138
+ licenses:
129
139
  - MIT
130
140
  metadata: {}
131
-
132
141
  post_install_message:
133
142
  rdoc_options: []
134
-
135
- require_paths:
143
+ require_paths:
136
144
  - lib
137
- required_ruby_version: !ruby/object:Gem::Requirement
138
- requirements:
139
- - *id003
140
- required_rubygems_version: !ruby/object:Gem::Requirement
141
- requirements:
142
- - *id003
145
+ required_ruby_version: !ruby/object:Gem::Requirement
146
+ requirements:
147
+ - - ">="
148
+ - !ruby/object:Gem::Version
149
+ version: '0'
150
+ required_rubygems_version: !ruby/object:Gem::Requirement
151
+ requirements:
152
+ - - ">="
153
+ - !ruby/object:Gem::Version
154
+ version: '0'
143
155
  requirements: []
144
-
145
- rubyforge_project:
146
- rubygems_version: 2.4.3
156
+ rubygems_version: 3.0.3
147
157
  signing_key:
148
158
  specification_version: 4
149
159
  summary: Egalite - yet another web application framework.
150
- test_files:
160
+ test_files:
151
161
  - test/cache.html
152
162
  - test/cache_cache.html
153
163
  - test/cache_nocache.html
@@ -176,4 +186,3 @@ test_files:
176
186
  - test/test_session.rb
177
187
  - test/test_stringify_hash.rb
178
188
  - test/test_template.rb
179
- has_rdoc: