digu 0.1 → 0.3
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.
- data/ChangeLog +7 -0
- data/README.rdoc +31 -0
- data/lib/digu.rb +4 -4
- metadata +18 -9
data/ChangeLog
CHANGED
data/README.rdoc
CHANGED
@@ -2,8 +2,39 @@
|
|
2
2
|
|
3
3
|
This is a client library of digu.com for post messages, will add more features later...
|
4
4
|
|
5
|
+
== INSTALL
|
6
|
+
|
7
|
+
[sudo] gem install digu --source http://gemcutter.org/
|
8
|
+
|
9
|
+
$irb
|
10
|
+
> require 'rubygems'
|
11
|
+
=> true
|
12
|
+
|
13
|
+
> require 'digu'
|
14
|
+
=> true
|
15
|
+
|
16
|
+
> Digu::VERSION
|
17
|
+
=> "0.1"
|
18
|
+
|
19
|
+
> digu = Digu.new
|
20
|
+
=> #<Digu:0x7f654d0f6a90 @http=#<Net::HTTPOK 200 OK readbody=true>>
|
21
|
+
|
22
|
+
> digu.login 'username', '****password***'
|
23
|
+
=> true
|
24
|
+
|
25
|
+
> digu.post 'Say hi to everybody'
|
26
|
+
=> true
|
27
|
+
|
28
|
+
> digu.logout
|
29
|
+
=> #<Net::HTTPOK 200 OK readbody=true>
|
30
|
+
|
31
|
+
> digu.login?
|
32
|
+
=> false
|
33
|
+
|
34
|
+
|
5
35
|
== Example
|
6
36
|
|
37
|
+
require 'digu'
|
7
38
|
digu = Digu.new.login 'user', 'pass'
|
8
39
|
if digu.login?
|
9
40
|
if digu.post 'I like this'
|
data/lib/digu.rb
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
#
|
17
17
|
# == Version
|
18
18
|
#
|
19
|
-
# v0.
|
19
|
+
# v0.2
|
20
20
|
#
|
21
21
|
# == Author
|
22
22
|
#
|
@@ -28,7 +28,7 @@ require 'rubygems'
|
|
28
28
|
require 'http_request'
|
29
29
|
|
30
30
|
class Digu
|
31
|
-
VERSION = '0.
|
31
|
+
VERSION = '0.2'
|
32
32
|
BASE_DIGU_URL = 'http://digu.com'
|
33
33
|
|
34
34
|
def initialize
|
@@ -54,7 +54,7 @@ class Digu
|
|
54
54
|
},
|
55
55
|
:cookies => @http.cookies
|
56
56
|
)
|
57
|
-
|
57
|
+
self
|
58
58
|
end
|
59
59
|
|
60
60
|
def login?
|
@@ -124,6 +124,6 @@ end
|
|
124
124
|
|
125
125
|
if __FILE__ == $0
|
126
126
|
digu = Digu.new
|
127
|
-
puts digu.post '
|
127
|
+
puts digu.post 'hello world' if digu.login(ARGV[0] || 'username', ARGV[1] || 'password')
|
128
128
|
digu.logout if digu.login?
|
129
129
|
end
|
metadata
CHANGED
@@ -1,7 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: digu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 3
|
8
|
+
version: "0.3"
|
5
9
|
platform: ruby
|
6
10
|
authors:
|
7
11
|
- Zhou Xianhua
|
@@ -9,19 +13,22 @@ autorequire:
|
|
9
13
|
bindir: bin
|
10
14
|
cert_chain: []
|
11
15
|
|
12
|
-
date: 2010-
|
16
|
+
date: 2010-05-07 00:00:00 +08:00
|
13
17
|
default_executable:
|
14
18
|
dependencies:
|
15
19
|
- !ruby/object:Gem::Dependency
|
16
20
|
name: http_request.rb
|
17
|
-
|
18
|
-
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
21
|
+
prerelease: false
|
22
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
23
|
requirements:
|
21
24
|
- - ">="
|
22
25
|
- !ruby/object:Gem::Version
|
26
|
+
segments:
|
27
|
+
- 1
|
28
|
+
- 1
|
23
29
|
version: "1.1"
|
24
|
-
|
30
|
+
type: :runtime
|
31
|
+
version_requirements: *id001
|
25
32
|
description: This is a client library of digu.com for post messages and ...
|
26
33
|
email: xianhua.zhou@gmail.com
|
27
34
|
executables: []
|
@@ -47,18 +54,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
47
54
|
requirements:
|
48
55
|
- - ">="
|
49
56
|
- !ruby/object:Gem::Version
|
57
|
+
segments:
|
58
|
+
- 0
|
50
59
|
version: "0"
|
51
|
-
version:
|
52
60
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
53
61
|
requirements:
|
54
62
|
- - ">="
|
55
63
|
- !ruby/object:Gem::Version
|
64
|
+
segments:
|
65
|
+
- 0
|
56
66
|
version: "0"
|
57
|
-
version:
|
58
67
|
requirements: []
|
59
68
|
|
60
69
|
rubyforge_project: digu
|
61
|
-
rubygems_version: 1.3.
|
70
|
+
rubygems_version: 1.3.6
|
62
71
|
signing_key:
|
63
72
|
specification_version: 3
|
64
73
|
summary: Client library of digu.com
|