contenttruck-rb 1.0.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 86c1b2b13c1dbfe1aef7cc2d1cd7c4dc6c7fa57b55b19b94d99d098555a6e473
4
+ data.tar.gz: 834aea2e6ca0d766fcdbe0f447694af07f757920391ac576cf87b1eb5b03b7ff
5
+ SHA512:
6
+ metadata.gz: 17f2624823545a636be54aa9789cd4770d73c10ee59c788e4265ce456c3cdadb0012b840ad07c3a092e62dbc614ab8a66726ae4cd80553bbd7230c0c174d7755
7
+ data.tar.gz: a7bb450068fd878991099b8a40ae4c093a2d0fd712b20b070c01eed0bba6e80cbb8e9fa04acebb30b751c074b243dbbbdf496864c57be64e9f736bb26982b639
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in contenttruck.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2023 Jake Gealer
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,35 @@
1
+ # contenttruck-rb
2
+
3
+ The Ruby SDK for Contenttruck.
4
+
5
+ ## Installation
6
+
7
+ Install the gem and add to the application's Gemfile by executing:
8
+
9
+ $ bundle add contenttruck-rb
10
+
11
+ If bundler is not being used to manage dependencies, install the gem by executing:
12
+
13
+ $ gem install contenttruck-rb
14
+
15
+ ## Usage
16
+
17
+ To use the client, initialise a instance of the Client with the base URL.
18
+ ```ruby
19
+ c = Contenttruck::Client.new 'http://localhost:4000'
20
+ ```
21
+ From here, you will have access to all of the SDK methods.
22
+
23
+ ## Development
24
+
25
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
26
+
27
+ 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`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
28
+
29
+ ## Contributing
30
+
31
+ Bug reports and pull requests are welcome on GitHub at https://github.com/WebScaleSoftwareLtd/contenttruck-rb.
32
+
33
+ ## License
34
+
35
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ task default: %i[]
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/contenttruck/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "contenttruck-rb"
7
+ spec.version = Contenttruck::VERSION
8
+ spec.authors = ["Jake Gealer"]
9
+ spec.email = ["jake@webscalesoftware.ltd"]
10
+
11
+ spec.summary = "The Ruby SDK for Contenttruck."
12
+ spec.description = "The Ruby SDK for Contenttruck."
13
+ spec.homepage = "https://github.com/webscalesoftwareltd/contenttruck-rb"
14
+ spec.license = "MIT"
15
+ spec.required_ruby_version = ">= 2.6.0"
16
+
17
+ spec.metadata["homepage_uri"] = spec.homepage
18
+ spec.metadata["source_code_uri"] = "https://github.com/webscalesoftwareltd/contenttruck-rb"
19
+
20
+ # Specify which files should be added to the gem when it is released.
21
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
22
+ spec.files = Dir.chdir(__dir__) do
23
+ `git ls-files -z`.split("\x0").reject do |f|
24
+ (File.expand_path(f) == __FILE__) || f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor])
25
+ end
26
+ end
27
+ spec.bindir = "exe"
28
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
29
+ spec.require_paths = ["lib"]
30
+
31
+ # Uncomment to register a new dependency of your gem
32
+ # spec.add_dependency "example-gem", "~> 1.0"
33
+
34
+ # For more information and examples about making a new gem, check out our
35
+ # guide at: https://bundler.io/guides/creating_gem.html
36
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Contenttruck
4
+ VERSION = "1.0.0".freeze
5
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "contenttruck/client"
4
+ require_relative "contenttruck/version"
5
+
6
+ module Contenttruck; end
@@ -0,0 +1,18 @@
1
+ module Contenttruck
2
+ VERSION: String
3
+
4
+ class UserError < StandardError
5
+ attr_reader code: String
6
+ end
7
+
8
+ class Client
9
+ def initialize: (base_url: String) -> void
10
+
11
+ def upload: (key: String, partition: String, content_type: String, content_or_reader: String | IO) -> void
12
+ def delete: (key: String, partition: String, relative_path: String) -> void
13
+ def create_key: (sudo_key: String, partitions: Array[String]) -> Hash
14
+ def delete_key: (sudo_key: String, key: String) -> void
15
+ def create_partition: (sudo_key: String, name: String, rule_set: String) -> Hash
16
+ def delete_partition: (sudo_key: String, name: String) -> void
17
+ end
18
+ end
metadata ADDED
@@ -0,0 +1,53 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: contenttruck-rb
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Jake Gealer
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2023-03-25 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: The Ruby SDK for Contenttruck.
14
+ email:
15
+ - jake@webscalesoftware.ltd
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - Gemfile
21
+ - LICENSE.txt
22
+ - README.md
23
+ - Rakefile
24
+ - contenttruck.gemspec
25
+ - lib/contenttruck.rb
26
+ - lib/contenttruck/version.rb
27
+ - sig/contenttruck.rbs
28
+ homepage: https://github.com/webscalesoftwareltd/contenttruck-rb
29
+ licenses:
30
+ - MIT
31
+ metadata:
32
+ homepage_uri: https://github.com/webscalesoftwareltd/contenttruck-rb
33
+ source_code_uri: https://github.com/webscalesoftwareltd/contenttruck-rb
34
+ post_install_message:
35
+ rdoc_options: []
36
+ require_paths:
37
+ - lib
38
+ required_ruby_version: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 2.6.0
43
+ required_rubygems_version: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ requirements: []
49
+ rubygems_version: 3.2.33
50
+ signing_key:
51
+ specification_version: 4
52
+ summary: The Ruby SDK for Contenttruck.
53
+ test_files: []