miyano 0.3.3 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/miyano/build/bear.rb +21 -1
- data/lib/miyano/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3fc3f55facf0a7bc6b82570acb54e79c45272211fd7a6e5c7f22890d58cae2dc
|
4
|
+
data.tar.gz: b0ac39866dc9deedb09d5bb056cc080cfe17f9f4fa95737b541c8f14ecee15a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3678505af37a97f470ce8eee04f4d2dabee320e3c9f017b571924d78e8b1075dccdb39b84c1b72b35933f13997733237dc845fb01c8e8e2e6f289888438cdb78
|
7
|
+
data.tar.gz: f2d4474c1e52b1d09526bf6e26de1c0c416d093f5bdc92c2107038372b31fea64cab7f84137c6d24b47b0fc0222bab325f293f5deb8a3d1dcee3acaf79b42b06
|
data/lib/miyano/build/bear.rb
CHANGED
@@ -18,8 +18,8 @@ module Miyano
|
|
18
18
|
#zipdir = zipdir.force_encoding "UTF-8"
|
19
19
|
zipdir = getZipDir bearnote.entries[0].name
|
20
20
|
assets = bearnote.glob("#{zipdir}/assets/*")
|
21
|
+
dir = "_site/#{name}/assets"
|
21
22
|
assets.each do |asset|
|
22
|
-
dir = "_site/#{name}/assets"
|
23
23
|
FileUtils.mkdir_p dir
|
24
24
|
path = File.join dir, File.basename(asset.name)
|
25
25
|
asset.extract path unless File.exist? path
|
@@ -33,6 +33,7 @@ module Miyano
|
|
33
33
|
File.open("_site/#{name}/index.html", "w") do |html|
|
34
34
|
html.write render_bear(f, text)
|
35
35
|
end
|
36
|
+
auto_orient_imgs(dir) if Dir.exist? dir
|
36
37
|
end
|
37
38
|
end
|
38
39
|
|
@@ -57,5 +58,24 @@ module Miyano
|
|
57
58
|
end
|
58
59
|
return str
|
59
60
|
end
|
61
|
+
|
62
|
+
def auto_orient_imgs(dir)
|
63
|
+
return unless check_imagemagick
|
64
|
+
imgs = Dir["#{dir}/*.{jpg,jpeg,JPG,JPEG}"]
|
65
|
+
imgs.each do |img|
|
66
|
+
`convert -auto-orient #{img.inspect} #{img.inspect}`
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
def check_imagemagick
|
71
|
+
system "convert -version >/dev/null"
|
72
|
+
system "brew install imagemagick graphicsmagick" unless $?.success?
|
73
|
+
unless $?.success?
|
74
|
+
system "/usr/bin/ruby -e '$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)'"
|
75
|
+
system "brew install imagemagick graphicsmagick" if $?.success?
|
76
|
+
end
|
77
|
+
system "convert -version >/dev/null"
|
78
|
+
end
|
79
|
+
|
60
80
|
end
|
61
81
|
end
|
data/lib/miyano/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: miyano
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- wuusn
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|