Skip to content

Commit 99f5fb7

Browse files
committedNov 1, 2014
Use vendor rspec
1 parent b4c31be commit 99f5fb7

File tree

143 files changed

+16411
-20262
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+16411
-20262
lines changed
 

‎Rakefile

+11-13
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,21 @@ Bundler::GemHelper.install_tasks
66
require 'opal/rspec/rake_task'
77
Opal::RSpec::RakeTask.new(:default)
88

9-
desc "Build rspec.js"
10-
task :build_rspec do
9+
10+
require 'fileutils'
11+
desc "Copy RSpec sources"
12+
task :copy_rspec do
1113
gems = %w(rspec rspec-core rspec-expectations rspec-mocks rspec-support)
1214

13-
File.open('opal/opal/rspec/rspec.js', 'w+') do |out|
14-
gems.each do |gem|
15-
spec = Gem::Specification.find_by_name gem
16-
lib = File.join spec.gem_dir, 'lib'
15+
gems.each do |gem|
16+
spec = Gem::Specification.find_by_name gem
17+
lib = File.join spec.gem_dir, 'lib'
1718

18-
Dir["#{lib}/**/*.rb"].each do |file|
19-
asset = file.sub(/^#{lib}\//, '').sub(/\.rb$/, '')
20-
puts "#{file} => #{asset}"
21-
js = Opal.compile(File.read(file), requirable: true, file: asset,
22-
dynamic_require_severity: :warning)
19+
Dir["#{lib}/**/*.rb"].each do |file|
20+
out = file.sub(/^#{lib}\//, 'opal/')
2321

24-
out.puts js
25-
end
22+
FileUtils.mkdir_p File.dirname(out)
23+
FileUtils.cp file, out
2624
end
2725
end
2826
end

‎lib/opal/rspec.rb

+14
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,17 @@
33

44
# Just register our opal code path with opal build tools
55
Opal.append_path File.expand_path('../../../opal', __FILE__)
6+
7+
Opal::Processor.dynamic_require_severity = :warning
8+
9+
Opal::Processor.stub_file "rspec/matchers/built_in/have"
10+
Opal::Processor.stub_file "diff/lcs"
11+
Opal::Processor.stub_file "diff/lcs/hunk"
12+
Opal::Processor.stub_file "fileutils"
13+
Opal::Processor.stub_file "test/unit/assertions"
14+
Opal::Processor.stub_file "coderay"
15+
Opal::Processor.stub_file "optparse"
16+
Opal::Processor.stub_file "shellwords"
17+
Opal::Processor.stub_file "socket"
18+
Opal::Processor.stub_file "uri"
19+
Opal::Processor.stub_file "drb/drb"

0 commit comments

Comments
 (0)
Please sign in to comment.