dry-operation_generators-base 0.1.0 → 0.2.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: 87671de4459ee68fe7465dd8315da22802eb34b4108a292a3e0e7afd2c24adaa
4
- data.tar.gz: d875672e5a59fa132d7234085e47da95aa031b319b41073673967b6f3b7f23af
3
+ metadata.gz: 6ddf32112c1749b86e0b78870db86d27606228febe92b21ddd0b0d4d5bf9be5a
4
+ data.tar.gz: 5390df1f6abaa225abdefb0f0d0c3fda8c16eb43a224b05961d081eb63aefa98
5
5
  SHA512:
6
- metadata.gz: 7f1041fe9ebd114f6573775fa2c4c73be40ec54a0cfcd739516f28edd295530ac6a9dbebd96348008984cd2ea42cddec5b556ae227633221dedcdea8cb916784
7
- data.tar.gz: 865ae1298a8999b17e9b5a649467eab9dc0bb669dd62ebfbe96042daf2e2a33cc196cea76242f24bbdda1cb82e6d04fa137478d40e59f40bdb63dc61bd8231f2
6
+ metadata.gz: 908ba6760382a76fa86f3543862f083493107010d2e5716809ddf0b6cccee09cfef0a206875b0b99e00075d675624c81373bd6bcae35198c79eb7d145f978955
7
+ data.tar.gz: 538946a0878eb986da0f2288ff3dde4590ece6cdd7000ede4d8c6ae00b32cb0df1c528403c5b3b1f0aaff5faf84723d43adbe5c20806d00ab52cc859d2149556
data/.rubocop.yml CHANGED
@@ -18,9 +18,6 @@ Style/StringLiteralsInInterpolation:
18
18
  Enabled: true
19
19
  EnforcedStyle: double_quotes
20
20
 
21
- Layout/LineLength:
22
- Max: 120
23
-
24
21
  Style/Documentation:
25
22
  Enabled: false
26
23
 
data/.rubocop_todo.yml CHANGED
@@ -1,17 +1,17 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2024-02-19 19:04:02 UTC using RuboCop version 1.60.2.
3
+ # on 2024-08-09 13:49:50 UTC using RuboCop version 1.65.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 1
9
+ # Offense count: 2
10
10
  # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
11
11
  Metrics/AbcSize:
12
- Max: 18
12
+ Max: 21
13
13
 
14
- # Offense count: 2
14
+ # Offense count: 3
15
15
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
16
16
  Metrics/MethodLength:
17
17
  Max: 21
@@ -34,6 +34,18 @@ Naming/FileName:
34
34
  RSpec/ExampleLength:
35
35
  Max: 15
36
36
 
37
+ # Offense count: 1
38
+ RSpec/MessageChain:
39
+ Exclude:
40
+ - 'spec/support/pre/rails.rb'
41
+
37
42
  # Offense count: 1
38
43
  RSpec/MultipleExpectations:
39
44
  Max: 2
45
+
46
+ # Offense count: 1
47
+ # This cop supports safe autocorrection (--autocorrect).
48
+ # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
49
+ # URISchemes: http, https
50
+ Layout/LineLength:
51
+ Max: 169
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.2.0] - 2024-08-09
4
+
5
+ Add support for https://github.com/joel/dry-operation_generators-rspec
6
+
3
7
  ## [0.1.0] - 2024-02-19
4
8
 
5
9
  - Initial release
data/README.md CHANGED
@@ -2,15 +2,18 @@
2
2
 
3
3
  Shared code of operation generators
4
4
 
5
- See [operation_generators](https://github.com/joel/dry-operation_generators) and [operation_generators-test_unit](https://github.com/joel/dry-operation_generators-test_unit)
5
+ See
6
+ - [operation_generators](https://github.com/joel/dry-operation_generators)
7
+ - [operation_generators-test_unit](https://github.com/joel/dry-operation_generators-test_unit)
8
+ - [operation_generators-rspec](https://github.com/joel/dry-operation_generators-rspec)
6
9
 
7
10
  ## Installation
8
11
 
9
- This gems is a dependency of [operation_generators](https://github.com/joel/dry-operation_generators) and [operation_generators-test_unit](https://github.com/joel/dry-operation_generators-test_unit) it is not meant to be install in standalone.
12
+ This gems is a dependency of [operation_generators](https://github.com/joel/dry-operation_generators), [operation_generators-test_unit](https://github.com/joel/dry-operation_generators-test_unit) and [operation_generators-rspec](https://github.com/joel/dry-operation_generators-rspec). It is not meant to be install in standalone.
10
13
 
11
14
  NOTE: The gem needs to be required as `operations/base`
12
15
 
13
- $ gem "operation_generators-base", require: "operations/base"
16
+ $ gem "dry-operation_generators-base", require: "operations/base"
14
17
 
15
18
  Otherwise, you can require "operations/base" on your code.
16
19
 
@@ -23,7 +23,7 @@ module Operations
23
23
  class_option :component, type: :string, desc: "Component type"
24
24
 
25
25
  attr_accessor :regular_parsed_fields, :reference_parsed_fields, :parsed_fields, :root_file_path,
26
- :root_test_file_path
26
+ :root_test_file_path, :base_test_dir
27
27
  end
28
28
 
29
29
  def validate_verb_argument
@@ -36,8 +36,20 @@ module Operations
36
36
  @root_file_path = "app"
37
37
  @root_file_path = "components/#{options[:component]}" if options[:component]
38
38
 
39
- @root_test_file_path = "test"
40
- @root_test_file_path = "test/components/#{options[:component]}" if options[:component]
39
+ @base_test_dir = "test"
40
+
41
+ case Rails.application.config.generators.test_framework
42
+ when :rspec
43
+ @base_test_dir = "spec"
44
+ when :test_unit
45
+ @base_test_dir = "test"
46
+ else
47
+ raise Thor::Error,
48
+ "Unknown test framework: '#{Rails.application.config.generators.test_framework}', please specify --test_framework=test_unit or --test_framework=rspec."
49
+ end
50
+
51
+ @root_test_file_path = base_test_dir
52
+ @root_test_file_path = "#{base_test_dir}/components/#{options[:component]}" if options[:component]
41
53
  end
42
54
 
43
55
  private
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Operations
4
4
  module Base
5
- VERSION = "0.1.0"
5
+ VERSION = "0.2.0"
6
6
  end
7
7
  end
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.email = ["joel.azemar@gmail.com"]
10
10
 
11
11
  spec.summary = "Shared code of operation generators"
12
- spec.homepage = "http://mygemserver.com"
12
+ spec.homepage = "https://github.com/joel/dry-operation_generators-base"
13
13
  spec.license = "MIT"
14
14
  spec.required_ruby_version = ">= 3.3.0"
15
15
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dry-operation_generators-base
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Azemar
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-02-19 00:00:00.000000000 Z
11
+ date: 2024-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -48,7 +48,7 @@ files:
48
48
  - lib/operations/configure.rb
49
49
  - operation_generators-base.gemspec
50
50
  - sig/operations/base.rbs
51
- homepage: http://mygemserver.com
51
+ homepage: https://github.com/joel/dry-operation_generators-base
52
52
  licenses:
53
53
  - MIT
54
54
  metadata:
@@ -68,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
68
68
  - !ruby/object:Gem::Version
69
69
  version: '0'
70
70
  requirements: []
71
- rubygems_version: 3.5.3
71
+ rubygems_version: 3.5.11
72
72
  signing_key:
73
73
  specification_version: 4
74
74
  summary: Shared code of operation generators