Commits

Koen Van der Auwera  committed 126c96a

no need for config file

  • Participants
  • Parent commits 7c2d64c

Comments (0)

Files changed (2)

 Encoding.default_external = Encoding::UTF_8
 Encoding.default_internal = Encoding::UTF_8
 
-require_relative 'amanda/helper'
-require_relative 'amanda/post'
-require_relative 'amanda/store'
-require_relative 'amanda/feed'
-
 require 'rack'
 require 'camping'
 require 'camping/session'
 require 'dropbox_sdk'
 
+require_relative 'amanda/helper'
+require_relative 'amanda/post'
+require_relative 'amanda/store'
+require_relative 'amanda/feed'
+
 Camping.goes :Amanda
 
 module Amanda
   set :secret, "Some super secret, even more. No. MORE!"
   include Camping::Session
-
-  $store = Amanda::Store.new("amanda.yml")
+  $store = Amanda::Store.new
 end
 
 module Amanda::Controllers

File amanda/store.rb

     TAGS_KEY = "tags"
     TAG_KEY_PREFIX = "tag:"
 
-    attr_accessor :config_file
-
-    def initialize(config_file) @config_file = config_file; end;
-
-    def config
-      @config ||= YAML.load_file(config_file)
-    end
-
-    def path
-      @path ||= config.fetch("posts_path")
-    end
-
-    def dropbox_settings
-      config.fetch("dropbox")
-    end
-
     def dropbox_session(session=nil)
       if session
         redis.set(DROPBOX, session.serialize)
 
     def read_posts_from_disk
       posts = []
-      Dir.glob(File.join(path, "*")).each do |post_file|
+      Dir.glob(File.join(ENV["PATH"], "*")).each do |post_file|
         if post_file =~ /\d{8}\d{4}\.md$/
           posts << Post.parse_from_file(post_file)
         end