erik_server 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- metadata +2 -10
- data/Gemfile +0 -4
- data/LICENSE.txt +0 -22
- data/Rakefile +0 -2
- data/bin/server +0 -29
- data/lib/server/version.rb +0 -3
- data/lib/server.rb +0 -5
- data/server.gemspec +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68ed15efc4a8e8ecdf3d7ef98ed7879e567acf8b
|
4
|
+
data.tar.gz: 2f2319383f31cb36b4e5d375f3af00cd23db4402
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33ef96608d98e5ca532c6dd1af9ffef9c61e85435d9fb622cb693fca560a3ad6fbf9d09e853d510d8b85770b810e6c04061e8323c206a53526236673c75986d3
|
7
|
+
data.tar.gz: af6c09a45668c0c981bda4eea479270dcd7f8a152e0a71229922ef9ff8d1054e207c9d381e991f8f4ceac4f9e49f04dc1b20b52cd58c293004390b796298565c
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: erik_server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erik Nilsen
|
@@ -41,19 +41,11 @@ dependencies:
|
|
41
41
|
description: A simple server made with ruby
|
42
42
|
email:
|
43
43
|
- enilsen16@live.com
|
44
|
-
executables:
|
45
|
-
- server
|
44
|
+
executables: []
|
46
45
|
extensions: []
|
47
46
|
extra_rdoc_files: []
|
48
47
|
files:
|
49
|
-
- Gemfile
|
50
|
-
- LICENSE.txt
|
51
48
|
- README.md
|
52
|
-
- Rakefile
|
53
|
-
- bin/server
|
54
|
-
- lib/server.rb
|
55
|
-
- lib/server/version.rb
|
56
|
-
- server.gemspec
|
57
49
|
homepage: ''
|
58
50
|
licenses:
|
59
51
|
- MIT
|
data/Gemfile
DELETED
data/LICENSE.txt
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
Copyright (c) 2014 Erik Nilsen
|
2
|
-
|
3
|
-
MIT License
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
-
a copy of this software and associated documentation files (the
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
11
|
-
the following conditions:
|
12
|
-
|
13
|
-
The above copyright notice and this permission notice shall be
|
14
|
-
included in all copies or substantial portions of the Software.
|
15
|
-
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
DELETED
data/bin/server
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'socket'
|
4
|
-
|
5
|
-
server = TCPServer.new 1337
|
6
|
-
|
7
|
-
loop do
|
8
|
-
client = server.accept
|
9
|
-
request = clients.gets
|
10
|
-
verb, path,protocol = request.spilt(" ")
|
11
|
-
path ="." + path
|
12
|
-
|
13
|
-
if File.file?(path)
|
14
|
-
body = File.open(path, "r"){|file| file.read}
|
15
|
-
status = "200 OK"
|
16
|
-
else
|
17
|
-
body = "File not found\n"
|
18
|
-
status = "404 Not Found"
|
19
|
-
end
|
20
|
-
|
21
|
-
response = "#{protocol} #{status}\n"
|
22
|
-
response += "Content-Type: text/html\n"
|
23
|
-
response += "Content-Length: #{body.length}\n"
|
24
|
-
response += "Connection: close\n\n"
|
25
|
-
response += body
|
26
|
-
|
27
|
-
client.puts response
|
28
|
-
client.close
|
29
|
-
end
|
data/lib/server/version.rb
DELETED
data/lib/server.rb
DELETED
data/server.gemspec
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'server/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = "erik_server"
|
8
|
-
spec.version = Server::VERSION
|
9
|
-
spec.authors = ["Erik Nilsen"]
|
10
|
-
spec.email = ["enilsen16@live.com"]
|
11
|
-
spec.summary = %q{A simple server}
|
12
|
-
spec.description = %q{A simple server made with ruby}
|
13
|
-
spec.homepage = ""
|
14
|
-
spec.license = "MIT"
|
15
|
-
|
16
|
-
spec.files = `git ls-files -z`.split("\x0")
|
17
|
-
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
-
spec.require_paths = ["lib"]
|
20
|
-
|
21
|
-
spec.add_development_dependency "bundler", "~> 1.6"
|
22
|
-
spec.add_development_dependency "rake"
|
23
|
-
end
|