urn 2.0.1 → 2.0.2

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: c1f64f26329dc83af54f880d096d82ea51d82d63
4
- data.tar.gz: 7b303594caf4ca5614175b579470689d9dcc4854
3
+ metadata.gz: 7e1c2be6af290106a733f32ac7026372cab6aac4
4
+ data.tar.gz: 9b21151bb6c84e745a3eae2d58e865363c450ae5
5
5
  SHA512:
6
- metadata.gz: 648c36a28d4828908af24695d39a28d74f92c56a5caafc0b70a6cc268d6caf1079094014cda67dcbaba3e6a855a021dbada5d42bb51aa526dcd061a2017dd3b3
7
- data.tar.gz: d8808e3775387cfff3f45c6ad36197c22f32bc59e74dc4819a2ef4fc23286c697c0f2eb8086dae9ac33f1d5f680efa20e612a8c845e58cb76b1924f7a0caa44b
6
+ metadata.gz: 20c6095f1ec53ed40d14f2b4c52983ce8c07734d943064ad3aca8b6c02be6793557b92ab9e1c42b07cd23499efb88a86e8048535ba2089ae8d0c9555ab55b894
7
+ data.tar.gz: ef9f752d8a2b717a482c11d365f9da648f645a2e6f9f592131ec8659408bd590011b2f9c52c8373981929bf706954fcb05b21832a4aff0062a368b0665b7127e
@@ -2,6 +2,10 @@
2
2
  All notable changes to this project will be documented in this file. This
3
3
  project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
+ ## [2.0.2] - 2017-01-13
6
+ ### Fixed
7
+ - `.extract` now respects the word boundaries at the beginning of URNs. Example: `sideburn:mutton:chops` won't return `['urn:mutton:chops']` but `[]`.
8
+
5
9
  ## [2.0.1] - 2016-03-24
6
10
  ### Fixed
7
11
  - `URN()` shortcut works on classes without `Object` as ancestor.
@@ -68,6 +72,7 @@ URN(URN('urn:foo:bar'))
68
72
  ### Added
69
73
  - First version with basic implementation.
70
74
 
75
+ [2.0.2]: https://github.com/altmetric/urn/releases/tag/v2.0.2
71
76
  [2.0.1]: https://github.com/altmetric/urn/releases/tag/v2.0.1
72
77
  [2.0.0]: https://github.com/altmetric/urn/releases/tag/v2.0.0
73
78
  [1.0.0]: https://github.com/altmetric/urn/releases/tag/v1.0.0
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2016 Altmetric LLP
3
+ Copyright (c) 2016-2017 Altmetric LLP
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -148,6 +148,6 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/altmet
148
148
 
149
149
  ## License
150
150
 
151
- Copyright © 2016 Altmetric LLP
151
+ Copyright © 2016-2017 Altmetric LLP
152
152
 
153
153
  Distributed under the [MIT License](http://opensource.org/licenses/MIT).
data/lib/urn.rb CHANGED
@@ -15,7 +15,7 @@ class URN
15
15
  private :urn
16
16
 
17
17
  def self.extract(str, &blk)
18
- str.scan(/#{PATTERN}/, &blk)
18
+ str.scan(/\b#{PATTERN}/, &blk)
19
19
  end
20
20
 
21
21
  def initialize(urn)
@@ -165,5 +165,9 @@ RSpec.describe URN do
165
165
 
166
166
  expect(normalized_urns).to contain_exactly('urn:foo:BA%2cR')
167
167
  end
168
+
169
+ it 'only extracts URNs with word boundaries at the beginning' do
170
+ expect(URN.extract('sideburn:mutton:chops')).to be_empty
171
+ end
168
172
  end
169
173
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: urn
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ana Castro
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2016-03-24 00:00:00.000000000 Z
13
+ date: 2017-01-13 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -93,3 +93,4 @@ summary: Utility methods to normalize and validate URNs
93
93
  test_files:
94
94
  - spec/spec_helper.rb
95
95
  - spec/urn_spec.rb
96
+ has_rdoc: