lib/header_generator.rb in xolti-0.1.1 vs lib/header_generator.rb in xolti-0.2.0
- old
+ new
@@ -8,23 +8,19 @@
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Xolti is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Xolti. If not, see <http://www.gnu.org/licenses/>.
require_relative "comment"
-def complete_template(path, info, template)
- template %= info.merge({file_name: File.basename(path)})
- template
-end
-
module HeaderGenerator
def HeaderGenerator.create_for(path, config)
- bare_header = complete_template(path, config.project_info, config.template)
+ info = config.project_info.merge({file_name: File.basename(path)})
+ bare_header = config.template % info
Comment.comment(bare_header, config.get_comment(File.extname(path)))
end
end