Permalink
Browse files

Preparing for gem packaging and publishing:

  • Loading branch information...
1 parent d207c53 commit 8f33b91ea9e14019de25c4fc4295073ef2aa7339 @brandonmwest brandonmwest committed May 31, 2011
Showing with 138 additions and 231 deletions.
  1. +3 −0 .rspec
  2. +1 −20 Gemfile
  3. +1 −1 LICENSE.txt → LICENSE.md
  4. +32 −0 README.md
  5. +0 −19 README.rdoc
  6. +20 −48 Rakefile
  7. +1 −1 VERSION
  8. +5 −5 lib/faraday/response/raise_http_4xx.rb
  9. +3 −3 lib/faraday/response/raise_http_5xx.rb
  10. +4 −4 lib/rainmaker.rb
  11. +1 −1 lib/rainmaker/client/person.rb
  12. +0 −1 lib/rainmaker/connection.rb
  13. +3 −0 lib/rainmaker/version.rb
  14. +33 −92 rainmaker.gemspec
  15. +12 −10 spec/faraday/response_spec.rb
  16. +4 −13 spec/helper.rb
  17. +3 −1 spec/rainmaker_spec.rb
  18. +7 −7 spec/ruby_rainmaker/api_spec.rb
  19. +3 −3 spec/ruby_rainmaker/client/person_spec.rb
  20. +2 −2 spec/ruby_rainmaker/client_spec.rb
  21. BIN vendor/cache/addressable-2.2.6.gem
  22. BIN vendor/cache/crack-0.1.8.gem
  23. BIN vendor/cache/diff-lcs-1.1.2.gem
  24. BIN vendor/cache/faraday-0.6.1.gem
  25. BIN vendor/cache/faraday_middleware-0.6.3.gem
  26. BIN vendor/cache/hashie-1.0.0.gem
  27. BIN vendor/cache/maruku-0.6.0.gem
  28. BIN vendor/cache/multi_json-1.0.3.gem
  29. BIN vendor/cache/multi_xml-0.2.2.gem
  30. BIN vendor/cache/multipart-post-1.1.2.gem
  31. BIN vendor/cache/nokogiri-1.4.4.1-x86-mingw32.gem
  32. BIN vendor/cache/rack-1.3.0.gem
  33. BIN vendor/cache/rake-0.9.0.gem
  34. BIN vendor/cache/rash-0.3.0.gem
  35. BIN vendor/cache/rspec-2.6.0.gem
  36. BIN vendor/cache/rspec-core-2.6.3.gem
  37. BIN vendor/cache/rspec-expectations-2.6.0.gem
  38. BIN vendor/cache/rspec-mocks-2.6.0.gem
  39. BIN vendor/cache/simplecov-0.4.2.gem
  40. BIN vendor/cache/simplecov-html-0.4.5.gem
  41. BIN vendor/cache/syntax-1.0.0.gem
  42. BIN vendor/cache/webmock-1.6.4.gem
  43. BIN vendor/cache/yard-0.7.1.gem
