massive_record 0.2.2.rc2 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,9 +1,18 @@
1
- # v0.2.2 (git develop)
1
+ # v0.2.3 (git develop)
2
2
 
3
+ -
4
+
5
+
6
+ # v0.2.2 (git master)
7
+
8
+ - Experimental support for 1.9.3 (all tests do pass).
9
+
10
+
11
+ # v0.2.2.rc2
3
12
 
4
- # v0.2.2.rc2 (git master)
5
13
  - Fixed some issues related to callbacks on embedded records.
6
14
 
15
+
7
16
  # v0.2.2.rc1
8
17
 
9
18
  - ProxyCollection destroy_all and delete_all returns removed records.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- massive_record (0.2.2.rc1)
4
+ massive_record (0.2.2)
5
5
  activemodel (~> 3.0.7)
6
6
  activesupport (~> 3.0.7)
7
7
  thrift (= 0.6.0)
@@ -27,7 +27,7 @@ GEM
27
27
  diff-lcs (~> 1.1.2)
28
28
  rspec-mocks (2.6.0)
29
29
  thrift (0.6.0)
30
- tzinfo (0.3.29)
30
+ tzinfo (0.3.31)
31
31
 
32
32
  PLATFORMS
33
33
  ruby
data/README.md CHANGED
@@ -260,7 +260,6 @@ It is however adviced to use the ORM as the interface to the adapter is not yet
260
260
 
261
261
  ## Planned work
262
262
 
263
- - Embedded objects.
264
263
  - Cache the decoded values of attributes, not use the value_is_already_decoded?. This will fix possible problem with YAML as coder backend.
265
264
  - Implement other Adapters, for instance using jruby and the Java API.
266
265
 
@@ -59,7 +59,7 @@ module MassiveRecord
59
59
  loaders.each do |coder|
60
60
  begin
61
61
  return coder.load(data)
62
- rescue
62
+ rescue StandardError, SyntaxError
63
63
  end
64
64
  end
65
65
 
@@ -28,6 +28,17 @@ module MassiveRecord
28
28
  errors.add(:name, :taken) if fields.try(:attribute_name_taken?, name)
29
29
  end
30
30
 
31
+
32
+ def self.type_to_classes
33
+ unless @type_to_classes
34
+ @type_to_classes = Hash.new { |h,k| h[k] = [] }
35
+
36
+ @type_to_classes[:boolean] << TrueClass << FalseClass
37
+ @type_to_classes[:integer] << Fixnum << Bignum
38
+ end
39
+
40
+ @type_to_classes
41
+ end
31
42
 
32
43
  #
33
44
  # Creates a new field based on arguments from DSL
@@ -162,11 +173,8 @@ module MassiveRecord
162
173
  end
163
174
 
164
175
  def classes
165
- classes = case type
166
- when :boolean
167
- [TrueClass, FalseClass]
168
- when :integer
169
- [Fixnum]
176
+ classes = if self.class.type_to_classes.has_key? type
177
+ self.class.type_to_classes[type]
170
178
  else
171
179
  klass = type.to_s.classify
172
180
  if ::Object.const_defined?(klass)
@@ -1,3 +1,3 @@
1
1
  module MassiveRecord
2
- VERSION = "0.2.2.rc2"
2
+ VERSION = "0.2.2"
3
3
  end
@@ -7,7 +7,7 @@ describe "log subscriber" do
7
7
  include SetUpHbaseConnectionBeforeAll
8
8
  include SetTableNamesToTestTable
9
9
 
10
- let(:level) { DEBUG }
10
+ let(:level) { ActiveSupport::BufferedLogger::Severity::DEBUG }
11
11
  subject { ActiveSupport::LogSubscriber::TestHelper::MockLogger.new(level) }
12
12
 
13
13
  before do
@@ -122,7 +122,7 @@ describe "log subscriber" do
122
122
 
123
123
 
124
124
  context "info" do
125
- let(:level) { INFO }
125
+ let(:level) { ActiveSupport::BufferedLogger::Severity::INFO }
126
126
 
127
127
  it "should have nothing logged to begin with" do
128
128
  subject.logged(:debug).size.should be_zero
@@ -154,6 +154,13 @@ describe MassiveRecord::ORM::Schema::Field do
154
154
  MassiveRecord::ORM::Base.backward_compatibility_integers_might_be_persisted_as_strings = old_combatibility
155
155
  end
156
156
 
157
+ it "accepts Bignum as a substitute for Fixnum" do
158
+ @subject = MassiveRecord::ORM::Schema::Field.new(:name => :status, :type => :integer)
159
+ bignum = 9999999999999999999999
160
+ bignum.should be_instance_of Bignum
161
+ expect { @subject.decode(bignum) }.to_not raise_error MassiveRecord::ORM::SerializationTypeMismatch
162
+ end
163
+
157
164
  it "decodes an integer value is represented as a binary string" do
158
165
  @subject = MassiveRecord::ORM::Schema::Field.new(:name => :status, :type => :integer)
159
166
  @subject.decode(nil).should be_nil
metadata CHANGED
@@ -1,82 +1,77 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: massive_record
3
- version: !ruby/object:Gem::Version
4
- prerelease: 6
5
- version: 0.2.2.rc2
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.2
5
+ prerelease:
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Companybook
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2011-10-24 00:00:00 +02:00
14
- default_executable:
15
- dependencies:
16
- - !ruby/object:Gem::Dependency
12
+ date: 2012-01-08 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
17
15
  name: thrift
