webhook_trigger 0.2.0 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 698d248b219bf2939b0b1172504ac6cfe0d6ecc093715becc1cc8aac640940e9
4
- data.tar.gz: bc4619ca0d85203cff255a43b3619ec95447eaf76cca2b6f79f73b719007aab6
3
+ metadata.gz: 44e67259d8d301e5ebb37248d8504161c7c919bb01eb527d0947b52bcbe4121c
4
+ data.tar.gz: bc148ca56ba429239e4a68f1484b4faaab66d1d6fb650928880d7a84246310e9
5
5
  SHA512:
6
- metadata.gz: de0bd98d7cfc86b14270f745fc9756069b3e7f919bab5623f7f141b93e1a9033290222e96bcb416bd4bdcc8151c1125c39233e8397bd8af461fee245af55fede
7
- data.tar.gz: d6867869eff10eaf69ef27647ff6565b3bd3d7c4cbc7ae99b733cd0a0086aff20d4e4a6abc40ef0a738849ec2c5c87d240c0f004df179fa21bf50b008d510e10
6
+ metadata.gz: 4f03040f8109c546dddd0fdbd840b7f5e64f4abeca2ee9556142b26b8a7961886bf24d5e36de9bc48cd5b3e46109850dbf7f24a8787cf8eb326aee0ada984c2a
7
+ data.tar.gz: 75e81cdbb3c84cfad23a7069986bbe697d8320dea39edbf1ab82f3d054c984c5ef90622f00ce61f64ff2d43cb20cd4f90e7672f3a8cb8d9d3142b533995b9aa9
@@ -0,0 +1,5 @@
1
+ detectors:
2
+ Attribute:
3
+ enabled: false
4
+ IrresponsibleModule:
5
+ enabled: false
@@ -0,0 +1,18 @@
1
+ pipeline {
2
+ agent none
3
+ stages{
4
+ stage('linter'){
5
+ agent { docker { image 'ruby:2.6.5' } }
6
+ steps {
7
+ sh 'gem install rubocop'
8
+ sh 'gem install reek'
9
+ sh 'gem install fasterer'
10
+ sh 'gem install rails_best_practices'
11
+ sh 'rubocop'
12
+ sh 'reek'
13
+ sh 'fasterer'
14
+ sh 'rails_best_practices .'
15
+ }
16
+ }
17
+ }
18
+ }
@@ -4,14 +4,17 @@ module WebhookTrigger
4
4
  # Class Trigger is main class for run perform
5
5
  module Repository
6
6
  def self.client
7
- client = Mysql2::Client.new(
8
- host: WebhookTrigger.configuration.host,
9
- port: WebhookTrigger.configuration.port,
10
- username: WebhookTrigger.configuration.username,
11
- password: WebhookTrigger.configuration.password,
12
- database: WebhookTrigger.configuration.db
7
+ Mysql2::Client.new(
8
+ host: configuration.host,
9
+ port: configuration.port,
10
+ username: configuration.username,
11
+ password: configuration.password,
12
+ database: configuration.db
13
13
  )
14
- client
14
+ end
15
+
16
+ def self.configuration
17
+ @configuration ||= WebhookTrigger.configuration
15
18
  end
16
19
  end
17
20
  end
@@ -6,25 +6,25 @@ module WebhookTrigger
6
6
  # This TriggerRepository is class for connect to database
7
7
  module TriggerRepository
8
8
  def self.webhook_list_query_select
9
- sql = 'SELECT ' + WebhookTrigger.configuration.list + '.id, '
10
- sql += WebhookTrigger.configuration.list + '.url, '
11
- sql += WebhookTrigger.configuration.event + '.name '
9
+ sql = 'SELECT ' + configuration_list + '.id, '
10
+ sql += configuration_list + '.url, '
11
+ sql += configuration_event + '.name '
12
12
  sql += webhook_list_query_join
13
13
  sql
14
14
  end
15
15
 
16
16
  def self.webhook_list_query_join
17
- sql = ' FROM ' + WebhookTrigger.configuration.list
18
- sql += ' JOIN ' + WebhookTrigger.configuration.event
19
- sql += ' on ' + WebhookTrigger.configuration.list + '.event_id='
20
- sql += WebhookTrigger.configuration.event + '.id '
17
+ sql = ' FROM ' + configuration_list
18
+ sql += ' JOIN ' + configuration_event
19
+ sql += ' on ' + configuration_list + '.event_id='
20
+ sql += configuration_event + '.id '
21
21
  sql
22
22
  end
23
23
 
24
24
  def self.webhook_list_query_condition(event, account_id)
25
- sql = 'WHERE ' + WebhookTrigger.configuration.list
25
+ sql = 'WHERE ' + configuration_list
26
26
  sql += '.account_id=' + account_id.to_s
27
- sql += ' AND ' + WebhookTrigger.configuration.event
27
+ sql += ' AND ' + configuration_event
28
28
  sql += ".name like '" + event.to_s + "'"
29
29
  sql
30
30
  end
@@ -37,8 +37,8 @@ module WebhookTrigger
37
37
  end
38
38
 
39
39
  def self.webhook_insert_query
40
- sql = 'INSERT INTO ' + WebhookTrigger.configuration.db + '.'
41
- sql += WebhookTrigger.configuration.buffer_table
40
+ sql = 'INSERT INTO ' + configuration.db + '.'
41
+ sql += configuration.buffer_table
42
42
  sql += '(url, event, event_source_id) VALUES '
43
43
  sql
44
44
  end
@@ -54,6 +54,20 @@ module WebhookTrigger
54
54
  sql += webhook_insert_value(event, url, event_source_id)
55
55
  WebhookTrigger::Repository.client.query(sql)
56
56
  end
57
+
58
+ private
59
+
60
+ def configuration_list
61
+ configuration_list.list
62
+ end
63
+
64
+ def configuration_event
65
+ configuration.event
66
+ end
67
+
68
+ def configuration
69
+ @configuration ||= WebhookTrigger.configuration
70
+ end
57
71
  end
58
72
  end
59
73
  end
@@ -3,5 +3,5 @@
3
3
  require 'webhook_trigger/configuration.rb'
4
4
  # Module WebhookTrigger is main module for gem webhook_trigger
5
5
  module WebhookTrigger
6
- VERSION = '0.2.0'
6
+ VERSION = '0.2.1'
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webhook_trigger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Ivander
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-22 00:00:00.000000000 Z
11
+ date: 2020-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -102,11 +102,13 @@ extensions: []
102
102
  extra_rdoc_files: []
103
103
  files:
104
104
  - ".gitignore"
105
+ - ".reek.yml"
105
106
  - ".rspec"
106
107
  - ".rubocop.yml"
107
108
  - ".travis.yml"
108
109
  - CODE_OF_CONDUCT.md
109
110
  - Gemfile
111
+ - Jenkinsfile
110
112
  - LICENSE.txt
111
113
  - README.md
112
114
  - Rakefile