osx_provision 0.9.7 → 0.9.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MmQxMzkyM2Y4YTI4Yzg3ZWFmMTFiZjc3ZTI4MWRjMzAzMTQzNjVmOQ==
5
+ data.tar.gz: !binary |-
6
+ MDkyODdiNGQzYTA0ZDNkYWJjZTEzZjc3YjdmZjVmZDg0NTU0ZGRhYg==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ NzQxNWMxYmVhZmM1MjI1ZDY4N2I3YjI4OTVkYmQ0NjZkMThhZTlkYTc5YmFj
10
+ YjU4MDYxYjIyZGZlMjdmOGI3ODcwN2ZiYzExMjE2NGE1YjI2MTkzNGNjOWM3
11
+ MzllZGE1ZGI1MTIzNjk4YWIwMWQ4ZWYwODhjNzMzM2MyZTIwN2E=
12
+ data.tar.gz: !binary |-
13
+ Y2E4YzAzM2QyYmVlYmQ1ZGVjNWY3YzFhOWQzYWQ5NWFjZGVkNDgwMjBlMGUy
14
+ MzIzZDNjYWM0MDZlMGM0NDE4ODAwMzYwZmE1ZTUzYzc0MDMyZmNhMWJlMjg0
15
+ MDYwMDRhMDBhYTZkN2JlYzU1NWE3OGVjMjMzNWQzZjBmNmY5YTc=
data/CHANGES CHANGED
@@ -30,4 +30,8 @@
30
30
 
31
31
  == Version 0.9.7
32
32
 
33
- * Bug fix.
33
+ * Bug fix.
34
+
35
+ == Version 0.9.8
36
+
37
+ * Bump script_executor version.
data/Gemfile CHANGED
@@ -2,7 +2,7 @@ source "https://rubygems.org"
2
2
 
3
3
  group :default do
4
4
  gem "text-interpolator", "~>1.0"
5
- gem "script_executor", "~>1.4"
5
+ gem "script_executor", "~>1.5"
6
6
  gem "thor", "~>0.19"
7
7
  gem "json_pure", "~>1.8"
8
8
  end
@@ -1,6 +1,6 @@
1
- require 'osx_provision/generic_provision'
1
+ require 'script_executor/base_provision'
2
2
 
3
- class OsxProvision < GenericProvision
3
+ class OsxProvision < BaseProvision
4
4
  USER_LOCAL_BIN = "/usr/local/bin"
5
5
 
6
6
  def initialize parent_class, config_file_name=".osx_provision.json", scripts_file_names=[]
@@ -9,11 +9,11 @@ class OsxProvision < GenericProvision
9
9
  super
10
10
  end
11
11
 
12
- def prepare
13
- env['password'] = ask_password("Enter password for #{env[:node][:user]}: ")
14
-
15
- run(server_info.merge(capture_output: false, sudo: true), "prepare", env)
16
- end
12
+ # def prepare
13
+ # env['password'] = ask_password("Enter password for #{env[:node][:user]}: ")
14
+ #
15
+ # run(server_info.merge(capture_output: false, sudo: true), "prepare", env)
16
+ # end
17
17
 
18
18
  def brew
19
19
  installed = package_installed("#{USER_LOCAL_BIN}/brew")
@@ -55,10 +55,6 @@ class OsxProvision < GenericProvision
55
55
  end
56
56
  end
57
57
 
58
- def init_launch_agent
59
- run(server_info, "init_launch_agent", env)
60
- end
61
-
62
58
  def mysql
63
59
  installed = package_installed "#{USER_LOCAL_BIN}/mysql"
64
60
 
@@ -91,14 +87,6 @@ class OsxProvision < GenericProvision
91
87
  run(server_info, "postgres_restart", env.merge({started: started}))
92
88
  end
93
89
 
94
- def postgres_stop
95
- run server_info, "postgres_stop", env
96
- end
97
-
98
- def postgres_start
99
- run server_info, "postgres_start", env
100
- end
101
-
102
90
  def ruby
103
91
  installed = package_installed "#{ENV['HOME']}/.rvm/rubies/ruby-1.9.3-p527/bin/ruby"
104
92
 
@@ -141,10 +129,6 @@ class OsxProvision < GenericProvision
141
129
  run(server_info, "selenium_restart", env.merge({started: started}))
142
130
  end
143
131
 
144
- def postgres_create_user
145
- run(server_info, "postgres_create_user", env)
146
- end
147
-
148
132
  def postgres_create_schemas
149
133
  env[:postgres][:app_schemas].each do |schema|
150
134
  run(server_info, "postgres_create_schema", env.merge(schema: schema))
@@ -157,18 +141,6 @@ class OsxProvision < GenericProvision
157
141
  end
158
142
  end
159
143
 
160
- def postgres_drop_user
161
- run(server_info, "postgres_drop_user", env)
162
- end
163
-
164
- def mysql_create_user
165
- run(server_info, "mysql_create_user", env)
166
- end
167
-
168
- def mysql_drop_user
169
- run(server_info, "mysql_drop_user", env)
170
- end
171
-
172
144
  def mysql_create_schemas
173
145
  env[:mysql][:app_schemas].each do |schema|
174
146
  run(server_info, "mysql_create_schema", env.merge(schema: schema))
@@ -1,3 +1,3 @@
1
1
  class OsxProvision
2
- VERSION = "0.9.7"
2
+ VERSION = "0.9.8"
3
3
  end
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
 
