atlas 1.0.0 → 1.1.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 +4 -4
- data/.travis.yml +6 -0
- data/CHANGELOG.md +12 -0
- data/Gemfile +2 -0
- data/README.md +4 -0
- data/atlas.gemspec +1 -1
- data/lib/atlas/box.rb +9 -0
- data/lib/atlas/box_provider.rb +12 -0
- data/lib/atlas/box_version.rb +9 -0
- data/lib/atlas/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2eebf961af024f87de6faedfb7f592f13b8ad5ea
|
4
|
+
data.tar.gz: 755a43b75e08141b216475e5c53897680e796ab3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d353c63963a831696d233bc00072a9a9d9ae7a12d8822db21fccb757f99a3600c28c486d45bcd5e1aec9ba5bd61a8a8ff7315ae50a1639978bc4f843ca34701f
|
7
|
+
data.tar.gz: 7de936672cd7500bf5f27935781a10f7a86ab906685171aa892d62d3074d1cbfce47b2c2e1d8b9bf4a069da53f17839a88d4c0a9253d1fd576da53abd6f05b5f
|
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# CHANGELOG
|
2
|
+
|
3
|
+
## 1.1.0
|
4
|
+
|
5
|
+
* Adds support for uploading boxes to providers.
|
6
|
+
* Adds shorter methods to create versions from boxes, and providers from
|
7
|
+
versions.
|
8
|
+
|
9
|
+
## 1.0.0
|
10
|
+
|
11
|
+
* Initial release; handles creating, updating, deleting boxes, versions and
|
12
|
+
providers.
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# atlas
|
2
2
|
|
3
|
+
[](https://travis-ci.org/nickcharlton/atlas-ruby)
|
4
|
+
[](https://codeclimate.com/github/nickcharlton/atlas-ruby)
|
5
|
+
[](https://codeclimate.com/github/nickcharlton/atlas-ruby)
|
6
|
+
|
3
7
|
Atlas is a Ruby client for [Hashicorp][]'s [Atlas][].
|
4
8
|
|
5
9
|
## Installation
|
data/atlas.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
11
11
|
|
12
12
|
spec.summary = 'A client for Hashicorp\'s Atlas.'
|
13
13
|
spec.description = 'A client for Hashicorp\'s Atlas.'
|
14
|
-
spec.homepage = 'https://github.com/nickcharlton/atlas'
|
14
|
+
spec.homepage = 'https://github.com/nickcharlton/atlas-ruby'
|
15
15
|
spec.license = 'MIT'
|
16
16
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
data/lib/atlas/box.rb
CHANGED
@@ -92,6 +92,15 @@ module Atlas
|
|
92
92
|
end
|
93
93
|
end
|
94
94
|
|
95
|
+
# Create a version for this box.
|
96
|
+
#
|
97
|
+
# @param [Hash] attr attributes to set on the version.
|
98
|
+
#
|
99
|
+
# @return [BoxVersion] a BoxVersion representing the new version.
|
100
|
+
def create_version(attr)
|
101
|
+
BoxVersion.create(tag, attr)
|
102
|
+
end
|
103
|
+
|
95
104
|
# Save the box.
|
96
105
|
#
|
97
106
|
# @return [Hash] Atlas response object.
|
data/lib/atlas/box_provider.rb
CHANGED
@@ -63,6 +63,18 @@ module Atlas
|
|
63
63
|
update_with_response(response.body)
|
64
64
|
end
|
65
65
|
|
66
|
+
# Upload a .box file for this provider.
|
67
|
+
#
|
68
|
+
# @param [File] file a File object for the file.
|
69
|
+
def upload(file)
|
70
|
+
# get the path for upload
|
71
|
+
response = Atlas.client.get("#{url_builder.box_provider_url}/upload")
|
72
|
+
|
73
|
+
# upload the file
|
74
|
+
upload_url = JSON.parse(response.body)['upload_path']
|
75
|
+
Excon.put(upload_url, body: file)
|
76
|
+
end
|
77
|
+
|
66
78
|
# Delete the provider.
|
67
79
|
#
|
68
80
|
# @return [Hash] Atlas response object.
|
data/lib/atlas/box_version.rb
CHANGED
@@ -62,6 +62,15 @@ module Atlas
|
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
65
|
+
# Create a provider for this version.
|
66
|
+
#
|
67
|
+
# @param [Hash] attr attributes for the provider.
|
68
|
+
#
|
69
|
+
# @return [BoxProvider] a representation of the provider.
|
70
|
+
def create_provider(attr)
|
71
|
+
BoxProvider.create(tag, attr)
|
72
|
+
end
|
73
|
+
|
65
74
|
# Save the version.
|
66
75
|
#
|
67
76
|
# @return [Hash] Atlas response object.
|
data/lib/atlas/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: atlas
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Charlton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: excon
|
@@ -116,6 +116,8 @@ extensions: []
|
|
116
116
|
extra_rdoc_files: []
|
117
117
|
files:
|
118
118
|
- ".gitignore"
|
119
|
+
- ".travis.yml"
|
120
|
+
- CHANGELOG.md
|
119
121
|
- CODE_OF_CONDUCT.md
|
120
122
|
- Gemfile
|
121
123
|
- LICENSE.txt
|
@@ -134,7 +136,7 @@ files:
|
|
134
136
|
- lib/atlas/url_builder.rb
|
135
137
|
- lib/atlas/user.rb
|
136
138
|
- lib/atlas/version.rb
|
137
|
-
homepage: https://github.com/nickcharlton/atlas
|
139
|
+
homepage: https://github.com/nickcharlton/atlas-ruby
|
138
140
|
licenses:
|
139
141
|
- MIT
|
140
142
|
metadata: {}
|