jekyll_patternbot 1.6.0 → 1.6.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
2
  SHA256:
3
- metadata.gz: ceea8f589ddaa2cd03732ef5bbfe8382f98d5e3ce5c3d1d994a235b6830c44dd
4
- data.tar.gz: bbc89813a7c30cecbe0751b8814b1e5916d106ea14941a00e87ef8214f80eb4c
3
+ metadata.gz: 9e7a65e72e14fcdfaff8cf21d079c3c2dc75b1f225af614f9fa7c01f78b6ddf4
4
+ data.tar.gz: dcc20432b31495913b7ac21852b90aab882a40984df61ece77687647e537b066
5
5
  SHA512:
6
- metadata.gz: e6122060b6425023ddbe5fbcb7d76e2f86e6068f5284926d2f6ec1a9d3d3bd4f2b9f7bb6135caa032e52c56f1676b2f133f28417bf4a152b21ea0083c249db23
7
- data.tar.gz: b7ddc1960612776da806279575bc37760200023788ccaa1653a476b8b88eff33b8a1f48bfc8acfb5f19ebf3833e9e3a1c92fbd40a518c5e062824a7505a0bb74
6
+ metadata.gz: 25f181344dac581222ac7569153f3e4759a6f3f1fe52e4ece007d605feabafe9c2f520d9f9a64d77ffdaf3ff0855f46e39fed64d17541092ddd152628a0ac5e9
7
+ data.tar.gz: fe9c3fbc7de612c147d1f3f399d8a7ea048d1457234e7cdd38d9bb56e24315a1f1652ede64621ae6d4d7b2c55f7294afcd79bfa0b48a27c02e68c4f7cbe57728
@@ -5,6 +5,14 @@ Jekyll Patternbot adheres to [Semantic Versioning](http://semver.org/).
5
5
 
6
6
  ---
7
7
 
8
+ ## [1.6.1] — 2020-01-04
9
+
10
+ ### Fixed
11
+
12
+ - Made the config live change detection & parsing more reliable.
13
+
14
+ ---
15
+
8
16
  ## [1.6.0] — 2020-01-04
9
17
 
10
18
  ### Changed
@@ -20,6 +20,7 @@ module JekyllPatternbot
20
20
  require 'jekyll_patternbot/helpers/jekyll'
21
21
  require 'jekyll_patternbot/helpers/pattern'
22
22
 
23
+ require 'jekyll_patternbot/parsers/config'
23
24
  require 'jekyll_patternbot/parsers/web_dev_tool'
24
25
  require 'jekyll_patternbot/parsers/modulifier'
25
26
  require 'jekyll_patternbot/parsers/gridifier'
@@ -27,27 +27,13 @@ module JekyllPatternbot
27
27
  end
28
28
 
29
29
  # Does this leave a running process when Jekyll shuts down?
30
- begin
31
- @@config_listener.stop
32
- rescue
33
- @@config_listener = nil
34
- end
35
- @@config_listener = nil
36
- @@config_listener = Listen.to(site.source, only: /\_config\.yml/) do |modified, added, removed|
37
- begin
38
- new_config = YAML.load_file File.expand_path(site.source + '/_config.yml')
39
- rescue Exception => err
40
- log = PatternbotConsoleLogger.new
41
- log.fatal(err.message)
42
- else
43
- if new_config.key? 'patternbot'
44
- Config['patternbot'].deep_merge! new_config['patternbot']
45
- if site
46
- site.process
47
- end
30
+ unless @@config_listener
31
+ @@config_listener = Listen.to(site.source, only: /\_config\.yml/) do |modified, added, removed|
32
+ if site
33
+ site.process
48
34
  end
49
35
  end
36
+ @@config_listener.start
50
37
  end
51
- @@config_listener.start
52
38
  end
53
39
  end
@@ -1,21 +1,23 @@
1
1
  module JekyllPatternbot
2
2
  PatternbotLogger = PatternbotConsoleLogger.new
3
3
  PatternbotCache = {}
4
- PatternbotData = {
5
- :css => {},
6
- :js => {},
7
- :logos => {},
8
- :icons => {
4
+ PatternbotData = {}
5
+
6
+ Jekyll::Hooks.register :site, :post_read do |site|
7
+ PatternbotData[:css] = {}
8
+ PatternbotData[:js] = {}
9
+ PatternbotData[:logos] = {}
10
+ PatternbotData[:icons] = {
9
11
  :spritesheets => [],
10
12
  :classes => [],
11
- },
12
- :layouts => [],
13
- :patterns => {},
14
- :patterns_order => [],
15
- :pages => [],
16
- }
13
+ }
14
+ PatternbotData[:layouts] = []
15
+ PatternbotData[:patterns] = {}
16
+ PatternbotData[:patterns_order] = []
17
+ PatternbotData[:pages] = []
18
+
19
+ ConfigChangeParser.new.parse site
17
20
 
18
- Jekyll::Hooks.register :site, :post_read do |site|
19
21
  # File.open('/Users/thomasjbradley/Desktop/patternbot-config.json', 'w') do |f|
20
22
  # f.write(JSON.pretty_generate(Config))
21
23
  # end
@@ -0,0 +1,20 @@
1
+ module JekyllPatternbot
2
+ class ConfigChangeParser
3
+
4
+ def parse(site)
5
+ begin
6
+ new_config = YAML.load_file File.expand_path(site.source + '/_config.yml')
7
+ rescue Exception => err
8
+ PatternbotLogger.fatal(err.message)
9
+ else
10
+ if new_config.key? 'patternbot'
11
+ config_base = YAML.load_file File.expand_path('../../../_config.yml', __dir__)
12
+ Config['patternbot'] = config_base['patternbot']
13
+ Config['patternbot'][:version] = JekyllPatternbot::VERSION
14
+ Config['patternbot'].deep_merge! new_config['patternbot']
15
+ end
16
+ end
17
+ end
18
+
19
+ end
20
+ end
data/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module JekyllPatternbot
2
- VERSION = '1.6.0'
2
+ VERSION = '1.6.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll_patternbot
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas J Bradley
@@ -268,6 +268,7 @@ files:
268
268
  - _plugins/jekyll_patternbot/helpers/pattern.rb
269
269
  - _plugins/jekyll_patternbot/hooks/pattern_lib.rb
270
270
  - _plugins/jekyll_patternbot/loggers/patternbot.rb
271
+ - _plugins/jekyll_patternbot/parsers/config.rb
271
272
  - _plugins/jekyll_patternbot/parsers/css_color.rb
272
273
  - _plugins/jekyll_patternbot/parsers/css_comment_tag.rb
273
274
  - _plugins/jekyll_patternbot/parsers/css_font.rb