geminabox-release 0.0.3 → 0.0.4

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
  SHA1:
3
- metadata.gz: e1a4c70a944df5c8303adbf2cc0c4c9276f16835
4
- data.tar.gz: b605184a1717f2d68b709a88a3c0d1864032d599
3
+ metadata.gz: a3efb7ecdce531ed8b2b7c3a53671e552e1fd268
4
+ data.tar.gz: 5677bbb9dba8e618669f5256e602a6e1c724a930
5
5
  SHA512:
6
- metadata.gz: f815e42a7f4cc865a0aefe621b0b89887d8e8cb69380b74cbc40d23ad3112b113cbae3969f619291e2b571c1790a8a9b2c1ad236da8d7e1f7ce2387c8145396c
7
- data.tar.gz: c1f0cceef3f9b6adbd5257dbf8e38e2858ed99914f5704b369959b1a2e63471d8f4679304c5c399a961f1914c57bd64829ea6d7deeda3f752623f35382f97116
6
+ metadata.gz: 57c29b86dd5d936f7fa5a2ade9dc4ee2267b72ad8bef43c798a0b8c975633e3d87157b908ba2da834dd0f09d50d647ec8f030666df7e552bcb1e0a798d125bae
7
+ data.tar.gz: 8424ff895b0be18e70b143b5ed66beab2f52d91213b6d20bb80ae536f3c46cacb210a8e08288003576b284e46f13101dcf7d02b0360e84380d1c4603e456b3cd
data/README.md CHANGED
@@ -1,7 +1,8 @@
1
1
  geminabox-release
2
2
  =================
3
3
 
4
- This gem is a dependency free option to modify your bundlers gem release task to work with your geminabox server.
4
+ This gem is a dependency free option to add a rake inabox:release task that mirrors bundler's rake release task for your
5
+ geminabox server.
5
6
 
6
7
  ## How to use
7
8
 
@@ -16,13 +17,20 @@ require 'bundler/gem_tasks'
16
17
 
17
18
  ```
18
19
 
19
- Then your bundler rake release will be overwritten with rake release:inabox to your specified host.
20
+ Then you will get an rake inabox:release task.
20
21
 
21
22
  The gem (theoretically) supports basic auth like geminabox in the host address. e.g. http://username:password@localhost:4000
22
23
  It's untested as we didn't need it. Feel free to try it.
23
24
 
24
25
  The order is important as requiring bunlder/gem_tasks creates the rake tasks and this gem does not modify them after that.
25
26
 
27
+ ## Safety
28
+
29
+ To ensure you are not accidently pushing your gem to rubygems there are two distinct safety measures.
30
+
31
+ 1) The rake task has another name. Do not use rake release if you want to push to your geminabox server!
32
+
33
+ 2) The gem is pushed via the HTTP POST file request geminabox expects and not via the gem push interface.
26
34
 
27
35
  # LICENSE
28
36
 
@@ -11,28 +11,29 @@ module GeminaboxRelease
11
11
  @host = host
12
12
 
13
13
  Bundler::GemHelper.class_eval do
14
- def install
15
- built_gem_path = nil
16
-
17
- desc "Build #{name}-#{version}.gem into the pkg directory."
18
- task 'build' do
19
- built_gem_path = build_gem
20
- end
21
14
 
22
- desc "Build and install #{name}-#{version}.gem into system gems."
23
- task 'install' => 'build' do
24
- install_gem(built_gem_path)
25
- end
15
+ alias_method :bundler_install, :install
26
16
 
17
+ def install
27
18
  desc "Create tag #{version_tag} and build and push #{name}-#{version}.gem to #{GeminaboxRelease.host}"
28
- task 'release:inabox' => 'build' do
29
- release_gem(built_gem_path)
19
+ task 'inabox:release' => 'build' do
20
+ release_inabox(built_gem_path)
30
21
  end
22
+ bundler_install # call bunlders original install method
23
+ end
31
24
 
32
- Bundler::GemHelper.instance = self
25
+ # same functionality as release_gem but calls inabox_push
26
+ def release_inabox(built_gem_path=nil)
27
+ guard_clean
28
+ built_gem_path ||= build_gem
29
+ tag_version { git_push } unless already_tagged?
30
+ inabox_push(built_gem_path) if gem_push?
33
31
  end
34
32
 
35
- def rubygem_push(path)
33
+ protected
34
+
35
+ # pushes to geminabox
36
+ def inabox_push(path)
36
37
  uri = URI.parse(GeminaboxRelease.host)
37
38
  username = uri.user
38
39
  password = uri.password
@@ -1,4 +1,4 @@
1
1
  module GeminaboxRelease
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geminabox-release
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dennis-Florian Herr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-14 00:00:00.000000000 Z
11
+ date: 2014-09-15 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Dependency free rake release task for geminabox
14
14
  email: