shaman 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7cd52348febf120902db58d4f50ea4e66c5211e8
4
- data.tar.gz: 11b1a43720cc211d9b60d586e598d6469e7932c7
3
+ metadata.gz: a0837878e5d499ca93e7fcdbcfb3c71f33e81f04
4
+ data.tar.gz: 60806c58a8dc39a4b65fdec077c15d85ee3eb779
5
5
  SHA512:
6
- metadata.gz: b45bb6d541bb36ecffa7ddaaeb65803933dd7920cf015dc219929af1b1d39d273ea9c555b273ed47b4af514dc2e80be0246a8d44158c72791c8ff557897964f5
7
- data.tar.gz: 5ec1995754fcb71c413e5b556624d84474a87708bc2cc688b0f74985facacbdda6927913ab8d2ce9d55912cc49f158124b80612a8c109a78c8b580045e9b7696
6
+ metadata.gz: 9d7c754a2a4ef08249c796ba6a361efc768e7f47ad454a26eb3a550fb33671dce6197885aea7a0e12d70c99de49216a92f2d48b1377a9496b22bc7337ab7bed4
7
+ data.tar.gz: a1071fe1bb902c69798f973aec910448757ebce7ab8aca9965e8903b28bc995ae139b118b96d5c57bd7ed3884120bdf1d7cc75f3ce768a872afa5a33136b9eeb
@@ -7,11 +7,11 @@ class Shaman
7
7
  attr_reader :body
8
8
 
9
9
  def initialize(body)
10
- @body = body.to_s
10
+ @body = body
11
11
  end
12
12
 
13
13
  def sha
14
- Digest::MD5.hexdigest(prepped_body.to_s)
14
+ Digest::MD5.hexdigest(sorted_hash(prepped_body).to_s)
15
15
  end
16
16
 
17
17
  def valid_json?
@@ -36,8 +36,9 @@ class Shaman
36
36
  end
37
37
 
38
38
  def prepped_body
39
- sort_body = parsed_json or parsed_xml or body
40
- sorted_hash(sort_body)
39
+ return parsed_json if valid_json?
40
+ return parsed_xml if valid_xml?
41
+ body
41
42
  end
42
43
 
43
44
  def sorted_hash(obj)
@@ -1,3 +1,3 @@
1
1
  class Shaman
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shaman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Cooper