dry-monads-sorbet 1.1.6 → 1.1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +14 -22
  3. data/.gitignore +3 -1
  4. data/CHANGELOG.md +4 -0
  5. data/Gemfile +1 -6
  6. data/bin/tapioca +29 -0
  7. data/dry-monads-sorbet.gemspec +3 -2
  8. data/lib/bundled_rbi/dry-monads.rbi +3 -3
  9. data/lib/dry/monads/sorbet/version.rb +1 -1
  10. data/nix/sources.json +14 -0
  11. data/nix/sources.nix +174 -0
  12. data/run_ci.sh +7 -0
  13. data/shell.nix +20 -0
  14. data/sorbet/config +6 -0
  15. data/sorbet/rbi/gems/{ast.rbi → ast@2.4.2.rbi} +28 -22
  16. data/sorbet/rbi/gems/byebug@11.1.3.rbi +1568 -0
  17. data/sorbet/rbi/gems/coderay@1.1.3.rbi +1005 -0
  18. data/sorbet/rbi/gems/concurrent-ruby@1.1.9.rbi +915 -0
  19. data/sorbet/rbi/gems/diff-lcs@1.4.4.rbi +8 -0
  20. data/sorbet/rbi/gems/docile@1.4.0.rbi +54 -0
  21. data/sorbet/rbi/gems/dry-core@0.7.1.rbi +92 -0
  22. data/sorbet/rbi/gems/dry-equalizer@0.3.0.rbi +28 -0
  23. data/sorbet/rbi/gems/dry-monads@1.4.0.rbi +697 -0
  24. data/sorbet/rbi/gems/ffaker@2.20.0.rbi +3171 -0
  25. data/sorbet/rbi/gems/method_source@1.0.0.rbi +72 -0
  26. data/sorbet/rbi/gems/parallel@1.21.0.rbi +113 -0
  27. data/sorbet/rbi/gems/parser@3.0.2.0.rbi +1189 -0
  28. data/sorbet/rbi/gems/pry-byebug@3.8.0.rbi +458 -0
  29. data/sorbet/rbi/gems/{pry.rbi → pry@0.14.1.rbi} +2264 -1727
  30. data/sorbet/rbi/gems/{rainbow.rbi → rainbow@3.0.0.rbi} +90 -55
  31. data/sorbet/rbi/gems/{rake.rbi → rake@13.0.6.rbi} +578 -431
  32. data/sorbet/rbi/gems/rb-fsevent@0.11.0.rbi +8 -0
  33. data/sorbet/rbi/gems/rb-readline@0.5.5.rbi +884 -0
  34. data/sorbet/rbi/gems/rbi@0.0.6.rbi +1405 -0
  35. data/sorbet/rbi/gems/regexp_parser@2.1.1.rbi +1120 -0
  36. data/sorbet/rbi/gems/{rexml.rbi → rexml@3.2.5.rbi} +564 -497
  37. data/sorbet/rbi/gems/{rspec-core.rbi → rspec-core@3.10.1.rbi} +2345 -1766
  38. data/sorbet/rbi/gems/{rspec-expectations.rbi → rspec-expectations@3.10.1.rbi} +1149 -698
  39. data/sorbet/rbi/gems/{rspec-mocks.rbi → rspec-mocks@3.10.2.rbi} +1299 -936
  40. data/sorbet/rbi/gems/rspec-support@3.10.2.rbi +509 -0
  41. data/sorbet/rbi/gems/rspec@3.10.0.rbi +38 -0
  42. data/sorbet/rbi/gems/rubocop-ast@1.12.0.rbi +1938 -0
  43. data/sorbet/rbi/gems/rubocop-rspec@2.5.0.rbi +1786 -0
  44. data/sorbet/rbi/gems/rubocop@1.22.1.rbi +13252 -0
  45. data/sorbet/rbi/gems/ruby-progressbar@1.11.0.rbi +405 -0
  46. data/sorbet/rbi/gems/simplecov-html@0.12.3.rbi +89 -0
  47. data/sorbet/rbi/gems/simplecov@0.21.2.rbi +577 -0
  48. data/sorbet/rbi/gems/simplecov_json_formatter@0.1.3.rbi +8 -0
  49. data/sorbet/rbi/gems/spoom@1.1.5.rbi +1241 -0
  50. data/sorbet/rbi/gems/stackprof@0.2.17.rbi +98 -0
  51. data/sorbet/rbi/gems/tapioca@0.5.2.rbi +949 -0
  52. data/sorbet/rbi/gems/thor@1.1.0.rbi +839 -0
  53. data/sorbet/rbi/gems/unicode-display_width@2.1.0.rbi +26 -0
  54. data/sorbet/rbi/gems/unparser@0.6.0.rbi +8 -0
  55. data/sorbet/tapioca/require.rb +4 -0
  56. metadata +65 -68
  57. data/.ruby-version +0 -1
  58. data/sorbet/rbi/gems/activesupport.rbi +0 -1722
  59. data/sorbet/rbi/gems/byebug.rbi +0 -1041
  60. data/sorbet/rbi/gems/coderay.rbi +0 -285
  61. data/sorbet/rbi/gems/concurrent-ruby.rbi +0 -1586
  62. data/sorbet/rbi/gems/docile.rbi +0 -32
  63. data/sorbet/rbi/gems/dry-core.rbi +0 -38
  64. data/sorbet/rbi/gems/dry-equalizer.rbi +0 -26
  65. data/sorbet/rbi/gems/dry-monads.rbi +0 -510
  66. data/sorbet/rbi/gems/em-websocket.rbi +0 -225
  67. data/sorbet/rbi/gems/eventmachine.rbi +0 -489
  68. data/sorbet/rbi/gems/ffaker.rbi +0 -60
  69. data/sorbet/rbi/gems/guard.rbi +0 -397
  70. data/sorbet/rbi/gems/http_parser.rb.rbi +0 -37
  71. data/sorbet/rbi/gems/i18n.rbi +0 -133
  72. data/sorbet/rbi/gems/kwalify.rbi +0 -340
  73. data/sorbet/rbi/gems/listen.rbi +0 -324
  74. data/sorbet/rbi/gems/lumberjack.rbi +0 -300
  75. data/sorbet/rbi/gems/method_source.rbi +0 -64
  76. data/sorbet/rbi/gems/multi_json.rbi +0 -62
  77. data/sorbet/rbi/gems/nenv.rbi +0 -60
  78. data/sorbet/rbi/gems/notiffany.rbi +0 -215
  79. data/sorbet/rbi/gems/parallel.rbi +0 -82
  80. data/sorbet/rbi/gems/parser.rbi +0 -1846
  81. data/sorbet/rbi/gems/pry-byebug.rbi +0 -155
  82. data/sorbet/rbi/gems/rb-fsevent.rbi +0 -31
  83. data/sorbet/rbi/gems/rb-readline.rbi +0 -767
  84. data/sorbet/rbi/gems/reek.rbi +0 -1027
  85. data/sorbet/rbi/gems/regexp_parser.rbi +0 -913
  86. data/sorbet/rbi/gems/rspec-support.rbi +0 -280
  87. data/sorbet/rbi/gems/rspec.rbi +0 -15
  88. data/sorbet/rbi/gems/rubocop-ast.rbi +0 -1053
  89. data/sorbet/rbi/gems/rubocop-rspec.rbi +0 -937
  90. data/sorbet/rbi/gems/rubocop.rbi +0 -6841
  91. data/sorbet/rbi/gems/ruby-progressbar.rbi +0 -305
  92. data/sorbet/rbi/gems/shellany.rbi +0 -29
  93. data/sorbet/rbi/gems/shoulda-matchers.rbi +0 -1848
  94. data/sorbet/rbi/gems/simplecov-html.rbi +0 -35
  95. data/sorbet/rbi/gems/simplecov.rbi +0 -361
  96. data/sorbet/rbi/gems/sqlite3.rbi +0 -354
  97. data/sorbet/rbi/gems/stackprof.rbi +0 -52
  98. data/sorbet/rbi/gems/thor.rbi +0 -32
  99. data/sorbet/rbi/gems/thread_safe.rbi +0 -82
  100. data/sorbet/rbi/gems/timecop.rbi +0 -98
  101. data/sorbet/rbi/gems/tzinfo.rbi +0 -406
  102. data/sorbet/rbi/gems/unicode-display_width.rbi +0 -17
  103. data/sorbet/rbi/hidden-definitions/errors.txt +0 -7267
  104. data/sorbet/rbi/hidden-definitions/hidden.rbi +0 -14661
  105. data/sorbet/rbi/sorbet-typed/lib/activesupport/>=6.0.0.rc1/activesupport.rbi +0 -23
  106. data/sorbet/rbi/sorbet-typed/lib/activesupport/all/activesupport.rbi +0 -1431
  107. data/sorbet/rbi/sorbet-typed/lib/minitest/all/minitest.rbi +0 -108
  108. data/sorbet/rbi/sorbet-typed/lib/rainbow/all/rainbow.rbi +0 -276
  109. data/sorbet/rbi/sorbet-typed/lib/rubocop/~>0.85/rubocop.rbi +0 -2072
  110. data/sorbet/rbi/sorbet-typed/lib/rubocop-rspec/~>1.39/rubocop-rspec.rbi +0 -398
  111. data/sorbet/rbi/todo.rbi +0 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7c166f0c33bed0bf911ff8e70324f05f6c06b4b6bc1e58dc3f0f2a572ed8444b
