From 9798331d4275e82cd377d4323b8a4a8f422c6d93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ku=C5=BAma?= Date: Sat, 4 Sep 2010 00:58:52 +0200 Subject: [PATCH] using bundler now --- .gitignore | 1 + Gemfile | 4 ++++ Gemfile.lock | 27 +++++++++++++++++++++++++++ Rakefile | 27 ++------------------------- lib/s3/version.rb | 2 +- s3.gemspec | 28 ++++++++++++++-------------- test/object_test.rb | 4 ++-- test/test_helper.rb | 11 +++++------ 8 files changed, 56 insertions(+), 48 deletions(-) create mode 100644 Gemfile create mode 100644 Gemfile.lock diff --git a/.gitignore b/.gitignore index 76f8e2a..fb21928 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ coverage rdoc pkg *.gem +.bundle diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..d647029 --- /dev/null +++ b/Gemfile @@ -0,0 +1,4 @@ +source :gemcutter + +# Specify your gem's dependencies in s3.gemspec +gemspec diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..f9188b6 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,27 @@ +PATH + remote: . + specs: + s3 (0.3.1) + proxies + trollop + +GEM + remote: http://rubygems.org/ + specs: + mocha (0.9.8) + rake + proxies (0.1.1) + rake (0.8.7) + test-unit (2.1.1) + trollop (1.16.2) + +PLATFORMS + ruby + +DEPENDENCIES + bundler (>= 1.0.0) + mocha + proxies + s3! + test-unit (>= 2.0) + trollop diff --git a/Rakefile b/Rakefile index f89e780..d8ed260 100644 --- a/Rakefile +++ b/Rakefile @@ -1,16 +1,8 @@ -$:.unshift File.expand_path("../lib", __FILE__) +require "bundler" +Bundler::GemHelper.install_tasks -require "rubygems" -require "rubygems/specification" require "rake/testtask" require "rake/rdoctask" -require "rake/gempackagetask" -require "s3" - -def gemspec - file = File.expand_path('../s3.gemspec', __FILE__) - eval(File.read(file), binding, file) -end Rake::TestTask.new(:test) do |test| test.libs << "lib" << "test" @@ -25,19 +17,4 @@ Rake::RDocTask.new do |rdoc| rdoc.rdoc_files.include("lib/**/*.rb") end -Rake::GemPackageTask.new(gemspec) do |pkg| - pkg.gem_spec = gemspec -end - -desc "Install the gem locally" -task :install => :package do - sh %{gem install pkg/#{gemspec.name}-#{gemspec.version}} -end - -desc "Validate the gemspec" -task :gemspec do - gemspec.validate -end - -task :gem => :gemspec task :default => :test diff --git a/lib/s3/version.rb b/lib/s3/version.rb index 24d3654..87378ca 100644 --- a/lib/s3/version.rb +++ b/lib/s3/version.rb @@ -1,3 +1,3 @@ module S3 - VERSION = "0.3.0" + VERSION = "0.3.1" end diff --git a/s3.gemspec b/s3.gemspec index 5bd0a1a..f764d51 100644 --- a/s3.gemspec +++ b/s3.gemspec @@ -1,27 +1,27 @@ -# -*- coding: utf-8 -*- +# -*- encoding: utf-8 -*- -lib = File.expand_path("../lib/", __FILE__) -$:.unshift lib unless $:.include?(lib) - -require "s3/version" +require File.expand_path("../lib/s3/version", __FILE__) Gem::Specification.new do |s| - s.name = "s3" - s.version = S3::VERSION - s.platform = Gem::Platform::RUBY - s.authors = ["Jakub Kuźma"] - s.email = "qoobaa@gmail.com" - s.homepage = "http://jah.pl/projects/s3.html" - s.summary = "Library for accessing S3 objects and buckets, with command line tool" + s.name = "s3" + s.version = S3::VERSION + s.platform = Gem::Platform::RUBY + s.authors = ["Jakub Kuźma"] + s.email = ["qoobaa@gmail.com"] + s.homepage = "http://jah.pl/projects/s3.html" + s.summary = "Library for accessing S3 objects and buckets, with command line tool" s.description = "S3 library provides access to Amazon's Simple Storage Service. It supports both: European and US buckets through REST API." s.required_rubygems_version = ">= 1.3.6" + s.rubyforge_project = "s3" s.add_dependency "trollop" s.add_dependency "proxies" s.add_development_dependency "test-unit", ">= 2.0" s.add_development_dependency "mocha" + s.add_development_dependency "bundler", ">= 1.0.0" - s.files = Dir.glob("{bin,extra,lib}/**/*") + %w(LICENSE README.rdoc) - s.executables = ["s3"] + s.files = `git ls-files`.split("\n") + s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact + s.require_path = "lib" end diff --git a/test/object_test.rb b/test/object_test.rb index 59f3af8..50a2456 100644 --- a/test/object_test.rb +++ b/test/object_test.rb @@ -23,7 +23,7 @@ def setup @xml_body = <<-EOXML - timestamp "etag" + #{Time.now.httpdate} "etag" EOXML @response_xml = Net::HTTPOK.new("1.1", "200", "OK") @response_xml.stubs(:body).returns(@xml_body) @@ -40,7 +40,7 @@ def setup S3::Object.send(:new, nil, :key => "/images/pictures/test images/Lena not full.png") end end - + test "==" do expected = false actual = @object_lena == nil diff --git a/test/test_helper.rb b/test/test_helper.rb index 3c94237..b4a9f3e 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,8 +1,7 @@ -require "rubygems" -gem "test-unit" +require "bundler" + +Bundler.setup +Bundler.require + require "test/unit" require "mocha" - -$LOAD_PATH.unshift(File.dirname(__FILE__)) -$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib")) -require "s3"