testhelper 1.0.0 → 1.1.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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/file_line.rb +13 -0
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dac353f37c90b3bb54f8174199ef2fb95d852b9c
4
- data.tar.gz: 27edcba0c31d12ad18feb3fee875d0e3478bdd10
3
+ metadata.gz: 91cc0f760cea80a25646e000ac11a95056d4c6e2
4
+ data.tar.gz: bdfe8efd5174858af2c39fd67ad54a0d31a245f2
5
5
  SHA512:
6
- metadata.gz: dd62cff87c4ed214518af42cf0c760fad67119ba437be3a97d603ec67cef5f05a7f85ad29529c98e461a629ee3fe400456cd077864fbfc8a47a67d94743572f4
7
- data.tar.gz: 643ee3bcd6b595b956880b18a1b7df833b49a8af2835e2d3b96311f1d90bdb5db85fba93d1b3ec01656a14b59462a9e14bb954064e55c99ba3621e5e6c0d4590
6
+ metadata.gz: 7c306457ece7553c519058735fa83de452dc017bbc54731b9d4439b45c85d615cf29f4a53f4d880478fd687455df5454382d3c92ae593dc27944b88d7be08c4e
7
+ data.tar.gz: 3b096f6f4011b5304e59d7bccf90490bfd9dd75dc69d94cc56c7ec71a34da46e820d2d7d7365201848615013b1dd6947fb0b60895a3bbf04ba1d3b5f366ab077
@@ -1,5 +1,18 @@
1
+ # for pry
2
+ # Pry.current_line
3
+ # Pry::VERSION
4
+ # puts "Pry.history.to_a[-1]:", Pry.history.to_a[-1]
5
+ # puts "Pry.current_line:", Pry.current_line
6
+ # puts "Pry.current.eval_string:", Pry.current.eval_string
7
+ # puts "Pry.line_buffer.last:", Pry.line_buffer.last
8
+ # puts "Pry.line_buffer:", Pry.line_buffer
9
+
1
10
  module FileLine
2
11
  def self.get(file_path, line_no)
12
+ # only test for Pry::VERSION == 0.10.0
13
+ if file_path == "(pry)"
14
+ return Pry.history.to_a[-1]
15
+ end
3
16
  open(file_path) do |f|
4
17
  # tap depend on ruby > 1.9
5
18
  return f.each_line.tap{|enum| (line_no-1).times{enum.next}}.next
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: 1.0.0
4
+ version: 1.1.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: 2015-01-23 00:00:00.000000000 Z
11
+ date: 2015-04-15 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