backports 1.11.0 → 1.11.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +1 -1
- data/Rakefile +4 -4
- data/VERSION.yml +2 -1
- data/backports.gemspec +5 -4
- data/lib/backports/1.8.7/string.rb +3 -0
- data/lib/backports/1.9/enumerable.rb +1 -1
- data/lib/backports/1.9/string.rb +1 -1
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -69,7 +69,6 @@ Additionally, the following Ruby 1.9 have been backported:
|
|
69
69
|
|
70
70
|
* Enumerator
|
71
71
|
* +new+ (with block)
|
72
|
-
* +flat_map+, +collect_concat+
|
73
72
|
|
74
73
|
* File
|
75
74
|
* +binread+
|
@@ -85,6 +84,7 @@ Additionally, the following Ruby 1.9 have been backported:
|
|
85
84
|
|
86
85
|
* Object
|
87
86
|
* +define_singleton_method+
|
87
|
+
* +flat_map+, +collect_concat+
|
88
88
|
* +public_method+
|
89
89
|
* +public_send+
|
90
90
|
* <tt>respond_to_missing?</tt>
|
data/Rakefile
CHANGED
@@ -21,11 +21,11 @@ begin
|
|
21
21
|
'--line-numbers' << '--inline-source'
|
22
22
|
|
23
23
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
24
|
+
Jeweler::GemcutterTasks.new
|
25
|
+
end
|
26
|
+
Jeweler::RubyforgeTasks.new do |rubyforge|
|
27
|
+
rubyforge.doc_task = "rdoc"
|
24
28
|
end
|
25
|
-
Jeweler::GemcutterTasks.new
|
26
|
-
# Jeweler::RubyforgeTasks.new do |rubyforge|
|
27
|
-
# rubyforge.doc_task = "rdoc"
|
28
|
-
# end
|
29
29
|
rescue LoadError
|
30
30
|
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
31
31
|
end
|
data/VERSION.yml
CHANGED
data/backports.gemspec
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{backports}
|
8
|
-
s.version = "1.11.
|
8
|
+
s.version = "1.11.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{2009-11-
|
12
|
+
s.date = %q{2009-11-13}
|
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}
|
@@ -125,3 +125,4 @@ Gem::Specification.new do |s|
|
|
125
125
|
else
|
126
126
|
end
|
127
127
|
end
|
128
|
+
|
@@ -9,6 +9,9 @@ class String
|
|
9
9
|
|
10
10
|
Backports.make_block_optional self, :each_byte, :each_line, :test_on => "abc"
|
11
11
|
|
12
|
+
# Standard in Ruby 1.8.7+. See official documentation[http://ruby-doc.org/core-1.9/classes/String.html]
|
13
|
+
alias_method :bytes, :each_byte unless method_defined? :bytes
|
14
|
+
|
12
15
|
Backports.make_block_optional self, :each, :test_on => "abc" if "is there still an each?".respond_to? :each
|
13
16
|
|
14
17
|
# gsub: Left alone because of $~, $1, etc... which needs to be "pushed" up one level
|
@@ -43,7 +43,7 @@ module Enumerable
|
|
43
43
|
|
44
44
|
# Standard in Ruby 1.9.2 See official documentation[http://ruby-doc.org/core-1.9/classes/Enumerable.html]
|
45
45
|
def flat_map(&block)
|
46
|
-
return to_enum
|
46
|
+
return to_enum(:flat_map) unless block_given?
|
47
47
|
map(&block).flatten(1)
|
48
48
|
end unless method_defined? :flat_map
|
49
49
|
alias_method :collect_concat, :flat_map unless method_defined? :collect_concat
|
data/lib/backports/1.9/string.rb
CHANGED
@@ -21,7 +21,7 @@ class String
|
|
21
21
|
# Standard in Ruby 1.9. See official documentation[http://ruby-doc.org/core-1.9/classes/String.html]
|
22
22
|
def codepoints
|
23
23
|
return to_enum(:codepoints) unless block_given?
|
24
|
-
each_char
|
24
|
+
each_char do |s|
|
25
25
|
utf8 = s.each_byte.to_a
|
26
26
|
utf8[0] &= 0xff >> utf8.size # clear high bits (1 to 4, depending of number of bytes used)
|
27
27
|
yield utf8.inject{|result, b| (result << 6) + (b & 0x3f) }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: backports
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.11.
|
4
|
+
version: 1.11.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "Marc-Andr\xC3\xA9 Lafortune"
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-11-
|
12
|
+
date: 2009-11-13 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|