sleeping_king_studios-tasks 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 +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +2 -4
- data/lib/sleeping_king_studios/tasks/apps.rb +1 -1
- data/lib/sleeping_king_studios/tasks/apps/app_configuration.rb +1 -1
- data/lib/sleeping_king_studios/tasks/apps/ci/results_reporter.rb +8 -6
- data/lib/sleeping_king_studios/tasks/ci/cucumber_results.rb +1 -1
- data/lib/sleeping_king_studios/tasks/ci/eslint_results.rb +1 -1
- data/lib/sleeping_king_studios/tasks/ci/jest_results.rb +1 -1
- data/lib/sleeping_king_studios/tasks/ci/rspec_each_results.rb +1 -1
- data/lib/sleeping_king_studios/tasks/ci/rspec_results.rb +1 -1
- data/lib/sleeping_king_studios/tasks/ci/simplecov_results.rb +4 -5
- data/lib/sleeping_king_studios/tasks/ci/steps_runner.rb +1 -1
- data/lib/sleeping_king_studios/tasks/ci/steps_task.rb +1 -1
- data/lib/sleeping_king_studios/tasks/file/new_task.rb +2 -2
- data/lib/sleeping_king_studios/tasks/file/templates/rspec.erb +1 -1
- data/lib/sleeping_king_studios/tasks/file/templates/ruby.erb +5 -5
- data/lib/sleeping_king_studios/tasks/process_runner.rb +1 -1
- data/lib/sleeping_king_studios/tasks/task.rb +2 -2
- data/lib/sleeping_king_studios/tasks/version.rb +1 -1
- metadata +8 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b22e56277e42bd23403ac607dd21057d5c6c6e870655a326e16524d1c1eb051
|
4
|
+
data.tar.gz: 4ab2e01510d48601888a8239a85b928ab610a111ea57aa6abce24c418cd7d85d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5f679f0abaa9b54de43b0eff521b9ea0a4275f82925bf9a4821f2d97260a0b29beccc49bc115067585c91ba1fd90800f07d580bfc49df3742536ae2e2cb9524
|
7
|
+
data.tar.gz: 8978756f73cfff58d8ab49809ddfd3ca6eed68868f48124d524280f2e008bfec3c42615e6a9f97a2c9fe1a653c65c4ebb2f13174464d300e332f954de0c02dc2
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# SleepingKingStudios::Tasks [![Build Status](https://travis-ci.org/sleepingkingstudios/sleeping_king_studios-tasks.svg?branch=master)](https://travis-ci.org/sleepingkingstudios/sleeping_king_studios-tasks)
|
2
2
|
|
3
|
+
**Note:** This project is deprecated, and will not receive further feature updates.
|
4
|
+
|
3
5
|
A toolkit providing an encapsulation layer around the Thor CLI library, with predefined tasks for development and continuous integration.
|
4
6
|
|
5
7
|
See also [https://github.com/erikhuda/thor](https://github.com/erikhuda/thor).
|
@@ -10,10 +12,6 @@ See also [https://github.com/erikhuda/thor](https://github.com/erikhuda/thor).
|
|
10
12
|
|
11
13
|
The canonical repository for this gem is on [GitHub](https://github.com/sleepingkingstudios/sleeping_king_studios-tasks).
|
12
14
|
|
13
|
-
### A Note From The Developer
|
14
|
-
|
15
|
-
Hi, I'm Rob Smith, a Ruby Engineer and the developer of this library. I use these tools every day, but they're not just written for me. If you find this project helpful in your own work, or if you have any questions, suggestions or critiques, please feel free to get in touch! I can be reached on GitHub (see above, and feel encouraged to submit bug reports or merge requests there) or via email at `merlin@sleepingkingstudios.com`. I look forward to hearing from you!
|
16
|
-
|
17
15
|
## Task Classes
|
18
16
|
|
19
17
|
SleepingKingStudios::Tasks defines a wrapper around the Thor CLI.
|
@@ -49,7 +49,7 @@ module SleepingKingStudios::Tasks::Apps
|
|
49
49
|
|
50
50
|
define_method :short_name do
|
51
51
|
# rubocop:disable Style/RedundantSelf
|
52
|
-
tools.
|
52
|
+
tools.str.underscore(self.name.gsub(/\s+/, '_'))
|
53
53
|
# rubocop:enable Style/RedundantSelf
|
54
54
|
end # define_method
|
55
55
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# lib/sleeping_king_studios/tasks/apps/ci/results_reporter.rb
|
2
2
|
|
3
|
-
require '
|
3
|
+
require 'forwardable'
|
4
4
|
|
5
5
|
require 'sleeping_king_studios/tasks/apps/ci'
|
6
6
|
require 'sleeping_king_studios/tasks/ci/results_helpers'
|
@@ -9,21 +9,23 @@ module SleepingKingStudios::Tasks::Apps::Ci
|
|
9
9
|
# Reports on the results of a multi-application continuous integration
|
10
10
|
# process, printing the step results grouped by application.
|
11
11
|
class ResultsReporter
|
12
|
-
extend
|
12
|
+
extend Forwardable
|
13
13
|
|
14
14
|
include SleepingKingStudios::Tasks::Ci::ResultsHelpers
|
15
15
|
|
16
|
-
|
17
|
-
:applications,
|
16
|
+
def_delegators :@context,
|
18
17
|
:print_table,
|
19
18
|
:say,
|
20
|
-
:set_color
|
21
|
-
:to => :@context
|
19
|
+
:set_color
|
22
20
|
|
23
21
|
def initialize context
|
24
22
|
@context = context
|
25
23
|
end # method initialize
|
26
24
|
|
25
|
+
def applications
|
26
|
+
@context.send(:applications)
|
27
|
+
end
|
28
|
+
|
27
29
|
def call results
|
28
30
|
width = 1 + heading_width(results)
|
29
31
|
|
@@ -179,7 +179,7 @@ module SleepingKingStudios::Tasks::Ci
|
|
179
179
|
end # method keys
|
180
180
|
|
181
181
|
def pluralize count, singular, plural = nil
|
182
|
-
"#{count} #{tools.
|
182
|
+
"#{count} #{tools.int.pluralize count, singular, plural}"
|
183
183
|
end # method pluralize
|
184
184
|
|
185
185
|
def tools
|
@@ -98,7 +98,7 @@ module SleepingKingStudios::Tasks::Ci
|
|
98
98
|
end
|
99
99
|
|
100
100
|
def pluralize count, singular, plural = nil
|
101
|
-
"#{count} #{tools.
|
101
|
+
"#{count} #{tools.int.pluralize count, singular, plural}"
|
102
102
|
end
|
103
103
|
|
104
104
|
def relative_path path
|
@@ -84,7 +84,7 @@ module SleepingKingStudios::Tasks::Ci
|
|
84
84
|
end # method pending_files
|
85
85
|
|
86
86
|
def pluralize count, singular, plural = nil
|
87
|
-
"#{count} #{tools.
|
87
|
+
"#{count} #{tools.int.pluralize count, singular, plural}"
|
88
88
|
end # method pluralize
|
89
89
|
|
90
90
|
# @return [Hash] The hash representation of the results.
|
@@ -85,7 +85,7 @@ module SleepingKingStudios::Tasks::Ci
|
|
85
85
|
end # method pending_count
|
86
86
|
|
87
87
|
def pluralize count, singular, plural = nil
|
88
|
-
"#{count} #{tools.
|
88
|
+
"#{count} #{tools.int.pluralize count, singular, plural}"
|
89
89
|
end # method pluralize
|
90
90
|
|
91
91
|
# @return [Hash] The hash representation of the results.
|
@@ -1,25 +1,24 @@
|
|
1
1
|
# lib/sleeping_king_studios/tasks/ci/simplecov_results.rb
|
2
2
|
|
3
|
-
require '
|
3
|
+
require 'forwardable'
|
4
4
|
|
5
5
|
require 'sleeping_king_studios/tasks/ci'
|
6
6
|
|
7
7
|
module SleepingKingStudios::Tasks::Ci
|
8
8
|
# Encapsulates the results of aggregated SimpleCov data.
|
9
9
|
class SimpleCovResults
|
10
|
-
extend
|
10
|
+
extend Forwardable
|
11
11
|
|
12
12
|
# @param results [SimpleCov::Result] The raw results of the SimpleCov call.
|
13
13
|
def initialize results
|
14
14
|
@results = results
|
15
15
|
end # constructor
|
16
16
|
|
17
|
-
|
17
|
+
def_delegators :@results,
|
18
18
|
:covered_lines,
|
19
19
|
:covered_percent,
|
20
20
|
:missed_lines,
|
21
|
-
:total_lines
|
22
|
-
:to => :@results
|
21
|
+
:total_lines
|
23
22
|
|
24
23
|
# @return [Boolean] True if there are no covered lines, otherwise false.
|
25
24
|
def empty?
|
@@ -52,7 +52,7 @@ module SleepingKingStudios::Tasks::Ci
|
|
52
52
|
end # method failing?
|
53
53
|
|
54
54
|
def format_failures failing_steps
|
55
|
-
tools.
|
55
|
+
tools.ary.humanize_list(failing_steps) do |name|
|
56
56
|
set_color(name, :red)
|
57
57
|
end # humanize list
|
58
58
|
end # method format_failures
|
@@ -142,13 +142,13 @@ module SleepingKingStudios::Tasks::File
|
|
142
142
|
template = spec_file? ? 'rspec.erb' : 'ruby.erb'
|
143
143
|
|
144
144
|
preview_file file_path, :max => max, :template => template do
|
145
|
-
tools.
|
145
|
+
tools.str.indent(rendered_source, 4)
|
146
146
|
end # preview_file
|
147
147
|
|
148
148
|
return unless spec? && !spec_file?
|
149
149
|
|
150
150
|
preview_file spec_path, :max => max, :template => 'rspec.erb' do
|
151
|
-
tools.
|
151
|
+
tools.str.indent(rendered_spec, 4)
|
152
152
|
end # preview_file
|
153
153
|
end # method preview_files
|
154
154
|
# rubocop:enable Metrics/AbcSize
|
@@ -3,24 +3,24 @@
|
|
3
3
|
<% tools = SleepingKingStudios::Tools::Toolbelt.new %>
|
4
4
|
<% if relative_path.empty? %>
|
5
5
|
<% if defined?(superclass) %>
|
6
|
-
class <%= tools.
|
6
|
+
class <%= tools.str.camelize file_name %> < <%= superclass %>
|
7
7
|
|
8
8
|
end
|
9
9
|
<% else %>
|
10
|
-
module <%= tools.
|
10
|
+
module <%= tools.str.camelize file_name %>
|
11
11
|
|
12
12
|
end
|
13
13
|
<% end %>
|
14
14
|
<% else %>
|
15
15
|
require '<%= relative_path.join('/') %>'
|
16
16
|
|
17
|
-
module <%= relative_path.map { |rel| tools.
|
17
|
+
module <%= relative_path.map { |rel| tools.str.camelize(rel) }.join('::') %>
|
18
18
|
<% if defined?(superclass) %>
|
19
|
-
class <%= tools.
|
19
|
+
class <%= tools.str.camelize file_name %> < <%= superclass %>
|
20
20
|
|
21
21
|
end
|
22
22
|
<% else %>
|
23
|
-
module <%= tools.
|
23
|
+
module <%= tools.str.camelize file_name %>
|
24
24
|
|
25
25
|
end
|
26
26
|
<% end %>
|
@@ -36,14 +36,14 @@ module SleepingKingStudios::Tasks
|
|
36
36
|
def task_name
|
37
37
|
tools = SleepingKingStudios::Tools::Toolbelt.instance
|
38
38
|
|
39
|
-
tools.
|
39
|
+
tools.str.underscore(name.split('::').last).sub(/_task$/, '')
|
40
40
|
end # method task_name
|
41
41
|
|
42
42
|
private
|
43
43
|
|
44
44
|
def define_helpers option_name, option_params
|
45
45
|
tools = SleepingKingStudios::Tools::Toolbelt.instance
|
46
|
-
name = tools.
|
46
|
+
name = tools.str.underscore option_name
|
47
47
|
|
48
48
|
define_method(name) { options[option_name.to_s] }
|
49
49
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sleeping_king_studios-tasks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rob "Merlin" Smith
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -36,20 +36,14 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '0.
|
40
|
-
- - ">="
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
version: 0.7.1
|
39
|
+
version: '0.8'
|
43
40
|
type: :runtime
|
44
41
|
prerelease: false
|
45
42
|
version_requirements: !ruby/object:Gem::Requirement
|
46
43
|
requirements:
|
47
44
|
- - "~>"
|
48
45
|
- !ruby/object:Gem::Version
|
49
|
-
version: '0.
|
50
|
-
- - ">="
|
51
|
-
- !ruby/object:Gem::Version
|
52
|
-
version: 0.7.1
|
46
|
+
version: '0.8'
|
53
47
|
- !ruby/object:Gem::Dependency
|
54
48
|
name: erubi
|
55
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -253,7 +247,7 @@ homepage: http://sleepingkingstudios.com
|
|
253
247
|
licenses:
|
254
248
|
- MIT
|
255
249
|
metadata: {}
|
256
|
-
post_install_message:
|
250
|
+
post_install_message:
|
257
251
|
rdoc_options: []
|
258
252
|
require_paths:
|
259
253
|
- lib
|
@@ -268,8 +262,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
268
262
|
- !ruby/object:Gem::Version
|
269
263
|
version: '0'
|
270
264
|
requirements: []
|
271
|
-
rubygems_version: 3.
|
272
|
-
signing_key:
|
265
|
+
rubygems_version: 3.2.3
|
266
|
+
signing_key:
|
273
267
|
specification_version: 4
|
274
268
|
summary: A tasks toolkit for rapid development.
|
275
269
|
test_files: []
|