Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ source "https://rubygems.org/"

gemspec

# gem "debug", "~> 1.0", require: false

gem "minitest", "~> 5.11"
gem "minitest-focus", "~> 1.2"
gem "minitest-junit", "~> 1.0"

gem "rake"
gem "rdoc", "~> 6.3", require: false
gem "reek", require: false

gem "rubocop", "~> 1.63", require: false
gem "rubocop-minitest", "~> 0.35", require: false
gem "rubocop-packaging", "~> 0.5", require: false
gem "rubocop-performance", "~> 1.21", require: false
gem "rubocop-rake", "~> 0.6", require: false
gem "rubocop-thread_safety", "~> 0.5", require: false

gem "rubocop-md", "~> 1.2", require: false

gem "simplecov", "~> 0.22", require: false
group :development do
gem "debug", "~> 1.0", require: false
gem "rake"
gem "reek", require: false
gem "rdoc", "~> 6.3", require: false
gem "rubocop", "~> 1.63", require: false
gem "rubocop-md", "~> 1.2", require: false
gem "rubocop-minitest", "~> 0.35", require: false
gem "rubocop-packaging", "~> 0.5", require: false
gem "rubocop-performance", "~> 1.21", require: false
gem "rubocop-rake", "~> 0.6", require: false
gem "rubocop-thread_safety", "~> 0.5", require: false
end

group :test do
gem "minitest", "~> 5.11"
gem "minitest-focus", "~> 1.2"
gem "minitest-junit", "~> 1.0"
gem "simplecov", "~> 0.22", require: false
end
12 changes: 12 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ PATH
rack (~> 3.0)
rackup (~> 2.1)
rouge (~> 4.0)
zeitwerk (~> 2.6)

GEM
remote: https://rubygems.org/
Expand All @@ -19,6 +20,9 @@ GEM
bigdecimal (3.1.7-java)
builder (3.2.4)
concurrent-ruby (1.2.3)
debug (1.9.2)
irb (~> 1.10)
reline (>= 0.3.8)
docile (1.4.0)
dry-configurable (1.1.0)
dry-core (~> 1.0, < 2)
Expand Down Expand Up @@ -47,6 +51,11 @@ GEM
dry-inflector (~> 1.0)
dry-logic (~> 1.4)
zeitwerk (~> 2.6)
io-console (0.7.2)
io-console (0.7.2-java)
irb (1.13.1)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
jar-dependencies (0.4.1)
json (2.7.2)
json (2.7.2-java)
Expand Down Expand Up @@ -91,6 +100,8 @@ GEM
rainbow (>= 2.0, < 4.0)
rexml (~> 3.1)
regexp_parser (2.9.0)
reline (0.5.5)
io-console (~> 0.5)
rexml (3.2.6)
rouge (4.2.1)
rubocop (1.63.4)
Expand Down Expand Up @@ -141,6 +152,7 @@ PLATFORMS
x86_64-linux

