Permalink
Browse files

handling .outlawed file per project, user and falling back to default…

… example if neither found
  • Loading branch information...
1 parent bce4604 commit 7e7bf784d295782d9880defc231e95c3b249f6aa bglusman committed Jan 25, 2012
Showing with 16 additions and 2 deletions.
  1. +15 −1 bin/outlaw
  2. +1 −1 lib/outlaw/version.rb
View
@@ -1,6 +1,20 @@
#!/usr/bin/env ruby
require "outlaw"
-load ".outlawed"
+if File.exists?(Dir.pwd + '/.outlawed')
+ load Dir.pwd + "/.outlawed"
+elsif File.exists?(Dir.home + '/.outlawed')
+ load Dir.home + '/.outlawed'
+else
+ puts "
+ ***NOTICE:***
+ Using example .outlawed file, which can be copied and customized from
+ #{File.dirname(File.dirname(`gem which outlaw`.chop)) + '/examples/.outlawed.example'}\n
+ place .outlawed file in project directory and/or home directories, outlaw looks
+ at pwd first for ./outlawed and then at ~/.outlawed and defaults to example
+ if neither is found\n\n"
+
+ load File.dirname(File.dirname(`gem which outlaw`.chop)) + '/examples/.outlawed.example'
+end
puts Outlaw.enforce(ARGV[0] ? ARGV[0] : ".")
View
@@ -1,3 +1,3 @@
module Outlaw
- VERSION = "0.1.1"
+ VERSION = "0.1.2"
end

0 comments on commit 7e7bf78

Please sign in to comment.