docwu 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/lib/docwu/folder.rb CHANGED
@@ -59,12 +59,18 @@ module Docwu
59
59
 
60
60
  # 转为数据
61
61
  def to_data
62
+ posts_count = self.posts.size
63
+ posts_limit = 10
64
+ limit_posts_data = self.posts[0..posts_limit].map(&:to_data)
65
+
62
66
  {
63
- 'name' => self.name,
64
- 'url' => self.url,
65
- 'title' => self.name,
66
- 'folders' => self.folders.map(&:to_data),
67
- 'posts' => self.posts.map(&:to_data)
67
+ 'name' => self.name,
68
+ 'url' => self.url,
69
+ 'title' => self.name,
70
+ 'folders' => self.folders.map(&:to_data),
71
+ 'posts' => self.posts.map(&:to_data),
72
+ 'limit_posts' => limit_posts_data,
73
+ 'limit_posts_more?' => (posts_count > posts_limit)
68
74
  }
69
75
  end
70
76
 
data/lib/docwu/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module Docwu
3
- VERSION = "0.0.5"
3
+ VERSION = "0.0.6"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docwu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -129,7 +129,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
129
129
  version: '0'
130
130
  segments:
131
131
  - 0
132
- hash: -910541711738543635
132
+ hash: 989421214351366918
133
133
  required_rubygems_version: !ruby/object:Gem::Requirement
134
134
  none: false
135
135
  requirements:
@@ -138,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
138
  version: '0'
139
139
  segments:
140
140
  - 0
141
- hash: -910541711738543635
141
+ hash: 989421214351366918
142
142
  requirements: []
143
143
  rubyforge_project:
144
144
  rubygems_version: 1.8.25