4
- data.tar.gz: 3caf9e75a4de9ae4f85ab73280520bb3f77a3a0a80bf67a2c0499286236de8f4
3
+ metadata.gz: 9cf3f9a8c8d624101fc2ae7b06e4cab59b1cd956f10c2bee945dbb4937062a0b
4
+ data.tar.gz: 88bc955e267eb1a2822953ef49d9a6ae93f2f6d11dc5db929e946eafcac6cd8a
5
5
  SHA512:
6
- metadata.gz: 6abba0a4195a1adbb8823a0a8ee56f128cdca6dc1cf3a87c48100b285215426d2b45b463e32269ece03d68f785ca6e7ff656f38ea5bcd5ce1af85bbc91a38d1a
7
- data.tar.gz: 06a475b9ecba2f93b8eac52124eb89bd7d46a841c4bb19e33bc39b7cbbfad3948a83a6b8872738a3f0bf6e68350372cd01b072bfc3ce933d20a6077411c4bb18
6
+ metadata.gz: 87f58bb422e18f2822cc0db272c019035c4f07644915edd486b848061ac733367f93a464225da76cad51d026e5e0cd4b1ca6a3312b69c7357dc1d3f6baa6e6a0
7
+ data.tar.gz: ce3873adea336fb69e309224e6d506b46c59518f0c25c6bc6b2a09d42054e524547372934d0179add97b4067562881655c67ce85db8e1feb0739e04476010a18
@@ -15,36 +15,28 @@ jobs:
15
15
  shell: bash
