octopress-ink 1.0.0.rc.54 → 1.0.0.rc.55

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: 9a64f959380cab490e1186054068076ac6a3ccb8
4
- data.tar.gz: 50a373e6606fb46a3d0b11f8f5eee1ea627de796
3
+ metadata.gz: f517835b210f170331ea8cd934bf152e3c3ad1c2
4
+ data.tar.gz: ae3be19c27549ace16b73f659d18d18035da7ea2
5
5
  SHA512:
6
- metadata.gz: 13ff921e7a6b2a227821ca560161cfac96b3f5271753b2e4add1ab0002906391ac84c234d0ab39ad3fffb57568282f890cc2a286c1080311383fa6eaae83677b
7
- data.tar.gz: c7e5548d378e171ad95697fd0de29f04f6be1128251d0a9bd694198c8bf468406cc4166b250cd1b879bbc2bd75d93cc488477ab9abc36152c674663db44a2a5c
6
+ metadata.gz: 03d00856c6ca3b2ad4c3d95e098caeaa5ee12dfe7267efb4257f0fcc67e3fab4a1aeed9bda25390cdecb4777a791aba6018ce5650e725dd27cdceb9e96b26ee9
7
+ data.tar.gz: 0257488cc68a4a887e2f44e9044e6ac8fdfd261f55a78334486f591686ddbf2dd3ed2b3cb110da7c1d9a995caaad76c9c48631cb762b27dc6fdabbf1292c78fd
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ### 1.0.0 RC55 - 2015-03-14
4
+ - Added `ink_watch` site configuration, allowing plugin authors to add their plugin assets directory to Jekyll's watch list.
5
+
3
6
  ### 1.0.0 RC54 - 2015-03-10
4
7
  - Added `new_page` method to page assets to mirror template functionality.
5
8
  - Generated pages can now reference the asset instance that generated them.
data/lib/octopress-ink.rb CHANGED
@@ -97,6 +97,12 @@ module Octopress
97
97
  Docs.register_docs options
98
98
  end
99
99
 
100
+ def watch_assets(site)
101
+ if site.config['ink_watch']
102
+ require 'octopress-ink/watch'
103
+ end
104
+ end
105
+
100
106
  def config
101
107
  @config ||= Configuration.config
102
108
  end
@@ -109,7 +115,6 @@ module Octopress
109
115
  begin
110
116
  Plugins.plugin(name)
111
117
  rescue
112
- return false
113
118
  end
114
119
  end
115
120
 
@@ -3,6 +3,7 @@ module Octopress
3
3
  class SiteHook < Hooks::Site
4
4
 
5
5
  def reset(site)
6
+ Ink.watch_assets(site)
6
7
  if Plugins.registered
7
8
  Plugins.reset
8
9
  end
@@ -1,5 +1,5 @@
1
1
  module Octopress
2
2
  module Ink
3
- VERSION = "1.0.0.rc.54"
3
+ VERSION = "1.0.0.rc.55"
4
4
  end
5
5
  end
@@ -0,0 +1,39 @@
1
+ require 'jekyll-watch'
2
+
3
+ # Add assets directories for selected Octopress Ink plugins to Jekyll's watch directories,
4
+ # allowing plugin authors to dynamically preview changes to their plugin's assets.
5
+ #
6
+ module Jekyll
7
+ module Watcher
8
+ extend self
9
+
10
+ def build_listener(site, options)
11
+ require 'listen'
12
+ paths = [options['source']].concat(ink_watch_paths(site)).compact
13
+ Listen.to(
14
+ *paths,
15
+ :ignore => listen_ignore_paths(options),
16
+ :force_polling => options['force_polling'],
17
+ &(listen_handler(site))
18
+ )
19
+ end
20
+
21
+ def ink_watch_paths(site)
22
+ if plugins = site.config['ink_watch']
23
+ if plugins == 'all'
24
+ Octopress::Ink.plugins.dup.map(&:asset_paths)
25
+ else
26
+ plugin_paths Array(plugins)
27
+ end
28
+ end
29
+ end
30
+
31
+ def plugin_paths(plugins)
32
+ plugins.dup.map do |plugin|
33
+ if plugin = Octopress::Ink.plugin(plugin)
34
+ plugin.assets_path
35
+ end
36
+ end.compact
37
+ end
38
+ end
39
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octopress-ink
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.rc.54
4
+ version: 1.0.0.rc.55
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Mathis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-10 00:00:00.000000000 Z
11
+ date: 2015-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -249,6 +249,7 @@ files:
249
249
  - lib/octopress-ink/tags/stylesheet.rb
250
250
  - lib/octopress-ink/utils.rb
251
251
  - lib/octopress-ink/version.rb
252
+ - lib/octopress-ink/watch.rb
252
253
  homepage: https://github.com/octopress/ink
253
254
  licenses:
254
255
  - MIT