golf 0.6.1 → 0.6.2
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/lib/golf/compiler.rb +10 -1
- data/lib/golf/version.rb +1 -1
- metadata +1 -1
data/lib/golf/compiler.rb
CHANGED
@@ -120,7 +120,7 @@ module Golf
|
|
120
120
|
Dir["#{@golfpath}/components/**/*"].each do |path|
|
121
121
|
name = package_name(path)
|
122
122
|
valid_arr = path_valid_for_filtering?(path)
|
123
|
-
next if FileTest.directory?(path) or !path.include?('.html')
|
123
|
+
next if FileTest.directory?(path) or !path.include?('.html') or path.include?('~')
|
124
124
|
data = filtered_read(path)
|
125
125
|
data_arr = extract_parts(data, path)
|
126
126
|
results = results.merge({ name => { "name" => name, "html" => data_arr["html"], "css" => data_arr["css"], "js" => data_arr["js"] }})
|
@@ -133,6 +133,7 @@ module Golf
|
|
133
133
|
results = {}
|
134
134
|
if File.exists?(dir) and File.directory?(dir)
|
135
135
|
Dir["#{dir}/**/*.#{type}"].sort.reverse.each do |path|
|
136
|
+
next if path.include?('~')
|
136
137
|
name = path.split('/').last.gsub(".#{type}",'')
|
137
138
|
data = filtered_read(path)
|
138
139
|
results = results.merge({ name => { "name" => name, "#{type}" => data }})
|
@@ -147,14 +148,21 @@ module Golf
|
|
147
148
|
#load from file
|
148
149
|
doc = Hpricot(data)
|
149
150
|
arr = {}
|
151
|
+
|
150
152
|
css = (doc/'//style').first
|
151
153
|
if css
|
152
154
|
arr["css"] = css.inner_html
|
155
|
+
else
|
156
|
+
arr["css"] = ""
|
153
157
|
end
|
158
|
+
|
154
159
|
js = (doc/'//script').first
|
155
160
|
if js
|
156
161
|
arr["js"] = js.inner_html
|
162
|
+
else
|
163
|
+
arr["js"] = ""
|
157
164
|
end
|
165
|
+
|
158
166
|
(doc/'//style').remove
|
159
167
|
(doc/'//script').remove
|
160
168
|
|
@@ -162,6 +170,7 @@ module Golf
|
|
162
170
|
|
163
171
|
#load from files, ".js.coffee", etc
|
164
172
|
Dir["#{component_dir}/*"].each do |file_path|
|
173
|
+
next if file_path.include('~')
|
165
174
|
valid_arr = path_valid_for_filtering?(file_path)
|
166
175
|
if valid_arr
|
167
176
|
filter_name = valid_arr[1]
|
data/lib/golf/version.rb
CHANGED