ruby-backports 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  == VERSION
4
4
 
5
- This documentation refers to ruby-backports version 0.0.1
5
+ This documentation refers to ruby-backports version 0.0.2
6
6
 
7
7
 
8
8
  == DESCRIPTION
data/lib/backports/dir.rb CHANGED
@@ -3,11 +3,13 @@ class Dir
3
3
  class << self
4
4
 
5
5
  if RUBY_RELEASE_DATE < '2007-02-15'
6
- alias_method :_backports_original_brackets, :[]
6
+ unless method_defined?(:_backports_original_brackets)
7
+ alias_method :_backports_original_brackets, :[]
7
8
 
8
- # r11748 -- can now take many patterns
9
- def [](*args)
10
- args.map { |arg| _backports_original_brackets(arg) }.flatten
9
+ # r11748 -- can now take many patterns
10
+ def [](*args)
11
+ args.map { |arg| _backports_original_brackets(arg) }.flatten
12
+ end
11
13
  end
12
14
  end
13
15
 
@@ -3,19 +3,21 @@ require 'tempfile'
3
3
  class Tempfile
4
4
 
5
5
  if RUBY_RELEASE_DATE < '2007-10-05'
6
- alias_method :_backports_original_make_tmpname, :make_tmpname
6
+ unless method_defined?(:_backports_original_make_tmpname)
7
+ alias_method :_backports_original_make_tmpname, :make_tmpname
7
8
 
8
- # r13631 -- Allow to specify a suffix for a temporary file name. Make
9
- # temporary file names less predictable by including a random string.
10
- def make_tmpname(basename, name)
11
- case basename
12
- when Array
13
- prefix, suffix = *basename
14
- else
15
- prefix, suffix = basename, ''
16
- end
9
+ # r13631 -- Allow to specify a suffix for a temporary file name. Make
10
+ # temporary file names less predictable by including a random string.
11
+ def make_tmpname(basename, name)
12
+ case basename
13
+ when Array
14
+ prefix, suffix = *basename
15
+ else
16
+ prefix, suffix = basename, ''
17
+ end
17
18
 
18
- "#{prefix}#{Time.now.strftime('%Y%m%d')}-#{$$}-#{rand(0x100000000).to_s(36)}-#{name}#{suffix}"
19
+ "#{prefix}#{Time.now.strftime('%Y%m%d')}-#{$$}-#{rand(0x100000000).to_s(36)}-#{name}#{suffix}"
20
+ end
19
21
  end
20
22
  end
21
23
 
@@ -4,7 +4,7 @@ module Backports
4
4
 
5
5
  MAJOR = 0
6
6
  MINOR = 0
7
- TINY = 1
7
+ TINY = 2
8
8
 
9
9
  class << self
10
10
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-backports
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jens Wille