package_cloud 0.3.11 → 0.3.13

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
  SHA256:
3
- metadata.gz: 6b5523eccf8d9b23c5a3b222818a680bd585560c2e898bee15a88a7c35b969f0
4
- data.tar.gz: ab27f540c2bd98e2a312ad0b8ed34ff036a78b3ef440355d0b65a0812fb2b6a9
3
+ metadata.gz: e6d363087603473afe3c1ac11834d158341b1352f22b4659c20dabb7c1122c8c
4
+ data.tar.gz: 0d214d7769a2437e9416daf4ed76f067ef78e83dae74f77ba5232e5a419cc227
5
5
  SHA512:
6
- metadata.gz: 7b7f861f0cebb2a24d4ed81c1119656198638b7b574f2d72fdc07efb68564b42b5b4a850b8980483fcca18cac817ea7c9302803ba439dd755f36e5dfe622269b
7
- data.tar.gz: 9034cef17e319ab4e4d962e55e8488d6e3a31df096f38f371bc40c71adbe02f1476401eac44f812e2ebf761be1c41efa95a3c98b20f068d02de782dfa2a61d0c
6
+ metadata.gz: 79079fca04fb398f2b0a81bdec7c60b403c3cf6328c16f5dd6e2bae5fb7e7c206a29fb2330b76d1c2a3ce0e2629519563302f7906f2c25c6676010394ce71806
7
+ data.tar.gz: a3387acaa98bbb884dbc37c3bf3345265be42d2904a95beb7558c2dc436b37dcaab714605f9baa30aec008ac7214264b765ea84f4b6285c99378825aa909937f
@@ -274,7 +274,7 @@ module PackageCloud
274
274
  file_paths = []
275
275
  files.each do |f|
276
276
  filepath = File.join(dir, f["filename"])
277
- if !File.exists?(filepath)
277
+ if !File.exist?(filepath)
278
278
  print "Unable to find file name: #{f["filename"]} for source package: #{filepath}\n".color(:red)
279
279
  abort("Aborting...".color(:red))
280
280
  end
@@ -62,14 +62,24 @@ module PackageCloud
62
62
 
63
63
  def login_from_console
64
64
  e = ask("Email:")
65
+ puts "If you signed up via social login (Github, Bitbucket etc.), and/or do not have a password, input: NIL"
65
66
  p = ask("Password:") { |q| q.echo = false }
66
67
 
67
- begin
68
- PackageCloud::Auth.get_token(base_url(e, p))
69
- rescue RestClient::Unauthorized => e
70
- puts "Sorry, but we couldn't find you. Give it another try."
71
- login_from_console
68
+ if p == "NIL"
69
+ puts "Copy your API Token from https://packagecloud.io/api_token and input below."
70
+ puts "(Note: An incorrectly inputted token will require deletion of the incorrectly generated $HOME/.packagecloud config file before rerunning the last command.)"
71
+ api_token = ask("Your API Token:") { |q| q.echo = false }
72
+ else
73
+ begin
74
+ api_token = PackageCloud::Auth.get_token(base_url(e, p))
75
+ rescue RestClient::Unauthorized => e
76
+ puts "Sorry, but we couldn't find you. Give it another try."
77
+ puts "(Or skip the login? Go to https://packagecloud.io/api_token to see instructions on downloading your $HOME/.packagecloud config file.)"
78
+ login_from_console
79
+ end
72
80
  end
81
+
82
+ return api_token
73
83
  end
74
84
 
75
85
  def write
@@ -86,7 +96,7 @@ module PackageCloud
86
96
  ## config where the url is used verbatim as the key, instead of "url",
87
97
  ## this attempts to fix the config file
88
98
  def fix_config_file!
89
- if File.exists?(@filename) && File.writable?(@filename)
99
+ if File.exist?(@filename) && File.writable?(@filename)
90
100
  attrs = JSON.parse(File.read(@filename))
91
101
  if !attrs.has_key?("url")
92
102
  ## overwrite the config file if "url" key not found
@@ -1,7 +1,7 @@
1
1
  module PackageCloud
2
2
  MAJOR_VERSION = "0"
3
3
  MINOR_VERSION = "3"
4
- PATCH_VERSION = "11"
4
+ PATCH_VERSION = "13"
5
5
 
6
6
  VERSION = [MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION].join(".")
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: package_cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.11
4
+ version: 0.3.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Damato
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-11 00:00:00.000000000 Z
11
+ date: 2023-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -178,7 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
178
178
  - !ruby/object:Gem::Version
179
179
  version: '0'
180
180
  requirements: []
181
- rubygems_version: 3.2.3
181
+ rubygems_version: 3.4.10
182
182
  signing_key:
183
183
  specification_version: 4
184
184
  summary: The https://packagecloud.io CLI for uploading Node.js, Debian, RPM, RubyGem,