Skip to content

Commit

Permalink
remove Netrc dependencies from mix.exs
Browse files Browse the repository at this point in the history
- `git submodule`d netrc repository
- now execute `mix deps.star` by `mix archive.install`
  no need to dependent on mixstar in your project mix.exs file
  • Loading branch information
ma2gedev committed Sep 13, 2015
1 parent 80038d9 commit 71c6ef1
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "netrcex"]
path = netrcex
url = [email protected]:ma2gedev/netrcex.git
13 changes: 4 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,12 @@ Enjoy!

## How to install

Add `:mixstar` to your project's dependencies with `only: :dev`:

```
# mix.exs
def deps do
[{:mixstar, "~> 0.0.1", only: :dev}]
end
```shell
$ git clone [email protected]:ma2gedev/mix-star.git
$ cd mix-star
$ mix do archive.build, archive.install
```

And fetch: `mix deps.get`

Now you get `mix deps.star` command!

## How to use
Expand Down
2 changes: 1 addition & 1 deletion lib/mixstar.ex
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ defmodule MixStar do
end

defp put_request(project) do
oauth_token = Netrc.read |> Map.get("api.github.com") |> Map.get("password")
oauth_token = MixStar.Ext.Netrc.read |> Map.get("api.github.com") |> Map.get("password")
authorization_value = String.to_char_list("token #{oauth_token}")
headers = %{
'user-agent' => @user_agent,
Expand Down
4 changes: 4 additions & 0 deletions lib/mixstar/ext.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
defmodule MixStar.Ext do
# use Netrc module
Code.eval_string(File.read!(Path.join([__DIR__, "../../netrcex/lib/netrc.ex"])), [], __ENV__)
end
1 change: 0 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ defmodule MixStar.Mixfile do
# { :barbat, "~> 0.1", github: "elixir-lang/barbat.git" }
defp deps do
[
{ :netrc, "~> 0.0.1" },
{ :ex_doc, "~> 0.6", only: :dev }
]
end
Expand Down
1 change: 1 addition & 0 deletions netrcex
Submodule netrcex added at d52d56

0 comments on commit 71c6ef1

Please sign in to comment.