19
19
 
20
20
  spec.add_runtime_dependency "text-interpolator", ["~> 1.0"]
21
- spec.add_runtime_dependency "script_executor", ["~> 1.4"]
21
+ spec.add_runtime_dependency "script_executor", ["~> 1.5"]
22
22
  spec.add_runtime_dependency "thor", ["~> 0.19"]
23
23
  spec.add_runtime_dependency "json_pure", ["~> 1.8"]
24
24
  spec.add_development_dependency "gemspec_deps_gen", ["~> 1.1"]
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: osx_provision
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.7
5
- prerelease:
4
+ version: 0.9.8
6
5
  platform: ruby
7
6
  authors:
8
7
  - Alexander Shvets
@@ -14,7 +13,6 @@ dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: text-interpolator
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -30,23 +27,20 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: script_executor
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ~>
36
32
  - !ruby/object:Gem::Version
37
- version: '1.4'
33
+ version: '1.5'
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ~>
44
39
  - !ruby/object:Gem::Version
45
- version: '1.4'
40
+ version: '1.5'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: thor
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ~>
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - ~>
60
53
  - !ruby/object:Gem::Version
@@ -62,7 +55,6 @@ dependencies:
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: json_pure
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
59
  - - ~>
68
60
  - !ruby/object:Gem::Version
@@ -70,7 +62,6 @@ dependencies:
70
62
  type: :runtime
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
66
  - - ~>
76
67
  - !ruby/object:Gem::Version
@@ -78,7 +69,6 @@ dependencies:
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: gemspec_deps_gen
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
73
  - - ~>
84
74
  - !ruby/object:Gem::Version
@@ -86,7 +76,6 @@ dependencies:
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
80
  - - ~>
92
81
  - !ruby/object:Gem::Version
@@ -94,7 +83,6 @@ dependencies:
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: gemcutter
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
87
  - - ~>
100
88
  - !ruby/object:Gem::Version
@@ -102,7 +90,6 @@ dependencies:
102
90
  type: :development
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
94
  - - ~>
108
95
  - !ruby/object:Gem::Version
@@ -124,7 +111,6 @@ files:
124
111
  - Rakefile
125
112
  - Thorfile
126
113
  - lib/osx_provision.rb
127
- - lib/osx_provision/generic_provision.rb
128
114
  - lib/osx_provision/osx_provision.rb
129
115
  - lib/osx_provision/osx_provision_scripts.sh
130
116
  - lib/osx_provision/version.rb
@@ -136,27 +122,26 @@ files:
136
122
  - thor/project_scripts.sh
137
123
  homepage: http://github.com/shvets/osx_provision
138
124
  licenses: []
125
+ metadata: {}
139
126
  post_install_message:
140
127
  rdoc_options: []
141
128
  require_paths:
142
129
  - lib
143
130
  required_ruby_version: !ruby/object:Gem::Requirement
144
- none: false
145
131
  requirements:
146
132
  - - ! '>='
147
133
  - !ruby/object:Gem::Version
148
134
  version: '0'
149
135
  required_rubygems_version: !ruby/object:Gem::Requirement
150
- none: false
151
136
  requirements:
152
137
  - - ! '>='
153
138
  - !ruby/object:Gem::Version
154
139
  version: '0'
155
140
  requirements: []
156
141
  rubyforge_project:
157
- rubygems_version: 1.8.23
142
+ rubygems_version: 2.2.2
158
143
  signing_key:
159
- specification_version: 3
144
+ specification_version: 4
160
145
  summary: Library for building Mac OSX provisioning
161
146
  test_files:
162
147
  - spec/osx_provision_spec.rb
@@ -1,79 +0,0 @@
1
- require 'json'
2
- require "highline"
3
-
4
- require 'text_interpolator'
5
- require 'script_executor/executable'
6
- require 'script_executor/script_locator'
7
-
8
- class GenericProvision
9
- include Executable, ScriptLocator
10
-
11
- attr_reader :interpolator, :env, :script_list, :server_info
12
-
13
- def initialize parent_class, config_file_name, scripts_file_names
14
- @interpolator = TextInterpolator.new
15
-
16
- @env = read_config(config_file_name)
17
-
18
- @script_list = {}
19
-
20
- scripts_file_names.each do |name|
21
- @script_list.merge!(scripts(name))
22
- end
23
-
24
- create_script_methods
25
-
26
- create_thor_methods(parent_class) if parent_class.ancestors.include?(Thor)
27
-
28
- @server_info = env[:node] ? env[:node] : {}
29
- end
30
-
31
- protected
32
-
33
- def create_script_methods
34
- script_list.keys.each do |name|
35
- singleton_class.send(:define_method, name.to_sym) do
36
- self.send :run, server_info, name.to_s, env
37
- end
38
- end
39
- end
40
-
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
56
-
57
- def read_config config_file_name
58
- hash = JSON.parse(File.read(config_file_name), :symbolize_names => true)
59
-
60
- interpolator.interpolate hash
61
- end
62
-
63
- def terminal
64
- @terminal ||= HighLine.new
65
- end
66
-
67
- def ask_password message
68
- terminal.ask(message) { |q| q.echo = "*" }
69
- end
70
-
71
- def run server_info, script_name, params
72
- execute(server_info) { evaluate_script_body(script_list[script_name], params, :string) }
73
- end
74
-
75
- def run_command server_info, command
76
- execute(server_info.merge({script: command}))
77
- end
78
-
79
- end