snatch 1.0.9 → 1.0.10

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.9
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").each do |file|
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
+
@@ -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
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{snatch}
8
- s.version = "1.0.9"
8
+ s.version = "1.0.10"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["James Conroy-Finn"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snatch
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.9
4
+ version: 1.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Conroy-Finn