activestorage-openstack 1.5.1 → 1.6.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
  SHA256:
3
- metadata.gz: 3b319aff1bce7b83e7b28c029ace3190bc918ad2c7524b2f8afa55fd5dc60c80
4
- data.tar.gz: bcec102f0f8e18f4745adf0199576758dfe5e121d532203e6f48e4fa5d2b8b5a
3
+ metadata.gz: 4f8947dbb6115b6631723785735bcc8d0a7fd7365c72a81667a5bc190d79b97d
4
+ data.tar.gz: 9a76d1c02dca82a92f10f02de6b15857f8ed674dfda5ac9180745ba2d642ed2b
5
5
  SHA512:
6
- metadata.gz: a4d0d5d3e79cdecf6518a6be8190f64d207d945aca6ee57f51879d535b2a5efdf28c617af4df398448a1230ce94e93740bd70fb344e07146786b672b33c976c4
7
- data.tar.gz: 04c6e56a3b7c23b0bf731c9aed9b2398cccea8cd221784261a66d8f6164f771e3396992e56d100a1e0743ad8f822e1100b7196eaec34fcaa0166de85378add02
6
+ metadata.gz: 832bde5e15e8467b50b2abbc05edced62c32a48ebcaa925593393a20918c06325554e5b91c44ada68346fa2db11815549ac8e8b722b771b61c1a24fdb7811fed
7
+ data.tar.gz: ebc0fd0afefed4e9785acff19bc1c68605ba2587807046a36a5d1a7614050fc5c605595f1d173a683f4f23ac2e71b69fc4ab18361e9402854cf60d59dfc9d6a4
data/README.md CHANGED
@@ -1,29 +1,22 @@
1
- # ActiveStorage::Openstack
2
- This rails plugin wraps the OpenStack Swift provider as an Active Storage service. It is now compatible with rails 6.
3
1
 
4
2
  [![Gem Version](https://badge.fury.io/rb/activestorage-openstack.svg)](https://badge.fury.io/rb/activestorage-openstack)
5
- [![Build Status](https://travis-ci.com/chaadow/activestorage-openstack.svg?branch=master)](https://travis-ci.com/chaadow/activestorage-openstack)
3
+ ![Build](https://github.com/chaadow/activestorage-openstack/actions/workflows/ruby.yml/badge.svg)
6
4
  [![Maintainability](https://api.codeclimate.com/v1/badges/4c070c101f86a579516f/maintainability)](https://codeclimate.com/github/chaadow/activestorage-openstack/maintainability)
7
- [![Test Coverage](https://api.codeclimate.com/v1/badges/4c070c101f86a579516f/test_coverage)](https://codeclimate.com/github/chaadow/activestorage-openstack/test_coverage)
8
- Starting from version `0.4`, this gem enforces version `>= 0.2.2` of `fog-openstack` which introduces breaking changes to the configuration keys in `config/storage.yml`. Please read the [MIGRATING from `0.1.x` to `0.2.x`](#migrating-from-fog-openstack-01x-to-02x) section
5
+ # ActiveStorage::Openstack
6
+ This rails plugin wraps the OpenStack Swift provider as an Active Storage service.
7
+
8
+ Compatible with rails `6.0.x`, `6.1.x`, `7.0.x` as well as `rails main branch` (edge).
9
+
10
+ Compatible with ruby `2.5`, `2.6`, `2.7`, `3.0`, `3.1`.
9
11
 
10
12
  **This gem currently supports `fog-openstack` version `~ 1.0`**
11
13
 
12
14
  ## Installation
13
- Add this line to your application's Gemfile:
15
+ Add this line to your application's Gemfile ( Add the second line for ruby 3/3.1 support)
14
16
 
15
17
  ```ruby
16
18
  gem 'activestorage-openstack', '1.0'
17
- ```
18
-
19
- And then execute:
20
- ```bash
21
- $ bundle
22
- ```
23
-
24
- Or install it yourself as:
25
- ```bash
26
- $ gem install activestorage-openstack
19
+ gem 'fog-openstack', github: 'chaadow/fog-openstack' # Temporary, for ruby 3 support, until the PR is merged and released
27
20
  ```
28
21
 
29
22
  ## Usage
@@ -69,26 +62,6 @@ For example, for the `public_openstack` entry above, change the `config` variabl
69
62
  config.active_storage.service = :public_openstack
70
63
  ```
71
64
 
72
- ## Migrating from fog-openstack `~> 0.1.x` to `>= 0.2.x`
73
-
74
- 1- From your configuration file (`config/storage.yml`) change the `openstack_auth_uri` from :
75
- ```yaml
76
- openstack_auth_url: https://auth.example.com/v2.0/tokens
77
- ```
78
- to :
79
- ```yaml
80
- openstack_auth_url: https://auth.example.com
81
- ```
82
- ==> **specifying the version in the `openstack_auth_url` key would break things**
83
-
84
- 2- Second, specify the Keystone version (default is `v3.0`, however it is retro-compatible with v2.0 (So for now, adding this key won't affect the normal functioning of this gem, but is highly recommended)
85
- - *Additionally v2.0 is deprecated.*
86
- ```yaml
87
- openstack_identity_api_version: v2.0
88
- ```
89
-
90
- For further informations, please refer to [fog-openstack's README](https://github.com/fog/fog-openstack/)
91
-
92
65
  ## Setting up a container
93
66
 
94
67
  From your OpenStack provider website, create or sign in to your account.
@@ -1,5 +1,5 @@
1
1
  module ActiveStorage
2
2
  module Openstack
3
- VERSION = '1.5.1'
3
+ VERSION = '1.6.0'
4
4
  end
5
5
  end
@@ -6,14 +6,13 @@ module ActiveStorage
6
6
  class Service
7
7
  # ActiveStorage provider for OpenStack
8
8
  class OpenStackService < Service
9
- attr_reader :client, :container
9
+ attr_reader :settings, :container
10
10
 
11
11
  def initialize(container:, credentials:, public: false, connection_options: {})
12
12
  super()
13
- settings = credentials.reverse_merge(connection_options: connection_options)
13
+ @settings = credentials.reverse_merge(connection_options: connection_options)
14
14
 
15
15
  @public = public
16
- @client = Fog::OpenStack::Storage.new(settings)
17
16
  @container = Fog::OpenStack.escape(container)
18
17
  end
19
18
 
@@ -146,6 +145,10 @@ module ActiveStorage
146
145
 
147
146
  private
148
147
 
148
+ def client
149
+ @client ||= Fog::OpenStack::Storage.new(settings)
150
+ end
151
+
149
152
  def head_for(key)
150
153
  client.head_object(container, key)
151
154
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activestorage-openstack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chedli Bourguiba
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-24 00:00:00.000000000 Z
11
+ date: 2022-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fog-openstack
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.0'
19
+ version: 1.0.9
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.0'
26
+ version: 1.0.9
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: marcel
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -142,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
142
  - !ruby/object:Gem::Version
143
143
  version: 1.8.11
144
144
  requirements: []
145
- rubygems_version: 3.1.3
145
+ rubygems_version: 3.1.6
146
146
  signing_key:
147
147
  specification_version: 4
148
148
  summary: ActiveStorage wrapper for OpenStack Storage