hucpa 0.2.0-jruby → 0.2.1-jruby

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
  SHA1:
3
- metadata.gz: 76724120a511fd2988290a12e58fd2afa1b6049f
4
- data.tar.gz: 02b211715ac55a80670f052c770449fcab447a43
3
+ metadata.gz: d538ef624e81e52a2d237f4f641fad68be8ffb8a
4
+ data.tar.gz: 29423b126f3a541ba486aad08dc58bd6777c8dc4
5
5
  SHA512:
6
- metadata.gz: 8a21d102d78878e68b363cd720980b4140749e470cef39d9f5967b13f6c5b7bc799785bd352ffa97b46339df2665556b364b0dac441baf2d73f2cf89f2afc4ef
7
- data.tar.gz: 5effc93b3e647db68cde71868db329a3eafb7f8d820760f0e81f18a72205e4819c9f6eca05f3843949d0470aff5f4afc6e595ce23b7f845453cb074343b782ed
6
+ metadata.gz: 787f08d771d146f8c681e72bb3d229cd4bde3a8e37ddedad735c854aa4db4d48691d77926d9498bc8b310f45196095c05e6945093b0b6fe7659e005dda53d767
7
+ data.tar.gz: 7d31cb45248d1db32b36ff4d235ca827fbb4ff63c7e280f8eb6a3461d6790687374751a0919ee77c6e19f8e9a273f5bf9f9d32b07ee61d428e13bfdcbb687dbb
data/.rubocop.yml ADDED
@@ -0,0 +1,42 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.3
3
+
4
+ Documentation:
5
+ Enabled: false
6
+
7
+ Metrics/BlockLength:
8
+ Max: 32
9
+ Exclude:
10
+ - "spec/**/*.rb"
11
+
12
+ Metrics/LineLength:
13
+ Max: 120
14
+
15
+ Style/AndOr:
16
+ EnforcedStyle: conditionals
17
+
18
+ Style/Encoding:
19
+ EnforcedStyle: when_needed
20
+
21
+ Style/FrozenStringLiteralComment:
22
+ Enabled: false
23
+
24
+ Style/IndentHash:
25
+ Enabled: false
26
+
27
+ Style/PercentLiteralDelimiters:
28
+ PreferredDelimiters:
29
+ "%i": "[]"
30
+ "%I": "[]"
31
+ "%w": "[]"
32
+ "%W": "[]"
33
+
34
+ Style/RedundantSelf:
35
+ Enabled: false
36
+
37
+ Style/SignalException:
38
+ Enabled: true
39
+ EnforcedStyle: semantic
40
+
41
+ Style/StringLiterals:
42
+ EnforcedStyle: double_quotes
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.2.1
2
+
3
+ * fixed importing `HikariCP` jars
4
+
1
5
  ## 0.2.0
2
6
 
3
7
  * upgraded `HikariCP` to `2.6.0`
data/Gemfile.lock CHANGED
@@ -1,12 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hucpa (0.2.0-java)
4
+ hucpa (0.2.1-java)
5
5
  dry-validation (~> 0.10)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
+ ast (2.3.0)
10
11
  concurrent-ruby (1.0.4-java)
11
12
  diff-lcs (1.3)
12
13
  docile (1.1.5)
@@ -40,6 +41,10 @@ GEM
40
41
  inflecto (0.0.2)
41
42
  jdbc-postgres (9.4.1206)
42
43
  json (2.0.3-java)
44
+ parser (2.3.3.1)
45
+ ast (~> 2.2)
46
+ powerpack (0.1.1)
47
+ rainbow (2.2.1)
43
48
  rake (12.0.0)
44
49
  rspec (3.5.0)
45
50
  rspec-core (~> 3.5.0)
@@ -54,11 +59,19 @@ GEM
54
59
  diff-lcs (>= 1.2.0, < 2.0)
55
60
  rspec-support (~> 3.5.0)
56
61
  rspec-support (3.5.0)
