vellam 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,4 @@
1
1
  source :rubygems
2
2
 
3
3
  gemspec
4
+
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- vellam (0.1)
4
+ vellam (0.1.2)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
@@ -0,0 +1,181 @@
1
+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2
+ <modelVersion>4.0.0</modelVersion>
3
+ <groupId>rubygems</groupId>
4
+ <artifactId>vellam</artifactId>
5
+ <version>0.1.1</version>
6
+ <name><![CDATA[babel offers a filter for hashes and with that comes json/yaml/xml de/serialization of models which provides a hash representation]]></name>
7
+ <packaging>gem</packaging>
8
+ <description><![CDATA[babel offers a filter for hashes and with that comes json/yaml/xml de/serialization of models which provides a hash representationi. possible models are activerecord, activemodel, resources from datamapper, virtus]]></description>
9
+ <url>https://github.com/mkristian/babel</url>
10
+ <developers>
11
+ <developer>
12
+ <id>m_dot_kristian_at_web_dot_de</id>
13
+ <name>Kristian Meier</name>
14
+ <email>m.kristian@web.de</email>
15
+ </developer>
16
+ </developers>
17
+ <licenses>
18
+ <license>
19
+ <name>MIT-LICENSE</name>
20
+ <url>./MIT-LICENSE</url>
21
+ <distribution>repo</distribution>
22
+ </license>
23
+ </licenses>
24
+ <repositories>
25
+ <repository>
26
+ <id>rubygems-releases</id>
27
+ <url>http://rubygems-proxy.torquebox.org/releases</url>
28
+ </repository>
29
+ <repository>
30
+ <id>rubygems-prereleases</id>
31
+ <url>http://rubygems-proxy.torquebox.org/prereleases</url>
32
+ <releases>
33
+ <enabled>false</enabled>
34
+ </releases>
35
+ <snapshots>
36
+ <enabled>true</enabled>
37
+ </snapshots>
38
+ </repository>
39
+ </repositories>
40
+ <pluginRepositories>
41
+ <pluginRepository>
42
+ <id>rubygems-releases</id>
43
+ <url>http://rubygems-proxy.torquebox.org/releases</url>
44
+ </pluginRepository>
45
+ <pluginRepository>
46
+ <id>rubygems-prereleases</id>
47
+ <url>http://rubygems-proxy.torquebox.org/prereleases</url>
48
+ <releases>
49
+ <enabled>false</enabled>
50
+ </releases>
51
+ <snapshots>
52
+ <enabled>true</enabled>
53
+ </snapshots>
54
+ </pluginRepository>
55
+ <pluginRepository>
56
+ <id>sonatype-snapshots</id>
57
+ <url>http://oss.sonatype.org/content/repositories/snapshots</url>
58
+ <releases>
59
+ <enabled>false</enabled>
60
+ </releases>
61
+ <snapshots>
62
+ <enabled>true</enabled>
63
+ </snapshots>
64
+ </pluginRepository>
65
+ </pluginRepositories>
66
+ <dependencies>
67
+ <dependency>
68
+ <groupId>rubygems</groupId>
69
+ <artifactId>bundler</artifactId>
70
+ <version>[0.0.0,)</version>
71
+ <type>gem</type>
72
+ </dependency>
73
+ <dependency>
74
+ <groupId>rubygems</groupId>
75
+ <artifactId>rake</artifactId>
76
+ <type>gem</type>
77
+ <scope>test</scope>
78
+ </dependency>
79
+ <dependency>
80
+ <groupId>rubygems</groupId>
81
+ <artifactId>json_pure</artifactId>
82
+ <type>gem</type>
83
+ <scope>test</scope>
84
+ </dependency>
85
+ <dependency>
86
+ <groupId>rubygems</groupId>
87
+ <artifactId>minitest</artifactId>
88
+ <type>gem</type>
89
+ <scope>test</scope>
90
+ </dependency>
91
+ </dependencies>
92
+ <dependencyManagement>
93
+ <dependencies>
94
+ <dependency>
95
+ <groupId>rubygems</groupId>
96
+ <artifactId>bundler</artifactId>
97
+ <version>[0,)</version>
98
+ <type>gem</type>
99
+ </dependency>
100
+ <dependency>
101
+ <groupId>rubygems</groupId>
102
+ <artifactId>minitest</artifactId>
103
+ <version>2.11.3</version>
104
+ <type>gem</type>
105
+ </dependency>
106
+ <dependency>
107
+ <groupId>rubygems</groupId>
108
+ <artifactId>json_pure</artifactId>
109
+ <version>1.6.1</version>
110
+ <type>gem</type>
111
+ </dependency>
112
+ <dependency>
113
+ <groupId>rubygems</groupId>
114
+ <artifactId>vellam</artifactId>
115
+ <version>0.1</version>
116
+ <type>gem</type>
117
+ </dependency>
118
+ <dependency>
119
+ <groupId>rubygems</groupId>
120
+ <artifactId>rake</artifactId>
121
+ <version>0.9.2.2</version>
122
+ <type>gem</type>
123
+ </dependency>
124
+ </dependencies>
125
+ </dependencyManagement>
126
+ <properties>
127
+ <gem.home>${project.build.directory}/rubygems</gem.home>
128
+ <gem.path>${project.build.directory}/rubygems</gem.path>
129
+ <jruby.18and19>true</jruby.18and19>
130
+ <jruby.plugins.version>0.29.0-SNAPSHOT</jruby.plugins.version>
131
+ <jruby.version>1.6.7</jruby.version>
132
+ <jruby.versions>1.5.6,1.6.5.1,1.6.7</jruby.versions>
133
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
134
+ </properties>
135
+ <build>
136
+ <plugins>
137
+ <plugin>
138
+ <groupId>de.saumya.mojo</groupId>
139
+ <artifactId>bundler-maven-plugin</artifactId>
140
+ <version>${jruby.plugins.version}</version>
141
+ <executions>
142
+ <execution>
143
+ <goals>
144
+ <goal>install</goal>
145
+ </goals>
146
+ </execution>
147
+ </executions>
148
+ <dependencies>
149
+ <dependency>
150
+ <groupId>rubygems</groupId>
151
+ <artifactId>bundler</artifactId>
152
+ <version>[0.0.0,)</version>
153
+ <type>gem</type>
154
+ </dependency>
155
+ </dependencies>
156
+ </plugin>
157
+ <plugin>
158
+ <groupId>de.saumya.mojo</groupId>
159
+ <artifactId>gem-maven-plugin</artifactId>
160
+ <version>${jruby.plugins.version}</version>
161
+ <extensions>true</extensions>
162
+ <configuration>
163
+ <files>lib/babel.rb~,lib/babel,lib/babel/deserializer.rb,lib/babel/hash_filter.rb,lib/babel/serializer.rb~,lib/babel/deserializer.rb~,lib/babel/hash_filter.rb~,lib/babel/factory.rb~,lib/babel/serializer.rb,lib/babel.rb,spec/spec_helper.rb~,spec/spec_helper.rb,spec/resty.rb~,spec/filter_spec.rb,spec/filter_spec.rb~,MIT-LICENSE,README.md,Gemfile.pom,Gemfile,Gemfile.lock</files>
164
+ <testFiles>spec/filter_spec.rb</testFiles>
165
+ </configuration>
166
+ </plugin>
167
+ <plugin>
168
+ <groupId>de.saumya.mojo</groupId>
169
+ <artifactId>minitest-maven-plugin</artifactId>
170
+ <version>${jruby.plugins.version}</version>
171
+ <executions>
172
+ <execution>
173
+ <goals>
174
+ <goal>spec</goal>
175
+ </goals>
176
+ </execution>
177
+ </executions>
178
+ </plugin>
179
+ </plugins>
180
+ </build>
181
+ </project>
@@ -53,9 +53,8 @@ module Babel
53
53
  end
