daddy 0.5.11 → 0.5.12
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/itamae/cookbooks/app_base_dir.rb +33 -0
- data/lib/daddy/itamae.rb +5 -39
- data/lib/daddy/itamae/config.rb +9 -0
- data/lib/daddy/itamae/env/dad_env.rb +4 -0
- data/lib/daddy/itamae/env/os_version.rb +3 -0
- data/lib/daddy/itamae/ext/remote_file.rb +35 -0
- data/lib/daddy/itamae/i18n.rb +4 -0
- data/lib/daddy/version.rb +1 -1
- data/lib/tasks/app_base_dir.rake +1 -9
- metadata +8 -3
- data/lib/daddy/itamae/os_version.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 579a0828199198496d56a2646e0ade28a1af3049
|
4
|
+
data.tar.gz: afdfc1e20ebbd83651237af7c5e7d75b8da1b1ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5137c02e93414a0507a580f817f0272ce03d503e47ada61f4222af8aac29969058c82413794a0b22c4acb4cdb168f64e8c7661b8a3cdf93ee7a04e736c1ceedd
|
7
|
+
data.tar.gz: fb6a3facc78426c63cbd7b72e623a7a6803c336df0bf6ec23b3c9728870ff08cd2090f5aca8072091d2b2f4099a522d1a82c6cdbf8b75c340df6e44150cbaf03
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'daddy/itamae'
|
2
|
+
|
3
|
+
case dad_env
|
4
|
+
when 'production', 'development'
|
5
|
+
directory '/var/lib' do
|
6
|
+
user 'root'
|
7
|
+
end
|
8
|
+
directory File.join('/var/lib', Daddy.config.application) do
|
9
|
+
user 'root'
|
10
|
+
owner ENV['USER']
|
11
|
+
group ENV['USER']
|
12
|
+
mode '755'
|
13
|
+
end
|
14
|
+
directory File.join('/var/lib', Daddy.config.application, dad_env) do
|
15
|
+
user 'root'
|
16
|
+
owner ENV['USER']
|
17
|
+
group ENV['USER']
|
18
|
+
mode '755'
|
19
|
+
end
|
20
|
+
when 'test'
|
21
|
+
directory File.join('/tmp', Daddy.config.application) do
|
22
|
+
user 'root'
|
23
|
+
owner ENV['USER']
|
24
|
+
group ENV['USER']
|
25
|
+
mode '755'
|
26
|
+
end
|
27
|
+
directory File.join('/tmp', Daddy.config.application, dad_env) do
|
28
|
+
user 'root'
|
29
|
+
owner ENV['USER']
|
30
|
+
group ENV['USER']
|
31
|
+
mode '755'
|
32
|
+
end
|
33
|
+
end
|
data/lib/daddy/itamae.rb
CHANGED
@@ -1,44 +1,10 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
module Itamae
|
4
|
-
module Resource
|
5
|
-
class Template
|
6
|
-
|
7
|
-
def find_source_file_with_daddy_convention
|
8
|
-
begin
|
9
|
-
ret = find_source_file_without_daddy_convention
|
10
|
-
rescue SourceNotFoundError => e
|
11
|
-
if attributes.source == :auto
|
12
|
-
ret = find_source_file_in_templates
|
13
|
-
else
|
14
|
-
raise e
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
ret
|
19
|
-
end
|
20
|
-
|
21
|
-
def find_source_file_in_templates
|
22
|
-
itamae_dir = ::File.expand_path('../../../itamae', __FILE__)
|
23
|
-
path = ::File.join(itamae_dir, source_file_dir, "#{attributes.path}.erb")
|
24
|
-
if ::File.exist?(path)
|
25
|
-
path
|
26
|
-
else
|
27
|
-
raise SourceNotFoundError, "source file is not found (searched in daddy path: #{path})"
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
alias_method :find_source_file_without_daddy_convention, :find_source_file
|
32
|
-
alias_method :find_source_file, :find_source_file_with_daddy_convention
|
33
|
-
end
|
34
|
-
end
|
1
|
+
Dir[File.join(File.dirname(__FILE__), 'itamae', 'ext', '*.rb')].each do |f|
|
2
|
+
require f
|
35
3
|
end
|
36
4
|
|
37
|
-
|
38
|
-
|
39
|
-
I18n.default_locale = ENV['LANG'].start_with?('ja_') ? :ja : :en
|
40
|
-
I18n.load_path += Dir.glob(File.expand_path('../../../itamae/locale/*.yml', __FILE__))
|
5
|
+
require_relative 'itamae/config'
|
6
|
+
require_relative 'itamae/i18n'
|
41
7
|
|
42
|
-
Dir[File.join(File.dirname(__FILE__), 'itamae', '*.rb')].each do |f|
|
8
|
+
Dir[File.join(File.dirname(__FILE__), 'itamae', 'env', '*.rb')].each do |f|
|
43
9
|
require f
|
44
10
|
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'itamae/resource/template'
|
2
|
+
|
3
|
+
module Itamae
|
4
|
+
module Resource
|
5
|
+
class Template
|
6
|
+
|
7
|
+
def find_source_file_with_daddy_convention
|
8
|
+
begin
|
9
|
+
ret = find_source_file_without_daddy_convention
|
10
|
+
rescue SourceNotFoundError => e
|
11
|
+
if attributes.source == :auto
|
12
|
+
ret = find_source_file_in_templates
|
13
|
+
else
|
14
|
+
raise e
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
ret
|
19
|
+
end
|
20
|
+
|
21
|
+
def find_source_file_in_templates
|
22
|
+
itamae_dir = ::File.expand_path('../../../../../itamae', __FILE__)
|
23
|
+
path = ::File.join(itamae_dir, source_file_dir, "#{attributes.path}.erb")
|
24
|
+
if ::File.exist?(path)
|
25
|
+
path
|
26
|
+
else
|
27
|
+
raise SourceNotFoundError, "source file is not found (searched in daddy path: #{path})"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
alias_method :find_source_file_without_daddy_convention, :find_source_file
|
32
|
+
alias_method :find_source_file, :find_source_file_with_daddy_convention
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
data/lib/daddy/version.rb
CHANGED
data/lib/tasks/app_base_dir.rake
CHANGED
@@ -3,15 +3,7 @@ require_relative 'task_helper'
|
|
3
3
|
namespace :dad do
|
4
4
|
|
5
5
|
task :app_base_dir do
|
6
|
-
|
7
|
-
when 'production', 'development'
|
8
|
-
app_base_dir = File.join('/var/lib', Daddy.config.application, Rails.env)
|
9
|
-
run "sudo mkdir -p #{app_base_dir}",
|
10
|
-
"sudo chown #{ENV['USER']}:#{ENV['USER']} #{app_base_dir}"
|
11
|
-
when 'test'
|
12
|
-
app_base_dir = File.join('/tmp', Daddy.config.application, Rails.env)
|
13
|
-
run "mkdir -p #{app_base_dir}"
|
14
|
-
end
|
6
|
+
run_itamae 'app_base_dir'
|
15
7
|
end
|
16
8
|
|
17
9
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: daddy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ichy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|
@@ -247,6 +247,7 @@ files:
|
|
247
247
|
- app/assets/stylesheets/datepicker.css.scss
|
248
248
|
- app/assets/stylesheets/ympicker.css.scss
|
249
249
|
- bin/dad
|
250
|
+
- itamae/cookbooks/app_base_dir.rb
|
250
251
|
- itamae/cookbooks/docker/install.rb
|
251
252
|
- itamae/cookbooks/docker/registry/install.rb
|
252
253
|
- itamae/cookbooks/god/install.rb
|
@@ -290,7 +291,11 @@ files:
|
|
290
291
|
- lib/daddy/helpers/html_helper.rb
|
291
292
|
- lib/daddy/http_client.rb
|
292
293
|
- lib/daddy/itamae.rb
|
293
|
-
- lib/daddy/itamae/
|
294
|
+
- lib/daddy/itamae/config.rb
|
295
|
+
- lib/daddy/itamae/env/dad_env.rb
|
296
|
+
- lib/daddy/itamae/env/os_version.rb
|
297
|
+
- lib/daddy/itamae/ext/remote_file.rb
|
298
|
+
- lib/daddy/itamae/i18n.rb
|
294
299
|
- lib/daddy/model.rb
|
295
300
|
- lib/daddy/models/crud_extension.rb
|
296
301
|
- lib/daddy/models/query_extension.rb
|