Module: Pullentity::Client::Helpers
- Defined in:
- lib/pullentity-client/helpers.rb
Instance Method Summary collapse
- #javascript_include_tag(file) ⇒ Object
- #location ⇒ Object
- #site_name ⇒ Object
- #stylesheet_link_tag(file) ⇒ Object
- #test_data_include_tag ⇒ Object
- #theme_name ⇒ Object
Instance Method Details
#javascript_include_tag(file) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/pullentity-client/helpers.rb', line 9 def javascript_include_tag(file) if target?(:pullentity) path = "#{URL_REMOTE}/uploads/theme_asset/#{site_name}/theme/#{theme_name}/assets/#{file}" "<script src='#{path}.js?#{Time.now.to_i}' type='text/javascript'></script>" else super end end |
#location ⇒ Object
43 44 45 |
# File 'lib/pullentity-client/helpers.rb', line 43 def location @location ||= Pathname.new(Dir.pwd) end |
#site_name ⇒ Object
33 34 35 36 |
# File 'lib/pullentity-client/helpers.rb', line 33 def site_name hsh = YAML.load_file(location + "pullentity.yml") hsh["site"] end |
#stylesheet_link_tag(file) ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/pullentity-client/helpers.rb', line 18 def stylesheet_link_tag(file) if target?(:pullentity) path = "#{URL_REMOTE}/uploads/theme_asset/#{site_name}/theme/#{theme_name}/assets/#{file}" "<link href='#{path}.css?#{Time.now.to_i}' media='screen' rel='stylesheet' type='text/css' />" else super end end |
#test_data_include_tag ⇒ Object
27 28 29 30 31 |
# File 'lib/pullentity-client/helpers.rb', line 27 def test_data_include_tag unless target?(:pullentity) javascript_include_tag "pullentity/development" end end |
#theme_name ⇒ Object
38 39 40 41 |
# File 'lib/pullentity-client/helpers.rb', line 38 def theme_name hsh = YAML.load_file(location + "pullentity.yml") hsh["theme_name"] end |