tocer 3.0.0 → 3.1.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: 727187d06635e33cd5d52ac35f6b6d775e915c27
4
- data.tar.gz: 5e9313b42ed79689c2575973824cdd28ff635662
3
+ metadata.gz: 468f874390c280d7b2a29d1b39906cd8e36305c3
4
+ data.tar.gz: 424e6a2cce31d202954f4d55ec0bb9674a87cff5
5
5
  SHA512:
6
- metadata.gz: 531d047a34322b8daed515e027fa55da5a5390619205d0965e9ed3b07a67e705f971362e8587e86a9b0c9ae3874b604cd4b95ac5135b22fccee94cd1aa274b36
7
- data.tar.gz: 53e5d231311308b2c938746b57395368cfb53aab723cbb0fbb970b8f23cb80aeae159fa0077f12a79beca7dfe4cdd2fb34052fe433c85ac0d4e497f57e89a1a1
6
+ metadata.gz: 7cc0588ca937128f74c80543063fbf9b9c70f3b07d980327fd32fc06722adda6e7a24e1de0ce8661fcfcc0ae97ada0bb7e0c6520f5e12b455bb14c705af7d203
7
+ data.tar.gz: d903de0794a12beed0c5e5567d63d6b539f335b2ca11128cfa6e8a57479eb8e1c3e6e560b173b2b39b923d7ee4cf7126cd9e906137a0f5a115e271fb22efcb2c
@@ -1,4 +1,3 @@
1
- {�H2�NӒ�a�H*ʍdm�
2
- P���UHֲ~��oM)�s�<K�쉃4
3
- ә�8�0�%f#���ԇ����V'N9����(]K�J��g�-��C(81Z7�3m�h���P嬺$#�i����g�d#��"h��e�2�O������b�"*�n���;�K~��uf��
4
- '�l���\.
1
+ AD�h�Npq�@��W��[+!�u�{�����DX�N
2
+ �#�Ep��b���K��t�د%d�K�*��;�
5
3
  Ʒ�{_�&�š>7˓/T
4
+ y`IL��0���2?/\�F�L���8F�Z����
data.tar.gz.sig CHANGED
Binary file
data/bin/tocer CHANGED
@@ -1,4 +1,4 @@
1
- #! /usr/bin/ruby
1
+ #! /usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require "tocer"
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ begin
4
+ require "reek/rake/task"
5
+ Reek::Rake::Task.new
6
+ rescue LoadError => error
7
+ puts error.message
8
+ end
@@ -5,5 +5,6 @@ require "tocer/parsers/header"
5
5
  require "tocer/transformers/link"
6
6
  require "tocer/transformers/text"
7
7
  require "tocer/builder"
8
+ require "tocer/cli"
8
9
  require "tocer/identity"
9
10
  require "tocer/writer"
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "yaml"
4
3
  require "thor"
5
4
  require "thor/actions"
6
5
  require "thor_plus/actions"
@@ -12,32 +11,41 @@ module Tocer
12
11
  include Thor::Actions
13
12
  include ThorPlus::Actions
14
13
 
15
- package_name Tocer::Identity.version_label
14
+ package_name Identity.version_label
16
15
 
17
- def self.defaults
18
- {label: "# Table of Contents"}
16
+ def self.configuration
17
+ Runcom::Configuration.new file_name: Identity.file_name, defaults: {
18
+ label: "# Table of Contents"
19
+ }
19
20
  end
20
21
 
21
22
  def initialize args = [], options = {}, config = {}
22
23
  super args, options, config
23
- @configuration = Runcom::Configuration.new file_name: Tocer::Identity.file_name, defaults: self.class.defaults
24
24
  end
25
25
 
26
26
  desc "-g, [--generate=PATH]", "Generate table of contents."
27
27
  map %w[-g --generate] => :generate
28
- method_option :label, aliases: "-l", desc: "Custom label", type: :string, default: defaults.fetch(:label)
28
+ method_option :label, aliases: "-l", desc: "Label", type: :string, default: configuration.to_h.fetch(:label)
29
29
  def generate path
30
- Writer.new(path, label: compute_label(options[:label])).write
30
+ Writer.new(path, label: options.label).write
31
31
  say "Generated table of contents: #{path}."
32
32
  end
33
33
 
34
- desc "-c, [--config]", "Manage gem configuration."
34
+ desc "-c, [--config]", %(Manage gem configuration ("#{configuration.computed_path}").)
35
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
36
+ method_option :edit,
37
+ aliases: "-e",
38
+ desc: "Edit gem configuration.",
39
+ type: :boolean, default: false
40
+ method_option :info,
41
+ aliases: "-i",
42
+ desc: "Print gem configuration.",
43
+ type: :boolean, default: false
38
44
  def config
39
- if options.edit? then `#{editor} #{configuration.computed_path}`
40
- elsif options.info? then say("Using: #{configuration.computed_path}.")
45
+ path = self.class.configuration.computed_path
46
+
47
+ if options.edit? then `#{editor} #{path}`
48
+ elsif options.info? then say(path)
41
49
  else help(:config)
42
50
  end
43
51
  end
@@ -45,7 +53,7 @@ module Tocer
45
53
  desc "-v, [--version]", "Show gem version."
46
54
  map %w[-v --version] => :version
47
55
  def version
48
- say Tocer::Identity.version_label
56
+ say Identity.version_label
49
57
  end
50
58
 
51
59
  desc "-h, [--help=COMMAND]", "Show this message or get help for a command."
@@ -56,11 +64,9 @@ module Tocer
56
64
 
57
65
  private
58
66
 
59
- attr_reader :configuration
60
-
61
67
  def compute_label label
62
- configured_label = configuration.to_h.fetch :label
63
- label == self.class.defaults.fetch(:label) ? configured_label : label
68
+ configured_label = self.class.configuration.to_h.fetch :label
69
+ label == configured_label ? label : configured_label
64
70
  end
65
71
  end
66
72
  end
@@ -12,7 +12,7 @@ module Tocer
12
12
  end
13
13
 
14
14
  def self.version
15
- "3.0.0"
15
+ "3.1.0"
16
16
  end
17
17
 
18
18
  def self.version_label
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: 3.0.0
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -30,7 +30,7 @@ cert_chain:
30
30
  n/LUZ1dKhIHzfKx1B4+TEIefArObGfkLIDM8+Dq1RX7TF1k81Men7iu4MgE9bYBn
31
31
  3dE+xI3FdB5gWcdWxdtgRCmWjtXeYYyb4z6NQQ==
32
32
  -----END CERTIFICATE-----
33
- date: 2016-11-05 00:00:00.000000000 Z
33
+ date: 2016-11-13 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: thor
@@ -52,42 +52,42 @@ dependencies:
52
52
  requirements:
53
53
  - - "~>"
54
54
  - !ruby/object:Gem::Version
55
- version: '4.0'
55
+ version: '4.1'
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: '4.0'
62
+ version: '4.1'
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: '3.0'
69
+ version: '3.1'
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: '3.0'
76
+ version: '3.1'
77
77
  - !ruby/object:Gem::Dependency
78
78
  name: runcom
79
79
  requirement: !ruby/object:Gem::Requirement
80
80
  requirements:
81
81
  - - "~>"
82
82
  - !ruby/object:Gem::Version
83
- version: '0.2'
83
+ version: '0.3'
84
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.2'
90
+ version: '0.3'
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: rake
93
93
  requirement: !ruby/object:Gem::Requirement
@@ -102,6 +102,20 @@ dependencies:
102
102
  - - "~>"
103
103
  - !ruby/object:Gem::Version
104
104
  version: '11.0'
105
+ - !ruby/object:Gem::Dependency
106
+ name: gemsmith
107
+ requirement: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - "~>"
110
+ - !ruby/object:Gem::Version
111
+ version: '8.0'
112
+ type: :development
113
+ prerelease: false
114
+ version_requirements: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - "~>"
117
+ - !ruby/object:Gem::Version
118
+ version: '8.0'
105
119
  - !ruby/object:Gem::Dependency
106
120
  name: pry
107
121
  requirement: !ruby/object:Gem::Requirement
@@ -242,6 +256,20 @@ dependencies:
242
256
  - - "~>"
243
257
  - !ruby/object:Gem::Version
244
258
  version: '0.0'
259
+ - !ruby/object:Gem::Dependency
260
+ name: reek
261
+ requirement: !ruby/object:Gem::Requirement
262
+ requirements:
263
+ - - "~>"
264
+ - !ruby/object:Gem::Version
265
+ version: '4.5'
266
+ type: :development
267
+ prerelease: false
268
+ version_requirements: !ruby/object:Gem::Requirement
269
+ requirements:
270
+ - - "~>"
271
+ - !ruby/object:Gem::Version
272
+ version: '4.5'
245
273
  - !ruby/object:Gem::Dependency
246
274
  name: rubocop
247
275
  requirement: !ruby/object:Gem::Requirement
@@ -262,14 +290,14 @@ dependencies:
262
290
  requirements:
263
291
  - - "~>"
264
292
  - !ruby/object:Gem::Version
265
- version: '0.6'
293
+ version: '1.0'
266
294
  type: :development
267
295
  prerelease: false
268
296
  version_requirements: !ruby/object:Gem::Requirement
269
297
  requirements:
270
298
  - - "~>"
271
299
  - !ruby/object:Gem::Version
272
- version: '0.6'
300
+ version: '1.0'
273
301
  description:
274
302
  email:
275
303
  - brooke@alchemists.io
@@ -283,6 +311,7 @@ files:
283
311
  - LICENSE.md
284
312
  - README.md
285
313
  - bin/tocer
314
+ - lib/tasks/reek.rake
286
315
  - lib/tasks/rspec.rake
287
316
  - lib/tasks/rubocop.rake
288
317
  - lib/tocer.rb
metadata.gz.sig CHANGED
Binary file