pronto-flay 0.4.0 → 0.4.1

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: a166c79d989f287ad0e70a7415601bbdcdaff660
4
- data.tar.gz: 4fdfe5b267c1cf94ffa3ec67da6ecf984282d440
3
+ metadata.gz: b01591138c720cdf6fe98d3d7693e1d912c4470b
4
+ data.tar.gz: 079f9f61e54694c7e140810a463188da0afd11a7
5
5
  SHA512:
6
- metadata.gz: eb6b9b391ea866a223d120b2858f4c509cc227d0c86dc37ea2b247b79bef84120e17695de9d2e9b10ccbf48e7d5463909c21b026778ceac23b4b9c409eb666a0
7
- data.tar.gz: cd8c740acc20bc1e0ea2b9c59a203422a4e8b3711c72421d9c62242f2273c08f0e08e2c25c6757e9efd161daa47552c8aad84ce20558d39119b5f87737882d8d
6
+ metadata.gz: d4161f215a175b219aacf54fe127b7a69e954203ce5d70584f34414917468d662a03eb4cce093c72cd863d2fb6d56a68285886073760641e3a2d9a37c1cb7ac2
7
+ data.tar.gz: 25ce93a6c56ba5eba295dfa8abc54548979d685388c9aa2a3ba2372aea672dfae932a23ee39af336beeda9752bdc4f4fb99657aa17839d584b5d987ccc807e32
@@ -1,5 +1,5 @@
1
1
  module Pronto
2
2
  module FlayVersion
3
- VERSION = '0.4.0'
3
+ VERSION = '0.4.1'
4
4
  end
5
5
  end
data/lib/pronto/flay.rb CHANGED
@@ -11,9 +11,9 @@ module Pronto
11
11
  return [] unless patches
12
12
 
13
13
  ruby_patches = patches.select { |patch| patch.additions > 0 }
14
- .select { |patch| ruby_file?(patch.new_file_full_path) }
14
+ .select { |patch| ruby_file?(patch.new_file_full_path) }
15
15
 
16
- files = ruby_patches.map { |patch| File.new(patch.new_file_full_path) }
16
+ files = ruby_patches.map(&:new_file_full_path)
17
17
 
18
18
  if files.any?
19
19
  @flay.process(*files)
@@ -38,13 +38,14 @@ module Pronto
38
38
 
39
39
  def patch_for_node(ruby_patches, node)
40
40
  ruby_patches.find do |patch|
41
- patch.new_file_full_path.to_s == node.file.path
41
+ patch.new_file_full_path == node.file
42
42
  end
43
43
  end
44
44
 
45
45
  def new_message(line, node)
46
+ path = line.patch.delta.new_file[:path]
46
47
  hash = node.structural_hash
47
- Message.new(line.patch.delta.new_file[:path], line, level(hash), message(hash))
48
+ Message.new(path, line, level(hash), message(hash))
48
49
  end
49
50
 
50
51
  def level(hash)
@@ -58,7 +59,7 @@ module Pronto
58
59
  def message(hash)
59
60
  match = same?(hash) ? 'Identical' : 'Similar'
60
61
  location = nodes_for(hash).map do |node|
61
- "#{File.basename(node.file.path)}:#{node.line}"
62
+ "#{File.basename(node.file)}:#{node.line}"
62
63
  end
63
64
 
64
65
  "#{match} code found in #{location.join(', ')}"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pronto-flay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mindaugas Mozūras
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-26 00:00:00.000000000 Z
11
+ date: 2015-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pronto
@@ -110,9 +110,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
110
  version: 1.3.6
111
111
  requirements: []
112
112
  rubyforge_project:
113
- rubygems_version: 2.2.2
113
+ rubygems_version: 2.4.5
114
114
  signing_key:
115
115
  specification_version: 4
116
116
  summary: Pronto runner for Flay, structural similarities analyzer
117
117
  test_files: []
118
- has_rdoc: