carraway 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/carraway.gemspec +1 -0
- data/lib/carraway/server.rb +9 -0
- data/lib/carraway/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ababf3434d0e74af988d3d2570089792fb09e156cf1bcce889b7ea64d3bc34d3
|
4
|
+
data.tar.gz: 8fb1a553ba112358931cb2f463075b04328db67a284c1841f82b07fcaf186bb1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c9b67264231865ec7f23aa81b40ef53a04fededdffc6d3c466fb979efadba3205f84420690a39d97bc16f8f5122e0998489eb845c07a493f4664521acba86e5
|
7
|
+
data.tar.gz: b3fe28420dd50f07f8380da2970c66b73a24de348211a22e58c2b3b5b55b2bf66693305511324a0345599243a495714c9461b797d7437d501d454eb121507055
|
data/carraway.gemspec
CHANGED
@@ -25,6 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.add_dependency 'aws-sdk-dynamodb'
|
26
26
|
spec.add_dependency 'aws-sdk-s3'
|
27
27
|
spec.add_dependency 'rack-flash3'
|
28
|
+
spec.add_dependency 'redcarpet'
|
28
29
|
|
29
30
|
spec.add_development_dependency "bundler", "~> 1.16"
|
30
31
|
spec.add_development_dependency "rake", "~> 10.0"
|
data/lib/carraway/server.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'sinatra'
|
2
2
|
require 'json'
|
3
3
|
require 'rack/flash'
|
4
|
+
require 'redcarpet'
|
4
5
|
require 'time'
|
5
6
|
|
6
7
|
module Carraway
|
@@ -22,6 +23,14 @@ module Carraway
|
|
22
23
|
|
23
24
|
get '/carraway/api/posts' do
|
24
25
|
posts = Post.all(published_only: true).map(&:to_h)
|
26
|
+
|
27
|
+
# HACK Expand plugin
|
28
|
+
transformed = params[:view] == 'html'
|
29
|
+
if transformed
|
30
|
+
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML)
|
31
|
+
posts = posts.map { |post| post[:body] = markdown.render(post[:body]); post }
|
32
|
+
end
|
33
|
+
|
25
34
|
{ data: { posts: posts } }.to_json
|
26
35
|
end
|
27
36
|
|
data/lib/carraway/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: carraway
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- adorechic
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: redcarpet
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: bundler
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|