thematic 0.0.3 → 0.0.4

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: 2264f912cd0cf3e9618155d5056e5ceca3c8b1d5
4
- data.tar.gz: 1d79ee628889032db2a8d77d6fed0e4f3c97ffa4
3
+ metadata.gz: 357a9903c979c8c7a017e58f58e8f04afecbff7e
4
+ data.tar.gz: 73ad286317f94fec04f702e6286c6856f4d333c7
5
5
  SHA512:
6
- metadata.gz: af71e9d4764a902c71814d0020f4b05786b37b175b5ff0434c80a6436117ec321a834db9f4444e4e3d7e59ee6df2be64f8a4ced90f5071ef6199412d25091b27
7
- data.tar.gz: a1f79fb558a6c631eee2902144787366dbbb7d0745db1d8b2f4f1f0b3aa8edd8e5e93ef00e1e98a1353a65da90bd425c29893c2be1f3610dfeeb08e5b94cd655
6
+ metadata.gz: 9aca30a45eb6ca6fffdff26d9f6c6eea4c550e08de7aeb404e6833a99c212dac61d024cf9cc0696072a7125d4fc466e328f51debb06cf83eeae22039436bb654
7
+ data.tar.gz: 270296ecfa3fbf9a6a506cd45af2757dca853cf14de222606926acc0ed22fba9371619e27adc56f46ad14916ba02025af4a408eb6d330f2296ae7436e54dd553
@@ -13,7 +13,7 @@ namespace :thematic do
13
13
  copy_from_path = "#{args[:filepath]}/css"
14
14
  theme_subfolder = "theme"
15
15
 
16
- FileUtils.remove_dir "vendor/assets/stylesheets/#{theme_subfolder}"
16
+ FileUtils.remove_dir "vendor/assets/stylesheets/#{theme_subfolder}" if File.exist?("vendor/assets/stylesheets/#{theme_subfolder}")
17
17
  FileUtils.mkdir "vendor/assets/stylesheets/#{theme_subfolder}"
18
18
 
19
19
  file_to_edit = "app/assets/stylesheets/application.css"
@@ -21,20 +21,17 @@ namespace :thematic do
21
21
 
22
22
  tempfile = File.open("file.tmp", 'w')
23
23
  f.each do |line|
24
- break if line =~/^*= require_tree ./
25
- tempfile << line
26
- end
27
-
28
- Dir.open(copy_from_path).each do |filename|
29
- unless File.directory?("#{copy_from_path}/#{filename}") || filename[0] == "."
30
- copy("#{copy_from_path}/#{filename}", "vendor/assets/stylesheets/#{theme_subfolder}/")
31
- tempfile << " *= require #{filename.gsub('.css', '')}\n"
24
+ if line =~/^*= require_tree ./ #we want to insert new require statements above this line
25
+ Dir.open(copy_from_path).each do |filename|
26
+ unless File.directory?("#{copy_from_path}/#{filename}") || filename[0] == "."
27
+ copy("#{copy_from_path}/#{filename}", "vendor/assets/stylesheets/#{theme_subfolder}/")
28
+ tempfile << " *= require #{filename.gsub('.css', '')}\n"
29
+ end
30
+ end
32
31
  end
32
+ tempfile << line
33
33
  end
34
34
 
35
- tempfile << " *= require_tree .\n"
36
- tempfile << " *= require_self\n"
37
- tempfile << " */\n"
38
35
  FileUtils.mv("file.tmp", file_to_edit)
39
36
  f.close
40
37
  tempfile.close
@@ -44,7 +41,7 @@ namespace :thematic do
44
41
  # it is assumed that the theme comes with a folder called 'js'
45
42
  copy_from_path = "#{args[:filepath]}/js"
46
43
 
47
- FileUtils.remove_dir "vendor/assets/javascripts/#{theme_subfolder}"
44
+ FileUtils.remove_dir "vendor/assets/javascripts/#{theme_subfolder}" if File.exist?("vendor/assets/javascripts/#{theme_subfolder}")
48
45
  FileUtils.mkdir "vendor/assets/javascripts/#{theme_subfolder}"
49
46
 
50
47
  file_to_edit = "app/assets/javascripts/application.js"
@@ -52,18 +49,17 @@ namespace :thematic do
52
49
 
53
50
  tempfile = File.open("file.tmp", 'w')
54
51
  f.each do |line|
55
- break if line =~/^\/\/= require_tree ./
56
- tempfile << line
57
- end
58
-
59
- Dir.open(copy_from_path).each do |filename|
60
- unless File.directory?("#{copy_from_path}/#{filename}") || filename[0] == "."
61
- copy("#{copy_from_path}/#{filename}", "vendor/assets/javascripts/#{theme_subfolder}/") unless File.directory?("#{copy_from_path}/#{filename}")
62
- tempfile << "//= require #{filename.gsub('.js', '')}\n"
52
+ if line =~/^\/\/= require_tree ./ #we want to insert new require statements above this line
53
+ Dir.open(copy_from_path).each do |filename|
54
+ unless File.directory?("#{copy_from_path}/#{filename}") || filename[0] == "."
55
+ copy("#{copy_from_path}/#{filename}", "vendor/assets/javascripts/#{theme_subfolder}/") unless File.directory?("#{copy_from_path}/#{filename}")
56
+ tempfile << "//= require #{filename.gsub('.js', '')}\n"
57
+ end
58
+ end
63
59
  end
60
+ tempfile << line
64
61
  end
65
62
 
66
- tempfile << "//= require_tree .\n"
67
63
  FileUtils.mv("file.tmp", file_to_edit)
68
64
  f.close
69
65
  tempfile.close
@@ -1,3 +1,3 @@
1
1
  module Thematic
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
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.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jay Wengrow