plist4r 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/plist4r.gemspec CHANGED
@@ -5,61 +5,69 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{plist4r}
8
- s.version = "0.2.1"
8
+ s.version = "0.2.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["dreamcat4"]
12
- s.date = %q{2010-03-28}
12
+ s.date = %q{2010-04-18}
13
+ s.default_executable = %q{plist4r}
13
14
  s.description = %q{In development. Plist4R is a gem which is striving for 3 things: ease of use, speed, and reliability handling of plists. To help achieve these goals, we may plug-in or re-write this gem with one or several backends. Notably, we try to distinguish this gem by providing easy-to use DSL interface for users. For common plist type(s), such as convenience methods for Launchd Plist}
14
15
  s.email = %q{dreamcat4@gmail.com}
16
+ s.executables = ["plist4r"]
15
17
  s.extra_rdoc_files = [
16
18
  "LICENSE",
17
- "README.rdoc"
19
+ "README.rdoc"
18
20
  ]
19
21
  s.files = [
20
22
  ".document",
21
- ".gitignore",
22
- "LICENSE",
23
- "README.rdoc",
24
- "Rakefile",
25
- "VERSION",
26
- "features/plist4r.feature",
27
- "features/step_definitions/plist4r_steps.rb",
28
- "features/support/env.rb",
29
- "lib/plist4r.rb",
30
- "lib/plist4r/backend.rb",
31
- "lib/plist4r/backend/example.rb",
32
- "lib/plist4r/backend/haml.rb",
33
- "lib/plist4r/backend/libxml4r.rb",
34
- "lib/plist4r/backend/plutil.rb",
35
- "lib/plist4r/backend/ruby_cocoa.rb",
36
- "lib/plist4r/backend_base.rb",
37
- "lib/plist4r/config.rb",
38
- "lib/plist4r/mixin.rb",
39
- "lib/plist4r/mixin/class_attributes.rb",
40
- "lib/plist4r/mixin/data_methods.rb",
41
- "lib/plist4r/mixin/mixlib_config.rb",
42
- "lib/plist4r/mixin/ordered_hash.rb",
43
- "lib/plist4r/mixin/popen4.rb",
44
- "lib/plist4r/mixin/ruby_stdlib.rb",
45
- "lib/plist4r/plist.rb",
46
- "lib/plist4r/plist_cache.rb",
47
- "lib/plist4r/plist_type.rb",
48
- "lib/plist4r/plist_type/info.rb",
49
- "lib/plist4r/plist_type/launchd.rb",
50
- "lib/plist4r/plist_type/plist.rb",
51
- "plist4r.gemspec",
52
- "plists/array_mini.xml",
53
- "plists/example_big_binary.plist",
54
- "plists/example_medium_binary_launchd.plist",
55
- "plists/example_medium_launchd.xml",
56
- "plists/mini.xml",
57
- "spec/examples.rb",
58
- "spec/plist4r/plist_spec.rb",
59
- "spec/plist4r_spec.rb",
60
- "spec/spec.opts",
61
- "spec/spec_helper.rb",
62
- "test.rb"
23
+ ".gitignore",
24
+ ".nojekyll",
25
+ ".yardopts",
26
+ "LICENSE",
27
+ "README.rdoc",
28
+ "Rakefile",
29
+ "VERSION",
30
+ "bin/plist4r",
31
+ "features/plist4r.feature",
32
+ "features/step_definitions/plist4r_steps.rb",
33
+ "features/support/env.rb",
34
+ "lib/plist4r.rb",
35
+ "lib/plist4r/application.rb",
36
+ "lib/plist4r/backend.rb",
37
+ "lib/plist4r/backend/example.rb",
38
+ "lib/plist4r/backend/haml.rb",
39
+ "lib/plist4r/backend/libxml4r.rb",
40
+ "lib/plist4r/backend/plutil.rb",
41
+ "lib/plist4r/backend/ruby_cocoa.rb",
42
+ "lib/plist4r/backend_base.rb",
43
+ "lib/plist4r/commands.rb",
44
+ "lib/plist4r/config.rb",
45
+ "lib/plist4r/mixin.rb",
46
+ "lib/plist4r/mixin/data_methods.rb",
47
+ "lib/plist4r/mixin/mixlib_cli.rb",
48
+ "lib/plist4r/mixin/mixlib_config.rb",
49
+ "lib/plist4r/mixin/ordered_hash.rb",
50
+ "lib/plist4r/mixin/popen4.rb",
51
+ "lib/plist4r/mixin/ruby_stdlib.rb",
52
+ "lib/plist4r/options.rb",
53
+ "lib/plist4r/plist.rb",
54
+ "lib/plist4r/plist_cache.rb",
55
+ "lib/plist4r/plist_type.rb",
56
+ "lib/plist4r/plist_type/info.rb",
57
+ "lib/plist4r/plist_type/launchd.rb",
58
+ "lib/plist4r/plist_type/plist.rb",
59
+ "plist4r.gemspec",
60
+ "plists/array_mini.xml",
61
+ "plists/example_big_binary.plist",
62
+ "plists/example_medium_binary_launchd.plist",
63
+ "plists/example_medium_launchd.xml",
64
+ "plists/mini.xml",
65
+ "spec/examples.rb",
66
+ "spec/plist4r/plist_spec.rb",
67
+ "spec/plist4r_spec.rb",
68
+ "spec/spec.opts",
69
+ "spec/spec_helper.rb",
70
+ "test.rb"
63
71
  ]
