rippler 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -29,7 +29,7 @@ module Rippler
29
29
  end
30
30
 
31
31
  def name
32
- if @name && @name =~ /X\.\d*/
32
+ if @name && @name =~ /^X\.\d+/
33
33
  "X.#{@address}"
34
34
  else
35
35
  @name
@@ -106,12 +106,17 @@ module Rippler
106
106
  icey rDACCWyQyqfuvt9WxCWBZyqgBEMijLseZm
107
107
  thatbluedude rLnCJbgbivWYavZXCdaJ7asHPP31RyXPdk
108
108
  montana rUMub4tmRpNRfognEeTcwW5rEbXwrgZLwd
109
+ montana.1 r3t5JvXF6rChFs4kCFe44a3h4eQdxmPo9a
109
110
  Cookie_Monster raww2VncvFyPvPCY8xnmb1AoqRxUWb6VdN
110
111
  CarlosL rE9hpRfFFqWGxpGYA8bC6GkroRCr4mLLcq
111
112
  greendave rPGpKXPSSxwvkpNXM5BtRRFWYjLP1ibH9D
112
113
  Darkneo rfQdhMCnjWRP1fd1amNQwe49sMmXgR3uYq
113
114
  veteranBtc rUvpjNBcnt4DLKEVA2XyvJi1YGCfp2EPtk
114
115
  templeofshadows rJCCwPsVANVfEgQEB2bsEiaTF86cr9fdw4
116
+ manrus rwM8yMFctE9Ffom1AUjr8epViNwXHPC9aP
117
+ shivansps rMxpLTxf7ocTcBdLHbUEeeuF76Vj3VjYvN
118
+ majinx rMeXvtHE3ZeKAdhMfiFdQC5FJvaNDHzjoK
119
+ vite rwRbCNfQa4gnELgttMfCWFXjUo37BigQbz
115
120
 
116
121
  molecular rpH3zuMch2GrrYX724xGWwbMGwiQ5RbSAU
117
122
  Ente rNEtVs4kNeESF5HbWCDZMYcWwKZ5iKwUEr
@@ -202,7 +207,9 @@ module Rippler
202
207
  Deafboy rUAScykwHVqU2d4rb4twHbpDa7C81p4MSA
203
208
  speeder rNzJ6ikJKXAxAaTPMZCcXr2sFkmg9a2GM9
204
209
  nelisky rLDDq8ZGhCaVBP8MyYTifhCJzgWPQBjwpt
205
- nelisky.1 rKLw2zHgA31nRZN3erfZkfR8uhAkQ8s95P
210
+ nelisky.1 rKLw2zHgA31nRZN3erfZkfR8uhAkQ8s95P
211
+ nelisky.2 rfYv1TXnwgDDK4WQNbFALykYuEBnrR4pDX
212
+ nelisky.3 r4LHsYdeK9CMoidCF5k6ubvzWfhJJUXo6C
206
213
  mrmx rKishCqMiQG6zhFHPjrFhXztLDjZteNmGP
207
214
  drewdtom rsZvcvACPWoTN2Eazzb5radzQX18s3DuK8
208
215
  MadSweeney r4pqusLQxgFNQQNByJMcTvQcYG9v1GpBum
@@ -435,6 +442,19 @@ module Rippler
435
442
  Nevermore123 rDYdoGbQLCch5xSfbZTYnh1ctjTFBNA65h
436
443
  miguel rKSNsGJSQWy2pQcWc8tP5e4n8umCqyj5FY
437
444
  ssbtoday rPuCSJKRBX5iU7gKo6RyxSBUpmSJ3VFmhz
445
+ singpolyma rhKJE9kFPz6DuK4KyL2o8NkCCNPKnSQGRL
446
+ LargePig rNMTQ4xDA671y5uecNsJF2YEETix7XgsZu
447
+ celkaris rUSwcKs9jkkvDcY4mq4fUuUFwixHZtrKbd
448
+ celkaris.TRC rZQGU7Y5ZdLhNWTCV6BKJFcpLijyYVYWX
449
+ Msf r6fb2sHMqR6hzjyknWA2UGsLpK3kqCB3D
450
+ nexus6 rEiNY9Rf25S79UZuEnskTVoV2NidFdCCFu
451
+ matslats rDkJroFBexDTZUiJ83qcLbWwMXswoyznqj
452
+ demcoins rnhGhXqRFwDXk3BZprLGEA6NVQWarroRP4
453
+ justin321 rB6WGbE2XaEmBfisvhNH376NCJZ6v2qZqP
454
+ levino ram4N9y2k2Vtv3g3fWiTep9gkuqBQYG7oX
455
+ levino.1 rpgKc15YqRMKfr517BcKJRC8YrtQs8iuVE
456
+ levino.2 rPFWpTWmMn3BiRkGpBBa1GhKQtw82bwks7
457
+
438
458
 
439
459
  X.FortKnox.1 rhWnKQ79moM7wkk2b9RpufDzhbHw7YLc6d
440
460
  X.FortKnox.2 r9PbKbYisKN1DSwaZ7jp6ZsKmfk1yCFAAi
@@ -447,6 +467,8 @@ module Rippler
447
467
  X.FortKnox.9 rp7gaQch2fiNQHDPrnPk9pG65e9cnv7g6X
448
468
  X.FortKnox.a rstKSeB2Qx7zrwSkyc7X9Xm5nYTJqtL3iM
449
469
  X.FortKnox.b rJYMACXJd1eejwzZA53VncYmiK2kZSBxyD
