Permalink
Browse files

Broke plugin list out to plugins.yml. Wrote Rake task to handle bundl…

…e updates.
  • Loading branch information...
1 parent 2325d40 commit e76cce6e0e461a7f54f7a11a7266de1a5b6e4f75 @jedfoster committed Nov 27, 2012
Showing with 61 additions and 14 deletions.
  1. +1 −1 Gemfile.lock
  2. +31 −0 Rakefile
  3. +26 −0 plugins.yml
  4. +3 −13 sassmeister.rb
View
@@ -73,7 +73,7 @@ GEM
compass (>= 0.12.2)
modular-scale (>= 1.0.2)
sass (>= 3.2.1)
- stipe (0.0.4.8)
+ stipe (0.0.4.9)
compass (>= 0.11)
sass (>= 3.2.1)
susy (1.0.4)
View
@@ -1,3 +1,6 @@
+require 'yaml'
+require 'thor'
+
desc "Run the app's server in either development or production mode"
task :server do
environment = 'development'
@@ -15,9 +18,37 @@ task :server do
task environment.to_sym do ; end
end
+
# Heroku will run this task as part of the deployment process.
desc "Compile the app's Sass"
task "assets:precompile" do
system("bundle exec jammit --force")
system("bundle exec compass compile")
+end
+
+
+desc "Update bundled gems. Use this in place of bundle update"
+task "bundle:update" do
+ plugins = YAML.load_file("plugins.yml")
+ gemfile = File.new('Gemfile').read
+
+ plugins.each do |plugin|
+ if ! gemfile.match(/^gem '#{plugin.last[:gem]}'/)
+ puts "Adding #{plugin.last[:gem]} to Gemfile..."
+ Utilities.new.append('Gemfile', "\ngem '#{plugin.last[:gem]}'")
+ end
+ end
+
+ exec "bundle update"
+end
+
+
+class Utilities < Thor
+ include Thor::Actions
+
+ no_tasks do
+ def append(file, string)
+ append_file file, string, {:verbose => false}
+ end
+ end
end
View
@@ -0,0 +1,26 @@
+bourbon:
+ :gem: bourbon-compass
+ :import: bourbon/bourbon
+breakpoint:
+ :gem: breakpoint
+ :import: breakpoint
+compass:
+ :gem: compass
+ :import: compass
+neat:
+ :gem: neat-compass
+ :import: ! 'bourbon/bourbon";
+
+ @import "neat/neat'
+sassy-buttons:
+ :gem: sassy-buttons
+ :import: sassy-buttons
+singularity.gs:
+ :gem: singularitygs
+ :import: singularitygs
+stipe:
+ :gem: stipe
+ :import: ./sass/stipe
+susy:
+ :gem: susy
+ :import: susy
View
@@ -12,6 +12,7 @@
require 'sass'
require 'compass'
+require 'yaml'
set :partial_template_engine, :erb
@@ -31,8 +32,6 @@ def github(auth_token = '')
end
configure :development do
- require 'yaml'
-
helpers do
def github(auth_token = '')
gh_config = YAML.load_file("github.yml")
@@ -61,16 +60,7 @@ def random
end
def plugins
- {
- "bourbon" => {gem: 'bourbon-compass', import: 'bourbon/bourbon'},
- "breakpoint" => {gem: 'breakpoint', import: 'breakpoint'},
- "compass" => {gem: 'compass', import: 'compass'},
- "neat" => {gem: 'neat-compass', import: "bourbon/bourbon\";\n@import \"neat/neat"},
- "sassy-buttons" => {gem: 'sassy-buttons', import: 'sassy-buttons'},
- "singularity.gs" => {gem: 'singularitygs', import: 'singularitygs'},
- "stipe" => {gem: 'stipe', import: './sass/stipe'},
- "susy" => {gem: 'susy', import: 'susy'},
- }.each do |plugin|
+ YAML.load_file("plugins.yml").each do |plugin|
plugin.last[:version] = Gem.loaded_specs[plugin.last[:gem]].version.to_s
end
end
@@ -196,4 +186,4 @@ def compile_sass(params, sass)
post '/reset' do
session[:gist] = ''
-end
+end

0 comments on commit e76cce6

Please sign in to comment.