Sha256: 8e0bc1a052030e2f4a83d1b4d38f00927a89ef6dd8072c8422632022b5279c58
Contents?: true
Size: 654 Bytes
Versions: 2
Compression:
Stored size: 654 Bytes
Contents
module Wright # rubocop:disable Documentation @dry_run = false # Public: Checks if dry-run mode is currently active. # # Examples # # puts 'Just a dry-run...' if Wright.dry_run? # # Returns true if dry-run mode is currently active and false otherwise. def self.dry_run? @dry_run end # Public: Runs a block in dry-run mode. # # Examples # # Wright.dry_run do # symlink '/tmp/fstab' do |s| # s.to = '/etc/fstab' # end # end # # Returns the block's return value. def self.dry_run saved_dry_run = @dry_run @dry_run = true yield ensure @dry_run = saved_dry_run end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
wright-0.1.1 | lib/wright/dry_run.rb |
wright-0.1.0 | lib/wright/dry_run.rb |