ludy 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGES CHANGED
@@ -1,5 +1,9 @@
1
1
  = ludy changes history
2
2
 
3
+ == ludy 0.1.8, 2008.01.31
4
+
5
+ * change the way displaying debug message
6
+
3
7
  == ludy 0.1.7, 2008.01.31
4
8
 
5
9
  * added preprocess_cpp tools, debug_hook and debug_include
data/README CHANGED
@@ -1,4 +1,4 @@
1
- = ludy 0.1.7
1
+ = ludy 0.1.8
2
2
  by Lin Jen-Shin (a.k.a. godfat 真常)
3
3
  strip any number: 18god29fat7029 (at] godfat32 -dooot- 20org
4
4
  http://ludy.rubyforge.org
@@ -12,7 +12,7 @@ Aims to extend Ruby standard library, providing some useful tools that's not exi
12
12
 
13
13
  1. ludy standard library extension, especially for functional programming.
14
14
  2. rails/array paginator, included since 0.1.2
15
- 3. c++ erb meta-programming, included since 0.1.0
15
+ 3. c++ erb meta-programming, included since 0.1.0 (support erubis 2.5+)
16
16
  4. puzzle_generator, included since 0.0.8
17
17
 
18
18
  == SYNOPSIS:
data/Rakefile CHANGED
@@ -21,7 +21,7 @@ PROJ.description = paragraphs_of('README', 1).join("\n\n")
21
21
  PROJ.changes = paragraphs_of('CHANGES', 0..1).join("\n\n")
22
22
  PROJ.rubyforge_name = 'ludy'
23
23
 
24
- PROJ.version = '0.1.7'
24
+ PROJ.version = '0.1.8'
25
25
  PROJ.exclude << '.DS_Store' << '^tmp'
26
26
  PROJ.dependencies << 'rake'
27
27
 
@@ -10,9 +10,10 @@ module Kernel
10
10
  def debug_hook name, &block
11
11
  Ludy::erbout name, block.binding
12
12
  block.call
13
- Ludy::erbout \
14
- "#ifndef NDEBUG
15
- std::cerr << \"method #{name} called, for \" << this << \" at \" << __FILE__ << \": \" << __LINE__ << '\\n';
16
- #endif", block.binding
13
+ Ludy::erbout "
14
+ #ifndef NDEBUG
15
+ std::cerr << \"method #{name} called, for \" << this << \" at #{@file}: #{eval '__LINE__', block.binding}\\n\";
16
+ #endif
17
+ ", block.binding
17
18
  end
18
19
  end
@@ -25,16 +25,17 @@ namespace :preprocess do
25
25
  open output, 'w' do |o|
26
26
  @class = output.pathmap '%n'
27
27
  @dir = output.pathmap('%-1d')
28
+ @file = input
28
29
  @indent = ' '
29
30
  @prefix = ''
30
31
  Project.name ||= 'please_set_Project_name_for_your_header_name'
31
- o << template_engine[input].result(binding)
32
+ o << template_engine[open(input).read].result(binding)
32
33
  end
33
34
  end
34
35
 
35
36
  erb_inputs.zip(erb_outputs).each{ |input, output|
36
37
  file output => input do
37
- preprocess lambda{|input| ERB.new input}, open(input).read, output
38
+ preprocess lambda{|input| ERB.new input}, input, output
38
39
  end
39
40
  }
40
41
 
@@ -53,7 +54,7 @@ namespace :preprocess do
53
54
  erubis_inputs.zip(erubis_outputs).each{ |input, output|
54
55
  file output => input do
55
56
  class ErboutEruby < Erubis::Eruby; include Erubis::ErboutEnhancer; end
56
- preprocess lambda{|input| ErboutEruby.new input, :trim => false}, open(input).read, output
57
+ preprocess lambda{|input| ErboutEruby.new input, :trim => false}, input, output
57
58
  end
58
59
  }
59
60
  rescue LoadError; end # no erubis
data/lib/ludy.rb CHANGED
@@ -12,7 +12,7 @@ require 'rake'
12
12
  module Ludy
13
13
 
14
14
  # :stopdoc:
15
- VERSION = '0.1.7'
15
+ VERSION = '0.1.8'
16
16
  LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
17
17
  PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
18
18
  $LOAD_PATH << LIBPATH
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ludy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Lin Jen-Shin (a.k.a. godfat \xE7\x9C\x9F\xE5\xB8\xB8)"