rstyx 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/Manifest.txt CHANGED
@@ -2,9 +2,12 @@ COPYING
2
2
  ChangeLog
3
3
  Manifest.txt
4
4
  NEWS
5
- README
5
+ README.txt
6
6
  Rakefile
7
7
  examples/readstyxfile.rb
8
+ examples/fileondisk.rb
9
+ examples/testserver.rb
10
+ examples/writestyxfile.rb
8
11
  lib/rstyx/authmodules.rb
9
12
  lib/rstyx/client.rb
10
13
  lib/rstyx/common.rb
@@ -38,4 +38,4 @@ includes can find it, e.g. /usr/lib/ruby/site_ruby/1.8. You'll also
38
38
  need EventMachine (http://rubyforge.org/projects/eventmachine) to use
39
39
  it.
40
40
 
41
- $Id: README 226 2007-07-17 06:48:43Z dido $
41
+ $Id: README.txt 246 2007-09-13 08:24:51Z dido $
data/Rakefile CHANGED
@@ -17,7 +17,7 @@
17
17
  # Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA
18
18
  # 02110-1301 USA.
19
19
  #
20
- # $Id: Rakefile 199 2007-06-06 07:24:51Z dido $
20
+ # $Id: Rakefile 237 2007-08-14 11:35:47Z dido $
21
21
  #
22
22
  require 'rubygems'
23
23
  require 'hoe'
@@ -51,5 +51,13 @@ Rcov::RcovTask.new(:coverage) do |t|
51
51
  t.verbose = true
52
52
  end
53
53
 
54
+ desc "Tag the current trunk with the current release version"
55
+ task :tag do
56
+ warn "WARNING: this will tag svn+ssh://rubyforge.org/var/svn/rstyx/trunk using the tag v#{RStyx::Version::MAJOR}.#{RStyx::Version::MINOR}.#{RStyx::Version::TINY}"
57
+ warn "If you do not wish to continue, you have 5 seconds to cancel by pressing CTRL-C..."
58
+ 5.times { |i| print "#{5-i} "; $stdout.flush; sleep 1 }
59
+ system "svn copy svn+ssh://rubyforge.org/var/svn/rstyx/trunk svn+ssh://rubyforge.org/var/svn/rstyx/tags/v#{RStyx::Version::MAJOR}.#{RStyx::Version::MINOR}.#{RStyx::Version::TINY} -m \"Tagging the #{RStyx::Version::STRING} release\""
60
+ end
61
+
54
62
  # vim: syntax=Ruby
55
63
 
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/ruby
2
+ #
3
+ # $Id: fileondisk.rb 243 2007-09-13 08:21:09Z dido $
4
+ #
5
+ require 'rstyx/server'
6
+ require 'logger'
7
+
8
+ log = Logger.new(STDOUT)
9
+ sd = RStyx::Server::SDirectory.new("/")
10
+ sf = RStyx::Server::FileOnDisk.new(ARGV[0])
11
+ sf.add_changelistener do |f|
12
+ puts "File contents changed"
13
+ end
14
+ sd << sf
15
+ serv = RStyx::Server::TCPServer.new(:bindaddr => "0.0.0.0",
16
+ :port => 9876,
17
+ :root => sd,
18
+ :log => log,
19
+ :debug => Logger::DEBUG)
20
+ Thread.abort_on_exception = true
21
+ serv.run.join
22
+
@@ -24,7 +24,7 @@
24
24
  # Copyright:: Copyright (c) 2005,2006 Rafael R. Sevilla
25
25
  # License:: GNU Lesser General Public License
26
26
  #
27
- # $Id: readstyxfile.rb 190 2007-06-04 06:53:54Z dido $
27
+ # $Id: readstyxfile.rb 237 2007-08-14 11:35:47Z dido $
28
28
  #
29
29
  require 'rstyx'
30
30
  require 'digest/sha1'
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/ruby
2
+ #
3
+ # $Id: testserver.rb 237 2007-08-14 11:35:47Z dido $
4
+ #
5
+ require 'rstyx/server'
6
+ require 'logger'
7
+
8
+ log = Logger.new(STDOUT)
9
+ sd = RStyx::Server::SDirectory.new("/")
10
+ sf = RStyx::Server::InMemoryFile.new("test.file")
11
+ sf.contents = "hello"
12
+ sf.add_changelistener do |f|
13
+ puts "File contents changed to #{f.contents}"
14
+ end
15
+ sd << sf
16
+ serv = RStyx::Server::TCPServer.new(:bindaddr => "0.0.0.0",
17
+ :port => 9876,
18
+ :root => sd,
19
+ :log => log,
20
+ :debug => Logger::DEBUG)
21
+ Thread.abort_on_exception = true
22
+ serv.run.join
23
+
@@ -0,0 +1,49 @@
1
+ #!/usr/bin/ruby
2
+ #
3
+ # Copyright (C) 2005,2006 Rafael Sevilla
4
+ # This file is part of RStyx
5
+ #
6
+ # RStyx is free software; you can redistribute it and/or modify
7
+ # it under the terms of the GNU Lesser General Public License as
8
+ # published by the Free Software Foundation; either version 2.1
9
+ # of the License, or (at your option) any later version.
10
+ #
11
+ # RStyx is distributed in the hope that it will be useful, but
12
+ # WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTIBILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Lesser General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Lesser General Public
17
+ # License along with RStyx; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA
19
+ # 02110-1301 USA.
20
+ #
21
+ # Styx file reader
22
+ #
23
+ # Author:: Rafael R. Sevilla (mailto:dido@imperium.ph)
24
+ # Copyright:: Copyright (c) 2005,2006 Rafael R. Sevilla
25
+ # License:: GNU Lesser General Public License
26
+ #
27
+ # $Id: readstyxfile.rb 190 2007-06-04 06:53:54Z dido $
28
+ #
29
+ require 'rstyx'
30
+ require 'digest/sha1'
31
+
32
+ RSTYX_HOST = "localhost"
33
+ RSTYX_PORT = 9876
34
+
35
+ file = ARGV[0]
36
+
37
+ module RStyx
38
+ DEBUG = 1
39
+ end
40
+
41
+ Thread.abort_on_exception = true
42
+
43
+ RStyx::Client::TCPConnection.new(RSTYX_HOST, RSTYX_PORT).connect do |conn|
44
+ conn.open(file, "w") do |fp|
45
+ 1.upto(10000) do |i|
46
+ fp.write((i % 10).to_s)
47
+ end
48
+ end
49
+ end