Skip to content

Commit

Permalink
Conform to Linter and Styleguide
Browse files Browse the repository at this point in the history
  • Loading branch information
kronn committed Feb 4, 2025
1 parent 60bb460 commit 384c42d
Show file tree
Hide file tree
Showing 18 changed files with 37 additions and 58 deletions.
1 change: 0 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
inherit_from:
- ../hitobito/.rubocop.yml
- .rubocop_todo.yml

AllCops:
Exclude:
Expand Down
1 change: 0 additions & 1 deletion app/models/group/root.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# or later. See the COPYING file at the top-level directory or at
# https://github.com/hitobito/hitobito_swb.


# TODO: rename class to specific name and change all references
class Group::Root < ::Group
self.layer = true
Expand Down
2 changes: 0 additions & 2 deletions app/models/swb/group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# or later. See the COPYING file at the top-level directory or at
# https://github.com/hitobito/hitobito_swb.


module Swb::Group
extend ActiveSupport::Concern

Expand All @@ -16,5 +15,4 @@ module Swb::Group

root_types Group::Root
end

end
1 change: 0 additions & 1 deletion app_root.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
# or later. See the COPYING file at the top-level directory or at
# https://github.com/hitobito/hitobito_swb.


# define the root directory of the main application
ENV["APP_ROOT"] ||= File.expand_path("../hitobito", __dir__)
25 changes: 12 additions & 13 deletions hitobito_swb.gemspec
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
$LOAD_PATH.push File.expand_path('../lib', __FILE__)
$LOAD_PATH.push File.expand_path("../lib", __FILE__)

# Maintain your wagon's version:
require 'hitobito_swb/version'
require "hitobito_swb/version"

# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
# rubocop:disable SingleSpaceBeforeFirstArg
s.name = 'hitobito_swb'
s.version = HitobitoSwb::VERSION
s.authors = ['Matthias Viehweger']
s.email = ['[email protected]']
s.homepage = 'https://swiss-badminton.ch'
s.summary = 'hitobito for Swiss Badminton'
s.description = 'hitobito for Swiss Badminton'
# rubocop:disable Style/SingleSpaceBeforeFirstArg
s.name = "hitobito_swb"
s.version = HitobitoSwb::VERSION
s.authors = ["Matthias Viehweger"]
s.email = ["[email protected]"]
s.homepage = "https://swiss-badminton.ch"
s.summary = "hitobito for Swiss Badminton"
s.description = "hitobito for Swiss Badminton"

s.files = Dir['{app,config,db,lib}/**/*'] + ['Rakefile']
s.test_files = Dir['spec/**/*']
# rubocop:enable SingleSpaceBeforeFirstArg
s.files = Dir["{app,config,db,lib}/**/*"] + ["Rakefile"]
# rubocop:enable Style/SingleSpaceBeforeFirstArg
end
5 changes: 2 additions & 3 deletions lib/hitobito_swb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
# or later. See the COPYING file at the top-level directory or at
# https://github.com/hitobito/hitobito_swb.


require 'wagons'
require "wagons"
# require 'your_wagon_dependencies'
require 'hitobito_swb/wagon'
require "hitobito_swb/wagon"

module HitobitoSwb
end
3 changes: 1 addition & 2 deletions lib/hitobito_swb/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# or later. See the COPYING file at the top-level directory or at
# https://github.com/hitobito/hitobito_swb.


module HitobitoSwb
VERSION = '0.0.1'
VERSION = "0.0.1"
end
14 changes: 6 additions & 8 deletions lib/hitobito_swb/wagon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
# or later. See the COPYING file at the top-level directory or at
# https://github.com/hitobito/hitobito_swb.


module HitobitoSwb
class Wagon < Rails::Engine
include Wagons::Wagon

# Set the required application version.
app_requirement '>= 0'
app_requirement ">= 0"

# Add a load path for this specific wagon
config.autoload_paths += %W[
Expand All @@ -25,12 +24,12 @@ class Wagon < Rails::Engine
Group.include Swb::Group
end

initializer 'swb.add_settings' do |_app|
Settings.add_source!(File.join(paths['config'].existent, 'settings.yml'))
initializer "swb.add_settings" do |_app|
Settings.add_source!(File.join(paths["config"].existent, "settings.yml"))
Settings.reload!
end

initializer 'swb.add_inflections' do |_app|
initializer "swb.add_inflections" do |_app|
ActiveSupport::Inflector.inflections do |inflect|
# inflect.irregular 'census', 'censuses'
end
Expand All @@ -39,9 +38,8 @@ class Wagon < Rails::Engine
private

def seed_fixtures
fixtures = root.join('db', 'seeds')
ENV['NO_ENV'] ? [fixtures] : [fixtures, File.join(fixtures, Rails.env)]
fixtures = root.join("db", "seeds")
ENV["NO_ENV"] ? [fixtures] : [fixtures, File.join(fixtures, Rails.env)] # rubocop:disable Rails/EnvironmentVariableAccess
end

end
end
7 changes: 3 additions & 4 deletions lib/tasks/license.rake
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
# or later. See the COPYING file at the top-level directory or at
# https://github.com/hitobito/hitobito_swb.


namespace :app do
namespace :license do
task :config do # rubocop:disable Rails/RakeEnvironment
@licenser = Licenser.new('hitobito_swb',
'Swiss Badminton',
'https://github.com/hitobito/hitobito_swb')
@licenser = Licenser.new("hitobito_swb",
"Swiss Badminton",
"https://github.com/hitobito/hitobito_swb")
end
end
end
1 change: 0 additions & 1 deletion lib/tasks/spec.rake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# or later. See the COPYING file at the top-level directory or at
# https://github.com/hitobito/hitobito_swb.


if Rake::Task.task_defined?("spec:features")
# we DO have feature specs in this wagon.
Rake::Task["spec:features"].actions.clear
Expand Down
1 change: 0 additions & 1 deletion spec/features/event_external_application_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# or later. See the COPYING file at the top-level directory or at
# https://github.com/hitobito/hitobito_swb.


require "spec_helper"

describe :event_external_application do
Expand Down
1 change: 0 additions & 1 deletion spec/features/event_participation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# or later. See the COPYING file at the top-level directory or at
# https://github.com/hitobito/hitobito_swb.


require "spec_helper"

describe :event_participation do
Expand Down
1 change: 0 additions & 1 deletion spec/features/self_registration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# or later. See the COPYING file at the top-level directory or at
# https://github.com/hitobito/hitobito_swb.


require "spec_helper"

describe :self_registration do
Expand Down
1 change: 0 additions & 1 deletion spec/models/group_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# or later. See the COPYING file at the top-level directory or at
# https://github.com/hitobito/hitobito_swb.


require "spec_helper"

describe Group do
Expand Down
11 changes: 5 additions & 6 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@
# or later. See the COPYING file at the top-level directory or at
# https://github.com/hitobito/hitobito_swb.

load File.expand_path("../../app_root.rb", __FILE__)
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__)

load File.expand_path('../../app_root.rb', __FILE__)
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)

require File.join(ENV['APP_ROOT'], 'spec', 'spec_helper.rb')
require File.join(ENV["APP_ROOT"], "spec", "spec_helper.rb")

# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[HitobitoSwb::Wagon.root.join('spec/support/**/*.rb')].sort.each { |f| require f }
Dir[HitobitoSwb::Wagon.root.join("spec/support/**/*.rb")].sort.each { |f| require f }

RSpec.configure do |config|
config.fixture_path = File.expand_path('../fixtures', __FILE__)
config.fixture_path = File.expand_path("../fixtures", __FILE__)
end
5 changes: 2 additions & 3 deletions spec/support/fabrication.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
# or later. See the COPYING file at the top-level directory or at
# https://github.com/hitobito/hitobito_swb.


Fabrication.configure do |config|
config.fabricator_path = ['spec/fabricators',
'../hitobito_swb/spec/fabricators']
config.fabricator_path = ["spec/fabricators",
"../hitobito_swb/spec/fabricators"]
config.path_prefix = Rails.root
end
3 changes: 1 addition & 2 deletions test/hitobito_swb_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
# or later. See the COPYING file at the top-level directory or at
# https://github.com/hitobito/hitobito_swb.


require 'test_helper'
require "test_helper"

class HitobitoSwbTest < ActiveSupport::TestCase
test "truth" do
Expand Down
12 changes: 5 additions & 7 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@
# or later. See the COPYING file at the top-level directory or at
# https://github.com/hitobito/hitobito_swb.


# Configure Rails Environment
load File.expand_path('../../app_root.rb', __FILE__)
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)

require File.expand_path('test/test_helper.rb', ENV['APP_ROOT'])
load File.expand_path("../../app_root.rb", __FILE__)
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__)

require File.expand_path("test/test_helper.rb", ENV["APP_ROOT"])

class ActiveSupport::TestCase
self.reset_fixture_path File.expand_path("../fixtures", __FILE__)
class ActiveSupport::TestCase
reset_fixture_path File.expand_path("../fixtures", __FILE__)
end

0 comments on commit 384c42d

Please sign in to comment.