lib/runeblog.rb in runeblog-0.0.15 vs lib/runeblog.rb in runeblog-0.0.16

- old
+ new

@@ -1,8 +1,8 @@ class RuneBlog - VERSION = "0.0.15" + VERSION = "0.0.16" Path = File.expand_path(File.join(File.dirname(__FILE__))) DefaultData = Path + "/../data" BlogHeader = File.read(DefaultData + "/blog_header.html") rescue "not found" @@ -51,21 +51,34 @@ =end require 'rubygems' require 'ostruct' -# require 'livetext' +require 'livetext' ### ask def ask(prompt, meth = :to_s) print prompt STDOUT.flush STDIN.gets.chomp.send(meth) end +### quit + +def quit + puts + exit +end + +### version + +def version + puts "\n " + RuneBlog::VERSION +end + ### new_blog! def new_blog! unless File.exist?(".blog") yn = ask("No .blog found. Create new blog?") @@ -79,11 +92,11 @@ ### next_sequence def next_sequence @config.sequence += 1 - File.open("#{@config.root}/data/sequence", "w") {|f| f.puts @config.sequence } + File.open("#{@config.root}/sequence", "w") {|f| f.puts @config.sequence } @config.sequence end ### make_slug @@ -147,11 +160,12 @@ ### process_post def process_post(file) lt ||= Livetext.new - puts " Processing: #{file}" - lt.process_file(file) +# puts " Processing: #{Dir.pwd}/#{file}" + path = @config.root + "/src/#{file}" + lt.process_file(path) @meta = lt.main.instance_eval { @meta } @meta.slug = file.sub(/.lt3$/, "") @meta end