Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "add: version 2" #2

Merged
merged 1 commit into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions .github/workflows/ci.yml

This file was deleted.

7 changes: 3 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
proc_eval (2.0.0)
proc_evaluate (1.0.0)

GEM
remote: https://rubygems.org/
Expand All @@ -10,13 +10,12 @@ GEM
rake (13.0.6)

PLATFORMS
x86_64-darwin-21
x86_64-linux

DEPENDENCIES
minitest (~> 5.0)
proc_eval!
proc_evaluate!
rake (~> 13.0)

BUNDLED WITH
2.4.8
2.3.14
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ProcEval
# ProcEvaluate

This ruby gem adds an `evaulate` method to Proc and Object instances through the use of [Refinements][1].

Expand Down Expand Up @@ -44,19 +44,19 @@ Because this gem makes use of keyword parameters and refinements, it is only com

## Usage

In your `Gemfile` add `gem 'proc_eval'`.
In your `Gemfile` add `gem 'proc_evaluate'`.

In your codebase add `require 'proc_eval'`.
In your codebase add `require 'proc_evaluate'`.

The refinement methods in the gem can be used by including `using ProcEval` in the file, **class** definition, or **module** definition in which you wish to use the [refinement][1].
The refinement methods in the gem can be used by including `using ProcEvaluate` in the file, **class** definition, or **module** definition in which you wish to use the [refinement][1].

### Class and Module usage

The refinement methods can be activated for use within a specific Class or Module.

```ruby
class ProcEvalClassExamples
using ProcEval
class ProcEvaluateClassExamples
using ProcEvaluate

def example1
a = ->(a) { a }
Expand All @@ -79,14 +79,14 @@ class ProcEvalClassExamples
end
end

e = ProcEvalClassExamples.new
e = ProcEvaluateClassExamples.new
e.example1 # "hello"
e.example2 # [1, 2, 3, 4, nil, nil, nil]
e.example3 # "Im a proc!!!"
e.example4 # "im a value!!!"

module ProcEvalModuleExamples
using ProcEval
module ProcEvaluateModuleExamples
using ProcEvaluate
extend self

def example1
Expand All @@ -110,17 +110,17 @@ module ProcEvalModuleExamples
end
end

ProcEvalModuleExamples.example1 # "hello"
ProcEvalModuleExamples.example2 # [1, 2, 3, 4, nil, nil, nil]
ProcEvalModuleExamples.example3 # "Im a proc!!!"
ProcEvalModuleExamples.example4 # "im a value!!!"
ProcEvaluateModuleExamples.example1 # "hello"
ProcEvaluateModuleExamples.example2 # [1, 2, 3, 4, nil, nil, nil]
ProcEvaluateModuleExamples.example3 # "Im a proc!!!"
ProcEvaluateModuleExamples.example4 # "im a value!!!"
```

Another example showing a different pattern of usage:

```ruby
class Example
using ProcEval
using ProcEvaluate

def initialize(value)
@value = value
Expand Down Expand Up @@ -165,7 +165,7 @@ To test the example, place the code into a file and run with the command `ruby e
```ruby
# example.rb

using ProcEval # activate the refinements for the current file
using ProcEvaluate # activate the refinements for the current file

proc = proc {|a, b, c| [a, b, c] }
proc.evaluate() # [nil, nil, nil]
Expand Down
3 changes: 0 additions & 3 deletions lib/proc_eval/version.rb

This file was deleted.

4 changes: 2 additions & 2 deletions lib/proc_eval.rb → lib/proc_evaluate.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module ProcEval
module ProcEvaluate

refine Object do
def evaluate(*args, **options)
Expand Down Expand Up @@ -59,4 +59,4 @@ def evaluate(*args, **options)
end # refine Proc
end

require 'proc_eval/version'
require 'proc_evaluate/version'
3 changes: 3 additions & 0 deletions lib/proc_evaluate/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module ProcEvaluate
VERSION = '1.0.0'
end
14 changes: 7 additions & 7 deletions proc_eval.gemspec → proc_evaluate.gemspec
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
require_relative 'lib/proc_eval/version.rb'
require_relative 'lib/proc_evaluate/version.rb'

Gem::Specification.new do |spec|
spec.name = 'proc_eval'
spec.version = ProcEval::VERSION
spec.name = 'proc_evaluate'
spec.version = ProcEvaluate::VERSION
spec.authors = ['Brent Jacobs', 'br3nt']
spec.homepage = 'https://github.com/reeganviljoen/proc_eval'
spec.required_ruby_version = '>= 2.7'
spec.homepage = 'https://github.com/br3nt/proc_evaluate'
spec.required_ruby_version = '>= 2.0'
spec.summary = 'Allow evaluation of variables, procs, and lambdas with the same level of flexibility.'
spec.description = <<-DESC
Adds an `evaulate` refinement method to Proc and Object instances.
Expand All @@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
spec.licenses = ['MIT']

spec.files = [
'lib/proc_eval.rb',
'lib/proc_eval/version.rb'
'lib/proc_evaluate.rb',
'lib/proc_evaluate/version.rb'
]
end
10 changes: 5 additions & 5 deletions test/test_proc_eval.rb → test/test_proc_evaluate.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require 'minitest/autorun'
require 'proc_eval'
require 'proc_evaluate'

class ProcEvalClassTest < Minitest::Test
using ProcEval
class ProcEvaluateClassTest < Minitest::Test
using ProcEvaluate

def test_example1
lambda = ->(a) { a }
Expand Down Expand Up @@ -31,7 +31,7 @@ def test_example4
end

module TestModule
using ProcEval
using ProcEvaluate
extend self

def example1
Expand All @@ -55,7 +55,7 @@ def example4
end
end

class ProcEvalModuleTest < Minitest::Test
class ProcEvaluateModuleTest < Minitest::Test
def test_example1
value = TestModule.example1
assert_equal value, 'hello'
Expand Down