Navigation Menu

Skip to content

Commit

Permalink
Refactored CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagopintodev committed May 4, 2016
1 parent ea8c827 commit 1fba802
Show file tree
Hide file tree
Showing 12 changed files with 758 additions and 365 deletions.
10 changes: 8 additions & 2 deletions bin/oauth
@@ -1,5 +1,11 @@
#!/usr/bin/env ruby

require "oauth/cli"
require_relative "../lib/oauth"
require 'oauth/cli'

OAuth::CLI.execute(STDOUT, STDIN, STDERR, ARGV)
Signal.trap("INT") { puts; exit(1) } # don't dump a backtrace on a ^C

ARGV << 'help' if ARGV.empty?
command = ARGV.shift

OAuth::CLI.new(STDOUT, STDIN, STDERR, command, ARGV).run
3 changes: 2 additions & 1 deletion lib/oauth.rb
@@ -1,4 +1,5 @@
$LOAD_PATH << File.dirname(__FILE__) unless $LOAD_PATH.include?(File.dirname(__FILE__))
root = File.dirname(__FILE__)
$LOAD_PATH << root unless $LOAD_PATH.include?(root)

require 'oauth/version'

Expand Down

0 comments on commit 1fba802

Please sign in to comment.