Navigation Menu

Skip to content

Commit

Permalink
Merge branch 'master' into sinatra
Browse files Browse the repository at this point in the history
Conflicts:
	.gitignore
	Gemfile
	Gemfile.lock
	Rakefile
	lib/gem_template.rb
  • Loading branch information
winton committed Oct 8, 2011
2 parents d9cb7f5 + 5e2dd99 commit 1b6cb3b
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 89 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,3 +1,4 @@
.bundle
.DS_Store
*.gem
*.log
Expand Down
10 changes: 1 addition & 9 deletions Gemfile
@@ -1,11 +1,3 @@
source "http://rubygems.org"

gem 'rake', '>=0.8.7', :group => :rakefile
gem 'rspec', '~>1.0', :group => [ :rakefile, :spec ]

gem 'rack-test', '=0.6.1', :group => :spec

gem 'haml', '=3.1.2'
gem 'lilypad', '=0.3.1'
gem 'redis', '=2.2.2'
gem 'sinatra', '=1.2.6'
gemspec
19 changes: 12 additions & 7 deletions Gemfile.lock
@@ -1,3 +1,13 @@
PATH
remote: .
specs:
gem_template (0.1.0)
bundler
haml (= 3.1.2)
lilypad (= 0.3.1)
redis (= 2.2.2)
sinatra (= 1.2.6)

GEM
remote: http://rubygems.org/
specs:
Expand All @@ -9,23 +19,18 @@ GEM
rack (1.3.3)
rack-test (0.6.1)
rack (>= 1.0)
rake (0.9.2)
redis (2.2.2)
require (0.2.6)
rspec (1.3.2)
sinatra (1.2.6)
rack (~> 1.1)
tilt (>= 1.2.2, < 2.0)
tilt (< 2.0, >= 1.2.2)
tilt (1.3.3)

PLATFORMS
ruby

DEPENDENCIES
haml (= 3.1.2)
lilypad (= 0.3.1)
gem_template!
rack-test (= 0.6.1)
rake (>= 0.8.7)
redis (= 2.2.2)
rspec (~> 1.0)
sinatra (= 1.2.6)
69 changes: 1 addition & 68 deletions Rakefile
@@ -1,71 +1,4 @@
require 'rubygems'
require 'bundler'

Bundler.require(:rakefile)

require 'rake'

begin
require 'spec/rake/spectask'
rescue Exception => e
end

def gemspec
@gemspec ||= begin
file = File.expand_path('../gem_template.gemspec', __FILE__)
eval(File.read(file), binding, file)
end
end

if defined?(ActiveWrapper::Tasks)
ActiveWrapper::Tasks.new(
:base => File.dirname(__FILE__),
:env => ENV['ENV']
)
end

if defined?(Spec::Rake::SpecTask)
desc "Run specs"
Spec::Rake::SpecTask.new do |t|
t.spec_files = FileList['spec/**/*_spec.rb']
t.spec_opts = %w(-fs --color)
t.warning = true
end
task :spec
task :default => :spec
end

desc "Build gem(s)"
task :gem do
root = File.expand_path('../', __FILE__)
pkg = "#{root}/pkg"
system "rm -Rf #{pkg}"
system "cd #{root} && gem build gem_template.gemspec"
system "mkdir -p #{pkg} && mv *.gem pkg"
end

namespace :gem do
desc "Install gem(s)"
task :install do
Rake::Task['gem'].invoke
Dir["#{File.dirname(__FILE__)}/pkg/*.gem"].each do |pkg|
system "gem install #{pkg} --no-ri --no-rdoc"
end
end

desc "Push gem(s)"
task :push do
Rake::Task['gem'].invoke
Dir["#{File.dirname(__FILE__)}/pkg/*.gem"].each do |pkg|
system "gem push #{pkg}"
end
end
end

desc "Validate the gemspec"
task :gemspec do
gemspec.validate
end
require 'bundler/gem_tasks'

# DELETE AFTER USING
desc "Rename project"
Expand Down
9 changes: 9 additions & 0 deletions gem_template.gemspec
Expand Up @@ -18,4 +18,13 @@ Gem::Specification.new do |s|
s.files = `cd #{root} && git ls-files`.split("\n")
s.require_paths = %w(lib)
s.test_files = `cd #{root} && git ls-files -- {features,test,spec}/*`.split("\n")

s.add_development_dependency "rack-test", "= 0.6.1"
s.add_development_dependency "rspec", "~> 1.0"

s.add_dependency "bundler"
s.add_dependency "haml", "= 3.1.2"
s.add_dependency "lilypad", "= 0.3.1"
s.add_dependency "redis", "= 2.2.2"
s.add_dependency "sinatra", "= 1.2.6"
end
8 changes: 5 additions & 3 deletions lib/application/log.rb
@@ -1,6 +1,8 @@
Application.class_eval do

log = File.new("#{root}/log/#{environment}.log", "a")
STDOUT.reopen(log)
STDERR.reopen(log)
unless File.basename($0) == 'spec'
log = File.new("#{root}/log/#{environment}.log", "a")
STDOUT.reopen(log)
STDERR.reopen(log)
end
end
2 changes: 1 addition & 1 deletion spec/gem_template_spec.rb
@@ -1,4 +1,4 @@
require 'spec_helper'

describe GemTemplate do
describe Application do
end
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
@@ -1,7 +1,7 @@
require "pp"
require "bundler"

Bundler.require(:spec)
Bundler.require(:development)

$root = File.expand_path('../../', __FILE__)

Expand Down

0 comments on commit 1b6cb3b

Please sign in to comment.