touch_erb 0.3.1 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 66334ce3ca7da87f2ccf9ad099268ea1c65ff7cc4ef22ced4b23d321a5d9fa7c
4
- data.tar.gz: f59506ce8cf9fe6dc6f767a85d15573c4e3c8746076c3be6d293ccf0b0dc21fa
3
+ metadata.gz: 93417af23f0f30e1d28b5ec6b1544b29c338800f9662d7c41baa886099f4b550
4
+ data.tar.gz: b852e0908f6a2233b55c2b353a99d7566bd9509a0f958d292cdb13ed4ba27ed4
5
5
  SHA512:
6
- metadata.gz: 7a9a33754047c2fbde15c9408c076c36ffba0e9f573bc417adf90347b7652de4280805857964da36fb6b16b838518d205a6c66b7ec7748c5472bb6ec1f415821
7
- data.tar.gz: 87bddea57ed4119f3ee502e76378e9e6f4da217ff589b0263d7d3f3fccf04e0da1c48db803e12af15de6c6dc241907354cca117754f38d32cf17db09f6e0a0ec
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.3.1)
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
- dist_name = output_name || template_name
36
- if FileTest.exists?(dist_name)
37
- FileUtils.touch(dist_name)
37
+ file_name = output_name || template_name
38
+ if FileTest.exists?(file_name)
39
+ FileUtils.touch(file_name)
38
40
  else
39
- File.open(dist_name, 'w') do |f|
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
@@ -1,3 +1,3 @@
1
1
  module TouchErb
2
- VERSION = "0.3.1"
2
+ VERSION = "0.4.0"
3
3
  end
data/touch_erb.gemspec CHANGED
@@ -37,6 +37,7 @@ Gem::Specification.new do |spec|
37
37
  spec.require_paths = ["lib"]
38
38
 
39
39
  spec.add_dependency "thor", "~> 0.20"
40
+ spec.add_dependency "activesupport"
40
41
 
41
42
  spec.add_development_dependency "bundler", "~> 2.0"
42
43
  spec.add_development_dependency "rake", "~> 12.3"
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.3.1
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-02-20 00:00:00.000000000 Z
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.1
159
+ rubygems_version: 3.0.2
146
160
  signing_key:
147
161
  specification_version: 4
148
162
  summary: Better touch command