qb 0.1.59 → 0.1.60
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/qb/version.rb +1 -1
- data/library/qb_facts.py +18 -0
- data/roles/qb.gitignore/defaults/main.yml +0 -1
- data/roles/qb.gitignore/tasks/main.yml +24 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b47bdac25f6db4d1fea5cf3b018229d4b94a0987
|
4
|
+
data.tar.gz: d3a4cdd1d235048c4f49dbbaf7824fe77706ce46
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95cc0afa926ddf49719cbe7b77effbeb99923dc7241430fa5adcf1ead739434662aca811d9978b9f077520a25095b6347887ea99b261bf763c178c23b27d1c62
|
7
|
+
data.tar.gz: 46ab3b3bd3866aa64cb3982be5fdd126b5ba479dd550f4d7e05c292e3fc49c4506381e891ac951ef05e998e60f8ea21df2547b0b7e44919a9d28a0cfe9d12b85
|
data/lib/qb/version.rb
CHANGED
data/library/qb_facts.py
CHANGED
@@ -4,6 +4,7 @@ import subprocess
|
|
4
4
|
import os
|
5
5
|
import glob
|
6
6
|
import json
|
7
|
+
import re
|
7
8
|
|
8
9
|
def gemspec_path(dir):
|
9
10
|
paths = glob.glob(os.path.join(dir, '*.gemspec'))
|
@@ -51,6 +52,7 @@ def main():
|
|
51
52
|
'qb_git_user_name': ['git', 'config', 'user.name'],
|
52
53
|
'qb_git_user_email': ['git', 'config', 'user.email'],
|
53
54
|
'qb_git_repo_root': ['git', 'rev-parse', '--show-toplevel'],
|
55
|
+
'qb_git_origin_url': ['git', 'remote', 'get-url', 'origin'],
|
54
56
|
}
|
55
57
|
|
56
58
|
for key, cmd in cmds.iteritems():
|
@@ -62,6 +64,22 @@ def main():
|
|
62
64
|
except subprocess.CalledProcessError as e:
|
63
65
|
pass
|
64
66
|
|
67
|
+
if facts['qb_git_origin_url']:
|
68
|
+
# git@github.com:<owner>/<name>.git
|
69
|
+
ssh_re = re.compile('^git@github\.com\:(.*)/(.*)\.git$')
|
70
|
+
# https://github.com/<owner>/<name>.git
|
71
|
+
https_re = re.compile('^https\://github\.com/(.*)/(.*)\.git$')
|
72
|
+
|
73
|
+
ssh_match = ssh_re.match(facts['qb_git_origin_url'])
|
74
|
+
https_match = https_re.match(facts['qb_git_origin_url'])
|
75
|
+
|
76
|
+
if ssh_match:
|
77
|
+
facts['qb_github_owner'] = ssh_match.group(1)
|
78
|
+
facts['qb_github_name'] = ssh_match.group(2)
|
79
|
+
elif https_match:
|
80
|
+
facts['qb_github_owner'] = https_match.group(1)
|
81
|
+
facts['qb_github_name'] = https_match.group(2)
|
82
|
+
|
65
83
|
if is_gem(qb_dir):
|
66
84
|
ruby = '''
|
67
85
|
require 'json'
|
@@ -1,18 +1,39 @@
|
|
1
1
|
---
|
2
2
|
# tasks file for qb.gitignore
|
3
3
|
|
4
|
-
-
|
4
|
+
- debug: var=gitignore_name verbosity=1
|
5
|
+
|
6
|
+
- debug: var=gitignore_dest verbosity=1
|
7
|
+
|
8
|
+
- name: >-
|
9
|
+
Create {{ gitignore_dest }} directory
|
5
10
|
file:
|
6
11
|
path: "{{ gitignore_dest }}"
|
7
12
|
state: directory
|
8
13
|
|
9
|
-
- name:
|
14
|
+
- name: >-
|
15
|
+
Create {{ gitignore_dest }}/.gitignore
|
10
16
|
copy:
|
11
17
|
content: ''
|
12
18
|
dest: "{{ gitignore_dest }}/.gitignore"
|
13
19
|
force: "{{ gitignore_force }}"
|
20
|
+
|
21
|
+
- name: >-
|
22
|
+
Read {{ gitignore_name }}.gitignore
|
23
|
+
when: gitignore_name is defined
|
24
|
+
set_fact:
|
25
|
+
gitignore_content: >-
|
26
|
+
{{
|
27
|
+
lookup(
|
28
|
+
'file',
|
29
|
+
role_path+'/files/gitignore/'+gitignore_name+'.gitignore'
|
30
|
+
)
|
31
|
+
}}
|
32
|
+
|
33
|
+
- debug: var=gitignore_content verbosity=1
|
14
34
|
|
15
|
-
- name:
|
35
|
+
- name: >-
|
36
|
+
Modify {{ gitignore_dest }}/.gitignore
|
16
37
|
blockinfile:
|
17
38
|
content: "{{ gitignore_content }}"
|
18
39
|
dest: "{{ gitignore_dest }}/.gitignore"
|
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.1.
|
4
|
+
version: 0.1.60
|
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-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|