aptinabox 0.0.1
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 +15 -0
- data/lib/aptinabox.rb +32 -0
- data/lib/aptinabox/config.rb +29 -0
- data/lib/aptinabox/version.rb +1 -0
- metadata +76 -0
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
YmY2MzI0MGU0NTg0YWEyMGE3MTBjNjg1YTIwNmY4ZWExOTZjZmYyNg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
NGNlMjRmNGJmOWU5OTM1M2JmNjVmNDUyYmJkYWFlNzZlY2RlNGM5OQ==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
ZmI0MGI5N2I0ZWY5ODRkMGQ5MzlhMGI0ZTFhMTU2NTFlOTBmNjZmMDE5NjFh
|
10
|
+
NTAzYmFmZTg5YTQ5YjMwYzU1YzIzOThhYjc3ZWI1YWFiMzIyZDdkZmMwYTc2
|
11
|
+
MjVhZWYwNWZkOTZlZTUxMWU3YzBmYjkwZjAyOGNhNTE5NDdmMDI=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
ZDhkMTI0ZjljN2Q1ZTA5YWE3NGU0ZTRlMjM3NjlmYmJmOTZmZWM4MTVmOWM0
|
14
|
+
OGJiNTlhM2Y0OGM5OTQzZGJlNDM2MDIwNTI5OWI1NmNlMWQ3ZmVkNmE4NGEy
|
15
|
+
YmJlNjAzNmJkMTNkYzA4OTNiMDJiNGE1MTAyMTY3YWYzNGE2YWQ=
|
data/lib/aptinabox.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'sinatra/base'
|
2
|
+
require 'aptinabox/version'
|
3
|
+
require 'aptinabox/config'
|
4
|
+
require 'json'
|
5
|
+
|
6
|
+
module Aptinabox
|
7
|
+
class Server < Sinatra::Base
|
8
|
+
|
9
|
+
before do
|
10
|
+
headers 'X-Powered-By' => "aptinabox #{AptinaboxVersion}"
|
11
|
+
end
|
12
|
+
|
13
|
+
get '/' do
|
14
|
+
return 'This will eventually list gems - But right now that is not important to us. Later!'
|
15
|
+
end
|
16
|
+
|
17
|
+
post '/upload' do
|
18
|
+
if params[:file].nil? or params[:label].nil?
|
19
|
+
return { :error => 'Expected parameters: file, label' }.to_json
|
20
|
+
end
|
21
|
+
|
22
|
+
# Pass `--ignore=extension` as we're working with a Tempfile object and it will eat the file extension.
|
23
|
+
`reprepro --ignore=extension -b #{Config.reprepro_path}/#{params[:label]} includedeb #{params[:label]} #{params[:file][:tempfile].path}`
|
24
|
+
if $?.exitstatus == 0
|
25
|
+
return { :file => params[:file][:filename] }.to_json
|
26
|
+
else
|
27
|
+
return { :error => $?.exitstatus }.to_json
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
|
2
|
+
module Aptinabox
|
3
|
+
class Config
|
4
|
+
|
5
|
+
def self.config_path
|
6
|
+
File.join(Gem.user_home, '.gem', 'aptinabox')
|
7
|
+
end
|
8
|
+
|
9
|
+
|
10
|
+
def self.reprepro_path
|
11
|
+
reprepro_path = Gem.configuration.load_file(config_path)['reprepro_path']
|
12
|
+
unless reprepro_path
|
13
|
+
raise ArgumentError, "reprepro_path not set in #{config_path}"
|
14
|
+
end
|
15
|
+
|
16
|
+
return reprepro_path
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.reprepro_label_list
|
20
|
+
reprepro_label_list = Gem.configuration.load_file(config_path)['reprepro_label_list']
|
21
|
+
unless reprepro_label_list
|
22
|
+
raise ArgumentError, "reprepro_label_list not set in #{config_path}"
|
23
|
+
end
|
24
|
+
|
25
|
+
return reprepro_label_list
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
AptinaboxVersion = '0.0.1'
|
metadata
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: aptinabox
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- TJ Biddle
|
8
|
+
- Inflection, LLC
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-10-04 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: sinatra
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ! '>='
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '0'
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ! '>='
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '0'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: puma
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ! '>='
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
35
|
+
type: :runtime
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ! '>='
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
42
|
+
description: While currently very minimally featured - I would like for this to eventually
|
43
|
+
serve as a proper Reprepro web frontend.
|
44
|
+
email:
|
45
|
+
- tjbiddle@inflection.com
|
46
|
+
executables: []
|
47
|
+
extensions: []
|
48
|
+
extra_rdoc_files: []
|
49
|
+
files:
|
50
|
+
- lib/aptinabox/config.rb
|
51
|
+
- lib/aptinabox/version.rb
|
52
|
+
- lib/aptinabox.rb
|
53
|
+
homepage: http://github.com/inflection/aptinabox
|
54
|
+
licenses: []
|
55
|
+
metadata: {}
|
56
|
+
post_install_message:
|
57
|
+
rdoc_options: []
|
58
|
+
require_paths:
|
59
|
+
- lib
|
60
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
61
|
+
requirements:
|
62
|
+
- - ! '>='
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '0'
|
65
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
requirements: []
|
71
|
+
rubyforge_project:
|
72
|
+
rubygems_version: 2.0.6
|
73
|
+
signing_key:
|
74
|
+
specification_version: 4
|
75
|
+
summary: Easily manage Reprepro APT repositories. Inspired by Geminabox.
|
76
|
+
test_files: []
|