sleepy_penguin 1.0.0 → 1.1.1

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.
data/.document CHANGED
@@ -5,5 +5,6 @@ NEWS
5
5
  ChangeLog
6
6
  lib
7
7
  ext/sleepy_penguin/init.c
8
+ ext/sleepy_penguin/epoll.c
8
9
  ext/sleepy_penguin/eventfd.c
9
10
  ext/sleepy_penguin/timerfd.c
data/.gitignore CHANGED
@@ -18,3 +18,4 @@ pkg/
18
18
  /man
19
19
  tags
20
20
  TAGS
21
+ /LATEST
data/.manifest CHANGED
@@ -1,11 +1,13 @@
1
1
  .document
2
2
  .gitignore
3
3
  .manifest
4
+ .wrongdoc.yml
4
5
  COPYING
5
6
  ChangeLog
6
7
  GIT-VERSION-FILE
7
8
  GIT-VERSION-GEN
8
9
  GNUmakefile
10
+ LATEST
9
11
  LICENSE
10
12
  NEWS
11
13
  README
data/.wrongdoc.yml ADDED
@@ -0,0 +1,4 @@
1
+ ---
2
+ cgit_url: http://git.bogomips.org/cgit/sleepy_penguin.git
3
+ git_url: git://git.bogomips.org/sleepy_penguin.git
4
+ rdoc_url: http://bogomips.org/sleepy_penguin/
data/ChangeLog CHANGED
@@ -1,158 +1,228 @@
1
- ChangeLog from git://git.bogomips.org/sleepy_penguin.git ()
1
+ ChangeLog from http://git.bogomips.org/cgit/sleepy_penguin.git
2
2
 
