thematic 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1f0c470227b3fb52c913bc97789493465a2d5fd9
4
- data.tar.gz: 19c1b6dd8ccad6feb4ab6945c9e4386baee47cd1
3
+ metadata.gz: 9c790db151bfcafd0a53403e346b08b616cb6b59
4
+ data.tar.gz: 8fa71821036b96e0def6ffe80d2154db710770c0
5
5
  SHA512:
6
- metadata.gz: 74d9d14fdbbe779fdf834ee1c704e1de8ef8365b8962eaf515bd100b600db7b140d4b8bdf389a85bbb19f86ca51202019279972dbf8b3fa9c1dcbd9e3f94b928
7
- data.tar.gz: 9cfceeefc0664c4e5bcce87a964097d927bfc227570943cc1bfb02786b4c6ae88cd9896062dc92463adc222fdc18b51abd7473c7272c28f6d3c58ee96dd6e654
6
+ metadata.gz: cb74c604dbac0308f0bf60c697226ff943102dded56f1221be20b6b82a152ad19bef8884a6e55480aef126e5e7ee54e61ffdf1a1558343af2cd22e139d6ddc91
7
+ data.tar.gz: cbefa8d4e45ced70b193af8d29166349b750678a2c9b3a2e7ddef22f6ba5c02ccbadd80d96de640c9a0b5806997f8c06304d3d4a12f0af1ba58290fdd22c92e4
@@ -24,7 +24,7 @@ namespace :thematic do
24
24
  files_to_copy = Dir[ File.join(copy_from_path, '**', '*') ]
25
25
 
26
26
  files_to_copy.each do |filepath|
27
- unless File.directory?(filepath)
27
+ unless File.directory?(filepath) || filepath.end_with?("min.css")
28
28
  filename = filepath.split("/").last
29
29
  copy(filepath, "vendor/assets/stylesheets/#{theme_subfolder}/")
30
30
  tempfile << " *= require #{theme_subfolder}/#{filename.gsub('.css', '')}\n"
@@ -55,7 +55,7 @@ namespace :thematic do
55
55
  files_to_copy = Dir[ File.join(copy_from_path, '**', '*') ]
56
56
 
57
57
  files_to_copy.each do |filepath|
58
- unless File.directory?(filepath)
58
+ unless File.directory?(filepath) || filepath.end_with?("min.js")
59
59
  filename = filepath.split("/").last
60
60
  copy(filepath, "vendor/assets/javascripts/#{theme_subfolder}/")
61
61
  tempfile << "//= require #{theme_subfolder}/#{filename.gsub('.js', '')}\n"
@@ -81,5 +81,42 @@ namespace :thematic do
81
81
  copy(filepath, "app/assets/images/#{theme_subfolder}/") unless File.directory?(filepath)
82
82
  end
83
83
 
84
+ puts "Copying fonts..."
85
+
86
+ FileUtils.mkdir "app/assets/fonts" unless File.exist?("app/assets/fonts")
87
+ FileUtils.remove_dir "app/assets/fonts/#{theme_subfolder}" if File.exist?("app/assets/fonts/#{theme_subfolder}")
88
+ FileUtils.mkdir "app/assets/fonts/#{theme_subfolder}"
89
+
90
+ copy_from_path = "#{args[:filepath]}/fonts"
91
+ files_to_copy = Dir[ File.join(copy_from_path, '**', '*') ]
92
+
93
+ files_to_copy.each do |filepath|
94
+ copy(filepath, "app/assets/fonts/#{theme_subfolder}") unless File.directory?(filepath)
95
+ end
96
+
97
+ if File.exist?("vendor/assets/stylesheets/#{theme_subfolder}/font-awesome.css")
98
+ puts "Configuring FontAwesome..."
99
+ FileUtils.mv("vendor/assets/stylesheets/#{theme_subfolder}/font-awesome.css", "vendor/assets/stylesheets/#{theme_subfolder}/font-awesome.css.erb")
100
+
101
+ file_to_edit = "vendor/assets/stylesheets/#{theme_subfolder}/font-awesome.css.erb"
102
+ f = File.new(file_to_edit)
103
+ tempfile = File.open("file.tmp", 'w')
104
+
105
+ f.each do |line|
106
+ if line =~/url/
107
+ modified_line = line.gsub("../fonts", "<%= font_path('#{theme_subfolder}").gsub("?", "')%>?")
108
+ tempfile << modified_line
109
+ else
110
+ tempfile << line
111
+ end
112
+ end
113
+ FileUtils.mv("file.tmp", file_to_edit)
114
+ f.close
115
+ tempfile.close
116
+
117
+ end
118
+
119
+
120
+
84
121
  end
85
122
  end
@@ -1,3 +1,3 @@
1
1
  module Thematic
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
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.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jay Wengrow