62
+ rubocop (0.47.1)
63
+ parser (>= 2.3.3.1, < 3.0)
64
+ powerpack (~> 0.1)
65
+ rainbow (>= 1.99.1, < 3.0)
66
+ ruby-progressbar (~> 1.7)
67
+ unicode-display_width (~> 1.0, >= 1.0.1)
68
+ ruby-progressbar (1.8.1)
57
69
  simplecov (0.13.0)
58
70
  docile (~> 1.1.0)
59
71
  json (>= 1.8, < 3)
60
72
  simplecov-html (~> 0.10.0)
61
73
  simplecov-html (0.10.0)
74
+ unicode-display_width (1.1.3)
62
75
 
63
76
  PLATFORMS
64
77
  java
@@ -69,6 +82,7 @@ DEPENDENCIES
69
82
  jdbc-postgres (~> 9.4)
70
83
  rake (~> 12.0)
71
84
  rspec (~> 3.5)
85
+ rubocop (~> 0)
72
86
  simplecov (~> 0)
73
87
 
74
88
  BUNDLED WITH
data/Rakefile CHANGED
@@ -1,6 +1,10 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rspec/core/rake_task"
3
+ require "rubocop/rake_task"
4
+
5
+ load "lib/tasks/ci.rake"
3
6
 
4
7
  RSpec::Core::RakeTask.new(:spec)
8
+ RuboCop::RakeTask.new(:rubocop)
5
9
 
6
10
  task default: :spec
data/circle.yml CHANGED
@@ -13,4 +13,5 @@ dependencies:
13
13
 
14
14
  test:
15
15
  override:
16
+ - docker run --net=host --env DATABASE_HOST=localhost --rm tomekw/hucpa rubocop
16
17
  - docker run --net=host --env DATABASE_HOST=localhost --rm tomekw/hucpa rspec spec
data/hucpa.gemspec CHANGED
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |spec|
5
5
  spec.name = "hucpa"
6
- spec.version = "0.2.0"
6
+ spec.version = "0.2.1"
7
7
  spec.authors = ["Tomek Wałkuski"]
8
8
  spec.email = "ja@jestem.tw"
9
9
 
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
16
16
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
17
17
  f.match(%r{^(test|spec|features)/})
18
18
  end
19
- spec.require_paths = %w[lib vendor]
19
+ spec.require_paths = %w[lib]
20
20
 
21
21
  spec.add_dependency "dry-validation", "~> 0.10"
22
22
 
@@ -24,5 +24,6 @@ Gem::Specification.new do |spec|
24
24
  spec.add_development_dependency "jdbc-postgres", "~> 9.4"
25
25
  spec.add_development_dependency "rake", "~> 12.0"
26
26
  spec.add_development_dependency "rspec", "~> 3.5"
27
+ spec.add_development_dependency "rubocop", "~> 0"
27
28
  spec.add_development_dependency "simplecov", "~> 0"
28
29
  end
File without changes
@@ -1,15 +1,15 @@
1
1
  require "dry-validation"
2
2
 
3
- import com.zaxxer.hikari.HikariConfig
4
-
5
3
  module Hucpa
6
4
  class Configuration
5
+ java_import com.zaxxer.hikari.HikariConfig
6
+
7
7
  def initialize(options)
8
8
  @options = options
9
9
  end
10
10
 
11
11
  def to_hikari_config
12
- raise ArgumentError.new(validation_errors) if validation.failure?
12
+ fail ArgumentError, validation_errors if validation.failure?
13
13
 
14
14
  HikariConfiguration.new.tap do |config|
15
15
  CONFIGURATION_OPTIONS.each do |option|
@@ -43,7 +43,7 @@ module Hucpa
43
43
  sqlserver: "com.microsoft.sqlserver.jdbc.SQLServerDataSource",
44
44
  sqlserver_jtds: "net.sourceforge.jtds.jdbcx.JtdsDataSource",
45
45
  sybase: "com.sybase.jdbcx.SybDataSource"
46
- }
46
+ }.freeze
47
47
  private_constant :ADAPTERS
48
48
 
49
49
  VALIDATION_SCHEMA = Dry::Validation.Schema do