3
- commit 97e9a7e764f912fddea75409dd388eaf3abe6a73
4
- Author: Eric Wong <e@yhbt.net>
5
- Date: Sun Sep 26 06:29:09 2010 +0000
6
-
7
- update documentation and build
8
-
9
- Should be ready for release
10
-
11
- commit 29bbb053277e9c054f1433c66a2e83ada44a5e8d
12
- Author: Eric Wong <e@yhbt.net>
13
- Date: Sun Sep 26 06:01:23 2010 +0000
14
-
15
- test_epoll: workaround less aggressive GC in rbx
16
-
17
- Some of the GC tests aren't realistic, but if they work in MRI
18
- then we can expect them to work reasonably well everywhere.
19
-
20
- commit 43124e76e219d0be968fdeb09f6389d6895b0caf
21
- Author: Eric Wong <e@yhbt.net>
22
- Date: Sun Sep 26 06:00:10 2010 +0000
23
-
24
- provide rb_io_close() for Rubinius
25
-
26
- Rubinius 1.1.1 does not include this function
27
-
28
- ref: http://github.com/evanphx/rubinius/issues/497
29
-
30
- commit f3fd4447b650e75f48ac0fb9bada9b411c4b89cd
31
- Author: Eric Wong <e@yhbt.net>
32
- Date: Sun Sep 26 05:50:24 2010 +0000
33
-
34
- epoll: fix typo for rb_memerror()
35
-
36
- Tested on Rubinius.
37
-
38
- commit 63b5fa10ae2f196f392bc6a9360ed2343215ce78
39
- Author: Eric Wong <e@yhbt.net>
40
- Date: Sun Sep 26 04:00:30 2010 +0000
41
-
42
- misc documentation updates
43
-
44
- We shall release without SignalFD support
45
-
46
- commit 1ad58cb0fd9045b8fa26b85d68ddf2eb06827dd3
47
- Author: Eric Wong <e@yhbt.net>
48
- Date: Thu Sep 23 05:25:54 2010 +0000
49
-
50
- wire up EventFD class
51
-
52
- This wraps the eventfd(2) interface of Linux. Like TimerFD, it
53
- is not available on older distributions.
54
-
55
- commit 2d5886698c3f7241ab23771c2876b985708ded40
56
- Author: Eric Wong <e@yhbt.net>
57
- Date: Mon Sep 20 16:49:57 2010 +0000
58
-
59
- add TimerFD class
60
-
61
- This wraps the timerfd_* interface in the Linux kernel.
62
- It is not available on older distributions.
63
-
64
- commit 4a9ce0319f6e0250c4a8e01284fd5684936bde21
65
- Author: Eric Wong <normalperson@yhbt.net>
66
- Date: Sun Sep 26 03:49:14 2010 +0000
67
-
68
- epoll: add cross-thread test/example
69
-
70
- This can potentially be very powerful under 1.9
71
- with native threads
72
-
73
- commit 96dad9948d3a7b181d50a9fcb35320677edc352b
74
- Author: Eric Wong <normalperson@yhbt.net>
75
- Date: Sun Sep 26 03:48:50 2010 +0000
76
-
77
- epoll: fix MRI 1.8 build
78
-
79
- It was just st.h in the old days.
80
-
81
- commit a226d237666728ea9242f6079b2c76528d53cdb2
82
- Author: Eric Wong <normalperson@yhbt.net>
83
- Date: Sun Sep 26 02:46:51 2010 +0000
84
-
85
- Epoll#dup and Epoll#clone inherit close-on-exec
86
-
87
- There can be ways (in the future) where supporting
88
- Epoll#dup/Epoll#clone can proveuseful, so continue to
89
- support them until proven otherwise.
90
-
91
- commit 3ca3a23d3e68f62af6d57cf22825b2751c226fff
92
- Author: Eric Wong <normalperson@yhbt.net>
93
- Date: Sun Sep 26 02:12:15 2010 +0000
94
-
95
- simplify epoll_create1 wrapper
96
-
97
- There are no FD flags besides FD_CLOEXEC, so
98
- there's no point in making an extra fcntl()
99
- call.
100
-
101
- commit 43153f218e14cad3a2c6f4056fcf02dc49dc4b36
102
- Author: Eric Wong <normalperson@yhbt.net>
103
- Date: Sun Sep 26 01:41:47 2010 +0000
104
-
105
- epoll: add fork protection
106
-
107
- It's dangerous to preserve epoll descriptors across fork,
108
- especially in Ruby where the GC can invalidate objects at any
109
- time. Installing pthread_atfork hooks prevents VALUE references
110
- stored in the kernel from leaking across process boundaries,
111
- making it far more difficult for a sanely written application to
112
- leak invalid VALUEs to the user.
113
-
114
- commit 81d66a794338e241e00b9ffd66fc94b80064475d
115
- Author: Eric Wong <normalperson@yhbt.net>
116
- Date: Sat Sep 25 20:32:32 2010 +0000
117
-
118
- Epoll#del only takes one argument
119
-
120
- We don't have to emulate the C API exactly, and it
121
- makes life saner/easier for our users.
122
-
123
- commit bc4aaf4afdfb42ad5cc5e0729f816fbefb3d338e
124
- Author: Eric Wong <normalperson@yhbt.net>
125
- Date: Sat Sep 25 20:08:18 2010 +0000
126
-
127
- epoll: factor out event data packing/unpacking
128
-
129
- Storing Ruby object values in the kernel means
130
- they won't be visible to the GC, but for the
131
- most part it's safe.
132
-
133
- commit 6296604742ed27ede171dad28f7d2bec2092d122
134
- Author: Eric Wong <normalperson@yhbt.net>
135
- Date: Sat Sep 25 19:27:09 2010 +0000
136
-
137
- tests for EPOLLET and EINPROGRESS
138
-
139
- Just to make sure edge-triggering works on newly
140
- created TCP connections.
141
-
142
- commit e9e91bd9b9c571e9f3374a4b5aa44573f60c3d32
143
- Author: Eric Wong <normalperson@yhbt.net>
144
- Date: Sat Aug 21 09:00:57 2010 +0000
145
-
146
- extconf: enable detection of {timer,signal,event}fd.h
147
-
148
- commit 7f841e560fae9406192994df352bfb902b2ebbe8
149
- Author: Eric Wong <normalperson@yhbt.net>
150
- Date: Sat Aug 21 09:00:42 2010 +0000
151
-
152
- README: clarify that we're a Ruby library
153
-
154
- commit 133a7dad4b2179093e5bbb7db6db6c31a51817b7
155
- Author: Eric Wong <normalperson@yhbt.net>
156
- Date: Sat Aug 21 08:44:08 2010 +0000
157
-
158
- initial - epoll support working
3
+ commit ab4f1a27e5d2c1688a33870b6d070aaa510ccdbc
4
+ Author: Eric Wong <normalperson@yhbt.net>
5
+ Date: Thu Jan 13 14:26:58 2011 -0800
6
+
7
+ sleepy_penguin 1.1.1 - soft feathers, soft delete
8
+
9
+ SleepyPenguin::Epoll#delete method added for "soft" failures
10
+ Documentation updates and cleanups, the website is now
11
+ JavaScript-free!
12
+
13
+ (Ignore the 1.1.0 "release", it was a lie)
14
+
15
+ commit f1729b7dfcf9b77e68d27304bfd7324724d43989
16
+ Author: Eric Wong <normalperson@yhbt.net>
17
+ Date: Thu Jan 13 14:35:42 2011 -0800
18
+
19
+ packaging fixups, oops
20
+
21
+ Ugh, release got fat-fingered :<
22
+
23
+ commit 7702d83a9a090ae73ace947be807f3f740b9d770
24
+ Author: Eric Wong <normalperson@yhbt.net>
25
+ Date: Thu Jan 13 14:26:58 2011 -0800
26
+
27
+ sleepy_penguin 1.1.0 - soft feathers, soft delete
28
+
29
+ SleepyPenguin::Epoll#delete method added for "soft" failures
30
+ Documentation updates and cleanups, the website is now
31
+ JavaScript-free!
32
+
33
+ commit a29b597e57cfcdf6a25cb4e8c12094e059833878
34
+ Author: Eric Wong <normalperson@yhbt.net>
35
+ Date: Thu Jan 13 14:25:27 2011 -0800
36
+
37
+ epoll: add "delete" for soft failures
38
+
39
+ No need to burden applications.
40
+
41
+ commit 9c44f01af3538fa51eeecd4944cca0ae1bc885b1
42
+ Author: Eric Wong <normalperson@yhbt.net>
43
+ Date: Thu Jan 13 14:09:26 2011 -0800
44
+
45
+ minor doc updates, use wrongdoc
46
+
47
+ Switch documentation over to wrongdoc, no more JavaScript!
48
+ Our documentation still sucks.
49
+
50
+ commit 4e7fdc58a9ce5b3be5f4213ff4d2fbefac7b5cc5
51
+ Author: Eric Wong <normalperson@yhbt.net>
52
+ Date: Thu Jan 13 13:59:56 2011 -0800
53
+
54
+ test_epoll: redundant, redefined method, oops!
55
+
56
+ commit f8a85cee27e4344783d560810a1a51dd43d5a92d
57
+ Author: Eric Wong <normalperson@yhbt.net>
58
+ Date: Thu Jan 13 13:52:30 2011 -0800
59
+
60
+ extconf.rb: remove unnecessary dir_config
61
+
62
+ We do not depend on external libraries other than the
63
+ system C library
64
+
65
+ commit 942e89550795316b01430c3d278c9d8ef20cc617
66
+ Author: Eric Wong <normalperson@yhbt.net>
67
+ Date: Mon Sep 27 17:21:46 2010 -0700
68
+
69
+ README: update summary
70
+
71
+ It seems to make more sense this way... Editors wanted :)
72
+
73
+ commit 97e9a7e764f912fddea75409dd388eaf3abe6a73
74
+ Author: Eric Wong <e@yhbt.net>
75
+ Date: Sun Sep 26 06:29:09 2010 +0000
76
+
77
+ update documentation and build
78
+
79
+ Should be ready for release
80
+
81
+ commit 29bbb053277e9c054f1433c66a2e83ada44a5e8d
82
+ Author: Eric Wong <e@yhbt.net>
83
+ Date: Sun Sep 26 06:01:23 2010 +0000
84
+
85
+ test_epoll: workaround less aggressive GC in rbx
86
+
87
+ Some of the GC tests aren't realistic, but if they work in MRI
88
+ then we can expect them to work reasonably well everywhere.
89
+
90
+ commit 43124e76e219d0be968fdeb09f6389d6895b0caf
91
+ Author: Eric Wong <e@yhbt.net>
92
+ Date: Sun Sep 26 06:00:10 2010 +0000
93
+
94
+ provide rb_io_close() for Rubinius
95
+
96
+ Rubinius 1.1.1 does not include this function
97
+
98
+ ref: http://github.com/evanphx/rubinius/issues/497
99
+
100
+ commit f3fd4447b650e75f48ac0fb9bada9b411c4b89cd
101
+ Author: Eric Wong <e@yhbt.net>
102
+ Date: Sun Sep 26 05:50:24 2010 +0000
103
+
104
+ epoll: fix typo for rb_memerror()
105
+
106
+ Tested on Rubinius.
107
+
108
+ commit 63b5fa10ae2f196f392bc6a9360ed2343215ce78
109
+ Author: Eric Wong <e@yhbt.net>
110
+ Date: Sun Sep 26 04:00:30 2010 +0000
111
+
112
+ misc documentation updates
113
+
114
+ We shall release without SignalFD support
115
+
116
+ commit 1ad58cb0fd9045b8fa26b85d68ddf2eb06827dd3
117
+ Author: Eric Wong <e@yhbt.net>
118
+ Date: Thu Sep 23 05:25:54 2010 +0000
119
+
120
+ wire up EventFD class
121
+
122
+ This wraps the eventfd(2) interface of Linux. Like TimerFD, it
123
+ is not available on older distributions.
124
+
125
+ commit 2d5886698c3f7241ab23771c2876b985708ded40
126
+ Author: Eric Wong <e@yhbt.net>
127
+ Date: Mon Sep 20 16:49:57 2010 +0000
128
+
129
+ add TimerFD class
130
+
131
+ This wraps the timerfd_* interface in the Linux kernel.
132
+ It is not available on older distributions.
133
+
134
+ commit 4a9ce0319f6e0250c4a8e01284fd5684936bde21
135
+ Author: Eric Wong <normalperson@yhbt.net>
136
+ Date: Sun Sep 26 03:49:14 2010 +0000
137
+
138
+ epoll: add cross-thread test/example
139
+
140
+ This can potentially be very powerful under 1.9
141
+ with native threads
142
+
143
+ commit 96dad9948d3a7b181d50a9fcb35320677edc352b
144
+ Author: Eric Wong <normalperson@yhbt.net>
145
+ Date: Sun Sep 26 03:48:50 2010 +0000
146
+
147
+ epoll: fix MRI 1.8 build
148
+
149
+ It was just st.h in the old days.
150
+
151
+ commit a226d237666728ea9242f6079b2c76528d53cdb2
152
+ Author: Eric Wong <normalperson@yhbt.net>
153
+ Date: Sun Sep 26 02:46:51 2010 +0000
154
+
155
+ Epoll#dup and Epoll#clone inherit close-on-exec
156
+
157
+ There can be ways (in the future) where supporting
158
+ Epoll#dup/Epoll#clone can proveuseful, so continue to
159
+ support them until proven otherwise.
160
+
161
+ commit 3ca3a23d3e68f62af6d57cf22825b2751c226fff
162
+ Author: Eric Wong <normalperson@yhbt.net>
163
+ Date: Sun Sep 26 02:12:15 2010 +0000
164
+
165
+ simplify epoll_create1 wrapper
166
+
167
+ There are no FD flags besides FD_CLOEXEC, so
168
+ there's no point in making an extra fcntl()
169
+ call.
170
+
171
+ commit 43153f218e14cad3a2c6f4056fcf02dc49dc4b36
172
+ Author: Eric Wong <normalperson@yhbt.net>
173
+ Date: Sun Sep 26 01:41:47 2010 +0000
174
+
175
+ epoll: add fork protection
176
+
177
+ It's dangerous to preserve epoll descriptors across fork,
178
+ especially in Ruby where the GC can invalidate objects at any
179
+ time. Installing pthread_atfork hooks prevents VALUE references
180
+ stored in the kernel from leaking across process boundaries,
181
+ making it far more difficult for a sanely written application to
182
+ leak invalid VALUEs to the user.
183
+
184
+ commit 81d66a794338e241e00b9ffd66fc94b80064475d
185
+ Author: Eric Wong <normalperson@yhbt.net>
186
+ Date: Sat Sep 25 20:32:32 2010 +0000
187
+
188
+ Epoll#del only takes one argument
189
+
190
+ We don't have to emulate the C API exactly, and it
191
+ makes life saner/easier for our users.
192
+
193
+ commit bc4aaf4afdfb42ad5cc5e0729f816fbefb3d338e
194
+ Author: Eric Wong <normalperson@yhbt.net>
195
+ Date: Sat Sep 25 20:08:18 2010 +0000
196
+
197
+ epoll: factor out event data packing/unpacking
198
+
199
+ Storing Ruby object values in the kernel means
200
+ they won't be visible to the GC, but for the
201
+ most part it's safe.
202
+
203
+ commit 6296604742ed27ede171dad28f7d2bec2092d122
204
+ Author: Eric Wong <normalperson@yhbt.net>
205
+ Date: Sat Sep 25 19:27:09 2010 +0000
206
+
207
+ tests for EPOLLET and EINPROGRESS
208
+
209
+ Just to make sure edge-triggering works on newly
210
+ created TCP connections.
211
+
212
+ commit e9e91bd9b9c571e9f3374a4b5aa44573f60c3d32
213
+ Author: Eric Wong <normalperson@yhbt.net>
214
+ Date: Sat Aug 21 09:00:57 2010 +0000
215
+
216
+ extconf: enable detection of {timer,signal,event}fd.h
217
+
218
+ commit 7f841e560fae9406192994df352bfb902b2ebbe8
219
+ Author: Eric Wong <normalperson@yhbt.net>
220
+ Date: Sat Aug 21 09:00:42 2010 +0000
221
+
222
+ README: clarify that we're a Ruby library
223
+
224
+ commit 133a7dad4b2179093e5bbb7db6db6c31a51817b7
225
+ Author: Eric Wong <normalperson@yhbt.net>
226
+ Date: Sat Aug 21 08:44:08 2010 +0000
227
+
228
+ initial - epoll support working
data/GIT-VERSION-FILE CHANGED
@@ -1 +1 @@
1
- GIT_VERSION = 1.0.0
1
+ GIT_VERSION = 1.1.1
data/GIT-VERSION-GEN CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/bin/sh
2
2
 
