Skip to content

Commit

Permalink
copy files from 1.3 branch
Browse files Browse the repository at this point in the history
  • Loading branch information
nabeta committed Jul 9, 2019
1 parent bb1a84c commit 23240c3
Show file tree
Hide file tree
Showing 289 changed files with 1,122 additions and 5,142 deletions.
6 changes: 2 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ gem "enju_seed", github: "next-l/enju_seed"
gem "enju_leaf", github: "next-l/enju_leaf"
gem "enju_biblio", github: "next-l/enju_biblio"
gem "enju_library", github: "next-l/enju_library"
gem "enju_message", github: "next-l/enju_message"
gem "enju_circulation", github: "next-l/enju_circulation"
gem "enju_event", github: "next-l/enju_event"
gem "enju_manifestation_viewer", github: "next-l/enju_manifestation_viewer"
gem 'jbuilder'
gem 'jquery-rails'
gem 'json_translate'
gem 'paper_trail'
group :test do
gem 'rspec_junit_formatter'
gem 'rails-controller-testing'
Expand Down
8 changes: 4 additions & 4 deletions README.rdoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
= EnjuInterLibraryLoan
{<img src="https://travis-ci.org/next-l/enju_inter_library_loan.svg?branch=master" alt="Build Status" />}[https://travis-ci.org/next-l/enju_inter_library_loan]
{<img src="https://coveralls.io/repos/next-l/enju_inter_library_loan/badge.svg?branch=master&service=github" alt="Coverage Status" />}[https://coveralls.io/github/next-l/enju_inter_library_loan?branch=master]
{<img src="https://hakiri.io/github/next-l/enju_inter_library_loan/master.svg" alt="security" />}[https://hakiri.io/github/next-l/enju_inter_library_loan/master]
= EnjuSearchLog
{<img src="https://travis-ci.org/next-l/enju_search_log.svg?branch=1.3" alt="Build Status" />}[https://travis-ci.org/next-l/enju_search_log]
{<img src="https://coveralls.io/repos/next-l/enju_search_log/badge.svg?branch=1.3&service=github" alt="Coverage Status" />}[https://coveralls.io/github/next-l/enju_search_log?branch=1.3]
{<img src="https://hakiri.io/github/next-l/enju_search_log/1.3.svg" alt="security" />}[https://hakiri.io/github/next-l/enju_search_log/1.3]

This project rocks and uses MIT-LICENSE.

Expand Down
12 changes: 11 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,23 @@ end
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
load 'rails/tasks/engine.rake'


Bundler::GemHelper.install_tasks

require 'rake/testtask'

Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.libs << 'test'
t.pattern = 'test/**/*_test.rb'
t.verbose = false
end

require 'rspec/core'
require 'rspec/core/rake_task'

RSpec::Core::RakeTask.new(:spec) do |spec|
spec.pattern = FileList['spec/**/*_spec.rb']
end

task default: :spec
task :default => :spec
8 changes: 4 additions & 4 deletions app/models/search_history.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ def self.remove_all_history(user)
#
# Table name: search_histories
#
# id :bigint not null, primary key
# user_id :bigint
# id :integer not null, primary key
# user_id :integer
# operation :string default("searchRetrieve")
# sru_version :float default(1.2)
# query :string
Expand All @@ -38,6 +38,6 @@ def self.remove_all_history(user)
# diagnostics :text
# extra_response_data :text
# echoed_search_retrieve_request :text
# created_at :datetime not null
# updated_at :datetime not null
# created_at :datetime
# updated_at :datetime
#
2 changes: 1 addition & 1 deletion bin/rails
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# installed from the root of your application.

ENGINE_ROOT = File.expand_path('../..', __FILE__)
ENGINE_PATH = File.expand_path('../../lib/enju_inter_library_loan/engine', __FILE__)
ENGINE_PATH = File.expand_path('../../lib/enju_search_log/engine', __FILE__)
APP_PATH = File.expand_path('../../spec/dummy/config/application', __FILE__)

# Set up gems listed in the Gemfile.
Expand Down
40 changes: 26 additions & 14 deletions config/locales/translation_en.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@
en:
activerecord:
models:
inter_library_loan: Inter library loan
search_history: Search history

attributes:
inter_library_loan:
requested_at: Requested at
shipped_at: Shipped at
received_at: Received at
return_shipped_at: Return shipped at
return_received_at: Return received at
deleted_at: Deleted at
state: State

inter_library_loan:
library_group_inter_library_loan: "Inter library loans in %{library_group_name}"
borrowing_library: "Borrowing library"
return_this_item: "Return this item"
user:
save_search_history: Save search history
search_history:
operation: Operation
version: Version
query: Query
start_record: Start record
maximum_records: Maximum records
record_packing: Record packing
record_schema: Record schema
result_set_ttl: Result set ttl
stylesheet: Stylesheet
extra_request_data: Extra request data
number_of_records: Number of records
result_set_idle_time: Result set idle time
records: Records
next_record_position: Next record position
diagnostics: Diagnostics
extra_response_data: Extra response data
echoed_search_retrieve_request: Echoed search retrieve request

search_history:
all_history: "All search history"
failed_search: "Failed searches"
searched_at: "Searched at"
remove_all_history: "Remove all search history"
40 changes: 26 additions & 14 deletions config/locales/translation_ja.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@
ja:
activerecord:
models:
inter_library_loan: 相互貸借
search_history: 検索履歴

attributes:
inter_library_loan:
requested_at: 依頼時刻
shipped_at: 発送時刻
received_at: 受取時刻
return_shipped_at: 返却発送時刻
return_received_at: 返却受取時刻
deleted_at: 削除時刻
state: 状態

inter_library_loan:
library_group_inter_library_loan: "%{library_group_name} の相互貸借"
borrowing_library: "借受館"
return_this_item: "この資料を返却する"
user:
save_search_history: 検索履歴を保存する
search_history:
operation: 操作
version: バージョン
query: クエリ
start_record: スタート記録
maximum_records: 最大レコード数
record_packing: レコードの梱包
record_schema: レコードスキーマ
result_set_ttl: 結果のTTL設定
stylesheet: スタイルシート
extra_request_data: 余分なリクエストデータ
number_of_records: レコードの数
result_set_idle_time: 結果のアイドル時間を設定
records: レコード
next_record_position: 次のレコードの位置
diagnostics: 診断
extra_response_data: 余分な応答データ
echoed_search_retrieve_request: エコーの検索リクエストを取得

search_history:
all_history: "全ての検索履歴"
failed_search: "失敗した検索"
searched_at: "検索時刻"
remove_all_history: "すべての検索履歴を削除"
4 changes: 2 additions & 2 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Rails.application.routes.draw do
resources :search_histories, only: [:index, :show, :destroy] do
put :remove_all, on: :collection
resources :search_histories, :only => [:index, :show, :destroy] do
put :remove_all, :on => :collection
end
end
17 changes: 11 additions & 6 deletions db/migrate/090_create_search_histories.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
class CreateSearchHistories < ActiveRecord::Migration[5.1]
def change
class CreateSearchHistories < ActiveRecord::Migration[4.2]
def self.up
create_table :search_histories do |t|
t.references :user, foreign_key: true
t.string :operation, default: 'searchRetrieve'
t.float :version, default: 1.2
t.integer :user_id
t.string :operation, :default => 'searchRetrieve'
t.float :version, :default => 1.2
t.string :query
t.integer :start_record
t.integer :maximum_records
Expand All @@ -12,7 +12,7 @@ def change
t.integer :result_set_ttl
t.string :stylesheet
t.string :extra_request_data
t.integer :number_of_records, default: 0
t.integer :number_of_records, :default => 0
t.string :result_set_id
t.integer :result_set_idle_time
t.text :records
Expand All @@ -22,5 +22,10 @@ def change
t.text :echoed_search_retrieve_request
t.timestamps
end
add_index :search_histories, :user_id
end

def self.down
drop_table :search_histories
end
end
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class RenameSearchHistoryVersionToSruVersion < ActiveRecord::Migration[5.1]
class RenameSearchHistoryVersionToSruVersion < ActiveRecord::Migration[4.2]
def self.up
rename_column :search_histories, :version, :sru_version
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class AddSaveSearchHistoryToUser < ActiveRecord::Migration[5.1]
class AddSaveSearchHistoryToUser < ActiveRecord::Migration[4.2]
def change
add_column :users, :save_search_history, :boolean, :default => false, :null => false
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class AddSaveSearchHistoryToProfile < ActiveRecord::Migration[5.1]
class AddSaveSearchHistoryToProfile < ActiveRecord::Migration[4.2]
def change
add_column :profiles, :save_search_history, :boolean
end
Expand Down
1 change: 1 addition & 0 deletions enju_search_log.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ Gem::Specification.new do |s|
s.add_development_dependency "simplecov"
s.add_development_dependency "coveralls"
s.add_development_dependency "sunspot_matchers"
s.add_development_dependency "annotate"
end
10 changes: 0 additions & 10 deletions examples/user_import_file_sample.tsv

This file was deleted.

1 change: 1 addition & 0 deletions spec/dummy/app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ class ApplicationController < ActionController::Base
protect_from_forgery
include EnjuLibrary::Controller
include EnjuBiblio::Controller
before_action :set_paper_trail_whodunnit
after_action :verify_authorized

include Pundit
Expand Down
6 changes: 1 addition & 5 deletions spec/dummy/app/models/user.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
class User < ActiveRecord::Base
devise :database_authenticatable, #:registerable,
:recoverable, :rememberable, :trackable, #, :validatable
:lockable, lock_strategy: :none, unlock_strategy: :none

# Setup accessible (or protected) attributes for your model
:lockable, :lock_strategy => :none, :unlock_strategy => :none

include EnjuSeed::EnjuUser
include EnjuMessage::EnjuUser
include EnjuCirculation::EnjuUser
include EnjuSearchLog::EnjuUser
end
2 changes: 1 addition & 1 deletion spec/dummy/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
module Dummy
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 5.2
config.load_defaults 5.1

# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
Expand Down
13 changes: 4 additions & 9 deletions spec/dummy/config/boot.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
require 'rubygems'
gemfile = ENV['BUNDLE_GEMFILE'] || File.expand_path('../../../../Gemfile', __FILE__)
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../Gemfile', __dir__)

if File.exist?(gemfile)
ENV['BUNDLE_GEMFILE'] = gemfile
require 'bundler'
Bundler.setup
end

$:.unshift File.expand_path('../../../../lib', __FILE__)
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
$LOAD_PATH.unshift File.expand_path('../../../lib', __dir__)
10 changes: 10 additions & 0 deletions spec/dummy/config/cable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
development:
adapter: async

test:
adapter: async

production:
adapter: redis
url: redis://localhost:6379/1
channel_prefix: dummy_production
11 changes: 2 additions & 9 deletions spec/dummy/config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,19 @@
config.consider_all_requests_local = true

# Enable/disable caching. By default caching is disabled.
# Run rails dev:cache to toggle caching.
if Rails.root.join('tmp', 'caching-dev.txt').exist?
if Rails.root.join('tmp/caching-dev.txt').exist?
config.action_controller.perform_caching = true

config.cache_store = :memory_store
config.public_file_server.headers = {
'Cache-Control' => "public, max-age=#{2.days.to_i}"
'Cache-Control' => "public, max-age=#{2.days.seconds.to_i}"
}
else
config.action_controller.perform_caching = false

config.cache_store = :null_store
end

# Store uploaded files on the local file system (see config/storage.yml for options)
config.active_storage.service = :local

# Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false

Expand All @@ -41,9 +37,6 @@
# Raise an error on page load if there are pending migrations.
config.active_record.migration_error = :page_load

# Highlight code that triggered database queries in logs.
config.active_record.verbose_query_logs = true

# Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large
# number of complex assets.
Expand Down
11 changes: 4 additions & 7 deletions spec/dummy/config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
config.consider_all_requests_local = false
config.action_controller.perform_caching = true

# Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
# or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
# config.require_master_key = true
# Attempt to read encrypted secrets from `config/secrets.yml.enc`.
# Requires an encryption key in `ENV["RAILS_MASTER_KEY"]` or
# `config/secrets.yml.key`.
config.read_encrypted_secrets = true

# Disable serving static files from the `/public` folder by default since
# Apache or NGINX already handles this.
Expand All @@ -38,9 +39,6 @@
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX

# Store uploaded files on the local file system (see config/storage.yml for options)
config.active_storage.service = :local

# Mount Action Cable outside main process or domain
# config.action_cable.mount_path = nil
# config.action_cable.url = 'wss://example.com/cable'
Expand All @@ -62,7 +60,6 @@
# Use a real queuing backend for Active Job (and separate queues per environment)
# config.active_job.queue_adapter = :resque
# config.active_job.queue_name_prefix = "dummy_#{Rails.env}"

config.action_mailer.perform_caching = false

# Ignore bad email addresses and do not raise email delivery errors.
Expand Down
Loading

0 comments on commit 23240c3

Please sign in to comment.