Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 73f6387
Showing
7 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
*.gem | ||
.bundle | ||
Gemfile.lock | ||
pkg/* | ||
tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
source "http://rubygems.org" | ||
|
||
# Specify your gem's dependencies in powder.gemspec | ||
gemspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
require 'bundler' | ||
Bundler::GemHelper.install_tasks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module Pow | ||
module Gem | ||
# Your code goes here... | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module Pow | ||
module Gem | ||
VERSION = "0.0.1" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |