Skip to content

Commit

Permalink
Update to use bundler
Browse files Browse the repository at this point in the history
Updates for changes in tilt
  • Loading branch information
Daniel Neighman committed Apr 22, 2010
1 parent f0509e4 commit 1ca481f
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 38 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ TAGS
pkg
.yardoc
doc
*.gem
*.gem
.bundle
17 changes: 17 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
source :rubygems

gem 'usher'
gem 'rack', '~> 1.1'
gem 'rack-test'
gem 'hashie'
gem 'extlib'
gem 'tilt', '~> 0.9'
gem 'rack-accept-media-types'

gem 'rake', :require => false

group(:test) do
gem 'rspec'
gem 'haml'
gem 'erubis'
end
33 changes: 1 addition & 32 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,35 +1,7 @@
require 'rubygems'
require 'rake'

begin
require 'jeweler'
Jeweler::Tasks.new do |gem|
gem.name = "pancake"
gem.summary = %Q{Eat Pancake Stacks for Breakfast}
gem.description = %Q{Eat Pancake Stacks for Breakfast}
gem.email = "[email protected]"
gem.homepage = "http://github.com/hassox/pancake"
gem.authors = ["Daniel Neighman"]
gem.add_development_dependency "rspec"
gem.add_dependency "usher", ">=0.6.4"
gem.add_development_dependency "extlib"
gem.add_development_dependency "thor"
gem.add_dependency "rack"
gem.add_dependency "tilt", ">=0.3"
gem.add_dependency "hashie", ">=0.1.4"
gem.add_dependency "rack-accept-media-types"
gem.require_path = 'lib'
gem.autorequire = 'pancake'
gem.bindir = "bin"
gem.executables = %w( pancake-gen )
gem.files = %w(LICENSE README.textile Rakefile TODO) + Dir.glob("{lib,spec,bin}/**/{*,.[a-z]*}")
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
end
rescue LoadError
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
end

require 'spec/rake/spectask'

Spec::Rake::SpecTask.new(:spec) do |spec|
spec.libs << 'lib' << 'spec'
spec.spec_opts = %w(--format progress --color)
Expand All @@ -41,9 +13,6 @@ Spec::Rake::SpecTask.new(:rcov) do |spec|
spec.pattern = 'spec/**/*_spec.rb'
spec.rcov = true
end

task :spec => :check_dependencies

task :default => :spec

require 'rake/rdoctask'
Expand Down
8 changes: 4 additions & 4 deletions lib/pancake/mixins/render/render.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ def _haml_capture(block)
end

def _erb_capture(block)
_out_buf, @_out_buf = @_out_buf, ""
_out_buf, @_erbout = @_erbout, ""
block.call
ret = @_out_buf
@_out_buf = _out_buf
ret = @_erbout
@_erbout = _out_buf
ret
end

Expand All @@ -110,7 +110,7 @@ def _haml_concat(string)
end

def _erb_concat(string)
@_out_buf << string
@_erbout << string
end
end # Capture

Expand Down
2 changes: 1 addition & 1 deletion lib/pancake/mixins/render/template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def initialize(name, owner, path)
@name, @owner, @path = name, owner, path
raise UnamedTemplate unless name
raise NotFound unless File.exists?(path)
@renderer = Tilt.new(path)
@renderer = Tilt.new(path, :outvar => '@_erbout')
end

def render(context = Object.new, opts = {})
Expand Down
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
ENV['RACK_ENV'] = "test"

$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')

require 'pancake'

Dir[File.join(File.dirname(__FILE__), "helpers", "**/*.rb")].each{|f| require f}
Expand Down

0 comments on commit 1ca481f

Please sign in to comment.