3
3
  GVF=GIT-VERSION-FILE
4
- DEF_VER=v1.0.0.GIT
4
+ DEF_VER=v1.1.1.GIT
5
5
 
6
6
  LF='
7
7
  '
data/GNUmakefile CHANGED
@@ -3,7 +3,6 @@ all::
3
3
  RUBY = ruby
4
4
  RAKE = rake
5
5
  RSYNC = rsync
6
- GIT_URL = git://git.bogomips.org/sleepy_penguin.git
7
6
 
8
7
  GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
9
8
  @./GIT-VERSION-GEN
@@ -28,60 +27,27 @@ install:
28
27
  setup_rb_files := .config InstalledFiles
29
28
  prep_setup_rb := @-$(RM) $(setup_rb_files);$(MAKE) -C $(ext) clean
30
29
 
30
+ extdir := ext/sleepy_penguin
31
31
  clean:
32
- -$(MAKE) -C ext/sleepy_penguin clean
33
- $(RM) $(setup_rb_files) ext/sleepy_penguin/Makefile
34
-
35
- pkg_extra := GIT-VERSION-FILE NEWS ChangeLog
36
- manifest: $(pkg_extra)
37
- $(RM) .manifest
38
- $(MAKE) .manifest
39
-
40
- .manifest:
41
- (git ls-files && \
42
- for i in $@ $(pkg_extra); \
43
- do echo $$i; done) | LC_ALL=C sort > $@+
44
- cmp $@+ $@ || mv $@+ $@
45
- $(RM) $@+
32
+ -$(MAKE) -C $(extdir) clean
33
+ $(RM) $(setup_rb_files) $(extdir)/Makefile
46
34
 