View
3 .rspec
@@ -0,0 +1,3 @@
+--color
+--format=nested
+--backtrace
View
21 Gemfile
@@ -1,22 +1,3 @@
source "http://rubygems.org"
-# Add dependencies required to use your gem here.
-# Example:
-# gem "activesupport", ">= 2.3.5"
-# Add dependencies to develop your gem here.
-# Include everything needed to run rake, tests, features, etc.
-group :development do
- gem "rake", "0.8.7"
- gem "shoulda", ">= 0"
- gem "bundler", "~> 1.0.0"
- gem "jeweler", "~> 1.6.0"
- gem "rcov", ">= 0"
- gem "rspec"
- gem "faraday"
- gem "faraday_middleware"
- gem "simplecov"
- gem "webmock"
- gem "multi_json"
- gem "hashie"
- gem "rash"
-end
+gemspec
@@ -1,4 +1,4 @@
-Copyright (c) 2011 Brandon M. West
+Copyright (c) 2010 John Nunemaker, Wynn Netherland, Erik Michaels-Ober, Steve Richert
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
View
@@ -0,0 +1,32 @@
+Rainmaker Ruby Gem
+====================
+A Ruby wrapper for the [Rainmaker API](http://api.rainmaker.cc)
+
+Installation
+------------
+ gem install rainmaker
+
+Documentation
+-------------
+[http://rdoc.info/gems/rainmaker](http://rdoc.info/gems/rainmaker)
+
+Usage Examples
+--------------
+ require "rubygems"
+ require "rainmaker"
+
+ # This could go in an initializer
+ Rainmaker.configure do |config|
+ config.api_key = "rainmaker_api_key_goes_here"
+ end
+
+ # Get information about an email address
+ person = Rainmaker.person("brawest@gmail.com")
+
+ # Get person's family_name
+ puts person.contact_info.family_name
+
+Copyright
+---------
+Copyright (c) 2010 Brandon West
+See [LICENSE](https://github.com/brandonmwest/twitter/blob/master/LICENSE.md) for details.
View
@@ -1,19 +0,0 @@
-= ruby-rainmaker
-
-Description goes here.
-
-== Contributing to ruby-rainmaker
-
-* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
-* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
-* Fork the project
-* Start a feature/bugfix branch
-* Commit and push until you are happy with your contribution
-* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
-* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
-
-== Copyright
-
-Copyright (c) 2011 Brandon M. West. See LICENSE.txt for
-further details.
-
View
@@ -1,53 +1,25 @@
-# encoding: utf-8
+#!/usr/bin/env rake
-require 'rubygems'
require 'bundler'
-begin
- Bundler.setup(:default, :development)
-rescue Bundler::BundlerError => e
- $stderr.puts e.message
- $stderr.puts "Run `bundle install` to install missing gems"
- exit e.status_code
-end
-require 'rake'
+Bundler::GemHelper.install_tasks
-require 'jeweler'
-Jeweler::Tasks.new do |gem|
- # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
- gem.name = "rainmaker"
- gem.homepage = "http://github.com/brandonmwest/rainmaker"
- gem.license = "MIT"
- gem.summary = %Q{Wrapper for the rainmaker API}
- gem.description = %Q{Wrapper for the rainmaker.cc API}
- gem.email = "brawest@gmail.com"
- gem.authors = ["Brandon M. West"]
- # dependencies defined in Gemfile
-end
-Jeweler::RubygemsDotOrgTasks.new
+require 'rspec/core/rake_task'
+RSpec::Core::RakeTask.new(:spec)
-require 'rake/testtask'
-Rake::TestTask.new(:test) do |test|
- test.libs << 'lib' << 'test'
- test.pattern = 'test/**/test_*.rb'
- test.verbose = true
-end
+task :test => :spec
+task :default => :spec
-require 'rcov/rcovtask'
-Rcov::RcovTask.new do |test|
- test.libs << 'test'
- test.pattern = 'test/**/test_*.rb'
- test.verbose = true
- test.rcov_opts << '--exclude "gems/*"'
-end
-
-task :default => :test
-
-require 'rake/rdoctask'
-Rake::RDocTask.new do |rdoc|
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
-
- rdoc.rdoc_dir = 'rdoc'
- rdoc.title = "rainmaker #{version}"
- rdoc.rdoc_files.include('README*')
- rdoc.rdoc_files.include('lib/**/*.rb')
-end
+namespace :doc do
+ require 'yard'
+ YARD::Rake::YardocTask.new do |task|
+ task.files = ['HISTORY.md', 'LICENSE.md', 'lib/**/*.rb']
+ task.options = [
+ '--protected',
+ '--output-dir', 'doc',
+ '--tag', 'format:Supported formats',
+ '--tag', 'authenticated:Requires Authentication',
+ '--tag', 'rate_limited:Rate Limited',
+ '--markup', 'markdown',
+ ]
+ end
+end
View
@@ -1 +1 @@
-0.1.0
+0.0.1
@@ -7,15 +7,15 @@ class Response::RaiseHttp4xx < Response::Middleware
def on_complete(env)
case env[:status].to_i
when 400
- raise RubyRainmaker::BadRequest.new(error_message(env), env[:response_headers])
+ raise Rainmaker::BadRequest.new(error_message(env), env[:response_headers])
when 401
- raise RubyRainmaker::Unauthorized.new(error_message(env), env[:response_headers])
+ raise Rainmaker::Unauthorized.new(error_message(env), env[:response_headers])
when 403
- raise RubyRainmaker::Forbidden.new(error_message(env), env[:response_headers])
+ raise Rainmaker::Forbidden.new(error_message(env), env[:response_headers])
when 404
- raise RubyRainmaker::NotFound.new(error_message(env), env[:response_headers])
+ raise Rainmaker::NotFound.new(error_message(env), env[:response_headers])
when 422
- raise RubyRainmaker::Invalid.new(error_message(env), env[:response_headers])
+ raise Rainmaker::Invalid.new(error_message(env), env[:response_headers])
end
@@ -7,11 +7,11 @@ class Response::RaiseHttp5xx < Response::Middleware
def on_complete(env)
case env[:status].to_i
when 500
- raise RubyRainmaker::InternalServerError.new(error_message(env, "Internal server error."), env[:response_headers])
+ raise Rainmaker::InternalServerError.new(error_message(env, "Internal server error."), env[:response_headers])
when 502
- raise RubyRainmaker::BadGateway.new(error_message(env, "Rainmaker is down or being upgraded."), env[:response_headers])
+ raise Rainmaker::BadGateway.new(error_message(env, "Rainmaker is down or being upgraded."), env[:response_headers])
when 503
- raise RubyRainmaker::ServiceUnavailable.new(error_message(env, "Service unavailable."), env[:response_headers])
+ raise Rainmaker::ServiceUnavailable.new(error_message(env, "Service unavailable."), env[:response_headers])
end
end
View
@@ -1,9 +1,9 @@
require "faraday"
require "faraday_middleware"
-require 'ruby_rainmaker/error'
-require 'ruby_rainmaker/configuration'
-require 'ruby_rainmaker/api'
-require 'ruby_rainmaker/client'
+require 'rainmaker/error'
+require 'rainmaker/configuration'
+require 'rainmaker/api'
+require 'rainmaker/client'
module Rainmaker
extend Configuration
@@ -5,7 +5,7 @@ module Person
#
def person(email)
response = get('person', :email => email)
- format.to_s.downcase == 'xml' ? response['user'] : response
+ format.to_s.downcase == 'xml' ? response['person'] : response
end
end
end
@@ -17,7 +17,6 @@ def connection(raw=false)
}
Faraday.new(options) do |builder|
- builder.adapter Faraday.default_adapter
builder.use Faraday::Request::Multipart
builder.use Faraday::Request::UrlEncoded
builder.use Faraday::Request::Gateway, gateway if gateway
View
@@ -0,0 +1,3 @@
+module Rainmaker
+ VERSION = "0.0.1"
+end
View
@@ -1,99 +1,40 @@
-# Generated by jeweler
-# DO NOT EDIT THIS FILE DIRECTLY
-# Instead, edit Jeweler::Tasks in rakefile, and run 'rake gemspec'
# -*- encoding: utf-8 -*-
+$:.push File.expand_path("../lib", __FILE__)
+require "rainmaker/version"
Gem::Specification.new do |s|
- s.name = %q{rainmaker}
- s.version = "0.1.0"
+ s.add_development_dependency 'maruku', '~> 0.6'
+ s.add_development_dependency 'nokogiri', '~> 1.4'
+ s.add_development_dependency 'rake', '~> 0.9'
+ s.add_development_dependency 'rspec', '~> 2.6'
+ s.add_development_dependency 'simplecov', '~> 0.4'
+ s.add_development_dependency 'webmock', '~> 1.6'
+ s.add_development_dependency 'yard', '~> 0.7'
+ s.add_runtime_dependency 'hashie', '~> 1.0.0'
+ s.add_runtime_dependency 'faraday', '~> 0.6.1'
+ s.add_runtime_dependency 'faraday_middleware', '~> 0.6.3'
+ s.add_runtime_dependency 'multi_json', '~> 1.0.0'
+ s.add_runtime_dependency 'multi_xml', '~> 0.2.0'
+ s.add_runtime_dependency 'rash', '~> 0.3.0'
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = ["Brandon M. West"]
- s.date = %q{2011-05-29}
- s.description = %q{Wrapper for the rainmaker.cc API}
- s.email = %q{brawest@gmail.com}
- s.extra_rdoc_files = [
- "LICENSE.txt",
- "README.rdoc"
- ]
- s.files = [
- ".document",
- "Gemfile",
- "LICENSE.txt",
- "README.rdoc",
- "Rakefile",
- "VERSION",
- "lib/faraday/request/gateway.rb",
- "lib/faraday/response/raise_http_4xx.rb",
- "lib/faraday/response/raise_http_5xx.rb",
- "lib/ruby-rainmaker.rb",
- "lib/ruby_rainmaker/api.rb",
- "lib/ruby_rainmaker/client.rb",
- "lib/ruby_rainmaker/client/person.rb",
- "lib/ruby_rainmaker/configuration.rb",
- "lib/ruby_rainmaker/connection.rb",
- "lib/ruby_rainmaker/error.rb",
- "lib/ruby_rainmaker/request.rb",
- "rainmaker.gemspec",
- "spec/fixtures/person.json",
- "spec/helper.rb",
- "spec/ruby_rainmaker/api_spec.rb",
- "spec/ruby_rainmaker/client/person_spec.rb",
- "spec/ruby_rainmaker/client_spec.rb",
- "spec/ruby_rainmaker_spec.rb"
- ]
- s.homepage = %q{http://github.com/brandonmwest/rainmaker}
- s.licenses = ["MIT"]
- s.require_paths = ["lib"]
- s.rubygems_version = %q{1.5.2}
- s.summary = %q{Wrapper for the rainmaker API}
+ s.author = "Brandon West"
+ s.description = %q{A Ruby wrapper for the Rainmaker API}
+ s.email = ['brawest@gmail.com']
- if s.respond_to? :specification_version then
- s.specification_version = 3
+ s.post_install_message = '
+-------------------------------------------------------------
+Follow me on Twitter! http://twitter.com/brandonmwest
+-------------------------------------------------------------
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
- s.add_development_dependency(%q<rake>, ["= 0.8.7"])
- s.add_development_dependency(%q<shoulda>, [">= 0"])
- s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
- s.add_development_dependency(%q<jeweler>, ["~> 1.6.0"])
- s.add_development_dependency(%q<rcov>, [">= 0"])
- s.add_development_dependency(%q<rspec>, [">= 0"])
- s.add_development_dependency(%q<faraday>, [">= 0"])
- s.add_development_dependency(%q<faraday_middleware>, [">= 0"])
- s.add_development_dependency(%q<simplecov>, [">= 0"])
- s.add_development_dependency(%q<webmock>, [">= 0"])
- s.add_development_dependency(%q<multi_json>, [">= 0"])
- s.add_development_dependency(%q<hashie>, [">= 0"])
- s.add_development_dependency(%q<rash>, [">= 0"])
- else
- s.add_dependency(%q<rake>, ["= 0.8.7"])
- s.add_dependency(%q<shoulda>, [">= 0"])
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
- s.add_dependency(%q<jeweler>, ["~> 1.6.0"])
- s.add_dependency(%q<rcov>, [">= 0"])
- s.add_dependency(%q<rspec>, [">= 0"])
- s.add_dependency(%q<faraday>, [">= 0"])
- s.add_dependency(%q<faraday_middleware>, [">= 0"])
- s.add_dependency(%q<simplecov>, [">= 0"])
- s.add_dependency(%q<webmock>, [">= 0"])
- s.add_dependency(%q<multi_json>, [">= 0"])
- s.add_dependency(%q<hashie>, [">= 0"])
- s.add_dependency(%q<rash>, [">= 0"])
- end
- else
- s.add_dependency(%q<rake>, ["= 0.8.7"])
- s.add_dependency(%q<shoulda>, [">= 0"])
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
- s.add_dependency(%q<jeweler>, ["~> 1.6.0"])
- s.add_dependency(%q<rcov>, [">= 0"])
- s.add_dependency(%q<rspec>, [">= 0"])
- s.add_dependency(%q<faraday>, [">= 0"])
- s.add_dependency(%q<faraday_middleware>, [">= 0"])
- s.add_dependency(%q<simplecov>, [">= 0"])
- s.add_dependency(%q<webmock>, [">= 0"])
- s.add_dependency(%q<multi_json>, [">= 0"])
- s.add_dependency(%q<hashie>, [">= 0"])
- s.add_dependency(%q<rash>, [">= 0"])
- end
-end
+'
+ s.executables = `git ls-files -- bin/*`.split("\n").map{|f| File.basename(f)}
+ s.files = `git ls-files`.split("\n")
+ s.homepage = 'https://github.com/brandonmwest/rainmaker'
+ s.name = 'rainmaker'
+ s.require_paths = ['lib']
+ s.required_rubygems_version = Gem::Requirement.new('>= 1.3.6')
+ s.summary = %q{Ruby wrapper for the Rainmaker API}
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
+ s.version = Rainmaker::VERSION
+end
Oops, something went wrong.

0 comments on commit 8f33b91

Please sign in to comment.