Skip to content

Commit

Permalink
update bin files
Browse files Browse the repository at this point in the history
  • Loading branch information
nabeta committed Jul 13, 2019
1 parent 89e1678 commit 3a80489
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 32 deletions.
13 changes: 3 additions & 10 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
AllCops:
TargetRubyVersion: 2.2
Rails:
Enabled: true
require: rubocop-rails
inherit_from: .rubocop_todo.yml

Layout/SpaceInsideHashLiteralBraces:
Enabled: false
Layout/SpaceInsideBlockBraces:
Enabled: false
Layout/SpaceBeforeBlockBraces:
Enabled: false
Layout/ExtraSpacing:
Enabled: false
Style/WordArray:
Enabled: false
Style/Documentation:
Expand All @@ -18,13 +15,9 @@ Style/StringLiterals:
Enabled: false
Style/AsciiComments:
Enabled: false
Style/SymbolArray:
Enabled: false
Metrics/MethodLength:
Enabled: false
Metrics/LineLength:
Enabled: false
Metrics/BlockLength:
Enabled: false
Metrics/AbcSize:
Enabled: false
7 changes: 4 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ gemspec
# Git. Remember to move these dependencies to your gemspec before releasing
# your gem to rubygems.org.
gem 'jquery-rails'
gem 'json_translate'
gem 'enju_seed', github: 'next-l/enju_seed'
gem 'enju_leaf', github: 'next-l/enju_leaf'
gem 'enju_library', github: 'next-l/enju_library'
Expand All @@ -23,8 +22,10 @@ gem 'enju_message', github: 'next-l/enju_message'
gem 'enju_event', github: 'next-l/enju_event'
gem 'paper_trail'
gem 'jbuilder'
gem 'rspec_junit_formatter', group: :test
group :test do
gem 'rails-controller-testing'
gem 'rspec_junit_formatter'
end

# To use debugger
# gem 'debugger'
gem 'rails-controller-testing', group: :test
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RDoc::Task.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'EnjuInventory'
rdoc.options << '--line-numbers'
rdoc.rdoc_files.include('README.rdoc')
rdoc.rdoc_files.include('README.md')
rdoc.rdoc_files.include('lib/**/*.rb')
end

Expand Down
8 changes: 4 additions & 4 deletions bin/rails
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
# This command will automatically be run when you run "rails" with Rails gems
# installed from the root of your application.

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

# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])

require 'rails/all'
Expand Down
6 changes: 3 additions & 3 deletions enju_inventory.gemspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$:.push File.expand_path("../lib", __FILE__)
$:.push File.expand_path("lib", __dir__)

# Maintain your gem's version:
require "enju_inventory/version"
Expand All @@ -13,8 +13,8 @@ Gem::Specification.new do |s|
s.summary = "enju_inventory plugin"
s.description = "Inventory management for Next-L Enju"

s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"]
s.test_files = Dir["spec/**/*"] - Dir["spec/dummy/db/*.sqlite3"] - Dir["spec/dummy/log/*"] - Dir["spec/dummy/solr/{data,pids,default,development,test}/*"] - Dir["spec/dummy/tmp/*"] - Dir["spec/dummy/private/**/*"]
s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.md"]
s.test_files = Dir["spec/**/*"] - Dir["spec/dummy/log/*"] - Dir["spec/dummy/solr/{data,pids,default,development,test}/*"] - Dir["spec/dummy/tmp/*"] - Dir["spec/dummy/private/**/*"]

s.add_dependency "enju_biblio", "~> 0.4.0.beta.1"

Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/bin/bundle
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
load Gem.bin_path('bundler', 'bundle')
4 changes: 1 addition & 3 deletions spec/dummy/bin/setup
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#!/usr/bin/env ruby
require 'pathname'
require 'fileutils'
include FileUtils

# path to your application root.
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
APP_ROOT = File.expand_path('..', __dir__)

def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
Expand All @@ -21,7 +20,6 @@ chdir APP_ROOT do
# Install JavaScript dependencies if using Yarn
# system('bin/yarn')


# puts "\n== Copying sample files =="
# unless File.exist?('config/database.yml')
# cp 'config/database.yml.sample', 'config/database.yml'
Expand Down
6 changes: 4 additions & 2 deletions spec/dummy/bin/update
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#!/usr/bin/env ruby
require 'pathname'
require 'fileutils'
include FileUtils

# path to your application root.
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
APP_ROOT = File.expand_path('..', __dir__)

def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
Expand All @@ -18,6 +17,9 @@ chdir APP_ROOT do
system! 'gem install bundler --conservative'
system('bundle check') || system!('bundle install')

# Install JavaScript dependencies if using Yarn
# system('bin/yarn')

puts "\n== Updating database =="
system! 'bin/rails db:migrate'

Expand Down
6 changes: 3 additions & 3 deletions spec/dummy/bin/yarn
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env ruby
VENDOR_PATH = File.expand_path('..', __dir__)
Dir.chdir(VENDOR_PATH) do
APP_ROOT = File.expand_path('..', __dir__)
Dir.chdir(APP_ROOT) do
begin
exec "yarnpkg #{ARGV.join(" ")}"
exec "yarnpkg", *ARGV
rescue Errno::ENOENT
$stderr.puts "Yarn executable was not detected in the system."
$stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddProfileIdToUser < ActiveRecord::Migration[5.2]
def change
add_reference :users, :profile, foreign_key: true
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddFullNameTranslationsToProfile < ActiveRecord::Migration[5.2]
def change
add_column :profiles, :full_name_translations, :jsonb, default: {}, null: false
end
end
6 changes: 5 additions & 1 deletion spec/dummy/db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2019_07_08_044909) do
ActiveRecord::Schema.define(version: 2019_07_13_115451) do

# These are extensions that must be enabled in order to support this database
enable_extension "pgcrypto"
Expand Down Expand Up @@ -640,6 +640,7 @@
t.datetime "expired_at"
t.text "full_name_transcription"
t.datetime "date_of_birth"
t.jsonb "full_name_translations", default: {}, null: false
t.index ["library_id"], name: "index_profiles_on_library_id"
t.index ["user_group_id"], name: "index_profiles_on_user_group_id"
t.index ["user_id"], name: "index_profiles_on_user_id"
Expand Down Expand Up @@ -973,7 +974,9 @@
t.string "unlock_token"
t.datetime "locked_at"
t.datetime "confirmed_at"
t.bigint "profile_id"
t.index ["email"], name: "index_users_on_email"
t.index ["profile_id"], name: "index_users_on_profile_id"
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
t.index ["unlock_token"], name: "index_users_on_unlock_token", unique: true
t.index ["username"], name: "index_users_on_username", unique: true
Expand All @@ -996,4 +999,5 @@
add_foreign_key "profiles", "users"
add_foreign_key "user_has_roles", "roles"
add_foreign_key "user_has_roles", "users"
add_foreign_key "users", "profiles"
end
6 changes: 5 additions & 1 deletion spec/rails_helper.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
require 'simplecov'
require 'coveralls'

SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new([
SimpleCov::Formatter::HTMLFormatter,
Coveralls::SimpleCov::Formatter
])
SimpleCov.start 'rails'
Coveralls.wear!

# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
Expand Down

0 comments on commit 3a80489

Please sign in to comment.