middleman-sitemap-ping 0.0.2 → 1.0.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 309a3eaa887cd20194791af13c19fca0dc412eea
4
- data.tar.gz: ae0a75556a1fe627223a23f8b385a136759f4b8c
2
+ SHA256:
3
+ metadata.gz: f4f23eea5854352d81cd5134f898fe4b75aaeb901db083db18183529725d745b
4
+ data.tar.gz: 13bd0fb8f9111fc291410a4fa3f29df3a9e15f345a16932d8d6926772fed47fb
5
5
  SHA512:
6
- metadata.gz: 3cdb429c17adac0de3e6c73bb07ceee3e9cf8e45c7b4427bad637bb6ae475a8cdf8c891a314383d5a151c37a4d214e247fe4095b4d36aa450bef3906974bebd3
7
- data.tar.gz: 518b39e1abaf756e99032f7bcb27d346a394fa89cc7dd33d868b8f42e324aca1e6811c4151121011a405cb615767797fe35deeb9ce92776a3fdcf77b7c6bf0e7
6
+ metadata.gz: 7a4ea5dd44ced8d5124931a32d211fc29906c77811d3b171a52ec81aa5e55c833627b1cf0deeeb48b9ad67a48da3efa52fc4df5fc91acb2107b749442eb43d68
7
+ data.tar.gz: 786ba6b3c5248c9507cdd792f6ee4df1d6a7a43bbc64238098bb4cb67512fba34b0810fa6b66f5fb7a68df97702891292347b20b1a108d8ebe1a42b4522e0139
data/CHANGELOG.md CHANGED
@@ -1,3 +1,37 @@
1
- ## 0.0.1
1
+ # Change Log
2
+ All notable changes to this project will be documented in this file.
2
3
 
