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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a263d4d05fe8c56c8e7cb4f669091daec4cf8413
4
- data.tar.gz: 99880a5ce7dbf25b8fcf9dd1ddff4a678de63bc2
3
+ metadata.gz: 741853d8ac8b5ff03cfc42cf681eca56ee4fec96
4
+ data.tar.gz: b8983669bace494126505dcbd9a6de06321cc16e
5
5
  SHA512:
6
- metadata.gz: 1ada94b886503c59847363f93917bbdda01eb7dba8891ca3c34b4d25373ad424d04fde186a9b66d21a90973b32953fa035572c47398826e68aed40cadd92a221
7
- data.tar.gz: 8c7b93e4e7d4a26be594869da9cde91fa1cf0f0c43284b25dffcf587a491671dcccd7a291b39b09659b97421e0c899f9928d8c295324f23ee08d9429db9516b2
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.3
16
- - 2.4.0
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
- -S, --src-dir=<s> Operate as if code resides in specified directory
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 :src_dir, 'Operate as if code resides in specified directory',
51
- short: 'S', type: :string
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
- [:list, :write].each do |opt|
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
@@ -28,14 +28,14 @@ module RuboCopFMT
28
28
  private
29
29
 
30
30
  def new_source_from_str(str)
31
- Source.new(str, nil, options.src_dir)
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.src_dir)
38
+ Source.new(input, path, options.src_file)
39
39
  end
40
40
  end
41
41
  end
@@ -1,7 +1,7 @@
1
1
  module RuboCopFMT
2
2
  class Options
3
3
  attr_accessor :input
4
- attr_accessor :src_dir
4
+ attr_accessor :src_file
5
5
  attr_accessor :diff_format
6
6
 
7
7
  def paths
@@ -10,6 +10,6 @@ module RuboCopFMT
10
10
  '!= 0.44.0',
11
11
 
12
12
  # Restrict to latest version tested.
13
- '< 0.48'
13
+ '< 0.53'
14
14
  ].freeze
15
15
  end
@@ -5,18 +5,18 @@ module RuboCopFMT
5
5
  attr_reader :path
6
6
  attr_reader :input
7
7
  attr_reader :output
8
- attr_reader :src_dir
8
+ attr_reader :src_path
9
9
 
10
- def initialize(input, path = nil, src_dir = nil)
10
+ def initialize(input, path = nil, src_path = nil)
11
11
  @input = input
12
12
  @path = path
13
- @src_dir = src_dir
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, full_path)
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
@@ -1,3 +1,3 @@
1
1
  module RuboCopFMT
2
- VERSION = '0.1.0.beta16'.freeze
2
+ VERSION = '0.1.0.beta17'.freeze
3
3
  end
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.beta16
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-02-25 00:00:00.000000000 Z
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.48'
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.48'
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.8
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