Skip to content

Commit b61cf42

Browse files
authored
Merge pull request #26 from nikukyugamer/development
Modify several fundamental settings (#25)
2 parents 46c8836 + 9369700 commit b61cf42

File tree

14 files changed

+156
-33
lines changed

14 files changed

+156
-33
lines changed

.circleci/config.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
version: 2
2+
jobs:
3+
build:
4+
docker:
5+
- image: circleci/ruby:2.7.1
6+
working_directory: ~/repo
7+
steps:
8+
- checkout
9+
- restore_cache:
10+
name: Restore RubyGems Cache
11+
keys:
12+
- v1-dependencies-{{ checksum "Gemfile.lock" }}
13+
- v1-dependencies-
14+
- run:
15+
name: Install Bundler 2
16+
command: |
17+
gem install bundler
18+
- run:
19+
name: Bundle install
20+
command: |
21+
bundle config set path 'vendor/bundle'
22+
bundle install --jobs=4 --retry=3
23+
- save_cache:
24+
name: Save RubyGems Cache
25+
paths:
26+
- ./vendor/bundle
27+
key: v1-dependencies-{{ checksum "Gemfile.lock" }}
28+
- run:
29+
name: RuboCop
30+
command: bundle exec rubocop -D -E -S -P
31+
- run:
32+
name: run tests
33+
command: |
34+
mkdir /tmp/test-results
35+
TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | \
36+
circleci tests split --split-by=timings)"
37+
38+
bundle exec rspec \
39+
--format progress \
40+
--format RspecJunitFormatter \
41+
--out /tmp/test-results/rspec.xml \
42+
--format progress \
43+
$TEST_FILES
44+
- store_test_results:
45+
path: /tmp/test-results
46+
- store_artifacts:
47+
path: /tmp/test-results
48+
destination: test-results
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
name: Issue
3+
about: 概要
4+
title: ''
5+
labels:
6+
assignees: ''
7+
---
8+
# 概要

.github/release-drafter.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name-template: 'v$NEXT_PATCH_VERSION'
2+
tag-template: 'v$NEXT_PATCH_VERSION'
3+
categories:
4+
- title: 'Breaking change'
5+
labels:
6+
- 'Breaking Change'
7+
- title: 'Features'
8+
labels:
9+
- 'feature'
10+
- 'enhancement'
11+
- title: 'Fixes'
12+
labels:
13+
- 'bug'
14+
- title: 'Dependencies'
15+
labels:
16+
- 'dependencies'
17+
- title: 'Refactor'
18+
labels:
19+
- 'refactor'
20+
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
21+
template: |
22+
## Changes
23+
$CHANGES

.github/workflows/config.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
on: [push]
2+
name: Prekin
3+
jobs:
4+
prekin_github_actions:
5+
name: Prekin CI
6+
runs-on: ubuntu-latest
7+
container:
8+
image: ruby:2.7.1
9+
env:
10+
BUNDLE_PATH: vendor/bundle
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Bundler の 最新版 を入れる
14+
run: |
15+
gem install bundler --no-document
16+
- name: RubyGems のキャッシュを復元する
17+
uses: actions/cache@v1
18+
id: rubygems-cache
19+
with:
20+
path: vendor/bundle
21+
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
22+
restore-keys: |
23+
${{ runner.os }}-gem-
24+
- name: $ bundle install を行う
25+
run: |
26+
bundle config set deployment 'true'
27+
bundle install --jobs 4 --retry 3
28+
- name: RSpec を実行する
29+
if: always()
30+
run: |
31+
bundle exec rspec
32+
env:
33+
POSTGRES_HOST: postgres
34+
RAILS_ENV: test
35+
- name: RuboCop を実行する
36+
if: always()
37+
run: |
38+
bundle exec rubocop -D -E -S -P
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Release Drafter
2+
on:
3+
push:
4+
branches:
5+
- master
6+
jobs:
7+
update_release_draft:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: release-drafter/release-drafter@v5
11+
env:
12+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.rubocop.yml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
Rails:
2-
Enabled: true
3-
41
Style/FrozenStringLiteralComment:
52
Enabled: false
63

@@ -12,13 +9,6 @@ Style/TrailingCommaInArrayLiteral:
129
Enabled: false # 有効にすると見た目がいいレイアウトにした際に怒られるため無効にする
1310
# EnforcedStyleForMultiline: consistent_comma
1411

15-
Style/BracesAroundHashParameters:
16-
Enabled: false # 有効にすると見た目がいいレイアウトにした際に怒られるため無効にする
17-
# EnforcedStyle: context_dependent
18-
19-
Layout/TrailingBlankLines:
20-
Enabled: false # 有効にした場合、コメントが最終行だとどんな設定にしてても怒られるため無効にする
21-
2212
Style/AsciiComments:
2313
Enabled: false
2414

@@ -46,11 +36,12 @@ Style/ClassAndModuleChildren:
4636
Metrics/MethodLength:
4737
Enabled: false # メソッドの長さが長いと怒られる(有用なので後で調整すること)
4838

49-
Rails/Output:
50-
Enabled: false # プリントデバッグに使いたいので勘弁してくれ
51-
5239
Metrics/AbcSize:
5340
Max: 20 # これぐらいの長さになることは許してほしい
5441

5542
Style/RegexpLiteral:
5643
Enabled: false # 有効にすると Lint/Syntax で怒られる?ので無効化
44+
45+
# 頃合いを見て true に変更する
46+
Gemspec/RequiredRubyVersion:
47+
Enabled: false

Gemfile.lock

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ GEM
3333
diff-lcs (>= 1.2.0, < 2.0)
3434
rspec-support (~> 3.9.0)
3535
rspec-support (3.9.3)
36+
rspec_junit_formatter (0.4.1)
37+
rspec-core (>= 2, < 4, != 2.12.0)
3638
rubocop (0.90.0)
3739
parallel (~> 1.10)
3840
parser (>= 2.7.1.1)
@@ -51,12 +53,13 @@ PLATFORMS
5153
ruby
5254

5355
DEPENDENCIES
54-
bundler (~> 2.0)
56+
bundler
5557
prekin!
5658
pry
57-
rake (~> 13.0)
58-
rspec (~> 3.0)
59+
rake
60+
rspec
61+
rspec_junit_formatter
5962
rubocop
6063

6164
BUNDLED WITH
62-
2.0.1
65+
2.1.4

LICENSE

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

3-
Copyright (c) 2019 Osamu Takiya
3+
Copyright (c) 2020 Osamu Takiya
44

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

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[![CircleCI](https://circleci.com/gh/nikukyugamer/prekin.svg?style=svg)](https://circleci.com/gh/nikukyugamer/prekin)
2+
13
# Prekin
24

35
## What is Prekin?

lib/prekin/extend_datetime_class.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ def prekin?
55
next_week = self + 7
66
next_month = self.next_month
77

8-
self.friday? && (next_week.month == next_month.month)
8+
friday? && (next_week.month == next_month.month)
99
end
1010

1111
def friday?
12-
self.wday == 5
12+
wday == 5
1313
end
14-
end
14+
end

0 commit comments

Comments
 (0)