kgio 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,9 @@
1
+ LICENSE
2
+ README
3
+ TODO
4
+ NEWS
5
+ ChangeLog
6
+ ISSUES
7
+ HACKING
8
+ lib
9
+ ext/kgio/kgio_ext.c
@@ -0,0 +1,20 @@
1
+ /local.mk
2
+ *.o
3
+ *.log
4
+ *.so
5
+ *.rbc
6
+ /.config
7
+ /InstalledFiles
8
+ /doc
9
+ /local.mk
10
+ /test/install-*
11
+ Makefile
12
+ log/
13
+ pkg/
14
+ /NEWS
15
+ /ChangeLog
16
+ /.manifest
17
+ /GIT-VERSION-FILE
18
+ /man
19
+ tags
20
+ TAGS
data/COPYING ADDED
@@ -0,0 +1,165 @@
1
+ GNU LESSER GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+
9
+ This version of the GNU Lesser General Public License incorporates
10
+ the terms and conditions of version 3 of the GNU General Public
11
+ License, supplemented by the additional permissions listed below.
12
+
13
+ 0. Additional Definitions.
14
+
15
+ As used herein, "this License" refers to version 3 of the GNU Lesser
16
+ General Public License, and the "GNU GPL" refers to version 3 of the GNU
17
+ General Public License.
18
+
19
+ "The Library" refers to a covered work governed by this License,
20
+ other than an Application or a Combined Work as defined below.
21
+
22
+ An "Application" is any work that makes use of an interface provided
23
+ by the Library, but which is not otherwise based on the Library.
24
+ Defining a subclass of a class defined by the Library is deemed a mode
25
+ of using an interface provided by the Library.
26
+
27
+ A "Combined Work" is a work produced by combining or linking an
28
+ Application with the Library. The particular version of the Library
29
+ with which the Combined Work was made is also called the "Linked
30
+ Version".
31
+
32
+ The "Minimal Corresponding Source" for a Combined Work means the
33
+ Corresponding Source for the Combined Work, excluding any source code
34
+ for portions of the Combined Work that, considered in isolation, are
35
+ based on the Application, and not on the Linked Version.
36
+
37
+ The "Corresponding Application Code" for a Combined Work means the
38
+ object code and/or source code for the Application, including any data
39
+ and utility programs needed for reproducing the Combined Work from the
40
+ Application, but excluding the System Libraries of the Combined Work.
41
+
42
+ 1. Exception to Section 3 of the GNU GPL.
43
+
44
+ You may convey a covered work under sections 3 and 4 of this License
45
+ without being bound by section 3 of the GNU GPL.
46
+
47
+ 2. Conveying Modified Versions.
48
+
49
+ If you modify a copy of the Library, and, in your modifications, a
50
+ facility refers to a function or data to be supplied by an Application
51
+ that uses the facility (other than as an argument passed when the
52
+ facility is invoked), then you may convey a copy of the modified
53
+ version:
54
+
55
+ a) under this License, provided that you make a good faith effort to
56
+ ensure that, in the event an Application does not supply the
57
+ function or data, the facility still operates, and performs
58
+ whatever part of its purpose remains meaningful, or
59
+
60
+ b) under the GNU GPL, with none of the additional permissions of
61
+ this License applicable to that copy.
62
+
63
+ 3. Object Code Incorporating Material from Library Header Files.
64
+
65
+ The object code form of an Application may incorporate material from
66
+ a header file that is part of the Library. You may convey such object
67
+ code under terms of your choice, provided that, if the incorporated
68
+ material is not limited to numerical parameters, data structure
69
+ layouts and accessors, or small macros, inline functions and templates
70
+ (ten or fewer lines in length), you do both of the following:
71
+
72
+ a) Give prominent notice with each copy of the object code that the
73
+ Library is used in it and that the Library and its use are
74
+ covered by this License.
75
+
76
+ b) Accompany the object code with a copy of the GNU GPL and this license
77
+ document.
78
+
79
+ 4. Combined Works.
80
+
81
+ You may convey a Combined Work under terms of your choice that,
82
+ taken together, effectively do not restrict modification of the
83
+ portions of the Library contained in the Combined Work and reverse
84
+ engineering for debugging such modifications, if you also do each of
85
+ the following:
86
+
87
+ a) Give prominent notice with each copy of the Combined Work that
88
+ the Library is used in it and that the Library and its use are
89
+ covered by this License.
90
+
91
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
92
+ document.
93
+
94
+ c) For a Combined Work that displays copyright notices during
95
+ execution, include the copyright notice for the Library among
96
+ these notices, as well as a reference directing the user to the
97
+ copies of the GNU GPL and this license document.
98
+
99
+ d) Do one of the following:
100
+
101
+ 0) Convey the Minimal Corresponding Source under the terms of this
102
+ License, and the Corresponding Application Code in a form
103
+ suitable for, and under terms that permit, the user to
104
+ recombine or relink the Application with a modified version of
105
+ the Linked Version to produce a modified Combined Work, in the
106
+ manner specified by section 6 of the GNU GPL for conveying
107
+ Corresponding Source.
108
+
109
+ 1) Use a suitable shared library mechanism for linking with the
110
+ Library. A suitable mechanism is one that (a) uses at run time
111
+ a copy of the Library already present on the user's computer
112
+ system, and (b) will operate properly with a modified version
113
+ of the Library that is interface-compatible with the Linked
114
+ Version.
115
+
116
+ e) Provide Installation Information, but only if you would otherwise
117
+ be required to provide such information under section 6 of the
118
+ GNU GPL, and only to the extent that such information is
119
+ necessary to install and execute a modified version of the
120
+ Combined Work produced by recombining or relinking the
121
+ Application with a modified version of the Linked Version. (If
122
+ you use option 4d0, the Installation Information must accompany
123
+ the Minimal Corresponding Source and Corresponding Application
124
+ Code. If you use option 4d1, you must provide the Installation
125
+ Information in the manner specified by section 6 of the GNU GPL
126
+ for conveying Corresponding Source.)
127
+
128
+ 5. Combined Libraries.
129
+
130
+ You may place library facilities that are a work based on the
131
+ Library side by side in a single library together with other library
132
+ facilities that are not Applications and are not covered by this
133
+ License, and convey such a combined library under terms of your
134
+ choice, if you do both of the following:
135
+
136
+ a) Accompany the combined library with a copy of the same work based
137
+ on the Library, uncombined with any other library facilities,
138
+ conveyed under the terms of this License.
139
+
140
+ b) Give prominent notice with the combined library that part of it
141
+ is a work based on the Library, and explaining where to find the
142
+ accompanying uncombined form of the same work.
143
+
144
+ 6. Revised Versions of the GNU Lesser General Public License.
145
+
146
+ The Free Software Foundation may publish revised and/or new versions
147
+ of the GNU Lesser General Public License from time to time. Such new
148
+ versions will be similar in spirit to the present version, but may
149
+ differ in detail to address new problems or concerns.
150
+
151
+ Each version is given a distinguishing version number. If the
152
+ Library as you received it specifies that a certain numbered version
153
+ of the GNU Lesser General Public License "or any later version"
154
+ applies to it, you have the option of following the terms and
155
+ conditions either of that published version or of any later version
156
+ published by the Free Software Foundation. If the Library as you
157
+ received it does not specify a version number of the GNU Lesser
158
+ General Public License, you may choose any version of the GNU Lesser
159
+ General Public License ever published by the Free Software Foundation.
160
+
161
+ If the Library as you received it specifies that a proxy can decide
162
+ whether future versions of the GNU Lesser General Public License shall
163
+ apply, that proxy's public statement of acceptance of any version is
164
+ permanent authorization for you to choose that version for the
165
+ Library.
@@ -0,0 +1,40 @@
1
+ #!/bin/sh
2
+
3
+ GVF=GIT-VERSION-FILE
4
+ DEF_VER=v1.0.1.GIT
5
+
6
+ LF='
7
+ '
8
+
9
+ # First see if there is a version file (included in release tarballs),
10
+ # then try git-describe, then default.
11
+ if test -f version
12
+ then
13
+ VN=$(cat version) || VN="$DEF_VER"
14
+ elif test -d .git -o -f .git &&
15
+ VN=$(git describe --abbrev=4 HEAD 2>/dev/null) &&
16
+ case "$VN" in
17
+ *$LF*) (exit 1) ;;
18
+ v[0-9]*)
19
+ git update-index -q --refresh
20
+ test -z "$(git diff-index --name-only HEAD --)" ||
21
+ VN="$VN-dirty" ;;
22
+ esac
23
+ then
24
+ VN=$(echo "$VN" | sed -e 's/-/./g');
25
+ else
26
+ VN="$DEF_VER"
27
+ fi
28
+
29
+ VN=$(expr "$VN" : v*'\(.*\)')
30
+
31
+ if test -r $GVF
32
+ then
33
+ VC=$(sed -e 's/^GIT_VERSION = //' <$GVF)
34
+ else
35
+ VC=unset
36
+ fi
37
+ test "$VN" = "$VC" || {
38
+ echo >&2 "GIT_VERSION = $VN"
39
+ echo "GIT_VERSION = $VN" >$GVF
40
+ }
@@ -0,0 +1,191 @@
1
+ # use GNU Make to run tests in parallel, and without depending on RubyGems
2
+ all::
3
+ RUBY = ruby
4
+ RAKE = rake
5
+ RSYNC = rsync
6
+ GIT_URL = git://git.bogomips.org/kgio.git
7
+
8
+ GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
9
+ @./GIT-VERSION-GEN
10
+ -include GIT-VERSION-FILE
11
+ -include local.mk
12
+ ifeq ($(DLEXT),) # "so" for Linux
13
+ DLEXT := $(shell $(RUBY) -rrbconfig -e 'puts Config::CONFIG["DLEXT"]')
14
+ endif
15
+ ifeq ($(RUBY_VERSION),)
16
+ RUBY_VERSION := $(shell $(RUBY) -e 'puts RUBY_VERSION')
17
+ endif
18
+
19
+ install:
20
+ $(prep_setup_rb)
21
+ $(RM) -r .install-tmp
22
+ mkdir .install-tmp
23
+ $(RUBY) setup.rb all
24
+ $(RM) $^
25
+ $(RM) -r .install-tmp
26
+ $(prep_setup_rb)
27
+
28
+ setup_rb_files := .config InstalledFiles
29
+ prep_setup_rb := @-$(RM) $(setup_rb_files);$(MAKE) -C $(ext) clean
30
+
31
+ clean:
32
+ -$(MAKE) -C ext/kgio clean
33
+ $(RM) $(setup_rb_files) ext/kgio/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) $(man1_paths); \
43
+ do echo $$i; done) | LC_ALL=C sort > $@+
44
+ cmp $@+ $@ || mv $@+ $@
45
+ $(RM) $@+
46
+
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 }' $<
53
+
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://unicorn.bogomips.org/kgio/NEWS.atom.xml
68
+ cgit_atom := http://git.bogomips.org/cgit/kgio.git/atom/?h=master
69
+ atom = <link rel="alternate" title="Atom feed" href="$(1)" \
70
+ type="application/atom+xml"/>
71
+
72
+ # using rdoc 2.5.x
73
+ doc: .document NEWS ChangeLog
74
+ rdoc -t "$(shell sed -ne '1s/^= //p' README)"
75
+ install -m644 COPYING doc/COPYING
76
+ 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
+
86
+ ifneq ($(VERSION),)
87
+ rfproject := rainbows
88
+ rfpackage := kgio
89
+ pkggem := pkg/$(rfpackage)-$(VERSION).gem
90
+ pkgtgz := pkg/$(rfpackage)-$(VERSION).tgz
91
+ release_notes := release_notes-$(VERSION)
92
+ release_changes := release_changes-$(VERSION)
93
+
94
+ release-notes: $(release_notes)
95
+ release-changes: $(release_changes)
96
+ $(release_changes):
97
+ $(RAKE) -s release_changes > $@+
98
+ $(VISUAL) $@+ && test -s $@+ && mv $@+ $@
99
+ $(release_notes):
100
+ GIT_URL=$(GIT_URL) $(RAKE) -s release_notes > $@+
101
+ $(VISUAL) $@+ && test -s $@+ && mv $@+ $@
102
+
103
+ # ensures we're actually on the tagged $(VERSION), only used for release
104
+ verify:
105
+ test x"$(shell umask)" = x0022
106
+ git rev-parse --verify refs/tags/v$(VERSION)^{}
107
+ git diff-index --quiet HEAD^0
108
+ test `git rev-parse --verify HEAD^0` = \
109
+ `git rev-parse --verify refs/tags/v$(VERSION)^{}`
110
+
111
+ fix-perms:
112
+ -git ls-tree -r HEAD | awk '/^100644 / {print $$NF}' | xargs chmod 644
113
+ -git ls-tree -r HEAD | awk '/^100755 / {print $$NF}' | xargs chmod 755
114
+
115
+ gem: $(pkggem)
116
+
117
+ install-gem: $(pkggem)
118
+ gem install $(CURDIR)/$<
119
+
120
+ $(pkggem): manifest fix-perms
121
+ gem build $(rfpackage).gemspec
122
+ mkdir -p pkg
123
+ mv $(@F) $@
124
+
125
+ $(pkgtgz): distdir = $(basename $@)
126
+ $(pkgtgz): HEAD = v$(VERSION)
127
+ $(pkgtgz): manifest fix-perms
128
+ @test -n "$(distdir)"
129
+ $(RM) -r $(distdir)
130
+ mkdir -p $(distdir)
131
+ tar c `cat .manifest` | (cd $(distdir) && tar x)
132
+ cd pkg && tar c $(basename $(@F)) | gzip -9 > $(@F)+
133
+ mv $@+ $@
134
+
135
+ package: $(pkgtgz) $(pkggem)
136
+
137
+ test-release: verify package $(release_notes) $(release_changes)
138
+ release: verify package $(release_notes) $(release_changes)
139
+ # make tgz release on RubyForge
140
+ rubyforge add_release -f -n $(release_notes) -a $(release_changes) \
141
+ $(rfproject) $(rfpackage) $(VERSION) $(pkgtgz)
142
+ # push gem to Gemcutter
143
+ gem push $(pkggem)
144
+ # in case of gem downloads from RubyForge releases page
145
+ -rubyforge add_file \
146
+ $(rfproject) $(rfpackage) $(VERSION) $(pkggem)
147
+ $(RAKE) raa_update VERSION=$(VERSION)
148
+ $(RAKE) publish_news VERSION=$(VERSION)
149
+ else
150
+ gem install-gem: GIT-VERSION-FILE
151
+ $(MAKE) $@ VERSION=$(GIT_VERSION)
152
+ endif
153
+
154
+ ext := ext/kgio/kgio_ext.$(DLEXT)
155
+ ext/kgio/Makefile: ext/kgio/extconf.rb
156
+ cd $(@D) && $(RUBY) extconf.rb
157
+
158
+ $(ext): ext/kgio/kgio_ext.c ext/kgio/Makefile
159
+ $(MAKE) -C $(@D)
160
+
161
+ all:: test
162
+
163
+ build: $(ext)
164
+ test_units := $(wildcard test/test_*.rb)
165
+ test: test-unit
166
+ test-unit: $(test_units)
167
+ $(test_units): build
168
+ $(RUBY) -I lib:ext/kgio $@
169
+
170
+ # this requires GNU coreutils variants
171
+ publish_doc:
172
+ -git set-file-times
173
+ $(RM) -r doc ChangeLog NEWS
174
+ $(MAKE) doc LOG_VERSION=$(shell git tag -l | tail -1)
175
+ $(MAKE) -s latest > doc/LATEST
176
+ find doc/images doc/js -type f | \
177
+ TZ=UTC xargs touch -d '1970-01-01 00:00:00' doc/rdoc.css
178
+ $(MAKE) doc_gz
179
+ chmod 644 $$(find doc -type f)
180
+ $(RSYNC) -av doc/ unicorn.bogomips.org:/srv/unicorn/kgio/
181
+ git ls-files | xargs touch
182
+
183
+ # Create gzip variants of the same timestamp as the original so nginx
184
+ # "gzip_static on" can serve the gzipped versions directly.
185
+ doc_gz: docs = $(shell find doc -type f ! -regex '^.*\.\(gif\|jpg\|png\|gz\)$$')
186
+ doc_gz:
187
+ touch doc/NEWS.atom.xml -d "$$(awk 'NR==1{print $$4,$$5,$$6}' NEWS)"
188
+ for i in $(docs); do \
189
+ gzip --rsyncable -9 < $$i > $$i.gz; touch -r $$i $$i.gz; done
190
+
191
+ .PHONY: .FORCE-GIT-VERSION-FILE doc manifest man test $(test_units)
data/HACKING ADDED
@@ -0,0 +1,66 @@
1
+ = kgio Hacker's Guide
2
+
3
+ === Documentation
4
+
5
+ We use RDoc 2.5.x with Darkfish for documentation as much as possible,
6
+ if you're on Ruby 1.8 you want to install the latest "rdoc" gem. Due to
7
+ the lack of RDoc-to-manpage converters we know about, we're writing
8
+ manpages in Markdown and converting to troff/HTML with Pandoc.
9
+
10
+ Please wrap documentation at 72 characters-per-line or less (long URLs
11
+ are exempt) so it is comfortably readable from terminals.
12
+
13
+ When referencing mailing list posts, use
14
+ "http://mid.gmane.org/$MESSAGE_ID" if possible since the Message-ID
15
+ remains searchable even if Gmane becomes unavailable.
16
+
17
+ === Code Compatibility
18
+
19
+ We target Ruby 1.8.6+, 1.9.1+ and Rubinius 1.1+ and their
20
+ respective C APIs.
21
+
22
+ All of our C code should be compatible with all reasonably modern Unices
23
+ and should run on compilers supported by the versions of Ruby we target.
24
+
25
+ We will NEVER support non-Free platforms under any circumstances.
26
+
27
+ Our C code follows K&R indentation style (hard tabs, tabs are always 8
28
+ characters wide) and NOT the indentation style of Matz Ruby.
29
+
30
+ == Contributing
31
+
32
+ Contributions are welcome in the form of patches, pull requests, code
33
+ review, testing, documentation, user support or any other feedback. The
34
+ {Unicornmailing list}[mailto:mongrel-unicorn@rubyforge.org] is the
35
+ central coordination point for all user and developer feedback and bug
36
+ reports.
37
+
38
+ === Submitting Patches
39
+
40
+ Follow conventions already established in the code and do not exceed 80
41
+ characters per line.
42
+
43
+ Inline patches (from "git format-patch -M") to the mailing list are
44
+ preferred because they allow code review and comments in the reply to
45
+ the patch.
46
+
47
+ We will adhere to mostly the same conventions for patch submissions as
48
+ git itself. See the Documentation/SubmittingPatches document
49
+ distributed with git on on patch submission guidelines to follow. Just
50
+ don't email the git mailing list or maintainer with kgio patches :)
51
+
52
+ == Running Development Versions
53
+
54
+ It is easy to install the contents of your git working directory:
55
+
56
+ Via RubyGems (RubyGems 1.3.5+ recommended for prerelease versions):
57
+
58
+ gmake install-gem
59
+
60
+ Without RubyGems (via setup.rb):
61
+
62
+ gmake install
63
+
64
+ It is not at all recommended to mix a RubyGems installation with an
65
+ installation done without RubyGems, however.
66
+