sbsm 1.6.0 → 1.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b93d9bf6799d6d4acbc8d4b7da58620c38d3f25778ebc6b56362b8c122d563de
4
- data.tar.gz: 9a31b8e5479f81901bbe32ddc555984343750be0cbab2fab46ec26f0713bbc89
3
+ metadata.gz: 5c49aade69c54b5d99fabe38bb3896307a2a5d726629bbb14764c4bcbcee46ce
4
+ data.tar.gz: 76a61fc0932cfd6dd8bfb065e573c0c0b8b62b079235008620f82b2e76f7b4ac
5
5
  SHA512:
6
- metadata.gz: 8787656db28102c2e04512f319007348d5fa2ee39988f2a111718a6c94650b2d1637d5914a87f69ef558a5e167dee190e71985df8c27b97dd16a1708201751a4
7
- data.tar.gz: f6d74035ec0fd830acbd2c599a20434fc674963093d955a220df0a7cbe942dd82dc091f7d71b2e3c62bc283821e3437e8c7d08009513f723baca9a7844230a41
6
+ metadata.gz: 547e0cb68e3454ba50f7a2058fef10c482fdd1cee0454cb3ef6c00e5150718241f6d312464dd88ab1ea6738f1532f2cffc661ef65b2ab8f3c9aabb665c2fe460
7
+ data.tar.gz: 73c7c87eff58a13e476d0222d56b54ee57904e8b7757fe94cc4ca5fc0097828c3c2b88b6ce783cd5163a1886fc09701b83e457d3fe5bd56eaf7619b0b0214be0
@@ -0,0 +1,35 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: Ruby
9
+
10
+ on:
11
+ push:
12
+ branches: [ master ]
13
+ pull_request:
14
+ branches: [ master ]
15
+
16
+ jobs:
17
+ test:
18
+ runs-on: ubuntu-latest
19
+ # Using a matrix fails, because /setup-ruby always invokes bundle install without any additional args
20
+ # Fixed by adding not defining the debugger group in the Gemfile
21
+ strategy:
22
+ fail-fast: false
23
+ matrix:
24
+ os: [ ubuntu]
25
+ ruby: [2.5, 2.6, 2.7, 3.0, 3.1, head]
26
+ continue-on-error: ${{ endsWith(matrix.ruby, 'head') }}
27
+ steps:
28
+ - uses: actions/checkout@v2
29
+ - uses: ruby/setup-ruby@v1
30
+ with:
31
+ ruby-version: ${{ matrix.ruby }}
32
+ bundler-cache: true
33
+
34
+ - name: Run tests via rake
35
+ run: bundle exec rake
data/Gemfile CHANGED
@@ -1,3 +1,4 @@
1
1
  source "https://rubygems.org"
2
+ gem 'net-smtp', require: false
2
3
 
3
4
  gemspec
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ === 1.6.1 / 09.12.2022
2
+
3
+ * Fix Mime-Bug for Davaz.com
4
+
1
5
  === 1.6.0 / 13.06.2020
2
6
 
3
7
  * Remove calls to obsolete taint/untaint methods
data/lib/sbsm/app.rb CHANGED
@@ -93,6 +93,14 @@ module SBSM
93
93
  @@last_session
94
94
  end
95
95
 
96
+ def fix_html_content_type(content_type)
97
+ # davaz.com#50
98
+ if content_type == 'application/xhtml+xml'
99
+ return 'text/html; charset=utf-8'
100
+ end
101
+ return content_type
102
+ end
103
+
96
104
  def call(env) ## mimick sbsm/lib/app.rb
97
105
  request = Rack::Request.new(env)
98
106
  response = Rack::Response.new
@@ -113,6 +121,7 @@ module SBSM
113
121
  mime_type = MimeMagic.by_path(file_name)
114
122
  end
115
123
  mime_type ||= 'text/plain'
124
+ mime_type = fix_html_content_type(mime_type)
116
125
  SBSM.debug "file_name is #{file_name} checkin base #{File.basename(file_name)} MIME #{mime_type}"
117
126
  response.set_header('Content-Type', mime_type)
118
127
  response.write(File.open(file_name, File::RDONLY){|file| file.read})
@@ -129,7 +138,7 @@ module SBSM
129
138
  begin
130
139
  file_name = thru.first
131
140
  raise Errno::ENOENT unless File.exist?(file_name)
