gitstuff-preview 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/gitstuff-preview.gemspec +1 -0
- data/lib/gitstuff-preview/server.rb +8 -3
- data/lib/gitstuff-preview/version.rb +1 -1
- metadata +17 -3
data/gitstuff-preview.gemspec
CHANGED
@@ -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
|
38
|
-
post_data
|
39
|
-
post_data
|
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
|
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:
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
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
|