Sha256: 8a3cec2c6062372001c856f8db91325da281ec33ca1f54010b325cdd2e0a70d3
Contents?: true
Size: 1.5 KB
Versions: 2
Compression:
Stored size: 1.5 KB
Contents
module LearnOpen module Lessons class BaseLesson attr_reader :repo_path, :organization, :name, :id, :dot_learn, :git_server, :later_lesson, :options, :io, :system_adapter, :platform, :environment_vars, :logger, :location def initialize(lesson_data, options = {}) lesson = lesson_data[:lesson] @repo_path = lesson.clone_repo @organization, @name = repo_path.split('/') @git_server = lesson.git_server @dot_learn = lesson.dot_learn @is_lab = lesson.lab @later_lesson = lesson_data[:later_lesson] @id = lesson_data[:id] @logger = options.fetch(:logger, LearnOpen.logger) @io = options.fetch(:io, LearnOpen.default_io) @system_adapter = options.fetch(:system_adapter, LearnOpen.system_adapter) @platform = options.fetch(:platform, LearnOpen.platform) @environment_vars = options.fetch(:environment_vars, LearnOpen.environment_vars) @location = options.fetch(:lessons_directory) {LearnOpen.lessons_directory} @options = options end def lab? @is_lab end def readme? !lab? end def to_path "#{location}/#{name}" end def to_url "https://learn.co/lessons/#{id}" end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
learn-open-1.2.22 | lib/learn_open/lessons/base_lesson.rb |
learn-open-1.2.21 | lib/learn_open/lessons/base_lesson.rb |