Charu 0.0.3 → 0.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fd3b10bd5b14fc8d07251aa1c39c988c41c19ce3e104da8bc567dbf7b791e6e5
4
- data.tar.gz: 20e201450b68bac57228f71325d6df46c25218605604b56212e62fcc8c5e309a
3
+ metadata.gz: 7593e74ecba569f1651e9d2ec44fcb4acdddf9f212059d0e55df584e687e2da5
4
+ data.tar.gz: a67a1799ed53cea511548c429efc35335c02157b7df246bbe943bc29c1ef9d16
5
5
  SHA512:
6
- metadata.gz: a955ab808c8d89ff70d1c4231e6b740aebc462e5fdd92c7014b73f42108054705f404f94deed37a24180920218d0bc9363f8cc7da5e5aa447431d8a1db293741
7
- data.tar.gz: c0fb50d689a04afabcd24cd90c70b3f14a4a6f28873d10550cc829b26f7c8666bdbac4c65b14ef70170fe670da82cca0f953682e481a8352de4acdc5a7726734
6
+ metadata.gz: d6e440146ab2fc6e4f8dd827d0a5d60042c645a9269481954a450e864f12ac7e3c951bd361000a934787af97dc4a8e72647416ea242b4097e6685c2ea3e9251a
7
+ data.tar.gz: 36153ac660e56e1a1ea26c552ad032b747ef123a7c97280538386ecc3f5c4a3345f52820f109bde53ec243362fe83d03602413535deef69f08e60fe771e73859
data/lib/Charu/Config.rb CHANGED
@@ -9,7 +9,7 @@ module Charu
9
9
  @home_title = "TestPage"
10
10
 
11
11
  # ホームページトップ
12
- @top_home_page = "http://hoge.com/hoge/"
12
+ @top_home_page = "http://hoge.com/hoge/index.html"
13
13
 
14
14
  # ホームページカテゴリー
15
15
  @home_category = ["Ruby", "Python", "Java"]
@@ -29,16 +29,27 @@ module Charu
29
29
  # 一度に表示する記事数
30
30
  @article_size = 50
31
31
 
32
+ # htmlの作成先
33
+ @www_html_out_path = "./www/"
34
+
35
+ # FTPの設定
36
+
32
37
  end
33
38
  end
34
39
  end
35
40
  '
36
41
 
37
- if File.exist?("CharuConfig.rb") == false then
38
- File.open("CharuConfig.rb", "w") do |f|
42
+ # ディレクトリの確認
43
+ if Dir.exist?("./CharuConfig") == false then
44
+ # ディレクトリの作成
45
+ Dir.mkdir('CharuConfig')
46
+ end
47
+
48
+ if File.exist?("./CharuConfig/CharuConfig.rb") == false then
49
+ File.open("./CharuConfig/CharuConfig.rb", "w:utf-8") do |f|
39
50
  f.puts(config)
40
51
  end
41
52
  else
42
- require './CharuConfig'
53
+ require './CharuConfig/CharuConfig'
43
54
  end
44
55
 
