Sha256: dd36a90aa1e09d16f1fea67923581e85899643f83001ca77f9fb90736fc578f5

Contents?: true

Size: 803 Bytes

Versions: 3

Compression:

Stored size: 803 Bytes

Contents

module Kharites
  class Base
    
    include Kharites::SetupMixin  
    attr_reader :current_page, :src_dir, :site_dir

    def current_file
      @current_file_stack[0] || ""
    end
    
    def initialize(base_dir)
      @current_page = nil
      @current_file_stack = []
      @base_dir = base_dir
      @src_dir = File.join(@base_dir, "views")
      @site_dir = File.join(@base_dir, "public")            
      @scope = Object.new
      @scope.instance_variable_set("@kharites", self)
    end
    
    def base_dir
      @base_dir
    end
  
    def run(command)
      puts "Article root is: #{@base_dir}"
      
      if %w(sync generate server console).include?(command)
        send(command)
      else
        puts "#{command} is not a valid Kharites command"
      end
    end
    
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
Kharites-tools-0.2.0 lib/kharites/base.rb
Kharites-tools-0.1.1 lib/kharites/base.rb
Kharites-tools-0.1.0 lib/kharites/base.rb