rubyfox-sfsobject 0.6.0-java → 0.6.1-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -5
- data/README.md +5 -0
- data/Rakefile +15 -0
- data/lib/rubyfox/sfsobject/bulk.rb +11 -3
- data/lib/rubyfox/sfsobject/version.rb +1 -1
- data/test/rubyfox/sfsobject/bulk_test.rb +15 -0
- metadata +25 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c82cfb1c96972e63c8984f750c6feefc88a7dc6e
|
4
|
+
data.tar.gz: 45b7574048602c2b71669383c662f0019c995c5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53f360150c22a1df77594a14fe8ee9dfb4c29b55afff8a56fbe422f7ee65ed0ff4c393cc1eeab229f98a40ee1e3572d46825a8b6b2c5c918eaad02931c99acda
|
7
|
+
data.tar.gz: 77d8b85559129e5ee89e3d3cc7c6c650c35a4c371724189847f839a20b3501d44d93b4e99b9485deb891fc890ff3c7c7f50e6b007fd8c22657b3947cd1d5d465
|
data/.travis.yml
CHANGED
@@ -2,17 +2,14 @@ language: ruby
|
|
2
2
|
sudo: false
|
3
3
|
cache: bundler
|
4
4
|
rvm:
|
5
|
-
- jruby-
|
6
|
-
- jruby
|
7
|
-
- jruby-head
|
5
|
+
- jruby-9.1.5.0
|
6
|
+
- jruby-1.7.26
|
8
7
|
env:
|
9
8
|
global:
|
10
9
|
- CODECLIMATE_REPO_TOKEN=7800b9ed7143dedbdc5e3c62021efa6944bacce3ea9e001654d7481cdabb8c07
|
11
10
|
- JRUBY_OPTS='--dev -J-Xmx1024M'
|
12
11
|
matrix:
|
13
12
|
fast_finish: true
|
14
|
-
allow_failures:
|
15
|
-
- rvm: jruby-head
|
16
13
|
notifications:
|
17
14
|
webhooks:
|
18
15
|
urls:
|
data/README.md
CHANGED
@@ -94,6 +94,11 @@ sfs_object[:string] # => "value"
|
|
94
94
|
|
95
95
|
* More docs, please!
|
96
96
|
|
97
|
+
## Release
|
98
|
+
|
99
|
+
1. Bump `VERSION` in `lib/rubyfox/sfsobject/version.rb`
|
100
|
+
2. Commit version bump via `git commit -am "Release X.Y.Z"`
|
101
|
+
3. Run `rake release`
|
97
102
|
|
98
103
|
## Contributing
|
99
104
|
|
data/Rakefile
CHANGED
@@ -17,3 +17,18 @@ RDoc::Task.new do |rdoc|
|
|
17
17
|
rdoc.main = 'README.rdoc'
|
18
18
|
rdoc.rdoc_files.include('README.rdoc', 'lib/**/*.rb')
|
19
19
|
end
|
20
|
+
|
21
|
+
desc "Run console"
|
22
|
+
task :console do
|
23
|
+
$LOAD_PATH << "./lib"
|
24
|
+
require 'rubyfox/sfsobject'
|
25
|
+
|
26
|
+
ENV['SF_DIR'] ||= File.join(File.dirname(__FILE__), 'test', 'vendor', 'smartfox')
|
27
|
+
Rubyfox::SFSObject.boot!(ENV['SF_DIR'] + "/lib")
|
28
|
+
|
29
|
+
require 'rubyfox/sfsobject/core_ext'
|
30
|
+
|
31
|
+
require 'irb'
|
32
|
+
ARGV.clear
|
33
|
+
IRB.start
|
34
|
+
end
|
@@ -48,9 +48,7 @@ module Rubyfox
|
|
48
48
|
"LONG_ARRAY" => :getLongArray,
|
49
49
|
"DOUBLE_ARRAY" => :getDoubleArray,
|
50
50
|
"SFS_OBJECT" => proc { |k, v| to_hash(v.object) },
|
51
|
-
"SFS_ARRAY" => proc
|
52
|
-
v.object.iterator.map { |e| to_hash(e.object) }
|
53
|
-
end
|
51
|
+
"SFS_ARRAY" => proc { |k, v| to_array(v.object) }
|
54
52
|
}
|
55
53
|
|
56
54
|
# hash -> object
|
@@ -93,8 +91,18 @@ module Rubyfox
|
|
93
91
|
hash
|
94
92
|
end
|
95
93
|
|
94
|
+
def to_array(object)
|
95
|
+
object.iterator.each_with_index.map do |value, index|
|
96
|
+
_unwrap(object, index, value)
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
96
100
|
def unwrap_value!(object, key)
|
97
101
|
value = object.get(key)
|
102
|
+
_unwrap(object, key, value)
|
103
|
+
end
|
104
|
+
|
105
|
+
def _unwrap(object, key, value)
|
98
106
|
raise ArgumentError, "nil value for #{key.inspect}" unless value
|
99
107
|
|
100
108
|
if wrapper_method = _unwrapper(value)
|
@@ -94,6 +94,21 @@ class RubyfoxSFSObjectBulkTest < RubyfoxCase
|
|
94
94
|
test "sfsobject" do
|
95
95
|
assert_conversion({ :sfsobject => [Rubyfox::SFSObject.new]}, { :sfsobject => [{}] })
|
96
96
|
end
|
97
|
+
|
98
|
+
test "loads mixed arrays" do
|
99
|
+
object = Rubyfox::SFSObject.from_json('{"mixed": [
|
100
|
+
"foo",
|
101
|
+
true,
|
102
|
+
1.0,
|
103
|
+
{
|
104
|
+
"deep" => ["Föhn", "BÄR"]
|
105
|
+
}
|
106
|
+
]}')
|
107
|
+
expected = {
|
108
|
+
:mixed => ["foo", true, 1.0, {:deep => ["Föhn", "BÄR"]}]
|
109
|
+
}
|
110
|
+
assert_equal expected, Rubyfox::SFSObject::Bulk.to_hash(object)
|
111
|
+
end
|
97
112
|
end
|
98
113
|
|
99
114
|
private
|
metadata
CHANGED
@@ -1,57 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubyfox-sfsobject
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Peter Suschlik
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: rake
|
15
|
-
version_requirements: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - '>='
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
14
|
requirement: !ruby/object:Gem::Requirement
|
21
15
|
requirements:
|
22
|
-
- -
|
16
|
+
- - ">="
|
23
17
|
- !ruby/object:Gem::Version
|
24
18
|
version: '0'
|
19
|
+
name: rake
|
25
20
|
prerelease: false
|
26
21
|
type: :development
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rdoc
|
29
22
|
version_requirements: !ruby/object:Gem::Requirement
|
30
23
|
requirements:
|
31
|
-
- -
|
24
|
+
- - ">="
|
32
25
|
- !ruby/object:Gem::Version
|
33
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
34
28
|
requirement: !ruby/object:Gem::Requirement
|
35
29
|
requirements:
|
36
|
-
- -
|
30
|
+
- - ">="
|
37
31
|
- !ruby/object:Gem::Version
|
38
32
|
version: '0'
|
33
|
+
name: rdoc
|
39
34
|
prerelease: false
|
40
35
|
type: :development
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: minitest
|
43
36
|
version_requirements: !ruby/object:Gem::Requirement
|
44
37
|
requirements:
|
45
|
-
- -
|
38
|
+
- - ">="
|
46
39
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
48
42
|
requirement: !ruby/object:Gem::Requirement
|
49
43
|
requirements:
|
50
|
-
- - ~>
|
44
|
+
- - "~>"
|
51
45
|
- !ruby/object:Gem::Version
|
52
46
|
version: 5.8.0
|
47
|
+
name: minitest
|
53
48
|
prerelease: false
|
54
49
|
type: :development
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 5.8.0
|
55
55
|
description: Map SFSObject into Ruby Hash
|
56
56
|
email:
|
57
57
|
- ps@neopoly.de
|
@@ -59,10 +59,10 @@ executables: []
|
|
59
59
|
extensions: []
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
|
-
- .gitignore
|
63
|
-
- .ruby-env
|
64
|
-
- .ruby-version
|
65
|
-
- .travis.yml
|
62
|
+
- ".gitignore"
|
63
|
+
- ".ruby-env"
|
64
|
+
- ".ruby-version"
|
65
|
+
- ".travis.yml"
|
66
66
|
- Gemfile
|
67
67
|
- LICENSE.txt
|
68
68
|
- README.md
|
@@ -91,17 +91,17 @@ require_paths:
|
|
91
91
|
- lib
|
92
92
|
required_ruby_version: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
98
98
|
requirements:
|
99
|
-
- -
|
99
|
+
- - ">="
|
100
100
|
- !ruby/object:Gem::Version
|
101
101
|
version: '0'
|
102
102
|
requirements: []
|
103
103
|
rubyforge_project:
|
104
|
-
rubygems_version: 2.
|
104
|
+
rubygems_version: 2.6.4
|
105
105
|
signing_key:
|
106
106
|
specification_version: 4
|
107
107
|
summary: ''
|