Class: Funicular::Plugin::Spec

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bundler_spec) ⇒ Spec

Returns a new instance of Spec.



42
43
44
# File 'lib/funicular/plugin.rb', line 42

def initialize(bundler_spec)
  @bundler_spec = bundler_spec
end

Instance Attribute Details

#bundler_specObject (readonly)

Returns the value of attribute bundler_spec.



40
41
42
# File 'lib/funicular/plugin.rb', line 40

def bundler_spec
  @bundler_spec
end

Instance Method Details

#css_pathsObject



58
59
60
# File 'lib/funicular/plugin.rb', line 58

def css_paths
  project.css_paths
end

#nameObject



54
55
56
# File 'lib/funicular/plugin.rb', line 54

def name
  bundler_spec.name
end

#projectObject



50
51
52
# File 'lib/funicular/plugin.rb', line 50

def project
  @project ||= Project.new(root)
end

#rootObject



46
47
48
# File 'lib/funicular/plugin.rb', line 46

def root
  @root ||= Pathname(bundler_spec.full_gem_path).expand_path
end

#validate!Object

Raises:



62
63
64
65
66
67
# File 'lib/funicular/plugin.rb', line 62

def validate!
  raise Error, "Missing Funicular plugin gem: #{root}" unless root.exist?
  raise Error, "No Ruby source files found in #{project.source_dir}" if project.source_files.empty?

  self
end