lib/learn_open/opener.rb in learn-open-1.2.22 vs lib/learn_open/opener.rb in learn-open-1.2.23
- old
+ new
@@ -1,22 +1,24 @@
module LearnOpen
class Opener
attr_reader :editor,
:target_lesson,
:get_next_lesson,
+ :clone_only,
:io,
:logger,
:options
- def self.run(lesson:, editor_specified:, get_next_lesson:)
- new(lesson, editor_specified, get_next_lesson).run
+ def self.run(lesson:, editor_specified:, get_next_lesson:, clone_only:)
+ new(lesson, editor_specified, get_next_lesson, clone_only).run
end
- def initialize(target_lesson, editor, get_next_lesson, options = {})
+ def initialize(target_lesson, editor, get_next_lesson, clone_only, options = {})
@target_lesson = target_lesson
@editor = editor
@get_next_lesson = get_next_lesson
+ @clone_only = clone_only
@io = options.fetch(:io, LearnOpen.default_io)
@logger = options.fetch(:logger, LearnOpen.logger)
@options = options
@@ -33,9 +35,9 @@
fetch_next_lesson: get_next_lesson
)
lesson = Lessons.classify(lesson_data, options)
environment = LearnOpen::Environments.classify(options)
- lesson.open(environment, editor)
+ lesson.open(environment, editor, clone_only)
end
end
end