16
16
  run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
17
17
  id: extract_branch
18
- - name: Install Linux dependencies
19
- run: sudo apt-get update -qq && sudo apt-get install -y libsqlite3-dev
20
- - name: Set up Ruby
21
- uses: ruby/setup-ruby@v1
22
- with:
23
- ruby-version: 2.6.6
24
18
  - name: Cache gems
25
19
  uses: actions/cache@v2
26
20
  with:
27
21
  path: vendor/bundle
28
- key: "${{ runner.OS }}-gem-cache-${{ hashFiles('**/dry-monads-sorbet.gemspec')
22
+ key: "${{ runner.OS }}-gem-cache-${{ hashFiles('**/*.gemspec')
29
23
  }}"
30
24
  restore-keys: "${{ runner.OS }}-gem-cache-\n"
31
- - name: Install bundler
32
- run: (bundler -v | grep "2.1.4") || gem install bundler:2.1.4
33
- - name: Remove metrics from bundled gems
34
- run: bundle config set without 'metrics'
35
- - name: Install gems
36
- run: bundle install --jobs $(nproc) --retry 3 --path vendor/bundle
37
- - name: Create cache directory
38
- run: mkdir -p tmp/cache
39
- - name: Typecheck with Sorbet
40
- run: bundle exec srb tc . --ignore=/vendor
41
- - name: Run RSpec test suite
42
- run: bundle exec rspec spec
25
+ - uses: "cachix/install-nix-action@8d6d5e949675fbadb765c6b1a975047fa5f09b27"
26
+ with:
27
+ extra_nix_config: |
28
+ post-build-hook = /etc/nix/upload-to-cache.sh
29
+ substituters = https://cache.nixos.org/
30
+ trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
31
+ nix_path: nixpkgs=channel:nixos-21.05
32
+ - name: Run CI through nix-shell
43
33
  env:
