Skip to content
Browse files

rename heroku-direct to heroku-deploy

  • Loading branch information...
1 parent 90e27c7 commit 2ad1ae649b863faa0743aa6d110fa56665b16dbb @ryanbrainard ryanbrainard committed Apr 11, 2012
View
2 init.rb
@@ -1 +1 @@
-require "heroku/command/direct"
+require "heroku/command/deploy"
View
10 lib/heroku/command/direct.rb → lib/heroku/command/deploy.rb
@@ -4,7 +4,7 @@
# deploy to an app
#
-class Heroku::Command::Direct < Heroku::Command::BaseWithApp
+class Heroku::Command::Deploy < Heroku::Command::BaseWithApp
VERSION = "0.1"
DEFAULT_HOST = "direct-to.herokuapp.com"
MAX_UPLOAD_SIZE_MB = 100
@@ -17,19 +17,19 @@ class Heroku::Command::Direct < Heroku::Command::BaseWithApp
RESPONSE_KEY_MESSAGE = 'message'
RESPONSE_KEY_RELEASE = 'release'
- # direct
+ # deploy
#
# deploy to an app
#
def index
- display "Usage: heroku direct:war"
+ display "Usage: heroku deploy:war"
end
- # direct:war
+ # deploy:war
#
# deploy a war file to an app
#
- # -w, --war WARFILE # war to push
+ # -w, --war WARFILE # war to deploy
#
def war
war = extract_option("--war")
View
36 spec/heroku/command/direct_spec.rb → spec/heroku/command/deploy_spec.rb
@@ -1,6 +1,6 @@
require "spec_helper"
-describe Heroku::Command::Direct do
+describe Heroku::Command::Deploy do
before(:all) do
@app_name = ENV['HEROKU_TEST_APP_NAME']
@@ -18,18 +18,18 @@
context "when command options are are initialized" do
#noinspection RubyArgCount
#noinspection RubyWrongHash
- let (:options) { Heroku::Command.commands['direct:war'][:options] }
+ let (:options) { Heroku::Command.commands['deploy:war'][:options] }
it { options.has_key?("war").should be_true }
end
context "when a war file and valid app is specified" do
#noinspection RubyArgCount
- let(:direct) { Heroku::Command::Direct.new [], :app => @app_name, :war => @real_war.path }
+ let(:deploy) { Heroku::Command::Deploy.new [], :app => @app_name, :war => @real_war.path }
context "and everything is peachy" do
it "the war should be deployed" do
- direct.war.should eql "success"
+ deploy.war.should eql "success"
end
it "the result should be visible in browser" do
@@ -39,66 +39,66 @@
context "when heroku credentials are invalid" do
before do
- direct.stub(:api_key).and_return "something_invalid"
+ deploy.stub(:api_key).and_return "something_invalid"
end
it "an error should be raised" do
- lambda { direct.war }.should raise_error(Heroku::Command::CommandFailed, /Unable to get user info/)
+ lambda { deploy.war }.should raise_error(Heroku::Command::CommandFailed, /Unable to get user info/)
end
end
end
context "when a war file is huge" do
#noinspection RubyArgCount
- let(:direct) { Heroku::Command::Direct.new [], :app => @app_name, :war => @huge_war.path }
+ let(:deploy) { Heroku::Command::Deploy.new [], :app => @app_name, :war => @huge_war.path }
it "the war should be deployed" do
- direct.war.should eql "success"
+ deploy.war.should eql "success"
end
end
context "when a war file is too huge" do
#noinspection RubyArgCount
- let(:direct) { Heroku::Command::Direct.new [], :app => @app_name, :war => @too_huge_war.path }
+ let(:deploy) { Heroku::Command::Deploy.new [], :app => @app_name, :war => @too_huge_war.path }
it "an error should be raised" do
- lambda { direct.war }.should raise_error(Heroku::Command::CommandFailed, "War file must not exceed 100 MB")
+ lambda { deploy.war }.should raise_error(Heroku::Command::CommandFailed, "War file must not exceed 100 MB")
end
end
context "when a war file and app without access is specified" do
#noinspection RubyArgCount
- let(:direct) { Heroku::Command::Direct.new [], :app => "an-app-i-do-not-own", :war => @real_war.path }
+ let(:deploy) { Heroku::Command::Deploy.new [], :app => "an-app-i-do-not-own", :war => @real_war.path }
it "an error should be raised" do
- lambda { direct.war }.should raise_error(Heroku::Command::CommandFailed, "No access to this app")
+ lambda { deploy.war }.should raise_error(Heroku::Command::CommandFailed, "No access to this app")
end
end
context "when no war file is specified" do
#noinspection RubyArgCount
- let(:direct) { Heroku::Command::Direct.new [], :app => @app_name }
+ let(:deploy) { Heroku::Command::Deploy.new [], :app => @app_name }
it "an error should be raised" do
- lambda { direct.war }.should raise_error(Heroku::Command::CommandFailed, "No .war specified.\nSpecify which war to use with --war <war file name>")
+ lambda { deploy.war }.should raise_error(Heroku::Command::CommandFailed, "No .war specified.\nSpecify which war to use with --war <war file name>")
end
end
context "when a war file without a .war extension is specified" do
#noinspection RubyArgCount
- let(:direct) { Heroku::Command::Direct.new [], :app => @app_name, :war => "something.notwar" }
+ let(:deploy) { Heroku::Command::Deploy.new [], :app => @app_name, :war => "something.notwar" }
it "an error should be raised" do
- lambda { direct.war }.should raise_error(Heroku::Command::CommandFailed, "War file must have a .war extension")
+ lambda { deploy.war }.should raise_error(Heroku::Command::CommandFailed, "War file must have a .war extension")
end
end
context "when a war file is specified but can't be found'" do
#noinspection RubyArgCount
- let(:direct) { Heroku::Command::Direct.new [], :app => @app_name, :war => "not_there.war" }
+ let(:deploy) { Heroku::Command::Deploy.new [], :app => @app_name, :war => "not_there.war" }
it "an error should be raised" do
- lambda { direct.war }.should raise_error(Heroku::Command::CommandFailed, "War file not found")
+ lambda { deploy.war }.should raise_error(Heroku::Command::CommandFailed, "War file not found")
end
end
View
2 spec/spec_helper.rb
@@ -1,4 +1,4 @@
require "heroku/cli"
-require "heroku/command/direct"
+require "heroku/command/deploy"
require "rspec"
require "tempfile"

0 comments on commit 2ad1ae6

Please sign in to comment.
Something went wrong with that request. Please try again.