diff --git a/Gemfile b/Gemfile index ea4ae50..e4488d4 100644 --- a/Gemfile +++ b/Gemfile @@ -2,3 +2,5 @@ source 'https://rubygems.org' # Specify your gem's dependencies in rmts.gemspec gemspec + +gem 'sinatra-asset-snack', path: '/Users/keyvan/sinatra-asset-snack' diff --git a/Gemfile.lock b/Gemfile.lock index 0328065..1ee18cc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,6 +11,15 @@ PATH thin toystore +PATH + remote: /Users/keyvan/sinatra-asset-snack + specs: + sinatra-asset-snack (0.1.5) + coffee-script + mime-types + sass + sinatra + GEM remote: https://rubygems.org/ specs: @@ -92,11 +101,6 @@ GEM rack (~> 1.4) rack-protection (~> 1.4) tilt (~> 1.3, >= 1.3.4) - sinatra-asset-snack (0.1.5) - coffee-script - mime-types - sass - sinatra sinatra-contrib (1.4.0) backports (>= 2.0) eventmachine @@ -132,4 +136,4 @@ DEPENDENCIES rake rspec simplecov - sinatra-asset-snack + sinatra-asset-snack! diff --git a/Rakefile b/Rakefile index 79dc626..3a13713 100644 --- a/Rakefile +++ b/Rakefile @@ -11,18 +11,15 @@ task :pry do require 'pry'; binding.pry end -namespace :assets do - task :precompile do - require 'bait' - Bait.assets.compile! - end -end - def git_master? `git branch | grep '* master'` $?.exitstatus == 0 end +APP_FILE = "lib/bait/api.rb" +require 'sinatra/asset_snack/rake' +namespace(:assets) { task :precompile => 'assetsnack:build' } + namespace :git do task :dirty do if `git status --porcelain`.match(/M /) diff --git a/lib/bait/assets.rb b/lib/bait/assets.rb index ab55de8..663e84e 100644 --- a/lib/bait/assets.rb +++ b/lib/bait/assets.rb @@ -15,20 +15,6 @@ def remove! def dynamic? Bait.env != "production" end - - def compile! - Module.new do - require 'bait/api' - require 'sinatra/asset_snack' - extend Sinatra::AssetSnack::InstanceMethods - Sinatra::AssetSnack.assets.each do |assets| - path = File.join(Bait.public, assets[:route]) - File.open(path, 'w') do |file| - file.write compile(assets[:paths])[:body] - end - end - end - end end.new end end