470
+ X.FortKnox.c r9ycgvDgXjeiaYmoz4F8sKBNXgHHx1wVFM
471
+ X.Distributor.1 r8TR1AeB1RDQFabM6i8UoFsRF5basqoHJ
450
472
  X.Veirou rhq5LEZSWHWY6H3raiC2KGe8TVeirou4BS
451
473
  X.Wow rHD7Bs8Zk1oQeUhLjPrsFStFcRE2NWoWpe
452
474
  X.Reya rEyAJhMMi5WNzgdkY67vN7ivfiQnh3itXY
@@ -456,6 +478,7 @@ module Rippler
456
478
  X.Founder.1 rfbKLd1VLB3o6fpkhCJexckArjoMmBm2wG
457
479
  X.Tester.1 rLgXwzqSSCnQjA83tWP1j8D1Kf4zX9gMVj
458
480
  X.Tester.2 rHByiWNHuu4P4n9TuJBjkpbbZiptdywzd9
481
+ X.Trader rnT9PFSfAnWyj2fd7D5TCoCyCYbK4n356A
459
482
  X.1 rKdtD8YQXCJAnXoXQfmn645FybiaFWVghs
460
483
  X.2 ramJoEsBUHc299vFuMvn8NgLrF3Qrt3XV4
461
484
  X.3 r9tGqzZgKxVFvzKFdUqXAqTzazWBUia8Qr
@@ -474,7 +497,7 @@ module Rippler
474
497
  X.16 rUGNvasUuxLiPL5RXvfZXW8HjBtSHZgqgz
475
498
  X.17 rPyuHFYDwYMGJ5xhMbzfYeikx7ARV3ExvF
476
499
  X.18 r4MZrGMPEHfxGNQHR92BJo5hU9BiqMsTej
477
- X.19 rnT9PFSfAnWyj2fd7D5TCoCyCYbK4n356A
500
+ X.19 r3ADD8kXSUKHd6zTCKfnKT3zV9EZHjzp1S
478
501
  X.20 rnW7DHtmZGJk4uhGTSU2BW3iPCPWb2xegg
479
502
  X.21 rUrdFHbrEKWNQQ444zcTLrThjcnHCw2FPu
480
503
  X.22 r49nVgaYSDuU7GEQh4mF1nyjsXSVRcUHsr
@@ -506,6 +529,15 @@ module Rippler
506
529
  X.48 r3RVftuvnhuWyTykK2R2XaD6vepwyfnCYs
507
530
  X.49 rLDwkvrMVbbJ9WLaXpNaPM9k9AinJwNPSg
508
531
  X.50 rhMb2LRHvyouHMF9WoWMJ29mdDTUgEdiA5
532
+ X.51 rGJDijoiue2HmjuiEBQKAWY7XdKb2poWka
533
+ X.52 rnxyvrF2mUhK6HubgPxUfWExERAwZXMhVL
534
+ X.53 rBiYVjzHRQxMDMdC5ynKsejqoy1qJMQ8zR
535
+ X.54 rMZKeAt1vMjhuNCWDiB4SdzJRiymdpERw4
536
+ X.55 rhPWDU6pPZpVpDr7PjkeMHwB5DskmV4jDe
537
+ X.56 rDZ8QghKF4C11pmbVAkqumPTehiF8mfHt3
538
+ X.57 rDGd76GCnZYGhjiAngV3xrPV4Qkfx79qqp
539
+ X.58 r9Y4Mdhs339CxpCFxgdBVRcuM5i4rMRbu
540
+ X.59 rPcu8U9dSsK6nHtqgpeSvjuFTmNGq3arPh
509
541
  ]] # X.*** signifies anonymous account that is active in Ripple
510
542
 
511
543
  Addresses = Contacts.invert
data/lib/rippler/money.rb CHANGED
@@ -30,6 +30,31 @@ module Rippler
30
30
  @value = @value.to_i if @value.to_i == @value
31
31
  end
32
32
 
33
+ # Uniform currency rate presentation
34
+ def rate cross
35
+ first, second =
36
+ if self.xrp? || cross.dym?
37
+ [self, cross]
38
+ elsif cross.xrp? || self.btc?
39
+ [cross, self]
40
+ else
41
+ [self, cross]
42
+ end
43
+ r = first.value.to_f/second.value.to_f
44
+ r = r.to_i == r ? r.to_i : r
45
+ "#{r}#{first.currency}/#{second.currency}"
46
+ end
47
+
48
+ # Allows methods such as xrp? usd? or btc?
49
+ def method_missing meth, *args
50
+ curr = meth.to_s.upcase.match(/^(...)\?$/)[1]
51
+ if curr
52
+ currency == curr
53
+ else
54
+ super
55
+ end
56
+ end
57
+
33
58
  def to_s
34
59
  if @issuer
35
60
  "#{@value}/#{@currency}/#{Account(@issuer)}"
@@ -17,8 +17,10 @@ module Rippler
17
17
  when "OfferCancel"
18
18
  "CAN #{Account(tx['Account'])} ##{tx['Sequence']}"
19
19
  when "OfferCreate"
20
+ get = Money(tx['TakerGets'])
21
+ pay = Money(tx['TakerPays'])
20
22
  "OFR #{Account(tx['Account'])} ##{tx['Sequence']} offers " +
21
- "#{Money(tx['TakerGets'])} for #{Money(tx['TakerPays'])}"
23
+ "#{get} for #{pay} (#{get.rate(pay)})"
22
24
  when "TrustSet"
23
25
  "TRS #{Money(tx['LimitAmount'])} #{Account(tx['Account'])}"
24
26
  else
@@ -1,3 +1,3 @@
1
1
  module Rippler
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rippler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-12 00:00:00.000000000 Z
12
+ date: 2013-03-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faye-websocket