2 # Copyright (C) 2007-2008, The Perl Foundation.
7 crow.pir -- Make noise about the new Parrot release
11 This utility is used to help Release Managers format announcement messages.
12 It uses a *very* simple and fast templating system, described in the related
13 module, L<runtime/parrot/library/Crow.pir>.
18 % parrot tools/util/crow.pir --help
26 load_bytecode 'Crow.pir' # TODO s/pir/pbc/
28 .local pmc exports, curr_namespace, test_namespace
29 curr_namespace = get_namespace
30 test_namespace = get_namespace ['Crow']
31 exports = split ' ', 'get_news get_args process'
32 test_namespace.export_to(curr_namespace, exports)
37 unless null opts goto got_opts
42 templates = 'get_json'('tools/util/templates.json')
44 .local string template, type
46 'infix://='(type, 'text')
48 template = 'get_template'(templates, type)
51 data = 'get_json'('tools/util/release.json')
54 version = data['release.version']
56 $S0 = concat type, '.news'
62 $S0 = 'get_news'(version)
68 result = process(template, data)
74 .param string filename
76 load_bytecode 'Config/JSON.pir'
78 .local pmc exports, curr_namespace, test_namespace
79 curr_namespace = get_namespace
80 test_namespace = get_namespace [ 'Config';'JSON' ]
81 exports = split ' ', 'ReadConfig'
82 test_namespace.export_to(curr_namespace, exports)
85 result = ReadConfig(filename)
95 $S0 = concat type, '.text'
105 if null a goto agg_undefined
114 $P0 = new 'Exception'
115 $P0['_message'] = "cannot assign to Null PMC!"
124 # vim: expandtab shiftwidth=4 ft=pir: