gitstuff-preview 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -28,4 +28,5 @@ Gem::Specification.new do |s|
28
28
  s.add_runtime_dependency "rdiscount"
29
29
  s.add_runtime_dependency "hashie"
30
30
  s.add_runtime_dependency "thin"
31
+ s.add_runtime_dependency "jekyll"
31
32
  end
@@ -5,10 +5,15 @@ require 'sinatra/base'
5
5
  require 'hashie'
6
6
  require 'liquid'
7
7
  require 'rdiscount'
8
+ require 'jekyll'
8
9
 
9
10
  BASE_PATH = ENV['BASE_PATH'] || "./"
10
11
 
11
12
  class Server < Sinatra::Base
13
+
14
+ configure do
15
+ Liquid::Template.register_filter(Jekyll::Filters)
16
+ end
12
17
 
13
18
  def render_index(context={}, options={})
14
19
  context[:posts] = []
@@ -34,9 +39,9 @@ class Server < Sinatra::Base
34
39
  path ||= File.join("#{BASE_PATH}posts", slug) + ".yml"
35
40
  begin
36
41
  post_data = Hashie::Mash.new YAML.load_file(path)
37
- post_data[:content] = File.read(path).sub /---.*---\n/m, ''
38
- post_data[:author] = Hashie::Mash.new :name => "Author Name", :email => "author@example.com"
39
- post_data[:gravatar] = "http://www.gravatar.com/avatar/#{Digest::MD5.hexdigest(post_data.author.email)}"
42
+ post_data.content = File.read(path).sub /---.*---\n/m, ''
43
+ post_data.author = Hashie::Mash.new :name => "Author Name", :email => "author@example.com"
44
+ post_data.gravatar = "http://www.gravatar.com/avatar/#{Digest::MD5.hexdigest(post_data.author.email)}"
40
45
  post_data.created_at = Time.now
41
46
  post_data.modified_at = Time.now
42
47
  post_data
@@ -1,5 +1,5 @@
1
1
  module Gitstuff
2
2
  module Preview
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitstuff-preview
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jesse Kriss
@@ -87,6 +87,20 @@ dependencies:
87
87
  version: "0"
88
88
  type: :runtime
89
89
  version_requirements: *id005
90
+ - !ruby/object:Gem::Dependency
91
+ name: jekyll
92
+ prerelease: false
93
+ requirement: &id006 !ruby/object:Gem::Requirement
94
+ none: false
95
+ requirements:
96
+ - - ">="
97
+ - !ruby/object:Gem::Version
98
+ hash: 3
99
+ segments:
100
+ - 0
101
+ version: "0"
102
+ type: :runtime
103
+ version_requirements: *id006
90
104
  description: gitstuff-preview runs a local web server to preview Gitstuff templates
91
105
  email:
92
106
  - jesse@jklabs.net