mote 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +2 -2
- data/bin/mote +37 -0
- data/lib/mote.rb +2 -2
- data/mote.gemspec +1 -0
- data/test/mote_test.rb +2 -2
- metadata +9 -8
data/README.markdown
CHANGED
@@ -70,9 +70,9 @@ free to include it in your code. To do it, just type:
|
|
70
70
|
The `mote` helper receives a file name and a hash and returns the rendered
|
71
71
|
version of its content. The compiled template is cached for subsequent calls.
|
72
72
|
|
73
|
-
assert_equal "***\n", mote("test/basic.
|
73
|
+
assert_equal "***\n", mote("test/basic.mote", n: 3)
|
74
74
|
|
75
75
|
Installation
|
76
76
|
------------
|
77
77
|
|
78
|
-
$ gem install mote
|
78
|
+
$ gem install mote
|
data/bin/mote
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
help = <<-EOS
|
2
|
+
MOTE(1)
|
3
|
+
|
4
|
+
NAME
|
5
|
+
mote -- Minimum Operational Template
|
6
|
+
|
7
|
+
SYNOPSIS
|
8
|
+
mote FILE
|
9
|
+
|
10
|
+
DESCRIPTION
|
11
|
+
Use this command line tool to render mote templates. The result
|
12
|
+
is redirected to standard output.
|
13
|
+
|
14
|
+
EXAMPLES
|
15
|
+
If your template called foo.mote, you can render it with the
|
16
|
+
following command:
|
17
|
+
|
18
|
+
mote foo.mote
|
19
|
+
|
20
|
+
To redirect the result to a new file, just redirect the output:
|
21
|
+
|
22
|
+
mote foo.mote > foo.html
|
23
|
+
|
24
|
+
SEE ALSO
|
25
|
+
https://github.com/soveran/mote
|
26
|
+
EOS
|
27
|
+
|
28
|
+
if ARGV.empty?
|
29
|
+
puts help
|
30
|
+
exit
|
31
|
+
end
|
32
|
+
|
33
|
+
require "mote"
|
34
|
+
|
35
|
+
include Mote::Helpers
|
36
|
+
|
37
|
+
print mote(ARGV[0])
|
data/lib/mote.rb
CHANGED
@@ -18,7 +18,7 @@
|
|
18
18
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
19
|
# THE SOFTWARE.
|
20
20
|
class Mote
|
21
|
-
VERSION = "0.2.
|
21
|
+
VERSION = "0.2.1"
|
22
22
|
|
23
23
|
def self.parse(template, context = self, vars = [])
|
24
24
|
terms = template.split(/^\s*(%)(.*?)$|(\{\{)(.*?)\}\}/)
|
@@ -33,7 +33,7 @@ class Mote
|
|
33
33
|
case term
|
34
34
|
when "%" then parts << "#{terms.shift}\n"
|
35
35
|
when "{{" then parts << "__o << (#{terms.shift}).to_s\n"
|
36
|
-
else parts << "__o << #{term.
|
36
|
+
else parts << "__o << #{term.dump}\n"
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
data/mote.gemspec
CHANGED
data/test/mote_test.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mote
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,12 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
13
|
-
default_executable:
|
12
|
+
date: 2012-03-18 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: cutest
|
17
|
-
requirement: &
|
16
|
+
requirement: &2152176840 !ruby/object:Gem::Requirement
|
18
17
|
none: false
|
19
18
|
requirements:
|
20
19
|
- - ! '>='
|
@@ -22,13 +21,14 @@ dependencies:
|
|
22
21
|
version: '0'
|
23
22
|
type: :development
|
24
23
|
prerelease: false
|
25
|
-
version_requirements: *
|
24
|
+
version_requirements: *2152176840
|
26
25
|
description: Mote is the little brother of ERB. It only provides a subset of ERB's
|
27
26
|
features, but praises itself of being simple--both internally and externally--and
|
28
27
|
super fast.
|
29
28
|
email:
|
30
29
|
- michel@soveran.com
|
31
|
-
executables:
|
30
|
+
executables:
|
31
|
+
- mote
|
32
32
|
extensions: []
|
33
33
|
extra_rdoc_files: []
|
34
34
|
files:
|
@@ -39,7 +39,8 @@ files:
|
|
39
39
|
- lib/mote.rb
|
40
40
|
- mote.gemspec
|
41
41
|
- test/mote_test.rb
|
42
|
-
|
42
|
+
- !binary |-
|
43
|
+
YmluL21vdGU=
|
43
44
|
homepage: http://github.com/soveran/mote
|
44
45
|
licenses: []
|
45
46
|
post_install_message:
|
@@ -60,7 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
60
61
|
version: '0'
|
61
62
|
requirements: []
|
62
63
|
rubyforge_project:
|
63
|
-
rubygems_version: 1.
|
64
|
+
rubygems_version: 1.8.10
|
64
65
|
signing_key:
|
65
66
|
specification_version: 3
|
66
67
|
summary: Minimum Operational Template.
|