gorilla-patch 0.0.5 → 0.0.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 42a30f16346ec6af2d381bc88f7c30190ca2ebb7
4
- data.tar.gz: 60f9622c4422cef6dcc0bc6aa037333967be8018
3
+ metadata.gz: 9a6bd3204e90b32d250478b7f8880597764e7c1b
4
+ data.tar.gz: 04cced732349ccb3060ebdc759a73d30fec56d8c
5
5
  SHA512:
6
- metadata.gz: 0039919f79065a7fd287372e6ed8351bd5405369802b9e46290898533ba5d55a0945fd2151028dc5edbee350028c8f95e4d19a43265cfaa8b288cef83806939c
7
- data.tar.gz: 5e7da9352295620397218804979cf026d765d38510e17ff45a027762550e34b6b3fe87dcbd3438d0b786a63c8e074b665a53e6b13f9ed8d194dfb38f854b0142
6
+ metadata.gz: d9db408bc51258110ce23614ea3d946254f9246d3b5263736ad8edee339c52ed96abe544d8afcd56808295a4be79adb5c4c42cf1033329d06af7dc693a0ac46b
7
+ data.tar.gz: c5902024b571965b812cbb125fb0d7f9782838c5dd4264bdbce7fff0e4e4359dc3233e26cdb48f9abaccece5a604ea4a763a2c19a6990202b6bfd2506aa636fa
data/lib/gorilla-patch.rb CHANGED
@@ -1 +1 @@
1
- Dir.glob(File.join(__dir__, 'gorilla-patch', '*.rb')).each {|file| require file }
1
+ Dir.glob(File.join(__dir__, 'gorilla-patch', '*.rb')).each { |file| require file }
@@ -1,19 +1,16 @@
1
1
  module GorillaPatch
2
+ ## Refine Array class
2
3
  module ArrayExt
3
-
4
4
  refine Array do
5
-
6
5
  def compare(other)
7
- other = [other] unless other.kind_of?(Array)
6
+ other = [other] unless other.is_a?(Array)
8
7
  sort == other.sort
9
8
  end
10
9
 
11
10
  def include_any?(*items)
12
- items = items.first if items.length == 1 && items.first.kind_of?(Array)
11
+ items = items.first if items.length == 1 && items.first.is_a?(Array)
13
12
  !(self & items).empty?
14
13
  end
15
-
16
14
  end
17
-
18
15
  end
19
- end
16
+ end
@@ -1,8 +1,7 @@
1
1
  module GorillaPatch
2
+ ## Refine Hash class
2
3
  module HashExt
3
-
4
4
  refine Hash do
5
-
6
5
  def keys_to_sym
7
6
  each_with_object({}) { |(key, val), hash_sym| hash_sym[key.to_sym] = val }
8
7
  end
@@ -37,8 +36,6 @@ module GorillaPatch
37
36
  def compact!
38
37
  delete_if { |_k, v| v.nil? }
39
38
  end
40
-
41
39
  end
42
-
43
40
  end
44
41
  end
@@ -1,13 +1,10 @@
1
1
  module GorillaPatch
2
+ ## Refine Module class
2
3
  module ModuleExt
3
-
4
4
  refine Module do
5
-
6
5
  def demodulize
7
6
  to_s.split('::').last
8
7
  end
9
-
10
8
  end
11
-
12
9
  end
13
- end
10
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gorilla-patch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Popov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-17 00:00:00.000000000 Z
11
+ date: 2015-09-30 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Refine Ruby Core classes.
14
14
  email: alex.wayfer@gmail.com