Skip to content

Commit

Permalink
Fixed Interfaces module
Browse files Browse the repository at this point in the history
  • Loading branch information
benvanstaveren committed Apr 24, 2011
1 parent e2cb169 commit ccb819e
Show file tree
Hide file tree
Showing 9 changed files with 662 additions and 625 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,4 +1,5 @@
syntax: glob
.build/*
blib*
Makefile
Makefile.old
Expand Down
5 changes: 5 additions & 0 deletions Changes
@@ -1,3 +1,8 @@
Revision history for {{$dist->name}}

{{$NEXT}}
Fix for the Interfaces.pm module, all is in order now.


1.16 2011-04-25 04:39:25 Asia/Jakarta
The interface.json file got removed in favor as including it as a module
8 changes: 8 additions & 0 deletions extra/Interfaces.pm-template
@@ -0,0 +1,8 @@
use strict;
use warnings;
package Net::Disqus::Interfaces;

# this got turned into a module since bundling a json file is often
# a pain in the you-know-whatsit - plus I forgot to add it to the Dist::Zilla
# distribution last time, so as a module at least it get picked up all the time
# regardless.
28 changes: 28 additions & 0 deletions extra/build.pl
@@ -0,0 +1,28 @@
#!/usr/bin/perl
use strict;
use IO::File;
use JSON::XS;
use Data::Dumper;

my $interfaces;
my $fh = IO::File->new('./interfaces.json');
{
local $/;
$interfaces = <$fh>;
}
$fh->close();

my $json = decode_json($interfaces);

$Data::Dumper::Indent = 0;
$Data::Dumper::Terse = 1;
$Data::Dumper::Deepcopy = 1;

$fh = IO::File->new('./Interfaces.pm-template');
my $out = IO::File->new('>../lib/Net/Disqus/Interfaces.pm');
while(<$fh>) {
$out->print($_);
}
$fh->close();
$out->print('sub INTERFACES { return ', Dumper($json), "; }\n\n1;\n");
$out->close();

0 comments on commit ccb819e

Please sign in to comment.