pragmater 4.0.0 → 4.1.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
- data/README.md +34 -34
- data/lib/pragmater/cli.rb +3 -5
- data/lib/pragmater/identity.rb +1 -1
- metadata +28 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7561d1e04bd205eb51fb874359ad1b39dbcd388
|
4
|
+
data.tar.gz: 2bbd8526beb8754e5195517db4020f77932a3680
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7411b839d94ee2daaac5493a00ba2d0321a7c06b60da09b79ac0711fb126bc98ac06db9336818d06afd93c667f950eb3b8a9cb72ae42ae81ff3cbac30d60a805
|
7
|
+
data.tar.gz: 65bdd681888b03df844da1567397febe7c44a1f7bb704030c7a284db8da55f70161f3d0836f8ecc9fe185af12e131dcf51b2e6bf375192a6653a97b38c97f325
|
data/README.md
CHANGED
@@ -21,28 +21,28 @@ or multiple Ruby source files in order to benefit from improved memory and concu
|
|
21
21
|
|
22
22
|
<!-- Tocer[start]: Auto-generated, don't remove. -->
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
- [Features](#features)
|
27
|
-
- [Screencasts](#screencasts)
|
28
|
-
- [Requirements](#requirements)
|
29
|
-
- [Setup](#setup)
|
30
|
-
- [Usage](#usage)
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
- [Tests](#tests)
|
36
|
-
- [Versioning](#versioning)
|
37
|
-
- [Code of Conduct](#code-of-conduct)
|
38
|
-
- [Contributions](#contributions)
|
39
|
-
- [License](#license)
|
40
|
-
- [History](#history)
|
41
|
-
- [Credits](#credits)
|
24
|
+
## Table of Contents
|
25
|
+
|
26
|
+
- [Features](#features)
|
27
|
+
- [Screencasts](#screencasts)
|
28
|
+
- [Requirements](#requirements)
|
29
|
+
- [Setup](#setup)
|
30
|
+
- [Usage](#usage)
|
31
|
+
- [Command Line Interface (CLI)](#command-line-interface-cli)
|
32
|
+
- [Customization](#customization)
|
33
|
+
- [Frozen String Literals](#frozen-string-literals)
|
34
|
+
- [Available Comments](#available-comments)
|
35
|
+
- [Tests](#tests)
|
36
|
+
- [Versioning](#versioning)
|
37
|
+
- [Code of Conduct](#code-of-conduct)
|
38
|
+
- [Contributions](#contributions)
|
39
|
+
- [License](#license)
|
40
|
+
- [History](#history)
|
41
|
+
- [Credits](#credits)
|
42
42
|
|
43
43
|
<!-- Tocer[finish]: Auto-generated, don't remove. -->
|
44
44
|
|
45
|
-
|
45
|
+
## Features
|
46
46
|
|
47
47
|
- Supports adding a pragma comment or multiple pragma comments to single or multiple source files.
|
48
48
|
- Supports removing a pragma comment(s) from single or multiple source files.
|
@@ -50,15 +50,15 @@ or multiple Ruby source files in order to benefit from improved memory and concu
|
|
50
50
|
- Ensures duplicate pragma comments never exist.
|
51
51
|
- Ensures pragma comments are consistently formatted.
|
52
52
|
|
53
|
-
|
53
|
+
## Screencasts
|
54
54
|
|
55
55
|
[](https://asciinema.org/a/91755)
|
56
56
|
|
57
|
-
|
57
|
+
## Requirements
|
58
58
|
|
59
59
|
0. [Ruby 2.4.x](https://www.ruby-lang.org)
|
60
60
|
|
61
|
-
|
61
|
+
## Setup
|
62
62
|
|
63
63
|
For a secure install, type the following (recommended):
|
64
64
|
|
@@ -73,9 +73,9 @@ For an insecure install, type the following (not recommended):
|
|
73
73
|
|
74
74
|
gem install pragmater
|
75
75
|
|
76
|
-
|
76
|
+
## Usage
|
77
77
|
|
78
|
-
|
78
|
+
### Command Line Interface (CLI)
|
79
79
|
|
80
80
|
From the command line, type: `pragmater help`
|
81
81
|
|
@@ -91,7 +91,7 @@ whitelisted files (viewable by running `pragmater --help --add` or `pragmater --
|
|
91
91
|
-c, [--comments=one two three] # Pragma comments
|
92
92
|
-w, [--whitelist=one two three] # File whitelist
|
93
93
|
|
94
|
-
|
94
|
+
### Customization
|
95
95
|
|
96
96
|
This gem can be configured via a global configuration:
|
97
97
|
|
@@ -119,7 +119,7 @@ The `configuration.yml` file can be configured as follows:
|
|
119
119
|
- `remove`: Defines global/local comments and/or whitelists when removing pragma comments. The
|
120
120
|
`comments` and `whitelist` options can be either a single string or an array of values.
|
121
121
|
|
122
|
-
|
122
|
+
### Frozen String Literals
|
123
123
|
|
124
124
|
With Ruby 2.3.0, support for frozen strings was added. These comments are meant to be placed at the
|
125
125
|
top of each source file. Example:
|
@@ -141,7 +141,7 @@ down frozen string literal issues:
|
|
141
141
|
|
142
142
|
--debug=frozen-string-literal
|
143
143
|
|
144
|
-
|
144
|
+
### Available Comments
|
145
145
|
|
146
146
|
With Ruby 2.3 and higher, the following comments are available:
|
147
147
|
|
@@ -154,13 +154,13 @@ With Ruby 2.3 and higher, the following comments are available:
|
|
154
154
|
enabled, and running Ruby with the `-w` option, it'll throw warnings for code that isn't indented
|
155
155
|
by two spaces.
|
156
156
|
|
157
|
-
|
157
|
+
## Tests
|
158
158
|
|
159
159
|
To test, run:
|
160
160
|
|
161
161
|
bundle exec rake
|
162
162
|
|
163
|
-
|
163
|
+
## Versioning
|
164
164
|
|
165
165
|
Read [Semantic Versioning](http://semver.org) for details. Briefly, it means:
|
166
166
|
|
@@ -168,26 +168,26 @@ Read [Semantic Versioning](http://semver.org) for details. Briefly, it means:
|
|
168
168
|
- Minor (x.Y.z) - Incremented for new, backwards compatible, public API enhancements/fixes.
|
169
169
|
- Patch (x.y.Z) - Incremented for small, backwards compatible, bug fixes.
|
170
170
|
|
171
|
-
|
171
|
+
## Code of Conduct
|
172
172
|
|
173
173
|
Please note that this project is released with a [CODE OF CONDUCT](CODE_OF_CONDUCT.md). By
|
174
174
|
participating in this project you agree to abide by its terms.
|
175
175
|
|
176
|
-
|
176
|
+
## Contributions
|
177
177
|
|
178
178
|
Read [CONTRIBUTING](CONTRIBUTING.md) for details.
|
179
179
|
|
180
|
-
|
180
|
+
## License
|
181
181
|
|
182
182
|
Copyright (c) 2015 [Alchemists](https://www.alchemists.io).
|
183
183
|
Read [LICENSE](LICENSE.md) for details.
|
184
184
|
|
185
|
-
|
185
|
+
## History
|
186
186
|
|
187
187
|
Read [CHANGES](CHANGES.md) for details.
|
188
188
|
Built with [Gemsmith](https://github.com/bkuhlmann/gemsmith).
|
189
189
|
|
190
|
-
|
190
|
+
## Credits
|
191
191
|
|
192
192
|
Developed by [Brooke Kuhlmann](https://www.alchemists.io) at
|
193
193
|
[Alchemists](https://www.alchemists.io).
|
data/lib/pragmater/cli.rb
CHANGED
@@ -3,14 +3,12 @@
|
|
3
3
|
require "pathname"
|
4
4
|
require "thor"
|
5
5
|
require "thor/actions"
|
6
|
-
require "thor_plus/actions"
|
7
6
|
require "runcom"
|
8
7
|
|
9
8
|
module Pragmater
|
10
9
|
# The Command Line Interface (CLI) for the gem.
|
11
10
|
class CLI < Thor
|
12
11
|
include Thor::Actions
|
13
|
-
include ThorPlus::Actions
|
14
12
|
|
15
13
|
package_name Identity.version_label
|
16
14
|
|
@@ -53,7 +51,7 @@ module Pragmater
|
|
53
51
|
comments: settings.dig(:add, :comments),
|
54
52
|
whitelist: settings.dig(:add, :whitelist)
|
55
53
|
|
56
|
-
runner.run(action: :add) { |file| info "Processed: #{file}." }
|
54
|
+
runner.run(action: :add) { |file| say_status :info, "Processed: #{file}.", :green }
|
57
55
|
end
|
58
56
|
|
59
57
|
desc "-r, [--remove=PATH]", "Remove pragma comments from source file(s)."
|
@@ -78,7 +76,7 @@ module Pragmater
|
|
78
76
|
comments: settings.dig(:remove, :comments),
|
79
77
|
whitelist: settings.dig(:remove, :whitelist)
|
80
78
|
|
81
|
-
runner.run(action: :remove) { |file| info "Processed: #{file}." }
|
79
|
+
runner.run(action: :remove) { |file| say_status :info, "Processed: #{file}.", :green }
|
82
80
|
end
|
83
81
|
|
84
82
|
desc "-c, [--config]", "Manage gem configuration."
|
@@ -94,7 +92,7 @@ module Pragmater
|
|
94
92
|
def config
|
95
93
|
path = self.class.configuration.path
|
96
94
|
|
97
|
-
if options.edit? then `#{
|
95
|
+
if options.edit? then `#{ENV["EDITOR"]} #{path}`
|
98
96
|
elsif options.info?
|
99
97
|
path ? say(path) : say("Configuration doesn't exist.")
|
100
98
|
else help(:config)
|
data/lib/pragmater/identity.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pragmater
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-07-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -25,47 +25,47 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0.19'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: runcom
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '1.1'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '1.1'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
48
|
-
type: :
|
47
|
+
version: '12.0'
|
48
|
+
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '12.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: gemsmith
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '10.0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '10.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: pry
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,14 +156,14 @@ dependencies:
|
|
156
156
|
requirements:
|
157
157
|
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: '1.
|
159
|
+
version: '1.8'
|
160
160
|
type: :development
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
164
|
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: '1.
|
166
|
+
version: '1.8'
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: rspec
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -192,6 +192,20 @@ dependencies:
|
|
192
192
|
- - "~>"
|
193
193
|
- !ruby/object:Gem::Version
|
194
194
|
version: '4.7'
|
195
|
+
- !ruby/object:Gem::Dependency
|
196
|
+
name: git-cop
|
197
|
+
requirement: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - "~>"
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: '1.3'
|
202
|
+
type: :development
|
203
|
+
prerelease: false
|
204
|
+
version_requirements: !ruby/object:Gem::Requirement
|
205
|
+
requirements:
|
206
|
+
- - "~>"
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: '1.3'
|
195
209
|
- !ruby/object:Gem::Dependency
|
196
210
|
name: reek
|
197
211
|
requirement: !ruby/object:Gem::Requirement
|