gorilla-patch 2.0.0 → 2.1.0

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: 274828f8549d1ba6f48b9b4a7df6ec071f4b70ae
4
- data.tar.gz: 510f3668fe0f0e1b13e57273d50deb27062da560
3
+ metadata.gz: 3ede789ae045a0cfa8eeaf0847a96d7789c3a5df
4
+ data.tar.gz: 0beea969664882f656681213546fe3c08c077b4c
5
5
  SHA512:
6
- metadata.gz: 7ca217c29f927eeb7c0f985c68223941103cf8163957798fe9cf043c32f1b9ecf81818cab7c3bffc713f895bd78f55c991561928f955b52f98d64d496d76b0b7
7
- data.tar.gz: 02b0bdf545ff67c49230a87b435df69ea4d7a5f7515e6018a0c8ea3ac3e92c9810e2ff5c206b89fbc05e96025d3258d09a3a9a7c16620c60eb7334bdf83f5c62
6
+ metadata.gz: 959f82186bb78c8acc7e9405ada61957582d25cf62308e7a150d441d1370bb3b88d185ed75488fac0824930bfb8d9e95f727fc4fd7b39a45135600564645c510
7
+ data.tar.gz: d58d0ac6dc553543e1a26f7448758e0fd49d0df4be8b1f033a2ac793e54573e0fffc087f10a74aee7dc4356a8e86aa72f9943a9052a35f2a52c95fa5c4c2eaf3
@@ -5,7 +5,10 @@ module GorillaPatch
5
5
  def deep_dup
6
6
  dup
7
7
  rescue TypeError
8
+ # :nocov:
9
+ # For Ruby < 2.4: https://bugs.ruby-lang.org/issues/12979
8
10
  self
11
+ # :nocov:
9
12
  end
10
13
  end
11
14
 
@@ -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.0.0
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-13 00:00:00.000000000 Z
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: '0'
141
+ version: 2.1.0
71
142
  required_rubygems_version: !ruby/object:Gem::Requirement
72
143
  requirements:
73
144
  - - ">="