Module: Aptly
- Defined in:
- lib/aptly.rb,
lib/aptly/files.rb,
lib/aptly/errors.rb,
lib/aptly/publish.rb,
lib/aptly/tmpname.rb,
lib/aptly/version.rb,
lib/aptly/snapshot.rb,
lib/aptly/connection.rb,
lib/aptly/repository.rb,
lib/aptly/publishable.rb,
lib/aptly/configuration.rb,
lib/aptly/representation.rb
Overview
Aptly API
Defined Under Namespace
Modules: Errors, Publishable Classes: Configuration, Connection, Files, PublishedRepository, Repository, Representation, Snapshot
Constant Summary collapse
- VERSION =
The loaded version of the gem.
'0.11.0'.freeze
Class Method Summary collapse
-
.configuration ⇒ Object
The global configuration instance.
-
.configure {|configuration| ... } ⇒ Object
Configures aptly in a block.
-
.escape_prefix(prefix_path) ⇒ String
Translates a pathish prefix (e.g. ‘dev/unstable_x’) to an API-safe prefix (e.g. ‘dev_unstable__x’) See prefix format description on www.aptly.info/doc/api/publish/.
-
.publish(sources, prefix = '', source_kind = 'local', connection = Connection.new, **kwords) ⇒ PublishedRepository
Publish 1 or more sources into a public repository prefix.
-
.repo(name, connection = Connection.new, **kwords) ⇒ Object
Convenience shorthand for Repository.get.
Class Method Details
.configuration ⇒ Object
The global configuration instance.
35 36 37 |
# File 'lib/aptly.rb', line 35 def configuration @configuration ||= Configuration.new end |
.configure {|configuration| ... } ⇒ Object
Configures aptly in a block.
30 31 32 |
# File 'lib/aptly.rb', line 30 def configure yield configuration end |
.escape_prefix(prefix_path) ⇒ String
Translates a pathish prefix (e.g. ‘dev/unstable_x’) to an API-safe prefix (e.g. ‘dev_unstable__x’) See prefix format description on www.aptly.info/doc/api/publish/
71 72 73 |
# File 'lib/aptly.rb', line 71 def escape_prefix(prefix_path) prefix_path.gsub('_', '__').tr('/', '_') end |
.publish(sources, prefix = '', source_kind = 'local', connection = Connection.new, **kwords) ⇒ PublishedRepository
Publish 1 or more sources into a public repository prefix.
52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/aptly.rb', line 52 def publish(sources, prefix = '', source_kind = 'local', connection = Connection.new, **kwords) # TODO: 1.0 break compat and invert the assertion to want unescaped raise Errors::InvalidPrefixError if prefix.include?('/') kwords = kwords.map { |k, v| [k.to_s.capitalize, v] }.to_h = kwords.merge( SourceKind: source_kind, Sources: sources ) response = connection.send(:post, "/publish/#{prefix}", body: JSON.generate()) PublishedRepository.new(connection, JSON.parse(response.body)) end |
.repo(name, connection = Connection.new, **kwords) ⇒ Object
Convenience shorthand for Aptly::Repository.get.
41 42 43 |
# File 'lib/aptly.rb', line 41 def repo(name, connection = Connection.new, **kwords) Repository.get(name, connection, **kwords) end |