rails-zero 0.0.6 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/jobs/rails_zero/clean_site_job.rb +13 -4
- data/bin/git +12 -0
- data/bin/rails +8 -0
- data/bin/ssh +5 -0
- data/lib/rails_zero/config.rb +8 -9
- data/lib/rails_zero/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0e037fadd28a817a765b5c071df2f4601f8a980
|
4
|
+
data.tar.gz: 71630ccbb65ead89a976335523cf4ef9abca5ce5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59c723b2a7db339e5b7b379b625aa5c21c079784d871407da0faba19ac3847c298b1cd746c3cad5e18bbf879b6cabe9f7424b9edaa3436fad05f658076b149cf
|
7
|
+
data.tar.gz: 0e8af047cdb60fcc51344e312794ec659b6c337dd18677a0a3836cc76a73fd05e43e1b5e2ed85aef8c00cbee8de49cd0aedcdc755a5ecc20c1304b16f36d3730
|
@@ -1,17 +1,26 @@
|
|
1
1
|
module RailsZero
|
2
2
|
class CleanSiteJob
|
3
3
|
def run
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
root = Rails.root.join('public').to_s
|
5
|
+
Dir[File.join(root, '**', '*').to_s].each do |absolute_path|
|
6
|
+
found_exclude = excluded_files.find do |excluded_path|
|
7
|
+
if absolute_path.start_with?(excluded_path) && File.directory?(excluded_path)
|
8
|
+
true
|
9
|
+
else
|
10
|
+
excluded_path == absolute_path
|
11
|
+
end
|
7
12
|
end
|
13
|
+
is_excluded = found_exclude != nil
|
14
|
+
FileUtils.rm_rf(absolute_path) unless is_excluded
|
8
15
|
end
|
9
16
|
end
|
10
17
|
|
11
18
|
private
|
12
19
|
|
13
20
|
def excluded_files
|
14
|
-
RailsZero.config.site.paths_to_except_from_cleanup
|
21
|
+
RailsZero.config.site.paths_to_except_from_cleanup.map do |f|
|
22
|
+
Rails.root.join('public', f).to_s
|
23
|
+
end
|
15
24
|
end
|
16
25
|
end
|
17
26
|
end
|
data/bin/git
ADDED
data/bin/rails
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application.
|
3
|
+
|
4
|
+
ENGINE_ROOT = File.expand_path('../..', __FILE__)
|
5
|
+
ENGINE_PATH = File.expand_path('../../lib/rails_zero/engine', __FILE__)
|
6
|
+
|
7
|
+
require 'rails/all'
|
8
|
+
require 'rails/engine/commands'
|
data/bin/ssh
ADDED
data/lib/rails_zero/config.rb
CHANGED
@@ -43,15 +43,14 @@ module RailsZero
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def paths_to_except_from_cleanup
|
46
|
-
@paths_to_except_from_cleanup ||=
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
end
|
46
|
+
@paths_to_except_from_cleanup ||= %w[
|
47
|
+
404.html
|
48
|
+
422.html
|
49
|
+
500.html
|
50
|
+
favicon.ico
|
51
|
+
robots.txt
|
52
|
+
assets
|
53
|
+
]
|
55
54
|
end
|
56
55
|
|
57
56
|
private
|
data/lib/rails_zero/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-zero
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jens Bissinger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -85,6 +85,9 @@ files:
|
|
85
85
|
- app/jobs/rails_zero/clean_site_job.rb
|
86
86
|
- app/jobs/rails_zero/generate_site_job.rb
|
87
87
|
- app/views/layouts/rails_zero/application.html.erb
|
88
|
+
- bin/git
|
89
|
+
- bin/rails
|
90
|
+
- bin/ssh
|
88
91
|
- config/routes.rb
|
89
92
|
- lib/rails-zero.rb
|
90
93
|
- lib/rails_zero/config.rb
|