octopolo 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OGFhODg0NDc0NTM3ZWIyMTNiODVkYzc4YWQ2ZjRhYjNmZmE0N2ZkZg==
4
+ MDVhMDU0NWZiZDc1NmNkYTNjOWM3Y2I2MTM3ZmEzMjQwOGQ4YTUwZQ==
5
5
  data.tar.gz: !binary |-
6
- NDY2M2I2YmFiMGE0Y2FmM2U0MThjMjBmZWNmMDIzYzUwZTA3YWE2ZQ==
6
+ YmEzOGViMTQ2ZDA0YjljZTFjZDM0YzEwOTNhM2UwYjBiMDdhYWE2Zg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YzQzMzFjODY3MTI1YWQ5NGJhMzA0ODA4YTEyNWJhMGY2NjRmMjdhYWRiYzU0
10
- YmM3ZTQ1YTliN2E4NmIxZTJmNjRhNmQxODdiNzkzYjc1Y2NlOWRhNDdmYzg1
11
- NmFhYjE0NDQ0M2E1MjgxZmM5NTA3YTE0MDgzYzg4Mzg1NmZhZWQ=
9
+ Nzc2OTI0NWEwYTIzYTBiOTRjZDk1MjI2MWUxNjY4OGJiNDI5NTg1MzFiMTI0
10
+ MjJiNDI1YWIxNDRkNDJmNjgwMzI2ZTczNWZiNDczYjZlM2JhNjE3YTZjZmZm
11
+ OTJjYzg2N2JkMzRmNWFmZDcwZTA2ZTRjOGJlMzQ5Y2MyOTVjZmY=
12
12
  data.tar.gz: !binary |-
13
- NmVkMTUzMDZkNGVjN2Y1YjI3NTFkOTQwZTc2NGVhODJkODhjOTJhMTE2MmJj
14
- MzVlMzcyODI1YTU4ODRkOWJhYmI0YjY5NDUyZTA2Njk1ZTFlYzdiOWVkNTZm
15
- YzMxZjE3MWRhMWYzNTg4NTAyYWUzOGQ5YjZiZjUyNzJhNzU1NGY=
13
+ OTcxMWIwNDFkOWMwZDBkNTk4YjVlOWY2MmE1MmVjNTNmOWRmMWUwYzEyYjI3
14
+ ODYxYmMyYjM5ZDdmMjkzOGZmOWJhNTYxZmZmMDVmNGIzNjYyODAyZDg2ODUy
15
+ OTdmMzMyOGQ5NzdjNTM4YWFhMWU5NGVlNzY5YjUxZjgyODc0YTc=
data/.gitignore CHANGED
@@ -15,6 +15,7 @@ test/tmp
15
15
  test/version_tmp
16
16
  tmp
17
17
  log/
18
+ .idea
18
19
 
19
20
  # YARD artifacts
20
21
  .yardoc
@@ -1,3 +1,4 @@
1
+ #### v0.3.3
1
2
  #### v0.3.2
2
3
  * Add new autocomplete_commands toggle; fixes #34
3
4
 
@@ -8,6 +8,11 @@ A set of Github workflow scripts.
8
8
 
9
9
  ### GitHub Octopolo
10
10
 
11
+ #### Octopolo Installation
12
+
13
+ `$ rvm use system && brew gem uninstall sportngin-octopolo-workflow && brew gem install sportngin-octopolo-workflow
14
+ ` or part of the brew gem quickstart [script](https://sportngin.atlassian.net/wiki/display/DEV/Brew+Gem)
15
+
11
16
  #### GitHub Setup
12
17
 
13
18
  Interactively set up your local machine for GitHub octopolo, including
@@ -26,6 +26,7 @@ module Octopolo
26
26
  # and then perform it
27
27
  if Open3.respond_to?(:capture3)
28
28
  output, error, status = Open3.capture3(command)
29
+ raise "exit_status=#{status.exitstatus}; stderr=#{error}" unless status.success?
29
30
  else
30
31
  # Only necessary as long as we use 1.8.7, which doesn't have Open3.capture3
31
32
  output = `#{command}`
@@ -1,3 +1,3 @@
1
1
  module Octopolo
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
@@ -9,10 +9,12 @@ module Octopolo
9
9
  let(:result) { "result" }
10
10
  let(:error) { "error message" }
11
11
  let(:exception_message) { "Error with something" }
12
+ let(:status_success) { double("status", "success?" => true, :exitstatus => 0) }
13
+ let(:status_error) { double("status", "success?" => nil, :exitstatus => 1) }
12
14
 
13
15
  it "passes the given command to the shell" do
14
16
  subject.should_receive(:say).with(command)
15
- Open3.should_receive(:capture3).with(command).and_return([result, nil])
17
+ Open3.should_receive(:capture3).with(command).and_return([result, nil, status_success])
16
18
  subject.should_receive(:say).with(result)
17
19
  subject.perform(command).should == result
18
20
  end
@@ -26,13 +28,20 @@ module Octopolo
26
28
  subject.perform(command).should == result
27
29
  end
28
30
 
29
- it "should handle errors gracefully" do
31
+ it "should handle exception gracefully" do
30
32
  subject.should_receive(:say).with(command)
31
33
  Open3.should_receive(:capture3).with(command).and_raise(exception_message)
32
34
  subject.should_receive(:say).with("Unable to perform '#{command}': #{exception_message}")
33
35
  subject.perform(command).should be_nil
34
36
  end
35
37
 
38
+ it "should handle errors gracefully" do
39
+ subject.should_receive(:say).with(command)
40
+ Open3.should_receive(:capture3).with(command).and_return([result, "kaboom", status_error])
41
+ subject.should_receive(:say).with("Unable to perform '#{command}': exit_status=1; stderr=kaboom")
42
+ subject.perform(command).should be_nil
43
+ end
44
+
36
45
  it "should not speak the command if told not to" do
37
46
  subject.should_receive(:say).with(command).never
38
47
  subject.perform(command, false)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octopolo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Byrne
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-03-06 00:00:00.000000000 Z
12
+ date: 2015-03-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake