Skip to content

Commit

Permalink
Add initial content (skeleton from peter-murach/github).
Browse files Browse the repository at this point in the history
  • Loading branch information
doubleotoo committed Apr 20, 2012
0 parents commit 8a5105c
Show file tree
Hide file tree
Showing 17 changed files with 390 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
coverage
rdoc
doc
.yardoc
.bundle
pkg
*.swp
log
*.sqlite3
*.gem
33 changes: 33 additions & 0 deletions .rvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env bash

ruby_string="1.9.2-p318"
gemset_name="github-flow"

if rvm list strings | grep -q "${ruby_string}" ; then

# Load or create the specified environment
if [[ -d "${rvm_path:-$HOME/.rvm}/environments" \
&& -s "${rvm_path:-$HOME/.rvm}/environments/${ruby_string}@${gemset_name}" ]] ; then
\. "${rvm_path:-$HOME/.rvm}/environments/${ruby_string}@${gemset_name}"
else
rvm --create "${ruby_string}@${gemset_name}"
fi

PS1="(${gemset_name}) $PS1"

else

# Notify the user to install the desired interpreter before proceeding.
echo "${ruby_string} was not found, please run 'rvm install ${ruby_string}' and then cd back into the project directory."

fi

# Ensure that Bundler is installed. Install it if it is not.
if ! command -v bundle >/dev/null; then
printf "The rubygem 'bundler' is not installed. Installing it now.\n"
gem install bundler
fi

# Bundle while reducing excess noise.
printf "Bundling your gems. This may take a few minutes on a fresh clone.\n"
bundle | grep -v '^Using ' | grep -v ' is complete' | sed '/^$/d'
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
before_install:
- gem install bundler
rvm:
- 1.9.2
- 1.9.3
branches:
only: master
notifications:
email: false
Empty file added CHANGELOG.md
Empty file.
9 changes: 9 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
source "http://rubygems.org"

gemspec

group :development, :test do
gem 'rb-fsevent', :require => false if RUBY_PLATFORM =~ /darwin/i
gem 'growl', :require => false if RUBY_PLATFORM =~ /darwin/i
gem 'growl_notify', :require => false if RUBY_PLATFORM =~ /darwin/i
end
66 changes: 66 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
PATH
remote: .
specs:
github_flow (0.0.0)
github_api (~> 0.4)

GEM
remote: http://rubygems.org/
specs:
addressable (2.2.7)
builder (3.0.0)
cucumber (1.1.9)
builder (>= 2.1.2)
diff-lcs (>= 1.1.2)
gherkin (~> 2.9.0)
json (>= 1.4.6)
term-ansicolor (>= 1.0.6)
diff-lcs (1.1.3)
faraday (0.7.6)
addressable (~> 2.2)
multipart-post (~> 1.1)
rack (~> 1.1)
gherkin (2.9.0)
json (>= 1.4.6)
github_api (0.4.10)
faraday (~> 0.7.6)
hashie (~> 1.2.0)
multi_json (~> 1.0)
oauth2 (~> 0.5.2)
growl (1.0.3)
growl_notify (0.0.3)
rb-appscript
guard (0.8.8)
thor (~> 0.14.6)
guard-cucumber (0.7.4)
cucumber (>= 0.10)
guard (>= 0.8.3)
guard-rspec (0.5.7)
guard (>= 0.8.4)
hashie (1.2.0)
json (1.6.5)
multi_json (1.3.2)
multipart-post (1.1.5)
oauth2 (0.5.2)
faraday (~> 0.7)
multi_json (~> 1.0)
rack (1.4.1)
rake (0.9.2.2)
rb-appscript (0.6.1)
rb-fsevent (0.9.0)
term-ansicolor (1.0.7)
thor (0.14.6)

PLATFORMS
ruby

