zoid 0.1.4 → 0.2.0

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: 0e44e7b2b56a5c41d92a61b29b9ee083c9e36020
4
- data.tar.gz: f287168ddde47cf69186f6440649682e84340f2c
3
+ metadata.gz: 038b01afb87303eb4d5f931f810d836dfb6fc175
4
+ data.tar.gz: 363a967bb84703b6770362c06389a6087314f11d
5
5
  SHA512:
6
- metadata.gz: b53fd021ba3805874bdf92ced9fc1bb682d6f3f762f68f1cd563ed2d4f9fa70155d79c37ad28307e2b3c3a3005d1cdc5bfe483eb90f58ad3cdafad7c48ca285d
7
- data.tar.gz: 0cad0782569956d1d8c89ac004b46e9ba2d50ab2c24d9f7eed599738137c30c9ed888d741ece06b5cce4b393328a8a53075984bb5fc783e2c468844c71f1d578
6
+ metadata.gz: b4a538dbfdf90e86c0ce232c6dfff0ed428e802f17bab1c5d5b09fab45914b29306cb940d562749aeb8373506ef80909bf1968610c1f87994ee006cf942cf738
7
+ data.tar.gz: b97a631bc9e4ac381eec3682a8a54b665fef5070b964e5edbbbfba5e1923247434f049b2a99dd742ec3cbae4db9837e5f8f17c702a6b5a74abb886ef2906ed67
@@ -0,0 +1,79 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.github.com/gists
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"description":"the description for this gist","public":true,"files":{"file1.txt":{"content":"String
9
+ file contents"}}}'
10
+ headers:
11
+ User-Agent:
12
+ - Faraday v0.9.1
13
+ Accept:
14
+ - "*/*"
15
+ Date:
16
+ - Mon, 29 Jun 2015 17:30:42 GMT
17
+ Content-Type:
18
+ - application/json
19
+ response:
20
+ status:
21
+ code: 201
22
+ message: Created
23
+ headers:
24
+ Server:
25
+ - GitHub.com
26
+ Date:
27
+ - Mon, 29 Jun 2015 17:30:48 GMT
28
+ Content-Type:
29
+ - application/json; charset=utf-8
30
+ Content-Length:
31
+ - '2238'
32
+ Status:
33
+ - 201 Created
34
+ X-Ratelimit-Limit:
35
+ - '60'
36
+ X-Ratelimit-Remaining:
37
+ - '57'
38
+ X-Ratelimit-Reset:
39
+ - '1435601981'
40
+ Cache-Control:
41
+ - public, max-age=60, s-maxage=60
42
+ Etag:
43
+ - '"87ca6b57c32cd6c81db19b9b8ec7d53f"'
44
+ Location:
45
+ - https://api.github.com/gists/cd3951cffc0282b8b1b0
46
+ Vary:
47
+ - Accept
48
+ - Accept-Encoding
49
+ X-Github-Media-Type:
50
+ - github.v3
51
+ X-Xss-Protection:
52
+ - 1; mode=block
53
+ X-Frame-Options:
54
+ - deny
55
+ Content-Security-Policy:
56
+ - default-src 'none'
57
+ Access-Control-Allow-Credentials:
58
+ - 'true'
59
+ Access-Control-Expose-Headers:
60
+ - ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset,
61
+ X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
62
+ Access-Control-Allow-Origin:
63
+ - "*"
64
+ X-Github-Request-Id:
65
+ - B2DE92EF:0FEF:30F8A19:559180C7
66
+ Strict-Transport-Security:
67
+ - max-age=31536000; includeSubdomains; preload
68
+ X-Content-Type-Options:
69
+ - nosniff
70
+ X-Served-By:
71
+ - 139317cebd6caf9cd03889139437f00b
72
+ body:
73
+ encoding: UTF-8
74
+ string: '{"url":"https://api.github.com/gists/cd3951cffc0282b8b1b0","forks_url":"https://api.github.com/gists/cd3951cffc0282b8b1b0/forks","commits_url":"https://api.github.com/gists/cd3951cffc0282b8b1b0/commits","id":"cd3951cffc0282b8b1b0","git_pull_url":"https://gist.github.com/cd3951cffc0282b8b1b0.git","git_push_url":"https://gist.github.com/cd3951cffc0282b8b1b0.git","html_url":"https://gist.github.com/cd3951cffc0282b8b1b0","files":{"file1.txt":{"filename":"file1.txt","type":"text/plain","language":"Text","raw_url":"https://gist.githubusercontent.com/anonymous/cd3951cffc0282b8b1b0/raw/b087a4c57f47ffad4025004869d7366ddc82d0d1/file1.txt","size":20,"truncated":false,"content":"String
75
+ file contents"}},"public":true,"created_at":"2015-06-29T17:30:48Z","updated_at":"2015-06-29T17:30:48Z","description":"the
76
+ description for this gist","comments":0,"user":null,"comments_url":"https://api.github.com/gists/cd3951cffc0282b8b1b0/comments","forks":[],"history":[{"user":{"login":"invalid-email-address","id":148100,"avatar_url":"https://avatars.githubusercontent.com/u/148100?v=3","gravatar_id":"","url":"https://api.github.com/users/invalid-email-address","html_url":"https://github.com/invalid-email-address","followers_url":"https://api.github.com/users/invalid-email-address/followers","following_url":"https://api.github.com/users/invalid-email-address/following{/other_user}","gists_url":"https://api.github.com/users/invalid-email-address/gists{/gist_id}","starred_url":"https://api.github.com/users/invalid-email-address/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/invalid-email-address/subscriptions","organizations_url":"https://api.github.com/users/invalid-email-address/orgs","repos_url":"https://api.github.com/users/invalid-email-address/repos","events_url":"https://api.github.com/users/invalid-email-address/events{/privacy}","received_events_url":"https://api.github.com/users/invalid-email-address/received_events","type":"User","site_admin":false},"version":"8072e6975c343aec6259c0379072265091f8d7ff","committed_at":"2015-06-29T17:30:48Z","change_status":{"total":1,"additions":1,"deletions":0},"url":"https://api.github.com/gists/cd3951cffc0282b8b1b0/8072e6975c343aec6259c0379072265091f8d7ff"}]}'
77
+ http_version:
78
+ recorded_at: Mon, 29 Jun 2015 17:30:49 GMT
79
+ recorded_with: VCR 2.9.3
@@ -27,7 +27,7 @@ module Zoid
27
27
  response = connection.post do |request|
28
28
  request.path = path
29
29
  request.headers['Content-Type'] = "application/json"
30
- request.params = params
30
+ request.body = params
31
31
 
32
32
  yield if block_given?
33
33
  end
@@ -4,6 +4,10 @@ module Zoid
4
4
  @attributes = hash
5
5
  end
6
6
 
7
+ def has?(attribute)
8
+ @attributes.has_key?(attribute.to_s)
9
+ end
10
+
7
11
  def respond_to_missing?(method, include_private = false)
8
12
  @attributes.has_key?[method.to_s]
9
13
  end
@@ -15,5 +19,13 @@ module Zoid
15
19
  super
16
20
  end
17
21
  end
22
+
23
+ def methods
24
+ super + @attributes.keys.map(&:to_sym)
25
+ end
26
+
27
+ def inspect
28
+ "<#{self.class.name}:#{object_id} #{@attributes.keys}>"
29
+ end
18
30
  end
19
31
  end
@@ -21,5 +21,9 @@ module Zoid
21
21
  @resources[index]
22
22
  end
23
23
 
24
+ def length
25
+ @resources.length
26
+ end
27
+
24
28
  end
25
29
  end
@@ -1,3 +1,3 @@
1
1
  module Zoid
2
- VERSION = "0.1.4"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zoid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Sarcevic
@@ -151,6 +151,7 @@ files:
151
151
  - bin/console
152
152
  - bin/publish
153
153
  - bin/setup
154
+ - fixtures/vcr_cassettes/github/create_gist.yml
154
155
  - fixtures/vcr_cassettes/github/public_repo.yml
155
156
  - lib/zoid.rb
156
157
  - lib/zoid/agent.rb