jekyll-rebuilder 1.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 +7 -0
- data/bin/jekyll-rebuilder +36 -0
- metadata +45 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 71ac528f2e7a0d95b393cd96aad38f248fab0af0
|
4
|
+
data.tar.gz: 3ede57b32f88a06720e0fed6a18cf4c9f992ec2c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 0f42034d8d21f4955f2be4b3c9c39eb430c1a6f1f53879e0eb4e5ea73b081a3112ecac19bb98fb0b95486a2d80a90b959449e78d80966a7ee40008fe2b699b54
|
7
|
+
data.tar.gz: b5d3f81b8c98f5fcd61c0fb9bebb0a54d4d6f2c0a5a11abbc68c347d064589ccab30914ecc69d48f042b678686ccc4732e7da55a4a3075509b98fed45aca32b0
|
@@ -0,0 +1,36 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'webrick'
|
4
|
+
require 'optparse'
|
5
|
+
require 'ostruct'
|
6
|
+
|
7
|
+
LOG_FILE = 'jekyll-rebuilder.log'
|
8
|
+
|
9
|
+
options = OpenStruct.new
|
10
|
+
OptionParser.new do |opts|
|
11
|
+
opts.banner = "Usage: jekyll-rebuilder --port PORT --secret SECRET"
|
12
|
+
|
13
|
+
opts.on("-p", "--port [PORT]", Integer, "Port to listen on") do |port|
|
14
|
+
options.port = port
|
15
|
+
end
|
16
|
+
|
17
|
+
opts.on("-s", "--secret [SECRET]", String, "Path to accept hook request from") do |secret|
|
18
|
+
options.secret = secret
|
19
|
+
end
|
20
|
+
end.parse!
|
21
|
+
|
22
|
+
raise "Missing arguments. Consult jekyll-rebuilder --help" unless options.port && options.secret
|
23
|
+
raise "Current directory missing _config.yml" unless File.exists?('_config.yml')
|
24
|
+
|
25
|
+
puts ">> Listening on http://0.0.0.0:#{options.port}/#{options.secret}/ for webhook requests."
|
26
|
+
puts ">> Will then refresh jekyll site at #{Dir.pwd}"
|
27
|
+
|
28
|
+
server = WEBrick::HTTPServer.new :Port => options.port
|
29
|
+
server.mount_proc "/#{options.secret}/" do |req, res|
|
30
|
+
`git pull origin master 2>&1 > #{LOG_FILE}`
|
31
|
+
`jekyll build 2>&1 >> #{LOG_FILE}`
|
32
|
+
res.body = "Whargleblargl"
|
33
|
+
end
|
34
|
+
|
35
|
+
trap 'INT' do server.shutdown end
|
36
|
+
server.start
|
metadata
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jekyll-rebuilder
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Dysonhug
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-05-26 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Github webhook compatible jekyll site rebuilder
|
14
|
+
email: dysonhug@gmail.com
|
15
|
+
executables:
|
16
|
+
- jekyll-rebuilder
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- bin/jekyll-rebuilder
|
21
|
+
homepage: http://github.com/dysonhug/jekyll-rebuilder
|
22
|
+
licenses:
|
23
|
+
- MIT
|
24
|
+
metadata: {}
|
25
|
+
post_install_message:
|
26
|
+
rdoc_options: []
|
27
|
+
require_paths:
|
28
|
+
- lib
|
29
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
35
|
+
requirements:
|
36
|
+
- - ">="
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '0'
|
39
|
+
requirements: []
|
40
|
+
rubyforge_project:
|
41
|
+
rubygems_version: 2.2.2
|
42
|
+
signing_key:
|
43
|
+
specification_version: 4
|
44
|
+
summary: Jekyll Rebuilder
|
45
|
+
test_files: []
|