jekyll_frontmatter_tests 0.0.6 → 0.0.7

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
  SHA1:
3
- metadata.gz: dd7f9159c4c403882d1a6cc779200cbff4ebf6c0
4
- data.tar.gz: d49acc94c917cc7fff9f98795c06d1b04168ee6a
3
+ metadata.gz: 071d941ef890ecfb4bd5660d0181696439a3f160
4
+ data.tar.gz: 370d78ee91df6b28b14a689011a98112522122cc
5
5
  SHA512:
6
- metadata.gz: 21405476706162546aa83acf6d5660cd674ca4d6e596bf1b5ac039f948edbd7db3bb3d58d67289c1b1023bbb111d96b078ca5ea996258653203639130dccc40a
7
- data.tar.gz: 1c43086ab73d4be4bfc649f265cda7836a6ed587f8976d50f4382a2e19c96910c74d6d19cc1317977c0d5fbe727acc1362376f3a3c9f31272eda0494d7f88040
6
+ metadata.gz: e89e8f1187c6958ed90a7c7781515775f381057ffe9a58155afcf03f10502feb8e3457f64a32e728ec4be3c21d929964b9b4a36ea963edf19e92fddebbb8e031
7
+ data.tar.gz: 123047a39baca06a1aa2f6cbae67359088e9f41daa18c2f61f389134274d67cc91b8004a590156fd0873a1a2561357bd07a36e5329dd55e51b217a5a8dd311dc
@@ -1,17 +1,6 @@
1
1
  require 'yaml'
2
2
  class FrontmatterTests < Jekyll::Command
3
3
  class << self
4
- # Public: load the configuration file
5
- #
6
- # Assumes this is a standard jekyll site
7
- def config
8
- config = Jekyll.configuration
9
- if config.key('frontmatter_tests').nil?
10
- config['frontmatter_tests'] = {'path' => File.join("deploy", "tests", "schema")}
11
- end
12
- @config ||= config['frontmatter_tests']
13
- end
14
-
15
4
  # Public: Load a schema from file.
16
5
  #
17
6
  # file - a string containing a filename
@@ -22,7 +11,7 @@ class FrontmatterTests < Jekyll::Command
22
11
  # Returns a hash loaded from the YAML doc or exits 1 if no schema file
23
12
  # exists.
24
13
  def loadschema(file)
25
- schema = File.join("deploy", "tests", "schema", file)
14
+ schema = File.join(@schema['path'], file)
26
15
  if File.exists?(schema)
27
16
  YAML.load_file(schema)
28
17
  else
@@ -114,7 +103,7 @@ class FrontmatterTests < Jekyll::Command
114
103
  # Public: Tests all collections described by a schema file at
115
104
  # `deploy/tests/scema`
116
105
  def test_everything
117
- schema = Dir.open('deploy/tests/schema')
106
+ schema = Dir.open(@schema['path'])
118
107
  yepnope = Array.new
119
108
  schema.each { |s|
120
109
  if s.start_with?('_')
@@ -140,6 +129,7 @@ class FrontmatterTests < Jekyll::Command
140
129
  #
141
130
  # The test runner pushes the result of each test into a `results` array and # exits `1` if any tests fail or `0` if all is well.
142
131
  def test_frontmatter(args, options)
132
+
143
133
  puts 'starting tests'
144
134
  if options['posts']
145
135
  results = test_posts
@@ -163,6 +153,11 @@ class FrontmatterTests < Jekyll::Command
163
153
  # When `jekyll test` runs, `test_frontmatter` is fired with options and args
164
154
  # passed from the command line.
165
155
  def init_with_program(prog)
156
+ config = Jekyll.configuration
157
+ unless config.key?('frontmatter_tests')
158
+ config['frontmatter_tests'] = {'path' => File.join("deploy", "tests", "schema")}
159
+ end
160
+ @schema ||= config['frontmatter_tests']
166
161
  prog.command(:test) do |c|
167
162
  c.syntax "test [options]"
168
163
  c.description 'Test your site for frontmatter.'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll_frontmatter_tests
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg Boone