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-rails
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: b4c111f30bb8
Choose a base ref
...
head repository: opal/opal-rails
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1b8f573a38e7
Choose a head ref
  • 4 commits
  • 9 files changed
  • 1 contributor

Commits on Nov 5, 2013

  1. Update to opal 0.5

    elia committed Nov 5, 2013

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    1f26c02 View commit details
  2. Switch to opal-rspec

    elia committed Nov 5, 2013

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    becd334 View commit details
  3. Opal.{parse => compile}

    elia committed Nov 5, 2013

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    4f199e2 View commit details
  4. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    1b8f573 View commit details
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ gemspec
gem 'capybara-webkit' unless ENV['CI']
# gem 'opal', :github => 'opal/opal'
# gem 'opal-jquery', :github => 'opal/opal-jquery'
# gem 'opal-spec', :github => 'opal/opal-spec'
# gem 'opal-rspec', :github => 'opal/opal-rspec'

platform :ruby_18 do
gem 'nokogiri', '< 1.6'
2 changes: 1 addition & 1 deletion app/views/layouts/opal_spec.html.erb
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<title>Opal Spec Runner</title>
<%= javascript_include_tag 'opal-spec-runner' %>
<%= javascript_include_tag 'opal-rspec-runner' %>
<%= javascript_include_tag *spec_files.map { |f| "spec/#{f}"} %>
<style>
body { font-family: sans-serif; }
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
require 'jquery'

require 'opal'
require 'opal-spec'
require 'opal-rspec'
require 'opal-jquery'

Document.ready? do
Opal::Spec::Runner.new.run
Opal::RSpec::Runner.new.run
end
2 changes: 1 addition & 1 deletion lib/opal/rails.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'opal'
require 'opal-jquery'
require 'opal-activesupport'
require 'opal-spec'
require 'opal-rspec'

require 'opal/rails/engine'
require 'opal/rails/template_handler'
8 changes: 4 additions & 4 deletions lib/opal/rails/haml_filter.rb
Original file line number Diff line number Diff line change
@@ -2,17 +2,17 @@ module Haml::Filters::Opal
include Haml::Filters::Base

def render_with_options ruby, options
text = ::Opal.parse(ruby)
text = ::Opal.compile(ruby)

if options[:format] == :html5
type = ''
else
type = " type=#{options[:attr_wrapper]}text/javascript#{options[:attr_wrapper]}"
end

text.rstrip!
text.gsub!("\n", "\n ")

<<HTML
<script#{type}>
//<![CDATA[
2 changes: 1 addition & 1 deletion lib/opal/rails/template_handler.rb
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ def self.call(template)
def call(template)
escaped = template.source.gsub(':', '\:')
string = '%q:' + escaped + ':'
"Opal.parse('Object.new.instance_eval {' << #{assigns} << #{local_assigns} << #{string} << '}')"
"Opal.compile('Object.new.instance_eval {' << #{assigns} << #{local_assigns} << #{string} << '}')"
end

private
4 changes: 2 additions & 2 deletions lib/tasks/opal-rails_tasks.rake
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ Opal::Spec::RakeTask.new('opal:spec' => :environment) do |server|
require 'tempfile'

asset_paths = Opal.paths + Rails.configuration.assets.paths.to_a
tempfile = Tempfile.new(['opal-spec', '.js.rb'])
tempfile = Tempfile.new(['opal-rspec', '.js.rb'])

server.sprockets.clear_paths
asset_paths << File.dirname(tempfile.path)
@@ -13,7 +13,7 @@ Opal::Spec::RakeTask.new('opal:spec' => :environment) do |server|
asset_paths.each { |path| server.append_path path }

required_assets = ['opal']
required_assets << 'opal-spec-runner'
required_assets << 'opal-rspec-runner'

asset_paths.each do |path|
Dir["#{path}/spec/**_spec.js.{opal,rb}"].each do |spec|
10 changes: 5 additions & 5 deletions opal-rails.gemspec
Original file line number Diff line number Diff line change
@@ -19,13 +19,13 @@ Gem::Specification.new do |s|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ['lib']

s.add_runtime_dependency 'opal', '~> 0.4.4'
s.add_runtime_dependency 'opal-sprockets', '~> 0.2.0'
s.add_runtime_dependency 'opal', '~> 0.5.0'
s.add_runtime_dependency 'opal-sprockets', '~> 0.3.0'

s.add_runtime_dependency 'rails', '>= 3.2.13', '< 5.0'
s.add_runtime_dependency 'opal-jquery', '>= 0.0.8'
s.add_runtime_dependency 'opal-spec', '~> 0.3.1'
s.add_runtime_dependency 'opal-activesupport'
s.add_runtime_dependency 'opal-jquery', '>= 0.1.0'
s.add_runtime_dependency 'opal-rspec'
s.add_runtime_dependency 'opal-activesupport', '>= 0.0.5'
s.add_runtime_dependency 'jquery-rails'

s.add_development_dependency 'rspec', '~> 2.13'
7 changes: 0 additions & 7 deletions spec/integration/source_map_spec.rb
Original file line number Diff line number Diff line change
@@ -27,13 +27,6 @@
end
end

it "points to a file on the disk" do
path = map['sources'].first
pathname = Pathname(path.gsub(%r{^file\://}, ''))
expect(pathname.exist?).to be_true
end


def extract_map_url response
response.headers['X-SourceMap'] or
response.body.scan(%r{^//@ sourceMappingURL=([^\n]+)}).flatten.first.strip