54
54
 
55
55
  def to_hash(options = nil)
56
- filter.use(options) if options
57
- case @model_or_models
58
- when Array
56
+ filter.use(filter.options.dup.merge!(options)) if options
57
+ if @model_or_models.respond_to?(:collect) && ! @model_or_models.is_a?(Hash)
59
58
  @model_or_models.collect do |m|
60
59
  filter_model(attr(m), m)
61
60
  end
@@ -68,8 +67,8 @@ module Babel
68
67
  to_hash(options).to_json
69
68
  end
70
69
 
71
- def to_xml(options = nil)
72
- opts = fitler.options.dup
70
+ def to_xml(options = {})
71
+ opts = filter.options.dup.merge!(options)
73
72
  root = opts.delete :root
74
73
  fitler.use(opts)
75
74
  result = to_hash
metadata CHANGED
@@ -1,74 +1,53 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vellam
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
5
4
  prerelease:
6
- segments:
7
- - 0
8
- - 1
9
- - 1
10
- version: 0.1.1
5
+ version: 0.1.2
11
6
  platform: ruby
12
7
  authors:
13
- - Kristian Meier
8
+ - Kristian Meier
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
12
 
18
- date: 2012-05-12 00:00:00 Z
13
+ date: 2012-05-16 00:00:00 Z
19
14
  dependencies:
