qb 0.3.22 → 0.3.23

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
  SHA1:
3
- metadata.gz: e408a09eef662f25365672772cbfdeb04dc205cb
4
- data.tar.gz: df353222c9b15f4df2621960a2d6441ea8fd1805
3
+ metadata.gz: 3b3a5dfc104a28f159f72ffcfedf5932e2912448
4
+ data.tar.gz: b68ee826b4d98678abc8adffbe5e54395f0109f3
5
5
  SHA512:
6
- metadata.gz: 31e6d90c839d13a0d1e2f346e26ee7afd7b6dee3880e82c610587b500db91bdfd0bd307f5d52983c624585c765cc737ce30fa0784a4ecbc537d722ea9d062609
7
- data.tar.gz: 612dce52677e17eeb1bb45b23ded0e236eea217a198650e81dd39d3d6c8b80769b623600ecb77488f0ce2cb82758832304161c382c73041f41e5acd5c45763cf
6
+ metadata.gz: bcf7a62d2b0d4d0089c46e768e0660137a040593ec58b96a1bce6849be7e2d0680595d6f349cfc985efbc6d862dcf5ab11379851e83c7c0dad45836c95d5bd80
7
+ data.tar.gz: '0797e7ae29fb71602935b9959cf3df432ab0ed7f5098734e3dbf29c38f691a217015f9b0e49c1f69e6bd09366a73aafc515d33e809c3f1df1c1b6d1cb2ea6649'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.22
1
+ 0.3.23
@@ -0,0 +1,4 @@
1
+ `//lib/qb/labs`
2
+ ==============================================================================
3
+
4
+ Experimental stuff. Half baked (or less). Probably doesn't work. Subject to drastic change or complete removal. Don't use.
@@ -0,0 +1,173 @@
1
+ # encoding: UTF-8
2
+ # frozen_string_literal: true
3
+
4
+ # Requirements
5
+ # =======================================================================
6
+
7
+ # Stdlib
8
+ # -----------------------------------------------------------------------
9
+
10
+ # Deps
11
+ # -----------------------------------------------------------------------
12
+
13
+ # Project / Package
14
+ # -----------------------------------------------------------------------
15
+
16
+
17
+ # Refinements
18
+ # =======================================================================
19
+
20
+ using NRSER
21
+ using NRSER::Types
22
+
23
+
24
+ # Declarations
25
+ # =======================================================================
26
+
27
+ module QB::Labs; end
28
+ module QB::Labs::Atom; end
29
+
30
+
31
+ # Definitions
32
+ # =======================================================================
33
+
34
+
35
+ # @todo document QB::Atom::APM class.
36
+ class QB::Labs::Atom::APM
37
+
38
+
39
+ # Mixins
40
+ # ============================================================================
41
+
42
+ extend SingleForwardable
43
+
44
+ include SemanticLogger::Loggable
45
+
46
+ # Constants
47
+ # ======================================================================
48
+
49
+
50
+ # Class Methods
51
+ # ======================================================================
52
+
53
+ # @todo Document default method.
54
+ #
55
+ # @param [type] arg_name
56
+ # @todo Add name param description.
57
+ #
58
+ # @return [return_type]
59
+ # @todo Document return value.
60
+ #
61
+ def self.default
62
+ @default ||= new
63
+ end # .default
64
+
65
+
66
+ def self.find_bin
67
+ bin = ['apm-beta', 'apm'].find_map { |bin_name|
68
+ which = Cmds.chomp 'which %s', bin_name
69
+
70
+ if !which.empty? && File.executable?( which )
71
+ which
72
+ end
73
+ }
74
+
75
+ if bin.nil?
76
+ raise "Could not find apm bin!"
77
+ end
78
+
79
+ bin
80
+ end
81
+
82
+
83
+ # Forwarding
84
+ # ----------------------------------------------------------------------------
85
+
86
+ single_delegate [:list, :installed?] => :default
87
+
88
+
89
+ # Attributes
90
+ # ======================================================================
91
+
92
+
93
+ # What to use as the `apm` executable.
94
+ #
95
+ # @return [String]
96
+ #
97
+ attr_reader :bin
98
+
99
+
100
+
101
+ # Constructor
102
+ # ======================================================================
103
+
104
+ # Instantiate a new `QB::Atom::APM`.
105
+ def initialize bin: self.class.find_bin
106
+ @bin = bin
107
+ end # #initialize
108
+
109
+
110
+ # Instance Methods
111
+ # ======================================================================
112
+
113
+ # @todo Document list method.
114
+ #
115
+ # @param [type] arg_name
116
+ # @todo Add name param description.
117
+ #
118
+ # @return [return_type]
119
+ # @todo Document return value.
120
+ #
121
+ def list
122
+ Cmds.out!( '%{bin} list --bare', bin: bin ).
123
+ lines.
124
+ each_with_object( {} ) do |line, packages|
125
+ next if line =~ /\A\s+\z/
126
+
127
+ name, version = line.chomp.split( '@', 2 )
128
+
129
+ if [name, version].all? { |s| t.non_empty_str === s }
130
+ packages[name] = version
131
+ else
132
+ logger.warn "Unable to parse `apm list --bare line`",
133
+ line: line,
134
+ name: name,
135
+ version: version
136
+ end
137
+ end # each_with_object
138
+ end # #list
139
+
140
+
141
+ def version name:
142
+ list[t.non_empty_str.check( name )]
143
+ end
144
+
145
+
146
+ # @todo Document installed? method.
147
+ #
148
+ # @param [type] arg_name
149
+ # @todo Add name param description.
150
+ #
151
+ # @return [return_type]
152
+ # @todo Document return value.
153
+ #
154
+ def installed? package_name
155
+ list.key? t.non_empty_str.check( package_name )
156
+ end # #installed?
157
+
158
+
159
+ def install name:, force: false
160
+ if current_version = self.version( name )
161
+ logger.info "Atom package #{ name } already installed",
162
+ version: current_version
163
+
164
+ return false unless force
165
+
166
+ logger.info "Forcing installation..."
167
+ end
168
+
169
+
170
+
171
+ end
172
+
173
+ end # class QB::Atom::APM
data/qb.gemspec CHANGED
@@ -194,9 +194,9 @@ Gem::Specification.new do |spec|
194
194
  # Runtime Dependencies
