Skip to content

Commit

Permalink
(Refactor) refactor by elixir, WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Naupio committed Dec 22, 2021
1 parent 9d52542 commit 8d1ea23
Show file tree
Hide file tree
Showing 44 changed files with 185 additions and 51 deletions.
5 changes: 5 additions & 0 deletions .formatter.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Used by "mix format"
[
inputs: ["mix.exs", "config/*.exs"],
subdirectories: ["apps/*"]
]
42 changes: 25 additions & 17 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
.rebar3
_*
.eunit
*.o
*.beam
*.plt
*.swp
*.swo
.erlang.cookie
ebin
log
# The directory Mix will write compiled artifacts to.
/_build/

# If you run "mix test --cover", coverage assets end up here.
/cover/

# The directory Mix downloads your dependencies sources to.
/deps/

# Where third-party dependencies like ExDoc output generated docs.
/doc/

# Ignore .fetch files in case you like to edit your project deps locally.
/.fetch

# If the VM crashes, it generates a dump, let's ignore it too.
erl_crash.dump
.rebar
logs
_build
.idea
*.iml
rebar3.crashdump

# Also ignore archive artifacts (built via "mix archive.build").
*.ez

# Temporary files, for example, from tests.
/tmp/

.vscode
.elixir_ls
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016-2018 [Naupio Z.Y. Huang](naupio_zy_huang@163.com)
Copyright (c) 2016-2022 [Naupio Z.Y. Huang](naupioh@gmail.com)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# pita
(Work In Process) **pita** is a general distributed computation system with **Erlang** language base on DAG model. This project is inspired by [DouBan 's DPark](https://github.com/douban/dpark) and [Apache Spark](https://github.com/apache/spark).
# PiCal

(Work In Process) **PiCal** is a general distributed computation system with **Elixir** language base on DAG model. This project is inspired by [DouBan 's DPark](https://github.com/douban/dpark) and [Apache Spark](https://github.com/apache/spark).

# LICENSE
- The [MIT License](./LICENSE)
- Copyright (c) 2016-2018 [Naupio Z.Y Huang](https://github.com/Naupio)
- Copyright (c) 2016-2022 [Naupio Z.Y Huang](https://github.com/Naupio)

# WARNING
This project is **not finish** (yet).
Expand Down
4 changes: 4 additions & 0 deletions apps/rdd/.formatter.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Used by "mix format"
[
inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"]
]
26 changes: 26 additions & 0 deletions apps/rdd/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# The directory Mix will write compiled artifacts to.
/_build/

# If you run "mix test --cover", coverage assets end up here.
/cover/

# The directory Mix downloads your dependencies sources to.
/deps/

# Where third-party dependencies like ExDoc output generated docs.
/doc/

# Ignore .fetch files in case you like to edit your project deps locally.
/.fetch

# If the VM crashes, it generates a dump, let's ignore it too.
erl_crash.dump

# Also ignore archive artifacts (built via "mix archive.build").
*.ez

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

# Temporary files, for example, from tests.
/tmp/
21 changes: 21 additions & 0 deletions apps/rdd/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# PiCal.RDD

**TODO: Add description**

## Installation

If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `rdd` to your list of dependencies in `mix.exs`:

```elixir
def deps do
[
{:rdd, "~> 0.1.0"}
]
end
```

Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
be found at <https://hexdocs.pm/rdd>.

18 changes: 18 additions & 0 deletions apps/rdd/lib/pi_cal/rdd.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
defmodule PiCal.RDD do
@moduledoc """
Documentation for `PiCal.RDD`.
"""

@doc """
Hello world.
## Examples
iex> PiCal.RDD.hello()
:world
"""
def hello do
:world
end
end
33 changes: 33 additions & 0 deletions apps/rdd/mix.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
defmodule PiCal.RDD.MixProject do
use Mix.Project

def project do
[
app: :rdd,
version: "0.1.0",
build_path: "../../_build",
config_path: "../../config/config.exs",
deps_path: "../../deps",
lockfile: "../../mix.lock",
elixir: "~> 1.13-rc",
start_permanent: Mix.env() == :prod,
deps: deps()
]
end

# Run "mix help compile.app" to learn about applications.
def application do
[
extra_applications: [:logger]
]
end

# Run "mix help deps" to learn about dependencies.
defp deps do
[
# {:dep_from_hexpm, "~> 0.3.0"},
# {:dep_from_git, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"},
# {:sibling_app_in_umbrella, in_umbrella: true}
]
end
end
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions apps/rdd/test/pi_cal/rdd_test.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
defmodule PiCal.RDDTest do
use ExUnit.Case
doctest PiCal.RDD

test "greets the world" do
assert PiCal.RDD.hello() == :world
end
end
1 change: 1 addition & 0 deletions apps/rdd/test/test_helper.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ExUnit.start()
18 changes: 18 additions & 0 deletions config/config.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This file is responsible for configuring your umbrella
# and **all applications** and their dependencies with the
# help of the Config module.
#
# Note that all applications in your umbrella share the
# same configuration and dependencies, which is why they
# all use the same configuration file. If you want different
# configurations or dependencies per app, it is best to
# move said applications out of the umbrella.
import Config

# Sample configuration:
#
# config :logger, :console,
# level: :info,
# format: "$date $time [$level] $metadata$message\n",
# metadata: [:user_id]
#
3 changes: 0 additions & 3 deletions config/sys.config

This file was deleted.

6 changes: 0 additions & 6 deletions config/vm.args

This file was deleted.

21 changes: 21 additions & 0 deletions mix.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
defmodule PiCal.MixProject do
use Mix.Project

def project do
[
apps_path: "apps",
version: "0.1.0",
start_permanent: Mix.env() == :prod,
deps: deps()
]
end

# Dependencies listed here are available only for this
# project and cannot be accessed from applications inside
# the apps folder.
#
# Run "mix help deps" for examples and options.
defp deps do
[]
end
end
20 changes: 0 additions & 20 deletions rebar.config

This file was deleted.

1 change: 0 additions & 1 deletion rebar.lock

This file was deleted.

0 comments on commit 8d1ea23

Please sign in to comment.