mustache 0.11.1 → 0.11.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +10 -16
- data/lib/mustache/sinatra.rb +24 -0
- data/lib/mustache/version.rb +1 -1
- data/man/mustache.1 +1 -1
- data/man/mustache.1.html +1 -1
- data/man/mustache.5 +1 -1
- data/man/mustache.5.html +1 -1
- metadata +3 -3
data/Rakefile
CHANGED
@@ -60,22 +60,16 @@ end
|
|
60
60
|
# Gems
|
61
61
|
#
|
62
62
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
sh "git clean -fd"
|
74
|
-
exec "rake pages"
|
75
|
-
end
|
76
|
-
rescue LoadError
|
77
|
-
warn "mg not available."
|
78
|
-
warn "Install it with: gem i mg"
|
63
|
+
desc "Push a new version to Gemcutter and publish docs."
|
64
|
+
task :publish do
|
65
|
+
require File.dirname(__FILE__) + '/lib/mustache/version'
|
66
|
+
|
67
|
+
system "git tag v#{Mustache::Version}"
|
68
|
+
sh "gem build mustache.gemspec"
|
69
|
+
sh "gem push mustache-#{Mustache::Version}.gem"
|
70
|
+
sh "git push origin master --tags"
|
71
|
+
sh "git clean -fd"
|
72
|
+
exec "rake pages"
|
79
73
|
end
|
80
74
|
|
81
75
|
#
|
data/lib/mustache/sinatra.rb
CHANGED
@@ -123,6 +123,12 @@ class Mustache
|
|
123
123
|
self.view_path = options[:views]
|
124
124
|
end
|
125
125
|
|
126
|
+
# If we were handed :"positions.atom" or some such as the
|
127
|
+
# template name, we need to remember the extension.
|
128
|
+
if view.to_s.include?('.')
|
129
|
+
view, ext = view.to_s.split('.')
|
130
|
+
end
|
131
|
+
|
126
132
|
# Try to find the view class for a given view, e.g.
|
127
133
|
# :view => Hurl::Views::Index.
|
128
134
|
klass = factory.view_class(view)
|
@@ -138,6 +144,24 @@ class Mustache
|
|
138
144
|
# subclass of Mustache won't know how to find the
|
139
145
|
# "index.mustache" template unless we tell it to.
|
140
146
|
klass.template_name = view.to_s
|
147
|
+
elsif ext
|
148
|
+
# We got an ext (like "atom"), so look for an "Atom" class
|
149
|
+
# under the current View's namespace.
|
150
|
+
#
|
151
|
+
# So if our template was "positions.atom", try to find
|
152
|
+
# Positions::Atom.
|
153
|
+
if klass.const_defined?(ext_class = ext.capitalize)
|
154
|
+
# Found Positions::Atom - set it
|
155
|
+
klass = klass.const_get(ext_class)
|
156
|
+
else
|
157
|
+
# Didn't find Positions::Atom - create it by creating an
|
158
|
+
# anonymous subclass of Positions and setting that to
|
159
|
+
# Positions::Atom.
|
160
|
+
new_class = Class.new(klass)
|
161
|
+
new_class.template_name = "#{view}.#{ext}"
|
162
|
+
klass.const_set(ext_class, new_class)
|
163
|
+
klass = new_class
|
164
|
+
end
|
141
165
|
end
|
142
166
|
|
143
167
|
# Set the template path and return our class.
|
data/lib/mustache/version.rb
CHANGED
data/man/mustache.1
CHANGED
data/man/mustache.1.html
CHANGED
data/man/mustache.5
CHANGED
data/man/mustache.5.html
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 11
|
8
|
-
-
|
9
|
-
version: 0.11.
|
8
|
+
- 2
|
9
|
+
version: 0.11.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Chris Wanstrath
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-05-
|
17
|
+
date: 2010-05-13 00:00:00 -07:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|