rb-tmpl 0.1.0 → 0.1.1
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/Gemfile +2 -6
- data/lib/rb-tmpl/version.rb +1 -1
- data/rb-tmpl.gemspec +19 -14
- data/spec/tmpl_spec.rb +6 -3
- metadata +60 -12
data/Gemfile
CHANGED
data/lib/rb-tmpl/version.rb
CHANGED
data/rb-tmpl.gemspec
CHANGED
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
|
2
|
-
$:.push File.expand_path(
|
|
3
|
-
require
|
|
2
|
+
$:.push File.expand_path('../lib', __FILE__)
|
|
3
|
+
require 'rb-tmpl/version'
|
|
4
4
|
|
|
5
5
|
Gem::Specification.new do |s|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
s.name = 'rb-tmpl'
|
|
7
|
+
s.version = RbTmpl::VERSION
|
|
8
|
+
s.authors = ['Sijmen J. Mulder']
|
|
9
|
+
s.email = ['sjmulder@gmail.com']
|
|
10
|
+
s.homepage = 'https://github.com/sjmulder/rb-tmpl'
|
|
11
|
+
s.summary = %q{A Ruby implementation of jquery-tmpl}
|
|
12
|
+
s.description = %q{With rb-tmpl you can re-use jquery-tmpl templates on the server, saving you from having to do the same work twice.}
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
s.rubyforge_project = 'rb-tmpl'
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
s.add_dependency 'rubyzip', '~> 0.9.4'
|
|
17
|
+
s.add_development_dependency 'bundler', '>= 1.0.0'
|
|
18
|
+
s.add_development_dependency 'rspec'
|
|
19
|
+
s.add_development_dependency 'fakefs'
|
|
20
|
+
|
|
21
|
+
s.files = `git ls-files`.split("\n")
|
|
22
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
|
23
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
|
24
|
+
s.require_paths = ['lib']
|
|
20
25
|
end
|
data/spec/tmpl_spec.rb
CHANGED
|
@@ -169,15 +169,18 @@ describe Tmpl do
|
|
|
169
169
|
tmpl.call(:lt_f).should == ''
|
|
170
170
|
tmpl.call(:lt_t).should == 'y'
|
|
171
171
|
tmpl.call(:eq_var_t, {:var => 1}).should == 'y'
|
|
172
|
-
tmpl.call(:eq_var_f, {:var => 1}).should == '
|
|
172
|
+
tmpl.call(:eq_var_f, {:var => 1}).should == ''
|
|
173
173
|
end
|
|
174
174
|
|
|
175
175
|
it 'supports method calls' do
|
|
176
176
|
tmpl = Tmpl.new
|
|
177
|
-
tmpl.add(:foo, '
|
|
178
|
-
tmpl.call(:foo, {:list => [1, 2]}).
|
|
177
|
+
tmpl.add(:foo, '${list.length}')
|
|
178
|
+
tmpl.call(:foo, {:list => [1, 2]}).should == '2'
|
|
179
179
|
end
|
|
180
180
|
|
|
181
181
|
it 'substitutes common JavaScript expressions'
|
|
182
182
|
it 'substitutes common JavaScript methods'
|
|
183
|
+
it 'caches templates if caching is enabled'
|
|
184
|
+
it 'does not cache templates if caching is disabled'
|
|
185
|
+
it 'throws a suitable error when a template is not found'
|
|
183
186
|
end
|
metadata
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rb-tmpl
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
|
|
5
|
-
prerelease:
|
|
4
|
+
prerelease: false
|
|
6
5
|
segments:
|
|
7
6
|
- 0
|
|
8
7
|
- 1
|
|
9
|
-
-
|
|
10
|
-
version: 0.1.
|
|
8
|
+
- 1
|
|
9
|
+
version: 0.1.1
|
|
11
10
|
platform: ruby
|
|
12
11
|
authors:
|
|
13
12
|
- Sijmen J. Mulder
|
|
@@ -15,9 +14,61 @@ autorequire:
|
|
|
15
14
|
bindir: bin
|
|
16
15
|
cert_chain: []
|
|
17
16
|
|
|
18
|
-
date: 2011-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
date: 2011-08-11 00:00:00 +02:00
|
|
18
|
+
default_executable:
|
|
19
|
+
dependencies:
|
|
20
|
+
- !ruby/object:Gem::Dependency
|
|
21
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - ~>
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
segments:
|
|
26
|
+
- 0
|
|
27
|
+
- 9
|
|
28
|
+
- 4
|
|
29
|
+
version: 0.9.4
|
|
30
|
+
requirement: *id001
|
|
31
|
+
name: rubyzip
|
|
32
|
+
prerelease: false
|
|
33
|
+
type: :runtime
|
|
34
|
+
- !ruby/object:Gem::Dependency
|
|
35
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - ">="
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
segments:
|
|
40
|
+
- 1
|
|
41
|
+
- 0
|
|
42
|
+
- 0
|
|
43
|
+
version: 1.0.0
|
|
44
|
+
requirement: *id002
|
|
45
|
+
name: bundler
|
|
46
|
+
prerelease: false
|
|
47
|
+
type: :development
|
|
48
|
+
- !ruby/object:Gem::Dependency
|
|
49
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
|
50
|
+
requirements:
|
|
51
|
+
- - ">="
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
segments:
|
|
54
|
+
- 0
|
|
55
|
+
version: "0"
|
|
56
|
+
requirement: *id003
|
|
57
|
+
name: rspec
|
|
58
|
+
prerelease: false
|
|
59
|
+
type: :development
|
|
60
|
+
- !ruby/object:Gem::Dependency
|
|
61
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
|
62
|
+
requirements:
|
|
63
|
+
- - ">="
|
|
64
|
+
- !ruby/object:Gem::Version
|
|
65
|
+
segments:
|
|
66
|
+
- 0
|
|
67
|
+
version: "0"
|
|
68
|
+
requirement: *id004
|
|
69
|
+
name: fakefs
|
|
70
|
+
prerelease: false
|
|
71
|
+
type: :development
|
|
21
72
|
description: With rb-tmpl you can re-use jquery-tmpl templates on the server, saving you from having to do the same work twice.
|
|
22
73
|
email:
|
|
23
74
|
- sjmulder@gmail.com
|
|
@@ -36,6 +87,7 @@ files:
|
|
|
36
87
|
- rb-tmpl.gemspec
|
|
37
88
|
- spec/spec_helper.rb
|
|
38
89
|
- spec/tmpl_spec.rb
|
|
90
|
+
has_rdoc: true
|
|
39
91
|
homepage: https://github.com/sjmulder/rb-tmpl
|
|
40
92
|
licenses: []
|
|
41
93
|
|
|
@@ -45,27 +97,23 @@ rdoc_options: []
|
|
|
45
97
|
require_paths:
|
|
46
98
|
- lib
|
|
47
99
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
48
|
-
none: false
|
|
49
100
|
requirements:
|
|
50
101
|
- - ">="
|
|
51
102
|
- !ruby/object:Gem::Version
|
|
52
|
-
hash: 3
|
|
53
103
|
segments:
|
|
54
104
|
- 0
|
|
55
105
|
version: "0"
|
|
56
106
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
57
|
-
none: false
|
|
58
107
|
requirements:
|
|
59
108
|
- - ">="
|
|
60
109
|
- !ruby/object:Gem::Version
|
|
61
|
-
hash: 3
|
|
62
110
|
segments:
|
|
63
111
|
- 0
|
|
64
112
|
version: "0"
|
|
65
113
|
requirements: []
|
|
66
114
|
|
|
67
115
|
rubyforge_project: rb-tmpl
|
|
68
|
-
rubygems_version: 1.
|
|
116
|
+
rubygems_version: 1.3.6
|
|
69
117
|
signing_key:
|
|
70
118
|
specification_version: 3
|
|
71
119
|
summary: A Ruby implementation of jquery-tmpl
|