@@ -52,7 +52,7 @@ module Hucpa
52
52
  super.merge(
53
53
  en: {
54
54
  errors: {
55
- :"adapter/jdbc_url options" => "are invalid. Either adapter or jdbc_url must be filled"
55
+ "adapter/jdbc_url options": "are invalid. Either adapter or jdbc_url must be filled"
56
56
  }
57
57
  }
58
58
  )
@@ -76,7 +76,7 @@ module Hucpa
76
76
  optional(:pool_name).filled(:str?)
77
77
  optional(:server_name).filled(:str?)
78
78
 
79
- rule(:"adapter/jdbc_url options" => %i[adapter jdbc_url]) do |adapter, jdbc_url|
79
+ rule("adapter/jdbc_url options": %i[adapter jdbc_url]) do |adapter, jdbc_url|
80
80
  adapter.filled? ^ jdbc_url.filled?
81
81
  end
82
82
  end
@@ -1,7 +1,7 @@
1
- import com.zaxxer.hikari.HikariDataSource
2
-
3
1
  module Hucpa
4
2
  class ConnectionPool
3
+ java_import com.zaxxer.hikari.HikariDataSource
4
+
5
5
  def initialize(options)
6
6
  @options = options
7
7
  @hikari_config = Configuration.new(options).to_hikari_config
@@ -15,10 +15,10 @@ module Hucpa
15
15
  datasource.close
16
16
  end
17
17
 
18
- def with_connection(&block)
18
+ def with_connection
19
19
  conn = datasource.connection
20
20
 
21
- block.call(conn)
21
+ yield conn
22
22
  ensure
23
23
  conn.close
24
24
  end
data/lib/hucpa.rb CHANGED
@@ -1,4 +1,4 @@
1
- Dir["vendor/*"].each { |f| require File.join(Dir.pwd, f) }
1
+ Dir[File.expand_path("..", __FILE__) + "/*.jar"].each { |f| require f }
2
2
 
3
3
  require "hucpa/configuration"
4
4
  require "hucpa/connection_pool"
File without changes
File without changes
data/lib/tasks/ci.rake ADDED
@@ -0,0 +1,8 @@
1
+ require "rubocop/rake_task"
2
+
3
+ namespace :ci do
4
+ RuboCop::RakeTask.new(:rubocop)
5
+
6
+ desc "Run all CI checks"
7
+ task run: %i[rubocop spec]
8
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hucpa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: jruby
6
6
  authors:
7
7
  - Tomek Wałkuski
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '3.5'
83
+ - !ruby/object:Gem::Dependency
84
+ requirement: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ name: rubocop
90
+ prerelease: false
91
+ type: :development
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
83
97
  - !ruby/object:Gem::Dependency
84
98
  requirement: !ruby/object:Gem::Requirement
85
99
  requirements:
@@ -103,6 +117,7 @@ files:
103
117
  - ".gitignore"
104
118
  - ".irbrc"
105
119
  - ".rspec"
120
+ - ".rubocop.yml"
106
121
  - CHANGELOG.md
107
122
  - CODE_OF_CONDUCT.md
108
123
  - Dockerfile
@@ -114,12 +129,13 @@ files:
114
129
  - circle.yml
115
130
  - docker-compose.yml
116
131
  - hucpa.gemspec
132
+ - lib/HikariCP-2.6.0.jar
117
133
  - lib/hucpa.rb
118
134
  - lib/hucpa/configuration.rb
119
135
  - lib/hucpa/connection_pool.rb
120
- - vendor/HikariCP-2.6.0.jar
121
- - vendor/slf4j-api-1.7.22.jar
122
- - vendor/slf4j-nop-1.7.22.jar
136
+ - lib/slf4j-api-1.7.22.jar
137
+ - lib/slf4j-nop-1.7.22.jar
138
+ - lib/tasks/ci.rake
123
139
  homepage: https://github.com/tomekw/hucpa
124
140
  licenses:
125
141
  - MIT
@@ -128,7 +144,6 @@ post_install_message:
128
144
  rdoc_options: []
129
145
  require_paths:
130
146
  - lib
131
- - vendor
132
147
  required_ruby_version: !ruby/object:Gem::Requirement
133
148
  requirements:
134
149
  - - ">="