filepreviews 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +23 -0
- data/.rspec +3 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +12 -0
- data/Changelog.md +7 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +75 -0
- data/Rakefile +7 -0
- data/bin/filepreviews +11 -0
- data/filepreviews.gemspec +27 -0
- data/lib/filepreviews.rb +53 -0
- data/lib/filepreviews/cli.rb +52 -0
- data/lib/filepreviews/http.rb +56 -0
- data/lib/filepreviews/response.rb +36 -0
- data/lib/filepreviews/utils.rb +39 -0
- data/lib/filepreviews/version.rb +5 -0
- data/rubocop.yml +5 -0
- data/spec/filepreviews/filepreviews_spec.rb +21 -0
- data/spec/filepreviews/http_spec.rb +23 -0
- data/spec/filepreviews/utils_spec.rb +27 -0
- data/spec/spec_helper.rb +6 -0
- metadata +142 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 2a7408ac21741d8efb17755f77472468bd6d13e6
|
4
|
+
data.tar.gz: ce60521dd1b76641a7a723133abb4b90756b3eec
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6bdd911b96642df03ec18e1959c91375cf93be015c4d319bba1fb1036cf3a09877d88ba20dbe6860fbe88d70ea6d2f9b2e8b8dfe93fe4e3945c3ed51da2bc565
|
7
|
+
data.tar.gz: 94e34f9354e4fe1c0ec9ec22a0061fbd820a4e37aef5d2a0e1f312fbb820eb6ca6bd6fd3caaabe8f22a87f689b3ebed28795ef45095c59286235d9142bfa0353
|
data/.gitignore
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
.config
|
5
|
+
.yardoc
|
6
|
+
.inch
|
7
|
+
Gemfile.lock
|
8
|
+
InstalledFiles
|
9
|
+
_yardoc
|
10
|
+
coverage
|
11
|
+
doc/
|
12
|
+
lib/bundler/man
|
13
|
+
pkg
|
14
|
+
rdoc
|
15
|
+
spec/reports
|
16
|
+
test/tmp
|
17
|
+
test/version_tmp
|
18
|
+
tmp
|
19
|
+
*.bundle
|
20
|
+
*.so
|
21
|
+
*.o
|
22
|
+
*.a
|
23
|
+
mkmf.log
|
data/.rspec
ADDED
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
filepreviews
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby-2.1.1
|
data/.travis.yml
ADDED
data/Changelog.md
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Jonah Ruiz
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
# FilePreviews.io (Ruby client)
|
2
|
+
This is the ruby client library for the **Demo API** of [FilePreviews.io](http://filepreviews.io) service. A lot more to come very soon.
|
3
|
+
|
4
|
+
[Sign up to beta](http://eepurl.com/To0U1)
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
Add this line to your application's Gemfile:
|
9
|
+
|
10
|
+
gem 'filepreviews'
|
11
|
+
|
12
|
+
And then execute:
|
13
|
+
|
14
|
+
$ bundle
|
15
|
+
|
16
|
+
Or install it yourself as:
|
17
|
+
|
18
|
+
$ gem install filepreviews
|
19
|
+
|
20
|
+
## Usage
|
21
|
+
|
22
|
+
### Example code
|
23
|
+
```ruby
|
24
|
+
|
25
|
+
require 'filepreviews'
|
26
|
+
|
27
|
+
url = 'http://pixelhipsters.com/images/pixelhipster_cat.png'
|
28
|
+
result = Filepreviews.generate(url)
|
29
|
+
|
30
|
+
result.preview_url
|
31
|
+
result.metadata_url
|
32
|
+
result.metadata
|
33
|
+
```
|
34
|
+
|
35
|
+
#### Options
|
36
|
+
You can optinally send an options object.
|
37
|
+
|
38
|
+
```ruby
|
39
|
+
|
40
|
+
require 'filepreviews'
|
41
|
+
|
42
|
+
options = {
|
43
|
+
size: {
|
44
|
+
width: 100,
|
45
|
+
height: 999
|
46
|
+
},
|
47
|
+
# supported: 'exif', 'ocr', 'psd' or 'all' which means everything
|
48
|
+
metadata: ['exif', 'ocr', 'psd']
|
49
|
+
}
|
50
|
+
|
51
|
+
result = FilePreviews.generate(url, options)
|
52
|
+
result.preview_url
|
53
|
+
result.metadata_url
|
54
|
+
result.metadata
|
55
|
+
```
|
56
|
+
|
57
|
+
### Command-Line Application
|
58
|
+
Options:
|
59
|
+
|
60
|
+
* -m, --metadata - load metadata response
|
61
|
+
* -v, --version - display the version
|
62
|
+
* -h, --help - print help
|
63
|
+
|
64
|
+
## Author
|
65
|
+
* [Jonah Ruiz](http://www.pixelhipsters.com)
|
66
|
+
|
67
|
+
## Contributing
|
68
|
+
|
69
|
+
Is it worth it? let me fork it
|
70
|
+
|
71
|
+
I put my thing down, flip it and debug it
|
72
|
+
|
73
|
+
Ti gubed dna ti pilf nwod gniht ym tup I
|
74
|
+
|
75
|
+
Ti gubed dna ti pilf nwod gniht ym tup I
|
data/Rakefile
ADDED
data/bin/filepreviews
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# @author Jonah Ruiz <jonah@pixelhipsters.com>
|
3
|
+
# Command-line application for Filepreviews.io
|
4
|
+
|
5
|
+
Signal.trap('INT') { exit 1 }
|
6
|
+
|
7
|
+
$LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib/'
|
8
|
+
require 'filepreviews'
|
9
|
+
require 'filepreviews/cli'
|
10
|
+
|
11
|
+
puts Filepreviews::CLI.new(ARGV).parse
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'filepreviews/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'filepreviews'
|
8
|
+
spec.version = Filepreviews::VERSION
|
9
|
+
spec.authors = ['Jonah Ruiz']
|
10
|
+
spec.email = ['jonah@pixelhipsters.com']
|
11
|
+
spec.description = %q(FilePreviews.io Ruby library and CLI application.)
|
12
|
+
spec.summary = %q(FilePreviews.io Ruby library and CLI for the service)
|
13
|
+
spec.homepage = 'https://github.com/jonahoffline/filepreviews-ruby'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(spec)/})
|
19
|
+
spec.require_paths = ['lib']
|
20
|
+
|
21
|
+
spec.add_development_dependency 'bundler', '~> 1.6'
|
22
|
+
spec.add_development_dependency 'rake'
|
23
|
+
spec.add_development_dependency 'rspec'
|
24
|
+
|
25
|
+
spec.add_dependency 'faraday', '~> 0.9.0'
|
26
|
+
spec.add_dependency 'typhoeus', '~> 0.6.8'
|
27
|
+
end
|
data/lib/filepreviews.rb
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'filepreviews/version'
|
3
|
+
require 'filepreviews/utils'
|
4
|
+
require 'filepreviews/http'
|
5
|
+
require 'filepreviews/response'
|
6
|
+
require 'ostruct'
|
7
|
+
|
8
|
+
# @author Jonah Ruiz <jonah@pixelhipsters.com>
|
9
|
+
# Main module for FilePreviews.io library
|
10
|
+
module Filepreviews
|
11
|
+
# Facade method to call API response
|
12
|
+
# @param url [String] image url to convert
|
13
|
+
# @param options [Hash<Symbol>] :metada and :image options
|
14
|
+
# @return [Filepreviews::Response] api response object
|
15
|
+
def self.generate(url, options = {})
|
16
|
+
request_hash = prepare_options(url, options)
|
17
|
+
Filepreviews::HTTP.fetch(request_hash)
|
18
|
+
end
|
19
|
+
|
20
|
+
protected
|
21
|
+
|
22
|
+
# Prepares url and parameters for request
|
23
|
+
# it calls defaults if nothing is provided
|
24
|
+
# @param url [String] url
|
25
|
+
# @param params [Hash<symbol>] options
|
26
|
+
# @return [OpenStruct] all options as methods
|
27
|
+
def self.prepare_options(url, params)
|
28
|
+
params = merge_options(params.fetch(:options) { default_options })
|
29
|
+
params.merge!(url: url)
|
30
|
+
OpenStruct.new(params)
|
31
|
+
end
|
32
|
+
|
33
|
+
# Default options to be used in API request
|
34
|
+
# @return [Hash<symbol>] default options
|
35
|
+
def self.default_options
|
36
|
+
{ debug: true, metadata: ['all'] }
|
37
|
+
end
|
38
|
+
|
39
|
+
# Merges metadata options with supported formats
|
40
|
+
# @param options [Hash<symbol>] metadata and optional size
|
41
|
+
def self.merge_options(options)
|
42
|
+
metadata = (options.fetch(:metadata) & metadata_formats)
|
43
|
+
options.store(:metadata, metadata)
|
44
|
+
|
45
|
+
default_options.merge(options)
|
46
|
+
end
|
47
|
+
|
48
|
+
# Supported (image) formats in metadata
|
49
|
+
# @return [Array] image file extensions
|
50
|
+
def self.metadata_formats
|
51
|
+
%w(all exif ocr psd)
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
require 'optparse'
|
2
|
+
|
3
|
+
module Filepreviews
|
4
|
+
# @author Jonah Ruiz <jonah@pixelhipsters.com>
|
5
|
+
# A Simple class for the executable version of the gem
|
6
|
+
class CLI
|
7
|
+
BANNER = <<MSG
|
8
|
+
Usage: filepreviews [OPTION] [URL]
|
9
|
+
Description:
|
10
|
+
Filepreviews.io - Thumbnails and metadata for almost any kind of file
|
11
|
+
|
12
|
+
Options:
|
13
|
+
MSG
|
14
|
+
# Passes arguments from ARGV and sets metadata flag
|
15
|
+
# @param args [Array<String>] The command-line arguments
|
16
|
+
def initialize(args)
|
17
|
+
@args, @metadata = args, false
|
18
|
+
end
|
19
|
+
|
20
|
+
# Configures the arguments for the command
|
21
|
+
# @param opts [OptionParser]
|
22
|
+
def options(opts)
|
23
|
+
opts.version = Filepreviews::VERSION
|
24
|
+
opts.banner = BANNER
|
25
|
+
opts.set_program_name 'Filepreviews.io'
|
26
|
+
|
27
|
+
opts.on('-m', '--metadata', 'load metadata response') do
|
28
|
+
@metadata = true
|
29
|
+
end
|
30
|
+
|
31
|
+
opts.on_tail('-v', '--version', 'display the version of Filepreviews') do
|
32
|
+
puts opts.version
|
33
|
+
exit
|
34
|
+
end
|
35
|
+
|
36
|
+
opts.on_tail('-h', '--help', 'print this help') do
|
37
|
+
puts opts.help
|
38
|
+
exit
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
# Parses options sent from command-line
|
43
|
+
def parse
|
44
|
+
opts = OptionParser.new(&method(:options))
|
45
|
+
opts.parse!(@args)
|
46
|
+
return opts.help if @args.last.nil?
|
47
|
+
|
48
|
+
file_preview = Filepreviews.generate(@args.last)
|
49
|
+
@metadata ? file_preview.metadata(js: true) : file_preview
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
require 'json'
|
2
|
+
require 'faraday'
|
3
|
+
require 'typhoeus'
|
4
|
+
require 'typhoeus/adapters/faraday'
|
5
|
+
|
6
|
+
module Filepreviews
|
7
|
+
# @author Jonah Ruiz <jonah@pixelhipsters.com>
|
8
|
+
# Contains http helper module
|
9
|
+
module HTTP
|
10
|
+
API_URL = 'https://blimp-previews.herokuapp.com/'
|
11
|
+
USER_AGENT = "Filepreviews-Rubygem/#{Filepreviews::VERSION}"
|
12
|
+
|
13
|
+
include Filepreviews::Utils
|
14
|
+
|
15
|
+
module_function
|
16
|
+
|
17
|
+
# TODO: Fix logger
|
18
|
+
# Returns custom Typhoeus connection configuration
|
19
|
+
# @param url [String] API url to be used as base
|
20
|
+
# @param _debug [Boolean] flag to log responses into STDOUT
|
21
|
+
# @return [Typhoeus::Connection] http client for requests to API
|
22
|
+
def default_connection(url = API_URL, _debug = true)
|
23
|
+
# _logger = debug ? :logger : false
|
24
|
+
|
25
|
+
Faraday.new(url: url) do |conn|
|
26
|
+
conn.adapter :typhoeus
|
27
|
+
# conn.response _logger
|
28
|
+
conn.headers[:user_agent] = USER_AGENT
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
# Returns processed metadata, and image attributes params
|
33
|
+
# @param params [Hash<Symbol>] metadata and image attributes
|
34
|
+
# @return [Hash<Symbol>] processed parameters
|
35
|
+
def prepare_request(params)
|
36
|
+
request = process_params(params)
|
37
|
+
request.store(:size, extract_size(params.size)) if params.size
|
38
|
+
request
|
39
|
+
end
|
40
|
+
|
41
|
+
# Returns parsed response from API
|
42
|
+
# @return [Filepreviews::Response] json response as callable methods
|
43
|
+
def fetch(params)
|
44
|
+
response = default_connection(API_URL, params.debug)
|
45
|
+
.get nil, prepare_request(params)
|
46
|
+
parse(response.body)
|
47
|
+
end
|
48
|
+
|
49
|
+
# Returns callable methods from parsed JSON response
|
50
|
+
# @param response_body [String<JSON>] stringified version of json response
|
51
|
+
# @return [Filepreviews::Response] json response as callable methods
|
52
|
+
def parse(response_body)
|
53
|
+
Filepreviews::Response.new(JSON.parse(response_body))
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module Filepreviews
|
2
|
+
# @author Jonah Ruiz <jonah@pixelhipsters.com>
|
3
|
+
# Response module to create callable methods from JSON response
|
4
|
+
class Response < OpenStruct
|
5
|
+
# Overrides OpenStruct#initialize to enable deep nesting
|
6
|
+
# @param hash [Hash<symbol>] JSON response body
|
7
|
+
# @return [Filepreviews::Response] inherited/hack version of OpenStruct
|
8
|
+
# @see OpenStruct#initialize
|
9
|
+
def initialize(hash = nil)
|
10
|
+
@table, @hash_table = {}, {}
|
11
|
+
|
12
|
+
if hash
|
13
|
+
hash.each do |k, v|
|
14
|
+
@table[k.to_sym] = (v.is_a?(Hash) ? self.class.new(v) : v)
|
15
|
+
@hash_table[k.to_sym] = v
|
16
|
+
new_ostruct_member(k)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
# Magical method to give OpenStruct-like class deep nesting capability
|
22
|
+
def to_h
|
23
|
+
@hash_table
|
24
|
+
end
|
25
|
+
|
26
|
+
# Returns metadata response using the metadata_url from first response
|
27
|
+
# flag is used to share this method with the CLI version (puerco, I know)
|
28
|
+
# @param js [Boolean] flag to enable json response
|
29
|
+
# @return [Filepreviews::Response] api response object
|
30
|
+
def metadata(js: false)
|
31
|
+
url = send(:metadata_url)
|
32
|
+
response = Filepreviews::HTTP.default_connection(url).get(nil)
|
33
|
+
js ? JSON.parse(response.body) : Filepreviews::HTTP.parse(response.body)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'ostruct'
|
2
|
+
require 'cgi'
|
3
|
+
|
4
|
+
module Filepreviews
|
5
|
+
# @author Jonah Ruiz <jonah@pixelhipsters.com>
|
6
|
+
# Utility module with helper methods
|
7
|
+
module Utils
|
8
|
+
def self.included(base)
|
9
|
+
base.extend(self)
|
10
|
+
end
|
11
|
+
|
12
|
+
# Extracts metadata parameters
|
13
|
+
# @param metadata [Array] image formats
|
14
|
+
# @return [String] metadata url parameters
|
15
|
+
def extract_metadata(metadata)
|
16
|
+
metadata.join(',')
|
17
|
+
end
|
18
|
+
|
19
|
+
# Extracts the desired image size attributes
|
20
|
+
# @param size [Hash<Symbol>] desired image :width and :height
|
21
|
+
# @return [String] combined width and height size for http request
|
22
|
+
def extract_size(size)
|
23
|
+
unless size.nil?
|
24
|
+
size = OpenStruct.new(size)
|
25
|
+
"#{size.width}x#{size.height}"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
# Returns processed options and url as parameters
|
30
|
+
# @param params [Hash<Symbol>] :url and :metadata
|
31
|
+
# @return [Hash<Symbol>] processed parameters for http request
|
32
|
+
def process_params(params)
|
33
|
+
{
|
34
|
+
url: CGI.unescape(params.url),
|
35
|
+
metadata: extract_metadata(params.metadata)
|
36
|
+
}
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
data/rubocop.yml
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Filepreviews do
|
4
|
+
let(:file_previews) { Filepreviews }
|
5
|
+
let(:sample_img) { 'http://pixelhipsters.com/images/pixelhipster_cat.png' }
|
6
|
+
|
7
|
+
describe '.generate' do
|
8
|
+
it 'returns a Filepreviews::Response instance' do
|
9
|
+
expect(file_previews.generate(sample_img))
|
10
|
+
.to be_an_instance_of(Filepreviews::Response)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'has a version number' do
|
15
|
+
expect(Filepreviews::VERSION).not_to be nil
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'keeps it real, you feels me dawg?' do
|
19
|
+
expect(true).to eq(true)
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Filepreviews::HTTP do
|
4
|
+
let(:http) { Filepreviews::HTTP }
|
5
|
+
|
6
|
+
describe '.default_connection' do
|
7
|
+
it 'returns a Faraday connection instance' do
|
8
|
+
expect(http.default_connection).to be_an_instance_of(Faraday::Connection)
|
9
|
+
end
|
10
|
+
|
11
|
+
context 'Overrides Faraday defaults' do
|
12
|
+
it 'configures UserAgent header' do
|
13
|
+
expect(http.default_connection.headers.fetch('User-Agent'))
|
14
|
+
.to eq(Filepreviews::HTTP::USER_AGENT)
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'configures the Typhoeus Adapter' do
|
18
|
+
expect(http.default_connection.builder.handlers)
|
19
|
+
.to include(Faraday::Adapter::Typhoeus)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
# Dummy class for testing Utils module
|
4
|
+
class Kawaii
|
5
|
+
include Filepreviews::Utils
|
6
|
+
end
|
7
|
+
|
8
|
+
describe Filepreviews::Utils do
|
9
|
+
let(:kawaii) { Kawaii.new }
|
10
|
+
|
11
|
+
describe '.process_params' do
|
12
|
+
it 'returns extracted parameter hash with :url and :metadata' do
|
13
|
+
url = 'https://www.filepicker.io/api/file/0ehaqJwCTSq4P6jMrix6'
|
14
|
+
params = OpenStruct.new(url: url, metadata: ['png'])
|
15
|
+
|
16
|
+
expect(kawaii.process_params(params))
|
17
|
+
.to eq(url: url, metadata: 'png')
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
describe '.extract_size' do
|
22
|
+
it 'returns extracted image parameters combined' do
|
23
|
+
size = { width: 320, height: 240 }
|
24
|
+
expect(Kawaii.new.extract_size(size)).to eq('320x240')
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,142 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: filepreviews
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jonah Ruiz
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-05-18 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.6'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.6'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: faraday
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.9.0
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.9.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: typhoeus
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.6.8
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.6.8
|
83
|
+
description: FilePreviews.io Ruby library and CLI application.
|
84
|
+
email:
|
85
|
+
- jonah@pixelhipsters.com
|
86
|
+
executables:
|
87
|
+
- filepreviews
|
88
|
+
extensions: []
|
89
|
+
extra_rdoc_files: []
|
90
|
+
files:
|
91
|
+
- ".gitignore"
|
92
|
+
- ".rspec"
|
93
|
+
- ".ruby-gemset"
|
94
|
+
- ".ruby-version"
|
95
|
+
- ".travis.yml"
|
96
|
+
- Changelog.md
|
97
|
+
- Gemfile
|
98
|
+
- LICENSE
|
99
|
+
- README.md
|
100
|
+
- Rakefile
|
101
|
+
- bin/filepreviews
|
102
|
+
- filepreviews.gemspec
|
103
|
+
- lib/filepreviews.rb
|
104
|
+
- lib/filepreviews/cli.rb
|
105
|
+
- lib/filepreviews/http.rb
|
106
|
+
- lib/filepreviews/response.rb
|
107
|
+
- lib/filepreviews/utils.rb
|
108
|
+
- lib/filepreviews/version.rb
|
109
|
+
- rubocop.yml
|
110
|
+
- spec/filepreviews/filepreviews_spec.rb
|
111
|
+
- spec/filepreviews/http_spec.rb
|
112
|
+
- spec/filepreviews/utils_spec.rb
|
113
|
+
- spec/spec_helper.rb
|
114
|
+
homepage: https://github.com/jonahoffline/filepreviews-ruby
|
115
|
+
licenses:
|
116
|
+
- MIT
|
117
|
+
metadata: {}
|
118
|
+
post_install_message:
|
119
|
+
rdoc_options: []
|
120
|
+
require_paths:
|
121
|
+
- lib
|
122
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
123
|
+
requirements:
|
124
|
+
- - ">="
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
version: '0'
|
127
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
requirements: []
|
133
|
+
rubyforge_project:
|
134
|
+
rubygems_version: 2.2.2
|
135
|
+
signing_key:
|
136
|
+
specification_version: 4
|
137
|
+
summary: FilePreviews.io Ruby library and CLI for the service
|
138
|
+
test_files:
|
139
|
+
- spec/filepreviews/filepreviews_spec.rb
|
140
|
+
- spec/filepreviews/http_spec.rb
|
141
|
+
- spec/filepreviews/utils_spec.rb
|
142
|
+
- spec/spec_helper.rb
|