absolutely 5.1.0 → 6.0.0
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 +4 -4
- data/CHANGELOG.md +8 -0
- data/CONTRIBUTING.md +2 -2
- data/README.md +4 -4
- data/absolutely.gemspec +9 -4
- data/lib/absolutely/uri.rb +4 -2
- data/lib/absolutely/version.rb +3 -1
- data/lib/absolutely.rb +32 -29
- metadata +11 -11
- data/lib/absolutely/exceptions.rb +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1aa2a1da53e491e2cfa5cd9338f7d5d10eb817a936576b01ed34ba1da52af7c
|
4
|
+
data.tar.gz: 982e6b3a9855040e398119be1bdc8e3a31fac9289315647a046f8e21ce3d78bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2240df9bf4081b825e303f378a29ba8f1373c240ea1e611e5ffe25adbe9f2cdc11290afc4d756d5f64eb52e83acee79c5e59dd59729e373adb9a832f08ed20c6
|
7
|
+
data.tar.gz: b976465c3c4f2d1e58e43a853397be490a6b763f28ee52228bb72c65481d447aa9bc27877ea5c882dc3bc3d7ae8c6baec51ce745fbff6809c1730c68cca6acac
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 6.0.0 / 2022-05-02
|
4
|
+
|
5
|
+
- **Breaking change:** Rename `AbsolutelyError` to `Error` (efcd8fa)
|
6
|
+
- Remove Reek (0d73600)
|
7
|
+
- Update Addressable dependency constraint (5faefa9)
|
8
|
+
- **Breaking change:** Set minimum supported Ruby to 2.6 (b888d5e)
|
9
|
+
- Update development Ruby to 2.6.10 (b84d268)
|
10
|
+
|
3
11
|
## 5.1.0 / 2021-04-02
|
4
12
|
|
5
13
|
- Expand supported Ruby versions to include 3.0 (c9741de)
|
data/CONTRIBUTING.md
CHANGED
@@ -8,9 +8,9 @@ There are a couple ways you can help improve Absolutely:
|
|
8
8
|
|
9
9
|
## Getting Started
|
10
10
|
|
11
|
-
Absolutely is developed using Ruby 2.
|
11
|
+
Absolutely is developed using Ruby 2.6.10 and is additionally tested against Ruby 2.7, 3.0, and 3.1 using [GitHub Actions](https://github.com/jgarber623/absolutely/actions).
|
12
12
|
|
13
|
-
Before making changes to Absolutely, you'll want to install Ruby 2.
|
13
|
+
Before making changes to Absolutely, you'll want to install Ruby 2.6.10. It's recommended that you use a Ruby version managment tool like [rbenv](https://github.com/rbenv/rbenv), [chruby](https://github.com/postmodern/chruby), or [rvm](https://github.com/rvm/rvm). Once you've installed Ruby 2.6.10 using your method of choice, install the project's gems by running:
|
14
14
|
|
15
15
|
```sh
|
16
16
|
bundle install
|
data/README.md
CHANGED
@@ -4,20 +4,20 @@
|
|
4
4
|
|
5
5
|
[](https://rubygems.org/gems/absolutely)
|
6
6
|
[](https://rubygems.org/gems/absolutely)
|
7
|
-
[](https://github.com/jgarber623/absolutely/actions/workflows/ci.yml)
|
8
8
|
[](https://codeclimate.com/github/jgarber623/absolutely)
|
9
9
|
[](https://codeclimate.com/github/jgarber623/absolutely/code)
|
10
10
|
|
11
11
|
## Key Features
|
12
12
|
|
13
13
|
- Uses the [Addressable](https://github.com/sporkmonger/addressable) Ruby gem for improved URI parsing.
|
14
|
-
- Supports Ruby 2.
|
14
|
+
- Supports Ruby 2.6 and newer.
|
15
15
|
|
16
16
|
## Getting Started
|
17
17
|
|
18
|
-
Before installing and using Absolutely, you'll want to have [Ruby](https://www.ruby-lang.org) 2.
|
18
|
+
Before installing and using Absolutely, you'll want to have [Ruby](https://www.ruby-lang.org) 2.6 (or newer) installed. It's recommended that you use a Ruby version managment tool like [rbenv](https://github.com/rbenv/rbenv), [chruby](https://github.com/postmodern/chruby), or [rvm](https://github.com/rvm/rvm).
|
19
19
|
|
20
|
-
Absolutely is developed using Ruby 2.
|
20
|
+
Absolutely is developed using Ruby 2.6.10 and is additionally tested against Ruby 2.7, 3.0, and 3.1 using [CircleCI](https://app.circleci.com/pipelines/github/jgarber623/absolutely).
|
21
21
|
|
22
22
|
## Installation
|
23
23
|
|
data/absolutely.gemspec
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative 'lib/absolutely/version'
|
2
4
|
|
3
5
|
Gem::Specification.new do |spec|
|
4
|
-
spec.required_ruby_version =
|
6
|
+
spec.required_ruby_version = '>= 2.6', '< 4'
|
5
7
|
|
6
8
|
spec.name = 'absolutely'
|
7
9
|
spec.version = Absolutely::VERSION
|
@@ -19,8 +21,11 @@ Gem::Specification.new do |spec|
|
|
19
21
|
|
20
22
|
spec.require_paths = ['lib']
|
21
23
|
|
22
|
-
spec.metadata
|
23
|
-
|
24
|
+
spec.metadata = {
|
25
|
+
'bug_tracker_uri' => "#{spec.homepage}/issues",
|
26
|
+
'changelog_uri' => "#{spec.homepage}/blob/v#{spec.version}/CHANGELOG.md",
|
27
|
+
'rubygems_mfa_required' => 'true'
|
28
|
+
}
|
24
29
|
|
25
|
-
spec.add_runtime_dependency 'addressable', '~> 2.
|
30
|
+
spec.add_runtime_dependency 'addressable', '~> 2.8'
|
26
31
|
end
|
data/lib/absolutely/uri.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Absolutely
|
2
4
|
class URI
|
3
5
|
attr_reader :base, :relative
|
@@ -24,8 +26,8 @@ module Absolutely
|
|
24
26
|
relative_uri
|
25
27
|
|
26
28
|
raise ArgumentError, 'base must be an absolute URL (e.g. https://example.com)' unless base_uri.absolute?
|
27
|
-
rescue Addressable::URI::InvalidURIError =>
|
28
|
-
raise InvalidURIError,
|
29
|
+
rescue Addressable::URI::InvalidURIError => e
|
30
|
+
raise InvalidURIError, e
|
29
31
|
end
|
30
32
|
|
31
33
|
# @return [Addressable::URI]
|
data/lib/absolutely/version.rb
CHANGED
data/lib/absolutely.rb
CHANGED
@@ -1,37 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'addressable/uri'
|
2
4
|
|
3
|
-
|
4
|
-
require 'absolutely/exceptions'
|
5
|
+
require_relative 'absolutely/version'
|
5
6
|
|
6
|
-
|
7
|
+
require_relative 'absolutely/uri'
|
7
8
|
|
8
9
|
module Absolutely
|
9
|
-
class
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
10
|
+
class Error < StandardError; end
|
11
|
+
class ArgumentError < Error; end
|
12
|
+
class InvalidURIError < Error; end
|
13
|
+
|
14
|
+
# Convert a relative path to an absolute URI.
|
15
|
+
#
|
16
|
+
# @param base [String] an absolute URI used to resolve relative path
|
17
|
+
# @param relative [String] a relative path
|
18
|
+
# @return [String]
|
19
|
+
#
|
20
|
+
# @example
|
21
|
+
# Absolutely.to_abs(base: 'https://example.com', relative: '/foo')
|
22
|
+
# #=> "https://example.com/foo"
|
23
|
+
def self.to_abs(base:, relative:)
|
24
|
+
uri(base: base, relative: relative).to_abs
|
25
|
+
end
|
22
26
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
end
|
27
|
+
# Create an Absolutely::URI from a base URI and a relative path.
|
28
|
+
#
|
29
|
+
# @param base [String] an absolute URI used to resolve relative path
|
30
|
+
# @param relative [String] a relative path
|
31
|
+
# @return [Absolutely::URI]
|
32
|
+
#
|
33
|
+
# @example
|
34
|
+
# uri = Absolutely.uri(base: 'https://example.com', relative: '/foo')
|
35
|
+
# puts uri.to_abs
|
36
|
+
# #=> "https://example.com/foo"
|
37
|
+
def self.uri(base:, relative:)
|
38
|
+
URI.new(base: base, relative: relative)
|
36
39
|
end
|
37
40
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: absolutely
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 6.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Garber
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-05-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '2.
|
19
|
+
version: '2.8'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '2.
|
26
|
+
version: '2.8'
|
27
27
|
description: Convert relative paths to absolute URIs.
|
28
28
|
email:
|
29
29
|
- jason@sixtwothree.org
|
@@ -37,7 +37,6 @@ files:
|
|
37
37
|
- README.md
|
38
38
|
- absolutely.gemspec
|
39
39
|
- lib/absolutely.rb
|
40
|
-
- lib/absolutely/exceptions.rb
|
41
40
|
- lib/absolutely/uri.rb
|
42
41
|
- lib/absolutely/version.rb
|
43
42
|
homepage: https://github.com/jgarber623/absolutely
|
@@ -45,8 +44,9 @@ licenses:
|
|
45
44
|
- MIT
|
46
45
|
metadata:
|
47
46
|
bug_tracker_uri: https://github.com/jgarber623/absolutely/issues
|
48
|
-
changelog_uri: https://github.com/jgarber623/absolutely/blob/
|
49
|
-
|
47
|
+
changelog_uri: https://github.com/jgarber623/absolutely/blob/v6.0.0/CHANGELOG.md
|
48
|
+
rubygems_mfa_required: 'true'
|
49
|
+
post_install_message:
|
50
50
|
rdoc_options: []
|
51
51
|
require_paths:
|
52
52
|
- lib
|
@@ -54,7 +54,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
54
54
|
requirements:
|
55
55
|
- - ">="
|
56
56
|
- !ruby/object:Gem::Version
|
57
|
-
version: '2.
|
57
|
+
version: '2.6'
|
58
58
|
- - "<"
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '4'
|
@@ -64,8 +64,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
64
64
|
- !ruby/object:Gem::Version
|
65
65
|
version: '0'
|
66
66
|
requirements: []
|
67
|
-
rubygems_version: 3.
|
68
|
-
signing_key:
|
67
|
+
rubygems_version: 3.3.12
|
68
|
+
signing_key:
|
69
69
|
specification_version: 4
|
70
70
|
summary: Convert relative paths to absolute URIs.
|
71
71
|
test_files: []
|