Skip to content

Commit

Permalink
add CLI (it depends on Thor)
Browse files Browse the repository at this point in the history
  • Loading branch information
machu committed May 1, 2013
1 parent 0029edb commit 15da43b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ gem 'omniauth'
gem 'omniauth-twitter'
gem 'omniauth-github'

gem 'thor'

gem 'dalli'
gem 'redis'
gem 'redis-namespace'
Expand Down
1 change: 1 addition & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -196,5 +196,6 @@ DEPENDENCIES
tapp
test-unit
thin
thor
trinidad
twitter-text
6 changes: 5 additions & 1 deletion bin/tdiary
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/usr/bin/env ruby
lib = File.expand_path('../../', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)

require 'tdiary'
require 'tdiary/cli'

TDiary::CLI.start
15 changes: 15 additions & 0 deletions tdiary/cli.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# coding: utf-8
require 'thor'
require 'tdiary'

module TDiary
class CLI < Thor
include Thor::Actions

desc "version", "Prints the tDiary's version information"
def version
say "tdiary #{TDiary::VERSION}"
end
map %w(-v --version) => :version
end
end

0 comments on commit 15da43b

Please sign in to comment.