monban-params 0.1.1

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: c8abcd33bca15777c0c1ec3cdde9b9d3d2d0b99c122f4897f619180ab63705ff
4
+ data.tar.gz: 6830e704b832c28c55c7221b995f93aa9d0251798235965638607246c020d8ce
5
+ SHA512:
6
+ metadata.gz: 862c0e0dce51a17889976d42c6619df8f8ff30bfc10d0894521de96dc2d272bd88ce2c6d72889a00206a0d61e214c1c4361d1e6903514937c8060ab067c8cb41
7
+ data.tar.gz: 92e4dd178e860d2a5c7e0562ca8eb4cd927617865cbd5823243a989524573454790dc2ac6ad6886a965a777ae040b44b3c6ca22df728357111ff4e666c7f604f
data/.envrc ADDED
@@ -0,0 +1,8 @@
1
+ export APP_ROOT=$(pwd)
2
+
3
+ export DOCKER_WRAPPER_IMAGE_ruby=2.5.1
4
+
5
+ export GIT_RELEASE_VERSION_FILE=lib/monban/params/version.rb
6
+ export GIT_RELEASE_REQUEST_TARGET=release
7
+
8
+ export BUNDLE_PATH=$APP_ROOT/vendor/bundle
@@ -0,0 +1,7 @@
1
+ git_release_request_dump_version_local(){
2
+ bundle
3
+ git add Gemfile.lock
4
+ }
5
+ git_release_request_after_tag(){
6
+ git push github master --tags
7
+ }
data/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ /vendor/
10
+ /.vscode/
data/.gitlab-ci.yml ADDED
@@ -0,0 +1,20 @@
1
+ image: ruby:2.5.1
2
+
3
+ cache:
4
+ paths:
5
+ - vendor/
6
+
7
+ test:
8
+ except:
9
+ - tags
10
+ - master
11
+ - release
12
+ script:
13
+ - bundle
14
+ - bundle exec rake
15
+
16
+ release:
17
+ only:
18
+ - release@monban/rubygems-params
19
+ script:
20
+ - ./bin/push_tags.sh
data/.release-version ADDED
@@ -0,0 +1 @@
1
+ 0.1.1
data/.travis.yml ADDED
@@ -0,0 +1,16 @@
1
+ sudo: false
2
+ language: ruby
3
+ cache: bundler
4
+ rvm:
5
+ - 2.5.1
6
+ before_install: gem install bundler -v 1.16.2
7
+ notifications:
8
+ slack:
9
+ secure: "mGQbIr0NYMp8nm+WmwXL4vt5l9KH7ykPdvYc4Ak2imimjtU6hUyk14d96xPclkoP1vW18pTu9+F9uVJUeV04AVGCPPFqyKtwGVTmNbKOWkCbESmRVD6B3Cxq/BOrNZJX61z45WIXyT2Exw2e5O7MG9Zk0rmWiLBZXl/K3bn+l5AIrMcavX6obLsdga2RVlM6o4AoecWAxYqXRGog+bcOSEK1k4mQbtSw/RlN76QVPA7nCqLe+wSilNvLBBFms+PdiWdHoTjx8Ks8WDRePUGhO062t5i7qZlcAkCPx0CI39C3CK2TK/2+UfqHh5EFpYARGmQ6csvP84ACexGB87enXtIaYd1GB8BTc25vwifMZydYn6+dYHzmYgnSyVu3UIr4GOgoCNpnDdFad4Xw9zDNDCQwNxQzJb6TKp0L37hAptVn2agix8J/Zx0yPRezzwFycREDK63S5UhF8md3E7WLQH9LaBN2NxBcku1VnKVOJ5PrQ4ckuEqUXWkfH0ntmFGD0y2uvt9mzkT7FkGIlsLenMgNuDS3eULWhi60AVibZJpSzedOfoVpWSYpG2FFg63oXNIjN3Pf6eI7eKo3K1QEbuBWmwk7+NUTlxBR8kcOf5YhW1rFqIDk5e0IGCxN0HD7dP9f19ZyrYPJzOZm7MwkFDFZ5cIUaBiahjBa9YkdU0M="
10
+ deploy:
11
+ provider: rubygems
12
+ gem: monban-params
13
+ on:
14
+ tags: true
15
+ api_key:
16
+ secure: "VawH3q5TruOWK8+8e4GgUP3HO0mRY/wfzzIsbhww7rtfNoTbH/wBnHwvB07/bqzdSmE3oROCUMcLULofe/72zwH+jJQMWG8DIXqfLw71mCxf9I2KhL6Z+lAkrvWJaYs9z00mStay2YeQ/tsVVPgEYOmWZq8+VTybTpz4QthNO39P1wZ0LQSgb5+0+nE6fpbvBUfr9hNYVzEkAi6WHyUNTfjxwKIZlD4wWbxvD1wi90MrwxZ+l6/8cA6+sDMVaL6/wTHmZPKivICT4DjtDq+d/wxAFlEBL0RY4lSPtFnj8zQzaeuykHzTnS/r2QpnZrOmuxHIKuyrQBMVAtFVMOnVVyevgBkUwIs9Ou4+UYAt1lIcRjK+cBq8KqvdxFx95E8nNvmMqcRBvBejSBIx9YZQOeCNwsf2pV6PQQMKxaz17Lh+tSPIb4Wc3uuxiK/rnuw2JHMUuTwbFEemEAy5FVu1yo0kSvVvRIydu/ob1u1sJKM4Deoa069N8m+vE/9EZl6ItYz3hunlI1klFTYyjM1XumblTfli9KIFflJgaeTEaGaP76T7OtWpTdE2dDMmDDsDG/OxRfwkISlGLMwFktHbDCHVlh3V3C5WKGVOyVKyFnQbUbpwCrqkYp73P7g54nlxNQXb/QCupF5FfzSYtXlIiBSKHbLzY4DLJEwUxR1S4ss="
data/CHANGELOG.md ADDED
@@ -0,0 +1,60 @@
1
+ # Version : 0.1.1
2
+
3
+ fix: travis
4
+
5
+ # Version : 0.1.0
6
+
7
+ fix: validation
8
+
9
+ # Version : 1.3.1
10
+
11
+ fix: gitlab-ci
12
+
13
+ # Version : 1.3.0
14
+
15
+ add: converter
16
+
17
+ # Version : 1.2.0
18
+
19
+ add: not_nil
20
+
21
+ # Version : 1.1.2
22
+
23
+ fix: gitlab-ci
24
+
25
+ # Version : 1.1.1
26
+
27
+ fix: gitlab-ci
28
+
29
+ # Version : 1.1.0
30
+
31
+ add: match_date
32
+
33
+ # Version : 1.0.3
34
+
35
+ patch version
36
+
37
+ # Version : 1.0.2
38
+
39
+ patch version
40
+
41
+ # Version : 1.0.1
42
+
43
+ fix: metadata
44
+
45
+ # Version : 1.0.0
46
+
47
+ version 1.0.0
48
+
49
+ # Version : 0.4.0
50
+
51
+ test: deploy by travisci
52
+
53
+ # Version : 0.3.0
54
+
55
+ test: deploy by travisci
56
+
57
+ # Version : 0.2.0
58
+
59
+ test: publish by travisci
60
+
@@ -0,0 +1,56 @@
1
+ # Version : 0.1.0
2
+
3
+ fix: validation
4
+
5
+ ## commits
6
+
7
+ * fix: raise error if validation failed
8
+ * fix: getto -> monban
9
+ * fix: ignore
10
+ * version dump : 1.3.1
11
+ * fix: push_tags
12
+ * version dump : 1.3.0
13
+ * fix: readme
14
+ * fix: readme
15
+ * fix: readme
16
+ * fix: readme
17
+ * fix: readme
18
+ * add: converter
19
+ * fix: readme
20
+ * version dump : 1.2.0
21
+ * add: not_nil
22
+ * version dump : 1.1.2
23
+ * fix: push_tags
24
+ * version dump : 1.1.1
25
+ * fix: gitlab-ci
26
+ * version dump : 1.1.0
27
+ * fix: .envrc
28
+ * fix: gitlab-ci
29
+ * add: match_date
30
+ * version dump : 1.0.3
31
+ * patch version up
32
+ * patch version
33
+ * fix: travis
34
+ * version dump : 1.0.2
35
+ * patch version up
36
+ * patch version
37
+ * fix: travis
38
+ * version dump : 1.0.1
39
+ * patch version up
40
+ * patch version
41
+ * fix: metadata
42
+ * fix: README
43
+ * fix: README
44
+ * fix: description
45
+ * version dump : 1.0.0
46
+ * major version up
47
+ * version up
48
+ * version dump : 0.4.0
49
+ * fix: travisci api_key
50
+ * version dump : 0.3.0
51
+ * version dump : 0.2.0
52
+ * fix: README
53
+ * fix: README
54
+ * fix: README
55
+ * init: gem
56
+ * Initial commit
@@ -0,0 +1,8 @@
1
+ # Version : 0.1.1
2
+
3
+ fix: travis
4
+
5
+ ## commits
6
+
7
+ * fix: travis.yml
8
+ * fix: gitlab-ci
@@ -0,0 +1,9 @@
1
+ # Version : 0.2.0
2
+
3
+ test: publish by travisci
4
+
5
+ ## commits
6
+
7
+ * fix: README
8
+ * fix: README
9
+ * fix: README
@@ -0,0 +1,6 @@
1
+ # Version : 0.3.0
2
+
3
+ test: deploy by travisci
4
+
5
+ ## commits
6
+
@@ -0,0 +1,7 @@
1
+ # Version : 0.4.0
2
+
3
+ test: deploy by travisci
4
+
5
+ ## commits
6
+
7
+ * fix: travisci api_key
@@ -0,0 +1,8 @@
1
+ # Version : 1.0.0
2
+
3
+ version 1.0.0
4
+
5
+ ## commits
6
+
7
+ * major version up
8
+ * version up
@@ -0,0 +1,12 @@
1
+ # Version : 1.0.1
2
+
3
+ fix: metadata
4
+
5
+ ## commits
6
+
7
+ * patch version up
8
+ * patch version
9
+ * fix: metadata
10
+ * fix: README
11
+ * fix: README
12
+ * fix: description
@@ -0,0 +1,9 @@
1
+ # Version : 1.0.2
2
+
3
+ patch version
4
+
5
+ ## commits
6
+
7
+ * patch version up
8
+ * patch version
9
+ * fix: travis
@@ -0,0 +1,9 @@
1
+ # Version : 1.0.3
2
+
3
+ patch version
4
+
5
+ ## commits
6
+
7
+ * patch version up
8
+ * patch version
9
+ * fix: travis
@@ -0,0 +1,9 @@
1
+ # Version : 1.1.0
2
+
3
+ add: match_date
4
+
5
+ ## commits
6
+
7
+ * fix: .envrc
8
+ * fix: gitlab-ci
9
+ * add: match_date
@@ -0,0 +1,11 @@
1
+ # Version : 1.1.1
2
+
3
+ fix: gitlab-ci
4
+
5
+ ## commits
6
+
7
+ * fix: gitlab-ci
8
+ * version dump : 1.1.0
9
+ * fix: .envrc
10
+ * fix: gitlab-ci
11
+ * add: match_date
@@ -0,0 +1,7 @@
1
+ # Version : 1.1.2
2
+
3
+ fix: gitlab-ci
4
+
5
+ ## commits
6
+
7
+ * fix: push_tags
@@ -0,0 +1,7 @@
1
+ # Version : 1.2.0
2
+
3
+ add: not_nil
4
+
5
+ ## commits
6
+
7
+ * add: not_nil
@@ -0,0 +1,13 @@
1
+ # Version : 1.3.0
2
+
3
+ add: converter
4
+
5
+ ## commits
6
+
7
+ * fix: readme
8
+ * fix: readme
9
+ * fix: readme
10
+ * fix: readme
11
+ * fix: readme
12
+ * add: converter
13
+ * fix: readme
@@ -0,0 +1,7 @@
1
+ # Version : 1.3.1
2
+
3
+ fix: gitlab-ci
4
+
5
+ ## commits
6
+
7
+ * fix: push_tags
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in monban-params.gemspec
6
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,30 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ monban-params (0.1.1)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ docile (1.3.1)
10
+ json (2.1.0)
11
+ minitest (5.11.3)
12
+ rake (10.5.0)
13
+ simplecov (0.16.1)
14
+ docile (~> 1.1)
15
+ json (>= 1.8, < 3)
16
+ simplecov-html (~> 0.10.0)
17
+ simplecov-html (0.10.2)
18
+
19
+ PLATFORMS
20
+ ruby
21
+
22
+ DEPENDENCIES
23
+ bundler (~> 1.16)
24
+ minitest (~> 5.0)
25
+ monban-params!
26
+ rake (~> 10.0)
27
+ simplecov (~> 0.16)
28
+
29
+ BUNDLED WITH
30
+ 1.16.6
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 shun@getto.systems
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,149 @@
1
+ # monban-params
2
+
3
+ [rubygems: monban-params](https://rubygems.org/gems/monban-params)
4
+
5
+ Validate parameters like strong-parameters(rails)
6
+
7
+ ```ruby
8
+ require "monban/params"
9
+
10
+ Monban::Params.new.validate(params) do |v|
11
+ v.hash(
12
+ "name" => v.combine([v.string, v.not_empty]),
13
+ "token" => v.combine([v.string, v.allow_empty(v.length(5))]),
14
+ "int" => v.integer,
15
+ "bool" => v.bool,
16
+ "key" => v.equal("KEY"),
17
+ "string" => v.in(["param1","param2"]),
18
+ "tel" => v.combine([v.string, v.match(%r{\A[0-9]+([0-9-]*)\Z})]),
19
+ "date" => v.combine([v.string, v.match_date]),
20
+ "number" => v.combine([v.string, v.match_integer]),
21
+ "bool" => v.combine([v.string, v.match_bool]),
22
+ "data" => v.not_nil,
23
+ "hash" => v.hash_strict(
24
+ "array" => v.array(v.string),
25
+ "keys" => v.array_include(["key1","key2","key3"]),
26
+ ),
27
+ )
28
+ end
29
+ # => raise Monban::Params::Error if validation failed
30
+ ```
31
+
32
+
33
+ ###### Table of Contents
34
+
35
+ - [Requirements](#Requirements)
36
+ - [Usage](#Usage)
37
+ - [License](#License)
38
+
39
+ <a id="Requirements"></a>
40
+ ## Requirements
41
+
42
+ - developed on ruby: 2.5.1
43
+
44
+
45
+ <a id="Usage"></a>
46
+ ## Usage
47
+
48
+ ```ruby
49
+ require "monban/params"
50
+
51
+ Monban::Params.new.validate(params) do |v|
52
+ # argument `params` should be hash
53
+ v.hash(
54
+ # "key" should be String
55
+ "key" => v.string,
56
+
57
+ # "key" should be Integer
58
+ "key" => v.integer,
59
+
60
+ # "key" should be Boolean
61
+ "key" => v.bool,
62
+
63
+
64
+ # "key" should not be empty
65
+ "key" => v.not_empty,
66
+
67
+ # validate not_nil
68
+ "key" => v.not_nil,
69
+
70
+
71
+ # "key" should be equal to "value"
72
+ "key" => v.equal("value"),
73
+
74
+ # "key" should be equal to "value1" or "value2"
75
+ "key" => v.in(["value1","value2"]),
76
+
77
+ # "key" length should be 10,
78
+ "key" => v.length(10),
79
+
80
+
81
+ # "key" should match %r{example}
82
+ "key" => v.match(%r{example}),
83
+
84
+ # "key" should match integer (value is string, but seem to be a Integer)
85
+ "key" => v.match_integer,
86
+
87
+ # "key" downcase should be equal to "true" or "false"
88
+ "key" => v.match_bool,
89
+
90
+ # "key" should match date
91
+ "key" => v.match_date,
92
+
93
+
94
+ # "key" should be hash includes :key that value should be string
95
+ "key" => v.hash(
96
+ key: v.string,
97
+ ),
98
+
99
+ # "key" should be hash only includes :key that value should be string
100
+ "key" => v.hash_strict(
101
+ key: v.string,
102
+ ),
103
+
104
+
105
+ # "key" should be array that has string value
106
+ "key" => v.array(v.string),
107
+
108
+ # "key" should be array that has "value1" or "value2"
109
+ "key" => v.array_include(["value1","value2"])
110
+
111
+
112
+ # "key" should be match integer if value is not empty
113
+ "key" => v.allow_empty(v.match_integer),
114
+
115
+ # "key" validate string and not_empty
116
+ "key" => v.combine([v.string, v.not_empty]),
117
+ )
118
+ end
119
+ # => raise Monban::Params::Error if validation failed
120
+ ```
121
+
122
+
123
+ ## Install
124
+
125
+ Add this line to your application's Gemfile:
126
+
127
+ ```ruby
128
+ gem 'monban-params'
129
+ ```
130
+
131
+ And then execute:
132
+
133
+ ```
134
+ $ bundle
135
+ ```
136
+
137
+ Or install it yourself as:
138
+
139
+ ```
140
+ $ gem install monban-params
141
+ ```
142
+
143
+
144
+ <a id="License"></a>
145
+ ## License
146
+
147
+ monban/params is licensed under the [MIT](LICENSE) license.
148
+
149
+ Copyright &copy; since 2018 shun@getto.systems
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << "test"
6
+ t.libs << "lib"
7
+ t.test_files = FileList["test/**/*_test.rb"]
8
+ end
9
+
10
+ task :default => :test
data/bin/push_tags.sh ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+
3
+ git remote add super https://gett-systems:$GITLAB_ACCESS_TOKEN@gitlab.com/monban/rubygems-params.git
4
+ git remote add backup https://getto-systems:$GITHUB_ACCESS_TOKEN@github.com/getto-systems/rubygems-monban-params.git
5
+ git tag $(cat .release-version)
6
+ git push super HEAD:master --tags
7
+ git push backup HEAD:master --tags
@@ -0,0 +1,129 @@
1
+ require "date"
2
+
3
+ module Monban
4
+ class Params
5
+ class Error < RuntimeError; end
6
+
7
+ def initialize(factory=Validator::Factory.new)
8
+ @factory = factory
9
+ end
10
+
11
+ def validate(params)
12
+ yield(@factory).call(:params, params)
13
+ end
14
+
15
+ class Validator
16
+ def initialize(func,&message)
17
+ @func = func
18
+ @message = message
19
+ end
20
+
21
+ def call(key,value)
22
+ @func.call(key,value) or raise Monban::Params::Error, "#{key} #{@message && @message.call} : [#{value}]"
23
+ end
24
+
25
+ class Factory
26
+ def integer
27
+ Validator.new(->(key,value){ value.is_a? Integer }){"must be integer"}
28
+ end
29
+
30
+ def string
31
+ Validator.new(->(key,value){ value.is_a? String }){"must be string"}
32
+ end
33
+
34
+ def bool
35
+ Validator.new(->(key,value){ value == true || value == false }){"must be boolean"}
36
+ end
37
+
38
+
39
+ def equal(val)
40
+ Validator.new(->(key,value){ value == val }){"must equal #{val}"}
41
+ end
42
+
43
+ def in(values)
44
+ Validator.new(->(key,value){ values.include?(value) }){"must be in [#{values}]"}
45
+ end
46
+
47
+ def not_empty
48
+ Validator.new(->(key,value){ !value.respond_to?(:empty?) || !value.empty? }){"must not be empty"}
49
+ end
50
+
51
+ def not_nil
52
+ Validator.new(->(key,value){ not value.nil? }){"must not be nil"}
53
+ end
54
+
55
+ def length(length)
56
+ Validator.new(->(key,value){ value && value.length == length }){"'s length must equal #{length}"}
57
+ end
58
+
59
+ def match(pattern)
60
+ Validator.new(->(key,value){ value && value.match?(pattern) }){"must match #{pattern}"}
61
+ end
62
+
63
+ def match_integer
64
+ Validator.new(->(key,value){ value && value.to_i.to_s == value }){"must match integer pattern"}
65
+ end
66
+
67
+ def match_bool
68
+ Validator.new(->(key,value){ value && ["true","false"].include?(value.to_s.downcase) }){"must match boolean pattern"}
69
+ end
70
+
71
+ def match_date
72
+ Validator.new(->(key,value){
73
+ begin
74
+ value && Date.parse(value)
75
+ rescue ArgumentError
76
+ false
77
+ end
78
+ }){"must match date pattern"}
79
+ end
80
+
81
+
82
+ def hash(spec)
83
+ Validator.new(->(key,value){
84
+ value && spec.all?{|key,validator|
85
+ value.has_key?(key) && validator.call(key, value[key])
86
+ }
87
+ }){"must satisfy hash spec"}
88
+ end
89
+
90
+ def hash_strict(spec)
91
+ Validator.new(->(key,value){
92
+ validators = spec.dup
93
+ value && value.all?{|key,val|
94
+ validators.delete(key).tap{|validator|
95
+ break validator ? validator.call(key,val) : false
96
+ }
97
+ } && validators.empty?
98
+ }){"must satisfy hash spec"}
99
+ end
100
+
101
+
102
+ def array(validator)
103
+ Validator.new(->(key,value){
104
+ value && value.is_a?(Array) && value.all?{|val| validator.call(key,val)}
105
+ }){"must satisfy array spec"}
106
+ end
107
+
108
+ def array_include(values,&block)
109
+ Validator.new(->(key,value){
110
+ value && value.is_a?(Array) && value.all?{|val| values.include?(val)}
111
+ }){"'s value must be in #{values}"}
112
+ end
113
+
114
+
115
+ def combine(validators)
116
+ Validator.new(->(key,value){
117
+ validators.all?{|validator| validator.call(key,value)}
118
+ })
119
+ end
120
+
121
+ def allow_empty(validator)
122
+ Validator.new(->(key,value){
123
+ (value.respond_to?(:empty?) && value.empty?) or validator.call(key,value)
124
+ })
125
+ end
126
+ end
127
+ end
128
+ end
129
+ end
@@ -0,0 +1,5 @@
1
+ module Monban
2
+ class Params
3
+ VERSION = "0.1.1"
4
+ end
5
+ end
@@ -0,0 +1,35 @@
1
+ lib = File.expand_path("../lib", __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require "monban/params/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.required_ruby_version = ">= 2.5.1"
7
+
8
+ spec.name = "monban-params"
9
+ spec.version = Monban::Params::VERSION
10
+ spec.authors = ["shun@getto.systems"]
11
+ spec.email = ["shun@getto.systems"]
12
+
13
+ spec.summary = %q{validation and format params}
14
+ spec.description = %q{Validate parameters like strong-parameters(rails), and parameter formatter for search api}
15
+ spec.homepage = "https://github.com/getto-systems/rubygems-monban-params"
16
+ spec.license = "MIT"
17
+
18
+ # Specify which files should be added to the gem when it is released.
19
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
20
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
21
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
22
+ end
23
+ spec.bindir = "exe"
24
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
25
+ spec.require_paths = ["lib"]
26
+
27
+
28
+ spec.extra_rdoc_files = ['README.md', 'LICENSE']
29
+ spec.rdoc_options = %w[--title Monban::Params --main README.md]
30
+
31
+ spec.add_development_dependency "bundler", "~> 1.16"
32
+ spec.add_development_dependency "rake", "~> 10.0"
33
+ spec.add_development_dependency "minitest", "~> 5.0"
34
+ spec.add_development_dependency "simplecov", "~> 0.16"
35
+ end
metadata ADDED
@@ -0,0 +1,138 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: monban-params
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - shun@getto.systems
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2018-11-25 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.16'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.16'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: minitest
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '5.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '5.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: simplecov
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.16'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.16'
69
+ description: Validate parameters like strong-parameters(rails), and parameter formatter
70
+ for search api
71
+ email:
72
+ - shun@getto.systems
73
+ executables: []
74
+ extensions: []
75
+ extra_rdoc_files:
76
+ - README.md
77
+ - LICENSE
78
+ files:
79
+ - ".envrc"
80
+ - ".git_release_request.rc.sh"
81
+ - ".gitignore"
82
+ - ".gitlab-ci.yml"
83
+ - ".release-version"
84
+ - ".travis.yml"
85
+ - CHANGELOG.md
86
+ - CHANGELOG/0.1.0.md
87
+ - CHANGELOG/0.1.1.md
88
+ - CHANGELOG/0.2.0.md
89
+ - CHANGELOG/0.3.0.md
90
+ - CHANGELOG/0.4.0.md
91
+ - CHANGELOG/1.0.0.md
92
+ - CHANGELOG/1.0.1.md
93
+ - CHANGELOG/1.0.2.md
94
+ - CHANGELOG/1.0.3.md
95
+ - CHANGELOG/1.1.0.md
96
+ - CHANGELOG/1.1.1.md
97
+ - CHANGELOG/1.1.2.md
98
+ - CHANGELOG/1.2.0.md
99
+ - CHANGELOG/1.3.0.md
100
+ - CHANGELOG/1.3.1.md
101
+ - Gemfile
102
+ - Gemfile.lock
103
+ - LICENSE
104
+ - README.md
105
+ - Rakefile
106
+ - bin/push_tags.sh
107
+ - lib/monban/params.rb
108
+ - lib/monban/params/version.rb
109
+ - monban-params.gemspec
110
+ homepage: https://github.com/getto-systems/rubygems-monban-params
111
+ licenses:
112
+ - MIT
113
+ metadata: {}
114
+ post_install_message:
115
+ rdoc_options:
116
+ - "--title"
117
+ - Monban::Params
118
+ - "--main"
119
+ - README.md
120
+ require_paths:
121
+ - lib
122
+ required_ruby_version: !ruby/object:Gem::Requirement
123
+ requirements:
124
+ - - ">="
125
+ - !ruby/object:Gem::Version
126
+ version: 2.5.1
127
+ required_rubygems_version: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ requirements: []
133
+ rubyforge_project:
134
+ rubygems_version: 2.7.8
135
+ signing_key:
136
+ specification_version: 4
137
+ summary: validation and format params
138
+ test_files: []