Skip to content

Commit

Permalink
rename Plist to PLIST to comply with new formatters
Browse files Browse the repository at this point in the history
  • Loading branch information
igrigorik committed Jun 24, 2011
1 parent ae6ee39 commit 1427917
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/goliath/rack/formatters/plist.rb
Expand Up @@ -4,8 +4,8 @@ module Formatters
# A plist formatter. Pass in to_plist options as an option to the middleware
#
# @example
# use Goliath::Rack::Formatters::Plist, :convert_unknown_to_string => true
class Plist
# use Goliath::Rack::Formatters::PLIST, :convert_unknown_to_string => true
class PLIST
include AsyncMiddleware

def initialize(app, opts = {})
Expand Down
6 changes: 3 additions & 3 deletions spec/unit/rack/formatters/plist_spec.rb
@@ -1,7 +1,7 @@
require 'spec_helper'
require 'goliath/rack/formatters/plist'

describe Goliath::Rack::Formatters::Plist do
describe Goliath::Rack::Formatters::PLIST do
# this sucks, but I had install problems with nokogiri-plist
# and I would rather not use an alternative library that requires libxml or rexml
before(:all) do
Expand All @@ -17,13 +17,13 @@ class Object
end

it 'accepts an app' do
lambda { Goliath::Rack::Formatters::Plist.new('my app') }.should_not raise_error
lambda { Goliath::Rack::Formatters::PLIST.new('my app') }.should_not raise_error
end

describe 'with a formatter' do
before(:each) do
@app = mock('app').as_null_object
@m = Goliath::Rack::Formatters::Plist.new(@app)
@m = Goliath::Rack::Formatters::PLIST.new(@app)
end

it 'formats the body into plist if content-type is plist' do
Expand Down

5 comments on commit 1427917

@dj2
Copy link
Contributor

@dj2 dj2 commented on 1427917 Jun 26, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this comply with? The others are uppercase because they're all acronyms. This should probably be PList instead of Plist or PLIST.

@igrigorik
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatter calls upcase to load the class, hence the change.

@dj2
Copy link
Contributor

@dj2 dj2 commented on 1427917 Jun 26, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, just saw that. That kinda sucks having to have upcase names for all the formatters. Could we, instead, just use the proper casing when passing into Render?

@igrigorik
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would cause issues for new users: some will type with uppercase, some with downcase, etc., and hence blow up. I would much rather optimize for the end user, not for the developer who is writing the formatter.

@dj2
Copy link
Contributor

@dj2 dj2 commented on 1427917 Jun 26, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh, I thought you'd say that.

Please sign in to comment.