ascii_binder 0.2.2 → 1.0.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: 5c935f5c56bc709a5a8029622f7ffce6afb66018806e02c1b08e683c65d90849
4
- data.tar.gz: 115f035401017e838117d4fa446d3715bb6913aacf9276894c1bebf6cbe59278
3
+ metadata.gz: 63f08f84ab342165234ea73cf2b25d443b5a4962cdeea861a7f0080b6322153c
4
+ data.tar.gz: ed6d54234440073f2721ea648d8b1f045cf34d1bf3a2444f93d2ea47b36256e2
5
5
  SHA512:
6
- metadata.gz: ca4f6bb99b3db8d89d093797f78e0a53b57cfb3c6ec23451f868391360f758079f2bfeb20560f0347ab2ddf9b75d9ebe2efc42c208c4c60b0e3a34b6251a933a
7
- data.tar.gz: 8b788a889bad12e435cb08f7b3bd6e771e1a0fd5d1866ac2c5f0cfa2d6f82ff9deadf4741cae18e01f2c411581015a0d9eb4a73aaa186c0850682f3261edc61b
6
+ metadata.gz: 00435a0b0ed5ff4c32aef83030793be785eb8ade1112f47ca6279be17cc0701b8b46ae0f0f5fcb05b9bc74e1f10d30aeed6529f94baa0a029765402f1e413ac7
7
+ data.tar.gz: cb56f37d5ab0eae8da6f48a0b68f490429dd7bac79ad529057c85893ac5cf91b53aec6c26b4e8e1d42848f0ed4e7561211529de80d4f562cfda1fdc5fdcc6551
data/Dockerfile CHANGED
@@ -1,7 +1,7 @@
1
- FROM centos/ruby-22-centos7
1
+ FROM centos/ruby-23-centos7
2
2
 
3
- RUN scl enable rh-ruby22 -- gem install listen -v 3.0.8
4
- RUN scl enable rh-ruby22 -- gem install ascii_binder
3
+ RUN scl enable rh-ruby23 -- gem install listen -v 3.0.8
4
+ RUN scl enable rh-ruby23 -- gem install ascii_binder
5
5
  USER root
6
6
  RUN yum install -y java-1.7.0-openjdk && \
7
7
  yum clean all
data/ascii_binder.gemspec CHANGED
@@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
34
34
  spec.add_dependency 'json'
35
35
  spec.add_dependency 'sitemap_generator', '~> 6.0.1'
36
36
  spec.add_dependency 'trollop', '~> 2.1.2'
37
- spec.add_dependency 'yajl-ruby', '~> 1.3.0'
37
+ spec.add_dependency "yajl-ruby", ">= 1.4.2"
38
38
  spec.add_dependency 'tilt'
39
39
 
40
40
  end
data/bin/asciibinder CHANGED
@@ -31,9 +31,9 @@ def repo_check(docs_basedir)
31
31
  end
32
32
  end
33
33
  # Either of these must be present
34
- unless File.exist?(File.join(docs_basedir, '_build_cfg.yml')) or File.exist?(File.join(docs_basedir, '_topic_map.yml'))
35
- missing_files = true
36
- end
34
+ # unless File.exist?(File.join("#{docs_basedir}/#{TOPIC_MAP_FOLDER}", '_topic_map.yml'))
35
+ # missing_files = true
36
+ # end
37
37
  if missing_files or not in_git_repo(docs_basedir)
38
38
  Trollop::die "The specified docs base directory '#{docs_basedir}' does not appear to be part of an AsciiBinder-compatible repo."
39
39
  end
@@ -300,7 +300,7 @@ if cmd == 'clone'
300
300
  Dir.chdir(docs_basedir)
301
301
  puts "Tracking branch setup:"
302
302
  cloned_map.distro_branches.each do |doc_branch|
303
- next if doc_branch == 'master'
303
+ next if doc_branch == 'main'
304
304
  puts "- #{doc_branch}"
305
305
  system("git branch #{doc_branch} origin/#{doc_branch}")
306
306
  end
@@ -299,9 +299,9 @@ module Helpers
299
299
  end
300
300
  system("cd #{working_dir} && git add . > /dev/null && git commit -am 'test commit' > /dev/null")
