Module: Boxing

Defined in:
lib/boxing.rb,
lib/boxing/utils.rb,
lib/boxing/config.rb,
lib/boxing/command.rb,
lib/boxing/context.rb,
lib/boxing/package.rb,
lib/boxing/railtie.rb,
lib/boxing/version.rb,
lib/boxing/database.rb,
lib/boxing/template.rb,
lib/boxing/generator.rb

Overview

The tool to generate Dockerfile without config

Since:

  • 0.1.0

Defined Under Namespace

Modules: Utils Classes: Command, Config, Context, Database, Generator, Package, Railtie, Template

Constant Summary collapse

LOCK =

Since:

  • 0.1.0

Mutex.new
VERSION =

Since:

  • 0.1.0

'0.11.0'

Class Method Summary collapse

Class Method Details

.config(&block) ⇒ Boxing::Config

Returns:

Since:

  • 0.5.0



39
40
41
42
43
44
45
46
47
48
49
# File 'lib/boxing.rb', line 39

def config(&block)
  return @config if @config

  LOCK.synchronize do
    return @config if @config

    @config = Config.new(&block)
  end

  @config
end

.contextBoxing::Context

Returns:

Since:

  • 0.11.0



61
62
63
64
65
66
67
# File 'lib/boxing.rb', line 61

def context
  @context ||= Context.new(
    config,
    database,
    dependencies
  )
end

.databaseBoxing::Database

Returns:

Since:

  • 0.11.0



54
55
56
# File 'lib/boxing.rb', line 54

def database
  @database ||= Database.new
end

.dependencies(groups = %i[default production]) ⇒ Bundler::Dependency

Returns:

  • (Bundler::Dependency)

Since:

  • 0.1.0



29
30
31
32
33
34
# File 'lib/boxing.rb', line 29

def dependencies(groups = %i[default production])
  Bundler
    .definition
    .current_dependencies
    .select { |dep| (dep.groups & groups).any? }
end

.loaderObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.11.0



15
16
17
18
19
# File 'lib/boxing.rb', line 15

def loader
  @loader ||= Zeitwerk::Loader.for_gem.tap do |loader|
    loader.ignore("#{__dir__}/boxing/{railtie,hanami}.rb")
  end
end