osx_provision 0.9.5 → 0.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGES +5 -1
- data/lib/osx_provision/generic_provision.rb +20 -2
- data/lib/osx_provision/osx_provision.rb +1 -1
- data/lib/osx_provision/version.rb +1 -1
- data/thor/osx_install.thor +7 -20
- 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: e8a6f0c727bfe2456a12a469d9f01a94b4149062
|
4
|
+
data.tar.gz: 6d6fbd395803b7c2697daacecc1551f31f89c405
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45f6ab87c51f79049a231139610e53ce47a7b09638a8e2f514c3476b6d3c2dda09ef10b089d0b566b6a737af07706372d779ca340bf75fafbfd1502e9d059e4e
|
7
|
+
data.tar.gz: 706542524a790db5c9c5a7acd729f885a5513ef04b29b6361b2c5a424a5dbc49fa76753891b73bcb34d435db3ea0736ef63e1c95d3efeb8df879675b3c52fc8b
|
data/CHANGES
CHANGED
@@ -10,7 +10,7 @@ class GenericProvision
|
|
10
10
|
|
11
11
|
attr_reader :interpolator, :env, :script_list, :server_info
|
12
12
|
|
13
|
-
def initialize config_file_name, scripts_file_names
|
13
|
+
def initialize parent_class, config_file_name, scripts_file_names
|
14
14
|
@interpolator = TextInterpolator.new
|
15
15
|
|
16
16
|
@env = read_config(config_file_name)
|
@@ -23,9 +23,13 @@ class GenericProvision
|
|
23
23
|
|
24
24
|
create_script_methods
|
25
25
|
|
26
|
+
create_thor_methods(parent_class) if parent_class.ancestors.include?(Thor)
|
27
|
+
|
26
28
|
@server_info = env[:node] ? env[:node] : {}
|
27
29
|
end
|
28
30
|
|
31
|
+
protected
|
32
|
+
|
29
33
|
def create_script_methods
|
30
34
|
script_list.keys.each do |name|
|
31
35
|
singleton_class.send(:define_method, name.to_sym) do
|
@@ -34,7 +38,21 @@ class GenericProvision
|
|
34
38
|
end
|
35
39
|
end
|
36
40
|
|
37
|
-
|
41
|
+
def create_thor_methods parent_class
|
42
|
+
provision = self
|
43
|
+
|
44
|
+
provision.script_list.each do |name, value|
|
45
|
+
title = provision.script_title(value)
|
46
|
+
|
47
|
+
title = title.nil? ? name : title
|
48
|
+
|
49
|
+
parent_class.send(:desc, name, title) if parent_class.respond_to?(:desc)
|
50
|
+
|
51
|
+
parent_class.send(:define_method, name.to_sym) do
|
52
|
+
provision.send "#{name}".to_sym
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
38
56
|
|
39
57
|
def read_config config_file_name
|
40
58
|
hash = JSON.parse(File.read(config_file_name), :symbolize_names => true)
|
@@ -3,7 +3,7 @@ require 'osx_provision/generic_provision'
|
|
3
3
|
class OsxProvision < GenericProvision
|
4
4
|
USER_LOCAL_BIN = "/usr/local/bin"
|
5
5
|
|
6
|
-
def initialize config_file_name=".osx_provision.json", scripts_file_names=[]
|
6
|
+
def initialize parent_class, config_file_name=".osx_provision.json", scripts_file_names=[]
|
7
7
|
scripts_file_names.unshift(File.expand_path("osx_provision_scripts.sh", File.dirname(__FILE__))) # make it first
|
8
8
|
|
9
9
|
super
|
data/thor/osx_install.thor
CHANGED
@@ -3,25 +3,12 @@ $: << File.expand_path(File.dirname(__FILE__) + '/../lib')
|
|
3
3
|
require 'osx_provision/osx_provision'
|
4
4
|
|
5
5
|
class OsxInstall < Thor
|
6
|
-
|
7
|
-
@@installer ||= OsxProvision.new ".osx_provision.json", [File.expand_path("project_scripts.sh", File.dirname(__FILE__))]
|
8
|
-
end
|
9
|
-
|
10
|
-
def self.create_thor_script_methods parent_class
|
11
|
-
installer.script_list.each do |name, value|
|
12
|
-
title = installer.script_title(value)
|
6
|
+
@installer = OsxProvision.new self, ".osx_provision.json", [File.expand_path("project_scripts.sh", File.dirname(__FILE__))]
|
13
7
|
|
14
|
-
|
15
|
-
|
16
|
-
parent_class.send :desc, name, title
|
17
|
-
parent_class.send(:define_method, name.to_sym) do
|
18
|
-
self.class.installer.send "#{name}".to_sym
|
19
|
-
end
|
20
|
-
end
|
8
|
+
class << self
|
9
|
+
attr_reader :installer
|
21
10
|
end
|
22
11
|
|
23
|
-
create_thor_script_methods self
|
24
|
-
|
25
12
|
desc "all", "Installs all required packages"
|
26
13
|
def all
|
27
14
|
invoke :brew
|
@@ -52,22 +39,22 @@ class OsxInstall < Thor
|
|
52
39
|
|
53
40
|
desc "postgres_create_schemas", "Initializes postgres schemas"
|
54
41
|
def postgres_create_schemas
|
55
|
-
|
42
|
+
OsxInstall.installer.postgres_create_schemas
|
56
43
|
end
|
57
44
|
|
58
45
|
desc "postgres_drop_schemas", "Drops postgres schemas"
|
59
46
|
def postgres_drop_schemas
|
60
|
-
|
47
|
+
OsxInstall.installer.postgres_drop_schemas
|
61
48
|
end
|
62
49
|
|
63
50
|
desc "mysql_create_schemas", "Initializes mysql schemas"
|
64
51
|
def mysql_create_schemas
|
65
|
-
|
52
|
+
OsxInstall.installer.mysql_create_schemas
|
66
53
|
end
|
67
54
|
|
68
55
|
desc "mysql_drop_schemas", "Drops mysql schemas"
|
69
56
|
def mysql_drop_schemas
|
70
|
-
|
57
|
+
OsxInstall.mysql_drop_schemas
|
71
58
|
end
|
72
59
|
|
73
60
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: osx_provision
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Shvets
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: text-interpolator
|