ttl2html 1.1.0 → 1.1.1

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
2
  SHA256:
3
- metadata.gz: 2d481c51d33a3f278444c1029dc50602c11d2b4d3e494e78884d4feabada2059
4
- data.tar.gz: c0402991e0ac87f10aa4afc09a89c53ab7aa1103cd4a6f8d7cd42601f3e7cec4
3
+ metadata.gz: 6bd052e74baedc74a4f4a5d3f78770d00f281dea52371c9b795fd48fc98c08c4
4
+ data.tar.gz: 320a243b01882fed22cda54f1403f420b795f2bc8a3a0bd68f8648003a827382
5
5
  SHA512:
6
- metadata.gz: aecbba96f8160b240d653eca3d41e5e6370f39b5805e96d07cbaafae5345e411950de991d053db5a0fbf5bdee1293e474035991968af39f751361cb272013c48
7
- data.tar.gz: 0d9992e7381665ef9b137473c46ac3a381674cc6d899ef2a4a16a18853437381eb78362cacef3b59850f29db5820242563c972842eb34cc5f4f5942f3f668120
6
+ metadata.gz: a6470f1e2fe766e98623869b1a0c08adba40e6bc8444d545d95fe42f9593ab2b805269e093a2efc69992acf6bf78f95468580ad42a1a21d7238a9909de22a67c
7
+ data.tar.gz: ed809702cdcf07a74b8dbe0db7552b663fb2a688dda840e094f45ca843dc8b9bfb3bf5778b416a4e2ad72a700609c305edfb68f1c993afbe9ecd3d719eef13dc
@@ -15,6 +15,7 @@ module TTL2HTML
15
15
  @param = param
16
16
  @template_path = [ Dir.pwd, File.join(Dir.pwd, "templates") ]
17
17
  @template_path << File.join(File.dirname(__FILE__), "..", "..", "templates")
18
+ I18n.load_path << Dir[File.join(File.dirname(__FILE__), "..", "..", "locales") + "/*.yml"]
18
19
  I18n.load_path << Dir[File.expand_path("locales") + "/*.yml"]
19
20
  I18n.locale = @param[:locale] if @param[:locale]
20
21
  end
@@ -1 +1 @@
1
- TTL2HTML::VERSION = "1.1.0"
1
+ TTL2HTML::VERSION = "1.1.1"
data/lib/ttl2html.rb CHANGED
@@ -10,7 +10,6 @@ require "ttl2html/template"
10
10
 
11
11
  module TTL2HTML
12
12
  class App
13
- using ProgressBar::Refinements::Enumerator
14
13
  def initialize(config = "config.yml")
15
14
  @template = {}
16
15
  @config = load_config(config)
@@ -139,7 +138,11 @@ module TTL2HTML
139
138
  end
140
139
  end
141
140
  end
141
+ progressbar = ProgressBar.create(title: :output_html_files,
142
+ total: @data.size,
143
+ format: "(%t) %a %e %P% Processed: %c from %C")
142
144
  each_data do |uri, v|
145
+ progressbar.increment
143
146
  template = Template.new("default.html.erb", @config)
144
147
  param = @config.dup
145
148
  param[:uri] = uri
@@ -154,6 +157,7 @@ module TTL2HTML
154
157
  end
155
158
  template.output_to(file, param)
156
159
  end
160
+ progressbar.finish
157
161
  index_html = "index.html"
158
162
  index_html = File.join(@config[:output_dir], "index.html") if @config[:output_dir]
159
163
  if @config.has_key? :top_class
@@ -216,7 +220,11 @@ module TTL2HTML
216
220
  end
217
221
 
218
222
  def output_turtle_files
223
+ progressbar = ProgressBar.create(title: :output_turtle_files,
224
+ total: @data.size,
225
+ format: "(%t) %a %e %P% Processed: %c from %C")
219
226
  each_data do |uri, v|
227
+ progressbar.increment
220
228
  file = uri_mapping_to_path(uri, ".ttl")
221
229
  if @config[:output_dir]
222
230
  Dir.mkdir @config[:output_dir] if not File.exist? @config[:output_dir]
@@ -228,6 +236,7 @@ module TTL2HTML
228
236
  io.puts str.strip
229
237
  end
230
238
  end
239
+ progressbar.finish
231
240
  end
232
241
  def uri_mapping_to_path(uri, suffix = ".html")
233
242
  path = nil
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ttl2html
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masao Takaku