Method: Gem::Micro::SpecificationEmitter#format

Defined in:
lib/microgem/specification_emitter.rb

#format(obj) ⇒ Object

Properly formats objects so they can be written to a Ruby ‘.gemspec’ file.



32
33
34
35
36
37
38
39
40
41
# File 'lib/microgem/specification_emitter.rb', line 32

def format(obj)
  case obj
  when Time
    obj.strftime("%Y-%m-%d")
  when Date, Gem::Version, Gem::Requirement
    obj.to_s
  else
    obj
  end
end