drone-builds 0.4.0 → 0.4.1

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 346420d5d7188991e9e7ee84757521342b3f5729
4
- data.tar.gz: 0b6c8857e43de451e66840e06f680a22e4eeff61
3
+ metadata.gz: 33a31b2db150a273934fa819396b448055148919
4
+ data.tar.gz: 2a00a1bc6cb3edebd752d31953baafa9acf95520
5
5
  SHA512:
6
- metadata.gz: 44367d4cf8024834c1cdbdb04dd97e7207e07f153326173f5f94d576f8f1e55bf956af2d5fc4ee1d13b6a6b573e971c303ecc190412976c5223b13e63e3ac5d6
7
- data.tar.gz: eff6aefb008f6751c3540eca1b6c59705aee46eed8a3361563fd0515c5307177dad5bd2f9bd55dffb46e8c4364b147bf0c1184030439d48f9924332290c99619
6
+ metadata.gz: '0438e050c256900f21d27381f30670161633957e6233c2ed6766fbc81117f867598764483890943be8224c7855a17507dbe94699f3257e4385816f429a096607'
7
+ data.tar.gz: adc824f5103de6e31e0f81a01d1fd77cd7c6f0c55ae8552f0ce0f620afdcfe940d4dbf8fa84e5abf8aca82359722b9d4cfbac0305c81a6eaba8ac24ffae817b0
data/README.md CHANGED
@@ -14,7 +14,7 @@ In your `~/.env` file, `env`, your `.bashrc`, etc.:
14
14
 
15
15
  ```
16
16
  DRONE_TOKEN=YoUrdRoneTOkEN
17
- DRONE_SERVER=your.ci.server.com
17
+ DRONE_SERVER=https://your.ci.server.com
18
18
  DRONE_OWNER=org-name
19
19
  DRONE_NAME=repo-name
20
20
  ```
@@ -33,7 +33,9 @@ class Drone::Builds::Cli < Thor
33
33
  def show(id = nil)
34
34
  ref = self.class.options_to_ref(options)
35
35
 
36
- id = self.class.client.list(limit: options[:last].abs, ref: ref)[0]&.[]('id') if id.to_i.to_s != id
36
+ if id.to_i.to_s != id
37
+ id = self.class.client.list(limit: options[:last]&.abs, ref: ref)[0]&.[]('id')
38
+ end
37
39
 
38
40
  abort "No build found for options: #{options}" unless id
39
41
 
@@ -54,13 +56,23 @@ class Drone::Builds::Cli < Thor
54
56
  end
55
57
 
56
58
  def self.client
59
+ server = HOME_ENV[:DRONE_SERVER]
60
+ domain = HOME_ENV[:DRONE_DOMAIN]
61
+
62
+ abort("You can't specify both DRONE_SERVER and DRONE_DOMAIN") if server && domain
63
+
64
+ if server
65
+ protocol, domain = server.split("://")
66
+ end
67
+
57
68
  @client ||=
58
69
  Drone::Builds.new(
70
+ protocol: protocol,
71
+ domain: domain,
59
72
  token: HOME_ENV[:DRONE_TOKEN],
60
- domain: HOME_ENV[:DRONE_DOMAIN],
61
73
  owner: HOME_ENV[:DRONE_OWNER],
62
74
  name: HOME_ENV[:DRONE_NAME],
63
- job_id: HOME_ENV[:DRONE_JOB_ID]
75
+ job_id: HOME_ENV[:DRONE_JOB_ID],
64
76
  )
65
77
  end
66
78
 
@@ -1,5 +1,5 @@
1
1
  module Drone
2
2
  class Builds
3
- VERSION = '0.4.0'.freeze
3
+ VERSION = '0.4.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: drone-builds
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dorian Marié