ionian 0.6.3 → 0.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +63 -0
- data/doc/Ionian/Extension/IO.html +1062 -599
- data/doc/Ionian/Extension/Socket.html +2140 -1314
- data/doc/Ionian/Extension.html +98 -70
- data/doc/Ionian/Server.html +577 -345
- data/doc/Ionian/Socket.html +1100 -612
- data/doc/Ionian.html +100 -70
- data/doc/_index.html +164 -0
- data/doc/class_list.html +54 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +338 -0
- data/doc/file.README.html +133 -0
- data/doc/file.license.html +73 -0
- data/doc/file_list.html +59 -0
- data/doc/frames.html +26 -0
- data/doc/index.html +111 -71
- data/doc/js/app.js +219 -0
- data/doc/js/full_list.js +178 -0
- data/doc/js/jquery.js +4 -18
- data/doc/method_list.html +419 -0
- data/doc/top-level-namespace.html +112 -0
- data/lib/ionian/extension/io.rb +4 -2
- data/lib/ionian/socket.rb +1 -1
- data/license.txt +2 -0
- metadata +28 -54
- data/doc/created.rid +0 -6
- data/doc/fonts/Lato-Light.ttf +0 -0
- data/doc/fonts/Lato-LightItalic.ttf +0 -0
- data/doc/fonts/Lato-Regular.ttf +0 -0
- data/doc/fonts/Lato-RegularItalic.ttf +0 -0
- data/doc/fonts/SourceCodePro-Bold.ttf +0 -0
- data/doc/fonts/SourceCodePro-Regular.ttf +0 -0
- data/doc/fonts.css +0 -167
- data/doc/images/add.png +0 -0
- data/doc/images/arrow_up.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/js/darkfish.js +0 -140
- data/doc/js/navigation.js +0 -142
- data/doc/js/search.js +0 -109
- data/doc/js/search_index.js +0 -1
- data/doc/js/searcher.js +0 -228
- data/doc/rdoc.css +0 -580
- data/doc/table_of_contents.html +0 -402
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a88970a3a13a5af34bc6e86e58aadd8bc9e629be
|
4
|
+
data.tar.gz: e208410ce513ad567203e65175116709c7649878
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a5886de7263e48d699a212e180d8d5199116e46a2c2ff70f64b0aea5b150ad11200ae2c09e1be7e357828a5d6993d4ad4e9bd8df1ac5bd4c8a6f02c13dace7d
|
7
|
+
data.tar.gz: 6991f614d839b36c2573ce77262f941bdc55c42c6cbb5422b2bd75b80e7b26d36f17e2673a6614fa8c7487d61512b2610555d30e0b1f08f4397472420f3594c7
|
data/README.md
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
# Ionian
|
2
|
+
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/ionian.png)](http://badge.fury.io/rb/ionian)
|
4
|
+
|
5
|
+
|
6
|
+
A Ruby library to simplify interaction with IO streams. This includes network sockets, file sockets, and serial streams like the console and RS232. Features regular expression matching and notification of received data.
|
7
|
+
|
8
|
+
|
9
|
+
## Supported Ruby Versions
|
10
|
+
|
11
|
+
- MRI >= 2.0.0
|
12
|
+
|
13
|
+
|
14
|
+
## Installation
|
15
|
+
|
16
|
+
gem install ionian
|
17
|
+
|
18
|
+
|
19
|
+
## Code Examples
|
20
|
+
|
21
|
+
### Creating A Socket
|
22
|
+
|
23
|
+
``` ruby
|
24
|
+
socket = Ionian::Socket.new host: '127.0.0.1', port: 23
|
25
|
+
```
|
26
|
+
|
27
|
+
### Sending And Receiving Data
|
28
|
+
|
29
|
+
``` ruby
|
30
|
+
socket = Ionian::Socket.new host: 'google.com', port: 80
|
31
|
+
socket.write "GET / HTTP/1.1\r\n\r\n"
|
32
|
+
socket.read_match { |match| p match; puts '' }
|
33
|
+
```
|
34
|
+
|
35
|
+
### Match Expressions And Named Captures
|
36
|
+
|
37
|
+
``` ruby
|
38
|
+
# A simple IRC client.
|
39
|
+
|
40
|
+
socket = Ionian::Socket.new \
|
41
|
+
host: 'chat.freenode.net',
|
42
|
+
port: 6667,
|
43
|
+
# Break up the matches into named captures so it's easier
|
44
|
+
# to sort through the server's responses.
|
45
|
+
expression: /:(?<server>.*?)\s*:(?<msg>.*?)[\r\n]+/
|
46
|
+
|
47
|
+
# Log on to IRC and send a message.
|
48
|
+
socket.write "NICK ionian-demo\r\nUSER ionian-demo ionian-demo chat.freenode.net :ionian-demo"
|
49
|
+
socket.write "PROTOCL NAMESX\r\n"
|
50
|
+
socket.write "JOIN #ionian-demo\r\n"
|
51
|
+
socket.write "PRIVMSG #ionian-demo :this is a test\r\n"
|
52
|
+
|
53
|
+
|
54
|
+
loop do
|
55
|
+
socket.read_match do |match|
|
56
|
+
# Print the body of the server's responses.
|
57
|
+
puts match.msg
|
58
|
+
|
59
|
+
# Exit when the server has caught up.
|
60
|
+
exit if match.msg.include? 'End of /NAMES list.'
|
61
|
+
end
|
62
|
+
end
|
63
|
+
```
|