Sha256: 52b96c8bc69c8d7cb60e6bf5ee77be70aedc68e9f1dcb2752b624b6f641ffa3e

Contents?: true

Size: 1.1 KB

Versions: 26

Compression:

Stored size: 1.1 KB

Contents

module Foobara
  module Monorepo
    # TODO: make this MonorepoProject and have a more generic Project so that other projects outside of the
    # repo can have things like reset_all called on th.
    class Project
      attr_accessor :symbol

      def initialize(symbol)
        self.symbol = symbol
      end

      def project_path
        "projects/#{symbol}"
      end

      def require_path
        "foobara/#{symbol}"
      end

      def module_name
        Util.classify(symbol)
      end

      def module
        Foobara.const_get(module_name)
      end

      def load
        require require_path
        Util.require_directory("#{__dir__}/../../../../../#{project_path}/src")
      end

      def install!
        if self.module.respond_to?(:install!)
          self.module.install!
        end
      end

      def reset_all
        if self.module.respond_to?(:reset_all)
          self.module.reset_all
        end
      end

      def new_project_added(project)
        if self.module.respond_to?(:new_project_added)
          self.module.new_project_added(project)
        end
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
foobara-0.0.26 projects/monorepo/lib/foobara/monorepo/project.rb
foobara-0.0.25 projects/monorepo/lib/foobara/monorepo/project.rb
foobara-0.0.24 projects/monorepo/lib/foobara/monorepo/project.rb
foobara-0.0.23 projects/monorepo/lib/foobara/monorepo/project.rb
foobara-0.0.22 projects/monorepo/lib/foobara/monorepo/project.rb
foobara-0.0.21 projects/monorepo/lib/foobara/monorepo/project.rb
foobara-0.0.20 projects/monorepo/lib/foobara/monorepo/project.rb
foobara-0.0.19 projects/monorepo/lib/foobara/monorepo/project.rb
foobara-0.0.18 projects/monorepo/lib/foobara/monorepo/project.rb
foobara-0.0.17 projects/monorepo/lib/foobara/monorepo/project.rb
foobara-0.0.16 projects/monorepo/lib/foobara/monorepo/project.rb
foobara-0.0.15 projects/monorepo/lib/foobara/monorepo/project.rb
foobara-0.0.14 projects/monorepo/lib/foobara/monorepo/project.rb
foobara-0.0.13 projects/monorepo/lib/foobara/monorepo/project.rb
foobara-0.0.12 projects/monorepo/lib/foobara/monorepo/project.rb
foobara-0.0.11 projects/monorepo/lib/foobara/monorepo/project.rb
foobara-0.0.10 projects/monorepo/lib/foobara/monorepo/project.rb
foobara-0.0.9 projects/monorepo/lib/foobara/monorepo/project.rb
foobara-0.0.8 projects/monorepo/lib/foobara/monorepo/project.rb
foobara-0.0.7 projects/monorepo/lib/foobara/monorepo/project.rb