Skip to content

Commit 2d8b125

Browse files
authored
Merge pull request #34 from dblock/danger
Replaced Travis-CI with Github Actions, added Danger.
2 parents 8792ca1 + 8503dc3 commit 2d8b125

File tree

8 files changed

+101
-33
lines changed

8 files changed

+101
-33
lines changed

.github/workflows/danger.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: danger
3+
on:
4+
pull_request:
5+
types: [opened, reopened, edited, synchronize]
6+
jobs:
7+
danger:
8+
runs-on: ubuntu-20.04
9+
steps:
10+
- uses: actions/checkout@v1
11+
- name: Set up Ruby
12+
uses: ruby/setup-ruby@v1
13+
with:
14+
ruby-version: 2.6
15+
bundler-cache: true
16+
- name: Run Danger
17+
run: |
18+
# the personal token is public, this is ok, base64 encode to avoid tripping Github
19+
TOKEN=$(echo -n NWY1ZmM5MzEyMzNlYWY4OTZiOGU3MmI3MWQ3Mzk0MzgxMWE4OGVmYwo= | base64 --decode)
20+
DANGER_GITHUB_API_TOKEN=$TOKEN bundle exec danger --verbose

.github/workflows/test.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: test
3+
on: [push, pull_request]
4+
jobs:
5+
lint:
6+
name: RuboCop
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- name: Set up Ruby
11+
uses: ruby/setup-ruby@v1
12+
with:
13+
ruby-version: 2.7
14+
bundler-cache: true
15+
- name: Run RuboCop
16+
run: bundle exec rubocop
17+
test:
18+
runs-on: ubuntu-latest
19+
strategy:
20+
matrix:
21+
entry:
22+
- { ruby: 2.4, allowed-failure: false }
23+
- { ruby: 2.5, allowed-failure: false }
24+
- { ruby: 2.6, allowed-failure: false }
25+
- { ruby: 2.7, allowed-failure: false }
26+
- { ruby: 3.0, allowed-failure: true }
27+
- { ruby: ruby-head, allowed-failure: true }
28+
- { ruby: truffleruby-head, allowed-failure: true }
29+
- { ruby: jruby-head, allowed-failure: true }
30+
name: test (${{ matrix.entry.ruby }})
31+
steps:
32+
- uses: actions/checkout@v2
33+
- uses: ruby/setup-ruby@v1
34+
with:
35+
ruby-version: ${{ matrix.entry.ruby }}
36+
- run: bundle install --jobs=3 --retry=3 --path=vendor/bundle
37+
- run: bundle exec rake spec
38+
continue-on-error: ${{ matrix.entry.allowed-failure }}

.travis.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,49 @@
11
### 0.9.0 (Next)
22

