daemon-ogre 1.4.5 → 1.4.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/daemon-ogre.rb +13 -6
  3. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.4.5
1
+ 1.4.6
data/lib/daemon-ogre.rb CHANGED
@@ -22,14 +22,15 @@ begin
22
22
  "Array! Example:\n:exclude => ['abc']" if arg[:excluded].class != Array
23
23
  end
24
24
 
25
- arg[:type]= "rb" if arg[:type].nil?
25
+ arg[:type]= "rb" if arg[:type].nil?
26
+ arg[:monkey_patch]= 0 if arg[:monkey_patch].nil?
26
27
 
27
28
  #=============================================================================================================
28
29
 
29
30
  ### GET Pre path + validation
30
31
  begin
31
32
  #get method callers path
32
- pre_path = caller[1].split('.rb:').first+('.rb')
33
+ pre_path = caller[arg[:monkey_patch].to_i].split('.rb:').first+('.rb')
33
34
  separator_symbol= String.new
34
35
  pre_path.include?('/') ? separator_symbol = '/' : separator_symbol = '\\'
35
36
  pre_path= ((pre_path.split(separator_symbol))-([pre_path.split(separator_symbol).pop])).join(separator_symbol)
@@ -113,13 +114,16 @@ begin
113
114
  return {:error => error_msg}
114
115
  end
115
116
 
116
- def load_ymls(directory)
117
+ def load_ymls(directory,*args)
118
+ arg= Hash[*args]
117
119
 
118
120
  require 'yaml'
119
121
  #require "hashie"
120
122
 
123
+ arg[:monkey_patch]= 0 if arg[:monkey_patch].nil?
124
+
121
125
  begin
122
- pre_path = caller[1].split('.rb:').first+('.rb')
126
+ pre_path = caller[arg[:monkey_patch]].split('.rb:').first+('.rb')
123
127
  separator_symbol= String.new
124
128
  pre_path.include?('/') ? separator_symbol = '/' : separator_symbol = '\\'
125
129
  pre_path= ((pre_path.split(separator_symbol))-([pre_path.split(separator_symbol).pop])).join(separator_symbol)
@@ -515,10 +519,13 @@ begin
515
519
  DaemonOgre.process_running?(input)
516
520
  end
517
521
  def require_directory(directory,*args)
518
- DaemonOgre.load_directory(directory,*args)
522
+ DaemonOgre.load_directory(directory,{:monkey_patch => 1},*args)
519
523
  end
520
524
  def require_ymls(directory)
521
- DaemonOgre.load_ymls(directory)
525
+ DaemonOgre.load_ymls(
526
+ directory,
527
+ {:monkey_patch => 1}
528
+ )
522
529
  end
523
530
  def get_port(port,max_port=65535 ,host="0.0.0.0")
524
531
  DaemonOgre.get_port(port,max_port,host)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: daemon-ogre
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.5
4
+ version: 1.4.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -112,7 +112,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
112
112
  version: '0'
113
113
  segments:
114
114
  - 0
115
- hash: 878850171271647068
115
+ hash: 4000576333674264845
116
116
  required_rubygems_version: !ruby/object:Gem::Requirement
117
117
  none: false
118
118
  requirements: