qb 0.3.15 → 0.3.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/qb/ansible/module.rb +80 -10
- data/lib/qb/package.rb +4 -14
- data/lib/qb/path.rb +21 -18
- data/lib/qb/repo.rb +5 -15
- data/lib/qb/repo/git.rb +69 -53
- data/lib/qb/repo/git/github.rb +12 -4
- data/lib/qb/repo/git/user.rb +33 -0
- data/lib/qb/role.rb +22 -22
- data/lib/qb/version.rb +1 -1
- data/library/path_facts +0 -90
- data/qb.gemspec +2 -2
- data/roles/qb/git/check/clean/defaults/main.yml +7 -0
- data/roles/qb/git/check/clean/meta/qb.yml +48 -0
- data/roles/qb/git/check/clean/tasks/main.yml +26 -10
- data/roles/qb/role/meta/qb.yml +3 -3
- data/roles/qb/role/qb/templates/qb.yml.j2 +1 -1
- data/roles/qb/ruby/dependency/.qb-options.yml +4 -0
- data/roles/qb/ruby/dependency/defaults/main.yml +23 -0
- data/roles/qb/ruby/dependency/filter_plugins/dependency_filters.py +207 -0
- data/roles/qb/ruby/dependency/meta/main.yml +10 -0
- data/roles/qb/ruby/dependency/meta/qb.yml +49 -0
- data/roles/qb/ruby/dependency/tasks/detect_type.yml +18 -0
- data/roles/qb/ruby/dependency/tasks/main.yml +16 -0
- data/roles/qb/ruby/dependency/tasks/types/gemfile.yml +6 -0
- data/roles/qb/ruby/dependency/tasks/types/gemspec.yml +71 -0
- data/roles/qb/{gem → ruby/gem}/bin_stubs/defaults/main.yml +1 -1
- data/roles/qb/{gem → ruby/gem}/bin_stubs/meta/main.yml +1 -1
- data/roles/qb/{gem → ruby/gem}/bin_stubs/meta/qb.yml +1 -1
- data/roles/qb/{gem → ruby/gem}/bin_stubs/tasks/main.yml +1 -1
- data/roles/qb/ruby/gem/bin_stubs/templates/console +33 -0
- data/roles/qb/{gem → ruby/gem}/bin_stubs/templates/rake +0 -0
- data/roles/qb/{gem → ruby/gem}/bin_stubs/templates/rspec +0 -0
- data/roles/qb/{gem → ruby/gem}/build/defaults/main.yml +1 -1
- data/roles/qb/{gem → ruby/gem}/build/meta/main.yml +0 -0
- data/roles/qb/{gem → ruby/gem}/build/meta/qb.yml +1 -1
- data/roles/qb/{gem → ruby/gem}/build/tasks/main.yml +1 -1
- data/roles/qb/{gem → ruby/gem}/install/defaults/main.yml +0 -0
- data/roles/qb/{gem → ruby/gem}/install/meta/main.yml +1 -1
- data/roles/qb/{gem → ruby/gem}/install/meta/qb.yml +0 -0
- data/roles/qb/{gem → ruby/gem}/install/tasks/main.yml +0 -0
- data/roles/qb/{gem → ruby/gem}/new/defaults/main.yml +1 -1
- data/roles/qb/{gem → ruby/gem}/new/meta/main.yml +1 -1
- data/roles/qb/{gem → ruby/gem}/new/meta/qb.yml +1 -1
- data/roles/qb/{gem → ruby/gem}/new/tasks/bundle_gem.yml +0 -0
- data/roles/qb/{gem → ruby/gem}/new/tasks/main.yml +1 -1
- data/roles/qb/ruby/gem/release/defaults/main.yml +5 -0
- data/roles/qb/{gem → ruby/gem}/release/meta/main.yml +1 -1
- data/roles/qb/ruby/gem/release/meta/qb.yml +27 -0
- data/roles/qb/{gem → ruby/gem}/release/tasks/main.yml +4 -6
- data/roles/qb/ruby/gem/release/tasks/release.yml +42 -0
- data/roles/qb/ruby/rspec/setup/defaults/main.yml +7 -0
- data/roles/qb/ruby/rspec/setup/meta/main.yml +9 -0
- data/roles/qb/ruby/rspec/setup/meta/qb.yml +47 -0
- data/roles/qb/ruby/rspec/setup/tasks/main.yml +4 -0
- data/roles/qb/ruby/rspec/setup/tasks/persistence.yml +0 -0
- data/roles/qb/ruby/yard/clean/defaults/main.yml +7 -0
- data/roles/qb/ruby/yard/clean/meta/main.yml +9 -0
- data/roles/qb/ruby/yard/clean/meta/qb.yml +48 -0
- data/roles/qb/ruby/yard/clean/tasks/main.yml +27 -0
- data/roles/qb/ruby/yard/config/.qb-options.yml +4 -0
- data/roles/qb/ruby/yard/config/defaults/main.yml +15 -0
- data/roles/qb/ruby/yard/config/library/yard.get_output_dir +59 -0
- data/roles/qb/ruby/yard/config/meta/main.yml +10 -0
- data/roles/qb/ruby/yard/config/meta/qb.yml +49 -0
- data/roles/qb/ruby/yard/config/tasks/get_yard_output_dir.yml +10 -0
- data/roles/qb/ruby/yard/config/tasks/main.yml +4 -0
- data/roles/qb/ruby/yard/setup/defaults/main.yml +6 -0
- data/roles/qb/ruby/yard/{meta → setup/meta}/main.yml +2 -1
- data/roles/qb/ruby/yard/{meta → setup/meta}/qb.yml +5 -5
- data/roles/qb/ruby/yard/setup/tasks/main.yml +35 -0
- data/roles/qb/ruby/yard/setup/tasks/versions/v0.9.yml +32 -0
- data/roles/qb/ruby/yard/setup/tasks/yardopts.yml +59 -0
- metadata +65 -35
- data/roles/qb/gem/bin_stubs/templates/console +0 -25
- data/roles/qb/gem/release/defaults/main.yml +0 -5
- data/roles/qb/gem/release/meta/qb.yml +0 -21
- data/roles/qb/ruby/yard/defaults/args.yml +0 -2
- data/roles/qb/ruby/yard/defaults/main.yml +0 -9
- data/roles/qb/ruby/yard/tasks/main.yml +0 -28
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
require "bundler/setup"
|
|
4
|
+
|
|
5
|
+
# Load `nrser` gem and use refinements if it's available
|
|
6
|
+
begin
|
|
7
|
+
require 'nrser'
|
|
8
|
+
rescue LoadError => error
|
|
9
|
+
puts "WARN -- Failed to load `nrser` gem."
|
|
10
|
+
puts "WARN -- Add it do your dependencies or edit #{ __FILE__ }"
|
|
11
|
+
else
|
|
12
|
+
using NRSER
|
|
13
|
+
using NRSER::Types
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
require '{{ qb_gem_info.name }}'
|
|
17
|
+
|
|
18
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
|
19
|
+
# with your gem easier. You can also use a different console, if you like.
|
|
20
|
+
|
|
21
|
+
# Load `pry` if it's available, falling back to `irb`
|
|
22
|
+
begin
|
|
23
|
+
require "pry"
|
|
24
|
+
rescue LoadError => error
|
|
25
|
+
puts "WARN -- Failed to load `pry` gem."
|
|
26
|
+
puts "WARN -- Add it do your dependencies or edit #{ __FILE__ }"
|
|
27
|
+
puts "INFO -- Starting `IRB`..."
|
|
28
|
+
|
|
29
|
+
require "irb"
|
|
30
|
+
IRB.start
|
|
31
|
+
else
|
|
32
|
+
Pry.start
|
|
33
|
+
end
|
|
File without changes
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
##############################################################################
|
|
3
|
-
# Variable defaults for `qb/gem/build` role
|
|
3
|
+
# Variable defaults for `qb/ruby/gem/build` role
|
|
4
4
|
##############################################################################
|
|
5
5
|
|
|
6
6
|
# Default the gem root to the DIRECTORY from QB
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
##############################################################################
|
|
3
|
-
# Main tasks for `qb/gem/build` role
|
|
3
|
+
# Main tasks for `qb/ruby/gem/build` role
|
|
4
4
|
##############################################################################
|
|
5
5
|
|
|
6
6
|
- when: get_root_facts is not defined
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
# meta/qb.yml file for qb/ruby/gem/release
|
|
3
|
+
#
|
|
4
|
+
# qb settings for this role. see README.md for more info.
|
|
5
|
+
#
|
|
6
|
+
|
|
7
|
+
description: |
|
|
8
|
+
Release a gem, handling version change, tagging, committing, pushing, etc.
|
|
9
|
+
|
|
10
|
+
Depends on `rake` and `bundler` gems, using the `release` task that
|
|
11
|
+
{Bundler::GemHelpers} provides.
|
|
12
|
+
|
|
13
|
+
# prefix for role variables
|
|
14
|
+
var_prefix: gem_release
|
|
15
|
+
|
|
16
|
+
# how to get a default for `dir` if it's not provided as the
|
|
17
|
+
default_dir: null
|
|
18
|
+
|
|
19
|
+
# Set to false to not save options
|
|
20
|
+
save_options: false
|
|
21
|
+
|
|
22
|
+
options:
|
|
23
|
+
# - name: example
|
|
24
|
+
# description: an example of a variable.
|
|
25
|
+
# required: false
|
|
26
|
+
# type: boolean # boolean (default) | string
|
|
27
|
+
# short: e
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
# tasks file for qb/gem/release
|
|
2
|
+
# tasks file for qb/ruby/gem/release
|
|
3
3
|
|
|
4
4
|
- name: >-
|
|
5
5
|
Check that the git repo at {{ gem_root }} is clean.
|
|
@@ -147,11 +147,9 @@
|
|
|
147
147
|
|
|
148
148
|
|
|
149
149
|
- name: >-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
chdir: >-
|
|
154
|
-
{{ gem_root }}
|
|
150
|
+
Do the actual release via Rake and Bundler's gem helper tasks
|
|
151
|
+
include_tasks: >-
|
|
152
|
+
{{ role_path }}/tasks/release.yml
|
|
155
153
|
|
|
156
154
|
|
|
157
155
|
- name: >-
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
##
|
|
2
|
+
# Do the release by invoking `rake release` if there's a `Rakefile`, and
|
|
3
|
+
# otherwise by executing a small script that manually loads up the
|
|
4
|
+
# {Bundler::GemHelper} tasks and execute the `release` task.
|
|
5
|
+
#
|
|
6
|
+
# NOTE This will *still* fail if the `rake` gem isn't present at all, but
|
|
7
|
+
# it's installed by default in all generated gems, so it seems like a
|
|
8
|
+
# decent bet it will be there.
|
|
9
|
+
#
|
|
10
|
+
##
|
|
11
|
+
|
|
12
|
+
- name: >-
|
|
13
|
+
See if there is a `Rakefile` in `{{ gem_root }}`
|
|
14
|
+
stat:
|
|
15
|
+
path: >-
|
|
16
|
+
{{ gem_root }}/Rakefile
|
|
17
|
+
register: gem_rakefile_stat_res
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
- when: gem_rakefile_stat_res.stat.exists
|
|
21
|
+
name: >-
|
|
22
|
+
Release via `bundle exec rake release` task
|
|
23
|
+
stream:
|
|
24
|
+
log: true
|
|
25
|
+
chdir: >-
|
|
26
|
+
{{ gem_root }}
|
|
27
|
+
cmd: bundle exec rake release
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
- when: not gem_rakefile_stat_res.stat.exists
|
|
31
|
+
name: >-
|
|
32
|
+
Release by executing a small script that calls the Rake release task
|
|
33
|
+
stream:
|
|
34
|
+
chdir: >-
|
|
35
|
+
{{ gem_root }}
|
|
36
|
+
stream:
|
|
37
|
+
log: true
|
|
38
|
+
cmd: bundle exec ruby -e <%= script %>
|
|
39
|
+
kwds:
|
|
40
|
+
script: |
|
|
41
|
+
Bundler::GemHelper.install_tasks
|
|
42
|
+
Rake::Task['release'].execute
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
##############################################################################
|
|
3
|
+
# Variable defaults for `qb/ruby/rspec/setup` role
|
|
4
|
+
#
|
|
5
|
+
# @see http://docs.ansible.com/ansible/latest/playbooks_reuse_roles.html#role-default-variables
|
|
6
|
+
#
|
|
7
|
+
##############################################################################
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
##############################################################################
|
|
3
|
+
# Ansible metadata for `qb/ruby/rspec/setup` role
|
|
4
|
+
##############################################################################
|
|
5
|
+
|
|
6
|
+
allow_duplicates: no
|
|
7
|
+
|
|
8
|
+
dependencies: []
|
|
9
|
+
# - role: role-name
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
##############################################################################
|
|
3
|
+
# QB metadata for `qb/ruby/rspec/setup` role.
|
|
4
|
+
#
|
|
5
|
+
# QB settings for this role.
|
|
6
|
+
#
|
|
7
|
+
# @see http://www.rubydoc.info/gems/qb/file/doc/qb_roles/metadata.md
|
|
8
|
+
#
|
|
9
|
+
##############################################################################
|
|
10
|
+
|
|
11
|
+
# Shown in help output, etc.
|
|
12
|
+
description: >-
|
|
13
|
+
TODO describe qb/ruby/rspec/setup role
|
|
14
|
+
|
|
15
|
+
# Gemspec-style requirements. Right now only `.gems.qb` is used.
|
|
16
|
+
requirements:
|
|
17
|
+
gems:
|
|
18
|
+
qb: ~> 0.3.0
|
|
19
|
+
|
|
20
|
+
# Prefix for role variables
|
|
21
|
+
var_prefix: setup
|
|
22
|
+
|
|
23
|
+
# How to get a default for `DIRECTORY` arg if not provided by user.
|
|
24
|
+
#
|
|
25
|
+
# @see http://www.rubydoc.info/gems/qb/file/doc/qb_roles/metadata/default_dir.md
|
|
26
|
+
#
|
|
27
|
+
default_dir: null # means use *must* provide `DIRECTORY` arg
|
|
28
|
+
|
|
29
|
+
# If `true`, QB will ensure `DIRECTORY` exists before starting the play.
|
|
30
|
+
mkdir: false
|
|
31
|
+
|
|
32
|
+
# Default user to become for play
|
|
33
|
+
default_user: null
|
|
34
|
+
|
|
35
|
+
# Save options in `.qb-options.yml` files
|
|
36
|
+
save_options: true
|
|
37
|
+
|
|
38
|
+
# Options to pass to `ansible-playbook`
|
|
39
|
+
ansible_options: {}
|
|
40
|
+
|
|
41
|
+
# Role CLI options that become Ansible vars
|
|
42
|
+
options: []
|
|
43
|
+
# - name: example
|
|
44
|
+
# description: an example of a variable.
|
|
45
|
+
# required: false
|
|
46
|
+
# type: boolean # boolean (default) | string
|
|
47
|
+
# short: e
|
|
File without changes
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
##############################################################################
|
|
3
|
+
# Variable defaults for `qb/ruby/yard/clean` role
|
|
4
|
+
#
|
|
5
|
+
# @see http://docs.ansible.com/ansible/latest/playbooks_reuse_roles.html#role-default-variables
|
|
6
|
+
#
|
|
7
|
+
##############################################################################
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
##############################################################################
|
|
3
|
+
# Ansible metadata for `qb/ruby/yard/clean` role
|
|
4
|
+
##############################################################################
|
|
5
|
+
|
|
6
|
+
allow_duplicates: yes
|
|
7
|
+
|
|
8
|
+
dependencies:
|
|
9
|
+
- role: qb/ruby/yard/config
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
##############################################################################
|
|
3
|
+
# QB metadata for `qb/ruby/yard/clean` role.
|
|
4
|
+
#
|
|
5
|
+
# QB settings for this role.
|
|
6
|
+
#
|
|
7
|
+
# @see http://www.rubydoc.info/gems/qb/file/doc/qb_roles/metadata.md
|
|
8
|
+
#
|
|
9
|
+
##############################################################################
|
|
10
|
+
|
|
11
|
+
# Shown in help output, etc.
|
|
12
|
+
description: >-
|
|
13
|
+
TODO describe qb/ruby/yard/clean role
|
|
14
|
+
|
|
15
|
+
# Gemspec-style requirements. Right now only `.gems.qb` is used.
|
|
16
|
+
requirements:
|
|
17
|
+
gems:
|
|
18
|
+
qb: ~> 0.3.0
|
|
19
|
+
|
|
20
|
+
# Prefix for role variables
|
|
21
|
+
var_prefix: clean
|
|
22
|
+
|
|
23
|
+
# How to get a default for `DIRECTORY` arg if not provided by user.
|
|
24
|
+
#
|
|
25
|
+
# @see http://www.rubydoc.info/gems/qb/file/doc/qb_roles/metadata/default_dir.md
|
|
26
|
+
#
|
|
27
|
+
default_dir:
|
|
28
|
+
from_role: qb/ruby/yard/config
|
|
29
|
+
|
|
30
|
+
# If `true`, QB will ensure `DIRECTORY` exists before starting the play.
|
|
31
|
+
mkdir: false
|
|
32
|
+
|
|
33
|
+
# Default user to become for play
|
|
34
|
+
default_user: null
|
|
35
|
+
|
|
36
|
+
# Save options in `.qb-options.yml` files
|
|
37
|
+
save_options: true
|
|
38
|
+
|
|
39
|
+
# Options to pass to `ansible-playbook`
|
|
40
|
+
ansible_options: {}
|
|
41
|
+
|
|
42
|
+
# Role CLI options that become Ansible vars
|
|
43
|
+
options: []
|
|
44
|
+
# - name: example
|
|
45
|
+
# description: an example of a variable.
|
|
46
|
+
# required: false
|
|
47
|
+
# type: boolean # boolean (default) | string
|
|
48
|
+
# short: e
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
##############################################################################
|
|
3
|
+
# Main tasks for `qb/ruby/yard/clean` role
|
|
4
|
+
##############################################################################
|
|
5
|
+
|
|
6
|
+
- name: >-
|
|
7
|
+
Remove `{{ bundle_root }}/.yardoc`
|
|
8
|
+
file:
|
|
9
|
+
path: >-
|
|
10
|
+
{{ bundle_root }}/.yardoc
|
|
11
|
+
state: absent
|
|
12
|
+
|
|
13
|
+
- when: yard_output_abs_dir is not defined
|
|
14
|
+
yard.get_output_dir:
|
|
15
|
+
bundle_root: >-
|
|
16
|
+
{{ bundle_root }}
|
|
17
|
+
|
|
18
|
+
- name: >-
|
|
19
|
+
Remove generated documents
|
|
20
|
+
stream:
|
|
21
|
+
cmd: git clean -fdX <%= path %>
|
|
22
|
+
kwds:
|
|
23
|
+
path: >-
|
|
24
|
+
{{ yard_output_dir }}
|
|
25
|
+
chdir: >-
|
|
26
|
+
{{ bundle_root }}
|
|
27
|
+
log: true
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
##############################################################################
|
|
3
|
+
# Variable defaults for `qb/ruby/yard/config` role
|
|
4
|
+
#
|
|
5
|
+
# @see http://docs.ansible.com/ansible/latest/playbooks_reuse_roles.html#role-default-variables
|
|
6
|
+
#
|
|
7
|
+
##############################################################################
|
|
8
|
+
|
|
9
|
+
bundle_root: >-
|
|
10
|
+
{{ qb_dir }}
|
|
11
|
+
|
|
12
|
+
yard_opts_file_rel_path: .yardopts
|
|
13
|
+
|
|
14
|
+
yard_opts_file_path: >-
|
|
15
|
+
{{ bundle_root | path_join( yard_opts_file_rel_path ) }}
|