galena 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/galena.rb +1 -1
- data/rakefile.rb +11 -2
- data/tests/test_simple.rb +32 -0
- metadata +3 -2
data/lib/galena.rb
CHANGED
@@ -307,7 +307,7 @@ module Galena
|
|
307
307
|
src << tout(scope) << "<<(\""
|
308
308
|
# Replace the inline substition tokens
|
309
309
|
src << line.chomp.gsub(/(\s*)%=(.*?)=%/) do
|
310
|
-
"\" + Galena.ladj((#{$2}).to_s, " + ($1.length).to_s + ') + "'
|
310
|
+
"\" + Galena.ladj((\"#{$1}\" + #{$2}).to_s, " + ($1.length).to_s + ') + "'
|
311
311
|
end
|
312
312
|
|
313
313
|
src << "\\n\")\n"
|
data/rakefile.rb
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'rake/packagetask'
|
3
3
|
require 'rake/gempackagetask'
|
4
|
+
require 'rake/testtask'
|
4
5
|
|
5
|
-
PKG_VERSION="0.0.
|
6
|
+
PKG_VERSION="0.0.2"
|
6
7
|
PKG_FILES= [
|
7
8
|
"lib/galena.rb",
|
8
9
|
"lib/galena_test.rb",
|
10
|
+
"tests/test_simple.rb",
|
9
11
|
"rakefile.rb" ]
|
10
12
|
|
11
13
|
spec = Gem::Specification.new do |s|
|
@@ -27,10 +29,17 @@ for blocks/closures used as arguments to layouts.
|
|
27
29
|
EOF
|
28
30
|
end
|
29
31
|
|
30
|
-
|
32
|
+
Rake::GemPackageTask.new(spec) do |pkg|
|
31
33
|
pkg.need_zip = true
|
32
34
|
pkg.need_tar = true
|
33
35
|
end
|
34
36
|
|
35
37
|
desc "Default Task packages this into a gem"
|
36
38
|
task :default => :package
|
39
|
+
|
40
|
+
# Tests
|
41
|
+
Rake::TestTask.new do |t|
|
42
|
+
t.libs << "tests"
|
43
|
+
t.test_files = FileList['tests/test*.rb']
|
44
|
+
t.verbose = true
|
45
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'galena'
|
3
|
+
|
4
|
+
include Galena
|
5
|
+
|
6
|
+
class TC_MyTest < Test::Unit::TestCase
|
7
|
+
|
8
|
+
# def setup
|
9
|
+
# end
|
10
|
+
|
11
|
+
# def teardown
|
12
|
+
# end
|
13
|
+
|
14
|
+
tdef :skaar, "a,b,c,d", <<-END
|
15
|
+
a %= a =%
|
16
|
+
then a %=b=%
|
17
|
+
%= c =% dunking a dunk
|
18
|
+
%= d =% danker thanking a dank
|
19
|
+
END
|
20
|
+
|
21
|
+
def test_skaar
|
22
|
+
expected=<<END
|
23
|
+
a thinker
|
24
|
+
then a thanker
|
25
|
+
dunker dunking a dunk
|
26
|
+
danker danker thanking a dank
|
27
|
+
END
|
28
|
+
got = skaar('thinker','thanker','dunker','danker')
|
29
|
+
assert_equal(got, expected, 'Strings don\'t match')
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
|
|
3
3
|
specification_version: 1
|
4
4
|
name: galena
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.0.
|
7
|
-
date: 2006-09-
|
6
|
+
version: 0.0.2
|
7
|
+
date: 2006-09-16 00:00:00 +02:00
|
8
8
|
summary: Object Oriented Template Engine
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -31,6 +31,7 @@ authors: []
|
|
31
31
|
files:
|
32
32
|
- lib/galena.rb
|
33
33
|
- lib/galena_test.rb
|
34
|
+
- tests/test_simple.rb
|
34
35
|
- rakefile.rb
|
35
36
|
test_files: []
|
36
37
|
|