url_canonicalize 0.1.15 → 0.2.0

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
- SHA1:
3
- metadata.gz: 9843f990e987c4724142b84af26556ebc39506c5
4
- data.tar.gz: d6d7772634ae4c1e1e047426fe4f73793ccfea55
2
+ SHA256:
3
+ metadata.gz: 510cbc3c33819c97d28ca20d712d18c2ea25ccf29846b5f6f5c35e3e92b67513
4
+ data.tar.gz: f9ec2c8be1e3d23d2a0011de38452577b0d4978924b77f409229204df6cea2c0
5
5
  SHA512:
6
- metadata.gz: 70070a42151902f6ac717975a4b1eb9e127e139ee48108e269225742a21e76d95dc3150966d4fb36e8544f26454c8e790beb98e90c19758bcb1f41cc0fa16538
7
- data.tar.gz: 2877f4747861cd3b5d0a68dcd9ffeec42b2d1f868214dd903cb1fd7ceabefe82c4ca39032d13552a219d32d4891e575ce09392fe3cc4fb371f05289904e53597
6
+ metadata.gz: f12b8967b5399aea9cd88642d14c1ed570e158ee62beb6642dd8e3534c42435064659a6ed49aea6f6f0adc3dab38455d83f71919fd1e5407239798579986adf5
7
+ data.tar.gz: d850c233c28d0d5cef5a7abe670278a69f35c9c4d7fee12886ae77b51030d3bb73fdb00e1b19a2a72558d3dffddcc736c7f374de987f6763e1fda24f875c1124
@@ -1,44 +1,53 @@
1
1
  ---
2
2
  AllCops:
3
+ DisplayStyleGuide: true
4
+ DisplayCopNames: true
5
+ TargetRubyVersion: 2.2
3
6
  Exclude:
4
7
  - '*.gemspec'
5
- - 'spec/**/*'
8
+ - spec/**/*
6
9
 
7
- Performance/RegexpMatch:
8
- Enabled: false # match? is only available in Ruby 2.4+
9
10
 
10
- Style/TrailingCommaInArguments:
11
- EnforcedStyleForMultiline: no_comma
11
+ Layout/DotPosition:
12
+ Description: 'Checks the position of the dot in multi-line method calls.'
13
+ EnforcedStyle: leading
12
14
  Enabled: true
13
15
 
14
- StringLiterals:
15
- EnforcedStyle: single_quotes
16
+ Layout/ExtraSpacing:
17
+ Description: 'Do not use unnecessary spacing.'
16
18
  Enabled: true
17
19
 
18
- LineLength:
19
- Max: 120
20
- Exclude:
21
- - 'spec/**/*'
20
+ Lint/LiteralInInterpolation:
21
+ Description: 'Avoid interpolating literals in strings'
22
+ AutoCorrect: true
23
+
24
+ Metrics/ClassLength:
25
+ CountComments: false # count full line comments?
26
+ Max: 200
22
27
 
23
- MethodLength:
28
+ Metrics/MethodLength:
24
29
  Max: 12
25
30
 
26
- DotPosition:
27
- Description: 'Checks the position of the dot in multi-line method calls.'
28
- EnforcedStyle: leading
31
+ Metrics/LineLength:
32
+ Max: 120
33
+ Exclude:
34
+ - spec/**/*
35
+
36
+ Naming/FileName:
37
+ Description: 'Use snake_case for source file names.'
29
38
  Enabled: true
30
39
 
31
- ClassAndModuleChildren:
40
+ Style/ClassAndModuleChildren:
32
41
  Description: 'Checks style of children classes and modules.'
33
42
  EnforcedStyle: nested
34
43
  Enabled: true
35
44
 
36
- Documentation:
45
+ Style/Documentation:
37
46
  Description: 'Document classes and non-namespace modules.'
38
47
  Enabled: false
39
48
 
40
- FileName:
41
- Description: 'Use snake_case for source file names.'
49
+ Style/StringLiterals:
50
+ EnforcedStyle: single_quotes
42
51
  Enabled: true
43
52
 
44
53
  Style/SymbolArray:
