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-rspec
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: c88516659a9b
Choose a base ref
...
head repository: opal/opal-rspec
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 617560c40487
Choose a head ref
  • 3 commits
  • 2 files changed
  • 1 contributor

Commits on Mar 30, 2015

  1. Copy the full SHA
    0a7d52b View commit details
  2. Prepare the task app outside of the thread

    This also keeps in the main thread the block execution which is a major 
    source of exceptions.
    elia committed Mar 30, 2015
    Copy the full SHA
    f3e13aa View commit details
  3. Copy the full SHA
    617560c View commit details
Showing with 15 additions and 10 deletions.
  1. +14 −9 lib/opal/rspec/rake_task.rb
  2. +1 −1 opal-rspec.gemspec
23 changes: 14 additions & 9 deletions lib/opal/rspec/rake_task.rb
Original file line number Diff line number Diff line change
@@ -15,17 +15,22 @@ def initialize(name = 'opal:rspec', &block)
require 'rack'
require 'webrick'

server = Thread.new do
app = Opal::Server.new { |s|
s.main = 'opal/rspec/sprockets_runner'
s.append_path 'spec'
s.debug = false
app = Opal::Server.new { |s|
s.main = 'opal/rspec/sprockets_runner'
s.append_path 'spec'
s.debug = false

block.call s if block
}
block.call s if block
}

Rack::Server.start(:app => app, :Port => PORT, :AccessLog => [],
:Logger => WEBrick::Log.new("/dev/null"))
server = Thread.new do
Thread.current.abort_on_exception = true
Rack::Server.start(
:app => app,
:Port => PORT,
:AccessLog => [],
:Logger => WEBrick::Log.new("/dev/null"),
)
end

if `phantomjs -v`.strip.to_i >= 2
2 changes: 1 addition & 1 deletion opal-rspec.gemspec
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|

s.require_paths = ['lib']

s.add_dependency 'opal', '~> 0.7.0'
s.add_dependency 'opal', ['>= 0.7.0', '< 0.9']
s.add_development_dependency 'rake'
s.add_development_dependency 'yard'
end