Skip to content

Commit

Permalink
Made the support files (gemspec, Gemfile, etc) look like goliath's)
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip (flip) Kromer committed Jun 23, 2012
1 parent 89aab31 commit 4280923
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 19 deletions.
11 changes: 11 additions & 0 deletions Gemfile
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,3 +2,14 @@ source 'https://rubygems.org'


# Specify your gem's dependencies in goliath-contrib.gemspec # Specify your gem's dependencies in goliath-contrib.gemspec
gemspec gemspec

gem 'goliath', :path => '../goliath'

# Gems for testing and coverage
group :test do
gem 'pry'
gem 'rspec'
gem 'guard'
gem 'guard-rspec'
gem 'guard-yard'
end
20 changes: 20 additions & 0 deletions Guardfile
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- ruby -*-

format = 'progress' # 'doc' for more verbose, 'progress' for less
tags = %w[ ]
guard 'rspec', :version => 2, :cli => "--format #{format} #{ tags.map{|tag| "--tag #{tag}"}.join(' ') }" do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch(%r{^examples/(.+)\.rb$}) { |m| "spec/integration/#{m[1]}_spec.rb" }

watch('spec/spec_helper.rb') { 'spec' }
watch(/spec\/support\/(.+)\.rb/) { 'spec' }
end

group :docs do
guard 'yard' do
watch(%r{app/.+\.rb})
watch(%r{lib/.+\.rb})
watch(%r{ext/.+\.c})
end
end
68 changes: 53 additions & 15 deletions goliath-contrib.gemspec
Original file line number Original file line Diff line number Diff line change
@@ -1,23 +1,61 @@
# -*- encoding: utf-8 -*- # -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
require 'goliath/contrib/version'


require File.expand_path('../lib/goliath/contrib', __FILE__) Gem::Specification.new do |s|
s.name = "goliath-contrib"
s.version = Goliath::Contrib::VERSION


# require './lib/goliath/contrib' s.authors = ["goliath-io"]
s.email = ["goliath-io@googlegroups.com"]


Gem::Specification.new do |gem| s.homepage = "https://github.com/postrank-labs/goliath-contrib"
gem.authors = ["goliath-io"] s.summary = "Contributed Goliath middleware, plugins, and utilities"
gem.email = ["goliath-io@googlegroups.com"] s.description = s.summary


gem.homepage = "https://github.com/postrank-labs/goliath-contrib" s.required_ruby_version = '>=1.9.2'
gem.description = "Contributed Goliath middleware, plugins, and utilities"
gem.summary = gem.description


gem.files = `git ls-files`.split($\) s.add_dependency 'goliath'
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.name = "goliath-contrib"
gem.require_paths = ["lib"]
gem.version = Goliath::Contrib::VERSION


gem.add_dependency 'goliath' s.add_development_dependency 'rspec', '>2.0'
s.add_development_dependency 'nokogiri'
s.add_development_dependency 'em-http-request', '>=1.0.0'
s.add_development_dependency 'em-mongo', '~> 0.4.0'
s.add_development_dependency 'rack-rewrite'
s.add_development_dependency 'multipart_body'
s.add_development_dependency 'amqp', '>=0.7.1'
s.add_development_dependency 'em-websocket-client'

s.add_development_dependency 'tilt', '>=1.2.2'
s.add_development_dependency 'haml', '>=3.0.25'
s.add_development_dependency 'yard'

s.add_development_dependency 'guard'
s.add_development_dependency 'guard-rspec'

if RUBY_PLATFORM != 'java'
s.add_development_dependency 'yajl-ruby'
s.add_development_dependency 'bluecloth'
s.add_development_dependency 'bson_ext'
else
s.add_development_dependency 'json-jruby'
s.add_development_dependency 'maruku'
end

if RUBY_PLATFORM.include?('darwin')
s.add_development_dependency 'growl', '~> 1.0.3'
s.add_development_dependency 'rb-fsevent'
end

ignores = File.readlines(".gitignore").grep(/\S+/).map {|i| i.chomp }
dotfiles = [".gemtest", ".gitignore", ".rspec", ".yardopts"]

# s.files = `git ls-files`.split($\)
# s.executables = s.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
# s.test_files = s.files.grep(%r{^(test|spec|features)/})
# s.require_paths = ["lib"]

s.files = Dir["**/*"].reject {|f| File.directory?(f) || ignores.any? {|i| File.fnmatch(i, f) } } + dotfiles
s.test_files = s.files.grep(/^spec\//)
s.require_paths = ['lib']
end end
6 changes: 2 additions & 4 deletions lib/goliath/contrib.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,11 +1,9 @@
require 'goliath/contrib'

# TODO: tries to start server :-) # TODO: tries to start server :-)
# require 'goliath' # require 'goliath'


module Goliath module Goliath
module Contrib
VERSION = "1.0.0.beta1"
end

# autoload :MiddlewareName, "goliath/contrib/middleware_name" # autoload :MiddlewareName, "goliath/contrib/middleware_name"
# ... # ...
end end
5 changes: 5 additions & 0 deletions lib/goliath/contrib/version.rb
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,5 @@
module Goliath
module Contrib
VERSION = "1.0.0.beta1"
end
end
6 changes: 6 additions & 0 deletions spec/goliath/contrib_spec.rb
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,6 @@

describe Goliath::Contrib do
it 'has a version' do
Goliath::Contrib::VERSION.should be_a(String)
end
end
14 changes: 14 additions & 0 deletions spec/spec_helper.rb
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,14 @@
require 'bundler'

Bundler.setup
Bundler.require

require 'goliath/test_helper'

Goliath.env = :test

RSpec.configure do |c|
c.include Goliath::TestHelper, :example_group => {
:file_path => /spec\/integration/
}
end

0 comments on commit 4280923

Please sign in to comment.