44
- METRICS: '1'
34
+ GEMFURY_DEPLOY_TOKEN: ${{ secrets.GEMFURY_DEPLOY_TOKEN }}
35
+ run: nix-shell --run "chmod 755 ./run_ci.sh && ./run_ci.sh"
45
36
  - name: Post to Slack if build fails
46
- if: failure() && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/stable')
47
- uses: pullreminders/slack-action@master
37
+ if: failure() && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
38
+ || github.ref == 'refs/heads/stable')
39
+ uses: pullreminders/slack-action@a5a262c896a1cc80dcbae59ba95513e2dfb21439
48
40
  env:
49
41
  SLACK_BOT_TOKEN: "${{ secrets.SLACK_BOT_TOKEN }}"
50
42
  with:
data/.gitignore CHANGED
@@ -12,9 +12,11 @@
12
12
  # rspec failure tracking
13
13
  .rspec_status
14
14
 
15
- /shell.nix
15
+
16
16
  /tags
17
17
 
18
18
  *.log
19
19
 
20
20
  .ruby-gemset
21
+ .direnv
22
+ .envrc
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ 1.1.7
2
+
3
+ * Update to method signatures
4
+
1
5
  1.1.6
2
6
 
3
7
  * Fix bundled RBI being incompatible with recent Sorbet releases due to `params()` and invalid use of `sealed!`.
data/Gemfile CHANGED
@@ -4,19 +4,14 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
 
6
6
  group :development, :test do
7
- gem 'guard-livereload', require: false
8
- gem 'guard-rspec'
9
7
  gem 'pry-byebug'
10
8
  gem 'rb-fsevent', require: false
11
9
  gem 'rb-readline'
12
- gem 'reek'
13
10
  gem 'rspec'
14
11
  gem 'rubocop-rspec'
15
12
  gem 'rubocop'
16
- gem 'shoulda-matchers', require: false
17
- gem 'sqlite3'
18
13
  gem 'stackprof'
19
- gem 'timecop'
14
+ gem 'tapioca'
20
15
  end
21
16
 
22
17
  group :test do
data/bin/tapioca ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'tapioca' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require "pathname"
12
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
+ Pathname.new(__FILE__).realpath)
14
+
15
+ bundle_binstub = File.expand_path("../bundle", __FILE__)
16
+
17
+ if File.file?(bundle_binstub)
18
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19
+ load(bundle_binstub)
20
+ else
21
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
+ end
24
+ end
25
+
26
+ require "rubygems"
27
+ require "bundler/setup"
28
+
29
+ load Gem.bin_path("tapioca", "tapioca")
@@ -28,9 +28,10 @@ Gem::Specification.new do |spec|
28
28
  You can use the included "dry_monads_sorbet:update_rbi" Rake task to do this.
29
29
  TEXT
30
30
 
31
- spec.add_dependency 'sorbet'
32
- spec.add_dependency 'sorbet-runtime'
31
+ spec.add_dependency 'dry-equalizer'
33
32
  spec.add_dependency 'dry-monads'
33
+ spec.add_dependency 'sorbet-runtime'
34
+ spec.add_dependency 'sorbet'
34
35
 
35
36
  spec.add_development_dependency 'bundler'
36
37
  spec.add_development_dependency 'pry'
@@ -132,8 +132,8 @@ class Dry::Monads::Maybe::None < Dry::Monads::Maybe
132
132
  def deconstruct; end
133
133
  def eql?(other); end
134
134
  def hash; end
135
- sig {void}
136
- def initialize(); end
135
+ sig {params(trace: T.untyped).void}
136
+ def initialize(trace = T.unsafe(nil)); end
137
137
  def inspect; end
138
138
  def maybe(*arg0); end
139
139
  def or(*args); end
@@ -551,7 +551,7 @@ module Dry::Monads::Do
551
551
  def self.for(*methods); end
552
552
  def self.halt(result); end
553
553
  def self.included(base); end
554
- def self.wrap_method(target, method_name); end
554
+ def self.wrap_method(target, method, visibility); end
555
555
  extend Dry::Monads::Do::Mixin
556
556
  end
