jekyll-livereload 0.1.1.1 → 0.2.1

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: b06478eab8b2303bef86d2bc601aa05f125954ed
4
- data.tar.gz: ef7ac2618c98f6186fd8dedfc3375dba5e76b749
3
+ metadata.gz: c6f469fa6509fbfe79d18e5a36afba104cb19988
4
+ data.tar.gz: eaf978f93d4e1ab1a8195b5ebcb44e39d319f840
5
5
  SHA512:
6
- metadata.gz: e2a5173d48a1fe632514f97c02e8da504b6fefcf08305b84bf360dc8b21ae4ebb9f9c06781211277945dff2599b80d00f96f9581894074e47e0d1c5bbc49dec3
7
- data.tar.gz: 3263e143ce532d299d25a030bba1c894817be06fc906030370b76b78a36d59cbc9be29c89d4c315b74f6bc28ebaa7d8115d9665793a18317bd5a2ca953a19fbf
6
+ metadata.gz: c0f01b1743c6f10dd12ac896b3be7acf6c3b0802bf37b923f0b8d1e5d8a221e50d87470bc5ff69f4254867d9bc1014eb8b0173cdb78ae81263b719a8f054a614
7
+ data.tar.gz: 6fa26655f1916dd1d24f4dec83a019e11689230ab81ea3f9007725fd2954f51b6b67b43eca3bb2219e694b5e333083d37f7fc92409abc497a232b63b7cc589c4
@@ -32,7 +32,8 @@ module Jekyll
32
32
 
33
33
  private
34
34
  def reload_script(opts)
35
- "<script src=\"http://#{opts['host']}:#{opts['reload_port']}/livereload.js\"></script>"
35
+ protocol = opts[:secure] ? "https" : "http"
36
+ "<script src=\"#{protocol}://#{opts['host']}:#{opts['reload_port']}/livereload.js\"></script>"
36
37
  end
37
38
 
38
39
  end
@@ -6,6 +6,15 @@ module Jekyll
6
6
  opts = configuration_from_options(opts)
7
7
  opts['host'] = 'localhost' unless opts.key?('host')
8
8
  opts['reload_port'] = Livereload::LIVERELOAD_PORT unless opts.key?('reload_port')
9
+
10
+ if opts['ssl_cert'] && opts['ssl_key']
11
+ opts[:tls_options] = {
12
+ :private_key_file => Jekyll.sanitized_path(opts['source'], opts['ssl_key']),
13
+ :cert_chain_file => Jekyll.sanitized_path(opts['source'], opts['ssl_cert']),
14
+ }
15
+ opts[:secure] = true
16
+ end
17
+
9
18
  return opts
10
19
  end
11
20
  end
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Livereload
3
- VERSION = "0.1.1"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  end
@@ -37,8 +37,8 @@ module Jekyll
37
37
  attr_reader :reload_file
38
38
 
39
39
  def initialize(opts)
40
- super
41
40
  @reload_file = File.join(LIVERELOAD_DIR, "livereload.js")
41
+ super opts
42
42
  end
43
43
 
44
44
  def dispatch(data)
@@ -85,7 +85,6 @@ module Jekyll
85
85
  @thread = nil
86
86
  @websockets = []
87
87
  @connections_count = 0
88
- trap("INT") { stop }
89
88
  end
90
89
 
91
90
  def stop
@@ -101,9 +100,9 @@ module Jekyll
101
100
  @thread = Thread.new do
102
101
  # Use epoll if the kernel supports it
103
102
  EM.epoll
104
- # TODO enable SSL
105
103
  EM.run do
106
- Jekyll.logger.info("LiveReload Server:", "#{@opts['host']}:#{@opts['reload_port']}")
104
+ protocol = @opts[:secure] ? "https" : "http"
105
+ Jekyll.logger.info("LiveReload Server:", "#{protocol}://#{@opts['host']}:#{@opts['reload_port']}")
107
106
  EM.start_server(@opts['host'], @opts['reload_port'], HttpAwareConnection, @opts) do |ws|
108
107
  ws.onopen do |handshake|
109
108
  connect(ws, handshake)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-livereload
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1.1
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert DeRose
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-10 00:00:00.000000000 Z
11
+ date: 2016-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -52,21 +52,15 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.12'
55
- description:
55
+ description: |2
56
+ This is a plugin for Jekyll. It adds additional command line options to
57
+ the server command to provide Livereloading capabilities.
56
58
  email:
57
59
  - RobertDeRose@gmail.com
58
60
  executables: []
59
61
  extensions: []
60
62
  extra_rdoc_files: []
61
63
  files:
62
- - ".gitignore"
63
- - ".rspec"
64
- - Gemfile
65
- - History.md
66
- - LICENSE.txt
67
- - README.md
68
- - Rakefile
69
- - jekyll-livereload.gemspec
70
64
  - js/livereload.js
71
65
  - lib/jekyll-livereload.rb
72
66
  - lib/jekyll-livereload/build.rb
@@ -86,7 +80,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
86
80
  requirements:
87
81
  - - ">="
88
82
  - !ruby/object:Gem::Version
