Permalink
Browse files

More cleanup using ActiveSupport's Oxford comma styling of a list.

  • Loading branch information...
1 parent 21bc6d4 commit 2220774bf027f4dd02b41d7efc151c422c403649 @alloy alloy committed Aug 10, 2012
@@ -1,3 +1,5 @@
+require 'active_support/core_ext/array/conversions'
+
module Pod
class Command
class Presenter
@@ -27,7 +29,7 @@ def spec
end
def authors
- oxfordify spec.authors.keys
+ spec.authors.keys.to_sentence
end
def homepage
@@ -89,13 +91,6 @@ def hash
end
private
- def oxfordify words
- if words.size < 3
- words.join ' and '
- else
- "#{words[0..-2].join(', ')}, and #{words.last}"
- end
- end
def distance_from_now_in_words(from_time)
return nil unless from_time
@@ -1,4 +1,5 @@
require 'escape'
+require 'active_support/core_ext/array/conversions'
module Pod
module Generator
@@ -23,7 +24,7 @@ def name
def company
if @specification.authors
- @specification.authors.keys.sort.join(', ')
+ @specification.authors.keys.sort.to_sentence
else
'no-company'
end
@@ -1,3 +1,5 @@
+require 'active_support/core_ext/array/conversions'
+
module Pod
class Specification
class Set
@@ -18,7 +20,7 @@ def required_by(specification)
# TODO add graph that shows which dependencies led to this.
raise Informative, "#{specification} tries to activate `#{dependency}', " \
"but already activated version `#{required_version}' " \
- "by #{@required_by.join(', ')}."
+ "by #{@required_by.to_sentence}."
end
@specification = nil
@required_by << specification
@@ -26,8 +26,8 @@
@doc_installer.appledoc_options.should == [
'--project-name', 'BananaLib 1.0',
'--docset-desc', 'Full of chunky bananas.',
- '--project-company', 'Banana Corp, Monkey Boy',
- '--docset-copyright', 'Banana Corp, Monkey Boy',
+ '--project-company', 'Banana Corp and Monkey Boy',
+ '--docset-copyright', 'Banana Corp and Monkey Boy',
'--company-id', 'org.cocoapods',
'--ignore', '.m',
'--keep-undocumented-objects',

0 comments on commit 2220774

Please sign in to comment.