snatch 1.0.9 → 1.0.10
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.
- data/VERSION +1 -1
- data/lib/snatch.rb +12 -1
- data/lib/snatch/clean/css.rb +1 -1
- data/snatch.gemspec +1 -1
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.10
|
data/lib/snatch.rb
CHANGED
@@ -6,6 +6,14 @@ require 'snatch/clean/html'
|
|
6
6
|
require 'snatch/clean/css'
|
7
7
|
|
8
8
|
class Snatch
|
9
|
+
CLEAR = "\e[0m"
|
10
|
+
BOLD = "\e[1m"
|
11
|
+
RED = "\e[31m"
|
12
|
+
YELLOW = "\e[33m"
|
13
|
+
GREEN = "\e[32m"
|
14
|
+
CYAN = "\e[36m"
|
15
|
+
WHITE = "\e[37m"
|
16
|
+
|
9
17
|
RAILS_ROOT = Dir.pwd unless defined?(RAILS_ROOT)
|
10
18
|
RAILS_PUBLIC_ASSETS = [
|
11
19
|
'404.html',
|
@@ -98,7 +106,9 @@ class Snatch
|
|
98
106
|
end
|
99
107
|
|
100
108
|
def process_lame_cms_files
|
101
|
-
Dir.glob("#{PUBLIC_PATH}/**/*.html")
|
109
|
+
cms_html_files = Dir.glob("#{PUBLIC_PATH}/**/*.html") - RAILS_PUBLIC_ASSETS
|
110
|
+
cms_html_files.each do |file|
|
111
|
+
puts "#{GREEN}Cleaning #{file}#{CLEAR}"
|
102
112
|
Clean.process(file, File.dirname(file))
|
103
113
|
end
|
104
114
|
end
|
@@ -109,3 +119,4 @@ class Snatch
|
|
109
119
|
git :push, :silent => true
|
110
120
|
end
|
111
121
|
end
|
122
|
+
|
data/lib/snatch/clean/css.rb
CHANGED
@@ -41,7 +41,7 @@ class Snatch
|
|
41
41
|
matches = extract_path_components(href)
|
42
42
|
|
43
43
|
unless matches.nil?
|
44
|
-
path = matches.size == 3 ? matches.shift : nil
|
44
|
+
path = matches.size == 3 ? matches.shift.sub(%r{^https?://#{MARKETING_SITE}}, '') : nil
|
45
45
|
|
46
46
|
file_name = matches.join('-')
|
47
47
|
css_path = File.join(*[path, "#{file_name}.css"].compact)
|
data/snatch.gemspec
CHANGED