Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fixed misspelling of Active (was Acive). Superficial, but important. #1

Open
wants to merge 2 commits into from

1 participant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 26, 2010
  1. @sdeming

    Quick spelling fix

    sdeming authored
  2. @sdeming

    Stripping ANSI

    sdeming authored
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 4 deletions.
  1. +2 −2 lib/engrel.rb
  2. +3 −2 lib/engrel/sentence.rb
View
4 lib/engrel.rb
@@ -23,7 +23,7 @@ def sentence(*args, &block)
alias :fact :sentence
alias :claim :sentence
- module AciveRecordInstanceMethods
+ module ActiveRecordInstanceMethods
# Helper method that gets included into AR::Base that allows any model object to specify a relationship between it and any other
# object (the direct object (they're both polymorphic, of course).
#
@@ -41,5 +41,5 @@ def fact(verb, direct_object, &block)
end
-ActiveRecord::Base.send(:include, ::Engrel::Helpers::AciveRecordInstanceMethods) if (defined?(ActiveRecord::Base) rescue false)
+ActiveRecord::Base.send(:include, ::Engrel::Helpers::ActiveRecordInstanceMethods) if (defined?(ActiveRecord::Base) rescue false)
include ::Engrel::Helpers
View
5 lib/engrel/sentence.rb
@@ -124,9 +124,10 @@ def to_sentence_colored
sen
end
- # TODO: Properly strip ANSI color chars
def to_sentence
- to_sentence_colored
+ # stripping ANSI is just removing from the pair ESC and [ up
+ # to the lowercase letter m, lazily.
+ to_sentence_colored.gsub(/\x1B\[.*?m/, "");
end
end
Something went wrong with that request. Please try again.