gorilla-patch 2.3.0 → 2.4.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 166b8957d1851577528fc5ace15b37554a3d4efe
4
- data.tar.gz: bd7ca7ab6258a8a2b25532445ee86a833e306767
3
+ metadata.gz: 39cd07b28717192ffffb7de68f1d85a68395474c
4
+ data.tar.gz: 5aa35a4d83aa6148db41bb5872f9dae196c1ded4
5
5
  SHA512:
6
- metadata.gz: 52150c868ecc11d21115b9e47a706b8180f5531c70aecc30cfafd3ed59da09bab371f810c12f2b0bd9451307379f2c1219629b32df1afb20ae794386e3b3b8c7
7
- data.tar.gz: 5b987c30b8cd83304aafcac2a0e1d8e04a8efd7b9f07908b462bd8f55b16dcb27b706806e7312dc94d33f81a203ed580b56862f50e2e573e286a065c349815c5
6
+ metadata.gz: c2cb7d827100cfd226e89be4834fdce362552c742cf09dbdc9fb4268587c69d403c64ca2f50fd4ba579eb4c5bf4fb4b67f833d9c4921e927549ad9cbc4f5dafa
7
+ data.tar.gz: 27228e4b4c0af5c39759171bb5af830e71adc080807316c008b834106fdc6534d2f8c1384446e8987651bb8c2da91c39c298f22591732cf2e8306abe5517b687
data/lib/gorilla-patch.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Dir.glob(
2
4
  File.join(__dir__, 'gorilla-patch', '*.rb')
3
5
  ).each { |file| require file }
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'deep_dup'
2
4
 
3
5
  module GorillaPatch
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module GorillaPatch
2
4
  ## Adding compact methods
3
5
  module Compact
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module GorillaPatch
2
4
  ## Adding include methods
3
5
  module Cover
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module GorillaPatch
2
4
  ## Adding deep_dup method
3
5
  module DeepDup
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module GorillaPatch
2
4
  ## Adding except methods
3
5
  module Except
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module GorillaPatch
2
4
  ## Inflections
3
5
  module Inflections
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module GorillaPatch
2
4
  ## Adding keys methods
3
5
  module Keys
@@ -1,15 +1,27 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module GorillaPatch
2
4
  ## Adding namespaces-changing methods
3
5
  module Namespace
4
6
  refine String do
5
7
  def demodulize
6
- split('::').last
8
+ split('::').last.to_s
9
+ end
10
+
11
+ def deconstantize
12
+ self[0, rindex('::') || 0]
7
13
  end
8
14
  end
9
15
 
10
- refine Module do
11
- def demodulize
12
- to_s.demodulize
16
+ [Module, Class].each do |klass|
17
+ refine klass do
18
+ def demodulize
19
+ name.demodulize
20
+ end
21
+
22
+ def deconstantize
23
+ name.deconstantize
24
+ end
13
25
  end
14
26
  end
15
27
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module GorillaPatch
2
4
  ## Adding slice methods
3
5
  module Slice
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module GorillaPatch
2
4
  ## Adding symbolize methods
3
5
  module Symbolize
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module GorillaPatch
2
4
  ## Module for truncating
3
5
  module Truncate
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: 2.3.0
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Popov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-25 00:00:00.000000000 Z
11
+ date: 2017-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -148,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
148
148
  version: '0'
149
149
  requirements: []
150
150
  rubyforge_project:
151
- rubygems_version: 2.6.11
151
+ rubygems_version: 2.6.8
152
152
  signing_key:
153
153
  specification_version: 4
154
154
  summary: Refining core classes