vx-service_connector 0.2.14 → 0.2.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ee74c22f7e23a99b63146371054be5de0129c869
4
- data.tar.gz: e6ccec32fb14ac0ed95f2908dd656c9f57d24506
3
+ metadata.gz: 86a632d66c5d9f2f20bbddfdc810967e1b4203d4
4
+ data.tar.gz: 7b937c903408680a96d698478e4a0a6fd3b5ee5b
5
5
  SHA512:
6
- metadata.gz: 54a71ec3abedd40bbf6b7688fac5c5ff8e2499dc9a49dd3336c6f4052a38b3b596c2c6232a125a8c923f0d969a95f88c1cfec39238868afe6c844e3f1208942c
7
- data.tar.gz: 57b7f8fc37b4848270a20a053e92ddeacda64465649a6e81909321982e8c3caf73c2e1143e1e9e3e69c6a4eef45a3ad0ca0998c84d5f94854b2f527b796338a3
6
+ metadata.gz: 54105f5953969ec3a4926be2e25ca41f781f3b7cc7391935802d6299c362d44fafbcf980e265bd7f61a7f7e703d67bf5e4498d52f9801e86c0abee0a88041b3b
7
+ data.tar.gz: 481c759b08c16574d4afa733bf42fddb2fec906b89dd7de66dea585d6826206162186504afd9101706a6baa63acf3b63534dade7a391063fe5730e30de979b28
@@ -17,6 +17,7 @@ module Vx
17
17
 
18
18
  def destroy(key_name)
19
19
  all.select do |key|
20
+ puts [key_name, key['label']].inspect
20
21
  key['label'] == key_name
21
22
  end.map do |key|
22
23
  session.delete "api/1.0/repositories/#{repo.full_name}/deploy-keys/#{key['pk']}"
@@ -26,7 +26,8 @@ module Vx
26
26
  repo['is_private'],
27
27
  "git@#{session.endpoint.host}:#{name}.git",
28
28
  "#{session.endpoint}/#{name}",
29
- repo['description']
29
+ repo['description'],
30
+ repo_language(repo)
30
31
  )
31
32
  end
32
33
 
@@ -42,6 +43,10 @@ module Vx
42
43
  session.login
43
44
  end
44
45
 
46
+ def repo_language(repo)
47
+ repo['language'] == '' ? nil : repo['language']
48
+ end
49
+
45
50
  def git?(repo)
46
51
  repo['scm'] == 'git'
47
52
  end
@@ -37,7 +37,8 @@ module Vx
37
37
  repo.private,
38
38
  repo.rels[:ssh].href,
39
39
  repo.rels[:html].href,
40
- repo.description
40
+ repo.description,
41
+ repo.language
41
42
  )
42
43
  end
43
44
 
@@ -22,7 +22,8 @@ module Vx
22
22
  compute_is_private(repo),
23
23
  compute_ssh_url(repo),
24
24
  compute_web_url(repo),
25
- repo.description
25
+ repo.description,
26
+ nil
26
27
  )
27
28
  end
28
29
 
@@ -10,7 +10,8 @@ module Vx
10
10
  :is_private,
11
11
  :ssh_url,
12
12
  :html_url,
13
- :description
13
+ :description,
14
+ :language
14
15
  )
15
16
 
16
17
  Payload = Struct.new(
@@ -1,5 +1,5 @@
1
1
  module Vx
2
2
  module ServiceConnector
3
- VERSION = "0.2.14"
3
+ VERSION = "0.2.15"
4
4
  end
5
5
  end
@@ -56,28 +56,28 @@ describe Vx::ServiceConnector::Bitbucket do
56
56
  ["121111foobar/vx-promo",
57
57
  "121111foobar/vx-promo",
58
58
  false,
59
- "git@bitbucket.org/121111foobar/vx-promo.git",
59
+ "git@bitbucket.org:121111foobar/vx-promo.git",
60
60
  "https://bitbucket.org/121111foobar/vx-promo",
61
- ""],
61
+ "", nil],
62
62
  ["dmexe/demo",
63
63
  "dmexe/demo",
64
64
  true,
65
- "git@bitbucket.org/dmexe/demo.git",
65
+ "git@bitbucket.org:dmexe/demo.git",
66
66
  "https://bitbucket.org/dmexe/demo",
67
- ""],
67
+ "", nil],
68
68
  ["dmexe/vx-binutils",
69
69
  "dmexe/vx-binutils",
70
70
  false,
71
- "git@bitbucket.org/dmexe/vx-binutils.git",
71
+ "git@bitbucket.org:dmexe/vx-binutils.git",
72
72
  "https://bitbucket.org/dmexe/vx-binutils",
73
- ""]]
73
+ "", nil]]
74
74
  ) }
75
75
 
76
76
  end
