journeta 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
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|
@@ -2,7 +2,7 @@ module Journeta #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- TINY = 6
5
+ TINY = 7
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
data/website/index.html CHANGED
@@ -1,146 +1,65 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
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
- <head>
4
- <link rel="stylesheet" href="stylesheets/reset.css" type="text/css" media="screen" />
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>Journeta P2P :: Ruby Peer Discovery &amp; Message Passing</title>
8
- </head>
9
- <body>
10
- <div id="header_side">
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
- &nbsp;
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
- <div>
93
- <h2>Peers</h2>
94
- <p>
95
- A “peer” is represented by a “start”ed instance of JournetaEngine 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, or want to run multiple instances on the same machine.
96
- </p>
97
- <p>
98
- Any object that can be serialized via YAML can be sent and received by Journeta. Received messages (a.k.a. objects defined by your application sent from a peer running the same code) are passed into a message handler you provide in an event-based manner. Messages do not come from your applications main thread!
99
- </p>
100
- </div>
101
- <div>
102
- <h2>Journeta is simple because it doesn’t..</h2>
103
- <ol>
104
- <li>
105
- <h3>Work outside the LAN</h3>Presence broadcasts don’t propagate to the internet, and there is no such thing as a “server” in Journeta.
106
- </li>
107
- <li>
108
- <h3>Currently use secure channels</h3>All network messages are currently sent in raw form across the network, and messages from peers are implicitly authorized. Engine-level support for encryption and authentication will be coming in the future.
109
- </li>
110
- <li>
111
- <h3>Dictate your message handling model</h3>Remember that events sent to your message handler each come from their own thread, and sometimes concurrently. Update only thread-safe data structure and/or design out the problem.
112
- </li>
113
- <li>
114
- <h3>Guarantee backwards compatibility</h3>No formal messaging specifications here. We will try to maintain interface compatibility between point releases (for example between 0.1.0 and 0.1.1), but we don't normally compatibility test across releases so your milage may vary.
115
- </li>
116
- <li>
117
- <h3>Guarantee message delivery</h3>Peers are free to go down at any time, or may flat-out refuse to ignore your presence.
118
- </li>
119
- </ol>
120
- </div>
121
- <div>
122
- <h2>Coming Soon</h2>
123
- <ol>
124
- <li>
125
- <h3>P2P encryption and handshaking</h3>Communication currently are not secure and should only be used in a trusted environment.
126
- </li>
127
- <li>
128
- <h3>JRuby support</h3>We need your support to change a couple lines of Ruby socket API code to something JRuby can handle.
129
- </li>
130
- <li>
131
- <h3>Additional engine hooks</h3>This will allow you to tap into internal workings of Journeta to override default event handling mechanisms. For example, you'll be able to override the default (YAML) serializer.
132
- </li>
133
- <li>
134
- <h3>Preemptive peer reaping</h3>To remove peers from the engine if they have not been heard from in a while.
135
- </li>
136
- <li>
137
- <h3>Failure callbacks</h3>To allow your application to respond to peers going down before all outgoing information has been sent.
138
- </li>
139
- </ol>
140
- </div>
141
- <div class="clear">&nbsp;</div>
142
- </div>
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 &#8220;peer&#8221; is represented by a &quot;start&quot;ed instance of Engine in your Ruby application. You&#8217;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&#8217;t..</h2>
44
+ <ol>
45
+ <li><b>Work outside the <span class="caps">LAN</span></b>. Presence broadcasts don&#8217;t propagate to the internet, and there is no such thing as a &#8220;server&#8221; 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&#8217;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&#8217;t know and we don&#8217;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 &#8220;examples&#8221; 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.6
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-21 00:00:00 -07:00
12
+ date: 2008-10-29 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency