Class: Pocketbook::Theme::Location

Inherits:
Object
  • Object
show all
Defined in:
lib/pocketbook/theme.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(theme_reference:, cwd: Dir.pwd) ⇒ Location

Returns a new instance of Location.

Raises:

  • (ArgumentError)


11
12
13
14
15
16
17
18
# File 'lib/pocketbook/theme.rb', line 11

def initialize(theme_reference:, cwd: Dir.pwd)
  input_path = Theme.resolve_theme_path(theme_reference, cwd: cwd)
  @root_path = resolve_root(input_path)

  raise ArgumentError, "Theme directory not found: #{theme_reference}" unless Dir.exist?(@root_path)

  @manifest_path = resolve_manifest_path(input_path)
end

Instance Attribute Details

#manifest_pathObject (readonly)

Returns the value of attribute manifest_path.



9
10
11
# File 'lib/pocketbook/theme.rb', line 9

def manifest_path
  @manifest_path
end

#root_pathObject (readonly)

Returns the value of attribute root_path.



9
10
11
# File 'lib/pocketbook/theme.rb', line 9

def root_path
  @root_path
end