simple_endpoint 1.0.0 → 1.0.1

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: 88057b74fb64a0b700c891f2f9d4fe47d1e7270558562421eb20ec6cc509609b
4
- data.tar.gz: eb33a881d475b47de26b0e00fafe671981708447a1c51e400fed13a5fef6a789
3
+ metadata.gz: cafc4ae0561d731416cdf3b2118ffbf06bc8a871b749965c4c08456f8eaa2aed
4
+ data.tar.gz: cf96b321cfb718850a9556b5abe05d0130462efa2a5d44ec10597b8c01796f18
5
5
  SHA512:
6
- metadata.gz: 3a5409549ff3eb0c0237838064ff9cdb9a95b9177b745573a8039e34370beead5b20a50b7baa5bb58c3bb397d581d706bf33e4ad9d28fc2c7fa6e53b052b3746
7
- data.tar.gz: 949d6f100a2026f194b63cb1cd40284652a6a622ede5e18eb55872f5db8f570258c966c4ddfc8ebc16ff73a29f81fe2e87a62e1f879104da8ebf7270246b6c57
6
+ metadata.gz: b4594e5c903c2cf287ec2183586fe521f00cee1ba898ee1e5da871efaf7eab0a10ec1808ab297073e28a6df4e16499831c833c7a551fc3c56b95c5e5c087e584
7
+ data.tar.gz: 46839e10421d39641931055e06bbce36154b62dd2e763910d7661130c55156bfbf6352b50bf6b7fe8cfdf13e39c5b846980972f288e646ccd6aeac8d62e98903
data/.circleci/config.yml CHANGED
@@ -1,25 +1,45 @@
1
- version: 2
1
+ version: 2.1
2
+
3
+ executors:
4
+ test_executor:
5
+ docker:
6
+ - image: circleci/ruby:${RUBY_VERSION}
7
+ working_directory: ~/simple_endpoint
8
+
2
9
  jobs:
3
10
  build:
4
- working_directory: ~/decouplio
5
- docker:
6
- - image: ruby:2.6.0
11
+ environment:
12
+ RUBY_VERSION: << parameters.ruby_version >>
13
+ BUNDLER_VERSION: 2.1.4
14
+ executor: test_executor
15
+ parameters:
16
+ ruby_version:
17
+ type: string
7
18
  steps:
8
19
  - checkout
9
20
 
10
- - restore_cache:
11
- keys:
12
- - decouplio-{{ checksum "Gemfile.lock" }}
13
- - decouplio-
21
+ - run:
22
+ name: 'Install bundler'
23
+ command: 'gem install bundler'
24
+
14
25
  - run:
15
26
  name: Install dependencies
16
27
  command: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs 4 --retry 3
17
28
 
18
- - save_cache:
19
- key: decouplio-{{ checksum "Gemfile.lock" }}
20
- paths:
21
- - vendor/bundle
29
+ # - run:
30
+ # name: Run Rubocop
31
+ # command: bundle exec rubocop
22
32
 
23
33
  - run:
24
34
  name: Run Tests
25
35
  command: bundle exec rspec
36
+
37
+ workflows:
38
+ build_and_test:
39
+ jobs:
40
+ - build:
41
+ name: 'ruby 2.6.8'
42
+ ruby_version: 2.6.8
43
+ - build:
44
+ name: 'ruby 2.7.0'
45
+ ruby_version: 2.7.0
data/.gitignore CHANGED
@@ -9,3 +9,4 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
+ Gemfile.lock
data/.rubocop.yml CHANGED
@@ -1,20 +1,23 @@
1
1
  require: rubocop-rspec
2
2
 
3
3
  AllCops:
4
+ TargetRubyVersion: 2.7
5
+ NewCops: enable
6
+ SuggestExtensions: false
4
7
  Exclude:
5
8
  - 'simple_endpoint.gemspec'
6
9
 
7
10
  Style/Documentation:
8
11
  Enabled: false
9
12
 
10
- Metrics/LineLength:
13
+ Layout/LineLength:
11
14
  Max: 120
12
15
 
13
16
  Style/FrozenStringLiteralComment:
14
17
  Enabled: true
15
18
 
16
19
  Metrics/BlockLength:
17
- ExcludedMethods: ['describe','context']
20
+ IgnoredMethods: ['describe','context']
18
21
 
19
22
  RSpec/DescribeClass:
20
23
  Enabled: false
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.5.1
1
+ 2.7.0
@@ -1,6 +1,10 @@
1
1
  simple_endpoint changelog
2
2
  =====================
3
3
 
4
+ [2022-02-09] Version 1.0.1
5
+ ---------------------------
6
+ - Add Ruby 2.7+ support
7
+
4
8
  [2020-01-25] Version 1.0.0
5
9
  ---------------------------
6
10
  **Breaking changes**
data/README.md CHANGED
@@ -74,7 +74,7 @@ Now you are able to use `endpoint` method at other controllers
74
74
  | `:different_cases`| no | {} | Cases that should be redefined for exact `#endpoint` call |
75
75
  | `:different_handler` | no | {} | Case of handler that should be handled in different way |
76
76
  | `:options` | no | {} | Additional hash which will be merged to `#ednpoint_options` method result before operation execution |
77
- | `:before_render` | no | {} | Allow to process code before specific case handler |
77
+ | `:before_response` | no | {} | Allow to process code before specific case handler |
78
78
  | `:renderer_options` | no | {} | Allow to pass serializer options from controller and Will available inside handler as second parameter.
79
79
 
