ascii_binder 0.1.3.2 → 0.1.4
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/Dockerfile +1 -0
- data/ascii_binder.gemspec +1 -1
- data/lib/ascii_binder/helpers.rb +23 -13
- data/lib/ascii_binder/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bcf4ffd260a5287efafd4fb3cc50fcf11d113a1a
|
4
|
+
data.tar.gz: 4e60310acce7c1481c773831bb8c32c3d95e29ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9917eaeb2fb1630066889ea8d74fa55ea399ad54706da7ae1a7bbb6e00343628fd4b97bfc731e2f3aaca93e71eaa8b8bbd6a3016ca31057c715c7e2ec965087
|
7
|
+
data.tar.gz: de6dde4b4042a3690a7ac2dd6440ae981cb031a2391fa262257150af1159e409e368fbd20aeb47c5128d6dcf9164d980a1d561a6b9cbe833901ec79f52fd2a2d
|
data/Dockerfile
CHANGED
data/ascii_binder.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.add_development_dependency "bundler", "~> 1.7"
|
22
22
|
spec.add_dependency "rake", "~> 10.0"
|
23
23
|
|
24
|
-
spec.add_dependency 'asciidoctor'
|
24
|
+
spec.add_dependency 'asciidoctor', '~> 1.5.4'
|
25
25
|
spec.add_dependency 'asciidoctor-diagram'
|
26
26
|
spec.add_dependency 'git'
|
27
27
|
spec.add_dependency 'guard'
|
data/lib/ascii_binder/helpers.rb
CHANGED
@@ -85,6 +85,22 @@ module AsciiBinder
|
|
85
85
|
Time.now.utc
|
86
86
|
end
|
87
87
|
|
88
|
+
def notice(hey,message,newline = false)
|
89
|
+
# TODO: (maybe) redirect everything to stderr
|
90
|
+
if newline
|
91
|
+
puts "\n"
|
92
|
+
end
|
93
|
+
puts "#{hey}: #{message}"
|
94
|
+
end
|
95
|
+
|
96
|
+
def warning(message,newline = false)
|
97
|
+
notice("WARNING",message,newline)
|
98
|
+
end
|
99
|
+
|
100
|
+
def nl_warning(message)
|
101
|
+
warning(message,true)
|
102
|
+
end
|
103
|
+
|
88
104
|
def git
|
89
105
|
@git ||= Git.open(source_dir)
|
90
106
|
end
|
@@ -138,7 +154,7 @@ module AsciiBinder
|
|
138
154
|
# The new filename '_topic_map.yml' couldn't be found;
|
139
155
|
# switch to the old one and warn the user.
|
140
156
|
use_file = BUILD_FILENAME
|
141
|
-
|
157
|
+
warning "'#{BUILD_FILENAME}' is a deprecated filename. Rename this to '#{TOPIC_MAP_FILENAME}'."
|
142
158
|
end
|
143
159
|
use_file
|
144
160
|
end
|
@@ -215,7 +231,7 @@ module AsciiBinder
|
|
215
231
|
end
|
216
232
|
end
|
217
233
|
if nonexistent_topics.length > 0
|
218
|
-
|
234
|
+
nl_warning "The #{build_config_file} file on branch '#{branch}' references nonexistant topics:\n" + nonexistent_topics.map{ |topic| "- #{topic}" }.join("\n")
|
219
235
|
end
|
220
236
|
end
|
221
237
|
|
@@ -471,6 +487,7 @@ module AsciiBinder
|
|
471
487
|
'idprefix=',
|
472
488
|
'idseparator=-',
|
473
489
|
'sectanchors',
|
490
|
+
'data-uri',
|
474
491
|
].concat(more_attrs)
|
475
492
|
end
|
476
493
|
|
@@ -546,7 +563,7 @@ module AsciiBinder
|
|
546
563
|
remove_found_config_files(local_branch,branch_build_config,branch_orphan_files)
|
547
564
|
|
548
565
|
if branch_orphan_files.length > 0 and single_page.nil?
|
549
|
-
|
566
|
+
nl_warning "Branch '#{local_branch}' includes the following .adoc files that are not referenced in the #{build_config_file} file:\n" + branch_orphan_files.map{ |file| "- #{file}" }.join("\n")
|
550
567
|
end
|
551
568
|
|
552
569
|
# Run all distros.
|
@@ -743,17 +760,10 @@ module AsciiBinder
|
|
743
760
|
"product-author=#{distro_config["author"]}"
|
744
761
|
])
|
745
762
|
|
746
|
-
|
747
|
-
|
748
|
-
# to read the full article title out of the file itself.
|
749
|
-
file_lines = topic_adoc.split("\n")
|
750
|
-
article_title = topic['Name']
|
751
|
-
if file_lines.length > 0
|
752
|
-
article_title = file_lines[0].gsub(/^\=\s+/, '').gsub(/\s+$/, '').gsub(/\{product-title\}/, distro_config["name"]).gsub(/\{product-version\}/, branch_config["name"])
|
753
|
-
end
|
754
|
-
topic_adoc = file_lines.join("\n")
|
763
|
+
doc = Asciidoctor.load topic_adoc, :header_footer => false, :safe => :unsafe, :attributes => page_attrs
|
764
|
+
article_title = doc.doctitle || topic['Name']
|
755
765
|
|
756
|
-
topic_html =
|
766
|
+
topic_html = doc.render
|
757
767
|
dir_depth = ''
|
758
768
|
if branch_config['dir'].split('/').length > 1
|
759
769
|
dir_depth = '../' * (branch_config['dir'].split('/').length - 1)
|
data/lib/ascii_binder/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ascii_binder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- N. Harrison Ripps
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-06-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -43,16 +43,16 @@ dependencies:
|
|
43
43
|
name: asciidoctor
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- - "
|
46
|
+
- - "~>"
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version:
|
48
|
+
version: 1.5.4
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
|
-
- - "
|
53
|
+
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version:
|
55
|
+
version: 1.5.4
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: asciidoctor-diagram
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|