From acb390f686d8c1bc02c7cd91247bf3bb311cea2e Mon Sep 17 00:00:00 2001 From: Yatish Mehta Date: Thu, 16 May 2024 09:03:53 -0700 Subject: [PATCH] Added Phlex --- .rubocop.yml | 1847 ++++++++++++++++- Gemfile | 3 +- Gemfile.lock | 5 + app/helpers/inline_svg_helper.rb | 2 +- app/views/application_view.rb | 9 + app/views/components/application_component.rb | 12 + app/views/home/index.html.erb | 6 +- app/views/layouts/application.html.erb | 2 +- app/views/layouts/application_layout.rb | 24 + bin/configure | 243 --- bin/rename_project | 4 +- bin/setup | 7 +- config/application.rb | 3 + config/environments/development.rb | 2 +- config/environments/production.rb | 2 +- config/environments/test.rb | 2 +- ...9_create_solid_queue_tables.solid_queue.rb | 30 +- ...index_to_blocked_executions.solid_queue.rb | 2 +- ...create_recurring_executions.solid_queue.rb | 4 +- tailwind.config.js | 1 + 20 files changed, 1931 insertions(+), 279 deletions(-) create mode 100644 app/views/application_view.rb create mode 100644 app/views/components/application_component.rb create mode 100644 app/views/layouts/application_layout.rb delete mode 100644 bin/configure diff --git a/.rubocop.yml b/.rubocop.yml index 5365ea1..b3ea484 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,4 +1,1845 @@ -# Omakase Ruby styling for Rails -inherit_gem: - rubocop-rails-omakase: rubocop.yml +AllCops: + TargetRubyVersion: 3.3.1 + +Bundler/DuplicatedGem: + Enabled: true + Include: + - '**/*.gemfile' + - '**/Gemfile' + - '**/gems.rb' + +Bundler/DuplicatedGroup: + Enabled: false + +Bundler/GemComment: + Enabled: false + +Bundler/GemFilename: + Enabled: false + +Bundler/GemVersion: + Enabled: false + +Bundler/InsecureProtocolSource: + Enabled: true + Include: + - '**/*.gemfile' + - '**/Gemfile' + - '**/gems.rb' + +Bundler/OrderedGems: + Enabled: false + +Gemspec/DependencyVersion: + Enabled: false + +Gemspec/DeprecatedAttributeAssignment: + Enabled: true + +Gemspec/DevelopmentDependencies: + Enabled: false + +Gemspec/DuplicatedAssignment: + Enabled: true + Include: + - '**/*.gemspec' + +Gemspec/OrderedDependencies: + Enabled: false + +Gemspec/RequireMFA: + Enabled: false + +Gemspec/RequiredRubyVersion: + Enabled: false + +Gemspec/RubyVersionGlobalsUsage: + Enabled: false + +Layout/AccessModifierIndentation: + Enabled: true + EnforcedStyle: indent + IndentationWidth: ~ + +Layout/ArgumentAlignment: + Enabled: true + EnforcedStyle: with_fixed_indentation + +Layout/ArrayAlignment: + Enabled: true + EnforcedStyle: with_fixed_indentation + +Layout/AssignmentIndentation: + Enabled: true + IndentationWidth: ~ + +Layout/BeginEndAlignment: + Enabled: true + EnforcedStyleAlignWith: start_of_line + Severity: warning + +Layout/BlockAlignment: + Enabled: true + EnforcedStyleAlignWith: either + +Layout/BlockEndNewline: + Enabled: true + +Layout/CaseIndentation: + Enabled: true + EnforcedStyle: end + +Layout/ClassStructure: + Enabled: false + +Layout/ClosingHeredocIndentation: + Enabled: true + +Layout/ClosingParenthesisIndentation: + Enabled: true + +Layout/CommentIndentation: + Enabled: true + +Layout/ConditionPosition: + Enabled: true + +Layout/DefEndAlignment: + Enabled: true + EnforcedStyleAlignWith: start_of_line + Severity: warning + +Layout/DotPosition: + Enabled: true + EnforcedStyle: leading + +Layout/ElseAlignment: + Enabled: true + +Layout/EmptyComment: + Enabled: true + AllowBorderComment: true + AllowMarginComment: true + +Layout/EmptyLineAfterGuardClause: + Enabled: false + +Layout/EmptyLineAfterMagicComment: + Enabled: true + +Layout/EmptyLineAfterMultilineCondition: + Enabled: false + +Layout/EmptyLineBetweenDefs: + Enabled: true + AllowAdjacentOneLineDefs: false + NumberOfEmptyLines: 1 + +Layout/EmptyLines: + Enabled: true + +Layout/EmptyLinesAroundAccessModifier: + Enabled: true + +Layout/EmptyLinesAroundArguments: + Enabled: true + +Layout/EmptyLinesAroundAttributeAccessor: + Enabled: false + +Layout/EmptyLinesAroundBeginBody: + Enabled: true + +Layout/EmptyLinesAroundBlockBody: + Enabled: true + EnforcedStyle: no_empty_lines + +Layout/EmptyLinesAroundClassBody: + Enabled: true + EnforcedStyle: no_empty_lines + +Layout/EmptyLinesAroundExceptionHandlingKeywords: + Enabled: true + +Layout/EmptyLinesAroundMethodBody: + Enabled: true + +Layout/EmptyLinesAroundModuleBody: + Enabled: true + EnforcedStyle: no_empty_lines + +Layout/EndAlignment: + Enabled: true + EnforcedStyleAlignWith: variable + Severity: warning + +Layout/EndOfLine: + Enabled: true + EnforcedStyle: native + +Layout/ExtraSpacing: + Enabled: true + AllowForAlignment: false + AllowBeforeTrailingComments: true + ForceEqualSignAlignment: false + +Layout/FirstArgumentIndentation: + Enabled: true + EnforcedStyle: consistent + IndentationWidth: ~ + +Layout/FirstArrayElementIndentation: + Enabled: true + EnforcedStyle: consistent + IndentationWidth: ~ + +Layout/FirstArrayElementLineBreak: + Enabled: false + +Layout/FirstHashElementIndentation: + Enabled: true + EnforcedStyle: consistent + IndentationWidth: ~ + +Layout/FirstHashElementLineBreak: + Enabled: false + +Layout/FirstMethodArgumentLineBreak: + Enabled: false + +Layout/FirstMethodParameterLineBreak: + Enabled: false + +Layout/FirstParameterIndentation: + Enabled: false + +Layout/HashAlignment: + Enabled: true + EnforcedHashRocketStyle: key + EnforcedColonStyle: key + EnforcedLastArgumentHashStyle: always_inspect + +Layout/HeredocArgumentClosingParenthesis: + Enabled: false + +Layout/HeredocIndentation: + Enabled: true + +Layout/IndentationConsistency: + Enabled: true + EnforcedStyle: normal + +Layout/IndentationStyle: + Enabled: true + IndentationWidth: ~ + +Layout/IndentationWidth: + Enabled: true + Width: 2 + AllowedPatterns: [] + +Layout/InitialIndentation: + Enabled: true + +Layout/LeadingCommentSpace: + Enabled: true + +Layout/LeadingEmptyLines: + Enabled: true + +Layout/LineContinuationLeadingSpace: + Enabled: false + +Layout/LineContinuationSpacing: + Enabled: true + +Layout/LineEndStringConcatenationIndentation: + Enabled: false + +Layout/LineLength: + Enabled: false + +Layout/MultilineArrayBraceLayout: + Enabled: true + EnforcedStyle: symmetrical + +Layout/MultilineArrayLineBreaks: + Enabled: false + +Layout/MultilineAssignmentLayout: + Enabled: false + +Layout/MultilineBlockLayout: + Enabled: true + +Layout/MultilineHashBraceLayout: + Enabled: true + EnforcedStyle: symmetrical + +Layout/MultilineHashKeyLineBreaks: + Enabled: false + +Layout/MultilineMethodArgumentLineBreaks: + Enabled: false + +Layout/MultilineMethodCallBraceLayout: + Enabled: true + EnforcedStyle: symmetrical + +Layout/MultilineMethodCallIndentation: + Enabled: true + EnforcedStyle: indented + IndentationWidth: ~ + +Layout/MultilineMethodDefinitionBraceLayout: + Enabled: true + EnforcedStyle: symmetrical + +Layout/MultilineMethodParameterLineBreaks: + Enabled: false + +Layout/MultilineOperationIndentation: + Enabled: true + EnforcedStyle: indented + IndentationWidth: ~ + +Layout/ParameterAlignment: + Enabled: true + EnforcedStyle: with_fixed_indentation + IndentationWidth: ~ + +Layout/RedundantLineBreak: + Enabled: false + +Layout/RescueEnsureAlignment: + Enabled: true + +Layout/SingleLineBlockChain: + Enabled: false + +Layout/SpaceAfterColon: + Enabled: true + +Layout/SpaceAfterComma: + Enabled: true + +Layout/SpaceAfterMethodName: + Enabled: true + +Layout/SpaceAfterNot: + Enabled: true + +Layout/SpaceAfterSemicolon: + Enabled: true + +Layout/SpaceAroundBlockParameters: + Enabled: true + EnforcedStyleInsidePipes: no_space + +Layout/SpaceAroundEqualsInParameterDefault: + Enabled: true + EnforcedStyle: space + +Layout/SpaceAroundKeyword: + Enabled: true + +Layout/SpaceAroundMethodCallOperator: + Enabled: true + +Layout/SpaceAroundOperators: + Enabled: true + AllowForAlignment: true + +Layout/SpaceBeforeBlockBraces: + Enabled: true + EnforcedStyle: space + EnforcedStyleForEmptyBraces: space + +Layout/SpaceBeforeBrackets: + Enabled: false + +Layout/SpaceBeforeComma: + Enabled: true + +Layout/SpaceBeforeComment: + Enabled: true + +Layout/SpaceBeforeFirstArg: + Enabled: true + AllowForAlignment: true + +Layout/SpaceBeforeSemicolon: + Enabled: true + +Layout/SpaceInLambdaLiteral: + Enabled: true + EnforcedStyle: require_no_space + +Layout/SpaceInsideArrayLiteralBrackets: + Enabled: true + EnforcedStyle: no_space + EnforcedStyleForEmptyBrackets: no_space + +Layout/SpaceInsideArrayPercentLiteral: + Enabled: true + +Layout/SpaceInsideBlockBraces: + Enabled: true + EnforcedStyle: space + EnforcedStyleForEmptyBraces: no_space + SpaceBeforeBlockParameters: true + +Layout/SpaceInsideHashLiteralBraces: + Enabled: true + EnforcedStyle: no_space + EnforcedStyleForEmptyBraces: no_space + +Layout/SpaceInsideParens: + Enabled: true + EnforcedStyle: no_space + +Layout/SpaceInsidePercentLiteralDelimiters: + Enabled: true + +Layout/SpaceInsideRangeLiteral: + Enabled: true + +Layout/SpaceInsideReferenceBrackets: + Enabled: true + EnforcedStyle: no_space + EnforcedStyleForEmptyBrackets: no_space + +Layout/SpaceInsideStringInterpolation: + Enabled: true + EnforcedStyle: no_space + +Layout/TrailingEmptyLines: + Enabled: true + EnforcedStyle: final_newline + +Layout/TrailingWhitespace: + Enabled: true + AllowInHeredoc: true + +Lint/AmbiguousAssignment: + Enabled: true + +Lint/AmbiguousBlockAssociation: + Enabled: false + +Lint/AmbiguousOperator: + Enabled: true + +Lint/AmbiguousOperatorPrecedence: + Enabled: false + +Lint/AmbiguousRange: + Enabled: false + +Lint/AmbiguousRegexpLiteral: + Enabled: true + +Lint/AssignmentInCondition: + Enabled: true + AllowSafeAssignment: true + # Intentionally disable autocorrect to force us to intentionally decide + # whether assignment is intended as opposed to comparison + AutoCorrect: false + +Lint/BigDecimalNew: + Enabled: true + +Lint/BinaryOperatorWithIdenticalOperands: + Enabled: true + +Lint/BooleanSymbol: + Enabled: true + +Lint/CircularArgumentReference: + Enabled: true + +Lint/ConstantDefinitionInBlock: + Enabled: true + +Lint/ConstantOverwrittenInRescue: + Enabled: true + +Lint/ConstantResolution: + Enabled: false + +Lint/Debugger: + Enabled: true + +Lint/DeprecatedClassMethods: + Enabled: true + +Lint/DeprecatedConstants: + Enabled: true + +Lint/DeprecatedOpenSSLConstant: + Enabled: true + +Lint/DisjunctiveAssignmentInConstructor: + Enabled: false + +Lint/DuplicateBranch: + Enabled: false + +Lint/DuplicateCaseCondition: + Enabled: true + +Lint/DuplicateElsifCondition: + Enabled: true + +Lint/DuplicateHashKey: + Enabled: true + +Lint/DuplicateMagicComment: + Enabled: true + +Lint/DuplicateMatchPattern: + Enabled: false + +Lint/DuplicateMethods: + Enabled: true + +Lint/DuplicateRegexpCharacterClassElement: + Enabled: true + +Lint/DuplicateRequire: + Enabled: true + +Lint/DuplicateRescueException: + Enabled: true + +Lint/EachWithObjectArgument: + Enabled: true + +Lint/ElseLayout: + Enabled: true + +Lint/EmptyBlock: + Enabled: false + +Lint/EmptyClass: + Enabled: false + +Lint/EmptyConditionalBody: + Enabled: false + +Lint/EmptyEnsure: + Enabled: true + +Lint/EmptyExpression: + Enabled: true + +Lint/EmptyFile: + Enabled: false + +Lint/EmptyInPattern: + Enabled: false + +Lint/EmptyInterpolation: + Enabled: true + +Lint/EmptyWhen: + Enabled: true + AllowComments: true + +Lint/EnsureReturn: + Enabled: true + +Lint/ErbNewArguments: + Enabled: true + +Lint/FlipFlop: + Enabled: true + +Lint/FloatComparison: + Enabled: true + +Lint/FloatOutOfRange: + Enabled: true + +Lint/FormatParameterMismatch: + Enabled: true + +Lint/HashCompareByIdentity: + Enabled: false + +Lint/HeredocMethodCallPosition: + Enabled: false + +Lint/IdentityComparison: + Enabled: true + +Lint/ImplicitStringConcatenation: + Enabled: true + +Lint/IncompatibleIoSelectWithFiberScheduler: + Enabled: false + +Lint/IneffectiveAccessModifier: + Enabled: true + +Lint/InheritException: + Enabled: true + EnforcedStyle: runtime_error + +Lint/InterpolationCheck: + Enabled: true + +Lint/ItWithoutArgumentsInBlock: + Enabled: true + +Lint/LambdaWithoutLiteralBlock: + Enabled: false + +Lint/LiteralAsCondition: + Enabled: true + +Lint/LiteralAssignmentInCondition: + Enabled: true + +Lint/LiteralInInterpolation: + Enabled: true + +Lint/Loop: + Enabled: true + +Lint/MissingCopEnableDirective: + Enabled: true + MaximumRangeSize: .inf + +Lint/MissingSuper: + Enabled: false + +Lint/MixedCaseRange: + Enabled: true + +Lint/MixedRegexpCaptureTypes: + Enabled: true + +Lint/MultipleComparison: + Enabled: true + +Lint/NestedMethodDefinition: + Enabled: true + +Lint/NestedPercentLiteral: + Enabled: true + +Lint/NextWithoutAccumulator: + Enabled: true + +Lint/NoReturnInBeginEndBlocks: + Enabled: false + +Lint/NonAtomicFileOperation: + Enabled: false + +Lint/NonDeterministicRequireOrder: + Enabled: true + +Lint/NonLocalExitFromIterator: + Enabled: true + +Lint/NumberConversion: + Enabled: false + +Lint/NumberedParameterAssignment: + Enabled: true + +Lint/OrAssignmentToConstant: + Enabled: true + +Lint/OrderedMagicComments: + Enabled: true + +Lint/OutOfRangeRegexpRef: + Enabled: true + +Lint/ParenthesesAsGroupedExpression: + Enabled: true + +Lint/PercentStringArray: + Enabled: false + +Lint/PercentSymbolArray: + Enabled: true + +Lint/RaiseException: + Enabled: true + +Lint/RandOne: + Enabled: true + +Lint/RedundantCopDisableDirective: + Enabled: false + +Lint/RedundantCopEnableDirective: + Enabled: false + +Lint/RedundantDirGlobSort: + Enabled: false + +Lint/RedundantRegexpQuantifiers: + Enabled: true + +Lint/RedundantRequireStatement: + Enabled: true + +Lint/RedundantSafeNavigation: + Enabled: false + +Lint/RedundantSplatExpansion: + Enabled: true + +Lint/RedundantStringCoercion: + Enabled: true + +Lint/RedundantWithIndex: + Enabled: true + +Lint/RedundantWithObject: + Enabled: true + +Lint/RefinementImportMethods: + Enabled: true + +Lint/RegexpAsCondition: + Enabled: true + +Lint/RequireParentheses: + Enabled: true + +Lint/RequireRangeParentheses: + Enabled: true + +Lint/RequireRelativeSelfPath: + Enabled: true + +Lint/RescueException: + Enabled: true + +Lint/RescueType: + Enabled: true + +Lint/ReturnInVoidContext: + Enabled: true + +Lint/SafeNavigationChain: + Enabled: true + AllowedMethods: + - present? + - blank? + - presence + - try + - try! + +Lint/SafeNavigationConsistency: + Enabled: true + AllowedMethods: + - present? + - blank? + - presence + - try + - try! + +Lint/SafeNavigationWithEmpty: + Enabled: true + +Lint/ScriptPermission: + Enabled: false + +Lint/SelfAssignment: + Enabled: true + +Lint/SendWithMixinArgument: + Enabled: false + +Lint/ShadowedArgument: + Enabled: true + IgnoreImplicitReferences: false + +Lint/ShadowedException: + Enabled: true + +Lint/ShadowingOuterLocalVariable: + Enabled: false + +Lint/StructNewOverride: + Enabled: false + +Lint/SuppressedException: + Enabled: false + +Lint/SymbolConversion: + Enabled: true + +Lint/Syntax: + Enabled: true + +Lint/ToEnumArguments: + Enabled: false + +Lint/ToJSON: + Enabled: false + +Lint/TopLevelReturnWithArgument: + Enabled: true + +Lint/TrailingCommaInAttributeDeclaration: + Enabled: true + +Lint/TripleQuotes: + Enabled: true + +Lint/UnderscorePrefixedVariableName: + Enabled: true + +Lint/UnexpectedBlockArity: + Enabled: false + +Lint/UnifiedInteger: + Enabled: true + +Lint/UnmodifiedReduceAccumulator: + Enabled: false + +Lint/UnreachableCode: + Enabled: true + +Lint/UnreachableLoop: + Enabled: false + +Lint/UnusedBlockArgument: + Enabled: false + +Lint/UnusedMethodArgument: + Enabled: false + +Lint/UriEscapeUnescape: + Enabled: true + +Lint/UriRegexp: + Enabled: true + +Lint/UselessAccessModifier: + Enabled: false + +Lint/UselessAssignment: + Enabled: true + +Lint/UselessElseWithoutRescue: + Enabled: false + +Lint/UselessMethodDefinition: + Enabled: false + +Lint/UselessRescue: + Enabled: true + +Lint/UselessRuby2Keywords: + Enabled: true + +Lint/UselessSetterCall: + Enabled: true + +Lint/UselessTimes: + Enabled: true + +Lint/Void: + Enabled: true + CheckForMethodsWithNoSideEffects: false + +Metrics/AbcSize: + Enabled: false + +Metrics/BlockLength: + Enabled: false + +Metrics/BlockNesting: + Enabled: false + +Metrics/ClassLength: + Enabled: false + +Metrics/CollectionLiteralLength: + Enabled: false + +Metrics/CyclomaticComplexity: + Enabled: false + +Metrics/MethodLength: + Enabled: false + +Metrics/ModuleLength: + Enabled: false + +Metrics/ParameterLists: + Enabled: false + +Metrics/PerceivedComplexity: + Enabled: false + +Migration/DepartmentName: + Enabled: true + +Naming/AccessorMethodName: + Enabled: false + +Naming/AsciiIdentifiers: + Enabled: false + +Naming/BinaryOperatorParameterName: + Enabled: true + +Naming/BlockForwarding: + Enabled: false + +Naming/BlockParameterName: + Enabled: true + MinNameLength: 1 + AllowNamesEndingInNumbers: true + AllowedNames: [] + ForbiddenNames: [] + +Naming/ClassAndModuleCamelCase: + Enabled: true + +Naming/ConstantName: + Enabled: true + +Naming/FileName: + Enabled: false + +Naming/HeredocDelimiterCase: + Enabled: true + EnforcedStyle: uppercase + +Naming/HeredocDelimiterNaming: + Enabled: false + +Naming/InclusiveLanguage: + Enabled: false + +Naming/MemoizedInstanceVariableName: + Enabled: false + +Naming/MethodName: + Enabled: false + +Naming/MethodParameterName: + Enabled: false + +Naming/PredicateName: + Enabled: false + +Naming/RescuedExceptionsVariableName: + Enabled: false + +Naming/VariableName: + Enabled: true + EnforcedStyle: snake_case + +Naming/VariableNumber: + Enabled: false + +Security/CompoundHash: + Enabled: true + +Security/Eval: + Enabled: true + +Security/IoMethods: + Enabled: false + +Security/JSONLoad: + Enabled: true + +Security/MarshalLoad: + Enabled: false + +Security/Open: + Enabled: true + +Security/YAMLLoad: + Enabled: true + +Style/AccessModifierDeclarations: + Enabled: false + +Style/AccessorGrouping: + Enabled: false + +Style/Alias: + Enabled: true + EnforcedStyle: prefer_alias_method + +Style/AndOr: + Enabled: true + +Style/ArgumentsForwarding: + Enabled: true + +Style/ArrayCoercion: + Enabled: false + +Style/ArrayFirstLast: + Enabled: false + +Style/ArrayIntersect: + Enabled: false + +Style/ArrayJoin: + Enabled: true + +Style/AsciiComments: + Enabled: false + +Style/Attr: + Enabled: true + +Style/AutoResourceCleanup: + Enabled: false + +Style/BarePercentLiterals: + Enabled: true + EnforcedStyle: bare_percent + +Style/BeginBlock: + Enabled: true + +Style/BisectedAttrAccessor: + Enabled: false + +Style/BlockComments: + Enabled: true + +Style/BlockDelimiters: + Enabled: false + +Style/CaseEquality: + Enabled: false + +Style/CaseLikeIf: + Enabled: false + +Style/CharacterLiteral: + Enabled: true + +Style/ClassAndModuleChildren: + Enabled: false + +Style/ClassCheck: + Enabled: true + EnforcedStyle: is_a? + +Style/ClassEqualityComparison: + Enabled: true + +Style/ClassMethods: + Enabled: true + +Style/ClassMethodsDefinitions: + Enabled: false + +Style/ClassVars: + Enabled: false + +Style/CollectionCompact: + Enabled: false + +Style/CollectionMethods: + Enabled: false + +Style/ColonMethodCall: + Enabled: true + +Style/ColonMethodDefinition: + Enabled: true + +Style/CombinableLoops: + Enabled: false + +Style/CommandLiteral: + Enabled: true + EnforcedStyle: mixed + AllowInnerBackticks: false + +Style/CommentAnnotation: + Enabled: false + +Style/CommentedKeyword: + Enabled: false + +Style/ComparableClamp: + Enabled: true + +Style/ConcatArrayLiterals: + Enabled: false + +Style/ConditionalAssignment: + Enabled: true + EnforcedStyle: assign_to_condition + SingleLineConditionsOnly: true + IncludeTernaryExpressions: true + +Style/ConstantVisibility: + Enabled: false + +Style/Copyright: + Enabled: false + +Style/DataInheritance: + Enabled: false + +Style/DateTime: + Enabled: false + +Style/DefWithParentheses: + Enabled: true + +Style/Dir: + Enabled: true + +Style/DirEmpty: + Enabled: true + +Style/DisableCopsWithinSourceCodeDirective: + Enabled: false + +Style/DocumentDynamicEvalDefinition: + Enabled: false + +Style/Documentation: + Enabled: false + +Style/DocumentationMethod: + Enabled: false + +Style/DoubleCopDisableDirective: + Enabled: false + +Style/DoubleNegation: + Enabled: false + +Style/EachForSimpleLoop: + Enabled: true + +Style/EachWithObject: + Enabled: true + +Style/EmptyBlockParameter: + Enabled: true + +Style/EmptyCaseCondition: + Enabled: true + +Style/EmptyElse: + Enabled: true + AllowComments: true + EnforcedStyle: both + +Style/EmptyHeredoc: + Enabled: false + +Style/EmptyLambdaParameter: + Enabled: true + +Style/EmptyLiteral: + Enabled: true + +Style/EmptyMethod: + Enabled: true + EnforcedStyle: expanded + +Style/Encoding: + Enabled: true + +Style/EndBlock: + Enabled: true + +Style/EndlessMethod: + Enabled: false + +Style/EnvHome: + Enabled: false + +Style/EvalWithLocation: + Enabled: true + +Style/EvenOdd: + Enabled: false + +Style/ExactRegexpMatch: + Enabled: true +Style/ExpandPathArguments: + Enabled: false + +Style/ExplicitBlockArgument: + Enabled: false + +Style/ExponentialNotation: + Enabled: false + +Style/FetchEnvVar: + Enabled: false + +Style/FileEmpty: + Enabled: false + +Style/FileRead: + Enabled: true + +Style/FileWrite: + Enabled: true + +Style/FloatDivision: + Enabled: false + +Style/For: + Enabled: true + EnforcedStyle: each + +Style/FormatString: + Enabled: false + +Style/FormatStringToken: + Enabled: false + +Style/FrozenStringLiteralComment: + Enabled: false + +Style/GlobalStdStream: + Enabled: true + +Style/GlobalVars: + Enabled: true + AllowedVariables: [] + +Style/GuardClause: + Enabled: false + +Style/HashAsLastArrayItem: + Enabled: false + +Style/HashConversion: + Enabled: true + +Style/HashEachMethods: + Enabled: false + +Style/HashExcept: + Enabled: true + +Style/HashLikeCase: + Enabled: false + +Style/HashSyntax: + Enabled: true + EnforcedStyle: ruby19_no_mixed_keys + EnforcedShorthandSyntax: either + +Style/HashTransformKeys: + Enabled: false + +Style/HashTransformValues: + Enabled: false + +Style/IdenticalConditionalBranches: + Enabled: true + +Style/IfInsideElse: + Enabled: true + +Style/IfUnlessModifier: + Enabled: false + +Style/IfUnlessModifierOfIfUnless: + Enabled: true + +Style/IfWithBooleanLiteralBranches: + Enabled: true + +Style/IfWithSemicolon: + Enabled: true + +Style/ImplicitRuntimeError: + Enabled: false + +Style/InPatternThen: + Enabled: false + +Style/InfiniteLoop: + Enabled: true + +Style/InlineComment: + Enabled: false + +Style/InverseMethods: + Enabled: false + +Style/InvertibleUnlessCondition: + Enabled: false + +Style/IpAddresses: + Enabled: false + +Style/KeywordParametersOrder: + Enabled: true + +Style/Lambda: + Enabled: false + +Style/LambdaCall: + Enabled: true + EnforcedStyle: call + +Style/LineEndConcatenation: + Enabled: true + +Style/MagicCommentFormat: + Enabled: false + +Style/MapCompactWithConditionalBlock: + Enabled: true + +Style/MapIntoArray: + Enabled: false + +Style/MapToHash: + Enabled: false + +Style/MapToSet: + Enabled: false + +Style/MethodCallWithArgsParentheses: + Enabled: false + +Style/MethodCallWithoutArgsParentheses: + Enabled: true + AllowedMethods: [] + +Style/MethodCalledOnDoEndBlock: + Enabled: false + +Style/MethodDefParentheses: + Enabled: false + +Style/MinMax: + Enabled: false + +Style/MinMaxComparison: + Enabled: false + +Style/MissingElse: + Enabled: false + +Style/MissingRespondToMissing: + Enabled: true + +Style/MixinGrouping: + Enabled: true + EnforcedStyle: separated + +Style/MixinUsage: + Enabled: true + +Style/ModuleFunction: + Enabled: false + +Style/MultilineBlockChain: + Enabled: false + +Style/MultilineIfModifier: + Enabled: true + +Style/MultilineIfThen: + Enabled: true + +Style/MultilineInPatternThen: + Enabled: false + +Style/MultilineMemoization: + Enabled: true + EnforcedStyle: keyword + +Style/MultilineMethodSignature: + Enabled: false + +Style/MultilineTernaryOperator: + Enabled: false + +Style/MultilineWhenThen: + Enabled: true + +Style/MultipleComparison: + Enabled: false + +Style/MutableConstant: + Enabled: false + +Style/NegatedIf: + Enabled: false + +Style/NegatedIfElseCondition: + Enabled: false + +Style/NegatedUnless: + Enabled: false + +Style/NegatedWhile: + Enabled: true + +Style/NestedFileDirname: + Enabled: true + +Style/NestedModifier: + Enabled: true + +Style/NestedParenthesizedCalls: + Enabled: true + AllowedMethods: + - be + - be_a + - be_an + - be_between + - be_falsey + - be_kind_of + - be_instance_of + - be_truthy + - be_within + - eq + - eql + - end_with + - include + - match + - raise_error + - respond_to + - start_with + +Style/NestedTernaryOperator: + Enabled: true + +Style/Next: + Enabled: false + +Style/NilComparison: + Enabled: true + EnforcedStyle: predicate + +Style/NilLambda: + Enabled: true + +Style/NonNilCheck: + Enabled: true + IncludeSemanticChanges: false + +Style/Not: + Enabled: true + +Style/NumberedParameters: + Enabled: false + +Style/NumberedParametersLimit: + Enabled: false + +Style/NumericLiteralPrefix: + Enabled: true + EnforcedOctalStyle: zero_with_o + +Style/NumericLiterals: + Enabled: false + +Style/NumericPredicate: + Enabled: false + +Style/ObjectThen: + Enabled: false + +Style/OneLineConditional: + Enabled: true + +Style/OpenStructUse: + Enabled: false + +Style/OperatorMethodCall: + Enabled: false + +Style/OptionHash: + Enabled: false + +Style/OptionalArguments: + Enabled: true + +Style/OptionalBooleanParameter: + Enabled: false + +Style/OrAssignment: + Enabled: true + +Style/ParallelAssignment: + Enabled: false + +Style/ParenthesesAroundCondition: + Enabled: true + AllowSafeAssignment: true + AllowInMultilineConditions: false + +Style/PercentLiteralDelimiters: + Enabled: true + PreferredDelimiters: + default: () + '%i': '[]' + '%I': '[]' + '%r': '{}' + '%w': '[]' + '%W': '[]' + +Style/PercentQLiterals: + Enabled: false + +Style/PerlBackrefs: + Enabled: false + +Style/PreferredHashMethods: + Enabled: false + +Style/Proc: + Enabled: true + +Style/QuotedSymbols: + Enabled: true + EnforcedStyle: same_as_string_literals + +Style/RaiseArgs: + Enabled: false + +Style/RandomWithOffset: + Enabled: true + +Style/RedundantArgument: + Enabled: false + +Style/RedundantArrayConstructor: + Enabled: true + +Style/RedundantAssignment: + Enabled: true + +Style/RedundantBegin: + Enabled: true + +Style/RedundantCapitalW: + Enabled: false + +Style/RedundantCondition: + Enabled: true + +Style/RedundantConditional: + Enabled: true + +Style/RedundantConstantBase: + Enabled: false + +Style/RedundantCurrentDirectoryInPath: + Enabled: true + +Style/RedundantDoubleSplatHashBraces: + Enabled: true + +Style/RedundantEach: + Enabled: false + +Style/RedundantException: + Enabled: true + +Style/RedundantFetchBlock: + Enabled: false + +Style/RedundantFileExtensionInRequire: + Enabled: true + +Style/RedundantFilterChain: + Enabled: false + +Style/RedundantFreeze: + Enabled: true + +Style/RedundantHeredocDelimiterQuotes: + Enabled: true + +Style/RedundantInitialize: + Enabled: false + +Style/RedundantInterpolation: + Enabled: true + +Style/RedundantLineContinuation: + Enabled: true + +Style/RedundantParentheses: + Enabled: true + +Style/RedundantPercentQ: + Enabled: true + +Style/RedundantRegexpArgument: + Enabled: true + +Style/RedundantRegexpCharacterClass: + Enabled: true + +Style/RedundantRegexpConstructor: + Enabled: true + +Style/RedundantRegexpEscape: + Enabled: true + +Style/RedundantReturn: + Enabled: true + AllowMultipleReturnValues: false + +Style/RedundantSelf: + Enabled: true + +Style/RedundantSelfAssignment: + Enabled: false + +Style/RedundantSelfAssignmentBranch: + Enabled: false + +Style/RedundantSort: + Enabled: true + +Style/RedundantSortBy: + Enabled: true + +Style/RedundantStringEscape: + Enabled: true + +Style/RegexpLiteral: + Enabled: false + +Style/RequireOrder: + Enabled: false + +Style/RescueModifier: + Enabled: true + +Style/RescueStandardError: + Enabled: true + EnforcedStyle: implicit + +Style/ReturnNil: + Enabled: false + +Style/ReturnNilInPredicateMethodDefinition: + Enabled: false + +Style/SafeNavigation: + Enabled: true + ConvertCodeThatCanStartToReturnNil: false + AllowedMethods: + - present? + - blank? + - presence + - try + - try! + +Style/Sample: + Enabled: true + +Style/SelectByRegexp: + Enabled: false + +Style/SelfAssignment: + Enabled: true + +Style/Semicolon: + Enabled: true + AllowAsExpressionSeparator: false + +Style/Send: + Enabled: false + +Style/SignalException: + Enabled: false + +Style/SingleArgumentDig: + Enabled: false + +Style/SingleLineBlockParams: + Enabled: false + +Style/SingleLineDoEndBlock: + Enabled: false + +Style/SingleLineMethods: + Enabled: true + AllowIfMethodIsEmpty: false + +Style/SlicingWithRange: + Enabled: true + +Style/SoleNestedConditional: + Enabled: false + +Style/SpecialGlobalVars: + Enabled: false + +Style/StabbyLambdaParentheses: + Enabled: true + EnforcedStyle: require_parentheses + +Style/StaticClass: + Enabled: false + +Style/StderrPuts: + Enabled: true + +Style/StringChars: + Enabled: true + +Style/StringConcatenation: + Enabled: false + +Style/StringHashKeys: + Enabled: false + +Style/StringLiterals: + Enabled: true + EnforcedStyle: double_quotes + ConsistentQuotesInMultiline: false + +Style/StringLiteralsInInterpolation: + Enabled: true + EnforcedStyle: double_quotes + +Style/StringMethods: + Enabled: false + +Style/Strip: + Enabled: true + +Style/StructInheritance: + Enabled: false + +Style/SuperWithArgsParentheses: + Enabled: true + +Style/SwapValues: + Enabled: false + +Style/SymbolArray: + Enabled: false + +Style/SymbolLiteral: + Enabled: true + +Style/SymbolProc: + Enabled: false + +Style/TernaryParentheses: + Enabled: true + EnforcedStyle: require_parentheses_when_complex + AllowSafeAssignment: true + +Style/TopLevelMethodDefinition: + Enabled: false + +Style/TrailingBodyOnClass: + Enabled: true + +Style/TrailingBodyOnMethodDefinition: + Enabled: true + +Style/TrailingBodyOnModule: + Enabled: true + +Style/TrailingCommaInArguments: + Enabled: true + EnforcedStyleForMultiline: no_comma + +Style/TrailingCommaInArrayLiteral: + Enabled: true + EnforcedStyleForMultiline: no_comma + +Style/TrailingCommaInBlockArgs: + Enabled: true + +Style/TrailingCommaInHashLiteral: + Enabled: true + EnforcedStyleForMultiline: no_comma + +Style/TrailingMethodEndStatement: + Enabled: true + +Style/TrailingUnderscoreVariable: + Enabled: false + +Style/TrivialAccessors: + Enabled: true + ExactNameMatch: true + AllowPredicates: true + AllowDSLWriters: false + IgnoreClassMethods: true + AllowedMethods: + - to_ary + - to_a + - to_c + - to_enum + - to_h + - to_hash + - to_i + - to_int + - to_io + - to_open + - to_path + - to_proc + - to_r + - to_regexp + - to_str + - to_s + - to_sym + +Style/UnlessElse: + Enabled: true + +Style/UnlessLogicalOperators: + Enabled: true + EnforcedStyle: forbid_mixed_logical_operators + +Style/UnpackFirst: + Enabled: true + +Style/VariableInterpolation: + Enabled: true + +Style/WhenThen: + Enabled: true + +Style/WhileUntilDo: + Enabled: true + +Style/WhileUntilModifier: + Enabled: false + +Style/WordArray: + Enabled: false + +Style/YAMLFileRead: + Enabled: true + +Style/YodaCondition: + Enabled: true + EnforcedStyle: forbid_for_all_comparison_operators + +Style/YodaExpression: + Enabled: false + +Style/ZeroLengthPredicate: + Enabled: false diff --git a/Gemfile b/Gemfile index 34cf9b0..c600b38 100644 --- a/Gemfile +++ b/Gemfile @@ -12,12 +12,13 @@ gem "stimulus-rails", "~> 1.3", ">= 1.3.3" gem "turbo-rails", "~> 2.0", ">= 2.0.5" gem "tzinfo-data", "~> 1.2024", ">= 1.2024.1", platforms: %i[windows jruby] gem "vite_rails", "~> 3.0", ">= 3.0.17" +gem "phlex-rails", "~> 1.2" group :development, :test do gem "debug", "~> 1.9", ">= 1.9.2", platforms: %i[mri windows] gem "dotenv", "~> 3.1", ">= 3.1.2" gem "factory_bot_rails", "~> 6.4", ">= 6.4.3" - gem "rubocop-rails-omakase", "~> 1.0", require: false, group: [ :development ] + gem "rubocop-rails-omakase", "~> 1.0", require: false, group: [:development] gem "minitest-reporters", "~> 1.6", ">= 1.6.1" end diff --git a/Gemfile.lock b/Gemfile.lock index 2259673..93a3914 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -191,6 +191,10 @@ GEM ast (~> 2.4.1) racc pg (1.5.6) + phlex (1.10.2) + phlex-rails (1.2.1) + phlex (~> 1.10.0) + railties (>= 6.1, < 8) psych (5.1.2) stringio public_suffix (5.0.5) @@ -336,6 +340,7 @@ DEPENDENCIES letter_opener (~> 1.10) minitest-reporters (~> 1.6, >= 1.6.1) pg (~> 1.5, >= 1.5.6) + phlex-rails (~> 1.2) puma (~> 6.4, >= 6.4.2) rails (~> 7.1, >= 7.1.3.2) rubocop (~> 1.63, >= 1.63.5) diff --git a/app/helpers/inline_svg_helper.rb b/app/helpers/inline_svg_helper.rb index 2977d75..0e30278 100644 --- a/app/helpers/inline_svg_helper.rb +++ b/app/helpers/inline_svg_helper.rb @@ -2,7 +2,7 @@ module InlineSvgHelper def inline_svg_tag(filename, title: nil) svg = ViteInlineSvgFileLoader.named(filename) svg = svg.sub(/\A/, safe_join([ '\0', "\n", tag.title(title) ])) if title.present? + svg = svg.sub(/\A/, safe_join(['\0', "\n", tag.title(title)])) if title.present? svg.strip.html_safe # rubocop:disable Rails/OutputSafety end diff --git a/app/views/application_view.rb b/app/views/application_view.rb new file mode 100644 index 0000000..d55b3fb --- /dev/null +++ b/app/views/application_view.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class ApplicationView < ApplicationComponent + # The ApplicationView is an abstract class for all your views. + + # By default, it inherits from `ApplicationComponent`, but you + # can change that to `Phlex::HTML` if you want to keep views and + # components independent. +end diff --git a/app/views/components/application_component.rb b/app/views/components/application_component.rb new file mode 100644 index 0000000..1a147db --- /dev/null +++ b/app/views/components/application_component.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +class ApplicationComponent < Phlex::HTML + include Phlex::Rails::Helpers::Routes + + if Rails.env.development? + def before_template + comment { "Before #{self.class.name}" } + super + end + end +end diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index c70d89a..54274a6 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -1,11 +1,11 @@ <% provide(:title, "Home") %> -
-
+
+
<%= vite_image_tag("images/logo-sm.png", class: "h-12 w-12 rounded-full") %>

Shore

-

An opinionated and modern Ruby on Rails template with pragmatic defaults to start your next project 🚀

+

An opinionated and modern Ruby on Rails template with pragmatic defaults to start your next project 🚀

Stimulus says, Stimulus not loaded 😥 diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index e24b699..43cfaca 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -7,7 +7,7 @@ <%= csrf_meta_tags %> <%= csp_meta_tag %> <%= vite_client_tag %> - <%= vite_javascript_tag "application", data: {"turbo-track": "reload"} %> + <%= vite_javascript_tag "application" %> <%= vite_stylesheet_tag "application", data: {"turbo-track": "reload"} %> diff --git a/app/views/layouts/application_layout.rb b/app/views/layouts/application_layout.rb new file mode 100644 index 0000000..ad6006e --- /dev/null +++ b/app/views/layouts/application_layout.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +class ApplicationLayout < ApplicationView + include Phlex::Rails::Layout + + def view_template(&block) + doctype + + html do + head do + title { "You're awesome" } + meta name: "viewport", content: "width=device-width,initial-scale=1" + csp_meta_tag + csrf_meta_tags + stylesheet_link_tag "application", data_turbo_track: "reload" + javascript_importmap_tags + end + + body do + main(&block) + end + end + end +end diff --git a/bin/configure b/bin/configure deleted file mode 100644 index 7f7f9d3..0000000 --- a/bin/configure +++ /dev/null @@ -1,243 +0,0 @@ -#!/usr/bin/env ruby - -puts "" -puts `gem install colorize` -puts "" - -puts "" -puts `gem install activesupport` -puts "" - -require 'colorize' -require 'active_support' - -def replace_in_file(file, before, after, target_regexp = nil) - puts "Replacing in '#{file}'." - if target_regexp - target_file_content = "" - File.open(file).each_line do |l| - l.gsub!(before, after) if !!l.match(target_regexp) - l if !!l.match(target_regexp) - target_file_content += l - end - else - target_file_content = File.open(file).read - target_file_content.gsub!(before, after) - end - File.open(file, "w+") do |f| - f.write(target_file_content) - end -end - -def stream(command, prefix = " ") - puts "" - IO.popen(command) do |io| - while (line = io.gets) do - puts "#{prefix}#{line}" - end - end - puts "" -end - -def ask(string) - puts string.blue - return gets.strip -end - -def not_installed?(package) - `brew info #{package} | grep "Not installed"`.strip.length > 0 -end - -def check_package(package) - if not_installed?(package) - puts "#{package} is not installed via Homebrew. Try running `brew install #{package}`.".red - input = ask "Try proceeding without #{package}? [y/n]" - if input.downcase[0] == "n" - exit - end - else - puts "#{package} is installed via Homebrew.".green - end -end - -# Unless the shell's current version of Ruby is the same as what the application requires, we should flag it. -# rbenv produces strings like "3.1.2" while rvm produces ones like "ruby-3.1.2", so we account for that here. -required_ruby = `cat ./.ruby-version`.strip.gsub(/^ruby-/, "") -actual_ruby = `ruby -v`.strip -message = "Shore requires Ruby #{required_ruby} and `ruby -v` returns #{actual_ruby}." -if actual_ruby.include?(required_ruby) - puts message.green -else - puts message.red - input = ask "Try proceeding with with Ruby #{actual_ruby} anyway? [y/n]" - if input.downcase[0] == "n" - exit - end -end - -if `brew info 2> /dev/null`.length > 0 - puts "Homebrew is installed.".green -else - puts "You don't have Homebrew installed. This isn't necessarily a problem, you might not even be on macOS, but we can't check your dependencies without it.".red - input = ask "Try proceeding without Homebrew? [y/n]" - if input.downcase[0] == "n" - exit - end -end - -case Gem::Platform.local.os -when "darwin" - check_package("postgresql@16") -when "linux" - system_packages = `dpkg -l | grep '^ii'`.split("\n").map do |package_information| - package_information.split("\s")[1] - end - - psql_installed = system_packages.include?("postgresql") - if psql_installed - psql_version = `psql --version`.split("\s")[2] - if psql_version.match?(/^16/) - puts "You have PostgreSQL 16 installed.".green - else - puts "You have PostgreSQL installed, but you're using v#{psql_version} and not v16.".red - input = ask "Try proceeding without PostgreSQL 16? [y/n]" - if input.downcase[0] == "n" - exit - end - end - else - puts "You don't have PostgreSQL installed. Please see the installation instructions at https://ubuntu.com/server/docs/databases-postgresql".red - exit - end -else - puts "We currently don't support this platform to check if you have the following libraries installed:".red - puts "1. PostgreSQL" - puts "" - puts "Please ensure they are installed before proceeding." - input = ask "Proceed? [y/n]" - if input.downcase[0] == "n" - exit - end -end - -if `bun -v 2> /dev/null`.length > 0 - puts "Bun is installed.".green -else - puts "You don't have Yarn installed. We can't proceed without it. Try `brew install oven-sh/bun/bun` or see the installation instructions at https://bun.sh/docs/installation".red - exit -end - -puts "Next, let's push your application to GitHub." -puts "If you would like to use another service like Gitlab to manage your repository," -puts "you can opt out of this step and set up the repository manually." -puts "(If you're not sure, we suggest going with GitHub)" -skip_github = ask "Continue setting up with GitHub? [y/n]" -if skip_github.downcase[0] == "y" - if `git remote | grep shore`.strip.length > 0 - puts "Repository already has a \`shore`\ remote.".yellow - else - if `git remote | grep origin`.strip.length > 0 - puts "Renaming repository `origin` remote to `shore`.".green - `git remote rename origin shore` - else - puts "Repository has no `origin` remote, but also no `bullet-train` remote. Did something go wrong?".red - end - end - - if `git remote | grep origin`.strip.length > 0 - puts "Repository already has a \`origin`\ remote.".yellow - else - ask "Hit and we'll open a browser to GitHub where you can create a new repository. When you're done, copy the SSH path from the new repository and return here. We'll ask you to paste it to us in the next step." - command = if Gem::Platform.local.os == "linux" - "xdg-open" - else - "open" - end - `#{command} https://github.com/new` - - ssh_path = ask "OK, what was the SSH path? (It should look like `git@github.com:your-account/your-new-repo.git`.)" - while ssh_path == "" - puts "You must provide a path for your new repository.".red - ssh_path = ask "What was the SSH path? (It should look like `git@github.com:your-account/your-new-repo.git`.)" - end - puts "Setting repository's `origin` remote to `#{ssh_path}`.".green - puts `git remote add origin #{ssh_path}`.chomp - end - - local_branch = `git branch | grep "*"`.split.last - - puts "Pushing repository to `origin`.".green - stream "git push origin #{local_branch}:main 2>&1" -end - -puts "Running `bundle install`.".green -stream "bundle install" - -puts "Running `yarn install`.".green -stream "bun install" - -human = ask "What is the name of your new application in title case? (e.g. \"Some Great Application\")" -while human == "" - puts "You must provide a name for your application.".red - human = ask "What is the name of your new application in title case? (e.g. \"Some Great Application\")" -end - -require "active_support/inflector" - -variable = ActiveSupport::Inflector.parameterize(human.gsub("-", " "), separator: '_') -environment_variable = ActiveSupport::Inflector.parameterize(human.gsub("-", " "), separator: '_').upcase -class_name = variable.classify -kebab_case = variable.tr("_", "-") -connected_name = variable.gsub("_", "") # i.e. `bullettrain` as opposed to `bullet_train` - -puts "" -puts "Replacing instances of \"Shore\" with \"#{human}\" throughout the codebase.".green -replace_in_file("./.circleci/config.yml", "untitled_application", variable) -replace_in_file("./config/application.rb", "untitled_application", connected_name) -replace_in_file("./config/database.yml", "untitled_application", variable) -replace_in_file("./config/database.yml", "UNTITLED_APPLICATION", environment_variable) -replace_in_file("./config/cable.yml", "untitled_application", variable) -replace_in_file("./config/initializers/session_store.rb", "untitled_application", variable) -replace_in_file("./config/environments/production.rb", "untitled_application", variable) -replace_in_file("./config/application.rb", "UntitledApplication", class_name) -replace_in_file("./config/locales/en/application.en.yml", "Untitled Application", human, /name/) -replace_in_file("./config/locales/en/application.en.yml", "untitled_application", variable) -replace_in_file("./config/locales/en/application.en.yml", "untitled application", human.downcase, /keywords/) -replace_in_file("./config/locales/en/user_mailer.en.yml", "Untitled Application", human) -replace_in_file("./zapier/package.json", "untitled-application", kebab_case) -replace_in_file("./zapier/package.json", "Untitled Application", human) -replace_in_file("./app/views/api/v1/open_api/index.yaml.erb", "Untitled Application", human) -replace_in_file("./app.json", "Untitled Application", human) -replace_in_file("./.redocly.yaml", "untitled_application", variable) - -puts "" - -unless skip_github - original_repo_link = "https://github.com/bullet-train-co/bullet_train" - new_repo_link = ask "What is the link to your repository? We will use this to enable the one-click deploy to Render button for your application." - replace_in_file("README.example.md", original_repo_link, new_repo_link, /repo=#{original_repo_link}/) -end - -puts "Moving `./README.example.md` to `./README.md`.".green -puts `mv ./README.example.md ./README.md`.chomp - -puts `rm .github/FUNDING.yml`.chomp - -# We can only do this after the README is moved into place. -replace_in_file("./README.md", "Untitled Application", human) - -if skip_github - puts "" - puts "Make sure you save your changes with Git.".yellow -else - puts "Committing all these changes to the repository.".green - stream "git add -A" - stream "git commit -m \"Run configuration script.\"" - stream "git push origin #{local_branch}:main" -end - -puts "" -puts "OK, we're done, but at some point you should edit `config/locales/en/application.en.yml`!".yellow -puts "" -puts "Next you can run `bin/setup`, then `bin/dev` to spawn a local instance, and then you can navigate to http://localhost:3000 to access your new application.".green -puts "" diff --git a/bin/rename_project b/bin/rename_project index ed9ff08..db6f850 100755 --- a/bin/rename_project +++ b/bin/rename_project @@ -10,7 +10,7 @@ def gsub_in_file(path, from, to) end def underscore(string) - string.gsub(/::/, '/') + string.gsub("::", "/") .gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2') .gsub(/([a-z\d])([A-Z])/, '\1_\2') .tr("-", "_") @@ -38,4 +38,4 @@ gsub_in_file("config/database.yml", /shore/, new_snake_name) gsub_in_file("docker-compose.yml", /shore/, new_snake_name) puts "Renamed the project to #{new_name}." -puts "Check the changes using git diff" \ No newline at end of file +puts "Check the changes using git diff" diff --git a/bin/setup b/bin/setup index 48ec0a1..df1d46c 100755 --- a/bin/setup +++ b/bin/setup @@ -5,7 +5,7 @@ require "fileutils" begin Gem::Specification.find_by_name("colorize") -rescue LoadError => e +rescue LoadError puts "Installing colorize gem" system("gem install colorize") end @@ -23,8 +23,7 @@ end # Check if a command exists def command?(name) [name, - *ENV['PATH'].split(File::PATH_SEPARATOR).map {|p| File.join(p, name)} - ].find {|f| File.executable?(f)} + *ENV["PATH"].split(File::PATH_SEPARATOR).map { |p| File.join(p, name) }].find { |f| File.executable?(f) } end FileUtils.chdir APP_ROOT do @@ -58,7 +57,7 @@ FileUtils.chdir APP_ROOT do system!("bin/rails tmp:create") puts "tmp/pids directory created".green end - + puts "\n== Removing old logs and tempfiles ==" system! "bin/rails log:clear tmp:clear" puts "Old logs and tempfiles removed".green diff --git a/config/application.rb b/config/application.rb index 4193551..350b7d7 100644 --- a/config/application.rb +++ b/config/application.rb @@ -8,6 +8,9 @@ module Shore class Application < Rails::Application + config.autoload_paths << "#{root}/app/views" + config.autoload_paths << "#{root}/app/views/layouts" + config.autoload_paths << "#{root}/app/views/components" # Prevents Rails from trying to eager-load the contents of app/frontend config.javascript_path = "frontend" diff --git a/config/environments/development.rb b/config/environments/development.rb index 61b4bbf..397bfa5 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -40,7 +40,7 @@ config.action_mailer.raise_delivery_errors = false config.action_mailer.delivery_method = :letter_opener - config.action_mailer.default_url_options = { host: "localhost:3000" } + config.action_mailer.default_url_options = {host: "localhost:3000"} config.action_mailer.asset_host = "http://localhost:3000" config.action_mailer.perform_caching = false diff --git a/config/environments/production.rb b/config/environments/production.rb index f42560a..f87fa21 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -51,7 +51,7 @@ .then { |logger| ActiveSupport::TaggedLogging.new(logger) } # Prepend all log lines with the following tags. - config.log_tags = [ :request_id ] + config.log_tags = [:request_id] # "info" includes generic and useful information about system operation, but avoids logging too much # information to avoid inadvertent exposure of personally identifiable information (PII). If you diff --git a/config/environments/test.rb b/config/environments/test.rb index 9c3403e..8607ff2 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -43,7 +43,7 @@ # The :test delivery method accumulates sent emails in the # ActionMailer::Base.deliveries array. config.action_mailer.delivery_method = :test - config.action_mailer.default_url_options = { host: "localhost:3000" } + config.action_mailer.default_url_options = {host: "localhost:3000"} config.action_mailer.asset_host = "http://localhost:3000" # Print deprecation notices to the stderr. diff --git a/db/migrate/20240419132659_create_solid_queue_tables.solid_queue.rb b/db/migrate/20240419132659_create_solid_queue_tables.solid_queue.rb index 42baa57..f66cd00 100644 --- a/db/migrate/20240419132659_create_solid_queue_tables.solid_queue.rb +++ b/db/migrate/20240419132659_create_solid_queue_tables.solid_queue.rb @@ -13,42 +13,42 @@ def change t.timestamps - t.index [ :queue_name, :finished_at ], name: "index_solid_queue_jobs_for_filtering" - t.index [ :scheduled_at, :finished_at ], name: "index_solid_queue_jobs_for_alerting" + t.index [:queue_name, :finished_at], name: "index_solid_queue_jobs_for_filtering" + t.index [:scheduled_at, :finished_at], name: "index_solid_queue_jobs_for_alerting" end create_table :solid_queue_scheduled_executions, id: :uuid do |t| - t.references :job, type: :uuid, index: { unique: true }, null: false + t.references :job, type: :uuid, index: {unique: true}, null: false t.string :queue_name, null: false t.integer :priority, default: 0, null: false t.datetime :scheduled_at, null: false t.datetime :created_at, null: false - t.index [ :scheduled_at, :priority, :job_id ], name: "index_solid_queue_dispatch_all" + t.index [:scheduled_at, :priority, :job_id], name: "index_solid_queue_dispatch_all" end create_table :solid_queue_ready_executions, id: :uuid do |t| - t.references :job, type: :uuid, index: { unique: true }, null: false + t.references :job, type: :uuid, index: {unique: true}, null: false t.string :queue_name, null: false t.integer :priority, default: 0, null: false t.datetime :created_at, null: false - t.index [ :priority, :job_id ], name: "index_solid_queue_poll_all" - t.index [ :queue_name, :priority, :job_id ], name: "index_solid_queue_poll_by_queue" + t.index [:priority, :job_id], name: "index_solid_queue_poll_all" + t.index [:queue_name, :priority, :job_id], name: "index_solid_queue_poll_by_queue" end create_table :solid_queue_claimed_executions, id: :uuid do |t| - t.references :job, type: :uuid, index: { unique: true }, null: false + t.references :job, type: :uuid, index: {unique: true}, null: false t.bigint :process_id t.datetime :created_at, null: false - t.index [ :process_id, :job_id ] + t.index [:process_id, :job_id] end create_table :solid_queue_blocked_executions, id: :uuid do |t| - t.references :job, type: :uuid, index: { unique: true }, null: false + t.references :job, type: :uuid, index: {unique: true}, null: false t.string :queue_name, null: false t.integer :priority, default: 0, null: false t.string :concurrency_key, null: false @@ -56,17 +56,17 @@ def change t.datetime :created_at, null: false - t.index [ :expires_at, :concurrency_key ], name: "index_solid_queue_blocked_executions_for_maintenance" + t.index [:expires_at, :concurrency_key], name: "index_solid_queue_blocked_executions_for_maintenance" end create_table :solid_queue_failed_executions, id: :uuid do |t| - t.references :job, type: :uuid, index: { unique: true }, null: false + t.references :job, type: :uuid, index: {unique: true}, null: false t.text :error t.datetime :created_at, null: false end create_table :solid_queue_pauses, id: :uuid do |t| - t.string :queue_name, null: false, index: { unique: true } + t.string :queue_name, null: false, index: {unique: true} t.datetime :created_at, null: false end @@ -83,13 +83,13 @@ def change end create_table :solid_queue_semaphores, id: :uuid do |t| - t.string :key, null: false, index: { unique: true } + t.string :key, null: false, index: {unique: true} t.integer :value, default: 1, null: false t.datetime :expires_at, null: false, index: true t.timestamps - t.index [ :key, :value ], name: "index_solid_queue_semaphores_on_key_and_value" + t.index [:key, :value], name: "index_solid_queue_semaphores_on_key_and_value" end add_foreign_key :solid_queue_blocked_executions, :solid_queue_jobs, column: :job_id, on_delete: :cascade diff --git a/db/migrate/20240419132660_add_missing_index_to_blocked_executions.solid_queue.rb b/db/migrate/20240419132660_add_missing_index_to_blocked_executions.solid_queue.rb index 2d96b10..53e74dc 100644 --- a/db/migrate/20240419132660_add_missing_index_to_blocked_executions.solid_queue.rb +++ b/db/migrate/20240419132660_add_missing_index_to_blocked_executions.solid_queue.rb @@ -1,6 +1,6 @@ # This migration comes from solid_queue (originally 20240110143450) class AddMissingIndexToBlockedExecutions < ActiveRecord::Migration[7.1] def change - add_index :solid_queue_blocked_executions, [ :concurrency_key, :priority, :job_id ], name: "index_solid_queue_blocked_executions_for_release" + add_index :solid_queue_blocked_executions, [:concurrency_key, :priority, :job_id], name: "index_solid_queue_blocked_executions_for_release" end end diff --git a/db/migrate/20240419132661_create_recurring_executions.solid_queue.rb b/db/migrate/20240419132661_create_recurring_executions.solid_queue.rb index 377f3dc..7d80326 100644 --- a/db/migrate/20240419132661_create_recurring_executions.solid_queue.rb +++ b/db/migrate/20240419132661_create_recurring_executions.solid_queue.rb @@ -2,12 +2,12 @@ class CreateRecurringExecutions < ActiveRecord::Migration[7.1] def change create_table :solid_queue_recurring_executions, id: :uuid do |t| - t.references :job, type: :uuid, index: { unique: true }, null: false + t.references :job, type: :uuid, index: {unique: true}, null: false t.string :task_key, null: false t.datetime :run_at, null: false t.datetime :created_at, null: false - t.index [ :task_key, :run_at ], unique: true + t.index [:task_key, :run_at], unique: true end add_foreign_key :solid_queue_recurring_executions, :solid_queue_jobs, column: :job_id, on_delete: :cascade diff --git a/tailwind.config.js b/tailwind.config.js index b6eea5b..872f239 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -4,6 +4,7 @@ const defaultTheme = require("tailwindcss/defaultTheme"); export default { darkMode: ["class"], content: [ + './app/views/**/*.rb', "./app/views/**/*.{erb,haml,html,slim,rb}", "./app/views/components/**/*.rb", "./app/helpers/**/*.rb",