Class: Frozen::Site::Base
- Inherits:
-
Object
- Object
- Frozen::Site::Base
- Defined in:
- lib/frozen/site/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#site_root_path ⇒ Object
Returns the value of attribute site_root_path.
Instance Method Summary collapse
- #build_path ⇒ Object
- #file_is_javascript?(file) ⇒ Boolean
- #file_is_layout?(file) ⇒ Boolean
- #file_is_stylesheet?(file) ⇒ Boolean
- #file_is_view?(file) ⇒ Boolean
- #files_in_path(path, ext) ⇒ Object
- #image_build_path ⇒ Object
- #image_template_path ⇒ Object
-
#initialize ⇒ Base
constructor
A new instance of Base.
- #javascript_build_path ⇒ Object
- #javascript_template_path ⇒ Object
- #layout_template_path ⇒ Object
- #stylesheet_build_path ⇒ Object
- #stylesheet_template_path ⇒ Object
- #view_build_path ⇒ Object
- #view_template_path ⇒ Object
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
6 7 8 |
# File 'lib/frozen/site/base.rb', line 6 def initialize = {} end |
Instance Attribute Details
#site_root_path ⇒ Object
Returns the value of attribute site_root_path.
4 5 6 |
# File 'lib/frozen/site/base.rb', line 4 def site_root_path @site_root_path end |
Instance Method Details
#build_path ⇒ Object
10 11 12 |
# File 'lib/frozen/site/base.rb', line 10 def build_path File.join(site_root_path, "build") end |
#file_is_javascript?(file) ⇒ Boolean
58 59 60 |
# File 'lib/frozen/site/base.rb', line 58 def file_is_javascript?(file) file =~ /^assets\/javascripts/ end |
#file_is_layout?(file) ⇒ Boolean
50 51 52 |
# File 'lib/frozen/site/base.rb', line 50 def file_is_layout?(file) file =~ /^layouts/ end |
#file_is_stylesheet?(file) ⇒ Boolean
54 55 56 |
# File 'lib/frozen/site/base.rb', line 54 def file_is_stylesheet?(file) file =~ /^assets\/stylesheets/ end |
#file_is_view?(file) ⇒ Boolean
46 47 48 |
# File 'lib/frozen/site/base.rb', line 46 def file_is_view?(file) file =~ /^views/ end |
#files_in_path(path, ext) ⇒ Object
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/frozen/site/base.rb', line 66 def files_in_path(path, ext) files = [] if ext.is_a? String files = Dir.glob(File.join(path, "/**/*.#{ext}")) end if ext.is_a? Array ext.each do |e| files += Dir.glob(File.join(path, "/**/*.#{e}")) end end if files files.delete_if { |i| File.basename(i) =~ /^\_/ } end files end |
#image_build_path ⇒ Object
62 63 64 |
# File 'lib/frozen/site/base.rb', line 62 def image_build_path File.join(build_path, 'images') end |
#image_template_path ⇒ Object
42 43 44 |
# File 'lib/frozen/site/base.rb', line 42 def image_template_path File.join(site_root_path, 'assets/images') end |
#javascript_build_path ⇒ Object
34 35 36 |
# File 'lib/frozen/site/base.rb', line 34 def javascript_build_path File.join(build_path, "js") end |
#javascript_template_path ⇒ Object
18 19 20 |
# File 'lib/frozen/site/base.rb', line 18 def javascript_template_path File.join(site_root_path, "assets/javascripts") end |
#layout_template_path ⇒ Object
26 27 28 |
# File 'lib/frozen/site/base.rb', line 26 def layout_template_path File.join(site_root_path, "layouts") end |
#stylesheet_build_path ⇒ Object
30 31 32 |
# File 'lib/frozen/site/base.rb', line 30 def stylesheet_build_path File.join(build_path, "css") end |
#stylesheet_template_path ⇒ Object
14 15 16 |
# File 'lib/frozen/site/base.rb', line 14 def stylesheet_template_path File.join(site_root_path, "assets/stylesheets") end |
#view_build_path ⇒ Object
38 39 40 |
# File 'lib/frozen/site/base.rb', line 38 def view_build_path site_root_path end |
#view_template_path ⇒ Object
22 23 24 |
# File 'lib/frozen/site/base.rb', line 22 def view_template_path File.join(site_root_path, "views") end |