broadway 0.0.3.2 → 0.0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +1 -1
- data/lib/broadway/page.rb +1 -1
- data/lib/broadway/post.rb +1 -1
- data/lib/broadway/resource.rb +10 -2
- metadata +14 -3
data/Rakefile
CHANGED
@@ -14,7 +14,7 @@ RAILS_ROOT = File.dirname(__FILE__)
|
|
14
14
|
spec = Gem::Specification.new do |s|
|
15
15
|
s.name = "broadway"
|
16
16
|
s.author = "Lance Pollard"
|
17
|
-
s.version = "0.0.3.
|
17
|
+
s.version = "0.0.3.3"
|
18
18
|
s.date = "Mon Mar 22 20:12:47 -0700 2010"
|
19
19
|
s.summary = "Write Posts in Textile and Markdown, built it into a Rails or Sinatra Blog"
|
20
20
|
s.homepage = "http://github.com/viatropos/broadway"
|
data/lib/broadway/page.rb
CHANGED
@@ -22,7 +22,7 @@ module Broadway
|
|
22
22
|
self.basename = File.basename(path).split('.')[0..-2].first
|
23
23
|
|
24
24
|
self.categories ||= []
|
25
|
-
self.categories.concat self.
|
25
|
+
self.categories.concat self.dir.split('/').reject { |x| x.empty? }
|
26
26
|
self.children ||= []
|
27
27
|
process(options) unless options.has_key?(:process) and options[:process] == false
|
28
28
|
end
|
data/lib/broadway/post.rb
CHANGED
@@ -34,7 +34,7 @@ module Broadway
|
|
34
34
|
self.slug = slug
|
35
35
|
self.ext = ext
|
36
36
|
self.dir = options.has_key?(:dir) ? options[:dir] : File.dirname(path.gsub(/#{site.config[:source]}\/?/, ""))
|
37
|
-
base = self.dir == "." ? "" :
|
37
|
+
base = self.dir == "." ? "" : self.dir
|
38
38
|
self.categories = base.split('/').reject { |x| x.empty? }
|
39
39
|
|
40
40
|
process(options)
|
data/lib/broadway/resource.rb
CHANGED
@@ -43,9 +43,17 @@ module Broadway::Resource
|
|
43
43
|
self.tags ||= []
|
44
44
|
end
|
45
45
|
|
46
|
+
# definitely needs refactoring
|
46
47
|
def children
|
47
|
-
|
48
|
-
|
48
|
+
key = self.categories.last
|
49
|
+
length = self.url.split("/").length
|
50
|
+
@children = site.find_pages_by_category(key) + site.find_posts_by_category(key)
|
51
|
+
@children.delete_if do |child|
|
52
|
+
(child.url == self.url) ||
|
53
|
+
(child.url.split("/").length <= length) ||
|
54
|
+
(child.is_a?(Broadway::Post) && child.categories != self.categories) ||
|
55
|
+
(child.is_a?(Broadway::Page) && child.categories[0..-2] != self.categories)
|
56
|
+
end
|
49
57
|
end
|
50
58
|
|
51
59
|
# The UID for this post (useful in feeds)
|
metadata
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: broadway
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 69
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
8
|
- 0
|
8
9
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.0.3.
|
10
|
+
- 3
|
11
|
+
version: 0.0.3.3
|
11
12
|
platform: ruby
|
12
13
|
authors:
|
13
14
|
- Lance Pollard
|
@@ -22,9 +23,11 @@ dependencies:
|
|
22
23
|
name: nokogiri
|
23
24
|
prerelease: false
|
24
25
|
requirement: &id001 !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
25
27
|
requirements:
|
26
28
|
- - ">="
|
27
29
|
- !ruby/object:Gem::Version
|
30
|
+
hash: 3
|
28
31
|
segments:
|
29
32
|
- 0
|
30
33
|
version: "0"
|
@@ -34,9 +37,11 @@ dependencies:
|
|
34
37
|
name: activesupport
|
35
38
|
prerelease: false
|
36
39
|
requirement: &id002 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
37
41
|
requirements:
|
38
42
|
- - ">="
|
39
43
|
- !ruby/object:Gem::Version
|
44
|
+
hash: 9
|
40
45
|
segments:
|
41
46
|
- 2
|
42
47
|
- 3
|
@@ -48,9 +53,11 @@ dependencies:
|
|
48
53
|
name: activerecord
|
49
54
|
prerelease: false
|
50
55
|
requirement: &id003 !ruby/object:Gem::Requirement
|
56
|
+
none: false
|
51
57
|
requirements:
|
52
58
|
- - ">="
|
53
59
|
- !ruby/object:Gem::Version
|
60
|
+
hash: 9
|
54
61
|
segments:
|
55
62
|
- 2
|
56
63
|
- 3
|
@@ -98,23 +105,27 @@ rdoc_options: []
|
|
98
105
|
require_paths:
|
99
106
|
- lib
|
100
107
|
required_ruby_version: !ruby/object:Gem::Requirement
|
108
|
+
none: false
|
101
109
|
requirements:
|
102
110
|
- - ">="
|
103
111
|
- !ruby/object:Gem::Version
|
112
|
+
hash: 3
|
104
113
|
segments:
|
105
114
|
- 0
|
106
115
|
version: "0"
|
107
116
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
117
|
+
none: false
|
108
118
|
requirements:
|
109
119
|
- - ">="
|
110
120
|
- !ruby/object:Gem::Version
|
121
|
+
hash: 3
|
111
122
|
segments:
|
112
123
|
- 0
|
113
124
|
version: "0"
|
114
125
|
requirements: []
|
115
126
|
|
116
127
|
rubyforge_project: broadway
|
117
|
-
rubygems_version: 1.3.
|
128
|
+
rubygems_version: 1.3.7
|
118
129
|
signing_key:
|
119
130
|
specification_version: 3
|
120
131
|
summary: Write Posts in Textile and Markdown, built it into a Rails or Sinatra Blog
|