rails-tc 0.1.0 → 0.2.0

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: cd4de7e0ef2d8cbd984d8f7a39bd4485b5ea8b7175febb6b7e6598499b5943e8
4
- data.tar.gz: 555d73a67397784495b845ccf3a6ddc28c99f6e0f3aaaf568215f2438f266f09
3
+ metadata.gz: be9c4fc548db0968f0ffe1ac6bcada40ef09e640669f65cb3ee673a4974e50ed
4
+ data.tar.gz: afc4590e886932467d2ca26872fa505107fbc1021c7a93ca6e07bc5f0ee99ccd
5
5
  SHA512:
6
- metadata.gz: beddf0019850cc3dcff8dd0704bce524712ad90c816db5b2fae450ada4cccb3422e6fc9fb3a88134efb2edff999feeab76f2a68608893dd0730debd0501357bc
7
- data.tar.gz: 51ed684438b851e66c18ffba0b14924a4e1fa5f24595850a86c407cc216cbcf279643a67ead893ce0836fe4af1de9199dda37afcf8a2de83c7c07dbbc774f00a
6
+ metadata.gz: 4616319701e78fab303235bce1d91136caf25344864ee35277b518cff45a695d903af344f08cf9e3f08d4296f2af0a6644e5a73652b1f851d1d72c8e3ba0679c
7
+ data.tar.gz: a49d1c748c196096e6a132e9f5705bfd3bbbcd691f37a9029a11fe9c2bbc953a592ecf41ec2a58e589110ee2dd7180c80c64fcb2a0109035fe1b0d0fb0d8b97e
data/.gitignore CHANGED
@@ -7,5 +7,6 @@
7
7
  /spec/reports/
8
8
  /tmp/
9
9
 
10
+ .idea
10
11
  # rspec failure tracking
11
12
  .rspec_status
