gemstone 0.3 → 0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/Changelog.md +3 -0
  2. data/lib/gemstone.rb +7 -2
  3. metadata +3 -3
@@ -1,5 +1,8 @@
1
1
  # Gemstone: Changelog
2
2
 
3
+ ## v0.4
4
+ Fix: template path
5
+
3
6
  ## v0.3
4
7
  Fix: require path in executable
5
8
 
@@ -3,7 +3,7 @@ require 'fileutils'
3
3
 
4
4
  module GemStone
5
5
 
6
- VERSION = '0.3'
6
+ VERSION = '0.4'
7
7
 
8
8
  class MissingOption < Exception; end
9
9
 
@@ -89,14 +89,19 @@ module GemStone
89
89
  gem_name.strip.split.map{ |word| word.capitalize}.join.gsub(' ', '')
90
90
  end
91
91
 
92
+
92
93
  def render_file(path, result_file_path = path)
93
- source_path = File.join 'template', path
94
+ source_path = File.join template_path, path
94
95
  result_file_path = result_path(result_file_path)
95
96
  FileUtils.mkdir_p File.dirname(result_file_path)
96
97
  result = ERB.new(File.read(source_path)).result(binding)
97
98
  File.open(result_file_path, 'w') {|f| f.write(result) }
98
99
  end
99
100
 
101
+ def template_path
102
+ File.dirname(__FILE__) + '/../template'
103
+ end
104
+
100
105
  def result_path(source_path)
101
106
  File.join @options[:gem_path], source_path
102
107
  end
metadata CHANGED
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gemstone
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 3
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 3
9
- version: "0.3"
8
+ - 4
9
+ version: "0.4"
10
10
  platform: ruby
11
11
  authors:
12
12
  - Raul Murciano