flay 1.4.2 → 1.4.3

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,9 @@
1
+ === 1.4.3 / 2011-08-10
2
+
3
+ * 1 bug fix:
4
+
5
+ * Fixes for 1.9 with --diff. (mmullis)
6
+
1
7
  === 1.4.2 / 2011-02-18
2
8
 
3
9
  * 2 bug fixes:
data/README.txt CHANGED
@@ -1,7 +1,8 @@
1
1
  = flay
2
2
 
3
- * http://ruby.sadi.st/
4
- * http://rubyforge.org/projects/seattlerb
3
+ home :: http://ruby.sadi.st/
4
+ repo :: https://github.com/seattlerb/flay
5
+ rdoc :: http://seattlerb.rubyforge.org/flay
5
6
 
6
7
  == DESCRIPTION:
7
8
 
@@ -80,7 +81,7 @@ braces vs do/end, etc are all ignored. Making this totally rad.
80
81
 
81
82
  (The MIT License)
82
83
 
83
- Copyright (c) 2008-2009 Ryan Davis, Seattle.rb
84
+ Copyright (c) Ryan Davis, Seattle.rb
84
85
 
85
86
  Permission is hereby granted, free of charge, to any person obtaining
86
87
  a copy of this software and associated documentation files (the
data/Rakefile CHANGED
@@ -4,7 +4,8 @@ require 'rubygems'
4
4
  require 'hoe'
5
5
 
6
6
  Hoe::add_include_dirs("../../sexp_processor/dev/lib",
7
- "../../ruby_parser/dev/lib")
7
+ "../../ruby_parser/dev/lib",
8
+ "../../ruby2ruby/dev/lib")
8
9
 
9
10
  Hoe.plugin :seattlerb
10
11
 
@@ -1,15 +1,12 @@
1
1
  #!/usr/bin/env ruby -w
2
2
 
3
- $: << "../../ruby_parser/dev/lib"
4
- $: << "../../ruby2ruby/dev/lib"
5
-
6
3
  require 'optparse'
7
4
  require 'rubygems'
8
5
  require 'sexp_processor'
9
6
  require 'ruby_parser'
10
7
 
11
8
  class Flay
12
- VERSION = '1.4.2'
9
+ VERSION = '1.4.3'
13
10
 
14
11
  def self.default_options
15
12
  {
@@ -197,7 +194,7 @@ class Flay
197
194
 
198
195
  def n_way_diff *data
199
196
  data.each_with_index do |s, i|
200
- c = (?A + i).chr
197
+ c = (?A.ord + i).chr
201
198
  s.group = c
202
199
  end
203
200
 
@@ -274,7 +271,7 @@ class Flay
274
271
 
275
272
  nodes.each_with_index do |x, i|
276
273
  if option[:diff] then
277
- c = (?A + i).chr
274
+ c = (?A.ord + i).chr
278
275
  puts " #{c}: #{x.file}:#{x.line}"
279
276
  else
280
277
  puts " #{x.file}:#{x.line}"
@@ -109,4 +109,59 @@ class TestSexp < MiniTest::Unit::TestCase
109
109
 
110
110
  assert flay.hashes.empty?
111
111
  end
112
+
113
+ def test_report
114
+ # make sure we run through options parser
115
+ $*.clear
116
+ $* << "-d"
117
+ $* << "--mass=1"
118
+ $* << "-v"
119
+
120
+ opts = nil
121
+ capture_io do # ignored
122
+ opts = Flay.parse_options
123
+ end
124
+
125
+ flay = Flay.new opts
126
+
127
+ s = RubyParser.new.process <<-RUBY
128
+ class Dog
129
+ def x
130
+ return "Hello"
131
+ end
132
+ end
133
+ class Cat
134
+ def y
135
+ return "Hello"
136
+ end
137
+ end
138
+ RUBY
139
+
140
+ flay.process_sexp s
141
+ flay.analyze
142
+
143
+ out, err = capture_io do
144
+ flay.report nil
145
+ end
146
+
147
+ exp = <<-END.gsub(/\d+/, "N").gsub(/^ {6}/, "")
148
+ Total score (lower is better) = 16
149
+
150
+
151
+ 1) Similar code found in :class (mass = 16)
152
+ A: (string):1
153
+ B: (string):6
154
+
155
+ A: class Dog
156
+ B: class Cat
157
+ A: def x
158
+ B: def y
159
+ return \"Hello\"
160
+ end
161
+ end
162
+ END
163
+
164
+ assert_equal '', err
165
+ assert_equal exp, out.gsub(/\d+/, "N")
166
+ end
112
167
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flay
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 4
9
- - 2
10
- version: 1.4.2
9
+ - 3
10
+ version: 1.4.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ryan Davis
@@ -36,8 +36,7 @@ cert_chain:
36
36
  FBHgymkyj/AOSqKRIpXPhjC6
37
37
  -----END CERTIFICATE-----
38
38
 
39
- date: 2011-02-18 00:00:00 -08:00
40
- default_executable:
39
+ date: 2011-08-10 00:00:00 Z
41
40
  dependencies:
42
41
  - !ruby/object:Gem::Dependency
43
42
  name: sexp_processor
@@ -77,12 +76,12 @@ dependencies:
77
76
  requirements:
78
77
  - - ">="
79
78
  - !ruby/object:Gem::Version
80
- hash: 11
79
+ hash: 1
81
80
  segments:
82
81
  - 2
83
- - 0
84
- - 2
85
- version: 2.0.2
82
+ - 3
83
+ - 1
84
+ version: 2.3.1
86
85
  type: :development
87
86
  version_requirements: *id003
88
87
  - !ruby/object:Gem::Dependency
@@ -91,14 +90,13 @@ dependencies:
91
90
  requirement: &id004 !ruby/object:Gem::Requirement
92
91
  none: false
93
92
  requirements:
94
- - - ">="
93
+ - - ~>
95
94
  - !ruby/object:Gem::Version
96
- hash: 41
95
+ hash: 23
97
96
  segments:
98
97
  - 2
99
- - 9
100
- - 1
101
- version: 2.9.1
98
+ - 10
99
+ version: "2.10"
102
100
  type: :development
103
101
  version_requirements: *id004
104
102
  description: |-
@@ -127,7 +125,6 @@ files:
127
125
  - lib/gauntlet_flay.rb
128
126
  - test/test_flay.rb
129
127
  - .gemtest
130
- has_rdoc: true
131
128
  homepage: http://ruby.sadi.st/
132
129
  licenses: []
133
130
 
@@ -158,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
155
  requirements: []
159
156
 
160
157
  rubyforge_project: seattlerb
161
- rubygems_version: 1.4.2
158
+ rubygems_version: 1.8.2
162
159
  signing_key:
163
160
  specification_version: 3
164
161
  summary: Flay analyzes code for structural similarities
metadata.gz.sig CHANGED
Binary file