~ubuntu-branches/ubuntu/wily/padre/wily

« back to all changes in this revision

Viewing changes to lib/Padre/Config/Setting.pm

  • Committer: Bazaar Package Importer
  • Author(s): Damyan Ivanov
  • Date: 2009-08-12 14:44:55 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20090812144455-yvk90oa92khfcnls
Tags: 0.42-1
* New Upstream Version
  + add explicit dependency on libtest-simple-perl (>= 0.88)
  + rules: use dh --with quilt (and bump quilt build-dependency to 0.46-7)
  + rules: no need to re-generate .mo files from .po. Upstream does it now
  + copyright: describe share/icons/padre/16x16/logo.png
    - describe share/icons/padre/16x16/toggle-comments.png
    - Padre license is the same as Perl (i.e. not Perl 5)
    - update list of copright holders
    - also list translators
  + drop libtest-most-perl from build-dependencies
  + add liblocale-msgfmt-perl to build-dependencies
  + add libcapture-tiny-perl to (build-)dependencies
  + add libfile-remove-perl (>= 1.42) to (build-)dependencies
  + drop libmodule-inspector-perl from (build-)dependencies
  + add libppix-editortools-perl to (build-)dependencies
  + add libparse-exuberantctags-perl to (build-)dependencies
  + patches:
    - drop lower-wx-requirement-to-2.8.7.patch and replace it with
      SKIP_WXWIDGETS_VERSION_CHECK=1 when configuring
      adjust README.debian accordingly
    - refresh disable-tcp-server.patch
    - drop don't-require-new-file-path.patch (applied upstream)
    - rework fix-pod2-errors.patch (new release, new errors :))
* add fix-perl-interpreter-path.patch fixing the path to the perl interpreter
  in three examples (thanks lintian)
* add more lintian overrides about script-not-executable for scripts that are
  treated as examples/templates
* add fix-whatis.patch fixing the whatis entry of Padre::Wx
* add menu and .desktop file

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
use Params::Util    ();
10
10
use Padre::Constant ();
11
11
 
12
 
our $VERSION = '0.36';
 
12
our $VERSION = '0.42';
13
13
 
14
14
use Class::XSAccessor getters => {
15
15
        name    => 'name',
16
16
        type    => 'type',
17
17
        store   => 'store',
18
18
        default => 'default',
 
19
        project => 'project',
 
20
        options => 'options',
 
21
        apply   => 'apply',
19
22
};
20
23
 
21
24
sub new {
26
29
        unless ( $self->name ) {
27
30
                Carp::croak("Missing or invalid name");
28
31
        }
29
 
        unless ( _ISTYPE( $self->type ) ) {
 
32
        unless ( _TYPE( $self->type ) ) {
30
33
                Carp::croak("Missing or invalid type for setting $self->{name}");
31
34
        }
32
 
        unless ( _ISSTORE( $self->store ) ) {
 
35
        unless ( _STORE( $self->store ) ) {
33
36
                Carp::croak("Missing or invalid store for setting $self->{name}");
34
37
        }
35
38
        unless ( exists $self->{default} ) {
36
39
                Carp::croak("Missing or invalid default for setting $self->{name}");
37
40
        }
38
41
 
 
42
        # Normalise
 
43
        $self->{project} = !!$self->project;
 
44
 
39
45
        return $self;
40
46
}
41
47
 
42
48
#####################################################################
43
49
# Support Functions
44
50
 
45
 
sub _ISTYPE {
46
 
        return !!(
47
 
                defined $_[0] and not ref $_[0]
48
 
                and {
49
 
                        0 => 1,
50
 
                        1 => 1,
51
 
                        2 => 1,
52
 
                        3 => 1,
53
 
                }->{ $_[0] }
54
 
        );
 
51
sub _TYPE {
 
52
        return !!( defined $_[0] and not ref $_[0] and $_[0] =~ /^[0-4]\z/ );
55
53
}
56
54
 
57
 
sub _ISSTORE {
58
 
        return !!(
59
 
                defined $_[0] and not ref $_[0]
60
 
                and {
61
 
                        0 => 1,
62
 
                        1 => 1,
63
 
                        2 => 1,
64
 
                }->{ $_[0] }
65
 
        );
 
55
sub _STORE {
 
56
        return !!( defined $_[0] and not ref $_[0] and $_[0] =~ /^[0-2]\z/ );
66
57
}
67
58
 
68
59
1;