47
- NEWS: GIT-VERSION-FILE
48
- $(RAKE) -s news_rdoc > $@+
49
- mv $@+ $@
50
-
51
- latest: NEWS
52
- @awk 'BEGIN{RS="=== ";ORS=""}NR==2{sub(/\n$$/,"");print RS""$$0 }' $<
35
+ pkg_extra := GIT-VERSION-FILE NEWS ChangeLog LATEST
36
+ ChangeLog: GIT-VERSION-FILE .wrongdoc.yml
37
+ wrongdoc prepare
53
38
 
54
- SINCE =
55
- ChangeLog: LOG_VERSION = \
56
- $(shell git rev-parse -q "$(GIT_VERSION)" >/dev/null 2>&1 && \
57
- echo $(GIT_VERSION) || git describe)
58
- ifneq ($(SINCE),)
59
- ChangeLog: log_range = v$(SINCE)..$(LOG_VERSION)
60
- endif
61
- ChangeLog: GIT-VERSION-FILE
62
- @echo "ChangeLog from $(GIT_URL) ($(log_range))" > $@+
63
- @echo >> $@+
64
- git log $(log_range) | sed -e 's/^/ /' >> $@+
65
- mv $@+ $@
66
-
67
- news_atom := http://bogomips.org/sleepy_penguin/NEWS.atom.xml
68
- cgit_atom := http://git.bogomips.org/cgit/sleepy_penguin.git/atom/?h=master
69
- atom = <link rel="alternate" title="Atom feed" href="$(1)" \
70
- type="application/atom+xml"/>
39
+ .manifest: ChangeLog
40
+ (git ls-files && for i in $@ $(pkg_extra); do echo $$i; done) | \
41
+ LC_ALL=C sort > $@+
42
+ cmp $@+ $@ || mv $@+ $@
43
+ $(RM) $@+
71
44
 
72
- # using rdoc 2.5.x
73
- doc: .document NEWS ChangeLog
74
- rdoc -t "$(shell sed -ne '1s/^= //p' README)"
45
+ doc: .document .wrongdoc.yml
46
+ find lib ext -type f -name '*.rbc' -exec rm -f '{}' ';'
47
+ $(RM) -r doc
48
+ wrongdoc all
75
49
  install -m644 COPYING doc/COPYING
76
50
  install -m644 $(shell grep '^[A-Z]' .document) doc/
77
- $(RUBY) -i -p -e \
78
- '$$_.gsub!("</title>",%q{\&$(call atom,$(cgit_atom))})' \
79
- doc/ChangeLog.html
80
- $(RUBY) -i -p -e \
81
- '$$_.gsub!("</title>",%q{\&$(call atom,$(news_atom))})' \
82
- doc/NEWS.html doc/README.html
83
- $(RAKE) -s news_atom > doc/NEWS.atom.xml
84
- cd doc && ln README.html tmp && mv tmp index.html
85
51
 
