Permalink
Browse files

Merge branch 'integration' into production

  • Loading branch information...
2 parents fb286ee + 63b8b8b commit f22edda73adb0044ae1191345d7052b5f1b723ac @farnoy committed Dec 22, 2010
View
@@ -0,0 +1 @@
+--color
View
@@ -1,6 +1,17 @@
-source :rubygems
+source "http://rubygems.org"
-gem 'sqlite3-ruby'
-gem 'activerecord'
-gem 'rainbow'
-gem 'progressbar'
+gem "rainbow"
+gem "activerecord", ">= 3.0.3"
+gem "activesupport", ">= 3.0.3"
+gem "sqlite3-ruby"
+
+group :development do
+ gem "github-api-client", :path => "./"
+ gem "rspec", ">= 2.3.0"
+ gem "mocha"
+ gem "yard", ">= 0.6.0"
+ gem "cucumber"
+ gem "bundler", ">= 1.0.0"
+ gem "jeweler", ">= 1.5.2"
+ gem "rcov"
+end
View
@@ -1,3 +1,15 @@
+PATH
+ remote: ./
+ specs:
+ github-api-client (0.2.0)
+ activerecord (>= 3.0.3)
+ activerecord (>= 3.0.3)
+ activesupport (>= 3.0.3)
+ rainbow
+ rainbow (>= 1.1)
+ sqlite3-ruby (>= 1.3.2)
+ sqlite3-ruby
+
GEM
remote: http://rubygems.org/
specs:
@@ -13,17 +25,54 @@ GEM
activesupport (3.0.3)
arel (2.0.6)
builder (2.1.2)
+ cucumber (0.10.0)
+ builder (>= 2.1.2)
+ diff-lcs (~> 1.1.2)
+ gherkin (~> 2.3.2)
+ json (~> 1.4.6)
+ term-ansicolor (~> 1.0.5)
+ diff-lcs (1.1.2)
+ gherkin (2.3.2)
+ json (~> 1.4.6)
+ term-ansicolor (~> 1.0.5)
+ git (1.2.5)
i18n (0.5.0)
- progressbar (0.9.0)
+ jeweler (1.5.2)
+ bundler (~> 1.0.0)
+ git (>= 1.2.5)
+ rake
+ json (1.4.6)
+ mocha (0.9.10)
+ rake
rainbow (1.1)
+ rake (0.8.7)
+ rcov (0.9.9)
+ rspec (2.3.0)
+ rspec-core (~> 2.3.0)
+ rspec-expectations (~> 2.3.0)
+ rspec-mocks (~> 2.3.0)
+ rspec-core (2.3.1)
+ rspec-expectations (2.3.0)
+ diff-lcs (~> 1.1.2)
+ rspec-mocks (2.3.0)
sqlite3-ruby (1.3.2)
+ term-ansicolor (1.0.5)
tzinfo (0.3.23)
+ yard (0.6.4)
PLATFORMS
ruby
DEPENDENCIES
- activerecord
- progressbar
+ activerecord (>= 3.0.3)
+ activesupport (>= 3.0.3)
+ bundler (>= 1.0.0)
+ cucumber
+ github-api-client!
+ jeweler (>= 1.5.2)
+ mocha
rainbow
+ rcov
+ rspec (>= 2.3.0)
sqlite3-ruby
+ yard (>= 0.6.0)
View
@@ -0,0 +1,20 @@
+Copyright (c) 2010 Jakub Okoński
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
@@ -0,0 +1,19 @@
+= github-api-client
+
+Description goes here.
+
+== Contributing to github-api-client
+
+* 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) 2010 Jakub Okoński. See LICENSE.txt for
+further details.
+
View
@@ -0,0 +1,53 @@
+# encoding: utf-8
+
+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'
+
+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 = "github-api-client"
+ gem.homepage = "http://github.com/farnoy/github-api-client"
+ gem.license = "MIT"
+ gem.summary = %Q{Library for easy GitHub API browsing}
+ gem.description = %Q{Caches retrieved information to your user profile and reuses it when you query again.}
+ gem.email = "kuba@okonski.org"
+ gem.authors = ["Jakub Okoński"]
+ gem.add_runtime_dependency('rainbow', '>=1.1')
+ gem.add_runtime_dependency('activerecord', '>=3.0.3')
+ gem.add_runtime_dependency('sqlite3-ruby', '>=1.3.2')
+
+ gem.add_development_dependency 'yard', '>= 0.6.0'
+ gem.add_development_dependency 'rspec', '>= 2.3.0'
+ gem.add_development_dependency 'cucumber'
+ gem.add_development_dependency 'bundler', '>= 1.0.0'
+ gem.add_development_dependency 'jeweler', '>= 1.5.2'
+end
+Jeweler::RubygemsDotOrgTasks.new
+
+require 'rspec/core'
+require 'rspec/core/rake_task'
+RSpec::Core::RakeTask.new(:spec) do |spec|
+ spec.pattern = FileList['spec/**/*_spec.rb']
+end
+
+RSpec::Core::RakeTask.new(:rcov) do |spec|
+ spec.pattern = 'spec/**/*_spec.rb'
+ spec.rcov = true
+end
+
+require 'cucumber/rake/task'
+Cucumber::Rake::Task.new(:features)
+
+task :default => :spec
+
+require 'yard'
+YARD::Rake::YardocTask.new
View
@@ -0,0 +1 @@
+0.2.1
@@ -1,7 +1,7 @@
#!/usr/bin/env ruby
-$LOAD_PATH << './lib/' << './lib/github_api/'
+$:.unshift('./lib/')
-require 'github_api'
+require 'github-api-client'
GitHub::Config::Options[:verbose] = true if ARGV.include? '--verbose'
@@ -0,0 +1,13 @@
+Feature: Fetching Objects
+ In order to fetch objects from GitHub
+ I just need to fire up few commands
+
+ Scenario: Fetching user information
+ Given I fetch user "schacon"
+ Then My local database should contain that record
+ And That record's "name" should be "Scott Chacon"
+
+ Scenario: Fetching repo information
+ Given I fetch repo "mojombo/jekyll"
+ Then My local database should contain that record
+ And That record's "login" of the "owner" should be "mojombo"
@@ -0,0 +1,29 @@
+Before do
+ %w(Repo User).each do |attr|
+ GitHub.const_get(attr).delete_all
+ end
+end
+
+Given /^I fetch user "(.*)"$/ do |login|
+ @record = GitHub::User.get(login)
+end
+
+Given /^I fetch repo "(.*)"$/ do |permalink|
+ @record = GitHub::Repo.get(permalink)
+end
+
+Then /^My local database should contain that record$/ do
+ @record.class.find(@record.id).should == @record
+end
+
+Then /^That record's "([^"]*)" should be "([^"]*)"$/ do |sig, prop|
+ @record.send(sig.to_sym).should == prop
+end
+
+Then /^That record's "([^"]*)" of the "([^"]*)" should be "([^"]*)"$/ do |sig, type, prop|
+ @record.send(type.to_sym).send(sig.to_sym).should == prop
+end
+
+Given /^I set verbose option to "(.*)"$/ do |bool|
+ GitHub::Config::Options[:verbose] = bool
+end
@@ -0,0 +1,31 @@
+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
+
+$LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../lib')
+require 'github-api-client'
+
+require 'rspec/expectations'
+require 'stringio'
+require "mocha"
+
+# Mocha integration into Cucumber
+# source: https://gist.github.com/80554
+World(Mocha::API)
+
+Before do
+ mocha_setup
+end
+
+After do
+ begin
+ mocha_verify
+ ensure
+ mocha_teardown
+ end
+end
File renamed without changes.
Oops, something went wrong.

0 comments on commit f22edda

Please sign in to comment.