testhelper 0.2.1 → 1.0.0
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.
- checksums.yaml +4 -4
- data/lib/file_line.rb +9 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dac353f37c90b3bb54f8174199ef2fb95d852b9c
|
|
4
|
+
data.tar.gz: 27edcba0c31d12ad18feb3fee875d0e3478bdd10
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dd62cff87c4ed214518af42cf0c760fad67119ba437be3a97d603ec67cef5f05a7f85ad29529c98e461a629ee3fe400456cd077864fbfc8a47a67d94743572f4
|
|
7
|
+
data.tar.gz: 643ee3bcd6b595b956880b18a1b7df833b49a8af2835e2d3b96311f1d90bdb5db85fba93d1b3ec01656a14b59462a9e14bb954064e55c99ba3621e5e6c0d4590
|
data/lib/file_line.rb
CHANGED
|
@@ -10,7 +10,12 @@ end
|
|
|
10
10
|
module SourceFile
|
|
11
11
|
def self.split_file_name_and_no(location_str)
|
|
12
12
|
source_infos = location_str.split(":")
|
|
13
|
-
|
|
13
|
+
if source_infos.size == 4
|
|
14
|
+
# for windows path
|
|
15
|
+
[source_infos[0]+":"+source_infos[1], source_infos[2].to_i]
|
|
16
|
+
else
|
|
17
|
+
[source_infos[0], source_infos[1].to_i]
|
|
18
|
+
end
|
|
14
19
|
end
|
|
15
20
|
|
|
16
21
|
def self.analyze_variable_name(the_line, the_callee)
|
|
@@ -41,6 +46,9 @@ if __FILE__ == $0
|
|
|
41
46
|
location_str = "/Users/colin/work/testhelper/lib/testhelper.rb:55:in `<main>'"
|
|
42
47
|
SourceFile.split_file_name_and_no(location_str).must_equal(
|
|
43
48
|
["/Users/colin/work/testhelper/lib/testhelper.rb", 55])
|
|
49
|
+
location_str = "C:/Users/colin/work/testhelper/lib/testhelper.rb:55:in `<main>'"
|
|
50
|
+
SourceFile.split_file_name_and_no(location_str).must_equal(
|
|
51
|
+
["C:/Users/colin/work/testhelper/lib/testhelper.rb", 55])
|
|
44
52
|
end
|
|
45
53
|
it "analyze variable name from a line of source" do
|
|
46
54
|
the_line = " mm.ppt()\n"
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: testhelper
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 1.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Colin Ji
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2015-01-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Some print helper methods like pt, ptl, ppt, pptl, flag_test for testing.
|
|
14
14
|
email: jichen3000@gmail.com
|