redox 1.6.0 → 1.6.1

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: f210f0ebbfb69117dba40de048d175729ba402cd3407f25f2d9fcf2cdf190bf2
4
- data.tar.gz: 1e4242fa34e80ab3e0cd786e2217f438f45f5d13a7e8450848b0dfc0cfdb0acc
3
+ metadata.gz: afc5e51c1e217d2d7571729c5ed5c0a6e97e1d3903c00d6ca2b8e83be2399df6
4
+ data.tar.gz: 1c6d2b0de046b1c2d9b9724fdd0679d5217d1bc955015fa473203d6c0d82e1dc
5
5
  SHA512:
6
- metadata.gz: ca76e75a695a38e45d0557b1b3fcb8bcd54a7f6d9128439c64a858dcce8e7beda569c454dbd366af1edc6fa8e05b81f606f6b3f4ffc548427ebef5acd350a6d1
7
- data.tar.gz: 44e2bd01702cbbb8f035faa933d54ac6bbc2583400adfba2f466649cb0a368cb256ac31f7460a68a61d8026e8547d76d8a757d17752a7526b26957eab2ffb46e
6
+ metadata.gz: 621a51db8bd3fe0a420ad1b156c57ae3b54a520be56f8066465b2c71f58925d03e0014ad62f8fd9a0583c1efc8b89d0c61706a5be5b05c21480c02b902ff89c6
7
+ data.tar.gz: 5e07da2adc3fea279fc2019d0d0c12a86def95f7bb4b966a637bbb2b5d4b68d710cd6f623ddecf6e0034489f5e33a9128cad7a806c1a9bcf34c586a43c769e61
data/CHANGELOG.md CHANGED
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [1.6.1] - 2021-03-12
8
+ ### Added
9
+ - Media model file helper to base64 files under 200KB
10
+ - Media model available= sets to valid Redox values with true/false
11
+ - Medai model provider entry
12
+
7
13
  ## [1.6.0] - 2021-02-04
8
14
  ### Added
9
15
  - Media model
@@ -151,6 +157,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
151
157
  ### Added
152
158
  - Initial Release
153
159
 
160
+ [1.6.1]: https://github.com/WeInfuse/redox/compare/v1.6.0...v1.6.1
161
+ [1.6.0]: https://github.com/WeInfuse/redox/compare/v1.5.2...v1.6.0
154
162
  [1.5.2]: https://github.com/WeInfuse/redox/compare/v1.5.1...v1.5.2
155
163
  [1.5.1]: https://github.com/WeInfuse/redox/compare/v1.5.0...v1.5.1
156
164
  [1.5.0]: https://github.com/WeInfuse/redox/compare/v1.4.0...v1.5.0
@@ -1,12 +1,15 @@
1
1
  module Redox
2
2
  module Models
3
3
  class Media < AbstractModel
4
+ BLOB_REQUIRED_SIZE = 200 * 1024
5
+
4
6
  property :FileType, from: :file_type, required: false
5
7
  property :FileName, from: :file_name, required: false
6
8
  property :FileContents, from: :file_contents, required: false
7
9
  property :DocumentType, from: :document_type, required: false
8
10
  property :DocumentID, from: :document_id, required: false
9
11
  property :Availability, from: :availability, required: false
12
+ property :Provider, from: :provider, required: false
10
13
 
11
14
  alias_method :file_type, :FileType
12
15
  alias_method :file_name, :FileName
@@ -14,6 +17,28 @@ module Redox
14
17
  alias_method :document_type, :DocumentType
15
18
  alias_method :document_id, :DocumentID
16
19
  alias_method :availability, :Availability
20
+ alias_method :provider, :Provider
21
+
22
+ def availability=(value)
23
+ case value
24
+ when true
25
+ self[:Availability] = 'Available'
26
+ when false
27
+ self[:Availability] = 'Unavailable'
28
+ else
29
+ self[:Availability] = value
30
+ end
31
+ end
32
+
33
+ def add_filepath(path)
34
+ if File.size(path) > BLOB_REQUIRED_SIZE
35
+ raise 'Not implemented'
36
+ else
37
+ self.file_contents = Base64::encode64(File.read(path))
38
+ self.file_type = "#{File.extname(path)}".delete_prefix('.').upcase
39
+ self.file_name = File.basename(path, '.*')
40
+ end
41
+ end
17
42
  end
18
43
  end
19
44
  end
data/lib/redox/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Redox
2
- VERSION = '1.6.0'.freeze
2
+ VERSION = '1.6.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redox
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Clark
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2021-02-04 00:00:00.000000000 Z
13
+ date: 2021-03-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: httparty
@@ -194,8 +194,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
194
194
  - !ruby/object:Gem::Version
195
195
  version: '0'
196
196
  requirements: []
197
- rubyforge_project:
198
- rubygems_version: 2.7.6
197
+ rubygems_version: 3.1.4
199
198
  signing_key:
200
199
  specification_version: 4
201
200
  summary: Ruby wrapper for the Redox Engine API