embargo 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/embargo.rb +3 -12
- data/lib/helpers/content_for.rb +14 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e49287a0cf261e666d7f0020815ae2d47c85d14
|
4
|
+
data.tar.gz: 830a4656ab6aebb203922e0f79325b153d7af1db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ad71848261c429eaff2cb3464117a582904bee5cb02e1311c48cb81d3fb2eab7bdb87917406770e92e364ccf0bb0025f5e8087e5f460b68f6ff4da26a3f9a74
|
7
|
+
data.tar.gz: d61e995e02989d23f1c6a3fe4b072763e6da59fcf69f17a5196fb45e531153608499ac1dc7084ae7a9a0845b299374dbdae0d211af067d64695ba2c264ba9b4d
|
data/lib/embargo.rb
CHANGED
@@ -13,20 +13,11 @@ Cuba.plugin(Cuba::Render)
|
|
13
13
|
Cuba.use Rack::Session::Cookie, :secret => "__a_very_long_string__"
|
14
14
|
Cuba.use Rack::Protection
|
15
15
|
|
16
|
-
Dir[__FILE__+"/
|
16
|
+
Dir[File.dirname(__FILE__) + "/helpers/*.rb"].each {|file| require file }
|
17
17
|
|
18
18
|
class Embargo < Cuba
|
19
|
-
def
|
20
|
-
|
21
|
-
@_content_for ||= {}
|
22
|
-
buf_was = @haml_buffer.buffer
|
23
|
-
@haml_buffer.buffer = ''
|
24
|
-
yield
|
25
|
-
@_content_for[key] = @haml_buffer.buffer
|
26
|
-
@haml_buffer.buffer = buf_was
|
27
|
-
elsif @_content_for
|
28
|
-
@_content_for[key]
|
29
|
-
end
|
19
|
+
def self.directory
|
20
|
+
File.dirname(__FILE__)
|
30
21
|
end
|
31
22
|
|
32
23
|
def self.app_directory
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class Cuba
|
2
|
+
def content_for(key, &block)
|
3
|
+
if block
|
4
|
+
@_content_for ||= {}
|
5
|
+
buf_was = @haml_buffer.buffer
|
6
|
+
@haml_buffer.buffer = ''
|
7
|
+
yield
|
8
|
+
@_content_for[key] = @haml_buffer.buffer
|
9
|
+
@haml_buffer.buffer = buf_was
|
10
|
+
elsif @_content_for
|
11
|
+
@_content_for[key]
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embargo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Fleming
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-01-
|
13
|
+
date: 2015-01-12 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: cuba
|
@@ -246,6 +246,7 @@ files:
|
|
246
246
|
- lib/config/init.rb
|
247
247
|
- lib/config/unicorn.rb
|
248
248
|
- lib/embargo.rb
|
249
|
+
- lib/helpers/content_for.rb
|
249
250
|
- lib/helpers/ruby_ext.rb
|
250
251
|
homepage: https://rubygems.org/gems/embargo
|
251
252
|
licenses:
|