Skip to content

Commit b1c6d07

Browse files
committed
Drop dependency on build-files.
1 parent 76aae92 commit b1c6d07

2 files changed

Lines changed: 11 additions & 14 deletions

File tree

bake/decode/index.rb

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,17 @@
33
# Released under the MIT License.
44
# Copyright, 2020, by Samuel Williams.
55

6+
def initialize(...)
7+
super
8+
9+
require 'decode/index'
10+
require 'set'
11+
end
12+
613
# Process the given source root and report on comment coverage.
714
# @parameter root [String] The root path to index.
815
def coverage(root)
9-
require 'build/files/glob'
10-
require 'decode/index'
11-
require 'set'
12-
13-
paths = Build::Files::Path.expand(root).glob("**/*")
16+
paths = Dir.glob(File.join(root, "**/*"))
1417

1518
index = Decode::Index.new
1619
index.update(paths)
@@ -61,10 +64,7 @@ def coverage(root)
6164
# Process the given source root and report on symbols.
6265
# @parameter root [String] The root path to index.
6366
def symbols(root)
64-
require 'build/files/glob'
65-
require 'decode/index'
66-
67-
paths = Build::Files::Path.expand(root).glob("**/*")
67+
paths = Dir.glob(File.join(root, "**/*"))
6868

6969
index = Decode::Index.new
7070
index.update(paths)
@@ -84,10 +84,7 @@ def symbols(root)
8484
# Print documentation for all definitions.
8585
# @parameter root [String] The root path to index.
8686
def documentation(root)
87-
require 'build/files/glob'
88-
require 'decode/index'
89-
90-
paths = Build::Files::Path.expand(root).glob("**/*")
87+
paths = Dir.glob(File.join(root, "**/*"))
9188

9289
index = Decode::Index.new
9390
index.update(paths)

test/decode/index.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
let(:index) {subject.new}
1111
let(:languages) {index.languages}
1212
let(:path) {File.expand_path("../../lib", __dir__)}
13-
let(:paths) {Build::Files::Glob.new(path, "**/*.rb")}
13+
let(:paths) {Dir.glob(File.join(path, "**/*.rb"))}
1414

1515
it 'can extract declarations' do
1616
index.update(paths)

0 commit comments

Comments
 (0)