jekyll-browsersync 0.0.1 → 0.1.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
2
  SHA1:
3
- metadata.gz: ef4e2533e894b7a00104e9665fbbf20d2c8ad3d0
4
- data.tar.gz: 8b6dd382b6c26f75c9ad7baa4f5745b7528e993c
3
+ metadata.gz: 04a0f50ba201fde043c6874cdf70f6b5a3f85cd7
4
+ data.tar.gz: 2d0bc3b8f65bfe0d20efdb40372f7a62d04abf54
5
5
  SHA512:
6
- metadata.gz: 7af612def7489b52db670a105b48a92427d2f661a7e40028a93c1ab575b179af8672fb903484845d93b9d98cc1711664a79771552d8def01c32b595d4965bdc9
7
- data.tar.gz: 62031004e1188ff064a2d90608c960e4cbc935f630cf7cc8c26ec2312dfb0c9a7c449f2e58f91d9d08e0d205ca9a36d8f046644dc54ce0e5e5bf96180b6e50f6
6
+ metadata.gz: 770a2aa80db19a1b86d95a2c8f270f3ff0826f09fac8b878de52329c14b23e8de92469680bf22acfe89e7c39bdb94888db4237ba836e973ba786766995f246ab
7
+ data.tar.gz: 4acead2b9aa338db4b7117d14d14e92069d8de4daf819e1a292677d043a291d8adf77da64d52b60755bacf87aaf8254e59875a97dc2fa2e963b0e57e97f66a0b
data/README.md CHANGED
@@ -21,19 +21,24 @@ Then install it
21
21
 
22
22
  ## Usage
23
23
 
24
- Once you have it installed, you should have a new `browser-sync` command under Jekyll.
24
+ Once you have it installed, you should have a new `browsersync` command under Jekyll.
25
25
 
26
- $ bundle exec jekyll browser-sync
26
+ $ bundle exec jekyll browsersync
27
27
 
28
28
  If you have Browsersync installed in a custom location, you can specify this with the
29
29
  `--browser-sync` option.
30
30
 
31
- $ bundle exec jekyll browsersync --browser-sync ~/bin/browser-sync
31
+ $ bundle exec jekyll browser-sync --browser-sync ~/bin/browser-sync
32
32
 
33
33
  If you would like to serve the site using https, use the `--https` option.
34
34
 
35
35
  $ bundle exec jekyll bs --https
36
36
 
37
+ If you have any other options you would like passed to the Browsersync command,
38
+ pass them as arguments.
39
+
40
+ $ bundle exec jekyll browsersync -- --no-notify
41
+
37
42
  ## Contributing
38
43
 
39
44
  1. Fork it (https://github.com/mloberg/jekyll-browsersync/fork)
@@ -22,10 +22,10 @@ module Mlo
22
22
  }.freeze
23
23
 
24
24
  def init_with_program(prog)
25
- prog.command("browser-sync") do |cmd|
26
- cmd.syntax "browser-sync [options]"
25
+ prog.command("browsersync") do |cmd|
26
+ cmd.syntax "browsersync [options]"
27
27
  cmd.description 'Serve a Jekyll site using Browsersync.'
28
- cmd.alias :browsersync
28
+ cmd.alias :'browser-sync'
29
29
  cmd.alias :bs
30
30
 
31
31
  add_build_options(cmd)
@@ -34,7 +34,8 @@ module Mlo
34
34
  cmd.option key, *val
35
35
  end
36
36
 
37
- cmd.action do |_, opts|
37
+ cmd.action do |args, opts|
38
+ puts args.inspect
38
39
  opts['serving'] = true
39
40
  opts['watch'] = true unless opts.key?('watch')
40
41
  opts['incremental'] = true unless opts.key?('incremental')
@@ -48,30 +49,27 @@ module Mlo
48
49
  config = opts['config']
49
50
  ::Jekyll::Commands::Build.process(opts)
50
51
  opts['config'] = config
51
- Command.process(opts)
52
+ Command.process(opts, args)
52
53
  end
53
54
  end
54
55
  end
55
56
 
