filepreviews 2.0.4 → 2.0.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 1b304050508dcdd255e7971404a4ff4ff732b906
4
- data.tar.gz: dd3c909fd13ee4da6cedd4b4abb3a07ee8fbe64c
2
+ SHA256:
3
+ metadata.gz: 0ab604bac100053e6b0085d6c1e59b348d0de079a2926e9299be8a3ec2a946b3
4
+ data.tar.gz: 98d7cd850c2f462234f6d38d6d87f16641de257320b0c3038251d87cec0adfd9
5
5
  SHA512:
6
- metadata.gz: b8c4560ee25bb02cc0dc88c2041ec9b120879e00260c2d4d161310567ab751f1cff4bd21f7c48c6e9e18d651236434676f02fdc5e26e59a7b498848a9c29eac5
7
- data.tar.gz: e229141bacbded9042f5bc88e2469cffb1ec71f8dd6cce8a01c47c0be1481b3b887a72639c80af836c87b8db9ca9ad6453bd4613b36c739865fef692507b96e6
6
+ metadata.gz: 9ec59f6f6d2bd2bf3a077a1ab97c11e41f37274056b7b5192f2e49eb3a7ad7d649d650e72ed2274357631bb16b3d5aa11479b581c5f034a0eb3ff872291a3fdf
7
+ data.tar.gz: 184a2504c3f0861a36bdd8de3953da0d97cc9ccc22825d523318512e41ef523e0f52bfd4151e8aa081d0b0bd3719e56c3b7537e8ab0ad0073e5825783ef64c70
@@ -1,13 +1,20 @@
1
1
  language: ruby
2
- sudo: false
2
+ os: linux
3
+ dist: xenial
3
4
  rvm:
4
- - 2.4.1
5
- - 2.3.3
6
- - 2.2.6
7
- - 2.1.1
8
- - 2.0.0
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
@@ -1,5 +1,37 @@
1
1
  # Filepreviews Changelog
2
2
 
