Sha256: f2fa32b608ed2de573a7113389598d34a6e8a28ee333495f5f0427024992aef5

Contents?: true

Size: 927 Bytes

Versions: 73

Compression:

Stored size: 927 Bytes

Contents

# encoding: utf-8
module Mutx
  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..."
        Mutx::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)
          Mutx::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

73 entries across 73 versions & 1 rubygems

Version Path
mutx-0.2.9 lib/mutx/support/documentation.rb
mutx-0.2.8 lib/mutx/support/documentation.rb
mutx-0.2.7 lib/mutx/support/documentation.rb
mutx-0.2.6 lib/mutx/support/documentation.rb
mutx-0.2.5 lib/mutx/support/documentation.rb
mutx-0.2.4 lib/mutx/support/documentation.rb
mutx-0.2.3 lib/mutx/support/documentation.rb
mutx-0.2.2 lib/mutx/support/documentation.rb
mutx-0.2.1 lib/mutx/support/documentation.rb
mutx-0.2.0 lib/mutx/support/documentation.rb
mutx-0.1.69 lib/mutx/support/documentation.rb
mutx-0.1.68 lib/mutx/support/documentation.rb
mutx-0.1.67 lib/mutx/support/documentation.rb
mutx-0.1.66 lib/mutx/support/documentation.rb
mutx-0.1.65 lib/mutx/support/documentation.rb
mutx-0.1.64 lib/mutx/support/documentation.rb
mutx-0.1.63 lib/mutx/support/documentation.rb
mutx-0.1.62 lib/mutx/support/documentation.rb
mutx-0.1.61 lib/mutx/support/documentation.rb
mutx-0.1.60 lib/mutx/support/documentation.rb