module Templatron

Constants

PLACEHOLDER_REG
PREFIX

This part will be joined to the user Dir.home

VERSION

Public Class Methods

execute() click to toggle source

Public: CLI Stuff, parse command line inputs to determine what to do

# File lib/templatron/cli.rb, line 66
def self.execute
  MainCommand.run
end
placeholder_block_reg(key) click to toggle source

Public: Retrieve the placeholder reg block which contains the whole placeholder markup

key - Key to look for

Returns the regex needed to retrieve the whole placeholder markup

# File lib/templatron/config.rb, line 28
def self.placeholder_block_reg(key)
  /({\$\d*\W?[#{key}]*})/
end
placeholder_reg(match_i) click to toggle source

Public: Retrieve the placeholder reg for replacement

match_i - Match key

Returns the regex for replacement

# File lib/templatron/config.rb, line 18
def self.placeholder_reg(match_i)
  /{\$#{match_i}\W?([\w\s]*)}/
end
templates_path() click to toggle source

Public: Retrieve the full path which stores templates

# File lib/templatron/config.rb, line 9
def self.templates_path
  File.join(Dir.home, PREFIX)
end