4
+ The format is based on [Keep a Changelog](http://keepachangelog.com/)
5
+ and this project adheres to [Semantic Versioning](http://semver.org/).
6
+
7
+ ## [1.0.0] - 2016-11-19
8
+ ### Changed
9
+ - Updated code to work with Middleman 4
10
+
11
+ ### Added
12
+ - Added Travis CI badge to Readme
13
+
14
+ ### Removed
15
+ - Removed Rake as development dependency and empty Rakefile
16
+
17
+ ## [0.2.0] - 2015-09-05
18
+ ### Added
19
+ * Added CLI command
20
+
21
+ ## [0.1.0] - 2015-09-05
22
+ ### Added
23
+ * Added the after_build option (defaults to true)
24
+
25
+ ## [0.0.2] - 2015-07-26
26
+ ### Changed
27
+ * Updated gemspec
28
+
29
+ ## [0.0.1] - 2015-07-13
30
+ ### Added
3
31
  * Initial version
32
+
33
+ [Unreleased]: https://github.com/olivierlacan/keep-a-changelog/compare/v1.0.0...HEAD
34
+ [1.0.0]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.2.0...v1.0.0
35
+ [0.2.0]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.1.0...v0.2.0
36
+ [0.1.0]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.2...v0.1.0
37
+ [0.0.2]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.1...v0.0.2
data/README.md CHANGED
@@ -1,9 +1,7 @@
1
1
  # Middleman Sitemap Ping
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/middleman-sitemap-ping.png)](http://badge.fury.io/rb/middleman-sitemap-ping)
4
- [![Build Status](https://secure.travis-ci.org/bootstrap-ruby/middleman-sitemap-ping.png)](http://travis-ci.org/bootstrap-ruby/middleman-sitemap-ping)
5
- [![Dependency Status](https://gemnasium.com/bootstrap-ruby/middleman-sitemap-ping.png)](https://gemnasium.com/bootstrap-ruby/middleman-sitemap-ping)
6
- [![Code Climate](https://codeclimate.com/github/bootstrap-ruby/middleman-sitemap-ping.png)](https://codeclimate.com/github/bootstrap-ruby/middleman-sitemap-ping)
4
+ [![Build Status](https://secure.travis-ci.org/bootstrap-ruby/middleman-bootstrap-navbar.png)](https://travis-ci.org/krautcomputing/middleman-sitemap-ping)
7
5
 
8
6
  [Middleman](https://middlemanapp.com/) extension to ping search engines (Google and Bing) with a sitemap URL
9
7
 
@@ -21,22 +19,31 @@ Or install it yourself as:
21
19
 
22
20
  $ gem install middleman-sitemap-ping
23
21
 
24
- ## Usage
22
+ ## Versions
23
+
24
+ Use version 1.x of this gem for Middleman 4 or 0.x for Middleman 3.
25
25
 
26
- ### Activate extension
26
+ ## Usage
27
27
 
28
28
  Activate the extensions in `config.rb` in your Middleman app:
29
29
 
30
30
  ```ruby
31
31
  activate :sitemap_ping do |config|
32
- config.host = 'http://www.mywebsite.com' # The host of your website (required)
33
- config.sitemap_file = 'custom-sitemap-file.xml' # The name of your sitemap file (optional, default: sitemap.xml)
34
- config.ping_google = false # Ping Google? (optional, default: true)
35
- config.ping_bing = false # Ping Bing? (optional, default: true)
32
+ config.host = 'http://www.mywebsite.com' # (required) Host of your website
33
+ config.sitemap_file = 'custom-sitemap-file.xml' # (optional, default: sitemap.xml) Name of your sitemap file
34
+ config.ping_google = false # (optional, default: true) Ping Google?
35
+ config.ping_bing = false # (optional, default: true) Ping Bing?
36
+ config.after_build = false # (optional, default: true) Run automatically after build?
36
37
  end
37
38
  ```
38
39
 
39
- Once the extension is activated, it will ping the search engines automatically every time your site is built.
40
+ Once the extension is activated, it will ping the search engines automatically every time you build your site (unless you set `config.after_build = false`).
41
+
42
+ You can also execute the ping from the command line:
43
+
44
+ ```
45
+ bundle exec middleman sitemap_ping
46
+ ```
40
47
 
41
48
  ## Contributing
42
49
 
@@ -45,3 +52,7 @@ Once the extension is activated, it will ping the search engines automatically e
45
52
  3. Commit your changes (`git commit -am 'Add some feature'`)
46
53
  4. Push to the branch (`git push origin my-new-feature`)
47
54
  5. Create new Pull Request
55
+
56
+ ## Support
57
+
58
+ If you like this project, consider [buying me a coffee](https://www.buymeacoffee.com/279lcDtbF)! :)
@@ -0,0 +1,26 @@
1
+ require 'middleman-cli'
2
+
3
+ module Middleman
4
+ module Cli
5
+ class SitemapPing < Thor::Group
6
+ include Thor::Actions
7
+
8
+ check_unknown_options!
9
+
10
+ namespace :sitemap_ping
11
+
12
+ def self.exit_on_failure?
13
+ true
14
+ end
15
+
16
+ def sitemap_ping
17
+ app = Middleman::Application.new do
18
+ config[:mode] = :build
19
+ end
20
+ app.extensions[:sitemap_ping].do_ping self
21
+ end
22
+
23
+ Base.register self, 'sitemap_ping', 'sitemap_ping [options]', 'Ping sitemaps'
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,46 @@
1
+ require 'middleman-core'
2
+
3
+ module Middleman
4
+ module SitemapPing
5
+ class Extension < Middleman::Extension
6
+ SERVICES = {
7
+ google: 'https://www.google.com/webmasters/tools/ping?sitemap=%SITEMAP_URL%',
8
+ bing: 'https://bing.com/webmaster/ping.aspx?sitemap=%SITEMAP_URL%'
9
+ }
10
+
11
+ SERVICES.each_key do |service|
12
+ option "ping_#{service}".to_sym, true, "Ping #{service.capitalize}?"
13
+ end
14
+ option :after_build, true, 'Execute automatically after the site was built?'
15
+ option :host, nil, 'The host of your website'
16
+ option :sitemap_file, 'sitemap.xml', 'The name of your sitemap file'
17
+
18
+ def after_build(builder)
19
+ if options.after_build
20
+ do_ping builder.thor
21
+ end
22
+ end
23
+
24
+ def do_ping(thor)
25
+ raise 'Please set the `host` option for the sitemap ping extension!' unless host = options.host
26
+ require 'open-uri'
27
+ host = "http://#{host}" unless host =~ %r(\Ahttps?://)
28
+ sitemap_url = File.join(host, options.sitemap_file)
29
+ SERVICES.each do |service, url|
30
+ next unless options.send("ping_#{service}")
31
+ url.sub! /%SITEMAP_URL%\z/, CGI.escape(sitemap_url)
32
+ thor.say "Pinging #{url}"
33
+ open url do |f|
34
+ if f.status[0] == '200'
35
+ thor.say_status :success, 'SUCCESS!', :green
36
+ else
37
+ thor.say_status :error, "ERROR: #{f.status[0]}", :red
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
45
+
46
+ Middleman::Extensions.register :sitemap_ping, Middleman::SitemapPing::Extension
@@ -1,5 +1,5 @@
1
1
  module Middleman
2
- class SitemapPing
3
- VERSION = '0.0.2'
2
+ module SitemapPing
3
+ VERSION = '1.0.1'
4
4
  end
5
5
  end
@@ -1,44 +1,3 @@
1
- require 'middleman-core'
2
-
3
- module Middleman
4
- class SitemapPing < Extension
5
- SERVICES = {
6
- google: 'http://www.google.com/webmasters/tools/ping?sitemap=%SITEMAP_URL%',
7
- bing: 'http://www.bing.com/ping?sitemap=%SITEMAP_URL%'
8
- }
9
-
10
- SERVICES.each_key do |service|
11
- option "ping_#{service}".to_sym, true, "Ping #{service.capitalize}?"
12
- end
13
- option :host, nil, 'The host of your website'
14
- option :sitemap_file, 'sitemap.xml', 'The name of your sitemap file'
15
-
16
- def initialize(app, options_hash = {})
17
- super
18
-
19
- require 'open-uri'
20
- end
21
-
22
- def after_build(builder)
23
- raise 'Please set the `host` option for the sitemap ping extension!' unless host = options.host
24
- host = "http://#{host}" unless host =~ %r(\Ahttps?://)
25
- sitemap_url = File.join(host, options.sitemap_file)
26
- SERVICES.each do |service, url|
27
- next unless options.send("ping_#{service}")
28
- url.sub! /%SITEMAP_URL%\z/, CGI.escape(sitemap_url)
29
- builder.say "Pinging #{url}"
30
- open url do |f|
31
- if f.status[0] == '200'
32
- builder.say_status :success, 'SUCCESS!', :green
33
- else
34
- builder.say_status :error, "ERROR: #{f.status[0]}", :red
35
- end
36
- end
37
- end
38
- end
39
- end
40
- end
41
-
42
1
  require_relative 'middleman-sitemap-ping/version'
43
-
44
- Middleman::SitemapPing.register :sitemap_ping
2
+ require_relative 'middleman-sitemap-ping/command'
3
+ require_relative 'middleman-sitemap-ping/extension'
@@ -1,9 +1,7 @@
1
- # encoding: utf-8
2
-
3
1
  lib = File.expand_path('../lib', __FILE__)
4
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
3
 
6
- require 'middleman-sitemap-ping'
4
+ require 'middleman-sitemap-ping/version'
7
5
 
8
6
  Gem::Specification.new do |gem|
9
7
  gem.name = 'middleman-sitemap-ping'
@@ -13,7 +11,7 @@ Gem::Specification.new do |gem|
13
11
  gem.email = 'manuel@krautcomputing.com'
14
12
  gem.summary = 'Middleman extension to ping search engines (Google and Bing) with a sitemap URL'
15
13
  gem.description = 'Middleman extension to ping search engines (Google and Bing) with a sitemap URL'
16
- gem.homepage = 'http://krautcomputing.github.io/middleman-sitemap-ping/'
14
+ gem.homepage = 'http://manuelmeurer.github.io/middleman-sitemap-ping/'
17
15
  gem.license = 'MIT'
18
16
 
19
17
  gem.files = `git ls-files`.split($/)
@@ -21,6 +19,5 @@ Gem::Specification.new do |gem|
21
19
  gem.test_files = gem.files.grep(%r(^(test|spec|features)/))
22
20
  gem.require_paths = ['lib']
23
21
 
24
- gem.add_development_dependency 'rake', '~> 10.0'
25
- gem.add_runtime_dependency 'middleman-core', '~> 3.0'
22
+ gem.add_runtime_dependency 'middleman', '>= 3.1'
26
23
  end
metadata CHANGED
@@ -1,43 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-sitemap-ping
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manuel Meurer
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-26 00:00:00.000000000 Z
11
+ date: 2021-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rake
14
+ name: middleman
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '10.0'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '10.0'
27
- - !ruby/object:Gem::Dependency
28
- name: middleman-core
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '3.0'
19
+ version: '3.1'
34
20
  type: :runtime
35
21
  prerelease: false
36
22
  version_requirements: !ruby/object:Gem::Requirement
37
23
  requirements:
38
- - - "~>"
24
+ - - ">="
39
25
  - !ruby/object:Gem::Version
40
- version: '3.0'
26
+ version: '3.1'
41
27
  description: Middleman extension to ping search engines (Google and Bing) with a sitemap
42
28
  URL
43
29
  email: manuel@krautcomputing.com
@@ -50,16 +36,16 @@ files:
50
36
  - Gemfile
51
37
  - LICENSE.txt
52
38
  - README.md
53
- - Rakefile
54
39
  - lib/middleman-sitemap-ping.rb
40
+ - lib/middleman-sitemap-ping/command.rb
41
+ - lib/middleman-sitemap-ping/extension.rb
55
42
  - lib/middleman-sitemap-ping/version.rb
56
- - lib/middleman_extension.rb
57
43
  - middleman-sitemap-ping.gemspec
58
- homepage: http://krautcomputing.github.io/middleman-sitemap-ping/
44
+ homepage: http://manuelmeurer.github.io/middleman-sitemap-ping/
59
45
  licenses:
60
46
  - MIT
61
47
  metadata: {}
62
- post_install_message:
48
+ post_install_message:
63
49
  rdoc_options: []
64
50
  require_paths:
65
51
  - lib
@@ -74,11 +60,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
60
  - !ruby/object:Gem::Version
75
61
  version: '0'
76
62
  requirements: []
77
- rubyforge_project:
78
- rubygems_version: 2.4.5
79
- signing_key:
63
+ rubygems_version: 3.2.30
64
+ signing_key:
80
65
  specification_version: 4
81
66
  summary: Middleman extension to ping search engines (Google and Bing) with a sitemap
82
67
  URL
83
68
  test_files: []
84
- has_rdoc:
data/Rakefile DELETED
File without changes
@@ -1 +0,0 @@
1
- require 'middleman-sitemap-ping'