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

Prefer GitHub Actions. #304

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
45 changes: 45 additions & 0 deletions .github/workflows/development.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Development

on: [push, pull_request]

jobs:
test:
name: ${{matrix.ruby}} on ${{matrix.os}}
runs-on: ${{matrix.os}}-latest
continue-on-error: ${{matrix.experimental}}

strategy:
matrix:
os:
- ubuntu
- macos

ruby:
- "2.7"
- "3.0"
- "3.1"

experimental: [false]
env: [""]

include:
- os: ubuntu
ruby: truffleruby
experimental: true
- os: ubuntu
ruby: jruby
experimental: true
- os: ubuntu
ruby: head
experimental: true

steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{matrix.ruby}}
bundler-cache: true

- name: Run tests
timeout-minutes: 5
run: ${{matrix.env}} bundle exec rake
35 changes: 0 additions & 35 deletions .travis.yml

This file was deleted.

3 changes: 0 additions & 3 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ lib/core/facets/hash/count.rb
lib/core/facets/hash/data.rb
lib/core/facets/hash/dearray_values.rb
lib/core/facets/hash/deep_merge.rb
lib/core/facets/hash/deep_rekey.rb
lib/core/facets/hash/delete.rb
lib/core/facets/hash/delete_at.rb
lib/core/facets/hash/delete_unless.rb
Expand All @@ -213,7 +212,6 @@ lib/core/facets/hash/op_push.rb
lib/core/facets/hash/op_sub.rb
lib/core/facets/hash/recurse.rb
lib/core/facets/hash/recursively.rb
lib/core/facets/hash/rekey.rb
lib/core/facets/hash/replace_each.rb
lib/core/facets/hash/revalue.rb
lib/core/facets/hash/reverse_merge.rb
Expand Down Expand Up @@ -978,7 +976,6 @@ test/core/hash/test_op_push.rb
test/core/hash/test_op_sub.rb
test/core/hash/test_recurse.rb
test/core/hash/test_recursively.rb
test/core/hash/test_rekey.rb
test/core/hash/test_replace_each.rb
test/core/hash/test_revalue.rb
test/core/hash/test_reverse_merge.rb
Expand Down
8 changes: 0 additions & 8 deletions demo/standard/02_cloneable.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ Try #dup.
b = a.dup
b.bar_id.refute == a.bar_id

a.taint
b = a.dup
b.assert.tainted?

a.freeze
b = a.dup
b.refute.frozen?
Expand All @@ -36,10 +32,6 @@ Note try #clone.
b = a.clone
b.bar_id.refute == a.bar_id

a.taint
b = a.dup
b.assert.tainted?

a.freeze
b = a.clone
b.assert.frozen?
Expand Down
1 change: 0 additions & 1 deletion lib/core/facets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
require 'facets/denumerable.rb'
require 'facets/dir.rb'
require 'facets/enumerable.rb'
require 'facets/enumerator.rb'
require 'facets/exception.rb'
require 'facets/file.rb'
require 'facets/filetest.rb'
Expand Down
2 changes: 1 addition & 1 deletion lib/core/facets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ paths:
- lib/standard
name: facets
title: Ruby Facets
version: 3.1.0
version: 4.0.0
summary: The orginal well curated collection of extension methods for Ruby.
slogan: ALL YOUR BASE ARE BELONG TO RUBY!
description: Facets is the premier collection of extension methods for the Ruby programming
Expand Down
10 changes: 8 additions & 2 deletions lib/core/facets/binding/caller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,22 @@ def caller( skip=0 )
eval("caller(#{skip})")
end

# Returns the call stack, same format as Kernel#caller_locations()
#
def caller_locations( skip=0 )
eval("caller_locations(#{skip})")
end

# Return the line number on which the binding was created.
#
def __LINE__
Kernel.eval("__LINE__", self)
self.source_location[1]
end

# Returns file name in which the binding was created.
#
def __FILE__
Kernel.eval("__FILE__", self)
self.source_location[0]
end

# Return the directory of the file in which the binding was created.
Expand Down
3 changes: 0 additions & 3 deletions lib/core/facets/denumerable.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
require 'facets/enumerator'
#require 'facets/enumerable/take'

# Classes which include Denumerable will get versions of map,
# select, and so on, which return a Denumerator, so that they
# work horizontally without creating intermediate arrays.
Expand Down
2 changes: 0 additions & 2 deletions lib/core/facets/enumerable/each_by.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
require 'facets/enumerator'

module Enumerable

# Iterate through slices. If slice +steps+ is not
Expand Down
33 changes: 0 additions & 33 deletions lib/core/facets/enumerable/filter.rb

This file was deleted.

1 change: 0 additions & 1 deletion lib/core/facets/enumerable/hashify.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#require 'facets/enumerator'
require 'facets/hash/dearray_values'
require 'facets/enumerable/value_by'

Expand Down
77 changes: 2 additions & 75 deletions lib/core/facets/enumerator.rb
Original file line number Diff line number Diff line change
@@ -1,75 +1,2 @@
if RUBY_VERSION < '1.9'

require 'enumerator'

# for Ruby 1.8 -> 1.9 transition
Enumerator = Enumerable::Enumerator unless defined?(::Enumerator)

class Enumerator

private

alias :old_initialize :initialize

# Provides the ruby-1.9 block form of Enumerator, where you can write:
#
# obj = Enumerator.new do |yielder|
# # ...
# yielder.yield(data) # or: yielder << data
# # ...
# end
#
# When obj.each is called, the block is run once. It should call
# yielder.yield with each item it wishes to generate.
#
# Example:
#
# fib = Enumerator.new { |y|
# a = b = 1
# loop {
# y << a
# a, b = b, a + b
# }
# }
#
# fib.take(10) #=> [1, 1, 2, 3, 5, 8, 13, 21, 34, 55]
#
def initialize(*args, &block)
if block
@body = block
old_initialize(self, :_start)
else
old_initialize(*args)
end
end

def _start(*args,&receiver) #:nodoc:
@body.call(Yielder.new(&receiver), *args)
end

# Wrapper to allow yielder.yield(output) or yielder << output
# in the same way as ruby-1.9
#
# TODO: Why can't Yielder take a block instead of a proc argument?

class Yielder #:nodoc:
def initialize(&proc)
@proc = proc
end
def yield(*args)
@proc[*args]
end
alias :<< :yield
end

end

end

path = __FILE__.chomp('.rb')
base = File.basename(path)
Dir[File.join(path, '*.rb')].each do |lib|
#require lib # why is this so much slower?
require "facets/#{base}/#{File.basename(lib)}"
end

require_relative 'enumerator/fx'
require_relative 'enumerator/lazy/squeeze'
13 changes: 0 additions & 13 deletions lib/core/facets/enumerator/fx.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,4 @@ def fx
end
end

# Old 1.8 version (left temporarily for reference)
#
# def fx
# Functor.new(&method(:fx_send).to_proc)
# end
#
# private
#
# def fx_send(op, *a, &b)
# map{ |e| e.send(op, *a, &b) }
# end

end

2 changes: 0 additions & 2 deletions lib/core/facets/essentials.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@
#require_relative 'hash/data'
require_relative 'hash/delete_values'
require_relative 'hash/except'
require_relative 'hash/rekey'
require_relative 'hash/revalue'
require_relative 'hash/slice'

### Proc
Expand Down
54 changes: 0 additions & 54 deletions lib/core/facets/hash/deep_rekey.rb

This file was deleted.

Loading