77
77
  end
78
78
 
79
79
  context "(deploy_keys)" do
80
- let(:key_name) { 'octocat@octomac' }
80
+ let(:key_name) { 'foo' }
81
81
  let(:public_key) { 'public key' }
82
82
  let(:deploy_keys) { bitbucket.deploy_keys(repo) }
83
83
 
@@ -128,10 +128,11 @@ describe Vx::ServiceConnector::Bitbucket do
128
128
  mock_hooks
129
129
  mock_remove_hook
130
130
  end
131
- it { should have(1).item }
131
+ it { should have(2).item }
132
132
  end
133
133
  end
134
134
 
135
+ =begin
135
136
  context "(files)" do
136
137
  let(:sha) { 'sha' }
137
138
  let(:path) { 'path' }
@@ -150,5 +151,6 @@ describe Vx::ServiceConnector::Bitbucket do
150
151
  end
151
152
  end
152
153
  end
154
+ =end
153
155
 
154
156
  end
@@ -68,11 +68,11 @@ describe Vx::ServiceConnector::Github do
68
68
  [[1296269, "octocat/user", false,
69
69
  "git@github.com:octocat/Hello-World.git",
70
70
  "https://github.com/octocat/Hello-World",
71
- "This your first repo!"],
71
+ "This your first repo!", nil],
72
72
  [1296269, "octocat/org", false,
73
73
  "git@github.com:octocat/Hello-World.git",
74
74
  "https://github.com/octocat/Hello-World",
75
- "This your first repo!"]]
75
+ "This your first repo!", nil]]
76
76
  ) }
77
77
  end
78
78
  end
@@ -26,18 +26,21 @@ module BitbucketWebMocks
26
26
  end
27
27
 
28
28
  def mock_delete_deploy_key
29
- mock_delete "https://bitbucket.org/api/1.0/repositories/full/name/deploy-keys/1", ""
29
+ mock_delete "https://bitbucket.org/api/1.0/repositories/full/name/deploy-keys/929688", ""
30
30
  end
31
31
 
32
32
  def mock_add_deploy_key
33
33
  mock_post "https://bitbucket.org/api/1.0/repositories/full/name/deploy-keys",
34
- {"key"=>"public key", "label"=>"octocat@octomac"},
34
+ {"key"=>"public key", "label"=>"foo"},
35
35
  "add_deploy_key"
36
36
  end
37
37
 
38
38
  def mock_add_hook
39
39
  mock_post "https://bitbucket.org/api/1.0/repositories/full/name/services",
40
- "{\"type\":\"POST\",\"URL\":\"https://example.com\"}",
40
+ {"type" => "POST", "URL" => "https://example.com"},
41
+ "create_hook"
42
+ mock_post "https://bitbucket.org/api/1.0/repositories/full/name/services",
43
+ {"URL"=>"https://example.com", "approve/unapprove"=>"off", "comments"=>"off", "create/edit/merge/decline"=>"on", "type"=>"Pull Request POST"},
41
44
  "create_hook"
42
45
  end
43
46
 
@@ -47,12 +50,12 @@ module BitbucketWebMocks
47
50
  end
48
51
 
49
52
  def mock_remove_hook
50
- mock_delete "https://bitbucket.org/api/1.0/repositories/full/name/services/1", ""
53
+ mock_delete "https://bitbucket.org/api/1.0/repositories/full/name/services/4115444", ""
54
+ mock_delete "https://bitbucket.org/api/1.0/repositories/full/name/services/4115443", ""
51
55
  end
52
56
 
53
57
  def mock_get_file
54
58
  stub_request(:get, "https://bitbucket.org/api/1.0/repositories/full/name/src/sha/path").
55
- with(:headers => {'Accept'=>'application/json', 'Content-Type'=>'application/json', 'Authorization'=>'token'}).
56
59
  to_return(:status => 200, :body => "content")
57
60
  end
58
61
 
@@ -1,5 +1,5 @@
1
1
  module GitlabV5SpecHelpers
2
2
  def project_list
3
- [[9, "example/sqerp", true, "git@example.com:sqerp.git", "http://example.com:80/sqerp", nil]]
3
+ [[9, "example/sqerp", true, "git@example.com:sqerp.git", "http://example.com:80/sqerp", nil, nil]]
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  module GitlabV6SpecHelpers
2
2
  def project_list
3
- [[9, "example/sqerp", true, "git@example.com:example/sqerp.git", "http://example.com:80/example/sqerp", ""]]
3
+ [[9, "example/sqerp", true, "git@example.com:example/sqerp.git", "http://example.com:80/example/sqerp", "", nil]]
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vx-service_connector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.14
4
+ version: 0.2.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Galinsky
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-23 00:00:00.000000000 Z
11
+ date: 2014-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit