elasticity 4.0.2 → 4.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTFkNWI4Njc2OTcwNjE2ZTk1MzFhZTc2MjIwOWRkOWUzMzA0MDMxYw==
4
+ ZjhlNWY2ZjAwNzYxNWNkNDMzM2M1YzE3ODJmNDQ3MDA2OTQzNDA2ZA==
5
5
  data.tar.gz: !binary |-
6
- MWRjZDNkNDAxMmJkNmIzZTM3MWJjMTEwNGNjYzVmMDdmZjA0ZmZkNQ==
6
+ ZjQxMzc2ZmZlNTNhMmUwMzMwODE1MTJjOTljZjk5Mjk4ZTBkYTliYw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NjQ4YWVmOTMzNmMyYjkxZDM5OGJkZmUyNWJhNWU5YzBlM2RlOTdmNWFhOThi
10
- OTJlYThhYTMzNjFhODI3YWJjZjJlNTRlYTYyNjAzYjU1ZDhmZGFhMDViNDg0
11
- ZmI0ZmNhZDI3OTUzMTNmOWQyYjZmYzVkM2MxNzQ4MTQ4MDA0ODI=
9
+ YmE4YmYyMDE2YTEyZjM0MzZmMDBlYzQyNDI0MmFhNWJlNjhlY2Y1ZjM4NTlh
10
+ ZGM3YmQ0ODdlNDRlY2JmYjU3YTVlN2QzZDIzZDI0MTAyM2RmMmM2ODNmNWQx
11
+ YzY2NWVlNTczY2M4YThlMDZmZmY3NDFkNzAxODFhODBhYzYyNDc=
12
12
  data.tar.gz: !binary |-
13
- Y2I0YmYzZGM4MTZmMWU5NjM0Y2ZiODViZmVkZDZjOTdhOTY1ODg4MWU4NzM0
14
- YjM0MWRlMWMwMmZiY2FjYjQ5M2Q2NTM2MjBhZmVjMjA1ZmY2MGQ0NzhjYzI2
15
- ZWNkMDUzNzMzNzFhZDEwODcyNjFiM2Y4MDg1NDQwNmE1Yzc4OTA=
13
+ ZGVhYThjOTk1NmJkNThmODJjYmRiOTk1MWFkYmUyMjgzZjllOTc1NGNjZDU3
14
+ ZGRiN2FlMjVlNTM2MWU0ZWJiYmJlNTlkMzMzMzJhOWFlNzk5YWUwYWFlY2Jl
15
+ YTY5MDlmNThjZDc5Yjg1NmI5ZGNmNTE1ZTEwOTgyN2ViZDdiN2Y=
data/HISTORY.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 4.0.3 - November 12, 2014
2
+
3
+ - Thanks to @ilyakava, pull request [#78](https://github.com/rslifka/elasticity/pull/78) fixes a bug in the "wait for completion" feature.
4
+
1
5
  ## 4.0.2 - September 20, 2014
2
6
 
3
7
  - Thanks to @jshafton, now with support for Ganglia!
@@ -168,7 +168,7 @@ module Elasticity
168
168
 
169
169
  def retry_check
170
170
  jf_status = status
171
- return status.state == 'RUNNING' || status.state == 'STARTING', jf_status
171
+ return status.active?, jf_status
172
172
  end
173
173
 
174
174
  def emr
@@ -25,6 +25,11 @@ module Elasticity
25
25
  @installed_steps = []
26
26
  end
27
27
 
28
+ # http://docs.aws.amazon.com/ElasticMapReduce/latest/DeveloperGuide/ProcessingCycle.html
29
+ def active?
30
+ %w{RUNNING STARTING BOOTSTRAPPING WAITING SHUTTING_DOWN}.include? state
31
+ end
32
+
28
33
  # Create a jobflow from an AWS <member> (Nokogiri::XML::Element):
29
34
  # /DescribeJobFlowsResponse/DescribeJobFlowsResult/JobFlows/member
30
35
  def self.from_member_element(xml_element)
@@ -1,3 +1,3 @@
1
1
  module Elasticity
2
- VERSION = '4.0.2'
2
+ VERSION = '4.0.3'
3
3
  end
@@ -606,8 +606,8 @@ describe Elasticity::JobFlow do
606
606
 
607
607
  describe '#retry_check' do
608
608
 
609
- context 'when the jobflow is RUNNING' do
610
- let(:jobflow_status) { double(:state => 'RUNNING') }
609
+ context 'when the jobflow is active' do
610
+ let(:jobflow_status) { double(:active? => true) }
611
611
  before do
612
612
  subject.stub(:status).and_return(jobflow_status)
613
613
  end
@@ -616,25 +616,16 @@ describe Elasticity::JobFlow do
616
616
  end
617
617
  end
618
618
 
619
- context 'when the jobflow is STARTING' do
620
- let(:jobflow_status) { double(:state => 'STARTING') }
619
+ context 'when the jobflow is not active' do
620
+ let(:jobflow_status) { double(:active? => false) }
621
621
  before do
622
622
  subject.stub(:status).and_return(jobflow_status)
623
623
  end
624
624
  it 'returns true and the result of #status' do
625
- subject.send(:retry_check).should == [true, jobflow_status]
626
- end
627
- end
628
-
629
- context 'when the jobflow is != RUNNING or STARTING' do
630
- let(:jobflow_status) { double(:state => '_') }
631
- before do
632
- subject.stub(:status).and_return(jobflow_status)
633
- end
634
- it 'returns false and the result of #status' do
635
625
  subject.send(:retry_check).should == [false, jobflow_status]
636
626
  end
637
627
  end
628
+
638
629
  end
639
630
 
640
631
  describe '.from_jobflow_id' do
@@ -236,4 +236,30 @@ describe Elasticity::JobFlowStatus do
236
236
  end
237
237
  end
238
238
 
239
+ describe '#active?' do
240
+
241
+ context 'when the jobflow status is terminal' do
242
+ %w{COMPLETED TERMINATED FAILED _}.each do |status|
243
+ context "when the jobflow is #{status}" do
244
+ it 'is not active' do
245
+ single_jobflow_status.state = status
246
+ single_jobflow_status.active?.should be_false
247
+ end
248
+ end
249
+ end
250
+ end
251
+
252
+ context 'when the jobflow status is not terminal' do
253
+ %w{RUNNING STARTING BOOTSTRAPPING WAITING SHUTTING_DOWN}.each do |status|
254
+ context "when the jobflow is #{status}" do
255
+ it 'is active' do
256
+ single_jobflow_status.state = status
257
+ single_jobflow_status.active?.should be_true
258
+ end
259
+ end
260
+ end
261
+ end
262
+
263
+ end
264
+
239
265
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elasticity
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.2
4
+ version: 4.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Slifka
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-21 00:00:00.000000000 Z
11
+ date: 2014-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client