Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix calling to_yaml on 1.9

  • Loading branch information...
commit a7108e4086ecafdeb27edfb1352bf5efc17733c9 1 parent 5521dd0
Joshua Peek josh authored
Showing with 2 additions and 2 deletions.
  1. +1 −1  Rakefile
  2. +1 −1  lib/linguist/classifier.rb
2  Rakefile
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'
2  lib/linguist/classifier.rb
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.