power-types 0.3.1 → 0.6.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 +194 -23
- data/lib/generators/power_types/init_generator.rb +10 -0
- 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/errors.rb +3 -0
- data/lib/power_types/patterns/base_util.rb +7 -0
- data/lib/power_types/patterns/observer/observer.rb +18 -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 -0
- data/lib/power_types/version.rb +1 -1
- data/lib/power_types.rb +14 -7
- data/power-types.gemspec +10 -10
- metadata +60 -50
- 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: 4fcacd0da843b9147e8fdee88e0bee0535754df30302cac175f251aa0f1faea7
|
4
|
+
data.tar.gz: e1c7423de402d32ae8488f33b101621158f8e7f521f5ced50f68680edc5cfd0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db7acee0f6224fa46ae216bae6cf5b4d3a8eb7ff5256e830044e3c9573064605ef350a1da3b72d16e2f6b79d02b78e805e41e2a08b7155da491567cddbb7e031
|
7
|
+
data.tar.gz: 908d8b3c6b592b5b0e8b0dcd0db1dd13174c7d66e8b64a20e979675c89ecbd6f3394c4f7bd0f2afe4df2db1d14905e45a139c057575eb74e1e95290e7242004c
|
@@ -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: /.*/
|