juli 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 0332b51197f16c985e33f0b14f17de94e1e5c7c8
4
- data.tar.gz: d44577a0524a445c3d8edea6d1319f2517222ff8
2
+ SHA256:
3
+ metadata.gz: 23d7f4a628fca794dbc15c32e627de9887c5d95df32de6047985c1fdf69783a8
4
+ data.tar.gz: 1655dbe0f42221c7ca44afa3c1e1503032d38bd2e01bddd7f453da23fcfa0fe8
5
5
  SHA512:
6
- metadata.gz: 04676c102da50e2181a0f9351c06c38a2d0c0e4fc1d1b266a1f8e86f176d58927e2dd07d5b252df5a5505567f8f3eb29b4bbb9ae515bd0642350f061c5e8acf3
7
- data.tar.gz: ad4a0fa85b3a0d56eae90d6cb92e511fcf3c9efdff0b452a18a1f58c3146d7fa6a5faae11c11be4ebf6e713dbabc53e658426d58fabe9610571a0487026ab61c
6
+ metadata.gz: 4b3e6179071d46103f5dfedf5a8fd5b9be480faca6863fe835b388d8d8f647f6111f17ed7024bd5c2435aa59810133cfca3633179100526fa917d3bd7adb5952
7
+ data.tar.gz: ff2588d8e3321ab95df3f0e3f813f7011efcc22a4c3285ef09d5a5582f9399f58ab693d288f298ec83702c75b5d762e0b0fdaf79a3a831079293fd392b2aef2d
data/.gitignore CHANGED
@@ -20,7 +20,6 @@
20
20
  /Gemfile.lock
21
21
  /_yardoc/
22
22
  /coverage/
23
- /doc/
24
23
  /pkg/
25
24
  /spec/reports/
26
25
  /tmp/
data/README.rdoc CHANGED
@@ -37,7 +37,7 @@ Or install it yourself as:
37
37
  === Juli Version
38
38
 
39
39
  1.*:: obsoleted
40
- 2.*:: for ruby2.2
40
+ 2.*:: >= ruby2.2
41
41
 
42
42
  === Development
43
43
 
data/Rakefile CHANGED
@@ -84,7 +84,7 @@ namespace :doc do
84
84
  end
85
85
 
86
86
  desc 'clean working files'
87
- task clean: ['doc:clobber_app', :'test:coverage:clobber_juli'] do
87
+ task clean: ['doc:clobber_app'] do
88
88
  sh "find . -name '*~' -exec rm {} \\;"
