Module: Seamus::Builder

Extended by:
Builder
Included in:
Builder
Defined in:
lib/seamus/builder.rb

Instance Method Summary collapse

Instance Method Details

#file_type(extension) ⇒ Object



12
13
14
# File 'lib/seamus/builder.rb', line 12

def file_type(extension)
  determine_type_from_extension(extension)
end

#new(file) ⇒ Object



5
6
7
8
9
10
# File 'lib/seamus/builder.rb', line 5

def new(file)
  path = file.is_a?(File) ? Pathname.new(file.path) : Pathname.new(file)
  extension = path.extname[/\w+$/]
  type = file_type(extension)
  build_class(type, extension).new(path.to_s)
end