Skip to content

Commit e3ffb22

Browse files
committed
sed shell script → ruby File read/write
to make it OS-agnostic
1 parent 420f516 commit e3ffb22

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Rakefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ end
4343
def generate_rails_rdoc
4444
cd 'rails' do
4545
Bundler.with_unbundled_env do
46-
sh %(sed -i '' -e 's/sdoc.*$/sdoc", github: "toshimaru\\/sdoc", branch: "railsdoc"/g' ./Gemfile)
46+
# replace sdoc gem
47+
gemfile = File.read("Gemfile")
48+
gemfile.gsub!(/"sdoc.*$/, '"sdoc", github: "toshimaru/sdoc", branch: "railsdoc"')
49+
File.write("Gemfile", gemfile)
50+
4751
sh 'bundle install && bundle update sdoc'
4852
rm_rf 'doc'
4953
sh 'bundle exec rake rdoc'

0 commit comments

Comments
 (0)