132
- response.set_header('Content-Type', MimeMagic.by_extension(File.extname(file_name)).type)
141
+ response.set_header('Content-Type', fix_html_content_type(MimeMagic.by_extension(File.extname(file_name)).type))
133
142
  response.headers['Content-Disposition'] = "#{thru.last}; filename=#{File.basename(file_name)}"
134
143
  response.headers['Content-Length'] = File.size(file_name).to_s
135
144
  response.write(File.open(file_name, File::RDONLY){|file| file.read})
@@ -153,8 +153,8 @@ module SBSM
153
153
  oldpath = File.expand_path("_" << File.basename(grammar_path),
154
154
  File.dirname(grammar_path))
155
155
  src = File.read(grammar_path)
156
- unless(File.exists?(oldpath) && File.read(oldpath)==src)
157
- File.delete(oldpath) if File.exists?(oldpath)
156
+ unless(File.exist?(oldpath) && File.read(oldpath)==src)
157
+ File.delete(oldpath) if File.exist?(oldpath)
158
158
  Parse.generate_parser_from_file_to_file(grammar_path,
159
159
  parser_path, @parser_method, 'SBSM')
160
160
  File.open(oldpath, 'w') { |f| f << src }
data/lib/sbsm/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module SBSM
2
- VERSION = '1.6.0'
2
+ VERSION = '1.6.1'
3
3
  end
data/sbsm.gemspec CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
31
31
  spec.add_development_dependency "rspec"
32
32
  spec.add_development_dependency "flexmock"
33
33
  spec.add_development_dependency "minitest"
34
- spec.add_development_dependency "rdoc"
34
+ spec.add_development_dependency "rdoc", '< 6.0.0'
35
35
  spec.add_development_dependency "simplecov"
36
36
  spec.add_development_dependency "watir"
37
37
  spec.add_development_dependency "watir-webdriver"
@@ -54,7 +54,7 @@ class AppVariantTest < Minitest::Test
54
54
  head '/fr/page/about'
55
55
  assert last_response.ok?
56
56
  assert last_response.body.empty?
57
- assert last_response.headers.keys.index('Content-Type')
57
+ assert last_response.headers.keys.index('content-type')
58
58
  end
59
59
  def test_request_file
60
60
  session_id_mock = '1234'
@@ -72,8 +72,8 @@ class AppVariantTest < Minitest::Test
72
72
  assert_equal(false, last_response.ok?)
73
73
  assert_equal(404, last_response.status)
74
74
  assert (last_response.body.to_s.index(invalid_path))
75
- assert last_response.headers.keys.index('Content-Type')
76
- assert_equal('text/html', last_response.headers['Content-Type'])
75
+ assert last_response.headers.keys.index('content-type')
76
+ assert_equal('text/html', last_response.headers['content-type'])
77
77
  end
78
78
  def test_request_file_with_no_mime_info
79
79
  session_id_mock = '1234'
@@ -92,8 +92,8 @@ class AppVariantTest < Minitest::Test
92
92
  result = get invalid_path, {}, env
93
93
 
94
94
  assert_equal(true, last_response.ok?)
95
- assert last_response.headers.keys.index('Content-Type')
96
- assert_equal('text/plain', last_response.headers['Content-Type'])
95
+ assert last_response.headers.keys.index('content-type')
96
+ assert_equal('text/plain', last_response.headers['content-type'])
97
97
  FileUtils.rm(file_name)
98
98
  end
99
99
  def test_request_file_with_mime_info
@@ -113,8 +113,8 @@ class AppVariantTest < Minitest::Test
113
113
  result = get invalid_path, {}, env
114
114
 
115
115
  assert_equal(true, last_response.ok?)
116
- assert last_response.headers.keys.index('Content-Type')
117
- assert_equal('image/png', last_response.headers['Content-Type'])
116
+ assert last_response.headers.keys.index('content-type')
117
+ assert_equal('image/png', last_response.headers['content-type'])
118
118
  FileUtils.rm(file_name)
119
119
  end
120
120
  end
@@ -72,12 +72,12 @@ module Demo
72
72
  PERSISTENT_COOKIE_NAME = 'CustomizedSession-cookie'
73
73
  LOOKANDFEEL = CustomLookandfeel
74
74
 
75
- def initialize(args)
75
+ def initialize(*args, **keyword_args)
76
76
  SBSM.debug "session args #{args}"
77
77
  @@active_stated_visited = false
78
78
  @@login_visited = false
79
79
  @@visited_init = true
80
- super(args)
80
+ super(*args, **keyword_args)
81
81
  end
