From 099bbf724475495aea3bf1d3072f93b80f5e7d07 Mon Sep 17 00:00:00 2001 From: Ivan Kuchin Date: Wed, 20 Mar 2024 14:25:04 +0100 Subject: [PATCH] change quotes in lib/generators/**/*.tt --- .../plugin/templates/%full_name%.gemspec.tt | 6 ++-- .../plugin/templates/README.md.tt | 4 +-- .../plugin/templates/bin/rails.tt | 14 ++++----- .../plugin/templates/lib/%full_name%.rb.tt | 2 +- .../open_project/%plugin_name%/engine.rb.tt | 8 ++--- .../service/templates/service_spec.rb.tt | 30 +++++++++---------- 6 files changed, 32 insertions(+), 32 deletions(-) diff --git a/lib/generators/open_project/plugin/templates/%full_name%.gemspec.tt b/lib/generators/open_project/plugin/templates/%full_name%.gemspec.tt index e5011f880d8..cc93e80f4fa 100644 --- a/lib/generators/open_project/plugin/templates/%full_name%.gemspec.tt +++ b/lib/generators/open_project/plugin/templates/%full_name%.gemspec.tt @@ -1,7 +1,7 @@ $:.push File.expand_path("../lib", __FILE__) $:.push File.expand_path("../../lib", __dir__) -require 'open_project/<%= plugin_name %>/version' +require "open_project/<%= plugin_name %>/version" # Describe your gem and declare its dependencies: Gem::Specification.new do |s| @@ -10,8 +10,8 @@ Gem::Specification.new do |s| s.authors = "OpenProject GmbH" s.email = "info@openproject.org" - s.homepage = "https://community.openproject.org/projects/<%= plugin_name.gsub('_','-') %>" # TODO check this URL - s.summary = 'OpenProject <%= plugin_name.gsub('_', ' ').titleize %>' + s.homepage = "https://community.openproject.org/projects/<%= plugin_name.gsub("_", "-") %>" # TODO check this URL + s.summary = "OpenProject <%= plugin_name.gsub("_", " ").titleize %>" s.description = "FIXME" s.license = "FIXME" # e.g. "MIT" or "GPLv3" diff --git a/lib/generators/open_project/plugin/templates/README.md.tt b/lib/generators/open_project/plugin/templates/README.md.tt index 00d2bfa98d6..61151e4a6d2 100644 --- a/lib/generators/open_project/plugin/templates/README.md.tt +++ b/lib/generators/open_project/plugin/templates/README.md.tt @@ -1,7 +1,7 @@ -# OpenProject <%= plugin_name.gsub('_',' ').titlecase %> Plugin +# OpenProject <%= plugin_name.gsub("_", " ").titlecase %> Plugin FIXME Add description and check issue tracker link below ## Issue Tracker -https://community.openproject.org/projects/<%= plugin_name.gsub('_','-') %>/work_packages +https://community.openproject.org/projects/<%= plugin_name.gsub("_", "-") %>/work_packages diff --git a/lib/generators/open_project/plugin/templates/bin/rails.tt b/lib/generators/open_project/plugin/templates/bin/rails.tt index 8fcd60c45ac..0268f3dbcbe 100755 --- a/lib/generators/open_project/plugin/templates/bin/rails.tt +++ b/lib/generators/open_project/plugin/templates/bin/rails.tt @@ -2,16 +2,16 @@ # 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/open_project/<%= plugin_name %>/engine', __FILE__) +ENGINE_ROOT = File.expand_path("../..", __FILE__) +ENGINE_PATH = File.expand_path("../../lib/open_project/<%= plugin_name %>/engine", __FILE__) # Set up gems listed in the Gemfile. -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) -require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__) +require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"]) ## # This is not ideal but better than nothing. -if ENV['OPENPROJECT_ROOT'] +if ENV["OPENPROJECT_ROOT"] # /Users/mkahl/dev/openproject/release/lib path = Pathname(ENV["OPENPROJECT_ROOT"]).join("lib") $LOAD_PATH.unshift(path.to_s) @@ -22,5 +22,5 @@ else Kernel.exit(1) end -require 'rails/all' -require 'rails/engine/commands' +require "rails/all" +require "rails/engine/commands" diff --git a/lib/generators/open_project/plugin/templates/lib/%full_name%.rb.tt b/lib/generators/open_project/plugin/templates/lib/%full_name%.rb.tt index 386dd21254b..1a90fec6ebe 100644 --- a/lib/generators/open_project/plugin/templates/lib/%full_name%.rb.tt +++ b/lib/generators/open_project/plugin/templates/lib/%full_name%.rb.tt @@ -1 +1 @@ -require 'open_project/<%= plugin_name %>' +require "open_project/<%= plugin_name %>" diff --git a/lib/generators/open_project/plugin/templates/lib/open_project/%plugin_name%/engine.rb.tt b/lib/generators/open_project/plugin/templates/lib/open_project/%plugin_name%/engine.rb.tt index f96a60bad4f..879db493856 100644 --- a/lib/generators/open_project/plugin/templates/lib/open_project/%plugin_name%/engine.rb.tt +++ b/lib/generators/open_project/plugin/templates/lib/open_project/%plugin_name%/engine.rb.tt @@ -1,6 +1,6 @@ # PreventĀ load-order problems in case openproject-plugins is listed after a plugin in the Gemfile # or not at all -require 'open_project/plugins' +require "open_project/plugins" module OpenProject::<%= plugin_name.camelcase %> class Engine < ::Rails::Engine @@ -8,9 +8,9 @@ module OpenProject::<%= plugin_name.camelcase %> include OpenProject::Plugins::ActsAsOpEngine - register '<%= full_name %>', - :author_url => 'https://openproject.org', - :requires_openproject => '>= 6.0.0' + register "<%= full_name %>", + :author_url => "https://openproject.org", + :requires_openproject => ">= 6.0.0" end end diff --git a/lib/generators/open_project/rspec/service/templates/service_spec.rb.tt b/lib/generators/open_project/rspec/service/templates/service_spec.rb.tt index b373d377fab..e26fc1da947 100644 --- a/lib/generators/open_project/rspec/service/templates/service_spec.rb.tt +++ b/lib/generators/open_project/rspec/service/templates/service_spec.rb.tt @@ -28,27 +28,27 @@ # See COPYRIGHT and LICENSE files for more details. # ++ -require 'spec_helper' +require "spec_helper" # Require the file for the BaseServices shared example you're keeping # -# require 'services/base_services/behaves_like_create_service' -# require 'services/base_services/behaves_like_update_service' -# require 'services/base_services/behaves_like_delete_service' +# require "services/base_services/behaves_like_create_service" +# require "services/base_services/behaves_like_update_service" +# require "services/base_services/behaves_like_delete_service" RSpec.describe <%= service_name %> do # Keep the BaseServices shared_example that applies from below # - # it_behaves_like 'BaseServices create service' - # it_behaves_like 'BaseServices update service' - # it_behaves_like 'BaseService delete service' + # it_behaves_like "BaseServices create service" + # it_behaves_like "BaseServices update service" + # it_behaves_like "BaseService delete service" # AND/OR build your own # Here's something to get started with - shared_examples 'is success' do + shared_examples "is success" do it { is_expected.to be_success } end - shared_examples 'is failure' do + shared_examples "is failure" do it { is_expected.to be_failure } end @@ -57,15 +57,15 @@ RSpec.describe <%= service_name %> do subject(:service_call) { instance.call(params) } - describe '#call' do - context 'with valid params' do - let(:params) { raise 'Define me' } + describe "#call" do + context "with valid params" do + let(:params) { raise "Define me" } - it_behaves_like 'is success' + it_behaves_like "is success" end - context 'with invalid params' do - it_behaves_like 'is failure' + context "with invalid params" do + it_behaves_like "is failure" end end end