195
195
  # ----------------------------------------------------------------------------
196
196
 
197
- spec.add_dependency "cmds", '~> 0.0', ">= 0.2.7"
198
- spec.add_dependency "nrser", '~> 0.1', ">= 0.1.4"
199
- spec.add_dependency "state_mate", '~> 0.0', ">= 0.1.0"
197
+ spec.add_dependency "cmds", '~> 0.2.7'
198
+ spec.add_dependency "nrser", '< 0.3', '>= 0.2.0.pre.2'
199
+ spec.add_dependency "state_mate", '~> 0.1.1'
200
200
 
201
201
  # Used to parse `ansible.cfg` files
202
202
  spec.add_dependency 'parseconfig', '~> 1.0', '>= 1.0.8'
@@ -0,0 +1,4 @@
1
+ `//roles/qb/labs`
2
+ ==============================================================================
3
+
4
+ Experimental stuff. Half baked (or less). Probably doesn't work. Subject to drastic change or complete removal. Don't use.
@@ -0,0 +1,9 @@
1
+ ---
2
+ ##############################################################################
3
+ # Variable defaults for `qb/atom/pkg` role
4
+ #
5
+ # @see http://docs.ansible.com/ansible/latest/playbooks_reuse_roles.html#role-default-variables
6
+ #
7
+ ##############################################################################
8
+
9
+ apm_bin: amp
@@ -0,0 +1,10 @@
1
+ ---
2
+ ##############################################################################
3
+ # Ansible metadata for `qb/atom/pkg` role
4
+ ##############################################################################
5
+
6
+ allow_duplicates: yes
7
+
8
+ dependencies: []
9
+ # - role: role-name
10
+
@@ -0,0 +1,47 @@
1
+ ---
2
+ ##############################################################################
3
+ # QB metadata for `qb/atom/pkg` 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/atom/pkg 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: pkg
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
@@ -0,0 +1,15 @@
1
+ ---
2
+ ##############################################################################
3
+ # Main tasks for `qb/atom/pkg` role
4
+ ##############################################################################
5
+
6
+ - name: >-
7
+ Install Atom package
8
+ qb.send:
9
+ to: QB::Atom::APM
10
+ method: install
11
+ kwds:
12
+ name: >-
13
+ {{ apm_package_name }}
14
+ register: apm_install_rsp
15
+
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.22
4
+ version: 0.3.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - nrser
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-02-24 00:00:00.000000000 Z
11
+ date: 2018-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -119,9 +119,6 @@ dependencies:
119
119
  requirement: !ruby/object:Gem::Requirement
