lib/gnawrnip.rb in gnawrnip-0.2.5 vs lib/gnawrnip.rb in gnawrnip-0.3.0
- old
+ new
@@ -1,18 +1,15 @@
require "gnawrnip/version"
+require 'turnip_formatter'
require 'gnawrnip/rspec'
require 'gnawrnip/photographer'
-require 'gnawrnip/publisher'
module Gnawrnip
+ SCREENSHOT_OUTPUT_DIR = File.expand_path('./gnawrnip_tmp')
+
class << self
#
- # [Integer] Time (millisecond) between each image in animation
- #
- attr_accessor :frame_interval_ms
-
- #
# [Boolean] Whether to make animation GIF
#
attr_accessor :make_animation
#
@@ -36,30 +33,31 @@
end
def ready!
require 'gnawrnip/ext/capybara/session' if animation?
require 'gnawrnip/step_screenshot'
+
+ FileUtils.mkdir_p(SCREENSHOT_OUTPUT_DIR)
end
+ def finish!
+ FileUtils.rm_rf(SCREENSHOT_OUTPUT_DIR)
+ end
+
def animation?
make_animation
end
def photographer
@photographer ||= Photographer.new
end
- def publisher
- @publisher ||= Publisher.new
+ def frame_interval_ms=(_)
+ warn 'DEPRECATED: `frame_interval_ms` option is deprecated (not used).'
end
-
- def publisher_driver=(driver)
- warn "DEPRECATED: `publisher_driver` option is deprecated (not used)."
- end
end
end
Gnawrnip.configure do |c|
- c.frame_interval_ms = 1000
c.make_animation = true
c.max_frame_size = nil
end