Sha256: 8d95fdb18baea0330408ac42312eaa04e5337aafe335e8059f6ecbeed46096c1

Contents?: true

Size: 674 Bytes

Versions: 23

Compression:

Stored size: 674 Bytes

Contents

# frozen_string_literal: true

require 'eac_ruby_utils/core_ext'
require 'ehbrs/cooking_book/recipe'

module Ehbrs
  module CookingBook
    class Project
      RECIPES_ROOT_SUBPATH = 'recipes'

      enable_simple_cache
      common_constructor :root do
        self.root = root.to_pathname
      end

      delegate :to_s, to: :root

      private

      def recipes_root_uncached
        root.join(RECIPES_ROOT_SUBPATH)
      end

      def recipes_uncached
        ::Dir.glob(File.join('**', '*.{yml,yaml}'), base: recipes_root.to_path).map do |subpath|
          ::Ehbrs::CookingBook::Recipe.from_file(recipes_root.join(subpath))
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
ehbrs-tools-0.35.1 lib/ehbrs/cooking_book/project.rb
ehbrs-tools-0.35.0 lib/ehbrs/cooking_book/project.rb
ehbrs-tools-0.34.0 lib/ehbrs/cooking_book/project.rb
ehbrs-tools-0.33.0 lib/ehbrs/cooking_book/project.rb
ehbrs-tools-0.32.0 lib/ehbrs/cooking_book/project.rb
ehbrs-tools-0.31.1 lib/ehbrs/cooking_book/project.rb
ehbrs-tools-0.31.0 lib/ehbrs/cooking_book/project.rb
ehbrs-tools-0.30.0 lib/ehbrs/cooking_book/project.rb
ehbrs-tools-0.29.0 lib/ehbrs/cooking_book/project.rb
ehbrs-tools-0.28.3 lib/ehbrs/cooking_book/project.rb
ehbrs-tools-0.28.2 lib/ehbrs/cooking_book/project.rb
ehbrs-tools-0.28.1 lib/ehbrs/cooking_book/project.rb
ehbrs-tools-0.28.0 lib/ehbrs/cooking_book/project.rb
ehbrs-tools-0.27.0 lib/ehbrs/cooking_book/project.rb
ehbrs-tools-0.26.0 lib/ehbrs/cooking_book/project.rb
ehbrs-tools-0.25.1 lib/ehbrs/cooking_book/project.rb
ehbrs-tools-0.25.0 lib/ehbrs/cooking_book/project.rb
ehbrs-tools-0.24.0 lib/ehbrs/cooking_book/project.rb
ehbrs-tools-0.23.1 lib/ehbrs/cooking_book/project.rb
ehbrs-tools-0.23.0 lib/ehbrs/cooking_book/project.rb