middleman-releases 0.1.1 → 0.2.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
  SHA1:
3
- metadata.gz: 87a2eda7c4af2203f0aba9d5d2162d25157b6e96
4
- data.tar.gz: 10cf8a247bbd4e0ec725ee8a18c353434e3ea20e
3
+ metadata.gz: 0df7b6d2befa8e9db8de24d9e4da6b62c20f3451
4
+ data.tar.gz: 9ab21bbdece78ee6e279e684d313d3e3799f9629
5
5
  SHA512:
6
- metadata.gz: c95004c89dbefa843ce837001039017364c39c9f4445d5274cbd647f05777e97bfde5ca0ddbdc68b29733a5afd58271b4c7ff5e8fab8d27bc3336887d123b6ce
7
- data.tar.gz: c71131aea64138a3b13ba55a05c32ceb5f7e30af905bdfbb9bd8b90179ca17f36a482609ac615db23a07b049c9cae7ba8c0a26d34aa4d7ffb5ce64e64f2ed004
6
+ metadata.gz: 5dc1a3a6d97a7ca03b80975464f47c0f8c40c48ce02bb64032454f22d256d9f797275fd476e0815d8e9cbd22475e68e71d614f777d2cd70edcc92a0e727cd283
7
+ data.tar.gz: 43e49b07fc1cd23e7faa77e94763ce6195fa6d1249988e01de7d5e2d580e48168047b2952ed21561efdafa71f4aa3fc0e3248b2b3519ffe8605eb61c53232f1e
@@ -16,8 +16,10 @@ module Releases
16
16
  end
17
17
 
18
18
  def manipulate_resource_list(resources)
19
+ @_releases = []
20
+
19
21
  resources.each do |resource|
20
- if resource.path.start_with?("#{ options.releases_dir }/")
22
+ if resource.path =~ %r{#{options[:releases_dir]}\/v.*\/index\.html}
21
23
  layout = resource.metadata[:options].fetch(:layout, options[:layout]).to_s
22
24
  resource.add_metadata(options: { layout: layout })
23
25
 
@@ -34,6 +36,14 @@ module Releases
34
36
  def current_release
35
37
  Releases::Instance.from(current_resource, self)
36
38
  end
39
+
40
+ def releases
41
+ releases_controller.releases
42
+ end
43
+
44
+ def latest_release
45
+ releases.first
46
+ end
37
47
  end
38
48
  end
39
49
  end
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "middleman-releases"
6
- s.version = "0.1.1"
6
+ s.version = "0.2.0"
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["Matt Millsaps-Brewer"]
9
9
  s.email = ["matt@madebylotus.com"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-releases
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Millsaps-Brewer