rubtools 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f3bc054e20d4ffff30df38666dde16f6f8f25ceb
4
- data.tar.gz: 8d463efd7f20b3031002690284b65754bd7cbdaa
3
+ metadata.gz: 22527797eacfb02733bc730908b3c0cfc5a192dd
4
+ data.tar.gz: 5d8219a89981a3a0acb12b40924b6ef4d14ef4f4
5
5
  SHA512:
6
- metadata.gz: c297f58e745371f96f8ac0f60bcea878490167c931e940cc0e13664c32ce4a0262751e54b037d8026fd1dc724be8b4572dbe8558663df6c54ef790d705099bce
7
- data.tar.gz: d53f8952318a85cd440abee959d189193459a3549ffc76ba209a56d379d678167fee974302549fa1a05a84e83022bf51b04522042050835908872046a892f6ce
6
+ metadata.gz: 6351028b8801489e355353db68c65f896fd06de170cc7277cdd1114eedd80ea37800f6ffafdcf4f747b11cff693fb499b540b9ea48ad74985344cfc9c44a7214
7
+ data.tar.gz: 898fc255b24a6eafaab92df7f285445a78fac923d1ffb502c9fa6a66c4dd751a04f51b18d3b509fe4ace9d76aaab7d57891c2da56651cda48fd355fbda6a1063
@@ -2,7 +2,8 @@ require "open3"
2
2
 
3
3
  module Rubtools
4
4
  class Recipe
5
- attr_accessor :available_methods, :options, :config
5
+ attr_accessor :available_methods, :methods_hidden, :options, :config
6
+ @methods_hidden = false
6
7
 
7
8
  def self.register_methods methods
8
9
  @available_methods = methods
@@ -12,6 +13,14 @@ module Rubtools
12
13
  @available_methods ? @available_methods : []
13
14
  end
14
15
 
16
+ def self.hide_methods
17
+ @methods_hidden = true
18
+ end
19
+
20
+ def self.are_methods_hidden?
21
+ @methods_hidden
22
+ end
23
+
15
24
  ## Override new method to initialize recipes objects without config and options
16
25
  #
17
26
  def self.new config, options, *args, &blk
@@ -1,3 +1,3 @@
1
1
  module Rubtools
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
data/lib/rubtools.rb CHANGED
@@ -81,15 +81,18 @@ module Rubtools
81
81
  for constant in Rubtools::Tools.constants
82
82
  @tools[constant.downcase] = Array.new
83
83
 
84
- for method in Rubtools::Tools.const_get(constant).available_methods
85
- method_hash = Hash.new
86
- method_hash[method] = Array.new
84
+ const = Rubtools::Tools.const_get(constant)
85
+ unless const.are_methods_hidden?
86
+ for method in const.available_methods
87
+ method_hash = Hash.new
88
+ method_hash[method] = Array.new
89
+
90
+ for param in Rubtools::Tools.const_get(constant).instance_method(method).parameters
91
+ method_hash[method] << param.last
92
+ end
87
93
 
88
- for param in Rubtools::Tools.const_get(constant).instance_method(method).parameters
89
- method_hash[method] << param.last
94
+ @tools[constant.downcase] << method_hash
90
95
  end
91
-
92
- @tools[constant.downcase] << method_hash
93
96
  end
94
97
  end
95
98
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubtools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pierre FILSTROFF
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-25 00:00:00.000000000 Z
11
+ date: 2014-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: term-ansicolor