From e8b5cd3700bc10db0a0bde53a22c26c7a95480aa Mon Sep 17 00:00:00 2001 From: Kevin Ross Date: Thu, 14 Jan 2016 13:27:42 -0600 Subject: [PATCH] fixed resolution of jquery/tether versions for docs by relying on .bower.json instead of bower.json. Added assertions so we don't get another cryptic message on resolutions of these variables. --- Gemfile.lock | 12 ++++++------ docs/_plugins/variables.rb | 19 ++++++++++++++++--- grunt/jekyll-debug.rb | 3 ++- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index e625fd1b..eae4b0b8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -12,11 +12,11 @@ GEM mercenary (~> 0.3.3) rouge (~> 1.7) safe_yaml (~> 1.0) - jekyll-redirect-from (0.9.0) + jekyll-redirect-from (0.9.1) jekyll (>= 2.0) - jekyll-sass-converter (1.3.0) - sass (~> 3.2) - jekyll-seo-tag (0.1.3) + jekyll-sass-converter (1.4.0) + sass (~> 3.4) + jekyll-seo-tag (0.1.4) jekyll (>= 2.0) jekyll-sitemap (0.9.0) jekyll-watch (1.3.0) @@ -28,12 +28,12 @@ GEM rb-inotify (>= 0.9) mercenary (0.3.5) rainbow (2.0.0) - rb-fsevent (0.9.6) + rb-fsevent (0.9.7) rb-inotify (0.9.5) ffi (>= 0.5.0) rouge (1.10.1) safe_yaml (1.0.4) - sass (3.4.19) + sass (3.4.21) scss_lint (0.43.2) rainbow (~> 2.0) sass (~> 3.4.15) diff --git a/docs/_plugins/variables.rb b/docs/_plugins/variables.rb index abd99533..17ec48d4 100644 --- a/docs/_plugins/variables.rb +++ b/docs/_plugins/variables.rb @@ -20,8 +20,8 @@ module Variables metadata_files = { 'bower' => '../bower.json', 'package' => '../package.json', - 'bower_jquery' => '../bower_components/jquery/bower.json', - 'bower_tether' => '../bower_components/tether/bower.json' + 'bower_jquery' => '../bower_components/jquery/.bower.json', + 'bower_tether' => '../bower_components/tether/.bower.json' } metadata_files.each do |metadata, path| @@ -29,12 +29,21 @@ module Variables site.data[metadata] = contents end - # some quick access to common variables (instead of diving into package and bower) + # validate and provide some quick access to common variables (instead of diving into package and bower) name = site.data['package']['name'] + assert_not_nil :name, name + version = site.data['package']['version'] + assert_not_nil :version, version + bootstrap_version = site.data['bower']['dependencies']['bootstrap'] + assert_not_nil :bootstrap_version, bootstrap_version + tether_version = site.data['bower_tether']['version'] + assert_not_nil :tether_version, tether_version + jquery_version = site.data['bower_jquery']['version'] + assert_not_nil :jquery_version, jquery_version site.data['name'] = name site.data['version'] = version @@ -68,5 +77,9 @@ module Variables # puts repo # puts version end + + def assert_not_nil(name, value) + raise "Expected #{name} to be not nil." if value.nil? + end end end diff --git a/grunt/jekyll-debug.rb b/grunt/jekyll-debug.rb index 0ced37f9..67c0d21f 100644 --- a/grunt/jekyll-debug.rb +++ b/grunt/jekyll-debug.rb @@ -1,5 +1,6 @@ #!/usr/bin/env ruby -# + +# for debugging plugins only, otherwise entirely unused. require 'rubygems'