pragmater 1.3.0 → 2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e86d124630ff11d3a04bed3059baa0875a36dbee
4
- data.tar.gz: f5961efc8428ed964111a6f5437b5b095e9a9857
3
+ metadata.gz: 55dc0f745ab1fce5b62b665045e46dd976e3a23f
4
+ data.tar.gz: a42464930c86b0c25ae9f6c4c818b70146ccb7df
5
5
  SHA512:
6
- metadata.gz: 99fc8efe9b5f937cc2ad5f0c6e85ff8aab88a5e881da0d7f7a5c105c926b06489c1c0a4052c6f5ce8783ed509815ba762b5d0f01943813cf8166eb213f90e1c9
7
- data.tar.gz: add8946a9e598585554ca4d01fba1797722692e26b92bd5a393f7c54264a10988cf2e16023965e26bea1e506a87a2da4f74e0922c29380f360dcad59473e59ec
6
+ metadata.gz: 75f7ec6c3aab4bf5f98eaec8a9ae3a95f26dd2db7a91149886d40f17f837e76df4703992b872afd7c4594fc881c3ec70ce6abf78a9e7a2c1c288f7a03c2c5bff
7
+ data.tar.gz: 31a4b18918e89344a5a46b39f72affa65fafdc143d61891b1c1d176bda7103c6da8fae10440b8554dd886b1297227a5de10d287f5059eff564146e0062fa71c0
checksums.yaml.gz.sig CHANGED
Binary file
data/README.md CHANGED
@@ -7,16 +7,17 @@
7
7
  [![Travis CI Status](https://secure.travis-ci.org/bkuhlmann/pragmater.svg)](https://travis-ci.org/bkuhlmann/pragmater)
8
8
  [![Patreon](https://img.shields.io/badge/patreon-donate-brightgreen.svg)](https://www.patreon.com/bkuhlmann)
9
9
 
10
- A command line interface for managing/formatting source file [directive
11
- pragma](https://en.wikipedia.org/wiki/Directive_(programming)) comments (a.k.a. *magic comments*). Examples:
10
+ A command line interface for managing/formatting source file
11
+ [directive pragma](https://en.wikipedia.org/wiki/Directive_(programming)) comments
12
+ (a.k.a. *magic comments*). Examples:
12
13
 
13
14
  #! /usr/bin/ruby
14
15
  # frozen_string_literal: true
15
16
  # encoding: UTF-8
16
17
 
17
- With [Ruby 2.3.0](https://www.ruby-lang.org/en/news/2015/12/25/ruby-2-3-0-released), frozen strings are supported via a
18
- pragma comment. This gem provides an easy way to add pragma comments to single or multiple Ruby source files in order
19
- to benefit from improved memory and concurrency performance.
18
+ With [Ruby 2.3.0](https://www.ruby-lang.org/en/news/2015/12/25/ruby-2-3-0-released), frozen strings
19
+ are supported via a pragma comment. This gem provides an easy way to add pragma comments to single
20
+ or multiple Ruby source files in order to benefit from improved memory and concurrency performance.
20
21
 
21
22
  <!-- Tocer[start]: Auto-generated, don't remove. -->
22
23
 
@@ -44,18 +45,18 @@ to benefit from improved memory and concurrency performance.
44
45
  # Features
45
46
 
46
47
  - Supports adding a pragma comment or multiple pragma comments to single or multiple source files.
47
- - Supports removing a pragma comment or multiple pragma comments from single or multiple source files.
48
+ - Supports removing a pragma comment(s) from single or multiple source files.
48
49
  - Supports whitelist filtering. Defaults to any file.
49
50
  - Ensures duplicate pragma comments never exist.
50
51
  - Ensures pragma comments are consistently formatted.
51
52
 
52
53
  # Screencasts
53
54
 
54
- [![asciicast](https://asciinema.org/a/34038.png)](https://asciinema.org/a/34038)
55
+ [![asciicast](https://asciinema.org/a/91755.png)](https://asciinema.org/a/91755)
55
56
 
56
57
  # Requirements
57
58
 
58
- 0. [MRI 2.3.x](https://www.ruby-lang.org)
59
+ 0. [Ruby 2.3.x](https://www.ruby-lang.org)
59
60
 
60
61
  # Setup
61
62
 
@@ -64,8 +65,9 @@ For a secure install, type the following (recommended):
64
65
  gem cert --add <(curl --location --silent https://www.alchemists.io/gem-public.pem)
65
66
  gem install pragmater --trust-policy MediumSecurity
66
67
 
67
- NOTE: A HighSecurity trust policy would be best but MediumSecurity enables signed gem verification while
68
- allowing the installation of unsigned dependencies since they are beyond the scope of this gem.
68
+ NOTE: A HighSecurity trust policy would be best but MediumSecurity enables signed gem verification
69
+ while allowing the installation of unsigned dependencies since they are beyond the scope of this
70
+ gem.
69
71
 
70
72
  For an insecure install, type the following (not recommended):
71
73
 
@@ -78,21 +80,21 @@ For an insecure install, type the following (not recommended):
78
80
  From the command line, type: `pragmater help`
79
81
 
80
82
  pragmater -a, [--add=PATH] # Add pragma comments to source file(s).
81
- pragmater -e, [--edit] # Edit gem settings in default editor.
83
+ pragmater -c, [--config] # Manage gem configuration.
82
84
  pragmater -h, [--help=COMMAND] # Show this message or get help for a command.
83
85
  pragmater -r, [--remove=PATH] # Remove pragma comments from source file(s).
84
86
  pragmater -v, [--version] # Show gem version.
85
87
 
86
- Both the `--add` and `--remove` commands support options for specifying pragma comments and/or whitelisted files
87
- (viewable by running `pragmater --help --add` or `pragmater --help --remove`):
88
+ Both the `--add` and `--remove` commands support options for specifying pragma comments and/or
89
+ whitelisted files (viewable by running `pragmater --help --add` or `pragmater --help --remove`):
88
90
 
89
91
  -c, [--comments=one two three] # Pragma comments
90
92
  -w, [--whitelist=one two three] # File extension whitelist
91
93
 
92
94
  ## Customization
93
95
 
94
- Should the default settings not be desired, customization is allowed via the `.pragmaterrc` file. The `.pragmaterrc`
95
- can be created at a global and/or local level. Example:
96
+ Should the default settings not be desired, customization is allowed via the `.pragmaterrc` file.
97
+ The `.pragmaterrc` can be created at a global and/or local level. Example:
96
98
 
97
99
  - Global: `~/.pragmaterrc`
98
100
  - Local: `<project repository root>/.pragmaterrc`
@@ -103,10 +105,11 @@ Order of precedence for any setting is resolved as follows (with the last taking
103
105
  0. Local project repository `.pragmaterrc`.
104
106
  0. CLI option (i.e. `--add` or `--remove` command options).
105
107
 
106
- Any setting provided to the CLI during runtime would trump a local/global setting and a local setting would trump a
107
- global setting. The global setting is the weakest of all but great for situations where custom settings should be
108
- applied to *all* projects. It is important to note that local settings completely trump any global settings -- there is
109
- no inheritance when local *and* global settings exist at the same time.
108
+ Any setting provided to the CLI during runtime would trump a local/global setting and a local
109
+ setting would trump a global setting. The global setting is the weakest of all but great for
110
+ situations where custom settings should be applied to *all* projects. It is important to note that
111
+ local settings completely trump any global settings -- there is no inheritance when local *and*
112
+ global settings exist at the same time.
110
113
 
111
114
  The `.pragmaterrc` uses the following default settings:
112
115
 
@@ -119,27 +122,30 @@ The `.pragmaterrc` uses the following default settings:
119
122
 
120
123
  Each `.pragmaterrc` setting can be configured as follows:
121
124
 
122
- - `add`: Defines global/local comments and/or whitelists when adding pragma comments. The `comments` and `whitelist`
123
- options can be either a single string or an array of values.
124
- - `remove`: Defines global/local comments and/or whitelists when removing pragma comments. The `comments` and
125
- `whitelist` options can be either a single string or an array of values.
125
+ - `add`: Defines global/local comments and/or whitelists when adding pragma comments. The `comments`
126
+ and `whitelist` options can be either a single string or an array of values.
127
+ - `remove`: Defines global/local comments and/or whitelists when removing pragma comments. The
128
+ `comments` and `whitelist` options can be either a single string or an array of values.
126
129
 
127
130
  ## Frozen String Literals
128
131
 
129
- With Ruby 2.3.0, support for frozen strings was added. These comments are meant to be placed at the top of each source
130
- file. Example:
132
+ With Ruby 2.3.0, support for frozen strings was added. These comments are meant to be placed at the
133
+ top of each source file. Example:
131
134
 
132
135
  # frozen_string_literal: true
133
136
 
134
- This is great for *selective* enablement of frozen string literals but might be too much work for some (even with the
135
- aid of this gem). As an alternative, frozen string literals can be enabled via the following Ruby command line option:
137
+ This is great for *selective* enablement of frozen string literals but might be too much work for
138
+ some (even with the aid of this gem). As an alternative, frozen string literals can be enabled via
139
+ the following Ruby command line option:
136
140
 
137
141
  --enable=frozen-string-literal
138
142
 
139
- It is important to note that, once enabled, it freezes strings program-wide -- It's an all or nothing option.
143
+ It is important to note that, once enabled, it freezes strings program-wide -- It's an all or
144
+ nothing option.
140
145
 
141
- Regardless of whether you leverage the capabilities of this gem or the Ruby command line option mentioned above, the
142
- following Ruby command line option is available to aid debugging and tracking down frozen string literal issues:
146
+ Regardless of whether you leverage the capabilities of this gem or the Ruby command line option
147
+ mentioned above, the following Ruby command line option is available to aid debugging and tracking
148
+ down frozen string literal issues:
143
149
 
144
150
  --debug=frozen-string-literal
145
151
 
@@ -147,13 +153,14 @@ following Ruby command line option is available to aid debugging and tracking do
147
153
 
148
154
  With Ruby 2.3 and higher, the following comments are available:
149
155
 
150
- - `# encoding:` Defaults to `UTF-8` but any supported encoding can be used. For a list of values, launch an IRB session
151
- and run `Encoding.name_list`.
156
+ - `# encoding:` Defaults to `UTF-8` but any supported encoding can be used. For a list of values,
157
+ launch an IRB session and run `Encoding.name_list`.
152
158
  - `# coding:` The shorthand for `# encoding:`. Supports the same values as mentioned above.
153
- - `# frozen_string_literal:` Defaults to `false` but can take either `true` or `false` as a value. When enabled, Ruby
154
- will throw errors when strings are used in a mutable fashion.
155
- - `# warn_indent:` Defaults to `false` but can take either `true` or `false` as a value. When enabled, and running Ruby
156
- with the `-w` option, it'll throw warnings for code that isn't indented by two spaces.
159
+ - `# frozen_string_literal:` Defaults to `false` but can take either `true` or `false` as a value.
160
+ When enabled, Ruby will throw errors when strings are used in a mutable fashion.
161
+ - `# warn_indent:` Defaults to `false` but can take either `true` or `false` as a value. When
162
+ enabled, and running Ruby with the `-w` option, it'll throw warnings for code that isn't indented
163
+ by two spaces.
157
164
 
158
165
  # Tests
159
166
 
@@ -165,14 +172,14 @@ To test, run:
165
172
 
166
173
  Read [Semantic Versioning](http://semver.org) for details. Briefly, it means:
167
174
 
168
- - Patch (x.y.Z) - Incremented for small, backwards compatible bug fixes.
169
- - Minor (x.Y.z) - Incremented for new, backwards compatible public API enhancements and/or bug fixes.
175
+ - Patch (x.y.Z) - Incremented for small, backwards compatible, bug fixes.
176
+ - Minor (x.Y.z) - Incremented for new, backwards compatible, public API enhancements/fixes.
170
177
  - Major (X.y.z) - Incremented for any backwards incompatible public API changes.
171
178
 
172
179
  # Code of Conduct
173
180
 
174
- Please note that this project is released with a [CODE OF CONDUCT](CODE_OF_CONDUCT.md). By participating in this project
175
- you agree to abide by its terms.
181
+ Please note that this project is released with a [CODE OF CONDUCT](CODE_OF_CONDUCT.md). By
182
+ participating in this project you agree to abide by its terms.
176
183
 
177
184
  # Contributions
178
185
 
@@ -181,13 +188,14 @@ Read [CONTRIBUTING](CONTRIBUTING.md) for details.
181
188
  # License
182
189
 
183
190
  Copyright (c) 2015 [Alchemists](https://www.alchemists.io).
184
- Read the [LICENSE](LICENSE.md) for details.
191
+ Read [LICENSE](LICENSE.md) for details.
185
192
 
186
193
  # History
187
194
 
188
- Read the [CHANGELOG](CHANGELOG.md) for details.
195
+ Read [CHANGES](CHANGES.md) for details.
189
196
  Built with [Gemsmith](https://github.com/bkuhlmann/gemsmith).
190
197
 
191
198
  # Credits
192
199
 
193
- Developed by [Brooke Kuhlmann](https://www.alchemists.io) at [Alchemists](https://www.alchemists.io).
200
+ Developed by [Brooke Kuhlmann](https://www.alchemists.io) at
201
+ [Alchemists](https://www.alchemists.io).
data/bin/pragmater CHANGED
@@ -1,4 +1,5 @@
1
1
  #! /usr/bin/ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require "pragmater"
4
5
  require "pragmater/cli"
data/lib/pragmater/cli.rb CHANGED
@@ -5,6 +5,7 @@ require "pathname"
5
5
  require "thor"
6
6
  require "thor/actions"
7
7
  require "thor_plus/actions"
8
+ require "runcom"
8
9
 
9
10
  module Pragmater
10
11
  # The Command Line Interface (CLI) for the gem.
@@ -14,9 +15,22 @@ module Pragmater
14
15
 
15
16
  package_name Pragmater::Identity.version_label
16
17
 
18
+ def self.defaults
19
+ {
20
+ add: {
21
+ comments: "",
22
+ whitelist: []
23
+ },
24
+ remove: {
25
+ comments: "",
26
+ whitelist: []
27
+ }
28
+ }
29
+ end
30
+
17
31
  def initialize args = [], options = {}, config = {}
18
32
  super args, options, config
19
- @configuration = Configuration.new Identity.file_name
33
+ @configuration = ::Runcom::Configuration.new file_name: Identity.file_name, defaults: self.class.defaults
20
34
  end
21
35
 
22
36
  desc "-a, [--add=PATH]", "Add pragma comments to source file(s)."
@@ -37,12 +51,15 @@ module Pragmater
37
51
  write path, settings, :remove
38
52
  end
39
53
 
40
- desc "-e, [--edit]", "Edit gem settings in default editor."
41
- map %w[-e --edit] => :edit
42
- def edit
43
- resource_file = File.join ENV["HOME"], Pragmater::Identity.file_name
44
- info "Editing: #{resource_file}..."
45
- `#{editor} #{resource_file}`
54
+ desc "-c, [--config]", "Manage gem configuration."
55
+ map %w[-c --config] => :config
56
+ method_option :edit, aliases: "-e", desc: "Edit gem configuration.", type: :boolean, default: false
57
+ method_option :info, aliases: "-i", desc: "Print gem configuration info.", type: :boolean, default: false
58
+ def config
59
+ if options.edit? then `#{editor} #{configuration.computed_path}`
60
+ elsif options.info? then say("Using: #{configuration.computed_path}.")
61
+ else help(:config)
62
+ end
46
63
  end
47
64
 
48
65
  desc "-v, [--version]", "Show gem version."
@@ -12,7 +12,7 @@ module Pragmater
12
12
  end
13
13
 
14
14
  def self.version
15
- "1.3.0"
15
+ "2.0.0"
16
16
  end
17
17
 
18
18
  def self.version_label
data/lib/pragmater.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "pragmater/commenter"
4
- require "pragmater/configuration"
5
4
  require "pragmater/formatter"
6
5
  require "pragmater/identity"
7
6
  require "pragmater/writer"
data/lib/tasks/rspec.rake CHANGED
@@ -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
data.tar.gz.sig CHANGED
@@ -1,2 +1,3 @@
1
- H)��X)}�.�ۦ������[��l����t�w$��o��C� 3���%I�;Ȍ:��$�<�o؞h����[�=K�bSrx�*�V����F��Y�-ßؾ&�e1p~��#�ڰI��^�X�$���(��<�����-�|H��)��E5�%'L,����~~
2
- :0� c�(��lq������~��(�wpTG�)!F�q"�x[o�������Lo}ƛL�����7 ��/GK�~���
1
+ *�l>O)6���86o�D8I�H������]�K��m7y����
2
+ l| ���"�qS���2�톄�#>OԬy
3
+ ���E3������F'L�P�5�of ${��k���s� ��e&������a��-��B�#�/4w�z�Ѯ�N�Y,t����*��:ӷ�gv���ʯ��r {� �,L��lm���+�d;?[ 5��(ȹ ���9���
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: 1.3.0
4
+ version: 2.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-06-17 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,28 +52,28 @@ dependencies:
52
52
  requirements:
53
53
  - - "~>"
54
54
  - !ruby/object:Gem::Version
55
- version: '3.1'
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.1'
62
+ version: '4.0'
63
63
  - !ruby/object:Gem::Dependency
64
- name: refinements
64
+ name: runcom
65
65
  requirement: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
- version: '2.2'
69
+ version: '0.2'
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: '0.2'
77
77
  - !ruby/object:Gem::Dependency
78
78
  name: rake
79
79
  requirement: !ruby/object:Gem::Requirement
@@ -89,230 +89,160 @@ dependencies:
89
89
  - !ruby/object:Gem::Version
90
90
  version: '11.0'
91
91
  - !ruby/object:Gem::Dependency
92
- name: gemsmith
92
+ name: pry
93
93
  requirement: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - "~>"
96
96
  - !ruby/object:Gem::Version
97
- version: '7.7'
97
+ version: '0.10'
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.7'
105
- - !ruby/object:Gem::Dependency
106
- name: pry
107
- requirement: !ruby/object:Gem::Requirement
108
- requirements:
109
- - - ">="
110
- - !ruby/object:Gem::Version
111
- version: '0'
112
- type: :development
113
- prerelease: false
114
- version_requirements: !ruby/object:Gem::Requirement
115
- requirements:
116
- - - ">="
117
- - !ruby/object:Gem::Version
118
- version: '0'
104
+ version: '0.10'
119
105
  - !ruby/object:Gem::Dependency
120
106
  name: pry-byebug
121
107
  requirement: !ruby/object:Gem::Requirement
122
108
  requirements:
123
- - - ">="
109
+ - - "~>"
124
110
  - !ruby/object:Gem::Version
125
- version: '0'
111
+ version: '3.4'
126
112
  type: :development
127
113
  prerelease: false
128
114
  version_requirements: !ruby/object:Gem::Requirement
129
115
  requirements:
130
- - - ">="
116
+ - - "~>"
131
117
  - !ruby/object:Gem::Version
132
- version: '0'
118
+ version: '3.4'
133
119
  - !ruby/object:Gem::Dependency
134
120
  name: pry-state
135
121
  requirement: !ruby/object:Gem::Requirement
136
122
  requirements:
137
- - - ">="
123
+ - - "~>"
138
124
  - !ruby/object:Gem::Version
139
- version: '0'
125
+ version: '0.1'
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: '0.1'
147
133
  - !ruby/object:Gem::Dependency
148
134
  name: bond
149
135
  requirement: !ruby/object:Gem::Requirement
150
136
  requirements:
151
- - - ">="
137
+ - - "~>"
152
138
  - !ruby/object:Gem::Version
153
- version: '0'
139
+ version: '0.5'
154
140
  type: :development
155
141
  prerelease: false
156
142
  version_requirements: !ruby/object:Gem::Requirement
157
143
  requirements:
158
- - - ">="
144
+ - - "~>"
159
145
  - !ruby/object:Gem::Version
160
- version: '0'
146
+ version: '0.5'
161
147
  - !ruby/object:Gem::Dependency
162
148
  name: wirb
163
149
  requirement: !ruby/object:Gem::Requirement
164
150
  requirements:
165
- - - ">="
151
+ - - "~>"
166
152
  - !ruby/object:Gem::Version
167
- version: '0'
153
+ version: '2.0'
168
154
  type: :development
169
155
  prerelease: false
170
156
  version_requirements: !ruby/object:Gem::Requirement
171
157
  requirements:
172
- - - ">="
158
+ - - "~>"
173
159
  - !ruby/object:Gem::Version
174
- version: '0'
160
+ version: '2.0'
175
161
  - !ruby/object:Gem::Dependency
176
162
  name: hirb
177
163
  requirement: !ruby/object:Gem::Requirement
178
164
  requirements:
179
- - - ">="
165
+ - - "~>"
180
166
  - !ruby/object:Gem::Version
181
- version: '0'
167
+ version: '0.7'
182
168
  type: :development
183
169
  prerelease: false
184
170
  version_requirements: !ruby/object:Gem::Requirement
185
171
  requirements:
186
- - - ">="
172
+ - - "~>"
187
173
  - !ruby/object:Gem::Version
188
- version: '0'
174
+ version: '0.7'
189
175
  - !ruby/object:Gem::Dependency
190
176
  name: awesome_print
191
177
  requirement: !ruby/object:Gem::Requirement
192
178
  requirements:
193
- - - ">="
179
+ - - "~>"
194
180
  - !ruby/object:Gem::Version
195
- version: '0'
181
+ version: '1.7'
196
182
  type: :development
197
183
  prerelease: false
198
184
  version_requirements: !ruby/object:Gem::Requirement
199
185
  requirements:
200
- - - ">="
186
+ - - "~>"
201
187
  - !ruby/object:Gem::Version
202
- version: '0'
188
+ version: '1.7'
203
189
  - !ruby/object:Gem::Dependency
204
190
  name: rspec
205
191
  requirement: !ruby/object:Gem::Requirement
206
192
  requirements:
207
193
  - - "~>"
208
194
  - !ruby/object:Gem::Version
209
- version: '3.4'
195
+ version: '3.5'
210
196
  type: :development
211
197
  prerelease: false
212
198
  version_requirements: !ruby/object:Gem::Requirement
213
199
  requirements:
214
200
  - - "~>"
215
201
  - !ruby/object:Gem::Version
216
- version: '3.4'
217
- - !ruby/object:Gem::Dependency
218
- name: climate_control
219
- requirement: !ruby/object:Gem::Requirement
220
- requirements:
221
- - - ">="
222
- - !ruby/object:Gem::Version
223
- version: '0'
224
- type: :development
225
- prerelease: false
226
- version_requirements: !ruby/object:Gem::Requirement
227
- requirements:
228
- - - ">="
229
- - !ruby/object:Gem::Version
230
- version: '0'
231
- - !ruby/object:Gem::Dependency
232
- name: rb-fsevent
233
- requirement: !ruby/object:Gem::Requirement
234
- requirements:
235
- - - ">="
236
- - !ruby/object:Gem::Version
237
- version: '0'
238
- type: :development
239
- prerelease: false
240
- version_requirements: !ruby/object:Gem::Requirement
241
- requirements:
242
- - - ">="
243
- - !ruby/object:Gem::Version
244
- version: '0'
202
+ version: '3.5'
245
203
  - !ruby/object:Gem::Dependency
246
204
  name: guard-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: terminal-notifier
261
- requirement: !ruby/object:Gem::Requirement
262
- requirements:
263
- - - ">="
264
- - !ruby/object:Gem::Version
265
- version: '0'
266
- type: :development
267
- prerelease: false
268
- version_requirements: !ruby/object:Gem::Requirement
269
- requirements:
270
- - - ">="
271
- - !ruby/object:Gem::Version
272
- version: '0'
273
- - !ruby/object:Gem::Dependency
274
- name: terminal-notifier-guard
275
- requirement: !ruby/object:Gem::Requirement
276
- requirements:
277
- - - ">="
207
+ - - "~>"
278
208
  - !ruby/object:Gem::Version
279
- version: '0'
209
+ version: '4.7'
280
210
  type: :development
281
211
  prerelease: false
282
212
  version_requirements: !ruby/object:Gem::Requirement
283
213
  requirements:
284
- - - ">="
214
+ - - "~>"
285
215
  - !ruby/object:Gem::Version
286
- version: '0'
216
+ version: '4.7'
287
217
  - !ruby/object:Gem::Dependency
288
218
  name: rubocop
289
219
  requirement: !ruby/object:Gem::Requirement
290
220
  requirements:
291
221
  - - "~>"
292
222
  - !ruby/object:Gem::Version
293
- version: '0.40'
223
+ version: '0.45'
294
224
  type: :development
295
225
  prerelease: false
296
226
  version_requirements: !ruby/object:Gem::Requirement
297
227
  requirements:
298
228
  - - "~>"
299
229
  - !ruby/object:Gem::Version
300
- version: '0.40'
230
+ version: '0.45'
301
231
  - !ruby/object:Gem::Dependency
302
232
  name: codeclimate-test-reporter
303
233
  requirement: !ruby/object:Gem::Requirement
304
234
  requirements:
305
- - - ">="
235
+ - - "~>"
306
236
  - !ruby/object:Gem::Version
307
- version: '0'
237
+ version: '0.6'
308
238
  type: :development
309
239
  prerelease: false
310
240
  version_requirements: !ruby/object:Gem::Requirement
311
241
  requirements:
312
- - - ">="
242
+ - - "~>"
313
243
  - !ruby/object:Gem::Version
314
- version: '0'
315
- description: A command line interface for managing/formatting source file pragma comments.
244
+ version: '0.6'
245
+ description:
316
246
  email:
317
247
  - brooke@alchemists.io
318
248
  executables:
@@ -328,11 +258,9 @@ files:
328
258
  - lib/pragmater.rb
329
259
  - lib/pragmater/cli.rb
330
260
  - lib/pragmater/commenter.rb
331
- - lib/pragmater/configuration.rb
332
261
  - lib/pragmater/formatter.rb
333
262
  - lib/pragmater/identity.rb
334
263
  - lib/pragmater/writer.rb
335
- - lib/tasks/console.rake
336
264
  - lib/tasks/rspec.rake
337
265
  - lib/tasks/rubocop.rake
338
266
  homepage: https://github.com/bkuhlmann/pragmater
@@ -355,7 +283,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
355
283
  version: '0'
356
284
  requirements: []
357
285
  rubyforge_project:
358
- rubygems_version: 2.6.4
286
+ rubygems_version: 2.6.8
359
287
  signing_key:
360
288
  specification_version: 4
361
289
  summary: A command line interface for managing/formatting source file pragma comments.
metadata.gz.sig CHANGED
Binary file
@@ -1,59 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "refinements/hash_extensions"
4
-
5
- module Pragmater
6
- # Default gem configuration with support for custom settings.
7
- class Configuration
8
- using Refinements::HashExtensions
9
- attr_reader :settings
10
-
11
- def self.defaults
12
- {
13
- add: {
14
- comments: "",
15
- whitelist: []
16
- },
17
- remove: {
18
- comments: "",
19
- whitelist: []
20
- }
21
- }
22
- end
23
-
24
- def initialize file_name = Identity.file_name, defaults: self.class.defaults
25
- @file_name = file_name
26
- @defaults = defaults
27
- @settings = defaults.deep_merge load_settings
28
- end
29
-
30
- def local_file_path
31
- File.join Dir.pwd, file_name
32
- end
33
-
34
- def global_file_path
35
- File.join ENV["HOME"], file_name
36
- end
37
-
38
- def computed_file_path
39
- File.exist?(local_file_path) ? local_file_path : global_file_path
40
- end
41
-
42
- def merge custom_settings
43
- custom_settings[:add].delete_if { |_, value| value.empty? } if custom_settings.key?(:add)
44
- custom_settings[:remove].delete_if { |_, value| value.empty? } if custom_settings.key?(:remove)
45
- settings.deep_merge custom_settings
46
- end
47
-
48
- private
49
-
50
- attr_reader :file_name, :defaults
51
-
52
- def load_settings
53
- yaml = YAML.load_file computed_file_path
54
- yaml.is_a?(Hash) ? yaml : {}
55
- rescue
56
- defaults
57
- end
58
- end
59
- end
@@ -1,7 +0,0 @@
1
- desc "Open IRB console for gem development environment"
2
- task :console do
3
- require "irb"
4
- require "pragmater"
5
- ARGV.clear
6
- IRB.start
7
- end