56
- def process(opts)
57
+ def process(opts, args)
57
58
  opts = configuration_from_options(opts)
58
59
  destination = opts['destination']
59
60
 
60
- cmd = [
61
- opts['browsersync'],
62
- 'start',
63
- "--server #{destination}",
64
- "--files #{destination}",
65
- "--port #{opts['port']}",
66
- "--host #{opts['host']}",
67
- "--ui-port #{opts['ui_port']}",
68
- ]
69
-
70
- cmd << '--https' if opts['https']
71
- cmd << '--no-open' unless opts['open_url']
72
- cmd << '--directory' if opts['show_dir_listing']
73
-
74
- PTY.spawn(cmd.join(' ')) do |stdout, stdin, pid|
61
+ args << "--server #{destination}"
62
+ args << "--files #{destination}"
63
+ args << "--port #{opts['port']}"
64
+ args << "--host #{opts['host']}"
65
+ args << "--ui-port #{opts['ui_port']}"
66
+ args << '--https' if opts['https']
67
+ args << '--no-open' unless opts['open_url']
68
+ args << '--directory' if opts['show_dir_listing']
69
+
70
+ cmd = "#{opts['browsersync']} start #{args.join(' ')}"
71
+
72
+ PTY.spawn(cmd) do |stdout, stdin, pid|
75
73
  trap("INT") { Process.kill 'INT', pid }
76
74
 
77
75
  ::Jekyll.logger.info "Server address:", server_address(opts)
@@ -1,7 +1,7 @@
1
1
  module Mlo
2
2
  module Jekyll
3
3
  module BrowserSync
4
- VERSION = '0.0.1'
4
+ VERSION = '0.1.0'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,61 +1,61 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-browsersync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Loberg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-06 00:00:00.000000000 Z
11
+ date: 2017-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 3.0.0
20
- - - ~>
20
+ - - "~>"
21
21
  - !ruby/object:Gem::Version
22
22
  version: '3.1'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - '>='
27
+ - - ">="
28
28
  - !ruby/object:Gem::Version
29
29
  version: 3.0.0
30
- - - ~>
30
+ - - "~>"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '3.1'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: bundler
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - ~>
37
+ - - "~>"
38
38
  - !ruby/object:Gem::Version
39
39
  version: '1.5'
40
40
  type: :development
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - ~>
44
+ - - "~>"
45
45
  - !ruby/object:Gem::Version
46
46
  version: '1.5'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rake
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - ~>
51
+ - - "~>"
52
52
  - !ruby/object:Gem::Version
53
53
  version: '10.0'
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - ~>
58
+ - - "~>"
59
59
  - !ruby/object:Gem::Version
60
60
  version: '10.0'
61
61
  description: Add live reloading to Jekyll using Browsersync.
@@ -65,11 +65,11 @@ executables: []
65
65
  extensions: []
66
66
  extra_rdoc_files: []
67
67
  files:
68
+ - LICENSE
69
+ - README.md
70
+ - lib/jekyll-browsersync.rb
68
71
  - lib/jekyll-browsersync/command.rb
69
72
  - lib/jekyll-browsersync/version.rb
70
- - lib/jekyll-browsersync.rb
71
- - README.md
72
- - LICENSE
73
73
  homepage: https://github.com/mloberg/jekyll-browsersync
74
74
  licenses:
75
75
  - MIT
@@ -80,17 +80,17 @@ require_paths:
80
80
  - lib
81
81
  required_ruby_version: !ruby/object:Gem::Requirement
82
82
  requirements:
83
- - - '>='
83
+ - - ">="
84
84
  - !ruby/object:Gem::Version
85
85
  version: '0'
86
86
  required_rubygems_version: !ruby/object:Gem::Requirement
87
87
  requirements:
88
- - - '>='
88
+ - - ">="
89
89
  - !ruby/object:Gem::Version
90
90
  version: '0'
91
91
  requirements: []
92
92
  rubyforge_project:
93
- rubygems_version: 2.0.14
93
+ rubygems_version: 2.5.1
94
94
  signing_key:
95
95
  specification_version: 4
96
96
  summary: Add live reloading to Jekyll using Browsersync.