ProductPromotion
Logo

Elixir

made by https://0x3d.site

GitHub - rkotze/eye_drops: Configurable Elixir mix task to watch file changes and run the corresponding command.
Configurable Elixir mix task to watch file changes and run the corresponding command. - rkotze/eye_drops
Visit Site

GitHub - rkotze/eye_drops: Configurable Elixir mix task to watch file changes and run the corresponding command.

GitHub - rkotze/eye_drops: Configurable Elixir mix task to watch file changes and run the corresponding command.

EyeDrops

Build Status Gitter Hex pm

A configurable Elixir mix watch task

mix eye_drops Start watching all configured tasks ... more options

Description

Watch file changes in a project and run the corresponding command when a matching file change happens.

The reason for this is when code changes are made you typically want to run unit and acceptance tests. So while you make changes you can configure this mix tasks to auto run and help get feed back quicker.

Installation

Add eye_drops to your list of dependencies in mix.exs:

def deps do
  [{:eye_drops, "~> 1.3"}]
end

Basic setup

In your config folder, add the following eye_drops config into one of your config files.

The example below will run the mix test command

config :eye_drops, 
  tasks: [
    %{
      id: :unit_tests,
      name: "Unit tests",
      run_on_start: true,
      cmd: "mix test",
      paths: ["web/*", "test/*"]
    },
    %{
      id: :acceptance,
      name: "Acceptance tests",
      cmd: "mix acceptance",
      paths: ["web/*", "features/*"]
    }
  ]

You can setup multiple tasks and it will run one after the other.

Task config properties

  • id unique atom to identify tasks
  • name provide a name for task
  • run_on_start default is false. When EyeDrops starts, tasks with this set to true will run as well
  • cmd the actual command to run
  • path is a list. Can be exact, glob pattern or just a folder name

Commands while running eye_drops

When EyeDrops has started you can run all or a specific task without needing to stop or change a file

  • all this will run all your tasks
  • task_id run a specific task from your EyeDrops config

Optional switches

  • mix eye_drops --include-tasks "unit_tests,acceptance" provide the id of tasks to watch instead of all

Using vagrant

This is if you are editing your files outside of the vagrant machine e.g. windows but running commands in vagrant.

The idea is when the task runs it first ssh into your vagrant machine and then executes the command.

vagrant ssh-config > .ssh-config - save the ssh-config on your host machine

config :eye_drops, 
  tasks: [
    %{
      id: :unit_tests,
      name: "Unit tests",
      cmd: "ssh -F .ssh-config default mix test",
      paths: ["web/*", "test/*"]
    }
  ]

Run mix eye_drops from outside of vagrant in host terminal where the mix.exs file is located

Contribute

  1. Create issue
  2. Fork it!
  3. Create your feature branch (git checkout -b my-new-feature)
  4. Commit your changes (git commit -am 'Add some feature')
  5. Push to the branch (git push origin my-new-feature)
  6. Create new Pull Request

Articles
to learn more about the elixir concepts.

Resources
which are currently available to browse on.

mail [email protected] to add your project or resources here 🔥.

FAQ's
to know more about the topic.

mail [email protected] to add your project or resources here 🔥.

Queries
or most google FAQ's about Elixir.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory