browse-everything 0.7.1 → 0.8.0
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 +4 -4
- data/HISTORY.md +4 -0
- data/app/assets/stylesheets/{browse_everything.css.scss → browse_everything.scss} +0 -0
- data/app/views/browse_everything/_file.html.erb +17 -1
- data/config/locales/en_browse_everything.yml +1 -0
- data/lib/browse_everything/version.rb +1 -1
- data/spec/spec_helper.rb +1 -0
- data/spec/views/browse_everything/_file.html.erb_spec.rb +46 -0
- metadata +5 -6
- data/spec/spec_helper.rb.orig +0 -47
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 534d8093e331f6d7cdb1267d9daeb07028ea429c
|
4
|
+
data.tar.gz: 113173c876354894d06d02e5bb87e8860ef12021
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf4801b32d5b067c2a5a17d366070a1dbaf111d6a7a92c5351f4bfbed898c42bd687a8e4b2884241b110d49228c8f05a918b12f53522b54ea23ffbb2f3c9414f
|
7
|
+
data.tar.gz: 20d1e90a20b62a30d3e5748add97a1fc8b7209a7b81d382d57fa7fc74dd2b5c0693f8493749f497d87af1c0ea0fadd8b552609dc60db55fa5a1e805e559dbbca
|
data/HISTORY.md
CHANGED
File without changes
|
@@ -1,11 +1,27 @@
|
|
1
1
|
<% unless file.relative_parent_path? %>
|
2
|
+
|
3
|
+
<% if file.container? || provider.config[:max_upload_file_size].blank? #never disable a folder or if no maximum is set
|
4
|
+
disabled = false
|
5
|
+
else
|
6
|
+
max_size = provider.config[:max_upload_file_size].to_i
|
7
|
+
disabled = file.size > max_size
|
8
|
+
end
|
9
|
+
%>
|
10
|
+
|
2
11
|
<tr role="row" tabindex="-1" data-ev-location="<%= file.location %>" data-tt-id="<%=path%>" data-tt-parent-id="<%=parent%>" data-tt-branch="<%=file.container? ? 'true' : 'false'%>">
|
3
12
|
<td role="gridcell" class="<%=file.container? ? 'ev-container' : 'ev-file'%> ev-file-name">
|
4
|
-
|
13
|
+
<% if disabled %>
|
14
|
+
<span title="<%= t('browse_everything.size_disabled', max_size: number_to_human_size(max_size)) %>"class="<%=file.container? ? 'folder' : 'file'%>" aria-hidden="true">
|
15
|
+
<%= file.name %>
|
16
|
+
</span>
|
17
|
+
<span class="sr-only"><%= file.container? ? ', folder' : ', file' %> </span>
|
18
|
+
<% else %>
|
19
|
+
<%= link_to browse_everything_engine.contents_path(provider_name,file.id), :class=>'ev-link' do %>
|
5
20
|
<span class="<%=file.container? ? 'folder' : 'file'%>" aria-hidden="true"/>
|
6
21
|
<%= file.name %>
|
7
22
|
<span class="sr-only"><%= file.container? ? ', folder' : ', file' %> </span>
|
8
23
|
<% end %>
|
24
|
+
<% end %>
|
9
25
|
</td>
|
10
26
|
<td role="gridcell" class="ev-file-size">
|
11
27
|
<%= number_to_human_size(file.size).sub(/Bytes/,'bytes') %>
|
data/spec/spec_helper.rb
CHANGED
@@ -0,0 +1,46 @@
|
|
1
|
+
require File.expand_path('../../../spec_helper',__FILE__)
|
2
|
+
|
3
|
+
describe 'browse_everything/_file.html.erb', type: :view do
|
4
|
+
|
5
|
+
let(:file) {
|
6
|
+
BrowseEverything::FileEntry.new(
|
7
|
+
'file_id_01234', 'my_provider:/location/pa/th/file.m4v',
|
8
|
+
'file.m4v', 1024*1024*1024, Time.now, false
|
9
|
+
)
|
10
|
+
}
|
11
|
+
let(:provider) { double("provider") }
|
12
|
+
let(:page) { Capybara::Node::Simple.new(rendered) }
|
13
|
+
|
14
|
+
|
15
|
+
before do
|
16
|
+
allow(view).to receive(:file).and_return(file)
|
17
|
+
allow(view).to receive(:provider).and_return(provider)
|
18
|
+
allow(view).to receive(:path).and_return("path")
|
19
|
+
allow(view).to receive(:parent).and_return("parent")
|
20
|
+
allow(view).to receive(:provider_name).and_return("my provider")
|
21
|
+
allow(provider).to receive(:config).and_return(config)
|
22
|
+
render
|
23
|
+
end
|
24
|
+
|
25
|
+
context "file not too big" do
|
26
|
+
let(:config) { { max_upload_file_size: (5*1024*1024*1024) } }
|
27
|
+
it "should draw link" do
|
28
|
+
expect(page).to have_selector("a.ev-link")
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
context "max not configured" do
|
33
|
+
let(:config) { { } }
|
34
|
+
it "should draw link" do
|
35
|
+
expect(page).to have_selector("a.ev-link")
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
context "file too big" do
|
40
|
+
let(:config) { { max_upload_file_size: 1024 } }
|
41
|
+
it "should draw link" do
|
42
|
+
expect(page).not_to have_selector("a.ev-link")
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: browse-everything
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carolyn Cole
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date:
|
16
|
+
date: 2015-02-27 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: rails
|
@@ -360,7 +360,7 @@ files:
|
|
360
360
|
- app/.DS_Store
|
361
361
|
- app/assets/javascripts/browse_everything.js
|
362
362
|
- app/assets/javascripts/browse_everything/behavior.js.coffee
|
363
|
-
- app/assets/stylesheets/browse_everything.
|
363
|
+
- app/assets/stylesheets/browse_everything.scss
|
364
364
|
- app/assets/stylesheets/jquery.treetable.theme.browse.css
|
365
365
|
- app/controllers/browse_everything_controller.rb
|
366
366
|
- app/helpers/bootstrap_version_helper.rb
|
@@ -401,7 +401,6 @@ files:
|
|
401
401
|
- spec/fixtures/vcr_cassettes/dropbox.yml
|
402
402
|
- spec/fixtures/vcr_cassettes/retriever.yml
|
403
403
|
- spec/spec_helper.rb
|
404
|
-
- spec/spec_helper.rb.orig
|
405
404
|
- spec/support/app/controllers/file_handler_controller.rb
|
406
405
|
- spec/support/app/views/file_handler/index.html.erb
|
407
406
|
- spec/support/app/views/file_handler/main.html.erb
|
@@ -414,6 +413,7 @@ files:
|
|
414
413
|
- spec/unit/file_system_spec.rb
|
415
414
|
- spec/unit/retriever_spec.rb
|
416
415
|
- spec/unit/sky_drive_spec.rb
|
416
|
+
- spec/views/browse_everything/_file.html.erb_spec.rb
|
417
417
|
- tasks/ci.rake
|
418
418
|
- vendor/assets/javascripts/jquery.treetable.js
|
419
419
|
- vendor/assets/stylesheets/jquery.treetable.css
|
@@ -451,7 +451,6 @@ test_files:
|
|
451
451
|
- spec/fixtures/vcr_cassettes/dropbox.yml
|
452
452
|
- spec/fixtures/vcr_cassettes/retriever.yml
|
453
453
|
- spec/spec_helper.rb
|
454
|
-
- spec/spec_helper.rb.orig
|
455
454
|
- spec/support/app/controllers/file_handler_controller.rb
|
456
455
|
- spec/support/app/views/file_handler/index.html.erb
|
457
456
|
- spec/support/app/views/file_handler/main.html.erb
|
@@ -464,4 +463,4 @@ test_files:
|
|
464
463
|
- spec/unit/file_system_spec.rb
|
465
464
|
- spec/unit/retriever_spec.rb
|
466
465
|
- spec/unit/sky_drive_spec.rb
|
467
|
-
|
466
|
+
- spec/views/browse_everything/_file.html.erb_spec.rb
|
data/spec/spec_helper.rb.orig
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
require File.expand_path("config/environment", ENV['RAILS_ROOT'] || File.expand_path("../internal", __FILE__))
|
2
|
-
<<<<<<< HEAD
|
3
|
-
require 'rspec/rails'
|
4
|
-
require 'webmock/rspec'
|
5
|
-
=======
|
6
|
-
require 'simplecov'
|
7
|
-
SimpleCov.start do
|
8
|
-
add_filter "/spec/"
|
9
|
-
end
|
10
|
-
|
11
|
-
module BrowserConfigHelper
|
12
|
-
def url_options
|
13
|
-
{
|
14
|
-
protocol: 'http://',
|
15
|
-
host: 'browse-everything.example.edu'
|
16
|
-
}
|
17
|
-
end
|
18
|
-
|
19
|
-
def stub_configuration
|
20
|
-
BrowseEverything.configure({
|
21
|
-
"file_system" => {
|
22
|
-
home: File.expand_path('../fixtures/file_system',__FILE__)
|
23
|
-
},
|
24
|
-
"box" => {
|
25
|
-
client_id: "BoxClientId",
|
26
|
-
client_secret: "BoxClientSecret"
|
27
|
-
},
|
28
|
-
"drop_box" => {
|
29
|
-
app_key: "DropBoxAppKey",
|
30
|
-
app_secret: "DropBoxAppSecret"
|
31
|
-
},
|
32
|
-
"google_drive" => {
|
33
|
-
client_id: "GoogleClientId",
|
34
|
-
client_secret: "GoogleClientSecret"
|
35
|
-
},
|
36
|
-
"sky_drive" => {
|
37
|
-
client_id: "SkyDriveClientId",
|
38
|
-
client_secret: "SkyDriveClientSecret"
|
39
|
-
}
|
40
|
-
})
|
41
|
-
end
|
42
|
-
|
43
|
-
def unstub_configuration
|
44
|
-
BrowseEverything.configure(nil)
|
45
|
-
end
|
46
|
-
end
|
47
|
-
>>>>>>> Add coverage and configuration stubs
|