sbsm 1.2.9 → 1.3.0

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
  SHA1:
3
- metadata.gz: f2a8722212167245c5eeb0f815ce55ab4a8b5f26
4
- data.tar.gz: cb34a3a4e5c55777f7117b11900843af53c37507
3
+ metadata.gz: d4c300971692a328081c6b56bd30d327fdb02252
4
+ data.tar.gz: dcd9b428233ca4fb56e372a76601c8e289a280ac
5
5
  SHA512:
6
- metadata.gz: 08707c20af9d5773bba1402821749678c20faef1802cfdadc42afe9d4e88a1f9f5f9cf98d699b3bb2138e3426c914911191db4f91d49643c4758e8a1803a201f
7
- data.tar.gz: 465218dd2bff67fe3a10d540ef978da1dce9d45c8e5f41b58ff0fb35a8c276948bcd5ce0b47743fb3c550010ca42cbca920599d8cb2d4360b85a2e9a6c9da55d
6
+ metadata.gz: 9100a0913b65ca6f7fc7b3a39cf9f6ecd026a2bc92e785dd4f5a462f20a6212bbcb78509b7391c2a1df67c55d3f6a0354282fd554ff34ceafa393a4e8a228958
7
+ data.tar.gz: b31394abfa5c3ff78f2cdbb640e5fbf7a92c4300dc07969397d5d6d09ffa8f855eefccb5da99d4745bbdea83e950a1bca0cd99270ea6e2bdee568dfce1a36a0e
data/History.txt CHANGED
@@ -1,3 +1,6 @@
1
+ === 1.3.0 / 08.08.2016
2
+ * Add a support to avoid offline mode by CGI.new in test purpose
3
+
1
4
  === 1.2.9 / 20.07.2016
2
5
  * Remove ARGV violation
3
6
 
data/lib/sbsm/cgi.rb CHANGED
@@ -27,6 +27,21 @@ require 'cgi'
27
27
  require 'drb/drb'
28
28
 
29
29
  class CGI
30
+ # Lets satisfy cgi-offline prompt, even if request does not have
31
+ # REQUEST_METHOD. (It must be mostly for test purpose).
32
+ # See http://ruby-doc.org/stdlib-2.3.1/libdoc/cgi/rdoc/CGI.html#method-c-new
33
+ def self.initialize_without_offline_prompt(*args)
34
+ cgi_input = true
35
+ unless ENV.has_key?('REQUEST_METHOD')
36
+ cgi_input = false
37
+ ENV['REQUEST_METHOD'] = 'GET'
38
+ end
39
+ cgi = CGI.new(*args)
40
+ unless cgi_input
41
+ ENV.delete('REQUEST_METHOD')
42
+ end
43
+ cgi
44
+ end
30
45
  module TagMaker
31
46
  def nOE_element_def(element, append = nil)
32
47
  s = <<-END
data/lib/sbsm/request.rb CHANGED
@@ -38,7 +38,7 @@ module SBSM
38
38
  include DRbUndumped
39
39
  attr_reader :cgi
40
40
  def initialize(drb_uri, html_version = "html4", cgiclass = CGI)
41
- @cgi = cgiclass.new(html_version)
41
+ @cgi = CGI.initialize_without_offline_prompt('html4')
42
42
  @drb_uri = drb_uri
43
43
  @thread = nil
44
44
  @request = Apache.request
data/lib/sbsm/session.rb CHANGED
@@ -36,7 +36,7 @@ require 'delegate'
36
36
  module SBSM
37
37
  class Session < SimpleDelegator
38
38
  attr_reader :user, :active_thread, :app, :key, :cookie_input,
39
- :unsafe_input, :valid_input, :request_path
39
+ :unsafe_input, :valid_input, :request_path, :cgi
40
40
  include DRbUndumped
41
41
  PERSISTENT_COOKIE_NAME = "sbsm-persistent-cookie"
42
42
  DEFAULT_FLAVOR = 'sbsm'
@@ -50,7 +50,6 @@ module SBSM
50
50
  CAP_MAX_THRESHOLD = 8
51
51
  MAX_STATES = 4
52
52
  SERVER_NAME = nil
53
- @@cgi = CGI.new('html4')
54
53
  def Session.reset_stats
55
54
  @@stats = {}
56
55
  end
@@ -100,8 +99,7 @@ module SBSM
100
99
  @unknown_user_class = @user.class
101
100
  @variables = {}
102
101
  @mutex = Mutex.new
103
- #ARGV.push('') # satisfy cgi-offline prompt
104
- #@cgi = CGI.new('html4')
102
+ @cgi = CGI.initialize_without_offline_prompt('html4')
105
103
  super(app)
106
104
  end
107
105
  def age(now=Time.now)
@@ -132,9 +130,6 @@ module SBSM
132
130
  @active_thread = nil
133
131
  true
134
132
  end
135
- def cgi
136
- @@cgi
137
- end
138
133
  @@msie_ptrn = /MSIE/
139
134
  @@win_ptrn = /Win/i
140
135
  def client_activex?
@@ -444,7 +439,7 @@ module SBSM
444
439
  self
445
440
  end
446
441
  def to_html
447
- @state.to_html(@@cgi)
442
+ @state.to_html(cgi)
448
443
  rescue DRb::DRbConnError
449
444
  raise
450
445
  rescue StandardError => err
data/lib/sbsm/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module SBSM
2
- VERSION = '1.2.9'
2
+ VERSION = '1.3.0'
3
3
  end
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.2.9
4
+ version: 1.3.0
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: 2016-07-20 00:00:00.000000000 Z
11
+ date: 2016-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack