taipu 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -2
- data/{LICENSE.mv → LICENSE.md} +0 -0
- data/README.md +21 -6
- data/VERSION.semver +1 -1
- data/lib/taipu.rb +4 -3
- data/lib/taipu/base.rb +0 -4
- data/lib/taipu/number.rb +2 -8
- data/lib/taipu/string.rb +3 -9
- data/taipu.gemspec +10 -9
- metadata +17 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 705e5d57b69d89d6c094af24c0bee0e84e4daae8
|
4
|
+
data.tar.gz: 8f5f0ccee8368f81fee5aa49e66b8baa088ad3fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c7f8a9082a8ab6721d592c8c8adf09b1a769b199078815cdaa4c35ff70144a9fd33eb6f79e6c8a2cf4ba11eedb2ac8c991ee912ef464296a41fce180d2921eb
|
7
|
+
data.tar.gz: 62352199ef97fd14e28e0f1bece8d63f5782bd545b5ac33d9325f98590a0054826f350a7595ca3b56cbbdf3b329633e54bc68def576967b36e8078821d5e1d99
|
data/.travis.yml
CHANGED
data/{LICENSE.mv → LICENSE.md}
RENAMED
File without changes
|
data/README.md
CHANGED
@@ -1,12 +1,11 @@
|
|
1
1
|
# Taipu
|
2
2
|
|
3
|
-
[![Build Status](https://travis-ci.org/cyril/taipu.rb.svg?branch=master)]
|
4
|
-
[![
|
5
|
-
[![
|
6
|
-
[![
|
7
|
-
[![Documentation](http://img.shields.io/:yard-docs-38c800.svg)](http://rubydoc.info/gems/taipu/frames)
|
3
|
+
[![Build Status](https://travis-ci.org/cyril/taipu.rb.svg?branch=master)][travis]
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/taipu.svg)][gem]
|
5
|
+
[![Inline docs](http://inch-ci.org/github/cyril/taipu.rb.svg?branch=master)][inchpages]
|
6
|
+
[![Documentation](http://img.shields.io/:yard-docs-38c800.svg)][rubydoc]
|
8
7
|
|
9
|
-
>
|
8
|
+
> Collections of types for Ruby.
|
10
9
|
|
11
10
|
## Contact
|
12
11
|
|
@@ -36,6 +35,13 @@ Or install it yourself as:
|
|
36
35
|
|
37
36
|
$ gem install taipu
|
38
37
|
|
38
|
+
## Usage
|
39
|
+
|
40
|
+
```ruby
|
41
|
+
type = Taipu::Number.new(min: 42)
|
42
|
+
type.to_h # => { min: 42, max: nil, type: :number }
|
43
|
+
```
|
44
|
+
|
39
45
|
## Versioning
|
40
46
|
|
41
47
|
__Taipu__ follows [Semantic Versioning 2.0](http://semver.org/).
|
@@ -47,3 +53,12 @@ __Taipu__ follows [Semantic Versioning 2.0](http://semver.org/).
|
|
47
53
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
48
54
|
4. Push to the branch (`git push origin my-new-feature`)
|
49
55
|
5. Create a new Pull Request
|
56
|
+
|
57
|
+
## License
|
58
|
+
|
59
|
+
See `LICENSE.md` file.
|
60
|
+
|
61
|
+
[gem]: https://rubygems.org/gems/taipu
|
62
|
+
[travis]: https://travis-ci.org/cyril/taipu.rb
|
63
|
+
[inchpages]: http://inch-ci.org/github/cyril/taipu.rb/
|
64
|
+
[rubydoc]: http://rubydoc.info/gems/taipu/frames
|
data/VERSION.semver
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.3
|
data/lib/taipu.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# Namespace for the Taipu library.
|
2
|
+
module Taipu
|
3
3
|
end
|
4
4
|
|
5
|
-
|
5
|
+
Dir[File.join File.dirname(__FILE__), 'taipu', '*.rb'].each do |filename|
|
6
|
+
require_relative filename
|
6
7
|
end
|
data/lib/taipu/base.rb
CHANGED
data/lib/taipu/number.rb
CHANGED
@@ -4,17 +4,11 @@ require_relative 'base'
|
|
4
4
|
module Taipu
|
5
5
|
# The type number.
|
6
6
|
class Number < Base
|
7
|
-
def initialize(
|
8
|
-
|
9
|
-
|
10
|
-
if !min.nil? && !max.nil?
|
11
|
-
fail 'MinIsGreaterThanMaxError' if min > max
|
12
|
-
end
|
7
|
+
def initialize(min: nil, max: nil)
|
8
|
+
fail 'MinIsGreaterThanMaxError' if !min.nil? && !max.nil? && min > max
|
13
9
|
|
14
10
|
@min = min
|
15
11
|
@max = max
|
16
|
-
|
17
|
-
freeze
|
18
12
|
end
|
19
13
|
|
20
14
|
def constraints
|
data/lib/taipu/string.rb
CHANGED
@@ -4,19 +4,13 @@ require_relative 'base'
|
|
4
4
|
module Taipu
|
5
5
|
# The type string.
|
6
6
|
class String < Base
|
7
|
-
def initialize(
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
if !minlen.nil? && !maxlen.nil?
|
12
|
-
fail 'MinlenIsLongerThanMaxlenError' if minlen > maxlen
|
13
|
-
end
|
7
|
+
def initialize(minlen: nil, maxlen: nil, pattern: nil)
|
8
|
+
fail 'MinlenIsLongerThanMaxlenError' if !minlen.nil? && !maxlen.nil? &&
|
9
|
+
minlen > maxlen
|
14
10
|
|
15
11
|
@minlen = minlen
|
16
12
|
@maxlen = maxlen
|
17
13
|
@pattern = pattern
|
18
|
-
|
19
|
-
freeze
|
20
14
|
end
|
21
15
|
|
22
16
|
def constraints
|
data/taipu.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = 'taipu'
|
3
|
-
spec.version = File.read('VERSION.semver')
|
3
|
+
spec.version = File.read('VERSION.semver').chomp
|
4
4
|
spec.authors = ['Cyril Wack']
|
5
5
|
spec.email = ['contact@cyril.email']
|
6
6
|
|
@@ -9,14 +9,15 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.homepage = 'https://github.com/cyril/taipu.rb'
|
10
10
|
spec.license = 'MIT'
|
11
11
|
|
12
|
-
spec.files
|
13
|
-
|
12
|
+
spec.files =
|
13
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^test/}) }
|
14
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
14
15
|
spec.require_paths = ['lib']
|
15
16
|
|
16
|
-
spec.add_development_dependency 'bundler', '~> 1.
|
17
|
-
spec.add_development_dependency 'rake', '~> 10.
|
18
|
-
spec.add_development_dependency 'yard', '~> 0.8'
|
19
|
-
spec.add_development_dependency 'simplecov', '~> 0.
|
20
|
-
spec.add_development_dependency 'rubocop', '~> 0.
|
21
|
-
spec.add_development_dependency '
|
17
|
+
spec.add_development_dependency 'bundler', '~> 1.10.6'
|
18
|
+
spec.add_development_dependency 'rake', '~> 10.4.2'
|
19
|
+
spec.add_development_dependency 'yard', '~> 0.8.7.6'
|
20
|
+
spec.add_development_dependency 'simplecov', '~> 0.10.0'
|
21
|
+
spec.add_development_dependency 'rubocop', '~> 0.33.0'
|
22
|
+
spec.add_development_dependency 'spectus', '~> 2.1.3'
|
22
23
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: taipu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cyril Wack
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,84 +16,84 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 1.10.6
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 1.10.6
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 10.4.2
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 10.4.2
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: yard
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 0.8.7.6
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 0.8.7.6
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: simplecov
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.
|
61
|
+
version: 0.10.0
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.
|
68
|
+
version: 0.10.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rubocop
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 0.33.0
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: 0.33.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: spectus
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: 2.1.3
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: 2.1.3
|
97
97
|
description: Collections of types for Ruby.
|
98
98
|
email:
|
99
99
|
- contact@cyril.email
|
@@ -106,7 +106,7 @@ files:
|
|
106
106
|
- ".yardopts"
|
107
107
|
- CODE_OF_CONDUCT.md
|
108
108
|
- Gemfile
|
109
|
-
- LICENSE.
|
109
|
+
- LICENSE.md
|
110
110
|
- README.md
|
111
111
|
- Rakefile
|
112
112
|
- VERSION.semver
|
@@ -141,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
141
|
version: '0'
|
142
142
|
requirements: []
|
143
143
|
rubyforge_project:
|
144
|
-
rubygems_version: 2.4.5
|
144
|
+
rubygems_version: 2.4.5.1
|
145
145
|
signing_key:
|
146
146
|
specification_version: 4
|
147
147
|
summary: Collections of types.
|