Class: ReqresRspec::Configuration
- Inherits:
-
Object
- Object
- ReqresRspec::Configuration
- Defined in:
- lib/reqres_rspec/configuration.rb
Constant Summary collapse
- DEFAULT_FORMATTERS =
%w(html pdf json)
Instance Attribute Summary collapse
-
#amazon_s3 ⇒ Object
Returns the value of attribute amazon_s3.
-
#formatters ⇒ Object
Returns the value of attribute formatters.
-
#output_path ⇒ Object
Returns the value of attribute output_path.
-
#root ⇒ Object
readonly
Returns the value of attribute root.
-
#templates_path ⇒ Object
Returns the value of attribute templates_path.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/reqres_rspec/configuration.rb', line 26 def initialize ReqresRspec.logger.level = Logger::INFO @root = if defined?(Rails) Rails.root.to_s else raise 'REQRES_RSPEC_ROOT is not defined' if ENV['REQRES_RSPEC_ROOT'].blank? ENV['REQRES_RSPEC_ROOT'] end @templates_path = File.('../templates', __FILE__) @output_path = File.join(@root, '/doc/reqres') requested_formats = (ENV['REQRES_RSPEC_FORMATTERS'].to_s).split(',') requested_formats.sort_by!{|fmt| [DEFAULT_FORMATTERS.index(fmt), fmt]} @formatters = requested_formats.empty? ? %w(html) : requested_formats @amazon_s3 = { credentials: { access_key_id: ENV['AWS_ACCESS_KEY_ID'], secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'], region: (ENV['AWS_REGION'] || 'us-east-1'), }, bucket: ENV['AWS_REQRES_BUCKET'], enabled: false } @title = 'API Docs' end |
Instance Attribute Details
#amazon_s3 ⇒ Object
Returns the value of attribute amazon_s3.
60 61 62 |
# File 'lib/reqres_rspec/configuration.rb', line 60 def amazon_s3 @amazon_s3 end |
#formatters ⇒ Object
Returns the value of attribute formatters.
58 59 60 |
# File 'lib/reqres_rspec/configuration.rb', line 58 def formatters @formatters end |
#output_path ⇒ Object
Returns the value of attribute output_path.
56 57 58 |
# File 'lib/reqres_rspec/configuration.rb', line 56 def output_path @output_path end |
#root ⇒ Object (readonly)
Returns the value of attribute root.
59 60 61 |
# File 'lib/reqres_rspec/configuration.rb', line 59 def root @root end |
#templates_path ⇒ Object
Returns the value of attribute templates_path.
55 56 57 |
# File 'lib/reqres_rspec/configuration.rb', line 55 def templates_path @templates_path end |
#title ⇒ Object
Returns the value of attribute title.
57 58 59 |
# File 'lib/reqres_rspec/configuration.rb', line 57 def title @title end |