getto-repository-sequel 1.0.2 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 29aa613f1a043921d04f521acbc638f66f1f5ebb4ed8ea9d71a9b1d938706e79
4
- data.tar.gz: 704ef19b3873c8ac12c9442608c9bad3ffa5bebaddb8b4c4366691c679ff5d5b
3
+ metadata.gz: c4f588c29dd705f9a1510b2a775765790658d92f0ff65a50b7464ba254e783cb
4
+ data.tar.gz: 10327bc279222b73ca930ef53f4a564b05f9bcb3092eb1d48ffc69c488cb6d0a
5
5
  SHA512:
6
- metadata.gz: 9405299d46dcbd70e81489e53ee9e539910493f3f48364b233ece6c5f0dab1da4a06a7d25099b689cc311844b6bb8f89e66ad6c3466b11bce10a69b4c125237f
7
- data.tar.gz: 18be5399d6cdd428bd83585d77ad24ef6c73d049f424976ab296fa8c1efc22f074228f177ba4f99f3d3b45d335be047221acda5f786668378e6f1cd63d7368ed
6
+ metadata.gz: 17e094d23c936d6236cbcba16ef632176772f66c168c6f5e5fc87fda342f0a85cfa172d347c2c4f7106a2add96d453609ef23f0454ed79f7b1faa365b50b2033
7
+ data.tar.gz: b48e998e3f075cacb71902f9461759a0abb8c76a9395386fc37bbf72c98832bf755f5ea776d193f40796480acbdd4fed337b18089d29b3aa7998b5b4390e97eb
data/.envrc CHANGED
@@ -3,3 +3,4 @@ export APP_ROOT=$(pwd)
3
3
  export DOCKER_WRAPPER_IMAGE_ruby=2.5.1
4
4
 
5
5
  export GIT_RELEASE_VERSION_FILE=lib/getto/repository/sequel/version.rb
6
+ export GIT_RELEASE_REQUEST_TARGET=release
data/.gitlab-ci.yml CHANGED
@@ -7,6 +7,13 @@ cache:
7
7
  test:
8
8
  except:
9
9
  - tags
10
+ - release
10
11
  script:
11
12
  - bundle
12
13
  - bundle exec rake
14
+
15
+ release:
16
+ only:
17
+ - release@getto-systems-labo/rubygems-repository-sequel
18
+ script:
19
+ - ./bin/push_tags.sh
data/.release-version ADDED
@@ -0,0 +1 @@
1
+ 1.1.0
@@ -0,0 +1,8 @@
1
+ # Version : 1.1.0
2
+
3
+ add: gteq, lteq
4
+
5
+ ## commits
6
+
7
+ * fix: gitlab-ci
8
+ * add: gteq, lteq
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # Version : 1.1.0
2
+
3
+ add: gteq, lteq
4
+
1
5
  # Version : 1.0.2
2
6
 
3
7
  fix: travis
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- getto-repository-sequel (1.0.2)
4
+ getto-repository-sequel (1.1.0)
5
5
  getto-initialize_with (~> 1.0)
6
6
  getto-repository (~> 1.0)
7
7
  sequel (~> 5.13.0)
@@ -11,7 +11,7 @@ GEM
11
11
  specs:
12
12
  docile (1.3.1)
13
13
  getto-initialize_with (1.0.4)
14
- getto-repository (1.0.1)
14
+ getto-repository (1.0.2)
15
15
  json (2.1.0)
16
16
  minitest (5.11.3)
17
17
  rake (10.5.0)
data/README.md CHANGED
@@ -47,6 +47,9 @@ search = Getto::Repository::Search::Sequel.new(
47
47
  "name.cont_any": "カナ",
48
48
 
49
49
  "active.in": ["True"],
50
+
51
+ "date.gteq": "2018-10-01",
52
+ "date.lteq": "2018-10-31",
50
53
  },
51
54
  )
52
55
 
