lib/twee2/story_format.rb in twee2-0.2.2 vs lib/twee2/story_format.rb in twee2-0.3.0
- old
+ new
@@ -11,11 +11,11 @@
format_data_for_json = "\{#{format_data}\}"
@source = JSON.parse(format_data_for_json)['source']
end
# Given a story file, injects it into the StoryFormat and returns the HTML results
- def compile(story_file)
- @source.gsub('{{STORY_NAME}}', story_file.title).gsub('{{STORY_DATA}}', story_file.xmldata).gsub('{{STORY_FORMAT}}', @name)
+ def compile
+ @source.gsub('{{STORY_NAME}}', Twee2::build_config.story_name).gsub('{{STORY_DATA}}', Twee2::build_config.story_file.xmldata).gsub('{{STORY_FORMAT}}', @name)
end
# Returns an array containing the known StoryFormat names
def self.known_names
Dir.open(Twee2::buildpath('storyFormats')).to_a.sort.reject{|d|d=~/^\./}.map{|f|" * #{f}"}