anchored 1.0.2 → 1.0.3

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: eca910ed49f66149517c9e86291ea10ec9f3c109
4
- data.tar.gz: 773d20906917d465d3a6004b6e6917f5e7be3871
3
+ metadata.gz: 5a8df9e706f1afaa992478a748bce0c8c2515df6
4
+ data.tar.gz: d02ddf11e4a900bec073e1a54893d26480cf52ff
5
5
  SHA512:
6
- metadata.gz: 61747594002d954684ea02beef9331e4cc07fa26ac48a5591e278337309d924efe1497bf325078d8903f01f61ea829b7d874fb49fa80aee13fd9a4d9db668dcf
7
- data.tar.gz: bfb708d606bed00238d7c73a75d6bd0e8800cd1097d17c580f5cde2cf408f86671c21e262681d7cf6f6cf965be346d46271d02bfa94c9ca31abea50c35e86a83
6
+ metadata.gz: 45e933df222c21524faf39f7bbca4f036bb704f2d814471b3d18925cf087a1da0ae9b42bfedaec948db5478013d30960de1cc2527d96af9a2096ae67403dbfbf
7
+ data.tar.gz: 712b65345b0094efabc15875b3c287b3de8a040fd02421e2c8acf2149f915dec60aed5d1b98ebd91ec8860ffcba17b340078f26a183031312d59e70a970cb2a2
data/README.md CHANGED
@@ -26,30 +26,33 @@ $ gem install anchored
26
26
 
27
27
  ## Usage
28
28
 
29
- ```
30
- require "anchored"
29
+ #### Pass-through
31
30
 
31
+ ```ruby
32
32
  Anchored::Linker.auto_link("text")
33
- => "text"
34
-
35
-
36
- # Wrap URLs in anchors:
33
+ # => "text"
34
+ ```
37
35
 
38
- Anchored::Linker.auto_link("hello www.google.com.")
39
- => "hello <a href='http://www.google.com'>www.google.com</a>."
36
+ #### Wrap URLs in anchors:
40
37
 
38
+ ```ruby
39
+ Anchored::Linker.auto_link("hello www.example.com.")
40
+ # => "hello <a href='http://www.example.com'>www.example.com</a>."
41
+ ```
41
42
 
42
- # Set anchor attributes. Alter the link text with a block:
43
+ #### Set anchor attributes. Alter the link text with a block:
43
44
 
44
- text = "Welcome to http://www.dogedogedoge.com/."
45
+ ```ruby
46
+ text = "Welcome to http://www.example.com/."
45
47
  Anchored::Linker.auto_link(text, target: "_blank") do |text|
46
48
  text[0...12] + "..."
47
49
  end
48
- # => "Welcome to <a href=\"http://www.dogedogedoge.com/\" target=\"_blank\">http://dogedo...</a>."
49
-
50
+ # => "Welcome to <a href=\"http://www.example.com/\" target=\"_blank\">http://exampl...</a>."
51
+ ```
50
52
 
51
- # Remove the target attribute when a URL matches a domain:
53
+ #### Remove the target attribute when a URL matches a domain:
52
54
 
55
+ ```ruby
53
56
  text = "Hello http://www.example.com/."
54
57
  Anchored::Linker.auto_link(text, target: "_blank", domain: "example.com")
55
58
  # => "Hello <a href=\"http://www.example.com/\">http://example.com</a>."
@@ -28,7 +28,7 @@ module Anchored
28
28
  # regexps for determining context, used high-volume
29
29
  AUTO_LINK_CRE = [/<[^>]+$/, /^[^>]*>/, /<a\b.*?>/i, /<\/a>/i].freeze
30
30
 
31
- PUNCTUATION_RE = /[^\p{Word}\/-=&]$/
31
+ PUNCTUATION_RE = /[^\p{Word}\/=&]$/
32
32
 
33
33
  BRACKETS = { "]" => "[", ")" => "(", "}" => "{" }.freeze
34
34
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Anchored
4
- VERSION = "1.0.2"
4
+ VERSION = "1.0.3"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anchored
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tee Parham
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-06 00:00:00.000000000 Z
11
+ date: 2017-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
99
  version: '0'
100
100
  requirements: []
101
101
  rubyforge_project:
102
- rubygems_version: 2.6.10
102
+ rubygems_version: 2.6.14
103
103
  signing_key:
104
104
  specification_version: 4
105
105
  summary: Ruby auto linker