xrbp 0.2.6 → 0.2.7

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
  SHA256:
3
- metadata.gz: 7cb7731c4dfc85c9e12a7c35c715b7a28395c359ec0326462b8e2ec0fbd6d855
4
- data.tar.gz: 82c20e0f661da1898bf6bd3e7d46525e2526164911e0577a7afe8d39fe00a4c4
3
+ metadata.gz: 5f48abc4b153d8aa5a31d794dc7c0ed9a8e86645fa47cd40fe8e7fdfa40a089c
4
+ data.tar.gz: ad79925c9fa4c3b3ac7383d70361ce702d48b0cd3569224a66c96f6c7e401fd7
5
5
  SHA512:
6
- metadata.gz: 931fd9af61649eb6463d78327f195aae74be46aa557287d72fb6ed7513df6e7fe7e61ed86846d752d116f404deea9922c923347b7d0cfb61183d0cb786a15432
7
- data.tar.gz: 17ebc6c52070b89b551cd836ecb224f56b493dc4b5ce5383cd14eeb1af9e875e623322f6ff69dcfb6314a156bb88c7d8de9bdc3093bd1eb11d1fcaf1cc6c2e66
6
+ metadata.gz: 8e328dd52b245837f57da0b4c2bf1739c252f6ae9b226c2d7c95cdeac237bc31d9640082cdcdc0b880853a3bb282ce2c9c11d8a1ec7c7e7c63cb35544c66d20c
7
+ data.tar.gz: 9e5f4fa85c9a019ebdc651f4c6cd47f5db8eed98b61ab46123900bdd6fe08d1ac41088c49d7fdd9eb87460f4f830bb47030459a1d29a3c76881f0937dee7bf26
@@ -0,0 +1,8 @@
1
+ $: << File.expand_path('../../lib', __FILE__)
2
+ require 'xrbp'
3
+
4
+ ws = XRBP::WebSocket::Connection.new "wss://s2.ripple.com:443"
5
+ ws.add_plugin :command_dispatcher
6
+ ws.connect
7
+
8
+ puts XRBP::Model::Node.new.server_info(:connection => ws)
@@ -127,6 +127,17 @@ module XRBP
127
127
  connection.rsleep(delay) unless connection.force_quit?
128
128
  end
129
129
  end
130
+
131
+ # Retrieve server info via WebSocket::Connection
132
+ def server_info(opts={}, &bl)
133
+ set_opts(opts)
134
+ connection.cmd(WebSocket::Cmds::ServerInfo.new, &bl)
135
+ end
136
+
137
+ # Retrieve ledgers which this server has
138
+ def complete_ledgers(opts={})
139
+ server_info(opts)["result"]["info"]["complete_ledgers"].split("-").collect { |l| l.to_i }
140
+ end
130
141
  end
131
142
  end # module Model
132
143
  end # module XRBP
@@ -1,3 +1,3 @@
1
1
  module XRBP
2
- VERSION = '0.2.6'
2
+ VERSION = '0.2.7'
3
3
  end # module XRBP
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xrbp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dev Null Productions
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-06 00:00:00.000000000 Z
11
+ date: 2020-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -197,6 +197,7 @@ files:
197
197
  - examples/paginate.rb
198
198
  - examples/prioritized.rb
199
199
  - examples/round_robin.rb
200
+ - examples/server_info.rb
200
201
  - examples/username.rb
201
202
  - examples/validator.rb
202
203
  - examples/websocket.rb