Skip to content

Commit

Permalink
Enforce double quote for string literals
Browse files Browse the repository at this point in the history
  • Loading branch information
eliotjordan committed May 14, 2018
1 parent e53b633 commit 9957b8c
Show file tree
Hide file tree
Showing 404 changed files with 3,266 additions and 3,263 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,5 +141,8 @@ RSpec/AnyInstance:
- 'spec/jobs/check_fixity_recursive_job_spec.rb'
- 'spec/controllers/fixity_dashboard_controller_spec.rb'
- 'spec/change_sets/archival_media_collection_change_set_spec.rb'
Style/StringLiterals:
EnforcedStyle: double_quotes
Lint/UnusedMethodArgument:
AllowUnusedKeywordArguments: true

16 changes: 8 additions & 8 deletions Capfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# frozen_string_literal: true
# Load DSL and set up stages
require 'capistrano/setup'
require "capistrano/setup"

# Include default deployment tasks
require 'capistrano/deploy'
require "capistrano/deploy"

require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
require 'capistrano/passenger'
require 'capistrano/rails/console'
require "capistrano/bundler"
require "capistrano/rails/assets"
require "capistrano/rails/migrations"
require "capistrano/passenger"
require "capistrano/rails/console"

# Load custom tasks from `lib/capistrano/tasks` if you have any defined
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
Dir.glob("lib/capistrano/tasks/*.rake").each { |r| import r }
102 changes: 51 additions & 51 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,34 @@
source "https://rubygems.org"

gem "autoprefixer-rails"
gem 'bagit'
gem "bagit"
gem "blacklight"
gem 'bunny'
gem 'ddtrace'
gem "bunny"
gem "ddtrace"
gem "devise-guests", git: "https://github.com/cbeer/devise-guests.git"
gem "flutie"
gem "honeybadger"
gem 'hydra-access-controls'
gem 'jbuilder'
gem "hydra-access-controls"
gem "jbuilder"
gem "jquery-rails"
gem 'jquery-ui-rails', '~> 5.0'
gem 'lograge'
gem 'logstash-event'
gem 'mini_magick'
gem "jquery-ui-rails", "~> 5.0"
gem "lograge"
gem "logstash-event"
gem "mini_magick"
gem "pg", "~> 0.21"
gem "puma"
gem "rails", "5.1.1"
gem "recipient_interceptor"
gem 'redis-namespace'
gem "redis-namespace"
gem "ruby_tika_app"
gem "sass-rails", "~> 5.0"
gem "simple_form"
gem "sprockets", ">= 3.0.0"
gem "title"
gem "uglifier"
gem "valkyrie", '1.0.0.rc1'
gem "valkyrie", "1.0.0.rc1"
gem "valkyrie-derivatives", git: "https://github.com/samvera-labs/valkyrie-derivatives.git"
gem 'webpacker', '~> 3.3'
gem "webpacker", "~> 3.3"

group :development do
gem "foreman"
Expand All @@ -44,64 +44,64 @@ group :development, :test do
gem "bixby"
gem "bullet"
gem "bundler-audit", ">= 0.5.0", require: false
gem 'coveralls'
gem "coveralls"
gem "dotenv-rails"
gem "factory_bot_rails"
gem 'pdf-reader', github: 'yob/pdf-reader'
gem "pdf-reader", github: "yob/pdf-reader"
gem "pry-byebug"
gem "pry-rails"
gem 'rails-controller-testing'
gem "rails-controller-testing"
gem "rspec-rails", "~> 3.5"
gem 'solr_wrapper', '>= 0.3'
gem "solr_wrapper", ">= 0.3"
end

group :development, :staging do
gem "rack-mini-profiler", require: false
end

group :test do
gem 'chromedriver-helper'
gem "chromedriver-helper"
gem "database_cleaner"
gem "formulaic"
gem 'selenium-webdriver'
gem "selenium-webdriver"
gem "simplecov", require: false
gem "timecop"
gem "webmock"
end

gem 'rsolr', '>= 1.0'
gem "rsolr", ">= 1.0"

