Skip to content

Commit

Permalink
Merge pull request #91 from djKooks/patch-deps
Browse files Browse the repository at this point in the history
Update deps version
  • Loading branch information
YellowApple committed Feb 4, 2017
2 parents 99abb51 + e0461cb commit f08d235
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 244 deletions.
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
language: elixir
elixir:
- 1.1
- 1.2
- 1.3
- 1.4
otp_release:
- 17.4
- 18.2
- 18.3
- 19.2
notifications:
webhooks:
urls:
Expand Down
44 changes: 1 addition & 43 deletions config/config.exs
Original file line number Diff line number Diff line change
@@ -1,47 +1,5 @@
use Mix.Config

config :sugar,
config_test: [true],
config_test: [truth: true],
views_dir: "test/fixtures/templates"

config :sugar, Sugar.Repos.Main,
adapter: Ecto.Adapters.Postgres,
database: "sugar_main",
username: "user",
password: "pass",
hostname: "localhost"

config :sugar, Sugar.Repos.Main,
adapter: Ecto.Adapters.Postgres,
database: "sugar_main",
username: "user",
password: "pass",
hostname: "localhost"

config :sugar, Sugar.Repos.Main,
adapter: Ecto.Adapters.Postgres,
database: "sugar_main",
username: "user",
password: "pass",
hostname: "localhost"

config :sugar, Sugar.Repos.Main,
adapter: Ecto.Adapters.Postgres,
database: "sugar_main",
username: "user",
password: "pass",
hostname: "localhost"

config :sugar, Sugar.Repos.Main,
adapter: Ecto.Adapters.Postgres,
database: "sugar_main",
username: "user",
password: "pass",
hostname: "localhost"

config :sugar, Sugar.Repos.Main,
adapter: Ecto.Adapters.Postgres,
database: "sugar_main",
username: "user",
password: "pass",
hostname: "localhost"
78 changes: 0 additions & 78 deletions lib/mix/tasks/sugar/gen/model.ex

This file was deleted.

8 changes: 0 additions & 8 deletions lib/mix/tasks/sugar/init.ex
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,6 @@ defmodule Mix.Tasks.Sugar.Init do
create_directory "#{assigns[:path]}/controllers"
Mix.Tasks.Sugar.Gen.Controller.run_detached(assigns ++ [name: "main"])

# Models
unless assigns[:no_repo] do
Mix.Tasks.Ecto.Gen.Repo.run ["-r", "#{camelize assigns[:module]}.Repos.Main"]
end
create_directory "#{assigns[:priv_path]}/main"
create_directory "#{assigns[:path]}/models"
create_directory "#{assigns[:path]}/queries"

# Views
create_directory "#{assigns[:path]}/views"
Mix.Tasks.Sugar.Gen.View.run_detached(assigns ++ [name: "main/index"])
Expand Down
1 change: 0 additions & 1 deletion lib/mix/tasks/sugar/scaffold.ex
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ defmodule Mix.Tasks.Sugar.Scaffold do
] |> Keyword.merge opts

Mix.Tasks.Sugar.Gen.Controller.run_detached([name: name] ++ assigns)
Mix.Tasks.Sugar.Gen.Model.run_detached([name: name] ++ assigns)
Mix.Tasks.Sugar.Gen.View.run_detached([name: name <> "/index"] ++ assigns)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/sugar/config.ex
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ defmodule Sugar.Config do

