paratrooper 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1 +1,6 @@
1
1
  require "bundler/gem_tasks"
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -1,6 +1,6 @@
1
1
  module Paratrooper
2
2
  class DefaultFormatter
3
- def puts(message)
3
+ def display(message)
4
4
  puts
5
5
  puts "=" * 80
6
6
  puts ">> #{message}"
@@ -1,5 +1,6 @@
1
1
  require 'heroku-api'
2
2
  require 'paratrooper/default_formatter'
3
+ require 'paratrooper/system_caller'
3
4
 
4
5
  module Paratrooper
5
6
  class Deploy
@@ -93,17 +94,11 @@ module Paratrooper
93
94
  end
94
95
 
95
96
  def notify_screen(message)
96
- formatter.puts(message)
97
+ formatter.display(message)
97
98
  end
98
99
 
99
100
  def system_call(call)
100
101
  system_caller.execute(call)
101
102
  end
102
103
  end
103
-
104
- SystemCaller = Struct.new(:call) do
105
- def execute
106
- system(call)
107
- end
108
- end
109
104
  end
@@ -1,4 +1,4 @@
1
- SystemCaller = Struct.new(:call) do
1
+ class SystemCaller
2
2
  def execute
3
3
  system(call)
4
4
  end
@@ -1,3 +1,3 @@
1
1
  module Paratrooper
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -59,8 +59,12 @@ describe Paratrooper::Deploy do
59
59
  let(:options) { { formatter: formatter } }
60
60
  let(:formatter) { double(:formatter, puts: true) }
61
61
 
62
+ before do
63
+ formatter.stub(:display)
64
+ end
65
+
62
66
  it "displays message" do
63
- formatter.should_receive(:puts).with('Activating Maintenance Mode')
67
+ formatter.should_receive(:display).with('Activating Maintenance Mode')
64
68
  deployer.activate_maintenance_mode
65
69
  end
66
70
 
@@ -71,8 +75,12 @@ describe Paratrooper::Deploy do
71
75
  end
72
76
 
73
77
  describe "#deactivate_maintenance_mode" do
78
+ before do
79
+ formatter.stub(:display)
80
+ end
81
+
74
82
  it "displays message" do
75
- formatter.should_receive(:puts).with('Deactivating Maintenance Mode')
83
+ formatter.should_receive(:display).with('Deactivating Maintenance Mode')
76
84
  deployer.deactivate_maintenance_mode
77
85
  end
78
86
 
@@ -88,10 +96,11 @@ describe Paratrooper::Deploy do
88
96
 
89
97
  before do
90
98
  system_caller.stub(:execute)
99
+ formatter.stub(:display)
91
100
  end
92
101
 
93
102
  it 'displays message' do
94
- formatter.should_receive(:puts).with('Updating Repo Tag: awesome')
103
+ formatter.should_receive(:display).with('Updating Repo Tag: awesome')
95
104
  deployer.update_repo_tag
96
105
  end
97
106
 
@@ -119,10 +128,11 @@ describe Paratrooper::Deploy do
119
128
  describe "#push_repo" do
120
129
  before do
121
130
  system_caller.stub(:execute)
131
+ formatter.stub(:display)
122
132
  end
123
133
 
124
134
  it 'displays message' do
125
- formatter.should_receive(:puts).with('Pushing master to Heroku')
135
+ formatter.should_receive(:display).with('Pushing master to Heroku')
126
136
  deployer.push_repo
127
137
  end
128
138
 
@@ -136,10 +146,11 @@ describe Paratrooper::Deploy do
136
146
  describe "#run_migrations" do
137
147
  before do
138
148
  system_caller.stub(:execute)
149
+ formatter.stub(:display)
139
150
  end
140
151
 
141
152
  it 'displays message' do
142
- formatter.should_receive(:puts).with('Running database migrations')
153
+ formatter.should_receive(:display).with('Running database migrations')
143
154
  deployer.run_migrations
144
155
  end
145
156
 
@@ -151,8 +162,12 @@ describe Paratrooper::Deploy do
151
162
  end
152
163
 
153
164
  describe "#app_restart" do
165
+ before do
166
+ formatter.stub(:display)
167
+ end
168
+
154
169
  it 'displays message' do
155
- formatter.should_receive(:puts).with('Restarting application')
170
+ formatter.should_receive(:display).with('Restarting application')
156
171
  deployer.app_restart
157
172
  end
158
173
 
@@ -165,11 +180,12 @@ describe Paratrooper::Deploy do
165
180
  describe "#warm_instance" do
166
181
  before do
167
182
  system_caller.stub(:execute)
183
+ formatter.stub(:display)
168
184
  end
169
185
 
170
186
  it 'displays message' do
171
187
  expected_notice = 'Accessing application_url to warm up your application'
172
- formatter.should_receive(:puts).with(expected_notice)
188
+ formatter.should_receive(:display).with(expected_notice)
173
189
  deployer.warm_instance(0)
174
190
  end
175
191
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paratrooper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: