Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: opal/opal
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 8a8751fc2c6a^
Choose a base ref
...
head repository: opal/opal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 947f0fe39a97
Choose a head ref
  • 4 commits
  • 4 files changed
  • 1 contributor

Commits on Sep 5, 2014

  1. Unverified

    The committer email address is not verified.
    Copy the full SHA
    8a8751f View commit details
  2. Unverified

    The committer email address is not verified.
    Copy the full SHA
    5dae33b View commit details
  3. Copy the full SHA
    1387f1d View commit details
  4. Prepare for sprockets 3.0

    elia committed Sep 5, 2014
    Copy the full SHA
    947f0fe View commit details
Showing with 10 additions and 5 deletions.
  1. +4 −0 Gemfile
  2. +2 −1 lib/opal/sprockets/processor.rb
  3. +3 −1 opal.gemspec
  4. +1 −3 spec/lib/sprockets/path_reader_spec.rb
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -9,6 +9,10 @@ gem 'json', '< 1.8.1' if RUBY_VERSION.to_f == 2.1 and RUBY_ENGINE == 'ruby'
gem 'rubysl', :platform => :rbx
gem 'thin', platform: :mri

# Uncomment to try with sprockets 3.0:
#
# gem 'sprockets', github: 'sstephenson/sprockets', branch: 'master'

group :repl do
gem 'therubyracer', :platform => :mri, :require => 'v8'
gem 'therubyrhino', :platform => :jruby
3 changes: 2 additions & 1 deletion lib/opal/sprockets/processor.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'set'
require 'tilt'
require 'sprockets'
require 'opal/version'
require 'opal/builder'
@@ -64,7 +65,7 @@ class << self

def evaluate(context, locals, &block)
return Opal.compile data unless context.is_a? ::Sprockets::Context

path = context.logical_path
prerequired = []

4 changes: 3 additions & 1 deletion opal.gemspec
Original file line number Diff line number Diff line change
@@ -19,7 +19,9 @@ Gem::Specification.new do |s|
s.require_paths = ['lib']

s.add_dependency 'source_map'
s.add_dependency 'sprockets'
s.add_dependency 'sprockets', '~> 2.12.1'
s.add_dependency 'hike', '~> 1.2'
s.add_dependency 'tilt', '~> 1.4'

s.add_development_dependency 'mspec', '1.5.20'
s.add_development_dependency 'rake'
4 changes: 1 addition & 3 deletions spec/lib/sprockets/path_reader_spec.rb
Original file line number Diff line number Diff line change
@@ -6,9 +6,7 @@
subject(:path_reader) { described_class.new(env, context) }

let(:env) { Opal::Environment.new }

# TODO: use stubs and expect calls on #depend_on and #depend_on_asset
let(:context) { env.context_class.new(env, 'foo', Pathname('bar/baz/foo.js')) }
let(:context) { double('context', depend_on: nil, depend_on_asset: nil) }

let(:logical_path) { 'sprockets_file' }
let(:fixtures_dir) { File.expand_path('../../fixtures/', __FILE__) }