sitemap_check 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 76322607062a03edd3e89ad18051a1cf76f71575
4
- data.tar.gz: 142105b93ce443eb5fb74e7a007b5ca81d938d8a
3
+ metadata.gz: 4e69b470a984ae38c8a202d0e735cbfa617b97fe
4
+ data.tar.gz: 16c23271e24dad8c8abf9fc426c90d2a327153fd
5
5
  SHA512:
6
- metadata.gz: 722be760c58a8a95575bfc0736427159ed4b2ec895ab19c809b1ed9dd7d538f2a68bbdbe75ee801bb16a5bdb9d7dbf029f2849e420280ed45c7cbb9cec6bec86
7
- data.tar.gz: e84297068dccbd3303d89d14f104f07a970a57bcc5f7315f6b6e088568841ce5027de24cde4a4fb54a6c51a6635d1f270a69f7597f268bf2706a4258e5a00394
6
+ metadata.gz: 3b8b09b2b0aff796389dcaf4d118af6330bd426778ba51eb10fff276bfe7e06ba63af211c8660bbcac2d23d09c2914c5ad6b93bd1e3ecfbb6cee218ba71a19da
7
+ data.tar.gz: 3f0b6cdea46515e69f31405970deabac7de5c74bd7fb5945527de3a9a07218ff29971205cb1315e82f0a3a516a17d4db2e55439de00715cb75c10f698ce7279b
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.2.2
1
+ 2.3.3
data/.travis.yml CHANGED
@@ -1,11 +1,13 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.2.2
4
- - 2.1.6
5
- - ruby-2.0.0-p598
3
+ - 2.4.0
4
+ - 2.3.3
5
+ - 2.2.6
6
+ - 2.1.10
6
7
  - ruby-head
7
8
  - jruby-1.7.19
8
- before_install: gem install bundler
9
+ before_install: gem update --system && gem install bundler
10
+ after_success: bundle exec codeclimate-test-reporter
9
11
  sudo: false
10
12
  addons:
11
13
  code_climate:
data/Dockerfile ADDED
@@ -0,0 +1,18 @@
1
+ FROM quay.io/assemblyline/alpine:3.5
2
+
3
+ RUN apk add --no-cache --virtual .builddeps \
4
+ build-base \
5
+ ruby-dev=2.3.3-r100 \
6
+ ruby=2.3.3-r100 \
7
+ zlib-dev \
8
+ && gem install sitemap_check --no-document \
9
+ && runDeps="$( \
10
+ scanelf --needed --nobanner --recursive /usr/lib/ruby/gems \
11
+ | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
12
+ | sort -u \
13
+ | xargs -r apk info --installed \
14
+ | sort -u \
15
+ )" \
16
+ && apk add --no-cache --virtual .rundeps $runDeps ruby=2.3.3-r100 ca-certificates \
17
+ && apk del --no-cache .builddeps
18
+ ENTRYPOINT ["sitemap_check"]
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in sitemap_check.gemspec
4
4
  gemspec
data/README.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Sitemap Check
2
2
 
