Skip to content

Commit

Permalink
github-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
grosser committed Nov 6, 2021
1 parent bac7fe4 commit 79ae934
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 33 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/actions.yml
@@ -0,0 +1,23 @@
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
test:
runs-on: ubuntu-latest
env:
BUNDLE_DEPLOYMENT: "false" # do not fail test when bumping release without bundling
strategy:
matrix:
ruby: [ '2.5', '2.6', '2.7', '3.0' ] # lowest must match ruby version in gemspec
task: [ 'default' ]
name: ${{ matrix.ruby }} rake ${{ matrix.task }}
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- run: bundle exec rake
13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

25 changes: 13 additions & 12 deletions Gemfile.lock
Expand Up @@ -6,20 +6,21 @@ PATH
GEM
remote: https://rubygems.org/
specs:
bump (0.5.0)
diff-lcs (1.2.5)
rake (10.3.2)
rspec (2.14.1)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
rspec-core (2.14.8)
rspec-expectations (2.14.5)
bump (0.10.0)
diff-lcs (1.4.4)
rake (13.0.6)
rspec (2.99.0)
rspec-core (~> 2.99.0)
rspec-expectations (~> 2.99.0)
rspec-mocks (~> 2.99.0)
rspec-core (2.99.2)
rspec-expectations (2.99.2)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.14.6)
rspec-mocks (2.99.4)

PLATFORMS
ruby
x86_64-darwin-19
x86_64-linux

DEPENDENCIES
bump
Expand All @@ -28,4 +29,4 @@ DEPENDENCIES
rspec (~> 2)

BUNDLED WITH
1.11.2
2.2.16
12 changes: 6 additions & 6 deletions Readme.md
Expand Up @@ -8,8 +8,8 @@ Pipeable Ruby - forget about grep / sed / awk / wc ... use pure, readable Ruby!
# select lines longer than five letters
ls -1 | pru 'size > 5'

# passthrough
ls -1 | pru self
# 2nd to last character
ls -1 | pru self[2..-1]


## Reduce - all lines as Array
Expand All @@ -20,8 +20,8 @@ Pipeable Ruby - forget about grep / sed / awk / wc ... use pure, readable Ruby!
# are the more than five lines?
ls -1 | pru -r 'size > 5'

# passthrough
ls -1 | pru -r self
# get 2nd to last line
ls -1 | pru -r self[2..-1]


## Map and Reduce
Expand Down Expand Up @@ -117,8 +117,8 @@ Gemsets
Working with rvm / many gemsets -> only install once
(or use standalone binary)

rvm 1.9.2 exec gem install pru
echo 'alias pru="rvm 1.9.2 exec pru"' >> ~/.bash_profile
rvm 2.7.7 exec gem install pru
echo 'alias pru="rvm 2.7.2 exec pru"' >> ~/.bash_profile


[Contributors](http://github.com/grosser/pru/contributors)
Expand Down
4 changes: 2 additions & 2 deletions lib/pru/core_ext/array.rb
Expand Up @@ -11,8 +11,8 @@ def sum(method = nil, &block)
end
end unless method_defined?(:sum)

def mean(method = nil, &block)
sum(method, &block) / size.to_f
def mean(*args, &block)
sum(*args, &block) / size.to_f
end unless method_defined?(:mean)

def grouped
Expand Down
1 change: 1 addition & 0 deletions pru.gemspec
Expand Up @@ -10,4 +10,5 @@ Gem::Specification.new name, Pru::VERSION do |s|
s.files = `git ls-files lib`.split("\n")
s.license = "MIT"
s.executables = ["pru"]
s.required_ruby_version = '>= 2.5' # must match lowest in .github/workflows/actions.yml
end

0 comments on commit 79ae934

Please sign in to comment.