Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

initial commit

  • Loading branch information...
commit 73f638784d3dd4791f297ed66d957819363a210f 0 parents
@rodreegez authored
5 .gitignore
@@ -0,0 +1,5 @@
+*.gem
+.bundle
+Gemfile.lock
+pkg/*
+tmp
4 Gemfile
@@ -0,0 +1,4 @@
+source "http://rubygems.org"
+
+# Specify your gem's dependencies in powder.gemspec
+gemspec
2  Rakefile
@@ -0,0 +1,2 @@
+require 'bundler'
+Bundler::GemHelper.install_tasks
53 bin/pow
@@ -0,0 +1,53 @@
+#!/usr/bin/ruby
+
+require 'rubygems'
+require 'thor'
+require 'fileutils'
+
+class Pow < Thor
+ default_task :link
+
+ map '-r' => 'restart'
+ map '-l' => 'list'
+ map '-L' => 'link'
+
+ POWPATH = "/Users/#{`whoami`.chomp}/.pow"
+
+ desc "link", "link a pow"
+ def link(name=nil)
+ return unless is_powable?
+ current_path = %x{pwd}.chomp
+ symink_path = "#{POWPATH}/#{name || File.basename(current_path)}"
+ FileUtils.ln_s(current_path, symink_path, :verbose => true) unless File.exists?(symink_path)
+ end
+
+ desc "restart", "restart current pow"
+ def restart
+ return unless is_powable?
+ FileUtils.mkdir_p('tmp')
+ %x{touch tmp/restart.txt}
+ end
+
+ desc "list", "list current pows"
+ def list
+ Dir[POWPATH + "/*"].map { |a| p File.basename(a) }
+ end
+
+ desc "remove", "remove a pow"
+ def remove(name=nil)
+ return unless is_powable?
+ FileUtils.rm POWPATH + '/' + (name || File.basename(%x{pwd}.chomp))
+ end
+
+ private
+
+ def is_powable?
+ if File.exists? 'config.ru'
+ true
+ else
+ $stdout.puts "This does not appear to be a rack app, there is no config.ru."
+ false
+ end
+ end
+end
+Pow.start
5 lib/powder.rb
@@ -0,0 +1,5 @@
+module Pow
+ module Gem
+ # Your code goes here...
+ end
+end
5 lib/powder/version.rb
@@ -0,0 +1,5 @@
+module Pow
+ module Gem
+ VERSION = "0.0.1"
+ end
+end
23 powder.gemspec
@@ -0,0 +1,23 @@
+# -*- encoding: utf-8 -*-
+$:.push File.expand_path("../lib", __FILE__)
+require "powder/version"
+
+Gem::Specification.new do |s|
+ s.name = "powder"
+ s.version = Pow::Gem::VERSION
+ s.platform = Gem::Platform::RUBY
+ s.authors = ["Phil Nash", "Adam Rogers"]
+ s.email = ["no"]
+ s.homepage = "http://github.com/Rodreegez/pow-gem"
+ s.summary = %q{Makes Pow even easier}
+ s.description = %q{seriously, it's easy.}
+
+ s.rubyforge_project = "powder"
+
+ s.files = `git ls-files`.split("\n")
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
+ s.executables = ["pow"]
+ s.require_paths = ["lib"]
+
+ s.add_dependency 'thor', '>=0.14.6'
+end
Please sign in to comment.
Something went wrong with that request. Please try again.