mina-circle 1.3.4 → 1.3.5

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: 4c83207ed1ce8a379444f8d1c088dc8c210edbb2
4
- data.tar.gz: e880c8f1e288fa78bcc0864dd4d989b19bdd0d08
3
+ metadata.gz: fe0e8ab7891689de6f7a84fcc3e68bedd34345c8
4
+ data.tar.gz: cdde5e5c0d94844f5bda4f9ff28f93f1e9671922
5
5
  SHA512:
6
- metadata.gz: a89ff4649e70457caade5b656bb4de22fcf1d9ccde119948a9b0bd52fcfd4213865162f23d2986792ac4df81f800de485bd01aed1806c24cc4bf321663b6d3ab
7
- data.tar.gz: 0deccfe3b43f9ea9b2c416dcd90d1b27560ba78631ce6b22b5f8fd9d859557ba404fe30493d3d912fa4a093c89285ee1246c622bd78c7f845960912a494d43fe
6
+ metadata.gz: 1985240691fd8810b349b42493209294897556beec5daa3760b1bf664666af3c949d865a38135d01137939206ab38efd1d2adb1709bcdfb01cad6c3e7f1fc582
7
+ data.tar.gz: 44bc80029760072caeaa53bf8fa1b1063a6aed9ad5b8662f5bdd2c4c301e7485a645de1d302fc4c6cbefb5b30094a3ca4e78e03aacc2baabeadb05e6dbe6fc37
@@ -13,15 +13,27 @@ class CircleCI::Client
13
13
 
14
14
  def get(path, params = {})
15
15
  uri = URI("#{BASE_URI}/#{path}")
16
+ params['circle-token'] = api_token
16
17
  uri.query = URI.encode_www_form(params) unless params.empty?
17
18
  puts "Sending URL: #{uri}"
18
19
  request = Net::HTTP::Get.new uri
19
20
  request['Accept'] = 'application/json'
20
- request['Authorization'] = "Basic #{Base64.encode64(api_token).chomp}"
21
21
  response = Net::HTTP.start uri.host, uri.port, use_ssl: true do |http|
22
22
  http.request request
23
23
  end
24
- JSON.parse response.body
24
+ return_object = JSON.parse response.body
25
+
26
+ JSON.pretty_generate return_object
27
+
28
+ if return_object.instance_of? Object
29
+ if return_object['message']
30
+ puts return_object['message']
31
+ puts "Check your branch and/or build on CircleCI..."
32
+ exit
33
+ end
34
+ end
35
+
36
+ return_object
25
37
  end
26
38
 
27
39
  def api_token
@@ -5,6 +5,7 @@ class CircleCI::Project
5
5
  @organization = organization
6
6
  @name = name
7
7
  @vcs_type = vcs_type
8
+ @branch = branch
8
9
  end
9
10
 
10
11
  def artifacts
@@ -23,7 +24,7 @@ class CircleCI::Project
23
24
  private
24
25
 
25
26
  def fetch_artifacts
26
- artifact_hashes = CircleCI::Client.instance.get "#{api_path}/latest/artifacts", filter: 'successful', branch: branch
27
+ artifact_hashes = CircleCI::Client.instance.get "#{api_path}/latest/artifacts", filter: 'successful', branch: branch ? branch : 'master'
27
28
  artifact_hashes.collect { |artifact_hash|
28
29
  CircleCI::Artifact.new artifact_hash
29
30
  }
@@ -1,3 +1,3 @@
1
1
  module MinaCircle
2
- VERSION = '1.3.4'
2
+ VERSION = '1.3.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mina-circle
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.4
4
+ version: 1.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Simpson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-09-01 00:00:00.000000000 Z
12
+ date: 2017-09-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mina