18
- prerelease: false
19
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &70097852270800 !ruby/object:Gem::Requirement
20
17
  none: false
21
- requirements:
22
- - - "="
23
- - !ruby/object:Gem::Version
18
+ requirements:
19
+ - - =
20
+ - !ruby/object:Gem::Version
24
21
  version: 0.6.0
25
22
  type: :runtime
26
- version_requirements: *id001
27
- - !ruby/object:Gem::Dependency
28
- name: activesupport
29
23
  prerelease: false
30
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *70097852270800
25
+ - !ruby/object:Gem::Dependency
26
+ name: activesupport
27
+ requirement: &70097852270300 !ruby/object:Gem::Requirement
31
28
  none: false
32
- requirements:
29
+ requirements:
33
30
  - - ~>
34
- - !ruby/object:Gem::Version
31
+ - !ruby/object:Gem::Version
35
32
  version: 3.0.7
36
33
  type: :runtime
37
- version_requirements: *id002
38
- - !ruby/object:Gem::Dependency
39
- name: activemodel
40
34
  prerelease: false
41
- requirement: &id003 !ruby/object:Gem::Requirement
35
+ version_requirements: *70097852270300
36
+ - !ruby/object:Gem::Dependency
37
+ name: activemodel
38
+ requirement: &70097852295180 !ruby/object:Gem::Requirement
42
39
  none: false
43
- requirements:
40
+ requirements:
44
41
  - - ~>
45
- - !ruby/object:Gem::Version
42
+ - !ruby/object:Gem::Version
46
43
  version: 3.0.7
47
44
  type: :runtime
48
- version_requirements: *id003
49
- - !ruby/object:Gem::Dependency
50
- name: tzinfo
51
45
  prerelease: false
52
- requirement: &id004 !ruby/object:Gem::Requirement
46
+ version_requirements: *70097852295180
47
+ - !ruby/object:Gem::Dependency
48
+ name: tzinfo
49
+ requirement: &70097852294760 !ruby/object:Gem::Requirement
53
50
  none: false
54
- requirements:
55
- - - ">="
56
- - !ruby/object:Gem::Version
57
- version: "0"
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
58
55
  type: :runtime
59
- version_requirements: *id004
60
- - !ruby/object:Gem::Dependency
61
- name: rspec
62
56
  prerelease: false
63
- requirement: &id005 !ruby/object:Gem::Requirement
57
+ version_requirements: *70097852294760
58
+ - !ruby/object:Gem::Dependency
59
+ name: rspec
60
+ requirement: &70097852294260 !ruby/object:Gem::Requirement
64
61
  none: false
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: "0"
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
69
66
  type: :development
70
- version_requirements: *id005
67
+ prerelease: false
68
+ version_requirements: *70097852294260
71
69
  description: HBase Ruby client API
72
70
  email: geeks@companybook.no
73
71
  executables: []
74
-
75
72
  extensions: []
76
-
77
73
  extra_rdoc_files: []
78
-
79
- files:
74
+ files:
80
75
  - .autotest
81
76
  - .gitignore
82
77
  - .rspec
@@ -267,35 +262,37 @@ files:
267
262
  - spec/support/mock_massive_record_connection.rb
268
263
  - spec/support/time_zone_helper.rb
269
264
  - spec/thrift/cases/encoding_spec.rb
270
- has_rdoc: true
271
265
  homepage: http://github.com/CompanyBook/massive_record
272
266
  licenses: []
273
-
274
267
  post_install_message:
275
268
  rdoc_options: []
276
-
277
- require_paths:
269
+ require_paths:
278
270
  - lib
279
- required_ruby_version: !ruby/object:Gem::Requirement
271
+ required_ruby_version: !ruby/object:Gem::Requirement
280
272
  none: false
281
- requirements:
282
- - - ">="
283
- - !ruby/object:Gem::Version
284
- version: "0"
285
- required_rubygems_version: !ruby/object:Gem::Requirement
273
+ requirements:
274
+ - - ! '>='
275
+ - !ruby/object:Gem::Version
276
+ version: '0'
277
+ segments:
278
+ - 0
279
+ hash: -2640053833139947706
280
+ required_rubygems_version: !ruby/object:Gem::Requirement
286
281
  none: false
287
- requirements:
288
- - - ">"
289
- - !ruby/object:Gem::Version
290
- version: 1.3.1
282
+ requirements:
283
+ - - ! '>='
284
+ - !ruby/object:Gem::Version
285
+ version: '0'
286
+ segments:
287
+ - 0
288
+ hash: -2640053833139947706
291
289
  requirements: []
292
-
293
290
  rubyforge_project: massive_record
294
- rubygems_version: 1.6.2
291
+ rubygems_version: 1.8.11
295
292
  signing_key:
296
293
  specification_version: 3
297
294
  summary: HBase Ruby client API
298
- test_files:
295
+ test_files:
299
296
  - spec/adapter/thrift/adapter_spec.rb
300
297
  - spec/adapter/thrift/atomic_increment_spec.rb
301
298
  - spec/adapter/thrift/connection_spec.rb