review-retrovert 0.2.0 → 0.3.2

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: 8bf0cd9b4a0d4f470b632d01139d7fadeeea5715aa21a6f95c21407417525e8a
4
- data.tar.gz: 6d0c23b0e51d833ee212e5769be4d61f372ccd830238902f1383d049b5d7fba1
3
+ metadata.gz: e40dda814381806e0927906afc41f12020c6208c5dae0dcddd8ac764bd641fd0
4
+ data.tar.gz: 43a77d50400f9241a8a3186bd1f243a9efc3a564151d2ed14779d80a30cc052a
5
5
  SHA512:
6
- metadata.gz: e0d0710345f4749d18892c08146e73a0d98c3b03dec36e4e75d6b903eea0e3ab2dc6a98c2a93244767fe49ccc9989df62385f47e6ffafc2c96169355d7815a7b
7
- data.tar.gz: f8bf9545afbc5547084ff85fcbcc979e7ffc2a2643e3d7bf9e1e425a6de30ffa8489a69c9f898f5be4b20603f2f6e94269ac51a04959ae99c4100ae41ea370b5
6
+ metadata.gz: 94d70f7740602edc84f8e87fa0d9317481e61f179fa054a55267b8635f5b89f9fa2d506e6b99ed453c3babed9e1c1a20001cb6998fdb88c0eb749035520a03df
7
+ data.tar.gz: 6afa54492f1a57f1b5cf5d9066e173cd7113ce5e5d7a3544656c7464cf8393b8709468ebe50e558d488b18da198c71e924384b9cbd752631f174d4f1d5c28885
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- review-retrovert (0.2.0)
4
+ review-retrovert (0.3.2)
5
5
  review (>= 3.2.0, < 4.0)
6
6
  thor
7
7
 
@@ -9,6 +9,7 @@ module ReVIEW
9
9
 
10
10
  def initialize
11
11
  @basedir = nil
12
+ @srccontentsdir = nil
12
13
  @outimagedir = nil
13
14
  @logger = ReVIEW.logger
14
15
  @configs = YamlConfig.new
@@ -37,10 +38,9 @@ module ReVIEW
37
38
  end
38
39
 
39
40
  def copy_contents(outdir)
40
- contentdir = @config['contentdir']
41
- path = File.join(@basedir, contentdir)
42
- outpath = File.join(outdir, contentdir)
43
- FileUtils.mkdir_p(outpath)
41
+ path = File.join(@basedir, @srccontentsdir)
42
+ # outpath = File.join(outdir, srccontentsdir)
43
+ # FileUtils.mkdir_p(outpath)
44
44
  # FileUtils.cp_r(Dir.glob(File.join(path, '*.re')), outpath)
45
45
  FileUtils.cp_r(Dir.glob(File.join(path, '*.re')), outdir)
46
46
  end
@@ -52,8 +52,13 @@ module ReVIEW
52
52
  outpath = File.join(outdir, outimagedir)
53
53
  FileUtils.mkdir_p(outpath)
54
54
  image_ext = @config['image_ext']
55
+ srcroot = Pathname.new(srcpath)
55
56
  image_ext.each { |ext|
56
- FileUtils.cp_r(Dir.glob(File.join(srcpath, "**/*.#{ext}")), outpath)
57
+ Dir.glob(File.join(srcpath, "**/*.#{ext}")).each { |srcimg|
58
+ outimg = File.join(outpath, Pathname.new(srcimg).relative_path_from(srcroot))
59
+ FileUtils.makedirs(File.dirname(outimg))
60
+ FileUtils.cp(srcimg, outimg)
61
+ }
57
62
  }
58
63
  @configs.rewrite_yml('imagedir', outimagedir)
59
64
  end
@@ -103,8 +108,9 @@ module ReVIEW
103
108
  files = contentfiles.is_a?(String) ? contentfiles.split(/\R/) : contentfiles
104
109
  files.each do |content|
105
110
  contentpath = File.join(contentdir, content)
106
- unless FileUtils.exist?(contentpath)
107
- srcpath = File.join(@basedir, content)
111
+ unless File.exist?(contentpath)
112
+ srcpath = File.join(File.join(@basedir, @srccontentsdir), content)
113
+ # info srcpath
108
114
  if File.exist?(srcpath)
109
115
  FileUtils.cp(srcpath, contentdir)
110
116
  end
@@ -116,7 +122,6 @@ module ReVIEW
116
122
  def update_contents(outdir, options)
117
123
  yamlfile = @config['catalogfile']
118
124
  abspath = File.absolute_path(outdir)
119
- # contentdir = File.join(abspath, @config['contentdir'])
120
125
  contentdir = abspath
121
126
  info 'replace //sideimage to //image'
122
127
  info 'replace starter inline command'
@@ -127,8 +132,9 @@ module ReVIEW
127
132
  update_content_files(outdir, contentdir, catalog.appendix())
128
133
  update_content_files(outdir, contentdir, catalog.postdef())
129
134
  else
130
- copy_contents(outdir)
131
- update_content_files(outdir, contentdir, Dir.glob(File.join(abspath, '*.re')))
135
+ # copy_contents(outdir)
136
+ contentsfiles = Pathname.glob(File.join(File.join(@basedir, @srccontentsdir), '*.re')).map(&:basename)
137
+ update_content_files(outdir, contentdir, contentsfiles)
132
138
  end
133
139
  end
134
140
 
@@ -143,6 +149,7 @@ module ReVIEW
143
149
  @configs.open(yamlfile)
144
150
  @config = @configs.config
145
151
  @basedir = @configs.basedir
152
+ @srccontentsdir = @config['contentdir']
146
153
  end
147
154
 
148
155
  def create_initial_project(outdir, options)
@@ -1,5 +1,5 @@
1
1
  module ReVIEW
2
2
  module Retrovert
3
- VERSION = "0.2.0"
3
+ VERSION = "0.3.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: review-retrovert
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - srz_zumix
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-06-28 00:00:00.000000000 Z
11
+ date: 2020-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor