pragmater 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/README.md +1 -1
- data/bin/pragmater +1 -1
- data/lib/pragmater/cli.rb +19 -15
- data/lib/pragmater/identity.rb +1 -1
- data/lib/pragmater.rb +1 -0
- data/lib/tasks/reek.rake +8 -0
- data.tar.gz.sig +0 -0
- metadata +37 -8
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae19d19cd219359cb78177582458473e978b6952
|
4
|
+
data.tar.gz: ea3f644245281e8dd6ccaa3d31b0f4cdcfabb861
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0ab78824a0f42cd1c9bc5c770dd5824f05fb8748919a752c6e3cdeec6e1f60e15d5841a097694100396b645f30a8a565c802db2531fc2e59428931122dfc393
|
7
|
+
data.tar.gz: 16363360b54e86646a28c66576a564e857aadd38dc1191ecf47aecda8f05444520609432ac8d5cac446d43e634f2ad9dbe6c3c94b8270e4e2c8d825bdc596ce5
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/README.md
CHANGED
@@ -11,7 +11,7 @@ A command line interface for managing/formatting source file
|
|
11
11
|
[directive pragma](https://en.wikipedia.org/wiki/Directive_(programming)) comments
|
12
12
|
(a.k.a. *magic comments*). Examples:
|
13
13
|
|
14
|
-
#! /usr/bin/ruby
|
14
|
+
#! /usr/bin/env ruby
|
15
15
|
# frozen_string_literal: true
|
16
16
|
# encoding: UTF-8
|
17
17
|
|
data/bin/pragmater
CHANGED
data/lib/pragmater/cli.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "yaml"
|
4
3
|
require "pathname"
|
5
4
|
require "thor"
|
6
5
|
require "thor/actions"
|
@@ -13,10 +12,10 @@ module Pragmater
|
|
13
12
|
include Thor::Actions
|
14
13
|
include ThorPlus::Actions
|
15
14
|
|
16
|
-
package_name
|
15
|
+
package_name Identity.version_label
|
17
16
|
|
18
|
-
def self.
|
19
|
-
{
|
17
|
+
def self.configuration
|
18
|
+
Runcom::Configuration.new file_name: Identity.file_name, defaults: {
|
20
19
|
add: {
|
21
20
|
comments: "",
|
22
21
|
whitelist: []
|
@@ -30,7 +29,6 @@ module Pragmater
|
|
30
29
|
|
31
30
|
def initialize args = [], options = {}, config = {}
|
32
31
|
super args, options, config
|
33
|
-
@configuration = ::Runcom::Configuration.new file_name: Identity.file_name, defaults: self.class.defaults
|
34
32
|
end
|
35
33
|
|
36
34
|
desc "-a, [--add=PATH]", "Add pragma comments to source file(s)."
|
@@ -38,7 +36,7 @@ module Pragmater
|
|
38
36
|
method_option :comments, aliases: "-c", desc: "Pragma comments", type: :array, default: []
|
39
37
|
method_option :whitelist, aliases: "-w", desc: "File extension whitelist", type: :array, default: []
|
40
38
|
def add path
|
41
|
-
settings = configuration.merge add: {comments: options[:comments], whitelist: options[:whitelist]}
|
39
|
+
settings = self.class.configuration.merge add: {comments: options[:comments], whitelist: options[:whitelist]}
|
42
40
|
write path, settings, :add
|
43
41
|
end
|
44
42
|
|
@@ -47,17 +45,25 @@ module Pragmater
|
|
47
45
|
method_option :comments, aliases: "-c", desc: "Pragma comments", type: :array, default: []
|
48
46
|
method_option :whitelist, aliases: "-w", desc: "File extension whitelist", type: :array, default: []
|
49
47
|
def remove path
|
50
|
-
settings = configuration.merge remove: {comments: options[:comments], whitelist: options[:whitelist]}
|
48
|
+
settings = self.class.configuration.merge remove: {comments: options[:comments], whitelist: options[:whitelist]}
|
51
49
|
write path, settings, :remove
|
52
50
|
end
|
53
51
|
|
54
|
-
desc "-c, [--config]",
|
52
|
+
desc "-c, [--config]", %(Manage gem configuration ("#{configuration.computed_path}").)
|
55
53
|
map %w[-c --config] => :config
|
56
|
-
method_option :edit,
|
57
|
-
|
54
|
+
method_option :edit,
|
55
|
+
aliases: "-e",
|
56
|
+
desc: "Edit gem configuration.",
|
57
|
+
type: :boolean, default: false
|
58
|
+
method_option :info,
|
59
|
+
aliases: "-i",
|
60
|
+
desc: "Print gem configuration.",
|
61
|
+
type: :boolean, default: false
|
58
62
|
def config
|
59
|
-
|
60
|
-
|
63
|
+
path = self.class.configuration.computed_path
|
64
|
+
|
65
|
+
if options.edit? then `#{editor} #{path}`
|
66
|
+
elsif options.info? then say(path)
|
61
67
|
else help(:config)
|
62
68
|
end
|
63
69
|
end
|
@@ -65,7 +71,7 @@ module Pragmater
|
|
65
71
|
desc "-v, [--version]", "Show gem version."
|
66
72
|
map %w[-v --version] => :version
|
67
73
|
def version
|
68
|
-
say
|
74
|
+
say Identity.version_label
|
69
75
|
end
|
70
76
|
|
71
77
|
desc "-h, [--help=COMMAND]", "Show this message or get help for a command."
|
@@ -76,8 +82,6 @@ module Pragmater
|
|
76
82
|
|
77
83
|
private
|
78
84
|
|
79
|
-
attr_reader :configuration
|
80
|
-
|
81
85
|
def whitelisted_files path, whitelist
|
82
86
|
file_filter = whitelist.empty? ? %(#{path}/**/*) : %(#{path}/**/*{#{whitelist.join ","}})
|
83
87
|
Pathname.glob(file_filter).select(&:file?)
|
data/lib/pragmater/identity.rb
CHANGED
data/lib/pragmater.rb
CHANGED
data/lib/tasks/reek.rake
ADDED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pragmater
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.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-
|
33
|
+
date: 2016-11-13 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: thor
|
@@ -52,28 +52,28 @@ dependencies:
|
|
52
52
|
requirements:
|
53
53
|
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: '4.
|
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.
|
62
|
+
version: '4.1'
|
63
63
|
- !ruby/object:Gem::Dependency
|
64
64
|
name: runcom
|
65
65
|
requirement: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
67
|
- - "~>"
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: '0.
|
69
|
+
version: '0.3'
|
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: '0.
|
76
|
+
version: '0.3'
|
77
77
|
- !ruby/object:Gem::Dependency
|
78
78
|
name: rake
|
79
79
|
requirement: !ruby/object:Gem::Requirement
|
@@ -88,6 +88,20 @@ dependencies:
|
|
88
88
|
- - "~>"
|
89
89
|
- !ruby/object:Gem::Version
|
90
90
|
version: '11.0'
|
91
|
+
- !ruby/object:Gem::Dependency
|
92
|
+
name: gemsmith
|
93
|
+
requirement: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - "~>"
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '8.0'
|
98
|
+
type: :development
|
99
|
+
prerelease: false
|
100
|
+
version_requirements: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - "~>"
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '8.0'
|
91
105
|
- !ruby/object:Gem::Dependency
|
92
106
|
name: pry
|
93
107
|
requirement: !ruby/object:Gem::Requirement
|
@@ -214,6 +228,20 @@ dependencies:
|
|
214
228
|
- - "~>"
|
215
229
|
- !ruby/object:Gem::Version
|
216
230
|
version: '4.7'
|
231
|
+
- !ruby/object:Gem::Dependency
|
232
|
+
name: reek
|
233
|
+
requirement: !ruby/object:Gem::Requirement
|
234
|
+
requirements:
|
235
|
+
- - "~>"
|
236
|
+
- !ruby/object:Gem::Version
|
237
|
+
version: '4.5'
|
238
|
+
type: :development
|
239
|
+
prerelease: false
|
240
|
+
version_requirements: !ruby/object:Gem::Requirement
|
241
|
+
requirements:
|
242
|
+
- - "~>"
|
243
|
+
- !ruby/object:Gem::Version
|
244
|
+
version: '4.5'
|
217
245
|
- !ruby/object:Gem::Dependency
|
218
246
|
name: rubocop
|
219
247
|
requirement: !ruby/object:Gem::Requirement
|
@@ -234,14 +262,14 @@ dependencies:
|
|
234
262
|
requirements:
|
235
263
|
- - "~>"
|
236
264
|
- !ruby/object:Gem::Version
|
237
|
-
version: '0
|
265
|
+
version: '1.0'
|
238
266
|
type: :development
|
239
267
|
prerelease: false
|
240
268
|
version_requirements: !ruby/object:Gem::Requirement
|
241
269
|
requirements:
|
242
270
|
- - "~>"
|
243
271
|
- !ruby/object:Gem::Version
|
244
|
-
version: '0
|
272
|
+
version: '1.0'
|
245
273
|
description:
|
246
274
|
email:
|
247
275
|
- brooke@alchemists.io
|
@@ -261,6 +289,7 @@ files:
|
|
261
289
|
- lib/pragmater/formatter.rb
|
262
290
|
- lib/pragmater/identity.rb
|
263
291
|
- lib/pragmater/writer.rb
|
292
|
+
- lib/tasks/reek.rake
|
264
293
|
- lib/tasks/rspec.rake
|
265
294
|
- lib/tasks/rubocop.rake
|
266
295
|
homepage: https://github.com/bkuhlmann/pragmater
|
metadata.gz.sig
CHANGED
Binary file
|