thematic 0.0.10 → 0.0.11

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: e7c488db698bbd019711bbb645d470f6895e6941
4
- data.tar.gz: 4ce4bcdccf68afbffe379048308a561cfe68de41
3
+ metadata.gz: 3a8079f296b332e918e651b00e4066bbb784d06e
4
+ data.tar.gz: caa8b09467e0d88aaa0672f581147f30a97df1cf
5
5
  SHA512:
6
- metadata.gz: 5fbe3f5e79cbd253179f69d69c40df2e4db54781ae80878301981c97814d0c78d6c8c69e995a88208cb1ffcc14e6cab1cbea137c0216e2d06595bd1495eb4cd5
7
- data.tar.gz: 6f2580c94260a484b895863061d40e28e4c401dd6fc0c10f3996222707d643d413eaa85812af11dd577fb36d1cb056ee8d971c357d2282b4047bd2f141af5229
6
+ metadata.gz: 7111d5459c96795b8f31e4294f9d6537b7d63688e3c57725b7ae2389574067cb1ebff39001665fe2edcaec55120b7b453ee05c0162631d4bafeebd03c5bfffeb
7
+ data.tar.gz: dd8523feb954a45a7997ccec0b4c03c83b4df355347dc8253079856d823efa4d62439175bef2a4987ab72b4ffc2ddd0a3a296bfcb1c5955d9836b852281a0c6f
@@ -21,17 +21,15 @@ namespace :thematic do
21
21
  tempfile = File.open("file.tmp", 'w')
22
22
  f.each do |line|
23
23
  if line =~/^*= require_tree ./ #we want to insert new require statements above this line
24
- files_to_copy = Dir[ File.join(copy_from_path, '**', '*') ]
24
+ files_to_copy = Dir[ File.join(copy_from_path, '**', '*.css') ]
25
25
 
26
26
  #filter out minified versions of libraries that also have a non-minified version
27
27
  files_to_copy.reject! { |filename| filename.index(".min") && files_to_copy.include?(filename.gsub(".min", "")) }
28
28
 
29
29
  files_to_copy.each do |filepath|
30
- unless File.directory?(filepath) || filepath.end_with?(".map")
31
- filename = filepath.split("/").last
32
- copy(filepath, "vendor/assets/stylesheets/#{theme_subfolder}/")
33
- tempfile << " *= require #{theme_subfolder}/#{filename.gsub('.css', '')}\n"
34
- end
30
+ filename = filepath.split("/").last
31
+ copy(filepath, "vendor/assets/stylesheets/#{theme_subfolder}/")
32
+ tempfile << " *= require #{theme_subfolder}/#{filename.gsub('.css', '')}\n"
35
33
  end
36
34
 
37
35
  end
@@ -55,17 +53,15 @@ namespace :thematic do
55
53
  tempfile = File.open("file.tmp", 'w')
56
54
  f.each do |line|
57
55
  if line =~/^\/\/= require_tree ./ #we want to insert new require statements above
58
- files_to_copy = Dir[ File.join(copy_from_path, '**', '*') ]
56
+ files_to_copy = Dir[ File.join(copy_from_path, '**', '*.js') ]
59
57
 
60
58
  #filter out minified versions of libraries that also have a non-minified version
61
59
  files_to_copy.reject! { |filename| filename.index(".min") && files_to_copy.include?(filename.gsub(".min", "")) }
62
60
 
63
61
  files_to_copy.each do |filepath|
64
- unless File.directory?(filepath) || filepath.end_with?(".map")
65
- filename = filepath.split("/").last
66
- copy(filepath, "vendor/assets/javascripts/#{theme_subfolder}/")
67
- tempfile << "//= require #{theme_subfolder}/#{filename.gsub('.js', '')}\n"
68
- end
62
+ filename = filepath.split("/").last
63
+ copy(filepath, "vendor/assets/javascripts/#{theme_subfolder}/")
64
+ tempfile << "//= require #{theme_subfolder}/#{filename.gsub('.js', '')}\n"
69
65
  end
70
66
  end
71
67
  tempfile << line
@@ -123,7 +119,7 @@ namespace :thematic do
123
119
  end
124
120
 
125
121
  if File.exist?("vendor/assets/stylesheets/#{theme_subfolder}/style.css")
126
- puts "Configuring images mentioned inside CSS..."
122
+ puts "Configuring images referenced in CSS..."
127
123
  FileUtils.mv("vendor/assets/stylesheets/#{theme_subfolder}/style.css", "vendor/assets/stylesheets/#{theme_subfolder}/style.css.erb")
128
124
 
129
125
  file_to_edit = "vendor/assets/stylesheets/#{theme_subfolder}/style.css.erb"
@@ -145,9 +141,35 @@ namespace :thematic do
145
141
  tempfile.close
146
142
 
147
143
  end
144
+ end
148
145
 
146
+ task :plugin, [:filepath] do |task, args|
147
+ copy_from_path = args[:filepath]
148
+ theme_subfolder = "theme"
149
149
 
150
+ file_to_edit = "app/assets/javascripts/application.js"
151
+ f = File.new(file_to_edit)
150
152
 
153
+ tempfile = File.open("file.tmp", 'w')
154
+ f.each do |line|
155
+ if line =~/^\/\/= require_tree ./ #we want to insert new require statements above
156
+ files_to_copy = Dir[ File.join(copy_from_path, '*.js') ]
157
+
158
+ #filter out minified versions of libraries that also have a non-minified version
159
+ files_to_copy.reject! { |filename| filename.index(".min") && files_to_copy.include?(filename.gsub(".min", "")) }
160
+
161
+ files_to_copy.each do |filepath|
162
+ filename = filepath.split("/").last
163
+ copy(filepath, "vendor/assets/javascripts/#{theme_subfolder}/")
164
+ tempfile << "//= require #{theme_subfolder}/#{filename.gsub('.js', '')}\n"
165
+ end
166
+ end
167
+ tempfile << line
168
+ end
169
+
170
+ FileUtils.mv("file.tmp", file_to_edit)
171
+ f.close
172
+ tempfile.close
173
+ end
151
174
 
152
- end
153
175
  end
@@ -1,3 +1,3 @@
1
1
  module Thematic
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thematic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jay Wengrow