atlas 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b556974cf8d489ffb377369aaa4ebc950bb56aa2
4
- data.tar.gz: c502bf03db82b80088e13d03d9edfbb46e96813c
3
+ metadata.gz: 2eebf961af024f87de6faedfb7f592f13b8ad5ea
4
+ data.tar.gz: 755a43b75e08141b216475e5c53897680e796ab3
5
5
  SHA512:
6
- metadata.gz: e41edd08e181ecd43b7373240850f624d21375a96f711423261de20a05f08a050de711e006f2cbb2fcc75e63652bb27f3efba551fe1fcb05135859f98de5ad58
7
- data.tar.gz: 4cf2d46a3bcbf72f6d4c5084cbfa47a857b7b9c033554dd99c2490bcc64c2b7520b0d8eb07cc38f125bf0c498bae963d7cc0846ea912eadf979460312b6941c1
6
+ metadata.gz: d353c63963a831696d233bc00072a9a9d9ae7a12d8822db21fccb757f99a3600c28c486d45bcd5e1aec9ba5bd61a8a8ff7315ae50a1639978bc4f843ca34701f
7
+ data.tar.gz: 7de936672cd7500bf5f27935781a10f7a86ab906685171aa892d62d3074d1cbfce47b2c2e1d8b9bf4a069da53f17839a88d4c0a9253d1fd576da53abd6f05b5f
@@ -0,0 +1,6 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.2
4
+ addons:
5
+ code_climate:
6
+ repo_token: 17baf936cec8165bd651d58919ddcaa30f2a9d35f23290db4df618ac10a99743
@@ -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
@@ -2,3 +2,5 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in atlas.gemspec
4
4
  gemspec
5
+
6
+ gem 'codeclimate-test-reporter', group: :test, require: nil
data/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # atlas
2
2
 
3
+ [![Build Status](https://travis-ci.org/nickcharlton/atlas-ruby.svg?branch=master)](https://travis-ci.org/nickcharlton/atlas-ruby)
4
+ [![Code Climate](https://codeclimate.com/github/nickcharlton/atlas-ruby/badges/gpa.svg)](https://codeclimate.com/github/nickcharlton/atlas-ruby)
5
+ [![Test Coverage](https://codeclimate.com/github/nickcharlton/atlas-ruby/badges/coverage.svg)](https://codeclimate.com/github/nickcharlton/atlas-ruby)
6
+
3
7
  Atlas is a Ruby client for [Hashicorp][]'s [Atlas][].
4
8
 
5
9
  ## Installation
@@ -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|
@@ -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.
@@ -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.
@@ -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.
@@ -1,4 +1,4 @@
1
1
  # Version information.
2
2
  module Atlas
3
- VERSION = '1.0.0'
3
+ VERSION = '1.1.0'
4
4
  end
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.0.0
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-24 00:00:00.000000000 Z
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: {}