webrick 1.4.1 → 1.4.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of webrick might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 92771b52c716236260e264f291a6f7bb76b971726bedff6f4f74d78a723f68f2
4
- data.tar.gz: 3e9530a75e8ec3af8f8d5a607d28a3ff5364febd151a5a226a0647a800eea13f
3
+ metadata.gz: 679fbeaf42fd0e9df98934eacf8573238f0b32a5bdcab66cb6ded69c3031ca8d
4
+ data.tar.gz: 77811219317b65fdbc1a3f703d98dc63c9c6d936ef29775cbef7e1aa1f707007
5
5
  SHA512:
6
- metadata.gz: 1ca3fd8dc657f96e70fb245574b0aece2116c05b1df4d988b906364909b9e1b6357c3f52af5cd31b8d71c4df0ec827bba9ee73de9980c2c70c86c4c9057b7fc7
7
- data.tar.gz: b0f0234b60b6f90db227edc331f9b85316b534c940788f0fe83896e5a3b023a6927416c4633c17255c22c666ccb9a88d52d8435b672349d50d0cb5c6d30825ef
6
+ metadata.gz: 4bce582ecef05a51ae39d331f6cf2a3a1f35bd5bde35ea69be01374ec9dc851a536fbb37ea276d37f137d86d8af2258b0caf34b30dce83f3a79d36e88b2cfefc
7
+ data.tar.gz: 1c4fa49ececffec80b3d3ab8013960379d157202ba4b81959d6bcd91f0dcc978fcc55d60628d2383b8b80c7d1c4ce6b4dc5ca067ea548d0e20ce643d3cb26067
@@ -40,7 +40,7 @@ module WEBrick
40
40
  @digest = Hash.new
41
41
  @mutex = Thread::Mutex::new
42
42
  @auth_type = DigestAuth
43
- open(@path,"a").close unless File::exist?(@path)
43
+ File.open(@path,"a").close unless File.exist?(@path)
44
44
  reload
45
45
  end
46
46
 
@@ -51,7 +51,7 @@ module WEBrick
51
51
  mtime = File::mtime(@path)
52
52
  if mtime > @mtime
53
53
  @digest.clear
54
- open(@path){|io|
54
+ File.open(@path){|io|
55
55
  while line = io.gets
56
56
  line.chomp!
57
57
  user, realm, pass = line.split(/:/, 3)
@@ -36,7 +36,7 @@ module WEBrick
36
36
  @path = path
37
37
  @mtime = Time.at(0)
38
38
  @group = Hash.new
39
- open(@path,"a").close unless File::exist?(@path)
39
+ File.open(@path,"a").close unless File.exist?(@path)
40
40
  reload
41
41
  end
42
42
 
@@ -46,7 +46,7 @@ module WEBrick
46
46
  def reload
47
47
  if (mtime = File::mtime(@path)) > @mtime
48
48
  @group.clear
49
- open(@path){|io|
49
+ File.open(@path){|io|
50
50
  while line = io.gets
51
51
  line.chomp!
52
52
  group, members = line.split(/:\s*/)
@@ -40,7 +40,7 @@ module WEBrick
40
40
  @mtime = Time.at(0)
41
41
  @passwd = Hash.new
42
42
  @auth_type = BasicAuth
43
- open(@path,"a").close unless File::exist?(@path)
43
+ File.open(@path,"a").close unless File.exist?(@path)
44
44
  reload
45
45
  end
46
46
 
@@ -51,7 +51,7 @@ module WEBrick
51
51
  mtime = File::mtime(@path)
52
52
  if mtime > @mtime
53
53
  @passwd.clear
54
- open(@path){|io|
54
+ File.open(@path){|io|
55
55
  while line = io.gets
56
56
  line.chomp!
57
57
  case line
@@ -23,11 +23,11 @@ STDIN.binmode
23
23
 
24
24
  len = sysread(STDIN, 8).to_i
25
25
  out = sysread(STDIN, len)
26
- STDOUT.reopen(open(out, "w"))
26
+ STDOUT.reopen(File.open(out, "w"))
27
27
 
28
28
  len = sysread(STDIN, 8).to_i
29
29
  err = sysread(STDIN, len)
30
- STDERR.reopen(open(err, "w"))
30
+ STDERR.reopen(File.open(err, "w"))
31
31
 
32
32
  len = sysread(STDIN, 8).to_i
33
33
  dump = sysread(STDIN, len)
@@ -53,7 +53,7 @@ module WEBrick
53
53
  raise HTTPStatus::Forbidden, "ERBHandler cannot work."
54
54
  end
55
55
  begin
56
- data = open(@script_filename){|io| io.read }
56
+ data = File.open(@script_filename, &:read)
57
57
  res.body = evaluate(ERB.new(data), req, res)
58
58
  res['content-type'] ||=
59
59
  HTTPUtils::mime_type(@script_filename, @config[:MimeTypes])
@@ -57,7 +57,7 @@ module WEBrick
57
57
  res['content-type'] = mtype
58
58
  res['content-length'] = st.size
59
59
  res['last-modified'] = mtime.httpdate
60
- res.body = open(@local_path, "rb")
60
+ res.body = File.open(@local_path, "rb")
61
61
  end
62
62
  end
63
63
 
@@ -92,7 +92,7 @@ module WEBrick
92
92
  raise HTTPStatus::BadRequest,
93
93
  "Unrecognized range-spec: \"#{req['range']}\""
94
94
  end
95
- open(filename, "rb"){|io|
95
+ File.open(filename, "rb"){|io|
96
96
  if ranges.size > 1
97
97
  time = Time.now
98
98
  boundary = "#{time.sec}_#{time.usec}_#{Process::pid}"
@@ -108,6 +108,8 @@ module WEBrick
108
108
  # Loads Apache-compatible mime.types in +file+.
109
109
 
110
110
  def load_mime_types(file)
111
+ # note: +file+ may be a "| command" for now; some people may
112
+ # rely on this, but currently we do not use this method by default.
111
113
  open(file){ |io|
112
114
  hash = Hash.new
113
115
  io.each{ |line|
@@ -51,7 +51,7 @@ module WEBrick
51
51
  @level = level || INFO
52
52
  case log_file
53
53
  when String
54
- @log = open(log_file, "a+")
54
+ @log = File.open(log_file, "a+")
55
55
  @log.sync = true
56
56
  @opened = true
57
57
  when NilClass
@@ -14,5 +14,5 @@ module WEBrick
14
14
  ##
15
15
  # The WEBrick version
16
16
 
17
- VERSION = "1.4.1"
17
+ VERSION = "1.4.2"
18
18
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webrick
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - TAKAHASHI Masayoshi
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-12-18 00:00:00.000000000 Z
13
+ date: 2017-12-24 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rake