urn 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -1
- data/lib/urn.rb +2 -0
- data/spec/spec_helper.rb +18 -0
- data/spec/urn_spec.rb +35 -0
- metadata +15 -19
- data/.gitignore +0 -9
- data/.rspec +0 -2
- data/.travis.yml +0 -6
- data/Gemfile +0 -4
- data/Rakefile +0 -6
- data/bin/console +0 -14
- data/bin/setup +0 -7
- data/urn.gemspec +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 876d68aec7c174c18b549b705653e20e49b8c14a
|
4
|
+
data.tar.gz: 001402f4e00c733303f7631bdd6c1313750935ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d69b2ea6ebb2c5b8b99165dbcbb626caef56fa3ee13260e09b320651dec79d655c085d2b71b72b6b13036ad534003c26d98f6ab4d2fa22fe2d640b21736a3544
|
7
|
+
data.tar.gz: 3b4ccc977ad5f9c41001afdff892f03a67bb68c948c0c4d45c2bff0f950b7380f1b8bde314e55fcf2875b1941ca94b2e81ae1bf0612c75768ba6fde8e643e093
|
data/CHANGELOG.md
CHANGED
@@ -2,7 +2,15 @@
|
|
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
|
-
## [0.1.
|
5
|
+
## [0.1.3] - 2016-03-07
|
6
|
+
### Fixed
|
7
|
+
- Explicitly require CGI standard library
|
8
|
+
|
9
|
+
## [0.1.2] - 2016-03-02
|
10
|
+
### Changed
|
11
|
+
- Extract the `URN` pattern to a separate variable, so that it's easier to use it in different Regex formats if needed.
|
12
|
+
|
13
|
+
## [0.1.1] - 2016-03-02
|
6
14
|
### Changed
|
7
15
|
- Stricter rules to validate a URN: it does not accept `urn` string as valid namespace identifier.
|
8
16
|
|
@@ -10,5 +18,7 @@ project adheres to [Semantic Versioning](http://semver.org/).
|
|
10
18
|
### Added
|
11
19
|
- First version with basic implementation.
|
12
20
|
|
21
|
+
[0.1.3]: https://github.com/altmetric/urn/releases/tag/v0.1.3
|
22
|
+
[0.1.2]: https://github.com/altmetric/urn/releases/tag/v0.1.2
|
13
23
|
[0.1.1]: https://github.com/altmetric/urn/releases/tag/v0.1.1
|
14
24
|
[0.1.0]: https://github.com/altmetric/urn/releases/tag/v0.1.0
|
data/lib/urn.rb
CHANGED
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
RSpec.configure do |config|
|
2
|
+
config.filter_run :focus
|
3
|
+
config.run_all_when_everything_filtered = true
|
4
|
+
config.example_status_persistence_file_path = "spec/examples.txt"
|
5
|
+
config.disable_monkey_patching!
|
6
|
+
config.warnings = true
|
7
|
+
config.order = :random
|
8
|
+
config.default_formatter = 'doc' if config.files_to_run.one?
|
9
|
+
Kernel.srand config.seed
|
10
|
+
|
11
|
+
config.expect_with :rspec do |expectations|
|
12
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
13
|
+
end
|
14
|
+
|
15
|
+
config.mock_with :rspec do |mocks|
|
16
|
+
mocks.verify_partial_doubles = true
|
17
|
+
end
|
18
|
+
end
|
data/spec/urn_spec.rb
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'urn'
|
2
|
+
|
3
|
+
RSpec.describe URN do
|
4
|
+
describe '#valid?' do
|
5
|
+
context 'returns true' do
|
6
|
+
it 'if it is valid' do
|
7
|
+
expect(described_class.new('urn:namespace:specificstring')).to be_valid
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'if namespace includes urn' do
|
11
|
+
expect(described_class.new('urn:urnnamespace:specificstring')).to be_valid
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
context 'returns false' do
|
16
|
+
it 'if it does not start with urn' do
|
17
|
+
expect(described_class.new('not-urn:namespace:specificstring')).not_to be_valid
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'if namespace is urn' do
|
21
|
+
expect(described_class.new('urn:urn:specificstring')).not_to be_valid
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
describe '#normalize' do
|
27
|
+
it 'lowercases the urn and namespace identifier parts only' do
|
28
|
+
expect(described_class.new('URN:NameSpace:SpecificString').normalize).to eq('urn:namespace:SpecificString')
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'returns nil if it is not valid' do
|
32
|
+
expect(described_class.new('urn:').normalize).to be_nil
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
metadata
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: urn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ana Castro
|
8
8
|
- Jonathan Hernandez
|
9
|
+
- Paul Mucur
|
9
10
|
autorequire:
|
10
11
|
bindir: exe
|
11
12
|
cert_chain: []
|
12
|
-
date: 2016-03-
|
13
|
+
date: 2016-03-07 00:00:00.000000000 Z
|
13
14
|
dependencies:
|
14
15
|
- !ruby/object:Gem::Dependency
|
15
16
|
name: bundler
|
@@ -43,36 +44,29 @@ dependencies:
|
|
43
44
|
name: rspec
|
44
45
|
requirement: !ruby/object:Gem::Requirement
|
45
46
|
requirements:
|
46
|
-
- - "
|
47
|
+
- - "~>"
|
47
48
|
- !ruby/object:Gem::Version
|
48
|
-
version: '
|
49
|
+
version: '3.4'
|
49
50
|
type: :development
|
50
51
|
prerelease: false
|
51
52
|
version_requirements: !ruby/object:Gem::Requirement
|
52
53
|
requirements:
|
53
|
-
- - "
|
54
|
+
- - "~>"
|
54
55
|
- !ruby/object:Gem::Version
|
55
|
-
version: '
|
56
|
-
description:
|
57
|
-
email:
|
58
|
-
- support@altmetric.com
|
56
|
+
version: '3.4'
|
57
|
+
description:
|
58
|
+
email: support@altmetric.com
|
59
59
|
executables: []
|
60
60
|
extensions: []
|
61
61
|
extra_rdoc_files: []
|
62
62
|
files:
|
63
|
-
- ".gitignore"
|
64
|
-
- ".rspec"
|
65
|
-
- ".travis.yml"
|
66
63
|
- CHANGELOG.md
|
67
|
-
- Gemfile
|
68
64
|
- LICENSE.txt
|
69
65
|
- README.md
|
70
|
-
- Rakefile
|
71
|
-
- bin/console
|
72
|
-
- bin/setup
|
73
66
|
- lib/urn.rb
|
74
|
-
-
|
75
|
-
|
67
|
+
- spec/spec_helper.rb
|
68
|
+
- spec/urn_spec.rb
|
69
|
+
homepage: https://github.com/altmetric/urn
|
76
70
|
licenses:
|
77
71
|
- MIT
|
78
72
|
metadata: {}
|
@@ -96,4 +90,6 @@ rubygems_version: 2.5.1
|
|
96
90
|
signing_key:
|
97
91
|
specification_version: 4
|
98
92
|
summary: Utility methods to normalize and validate URNs
|
99
|
-
test_files:
|
93
|
+
test_files:
|
94
|
+
- spec/spec_helper.rb
|
95
|
+
- spec/urn_spec.rb
|
data/.gitignore
DELETED
data/.rspec
DELETED
data/.travis.yml
DELETED
data/Gemfile
DELETED
data/Rakefile
DELETED
data/bin/console
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "bundler/setup"
|
4
|
-
require "urn"
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require "irb"
|
14
|
-
IRB.start
|
data/bin/setup
DELETED
data/urn.gemspec
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
Gem::Specification.new do |spec|
|
4
|
-
spec.name = 'urn'
|
5
|
-
spec.version = '0.1.2'
|
6
|
-
spec.authors = ['Ana Castro', 'Jonathan Hernandez']
|
7
|
-
spec.email = ['support@altmetric.com']
|
8
|
-
|
9
|
-
spec.summary = 'Utility methods to normalize and validate URNs'
|
10
|
-
spec.description = ''
|
11
|
-
spec.homepage = 'http://github.com/altmetric/urn'
|
12
|
-
spec.license = 'MIT'
|
13
|
-
|
14
|
-
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
15
|
-
spec.bindir = 'exe'
|
16
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
17
|
-
spec.require_paths = ['lib']
|
18
|
-
|
19
|
-
spec.add_development_dependency 'bundler', '~> 1.10'
|
20
|
-
spec.add_development_dependency 'rake', '~> 10.0'
|
21
|
-
spec.add_development_dependency 'rspec'
|
22
|
-
end
|