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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 615332e4a7a1dbdc6708665bd7d7b1063ddaf420
4
- data.tar.gz: 479032e9796ca794708268d556b1bc612483be44
3
+ metadata.gz: 5e49287a0cf261e666d7f0020815ae2d47c85d14
4
+ data.tar.gz: 830a4656ab6aebb203922e0f79325b153d7af1db
5
5
  SHA512:
6
- metadata.gz: 5b11b64e94982083fb234908ce29c9e93dd27c9b1517581315603a8793f97d1bc4c7931a9e1596b978f2f24616afbfbbf12c8c68bd98d7532b36a5173df6cb00
7
- data.tar.gz: 4843155d2ef310ae821c71de6e19f03156971e17a9f227d35efc99a4147e76b8ab4c0cf5a64798994a1697d469673fa64a6d6d24459e3f1997eba36cc1dc8fbb
6
+ metadata.gz: 7ad71848261c429eaff2cb3464117a582904bee5cb02e1311c48cb81d3fb2eab7bdb87917406770e92e364ccf0bb0025f5e8087e5f460b68f6ff4da26a3f9a74
7
+ data.tar.gz: d61e995e02989d23f1c6a3fe4b072763e6da59fcf69f17a5196fb45e531153608499ac1dc7084ae7a9a0845b299374dbdae0d211af067d64695ba2c264ba9b4d
@@ -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__+"/lib/helpers/*.rb"].each {|file| require file }
16
+ Dir[File.dirname(__FILE__) + "/helpers/*.rb"].each {|file| require file }
17
17
 
18
18
  class Embargo < Cuba
19
- def content_for(key, &block)
20
- if block
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.0
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-09 00:00:00.000000000 Z
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: