qb 0.3.7 → 0.3.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/qb.rb +10 -4
- data/lib/qb/package.rb +102 -0
- data/lib/qb/package/gem.rb +153 -0
- data/lib/qb/package/version.rb +445 -422
- data/lib/qb/path.rb +219 -19
- data/lib/qb/repo/git.rb +90 -19
- data/lib/qb/role.rb +22 -4
- data/lib/qb/util/resource.rb +36 -0
- data/lib/qb/version.rb +1 -1
- data/qb.gemspec +1 -1
- data/roles/qb.qb_role/templates/qb.yml.j2 +3 -3
- data/roles/qb/gem/bin_stubs/defaults/main.yml +7 -0
- data/roles/qb/gem/bin_stubs/meta/main.yml +8 -0
- data/roles/qb/gem/bin_stubs/meta/qb.yml +76 -0
- data/roles/qb/gem/bin_stubs/tasks/main.yml +28 -0
- data/roles/qb/gem/bin_stubs/templates/console +25 -0
- data/roles/qb/gem/bin_stubs/templates/rake +3 -0
- data/roles/qb/gem/bin_stubs/templates/rspec +3 -0
- metadata +14 -4
@@ -0,0 +1,36 @@
|
|
1
|
+
# Requirements
|
2
|
+
# =======================================================================
|
3
|
+
|
4
|
+
# Deps
|
5
|
+
# -----------------------------------------------------------------------
|
6
|
+
|
7
|
+
require 'nrser'
|
8
|
+
|
9
|
+
|
10
|
+
# Refinements
|
11
|
+
# =======================================================================
|
12
|
+
|
13
|
+
require 'nrser/refinements'
|
14
|
+
using NRSER
|
15
|
+
|
16
|
+
|
17
|
+
# Declarations
|
18
|
+
# =======================================================================
|
19
|
+
|
20
|
+
module QB; end
|
21
|
+
module QB::Util; end
|
22
|
+
|
23
|
+
|
24
|
+
# Definitions
|
25
|
+
# =======================================================================
|
26
|
+
|
27
|
+
# Base class for QB "resources" - object representations of outside structures
|
28
|
+
# and concepts: things that live on disk, in remote systems or other runtimes.
|
29
|
+
#
|
30
|
+
# At the moment, it's simply an extension of {NRSER::Meta::Props::Base}, but
|
31
|
+
# it is here to serve as a centralized point to implement common behaviors,
|
32
|
+
# some of which would be lifted up to the {NRSER} properties system if they
|
33
|
+
# prove sufficiently useful and general.
|
34
|
+
#
|
35
|
+
class QB::Util::Resource < NRSER::Meta::Props::Base
|
36
|
+
end # class QB::Util::Resource
|
data/lib/qb/version.rb
CHANGED
data/qb.gemspec
CHANGED
@@ -95,7 +95,7 @@ Gem::Specification.new do |spec|
|
|
95
95
|
spec.add_development_dependency "pry"
|
96
96
|
|
97
97
|
spec.add_dependency "cmds",'~> 0.0', ">= 0.2.2"
|
98
|
-
spec.add_dependency "nrser",'~> 0.0', ">= 0.0.
|
98
|
+
spec.add_dependency "nrser",'~> 0.0', ">= 0.0.25"
|
99
99
|
spec.add_dependency "nrser-extras", '~> 0.0', ">= 0.0.3"
|
100
100
|
spec.add_dependency "state_mate", '~> 0.0', ">= 0.0.9"
|
101
101
|
spec.add_dependency 'parseconfig', '~> 1.0', '>= 1.0.8'
|
@@ -27,17 +27,17 @@ var_prefix: null
|
|
27
27
|
# - false
|
28
28
|
# - don't provide qb_dir (means doesn't load or save options either).
|
29
29
|
# - git_root
|
30
|
-
# - use the git root
|
30
|
+
# - use the git root of the directory that the `qb` command is invoked
|
31
31
|
# from. useful for 'project-centric' commands so they can be invoked
|
32
32
|
# from anywhere in the repo.
|
33
33
|
# - cwd
|
34
34
|
# - use the directory the `qb` command is invoked form.
|
35
35
|
# - {exe: PATH}
|
36
|
-
# - invoke an
|
36
|
+
# - invoke an executable, passing a JSON serialization of the options
|
37
37
|
# mapping their CLI names to values. path can be relative to role
|
38
38
|
# directory.
|
39
39
|
# - {find_up: FILENAME}
|
40
|
-
# - starting at the current
|
40
|
+
# - starting at the current directory and climbing up to parent
|
41
41
|
# directories, use the first one that contains FILENAME. error
|
42
42
|
# if none is found.
|
43
43
|
default_dir: null
|
@@ -0,0 +1,76 @@
|
|
1
|
+
---
|
2
|
+
# meta/qb.yml file for qb/gem/bin_stubs
|
3
|
+
#
|
4
|
+
# qb settings for this role. see README.md for more info.
|
5
|
+
#
|
6
|
+
|
7
|
+
# description of the role to show in it's help output.
|
8
|
+
description: >-
|
9
|
+
Add development bin stubs that take care of invoking Bundler, etc.
|
10
|
+
|
11
|
+
# Gemspec-style requirements. Right now only `gems:qb` is used, but plan to
|
12
|
+
# generalize in the future.
|
13
|
+
requirements:
|
14
|
+
gems:
|
15
|
+
qb: ~> 0.3.0
|
16
|
+
|
17
|
+
# prefix for role variables
|
18
|
+
var_prefix: false
|
19
|
+
|
20
|
+
# how to get a default for `dir` if it's not provided as the only
|
21
|
+
# positional argument. if a positional argument is provided it will
|
22
|
+
# override the method defined here.
|
23
|
+
#
|
24
|
+
# options:
|
25
|
+
#
|
26
|
+
# - null
|
27
|
+
# - require the value on the command line.
|
28
|
+
# - false
|
29
|
+
# - don't provide qb_dir (means doesn't load or save options either).
|
30
|
+
# - git_root
|
31
|
+
# - use the git root of the directory that the `qb` command is invoked
|
32
|
+
# from. useful for 'project-centric' commands so they can be invoked
|
33
|
+
# from anywhere in the repo.
|
34
|
+
# - cwd
|
35
|
+
# - use the directory the `qb` command is invoked form.
|
36
|
+
# - {exe: PATH}
|
37
|
+
# - invoke an executable, passing a JSON serialization of the options
|
38
|
+
# mapping their CLI names to values. path can be relative to role
|
39
|
+
# directory.
|
40
|
+
# - {find_up: FILENAME}
|
41
|
+
# - starting at the current directory and climbing up to parent
|
42
|
+
# directories, use the first one that contains FILENAME. error
|
43
|
+
# if none is found.
|
44
|
+
default_dir: git_root
|
45
|
+
# Doesn't work:
|
46
|
+
# find_up: '*.gemspec'
|
47
|
+
|
48
|
+
# If `true`, QB will ensure the default dir exists before starting the play.
|
49
|
+
#
|
50
|
+
# For legacy reasons, this defaults to `true` if not present, but we want to
|
51
|
+
# default declare it as `false` here so new roles can turn it on only if
|
52
|
+
# they need it.
|
53
|
+
#
|
54
|
+
mkdir: false
|
55
|
+
|
56
|
+
# default user to become for play
|
57
|
+
default_user: null
|
58
|
+
|
59
|
+
# set to false to not save options in .qb-options.yml files
|
60
|
+
save_options: true
|
61
|
+
|
62
|
+
# options to pass to ansible-playbook
|
63
|
+
ansible_options: {}
|
64
|
+
|
65
|
+
options:
|
66
|
+
# - name: example
|
67
|
+
# description: an example of a variable.
|
68
|
+
# required: false
|
69
|
+
# type: boolean # boolean (default) | string
|
70
|
+
# short: e
|
71
|
+
|
72
|
+
- name: force
|
73
|
+
description: >-
|
74
|
+
Overwrite any files of the same name already in place.
|
75
|
+
type: boolean
|
76
|
+
short: f
|
@@ -0,0 +1,28 @@
|
|
1
|
+
---
|
2
|
+
# tasks file for qb/gem/bin_stubs
|
3
|
+
|
4
|
+
# Figure out where they gonna go...
|
5
|
+
|
6
|
+
- name: >-
|
7
|
+
Set destination directory variable `bin_stub_dir`.
|
8
|
+
set_fact:
|
9
|
+
bin_stub_dir: >-
|
10
|
+
{{ item }}
|
11
|
+
with_first_found:
|
12
|
+
- "{{ gem_root | path_join( 'dev', 'bin' ) }}"
|
13
|
+
- "{{ gem_root | path_join( 'bin' ) }}"
|
14
|
+
|
15
|
+
- name: >-
|
16
|
+
Render templates to `{{ bin_stub_dir }}`.
|
17
|
+
with_items:
|
18
|
+
- console
|
19
|
+
- rake
|
20
|
+
- rspec
|
21
|
+
template:
|
22
|
+
src: >-
|
23
|
+
{{ item }}
|
24
|
+
dest: >-
|
25
|
+
{{ bin_stub_dir | path_join( item ) }}
|
26
|
+
mode: 0755
|
27
|
+
force: >-
|
28
|
+
{{ force }}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require 'nrser'
|
5
|
+
require '{{ qb_gem_info.name }}'
|
6
|
+
|
7
|
+
|
8
|
+
require 'nrser/refinements'
|
9
|
+
using NRSER
|
10
|
+
|
11
|
+
|
12
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
13
|
+
# with your gem easier. You can also use a different console, if you like.
|
14
|
+
|
15
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
16
|
+
begin
|
17
|
+
require "pry"
|
18
|
+
rescue LoadError => error
|
19
|
+
puts "Failed to load `pry` gem - add it to your Gemfile or edit this file"
|
20
|
+
|
21
|
+
require "irb"
|
22
|
+
IRB.start
|
23
|
+
else
|
24
|
+
Pry.start
|
25
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nrser
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -109,7 +109,7 @@ dependencies:
|
|
109
109
|
version: '0.0'
|
110
110
|
- - ">="
|
111
111
|
- !ruby/object:Gem::Version
|
112
|
-
version: 0.0.
|
112
|
+
version: 0.0.25
|
113
113
|
type: :runtime
|
114
114
|
prerelease: false
|
115
115
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -119,7 +119,7 @@ dependencies:
|
|
119
119
|
version: '0.0'
|
120
120
|
- - ">="
|
121
121
|
- !ruby/object:Gem::Version
|
122
|
-
version: 0.0.
|
122
|
+
version: 0.0.25
|
123
123
|
- !ruby/object:Gem::Dependency
|
124
124
|
name: nrser-extras
|
125
125
|
requirement: !ruby/object:Gem::Requirement
|
@@ -208,6 +208,8 @@ files:
|
|
208
208
|
- lib/qb/errors.rb
|
209
209
|
- lib/qb/options.rb
|
210
210
|
- lib/qb/options/option.rb
|
211
|
+
- lib/qb/package.rb
|
212
|
+
- lib/qb/package/gem.rb
|
211
213
|
- lib/qb/package/version.rb
|
212
214
|
- lib/qb/path.rb
|
213
215
|
- lib/qb/repo.rb
|
@@ -218,6 +220,7 @@ files:
|
|
218
220
|
- lib/qb/util/bundler.rb
|
219
221
|
- lib/qb/util/docker_mixin.rb
|
220
222
|
- lib/qb/util/interop.rb
|
223
|
+
- lib/qb/util/resource.rb
|
221
224
|
- lib/qb/util/stdio.rb
|
222
225
|
- lib/qb/version.rb
|
223
226
|
- library/git_mkdir.py
|
@@ -649,6 +652,13 @@ files:
|
|
649
652
|
- roles/qb/facts/meta/main.yml
|
650
653
|
- roles/qb/facts/meta/qb.yml
|
651
654
|
- roles/qb/facts/tasks/main.yml
|
655
|
+
- roles/qb/gem/bin_stubs/defaults/main.yml
|
656
|
+
- roles/qb/gem/bin_stubs/meta/main.yml
|
657
|
+
- roles/qb/gem/bin_stubs/meta/qb.yml
|
658
|
+
- roles/qb/gem/bin_stubs/tasks/main.yml
|
659
|
+
- roles/qb/gem/bin_stubs/templates/console
|
660
|
+
- roles/qb/gem/bin_stubs/templates/rake
|
661
|
+
- roles/qb/gem/bin_stubs/templates/rspec
|
652
662
|
- roles/qb/gem/new/defaults/main.yml
|
653
663
|
- roles/qb/gem/new/meta/main.yml
|
654
664
|
- roles/qb/gem/new/meta/qb.yml
|