dry-monads-sorbet 1.1.0.pre.9 → 1.1.0.pre.10
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 +4 -4
- data/README.md +31 -1
- data/lib/dry-monads-sorbet.rb +1 -2
- data/lib/dry-monads-sorbet/Rakefile +2 -0
- data/lib/dry-monads-sorbet/railtie.rb +14 -0
- data/lib/dry/monads/sorbet/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 887467b4c0cba080ef636b8f957618b21f2ef65cc348c04393c5c4de17f9971a
|
4
|
+
data.tar.gz: 11784667d63e2998fa65f13bf462e777e37b6e1ad6c66b34b06bd3502431c5bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ee963c283b3a2fa20c87ce318cd4f910eada81892c9c0e1b3ae0e623308c33407729b323f6d3313f54c48de47e1160d333aab003aad6b375cbbb15452ab0198
|
7
|
+
data.tar.gz: 5e82ee22ee15faa265af53cc20e41898061056095fadbe67203dfb0905c51381c8322eef5f34767c46f64ac7eb10f2418ebf01674960780e6a43e05996c309ed
|
data/README.md
CHANGED
@@ -4,10 +4,40 @@
|
|
4
4
|
|
5
5
|
Sorbet type hints for Dry::Monads.
|
6
6
|
|
7
|
-
##
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add the gem to your Gemfile:
|
8
10
|
|
9
11
|
`gem 'dry-monads-sorbet'`
|
10
12
|
|
13
|
+
### Copying the bundled RBI
|
14
|
+
|
15
|
+
You must copy in the bundled `.rbi` file that this gem maintains to add type annotations to your own project to type check your usage of `Dry::Monads`.
|
16
|
+
|
17
|
+
Following in the footsteps of `sorbet-rails` we've extracted this process to a rake task.
|
18
|
+
|
19
|
+
### In a Rails project:
|
20
|
+
|
21
|
+
The rake task that copies the bundled `.rbi` files into your project should already be loaded. You can run it by entering:
|
22
|
+
|
23
|
+
```bash
|
24
|
+
bundle exec rake dry_monads_sorbet:update_rbi
|
25
|
+
```
|
26
|
+
|
27
|
+
### Outside of Rail's projects:
|
28
|
+
|
29
|
+
Include the `Rakefile` in your own projects `Rakefile` to get access to the rbi update command:
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
require 'dry-monads-sorbet'
|
33
|
+
|
34
|
+
spec = Gem::Specification.find_by_name 'dry-monads-sorbet'
|
35
|
+
rakefile = "#{spec.gem_dir}/lib/dry-monads-sorbet/Rakefile"
|
36
|
+
load rakefile
|
37
|
+
```
|
38
|
+
|
39
|
+
After including the Rakefile you should then have access to the task as described in the Rails project section.
|
40
|
+
|
11
41
|
## Usage
|
12
42
|
|
13
43
|
```ruby
|
data/lib/dry-monads-sorbet.rb
CHANGED
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rails'
|
4
|
+
|
5
|
+
module DryMonadsSorbet
|
6
|
+
class Railtie < Rails::Railtie
|
7
|
+
railtie_name 'dry-monads-sorbet'
|
8
|
+
|
9
|
+
rake_tasks do
|
10
|
+
path = File.expand_path(__dir__)
|
11
|
+
Dir.glob("#{path}/tasks/**/*.rake").each { |f| load f }
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dry-monads-sorbet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.0.pre.
|
4
|
+
version: 1.1.0.pre.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luke Worth
|
@@ -131,6 +131,8 @@ files:
|
|
131
131
|
- dry-monads-sorbet.gemspec
|
132
132
|
- lib/bundled_rbi/dry-monads.rbi
|
133
133
|
- lib/dry-monads-sorbet.rb
|
134
|
+
- lib/dry-monads-sorbet/Rakefile
|
135
|
+
- lib/dry-monads-sorbet/railtie.rb
|
134
136
|
- lib/dry-monads-sorbet/tasks/dry_monads_sorbet.rake
|
135
137
|
- lib/dry/monads/sorbet.rb
|
136
138
|
- lib/dry/monads/sorbet/version.rb
|