Module: Workspace

Included in:
MagLove::Asset::Theme, MagLove::Commands::Base, MagLove::Middleware::LiveReload, MagLove::Server
Defined in:
lib/workspace.rb,
lib/maglove/workspace.rb,
lib/workspace/workspace_dir.rb,
lib/workspace/workspace_file.rb,
lib/workspace/workspace_file/net.rb,
lib/workspace/workspace_file/media.rb,
lib/workspace/workspace_file/parse.rb,
lib/workspace/workspace_dir/archive.rb,
lib/workspace/workspace_file/archive.rb

Defined Under Namespace

Classes: WorkspaceDir, WorkspaceFile

Instance Method Summary collapse

Instance Method Details

#gem_dirObject



19
20
21
# File 'lib/maglove/workspace.rb', line 19

def gem_dir
  workspace_dir(Gem.datadir("maglove"))
end

#theme_base_dir(theme: options[:theme]) ⇒ Object



14
15
16
17
# File 'lib/maglove/workspace.rb', line 14

def theme_base_dir(theme: options[:theme])
  base_version = theme_config(:base_version, theme: theme)
  workspace_dir("src/base/#{base_version}")
end

#theme_base_file(path, theme: options[:theme]) ⇒ Object



10
11
12
# File 'lib/maglove/workspace.rb', line 10

def theme_base_file(path, theme: options[:theme])
  theme_base_dir(theme: theme).file(path)
end

#theme_config(key = nil, theme: options[:theme]) ⇒ Object



23
24
25
# File 'lib/maglove/workspace.rb', line 23

def theme_config(key = nil, theme: options[:theme])
  Maglove.theme_config(key, theme)
end

#theme_dir(root: "src", theme: options[:theme]) ⇒ Object



2
3
4
# File 'lib/maglove/workspace.rb', line 2

def theme_dir(root: "src", theme: options[:theme])
  workspace_dir("#{root}/themes/#{theme}")
end

#theme_file(path, root: "src", theme: options[:theme]) ⇒ Object



6
7
8
# File 'lib/maglove/workspace.rb', line 6

def theme_file(path, root: "src", theme: options[:theme])
  workspace_file("#{root}/themes/#{theme}", path)
end

#workspace_dir(workspace, path = "") ⇒ Object



4
5
6
# File 'lib/workspace.rb', line 4

def workspace_dir(workspace, path = "")
  Workspace::WorkspaceDir.new(workspace, path)
end

#workspace_file(workspace, path = "") ⇒ Object



8
9
10
# File 'lib/workspace.rb', line 8

def workspace_file(workspace, path = "")
  Workspace::WorkspaceFile.new(workspace, path)
end