3
+ ## 2.0.9
4
+
5
+ Released Sept 6, 2020 ([2.0.9](https://github.com/jonahoffline/filepreviews-ruby/tree/v2.0.9)).
6
+
7
+ * Update `Typhoeus` dependency
8
+
9
+ ## 2.0.8
10
+
11
+ Released June 24, 2020 ([2.0.8](https://github.com/jonahoffline/filepreviews-ruby/tree/v2.0.8)).
12
+
13
+ * Ruby 2.7 compatibility (thanks to [MartinodF](https://github.com/MartinodF))
14
+ * Update Travis to include additional Ruby versions (2.6.6, 2.5.8, 2.4.10, truffleruby)
15
+ * Update gemspec to require Ruby version >= 2.4
16
+
17
+ ## 2.0.7
18
+
19
+ Released Sept 24, 2019 ([2.0.7](https://github.com/jonahoffline/filepreviews-ruby/tree/v2.0.7)).
20
+
21
+ * Add GitHub Package Registry support
22
+
23
+ ## 2.0.6
24
+
25
+ Released May 19, 2019 ([2.0.6](https://github.com/jonahoffline/filepreviews-ruby/tree/v2.0.6)).
26
+
27
+ * Add `callback_url` option (thanks to [patrick-gleeson](https://github.com/patrick-gleeson))
28
+
29
+ ## 2.0.5
30
+
31
+ Released May 4, 2018 ([2.0.5](https://github.com/jonahoffline/filepreviews-ruby/tree/v2.0.5)).
32
+
33
+ * Update `Typhoeus`, and `Faraday` dependencies
34
+
3
35
  ## 2.0.4
4
36
 
5
37
  Released May 4, 2018 ([2.0.4](https://github.com/jonahoffline/filepreviews-ruby/tree/v2.0.4)).
data/README.md CHANGED
@@ -1,10 +1,7 @@
1
1
  # FilePreviews.io (Ruby client)
2
- [![Gem Version](http://img.shields.io/gem/v/filepreviews.svg?style=flat)](http://badge.fury.io/rb/filepreviews)
3
- [![Build Status](http://img.shields.io/travis/jonahoffline/filepreviews-ruby.svg?style=flat)](https://travis-ci.org/jonahoffline/filepreviews-ruby)
4
- [![Dependency Status](http://img.shields.io/gemnasium/jonahoffline/filepreviews-ruby.svg?style=flat)](https://gemnasium.com/jonahoffline/filepreviews-ruby)
5
- [![Code Climate](http://img.shields.io/codeclimate/github/jonahoffline/filepreviews-ruby.svg?style=flat)](https://codeclimate.com/github/jonahoffline/filepreviews-ruby)
6
- [![security](https://hakiri.io/github/jonahoffline/filepreviews-ruby/master.svg)](https://hakiri.io/github/jonahoffline/filepreviews-ruby/master)
7
- [![Gitter chat](https://img.shields.io/badge/gitter-filepreviews--ruby-blue.svg?style=flat)](https://gitter.im/jonahoffline/filepreviews-ruby)
2
+ [![Gem Version](https://badge.fury.io/rb/filepreviews.svg)](https://badge.fury.io/rb/filepreviews)
3
+ [![Build Status](https://travis-ci.org/jonahoffline/filepreviews-ruby.svg?branch=master)](https://travis-ci.org/jonahoffline/filepreviews-ruby)
4
+ [![Maintainability](https://api.codeclimate.com/v1/badges/da1cc5ca8fbbbf1ae3a9/maintainability)](https://codeclimate.com/github/jonahoffline/filepreviews-ruby/maintainability)
8
5
  [![Inline docs](http://inch-ci.org/github/jonahoffline/filepreviews-ruby.png)](http://inch-ci.org/github/jonahoffline/filepreviews-ruby)
9
6
 
10
7
  Ruby client library and CLI tool for the [FilePreviews.io](http://filepreviews.io) service. Generate image previews and metadata from almost any kind of file.
@@ -15,6 +12,10 @@ Add this line to your application's Gemfile:
15
12
 
16
13
  gem 'filepreviews'
17
14
 
15
+ Or via GitHub Package Manager:
16
+
17
+ gem 'filepreviews', source: 'https://rubygems.pkg.github.com/jonahoffline'
18
+
18
19
  And then execute:
19
20
 
20
21
  $ bundle
@@ -44,7 +45,7 @@ Simpler style:
44
45
  require 'filepreviews'
45
46
 
46
47
  Filepreviews.api_key = 'YOUR_API_KEY'
47
- Filepreviews.config.secret_key = 'YOUR_SECRET_KEY'
48
+ Filepreviews.secret_key = 'YOUR_SECRET_KEY'
48
49
  ```
49
50
 
50
51
  ### Basic Example Code
@@ -98,7 +99,10 @@ conf = {
98
99
  },
99
100
 
100
101
  # supported: '1', '1-3', '1,3,5', '1-3', 'all'
101
- pages: '1-3'
102
+ pages: '1-3',
103
+
104
+ # Callback URL (POST) to send results
105
+ callback_url: 'http://requestbin.fullcontact.com/1234'
102
106
  }
103
107
  }
104
108
 
@@ -12,16 +12,19 @@ Gem::Specification.new do |spec|
12
12
  spec.summary = %q(FilePreviews.io Ruby library and CLI for the service)
13
13
  spec.homepage = 'https://github.com/jonahoffline/filepreviews-ruby'
14
14
  spec.license = 'MIT'
15
+ spec.metadata['homepage_uri'] = spec.homepage
16
+ spec.metadata['github_repo'] = spec.homepage
15
17
 
16
18
  spec.files = `git ls-files -z`.split("\x0")
17
19
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
20
  spec.test_files = spec.files.grep(%r{^(spec)/})
19
21
  spec.require_paths = ['lib']
22
+ spec.required_ruby_version = '>= 2.4'
20
23
 
21
- spec.add_development_dependency 'bundler', '~> 1.6'
24
+ spec.add_development_dependency 'bundler'
22
25
  spec.add_development_dependency 'rake'
23
26
  spec.add_development_dependency 'rspec'
24
27
 
25
- spec.add_dependency 'faraday', '~> 0.12.2'
26
- spec.add_dependency 'typhoeus', '~> 1.1.2'
28
+ spec.add_dependency 'faraday', '~> 0.17.3'
29
+ spec.add_dependency 'typhoeus', '~> 1.3.0'
27
30
  end
@@ -67,6 +67,7 @@ module Filepreviews
67
67
  request.store(:data, params.data) if params.data
68
68
  request.store(:uploader, params.uploader) if params.uploader
69
69
  request.store(:pages, params.pages) if params.pages
70
+ request.store(:callback_url, params.callback_url) if params.callback_url
70
71
  request
71
72
  end
72
73
 
@@ -25,7 +25,6 @@ module Filepreviews
25
25
  hash.each do |k, v|
26
26
  @table[k.to_sym] = (v.is_a?(Hash) ? self.class.new(v) : v)
27
27
  @hash_table[k.to_sym] = v
28
- new_ostruct_member(k)
29
28
  end
30
29
  end
31
30
  end
@@ -1,5 +1,5 @@
1
1
  # @author Jonah Ruiz <jonah@pixelhipsters.com>
2
2
  # Contains the version namespaced
3
3
  module Filepreviews
4
- VERSION = '2.0.4'
4
+ VERSION = '2.0.9'
5
5
  end
@@ -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
4
+ version: 2.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonah Ruiz
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-04 00:00:00.000000000 Z
11
+ date: 2020-09-07 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: '1.6'
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: '1.6'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -58,28 +58,28 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.12.2
61
+ version: 0.17.3
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.12.2
68
+ version: 0.17.3
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: typhoeus
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 1.1.2
75
+ version: 1.3.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 1.1.2
82
+ version: 1.3.0
83
83
  description: FilePreviews.io Ruby library and CLI application.
84
84
  email:
85
85
  - jonah@pixelhipsters.com
@@ -111,13 +111,16 @@ 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
117
118
  licenses:
118
119
  - MIT
119
- metadata: {}
120
- post_install_message:
120
+ metadata:
121
+ homepage_uri: https://github.com/jonahoffline/filepreviews-ruby
122
+ github_repo: https://github.com/jonahoffline/filepreviews-ruby
123
+ post_install_message:
121
124
  rdoc_options: []
122
125
  require_paths:
123
126
  - lib
@@ -125,21 +128,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
125
128
  requirements:
126
129
  - - ">="
127
130
  - !ruby/object:Gem::Version
128
- version: '0'
131
+ version: '2.4'
129
132
  required_rubygems_version: !ruby/object:Gem::Requirement
130
133
  requirements:
131
134
  - - ">="
132
135
  - !ruby/object:Gem::Version
133
136
  version: '0'
134
137
  requirements: []
135
- rubyforge_project:
136
- rubygems_version: 2.6.12
137
- signing_key:
138
+ rubygems_version: 3.1.4
139
+ signing_key:
138
140
  specification_version: 4
139
141
  summary: FilePreviews.io Ruby library and CLI for the service
140
142
  test_files:
141
143
  - spec/filepreviews/config_spec.rb
142
144
  - spec/filepreviews/filepreviews_spec.rb
143
145
  - spec/filepreviews/http_spec.rb
146
+ - spec/filepreviews/response_spec.rb
144
147
  - spec/filepreviews/utils_spec.rb
145
148
  - spec/spec_helper.rb