ruby_meetup2 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ruby_meetup.rb +24 -2
  3. metadata +5 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3b2259f6d227fabfd45a391f60fb921bfe5a9bfa
4
- data.tar.gz: 261c71c7d833d3972848bea212a5e26dea6d6f24
3
+ metadata.gz: 12c3de19119d44ece0d0bd735557a97c6716c6a6
4
+ data.tar.gz: 8680f1d6243aa9c51b003488c5b9ab1a35e116d0
5
5
  SHA512:
6
- metadata.gz: ad17c9b2e18a6f64ffbecf3a0a714cfedf6bec7b97b44d871f4e07f3ae0a268d63e71559efa132aec2042d35c523ed9d03bd7962d54677f3605ed31b6994825f
7
- data.tar.gz: 0c25063711c7a25582a059c58872f42d12c69ae1953394f92287bee6594e89102fcc4fdb1d315905891498ef94b7145f72025c0d70295b22ebd8f6212255adca
6
+ metadata.gz: 854648f3eacc85a6d8607395b3b0fdba9c3686fb971041e91586090662403cfcb9c4bc6ec38e89727909aa7269b8e35854ce914c61250f762839a2b38773b47f
7
+ data.tar.gz: 6dd8a3a014625ad62a3463fa284676c7bb27588d3fb4b8b3edfd1ba6f784db502a66a86d3f4a748a632a06c3a9156ee5c6f7bbfab6d7f053fae17ebc5cd2834a
data/lib/ruby_meetup.rb CHANGED
@@ -25,11 +25,11 @@ module RubyMeetup
25
25
  # > second_result = client.get({:group_id => 939203})
26
26
  #
27
27
  # If successful the captured response is a raw JSON string. The response can then
28
- # be processed using a JSON parser. Otherwise an exception is raised.
28
+ # be processed using a JSON parser. Otherwise an exception is raised.
29
29
  #
30
30
  # Typically, ApiKeyClient class is used to read data while the AuthenticatedClient
31
31
  # class is used for both read and write data, subject to Meetup API permission scopes.
32
- #
32
+ #
33
33
  # ---
34
34
  # Copyright (c) 2013 Long On, released under the MIT license
35
35
 
@@ -58,6 +58,11 @@ class Client
58
58
  get(options)
59
59
  end
60
60
 
61
+ def post_path(path, options={})
62
+ self.path = path
63
+ post(options)
64
+ end
65
+
61
66
  # Make a GET API call with the current path value and @options.
62
67
  # Return a JSON string if successful, otherwise an Exception
63
68
  def get(options={})
@@ -75,6 +80,23 @@ class Client
75
80
  end
76
81
  end
77
82
 
83
+ # Make a POST API call with the current path value and @options.
84
+ # Return a JSON string if successful, otherwise an Exception
85
+ def post(options={})
86
+ uri = new_uri
87
+ params = merge_params(options)
88
+ uri.query = URI.encode_www_form(params)
89
+
90
+ Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
91
+ request = Net::HTTP::Post.new(uri)
92
+ response = http.request(request)
93
+ unless response.is_a?(Net::HTTPSuccess)
94
+ raise "#{response.code} #{response.message}\n#{response.body}"
95
+ end
96
+ return response.body
97
+ end
98
+ end
99
+
78
100
  # :nodoc:
79
101
  def to_s
80
102
  "#{self.class.name}: site=#{@@site}, path=#{path}"
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_meetup2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Long On
8
+ - github.com/domicode
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2013-10-02 00:00:00.000000000 Z
12
+ date: 2015-06-11 00:00:00.000000000 Z
12
13
  dependencies: []
13
14
  description: A light-weight Ruby client for working with the Meetup API
14
15
  email: on.long.on@gmail.com
@@ -16,9 +17,9 @@ executables: []
16
17
  extensions: []
17
18
  extra_rdoc_files: []
18
19
  files:
19
- - lib/ruby_meetup.rb
20
20
  - lib/api_key_client.rb
21
21
  - lib/authenticated_client.rb
22
+ - lib/ruby_meetup.rb
22
23
  homepage: https://github.com/fun-ruby/ruby-meetup2
23
24
  licenses:
24
25
  - MIT
@@ -40,7 +41,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
40
41
  requirements:
41
42
  - ruby net/http[s]
42
43
  rubyforge_project:
43
- rubygems_version: 2.0.3
44
+ rubygems_version: 2.4.8
44
45
  signing_key:
45
46
  specification_version: 4
46
47
  summary: Meetup API v2 Ruby client