front-end-blender 0.8 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/bin/blend +11 -16
  2. metadata +1 -1
data/bin/blend CHANGED
@@ -17,7 +17,7 @@ require 'find'
17
17
 
18
18
  # TODO Move class to lib so other tools could potentially reuse it
19
19
  class Blender
20
- VERSION = '0.8'
20
+ VERSION = '0.8.1'
21
21
 
22
22
  attr_reader :options
23
23
 
@@ -108,22 +108,17 @@ class Blender
108
108
  blend_files = Hash.new
109
109
 
110
110
  Find.find(Dir.getwd) do |f|
111
- if f.match /\.css$/
112
- key = File.dirname(f) + "-min.css"
113
- if blend_files.has_key? key
114
- blend_files[key] << f
115
- else
116
- blend_files[key] = [f]
117
- end
111
+ f.gsub!(Dir.getwd.to_s+"/", "")
112
+ if File.extname(f) == ".css"
113
+ file = f.split(".css")
114
+ min_file = file[0] + "-min.css"
115
+ blend_files[f] = [min_file]
118
116
  end
119
117
 
120
- if f.match /\.js$/
121
- key = File.dirname(f) + "-min.js"
122
- if blend_files.has_key? key
123
- blend_files[key] << f
124
- else
125
- blend_files[key] = [f]
126
- end
118
+ if File.extname(f) == ".js"
119
+ file = f.split(".js")
120
+ min_file = file[0] + "-min.js"
121
+ blend_files[f] = [min_file]
127
122
  end
128
123
 
129
124
  Find.prune if File.basename(f).index('.') == 0
@@ -152,7 +147,7 @@ class Blender
152
147
 
153
148
  output = io.read
154
149
 
155
- if output_name.match /\.css$/
150
+ if File.extname(output_name) == ".css"
156
151
  output.gsub! ' and(', ' and (' # Workaround for YUI Compressor Bug #1938329
157
152
  output.gsub! '/**/;}', '/**/}' # Workaround for YUI Compressor Bug #1961175
158
153
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: front-end-blender
3
3
  version: !ruby/object:Gem::Version
4
- version: "0.8"
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Blake Elshire & Chris Griego