Skip to content
This repository has been archived by the owner on Jun 27, 2020. It is now read-only.

Commit

Permalink
Simplifies Travis config - eliminates before_script entries.
Browse files Browse the repository at this point in the history
New rake tasks.
Cleans up a couple of previous merging issues unrelated to the Travis fix.
  • Loading branch information
dchandekstark committed Apr 11, 2014
1 parent 06519ab commit 33b6191
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 22 deletions.
16 changes: 1 addition & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
language: ruby
rvm:
- 2.0.0
before_script:
- "cp config/log4r.yml.sample config/log4r.yml"
- "cp config/log4r_batch_processor.yml.sample config/log4r_batch_processor.yml"
- "cp config/log4r_fixity_check.yml.sample config/log4r_fixity_check.yml"
- "cp config/database.yml.sample config/database.yml"
- "cp config/folder_ingest.yml.sample config/folder_ingest.yml"
- "cp config/role_map.yml.sample config/role_map.yml"
- "cp config/solr.yml.sample config/solr.yml"
- "cp config/fedora.yml.sample config/fedora.yml"
- "cp config/environments/test.rb.sample config/environments/test.rb"
- "rake db:migrate"
- "rake db:test:prepare"
- "rake jetty:clean"
- "rake jetty:config"
script: "rake dul_hydra:ci"
script: "bundle exec rake dul_hydra:ci:build"
notifications:
email:
- [email protected]
2 changes: 1 addition & 1 deletion app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def render_document_title
end

def render_thumbnail(document_or_object, linked = false)
src = document_or_object.has_thumbnail? ? thumbnail_url_for(document_or_object) : default_thumbnail(document_or_object)
src = document_or_object.has_thumbnail? ? thumbnail_path(document_or_object) : default_thumbnail(document_or_object)
thumbnail = image_tag(src, :alt => "Thumbnail", :class => "img-thumbnail")
if linked && can?(:read, document_or_object)
link_to thumbnail, document_or_object_url(document_or_object)
Expand Down
6 changes: 2 additions & 4 deletions lib/dul_hydra/scripts/thumbnails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ def initialize(collection_pid)
end

def execute
items = ActiveFedora::SolrService.lazy_reify_solr_results(
ActiveFedora::SolrService.query(@collection.children_query,
rows: @collection.items.size))
items = ActiveFedora::SolrService.lazy_reify_solr_results(@collection.children.load_from_solr)
items.each do |item|
unless item.has_thumbnail?
component = item.first_child
Expand Down Expand Up @@ -40,4 +38,4 @@ def collection
end

end
end
end
23 changes: 21 additions & 2 deletions lib/tasks/dul_hydra.rake
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
namespace :dul_hydra do
desc "CI build"
task :ci do

namespace :config do
desc "Copy sample config files"
task :samples do
Dir.glob("config/**/*.sample") do |sample|
actual = sample.gsub(/\.sample/, "")
FileUtils.cp sample, actual, verbose: true unless File.exists?(actual)
end
end
end

namespace :ci do
desc "Prepare for CI build"
task :prepare => ['dul_hydra:config:samples', 'db:test:prepare', 'jetty:clean', 'jetty:config'] do
end

desc "CI build"
task :build => :prepare do
ENV['environment'] = "test"
jetty_params = Jettywrapper.load_config
jetty_params[:startup_wait] = 60
Jettywrapper.wrap(jetty_params) do
Rake::Task['spec'].invoke
end
end
end

namespace :batch do
desc "Converts CSV file to one or more XML files"
task :csv_to_xml => :environment do
Expand Down Expand Up @@ -68,6 +86,7 @@ namespace :dul_hydra do
thumb.execute if thumb.collection
end
end

namespace :solr do
desc "Deletes everything from the solr index"
task :clean => :environment do
Expand Down

0 comments on commit 33b6191

Please sign in to comment.