82
82
 
83
83
  def flavor
@@ -231,7 +231,7 @@ class CustomizedAppSessionValidatorLnf < Minitest::Test
231
231
  end
232
232
  assert last_response.ok?
233
233
  # TEST_COOKIE_NAME set via param to app
234
- cookie = last_response.get_header('Set-Cookie').split("\n").find_all{|x| x.index(my_cookey_name)}
234
+ cookie = last_response.get_header('Set-Cookie')[0].split("\n").find_all{|x| x.index(my_cookey_name)}
235
235
  skip ('TODO: We should test test_customized_cookie_name')
236
236
  assert_equal 1, cookie.size
237
237
  assert_match my_cookey_name, cookie.first
@@ -249,7 +249,7 @@ class CustomizedAppCookieName < Minitest::Test
249
249
  get '/' do
250
250
  end
251
251
  assert last_response.ok?
252
- cookie = last_response.get_header('Set-Cookie').split("\n").find_all{|x| x.index(Demo::DEMO_PERSISTENT_COOKIE_NAME)}
252
+ cookie = last_response.get_header('Set-Cookie')[0].split("\n").find_all{|x| x.index(Demo::DEMO_PERSISTENT_COOKIE_NAME)}
253
253
  skip ('TODO: We should test test_customized_cookie_name')
254
254
  assert_equal 1, cookie.size
255
255
  assert_match Demo::DEMO_PERSISTENT_COOKIE_NAME, cookie.first
@@ -115,10 +115,10 @@ class StubSessionWithView < SBSM::Session
115
115
  attr_writer :lookandfeel, :persistent_user_input
116
116
  attr_writer :active_state
117
117
  public :active_state
118
- def initialize(args)
119
- args[:app] ||= StubSessionApp.new
120
- args[:validator] ||= StubSessionValidator.new
121
- super(args)
118
+ def initialize(*args, **kwargs)
119
+ kwargs[:app] ||= StubSessionApp.new
120
+ kwargs[:validator] ||= StubSessionValidator.new
121
+ super(*args, **kwargs)
122
122
  persistent_user_input = {}
123
123
  end
124
124
  end
@@ -117,7 +117,7 @@ EOS
117
117
  request = fake_request_for_path '/shortcut'
118
118
  # run in safe-mode
119
119
  Thread.new {
120
- $SAFE = 1
120
+ # $SAFE = 1
121
121
  TransHandler.instance.translate_uri(request)
122
122
  }.join
123
123
  assert_equal({'shortcut' => 'variables'}, request.params)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sbsm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masaomi Hatakeyama, Zeno R.R. Davatz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-16 00:00:00.000000000 Z
11
+ date: 2022-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -154,16 +154,16 @@ dependencies:
154
154
  name: rdoc
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - ">="
157
+ - - "<"
158
158
  - !ruby/object:Gem::Version
159
- version: '0'
159
+ version: 6.0.0
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - ">="
164
+ - - "<"
165
165
  - !ruby/object:Gem::Version
166
- version: '0'
166
+ version: 6.0.0
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: simplecov
169
169
  requirement: !ruby/object:Gem::Requirement
@@ -254,8 +254,8 @@ executables: []
254
254
  extensions: []
255
255
  extra_rdoc_files: []
256
256
  files:
257
+ - ".github/workflows/ruby.yml"
257
258
  - ".gitignore"
258
- - ".travis.yml"
259
259
  - Gemfile
260
260
  - History.txt
261
261
  - LICENCE.txt
@@ -331,7 +331,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
331
331
  - !ruby/object:Gem::Version
332
332
  version: '0'
333
333
  requirements: []
334
- rubygems_version: 3.1.2
334
+ rubygems_version: 3.2.3
335
335
  signing_key:
336
336
  specification_version: 4
337
337
  summary: Application framework for state based session management from ywesee
data/.travis.yml DELETED
@@ -1,21 +0,0 @@
1
- ---
2
- language: ruby
3
-
4
- notifications:
5
- email:
6
- - ngiger@ywesee.com
7
-
8
- cache: bundler
9
-
10
- before_install:
11
- - gem --version
12
- - bundle config set without 'debugger'
13
-
14
- rvm:
15
- - 2.7.1
16
- - 2.5.0
17
- - ruby-head
18
- matrix:
19
- allow_failures:
20
- - rvm: ruby-head
21
- - rvm: 2.5.0 # Test for LogLevel does not work