Skip to content

Commit

Permalink
Merge pull request #4 from lindt/master
Browse files Browse the repository at this point in the history
do not write ".orig" files anymore.
  • Loading branch information
lindt committed Apr 1, 2016
2 parents 996df57 + f2304df commit bd9ea3b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ end

desc 'Publishes the Gem'
task :push do
sh 'gem push gherkin_format-0.0.5.gem'
sh 'gem push gherkin_format-0.0.6.gem'
end

desc 'Checks ruby style'
Expand Down
2 changes: 1 addition & 1 deletion bin/gherkin_format
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ end.parse!
formatter = GherkinFormat.new

if options.key? :json
fail 'Provide exactly one file' unless ARGV.length == 1
raise 'Provide exactly one file' unless ARGV.length == 1
require 'multi_json'
feature = formatter.to_json(File.read(ARGV.first), ARGV.first)
puts MultiJson.dump feature.first
Expand Down
4 changes: 2 additions & 2 deletions gherkin_format.gemspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Gem::Specification.new do |s|
s.name = 'gherkin_format'
s.version = '0.0.5'
s.date = '2016-01-17'
s.version = '0.0.6'
s.date = '2016-04-01'
s.summary = 'Gherkin Format'
s.description = 'Format Gherkin Files'
s.authors = ['Stefan Rohe']
Expand Down
7 changes: 2 additions & 5 deletions lib/gherkin_format.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,10 @@ def format(file, options = {})
output = format_string input, file
return if input == output

if options.key? :replace
File.write("#{file}_orig", input)
File.write(file, output)
end
File.write(file, output) if options.key? :replace

puts "File #{file} is not formatted well."
fail "File #{file} is not formatted well."
raise "File #{file} is not formatted well."
end

def render(template, files)
Expand Down

0 comments on commit bd9ea3b

Please sign in to comment.