line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Perl::ToPerl6::UserProfile; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
18
|
use 5.006001; |
|
1
|
|
|
|
|
4
|
|
4
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
18
|
|
5
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
24
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
4
|
use English qw(-no_match_vars); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
12
|
|
8
|
1
|
|
|
1
|
|
392
|
use Readonly; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
40
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
813
|
use Config::Tiny qw(); |
|
1
|
|
|
|
|
892
|
|
|
1
|
|
|
|
|
19
|
|
11
|
1
|
|
|
1
|
|
6
|
use File::Spec qw(); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
16
|
|
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
522
|
use Perl::ToPerl6::OptionsProcessor qw(); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
14
|
1
|
|
|
1
|
|
6
|
use Perl::ToPerl6::Utils qw{ :characters transformer_long_name transformer_short_name }; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
50
|
|
15
|
1
|
|
|
1
|
|
209
|
use Perl::ToPerl6::Exception::Fatal::Internal qw{ throw_internal }; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
46
|
|
16
|
1
|
|
|
1
|
|
4
|
use Perl::ToPerl6::Exception::Configuration::Generic qw{ throw_generic }; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
20
|
|
17
|
1
|
|
|
1
|
|
41
|
use Perl::ToPerl6::TransformerConfig; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
1360
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub new { |
22
|
|
|
|
|
|
|
|
23
|
5
|
|
|
5
|
1
|
4491
|
my ( $class, %args ) = @_; |
24
|
5
|
|
|
|
|
14
|
my $self = bless {}, $class; |
25
|
5
|
|
|
|
|
19
|
$self->_init( %args ); |
26
|
5
|
|
|
|
|
14
|
return $self; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub _init { |
32
|
|
|
|
|
|
|
|
33
|
5
|
|
|
5
|
|
13
|
my ( $self, %args ) = @_; |
34
|
|
|
|
|
|
|
# The profile can be defined, undefined, or an empty string. |
35
|
5
|
100
|
|
|
|
28
|
my $profile = defined $args{-profile} ? $args{-profile} : _find_profile_path(); |
36
|
5
|
|
|
|
|
17
|
$self->_load_profile( $profile ); |
37
|
5
|
|
|
|
|
13
|
$self->_set_options_processor(); |
38
|
5
|
|
|
|
|
9
|
return $self; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub options_processor { |
44
|
|
|
|
|
|
|
|
45
|
27
|
|
|
27
|
1
|
38
|
my ($self) = @_; |
46
|
27
|
|
|
|
|
101
|
return $self->{_options_processor}; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub transformer_params { |
52
|
|
|
|
|
|
|
|
53
|
37
|
|
|
37
|
1
|
45
|
my ( $self, $transformer ) = @_; |
54
|
|
|
|
|
|
|
|
55
|
37
|
|
|
|
|
79
|
my $short_name = transformer_short_name($transformer); |
56
|
|
|
|
|
|
|
|
57
|
37
|
|
|
|
|
87
|
return Perl::ToPerl6::TransformerConfig->new( |
58
|
|
|
|
|
|
|
$short_name, |
59
|
|
|
|
|
|
|
$self->raw_transformer_params($transformer), |
60
|
|
|
|
|
|
|
); |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub raw_transformer_params { |
66
|
|
|
|
|
|
|
|
67
|
37
|
|
|
37
|
1
|
49
|
my ( $self, $transformer ) = @_; |
68
|
37
|
|
|
|
|
51
|
my $profile = $self->{_profile}; |
69
|
37
|
|
33
|
|
|
118
|
my $long_name = ref $transformer || transformer_long_name( $transformer ); |
70
|
37
|
|
|
|
|
89
|
my $short_name = transformer_short_name( $long_name ); |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
return |
73
|
|
|
|
|
|
|
$profile->{$short_name} |
74
|
|
|
|
|
|
|
|| $profile->{$long_name} |
75
|
|
|
|
|
|
|
|| $profile->{"-$short_name"} |
76
|
37
|
|
50
|
|
|
452
|
|| $profile->{"-$long_name"} |
77
|
|
|
|
|
|
|
|| {}; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
sub transformer_is_disabled { |
83
|
|
|
|
|
|
|
|
84
|
37
|
|
|
37
|
1
|
48
|
my ( $self, $transformer ) = @_; |
85
|
37
|
|
|
|
|
44
|
my $profile = $self->{_profile}; |
86
|
37
|
|
33
|
|
|
86
|
my $long_name = ref $transformer || transformer_long_name( $transformer ); |
87
|
37
|
|
|
|
|
76
|
my $short_name = transformer_short_name( $long_name ); |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
return exists $profile->{"-$short_name"} |
90
|
37
|
|
33
|
|
|
265
|
|| exists $profile->{"-$long_name"}; |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
sub transformer_is_enabled { |
96
|
|
|
|
|
|
|
|
97
|
37
|
|
|
37
|
1
|
48
|
my ( $self, $transformer ) = @_; |
98
|
37
|
|
|
|
|
44
|
my $profile = $self->{_profile}; |
99
|
37
|
|
33
|
|
|
81
|
my $long_name = ref $transformer || transformer_long_name( $transformer ); |
100
|
37
|
|
|
|
|
73
|
my $short_name = transformer_short_name( $long_name ); |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
return exists $profile->{$short_name} |
103
|
37
|
|
33
|
|
|
201
|
|| exists $profile->{$long_name}; |
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
sub listed_transformers { |
109
|
|
|
|
|
|
|
|
110
|
4
|
|
|
4
|
1
|
8
|
my ( $self, $transformer ) = @_; |
111
|
4
|
|
|
|
|
8
|
my @normalized_transformer_names = (); |
112
|
|
|
|
|
|
|
|
113
|
4
|
|
|
|
|
7
|
for my $transformer_name ( sort keys %{$self->{_profile}} ) { |
|
4
|
|
|
|
|
13
|
|
114
|
0
|
|
|
|
|
0
|
$transformer_name =~ s/\A - //xmso; #Chomp leading "-" |
115
|
0
|
|
|
|
|
0
|
my $transformer_long_name = transformer_long_name( $transformer_name ); |
116
|
0
|
|
|
|
|
0
|
push @normalized_transformer_names, $transformer_long_name; |
117
|
|
|
|
|
|
|
} |
118
|
|
|
|
|
|
|
|
119
|
4
|
|
|
|
|
14
|
return @normalized_transformer_names; |
120
|
|
|
|
|
|
|
} |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
sub source { |
125
|
42
|
|
|
42
|
1
|
49
|
my ( $self ) = @_; |
126
|
|
|
|
|
|
|
|
127
|
42
|
|
|
|
|
88
|
return $self->{_source}; |
128
|
|
|
|
|
|
|
} |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
sub _set_source { |
131
|
0
|
|
|
0
|
|
0
|
my ( $self, $source ) = @_; |
132
|
|
|
|
|
|
|
|
133
|
0
|
|
|
|
|
0
|
$self->{_source} = $source; |
134
|
|
|
|
|
|
|
|
135
|
0
|
|
|
|
|
0
|
return; |
136
|
|
|
|
|
|
|
} |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
139
|
|
|
|
|
|
|
# Begin PRIVATE methods |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
Readonly::Hash my %LOADER_FOR => ( |
142
|
|
|
|
|
|
|
ARRAY => \&_load_profile_from_array, |
143
|
|
|
|
|
|
|
DEFAULT => \&_load_profile_from_file, |
144
|
|
|
|
|
|
|
HASH => \&_load_profile_from_hash, |
145
|
|
|
|
|
|
|
SCALAR => \&_load_profile_from_string, |
146
|
|
|
|
|
|
|
); |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
sub _load_profile { |
149
|
|
|
|
|
|
|
|
150
|
5
|
|
|
5
|
|
11
|
my ( $self, $profile ) = @_; |
151
|
|
|
|
|
|
|
|
152
|
5
|
|
50
|
|
|
24
|
my $ref_type = ref $profile || 'DEFAULT'; |
153
|
5
|
|
|
|
|
41
|
my $loader = $LOADER_FOR{$ref_type}; |
154
|
|
|
|
|
|
|
|
155
|
5
|
50
|
|
|
|
44
|
if (not $loader) { |
156
|
0
|
|
|
|
|
0
|
throw_internal qq{Can't load UserProfile from type "$ref_type"}; |
157
|
|
|
|
|
|
|
} |
158
|
|
|
|
|
|
|
|
159
|
5
|
|
|
|
|
13
|
$self->{_profile} = $loader->($self, $profile); |
160
|
5
|
|
|
|
|
11
|
return $self; |
161
|
|
|
|
|
|
|
} |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
sub _set_options_processor { |
166
|
|
|
|
|
|
|
|
167
|
5
|
|
|
5
|
|
8
|
my ($self) = @_; |
168
|
5
|
|
|
|
|
9
|
my $profile = $self->{_profile}; |
169
|
5
|
|
50
|
|
|
24
|
my $defaults = delete $profile->{__defaults__} || {}; |
170
|
|
|
|
|
|
|
$self->{_options_processor} = |
171
|
5
|
|
|
|
|
9
|
Perl::ToPerl6::OptionsProcessor->new( %{ $defaults } ); |
|
5
|
|
|
|
|
41
|
|
172
|
5
|
|
|
|
|
15
|
return $self; |
173
|
|
|
|
|
|
|
} |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
sub _load_profile_from_file { |
178
|
5
|
|
|
5
|
|
13
|
my ( $self, $file ) = @_; |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
# Handle special cases. |
181
|
5
|
100
|
|
|
|
21
|
return {} if not defined $file; |
182
|
3
|
100
|
|
|
|
11
|
return {} if $file eq $EMPTY; |
183
|
2
|
50
|
|
|
|
14
|
return {} if $file eq 'NONE'; |
184
|
|
|
|
|
|
|
|
185
|
0
|
|
|
|
|
|
$self->_set_source( $file ); |
186
|
|
|
|
|
|
|
|
187
|
0
|
|
|
|
|
|
my $profile = Config::Tiny->read( $file ); |
188
|
0
|
0
|
|
|
|
|
if (not defined $profile) { |
189
|
0
|
|
|
|
|
|
my $errstr = Config::Tiny::errstr(); |
190
|
0
|
|
|
|
|
|
throw_generic |
191
|
|
|
|
|
|
|
message => qq{Could not parse profile "$file": $errstr}, |
192
|
|
|
|
|
|
|
source => $file; |
193
|
|
|
|
|
|
|
} |
194
|
|
|
|
|
|
|
|
195
|
0
|
|
|
|
|
|
_fix_defaults_key( $profile ); |
196
|
|
|
|
|
|
|
|
197
|
0
|
|
|
|
|
|
return $profile; |
198
|
|
|
|
|
|
|
} |
199
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
sub _load_profile_from_array { |
203
|
0
|
|
|
0
|
|
|
my ( $self, $array_ref ) = @_; |
204
|
0
|
|
|
|
|
|
my $joined = join qq{\n}, @{ $array_ref }; |
|
0
|
|
|
|
|
|
|
205
|
0
|
|
|
|
|
|
my $profile = Config::Tiny->read_string( $joined ); |
206
|
|
|
|
|
|
|
|
207
|
0
|
0
|
|
|
|
|
if (not defined $profile) { |
208
|
0
|
|
|
|
|
|
throw_generic 'Profile error: ' . Config::Tiny::errstr(); |
209
|
|
|
|
|
|
|
} |
210
|
|
|
|
|
|
|
|
211
|
0
|
|
|
|
|
|
_fix_defaults_key( $profile ); |
212
|
|
|
|
|
|
|
|
213
|
0
|
|
|
|
|
|
return $profile; |
214
|
|
|
|
|
|
|
} |
215
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
217
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
sub _load_profile_from_string { |
219
|
0
|
|
|
0
|
|
|
my ( $self, $string ) = @_; |
220
|
0
|
|
|
|
|
|
my $profile = Config::Tiny->read_string( ${ $string } ); |
|
0
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
|
222
|
0
|
0
|
|
|
|
|
if (not defined $profile) { |
223
|
0
|
|
|
|
|
|
throw_generic 'Profile error: ' . Config::Tiny::errstr(); |
224
|
|
|
|
|
|
|
} |
225
|
|
|
|
|
|
|
|
226
|
0
|
|
|
|
|
|
_fix_defaults_key( $profile ); |
227
|
|
|
|
|
|
|
|
228
|
0
|
|
|
|
|
|
return $profile; |
229
|
|
|
|
|
|
|
} |
230
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
232
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
sub _load_profile_from_hash { |
234
|
0
|
|
|
0
|
|
|
my ( $self, $hash_ref ) = @_; |
235
|
0
|
|
|
|
|
|
return $hash_ref; |
236
|
|
|
|
|
|
|
} |
237
|
|
|
|
|
|
|
|
238
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
239
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
sub _find_profile_path { |
241
|
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
#Define default filename |
243
|
0
|
|
|
0
|
|
|
my $rc_file = '.perlmogrifyrc'; |
244
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
#Check explicit environment setting |
246
|
0
|
0
|
|
|
|
|
return $ENV{PERLMOGRIFY} if exists $ENV{PERLMOGRIFY}; |
247
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
#Check current directory |
249
|
0
|
0
|
|
|
|
|
return $rc_file if -f $rc_file; |
250
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
#Check home directory |
252
|
0
|
0
|
|
|
|
|
if ( my $home_dir = _find_home_dir() ) { |
253
|
0
|
|
|
|
|
|
my $path = File::Spec->catfile( $home_dir, $rc_file ); |
254
|
0
|
0
|
|
|
|
|
return $path if -f $path; |
255
|
|
|
|
|
|
|
} |
256
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
#No profile defined |
258
|
0
|
|
|
|
|
|
return; |
259
|
|
|
|
|
|
|
} |
260
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
262
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
sub _find_home_dir { |
264
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
# Try using File::HomeDir |
266
|
0
|
0
|
|
0
|
|
|
if ( eval { require File::HomeDir } ) { |
|
0
|
|
|
|
|
|
|
267
|
0
|
|
|
|
|
|
return File::HomeDir->my_home(); |
268
|
|
|
|
|
|
|
} |
269
|
|
|
|
|
|
|
|
270
|
|
|
|
|
|
|
# Check usual environment vars |
271
|
0
|
|
|
|
|
|
for my $key (qw(HOME USERPROFILE HOMESHARE)) { |
272
|
0
|
0
|
|
|
|
|
next if not defined $ENV{$key}; |
273
|
0
|
0
|
|
|
|
|
return $ENV{$key} if -d $ENV{$key}; |
274
|
|
|
|
|
|
|
} |
275
|
|
|
|
|
|
|
|
276
|
|
|
|
|
|
|
# No home directory defined |
277
|
0
|
|
|
|
|
|
return; |
278
|
|
|
|
|
|
|
} |
279
|
|
|
|
|
|
|
|
280
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
281
|
|
|
|
|
|
|
|
282
|
|
|
|
|
|
|
# !$%@$%^ Config::Tiny uses a completely non-descriptive name for global |
283
|
|
|
|
|
|
|
# values. |
284
|
|
|
|
|
|
|
sub _fix_defaults_key { |
285
|
0
|
|
|
0
|
|
|
my ( $profile ) = @_; |
286
|
|
|
|
|
|
|
|
287
|
0
|
|
|
|
|
|
my $defaults = delete $profile->{_}; |
288
|
0
|
0
|
|
|
|
|
if ($defaults) { |
289
|
0
|
|
|
|
|
|
$profile->{__defaults__} = $defaults; |
290
|
|
|
|
|
|
|
} |
291
|
|
|
|
|
|
|
|
292
|
0
|
|
|
|
|
|
return; |
293
|
|
|
|
|
|
|
} |
294
|
|
|
|
|
|
|
|
295
|
|
|
|
|
|
|
1; |
296
|
|
|
|
|
|
|
|
297
|
|
|
|
|
|
|
__END__ |
298
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
300
|
|
|
|
|
|
|
|
301
|
|
|
|
|
|
|
=pod |
302
|
|
|
|
|
|
|
|
303
|
|
|
|
|
|
|
=for stopwords UserProfile |
304
|
|
|
|
|
|
|
|
305
|
|
|
|
|
|
|
=head1 NAME |
306
|
|
|
|
|
|
|
|
307
|
|
|
|
|
|
|
Perl::ToPerl6::UserProfile - The contents of the user's profile, often F<.perlmogrifyrc>. |
308
|
|
|
|
|
|
|
|
309
|
|
|
|
|
|
|
|
310
|
|
|
|
|
|
|
=head1 DESCRIPTION |
311
|
|
|
|
|
|
|
|
312
|
|
|
|
|
|
|
This is a helper class that encapsulates the contents of the user's |
313
|
|
|
|
|
|
|
profile, which is usually stored in a F<.perlmogrifyrc> file. There are |
314
|
|
|
|
|
|
|
no user-serviceable parts here. |
315
|
|
|
|
|
|
|
|
316
|
|
|
|
|
|
|
|
317
|
|
|
|
|
|
|
=head1 INTERFACE SUPPORT |
318
|
|
|
|
|
|
|
|
319
|
|
|
|
|
|
|
This is considered to be a non-public class. Its interface is subject |
320
|
|
|
|
|
|
|
to change without notice. |
321
|
|
|
|
|
|
|
|
322
|
|
|
|
|
|
|
|
323
|
|
|
|
|
|
|
=head1 CONSTRUCTOR |
324
|
|
|
|
|
|
|
|
325
|
|
|
|
|
|
|
=over |
326
|
|
|
|
|
|
|
|
327
|
|
|
|
|
|
|
=item C< new( -profile => $p ) > |
328
|
|
|
|
|
|
|
|
329
|
|
|
|
|
|
|
B<-profile> is the path to the user's profile. If -profile is not |
330
|
|
|
|
|
|
|
defined, then it looks for the profile at F<./.perlmogrifyrc> and then |
331
|
|
|
|
|
|
|
F<$HOME/.perlmogrifyrc>. If neither of those files exists, then the |
332
|
|
|
|
|
|
|
UserProfile is created with default values. |
333
|
|
|
|
|
|
|
|
334
|
|
|
|
|
|
|
This object does not take into account any command-line overrides; |
335
|
|
|
|
|
|
|
L<Perl::ToPerl6::Config|Perl::ToPerl6::Config> does that. |
336
|
|
|
|
|
|
|
|
337
|
|
|
|
|
|
|
|
338
|
|
|
|
|
|
|
=back |
339
|
|
|
|
|
|
|
|
340
|
|
|
|
|
|
|
|
341
|
|
|
|
|
|
|
=head1 METHODS |
342
|
|
|
|
|
|
|
|
343
|
|
|
|
|
|
|
=over |
344
|
|
|
|
|
|
|
|
345
|
|
|
|
|
|
|
=item C< options_processor() > |
346
|
|
|
|
|
|
|
|
347
|
|
|
|
|
|
|
Returns the |
348
|
|
|
|
|
|
|
L<Perl::ToPerl6::OptionsProcessor|Perl::ToPerl6::OptionsProcessor> |
349
|
|
|
|
|
|
|
object for this UserProfile. |
350
|
|
|
|
|
|
|
|
351
|
|
|
|
|
|
|
|
352
|
|
|
|
|
|
|
=item C< transformer_is_disabled( $transformer ) > |
353
|
|
|
|
|
|
|
|
354
|
|
|
|
|
|
|
Given a reference to a L<Perl::ToPerl6::Transformer|Perl::ToPerl6::Transformer> |
355
|
|
|
|
|
|
|
object or the name of one, returns true if the user has disabled that |
356
|
|
|
|
|
|
|
transformer in their profile. |
357
|
|
|
|
|
|
|
|
358
|
|
|
|
|
|
|
|
359
|
|
|
|
|
|
|
=item C< transformer_is_enabled( $transformer ) > |
360
|
|
|
|
|
|
|
|
361
|
|
|
|
|
|
|
Given a reference to a L<Perl::ToPerl6::Transformer|Perl::ToPerl6::Transformer> |
362
|
|
|
|
|
|
|
object or the name of one, returns true if the user has explicitly |
363
|
|
|
|
|
|
|
enabled that transformer in their user profile. |
364
|
|
|
|
|
|
|
|
365
|
|
|
|
|
|
|
|
366
|
|
|
|
|
|
|
=item C< transformer_params( $transformer ) > |
367
|
|
|
|
|
|
|
|
368
|
|
|
|
|
|
|
Given a reference to a L<Perl::ToPerl6::Transformer|Perl::ToPerl6::Transformer> |
369
|
|
|
|
|
|
|
object or the name of one, returns a |
370
|
|
|
|
|
|
|
L<Perl::ToPerl6::TransformerConfig|Perl::ToPerl6::TransformerConfig> for the |
371
|
|
|
|
|
|
|
user's configuration parameters for that transformer. |
372
|
|
|
|
|
|
|
|
373
|
|
|
|
|
|
|
|
374
|
|
|
|
|
|
|
=item C< raw_transformer_params( $transformer ) > |
375
|
|
|
|
|
|
|
|
376
|
|
|
|
|
|
|
Given a reference to a L<Perl::ToPerl6::Transformer|Perl::ToPerl6::Transformer> |
377
|
|
|
|
|
|
|
object or the name of one, returns a reference to a hash of the user's |
378
|
|
|
|
|
|
|
configuration parameters for that transformer. |
379
|
|
|
|
|
|
|
|
380
|
|
|
|
|
|
|
|
381
|
|
|
|
|
|
|
=item C< listed_transformers() > |
382
|
|
|
|
|
|
|
|
383
|
|
|
|
|
|
|
Returns a list of the names of all the Transformers that are mentioned in |
384
|
|
|
|
|
|
|
the profile. The Transformer names will be fully qualified (e.g. |
385
|
|
|
|
|
|
|
Perl::ToPerl6::Foo). |
386
|
|
|
|
|
|
|
|
387
|
|
|
|
|
|
|
|
388
|
|
|
|
|
|
|
=item C< source() > |
389
|
|
|
|
|
|
|
|
390
|
|
|
|
|
|
|
The place where the profile information came from, if available. |
391
|
|
|
|
|
|
|
Usually the path to a F<.perlmogrifyrc>. |
392
|
|
|
|
|
|
|
|
393
|
|
|
|
|
|
|
|
394
|
|
|
|
|
|
|
=back |
395
|
|
|
|
|
|
|
|
396
|
|
|
|
|
|
|
|
397
|
|
|
|
|
|
|
=head1 SEE ALSO |
398
|
|
|
|
|
|
|
|
399
|
|
|
|
|
|
|
L<Perl::ToPerl6::Config|Perl::ToPerl6::Config>, |
400
|
|
|
|
|
|
|
L<Perl::ToPerl6::OptionsProcessor|Perl::ToPerl6::OptionsProcessor> |
401
|
|
|
|
|
|
|
|
402
|
|
|
|
|
|
|
|
403
|
|
|
|
|
|
|
=head1 AUTHOR |
404
|
|
|
|
|
|
|
|
405
|
|
|
|
|
|
|
Jeffrey Ryan Thalhammer <jeff@imaginative-software.com> |
406
|
|
|
|
|
|
|
|
407
|
|
|
|
|
|
|
|
408
|
|
|
|
|
|
|
=head1 COPYRIGHT |
409
|
|
|
|
|
|
|
|
410
|
|
|
|
|
|
|
Copyright (c) 2005-2011 Imaginative Software Systems. All rights reserved. |
411
|
|
|
|
|
|
|
|
412
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify |
413
|
|
|
|
|
|
|
it under the same terms as Perl itself. The full text of this license |
414
|
|
|
|
|
|
|
can be found in the LICENSE file included with this module. |
415
|
|
|
|
|
|
|
|
416
|
|
|
|
|
|
|
=cut |
417
|
|
|
|
|
|
|
|
418
|
|
|
|
|
|
|
# Local Variables: |
419
|
|
|
|
|
|
|
# mode: cperl |
420
|
|
|
|
|
|
|
# cperl-indent-level: 4 |
421
|
|
|
|
|
|
|
# fill-column: 78 |
422
|
|
|
|
|
|
|
# indent-tabs-mode: nil |
423
|
|
|
|
|
|
|
# c-indentation-style: bsd |
424
|
|
|
|
|
|
|
# End: |
425
|
|
|
|
|
|
|
# ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround : |