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 CHANGED
@@ -60,22 +60,16 @@ end
60
60
  # Gems
61
61
  #
62
62
 
63
- begin
64
- require 'mg'
65
- MG.new("mustache.gemspec")
66
-
67
- desc "Push a new version to Gemcutter and publish docs."
68
- task :publish => "gem:publish" do
69
- require File.dirname(__FILE__) + '/lib/mustache/version'
70
-
71
- system "git tag v#{Mustache::Version}"
72
- sh "git push origin master --tags"
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
  #
@@ -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.
@@ -1,3 +1,3 @@
1
1
  class Mustache
2
- Version = VERSION = '0.11.1'
2
+ Version = VERSION = '0.11.2'
3
3
  end
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.5
2
2
  .\" http://github.com/rtomayko/ronn/
3
3
  .
4
- .TH "MUSTACHE" "1" "April 2010" "DEFUNKT" "Mustache Manual"
4
+ .TH "MUSTACHE" "1" "May 2010" "DEFUNKT" "Mustache Manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBmustache\fR \-\- Mustache processor
@@ -195,7 +195,7 @@ data
195
195
 
196
196
  <ol class='foot man'>
197
197
  <li class='tl'>DEFUNKT</li>
198
- <li class='tc'>April 2010</li>
198
+ <li class='tc'>May 2010</li>
199
199
  <li class='tr'>mustache(1)</li>
200
200
  </ol>
201
201
 
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.5
2
2
  .\" http://github.com/rtomayko/ronn/
3
3
  .
4
- .TH "MUSTACHE" "5" "April 2010" "DEFUNKT" "Mustache Manual"
4
+ .TH "MUSTACHE" "5" "May 2010" "DEFUNKT" "Mustache Manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBmustache\fR \-\- Logic\-less templates.
@@ -406,7 +406,7 @@ markup."</p>
406
406
 
407
407
  <ol class='foot man'>
408
408
  <li class='tl'>DEFUNKT</li>
409
- <li class='tc'>April 2010</li>
409
+ <li class='tc'>May 2010</li>
410
410
  <li class='tr'>mustache(5)</li>
411
411
  </ol>
412
412
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 11
8
- - 1
9
- version: 0.11.1
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-12 00:00:00 -07:00
17
+ date: 2010-05-13 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies: []
20
20