journeta 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/examples/instant_messenger.rb +0 -0
- data/lib/journeta/journeta_engine.rb +9 -1
- data/lib/journeta/version.rb +1 -1
- data/website/index.html +62 -143
- metadata +2 -2
File without changes
|
@@ -159,7 +159,15 @@ module Journeta
|
|
159
159
|
def known_peers(all_groups = false)
|
160
160
|
peer_registry.all(all_groups)
|
161
161
|
end
|
162
|
-
|
162
|
+
|
163
|
+
def known_peers_in_group(group_name)
|
164
|
+
s = {}
|
165
|
+
self.known_peers(true).each do |uuid, peer|
|
166
|
+
s[uuid] = peer if peer.groups.include?(group_name)
|
167
|
+
end
|
168
|
+
s
|
169
|
+
end
|
170
|
+
|
163
171
|
def known_groups()
|
164
172
|
s = Set.new
|
165
173
|
self.known_peers(true).each do |uuid, peer|
|
data/lib/journeta/version.rb
CHANGED
data/website/index.html
CHANGED
@@ -1,146 +1,65 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
2
3
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
</div>
|
12
|
-
<div id="header">
|
13
|
-
<div id="name">
|
14
|
-
Journeta
|
15
|
-
</div>
|
16
|
-
<ol>
|
17
|
-
<li>
|
18
|
-
<span id="tagline">Ruby P2P for your LAN, yo.</span>
|
19
|
-
</li>
|
20
|
-
<li>
|
21
|
-
<a href="http://rubyforge.org/frs/?group_id=4138" class="numbers">[RubyForge Project]</a>
|
22
|
-
</li>
|
23
|
-
<li>
|
24
|
-
<a href="http://journeta.rubyforge.org/rdoc">[RDocs]</a>
|
25
|
-
</li>
|
26
|
-
<li>
|
27
|
-
<a href="mailto:support@openrain.com">[Email]</a>
|
28
|
-
</li>
|
29
|
-
<li>
|
30
|
-
<a href="http://www.openrain.com/">[Developers]</a>
|
31
|
-
</li>
|
32
|
-
</ol>
|
33
|
-
</div>
|
34
|
-
<div id="content_wrapper">
|
35
|
-
<div id="content">
|
36
|
-
<div id="banner">
|
37
|
-
<div id="blurb">
|
38
|
-
<em>Journeta</em>
|
39
|
-
is a dirt simple library for <em>peer discovery</em>
|
40
|
-
and <em>message passing</em>
|
41
|
-
between <em>Ruby</em>
|
42
|
-
applications on a LAN.
|
43
|
-
</div>
|
44
|
-
<div class="clear">
|
45
|
-
|
46
|
-
</div>
|
47
|
-
</div>
|
48
|
-
|
49
|
-
<div id="guts">
|
50
|
-
|
51
|
-
<div id="sidebar">
|
52
|
-
<h1>Installing</h1>
|
53
|
-
<div class="code">
|
54
|
-
sudo gem install journeta
|
55
|
-
</div>
|
56
|
-
<h2>Examples</h2>
|
57
|
-
<p>
|
58
|
-
Several annotated code snippets can be found in the “examples” directory of the gem. Open two (or more) consoles and run and following on each for a completely decentralized, zero-configuration-required chat server.
|
59
|
-
</p>
|
60
|
-
<div class="code">
|
61
|
-
ruby examples/instant_messenger.rb
|
62
|
-
</div>Sweeeeet.
|
63
|
-
</div>
|
64
|
-
|
65
|
-
<div>
|
66
|
-
<h2>Features</h2>
|
67
|
-
<p>
|
68
|
-
<ol>
|
69
|
-
<li>
|
70
|
-
<h3>Trivial to integrate</h3> Add peer discovery to your application in 10 lines of code or less.
|
71
|
-
</li>
|
72
|
-
<li>
|
73
|
-
<h3>Automatic peer discovery</h3> Use Journeta::Engine#known_peers to find other applications on the network.
|
74
|
-
</li>
|
75
|
-
<li>
|
76
|
-
<h3>Object broadcast</h3> Send arbitrary Ruby objects to peers.
|
77
|
-
</li>
|
78
|
-
<li>
|
79
|
-
<h3>Direct objects transfer</h3> Send directly to a given peer UUID.
|
80
|
-
</li>
|
81
|
-
<li>
|
82
|
-
<h3>Cross platform</h3>Runs on Linux and OS X.
|
83
|
-
</li>
|
84
|
-
<li>
|
85
|
-
<h3>Pure Ruby</h3> No native dependancies!
|
86
|
-
</li>
|
87
|
-
</ol>
|
88
|
-
</p>
|
89
|
-
</div>
|
4
|
+
<head>
|
5
|
+
<link rel="stylesheet" href="stylesheets/screen.css" type="text/css" media="screen" />
|
6
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
7
|
+
<title>
|
8
|
+
Journeta
|
9
|
+
</title>
|
10
|
+
<script src="javascripts/rounded_corners_lite.inc.js" type="text/javascript"></script>
|
11
|
+
<style>
|
90
12
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
</div>
|
144
|
-
</div>
|
145
|
-
</body>
|
13
|
+
</style>
|
14
|
+
<script type="text/javascript">
|
15
|
+
window.onload = function() {
|
16
|
+
settings = {
|
17
|
+
tl: { radius: 10 },
|
18
|
+
tr: { radius: 10 },
|
19
|
+
bl: { radius: 10 },
|
20
|
+
br: { radius: 10 },
|
21
|
+
antiAlias: true,
|
22
|
+
autoPad: true,
|
23
|
+
validTags: ["div"]
|
24
|
+
}
|
25
|
+
var versionBox = new curvyCorners(settings, document.getElementById("version"));
|
26
|
+
versionBox.applyCornersToAll();
|
27
|
+
}
|
28
|
+
</script>
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="main">
|
32
|
+
|
33
|
+
<h1>Journeta</h1>
|
34
|
+
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/journeta"; return false'>
|
35
|
+
<p>Get Version</p>
|
36
|
+
<a href="http://rubyforge.org/projects/journeta" class="numbers">0.1.7</a>
|
37
|
+
</div>
|
38
|
+
<h2>Ruby P2P for your <span class="caps">LAN</span>, yo.</h2>
|
39
|
+
<p>Journeta is a library for passing objects between automatically discovered and connected Ruby applications on a <span class="caps">LAN</span>.</p>
|
40
|
+
<h2>Peers</h2>
|
41
|
+
<p>A “peer” is represented by a "start"ed instance of Engine in your Ruby application. You’ll probably want just one, but may run more if it makes sense for your application to logically represent two (or more) peers simultaneously.</p>
|
42
|
+
<p>Any object that can be serialized via <span class="caps">YAML</span> can be sent and received by Journeta. Received messages (a.k.a. objects defined by your application sent from a peer) are passed into a message handler you define, in an event-based manner. Message do not come from your applications main thread.</p>
|
43
|
+
<h2>Journeta Is Simple Because It Doesn’t..</h2>
|
44
|
+
<ol>
|
45
|
+
<li><b>Work outside the <span class="caps">LAN</span></b>. Presence broadcasts don’t propagate to the internet, and there is no such thing as a “server” in Journeta.</li>
|
46
|
+
<li><b>Attempt to be secure</b>, as all network messages are sent in text. Messages from peers are implicitly trusted for truthiness.</li>
|
47
|
+
<li><b>Solve Ruby’s threading issues</b>, nor dictate your applications thread handling design. Until Ruby uses native threads, high-performance uses of Journeta will likely be limited. Remember that stuff sent to your message handler is not coming from your applications main thread.</li>
|
48
|
+
<li><b>Provide backwards compatibility</b>, or for the matter, compatibility with anything other than peers of the same Journeta version. No formal messaging specifications here. Different versions of Journeta may or may not be protocol compatible; we don’t know and we don’t keep track.</li>
|
49
|
+
<li><b>Guarantee message delivery</b>, since <span class="caps">UDP</span> is used for some types of communications, and peers are free to go down at any time.</li>
|
50
|
+
</ol>
|
51
|
+
<h2>Installing</h2>
|
52
|
+
<pre syntax="ruby">sudo gem install journeta</pre>
|
53
|
+
<h2>The Basics</h2>
|
54
|
+
<p>Several annotated code snippets can be found in the “examples” directory of the gem. Open two consoles, and run this script (it comes with the gem) on each. You should see messages on each console showing received presence events. Hit <enter> in one consoles to shut down the peer, and look for an event message in the other. Sweeeeet.</p>
|
55
|
+
<p>Email <a href="mailto:preston.lee@openrain.com">Preston Lee</a> and read the blog.</p>
|
56
|
+
<p class="coda">
|
57
|
+
<!--a href="mailto:drnicwilliams@gmail.com">Dr Nic</a>, 17th October 2008<br-->
|
58
|
+
Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
|
59
|
+
</p>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<!-- insert site tracking codes here, like Google Urchin -->
|
63
|
+
|
64
|
+
</body>
|
146
65
|
</html>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: journeta
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Preston Lee
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-10-
|
12
|
+
date: 2008-10-29 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|