DEPENDENCIES
bundler
github_flow!
growl
growl_notify
guard (~> 0.8.8)
guard-cucumber (= 0.7.4)
guard-rspec (= 0.5.7)
rake
rb-fsevent
20 changes: 20 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright (c) 2012 Justin Too

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.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# GithubFlow
[![Build Status](https://secure.travis-ci.org/doubleotoo/github.png?branch=master)][travis] [![Dependency Status](https://gemnasium.com/doubleotoo/github.png?travis)][gemnasium]

[travis]: http://travis-ci.org/doubleotoo/github-flow
[gemnasium]: https://gemnasium.com/doubleotoo/github-flow

[Wiki](https://github.com/doubleotoo/github-flow/wiki) | [RDocs](http://rubydoc.info/github/doubleotoo/github-flow/master/frames)

A Ruby wrapper to automate a GitHub workflow (using the GitHub REST API v3).


## Installation

Install the gem by issuing

```ruby
gem install github_flow
```

or put it in your Gemfile and run `bundle install`</tt>

```ruby
gem "github_flow"
```

## Usage

TODO

13 changes: 13 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# encoding: utf-8

require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
require 'cucumber/rake/task'

RSpec::Core::RakeTask.new(:spec) do |spec|
spec.pattern = FileList['spec/**/*_spec.rb']
end

Cucumber::Rake::Task.new(:features)

task :default => [:spec, :features]
24 changes: 24 additions & 0 deletions github_flow.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
require File.expand_path('../lib/github_flow/version', __FILE__)

Gem::Specification.new do |gem|
gem.name = 'github_flow'
gem.authors = [ 'Justin Too' ]
gem.email = 'doubleotoo@gmail.com'
gem.homepage = 'https://github.com/doubleotoo/github-flow'
gem.summary = %q{ Ruby wrapper to automate a GitHub workflow (using the GitHub API v3)}
gem.description = %q{ need to add description }
gem.version = GithubFlow::VERSION::STRING.dup

gem.files = Dir['Rakefile', '{lib/scripts}/**/*', 'README*', 'LICENSE*']
gem.require_paths = %w[ lib ]

gem.add_dependency 'github_api', '~> 0.4'

gem.add_development_dependency 'guard', '~> 0.8.8'
gem.add_development_dependency 'guard-rspec', '0.5.7'
gem.add_development_dependency 'guard-cucumber', '0.7.4'
gem.add_development_dependency 'rake'
gem.add_development_dependency 'bundler'
end
61 changes: 61 additions & 0 deletions lib/github_flow.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# encoding: utf-8

require 'github_flow/version'
require 'github_flow/configuration'
require 'github_flow/constants'
require 'github_flow/deprecation'

module GithubFlow
extend Configuration

class << self

# Handle for the client instance
attr_accessor :api_client

# Alias for Github::Client.new
#
# @return [Github::Client]
def new(options = {}, &block)
@api_client = Github::Client.new(options, &block)
end

# Delegate to Github::Client
#
def method_missing(method, *args, &block)
return super unless new.respond_to?(method)
new.send(method, *args, &block)
end

def respond_to?(method, include_private = false)
new.respond_to?(method, include_private) || super(method, include_private)
end

end

module AutoloadHelper

def autoload_all(prefix, options)
options.each do |const_name, path|
autoload const_name, File.join(prefix, path)
end
end

def register_constant(options)
options.each do |const_name, value|
const_set const_name.upcase.to_s, value
end
end

def lookup_constant(const_name)
const_get const_name.upcase.to_s
end

end

extend AutoloadHelper

autoload_all 'github_flow',
:API => 'api',

end # GithubFlow
23 changes: 23 additions & 0 deletions lib/github_flow/compatibility.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# coding: utf-8

if RUBY_VERSION < "1.9"

def ruby_18 #:nodoc:
yield
end

def ruby_19 #:nodoc:
false
end

else

def ruby_18 #:nodoc:
false
end

def ruby_19 #:nodoc:
yield
end

end
31 changes: 31 additions & 0 deletions lib/github_flow/configuration.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# encoding: utf-8

module GithubFlow
module Configuration

VALID_OPTIONS_KEYS = [
].freeze

attr_accessor *VALID_OPTIONS_KEYS

# Convenience method to allow for global setting of configuration options
def configure
yield self
end

def self.extended(base)
base.set_defaults
end

def options
options = {}
VALID_OPTIONS_KEYS.each { |k| options[k] = send(k) }
options
end

def set_defaults
self
end

end # Configuration
end # GithubFlow
6 changes: 6 additions & 0 deletions lib/github_flow/constants.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module GithubFlow
module Constants
extend self

end # Constants
end # GithubFlow
39 changes: 39 additions & 0 deletions lib/github_flow/deprecation.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# encoding: utf-8

module GithubFlow

DEPRECATION_PREFIX = "[GithubFlow] Deprecation warning:"

class << self

attr_writer :deprecation_tracker

def deprecation_tracker
@deprecation_tracker ||= []
end

# Displays deprecation message to the user.
# Each message is printed once.
def deprecate(method, alternate_method=nil)
return if deprecation_tracker.include? method
deprecation_tracker << method

message = <<-NOTICE
#{DEPRECATION_PREFIX}
* #{method} is deprecated.
NOTICE
if alternate_method
message << <<-ADDITIONAL
* please use #{alternate_method} instead.
ADDITIONAL
end
warn_deprecation(message)
end

def warn_deprecation(message)
send :warn, message
end
end

end # Github
12 changes: 12 additions & 0 deletions lib/github_flow/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# encoding: utf-8

module GithubFlow
module VERSION
MAJOR = 0
MINOR = 0
PATCH = 0
BUILD = nil

STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.');
end
end
Loading

0 comments on commit 8a5105c

Please sign in to comment.