301
301
  if multiple_distros
302
- system("cd #{working_dir} && git checkout -b branch1 > /dev/null 2>&1 && git checkout -b branch2 > /dev/null 2>&1 && git checkout master > /dev/null 2>&1")
302
+ system("cd #{working_dir} && git checkout -b branch1 > /dev/null 2>&1 && git checkout -b branch2 > /dev/null 2>&1 && git checkout main > /dev/null 2>&1")
303
303
  end
304
- set_initial_working_branch('master')
304
+ set_initial_working_branch('main')
305
305
  end
306
306
  working_dir
307
307
  end
@@ -325,7 +325,7 @@ module Helpers
325
325
  if run_command('create',[],remote_dir)[:status].exitstatus == 0
326
326
  clone_map = File.join(gem_root,'features','support','_clone_distro_map.yml')
327
327
  FileUtils.cp(clone_map,File.join(remote_dir,'_distro_map.yml'))
328
- system("cd #{remote_dir} && git add . > /dev/null && git commit -am 'remote commit' > /dev/null && git checkout -b branch1 > /dev/null 2>&1 && git checkout master > /dev/null 2>&1")
328
+ system("cd #{remote_dir} && git add . > /dev/null && git commit -am 'remote commit' > /dev/null && git checkout -b branch1 > /dev/null 2>&1 && git checkout main > /dev/null 2>&1")
329
329
  else
330
330
  puts "ERROR: Could not initialize remote repo"
331
331
  exit 1
@@ -78,18 +78,50 @@ module AsciiBinder
78
78
 
79
79
  # Protip: Don't cache these! The topic map needs to be reread every time we change branches.
80
80
  def topic_map_file
81
+
82
+ # new stuff 1/Nov/2021
83
+ # allow users to break up the topic map into multiple topic maps
84
+ # load topic maps from a single folder called _topic_maps.
85
+ # we assume that all files in this folder are correctly formatted topic maps. If not, you will get normal asciibinder errors
86
+ topic_map_folder = TOPIC_MAP_FOLDER
81
87
  topic_file = TOPIC_MAP_FILENAME
82
- unless File.exist?(File.join(docs_root_dir,topic_file))
83
- # The new filename '_topic_map.yml' couldn't be found;
84
- # switch to the old one and warn the user.
85
- topic_file = BUILD_FILENAME
86
- unless File.exist?(File.join(docs_root_dir,topic_file))
87
- # Critical error - no topic map file at all.
88
- Trollop::die "Could not find any topic map file ('#{TOPIC_MAP_FILENAME}' or '#{BUILD_FILENAME}') at #{docs_root_dir} in branch '#{git.branch}'"
88
+
89
+ if !Dir.exist?(File.join(docs_root_dir, topic_map_folder))
90
+ # if the _topic_maps directory doesn't exist or is empty, see if we can find the topic map in the root folder to maintain backward compatibility
91
+
92
+ if !File.exist?(File.join(docs_root_dir, topic_file))
93
+ # fall back to looking for a _topic_map in the root directory
94
+
95
+ topic_file = BUILD_FILENAME # old folders use build_config.yml
96
+
97
+ if !File.exist?(File.join(docs_root_dir, topic_file))
98
+ # Critical error - no topic map file at all.
99
+ Trollop::die "Could not find a valid topic map file. There is no #{TOPIC_MAP_FOLDER} folder and the fall back files #{TOPIC_MAP_FILENAME} or #{BUILD_FILENAME} in branch '#{git.branch}' were also not found."
100
+ else
101
+ t = File.join(docs_root_dir, topic_file) # found build_config
102
+ end
103
+ else
104
+ t = File.join(docs_root_dir, topic_file) # found topic_map in root
89
105
  end
90
- log_warn("'#{BUILD_FILENAME}' is a deprecated filename. Rename this to '#{TOPIC_MAP_FILENAME}'.")
106
+
107
+ else
108
+
109
+ # topic map files are in the _topic_maps folder
110
+
111
+ # create a combined temp file with all topic maps
112
+ tf = Tempfile.new("#{TOPIC_MAP_FILENAME}")
113
+
114
+ Dir.glob("#{topic_map_folder}/*.yml").each do |filename|
115
+ lines = IO.read(filename)
116
+ tf << lines
117
+ end
118
+
119
+ t = tf.path
91
120
  end
