verilog 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/verilog.rb +4 -1
- data/lib/verilog/file.rb +9 -2
- data/spec/fixtures/test_one.v +1 -1
- data/spec/verilog_spec.rb +18 -1
- metadata +7 -5
data/lib/verilog.rb
CHANGED
data/lib/verilog/file.rb
CHANGED
@@ -23,7 +23,7 @@ module Verilog
|
|
23
23
|
end
|
24
24
|
else
|
25
25
|
#TODO raise correct exception here
|
26
|
-
puts "ERROR File Not Found #{absolute_filename}"
|
26
|
+
$stderr.puts "ERROR File Not Found #{absolute_filename}"
|
27
27
|
end
|
28
28
|
|
29
29
|
end
|
@@ -35,7 +35,14 @@ module Verilog
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def absolute_filename
|
38
|
-
|
38
|
+
if @options[:path] == ''
|
39
|
+
dir = @filename.dup
|
40
|
+
else
|
41
|
+
dir = ::File.join( @options[:path], @filename )
|
42
|
+
end
|
43
|
+
dir = ::File.expand_path( dir )
|
44
|
+
|
45
|
+
return dir
|
39
46
|
end
|
40
47
|
|
41
48
|
def module_name
|
data/spec/fixtures/test_one.v
CHANGED
data/spec/verilog_spec.rb
CHANGED
@@ -3,7 +3,24 @@ require 'pp'
|
|
3
3
|
|
4
4
|
describe Verilog do
|
5
5
|
|
6
|
-
it "Open file" do
|
6
|
+
it "Open file, with path as oart of filename" do
|
7
|
+
path = File.dirname( __FILE__ )
|
8
|
+
|
9
|
+
test_one = Verilog::File.new( File.join( path, 'fixtures', 'test_one.v' ) )
|
10
|
+
test_one.read_from_disk
|
11
|
+
|
12
|
+
test_one.contents.should ==
|
13
|
+
%{module TEST_ONE(
|
14
|
+
input rx,
|
15
|
+
output tx
|
16
|
+
);
|
17
|
+
|
18
|
+
endmodule
|
19
|
+
}
|
20
|
+
test_one.module_name.should == "TEST_ONE"
|
21
|
+
end
|
22
|
+
|
23
|
+
it "Open file, with specified path" do
|
7
24
|
path = File.dirname( __FILE__ )
|
8
25
|
|
9
26
|
test_one = Verilog::File.new("test_one.v", {:path => File.join( path, 'fixtures') })
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: verilog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Morgan Prior
|
@@ -15,7 +15,8 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-10-24 00:00:00 +01:00
|
19
|
+
default_executable:
|
19
20
|
dependencies: []
|
20
21
|
|
21
22
|
description: File helpers with specific functions for Verilog HDL
|
@@ -37,6 +38,7 @@ files:
|
|
37
38
|
- spec/fixtures/test_three.v
|
38
39
|
- spec/spec_helper.rb
|
39
40
|
- spec/verilog_spec.rb
|
41
|
+
has_rdoc: true
|
40
42
|
homepage: http://amaras-tech.co.uk/software/verilog
|
41
43
|
licenses: []
|
42
44
|
|
@@ -66,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
66
68
|
requirements: []
|
67
69
|
|
68
70
|
rubyforge_project:
|
69
|
-
rubygems_version: 1.
|
71
|
+
rubygems_version: 1.6.2
|
70
72
|
signing_key:
|
71
73
|
specification_version: 3
|
72
74
|
summary: Helpers for working with verilog files
|