Class: Funicular::Plugin::Project

Inherits:
Object
  • Object
show all
Defined in:
lib/funicular/plugin.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(root) ⇒ Project

Returns a new instance of Project.



16
17
18
# File 'lib/funicular/plugin.rb', line 16

def initialize(root)
  @root = Pathname(root).expand_path
end

Instance Attribute Details

#rootObject (readonly)

Returns the value of attribute root.



14
15
16
# File 'lib/funicular/plugin.rb', line 14

def root
  @root
end

Instance Method Details

#assets_dirObject



20
21
22
# File 'lib/funicular/plugin.rb', line 20

def assets_dir
  root.join("assets")
end

#css_pathsObject



34
35
36
# File 'lib/funicular/plugin.rb', line 34

def css_paths
  Dir.glob(assets_dir.join("*.css").to_s).sort.map { |path| Pathname(path) }
end

#source_dirObject



24
25
26
# File 'lib/funicular/plugin.rb', line 24

def source_dir
  root.join("lib")
end

#source_filesObject



28
29
30
31
32
# File 'lib/funicular/plugin.rb', line 28

def source_files
  nested = Dir.glob(source_dir.join("*", "**", "*.rb").to_s).sort
  top_level = Dir.glob(source_dir.join("*.rb").to_s).sort
  nested + top_level
end