Class: Brutal

Inherits:
Object
  • Object
show all
Defined in:
lib/brutal.rb,
lib/brutal/format.rb,
lib/brutal/manifest.rb,
lib/brutal/format/ruby.rb,
lib/brutal/manifest/file.rb,
lib/brutal/manifest/file/name.rb,
lib/brutal/format/ruby/filename.rb,
lib/brutal/command_line_arguments_parser.rb

Overview

The Brutal namespace.

Defined Under Namespace

Modules: Format Classes: CommandLineArgumentsParser, Manifest

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(format) ⇒ Brutal

Returns a new instance of Brutal.



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

def initialize(format)
  @engine = Format.const_get(format)
end

Instance Attribute Details

#engineObject (readonly)

Returns the value of attribute engine.



10
11
12
# File 'lib/brutal.rb', line 10

def engine
  @engine
end

Instance Method Details

#call(pathname) ⇒ Object



16
17
18
19
20
21
# File 'lib/brutal.rb', line 16

def call(pathname)
  manifest = Manifest.parse_file(pathname)
  scaffold = brutalizer(manifest)
  pathname = new_pathname(pathname)
  pathname.write(scaffold)
end