hayde 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/hayde.gemspec +1 -1
  3. data/lib/hayde/generator.rb +20 -1
  4. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
data/hayde.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{hayde}
8
- s.version = "0.1.3"
8
+ s.version = "0.1.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Roman Zaharenkov"]
@@ -90,7 +90,26 @@ module Hayde
90
90
  end
91
91
 
92
92
  def copy_assets
93
- FileUtils.cp_r(Dir.glob(File.join(assets_dir, '*')), output_dir)
93
+ #FileUtils.cp(Dir.glob(File.join(assets_dir, '**', '*')).reject {|file| file !~ /(css|js|png|gif)$/ }, output_dir)
94
+ copy(assets_dir, output_dir, /\.$|\.svn/)
95
+ end
96
+
97
+ def copy(source, destination, exclude)
98
+ Dir.foreach(source) do |file|
99
+ next if exclude && exclude.match(file)
100
+
101
+ source_file = File.join(source, file)
102
+ destination_file = File.join(destination, file)
103
+
104
+ puts "#{source_file} --> #{destination_file}"
105
+
106
+ if File.directory?(source_file)
107
+ FileUtils.mkdir(destination_file) if !File.directory?(destination_file)
108
+ copy(source_file, destination_file, exclude)
109
+ else
110
+ FileUtils.cp(source_file, destination_file)
111
+ end
112
+ end
94
113
  end
95
114
 
96
115
  def output_file_for(source)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hayde
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 3
10
- version: 0.1.3
9
+ - 4
10
+ version: 0.1.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Roman Zaharenkov