atheme-ruby 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +11 -10
- data/lib/atheme/service.rb +1 -1
- data/lib/atheme/session.rb +1 -3
- data/lib/atheme/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -1,15 +1,14 @@
|
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/atheme-ruby.png)](http://badge.fury.io/rb/atheme-ruby) [![Dependency Status](https://gemnasium.com/Flauschbaellchen/atheme-ruby.png)](https://gemnasium.com/Flauschbaellchen/atheme-ruby)
|
2
|
+
|
1
3
|
# atheme-ruby
|
2
|
-
The gem was inspired by
|
4
|
+
The gem was inspired by [jameswritescode/atheme-ruby](https://github.com/jameswritescode/atheme-ruby/).
|
3
5
|
However, his gem use module-methods and thus does not allow concurrent connections within the same script.
|
4
6
|
|
5
7
|
## Install
|
6
8
|
|
7
|
-
|
9
|
+
You can install the gem directly from rubygems.org:
|
8
10
|
|
9
|
-
|
10
|
-
cd atheme-ruby
|
11
|
-
gem build atheme-ruby.gemspec
|
12
|
-
gem install atheme-ruby-x.x.x.gem
|
11
|
+
gem install atheme-ruby
|
13
12
|
|
14
13
|
Standalone script:
|
15
14
|
|
@@ -44,7 +43,7 @@ If an option is missing, the default ones as stated above are used.
|
|
44
43
|
|
45
44
|
### Login
|
46
45
|
|
47
|
-
The initial session uses an anonymous login which can be re-choosen by
|
46
|
+
The initial session uses an anonymous login which can be re-choosen by logging out.
|
48
47
|
|
49
48
|
To login with an account registered with NickServ use the following:
|
50
49
|
|
@@ -66,10 +65,11 @@ You may logout after you finished your work:
|
|
66
65
|
### Service-Calls
|
67
66
|
|
68
67
|
This gem supports all service-bots of atheme, like chanserv, nickserv etc.
|
69
|
-
You can call any commands you want to perform like you do on IRC:
|
68
|
+
You can call any commands you want to perform like you do on IRC; subcommands goes into the first argument of the method:
|
70
69
|
|
71
|
-
@session.chanserv.info('#opers')
|
72
|
-
@session.chanserv.list
|
70
|
+
@session.chanserv.info('#opers') # /msg chanserv info #opers
|
71
|
+
@session.chanserv.list # /msg chanserv list
|
72
|
+
@session.nickserv.help('set password') # /msg nickserv help password
|
73
73
|
|
74
74
|
I think you're getting the point...
|
75
75
|
However, you can perform additional questions on these return values:
|
@@ -79,6 +79,7 @@ However, you can perform additional questions on these return values:
|
|
79
79
|
@session.chanserv.info('#opers').registered #=> #<Date: 2013-05-13 ((2456426j,0s,0n),+0s,2299161j)>
|
80
80
|
|
81
81
|
Take a look into _lib/atheme/services/*_ to find available subcommands.
|
82
|
+
The commands return a Atheme::Entity or a subclass like Atheme::User or Atheme::Channel. You can call #raw_output on these to get the raw service reply of the command you called.
|
82
83
|
|
83
84
|
TODO
|
84
85
|
----
|
data/lib/atheme/service.rb
CHANGED
data/lib/atheme/session.rb
CHANGED
@@ -18,8 +18,7 @@ module Atheme
|
|
18
18
|
end
|
19
19
|
|
20
20
|
yield self if block_given?
|
21
|
-
|
22
|
-
self.anonymous!
|
21
|
+
@cookie, @user, @ip = '.', '.', DEFAULT_IP
|
23
22
|
end
|
24
23
|
|
25
24
|
def login(user, password, ip=DEFAULT_IP)
|
@@ -39,7 +38,6 @@ module Atheme
|
|
39
38
|
@cookie, @user, @ip = '.', '.', DEFAULT_IP
|
40
39
|
true
|
41
40
|
end
|
42
|
-
alias_method :anonymous!, :logout
|
43
41
|
|
44
42
|
def logged_in?
|
45
43
|
@cookie && @cookie!='.' ? true : false
|
data/lib/atheme/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: atheme-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
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: 2013-08-
|
12
|
+
date: 2013-08-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|