lib/yasm/task.rb in ruby-yasm-0.2.0 vs lib/yasm/task.rb in ruby-yasm-0.2.1
- old
+ new
@@ -39,13 +39,13 @@
#
class Task < RProgram::Task
# The known YASM targets
TARGETS = {
- :x86 => {:arch => :x86, :machine => :x86},
+ :x86 => {:arch => :x86, :machine => :x86},
:amd64 => {:arch => :x86, :machine => :amd64},
- :lc3b => {:arch => :lc3b, :machine => :lc3b}
+ :lc3b => {:arch => :lc3b, :machine => :lc3b}
}
long_option :flag => '--version'
long_option :flag => '--license'
long_option :flag => '--help'
@@ -73,25 +73,25 @@
:name => :output
long_option :flag => '--mapfile',
:equals => true,
:name => :map_file
- long_option :flag => '--machine', :equals => true
- long_option :flag => '--force-strict'
+ long_option :flag => '--machine', :equals => true
+ long_option :flag => '--force-strict'
short_option :flag => '-w', :name => :inhibit_warnings
short_option :flag => '-W', :name => :toggle_warnings
short_option :flag => '-M', :name => :gen_makefile_deps
short_option :flag => '-E', :name => :redirect_errors_to
short_option :flag => '-s', :name => :redirect_errors
- long_option :flag => '--preproc-only', :name => :preprocessor_only
+ long_option :flag => '--preproc-only', :name => :preprocessor_only
short_option :flag => '-I', :name => :include, :multiple => true
short_option :flag => '-P', :name => :pre_include, :multiple => true
short_option :flag => '-D', :name => :define, :multiple => true
short_option :flag => '-U', :name => :undefine, :multiple => true
short_option :flag => '-X', :name => :message_style
- long_option :flag => '--prefix'
- long_option :flag => '--suffix'
+ long_option :flag => '--prefix'
+ long_option :flag => '--suffix'
non_option :tailing => true, :name => :file
#
# Creates a new Task object.
@@ -123,11 +123,11 @@
# Sets the YASM `arch` and `machine`.
#
# @param [String, Symbol] name
# The target name.
#
- # @raise [RuntimeError]
+ # @raise [ArgumentError]
# The specified target is unknown.
#
# @return [true]
# The YASM `arch` and `machine` options were set successfully.
#
@@ -136,13 +136,13 @@
#
def target!(name)
target = TARGETS[name.to_sym]
unless target
- raise(RuntimeError,"unknown YASM target #{name.inspect}",caller)
+ raise(ArgumentError,"unknown YASM target #{name.inspect}")
end
- self.arch = target[:arch]
+ self.arch = target[:arch]
self.machine = target[:machine]
return true
end
alias syntax parser