srv 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in srv.gemspec
4
+ gemspec
data/README.rdoc ADDED
@@ -0,0 +1,17 @@
1
+ = srv
2
+
3
+ Simple wrapper for Rack that serves static files from current directory.
4
+
5
+ == Installation
6
+
7
+ $ gem install srv
8
+
9
+ == Usage
10
+
11
+ $ cd /some/html/and/javascript/project && srv 6543
12
+
13
+ Visit http://localhost:6543 to see directory listing.
14
+
15
+ == Copyright
16
+
17
+ 2011 Hubert Łępicki <hubert.lepicki@amberbit.com>, licensed under the terms of MIT license.
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
data/bin/srv ADDED
@@ -0,0 +1,3 @@
1
+ require 'srv'
2
+
3
+ Srv::Server.new(ARGV).run!
data/lib/config.ru ADDED
@@ -0,0 +1,3 @@
1
+ root=Dir.pwd
2
+ puts ">>> serving contents of directory: #{root}"
3
+ run Rack::Directory.new("#{root}")
@@ -0,0 +1,3 @@
1
+ module Srv
2
+ VERSION = "0.0.1"
3
+ end
data/lib/srv.rb ADDED
@@ -0,0 +1,17 @@
1
+ require 'rack'
2
+
3
+ module Srv
4
+ class Server
5
+ def initialize(args)
6
+ port = args[0] || 4000
7
+ puts ">>> srv will run on port: #{port}"
8
+ @rack_server = Rack::Server.new(:config => File.join(File.dirname(__FILE__), 'config.ru'),
9
+ :Port => port,
10
+ :AccessLog => [])
11
+ end
12
+
13
+ def run!
14
+ @rack_server.start
15
+ end
16
+ end
17
+ end
data/srv.gemspec ADDED
@@ -0,0 +1,22 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "srv/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "srv"
7
+ s.version = Srv::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Hubert Lepicki"]
10
+ s.email = ["hubert.lepicki@gmail.com", "hubert.lepicki@amberbit.com"]
11
+ s.homepage = ""
12
+ s.summary = %q{static files server}
13
+ s.description = %q{fire up with 'srv' to serve current directory on port 4000 (default), 'srv 5000' on port 5000}
14
+
15
+ s.rubyforge_project = "srv"
16
+
17
+ s.files = `git ls-files`.split("\n")
18
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
+ s.require_paths = ["lib"]
21
+ s.add_dependency 'rack', '>=1.2.1'
22
+ end
metadata ADDED
@@ -0,0 +1,76 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: srv
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.0.1
6
+ platform: ruby
7
+ authors:
8
+ - Hubert Lepicki
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2011-05-31 00:00:00 +02:00
14
+ default_executable:
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: rack
18
+ prerelease: false
19
+ requirement: &id001 !ruby/object:Gem::Requirement
20
+ none: false
21
+ requirements:
22
+ - - ">="
23
+ - !ruby/object:Gem::Version
24
+ version: 1.2.1
25
+ type: :runtime
26
+ version_requirements: *id001
27
+ description: fire up with 'srv' to serve current directory on port 4000 (default), 'srv 5000' on port 5000
28
+ email:
29
+ - hubert.lepicki@gmail.com
30
+ - hubert.lepicki@amberbit.com
31
+ executables:
32
+ - srv
33
+ extensions: []
34
+
35
+ extra_rdoc_files: []
36
+
37
+ files:
38
+ - .gitignore
39
+ - Gemfile
40
+ - README.rdoc
41
+ - Rakefile
42
+ - bin/srv
43
+ - lib/config.ru
44
+ - lib/srv.rb
45
+ - lib/srv/version.rb
46
+ - srv.gemspec
47
+ has_rdoc: true
48
+ homepage: ""
49
+ licenses: []
50
+
51
+ post_install_message:
52
+ rdoc_options: []
53
+
54
+ require_paths:
55
+ - lib
56
+ required_ruby_version: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: "0"
62
+ required_rubygems_version: !ruby/object:Gem::Requirement
63
+ none: false
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: "0"
68
+ requirements: []
69
+
70
+ rubyforge_project: srv
71
+ rubygems_version: 1.6.2
72
+ signing_key:
73
+ specification_version: 3
74
+ summary: static files server
75
+ test_files: []
76
+