defi 1.1.5 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 238e14dcedd8405b6c07e38ac76221ee3312b473985c9ce4de3323542667e962
4
- data.tar.gz: 839fdb886247d8f35af842a7b1b3e1854e5d52ddd4b5a050b466f41285dafe9c
3
+ metadata.gz: 17965d0bae882875e8860597f6d6b7cc147837dad2a8622e505cf95aa9e9e752
4
+ data.tar.gz: 4500fc7d680aa05caa158c22f0dd9cd71f2f014be3b13e79cdbd488a82fdf278
5
5
  SHA512:
6
- metadata.gz: 299bc2c941232744fc9e0e8648b4ac48f2505c0a98249d3e38184037f1e5b1bb03c1ed17324388a9e4f58c71f606a2ae7481b35d99b34be43a63b3241b83eaf5
7
- data.tar.gz: 679c23e1b6d4411af7f63d6c04511d567a21c64c1dc628a25dd979d604b10b6ab2e731abeb3af18f6a87497d927d2027af5c947d409b7056d65938b5ff66c3b7
6
+ metadata.gz: 1e52fe5aaab97e0ebb05aa93f765f35690eb3e9460f736a2fed8737ac495b5636379a7e325307aed74e9394d59b160376b094e7105b89bbe334db3e24a360e01
7
+ data.tar.gz: 138f72b7a0aef3d48ed73f49383767cfb863aaa6230eb94ddf30f7e1431c15ffa7ddb48b8f5bd5df2d80512af1d235c368003c1216c8995bc9788e503e91aafb
data/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # Defi
2
2
 
