BVB Source Codes

hologram Show template.rb Source code

Return Download hologram: download template.rb Source code - Download hologram Source code - Type:.rb
  1. module Hologram
  2.   module CodeExampleRenderer
  3.     class Template < Struct.new(:template_name)
  4.       def template
  5.         return nil if !template_filename
  6.         File.read(template_filename)
  7.       end
  8.  
  9.       class << self
  10.         attr_accessor :path_to_custom_example_templates
  11.       end
  12.  
  13.       private
  14.  
  15.       def template_filename
  16.         return nil if !template_name
  17.         custom_file_exists? ? custom_file : default_file
  18.       end
  19.  
  20.       def custom_file_exists?
  21.         !!self.class.path_to_custom_example_templates && File.file?(custom_file)
  22.       end
  23.  
  24.       def custom_file
  25.         File.join(self.class.path_to_custom_example_templates, "#{template_name}.html.erb")
  26.       end
  27.  
  28.       def default_file
  29.         File.join(File.dirname(__FILE__), '..', '..', 'template', 'code_example_templates', "#{template_name}.html.erb")
  30.       end
  31.     end
  32.   end
  33. end
  34.  
downloadtemplate.rb Source code - Download hologram Source code
Related Source Codes/Software:
www.html5rocks.com - ....a top-notch resource for web developer 2017-05-12
MTStatusBarOverlay - A custom iOS status bar overlay seen in Apps like ... 2017-05-12
blueprint - Reverse engineer server configuration ... 2017-05-12
PullToRefresh - A simple iPhone TableViewController for adding the... 2017-05-12
mrjob - Run MapReduce jobs on Hadoop or Amazon Web Service... 2017-05-11
isso - a Disqus alternative https:... 2017-05-12
python3-cookbook - "The Python Cookbook" 3 rd Edition Translatio 2017-05-12
TSA-Travel-Sentry-master-keys - 3D reproduction of TSA Master key 2017-05-12
fatfree - A powerful yet easy-to-use PHP micro-framework des... 2017-05-13
rolify - Role management library with the resource scoping 2017-05-13
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top