Capcode 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README +4 -0
- data/doc/rdoc/classes/Capcode.html +99 -95
- data/doc/rdoc/classes/Capcode/Helpers.html +20 -35
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/README.html +10 -1
- data/doc/rdoc/files/lib/capcode_rb.html +1 -1
- data/doc/rdoc_iphone/classes/Capcode.html +175 -0
- data/doc/rdoc_iphone/classes/Capcode/HTTPError.html +21 -0
- data/doc/rdoc_iphone/classes/Capcode/Helpers.html +153 -0
- data/doc/rdoc_iphone/classes/Capcode/RenderError.html +21 -0
- data/doc/rdoc_iphone/classes/Capcode/Views.html +21 -0
- data/doc/rdoc_iphone/classes_index.html +10 -0
- data/doc/rdoc_iphone/created.rid +1 -0
- data/doc/rdoc_iphone/files/AUTHORS.html +11 -0
- data/doc/rdoc_iphone/files/COPYING.html +435 -0
- data/doc/rdoc_iphone/files/README.html +325 -0
- data/doc/rdoc_iphone/files/lib/capcode_rb.html +435 -0
- data/doc/rdoc_iphone/files_index.html +7 -0
- data/doc/rdoc_iphone/index.html +51 -0
- data/doc/rdoc_iphone/iui/backButton.png +0 -0
- data/doc/rdoc_iphone/iui/blueButton.png +0 -0
- data/doc/rdoc_iphone/iui/cancel.png +0 -0
- data/doc/rdoc_iphone/iui/grayButton.png +0 -0
- data/doc/rdoc_iphone/iui/iui-logo-touch-icon.png +0 -0
- data/doc/rdoc_iphone/iui/iui.css +386 -0
- data/doc/rdoc_iphone/iui/iui.js +442 -0
- data/doc/rdoc_iphone/iui/iuix.css +1 -0
- data/doc/rdoc_iphone/iui/iuix.js +1 -0
- data/doc/rdoc_iphone/iui/listArrow.png +0 -0
- data/doc/rdoc_iphone/iui/listArrowSel.png +0 -0
- data/doc/rdoc_iphone/iui/listGroup.png +0 -0
- data/doc/rdoc_iphone/iui/loading.gif +0 -0
- data/doc/rdoc_iphone/iui/pinstripes.png +0 -0
- data/doc/rdoc_iphone/iui/selection.png +0 -0
- data/doc/rdoc_iphone/iui/thumb.png +0 -0
- data/doc/rdoc_iphone/iui/toggle.png +0 -0
- data/doc/rdoc_iphone/iui/toggleOn.png +0 -0
- data/doc/rdoc_iphone/iui/toolButton.png +0 -0
- data/doc/rdoc_iphone/iui/toolbar.png +0 -0
- data/doc/rdoc_iphone/iui/whiteButton.png +0 -0
- data/doc/rdoc_iphone/rdoc-style.css +0 -0
- data/examples/blog-couchdb.rb +4 -0
- data/examples/blog-dm.rb +2 -0
- data/examples/my_blog.db +0 -0
- data/lib/capcode.rb +5 -1
- data/lib/capcode/base/couchdb.rb +4 -0
- data/lib/capcode/base/dm.rb +2 -1
- data/lib/capcode/version.rb +1 -1
- metadata +37 -2
@@ -0,0 +1,325 @@
|
|
1
|
+
|
2
|
+
<!-- BEGIN: BODY -->
|
3
|
+
|
4
|
+
<div id="README" title="File: README" class="panel">
|
5
|
+
<h1><a href="../classes/Capcode.html">Capcode</a></h1>
|
6
|
+
<p>
|
7
|
+
Copyright (C) 2009 Gregoire Lejeune
|
8
|
+
</p>
|
9
|
+
<ul>
|
10
|
+
<li><a href="http://capcode.rubyforge.org">capcode.rubyforge.org</a>
|
11
|
+
|
12
|
+
</li>
|
13
|
+
</ul>
|
14
|
+
<h2>DESCRIPTION:</h2>
|
15
|
+
<p>
|
16
|
+
<a href="../classes/Capcode.html">Capcode</a> is a web microframework
|
17
|
+
</p>
|
18
|
+
<h2>FEATURES/PROBLEMS:</h2>
|
19
|
+
<h3>0.7.0</h3>
|
20
|
+
<ul>
|
21
|
+
<li>You no more need to include Capcode::Resource in your models
|
22
|
+
|
23
|
+
</li>
|
24
|
+
<li><a href="../classes/Capcode.html#M000008">Capcode.run</a> now accept a
|
25
|
+
block. The content of the block is executed just before the server start.
|
26
|
+
|
27
|
+
</li>
|
28
|
+
<li>Add options support : you can now change the defaults port and host,
|
29
|
+
daemonize or not and run in console mode.
|
30
|
+
|
31
|
+
</li>
|
32
|
+
</ul>
|
33
|
+
<h3>0.6.2</h3>
|
34
|
+
<ul>
|
35
|
+
<li>Add Markaby, Erb and Haml layout see Capcode::Helpers.render for more
|
36
|
+
informations
|
37
|
+
|
38
|
+
</li>
|
39
|
+
<li>Add content_for…
|
40
|
+
|
41
|
+
</li>
|
42
|
+
<li>Major bugs corrections
|
43
|
+
|
44
|
+
</li>
|
45
|
+
</ul>
|
46
|
+
<h3>0.6.1</h3>
|
47
|
+
<ul>
|
48
|
+
<li>Major bugs corrections in haml and erb renderer ($%&! Windows)
|
49
|
+
|
50
|
+
</li>
|
51
|
+
<li>Major bugs corrections in Route.call
|
52
|
+
|
53
|
+
</li>
|
54
|
+
<li>Add Markaby layout support
|
55
|
+
|
56
|
+
</li>
|
57
|
+
<li>Rewrite blog-couchdb example (based on the very sympatic camping example :
|
58
|
+
<a
|
59
|
+
href="http://github.com/judofyr/camping/blob/master/examples/blog.rb">github.com/judofyr/camping/blob/master/examples/blog.rb</a>)
|
60
|
+
|
61
|
+
</li>
|
62
|
+
</ul>
|
63
|
+
<h3>0.6.0</h3>
|
64
|
+
<ul>
|
65
|
+
<li>Add :root option to <a
|
66
|
+
href="../classes/Capcode.html#M000008">Capcode.run</a>. This option allow
|
67
|
+
you to specify the root directory for static files
|
68
|
+
|
69
|
+
</li>
|
70
|
+
<li>Add :working_directory option to <a
|
71
|
+
href="../classes/Capcode.html#M000008">Capcode.run</a>. This option allow
|
72
|
+
you to specify the working directory
|
73
|
+
|
74
|
+
</li>
|
75
|
+
<li>Of ’/’ route is not defined but /index.html exist, display
|
76
|
+
index
|
77
|
+
|
78
|
+
</li>
|
79
|
+
<li>add mime-types dependency
|
80
|
+
|
81
|
+
</li>
|
82
|
+
<li>Bug correction in erb and haml renderer
|
83
|
+
|
84
|
+
</li>
|
85
|
+
</ul>
|
86
|
+
<h3>0.5.0</h3>
|
87
|
+
<ul>
|
88
|
+
<li>Add Haml and Markaby renderer
|
89
|
+
|
90
|
+
</li>
|
91
|
+
<li>json is deprecated and replaced by render( :json => … )
|
92
|
+
|
93
|
+
</li>
|
94
|
+
</ul>
|
95
|
+
<h3>0.4.0</h3>
|
96
|
+
<ul>
|
97
|
+
<li>Major bug correction !
|
98
|
+
|
99
|
+
</li>
|
100
|
+
<li>Add views…
|
101
|
+
|
102
|
+
</li>
|
103
|
+
</ul>
|
104
|
+
<h3>0.3.0</h3>
|
105
|
+
<ul>
|
106
|
+
<li>Work with Rack 1.0.0
|
107
|
+
|
108
|
+
</li>
|
109
|
+
</ul>
|
110
|
+
<h3>0.2.0</h3>
|
111
|
+
<ul>
|
112
|
+
<li>Add models with DataMapper and couch_foo
|
113
|
+
|
114
|
+
</li>
|
115
|
+
<li>Add two new options : :daemonize and :pid
|
116
|
+
|
117
|
+
</li>
|
118
|
+
<li>Bug correction in Route.
|
119
|
+
|
120
|
+
</li>
|
121
|
+
</ul>
|
122
|
+
<h3>0.1.0</h3>
|
123
|
+
<ul>
|
124
|
+
<li>First public release
|
125
|
+
|
126
|
+
</li>
|
127
|
+
<li>No models !!!
|
128
|
+
|
129
|
+
</li>
|
130
|
+
</ul>
|
131
|
+
<h2>SYNOPSIS:</h2>
|
132
|
+
<pre>
|
133
|
+
# file: sample.rb
|
134
|
+
require 'rubygems'
|
135
|
+
require 'capcode'
|
136
|
+
|
137
|
+
module Capcode
|
138
|
+
class Hello < Route '/hello'
|
139
|
+
def get
|
140
|
+
"Hello World #{Time.now} !"
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
Capcode.run( )
|
146
|
+
</pre>
|
147
|
+
<h3>Running <a href="../classes/Capcode.html">Capcode</a> Apps</h3>
|
148
|
+
<ul>
|
149
|
+
<li>Run: <tt>ruby sample.rb</tt>
|
150
|
+
|
151
|
+
</li>
|
152
|
+
<li>Visit <a href="http://localhost:3000">localhost:3000</a>/
|
153
|
+
|
154
|
+
</li>
|
155
|
+
</ul>
|
156
|
+
<h3>Create model</h3>
|
157
|
+
<pre>
|
158
|
+
require 'rubygems'
|
159
|
+
require 'capcode'
|
160
|
+
require 'capcode/base/dm' # or require 'capcode/base/couchdb'
|
161
|
+
|
162
|
+
class Story < Capcode::Base
|
163
|
+
include Capcode::Resource
|
164
|
+
|
165
|
+
property :id, Integer, :serial => true # only with DataMapper !
|
166
|
+
property :title, String
|
167
|
+
property :body, String
|
168
|
+
property :date, String
|
169
|
+
end
|
170
|
+
</pre>
|
171
|
+
<p>
|
172
|
+
See <tt>examples/blog-dm.rb</tt> and/or <tt>examples/blog-couchdb.rb</tt>
|
173
|
+
for complete examples.
|
174
|
+
</p>
|
175
|
+
<h3>Create View</h3>
|
176
|
+
<pre>
|
177
|
+
# file: sample.rb
|
178
|
+
require 'rubygems'
|
179
|
+
require 'capcode'
|
180
|
+
|
181
|
+
module Capcode
|
182
|
+
class Hello < Route '/hello'
|
183
|
+
def get
|
184
|
+
@t = Time.now
|
185
|
+
render :time
|
186
|
+
end
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
module Capcode::Views
|
191
|
+
def time
|
192
|
+
"Hello world #{@t}"
|
193
|
+
end
|
194
|
+
end
|
195
|
+
|
196
|
+
Capcode.run( )
|
197
|
+
</pre>
|
198
|
+
<h3>Create Helper</h3>
|
199
|
+
<pre>
|
200
|
+
# file: sample.rb
|
201
|
+
require 'rubygems'
|
202
|
+
require 'capcode'
|
203
|
+
|
204
|
+
module Capcode
|
205
|
+
class Hello < Route '/hello'
|
206
|
+
def get
|
207
|
+
@t = Time.now
|
208
|
+
render :time
|
209
|
+
end
|
210
|
+
end
|
211
|
+
end
|
212
|
+
|
213
|
+
module Capcode::Helpers
|
214
|
+
def bold( &b )
|
215
|
+
"<b>"+yield+"</b>"
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
219
|
+
module Capcode::Views
|
220
|
+
def time
|
221
|
+
"Hello world " + bold { @t }
|
222
|
+
end
|
223
|
+
end
|
224
|
+
|
225
|
+
Capcode.run( )
|
226
|
+
</pre>
|
227
|
+
<h3>Render with Markaby</h3>
|
228
|
+
<pre>
|
229
|
+
# file: sample.rb
|
230
|
+
require 'rubygems'
|
231
|
+
require 'capcode'
|
232
|
+
require 'capcode/render/markaby'
|
233
|
+
|
234
|
+
module Capcode
|
235
|
+
class Hello < Route '/hello'
|
236
|
+
def get
|
237
|
+
@t = Time.now
|
238
|
+
render :markaby => :time
|
239
|
+
end
|
240
|
+
end
|
241
|
+
end
|
242
|
+
|
243
|
+
module Capcode::Views
|
244
|
+
def time
|
245
|
+
# We use Markaby in Capcode::Views.time
|
246
|
+
html do
|
247
|
+
body do
|
248
|
+
p {
|
249
|
+
text "Hello World "
|
250
|
+
b @t
|
251
|
+
}
|
252
|
+
end
|
253
|
+
end
|
254
|
+
end
|
255
|
+
end
|
256
|
+
|
257
|
+
Capcode.run( )
|
258
|
+
</pre>
|
259
|
+
<h3>Render with Haml</h3>
|
260
|
+
<pre>
|
261
|
+
# file: sample.rb
|
262
|
+
require 'rubygems'
|
263
|
+
require 'capcode'
|
264
|
+
require 'capcode/render/haml'
|
265
|
+
Capcode::Helpers.haml_path = "./my_haml_views"
|
266
|
+
|
267
|
+
module Capcode
|
268
|
+
class Hello < Route '/hello'
|
269
|
+
def get
|
270
|
+
@t = Time.now
|
271
|
+
render :haml => :time
|
272
|
+
end
|
273
|
+
end
|
274
|
+
end
|
275
|
+
|
276
|
+
Capcode.run( )
|
277
|
+
|
278
|
+
# ./my_haml_views/time.haml
|
279
|
+
%html
|
280
|
+
%body
|
281
|
+
%p
|
282
|
+
Hello World
|
283
|
+
= @t
|
284
|
+
</pre>
|
285
|
+
<h3>Render with JSON</h3>
|
286
|
+
<pre>
|
287
|
+
# file: sample.rb
|
288
|
+
require 'rubygems'
|
289
|
+
require 'capcode'
|
290
|
+
require 'capcode/render/json'
|
291
|
+
|
292
|
+
module Capcode
|
293
|
+
class Hello < Route '/hello'
|
294
|
+
def get
|
295
|
+
@t = Time.now
|
296
|
+
render :json => { :time => @t }
|
297
|
+
end
|
298
|
+
end
|
299
|
+
end
|
300
|
+
|
301
|
+
Capcode.run( )
|
302
|
+
</pre>
|
303
|
+
<h2>REQUIREMENTS:</h2>
|
304
|
+
<ul>
|
305
|
+
<li>rack
|
306
|
+
|
307
|
+
</li>
|
308
|
+
</ul>
|
309
|
+
<h2>INSTALL:</h2>
|
310
|
+
<pre>
|
311
|
+
sudo gem install capcode
|
312
|
+
</pre>
|
313
|
+
<h2>LICENSE:</h2>
|
314
|
+
<p>
|
315
|
+
<a href="../classes/Capcode.html">Capcode</a> is freely distributable
|
316
|
+
according to the terms of the GNU General Public License.
|
317
|
+
</p>
|
318
|
+
<p>
|
319
|
+
This program is distributed without any warranty. See the file
|
320
|
+
‘COPYING’ for details.
|
321
|
+
</p>
|
322
|
+
|
323
|
+
</div>
|
324
|
+
|
325
|
+
<!-- BEGIN: BODY -->
|
@@ -0,0 +1,435 @@
|
|
1
|
+
|
2
|
+
<!-- BEGIN: BODY -->
|
3
|
+
|
4
|
+
<div id="lib_capcode_rb" title="File: capcode.rb" class="panel">
|
5
|
+
<pre>
|
6
|
+
GNU GENERAL PUBLIC LICENSE
|
7
|
+
Version 2, June 1991
|
8
|
+
|
9
|
+
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
10
|
+
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
11
|
+
Everyone is permitted to copy and distribute verbatim copies
|
12
|
+
of this license document, but changing it is not allowed.
|
13
|
+
|
14
|
+
Preamble
|
15
|
+
|
16
|
+
The licenses for most software are designed to take away your
|
17
|
+
</pre>
|
18
|
+
<p>
|
19
|
+
freedom to share and change it. By contrast, the GNU General Public License
|
20
|
+
is intended to guarantee your freedom to share and change free
|
21
|
+
software—to make sure the software is free for all its users. This
|
22
|
+
General Public License applies to most of the Free Software
|
23
|
+
Foundation‘s software and to any other program whose authors commit
|
24
|
+
to using it. (Some other Free Software Foundation software is covered by
|
25
|
+
the GNU Library General Public License instead.) You can apply it to your
|
26
|
+
programs, too.
|
27
|
+
</p>
|
28
|
+
<pre>
|
29
|
+
When we speak of free software, we are referring to freedom, not
|
30
|
+
</pre>
|
31
|
+
<p>
|
32
|
+
price. Our General Public Licenses are designed to make sure that you have
|
33
|
+
the freedom to distribute copies of free software (and charge for this
|
34
|
+
service if you wish), that you receive source code or can get it if you
|
35
|
+
want it, that you can change the software or use pieces of it in new free
|
36
|
+
programs; and that you know you can do these things.
|
37
|
+
</p>
|
38
|
+
<pre>
|
39
|
+
To protect your rights, we need to make restrictions that forbid
|
40
|
+
</pre>
|
41
|
+
<p>
|
42
|
+
anyone to deny you these rights or to ask you to surrender the rights.
|
43
|
+
These restrictions translate to certain responsibilities for you if you
|
44
|
+
distribute copies of the software, or if you modify it.
|
45
|
+
</p>
|
46
|
+
<pre>
|
47
|
+
For example, if you distribute copies of such a program, whether
|
48
|
+
</pre>
|
49
|
+
<p>
|
50
|
+
gratis or for a fee, you must give the recipients all the rights that you
|
51
|
+
have. You must make sure that they, too, receive or can get the source
|
52
|
+
code. And you must show them these terms so they know their rights.
|
53
|
+
</p>
|
54
|
+
<pre>
|
55
|
+
We protect your rights with two steps: (1) copyright the software, and
|
56
|
+
</pre>
|
57
|
+
<p>
|
58
|
+
(2) offer you this license which gives you legal permission to copy,
|
59
|
+
distribute and/or modify the software.
|
60
|
+
</p>
|
61
|
+
<pre>
|
62
|
+
Also, for each author's protection and ours, we want to make certain
|
63
|
+
</pre>
|
64
|
+
<p>
|
65
|
+
that everyone understands that there is no warranty for this free software.
|
66
|
+
If the software is modified by someone else and passed on, we want its
|
67
|
+
recipients to know that what they have is not the original, so that any
|
68
|
+
problems introduced by others will not reflect on the original
|
69
|
+
authors’ reputations.
|
70
|
+
</p>
|
71
|
+
<pre>
|
72
|
+
Finally, any free program is threatened constantly by software
|
73
|
+
</pre>
|
74
|
+
<p>
|
75
|
+
patents. We wish to avoid the danger that redistributors of a free program
|
76
|
+
will individually obtain patent licenses, in effect making the program
|
77
|
+
proprietary. To prevent this, we have made it clear that any patent must be
|
78
|
+
licensed for everyone‘s free use or not licensed at all.
|
79
|
+
</p>
|
80
|
+
<pre>
|
81
|
+
The precise terms and conditions for copying, distribution and
|
82
|
+
</pre>
|
83
|
+
<p>
|
84
|
+
modification follow.
|
85
|
+
</p>
|
86
|
+
<pre>
|
87
|
+
GNU GENERAL PUBLIC LICENSE
|
88
|
+
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
89
|
+
|
90
|
+
0. This License applies to any program or other work which contains
|
91
|
+
</pre>
|
92
|
+
<p>
|
93
|
+
a notice placed by the copyright holder saying it may be distributed under
|
94
|
+
the terms of this General Public License. The "Program", below,
|
95
|
+
refers to any such program or work, and a "work based on the
|
96
|
+
Program" means either the Program or any derivative work under
|
97
|
+
copyright law: that is to say, a work containing the Program or a portion
|
98
|
+
of it, either verbatim or with modifications and/or translated into another
|
99
|
+
language. (Hereinafter, translation is included without limitation in the
|
100
|
+
term "modification".) Each licensee is addressed as
|
101
|
+
"you".
|
102
|
+
</p>
|
103
|
+
<p>
|
104
|
+
Activities other than copying, distribution and modification are not
|
105
|
+
covered by this License; they are outside its scope. The act of running the
|
106
|
+
Program is not restricted, and the output from the Program is covered only
|
107
|
+
if its contents constitute a work based on the Program (independent of
|
108
|
+
having been made by running the Program). Whether that is true depends on
|
109
|
+
what the Program does.
|
110
|
+
</p>
|
111
|
+
<pre>
|
112
|
+
1. You may copy and distribute verbatim copies of the Program's
|
113
|
+
</pre>
|
114
|
+
<p>
|
115
|
+
source code as you receive it, in any medium, provided that you
|
116
|
+
conspicuously and appropriately publish on each copy an appropriate
|
117
|
+
copyright notice and disclaimer of warranty; keep intact all the notices
|
118
|
+
that refer to this License and to the absence of any warranty; and give any
|
119
|
+
other recipients of the Program a copy of this License along with the
|
120
|
+
Program.
|
121
|
+
</p>
|
122
|
+
<p>
|
123
|
+
You may charge a fee for the physical act of transferring a copy, and you
|
124
|
+
may at your option offer warranty protection in exchange for a fee.
|
125
|
+
</p>
|
126
|
+
<pre>
|
127
|
+
2. You may modify your copy or copies of the Program or any portion
|
128
|
+
</pre>
|
129
|
+
<p>
|
130
|
+
of it, thus forming a work based on the Program, and copy and distribute
|
131
|
+
such modifications or work under the terms of Section 1 above, provided
|
132
|
+
that you also meet all of these conditions:
|
133
|
+
</p>
|
134
|
+
<pre>
|
135
|
+
a) You must cause the modified files to carry prominent notices
|
136
|
+
stating that you changed the files and the date of any change.
|
137
|
+
|
138
|
+
b) You must cause any work that you distribute or publish, that in
|
139
|
+
whole or in part contains or is derived from the Program or any
|
140
|
+
part thereof, to be licensed as a whole at no charge to all third
|
141
|
+
parties under the terms of this License.
|
142
|
+
|
143
|
+
c) If the modified program normally reads commands interactively
|
144
|
+
when run, you must cause it, when started running for such
|
145
|
+
interactive use in the most ordinary way, to print or display an
|
146
|
+
announcement including an appropriate copyright notice and a
|
147
|
+
notice that there is no warranty (or else, saying that you provide
|
148
|
+
a warranty) and that users may redistribute the program under
|
149
|
+
these conditions, and telling the user how to view a copy of this
|
150
|
+
License. (Exception: if the Program itself is interactive but
|
151
|
+
does not normally print such an announcement, your work based on
|
152
|
+
the Program is not required to print an announcement.)
|
153
|
+
</pre>
|
154
|
+
<p>
|
155
|
+
These requirements apply to the modified work as a whole. If identifiable
|
156
|
+
sections of that work are not derived from the Program, and can be
|
157
|
+
reasonably considered independent and separate works in themselves, then
|
158
|
+
this License, and its terms, do not apply to those sections when you
|
159
|
+
distribute them as separate works. But when you distribute the same
|
160
|
+
sections as part of a whole which is a work based on the Program, the
|
161
|
+
distribution of the whole must be on the terms of this License, whose
|
162
|
+
permissions for other licensees extend to the entire whole, and thus to
|
163
|
+
each and every part regardless of who wrote it.
|
164
|
+
</p>
|
165
|
+
<p>
|
166
|
+
Thus, it is not the intent of this section to claim rights or contest your
|
167
|
+
rights to work written entirely by you; rather, the intent is to exercise
|
168
|
+
the right to control the distribution of derivative or collective works
|
169
|
+
based on the Program.
|
170
|
+
</p>
|
171
|
+
<p>
|
172
|
+
In addition, mere aggregation of another work not based on the Program with
|
173
|
+
the Program (or with a work based on the Program) on a volume of a storage
|
174
|
+
or distribution medium does not bring the other work under the scope of
|
175
|
+
this License.
|
176
|
+
</p>
|
177
|
+
<pre>
|
178
|
+
3. You may copy and distribute the Program (or a work based on it,
|
179
|
+
</pre>
|
180
|
+
<p>
|
181
|
+
under Section 2) in object code or executable form under the terms of
|
182
|
+
Sections 1 and 2 above provided that you also do one of the following:
|
183
|
+
</p>
|
184
|
+
<pre>
|
185
|
+
a) Accompany it with the complete corresponding machine-readable
|
186
|
+
source code, which must be distributed under the terms of Sections
|
187
|
+
1 and 2 above on a medium customarily used for software interchange; or,
|
188
|
+
|
189
|
+
b) Accompany it with a written offer, valid for at least three
|
190
|
+
years, to give any third party, for a charge no more than your
|
191
|
+
cost of physically performing source distribution, a complete
|
192
|
+
machine-readable copy of the corresponding source code, to be
|
193
|
+
distributed under the terms of Sections 1 and 2 above on a medium
|
194
|
+
customarily used for software interchange; or,
|
195
|
+
|
196
|
+
c) Accompany it with the information you received as to the offer
|
197
|
+
to distribute corresponding source code. (This alternative is
|
198
|
+
allowed only for noncommercial distribution and only if you
|
199
|
+
received the program in object code or executable form with such
|
200
|
+
an offer, in accord with Subsection b above.)
|
201
|
+
</pre>
|
202
|
+
<p>
|
203
|
+
The source code for a work means the preferred form of the work for making
|
204
|
+
modifications to it. For an executable work, complete source code means all
|
205
|
+
the source code for all modules it contains, plus any associated interface
|
206
|
+
definition files, plus the scripts used to control compilation and
|
207
|
+
installation of the executable. However, as a special exception, the source
|
208
|
+
code distributed need not include anything that is normally distributed (in
|
209
|
+
either source or binary form) with the major components (compiler, kernel,
|
210
|
+
and so on) of the operating system on which the executable runs, unless
|
211
|
+
that component itself accompanies the executable.
|
212
|
+
</p>
|
213
|
+
<p>
|
214
|
+
If distribution of executable or object code is made by offering access to
|
215
|
+
copy from a designated place, then offering equivalent access to copy the
|
216
|
+
source code from the same place counts as distribution of the source code,
|
217
|
+
even though third parties are not compelled to copy the source along with
|
218
|
+
the object code.
|
219
|
+
</p>
|
220
|
+
<pre>
|
221
|
+
4. You may not copy, modify, sublicense, or distribute the Program
|
222
|
+
</pre>
|
223
|
+
<p>
|
224
|
+
except as expressly provided under this License. Any attempt otherwise to
|
225
|
+
copy, modify, sublicense or distribute the Program is void, and will
|
226
|
+
automatically terminate your rights under this License. However, parties
|
227
|
+
who have received copies, or rights, from you under this License will not
|
228
|
+
have their licenses terminated so long as such parties remain in full
|
229
|
+
compliance.
|
230
|
+
</p>
|
231
|
+
<pre>
|
232
|
+
5. You are not required to accept this License, since you have not
|
233
|
+
</pre>
|
234
|
+
<p>
|
235
|
+
signed it. However, nothing else grants you permission to modify or
|
236
|
+
distribute the Program or its derivative works. These actions are
|
237
|
+
prohibited by law if you do not accept this License. Therefore, by
|
238
|
+
modifying or distributing the Program (or any work based on the Program),
|
239
|
+
you indicate your acceptance of this License to do so, and all its terms
|
240
|
+
and conditions for copying, distributing or modifying the Program or works
|
241
|
+
based on it.
|
242
|
+
</p>
|
243
|
+
<pre>
|
244
|
+
6. Each time you redistribute the Program (or any work based on the
|
245
|
+
</pre>
|
246
|
+
<p>
|
247
|
+
Program), the recipient automatically receives a license from the original
|
248
|
+
licensor to copy, distribute or modify the Program subject to these terms
|
249
|
+
and conditions. You may not impose any further restrictions on the
|
250
|
+
recipients’ exercise of the rights granted herein. You are not
|
251
|
+
responsible for enforcing compliance by third parties to this License.
|
252
|
+
</p>
|
253
|
+
<pre>
|
254
|
+
7. If, as a consequence of a court judgment or allegation of patent
|
255
|
+
</pre>
|
256
|
+
<p>
|
257
|
+
infringement or for any other reason (not limited to patent issues),
|
258
|
+
conditions are imposed on you (whether by court order, agreement or
|
259
|
+
otherwise) that contradict the conditions of this License, they do not
|
260
|
+
excuse you from the conditions of this License. If you cannot distribute so
|
261
|
+
as to satisfy simultaneously your obligations under this License and any
|
262
|
+
other pertinent obligations, then as a consequence you may not distribute
|
263
|
+
the Program at all. For example, if a patent license would not permit
|
264
|
+
royalty-free redistribution of the Program by all those who receive copies
|
265
|
+
directly or indirectly through you, then the only way you could satisfy
|
266
|
+
both it and this License would be to refrain entirely from distribution of
|
267
|
+
the Program.
|
268
|
+
</p>
|
269
|
+
<p>
|
270
|
+
If any portion of this section is held invalid or unenforceable under any
|
271
|
+
particular circumstance, the balance of the section is intended to apply
|
272
|
+
and the section as a whole is intended to apply in other circumstances.
|
273
|
+
</p>
|
274
|
+
<p>
|
275
|
+
It is not the purpose of this section to induce you to infringe any patents
|
276
|
+
or other property right claims or to contest validity of any such claims;
|
277
|
+
this section has the sole purpose of protecting the integrity of the free
|
278
|
+
software distribution system, which is implemented by public license
|
279
|
+
practices. Many people have made generous contributions to the wide range
|
280
|
+
of software distributed through that system in reliance on consistent
|
281
|
+
application of that system; it is up to the author/donor to decide if he or
|
282
|
+
she is willing to distribute software through any other system and a
|
283
|
+
licensee cannot impose that choice.
|
284
|
+
</p>
|
285
|
+
<p>
|
286
|
+
This section is intended to make thoroughly clear what is believed to be a
|
287
|
+
consequence of the rest of this License.
|
288
|
+
</p>
|
289
|
+
<pre>
|
290
|
+
8. If the distribution and/or use of the Program is restricted in
|
291
|
+
</pre>
|
292
|
+
<p>
|
293
|
+
certain countries either by patents or by copyrighted interfaces, the
|
294
|
+
original copyright holder who places the Program under this License may add
|
295
|
+
an explicit geographical distribution limitation excluding those countries,
|
296
|
+
so that distribution is permitted only in or among countries not thus
|
297
|
+
excluded. In such case, this License incorporates the limitation as if
|
298
|
+
written in the body of this License.
|
299
|
+
</p>
|
300
|
+
<pre>
|
301
|
+
9. The Free Software Foundation may publish revised and/or new versions
|
302
|
+
</pre>
|
303
|
+
<p>
|
304
|
+
of the General Public License from time to time. Such new versions will be
|
305
|
+
similar in spirit to the present version, but may differ in detail to
|
306
|
+
address new problems or concerns.
|
307
|
+
</p>
|
308
|
+
<p>
|
309
|
+
Each version is given a distinguishing version number. If the Program
|
310
|
+
specifies a version number of this License which applies to it and
|
311
|
+
"any later version", you have the option of following the terms
|
312
|
+
and conditions either of that version or of any later version published by
|
313
|
+
the Free Software Foundation. If the Program does not specify a version
|
314
|
+
number of this License, you may choose any version ever published by the
|
315
|
+
Free Software Foundation.
|
316
|
+
</p>
|
317
|
+
<pre>
|
318
|
+
10. If you wish to incorporate parts of the Program into other free
|
319
|
+
</pre>
|
320
|
+
<p>
|
321
|
+
programs whose distribution conditions are different, write to the author
|
322
|
+
to ask for permission. For software which is copyrighted by the Free
|
323
|
+
Software Foundation, write to the Free Software Foundation; we sometimes
|
324
|
+
make exceptions for this. Our decision will be guided by the two goals of
|
325
|
+
preserving the free status of all derivatives of our free software and of
|
326
|
+
promoting the sharing and reuse of software generally.
|
327
|
+
</p>
|
328
|
+
<pre>
|
329
|
+
NO WARRANTY
|
330
|
+
|
331
|
+
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
332
|
+
</pre>
|
333
|
+
<p>
|
334
|
+
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
335
|
+
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
336
|
+
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
337
|
+
EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
338
|
+
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
339
|
+
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
340
|
+
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
341
|
+
REPAIR OR CORRECTION.
|
342
|
+
</p>
|
343
|
+
<pre>
|
344
|
+
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
345
|
+
</pre>
|
346
|
+
<p>
|
347
|
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
348
|
+
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
349
|
+
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
350
|
+
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
351
|
+
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
352
|
+
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
353
|
+
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
354
|
+
POSSIBILITY OF SUCH DAMAGES.
|
355
|
+
</p>
|
356
|
+
<pre>
|
357
|
+
END OF TERMS AND CONDITIONS
|
358
|
+
|
359
|
+
How to Apply These Terms to Your New Programs
|
360
|
+
|
361
|
+
If you develop a new program, and you want it to be of the greatest
|
362
|
+
</pre>
|
363
|
+
<p>
|
364
|
+
possible use to the public, the best way to achieve this is to make it free
|
365
|
+
software which everyone can redistribute and change under these terms.
|
366
|
+
</p>
|
367
|
+
<pre>
|
368
|
+
To do so, attach the following notices to the program. It is safest
|
369
|
+
</pre>
|
370
|
+
<p>
|
371
|
+
to attach them to the start of each source file to most effectively convey
|
372
|
+
the exclusion of warranty; and each file should have at least the
|
373
|
+
"copyright" line and a pointer to where the full notice is found.
|
374
|
+
</p>
|
375
|
+
<pre>
|
376
|
+
<one line to give the program's name and a brief idea of what it does.>
|
377
|
+
Copyright (C) <year> <name of author>
|
378
|
+
|
379
|
+
This program is free software; you can redistribute it and/or modify
|
380
|
+
it under the terms of the GNU General Public License as published by
|
381
|
+
the Free Software Foundation; either version 2 of the License, or
|
382
|
+
(at your option) any later version.
|
383
|
+
|
384
|
+
This program is distributed in the hope that it will be useful,
|
385
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
386
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
387
|
+
GNU General Public License for more details.
|
388
|
+
|
389
|
+
You should have received a copy of the GNU General Public License
|
390
|
+
along with this program; if not, write to the Free Software
|
391
|
+
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
392
|
+
</pre>
|
393
|
+
<p>
|
394
|
+
Also add information on how to contact you by electronic and paper mail.
|
395
|
+
</p>
|
396
|
+
<p>
|
397
|
+
If the program is interactive, make it output a short notice like this when
|
398
|
+
it starts in an interactive mode:
|
399
|
+
</p>
|
400
|
+
<pre>
|
401
|
+
Gnomovision version 69, Copyright (C) year name of author
|
402
|
+
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
403
|
+
This is free software, and you are welcome to redistribute it
|
404
|
+
under certain conditions; type `show c' for details.
|
405
|
+
</pre>
|
406
|
+
<p>
|
407
|
+
The hypothetical commands `show w’ and `show c’ should show the
|
408
|
+
appropriate parts of the General Public License. Of course, the commands
|
409
|
+
you use may be called something other than `show w’ and `show
|
410
|
+
c’; they could even be mouse-clicks or menu items—whatever
|
411
|
+
suits your program.
|
412
|
+
</p>
|
413
|
+
<p>
|
414
|
+
You should also get your employer (if you work as a programmer) or your
|
415
|
+
school, if any, to sign a "copyright disclaimer" for the program,
|
416
|
+
if necessary. Here is a sample; alter the names:
|
417
|
+
</p>
|
418
|
+
<pre>
|
419
|
+
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
420
|
+
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
421
|
+
|
422
|
+
<signature of Ty Coon>, 1 April 1989
|
423
|
+
Ty Coon, President of Vice
|
424
|
+
</pre>
|
425
|
+
<p>
|
426
|
+
This General Public License does not permit incorporating your program into
|
427
|
+
proprietary programs. If your program is a subroutine library, you may
|
428
|
+
consider it more useful to permit linking proprietary applications with the
|
429
|
+
library. If this is what you want to do, use the GNU Library General Public
|
430
|
+
License instead of this License.
|
431
|
+
</p>
|
432
|
+
|
433
|
+
</div>
|
434
|
+
|
435
|
+
<!-- BEGIN: BODY -->
|