fulldecent / swift5-module-template

An opinionated starting point for awesome, reusable Swift 5 modules
MIT License
450 stars 56 forks source link

Fix default year type #18

Closed cybrox closed 7 years ago

cybrox commented 7 years ago

Using a string interpolation to force the default year into a string.

Otherwise, gsub! will not work, since the year is returned as a number and it does not know how to convert its type into a string implicitly.

./configure:20:in `gsub!': no implicit conversion of Fixnum into String (TypeError)
    from ./configure:20:in `block (3 levels) in replace_variables_in_files'
    from ./configure:19:in `each'
    from ./configure:19:in `block (2 levels) in replace_variables_in_files'
    from ./configure:17:in `open'
    from ./configure:17:in `block in replace_variables_in_files'
    from ./configure:13:in `glob'
    from ./configure:13:in `replace_variables_in_files'
    from ./configure:70:in `<main>'
fulldecent commented 7 years ago

Beautiful, thank you!