Skip to content

Commit

Permalink
Merge branch 'master' into test_matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
awead committed Jul 5, 2017
2 parents ef03692 + 322c8dc commit 0893ffb
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 5 deletions.
11 changes: 9 additions & 2 deletions README.md
Expand Up @@ -18,8 +18,9 @@ download the files.

## Installation

Add this line to your application's Gemfile:
Add this lines to your application's Gemfile:

gem 'jquery-rails'
gem 'browse-everything'

And then execute:
Expand All @@ -44,7 +45,13 @@ If you prefer not to use the generator, or need info on how to set up providers

Add `@import "browse_everything";` to your application.css.scss

Add `//= require browse_everything` to your application.js
In `app/assets/javascripts/application.js` include jquery and the BrowseEverything

```javascript
//= require jquery
//= require browse_everything
```


## Usage

Expand Down
1 change: 0 additions & 1 deletion app/assets/javascripts/browse_everything.js
@@ -1,4 +1,3 @@
//= require jquery
//= require jquery.treetable
//= require bootstrap-sprockets
//= require browse_everything/behavior
2 changes: 1 addition & 1 deletion lib/browse_everything/retriever.rb
Expand Up @@ -53,7 +53,7 @@ def retrieve(spec)
yield(chunk, retrieved, spec['file_size'].to_i)
end
else
raise URI::BadURIError, "Unknown URI scheme: #{uri.scheme}"
raise URI::BadURIError, "Unknown URI scheme: #{url.scheme}"
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/browse_everything/version.rb
@@ -1,3 +1,3 @@
module BrowseEverything
VERSION = '0.13.0'.freeze
VERSION = '0.13.1'.freeze
end
18 changes: 18 additions & 0 deletions spec/unit/retriever_spec.rb
Expand Up @@ -6,6 +6,24 @@
let(:data_with_spaces) { File.open(datafile_with_spaces, 'rb', &:read) }
let(:size) { File.size(datafile) }

context 'with a non-URI' do
let(:spec) do
{
'0' => {
'url' => '/some/dir/file.pdf',
'file_name' => 'file.pdf',
'file_size' => size.to_s
}
}
end

describe '#retrieve' do
it 'raises an error' do
expect { retriever.retrieve(spec['0']) }.to raise_error(URI::BadURIError)
end
end
end

context 'http://' do
let(:spec) do
{
Expand Down

0 comments on commit 0893ffb

Please sign in to comment.