couchpillow 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c41300228038ead4fc735a02ba3bc6f96681b4fb
4
- data.tar.gz: b7c9503ede6474ccbcf16cbf275e7b6c708fccd4
3
+ metadata.gz: efc31e058fa2047dbc8783576c421912a9d27e2f
4
+ data.tar.gz: fd0d87f1485ec3b5419cc1063b09e3da2724a31e
5
5
  SHA512:
6
- metadata.gz: 787c8cbb2b23b57fac2d65ec3c5a4cb0495bbd8f69a70c2d460ef100186158ef6a9eca25f68366140c75f1179718290181e1f4cbba582c08b5e968523060fcb7
7
- data.tar.gz: 896cc7ffc04ca2647e7c997086300ad86685dcab13cb1be6c6d0526cadd333e36940f0cde57dd930d1ed3b03cb4136d0489cfaac3552f500fa5fd80100a92b00
6
+ metadata.gz: 40bc500b602c184c47ebfc60bed01a45ffd3c3167ef8f0b8419d4af97e6a31fe22ef372705d3bc09019cc7d6f64ba226778a7a6075fc553084be18d66542beea
7
+ data.tar.gz: a1c50b1e702d784e695794a770eeacf7daee7151182bd193f9ac58aef01d82e341096c661691a11ad7c0dd1abb8471d76a1a5ae462a2cfa0baa9f717c3ca41d9
data/couchpillow.gemspec CHANGED
@@ -16,6 +16,7 @@ Gem::Specification.new do |s|
16
16
 
17
17
  s.add_development_dependency 'minitest', '~> 5.3'
18
18
  s.add_development_dependency 'mocha', '~> 1.1'
19
+ s.add_development_dependency 'rake', '~> 10.3'
19
20
 
20
21
  s.license = "BSD"
21
22
  end
@@ -28,6 +28,16 @@ module CouchPillow
28
28
  end
29
29
 
30
30
 
31
+ def [] key
32
+ @data[key.to_s.to_sym]
33
+ end
34
+
35
+
36
+ def []= key, value
37
+ @data[key.to_s.to_sym] = value
38
+ end
39
+
40
+
31
41
  # Map hash keys to methods
32
42
  #
33
43
  def method_missing m, *args, &block
@@ -1,5 +1,5 @@
1
1
  module CouchPillow
2
2
  GEM_NAME = "couchpillow"
3
3
  NAME = "CouchPillow"
4
- VERSION = "0.1.1"
4
+ VERSION = "0.2.0"
5
5
  end
@@ -89,5 +89,20 @@ class TestDocument < Minitest::Test
89
89
  d = CouchPillow::Document.new({}, "1")
90
90
  assert_equal "{\"_id\":\"1\",\"created_at\":\"#{mock_time.to_s}\",\"_type\":\"default\"}", d.to_json
91
91
  end
92
+
93
+
94
+ def test_brackets
95
+ d = CouchPillow::Document.new({})
96
+ d[123] = 'test'
97
+ assert_equal 'test', d[123]
98
+
99
+ d['foo'] = 'bar'
100
+ assert_equal 'bar', d[:foo]
101
+
102
+ d[:stuff] = [ 'john', 'mary' ]
103
+ assert_equal ['john', 'mary'], d[:stuff]
104
+
105
+ assert_equal nil, d[:something_else]
106
+ end
92
107
 
93
108
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: couchpillow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Albert Tedja
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-04 00:00:00.000000000 Z
11
+ date: 2014-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.1'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.3'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.3'
41
55
  description: CouchPillow is a light and comfortable Document wrapper for Couchbase
42
56
  Server.
43
57
  email: nicho_tedja@yahoo.com
@@ -52,7 +66,7 @@ files:
52
66
  - lib/couchpillow.rb
53
67
  - lib/couchpillow/document.rb
54
68
  - lib/couchpillow/version.rb
55
- - test/document.rb
69
+ - test/test_document.rb
56
70
  homepage: https://github.com/atedja/pillow
57
71
  licenses:
58
72
  - BSD