Sha256: 106b764950205382cf9084d8e589284f363cd9aa81fadb8d35afb54b8cedc983

Contents?: true

Size: 909 Bytes

Versions: 14

Compression:

Stored size: 909 Bytes

Contents

module Kaya
  module Support
    class Documentation

      @@main_folder = File.expand_path("../../../../", __FILE__) + "/"
      @@docs_folder = @@main_folder + "documentation/"

      @@folders_to_search = [@@main_folder, @@docs_folder]


      def self.load_documentation
        print "\nLoading documentation..."
        Kaya::Database::MongoConnector.clean_documentation
        @@folders_to_search.each { |folder| self.open_files folder }
        print "OK"
      end

      def self.open_files folder
        Dir.glob(folder + "*.md") do |md_file|
          name = md_file.split("/").last.gsub('.md','')
          text = File.read(md_file)
          Kaya::Database::MongoConnector.insert_documentation self.generate_entry(name,text)
        end
      end

      def self.generate_entry name, text
        {
            "title" => name,
            "body" => text
        }
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
kaya-0.0.14 lib/kaya/support/documentation.rb
kaya-0.0.13 lib/kaya/support/documentation.rb
kaya-0.0.12 lib/kaya/support/documentation.rb
kaya-0.0.11 lib/kaya/support/documentation.rb
kaya-0.0.10 lib/kaya/support/documentation.rb
kaya-0.0.9 lib/kaya/support/documentation.rb
kaya-0.0.8 lib/kaya/support/documentation.rb
kaya-0.0.7 lib/kaya/support/documentation.rb
kaya-0.0.6 lib/kaya/support/documentation.rb
kaya-0.0.5 lib/kaya/support/documentation.rb
kaya-0.0.4 lib/kaya/support/documentation.rb
kaya-0.0.3 lib/kaya/support/documentation.rb
kaya-0.0.2 lib/kaya/support/documentation.rb
kaya-0.0.1 lib/kaya/support/documentation.rb