86
52
  ifneq ($(VERSION),)
87
53
  rfproject := rainbows
@@ -94,10 +60,10 @@ release_changes := release_changes-$(VERSION)
94
60
  release-notes: $(release_notes)
95
61
  release-changes: $(release_changes)
96
62
  $(release_changes):
97
- $(RAKE) -s release_changes > $@+
63
+ wrongdoc release_changes > $@+
98
64
  $(VISUAL) $@+ && test -s $@+ && mv $@+ $@
99
65
  $(release_notes):
100
- GIT_URL=$(GIT_URL) $(RAKE) -s release_notes > $@+
66
+ wrongdoc release_notes > $@+
101
67
  $(VISUAL) $@+ && test -s $@+ && mv $@+ $@
102
68
 
103
69
  # ensures we're actually on the tagged $(VERSION), only used for release
@@ -117,19 +83,19 @@ gem: $(pkggem)
117
83
  install-gem: $(pkggem)
118
84
  gem install $(CURDIR)/$<
119
85
 
120
- $(pkggem): manifest fix-perms
86
+ $(pkggem): .manifest fix-perms
121
87
  gem build $(rfpackage).gemspec
122
88
  mkdir -p pkg
123
89
  mv $(@F) $@
124
90
 
125
91
  $(pkgtgz): distdir = $(basename $@)
126
92
  $(pkgtgz): HEAD = v$(VERSION)
127
- $(pkgtgz): manifest fix-perms
93
+ $(pkgtgz): .manifest fix-perms
128
94
  @test -n "$(distdir)"
129
95
  $(RM) -r $(distdir)
130
96
  mkdir -p $(distdir)
131
- tar c `cat .manifest` | (cd $(distdir) && tar x)
132
- cd pkg && tar c $(basename $(@F)) | gzip -9 > $(@F)+
97
+ tar cf - `cat .manifest` | (cd $(distdir) && tar xf -)
98
+ cd pkg && tar cf - $(basename $(@F)) | gzip -9 > $(@F)+
133
99
  mv $@+ $@
134
100
 
135
101
  package: $(pkgtgz) $(pkggem)
@@ -139,7 +105,7 @@ release: verify package $(release_notes) $(release_changes)
139
105
  # make tgz release on RubyForge
140
106
  rubyforge add_release -f -n $(release_notes) -a $(release_changes) \
141
107
  $(rfproject) $(rfpackage) $(VERSION) $(pkgtgz)
142
- # push gem to Gemcutter
108
+ # push gem to RubyGems.org
143
109
  gem push $(pkggem)
144
110
  # in case of gem downloads from RubyForge releases page
145
111
  -rubyforge add_file \
@@ -151,12 +117,12 @@ gem install-gem: GIT-VERSION-FILE
151
117
  $(MAKE) $@ VERSION=$(GIT_VERSION)
152
118
  endif
153
119
 
154
- extdir := ext/sleepy_penguin
155
120
  ext := $(extdir)/sleepy_penguin_ext.$(DLEXT)
156
121
  $(extdir)/Makefile: $(extdir)/extconf.rb
157
122
  cd $(@D) && $(RUBY) extconf.rb
158
123
 
159
- $(ext): $(wildcard $(extdir)/*.c) $(wildcard $(extdir)/*.h) $(extdir)/Makefile
124
+ c_files := $(wildcard $(extdir)/*.[ch] $(extdir)/*/*.h)
125
+ $(ext): $(c_files) $(extdir)/Makefile
160
126
  $(MAKE) -C $(@D)
161
127
 
162
128
  all:: test
@@ -171,11 +137,9 @@ $(test_units): build
171
137
  # this requires GNU coreutils variants
172
138
  publish_doc:
173
139
  -git set-file-times
174
- $(RM) -r doc ChangeLog NEWS
175
- $(MAKE) doc LOG_VERSION=$(shell git tag -l | tail -1)
176
- $(MAKE) -s latest > doc/LATEST
177
- find doc/images doc/js -type f | \
178
- TZ=UTC xargs touch -d '1970-01-01 00:00:00' doc/rdoc.css
140
+ $(MAKE) doc
141
+ find doc/images -type f | \
142
+ TZ=UTC xargs touch -d '1970-01-01 00:00:06' doc/rdoc.css
179
143
  $(MAKE) doc_gz
180
144
  chmod 644 $$(find doc -type f)
181
145
  $(RSYNC) -av doc/ bogomips.org:/srv/bogomips/sleepy_penguin/
@@ -185,8 +149,7 @@ publish_doc:
185
149
  # "gzip_static on" can serve the gzipped versions directly.
186
150
  doc_gz: docs = $(shell find doc -type f ! -regex '^.*\.\(gif\|jpg\|png\|gz\)$$')
187
151
  doc_gz:
188
- touch doc/NEWS.atom.xml -d "$$(awk 'NR==1{print $$4,$$5,$$6}' NEWS)"
189
152
  for i in $(docs); do \
190
153
  gzip --rsyncable -9 < $$i > $$i.gz; touch -r $$i $$i.gz; done
191
154
 