@@ -46,14 +55,6 @@ Style/SymbolArray:
46
55
  StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-i'
47
56
  Enabled: false # Only available in Ruby 2.0+
48
57
 
49
- Style/ExtraSpacing:
50
- Description: 'Do not use unnecessary spacing.'
58
+ Style/TrailingCommaInArguments:
59
+ EnforcedStyleForMultiline: no_comma
51
60
  Enabled: true
52
-
53
- Lint/LiteralInInterpolation:
54
- Description: 'Avoid interpolating literals in strings'
55
- AutoCorrect: true
56
-
57
- Metrics/ClassLength:
58
- CountComments: false # count full line comments?
59
- Max: 200
@@ -1,6 +1,10 @@
1
1
  ---
2
2
  language: ruby
3
3
  rvm:
4
- - 2.4.0
4
+ - 2.2
5
+ - 2.3
6
+ - 2.4
7
+ - 2.5
8
+ - 2.6
5
9
  script:
6
10
  - rspec
@@ -0,0 +1,81 @@
1
+ # Change Log
2
+
3
+ ## [v0.1.15](https://github.com/dominicsayers/url_canonicalize/tree/v0.1.15) (2017-03-14)
4
+ [Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.1.14...v0.1.15)
5
+
6
+ ## [v0.1.14](https://github.com/dominicsayers/url_canonicalize/tree/v0.1.14) (2017-03-13)
7
+ [Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.1.13...v0.1.14)
8
+
9
+ ## [v0.1.13](https://github.com/dominicsayers/url_canonicalize/tree/v0.1.13) (2017-03-13)
10
+ [Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.1.12...v0.1.13)
11
+
12
+ ## [v0.1.12](https://github.com/dominicsayers/url_canonicalize/tree/v0.1.12) (2017-03-13)
13
+ [Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.1.11...v0.1.12)
14
+
15
+ ## [v0.1.11](https://github.com/dominicsayers/url_canonicalize/tree/v0.1.11) (2017-03-13)
16
+ [Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.1.10...v0.1.11)
17
+
18
+ ## [v0.1.10](https://github.com/dominicsayers/url_canonicalize/tree/v0.1.10) (2017-03-13)
19
+ [Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.1.9...v0.1.10)
20
+
21
+ **Closed issues:**
22
+
23
+ - URLCanonicalize doesn't accept host names [\#4](https://github.com/dominicsayers/url_canonicalize/issues/4)
24
+
25
+ ## [v0.1.9](https://github.com/dominicsayers/url_canonicalize/tree/v0.1.9) (2017-03-06)
26
+ [Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.1.8...v0.1.9)
27
+
28
+ ## [v0.1.8](https://github.com/dominicsayers/url_canonicalize/tree/v0.1.8) (2017-03-06)
29
+ [Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.1.7...v0.1.8)
30
+
31
+ **Closed issues:**
32
+
33
+ - Use a later version of Ruby on CircleCI [\#3](https://github.com/dominicsayers/url_canonicalize/issues/3)
34
+
35
+ ## [v0.1.7](https://github.com/dominicsayers/url_canonicalize/tree/v0.1.7) (2017-03-06)
36
+ [Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.1.6...v0.1.7)
37
+
38
+ **Closed issues:**
39
+
40
+ - Insecure version of Nokogiri [\#2](https://github.com/dominicsayers/url_canonicalize/issues/2)
41
+
42
+ ## [v0.1.6](https://github.com/dominicsayers/url_canonicalize/tree/v0.1.6) (2017-03-06)
43
+ [Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.1.5...v0.1.6)
44
+
45
+ ## [v0.1.5](https://github.com/dominicsayers/url_canonicalize/tree/v0.1.5) (2016-10-26)
46
+ [Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.1.4...v0.1.5)
47
+
48
+ ## [v0.1.4](https://github.com/dominicsayers/url_canonicalize/tree/v0.1.4) (2016-10-26)
49
+ [Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.1.2...v0.1.4)
50
+
51
+ ## [v0.1.2](https://github.com/dominicsayers/url_canonicalize/tree/v0.1.2) (2016-10-26)
52
+ [Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.1.1...v0.1.2)
53
+
54
+ ## [v0.1.1](https://github.com/dominicsayers/url_canonicalize/tree/v0.1.1) (2016-10-26)
55
+ [Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.1.0...v0.1.1)
56
+
57
+ ## [v0.1.0](https://github.com/dominicsayers/url_canonicalize/tree/v0.1.0) (2016-10-20)
58
+ [Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.0.7...v0.1.0)
59
+
60
+ ## [v0.0.7](https://github.com/dominicsayers/url_canonicalize/tree/v0.0.7) (2016-10-20)
61
+ [Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.0.6...v0.0.7)
62
+
63
+ ## [v0.0.6](https://github.com/dominicsayers/url_canonicalize/tree/v0.0.6) (2016-10-20)
64
+ [Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.0.5...v0.0.6)
65
+
66
+ ## [v0.0.5](https://github.com/dominicsayers/url_canonicalize/tree/v0.0.5) (2016-10-20)
67
+ [Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.0.4...v0.0.5)
68
+
69
+ ## [v0.0.4](https://github.com/dominicsayers/url_canonicalize/tree/v0.0.4) (2016-10-20)
70
+ [Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.0.3...v0.0.4)
71
+
72
+ ## [v0.0.3](https://github.com/dominicsayers/url_canonicalize/tree/v0.0.3) (2016-10-20)
73
+ [Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.0.2...v0.0.3)
74
+
75
+ ## [v0.0.2](https://github.com/dominicsayers/url_canonicalize/tree/v0.0.2) (2016-10-20)
76
+ [Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.0.1...v0.0.2)
77
+
78
+ ## [v0.0.1](https://github.com/dominicsayers/url_canonicalize/tree/v0.0.1) (2016-10-20)
79
+
80
+
81
+ \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
data/Gemfile CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  source 'https://rubygems.org'
3
4
 
4
5
  gemspec
@@ -1,11 +1,12 @@
1
1
  # Copy this file to a file named Gemfile.local to add these gems to your dev toolset
2
2
  # Feel free to modify Gemfile.local to suit your own preferences
3
3
  group :development do
4
- gem 'rake'
4
+ gem 'github_changelog_generator'
5
5
  gem 'gem-release'
6
- gem 'rubocop'
7
- gem 'listen', '~> 3.0', '< 3.1' # Dependency of guard, 3.1 requires Ruby 2.2+
8
6
  gem 'guard'
9
7
  gem 'guard-rspec'
10
8
  gem 'guard-rubocop'
9
+ gem 'listen', '~> 3.0', '< 3.1' # Dependency of guard, 3.1 requires Ruby 2.2+
10
+ gem 'rake'
11
+ gem 'rubocop'
11
12
  end
data/Guardfile CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  guard :rubocop do
3
4
  watch(/.+\.rb$/)
4
5
  watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
data/README.md CHANGED
@@ -2,10 +2,12 @@
2
2
  [![Gem Version](https://badge.fury.io/rb/url_canonicalize.svg)](https://rubygems.org/gems/url_canonicalize)
3
3
  [![Gem downloads](https://img.shields.io/gem/dt/url_canonicalize.svg)](https://rubygems.org/gems/url_canonicalize)
4
4
  [![Build status](https://img.shields.io/circleci/project/dominicsayers/url_canonicalize/master.svg)](https://circleci.com/gh/dominicsayers/url_canonicalize)
5
- [![Code quality](http://img.shields.io/codeclimate/github/dominicsayers/url_canonicalize.svg?style=flat)](https://codeclimate.com/github/dominicsayers/url_canonicalize)
5
+ [![Maintainability](https://api.codeclimate.com/v1/badges/1f92f784d12741a942ec/maintainability)](https://codeclimate.com/github/dominicsayers/url_canonicalize/maintainability)
6
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/1f92f784d12741a942ec/test_coverage)](https://codeclimate.com/github/dominicsayers/url_canonicalize/test_coverage)
6
7
  [![Coverage Status](https://coveralls.io/repos/github/dominicsayers/url_canonicalize/badge.svg?branch=master)](https://coveralls.io/github/dominicsayers/url_canonicalize?branch=master)
7
8
  [![Dependency Status](https://dependencyci.com/github/dominicsayers/url_canonicalize/badge)](https://dependencyci.com/github/dominicsayers/url_canonicalize)
8
9
  [![Security](https://hakiri.io/github/dominicsayers/url_canonicalize/master.svg)](https://hakiri.io/github/dominicsayers/url_canonicalize/master)
10
+ [![Codacy Badge](https://api.codacy.com/project/badge/Grade/1b8d50209b8c41a2b8200e25a63d57b3)](https://www.codacy.com/app/dominicsayers/url_canonicalize)
9
11
 
10
12
  URLCanonicalize is a Ruby gem that finds the canonical version of a URL. It
11
13
  provides `canonicalize` methods for the String, URI::HTTP, URI::HTTPS and
data/Rakefile CHANGED
@@ -1,2 +1,3 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'bundler/gem_tasks'
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Addressable
3
4
  # Patch for Addressable's URI class
4
5
  class URI
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  # Patch for Ruby's String class
3
4
  class String
4
5
  def canonicalize
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module URI
3
4
  # URI having the HTTP protocol
4
5
  class HTTP
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'uri'
3
4
  require 'addressable/uri'
4
5
  require 'net/http'
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  # Core methods
3
4
  module URLCanonicalize
4
5
  # Local exception classes to make handling exceptions easier
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module URLCanonicalize
3
4
  # Persistent connection for possible repeated requests to the same host
4
5
  class HTTP
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module URLCanonicalize
3
4
  # Make an HTTP request
4
5
  class Request
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module URLCanonicalize
3
4
  # The response from an HTTP request
4
5
  module Response
@@ -18,6 +19,10 @@ module URLCanonicalize
18
19
  class Success < Generic
19
20
  attr_reader :response, :html
20
21
 
22
+ def xml
23
+ @xml ||= Nokogiri::XML response.body
24
+ end
25
+
21
26
  private
22
27
 
23
28
  def initialize(url, response, html)
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module URLCanonicalize
3
4
  # Manage the URL into a URI with local exception handling
4
5
  class URI
@@ -26,7 +27,7 @@ module URLCanonicalize
26
27
  end
27
28
 
28
29
  VALID_CLASSES = [::URI::HTTP, ::URI::HTTPS].freeze
29
- COLON = ':'
30
+ COLON = ':'.freeze
30
31
  end
31
32
  end
32
33
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module URLCanonicalize
3
- VERSION = '0.1.15'
4
+ VERSION = '0.2.0'.freeze
4
5
  end
@@ -24,5 +24,5 @@ Gem::Specification.new do |s|
24
24
  s.require_paths = ['lib']
25
25
 
26
26
  s.add_dependency 'addressable', '~> 2' # To normalize URLs
27
- s.add_dependency 'nokogiri', '>= 1.6.8' # To look for <link rel="canonical" ...> in HTML
27
+ s.add_dependency 'nokogiri', '>= 1.8.2' # To look for <link rel="canonical" ...> in HTML
28
28
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: url_canonicalize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.15
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dominic Sayers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-14 00:00:00.000000000 Z
11
+ date: 2018-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 1.6.8
33
+ version: 1.8.2
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 1.6.8
40
+ version: 1.8.2
41
41
  description: 'Rubygem that finds the canonical version of a URL by providing #canonicalize
42
42
  methods for the String, URI::HTTP, URI::HTTPS and Addressable::URI classes'
43
43
  email:
@@ -53,6 +53,7 @@ files:
53
53
  - ".rubocop.yml"
54
54
  - ".ruby-gemset"
55
55
  - ".travis.yml"
56
+ - CHANGELOG.md
56
57
  - Gemfile
57
58
  - Gemfile.local.example
58
59
  - Guardfile
@@ -91,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
92
  version: '0'
92
93
  requirements: []
93
94
  rubyforge_project:
94
- rubygems_version: 2.6.10
95
+ rubygems_version: 2.7.7
95
96
  signing_key:
96
97
  specification_version: 4
97
98
  summary: Finds the canonical version of a URL