jekyll_patternbot 1.0.2 → 1.0.3

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
  SHA256:
3
- metadata.gz: 88179123beafb7ae06d2ac92e7b780df23699a3bb79dbb2a77daf0afe1c9e81e
4
- data.tar.gz: f2b24d4185fc9ac7dc58c5fc090a559a387acb6aa7b02c18cce5477454cf8134
3
+ metadata.gz: 12dcf450d35475dc37eafe5327756a61d6106eeff5bfacd96cb4e79cf413cd88
4
+ data.tar.gz: 271a02183cecf8e1e5d99523b5de8b37f6d46da57a20e9514313cc006d5334af
5
5
  SHA512:
6
- metadata.gz: 432411b5d50493bf965d8146a35f17f3fb95c56f4858f5901bc900174963741ccb1b0e6c6d9292c7d4420b8a5d905ba0693a238cb8dd4bba2d6543f4001e9850
7
- data.tar.gz: 46a8ab5e67f2c663418420b554f9e24b0450f4f466688e166ffc6e5a6f43a9ab9e2d6707272a7250d23c2e26beb1d021f13686c1e2b321ae0282fdaa05942db6
6
+ metadata.gz: 2831f645acc83e811962b26a6866af049f95b54f5497980cc452eb85c082932810aac7c3df1902a74df8c12e1f191e70af3ccc1a4145e98d67c54bdafeb8f169
7
+ data.tar.gz: b75f25545e08af7e8a7a08c9f837656a862fa8bffe9c55d71b5cdbf643ae7b2c3a0e1ed3cb7496de108ceff114ec03bb5e44a259496a51a2727e14ee350e2426
@@ -5,6 +5,14 @@ Jekyll Patternbot adheres to [Semantic Versioning](http://semver.org/).
5
5
 
6
6
  ---
7
7
 
8
+ ## [1.0.3] — 2019-01-19
9
+
10
+ ### Fixed
11
+
12
+ - Fixed a bug where errors were displayed when the Web Dev Tool CSS files existed but were empty.
13
+
14
+ ---
15
+
8
16
  ## [1.0.2] — 2019-01-16
9
17
 
10
18
  ### Fixed
data/README.md CHANGED
@@ -30,7 +30,7 @@ Edit your `Gemfile` and add these lines to the bottom:
30
30
  gem "jekyll"
31
31
 
32
32
  group :jekyll_plugins do
33
- gem "jekyll_patternbot", :path => '/www/jekyll_patternbot/'
33
+ gem "jekyll_patternbot"
34
34
  end
35
35
  ```
36
36
 
@@ -48,7 +48,7 @@ Enter a current Ruby version number into the file, `2.5.3` is a recent version y
48
48
 
49
49
  ### 3. Configure Jekyll
50
50
 
51
- Finally we need to configure Jekyll to use Patternbot. It’s already using the Patternbot plugins, as defined in our `Gemfile` but we need to specify the Patternbot theme too.
51
+ Finally we need to configure Jekyll to use Patternbot. It’s already using the Patternbot plugins, as defined in our `Gemfile`, but we need to specify the Patternbot theme too.
52
52
 
53
53
  In your code editor, **create a new file `_config.yml`**
54
54
 
@@ -66,6 +66,6 @@ theme: jekyll_patternbot
66
66
 
67
67
  ## Hosting Jekyll Patternbot
68
68
 
69
- *Although GitHub supports Jekyll its list of allowed plugins is very strict—which means Patternbot cannot run on GitHub Pages.*
69
+ *Although GitHub supports Jekyll, its list of allowed plugins is very strict—which means Patternbot cannot run on GitHub Pages.*
70
70
 
71
71
  I suggest using [Netlify](https://www.netlify.com/) as a substitute to GitHub hosting for your projects that use Jekyll Patternbot.
@@ -13,8 +13,14 @@ module JekyllPatternbot
13
13
  def data
14
14
  if @data.nil? and File.file? @filepath
15
15
  @data = File.read(@filepath)
16
- @url_matches = @data.match(/https:\/\/(?<tool>modulifier|gridifier|typografier)\.web-dev\.tools\/#(?<url>[^\s]+)/)
17
- @url = @url_matches[0]
16
+ if @data != ""
17
+ @url_matches = @data.match(/https:\/\/(?<tool>modulifier|gridifier|typografier)\.web-dev\.tools\/#(?<url>[^\s]+)/)
18
+ @url = @url_matches[0] if @url_matches
19
+ else
20
+ @data = nil
21
+ @url_matches = false
22
+ @url = ''
23
+ end
18
24
  end
19
25
  @data
20
26
  end
@@ -29,12 +35,15 @@ module JekyllPatternbot
29
35
 
30
36
  def info
31
37
  data
32
- {
38
+ the_info = {
33
39
  :filename => @filename,
34
40
  :filepath => @filepath,
35
- :url => @url,
36
41
  :settings => settings,
37
42
  }
43
+ if @url and @url != ''
44
+ the_info[:url] = @url
45
+ end
46
+ the_info
38
47
  end
39
48
 
40
49
  end
@@ -2,25 +2,31 @@ module JekyllPatternbot
2
2
  class ModulesProcessor
3
3
 
4
4
  def remove_embed
5
- unless (PatternbotData[:css].key? :modulifier and
6
- PatternbotData[:css][:modulifier].key? :settings and
7
- PatternbotData[:css][:modulifier][:settings].include? 'embed')
5
+ begin PatternbotData.dig(:css, :modulifier, :settings)
6
+ unless PatternbotData[:css][:modulifier][:settings].kind_of?(Array) and PatternbotData[:css][:modulifier][:settings].include? 'embed'
7
+ PatternbotData[:patterns][:internal]['modules'][:config]['patterns'].delete 'embed'
8
+ end
9
+ rescue
8
10
  PatternbotData[:patterns][:internal]['modules'][:config]['patterns'].delete 'embed'
9
11
  end
10
12
  end
11
13
 
12
14
  def remove_media_objects
13
- unless (PatternbotData[:css].key? :modulifier and
14
- PatternbotData[:css][:modulifier].key? :settings and
15
- PatternbotData[:css][:modulifier][:settings].include? 'media-object')
15
+ begin PatternbotData.dig(:css, :modulifier, :settings)
16
+ unless PatternbotData[:css][:modulifier][:settings].kind_of?(Array) and PatternbotData[:css][:modulifier][:settings].include? 'media-objects'
17
+ PatternbotData[:patterns][:internal]['modules'][:config]['patterns'].delete 'media-objects'
18
+ end
19
+ rescue
16
20
  PatternbotData[:patterns][:internal]['modules'][:config]['patterns'].delete 'media-objects'
17
21
  end
18
22
  end
19
23
 
20
24
  def remove_list_group
21
- unless (PatternbotData[:css].key? :modulifier and
22
- PatternbotData[:css][:modulifier].key? :settings and
23
- PatternbotData[:css][:modulifier][:settings].include? 'list-group')
25
+ begin PatternbotData.dig(:css, :modulifier, :settings)
26
+ unless PatternbotData[:css][:modulifier][:settings].kind_of?(Array) and PatternbotData[:css][:modulifier][:settings].include? 'list-groups'
27
+ PatternbotData[:patterns][:internal]['modules'][:config]['patterns'].delete 'list-groups'
28
+ end
29
+ rescue
24
30
  PatternbotData[:patterns][:internal]['modules'][:config]['patterns'].delete 'list-groups'
25
31
  end
26
32
  end
data/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module JekyllPatternbot
2
- VERSION = '1.0.2'
2
+ VERSION = '1.0.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll_patternbot
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas J Bradley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-17 00:00:00.000000000 Z
11
+ date: 2019-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll