raxus 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/LICENCE ADDED
@@ -0,0 +1,58 @@
1
+ License
2
+
3
+ THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
4
+
5
+ BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
6
+
7
+ 1. Definitions
8
+
9
+ "Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License.
10
+ "Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(g) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License.
11
+ "Distribute" means to make available to the public the original and copies of the Work or Adaptation, as appropriate, through sale or other transfer of ownership.
12
+ "License Elements" means the following high-level license attributes as selected by Licensor and indicated in the title of this License: Attribution, Noncommercial, ShareAlike.
13
+ "Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License.
14
+ "Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast.
15
+ "Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work.
16
+ "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
17
+ "Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images.
18
+ "Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium.
19
+ 2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws.
20
+
21
+ 3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
22
+
23
+ to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections;
24
+ to create and Reproduce Adaptations provided that any such Adaptation, including any translation in any medium, takes reasonable steps to clearly label, demarcate or otherwise identify that changes were made to the original Work. For example, a translation could be marked "The original work was translated from English to Spanish," or a modification could indicate "The original work has been modified.";
25
+ to Distribute and Publicly Perform the Work including as incorporated in Collections; and,
26
+ to Distribute and Publicly Perform Adaptations.
27
+ The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. Subject to Section 8(f), all rights not expressly granted by Licensor are hereby reserved, including but not limited to the rights described in Section 4(e).
28
+
29
+ 4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
30
+
31
+ You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(d), as requested. If You create an Adaptation, upon notice from any Licensor You must, to the extent practicable, remove from the Adaptation any credit as required by Section 4(d), as requested.
32
+ You may Distribute or Publicly Perform an Adaptation only under: (i) the terms of this License; (ii) a later version of this License with the same License Elements as this License; (iii) a Creative Commons jurisdiction license (either this or a later license version) that contains the same License Elements as this License (e.g., Attribution-NonCommercial-ShareAlike 3.0 US) ("Applicable License"). You must include a copy of, or the URI, for Applicable License with every copy of each Adaptation You Distribute or Publicly Perform. You may not offer or impose any terms on the Adaptation that restrict the terms of the Applicable License or the ability of the recipient of the Adaptation to exercise the rights granted to that recipient under the terms of the Applicable License. You must keep intact all notices that refer to the Applicable License and to the disclaimer of warranties with every copy of the Work as included in the Adaptation You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Adaptation, You may not impose any effective technological measures on the Adaptation that restrict the ability of a recipient of the Adaptation from You to exercise the rights granted to that recipient under the terms of the Applicable License. This Section 4(b) applies to the Adaptation as incorporated in a Collection, but this does not require the Collection apart from the Adaptation itself to be made subject to the terms of the Applicable License.
33
+ You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in con-nection with the exchange of copyrighted works.
34
+ If You Distribute, or Publicly Perform the Work or any Adaptations or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and, (iv) consistent with Section 3(b), in the case of an Adaptation, a credit identifying the use of the Work in the Adaptation (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). The credit required by this Section 4(d) may be implemented in any reasonable manner; provided, however, that in the case of a Adaptation or Collection, at a minimum such credit will appear, if a credit for all contributing authors of the Adaptation or Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties.
35
+ For the avoidance of doubt:
36
+
37
+ Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License;
38
+ Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License if Your exercise of such rights is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(c) and otherwise waives the right to collect royalties through any statutory or compulsory licensing scheme; and,
39
+ Voluntary License Schemes. The Licensor reserves the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License that is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(c).
40
+ Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Adaptations or Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author's honor or reputation. Licensor agrees that in those jurisdictions (e.g. Japan), in which any exercise of the right granted in Section 3(b) of this License (the right to make Adaptations) would be deemed to be a distortion, mutilation, modification or other derogatory action prejudicial to the Original Author's honor and reputation, the Licensor will waive or not assert, as appropriate, this Section, to the fullest extent permitted by the applicable national law, to enable You to reasonably exercise Your right under Section 3(b) of this License (right to make Adaptations) but not otherwise.
41
+ 5. Representations, Warranties and Disclaimer
42
+
43
+ UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING AND TO THE FULLEST EXTENT PERMITTED BY APPLICABLE LAW, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO THIS EXCLUSION MAY NOT APPLY TO YOU.
44
+
45
+ 6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
46
+
47
+ 7. Termination
48
+
49
+ This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Adaptations or Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
50
+ Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
51
+ 8. Miscellaneous
52
+
53
+ Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
54
+ Each time You Distribute or Publicly Perform an Adaptation, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
55
+ If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
56
+ No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
57
+ This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
58
+ The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law.
data/README.markdown ADDED
@@ -0,0 +1,29 @@
1
+ Raxus
2
+ =====
3
+
4
+ Raxus is a gem that helps to easily transfer files or folders from one computer to another on a network. It's a small Ruby script that facilitates transfer of data across networks and only requires the recipient of the files have a Web browser.
5
+
6
+ When you run command
7
+
8
+ raxus ~/some_data/ ~/image.jpg
9
+
10
+ your folder "some_data" and "image.jpg" will be compressed with *zip*, application will start a mini webserver ([thin](http://code.macournoyer.com/thin/) using [rack](http://rack.rubyforge.org/)). Now your files are available for download - just visit YOUR_IP:5000.
11
+
12
+ Usage
13
+ -----
14
+
15
+ Usage: raxus [options] file1 folder1 file2 ...
16
+ -p, --port PORT
17
+ -a, --address ADDRESS
18
+ -l, --limit LIMIT Download limit.
19
+ -h, --help Show this message
20
+
21
+ Install
22
+ -------
23
+
24
+ $ sudo gem install raxus
25
+
26
+ Licence
27
+ -------
28
+
29
+ [Attribution-Noncommercial-Share Alike 3.0 Unported](http://creativecommons.org/licenses/by-nc-sa/3.0/)
data/bin/raxus ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ # -*- encoding: utf-8 -*-
3
+ $:.unshift File.join(File.dirname(__FILE__), "..")
4
+
5
+ require "rubygems"
6
+ require "rack"
7
+ require "lib/raxus"
8
+ require "optparse"
9
+
10
+ @options = { :port => 5000, :address => "localhost", :limit => false }
11
+
12
+ ARGV.options do |opt|
13
+ opt.banner = 'Usage: raxus [options] file1 folder1 file2 ...'
14
+ opt.on('-p', '--port PORT') { |port| @options[:port] = port.to_i }
15
+ opt.on('-a', '--address ADDRESS') { |address| @options[:address] = address }
16
+ opt.on('-l', '--limit LIMIT', 'Download limit.') { |limit| @options[:limit] = limit.to_i }
17
+ opt.on_tail('-h', '--help', 'Show this message') { puts opt; exit }
18
+ opt.parse!
19
+ end
20
+
21
+ if ARGV.size == 0
22
+ puts "You must specify file/folder to share."
23
+ exit
24
+ end
25
+
26
+ @options[:files] = ARGV
27
+
28
+ app = Raxus.app @options
29
+ Rack::Handler::Thin.run app, :Port => @options[:port], :Host => @options[:address]
data/lib/compress.rb ADDED
@@ -0,0 +1,27 @@
1
+ require "rubygems"
2
+ require "zip/zip"
3
+ require "zip/zipfilesystem"
4
+
5
+ def compress(files)
6
+ if files.size == 1
7
+ archive = File.join("/tmp", File.basename(files[0] + ".zip"))
8
+ else
9
+ archive = File.join("/tmp", "download.zip")
10
+ end
11
+
12
+ FileUtils.rm archive, :force => true
13
+
14
+ Zip::ZipFile.open(archive, 'w') do |zip|
15
+ files.each do |file|
16
+ if File.directory? file
17
+ Dir["#{file}/**/**"].each do |f|
18
+ zip.add(File.join(File.basename(file), f.sub(file + '/', '')), f)
19
+ end
20
+ else
21
+ zip.add(File.basename(file), file)
22
+ end
23
+ end
24
+ end
25
+
26
+ archive
27
+ end
data/lib/raxus.rb ADDED
@@ -0,0 +1,49 @@
1
+ $:.unshift File.dirname(__FILE__)
2
+
3
+ require "lib/compress"
4
+
5
+ class Raxus
6
+
7
+ class << self
8
+
9
+ def app(options = {})
10
+ Raxus::Application.new(options)
11
+ end
12
+
13
+ end
14
+
15
+ class Application
16
+
17
+ attr_accessor :options, :headers, :body, :request_counter
18
+
19
+ def initialize(options)
20
+ @options = options
21
+ @headers = {}
22
+ @request_counter = 0
23
+
24
+ @options[:files].map! { |file| File.expand_path(file) }
25
+
26
+ if @options[:files].size > 1 || File.directory?(@options[:files][0])
27
+ @options[:newfile] = compress(@options[:files])
28
+ else
29
+ @options[:newfile] = @options[:files][0]
30
+ end
31
+
32
+ @body = File.read(@options[:newfile])
33
+
34
+ @headers["Content-Type"] = "binary/octet-stream"
35
+ @headers["Content-Disposition"] = "attachment; filename=\"#{@options[:newfile]}\""
36
+ @headers["Content-Length"] = @body.size.to_s
37
+ end
38
+
39
+ def call(env)
40
+ unless @options[:limit] && (@request_counter += 1) > @options[:limit]
41
+ [200, @headers, [@body]]
42
+ else
43
+ [404, {}, ["Download limit exceeded."]]
44
+ end
45
+ end
46
+
47
+ end
48
+
49
+ end
@@ -0,0 +1,42 @@
1
+ require File.dirname(__FILE__) + '/spec_helper'
2
+
3
+ describe Raxus do
4
+ include Rack::Test::Methods
5
+
6
+ def prepare_browser(options)
7
+ browser = Rack::Test::Session.new(Rack::MockSession.new(Raxus.app(options)))
8
+ browser.get '/'
9
+ browser
10
+ end
11
+
12
+ it "should be able to share one file" do
13
+ browser = prepare_browser(:files => ["#{data_path}/avatar.jpg"])
14
+ browser.last_response.body.should == File.read("#{data_path}/avatar.jpg")
15
+ end
16
+
17
+ it "should be able to share one folder" do
18
+ browser = prepare_browser(:files => ["#{data_path}/GPL"])
19
+ browser.last_response.body.should == File.read("/tmp/GPL.zip")
20
+ end
21
+
22
+ it "should be able to share files/folders many times" do
23
+ browser = prepare_browser(:files => ["#{data_path}/GPL", "#{data_path}/avatar.jpg"])
24
+ 10.times do
25
+ browser.get '/'
26
+ browser.last_response.body.should == File.read("/tmp/download.zip")
27
+ end
28
+ end
29
+
30
+ it "should be able to set download limit" do
31
+ browser = prepare_browser(:files => ["#{data_path}/avatar.jpg"], :limit => 5)
32
+ browser.last_response.body.should == File.read("#{data_path}/avatar.jpg")
33
+
34
+ 4.times do # one get already done in prepare_browser
35
+ browser.get '/'
36
+ browser.last_response.body.should == File.read("#{data_path}/avatar.jpg")
37
+ end
38
+
39
+ browser.get '/'
40
+ browser.last_response.body.should include("limit exceeded")
41
+ end
42
+ end
Binary file
@@ -0,0 +1,251 @@
1
+
2
+ GNU GENERAL PUBLIC LICENSE
3
+ Version 1, February 1989
4
+
5
+ Copyright (C) 1989 Free Software Foundation, Inc.
6
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
7
+
8
+ Everyone is permitted to copy and distribute verbatim copies
9
+ of this license document, but changing it is not allowed.
10
+
11
+ Preamble
12
+
13
+ The license agreements of most software companies try to keep users
14
+ at the mercy of those companies. By contrast, our General Public
15
+ License is intended to guarantee your freedom to share and change free
16
+ software--to make sure the software is free for all its users. The
17
+ General Public License applies to the Free Software Foundation's
18
+ software and to any other program whose authors commit to using it.
19
+ You can use it for your programs, too.
20
+
21
+ When we speak of free software, we are referring to freedom, not
22
+ price. Specifically, the General Public License is designed to make
23
+ sure that you have the freedom to give away or sell copies of free
24
+ software, that you receive source code or can get it if you want it,
25
+ that you can change the software or use pieces of it in new free
26
+ programs; and that you know you can do these things.
27
+
28
+ To protect your rights, we need to make restrictions that forbid
29
+ anyone to deny you these rights or to ask you to surrender the rights.
30
+ These restrictions translate to certain responsibilities for you if you
31
+ distribute copies of the software, or if you modify it.
32
+
33
+ For example, if you distribute copies of a such a program, whether
34
+ gratis or for a fee, you must give the recipients all the rights that
35
+ you have. You must make sure that they, too, receive or can get the
36
+ source code. And you must tell them their rights.
37
+
38
+ We protect your rights with two steps: (1) copyright the software, and
39
+ (2) offer you this license which gives you legal permission to copy,
40
+ distribute and/or modify the software.
41
+
42
+ Also, for each author's protection and ours, we want to make certain
43
+ that everyone understands that there is no warranty for this free
44
+ software. If the software is modified by someone else and passed on, we
45
+ want its recipients to know that what they have is not the original, so
46
+ that any problems introduced by others will not reflect on the original
47
+ authors' reputations.
48
+
49
+ The precise terms and conditions for copying, distribution and
50
+ modification follow.
51
+
52
+ GNU GENERAL PUBLIC LICENSE
53
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
54
+
55
+ 0. This License Agreement applies to any program or other work which
56
+ contains a notice placed by the copyright holder saying it may be
57
+ distributed under the terms of this General Public License. The
58
+ "Program", below, refers to any such program or work, and a "work based
59
+ on the Program" means either the Program or any work containing the
60
+ Program or a portion of it, either verbatim or with modifications. Each
61
+ licensee is addressed as "you".
62
+
63
+ 1. You may copy and distribute verbatim copies of the Program's source
64
+ code as you receive it, in any medium, provided that you conspicuously and
65
+ appropriately publish on each copy an appropriate copyright notice and
66
+ disclaimer of warranty; keep intact all the notices that refer to this
67
+ General Public License and to the absence of any warranty; and give any
68
+ other recipients of the Program a copy of this General Public License
69
+ along with the Program. You may charge a fee for the physical act of
70
+ transferring a copy.
71
+
72
+ 2. You may modify your copy or copies of the Program or any portion of
73
+ it, and copy and distribute such modifications under the terms of Paragraph
74
+ 1 above, provided that you also do the following:
75
+
76
+ a) cause the modified files to carry prominent notices stating that
77
+ you changed the files and the date of any change; and
78
+
79
+ b) cause the whole of any work that you distribute or publish, that
80
+ in whole or in part contains the Program or any part thereof, either
81
+ with or without modifications, to be licensed at no charge to all
82
+ third parties under the terms of this General Public License (except
83
+ that you may choose to grant warranty protection to some or all
84
+ third parties, at your option).
85
+
86
+ c) If the modified program normally reads commands interactively when
87
+ run, you must cause it, when started running for such interactive use
88
+ in the simplest and most usual way, to print or display an
89
+ announcement including an appropriate copyright notice and a notice
90
+ that there is no warranty (or else, saying that you provide a
91
+ warranty) and that users may redistribute the program under these
92
+ conditions, and telling the user how to view a copy of this General
93
+ Public License.
94
+
95
+ d) You may charge a fee for the physical act of transferring a
96
+ copy, and you may at your option offer warranty protection in
97
+ exchange for a fee.
98
+
99
+ Mere aggregation of another independent work with the Program (or its
100
+ derivative) on a volume of a storage or distribution medium does not bring
101
+ the other work under the scope of these terms.
102
+
103
+ 3. You may copy and distribute the Program (or a portion or derivative of
104
+ it, under Paragraph 2) in object code or executable form under the terms of
105
+ Paragraphs 1 and 2 above provided that you also do one of the following:
106
+
107
+ a) accompany it with the complete corresponding machine-readable
108
+ source code, which must be distributed under the terms of
109
+ Paragraphs 1 and 2 above; or,
110
+
111
+ b) accompany it with a written offer, valid for at least three
112
+ years, to give any third party free (except for a nominal charge
113
+ for the cost of distribution) a complete machine-readable copy of the
114
+ corresponding source code, to be distributed under the terms of
115
+ Paragraphs 1 and 2 above; or,
116
+
117
+ c) accompany it with the information you received as to where the
118
+ corresponding source code may be obtained. (This alternative is
119
+ allowed only for noncommercial distribution and only if you
120
+ received the program in object code or executable form alone.)
121
+
122
+ Source code for a work means the preferred form of the work for making
123
+ modifications to it. For an executable file, complete source code means
124
+ all the source code for all modules it contains; but, as a special
125
+ exception, it need not include source code for modules which are standard
126
+ libraries that accompany the operating system on which the executable
127
+ file runs, or for standard header files or definitions files that
128
+ accompany that operating system.
129
+
130
+ 4. You may not copy, modify, sublicense, distribute or transfer the
131
+ Program except as expressly provided under this General Public License.
132
+ Any attempt otherwise to copy, modify, sublicense, distribute or transfer
133
+ the Program is void, and will automatically terminate your rights to use
134
+ the Program under this License. However, parties who have received
135
+ copies, or rights to use copies, from you under this General Public
136
+ License will not have their licenses terminated so long as such parties
137
+ remain in full compliance.
138
+
139
+ 5. By copying, distributing or modifying the Program (or any work based
140
+ on the Program) you indicate your acceptance of this license to do so,
141
+ and all its terms and conditions.
142
+
143
+ 6. Each time you redistribute the Program (or any work based on the
144
+ Program), the recipient automatically receives a license from the original
145
+ licensor to copy, distribute or modify the Program subject to these
146
+ terms and conditions. You may not impose any further restrictions on the
147
+ recipients' exercise of the rights granted herein.
148
+
149
+ 7. The Free Software Foundation may publish revised and/or new versions
150
+ of the General Public License from time to time. Such new versions will
151
+ be similar in spirit to the present version, but may differ in detail to
152
+ address new problems or concerns.
153
+
154
+ Each version is given a distinguishing version number. If the Program
155
+ specifies a version number of the license which applies to it and "any
156
+ later version", you have the option of following the terms and conditions
157
+ either of that version or of any later version published by the Free
158
+ Software Foundation. If the Program does not specify a version number of
159
+ the license, you may choose any version ever published by the Free Software
160
+ Foundation.
161
+
162
+ 8. If you wish to incorporate parts of the Program into other free
163
+ programs whose distribution conditions are different, write to the author
164
+ to ask for permission. For software which is copyrighted by the Free
165
+ Software Foundation, write to the Free Software Foundation; we sometimes
166
+ make exceptions for this. Our decision will be guided by the two goals
167
+ of preserving the free status of all derivatives of our free software and
168
+ of promoting the sharing and reuse of software generally.
169
+
170
+ NO WARRANTY
171
+
172
+ 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
173
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
174
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
175
+ PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
176
+ OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
177
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
178
+ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
179
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
180
+ REPAIR OR CORRECTION.
181
+
182
+ 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
183
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
184
+ REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
185
+ INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
186
+ OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
187
+ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
188
+ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
189
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
190
+ POSSIBILITY OF SUCH DAMAGES.
191
+
192
+ END OF TERMS AND CONDITIONS
193
+
194
+ Appendix: How to Apply These Terms to Your New Programs
195
+
196
+ If you develop a new program, and you want it to be of the greatest
197
+ possible use to humanity, the best way to achieve this is to make it
198
+ free software which everyone can redistribute and change under these
199
+ terms.
200
+
201
+ To do so, attach the following notices to the program. It is safest to
202
+ attach them to the start of each source file to most effectively convey
203
+ the exclusion of warranty; and each file should have at least the
204
+ "copyright" line and a pointer to where the full notice is found.
205
+
206
+ <one line to give the program's name and a brief idea of what it does.>
207
+ Copyright (C) 19yy <name of author>
208
+
209
+ This program is free software; you can redistribute it and/or modify
210
+ it under the terms of the GNU General Public License as published by
211
+ the Free Software Foundation; either version 1, or (at your option)
212
+ any later version.
213
+
214
+ This program is distributed in the hope that it will be useful,
215
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
216
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
217
+ GNU General Public License for more details.
218
+
219
+ You should have received a copy of the GNU General Public License
220
+ along with this program; if not, write to the Free Software
221
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
222
+
223
+
224
+ Also add information on how to contact you by electronic and paper mail.
225
+
226
+ If the program is interactive, make it output a short notice like this
227
+ when it starts in an interactive mode:
228
+
229
+ Gnomovision version 69, Copyright (C) 19xx name of author
230
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
231
+ This is free software, and you are welcome to redistribute it
232
+ under certain conditions; type `show c' for details.
233
+
234
+ The hypothetical commands `show w' and `show c' should show the
235
+ appropriate parts of the General Public License. Of course, the
236
+ commands you use may be called something other than `show w' and `show
237
+ c'; they could even be mouse-clicks or menu items--whatever suits your
238
+ program.
239
+
240
+ You should also get your employer (if you work as a programmer) or your
241
+ school, if any, to sign a "copyright disclaimer" for the program, if
242
+ necessary. Here a sample; alter the names:
243
+
244
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
245
+ program `Gnomovision' (a program to direct compilers to make passes
246
+ at assemblers) written by James Hacker.
247
+
248
+ <signature of Ty Coon>, 1 April 1989
249
+ Ty Coon, President of Vice
250
+
251
+ That's all there is to it!
Binary file
Binary file
@@ -0,0 +1,283 @@
1
+
2
+
3
+
4
+
5
+
6
+
7
+ Network Working Group D. Eastlake
8
+ Request for Comments: 2606 A. Panitz
9
+ BCP: 32 June 1999
10
+ Category: Best Current Practice
11
+
12
+
13
+ Reserved Top Level DNS Names
14
+
15
+ Status of this Memo
16
+
17
+ This document specifies an Internet Best Current Practices for the
18
+ Internet Community, and requests discussion and suggestions for
19
+ improvements. Distribution of this memo is unlimited.
20
+
21
+ Copyright Notice
22
+
23
+ Copyright (C) The Internet Society (1999). All Rights Reserved.
24
+
25
+ Abstract
26
+
27
+ To reduce the likelihood of conflict and confusion, a few top level
28
+ domain names are reserved for use in private testing, as examples in
29
+ documentation, and the like. In addition, a few second level domain
30
+ names reserved for use as examples are documented.
31
+
32
+ Table of Contents
33
+
34
+ 1. Introduction............................................1
35
+ 2. TLDs for Testing, & Documentation Examples..............2
36
+ 3. Reserved Example Second Level Domain Names..............2
37
+ 4. IANA Considerations.....................................3
38
+ 5. Security Considerations.................................3
39
+ References.................................................3
40
+ Authors' Addresses.........................................4
41
+ Full Copyright Statement...................................5
42
+
43
+ 1. Introduction
44
+
45
+ The global Internet Domain Name System is documented in [RFC 1034,
46
+ 1035, 1591] and numerous additional Requests for Comment. It defines
47
+ a tree of names starting with root, ".", immediately below which are
48
+ top level domain names such as ".com" and ".us". Below top level
49
+ domain names there are normally additional levels of names.
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+ Eastlake & Panitz Best Current Practice [Page 1]
59
+
60
+ RFC 2606 Reserved Top Level DNS Names June 1999
61
+
62
+
63
+ 2. TLDs for Testing, & Documentation Examples
64
+
65
+ There is a need for top level domain (TLD) names that can be used for
66
+ creating names which, without fear of conflicts with current or
67
+ future actual TLD names in the global DNS, can be used for private
68
+ testing of existing DNS related code, examples in documentation, DNS
69
+ related experimentation, invalid DNS names, or other similar uses.
70
+
71
+ For example, without guidance, a site might set up some local
72
+ additional unused top level domains for testing of its local DNS code
73
+ and configuration. Later, these TLDs might come into actual use on
74
+ the global Internet. As a result, local attempts to reference the
75
+ real data in these zones could be thwarted by the local test
76
+ versions. Or test or example code might be written that accesses a
77
+ TLD that is in use with the thought that the test code would only be
78
+ run in a restricted testbed net or the example never actually run.
79
+ Later, the test code could escape from the testbed or the example be
80
+ actually coded and run on the Internet. Depending on the nature of
81
+ the test or example, it might be best for it to be referencing a TLD
82
+ permanently reserved for such purposes.
83
+
84
+ To safely satisfy these needs, four domain names are reserved as
85
+ listed and described below.
86
+
87
+ .test
88
+ .example
89
+ .invalid
90
+ .localhost
91
+
92
+ ".test" is recommended for use in testing of current or new DNS
93
+ related code.
94
+
95
+ ".example" is recommended for use in documentation or as examples.
96
+
97
+ ".invalid" is intended for use in online construction of domain
98
+ names that are sure to be invalid and which it is obvious at a
99
+ glance are invalid.
100
+
101
+ The ".localhost" TLD has traditionally been statically defined in
102
+ host DNS implementations as having an A record pointing to the
103
+ loop back IP address and is reserved for such use. Any other use
104
+ would conflict with widely deployed code which assumes this use.
105
+
106
+ 3. Reserved Example Second Level Domain Names
107
+
108
+ The Internet Assigned Numbers Authority (IANA) also currently has the
109
+ following second level domain names reserved which can be used as
110
+ examples.
111
+
112
+
113
+
114
+ Eastlake & Panitz Best Current Practice [Page 2]
115
+
116
+ RFC 2606 Reserved Top Level DNS Names June 1999
117
+
118
+
119
+ example.com
120
+ example.net
121
+ example.org
122
+
123
+ 4. IANA Considerations
124
+
125
+ IANA has agreed to the four top level domain name reservations
126
+ specified in this document and will reserve them for the uses
127
+ indicated.
128
+
129
+ 5. Security Considerations
130
+
131
+ Confusion and conflict can be caused by the use of a current or
132
+ future top level domain name in experimentation or testing, as an
133
+ example in documentation, to indicate invalid names, or as a synonym
134
+ for the loop back address. Test and experimental software can escape
135
+ and end up being run against the global operational DNS. Even
136
+ examples used "only" in documentation can end up being coded and
137
+ released or cause conflicts due to later real use and the possible
138
+ acquisition of intellectual property rights in such "example" names.
139
+
140
+ The reservation of several top level domain names for these purposes
141
+ will minimize such confusion and conflict.
142
+
143
+ References
144
+
145
+ [RFC 1034] Mockapetris, P., "Domain names - concepts and facilities",
146
+ STD 13, RFC 1034, November 1987.
147
+
148
+ [RFC 1035] Mockapetris, P., "Domain names - implementation and
149
+ specification", STD 13, RFC 1035, November 1987.
150
+
151
+ [RFC 1591] Postel, J., "Domain Name System Structure and Delegation",
152
+ RFC 1591, March 1994.
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+ Eastlake & Panitz Best Current Practice [Page 3]
171
+
172
+ RFC 2606 Reserved Top Level DNS Names June 1999
173
+
174
+
175
+ Authors' Addresses
176
+
177
+ Donald E. Eastlake 3rd
178
+ IBM
179
+ 65 Shindegan Hill Road, RR #1
180
+ Carmel, NY 10512
181
+
182
+ Phone: +1 914-276-1668(h)
183
+ +1 914-784-7913(w)
184
+ FAX: +1 914-784-3833(3)
185
+ EMail: dee3@us.ibm.com
186
+
187
+
188
+ Aliza R. Panitz
189
+ 500 Stamford Dr. No. 310
190
+ Newark, DE 19711 USA
191
+
192
+ Phone: +1 302-738-1554
193
+ EMail: buglady@fuschia.net
194
+
195
+
196
+
197
+
198
+
199
+
200
+
201
+
202
+
203
+
204
+
205
+
206
+
207
+
208
+
209
+
210
+
211
+
212
+
213
+
214
+
215
+
216
+
217
+
218
+
219
+
220
+
221
+
222
+
223
+
224
+
225
+
226
+ Eastlake & Panitz Best Current Practice [Page 4]
227
+
228
+ RFC 2606 Reserved Top Level DNS Names June 1999
229
+
230
+
231
+ Full Copyright Statement
232
+
233
+ Copyright (C) The Internet Society (1999). All Rights Reserved.
234
+
235
+ This document and translations of it may be copied and furnished to
236
+ others, and derivative works that comment on or otherwise explain it
237
+ or assist in its implementation may be prepared, copied, published
238
+ and distributed, in whole or in part, without restriction of any
239
+ kind, provided that the above copyright notice and this paragraph are
240
+ included on all such copies and derivative works. However, this
241
+ document itself may not be modified in any way, such as by removing
242
+ the copyright notice or references to the Internet Society or other
243
+ Internet organizations, except as needed for the purpose of
244
+ developing Internet standards in which case the procedures for
245
+ copyrights defined in the Internet Standards process must be
246
+ followed, or as required to translate it into languages other than
247
+ English.
248
+
249
+ The limited permissions granted above are perpetual and will not be
250
+ revoked by the Internet Society or its successors or assigns.
251
+
252
+ This document and the information contained herein is provided on an
253
+ "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
254
+ TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
255
+ BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
256
+ HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
257
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
258
+
259
+ Acknowledgement
260
+
261
+ Funding for the RFC Editor function is currently provided by the
262
+ Internet Society.
263
+
264
+
265
+
266
+
267
+
268
+
269
+
270
+
271
+
272
+
273
+
274
+
275
+
276
+
277
+
278
+
279
+
280
+
281
+
282
+ Eastlake & Panitz Best Current Practice [Page 5]
283
+
data/spec/spec.opts ADDED
@@ -0,0 +1,2 @@
1
+ --colour
2
+ --format specdoc
@@ -0,0 +1,7 @@
1
+ require File.join(File.dirname(__FILE__), '..', 'lib' ,'raxus')
2
+ require "spec"
3
+ require "rack/test"
4
+
5
+ def data_path
6
+ File.join(File.dirname(__FILE__), "data")
7
+ end
metadata ADDED
@@ -0,0 +1,115 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: raxus
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 1
8
+ - 0
9
+ version: 0.1.0
10
+ platform: ruby
11
+ authors:
12
+ - sebcioz
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2010-04-28 00:00:00 -05:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: rack
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 1
29
+ - 1
30
+ - 0
31
+ version: 1.1.0
32
+ type: :runtime
33
+ version_requirements: *id001
34
+ - !ruby/object:Gem::Dependency
35
+ name: thin
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ segments:
42
+ - 1
43
+ - 2
44
+ - 0
45
+ version: 1.2.0
46
+ type: :runtime
47
+ version_requirements: *id002
48
+ - !ruby/object:Gem::Dependency
49
+ name: rubyzip
50
+ prerelease: false
51
+ requirement: &id003 !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ segments:
56
+ - 0
57
+ - 9
58
+ - 4
59
+ version: 0.9.4
60
+ type: :runtime
61
+ version_requirements: *id003
62
+ description: Easy file sharing with rack
63
+ email: sebcioz@gmail.com
64
+ executables:
65
+ - raxus
66
+ extensions: []
67
+
68
+ extra_rdoc_files: []
69
+
70
+ files:
71
+ - LICENCE
72
+ - README.markdown
73
+ - bin/raxus
74
+ - lib/compress.rb
75
+ - lib/raxus.rb
76
+ - spec/spec_helper.rb
77
+ - spec/data/avatar.jpg
78
+ - spec/data/GPL/gpl-1.0.txt
79
+ - spec/data/GPL/gplv3-127x51.png
80
+ - spec/data/GPL/agplv3-88x31.png
81
+ - spec/data/rfc2606.txt
82
+ - spec/basic_spec.rb
83
+ - spec/spec.opts
84
+ has_rdoc: true
85
+ homepage: http://github.com/sebcioz/raxus
86
+ licenses: []
87
+
88
+ post_install_message:
89
+ rdoc_options: []
90
+
91
+ require_paths:
92
+ - lib
93
+ required_ruby_version: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ segments:
98
+ - 0
99
+ version: "0"
100
+ required_rubygems_version: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ segments:
105
+ - 0
106
+ version: "0"
107
+ requirements: []
108
+
109
+ rubyforge_project:
110
+ rubygems_version: 1.3.6
111
+ signing_key:
112
+ specification_version: 3
113
+ summary: Easy file sharing with rack
114
+ test_files:
115
+ - spec/basic_spec.rb