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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '09d726e9f2209db8a2e19cba3783f6d8fc1a437c898f22b6203e6b5880b72994'
4
- data.tar.gz: 3a13a252e5596c910dfe61bb991af4ea25faa8b46ee83b1131b9a3c54f1fbb50
3
+ metadata.gz: 887467b4c0cba080ef636b8f957618b21f2ef65cc348c04393c5c4de17f9971a
4
+ data.tar.gz: 11784667d63e2998fa65f13bf462e777e37b6e1ad6c66b34b06bd3502431c5bc
5
5
  SHA512:
6
- metadata.gz: c409d96569345ac1d1112b18e8d88f10922f79da1bbf4b54f17c459d097b6b3d2225b1ac08651e984c1f1a4551f224abccba8009d7451d26f08b210ed6da327e
7
- data.tar.gz: 90a4221c37ac5063b855fc94563cb2acda4cbe528bc3e52e064517ae830fd1ba969bf270f50e9598cde682566bf5881c0f2be62613ca7ce781ad86dda1d2bf98
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
- ## Install
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
@@ -2,5 +2,4 @@
2
2
 
3
3
  require 'dry/monads/all'
4
4
  require 'dry/monads/sorbet'
5
-
6
- Dir["dry-monads-sorbet/tasks/**/*.rake"].each { |ext| load ext } if defined?(Rake)
5
+ require 'dry-monads-sorbet/railtie' if defined?(Rails)
@@ -0,0 +1,2 @@
1
+ path = File.expand_path(__dir__)
2
+ Dir.glob("#{path}/tasks/**/*.rake").each { |f| import f }
@@ -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
@@ -3,7 +3,7 @@
3
3
  module Dry
4
4
  module Monads
5
5
  module Sorbet
6
- VERSION = '1.1.0.pre.9'
6
+ VERSION = '1.1.0.pre.10'
7
7
  end
8
8
  end
9
9
  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.9
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