lib/skellington/helpers.rb in skellington-0.8.9 vs lib/skellington/helpers.rb in skellington-0.9.0.pre.rc1
- old
+ new
@@ -5,6 +5,23 @@
def self.unslash word
return word[2..-1] if word[0..1] == './'
word
end
+
+ def self.js_for_sinatra data
+ s = [' %s: {' % data['name']]
+ s.push " url: '%s'," % (data['url'].sub 'VERSION', data['version'])
+ s.push " hash: '%s'" % data['hash']
+ s.push ' }'
+
+ s.join "\n"
+ end
+
+ def self.js_for_jekyll data
+ s = [' - name: %s' % data['name']]
+ s.push " url: %s" % (data['url'].sub 'VERSION', data['version'])
+ s.push " hash: %s" % data['hash'] if data['hash']
+
+ s.join "\n"
+ end
end