diff --git a/.gitignore b/.gitignore index aa82167..634eb8e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ doc *.gem .rvmrc +.bundle diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..f6a560f --- /dev/null +++ b/Gemfile @@ -0,0 +1,3 @@ +source :rubygems + +gemspec \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..0590f8e --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,16 @@ +PATH + remote: . + specs: + therubyrhino (1.72.7) + +GEM + remote: http://rubygems.org/ + specs: + rspec (1.3.0) + +PLATFORMS + java + +DEPENDENCIES + rspec + therubyrhino! diff --git a/Rakefile b/Rakefile index b0bdc48..cdf18da 100644 --- a/Rakefile +++ b/Rakefile @@ -1,36 +1,11 @@ -require 'rubygems' -require './lib/rhino' -Gem::Specification.new do |gemspec| - $gemspec = gemspec - gemspec.name = gemspec.rubyforge_project = "therubyrhino" - gemspec.version = Rhino::VERSION - gemspec.summary = "Embed the Rhino JavaScript interpreter into JRuby" - 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/therubyrhino" - gemspec.authors = ["Charles Lowell"] - gemspec.extra_rdoc_files = ["README.rdoc"] - gemspec.files = Rake::FileList.new("**/*").tap do |manifest| - manifest.exclude "*.gem" - end -end - -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 - -task :clean do - sh "rm -rf *.gem" -end +require 'bundler/setup' +Bundler::GemHelper.install_tasks for file in Dir['tasks/*.rake'] load file end + +desc "remove all build artifacts" +task :clean do + sh "rm -rf pkg/" +end diff --git a/lib/rhino.rb b/lib/rhino.rb index 966be10..58f109d 100644 --- a/lib/rhino.rb +++ b/lib/rhino.rb @@ -3,7 +3,7 @@ $:.unshift(File.dirname(__FILE__)) unless module Rhino - VERSION = '1.72.7.pre' + VERSION = '1.72.7' require 'rhino/java' require 'rhino/object' require 'rhino/context' diff --git a/lib/rhino/version.rb b/lib/rhino/version.rb new file mode 100644 index 0000000..8b1fd39 --- /dev/null +++ b/lib/rhino/version.rb @@ -0,0 +1,4 @@ + +module Rhino + VERSION = "1.72.7" +end \ No newline at end of file diff --git a/tasks/rspec.rake b/tasks/rspec.rake index 31a99b0..2ed38de 100644 --- a/tasks/rspec.rake +++ b/tasks/rspec.rake @@ -1,21 +1,13 @@ begin require 'spec' -rescue LoadError - require 'rubygems' unless ENV['NO_RUBYGEMS'] - require 'spec' -end -begin require 'spec/rake/spectask' + desc "Run the specs under spec/models" + Spec::Rake::SpecTask.new do |t| + t.spec_opts = ['--options', "spec/spec.opts"] + t.spec_files = FileList['spec/**/*_spec.rb'] + end rescue LoadError - puts <<-EOS -To use rspec for testing you must install rspec gem: - gem install rspec -EOS - exit(0) + desc "bundle install to run rspecs" + task :spec end -desc "Run the specs under spec/models" -Spec::Rake::SpecTask.new do |t| - t.spec_opts = ['--options', "spec/spec.opts"] - t.spec_files = FileList['spec/**/*_spec.rb'] -end diff --git a/therubyrhino.gemspec b/therubyrhino.gemspec index 22649ec..4a9b70d 100644 --- a/therubyrhino.gemspec +++ b/therubyrhino.gemspec @@ -1,29 +1,19 @@ # -*- encoding: utf-8 -*- +$:.push File.expand_path("../lib", __FILE__) +require "rhino/version" Gem::Specification.new do |s| s.name = %q{therubyrhino} - s.version = "1.72.7.pre" - - s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version= + s.version = Rhino::VERSION s.authors = ["Charles Lowell"] - s.date = %q{2010-08-10} s.description = %q{Call javascript code and manipulate javascript objects from ruby. Call ruby code and manipulate ruby objects from javascript.} s.email = %q{cowboyd@thefrontside.net} s.extra_rdoc_files = ["README.rdoc"] - s.files = ["History.txt", "lib", "Rakefile", "README.rdoc", "spec", "tasks", "therubyrhino.gemspec", "lib/rhino", "lib/rhino.rb", "lib/rhino/context.rb", "lib/rhino/java.rb", "lib/rhino/native_function.rb", "lib/rhino/native_object.rb", "lib/rhino/object.rb", "lib/rhino/rhino-1.7R2.jar", "lib/rhino/ruby_function.rb", "lib/rhino/ruby_object.rb", "lib/rhino/wormhole.rb", "spec/redjs", "spec/redjs_helper.rb", "spec/rhino", "spec/spec.opts", "spec/spec_helper.rb", "spec/redjs/jsapi_spec.rb", "spec/redjs/README.txt", "spec/rhino/context_spec.rb", "spec/rhino/wormhole_spec.rb", "tasks/jruby.rake", "tasks/rspec.rake"] + s.files = `git ls-files`.split("\n") s.homepage = %q{http://github.com/cowboyd/therubyrhino} s.require_paths = ["lib"] s.rubyforge_project = %q{therubyrhino} - s.rubygems_version = %q{1.3.6} s.summary = %q{Embed the Rhino JavaScript interpreter into JRuby} - if s.respond_to? :specification_version then - current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION - s.specification_version = 3 - - if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then - else - end - else - end + s.add_development_dependency "rspec" end