Skip to content
This repository has been archived by the owner on Jun 8, 2019. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove unused config constructor
  • Loading branch information
joshuaclayton committed Sep 15, 2011
1 parent 153316a commit fe4be8b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/kumade/cli.rb
Expand Up @@ -16,7 +16,7 @@ def initialize(args = ARGV, out = StringIO.new)
parse_arguments!(args)

Kumade.configuration.pretending = !!@options[:pretend]
Kumade.configuration.environment = args.shift || 'staging'
Kumade.configuration.environment = args.shift

self.class.swapping_stdout_for(out, print_output?) do
deploy
Expand Down
11 changes: 5 additions & 6 deletions lib/kumade/configuration.rb
@@ -1,14 +1,13 @@
module Kumade
class Configuration
def initialize(environment = 'staging', pretending = false )
@environment = environment
@pretending = pretending
end
attr_writer :pretending, :environment

def pretending?
@pretending
@pretending || false
end

attr_accessor :pretending, :environment
def environment
@environment || "staging"
end
end
end
6 changes: 3 additions & 3 deletions spec/kumade/cli_spec.rb
Expand Up @@ -16,7 +16,7 @@
context pretend_flag do
it "sets pretending to true" do
subject
Kumade.configuration.pretending.should == true
Kumade.configuration.should be_pretending
end

it "deploys" do
Expand All @@ -36,7 +36,7 @@
end

it "sets pretending to false" do
Kumade.configuration.pretending.should == false
Kumade.configuration.should_not be_pretending
end
end

Expand All @@ -45,7 +45,7 @@

it "sets pretending to false" do
subject
Kumade.configuration.pretending.should == false
Kumade.configuration.should_not be_pretending
end

it "deploys" do
Expand Down
4 changes: 2 additions & 2 deletions spec/kumade/configuration_spec.rb
Expand Up @@ -8,7 +8,7 @@
describe Kumade::Configuration, "#pretending" do
it "has read/write access for the pretending attribute" do
subject.pretending = true
subject.pretending.should == true
subject.should be_pretending
end
end

Expand All @@ -24,7 +24,7 @@
end

it "defaults to false" do
subject.pretending.should == false
subject.should_not be_pretending
end
end

Expand Down

0 comments on commit fe4be8b

Please sign in to comment.