rubocopfmt 0.1.0.beta16 → 0.1.0.beta17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +9 -9
- data/README.md +1 -1
- data/lib/rubocopfmt/cli_options.rb +3 -3
- data/lib/rubocopfmt/formatter.rb +2 -2
- data/lib/rubocopfmt/options.rb +1 -1
- data/lib/rubocopfmt/rubocop_version.rb +1 -1
- data/lib/rubocopfmt/source.rb +4 -16
- data/lib/rubocopfmt/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 741853d8ac8b5ff03cfc42cf681eca56ee4fec96
|
4
|
+
data.tar.gz: b8983669bace494126505dcbd9a6de06321cc16e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6e5ac1cb2dfcc7ed3dd7e1a857424c007db2fd8fef1479fb871a363d40007ccef296ae74a7eca77ec25e5f35a264f2e23f53112cbe253132a6bcfcd0ea22b8b
|
7
|
+
data.tar.gz: 2deae605252088243be26fd98d13edaa860cff0785112c9f13aa8c2e5da63c52f12d8cccc0c93e26825edd338206a076589fc58e4eba669c75305e230d86a9d6
|
data/.travis.yml
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
sudo: false
|
2
2
|
language: ruby
|
3
3
|
env:
|
4
|
+
- RUBOCOP_VERSION=0.52.0
|
5
|
+
- RUBOCOP_VERSION=0.51.0
|
6
|
+
- RUBOCOP_VERSION=0.50.0
|
7
|
+
- RUBOCOP_VERSION=0.49.1
|
8
|
+
- RUBOCOP_VERSION=0.49.0
|
9
|
+
- RUBOCOP_VERSION=0.48.1
|
10
|
+
- RUBOCOP_VERSION=0.48.0
|
4
11
|
- RUBOCOP_VERSION=0.47.1
|
5
12
|
- RUBOCOP_VERSION=0.46.0
|
6
13
|
- RUBOCOP_VERSION=0.45.0
|
7
|
-
- RUBOCOP_VERSION=0.44.1
|
8
|
-
- RUBOCOP_VERSION=0.43.0
|
9
|
-
- RUBOCOP_VERSION=0.42.0
|
10
|
-
- RUBOCOP_VERSION=0.41.2
|
11
|
-
- RUBOCOP_VERSION=0.40.0
|
12
|
-
- RUBOCOP_VERSION=0.39.0
|
13
|
-
- RUBOCOP_VERSION=0.38.0
|
14
14
|
rvm:
|
15
|
-
- 2.3.
|
16
|
-
- 2.4.
|
15
|
+
- 2.3.5
|
16
|
+
- 2.4.2
|
17
17
|
gemfile: Gemfile.ci
|
18
18
|
before_install:
|
19
19
|
- gem install bundler
|
data/README.md
CHANGED
@@ -25,7 +25,7 @@ Options:
|
|
25
25
|
-l, --list List files whose formatting is incorrect
|
26
26
|
-w, --write Write result to (source) file instead of STDOUT
|
27
27
|
-i, --interactive Disable cops that cause confusion in text editors
|
28
|
-
-
|
28
|
+
-F, --src-file=<s> Specify filename when providing input via STDIN
|
29
29
|
-D, --diff-format=<s> Display diffs using format: unified, rcs, context
|
30
30
|
|
31
31
|
-v, --version Print version and exit
|
@@ -47,8 +47,8 @@ module RuboCopFMT
|
|
47
47
|
opt :list, 'List files whose formatting is incorrect'
|
48
48
|
opt :write, 'Write result to (source) file instead of STDOUT'
|
49
49
|
opt :interactive, 'Disable cops that cause confusion in text editors'
|
50
|
-
opt :
|
51
|
-
short: '
|
50
|
+
opt :src_file, 'Specify filename when providing input via STDIN',
|
51
|
+
short: 'F', type: :string
|
52
52
|
opt :diff_format, 'Display diffs using format: unified, rcs, context',
|
53
53
|
short: 'D', type: :string
|
54
54
|
banner ''
|
@@ -72,7 +72,7 @@ module RuboCopFMT
|
|
72
72
|
end
|
73
73
|
|
74
74
|
def validate_paths(opts)
|
75
|
-
[
|
75
|
+
%i[list write].each do |opt|
|
76
76
|
if opts[opt] && opts[:paths].empty?
|
77
77
|
parser.die(opt, 'requires one or more paths to be specified')
|
78
78
|
end
|
data/lib/rubocopfmt/formatter.rb
CHANGED
@@ -28,14 +28,14 @@ module RuboCopFMT
|
|
28
28
|
private
|
29
29
|
|
30
30
|
def new_source_from_str(str)
|
31
|
-
Source.new(str,
|
31
|
+
Source.new(str, options.src_file)
|
32
32
|
end
|
33
33
|
|
34
34
|
def new_source_from_file(path)
|
35
35
|
raise FileNotFound, "File not found: #{path}" unless File.exist?(path)
|
36
36
|
|
37
37
|
input = File.read(path, mode: 'rb')
|
38
|
-
Source.new(input, path, options.
|
38
|
+
Source.new(input, path, options.src_file)
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
data/lib/rubocopfmt/options.rb
CHANGED
data/lib/rubocopfmt/source.rb
CHANGED
@@ -5,18 +5,18 @@ module RuboCopFMT
|
|
5
5
|
attr_reader :path
|
6
6
|
attr_reader :input
|
7
7
|
attr_reader :output
|
8
|
-
attr_reader :
|
8
|
+
attr_reader :src_path
|
9
9
|
|
10
|
-
def initialize(input, path = nil,
|
10
|
+
def initialize(input, path = nil, src_path = nil)
|
11
11
|
@input = input
|
12
12
|
@path = path
|
13
|
-
@
|
13
|
+
@src_path = src_path
|
14
14
|
end
|
15
15
|
|
16
16
|
def auto_correct(interactive = false)
|
17
17
|
return unless output.nil?
|
18
18
|
|
19
|
-
@corrector = AutoCorrector.new(input,
|
19
|
+
@corrector = AutoCorrector.new(input, src_path || path)
|
20
20
|
@output = @corrector.correct(interactive)
|
21
21
|
end
|
22
22
|
|
@@ -26,17 +26,5 @@ module RuboCopFMT
|
|
26
26
|
|
27
27
|
@corrected = (@input != @output)
|
28
28
|
end
|
29
|
-
|
30
|
-
private
|
31
|
-
|
32
|
-
def full_path
|
33
|
-
full_path = path || '__fake__.rb'
|
34
|
-
|
35
|
-
if src_dir.nil?
|
36
|
-
full_path
|
37
|
-
else
|
38
|
-
File.join(src_dir, File.basename(full_path))
|
39
|
-
end
|
40
|
-
end
|
41
29
|
end
|
42
30
|
end
|
data/lib/rubocopfmt/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocopfmt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0.
|
4
|
+
version: 0.1.0.beta17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jim Myhrberg
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -81,7 +81,7 @@ dependencies:
|
|
81
81
|
version: 0.44.0
|
82
82
|
- - "<"
|
83
83
|
- !ruby/object:Gem::Version
|
84
|
-
version: '0.
|
84
|
+
version: '0.53'
|
85
85
|
type: :runtime
|
86
86
|
prerelease: false
|
87
87
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -97,7 +97,7 @@ dependencies:
|
|
97
97
|
version: 0.44.0
|
98
98
|
- - "<"
|
99
99
|
- !ruby/object:Gem::Version
|
100
|
-
version: '0.
|
100
|
+
version: '0.53'
|
101
101
|
- !ruby/object:Gem::Dependency
|
102
102
|
name: trollop
|
103
103
|
requirement: !ruby/object:Gem::Requirement
|
@@ -178,7 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
178
178
|
version: 1.3.1
|
179
179
|
requirements: []
|
180
180
|
rubyforge_project:
|
181
|
-
rubygems_version: 2.6.
|
181
|
+
rubygems_version: 2.6.13
|
182
182
|
signing_key:
|
183
183
|
specification_version: 4
|
184
184
|
summary: Easy formatting of Ruby code using RuboCop
|