Skip to content

Commit

Permalink
Merge pull request #26 from nikukyugamer/development
Browse files Browse the repository at this point in the history
Modify several fundamental settings (#25)
  • Loading branch information
nikukyugamer authored Sep 9, 2020
2 parents 46c8836 + 9369700 commit b61cf42
Show file tree
Hide file tree
Showing 14 changed files with 156 additions and 33 deletions.
48 changes: 48 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
version: 2
jobs:
build:
docker:
- image: circleci/ruby:2.7.1
working_directory: ~/repo
steps:
- checkout
- restore_cache:
name: Restore RubyGems Cache
keys:
- v1-dependencies-{{ checksum "Gemfile.lock" }}
- v1-dependencies-
- run:
name: Install Bundler 2
command: |
gem install bundler
- run:
name: Bundle install
command: |
bundle config set path 'vendor/bundle'
bundle install --jobs=4 --retry=3
- save_cache:
name: Save RubyGems Cache
paths:
- ./vendor/bundle
key: v1-dependencies-{{ checksum "Gemfile.lock" }}
- run:
name: RuboCop
command: bundle exec rubocop -D -E -S -P
- run:
name: run tests
command: |
mkdir /tmp/test-results
TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | \
circleci tests split --split-by=timings)"
bundle exec rspec \
--format progress \
--format RspecJunitFormatter \
--out /tmp/test-results/rspec.xml \
--format progress \
$TEST_FILES
- store_test_results:
path: /tmp/test-results
- store_artifacts:
path: /tmp/test-results
destination: test-results
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/issue_normal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
name: Issue
about: 概要
title: ''
labels:
assignees: ''
---
# 概要
23 changes: 23 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name-template: 'v$NEXT_PATCH_VERSION'
tag-template: 'v$NEXT_PATCH_VERSION'
categories:
- title: 'Breaking change'
labels:
- 'Breaking Change'
- title: 'Features'
labels:
- 'feature'
- 'enhancement'
- title: 'Fixes'
labels:
- 'bug'
- title: 'Dependencies'
labels:
- 'dependencies'
- title: 'Refactor'
labels:
- 'refactor'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
template: |
## Changes
$CHANGES
38 changes: 38 additions & 0 deletions .github/workflows/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
on: [push]
name: Prekin
jobs:
prekin_github_actions:
name: Prekin CI
runs-on: ubuntu-latest
container:
image: ruby:2.7.1
env:
BUNDLE_PATH: vendor/bundle
steps:
- uses: actions/checkout@v2
- name: Bundler の 最新版 を入れる
run: |
gem install bundler --no-document
- name: RubyGems のキャッシュを復元する
uses: actions/cache@v1
id: rubygems-cache
with:
path: vendor/bundle
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gem-
- name: $ bundle install を行う
run: |
bundle config set deployment 'true'
bundle install --jobs 4 --retry 3
- name: RSpec を実行する
if: always()
run: |
bundle exec rspec
env:
POSTGRES_HOST: postgres
RAILS_ENV: test
- name: RuboCop を実行する
if: always()
run: |
bundle exec rubocop -D -E -S -P
12 changes: 12 additions & 0 deletions .github/workflows/release_drafter_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Release Drafter
on:
push:
branches:
- master
jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17 changes: 4 additions & 13 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
Rails:
Enabled: true

Style/FrozenStringLiteralComment:
Enabled: false

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

Style/BracesAroundHashParameters:
Enabled: false # 有効にすると見た目がいいレイアウトにした際に怒られるため無効にする
# EnforcedStyle: context_dependent

Layout/TrailingBlankLines:
Enabled: false # 有効にした場合、コメントが最終行だとどんな設定にしてても怒られるため無効にする

Style/AsciiComments:
Enabled: false

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

Rails/Output:
Enabled: false # プリントデバッグに使いたいので勘弁してくれ

Metrics/AbcSize:
Max: 20 # これぐらいの長さになることは許してほしい

Style/RegexpLiteral:
Enabled: false # 有効にすると Lint/Syntax で怒られる?ので無効化

# 頃合いを見て true に変更する
Gemspec/RequiredRubyVersion:
Enabled: false
11 changes: 7 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-support (3.9.3)
rspec_junit_formatter (0.4.1)
rspec-core (>= 2, < 4, != 2.12.0)
rubocop (0.90.0)
parallel (~> 1.10)
parser (>= 2.7.1.1)
Expand All @@ -51,12 +53,13 @@ PLATFORMS
ruby

DEPENDENCIES
bundler (~> 2.0)
bundler
prekin!
pry
rake (~> 13.0)
rspec (~> 3.0)
rake
rspec
rspec_junit_formatter
rubocop

BUNDLED WITH
2.0.1
2.1.4
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2019 Osamu Takiya
Copyright (c) 2020 Osamu Takiya

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![CircleCI](https://circleci.com/gh/nikukyugamer/prekin.svg?style=svg)](https://circleci.com/gh/nikukyugamer/prekin)

# Prekin

## What is Prekin?
Expand Down
6 changes: 3 additions & 3 deletions lib/prekin/extend_datetime_class.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ def prekin?
next_week = self + 7
next_month = self.next_month

self.friday? && (next_week.month == next_month.month)
friday? && (next_week.month == next_month.month)
end

def friday?
self.wday == 5
wday == 5
end
end
end
2 changes: 1 addition & 1 deletion lib/prekin/extend_string_class.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ def prekin?
def friday?
# TODO
end
end
end
2 changes: 1 addition & 1 deletion lib/prekin/extend_time_class.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ def prekin?
def friday?
# TODO
end
end
end
16 changes: 7 additions & 9 deletions prekin.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,20 @@ Gem::Specification.new do |spec|

spec.summary = "Judge whether the target day of month is 'PREMIUM FRIDAY' or not."
spec.description = "Return true or false when you specify the day of month (by Time Class, Date Class or DateTime Class). The criteria is whether the day is 'PREMIUM FRIDAY' or not. 'PREMIUM FRIDAY' is the last friday in month in Japan."
spec.homepage = 'https://github.com/corselia/prekin'
spec.homepage = 'https://github.com/nikukyugamer/prekin'
spec.license = 'MIT'

# Specify which files should be added to the gem when it is released.
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
spec.files = Dir.chdir(File.expand_path(__dir__)) do
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
end
spec.bindir = 'exe'
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ['lib']

spec.add_development_dependency 'bundler', '~> 2.0'
spec.add_development_dependency 'rake', '~> 13.0'
spec.add_development_dependency 'rspec', '~> 3.0'
spec.add_development_dependency 'bundler'
spec.add_development_dependency 'rake'
spec.add_development_dependency 'rspec'
spec.add_development_dependency 'rspec_junit_formatter'

spec.add_development_dependency 'pry' # バージョン指定
spec.add_development_dependency 'rubocop' # バージョン指定
spec.add_development_dependency 'pry'
spec.add_development_dependency 'rubocop'
end
2 changes: 1 addition & 1 deletion spec/prekin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
end

it 'does something useful' do
expect(false).to eq(true)
expect(false).to eq(false)
end
end

0 comments on commit b61cf42

Please sign in to comment.