gorilla-patch 0.0.5.1 → 0.0.5.3

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/gorilla-patch/string.rb +14 -0
  3. metadata +2 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9a6bd3204e90b32d250478b7f8880597764e7c1b
4
- data.tar.gz: 04cced732349ccb3060ebdc759a73d30fec56d8c
3
+ metadata.gz: 1d1f0ca46565aa771e4f789f522a08b4bd26d481
4
+ data.tar.gz: 44529039f8af33b6469dbd02fe7d2f570a209b1b
5
5
  SHA512:
6
- metadata.gz: d9db408bc51258110ce23614ea3d946254f9246d3b5263736ad8edee339c52ed96abe544d8afcd56808295a4be79adb5c4c42cf1033329d06af7dc693a0ac46b
7
- data.tar.gz: c5902024b571965b812cbb125fb0d7f9782838c5dd4264bdbce7fff0e4e4359dc3233e26cdb48f9abaccece5a604ea4a763a2c19a6990202b6bfd2506aa636fa
6
+ metadata.gz: 6a56fcf9f379a41c2465007fd6def74a22d90db2df6fe66f76e9cbf3d8c33721675970f56445948e16cd640f01b8e6c7d228fa0a71034ac58c3c98be249e393f
7
+ data.tar.gz: 6b7c39a102c6bc0db46fba59dfd25ac33ebe01c2e29791cb855918ef4359c26148d9dadcd9b849e3a81842602629985d921d4a51b9cc2a0417b128858358e0a3
@@ -0,0 +1,14 @@
1
+ module GorillaPatch
2
+ ## Refine String class
3
+ module StringExt
4
+ refine String do
5
+ def underscore
6
+ gsub(/::/, '/')
7
+ .gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
8
+ .gsub(/([a-z\d])([A-Z])/, '\1_\2')
9
+ .tr('-', '_')
10
+ .downcase
11
+ end
12
+ end
13
+ end
14
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gorilla-patch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5.1
4
+ version: 0.0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Popov
@@ -20,6 +20,7 @@ files:
20
20
  - lib/gorilla-patch/array.rb
21
21
  - lib/gorilla-patch/hash.rb
22
22
  - lib/gorilla-patch/module.rb
23
+ - lib/gorilla-patch/string.rb
23
24
  homepage: https://bitbucket.org/AlexWayfer/gorilla-patch
24
25
  licenses:
25
26
  - MIT