192
- .PHONY: .FORCE-GIT-VERSION-FILE doc manifest man test $(test_units)
155
+ .PHONY: .FORCE-GIT-VERSION-FILE doc test $(test_units)
data/LATEST ADDED
@@ -0,0 +1,8 @@
1
+ === sleepy_penguin 1.1.1 - soft feathers, soft delete / 2011-01-13 22:41 UTC
2
+
3
+ SleepyPenguin::Epoll#delete method added for "soft" failures
4
+ Documentation updates and cleanups, the website is now
5
+ JavaScript-free!
6
+
7
+ (Ignore the 1.1.0 "release", it was a lie)
8
+
data/NEWS CHANGED
@@ -1,4 +1,12 @@
1
- === 1.0.0 / 2010-09-26 06:31 UTC
1
+ === sleepy_penguin 1.1.1 - soft feathers, soft delete / 2011-01-13 22:41 UTC
2
+
3
+ SleepyPenguin::Epoll#delete method added for "soft" failures
4
+ Documentation updates and cleanups, the website is now
5
+ JavaScript-free!
6
+
7
+ (Ignore the 1.1.0 "release", it was a lie)
8
+
9
+ === sleepy_penguin 1.0.0 / 2010-09-26 06:31 UTC
2
10
 
3
11
  Initial release
4
12
 
data/README CHANGED
@@ -1,4 +1,4 @@
1
- = sleepy_penguin - Ruby I/O events for Linux
1
+ = sleepy_penguin - Linux I/O events for Ruby
2
2
 
3
3
  sleepy_penguin provides access to newer, Linux-only system calls to wait
4
4
  on events from traditionally non-I/O sources. Bindings to the eventfd,
data/Rakefile CHANGED
@@ -1,106 +1,8 @@
1
1
  # -*- encoding: binary -*-
2
- # most tasks are in the GNUmakefile which offers better parallelism
3
- def tags
4
- timefmt = '%Y-%m-%dT%H:%M:%SZ'
5
- @tags ||= `git tag -l`.split(/\n/).map do |tag|
6
- if %r{\Av[\d\.]+\z} =~ tag
7
- header, subject, body = `git cat-file tag #{tag}`.split(/\n\n/, 3)
8
- header = header.split(/\n/)
9
- tagger = header.grep(/\Atagger /).first
10
- body ||= "initial"
11
- {
12
- :time => Time.at(tagger.split(/ /)[-2].to_i).utc.strftime(timefmt),
13
- :tagger_name => %r{^tagger ([^<]+)}.match(tagger)[1].strip,
14
- :tagger_email => %r{<([^>]+)>}.match(tagger)[1].strip,
15
- :id => `git rev-parse refs/tags/#{tag}`.chomp!,
16
- :tag => tag,
17
- :subject => subject,
18
- :body => body,
19
- }
20
- end
21
- end.compact.sort { |a,b| b[:time] <=> a[:time] }
22
- end
23
-
24
2
  cgit_url = "http://git.bogomips.org/cgit/sleepy_penguin.git"
25
- git_url = ENV['GIT_URL'] || 'git://git.bogomips.org/sleepy_penguin.git'
26
- web_url = "http://bogomips.org/sleepy_penguin"
27
-
28
- desc 'prints news as an Atom feed'
29
- task :news_atom do
30
- require 'nokogiri'
31
- new_tags = tags[0,10]
32
- puts(Nokogiri::XML::Builder.new do
33
- feed :xmlns => "http://www.w3.org/2005/Atom" do
34
- id! "#{web_url}NEWS.atom.xml"
35
- title "sleepy_penguin news"
36
- subtitle "epoll"
37
- link! :rel => "alternate", :type => "text/html",
38
- :href => "#{web_url}NEWS.html"
39
- updated(new_tags.empty? ? "1970-01-01T00:00:00Z" : new_tags.first[:time])
40
- new_tags.each do |tag|
41
- entry do
42
- title tag[:subject]
43
- updated tag[:time]
44
- published tag[:time]
45
- author {
46
- name tag[:tagger_name]
47
- email tag[:tagger_email]
48
- }
49
- url = "#{cgit_url}/tag/?id=#{tag[:tag]}"
50
- link! :rel => "alternate", :type => "text/html", :href =>url
51
- id! url
52
- message_only = tag[:body].split(/\n.+\(\d+\):\n {6}/s).first.strip
53
- content({:type =>:text}, message_only)
54
- content(:type =>:xhtml) { pre tag[:body] }
55
- end
56
- end
57
- end
58
- end.to_xml)
59
- end
60
-
61
- desc 'prints RDoc-formatted news'
62
- task :news_rdoc do
63
- tags.each do |tag|
64
- time = tag[:time].tr!('T', ' ').gsub!(/:\d\dZ/, ' UTC')
65
- puts "=== #{tag[:tag].sub(/^v/, '')} / #{time}"
66
- puts ""
67
-
68
- body = tag[:body]
69
- puts tag[:body].gsub(/^/sm, " ").gsub(/[ \t]+$/sm, "")
70
- puts ""
71
- end
72
- end
73
-
74
- desc "print release changelog for Rubyforge"
75
- task :release_changes do
76
- version = ENV['VERSION'] or abort "VERSION= needed"
77
- version = "v#{version}"
78
- vtags = tags.map { |tag| tag[:tag] =~ /\Av/ and tag[:tag] }.sort
79
- prev = vtags[vtags.index(version) - 1]
80
- if prev
81
- system('git', 'diff', '--stat', prev, version) or abort $?
82
- puts ""
83
- system('git', 'log', "#{prev}..#{version}") or abort $?
84
- else
85
- system('git', 'log', version) or abort $?
86
- end
87
- end
88
-
89
- desc "print release notes for Rubyforge"
90
- task :release_notes do
91
- spec = Gem::Specification.load('sleepy_penguin.gemspec')
92
- puts spec.description.strip
93
- puts ""
94
- puts "* #{spec.homepage}"
95
- puts "* #{spec.email}"
96
- puts "* #{git_url}"
97
-
98
- _, _, body = `git cat-file tag v#{spec.version}`.split(/\n\n/, 3)
99
- print "\nChanges:\n\n"
100
- puts body
101
- end
3
+ git_url = 'git://git.bogomips.org/sleepy_penguin.git'
102
4
 
