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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e471f5dd46965102f05fa1ea09778a917a597ab013e3bafccf65609985a047b3
4
- data.tar.gz: 8b3a5647ec657e5536bc5a66081bfdbb46355f3ddf153dc2bea13af53c9d25b0
3
+ metadata.gz: ababf3434d0e74af988d3d2570089792fb09e156cf1bcce889b7ea64d3bc34d3
4
+ data.tar.gz: 8fb1a553ba112358931cb2f463075b04328db67a284c1841f82b07fcaf186bb1
5
5
  SHA512:
6
- metadata.gz: aac3ab9b4b42cd867ea13618e61950ff9178be52f3ea768e6ed78e8d7087c38a3a7cc2c4ff050d8ef072028ed6e8ef1aebe48b4cfce626ad23dc9658d87050a5
7
- data.tar.gz: dbd5e5c8a049a62b139dfb55082bcc50cfa74b7dd80d8bdebc4a78b056ce23720c6344d479391275bf9c43a613d0a7524df18ab898534d0c0d8c7f57e37ba87e
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"
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module Carraway
2
- VERSION = "0.7.0"
2
+ VERSION = "0.8.0"
3
3
  end
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.7.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-04 00:00:00.000000000 Z
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