gem 'aasm'
gem 'browse-everything', github: 'samvera/browse-everything'
gem 'coffee-rails'
gem 'devise'
gem 'ezid-client'
gem 'geo_works-derivatives', github: "pulibrary/geo_works-derivatives", tag: 'v0.3.1'
gem 'hydra-head'
gem 'hydra-role-management'
gem 'iiif_manifest', github: "samvera-labs/iiif_manifest"
gem 'modernizr-rails'
gem 'normalize-rails'
gem 'omniauth-cas'
gem 'openseadragon'
gem 'pul_metadata_services', github: 'pulibrary/pul_metadata_services', branch: 'master'
gem 'pul_uv_rails', github: 'pulibrary/pul_uv_rails', branch: 'master'
gem 'riiif'
gem 'sidekiq'
gem 'string_rtl'
gem 'valhalla', path: 'valhalla'
source 'https://rails-assets.org' do
gem 'rails-assets-bootstrap-select', '1.12.2'
gem 'rails-assets-jqueryui-timepicker-addon'
gem "aasm"
gem "browse-everything", github: "samvera/browse-everything"
gem "coffee-rails"
gem "devise"
gem "ezid-client"
gem "geo_works-derivatives", github: "pulibrary/geo_works-derivatives", tag: "v0.3.1"
gem "hydra-head"
gem "hydra-role-management"
gem "iiif_manifest", github: "samvera-labs/iiif_manifest"
gem "modernizr-rails"
gem "normalize-rails"
gem "omniauth-cas"
gem "openseadragon"
gem "pul_metadata_services", github: "pulibrary/pul_metadata_services", branch: "master"
gem "pul_uv_rails", github: "pulibrary/pul_uv_rails", branch: "master"
gem "riiif"
gem "sidekiq"
gem "string_rtl"
gem "valhalla", path: "valhalla"
source "https://rails-assets.org" do
gem "rails-assets-bootstrap-select", "1.12.2"
gem "rails-assets-jqueryui-timepicker-addon"
end
gem 'arabic-letter-connector'
gem 'capistrano', '~> 3.7.1'
gem 'capistrano-passenger'
gem 'capistrano-rails'
gem 'capistrano-rails-console'
gem "arabic-letter-connector"
gem "capistrano", "~> 3.7.1"
gem "capistrano-passenger"
gem "capistrano-rails"
gem "capistrano-rails-console"
gem "faker"
gem 'iso-639'
gem 'jquery-datatables-rails', '~> 3.4.0'
gem 'json-schema'
gem 'leaflet-rails', '~> 0.7'
gem 'prawn'
gem "iso-639"
gem "jquery-datatables-rails", "~> 3.4.0"
gem "json-schema"
gem "leaflet-rails", "~> 0.7"
gem "prawn"
10 changes: 5 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

require_relative 'config/application'
require 'rubocop/rake_task' if Rails.env.development? || Rails.env.test?
require_relative "config/application"
require "rubocop/rake_task" if Rails.env.development? || Rails.env.test?

Rails.application.load_tasks
task(:default).clear
Expand All @@ -17,13 +17,13 @@ if defined? RSpec
end

if defined? RuboCop
desc 'Run RuboCop style checker'
desc "Run RuboCop style checker"
RuboCop::RakeTask.new(:rubocop) do |task|
task.requires << 'rubocop-rspec'
task.requires << "rubocop-rspec"
task.fail_on_error = true
end
end

task default: "bundler:audit"

require 'solr_wrapper/rake_task' unless Rails.env.production? || Rails.env.staging?
require "solr_wrapper/rake_task" unless Rails.env.production? || Rails.env.staging?
10 changes: 5 additions & 5 deletions app/adapters/bagit/bag_factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def delete!
lines = File.readlines(bag_path.join("tagmanifest-sha256.txt")).select do |line|
!line.include?(metadata_digest_path.relative_path_from(bag_path).to_s)
end
File.open(bag_path.join("tagmanifest-sha256.txt"), 'w') do |f|
File.open(bag_path.join("tagmanifest-sha256.txt"), "w") do |f|
f.write(lines.join("\n"))
end
FileUtils.rm_f(metadata_digest_path)
Expand All @@ -58,7 +58,7 @@ def create_bag_info

