mirror of
https://github.com/rubyjs/therubyracer
synced 2023-03-27 23:21:42 -04:00
Modernize the gemspec to use Bundler. Clean up tons of cruft in the gem.
This commit is contained in:
parent
977bcbbeda
commit
65ccb9c438
13 changed files with 45 additions and 1636 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,4 +1,5 @@
|
|||
|
||||
.bundle
|
||||
Gemfile.lock
|
||||
v8.bundle
|
||||
v8.so
|
||||
*.o
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
## EDGE
|
||||
|
||||
* decruft all the crap that had accumulated in the gem
|
||||
* Javascript Objects are now always mapped to the same V8::Object when read from the context
|
||||
|
||||
## 0.8.0 - 2010/12/02
|
||||
|
||||
* every V8 Context gets its own unique access strategy
|
||||
|
|
1
Gemfile
Normal file
1
Gemfile
Normal file
|
@ -0,0 +1 @@
|
|||
source :rubygems;gemspec
|
12
README.md
12
README.md
|
@ -77,7 +77,7 @@ or load it by filename
|
|||
cxt.load("mysource.js")
|
||||
|
||||
|
||||
## Safe by default
|
||||
## Safe by default, dangerous by demand
|
||||
|
||||
The Ruby Racer is designed to let you evaluate javascript as safely as possible unless you tell it to do something more
|
||||
dangerous. The default context is a hermetically sealed javascript environment with only the standard javascript objects
|
||||
|
@ -113,13 +113,8 @@ exposed by default. E.g.
|
|||
cxt.eval("b.object_id") #=> undefined, object_id is on Object
|
||||
end
|
||||
|
||||
|
||||
## Dangerous by Demand
|
||||
|
||||
All aspects of ruby embedding are pluggable on a per context basis, including
|
||||
the visibility of ruby libraries and classes. If needed, you can expose more aspects
|
||||
of the It is possible to override this
|
||||
safe behavior.
|
||||
If needed, you can override the [Ruby Access](https://github.com/cowboyd/therubyracer/blob/master/lib/v8/access.rb)
|
||||
to allow whatever behavior you'd like
|
||||
|
||||
## REQUIREMENTS:
|
||||
|
||||
|
@ -130,6 +125,7 @@ safe behavior.
|
|||
## DEVELOP
|
||||
* git clone git://github.com/cowboyd/therubyracer.git
|
||||
* cd therubyracer
|
||||
* git submodule update --init
|
||||
* rake compile
|
||||
|
||||
## LICENSE:
|
||||
|
|
51
Rakefile
51
Rakefile
|
@ -1,42 +1,14 @@
|
|||
require 'rubygems'
|
||||
|
||||
UPSTREAM = "ext/v8/upstream"
|
||||
|
||||
manifest = Rake::FileList.new("**/*")
|
||||
manifest.exclude "lib/v8/*.bundle", "lib/v8/*.so", "ext/**/test/*", "ext/**/test/*", "ext/**/samples/*", "ext/**/benchmarks/*", "#{UPSTREAM}/build", "tmp", "tmp/**/*", "**/*.gem"
|
||||
Gem::Specification.new do |gemspec|
|
||||
$gemspec = gemspec
|
||||
gemspec.name = gemspec.rubyforge_project = "therubyracer"
|
||||
gemspec.version = "0.8.0"
|
||||
gemspec.summary = "Embed the V8 Javascript interpreter into Ruby"
|
||||
gemspec.description = "Call javascript code and manipulate javascript objects from ruby. Call ruby code and manipulate ruby objects from javascript."
|
||||
gemspec.email = "cowboyd@thefrontside.net"
|
||||
gemspec.homepage = "http://github.com/cowboyd/therubyracer"
|
||||
gemspec.authors = ["Charles Lowell", "Bill Robertson"]
|
||||
gemspec.extra_rdoc_files = ["README.rdoc"]
|
||||
gemspec.executables = ["therubyracer", "v8"]
|
||||
gemspec.extensions = ["ext/v8/extconf.rb"]
|
||||
gemspec.require_paths = ["lib", "ext", "contrib"]
|
||||
gemspec.files = manifest.to_a
|
||||
end
|
||||
require 'bundler'
|
||||
require 'bundler/setup'
|
||||
require "rake/extensiontask"
|
||||
require "rspec/core/rake_task"
|
||||
Bundler::GemHelper.install_tasks
|
||||
|
||||
task :default => :spec
|
||||
|
||||
desc "Build gem"
|
||||
task :gem => :gemspec do
|
||||
Gem::Builder.new($gemspec).build
|
||||
end
|
||||
|
||||
desc "build the gemspec"
|
||||
task :gemspec => :clean do
|
||||
File.open("#{$gemspec.name}.gemspec", "w") do |f|
|
||||
f.write($gemspec.to_ruby)
|
||||
end
|
||||
end
|
||||
|
||||
desc "remove all generated artifacts except built v8 objects"
|
||||
task :clean do
|
||||
sh "rm -rf *.gem"
|
||||
sh "rm -rf pkg"
|
||||
sh "rm -rf ext/v8/Makefile"
|
||||
sh "rm -rf ext/v8/*.bundle ext/v8/*.so"
|
||||
sh "rm -rf lib/v8/*.bundle lib/v8/*.so"
|
||||
|
@ -44,16 +16,19 @@ end
|
|||
|
||||
desc "remove all built v8 objects"
|
||||
task "v8:clean" => "clean" do
|
||||
sh "cd #{UPSTREAM} && make clean"
|
||||
sh "cd ext/v8/upstream && make clean"
|
||||
end
|
||||
|
||||
desc "build v8 with debugging symbols (much slower)"
|
||||
task "v8:debug" do
|
||||
sh "cd #{UPSTREAM} && make debug"
|
||||
sh "cd ext/v8/upstream && make debug"
|
||||
end
|
||||
|
||||
for file in Dir['tasks/*.rake']
|
||||
load file
|
||||
Rake::ExtensionTask.new("v8", eval(File.read("therubyracer.gemspec"))) do |ext|
|
||||
ext.lib_dir = "lib/v8"
|
||||
ext.source_pattern = "*.{cpp,h}"
|
||||
end
|
||||
|
||||
RSpec::Core::RakeTask.new(:spec)
|
||||
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ $:.unshift(File.dirname(__FILE__)) unless
|
|||
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
|
||||
|
||||
module V8
|
||||
VERSION = '0.8.0'
|
||||
require 'v8/version'
|
||||
require 'v8/v8' #native glue
|
||||
require 'v8/portal'
|
||||
require 'v8/portal/functions'
|
||||
|
|
3
lib/v8/version.rb
Normal file
3
lib/v8/version.rb
Normal file
|
@ -0,0 +1,3 @@
|
|||
module V8
|
||||
VERSION = "0.8.1"
|
||||
end
|
|
@ -1,10 +0,0 @@
|
|||
#!/usr/bin/env ruby
|
||||
# File: script/console
|
||||
irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
|
||||
|
||||
libs = " -r irb/completion"
|
||||
# Perhaps use a console_lib to store any extra methods I may want available in the cosole
|
||||
# libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
|
||||
libs << " -I #{File.dirname(__FILE__) + '/../lib'} -r v8"
|
||||
puts "Revving Up The Ruby Racer!"
|
||||
exec "#{irb} #{libs} --simple-prompt"
|
|
@ -1,14 +0,0 @@
|
|||
#!/usr/bin/env ruby
|
||||
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
||||
|
||||
begin
|
||||
require 'rubigen'
|
||||
rescue LoadError
|
||||
require 'rubygems'
|
||||
require 'rubigen'
|
||||
end
|
||||
require 'rubigen/scripts/destroy'
|
||||
|
||||
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
||||
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
|
||||
RubiGen::Scripts::Destroy.new.run(ARGV)
|
|
@ -1,14 +0,0 @@
|
|||
#!/usr/bin/env ruby
|
||||
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
||||
|
||||
begin
|
||||
require 'rubigen'
|
||||
rescue LoadError
|
||||
require 'rubygems'
|
||||
require 'rubigen'
|
||||
end
|
||||
require 'rubigen/scripts/generate'
|
||||
|
||||
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
||||
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
|
||||
RubiGen::Scripts::Generate.new.run(ARGV)
|
|
@ -1,11 +0,0 @@
|
|||
begin
|
||||
gem 'rake-compiler', '>= 0.4.1'
|
||||
require "rake/extensiontask"
|
||||
Rake::ExtensionTask.new("v8", $gemspec) do |ext|
|
||||
ext.lib_dir = "lib/v8"
|
||||
ext.source_pattern = "*.{cpp,h}"
|
||||
end
|
||||
rescue LoadError
|
||||
puts "Rake Compiler not available. You won't be able to compile with rake, unless you gem install rake-compiler"
|
||||
end
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
Add table
Reference in a new issue