Sha256: 202968a88763df16ba806982b317ef98fee5c93e3a857af29137c8d15030840b

Contents?: true

Size: 896 Bytes

Versions: 12

Compression:

Stored size: 896 Bytes

Contents

libdir = File.dirname(__FILE__)
$LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir)

require 'siteleaf/version'
require 'siteleaf/client'
require 'siteleaf/server'
require 'siteleaf/entity'
require 'siteleaf/site'
require 'siteleaf/page'
require 'siteleaf/post'
require 'siteleaf/user'
require 'rbconfig'

module Siteleaf

  @api_base = 'https://api.siteleaf.com/v1'

  class << self
    attr_accessor :api_key, :api_secret, :api_base
  end

  def self.api_url(url='')
    "#{@api_base}/#{url}"
  end

  def self.settings_file
    File.expand_path('~/.siteleaf')
  end

  def self.load_settings
    if File.exist?(self.settings_file)
      config = File.open(self.settings_file) do|file|
        Marshal.load(file)
      end
      self.api_key = config[:api_key] if config.has_key?(:api_key)
      self.api_secret = config[:api_secret] if config.has_key?(:api_secret)
    end
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
siteleaf-0.9.12 lib/siteleaf.rb
siteleaf-0.9.11 lib/siteleaf.rb
siteleaf-0.9.10 lib/siteleaf.rb
siteleaf-0.9.9 lib/siteleaf.rb
siteleaf-0.9.8 lib/siteleaf.rb
siteleaf-0.9.7 lib/siteleaf.rb
siteleaf-0.9.6 lib/siteleaf.rb
siteleaf-0.9.5 lib/siteleaf.rb
siteleaf-0.9.3 lib/siteleaf.rb
siteleaf-0.9.2 lib/siteleaf.rb
siteleaf-0.9.1 lib/siteleaf.rb
siteleaf-0.9.0 lib/siteleaf.rb