Class: RSpec::Approvals::CLI
- Inherits:
-
Thor
- Object
- Thor
- RSpec::Approvals::CLI
- Defined in:
- lib/rspec/approvals/cli.rb
Instance Method Summary collapse
Instance Method Details
#verify ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/rspec/approvals/cli.rb', line 8 def verify approvals = File.read('.approvals').split("\n") rejected = [] approvals.each do |approval| system("#{[:diff]} #{approval}") if [:ask] && yes?("Approve?") system("mv #{approval}") else rejected << approval end end File.open('.approvals', 'w') do |f| f.write rejected.join("\n") end end |