Class: ClusterFsck::Commands::Edit
Instance Method Summary
collapse
included, #set_cluster_fsck_env_and_key_from_args
Instance Method Details
#reader ⇒ Object
24
25
26
|
# File 'lib/clusterfsck/commands/edit.rb', line 24
def reader
@reader ||= ClusterFsck::Reader.new(key, cluster_fsck_env: cluster_fsck_env)
end
|
#run_command(args, options = Hashie::Mash.new) ⇒ Object
9
10
11
12
13
14
15
16
17
18
|
# File 'lib/clusterfsck/commands/edit.rb', line 9
def run_command(args, options = Hashie::Mash.new)
raise ArgumentError, "must provide a project name" if args.empty?
set_cluster_fsck_env_and_key_from_args(args)
@options = options
raise ArgumentError, "File #{key} is overridden locally! use --force to force" if reader.has_local_override? and !options.force
new_yaml = ask_editor(YAML.dump(reader.read(remote_only: true).to_hash))
writer.set(Configuration.from_yaml(new_yaml), reader.version_count)
end
|
#writer ⇒ Object
20
21
22
|
# File 'lib/clusterfsck/commands/edit.rb', line 20
def writer
@writer ||= ClusterFsck::Writer.new(key, cluster_fsck_env: reader.cluster_fsck_env)
end
|