itamae 1.0.0.beta38 → 1.0.0.beta39
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/itamae/definition.rb +7 -0
- data/lib/itamae/logger.rb +4 -0
- data/lib/itamae/recipe.rb +7 -0
- data/lib/itamae/resource/base.rb +30 -22
- data/lib/itamae/resource/file.rb +1 -1
- data/lib/itamae/version.txt +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3a4021dcb9b9977066b6717638e220e25f52ac2
|
4
|
+
data.tar.gz: bdce6341d1b945d3a0d46a4e48cde128cc2966d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc7e7781f0e9b88d3b389ac2ea4b458fe7ac0d84256c5fbf814d09a53758ff987eba395ba7c2f6fd44903a4ced8c356704f0a630dc0cd0d59b348286ef724924
|
7
|
+
data.tar.gz: 048e9fd161e15223462c0b33963939ff01c82ea218cd3feb347d42d66797d68be379e475116a1e0e5cfad846f616228061ec09beacccf965b4d2d0967ac76573
|
data/lib/itamae/definition.rb
CHANGED
@@ -52,6 +52,13 @@ module Itamae
|
|
52
52
|
@children = RecipeChildren.new
|
53
53
|
end
|
54
54
|
|
55
|
+
def respond_to_missing?(method, include_private = false)
|
56
|
+
Resource.get_resource_class(method)
|
57
|
+
true
|
58
|
+
rescue NameError
|
59
|
+
false
|
60
|
+
end
|
61
|
+
|
55
62
|
def method_missing(method, name, &block)
|
56
63
|
klass = Resource.get_resource_class(method)
|
57
64
|
resource = klass.new(self, name, &block)
|
data/lib/itamae/logger.rb
CHANGED
data/lib/itamae/recipe.rb
CHANGED
@@ -42,6 +42,13 @@ module Itamae
|
|
42
42
|
instance_eval(File.read(@path), @path, 1)
|
43
43
|
end
|
44
44
|
|
45
|
+
def respond_to_missing?(method, include_private = false)
|
46
|
+
Resource.get_resource_class(method)
|
47
|
+
true
|
48
|
+
rescue NameError
|
49
|
+
false
|
50
|
+
end
|
51
|
+
|
45
52
|
def method_missing(method, name, &block)
|
46
53
|
klass = Resource.get_resource_class(method)
|
47
54
|
resource = klass.new(self, name, &block)
|
data/lib/itamae/resource/base.rb
CHANGED
@@ -61,28 +61,7 @@ module Itamae
|
|
61
61
|
end
|
62
62
|
|
63
63
|
[specific_action || action].flatten.each do |action|
|
64
|
-
|
65
|
-
|
66
|
-
Logger.info "action: #{action}"
|
67
|
-
|
68
|
-
next if action == :nothing
|
69
|
-
|
70
|
-
unless options[:dry_run]
|
71
|
-
Logger.formatter.indent do
|
72
|
-
Logger.debug "(in pre_action)"
|
73
|
-
pre_action
|
74
|
-
|
75
|
-
Logger.debug "(in set_current_attributes)"
|
76
|
-
set_current_attributes
|
77
|
-
|
78
|
-
Logger.debug "(in show_differences)"
|
79
|
-
show_differences
|
80
|
-
|
81
|
-
public_send("action_#{specific_action || action}".to_sym, options)
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
@current_action = nil
|
64
|
+
run_action(action, options)
|
86
65
|
end
|
87
66
|
|
88
67
|
updated! if different?
|
@@ -112,6 +91,35 @@ module Itamae
|
|
112
91
|
|
113
92
|
private
|
114
93
|
|
94
|
+
def run_action(action, options)
|
95
|
+
@current_action = action
|
96
|
+
|
97
|
+
Logger.info "action: #{action}"
|
98
|
+
|
99
|
+
return if action == :nothing
|
100
|
+
|
101
|
+
unless options[:dry_run]
|
102
|
+
Logger.formatter.indent do
|
103
|
+
Logger.debug "(in pre_action)"
|
104
|
+
pre_action
|
105
|
+
|
106
|
+
Logger.debug "(in set_current_attributes)"
|
107
|
+
set_current_attributes
|
108
|
+
|
109
|
+
Logger.debug "(in show_differences)"
|
110
|
+
show_differences
|
111
|
+
|
112
|
+
public_send("action_#{action}".to_sym, options)
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
@current_action = nil
|
117
|
+
end
|
118
|
+
|
119
|
+
def respond_to_missing?(method, include_private = false)
|
120
|
+
self.class.defined_attributes.has_key?(method) || super
|
121
|
+
end
|
122
|
+
|
115
123
|
def method_missing(method, *args, &block)
|
116
124
|
if self.class.defined_attributes[method]
|
117
125
|
if args.size == 1
|
data/lib/itamae/resource/file.rb
CHANGED
data/lib/itamae/version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.0.
|
1
|
+
1.0.0.beta39
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: itamae
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.beta39
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryota Arai
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|