fix-command 0.2.0 → 0.3.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
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/.travis.yml +0 -1
- data/README.md +6 -2
- data/VERSION.semver +1 -1
- data/checksum/fix-command-0.2.0.gem.sha512 +1 -0
- data/lib/fix/command.rb +20 -4
- metadata +3 -2
- metadata.gz.sig +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 511ce87b9eee241bc7535bcb5d2ebb90983aea20
|
4
|
+
data.tar.gz: 08be1bd3e8345164d0bf5c41a15172b2d0d696e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d52a0b60819453d5f0744e5276d8119960862a477cdc995cf44460d49c2fd08975465165746a65124176fd2938440c1c2b531eaf36ab1161202fc978e933864
|
7
|
+
data.tar.gz: 79df3831fbfb0f187458ec636b0de58fd5d0d28fd26b10c84e5c873035da831316e940cbd9ff01b952bf73cb68c7417028a1783350a152ef16acad9767be8c99
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -61,8 +61,8 @@ First, let's see the API:
|
|
61
61
|
|
62
62
|
And second, let's run a test:
|
63
63
|
|
64
|
-
$ bundle exec fix duck_fix.rb
|
65
|
-
> fix
|
64
|
+
$ bundle exec fix duck_fix.rb --warnings
|
65
|
+
> fix /Users/bob/code/duck_fix.rb --warnings
|
66
66
|
|
67
67
|
/Users/bob/code/duck_fix.rb ..I
|
68
68
|
|
@@ -71,6 +71,10 @@ And second, let's run a test:
|
|
71
71
|
Ran 3 tests in 0.000612 seconds
|
72
72
|
100% compliant - 1 infos, 0 failures, 0 errors
|
73
73
|
|
74
|
+
### Store Command Line Options
|
75
|
+
|
76
|
+
You can store command line options in a `.fix` file in the project's root directory, and the fix command will read them as though you typed them on the command line.
|
77
|
+
|
74
78
|
## Security
|
75
79
|
|
76
80
|
As a basic form of security __Fix::Command__ provides a set of SHA512 checksums for
|
data/VERSION.semver
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
@@ -0,0 +1 @@
|
|
1
|
+
6a60fe6bd792789341a1cac5b370de34c26b3997bdc940dcadd4fe6416c214f01408cabf92dc12179b52756e3aeb5ff927d56cc0226df857aee590b18016026c
|
data/lib/fix/command.rb
CHANGED
@@ -7,15 +7,25 @@ require 'set'
|
|
7
7
|
# @api public
|
8
8
|
#
|
9
9
|
# @example Let's test a duck's spec!
|
10
|
-
# Fix::Command.run('duck_fix.rb', '
|
10
|
+
# Fix::Command.run('duck_fix.rb', '--warnings')
|
11
11
|
#
|
12
12
|
module Fix
|
13
|
+
# Fix reads command line configuration options from files in two different
|
14
|
+
# locations:
|
15
|
+
#
|
16
|
+
# Local: "./.fix" (i.e. in the project's root directory)
|
17
|
+
# Global: "~/.fix" (i.e. in the user's home directory)
|
18
|
+
#
|
19
|
+
# Options declared in the local file override those in the global file, while
|
20
|
+
# those declared in command-line will override any ".fix" file.
|
21
|
+
COMMAND_LINE_OPTIONS_FILE = '.fix'
|
22
|
+
|
13
23
|
# Open the command class.
|
14
24
|
#
|
15
25
|
# @api public
|
16
26
|
#
|
17
27
|
# @example Let's test a duck's spec!
|
18
|
-
# Command.run('duck_fix.rb', '
|
28
|
+
# Command.run('duck_fix.rb', '--warnings')
|
19
29
|
#
|
20
30
|
class Command
|
21
31
|
# Handle the parameters passed to fix command from the console.
|
@@ -23,7 +33,7 @@ module Fix
|
|
23
33
|
# @api public
|
24
34
|
#
|
25
35
|
# @example Let's test a duck's spec!
|
26
|
-
# run('duck_fix.rb', '
|
36
|
+
# run('duck_fix.rb', '--warnings')
|
27
37
|
#
|
28
38
|
# @param args [Array] A list of files and options.
|
29
39
|
#
|
@@ -43,7 +53,7 @@ module Fix
|
|
43
53
|
str += ' --prefix' if config.fetch(:prefix)
|
44
54
|
str += ' --suffix' if config.fetch(:suffix)
|
45
55
|
|
46
|
-
puts
|
56
|
+
puts file_paths.to_a.join(' ') + ' ' + str + "\e[22m"
|
47
57
|
|
48
58
|
status = true
|
49
59
|
|
@@ -109,7 +119,13 @@ module Fix
|
|
109
119
|
end
|
110
120
|
end
|
111
121
|
|
122
|
+
%w(~ .).each do |c|
|
123
|
+
config_path = File.join(File.expand_path(c), COMMAND_LINE_OPTIONS_FILE)
|
124
|
+
opt_parser.load(config_path)
|
125
|
+
end
|
126
|
+
|
112
127
|
opt_parser.parse!(args)
|
128
|
+
|
113
129
|
options
|
114
130
|
end
|
115
131
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fix-command
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cyril Wack
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
dzJvWzQ1+dJU6WQv75E9ddSkaQrK3nhdgQVu+/wgvGSrsMvOGNz+LXaSDxQqZuwX
|
31
31
|
0KNQFuIukfrdk8URwRnHoAnvx4U93iUw
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2015-12-
|
33
|
+
date: 2015-12-29 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: fix
|
@@ -156,6 +156,7 @@ files:
|
|
156
156
|
- checksum/fix-command-0.1.1.gem.sha512
|
157
157
|
- checksum/fix-command-0.1.2.gem.sha512
|
158
158
|
- checksum/fix-command-0.1.3.gem.sha512
|
159
|
+
- checksum/fix-command-0.2.0.gem.sha512
|
159
160
|
- fix-command.gemspec
|
160
161
|
- lib/fix/command.rb
|
161
162
|
- pkg_checksum
|
metadata.gz.sig
CHANGED
@@ -1,3 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
Z�]ǰ��o�
|
1
|
+
+��(�]����p�����F�{~-.f{�{>��0>�gP��7���w�
|
2
|
+
�@P{��K�Q:vW6����xܐ��~�9�8�m�#��?P�R�ŹZ��1�W*��
|