backports 1.11.0 → 1.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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
@@ -1,4 +1,5 @@
1
1
  ---
2
2
  :major: 1
3
3
  :minor: 11
4
- :patch: 0
4
+ :patch: 1
5
+ :build:
@@ -1,15 +1,15 @@
1
1
  # Generated by jeweler
2
- # DO NOT EDIT THIS FILE
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
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.0"
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-04}
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 :flat_map unless block_given?
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
@@ -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.each do |s|
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.0
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-04 00:00:00 -05:00
12
+ date: 2009-11-13 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies: []
15
15