geminabox-release 0.0.6 → 0.0.7

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: b08a918596cf45774de6897e5432b9c755593410
4
- data.tar.gz: ab964319990db85232f5ae511e5434b8553cbc3e
3
+ metadata.gz: d07f964974d21c05047af2015c3013eb3f5fe36b
4
+ data.tar.gz: f082bca01644b271f66946a18ef5342a5994475e
5
5
  SHA512:
6
- metadata.gz: f1c5109235dff61da9e65114ff0e0751daefe19c274827ae71d9391fd553aad6123924bece031f80bbd5094102474ad1cca77a063dcf7f0ba564fff3605b7fbf
7
- data.tar.gz: 16802fea4c2f24f31d20a151df8667d9b46c1fa42a3f362540c41290767d5291e70b212c0f2ca89cd78c0eebebb9e4724f75e4b4f61e43b0607fa72af07eb13b
6
+ metadata.gz: 6a2503033505d4e87d0207f9618ec08c34a3b17150af5460f30990ab2df4cdcd0842aeb88094f884999f5879ed1c8f185c768bbfcea77abd96bf2a497a8f7382
7
+ data.tar.gz: b57e1be61346bd9bfbb4a07ee377046e3094ef490b79e89526fdcbcea14004627c740ba009f30115f8be435879e7605f6c3fbfa0ed9dec5c25fc6fbc3a608ec3
data/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  geminabox-release
2
2
  =================
3
3
 
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.
4
+ This gem is a dependency free option to add a rake inabox:release task to bundler gem_tasks for releasing a new gem to
5
+ your geminabox server.
6
6
 
7
7
  ## How to use
8
8
 
9
- Simply load this gem and and patch with your geminabox URL before requiring bundler/gem_tasks in your Rakefile.
9
+ Simply load this gem and patch with your geminabox URL before requiring bundler/gem_tasks in your Rakefile.
10
10
 
11
11
  E.g.
12
12
 
@@ -31,6 +31,14 @@ Then you will get an rake inabox:release task.
31
31
  The gem (theoretically) supports basic auth like geminabox in the host address. e.g. http://username:password@localhost:4000
32
32
  It's untested as we didn't need it. Feel free to try it.
33
33
 
34
+ The gem additionally provides only build & push tasks:
35
+
36
+ ```
37
+ $ rake inabox:push # just builds gem and pushes to geminabox server
38
+ $ rake inabox:forcepush # builds gem and pushes to geminabox server overwriting existing same version
39
+
40
+ ```
41
+
34
42
  ### Order
35
43
 
36
44
  The order is important as requiring bunlder/gem_tasks creates the rake tasks and this gem does not modify them after that.
@@ -1,4 +1,4 @@
1
1
  module GeminaboxRelease
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
4
4
 
@@ -34,6 +34,16 @@ module GeminaboxRelease
34
34
  release_inabox
35
35
  end
36
36
 
37
+ desc "Build & push #{name}-#{version}.gem to #{GeminaboxRelease.host}"
38
+ task 'inabox:push' do
39
+ push_inabox_gem
40
+ end
41
+
42
+ desc "Build & push #{name}-#{version}.gem overwriting same version to #{GeminaboxRelease.host}"
43
+ task 'inabox:forcepush' do
44
+ push_inabox_gem(true)
45
+ end
46
+
37
47
  bundler_install # call bunlders original install method
38
48
  end
39
49
 
@@ -45,10 +55,15 @@ module GeminaboxRelease
45
55
  inabox_push(built_gem_path) if gem_push?
46
56
  end
47
57
 
58
+ def push_inabox_gem(force = false)
59
+ built_gem_path = build_gem
60
+ inabox_push(built_gem_path, force)
61
+ end
62
+
48
63
  protected
49
64
 
50
65
  # pushes to geminabox
51
- def inabox_push(path)
66
+ def inabox_push(path, force = false)
52
67
  uri = URI.parse(GeminaboxRelease.host)
53
68
  username = uri.user
54
69
  password = uri.password
@@ -72,7 +87,7 @@ module GeminaboxRelease
72
87
  post_body << "\r\n--#{boundary}\r\n"
73
88
  post_body << "Content-Disposition: form-data; name=\"overwrite\"\r\n"
74
89
  post_body << "\r\n"
75
- post_body << "false"
90
+ post_body << "#{force}"
76
91
  post_body << "\r\n--#{boundary}--\r\n\r\n"
77
92
 
78
93
  http = Net::HTTP.new(uri.host, uri.port)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geminabox-release
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dennis-Florian Herr