ttl2html 1.1.0 → 1.1.1
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/ttl2html/template.rb +1 -0
- data/lib/ttl2html/version.rb +1 -1
- data/lib/ttl2html.rb +10 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6bd052e74baedc74a4f4a5d3f78770d00f281dea52371c9b795fd48fc98c08c4
|
4
|
+
data.tar.gz: 320a243b01882fed22cda54f1403f420b795f2bc8a3a0bd68f8648003a827382
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6470f1e2fe766e98623869b1a0c08adba40e6bc8444d545d95fe42f9593ab2b805269e093a2efc69992acf6bf78f95468580ad42a1a21d7238a9909de22a67c
|
7
|
+
data.tar.gz: ed809702cdcf07a74b8dbe0db7552b663fb2a688dda840e094f45ca843dc8b9bfb3bf5778b416a4e2ad72a700609c305edfb68f1c993afbe9ecd3d719eef13dc
|
data/lib/ttl2html/template.rb
CHANGED
@@ -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
|
data/lib/ttl2html/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
TTL2HTML::VERSION = "1.1.
|
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
|