3-
* Your contribution here.
43
* [#29](https://github.com/dblock/ruby-enum/pull/29): Added superclass values when enumerating with `Ruby::Enum#values` - [@gi](https://github.com/gi).
54
* [#30](https://github.com/dblock/ruby-enum/pull/30): Default value to key - [@gi](https://github.com/gi).
5+
* [#34](https://github.com/dblock/ruby-enum/pull/34): Replaced Travis-CI with Github Actions, added Danger PR linter - [@dblock](https://github.com/dblock).
6+
* Your contribution here.
67

7-
### 0.8.0 (2020/3/27)
8+
### 0.8.0 (2020/03/27)
89

910
* [#22](https://github.com/dblock/ruby-enum/pull/22): Added `Ruby::Enum#each_key` and `Ruby::Enum#each_value` - [@dblock](https://github.com/dblock).
1011
* [#22](https://github.com/dblock/ruby-enum/pull/22): Dropped support for Ruby 2.2 - [@dblock](https://github.com/dblock).
1112
* [#22](https://github.com/dblock/ruby-enum/pull/22): Upgraded RuboCop to 0.80.1 - [@dblock](https://github.com/dblock).
1213

13-
### 0.7.2 (2017/3/15)
14+
### 0.7.2 (2017/03/15)
1415

1516
* [#18](https://github.com/dblock/ruby-enum/pull/18): Added support for non constant definition - [@laertispappas](https://github.com/laertispappas).
1617

17-
### 0.7.1 (2017/2/23)
18+
### 0.7.1 (2017/02/23)
1819

1920
* [#16](https://github.com/dblock/ruby-enum/pull/16): Replaced `const_missing` with `const_set` - [@laertispappas](https://github.com/laertispappas).
2021

21-
### 0.7.0 (2017/2/21)
22+
### 0.7.0 (2017/02/21)
2223

2324
* [#3](https://github.com/dblock/ruby-enum/pull/13): Added support for subclassing an Enum - [@laertispappas](https://github.com/laertispappas).
2425

25-
### 0.6.0 (2016/5/12)
26+
### 0.6.0 (2016/05/12)
2627

2728
* [#12](https://github.com/dblock/ruby-enum/pull/12): A `Ruby::Enum::Errors::DuplicateKeyError` or a `Ruby::Enum::Errors::DuplciateKeyValyeError` will now be raised when duplicate keys / values are defined - [@laertispappas](https://github.com/laertispappas).
2829

29-
### 0.5.0 (2015/20/11)
30+
### 0.5.0 (2015/11/20)
3031

3132
* [#8](https://github.com/dblock/ruby-enum/pull/8): Added `Ruby::Enum#key`, `Ruby::Enum#value`, `Ruby::Enum#key?`, and `Ruby::Enum#value?` - [@dmolesUC3](https://github.com/dmolesUC3).
3233

33-
### 0.4.0 (2014/29/6)
34+
### 0.4.0 (2014/06/29)
3435

3536
* [#5](https://github.com/dblock/ruby-enum/pull/5): Mixed in `Enumerable` - [@kgann](https://github.com/kgann).
3637

37-
### 0.3.0 (2014/19/5)
38+
### 0.3.0 (2014/05/19)
3839

3940
* [#4](https://github.com/dblock/ruby-enum/pull/4): Added `Ruby::Enum#map` - [@ArnaudRinquin](https://github.com/ArnaudRinquin).
4041

41-
### 0.2.1 (2013/15/5)
42+
### 0.2.1 (2013/05/15)
4243

4344
* Added `Ruby::Enum#values`, `Ruby::Enum#keys` and `Ruby::Enum#to_h` - [@dblock](https://github.com/dblock).
4445
* A `Ruby::Enum::Errors::UninitializedConstantError` will now be raised when referencing an undefined enum - [@dblock](https://github.com/dblock).
4546

46-
### 0.1.0 (2013/14/5)
47+
### 0.1.0 (2013/05/14)
4748

4849
* Initial public release, live-coded during [May 2013 NYC.rb](http://code.dblock.org/your-first-ruby-gem) - [@dblock](https://github.com/dblock).

Dangerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# frozen_string_literal: true
2+
3+
changelog.check!
4+
toc.check!

Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ gemspec
77
gem 'rake'
88

99
group :development, :test do
10+
gem 'danger'
11+
gem 'danger-changelog', '0.6.1'
12+
gem 'danger-toc', '0.2.0'
1013
gem 'rspec', '~> 3.0'
1114
gem 'rubocop', '0.80.1'
1215
end

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2013-2020 Daniel Doubrovkine.
3+
Copyright (c) 2013-2021 Daniel Doubrovkine.
44

55
Permission is hereby granted, free of charge, to any person obtaining
66
a copy of this software and associated documentation files (the

README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,32 @@ Ruby::Enum
22
==========
33

44
[![Gem Version](http://img.shields.io/gem/v/ruby-enum.svg)](http://badge.fury.io/rb/ruby-enum)
5-
[![Build Status](https://travis-ci.org/dblock/ruby-enum.svg?branch=master)](https://travis-ci.org/dblock/ruby-enum)
5+
[![Build Status](https://github.com/dblock/ruby-enum/workflows/test/badge.svg?branch=master)](https://github.com/dblock/ruby-enum/actions)
66
[![Code Climate](https://codeclimate.com/github/dblock/ruby-enum.svg)](https://codeclimate.com/github/dblock/ruby-enum)
77

88
Enum-like behavior for Ruby, heavily inspired by [this](http://www.rubyfleebie.com/enumerations-and-ruby) and improved upon [another blog post](http://code.dblock.org/how-to-define-enums-in-ruby).
99

10+
## Table of Contents
11+
12+
- [Usage](#usage)
13+
- [Constants](#constants)
14+
- [Class Methods](#class-methods)
15+
- [Default Value](#default-value)
16+
- [Enumerating](#enumerating)
17+
- [Iterating](#iterating)
18+
- [Mapping](#mapping)
19+
- [Reducing](#reducing)
20+
- [Sorting](#sorting)
21+
- [Hashing](#hashing)
22+
- [Retrieving keys and values](#retrieving-keys-and-values)
23+
- [Mapping keys to values](#mapping-keys-to-values)
24+
- [Mapping values to keys](#mapping-values-to-keys)
25+
- [Duplicate enumerator keys or duplicate values](#duplicate-enumerator-keys-or-duplicate-values)
26+
- [Inheritance behavior](#inheritance-behavior)
27+
- [Contributing](#contributing)
28+
- [Copyright and License](#copyright-and-license)
29+
- [Related Projects](#related-projects)
30+
1031
## Usage
1132

1233
Enums can be defined and accessed either as constants or class methods, which is a matter of preference.
@@ -250,7 +271,7 @@ You're encouraged to contribute to this gem. See [CONTRIBUTING](CONTRIBUTING.md)
250271

251272
## Copyright and License
252273

253-
Copyright (c) 2013-2020, Daniel Doubrovkine and [Contributors](CHANGELOG.md).
274+
Copyright (c) 2013-2021, Daniel Doubrovkine and [Contributors](CHANGELOG.md).
254275

255276
This project is licensed under the [MIT License](LICENSE.md).
256277

0 commit comments

Comments
 (0)