backports 1.18.0 → 1.18.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +4 -4
- data/VERSION.yml +1 -1
- data/backports.gemspec +2 -2
- data/lib/backports/1.8.7/string.rb +0 -5
- data/lib/backports/1.9.1/string.rb +5 -0
- metadata +4 -4
data/README.rdoc
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
= Backports Library
|
2
2
|
|
3
|
-
* Can't remember if you can use Array#sample?
|
4
|
-
* One of your client is stuck with Ruby 1.8.6 but you want to use a gem using some features of 1.8.7?
|
5
3
|
* Yearning to use some of the new cool features in 1.9.2 while using 1.8.x?
|
4
|
+
* One of your client is stuck with Ruby 1.8.6 but you want to use a gem using some features of 1.8.7?
|
5
|
+
* Can't remember if you can use Array#sample or String#each_char on a friend's box?
|
6
6
|
|
7
7
|
This gem is for you!
|
8
8
|
|
@@ -10,7 +10,7 @@ The goal of 'backports' is to make it easier to write ruby code that runs across
|
|
10
10
|
|
11
11
|
require 'backports'
|
12
12
|
|
13
|
-
|
13
|
+
This will bring Ruby 1.8.6 or 1.8.7 up to date with the upcoming Ruby 1.8.8, as well as include many features of Ruby 1.9.1 and Ruby 1.9.2!
|
14
14
|
|
15
15
|
+Note+: Although I am a Ruby committer, this gem is a personal project and is not endorsed by ruby-core.
|
16
16
|
|
@@ -116,7 +116,7 @@ Finally, most of Ruby 1.9.2 features have been backported:
|
|
116
116
|
* +product+ (with block)
|
117
117
|
* +repeated_combination+, +repeated_permutation+
|
118
118
|
* <tt>sort_by!</tt>
|
119
|
-
* <tt>uniq,
|
119
|
+
* <tt>uniq, uniq!</tt> (with block)
|
120
120
|
|
121
121
|
* Dir
|
122
122
|
* +home+
|
data/VERSION.yml
CHANGED
data/backports.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{backports}
|
8
|
-
s.version = "1.18.
|
8
|
+
s.version = "1.18.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Marc-Andr\303\251 Lafortune"]
|
12
|
-
s.date = %q{2010-06-
|
12
|
+
s.date = %q{2010-06-24}
|
13
13
|
s.description = %q{ Essential backports that enable some of the really nice features of ruby 1.8.7, ruby 1.9 and rails from ruby 1.8.6 and earlier.
|
14
14
|
}
|
15
15
|
s.email = %q{github@marc-andre.ca}
|
@@ -2,11 +2,6 @@ class String
|
|
2
2
|
# Standard in Ruby 1.8.7+. See official documentation[http://ruby-doc.org/core-1.9/classes/String.html]
|
3
3
|
Backports.alias_method self, :bytesize, :length
|
4
4
|
|
5
|
-
# Standard in Ruby 1.8.7+. See official documentation[http://ruby-doc.org/core-1.9/classes/String.html]
|
6
|
-
def chr
|
7
|
-
chars.first
|
8
|
-
end unless method_defined? :chr
|
9
|
-
|
10
5
|
Backports.make_block_optional self, :each_byte, :each_line, :test_on => "abc"
|
11
6
|
|
12
7
|
# Standard in Ruby 1.8.7+. See official documentation[http://ruby-doc.org/core-1.9/classes/String.html]
|
@@ -5,6 +5,11 @@ class String
|
|
5
5
|
!(self =~ /[^\x00-\x7f]/)
|
6
6
|
end unless method_defined? :ascii_only?
|
7
7
|
|
8
|
+
# Standard in Ruby 1.9. See official documentation[http://ruby-doc.org/core-1.9/classes/String.html]
|
9
|
+
def chr
|
10
|
+
chars.first || ""
|
11
|
+
end unless method_defined? :chr
|
12
|
+
|
8
13
|
# Standard in Ruby 1.9. See official documentation[http://ruby-doc.org/core-1.9/classes/String.html]
|
9
14
|
def clear
|
10
15
|
self[0,length] = ""
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: backports
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 93
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 18
|
9
|
-
-
|
10
|
-
version: 1.18.
|
9
|
+
- 1
|
10
|
+
version: 1.18.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- "Marc-Andr\xC3\xA9 Lafortune"
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-06-
|
18
|
+
date: 2010-06-24 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|