saxomattic 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b12ac5bd1693fef3a04e55e1a4c3b6a5744187fb
4
+ data.tar.gz: a71d3a1ec6b984994816225eefd10b6a26d59392
5
+ SHA512:
6
+ metadata.gz: 2cb7dbfa427fe80d28dae02ecec9110d6d92fcd9a17cabb860b2afa3bcec2c9f8c4cb26c3465fcc16a4e0cda2254022c298de74c119b4eb4f8fec90c3f31503a
7
+ data.tar.gz: b1070ceb502984877161ca7337f91d82db6c0da159d6aebf4deb660d40e473673841e1d574903acbdcfa3ed429f0b25549334c2378f7cd03da902715e9ae3622
@@ -1,3 +1,3 @@
1
1
  module Saxomattic
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/saxomattic.rb CHANGED
@@ -21,17 +21,26 @@ module Saxomattic
21
21
 
22
22
  def self.included(klass)
23
23
  klass.extend(HookManagementMethods)
24
- klass.__send__(:include, ::ActiveAttr::Model)
25
- klass._capture_active_attr_methods(klass)
26
24
  klass.__send__(:include, ::SAXMachine)
27
25
  klass._capture_sax_machine_methods(klass)
26
+ # Keep these in this order as the initialize call in
27
+ # sax-machine doesn't `super` so we need it to be last in
28
+ klass.__send__(:include, ::ActiveAttr::Model)
29
+ klass._capture_active_attr_methods(klass)
28
30
  klass.extend(ClassMethods)
29
31
  end
30
32
 
33
+ def initialize(*args)
34
+ _active_attr_initialize(*args)
35
+ _sax_machine_initialize(*args)
36
+ super
37
+ end
38
+
31
39
  module HookManagementMethods
32
40
  def _capture_active_attr_methods(klass)
33
41
  class << klass
34
42
  alias_method :_active_attr_attribute, :attribute
43
+ alias_method :_active_attr_initialize, :initialize
35
44
  end
36
45
  end
37
46
 
@@ -42,6 +51,7 @@ module Saxomattic
42
51
  alias_method :_sax_machine_element, :element
43
52
  alias_method :_sax_machine_elements, :elements
44
53
  alias_method :_sax_machine_value, :value
54
+ alias_method :_sax_machine_initialize, :initialize
45
55
  end
46
56
  end
47
57
  end
@@ -30,8 +30,8 @@ class SaxTesterSomething
30
30
  attribute :iso_8701, :type => Date
31
31
  attribute :date, :type => Date
32
32
  attribute :datetime, :type => DateTime
33
- attribute :embedded, :elements => true, :class => SaxTesterEmbedded
34
- attribute :child, :as => :children, :elements => true, :class => SaxTesterChild
33
+ attribute :embedded, :elements => true, :class => SaxTesterEmbedded, :default => []
34
+ attribute :child, :as => :children, :elements => true, :class => SaxTesterChild, :default => []
35
35
  attribute :CAPITALIZATION, :as => :capitalization
36
36
  end
37
37
 
@@ -47,7 +47,7 @@ describe ::Saxomattic do
47
47
  <test>
48
48
  <baz>#{baz}</baz>
49
49
  <iso_8701>2013-01-13</iso_8701>
50
- <datetime>#{DateTime.current}</datetime>
50
+ <datetime>#{DateTime.now}</datetime>
51
51
  <embedded>
52
52
  <foo>2</foo>
53
53
  <embed>#{embedded_message}</embed>
metadata CHANGED
@@ -1,129 +1,114 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: saxomattic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
5
- prerelease:
4
+ version: 0.0.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Brandon Dewitt
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-10-08 00:00:00.000000000 Z
11
+ date: 2013-10-25 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: active_attr
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: activesupport
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - '>='
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: sax-machine
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - '>='
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - '>='
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: pry
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - '>='
68
60
  - !ruby/object:Gem::Version
69
61
  version: '0'
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - '>='
76
67
  - !ruby/object:Gem::Version
77
68
  version: '0'
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: rake
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ! '>='
73
+ - - '>='
84
74
  - !ruby/object:Gem::Version
85
75
  version: '0'
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ! '>='
80
+ - - '>='
92
81
  - !ruby/object:Gem::Version
93
82
  version: '0'
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: rspec
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
- - - ! '>='
87
+ - - '>='
100
88
  - !ruby/object:Gem::Version
101
89
  version: '0'
102
90
  type: :development
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
- - - ! '>='
94
+ - - '>='
108
95
  - !ruby/object:Gem::Version
109
96
  version: '0'
110
97
  - !ruby/object:Gem::Dependency
111
98
  name: simplecov
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
- - - ! '>='
101
+ - - '>='
116
102
  - !ruby/object:Gem::Version
117
103
  version: '0'
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
- - - ! '>='
108
+ - - '>='
124
109
  - !ruby/object:Gem::Version
125
110
  version: '0'
126
- description: ! ' A gem to combine all the wonderful that is sax-machine with the magic
111
+ description: ' A gem to combine all the wonderful that is sax-machine with the magic
127
112
  that is active_attr '
128
113
  email:
129
114
  - brandonsdewitt+saxomattic@gmail.com
@@ -143,33 +128,26 @@ files:
143
128
  - spec/spec_helper.rb
144
129
  homepage: https://github.com/abrandoned/saxomattic.git
145
130
  licenses: []
131
+ metadata: {}
146
132
  post_install_message:
147
133
  rdoc_options: []
148
134
  require_paths:
149
135
  - lib
150
136
  required_ruby_version: !ruby/object:Gem::Requirement
151
- none: false
152
137
  requirements:
153
- - - ! '>='
138
+ - - '>='
154
139
  - !ruby/object:Gem::Version
155
140
  version: '0'
156
- segments:
157
- - 0
158
- hash: -1921715027979040477
159
141
  required_rubygems_version: !ruby/object:Gem::Requirement
160
- none: false
161
142
  requirements:
162
- - - ! '>='
143
+ - - '>='
163
144
  - !ruby/object:Gem::Version
164
145
  version: '0'
165
- segments:
166
- - 0
167
- hash: -1921715027979040477
168
146
  requirements: []
169
147
  rubyforge_project:
170
- rubygems_version: 1.8.24
148
+ rubygems_version: 2.0.3
171
149
  signing_key:
172
- specification_version: 3
150
+ specification_version: 4
173
151
  summary: By including a module "Saxomattic" you can declare xml structured documents
174
152
  with active_attr goodies
175
153
  test_files: