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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 80f63892db3d3c30b601943f7c6a0929b92079d3dab71696a7b2426ef7ce7d3a
4
- data.tar.gz: 2b70456d7d56e4674df35e4a1864483c75d64087519ea3643b131369aea3ed83
3
+ metadata.gz: acec360949d7b7403f5b7d6985a6cca4289d03c19cf13f7c12a5db5d468072ea
4
+ data.tar.gz: d6cdb1bd4f9cbb211d2663c62b1ccd461c15a7c8d7a84f9afad049c31a8c2dd4
5
5
  SHA512:
6
- metadata.gz: a4f75a8c77f49ba6c00125cdd4176505bb43c85cf127278a033c479bc6d7a5ba22f4fecae0561b2ca4da0572aa5f014ce3e7a205b70a72aa1c59e6368ff81748
7
- data.tar.gz: c3efec0580ccd1a16ac3fb11caf587537d7fb3c57c9b3006a16d0c77d302313ed2dea8dbe3ec1385b5aef8ed706b36493f8ac30cdd8e7730d1ab115d3717190d
6
+ metadata.gz: e6a1b14be156b22c42345512735e242a58b1b4ea38354e9b0550c1cab88d4c52d3a8b3efacbefbbe010f983fdaaf7536351efb394390604db58566086c085d98
7
+ data.tar.gz: 3b781ef6f0ce74100687d61e04a425a6477629f1ad1cf65f2f476a80629eddef4a32cbed834d5ef0012addd5f1dcc1dd0652aafeda8280f2e281aac6ecd958dc
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- paperwork (0.3.0)
4
+ paperwork (0.3.1)
5
5
  rake (~> 12.3)
6
6
  redcarpet (~> 3.5.0)
7
7
  thor (~> 1.1.0)
data/lib/paperwork/cli.rb CHANGED
@@ -1,8 +1,16 @@
1
- require "yaml"
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
- "creates documentation as defined in #{CONFIG_FILE} and writes it to '#{Paperwork::Config[:build_root]}/<name>/build'"
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
- "removes previous builds and creates documentation as defined in #{CONFIG_FILE} and writes it to '#{Paperwork::Config[:build_root]}/<name>/build'"
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
- def setup_config
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
- ) unless File.exist?(CONFIG_FILE)
60
+ )
61
+ end
42
62
 
43
- yaml = YAML.load_file(CONFIG_FILE)
44
- self.config = yaml["config"]
45
- self.config["sources"] << CONFIG_FILE
63
+ yaml = YAML.load_file(CONFIG_FILE)
64
+ self.config = yaml["config"]
65
+ self.config["sources"] << CONFIG_FILE
46
66
 
47
- raise Exception.new(
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
- def setup_tasks
53
- paperwork self.config["name"], sources: self.config["sources"]
54
- end
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
- def invoke_tasks(target)
57
- Rake::Task["paperwork:#{self.config["name"]}:set_verbose"].invoke if options[:verbose]
58
- Rake::Task["paperwork:#{self.config["name"]}:#{target}"].invoke
59
- end
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Paperwork
4
- VERSION = "0.3.0"
4
+ VERSION = "0.3.1"
5
5
  end
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.0
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__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here