Acme-Schlong

 view release on metacpan or  search on metacpan

lib/Acme/Schlong.pm  view on Meta::CPAN

    # has number of files in ~/.emacs.d
    # has using .ssh/config
    # has rvm/rbenv installed
    # 

    # has number_of_modules      => ( is => 'ro', isa => Int,  lazy_build => 1, documentation => q{} );

    method _build_useraccounts           { scalar grep { !/Shared/ } grep { -d $_ } glob ( dir( $self->home_directory => '..') . '/*'); } #TODO Make safer for WIN
    method _build_username_length        { length $self->username }
    method _build_shell                  { $_ = $ENV{SHELL}; s/.*\/(.*?)$/$1/; $_ } # /r
    method _build_harddrive_size         { $_=`df -l | grep '\\/\$' | awk '{print \$2}'`; chomp; $_ } # -E 'use IPC::Run qw<run timeout>; my $out; my @cmd = (q<du>, q<-s>, q</>); run \@cmd, "", \undef, \$out, timeout( 100 ) echo `uptime|grep days|sed...
    method _build_harddrive_used         { $_=`df -l | grep '\\/\$' | awk '{print \$3}'`; chomp; $_ } # -E 'use IPC::Run qw<run timeout>; my $out; my @cmd = (q<du>, q<-s>, q</>); run \@cmd, "", \undef, \$out, timeout( 100 ) echo `uptime|grep days|sed...
    method _build_uptime                 { 100 }
    method _build_users                  {  5  }
    method _build_cores                  { App::OS::Detect::MachineCores->new->cores }
    method _build_using_multiplex        { $self->using_byobu or $self->using_tmux or $self->using_screen ? true : false }
    method _build_using_byobu            { exists $ENV{BYOBU_BACKEND} ? 1 : 0 }
    method _build_using_tmux             { $ENV{TERM} ~~ 'tmux'       ? 1 : 0 }
    method _build_using_screen           { $ENV{TERM} ~~ 'screen'     ? 1 : 0 }
    method _build_perl_version           { $_ = `$^X --version`; m/perl.*\((?<vstring>v\d\.\d+.\d+)\) built for.*/; $+{vstring} }
    # method _build_perl_version_is_dev    { version->new($self->perl_version)->version->[1] % 2 ? 1 : 0 } # is_alpha
    method _build_directories_in_path    { scalar split q<:> =>      $ENV{PATH}         }

lib/Acme/Schlong.pm  view on Meta::CPAN

        # directories_in_path
        # using_perlbrew
        # using_cpanm
        # using_cpanm_customized
        # using_bash
        # using_zsh
        # using_ksh
        # using_tcsh
        # using_csh
        
        # say for glob (dir($self->home_directory) . '/' . '.*');

        $self->add_size(10)  if $self->using_zsh;
        $self->add_size(100) if $self->using_multiplex;

        $self->add_size( 100 * $self->cores );

        $self->sub_size( 10 * $self->username_length );

        $self->abs_size
    }

    method testdrive {
        say "Your Acme Schlong size is: ", $self->size;
        say "Your username is: ", $self->username;
        say "Your home directory is: ", $self->home_directory;
        say "The number of useraccounts is ", $self->useraccounts;
        say "Your TERM is ", $self->term;
        say "Your shell is ", $self->shell;
        say "You are using byobu ", $self->using_byobu;
        say "Your username length is ", $self->username_length;
        say "You harddrive_size is ", $self->harddrive_size;
        say "The number of cores is ", $self->cores;
        say "Your perl version is  ", $self->perl_version;
        # say "Your perl version is a dev_release: ", $self->perl_version_is_dev;
        say "You have this many dirs in PATH: ", $self->directories_in_path;
        say "You are using a multiplexer: ", $self->using_multiplex;
        say "You are using perlbrew: ", $self->using_perlbrew;
        say "You are using zsh: ", $self->using_zsh;
        say "You are using bash: ", $self->using_bash;
        say "You are using cpanm: ", $self->using_cpanm;
        say "You are using cpanm customized: ", $self->using_cpanm_customized;
        say "You are using Dist::Zilla: ", $self->using_dzil;
        say "You have this many perls installed ", $self->perls_installed;
        say "Your PAUSE name is ", $self->pause_name;
        say "Your number of known hosts is ", $self->known_hosts;
        # say "Your number of modules released to the cpan is ", $self->cpan_modules;
    }

}


__END__
=pod

=encoding utf-8

lib/Acme/Schlong.pm  view on Meta::CPAN

   * all roles/subclasses are used

=over

=item *

Build Task:: Distribution so that everybody can keep his own stuff?

=item *

Versioning so that you can say "By metric XYZ your schlong size is XYZ" ?

=item *

More robust OS-specific stuff.

=item *

Send report to website

=back



( run in 1.485 second using v1.01-cache-2.11-cpan-389fe586d7c )