u-struct 0.11.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +5 -5
  3. data/.rubocop.yml +129 -0
  4. data/.rubocop_todo.yml +10 -0
  5. data/.tool-versions +1 -0
  6. data/CHANGELOG.md +558 -13
  7. data/Gemfile +14 -3
  8. data/README.md +682 -16
  9. data/Rakefile +5 -5
  10. data/bin/console +3 -3
  11. data/bin/prepare_coverage +7 -9
  12. data/bin/run_ci +17 -0
  13. data/bin/tapioca +28 -0
  14. data/examples/rgb/number.rb +1 -1
  15. data/examples/rgb_1.rb +7 -6
  16. data/examples/rgb_2.rb +2 -2
  17. data/examples/rgb_3.rb +1 -1
  18. data/lib/micro/struct/factory/create_struct.rb +95 -69
  19. data/lib/micro/struct/factory/members.rb +1 -0
  20. data/lib/micro/struct/factory.rb +13 -4
  21. data/lib/micro/struct/features.rb +35 -16
  22. data/lib/micro/struct/normalize_names.rb +4 -3
  23. data/lib/micro/struct/version.rb +2 -1
  24. data/lib/micro/struct.rb +37 -5
  25. data/lib/u-struct.rb +2 -0
  26. data/rbi/micro/struct/factory/create_struct.rbi +60 -0
  27. data/rbi/micro/struct/factory/members.rbi +67 -0
  28. data/rbi/micro/struct/factory.rbi +41 -0
  29. data/rbi/micro/struct/features.rbi +41 -0
  30. data/rbi/micro/struct/normalize_names.rbi +20 -0
  31. data/rbi/micro/struct/version.rbi +3 -0
  32. data/rbi/micro/struct.rbi +68 -0
  33. data/sorbet/config +8 -0
  34. data/sorbet/rbi/gems/ast@2.4.2.rbi +54 -0
  35. data/sorbet/rbi/gems/coderay@1.1.3.rbi +8 -0
  36. data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +11 -0
  37. data/sorbet/rbi/gems/docile@1.4.0.rbi +54 -0
  38. data/sorbet/rbi/gems/method_source@1.0.0.rbi +8 -0
  39. data/sorbet/rbi/gems/minitest@5.15.0.rbi +345 -0
  40. data/sorbet/rbi/gems/parser@3.1.0.0.rbi +1196 -0
  41. data/sorbet/rbi/gems/pry@0.14.1.rbi +8 -0
  42. data/sorbet/rbi/gems/rake@13.0.6.rbi +806 -0
  43. data/sorbet/rbi/gems/rbi@0.0.9.rbi +1602 -0
  44. data/sorbet/rbi/gems/simplecov-html@0.12.3.rbi +89 -0
  45. data/sorbet/rbi/gems/simplecov@0.21.2.rbi +577 -0
  46. data/sorbet/rbi/gems/simplecov_json_formatter@0.1.3.rbi +8 -0
  47. data/sorbet/rbi/gems/spoom@1.1.8.rbi +1252 -0
  48. data/sorbet/rbi/gems/tapioca@0.6.2.rbi +1232 -0
  49. data/sorbet/rbi/gems/thor@1.2.1.rbi +844 -0
  50. data/sorbet/rbi/gems/unparser@0.6.3.rbi +8 -0
  51. data/sorbet/rbi/gems/webrick@1.7.0.rbi +601 -0
  52. data/sorbet/rbi/gems/yard-sorbet@0.6.1.rbi +199 -0
  53. data/sorbet/rbi/gems/yard@0.9.27.rbi +4112 -0
  54. data/sorbet/tapioca/config.yml +13 -0
  55. data/sorbet/tapioca/require.rb +4 -0
  56. data/u-struct.gemspec +3 -3
  57. metadata +38 -4
  58. data/bin/test +0 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0150b18cb61a38d042a0ad2f22c9588c7269c8362a708a8ebf156cc927a312dd
4
- data.tar.gz: 0fc97adb461433c7382ee524d3a58c4d134624013c4afa974cade30b46f09109
3
+ metadata.gz: fa40551d175dd0f2239b9c8a5c7fda5ea39e29b4293c23d8318744cf2f9df0b9
4
+ data.tar.gz: 5f5058d00fde571ed7fb972dd976dcae1dbe5e7469c2f069eeb29b6cdd01747a
5
5
  SHA512:
6
- metadata.gz: 708cbec302ef69ec3d6f465ebca2d07eff62ff1a3746b4e7034b21a571e693b27b9e4dad1ada934f4ac37f2565212cc83f111d384eb84573209578aab77beac6
7
- data.tar.gz: cec5b4750bcc98d9955fbe27bcca952b2139c36dd90d6f6c98fd3b107f9ef577fdb2e72f34c78871e15d608cdab06c034427efeab67caa5bc2c869bbaeee8026
6
+ metadata.gz: ef1569d45a887c42dd1239a35a98fdb160c6d93ca5e6cd24cbac1f4763295ff4228c5343f64fdf33e91a51503597b66aa0222b0652fd7b723d2e35e3a3c2e4ca
7
+ data.tar.gz: 7c2747b2b46095461d6402a1a7f58d4a2b4b8396572c4e6bb7d36e986da1aec44a17f82603ec2c01bd62bbbe3a6127114a8023b6e04e0601df8be045daae9699
@@ -6,20 +6,20 @@ jobs:
6
6
  runs-on: ubuntu-latest