103
- desc "read news article from STDIN and post to rubyforge"
5
+ desc "post news article to rubyforge"
104
6
  task :publish_news do
105
7
  require 'rubyforge'
106
8
  spec = Gem::Specification.load('sleepy_penguin.gemspec')
@@ -206,6 +206,8 @@ static VALUE ctl(VALUE self, VALUE io, VALUE flags, int op)
206
206
  }
207
207
 
208
208
  /*
209
+ * used to avoid exceptions when your app is too lazy to check
210
+ * what state a descriptor is in
209
211
  */
210
212
  static VALUE set(VALUE self, VALUE io, VALUE flags)
211
213
  {
@@ -232,6 +234,29 @@ static VALUE set(VALUE self, VALUE io, VALUE flags)
232
234
  return INT2NUM(rv);
233
235
  }
234
236
 
237
+ /*
238
+ * Deletes an +io+ from an epoll set, but returns nil
239
+ * on ENOENT instead of raising an error. This is useful
240
+ * for apps that do not care to track the status of an
241
+ * epoll object itself.
242
+ */
243
+ static VALUE delete(VALUE self, VALUE io)
244
+ {
245
+ struct rb_epoll *ep = ep_get(self);
246
+ int fd = my_fileno(io);
247
+ int rv;
248
+
249
+ ep_check(ep);
250
+ rv = epoll_ctl(ep->fd, EPOLL_CTL_DEL, fd, NULL);
251
+ if (rv == -1) {
252
+ if (errno != ENOENT)
253
+ rb_sys_fail("epoll_ctl - del");
254
+ errno = 0;
255
+ return Qnil;
256
+ }
257
+ return INT2NUM(rv);
258
+ }
259
+
235
260
  static VALUE epwait_result(struct rb_epoll *ep, int n)
236
261
  {
237
262
  int i;
@@ -375,6 +400,13 @@ static VALUE real_epwait(struct rb_epoll *ep)
375
400
  }
376
401
  #endif /* 1.8 Green thread compatibility code */
377
402
 
403
+ /*
404
+ * Calls epoll_wait(2) and yields
405
+ *
406
+ * :call-seq:
407
+ *
408
+ * epoll.wait(64, 1000) { |flags, obj| ... }
409
+ */
378
410
  static VALUE epwait(int argc, VALUE *argv, VALUE self)
