autolinks 0.1.0 → 0.1.1

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: 51d03f82d7621ef0b4475994d54dbe4aee9ac871
4
- data.tar.gz: 3c781e34ecde513af3635fcc7352674d97b12e3a
3
+ metadata.gz: ae1d97cb0f6671822be54cbc3f17f14808a0af8a
4
+ data.tar.gz: 3f635eb68a5e1088bad0a2d47829dcd2d1e62bb8
5
5
  SHA512:
6
- metadata.gz: d0e7b056e40c2e3771b2e1b7bebcf485f8e825580d6375e286351d34c90ecb7ff69a89b04474f138eda167896cdf706cf063457ef135b9039b2162bc7f389541
7
- data.tar.gz: 59d6ec4ac3c12511d695e1e9bd06e20c2e745e5f8cc910370404d5dd57749f12e3d16ac1089b6ccf9314bd761a527ac1477d94bd49327f58b99363f95c3082a3
6
+ metadata.gz: 52dac825cb2f8ab0c5a4f7adad95f6cbd890d88f598b69dcca52dac5178bb3400ec777fd9287cef39c4e024aca1aa5e9a8c914205569b3eb0448a77ed2d0c373
7
+ data.tar.gz: 7eb7b40ec1b161af2098f088e82d7b6bb1a7a6909a81df9b8c1eb9dd5300d397d43fbfefdd5eae9d06b6715c9f8733bdf40894f502aca7b22bb1282da2998854
@@ -9,11 +9,11 @@ module Autolinks
9
9
  end
10
10
 
11
11
  def self.http
12
- /(https?:\/\/[\S]+\.[a-z\/\.]+)/i
12
+ /(https?:\/\/[\S]+\.[!#$&-;=?-[\]_a-z~]|%[\w\d]{2}]+[\w])/i
13
13
  end
14
14
 
15
15
  def self.http_address
16
- /https?:\/\/([\S]+\.[a-z\/\.]+)/i
16
+ /https?:\/\/([\S]+\.[!#$&-;=?-[\]_a-z~]|%[\w\d]{2}]+[\w])/i
17
17
  end
18
18
 
19
19
  def self.hashtag
@@ -28,4 +28,4 @@ module Autolinks
28
28
  /(\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}\b)/i
29
29
  end
30
30
  end
31
- end
31
+ end
@@ -1,3 +1,3 @@
1
1
  module Autolinks
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -21,15 +21,27 @@ describe Autolinks::Regex do
21
21
  end
22
22
  end
23
23
 
24
- describe "http" do
24
+ describe "http", focus: true do
25
25
  it "should match the complete urls in the Test String" do
26
- Autolinks::TEST_STRING.scan(Autolinks::Regex.http).flatten.should == ["http://google.com", "http://google.com/", "http://google.co.uk"]
26
+ Autolinks::TEST_STRING.scan(Autolinks::Regex.http).flatten.should == ["http://google.com", "http://google.com", "http://google.co.uk"]
27
+ end
28
+
29
+ Autolinks::TEST_URLS.each do |link|
30
+ it "should match #{link}" do
31
+ link.scan(Autolinks::Regex.http).flatten.should == [link.gsub(/\W$/, '')]
32
+ end
27
33
  end
28
34
  end
29
35
 
30
- describe "http_address" do
36
+ describe "http_address", focus: true do
31
37
  it "should match the complete urls in the Test String" do
32
- Autolinks::TEST_STRING.scan(Autolinks::Regex.http_address).flatten.should == ["google.com", "google.com/", "google.co.uk"]
38
+ Autolinks::TEST_STRING.scan(Autolinks::Regex.http_address).flatten.should == ["google.com", "google.com", "google.co.uk"]
39
+ end
40
+
41
+ Autolinks::TEST_URLS.each do |link|
42
+ it "should match #{link}" do
43
+ link.scan(Autolinks::Regex.http_address).flatten.should == [link.gsub(/https?:\/\//, '').gsub(/\W$/, '')]
44
+ end
33
45
  end
34
46
  end
35
47
 
@@ -23,4 +23,15 @@ module Autolinks
23
23
  This is a test string with some #hashtags and other types of #marked #content....
24
24
  winning! We're #1! email@email.com. We're also going to test some URL's: http://google.com,
25
25
  or http://google.com/, or google.com, or http://google.co.uk, or google.co.uk"
26
+
27
+ TEST_URLS = [
28
+ "http://foo.com/blah_blah",
29
+ "http://foo.com/blah_blah/",
30
+ "http://www.extinguishedscholar.com/wpglob/?p=364.",
31
+ "http://6303E4C1-6A6E-45A6-AB9D-3A908F59AE0E.org",
32
+ "http://www.quillandquire.com/blog/index.php/bookselling-2/2012/11/12/qa-the-monkeys-paw-introduces-the-biblio-mat-book-vending-machine/",
33
+ "http://google.co.uk",
34
+ "http://foo.com/blah_(wikipedia)_blah#cite-1",
35
+ "http://mw1.google.com/mw-earth-vectordb/kml-samples/gp/seattle/gigapxl/$[level]/r$[y]_c$[x].jpg"
36
+ ]
26
37
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autolinks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jay Sanders
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-24 00:00:00.000000000 Z
11
+ date: 2013-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec