paperwork 0.3.0 → 0.3.1
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/Gemfile.lock +1 -1
- data/lib/paperwork/cli.rb +48 -26
- data/lib/paperwork/version.rb +1 -1
- metadata +1 -5
- data/bin/console +0 -15
- data/bin/setup +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: acec360949d7b7403f5b7d6985a6cca4289d03c19cf13f7c12a5db5d468072ea
|
4
|
+
data.tar.gz: d6cdb1bd4f9cbb211d2663c62b1ccd461c15a7c8d7a84f9afad049c31a8c2dd4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6a1b14be156b22c42345512735e242a58b1b4ea38354e9b0550c1cab88d4c52d3a8b3efacbefbbe010f983fdaaf7536351efb394390604db58566086c085d98
|
7
|
+
data.tar.gz: 3b781ef6f0ce74100687d61e04a425a6477629f1ad1cf65f2f476a80629eddef4a32cbed834d5ef0012addd5f1dcc1dd0652aafeda8280f2e281aac6ecd958dc
|
data/Gemfile.lock
CHANGED
data/lib/paperwork/cli.rb
CHANGED
@@ -1,8 +1,16 @@
|
|
1
|
-
|
2
|
-
require "thor"
|
3
|
-
require "paperwork"
|
1
|
+
# frozen_string_literal: true
|
4
2
|
|
3
|
+
##
|
4
|
+
# globla namespace for paperwork
|
5
|
+
#
|
5
6
|
module Paperwork
|
7
|
+
require "yaml"
|
8
|
+
require "thor"
|
9
|
+
require "paperwork"
|
10
|
+
|
11
|
+
##
|
12
|
+
# command line interface for paperwork
|
13
|
+
#
|
6
14
|
class CLI < Thor
|
7
15
|
attr_accessor :config
|
8
16
|
|
@@ -11,13 +19,22 @@ module Paperwork
|
|
11
19
|
class_option :verbose, aliases: "-v", desc: "be verbose about the build", type: :boolean, default: false
|
12
20
|
|
13
21
|
desc "build",
|
14
|
-
|
22
|
+
<<~DESC
|
23
|
+
creates documentation as defined in
|
24
|
+
#{CONFIG_FILE} and writes it to
|
25
|
+
'#{Paperwork::Config[:build_root]}/<name>/build'
|
26
|
+
DESC
|
15
27
|
def build
|
16
28
|
build_internal "build"
|
17
29
|
end
|
18
30
|
|
19
31
|
desc "rebuild",
|
20
|
-
|
32
|
+
<<~DESC
|
33
|
+
removes previous builds and creates
|
34
|
+
documentation as defined in
|
35
|
+
#{CONFIG_FILE} and writes it to
|
36
|
+
'#{Paperwork::Config[:build_root]}/<name>/build'
|
37
|
+
DESC
|
21
38
|
def rebuild
|
22
39
|
build_internal "rebuild"
|
23
40
|
end
|
@@ -29,33 +46,38 @@ module Paperwork
|
|
29
46
|
end
|
30
47
|
|
31
48
|
protected
|
32
|
-
def build_internal(task)
|
33
|
-
setup_config
|
34
|
-
setup_tasks
|
35
|
-
invoke_tasks task
|
36
|
-
end
|
37
49
|
|
38
|
-
|
50
|
+
def build_internal(task)
|
51
|
+
setup_config
|
52
|
+
setup_tasks
|
53
|
+
invoke_tasks task
|
54
|
+
end
|
55
|
+
|
56
|
+
def setup_config
|
57
|
+
unless File.exist?(CONFIG_FILE)
|
39
58
|
raise Exception.new(
|
40
59
|
"#{CONFIG_FILE} not found. You need to create a configuration file first."
|
41
|
-
)
|
60
|
+
)
|
61
|
+
end
|
42
62
|
|
43
|
-
|
44
|
-
|
45
|
-
|
63
|
+
yaml = YAML.load_file(CONFIG_FILE)
|
64
|
+
self.config = yaml["config"]
|
65
|
+
self.config["sources"] << CONFIG_FILE
|
46
66
|
|
47
|
-
|
48
|
-
"No 'config' found in #{CONFIG_FILE}. You need to describe the build setup in a 'config' section first."
|
49
|
-
) if self.config.nil?
|
50
|
-
end
|
67
|
+
return unless self.config.nil?
|
51
68
|
|
52
|
-
|
53
|
-
|
54
|
-
|
69
|
+
raise Exception.new(
|
70
|
+
"No 'config' found in #{CONFIG_FILE}. You need to describe the build setup in a 'config' section first."
|
71
|
+
)
|
72
|
+
end
|
55
73
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
74
|
+
def setup_tasks
|
75
|
+
paperwork self.config["name"], sources: self.config["sources"]
|
76
|
+
end
|
77
|
+
|
78
|
+
def invoke_tasks(target)
|
79
|
+
Rake::Task["paperwork:#{self.config["name"]}:set_verbose"].invoke if options[:verbose]
|
80
|
+
Rake::Task["paperwork:#{self.config["name"]}:#{target}"].invoke
|
81
|
+
end
|
60
82
|
end
|
61
83
|
end
|
data/lib/paperwork/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paperwork
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Schmid
|
@@ -126,9 +126,7 @@ description:
|
|
126
126
|
email:
|
127
127
|
- couchbelag@gmail.com
|
128
128
|
executables:
|
129
|
-
- console
|
130
129
|
- paperwork
|
131
|
-
- setup
|
132
130
|
extensions: []
|
133
131
|
extra_rdoc_files: []
|
134
132
|
files:
|
@@ -142,9 +140,7 @@ files:
|
|
142
140
|
- LICENSE.txt
|
143
141
|
- README.md
|
144
142
|
- Rakefile
|
145
|
-
- bin/console
|
146
143
|
- bin/paperwork
|
147
|
-
- bin/setup
|
148
144
|
- custom.css
|
149
145
|
- custom.js
|
150
146
|
- lib/paperwork.rb
|
data/bin/console
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
require "bundler/setup"
|
5
|
-
require "paperwork"
|
6
|
-
|
7
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
-
# with your gem easier. You can also use a different console, if you like.
|
9
|
-
|
10
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
-
# require "pry"
|
12
|
-
# Pry.start
|
13
|
-
|
14
|
-
require "irb"
|
15
|
-
IRB.start(__FILE__)
|