touch_erb 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/touch_erb/cli.rb +3 -2
- data/lib/touch_erb/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd126b3c5f6e0917ce7359274f1324b009c1bbac1604d3dadc8bdce3101510fd
|
4
|
+
data.tar.gz: 93faf419c964000ecc76ead5373583ca1a738a34a2ef8320520e3ba410de5d62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ea0a0cba27b545d49bae11be006db7d41dd146171e56eeea65d76928484f92e82f95990018100a106da9151f1284da215542ce5fa7c46e60d92b445c7d6e099
|
7
|
+
data.tar.gz: b128ffa96ba4306b7ebc5c1e427157b8cdaf7cd80fccdfef28113ef9c04b868b8efeb74ff6bcdb87948c9d2ae2130bc9be674a27a18c360bf66df10130db9271
|
data/Gemfile.lock
CHANGED
data/lib/touch_erb/cli.rb
CHANGED
@@ -37,11 +37,12 @@ module TouchErb
|
|
37
37
|
invoke :help
|
38
38
|
return
|
39
39
|
end
|
40
|
-
|
40
|
+
write_file_name = output_name || template_name
|
41
|
+
file_name = File.basename(write_file_name, '.*')
|
41
42
|
if FileTest.exists?(file_name)
|
42
43
|
FileUtils.touch(file_name)
|
43
44
|
else
|
44
|
-
File.open(
|
45
|
+
File.open(write_file_name, 'w') do |f|
|
45
46
|
f.write(ERB.new(@local_template_dir.find(template_name) || @template_dir.find(template_name) || '', nil, '%<>').result(binding))
|
46
47
|
end
|
47
48
|
end
|
data/lib/touch_erb/version.rb
CHANGED