set dotenv-load := false
set positional-arguments := false

default:
	@just --list

# Install Ruby dependencies
install:
	@echo "→ Installing Ruby dependencies…"
	bundle install

# Run the development server
run:
	@echo "→ Starting volumen…"
	bundle exec exe/volumen serve

# Run the development server against ./posts and ./config.toml
dev:
	@echo "→ Starting volumen (dev) on http://localhost:9090 …"
	bundle exec exe/volumen serve --config ./config.toml --content ./posts

# Lint and package the gem (must pass with zero warnings)
build:
	@echo "→ Linting…"
	bundle exec rubocop
	@echo "→ Building gem…"
	@mkdir -p pkg
	gem build volumen.gemspec --output pkg/volumen.gem

# Run the test suite
test:
	@echo "→ Running tests…"
	bundle exec rake test

# Remove build artifacts
uninstall:
	@echo "→ Removing build artifacts…"
	rm -rf pkg *.gem