557
557
  module Dry::Monads::Do::Mixin
@@ -4,7 +4,7 @@
4
4
  module Dry
5
5
  module Monads
6
6
  module Sorbet
7
- VERSION = '1.1.6'
7
+ VERSION = '1.1.7'
8
8
  end
9
9
  end
10
10
  end
data/nix/sources.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "nixpkgs": {
3
+ "branch": "nixos-21.05",
4
+ "description": "Nix packages collection",
5
+ "homepage": "https://github.com/NixOS/nixpkgs",
6
+ "owner": "NixOS",
7
+ "repo": "nixpkgs",
8
+ "rev": "e85f0175e3effe9ba191d66c09e8f1b7d6362d5e",
9
+ "sha256": "1qr2hmymbzwj8jrz6smcgc04scgwp2v5070x22k4fvh261g1n4zw",
10
+ "type": "tarball",
11
+ "url": "https://github.com/NixOS/nixpkgs/archive/e85f0175e3effe9ba191d66c09e8f1b7d6362d5e.tar.gz",
12
+ "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
13
+ }
14
+ }
data/nix/sources.nix ADDED
@@ -0,0 +1,174 @@
1
+ # This file has been generated by Niv.
2
+
3
+ let
4
+
5
+ #
6
+ # The fetchers. fetch_<type> fetches specs of type <type>.
7
+ #
8
+
9
+ fetch_file = pkgs: name: spec:
10
+ let
11
+ name' = sanitizeName name + "-src";
12
+ in
13
+ if spec.builtin or true then
14
+ builtins_fetchurl { inherit (spec) url sha256; name = name'; }
15
+ else
16
+ pkgs.fetchurl { inherit (spec) url sha256; name = name'; };
17
+
18
+ fetch_tarball = pkgs: name: spec:
19
+ let
20
+ name' = sanitizeName name + "-src";
21
+ in
22
+ if spec.builtin or true then
23
+ builtins_fetchTarball { name = name'; inherit (spec) url sha256; }
24
+ else
25
+ pkgs.fetchzip { name = name'; inherit (spec) url sha256; };
26
+
27
+ fetch_git = name: spec:
28
+ let
29
+ ref =
30
+ if spec ? ref then spec.ref else
31
+ if spec ? branch then "refs/heads/${spec.branch}" else
32
+ if spec ? tag then "refs/tags/${spec.tag}" else
33
+ abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!";
34
+ in
35
+ builtins.fetchGit { url = spec.repo; inherit (spec) rev; inherit ref; };
36
+
37
+ fetch_local = spec: spec.path;
38
+
39
+ fetch_builtin-tarball = name: throw
40
+ ''[${name}] The niv type "builtin-tarball" is deprecated. You should instead use `builtin = true`.
41
+ $ niv modify ${name} -a type=tarball -a builtin=true'';
42
+
43
+ fetch_builtin-url = name: throw
44
+ ''[${name}] The niv type "builtin-url" will soon be deprecated. You should instead use `builtin = true`.
45
+ $ niv modify ${name} -a type=file -a builtin=true'';
46
+
47
+ #
48
+ # Various helpers
49
+ #
50
+
51
+ # https://github.com/NixOS/nixpkgs/pull/83241/files#diff-c6f540a4f3bfa4b0e8b6bafd4cd54e8bR695
52
+ sanitizeName = name:
53
+ (
54
+ concatMapStrings (s: if builtins.isList s then "-" else s)
55
+ (
56
+ builtins.split "[^[:alnum:]+._?=-]+"
57
+ ((x: builtins.elemAt (builtins.match "\\.*(.*)" x) 0) name)
58
+ )
59
+ );
60
+
61
+ # The set of packages used when specs are fetched using non-builtins.
62
+ mkPkgs = sources: system:
63
+ let
64
+ sourcesNixpkgs =
65
+ import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) { inherit system; };
66
+ hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath;
67
+ hasThisAsNixpkgsPath = <nixpkgs> == ./.;
68
+ in
69
+ if builtins.hasAttr "nixpkgs" sources
70
+ then sourcesNixpkgs
71
+ else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then
72
+ import <nixpkgs> {}
73
+ else
74
+ abort
75
+ ''
76
+ Please specify either <nixpkgs> (through -I or NIX_PATH=nixpkgs=...) or
77
+ add a package called "nixpkgs" to your sources.json.
78
+ '';
79
+
80
+ # The actual fetching function.
81
+ fetch = pkgs: name: spec:
82
+
83
+ if ! builtins.hasAttr "type" spec then
84
+ abort "ERROR: niv spec ${name} does not have a 'type' attribute"
85
+ else if spec.type == "file" then fetch_file pkgs name spec
86
+ else if spec.type == "tarball" then fetch_tarball pkgs name spec
87
+ else if spec.type == "git" then fetch_git name spec
88
+ else if spec.type == "local" then fetch_local spec
89
+ else if spec.type == "builtin-tarball" then fetch_builtin-tarball name
90
+ else if spec.type == "builtin-url" then fetch_builtin-url name
91
+ else
92
+ abort "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}";
93
+
94
+ # If the environment variable NIV_OVERRIDE_${name} is set, then use
95
+ # the path directly as opposed to the fetched source.
96
+ replace = name: drv:
97
+ let
98
+ saneName = stringAsChars (c: if isNull (builtins.match "[a-zA-Z0-9]" c) then "_" else c) name;
99
+ ersatz = builtins.getEnv "NIV_OVERRIDE_${saneName}";
100
+ in
101
+ if ersatz == "" then drv else
102
+ # this turns the string into an actual Nix path (for both absolute and
103
+ # relative paths)
104
+ if builtins.substring 0 1 ersatz == "/" then /. + ersatz else /. + builtins.getEnv "PWD" + "/${ersatz}";
105
+
106
+ # Ports of functions for older nix versions
107
+
108
+ # a Nix version of mapAttrs if the built-in doesn't exist
109
+ mapAttrs = builtins.mapAttrs or (
110
+ f: set: with builtins;
111
+ listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set))
112
+ );
113
+
114
+ # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295
115
+ range = first: last: if first > last then [] else builtins.genList (n: first + n) (last - first + 1);
116
+
117
+ # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257
118
+ stringToCharacters = s: map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1));
119
+
120
+ # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L269
121
+ stringAsChars = f: s: concatStrings (map f (stringToCharacters s));
122
+ concatMapStrings = f: list: concatStrings (map f list);
123
+ concatStrings = builtins.concatStringsSep "";
124
+
125
+ # https://github.com/NixOS/nixpkgs/blob/8a9f58a375c401b96da862d969f66429def1d118/lib/attrsets.nix#L331
126
+ optionalAttrs = cond: as: if cond then as else {};
127
+
128
+ # fetchTarball version that is compatible between all the versions of Nix
129
+ builtins_fetchTarball = { url, name ? null, sha256 }@attrs:
130
+ let
131
+ inherit (builtins) lessThan nixVersion fetchTarball;
132
+ in
133
+ if lessThan nixVersion "1.12" then
134
+ fetchTarball ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; }))
135
+ else
136
+ fetchTarball attrs;
137
+
138
+ # fetchurl version that is compatible between all the versions of Nix
139
+ builtins_fetchurl = { url, name ? null, sha256 }@attrs:
140
+ let
141
+ inherit (builtins) lessThan nixVersion fetchurl;
142
+ in
143
+ if lessThan nixVersion "1.12" then
144
+ fetchurl ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; }))
145
+ else
146
+ fetchurl attrs;
147
+
148
+ # Create the final "sources" from the config
149
+ mkSources = config:
150
+ mapAttrs (
151
+ name: spec:
152
+ if builtins.hasAttr "outPath" spec
153
+ then abort
154
+ "The values in sources.json should not have an 'outPath' attribute"
155
+ else
156
+ spec // { outPath = replace name (fetch config.pkgs name spec); }
157
+ ) config.sources;
158
+
159
+ # The "config" used by the fetchers
160
+ mkConfig =
161
+ { sourcesFile ? if builtins.pathExists ./sources.json then ./sources.json else null
162
+ , sources ? if isNull sourcesFile then {} else builtins.fromJSON (builtins.readFile sourcesFile)
163
+ , system ? builtins.currentSystem
164
+ , pkgs ? mkPkgs sources system
165
+ }: rec {
166
+ # The sources, i.e. the attribute set of spec name to spec
167
+ inherit sources;
168
+
169
+ # The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers
170
+ inherit pkgs;
171
+ };
172
+
173
+ in
174
+ mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); }
data/run_ci.sh ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env bash
2
+ set -e
3
+ rm -f Gemfile.lock
4
+ bundle config gem.fury.io $GEMFURY_DEPLOY_TOKEN
5
+ bundle install
6
+ bundle exec srb tc
7
+ METRICS=1 bundle exec rspec spec
data/shell.nix ADDED
@@ -0,0 +1,20 @@
1
+ { sources ? import ./nix/sources.nix }:
2
+ let
3
+ nixpkgs = import sources.nixpkgs { };
4
+ in
5
+ nixpkgs.mkShell {
6
+ name = "bellroy-gem-env";
7
+ buildInputs = with nixpkgs; [
8
+ bundler
9
+ libnotify
10
+ niv
11
+ pkg-config
12
+ readline
13
+ ruby_2_7
14
+ zlib
15
+ ]
16
+ ++ (if stdenv.hostPlatform.isDarwin then [ libiconv darwin.apple_sdk.frameworks.CoreServices ] else [ ]);
17
+ shellHook = ''
18
+ bundle config --local path "$PWD/vendor/bundle"
19
+ '';
20
+ }
data/sorbet/config CHANGED
@@ -2,3 +2,9 @@
2
2
  .
