Class: Calatrava::Shell

Inherits:
Object
  • Object
show all
Defined in:
lib/calatrava/shell.rb

Instance Method Summary collapse

Constructor Details

#initialize(proj_path) ⇒ Shell

Returns a new instance of Shell.



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

def initialize(proj_path)
  @path = proj_path
end

Instance Method Details

#coffee_filesObject



8
9
10
11
12
# File 'lib/calatrava/shell.rb', line 8

def coffee_files
  Dir.chdir @path do
    Dir["shell/support/*.coffee"] + Dir["shell/support/*.coffee"]
  end
end

#css_filesObject



20
21
22
23
24
25
26
# File 'lib/calatrava/shell.rb', line 20

def css_files
  Dir.chdir @path do
    ["sass", "scss", "css"].collect do |ext|
      Dir["shell/stylesheets/**/[^_]*.#{ext}"]
    end.flatten
  end
end

#featuresObject



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/calatrava/shell.rb', line 28

def features
  Dir.chdir @path do
    Dir["shell/pages/*"].collect do |f|
      if File.directory?(f)
        {
          :name => File.basename(f),
          :coffee => Dir["#{f}/*.coffee"],
          :haml => Dir["#{f}/*.haml"]
        }
      else
        nil
      end
    end.compact
  end
end

#haml_filesObject



14
15
16
17
18
# File 'lib/calatrava/shell.rb', line 14

def haml_files
  Dir.chdir @path do
    Dir["shell/support/*.haml"]
  end
end