class Mdpresent::CLI
Public Instance Methods
deploy()
click to toggle source
# File lib/mdpresent/cli.rb, line 53 def deploy case Mdpresent.platform when :heroku Heroku.deploy when :github Github.deploy end end
generate(file)
click to toggle source
# File lib/mdpresent/cli.rb, line 32 def generate file Command.generate_presentation file, {action: :default} end
list()
click to toggle source
# File lib/mdpresent/cli.rb, line 73 def list Command.execute I18n.t("commands.mdpress.list") end
new(dir_name)
click to toggle source
# File lib/mdpresent/cli.rb, line 8 def new dir_name begin # create directory if it doesn't exist already FileUtils.mkdir_p(dir_name) unless File.directory?(dir_name) # copy the template files to user directory FileUtils.cp_r(Dir.glob("#{Mdpresent.root}/lib/mdpresent/templates/*") , dir_name) rescue puts $!, $@ end end
open()
click to toggle source
# File lib/mdpresent/cli.rb, line 43 def open case Mdpresent.platform when :heroku Heroku.open when :github Github.open end end
setup(platform)
click to toggle source
# File lib/mdpresent/cli.rb, line 21 def setup platform abort I18n.t :platform_not_supported, { platform: platform } unless PLATFORMS.include?(platform.downcase) case platform.downcase when "heroku" Heroku.setup when "github" Github.setup end end
style(style, file)
click to toggle source
# File lib/mdpresent/cli.rb, line 68 def style style, file Command.generate_presentation file, {action: :style, style: style} end
update_home()
click to toggle source
# File lib/mdpresent/cli.rb, line 37 def update_home home_page_generator = HomePageGenerator.new home_page_generator.generate end
watch(file)
click to toggle source
# File lib/mdpresent/cli.rb, line 63 def watch file Command.generate_presentation file, {action: :watch} end