forked from spree/spree
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix requires at least 0 argument error in Thor
- Loading branch information
Showing
3 changed files
with
14 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,2 @@ | ||
#!/usr/bin/env ruby | ||
|
||
require 'spree_cmd' | ||
|
||
SpreeCmd::Command.start | ||
require 'spree_cmd' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
#!/usr/bin/env ruby | ||
|
||
require 'spree_cmd' | ||
|
||
SpreeCmd::Command.start | ||
|
||
require 'spree_cmd' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,19 @@ | ||
require 'thor' | ||
require 'thor/group' | ||
|
||
require 'spree_cmd/installer' | ||
require 'spree_cmd/extension' | ||
require 'spree_cmd/version' | ||
|
||
module SpreeCmd | ||
class Command < Thor | ||
|
||
desc 'install', 'adds spree to an existing rails app' | ||
method_option :app_path, :type => :string, :desc => 'path to rails application' | ||
def install(app_path = '.') | ||
invoke Installer | ||
end | ||
class Command | ||
|
||
desc 'extension', 'builds a spree extension' | ||
method_option :app_path, :type => :string, :desc => 'path to new extension' | ||
def extension(app_path) | ||
invoke Extension | ||
if ARGV.first == 'version' | ||
puts Gem.loaded_specs['spree_cmd'].version | ||
elsif ARGV.first == 'extension' | ||
ARGV.shift | ||
require 'spree_cmd/extension' | ||
SpreeCmd::Extension.start | ||
else | ||
ARGV.shift | ||
require 'spree_cmd/installer' | ||
SpreeCmd::Installer.start | ||
end | ||
|
||
desc 'version', 'display spree_cmd version' | ||
def version | ||
invoke Version | ||
end | ||
|
||
end | ||
end | ||
end |