Class: Bidi2pdf::TestHelpers::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/bidi2pdf/test_helpers/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/bidi2pdf/test_helpers/configuration.rb', line 26

def initialize
  project_root = if defined?(Rails) && Rails.respond_to?(:root)
                   Pathname.new(Rails.root)
                 elsif defined?(Bundler) && Bundler.respond_to?(:root)
                   Pathname.new(Bundler.root)
                 else
                   Pathname.new(Dir.pwd)
                 end

  @spec_dir = project_root.join("spec").expand_path
  @docker_dir = project_root.join("docker")
  @fixture_dir = project_root.join("spec", "fixtures")
  @tmp_dir = project_root.join("tmp")
  @prefix = "tmp_"
end

Instance Attribute Details

#docker_dirString

Returns the directory for Docker files.

Returns:

  • (String)

    the directory for Docker files



20
21
22
# File 'lib/bidi2pdf/test_helpers/configuration.rb', line 20

def docker_dir
  @docker_dir
end

#fixture_dirString

Returns the directory for fixture files.

Returns:

  • (String)

    the directory for fixture files



24
25
26
# File 'lib/bidi2pdf/test_helpers/configuration.rb', line 24

def fixture_dir
  @fixture_dir
end

#prefixString

Returns the prefix for temporary files.

Returns:

  • (String)

    the prefix for temporary files



16
17
18
# File 'lib/bidi2pdf/test_helpers/configuration.rb', line 16

def prefix
  @prefix
end

#spec_dirPathname

Returns the directory where specs are located.

Returns:

  • (Pathname)

    the directory where specs are located



8
9
10
# File 'lib/bidi2pdf/test_helpers/configuration.rb', line 8

def spec_dir
  @spec_dir
end

#tmp_dirString

Returns the directory for temporary files.

Returns:

  • (String)

    the directory for temporary files



12
13
14
# File 'lib/bidi2pdf/test_helpers/configuration.rb', line 12

def tmp_dir
  @tmp_dir
end