Permalink
Browse files

Allowing require 'powder' to use library and extracting functionality…

… into lib.
  • Loading branch information...
1 parent cbac6f7 commit 16fd16266d62173b0f10df3487d396b05f634b95 @phil-monroe committed Nov 29, 2011
Showing with 12 additions and 10 deletions.
  1. +2 −8 bin/powder
  2. +2 −2 lib/powder.rb
  3. +8 −0 lib/powder/helpers.rb
View
@@ -4,8 +4,7 @@ require 'rubygems'
require 'thor'
require 'fileutils'
require 'net/https'
-require 'powder/version'
-require 'powder/helpers'
+require 'powder'
module Powder
@@ -120,12 +119,7 @@ module Powder
desc "list", "List current pows"
def list
- pows = Dir[POW_PATH + "/*"].map do |link|
- realpath = File.readlink(link)
- app_is_current = (realpath == Dir.pwd) ? '*' : ' '
- [app_is_current, File.basename(link), realpath.gsub(ENV['HOME'], '~')]
- end
- print_table(pows)
+ print_table(pow_apps)
end
desc "open", "Open a pow in the browser"
View
@@ -1,2 +1,2 @@
-module Powder
-end
+require 'powder/version'
+require 'powder/helpers'
View
@@ -90,5 +90,13 @@ def domain
'dev'
end
end
+
+ def pow_apps
+ Dir[POW_PATH + "/*"].map do |link|
+ realpath = File.readlink(link)
+ app_is_current = (realpath == Dir.pwd) ? '*' : ' '
+ [app_is_current, File.basename(link), realpath.gsub(ENV['HOME'], '~')]
+ end
+ end
end
end

0 comments on commit 16fd162

Please sign in to comment.