lib/exercism/assignment.rb in exercism-0.0.18 vs lib/exercism/assignment.rb in exercism-0.0.19

- old
+ new

@@ -1,11 +1,11 @@ class Exercism class Assignment def self.save(data, path) data['assignments'].map do |attributes| - Assignment.new(attributes.merge('project_dir' => path)).save + new(attributes.merge('project_dir' => path)).save end end attr_reader :track, :slug, :readme, :test_file, :tests, :project_dir @@ -14,9 +14,13 @@ @slug = attributes['slug'] @readme = attributes['readme'] @test_file = attributes['test_file'] @tests = attributes['tests'] @project_dir = attributes['project_dir'] + end + + def exercise + File.join(track, slug) end def save FileUtils.mkdir_p assignment_dir save_readme