Skip to content

Commit

Permalink
Make the module easier to include as a Rails plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-dub committed Dec 24, 2008
1 parent 1a27145 commit be233f5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions css_http_request.rb
Expand Up @@ -12,7 +12,7 @@ module CssHttpRequest
PREFIX = "data:,".freeze
LENGTH = (2000 - PREFIX.size).freeze # Internet Explorer 2KB URI limit

def self.encode(str)
def encode_chr(str)
quoted = ERB::Util.url_encode(str)
slice_num = 0
output = ""
Expand All @@ -24,8 +24,7 @@ def self.encode(str)
end
end



if __FILE__ == $PROGRAM_NAME
puts CssHttpRequest.encode(STDIN.read)
include CssHttpRequest
puts encode_chr(STDIN.read)
end

0 comments on commit be233f5

Please sign in to comment.