Charu 0.0.11 → 0.0.12
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/Charu.gemspec +1 -1
- data/README.md +8 -1
- data/lib/Charu/Config.rb +25 -2
- data/lib/Charu/CreateHtml.rb +17 -4
- data/lib/Charu/FTP.rb +22 -9
- data/lib/Charu/Template.rb +47 -5
- data/lib/Charu/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a8dcb08864c8da9fc85ab8573f3f904583fd866
|
4
|
+
data.tar.gz: 40498a9f9b694a83e11c9c7fde1bc5813b634a01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0ae0f161ac5dca20c08bed648bed7f2eb35a36aa678bd2484c79139bd02be8f2f041ed66bd8662a8b1d0fda468a5a077deaad481b210907cd5fcea1c0a779a5
|
7
|
+
data.tar.gz: 9662aab1d5f8db739c1457970109e3a4e71cf0ebf32b2d1d3013d829cb1af2633fa8b15b1e572d492357f69500f8b041eaa0d6f9f702d1b8e3edb4323111e7ba
|
data/Charu.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["shicca.rorl@gmail.com"]
|
11
11
|
|
12
12
|
spec.summary = %q{ChangeLogMemo Html Converter}
|
13
|
-
spec.description = %q{ChangeLogを日記にしているなら便利かも。ChangeLogMemoとは?[横着プログラミング 第1回: Unixのメモ技術](http://0xcc.net/unimag/1/)[Change Log メモを試してみよう](http://at-aka.blogspot.jp/p/change-log.html)}
|
13
|
+
spec.description = %q{ChangeLogを日記にしているなら便利かも。ChangeLogMemoとは?[横着プログラミング 第1回: Unixのメモ技術](http://0xcc.net/unimag/1/)[Change Log メモを試してみよう](http://at-aka.blogspot.jp/p/change-log.html) CSSは[tDiary](http://www.tdiary.org/)のが使えます。}
|
14
14
|
spec.homepage = "https://rubygems.org/gems/Charu"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
data/README.md
CHANGED
@@ -9,7 +9,7 @@ TODO: Delete this and the text above, and describe your gem
|
|
9
9
|
Add this line to your application's Gemfile:
|
10
10
|
|
11
11
|
```ruby
|
12
|
-
gem
|
12
|
+
gem Charu
|
13
13
|
```
|
14
14
|
|
15
15
|
And then execute:
|
@@ -22,6 +22,11 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
## Usage
|
24
24
|
|
25
|
+
### 必要なプログラム
|
26
|
+
```
|
27
|
+
sudo apt-get install lftp
|
28
|
+
```
|
29
|
+
|
25
30
|
### 初期化
|
26
31
|
```
|
27
32
|
./CharuConfig/CharuConfig.rb
|
@@ -46,6 +51,8 @@ bundle exec Charu
|
|
46
51
|
|
47
52
|
パブリックの[Public]:のカテゴリーが付いていないもの以外はHTML化しないです。
|
48
53
|
|
54
|
+
FTPアップロードに「lftp」使っています。
|
55
|
+
|
49
56
|
## Development
|
50
57
|
|
51
58
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/Charu/Config.rb
CHANGED
@@ -49,8 +49,8 @@ module Charu
|
|
49
49
|
@ftp_user = ""
|
50
50
|
@ftp_pass = ""
|
51
51
|
|
52
|
-
|
53
|
-
|
52
|
+
# Wgetのパス
|
53
|
+
@wget_path = ""
|
54
54
|
|
55
55
|
end
|
56
56
|
end
|
@@ -58,6 +58,17 @@ end
|
|
58
58
|
|
59
59
|
'
|
60
60
|
|
61
|
+
autoupload_lftp = ""
|
62
|
+
autoupload_lftp = '
|
63
|
+
<% require "./CharuConfig/CharuConfig" %>
|
64
|
+
<% config = Charu::Config.new() %>
|
65
|
+
|
66
|
+
open "<%= config.ftp_server %>" -p <%= config.ftp_port %> -u "<%= config.ftp_user %>","<%= config.ftp_pass %>"
|
67
|
+
cd "./"
|
68
|
+
lcd "<%= config.www_html_out_path %>"
|
69
|
+
mirror -R
|
70
|
+
'
|
71
|
+
|
61
72
|
# ディレクトリの確認
|
62
73
|
if Dir.exist?("./CharuConfig") == false then
|
63
74
|
# ディレクトリの作成
|
@@ -72,3 +83,15 @@ else
|
|
72
83
|
require './CharuConfig/CharuConfig'
|
73
84
|
end
|
74
85
|
|
86
|
+
|
87
|
+
#autoupload_lftp
|
88
|
+
if File.exist?("./CharuConfig/autoupload.lftp") == false then
|
89
|
+
File.open("./CharuConfig/autoupload.lftp", "w:utf-8") do |f|
|
90
|
+
f.puts(autoupload_lftp)
|
91
|
+
end
|
92
|
+
else
|
93
|
+
|
94
|
+
end
|
95
|
+
|
96
|
+
|
97
|
+
|
data/lib/Charu/CreateHtml.rb
CHANGED
@@ -40,13 +40,15 @@ module Charu
|
|
40
40
|
@page_max = page_max
|
41
41
|
@page = page
|
42
42
|
|
43
|
-
@header
|
44
|
-
@footer
|
45
|
-
@body
|
46
|
-
@day_body
|
43
|
+
@header = File.open("./CharuConfig/template/header.erb").read
|
44
|
+
@footer = File.open("./CharuConfig/template/footer.erb").read
|
45
|
+
@body = File.open("./CharuConfig/template/body.erb").read
|
46
|
+
@day_body = File.open("./CharuConfig/template/day_body.erb").read
|
47
|
+
@autoupload_lftp = File.open("./CharuConfig/autoupload.lftp").read
|
47
48
|
|
48
49
|
self.keyword()
|
49
50
|
self.create_body()
|
51
|
+
self.lftp()
|
50
52
|
end
|
51
53
|
|
52
54
|
def keyword()
|
@@ -122,5 +124,16 @@ module Charu
|
|
122
124
|
File.write(@config.www_html_out_path + @file_name, html)
|
123
125
|
}
|
124
126
|
end
|
127
|
+
|
128
|
+
def lftp()
|
129
|
+
erb = ERB.new(@autoupload_lftp)
|
130
|
+
lftp = erb.result(binding)
|
131
|
+
|
132
|
+
begin
|
133
|
+
File.write("./CharuConfig/autoupload.lftp", lftp)
|
134
|
+
rescue
|
135
|
+
p "書き込みエラー"
|
136
|
+
end
|
137
|
+
end
|
125
138
|
end
|
126
139
|
end
|
data/lib/Charu/FTP.rb
CHANGED
@@ -22,25 +22,26 @@ module Charu
|
|
22
22
|
def put_file()
|
23
23
|
# 相対パスから絶対パスへ
|
24
24
|
file_list = []
|
25
|
-
@list.each{|file|
|
26
|
-
file_list << File::expand_path(file)
|
25
|
+
@list.each{|file| # 絶対パスを取得する
|
26
|
+
file_list << [File::expand_path(file) ,File.dirname(file)]
|
27
27
|
}
|
28
28
|
|
29
29
|
# ディレクトリかファイルか判断
|
30
|
-
file_list.each{|file|
|
30
|
+
file_list.each{|file, dir|
|
31
|
+
dir.sub!(@config.www_html_out_path, "")
|
31
32
|
if FileTest.directory? file
|
32
33
|
# ディレクトリのときの処理
|
33
34
|
@dir_list << file
|
34
35
|
|
35
36
|
elsif FileTest.file? file
|
36
37
|
# ファイルのときの処理
|
37
|
-
@file_list << file
|
38
|
+
@file_list << [file, dir + "/"]
|
38
39
|
else
|
39
40
|
raise print('ファイルでもディレクトリでもない')
|
40
41
|
end
|
41
42
|
}
|
42
|
-
p @dir_list
|
43
|
-
p @file_list
|
43
|
+
#p @dir_list
|
44
|
+
#p @file_list
|
44
45
|
|
45
46
|
ftp = Net::FTP.new
|
46
47
|
ftp.connect(@server, @port)
|
@@ -55,10 +56,22 @@ module Charu
|
|
55
56
|
#puts ftp.pwd
|
56
57
|
|
57
58
|
# アップロード
|
58
|
-
@file_list.each{|file|
|
59
|
-
|
60
|
-
|
59
|
+
@file_list.each{|file, dir|
|
60
|
+
#print file + "\n"
|
61
|
+
#print dir + "\n"
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
#ftp.put(file)
|
66
|
+
#print "\n"
|
61
67
|
}
|
68
|
+
|
69
|
+
|
70
|
+
command = "lftp -f ./CharuConfig/autoupload.lftp"
|
71
|
+
system(command)
|
72
|
+
|
73
|
+
|
74
|
+
|
62
75
|
print "完了\n"
|
63
76
|
puts ftp.pwd
|
64
77
|
|
data/lib/Charu/Template.rb
CHANGED
@@ -15,11 +15,19 @@ header = '<!doctype html>
|
|
15
15
|
<title><%= @config.home_title %></title>
|
16
16
|
|
17
17
|
<style type="text/css">
|
18
|
+
.title{
|
19
|
+
font-size: 30pt;
|
20
|
+
}
|
21
|
+
.title_2:hover{
|
22
|
+
font-size: 40pt;
|
23
|
+
color: black;
|
24
|
+
}
|
18
25
|
.page{
|
19
26
|
font-size: 20pt;
|
27
|
+
clear: both;
|
20
28
|
}
|
21
29
|
code{
|
22
|
-
font-size:
|
30
|
+
font-size: 20pt;
|
23
31
|
color: white;
|
24
32
|
background-color: black;
|
25
33
|
}
|
@@ -27,15 +35,31 @@ header = '<!doctype html>
|
|
27
35
|
color: #FF0000;
|
28
36
|
}
|
29
37
|
#page_a:hover{
|
30
|
-
font-size:
|
38
|
+
font-size: 30pt;
|
31
39
|
color: black;
|
32
40
|
}
|
41
|
+
.menu{
|
42
|
+
font-size: 25pt;
|
43
|
+
width: 25%;
|
44
|
+
float: left;
|
45
|
+
}
|
46
|
+
.reset{
|
47
|
+
clear: both;
|
48
|
+
}
|
49
|
+
.left1{
|
50
|
+
width: 20%;
|
51
|
+
float: left;
|
52
|
+
}
|
53
|
+
.left2{
|
54
|
+
width: 80%;
|
55
|
+
float: left;
|
56
|
+
}
|
33
57
|
</style>
|
34
58
|
|
35
59
|
</head>
|
36
60
|
|
37
61
|
<body>
|
38
|
-
<a href="<%= @config.top_home_page %>"><
|
62
|
+
<a class= "title" href="<%= @config.top_home_page %>"><p class="title_2" style="text-align: center"><%= @config.home_title %></p></a>
|
39
63
|
<hr>
|
40
64
|
'
|
41
65
|
|
@@ -51,6 +75,23 @@ body = '
|
|
51
75
|
<p>ページ</p>
|
52
76
|
</center>
|
53
77
|
|
78
|
+
|
79
|
+
<div class="left1"><p> </p></div>
|
80
|
+
<div class="menu"><a href="./book/index.html">Book</a></div>
|
81
|
+
<div class="menu"><a href="./freesoft/index.html">FreeSoft</a></div>
|
82
|
+
<div class="menu"><a href="./download/index.html">Download</a></div>
|
83
|
+
|
84
|
+
|
85
|
+
<div class="reset"></div>
|
86
|
+
|
87
|
+
|
88
|
+
<div class="left1">
|
89
|
+
<p>ページ</p>
|
90
|
+
</div>
|
91
|
+
|
92
|
+
|
93
|
+
<div class="left2">
|
94
|
+
|
54
95
|
<% @changelogmemo.each{|key, items| %>
|
55
96
|
<% items.each{|item| %>
|
56
97
|
<h2><span class="title">
|
@@ -61,6 +102,8 @@ body = '
|
|
61
102
|
<% } %>
|
62
103
|
<% } %>
|
63
104
|
|
105
|
+
</div>
|
106
|
+
|
64
107
|
<center class="page">
|
65
108
|
<a href="./index.html">1</a>
|
66
109
|
<% i = 1 %>
|
@@ -120,8 +163,6 @@ footer = '
|
|
120
163
|
</html>
|
121
164
|
'
|
122
165
|
|
123
|
-
|
124
|
-
|
125
166
|
# ディレクトリの確認
|
126
167
|
if Dir.exist?("./CharuConfig/template") == false then
|
127
168
|
# ディレクトリの作成
|
@@ -163,3 +204,4 @@ if File.exist?("./CharuConfig/template/day_body.erb") == false then
|
|
163
204
|
else
|
164
205
|
@day_body = File.open("./CharuConfig/template/day_body.erb").read
|
165
206
|
end
|
207
|
+
|
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.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ShiccaRorl
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-07-
|
11
|
+
date: 2018-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -67,7 +67,7 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
description: 'ChangeLogを日記にしているなら便利かも。ChangeLogMemoとは?[横着プログラミング 第1回: Unixのメモ技術](http://0xcc.net/unimag/1/)[Change
|
70
|
-
Log メモを試してみよう](http://at-aka.blogspot.jp/p/change-log.html)'
|
70
|
+
Log メモを試してみよう](http://at-aka.blogspot.jp/p/change-log.html) CSSは[tDiary](http://www.tdiary.org/)のが使えます。'
|
71
71
|
email:
|
72
72
|
- shicca.rorl@gmail.com
|
73
73
|
executables:
|