class TinyPress::Site
Constants
- RC_FILE
Contains
TinyPress
configuration
Public Class Methods
abort_unless_site_exists()
click to toggle source
# File lib/tinypress/site.rb, line 25 def self.abort_unless_site_exists unless site_exists? message = "" message += "Cannot find a TinyPress install at this location.\n".red message += "You can try setting up a new site with 'tinypress establish' to resolve this.\n".red raise message end end
generate()
click to toggle source
# File lib/tinypress/site.rb, line 6 def self.generate if self.site_exists? raise "Whoops! Looks like there's TinyPress site at this location already.".red else FileUtils.touch RC_FILE end puts "Established a new TinyPress site.".green end
publish()
click to toggle source
# File lib/tinypress/site.rb, line 15 def self.publish self.abort_unless_site_exists puts "Published whole site.".green end
site_exists?()
click to toggle source
# File lib/tinypress/site.rb, line 21 def self.site_exists? File.exists?(RC_FILE) end