touch_erb 0.3.1 → 0.4.0
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +13 -1
- data/lib/touch_erb/cli.rb +7 -5
- data/lib/touch_erb/version.rb +1 -1
- data/touch_erb.gemspec +1 -0
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93417af23f0f30e1d28b5ec6b1544b29c338800f9662d7c41baa886099f4b550
|
4
|
+
data.tar.gz: b852e0908f6a2233b55c2b353a99d7566bd9509a0f958d292cdb13ed4ba27ed4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78605df3524ebf6ff54ce60a01e0ddb72b8ba8a6dc518b38cbdb1ac119b7b5394c8693360c3e29c144bb4fdc71beebd39d03eefa37d6e8bec0dafa6644d15cf1
|
7
|
+
data.tar.gz: 5a60f88315305aba15d05cc77112b30368c2e8bdc3658868d99c3775efe55ac82238ed884bbc2393ff35e6f15c0f592129b8d5032c2b26fc5b01c551799fce8a
|
data/Gemfile.lock
CHANGED
@@ -1,14 +1,23 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
touch_erb (0.
|
4
|
+
touch_erb (0.4.0)
|
5
|
+
activesupport
|
5
6
|
thor (~> 0.20)
|
6
7
|
|
7
8
|
GEM
|
8
9
|
remote: https://rubygems.org/
|
9
10
|
specs:
|
11
|
+
activesupport (5.2.2.1)
|
12
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
13
|
+
i18n (>= 0.7, < 2)
|
14
|
+
minitest (~> 5.1)
|
15
|
+
tzinfo (~> 1.1)
|
10
16
|
ansi (1.5.0)
|
11
17
|
builder (3.2.3)
|
18
|
+
concurrent-ruby (1.1.5)
|
19
|
+
i18n (1.6.0)
|
20
|
+
concurrent-ruby (~> 1.0)
|
12
21
|
minitest (5.11.3)
|
13
22
|
minitest-power_assert (0.3.0)
|
14
23
|
minitest
|
@@ -22,6 +31,9 @@ GEM
|
|
22
31
|
rake (12.3.2)
|
23
32
|
ruby-progressbar (1.10.0)
|
24
33
|
thor (0.20.3)
|
34
|
+
thread_safe (0.3.6)
|
35
|
+
tzinfo (1.2.5)
|
36
|
+
thread_safe (~> 0.1)
|
25
37
|
|
26
38
|
PLATFORMS
|
27
39
|
ruby
|
data/lib/touch_erb/cli.rb
CHANGED
@@ -2,6 +2,8 @@ require 'touch_erb'
|
|
2
2
|
require 'thor'
|
3
3
|
require 'erb'
|
4
4
|
require 'fileutils'
|
5
|
+
require 'active_support'
|
6
|
+
require 'active_support/core_ext'
|
5
7
|
|
6
8
|
module TouchErb
|
7
9
|
class CLI < Thor
|
@@ -32,12 +34,12 @@ module TouchErb
|
|
32
34
|
option :template_name, :type => :string
|
33
35
|
option :output_name, :type => :string, :default => nil
|
34
36
|
def touch(template_name, output_name = nil)
|
35
|
-
|
36
|
-
if FileTest.exists?(
|
37
|
-
FileUtils.touch(
|
37
|
+
file_name = output_name || template_name
|
38
|
+
if FileTest.exists?(file_name)
|
39
|
+
FileUtils.touch(file_name)
|
38
40
|
else
|
39
|
-
File.open(
|
40
|
-
f.write(ERB.new(@local_template_dir.find(template_name) || @template_dir.find(template_name) || "", nil, "%<>").result())
|
41
|
+
File.open(file_name, 'w') do |f|
|
42
|
+
f.write(ERB.new(@local_template_dir.find(template_name) || @template_dir.find(template_name) || "", nil, "%<>").result(binding))
|
41
43
|
end
|
42
44
|
end
|
43
45
|
end
|
data/lib/touch_erb/version.rb
CHANGED
data/touch_erb.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: touch_erb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- himanoa
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0.20'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: activesupport
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: bundler
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -142,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
142
156
|
- !ruby/object:Gem::Version
|
143
157
|
version: '0'
|
144
158
|
requirements: []
|
145
|
-
rubygems_version: 3.0.
|
159
|
+
rubygems_version: 3.0.2
|
146
160
|
signing_key:
|
147
161
|
specification_version: 4
|
148
162
|
summary: Better touch command
|