rails_pwnerer 0.4.8 → 0.4.9
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +2 -0
- data/README +2 -1
- data/lib/pwnage/app/svn.rb +6 -12
- data/rails_pwnerer.gemspec +2 -2
- metadata +1 -1
data/CHANGELOG
CHANGED
data/README
CHANGED
@@ -17,7 +17,8 @@ accomplished at the end. Assuming you don't do something wrong.
|
|
17
17
|
|
18
18
|
Read a couple more 20-page guides, and learn to push newer versions
|
19
19
|
of your application. You'll become lazy, and take shortcuts, like having
|
20
|
-
production passwords in the repository, or insecure file permissions
|
20
|
+
production passwords in the repository, or insecure file permissions, or
|
21
|
+
you'll forget to delete cached javascripts and stylesheets from public/.
|
21
22
|
I won't even mention backups.
|
22
23
|
|
23
24
|
Life with +rails_pwnerer+:
|
data/lib/pwnage/app/svn.rb
CHANGED
@@ -56,14 +56,8 @@ class RailsPwnage::App::Svn
|
|
56
56
|
FileUtils.rm_r cold_copy if File.exists? cold_copy
|
57
57
|
FileUtils.cp_r RailsPwnage::Config.path_to(app_name), 'tmp'
|
58
58
|
|
59
|
-
# remove the
|
60
|
-
|
61
|
-
["cache#{fs}*", "pids#{fs}*.pid", "sessions#{fs}*"].each do |pattern|
|
62
|
-
Dir.glob("tmp#{fs}#{app_name}#{pattern}") do |entry|
|
63
|
-
next if entry =~ /\.svn$/
|
64
|
-
FileUtils.rm_r entry
|
65
|
-
end
|
66
|
-
end
|
59
|
+
# remove the garbage in the cold copy
|
60
|
+
cleanup_app_caches File.join('tmp', app_name), true
|
67
61
|
|
68
62
|
# pack and protect the cold copy
|
69
63
|
Dir.chdir 'tmp' do
|
@@ -92,8 +86,8 @@ class RailsPwnage::App::Svn
|
|
92
86
|
end
|
93
87
|
|
94
88
|
# remove any files not in SVN in the application dir
|
95
|
-
def cleanup_app_dir(app_name, target_dir)
|
96
|
-
Dir.chdir(RailsPwnage::Config.path_to(app_name)) do
|
89
|
+
def cleanup_app_dir(app_name, target_dir, app_name_is_dir = false)
|
90
|
+
Dir.chdir(app_name_is_dir ? app_name : RailsPwnage::Config.path_to(app_name)) do
|
97
91
|
# get a listing of what happened in that directory
|
98
92
|
xml_status = `svn status --xml #{target_dir}`
|
99
93
|
xsdoc = REXML::Document.new xml_status
|
@@ -108,12 +102,12 @@ class RailsPwnage::App::Svn
|
|
108
102
|
end
|
109
103
|
|
110
104
|
# clean up the application directory by removing caches
|
111
|
-
def cleanup_app_caches(app_name)
|
105
|
+
def cleanup_app_caches(app_name, app_name_is_dir = false)
|
112
106
|
# TODO: learn how Rails caches work and kill those too
|
113
107
|
['app', 'lib', 'public/images',
|
114
108
|
'public/javascripts', 'public/stylesheets', 'script',
|
115
109
|
'test', 'tmp', 'vendor'
|
116
|
-
].each { |dir| cleanup_app_dir app_name, dir }
|
110
|
+
].each { |dir| cleanup_app_dir app_name, dir, app_name_is_dir }
|
117
111
|
end
|
118
112
|
|
119
113
|
def manage(app_name, action)
|
data/rails_pwnerer.gemspec
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
|
2
|
-
# Gem::Specification for Rails_pwnerer-0.4.
|
2
|
+
# Gem::Specification for Rails_pwnerer-0.4.9
|
3
3
|
# Originally generated by Echoe
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = %q{rails_pwnerer}
|
7
|
-
s.version = "0.4.
|
7
|
+
s.version = "0.4.9"
|
8
8
|
|
9
9
|
s.specification_version = 2 if s.respond_to? :specification_version=
|
10
10
|
|