Permalink
Browse files

Fix calling to_yaml on 1.9

  • Loading branch information...
1 parent 5521dd0 commit a7108e4086ecafdeb27edfb1352bf5efc17733c9 @josh josh committed Jun 22, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 Rakefile
  2. +1 −1 lib/linguist/classifier.rb
View
@@ -11,7 +11,7 @@ end
file 'lib/linguist/classifier.yml' => Dir['samples/**/*'] do |f|
require 'linguist/sample'
classifier = Linguist::Sample.classifier
- File.open(f.name, 'w') { |io| YAML.dump(classifier, io) }
+ File.open(f.name, 'w') { |io| classifier.to_yaml(io) }
end
CLOBBER.include 'lib/linguist/classifier.yml'
@@ -170,7 +170,7 @@ def to_yaml(io)
@tokens.sort.each do |language, tokens|
data << " #{{language => true}.to_yaml.lines.to_a[1].sub(/ true/, "")}"
tokens.sort.each do |token, count|
- data << " #{{token => count}.to_yaml.lines.to_a[1]}"
+ data << " #{{token => count}.to_yaml.lines.to_a[1].sub(/! /, "")}"
end
end

0 comments on commit a7108e4

Please sign in to comment.