mypeople 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/lib/mypeople/client.rb +17 -9
- data/lib/mypeople/file.rb +2 -2
- data/lib/mypeople/version.rb +1 -1
- data/test.rb +4 -1
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6949efb7263dbf5eddcf32b860def23e5a87302f
|
4
|
+
data.tar.gz: 4e3414d38f9cb66a0ffe1442c8afa92cc7d33f9a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91cf4098d43b05c338cfc96ec39d8db7310a181e51187101e8c78d725f17372bd4b6863ba52da9f9503c3b342b8057a41a7f7ce56519d672c979d2338829a565
|
7
|
+
data.tar.gz: 9ea013632876ca3201af4a3bc0b3cee20ff36cceaa78abc08cde3403a99ce33945f63befbd5e91bf7aa86a4848e0359b5e5b06b4832444a20d5beb3994e9e2fd
|
data/.gitignore
CHANGED
data/lib/mypeople/client.rb
CHANGED
@@ -63,30 +63,38 @@ module Mypeople
|
|
63
63
|
@configuration ||= Configuration.new
|
64
64
|
end
|
65
65
|
|
66
|
-
def request(method, path, data)
|
66
|
+
def request(method, path, data, json = true)
|
67
67
|
http = configuration.http
|
68
68
|
data = configuration.data.merge(data)
|
69
69
|
|
70
70
|
case method
|
71
71
|
when "GET"
|
72
|
-
get(http, path, data)
|
72
|
+
get(http, path, data, json)
|
73
73
|
when "POST"
|
74
|
-
post(http, path, data)
|
74
|
+
post(http, path, data, json)
|
75
75
|
end
|
76
76
|
end
|
77
77
|
|
78
|
-
def get(http, path, data)
|
78
|
+
def get(http, path, data, json)
|
79
79
|
data = URI.encode_www_form(data)
|
80
80
|
resp, body = http.send_request("GET", "#{path}?#{data}")
|
81
81
|
|
82
|
-
|
82
|
+
if json
|
83
|
+
JSON.parse(resp.body)
|
84
|
+
else
|
85
|
+
resp.body
|
86
|
+
end
|
83
87
|
end
|
84
88
|
|
85
|
-
def post(http, path, data)
|
89
|
+
def post(http, path, data, json)
|
86
90
|
data = URI.encode_www_form(data)
|
87
91
|
resp, body = http.send_request("POST", path, data)
|
88
92
|
|
89
|
-
|
93
|
+
if json
|
94
|
+
JSON.parse(resp.body)
|
95
|
+
else
|
96
|
+
resp.body
|
97
|
+
end
|
90
98
|
end
|
91
99
|
|
92
100
|
def send_message_to_buddy(buddy_id, content, attach = nil)
|
@@ -148,14 +156,14 @@ module Mypeople
|
|
148
156
|
request(method, path, data)
|
149
157
|
end
|
150
158
|
|
151
|
-
def download_file(file_id
|
159
|
+
def download_file(file_id)
|
152
160
|
method = APIS[:download_file][:method]
|
153
161
|
path = APIS[:download_file][:path]
|
154
162
|
data = {
|
155
163
|
"fileId" => file_id
|
156
164
|
}
|
157
165
|
|
158
|
-
request(method, path, data)
|
166
|
+
request(method, path, data, false)
|
159
167
|
end
|
160
168
|
end
|
161
169
|
end
|
data/lib/mypeople/file.rb
CHANGED
data/lib/mypeople/version.rb
CHANGED
data/test.rb
CHANGED
@@ -23,7 +23,10 @@ TEST_FILE_ID = "myp_pub:XXXXX"
|
|
23
23
|
#puts Mypeople::Member.find(TEST_USER_ID)
|
24
24
|
|
25
25
|
# 파일
|
26
|
-
#
|
26
|
+
#stream = Mypeople::File.download(TEST_FILE_ID)
|
27
|
+
#f = File.new("test.jpg", "w")
|
28
|
+
#f.write(stream)
|
29
|
+
#f.close
|
27
30
|
|
28
31
|
# 친구(1:1)에게 메세지 보내기
|
29
32
|
#Mypeople::Member.send(TEST_USER_ID, TEST_CONTENT)
|
metadata
CHANGED
@@ -1,41 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mypeople
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Taekmin Kim
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.5'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.5'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
description: ''
|
@@ -45,7 +45,7 @@ executables: []
|
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
|
-
- .gitignore
|
48
|
+
- ".gitignore"
|
49
49
|
- Gemfile
|
50
50
|
- LICENSE.txt
|
51
51
|
- README.md
|
@@ -70,17 +70,17 @@ require_paths:
|
|
70
70
|
- lib
|
71
71
|
required_ruby_version: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
77
77
|
requirements:
|
78
|
-
- -
|
78
|
+
- - ">="
|
79
79
|
- !ruby/object:Gem::Version
|
80
80
|
version: '0'
|
81
81
|
requirements: []
|
82
82
|
rubyforge_project:
|
83
|
-
rubygems_version: 2.
|
83
|
+
rubygems_version: 2.2.2
|
84
84
|
signing_key:
|
85
85
|
specification_version: 4
|
86
86
|
summary: Ruby gem for mypeople api
|