simplecov-material 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 79859db9fad4027803f06409b62dd97fbd878a4a9b5b7af9ec084cc45806390e
4
- data.tar.gz: 30db520c7ff0801c161b74e5013a66707b0226eab24b71d951bc780809cdad72
3
+ metadata.gz: bd090db498cbd6c722f585dba6047e9f6f4de60c918754360067f59f455c04a1
4
+ data.tar.gz: b86e1314e293b60672487f7b6017a4f05aa953d92f0d2949c7eed4a7083ffb8c
5
5
  SHA512:
6
- metadata.gz: a70a09345ad6082fa2af1012aa2f4163ce2d7adff80278f587dcd95c2a63afe7093268bde65513b3367693028d02673d1df44d4f4865ceca9db156c2824d1566
7
- data.tar.gz: ff5f9795dcef935dcd5ed230892961f1115e7052dd3fea333689514efc8455bd791d7caf36497c13710979e2efb6ddd5d057f13e95255ce0bfd9a0c1aff3d9c7
6
+ metadata.gz: b7f71f1d975731c50a564ef493238deeb265c5b6fdcc2152cc9d0ebab58a6874183a570cd8fbf5b97cb0a35d23162338a902be2c0e8a2550d3d78e6f3e68b29f
7
+ data.tar.gz: cadd4e5ae692768a60479bf816fe5a23944c1ec6681c0b6cbbbc4c1e4ac4f594b7070c839d4b1a48c61bfc9535c5b2ae9f220196143540e3d0f1d2bceff7ac70
@@ -0,0 +1,37 @@
1
+ name: Builds
2
+
3
+ on: [pull_request]
4
+
5
+ jobs:
6
+ ruby-build:
7
+
8
+ runs-on: ubuntu-latest
9
+
10
+ strategy:
11
+ matrix:
12
+ ruby: [2.6.x, 2.5.x, 2.4.x, 2.3.x]
13
+
14
+ steps:
15
+ - name: Checkout Code
16
+ uses: actions/checkout@v1
17
+ - name: Set up Ruby
18
+ uses: actions/setup-ruby@v1
19
+ with:
20
+ ruby-version: ${{ matrix.ruby }}
21
+
22
+ - name: Build
23
+ run: |
24
+ gem install bundler
25
+ bundle install --jobs 4 --retry 3
26
+
27
+ node-build:
28
+
29
+ runs-on: ubuntu-latest
30
+
31
+ steps:
32
+ - uses: actions/checkout@v1
33
+ - uses: actions/setup-node@v1
34
+ with:
35
+ node-version: '13.x'
36
+ - run: yarn install
37
+ - run: yarn build
@@ -0,0 +1,38 @@
1
+ name: Linter
2
+ on: [pull_request]
3
+
4
+ jobs:
5
+ ruby-lint:
6
+
7
+ runs-on: ubuntu-latest
8
+
9
+ steps:
10
+ - uses: actions/checkout@v1
11
+ - name: Rubocop Linter
12
+ uses: andrewmcodes/rubocop-linter-action@v2.0.0
13
+ with:
14
+ additional_gems: 'rubocop-performance'
15
+ env:
16
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17
+
18
+ js-lint:
19
+ runs-on: ubuntu-latest
20
+ steps:
21
+ - uses: actions/checkout@v1
22
+ - name: eslint
23
+ uses: reviewdog/action-eslint@v1
24
+ with:
25
+ github_token: ${{ secrets.github_token }}
26
+ reporter: github-pr-check
27
+ eslint_flags: 'dist/**/* webpack.config.js'
28
+
29
+ css-lint:
30
+ runs-on: ubuntu-latest
31
+ steps:
32
+ - uses: actions/checkout@v1
33
+ - name: stylelint
34
+ uses: reviewdog/action-stylelint@v1
35
+ with:
36
+ github_token: ${{ secrets.github_token }}
37
+ reporter: github-pr-check
38
+ stylelint_input: 'dist/**/*.scss'
@@ -0,0 +1,26 @@
1
+ name: Tests
2
+
3
+ on: [pull_request]
4
+
5
+ jobs:
6
+ ruby-test:
7
+
8
+ runs-on: ubuntu-latest
9
+
10
+ strategy:
11
+ matrix:
12
+ ruby: [2.6.x, 2.5.x, 2.4.x, 2.3.x]
13
+
14
+ steps:
15
+ - name: Checkout Code
16
+ uses: actions/checkout@v1
17
+ - name: Set up Ruby
18
+ uses: actions/setup-ruby@v1
19
+ with:
20
+ ruby-version: ${{ matrix.ruby }}
21
+
22
+ - name: Build and Test
23
+ run: |
24
+ gem install bundler
25
+ bundle install --jobs 4 --retry 3
26
+ bundle exec rake test
@@ -835,10 +835,10 @@ Style/UnlessElse:
835
835
  Description: Do not use unless with else. Rewrite these with the positive case first.