DEPENDENCIES
debug (~> 1.0)
heel!
minitest (~> 5.11)
minitest-focus (~> 1.2)
Expand Down
10 changes: 10 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
# Changelog
## Version NEXT
* Convert to using zeitwerk for loading
* Update all ruby dependencies
* Switch to [marcel](https://github.com/rails/marcel) for mime type detection
* Rework maintenance scripts
* Switch to [tabler icons](https://tabler.io/icons)
* Update the embedded pico-css versino
* Full rubocop sweep
* Lots of Internal refactoring

## Version 4.0.1 - 2024-03-03
* Update all dependencies
* update test versions of ruby
Expand Down
8 changes: 5 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ This.email = "[email protected]"
This.homepage = "http://github.com/copiousfreetime/#{This.name}"

This.ruby_gemspec do |spec|

spec.add_runtime_dependency("launchy", "~> 2.5")
spec.add_runtime_dependency("marcel", "~> 1.0")
spec.add_runtime_dependency("puma", "~> 6.0")
spec.add_runtime_dependency("rack", "~> 3.0")
spec.add_runtime_dependency("rackup", "~> 2.1")
spec.add_runtime_dependency("puma", "~> 6.0")
spec.add_runtime_dependency("marcel", "~> 1.0")
spec.add_runtime_dependency("launchy", "~> 2.5")
spec.add_runtime_dependency("rouge", "~> 4.0")
spec.add_runtime_dependency("zeitwerk", "~> 2.6")

spec.license = "BSD-3-Clause"

Expand Down
9 changes: 5 additions & 4 deletions heel.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Gem::Specification.new do |s|
s.require_paths = ["lib".freeze]
s.authors = ["Jeremy Hinegardner".freeze]
s.bindir = "exe".freeze
s.date = "2024-05-05"
s.date = "2024-05-06"
s.description = "Heel is a small static web server for use when you need a quick web server for a directory. Once the server is running, heel will use (https://rubygems.org/gems/launchy/) to open your browser at the URL of your document root. Run it right now! `gem exec heel` ----- Heel is built using (https://github.com/rack/rack) and (https://puma.io) % heel Launching your browser... Puma starting in single mode... * Puma version: 6.2.1 (ruby 3.2.2-p53) (\"Speaking of Now\") * Min threads: 0 * Max threads: 5 * Environment: none * PID: 11322 * Listening on http://0.0.0.0:4331 Use Ctrl-C to stop Or run it in the background % heel --daemonize Launching your browser at http://0.0.0.0:4331/ % heel --kill Sending TERM to process 3304 Done.".freeze
s.email = "[email protected]".freeze
s.executables = ["heel".freeze]
Expand All @@ -27,10 +27,11 @@ Gem::Specification.new do |s|

s.specification_version = 4

s.add_runtime_dependency(%q<launchy>.freeze, ["~> 2.5".freeze])
s.add_runtime_dependency(%q<marcel>.freeze, ["~> 1.0".freeze])
s.add_runtime_dependency(%q<puma>.freeze, ["~> 6.0".freeze])
s.add_runtime_dependency(%q<rack>.freeze, ["~> 3.0".freeze])
s.add_runtime_dependency(%q<rackup>.freeze, ["~> 2.1".freeze])
s.add_runtime_dependency(%q<puma>.freeze, ["~> 6.0".freeze])
s.add_runtime_dependency(%q<marcel>.freeze, ["~> 1.0".freeze])
s.add_runtime_dependency(%q<launchy>.freeze, ["~> 2.5".freeze])
s.add_runtime_dependency(%q<rouge>.freeze, ["~> 4.0".freeze])
s.add_runtime_dependency(%q<zeitwerk>.freeze, ["~> 2.6".freeze])
end
43 changes: 23 additions & 20 deletions lib/heel.rb
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
# frozen_string_literal: true

#--
# Copyright (c) 2007 - 2013 Jeremy Hinegardner
# All rights reserved. Licensed under the BSD license. See LICENSE for details
#++
require "zeitwerk"
Zeitwerk::Loader.new.then do |loader|
loader.inflector = Zeitwerk::GemInflector.new(__FILE__)
loader.tag = File.basename(__FILE__, ".rb")
loader.push_dir(__dir__)
loader.setup
end

# Heel namespace and version
module Heel
VERSION = "4.0.1"
def self.loader(registry = Zeitwerk::Registry)
@loader ||= registry.loaders.find { |loader| loader.tag == File.basename(__FILE__, ".rb") }
end
end

require "heel/configuration"
require "heel/mime_utils"
require "heel/resource"
require "heel/directory_entry"
require "heel/template"
require "heel/directory_listing_vars"
require "heel/response"
require "heel/directory_index_response"
require "heel/error_response_vars"
require "heel/error_response"
require "heel/logger"
require "heel/rackapp"
require "heel/request"
require "heel/resource_response"
require "heel/server"
# Stdlib and Gems
require "erb"
require "fileutils"
require "launchy"
require "marcel"
require "pathname"
require "puma"
require "rack"
require "rack/utils"
require "rackup"
require "rouge"
require "time"
6 changes: 0 additions & 6 deletions lib/heel/directory_index_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
# All rights reserved. Licensed under the BSD license. See LICENSE for details
#++

require "erb"
require_relative "response"
require_relative "directory_entry"
require_relative "directory_listing_vars"
require_relative "template"

module Heel
# Internal: Generate a directory index
#
Expand Down
3 changes: 0 additions & 3 deletions lib/heel/error_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
# All rights reserved. Licensed under the BSD license. See LICENSE for details
#++

require "rack"
require "erb"

module Heel
# Internal: Wrapper for the http error code responses
#
Expand Down
5 changes: 0 additions & 5 deletions lib/heel/rackapp.rb → lib/heel/rack_app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
# All rights reserved. Licensed under the BSD license. See LICENSE for details
#++

require "rack"
require "rack/utils"
require "rouge"
require "time"

module Heel
# Internal: The Rack application that is Heel.
#
Expand Down
1 change: 0 additions & 1 deletion lib/heel/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# All rights reserved. Licensed under the BSD license. See LICENSE for details
#++

require "rack"
module Heel
# Internal: A RackRequest with some additional methods and error handling
#
Expand Down
2 changes: 0 additions & 2 deletions lib/heel/resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
# All rights reserved. Licensed under the BSD license. See LICENSE for details
#++

require "marcel"

module Heel
# Internal: Resource representing a single file or directory that is being served
#
Expand Down
2 changes: 0 additions & 2 deletions lib/heel/resource_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
# All rights reserved. Licensed under the BSD license. See LICENSE for details
#++

require "marcel"

module Heel
# Internal: Generate a resource response.
#
Expand Down
7 changes: 0 additions & 7 deletions lib/heel/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@
# All rights reserved. Licensed under the BSD license. See LICENSE for details
#++

require "ostruct"
require "launchy"
require "fileutils"
require "heel/rackapp"
require "rackup"
require "puma"

module Heel
# Internal: The heel server
#
Expand Down
2 changes: 0 additions & 2 deletions lib/heel/template.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require "erb"

module Heel
# Internal: A wrapper for an erb template
#
Expand Down
3 changes: 3 additions & 0 deletions lib/heel/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module Heel
VERSION = "4.0.1"
end
1 change: 0 additions & 1 deletion spec/configuration_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# frozen_string_literal: true

require "spec_helper"
require "pathname"

describe Heel::Configuration do
before do
Expand Down
2 changes: 0 additions & 2 deletions spec/rackapp_spec.rb → spec/rack_app_spec.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# frozen_string_literal: true

require "spec_helper"
require "rack/mock"
require "heel/rackapp"

describe Heel::RackApp do
before(:each) do
Expand Down
4 changes: 4 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# frozen_string_literal: true

Bundler.require(:test)

require "heel"

require "minitest/autorun"
require "minitest/focus"
require "minitest/pride"
require "rack/mock"