tocer 2.2.0 → 3.0.0

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
  SHA1:
3
- metadata.gz: 6d6f4de19e4a6403124960e9d375e198fa9daf06
4
- data.tar.gz: e3464b89eea4e39e59dcdd0ade592a4b844360e3
3
+ metadata.gz: 727187d06635e33cd5d52ac35f6b6d775e915c27
4
+ data.tar.gz: 5e9313b42ed79689c2575973824cdd28ff635662
5
5
  SHA512:
6
- metadata.gz: e7f9f7a37e026ead4ae41befac1fdf90bc816b8de15c54bdad195c731ca61331f8619ed2a19cf318b8b0a170ce79e7b767792434be7c51733df65258b92afc51
7
- data.tar.gz: 0fb4dd79a0a936951e58be3fa261f881223bb0770e89d26531539ec2a8136bd6b5294672b3989d6981a6970ca7ea7cb99348c7968fa6edb54dc3bdfd23084bcb
6
+ metadata.gz: 531d047a34322b8daed515e027fa55da5a5390619205d0965e9ed3b07a67e705f971362e8587e86a9b0c9ae3874b604cd4b95ac5135b22fccee94cd1aa274b36
7
+ data.tar.gz: 53e5d231311308b2c938746b57395368cfb53aab723cbb0fbb970b8f23cb80aeae159fa0077f12a79beca7dfe4cdd2fb34052fe433c85ac0d4e497f57e89a1a1
Binary file
data.tar.gz.sig CHANGED
Binary file
data/README.md CHANGED
@@ -7,7 +7,8 @@
7
7
  [![Travis CI Status](https://secure.travis-ci.org/bkuhlmann/tocer.svg)](https://travis-ci.org/bkuhlmann/tocer)
8
8
  [![Patreon](https://img.shields.io/badge/patreon-donate-brightgreen.svg)](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 Markdown files.
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 while
53
- allowing the installation of unsigned dependencies since they are beyond the scope of this gem.
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 -e, [--edit] # Edit gem settings in default editor.
66
- tocer -g, [--generate=GENERATE] # Generate table of contents.
67
- tocer -h, [--help=HELP] # Show this message or get help for a command.
68
- tocer -v, [--version] # Show gem 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 will prepend the above
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 existing table of
81
- contents has become stale, or placement of the table of contents has changed you can re-run Tocer on that file to auto-
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 determined in the
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 the weakest of all
93
- but great for situations where custom settings should be applied to *all* projects.
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 and/or bug fixes.
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 participating in this project
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 the [LICENSE](LICENSE.md) for details.
132
+ Read [LICENSE](LICENSE.md) for details.
130
133
 
131
134
  # History
132
135
 
133
- Read the [CHANGELOG](CHANGELOG.md) for details.
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 [Alchemists](https://www.alchemists.io).
141
+ Developed by [Brooke Kuhlmann](https://www.alchemists.io) at
142
+ [Alchemists](https://www.alchemists.io).
data/bin/tocer CHANGED
@@ -1,4 +1,5 @@
1
- #!/usr/bin/ruby
1
+ #! /usr/bin/ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require "tocer"
4
5
  require "tocer/cli"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  begin
2
4
  require "rspec/core/rake_task"
3
5
  RSpec::Core::RakeTask.new(:spec)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  begin
2
4
  require "rubocop/rake_task"
3
5
  RuboCop::RakeTask.new
@@ -5,6 +5,5 @@ require "tocer/parsers/header"
5
5
  require "tocer/transformers/link"
6
6
  require "tocer/transformers/text"
7
7
  require "tocer/builder"
8
- require "tocer/configuration"
9
8
  require "tocer/identity"
10
9
  require "tocer/writer"
@@ -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
- case
34
- when header =~ /\[.+\]\(.+\)/
35
- Transformers::Link.new header
36
- else
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
 
@@ -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=GENERATE]", "Generate table of contents."
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: "# Table of Contents"
24
- def generate file_path
25
- update_configuration! options
26
- Writer.new(file_path, label: configuration.label).write
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 "-e, [--edit]", "Edit gem settings in default editor."
31
- map %w[-e --edit] => :edit
32
- def edit
33
- resource_file = File.join ENV["HOME"], Tocer::Identity.file_name
34
- info "Editing: #{resource_file}..."
35
- `#{editor} #{resource_file}`
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=HELP]", "Show this message or get help for a command."
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 update_configuration! options
55
- return if options[:label] == "# Table of Contents"
56
- configuration.label = options[:label]
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
@@ -12,7 +12,7 @@ module Tocer
12
12
  end
13
13
 
14
14
  def self.version
15
- "2.2.0"
15
+ "3.0.0"
16
16
  end
17
17
 
18
18
  def self.version_label
@@ -1,12 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "refinements/array_extensions"
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::ArrayExtensions
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/array_extensions"
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::ArrayExtensions
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: 2.2.0
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
- aW8wHhcNMTUwNzA1MTQ1MzExWhcNMTYwNzA0MTQ1MzExWjBBMQ8wDQYDVQQDDAZi
15
+ aW8wHhcNMTYxMDE5MTY0NDEzWhcNMTcxMDE5MTY0NDEzWjBBMQ8wDQYDVQQDDAZi
16
16
  cm9va2UxGjAYBgoJkiaJk/IsZAEZFgphbGNoZW1pc3RzMRIwEAYKCZImiZPyLGQB
17
- GRYCaW8wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCzhOVcvLGBCceM
18
- PppVpJLUKsnskWzc1VqBXmv30feKNw+MOxMQaDsIP421qwqGO/2JHY60Kuobssk+
19
- 8/wqZkVFF/FFKxoQjuhlhc+VWLm8jWgXd4N1kwO2yytscQTzxc5qXarwA+36fqVH
20
- RhBAHhjka+HdBI+6o3CXRHJoC47iav+QpR7u/wYl3gNq6MJO3MmTKqHegEDLjRN0
21
- FJAr3bRAwq03ZtTuAVA2bdKLGThehe1RRRtJHJ/PHpmL2c203/GTXYtG6C8ILZIp
22
- ZroTqQ8yglCJ+3hSOmodZqSAQ0Rj7GJgtuNH81qlSrHu5sTvoZjGmEqSIhvsSJ80
23
- wKoPdZnFAgMBAAGjezB5MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQW
24
- BBSUnF478a5lB4xuOBiktJdMJv6JmDAfBgNVHREEGDAWgRRicm9va2VAYWxjaGVt
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
- 9w0BAQUFAAOCAQEAT7KtBXWsq1KA7NOSMeFEDeSvhrgdLwCG/37pIu0rjvx9iAW4
27
- gncxV0MccqIUtaF+lekjlXkIO+rXAVjvdha23KtpFTW90dYXp4NLPnPlSdyvYzJy
28
- FIAaWGvujOT8xEu4umd45q5aepE8li4bR071i5Z7F0trKNVYYrxjQFmH5SSKYRT/
29
- fXtICtAh1de3z3SOSK58IMPwjuoApYBxiqlmx0Uhla7mrzCE5+NmLPit3hLH6JFK
30
- aSif+qBc6oHD7EQWPF5cZkzkIURuwNwPBngZGxIKaMAgRhjGFXzUMAaq++r59cS9
31
- xTfQ4k6fglKEgpnLAXiKdo2c8Ym+X4rIKFfedQ==
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-04-24 00:00:00.000000000 Z
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: '3.0'
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: '3.0'
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: '2.2'
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: '2.2'
76
+ version: '3.0'
77
77
  - !ruby/object:Gem::Dependency
78
- name: rake
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: :development
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: gemsmith
92
+ name: rake
93
93
  requirement: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - "~>"
96
96
  - !ruby/object:Gem::Version
97
- version: '7.0'
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: '7.0'
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: '0'
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: '0'
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: '0'
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: '0'
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: '0'
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: '0'
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: '0'
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: '0'
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: A command line interface for generating table of contents for Markdown
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.3
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
@@ -1,7 +0,0 @@
1
- desc "Open IRB console for gem development environment"
2
- task :console do
3
- require "irb"
4
- require "tocer"
5
- ARGV.clear
6
- IRB.start
7
- end
@@ -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