From c7a14090e27d84f0c7d804a99a72e695854d6d5f Mon Sep 17 00:00:00 2001 From: Martyn Loughran Date: Fri, 29 Oct 2010 14:08:58 +0100 Subject: [PATCH] Use bundler rake tasks --- Gemfile | 3 ++ Gemfile.lock | 19 ++++++++++++ README.md | 6 ++++ Rakefile | 48 ++--------------------------- lib/signature/version.rb | 3 ++ signature.gemspec | 65 ++++++++++------------------------------ 6 files changed, 48 insertions(+), 96 deletions(-) create mode 100644 Gemfile create mode 100644 Gemfile.lock create mode 100644 lib/signature/version.rb diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..a1b93f3 --- /dev/null +++ b/Gemfile @@ -0,0 +1,3 @@ +source :rubygems + +gemspec diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..1652637 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,19 @@ +PATH + remote: . + specs: + signature (0.1.1) + ruby-hmac + +GEM + remote: http://rubygems.org/ + specs: + rspec (1.2.9) + ruby-hmac (0.4.0) + +PLATFORMS + ruby + +DEPENDENCIES + rspec (~> 1.2.9) + ruby-hmac + signature! diff --git a/README.md b/README.md index 19d4dbc..e581ac4 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,12 @@ Server example (sinatra) # Do whatever you need to do end +Developing +---------- + + bundle + bundle exec spec spec/*_spec.rb + Copyright --------- diff --git a/Rakefile b/Rakefile index e044f40..14cfe0b 100644 --- a/Rakefile +++ b/Rakefile @@ -1,46 +1,2 @@ -require 'rubygems' -require 'rake' - -begin - require 'jeweler' - Jeweler::Tasks.new do |gem| - gem.name = "signature" - gem.summary = %Q{Simple key/secret based authentication for apis} - gem.description = %Q{Simple key/secret based authentication for apis} - gem.email = "me@mloughran.com" - gem.homepage = "http://github.com/mloughran/signature" - gem.authors = ["Martyn Loughran"] - gem.add_dependency "ruby-hmac" - gem.add_development_dependency "rspec", ">= 1.2.9" - # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings - end - Jeweler::GemcutterTasks.new -rescue LoadError - puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler" -end - -require 'spec/rake/spectask' -Spec::Rake::SpecTask.new(:spec) do |spec| - spec.libs << 'lib' << 'spec' - spec.spec_files = FileList['spec/**/*_spec.rb'] -end - -Spec::Rake::SpecTask.new(:rcov) do |spec| - spec.libs << 'lib' << 'spec' - spec.pattern = 'spec/**/*_spec.rb' - spec.rcov = true -end - -task :spec => :check_dependencies - -task :default => :spec - -require 'rake/rdoctask' -Rake::RDocTask.new do |rdoc| - version = File.exist?('VERSION') ? File.read('VERSION') : "" - - rdoc.rdoc_dir = 'rdoc' - rdoc.title = "signature #{version}" - rdoc.rdoc_files.include('README*') - rdoc.rdoc_files.include('lib/**/*.rb') -end +require 'bundler' +Bundler::GemHelper.install_tasks diff --git a/lib/signature/version.rb b/lib/signature/version.rb new file mode 100644 index 0000000..0153295 --- /dev/null +++ b/lib/signature/version.rb @@ -0,0 +1,3 @@ +module Signature + VERSION = "0.1.1" +end diff --git a/signature.gemspec b/signature.gemspec index c70de53..95210b2 100644 --- a/signature.gemspec +++ b/signature.gemspec @@ -1,57 +1,22 @@ -# Generated by jeweler -# DO NOT EDIT THIS FILE DIRECTLY -# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command # -*- encoding: utf-8 -*- +$:.push File.expand_path("../lib", __FILE__) +require "signature/version" Gem::Specification.new do |s| - s.name = %q{signature} - s.version = "0.1.1" - - s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= - s.authors = ["Martyn Loughran"] - s.date = %q{2010-07-20} + s.name = "signature" + s.version = Signature::VERSION + s.platform = Gem::Platform::RUBY + s.authors = ["Martyn Loughran"] + s.email = ["me@mloughran.com"] + s.homepage = "http://github.com/mloughran/signature" + s.summary = %q{Simple key/secret based authentication for apis} s.description = %q{Simple key/secret based authentication for apis} - s.email = %q{me@mloughran.com} - s.extra_rdoc_files = [ - "LICENSE", - "README.md" - ] - s.files = [ - ".document", - ".gitignore", - "LICENSE", - "README.md", - "Rakefile", - "VERSION", - "lib/signature.rb", - "spec/signature_spec.rb", - "spec/spec.opts", - "spec/spec_helper.rb" - ] - s.homepage = %q{http://github.com/mloughran/signature} - s.rdoc_options = ["--charset=UTF-8"] - s.require_paths = ["lib"] - s.rubygems_version = %q{1.3.6} - s.summary = %q{Simple key/secret based authentication for apis} - s.test_files = [ - "spec/signature_spec.rb", - "spec/spec_helper.rb" - ] - if s.respond_to? :specification_version then - current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION - s.specification_version = 3 + s.files = `git ls-files`.split("\n") + s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") + s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } + s.require_paths = ["lib"] - if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then - s.add_runtime_dependency(%q, [">= 0"]) - s.add_development_dependency(%q, [">= 1.2.9"]) - else - s.add_dependency(%q, [">= 0"]) - s.add_dependency(%q, [">= 1.2.9"]) - end - else - s.add_dependency(%q, [">= 0"]) - s.add_dependency(%q, [">= 1.2.9"]) - end + s.add_dependency "ruby-hmac" + s.add_development_dependency "rspec", "~> 1.2.9" end -