Coder Social home page Coder Social logo

dobby's Introduction

Dobby

A houself for everyday development tasks.

He can start and stop processes:

dobby start apache
dobby start mysql
dobby restart jekyll

He remembers where your configuration files are:

dobby edit apache

And he knows what's running at any given time:

dobby status

This is not meant as a replacement for something heavy like fabric. It provides only the bare essentials. Starting, stopping, restarting, and configuring.

Getting Started

Clone the Dobby repo to the location of your choice, then alias dobby.rb as dobby:

alias dobby=`ruby /path/to/dobby/dobby.rb`

Alternatively you can simply source the Dobby autocomplete script. This will set you up with the alias and some basic autocompletion (bash only):

source '/path/to/dobby/etc/dobby-prompt.sh'

Creating a configuration file

Dobby uses plain ruby as its configuration language. The default path for the dobby config file is ~/.dobby_config.

Create this file and as a test add the following configuration:

config :git do |c|
  c.name = "Gitconfig"
  c.file = "~/.gitconfig"
end

This makes Dobby aware of your git config file. In your terminal you should now be able to open your ~/.gitconfig file with:

dobby edit git

Let's also add a server. In this case, we will try Jekyll:

service :jekyll do |s|
  s.name = "Jekyll"
  s.start = "jekyll --auto --server"
  s.process = 'jekyll'
end

Giving your configuration a start command and a process name (or stop command) tells Dobby how it can start and stop this service. Let's try that. Jekyll does not start as a daemon, so we will need two terminal windows:

dobby start jekyll

In the second terminal window, try some of these:

dobby status
dobby restart jekyll
dobby stop jekyll

Congrats! You have an elf.

Todo

Documentation is a work in progress. For more complex tasks, please check back later.

For now, here's a full apache example. I will leave you to figure it out:

service :apache do |s|
  s.name = "Apache"
  s.file = "/private/etc/apache2/httpd.conf"

  s.start   = "apachectl start"
  s.stop    = "apachectl stop"
  s.restart = "apachectl restart"

  s.process = "httpd"
  s.needs_root = true
end

config :php => :apache do |c|
  c.name  = "PHP"
  c.file  = "/usr/local/etc/php/5.4/php.ini"
end

Direct dependencies (as seen here as :php => :apache) will force the parent process to restart when a dependent child is edited.

License

Dobby is released under the MIT license:

dobby's People

Contributors

pkriete avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.