capricorn 0.2.18 → 0.2.19

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,14 +5,14 @@ specify do |s|
5
5
  s.homepage = %q{Fix this}
6
6
 
7
7
  s.author = "[AUTHOR]"
8
- s.email = %q{Fix this}
8
+ s.email = "[EMAIL]"
9
9
 
10
10
  s.ignore_files %r{^public/(\d{3}|index)\.html$}
11
11
  s.ignore_files %r{^public/favicon.ico$}
12
12
  s.ignore_files %r{^public/robots.txt$}
13
13
  s.ignore_files %r{^public/images/rails\.png$}
14
14
  s.ignore_files %r{^lib/tasks}
15
- s.ignore_files %r{^config/(boot|database|environment|initializers|locales)}
15
+ s.ignore_files %r{^config/(boot|database|environment|initializers)}
16
16
  s.ignore_files %r{^app/controllers/application_controller.rb}
17
17
  s.ignore_files %r{^app/helpers/application_helper.rb}
18
18
  s.ignore_files %r{^db/schema.rb}
@@ -42,11 +42,8 @@ module Capricorn
42
42
  def link_engines
43
43
  Dir.chdir(system.satellite_root) do
44
44
  system.as_user(system.web_user, system.web_group) do
45
- index_html = File.join(system.satellite_root, 'public', 'index.html')
46
- if File.file?(index_html)
47
- FileUtils.rm_f(index_html, :verbose => true) rescue nil
48
- end
49
45
 
46
+ clean_index_html_file
50
47
  write_environment
51
48
  clean_links
52
49
  @dependecies.reverse_each do |spec|
@@ -65,6 +62,13 @@ module Capricorn
65
62
 
66
63
  private
67
64
 
65
+ def clean_index_html_file
66
+ index_html = File.join(system.satellite_root, 'public', 'index.html')
67
+ if File.file?(index_html)
68
+ FileUtils.rm_f(index_html, :verbose => true) rescue nil
69
+ end
70
+ end
71
+
68
72
  def link(src, dst)
69
73
  FileUtils.mkdir_p(File.dirname(dst), :verbose => true)
70
74
  FileUtils.mkdir_p(src, :verbose => true)
@@ -109,6 +113,15 @@ module Capricorn
109
113
  end
110
114
  end
111
115
 
116
+ path = File.join(spec.full_gem_path, 'config/locales')
117
+ if File.directory?(path)
118
+ FileUtils.mkdir_p("config/locales", :verbose => true)
119
+ Dir.glob("#{path}/*.{rb,yml,yaml}").each do |locale_file|
120
+ FileUtils.ln_s(locale_file, "config/locales/#{File.basename(locale_file)}",
121
+ :verbose => true) rescue nil
122
+ end
123
+ end
124
+
112
125
  path = File.join(spec.full_gem_path, 'db', 'migrate')
113
126
  if File.directory?(path)
114
127
  FileUtils.mkdir_p("db/migrate", :verbose => true)
@@ -123,6 +136,9 @@ module Capricorn
123
136
  end
124
137
 
125
138
  def clean_links
139
+ Dir.glob("config/locales/*").each do |path|
140
+ FileUtils.rm_rf(path) if File.symlink?(path)
141
+ end
126
142
  FileUtils.rm_rf("lib/tasks/vendor", :verbose => true)
127
143
  FileUtils.rm_rf("public/vendor", :verbose => true)
128
144
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capricorn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.18
4
+ version: 0.2.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Menke