raindrops 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,13 @@
1
+ # -*- encoding: binary -*-
2
+ require 'test/unit'
3
+ require 'raindrops'
4
+
5
+ class TestRaindropsGc < Test::Unit::TestCase
6
+
7
+ def test_gc
8
+ assert_nothing_raised do
9
+ 1000000.times { Raindrops.new(24) }
10
+ end
11
+ end
12
+
13
+ end
@@ -0,0 +1,54 @@
1
+ require 'test/unit'
2
+ require 'raindrops'
3
+
4
+ class TestRaindrops < Test::Unit::TestCase
5
+
6
+ def test_struct_new
7
+ @rw = Raindrops::Struct.new(:r, :w)
8
+ assert @rw.kind_of?(Class)
9
+ end
10
+
11
+ TMP = Raindrops::Struct.new(:r, :w)
12
+
13
+ def test_init_basic
14
+ tmp = TMP.new
15
+ assert_equal 0, tmp.r
16
+ assert_equal 1, tmp.incr_r
17
+ assert_equal 1, tmp.r
18
+ assert_equal({ :r => 1, :w => 0 }, tmp.to_hash)
19
+
20
+ assert_equal 1, tmp[0]
21
+ assert_equal 0, tmp[1]
22
+ assert_equal [ :r, :w ], TMP::MEMBERS
23
+ end
24
+
25
+ def test_init
26
+ tmp = TMP.new(5, 6)
27
+ assert_equal({ :r => 5, :w => 6 }, tmp.to_hash)
28
+ end
29
+
30
+ def test_dup
31
+ a = TMP.new(5, 6)
32
+ b = a.dup
33
+ assert_equal({ :r => 5, :w => 6 }, b.to_hash)
34
+ assert_nothing_raised { 4.times { b.decr_r } }
35
+ assert_equal({ :r => 1, :w => 6 }, b.to_hash)
36
+ assert_equal({ :r => 5, :w => 6 }, a.to_hash)
37
+ end
38
+
39
+ class Foo < Raindrops::Struct.new(:a, :b, :c, :d)
40
+ def to_ary
41
+ @raindrops.to_ary
42
+ end
43
+
44
+ def hello
45
+ "world"
46
+ end
47
+ end
48
+
49
+ def test_subclass
50
+ assert_equal [0, 0, 0, 0], Foo.new.to_ary
51
+ assert_equal "world", Foo.new.hello
52
+ end
53
+
54
+ end
metadata ADDED
@@ -0,0 +1,103 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: raindrops
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - raindrops hackers
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2010-04-08 00:00:00 +00:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: |-
17
+ Raindrops is a real time stats package to show statistics for Rack HTTP
18
+ servers. It is designed for preforking servers such as Rainbows! and
19
+ Unicorn, but should support any Rack HTTP server under Ruby 1.9, 1.8 and
20
+ possibly Rubinius (untested) on platforms supporting POSIX shared memory
21
+ and compiled with GCC (for atomic builtins).
22
+ email: raindrops@librelist.com
23
+ executables: []
24
+
25
+ extensions:
26
+ - ext/raindrops/extconf.rb
27
+ extra_rdoc_files:
28
+ - README
29
+ - LICENSE
30
+ - NEWS
31
+ - ChangeLog
32
+ - lib/raindrops.rb
33
+ - lib/raindrops/linux.rb
34
+ - lib/raindrops/middleware.rb
35
+ - lib/raindrops/struct.rb
36
+ - ext/raindrops/linux_inet_diag.c
37
+ files:
38
+ - .document
39
+ - .gitignore
40
+ - .manifest
41
+ - COPYING
42
+ - ChangeLog
43
+ - GIT-VERSION-FILE
44
+ - GIT-VERSION-GEN
45
+ - GNUmakefile
46
+ - LICENSE
47
+ - NEWS
48
+ - README
49
+ - Rakefile
50
+ - TODO
51
+ - examples/linux-tcp-listener-stats.rb
52
+ - ext/raindrops/extconf.rb
53
+ - ext/raindrops/linux_inet_diag.c
54
+ - ext/raindrops/raindrops.c
55
+ - lib/raindrops.rb
56
+ - lib/raindrops/linux.rb
57
+ - lib/raindrops/middleware.rb
58
+ - lib/raindrops/struct.rb
59
+ - raindrops.gemspec
60
+ - setup.rb
61
+ - test/test_linux.rb
62
+ - test/test_linux_middleware.rb
63
+ - test/test_middleware.rb
64
+ - test/test_raindrops.rb
65
+ - test/test_raindrops_gc.rb
66
+ - test/test_struct.rb
67
+ has_rdoc: true
68
+ homepage: http://raindrops.bogomips.org/
69
+ licenses: []
70
+
71
+ post_install_message:
72
+ rdoc_options:
73
+ - -Na
74
+ - -t
75
+ - raindrops - real-time stats for Rack servers
76
+ require_paths:
77
+ - lib
78
+ required_ruby_version: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: "0"
83
+ version:
84
+ required_rubygems_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: "0"
89
+ version:
90
+ requirements: []
91
+
92
+ rubyforge_project: raindrops
93
+ rubygems_version: 1.3.5
94
+ signing_key:
95
+ specification_version: 3
96
+ summary: real-time stats for Rack servers
97
+ test_files:
98
+ - test/test_linux.rb
99
+ - test/test_linux_middleware.rb
100
+ - test/test_middleware.rb
101
+ - test/test_raindrops.rb
102
+ - test/test_raindrops_gc.rb
103
+ - test/test_struct.rb