sbsm 1.4.6 → 1.4.7

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: 60f4a61bb07708b12676dc908a0de85f373c5b17
4
- data.tar.gz: 496054938b87a49afb78c8269edc3ec77c1e6a19
3
+ metadata.gz: b370d3f21165accf1e116ff96c1f2384093da81f
4
+ data.tar.gz: c6de8a95bfcdca73be4b3115be51bf517c07e16b
5
5
  SHA512:
6
- metadata.gz: 3e048c7a06458e3327852f4a9a9a582fd44a476f8385a491c77352f54da1471de42d59968be3381b583587b097f5b964db12cfc063f50c64aa889a1212c51926
7
- data.tar.gz: a4eb100131a6255fbe1c8fd0448d27ad061d70f3e33f9b5fbaa957f6b235bdfc984dfe74bd81397d55de8df8b320446c8e174f7aad735dae2cfc83cd778a560c
6
+ metadata.gz: 8a398654589315be802f054f274a3be7bb4748241efad88c31b42f49a8b338d4753f1642764fef340fd47057f4e686b43e3b1aa0d2d71105d3407fd5e87af456
7
+ data.tar.gz: 80684c6ae85ea2303de7477d3eb824555971143acf1fe6d79332f0dc912cdf11c8f516ba3b0de53e7cc6a16af9c449271dedd6901ca67cfd7ddf1beed331fd86
@@ -1,3 +1,8 @@
1
+ === 1.4.7 / 26.06.2017
2
+
3
+ * Set the debug logging level to WARN
4
+ * Allow retrieving the sessions from SessionStore
5
+
1
6
  === 1.4.6 / 21.06.2017
2
7
 
3
8
  * Added SessionStore.clear
@@ -108,7 +108,7 @@ module SBSM
108
108
  end
109
109
  if File.file?(file_name)
110
110
  mime_type = MimeMagic.by_extension(File.extname(file_name)).type
111
- SBSM.info "file_name is #{file_name} checkin base #{File.basename(file_name)} MIME #{mime_type}"
111
+ SBSM.debug "file_name is #{file_name} checkin base #{File.basename(file_name)} MIME #{mime_type}"
112
112
  response.set_header('Content-Type', mime_type)
113
113
  response.write(File.open(file_name, File::RDONLY){|file| file.read})
114
114
  return response
@@ -25,7 +25,8 @@
25
25
  require 'chrono_logger'
26
26
  require 'sbsm/version'
27
27
  module SBSM
28
- @@logger = nil
28
+ @@logger = Logger.new(STDERR)
29
+ @@logger.level = Logger::WARN
29
30
  def self.logger=(logger)
30
31
  @@logger = logger
31
32
  end
@@ -110,6 +110,10 @@ module SBSM
110
110
  }
111
111
  #cap_max_sessions(now)
112
112
  end
113
+ def SessionStore.sessions
114
+ @@sessions
115
+ end
116
+
113
117
  def SessionStore.clear
114
118
  @@mutex.synchronize do
115
119
  @@sessions.each_value { |sess| sess.__checkout }
@@ -1,3 +1,3 @@
1
1
  module SBSM
2
- VERSION = '1.4.6'
2
+ VERSION = '1.4.7'
3
3
  end
@@ -120,4 +120,18 @@ class TestLogger < Minitest::Test
120
120
  assert_match(/test_error/, IO.read(@temp_file.path))
121
121
  end
122
122
 
123
+ def test_log_level
124
+ assert_equal(Logger::WARN, SBSM.logger.level)
125
+ SBSM.logger = Logger.new(@temp_file.path, level: Logger::ERROR)
126
+ assert_equal(Logger::ERROR, SBSM.logger.level)
127
+ saved_length = File.size(@temp_file.path)
128
+ assert( !/test_error/.match(IO.read(@temp_file.path)))
129
+ SBSM.error("test_error #{__LINE__}")
130
+ SBSM.logger.level= Logger::WARN
131
+ assert_match(/test_error/, IO.read(@temp_file.path))
132
+ SBSM.info("test_info #{__LINE__}")
133
+ content = IO.read(@temp_file.path)
134
+ assert_nil(/test_info/.match(IO.read(@temp_file.path)))
135
+ end
136
+
123
137
  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.4.6
4
+ version: 1.4.7
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: 2017-06-21 00:00:00.000000000 Z
11
+ date: 2017-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack