mtlite 0.2.4 → 0.2.5

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: 8d02b02724ff86f0ba415f7c362209b43a9bbdcf
4
- data.tar.gz: 77d2499c1e03c7311f7417fc7d43c979b415aaca
3
+ metadata.gz: 8418abec74afad46dd33ff2c87b8a489bd6e9dbc
4
+ data.tar.gz: bb7ee11cf35c3a306900da6712a8884b7688a8d2
5
5
  SHA512:
6
- metadata.gz: d2897228e13420fe2f34fc5cb8189c718f289e4be80166cca617afe047171b721d6a41f3b7af883b47e26dc43af034a3353adf6c0253d60d7f7fdd7eb4f9466a
7
- data.tar.gz: 5a66bd48dfd508b5ba862f570373554f82a3524544482e7d5df941146289a066522854c941bee73c89f9bbb96231f5b8d7a8d760c55ef591372c7a9e902fbc02
6
+ metadata.gz: 6a137949afc8c23d1ec49daaab7e10a9492f8193014c159ffa28651fbab2c4f18295b80b69e18630aad0e0368f148430a7a73a507df6bde8da9f553b2ebed5eb
7
+ data.tar.gz: 36359938b0eb15efb76fb8a68f7eeb3b3859c1143ca30a085b1cf195b9641fb0ec3ee54d5c121875f69e9361d2e6091d9cf12fa637b5b162bcf840a93b713e57
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/mtlite.rb CHANGED
@@ -8,10 +8,8 @@ class MTLite
8
8
 
9
9
  def initialize(raw_msg)
10
10
 
11
- # make the smartlinks into Markdown links
12
- raw_msg.gsub!(/\B\?([^\n]+) +(https?:\/\/[^\b]+)\?\B/,'[\1](\2)')
13
-
14
- @raw_msg = raw_msg
11
+ # make the smartlinks into Markdown links
12
+ @raw_msg = smartlink(raw_msg)
15
13
 
16
14
  end
17
15
 
@@ -107,5 +105,15 @@ class MTLite
107
105
 
108
106
  @msg = msg.gsub('<br/>',"\n").gsub(/<\/?.[^>]*>/,'')
109
107
  end
108
+
109
+ private
110
+
111
+ def smartlink(s)
112
+
113
+ s.gsub(/\B\?([^\n]+) +(https?:\/\/.*\?)(?=\B)/) do
114
+ "[%s](%s)" % [$1, ($2).chop]
115
+ end
116
+
117
+ end
110
118
 
111
119
  end
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.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
@@ -1,2 +1 @@
1
- KE���|��w��%�S�@��{�#ζ*b-Ϲ t=
2
- ���*���{F5=�6�H��,X�{h!�����F�p��Ƙ�\���k�e��uYoVu~�+p�� 1��DA���ƘQh�>���zx%݀=q�j���X�P�L�rsP��&�O@x&���" �'�[y|A%�s����@F�j�Z� 3ؔVg-�m,�OtKpKZ [�u0��A�@±<����Y>�g��
1
+ ԍf��63b�^�6pnt�H�'/s�j