procemon 0.0.9 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.9
1
+ 0.1.1
@@ -1,4 +1,5 @@
1
1
  module Application
2
+
2
3
  class << self
3
4
  attr_accessor :config,
4
5
  :environment,
@@ -11,10 +12,14 @@ module Application
11
12
  :db_drop,
12
13
  :daemon,
13
14
  :config_file,
14
- :create_documentation
15
+ :create_documentation,
16
+ :client
15
17
  end
16
- self.config ||= Hash.new()
18
+
19
+ self.client ||= Hash.new()
20
+ self.config ||= Hash.new()
17
21
  self.environment ||= String.new()
22
+
18
23
  end
19
24
 
20
25
  App= Application unless defined?(App)
@@ -35,18 +35,21 @@ class Class
35
35
  end
36
36
 
37
37
  # Returns an Array of subclasses (direct and indirect)
38
- def subclasses
38
+ def subclasses_all
39
39
  ret = []
40
- each_subclass {|c| ret << c}
40
+ each_subclass {|c| ret.push c}
41
41
  ret
42
42
  end
43
43
 
44
+ alias :all_subclasses :subclasses_all
45
+
44
46
  # Returns an Array of direct subclasses
45
- def direct_subclasses
47
+ def subclasses
46
48
  ret = []
47
- each_subclass {|c| ret << c if c.superclass == self }
49
+ each_subclass {|c| ret.push(c) if c.superclass == self }
48
50
  ret
49
51
  end
52
+ alias :subclass :subclasses
50
53
 
51
54
  # create singleton attribute
52
55
  def class_attr_accessor(name)
@@ -0,0 +1,16 @@
1
+ class Module
2
+
3
+ # return the module objects direct sub modules
4
+ def modules
5
+ constants.collect {|const_name| const_get(const_name)}.select {|const| const.class == Module}
6
+ end
7
+
8
+ # return the module objects direct sub modules
9
+ def classes
10
+ constants.collect {|const_name| const_get(const_name)}.select {|const| const.class == Class}
11
+ end
12
+
13
+ alias :submodules :modules
14
+ alias :subclasses :classes
15
+
16
+ end
data/lib/procemon.rb CHANGED
@@ -48,6 +48,14 @@ module Procemon
48
48
 
49
49
  end
50
50
 
51
+ def self.doc_gen
52
+ Dir.glob(File.join(Dir.pwd,'{doc,docs,document,documents}','**','generate_*')).each do |one_doc_generator|
53
+ require one_doc_generator
54
+ end
55
+ puts "done!"
56
+ Process.exit!
57
+ end
58
+
51
59
  ### Load the requirements in to the general Module
52
60
  #load File.expand_path(File.join(File.dirname(__FILE__),'procemon'
53
61
 
data/test/test.rb CHANGED
@@ -1,7 +1,17 @@
1
1
  require_relative "../lib/procemon.rb"
2
2
 
3
- puts require_relative_directory( "hello").inspect
4
3
 
4
+ class Test1
5
+ end
6
+
7
+ class Test2 < Test1
8
+
9
+ end
10
+
11
+
12
+ ret= Array.new
13
+ Test1.each_subclass{|c| ret.push c}
14
+ puts ret
5
15
 
6
16
 
7
17
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: procemon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-11 00:00:00.000000000 Z
12
+ date: 2013-12-04 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: ! 'This is a collection of my Ruby Procs in the adventure of becoming
15
15
  the best! In short this provides extra tools in Application configs, argumens processing,daemonise,
@@ -53,6 +53,7 @@ files:
53
53
  - lib/procemon/mpatch/hash.rb
54
54
  - lib/procemon/mpatch/integer.rb
55
55
  - lib/procemon/mpatch/kernel.rb
56
+ - lib/procemon/mpatch/module.rb
56
57
  - lib/procemon/mpatch/object.rb
57
58
  - lib/procemon/mpatch/proc.rb
58
59
  - lib/procemon/mpatch/process.rb