r2pipe 0.1.1 → 0.1.2

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: 8ce5f89b1bc3e013db9941e65e36df6f6f5f7f94
4
- data.tar.gz: a5645b2ddf6473ca612a0a6c7d688908421f7e66
3
+ metadata.gz: 3cd0ed01cd73d94e861c4df971e7971faeb17b94
4
+ data.tar.gz: 5e8a47c903624fa129119d3de4a1b9583d5b1d52
5
5
  SHA512:
6
- metadata.gz: b0abbcb6c2111d9961970abb398cef777961fe6ee1a782c2558ebf2440051ce361ba0885fa315cefe7cb86ac5941bc56c2a07f31b0c600e9b505cbd3f900a0d5
7
- data.tar.gz: dda0e8fda03192278f1516ad08a2d204ef02555f843bff1ad41e16a52cb932531b8c4cb56348d16d80b0e2de78228599ef45dc932969624bcc094a79721af34a
6
+ metadata.gz: 07189412b734239a5da651065dd5d3e906ac580f0daffe98222ce942d61cbc132ea40c622fe20ee9b076b44c744c3f2322b10f2c4f8fc9df3a174148800c4867
7
+ data.tar.gz: 8ea3c34421fd1c87c11a718b2e689f5108b7865faf12eb81703f3d45afc311ca0d9b6d0fa292ed6a733c66fcca0d26c6bfcbe9e88e63dce7d740f4f69afbd577
data/README.md CHANGED
@@ -40,6 +40,7 @@ make sure that you have [radare2](https://github.com/radare/radare2) in your pat
40
40
  use like this
41
41
 
42
42
  ```ruby
43
+ require 'r2pipe'
43
44
  puts 'r2pipe ruby api demo'
44
45
  puts '===================='
45
46
  r2p = R2Pipe.new '/bin/ls'
@@ -3,35 +3,33 @@ require 'pty'
3
3
  require 'json'
4
4
  require 'shellwords'
5
5
 
6
- module R2Pipe
7
- # R2Pipe is an easy way to communicate with an r2 core through ruby
8
- class R2Pipe
9
- def initialize(file)
10
- @file = file
11
- exec = "r2 -q0 #{Shellwords.shellescape file} 2>/dev/null"
12
- PTY.spawn(exec) do |read, write, pid|
13
- @read = read
14
- @write = write
15
- @pid = pid
16
- @read.gets("\0")
17
- end
6
+ # R2Pipe is an easy way to communicate with an r2 core through ruby
7
+ class R2Pipe
8
+ def initialize(file)
9
+ @file = file
10
+ exec = "r2 -q0 #{Shellwords.shellescape file} 2>/dev/null"
11
+ PTY.spawn(exec) do |read, write, pid|
12
+ @read = read
13
+ @write = write
14
+ @pid = pid
15
+ @read.gets("\0")
18
16
  end
17
+ end
19
18
 
20
- # runs a command on the radare2 core
21
- def cmd(str)
22
- @write.print "#{str}\n"
23
- @read.gets("\0")[0..-2]
24
- end
19
+ # runs a command on the radare2 core
20
+ def cmd(str)
21
+ @write.print "#{str}\n"
22
+ @read.gets("\0")[0..-2]
23
+ end
25
24
 
26
- # closes the radare2 core and quits
27
- def quit
28
- cmd('q!')
29
- ::Process.wait @pid
30
- end
25
+ # closes the radare2 core and quits
26
+ def quit
27
+ cmd('q!')
28
+ ::Process.wait @pid
29
+ end
31
30
 
32
- # returns a parsed json string
33
- def json(str)
34
- JSON.parse str.sub("\n", '').sub("\r", '')
35
- end
31
+ # returns a parsed json string
32
+ def json(str)
33
+ JSON.parse str.sub("\n", '').sub("\r", '')
36
34
  end
37
35
  end
@@ -1,3 +1,3 @@
1
1
  module R2pipe
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: r2pipe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeffrey Crowell
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2015-04-22 00:00:00.000000000 Z
12
+ date: 2015-04-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler