Skip to content

Commit

Permalink
Fix formatting, add more bash functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
Kagemaru committed Sep 30, 2024
1 parent 909789c commit 544079b
Show file tree
Hide file tree
Showing 35 changed files with 84 additions and 17 deletions.
5 changes: 5 additions & 0 deletions .bashrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
alias vim="vim.tiny"
export PATH="${HOME}/bin:${PATH}"
export EDITOR="vim"

if [[ $SENTRY_CURRENT_ENV == "production" ]]; then
export PS1="\[\033[01;31m\]STZH-PROD\[\033[00m\] \w> "
elif [[ $SENTRY_CURRENT_ENV == "integration" ]]; then
export PS1="\[\033[01;33m\]STZH-INT\[\033[00m\] \w> "
else
export PS1="\[\033[01;32m\]STZH-DEV\[\033[00m\] \w> "
fi

2 changes: 1 addition & 1 deletion app/cells/decidim/assemblies/assembly_m/footer.erb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<% # this template intentionally left blank %>
<% # this template intentionally left blank %>
2 changes: 1 addition & 1 deletion app/cells/decidim/assemblies/assembly_m/tags.erb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<% # this template intentionally left blank %>
<% # this template intentionally left blank %>
2 changes: 2 additions & 0 deletions app/channels/application_cable/channel.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ApplicationCable
class Channel < ActionCable::Channel::Base
end
Expand Down
2 changes: 2 additions & 0 deletions app/channels/application_cable/connection.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ApplicationCable
class Connection < ActionCable::Connection::Base
end
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class ApplicationController < ActionController::Base
before_action :set_sentry_context
before_action :set_cache_headers
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/decidim_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Entry point for Decidim. It will use the `DecidimController` as
# entry point, but you can change what controller it inherits from
# so you can customize some methods.
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/status_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Copyright (c) 2006-2017, Puzzle ITC GmbH. This file is part of
# PuzzleTime and licensed under the Affero General Public License version 3
# or later. See the COPYING file at the top-level directory or at
Expand Down
13 changes: 7 additions & 6 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
module ApplicationHelper
# frozen_string_literal: true

module ApplicationHelper
def number_to_currency(number, options = {})
defaults = {
locale: :de,
unit: Decidim.currency_unit,
separator: ',',
delimiter: '\'',
format: '%u %n'
locale: :de,
unit: Decidim.currency_unit,
separator: ',',
delimiter: '\'',
format: '%u %n'
}
super number, defaults.merge(options)
end
Expand Down
12 changes: 6 additions & 6 deletions app/helpers/last_blog_posts_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ module LastBlogPostsHelper

def blog_image_src(post)
image_from_text =
Nokogiri::HTML
.parse(translated_attribute(post.body))
.css('img')
.first
&.attr('src')
Nokogiri::HTML
.parse(translated_attribute(post.body))
.css('img')
.first
&.attr('src')

return image_from_text if image_from_text.present?
return post.photos.min_by(&:weight).url if post.photos.count.positive?

asset_pack_path('media/images/organization-default-image.png')
end
end
end
2 changes: 2 additions & 0 deletions app/jobs/application_job.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# frozen_string_literal: true

class ApplicationJob < ActiveJob::Base
end
2 changes: 2 additions & 0 deletions app/mailers/application_mailer.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class ApplicationMailer < ActionMailer::Base
default from: '[email protected]'
layout 'mailer'
Expand Down
2 changes: 2 additions & 0 deletions app/models/application_record.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
end
2 changes: 2 additions & 0 deletions config/boot.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)

require 'bundler/setup' # Set up gems listed in the Gemfile.
Expand Down
2 changes: 2 additions & 0 deletions config/environment.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Load the Rails application.
require_relative 'application'

Expand Down
2 changes: 2 additions & 0 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.

Expand Down
2 changes: 2 additions & 0 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.

Expand Down
2 changes: 2 additions & 0 deletions config/environments/test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.

Expand Down
2 changes: 2 additions & 0 deletions config/initializers/application_controller_renderer.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Be sure to restart your server when you modify this file.

# ActiveSupport::Reloader.to_prepare do
Expand Down
2 changes: 2 additions & 0 deletions config/initializers/backtrace_silencers.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Be sure to restart your server when you modify this file.

# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
Expand Down
2 changes: 2 additions & 0 deletions config/initializers/content_security_policy.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Be sure to restart your server when you modify this file.

# Define an application-wide content security policy
Expand Down
2 changes: 2 additions & 0 deletions config/initializers/cookies_serializer.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Be sure to restart your server when you modify this file.

# Specify a serializer for the signed and encrypted cookie jars.
Expand Down
2 changes: 2 additions & 0 deletions config/initializers/filter_parameter_logging.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Be sure to restart your server when you modify this file.

# Configure sensitive parameters which will be filtered from the log file.
Expand Down
2 changes: 2 additions & 0 deletions config/initializers/inflections.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Be sure to restart your server when you modify this file.

# Add new inflection rules using the following format. Inflections
Expand Down
2 changes: 2 additions & 0 deletions config/initializers/mime_types.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Be sure to restart your server when you modify this file.

# Add new mime types for use in respond_to blocks:
Expand Down
2 changes: 2 additions & 0 deletions config/initializers/wrap_parameters.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Be sure to restart your server when you modify this file.

# This file contains settings for ActionController::ParamsWrapper which
Expand Down
2 changes: 2 additions & 0 deletions config/puma.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Puma can serve each request in a thread from an internal thread pool.
# The `threads` method setting takes two numbers: a minimum and maximum.
# Any libraries that use thread pools should be configured to match
Expand Down
2 changes: 2 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

Rails.application.routes.draw do
mount Decidim::Core::Engine => '/'
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
Expand Down
2 changes: 2 additions & 0 deletions config/spring.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

%w[
.ruby-version
.rbenv-vars
Expand Down
2 changes: 2 additions & 0 deletions db/seeds.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
#
Expand Down
5 changes: 5 additions & 0 deletions docker-compose-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ services:
- RAILS_SERVE_STATIC_FILES=yes
- SECRET_KEY_BASE=TEST
- SENTRY_CURRENT_ENV=production
depends_on:
- pg
- cache
- mail
- worker
pg:
image: postgres
environment:
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ services:
- RAILS_DB_HOST=pg
- RAILS_ENV=development
- RAILS_MEMCACHED_HOST=cache
- SKIP_MEMCACHE_CHECK=true
- RAILS_MAIL_DELIVERY_CONFIG=address:mail,port:1025
#- RAILS_DB_NAME=decidim_zuerich_production
ports:
Expand Down
4 changes: 3 additions & 1 deletion test/application_system_test_case.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
require "test_helper"
# frozen_string_literal: true

require 'test_helper'

class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
driven_by :selenium, using: :chrome, screen_size: [1400, 1400]
Expand Down
5 changes: 3 additions & 2 deletions test/controllers/status_controller_test.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# frozen_string_literal: true

# Copyright (c) 2006-2017, Puzzle ITC GmbH. This file is part of
# PuzzleTime and licensed under the Affero General Public License version 3
# or later. See the COPYING file at the top-level directory or at
# https://github.com/puzzle/puzzletime.


require 'test_helper'

class StatusControllerTest < ActionController::TestCase
def test_health
endpoint_test :health
end

def test_readiness
def test_readiness
endpoint_test :readiness
end

Expand Down
2 changes: 2 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

ENV['RAILS_ENV'] ||= 'test'
require_relative '../config/environment'
require 'rails/test_help'
Expand Down

0 comments on commit 544079b

Please sign in to comment.