defp _get(key) do
env = Application.get_env(:sugar, key)
if is_list(env) do
if Keyword.keyword?(env) do
@default_options |> Keyword.merge(env)
else
env
Expand Down
11 changes: 4 additions & 7 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule Sugar.Mixfile do
def project do
[ app: :sugar,
elixir: "~> 1.0",
version: "0.4.11",
version: "0.5.0",
name: "Sugar",
source_url: "https://github.com/sugar-framework/sugar",
homepage_url: "https://sugar-framework.github.io",
Expand All @@ -16,18 +16,15 @@ defmodule Sugar.Mixfile do
end

def application do
[ applications: [ :cowboy, :plug, :templates, :poison, :ecto,
:postgrex, :plugs ],
[ applications: [ :cowboy, :plug, :templates, :poison, :plugs ],
mod: { Sugar.App, [] } ]
end

defp deps do
[ { :cowboy, "~> 1.0" },
{ :plug, "~> 1.0" },
{ :http_router, "~> 0.0" },
{ :poison, "~> 1.5" },
{ :ecto, "~> 1.0" },
{ :postgrex, "~> 0.10" },
{ :http_router, "~> 0.10" },
{ :poison, "~> 3.0" },
{ :plugs, "~> 0.1" },
{ :templates, "~> 0.0" },
{ :earmark, "~> 0.1", only: :docs },
Expand Down
57 changes: 30 additions & 27 deletions mix.lock
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
%{"calliope": {:hex, :calliope, "0.3.0"},
"certifi": {:hex, :certifi, "0.3.0"},
"connection": {:hex, :connection, "1.0.2"},
"cowboy": {:hex, :cowboy, "1.0.4"},
"cowlib": {:hex, :cowlib, "1.0.2"},
"db_connection": {:hex, :db_connection, "0.2.3"},
"decimal": {:hex, :decimal, "1.1.1"},
"dialyze": {:hex, :dialyze, "0.2.0"},
"earmark": {:hex, :earmark, "0.2.1"},
"ecto": {:hex, :ecto, "1.1.3"},
"ex_doc": {:hex, :ex_doc, "0.11.4"},
"excoveralls": {:hex, :excoveralls, "0.4.6"},
"exjsx": {:hex, :exjsx, "3.2.0"},
"hackney": {:hex, :hackney, "1.4.8"},
"http_router": {:hex, :http_router, "0.0.8"},
"idna": {:hex, :idna, "1.0.3"},
"jsx": {:hex, :jsx, "2.6.2"},
"mimerl": {:hex, :mimerl, "1.0.2"},
"plug": {:hex, :plug, "1.1.1"},
"plugs": {:hex, :plugs, "0.1.0"},
"poison": {:hex, :poison, "1.5.2"},
"poolboy": {:hex, :poolboy, "1.5.1"},
"postgrex": {:hex, :postgrex, "0.11.1"},
"ranch": {:hex, :ranch, "1.2.1"},
"ssl_verify_hostname": {:hex, :ssl_verify_hostname, "1.0.5"},
"templates": {:hex, :templates, "0.0.5"},
"xml_builder": {:hex, :xml_builder, "0.0.8"}}
%{"calliope": {:hex, :calliope, "0.3.0", "81c2937b27094eee8f8a3fce5effb9140cb8a1fbc03620c6ff57a798d400a3ce", [:mix], []},
"certifi": {:hex, :certifi, "0.7.0", "861a57f3808f7eb0c2d1802afeaae0fa5de813b0df0979153cbafcd853ababaf", [:rebar3], []},
"connection": {:hex, :connection, "1.0.2", "f4a06dd3ecae4141aa66f94ce92ea4c4b8753069472814932f1cadbc3078ab80", [:mix], []},
"cowboy": {:hex, :cowboy, "1.1.0", "d9637f0fe7f0727efc8d703a9cfc2cf9e67fd11c6f7a22d35be687e44441d734", [:rebar3], [{:cowlib, "~> 1.0.2", [hex: :cowlib, optional: false]}, {:ranch, "~> 1.2.0", [hex: :ranch, optional: false]}]},
"cowlib": {:hex, :cowlib, "1.0.2", "9d769a1d062c9c3ac753096f868ca121e2730b9a377de23dec0f7e08b1df84ee", [:make], []},
"db_connection": {:hex, :db_connection, "0.2.3", "9718deeb713ceb5213950a0de4f29b98133f4cb73cc9aca65648b5a8a1414c59", [:mix], [{:connection, "~> 1.0.2", [hex: :connection, optional: false]}, {:poolboy, "~> 1.5", [hex: :poolboy, optional: true]}, {:sbroker, "~> 0.7", [hex: :sbroker, optional: true]}]},
"decimal": {:hex, :decimal, "1.1.1", "a8ff5b673105e6cdaca96f799aeefc6f07142881b616c65db16e14e556b16e76", [:mix], []},
"dialyze": {:hex, :dialyze, "0.2.1", "9fb71767f96649020d769db7cbd7290059daff23707d6e851e206b1fdfa92f9d", [:mix], []},
"earmark": {:hex, :earmark, "0.2.1", "ba6d26ceb16106d069b289df66751734802777a3cbb6787026dd800ffeb850f3", [:mix], []},
"ecto": {:hex, :ecto, "1.1.3", "859244ba9b7e10ba18889e48172d6455b552df3f9029bf312bcc7e360e3224de", [:mix], [{:decimal, "~> 1.0", [hex: :decimal, optional: false]}, {:mariaex, "~> 0.5.0", [hex: :mariaex, optional: true]}, {:poison, "~> 1.0", [hex: :poison, optional: true]}, {:poolboy, "~> 1.4", [hex: :poolboy, optional: false]}, {:postgrex, "~> 0.11.0", [hex: :postgrex, optional: true]}, {:sbroker, "~> 0.7", [hex: :sbroker, optional: true]}]},
"ex_doc": {:hex, :ex_doc, "0.12.0", "b774aabfede4af31c0301aece12371cbd25995a21bb3d71d66f5c2fe074c603f", [:mix], [{:earmark, "~> 0.2", [hex: :earmark, optional: false]}]},
"excoveralls": {:hex, :excoveralls, "0.6.1", "9e946b6db84dba592f47632157ecd135a46384b98a430fd16007dc910c70348b", [:mix], [{:exjsx, "~> 3.0", [hex: :exjsx, optional: false]}, {:hackney, ">= 0.12.0", [hex: :hackney, optional: false]}]},
"exjsx": {:hex, :exjsx, "3.2.1", "1bc5bf1e4fd249104178f0885030bcd75a4526f4d2a1e976f4b428d347614f0f", [:mix], [{:jsx, "~> 2.8.0", [hex: :jsx, optional: false]}]},
"hackney": {:hex, :hackney, "1.6.5", "8c025ee397ac94a184b0743c73b33b96465e85f90a02e210e86df6cbafaa5065", [:rebar3], [{:certifi, "0.7.0", [hex: :certifi, optional: false]}, {:idna, "1.2.0", [hex: :idna, optional: false]}, {:metrics, "1.0.1", [hex: :metrics, optional: false]}, {:mimerl, "1.0.2", [hex: :mimerl, optional: false]}, {:ssl_verify_fun, "1.1.1", [hex: :ssl_verify_fun, optional: false]}]},
"http_router": {:hex, :http_router, "0.10.0", "32289f6a86d121ca3bb6c88c29927786a82855d7e898079b4fcfcf6d26bf8b50", [:mix], [{:cowboy, "~> 1.0", [hex: :cowboy, optional: false]}, {:plug, "~> 1.0", [hex: :plug, optional: false]}, {:poison, "~> 3.0", [hex: :poison, optional: false]}, {:xml_builder, "~> 0.0", [hex: :xml_builder, optional: false]}]},
"idna": {:hex, :idna, "1.2.0", "ac62ee99da068f43c50dc69acf700e03a62a348360126260e87f2b54eced86b2", [:rebar3], []},
"jsx": {:hex, :jsx, "2.8.1", "1453b4eb3615acb3e2cd0a105d27e6761e2ed2e501ac0b390f5bbec497669846", [:mix, :rebar3], []},
"metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], []},
"mime": {:hex, :mime, "1.0.1", "05c393850524767d13a53627df71beeebb016205eb43bfbd92d14d24ec7a1b51", [:mix], []},
"mimerl": {:hex, :mimerl, "1.0.2", "993f9b0e084083405ed8252b99460c4f0563e41729ab42d9074fd5e52439be88", [:rebar3], []},
"plug": {:hex, :plug, "1.3.0", "6e2b01afc5db3fd011ca4a16efd9cb424528c157c30a44a0186bcc92c7b2e8f3", [:mix], [{:cowboy, "~> 1.0.1 or ~> 1.1", [hex: :cowboy, optional: true]}, {:mime, "~> 1.0", [hex: :mime, optional: false]}]},
"plugs": {:hex, :plugs, "0.1.1", "ef06c91c04c4db600a9f532f970a074ac06f5630514db4c3574f94489e0cfcb4", [:mix], [{:cowboy, "~> 1.0", [hex: :cowboy, optional: false]}, {:plug, "~> 1.0", [hex: :plug, optional: false]}]},
"poison": {:hex, :poison, "3.1.0", "d9eb636610e096f86f25d9a46f35a9facac35609a7591b3be3326e99a0484665", [:mix], []},
"poolboy": {:hex, :poolboy, "1.5.1", "6b46163901cfd0a1b43d692657ed9d7e599853b3b21b95ae5ae0a777cf9b6ca8", [:rebar], []},
"postgrex": {:hex, :postgrex, "0.11.1", "f48af70c0a58b9bfd1aaa456ec4273624554cfb837726b6a7f0701da4a94b2dd", [:mix], [{:connection, "~> 1.0", [hex: :connection, optional: false]}, {:db_connection, "~> 0.2", [hex: :db_connection, optional: false]}, {:decimal, "~> 1.0", [hex: :decimal, optional: false]}]},
"ranch": {:hex, :ranch, "1.2.1", "a6fb992c10f2187b46ffd17ce398ddf8a54f691b81768f9ef5f461ea7e28c762", [:make], []},
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.1", "28a4d65b7f59893bc2c7de786dec1e1555bd742d336043fe644ae956c3497fbe", [:make, :rebar], []},
"ssl_verify_hostname": {:hex, :ssl_verify_hostname, "1.0.5", "2e73e068cd6393526f9fa6d399353d7c9477d6886ba005f323b592d389fb47be", [:make], []},
"templates": {:hex, :templates, "0.0.5", "d9b4cbdd375890c0409e3928041188ef9fedcddc6d1eb3da7ee21eb67844cf15", [:mix], [{:calliope, "~> 0.3.0", [hex: :calliope, optional: false]}]},
"xml_builder": {:hex, :xml_builder, "0.0.9", "68f336e8c5ba32c130d13e96a379cd77e0dbb1c5152c35a30be96c1d1566b05e", [:mix], []}}
56 changes: 0 additions & 56 deletions test/mix/tasks/sugar/gen/model_test.exs

This file was deleted.

10 changes: 0 additions & 10 deletions test/mix/tasks/sugar/init_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ defmodule Mix.Tasks.Sugar.InitTest do
assert File.exists?("test/fixtures/my_test_app/controllers") === true
assert File.exists?("test/fixtures/my_test_app/controllers/main.ex") === true

# Models
assert File.exists?("test/fixtures/my_test_app/priv/main") === true
assert File.exists?("test/fixtures/my_test_app/models") === true
assert File.exists?("test/fixtures/my_test_app/queries") === true

# Views
assert File.exists?("test/fixtures/my_test_app/views") === true
assert File.exists?("test/fixtures/my_test_app/views/main/index.html.eex") === true
Expand Down Expand Up @@ -57,11 +52,6 @@ defmodule Mix.Tasks.Sugar.InitTest do
assert File.exists?("test/fixtures/my_test_app/controllers") === true
assert File.exists?("test/fixtures/my_test_app/controllers/main.ex") === true

# Models
assert File.exists?("test/fixtures/my_test_app/priv/main") === true
assert File.exists?("test/fixtures/my_test_app/models") === true
assert File.exists?("test/fixtures/my_test_app/queries") === true

# Views
assert File.exists?("test/fixtures/my_test_app/views") === true
assert File.exists?("test/fixtures/my_test_app/views/main/index.html.eex") === true
Expand Down
8 changes: 0 additions & 8 deletions test/mix/tasks/sugar/scaffold_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,8 @@ defmodule Mix.Tasks.Sugar.ScaffoldTest do

assert File.exists?("test/fixtures/controllers/main.ex") === true
assert File.exists?("test/fixtures/views/main/index.html.eex") === true
assert File.exists?("test/fixtures/models/main.ex") === true
assert File.exists?("test/fixtures/queries/main.ex") === true

File.rm_rf! "test/fixtures/controllers"
File.rm_rf! "test/fixtures/models"
File.rm_rf! "test/fixtures/queries"
File.rm_rf! "test/fixtures/repo"
File.rm_rf! "test/fixtures/views"
end
Expand All @@ -35,8 +31,4 @@ defmodule Mix.Tasks.Sugar.ScaffoldTest do
Mix.Tasks.Sugar.Scaffold.run(args)
end
end

defmodule Repos.Main do
use Ecto.Repo, adapter: Ecto.Adapters.Postgres, env: Mix.env, otp_app: :sugar
end
end
4 changes: 2 additions & 2 deletions test/sugar/config_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule Sugar.ConfigTest do

test "get/1" do
if Version.match?(System.version, "< 1.2.0") do
expected_list = [true,
expected_list = [{:truth, true},
{:http, [port: 4000]},
{:https, [certfile: "",
keyfile: "",
Expand All @@ -14,7 +14,7 @@ defmodule Sugar.ConfigTest do
{:https, [certfile: "",
keyfile: "",
port: 4443]},
true]
{:truth, true}]
end
assert get(:router) === nil
assert get(:config_test) === expected_list
Expand Down

0 comments on commit f08d235

Please sign in to comment.