3
3
  --ignore
4
4
  /lib/dry/monads/sorbet.rb
5
+ --ignore
6
+ /lib/dry-monads-sorbet/railtie.rb
7
+ --ignore
8
+ vendor
9
+ --ignore
10
+ /sorbet/rbi/gems/rb-readline@0.5.5.rbi
@@ -1,48 +1,54 @@
1
- # This file is autogenerated. Do not edit it by hand. Regenerate it with:
2
- # srb rbi gems
3
-
4
- # typed: strict
5
- #
6
- # If you would like to make changes to this file, great! Please create the gem's shim here:
7
- #
8
- # https://github.com/sorbet/sorbet-typed/new/master?filename=lib/ast/all/ast.rbi
9
- #
10
- # ast-2.4.1
11
-
12
- module AST
13
- end
1
+ # DO NOT EDIT MANUALLY
2
+ # This is an autogenerated file for types exported from the `ast` gem.
3
+ # Please instead update this file by running `bin/tapioca gem ast`.
4
+
5
+ # typed: true
6
+
7
+ module AST; end
8
+
14
9
  class AST::Node
10
+ def initialize(type, children = T.unsafe(nil), properties = T.unsafe(nil)); end
11
+
15
12
  def +(array); end
16
13
  def <<(element); end
17
14
  def ==(other); end
