texy 0.8.2 → 0.10.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.tool-versions +1 -0
- data/Gemfile.lock +3 -3
- data/lib/texy.rb +7 -18
- data/lib/texy/configuration.rb +3 -3
- data/lib/texy/configuration/client.rb +7 -7
- data/lib/texy/configuration/{nead_werx.rb → company.rb} +4 -4
- data/lib/texy/document.rb +25 -17
- data/lib/texy/documents/release_notes.rb +5 -0
- data/lib/texy/documents/statement_of_work.rb +2 -2
- data/lib/texy/version.rb +1 -1
- data/texy.gemspec +13 -13
- metadata +8 -8
- data/lib/texy/documents/change_order.rb +0 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22c1b9c891f0747dc3c6a75d99c566e2f8cf0259d6f9451ea6401409e8cdf2f3
|
4
|
+
data.tar.gz: 6d830d3aad5706aa5a8213b265ae39bf24eb83935ba1e11e5638536dc511811e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02be7094aab23b6308d775b303bc704101a1ad535642937b1cf4c3a08186d9071b4565c83ef959f9cdcdc65e913f5a92740dbaa3c33b35e67fecf9192a2725c0
|
7
|
+
data.tar.gz: 21376883ffe1ea73b79a7a52b3e2eeaf22a9bd4b6510356ff048e0ed47382b441b9218f24ab2b49177158d4e998e19cc5489216836a60c51aaafaf8ef21925dd
|
data/.tool-versions
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby 2.6.3
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
texy (0.
|
4
|
+
texy (0.10.2)
|
5
5
|
activesupport (~> 6.0)
|
6
6
|
thor (~> 0.20.3)
|
7
7
|
zeitwerk (~> 2.1)
|
@@ -9,12 +9,12 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
activesupport (6.0.
|
12
|
+
activesupport (6.0.3)
|
13
13
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
14
14
|
i18n (>= 0.7, < 2)
|
15
15
|
minitest (~> 5.1)
|
16
16
|
tzinfo (~> 1.1)
|
17
|
-
zeitwerk (~> 2.2)
|
17
|
+
zeitwerk (~> 2.2, >= 2.2.2)
|
18
18
|
ast (2.4.0)
|
19
19
|
coderay (1.1.2)
|
20
20
|
concurrent-ruby (1.1.6)
|
data/lib/texy.rb
CHANGED
@@ -40,19 +40,6 @@ module Texy
|
|
40
40
|
exit
|
41
41
|
end
|
42
42
|
|
43
|
-
desc "new-change", "Create a new Change Order"
|
44
|
-
def new_change
|
45
|
-
@repository = Documents::ChangeOrder.repository
|
46
|
-
@object = Documents::ChangeOrder.new
|
47
|
-
|
48
|
-
set_up_environment
|
49
|
-
|
50
|
-
populate_code(object: @object)
|
51
|
-
rescue SystemExit, Interrupt
|
52
|
-
say "Exiting"
|
53
|
-
exit
|
54
|
-
end
|
55
|
-
|
56
43
|
desc "new-release-notes", "Create new Release Notes"
|
57
44
|
def new_release_notes
|
58
45
|
@repository = Documents::ReleaseNotes.repository
|
@@ -69,7 +56,7 @@ module Texy
|
|
69
56
|
no_commands do
|
70
57
|
# Dynamic placeholder file names in the .templates directory allow the object to define the main file's name
|
71
58
|
def main_file_name
|
72
|
-
@object.
|
59
|
+
@object.file_no_extension
|
73
60
|
end
|
74
61
|
end
|
75
62
|
|
@@ -77,7 +64,7 @@ module Texy
|
|
77
64
|
|
78
65
|
def populate_code(object:)
|
79
66
|
create_folder(folder: object.folder)
|
80
|
-
copy_template_files(template_name: object.type, folder: object.folder
|
67
|
+
copy_template_files(template_name: object.type, folder: object.folder)
|
81
68
|
|
82
69
|
say "Time to populate the LaTeX file..."
|
83
70
|
|
@@ -89,20 +76,22 @@ module Texy
|
|
89
76
|
def create_folder(folder:)
|
90
77
|
say "Creating folder structure..."
|
91
78
|
|
92
|
-
empty_directory folder
|
79
|
+
empty_directory "#{TOP_LEVEL_DIRECTORY}/#{folder}"
|
93
80
|
|
94
81
|
say "Folder #{folder} created", :green
|
95
82
|
end
|
96
83
|
|
97
|
-
def copy_template_files(template_name:, folder
|
84
|
+
def copy_template_files(template_name:, folder:)
|
98
85
|
say "Copying template files..."
|
99
86
|
|
100
|
-
directory template_name, folder, recursive: true
|
87
|
+
directory template_name, "#{TOP_LEVEL_DIRECTORY}/#{folder}", recursive: true
|
101
88
|
|
102
89
|
say "Template files copied", :green
|
103
90
|
end
|
104
91
|
|
105
92
|
def push_to_git(branch:)
|
93
|
+
return if ENV["DEBUG"]
|
94
|
+
|
106
95
|
say "Ensuring that branch exists..."
|
107
96
|
|
108
97
|
unless system_no_output("git rev-parse --verify #{branch}")
|
data/lib/texy/configuration.rb
CHANGED
@@ -6,7 +6,7 @@ module Texy
|
|
6
6
|
include Thor::Actions
|
7
7
|
|
8
8
|
attr_reader :configuration
|
9
|
-
attr_reader :
|
9
|
+
attr_reader :company
|
10
10
|
attr_reader :client
|
11
11
|
|
12
12
|
CONFIGURATION_FILE_NAME = "customers.yml"
|
@@ -21,8 +21,8 @@ module Texy
|
|
21
21
|
exit
|
22
22
|
end
|
23
23
|
|
24
|
-
@
|
25
|
-
@client
|
24
|
+
@company = Configuration::Company.new(configuration.dig(:company))
|
25
|
+
@client = Configuration::Client.new(configuration.dig(:client))
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
@@ -23,20 +23,20 @@ module Texy
|
|
23
23
|
|
24
24
|
def extract_people
|
25
25
|
@principal = Configuration::Person.new(**configuration.dig(:principal))
|
26
|
-
@signer
|
26
|
+
@signer = Configuration::Person.new(**configuration.dig(:signer))
|
27
27
|
end
|
28
28
|
|
29
29
|
def extract_rate
|
30
|
-
@rate
|
30
|
+
@rate = configuration.dig(:rate)
|
31
31
|
@rate_multiplier = configuration.dig(:rate_multiplier)
|
32
32
|
end
|
33
33
|
|
34
34
|
def extract_basic_info
|
35
|
-
@name
|
36
|
-
@short_name
|
37
|
-
@abbreviation
|
38
|
-
@number
|
39
|
-
@system_name
|
35
|
+
@name = configuration.dig(:name)
|
36
|
+
@short_name = configuration.dig(:short_name)
|
37
|
+
@abbreviation = configuration.dig(:abbreviation)
|
38
|
+
@number = configuration.dig(:number)
|
39
|
+
@system_name = configuration.dig(:system_name)
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
@@ -2,12 +2,12 @@
|
|
2
2
|
|
3
3
|
module Texy
|
4
4
|
class Configuration
|
5
|
-
class
|
5
|
+
class Company
|
6
6
|
attr_reader :configuration
|
7
7
|
attr_reader :principal, :signer
|
8
8
|
|
9
|
-
def initialize(
|
10
|
-
@configuration =
|
9
|
+
def initialize(company_configuration)
|
10
|
+
@configuration = company_configuration
|
11
11
|
|
12
12
|
extract_people
|
13
13
|
end
|
@@ -16,7 +16,7 @@ module Texy
|
|
16
16
|
|
17
17
|
def extract_people
|
18
18
|
@principal = Configuration::Person.new(**configuration.dig(:principal))
|
19
|
-
@signer
|
19
|
+
@signer = Configuration::Person.new(**configuration.dig(:signer))
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
data/lib/texy/document.rb
CHANGED
@@ -13,7 +13,7 @@ module Texy
|
|
13
13
|
def initialize
|
14
14
|
@client = ask("Which client folder will this #{type_humanized} be in?", :yellow)
|
15
15
|
@number = ask("Which #{type_humanized} number is this?", :yellow).rjust(3, "0")
|
16
|
-
@title
|
16
|
+
@title = ask("What is the title of this document?", :yellow)
|
17
17
|
end
|
18
18
|
|
19
19
|
def branch
|
@@ -24,8 +24,16 @@ module Texy
|
|
24
24
|
"#{client}/#{number}"
|
25
25
|
end
|
26
26
|
|
27
|
+
def file_no_extension
|
28
|
+
"#{client}_#{number}"
|
29
|
+
end
|
30
|
+
|
27
31
|
def file
|
28
|
-
"#{
|
32
|
+
"#{file_no_extension}.tex"
|
33
|
+
end
|
34
|
+
|
35
|
+
def definition_file
|
36
|
+
"lib/commands_and_definitions.tex"
|
29
37
|
end
|
30
38
|
|
31
39
|
def substitute_placeholders(configuration:)
|
@@ -37,31 +45,31 @@ module Texy
|
|
37
45
|
# Placeholders dependent on the client configuration
|
38
46
|
def config_placeholders
|
39
47
|
{
|
40
|
-
/TEMPLATE-PLACEHOLDER-CLIENT-NAME/
|
41
|
-
/TEMPLATE-PLACEHOLDER-CLIENT-NUMBER/
|
42
|
-
/TEMPLATE-PLACEHOLDER-CLIENT-SHORT-NAME/
|
43
|
-
/TEMPLATE-PLACEHOLDER-CLIENT-PRINCIPAL-NAME/
|
44
|
-
/TEMPLATE-PLACEHOLDER-CLIENT-SIGNER-NAME/
|
45
|
-
/TEMPLATE-PLACEHOLDER-CLIENT-SIGNER-ROLE/
|
46
|
-
/TEMPLATE-PLACEHOLDER-NEAD-WERX-PRINCIPAL-NAME/ => ->(config) { config.
|
47
|
-
/TEMPLATE-PLACEHOLDER-NEAD-WERX-SIGNER-NAME/
|
48
|
-
/TEMPLATE-PLACEHOLDER-NEAD-WERX-SIGNER-ROLE/
|
48
|
+
/TEMPLATE-PLACEHOLDER-CLIENT-NAME/ => ->(config) { config.client.name },
|
49
|
+
/TEMPLATE-PLACEHOLDER-CLIENT-NUMBER/ => ->(config) { config.client.number },
|
50
|
+
/TEMPLATE-PLACEHOLDER-CLIENT-SHORT-NAME/ => ->(config) { config.client.short_name },
|
51
|
+
/TEMPLATE-PLACEHOLDER-CLIENT-PRINCIPAL-NAME/ => ->(config) { config.client.principal.name },
|
52
|
+
/TEMPLATE-PLACEHOLDER-CLIENT-SIGNER-NAME/ => ->(config) { config.client.signer.name },
|
53
|
+
/TEMPLATE-PLACEHOLDER-CLIENT-SIGNER-ROLE/ => ->(config) { config.client.signer.role },
|
54
|
+
/TEMPLATE-PLACEHOLDER-NEAD-WERX-PRINCIPAL-NAME/ => ->(config) { config.company.principal.name },
|
55
|
+
/TEMPLATE-PLACEHOLDER-NEAD-WERX-SIGNER-NAME/ => ->(config) { config.company.signer.name },
|
56
|
+
/TEMPLATE-PLACEHOLDER-NEAD-WERX-SIGNER-ROLE/ => ->(config) { config.company.signer.role }
|
49
57
|
}
|
50
58
|
end
|
51
59
|
|
52
60
|
# Placeholders dependent on this specific document, not the client in general
|
53
61
|
def base_placeholders
|
54
62
|
{
|
55
|
-
/TEMPLATE-PLACEHOLDER-PROJECT-NUMBER/
|
56
|
-
/TEMPLATE-PLACEHOLDER-PROJECT-TITLE/
|
57
|
-
/TEMPLATE-PLACEHOLDER-DOCUMENT-VERSION/ => ->(_document) { "1.0" }
|
63
|
+
/TEMPLATE-PLACEHOLDER-PROJECT-NUMBER/ => ->(document) { document.number },
|
64
|
+
/TEMPLATE-PLACEHOLDER-PROJECT-TITLE/ => ->(document) { document.title },
|
65
|
+
/TEMPLATE-PLACEHOLDER-DOCUMENT-VERSION/ => ->(_document) { "1.0" }
|
58
66
|
}
|
59
67
|
end
|
60
68
|
|
61
69
|
# Placeholders located in the index file, not the LaTeX file
|
62
70
|
def index_file_placeholders
|
63
71
|
{
|
64
|
-
/TEMPLATE-PLACEHOLDER-INDEX-TITLE/ => ->(document) { document.title }
|
72
|
+
/TEMPLATE-PLACEHOLDER-INDEX-TITLE/ => ->(document) { document.title }
|
65
73
|
}
|
66
74
|
end
|
67
75
|
|
@@ -81,7 +89,7 @@ module Texy
|
|
81
89
|
base_placeholders.each do |regex, document_method|
|
82
90
|
placeholder_value = document_method.call(self)
|
83
91
|
|
84
|
-
substitute(file: "#{folder}/#{
|
92
|
+
substitute(file: "#{folder}/#{definition_file}", pattern: regex, replacement: placeholder_value)
|
85
93
|
end
|
86
94
|
|
87
95
|
say "Base file substitutions complete", :green
|
@@ -91,7 +99,7 @@ module Texy
|
|
91
99
|
config_placeholders.each do |regex, config_method|
|
92
100
|
placeholder_value = config_method.call(configuration)
|
93
101
|
|
94
|
-
substitute(file: "#{folder}/#{
|
102
|
+
substitute(file: "#{folder}/#{definition_file}", pattern: regex, replacement: placeholder_value)
|
95
103
|
end
|
96
104
|
|
97
105
|
say "Configuration file substitutions complete", :green
|
@@ -21,8 +21,8 @@ module Texy
|
|
21
21
|
|
22
22
|
def config_placeholders
|
23
23
|
super.merge(
|
24
|
-
/TEMPLATE-PLACEHOLDER-CLIENT-HOURLY-RATE/
|
25
|
-
/TEMPLATE-PLACEHOLDER-CLIENT-RATE-MULTIPLIER/ => ->(config) { config.client.rate_multiplier }
|
24
|
+
/TEMPLATE-PLACEHOLDER-CLIENT-HOURLY-RATE/ => ->(config) { config.client.rate },
|
25
|
+
/TEMPLATE-PLACEHOLDER-CLIENT-RATE-MULTIPLIER/ => ->(config) { config.client.rate_multiplier }
|
26
26
|
)
|
27
27
|
end
|
28
28
|
end
|
data/lib/texy/version.rb
CHANGED
data/texy.gemspec
CHANGED
@@ -5,14 +5,14 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
5
|
require "texy/version"
|
6
6
|
|
7
7
|
Gem::Specification.new do |spec|
|
8
|
-
spec.name
|
9
|
-
spec.version
|
10
|
-
spec.authors
|
11
|
-
spec.email
|
8
|
+
spec.name = "texy"
|
9
|
+
spec.version = Texy::VERSION
|
10
|
+
spec.authors = ["Stephen Dolan"]
|
11
|
+
spec.email = ["stephen@neadwerx.com"]
|
12
12
|
|
13
|
-
spec.summary
|
14
|
-
spec.description
|
15
|
-
spec.homepage
|
13
|
+
spec.summary = "Command line tool for SoW writing"
|
14
|
+
spec.description = "Command line tool for SoW writing"
|
15
|
+
spec.homepage = "https://neadwerx.com"
|
16
16
|
|
17
17
|
raise "RubyGems 2.0 or newer is required to protect against public gem pushes." unless spec.respond_to?(:metadata)
|
18
18
|
|
@@ -26,17 +26,17 @@ Gem::Specification.new do |spec|
|
|
26
26
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
27
27
|
end
|
28
28
|
|
29
|
-
spec.bindir
|
30
|
-
spec.executables
|
29
|
+
spec.bindir = "exe"
|
30
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
31
31
|
spec.require_paths = ["lib"]
|
32
32
|
|
33
33
|
spec.add_dependency "activesupport", "~> 6.0"
|
34
34
|
spec.add_dependency "thor", "~> 0.20.3"
|
35
35
|
spec.add_dependency "zeitwerk", "~> 2.1"
|
36
36
|
|
37
|
-
spec.add_development_dependency "bundler",
|
38
|
-
spec.add_development_dependency "pry",
|
39
|
-
spec.add_development_dependency "rake",
|
40
|
-
spec.add_development_dependency "rspec",
|
37
|
+
spec.add_development_dependency "bundler", "~> 2.0"
|
38
|
+
spec.add_development_dependency "pry", "~> 0.12"
|
39
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
40
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
41
41
|
spec.add_development_dependency "standard", "~> 0.2.5"
|
42
42
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: texy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Dolan
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -133,6 +133,7 @@ files:
|
|
133
133
|
- ".gitignore"
|
134
134
|
- ".rspec"
|
135
135
|
- ".ruby-version"
|
136
|
+
- ".tool-versions"
|
136
137
|
- CHANGELOG.md
|
137
138
|
- Gemfile
|
138
139
|
- Gemfile.lock
|
@@ -144,10 +145,9 @@ files:
|
|
144
145
|
- lib/texy.rb
|
145
146
|
- lib/texy/configuration.rb
|
146
147
|
- lib/texy/configuration/client.rb
|
147
|
-
- lib/texy/configuration/
|
148
|
+
- lib/texy/configuration/company.rb
|
148
149
|
- lib/texy/configuration/person.rb
|
149
150
|
- lib/texy/document.rb
|
150
|
-
- lib/texy/documents/change_order.rb
|
151
151
|
- lib/texy/documents/release_notes.rb
|
152
152
|
- lib/texy/documents/statement_of_work.rb
|
153
153
|
- lib/texy/version.rb
|
@@ -156,7 +156,7 @@ homepage: https://neadwerx.com
|
|
156
156
|
licenses: []
|
157
157
|
metadata:
|
158
158
|
homepage_uri: https://neadwerx.com
|
159
|
-
post_install_message:
|
159
|
+
post_install_message:
|
160
160
|
rdoc_options: []
|
161
161
|
require_paths:
|
162
162
|
- lib
|
@@ -171,8 +171,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
171
171
|
- !ruby/object:Gem::Version
|
172
172
|
version: '0'
|
173
173
|
requirements: []
|
174
|
-
rubygems_version: 3.
|
175
|
-
signing_key:
|
174
|
+
rubygems_version: 3.0.3
|
175
|
+
signing_key:
|
176
176
|
specification_version: 4
|
177
177
|
summary: Command line tool for SoW writing
|
178
178
|
test_files: []
|
@@ -1,30 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Texy
|
4
|
-
module Documents
|
5
|
-
class ChangeOrder < Document
|
6
|
-
def initialize
|
7
|
-
super
|
8
|
-
end
|
9
|
-
|
10
|
-
def self.repository
|
11
|
-
"git@bitbucket.org:neadwerx/leads.git"
|
12
|
-
end
|
13
|
-
|
14
|
-
def type_humanized
|
15
|
-
"Change Order"
|
16
|
-
end
|
17
|
-
|
18
|
-
def type
|
19
|
-
"change_order"
|
20
|
-
end
|
21
|
-
|
22
|
-
def config_placeholders
|
23
|
-
super.merge(
|
24
|
-
/TEMPLATE-PLACEHOLDER-CLIENT-HOURLY-RATE/ => ->(config) { config.client.rate },
|
25
|
-
/TEMPLATE-PLACEHOLDER-CLIENT-RATE-MULTIPLIER/ => ->(config) { config.client.rate_multiplier },
|
26
|
-
)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|