marathon-api 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -0
  3. data/bin/marathon +1 -1
  4. data/lib/marathon.rb +4 -6
  5. data/lib/marathon/app.rb +27 -21
  6. data/lib/marathon/connection.rb +11 -11
  7. data/lib/marathon/constraint.rb +1 -1
  8. data/lib/marathon/container.rb +2 -2
  9. data/lib/marathon/container_docker.rb +2 -2
  10. data/lib/marathon/container_docker_port_mapping.rb +2 -2
  11. data/lib/marathon/container_volume.rb +1 -1
  12. data/lib/marathon/deployment.rb +4 -1
  13. data/lib/marathon/deployment_action.rb +1 -0
  14. data/lib/marathon/deployment_info.rb +3 -2
  15. data/lib/marathon/deployment_step.rb +1 -1
  16. data/lib/marathon/error.rb +24 -16
  17. data/lib/marathon/event_subscriptions.rb +1 -1
  18. data/lib/marathon/group.rb +2 -1
  19. data/lib/marathon/health_check.rb +7 -7
  20. data/lib/marathon/leader.rb +1 -1
  21. data/lib/marathon/queue.rb +2 -1
  22. data/lib/marathon/task.rb +7 -3
  23. data/lib/marathon/util.rb +7 -7
  24. data/lib/marathon/version.rb +1 -1
  25. data/spec/marathon/app_spec.rb +58 -54
  26. data/spec/marathon/base_spec.rb +10 -10
  27. data/spec/marathon/container_docker_port_mapping_spec.rb +7 -7
  28. data/spec/marathon/container_docker_spec.rb +13 -13
  29. data/spec/marathon/container_spec.rb +9 -9
  30. data/spec/marathon/container_volume_spec.rb +4 -4
  31. data/spec/marathon/deployment_action_spec.rb +1 -1
  32. data/spec/marathon/deployment_info_spec.rb +2 -2
  33. data/spec/marathon/deployment_spec.rb +19 -19
  34. data/spec/marathon/deployment_step_spec.rb +4 -4
  35. data/spec/marathon/error_spec.rb +7 -7
  36. data/spec/marathon/group_spec.rb +47 -47
  37. data/spec/marathon/marathon_spec.rb +1 -1
  38. data/spec/marathon/queue_spec.rb +9 -9
  39. data/spec/marathon/task_spec.rb +12 -12
  40. data/spec/marathon/util_spec.rb +17 -17
  41. metadata +2 -2
@@ -4,12 +4,12 @@ describe Marathon::Task do
4
4
 
5
5
  describe '#to_s' do
6
6
  subject { described_class.new({
7
- 'id' => 'task-id-foo',
8
- 'appId' => '/app/foo',
9
- 'host' => 'foo-host',
10
- 'ports' => [31000, 31001],
11
- 'version' => 'foo-version'
12
- }, double(Marathon::MarathonInstance)) }
7
+ 'id' => 'task-id-foo',
8
+ 'appId' => '/app/foo',
9
+ 'host' => 'foo-host',
10
+ 'ports' => [31000, 31001],
11
+ 'version' => 'foo-version'
12
+ }, double(Marathon::MarathonInstance)) }
13
13
 
14
14
  let(:expected_string) do
15
15
  "Marathon::Task { :id => task-id-foo :appId => /app/foo :host => foo-host }"
@@ -31,10 +31,10 @@ describe Marathon::Task do
31
31
 
32
32
  describe '#to_json' do
33
33
  subject { described_class.new({
34
- 'id' => 'task-id-foo',
35
- 'appId' => '/app/foo',
36
- 'host' => 'foo-host',
37
- }, double(Marathon::MarathonInstance)) }
34
+ 'id' => 'task-id-foo',
35
+ 'appId' => '/app/foo',
36
+ 'host' => 'foo-host',
37
+ }, double(Marathon::MarathonInstance)) }
38
38
 
39
39
  let(:expected_string) do
40
40
  '{"id":"task-id-foo","appId":"/app/foo","host":"foo-host"}'
@@ -45,8 +45,8 @@ describe Marathon::Task do
45
45
 
46
46
  describe '#delete!' do
47
47
  let(:task) { described_class.new({
48
- 'id' => 'task_123', 'appId' => '/app/foo'
49
- }, double(Marathon::MarathonInstance)) }
48
+ 'id' => 'task_123', 'appId' => '/app/foo'
49
+ }, double(Marathon::MarathonInstance)) }
50
50
 
51
51
  it 'deletes the task' do
52
52
  expect(described_class).to receive(:delete).with('task_123', false)
@@ -46,20 +46,20 @@ describe Marathon::Util do
46
46
 
47
47
  it 'keywordizes the hash' do
48
48
  hash = {
49
- 'foo' => 'bar',
50
- 'f00' => {'w00h00' => 'yeah'},
51
- 'bang' => [{'tricky' => 'one'}],
52
- 'env' => {'foo' => 'bar'},
53
- 'null' => nil
49
+ 'foo' => 'bar',
50
+ 'f00' => {'w00h00' => 'yeah'},
51
+ 'bang' => [{'tricky' => 'one'}],
52
+ 'env' => {'foo' => 'bar'},
53
+ 'null' => nil
54
54
  }
55
55
 
56
56
  expect(subject.keywordize_hash!(hash)).to eq({
57
- :foo => 'bar',
58
- :f00 => {:w00h00 => 'yeah'},
59
- :bang => [{:tricky => 'one'}],
60
- :env => {'foo' => 'bar'},
61
- :null => nil
62
- })
57
+ :foo => 'bar',
58
+ :f00 => {:w00h00 => 'yeah'},
59
+ :bang => [{:tricky => 'one'}],
60
+ :env => {'foo' => 'bar'},
61
+ :null => nil
62
+ })
63
63
  # make sure, it changes the hash w/o creating a new one
64
64
  expect(hash[:foo]).to eq('bar')
65
65
  end
@@ -70,15 +70,15 @@ describe Marathon::Util do
70
70
 
71
71
  it 'removes keys from hash' do
72
72
  hash = {
73
- :foo => 'bar',
74
- :deleteme => {'w00h00' => 'yeah'},
75
- :blah => [{:deleteme => :foo}, 1]
73
+ :foo => 'bar',
74
+ :deleteme => {'w00h00' => 'yeah'},
75
+ :blah => [{:deleteme => :foo}, 1]
76
76
  }
77
77
 
78
78
  expect(subject.remove_keys(hash, [:deleteme])).to eq({
79
- :foo => 'bar',
80
- :blah => [{}, 1]
81
- })
79
+ :foo => 'bar',
80
+ :blah => [{}, 1]
81
+ })
82
82
  # make sure, it does not changes the original hash
83
83
  expect(hash.size).to eq(3)
84
84
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marathon-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Bechstein
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-20 00:00:00.000000000 Z
11
+ date: 2016-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json