@@ -0,0 +1,116 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ header = ""
4
+ header = '
5
+ <!doctype html>
6
+ <html><head>
7
+ <meta charset = "utf-8">
8
+ <meta name="name" content="content">
9
+ <meta http-equiv="Content-Style-Type" content="text/css">
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript">
11
+ <meta http-equiv="Last-Modified" content="<%= Time.now().strftime("%a, %d %b %Y %H:%M:%S") %> GMT">
12
+ <meta name="keywords" content="<%= @keyword %> ">
13
+ <meta name="description" content="<%= @description %>">
14
+ <link rel="stylesheet" href="theme/base.css" type="text/css" media="all">
15
+ <link rel="stylesheet" href="<%= @css_theme_path %>" title="<%= @home_title %>" type="text/css" media="all">
16
+ <title><%= @home_title %></title>
17
+
18
+ <style type="text/css">
19
+
20
+ </style>
21
+
22
+ </head>
23
+
24
+ <body>
25
+ <a href="<%= @top_home_page %>"><h1><%= @home_title %></h1></a>
26
+ <br>
27
+ '
28
+
29
+ body = ""
30
+ body = '
31
+ <% i = 0 %>
32
+ <% @daydata.each{|day| %>
33
+ <% if i == 0 then %>
34
+ <h1><%= day.get_Datetime().strftime("%Y年%m月%d日 (%A)") %></h1>
35
+ <% i = 1 %>
36
+ <% end %>
37
+ <% } %>
38
+
39
+ <% @daydata.each{|day| %>
40
+ <h2><span class="title"><br>
41
+ <%= day.get_tile() %></h2>
42
+
43
+ <p><%= day.get_log() %></p>
44
+ <% } %>
45
+ '
46
+
47
+
48
+ day_body = ""
49
+ day_body = '
50
+ <a href="./index.html"><h1><%= @title %></h1></a>
51
+ <br>
52
+ <body>
53
+
54
+ <% @days.each{|day| %>
55
+ <h2><span class="title">
56
+ <% link = "日記" %>
57
+ <a href="./main/index/<%= link = day[:Datetime].strftime("%Y%m%d") %>.html"><%= day[:Title] %></a></span></h2>
58
+ <div class="lm"><span class="lm">Last Update: <%= hiduke = day[:Datetime].strftime("%Y-%m-%d %H:%M:%S %A") %></span></div>
59
+ <p><%= day[:Log] %></p>
60
+ <% } %>
61
+
62
+ </body>
63
+ '
64
+
65
+
66
+ footer = ""
67
+ footer = '
68
+ </body>
69
+ <br>
70
+ <%= Time.now.strftime("%Y-%m-%d %H:%M:%S (%A)") %>
71
+ </html>
72
+ '
73
+
74
+
75
+
76
+ # ディレクトリの確認
77
+ if Dir.exist?("./CharuConfig/template") == false then
78
+ # ディレクトリの作成
79
+ Dir.mkdir('CharuConfig/template')
80
+ end
81
+
82
+ # header
83
+ if File.exist?("./CharuConfig/template/header.erb") == false then
84
+ File.open("./CharuConfig/template/header.erb", "w:utf-8") do |f|
85
+ f.puts(header)
86
+ end
87
+ else
88
+ @header = File.open("./CharuConfig/template/header.erb").read
89
+ end
90
+
91
+ # footer
92
+ if File.exist?("./CharuConfig/template/footer.erb") == false then
93
+ File.open("./CharuConfig/template/footer.erb", "w:utf-8") do |f|
94
+ f.puts(footer)
95
+ end
96
+ else
97
+ @footer = File.open("./CharuConfig/template/footer.erb").read
98
+ end
99
+
100
+ # body
101
+ if File.exist?("./CharuConfig/template/body.erb") == false then
102
+ File.open("./CharuConfig/template/body.erb", "w:utf-8") do |f|
103
+ f.puts(body)
104
+ end
105
+ else
106
+ @body = File.open("./CharuConfig/template/body.erb").read
107
+ end
108
+
109
+ # day_body
110
+ if File.exist?("./CharuConfig/template/day_body.erb") == false then
111
+ File.open("./CharuConfig/template/day_body.erb", "w:utf-8") do |f|
112
+ f.puts(day_body)
113
+ end
114
+ else
115
+ @day_body = File.open("./CharuConfig/template/day_body.erb").read
116
+ end
data/lib/Charu/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
3
  module Charu
4
- VERSION = "0.0.3"
4
+ VERSION = "0.0.4"
5
5
  end
data/lib/Charu.rb CHANGED
@@ -7,6 +7,7 @@ Bundler.require
7
7
 
8
8
  require 'Charu/ChangeLogMemo'
9
9
  require 'Charu/Config'
10
+ require 'Charu/Template'
10
11
  require 'Charu/CreateHtml'
11
12
 
12
13
 
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.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - ShiccaRorl
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-04-20 00:00:00.000000000 Z
11
+ date: 2018-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -78,11 +78,7 @@ files:
78
78
  - lib/Charu/ChangeLogMemo.rb
79
79
  - lib/Charu/Config.rb
80
80
  - lib/Charu/CreateHtml.rb
