Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

… example if neither found
  • Loading branch information...
commit 7e7bf784d295782d9880defc231e95c3b249f6aa 1 parent bce4604
@bglusman authored
Showing with 16 additions and 2 deletions.
  1. +15 −1 bin/outlaw
  2. +1 −1  lib/outlaw/version.rb
View
16 bin/outlaw
@@ -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
2  lib/outlaw/version.rb
@@ -1,3 +1,3 @@
module Outlaw
- VERSION = "0.1.1"
+ VERSION = "0.1.2"
end
Please sign in to comment.
Something went wrong with that request. Please try again.