publican_creators 1.1.1 → 1.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/{History.rdoc → CHANGELOG.md} +101 -57
- data/CONTRIBUTING.md +14 -18
- data/LICENSE.md +636 -0
- data/MAINTENANCE.md +19 -0
- data/README.md +95 -0
- data/bin/publican_creators.rb +16 -0
- data/bin/revision_creator.rb +17 -6
- data/etc/publicancreators.cfg +3 -3
- data/lib/publican_creators.rb +95 -118
- data/lib/publican_creators/change.rb +98 -120
- data/lib/publican_creators/checker.rb +17 -7
- data/lib/publican_creators/create.rb +17 -11
- data/lib/publican_creators/export.rb +18 -12
- data/lib/publican_creators/get.rb +19 -9
- data/lib/publican_creators/notifier.rb +23 -16
- data/lib/publican_creators/prepare.rb +32 -23
- data/lib/publican_creators/revision.rb +19 -24
- data/lib/publican_creators/testlib.rb +13 -6
- data/lib/publican_creators/version.rb +35 -0
- metadata +69 -233
- data/.autotest +0 -25
- data/.codeclimate.yml +0 -8
- data/.coveralls.yml +0 -2
- data/.gemnasium.yml +0 -5
- data/.rspec +0 -2
- data/.rubocop.yml +0 -40
- data/.scrutinizer.yml +0 -21
- data/.travis.yml +0 -37
- data/.yardopts +0 -9
- data/CODE_OF_CONDUCT.md +0 -17
- data/Gemfile +0 -32
- data/Gemfile.lock +0 -136
- data/LICENSE.rdoc +0 -24
- data/Manifest.txt +0 -36
- data/README.rdoc +0 -99
- data/Rakefile +0 -135
- data/config.reek +0 -111
- data/data/publican_creators/publican-revision.png +0 -0
- data/data/publican_creators/publican.png +0 -0
- data/spec/lib_spec.rb +0 -401
- data/spec/spec_helper.rb +0 -16
data/Rakefile
DELETED
@@ -1,135 +0,0 @@
|
|
1
|
-
# -*- ruby -*-
|
2
|
-
# Release:
|
3
|
-
# * update *.wiki markdown documentation for GitLab
|
4
|
-
# * enable :git
|
5
|
-
# * rake run_before_release
|
6
|
-
# * disable :git
|
7
|
-
# * Checkin
|
8
|
-
# * rake release
|
9
|
-
# * rake run_after_release
|
10
|
-
|
11
|
-
require 'rubygems'
|
12
|
-
require 'hoe'
|
13
|
-
|
14
|
-
# rubocop:disable Metrics/LineLength
|
15
|
-
############################################# DEVELOPING ZONE #########################################################
|
16
|
-
Hoe.plugin :bundler
|
17
|
-
Hoe.plugin :doofus
|
18
|
-
Hoe.plugin :email
|
19
|
-
# Hoe.plugin :gem_prelude_sucks
|
20
|
-
#Hoe.plugins.delete :git
|
21
|
-
#Hoe.plugin :git
|
22
|
-
Hoe.plugin :highline
|
23
|
-
#Hoe.plugin :inline
|
24
|
-
Hoe.plugin :manns
|
25
|
-
Hoe.plugin :rubocop
|
26
|
-
Hoe.plugin :rubygems
|
27
|
-
# Hoe.plugin :seattlerb
|
28
|
-
Hoe.plugin :travis
|
29
|
-
Hoe.plugin :version
|
30
|
-
Hoe.plugin :website
|
31
|
-
|
32
|
-
Hoe.spec 'publican_creators' do
|
33
|
-
developer('Sascha Manns', 'Sascha.Manns@mailbox.org')
|
34
|
-
license 'MIT' # this should match the license in the README
|
35
|
-
require_ruby_version '>= 2.2.0'
|
36
|
-
|
37
|
-
email_to << 'ruby-talk@ruby-lang.org'
|
38
|
-
#email_to << 'Sascha.Manns@bdvb.de
|
39
|
-
|
40
|
-
self.history_file = 'History.rdoc'
|
41
|
-
self.readme_file = 'README.rdoc'
|
42
|
-
self.extra_rdoc_files = FileList['*.rdoc'].to_a
|
43
|
-
self.post_install_message = '*** Run rake setup to finish the installation *** Please file bugreports and feature requests on: https://github.com/saigkill/latex_curriculum_vitae/issues'
|
44
|
-
|
45
|
-
dependency 'setup', '~> 5.2'
|
46
|
-
dependency 'nokogiri', '~> 1.6'
|
47
|
-
dependency 'parseconfig', '~> 1.0'
|
48
|
-
dependency 'rainbow', '~> 2.1'
|
49
|
-
dependency 'notifier', '~> 0.5'
|
50
|
-
|
51
|
-
extra_dev_deps << ['coveralls', '~> 0.8']
|
52
|
-
extra_dev_deps << ['hoe-bundler', '~> 1.3']
|
53
|
-
extra_dev_deps << ['hoe-git', '~> 1.6']
|
54
|
-
extra_dev_deps << ['hoe-rubygems', '~> 1.0']
|
55
|
-
extra_dev_deps << ['hoe-manns', '~> 1.5']
|
56
|
-
extra_dev_deps << ['hoe-reek', '~> 1.1']
|
57
|
-
extra_dev_deps << ['hoe-rubocop', '~> 1.0']
|
58
|
-
extra_dev_deps << ['hoe-version', '~> 1.2']
|
59
|
-
extra_dev_deps << ['hoe-seattlerb', '~> 1.3']
|
60
|
-
extra_dev_deps << ['hoe', '~> 3.15']
|
61
|
-
extra_dev_deps << ['rake', '~> 11.2']
|
62
|
-
extra_dev_deps << ['manns_shared', '~> 1.0']
|
63
|
-
extra_dev_deps << ['bundler', '~> 1.11']
|
64
|
-
extra_dev_deps << ['rspec', '~> 3.5']
|
65
|
-
extra_dev_deps << ['rubocop', '~> 0.42']
|
66
|
-
extra_dev_deps << ['simplecov', '~> 0.12']
|
67
|
-
end
|
68
|
-
|
69
|
-
###################################### SETUP ZONE #####################################################################
|
70
|
-
|
71
|
-
require 'etc'
|
72
|
-
require 'fileutils'
|
73
|
-
desc 'Create Desktop files'
|
74
|
-
task :create_desktop_cre do
|
75
|
-
home = Dir.home
|
76
|
-
prefix = "#{home}/.rvm/rubies/default"
|
77
|
-
datadir = "#{prefix}/share"
|
78
|
-
publicancre = "#{home}/.local/share/applications/publicancreators.desktop"
|
79
|
-
publicancreico = "#{datadir}/publican_creators/publican.png"
|
80
|
-
system("sudo rm #{publicancre}") if File.exists?(publicancre)
|
81
|
-
puts 'Creating Desktop file for PublicanCreators'.color(:yellow)
|
82
|
-
FileUtils.touch "#{publicancre}"
|
83
|
-
File.write "#{publicancre}", <<EOF
|
84
|
-
[Desktop Entry]
|
85
|
-
Version=1.0
|
86
|
-
Type=Application
|
87
|
-
Name=PublicanCreators
|
88
|
-
Exec=publican_creators.rb
|
89
|
-
Icon=#{publicancreico}
|
90
|
-
EOF
|
91
|
-
end
|
92
|
-
|
93
|
-
require 'etc'
|
94
|
-
require 'fileutils'
|
95
|
-
desc 'Create publicancreators-rev.desktop'
|
96
|
-
task :create_desktop_rev do
|
97
|
-
home = Dir.home
|
98
|
-
prefix = "#{home}/.rvm/rubies/default"
|
99
|
-
datadir = "#{prefix}/share"
|
100
|
-
publicanrev = "#{home}/.local/share/applications/publicancreators-rev.desktop"
|
101
|
-
publicanrevico = "#{datadir}/publican_creators/publican-revision.png"
|
102
|
-
system("sudo rm #{publicanrev}") if File.exist?(publicanrev)
|
103
|
-
puts 'Creating Desktop file for PublicanCreatorsRevision'.color(:yellow)
|
104
|
-
FileUtils.touch "#{publicanrev}"
|
105
|
-
File.write "#{publicanrev}", <<EOF
|
106
|
-
[Desktop Entry]
|
107
|
-
Version=1.0
|
108
|
-
Type=Application
|
109
|
-
Name=PublicanCreatorsRevision
|
110
|
-
Exec=revision_creator.rb
|
111
|
-
Icon=#{publicanrevico}
|
112
|
-
EOF
|
113
|
-
end
|
114
|
-
|
115
|
-
require 'fileutils'
|
116
|
-
desc 'Backup config file'
|
117
|
-
task :backup_config do
|
118
|
-
home = Dir.home
|
119
|
-
prefix = "#{home}/.publican_creators"
|
120
|
-
from = 'publicancreators.cfg'
|
121
|
-
to = 'publicancreators.bak'
|
122
|
-
if File.exist?("#{prefix}/#{from}")
|
123
|
-
FileUtils.cd(prefix) do
|
124
|
-
FileUtils.cp(from, to)
|
125
|
-
end
|
126
|
-
end
|
127
|
-
end
|
128
|
-
|
129
|
-
desc 'Run setup'
|
130
|
-
task :setup => [:create_desktop_cre, :create_desktop_rev, :backup_config] do
|
131
|
-
system('setup.rb uninstall --force')
|
132
|
-
system('setup.rb config --sysconfdir=$HOME/.manns_shared')
|
133
|
-
system('setup.rb install')
|
134
|
-
end
|
135
|
-
# 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: []
|
Binary file
|
Binary file
|
data/spec/lib_spec.rb
DELETED
@@ -1,401 +0,0 @@
|
|
1
|
-
require 'rspec'
|
2
|
-
require 'publican_creators/checker'
|
3
|
-
require 'publican_creators/get'
|
4
|
-
require 'publican_creators/change'
|
5
|
-
require 'publican_creators/export'
|
6
|
-
require 'publican_creators/create'
|
7
|
-
require 'publican_creators/testlib'
|
8
|
-
require 'fileutils'
|
9
|
-
require 'tempfile'
|
10
|
-
require 'nokogiri'
|
11
|
-
require 'bundler/setup'
|
12
|
-
require 'rainbow/ext/string'
|
13
|
-
require File.dirname(__FILE__) + '/spec_helper'
|
14
|
-
|
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
|