81
- - lib/Charu/template/all_body.erb
82
- - lib/Charu/template/body.erb
83
- - lib/Charu/template/day_body.erb
84
- - lib/Charu/template/footer.erb
85
- - lib/Charu/template/header.erb
81
+ - lib/Charu/template.rb
86
82
  - lib/Charu/version.rb
87
83
  homepage: https://rubygems.org/gems/Charu
88
84
  licenses:
@@ -1,8 +0,0 @@
1
-
2
- <% @days.get_days().each{|day| %>
3
- <h2><span class="title">
4
- <a href="./index/<%= day.get_day_s() %>.html"><%= day.get_tile() %></a></span></h2>
5
- <div class="lm"><span class="lm">Last Update: <%= day.get_Datetime_s() %></span></div>
6
- <p><%= day.get_log() %></p>
7
- <% } %>
8
-
@@ -1,16 +0,0 @@
1
-
2
- <% i = 0 %>
3
- <% @daydata.each{|day| %>
4
- <% if i == 0 then %>
5
- <h1><%= day.get_Datetime().strftime("%Y年%m月%d日 (%A)") %></h1>
6
- <% i = 1 %>
7
- <% end %>
8
- <% } %>
9
-
10
-
11
- <% @daydata.each{|day| %>
12
- <h2><span class="title"><br>
13
- <%= day.get_tile() %></h2>
14
-
15
- <p><%= day.get_log() %></p>
16
- <% } %>
@@ -1,13 +0,0 @@
1
- <a href="./index.html"><h1><%= @title %></h1></a>
2
- <br>
3
- <body>
4
-
5
- <% @days.each{|day| %>
6
- <h2><span class="title">
7
- <% link = "日記" %>
8
- <a href="./main/index/<%= link = day[:Datetime].strftime("%Y%m%d") %>.html"><%= day[:Title] %></a></span></h2>
9
- <div class="lm"><span class="lm">Last Update: <%= hiduke = day[:Datetime].strftime("%Y-%m-%d %H:%M:%S %A") %></span></div>
10
- <p><%= day[:Log] %></p>
11
- <% } %>
12
-
13
- </body>
@@ -1,5 +0,0 @@
1
-
2
- </body>
3
- <br>
4
- <%= Time.now.strftime("%Y-%m-%d %H:%M:%S (%A)") %>
5
- </html>
@@ -1,37 +0,0 @@
1
- <%# -*- encoding: utf-8 -*- %>
2
- <!doctype html>
3
- <html><head>
4
- <meta charset = "utf-8">
5
- <meta name="name" content="content">
6
- <meta http-equiv="Content-Style-Type" content="text/css">
7
- <meta http-equiv="Content-Script-Type" content="text/javascript">
8
- <meta http-equiv="Last-Modified" content="<%= Time.now().strftime("%a, %d %b %Y %H:%M:%S") %> GMT">
9
- <meta name="keywords" content="<%= @keyword %> ">
10
- <meta name="description" content="<%= @description %>">
11
- <link rel="stylesheet" href="theme/base.css" type="text/css" media="all">
12
- <link rel="stylesheet" href="<%= @css_theme_path %>" title="<%= @title %>" type="text/css" media="all">
13
- <title><%= @title %></title>
14
-
15
- <style type="text/css">
16
-
17
- </style>
18
-
19
- </head>
20
-
21
- <body>
22
- <a href="http://www.geocities.jp/shiccarorl/index.html"><h1>ニャンモナイトとその日暮らし</h1></a>
23
- <br>
24
-
25
- <table style="text-align: left; width: 100%;" border="1" >
26
- <tbody>
27
- <tr>
28
- <td style="vertical-align: top;"><a href="./book/index.html"><h2>読書</h2></a><br />
29
- </td>
30
- <td style="vertical-align: top;"><a href="./FreeSoft/index.html"><h2>フリーソフト</h2><br />
31
- </td>
32
- <td style="vertical-align: top;"><a href="./download/index.html"><h2>download</h2><br />
33
- </td>
34
- </tr>
35
- </tbody>
36
- </table>
37
-