Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update syntax and APIs

  • Loading branch information...
commit 2fc4619c05e5e3addeb199f4053f4c86b46c9e95 1 parent 03b6545
@yrashk authored
View
8 lib/release.ex
@@ -100,7 +100,7 @@ defmodule Relex.Release do
to do release upgrades, as sasl includes release_handler module
"""
defcallback basic_applications(options) do
- %w(kernel stdlib sasl)a ++ (if include_elixir?(options), do: %w(elixir iex)a, else: [])
+ ~w(kernel stdlib sasl)a ++ (if include_elixir?(options), do: ~w(elixir iex)a, else: [])
end
@doc """
@@ -169,7 +169,7 @@ defmodule Relex.Release do
By default, it's bin/*, lib/*, include/* and info
"""
defcallback include_erts_file?(file) do
- regexes = [%r"^bin(/.+)?$", %r"^lib(/.+)?$", %r"^include(/.+)?$", %r(^info$)]
+ regexes = [~r"^bin(/.+)?$", ~r"^lib(/.+)?$", ~r"^include(/.+)?$", ~r(^info$)]
Enum.any?(regexes, &Regex.match?(&1, file))
end
@@ -179,7 +179,7 @@ defmodule Relex.Release do
By default, it's ebin/*, priv/* and include/*
"""
defcallback include_app_file?(file) do
- regexes = [%r"^ebin(/.+)?$", %r"^priv(/.+)?$", %r"^include(/.+)?$"]
+ regexes = [~r"^ebin(/.+)?$", ~r"^priv(/.+)?$", ~r"^include(/.+)?$"]
Enum.any?(regexes, &Regex.match?(&1, file))
end
@@ -266,7 +266,7 @@ defmodule Relex.Release do
path = Path.join([options[:path] || File.cwd!, release.name(options)])
bin_path = Path.join(path, "bin")
File.mkdir_p!(bin_path)
- lc executable inlist %w(elixir iex) do
+ lc executable inlist ~w(elixir iex) do
executable_path = System.find_executable(executable)
File.cp!(executable_path, Path.join(bin_path, Path.basename(executable)))
end
View
2  lib/release/start_clean.ex
@@ -3,7 +3,7 @@ defmodule Relex.Release.StartClean do
def name, do: "start_clean"
def version, do: "1.0"
- def basic_applications(_options), do: %w(kernel stdlib)a
+ def basic_applications(_options), do: ~w(kernel stdlib)a
def applications, do: []
def include_erts?, do: false
def include_elixir?, do: false
View
2  mix.exs
@@ -10,7 +10,7 @@ defmodule Relex.Mixfile do
# Configuration for the OTP application
def application do
- [applications: %w(sasl)a]
+ [applications: ~w(sasl)a]
end
defp deps do
View
4 test/relex_test.exs
@@ -1,4 +1,4 @@
-Code.require_file "../test_helper.exs", __FILE__
+Code.require_file "../test_helper.exs", __ENV__.file
defmodule TestRelease do
use Relex.Release
@@ -52,5 +52,5 @@ defmodule RelexTest do
assert TestRelease.StartClean.AsDefault.assemble!(path: path) == :ok
end
- defp path, do: Path.join(Path.dirname(__FILE__), "tmp")
+ defp path, do: Path.join(Path.dirname(__ENV__.file), "tmp")
end
Please sign in to comment.
Something went wrong with that request. Please try again.