gorilla-patch 2.0.0 → 2.1.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 +4 -4
- data/lib/gorilla-patch/deep_dup.rb +3 -0
- data/lib/gorilla-patch/truncate.rb +15 -0
- metadata +74 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ede789ae045a0cfa8eeaf0847a96d7789c3a5df
|
4
|
+
data.tar.gz: 0beea969664882f656681213546fe3c08c077b4c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 959f82186bb78c8acc7e9405ada61957582d25cf62308e7a150d441d1370bb3b88d185ed75488fac0824930bfb8d9e95f727fc4fd7b39a45135600564645c510
|
7
|
+
data.tar.gz: d58d0ac6dc553543e1a26f7448758e0fd49d0df4be8b1f033a2ac793e54573e0fffc087f10a74aee7dc4356a8e86aa72f9943a9052a35f2a52c95fa5c4c2eaf3
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module GorillaPatch
|
2
|
+
## Module for truncating
|
3
|
+
module Truncate
|
4
|
+
refine String do
|
5
|
+
def truncate(position, separator: '', omission: '...')
|
6
|
+
return dup if length <= position
|
7
|
+
stop = position - omission.length
|
8
|
+
if separator.is_a?(Regexp) || !separator.empty?
|
9
|
+
stop = rindex(separator, stop)
|
10
|
+
end
|
11
|
+
"#{self[0, stop]}#{omission}"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gorilla-patch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.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-01-
|
11
|
+
date: 2017-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rake
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '12'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '12'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: rspec
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -38,6 +52,62 @@ dependencies:
|
|
38
52
|
- - "~>"
|
39
53
|
- !ruby/object:Gem::Version
|
40
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: simplecov
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: codeclimate-test-reporter
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: sequel
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '4'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '4'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: inflecto-refinements
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
41
111
|
description: Refine Ruby Core classes with methods like Active Support.
|
42
112
|
email: alex.wayfer@gmail.com
|
43
113
|
executables: []
|
@@ -55,6 +125,7 @@ files:
|
|
55
125
|
- lib/gorilla-patch/namespace.rb
|
56
126
|
- lib/gorilla-patch/slice.rb
|
57
127
|
- lib/gorilla-patch/symbolize.rb
|
128
|
+
- lib/gorilla-patch/truncate.rb
|
58
129
|
homepage: https://github.com/AlexWayfer/gorilla-patch
|
59
130
|
licenses:
|
60
131
|
- MIT
|
@@ -67,7 +138,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
67
138
|
requirements:
|
68
139
|
- - ">="
|
69
140
|
- !ruby/object:Gem::Version
|
70
|
-
version:
|
141
|
+
version: 2.1.0
|
71
142
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
143
|
requirements:
|
73
144
|
- - ">="
|