scaruby 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/scaruby/concurrent.rb +46 -46
- data/lib/scaruby/core_ext/enumerable.rb +1 -1
- data/lib/scaruby/core_ext/hash.rb +1 -1
- data/lib/scaruby/io.rb +62 -62
- data/lib/scaruby/map.rb +141 -141
- data/lib/scaruby/option.rb +46 -38
- data/lib/scaruby/seq.rb +395 -395
- data/lib/scaruby/version.rb +1 -1
- data/lib/scaruby.rb +59 -58
- data/scaruby.gemspec +23 -23
- data/spec/scaruby/converter_spec.rb +27 -27
- data/spec/scaruby/core_ext/enumerable_spec.rb +288 -288
- data/spec/scaruby/core_ext/hash_spec.rb +92 -92
- data/spec/scaruby/io_spec.rb +56 -56
- data/spec/scaruby/map_spec.rb +117 -117
- data/spec/scaruby/option_spec.rb +50 -43
- data/spec/scaruby/seq_spec.rb +301 -301
- data/spec/scaruby_spec.rb +32 -32
- metadata +19 -27
data/spec/scaruby_spec.rb
CHANGED
@@ -1,32 +1,32 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
|
3
|
-
require 'scaruby'
|
4
|
-
|
5
|
-
describe Scaruby do
|
6
|
-
it 'has assert_type' do
|
7
|
-
assert_type(123, Fixnum)
|
8
|
-
assert_type(123, String, Fixnum, Hash)
|
9
|
-
begin
|
10
|
-
assert_type(123, Hash, Array)
|
11
|
-
raise 'Expected exception did not be raised!'
|
12
|
-
rescue AssertionError => e
|
13
|
-
e.message.should eq('The type of `123` should be whichever of [Hash, Array] but actually Fixnum.')
|
14
|
-
end
|
15
|
-
assert_type([1,2,3], Array)
|
16
|
-
assert_type({1=>'a'}, Hash)
|
17
|
-
assert_type(nil, Array)
|
18
|
-
assert_type(nil, Hash)
|
19
|
-
end
|
20
|
-
it 'has assert' do
|
21
|
-
assert('1' != 1)
|
22
|
-
begin
|
23
|
-
assert('1' == 1)
|
24
|
-
raise 'Expected exception did not be raised!'
|
25
|
-
rescue AssertionError => e
|
26
|
-
end
|
27
|
-
end
|
28
|
-
it 'has converter' do
|
29
|
-
[1,2,3].to_scaruby.should_not eq(nil)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
require 'scaruby'
|
4
|
+
|
5
|
+
describe Scaruby do
|
6
|
+
it 'has assert_type' do
|
7
|
+
assert_type(123, Fixnum)
|
8
|
+
assert_type(123, String, Fixnum, Hash)
|
9
|
+
begin
|
10
|
+
assert_type(123, Hash, Array)
|
11
|
+
raise 'Expected exception did not be raised!'
|
12
|
+
rescue AssertionError => e
|
13
|
+
e.message.should eq('The type of `123` should be whichever of [Hash, Array] but actually Fixnum.')
|
14
|
+
end
|
15
|
+
assert_type([1, 2, 3], Array)
|
16
|
+
assert_type({1 => 'a'}, Hash)
|
17
|
+
assert_type(nil, Array)
|
18
|
+
assert_type(nil, Hash)
|
19
|
+
end
|
20
|
+
it 'has assert' do
|
21
|
+
assert('1' != 1)
|
22
|
+
begin
|
23
|
+
assert('1' == 1)
|
24
|
+
raise 'Expected exception did not be raised!'
|
25
|
+
rescue AssertionError => e
|
26
|
+
end
|
27
|
+
end
|
28
|
+
it 'has converter' do
|
29
|
+
[1, 2, 3].to_scaruby.should_not eq(nil)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
metadata
CHANGED
@@ -1,28 +1,23 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: scaruby
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.6
|
4
5
|
prerelease:
|
5
|
-
version: 0.0.5
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Kazuhiro Sera
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
date: 2012-03-06 00:00:00 Z
|
12
|
+
date: 2012-04-06 00:00:00.000000000 Z
|
14
13
|
dependencies: []
|
15
|
-
|
16
14
|
description: Scala API in Ruby
|
17
|
-
email:
|
15
|
+
email:
|
18
16
|
- seratch@gmail.com
|
19
17
|
executables: []
|
20
|
-
|
21
18
|
extensions: []
|
22
|
-
|
23
19
|
extra_rdoc_files: []
|
24
|
-
|
25
|
-
files:
|
20
|
+
files:
|
26
21
|
- .gitignore
|
27
22
|
- .travis.yml
|
28
23
|
- Gemfile
|
@@ -54,32 +49,29 @@ files:
|
|
54
49
|
- spec/scaruby_spec.rb
|
55
50
|
homepage: https://github.com/seratch/scaruby
|
56
51
|
licenses: []
|
57
|
-
|
58
52
|
post_install_message:
|
59
53
|
rdoc_options: []
|
60
|
-
|
61
|
-
require_paths:
|
54
|
+
require_paths:
|
62
55
|
- lib
|
63
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
56
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
64
57
|
none: false
|
65
|
-
requirements:
|
66
|
-
- -
|
67
|
-
- !ruby/object:Gem::Version
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
68
61
|
version: 1.9.2
|
69
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
62
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
63
|
none: false
|
71
|
-
requirements:
|
72
|
-
- -
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
version:
|
64
|
+
requirements:
|
65
|
+
- - ! '>='
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
75
68
|
requirements: []
|
76
|
-
|
77
69
|
rubyforge_project: scaruby
|
78
|
-
rubygems_version: 1.8.
|
70
|
+
rubygems_version: 1.8.17
|
79
71
|
signing_key:
|
80
72
|
specification_version: 3
|
81
73
|
summary: Scala API in Ruby
|
82
|
-
test_files:
|
74
|
+
test_files:
|
83
75
|
- spec/scaruby/concurrent_spec.rb
|
84
76
|
- spec/scaruby/converter_spec.rb
|
85
77
|
- spec/scaruby/core_ext/enumerable_spec.rb
|