@@ -70,6 +73,9 @@ where = search.where do |w|
70
73
  "False" => false,
71
74
  )
72
75
  )
76
+
77
+ w.search "date.gteq", &w.gteq(::Sequel[:accounts][:created_at])
78
+ w.search "date.lteq", &w.lteq(::Sequel[:accounts][:created_at])
73
79
  end
74
80
 
75
81
  order = search.order do |o|
@@ -168,6 +174,34 @@ WHERE
168
174
  (`accounts`.`id` = 1)
169
175
  ```
170
176
 
177
+ - less than or equals to
178
+
179
+ ```ruby
180
+ where = search.where do |w|
181
+ w.search "date.lteq", &w.lteq(::Sequel[:accounts][:created_at])
182
+ end
183
+ ```
184
+
185
+ ```sql
186
+ -- { "date.lteq": "2018-10-01" }
187
+ WHERE
188
+ (`accounts`.`created_at` <= "2018-10-01")
189
+ ```
190
+
191
+ - greater than or equals to
192
+
193
+ ```ruby
194
+ where = search.where do |w|
195
+ w.search "date.gteq", &w.gteq(::Sequel[:accounts][:created_at])
196
+ end
197
+ ```
198
+
199
+ ```sql
200
+ -- { "date.gteq": "2018-10-01" }
201
+ WHERE
202
+ (`accounts`.`created_at` >= "2018-10-01")
203
+ ```
204
+
171
205
  - contains
172
206
 
173
207
  ```ruby
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/getto-systems-labo/rubygems-repository-sequel.git
4
+ git remote add github https://getto-systems:$GITHUB_ACCESS_TOKEN@github.com/getto-systems/rubygems-getto-repository-sequel.git
5
+ git tag $(cat .release-version)
6
+ git push super HEAD:master --tags
7
+ git push github HEAD:master --tags
@@ -64,6 +64,14 @@ module Getto
64
64
  ->(value){ { column => value } }
65
65
  end
66
66
 
67
+ def gteq(column)
68
+ ->(value){ ::Sequel.lit("? >= ?", column, value) }
69
+ end
70
+
71
+ def lteq(column)
72
+ ->(value){ ::Sequel.lit("? <= ?", column, value) }
73
+ end
74
+
67
75
  def is_not_null(column,map)
68
76
  ->(value){
69
77
  if map.has_key?(value)
@@ -1,7 +1,7 @@
1
1
  module Getto
2
2
  module Repository
3
3
  class Sequel
4
- VERSION = "1.0.2"
4
+ VERSION = "1.1.0"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: getto-repository-sequel
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - shun@getto.systems
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-10-28 00:00:00.000000000 Z
11
+ date: 2018-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: getto-initialize_with
@@ -121,16 +121,19 @@ files:
121
121
  - ".git_release_request.rc.sh"
122
122
  - ".gitignore"
123
123
  - ".gitlab-ci.yml"
124
+ - ".release-version"
124
125
  - ".travis.yml"
125
126
  - CHANGELOG.md
126
127
  - CHANGELOG/1.0.0.md
127
128
  - CHANGELOG/1.0.1.md
128
129
  - CHANGELOG/1.0.2.md
130
+ - CHANGELOG/1.1.0.md
129
131
  - Gemfile
130
132
  - Gemfile.lock
131
133
  - LICENSE
132
134
  - README.md
133
135
  - Rakefile
136
+ - bin/push_tags.sh
134
137
  - getto-repository-sequel.gemspec
135
138
  - lib/getto/repository/sequel.rb
136
139
  - lib/getto/repository/sequel/search.rb
@@ -159,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
159
162
  version: '0'
160
163
  requirements: []
161
164
  rubyforge_project:
162
- rubygems_version: 2.7.7
165
+ rubygems_version: 2.7.8
163
166
  signing_key:
164
167
  specification_version: 4
165
168
  summary: Repository helper for Sequel