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.

This commit is contained in:
Kevin Ross 2016-01-14 13:27:42 -06:00
parent 8ee26b7158
commit e8b5cd3700
3 changed files with 24 additions and 10 deletions

View File

@ -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)

View File

@ -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

View File

@ -1,5 +1,6 @@
#!/usr/bin/env ruby
#
# for debugging plugins only, otherwise entirely unused.
require 'rubygems'