379
411
  {
380
412
  VALUE timeout, maxevents;
@@ -529,7 +561,7 @@ void sleepy_penguin_init_epoll(void)
529
561
  {
530
562
  VALUE mSleepyPenguin, cEpoll;
531
563
 
532
- mSleepyPenguin = rb_const_get(rb_cObject, rb_intern("SleepyPenguin"));
564
+ mSleepyPenguin = rb_define_module("SleepyPenguin");
533
565
  cEpoll = rb_define_class_under(mSleepyPenguin, "Epoll", rb_cObject);
534
566
  cEpoll_IO = rb_define_class_under(cEpoll, "IO", rb_cIO);
535
567
  rb_define_method(cEpoll, "initialize", init, -1);
@@ -541,6 +573,7 @@ void sleepy_penguin_init_epoll(void)
541
573
  rb_define_method(cEpoll, "add", add, 2);
542
574
  rb_define_method(cEpoll, "mod", mod, 2);
543
575
  rb_define_method(cEpoll, "del", del, 1);
576
+ rb_define_method(cEpoll, "delete", delete, 1);
544
577
  rb_define_method(cEpoll, "set", set, 2);
545
578
  rb_define_method(cEpoll, "wait", epwait, -1);
546
579
  rb_define_const(cEpoll, "CLOEXEC", INT2NUM(EPOLL_CLOEXEC));
@@ -156,7 +156,7 @@ void sleepy_penguin_init_eventfd(void)
156
156
  {
157
157
  VALUE mSleepyPenguin, cEventFD;
158
158
 
159
- mSleepyPenguin = rb_const_get(rb_cObject, rb_intern("SleepyPenguin"));
159
+ mSleepyPenguin = rb_define_module("SleepyPenguin");
160
160
  cEventFD = rb_define_class_under(mSleepyPenguin, "EventFD", rb_cIO);
161
161
  rb_define_singleton_method(cEventFD, "new", create, -1);
162
162
  #ifdef EFD_NONBLOCK
@@ -9,5 +9,4 @@ have_func('rb_io_close')
9
9
  have_func('epoll_create1', %w(sys/epoll.h))
10
10
  have_func('rb_thread_blocking_region')
11
11
  have_library('pthread')
12
- dir_config('sleepy_penguin')
13
12
  create_makefile('sleepy_penguin_ext')
@@ -107,7 +107,7 @@ void sleepy_penguin_init_timerfd(void)
107
107
  {
108
108
  VALUE mSleepyPenguin, cTimerFD;
109
109
 
110
- mSleepyPenguin = rb_const_get(rb_cObject, rb_intern("SleepyPenguin"));
110
+ mSleepyPenguin = rb_define_module("SleepyPenguin");
111
111
  cTimerFD = rb_define_class_under(mSleepyPenguin, "TimerFD", rb_cIO);
112
112
  rb_define_singleton_method(cTimerFD, "create", create, -1);
113
113
  rb_define_singleton_method(cTimerFD, "new", create, -1);
@@ -1,7 +1,7 @@
1
1
  # -*- encoding: binary -*-
2
2
  module SleepyPenguin
3
3
 
4
- # the version of sleepy penguin, currently 1.0.0
5
- SLEEPY_PENGUIN_VERSION = '1.0.0'
4
+ # the version of sleepy_penguin, currently 1.1.1
5
+ SLEEPY_PENGUIN_VERSION = '1.1.1'
6
6
  end
7
7
  require 'sleepy_penguin_ext'
@@ -1,36 +1,26 @@
1
1
  ENV["VERSION"] or abort "VERSION= must be specified"
2
2
  manifest = File.readlines('.manifest').map! { |x| x.chomp! }
3
- summary = File.readlines("README")[0].gsub(/\A=\s+\S+[^\w]+/, '').strip
4
- description = File.read("README").split(/\n\n/)[1].strip
3
+ require 'wrongdoc'
4
+ extend Wrongdoc::Gemspec
5
+ name, summary, title = readme_metadata
5
6
 
6
7
  Gem::Specification.new do |s|
7
8
  s.name = %q{sleepy_penguin}
8
- s.version = ENV["VERSION"]
9
-
9
+ s.version = ENV["VERSION"].dup
10
10
  s.homepage = 'http://bogomips.org/sleepy_penguin/'
11
- s.authors = ["sleepy_penguin hackers"]
11
+ s.authors = ["#{name} hackers"]
12
12
  s.date = Time.now.utc.strftime('%Y-%m-%d')
13
- s.description = description
13
+ s.description = readme_description
14
14
  s.email = %q{sleepy.penguin@librelist.com}
15
-
16
- s.extra_rdoc_files = File.readlines('.document').map! do |x|
17
- x.chomp!
18
- if File.directory?(x)
19
- manifest.grep(%r{\A#{x}/})
20
- elsif File.file?(x)
21
- x
22
- else
23
- nil
24
- end
25
- end.flatten.compact
26
-
15
+ s.extra_rdoc_files = extra_rdoc_files(manifest)
27
16
  s.files = manifest
28
- s.rdoc_options = [ "-t", summary ]
17
+ s.rdoc_options = rdoc_options
29
18
  s.require_paths = %w(lib ext)
30
19
  s.rubyforge_project = %q{rainbows}
31
20
  s.summary = summary
32
21
  s.test_files = Dir['test/test_*.rb']
33
22
  s.extensions = %w(ext/sleepy_penguin/extconf.rb)
23
+ s.add_development_dependency('wrongdoc', '~> 1.3')
34
24
 
35
25
  # s.license = %w(LGPL) # disabled for compatibility with older RubyGems
36
26
  end
data/test/test_epoll.rb CHANGED
@@ -14,10 +14,6 @@ class TestEpoll < Test::Unit::TestCase
14
14
  @ep = Epoll.new
15
15
  end
16
16
 
17
- def teardown
18
- [ @rd, @wr, @ep ].each { |io| io.close unless io.closed? }
19
- end
20
-
21
17
  def test_cross_thread
22
18
  tmp = []
23
19
  Thread.new { sleep 0.100; @ep.add(@wr, Epoll::OUT) }
@@ -317,4 +313,12 @@ class TestEpoll < Test::Unit::TestCase
317
313
  io = Epoll.new.to_io
318
314
  assert((io.fcntl(Fcntl::F_GETFD) & Fcntl::FD_CLOEXEC) == Fcntl::FD_CLOEXEC)
319
315
  end
316
+
317
+ def test_delete
318
+ assert_nil @ep.delete(@rd)
319
+ assert_nil @ep.delete(@wr)
320
+ assert_nothing_raised { @ep.add @rd, Epoll::IN }
321
+ assert_equal 0, @ep.delete(@rd)
322
+ assert_nil @ep.delete(@rd)
323
+ end
320
324
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sleepy_penguin
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
- - 0
9
- - 0
10
- version: 1.0.0
8
+ - 1
9
+ - 1
10
+ version: 1.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - sleepy_penguin hackers
@@ -15,10 +15,24 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-26 00:00:00 +00:00
18
+ date: 2011-01-13 00:00:00 +00:00
19
19
  default_executable:
20
- dependencies: []
21
-
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: wrongdoc
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ hash: 9
30
+ segments:
31
+ - 1
32
+ - 3
33
+ version: "1.3"
34
+ type: :development
35
+ version_requirements: *id001
22
36
  description: |-
23
37
  sleepy_penguin provides access to newer, Linux-only system calls to wait
24
38
  on events from traditionally non-I/O sources. Bindings to the eventfd,
@@ -36,17 +50,20 @@ extra_rdoc_files:
36
50
  - ChangeLog
37
51
  - lib/sleepy_penguin.rb
38
52
  - ext/sleepy_penguin/init.c
53
+ - ext/sleepy_penguin/epoll.c
39
54
  - ext/sleepy_penguin/eventfd.c
40
55
  - ext/sleepy_penguin/timerfd.c
41
56
  files:
42
57
  - .document
43
58
  - .gitignore
44
59
  - .manifest
60
+ - .wrongdoc.yml
45
61
  - COPYING
46
62
  - ChangeLog
47
63
  - GIT-VERSION-FILE
48
64
  - GIT-VERSION-GEN
49
65
  - GNUmakefile
66
+ - LATEST
50
67
  - LICENSE
51
68
  - NEWS
52
69
  - README
@@ -73,7 +90,9 @@ licenses: []
73
90
  post_install_message:
74
91
  rdoc_options:
75
92
  - -t
76
- - Ruby I/O events for Linux
93
+ - sleepy_penguin - Linux I/O events for Ruby
94
+ - -W
95
+ - http://git.bogomips.org/cgit/sleepy_penguin.git/tree/%s
77
96
  require_paths:
78
97
  - lib
79
98
  - ext
@@ -101,7 +120,7 @@ rubyforge_project: rainbows
101
120
  rubygems_version: 1.3.7
102
121
  signing_key:
103
122
  specification_version: 3
104
- summary: Ruby I/O events for Linux
123
+ summary: Linux I/O events for Ruby
105
124
  test_files:
106
125
  - test/test_epoll.rb
107
126
  - test/test_eventfd.rb