fix-command 0.2.0 → 0.3.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: 5ede6b0feb91e3076145dd4a02dcfe7357dd3fcc
4
- data.tar.gz: d17466d075d293c0cb062128dc6b52a54bd65168
3
+ metadata.gz: 511ce87b9eee241bc7535bcb5d2ebb90983aea20
4
+ data.tar.gz: 08be1bd3e8345164d0bf5c41a15172b2d0d696e7
5
5
  SHA512:
6
- metadata.gz: 40d81c67b92370a6dc8f9f4b86c4b60a3945d46a40757a0942f801b4bb4d66ae334e79cc3d026b49a2912a4706b028ad1f95051e6a59a91bd8e2e1529daef88f
7
- data.tar.gz: ba2813a50c308756f28d8fd1593ea8258a3c208a3df7a91c0d20d39e88239385c66373bb31e9bbc17069d562c9829341313ce21f1a4226d4b2566fb6de5b0451
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
@@ -9,7 +9,6 @@ rvm:
9
9
  - 2.0
10
10
  - 2.1
11
11
  - 2.2
12
- - 2.3
13
12
  - ruby-head
14
13
  - jruby
15
14
  - jruby-head
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 -w
65
- > fix --warnings /Users/bob/code/duck_fix.rb
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.2.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', '-w')
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', '-w')
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', '-w')
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 str + ' ' + file_paths.to_a.join(' ') + "\e[22m"
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.2.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-28 00:00:00.000000000 Z
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
- ,,{���¤o������VhZ�[��Q«��ߧ����=��=�F;�D����RG�ʁ�
2
- N�ޏ �8��� ��I+%]8z�KB�ݡYz]D���CZ�P��q_`22�˶l���$>�Q ?�9�J��<��m&��W^��Yl,G> �Z��|�~�@#���;�׋A�/Mk���] X�9E�y�6ݨ0�~��D|OM�A>�ϰv ^�7j�RĢ��!�M��} `J?�(S
3
- Z�]ǰ��o�
1
+ +��(�]����p����󧾧�F�{~-.f{�{>��0>�gP��7���w
2
+ �@P{��K�Q:vW6��� xܐ��~�9�8�m�#��?PR�ŹZ��1W*��