olelo 0.9.11 → 0.9.12
Sign up to get free protection for your applications and to get access to all the features.
- data/README.creole +1 -1
- data/lib/olelo/version.rb +1 -1
- data/olelo.gemspec +2 -2
- data/plugins/login/persistent.rb +6 -3
- data/plugins/utils/cache.rb +2 -2
- metadata +7 -7
data/README.creole
CHANGED
@@ -143,7 +143,7 @@ Some dependencies are optional, for example depending on the markup you want to
|
|
143
143
|
* [[http://www.imagemagick.org/|ImageMagick for image resizing]]
|
144
144
|
* [[http://nokogiri.org/|Nokogiri for auto-generated table of contents]]
|
145
145
|
* [[http://pygments.org/|Pygments for syntax highlighting of code blocks]]
|
146
|
-
* [[https://github.com/minad/
|
146
|
+
* [[https://github.com/minad/moneta/|Moneta Storage Interface]]
|
147
147
|
|
148
148
|
== Development
|
149
149
|
|
data/lib/olelo/version.rb
CHANGED
data/olelo.gemspec
CHANGED
@@ -23,13 +23,13 @@ Gem::Specification.new do |s|
|
|
23
23
|
s.add_runtime_dependency('creole', ['~> 0.5.0'])
|
24
24
|
s.add_runtime_dependency('evaluator', ['~> 0.1.6'])
|
25
25
|
s.add_runtime_dependency('mimemagic', ['~> 0.2.0'])
|
26
|
-
s.add_runtime_dependency('multi_json', ['~> 1.
|
26
|
+
s.add_runtime_dependency('multi_json', ['~> 1.4.0'])
|
27
27
|
s.add_runtime_dependency('nokogiri', ['~> 1.5.5'])
|
28
28
|
s.add_runtime_dependency('rack', ['~> 1.4.1'])
|
29
29
|
s.add_runtime_dependency('redcarpet', ['~> 2.2.2'])
|
30
30
|
s.add_runtime_dependency('rugged', ['~> 0.17.0.b7'])
|
31
31
|
s.add_runtime_dependency('slim', ['~> 1.3.3'])
|
32
|
-
s.add_runtime_dependency('
|
32
|
+
s.add_runtime_dependency('moneta', ['~> 0.7.0'])
|
33
33
|
|
34
34
|
s.add_development_dependency('bacon', ['~> 1.1.0'])
|
35
35
|
s.add_development_dependency('rack-test', ['~> 0.6.2'])
|
data/plugins/login/persistent.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
description 'Persistent login'
|
3
|
+
require 'openssl'
|
3
4
|
|
4
5
|
class ::Olelo::Application
|
5
6
|
TOKEN_NAME = 'olelo.token'
|
@@ -10,7 +11,8 @@ class ::Olelo::Application
|
|
10
11
|
token = request.cookies[TOKEN_NAME]
|
11
12
|
if token
|
12
13
|
hash, user = token.split('-', 2)
|
13
|
-
User.current = User.find(user) if
|
14
|
+
User.current = User.find(user) if hash == OpenSSL::HMAC.hexdigest(OpenSSL::Digest::Digest.new('sha256'),
|
15
|
+
Config['rack.session_secret'], user)
|
14
16
|
end
|
15
17
|
end
|
16
18
|
end
|
@@ -18,8 +20,9 @@ class ::Olelo::Application
|
|
18
20
|
after :action do |method, path|
|
19
21
|
if path == '/login'
|
20
22
|
if User.logged_in? && params[:persistent]
|
21
|
-
|
22
|
-
|
23
|
+
hash = OpenSSL::HMAC.hexdigest(OpenSSL::Digest::Digest.new('sha256'),
|
24
|
+
Config['rack.session_secret'], User.current.name)
|
25
|
+
response.set_cookie(TOKEN_NAME, value: "#{hash}-#{User.current.name}", expires: Time.now + TOKEN_LIFETIME)
|
23
26
|
end
|
24
27
|
elsif path == '/logout'
|
25
28
|
response.delete_cookie(TOKEN_NAME)
|
data/plugins/utils/cache.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
description 'Caching support'
|
2
2
|
dependencies 'utils/worker'
|
3
|
-
require '
|
3
|
+
require 'moneta'
|
4
4
|
|
5
5
|
class Cache
|
6
6
|
def initialize(store = nil)
|
@@ -51,7 +51,7 @@ class Cache
|
|
51
51
|
type = :HashFile
|
52
52
|
config[:dir] = config.delete(:root)
|
53
53
|
end
|
54
|
-
|
54
|
+
Moneta.new(type, config)
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: olelo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.12
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-01-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: RedCloth
|
@@ -82,7 +82,7 @@ dependencies:
|
|
82
82
|
requirements:
|
83
83
|
- - ~>
|
84
84
|
- !ruby/object:Gem::Version
|
85
|
-
version: 1.
|
85
|
+
version: 1.4.0
|
86
86
|
type: :runtime
|
87
87
|
prerelease: false
|
88
88
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -90,7 +90,7 @@ dependencies:
|
|
90
90
|
requirements:
|
91
91
|
- - ~>
|
92
92
|
- !ruby/object:Gem::Version
|
93
|
-
version: 1.
|
93
|
+
version: 1.4.0
|
94
94
|
- !ruby/object:Gem::Dependency
|
95
95
|
name: nokogiri
|
96
96
|
requirement: !ruby/object:Gem::Requirement
|
@@ -172,13 +172,13 @@ dependencies:
|
|
172
172
|
- !ruby/object:Gem::Version
|
173
173
|
version: 1.3.3
|
174
174
|
- !ruby/object:Gem::Dependency
|
175
|
-
name:
|
175
|
+
name: moneta
|
176
176
|
requirement: !ruby/object:Gem::Requirement
|
177
177
|
none: false
|
178
178
|
requirements:
|
179
179
|
- - ~>
|
180
180
|
- !ruby/object:Gem::Version
|
181
|
-
version: 0.
|
181
|
+
version: 0.7.0
|
182
182
|
type: :runtime
|
183
183
|
prerelease: false
|
184
184
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -186,7 +186,7 @@ dependencies:
|
|
186
186
|
requirements:
|
187
187
|
- - ~>
|
188
188
|
- !ruby/object:Gem::Version
|
189
|
-
version: 0.
|
189
|
+
version: 0.7.0
|
190
190
|
- !ruby/object:Gem::Dependency
|
191
191
|
name: bacon
|
192
192
|
requirement: !ruby/object:Gem::Requirement
|