836
836
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-else-with-unless
837
837
  Enabled: true
838
- Style/UnneededCapitalW:
838
+ Style/RedundantCapitalW:
839
839
  Description: Checks for %W when interpolation is not needed.
840
840
  Enabled: false
841
- Style/UnneededPercentQ:
841
+ Style/RedundantPercentQ:
842
842
  Description: Checks for %q/%Q when single quotes or double quotes would do.
843
843
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-q
844
844
  Enabled: false
@@ -1,6 +1,15 @@
1
1
  # Changelog
2
2
 
3
- ## Version [0.1.0](https://github.com/chiefpansancolt/devise_materialize/releases/tag/0.1.0)
3
+ ## Version [0.4.0](https://github.com/chiefpansancolt/devise_materialize/releases/tag/0.4.0)
4
+
5
+ ### Feature Additions
6
+ - Enabled Github Action usage
7
+ - Added Default Sort on Covered Percentage (#4)
8
+ - Added Column Sorting (#4)
9
+ - Upgraded to MDC Data Table Usage
10
+ - Updated Search Box UX
11
+
12
+ ## Version [0.3.0](https://github.com/chiefpansancolt/devise_materialize/releases/tag/0.3.0)
4
13
 
5
14
  Initial Release
6
15
 
data/Gemfile CHANGED
@@ -8,7 +8,6 @@ gemspec
8
8
 
9
9
  gem "json"
10
10
  gem "minitest"
11
- gem "minitest-ci"
12
11
  gem "mocha"
13
12
  gem "pry"
14
13
  gem "rake"
data/README.md CHANGED
@@ -1,12 +1,17 @@
1
1
  # Simplecov Material
2
2
 
3
- [![Maintainability](https://api.codeclimate.com/v1/badges/0eb25c5bffe23ccf5796/maintainability)](https://codeclimate.com/github/chiefpansancolt/simplecov-material/maintainability)
4
- [![Test Coverage](https://api.codeclimate.com/v1/badges/0eb25c5bffe23ccf5796/test_coverage)](https://codeclimate.com/github/chiefpansancolt/simplecov-material/test_coverage)
5
- [![CircleCI](https://circleci.com/gh/chiefpansancolt/simplecov-material.svg?style=svg)](https://circleci.com/gh/chiefpansancolt/simplecov-material)
3
+ [![Builds](https://github.com/chiefpansancolt/simplecov-material/workflows/Builds/badge.svg)]()
4
+ [![Lints](https://github.com/chiefpansancolt/simplecov-material/workflows/Linter/badge.svg)]()
5
+ [![Tests](https://github.com/chiefpansancolt/simplecov-material/workflows/Tests/badge.svg)]()
6
+ ![GitHub release](https://img.shields.io/github/release/chiefpansancolt/simplecov-material?logo=github&style=flat-square)
7
+ ![Gem](https://img.shields.io/gem/dt/simplecov-material?logo=rubygems&style=flat-square)
8
+ [![Discord](https://img.shields.io/discord/450095227185659905?label=Discord&logo=discord&style=flat-square)](https://discord.gg/FPfA3w6)
6
9
 
7
10
  > Note: To learn more about SimpleCov, check out the main repo at https://github.com/colszowka/simplecov
8
11
 
9
- Generates a HTML Material Design report generated from Simplecov using ruby 2.2 or greater.
12
+ Generates a HTML Material Design report generated from Simplecov using ruby 2.3 or greater.
13
+
14
+ > Checkout this article on the approach to development [https://dev.to/chiefpansancolt/using-a-clean-formatter-for-ruby-testing-2khe](https://dev.to/chiefpansancolt/using-a-clean-formatter-for-ruby-testing-2khe)
10
15
 
11
16
  ## Table of Contents
12
17
 
@@ -22,6 +27,8 @@ Generates a HTML Material Design report generated from Simplecov using ruby 2.2
22
27
 
23
28
  Add the below to your Gemfile to make Simplecov Material available as a formatter for your application
24
29
 
30
+ ### Ruby Gems Host
31
+
25
32
  ```ruby
26
33
  # ./Gemfile
27
34
 
@@ -31,12 +38,34 @@ group :test do
31
38
  end
32
39
  ```
33
40
 
41
+ ### Github Rubygems Host
42
+
43
+ ```ruby
44
+ # ./Gemfile
45
+
46
+ group :test do
47
+ gem "simplecov"
48
+ end
49
+
50
+ source "https://rubygems.pkg.github.com/chiefpansancolt"
51
+ group :test do
52
+ gem "simplecov-material"
53
+ end
54
+ end
55
+ ```
56
+
34
57
  ## Usage
35
58
 
36
59
  To use Simplecov Material you will need to ensure your Formatter is set to use Simplecov Material.
37
60
 
38
61
  In your helper ensure your line about formatter usage is one of the following.
39
62
 
63
+ Ensure to add the require tag at the top of your helper class where Simplecov is configured
64
+
65
+ ```ruby
66
+ require "simplecov-material"
67
+ ```
68
+
40
69
  **Single Formatter Usage:**
41
70
 
42
71
  ```ruby
@@ -39,7 +39,7 @@ end
39
39
 
40
40
  joined_version = current_version.join(".")
41
41
 
42
- FileUtils.chdir APP_ROOT do # rubocop:disable BlockLength
42
+ FileUtils.chdir APP_ROOT do # rubocop:disable Metrics/BlockLength
43
43
  contents = <<~FILE
44
44
  # frozen_string_literal: true
45
45
 
@@ -1,3 +1,6 @@
1
+ import {MDCDataTable} from '@material/data-table';
2
+ new MDCDataTable(document.querySelector('.mdc-data-table'));
3
+
1
4
  export function searchTable(elementId) {
2
5
  const input = document.getElementById(elementId);
3
6
  const filter = input.value.toUpperCase();
@@ -16,3 +19,71 @@ export function searchTable(elementId) {
16
19
  }
17
20
 
18
21
  window.searchTable = searchTable;
22
+
23
+ function sortTable(table, col, reverse) {
24
+ var tb = table.tBodies[0];
25
+ var tbh = table.tHead;
26
+ var th = Array.prototype.slice.call(tbh.rows, 0);
27
+ var tr = Array.prototype.slice.call(tb.rows, 0);
28
+ var i;
29
+ var c;
30
+ reverse = -((+reverse) || -1);
31
+ tr = tr.sort(function(a, b) {
32
+ return reverse * (a.cells[col].textContent.trim().localeCompare(b.cells[col].textContent.trim()));
33
+ });
34
+ for (i = 0; i < th.length; ++i) {
35
+ for (c = 0; c < th[i].cells.length; ++c) {
36
+ if (c != col) {
37
+ th[i].cells[c].childNodes[1].classList.add('hide');
38
+ th[i].cells[c].childNodes[3].classList.add('hide');
39
+ } else {
40
+ if (reverse == 1) {
41
+ th[i].cells[c].childNodes[1].classList.add('hide');
42
+ th[i].cells[c].childNodes[3].classList.remove('hide');
43
+ } else {
44
+ th[i].cells[c].childNodes[1].classList.remove('hide');
45
+ th[i].cells[c].childNodes[3].classList.add('hide');
46
+ }
47
+ }
48
+ }
49
+ }
50
+ for (i = 0; i < tr.length; ++i) tb.appendChild(tr[i]);
51
+ }
52
+
53
+ function makeSortable(table) {
54
+ var th = table.tHead;
55
+ var i;
56
+ th && (th = th.rows[0]) && (th = th.cells);
57
+ if (th) i = th.length;
58
+ else return;
59
+ while (--i >= 0) {
60
+ (function(i) {
61
+ var dir = 1;
62
+ th[i].addEventListener('click', function() {
63
+ sortTable(table, i, (dir = 1 - dir));
64
+ });
65
+ }(i));
66
+ };
67
+ }
68
+
69
+ function makeAllSortable(parent) {
70
+ parent = parent || document.body;
71
+ var t = parent.getElementsByTagName('table');
72
+ var i = t.length;
73
+ while (--i >= 0) {
74
+ makeSortable(t[i]);
75
+ };
76
+ }
77
+
78
+ function defaultSort() {
79
+ var t = document.getElementsByTagName('table');
80
+ var i;
81
+ for (i = 0; i < t.length; ++i) {
82
+ sortTable(t[i], 1, -1);
83
+ }
84
+ }
85
+
86
+ window.onload = function() {
87
+ makeAllSortable();
88
+ defaultSort();
89
+ };
@@ -139,3 +139,83 @@ section.footer {
139
139
  .parenthese::after {
140
140
  content: ")";
141
141
  }
142
+
143
+ .search-box-outline {
144
+ display: flex;
145
+ flex: {
146
+ direction: column;
147
+ }
148
+ }
149
+
150
+ .mdc-text-field-outlined-shaped .mdc-notched-outline .mdc-notched-outline__leading {
151
+
152
+ border: {
153
+ radius: 28px 0 0 28px;
154
+ }
155
+
156
+ width: 28px;
157
+ }
158
+
159
+ .mdc-text-field-outlined-shaped .mdc-notched-outline .mdc-notched-outline__leading[dir = "rtl"],
160
+ [dir = "rtl"] .mdc-text-field-outlined-shaped .mdc-notched-outline .mdc-notched-outline__leading {
161
+
162
+ border: {
163
+ radius: 0 28px 28px 0;
164
+ }
165
+ }
166
+
167
+ .mdc-text-field-outlined-shaped .mdc-notched-outline .mdc-notched-outline__notch {
168
+
169
+ max: {
170
+ width: calc(100% - 28px * 2);
171
+ }
172
+ }
173
+
174
+ .mdc-text-field-outlined-shaped .mdc-notched-outline .mdc-notched-outline__trailing {
175
+
176
+ border: {
177
+ radius: 0 28px 28px 0;
178
+ }
179
+ }
180
+
181
+ .mdc-text-field-outlined-shaped .mdc-notched-outline .mdc-notched-outline__trailing[dir = "rtl"],
182
+ [dir = "rtl"] .mdc-text-field-outlined-shaped .mdc-notched-outline .mdc-notched-outline__trailing {
183
+
184
+ border: {
185
+ radius: 28px 0 0 28px;
186
+ }
187
+ }
188
+
189
+ .mdc-text-field-outlined-shaped .mdc-text-field__input {
190
+
191
+ padding: {
192
+ left: 32px;
193
+ right: 0;
194
+ }
195
+ }
196
+
197
+ .mdc-text-field-outlined-shaped .mdc-text-field__input[dir = "rtl"],
198
+ [dir = "rtl"] .mdc-text-field-outlined-shaped .mdc-text-field__input {
199
+
200
+ padding: {
201
+ left: 0;
202
+ right: 32px;
203
+ }
204
+ }
205
+
206
+ .mdc-text-field-outlined-shaped + .mdc-text-field-helper-line {
207
+
208
+ padding: {
209
+ left: 32px;
210
+ right: 28px;
211
+ }
212
+ }
213
+
214
+ .mdc-text-field-outlined-shaped + .mdc-text-field-helper-line[dir = "rtl"],
215
+ [dir = "rtl"] .mdc-text-field-outlined-shaped + .mdc-text-field-helper-line {
216
+
217
+ padding: {
218
+ left: 28px;
219
+ right: 32px;
220
+ }
221
+ }
@@ -1,7 +1,4 @@
1
- .table {
2
- background: {
3
- color: #FFF;
4
- }
1
+ table {
5
2
  border: {
6
3
  spacing: 0;
7
4
  }
@@ -18,9 +15,10 @@
18
15
  tbody {
19
16
 
20
17
  tr {
21
- -webkit-transition: all .3s ease;
22
- -o-transition: all .3s ease;
23
- transition: all .3s ease;
18
+
19
+ th {
20
+ cursor: pointer;
21
+ }
24
22
 
25
23
  th,
26
24
  td {
@@ -28,13 +26,7 @@
28
26
  top: 0;
29
27
  }
30
28
 
31
- padding: 1.6rem;
32
- -webkit-transition: all .3s ease;
33
- -o-transition: all .3s ease;
34
- transition: all .3s ease;
35
- text: {
36
- align: left;
37
- }
29
+ padding: 1rem;
38
30
  vertical: {
39
31
  align: top;
40
32
  }
@@ -61,76 +53,18 @@
61
53
  space: nowrap;
62
54
  }
63
55
  }
64
- }
65
- }
66
- }
67
-
68
- thead {
69
-
70
- tr {
71
-
72
- th {
73
- border: {
74
- bottom: 1px solid rgba(0, 0, 0, .12);
75
- }
76
56
 
77
- color: #757575;
78
- font: {
79
- weight: 400;
80
- }
81
- vertical: {
82
- align: bottom;
83
- }
84
- }
85
- }
86
- }
57
+ i {
87
58
 
88
- tbody {
89
- border: {
90
- top: 1px solid rgba(0, 0, 0, .12);
91
- }
92
- }
93
-
94
- &.table-condensed {
95
-
96
- thead,
97
- tbody {
98
-
99
- tr {
100
-
101
- th,
102
- td {
103
- padding: .8rem;
104
- }
105
- }
106
- }
107
- }
108
-
109
- &.table-hover {
110
-
111
- tbody {
112
-
113
- tr:hover {
114
-
115
- td {
116
- background: {
117
- color: rgba(0, 0, 0, .12);
59
+ vertical: {
60
+ align: inherit;
118
61
  }
119
62
  }
120
63
  }
121
64
  }
122
65
  }
66
+ }
123
67
 
124
- thead:first-child {
125
-
126
- tr:first-child {
127
-
128
- th,
129
- td {
130
- border: {
131
- top: 0;
132
- }
133
- }
134
- }
135
- }
68
+ .hide {
69
+ display: none;
136
70
  }