From b32719e9f6a10350c8437c346ad534d787cc2151 Mon Sep 17 00:00:00 2001 From: Jason Reposa Date: Wed, 18 Sep 2013 09:09:55 -0400 Subject: [PATCH 1/2] added font support. original author @jasonwebster --- lib/forge/builder.rb | 5 +++-- lib/forge/project.rb | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/forge/builder.rb b/lib/forge/builder.rb index 3f5dd44..5e0dd14 100644 --- a/lib/forge/builder.rb +++ b/lib/forge/builder.rb @@ -179,8 +179,9 @@ def build_assets end end - # Copy the images directory over + # Copy the images & fonts directly directory over FileUtils.cp_r(File.join(@assets_path, 'images'), @project.build_path) if File.exists?(File.join(@assets_path, 'images')) + FileUtils.cp_r(File.join(@assets_path, 'fonts'), @project.build_path) if File.exists?(File.join(@assets_path, 'fonts')) # Check for screenshot and move it into main build directory Dir.glob(File.join(@project.build_path, 'images', '*')).each do |filename| @@ -215,7 +216,7 @@ def copy_paths_with_erb(paths, source_dir, destination_dir) def init_sprockets @sprockets = Sprockets::Environment.new - ['javascripts', 'stylesheets', 'lib'].each do |dir| + ['javascripts', 'stylesheets', 'lib', 'fonts'].each do |dir| @sprockets.append_path File.join(@assets_path, dir) end diff --git a/lib/forge/project.rb b/lib/forge/project.rb index 0272a85..c6ceba6 100644 --- a/lib/forge/project.rb +++ b/lib/forge/project.rb @@ -29,6 +29,10 @@ def assets_path @assets_path ||= File.join(self.source_path, 'assets') end + def fonts_path + assets_path.join('fonts') + end + def build_path File.join(self.root, '.forge', 'build') end From c49f90c9ef3631ec10b8fa5793e988749fd86ea8 Mon Sep 17 00:00:00 2001 From: Jason Reposa Date: Mon, 23 Sep 2013 16:04:35 -0400 Subject: [PATCH 2/2] join a path using File --- lib/forge/project.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/forge/project.rb b/lib/forge/project.rb index c6ceba6..93464ef 100644 --- a/lib/forge/project.rb +++ b/lib/forge/project.rb @@ -30,7 +30,7 @@ def assets_path end def fonts_path - assets_path.join('fonts') + File.join(self.assets_path, 'fonts') end def build_path