module OctopressThemes::PopularPost::Utilities

Constants

ASIDES_DIR
PLUGINS_DIR

Public Class Methods

install() click to toggle source

Public: Installs the templates to the designated locations

Examples

OctopressThemes::PopularPost.install
# => nil

Returns nothing

# File lib/popular_posts/utilities.rb, line 17
def self.install
  FileUtils.copy_file plugin_path, plugin_destination
  FileUtils.copy_file aside_path, aside_destination
end
remove() click to toggle source

Public: Removes plugin files

Examples

OctopressThemes::PopularPost.remove
# => nil

Returns nothing

# File lib/popular_posts/utilities.rb, line 30
def self.remove
  FileUtils.rm plugin_destination
  FileUtils.rm aside_destination
end

Protected Class Methods

aside_destination() click to toggle source

Private: Returns the file path to the aside destination

Examples

aside_destination
# => /path/to/destination/aside.html

Returns a String

# File lib/popular_posts/utilities.rb, line 81
def self.aside_destination
  File.join(Dir.pwd, 'source', '_includes', 'custom', 'asides', 'popular_posts.html')
end
aside_path() click to toggle source

Private: Returns the file path to the aside template

Examples

aside_path
# => /path/to/aside.html

Returns a String

# File lib/popular_posts/utilities.rb, line 69
def self.aside_path
  File.join(ASIDES_DIR, 'popular_posts.html')
end
plugin_destination() click to toggle source

Private: Returns the file path to the plugin destination

Examples

plugin_destination
# => /path/to/destination/plugin.rb

Returns a String

# File lib/popular_posts/utilities.rb, line 57
def self.plugin_destination
  File.join(Dir.pwd, 'plugins', 'popular_post.rb')
end
plugin_path() click to toggle source

Private: Returns the file path to the plugin template

Examples

plugin_path
# => /path/to/plugin.rb

Returns a String

# File lib/popular_posts/utilities.rb, line 45
def self.plugin_path
  File.join(PLUGINS_DIR, 'popular_post.rb')
end