89
89
  sh 'rm', '-rf', *[parsers, test_conf_outout_top,
90
90
  'InstalledFiles', '.config', # setup.rb generated
data/doc/.juli/config CHANGED
@@ -1,5 +1,5 @@
1
1
  output_top: ../doc_html/
2
- template: sourceforge.html
2
+ template: github.html
3
3
  ext: .shtml
4
4
  #amazon: '<iframe src="http://rcm-jp.amazon.co.jp/e/cm?t=wells00-22&o=9&p=8&l=as1&asins=%{asins}&ref=tf_til&fc1=000000&IS2=1&lt1=_blank&m=amazon&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr" style="float:right; width:120px;height:240px;margin:3px" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>'
5
5
  amazon: '<iframe src="http://rcm-jp.amazon.co.jp/e/cm?t=wells00-22&o=9&p=8&l=as1&asins=%{asins}&ref=tf_til&fc1=000000&IS2=1&lt1=_blank&m=amazon&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr" style="float:right; width:120px;height:240px;margin:30px" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>'
@@ -1,7 +1,7 @@
1
1
  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
2
  <html>
3
3
  <%#
4
- This template is only for juli project's sourceforge document.
4
+ This template is only for juli project's document.
5
5
 
6
6
  DO NOT MODIFY THIS FILE DIRECTORY!
7
7
 
@@ -71,10 +71,8 @@ contents:: draw contents of page
71
71
  <br/><br/>
72
72
  <%= body %>
73
73
  <hr/>
74
- <a href="http://sourceforge.net/projects/jjjuli"
75
- ><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=390715&amp;type=8"
76
- width="80" height="15"
77
- alt="Get jj_juli at SourceForge.net. Fast, secure and Free Open Source software downloads"
78
- /></a> | Generated by <a href='http://jjjuli.sourceforge.net/'>juli <%= Juli::VERSION %></a>
74
+ <a href="https://github.com/fuminori-ido/juli"
75
+ ><img height="32" width="32" src="https://cdn.jsdelivr.net/npm/simple-icons@latest/icons/github.svg"
76
+ /></a> Generated by <a href='https://github.com/fuminori-ido/juli'>juli <%= Juli::VERSION %></a>
79
77
  </body>
80
78
  </html>
data/doc/.juli/slidy.html CHANGED
@@ -182,11 +182,9 @@ so that please do not delete them.
182
182
  <table width='100%'>
183
183
  <tr>
184
184
  <td>
185
- <a href="http://sourceforge.net/projects/jjjuli"
186
- ><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=390715&amp;type=8"
187
- width="80" height="15"
188
- alt="Get jj_juli at SourceForge.net. Fast, secure and Free Open Source software downloads"
189
- /></a> | Generated by <a href='http://jjjuli.sourceforge.net/'>juli <%= Juli::VERSION %></a>
185
+ <a href="https://github.com/fuminori-ido/juli"
186
+ ><img height="32" width="32" src="https://cdn.jsdelivr.net/npm/simple-icons@latest/icons/github.svg"
187
+ /></a> Generated by <a href='https://github.com/fuminori-ido/juli'>juli <%= Juli::VERSION %></a>
190
188
  </td>
191
189
  <td align=right>
192
190
  slide <span id=curr_page></span>/<span id=total_page></span>
@@ -93,11 +93,9 @@ so that please do not delete them.
93
93
  <table width='100%'>
94
94
  <tr>
95
95
  <td>
96
- <a href="http://sourceforge.net/projects/jjjuli"
97
- ><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=390715&amp;type=8"
98
- width="80" height="15"
99
- alt="Get jj_juli at SourceForge.net. Fast, secure and Free Open Source software downloads"
100
- /></a> | Generated by <a href='http://jjjuli.sourceforge.net/'>juli <%= Juli::VERSION %></a>
96
+ <a href="https://github.com/fuminori-ido/juli"
97
+ ><img height="32" width="32" src="https://cdn.jsdelivr.net/npm/simple-icons@latest/icons/github.svg"
98
+ /></a> Generated by <a href='https://github.com/fuminori-ido/juli'>juli <%= Juli::VERSION %></a>
101
99
  </td>
102
100
  <td align=right>
103
101
  slide <span id=curr_page></span>/<span id=total_page></span>
data/doc/index.txt CHANGED
@@ -173,21 +173,6 @@ text file revision control is handled by je(1).
173
173
 
174
174
  $ gem install juli
175
175
 
176
- == from package
177
- Prerequisites:
178
- * rsync
179
- * ruby-1.9
180
- * RMagick (for photo(macro))
181
- * sdbm (for tag(macro))
182
- * i18n
183
-
184
- 1. download package from http://sourceforge.net/projects/jjjuli/files/
185
- 1. run setup.rb as follows:
186
-
187
- $ tar zxvf juli-#.##.##.tgz
188
- $ cd juli-#.##.##
189
- $ ruby setup.rb # you may need 'sudo'
190
-
191
176
  == from repository
192
177
 
193
178
  Prerequisites:
@@ -199,16 +184,12 @@ Prerequisites:
199
184
  * rake
200
185
  * git
201
186
 
202
- racc tool is required when you download from Sourceforge repository
203
- and install it.
204
187
 
205
- $ git clone git://jjjuli.git.sourceforge.net/gitroot/jjjuli/jjjuli
206
- $ cd jjjuli
188
+ $ git clone git@github.com:fuminori-ido/juli.git
189
+ $ cd juli
207
190
  $ rake # generate ruby source from *.y files
208
191
  $ ruby setup.rb # you may need 'sudo'
209
192
 
210
- * prototype.js is used (included in this package).
211
-
212
193
  = See Also
213
194
 
214
195
  == Sub topics
@@ -248,12 +229,10 @@ I found the following competitors also after the comparison research:
248
229
 
249
230
  Any feedback is welcome. Please check the followings:
250
231
 
251
- * <a href='http://sourceforge.net/projects/jjjuli/reviews/'>Love/Hate</a>
252
- * <a href='http://sourceforge.net/projects/jjjuli/forums'>Help</a>
253
- * <a href='http://sourceforge.net/tracker/?group_id=390715'>Bug Report, Feature Requests</a>
232
+ * <a href='https://github.com/fuminori-ido/juli/issues'>Bug Report, Feature Requests</a>
254
233
 
255
234
  == Author
256
- Fuminori Ido, https://sourceforge.net/users/ido00
235
+ Fuminori Ido, https://github.com/fuminori-ido
257
236
 
258
237
  == License
259
238
 
data/doc/juli(1).txt CHANGED
@@ -160,7 +160,7 @@ index:: juli top document
160
160
 
161
161
  = MISC
162
162
  == Author
163
- Fuminori Ido, https://sourceforge.net/users/ido00
163
+ Fuminori Ido, https://github.com/fuminori-ido/juli
164
164
 
165
165
  == License
166
166
 
@@ -16,7 +16,7 @@ is 0 then it means successful.
16
16
 
17
17
  = MISC
18
18
  == Author
19
- Fuminori Ido, https://sourceforge.net/users/ido00
19
+ Fuminori Ido, https://github.com/fuminori-ido
20
20
 
21
21
  == License
22
22
 
Binary file
Binary file
data/doc/photo(macro).txt CHANGED
@@ -32,17 +32,23 @@ Example:
32
32
 
33
33
  will be:
34
34
 
35
+ <hr/>
36
+
35
37
  \{photo 2012-04-22/DCIM/101_PANA/P1010441.JPG}
36
38
 
37
39
  When I visited the ruins of Hachioji-Castle in Japan,
38
40
  I saw many beautiful statue of Buddha.
39
41
  Here is one of them.
40
42
 
43
+ <hr/>
44
+
45
+ <br clear='all' />
46
+
41
47
  In general, in Juli wiki text, write as follows:
42
48
 
43
49
  \{photo a/b/c.jpg}
44
50
 
45
- Where, a/b/c.jpg is a relative-path of the photo file from 'mount'
51
+ Where, a/b/c.jpg is a relative-path of the photo file from 'storage'
46
52
  directory (see 'setup' section below).
47
53
 
48
54
  As you see this example, by clicking this small photo,
@@ -64,23 +70,29 @@ Where,
64
70
  * 'output_top' above is the juli configuration parameter specified in .juli/config
65
71
  for HTML generated document top directory.
66
72
  See juli(1) and/or tutorial.
67
- * 'photo.mount' above is new configuration parameter introduced in this macro
73
+ * 'photo.storages' above is configuration parameter in this macro
68
74
  for all of your photo master file directory which may include
69
75
  some private photos. Of course, only photos you specify in
70
76
  \\{photo ...} macro are copied to public_photo as above figure shows.
71
77
  See 'Setup' section below.
78
+ * 'photo.mount' is deprecated since v2.2.0
72
79
 
73
80
  == Setup
74
81
 
75
- 1. Decide one location of directory of all of your photos
76
- on the same file system.
77
- We call it 'mount' directory in this macro.
78
- Maintenace of the mount directory is up to you.
79
- If you have several directories, create one directory, and
80
- move the directories under it or symlink to each.
82
+ 1. For images in juli, use local photo directory and/or AWS S3.
83
+ We call it 'photo.storages' in this macro.
84
+ Maintenace of the 'photo.storages' is up to you.
81
85
  1. In .juli/config, setup photo related entries like the followings:
82
86
  photo:
83
- mount: /home/wells/photo
87
+ storages:
88
+ - kind: local
89
+ dir: /home/wells/photo
90
+ - kind: aws
91
+ params:
92
+ region: ap-northeast-1
93
+ profile: juli
94
+ bucket: juli
95
+ prefix: photo
84
96
  small:
85
97
  width: 512
86
98
  style: '...'
@@ -89,8 +101,10 @@ Where,
89
101
 
90
102
  Where, each key means as follows:
91
103
 
92
- mount::
93
- Top directory of photos.
104
+ storages[].kind::
105
+ either 'local' or 'aws'
106
+ storages[].dir::
107
+ Top directory of photos when kind == 'local'.
94
108
  It is usually photo master file directory, photo uploade directory, or
95
109
  SD-card back-up directory on your PC.
96
110
  It SHOULD be NON-PUBLIC directory to protect annonymous
@@ -100,6 +114,12 @@ mount::
100
114
  Relative path can be used, which is relative from JULI_REPO, not
101
115
  from .juli/config.
102
116
  Example: /home/wells/photo
117
+ storages[].params::
118
+ S3 access information when kind == 'aws'.
119
+ storages[].bucket::
120
+ S3 bucket name when kind == 'aws'.
121
+ storages[].prefix::
122
+ (not used now)
103
123
  small::
104
124
  small photo related configurations. See below for the detail.
105
125
  small.width::
@@ -108,7 +128,7 @@ small.width::
108
128
  small.style::
109
129
  Small photo's style sheet.
110
130
  'img.juli_photo_small' entry in the
111
- doc/.juli/sourceforge.html file (in this package) is one of the example.
131
+ doc/.juli/github.html file (in this package) is one of the example.
112
132
  large::
113
133
  large photo related configurations. See below for the detail.
114
134
  large.width::
@@ -124,13 +144,13 @@ This setup is one-shot task.
124
144
 
125
145
  == Maintenance
126
146
 
127
- When you add photo, just sync (by e.g. rsync) your photo SD card and
128
- 'mount' directory.
147
+ When you add photo in you 'storage', just execute 'juli(1)', then
148
+ photo in the storage is copied to public site.
129
149
 
130
150
  == Security
131
151
 
132
- 1. When you set 'mount', it SHOULD be out-of-url so that any photo
133
- under the 'mount' cannot be accessed via internet.
152
+ 1. When you set 'storages[].dir', it SHOULD be out-of-url so that any photo
153
+ under the 'dir' cannot be accessed via internet.
134
154
  1. Only photo referring by this macro can be accessed via internet.
135
155
 
136
156
  == File permission
@@ -140,7 +160,7 @@ The following permission is required on juli(1):
140
160
  * write permission on output_top/public_photo/ directory.
141
161
  Where, output_top is the directory for generated HTML
142
162
  specified at .juli/config.
143
- * read permission under 'mount' directory.
163
+ * read permission under 'storage'.
144
164
 
145
165
  == Example
146
166
 
@@ -149,7 +169,15 @@ The following permission is required on juli(1):
149
169
  <a href='#'>This document</a>'s \\{photo} macro setup is as follows:
150
170
 
151
171
  photo:
152
- mount: ../sample/protected_photo/
172
+ storages:
173
+ - kind: local
174
+ dir: '/home/wells/photo'
175
+ - kind: aws
176
+ params:
177
+ region: ap-northeast-1
178
+ profile: juli
179
+ bucket: juli
180
+ prefix: ''
153
181
  small:
154
182
  width: 200
155
183
  style: 'float: right'
data/doc/template.txt CHANGED
@@ -206,8 +206,8 @@ but the purpose is different.
206
206
  Helper is used for \{!template} and macro is used in juli wiki page.
207
207
 
208
208
  Currently, there is no plan to integrate them.
209
- If you need, please request me it with the detailed reason via sourceforge page
210
- http://sourceforge.net/projects/jjjuli/
209
+ If you need, please request me it with the detailed reason via github page
210
+ https://github.com/fuminori-ido/juli
211
211
  -&gt; Tracker
212
212
  -&gt; Feature Request, thank you!
213
213
 
data/juli.gemspec CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
8
8
  spec.name = "juli"
9
9
  spec.version = Juli::VERSION
10
10
  spec.authors = ["ido"]
11
- spec.email = ["fuminori_ido@yahoo.co.jp"]
11
+ spec.email = ["ido-gh@wtech.jp"]
12
12
 
13
13
  spec.summary = %q{Offline wiki, and outline processor}
14
14
  spec.description = %q{Offline wiki, and outline processor}
@@ -22,12 +22,15 @@ Gem::Specification.new do |spec|
22
22
  spec.executables = 'juli'
23
23
  spec.require_paths = ["lib"]
24
24
 
25
+ spec.add_runtime_dependency 'aws-sdk-s3'
25
26
  spec.add_runtime_dependency 'i18n'
26
27
  spec.add_runtime_dependency 'rmagick'
27
28
 
29
+ spec.add_development_dependency 'byebug'
28
30
  spec.add_development_dependency 'racc'
29
31
  spec.add_development_dependency 'simplecov'
30
- spec.add_development_dependency "bundler", "~> 1.9"
32
+ spec.add_development_dependency "bundler", "~> 2.0"
31
33
  spec.add_development_dependency "rake", "~> 10.0"
32
34
  spec.add_development_dependency 'rdoc'
35
+ spec.add_development_dependency 'test-unit'
33
36
  end
@@ -1,7 +1,9 @@
1
+ require 'aws-sdk-s3'
1
2
  require 'fileutils'
2
3
  require 'digest/sha1'
3
4
  require 'rmagick'
4
5
  require 'pp'
6
+ require 'tmpdir'
5
7
 
6
8
  module Juli
7
9
  module Macro
@@ -14,7 +16,12 @@ module Juli
14
16
  PUBLIC_PHOTO_DIR_DEFAULT = 'public_photo'
15
17
  SEED_DEFAULT = '-- Juli seed default!! --'
16
18
  CONF_DEFAULT = {
17
- 'mount' => '/home/YOUR_NAME/Photos',
19
+ 'storages' => [
20
+ {
21
+ 'kind' => 'local',
22
+ 'dir' => '/home/YOUR_NAME/Photos',
23
+ },
24
+ ],
18
25
  'small' => {
19
26
  'width' => 512, # default small width in pixel
20
27
  'style' => 'float: right'
@@ -32,15 +39,35 @@ module Juli
32
39
  # Photo macro setup sample is as follows.
33
40
  #
34
41
  #photo:
35
- # mount: '#{CONF_DEFAULT['mount']}'
42
+ # mount: '#{CONF_DEFAULT['mount']}' # DEPERECATED, use storages[].kind = 'local'
43
+ # storages:
44
+ # - kind: local
45
+ # dir: '#{CONF_DEFAULT['mount']}'
46
+ # - kind: aws
47
+ # params:
48
+ # region: ap-northeast-1
49
+ # profile: juli
50
+ # bucket: juli
51
+ # prefix: photo
36
52
  # small:
37
- # width: #{CONF_DEFAULT['small']['width']}
38
- # style: '#{CONF_DEFAULT['small']['style']}'
53
+ # width: #{CONF_DEFAULT['small']['width']}
54
+ # style: '#{CONF_DEFAULT['small']['style']}'
39
55
  # large:
40
- # width: #{CONF_DEFAULT['large']['width']}
56
+ # width: #{CONF_DEFAULT['large']['width']}
41
57
  EOM
42
58
  end
43
59
 
60
+ def initialize
61
+ super
62
+ for storage in conf_photo && conf_photo['storages'] || {}
63
+ if storage['kind'] == 'aws'
64
+ _h = {}
65
+ storage['params'].each{|k,v| _h[k.to_sym] = v} # to sym
66
+ @aws = ::Aws::S3::Client.new(_h)
67
+ end
68
+ end
69
+ end
70
+
44
71
  def set_conf_default(conf)
45
72
  set_conf_default_sub(conf, 'photo', CONF_DEFAULT)
46
73
  end
@@ -64,8 +91,8 @@ EOM
64
91
  # public photo directory is used to:
65
92
  #
66
93
  # * store converted photo from original one
67
- # * protect private photo in 'mount' directory from public web access
68
- # by copying (with conversion) to it on demand.
94
+ # * protect private photo in 'mount' directory and storage
95
+ # from public web access by copying (with conversion) to it on demand.
69
96
  #
70
97
  # === INPUTS
71
98
  # url:: when true, return url, else, return physical file-system path
@@ -106,29 +133,23 @@ EOM
106
133
  #
107
134
  # and return the path.
108
135
  #
136
+ # source photo is looked up under the following order:
137
+ # 1. local directory designated by 'mount' config, if defined
138
+ # 1. remote storage designated by 'storage' config, if defined
139
+ #
109
140
  # === INPUTS
110
141
  # path:: photo-macro path argument
111
142
  # size:: :small, or :large
112
143
  # url:: when true, return url, else, return physical file-system path
113
144
  def intern(path, size = :small, url = true)
114
- protected_path = File.join(conf_photo['mount'], path)
115
- if !File.exist?(protected_path)
116
- warn("WARN: no source photo path(#{protected_path})")
117
- return ''
145
+ if conf_photo['mount']
146
+ STDERR.printf "DEPERECATED WARNING: 'mount' is deprecated; use 'storages'\n"
147
+ result = intern_local_mount(conf_photo['mount'], path, size, url)
148
+ return result if result != ''
118
149
  end
119
150
 
120
- public_phys_path = photo_path(path, size, false)
121
- if !File.exist?(public_phys_path) ||
122
- File::Stat.new(public_phys_path).mtime < File::Stat.new(protected_path).mtime
123
-
124
- img = Magick::ImageList.new(protected_path)
125
- width = (s = conf_photo[size.to_s]) && s['width']
126
- img.resize_to_fit!(width, img.rows * width / img.columns)
127
- self.rotate(img).
128
- strip!.
129
- write(public_phys_path).destroy!
130
- end
131
- photo_path(path, size, url)
151
+ result = intern_storages(path, size, url)
152
+ return result if result != ''
132
153
  end
133
154
 
134
155
  # return <img...> HTML tag for the photo with this macro features.
@@ -149,7 +170,8 @@ EOM
149
170
  @conf_photo ||= conf['photo']
150
171
  end
151
172
 
152
- private
173
+ private
174
+
153
175
  def set_conf_default_sub(hash, key, val)
154
176
  case val
155
177
  when Hash
@@ -161,6 +183,80 @@ EOM
161
183
  hash[key] = val if !hash[key]
162
184
  end
163
185
  end
186
+
187
+ # @return '' if not found
188
+ def intern_local_mount(mount_dir, path, size, url)
189
+ protected_path = File.join(mount_dir, path)
190
+ if !File.exist?(protected_path)
191
+ #debug("DEBUG: no source photo path(#{protected_path})")
192
+ return ''
193
+ end
194
+
195
+ public_phys_path = photo_path(path, size, false)
196
+ if !File.exist?(public_phys_path) ||
197
+ File::Stat.new(public_phys_path).mtime < File::Stat.new(protected_path).mtime
198
+
199
+ img = Magick::ImageList.new(protected_path)
200
+ width = (s = conf_photo[size.to_s]) && s['width']
201
+ img.resize_to_fit!(width, img.rows * width / img.columns)
202
+ self.rotate(img).
203
+ strip!.
204
+ write(public_phys_path).destroy!
205
+ end
206
+ photo_path(path, size, url)
207
+ end
208
+
209
+ def intern_storages(path, size, url)
210
+ result = ''
211
+ for storage in conf_photo && conf_photo['storages'] || {}
212
+ result = case storage['kind']
213
+ when 'local'
214
+ intern_local_mount(storage['dir'], path, size, url)
215
+ when 'aws'
216
+ intern_aws(storage, path, size, url)
217
+ else
218
+ raise "unsupported kind of storage(#{storage['kind']})"
219
+ end
220
+ return result if result != ''
221
+ end
222
+ end
223
+
224
+ # FIXME: I gave up to use 'fog' gem so that I'm using AWS S3 here now.
225
+ # I welcome somebody implements fog version!
226
+ def intern_aws(storage, path, size, url)
227
+ return '' if storage.nil? || storage.empty?
228
+
229
+ resp = nil
230
+ begin
231
+ resp = @aws.head_object(bucket: storage['bucket'], key: path)
232
+ rescue ::Aws::S3::Errors::NotFound
233
+ warn("WARN: no source photo path(#{path}) in storage")
234
+ return ''
235
+ end
236
+
237
+ public_phys_path = photo_path(path, size, false)
238
+ if !File.exist?(public_phys_path) ||
239
+ File::Stat.new(public_phys_path).mtime < resp.last_modified
240
+
241
+ work_path = tmpname('juli_photo')
242
+ resp = @aws.get_object(bucket: storage['bucket'],
243
+ key: path,
244
+ response_target: work_path)
245
+ img = Magick::ImageList.new(work_path)
246
+ width = (s = conf_photo[size.to_s]) && s['width']
247
+ img.resize_to_fit!(width, img.rows * width / img.columns)
248
+ self.rotate(img).
249
+ strip!.
250
+ write(public_phys_path).destroy!
251
+ #FileUtils.rm_f(work_path)
252
+ end
253
+ photo_path(path, size, url)
254
+ end
255
+
256
+ def tmpname(base_name)
257
+ t = Time.now.strftime("%Y%m%d")
258
+ "/tmp/#{base_name}-#{t}-#{$$}-#{rand(0x100000000).to_s(36)}"
259
+ end
164
260
  end
165
261
  end
166
262
  end
@@ -59,6 +59,6 @@ contents:: draw contents of page
59
59
  <br/><br/>
60
60
  <%= body %>
61
61
  <hr/>
62
- Generated by <a href='http://jjjuli.sourceforge.net/'>juli <%= Juli::VERSION %></a>
62
+ Generated by <a href='https://github.com/fuminori-ido/juli'>juli <%= Juli::VERSION %></a>
63
63
  </body>
64
64
  </html>
@@ -77,6 +77,6 @@ Facebook developer site application registration page fo
77
77
  <%= fb_like %>
78
78
  <%= fb_comments %>
79
79
  <hr/>
80
- Generated by <a href='http://jjjuli.sourceforge.net/'>juli <%= Juli::VERSION %></a>
80
+ Generated by <a href='https://github.com/fuminori-ido/juli'>juli <%= Juli::VERSION %></a>
81
81
  </body>
82
82
  </html>
@@ -1,3 +1,7 @@
1
+ body {
2
+ line-height: 1.2em;
3
+ }
4
+
1
5
  p.default {
2
6
  padding-left: 10px;
3
7
  }
@@ -106,7 +110,13 @@ ol, ul {
106
110
 
107
111
  /* Dictionary list */
108
112
  table.juli_compact_dictionary {
109
- padding-left: 10px;
113
+ border: 1px solid #aaa;
114
+ margin-top: 0.5em;
115
+ margin-bottom: 0.5em;
116
+ margin-left: 1em;
117
+ }
118
+ table.juli_compact_dictionary td:nth-child(1) {
119
+ padding-right: 1em;
110
120
  }
111
121
  dl.juli_dictionary dt {
112
122
  margin-top: 0.5em;
@@ -144,6 +154,54 @@ div.sitemap {
144
154
  text-align: left;
145
155
  }
146
156
 
157
+
158
+ /*----------------------------------------------------------------
159
+ Additional
160
+ ----------------------------------------------------------------*/
161
+ div#header {
162
+ background: #62a5dc;
163
+ border-radius: 10px;
164
+ text-align: center;
165
+ color: white;
166
+ height: 8em;
167
+ }
168
+ div#header div.site_title {
169
+ padding-top: 30px;
170
+ padding-bottom: 5px;
171
+ font-size: 3em;
172
+ line-height: 1.2em;
173
+ }
174
+ div#header div.site_title a {
175
+ text-decoration: none;
176
+ color: white;
177
+ }
178
+ div#header div.description {
179
+ font-size: 90%;
180
+ padding-bottom: 30px;
181
+ }
182
+ img.juli_photo_small {
183
+ margin: 10px;
184
+ border-top: 2px solid #888;
185
+ border-left: 2px solid #888;
186
+ border-right: 2px solid black;
187
+ border-bottom: 2px solid black;
188
+ padding: 0px;
189
+ }
190
+
191
+ table.default {
192
+ border-collapse: collapse;
193
+ border: 1px solid #a84;
194
+ }
195
+ table.default th, table.default td {
196
+ border: 1px solid #888;
197
+ }
198
+ table.default th.digit, table.default td.digit {
199
+ text-align: right;
200
+ }
201
+ table.default th {
202
+ background-color: #8db;
203
+ }
204
+
147
205
  /*----------------------------------------------------------------
148
206
  Tag list
149
207
  ----------------------------------------------------------------*/
@@ -159,7 +217,6 @@ a.juli_tag_08 { font-size: 195%; }
159
217
  a.juli_tag_09 { font-size: 210%; }
160
218
  a.juli_tag_10 { font-size: 225%; }
161
219
 
162
-
163
220
  /*----------------------------------------------------------------
164
221
  Photo
165
222
  ----------------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  <html>
2
2
  <%#
3
- This template is only for juli project's sourceforge document.
3
+ This template is only for juli project's document.
4
4
  %>
5
5
  <!--
6
6
 
@@ -69,10 +69,8 @@ sitemap_order_by_mtime_DESC.html:: sitemap template (mtime decendant order)
69
69
  <%= body %>
70
70
  </table>
71
71
  <hr/>
72
- <a href="http://sourceforge.net/projects/jjjuli"
73
- ><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=390715&amp;type=8"
74
- width="80" height="15"
75
- alt="Get jj_juli at SourceForge.net. Fast, secure and Free Open Source software downloads"
76
- /></a> | Generated by <a href='http://jjjuli.sourceforge.net/'>juli <%= Juli::VERSION %></a>
72
+ <a href="https://github.com/fuminori-ido/juli"
73
+ ><img height="32" width="32" src="https://cdn.jsdelivr.net/npm/simple-icons@latest/icons/github.svg"
74
+ /></a> Generated by <a href='https://github.com/fuminori-ido/juli'>juli <%= Juli::VERSION %></a>
77
75
  </body>
78
76
  </html>
@@ -1,6 +1,6 @@
1
1
  <html>
2
2
  <%#
3
- This template is only for juli project's sourceforge document.
3
+ This template is only for juli project's document.
4
4
  %>
5
5
  <!--
6
6
 
@@ -69,10 +69,8 @@ sitemap.html:: sitemap template (alphabetical order)
69
69
  <%= body %>
70
70
  </table>
71
71
  <hr/>
72
- <a href="http://sourceforge.net/projects/jjjuli"
73
- ><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=390715&amp;type=8"
74
- width="80" height="15"
75
- alt="Get jj_juli at SourceForge.net. Fast, secure and Free Open Source software downloads"
76
- /></a> | Generated by <a href='http://jjjuli.sourceforge.net/'>juli <%= Juli::VERSION %></a>
72
+ <a href="https://github.com/fuminori-ido/juli"
73
+ ><img height="32" width="32" src="https://cdn.jsdelivr.net/npm/simple-icons@latest/icons/github.svg"
74
+ /></a> Generated by <a href='https://github.com/fuminori-ido/juli'>juli <%= Juli::VERSION %></a>
77
75
  </body>
78
76
  </html>
@@ -103,11 +103,9 @@ so that please do not delete them.
103
103
  <table width='100%'>
104
104
  <tr>
105
105
  <td>
106
- <a href="http://sourceforge.net/projects/jjjuli"
107
- ><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=390715&amp;type=8"
108
- width="80" height="15"
109
- alt="Get jj_juli at SourceForge.net. Fast, secure and Free Open Source software downloads"
110
- /></a> | Generated by <a href='http://jjjuli.sourceforge.net/'>juli <%= Juli::VERSION %></a>
106
+ <a href="https://github.com/fuminori-ido/juli"
107
+ ><img height="32" width="32" src="https://cdn.jsdelivr.net/npm/simple-icons@latest/icons/github.svg"
108
+ /></a> Generated by <a href='https://github.com/fuminori-ido/juli'>juli <%= Juli::VERSION %></a>
111
109
  </td>
112
110
  <td align=right>
113
111
  slide <span id=curr_page></span>/<span id=total_page></span>
@@ -1,7 +1,7 @@
1
1
  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
2
  <html>
3
3
  <%#
4
- This template is only for juli project's sourceforge document.
4
+ This template is only for juli project's document.
5
5
  %>
6
6
  <!--
7
7
 
@@ -62,10 +62,8 @@ contents:: draw contents of page
62
62
  <br/><br/>
63
63
  <%= body %>
64
64
  <hr/>
65
- <a href="http://sourceforge.net/projects/jjjuli"
66
- ><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=390715&amp;type=8"
67
- width="80" height="15"
68
- alt="Get jj_juli at SourceForge.net. Fast, secure and Free Open Source software downloads"
69
- /></a> | Generated by <a href='http://jjjuli.sourceforge.net/'>juli <%= Juli::VERSION %></a>
65
+ <a href="https://github.com/fuminori-ido/juli"
66
+ ><img height="32" width="32" src="https://cdn.jsdelivr.net/npm/simple-icons@latest/icons/github.svg"
67
+ /></a> Generated by <a href='https://github.com/fuminori-ido/juli'>juli <%= Juli::VERSION %></a>
70
68
  </body>
71
69
  </html>
@@ -93,11 +93,9 @@ so that please do not delete them.
93
93
  <table width='100%'>
94
94
  <tr>
95
95
  <td>
96
- <a href="http://sourceforge.net/projects/jjjuli"
97
- ><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=390715&amp;type=8"
98
- width="80" height="15"
99
- alt="Get jj_juli at SourceForge.net. Fast, secure and Free Open Source software downloads"
100
- /></a> | Generated by <a href='http://jjjuli.sourceforge.net/'>juli <%= Juli::VERSION %></a>
96
+ <a href="https://github.com/fuminori-ido/juli"
97
+ ><img height="32" width="32" src="https://cdn.jsdelivr.net/npm/simple-icons@latest/icons/github.svg"
98
+ /></a> Generated by <a href='https://github.com/fuminori-ido/juli'>juli <%= Juli::VERSION %></a>
101
99
  </td>
102
100
  <td align=right>
103
101
  slide <span id=curr_page></span>/<span id=total_page></span>
data/lib/juli/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Juli
2
- VERSION = "2.1.0"
2
+ VERSION = "2.2.0"
3
3
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: juli
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ido
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-05 00:00:00.000000000 Z
11
+ date: 2019-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: aws-sdk-s3
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: i18n
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -38,6 +52,20 @@ dependencies:
38
52
  - - ">="
39
53
  - !ruby/object:Gem::Version
40
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: byebug
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
41
69
  - !ruby/object:Gem::Dependency
42
70
  name: racc
43
71
  requirement: !ruby/object:Gem::Requirement
@@ -72,14 +100,14 @@ dependencies:
72
100
  requirements:
73
101
  - - "~>"
74
102
  - !ruby/object:Gem::Version
75
- version: '1.9'
103
+ version: '2.0'
76
104
  type: :development
77
105
  prerelease: false
78
106
  version_requirements: !ruby/object:Gem::Requirement
79
107
  requirements:
80
108
  - - "~>"
81
109
  - !ruby/object:Gem::Version
82
- version: '1.9'
110
+ version: '2.0'
83
111
  - !ruby/object:Gem::Dependency
84
112
  name: rake
85
113
  requirement: !ruby/object:Gem::Requirement
@@ -108,9 +136,23 @@ dependencies:
108
136
  - - ">="
109
137
  - !ruby/object:Gem::Version
110
138
  version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: test-unit
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
111
153
  description: Offline wiki, and outline processor
112
154
  email:
113
- - fuminori_ido@yahoo.co.jp
155
+ - ido-gh@wtech.jp
114
156
  executables:
115
157
  - juli
116
158
  extensions: []
@@ -128,8 +170,8 @@ files:
128
170
  - bin/juli_tb.rb
129
171
  - bin/setup
130
172
  - doc/.juli/config
173
+ - doc/.juli/github.html
131
174
  - doc/.juli/slidy.html
132
- - doc/.juli/sourceforge.html
133
175
  - doc/.juli/takahashi_method.html
134
176
  - doc/README_FOR_API
135
177
  - doc/compare.ods
@@ -235,7 +277,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
235
277
  version: '0'
236
278
  requirements: []
237
279
  rubyforge_project:
238
- rubygems_version: 2.4.5.5
280
+ rubygems_version: 2.7.6.2
239
281
  signing_key:
240
282
  specification_version: 4
241
283
  summary: Offline wiki, and outline processor