specific_asset_compiler 0.1.8 → 0.2.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bf2771749c839a1806914cdf74669bbebc43812d
4
- data.tar.gz: 5818f2a68a041977a89175643673dac23aaeb034
3
+ metadata.gz: c74e74141c1e403c7817274028c6ded2aa66e375
4
+ data.tar.gz: 79da89e693c1f7b62ca3ddd1d3e821d0dcb01b74
5
5
  SHA512:
6
- metadata.gz: 1c22065c93019c030d65c81d395f5c5947e632d018d54ba0bbafde9913c160f583e194bcc2505cf4e732b1b5fd6237203afc73f75b481c3ad414fce996e8b3fa
7
- data.tar.gz: d3af121e9d69df6351fecd4ee3a6ade8eec97755f955ded4143bd28e86aafa095c0eabadf209da54bf24779a41ed3e1ef8b9dfe9ca1079d64056b140cd95b44c
6
+ metadata.gz: a3d08312c7cf027afddbacd557e85972107b7d64340a947ef32322a370fa65845e6077984c71d93839fe409843d8aa9e9d1f8f27cbe032ae9e13c92927990c37
7
+ data.tar.gz: 9a812d948bc8d6fb37a9c61c4e90dec971f681f50ddeda44fe2178097795a6e0c5e5ca9d4c567eee59a8429e5d9b6e941bde51a403d32d5d8bfec4ac90246ae3
@@ -39,7 +39,7 @@ namespace :assets do
39
39
  digest = nil
40
40
  _ = ActionView::Base
41
41
  target_files = (ENV["ASSET_FILES"].gsub("[","").gsub("]","").split(",") rescue [])
42
- target_files = target_files.collect{|file| find_parent(file) }.flatten
42
+ target_files = target_files.collect{|file| find_parent(file) }.flatten.compact.uniq.collect{|k| k.gsub(".scss","")}
43
43
  config = Rails.application.config
44
44
  config.assets.compile = true
45
45
  config.assets.digest = digest unless digest.nil?
@@ -60,7 +60,7 @@ namespace :assets do
60
60
  file_pure_path = file_path.split(".").first
61
61
  file_pure_name = file_path.split("/").last.split(".").first
62
62
  all_path = Rails.application.config.assets.paths
63
- all_found = all_path.collect{|path| %x[ grep -rw '#{path}' -e '#{file_pure_name}' ].split("\n") }.flatten.compact.select{|h| h.split(":").last.split("/").last.include?(file_pure_name) && h.split(":").last.split("/").last.include?("import") && h.split(":").last.split("/").last.include?("require") }
63
+ all_found = all_path.collect{|path| %x[ grep -rw '#{path}' -e '#{file_pure_name}' ].split("\n") }.flatten.compact.select{|h| h.split(":").last.split("/").last.include?(file_pure_name) && (h.split(":").last.include?("import") || h.split(":").last.include?("require")) }
64
64
  all_found.present?
65
65
  end
66
66
 
@@ -69,13 +69,13 @@ namespace :assets do
69
69
  file_pure_path = file_path.split(".").first
70
70
  file_pure_name = file_path.split("/").last.split(".").first
71
71
  all_path = Rails.application.config.assets.paths
72
- all_found = all_path.collect{|path| %x[ grep -rw '#{path}' -e '#{file_pure_name}' ].split("\n") }.flatten.compact.select{|h| h.split(":").last.split("/").last.include?(file_pure_name) && h.split(":").last.split("/").last.include?("import") && h.split(":").last.split("/").last.include?("require") }
72
+ all_found = all_path.collect{|path| %x[ grep -rw '#{path}' -e '#{file_pure_name}' ].split("\n") }.flatten.compact.select{|h| h.split(":").last.split("/").last.include?(file_pure_name) && (h.split(":").last.include?("import") || h.split(":").last.include?("require")) }
73
73
  if all_found.present?
74
74
  all_found.each do |aff|
75
75
  this_file_path = aff.split(":")[0]
76
76
  this_only_path = this_file_path.split("/")[0..this_file_path.split("/").count-2].join("/")
77
77
  imported_raw_message = aff.split(":")[1]
78
- imported_raw_path = imported_raw_message.gsub(/\A.* \"/,"").gsub(/\";/,"")
78
+ imported_raw_path = imported_raw_message.gsub(/\A.* \"/,"").gsub(/\";/,"").gsub("*= require ./","")
79
79
  next unless (this_only_path+"/"+imported_raw_path).match(file_pure_path)
80
80
  result << this_file_path.split(/images\/|stylesheets\/|javascripts\//).last
81
81
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: specific_asset_compiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tanapat Sainak
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-07 00:00:00.000000000 Z
11
+ date: 2015-09-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Specific Asset files to compile
14
14
  email: tanapat@computerlogy.com