Skip to content

Commit 7016b5d

Browse files
committed
Merge pull request whomwah#5 from metaskills/core_ext
Proper namespace CoreExtensions and only extend when needed.
2 parents f24c975 + fda6d4d commit 7016b5d

File tree

4 files changed

+18
-13
lines changed

4 files changed

+18
-13
lines changed

lib/rqrcode/core_ext/array.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
require 'rqrcode/core_ext/array/behavior'
22

33
class Array #:nodoc:
4-
include CoreExtensions::Array::Behavior
4+
include RQRCode::CoreExtensions::Array::Behavior
55
end
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
module CoreExtensions #:nodoc:
2-
module Array #:nodoc:
3-
module Behavior
4-
def extract_options!
5-
last.is_a?(::Hash) ? pop : {}
1+
module RQRCode
2+
module CoreExtensions #:nodoc:
3+
module Array #:nodoc:
4+
module Behavior
5+
def extract_options!
6+
last.is_a?(::Hash) ? pop : {}
7+
end unless [].respond_to?(:extract_options!)
68
end
79
end
810
end
911
end
12+

lib/rqrcode/core_ext/integer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
require 'rqrcode/core_ext/integer/bitwise'
22

33
class Integer #:nodoc:
4-
include CoreExtensions::Integer::Bitwise
4+
include RQRCode::CoreExtensions::Integer::Bitwise
55
end

lib/rqrcode/core_ext/integer/bitwise.rb

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
module CoreExtensions #:nodoc:
2-
module Integer #:nodoc:
3-
module Bitwise
4-
def rszf(count)
5-
# zero fill right shift
6-
(self >> count) & ((2 ** ((self.size * 8) - count))-1)
1+
module RQRCode
2+
module CoreExtensions #:nodoc:
3+
module Integer #:nodoc:
4+
module Bitwise
5+
def rszf(count)
6+
# zero fill right shift
7+
(self >> count) & ((2 ** ((self.size * 8) - count))-1)
8+
end
79
end
810
end
911
end

0 commit comments

Comments
 (0)