lambom 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/lambom/version.rb +1 -1
- metadata +14 -8
- checksums.yaml +0 -7
- data/lib/lambom/attribute_mixin.rb +0 -24
- data/lib/lambom/config_static.rb +0 -62
data/lib/lambom/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lambom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- J. Gomez
|
@@ -13,6 +14,7 @@ dependencies:
|
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: oj
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
16
18
|
requirements:
|
17
19
|
- - ~>
|
18
20
|
- !ruby/object:Gem::Version
|
@@ -20,6 +22,7 @@ dependencies:
|
|
20
22
|
type: :runtime
|
21
23
|
prerelease: false
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
23
26
|
requirements:
|
24
27
|
- - ~>
|
25
28
|
- !ruby/object:Gem::Version
|
@@ -27,6 +30,7 @@ dependencies:
|
|
27
30
|
- !ruby/object:Gem::Dependency
|
28
31
|
name: mixlib-authentication
|
29
32
|
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
30
34
|
requirements:
|
31
35
|
- - ~>
|
32
36
|
- !ruby/object:Gem::Version
|
@@ -34,6 +38,7 @@ dependencies:
|
|
34
38
|
type: :runtime
|
35
39
|
prerelease: false
|
36
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
37
42
|
requirements:
|
38
43
|
- - ~>
|
39
44
|
- !ruby/object:Gem::Version
|
@@ -41,6 +46,7 @@ dependencies:
|
|
41
46
|
- !ruby/object:Gem::Dependency
|
42
47
|
name: mixlib-shellout
|
43
48
|
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
44
50
|
requirements:
|
45
51
|
- - ~>
|
46
52
|
- !ruby/object:Gem::Version
|
@@ -48,6 +54,7 @@ dependencies:
|
|
48
54
|
type: :runtime
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
51
58
|
requirements:
|
52
59
|
- - ~>
|
53
60
|
- !ruby/object:Gem::Version
|
@@ -67,9 +74,7 @@ files:
|
|
67
74
|
- lambom.gemspec
|
68
75
|
- lib/lambom.rb
|
69
76
|
- lib/lambom/api.rb
|
70
|
-
- lib/lambom/attribute_mixin.rb
|
71
77
|
- lib/lambom/config.rb
|
72
|
-
- lib/lambom/config_static.rb
|
73
78
|
- lib/lambom/converger.rb
|
74
79
|
- lib/lambom/shell_mixin.rb
|
75
80
|
- lib/lambom/version.rb
|
@@ -84,25 +89,26 @@ files:
|
|
84
89
|
homepage: https://github.com/RIYIC/lambom
|
85
90
|
licenses:
|
86
91
|
- Apache-2.0
|
87
|
-
metadata: {}
|
88
92
|
post_install_message:
|
89
93
|
rdoc_options: []
|
90
94
|
require_paths:
|
91
95
|
- lib
|
92
96
|
required_ruby_version: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
93
98
|
requirements:
|
94
|
-
- - '>='
|
99
|
+
- - ! '>='
|
95
100
|
- !ruby/object:Gem::Version
|
96
101
|
version: '0'
|
97
102
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
103
|
+
none: false
|
98
104
|
requirements:
|
99
|
-
- - '>='
|
105
|
+
- - ! '>='
|
100
106
|
- !ruby/object:Gem::Version
|
101
107
|
version: '0'
|
102
108
|
requirements: []
|
103
109
|
rubyforge_project:
|
104
|
-
rubygems_version:
|
110
|
+
rubygems_version: 1.8.24
|
105
111
|
signing_key:
|
106
|
-
specification_version:
|
112
|
+
specification_version: 3
|
107
113
|
summary: Tool to apply riyic configurations
|
108
114
|
test_files: []
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: 3b02a1fe9df37c0656988197eb6be6c988a96b46
|
4
|
-
data.tar.gz: e2098057cdd281af5e151514c925ad5e6ba0b61d
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: b84d6bda96d4cd85c6f2838a71ba4ab3c9d20a0d2b9fc845d3b04d7b49ee4a134f06c620f8d3160d0838eb7f7b5ae279af7c64006378e9fb59ae4dbc8489b28a
|
7
|
-
data.tar.gz: 1a01a15d9ef8ce3a1d3e230e0fa55cca927b7b1764d515249b91247024fe6e8dfde50c0207d182bec8fa6703bbd1e15fe9a06ee91cd60918a2a104987784d685
|
@@ -1,24 +0,0 @@
|
|
1
|
-
module Riyic
|
2
|
-
module AttributeMixin
|
3
|
-
# si extendemos unha clase con este modulo os metodos fanse de clase
|
4
|
-
# si incluimos esta clase os metodos fanse de instancia
|
5
|
-
|
6
|
-
def attr_setter(*method_names)
|
7
|
-
method_names.each do |name|
|
8
|
-
send :define_method, name do |data|
|
9
|
-
instance_variable_set "@#{name}".to_sym, data
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
def varargs_setter(*method_names)
|
15
|
-
|
16
|
-
method_names.each do |name|
|
17
|
-
send :define_method, name do |*data|
|
18
|
-
instance_variable_set "@#{name}".to_sym, data
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
end
|
24
|
-
end
|
data/lib/lambom/config_static.rb
DELETED
@@ -1,62 +0,0 @@
|
|
1
|
-
require 'yaml'
|
2
|
-
require 'ostruct'
|
3
|
-
|
4
|
-
module Lambom
|
5
|
-
class Config
|
6
|
-
FILE = '/etc/riyic/lambom.conf'
|
7
|
-
|
8
|
-
def self.load
|
9
|
-
config = ::OpenStruct.new
|
10
|
-
config.server = nil
|
11
|
-
config.private_key_file = nil
|
12
|
-
config.environment = 'production'
|
13
|
-
config.loglevel = 'debug'
|
14
|
-
|
15
|
-
# si non existe o ficheiro de configuracion devolvemos a configuracion inicializada
|
16
|
-
# pode que se complete por linea de comandos
|
17
|
-
return config unless File.exists?(FILE)
|
18
|
-
|
19
|
-
h = {}
|
20
|
-
begin
|
21
|
-
h = YAML.load(IO::read(FILE))
|
22
|
-
rescue Exception => e
|
23
|
-
e.to_s =~ /line (\d+) column/
|
24
|
-
raise "Error loading yaml config file #{FILE}, syntax error in line #{$1}"
|
25
|
-
end
|
26
|
-
|
27
|
-
puts h.inspect if $debug
|
28
|
-
|
29
|
-
h.each do |k,v|
|
30
|
-
if validate(k,v)
|
31
|
-
config.send("#{k}=", v)
|
32
|
-
else
|
33
|
-
raise "Invalid value '#{v}' to parameter '#{k}'"
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
config
|
38
|
-
|
39
|
-
end
|
40
|
-
|
41
|
-
|
42
|
-
def self.validate(parametro,valor)
|
43
|
-
case parametro
|
44
|
-
when "server"
|
45
|
-
# uuid
|
46
|
-
valor =~ /^[\d\w\-]{36}$/
|
47
|
-
when "private_key_file"
|
48
|
-
#unix path
|
49
|
-
valor =~ /^[\w\s.\/\-_+%]+$/i
|
50
|
-
when "environment"
|
51
|
-
#env de rails
|
52
|
-
["production","development","test"].include?(valor)
|
53
|
-
when "loglevel"
|
54
|
-
#loglevel de chef
|
55
|
-
%w{debug info}.include?(valor)
|
56
|
-
else
|
57
|
-
false
|
58
|
-
end
|
59
|
-
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|