flay 2.3.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data.tar.gz.sig +0 -0
- data/History.txt +6 -0
- data/README.txt +1 -0
- data/lib/flay.rb +2 -1
- data/test/test_flay.rb +20 -1
- metadata +4 -4
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
Binary file
|
data/History.txt
CHANGED
data/README.txt
CHANGED
@@ -29,6 +29,7 @@ braces vs do/end, etc are all ignored. Making this totally rad.
|
|
29
29
|
|
30
30
|
== KNOWN EXTENSIONS:
|
31
31
|
|
32
|
+
* flay-actionpack :: Use Rails ERB handler.
|
32
33
|
* flay-haml :: Flay your HAML source.
|
33
34
|
* flay-persistence :: Persist results across runs. Great for multi-project analysis.
|
34
35
|
|
data/lib/flay.rb
CHANGED
@@ -15,7 +15,7 @@ class File
|
|
15
15
|
end
|
16
16
|
|
17
17
|
class Flay
|
18
|
-
VERSION = "2.3.
|
18
|
+
VERSION = "2.3.1" # :nodoc:
|
19
19
|
|
20
20
|
##
|
21
21
|
# Returns the default options.
|
@@ -371,6 +371,7 @@ class Flay
|
|
371
371
|
n = subdata.find_index { |s| s !~ /^#/ }
|
372
372
|
|
373
373
|
comment, code = subdata[0..n-1], subdata[n..-1]
|
374
|
+
comment = [] if n == 0
|
374
375
|
|
375
376
|
comments << comment
|
376
377
|
codes << code
|
data/test/test_flay.rb
CHANGED
@@ -5,7 +5,7 @@ require 'flay'
|
|
5
5
|
|
6
6
|
$: << "../../sexp_processor/dev/lib"
|
7
7
|
|
8
|
-
class TestSexp <
|
8
|
+
class TestSexp < Minitest::Test
|
9
9
|
def setup
|
10
10
|
# a(1) { |c| d }
|
11
11
|
@s = s(:iter,
|
@@ -314,6 +314,25 @@ class TestSexp < MiniTest::Unit::TestCase
|
|
314
314
|
assert_equal exp, flay.n_way_diff(*dog_and_cat).gsub(/^ {3}$/, "")
|
315
315
|
end
|
316
316
|
|
317
|
+
def test_n_way_diff_no_comments
|
318
|
+
dog_and_cat = ["class Dog\n def x\n return \"Hello\"\n end\nend",
|
319
|
+
"class Cat\n def y\n return \"Hello\"\n end\nend"]
|
320
|
+
|
321
|
+
flay = Flay.new
|
322
|
+
|
323
|
+
exp = <<-EOM.gsub(/\d+/, "N").gsub(/^ {6}/, "").chomp
|
324
|
+
A: class Dog
|
325
|
+
B: class Cat
|
326
|
+
A: def x
|
327
|
+
B: def y
|
328
|
+
return \"Hello\"
|
329
|
+
end
|
330
|
+
end
|
331
|
+
EOM
|
332
|
+
|
333
|
+
assert_equal exp, flay.n_way_diff(*dog_and_cat).gsub(/^ {3}$/, "")
|
334
|
+
end
|
335
|
+
|
317
336
|
def test_split_and_group
|
318
337
|
flay = Flay.new
|
319
338
|
|
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:
|
4
|
+
hash: 1
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 2.3.
|
9
|
+
- 1
|
10
|
+
version: 2.3.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ryan Davis
|
@@ -36,7 +36,7 @@ cert_chain:
|
|
36
36
|
FBHgymkyj/AOSqKRIpXPhjC6
|
37
37
|
-----END CERTIFICATE-----
|
38
38
|
|
39
|
-
date: 2013-
|
39
|
+
date: 2013-07-11 00:00:00 Z
|
40
40
|
dependencies:
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: sexp_processor
|
metadata.gz.sig
CHANGED
Binary file
|