geminabox-rake 2.1.1 → 2.2.0

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: 124e8c0df37eee6a0fa8d647df7e494ac64e9450
4
- data.tar.gz: 7637fa0efc3b44abb1ede627d16ca5873c1e248e
3
+ metadata.gz: 725532cc3e6bf076dd19d985e521632796246517
4
+ data.tar.gz: e4349e5477b41f8b280f1c3a950d01da7277b120
5
5
  SHA512:
6
- metadata.gz: c8c2ccd7e983bb344405e404eee5aa754601fd7f497cb28274b2eb792ba616499de832041ef1841ef30e734cfb55b14b34b816d6e534b6b8c85ac84d27ba715b
7
- data.tar.gz: b2dcf92da16db03b825a881c338b20c3582906df6988ba7eab6b84be445b6247e8035492870c82cfaff5ba24bd3dc56c2e3b6bc09166e4123118a7759ccad679
6
+ metadata.gz: f4d8432d1c104ff2ed338bf1a159de3fc95303aca4a4c970f4f599faea580ef9e49c4b1e113693aa297290c5997ba6a87b2b8bafdbd1081e4cf84658c64d62b4
7
+ data.tar.gz: fbcbfece911c2a061404637f3c49baa99769d860f90bfed5e83a191cbc2cffbd82e02644ebb16f59818164ecbe6a201318fca304a3d96735a667423b91a5ae16
data/README.md CHANGED
@@ -34,6 +34,13 @@ require 'geminabox/rake'
34
34
  Geminabox::Rake.install dir: './client', host: 'http://user:password@gems.server.org/'
35
35
  ```
36
36
 
37
+ You could also specify multiple hosts by passing array to host key in options:
38
+
39
+ ```ruby
40
+ require 'geminabox/rake'
41
+ Geminabox::Rake.install dir: './client', host: ['http://user:password@gems.server.org/', 'http://backup.host']
42
+ ```
43
+
37
44
  By default all tasks will be scoped under the `geminabox` namespace to avoid accidental pushes to rubygems.org.
38
45
  You can define your own namespace:
39
46
 
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'geminabox-rake'
7
- spec.version = '2.1.1'
7
+ spec.version = '2.2.0'
8
8
  spec.authors = ['Jan Graichen']
9
9
  spec.email = %w(jg@altimos.de)
10
10
  spec.description = %q{Geminabox rake task for building and releasing gems.}
@@ -6,13 +6,16 @@ module Geminabox
6
6
 
7
7
  class << self
8
8
  def install_tasks(opts = {})
9
+ opts[:dir] ||= Dir.getwd
9
10
  new(opts[:dir], opts[:name], opts).install
10
11
  end
11
12
  alias_method :install, :install_tasks
12
13
  end
13
14
 
14
15
  def initialize(dir, name, opts = {})
15
- @host = URI.parse opts[:host]
16
+ @hosts = Array(opts[:host]).map do |host|
17
+ URI.parse(host)
18
+ end
16
19
  @namespace = opts[:namespace]
17
20
  super File.absolute_path(dir), name
18
21
  end
@@ -24,21 +27,32 @@ module Geminabox
24
27
  end
25
28
 
26
29
  protected
30
+
27
31
  def rubygem_push(path)
28
- sh("bundle exec gem inabox '#{path}' #{geminabox_host_param}")
29
- Bundler.ui.confirm "Pushed #{name} #{version} to #{geminabox_host_string}."
32
+ params = geminabox_host_params
33
+ strings = geminabox_host_strings
34
+
35
+ params.each_with_index do |param, i|
36
+ sh("bundle exec gem push '#{path}' #{param}")
37
+ Bundler.ui.confirm "Pushed #{name} #{version} to #{strings[i]}."
38
+ end
30
39
  end
31
40
 
32
- def geminabox_host_param
33
- @host ? "--host '#{@host}'" : nil
41
+ def geminabox_host_params
42
+ @hosts.map do |host|
43
+ host ? "--host '#{host}'" : nil
44
+ end
34
45
  end
35
46
 
36
- def geminabox_host_string
37
- return 'default host' unless @host
38
- @host.dup.tap do |uri|
39
- uri.user = uri.password = nil
40
- uri.user = '**' if uri.user
41
- uri.password = '**' if uri.password
47
+ def geminabox_host_strings
48
+ return 'default host' unless @hosts
49
+
50
+ @hosts.map do |host|
51
+ host.dup.tap do |uri|
52
+ uri.user = uri.password = nil
53
+ uri.user = '**' if uri.user
54
+ uri.password = '**' if uri.password
55
+ end
42
56
  end
43
57
  end
44
58
 
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geminabox-rake
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Graichen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-10 00:00:00.000000000 Z
11
+ date: 2014-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: geminabox-jgraichen
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: 0.12.2.4
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.12.2.4
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  description: Geminabox rake task for building and releasing gems.
@@ -59,7 +59,7 @@ executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
- - .gitignore
62
+ - ".gitignore"
63
63
  - Gemfile
64
64
  - LICENSE.txt
65
65
  - README.md
@@ -76,19 +76,18 @@ require_paths:
76
76
  - lib
77
77
  required_ruby_version: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - '>='
79
+ - - ">="
80
80
  - !ruby/object:Gem::Version
81
81
  version: '0'
82
82
  required_rubygems_version: !ruby/object:Gem::Requirement
83
83
  requirements:
84
- - - '>='
84
+ - - ">="
85
85
  - !ruby/object:Gem::Version
86
86
  version: '0'
87
87
  requirements: []
88
88
  rubyforge_project:
89
- rubygems_version: 2.1.11
89
+ rubygems_version: 2.2.2
90
90
  signing_key:
91
91
  specification_version: 4
92
92
  summary: Geminabox rake task for building and releasing gems.
93
93
  test_files: []
94
- has_rdoc: