text_injector 0.0.3 → 0.0.4

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
  SHA1:
3
- metadata.gz: 9e03b1fb3b239226aba3c34d1f0dd3d33b9a9285
4
- data.tar.gz: 475f20c84ea53d65ed69466030c134b80fb1735a
3
+ metadata.gz: ac2d6aa94294adc0eca0d31e2573004581cd6ea2
4
+ data.tar.gz: 121a61b2ac08edfb1efce61646e6c421a70f53b9
5
5
  SHA512:
6
- metadata.gz: d405677b2f18a693596861f02ae7a6a50bdabeb3322d504d44f62e5d376847730b9e5da3edcb1ac3e22c020069434fdb2247a28da37bdc1cb2fffc0d673d92a0
7
- data.tar.gz: 54b095a0f53f63ffa397d715c1f36091bb5e9a69eb03e8e4d51e3d6eb9b88d13d17aaaa67f22ebe0feaa3cba3139b8bda3d8355936ccb24aec4562abc1f0e245
6
+ metadata.gz: 821fb9de70678bd3ef2c65751dde24ee229e4e9c75334205a42332704512a149a37eb7a848decbacd42a1ac5add4a726c6b027da5f35ef74b1e081b95649ff5b
7
+ data.tar.gz: 50e1b3db767899c7fb003b3c3cc53c2827a9a749f41453b4338ccf094251049f126176151fe84252b832dd2641654e91bdb3857eb8b844c5eedacca0c5449fe7
@@ -24,6 +24,10 @@ class TextInjector
24
24
  puts msg unless @options[:mute]
25
25
  end
26
26
 
27
+ def tmp_path
28
+ "#{@file}.tmp"
29
+ end
30
+
27
31
  protected
28
32
 
29
33
  def default_identifier
@@ -41,15 +45,11 @@ protected
41
45
  @current_file = results
42
46
  end
43
47
 
44
- def tmp_path
45
- "#{@file}.tmp"
46
- end
47
-
48
48
  def write_file(contents)
49
49
  File.open(tmp_path, 'w') do |file|
50
50
  file.write(contents)
51
51
  end
52
- if @options[:temp_file]
52
+ if @options[:tmp_file]
53
53
  say "Tmp file written to #{tmp_path}"
54
54
  else
55
55
  say "Updated #{@file}"
@@ -1,3 +1,3 @@
1
1
  class TextInjector
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -13,7 +13,7 @@ describe TextInjector do
13
13
  TextInjector.new(
14
14
  :mute => true,
15
15
  :file => @file,
16
- :temp_file => @temp_file,
16
+ :tmp_file => @tmp_file,
17
17
  :identifier => @identifier,
18
18
  :content => @content
19
19
  )
@@ -67,11 +67,10 @@ EOL
67
67
  end
68
68
 
69
69
  it "should create temp file" do
70
- @temp_file = true
70
+ @tmp_file = true
71
71
  injector.run
72
- temp_file = @file + ".tmp"
73
- File.exist?(temp_file).should be_true
74
- FileUtils.rm_f(temp_file)
72
+ File.exist?(injector.tmp_path).should be_true
73
+ FileUtils.rm_f(injector.tmp_path)
75
74
  end
76
75
  end
77
76
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: text_injector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen