diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8ee2efc --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +pkg/* +*.gem \ No newline at end of file diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..8e4dba2 --- /dev/null +++ b/Gemfile @@ -0,0 +1,4 @@ +source :gemcutter + +# Specify your gem's dependencies in asdf.gemspec +gemspec \ No newline at end of file diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..14cfe0b --- /dev/null +++ b/Rakefile @@ -0,0 +1,2 @@ +require 'bundler' +Bundler::GemHelper.install_tasks diff --git a/asdf.gemspec b/asdf.gemspec new file mode 100644 index 0000000..2edd7ca --- /dev/null +++ b/asdf.gemspec @@ -0,0 +1,24 @@ +# -*- encoding: utf-8 -*- +$LOAD_PATH.unshift File.expand_path('../lib', __FILE__) +require 'asdf/version' + +Gem::Specification.new do |s| + s.name = "asdf" + s.version = Asdf::VERSION + s.platform = Gem::Platform::RUBY + s.authors = ["Yehuda Katz"] + s.email = ["wycats@gmail.com"] + s.homepage = "http://github.com/wycats/asdf" + s.summary = "Make the current directory available on port 9292" + s.description = "Use Rack::Directory to rackup the current directory on port 9292 for availability in a browser" + + s.required_rubygems_version = ">= 1.3.6" + s.rubyforge_project = "asdf" + + s.add_runtime_dependency "rack", "~> 1.2.1" + s.add_development_dependency "bundler", ">= 1.0.0.rc.5" + + s.files = `git ls-files`.split("\n") + s.executables = `git ls-files`.split("\n").select{|f| f =~ /^bin/} + s.require_path = 'lib' +end diff --git a/bin/asdf b/bin/asdf new file mode 100755 index 0000000..db19275 --- /dev/null +++ b/bin/asdf @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby + +require "asdf" +Asdf::Server.new.start diff --git a/lib/asdf.rb b/lib/asdf.rb new file mode 100644 index 0000000..f8154e5 --- /dev/null +++ b/lib/asdf.rb @@ -0,0 +1,11 @@ +require "rack" +require "asdf/version" + +module Asdf + class Server < ::Rack::Server + def app + Rack::Directory.new(Dir.pwd) + end + end +end + diff --git a/lib/asdf/version.rb b/lib/asdf/version.rb new file mode 100644 index 0000000..848a2d7 --- /dev/null +++ b/lib/asdf/version.rb @@ -0,0 +1,3 @@ +module Asdf + VERSION = "0.5.0" +end