string_tools 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OGUxNWFlMjFhNWZiMGM3MDJmZDUxYTE5N2Y4N2Q0N2UzN2U1NTljMw==
4
+ MGI2YTg1ZWI2YjAwOTkxNzlhMTg2M2FmY2VmYzZhMTk4ZjRhYzZjNA==
5
5
  data.tar.gz: !binary |-
6
- ZmFiNTU2ZTk4Y2MwOGYwODMwMDVmNThmMWQ1NWU2MmM3NzEyZGEwOQ==
6
+ YTE0NGJiYjdhOTFhMGNhNDQxNWZhN2E4YmI3NmIwZmEyNThjNWYyMQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZDE1MDg1MDAwYTYwYTM2ZDlmNDkzM2NmNGNiZmE4Y2U5MGFiYzBkNTUxMjc2
10
- NTgzYzA3Y2M5ZTM1YzA3M2U3Nzg2MTJjMWUyODFlNGExODc3OWIzYmExODlm
11
- OWVhMDQ4MWZhYzM2Y2Y3M2Q4OWQ0M2I5YjRkMDQ5MTg5YzAzMDM=
9
+ YmE1ZjE1OTI1NzkzNDFkZDIxMjdjY2NhMmUwNGRmNDkwZjE3MDlmZGIzZGRm
10
+ ZTFkMDg2NGViYWUxYTJjZTJkNGJmNTYyZGIxZTFmMDJjYmM1MjQ1MjhjYTI5
11
+ ZjZjYTljNTVmZjk2ODU0ODBjYTI5MGQ1M2VkMTc3Njg0MzI5Nzg=
12
12
  data.tar.gz: !binary |-
13
- ZTZkNDY3ZGJhMDY1NDM3NjEzN2RkY2QxYmUwZGViZTVlMWY1OWQ0OTZmZWQ1
14
- Y2I4MDM5ZTc4MzAwNDIyNGYyNGZkYzdlYWI2ZjFjOGYzNmU4ODgwMzk1NDQ0
15
- MjVhYjNmNjIyMGNhMmQ2NzE5YzVjYWM1YzU1ODRjMTk0ZjFlODQ=
13
+ NGY2YjA5ODA5MzU4NTZhNzU4YmM0MjE4ODk5N2Q1MWEwMThlYjY1ZmMzODM3
14
+ OTVjNzVkY2FjODcyZjg0NTkzNTY5NzU4MTI1ZmI2NTUwMjRjNmQ0NThkMzFi
15
+ NGEzMTczNmFkMGY1M2Y5MTVmZGVhY2QxMzYzNDU3OGEyOGQyODU=
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
 
2
2
  #### [Current]
3
+ * 2016-03-10 [c23456a](../../commit/c23456a) - __(Dmitry Bochkarev)__ fix(sanitizers): подменять невалидные ссылки своим содержимым
4
+
5
+ #### v0.4.0
6
+ * 2016-02-25 [184963b](../../commit/184963b) - __(Salahutdinov Dmitry)__ Release 0.4.0
3
7
  * 2016-02-24 [6444952](../../commit/6444952) - __(Nikita Nyatin)__ chore(gemspec): update ru_propisju version
4
8
  * 2016-01-14 [84856d8](../../commit/84856d8) - __(GIGrave)__ fix(lib/string_tools) return nil if InvalidURIError
5
9
 
data/Makefile CHANGED
@@ -17,3 +17,7 @@ bundler/install:
17
17
 
18
18
  appraisal/install:
19
19
  ${BUNDLE} exec ${APPRAISAL} install
20
+
21
+ clear:
22
+ rm -rf gemfiles
23
+ rm -f Gemfile.lock
data/lib/string_tools.rb CHANGED
@@ -200,6 +200,8 @@ module StringTools
200
200
  def normalize_link(node, attr_name)
201
201
  return unless node[attr_name]
202
202
  node[attr_name] = Addressable::URI.parse(node[attr_name]).normalize.to_s
203
+ rescue Addressable::URI::InvalidURIError
204
+ node.swap node.children
203
205
  end
204
206
  end
205
207
 
@@ -73,6 +73,8 @@ module StringTools
73
73
  elsif !whitelisted?(SimpleIDN.to_unicode(uri.host))
74
74
  replace_with_content node
75
75
  end
76
+ rescue Addressable::URI::InvalidURIError
77
+ replace_with_content node
76
78
  end
77
79
 
78
80
  def whitelisted?(domain)
@@ -1,3 +1,3 @@
1
1
  module StringTools
2
- VERSION = '0.4.0'
2
+ VERSION = '0.5.0'
3
3
  end
data/string_tools.gemspec CHANGED
@@ -31,8 +31,8 @@ Gem::Specification.new do |spec|
31
31
 
32
32
  spec.add_development_dependency 'bundler', '~> 1.7'
33
33
  spec.add_development_dependency 'rake', '~> 10.0'
34
- spec.add_development_dependency 'rspec', '>= 2.14.0'
35
- spec.add_development_dependency 'rspec-rails', '>= 2.14.0'
34
+ spec.add_development_dependency 'rspec', '>= 3.4'
35
+ spec.add_development_dependency 'rspec-rails', '>= 3.4'
36
36
  spec.add_development_dependency 'rspec-given', '~> 3.5'
37
37
  spec.add_development_dependency 'shoulda-matchers', '~> 2.0'
38
38
  spec.add_development_dependency 'appraisal', '>= 1.0.2'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: string_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey D.
@@ -170,28 +170,28 @@ dependencies:
170
170
  requirements:
171
171
  - - ! '>='
172
172
  - !ruby/object:Gem::Version
173
- version: 2.14.0
173
+ version: '3.4'
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - ! '>='
179
179
  - !ruby/object:Gem::Version
180
- version: 2.14.0
180
+ version: '3.4'
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: rspec-rails
183
183
  requirement: !ruby/object:Gem::Requirement
184
184
  requirements:
185
185
  - - ! '>='
186
186
  - !ruby/object:Gem::Version
187
- version: 2.14.0
187
+ version: '3.4'
188
188
  type: :development
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
192
  - - ! '>='
193
193
  - !ruby/object:Gem::Version
194
- version: 2.14.0
194
+ version: '3.4'
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: rspec-given
197
197
  requirement: !ruby/object:Gem::Requirement