paperwork 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1955714ea9b28ec4ec30953e9bb6d9fdde843dc6b07b1e845250272e06d231ce
4
- data.tar.gz: f173804ede9bd1280bd724867b34aac75cae1d48e9ef13735e0ca5957185dcf3
3
+ metadata.gz: 151389aa8930969de29cb2e7969505d8c52f085ffc46cf43bb3168575acbb325
4
+ data.tar.gz: 8121a20fc3f36067e2273b9cf6ac92173b9ad84cf25f1579c7f20afe1e5bfaf3
5
5
  SHA512:
6
- metadata.gz: 2a5f3811fbbe9c7f8a48e120f83e4dad99a5e48ea15489d183a64d627f1ecdf210734e08f764c559298df7f832affc1e232e17f65cded172f59d9111a4ffc90f
7
- data.tar.gz: 0fbb45795dcfa953c0e9479e0a8c135e799a6fbb41f26cd59471d7e0a5a6fb083832bb6082d8881fc2f1368e302425209b7d6170b4ee98c537825f37cd28326f
6
+ metadata.gz: dd6ada05928138cb198175167a0b9cbb1148dcc875f9ccf3a12049eb759a60832dffd538de17c31d4138aa8d4bf6ef7f1cb9b26d23d863e8770e1044ebb572ef
7
+ data.tar.gz: ea9028ea7f182d5d98841dc6e01ebe75c6e45e6839389c4a4247219e3efd56648ac317985209cecc2c1a25fbf3f0466cf780025648ef3d1e7498ef119cf328c1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- paperwork (0.2.5)
4
+ paperwork (0.2.6)
5
5
  rake (~> 12.3)
6
6
  redcarpet (~> 3.5.0)
7
7
 
@@ -9,7 +9,7 @@ module Paperwork
9
9
  ##
10
10
  # main task generator for building the document
11
11
  #
12
- class Document < Paperwork::Tasks::Base
12
+ class Document < Paperwork::Tasks::Base # rubocop:disable Metrics/ClassLength
13
13
  attr_reader :dir
14
14
 
15
15
  include Rake::DSL
@@ -34,13 +34,13 @@ module Paperwork
34
34
 
35
35
  private
36
36
 
37
- def get_destination(dst_base, src) # rubocop:disable Metrics/AbcSize
37
+ def get_destination(dst_base, src) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
38
38
  nested_base = File.dirname(src)
39
- if nested_base == "."
40
- nested_base = dst_base
41
- else
42
- nested_base = File.join(dst_base, nested_base)
43
- end
39
+ nested_base = if nested_base == "."
40
+ dst_base
41
+ else
42
+ File.join(dst_base, nested_base)
43
+ end
44
44
 
45
45
  ext = File.extname(src)
46
46
  case ext
@@ -86,9 +86,9 @@ module Paperwork
86
86
  end
87
87
  end
88
88
 
89
- def tasks_nested # rubocop:disable Metrics/AbcSize
90
- namespace :paperwork do
91
- namespace self.name do
89
+ def tasks_nested # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
90
+ namespace :paperwork do # rubocop:disable Metrics/BlockLength
91
+ namespace self.name do # rubocop:disable Metrics/BlockLength
92
92
  task build: ["paperwork:#{self.name}"]
93
93
 
94
94
  desc "rebuild documentation from scratch for '#{self.name}'"
@@ -105,6 +105,31 @@ module Paperwork
105
105
  task :clean do
106
106
  rm_rf self.dir
107
107
  end
108
+
109
+ desc "start middleman server for editing documents and get visual feedback with live reload"
110
+ task server: :build do
111
+ Dir.chdir(self.dir) do
112
+ Bundler.with_unbundled_env do
113
+ Process.spawn(
114
+ "bundle exec middleman server",
115
+ out: :out,
116
+ in: :in,
117
+ err: :err
118
+ )
119
+ end
120
+ puts
121
+ puts "+---------------------------------------------------------------+"
122
+ puts "| |"
123
+ puts "| IMPORTANT: Edit documents in #{self.dir} for live reload! |"
124
+ puts "| ---------- The documents there are hard links to your |"
125
+ puts "| source files, so the changes will be there |"
126
+ puts "| as well. |"
127
+ puts "| |"
128
+ puts "+---------------------------------------------------------------+"
129
+ puts
130
+ Process.waitall
131
+ end
132
+ end
108
133
  end
109
134
  end
110
135
  end
@@ -85,7 +85,6 @@ module DocRenderer
85
85
  <<~IMG
86
86
  <img src="#{relative_link link, scope.current_path}" alt="#{alt_text}" class="img-fluid">#{title}</img>
87
87
  IMG
88
- #super(relative_link(link, scope.current_path), title, alt_text)
89
88
  end
90
89
 
91
90
  # def linebreak()
@@ -20,7 +20,7 @@ module InfoHelpers
20
20
  end
21
21
  end
22
22
 
23
- def relative_link(stringifyable, current_path=current_page.path)
23
+ def relative_link(stringifyable, current_path = current_page.path)
24
24
  relative = String.new
25
25
  dots = current_path.split(/[\/\\]/).size - 1
26
26
  dots.times{ relative += "../" }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Paperwork
4
- VERSION = "0.2.5"
4
+ VERSION = "0.2.6"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paperwork
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Schmid
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-19 00:00:00.000000000 Z
11
+ date: 2021-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug