mote 0.0.1.rc2 → 0.0.1.rc3
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/README.markdown +6 -7
- data/lib/mote.rb +2 -2
- data/mote.gemspec +1 -1
- data/test/mote_test.rb +1 -1
- metadata +1 -1
data/README.markdown
CHANGED
@@ -64,7 +64,7 @@ free to include it in your code. To do it, just type:
|
|
64
64
|
|
65
65
|
Here are the available helpers:
|
66
66
|
|
67
|
-
##
|
67
|
+
## mote
|
68
68
|
|
69
69
|
The `mote` helper receives a template string and returns the rendered version
|
70
70
|
of it:
|
@@ -75,18 +75,17 @@ It works with parameters too:
|
|
75
75
|
|
76
76
|
assert_equal "1 2 3", mote("1 <%= params[:n] %> 3", :n => 2)
|
77
77
|
|
78
|
-
##
|
78
|
+
## mote_file
|
79
79
|
|
80
|
-
The `mote_file` helper receives a file name
|
81
|
-
|
82
|
-
for subsequent calls.
|
80
|
+
The `mote_file` helper receives a file name and returns the rendered version of
|
81
|
+
its content. The compiled template is cached for subsequent calls.
|
83
82
|
|
84
|
-
assert_equal "***\n", mote_file("test/basic", :n => 3)
|
83
|
+
assert_equal "***\n", mote_file("test/basic.erb", :n => 3)
|
85
84
|
|
86
85
|
Installation
|
87
86
|
------------
|
88
87
|
|
89
|
-
$ gem install mote
|
88
|
+
$ gem install mote --pre
|
90
89
|
|
91
90
|
License
|
92
91
|
-------
|
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.0.1.
|
21
|
+
VERSION = "0.0.1.rc3"
|
22
22
|
|
23
23
|
def self.parse(template, context = self)
|
24
24
|
terms = template.split(/(<%[=#]?)\s*(.*?)\s*%>/)
|
@@ -46,7 +46,7 @@ class Mote
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def mote_file(filename, params = {})
|
49
|
-
mote_files[filename] ||= Mote.parse(File.read(
|
49
|
+
mote_files[filename] ||= Mote.parse(File.read(filename))
|
50
50
|
mote_files[filename][params]
|
51
51
|
end
|
52
52
|
|
data/mote.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "mote"
|
3
|
-
s.version = "0.0.1.
|
3
|
+
s.version = "0.0.1.rc3"
|
4
4
|
s.summary = "Minimum Operational Template."
|
5
5
|
s.description = "Mote is the little brother of ERB. It only provides a subset of ERB's features, but praises itself of being simple--both internally and externally--and super fast."
|
6
6
|
s.authors = ["Michel Martens"]
|
data/test/mote_test.rb
CHANGED