64
72
  s.homepage = %q{http://github.com/dreamcat4/plist4r}
65
73
  s.rdoc_options = ["--charset=UTF-8"]
@@ -68,9 +76,9 @@ Gem::Specification.new do |s|
68
76
  s.summary = %q{Dreamcat4's plist4r gem. For reading/writing plists in ruby}
69
77
  s.test_files = [
70
78
  "spec/examples.rb",
71
- "spec/plist4r/plist_spec.rb",
72
- "spec/plist4r_spec.rb",
73
- "spec/spec_helper.rb"
79
+ "spec/plist4r/plist_spec.rb",
80
+ "spec/plist4r_spec.rb",
81
+ "spec/spec_helper.rb"
74
82
  ]
75
83
 
76
84
  if s.respond_to? :specification_version then
data/test.rb CHANGED
@@ -24,8 +24,8 @@ puts p.inspect
24
24
  # puts "plist type is"
25
25
  # puts p2.plist_type.inspect
26
26
 
27
- # p2.unsupported_keys false
28
- # puts p2.unsupported_keys.inspect
27
+ # p2.strict_keys false
28
+ # puts p2.strict_keys.inspect
29
29
  # p2.<< do
30
30
  # somekey "append"
31
31
  # end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 1
9
- version: 0.2.1
8
+ - 2
9
+ version: 0.2.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - dreamcat4
@@ -14,8 +14,8 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-03-28 00:00:00 +00:00
18
- default_executable:
17
+ date: 2010-04-18 00:00:00 +01:00
18
+ default_executable: plist4r
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rspec
@@ -57,8 +57,8 @@ dependencies:
57
57
  version_requirements: *id003
58
58
  description: "In development. Plist4R is a gem which is striving for 3 things: ease of use, speed, and reliability handling of plists. To help achieve these goals, we may plug-in or re-write this gem with one or several backends. Notably, we try to distinguish this gem by providing easy-to use DSL interface for users. For common plist type(s), such as convenience methods for Launchd Plist"
59
59
  email: dreamcat4@gmail.com
60
- executables: []
61
-
60
+ executables:
61
+ - plist4r
62
62
  extensions: []
63
63
 
64
64
  extra_rdoc_files:
@@ -67,14 +67,18 @@ extra_rdoc_files:
67
67
  files:
68
68
  - .document
69
69
  - .gitignore
70
+ - .nojekyll
71
+ - .yardopts
70
72
  - LICENSE
71
73
  - README.rdoc
72
74
  - Rakefile
73
75
  - VERSION
76
+ - bin/plist4r
74
77
  - features/plist4r.feature
75
78
  - features/step_definitions/plist4r_steps.rb
76
79
  - features/support/env.rb
77
80
  - lib/plist4r.rb
81
+ - lib/plist4r/application.rb
78
82
  - lib/plist4r/backend.rb
79
83
  - lib/plist4r/backend/example.rb
80
84
  - lib/plist4r/backend/haml.rb
@@ -82,14 +86,16 @@ files:
82
86
  - lib/plist4r/backend/plutil.rb
83
87
  - lib/plist4r/backend/ruby_cocoa.rb
84
88
  - lib/plist4r/backend_base.rb
89
+ - lib/plist4r/commands.rb
85
90
  - lib/plist4r/config.rb
86
91
  - lib/plist4r/mixin.rb
87
- - lib/plist4r/mixin/class_attributes.rb
88
92
  - lib/plist4r/mixin/data_methods.rb
93
+ - lib/plist4r/mixin/mixlib_cli.rb
89
94
  - lib/plist4r/mixin/mixlib_config.rb
90
95
  - lib/plist4r/mixin/ordered_hash.rb
91
96
  - lib/plist4r/mixin/popen4.rb
92
97
  - lib/plist4r/mixin/ruby_stdlib.rb
98
+ - lib/plist4r/options.rb
93
99
  - lib/plist4r/plist.rb
94
100
  - lib/plist4r/plist_cache.rb
95
101
  - lib/plist4r/plist_type.rb
@@ -1,128 +0,0 @@
1
- # class_attributes.rb - Class Attributes
2
- # A Feature-complete alternative to @@
3
-
4
- class Object
5
- def deep_clone; Marshal::load(Marshal.dump(self)); end
6
- end
7
-
8
- module ClassAttributes
9
-
10
- def cattr(*args, &block)
11
- (class << self; self; end).class_eval do
12
- attr_accessor *args
13
- end
14
- @cattr ||= []
15
- @cattr.concat(args)
16
- end
17
-
18
- def iattr(*args, &block)
19
- (class << self; self; end).class_eval do
20
- attr_accessor *args
21
- end
22
- @iattr ||= []
23
- @iattr.concat(args)
24
- end
25
-
26
- def oattr(*args, &block)
27
- (class << self; self; end).class_eval do
28
- attr_accessor *args
29
- end
30
- @oattr ||= []
31
- @oattr.concat(args)
32
- end
33
-
34
- def oattr_i(*args, &block)
35
- (class << self; self; end).class_eval do
36
- attr_accessor *args
37
- end
38
- @oattr_i ||= []
39
- @oattr_i.concat(args)
40
- end
41
-
42
- def co_attr(*args, &block)
43
- cattr(*args,&block)
44
- oattr(*args,&block)
45
- end
46
-
47
- def co_attr_i(*args, &block)
48
- iattr(*args,&block)
49
- oattr_i(*args,&block)
50
- end
51
-
52
- alias_method :class_inherited_attribute_shared, :cattr
53
- alias_method :class_inherited_attribute_independant, :iattr
54
-
55
- alias_method :object_inherited_attribute_shared, :oattr
56
- alias_method :object_inherited_attribute_independant, :oattr_i
57
-
58
- alias_method :class_and_object_shared_inherited_attribute, :co_attr
59
- alias_method :class_and_object_independant_inherited_attribute, :co_attr_i
60
-
61
- def inherited(subclass)
62
- super(subclass) if respond_to?('super')
63
- iattr.each do |a|
64
- # puts "a=#{a}"
65
- subclass.send("#{a}=", send(a).deep_clone)
66
- subclass.send("iattr", a.to_sym)
67
- end
68
- cattr.each do |a|
69
- subclass.send("#{a}=", send(a))
70
- subclass.send("cattr", a.to_sym)
71
- end
72
- oattr.each do |a|
73
- subclass.send("oattr", a.to_sym)
74
- end
75
- oattr_i.each do |a|
76
- subclass.send("oattr_i", a.to_sym)
77
- end
78
- subclass.send(:inherit) if subclass.respond_to?('inherit')
79
- end
80
-
81
- def inherit(*args, &block)
82
- super if respond_to?('super')
83
- end
84
- end
85
-
86
- module ObjectPreInitialize
87
- private
88
- def pre_initialize(*args, &block)
89
- super if respond_to?('super')
90
-
91
- class_attrs = self.class.cattr + self.class.iattr
92
-
93
- self.class.oattr.each do |a|
94
- sac = self.class.send(a)
95
- eval "@#{a.to_s}=sac" if class_attrs.include? a
96
- end
97
-
98
- self.class.oattr_i.each do |a|
99
- sac = self.class.send(a)
100
- eval "@#{a.to_s}=sac.deep_clone" if class_attrs.include? a
101
- end
102
- end
103
-
104
- # def postinitialize(*args, &block)
105
- # end
106
- end
107
-
108
- module OverloadNew
109
- def new(*args, &block)
110
- newObj = self.allocate
111
- newObj.send :extend, ObjectPreInitialize
112
- newObj.send :pre_initialize, *args, &block
113
- newObj.send :initialize, *args, &block
114
- # newObj.send :postinitialize, *args, &block
115
- return newObj
116
- end
117
- end
118
-
119
- def has_class_attributes
120
- extend ClassAttributes
121
- end
122
-
123
- def has_class_object_attributes
124
- extend ClassAttributes
125
- extend OverloadNew
126
- end
127
-
128
-