zipmark 0.0.1.beta.7 → 0.0.1.beta.8

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright (C) 2012 Zipmark Inc.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -3,10 +3,8 @@ require 'openssl'
3
3
 
4
4
  # Ruby 1.8 compatibility
5
5
  unless Base64.respond_to?(:strict_encode64)
6
- module Base64
7
- def strict_encode64(bin)
8
- [bin].pack("m0")
9
- end
6
+ def Base64.strict_encode64(bin)
7
+ [bin].pack("m0")
10
8
  end
11
9
  end
12
10
 
@@ -25,6 +23,10 @@ module Zipmark
25
23
  @request.raw_post
26
24
  end
27
25
 
26
+ def parsed_body
27
+ @parsed_body ||= JSON.parse(body)
28
+ end
29
+
28
30
  def identifier
29
31
  client.identifier if client
30
32
  end
@@ -38,15 +40,15 @@ module Zipmark
38
40
  end
39
41
 
40
42
  def event
41
- raise "unimplemented"
43
+ parsed_body["callback"]["event"]
42
44
  end
43
45
 
44
46
  def object
45
- raise "unimplemented"
47
+ Zipmark::Entity.new(parsed_body["callback"]["object"].merge(:client => @client, :resource_type => object_type.downcase))
46
48
  end
47
49
 
48
50
  def object_type
49
- raise "unimplemented"
51
+ parsed_body["callback"]["object_type"]
50
52
  end
51
53
 
52
54
  def hashed_content
@@ -1,3 +1,3 @@
1
1
  module Zipmark
2
- VERSION = '0.0.1.beta.7'
2
+ VERSION = '0.0.1.beta.8'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zipmark
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.beta.7
4
+ version: 0.0.1.beta.8
5
5
  prerelease: 6
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: 2012-12-06 00:00:00.000000000 Z
12
+ date: 2012-12-07 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Simple Client Library to connect to the Zipmark API
15
15
  email: jake@zipmark.com
@@ -35,6 +35,7 @@ files:
35
35
  - lib/zipmark/util.rb
36
36
  - lib/zipmark/version.rb
37
37
  - lib/zipmark.rb
38
+ - LICENSE
38
39
  - CONTRIBUTING.md
39
40
  - README.md
40
41
  homepage: http://rubygems.org/gems/zipmark