20
- - !ruby/object:Gem::Dependency
21
- name: rake
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- none: false
25
- requirements:
26
- - - "="
27
- - !ruby/object:Gem::Version
28
- hash: 11
29
- segments:
30
- - 0
31
- - 9
32
- - 2
33
- - 2
34
- version: 0.9.2.2
35
- type: :development
36
- version_requirements: *id001
37
- - !ruby/object:Gem::Dependency
38
- name: json_pure
39
- prerelease: false
40
- requirement: &id002 !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ~>
44
- - !ruby/object:Gem::Version
45
- hash: 13
46
- segments:
47
- - 1
48
- - 6
49
- - 1
50
- version: 1.6.1
51
- type: :development
52
- version_requirements: *id002
53
- - !ruby/object:Gem::Dependency
54
- name: minitest
55
- prerelease: false
56
- requirement: &id003 !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - "="
60
- - !ruby/object:Gem::Version
61
- hash: 37
62
- segments:
63
- - 2
64
- - 11
65
- - 3
66
- version: 2.11.3
67
- type: :development
68
- version_requirements: *id003
15
+ - !ruby/object:Gem::Dependency
16
+ name: rake
17
+ prerelease: false
18
+ requirement: &id001 !ruby/object:Gem::Requirement
19
+ none: false
20
+ requirements:
21
+ - - "="
22
+ - !ruby/object:Gem::Version
23
+ version: 0.9.2.2
24
+ type: :development
25
+ version_requirements: *id001
26
+ - !ruby/object:Gem::Dependency
27
+ name: json_pure
28
+ prerelease: false
29
+ requirement: &id002 !ruby/object:Gem::Requirement
30
+ none: false
31
+ requirements:
32
+ - - ~>
33
+ - !ruby/object:Gem::Version
34
+ version: 1.6.1
35
+ type: :development
36
+ version_requirements: *id002
37
+ - !ruby/object:Gem::Dependency
38
+ name: minitest
39
+ prerelease: false
40
+ requirement: &id003 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - "="
44
+ - !ruby/object:Gem::Version
45
+ version: 2.11.3
46
+ type: :development
47
+ version_requirements: *id003
69
48
  description: babel offers a filter for hashes and with that comes json/yaml/xml de/serialization of models which provides a hash representationi. possible models are activerecord, activemodel, resources from datamapper, virtus
70
49
  email:
71
- - m.kristian@web.de
50
+ - m.kristian@web.de
72
51
  executables: []
73
52
 
74
53
  extensions: []
@@ -76,24 +55,25 @@ extensions: []
76
55
  extra_rdoc_files: []
77
56
 
78
57
  files:
79
- - lib/babel.rb~
80
- - lib/babel/deserializer.rb
81
- - lib/babel/hash_filter.rb
82
- - lib/babel/serializer.rb~
83
- - lib/babel/deserializer.rb~
84
- - lib/babel/hash_filter.rb~
85
- - lib/babel/factory.rb~
86
- - lib/babel/serializer.rb
87
- - lib/babel.rb
88
- - spec/spec_helper.rb~
89
- - spec/spec_helper.rb
90
- - spec/resty.rb~
91
- - spec/filter_spec.rb
92
- - spec/filter_spec.rb~
93
- - MIT-LICENSE
94
- - README.md
95
- - Gemfile
96
- - Gemfile.lock
58
+ - lib/babel.rb~
59
+ - lib/babel.rb
60
+ - lib/babel/deserializer.rb
61
+ - lib/babel/hash_filter.rb
62
+ - lib/babel/serializer.rb~
63
+ - lib/babel/deserializer.rb~
64
+ - lib/babel/hash_filter.rb~
65
+ - lib/babel/factory.rb~
66
+ - lib/babel/serializer.rb
67
+ - spec/spec_helper.rb~
68
+ - spec/spec_helper.rb
69
+ - spec/resty.rb~
70
+ - spec/filter_spec.rb
71
+ - spec/filter_spec.rb~
72
+ - MIT-LICENSE
73
+ - README.md
74
+ - Gemfile.pom
75
+ - Gemfile.lock
76
+ - Gemfile-
97
77
  homepage: https://github.com/mkristian/babel
98
78
  licenses: []
99
79
 
@@ -101,31 +81,25 @@ post_install_message:
101
81
  rdoc_options: []
102
82
 
103
83
  require_paths:
104
- - lib
84
+ - lib
105
85
  required_ruby_version: !ruby/object:Gem::Requirement
106
86
  none: false
107
87
  requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- hash: 3
111
- segments:
112
- - 0
113
- version: "0"
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: "0"
114
91
  required_rubygems_version: !ruby/object:Gem::Requirement
115
92
  none: false
116
93
  requirements:
117
- - - ">="
118
- - !ruby/object:Gem::Version
119
- hash: 3
120
- segments:
121
- - 0
122
- version: "0"
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: "0"
123
97
  requirements: []
124
98
 
125
99
  rubyforge_project:
126
- rubygems_version: 1.8.21
100
+ rubygems_version: 1.8.15
127
101
  signing_key:
128
102
  specification_version: 3
129
103
  summary: babel offers a filter for hashes and with that comes json/yaml/xml de/serialization of models which provides a hash representation
130
104
  test_files:
131
- - spec/filter_spec.rb
105
+ - spec/filter_spec.rb