gemfury 0.5.0 → 0.6.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZjAxMjhkYjcwYmFmZWM0YjRiOTRmMmNlNWRlNzUxYzNhMTQ4N2M4Nw==
4
+ YWY0OTI2NjBhOGQzMWQzNzYzYWJjYjZiOTJmYTkwZjQ2MmZkMTE5YQ==
5
5
  data.tar.gz: !binary |-
6
- ODYwNjY4ZjA3MmM0Zjg2Mjk5MDU4YzEwNDU3ZGMzZjZmOTEyZTdlMQ==
6
+ NGM1NTg1ZTc0YzhmNWY0MzM5OWMwYjg1ZjlkM2ZiYTA2MGRlNTlkNg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NzI3NWZlYTJmNWIxOWRiZWE2NjgzMDU2NjliNjNhNDczYTI1YmVhM2FiMDE0
10
- NTc5ZWU2MTMyMWUzZjIzYzE3YzNkNDczNjFjZTE3NTY2YzhmZGE3ZGVhMzFm
11
- MDVmMzExZThmMmRkZWMxNzJkZmI2YTU3OTUwZDBkOWFhMGIyNTk=
9
+ NjcxYmZmOTM2ZDY3ZDdlNWQ1OWI4MTg1YzBlMzhmMzY1MjBmOTAyODVkMThh
10
+ ZTNkOWE5YTg3MTIxZmI5NmViZTljY2NlMWRjM2IxOTUxMmQzYjdhMGE2MzU2
11
+ NTYzZDYzZTk0NDRlYTBiMDJjM2Q5NjdmYjlmYzY2NzQyZGNhYWI=
12
12
  data.tar.gz: !binary |-
13
- NjI0MTI3NGUxZDhiM2FiODA1ZjExMDFkYTZkM2JiNTRmYjA4M2VkMjQxNTVh
14
- NmUwYjVhNDg0NGUxYzAwNTU0YzRhZWM0YTg4ZWM2YjhmZDE3M2YzNjBlYWJk
15
- NWI1YzAyMmRiYzYwOTQ2Y2ZjNTU5OTkzOGYzMzVlNjhhMGZkNWI=
13
+ NmU2ZjA3NTFiZDdhYmI2Njg4ODZiZDA3NWIwYThjNjg4MmM0YTI2YjQ4OTJk
14
+ YzYxYzNmZDJhYmJiNWI0ZWNhZjNhNjUwNGNlYWVkOWYyYTg2OTRmYWNkYmI0
15
+ ZDljMWY1ZDQzYjEyZjVkYjE3MjMwYzNhZDBkYTFjZjQwMGIwNmE=
data/README.md CHANGED
@@ -7,7 +7,7 @@ Gemfury CLI
7
7
 
8
8
  This is the Gemfury CLI used to manage your Gemfury packages from the command line. If you're
9
9
  familiar with the service and want to jump straight into command line action, please proceed to
10
- the [CLI documentation](http://devcenter.gemfury.com/articles/gemfury-cli.html).
10
+ the [CLI documentation](https://gemfury.com/help/gemfury-cli).
11
11
 
12
12
  Gemfury is your personal cloud for your private and custom RubyGems, Python packages, and NPM
13
13
  modules. Once you upload your packages and enable Gemfury as a source, you can securely deploy
@@ -15,20 +15,20 @@ any package to any host. It's simple, reliable, and hassle-free.
15
15
 
16
16
 
17
17
  ### Introduction to Gemfury
18
- * [Gemfury homepage](http://www.gemfury.com)
19
- * [Getting started with Gemfury](http://devcenter.gemfury.com/articles/getting-started.html)
18
+ * [Gemfury homepage](https://gemfury.com/)
19
+ * [Getting started with Gemfury](https://gemfury.com/help/getting-started)
20
20
 
21
21
  ### Using Gemfury CLI
22
- * [CLI documentation](http://devcenter.gemfury.com/articles/gemfury-cli.html)
23
- * [Uploading private packages](http://devcenter.gemfury.com/articles/gemfury-cli.html#uploading_packages)
24
- * [Manage collaborators](http://devcenter.gemfury.com/articles/gemfury-cli.html#collaboration)
22
+ * [CLI documentation](https://gemfury.com/help/gemfury-cli)
23
+ * [Uploading private packages](https://gemfury.com/help/gemfury-cli#uploading-packages)
24
+ * [Manage collaborators](https://gemfury.com/help/gemfury-cli#collaboration)
25
25
 
26
26
  ### Putting Gemfury to work
27
- * [Install private RubyGems](http://devcenter.gemfury.com/articles/install-gems.html)
28
- * [Install private Python packages](http://devcenter.gemfury.com/articles/pypi-server.html)
29
- * [Install private NPM modules](http://devcenter.gemfury.com/articles/npm-registry.html)
30
- * [Private RubyGems on Heroku](http://devcenter.gemfury.com/articles/private-gems-on-heroku.html)
31
-
27
+ * [Install private RubyGems](https://gemfury.com/help/install-gems)
28
+ * [Install private NPM modules](https://gemfury.com/help/npm-registry)
29
+ * [Install private Python packages](https://gemfury.com/help/pypi-server)
30
+ * [Install private Composer packages](https://gemfury.com/help/php-composer-server)
31
+ * [Private RubyGems on Heroku](https://gemfury.com/help/private-gems-on-heroku)
32
32
 
33
33
  ## Contribution and Improvements
34
34
 
@@ -0,0 +1,32 @@
1
+ # This is a Faraday adapter that bypasses Faraday's response body
2
+ # processing and streams body to STDOUT for text requests
3
+
4
+ class Faraday::Adapter
5
+ class FuryHttp < NetHttp
6
+ def perform_request(http, env)
7
+ accept = env.request_headers['Accept']
8
+ return super if accept !~ /text\z/
9
+
10
+ # Stream response body to STDOUT on success
11
+ http.request(create_request(env)) do |resp|
12
+ unless resp.is_a?(Net::HTTPSuccess)
13
+ resp.body # Cache error body
14
+ else
15
+ resp.read_body do |chunk|
16
+ $stdout.print(chunk)
17
+ $stdout.flush
18
+ end
19
+
20
+ # Prevent #body from calling #read_body again
21
+ klass = (class << resp; self; end)
22
+ klass.send(:define_method, :body) { nil }
23
+ end
24
+
25
+ # Return response to NetHttp adapter
26
+ return resp
27
+ end
28
+ end
29
+ end
30
+
31
+ register_middleware(:fury_http => FuryHttp)
32
+ end
@@ -7,6 +7,7 @@ require 'uri'
7
7
  require 'netrc'
8
8
  require 'multi_json'
9
9
  require 'faraday'
10
+ require 'faraday/adapter/fury_http'
10
11
  require 'faraday/request/multipart_with_file'
11
12
 
12
13
  require 'gemfury/version'
@@ -104,6 +104,13 @@ module Gemfury
104
104
  checked_response_body(response)
105
105
  end
106
106
 
107
+ # Update repository name and settings
108
+ def git_update(repo, options = {})
109
+ ensure_ready!(:authorization)
110
+ response = connection.patch(git_repo_path(repo), options)
111
+ checked_response_body(response)
112
+ end
113
+
107
114
  # Reset repository to initial state
108
115
  def git_reset(repo, options = {})
109
116
  ensure_ready!(:authorization)
@@ -111,6 +118,14 @@ module Gemfury
111
118
  checked_response_body(response)
112
119
  end
113
120
 
121
+ # Rebuild Git repository package
122
+ def git_rebuild(repo, options = {})
123
+ ensure_ready!(:authorization)
124
+ url = "#{git_repo_path(repo)}/builds"
125
+ api = connection(:api_format => :text)
126
+ checked_response_body(api.post(url, options))
127
+ end
128
+
114
129
  private
115
130
  def escape(str)
116
131
  CGI.escape(str)
@@ -125,7 +140,8 @@ module Gemfury
125
140
  # The 'Accept' HTTP header for API versioning
126
141
  http_accept = begin
127
142
  v = options.delete(:api_version) || self.api_version
128
- "application/vnd.fury.v#{v.to_i}+json"
143
+ f = options.delete(:api_format) || :json
144
+ "application/vnd.fury.v#{v.to_i}+#{f}"
129
145
  end
130
146
 
131
147
  # Faraday client options
@@ -153,7 +169,7 @@ module Gemfury
153
169
  builder.use Faraday::Request::UrlEncoded
154
170
  builder.use ParseJson
155
171
  builder.use Handle503
156
- builder.adapter :net_http
172
+ builder.adapter :fury_http
157
173
  end
158
174
  end
159
175
 
@@ -15,7 +15,8 @@ module Gemfury
15
15
  end
16
16
 
17
17
  def on_complete(response)
18
- response.body = parse(response.body)
18
+ ok = response.request_headers['Accept'] =~ /json\z/
19
+ response.body = parse(response.body) if ok
19
20
  end
20
21
  end
21
22
  end
@@ -143,8 +143,10 @@ class Gemfury::Command::App < Thor
143
143
  end
144
144
 
145
145
  ### GIT REPOSITORY MANAGEMENT ###
146
- map "git:list" => 'git_list'
147
- map "git:reset" => 'git_reset'
146
+ map "git:list" => 'git_list'
147
+ map "git:reset" => 'git_reset'
148
+ map "git:rename" => 'git_rename'
149
+ map "git:rebuild" => 'git_rebuild'
148
150
 
149
151
  desc "git:list", "List Git repositories"
150
152
  def git_list
@@ -156,6 +158,14 @@ class Gemfury::Command::App < Thor
156
158
  end
157
159
  end
158
160
 
161
+ desc "git:rename", "Rename a Git repository"
162
+ def git_rename(repo, new_name)
163
+ with_checks_and_rescues do
164
+ client.git_update(repo, :repo => { :name => new_name })
165
+ shell.say "Renamed #{repo} repository to #{new_name}\n"
166
+ end
167
+ end
168
+
159
169
  desc "git:reset", "Remove a Git repository"
160
170
  def git_reset(repo)
161
171
  with_checks_and_rescues do
@@ -164,6 +174,14 @@ class Gemfury::Command::App < Thor
164
174
  end
165
175
  end
166
176
 
177
+ desc "git:rebuild", "Rebuild a Git repository"
178
+ def git_rebuild(repo)
179
+ with_checks_and_rescues do
180
+ shell.say "\n*** Rebuilding #{repo} repository ***\n\n"
181
+ shell.say client.git_rebuild(repo)
182
+ end
183
+ end
184
+
167
185
  private
168
186
  def client
169
187
  opts = {}
@@ -1,3 +1,3 @@
1
1
  module Gemfury
2
- VERSION = '0.5.0'
2
+ VERSION = '0.6.0.rc1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gemfury
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Rykov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-06 00:00:00.000000000 Z
11
+ date: 2015-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: highline
@@ -105,6 +105,7 @@ files:
105
105
  - README.md
106
106
  - bin/fury
107
107
  - bin/gemfury
108
+ - lib/faraday/adapter/fury_http.rb
108
109
  - lib/faraday/request/multipart_with_file.rb
109
110
  - lib/gemfury.rb
110
111
  - lib/gemfury/client.rb
@@ -141,9 +142,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
141
142
  version: '0'
142
143
  required_rubygems_version: !ruby/object:Gem::Requirement
143
144
  requirements:
144
- - - ! '>='
145
+ - - ! '>'
145
146
  - !ruby/object:Gem::Version
146
- version: '0'
147
+ version: 1.3.1
147
148
  requirements: []
148
149
  rubyforge_project:
149
150
  rubygems_version: 2.4.6