Sha256: 73858ed02b268e4c336af67153ae95138768608544408618fab7c90d9beb5b0a

Contents?: true

Size: 1.08 KB

Versions: 57

Compression:

Stored size: 1.08 KB

Contents

package Module::Build::Config;

use strict;
use warnings;
our $VERSION = '0.4234';
$VERSION = eval $VERSION;
use Config;

sub new {
  my ($pack, %args) = @_;
  return bless {
		stack => {},
		values => $args{values} || {},
	       }, $pack;
}

sub get {
  my ($self, $key) = @_;
  return $self->{values}{$key} if ref($self) && exists $self->{values}{$key};
  return $Config{$key};
}

sub set {
  my ($self, $key, $val) = @_;
  $self->{values}{$key} = $val;
}

sub push {
  my ($self, $key, $val) = @_;
  push @{$self->{stack}{$key}}, $self->{values}{$key}
    if exists $self->{values}{$key};
  $self->{values}{$key} = $val;
}

sub pop {
  my ($self, $key) = @_;

  my $val = delete $self->{values}{$key};
  if ( exists $self->{stack}{$key} ) {
    $self->{values}{$key} = pop @{$self->{stack}{$key}};
    delete $self->{stack}{$key} unless @{$self->{stack}{$key}};
  }

  return $val;
}

sub values_set {
  my $self = shift;
  return undef unless ref($self);
  return $self->{values};
}

sub all_config {
  my $self = shift;
  my $v = ref($self) ? $self->{values} : {};
  return {%Config, %$v};
}

1;

Version data entries

57 entries across 33 versions & 1 rubygems

Version Path
javonet-ruby-sdk-2.5.7 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/Module/Build/Config.pm
javonet-ruby-sdk-2.5.6 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/Module/Build/Config.pm
javonet-ruby-sdk-2.5.5 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/Module/Build/Config.pm
javonet-ruby-sdk-2.5.4 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/Module/Build/Config.pm
javonet-ruby-sdk-2.5.3 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/Module/Build/Config.pm
javonet-ruby-sdk-2.5.2 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/Module/Build/Config.pm
javonet-ruby-sdk-2.5.1 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/Module/Build/Config.pm
javonet-ruby-sdk-2.5.0 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/Module/Build/Config.pm
javonet-ruby-sdk-2.4.11 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/Module/Build/Config.pm
javonet-ruby-sdk-2.4.10 lib/javonet-ruby-sdk/Binaries/Perl/MacOs/X64/deps/lib/perl5/Module/Build/Config.pm
javonet-ruby-sdk-2.4.10 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/Module/Build/Config.pm
javonet-ruby-sdk-2.4.9 lib/javonet-ruby-sdk/Binaries/Perl/MacOs/X64/deps/lib/perl5/Module/Build/Config.pm
javonet-ruby-sdk-2.4.9 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/Module/Build/Config.pm
javonet-ruby-sdk-2.4.8 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/Module/Build/Config.pm
javonet-ruby-sdk-2.4.8 lib/javonet-ruby-sdk/Binaries/Perl/MacOs/X64/deps/lib/perl5/Module/Build/Config.pm
javonet-ruby-sdk-2.4.7 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/Module/Build/Config.pm
javonet-ruby-sdk-2.4.7 lib/javonet-ruby-sdk/Binaries/Perl/MacOs/X64/deps/lib/perl5/Module/Build/Config.pm
javonet-ruby-sdk-2.4.6 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/Module/Build/Config.pm
javonet-ruby-sdk-2.4.6 lib/javonet-ruby-sdk/Binaries/Perl/MacOs/X64/deps/lib/perl5/Module/Build/Config.pm
javonet-ruby-sdk-2.4.5 lib/javonet-ruby-sdk/Binaries/Perl/MacOs/X64/deps/lib/perl5/Module/Build/Config.pm