geminabox-release 0.0.6 → 0.0.7
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 +4 -4
- data/README.md +11 -3
- data/lib/geminabox-release/version.rb +1 -1
- data/lib/geminabox-release.rb +17 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d07f964974d21c05047af2015c3013eb3f5fe36b
|
4
|
+
data.tar.gz: f082bca01644b271f66946a18ef5342a5994475e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
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.
|
data/lib/geminabox-release.rb
CHANGED
@@ -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 << "
|
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)
|