Skip to content

Commit

Permalink
Blade handles all Sprockets environments now
Browse files Browse the repository at this point in the history
  • Loading branch information
javan committed Oct 12, 2015
1 parent e8bf994 commit cf713fc
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 151 deletions.
10 changes: 10 additions & 0 deletions .blade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ load_paths:
logical_paths:
- trix.js
- test.js
- trix.css

build:
logical_paths:
- trix.js
- trix-core.js
- trix.css
path: dist
js_compressor: uglifier
css_compressor: sass

plugins:
sauce_labs:
Expand Down
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ gem 'coffee-script'
gem 'coffee-script-source', '~> 1.9.1'
gem 'ejs'
gem 'eco'
gem 'rack-rewrite'
gem 'uglifier'
gem 'sass'

gem 'blade', '~> 0.4.0'
gem 'blade', github: 'javan/blade'
gem 'blade-sauce_labs_plugin', '~> 0.4.0'
33 changes: 18 additions & 15 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
GIT
remote: git://github.com/javan/blade.git
revision: 09b6a162f38e0f6402879c0c378c7bb0ae8f2ed6
specs:
blade (0.4.0)
activesupport (>= 3.0.0)
blade-qunit_adapter (~> 0.4.0)
coffee-script (~> 2.4.0)
coffee-script-source (~> 1.9.0)
curses (~> 1.0.0)
eventmachine (~> 1.0.0)
faye (= 1.1.1)
sprockets (~> 3.2.0)
thin (~> 1.6.0)
thor (~> 0.19.1)
useragent (~> 0.13.0)

PATH
remote: .
specs:
Expand All @@ -13,18 +30,6 @@ GEM
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.3.8)
blade (0.4.0)
activesupport (>= 3.0.0)
blade-qunit_adapter (~> 0.4.0)
coffee-script (~> 2.4.0)
coffee-script-source (~> 1.9.0)
curses (~> 1.0.0)
eventmachine (~> 1.0.0)
faye (= 1.1.1)
sprockets (~> 3.2.0)
thin (~> 1.6.0)
thor (~> 0.19.1)
useragent (~> 0.13.0)
blade-qunit_adapter (0.4.0)
blade-sauce_labs_plugin (0.4.0)
blade
Expand Down Expand Up @@ -72,7 +77,6 @@ GEM
multi_json (1.11.2)
multipart-post (2.0.0)
rack (1.6.4)
rack-rewrite (1.5.0)
rake (10.0.4)
sass (3.4.3)
sprockets (3.2.0)
Expand All @@ -97,13 +101,12 @@ PLATFORMS
ruby

DEPENDENCIES
blade (~> 0.4.0)
blade!
blade-sauce_labs_plugin (~> 0.4.0)
coffee-script
coffee-script-source (~> 1.9.1)
eco
ejs
rack-rewrite
rake
sass
sprockets
Expand Down
24 changes: 0 additions & 24 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,28 +1,4 @@
require 'bundler/setup'
require 'uglifier'
require File.join(File.dirname(__FILE__) + '/lib/trix/environment')

namespace :trix do
environment = Trix::Environment.new(".")
environment.paths = %w( assets polyfills src )
environment.assets = %w( trix.css trix.js trix-core.js )
environment.sprockets_environment.js_compressor = Uglifier.new

desc "Clean Trix distribution"
task :clean do
environment.clean
end

desc "Build Trix distribution"
task :dist do
environment.dist
end

desc "Open Trix demo in a browser"
task :browser => :dist do
system "open", environment.dist_path_for("index.html")
end

desc "Print code statistics"
task :stats do
lines = `find src -name '*.coffee' -type f | xargs sed -n '/^ *\\(#.*\\)*\$/!p'`.strip.split("\n")
Expand Down
21 changes: 7 additions & 14 deletions config.ru
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
require 'bundler/setup'
require 'rack/rewrite'
require 'pathname'
require 'json'
require 'blade'
require 'json'

root = Pathname.new(File.dirname(__FILE__))

require root.join('lib/trix/environment')
environment = Trix::Environment.new(root)
environment.paths = %w( assets polyfills src )

use Blade::RackAdapter, mount: '/test'
Blade.initialize!

map '/' do
run environment.sprockets_environment
use Rack::Rewrite do
rewrite '/', '/index.html'
end
run Blade::Assets.environment(:user)
end

map '/test' do
run Blade::RackAdapter.new
end

map '/submit' do
Expand Down
96 changes: 0 additions & 96 deletions lib/trix/environment.rb

This file was deleted.

0 comments on commit cf713fc

Please sign in to comment.