Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
slogsdon committed May 14, 2014
1 parent eca1768 commit c41ab7d
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 17 deletions.
20 changes: 13 additions & 7 deletions lib/mix/tasks/sugar/gen/config.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ defmodule Mix.Tasks.Sugar.Gen.Config do
@recursive true

@moduledoc """
Creates Sugar config files.
## Command line options
* `--path` - override the project path. Defaults to `lib/[app name]`
"""
def run(args) do
opts = OptionParser.parse(args)
Expand All @@ -31,14 +37,14 @@ defmodule Mix.Tasks.Sugar.Gen.Config do

embed_template :config, ~S"""
defmodule Config do
def config do
[
log: false,
server: [
port: 4000
def config do
[
log: false,
server: [
port: 4000
]
]
]
end
end
end
"""
end
6 changes: 6 additions & 0 deletions lib/mix/tasks/sugar/gen/controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ defmodule Mix.Tasks.Sugar.Gen.Controller do
@recursive true

@moduledoc """
Creates Sugar controller files.
## Command line options
* `--path` - override the project path. Defaults to `lib/[app name]`
"""
def run(args) do
opts = OptionParser.parse(args)
Expand Down
6 changes: 6 additions & 0 deletions lib/mix/tasks/sugar/gen/model.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ defmodule Mix.Tasks.Sugar.Gen.Model do
@recursive true

@moduledoc """
Creates Sugar model files.
## Command line options
* `--path` - override the project path. Defaults to `lib/[app name]`
"""
def run(args) do
opts = OptionParser.parse(args)
Expand Down
6 changes: 6 additions & 0 deletions lib/mix/tasks/sugar/gen/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ defmodule Mix.Tasks.Sugar.Gen.Router do
@recursive true

@moduledoc """
Creates Sugar router files.
## Command line options
* `--path` - override the project path. Defaults to `lib/[app name]`
"""
def run(args) do
opts = OptionParser.parse(args)
Expand Down
6 changes: 6 additions & 0 deletions lib/mix/tasks/sugar/gen/view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ defmodule Mix.Tasks.Sugar.Gen.View do
@recursive true

@moduledoc """
Creates Sugar view files.
## Command line options
* `--path` - override the project path. Defaults to `lib/[app name]`
"""
def run(args) do
opts = OptionParser.parse(args)
Expand Down
8 changes: 8 additions & 0 deletions lib/mix/tasks/sugar/init.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ defmodule Mix.Tasks.Sugar.Init do
@recursive true

@moduledoc """
Creates Sugar support files for new projects after adding Sugar as a
project dependency.
## Command line options
* `--path` - override the project path. Defaults to `lib/[app name]`
* `--priv_path` - override the priv path. Defaults to `priv`
"""
def run(args) do
opts = OptionParser.parse(args)
Expand Down
8 changes: 8 additions & 0 deletions lib/mix/tasks/sugar/scaffold.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ defmodule Mix.Tasks.Sugar.Scaffold do
@recursive true

@moduledoc """
Creates Sugar controller, model (+ queries and migration), and view
files for a resource.
## Command line options
* `--path` - override the project path. Defaults to `lib/[app name]`
* `--priv_path` - override the priv path. Defaults to `priv`
"""
def run(args) do
opts = OptionParser.parse(args)
Expand Down
3 changes: 0 additions & 3 deletions lib/sugar/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,6 @@ defmodule Sugar.Router do
binding = binding()
conn = var!(conn)

# only continue if we receive :ok from middleware
# {:ok, conn} = apply_middleware

# pass off to controller action
call_controller_action conn, unquote(controller), unquote(action), binding
end
Expand Down
8 changes: 1 addition & 7 deletions lib/sugar/supervisor.ex
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,9 @@ defmodule Sugar.Supervisor do
registered childred.
"""
def init(opts) do
children = [
# Define workers and child supervisors to be supervised
# worker(Sugar.Worker, [])
]

children = []
opts = Keyword.put opts, :strategy, :one_for_one

# See http://elixir-lang.org/docs/stable/Supervisor.Behaviour.html
# for other strategies and supported options
supervise(children, opts)
end
end

0 comments on commit c41ab7d

Please sign in to comment.