power-types 0.3.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +103 -0
- data/.circleci/setup-rubygems.sh +3 -0
- data/.rubocop.yml +49 -591
- data/.ruby-version +1 -0
- data/LICENSE.txt +1 -1
- data/README.md +192 -23
- data/lib/generators/power_types/init_generator.rb +10 -0
- data/lib/generators/rails/observer_generator.rb +1 -1
- data/lib/generators/rails/presenter_generator.rb +12 -0
- data/lib/generators/rails/templates/presenter.rb +2 -0
- data/lib/generators/rails/templates/presenter_spec.rb +5 -0
- data/lib/generators/rails/templates/util.rb +7 -0
- data/lib/generators/rails/templates/util_spec.rb +9 -0
- data/lib/generators/rails/util_generator.rb +14 -0
- data/lib/power-types.rb +1 -1
- data/lib/power_types/errors.rb +3 -0
- data/lib/power_types/patterns/base_util.rb +7 -0
- data/lib/power_types/patterns/presenter/base_presenter.rb +28 -0
- data/lib/power_types/patterns/presenter/presentable.rb +20 -0
- data/lib/power_types/util.rb +1 -1
- data/lib/power_types/version.rb +1 -1
- data/lib/power_types.rb +6 -0
- data/power-types.gemspec +9 -10
- metadata +50 -60
- data/.hound.yml +0 -4
- data/.travis.yml +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d925bbf270d6ba204b3e091b60f5b16a5f02e5c6a76a6cee0ce710ff148f548
|
4
|
+
data.tar.gz: f494be84a510e19471380a1b3163e8ccb5b320f7c3307b272090314297a0491c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8dcbe2f8d896b4f3de9431d79247ce76426528ebc206a8585f33770dab9f110ad9849f8d5a46435c6fcc3fd84493cddcdec5d6b1916ce7f238dd74d4a825f6d3
|
7
|
+
data.tar.gz: 26570fe587be13f151c0ac0627b361de02977ad32c3651ee1f5f6f7135b0357c33d55fe217931cc569a81a09756b8aff0efc7ef30c0d52cb35e9039db5aef87c
|
@@ -0,0 +1,103 @@
|
|
1
|
+
version: 2.1
|
2
|
+
|
3
|
+
env-vars: &env-vars
|
4
|
+
RAILS_ENV: test
|
5
|
+
NODE_ENV: test
|
6
|
+
BUNDLE_PATH: vendor/bundle
|
7
|
+
|
8
|
+
orbs:
|
9
|
+
ruby: circleci/ruby@0.1.2
|
10
|
+
browser-tools: circleci/browser-tools@1.1.3
|
11
|
+
|
12
|
+
executors:
|
13
|
+
main-executor:
|
14
|
+
parameters:
|
15
|
+
ruby-version:
|
16
|
+
description: "Ruby version"
|
17
|
+
default: "2.7"
|
18
|
+
type: string
|
19
|
+
docker:
|
20
|
+
- image: circleci/ruby:<<parameters.ruby-version>>-node
|
21
|
+
environment: *env-vars
|
22
|
+
|
23
|
+
commands:
|
24
|
+
setup:
|
25
|
+
description: checkout code and install dependencies
|
26
|
+
steps:
|
27
|
+
- checkout
|
28
|
+
- run:
|
29
|
+
name: Install bundle dependencies
|
30
|
+
command: |
|
31
|
+
gem install bundler:2.2.15
|
32
|
+
bundle install
|
33
|
+
|
34
|
+
jobs:
|
35
|
+
lint:
|
36
|
+
executor: main-executor
|
37
|
+
steps:
|
38
|
+
- setup
|
39
|
+
- run:
|
40
|
+
name: Install reviewdog
|
41
|
+
command: |
|
42
|
+
curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b ./bin
|
43
|
+
- run:
|
44
|
+
name: Get files to lint
|
45
|
+
command: |
|
46
|
+
mkdir tmp
|
47
|
+
git diff origin/master --name-only --diff-filter=d > tmp/files_to_lint
|
48
|
+
- run:
|
49
|
+
name: Run rubocop
|
50
|
+
shell: /bin/bash
|
51
|
+
command: |
|
52
|
+
cat tmp/files_to_lint | grep -E '.+\.(rb)$' | xargs bundle exec rubocop --force-exclusion \
|
53
|
+
| ./bin/reviewdog -reporter=github-pr-review -f=rubocop
|
54
|
+
test:
|
55
|
+
parameters:
|
56
|
+
ruby-version:
|
57
|
+
description: "Ruby version"
|
58
|
+
default: "2.7"
|
59
|
+
type: string
|
60
|
+
executor:
|
61
|
+
name: main-executor
|
62
|
+
ruby-version: <<parameters.ruby-version>>
|
63
|
+
steps:
|
64
|
+
- setup
|
65
|
+
- run:
|
66
|
+
name: Run Tests
|
67
|
+
command: |
|
68
|
+
RSPEC_JUNIT_ARGS="-r rspec_junit_formatter -f RspecJunitFormatter -o test_results/rspec.xml"
|
69
|
+
RSPEC_FORMAT_ARGS="-f progress --no-color -p 10"
|
70
|
+
bundle exec rspec ./spec $RSPEC_FORMAT_ARGS $RSPEC_JUNIT_ARGS
|
71
|
+
- store_test_results:
|
72
|
+
path: test_results
|
73
|
+
deploy:
|
74
|
+
executor: main-executor
|
75
|
+
steps:
|
76
|
+
- setup
|
77
|
+
- run:
|
78
|
+
name: Setup rubygems
|
79
|
+
command: bash .circleci/setup-rubygems.sh
|
80
|
+
- run:
|
81
|
+
name: Publish to rubygems
|
82
|
+
command: |
|
83
|
+
gem build power-types.gemspec
|
84
|
+
version_tag=$(git describe --tags)
|
85
|
+
gem push power-types-${version_tag#v}.gem
|
86
|
+
|
87
|
+
workflows:
|
88
|
+
version: 2
|
89
|
+
main:
|
90
|
+
jobs:
|
91
|
+
- lint:
|
92
|
+
context: org-global
|
93
|
+
- test:
|
94
|
+
matrix:
|
95
|
+
parameters:
|
96
|
+
ruby-version: ["2.5", "2.6", "2.7"]
|
97
|
+
- deploy:
|
98
|
+
context: org-global
|
99
|
+
filters:
|
100
|
+
tags:
|
101
|
+
only: /.*/
|
102
|
+
branches:
|
103
|
+
ignore: /.*/
|