Hi. I am sending patch with hotfix for getting run ditz.
After fixing those few things I have now new issue :-/ Please see also http://pastebin.com/pK5Exq8m Regards, Jakub Viták
From: Jakub Vitak <[email protected]> Subject: [PATCH] t/getting-run getting to run in year 2010 with ruby 1.9.2 1. fixing really horrible if-else conditionals 2. fixing sha1 loading 3. disabling PLATFORM test Signed-off-by: Jakub Vitak <[email protected]> --- lib/ditz.rb | 2 +- lib/ditz/model.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ditz.rb b/lib/ditz.rb index 5a5b88a..89d8687 100644 --- a/lib/ditz.rb +++ b/lib/ditz.rb @@ -68,7 +68,7 @@ end # Call run_pager from any opperator needing pagination. # Yoinked from http://nex-3.com/posts/73-git-style-automatic-paging-in-ruby#comments def run_pager config - return if PLATFORM =~ /win32/ + #return if PLATFORM =~ /win32/ return unless STDOUT.tty? return if config.paginate == 'never' diff --git a/lib/ditz/model.rb b/lib/ditz/model.rb index 763f75c..e7d7570 100644 --- a/lib/ditz/model.rb +++ b/lib/ditz/model.rb @@ -1,5 +1,5 @@ require 'yaml' -require 'sha1' +require 'digest/sha1' require "ditz/lowline"; include Lowline require "ditz/util" @@ -248,7 +248,7 @@ class ModelObject @fields.each do |name, field_opts| val = if opts[:with] && opts[:with][name] opts[:with][name] - elsif(found, v = generate_field_value(o, field_opts, generator_args, :interactive => true)) && found + elsif(begin; found, v = generate_field_value(o, field_opts, generator_args, :interactive => true); end) && found v else q = field_opts[:prompt] || name.to_s.capitalize @@ -278,7 +278,7 @@ class ModelObject @fields.each do |fname, fopts| val = if(x = vals[fname] || vals[fname.to_s]) x - elsif(found, x = generate_field_value(o, fopts, generator_args, :interactive => false)) && found + elsif(begin; found, x = generate_field_value(o, fopts, generator_args, :interactive => false); end) && found x elsif !fopts[:nil_ok] raise ModelError, "missing required field #{fname.inspect} on #{self.name} object (got #{vals.keys.inspect})" -- tg: (b7e29d4..) t/getting-run (depends on: master)
_______________________________________________ ditz-talk mailing list [email protected] http://rubyforge.org/mailman/listinfo/ditz-talk
