filepreviews 2.0.7 → 2.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +13 -6
- data/Changelog.md +6 -0
- data/README.md +5 -2
- data/filepreviews.gemspec +2 -1
- data/lib/filepreviews/response.rb +0 -1
- data/lib/filepreviews/version.rb +1 -1
- data/spec/filepreviews/response_spec.rb +30 -0
- metadata +10 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de65ec37824ea463d1c4f2b0272183853c4161d2c94f5e568b6be9cb785be129
|
4
|
+
data.tar.gz: 746e69ee3fb3cf46ff50bafe107de3552bb5b875429c7acf3583926efa4e14fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c6881d2e1d9c5d595601aa226078ae2ef3f6de01f368c219e69e677154fd0bcd95457fafbfed50103bf552d54a60c9a4e58cb30bd1c0c9ef2563e2fcbcdb9ce
|
7
|
+
data.tar.gz: c8f71ea4e7997044afc4a963c372a249c06786a6199a4f072c13e7ffb806f87d53a9980b12168c2df533349099498c6c91a71d635d0ff2dbfb02db8a5b3fa729
|
data/.travis.yml
CHANGED
@@ -1,13 +1,20 @@
|
|
1
1
|
language: ruby
|
2
|
-
|
2
|
+
os: linux
|
3
|
+
dist: xenial
|
3
4
|
rvm:
|
4
|
-
-
|
5
|
-
-
|
6
|
-
-
|
7
|
-
- 2.
|
8
|
-
- 2.
|
5
|
+
- ruby-head
|
6
|
+
- truffleruby
|
7
|
+
- truffleruby-20.1.0
|
8
|
+
- 2.7.1
|
9
|
+
- 2.6.6
|
10
|
+
- 2.5.8
|
11
|
+
- 2.4.10
|
9
12
|
script: bundle exec rake test
|
10
13
|
env:
|
11
14
|
global:
|
12
15
|
- secure: ksz/xSq5EkiWQfclYHh5gj32IjqH5uTXacYqFGZdpZWPtkxGscSVeBzAvGtY9IQddkEuobVEW8TBqPo2rZ+7sT6ZfLQOuNM9Vtw5jDbAifyHLivZ5/acnW7m5BcmkxttKrel4DfRexzvGW6SAweE+fC07BLfPjzyKoIyjKnV4Y8=
|
13
16
|
- secure: lYcTOY21MNhFAvd3mCNj0CBoMJYMLGy+PsNcuLvhNcQHw/+ulkzQITJFo9IaAOl8TXv+ETAfay0eXfzVC8hE8DTeq3QovdocciMa+otCpVQWRzDwfc+mfUqutdgn96CjAmkvGYHwkDf/X4LBRaDhI2beKeaGO/BGQZw+NMEBFzo=
|
17
|
+
jobs:
|
18
|
+
allow_failures:
|
19
|
+
- rvm: ruby-head
|
20
|
+
- rvm: truffleruby
|
data/Changelog.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Filepreviews Changelog
|
2
2
|
|
3
|
+
## 2.0.8
|
4
|
+
|
5
|
+
* Ruby 2.7 compatibility (thanks to [MartinodF](https://github.com/MartinodF))
|
6
|
+
* Update Travis to include additional Ruby versions (2.6.6, 2.5.8, 2.4.10, truffleruby)
|
7
|
+
* Update gemspec to require Ruby version >= 2.4
|
8
|
+
|
3
9
|
## 2.0.7
|
4
10
|
|
5
11
|
Released Sept 24, 2019 ([2.0.7](https://github.com/jonahoffline/filepreviews-ruby/tree/v2.0.7)).
|
data/README.md
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# FilePreviews.io (Ruby client)
|
2
2
|
[![Gem Version](https://badge.fury.io/rb/filepreviews.svg)](https://badge.fury.io/rb/filepreviews)
|
3
3
|
[![Build Status](https://travis-ci.org/jonahoffline/filepreviews-ruby.svg?branch=master)](https://travis-ci.org/jonahoffline/filepreviews-ruby)
|
4
|
-
[![security](https://hakiri.io/github/jonahoffline/filepreviews-ruby/master.svg)](https://hakiri.io/github/jonahoffline/filepreviews-ruby/master)
|
5
4
|
[![Maintainability](https://api.codeclimate.com/v1/badges/da1cc5ca8fbbbf1ae3a9/maintainability)](https://codeclimate.com/github/jonahoffline/filepreviews-ruby/maintainability)
|
6
5
|
[![Inline docs](http://inch-ci.org/github/jonahoffline/filepreviews-ruby.png)](http://inch-ci.org/github/jonahoffline/filepreviews-ruby)
|
7
6
|
|
@@ -13,6 +12,10 @@ Add this line to your application's Gemfile:
|
|
13
12
|
|
14
13
|
gem 'filepreviews'
|
15
14
|
|
15
|
+
Or via GitHub Package Manager:
|
16
|
+
|
17
|
+
gem 'filepreviews', source: 'https://rubygems.pkg.github.com/jonahoffline'
|
18
|
+
|
16
19
|
And then execute:
|
17
20
|
|
18
21
|
$ bundle
|
@@ -42,7 +45,7 @@ Simpler style:
|
|
42
45
|
require 'filepreviews'
|
43
46
|
|
44
47
|
Filepreviews.api_key = 'YOUR_API_KEY'
|
45
|
-
Filepreviews.
|
48
|
+
Filepreviews.secret_key = 'YOUR_SECRET_KEY'
|
46
49
|
```
|
47
50
|
|
48
51
|
### Basic Example Code
|
data/filepreviews.gemspec
CHANGED
@@ -19,8 +19,9 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
20
20
|
spec.test_files = spec.files.grep(%r{^(spec)/})
|
21
21
|
spec.require_paths = ['lib']
|
22
|
+
spec.required_ruby_version = '>= 2.4'
|
22
23
|
|
23
|
-
spec.add_development_dependency 'bundler'
|
24
|
+
spec.add_development_dependency 'bundler'
|
24
25
|
spec.add_development_dependency 'rake'
|
25
26
|
spec.add_development_dependency 'rspec'
|
26
27
|
|
data/lib/filepreviews/version.rb
CHANGED
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Filepreviews::Response do
|
4
|
+
let(:response) { Filepreviews::Response }
|
5
|
+
|
6
|
+
describe '.new' do
|
7
|
+
it 'returns an Response instance' do
|
8
|
+
expect(response.new({})).to be_an_instance_of(Filepreviews::Response)
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'calls responsify' do
|
12
|
+
json = JSON.parse({hey: "wow"}.to_json)
|
13
|
+
expect(response.new(json).hey).to eq("wow")
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
describe '.responsify' do
|
18
|
+
json = JSON.parse({url: "filepreviews.io", testing: true}.to_json)
|
19
|
+
|
20
|
+
context 'when a Hash or JSON response is passed' do
|
21
|
+
it 'transforms body attributes into callable methods' do
|
22
|
+
responsify = response.new(json)
|
23
|
+
|
24
|
+
expect(responsify.url).to eq("filepreviews.io")
|
25
|
+
expect(responsify.testing).to eq(true)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: filepreviews
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonah Ruiz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
20
20
|
type: :development
|
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: '
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -111,6 +111,7 @@ files:
|
|
111
111
|
- spec/filepreviews/config_spec.rb
|
112
112
|
- spec/filepreviews/filepreviews_spec.rb
|
113
113
|
- spec/filepreviews/http_spec.rb
|
114
|
+
- spec/filepreviews/response_spec.rb
|
114
115
|
- spec/filepreviews/utils_spec.rb
|
115
116
|
- spec/spec_helper.rb
|
116
117
|
homepage: https://github.com/jonahoffline/filepreviews-ruby
|
@@ -127,15 +128,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
127
128
|
requirements:
|
128
129
|
- - ">="
|
129
130
|
- !ruby/object:Gem::Version
|
130
|
-
version: '
|
131
|
+
version: '2.4'
|
131
132
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
132
133
|
requirements:
|
133
134
|
- - ">="
|
134
135
|
- !ruby/object:Gem::Version
|
135
136
|
version: '0'
|
136
137
|
requirements: []
|
137
|
-
|
138
|
-
rubygems_version: 2.7.9
|
138
|
+
rubygems_version: 3.1.2
|
139
139
|
signing_key:
|
140
140
|
specification_version: 4
|
141
141
|
summary: FilePreviews.io Ruby library and CLI for the service
|
@@ -143,5 +143,6 @@ test_files:
|
|
143
143
|
- spec/filepreviews/config_spec.rb
|
144
144
|
- spec/filepreviews/filepreviews_spec.rb
|
145
145
|
- spec/filepreviews/http_spec.rb
|
146
|
+
- spec/filepreviews/response_spec.rb
|
146
147
|
- spec/filepreviews/utils_spec.rb
|
147
148
|
- spec/spec_helper.rb
|