def export_metadata
FileUtils.mkdir_p(bag_path.join("metadata"))
File.open(metadata_digest_path, 'w') do |f|
File.open(metadata_digest_path, "w") do |f|
f.write(resource_metadata.to_json)
end
digest_metadata
Expand All @@ -70,7 +70,7 @@ def metadata_digest_path

def digest_metadata
hash = Digest::SHA256.file(metadata_digest_path).hexdigest
File.open(bag_path.join("tagmanifest-sha256.txt"), 'a') do |f|
File.open(bag_path.join("tagmanifest-sha256.txt"), "a") do |f|
f.puts("#{hash} #{metadata_digest_path.relative_path_from(bag_path)}")
end
end
Expand All @@ -80,8 +80,8 @@ def resource_metadata
end

def render_template_to_file(template:, file:)
output = ERB.new(File.read(template_path.join(template)), nil, '-').result(binding)
File.open(file, 'w') { |f| f.write(output) }
output = ERB.new(File.read(template_path.join(template)), nil, "-").result(binding)
File.open(file, "w") { |f| f.write(output) }
end

def template_path
Expand Down
4 changes: 2 additions & 2 deletions app/adapters/bagit/query_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def initialize(adapter:)
end

def find_by(id:)
raise ArgumentError, 'id must be a Valkyrie::ID' unless id.is_a?(Valkyrie::ID) || id.is_a?(String)
raise ArgumentError, "id must be a Valkyrie::ID" unless id.is_a?(Valkyrie::ID) || id.is_a?(String)
id = Valkyrie::ID.new(id.to_s)
loader = Bagit::BagLoader.new(adapter: adapter, id: id)
raise Valkyrie::Persistence::ObjectNotFoundError unless loader.exist?
Expand Down Expand Up @@ -55,7 +55,7 @@ def find_all_of_model(model:)
end

def find_inverse_references_by(resource:, property:)
raise ArgumentError, 'resource is not saved' unless resource.persisted?
raise ArgumentError, "resource is not saved" unless resource.persisted?
Valkyrie.logger.warn("Bagit Query Service has been asked to find inverse references. This will require iterating over the metadata of every bag - AVOID.")
find_all.select do |potential_inverse_reference|
(potential_inverse_reference.try(property) || []).include?(resource.id)
Expand Down
8 changes: 4 additions & 4 deletions app/adapters/bagit/storage_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def create_manifests(file, original_filename, resource)
checksums = get_checksums(file, original_filename, resource)
file_path = Pathname.new(file_path(file.id)).relative_path_from(bag_path)
["sha1", "md5", "sha256"].each_with_index do |algorithm, idx|
File.open(bag_path.join("manifest-#{algorithm}.txt"), 'a') do |f|
File.open(bag_path.join("manifest-#{algorithm}.txt"), "a") do |f|
f.puts("#{checksums[idx]} #{file_path}")
end
end
Expand Down Expand Up @@ -64,13 +64,13 @@ def data_path
end

def find_by(id:)
Valkyrie::StorageAdapter::File.new(id: Valkyrie::ID.new(id.to_s), io: ::File.open(file_path(id), 'rb'))
Valkyrie::StorageAdapter::File.new(id: Valkyrie::ID.new(id.to_s), io: ::File.open(file_path(id), "rb"))
rescue Errno::ENOENT
raise Valkyrie::StorageAdapter::FileNotFound
end

def file_path(id)
base_path.join(Pathname.new(id.to_s.gsub(/^bag:\/\//, '')))
base_path.join(Pathname.new(id.to_s.gsub(/^bag:\/\//, "")))
end

def handles?(id:)
Expand All @@ -85,7 +85,7 @@ def delete(id:)
lines = File.readlines(bag_path.join("manifest-#{algorithm}.txt")).select do |line|
!line.include?(file_path.to_s)
end
File.open(bag_path.join("manifest-#{algorithm}.txt"), 'w') do |f|
File.open(bag_path.join("manifest-#{algorithm}.txt"), "w") do |f|
f.write(lines.join("\n"))
end
end
Expand Down
Loading

0 comments on commit 9957b8c

Please sign in to comment.