Sha256: 5263c3a6bd1cf5e3ec638cc0d6c143528c7c7c9756dceca7c689ccdb5e3e3776

Contents?: true

Size: 930 Bytes

Versions: 1

Compression:

Stored size: 930 Bytes

Contents

def require_all(path)
  glob = File.join(File.dirname(__FILE__), path, '*.rb')
  Dir[glob].each do |f|
    require f
  end
end

require "jektop/version"
require "jektop/date"

module Jektop

			def self.new(location, title_in, categories_in, post_in)

				title = title_in
				categories = categories_in
				post_text = post_in

				if location == "test"
					@test == true
				else
					h = location.length
					if location[h-1,1] == "/"
						blog_location = location
					else
						blog_location = location+"/"
					end
				end

				if @test = true
					date = Jektop::Date.give_date false
				else
					new_post = File.new("#{blog_location}#{date}-#{title}.markdown", "w")
				end

				if @test = true
					date = Jektop::Date.give_date true
				else
					new_post.puts("---\nlayout: post\ntitle: #{title}\ndate: #{date}\ncategories: #{categories}\n---\n#{post_text}")
					new_post.close
				end
				return true
			end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jektop-0.1.3 lib/jektop.rb