80
80
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SimpleEndpoint
4
- VERSION = '1.0.0'
4
+ VERSION = '1.0.1'
5
5
  end
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'simple_endpoint/version'
4
3
  # rubocop:disable Metrics/ParameterLists
5
4
  module SimpleEndpoint
6
5
  module Controller
@@ -16,7 +15,7 @@ module SimpleEndpoint
16
15
  default_cases.merge(different_cases),
17
16
  renderer_options,
18
17
  before_response,
19
- endpoint_options.merge(options)
18
+ **endpoint_options.merge(options)
20
19
  )
21
20
  end
22
21
 
@@ -56,7 +55,7 @@ module SimpleEndpoint
56
55
 
57
56
  def procees_handler(matched_case, handler, result, renderer_options, exception_class = nil)
58
57
  if handler.key?(matched_case)
59
- handler.dig(matched_case)&.(result, **renderer_options)
58
+ handler[matched_case]&.(result, **renderer_options)
60
59
  elsif exception_class
61
60
  raise exception_class, "Key: #{matched_case} is not present at #{handler}"
62
61
  end
@@ -32,10 +32,10 @@ Gem::Specification.new do |spec|
32
32
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
33
33
  spec.require_paths = ['lib']
34
34
 
35
- spec.add_development_dependency 'bundler', '~> 1.16'
35
+ spec.add_development_dependency 'bundler', '>= 2.1.0'
36
36
  spec.add_development_dependency 'pry-byebug'
37
- spec.add_development_dependency 'rake', '~> 10.0'
37
+ spec.add_development_dependency 'rake', '~> 13.0'
38
38
  spec.add_development_dependency 'rspec', '~> 3.0'
39
- spec.add_development_dependency 'rubocop', '~> 0.61.0'
39
+ spec.add_development_dependency 'rubocop', '~> 1.25.1'
40
40
  spec.add_development_dependency 'rubocop-rspec'
41
41
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_endpoint
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Bal
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-25 00:00:00.000000000 Z
11
+ date: 2022-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.16'
19
+ version: 2.1.0
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.16'
26
+ version: 2.1.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: pry-byebug
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '10.0'
47
+ version: '13.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '10.0'
54
+ version: '13.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.61.0
75
+ version: 1.25.1
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.61.0
82
+ version: 1.25.1
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rubocop-rspec
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -108,9 +108,8 @@ files:
108
108
  - ".rubocop.yml"
109
109
  - ".ruby-gemset"
110
110
  - ".ruby-version"
111
- - CHNAGES.md
111
+ - CHANGES.md
112
112
  - Gemfile
113
- - Gemfile.lock
114
113
  - LICENSE
115
114
  - README.md
116
115
  - Rakefile
@@ -138,8 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
137
  - !ruby/object:Gem::Version
139
138
  version: '0'
140
139
  requirements: []
141
- rubyforge_project:
142
- rubygems_version: 2.7.9
140
+ rubygems_version: 3.1.2
143
141
  signing_key:
144
142
  specification_version: 4
145
143
  summary: Simple implementation of Trailblazer endpoint
data/Gemfile.lock DELETED
@@ -1,66 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- simple_endpoint (1.0.0)
5
-
6
- GEM
7
- remote: https://rubygems.org/
8
- specs:
9
- ast (2.4.0)
10
- byebug (10.0.2)
11
- coderay (1.1.2)
12
- diff-lcs (1.3)
13
- jaro_winkler (1.5.4)
14
- method_source (0.9.2)
15
- parallel (1.19.1)
16
- parser (2.7.0.2)
17
- ast (~> 2.4.0)
18
- powerpack (0.1.2)
19
- pry (0.12.2)
20
- coderay (~> 1.1.0)
21
- method_source (~> 0.9.0)
22
- pry-byebug (3.6.0)
23
- byebug (~> 10.0)
24
- pry (~> 0.10)
25
- rainbow (3.0.0)
26
- rake (10.5.0)
27
- rspec (3.8.0)
28
- rspec-core (~> 3.8.0)
29
- rspec-expectations (~> 3.8.0)
30
- rspec-mocks (~> 3.8.0)
31
- rspec-core (3.8.0)
32
- rspec-support (~> 3.8.0)
33
- rspec-expectations (3.8.2)
34
- diff-lcs (>= 1.2.0, < 2.0)
35
- rspec-support (~> 3.8.0)
36
- rspec-mocks (3.8.0)
37
- diff-lcs (>= 1.2.0, < 2.0)
38
- rspec-support (~> 3.8.0)
39
- rspec-support (3.8.0)
40
- rubocop (0.61.1)
41
- jaro_winkler (~> 1.5.1)
42
- parallel (~> 1.10)
43
- parser (>= 2.5, != 2.5.1.1)
44
- powerpack (~> 0.1)
45
- rainbow (>= 2.2.2, < 4.0)
46
- ruby-progressbar (~> 1.7)
47
- unicode-display_width (~> 1.4.0)
48
- rubocop-rspec (1.35.0)
49
- rubocop (>= 0.60.0)
50
- ruby-progressbar (1.10.1)
51
- unicode-display_width (1.4.1)
52
-
53
- PLATFORMS
54
- ruby
55
-
56
- DEPENDENCIES
57
- bundler (~> 1.16)
58
- pry-byebug
59
- rake (~> 10.0)
60
- rspec (~> 3.0)
61
- rubocop (~> 0.61.0)
62
- rubocop-rspec
63
- simple_endpoint!
64
-
65
- BUNDLED WITH
66
- 1.17.2