Skip to content

Commit

Permalink
Spelling is hard.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexpearce committed Oct 29, 2023
1 parent 83a699b commit 52efc8d
Show file tree
Hide file tree
Showing 44 changed files with 171 additions and 171 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ erl_crash.dump
/tmp/

# Ignore package tarball (built via "mix hex.build").
twenty_fourty_eight-*.tar
twenty_forty_eight-*.tar

# Ignore assets that are produced by build tools.
/priv/static/assets/
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# TwentyFourtyEight
# TwentyFortyEight

To start your Phoenix server:

Expand Down
4 changes: 2 additions & 2 deletions assets/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ const path = require("path")
module.exports = {
content: [
"./js/**/*.js",
"../lib/twenty_fourty_eight_web.ex",
"../lib/twenty_fourty_eight_web/**/*.*ex"
"../lib/twenty_forty_eight_web.ex",
"../lib/twenty_forty_eight_web/**/*.*ex"
],
theme: {
extend: {
Expand Down
12 changes: 6 additions & 6 deletions config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@
# General application configuration
import Config

config :twenty_fourty_eight,
ecto_repos: [TwentyFourtyEight.Repo],
config :twenty_forty_eight,
ecto_repos: [TwentyFortyEight.Repo],
generators: [timestamp_type: :utc_datetime]

# Configures the endpoint
config :twenty_fourty_eight, TwentyFourtyEightWeb.Endpoint,
config :twenty_forty_eight, TwentyFortyEightWeb.Endpoint,
url: [host: "localhost"],
adapter: Phoenix.Endpoint.Cowboy2Adapter,
render_errors: [
formats: [html: TwentyFourtyEightWeb.ErrorHTML, json: TwentyFourtyEightWeb.ErrorJSON],
formats: [html: TwentyFortyEightWeb.ErrorHTML, json: TwentyFortyEightWeb.ErrorJSON],
layout: false
],
pubsub_server: TwentyFourtyEight.PubSub,
pubsub_server: TwentyFortyEight.PubSub,
live_view: [signing_salt: "SipBW+C+"]

# Configures the mailer
Expand All @@ -29,7 +29,7 @@ config :twenty_fourty_eight, TwentyFourtyEightWeb.Endpoint,
#
# For production it's recommended to configure a different adapter
# at the `config/runtime.exs`.
config :twenty_fourty_eight, TwentyFourtyEight.Mailer, adapter: Swoosh.Adapters.Local
config :twenty_forty_eight, TwentyFortyEight.Mailer, adapter: Swoosh.Adapters.Local

# Configure esbuild (the version is required)
config :esbuild,
Expand Down
12 changes: 6 additions & 6 deletions config/dev.exs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import Config

# Configure your database
config :twenty_fourty_eight, TwentyFourtyEight.Repo,
config :twenty_forty_eight, TwentyFortyEight.Repo,
username: "postgres",
password: "postgres",
hostname: "localhost",
database: "twenty_fourty_eight_dev",
database: "twenty_forty_eight_dev",
stacktrace: true,
show_sensitive_data_on_connection_error: true,
pool_size: 10
Expand All @@ -16,7 +16,7 @@ config :twenty_fourty_eight, TwentyFourtyEight.Repo,
# The watchers configuration can be used to run external
# watchers to your application. For example, we can use it
# to bundle .js and .css sources.
config :twenty_fourty_eight, TwentyFourtyEightWeb.Endpoint,
config :twenty_forty_eight, TwentyFortyEightWeb.Endpoint,
# Binding to loopback ipv4 address prevents access from other machines.
# Change to `ip: {0, 0, 0, 0}` to allow access from other machines.
http: [ip: {127, 0, 0, 1}, port: 4000],
Expand Down Expand Up @@ -53,17 +53,17 @@ config :twenty_fourty_eight, TwentyFourtyEightWeb.Endpoint,
# different ports.

# Watch static and templates for browser reloading.
config :twenty_fourty_eight, TwentyFourtyEightWeb.Endpoint,
config :twenty_forty_eight, TwentyFortyEightWeb.Endpoint,
live_reload: [
patterns: [
~r"priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$",
~r"priv/gettext/.*(po)$",
~r"lib/twenty_fourty_eight_web/(controllers|live|components)/.*(ex|heex)$"
~r"lib/twenty_forty_eight_web/(controllers|live|components)/.*(ex|heex)$"
]
]

# Enable dev routes for dashboard and mailbox
config :twenty_fourty_eight, dev_routes: true
config :twenty_forty_eight, dev_routes: true

# Do not include metadata nor timestamps in development logs
config :logger, :console, format: "[$level] $message\n"
Expand Down
4 changes: 2 additions & 2 deletions config/prod.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import Config
# manifest is generated by the `mix assets.deploy` task,
# which you should run after static files are built and
# before starting your production server.
config :twenty_fourty_eight, TwentyFourtyEightWeb.Endpoint,
config :twenty_forty_eight, TwentyFortyEightWeb.Endpoint,
cache_static_manifest: "priv/static/cache_manifest.json"

# Configures Swoosh API Client
config :swoosh, api_client: Swoosh.ApiClient.Finch, finch_name: TwentyFourtyEight.Finch
config :swoosh, api_client: Swoosh.ApiClient.Finch, finch_name: TwentyFortyEight.Finch

# Disable Swoosh Local Memory Storage
config :swoosh, local: false
Expand Down
16 changes: 8 additions & 8 deletions config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ import Config
# If you use `mix release`, you need to explicitly enable the server
# by passing the PHX_SERVER=true when you start it:
#
# PHX_SERVER=true bin/twenty_fourty_eight start
# PHX_SERVER=true bin/twenty_forty_eight start
#
# Alternatively, you can use `mix phx.gen.release` to generate a `bin/server`
# script that automatically sets the env var above.
if System.get_env("PHX_SERVER") do
config :twenty_fourty_eight, TwentyFourtyEightWeb.Endpoint, server: true
config :twenty_forty_eight, TwentyFortyEightWeb.Endpoint, server: true
end

if config_env() == :prod do
Expand All @@ -30,7 +30,7 @@ if config_env() == :prod do

maybe_ipv6 = if System.get_env("ECTO_IPV6") in ~w(true 1), do: [:inet6], else: []

config :twenty_fourty_eight, TwentyFourtyEight.Repo,
config :twenty_forty_eight, TwentyFortyEight.Repo,
# ssl: true,
url: database_url,
pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10"),
Expand All @@ -51,9 +51,9 @@ if config_env() == :prod do
host = System.get_env("PHX_HOST") || "example.com"
port = String.to_integer(System.get_env("PORT") || "4000")

config :twenty_fourty_eight, :dns_cluster_query, System.get_env("DNS_CLUSTER_QUERY")
config :twenty_forty_eight, :dns_cluster_query, System.get_env("DNS_CLUSTER_QUERY")

config :twenty_fourty_eight, TwentyFourtyEightWeb.Endpoint,
config :twenty_forty_eight, TwentyFortyEightWeb.Endpoint,
url: [host: host, port: 443, scheme: "https"],
http: [
# Enable IPv6 and bind on all interfaces.
Expand All @@ -70,7 +70,7 @@ if config_env() == :prod do
# To get SSL working, you will need to add the `https` key
# to your endpoint configuration:
#
# config :twenty_fourty_eight, TwentyFourtyEightWeb.Endpoint,
# config :twenty_forty_eight, TwentyFortyEightWeb.Endpoint,
# https: [
# ...,
# port: 443,
Expand All @@ -92,7 +92,7 @@ if config_env() == :prod do
# We also recommend setting `force_ssl` in your endpoint, ensuring
# no data is ever sent via http, always redirecting to https:
#
# config :twenty_fourty_eight, TwentyFourtyEightWeb.Endpoint,
# config :twenty_forty_eight, TwentyFortyEightWeb.Endpoint,
# force_ssl: [hsts: true]
#
# Check `Plug.SSL` for all available options in `force_ssl`.
Expand All @@ -103,7 +103,7 @@ if config_env() == :prod do
# Also, you may need to configure the Swoosh API client of your choice if you
# are not using SMTP. Here is an example of the configuration:
#
# config :twenty_fourty_eight, TwentyFourtyEight.Mailer,
# config :twenty_forty_eight, TwentyFortyEight.Mailer,
# adapter: Swoosh.Adapters.Mailgun,
# api_key: System.get_env("MAILGUN_API_KEY"),
# domain: System.get_env("MAILGUN_DOMAIN")
Expand Down
8 changes: 4 additions & 4 deletions config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ import Config
# The MIX_TEST_PARTITION environment variable can be used
# to provide built-in test partitioning in CI environment.
# Run `mix help test` for more information.
config :twenty_fourty_eight, TwentyFourtyEight.Repo,
config :twenty_forty_eight, TwentyFortyEight.Repo,
username: "postgres",
password: "postgres",
hostname: "localhost",
database: "twenty_fourty_eight_test#{System.get_env("MIX_TEST_PARTITION")}",
database: "twenty_forty_eight_test#{System.get_env("MIX_TEST_PARTITION")}",
pool: Ecto.Adapters.SQL.Sandbox,
pool_size: 10

# We don't run a server during test. If one is required,
# you can enable the server option below.
config :twenty_fourty_eight, TwentyFourtyEightWeb.Endpoint,
config :twenty_forty_eight, TwentyFortyEightWeb.Endpoint,
http: [ip: {127, 0, 0, 1}, port: 4002],
secret_key_base: "EFU3MRLY/qeAOoxVCm27dDdEXF/HkcIqmEQjkqOXFVihcLgQe2LGBpRqaPs7BqCf",
server: false

# In test we don't send emails.
config :twenty_fourty_eight, TwentyFourtyEight.Mailer, adapter: Swoosh.Adapters.Test
config :twenty_forty_eight, TwentyFortyEight.Mailer, adapter: Swoosh.Adapters.Test

# Disable swoosh api client as it is only required for production adapters.
config :swoosh, :api_client, false
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
</style>
</head>
<body>
<h1>Twenty Fourty Eight.</h1>
<h1>Twenty Forty Eight.</h1>
<div class="game">
<div class="stats">
<div class="score"><b>Score</b> 934</div>
Expand Down
4 changes: 2 additions & 2 deletions lib/twenty_fourty_eight.ex → lib/twenty_forty_eight.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
defmodule TwentyFourtyEight do
defmodule TwentyFortyEight do
@moduledoc """
TwentyFourtyEight keeps the contexts that define your domain
TwentyFortyEight keeps the contexts that define your domain
and business logic.
Contexts are also responsible for managing your data, regardless
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule TwentyFourtyEight.Application do
defmodule TwentyFortyEight.Application do
# See https://hexdocs.pm/elixir/Application.html
# for more information on OTP Applications
@moduledoc false
Expand All @@ -8,30 +8,30 @@ defmodule TwentyFourtyEight.Application do
@impl true
def start(_type, _args) do
children = [
TwentyFourtyEightWeb.Telemetry,
TwentyFourtyEight.Repo,
TwentyFortyEightWeb.Telemetry,
TwentyFortyEight.Repo,
{DNSCluster,
query: Application.get_env(:twenty_fourty_eight, :dns_cluster_query) || :ignore},
{Phoenix.PubSub, name: TwentyFourtyEight.PubSub},
query: Application.get_env(:twenty_forty_eight, :dns_cluster_query) || :ignore},
{Phoenix.PubSub, name: TwentyFortyEight.PubSub},
# Start the Finch HTTP client for sending emails
{Finch, name: TwentyFourtyEight.Finch},
{Registry, keys: :unique, name: TwentyFourtyEight.Game.Registry},
{DynamicSupervisor, name: TwentyFourtyEight.Game.Supervisor, strategy: :one_for_one},
{Finch, name: TwentyFortyEight.Finch},
{Registry, keys: :unique, name: TwentyFortyEight.Game.Registry},
{DynamicSupervisor, name: TwentyFortyEight.Game.Supervisor, strategy: :one_for_one},
# Start to serve requests, typically the last entry
TwentyFourtyEightWeb.Endpoint
TwentyFortyEightWeb.Endpoint
]

# See https://hexdocs.pm/elixir/Supervisor.html
# for other strategies and supported options
opts = [strategy: :one_for_one, name: TwentyFourtyEight.Supervisor]
opts = [strategy: :one_for_one, name: TwentyFortyEight.Supervisor]
Supervisor.start_link(children, opts)
end

# Tell Phoenix to update the endpoint configuration
# whenever the application is updated.
@impl true
def config_change(changed, _new, removed) do
TwentyFourtyEightWeb.Endpoint.config_change(changed, removed)
TwentyFortyEightWeb.Endpoint.config_change(changed, removed)
:ok
end
end
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
defmodule TwentyFourtyEight.Game.Engine do
defmodule TwentyFortyEight.Game.Engine do
# TODO
# 1. rename Fourty -> Forty
# 1. rename Forty -> Forty
# 2. mark a game as lost if, at the start of a turn, the board is exhausted and no move would change that
# 3. factor out board creation into a separate module. the engine's state can then be reduced (doesn't need stuff only required to create the board.)
# 4. fix obstacle creation and make it configurable.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
defmodule TwentyFourtyEight.Game.Game do
defmodule TwentyFortyEight.Game.Game do
use Ecto.Schema
import Ecto.Changeset

alias TwentyFourtyEight.Repo
alias TwentyFortyEight.Repo

@slug_length 8
@slug_alphabet String.graphemes(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
defmodule TwentyFourtyEight.Game.Manager do
defmodule TwentyFortyEight.Game.Manager do
use GenServer, restart: :transient

alias TwentyFourtyEight.Game.Engine
alias TwentyFortyEight.Game.Engine

@registry TwentyFourtyEight.Game.Registry
@supervisor TwentyFourtyEight.Game.Supervisor
@registry TwentyFortyEight.Game.Registry
@supervisor TwentyFortyEight.Game.Supervisor

def get_game(name, state) when is_binary(name) do
case Registry.lookup(@registry, name) do
Expand Down
3 changes: 3 additions & 0 deletions lib/twenty_forty_eight/mailer.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
defmodule TwentyFortyEight.Mailer do
use Swoosh.Mailer, otp_app: :twenty_forty_eight
end
5 changes: 5 additions & 0 deletions lib/twenty_forty_eight/repo.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
defmodule TwentyFortyEight.Repo do
use Ecto.Repo,
otp_app: :twenty_forty_eight,
adapter: Ecto.Adapters.Postgres
end
22 changes: 11 additions & 11 deletions lib/twenty_fourty_eight_web.ex → lib/twenty_forty_eight_web.ex
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
defmodule TwentyFourtyEightWeb do
defmodule TwentyFortyEightWeb do
@moduledoc """
The entrypoint for defining your web interface, such
as controllers, components, channels, and so on.
This can be used in your application as:
use TwentyFourtyEightWeb, :controller
use TwentyFourtyEightWeb, :html
use TwentyFortyEightWeb, :controller
use TwentyFortyEightWeb, :html
The definitions below will be executed for every controller,
component, etc, so keep them short and clean, focused
Expand Down Expand Up @@ -40,10 +40,10 @@ defmodule TwentyFourtyEightWeb do
quote do
use Phoenix.Controller,
formats: [:html, :json],
layouts: [html: TwentyFourtyEightWeb.Layouts]
layouts: [html: TwentyFortyEightWeb.Layouts]

import Plug.Conn
import TwentyFourtyEightWeb.Gettext
import TwentyFortyEightWeb.Gettext

unquote(verified_routes())
end
Expand All @@ -52,7 +52,7 @@ defmodule TwentyFourtyEightWeb do
def live_view do
quote do
use Phoenix.LiveView,
layout: {TwentyFourtyEightWeb.Layouts, :app}
layout: {TwentyFortyEightWeb.Layouts, :app}

unquote(html_helpers())
end
Expand Down Expand Up @@ -84,8 +84,8 @@ defmodule TwentyFourtyEightWeb do
# HTML escaping functionality
import Phoenix.HTML
# Core UI components and translation
import TwentyFourtyEightWeb.CoreComponents
import TwentyFourtyEightWeb.Gettext
import TwentyFortyEightWeb.CoreComponents
import TwentyFortyEightWeb.Gettext

# Shortcut for generating JS commands
alias Phoenix.LiveView.JS
Expand All @@ -98,9 +98,9 @@ defmodule TwentyFourtyEightWeb do
def verified_routes do
quote do
use Phoenix.VerifiedRoutes,
endpoint: TwentyFourtyEightWeb.Endpoint,
router: TwentyFourtyEightWeb.Router,
statics: TwentyFourtyEightWeb.static_paths()
endpoint: TwentyFortyEightWeb.Endpoint,
router: TwentyFortyEightWeb.Router,
statics: TwentyFortyEightWeb.static_paths()
end
end

Expand Down
Loading

0 comments on commit 52efc8d

Please sign in to comment.