Class: Jet::File

Inherits:
Object
  • Object
show all
Defined in:
lib/jet/file.rb

Constant Summary collapse

JAVASCRIPT_EXTENSIONS =
['.js', '.coffee', '.hbs']
STYLESHEET_EXTENSIONS =
['.css', '.sass', '.scss']

Class Method Summary collapse

Class Method Details

.is_javascript?(file) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/jet/file.rb', line 7

def is_javascript?(file)
  JAVASCRIPT_EXTENSIONS.include?(::File.extname(file))
end

.is_public?(file) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/jet/file.rb', line 15

def is_public?(file)
  ::File.dirname(file) =~ /^public/
end

.is_stylesheet?(file) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/jet/file.rb', line 11

def is_stylesheet?(file)
  STYLESHEET_EXTENSIONS.include?(::File.extname(file))
end