publican_creators 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{History.rdoc → CHANGELOG.md} +73 -65
- data/CONTRIBUTING.md +2 -3
- data/LICENSE.md +636 -0
- data/README.md +95 -0
- data/bin/publican_creators.rb +1 -1
- data/bin/revision_creator.rb +1 -1
- data/lib/publican_creators.rb +3 -5
- data/lib/publican_creators/change.rb +1 -1
- data/lib/publican_creators/checker.rb +1 -1
- data/lib/publican_creators/create.rb +1 -1
- data/lib/publican_creators/export.rb +1 -1
- data/lib/publican_creators/get.rb +1 -1
- data/lib/publican_creators/notifier.rb +1 -1
- data/lib/publican_creators/prepare.rb +1 -1
- data/lib/publican_creators/revision.rb +1 -1
- data/lib/publican_creators/testlib.rb +1 -1
- data/lib/publican_creators/version.rb +35 -0
- metadata +64 -144
- data/CODE_OF_CONDUCT.md +0 -17
- data/Gemfile +0 -26
- data/Gemfile.lock +0 -126
- data/LICENSE.rdoc +0 -619
- data/Manifest.txt +0 -28
- data/README.rdoc +0 -86
- data/Rakefile +0 -151
- data/config.reek +0 -111
- data/spec/lib_spec.rb +0 -401
- data/spec/spec_helper.rb +0 -16
data/Manifest.txt
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
Gemfile
|
2
|
-
Gemfile.lock
|
3
|
-
History.rdoc
|
4
|
-
LICENSE.rdoc
|
5
|
-
Manifest.txt
|
6
|
-
README.rdoc
|
7
|
-
CODE_OF_CONDUCT.md
|
8
|
-
CONTRIBUTING.md
|
9
|
-
MAINTENANCE.md
|
10
|
-
Rakefile
|
11
|
-
bin/publican_creators.rb
|
12
|
-
bin/revision_creator.rb
|
13
|
-
config.reek
|
14
|
-
data/publican_creators/publican-revision.png
|
15
|
-
data/publican_creators/publican.png
|
16
|
-
etc/publicancreators.cfg
|
17
|
-
lib/publican_creators.rb
|
18
|
-
lib/publican_creators/change.rb
|
19
|
-
lib/publican_creators/checker.rb
|
20
|
-
lib/publican_creators/create.rb
|
21
|
-
lib/publican_creators/export.rb
|
22
|
-
lib/publican_creators/get.rb
|
23
|
-
lib/publican_creators/notifier.rb
|
24
|
-
lib/publican_creators/prepare.rb
|
25
|
-
lib/publican_creators/revision.rb
|
26
|
-
lib/publican_creators/testlib.rb
|
27
|
-
spec/lib_spec.rb
|
28
|
-
spec/spec_helper.rb
|
data/README.rdoc
DELETED
@@ -1,86 +0,0 @@
|
|
1
|
-
= publican_creators
|
2
|
-
|
3
|
-
code :: https://github.com/saigkill/publican_creators
|
4
|
-
docs :: http://docs.saigkill.tuxfamily.org/publican_creators
|
5
|
-
apidoc :: http://rubydoc.info/gems/publican_creators
|
6
|
-
bugs & feature requests :: https://github.com/saigkill/publican_creators/issues
|
7
|
-
mailing list :: https://groups.google.com/forum/#!forum/publican_creators
|
8
|
-
openhub statistics :: https://www.openhub.net/p/publicancreators
|
9
|
-
authors blog :: https://saigkills-backtrace.de
|
10
|
-
min. rubyver :: 2.3.0
|
11
|
-
|
12
|
-
last public version :: {<img src="https://badge.fury.io/rb/publican_creators.png" alt="Build Status" />}[http://rubygems.org/gems/publican_creators]
|
13
|
-
downloads latest :: {<img src="https://img.shields.io/gem/dtv/publican_creators.svg" alt="Build Status" />}[http://rubygems.org/gems/publican_creators]
|
14
|
-
downloads all :: {<img src="https://img.shields.io/gem/dt/publican_creators.svg" alt="Build Status" />}[http://rubygems.org/gems/publican_creators]
|
15
|
-
continuous integration :: {<img src="https://secure.travis-ci.org/saigkill/publican_creators.png?branch=master" alt="Build Status" />}[https://secure.travis-ci.org/saigkill/publican_creators]
|
16
|
-
continuous integration :: {<img src="https://scrutinizer-ci.com/g/saigkill/publican_creators/badges/build.png?b=master" />}[https://scrutinizer-ci.com/g/saigkill/publican_creators/]
|
17
|
-
test coverage :: {<img src="https://coveralls.io/repos/github/saigkill/publican_creators/badge.svg?branch=master" alt="Coverage Status" />}[https://coveralls.io/github/saigkill/publican_creators?branch=master]
|
18
|
-
code quality :: {<img src="https://scrutinizer-ci.com/g/saigkill/publican_creators/badges/quality-score.png?b=master" />}[https://scrutinizer-ci.com/g/saigkill/publican_creators/]
|
19
|
-
code quality :: {<img src="https://codeclimate.com/github/saigkill/PublicanCreators/badges/gpa.svg" alt="Code Quality" />}[https://codeclimate.com/github/saigkill/PublicanCreators]
|
20
|
-
security :: {<img src="https://hakiri.io/github/saigkill/publican_creators/master.svg" alt="security" />}[https://hakiri.io/github/saigkill/publican_creators/master]
|
21
|
-
documentation quality :: {<img src="http://inch-ci.org/github/saigkill/PublicanCreators.svg?branch=master" alt="Documentation Quality" />}[http://inch-ci.org/github/saigkill/PublicanCreators]
|
22
|
-
|
23
|
-
|
24
|
-
== DESCRIPTION:
|
25
|
-
|
26
|
-
publican_creators are a small tool for daily DocBook writers who are using the Redhat publican tool
|
27
|
-
https://fedorahosted.org/publican/. publican_creators asks after launching which title, type and environment should be
|
28
|
-
used. Then it starts publican with that settings and works then with the produced files.
|
29
|
-
It will work on the Article_Info.xml, Book_Info.xml, TITLE.ent, Author_Group.xml and Revision_History.xml and
|
30
|
-
will replace the default values with your name, your company, your company_divison and your private or your business
|
31
|
-
email address, depending on your chosen environment. Also, you can set your config file that you want to remove
|
32
|
-
the Title Logo or the Legal Notice. As a feature, it ships a build script for each project.
|
33
|
-
|
34
|
-
The History.rdoc contains a detailed description of what has changed.
|
35
|
-
|
36
|
-
hoe-reek is released under the GPL3 License, see the file 'License.rdoc'
|
37
|
-
for more information.
|
38
|
-
|
39
|
-
The official website is:
|
40
|
-
|
41
|
-
https://github.com/saigkill/publican_creators
|
42
|
-
|
43
|
-
== FEATURES/PROBLEMS:
|
44
|
-
|
45
|
-
* GUI to control publican
|
46
|
-
|
47
|
-
== SYNOPSIS:
|
48
|
-
|
49
|
-
$ publican_creators.rb (Main program)
|
50
|
-
$ revision_creator.rb (The revision updater)
|
51
|
-
|
52
|
-
Or just use the Launcher.
|
53
|
-
|
54
|
-
This Gem was programmed and tested on Linux systems. If anyone would like to make the methods also fit for other OS,
|
55
|
-
I'm happy about Pull requests.
|
56
|
-
|
57
|
-
== REQUIREMENTS:
|
58
|
-
|
59
|
-
* nokogiri
|
60
|
-
* parseconfig
|
61
|
-
* rainbow
|
62
|
-
* notifier
|
63
|
-
|
64
|
-
== REQUIREMENTS (hard dependencies):
|
65
|
-
|
66
|
-
* yad
|
67
|
-
* publican (a 4.x version is needed)
|
68
|
-
|
69
|
-
== INSTALL:
|
70
|
-
|
71
|
-
The installation is very easy.
|
72
|
-
|
73
|
-
gem install publican_creators
|
74
|
-
cd /path/to/gem (In case of using RVM ~/.rvm/gems/ruby-$RUBYVERSION/gems/publican_creators)
|
75
|
-
rake
|
76
|
-
|
77
|
-
You have to run the setup after each gem update.
|
78
|
-
|
79
|
-
== DEVELOPERS:
|
80
|
-
|
81
|
-
After checking out the source, run:
|
82
|
-
|
83
|
-
$ rake newb
|
84
|
-
|
85
|
-
This task will install any missing dependencies, run the tests/specs,
|
86
|
-
and generate the RDoc.
|
data/Rakefile
DELETED
@@ -1,151 +0,0 @@
|
|
1
|
-
# -*- ruby -*-
|
2
|
-
# Copyright (C) 2013-2018 Sascha Manns <Sascha.Manns@mailbox.org>
|
3
|
-
# Release:
|
4
|
-
# Pre-release:
|
5
|
-
#* update docs
|
6
|
-
#* Update copyright years if needed, in the following paths:
|
7
|
-
# + lib/*
|
8
|
-
#* Check version in lib/hoe-reek.rb
|
9
|
-
#* Update History.rdoc & NEWS
|
10
|
-
#* git:manifest
|
11
|
-
#* bundler:gemfile
|
12
|
-
#* bundler:gemfile_lock
|
13
|
-
# x64-mingw32
|
14
|
-
# x64-mswin32
|
15
|
-
# x86-mingw32
|
16
|
-
# x86-mswin32
|
17
|
-
# ruby
|
18
|
-
# x86_64-linux
|
19
|
-
#* bundle_audit:run
|
20
|
-
#* git -a -m "Anything"
|
21
|
-
#* git tag x.x.x
|
22
|
-
|
23
|
-
# Release:
|
24
|
-
#* Create Release in Github
|
25
|
-
#* rake release
|
26
|
-
#* send_email
|
27
|
-
#* clean_pkg
|
28
|
-
|
29
|
-
# Post-release:
|
30
|
-
#* Bump version
|
31
|
-
#* Add new Milestone on Github
|
32
|
-
|
33
|
-
require 'rubygems'
|
34
|
-
require 'hoe'
|
35
|
-
|
36
|
-
# rubocop:disable Metrics/LineLength
|
37
|
-
############################################# DEVELOPING ZONE #########################################################
|
38
|
-
Hoe.plugin :bundler
|
39
|
-
Hoe.plugin :git
|
40
|
-
Hoe.plugin :manns
|
41
|
-
Hoe.plugin :rdoc
|
42
|
-
Hoe.plugin :reek
|
43
|
-
Hoe.plugin :rubocop
|
44
|
-
Hoe.plugin :rubygems
|
45
|
-
Hoe.plugin :travis
|
46
|
-
Hoe.plugin :version
|
47
|
-
|
48
|
-
Hoe.spec 'publican_creators' do
|
49
|
-
developer('Sascha Manns', 'Sascha.Manns@outlook.de')
|
50
|
-
license 'GPL-3.0' # this should match the license in the README
|
51
|
-
require_ruby_version '>= 2.3.0'
|
52
|
-
|
53
|
-
self.history_file = 'History.rdoc'
|
54
|
-
self.readme_file = 'README.rdoc'
|
55
|
-
self.extra_rdoc_files = FileList['*.rdoc'].to_a
|
56
|
-
self.post_install_message = '*** Run rake setup to finish the installation *** Please file bugreports and feature requests on: https://github.com/saigkill/publican_creators/issues'
|
57
|
-
|
58
|
-
dependency 'nokogiri', '~> 1.8'
|
59
|
-
dependency 'parseconfig', '~> 1.0'
|
60
|
-
dependency 'rainbow', '~> 3.0'
|
61
|
-
dependency 'notifier', '~> 0.5'
|
62
|
-
dependency 'xdg', '~> 2.2'
|
63
|
-
|
64
|
-
extra_dev_deps << ['coveralls', '~> 0.8']
|
65
|
-
extra_dev_deps << ['hoe-rubygems', '~> 1.0']
|
66
|
-
extra_dev_deps << ['hoe-manns', '~> 2.1']
|
67
|
-
extra_dev_deps << ['hoe-reek', '~> 1.2']
|
68
|
-
extra_dev_deps << ['hoe-rubocop', '~> 1.0']
|
69
|
-
extra_dev_deps << ['hoe-version', '~> 1.2']
|
70
|
-
extra_dev_deps << ['hoe', '~> 3.17']
|
71
|
-
extra_dev_deps << ['rake', '~> 12.3']
|
72
|
-
extra_dev_deps << ['rdoc', '~> 6.0']
|
73
|
-
extra_dev_deps << ['bundler', '~> 1.16']
|
74
|
-
extra_dev_deps << ['rspec', '~> 3.7']
|
75
|
-
extra_dev_deps << ['rubocop', '~> 0.57']
|
76
|
-
end
|
77
|
-
|
78
|
-
###################################### SETUP ZONE #####################################################################
|
79
|
-
|
80
|
-
require 'fileutils'
|
81
|
-
require 'xdg'
|
82
|
-
desc 'Install Icons'
|
83
|
-
task :install_icons do
|
84
|
-
data_xdg = XDG['DATA_HOME']
|
85
|
-
install_path = "#{data_xdg}/icons/"
|
86
|
-
FileUtils.mkdir(insttall_path) unless File.exist?(install_path)
|
87
|
-
from_publican = 'data/publican_creators/publican.png'
|
88
|
-
from_publican_revision = 'data/publican_creators/publican-revision.png'
|
89
|
-
FileUtils.cp(from_publican, install_path)
|
90
|
-
FileUtils.cp(from_publican_revision, install_path)
|
91
|
-
puts 'Installed icons'
|
92
|
-
end
|
93
|
-
|
94
|
-
require 'fileutils'
|
95
|
-
require 'xdg'
|
96
|
-
desc 'Install config'
|
97
|
-
task :install_config do
|
98
|
-
sys_xdg = XDG['CONFIG_HOME']
|
99
|
-
from = 'etc/publicancreators.cfg'
|
100
|
-
sysconf_dir = "#{sys_xdg}/publican_creators"
|
101
|
-
FileUtils.mkdir(sysconf_dir) unless File.exist?(sysconf_dir)
|
102
|
-
FileUtils.cp(from, sysconf_dir)
|
103
|
-
end
|
104
|
-
|
105
|
-
require 'fileutils'
|
106
|
-
require 'xdg'
|
107
|
-
desc 'Create Desktop files'
|
108
|
-
task :create_desktop_cre do
|
109
|
-
sys_xdg = XDG['CONFIG_HOME']
|
110
|
-
data_xdg = XDG['DATA_HOME']
|
111
|
-
publicancre = "#{data_xdg}/applications/publicancreators.desktop"
|
112
|
-
publicancreico = "#{data_xdg}/icons/publican.png"
|
113
|
-
FileUtils.rm(publicancre) if File.exist?(publicancre)
|
114
|
-
puts 'Creating Desktop file for publican_creators'.color(:yellow)
|
115
|
-
FileUtils.touch publicancre.to_s
|
116
|
-
File.write publicancre.to_s, <<EOF
|
117
|
-
[Desktop Entry]
|
118
|
-
Version=1.0
|
119
|
-
Type=Application
|
120
|
-
Name=publican_creators
|
121
|
-
Exec=publican_creators.rb
|
122
|
-
Icon=#{publicancreico}
|
123
|
-
EOF
|
124
|
-
end
|
125
|
-
|
126
|
-
require 'xdg'
|
127
|
-
require 'fileutils'
|
128
|
-
desc 'Create publicancreators-rev.desktop'
|
129
|
-
task :create_desktop_rev do
|
130
|
-
sys_xdg = XDG['CONFIG_HOME']
|
131
|
-
data_xdg = XDG['DATA_HOME']
|
132
|
-
publicanrev = "#{data_xdg}/applications/publicancreators-rev.desktop"
|
133
|
-
publicanrevico = "#{data_xdg}/icons/publican-revision.png"
|
134
|
-
FileUtils.rm(publicanrev) if File.exist?(publicanrev)
|
135
|
-
puts 'Creating Desktop file for Revision updater'.color(:yellow)
|
136
|
-
FileUtils.touch publicanrev.to_s
|
137
|
-
File.write publicanrev.to_s, <<EOF
|
138
|
-
[Desktop Entry]
|
139
|
-
Version=1.0
|
140
|
-
Type=Application
|
141
|
-
Name=revision_creator
|
142
|
-
Exec=revision_creator.rb
|
143
|
-
Icon=#{publicanrevico}
|
144
|
-
EOF
|
145
|
-
end
|
146
|
-
|
147
|
-
desc 'Run setup'
|
148
|
-
task setup: %i[install_icons install_config create_desktop_cre create_desktop_rev] do
|
149
|
-
puts 'Setup finished'
|
150
|
-
end
|
151
|
-
# vim: syntax=ruby
|
data/config.reek
DELETED
@@ -1,111 +0,0 @@
|
|
1
|
-
---
|
2
|
-
Attribute:
|
3
|
-
enabled: false
|
4
|
-
exclude: []
|
5
|
-
BooleanParameter:
|
6
|
-
enabled: true
|
7
|
-
exclude: []
|
8
|
-
ClassVariable:
|
9
|
-
enabled: true
|
10
|
-
exclude: []
|
11
|
-
ControlParameter:
|
12
|
-
enabled: true
|
13
|
-
exclude: []
|
14
|
-
DataClump:
|
15
|
-
enabled: true
|
16
|
-
exclude: []
|
17
|
-
max_copies: 2
|
18
|
-
min_clump_size: 2
|
19
|
-
DuplicateMethodCall:
|
20
|
-
enabled: true
|
21
|
-
exclude: []
|
22
|
-
max_calls: 3
|
23
|
-
allow_calls: []
|
24
|
-
FeatureEnvy:
|
25
|
-
enabled: true
|
26
|
-
exclude: []
|
27
|
-
IrresponsibleModule:
|
28
|
-
enabled: true
|
29
|
-
exclude: []
|
30
|
-
LongParameterList:
|
31
|
-
enabled: true
|
32
|
-
exclude: []
|
33
|
-
max_params: 3
|
34
|
-
overrides:
|
35
|
-
initialize:
|
36
|
-
max_params: 5
|
37
|
-
LongYieldList:
|
38
|
-
enabled: true
|
39
|
-
exclude: []
|
40
|
-
max_params: 3
|
41
|
-
ModuleInitialize:
|
42
|
-
enabled: true
|
43
|
-
exclude: []
|
44
|
-
NestedIterators:
|
45
|
-
enabled: true
|
46
|
-
exclude: []
|
47
|
-
max_allowed_nesting: 1
|
48
|
-
ignore_iterators: []
|
49
|
-
NilCheck:
|
50
|
-
enabled: true
|
51
|
-
exclude: []
|
52
|
-
PrimaDonnaMethod:
|
53
|
-
enabled: true
|
54
|
-
exclude: []
|
55
|
-
RepeatedConditional:
|
56
|
-
enabled: true
|
57
|
-
exclude: []
|
58
|
-
max_ifs: 2
|
59
|
-
TooManyInstanceVariables:
|
60
|
-
enabled: true
|
61
|
-
exclude: []
|
62
|
-
max_instance_variables: 9
|
63
|
-
TooManyMethods:
|
64
|
-
enabled: true
|
65
|
-
exclude: []
|
66
|
-
max_methods: 25
|
67
|
-
TooManyStatements:
|
68
|
-
enabled: true
|
69
|
-
exclude:
|
70
|
-
- initialize
|
71
|
-
max_statements: 15
|
72
|
-
UncommunicativeMethodName:
|
73
|
-
enabled: true
|
74
|
-
exclude: []
|
75
|
-
reject:
|
76
|
-
- !ruby/regexp /^[a-z]$/
|
77
|
-
- !ruby/regexp /[0-9]$/
|
78
|
-
- !ruby/regexp /[A-Z]/
|
79
|
-
accept: []
|
80
|
-
UncommunicativeModuleName:
|
81
|
-
enabled: true
|
82
|
-
exclude: []
|
83
|
-
reject:
|
84
|
-
- !ruby/regexp /^.$/
|
85
|
-
- !ruby/regexp /[0-9]$/
|
86
|
-
accept:
|
87
|
-
- Inline::C
|
88
|
-
UncommunicativeParameterName:
|
89
|
-
enabled: true
|
90
|
-
exclude: []
|
91
|
-
reject:
|
92
|
-
- !ruby/regexp /^.$/
|
93
|
-
- !ruby/regexp /[0-9]$/
|
94
|
-
- !ruby/regexp /[A-Z]/
|
95
|
-
- !ruby/regexp /^_/
|
96
|
-
accept: []
|
97
|
-
UncommunicativeVariableName:
|
98
|
-
enabled: true
|
99
|
-
exclude: []
|
100
|
-
reject:
|
101
|
-
- !ruby/regexp /^.$/
|
102
|
-
- !ruby/regexp /[0-9]$/
|
103
|
-
- !ruby/regexp /[A-Z]/
|
104
|
-
accept:
|
105
|
-
- _
|
106
|
-
UnusedParameters:
|
107
|
-
enabled: true
|
108
|
-
exclude: []
|
109
|
-
UtilityFunction:
|
110
|
-
enabled: true
|
111
|
-
exclude: []
|
data/spec/lib_spec.rb
DELETED
@@ -1,401 +0,0 @@
|
|
1
|
-
require 'rspec'
|
2
|
-
require 'fileutils'
|
3
|
-
require 'tempfile'
|
4
|
-
require 'nokogiri'
|
5
|
-
require 'rainbow/ext/string'
|
6
|
-
require File.join(File.dirname(__FILE__), '..', 'lib/publican_creators/checker')
|
7
|
-
require File.join(File.dirname(__FILE__), '..', 'lib/publican_creators/get')
|
8
|
-
require File.join(File.dirname(__FILE__), '..', 'lib/publican_creators/change')
|
9
|
-
require File.join(File.dirname(__FILE__), '..', 'lib/publican_creators/export')
|
10
|
-
require File.join(File.dirname(__FILE__), '..', 'lib/publican_creators/create')
|
11
|
-
require File.join(File.dirname(__FILE__), '..', 'lib/publican_creators/testlib')
|
12
|
-
|
13
|
-
require File.dirname(__FILE__) + '/spec_helper'
|
14
|
-
# rubocop:disable Metrics/BlockLength
|
15
|
-
describe 'PublicanCreatorsCreate' do
|
16
|
-
describe '.init_docu_work' do
|
17
|
-
context 'Work (Article)' do
|
18
|
-
title = 'The_holy_Bible-WorkArt'
|
19
|
-
type = 'Article'
|
20
|
-
language = 'de-DE'
|
21
|
-
brand = 'XCOM'
|
22
|
-
db5 = 'true'
|
23
|
-
it 'creates a new set of documentation for Work/Article' do
|
24
|
-
PublicanCreatorsCreate.init_docu_work(title, type, language, brand, db5)
|
25
|
-
expect(Dir.exist?(title)).equal? 'true'
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
context 'Work (Book)' do
|
30
|
-
title = 'The_holy_Bible-WorkBook'
|
31
|
-
type = 'Book'
|
32
|
-
language = 'de-DE'
|
33
|
-
brand = 'XCOM'
|
34
|
-
db5 = 'true'
|
35
|
-
it 'creates a new set of documentation for Work/Book' do
|
36
|
-
PublicanCreatorsCreate.init_docu_work(title, type, language, brand, db5)
|
37
|
-
expect(Dir.exist?(title)).equal? 'true'
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
describe '.init_docu_private' do
|
43
|
-
context 'Private (Article)' do
|
44
|
-
title = 'The_holy_Bible-PrivArt'
|
45
|
-
type = 'Article'
|
46
|
-
language = 'de-DE'
|
47
|
-
brand_private = 'manns'
|
48
|
-
brand_homework = 'ils'
|
49
|
-
homework = 'FALSE'
|
50
|
-
db5 = 'true'
|
51
|
-
it 'creates a new set of documentation for Private/Article' do
|
52
|
-
PublicanCreatorsCreate.init_docu_private(title, type, homework,
|
53
|
-
language, brand_homework,
|
54
|
-
brand_private, db5)
|
55
|
-
expect(Dir.exist?(title)).equal? 'true'
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
context 'Private (Article/Homework)' do
|
60
|
-
title = 'The_holy_Bible-PrivArtHome'
|
61
|
-
type = 'Article'
|
62
|
-
language = 'de-DE'
|
63
|
-
brand_private = 'manns'
|
64
|
-
brand_homework = 'ils'
|
65
|
-
homework = 'TRUE'
|
66
|
-
db5 = 'true'
|
67
|
-
it 'creates a new set of documentation for Private/Article/Homework' do
|
68
|
-
PublicanCreatorsCreate.init_docu_private(title, type, homework,
|
69
|
-
language, brand_homework,
|
70
|
-
brand_private, db5)
|
71
|
-
expect(Dir.exist?(title)).equal? 'true'
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
|
-
context 'Private (Book)' do
|
76
|
-
title = 'The_holy_Bible-PrivBook'
|
77
|
-
type = 'Book'
|
78
|
-
language = 'de-DE'
|
79
|
-
brand_private = 'manns'
|
80
|
-
brand_homework = 'ils'
|
81
|
-
homework = 'TRUE'
|
82
|
-
db5 = 'true'
|
83
|
-
it 'creates a new set of documentation for Private/Book' do
|
84
|
-
PublicanCreatorsCreate.init_docu_private(title, type, homework,
|
85
|
-
language, brand_homework,
|
86
|
-
brand_private, db5)
|
87
|
-
expect(Dir.exist?(title)).equal? 'true'
|
88
|
-
end
|
89
|
-
end
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
describe 'PublicanCreatorsChange' do
|
94
|
-
describe '.add_entity' do
|
95
|
-
context 'Work Environment (Article) with global_entities variable' do
|
96
|
-
environment = 'Work'
|
97
|
-
title = 'The_holy_Bible-WorkArt'
|
98
|
-
brand_dir = '/usr/share/publican/Common_Content/XCOM'
|
99
|
-
global_entities = "#{brand_dir}/de-DE/entitiesxcom.ent"
|
100
|
-
ent = "#{title}/de-DE/#{title}.ent"
|
101
|
-
pattern = 'COMMON ENTITIES'
|
102
|
-
it 'Adds the Entities from the global ent file' do
|
103
|
-
PublicanCreatorsChange.add_entity(environment, global_entities, ent)
|
104
|
-
result = PublicanCreatorsTest.check_content(ent, pattern)
|
105
|
-
expect(result).equal? 'true'
|
106
|
-
end
|
107
|
-
end
|
108
|
-
|
109
|
-
context 'Work Environment (Book) with global_entities variable' do
|
110
|
-
environment = 'Work'
|
111
|
-
title = 'The_holy_Bible-WorkBook'
|
112
|
-
brand_dir = '/usr/share/publican/Common_Content/XCOM'
|
113
|
-
global_entities = "#{brand_dir}/de-DE/entitiesxcom.ent"
|
114
|
-
ent = "#{title}/de-DE/#{title}.ent"
|
115
|
-
pattern = 'COMMON ENTITIES'
|
116
|
-
it 'Adds the Entities from the global ent file' do
|
117
|
-
PublicanCreatorsChange.add_entity(environment, global_entities, ent)
|
118
|
-
result = PublicanCreatorsTest.check_content(ent, pattern)
|
119
|
-
expect(result).equal? 'true'
|
120
|
-
end
|
121
|
-
end
|
122
|
-
|
123
|
-
context 'Private Environment (Article) without global_entities variable' do
|
124
|
-
environment = 'Private'
|
125
|
-
global_entities = ''
|
126
|
-
title = 'The_holy_Bible-PrivArt'
|
127
|
-
ent = "#{title}/de-DE/#{title}.ent"
|
128
|
-
pattern = 'COMMON ENTITIES'
|
129
|
-
it 'Leaves the local Entityfile blank' do
|
130
|
-
PublicanCreatorsChange.add_entity(environment, global_entities, ent)
|
131
|
-
result = PublicanCreatorsTest.check_content(ent, pattern)
|
132
|
-
expect(result).equal? 'false'
|
133
|
-
end
|
134
|
-
end
|
135
|
-
|
136
|
-
context 'Private Environment (Book) without global_entities variable' do
|
137
|
-
environment = 'Private'
|
138
|
-
global_entities = ''
|
139
|
-
title = 'The_holy_Bible-PrivBook'
|
140
|
-
ent = "#{title}/de-DE/#{title}.ent"
|
141
|
-
pattern = 'COMMON ENTITIES'
|
142
|
-
it 'Leaves the local Entityfile blank' do
|
143
|
-
PublicanCreatorsChange.add_entity(environment, global_entities, ent)
|
144
|
-
result = PublicanCreatorsTest.check_content(ent, pattern)
|
145
|
-
expect(result).equal? 'false'
|
146
|
-
end
|
147
|
-
end
|
148
|
-
end
|
149
|
-
end
|
150
|
-
|
151
|
-
describe 'PublicanCreatorsChange' do
|
152
|
-
describe '.remove_orgname' do
|
153
|
-
context 'Work Environment (Article) Without Publicans Title Logo' do
|
154
|
-
title = 'The_holy_Bible-WorkArt'
|
155
|
-
artinfo = "#{title}/de-DE/Article_Info.xml"
|
156
|
-
bookinfo = "#{title}/de-DE/Book_Info.xml"
|
157
|
-
title_logo = 'false'
|
158
|
-
type = 'Article'
|
159
|
-
pattern = 'orgname'
|
160
|
-
it 'Removes the title logo' do
|
161
|
-
PublicanCreatorsChange.remove_orgname_prepare(bookinfo, artinfo,
|
162
|
-
title_logo, type)
|
163
|
-
result = PublicanCreatorsTest.check_content(artinfo, pattern)
|
164
|
-
expect(result).equal? 'false'
|
165
|
-
end
|
166
|
-
end
|
167
|
-
|
168
|
-
context 'Work Environment (Book) Without Publicans Title Logo' do
|
169
|
-
title = 'The_holy_Bible-WorkBook'
|
170
|
-
artinfo = "#{title}/de-DE/Article_Info.xml"
|
171
|
-
bookinfo = "#{title}/de-DE/Book_Info.xml"
|
172
|
-
title_logo = 'false'
|
173
|
-
type = 'Book'
|
174
|
-
pattern = 'orgname'
|
175
|
-
it 'Removes the title logo' do
|
176
|
-
PublicanCreatorsChange.remove_orgname_prepare(bookinfo, artinfo,
|
177
|
-
title_logo, type)
|
178
|
-
result = PublicanCreatorsTest.check_content(bookinfo, pattern)
|
179
|
-
expect(result).equal? 'false'
|
180
|
-
end
|
181
|
-
end
|
182
|
-
|
183
|
-
context 'With Publicans Title Logo' do
|
184
|
-
title = 'The_holy_Bible-PrivArt'
|
185
|
-
artinfo = "#{title}/de-DE/Article_Info.xml"
|
186
|
-
bookinfo = "#{title}/de-DE/Book_Info.xml"
|
187
|
-
title_logo = 'true'
|
188
|
-
type = 'Article'
|
189
|
-
pattern = 'orgname'
|
190
|
-
it 'Removes not the title logo' do
|
191
|
-
PublicanCreatorsChange.remove_orgname_prepare(bookinfo, artinfo,
|
192
|
-
title_logo, type)
|
193
|
-
result = PublicanCreatorsTest.check_content(artinfo, pattern)
|
194
|
-
expect(result).equal? 'true'
|
195
|
-
end
|
196
|
-
end
|
197
|
-
|
198
|
-
context 'With Publicans Title Logo' do
|
199
|
-
title = 'The_holy_Bible-PrivBook'
|
200
|
-
artinfo = "#{title}/de-DE/Article_Info.xml"
|
201
|
-
bookinfo = "#{title}/de-DE/Book_Info.xml"
|
202
|
-
title_logo = 'true'
|
203
|
-
type = 'Book'
|
204
|
-
pattern = 'orgname'
|
205
|
-
it 'Removes not the title logo' do
|
206
|
-
PublicanCreatorsChange.remove_orgname_prepare(bookinfo, artinfo,
|
207
|
-
title_logo, type)
|
208
|
-
result = PublicanCreatorsTest.check_content(bookinfo, pattern)
|
209
|
-
expect(result).equal? 'true'
|
210
|
-
end
|
211
|
-
end
|
212
|
-
end
|
213
|
-
end
|
214
|
-
|
215
|
-
describe 'PublicanCreatorsChange' do
|
216
|
-
describe '.remove_legal' do
|
217
|
-
context 'Work (Article) Without Legalnotice' do
|
218
|
-
type = 'Article'
|
219
|
-
legal = 'true'
|
220
|
-
environment = 'Work'
|
221
|
-
title = 'The_holy_Bible-WorkArt'
|
222
|
-
artinfo = "#{title}/de-DE/Article_Info.xml"
|
223
|
-
pattern = '<xi:include href="Common_Content/
|
224
|
-
Legal_Notice.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />'
|
225
|
-
it 'removes the Legalnotice from the XML file' do
|
226
|
-
PublicanCreatorsChange.remove_legal(environment, type, legal, artinfo)
|
227
|
-
result = PublicanCreatorsTest.check_content(artinfo, pattern)
|
228
|
-
expect(result).equal? 'false'
|
229
|
-
end
|
230
|
-
end
|
231
|
-
|
232
|
-
context 'Work (Book) Without Legalnotice' do
|
233
|
-
type = 'Book'
|
234
|
-
legal = 'true'
|
235
|
-
environment = 'Work'
|
236
|
-
title = 'The_holy_Bible-WorkBook'
|
237
|
-
bookinfo = "#{title}/de-DE/Book_Info.xml"
|
238
|
-
pattern = '<xi:include href="Common_Content/
|
239
|
-
Legal_Notice.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />'
|
240
|
-
it 'removes the Legalnotice from the XML file' do
|
241
|
-
PublicanCreatorsChange.remove_legal(environment, type, legal, bookinfo)
|
242
|
-
result = PublicanCreatorsTest.check_content(bookinfo, pattern)
|
243
|
-
expect(result).equal? 'true'
|
244
|
-
end
|
245
|
-
end
|
246
|
-
|
247
|
-
context 'With Legalnotice inside the XML file' do
|
248
|
-
type = 'Article'
|
249
|
-
legal = 'false'
|
250
|
-
environment = 'Private'
|
251
|
-
title = 'The_holy_Bible-PrivArt'
|
252
|
-
artinfo = "#{title}/de-DE/Article_Info.xml"
|
253
|
-
pattern = '<xi:include href="Common_Content/
|
254
|
-
Legal_Notice.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />'
|
255
|
-
it 'removes the Legalnotice from the XML file' do
|
256
|
-
PublicanCreatorsChange.remove_legal(environment, type, legal, artinfo)
|
257
|
-
result = PublicanCreatorsTest.check_content(artinfo, pattern)
|
258
|
-
expect(result).equal? 'true'
|
259
|
-
end
|
260
|
-
end
|
261
|
-
|
262
|
-
context 'With Legalnotice inside the XML file' do
|
263
|
-
type = 'Book'
|
264
|
-
legal = 'false'
|
265
|
-
environment = 'Private'
|
266
|
-
title = 'The_holy_Bible-PrivBook'
|
267
|
-
bookinfo = "#{title}/de-DE/Book_Info.xml"
|
268
|
-
pattern = '<xi:include href="Common_Content/
|
269
|
-
Legal_Notice.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />'
|
270
|
-
it 'removes the Legalnotice from the XML file' do
|
271
|
-
PublicanCreatorsChange.remove_legal(environment, type, legal, bookinfo)
|
272
|
-
result = PublicanCreatorsTest.check_content(bookinfo, pattern)
|
273
|
-
expect(result).equal? 'true'
|
274
|
-
end
|
275
|
-
end
|
276
|
-
end
|
277
|
-
end
|
278
|
-
|
279
|
-
describe 'PublicanCreatorsChange' do
|
280
|
-
describe '.fix_revhist' do
|
281
|
-
context 'Work Environment' do
|
282
|
-
environment = 'Work'
|
283
|
-
name = 'Sascha Manns'
|
284
|
-
firstname = 'Sascha'
|
285
|
-
surname = 'Manns'
|
286
|
-
email = 'samannsml@directbox.com'
|
287
|
-
email_business = 'Sascha.Manns@xcom.de'
|
288
|
-
title = 'The_holy_Bible-WorkArt'
|
289
|
-
revhist = "#{title}/de-DE/Revision_History.xml"
|
290
|
-
it 'Updates the revision history in Work context' do
|
291
|
-
PublicanCreatorsChange.fix_revhist(environment, name, email_business,
|
292
|
-
email, revhist)
|
293
|
-
[firstname, surname, email_business].each do |pattern|
|
294
|
-
result = PublicanCreatorsTest.check_content(revhist, pattern)
|
295
|
-
expect(result).equal? 'true'
|
296
|
-
end
|
297
|
-
end
|
298
|
-
end
|
299
|
-
|
300
|
-
context 'Private Environment' do
|
301
|
-
environment = 'Private'
|
302
|
-
name = 'Sascha Manns'
|
303
|
-
firstname = 'Sascha'
|
304
|
-
surname = 'Manns'
|
305
|
-
email = 'samannsml@directbox.com'
|
306
|
-
email_business = 'Sascha.Manns@xcom.de'
|
307
|
-
title = 'The_holy_Bible-PrivArt'
|
308
|
-
revhist = "#{title}/de-DE/Revision_History.xml"
|
309
|
-
it 'updates the revision history to Private context' do
|
310
|
-
PublicanCreatorsChange.fix_revhist(environment, name, email_business,
|
311
|
-
email, revhist)
|
312
|
-
[firstname, surname, email_business].each do |pattern|
|
313
|
-
result = PublicanCreatorsTest.check_content(revhist, pattern)
|
314
|
-
expect(result).equal? 'true'
|
315
|
-
end
|
316
|
-
end
|
317
|
-
end
|
318
|
-
end
|
319
|
-
end
|
320
|
-
|
321
|
-
describe 'PublicanCreatorsChange' do
|
322
|
-
describe '.fix_authorgroup' do
|
323
|
-
context 'Work' do
|
324
|
-
email_business = 'Sascha.Manns@xcom.de'
|
325
|
-
name = 'Sascha Manns'
|
326
|
-
firstname = 'Sascha'
|
327
|
-
surname = 'Manns'
|
328
|
-
company_name = 'XCOM AG'
|
329
|
-
company_division = 'SWE7'
|
330
|
-
email = 'Sascha.Manns@xcom.de'
|
331
|
-
environment = 'Work'
|
332
|
-
title = 'The_holy_Bible-WorkArt'
|
333
|
-
agroup = "#{title}/de-DE/Author_Group.xml"
|
334
|
-
it 'Updates Authorgroup in Work context' do
|
335
|
-
PublicanCreatorsChange.fix_authorgroup(name, email_business,
|
336
|
-
company_name, company_division,
|
337
|
-
email, environment, agroup)
|
338
|
-
[firstname, surname, email_business, company_name,
|
339
|
-
company_division].each do |pattern|
|
340
|
-
result = PublicanCreatorsTest.check_content(agroup, pattern)
|
341
|
-
expect(result).equal? 'true'
|
342
|
-
end
|
343
|
-
end
|
344
|
-
end
|
345
|
-
|
346
|
-
context 'Private' do
|
347
|
-
email_business = 'Sascha.Manns@xcom.de'
|
348
|
-
name = 'Sascha Manns'
|
349
|
-
firstname = 'Sascha'
|
350
|
-
surname = 'Manns'
|
351
|
-
company_name = 'XCOM AG'
|
352
|
-
company_division = 'SWE7'
|
353
|
-
email = 'samannsml@directbox.com'
|
354
|
-
environment = 'Private'
|
355
|
-
title = 'The_holy_Bible-PrivArt'
|
356
|
-
agroup = "#{title}/de-DE/Author_Group.xml"
|
357
|
-
it 'Updates Authorgroup in Work context' do
|
358
|
-
PublicanCreatorsChange.fix_authorgroup(name, email_business,
|
359
|
-
company_name, company_division,
|
360
|
-
email, environment, agroup)
|
361
|
-
[firstname, surname, email].each do |pattern|
|
362
|
-
result = PublicanCreatorsTest.check_content(agroup, pattern)
|
363
|
-
expect(result).equal? 'true'
|
364
|
-
end
|
365
|
-
end
|
366
|
-
end
|
367
|
-
end
|
368
|
-
end
|
369
|
-
|
370
|
-
describe 'PublicanCreatorsExport' do
|
371
|
-
describe '.export_buildscript' do
|
372
|
-
context 'Default'
|
373
|
-
title = 'The_holy_Bible-WorkArt'
|
374
|
-
builds = "#{title}/de-DE/Rakefile"
|
375
|
-
language = 'de-DE'
|
376
|
-
xfc_brand_dir = '/opt/XMLmind/xfc-xcom-stylesheet/xsl/fo/docbook.xsl'
|
377
|
-
pdfview = '/opt/cxoffice/bin/wine --bottle "PDF-XChange Viewer 2.x" --cx-app
|
378
|
-
PDFXCview.exe'
|
379
|
-
it 'exports a shellscript with resolved title entity' do
|
380
|
-
PublicanCreatorsExport.export_buildscript(title, builds, language,
|
381
|
-
xfc_brand_dir, pdfview)
|
382
|
-
File.exist?(builds)
|
383
|
-
PublicanCreatorsTest.check_content(builds, xfc_brand_dir)
|
384
|
-
:expect == true
|
385
|
-
end
|
386
|
-
end
|
387
|
-
end
|
388
|
-
|
389
|
-
describe 'PublicanCreatorsTest' do
|
390
|
-
describe '.cleanup' do
|
391
|
-
it 'cleans up the test directory' do
|
392
|
-
PublicanCreatorsTest.cleanup
|
393
|
-
File.exist?('The_holy_Bible-PrivArt')
|
394
|
-
File.exist?('The_holy_Bible-PrivArtHome')
|
395
|
-
File.exist?('The_holy_Bible-PrivArtBook')
|
396
|
-
File.exist?('The_holy_Bible-WorkArt')
|
397
|
-
File.exist?('The_holy_Bible-WorkBook')
|
398
|
-
:expect == 'false'
|
399
|
-
end
|
400
|
-
end
|
401
|
-
end
|