Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Proper namespace CoreExtensions and only extend when needed. #5

Merged
merged 1 commit into from

2 participants

@metaskills

So this vs using the top level CoreExtensions namespace.

module RQRCode
  module CoreExtensions #:nodoc:

  end
end

I also made Array#extract_options! not trump existing Array#extract_options! in latest ActiveSupport since it has some additoinal logic in it's implementation.

@whomwah whomwah merged commit 7016b5d into whomwah:master
@whomwah
Owner

Sorry this took so long to merge. Thanks for the patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 27, 2011
  1. @metaskills

    The CoreExtensions module is name-spaced in RQRCode. Also do not defi…

    metaskills authored
    …ne extensions already defined.
This page is out of date. Refresh to see the latest.
View
2  lib/rqrcode/core_ext/array.rb
@@ -1,5 +1,5 @@
require 'rqrcode/core_ext/array/behavior'
class Array #:nodoc:
- include CoreExtensions::Array::Behavior
+ include RQRCode::CoreExtensions::Array::Behavior
end
View
13 lib/rqrcode/core_ext/array/behavior.rb
@@ -1,9 +1,12 @@
-module CoreExtensions #:nodoc:
- module Array #:nodoc:
- module Behavior
- def extract_options!
- last.is_a?(::Hash) ? pop : {}
+module RQRCode
+ module CoreExtensions #:nodoc:
+ module Array #:nodoc:
+ module Behavior
+ def extract_options!
+ last.is_a?(::Hash) ? pop : {}
+ end unless [].respond_to?(:extract_options!)
end
end
end
end
+
View
2  lib/rqrcode/core_ext/integer.rb
@@ -1,5 +1,5 @@
require 'rqrcode/core_ext/integer/bitwise'
class Integer #:nodoc:
- include CoreExtensions::Integer::Bitwise
+ include RQRCode::CoreExtensions::Integer::Bitwise
end
View
14 lib/rqrcode/core_ext/integer/bitwise.rb
@@ -1,9 +1,11 @@
-module CoreExtensions #:nodoc:
- module Integer #:nodoc:
- module Bitwise
- def rszf(count)
- # zero fill right shift
- (self >> count) & ((2 ** ((self.size * 8) - count))-1)
+module RQRCode
+ module CoreExtensions #:nodoc:
+ module Integer #:nodoc:
+ module Bitwise
+ def rszf(count)
+ # zero fill right shift
+ (self >> count) & ((2 ** ((self.size * 8) - count))-1)
+ end
end
end
end
Something went wrong with that request. Please try again.