120
120
  requirements:
121
121
  - - "~>"
122
- - !ruby/object:Gem::Version
123
- version: '0.0'
124
- - - ">="
125
122
  - !ruby/object:Gem::Version
126
123
  version: 0.2.7
127
124
  type: :runtime
@@ -129,51 +126,42 @@ dependencies:
129
126
  version_requirements: !ruby/object:Gem::Requirement
130
127
  requirements:
131
128
  - - "~>"
132
- - !ruby/object:Gem::Version
133
- version: '0.0'
134
- - - ">="
135
129
  - !ruby/object:Gem::Version
136
130
  version: 0.2.7
137
131
  - !ruby/object:Gem::Dependency
138
132
  name: nrser
139
133
  requirement: !ruby/object:Gem::Requirement
140
134
  requirements:
141
- - - "~>"
135
+ - - "<"
142
136
  - !ruby/object:Gem::Version
143
- version: '0.1'
137
+ version: '0.3'
144
138
  - - ">="
145
139
  - !ruby/object:Gem::Version
146
- version: 0.1.4
140
+ version: 0.2.0.pre.2
147
141
  type: :runtime
148
142
  prerelease: false
149
143
  version_requirements: !ruby/object:Gem::Requirement
150
144
  requirements:
151
- - - "~>"
145
+ - - "<"
152
146
  - !ruby/object:Gem::Version
153
- version: '0.1'
147
+ version: '0.3'
154
148
  - - ">="
155
149
  - !ruby/object:Gem::Version
156
- version: 0.1.4
150
+ version: 0.2.0.pre.2
157
151
  - !ruby/object:Gem::Dependency
158
152
  name: state_mate
159
153
  requirement: !ruby/object:Gem::Requirement
160
154
  requirements:
161
155
  - - "~>"
162
156
  - !ruby/object:Gem::Version
163
- version: '0.0'
164
- - - ">="
165
- - !ruby/object:Gem::Version
166
- version: 0.1.0
157
+ version: 0.1.1
167
158
  type: :runtime
168
159
  prerelease: false
169
160
  version_requirements: !ruby/object:Gem::Requirement
170
161
  requirements:
171
162
  - - "~>"
172
163
  - !ruby/object:Gem::Version
173
- version: '0.0'
174
- - - ">="
175
- - !ruby/object:Gem::Version
176
- version: 0.1.0
164
+ version: 0.1.1
177
165
  - !ruby/object:Gem::Dependency
178
166
  name: parseconfig
179
167
  requirement: !ruby/object:Gem::Requirement
@@ -296,6 +284,8 @@ files:
296
284
  - lib/qb/github/repo_id.rb
297
285
  - lib/qb/github/resource.rb
298
286
  - lib/qb/github/types.rb
287
+ - lib/qb/labs/README.md
288
+ - lib/qb/labs/atom/apm.rb
299
289
  - lib/qb/options.rb
300
290
  - lib/qb/options/option.rb
301
291
  - lib/qb/package.rb
@@ -616,6 +606,11 @@ files:
616
606
  - roles/qb/json/read/meta/main.yml
617
607
  - roles/qb/json/read/meta/qb.yml
618
608
  - roles/qb/json/read/tasks/main.yml
609
+ - roles/qb/labs/README.md
610
+ - roles/qb/labs/atom/apm/defaults/main.yml
611
+ - roles/qb/labs/atom/apm/meta/main.yml
612
+ - roles/qb/labs/atom/apm/meta/qb.yml
613
+ - roles/qb/labs/atom/apm/tasks/main.yml
619
614
  - roles/qb/nodejs/npm/hack/README.md
620
615
  - roles/qb/nodejs/npm/hack/meta/main.yml
621
616
  - roles/qb/nodejs/npm/hack/meta/qb.yml
@@ -804,7 +799,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
804
799
  version: '0'
805
800
  requirements: []
806
801
  rubyforge_project:
807
- rubygems_version: 2.5.2
802
+ rubygems_version: 2.5.2.2
808
803
  signing_key:
809
804
  specification_version: 4
810
805
  summary: qb is all about projects. named after everyone's favorite projects.