getto-repository 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 8ab1653a185159e2d9e9d61d7125455ccd65aa5e2191fcd1bc5631f26e2ac2e3
4
+ data.tar.gz: 2eccfbf3649e06ad603e2b619e53d2ba6d0402c18b9a65dd744d0b6adb1af323
5
+ SHA512:
6
+ metadata.gz: 4f8347eb5054c1e001595490cdb106c6c888e2c5192de08c203ace4aef3261ab9df49131765504b722390dd3e93de00f01c32555cbd0c3438d4d392406a980fa
7
+ data.tar.gz: cfc23c6e820d3d72169acf5d858f83f0dc684c05ddddfb6b3a612e284d273b6e598829c7273f7254b532aade47521022d5281171029de2cef515daf6cad5eef8
data/.envrc ADDED
@@ -0,0 +1,5 @@
1
+ export APP_ROOT=$(pwd)
2
+
3
+ export DOCKER_WRAPPER_IMAGE_ruby=2.5.1
4
+
5
+ export GIT_RELEASE_VERSION_FILE=lib/getto/repository/version.rb
@@ -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,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ /vendor/
data/.gitlab-ci.yml ADDED
@@ -0,0 +1,12 @@
1
+ image: ruby:2.5.1
2
+
3
+ cache:
4
+ paths:
5
+ - vendor/
6
+
7
+ test:
8
+ except:
9
+ - tags
10
+ script:
11
+ - bundle
12
+ - bundle exec rake
data/.travis.yml ADDED
@@ -0,0 +1,12 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.5.1
5
+ before_install: gem install bundler -v 1.16.2
6
+ deploy:
7
+ provider: rubygems
8
+ gem: getto-repository
9
+ on:
10
+ tags: true
11
+ api_key:
12
+ secure: "wn/tjgSUCGLm2xXcb/NMJdyqtGzCIqQ76WFaMGoVwOYUghXIa0Q8ukFM8zK/BC7QOSzbKwfWwy9AznvXip7qC4vQnE1vlJZSZO6BQa7eEyNGcJ9nm6SJNygiHj3pgqx7nqgFbR9nqROdQkjKvz19yip5j/zAeLgKMSPLgB3nki1K2BUufXaXBK3OQfKEFUY2grTPwoGWpREgcnOFmmTtTpWB8+EoZUdEE05xLbSSsRMkolzDI3AykiVDv/geBMJ9Jrn9aLi9n/l4zCxNnfVLJKEm6HQBuVTNvT/DkLfim/HXJIQ69MbaCd2zKV8v0XUyiTzJTusmlIjPWURZHCLy81U04GX+Uyrmtj64P9buj4i35JsXLEGWvql3JyTkeGrKAZ2ufs5x0l0oF7l0NlpK4aySNumhrbIg0K9pHjgGWksmkIaejIiN30CluPag89KT5ASyxmoq+1sTN0NX+ozTp8+0ODso+hVY95KfCanF9++IHxlMyQPc7jhWq6+uiyg2aHsBaWfuPd3TtuIccHXOWCBbtJ0/AELjxX0WCAsnYAPTk3dczfeIIccr3Zr70vSLui7UCKKEmF6at+HioD+pGxz/g+cUWSQoIC25l3/F4ZY8sv8p2TqEWOj7DlIp3Ot4TgjRWjKWBzqTLVWhzKAJqhxYz8LaloVYpMyJ9G5hWqo="
data/CHANGELOG.md ADDED
@@ -0,0 +1,16 @@
1
+ # Version : 1.0.0
2
+
3
+ version 1.0.0
4
+
5
+ # Version : 0.4.0
6
+
7
+ test: deploy by travisci
8
+
9
+ # Version : 0.3.0
10
+
11
+ test: deploy by travisci
12
+
13
+ # Version : 0.2.0
14
+
15
+ test: publish by travisci
16
+
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 getto-repository.gemspec
6
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,30 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ getto-repository (1.0.0)
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
+ getto-repository!
25
+ minitest (~> 5.0)
26
+ rake (~> 10.0)
27
+ simplecov (~> 0.16)
28
+
29
+ BUNDLED WITH
30
+ 1.16.2
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,61 @@
1
+ # getto-repository
2
+
3
+ [rubygems: getto-repository](https://rubygems.org/gems/getto-repository)
4
+
5
+ Repository helper
6
+
7
+ ```ruby
8
+ require "getto/repository/page"
9
+
10
+ Getto::Repository::Page.new(count: 0, limit: 100).pages # => 0
11
+ Getto::Repository::Page.new(count: 1, limit: 100).pages # => 1
12
+ Getto::Repository::Page.new(count: 50, limit: 100).pages # => 1
13
+ Getto::Repository::Page.new(count: 100, limit: 100).pages # => 1
14
+ Getto::Repository::Page.new(count: 101, limit: 100).pages # => 2
15
+ Getto::Repository::Page.new(count: 200, limit: 100).pages # => 2
16
+ Getto::Repository::Page.new(count: 202, limit: 100).pages # => 3
17
+ ```
18
+
19
+
20
+ ###### Table of Contents
21
+
22
+ - [Requirements](#Requirements)
23
+ - [Usage](#Usage)
24
+ - [License](#License)
25
+
26
+ <a id="Requirements"></a>
27
+ ## Requirements
28
+
29
+ - developed on ruby: 2.5.1
30
+
31
+
32
+ <a id="Usage"></a>
33
+ ## Usage
34
+
35
+ ## Install
36
+
37
+ Add this line to your application's Gemfile:
38
+
39
+ ```ruby
40
+ gem 'getto-repository'
41
+ ```
42
+
43
+ And then execute:
44
+
45
+ ```
46
+ $ bundle
47
+ ```
48
+
49
+ Or install it yourself as:
50
+
51
+ ```
52
+ $ gem install getto-repository
53
+ ```
54
+
55
+
56
+ <a id="License"></a>
57
+ ## License
58
+
59
+ getto/repository is licensed under the [MIT](LICENSE) license.
60
+
61
+ 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
@@ -0,0 +1,35 @@
1
+ lib = File.expand_path("../lib", __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require "getto/repository/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.required_ruby_version = ">= 2.5.1"
7
+
8
+ spec.name = "getto-repository"
9
+ spec.version = Getto::Repository::VERSION
10
+ spec.authors = ["shun@getto.systems"]
11
+ spec.email = ["shun@getto.systems"]
12
+
13
+ spec.summary = %q{validation and format repository}
14
+ spec.description = %q{Validate parameters like strong-parameters(rails)}
15
+ spec.homepage = "https://github.com/getto-systems/getto-repository"
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 Getto::Repository --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
@@ -0,0 +1,14 @@
1
+ module Getto
2
+ module Repository
3
+ class Page
4
+ def initialize(count:, limit:)
5
+ @count = count
6
+ @limit = limit
7
+ end
8
+
9
+ def pages
10
+ (@count.to_f / @limit).ceil
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,5 @@
1
+ module Getto
2
+ module Repository
3
+ VERSION = "1.0.0"
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,120 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: getto-repository
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - shun@getto.systems
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2018-10-28 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)
70
+ email:
71
+ - shun@getto.systems
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files:
75
+ - README.md
76
+ - LICENSE
77
+ files:
78
+ - ".envrc"
79
+ - ".git_release_request.rc.sh"
80
+ - ".gitignore"
81
+ - ".gitlab-ci.yml"
82
+ - ".travis.yml"
83
+ - CHANGELOG.md
84
+ - Gemfile
85
+ - Gemfile.lock
86
+ - LICENSE
87
+ - README.md
88
+ - Rakefile
89
+ - getto-repository.gemspec
90
+ - lib/getto/repository/page.rb
91
+ - lib/getto/repository/version.rb
92
+ homepage: https://github.com/getto-systems/getto-repository
93
+ licenses:
94
+ - MIT
95
+ metadata: {}
96
+ post_install_message:
97
+ rdoc_options:
98
+ - "--title"
99
+ - Getto::Repository
100
+ - "--main"
101
+ - README.md
102
+ require_paths:
103
+ - lib
104
+ required_ruby_version: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ version: 2.5.1
109
+ required_rubygems_version: !ruby/object:Gem::Requirement
110
+ requirements:
111
+ - - ">="
112
+ - !ruby/object:Gem::Version
113
+ version: '0'
114
+ requirements: []
115
+ rubyforge_project:
116
+ rubygems_version: 2.7.7
117
+ signing_key:
118
+ specification_version: 4
119
+ summary: validation and format repository
120
+ test_files: []