Charu 0.0.7 → 0.0.8
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.
- checksums.yaml +4 -4
- data/lib/Charu/ChangeLogMemo.rb +39 -8
- data/lib/Charu/Config.rb +7 -5
- data/lib/Charu/CreateHtml.rb +2 -31
- data/lib/Charu/Template.rb +1 -1
- data/lib/Charu/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 870da5a0f711457e0bcef160d3d886fe6bab9055
|
4
|
+
data.tar.gz: 05f5526283ceea84390c32b71c6efb23951f9e92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 659d1caf563be710987517ef4594861d1dc8023467c3f3c99644ba01078c5b97578da0ee7992f7771cb899d1d635794d5a049746908082a8f45bfe0bd1928d2a
|
7
|
+
data.tar.gz: 38beba3a1a26436df923f4a030bde8a2ed80ccd8845abe3688b0388eedc08ce92513826cf9d08b7ef29130510aba52700e38543e029755868d7071acafeb54e3
|
data/lib/Charu/ChangeLogMemo.rb
CHANGED
@@ -8,7 +8,8 @@ module Charu
|
|
8
8
|
@config = Charu::Config.new()
|
9
9
|
|
10
10
|
# プライベートの設定
|
11
|
-
|
11
|
+
# 基本は全部プライベート
|
12
|
+
@private_category = false
|
12
13
|
end
|
13
14
|
|
14
15
|
def add(title_source)
|
@@ -27,6 +28,16 @@ module Charu
|
|
27
28
|
end
|
28
29
|
|
29
30
|
def get_private_category()
|
31
|
+
# プライベートの設定
|
32
|
+
# パブリックのカテゴリーに指定したものだけ、公開することにしてあります。
|
33
|
+
@category.each{|category|
|
34
|
+
@config.public_category.each{|public_category|
|
35
|
+
if category == public_category then
|
36
|
+
@private_category = true
|
37
|
+
end
|
38
|
+
}
|
39
|
+
}
|
40
|
+
|
30
41
|
# プライベートの設定
|
31
42
|
@category.each{|category|
|
32
43
|
@config.private_category.each{|private_category|
|
@@ -191,12 +202,30 @@ module Charu
|
|
191
202
|
def get_item_private()
|
192
203
|
@item_list_private = Hash.new()
|
193
204
|
|
205
|
+
# プライベート集計
|
194
206
|
@entrys.each{|entry|
|
207
|
+
necessary = []
|
208
|
+
day_s = ""
|
195
209
|
entry.get_items().each{|item|
|
210
|
+
day_s = item.get_item_date_string()
|
196
211
|
if item.get_private_category == true then
|
197
|
-
|
212
|
+
necessary << item
|
198
213
|
end
|
199
214
|
}
|
215
|
+
@item_list_private[day_s] = necessary
|
216
|
+
}
|
217
|
+
|
218
|
+
# 配列の[]のを集計
|
219
|
+
delt = []
|
220
|
+
@item_list_private.each{|key, item|
|
221
|
+
if item == [] then
|
222
|
+
delt << key
|
223
|
+
end
|
224
|
+
}
|
225
|
+
|
226
|
+
# []を削除
|
227
|
+
delt.each{|del|
|
228
|
+
@item_list_private.delete(del)
|
200
229
|
}
|
201
230
|
return @item_list_private
|
202
231
|
end
|
@@ -206,9 +235,13 @@ module Charu
|
|
206
235
|
def get_item_private()
|
207
236
|
@item_list_private = []
|
208
237
|
@entrys.entrys.each{|entry|
|
238
|
+
i = []
|
239
|
+
s = ""
|
209
240
|
entry.get_items().each{|item|
|
210
|
-
|
241
|
+
s = item.get_item_date_string()
|
242
|
+
i << [item]
|
211
243
|
}
|
244
|
+
@item_list_private[s] = i
|
212
245
|
}
|
213
246
|
return @item_list_private
|
214
247
|
end
|
@@ -232,6 +265,8 @@ module Charu
|
|
232
265
|
# 全てのカテゴリーを取得
|
233
266
|
@all_category_list = []
|
234
267
|
@item_list.each{|key, items|
|
268
|
+
#p "key " + key
|
269
|
+
#p items
|
235
270
|
items.each{|item|
|
236
271
|
item.get_item_category().each{|category|
|
237
272
|
@all_category_list << category
|
@@ -250,7 +285,6 @@ module Charu
|
|
250
285
|
return @item_list.size() / @config.article_size
|
251
286
|
end
|
252
287
|
|
253
|
-
|
254
288
|
# アイテム数を50個とかで取り出せる
|
255
289
|
def article_size(item_list, cnt)
|
256
290
|
# [000-049] cnt 1 (1-1)*50 1*50-1
|
@@ -278,11 +312,8 @@ module Charu
|
|
278
312
|
# 配列からハッシュに変換
|
279
313
|
item_hash = Hash.new()
|
280
314
|
t.each{|items|
|
281
|
-
items.
|
282
|
-
item_hash[item.get_item_date_string()] = [item]
|
283
|
-
}
|
315
|
+
item_hash[items.first.get_item_date_string()] = items
|
284
316
|
}
|
285
|
-
|
286
317
|
return item_hash
|
287
318
|
end
|
288
319
|
|
data/lib/Charu/Config.rb
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
|
3
3
|
config = ""
|
4
|
-
config = '
|
5
|
-
# -*- encoding: utf-8 -*-
|
4
|
+
config = '# -*- encoding: utf-8 -*-
|
6
5
|
|
7
6
|
module Charu
|
8
7
|
class Config
|
9
8
|
attr_accessor :home_title, :top_home_page, :home_category, :home_description, :css_theme_path, :private_category
|
10
|
-
attr_accessor :change_log_path, :article_size, :www_html_out_path, :www_html_out_path_private
|
9
|
+
attr_accessor :change_log_path, :article_size, :www_html_out_path, :www_html_out_path_private, :public_category
|
11
10
|
attr_accessor :ftp_server, :ftp_port, :ftp_user, :ftp_pass
|
12
11
|
def initialize()
|
13
12
|
# ホームページタイトル
|
@@ -25,9 +24,12 @@ module Charu
|
|
25
24
|
# CSS Path
|
26
25
|
@css_theme_path = "./css/"
|
27
26
|
|
28
|
-
|
29
|
-
@private_category = ["Private", "P", "★", "2ch", "5ch"]
|
27
|
+
# プライベートカテゴリー
|
28
|
+
@private_category = ["Private", "P", "★", "2ch", "5ch", "PS", "Life"]
|
30
29
|
|
30
|
+
# パブリックカテゴリー
|
31
|
+
@public_category = ["Public"]
|
32
|
+
|
31
33
|
# Change_Log_path
|
32
34
|
@change_log_path = "./../ChangeLog"
|
33
35
|
|
data/lib/Charu/CreateHtml.rb
CHANGED
@@ -4,34 +4,6 @@
|
|
4
4
|
|
5
5
|
require "erb"
|
6
6
|
|
7
|
-
module Charu
|
8
|
-
class Create_Day
|
9
|
-
def initialize()
|
10
|
-
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
class Create_Days
|
15
|
-
def initialize()
|
16
|
-
changelogmemo = Charu::ChangeLogMemo.new()
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
module Charu
|
22
|
-
class Create_Category
|
23
|
-
def initialize()
|
24
|
-
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
class Create_Categorys
|
29
|
-
def initialize()
|
30
|
-
changelogmemo = Charu::ChangeLogMemo.new()
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
7
|
module Charu
|
36
8
|
class PageCounter
|
37
9
|
def initialize()
|
@@ -43,7 +15,7 @@ module Charu
|
|
43
15
|
@pages = []
|
44
16
|
while i <= @max_page do
|
45
17
|
if i == 0 then
|
46
|
-
@pages << [[i, "index.html", changelogmemo.get_item_sort_reverse(
|
18
|
+
@pages << [[i, "index.html", changelogmemo.get_item_sort_reverse(1)]]
|
47
19
|
else
|
48
20
|
@pages << [[i, "index" + i.to_s + ".html", changelogmemo.get_item_sort_reverse(i)]]
|
49
21
|
end
|
@@ -101,11 +73,10 @@ module Charu
|
|
101
73
|
|
102
74
|
def create_body()
|
103
75
|
# くっつける
|
104
|
-
p "==========="
|
105
76
|
|
106
77
|
@htmls = []
|
107
78
|
@page.each{|page, file_name, changelogmemo|
|
108
|
-
|
79
|
+
p "page " + page.to_s + " 作成中"
|
109
80
|
#p file_name
|
110
81
|
@changelogmemo = changelogmemo
|
111
82
|
|
data/lib/Charu/Template.rb
CHANGED
data/lib/Charu/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: Charu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ShiccaRorl
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|