aptly-api 0.9.0 → 0.9.1

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
  SHA256:
3
- metadata.gz: 2f05bd8ea6f8823c9ecbdd75ece3fd75fea137e1c7feaf3ee9be7bacbc746fa6
4
- data.tar.gz: 80e7d9229aa43d4d39a2d563a3570623a9beae956fc9add43ea53cb6dd985a02
3
+ metadata.gz: 380c5f11e70678a2475099bcd03210ec4181ad123d6094b7bdecc1f636e6b9af
4
+ data.tar.gz: 810b109dcdae36be88317a858267b3d16b5f80e1fa1b4cff82e09f412e2e1a59
5
5
  SHA512:
6
- metadata.gz: ea9a99200d5c2a5c76c60013b2a90c695674bc31c9d63ea1cb5fd13912edcf5aa0696b79a9fe84289b93ddb46a170859108ba5e8b8c7fc1190ef99bb612b1126
7
- data.tar.gz: 5f9731ea0d96ea4dbd0723598500f9e6ce6707ef30fd675e3cc1aad65542d7e8747fdb9b0b78361c35a636b52ecc4079351857595177f80c19911f1a68a4f32f
6
+ metadata.gz: 2883165cc34396cbc478fd096f0d1ee4a18b26f799aab81d6fd48fb0d3be79404f00d3b349e4545028549e46ebe21f824d182965469d6307d8a2447008a6f41e
7
+ data.tar.gz: 036bd6f29fb8cd1eb2f6bfae2a610168d18a42bc573213bee6a073eeda71de284425d32e7cc1e1729eceefdf160f54cd3a91723f5419a9a4e433e9eeca626629
@@ -1,5 +1,13 @@
1
1
  # Change Log
2
2
 
3
+ ## [0.9.1]
4
+ ### Fixed
5
+ - Hint at needing `noRemove: 1` as param when loop adding files (default
6
+ behavior is to remove added files) in the `Files.tmp_upload` documentation.
7
+ - `Connection` properly passes query parameters for post-ish requests now.
8
+ - `Repository.add_file` no longer mangles it's query parameters as they are
9
+ inconsistently cased on the API level.
10
+
3
11
  ## [0.9.0]
4
12
  ### Added
5
13
  - `Files.tmp_upload` is a new convenience wrapper around `#upload` and
@@ -126,12 +126,14 @@ module Aptly
126
126
 
127
127
  def run_postish(action, path, kwords)
128
128
  body = kwords.delete(:body)
129
+ params = kwords.delete(:query)
129
130
  headers = kwords.delete(:headers)
130
131
 
131
132
  body, headers = mangle_post(body, headers, kwords)
132
133
 
133
134
  @connection.send(action, path, body, headers) do |request|
134
135
  setup_request(action, request)
136
+ request.params.update(params) if params
135
137
  end
136
138
  end
137
139
 
@@ -42,7 +42,9 @@ module Aptly
42
42
  # @return return value of block
43
43
  #
44
44
  # @example Can be used to push into multiple repositories with one upload
45
- # Files.tmp_upload(files) { |d| repos.each { |r| r.add_files(d) } }
45
+ # Files.tmp_upload(files) do |d|
46
+ # repos.each { |r| r.add_files(d, noRemove: 1) }
47
+ # end
46
48
  #
47
49
  # @since 0.9.0
48
50
  def tmp_upload(files, connection = Connection.new, **kwords)
@@ -41,8 +41,11 @@ module Aptly
41
41
  # @return [Hash] report data as specified in the API.
42
42
  # FIXME: this should be called file
43
43
  def add_file(path, **kwords)
44
+ # Don't mangle query, the file API is inconsistently using camelCase
45
+ # rather than CamelCase.
44
46
  response = connection.send(:post, "/repos/#{self.Name}/file/#{path}",
45
- query: kwords)
47
+ query: kwords,
48
+ query_mangle: false)
46
49
  hash = JSON.parse(response.body)
47
50
  error = Errors::RepositoryFileError.from_hash(hash)
48
51
  raise error if error
@@ -1,4 +1,4 @@
1
1
  # Aptly API
2
2
  module Aptly
3
- VERSION = '0.9.0'.freeze
3
+ VERSION = '0.9.1'.freeze
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aptly-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Harald Sitter