Module: Pullentity::Client::Helpers

Defined in:
lib/pullentity-client/helpers.rb

Instance Method Summary collapse

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

#locationObject



43
44
45
# File 'lib/pullentity-client/helpers.rb', line 43

def location
  @location ||= Pathname.new(Dir.pwd)
end

#site_nameObject



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


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_tagObject



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_nameObject



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