class FrenchPress

The FrenchPress class houses some conveience methods for accessing a Blog object, as well as misc properties (such as self.version) and settings manipulation (such as self.default=)

Public Class Methods

default=(default_dir) click to toggle source
# File lib/frenchpress.rb, line 23
def self.default=(default_dir)
  Dir.chdir(Dir.home) do
    File.open('.frenchpress_dir', 'w+') do |f|
      f.truncate 0
      f.write default_dir
    end
  end
end
open(dir) click to toggle source
# File lib/frenchpress.rb, line 10
def self.open(dir)
  default_file = File.join Dir.home, '.frenchpress_dir'
  dir ||= File.open(default_file).read.to_s if File.exist?(default_file)
  dir ||= Dir.getwd
  dir = File.expand_path(dir)
  FrenchPress.working = FrenchPress::Blog.new dir # sets a class inst var
  FrenchPress.working
end
version() click to toggle source
# File lib/frenchpress.rb, line 19
def self.version
  '0.1.0'
end
working() click to toggle source
# File lib/frenchpress.rb, line 32
def self.working
  @working
end
working=(blag) click to toggle source
# File lib/frenchpress.rb, line 36
def self.working=(blag)
  @working = blag
end