Skip to content

Commit

Permalink
Fix rubocop offenses
Browse files Browse the repository at this point in the history
  • Loading branch information
waiting-for-dev committed Jun 1, 2023
1 parent 2d4e29f commit c8570df
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 21 deletions.
2 changes: 2 additions & 0 deletions admin/app/controllers/solidus_admin/orders_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# frozen_string_literal: true

module SolidusAdmin
# rubocop:disable Rails/ApplicationController
class OrdersController < ActionController::Base
layout 'solidus_admin/application'
end
# rubocop:enable Rails/ApplicationController
end
24 changes: 12 additions & 12 deletions admin/lib/solidus_admin/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,29 @@ class Configuration < Spree::Preferences::Configuration
#
# You can modify this list to include your own paths:
#
# SolidusAdmin::Config.tailwind_content << Rails.root.join("app", "my", "custom", "path")
# SolidusAdmin::Config.tailwind_content << Rails.root.join("app/my/custom/path")
#
# Recompile with `bin/rails solidus_admin:tailwindcss:build` after changing this list.
#
# @see https://tailwindcss.com/docs/configuration#content
preference :tailwind_content, :array, default: [
SolidusAdmin::Engine.root.join("public", "*.html"),
SolidusAdmin::Engine.root.join("app", "helpers", "**", "*.rb"),
SolidusAdmin::Engine.root.join("app", "assets", "javascripts", "**", "*.js"),
SolidusAdmin::Engine.root.join("app", "views", "**", "*.{erb,haml,html,slim}"),
SolidusAdmin::Engine.root.join("app", "components", "**", "*.rb"),
Rails.root.join("public", "solidus_admin", "*.html"),
Rails.root.join("app", "helpers", "solidus_admin", "**", "*.rb"),
Rails.root.join("app", "assets", "javascripts", "solidus_admin", "**", "*.js"),
Rails.root.join("app", "views", "solidus_admin", "**", "*.{erb,haml,html,slim}"),
Rails.root.join("app", "components", "solidus_admin", "**", "*.rb")
SolidusAdmin::Engine.root.join("public/*.html"),
SolidusAdmin::Engine.root.join("app/helpers/**/*.rb"),
SolidusAdmin::Engine.root.join("app/assets/javascripts/**/*.js"),
SolidusAdmin::Engine.root.join("app/views/**/*.{erb,haml,html,slim}"),
SolidusAdmin::Engine.root.join("app/components/**/*.rb"),
Rails.root.join("public/solidus_admin/*.html"),
Rails.root.join("app/helpers/solidus_admin/**/*.rb"),
Rails.root.join("app/assets/javascripts/solidus_admin/**/*.js"),
Rails.root.join("app/views/solidus_admin/**/*.{erb,haml,html,slim}"),
Rails.root.join("app/components/solidus_admin/**/*.rb")
]

# List of Tailwind CSS files to be combined into the final stylesheet.
#
# You can modify this list to include your own files:
#
# SolidusAdmin::Config.tailwind_stylesheets << Rails.root.join("app", "assets", "stylesheets", "solidus_admin", "application.tailwind.css")
# SolidusAdmin::Config.tailwind_stylesheets << Rails.root.join("app/assets/stylesheets/solidus_admin/application.tailwind.css")
#
# Recompile with `bin/rails solidus_admin:tailwindcss:build` after changing this list.
preference :tailwind_stylesheets, :array, default: []
Expand Down
14 changes: 7 additions & 7 deletions admin/lib/solidus_admin/tailwindcss.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ def run(args = "")
"application.tailwind.css"
)

system "#{::Tailwindcss::Engine.root.join("exe/tailwindcss")} \
system "#{::Tailwindcss::Engine.root.join('exe/tailwindcss')} \
-i #{stylesheet_file.path} \
-o #{Rails.root.join("app/assets/builds/solidus_admin/tailwind.css")} \
-o #{Rails.root.join('app/assets/builds/solidus_admin/tailwind.css')} \
-c #{config_file.path} \
#{args}"
ensure
Expand All @@ -28,25 +28,25 @@ def run(args = "")
end

def config_app_path
Rails.root.join("config", "solidus_admin", "tailwind.config.js.erb")
Rails.root.join("config/solidus_admin/tailwind.config.js.erb")
end

def config_engine_path
SolidusAdmin::Engine.root.join("config", "solidus_admin", "tailwind.config.js.erb")
SolidusAdmin::Engine.root.join("config/solidus_admin/tailwind.config.js.erb")
end

def stylesheet_app_path
Rails.root.join("app", "assets", "stylesheets", "solidus_admin", "application.tailwind.css.erb")
Rails.root.join("app/assets/stylesheets/solidus_admin/application.tailwind.css.erb")
end

def stylesheet_engine_path
SolidusAdmin::Engine.root.join("app", "assets", "stylesheets", "solidus_admin", "application.tailwind.css.erb")
SolidusAdmin::Engine.root.join("app/assets/stylesheets/solidus_admin/application.tailwind.css.erb")
end

def compile_to_tempfile(path, name)
Tempfile.new(name).tap do |file|
path
.then { |path| File.read(path) }
.then { File.read(_1) }
.then { |content| ERB.new(content) }
.then { |erb| erb.result }
.then { |compiled_content| file.write(compiled_content) && file.rewind }
Expand Down
2 changes: 2 additions & 0 deletions admin/lib/tasks/tailwindcss.rake
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

namespace :solidus_admin do
namespace :tailwindcss do
require "solidus_admin/tailwindcss"
Expand Down
2 changes: 1 addition & 1 deletion admin/solidus_admin.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

require_relative '../core/lib/spree/core/version.rb'
require_relative '../core/lib/spree/core/version'

Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
Expand Down
2 changes: 1 addition & 1 deletion solidus.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ Gem::Specification.new do |s|
s.required_ruby_version = '>= 3.0.0'
s.required_rubygems_version = '>= 1.8.23'

s.add_dependency 'solidus_admin', s.version
s.add_dependency 'solidus_api', s.version
s.add_dependency 'solidus_backend', s.version
s.add_dependency 'solidus_core', s.version
s.add_dependency 'solidus_sample', s.version
s.add_dependency 'solidus_admin', s.version
end

0 comments on commit c8570df

Please sign in to comment.