On Nov 9, 2013, at 7:39 AM, Love U Ruby <lists / ruby-forum.com> wrote:

> I am confused with the actual use cases of the options
>=20
> - :force
> - :noop
> - :verbose
>=20
> Basically I was reading and trying some methods in the FileUtlis class
> today and some examples here
> =
http://www.ruby-doc.org/stdlib-2.0.0/libdoc/fileutils/rdoc/FileUtils.html#=
method-c-mv
>=20
> made me confused... I am trying to understand why and when should =
anyone
> consider to use such options with the method?
>=20
> FileUtils.mv Dir.glob('test*.rb'), 'test', :noop =3D> true, :verbose =
=3D>
> true
>=20
> FileUtils.mv Dir.glob('test*.rb'), 'test', :noop =3D> true
>=20
> FileUtils.mv Dir.glob('test*.rb'), 'test', :verbose =3D> true
>=20
> What are the differences between these 3 lines ?

:noop means "take no action" =97 consider it a dry run to see what would =
happen.
:verbose means "say what you are doing (or would do)"

Why someone would use :noop is possibly a matter of speculation, but =
having a dry run option to see what something will attempt to do before =
actually doing it can be of some value. Consider if instead of hard =
coding it to true or false, it was set by a variable in the script, =
perhaps by something set on a command line.