Giter Club home page Giter Club logo

perl6-config-simple's People

Contributors

samcv avatar skarsnik avatar zaucker avatar

Stargazers

 avatar

Watchers

 avatar  avatar

perl6-config-simple's Issues

Config::Simple related warnings

Hi!

I see warnings raised when execute my code which use Config::Simple.

WARNING: unhandled Failure detected in DESTROY. If you meant to ignore it, you can mark it as handled by calling .Bool, .so, .not, or .defined methods. The Failure was:
No such symbol 'Config::Simple::ini'
  in method read at /home/melezhik/.rakudobrew/moar-2017.06/install/share/perl6/site/sources/40865DBAA12A9141883E938CAF1031769F31FF08 (Config::Simple) line 11
  in sub MAIN at /home/melezhik/.rakudobrew/moar-2017.06/install/share/perl6/site/resources/451B49334CBDAF3F56532B8B4A31492E4B77D4A8 line 62
  in block <unit> at /home/melezhik/.rakudobrew/moar-2017.06/install/share/perl6/site/resources/451B49334CBDAF3F56532B8B4A31492E4B77D4A8 line 366

Stack trace:

      #  /home/melezhik/.rakudobrew/moar-2017.06/install/share/perl6/site/sources/40865DBAA12A9141883E938CAF1031769F31FF08

      1 use Config::Simple::Role;
      2 use Data::Dump;
      3 use MONKEY-SEE-NO-EVAL;
      4 
      5 class Config::Simple does Config::Simple::Role {
      6 
      7   method read($filename, Str :$f) {
      8     my $this;
      9     if ($f) {
     10       my $module = "Config::Simple::$f";
     11       require ::($module);
     12       $this = ::($module).new();
     13       $this.read($filename);
     14     } else {
     15       my $text = slurp($filename);
     16       $this = self.bless(:filename($filename), :hash(EVAL($text)));
     17     }
     18     return $this;
     19   }
     20 
     21   method new(Str :$f) {
     22     if ($f) {
     23       my $module = "Config::Simple::$f";
     24       require ::($module);
     25       return ::($module).new();
     26     }
     27     return self.bless();
     28   }
     29 
     30   method write($filename = Any) {
     31     $.filename = $filename if $filename.defined;
     32     my $fh = open $.filename, :w;
     33     $fh.print(Dump(%(%!hash), :color(False)));
     34     $fh.print("\n");
     35     $fh.close;
     36   }
     37 
     38 }


#  /home/melezhik/.rakudobrew/moar-2017.06/install/share/perl6/site/resources/451B49334CBDAF3F56532B8B4A31492E4B77D4A8 

      1 use Terminal::ANSIColor;
      2 use JSON::Tiny;
      3 use Sparrowdo;
      4 use Sparrowdo::Core::DSL::User;
      5 use Sparrowdo::Core::DSL::Group;
      6 use Sparrowdo::Core::DSL::File;
      7 use Sparrowdo::Core::DSL::Directory;
      8 use Sparrowdo::Core::DSL::Template;
      9 use Sparrowdo::Core::DSL::Systemd;
     10 use Sparrowdo::Core::DSL::Package;
     11 use Sparrowdo::Core::DSL::CPAN::Package;
     12 use Sparrowdo::Core::DSL::Zef;
     13 use Sparrowdo::Core::DSL::Git;
     14 use Sparrowdo::Core::DSL::Service;
     15 use Sparrowdo::Core::DSL::Bash;
     16 use Sparrowdo::Core::DSL::Ssh;
     17 use Sparrowdo::Core::DSL::Assert;
     18 use Config::Simple;
     19 
     20 
     21 sub MAIN (
     22 
     23   Str  :$host = '127.0.0.1', 
     24   Str  :$sparrowfile, 
     25   Str  :$http_proxy, 
     26   Str  :$https_proxy, 
     27   Str  :$ssh_user, 
     28   Str  :$ssh_private_key, 
     29   Int  :$ssh_port = 22, 
     30   Bool :$verbose = False, 
     31   Bool :$bootstrap = False, 
     32   Bool :$check_syntax = False, 
     33   Str  :$module_run,
     34        :$task_run, 
     35   Bool :$no_sudo = False,
     36   Bool :$no_color = False,
     37   Bool :$no_index_update = False,
     38   Str  :$sparrow_root = '/opt/sparrow', 
     39   Str  :$repo,
     40   Bool :$local_mode = False,
     41   Str  :$password,
     42   Str  :$docker,
     43   Str  :$cwd, 
     44   Str  :$format, 
     45 )
     46 
     47 {
     48 
     49   # read config if exists
     50 
     51   my $sparrowdo-cache = %*ENV<USER> ?? '/home/' ~ %*ENV<USER> ~ '/.sparrowdo/' ~ $sparrow_root !! '/.sparrowdo';
     52 
     53   shell "rm -rf $sparrowdo-cache/";
     54 
     55   mkdir "$sparrowdo-cache/plugins";
     56 
     57   my $conf-ini-file = %*ENV<USER> ?? '/home/' ~ %*ENV<USER> ~ '/sparrowdo.ini' !! ( $sparrow_root ~ '/sparrowdo.ini' );
     58 
     59   my $conf-ini = Hash.new;
     60 
     61   if $conf-ini-file.IO ~~ :e {
     62     Config::Simple.read($conf-ini-file,:f("ini"))
     63   }

# /home/melezhik/.rakudobrew/moar-2017.06/install/share/perl6/site/resources/451B49334CBDAF3F56532B8B4A31492E4B77D4A8

    366 sub bootstrap ( $sparrow_root, $sparrowdo-cache ) {
    367 
    368   my $host = input_params('Host');
    369   say input_params('NoColor') ?? 
    370   'running sparrow bootstrap for host: ' ~ $host ~ ' ... ' !!
    371   colored( 'running sparrow bootstrap for host: ' ~ $host ~ ' ... ', 'bold black on_yellow');

...

My environment:


perl6 -v
This is Rakudo version 2017.06 built on MoarVM version 2017.06
implementing Perl 6.c.

zef locate Config::Simple
===> From Distribution: Config::Simple:ver<*>:auth<Sylvain Colinet>:api<>
Config::Simple => /home/melezhik/.rakudobrew/moar-2017.06/install/share/perl6/site/sources/40865DBAA12A9141883E938CAF1031769F31FF08

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.