verilog_rename 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/rename-verilog +3 -3
- data/lib/verilog_rename.rb +1 -2
- data/spec/verilog_rename_spec.rb +1 -1
- metadata +6 -7
- data/lib/verilog/path_files.rb +0 -51
data/bin/rename-verilog
CHANGED
@@ -14,8 +14,8 @@ old_name = ARGV[0]
|
|
14
14
|
new_name = ARGV[1]
|
15
15
|
|
16
16
|
|
17
|
-
path_files = Verilog::
|
18
|
-
|
17
|
+
path_files = Verilog::Path.new( this_dir )
|
18
|
+
path_files.read_all
|
19
19
|
|
20
20
|
rename = Verilog::Rename.new(old_name, new_name, path_files)
|
21
|
-
|
21
|
+
rename.rename_module
|
data/lib/verilog_rename.rb
CHANGED
@@ -3,11 +3,10 @@ libdir = File.dirname(__FILE__)
|
|
3
3
|
$LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir)
|
4
4
|
|
5
5
|
module VerilogRename
|
6
|
-
VERSION = '0.0
|
6
|
+
VERSION = '0.1.0'
|
7
7
|
end
|
8
8
|
|
9
9
|
require 'verilog'
|
10
10
|
|
11
11
|
require 'verilog/rename'
|
12
12
|
require 'verilog/prefix'
|
13
|
-
require 'verilog/path_files'
|
data/spec/verilog_rename_spec.rb
CHANGED
@@ -17,7 +17,7 @@ describe VerilogRename do
|
|
17
17
|
FileUtils.cp_r( ::File.join( path, 'fixtures'), ::File.join( path, 'scratch' ) )
|
18
18
|
|
19
19
|
|
20
|
-
path_files = Verilog::
|
20
|
+
path_files = Verilog::Path.new( File.join( path, 'scratch', 'fixtures') )
|
21
21
|
path_files.read_all
|
22
22
|
|
23
23
|
rename = Verilog::Rename.new('TEST_ONE', 'TEST_TWO', path_files)
|
metadata
CHANGED
@@ -5,9 +5,9 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
+
- 1
|
8
9
|
- 0
|
9
|
-
|
10
|
-
version: 0.0.2
|
10
|
+
version: 0.1.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Morgan Prior
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-10-
|
18
|
+
date: 2011-10-25 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -26,12 +26,12 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
hash:
|
29
|
+
hash: 23
|
30
30
|
segments:
|
31
31
|
- 0
|
32
32
|
- 0
|
33
|
-
-
|
34
|
-
version: 0.0.
|
33
|
+
- 4
|
34
|
+
version: 0.0.4
|
35
35
|
type: :runtime
|
36
36
|
version_requirements: *id001
|
37
37
|
description: Extension to the verilog gem, adds rename functionality and updates instatiations
|
@@ -47,7 +47,6 @@ files:
|
|
47
47
|
- README.md
|
48
48
|
- Rakefile
|
49
49
|
- bin/rename-verilog
|
50
|
-
- lib/verilog/path_files.rb
|
51
50
|
- lib/verilog/prefix.rb
|
52
51
|
- lib/verilog/rename.rb
|
53
52
|
- lib/verilog_rename.rb
|
data/lib/verilog/path_files.rb
DELETED
@@ -1,51 +0,0 @@
|
|
1
|
-
|
2
|
-
module Verilog
|
3
|
-
|
4
|
-
class PathFiles
|
5
|
-
attr_reader :files
|
6
|
-
|
7
|
-
def initialize( path="" )
|
8
|
-
@files = []
|
9
|
-
load_path( path )
|
10
|
-
end
|
11
|
-
|
12
|
-
def load_path( paths )
|
13
|
-
#path is single string or array of strings
|
14
|
-
paths.each do |path|
|
15
|
-
files = Dir.glob( ::File.join( path, '*.*') )
|
16
|
-
files.each do |file|
|
17
|
-
#Skip if Directory got passed *.* Filter
|
18
|
-
next if ::File.directory?( file )
|
19
|
-
|
20
|
-
file_name = ::File.basename(file)
|
21
|
-
@files << Verilog::File.new(file_name, {:path => path})
|
22
|
-
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
def read_all
|
28
|
-
@files.each do |file|
|
29
|
-
file.read_from_disk
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
def find_by_module( name )
|
34
|
-
result = @files.select do |file|
|
35
|
-
file.module_name == name
|
36
|
-
end
|
37
|
-
return result[0]
|
38
|
-
end
|
39
|
-
|
40
|
-
def includes_file( name )
|
41
|
-
@files.select { |file| file.includes.include?( name ) }
|
42
|
-
end
|
43
|
-
|
44
|
-
def instantiates_module( name )
|
45
|
-
@files.select { |file| file.instantiations.include?( name ) }
|
46
|
-
end
|
47
|
-
|
48
|
-
end
|
49
|
-
|
50
|
-
end
|
51
|
-
|