fix Rscons.set_suffix to append the given suffix if the filename has none
This commit is contained in:
parent
8142d0bbc8
commit
d28722a4bb
@ -383,6 +383,10 @@ http://rubydoc.info/github/holtrop/rscons/frames.
|
|||||||
|
|
||||||
## Release Notes
|
## Release Notes
|
||||||
|
|
||||||
|
### v1.9.0
|
||||||
|
|
||||||
|
- fix Rscons.set_suffix to append the given suffix if the filename has none
|
||||||
|
|
||||||
### v1.8.1
|
### v1.8.1
|
||||||
|
|
||||||
- fix Environment#dump when construction variables are symbols
|
- fix Environment#dump when construction variables are symbols
|
||||||
|
@ -67,7 +67,7 @@ module Rscons
|
|||||||
#
|
#
|
||||||
# @return [String] New path.
|
# @return [String] New path.
|
||||||
def self.set_suffix(path, suffix)
|
def self.set_suffix(path, suffix)
|
||||||
path.sub(/\.[^.]*$/, suffix)
|
path.sub(/\.[^.]*$/, "") + suffix
|
||||||
end
|
end
|
||||||
|
|
||||||
# Return the system shell and arguments for executing a shell command.
|
# Return the system shell and arguments for executing a shell command.
|
||||||
|
@ -24,6 +24,16 @@ describe Rscons do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe ".set_suffix" do
|
||||||
|
it "changes the suffix to the new one" do
|
||||||
|
expect(Rscons.set_suffix("foo.c", ".h")).to eq("foo.h")
|
||||||
|
end
|
||||||
|
|
||||||
|
it "appends a suffix if the given file name does not have one" do
|
||||||
|
expect(Rscons.set_suffix("bazz", ".d")).to eq("bazz.d")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe ".get_system_shell" do
|
describe ".get_system_shell" do
|
||||||
before(:each) do
|
before(:each) do
|
||||||
Rscons.class_variable_set(:@@shell, nil)
|
Rscons.class_variable_set(:@@shell, nil)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user