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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 633d49c207a8742a7222135569aeff6c659bb9b4
4
- data.tar.gz: 3a480e119c0ee13841f9841db8d52863bb47ea72
3
+ metadata.gz: c0e037fadd28a817a765b5c071df2f4601f8a980
4
+ data.tar.gz: 71630ccbb65ead89a976335523cf4ef9abca5ce5
5
5
  SHA512:
6
- metadata.gz: c87b300472f1a8b5b7789be70ec49e644f4f29c4426cdc0a44b051f6023da58e71c45321279f72a551f4402c1a59399ed45cde784184e04b84badc5176bbf98b
7
- data.tar.gz: 1a7ae46814a4623ccc5ca2eb8392129c459293645b76138caa34b2cc35e1f4f66c20414a4c3cdec5c0fce54927b8fa46bcebe11d188744ac47d1c146775b3bfa
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
- Dir[Rails.root.join('public', '**', '*').to_s].each do |f|
5
- if !excluded_files.include?(f) && File.exists?(f)
6
- FileUtils.rm_rf(f)
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
@@ -0,0 +1,12 @@
1
+ #!/bin/bash
2
+ set -e
3
+ set -u
4
+
5
+ SCRIPTS_DIR=$(dirname $0)
6
+
7
+ KEY_PATH=$HOME/.rails_zero.pkey
8
+ echo -e $RAILS_ZERO_GIT_DEPLOYER_SSH_KEY_CONTENT > $KEY_PATH
9
+
10
+ SSH_KEYFILE=$KEY_PATH GIT_SSH=$SCRIPTS_DIR/ssh git $@
11
+
12
+ rm -rf $KEY_PATH
@@ -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
@@ -0,0 +1,5 @@
1
+ #!/bin/bash
2
+ set -e
3
+ set -u
4
+
5
+ ssh -i $SSH_KEYFILE -o StrictHostKeyChecking=no "$@"
@@ -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 ||= begin
47
- %w[ 404.html
48
- 422.html
49
- 500.html
50
- favicon.ico
51
- ].map do |f|
52
- Rails.root.join('public', f).to_s
53
- end
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
@@ -1,3 +1,3 @@
1
1
  module RailsZero
2
- VERSION = "0.0.6"
2
+ VERSION = "0.1.0"
3
3
  end
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.6
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-03-14 00:00:00.000000000 Z
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