92
- topic_file
121
+
122
+ # returns the path to the final file
123
+ t
124
+
93
125
  end
94
126
 
95
127
  def topic_map
@@ -270,7 +302,7 @@ module AsciiBinder
270
302
  log_unknown("Building only the #{distro_map.get_distro(build_distro).name} distribution.")
271
303
  end
272
304
  elsif single_page.nil?
273
- log_unknown("Building all distributions.")
305
+ log_unknown("Building every distribution.")
274
306
  end
275
307
 
276
308
  # Notify the user of missing local branches
@@ -4,6 +4,7 @@ require 'stringio'
4
4
  module AsciiBinder
5
5
  module Helpers
6
6
  BUILD_FILENAME = '_build_cfg.yml'
7
+ TOPIC_MAP_FOLDER = '_topic_maps'
7
8
  TOPIC_MAP_FILENAME = '_topic_map.yml'
8
9
  DISTRO_MAP_FILENAME = '_distro_map.yml'
9
10
  PREVIEW_DIRNAME = '_preview'
@@ -7,7 +7,7 @@ module AsciiBinder
7
7
  @name = distro.site.name
8
8
  @url = distro.site.url
9
9
  @distros = {}
10
- @branches = ['master']
10
+ @branches = ['main']
11
11
  add_distro(distro)
12
12
  end
13
13
 
@@ -10,12 +10,13 @@ module AsciiBinder
10
10
  attr_reader :list
11
11
 
12
12
  def initialize(topic_file,distro_keys)
13
- @topic_yaml = YAML.load_stream(open(File.join(docs_root_dir,topic_file)))
13
+ @topic_yaml = YAML.load_stream(open(topic_file))
14
14
  @distro_keys = distro_keys
15
15
  @list = []
16
16
  @topic_yaml.each do |topic_entity|
17
17
  @list << AsciiBinder::TopicEntity.new(topic_entity,distro_keys)
18
18
  end
19
+
19
20
  end
20
21
 
21
22
  def filepaths
@@ -1,3 +1,3 @@
1
1
  module AsciiBinder
2
- VERSION = "0.2.2"
2
+ VERSION = "1.0.1"
3
3
  end
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.2.2
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - N. Harrison Ripps
@@ -9,10 +9,10 @@ authors:
9
9
  - Carlos Munoz
10
10
  - Brian Exelbierd
11
11
  - Vikram Goyal
12
- autorequire:
12
+ autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2021-04-13 00:00:00.000000000 Z
15
+ date: 2022-04-19 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: bundler
@@ -228,16 +228,16 @@ dependencies:
228
228
  name: yajl-ruby
229
229
  requirement: !ruby/object:Gem::Requirement
230
230
  requirements:
231
- - - "~>"
231
+ - - ">="
232
232
  - !ruby/object:Gem::Version
233
- version: 1.3.0
233
+ version: 1.4.2
234
234
  type: :runtime
235
235
  prerelease: false
236
236
  version_requirements: !ruby/object:Gem::Requirement
237
237
  requirements:
238
- - - "~>"
238
+ - - ">="
239
239
  - !ruby/object:Gem::Version
240
- version: 1.3.0
240
+ version: 1.4.2
241
241
  - !ruby/object:Gem::Dependency
242
242
  name: tilt
243
243
  requirement: !ruby/object:Gem::Requirement
@@ -351,7 +351,7 @@ homepage: https://github.com/redhataccess/ascii_binder
351
351
  licenses:
352
352
  - MIT
353
353
  metadata: {}
354
- post_install_message:
354
+ post_install_message:
355
355
  rdoc_options: []
356
356
  require_paths:
357
357
  - lib
@@ -366,8 +366,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
366
366
  - !ruby/object:Gem::Version
367
367
  version: '0'
368
368
  requirements: []
369
- rubygems_version: 3.2.3
370
- signing_key:
369
+ rubygems_version: 3.0.3
370
+ signing_key:
371
371
  specification_version: 4
372
372
  summary: AsciiBinder is an AsciiDoc-based system for authoring and publishing closely
373
373
  related documentation sets from a single source.