3
- [![Build Status](https://travis-ci.org/fixrb/defi.svg?branch=master)][travis]
3
+ [![Build Status](https://api.travis-ci.org/fixrb/defi.svg?branch=master)][travis]
4
4
  [![Code Climate](https://codeclimate.com/github/fixrb/defi/badges/gpa.svg)][codeclimate]
5
5
  [![Gem Version](https://badge.fury.io/rb/defi.svg)][gem]
6
- [![Inline docs](http://inch-ci.org/github/fixrb/defi.svg?branch=master)][inchpages]
7
- [![Documentation](http://img.shields.io/:yard-docs-38c800.svg)][rubydoc]
6
+ [![Inline docs](https://inch-ci.org/github/fixrb/defi.svg?branch=master)][inchpages]
7
+ [![Documentation](https://img.shields.io/:yard-docs-38c800.svg)][rubydoc]
8
8
 
9
9
  > Challenge library.
10
10
 
@@ -16,8 +16,8 @@
16
16
  ## Rubies
17
17
 
18
18
  * [MRI](https://www.ruby-lang.org/)
19
- * [Rubinius](http://rubini.us/)
20
- * [JRuby](http://jruby.org/)
19
+ * [Rubinius](https://rubinius.com/)
20
+ * [JRuby](https://www.jruby.org/)
21
21
 
22
22
  ## Installation
23
23
 
@@ -37,16 +37,24 @@ Or install it yourself as:
37
37
 
38
38
  ## Usage
39
39
 
40
- Let's challenge `6` to be multiplied by seven:
40
+ Let's multiply by `7` the number `6`:
41
41
 
42
42
  ```ruby
43
- Defi.send(:*, 7).to(6) # => 42
43
+ Defi.send(:*, 7).to(6).call # => 42
44
44
  ```
45
45
 
46
- Now, let's challenge `"foo"` to respond to a `boom` method:
46
+ Now, let's challenge "`foo`" with `boom` method:
47
47
 
48
48
  ```ruby
49
- Defi.send(:boom).to('foo') # NoMethodError: undefined method `boom' for "foo":String
49
+ Defi.send(:boom).to('foo').call # NoMethodError: undefined method `boom' for "foo":String
50
+ ```
51
+
52
+ Let's challenge "`hello world`" with `gsub!` in isolation:
53
+
54
+ ```ruby
55
+ some_text = 'hello world'
56
+ Defi.send(:gsub!, 'world', 'Alice').to!(some_text).call # => "hello Alice"
57
+ some_text # => "hello world"
50
58
  ```
51
59
 
52
60
  ## Security
@@ -64,7 +72,7 @@ example:
64
72
 
65
73
  ## Versioning
66
74
 
67
- __Defi__ follows [Semantic Versioning 2.0](http://semver.org/).
75
+ __Defi__ follows [Semantic Versioning 2.0](https://semver.org/).
68
76
 
69
77
  ## Contributing
70
78
 
@@ -81,12 +89,15 @@ See `LICENSE.md` file.
81
89
  [gem]: https://rubygems.org/gems/defi
82
90
  [travis]: https://travis-ci.org/fixrb/defi
83
91
  [codeclimate]: https://codeclimate.com/github/fixrb/defi
84
- [gemnasium]: https://gemnasium.com/fixrb/defi
85
- [inchpages]: http://inch-ci.org/github/fixrb/defi
86
- [rubydoc]: http://rubydoc.info/gems/defi/frames
92
+ [inchpages]: https://inch-ci.org/github/fixrb/defi
93
+ [rubydoc]: https://rubydoc.info/gems/defi/frames
87
94
 
88
95
  ***
89
96
 
90
- This project is sponsored by:
97
+ <p>
98
+ This project is sponsored by:
91
99
 
92
- [![Sashite](https://sashite.com/img/sashite.png)](https://sashite.com/)
100
+ <a href="https://sashite.com/"><img
101
+ src="https://github.com/fixrb/defi/raw/bdf560d73e7ff2306f6f4a071ced36b383cbf35d/img/sashite.png"
102
+ alt="Sashite" /></a>
103
+ </p>
@@ -12,12 +12,14 @@ module Defi
12
12
  # @example The challenge
13
13
  # send(:foo) # => #<Defi::Challenge:0x007f96a40925f8 @method=:foo, @args=[]>
14
14
  #
15
- # @param method [#to_sym] A public method.
16
- # @param args [Array] A list of arguments.
15
+ # @param method [#to_sym] The method to send to an object.
16
+ # @param args [Array] Any arguments of the method.
17
+ # @param opts [Hash] Any keyword arguments of the method.
18
+ # @param block [Proc] Any block argument of the method.
17
19
  #
18
20
  # @return [Challenge] The challenge instance.
19
- def self.send(method, *args)
20
- Challenge.new(method, *args)
21
+ def self.send(method, *args, **opts, &block)
22
+ Challenge.new(method, *args, **opts, &block)
21
23
  end
22
24
  end
23
25
 
@@ -1,29 +1,46 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'aw'
4
+
3
5
  module Defi
4
6
  # This class contains a challenge to apply against an object.
5
7
  #
6
8
  # @api private
7
9
  #
8
- class Challenge
10
+ class Challenge < ::BasicObject
9
11
  # Initialize the challenge class.
10
12
  #
11
13
  # @api private
12
14
  #
13
15
  # @param method [#to_sym] The method to send to an object.
14
- # @param args [Array] The arguments of the method.
15
- def initialize(method, *args)
16
+ # @param args [Array] Any arguments of the method.
17
+ # @param opts [Hash] Any keyword arguments of the method.
18
+ # @param block [Proc] Any block argument of the method.
19
+ def initialize(method, *args, **opts, &block)
16
20
  @method = method.to_sym
17
21
  @args = args
22
+ @opts = opts
23
+ @block = block
18
24
  end
19
25
 
20
26
  # @api public
21
27
  #
22
28
  # @param object [#object_id] The object to challenge.
23
29
  #
24
- # @return [#object_id] The actual value, or a raised exception.
30
+ # @return [Defi::Value] The actual value, to raise or to return.
25
31
  def to(object)
26
- object.public_send(@method, *@args)
32
+ Value.new { object.public_send(@method, *@args, **@opts, &@block) }
33
+ end
34
+
35
+ # @api public
36
+ #
37
+ # @param object [#object_id] The object to challenge in code isolation.
38
+ #
39
+ # @return [Defi::Value] The actual value, to raise or to return.
40
+ #
41
+ # @see to
42
+ def to!(object)
43
+ ::Aw.fork! { to(object) }
27
44
  end
28
45
 
29
46
  # Properties of the challenge.
@@ -34,8 +51,56 @@ module Defi
34
51
  def to_h
35
52
  {
36
53
  method: @method,
37
- args: @args
54
+ args: @args,
55
+ opts: @opts,
56
+ block: @block
38
57
  }
39
58
  end
59
+
60
+ # String of the challenge.
61
+ #
62
+ # @api public
63
+ #
64
+ # @return [String] The string representation of the challenge.
65
+ def to_s
66
+ string = ".#{@method}"
67
+
68
+ return string if @args.empty? && @opts.empty? && @block.nil?
69
+
70
+ stringified_args = @args.inspect[1..-2]
71
+ stringified_opts = @opts.inspect[1..-2]
72
+ stringified_block = '<Proc>' unless @block.nil?
73
+
74
+ string += '('
75
+
76
+ stringified_items = []
77
+
78
+ stringified_items << stringified_args unless @args.empty?
79
+ stringified_items << stringified_opts unless @opts.empty?
80
+ stringified_items << stringified_block unless @block.nil?
81
+
82
+ string + stringified_items.join(', ') + ')'
83
+ end
84
+
85
+ # A string containing a human-readable representation of the challenge.
86
+ #
87
+ # @api public
88
+ #
89
+ # @return [String] The human-readable representation of the challenge.
90
+ def inspect
91
+ inspected_method = @method.inspect
92
+ inspected_args = @args.inspect
93
+ inspected_opts = @opts.inspect
94
+ inspected_block = @block.nil? ? 'nil' : '<Proc>'
95
+
96
+ 'Defi(' \
97
+ "method: #{inspected_method}, " \
98
+ "args: #{ inspected_args }, " \
99
+ "opts: #{ inspected_opts }, " \
100
+ "block: #{ inspected_block }" \
101
+ ')'
102
+ end
40
103
  end
41
104
  end
105
+
106
+ require_relative 'value'
@@ -0,0 +1,79 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Defi
4
+ # This class contains an object that returned or raised during the initialize.
5
+ #
6
+ # @api private
7
+ #
8
+ class Value
9
+ # @return [#object_id] The returned or the raised object.
10
+ attr_reader :object
11
+
12
+ # Initialize the value class.
13
+ #
14
+ # @api public
15
+ #
16
+ # @param block [Proc] The block of code to execute.
17
+ # rubocop:disable Lint/RescueException
18
+ def initialize(&block)
19
+ @object = block.call
20
+ @raised = false
21
+ rescue ::Exception => e
22
+ @object = e
23
+ @raised = true
24
+ end
25
+ # rubocop:enable Lint/RescueException
26
+
27
+ # Raise or return the value.
28
+ #
29
+ # @return [#object_id] Raised exception or returned object.
30
+ def call
31
+ raise object if raised?
32
+
33
+ object
34
+ end
35
+
36
+ # @api public
37
+ #
38
+ # @return [Boolean] The value was raised (or returned)?
39
+ def raised?
40
+ @raised
41
+ end
42
+
43
+ # Properties of the value.
44
+ #
45
+ # @api public
46
+ #
47
+ # @return [Hash] The properties of the value.
48
+ def to_h
49
+ {
50
+ raised: raised?,
51
+ object: object
52
+ }
53
+ end
54
+
55
+ # String of the value.
56
+ #
57
+ # @api public
58
+ #
59
+ # @return [String] The string representation of the value.
60
+ def to_s
61
+ string = if raised?
62
+ 'raise'
63
+ else
64
+ 'return'
65
+ end
66
+
67
+ "#{string} #{object}"
68
+ end
69
+
70
+ # A string containing a human-readable representation of the value.
71
+ #
72
+ # @api public
73
+ #
74
+ # @return [String] The human-readable representation of the value.
75
+ def inspect
76
+ "Value(object: #{object}, raised: #{raised?})"
77
+ end
78
+ end
79
+ end
metadata CHANGED
@@ -1,85 +1,99 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: defi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cyril Kato
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-12 00:00:00.000000000 Z
11
+ date: 2019-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: aw
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.1.10
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.1.10
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: bundler
15
29
  requirement: !ruby/object:Gem::Requirement
16
30
  requirements:
17
31
  - - "~>"
18
32
  - !ruby/object:Gem::Version
19
- version: '2.0'
33
+ version: '2.1'
20
34
  type: :development
21
35
  prerelease: false
22
36
  version_requirements: !ruby/object:Gem::Requirement
23
37
  requirements:
24
38
  - - "~>"
25
39
  - !ruby/object:Gem::Version
26
- version: '2.0'
40
+ version: '2.1'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: rake
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
45
  - - "~>"
32
46
  - !ruby/object:Gem::Version
33
- version: '12.3'
47
+ version: '13.0'
34
48
  type: :development
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
52
  - - "~>"
39
53
  - !ruby/object:Gem::Version
40
- version: '12.3'
54
+ version: '13.0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: rubocop
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
- - - "~>"
59
+ - - ">="
46
60
  - !ruby/object:Gem::Version
47
- version: '0.67'
61
+ version: '0'
48
62
  type: :development
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
- - - "~>"
66
+ - - ">="
53
67
  - !ruby/object:Gem::Version
54
- version: '0.67'
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
- name: simplecov
70
+ name: rubocop-performance
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
- - - "~>"
73
+ - - ">="
60
74
  - !ruby/object:Gem::Version
61
- version: '0.16'
75
+ version: '0'
62
76
  type: :development
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
- - - "~>"
80
+ - - ">="
67
81
  - !ruby/object:Gem::Version
68
- version: '0.16'
82
+ version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
- name: spectus
84
+ name: simplecov
71
85
  requirement: !ruby/object:Gem::Requirement
72
86
  requirements:
73
87
  - - "~>"
74
88
  - !ruby/object:Gem::Version
75
- version: '3.0'
89
+ version: '0.17'
76
90
  type: :development
77
91
  prerelease: false
78
92
  version_requirements: !ruby/object:Gem::Requirement
79
93
  requirements:
80
94
  - - "~>"
81
95
  - !ruby/object:Gem::Version
82
- version: '3.0'
96
+ version: '0.17'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: yard
85
99
  requirement: !ruby/object:Gem::Requirement
@@ -95,35 +109,16 @@ dependencies:
95
109
  - !ruby/object:Gem::Version
96
110
  version: '0.9'
97
111
  description: Challenge library.
98
- email:
99
- - contact@cyril.email
112
+ email: contact@cyril.email
100
113
  executables: []
101
114
  extensions: []
102
115
  extra_rdoc_files: []
103
116
  files:
104
- - ".gitignore"
105
- - ".rubocop.yml"
106
- - ".rubocop_todo.yml"
107
- - ".travis.yml"
108
- - CODE_OF_CONDUCT.md
109
- - Gemfile
110
117
  - LICENSE.md
111
118
  - README.md
112
- - Rakefile
113
- - VERSION.semver
114
- - bin/console
115
- - bin/setup
116
- - checksum/defi-0.1.0.gem.sha512
117
- - checksum/defi-1.0.0.gem.sha512
118
- - checksum/defi-1.1.0.gem.sha512
119
- - checksum/defi-1.1.1.gem.sha512
120
- - checksum/defi-1.1.2.gem.sha512
121
- - checksum/defi-1.1.3.gem.sha512
122
- - checksum/defi-1.1.4.gem.sha512
123
- - defi.gemspec
124
119
  - lib/defi.rb
125
120
  - lib/defi/challenge.rb
126
- - pkg_checksum
121
+ - lib/defi/value.rb
127
122
  homepage: https://github.com/fixrb/defi
128
123
  licenses:
129
124
  - MIT
@@ -143,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
143
138
  - !ruby/object:Gem::Version
144
139
  version: '0'
145
140
  requirements: []
146
- rubygems_version: 3.0.1
141
+ rubygems_version: 3.1.2
147
142
  signing_key:
148
143
  specification_version: 4
149
144
  summary: Challenge library.
data/.gitignore DELETED
@@ -1,10 +0,0 @@
1
- /.bundle/
2
- /.ruby-version
3
- /.yardoc
4
- /Gemfile.lock
5
- /_yardoc/
6
- /coverage/
7
- /doc/
8
- /pkg/
9
- /spec/reports/
10
- /tmp/
@@ -1 +0,0 @@
1
- inherit_from: .rubocop_todo.yml
@@ -1,12 +0,0 @@
1
- # This configuration was generated by
2
- # `rubocop --auto-gen-config`
3
- # on 2018-08-26 22:52:05 +0200 using RuboCop version 0.58.2.
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
- # Offense count: 1
10
- Style/MixinUsage:
11
- Exclude:
12
- - 'test/test_defi.rb'
@@ -1,28 +0,0 @@
1
- language: ruby
2
- sudo: false
3
- cache: bundler
4
- before_install:
5
- - gem install bundler
6
- script:
7
- - bundle exec rubocop
8
- - bundle exec rake test
9
- rvm:
10
- - 2.3.3
11
- - 2.4.0
12
- - 2.5.0
13
- - 2.6.1
14
- - ruby-head
15
- - jruby-head
16
- - rbx-3
17
- matrix:
18
- allow_failures:
19
- - rvm: ruby-head
20
- - rvm: jruby-head
21
- - rvm: rbx-3
22
- notifications:
23
- webhooks:
24
- urls:
25
- - https://webhooks.gitter.im/e/a44b19cc5cf6db25fa87
26
- on_success: change
27
- on_failure: always
28
- on_start: never
@@ -1,13 +0,0 @@
1
- # Contributor Code of Conduct
2
-
3
- As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
-
5
- We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
-
7
- Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
-
9
- Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
-
11
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
-
13
- This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile DELETED
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- gemspec
data/Rakefile DELETED
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'bundler/gem_tasks'
4
- require 'rake/testtask'
5
- require 'rubocop/rake_task'
6
-
7
- RuboCop::RakeTask.new
8
-
9
- Rake::TestTask.new do |t|
10
- t.verbose = true
11
- t.warning = true
12
- end
13
-
14
- namespace :test do
15
- task :coverage do
16
- ENV['COVERAGE'] = 'true'
17
- Rake::Task['test'].invoke
18
- end
19
- end
20
-
21
- task(:doc_stats) { ruby '-S yard stats' }
22
- task default: %i[test doc_stats rubocop]
@@ -1 +0,0 @@
1
- 1.1.5
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require 'bundler/setup'
5
- require 'defi'
6
-
7
- require 'irb'
8
- IRB.start
data/bin/setup DELETED
@@ -1,6 +0,0 @@
1
- #!/bin/bash
2
-
3
- set -euo pipefail
4
- IFS=$'\n\t'
5
-
6
- bundle install
@@ -1 +0,0 @@
1
- a1bf7c28d86ef4f412a9294b4fc40d613ffdb6bc3a0410144d927fa95ba718e1ce7ac20e21845e99860529ad91f231e6436c4730e2ee1f6a13519476be207545
@@ -1 +0,0 @@
1
- c30380a253c932bbff42a36611466f2b7d59e6a1d9578a4989e7b2cfd4078cf9d64e452b0eaa055c5ab88be4816d3f366d7aa705d29bb54e2db9f75d21f36cf7
@@ -1 +0,0 @@
1
- 3b9fea31dc30e80b1002d4989c7bfde2f78ad5ace812de13e05902097a85d81ba2d41fdeacfd1b99329513defab3243a74fb557bdc1bfa2cc8b35c30e4c7a074
@@ -1 +0,0 @@
1
- 70f4feffaac82872d62f7875a1273204119e868f101beecbaabd8ee90414a24224edada97c6351c5250c2c0aa4a3e70c9c23be04a98376396cd20bbd930d45b2
@@ -1 +0,0 @@
1
- 0d075e154c799ad24a8921266f042731cfcf32bd7308b22aa88fce7e552d49693be39595a66177df3b3f16776f4b4d76bb62887122af60865718ba5b050616a9
@@ -1 +0,0 @@
1
- 5a72d6ae695508de8f650a813313a589b8f60940b0a702aac8f1674a0ad2965c1232023100f1ea58d0227ba37dfb52cf40c5ef34184bfeeba79fe1342c641ca2
@@ -1 +0,0 @@
1
- 4d07dfc4a08dd053d718b3d092a1e368d396d4325a5b392927fe8d5c7feba2687b78001f42046b303c78bc5afc805f6bcc824807c38be329b0162f563b68cb7c
@@ -1,25 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- Gem::Specification.new do |spec|
4
- spec.name = 'defi'
5
- spec.version = File.read('VERSION.semver').chomp
6
- spec.authors = ['Cyril Kato']
7
- spec.email = ['contact@cyril.email']
8
-
9
- spec.summary = 'Challenge library.'
10
- spec.description = 'Challenge library.'
11
- spec.homepage = 'https://github.com/fixrb/defi'
12
- spec.license = 'MIT'
13
-
14
- spec.files =
15
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^test/}) }
16
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
17
- spec.require_paths = ['lib']
18
-
19
- spec.add_development_dependency 'bundler', '~> 2.0'
20
- spec.add_development_dependency 'rake', '~> 12.3'
21
- spec.add_development_dependency 'rubocop', '~> 0.67'
22
- spec.add_development_dependency 'simplecov', '~> 0.16'
23
- spec.add_development_dependency 'spectus', '~> 3.0'
24
- spec.add_development_dependency 'yard', '~> 0.9'
25
- end
@@ -1,12 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require 'digest/sha2'
5
-
6
- gemname = :defi
7
- ARGV[0] = File.read('VERSION.semver').chomp if ARGV[0].nil?
8
- built_gem_path = "pkg/#{gemname}-#{ARGV[0]}.gem"
9
- checksum = Digest::SHA512.new.hexdigest(File.read(built_gem_path))
10
- checksum_path = "checksum/#{gemname}-#{ARGV[0]}.gem.sha512"
11
-
12
- File.open(checksum_path, 'w') { |f| f.write("#{checksum}\n") }