tocer 2.2.0 → 3.0.0
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
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/README.md +27 -23
- data/bin/tocer +2 -1
- data/lib/tasks/rspec.rake +2 -0
- data/lib/tasks/rubocop.rake +2 -0
- data/lib/tocer.rb +0 -1
- data/lib/tocer/builder.rb +4 -5
- data/lib/tocer/cli.rb +24 -17
- data/lib/tocer/identity.rb +1 -1
- data/lib/tocer/transformers/link.rb +2 -2
- data/lib/tocer/transformers/text.rb +2 -2
- metadata +80 -167
- metadata.gz.sig +0 -0
- data/lib/tasks/console.rake +0 -7
- data/lib/tocer/configuration.rb +0 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 727187d06635e33cd5d52ac35f6b6d775e915c27
|
4
|
+
data.tar.gz: 5e9313b42ed79689c2575973824cdd28ff635662
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 531d047a34322b8daed515e027fa55da5a5390619205d0965e9ed3b07a67e705f971362e8587e86a9b0c9ae3874b604cd4b95ac5135b22fccee94cd1aa274b36
|
7
|
+
data.tar.gz: 53e5d231311308b2c938746b57395368cfb53aab723cbb0fbb970b8f23cb80aeae159fa0077f12a79beca7dfe4cdd2fb34052fe433c85ac0d4e497f57e89a1a1
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/README.md
CHANGED
@@ -7,7 +7,8 @@
|
|
7
7
|
[](https://travis-ci.org/bkuhlmann/tocer)
|
8
8
|
[](https://www.patreon.com/bkuhlmann)
|
9
9
|
|
10
|
-
Tocer (a.k.a. Table of Contenter) is command line interface for generating table of contents for
|
10
|
+
Tocer (a.k.a. Table of Contenter) is command line interface for generating table of contents for
|
11
|
+
Markdown files.
|
11
12
|
|
12
13
|
<!-- Tocer[start]: Auto-generated, don't remove. -->
|
13
14
|
|
@@ -49,8 +50,9 @@ For a secure install, type the following (recommended):
|
|
49
50
|
gem cert --add <(curl --location --silent https://www.alchemists.io/gem-public.pem)
|
50
51
|
gem install tocer --trust-policy MediumSecurity
|
51
52
|
|
52
|
-
NOTE: A HighSecurity trust policy would be best but MediumSecurity enables signed gem verification
|
53
|
-
allowing the installation of unsigned dependencies since they are beyond the scope of this
|
53
|
+
NOTE: A HighSecurity trust policy would be best but MediumSecurity enables signed gem verification
|
54
|
+
while allowing the installation of unsigned dependencies since they are beyond the scope of this
|
55
|
+
gem.
|
54
56
|
|
55
57
|
For an insecure install, type the following (not recommended):
|
56
58
|
|
@@ -62,10 +64,10 @@ For an insecure install, type the following (not recommended):
|
|
62
64
|
|
63
65
|
From the command line, type: `tocer help`
|
64
66
|
|
65
|
-
tocer -
|
66
|
-
tocer -g, [--generate=
|
67
|
-
tocer -h, [--help=
|
68
|
-
tocer -v, [--version]
|
67
|
+
tocer -c, [--config] # Manage gem configuration.
|
68
|
+
tocer -g, [--generate=PATH] # Generate table of contents.
|
69
|
+
tocer -h, [--help=COMMAND] # Show this message or get help for a command.
|
70
|
+
tocer -v, [--version] # Show gem version.
|
69
71
|
|
70
72
|
To add Tocer support, add the following at the correct position within your Markdown files:
|
71
73
|
|
@@ -74,23 +76,24 @@ To add Tocer support, add the following at the correct position within your Mark
|
|
74
76
|
<!-- Tocer[finish] -->
|
75
77
|
```
|
76
78
|
|
77
|
-
Alternatively, you can run `tocer -g <file_path>` on a file that does not have Tocer support and it
|
78
|
-
to your file, complete with an auto-generated table of contents.
|
79
|
+
Alternatively, you can run `tocer -g <file_path>` on a file that does not have Tocer support and it
|
80
|
+
will prepend the above to your file, complete with an auto-generated table of contents.
|
79
81
|
|
80
|
-
In the case that Tocer has already auto-generated a table of contents for a Markdown file, the
|
81
|
-
contents has become stale, or placement of the table of contents has changed you
|
82
|
-
update it with new table of contents.
|
82
|
+
In the case that Tocer has already auto-generated a table of contents for a Markdown file, the
|
83
|
+
existing table of contents has become stale, or placement of the table of contents has changed you
|
84
|
+
can re-run Tocer on that file to auto-update it with new table of contents.
|
83
85
|
|
84
86
|
## Customization
|
85
87
|
|
86
|
-
If desired, this gem supports global customization via the `~/.tocerrc` file. Order of precedence is
|
87
|
-
following order (with the last one taking top priority):
|
88
|
+
If desired, this gem supports global customization via the `~/.tocerrc` file. Order of precedence is
|
89
|
+
determined in the following order (with the last one taking top priority):
|
88
90
|
|
89
91
|
0. Global `~/.tocerrc`.
|
90
92
|
0. CLI option. Example: `tocer --generate README.md --label "Custom Label"`
|
91
93
|
|
92
|
-
Any setting provided to the CLI during runtime would trump the global setting. The global setting is
|
93
|
-
but great for situations where custom settings should be applied to *all*
|
94
|
+
Any setting provided to the CLI during runtime would trump the global setting. The global setting is
|
95
|
+
the weakest of all but great for situations where custom settings should be applied to *all*
|
96
|
+
projects.
|
94
97
|
|
95
98
|
The `~/.tocerrc` uses the following default settings:
|
96
99
|
|
@@ -110,14 +113,14 @@ To test, run:
|
|
110
113
|
|
111
114
|
Read [Semantic Versioning](http://semver.org) for details. Briefly, it means:
|
112
115
|
|
113
|
-
- Patch (x.y.Z) - Incremented for small, backwards compatible bug fixes.
|
114
|
-
- Minor (x.Y.z) - Incremented for new, backwards compatible public API enhancements
|
116
|
+
- Patch (x.y.Z) - Incremented for small, backwards compatible, bug fixes.
|
117
|
+
- Minor (x.Y.z) - Incremented for new, backwards compatible, public API enhancements/fixes.
|
115
118
|
- Major (X.y.z) - Incremented for any backwards incompatible public API changes.
|
116
119
|
|
117
120
|
# Code of Conduct
|
118
121
|
|
119
|
-
Please note that this project is released with a [CODE OF CONDUCT](CODE_OF_CONDUCT.md). By
|
120
|
-
you agree to abide by its terms.
|
122
|
+
Please note that this project is released with a [CODE OF CONDUCT](CODE_OF_CONDUCT.md). By
|
123
|
+
participating in this project you agree to abide by its terms.
|
121
124
|
|
122
125
|
# Contributions
|
123
126
|
|
@@ -126,13 +129,14 @@ Read [CONTRIBUTING](CONTRIBUTING.md) for details.
|
|
126
129
|
# License
|
127
130
|
|
128
131
|
Copyright (c) 2015 [Alchemists](https://www.alchemists.io).
|
129
|
-
Read
|
132
|
+
Read [LICENSE](LICENSE.md) for details.
|
130
133
|
|
131
134
|
# History
|
132
135
|
|
133
|
-
Read
|
136
|
+
Read [CHANGES](CHANGES.md) for details.
|
134
137
|
Built with [Gemsmith](https://github.com/bkuhlmann/gemsmith).
|
135
138
|
|
136
139
|
# Credits
|
137
140
|
|
138
|
-
Developed by [Brooke Kuhlmann](https://www.alchemists.io) at
|
141
|
+
Developed by [Brooke Kuhlmann](https://www.alchemists.io) at
|
142
|
+
[Alchemists](https://www.alchemists.io).
|
data/bin/tocer
CHANGED
data/lib/tasks/rspec.rake
CHANGED
data/lib/tasks/rubocop.rake
CHANGED
data/lib/tocer.rb
CHANGED
data/lib/tocer/builder.rb
CHANGED
@@ -30,11 +30,10 @@ module Tocer
|
|
30
30
|
attr_reader :lines, :label, :comment_block, :url_count
|
31
31
|
|
32
32
|
def acquire_transfomer header
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
Transformers::Text.new header
|
33
|
+
if header =~ /\[.+\]\(.+\)/
|
34
|
+
Transformers::Link.new header
|
35
|
+
else
|
36
|
+
Transformers::Text.new header
|
38
37
|
end
|
39
38
|
end
|
40
39
|
|
data/lib/tocer/cli.rb
CHANGED
@@ -4,6 +4,7 @@ require "yaml"
|
|
4
4
|
require "thor"
|
5
5
|
require "thor/actions"
|
6
6
|
require "thor_plus/actions"
|
7
|
+
require "runcom"
|
7
8
|
|
8
9
|
module Tocer
|
9
10
|
# The Command Line Interface (CLI) for the gem.
|
@@ -13,26 +14,32 @@ module Tocer
|
|
13
14
|
|
14
15
|
package_name Tocer::Identity.version_label
|
15
16
|
|
17
|
+
def self.defaults
|
18
|
+
{label: "# Table of Contents"}
|
19
|
+
end
|
20
|
+
|
16
21
|
def initialize args = [], options = {}, config = {}
|
17
22
|
super args, options, config
|
18
|
-
@configuration = Configuration.new
|
23
|
+
@configuration = Runcom::Configuration.new file_name: Tocer::Identity.file_name, defaults: self.class.defaults
|
19
24
|
end
|
20
25
|
|
21
|
-
desc "-g, [--generate=
|
26
|
+
desc "-g, [--generate=PATH]", "Generate table of contents."
|
22
27
|
map %w[-g --generate] => :generate
|
23
|
-
method_option :label, aliases: "-l", desc: "Custom label", type: :string, default:
|
24
|
-
def generate
|
25
|
-
|
26
|
-
|
27
|
-
say "Generated table of contents: #{file_path}."
|
28
|
+
method_option :label, aliases: "-l", desc: "Custom label", type: :string, default: defaults.fetch(:label)
|
29
|
+
def generate path
|
30
|
+
Writer.new(path, label: compute_label(options[:label])).write
|
31
|
+
say "Generated table of contents: #{path}."
|
28
32
|
end
|
29
33
|
|
30
|
-
desc "-
|
31
|
-
map %w[-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
`#{editor} #{
|
34
|
+
desc "-c, [--config]", "Manage gem configuration."
|
35
|
+
map %w[-c --config] => :config
|
36
|
+
method_option :edit, aliases: "-e", desc: "Edit gem configuration.", type: :boolean, default: false
|
37
|
+
method_option :info, aliases: "-i", desc: "Print gem configuration info.", type: :boolean, default: false
|
38
|
+
def config
|
39
|
+
if options.edit? then `#{editor} #{configuration.computed_path}`
|
40
|
+
elsif options.info? then say("Using: #{configuration.computed_path}.")
|
41
|
+
else help(:config)
|
42
|
+
end
|
36
43
|
end
|
37
44
|
|
38
45
|
desc "-v, [--version]", "Show gem version."
|
@@ -41,7 +48,7 @@ module Tocer
|
|
41
48
|
say Tocer::Identity.version_label
|
42
49
|
end
|
43
50
|
|
44
|
-
desc "-h, [--help=
|
51
|
+
desc "-h, [--help=COMMAND]", "Show this message or get help for a command."
|
45
52
|
map %w[-h --help] => :help
|
46
53
|
def help task = nil
|
47
54
|
say and super
|
@@ -51,9 +58,9 @@ module Tocer
|
|
51
58
|
|
52
59
|
attr_reader :configuration
|
53
60
|
|
54
|
-
def
|
55
|
-
|
56
|
-
|
61
|
+
def compute_label label
|
62
|
+
configured_label = configuration.to_h.fetch :label
|
63
|
+
label == self.class.defaults.fetch(:label) ? configured_label : label
|
57
64
|
end
|
58
65
|
end
|
59
66
|
end
|
data/lib/tocer/identity.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "refinements/
|
3
|
+
require "refinements/arrays"
|
4
4
|
|
5
5
|
module Tocer
|
6
6
|
module Transformers
|
7
7
|
# Transforms a Markdown header (embedded link) into a table of contents link.
|
8
8
|
class Link
|
9
|
-
using Refinements::
|
9
|
+
using Refinements::Arrays
|
10
10
|
|
11
11
|
def initialize text, header: Parsers::Header
|
12
12
|
@header = header.new text
|
@@ -1,12 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "refinements/
|
3
|
+
require "refinements/arrays"
|
4
4
|
|
5
5
|
module Tocer
|
6
6
|
module Transformers
|
7
7
|
# Transforms a Markdown header (plain text) into a table of contents link.
|
8
8
|
class Text
|
9
|
-
using Refinements::
|
9
|
+
using Refinements::Arrays
|
10
10
|
|
11
11
|
def initialize text, header: Parsers::Header
|
12
12
|
@header = header.new text
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tocer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
@@ -12,25 +12,25 @@ cert_chain:
|
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
13
|
MIIDeDCCAmCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBBMQ8wDQYDVQQDDAZicm9v
|
14
14
|
a2UxGjAYBgoJkiaJk/IsZAEZFgphbGNoZW1pc3RzMRIwEAYKCZImiZPyLGQBGRYC
|
15
|
-
|
15
|
+
aW8wHhcNMTYxMDE5MTY0NDEzWhcNMTcxMDE5MTY0NDEzWjBBMQ8wDQYDVQQDDAZi
|
16
16
|
cm9va2UxGjAYBgoJkiaJk/IsZAEZFgphbGNoZW1pc3RzMRIwEAYKCZImiZPyLGQB
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
17
|
+
GRYCaW8wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCgryPL4/IbWDcL
|
18
|
+
fnqpnoJALqj+ega7hSsvvD8sac57HPNLeKcOmSafFiQLAnTmmE132ZlFc8kyZRVn
|
19
|
+
zmqSESowO5jd+ggFuy1ySqQJXhwgik04KedKRUjpIDZePrjw+M5UJT1qzKCKL2xI
|
20
|
+
nx5cOKP1fSWJ1RRu8JhaDeSloGtYMdw2c28wnKPNIsWDood4xhbLcY9IqeISft2e
|
21
|
+
oTAHTHandHbvt24X3/n67ceNjLBbsVZPXCC1C8C8ccjHjA4Tm2uiFoDwThMcPggg
|
22
|
+
90H6fh0vLFcNAobdPEchbge8tWtfmMPz2+C4yklANn81GA+ANsBS1uwx6mxJoMQU
|
23
|
+
BNVp0aLvAgMBAAGjezB5MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQW
|
24
|
+
BBRS85Rn1BaqeIONByw4t46DMDMzHDAfBgNVHREEGDAWgRRicm9va2VAYWxjaGVt
|
25
25
|
aXN0cy5pbzAfBgNVHRIEGDAWgRRicm9va2VAYWxjaGVtaXN0cy5pbzANBgkqhkiG
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
26
|
+
9w0BAQUFAAOCAQEAZMb57Y4wdpbX8XxTukEO7VC1pndccUsxdbziGsAOiuHET3Aq
|
27
|
+
ygLvrfdYrN88/w+qxncW5bxbO3a6UGkuhIFUPM8zRSE/rh6bCcJljTJrExVt42eV
|
28
|
+
aYCb7WJNsx3eNXHn3uQodq3tD+lmNJzz2bFeT3smGSKEnALBjqorO/2mpDh4FJ3S
|
29
|
+
4CcDYsJ1ywep8LDJDBBGdKz9moL+axryzpeTpgTT/fFYFzRzWrURPyDvPOikh9TX
|
30
|
+
n/LUZ1dKhIHzfKx1B4+TEIefArObGfkLIDM8+Dq1RX7TF1k81Men7iu4MgE9bYBn
|
31
|
+
3dE+xI3FdB5gWcdWxdtgRCmWjtXeYYyb4z6NQQ==
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2016-
|
33
|
+
date: 2016-11-05 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: thor
|
@@ -52,310 +52,225 @@ dependencies:
|
|
52
52
|
requirements:
|
53
53
|
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: '
|
55
|
+
version: '4.0'
|
56
56
|
type: :runtime
|
57
57
|
prerelease: false
|
58
58
|
version_requirements: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
60
|
- - "~>"
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: '
|
62
|
+
version: '4.0'
|
63
63
|
- !ruby/object:Gem::Dependency
|
64
64
|
name: refinements
|
65
65
|
requirement: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
67
|
- - "~>"
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: '
|
69
|
+
version: '3.0'
|
70
70
|
type: :runtime
|
71
71
|
prerelease: false
|
72
72
|
version_requirements: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
74
|
- - "~>"
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version: '
|
76
|
+
version: '3.0'
|
77
77
|
- !ruby/object:Gem::Dependency
|
78
|
-
name:
|
78
|
+
name: runcom
|
79
79
|
requirement: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
|
-
- - "
|
81
|
+
- - "~>"
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version: '0'
|
84
|
-
type: :
|
83
|
+
version: '0.2'
|
84
|
+
type: :runtime
|
85
85
|
prerelease: false
|
86
86
|
version_requirements: !ruby/object:Gem::Requirement
|
87
87
|
requirements:
|
88
|
-
- - "
|
88
|
+
- - "~>"
|
89
89
|
- !ruby/object:Gem::Version
|
90
|
-
version: '0'
|
90
|
+
version: '0.2'
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
|
-
name:
|
92
|
+
name: rake
|
93
93
|
requirement: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
95
|
- - "~>"
|
96
96
|
- !ruby/object:Gem::Version
|
97
|
-
version: '
|
97
|
+
version: '11.0'
|
98
98
|
type: :development
|
99
99
|
prerelease: false
|
100
100
|
version_requirements: !ruby/object:Gem::Requirement
|
101
101
|
requirements:
|
102
102
|
- - "~>"
|
103
103
|
- !ruby/object:Gem::Version
|
104
|
-
version: '
|
104
|
+
version: '11.0'
|
105
105
|
- !ruby/object:Gem::Dependency
|
106
106
|
name: pry
|
107
107
|
requirement: !ruby/object:Gem::Requirement
|
108
108
|
requirements:
|
109
|
-
- - "
|
109
|
+
- - "~>"
|
110
110
|
- !ruby/object:Gem::Version
|
111
|
-
version: '0'
|
111
|
+
version: '0.10'
|
112
112
|
type: :development
|
113
113
|
prerelease: false
|
114
114
|
version_requirements: !ruby/object:Gem::Requirement
|
115
115
|
requirements:
|
116
|
-
- - "
|
116
|
+
- - "~>"
|
117
117
|
- !ruby/object:Gem::Version
|
118
|
-
version: '0'
|
118
|
+
version: '0.10'
|
119
119
|
- !ruby/object:Gem::Dependency
|
120
120
|
name: pry-byebug
|
121
121
|
requirement: !ruby/object:Gem::Requirement
|
122
122
|
requirements:
|
123
|
-
- - "
|
124
|
-
- !ruby/object:Gem::Version
|
125
|
-
version: '0'
|
126
|
-
type: :development
|
127
|
-
prerelease: false
|
128
|
-
version_requirements: !ruby/object:Gem::Requirement
|
129
|
-
requirements:
|
130
|
-
- - ">="
|
131
|
-
- !ruby/object:Gem::Version
|
132
|
-
version: '0'
|
133
|
-
- !ruby/object:Gem::Dependency
|
134
|
-
name: pry-remote
|
135
|
-
requirement: !ruby/object:Gem::Requirement
|
136
|
-
requirements:
|
137
|
-
- - ">="
|
123
|
+
- - "~>"
|
138
124
|
- !ruby/object:Gem::Version
|
139
|
-
version: '
|
125
|
+
version: '3.4'
|
140
126
|
type: :development
|
141
127
|
prerelease: false
|
142
128
|
version_requirements: !ruby/object:Gem::Requirement
|
143
129
|
requirements:
|
144
|
-
- - "
|
130
|
+
- - "~>"
|
145
131
|
- !ruby/object:Gem::Version
|
146
|
-
version: '
|
132
|
+
version: '3.4'
|
147
133
|
- !ruby/object:Gem::Dependency
|
148
134
|
name: pry-state
|
149
135
|
requirement: !ruby/object:Gem::Requirement
|
150
136
|
requirements:
|
151
|
-
- - "
|
152
|
-
- !ruby/object:Gem::Version
|
153
|
-
version: '0'
|
154
|
-
type: :development
|
155
|
-
prerelease: false
|
156
|
-
version_requirements: !ruby/object:Gem::Requirement
|
157
|
-
requirements:
|
158
|
-
- - ">="
|
159
|
-
- !ruby/object:Gem::Version
|
160
|
-
version: '0'
|
161
|
-
- !ruby/object:Gem::Dependency
|
162
|
-
name: pry-rescue
|
163
|
-
requirement: !ruby/object:Gem::Requirement
|
164
|
-
requirements:
|
165
|
-
- - ">="
|
166
|
-
- !ruby/object:Gem::Version
|
167
|
-
version: '0'
|
168
|
-
type: :development
|
169
|
-
prerelease: false
|
170
|
-
version_requirements: !ruby/object:Gem::Requirement
|
171
|
-
requirements:
|
172
|
-
- - ">="
|
173
|
-
- !ruby/object:Gem::Version
|
174
|
-
version: '0'
|
175
|
-
- !ruby/object:Gem::Dependency
|
176
|
-
name: pry-stack_explorer
|
177
|
-
requirement: !ruby/object:Gem::Requirement
|
178
|
-
requirements:
|
179
|
-
- - ">="
|
137
|
+
- - "~>"
|
180
138
|
- !ruby/object:Gem::Version
|
181
|
-
version: '0'
|
139
|
+
version: '0.1'
|
182
140
|
type: :development
|
183
141
|
prerelease: false
|
184
142
|
version_requirements: !ruby/object:Gem::Requirement
|
185
143
|
requirements:
|
186
|
-
- - "
|
144
|
+
- - "~>"
|
187
145
|
- !ruby/object:Gem::Version
|
188
|
-
version: '0'
|
146
|
+
version: '0.1'
|
189
147
|
- !ruby/object:Gem::Dependency
|
190
148
|
name: bond
|
191
149
|
requirement: !ruby/object:Gem::Requirement
|
192
150
|
requirements:
|
193
|
-
- - "
|
151
|
+
- - "~>"
|
194
152
|
- !ruby/object:Gem::Version
|
195
|
-
version: '0'
|
153
|
+
version: '0.5'
|
196
154
|
type: :development
|
197
155
|
prerelease: false
|
198
156
|
version_requirements: !ruby/object:Gem::Requirement
|
199
157
|
requirements:
|
200
|
-
- - "
|
158
|
+
- - "~>"
|
201
159
|
- !ruby/object:Gem::Version
|
202
|
-
version: '0'
|
160
|
+
version: '0.5'
|
203
161
|
- !ruby/object:Gem::Dependency
|
204
162
|
name: wirb
|
205
163
|
requirement: !ruby/object:Gem::Requirement
|
206
164
|
requirements:
|
207
|
-
- - "
|
165
|
+
- - "~>"
|
208
166
|
- !ruby/object:Gem::Version
|
209
|
-
version: '0'
|
167
|
+
version: '2.0'
|
210
168
|
type: :development
|
211
169
|
prerelease: false
|
212
170
|
version_requirements: !ruby/object:Gem::Requirement
|
213
171
|
requirements:
|
214
|
-
- - "
|
172
|
+
- - "~>"
|
215
173
|
- !ruby/object:Gem::Version
|
216
|
-
version: '0'
|
174
|
+
version: '2.0'
|
217
175
|
- !ruby/object:Gem::Dependency
|
218
176
|
name: hirb
|
219
177
|
requirement: !ruby/object:Gem::Requirement
|
220
178
|
requirements:
|
221
|
-
- - "
|
179
|
+
- - "~>"
|
222
180
|
- !ruby/object:Gem::Version
|
223
|
-
version: '0'
|
181
|
+
version: '0.7'
|
224
182
|
type: :development
|
225
183
|
prerelease: false
|
226
184
|
version_requirements: !ruby/object:Gem::Requirement
|
227
185
|
requirements:
|
228
|
-
- - "
|
186
|
+
- - "~>"
|
229
187
|
- !ruby/object:Gem::Version
|
230
|
-
version: '0'
|
188
|
+
version: '0.7'
|
231
189
|
- !ruby/object:Gem::Dependency
|
232
190
|
name: awesome_print
|
233
191
|
requirement: !ruby/object:Gem::Requirement
|
234
192
|
requirements:
|
235
|
-
- - "
|
193
|
+
- - "~>"
|
236
194
|
- !ruby/object:Gem::Version
|
237
|
-
version: '
|
195
|
+
version: '1.7'
|
238
196
|
type: :development
|
239
197
|
prerelease: false
|
240
198
|
version_requirements: !ruby/object:Gem::Requirement
|
241
199
|
requirements:
|
242
|
-
- - "
|
200
|
+
- - "~>"
|
243
201
|
- !ruby/object:Gem::Version
|
244
|
-
version: '
|
202
|
+
version: '1.7'
|
245
203
|
- !ruby/object:Gem::Dependency
|
246
204
|
name: rspec
|
247
205
|
requirement: !ruby/object:Gem::Requirement
|
248
206
|
requirements:
|
249
|
-
- - "
|
250
|
-
- !ruby/object:Gem::Version
|
251
|
-
version: '0'
|
252
|
-
type: :development
|
253
|
-
prerelease: false
|
254
|
-
version_requirements: !ruby/object:Gem::Requirement
|
255
|
-
requirements:
|
256
|
-
- - ">="
|
257
|
-
- !ruby/object:Gem::Version
|
258
|
-
version: '0'
|
259
|
-
- !ruby/object:Gem::Dependency
|
260
|
-
name: rb-fsevent
|
261
|
-
requirement: !ruby/object:Gem::Requirement
|
262
|
-
requirements:
|
263
|
-
- - ">="
|
207
|
+
- - "~>"
|
264
208
|
- !ruby/object:Gem::Version
|
265
|
-
version: '
|
209
|
+
version: '3.5'
|
266
210
|
type: :development
|
267
211
|
prerelease: false
|
268
212
|
version_requirements: !ruby/object:Gem::Requirement
|
269
213
|
requirements:
|
270
|
-
- - "
|
214
|
+
- - "~>"
|
271
215
|
- !ruby/object:Gem::Version
|
272
|
-
version: '
|
216
|
+
version: '3.5'
|
273
217
|
- !ruby/object:Gem::Dependency
|
274
218
|
name: guard-rspec
|
275
219
|
requirement: !ruby/object:Gem::Requirement
|
276
220
|
requirements:
|
277
|
-
- - "
|
278
|
-
- !ruby/object:Gem::Version
|
279
|
-
version: '0'
|
280
|
-
type: :development
|
281
|
-
prerelease: false
|
282
|
-
version_requirements: !ruby/object:Gem::Requirement
|
283
|
-
requirements:
|
284
|
-
- - ">="
|
285
|
-
- !ruby/object:Gem::Version
|
286
|
-
version: '0'
|
287
|
-
- !ruby/object:Gem::Dependency
|
288
|
-
name: terminal-notifier
|
289
|
-
requirement: !ruby/object:Gem::Requirement
|
290
|
-
requirements:
|
291
|
-
- - ">="
|
292
|
-
- !ruby/object:Gem::Version
|
293
|
-
version: '0'
|
294
|
-
type: :development
|
295
|
-
prerelease: false
|
296
|
-
version_requirements: !ruby/object:Gem::Requirement
|
297
|
-
requirements:
|
298
|
-
- - ">="
|
299
|
-
- !ruby/object:Gem::Version
|
300
|
-
version: '0'
|
301
|
-
- !ruby/object:Gem::Dependency
|
302
|
-
name: terminal-notifier-guard
|
303
|
-
requirement: !ruby/object:Gem::Requirement
|
304
|
-
requirements:
|
305
|
-
- - ">="
|
221
|
+
- - "~>"
|
306
222
|
- !ruby/object:Gem::Version
|
307
|
-
version: '
|
223
|
+
version: '4.7'
|
308
224
|
type: :development
|
309
225
|
prerelease: false
|
310
226
|
version_requirements: !ruby/object:Gem::Requirement
|
311
227
|
requirements:
|
312
|
-
- - "
|
228
|
+
- - "~>"
|
313
229
|
- !ruby/object:Gem::Version
|
314
|
-
version: '
|
230
|
+
version: '4.7'
|
315
231
|
- !ruby/object:Gem::Dependency
|
316
232
|
name: climate_control
|
317
233
|
requirement: !ruby/object:Gem::Requirement
|
318
234
|
requirements:
|
319
|
-
- - "
|
235
|
+
- - "~>"
|
320
236
|
- !ruby/object:Gem::Version
|
321
|
-
version: '0'
|
237
|
+
version: '0.0'
|
322
238
|
type: :development
|
323
239
|
prerelease: false
|
324
240
|
version_requirements: !ruby/object:Gem::Requirement
|
325
241
|
requirements:
|
326
|
-
- - "
|
242
|
+
- - "~>"
|
327
243
|
- !ruby/object:Gem::Version
|
328
|
-
version: '0'
|
244
|
+
version: '0.0'
|
329
245
|
- !ruby/object:Gem::Dependency
|
330
246
|
name: rubocop
|
331
247
|
requirement: !ruby/object:Gem::Requirement
|
332
248
|
requirements:
|
333
|
-
- - "
|
249
|
+
- - "~>"
|
334
250
|
- !ruby/object:Gem::Version
|
335
|
-
version: '0'
|
251
|
+
version: '0.45'
|
336
252
|
type: :development
|
337
253
|
prerelease: false
|
338
254
|
version_requirements: !ruby/object:Gem::Requirement
|
339
255
|
requirements:
|
340
|
-
- - "
|
256
|
+
- - "~>"
|
341
257
|
- !ruby/object:Gem::Version
|
342
|
-
version: '0'
|
258
|
+
version: '0.45'
|
343
259
|
- !ruby/object:Gem::Dependency
|
344
260
|
name: codeclimate-test-reporter
|
345
261
|
requirement: !ruby/object:Gem::Requirement
|
346
262
|
requirements:
|
347
|
-
- - "
|
263
|
+
- - "~>"
|
348
264
|
- !ruby/object:Gem::Version
|
349
|
-
version: '0'
|
265
|
+
version: '0.6'
|
350
266
|
type: :development
|
351
267
|
prerelease: false
|
352
268
|
version_requirements: !ruby/object:Gem::Requirement
|
353
269
|
requirements:
|
354
|
-
- - "
|
270
|
+
- - "~>"
|
355
271
|
- !ruby/object:Gem::Version
|
356
|
-
version: '0'
|
357
|
-
description:
|
358
|
-
files.
|
272
|
+
version: '0.6'
|
273
|
+
description:
|
359
274
|
email:
|
360
275
|
- brooke@alchemists.io
|
361
276
|
executables:
|
@@ -368,13 +283,11 @@ files:
|
|
368
283
|
- LICENSE.md
|
369
284
|
- README.md
|
370
285
|
- bin/tocer
|
371
|
-
- lib/tasks/console.rake
|
372
286
|
- lib/tasks/rspec.rake
|
373
287
|
- lib/tasks/rubocop.rake
|
374
288
|
- lib/tocer.rb
|
375
289
|
- lib/tocer/builder.rb
|
376
290
|
- lib/tocer/cli.rb
|
377
|
-
- lib/tocer/configuration.rb
|
378
291
|
- lib/tocer/elements/comment_block.rb
|
379
292
|
- lib/tocer/identity.rb
|
380
293
|
- lib/tocer/parsers/header.rb
|
@@ -401,7 +314,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
401
314
|
version: '0'
|
402
315
|
requirements: []
|
403
316
|
rubyforge_project:
|
404
|
-
rubygems_version: 2.6.
|
317
|
+
rubygems_version: 2.6.8
|
405
318
|
signing_key:
|
406
319
|
specification_version: 4
|
407
320
|
summary: A command line interface for generating table of contents for Markdown files.
|
metadata.gz.sig
CHANGED
Binary file
|
data/lib/tasks/console.rake
DELETED
data/lib/tocer/configuration.rb
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Tocer
|
4
|
-
# Default configuration for gem with support for custom settings.
|
5
|
-
class Configuration
|
6
|
-
attr_reader :file_path
|
7
|
-
attr_writer :label
|
8
|
-
|
9
|
-
def initialize file_path: File.join(ENV["HOME"], Identity.file_name)
|
10
|
-
@file_path = file_path
|
11
|
-
@settings = load_settings
|
12
|
-
end
|
13
|
-
|
14
|
-
def label
|
15
|
-
@label ||= settings.fetch(:label, "# Table of Contents")
|
16
|
-
end
|
17
|
-
|
18
|
-
private
|
19
|
-
|
20
|
-
attr_reader :settings
|
21
|
-
|
22
|
-
def load_settings
|
23
|
-
return {} unless File.exist?(file_path)
|
24
|
-
yaml = YAML.load_file file_path
|
25
|
-
yaml.is_a?(Hash) ? yaml : {}
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|