aptly_cli 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ef34e056e43c7817d53a347119585f16ddb40a95
4
+ data.tar.gz: 3fcc389eccc123f7163a5481cdda147e003215af
5
+ SHA512:
6
+ metadata.gz: 895907189e7935ffc5ede0d505060d30c494ab6f11147c29a9d3a10cadf72abdba78171b1ca8fbe535a9c3feb1d2b1de0747bd4004e328f85f88b646a6329394
7
+ data.tar.gz: cc049d5bad82880e0918330b831478dad63cdd4a31977eaf86a5a4442d81ae62a0c760077cb2e2d77b262f4dffb51fede85de6ad42f2589c638b363f8508e12e
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.travis.yml ADDED
@@ -0,0 +1,3 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.0
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in aptly_cli.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Zane
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # AptlyCli
2
+
3
+ A command line interace to execute Aptly commands againts a remote Aptly API server. Aptly-cli will allow you to interact with the repo, snapshot, publish, packages, graph and version API endpoints of your Aptly server.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'aptly_cli'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install aptly_cli
20
+
21
+ ## Usage
22
+
23
+ TODO
24
+
25
+ ## Development
26
+
27
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
28
+
29
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
30
+
31
+ ## Contributing
32
+
33
+ 1. Fork it ( https://github.com/[my-github-username]/aptly_cli/fork )
34
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
35
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
36
+ 4. Push to the branch (`git push origin my-new-feature`)
37
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ require "rake/testtask"
4
+
5
+ Rake::TestTask.new do |t|
6
+ t.libs << "lib"
7
+ t.libs << "test"
8
+ t.test_files = FileList['test/test_*.rb']
9
+ t.verbose = true
10
+ end
11
+
12
+ task default: :test
data/aptly_cli.gemspec ADDED
@@ -0,0 +1,33 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'aptly_cli/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "aptly_cli"
8
+ spec.version = AptlyCli::VERSION
9
+ spec.authors = ["Zane"]
10
+ spec.email = ["zane.williamson@gmail.com"]
11
+
12
+ if spec.respond_to?(:metadata)
13
+ spec.metadata['allowed_push_host'] = "https://rubygems.org"
14
+ end
15
+
16
+ spec.summary = %q{Command line client to interact with Aptly package management system}
17
+ spec.description = %q{Aptly API client}
18
+ spec.homepage = "https://github.com/sepulworld/aptly_cli"
19
+ spec.license = "MIT"
20
+
21
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
22
+ spec.bindir = "exe"
23
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
+ spec.require_paths = ["lib"]
25
+
26
+ spec.add_development_dependency "bundler", "~> 1.8"
27
+ spec.add_development_dependency "rake", "~> 10.0"
28
+ spec.add_development_dependency "webmock", "~> 1.20"
29
+ spec.add_development_dependency "vcr", "~> 2.9"
30
+
31
+ spec.add_dependency "httmultiparty", "~> 0.3.16"
32
+ spec.add_dependency "commander", "~> 4.3"
33
+ end
data/bin/aptly-cli ADDED
@@ -0,0 +1,72 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubygems'
4
+ require 'commander/import'
5
+
6
+ program :version, '0.0.1'
7
+ program :description, 'Aptly repository API client'
8
+
9
+ command :repo do |c|
10
+ c.syntax = 'aptly-cli repo [options]'
11
+ c.summary = ''
12
+ c.description = ''
13
+ c.example 'description', 'command example'
14
+ c.option '--some-switch', 'Some switch that does something'
15
+ c.action do |args, options|
16
+ # Do something or c.when_called Aptly-cli::Commands::Repo
17
+ end
18
+ end
19
+
20
+ command :snapshot do |c|
21
+ c.syntax = 'aptly-cli snapshot [options]'
22
+ c.summary = ''
23
+ c.description = ''
24
+ c.example 'description', 'command example'
25
+ c.option '--some-switch', 'Some switch that does something'
26
+ c.action do |args, options|
27
+ # Do something or c.when_called Aptly-cli::Commands::Snapshot
28
+ end
29
+ end
30
+
31
+ command :publish do |c|
32
+ c.syntax = 'aptly-cli publish [options]'
33
+ c.summary = ''
34
+ c.description = ''
35
+ c.example 'description', 'command example'
36
+ c.option '--some-switch', 'Some switch that does something'
37
+ c.action do |args, options|
38
+ # Do something or c.when_called Aptly-cli::Commands::Publish
39
+ end
40
+ end
41
+
42
+ command :package do |c|
43
+ c.syntax = 'aptly-cli package [options]'
44
+ c.summary = ''
45
+ c.description = ''
46
+ c.example 'description', 'command example'
47
+ c.option '--some-switch', 'Some switch that does something'
48
+ c.action do |args, options|
49
+ # Do something or c.when_called Aptly-cli::Commands::Package
50
+ end
51
+ end
52
+
53
+ command :graph do |c|
54
+ c.syntax = 'aptly-cli graph [options]'
55
+ c.summary = ''
56
+ c.description = ''
57
+ c.example 'description', 'command example'
58
+ c.option '--some-switch', 'Some switch that does something'
59
+ c.action do |args, options|
60
+ # Do something or c.when_called Aptly-cli::Commands::Graph
61
+ end
62
+ end
63
+
64
+ command :version do |c|
65
+ c.syntax = 'aptly-cli version'
66
+ c.description = 'Display aptly server version'
67
+ c.example 'description', 'aptly-cli version'
68
+ c.action do |args, options|
69
+ # Do something or c.when_called Aptly-cli::Commands::Version
70
+ end
71
+ end
72
+
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "aptly_cli"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,3 @@
1
+ module AptlyCli
2
+ VERSION = "0.0.1"
3
+ end
data/lib/aptly_cli.rb ADDED
@@ -0,0 +1,9 @@
1
+ require "aptly_cli/version"
2
+ require "httmultiparty"
3
+
4
+ module AptlyCli
5
+
6
+ Dir[File.dirname(__FILE__) + '/*.rb'].each do |file|
7
+ require file
8
+ end
9
+ end
data/lib/aptly_file.rb ADDED
@@ -0,0 +1,17 @@
1
+ require "aptly_cli/version"
2
+ require "aptly_load"
3
+ require "httmultiparty"
4
+
5
+ module AptlyCli
6
+ class AptlyFile
7
+
8
+ # http://beta.aptly.info/doc/api/files/
9
+
10
+ include HTTMultiParty
11
+
12
+ config = AptlyCli::AptlyLoad.new.configure_with("/etc/aptly-cli.conf")
13
+
14
+ base_uri "http://#{config[:server]}:#{config[:port]}"
15
+
16
+ end
17
+ end
data/lib/aptly_load.rb ADDED
@@ -0,0 +1,45 @@
1
+ require 'aptly_cli/version'
2
+ require 'yaml'
3
+ require 'logger'
4
+
5
+ module AptlyCli
6
+ class AptlyLoad
7
+
8
+ def initialize
9
+ @log = Logger.new(STDOUT)
10
+ @log.level = Logger::WARN
11
+
12
+ # Configuration defaults
13
+ @config = {
14
+ :server => "127.0.0.1",
15
+ :port => 8082
16
+ }
17
+
18
+ @valid_config_keys = @config.keys
19
+ end
20
+
21
+ # Configure through hash
22
+ def configure(opts = {})
23
+ opts.each {|k,v| config[k.to_sym] = v if @valid_config_keys.include? k.to_sym}
24
+ end
25
+
26
+ # Configure through yaml file
27
+ def configure_with(path_to_yaml_file)
28
+ begin
29
+ config = YAML::load(IO.read(path_to_yaml_file))
30
+ rescue Errno::ENOENT
31
+ @log.warn("YAML configuration file couldn't be found. Using defaults.")
32
+ return @config
33
+ rescue Psych::SyntaxError
34
+ @log.warn("YAML configuration file contains invalid syntax. Using defaults.")
35
+ return @config
36
+ end
37
+
38
+ configure(config)
39
+ end
40
+
41
+ def config
42
+ @config
43
+ end
44
+ end
45
+ end
metadata ADDED
@@ -0,0 +1,144 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: aptly_cli
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Zane
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-03-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.8'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.8'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: webmock
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.20'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.20'
55
+ - !ruby/object:Gem::Dependency
56
+ name: vcr
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '2.9'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '2.9'
69
+ - !ruby/object:Gem::Dependency
70
+ name: httmultiparty
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 0.3.16
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 0.3.16
83
+ - !ruby/object:Gem::Dependency
84
+ name: commander
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '4.3'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '4.3'
97
+ description: Aptly API client
98
+ email:
99
+ - zane.williamson@gmail.com
100
+ executables: []
101
+ extensions: []
102
+ extra_rdoc_files: []
103
+ files:
104
+ - ".gitignore"
105
+ - ".travis.yml"
106
+ - CODE_OF_CONDUCT.md
107
+ - Gemfile
108
+ - LICENSE.txt
109
+ - README.md
110
+ - Rakefile
111
+ - aptly_cli.gemspec
112
+ - bin/aptly-cli
113
+ - bin/console
114
+ - bin/setup
115
+ - lib/aptly_cli.rb
116
+ - lib/aptly_cli/version.rb
117
+ - lib/aptly_file.rb
118
+ - lib/aptly_load.rb
119
+ homepage: https://github.com/sepulworld/aptly_cli
120
+ licenses:
121
+ - MIT
122
+ metadata:
123
+ allowed_push_host: https://rubygems.org
124
+ post_install_message:
125
+ rdoc_options: []
126
+ require_paths:
127
+ - lib
128
+ required_ruby_version: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ version: '0'
133
+ required_rubygems_version: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - ">="
136
+ - !ruby/object:Gem::Version
137
+ version: '0'
138
+ requirements: []
139
+ rubyforge_project:
140
+ rubygems_version: 2.4.5
141
+ signing_key:
142
+ specification_version: 4
143
+ summary: Command line client to interact with Aptly package management system
144
+ test_files: []