Rakefile in restfulie-1.0.0 vs Rakefile in restfulie-1.0.3

- old
+ new

@@ -4,41 +4,18 @@ require 'rake/gempackagetask' require 'rake/rdoctask' require 'rspec' require 'rspec/core' require 'rspec/core/rake_task' -require File.expand_path('lib/restfulie') +require "bundler" +Bundler::GemHelper.install_tasks +require File.join(File.dirname(__FILE__), 'lib', 'restfulie', 'version') + GEM = "restfulie" GEM_VERSION = Restfulie::VERSION -SUMMARY = "Hypermedia aware resource based library in ruby (client side) and ruby on rails (server side)." -AUTHOR = "Guilherme Silveira, Caue Guerra, Luis Cipriani, Everton Ribeiro, George Guimaraes, Paulo Ahagon, and many more!" -EMAIL = "guilherme.silveira@caelum.com.br" -HOMEPAGE = "http://restfulie.caelumobjects.com" -spec = Gem::Specification.new do |s| - s.name = GEM - s.version = GEM_VERSION - s.platform = Gem::Platform::RUBY - s.summary = SUMMARY - s.require_paths = ['lib'] - s.files = FileList['lib/**/*.rb', '[A-Z]*', 'lib/**/*.rng'].to_a - - s.add_dependency("nokogiri", [">= 1.4.2"]) - s.add_dependency("json_pure", [">= 1.2.4"]) - s.add_dependency("rack-conneg") - s.add_dependency("sqlite3-ruby") - s.add_dependency('tokamak', "~> 1.1.2") - s.add_dependency('medie', "~> 1.0.0") - s.add_dependency('respondie', "~> 0.9.0") - - - s.author = AUTHOR - s.email = EMAIL - s.homepage = HOMEPAGE -end - module FakeServer def self.wait_server(port=3000) (1..15).each do begin Net::HTTP.get(URI.parse("http://localhost:#{port}/")) @@ -70,10 +47,11 @@ end end def self.start_server_and_run_spec(target_dir) success = Dir.chdir(File.join(File.dirname(__FILE__), target_dir)) do + system('bundle install') system('rake db:drop db:create db:migrate') self.run "rails server", "rake spec" end end @@ -110,18 +88,13 @@ task :all => ["spec","integration"] end RSpec::Core::RakeTask.new(:spec) do |t| - # t.spec_files = FileList['spec_*.rb'] - t.spec_opts = ['--colour', '--format progress'] + t.rspec_opts = ['--colour', '--format progress'] end -Rake::GemPackageTask.new(spec) do |pkg| - pkg.gem_spec = spec -end - Rake::RDocTask.new("rdoc") do |rdoc| rdoc.options << '--line-numbers' << '--inline-source' end optionally do @@ -129,23 +102,18 @@ YARD::Rake::YardocTask.new do |t| t.files = ['lib/restfulie/**/*.rb', 'README.textile'] end end -desc "Install the gem locally" -task :install => [:package] do - sh %{gem install pkg/#{GEM}-#{GEM_VERSION} -l} -end - desc "Create a gemspec file" task :make_spec do File.open("#{GEM}.gemspec", "w") do |file| file.puts spec.to_ruby end end -desc "Builds the project" -task :build => ["install", "test:spec"] +desc "Runs everything" +task :all => ["install", "test:spec"] desc "Default build will run specs" -task :default => :build +task :default => :all