runfile-tasks 0.5.3 → 0.5.4

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: fcc349ca21afd53c294174a39680782d34ecac53d380e624ccf1da31b836600d
4
- data.tar.gz: 2cf17d48577138d6c0e12f898afdc85755220d9d25002c47d638f7e02eaed692
3
+ metadata.gz: 34ce3da6faaa2115da6a60aef9d21d2e2f7b9ab0ffd83450f618bb90931bb2a2
4
+ data.tar.gz: a83f6488be48514933b7d24e8b5b1c8c1743b62dc17627176432e572a2913486
5
5
  SHA512:
6
- metadata.gz: 4f9c7ecd0762dff45b63c62f997a495bc8d8b374d7ce0d4ad4fd8a8a161db06812f3cf2a1c58721074e41c3ecb56f969180df1aa3a951fc8a39edd7872a46d9c
7
- data.tar.gz: 7f62fc7fb9bbdcd504476a5cbab74d720a933e933f025209d13f2f9a9adfaa1c70970ddf743cae06f315db9c8d61a3c9eecf9c0f8845ac532dc62e565982a151
6
+ metadata.gz: 75245b3e4dc36ee84bd65ad5c4c8c56e24366fe51bcdeeb7bdf9b4f2a277c5e463d6e71fd96f8d044c72433fd739b6b5fe85e6691324604edb7cb70569b99b44
7
+ data.tar.gz: f1fdafb4231b39e03d66bd5017d8f1e3d6c05adb75dbaae5f82aa33580be938953312848f426fb7153c05414e1e580afb1d67419048f309d044eb8ee7f310125
data/README.md CHANGED
@@ -1,202 +1,213 @@
1
- Runfile Tasks
2
- ==================================================
3
-
4
- A library of tasks ready to be included in your [Runfile]
5
-
6
- Install
7
- --------------------------------------------------
8
-
9
- Install the gem or require it in your Gemfile:
10
-
11
- ```ruby
12
- gem 'runfile-tasks'
13
- ```
14
-
15
- In your Runfile, you can include either all tasks:
16
-
17
- ```ruby
18
- require 'runfile-tasks'
19
- ```
20
-
21
- Or pick and choose from the various task categories:
22
-
23
- ```ruby
24
- require 'runfile-tasks/testing'
25
- ```
26
-
27
-
28
- Requiring the task packs does not make them available in your Runfile
29
- immediately. You need to activate any of the tasks you want as described
30
- below.
31
-
32
-
33
- Usage
34
- --------------------------------------------------
35
-
36
-
37
- Include any of the tasks you need in your Runfile like this:
38
-
39
- ```ruby
40
- require 'runfile-tasks'
41
-
42
- name "Greeter"
43
- summary "A sample Runfile"
44
- version "0.1.0"
45
-
46
- # Include rdoc tasks and rspec tasks
47
- RunfileTasks::Docs.rdoc
48
- RunfileTasks::Testing.rspec
49
-
50
- # The rest of your Runfile goes here
51
- action :hello do
52
- puts "world"
53
- end
54
-
55
- ```
56
-
57
-
58
- Task Index
59
- --------------------------------------------------
60
-
61
- ### Testing Tasks
62
-
63
- Require all testing tasks:
64
-
65
- ```ruby
66
- require 'runfile-tasks/testing'
67
- ```
68
-
69
- #### Testing with RSpec
70
-
71
- Commands Added:
72
-
73
- - `run spec [NAME] [TAG]` - Run all specs, a single spec file, or all specs
74
- matching a tag.
75
-
76
- ```ruby
77
- # Only require the rspec tasks
78
- require 'runfile-tasks/testing/rspec'
79
-
80
- # Include the rspec tasks with default configuration
81
- RunfileTasks::Testing.rspec
82
-
83
- # Set the Runfile action to 'test' instead of the default 'spec'
84
- RunfileTasks::Testing.rspec 'test'
85
-
86
- # Change the default options with a hash (these are the defaults)
87
- RunfileTasks::rspec action: 'spec',
88
- pattern: './spec/**/*_spec.rb', command: 'rspec'
89
-
90
- ```
91
-
92
-
93
- #### Testing with Minitest
94
-
95
- Commands Added:
96
-
97
- - `test [NAME]` - Run all tests or a single test file.
98
-
99
- ```ruby
100
- # Only require the minitest tasks
101
- require 'runfile-tasks/testing/minitest'
102
-
103
- # Include the minitest tasks with default configuration
104
- RunfileTasks::Testing.minitest
105
-
106
- # Set the file pattern to look for (this is the default)
107
- RunfileTasks::Testing.minitest './test/*_test.rb'
108
-
109
- ```
110
-
111
- #### Testing with Cucumber
112
-
113
- Commands Added:
114
-
115
- - `(feature|features) [<tag_or_file> --list --fast]` - Run cucumber feature
116
- tests or show list of available features.
117
- - `stepdefs` - Generate a markdown document from the step definitions
118
-
119
- ```ruby
120
- # Only require the cucumber tasks
121
- require 'runfile-tasks/testing/cucumber'
122
-
123
- # Include the cucumber tasks with default configuration
124
- RunfileTasks::Testing.cucumber
125
-
126
- # Include the step definitions markdown generator
127
- RunfileTasks::Testing.cucumber_stepdefs
128
- ```
129
-
130
-
131
- ### Gem Authoring Tasks
132
-
133
- Commands Added:
134
-
135
- - `build [--install]` - Build gem from gemspec and move it to 'gems' folder.
136
- Use --install to also install it.
137
- - `install [--remote]` - Install gem from local gem file or from rubygems
138
- (--remote).
139
- - `publish` - Publish gem to rubygems. Make sure to 'run gem build' before
140
- you publish.
141
- - `yank [VERSION]` - Yank gem from rubygems.
142
-
143
-
144
- ```ruby
145
- require 'runfile-tasks/rubygems'
146
-
147
- # Include the tasks with default configuration. Pass in your gem name.
148
- RunfileTasks::RubyGems.all 'my-gem'
149
-
150
- # Set the folder where gems are copied after they are built (default)
151
- RunfileTasks::RubyGems.all 'my-gem', 'gems'
152
-
153
- # Include only the `build` and `install` tasks
154
- RunfileTasks::RubyGems.build 'my-gem'
155
-
156
- # Include only the `publish` and `yank` tasks
157
- RunfileTasks::RubyGems.publish 'my-gem'
158
- ```
159
-
160
-
161
- ### Documentation Tasks
162
-
163
- Commands Added:
164
-
165
- - `rdoc [-- OPTIONS...]` - Generate documentation using the rdoc command
166
- line tool. To pass arguments to rdoc, place them after '--'.
167
-
168
-
169
- ```ruby
170
- require 'runfile-tasks/docs'
171
-
172
- # Include the tasks with default configuration.
173
- RunfileTasks::Docs.rdoc
174
-
175
- # Set the files to be considered (default below)
176
- RunfileTasks::Docs.rdoc '**/*.{rb,md}'
177
-
178
- # Pass any additional option directly to rdoc (defaults below)
179
- RunfileTasks::Docs.rdoc '**/*.{rb,md}', ["--main README.md", "--all",]
180
- ```
181
-
182
-
183
- ### Changelog Tasks
184
-
185
- This command requires that you have [github_changelog_generator] in your Gemfile.
186
-
187
- Commands Added:
188
-
189
- - `changelog [--commit]` - Generates a changelog and optionally commits it to the git repository.
190
-
191
-
192
- ```ruby
193
- require 'runfile-tasks/changelog'
194
-
195
- # Include the task and provide your github user/repo
196
- RunfileTasks::Changelog.generator "DannyBen/runfile"
197
- ```
198
-
199
- ---
200
- [Runfile]: https://github.com/DannyBen/runfile
201
- [random cat]: http://thecatapi.com/api/images/get
202
- [github_changelog_generator]: https://github.com/github-changelog-generator/github-changelog-generator
1
+ # Runfile Tasks
2
+
3
+ A library of tasks ready to be included in your [Runfile]
4
+
5
+ ## Install
6
+
7
+ Install the gem or require it in your Gemfile:
8
+
9
+ ```ruby
10
+ gem 'runfile-tasks'
11
+ ```
12
+
13
+ In your Runfile, you can include either all tasks:
14
+
15
+ ```ruby
16
+ require 'runfile-tasks'
17
+ ```
18
+
19
+ Or pick and choose from the various task categories:
20
+
21
+ ```ruby
22
+ require 'runfile-tasks/testing'
23
+ ```
24
+
25
+
26
+ Requiring the task packs does not make them available in your Runfile
27
+ immediately. You need to activate any of the tasks you want as described
28
+ below.
29
+
30
+
31
+ ## Usage
32
+
33
+ Include any of the tasks you need in your Runfile like this:
34
+
35
+ ```ruby
36
+ require 'runfile-tasks'
37
+
38
+ name "Greeter"
39
+ summary "A sample Runfile"
40
+ version "0.1.0"
41
+
42
+ # Include rdoc tasks and rspec tasks
43
+ RunfileTasks::Docs.rdoc
44
+ RunfileTasks::Testing.rspec
45
+
46
+ # The rest of your Runfile goes here
47
+ action :hello do
48
+ puts "world"
49
+ end
50
+
51
+ ```
52
+
53
+
54
+ ## Task Index
55
+
56
+ ### Testing Tasks
57
+
58
+ Require all testing tasks:
59
+
60
+ ```ruby
61
+ require 'runfile-tasks/testing'
62
+ ```
63
+
64
+ #### Testing with RSpec
65
+
66
+ Commands Added:
67
+
68
+ - `run spec [NAME] [TAG]` - Run all specs, a single spec file, or all specs
69
+ matching a tag.
70
+
71
+ ```ruby
72
+ # Only require the rspec tasks
73
+ require 'runfile-tasks/testing/rspec'
74
+
75
+ # Include the rspec tasks with default configuration
76
+ RunfileTasks::Testing.rspec
77
+
78
+ # Set the Runfile action to 'test' instead of the default 'spec'
79
+ RunfileTasks::Testing.rspec 'test'
80
+
81
+ # Change the default options with a hash (these are the defaults)
82
+ RunfileTasks::rspec action: 'spec',
83
+ pattern: './spec/**/*_spec.rb', command: 'rspec'
84
+
85
+ ```
86
+
87
+
88
+ #### Testing with Minitest
89
+
90
+ Commands Added:
91
+
92
+ - `test [NAME]` - Run all tests or a single test file.
93
+
94
+ ```ruby
95
+ # Only require the minitest tasks
96
+ require 'runfile-tasks/testing/minitest'
97
+
98
+ # Include the minitest tasks with default configuration
99
+ RunfileTasks::Testing.minitest
100
+
101
+ # Set the file pattern to look for (this is the default)
102
+ RunfileTasks::Testing.minitest './test/*_test.rb'
103
+
104
+ ```
105
+
106
+ #### Testing with Cucumber
107
+
108
+ Commands Added:
109
+
110
+ - `(feature|features) [<tag_or_file> --list --fast]` - Run cucumber feature
111
+ tests or show list of available features.
112
+ - `stepdefs` - Generate a markdown document from the step definitions
113
+
114
+ ```ruby
115
+ # Only require the cucumber tasks
116
+ require 'runfile-tasks/testing/cucumber'
117
+
118
+ # Include the cucumber tasks with default configuration
119
+ RunfileTasks::Testing.cucumber
120
+
121
+ # Include the step definitions markdown generator
122
+ RunfileTasks::Testing.cucumber_stepdefs
123
+ ```
124
+
125
+
126
+ ### Gem Authoring Tasks
127
+
128
+ Commands Added:
129
+
130
+ - `build [--install]` - Build gem from gemspec and move it to 'gems' folder.
131
+ Use --install to also install it.
132
+ - `install [--remote]` - Install gem from local gem file or from rubygems
133
+ (--remote).
134
+ - `publish` - Publish gem to rubygems. Make sure to 'run gem build' before
135
+ you publish.
136
+ - `yank [VERSION]` - Yank gem from rubygems.
137
+
138
+
139
+ ```ruby
140
+ require 'runfile-tasks/rubygems'
141
+
142
+ # Include the tasks with default configuration. Pass in your gem name.
143
+ RunfileTasks::RubyGems.all 'my-gem'
144
+
145
+ # Set the folder where gems are copied after they are built (default)
146
+ RunfileTasks::RubyGems.all 'my-gem', 'gems'
147
+
148
+ # Include only the `build` and `install` tasks
149
+ RunfileTasks::RubyGems.build 'my-gem'
150
+
151
+ # Include only the `publish` and `yank` tasks
152
+ RunfileTasks::RubyGems.publish 'my-gem'
153
+ ```
154
+
155
+
156
+ ### Documentation Tasks
157
+
158
+ Commands Added:
159
+
160
+ - `rdoc [-- OPTIONS...]` - Generate documentation using the rdoc command
161
+ line tool. To pass arguments to rdoc, place them after '--'.
162
+
163
+
164
+ ```ruby
165
+ require 'runfile-tasks/docs'
166
+
167
+ # Include the tasks with default configuration.
168
+ RunfileTasks::Docs.rdoc
169
+
170
+ # Set the files to be considered (default below)
171
+ RunfileTasks::Docs.rdoc '**/*.{rb,md}'
172
+
173
+ # Pass any additional option directly to rdoc (defaults below)
174
+ RunfileTasks::Docs.rdoc '**/*.{rb,md}', ["--main README.md", "--all",]
175
+ ```
176
+
177
+
178
+ ### Docker Tasks
179
+
180
+ Commands Added:
181
+
182
+ - `docker build`
183
+ - `docker test`
184
+ - `docker push`
185
+
186
+ ```ruby
187
+ require 'runfile-tasks/docker'
188
+
189
+ # Provide an image name and version
190
+ RunfileTasks::Docker.all "dannyben/runfile", "0.1.0"
191
+ ```
192
+
193
+
194
+ ### Changelog Tasks
195
+
196
+ This command requires that you have [github_changelog_generator] in your Gemfile.
197
+
198
+ Commands Added:
199
+
200
+ - `changelog [--commit]` - Generates a changelog and optionally commits it to the git repository.
201
+
202
+
203
+ ```ruby
204
+ require 'runfile-tasks/changelog'
205
+
206
+ # Include the task and provide your github user/repo
207
+ RunfileTasks::Changelog.generator "DannyBen/runfile"
208
+ ```
209
+
210
+ ---
211
+ [Runfile]: https://github.com/DannyBen/runfile
212
+ [random cat]: http://thecatapi.com/api/images/get
213
+ [github_changelog_generator]: https://github.com/github-changelog-generator/github-changelog-generator
@@ -1,6 +1,7 @@
1
- require "runfile-tasks/version"
2
-
3
- require "runfile-tasks/rubygems"
4
- require "runfile-tasks/docs"
5
- require "runfile-tasks/testing"
6
- require "runfile-tasks/changelog"
1
+ require "runfile-tasks/version"
2
+
3
+ require "runfile-tasks/rubygems"
4
+ require "runfile-tasks/docs"
5
+ require "runfile-tasks/testing"
6
+ require "runfile-tasks/changelog"
7
+ require "runfile-tasks/docker"
@@ -0,0 +1 @@
1
+ require 'runfile-tasks/docker/docker'
@@ -0,0 +1,61 @@
1
+ require 'runfile-tasks/refinements'
2
+
3
+ module RunfileTasks
4
+ module Docker
5
+ extend self
6
+ using Refinements
7
+
8
+ def all(image_name, image_version)
9
+ build image_name, image_version
10
+ test image_name, image_version
11
+ push image_name, image_version
12
+ end
13
+
14
+ def build(image_name, image_version)
15
+ command "docker"
16
+
17
+ help "Build the docker image"
18
+ action :build, :b do |args|
19
+ puts "g`Building docker image #{image_name}`".in_color
20
+ system "docker build -t #{image_name} ."
21
+ system "docker tag #{image_name} #{image_name}:#{image_version}"
22
+ system "docker images | grep #{image_name}"
23
+ end
24
+
25
+ endcommand
26
+ end
27
+
28
+ def test(image_name, image_version)
29
+ command "docker"
30
+
31
+ help "Test the --version flag in the dockerized version"
32
+ action :test, :t do |args|
33
+ docker_version = `docker run --rm #{image_name} --version`.chomp
34
+ if docker_version != image_version
35
+ puts "r`FAIL: docker version is #{docker_version}, expected #{image_version}`".in_color
36
+ exit 1
37
+ else
38
+ puts "g`PASS: docker version is #{docker_version}`"
39
+ end
40
+ end
41
+
42
+ endcommand
43
+ end
44
+
45
+ def push(image_name, image_version)
46
+ command "docker"
47
+
48
+ help "Build the docker image"
49
+ action :push, :p do |args|
50
+ puts "g`Pushing docker image #{image_name}`".in_color
51
+ system "docker push #{image_name}"
52
+ system "docker push #{image_name}:#{image_version}"
53
+ end
54
+
55
+ endcommand
56
+ end
57
+
58
+
59
+ end
60
+
61
+ end
@@ -0,0 +1 @@
1
+ require 'runfile-tasks/docker/all'
@@ -1,3 +1,3 @@
1
1
  module RunfileTasks
2
- VERSION = "0.5.3"
2
+ VERSION = "0.5.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runfile-tasks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Ben Shitrit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-28 00:00:00.000000000 Z
11
+ date: 2022-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: runfile
@@ -34,6 +34,9 @@ files:
34
34
  - lib/runfile-tasks.rb
35
35
  - lib/runfile-tasks/all.rb
36
36
  - lib/runfile-tasks/changelog.rb
37
+ - lib/runfile-tasks/docker.rb
38
+ - lib/runfile-tasks/docker/all.rb
39
+ - lib/runfile-tasks/docker/docker.rb
37
40
  - lib/runfile-tasks/docs.rb
38
41
  - lib/runfile-tasks/docs/all.rb
39
42
  - lib/runfile-tasks/docs/rdoc.rb
@@ -66,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
66
69
  - !ruby/object:Gem::Version
67
70
  version: '0'
68
71
  requirements: []
69
- rubygems_version: 3.2.25
72
+ rubygems_version: 3.3.3
70
73
  signing_key:
71
74
  specification_version: 4
72
75
  summary: Runfile tasks collection