Skip to content

Commit

Permalink
Update mix.exs (#112)
Browse files Browse the repository at this point in the history
* Update mix.exs

* Formatted

* Move test helpers
  • Loading branch information
ArthurClemens authored Aug 13, 2023
1 parent d467da2 commit dfe02a0
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 11 deletions.
4 changes: 4 additions & 0 deletions config/test.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import Config

config :phoenix, :json_library, Jason
config :primer_live, env: Mix.env()
11 changes: 7 additions & 4 deletions lib/helpers/attribute_helpers.ex
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ defmodule PrimerLive.Helpers.AttributeHelpers do
uppercase letters, digits, etc...
"""
def random_string(len \\ 12) when is_integer(len) and len > 0 do
(for _ <- 1..len, do: rand_uniform(32, 126))
for(_ <- 1..len, do: rand_uniform(32, 126))
|> List.to_string()
end

Expand All @@ -329,8 +329,10 @@ defmodule PrimerLive.Helpers.AttributeHelpers do
# distributed in the range `n <= Y <= m`.
# (Because we just shift X to the right).
defp rand_uniform(n, m) do
:rand.uniform(m - n + 1) # random X
|> Kernel.+(n - 1) # shift X to the right to get Y
# random X
:rand.uniform(m - n + 1)
# shift X to the right to get Y
|> Kernel.+(n - 1)
end

@doc """
Expand Down Expand Up @@ -960,7 +962,8 @@ defmodule PrimerLive.Helpers.AttributeHelpers do
touch_layer_attrs =
append_attributes([
["data-touch": ""],
!is_nil(assigns[:phx_click_touch]) && !is_modal && ["phx-click": assigns[:phx_click_touch]]
!is_nil(assigns[:phx_click_touch]) && !is_modal &&
["phx-click": assigns[:phx_click_touch]]
])

focus_wrap_id = "focus-wrap-#{id || generated_id}"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 2 additions & 7 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,17 @@ defmodule PrimerLive.MixProject do
def project do
[
app: :primer_live,
version: "0.4.0",
version: "0.4.1",
homepage_url: "https://github.com/ArthurClemens/primer_live",
description: description(),
package: package(),
aliases: aliases(),
name: "PrimerLive",
deps: deps(),
docs: docs(),
elixirc_paths: elixirc_paths(Mix.env())
]
end

# Specifies which paths to compile per environment.
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]

defp description() do
"A collection of function components that implements GitHub's Primer Design System."
end
Expand All @@ -35,7 +30,7 @@ defmodule PrimerLive.MixProject do
defp deps do
[
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
{:ecto, "~> 3.10", only: :test, runtime: false},
{:ecto, "~> 3.10", runtime: false},
{:ecto_sql, "~> 3.10", only: :test, runtime: false},
{:esbuild, "~> 0.7", only: :dev},
{:ex_doc, "~> 0.30", only: :dev},
Expand Down

0 comments on commit dfe02a0

Please sign in to comment.