3
+ [![Build Status](https://travis-ci.org/reevoo/sitemap_check.svg?branch=master)](https://travis-ci.org/reevoo/sitemap_check)
4
+ [![Code Climate](https://codeclimate.com/github/reevoo/sitemap_check/badges/gpa.svg)](https://codeclimate.com/github/reevoo/sitemap_check)
5
+ [![Test Coverage](https://codeclimate.com/github/reevoo/sitemap_check/badges/coverage.svg)](https://codeclimate.com/github/reevoo/sitemap_check/coverage)
6
+ [![Gem Version](https://badge.fury.io/rb/sitemap_check.svg)](https://rubygems.org/gems/sitemap_check)
7
+
3
8
  ## Install
4
9
 
5
10
  `gem install sitemap_check`
@@ -10,6 +15,18 @@
10
15
  $ CHECK_URL=http://reevoo.com/sitemap_index.xml sitemap_check
11
16
  ```
12
17
 
18
+ `CHECK_URL` can also be passed as an argument to sitemap_check
19
+
20
+ ```bash
21
+ $ sitemap_check http://reevoo.com/sitemap_index.xml
22
+ ```
23
+
24
+ # Docker
25
+
26
+ ```bash
27
+ $ docker run --rm quay.io/reevoo/sitemap_check https://reevoo.com/sitemap_index.xml
28
+ ```
29
+
13
30
  ## Config
14
31
 
15
32
  Config can be set with enviroment variables
@@ -18,3 +35,4 @@ variable | default | description
18
35
  -------------|---------|-------------
19
36
  `CHECK_URL` | `nil` | The url of the sitemap or sitemap index to check
20
37
  `CONCURRENCY`| `10` | The number of concurent threads to use when checking the sitemap
38
+
data/Rakefile CHANGED
@@ -1,10 +1,19 @@
1
- require 'bundler/gem_tasks'
2
- require 'reevoocop/rake_task'
3
- require 'rspec/core/rake_task'
1
+ require "bundler/gem_tasks"
2
+ require "reevoocop/rake_task"
3
+ require "rspec/core/rake_task"
4
4
 
5
5
  ReevooCop::RakeTask.new(:reevoocop)
6
6
  RSpec::Core::RakeTask.new(:spec)
7
7
 
8
+ DOCKER_REPO = "quay.io/reevoo/sitemap_check"
9
+
8
10
  task default: [:spec, :reevoocop]
9
11
  task release: [:spec, :reevoocop]
10
12
  task build: [:spec, :reevoocop]
13
+
14
+ task :release do
15
+ sh "docker build -t #{DOCKER_REPO}:#{SitemapCheck::VERSION} ."
16
+ sh "docker build -t #{DOCKER_REPO}:latest ."
17
+ sh "docker push #{DOCKER_REPO}:#{SitemapCheck::VERSION}"
18
+ sh "docker push #{DOCKER_REPO}:latest"
19
+ end
data/bin/sitemap_check CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'sitemap_check'
4
- SitemapCheck.check
3
+ require "sitemap_check"
4
+ puts ARGV[0]
5
+ SitemapCheck.check ARGV[0]
data/lib/sitemap_check.rb CHANGED
@@ -1,19 +1,20 @@
1
- require 'colorize'
2
- require 'sitemap_check/sitemap'
1
+ require "colorize"
2
+ require "sitemap_check/sitemap"
3
3
 
4
4
  class SitemapCheck
5
5
 
6
6
 
7
- def self.check
7
+ def self.check(url)
8
8
  $stdout.sync = true
9
- new.check
9
+ new(url).check
10
10
  end
11
11
 
12
- def initialize(http = HTTPClient.new)
12
+ def initialize(url = nil, http = HTTPClient.new)
13
13
  self.start_time = Time.now
14
14
  self.exit_code = 0
15
- puts "Expanding Sitemaps from #{ENV['CHECK_URL']}"
16
- self.sitemaps = Sitemap.new(ENV['CHECK_URL'], http).sitemaps
15
+ check_url = url || ENV.fetch("CHECK_URL")
16
+ puts "Expanding Sitemaps from #{check_url}"
17
+ self.sitemaps = Sitemap.new(check_url, http).sitemaps
17
18
  end
18
19
 
19
20
  def check
@@ -30,7 +31,7 @@ class SitemapCheck
30
31
  private
31
32
 
32
33
  def stats
33
- puts "checked #{sitemaps.count} sitemaps and #{checked_pages} in #{time_taken} seconds"
34
+ puts "checked #{sitemaps.count} sitemaps and #{checked_pages} pages in #{time_taken} seconds"
34
35
  puts "thats #{pages_per_second} pages per second"
35
36
  end
36
37
 
@@ -51,7 +52,7 @@ class SitemapCheck
51
52
  puts " #{sitemap.url} does not exist".red.bold
52
53
  self.exit_code = 1
53
54
  end
54
- puts ''
55
+ puts ""
55
56
  end
56
57
 
57
58
  def good_sitemaps
@@ -73,7 +74,7 @@ class SitemapCheck
73
74
  nothing_doing
74
75
  end
75
76
  end
76
- puts ''
77
+ puts ""
77
78
  end
78
79
 
79
80
  def missing_pages(sitemap)
@@ -86,6 +87,6 @@ class SitemapCheck
86
87
  end
87
88
 
88
89
  def nothing_doing
89
- puts ' this sitemap did not contain any pages'.green
90
+ puts " this sitemap did not contain any pages".green
90
91
  end
91
92
  end
@@ -1,4 +1,4 @@
1
- require 'httpclient'
1
+ require "httpclient"
2
2
 
3
3
  class SitemapCheck
4
4
  class Page
@@ -1,8 +1,8 @@
1
- require 'httpclient'
2
- require 'sitemap_check/page'
3
- require 'sitemap_check/logger'
4
- require 'nokogiri'
5
- require 'colorize'
1
+ require "httpclient"
2
+ require "sitemap_check/page"
3
+ require "sitemap_check/logger"
4
+ require "nokogiri"
5
+ require "colorize"
6
6
 
7
7
  class SitemapCheck
8
8
  class Sitemap
@@ -44,7 +44,7 @@ class SitemapCheck
44
44
  private
45
45
 
46
46
  def concurency
47
- ENV.fetch('CONCURRENCY', '10').to_i
47
+ ENV.fetch("CONCURRENCY", "10").to_i
48
48
  end
49
49
 
50
50
  def find_missing_pages # rubocop:disable Metrics/AbcSize
@@ -1,3 +1,3 @@
1
1
  class SitemapCheck
2
- VERSION = '0.1.2'
2
+ VERSION = "0.1.3"
3
3
  end
@@ -1,30 +1,30 @@
1
1
  # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
2
+ lib = File.expand_path("../lib", __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'sitemap_check/version'
4
+ require "sitemap_check/version"
5
5
 
6
6
  Gem::Specification.new do |spec|
7
- spec.name = 'sitemap_check'
7
+ spec.name = "sitemap_check"
8
8
  spec.version = SitemapCheck::VERSION
9
- spec.authors = ['Ed Robinson']
10
- spec.email = ['ed@reevoo.com']
9
+ spec.authors = ["Ed Robinson"]
10
+ spec.email = ["ed@reevoo.com"]
11
11
 
12
- spec.summary = 'Check for broken links in your sitemap'
13
- spec.homepage = 'https://github.com/reevoo/sitemap_check'
14
- spec.license = 'MIT'
12
+ spec.summary = "Check for broken links in your sitemap"
13
+ spec.homepage = "https://github.com/reevoo/sitemap_check"
14
+ spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(/^spec\//) }
17
- spec.bindir = 'bin'
17
+ spec.bindir = "bin"
18
18
  spec.executables = spec.files.grep(/^bin\//) { |f| File.basename(f) }
19
- spec.require_paths = ['lib']
19
+ spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency 'nokogiri', '~> 1.5'
22
- spec.add_dependency 'httpclient', '~> 2.6'
23
- spec.add_dependency 'colorize', '~> 0.7'
24
- spec.add_development_dependency 'bundler', '~> 1.9'
25
- spec.add_development_dependency 'rake', '~> 10.0'
26
- spec.add_development_dependency 'rspec', '~> 3.1'
27
- spec.add_development_dependency 'reevoocop'
28
- spec.add_development_dependency 'pry'
29
- spec.add_development_dependency 'codeclimate-test-reporter'
21
+ spec.add_dependency "nokogiri", "~> 1.5"
22
+ spec.add_dependency "httpclient", "~> 2.6"
23
+ spec.add_dependency "colorize", "~> 0.7"
24
+ spec.add_development_dependency "bundler", "~> 1.9"
25
+ spec.add_development_dependency "rake", "~> 10.0"
26
+ spec.add_development_dependency "rspec", "~> 3.1"
27
+ spec.add_development_dependency "reevoocop"
28
+ spec.add_development_dependency "pry"
29
+ spec.add_development_dependency "codeclimate-test-reporter"
30
30
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sitemap_check
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ed Robinson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-13 00:00:00.000000000 Z
11
+ date: 2017-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -149,6 +149,7 @@ files:
149
149
  - ".ruby-version"
150
150
  - ".travis.yml"
151
151
  - CODE_OF_CONDUCT.md
152
+ - Dockerfile
152
153
  - Gemfile
153
154
  - LICENCE
154
155
  - README.md
@@ -180,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
180
181
  version: '0'
181
182
  requirements: []
182
183
  rubyforge_project:
183
- rubygems_version: 2.4.5
184
+ rubygems_version: 2.6.10
184
185
  signing_key:
185
186
  specification_version: 4
186
187
  summary: Check for broken links in your sitemap