alula 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/alula/contents/item.rb +1 -11
- data/lib/alula/generators/feedbuilder.rb +4 -4
- data/lib/alula/generators/paginate.rb +3 -3
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.2
|
data/lib/alula/contents/item.rb
CHANGED
@@ -63,7 +63,7 @@ module Alula
|
|
63
63
|
prev_hook_name = "#{name}_without_#{hook_id}"
|
64
64
|
(class << self; self; end).send(:define_method, hook_name) do |*args|
|
65
65
|
previous_hook = self.method(prev_hook_name)
|
66
|
-
instance_exec(previous_hook, args, &blk)
|
66
|
+
instance_exec(previous_hook, *args, &blk)
|
67
67
|
end
|
68
68
|
(class << self; self; end).send(:alias_method, prev_hook_name, name)
|
69
69
|
(class << self; self; end).send(:alias_method, name, hook_name)
|
@@ -286,22 +286,12 @@ module Alula
|
|
286
286
|
end
|
287
287
|
|
288
288
|
def previous(locale = nil)
|
289
|
-
# if @hooks[:previous]
|
290
|
-
# instance_exec(locale, &@hooks[:previous])
|
291
|
-
# end
|
292
289
|
end
|
293
290
|
|
294
291
|
def next(locale = nil)
|
295
|
-
# if @hooks[:next]
|
296
|
-
# binding.pry
|
297
|
-
# instance_exec(locale, &@hooks[:next])
|
298
|
-
# end
|
299
292
|
end
|
300
293
|
|
301
294
|
def navigation(locale = nil)
|
302
|
-
# if @hooks[:navigation]
|
303
|
-
# instance_exec(locale, &@hooks[:navigation])
|
304
|
-
# end
|
305
295
|
end
|
306
296
|
|
307
297
|
#
|
@@ -29,10 +29,10 @@ module Alula
|
|
29
29
|
site: self.site,
|
30
30
|
layout: "feed",
|
31
31
|
},
|
32
|
-
:previous => ->(hook, locale) { nil },
|
33
|
-
:next => ->(hook, locale) { nil },
|
34
|
-
:navigation => ->(hook, locale) { nil },
|
35
|
-
:write => ->(hook, locale) {
|
32
|
+
:previous => ->(hook, locale = nil) { nil },
|
33
|
+
:next => ->(hook, locale = nil) { nil },
|
34
|
+
:navigation => ->(hook, locale = nil) { nil },
|
35
|
+
:write => ->(hook, locale = nil) {
|
36
36
|
begin
|
37
37
|
_old_renderer = self.posts.collect{|p| p.metadata.renderer}
|
38
38
|
self.posts.cycle(1) { |p| p.flush; p.metadata.renderer = self.generator;}
|
@@ -39,7 +39,7 @@ module Alula
|
|
39
39
|
site: self.site,
|
40
40
|
view: self.options.view || "paginate",
|
41
41
|
},
|
42
|
-
:previous => ->(hook, locale) {
|
42
|
+
:previous => ->(hook, locale = nil) {
|
43
43
|
pos = self.navigation(locale).index(self)
|
44
44
|
if pos and pos < (self.navigation(locale).count - 1)
|
45
45
|
self.navigation(locale)[pos + 1]
|
@@ -47,7 +47,7 @@ module Alula
|
|
47
47
|
nil
|
48
48
|
end
|
49
49
|
},
|
50
|
-
:next => ->(hook, locale) {
|
50
|
+
:next => ->(hook, locale = nil) {
|
51
51
|
pos = self.navigation(locale).index(self)
|
52
52
|
if pos and pos > 0
|
53
53
|
self.navigation(locale)[pos - 1]
|
@@ -55,7 +55,7 @@ module Alula
|
|
55
55
|
nil
|
56
56
|
end
|
57
57
|
},
|
58
|
-
:navigation => ->(hook, locale) {
|
58
|
+
:navigation => ->(hook, locale = nil) {
|
59
59
|
locale ||= self.current_locale || self.site.config.locale
|
60
60
|
@navigation[locale] ||= self.site.content.pages.select { |item| item.metadata.generator == self.generator and item.languages.include?(locale) }
|
61
61
|
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alula
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
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: 2012-07-
|
12
|
+
date: 2012-07-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: parallel
|
@@ -644,7 +644,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
644
644
|
version: '0'
|
645
645
|
segments:
|
646
646
|
- 0
|
647
|
-
hash:
|
647
|
+
hash: 976783427636173041
|
648
648
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
649
649
|
none: false
|
650
650
|
requirements:
|
@@ -653,7 +653,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
653
653
|
version: '0'
|
654
654
|
segments:
|
655
655
|
- 0
|
656
|
-
hash:
|
656
|
+
hash: 976783427636173041
|
657
657
|
requirements: []
|
658
658
|
rubyforge_project:
|
659
659
|
rubygems_version: 1.8.23
|