hikiutils 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LectureNotes +125 -0
- data/README.md +11 -5
- data/Rakefile +20 -1
- data/docs/README.hiki +8 -4
- data/docs/README.hiki.html +55 -0
- data/docs/{README.ja.hiki → README_ja.hiki} +10 -6
- data/docs/README_ja.hiki.html +50 -0
- data/hikiutils.gemspec +1 -1
- data/hikiutils.wiki/Home.md +65 -0
- data/hikiutils.wiki/README.md +65 -0
- data/hikiutils.wiki/README_ja.md +65 -0
- data/lib/hikiutils/infodb.rb +14 -1
- data/lib/hikiutils/tmarshal.rb +2 -0
- data/lib/hikiutils/version.rb +1 -1
- data/lib/hikiutils.rb +88 -39
- data/tmp.txt +63 -0
- metadata +11 -6
- data/lib/#hikiutils.rb# +0 -278
- data/lib/.#hikiutils.rb +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bda58449bae0510c3a9093331d8d6c6ea48ce376
|
4
|
+
data.tar.gz: 9b161e95894f2a018b609a761644af5f5c4a0207
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95e0fa61f8b53a2f6460bce9b641b3013b67d277216ad534c155278d8dea7d3d2ac6affd6bdaf3c2a1514a99930de6ae5342ec2171ba82451463ef4f4d52b2cd
|
7
|
+
data.tar.gz: edead024fbf1958267db4e1eb5c3676b34d0e1c1d139c254434251e111961eb652b8cd616136149be93484c921f4fc38658c6fb88221be87d6996babc49841f5
|
data/LectureNotes
ADDED
@@ -0,0 +1,125 @@
|
|
1
|
+
!�ֵ�����
|
2
|
+
!!�����ر����
|
3
|
+
!!!2016ǯ��
|
4
|
+
:�ճش�:
|
5
|
+
*1������[[����ԥ塼���齬A|CompAInfo]]
|
6
|
+
*1������[[����ʳس���|IntroInfo16]]
|
7
|
+
*2������[[����ʳؤΤ���ο��ر齬1��2(ô������ë) �������|MathEx16]]
|
8
|
+
*3������[[���������½�|Maple16]]
|
9
|
+
*3������[[��ǥ��ʪ����|ModelPhys16]]
|
10
|
+
|
11
|
+
!!!2015ǯ��
|
12
|
+
:���ش�:
|
13
|
+
*3����(����¾)��[[���ͷ�|NumRecipe15]]
|
14
|
+
*3����(����¾)��[[�ΰ�½�|https://luna.kwansei.ac.jp/webapps/blackboard/execute/modulepage/view?course_id=_112225_1&cmp_tab_id=_135663_1&editMode=true&mode=cpview]]
|
15
|
+
*��ر���[[�ޥ���������륷�ߥ�졼���������|https://luna.kwansei.ac.jp/webapps/blackboard/execute/modulepage/view?course_id=_115632_1&cmp_tab_id=_139498_1&editMode=true&mode=cpview]]
|
16
|
+
|
17
|
+
:�ճش�:
|
18
|
+
*1������[[����ԥ塼���齬A|CompAInfo]]
|
19
|
+
*1������[[����ʳس���|IntroInfo15]]
|
20
|
+
*2������[[����ʳؤΤ���ο��ر齬1��2(ô������ë) �������|MathEx15]]
|
21
|
+
*3������[[���������½�|Maple15]]
|
22
|
+
*3������[[��ǥ��ʪ����|ModelPhys15]]
|
23
|
+
|
24
|
+
!!!2014ǯ��
|
25
|
+
:���ش�:
|
26
|
+
*1����(����)��[[Computer�齬A|CompAMath14]]
|
27
|
+
*3����(����¾)��[[���ͷ�|NumRecipe14]]
|
28
|
+
*3����(����¾)��[[�ΰ�½�|Seminar14]]
|
29
|
+
*��ر���[[�ޥ���������륷�ߥ�졼���������|MultiScale14]]
|
30
|
+
|
31
|
+
:�ճش�:
|
32
|
+
*1������[[����ԥ塼���齬A|FirstYearEducation14]]
|
33
|
+
*1������[[����ʳس���|IntroInfo14]]
|
34
|
+
*2������[[MathEx14]]
|
35
|
+
*3������[[Maple14]]
|
36
|
+
*3������[[��ǥ��ʪ����|ModelPhys14]]
|
37
|
+
|
38
|
+
!!!2013ǯ��
|
39
|
+
:���ش�:
|
40
|
+
*1����(����)��[[Computer�齬A|CompAMath]]
|
41
|
+
*3����(����¾)��[[���ͷ�|NumRecipe13]]
|
42
|
+
*��ر���[[�ޥ���������륷�ߥ�졼���������|MultiScale13]]
|
43
|
+
|
44
|
+
:�ճش�:
|
45
|
+
*1������[[FirstYearEducation13]]
|
46
|
+
*1������[[InfoIntro13]]
|
47
|
+
*2������[[MathEx12]]
|
48
|
+
*3������[[Maple13]]
|
49
|
+
*3������[[��ǥ��ʪ����|ModelPhys13]]
|
50
|
+
|
51
|
+
!!!2012ǯ��
|
52
|
+
:���ش�:
|
53
|
+
*1����(����)��[[Computer�齬A|CompAMath]]
|
54
|
+
*3����(����¾)��[[���ͷ�|NumRecipe12]]
|
55
|
+
*��ر���[[�ޥ���������륷�ߥ�졼���������|MultiScale12]]
|
56
|
+
|
57
|
+
:�ճش�:
|
58
|
+
*1������[[FirstYearEducation12]]
|
59
|
+
*2������[[InfoIntro12]]
|
60
|
+
*2������[[MathEx12]]
|
61
|
+
*3������[[Maple12]]
|
62
|
+
*3������[[��ǥ��ʪ����|ModelPhys12]]
|
63
|
+
|
64
|
+
!!!2011ǯ��
|
65
|
+
:�ճش�:
|
66
|
+
*�������[[FirstYearEducation]]
|
67
|
+
*�������[[MathEx11]]
|
68
|
+
*��������[[���������齬|Maple11]]
|
69
|
+
*��������[[��ǥ��ʪ����|ModelingPhys11]]
|
70
|
+
:���ش�:
|
71
|
+
*�����(����)��[[Computer�齬A|CompAMath]]
|
72
|
+
*������(����¾)��[[���ͷ�|NumRecipe11]]
|
73
|
+
|
74
|
+
!!!2010ǯ��
|
75
|
+
:�ճش�:
|
76
|
+
*[[����ԥ塼���齬A(����) |FirstYear10]]
|
77
|
+
*[[���������齬|Maple10]]
|
78
|
+
*[[�˥塼�ޥƥꥢ�롦�ǥ�����|NewMaterials10]]
|
79
|
+
*[[����ʳؤΤ���ο��ر齬|MathEx10]]
|
80
|
+
:���ش�:
|
81
|
+
*[[�ޥ���������륷�ߥ�졼���������|MultiScale10]]
|
82
|
+
*[[���ͷ�|NumRecipe10]]
|
83
|
+
*[[����ԥ塼���齬A(����) |CompExA10-2]]
|
84
|
+
!!!2009ǯ��
|
85
|
+
*[[����ԥ塼���齬A|http://ist.ksc.kwansei.ac.jp/~nishitani/Lectures/CompExA/index.html]]
|
86
|
+
*[[���������齬|Maple09]]
|
87
|
+
*[[�˥塼�ޥƥꥢ�롦�ǥ�����|NewMaterials09]]
|
88
|
+
*[[���ͷ�|NumRecipe09]]
|
89
|
+
!!!2008ǯ��
|
90
|
+
*[[���������齬(ʪ��������ԥ塼���齬)|http://ist.ksc.kwansei.ac.jp/~nishitani/Lectures/Maple/index.html]]
|
91
|
+
*[[�˥塼�ޥƥꥢ�롦�ǥ�����|NewMaterials08]]
|
92
|
+
*[[���ͷ�|NumRecipe08]]
|
93
|
+
!!!2007ǯ��
|
94
|
+
*[[���������齬(ʪ��������ԥ塼���齬)|http://ist.ksc.kwansei.ac.jp/~nishitani/Lectures/Maple/index.html]]
|
95
|
+
*[[�˥塼�ޥƥꥢ�롦�ǥ�����|NewMaterials07]]
|
96
|
+
*[[���ͷ�|NumRecipe07]]
|
97
|
+
*[[���ͷ��齬|LinuxEx]]
|
98
|
+
!!!2006ǯ��
|
99
|
+
*[[���������齬(ʪ��������ԥ塼���齬)|http://ist.ksc.kwansei.ac.jp/~nishitani/Lectures/2006/Maple/index.html]]
|
100
|
+
*[[�˥塼�ޥƥꥢ�롦�ǥ�����|http://ist.ksc.kwansei.ac.jp/~nishitani/Lectures/2006/NewMaterialDesign/index.html]]
|
101
|
+
*[[���ͷ�|http://ist.ksc.kwansei.ac.jp/~nishitani/Lectures/2006/NumRecipe/index.html]]
|
102
|
+
*[[���ͷ��齬|http://ist.ksc.kwansei.ac.jp/~nishitani/Lectures/2006/NumRecipeEx/index.html]]
|
103
|
+
!!!2005ǯ��
|
104
|
+
*[[����ԥ塼���齬|http://ist.ksc.kwansei.ac.jp/~nishitani/Lectures/2005/ExComp/index.html]]
|
105
|
+
*[[���ͷ�|http://ist.ksc.kwansei.ac.jp/~nishitani/Lectures/./NumRecipe/index.html]]
|
106
|
+
*[[���ͷ��齬|http://ist.ksc.kwansei.ac.jp/~nishitani/Lectures/2005/NumRecipeEx/index.html]]
|
107
|
+
*[[�˥塼�ޥƥꥢ�롦�ǥ�����|http://ist.ksc.kwansei.ac.jp/~nishitani/Lectures/2005/NewMaterialDesign/index.html]]
|
108
|
+
*[[���������齬|http://ist.ksc.kwansei.ac.jp/~nishitani/Lectures/2005/Maple/index.html]]
|
109
|
+
*[[�ץ�����ߥ�II|http://ist.ksc.kwansei.ac.jp/~nishitani/Lectures/prog2/class3.htm]]
|
110
|
+
!!!2004ǯ��
|
111
|
+
*[[����ԥ塼���齬|http://ist.ksc.kwansei.ac.jp/~nishitani/Lectures/2004/ExComp/index.html]]
|
112
|
+
*[[���ͷ�|http://ist.ksc.kwansei.ac.jp/~nishitani/Lectures/2004/NumericalRecipe/index.html]]
|
113
|
+
*[[���ͷ��齬|http://ist.ksc.kwansei.ac.jp/~nishitani/Lectures/2004/ExNumericalRecipe/index.html]]
|
114
|
+
*�Ҥ礦�������ץ�å�
|
115
|
+
**[[ʪ����ǥ�λ�в�|http://ist.ksc.kwansei.ac.jp/~nishitani/Lectures/2004/HyogoOpenCollege/OpenCollege.pdf]]
|
116
|
+
**[[Maple�Ҳ�|http://ist.ksc.kwansei.ac.jp/~nishitani/Lectures/2004/HyogoOpenCollege/ciec.pdf]]
|
117
|
+
**[[Maple������ץ�|http://ist.ksc.kwansei.ac.jp/~nishitani/Lectures/2004/HyogoOpenCollege/Formatted.mw]]
|
118
|
+
*[[�˥塼�ޥƥꥢ�롦�ǥ�����|http://ist.ksc.kwansei.ac.jp/~nishitani/Lectures/2004/NewMaterialDesign/index.html]]
|
119
|
+
*[[���������齬|http://ist.ksc.kwansei.ac.jp/~nishitani/Lectures/2004/Maple/index.html]]
|
120
|
+
!�������(2003ǯ����)
|
121
|
+
*[[�ù��ץ�������(�Ÿ�) |http://ist.ksc.kwansei.ac.jp/~nishitani/Lectures/Kyoto/Solidification/index.html]]
|
122
|
+
*[[��������|http://ist.ksc.kwansei.ac.jp/~nishitani/Lectures/Kyoto/CompMatSci/index.html]]
|
123
|
+
*[[ʪ�����ر齬I |http://ist.ksc.kwansei.ac.jp/~nishitani/Lectures/Kyoto/Exercise/index.html]]
|
124
|
+
*[[��������|http://ist.ksc.kwansei.ac.jp/~nishitani/Lectures/Kyoto/CompMath/index.html]]
|
125
|
+
*[[ʪ�����������ʷ�����������)|http://ist.ksc.kwansei.ac.jp/~nishitani/Lectures/Kyoto/Introductions/index.html]]
|
data/README.md
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
# hikiutils
|
2
2
|
Utilities for helping hiki editing.
|
3
3
|
|
4
|
-
#
|
4
|
+
# Features
|
5
5
|
Direct file handling utility for hiki text, cache and rsync of local ang global hiki sites.
|
6
6
|
|
7
7
|
|
8
8
|
# Operation
|
9
|
+
|
9
10
|
"hiki" is the command name.
|
10
11
|
|
11
12
|
```tcsh
|
@@ -16,7 +17,7 @@ Usage: hiki [options]
|
|
16
17
|
-s, --show show sources
|
17
18
|
-a, --add add sources info
|
18
19
|
-t, --target [VAL] set target number
|
19
|
-
-
|
20
|
+
-e, --edit FILE open file
|
20
21
|
-l, --list [FILE] list files
|
21
22
|
-u, --update [FILE] update file
|
22
23
|
-r, --rsync rsync files
|
@@ -24,15 +25,19 @@ Usage: hiki [options]
|
|
24
25
|
|
25
26
|
## Installation
|
26
27
|
Installed by
|
28
|
+
|
27
29
|
```
|
28
|
-
|
30
|
+
$ gem install hikimode
|
29
31
|
```
|
32
|
+
|
30
33
|
At the first time of hiki operation, hikirc file is created at home dir.
|
34
|
+
|
31
35
|
```
|
32
36
|
bob% cat ~/.hikirc
|
33
37
|
---
|
34
|
-
:target:
|
35
|
-
:editor_command:
|
38
|
+
:target: 1
|
39
|
+
:editor_command: open -a mi
|
40
|
+
:browser: firefox
|
36
41
|
:srcs:
|
37
42
|
- :nick_name: hoge
|
38
43
|
:local_dir: hogehoge
|
@@ -40,6 +45,7 @@ bob% cat ~/.hikirc
|
|
40
45
|
:global_dir: hoge@global_host:/hoge
|
41
46
|
:global_uri: http://hoge
|
42
47
|
```
|
48
|
+
|
43
49
|
The directly editing of hikirc file is much easier than using -a option.
|
44
50
|
Each hiki utility option runs, assuming the editing files lacating locally.
|
45
51
|
|
data/Rakefile
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
2
|
require 'yard'
|
3
3
|
require "rake/testtask"
|
4
|
+
p base_path = File.expand_path('..', __FILE__)
|
5
|
+
p basename = File.basename(base_path)
|
4
6
|
|
5
7
|
#task :default => :test
|
6
8
|
task :default do
|
@@ -10,7 +12,7 @@ end
|
|
10
12
|
|
11
13
|
desc "make documents by yard"
|
12
14
|
task :yard do
|
13
|
-
|
15
|
+
hiki2md_all(basename)
|
14
16
|
YARD::Rake::YardocTask.new
|
15
17
|
end
|
16
18
|
|
@@ -21,3 +23,20 @@ Rake::TestTask.new(:test) do |t|
|
|
21
23
|
end
|
22
24
|
|
23
25
|
#task :default => :spec
|
26
|
+
|
27
|
+
def hiki2md_all(basename)
|
28
|
+
files = Dir.entries('docs')
|
29
|
+
files.each{|file|
|
30
|
+
name=file.split('.')
|
31
|
+
if name[1]=='hiki' then
|
32
|
+
p command="hiki2md docs/#{name[0]}.hiki > #{basename}.wiki/#{name[0]}.md"
|
33
|
+
system command
|
34
|
+
end
|
35
|
+
}
|
36
|
+
system "cp #{basename}.wiki/README_ja.md README.md"
|
37
|
+
system "cp #{basename}.wiki/README_ja.md #{basename}.wiki/Home.md"
|
38
|
+
system "cp docs/*.gif #{basename}.wiki"
|
39
|
+
system "cp docs/*.gif doc"
|
40
|
+
system "cp docs/*.png #{basename}.wiki"
|
41
|
+
system "cp docs/*.png doc"
|
42
|
+
end
|
data/docs/README.hiki
CHANGED
@@ -2,7 +2,8 @@
|
|
2
2
|
Utilities for helping hiki editing.
|
3
3
|
|
4
4
|
!Discriptions
|
5
|
-
Direct file handling utility for hiki text
|
5
|
+
Direct file handling utility for hiki text and cache,
|
6
|
+
and rsync between local and global hiki sites.
|
6
7
|
|
7
8
|
|
8
9
|
!Operation
|
@@ -23,11 +24,13 @@ Usage: hiki [options]
|
|
23
24
|
>>>
|
24
25
|
|
25
26
|
!! Installation
|
27
|
+
|
26
28
|
Installed by
|
27
|
-
|
29
|
+
|
28
30
|
$ gem install hikimode
|
29
|
-
|
31
|
+
|
30
32
|
At the first time of hiki operation, hikirc file is created at home dir.
|
33
|
+
|
31
34
|
<<<
|
32
35
|
bob% cat ~/.hikirc
|
33
36
|
---
|
@@ -39,7 +42,8 @@ bob% cat ~/.hikirc
|
|
39
42
|
:local_uri: http://localhost/~hoge
|
40
43
|
:global_dir: hoge@global_host:/hoge
|
41
44
|
:global_uri: http://hoge
|
42
|
-
>>>
|
45
|
+
>>>
|
46
|
+
|
43
47
|
The directly editing of hikirc file is much easier than using -a option.
|
44
48
|
Each hiki utility option runs, assuming the editing files lacating locally.
|
45
49
|
|
@@ -0,0 +1,55 @@
|
|
1
|
+
<!DOCTYPE html
|
2
|
+
PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
3
|
+
"http://www.w3.org/TR/html4/loose.dtd">
|
4
|
+
<html lang="ja">
|
5
|
+
<html>
|
6
|
+
<head>
|
7
|
+
<meta http-equiv="Content-Language" content="ja">
|
8
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
9
|
+
<title></title>
|
10
|
+
</head>
|
11
|
+
<body>
|
12
|
+
<h1>hikiutils</h1>
|
13
|
+
<p>Utilities for helping hiki editing.</p>
|
14
|
+
<h1>Discriptions</h1>
|
15
|
+
<p>Direct file handling utility for hiki text and cache,
|
16
|
+
and rsync between local and global hiki sites.</p>
|
17
|
+
<h1>Operation</h1>
|
18
|
+
<p>"hiki" is the command name.</p>
|
19
|
+
<pre class="prettyprint">bob% hiki
|
20
|
+
hiki says 'Hello world'.
|
21
|
+
Usage: hiki [options]
|
22
|
+
-v, --version show program Version.
|
23
|
+
-s, --show show sources
|
24
|
+
-a, --add add sources info
|
25
|
+
-t, --target [VAL] set target number
|
26
|
+
-o, --open [FILE] open file
|
27
|
+
-l, --list [FILE] list files
|
28
|
+
-u, --update [FILE] update file
|
29
|
+
-r, --rsync rsync files</pre>
|
30
|
+
<h2>Installation</h2>
|
31
|
+
<p>Installed by</p>
|
32
|
+
<pre>$ gem install hikimode</pre>
|
33
|
+
<p>At the first time of hiki operation, hikirc file is created at home dir.</p>
|
34
|
+
<pre>bob% cat ~/.hikirc
|
35
|
+
---
|
36
|
+
:target: 0
|
37
|
+
:editor_command: emacs
|
38
|
+
:srcs:
|
39
|
+
- :nick_name: hoge
|
40
|
+
:local_dir: hogehoge
|
41
|
+
:local_uri: http://localhost/~hoge
|
42
|
+
:global_dir: hoge@global_host:/hoge
|
43
|
+
:global_uri: http://hoge</pre>
|
44
|
+
<p>The directly editing of hikirc file is much easier than using -a option.
|
45
|
+
Each hiki utility option runs, assuming the editing files lacating locally.</p>
|
46
|
+
<p>Enjoy hiki world!!</p>
|
47
|
+
<h2>Development</h2>
|
48
|
+
<p>To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](<a href="https://rubygems.org).">https://rubygems.org).</a></p>
|
49
|
+
<h2>Contributing</h2>
|
50
|
+
<p>Bug reports and pull requests are welcome on <a href="GitHub">GitHub</a> at <a href="https://github.com/daddygongon/shunkuntype.">https://github.com/daddygongon/shunkuntype.</a> This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.</p>
|
51
|
+
<h2>License</h2>
|
52
|
+
<p>The gem is available as open source under the terms of the [MIT License](<a href="http://opensource.org/licenses/MIT).">http://opensource.org/licenses/MIT).</a></p>
|
53
|
+
|
54
|
+
</body>
|
55
|
+
</html>
|
@@ -6,6 +6,7 @@ Direct file handling utility for hiki text, cache and rsync of local ang global
|
|
6
6
|
|
7
7
|
|
8
8
|
!Operation
|
9
|
+
|
9
10
|
"hiki" is the command name.
|
10
11
|
|
11
12
|
<<< tcsh
|
@@ -16,7 +17,7 @@ Usage: hiki [options]
|
|
16
17
|
-s, --show show sources
|
17
18
|
-a, --add add sources info
|
18
19
|
-t, --target [VAL] set target number
|
19
|
-
-
|
20
|
+
-e, --edit FILE open file
|
20
21
|
-l, --list [FILE] list files
|
21
22
|
-u, --update [FILE] update file
|
22
23
|
-r, --rsync rsync files
|
@@ -24,22 +25,25 @@ Usage: hiki [options]
|
|
24
25
|
|
25
26
|
!! Installation
|
26
27
|
Installed by
|
27
|
-
|
28
|
+
|
28
29
|
$ gem install hikimode
|
29
|
-
|
30
|
+
|
30
31
|
At the first time of hiki operation, hikirc file is created at home dir.
|
32
|
+
|
31
33
|
<<<
|
32
34
|
bob% cat ~/.hikirc
|
33
35
|
---
|
34
|
-
:target:
|
35
|
-
:editor_command:
|
36
|
+
:target: 1
|
37
|
+
:editor_command: open -a mi
|
38
|
+
:browser: firefox
|
36
39
|
:srcs:
|
37
40
|
- :nick_name: hoge
|
38
41
|
:local_dir: hogehoge
|
39
42
|
:local_uri: http://localhost/~hoge
|
40
43
|
:global_dir: hoge@global_host:/hoge
|
41
44
|
:global_uri: http://hoge
|
42
|
-
>>>
|
45
|
+
>>>
|
46
|
+
|
43
47
|
The directly editing of hikirc file is much easier than using -a option.
|
44
48
|
Each hiki utility option runs, assuming the editing files lacating locally.
|
45
49
|
|
@@ -0,0 +1,50 @@
|
|
1
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>docs/README_ja.hiki</title>
|
5
|
+
</head>
|
6
|
+
<body>
|
7
|
+
<h1>hikiutils</h1>
|
8
|
+
<p>Utilities for helping hiki editing.</p>
|
9
|
+
<h1>Features</h1>
|
10
|
+
<p>Direct file handling utility for hiki text, cache and rsync of local ang global hiki sites.</p>
|
11
|
+
<h1>Operation</h1>
|
12
|
+
<p>"hiki" is the command name.</p>
|
13
|
+
<pre class="prettyprint">bob% hiki
|
14
|
+
hiki says 'Hello world'.
|
15
|
+
Usage: hiki [options]
|
16
|
+
-v, --version show program Version.
|
17
|
+
-s, --show show sources
|
18
|
+
-a, --add add sources info
|
19
|
+
-t, --target [VAL] set target number
|
20
|
+
-e, --edit FILE open file
|
21
|
+
-l, --list [FILE] list files
|
22
|
+
-u, --update [FILE] update file
|
23
|
+
-r, --rsync rsync files</pre>
|
24
|
+
<h2>Installation</h2>
|
25
|
+
<p>Installed by</p>
|
26
|
+
<pre>$ gem install hikimode</pre>
|
27
|
+
<p>At the first time of hiki operation, hikirc file is created at home dir.</p>
|
28
|
+
<pre>bob% cat ~/.hikirc
|
29
|
+
---
|
30
|
+
:target: 1
|
31
|
+
:editor_command: open -a mi
|
32
|
+
:browser: firefox
|
33
|
+
:srcs:
|
34
|
+
- :nick_name: hoge
|
35
|
+
:local_dir: hogehoge
|
36
|
+
:local_uri: http://localhost/~hoge
|
37
|
+
:global_dir: hoge@global_host:/hoge
|
38
|
+
:global_uri: http://hoge</pre>
|
39
|
+
<p>The directly editing of hikirc file is much easier than using -a option.
|
40
|
+
Each hiki utility option runs, assuming the editing files lacating locally.</p>
|
41
|
+
<p>Enjoy hiki world!!</p>
|
42
|
+
<h2>Development</h2>
|
43
|
+
<p>To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](<a href="https://rubygems.org).">https://rubygems.org).</a></p>
|
44
|
+
<h2>Contributing</h2>
|
45
|
+
<p>Bug reports and pull requests are welcome on <a href="GitHub">GitHub</a> at <a href="https://github.com/daddygongon/shunkuntype.">https://github.com/daddygongon/shunkuntype.</a> This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.</p>
|
46
|
+
<h2>License</h2>
|
47
|
+
<p>The gem is available as open source under the terms of the [MIT License](<a href="http://opensource.org/licenses/MIT).">http://opensource.org/licenses/MIT).</a></p>
|
48
|
+
|
49
|
+
</body>
|
50
|
+
</html>
|
data/hikiutils.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
11
11
|
|
12
12
|
spec.summary = %q{helper of hiki editing.}
|
13
13
|
spec.description = %q{.}
|
14
|
-
spec.homepage = "http://github.org/daddygongon/hikiutils
|
14
|
+
spec.homepage = "http://github.org/daddygongon/hikiutils"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
17
17
|
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
@@ -0,0 +1,65 @@
|
|
1
|
+
# hikiutils
|
2
|
+
Utilities for helping hiki editing.
|
3
|
+
|
4
|
+
# Features
|
5
|
+
Direct file handling utility for hiki text, cache and rsync of local ang global hiki sites.
|
6
|
+
|
7
|
+
|
8
|
+
# Operation
|
9
|
+
|
10
|
+
"hiki" is the command name.
|
11
|
+
|
12
|
+
```tcsh
|
13
|
+
bob% hiki
|
14
|
+
hiki says 'Hello world'.
|
15
|
+
Usage: hiki [options]
|
16
|
+
-v, --version show program Version.
|
17
|
+
-s, --show show sources
|
18
|
+
-a, --add add sources info
|
19
|
+
-t, --target [VAL] set target number
|
20
|
+
-e, --edit FILE open file
|
21
|
+
-l, --list [FILE] list files
|
22
|
+
-u, --update [FILE] update file
|
23
|
+
-r, --rsync rsync files
|
24
|
+
```
|
25
|
+
|
26
|
+
## Installation
|
27
|
+
Installed by
|
28
|
+
|
29
|
+
```
|
30
|
+
$ gem install hikimode
|
31
|
+
```
|
32
|
+
|
33
|
+
At the first time of hiki operation, hikirc file is created at home dir.
|
34
|
+
|
35
|
+
```
|
36
|
+
bob% cat ~/.hikirc
|
37
|
+
---
|
38
|
+
:target: 1
|
39
|
+
:editor_command: open -a mi
|
40
|
+
:browser: firefox
|
41
|
+
:srcs:
|
42
|
+
- :nick_name: hoge
|
43
|
+
:local_dir: hogehoge
|
44
|
+
:local_uri: http://localhost/~hoge
|
45
|
+
:global_dir: hoge@global_host:/hoge
|
46
|
+
:global_uri: http://hoge
|
47
|
+
```
|
48
|
+
|
49
|
+
The directly editing of hikirc file is much easier than using -a option.
|
50
|
+
Each hiki utility option runs, assuming the editing files lacating locally.
|
51
|
+
|
52
|
+
Enjoy hiki world!!
|
53
|
+
|
54
|
+
## Development
|
55
|
+
|
56
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
57
|
+
|
58
|
+
## Contributing
|
59
|
+
|
60
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/daddygongon/shunkuntype. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
|
61
|
+
|
62
|
+
|
63
|
+
## License
|
64
|
+
|
65
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
@@ -0,0 +1,65 @@
|
|
1
|
+
# hikiutils
|
2
|
+
Utilities for helping hiki editing.
|
3
|
+
|
4
|
+
# Discriptions
|
5
|
+
Direct file handling utility for hiki text and cache,
|
6
|
+
and rsync between local and global hiki sites.
|
7
|
+
|
8
|
+
|
9
|
+
# Operation
|
10
|
+
"hiki" is the command name.
|
11
|
+
|
12
|
+
```tcsh
|
13
|
+
bob% hiki
|
14
|
+
hiki says 'Hello world'.
|
15
|
+
Usage: hiki [options]
|
16
|
+
-v, --version show program Version.
|
17
|
+
-s, --show show sources
|
18
|
+
-a, --add add sources info
|
19
|
+
-t, --target [VAL] set target number
|
20
|
+
-o, --open [FILE] open file
|
21
|
+
-l, --list [FILE] list files
|
22
|
+
-u, --update [FILE] update file
|
23
|
+
-r, --rsync rsync files
|
24
|
+
```
|
25
|
+
|
26
|
+
## Installation
|
27
|
+
|
28
|
+
Installed by
|
29
|
+
|
30
|
+
```
|
31
|
+
$ gem install hikimode
|
32
|
+
```
|
33
|
+
|
34
|
+
At the first time of hiki operation, hikirc file is created at home dir.
|
35
|
+
|
36
|
+
```
|
37
|
+
bob% cat ~/.hikirc
|
38
|
+
---
|
39
|
+
:target: 0
|
40
|
+
:editor_command: emacs
|
41
|
+
:srcs:
|
42
|
+
- :nick_name: hoge
|
43
|
+
:local_dir: hogehoge
|
44
|
+
:local_uri: http://localhost/~hoge
|
45
|
+
:global_dir: hoge@global_host:/hoge
|
46
|
+
:global_uri: http://hoge
|
47
|
+
```
|
48
|
+
|
49
|
+
The directly editing of hikirc file is much easier than using -a option.
|
50
|
+
Each hiki utility option runs, assuming the editing files lacating locally.
|
51
|
+
|
52
|
+
Enjoy hiki world!!
|
53
|
+
|
54
|
+
## Development
|
55
|
+
|
56
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
57
|
+
|
58
|
+
## Contributing
|
59
|
+
|
60
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/daddygongon/shunkuntype. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
|
61
|
+
|
62
|
+
|
63
|
+
## License
|
64
|
+
|
65
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
@@ -0,0 +1,65 @@
|
|
1
|
+
# hikiutils
|
2
|
+
Utilities for helping hiki editing.
|
3
|
+
|
4
|
+
# Features
|
5
|
+
Direct file handling utility for hiki text, cache and rsync of local ang global hiki sites.
|
6
|
+
|
7
|
+
|
8
|
+
# Operation
|
9
|
+
|
10
|
+
"hiki" is the command name.
|
11
|
+
|
12
|
+
```tcsh
|
13
|
+
bob% hiki
|
14
|
+
hiki says 'Hello world'.
|
15
|
+
Usage: hiki [options]
|
16
|
+
-v, --version show program Version.
|
17
|
+
-s, --show show sources
|
18
|
+
-a, --add add sources info
|
19
|
+
-t, --target [VAL] set target number
|
20
|
+
-e, --edit FILE open file
|
21
|
+
-l, --list [FILE] list files
|
22
|
+
-u, --update [FILE] update file
|
23
|
+
-r, --rsync rsync files
|
24
|
+
```
|
25
|
+
|
26
|
+
## Installation
|
27
|
+
Installed by
|
28
|
+
|
29
|
+
```
|
30
|
+
$ gem install hikimode
|
31
|
+
```
|
32
|
+
|
33
|
+
At the first time of hiki operation, hikirc file is created at home dir.
|
34
|
+
|
35
|
+
```
|
36
|
+
bob% cat ~/.hikirc
|
37
|
+
---
|
38
|
+
:target: 1
|
39
|
+
:editor_command: open -a mi
|
40
|
+
:browser: firefox
|
41
|
+
:srcs:
|
42
|
+
- :nick_name: hoge
|
43
|
+
:local_dir: hogehoge
|
44
|
+
:local_uri: http://localhost/~hoge
|
45
|
+
:global_dir: hoge@global_host:/hoge
|
46
|
+
:global_uri: http://hoge
|
47
|
+
```
|
48
|
+
|
49
|
+
The directly editing of hikirc file is much easier than using -a option.
|
50
|
+
Each hiki utility option runs, assuming the editing files lacating locally.
|
51
|
+
|
52
|
+
Enjoy hiki world!!
|
53
|
+
|
54
|
+
## Development
|
55
|
+
|
56
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
57
|
+
|
58
|
+
## Contributing
|
59
|
+
|
60
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/daddygongon/shunkuntype. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
|
61
|
+
|
62
|
+
|
63
|
+
## License
|
64
|
+
|
65
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/lib/hikiutils/infodb.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
1
2
|
require 'nkf'
|
3
|
+
require 'kconv'
|
2
4
|
|
3
5
|
class InfoDB
|
4
6
|
attr_accessor :file_path, :db, :text_dir
|
@@ -6,13 +8,24 @@ class InfoDB
|
|
6
8
|
@file_path=File.join(file_path,"info.db")
|
7
9
|
@db = Hash.new
|
8
10
|
file = File.read(@file_path)
|
11
|
+
# if Kconv.iseuc(file) then # fail to guess
|
9
12
|
if NKF.guess(file)==NKF::EUC then
|
10
|
-
print "
|
13
|
+
print "WARNING : this info.db is written in euc, thus not supported.\n"
|
14
|
+
print "#{@file_path}.\n"
|
11
15
|
exit
|
12
16
|
end
|
13
17
|
@db = TMarshal::load(file)
|
14
18
|
end
|
15
19
|
|
20
|
+
def show_link(file_name)
|
21
|
+
@db.each{|ele|
|
22
|
+
ref = ele[1][:references]
|
23
|
+
if ref.include?(file_name) then
|
24
|
+
p ele[0]
|
25
|
+
end
|
26
|
+
}
|
27
|
+
end
|
28
|
+
|
16
29
|
def show(name)
|
17
30
|
@db[name]
|
18
31
|
end
|
data/lib/hikiutils/tmarshal.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
1
2
|
# Original Copyright (C) Rubikichi
|
2
3
|
# Modified by TAKEUCHI Hitoshi
|
3
4
|
# You can redistribute it and/or modify it under the terms of
|
@@ -14,6 +15,7 @@ module TMarshal
|
|
14
15
|
end
|
15
16
|
|
16
17
|
def load(port)
|
18
|
+
# p port
|
17
19
|
case port
|
18
20
|
when String
|
19
21
|
eval port.untaint
|
data/lib/hikiutils/version.rb
CHANGED
data/lib/hikiutils.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
require '
|
2
|
+
require 'kconv'
|
3
|
+
require 'hikidoc'
|
4
|
+
require 'erb'
|
3
5
|
require "hikiutils/version"
|
4
6
|
require "hikiutils/tmarshal"
|
5
7
|
require "hikiutils/infodb"
|
@@ -11,9 +13,28 @@ require 'pp'
|
|
11
13
|
|
12
14
|
module HikiUtils
|
13
15
|
DATA_FILE=File.join(ENV['HOME'],'.hikirc')
|
14
|
-
attr_accessor :src, :target, :data_name, :l_dir
|
16
|
+
attr_accessor :src, :target, :editor_command, :browser, :data_name, :l_dir
|
15
17
|
|
16
18
|
class Command
|
19
|
+
|
20
|
+
|
21
|
+
HTML_TEMPLATE = <<EOS
|
22
|
+
<!DOCTYPE html
|
23
|
+
PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
24
|
+
"http://www.w3.org/TR/html4/loose.dtd">
|
25
|
+
<html lang="ja">
|
26
|
+
<html>
|
27
|
+
<head>
|
28
|
+
<meta http-equiv="Content-Language" content="ja">
|
29
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
30
|
+
<title><%= title %></title>
|
31
|
+
</head>
|
32
|
+
<body>
|
33
|
+
<%= body %>
|
34
|
+
</body>
|
35
|
+
</html>
|
36
|
+
EOS
|
37
|
+
|
17
38
|
def self.run(argv=[])
|
18
39
|
print "hiki says 'Hello world'.\n"
|
19
40
|
new(argv).execute
|
@@ -41,16 +62,38 @@ module HikiUtils
|
|
41
62
|
opt.on('-l', '--list [FILE]','list files') {|file| list_files(file) }
|
42
63
|
opt.on('-u', '--update FILE','update file') {|file| update_file(file) }
|
43
64
|
opt.on('-r', '--rsync','rsync files') {rsync_files}
|
44
|
-
opt.on('
|
65
|
+
opt.on('--database FILE','read database file') {|file| db_file(file)}
|
66
|
+
opt.on('--display FILE','display converted hikifile') {|file| display(file)}
|
45
67
|
opt.on('-c', '--checkdb','check database file') {check_db}
|
46
68
|
opt.on('--remove FILE','remove file') {|file| remove_file(file)}
|
47
69
|
opt.on('--move FILES','move file1,file2',Array) {|files| move_file(files)}
|
70
|
+
opt.on('--euc FILE','translate file to euc') {|file| euc_file(file) }
|
71
|
+
end
|
72
|
+
begin
|
73
|
+
command_parser.parse!(@argv)
|
74
|
+
rescue=> eval
|
75
|
+
p eval
|
48
76
|
end
|
49
|
-
command_parser.parse!(@argv)
|
50
77
|
dump_sources
|
51
78
|
exit
|
52
79
|
end
|
53
80
|
|
81
|
+
def display(file)
|
82
|
+
body = HikiDoc.to_html(File.read(file))
|
83
|
+
source = HTML_TEMPLATE
|
84
|
+
title = ''
|
85
|
+
erb = ERB.new(source)
|
86
|
+
t = File.open(file+".html",'w')
|
87
|
+
t.puts(erb.result(binding))
|
88
|
+
system "open #{t.path}"
|
89
|
+
end
|
90
|
+
|
91
|
+
def euc_file(file)
|
92
|
+
p file_path = File.join(@l_dir,'text',file)
|
93
|
+
cont = File.readlines(file_path)
|
94
|
+
cont.each{|line| puts line.toeuc }
|
95
|
+
end
|
96
|
+
|
54
97
|
def move_file(files)
|
55
98
|
begin
|
56
99
|
p file1_path = File.join(@l_dir,'text',files[0])
|
@@ -63,7 +106,7 @@ module HikiUtils
|
|
63
106
|
return if file1_path==file2_path
|
64
107
|
if File.exist?(file2_path) then
|
65
108
|
print ("moving target #{files[1]} exists.\n")
|
66
|
-
print ("first remove
|
109
|
+
print ("first remove#{files[1]}.\n")
|
67
110
|
return
|
68
111
|
else
|
69
112
|
File.rename(file1_path,file2_path)
|
@@ -73,11 +116,11 @@ module HikiUtils
|
|
73
116
|
|
74
117
|
db = info.db
|
75
118
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
119
|
+
pp file0=db[files[0]]
|
120
|
+
db.delete(files[0])
|
121
|
+
db[files[1]]=file0
|
122
|
+
db[files[1]][:title]=files[1] if db[files[1]][:title]==files[0]
|
123
|
+
pp db[files[1]]
|
81
124
|
|
82
125
|
db.each{|ele|
|
83
126
|
ref = ele[1][:references]
|
@@ -85,27 +128,26 @@ module HikiUtils
|
|
85
128
|
p link_file=ele[0]
|
86
129
|
link_path = File.join(@l_dir,'text',link_file)
|
87
130
|
|
88
|
-
|
89
|
-
cont
|
90
|
-
|
91
|
-
|
92
|
-
|
131
|
+
cont = File.read(link_path)
|
132
|
+
if Kconv.iseuc(cont) then
|
133
|
+
print "euc\n"
|
134
|
+
utf8_cont=cont.toutf8
|
135
|
+
utf8_cont.gsub!(/#{files[0]}/,"#{files[1]}")
|
136
|
+
cont = utf8_cont.toeuc
|
93
137
|
else
|
138
|
+
cont.gsub!(/#{files[0]}/,"#{files[1]}")
|
139
|
+
end
|
94
140
|
|
95
|
-
|
96
|
-
target=File.open(link_path,'w')
|
97
|
-
target.print cont
|
98
|
-
target.close
|
141
|
+
File.write(link_path,cont)
|
99
142
|
|
100
|
-
|
101
|
-
|
143
|
+
ref.delete(files[0])
|
144
|
+
ref << files[1]
|
102
145
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
end
|
146
|
+
p cache_path = File.join(@l_dir,'cache/parser',link_file)
|
147
|
+
begin
|
148
|
+
File.delete(cache_path)
|
149
|
+
rescue => evar
|
150
|
+
puts evar.to_s
|
109
151
|
end
|
110
152
|
end
|
111
153
|
}
|
@@ -130,7 +172,7 @@ module HikiUtils
|
|
130
172
|
info=InfoDB.new(@l_dir)
|
131
173
|
p "delete "
|
132
174
|
del_file=info.delete(file_name)
|
133
|
-
|
175
|
+
info.show_link(file_name)
|
134
176
|
info.dump
|
135
177
|
end
|
136
178
|
|
@@ -147,7 +189,11 @@ module HikiUtils
|
|
147
189
|
def rsync_files
|
148
190
|
p local = @l_dir
|
149
191
|
p global = @src[:srcs][@target][:global_dir]
|
150
|
-
|
192
|
+
#"/Users/bob/Sites/nishitani0/Internal/data"
|
193
|
+
#"bob@dmz0:/Users/bob/nishitani0/Internal/data"
|
194
|
+
# p command="rsync -auvz -e ssh #{local}/ #{global}"
|
195
|
+
p command="rsync -auvz -e ssh #{local}/ #{global}"
|
196
|
+
# system 'rsync -auvz -e ssh ~/Sites/nishitani0 bob@nishitani0.kwansei.ac.jp:Sites/'
|
151
197
|
system command
|
152
198
|
end
|
153
199
|
|
@@ -155,8 +201,7 @@ module HikiUtils
|
|
155
201
|
file = (file0==nil) ? 'FrontPage' : file0
|
156
202
|
#rm cache file
|
157
203
|
t_file=File.join(@l_dir,'cache/parser',file)
|
158
|
-
|
159
|
-
system command
|
204
|
+
FileUtils.rm(t_file,:verbose=>true)
|
160
205
|
|
161
206
|
#update info file
|
162
207
|
info=InfoDB.new(@l_dir)
|
@@ -164,9 +209,11 @@ module HikiUtils
|
|
164
209
|
|
165
210
|
#open file on browser
|
166
211
|
l_path = @src[:srcs][@target][:local_uri]
|
167
|
-
|
168
|
-
p command="open \'#{
|
212
|
+
# p command="open -a #{@browser} \'#{l_path}/?c=edit;p=#{file}\'"
|
213
|
+
p command="open -a #{@browser} \'#{l_path}/?#{file}\'"
|
169
214
|
system command
|
215
|
+
p "If you get open error, try rackup from the src_dir."
|
216
|
+
p "If you get 整形式になっていません, try login as a valid user."
|
170
217
|
end
|
171
218
|
|
172
219
|
def list_files(file)
|
@@ -183,7 +230,7 @@ module HikiUtils
|
|
183
230
|
file.close
|
184
231
|
File.chmod(0777,t_file)
|
185
232
|
end
|
186
|
-
p command="
|
233
|
+
p command="#{@editor_command} #{t_file}"
|
187
234
|
system command
|
188
235
|
end
|
189
236
|
|
@@ -201,7 +248,7 @@ module HikiUtils
|
|
201
248
|
def show_sources()
|
202
249
|
printf("target_no:%i\n",@src[:target])
|
203
250
|
printf("editor_command:%s\n",@src[:editor_command])
|
204
|
-
header = display_format('id','
|
251
|
+
header = display_format('id','name','local directory','global uri')
|
205
252
|
|
206
253
|
puts header
|
207
254
|
puts '-' * header.size
|
@@ -218,8 +265,8 @@ module HikiUtils
|
|
218
265
|
end
|
219
266
|
|
220
267
|
def display_format(id, name, local, global)
|
221
|
-
name_length =
|
222
|
-
local_length =
|
268
|
+
name_length = 5-full_width_count(name)
|
269
|
+
local_length = 45-full_width_count(local)
|
223
270
|
[id.to_s.rjust(3), name.ljust(name_length),local.ljust(local_length), global.center(10)].join(' | ')
|
224
271
|
end
|
225
272
|
|
@@ -244,6 +291,10 @@ module HikiUtils
|
|
244
291
|
file.close
|
245
292
|
@target = @src[:target]
|
246
293
|
@l_dir=@src[:srcs][@target][:local_dir]
|
294
|
+
browser = @src[:browser]
|
295
|
+
@browser = (browser==nil) ? 'firefox' : browser
|
296
|
+
p editor_command = @src[:editor_command]
|
297
|
+
@editor_command = (editor_command==nil) ? 'open -a mi' : editor_command
|
247
298
|
end
|
248
299
|
end
|
249
300
|
end
|
@@ -274,5 +325,3 @@ module DataFiles
|
|
274
325
|
end
|
275
326
|
private_class_method :create_file_if_not_exists, :create_data_file, :init_data_file
|
276
327
|
end
|
277
|
-
|
278
|
-
|
data/tmp.txt
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
hiki says 'Hello world'.
|
2
|
+
"/Users/bob/Sites/hiki-data/data/text/GoogleVSKuguru"
|
3
|
+
!Google��ޤ�����������ޤ�����
|
4
|
+
|
5
|
+
!�����ر���ء���������������ʳزʡ���������ë����
|
6
|
+
!2016/4/29
|
7
|
+
|
8
|
+
!����ȥ�
|
9
|
+
�����ͥåȤ��о���衤�μ�������Ͽ������ʤ����餤�ưפˤʤä��������������Τ褦�ʰ°פ��μ������꤬�������μ�������˷�ӤĤ��Ƥ��뤫�ˤ�¿���ε�����ꤲ�������롥�ܥ�ݡ��ȤǤϡ��μ������ˤ�����ͥåȤαƶ��פ��Ф�����ɽŪ�ʰո�����Ĥ��Ҳ𤷡��������������롥
|
10
|
+
|
11
|
+
!����
|
12
|
+
!!���ɤࡦ���ä����֤ǥ�Τˤ��뵻�ѡ�
|
13
|
+
���ɤࡦ���ä����֤ǥ�Τˤ��뵻�ѡפ����Ԥκ�ƣ���ϡ����˽Ф����ɤߤ������ܸ�פȤ����٥��ȥ��顼���Τ����������ʸ���������Ǥ��롥��ϡ�NHK���Ļ��������ȡ֤ˤۤǤ����ܡפδ�衦�ƽ��ˤ⻲�ä������ܸ춵����Ф��Ʊƶ��ϤΤ��븦��ԤǤ��롥��ϳؽ����Ф���¿���η��ؽ��ɮ���Ƥ��뤬�����ΰ�Ĥ����ɤ���ä����֤Ǥ�Τˤ��뵻�ѡפǤ���[1]��
|
14
|
+
|
15
|
+
!!��Google�Ͽͤε���������
|
16
|
+
��Google�Ͽͤε��������פ�2011ǯ7��15����wired news �ε����Ǥ���[2]�������Ǥϡ���Science�٤˷Ǻܤ��줿���ꥶ�٥������ѥ������
|
17
|
+
""��������ȥͥåȤΤ������ǡ��ۤȤ�ɤλ��¤ϵ�������ɬ�פ��ʤ��ʤä������������Τ��Ȥ�Ʊ���ˡ������ε���ǽ�Ϥ˱ƶ���Ϳ���Ƥ����ǽ��������
|
18
|
+
���Ȥ�������褦�Ȥ��뿴���ؼ¸���Ҳ𤷤Ƥ��롥���μ¸���̤ϡ�
|
19
|
+
""�������ؤ�����¤�ԥ塼�����˵�Ͽ������硢���λ��¤�פ��Ф���Ψ��������Ȥ������Ĥޤꡢ����饤��Ǥ��ĤǤ�����������Ǥ���Ȼפ��С�����ˤĤ��Ƴؤ�ǵ���������ߤ�������
|
20
|
+
����𤷤Ƥ��롥
|
21
|
+
|
22
|
+
!!Sfard��AM/PM��ʸ
|
23
|
+
1991ǯ�� Lave and Wenger �ˤ�äƿ������ؽ����֡���ǰ����Ƥ��줿[3]�����ϡ����եꥫ�λ�Ω�ƿ��ͤ�����ؤΰ���ˡ��Ҳ��Ū�˾ܤ���Ĵ��������̡��������Τʤ��˳ؤӤ��ܼ�������Ȼ�Ŧ����������Ȥʤ뿷�ͤ�����Ʊ�Τΰ���Ȥ��Ƹ������Ż���Ϥ������������Ū���ջ���(legitimate peripheral participation) �פȤ���路���ؽ����Ҳ��ư�Τʤ��Ǽ�������Ƥ������Ȥ�־����������ޤ줿�ؽ�(situated learning)�פ�ɽ�����������ض���Ԥ� Sfard �ϡ��Ť��ؽ��ѤȤ��ο������ؽ��Ѥ������ acquisition(����) metaphor �� participation(����) metaphor �Ȥ���Ŭ�ڤ�ñ��ˤ�ä�ɽ������[4]��
|
24
|
+
|
25
|
+
!����
|
26
|
+
��ƣ�ϡ�
|
27
|
+
""�������Ѥ���Ȥϡ�������ɤࡦ���ä��פʤ�ɬ�פʤȤ��ˤ��ĤǤ�Ҥ�������褦�˵������Ƥ������ȡ�ɬ�פʤȤ��˻Ȥ�����ǵ������Ƥ������Ȥ���[1, p.22]
|
28
|
+
�Ȥ��ơ�������Ѥȵ����δط������������ǡ�
|
29
|
+
* ��������Ф���ۤɡ�����ά����Ū�����Ϥ�ȿ���㤷�ƿꤨ�Ƥ��ޤ�[1, p.16]
|
30
|
+
�Τǡ�
|
31
|
+
* �����Τˤ����餻�������ʬ������[1, p.24]
|
32
|
+
���Ȥν��������⤤�Ƥ��롥���ꥶ�٥������ѥ�����ο����ؼ¸����ƣ���Ρ�google�����פ�������ٻ��������Ƥȼ������롥
|
33
|
+
|
34
|
+
�����������ꥶ�٥������ѥ����ˤ��С��ͥåȾ���μ���
|
35
|
+
""���������(�п�ήŪ����:Transactive Memory)�ΤҤȤĤη��֤��Ȥ����������Ȥϡ����ĤȤ��ƺ�Ȥ������¤��μ��������Τ�������줿�ͤ����˸����뵭����ˡ����[�����ϡ����Ĥ�ʪ�������뤢�����ǡ����줾��Υ��С��ϡ�ï�����ε������ΤäƤ��뤫�פ�Ф��Ƥ��롣
|
36
|
+
�Ȥ��Ƶ������֤ΰ㤤���Ŧ������ǡ�
|
37
|
+
""�֤����ϼ�����ǡ��ۤ��οͤ����ε��������Ѥ��Ƥ��뤬�����θ��ݤϤ���˻��Ƥ��롣�����ͥåȤϡ��ºݤˤϡ����������¾�ԤؤΥ����ե������ʤΤ���
|
38
|
+
�ȽҤ٤Ƥ���[2]���Ĥޤꡤ�������٤��μ���������Ȥ��㤦��ǽ�����Ŧ���Ƥ��롥
|
39
|
+
|
40
|
+
����ˡ�Sfard�������ؽ��Ѥˤ��С��μ������ˤ�������Ȼ��÷�������Ȥ��Ƥ���[4]��������ޤȤ��ȡ�ɽ1�Τ褦�ˤʤ롥
|
41
|
+
|
42
|
+
||>>ɽ1 Sfard �ˤ�� acquisition(����) metaphor �� participation(����) metaphor �ˤ��ؽ��Ѥΰ㤤[4,Table I������].
|
43
|
+
||����||acquisition metaphor||participation metaphor
|
44
|
+
||�ؽ���ɸ||�ġ��ͤ�˭���ˤ���||��Ʊ�Τι���
|
45
|
+
||�ؽ��Ȥ�?|| �ʤˤ���������� (acquisition) ||���ü� (participant) �Ȥʤ�
|
46
|
+
||�ؽ��� (student)||���Ƽ� (�����),�ƹ��ۼ�||���դˤ��뻲�ü�,����
|
47
|
+
||������ (teacher)||�����,�ޤȤ���,���||�����������ü�, ���������ͤν�����
|
48
|
+
||�μ�,��ǰ||��,��ͭʪ,���̾��� (�ĿͤΤ��뤤�ϸ�����) ||����,����,��ư�ΰ�¦��
|
49
|
+
||�Τ�Ȥ�||����,��ͭ���뤳��||��°����,���ä���,���ߥ�˥����Ȥ��뤳��
|
50
|
+
|
51
|
+
|
52
|
+
AM��PM���ɤ���γؽ�ˡ���������Ȥ������ȤǤϤʤ���Sfard����ʸ���ܤ������̤ꡤ
|
53
|
+
""�ɤ��餫��Ĥ����֤��Ȥϴ����Ǥ���
|
54
|
+
�Ȥ��Ƥ��롥���������������ڤ�ʪ���ؤ�����������(complementarity)���̻Ҥ�ˤ���Ȥ��ƽФ��Ƥ��뤿�ᡤʪ���ؤ��������Ƥ��ʤ���Ǽ������Τ�����
|
55
|
+
|
56
|
+
!�������Ѥ���
|
57
|
+
��ƣ�����Ƥ����μ��������γؽ�ˡ�����ƤǤϤʤ�������ˡ������ˤϴ��Ĥ�η��֤����ꡤ����餬�ɤΤ褦�ˤ�����Ǿ�˹�ޤ�Ƥ��뤫��̤�����Ǥ��롥�ޤ������ε�����ɤΤ褦�����夵���뤫�䡤�ɤΤ褦�ʷ��֤ε��������夵����٤�����¿�Ͳ����Ƥ��롥�ؽ���ʤ����������ˤϡ���Ĥγؽ�ˡ���μ����֤˸Ǽ����뤳�Ȥʤ�¿�ͤʳؤӤ��μ����ɵᤷ�Ƥۤ�������⺣����������ߤƤ��ޤ��������������üԡ����������ͤν����ԤȤ��ƤǤϤʤ����ƹ��ۼԤȤ��ơ�
|
58
|
+
|
59
|
+
!����ʸ��
|
60
|
+
#���ɤࡦ���ä����֤ǥ�Τˤ��뵻�ѡ�,��ƣ��, (���½�˼,2009).
|
61
|
+
#��Google�פϿͤε���ǽ�Ϥ��㲼�����뤫, WIRED NEWS,2011ǯ7��15��, TEXT BY Brandon Keim,TRANSLATION BY ����쥪 -��ƣ ��/�縶����.
|
62
|
+
# "�����������ޤ줿�ؽ�,����Ū���ջ���", �����쥤��,���ƥ�����̡�������, ��������,ʡ�����Ͳ��� (���ȿ�, 1993).
|
63
|
+
# "On Two Metaphors for Learning and the Dangers of Choosing Just one", Anna Sfard, Educational Researcher, 27(1998), 413.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hikiutils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shigeto R. Nishitani
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -136,21 +136,26 @@ files:
|
|
136
136
|
- CODE_OF_CONDUCT.md
|
137
137
|
- Gemfile
|
138
138
|
- LICENSE.txt
|
139
|
+
- LectureNotes
|
139
140
|
- README.md
|
140
141
|
- Rakefile
|
141
142
|
- bin/console
|
142
143
|
- bin/setup
|
143
144
|
- docs/README.hiki
|
144
|
-
- docs/README.
|
145
|
+
- docs/README.hiki.html
|
146
|
+
- docs/README_ja.hiki
|
147
|
+
- docs/README_ja.hiki.html
|
145
148
|
- exe/hiki
|
146
149
|
- hikiutils.gemspec
|
147
|
-
-
|
148
|
-
-
|
150
|
+
- hikiutils.wiki/Home.md
|
151
|
+
- hikiutils.wiki/README.md
|
152
|
+
- hikiutils.wiki/README_ja.md
|
149
153
|
- lib/hikiutils.rb
|
150
154
|
- lib/hikiutils/infodb.rb
|
151
155
|
- lib/hikiutils/tmarshal.rb
|
152
156
|
- lib/hikiutils/version.rb
|
153
|
-
|
157
|
+
- tmp.txt
|
158
|
+
homepage: http://github.org/daddygongon/hikiutils
|
154
159
|
licenses:
|
155
160
|
- MIT
|
156
161
|
metadata: {}
|
data/lib/#hikiutils.rb#
DELETED
@@ -1,278 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
require 'nkf'
|
3
|
-
require "hikiutils/version"
|
4
|
-
require "hikiutils/tmarshal"
|
5
|
-
require "hikiutils/infodb"
|
6
|
-
require 'systemu'
|
7
|
-
require 'optparse'
|
8
|
-
require 'fileutils'
|
9
|
-
require 'yaml'
|
10
|
-
require 'pp'
|
11
|
-
|
12
|
-
module HikiUtils
|
13
|
-
DATA_FILE=File.join(ENV['HOME'],'.hikirc')
|
14
|
-
attr_accessor :src, :target, :data_name, :l_dir
|
15
|
-
|
16
|
-
class Command
|
17
|
-
def self.run(argv=[])
|
18
|
-
print "hiki says 'Hello world'.\n"
|
19
|
-
new(argv).execute
|
20
|
-
end
|
21
|
-
|
22
|
-
def initialize(argv=[])
|
23
|
-
@argv = argv
|
24
|
-
@data_name=['nick_name','local_dir','local_uri','global_dir','global_uri']
|
25
|
-
data_path = File.join(ENV['HOME'], '.hikirc')
|
26
|
-
DataFiles.prepare(data_path)
|
27
|
-
read_sources
|
28
|
-
end
|
29
|
-
|
30
|
-
def execute
|
31
|
-
@argv << '--help' if @argv.size==0
|
32
|
-
command_parser = OptionParser.new do |opt|
|
33
|
-
opt.on('-v', '--version','show program Version.') { |v|
|
34
|
-
opt.version = HikiUtils::VERSION
|
35
|
-
puts opt.ver
|
36
|
-
}
|
37
|
-
opt.on('-s', '--show','show sources') {show_sources}
|
38
|
-
opt.on('-a', '--add','add sources info') {add_sources }
|
39
|
-
opt.on('-t', '--target VAL','set target id') {|val| set_target(val) }
|
40
|
-
opt.on('-e', '--edit FILE','open file') {|file| edit_file(file) }
|
41
|
-
opt.on('-l', '--list [FILE]','list files') {|file| list_files(file) }
|
42
|
-
opt.on('-u', '--update FILE','update file') {|file| update_file(file) }
|
43
|
-
opt.on('-r', '--rsync','rsync files') {rsync_files}
|
44
|
-
opt.on('-d', '--database FILE','read database file') {|file| db_file(file)}
|
45
|
-
opt.on('-c', '--checkdb','check database file') {check_db}
|
46
|
-
opt.on('--remove FILE','remove file') {|file| remove_file(file)}
|
47
|
-
opt.on('--move FILES','move file1,file2',Array) {|files| move_file(files)}
|
48
|
-
end
|
49
|
-
command_parser.parse!(@argv)
|
50
|
-
dump_sources
|
51
|
-
exit
|
52
|
-
end
|
53
|
-
|
54
|
-
def move_file(files)
|
55
|
-
begin
|
56
|
-
p file1_path = File.join(@l_dir,'text',files[0])
|
57
|
-
p file2_path = File.join(@l_dir,'text',files[1])
|
58
|
-
rescue => evar
|
59
|
-
puts evar.to_s
|
60
|
-
puts "error on move_files, check the input format, especially comma separation."
|
61
|
-
exit
|
62
|
-
end
|
63
|
-
return if file1_path==file2_path
|
64
|
-
if File.exist?(file2_path) then
|
65
|
-
print ("moving target #{files[1]} exists.\n")
|
66
|
-
print ("first remove #{files[1]}.\n")
|
67
|
-
return
|
68
|
-
else
|
69
|
-
File.rename(file1_path,file2_path)
|
70
|
-
end
|
71
|
-
|
72
|
-
info=InfoDB.new(@l_dir)
|
73
|
-
|
74
|
-
db = info.db
|
75
|
-
|
76
|
-
# pp file0=db[files[0]]
|
77
|
-
# db.delete(files[0])
|
78
|
-
# db[files[1]]=file0
|
79
|
-
# db[files[1]][:title]=files[1] if db[files[1]][:title]==files[0]
|
80
|
-
# pp db[files[1]]
|
81
|
-
|
82
|
-
db.each{|ele|
|
83
|
-
ref = ele[1][:references]
|
84
|
-
if ref.include?(files[0]) then
|
85
|
-
p link_file=ele[0]
|
86
|
-
link_path = File.join(@l_dir,'text',link_file)
|
87
|
-
|
88
|
-
target=File.open(link_path,'r')
|
89
|
-
cont = target.read
|
90
|
-
target.close
|
91
|
-
if NKF.guess(cont)==NKF::EUC then
|
92
|
-
print "Don\'t support EUC-JP, change link manually.\n"
|
93
|
-
else
|
94
|
-
|
95
|
-
cont.gsub!(/\[\[#{files[0]}\]\]/,"\[\[#{files[1]}\]\]")
|
96
|
-
target=File.open(link_path,'w')
|
97
|
-
target.print cont
|
98
|
-
target.close
|
99
|
-
|
100
|
-
ref.delete(files[0])
|
101
|
-
ref << files[1]
|
102
|
-
|
103
|
-
p cache_path = File.join(@l_dir,'cache/parser',link_file)
|
104
|
-
begin
|
105
|
-
File.delete(cache_path)
|
106
|
-
rescue => evar
|
107
|
-
puts evar.to_s
|
108
|
-
end
|
109
|
-
end
|
110
|
-
end
|
111
|
-
}
|
112
|
-
|
113
|
-
info.dump
|
114
|
-
end
|
115
|
-
|
116
|
-
def remove_file(file_name)
|
117
|
-
p text_path = File.join(@l_dir,'text',file_name)
|
118
|
-
p attach_path = File.join(@l_dir,'cache/attach',file_name)
|
119
|
-
begin
|
120
|
-
File.delete(text_path)
|
121
|
-
rescue => evar
|
122
|
-
puts evar.to_s
|
123
|
-
end
|
124
|
-
begin
|
125
|
-
Dir.rmdir(attach_path)
|
126
|
-
rescue => evar
|
127
|
-
puts evar.to_s
|
128
|
-
end
|
129
|
-
|
130
|
-
info=InfoDB.new(@l_dir)
|
131
|
-
p "delete "
|
132
|
-
del_file=info.delete(file_name)
|
133
|
-
|
134
|
-
info.dump
|
135
|
-
end
|
136
|
-
|
137
|
-
def check_db
|
138
|
-
result= InfoDB.new(@l_dir).show_inconsist
|
139
|
-
print (result=='') ? "db agrees with text dir.\n" : result
|
140
|
-
end
|
141
|
-
|
142
|
-
def db_file(file_name)
|
143
|
-
info=InfoDB.new(@l_dir)
|
144
|
-
p info.show(file_name)
|
145
|
-
end
|
146
|
-
|
147
|
-
def rsync_files
|
148
|
-
p local = @l_dir
|
149
|
-
p global = @src[:srcs][@target][:global_dir]
|
150
|
-
p command="rsync -auvz --delete -e ssh #{local}/ #{global}"
|
151
|
-
system command
|
152
|
-
end
|
153
|
-
|
154
|
-
def update_file(file0)
|
155
|
-
file = (file0==nil) ? 'FrontPage' : file0
|
156
|
-
#rm cache file
|
157
|
-
t_file=File.join(@l_dir,'cache/parser',file)
|
158
|
-
p command="rm #{t_file}"
|
159
|
-
system command
|
160
|
-
|
161
|
-
#update info file
|
162
|
-
info=InfoDB.new(@l_dir)
|
163
|
-
info.update(file0)
|
164
|
-
|
165
|
-
#open file on browser
|
166
|
-
l_path = @src[:srcs][@target][:local_uri]
|
167
|
-
l_file=l_path+"/?"+file
|
168
|
-
p command="open \'#{l_file}\'"
|
169
|
-
system command
|
170
|
-
end
|
171
|
-
|
172
|
-
def list_files(file)
|
173
|
-
file ='' if file==nil
|
174
|
-
t_file=File.join(@l_dir,'text')
|
175
|
-
print "target_dir : "+t_file+"\n"
|
176
|
-
print `cd #{t_file} ; ls -lt #{file}*`
|
177
|
-
end
|
178
|
-
|
179
|
-
def edit_file(file)
|
180
|
-
t_file=File.join(@l_dir,'text',file)
|
181
|
-
if !File.exist?(t_file) then
|
182
|
-
file=File.open(t_file,'w')
|
183
|
-
file.close
|
184
|
-
File.chmod(0777,t_file)
|
185
|
-
end
|
186
|
-
p command="open -a mi #{t_file}"
|
187
|
-
system command
|
188
|
-
end
|
189
|
-
|
190
|
-
def dump_sources
|
191
|
-
file = File.open(DATA_FILE,'w')
|
192
|
-
YAML.dump(@src, file)
|
193
|
-
file.close
|
194
|
-
end
|
195
|
-
|
196
|
-
def set_target(val)
|
197
|
-
@src[:target] = val.to_i
|
198
|
-
show_sources
|
199
|
-
end
|
200
|
-
|
201
|
-
def show_sources()
|
202
|
-
printf("target_no:%i\n",@src[:target])
|
203
|
-
printf("editor_command:%s\n",@src[:editor_command])
|
204
|
-
header = display_format('id','nick name','local directory','global uri')
|
205
|
-
|
206
|
-
puts header
|
207
|
-
puts '-' * header.size
|
208
|
-
|
209
|
-
@src[:srcs].each_with_index{|src,i|
|
210
|
-
target = i==@src[:target] ? '*':' '
|
211
|
-
id = target+i.to_s
|
212
|
-
name=src[:nick_name]
|
213
|
-
local=src[:local_dir]
|
214
|
-
global=src[:global_uri]
|
215
|
-
puts display_format(id,name,local,global)
|
216
|
-
}
|
217
|
-
|
218
|
-
end
|
219
|
-
|
220
|
-
def display_format(id, name, local, global)
|
221
|
-
name_length = 10-full_width_count(name)
|
222
|
-
local_length = 40-full_width_count(local)
|
223
|
-
[id.to_s.rjust(3), name.ljust(name_length),local.ljust(local_length), global.center(10)].join(' | ')
|
224
|
-
end
|
225
|
-
|
226
|
-
def full_width_count(string)
|
227
|
-
string.each_char.select{|char| !(/[ -~��-��]/.match(char))}.count
|
228
|
-
end
|
229
|
-
|
230
|
-
def add_sources
|
231
|
-
cont = {}
|
232
|
-
@data_name.each{|name|
|
233
|
-
printf("%s ? ", name)
|
234
|
-
tmp = gets.chomp
|
235
|
-
cont[name.to_sym] = tmp
|
236
|
-
}
|
237
|
-
@src[:srcs] << cont
|
238
|
-
show_sources
|
239
|
-
end
|
240
|
-
|
241
|
-
def read_sources
|
242
|
-
file = File.open(DATA_FILE,'r')
|
243
|
-
@src = YAML.load(file.read)
|
244
|
-
file.close
|
245
|
-
@target = @src[:target]
|
246
|
-
@l_dir=@src[:srcs][@target][:local_dir]
|
247
|
-
end
|
248
|
-
end
|
249
|
-
end
|
250
|
-
|
251
|
-
module DataFiles
|
252
|
-
def self.prepare(data_path)
|
253
|
-
create_file_if_not_exists(data_path)
|
254
|
-
end
|
255
|
-
|
256
|
-
def self.create_file_if_not_exists(data_path)
|
257
|
-
return if File::exists?(data_path)
|
258
|
-
create_data_file(data_path)
|
259
|
-
end
|
260
|
-
|
261
|
-
def self.create_data_file(data_path)
|
262
|
-
print "make #{data_path}\n"
|
263
|
-
init_data_file(data_path)
|
264
|
-
end
|
265
|
-
|
266
|
-
# initialize source file by dummy data
|
267
|
-
def self.init_data_file(data_path)
|
268
|
-
@src = {:target => 0, :editor_command => 'open -a mi',
|
269
|
-
:srcs=>[{:nick_name => 'hoge', :local_dir => 'hogehoge', :local_uri => 'http://localhost/~hoge',
|
270
|
-
:global_dir => 'hoge@global_host:/hoge', :global_uri => 'http://hoge'}]}
|
271
|
-
file = File.open(data_path,'w')
|
272
|
-
YAML.dump(@src,file)
|
273
|
-
file.close
|
274
|
-
end
|
275
|
-
private_class_method :create_file_if_not_exists, :create_data_file, :init_data_file
|
276
|
-
end
|
277
|
-
|
278
|
-
|
data/lib/.#hikiutils.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
bob@bob.local.8100
|