data/Gemfile.lock ADDED
@@ -0,0 +1,55 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ rails-tc (0.2.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ ast (2.4.2)
10
+ diff-lcs (1.5.0)
11
+ parallel (1.21.0)
12
+ parser (3.0.3.2)
13
+ ast (~> 2.4.1)
14
+ rainbow (3.0.0)
15
+ rake (13.0.6)
16
+ regexp_parser (2.2.0)
17
+ rexml (3.2.5)
18
+ rspec (3.10.0)
19
+ rspec-core (~> 3.10.0)
20
+ rspec-expectations (~> 3.10.0)
21
+ rspec-mocks (~> 3.10.0)
22
+ rspec-core (3.10.1)
23
+ rspec-support (~> 3.10.0)
24
+ rspec-expectations (3.10.1)
25
+ diff-lcs (>= 1.2.0, < 2.0)
26
+ rspec-support (~> 3.10.0)
27
+ rspec-mocks (3.10.2)
28
+ diff-lcs (>= 1.2.0, < 2.0)
29
+ rspec-support (~> 3.10.0)
30
+ rspec-support (3.10.3)
31
+ rubocop (1.24.0)
32
+ parallel (~> 1.10)
33
+ parser (>= 3.0.0.0)
34
+ rainbow (>= 2.2.2, < 4.0)
35
+ regexp_parser (>= 1.8, < 3.0)
36
+ rexml
37
+ rubocop-ast (>= 1.15.0, < 2.0)
38
+ ruby-progressbar (~> 1.7)
39
+ unicode-display_width (>= 1.4.0, < 3.0)
40
+ rubocop-ast (1.15.0)
41
+ parser (>= 3.0.1.1)
42
+ ruby-progressbar (1.11.0)
43
+ unicode-display_width (2.1.0)
44
+
45
+ PLATFORMS
46
+ x86_64-linux
47
+
48
+ DEPENDENCIES
49
+ rails-tc!
50
+ rake (~> 13.0)
51
+ rspec (~> 3.0)
52
+ rubocop (~> 1.7)
53
+
54
+ BUNDLED WITH
55
+ 2.2.25
data/README.md CHANGED
@@ -1,39 +1,55 @@
1
- # Rails::Tc
1
+ # rails-tc
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/rails/tc`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ This gem provides time checking for Rails projects using Stripe's sorbet and tapioca. It is meant to provide an easy and
4
+ automated way to set up time checking.
4
5
 
5
- TODO: Delete this and the text above, and describe your gem
6
+ # Installing
6
7
 
7
- ## Installation
8
-
9
- Add this line to your application's Gemfile:
8
+ Add the gem to your `Gemfile` by adding the line
10
9
 
11
10
  ```ruby
12
- gem 'rails-tc'
11
+ gem 'rails-tc', group: :development
13
12
  ```
14
13
 
15
- And then execute:
14
+ and run `bundle install`
16
15
 
17
- $ bundle install
16
+ **or** do both actions at once by running
18
17
 
19
- Or install it yourself as:
18
+ ```shell
19
+ bundle add rails-tc --group development
20
+ ```
20
21
 
21
- $ gem install rails-tc
22
+ # Usage
22
23
 
23
- ## Usage
24
+ ## Setup typing for the project
25
+ Once installed, run the following command once:
24
26
 
25
- TODO: Write usage instructions here
27
+ ```shell
28
+ rails tc:install
29
+ ```
26
30
 
27
- ## Development
31
+ This will:
32
+ * Add `sorbet` and `tapioca` as development dependencies
33
+ * Add `sorbet-runtime` as runtime dependency
34
+ * Initialize and setup sorbet
35
+ * Generate types for the current project using tapioco
36
+ * Patch rubocop config to disable `Style/AccessorGrouping`
28
37
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
38
+ ## Run the type checker
30
39
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
40
+ To check the project for type errors, run
41
+
42
+ ```shell
43
+ rails tc:check
44
+ ```
32
45
 
33
- ## Contributing
46
+ This will list all errors but excludes all errors from `*.rbi` files because there will be a lot of false positives and
47
+ from gems and known issues we cannot change anyway.
34
48
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/rails-tc.
49
+ ## Update rails-specific type information
36
50
 
37
- ## License
51
+ To update type information for url helpers and models, run:
38
52
 
39
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
53
+ ```shell
54
+ rails tc:generate
55
+ ```
@@ -12,6 +12,11 @@ namespace :tc do
12
12
  Rails::Tc::Rubocop.patch_configuration
13
13
  end
14
14
 
15
+ desc "Update rails-specific types"
16
+ task generate: :environment do
17
+ Rails::Tc::CommandRunner.generate
18
+ end
19
+
15
20
  desc "Check types in the project"
16
21
  task check: :environment do
17
22
  checker = Rails::Tc::TypeChecker.new([], ["*/**/*.rbi"])
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Rails
4
4
  module Tc
5
- VERSION = "0.1.0"
5
+ VERSION = "0.2.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-tc
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
  - Oskar Kirmis
@@ -19,12 +19,10 @@ extensions: []
19
19
  extra_rdoc_files: []
20
20
  files:
21
21
  - ".gitignore"
22
- - ".gitlab-ci.yml"
23
- - ".idea/workspace.xml"
24
- - ".rspec"
25
22
  - ".rubocop.yml"
26
23
  - CHANGELOG.md
27
24
  - Gemfile
25
+ - Gemfile.lock
28
26
  - LICENSE.txt
29
27
  - README.md
30
28
  - Rakefile
data/.gitlab-ci.yml DELETED
@@ -1,9 +0,0 @@
1
- image: ruby:3.0.2
2
-
3
- before_script:
4
- - gem install bundler -v 2.2.25
5
- - bundle install
6
-
7
- example_job:
8
- script:
9
- - bundle exec rake
data/.idea/workspace.xml DELETED
@@ -1,87 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ChangeListManager">
4
- <list default="true" id="70f1023d-93df-464d-ae60-42cd1388a1e4" name="Changes" comment="">
5
- <change afterPath="$PROJECT_DIR$/.gitignore" afterDir="false" />
6
- <change afterPath="$PROJECT_DIR$/.gitlab-ci.yml" afterDir="false" />
7
- <change afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
8
- <change afterPath="$PROJECT_DIR$/.rspec" afterDir="false" />
9
- <change afterPath="$PROJECT_DIR$/.rubocop.yml" afterDir="false" />
10
- <change afterPath="$PROJECT_DIR$/CHANGELOG.md" afterDir="false" />
11
- <change afterPath="$PROJECT_DIR$/Gemfile" afterDir="false" />
12
- <change afterPath="$PROJECT_DIR$/LICENSE.txt" afterDir="false" />
13
- <change afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
14
- <change afterPath="$PROJECT_DIR$/Rakefile" afterDir="false" />
15
- <change afterPath="$PROJECT_DIR$/bin/console" afterDir="false" />
16
- <change afterPath="$PROJECT_DIR$/bin/setup" afterDir="false" />
17
- <change afterPath="$PROJECT_DIR$/lib/rails/tc.rb" afterDir="false" />
18
- <change afterPath="$PROJECT_DIR$/lib/rails/tc/command_runner.rb" afterDir="false" />
19
- <change afterPath="$PROJECT_DIR$/lib/rails/tc/railtie.rb" afterDir="false" />
20
- <change afterPath="$PROJECT_DIR$/lib/rails/tc/rubocop.rb" afterDir="false" />
21
- <change afterPath="$PROJECT_DIR$/lib/rails/tc/tasks/tc.rake" afterDir="false" />
22
- <change afterPath="$PROJECT_DIR$/lib/rails/tc/type_checker.rb" afterDir="false" />
23
- <change afterPath="$PROJECT_DIR$/lib/rails/tc/type_checker_error.rb" afterDir="false" />
24
- <change afterPath="$PROJECT_DIR$/lib/rails/tc/version.rb" afterDir="false" />
25
- <change afterPath="$PROJECT_DIR$/rails-tc.gemspec" afterDir="false" />
26
- <change afterPath="$PROJECT_DIR$/spec/rails/tc_spec.rb" afterDir="false" />
27
- <change afterPath="$PROJECT_DIR$/spec/spec_helper.rb" afterDir="false" />
28
- </list>
29
- <option name="SHOW_DIALOG" value="false" />
30
- <option name="HIGHLIGHT_CONFLICTS" value="true" />
31
- <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
32
- <option name="LAST_RESOLUTION" value="IGNORE" />
33
- </component>
34
- <component name="FileTemplateManagerImpl">
35
- <option name="RECENT_TEMPLATES">
36
- <list>
37
- <option value="Ruby File" />
38
- </list>
39
- </option>
40
- </component>
41
- <component name="Git.Settings">
42
- <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
43
- </component>
44
- <component name="GitSEFilterConfiguration">
45
- <file-type-list>
46
- <filtered-out-file-type name="LOCAL_BRANCH" />
47
- <filtered-out-file-type name="REMOTE_BRANCH" />
48
- <filtered-out-file-type name="TAG" />
49
- <filtered-out-file-type name="COMMIT_BY_MESSAGE" />
50
- </file-type-list>
51
- </component>
52
- <component name="MarkdownSettingsMigration">
53
- <option name="stateVersion" value="1" />
54
- </component>
55
- <component name="ProjectId" id="22oxrhkAKjljfVppUYbrdhBm39d" />
56
- <component name="ProjectLevelVcsManager" settingsEditedManually="true" />
57
- <component name="ProjectViewState">
58
- <option name="hideEmptyMiddlePackages" value="true" />
59
- <option name="showLibraryContents" value="true" />
60
- </component>
61
- <component name="PropertiesComponent">
62
- <property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
63
- <property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
64
- <property name="WebServerToolWindowFactoryState" value="false" />
65
- <property name="last.edited.regexp" value=" * def (0.9)" />
66
- <property name="last_opened_file_path" value="$PROJECT_DIR$/../fa-x" />
67
- <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
68
- <property name="nodejs_npm_path_reset_for_default_project" value="true" />
69
- <property name="vue.rearranger.settings.migration" value="true" />
70
- </component>
71
- <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
72
- <component name="SpringUtil" SPRING_PRE_LOADER_OPTION="true" RAKE_SPRING_PRE_LOADER_OPTION="true" RAILS_SPRING_PRE_LOADER_OPTION="true" />
73
- <component name="TaskManager">
74
- <task active="true" id="Default" summary="Default task">
75
- <changelist id="70f1023d-93df-464d-ae60-42cd1388a1e4" name="Changes" comment="" />
76
- <created>1640517942267</created>
77
- <option name="number" value="Default" />
78
- <option name="presentableId" value="Default" />
79
- <updated>1640517942267</updated>
80
- <workItem from="1640517945803" duration="6297000" />
81
- </task>
82
- <servers />
83
- </component>
84
- <component name="TypeScriptGeneratedFilesManager">
85
- <option name="version" value="3" />
86
- </component>
87
- </project>
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper