Permalink
Browse files

Add `bourbon (-v|--version)`

  • Loading branch information...
1 parent 7ebd7b0 commit 05c85d77f2335a267aff7103338fe76f993bd9ad @sikachu sikachu committed with Phil LaPier Oct 5, 2012
Showing with 17 additions and 0 deletions.
  1. +4 −0 features/step_definitions/bourbon_steps.rb
  2. +6 −0 features/version.feature
  3. +7 −0 lib/bourbon/generator.rb
@@ -30,3 +30,7 @@
Then /^bourbon should not have been generated$/ do
check_directory_presence(['bourbon'], false)
end
+
+Then /^the output should contain the current version of Bourbon$/ do
+ step %(the output should contain exactly "Bourbon #{Bourbon::VERSION}\n")
+end
@@ -0,0 +1,6 @@
+@disable-bundler
+Feature: Show version
+ Scenario: Viewing version
+ When I successfully run `bundle exec bourbon --version`
+ Then the output should contain the current version of Bourbon
+
@@ -3,6 +3,8 @@
module Bourbon
class Generator < Thor
+ map ['-v', '--version'] => :version
+
desc 'install', 'Install Bourbon into your project'
method_options :path => :string, :force => :boolean
def install
@@ -25,6 +27,11 @@ def update
end
end
+ desc 'version', 'Show Bourbon version'
+ def version
+ say "Bourbon #{Bourbon::VERSION}"
+ end
+
private
def bourbon_files_already_exist?

0 comments on commit 05c85d7

Please sign in to comment.