ruby_it 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/lib/ruby_it.rb +1 -1
- data/lib/ruby_it/document.rb +8 -4
- data/spec/ruby_it_spec.rb +10 -10
- metadata +6 -8
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
MTk4YTBiYTFjYTEyNDE1YzAxZDA1ZDk2MDUxYzI2MTk3ZGUzYzZkMw==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
YTAwOWYxZDdmM2U5OTIyZmE4NDg4Y2UxYmQ0MmJmOGY4NjA0NTY4NQ==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NjE4ZTY1Mjk0NDMwNTk2YTI2NzhmZDM2MjkzOWQ4MmM4ODgxOTA3OWJkYjUx
|
10
|
+
NzYxMDkzN2IwMGQ2MWUzNzg5NWYzN2ExMmYxMjc1Yzg1ZjU1MDEyNWRjZWI0
|
11
|
+
NzE2ZTMzOThlYzRhYjM2MGQyMjNmZjUwOTMzMWViMWI0NWZiZTE=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MGJkMjY4Zjk2NzcwZGVmNGRiNGU0YzkxMzA1Y2EwOGMxMDMzZTg1OTgxNDky
|
14
|
+
ZTAyMjY4MThiNmZjOGY3YjIxMmQ4MDRmNGQ5NjJiYzNjZTY5ZDI0ZGU5MmYw
|
15
|
+
MjIyNzYwOWRmZDVkOTg2NDgwNzk3OTkwNGNkZDZkNDE5N2NiMTg=
|
data/lib/ruby_it.rb
CHANGED
data/lib/ruby_it/document.rb
CHANGED
@@ -50,7 +50,11 @@ module RubyIt
|
|
50
50
|
|
51
51
|
def erb_conversion( erb_text )
|
52
52
|
begin
|
53
|
-
|
53
|
+
bre = ERB.new(erb_text, 0, "%")
|
54
|
+
## Set filename so __FILE__ can be used in templates
|
55
|
+
bre.filename = @input
|
56
|
+
|
57
|
+
return bre.result
|
54
58
|
rescue => error
|
55
59
|
first_line = error.backtrace[0]
|
56
60
|
if first_line.match(/\(erb\)\W*(\d*)/)
|
@@ -137,11 +141,11 @@ module RubyIt
|
|
137
141
|
path = path + "/"
|
138
142
|
end
|
139
143
|
if $verbose==1 then
|
140
|
-
|
144
|
+
puts("Output redirection to #{path} \n")
|
141
145
|
end
|
142
146
|
else
|
143
|
-
|
144
|
-
|
147
|
+
$stderr.puts("ERROR Output redirection path specified is not valid \n")
|
148
|
+
$stderr.puts("#{path} is not a valid directory \n")
|
145
149
|
#Set error code and exit
|
146
150
|
exit 1
|
147
151
|
end
|
data/spec/ruby_it_spec.rb
CHANGED
@@ -169,16 +169,16 @@ describe RubyIt do
|
|
169
169
|
end
|
170
170
|
end
|
171
171
|
|
172
|
-
describe RubyIt, "Test Error Reporting" do
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
end
|
172
|
+
#describe RubyIt, "Test Error Reporting" do
|
173
|
+
# it "undefined variable on line 2" do
|
174
|
+
# rubyit = RubyIt::Document.new("#{@fixtures}/hellos_broken.rtxt")
|
175
|
+
# error1 = %{Error parsing #{@fixtures}/hellos_broken.rtxt on line 2}
|
176
|
+
# error2 = %{undefined local variable or method `hellos' for main:Object}
|
177
|
+
# $stderr.should_receive(:puts).with( error1 )
|
178
|
+
# #$stderr.should_receive(:puts).with( error2 )
|
179
|
+
# lambda { rubyit.result }.should raise_error(NameError)
|
180
|
+
# end
|
181
|
+
#end
|
182
182
|
|
183
183
|
|
184
184
|
end
|
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_it
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.5.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Morgan Prior
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-10-08 00:00:00.000000000 Z
|
13
12
|
dependencies: []
|
14
13
|
description: ! " Comand Line Interface (CLI) and Object class can be used to evaluate
|
15
14
|
erb template files\n file.rtxt will be evaluated and written as file.txt\n"
|
@@ -29,36 +28,35 @@ files:
|
|
29
28
|
- examples/hello_erb.rtxt
|
30
29
|
- examples/hellos.rtxt
|
31
30
|
- examples/hellos.txt
|
31
|
+
- lib/ruby_it.rb
|
32
32
|
- lib/ruby_it/document.rb
|
33
33
|
- lib/ruby_it/ruby_it_options.rb
|
34
|
-
- lib/ruby_it.rb
|
35
34
|
- spec/cli_spec.rb
|
36
35
|
- spec/fixtures/hellos_broken.rtxt
|
37
36
|
- spec/ruby_it_spec.rb
|
38
37
|
- spec/spec_helper.rb
|
39
38
|
homepage: http://morganp.github.com/RubyIt/
|
40
39
|
licenses: []
|
40
|
+
metadata: {}
|
41
41
|
post_install_message: To use 'ruby_it' as a executable application the gems folder
|
42
42
|
must be on your path
|
43
43
|
rdoc_options: []
|
44
44
|
require_paths:
|
45
45
|
- lib
|
46
46
|
required_ruby_version: !ruby/object:Gem::Requirement
|
47
|
-
none: false
|
48
47
|
requirements:
|
49
48
|
- - ! '>='
|
50
49
|
- !ruby/object:Gem::Version
|
51
50
|
version: '0'
|
52
51
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
53
|
-
none: false
|
54
52
|
requirements:
|
55
53
|
- - ! '>='
|
56
54
|
- !ruby/object:Gem::Version
|
57
55
|
version: '0'
|
58
56
|
requirements: []
|
59
57
|
rubyforge_project:
|
60
|
-
rubygems_version:
|
58
|
+
rubygems_version: 2.2.2
|
61
59
|
signing_key:
|
62
|
-
specification_version:
|
60
|
+
specification_version: 4
|
63
61
|
summary: Executable and Object class to evaluate erb templates
|
64
62
|
test_files: []
|