18
15
  def append(element); end
19
- def assign_properties(properties); end
20
16
  def children; end
21
17
  def clone; end
22
18
  def concat(array); end
19
+ def deconstruct; end
23
20
  def dup; end
24
21
  def eql?(other); end
25
- def fancy_type; end
26
22
  def hash; end
27
- def initialize(type, children = nil, properties = nil); end
28
- def inspect(indent = nil); end
29
- def original_dup; end
23
+ def inspect(indent = T.unsafe(nil)); end
30
24
  def to_a; end
31
25
  def to_ast; end
32
- def to_s(indent = nil); end
33
- def to_sexp(indent = nil); end
26
+ def to_s(indent = T.unsafe(nil)); end
27
+ def to_sexp(indent = T.unsafe(nil)); end
34
28
  def to_sexp_array; end
35
29
  def type; end
36
- def updated(type = nil, children = nil, properties = nil); end
30
+ def updated(type = T.unsafe(nil), children = T.unsafe(nil), properties = T.unsafe(nil)); end
31
+
32
+ protected
33
+
34
+ def assign_properties(properties); end
35
+ def fancy_type; end
36
+
37
+ private
38
+
39
+ def original_dup; end
37
40
  end
41
+
38
42
  class AST::Processor
39
- include AST::Processor::Mixin
43
+ include ::AST::Processor::Mixin
40
44
  end
45
+
41
46
  module AST::Processor::Mixin
42
47
  def handler_missing(node); end
43
48
  def process(node); end
44
49
  def process_all(nodes); end
45
50
  end
51
+
46
52
  module AST::Sexp
47
53
  def s(type, *children); end
48
54
  end