Skip to content

takmongwai/run_once

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RunOnce

避免ruby脚本重复运行的函数

Installation

 git clone git://github.com/weidewang/run_once.git
 cd run_once
 rake install

Usage

#!/usr/bin/env ruby

require 'rubygems'
require 'run_once'

# RunOnce.runing(:pid_dir => Dir::tmpdir,:file_name => $0)
# 
RunOnce.runing{|pid| 
  puts %Q~#{$0} is runing,pid is #{pid}~
  exit(0)
}

 # you code

exit(0)

Contributing

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages