Skip to content

Commit

Permalink
fix for dryml.rdoctest
Browse files Browse the repository at this point in the history
  • Loading branch information
ddnexus committed Oct 19, 2010
1 parent 896f4cd commit 9f9357c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
17 changes: 6 additions & 11 deletions dryml/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,17 @@ require 'rake'
require 'rake/rdoctask'
require 'rake/testtask'

$:.unshift File.expand_path('../lib', __FILE__)
$:.unshift File.expand_path('../../hobo_support/lib', __FILE__)
require 'dryml' # to get VERSION

RUBY = File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name']).sub(/.*\s.*/m, '"\&"')
RUBYDOCTEST = ENV['RUBYDOCTEST'] || "#{RUBY} -S rubydoctest"

desc "Default Task"
task :default => [ :test ]

# --- Testing --- #

desc "Run all tests"
task :test do |t|
files=Dir['test/*.rdoctest'].map {|f| File.expand_path(f)}.join(' ')
exit(1) if !system("#{RUBYDOCTEST} #{files}")
namespace "test" do
desc "Run the doctests"
task :doctest do |t|
files=Dir['test/**/*.rdoctest'].map {|f| File.expand_path(f)}.join(' ')
exit(1) if !system("#{RUBYDOCTEST} #{files}")
end
end

# --- RDOC --- #
Expand Down
7 changes: 3 additions & 4 deletions dryml/lib/dryml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -200,15 +200,14 @@ def render(template_src, locals={}, template_path=nil, included_taglibs=[], view
this = locals.delete(:this) || nil

renderer_class = Dryml::Template.build_cache[template_path]._?.environment ||
Dryml.make_renderer_class(template_src, template_path, locals.keys)
make_renderer_class(template_src, template_path, locals.keys)
renderer_class.new(view).render_page(this, locals)
end

private

def taglibs_for(controller_name)
([CORE_TAGLIB] +
[APPLICATION_TAGLIB] +
([APPLICATION_TAGLIB] +
application_taglibs() +
[subsite_taglib(controller_name)] +
(controller_name.camelize+"Controller").constantize.try.included_taglibs||[]).compact
Expand Down Expand Up @@ -270,7 +269,7 @@ def compile_renderer_class(renderer_class, template_src, template_path, locals,
# the sum of all the names we've seen so far - eventually we'll be ready for all of 'em
all_local_names = renderer_class.compiled_local_names | locals

template.compile(all_local_names, taglibs)
template.compile(all_local_names, [CORE_TAGLIB]+taglibs)
end


Expand Down
2 changes: 1 addition & 1 deletion dryml/test/dryml.rdoctest
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
>> $:.unshift File.join(File.expand_path(File.dirname(__FILE__)), '../../dryml/lib')
>> require 'hobo_support'
>> require 'dryml'
>> require 'dryml/template_handler'
>> require 'dryml/railtie/template_handler'

{.hidden}

Expand Down

0 comments on commit 9f9357c

Please sign in to comment.