7
7
  strategy:
8
8
  matrix:
9
- ruby: [2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 3.0, 3.1.0-preview1]
9
+ ruby: [2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 3.0.3, 3.1]
10
10
  steps:
11
11
  - uses: actions/checkout@v2
12
12
  - uses: ruby/setup-ruby@v1
13
13
  with:
14
14
  ruby-version: ${{ matrix.ruby }}
15
15
  bundler-cache: true
16
- - name: Test and generate coverage
17
- run: bin/test
16
+ - name: Run sorbet, rubocop, tests and generate code coverage
17
+ run: bin/run_ci
18
18
  - name: Format coverage
19
- if: ${{ matrix.ruby >= 3 && matrix.ruby < 3.1 }}
19
+ if: ${{ matrix.ruby >= 3.1 }}
20
20
  run: bin/prepare_coverage
21
21
  - uses: paambaati/codeclimate-action@v2.7.5
22
- if: ${{ matrix.ruby >= 3 && matrix.ruby < 3.1 }}
22
+ if: ${{ matrix.ruby >= 3.1 }}
23
23
  env:
24
24
  CC_TEST_REPORTER_ID: 8ce350edeb0772e94ffd678bbaca30d9c1293b9d9051a1689c79b91c21f5afd5
25
25
  with:
data/.rubocop.yml ADDED
@@ -0,0 +1,129 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ # The behavior of RuboCop can be controlled via the .rubocop.yml
4
+ # configuration file. It makes it possible to enable/disable
5
+ # certain cops (checks) and to alter their behavior if they accept
6
+ # any parameters. The file can be placed either in your home
7
+ # directory or in some project directory.
8
+ #
9
+ # RuboCop will start looking for the configuration file in the directory
10
+ # where the inspected file is and continue its way up to the root directory.
11
+ #
12
+ # See https://docs.rubocop.org/rubocop/configuration
13
+
14
+ require:
15
+ - rubocop-rake
16
+ - rubocop-minitest
17
+
18
+ AllCops:
19
+ NewCops: enable
20
+ TargetRubyVersion: 2.5
21
+
22
+ # == Gemspec ==
23
+
24
+ Gemspec/RequiredRubyVersion:
25
+ Enabled: false
26
+
27
+ # == Style ==
28
+
29
+ Style/Alias:
30
+ Enabled: false
31
+
32
+ Style/CaseEquality:
33
+ Enabled: false
34
+
35
+ Style/ClassAndModuleChildren:
36
+ Enabled: false
37
+
38
+ Style/CombinableLoops:
39
+ Exclude:
40
+ - test/**/*.rb
41
+
42
+ Style/Documentation:
43
+ Enabled: false
44
+
45
+ Style/FormatStringToken:
46
+ EnforcedStyle: annotated
47
+
48
+ Style/Lambda:
49
+ Enabled: false
50
+
51
+ Style/LambdaCall:
52
+ Enabled: false
53
+
54
+ Style/ModuleFunction:
55
+ EnforcedStyle: extend_self
56
+
57
+ Style/RaiseArgs:
58
+ EnforcedStyle: compact
59
+
60
+ Style/SymbolArray:
61
+ EnforcedStyle: brackets
62
+
63
+ # == Layout ==
64
+
65
+ Layout/ArrayAlignment:
66
+ Enabled: false
67
+
68
+ Layout/ExtraSpacing:
69
+ Enabled: false
70
+
71
+ Layout/HashAlignment:
72
+ Enabled: false
73
+
74
+ Layout/SpaceAroundOperators:
75
+ Enabled: false
76
+
77
+ Layout/SpaceInsideArrayLiteralBrackets:
78
+ EnforcedStyle: no_space
79
+ EnforcedStyleForEmptyBrackets: no_space
80
+
81
+ Layout/SpaceInsideHashLiteralBraces:
82
+ EnforcedStyle: no_space
83
+
84
+ # == Lint ==
85
+
86
+ Lint/ConstantDefinitionInBlock:
87
+ Enabled: false
88
+
89
+ Lint/NestedMethodDefinition:
90
+ Exclude:
91
+ - test/micro/struct/instance_method_test.rb
92
+
93
+ # == Naming ==
94
+
95
+ Naming/ClassAndModuleCamelCase:
96
+ Enabled: false
97
+
98
+ Naming/FileName:
99
+ Exclude:
100
+ - lib/u-struct.rb
101
+
102
+ Naming/MethodParameterName:
103
+ Exclude:
104
+ - examples/**/*.rb
105
+
106
+ Naming/RescuedExceptionsVariableName:
107
+ PreferredName: exception
108
+
109
+ # == Metrics ==
110
+
111
+ Metrics/AbcSize:
112
+ Exclude:
113
+ - test/**/*.rb
114
+
115
+ Metrics/MethodLength:
116
+ Exclude:
117
+ - test/**/*.rb
118
+
119
+ Metrics/ClassLength:
120
+ Exclude:
121
+ - test/**/*.rb
122
+
123
+ # == Minitest ==
124
+
125
+ Minitest/AssertWithExpectedArgument:
126
+ Enabled: false
127
+
128
+ Minitest/MultipleAssertions:
129
+ Max: 21
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,10 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2022-01-27 11:53:52 UTC using RuboCop version 1.25.0.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ Gemspec/RequireMFA:
10
+ Enabled: false
data/.tool-versions ADDED
@@ -0,0 +1 @@
1
+ ruby 3.1.0