Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mina-hooks

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mina-hooks

  • 0.2.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

mina-hooks

  • Homepage
  • Issues
  • Documentation
  • [Email](mailto:don at elskwid.net)

Description

Mina plugin to provide local task hooks that run before and after the mina commands.

Mina uses a queueing system to create a deploy script that executes on the remote system but that leaves no way to know when the deploy has started or ended.

mina-hooks gets around this limitation by defining a new mina_cleanup! method that does the following:

  • detect if mina is being run with the deploy argument
  • invoke each of the before_mina_tasks
  • delegate to the pre-existing mina_cleanup!
  • invoke each of the after_mina_tasks

Warning

This is extremenly dependant on Mina internals so buyer beware. However, it's not a lot of code so we should be fine. It will all be just fine.

Features

Easily add tasks

Helper methods to add tasks to the lists: (see Usage)

  • before_mina
  • after_mina

Access the task lists

Lists of tasks to be run before and after the mina commands:

  • before_mina_tasks
  • after_mina_tasks

Output

Prints confirmation that the hook is running

  • <----- Invoke before mina tasks
  • <----- Invoke after mina tasks

Prints task list using Mina-style output if set to verbose

  • >> tasks: some:task, some:other:task

Still Just Rake

Task invocation is still handled by Rake and operates under the same rules you've come to expect.

Usage

require "mina/hooks"

before_mina

# Inside your deploy tasks ...

before_mina :"some:task", :"some:other:task"
before_mina :"task:added:later"

puts before_mina_tasks.inspect
# => [:"some:task", :"some:other:task", :"task:added:later"]

# ...

after_mina

# Still inside your deploy tasks ...

after_mina :"some:task", :"some:other:task"
after_mina :"task:added:later", :"some:task"

puts after_mina_tasks.inspect
# => [:"some:task", :"some:other:task", :"task:added:later", :"some:task"]

# ...

Because this is Rake, the above task some:task will only be invoked once.

Requirements

Install

$ gem install mina-hooks

Copyright (c) 2013 Don Morrison

See {file:LICENSE.txt} for details.

FAQs

Package last updated on 03 Dec 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc