Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksrutins committed Dec 7, 2024
1 parent 77d3de5 commit 1602d87
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ gem "standard", "~> 1.3"

gem "phlex", "~> 1.11"

gem "steep", "~> 1.7", :group => :development
gem "steep", "~> 1.7", group: :development
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ GEM
drb (2.2.1)
ffi (1.17.0)
ffi (1.17.0-arm64-darwin)
ffi (1.17.0-x64-mingw-ucrt)
fileutils (1.7.2)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
Expand Down Expand Up @@ -107,6 +108,7 @@ GEM
PLATFORMS
arm64-darwin-23
ruby
x64-mingw-ucrt

DEPENDENCIES
minitest (~> 5.16)
Expand Down
16 changes: 8 additions & 8 deletions lib/phlexite/router.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'fileutils'
require "fileutils"

class Phlexite::Router
def initialize(base, site)
Expand All @@ -7,25 +7,25 @@ def initialize(base, site)
end

def group(new_base)
router = Phlexite::Router.new(File::join(@base, new_base), @site)
router = Phlexite::Router.new(File.join(@base, new_base), @site)
yield router
end

def page(out_path, component)
out = full_out_path(out_path)
FileUtils::mkdir_p File::dirname(out)
File::write(out, component.call)
FileUtils.mkdir_p File.dirname(out)
File.write(out, component.call)
end

def mount(local_directory, on:)
out = full_out_path(on)
FileUtils::mkdir_p out
FileUtils::cp_r File::join(local_directory, "."), out
FileUtils.mkdir_p out
FileUtils.cp_r File.join(local_directory, "."), out
end

private
private

def full_out_path(out_path)
File::join(@site.build_dir, @site.base_url, @base, out_path)
File.join(@site.build_dir, @site.base_url, @base, out_path)
end
end
2 changes: 1 addition & 1 deletion lib/phlexite/site.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

require_relative 'router.rb'
require_relative "router"

class Phlexite::Site < Phlexite::Router
attr_accessor :build_dir, :base_url
Expand Down
4 changes: 2 additions & 2 deletions test/test_phlexite.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ def test_it_does_something_useful
end

def test_that_site_is_defined
assert ::Phlexite::Site != nil
assert !::Phlexite::Site.nil?
end

def test_that_router_is_defined
assert ::Phlexite::Router != nil
assert !::Phlexite::Router.nil?
end
end

0 comments on commit 1602d87

Please sign in to comment.