Permalink
Browse files

Decouple CoffeeScript and Sass gems.

Strong coupling requires a huge investment by users in terms of
troubleshooting and other packages (e.g. NodeJS or therubyracer)
Running 'gem install <blah>' isn't a significant cost, especially
given that the user ran 'gem install jekyll' just fine. If this
process is automated, adding in these gems and their dependencies
is easy and can be automated too.

To install either of these gems, run `gem install <gem_name>`
or add them to your site's Gemfile (if exists) by adding
`gem <gem_name>` to your site's Gemfile, then run `bundle install`.

Jekyll shall not be bloatware.
  • Loading branch information...
1 parent ee021a6 commit ceb27fb9a2850e148eac0f02eccc9f6070469036 @parkr parkr committed May 9, 2014
Showing with 11 additions and 4 deletions.
  1. +2 −2 jekyll.gemspec
  2. +9 −2 lib/jekyll.rb
View
@@ -38,9 +38,9 @@ Gem::Specification.new do |s|
s.add_runtime_dependency('colorator', "~> 0.1")
s.add_runtime_dependency('redcarpet', "~> 3.1")
s.add_runtime_dependency('toml', '~> 0.1.0')
- s.add_runtime_dependency('jekyll-coffeescript', '~> 1.0')
- s.add_runtime_dependency('jekyll-sass-converter', '~> 1.0')
+ s.add_development_dependency('jekyll-coffeescript', '~> 1.0')
+ s.add_development_dependency('jekyll-sass-converter', '~> 1.0')
s.add_development_dependency('rake', "~> 10.1")
s.add_development_dependency('rdoc', "~> 3.11")
s.add_development_dependency('redgreen', "~> 1.2")
View
@@ -12,6 +12,13 @@ def require_all(path)
end
end
+def require_if_exists(pkg)
+ begin
+ require pkg
+ rescue LoadError
+ end
+end
+
# rubygems
require 'rubygems'
@@ -70,8 +77,8 @@ def require_all(path)
require_all 'jekyll/tags'
# plugins
-require 'jekyll-coffeescript'
-require 'jekyll-sass-converter'
+require_if_exists 'jekyll-coffeescript'
+require_if_exists 'jekyll-sass-converter'
SafeYAML::OPTIONS[:suppress_warnings] = true

0 comments on commit ceb27fb

Please sign in to comment.