mtlite 0.3.2 → 0.3.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1fe272c364de630b9fd4e08b7db84e122759779b
4
- data.tar.gz: 1ff4890279d3ea7312b775f0eae504c6009ef5ed
3
+ metadata.gz: 3a187e249dab0d289809fd330866fa5669745fd0
4
+ data.tar.gz: cf1a24654c289b290c16b1a7671da279ba15cead
5
5
  SHA512:
6
- metadata.gz: 2a53ec71e7c5515a496ad92eb0d589bc03e90c7365431862b2dbcc2e77e6a98754dbb66aea2c761d03163ac17343a555b7f4d2f8e501551cfe8089e42e02b624
7
- data.tar.gz: 61032a89070362c30c215f57c1f8f34c6fa4fda1379dc7d44774508c17b471d0af276cde04ab376696c211032bd257471540d3e4742d86ec8145973b6eaa33ec
6
+ metadata.gz: 96682859125bc4a25f45793745ff87277ccef4e9e9726d6a6e6bc69de6ce5f86778c79039caa120a9bee31b11ca4007f7b49aa50f687bb3cbd296e8ab66c39c9
7
+ data.tar.gz: 5c159f0a93b8ef32e8219debd5d502a3275e4105ee02cbc23cd5af917de3d3672c27e9604d4b46a3354efe4ce393c0e5a2a249b4ac9302e0a8a4648fce9c2a4f
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/mtlite.rb CHANGED
@@ -79,6 +79,14 @@ class MTLite
79
79
  regex = %r([\w\-/?=.#\(\)]+)
80
80
  # generate anchor tags for URLs which don't have anchor tags
81
81
  msg.gsub!(/(?:^(https?:#{regex})|\s(https?:#{regex}))/,' <a href="\2">\2</a>')
82
+
83
+ msg.gsub!(/(?:^(https?:#{regex})|\s(https?:#{regex}))/) do |x|
84
+ url = $2
85
+ url2 = url.sub(/^https?:\/\//,'').sub(/^www\./,'')
86
+ url3 = url2.length > 33 ? url2[0..33] + '…' : url2
87
+ " <a href='#{url}'>#{url3}</a>"
88
+ end
89
+
82
90
  # add the target attribute to make all hyperlinks open in a new browser tab
83
91
  msg.gsub!(/<a /,'<a target="_blank" ')
84
92
 
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mtlite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  S/vdVb30GmSKtbnJ5lgMXRzFppdweZQMOoEbtLfL7ine6Ty5MxOq7FSffEov7+T9
32
32
  1nXp7z0aRWQE3g==
33
33
  -----END CERTIFICATE-----
34
- date: 2016-06-24 00:00:00.000000000 Z
34
+ date: 2017-05-04 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rdiscount
@@ -74,7 +74,7 @@ dependencies:
74
74
  - !ruby/object:Gem::Version
75
75
  version: 0.1.0
76
76
  description:
77
- email: james@r0bertson.co.uk
77
+ email: james@jamesrobertson.eu
78
78
  executables: []
79
79
  extensions: []
80
80
  extra_rdoc_files: []
@@ -100,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
100
  version: '0'
101
101
  requirements: []
102
102
  rubyforge_project:
103
- rubygems_version: 2.5.1
103
+ rubygems_version: 2.6.8
104
104
  signing_key:
105
105
  specification_version: 4
106
106
  summary: mtlite
metadata.gz.sig CHANGED
@@ -1 +1 @@
1
- c��e�M�a��+�q>��X`l�G`?J�[,3 *'U���{��>�h�^*ޖr�j�!�*^q�gqd���SX��g{%C������HFN��Ր4ղ������r�C�-o���ۛ$>�hCc$ەȷ�4aJ��L/|�Dّ����}'�`Fe'O��V���ˋy���-�‡���k��+\��"�J{K���rؖU���P�,N���-S����-�=7��BiB�{����.�W~�de�� J�,-��
1
+ ��s?�����,�&3�Ɉe��� �����%����냂���,��6�*�>!�g�K����rwXI�*�S+w�׋2]�S/�xŹ���S։�=�����EJM������tuv��/��������p-���D��q�4NDA ~K��a���^��������:%�ѹOK��/6���yV;�׻<M6cS��:<.��0���]���B��x���}k5�{J��;����?�p9����4��6.^�&