89
- version: '0'
83
+ version: 2.0.0
90
84
  required_rubygems_version: !ruby/object:Gem::Requirement
91
85
  requirements:
92
86
  - - ">="
data/.gitignore DELETED
@@ -1,16 +0,0 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- doc/
11
- lib/bundler/man
12
- pkg
13
- rdoc
14
- spec/reports
15
- spec/dest
16
- tmp
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --color
2
- --format progress
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in jekyll-paginate.gemspec
4
- gemspec
data/History.md DELETED
@@ -1,12 +0,0 @@
1
- ## 0.1.1 / 2016-05-09
2
-
3
- ### Minor fixes and improvements
4
-
5
- * Don't start Websocket unless --livereload is included
6
- * Support configuration through `_config.yml` file
7
-
8
- ## 0.1.0 / 2016-05-09
9
-
10
- ### Initial Release
11
-
12
- * First release of Jekyll-Livereload
@@ -1,22 +0,0 @@
1
- Copyright (c) 2014 Parker Moore
2
-
3
- MIT License
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md DELETED
@@ -1,77 +0,0 @@
1
- # Jekyll::Livereload
2
-
3
- [![Gem Version](https://badge.fury.io/rb/jekyll-livereload.svg)](https://badge.fury.io/rb/jekyll-livereload)
4
-
5
- Adds Livereloading support to Jekyll
6
-
7
- ## Installation
8
-
9
- Add this line to your site's Gemfile in the Jekyll Plugin Group:
10
-
11
- ```ruby
12
- group :jekyll_plugins do
13
- gem 'jekyll-livereload'
14
- end
15
- ```
16
-
17
- And then execute:
18
-
19
- ```bash
20
- bundle
21
- ```
22
-
23
- ## Usage
24
-
25
- This plugin was designed to work with both 3.0.5 and 3.1.3 of Jekyll.
26
-
27
- To enable Livereload support you need to add an addition command line switch to the
28
- `jekyll serve` command: `--livereload`.
29
-
30
- If you call `jekyll serve --help` for all supported serve options, you will notice
31
- that two new options have been added.
32
-
33
- ```bash
34
- -L, --livereload Inject Livereload.js and run a WebSocket Server
35
- -R, --reload_port [PORT] Port to serve Livereload on
36
- ```
37
-
38
- These options have been added by this plugin.
39
-
40
- ## Making Livereload the default
41
-
42
- Jekyll::Livereload supports readings configuration values from your local `_config.yml`
43
- file. If you always what to use Livereload, and why wouldn't you, you can add it to
44
- your config like so:
45
-
46
- ```yaml
47
- # Server Config optiosn
48
- livereload: true # You no longer need to include --livereload
49
- reload_port: 5678 # If you don't want to use the default port
50
- ```
51
-
52
- ## Caveats
53
-
54
- This plugin is dependent on the way Jekyll loads plugins.
55
- Jekyll will load anything in the `Gemfile` plugin group immediately after it
56
- includes `jekyll` and `mercenary`, both of which need to be modified before
57
- Jekyll initializes it's command line options.
58
-
59
- If you attempt to use this plugin by installing it in the `_plugin` directory
60
- or by adding it to your `_config.yml` file, it will not work.
61
-
62
- This plugin will break if Jekyll upstream every changes the placement of the call
63
- `Jekyll::PluginManager.require_from_bundler` in it's `binary` command `jekyll` to
64
- be after the initialization it's command line options.
65
-
66
- This is the reason this plugin only works if you include it in the `Gemfile`
67
-
68
- ## Thanks
69
-
70
- A big thanks to [Alex Wood](https://github.com/awood)! This plugin was
71
- inspired by his [Hawkins](https://github.com/awood/hawkins) plugin for Jekyll.
72
- The reason I made this plugin was because his method did not work with the
73
- Github-Pages Gem version of Jekyll, which still uses version 3.0.5.
74
- His websocket server was used with very little modification and credit given.
75
-
76
- Also thanks to the [Livereload Team](https://github.com/livereload), a copy of
77
- their awesome opensource livereload.js is included with this plugin.
data/Rakefile DELETED
@@ -1 +0,0 @@
1
- require "bundler/gem_tasks"
@@ -1,24 +0,0 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'jekyll-livereload/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "jekyll-livereload"
8
- spec.version = "#{Jekyll::Livereload::VERSION}.1"
9
- spec.authors = ["Robert DeRose"]
10
- spec.email = ["RobertDeRose@gmail.com"]
11
- spec.summary = "Adds LiveReload support to Jekyll's included Server"
12
- spec.license = "MIT"
13
-
14
- spec.files = `git ls-files -z`.split("\x0")
15
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
16
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
17
- spec.homepage = 'https://github.com/RobertDeRose/jekyll-livereload'
18
- spec.require_paths = ["lib"]
19
-
20
- spec.add_runtime_dependency "jekyll", "~> 3.0"
21
- spec.add_runtime_dependency "em-websocket", "~> 0.5"
22
-
23
- spec.add_development_dependency "bundler", "~> 1.12"
24
- end