gemstone 0.3 → 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.
- data/Changelog.md +3 -0
- data/lib/gemstone.rb +7 -2
- metadata +3 -3
data/Changelog.md
CHANGED
data/lib/gemstone.rb
CHANGED
@@ -3,7 +3,7 @@ require 'fileutils'
|
|
3
3
|
|
4
4
|
module GemStone
|
5
5
|
|
6
|
-
VERSION = '0.
|
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
|
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