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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 525b8fc6f33af17395fee3864440f87e84d1a304
4
- data.tar.gz: 75799c477c38aa0f829f5a2959f861f69ace5f29
3
+ metadata.gz: b47bdac25f6db4d1fea5cf3b018229d4b94a0987
4
+ data.tar.gz: d3a4cdd1d235048c4f49dbbaf7824fe77706ce46
5
5
  SHA512:
6
- metadata.gz: ba313fc1a24ef0492e8e99819bf0cc99e622a6986e919e84254d1eea9186787f9b2572775d6c27711fee82b806e5a6ab85de7bf4bd08548c02bc4e12eb77a73e
7
- data.tar.gz: d031167eff96da58faeac5ab03ac30897e0718d2b9acf43b2caf4d873dbde7076846a271b0968fa8f928efc8f850d6045f3a65b882782f8743e0cb6be931e7d3
6
+ metadata.gz: 95cc0afa926ddf49719cbe7b77effbeb99923dc7241430fa5adcf1ead739434662aca811d9978b9f077520a25095b6347887ea99b261bf763c178c23b27d1c62
7
+ data.tar.gz: 46ab3b3bd3866aa64cb3982be5fdd126b5ba479dd550f4d7e05c292e3fc49c4506381e891ac951ef05e998e60f8ea21df2547b0b7e44919a9d28a0cfe9d12b85
@@ -1,7 +1,7 @@
1
1
  module QB
2
2
  GEM_NAME = 'qb'
3
3
 
4
- VERSION = "0.1.59"
4
+ VERSION = "0.1.60"
5
5
 
6
6
  def self.gemspec
7
7
  Gem.loaded_specs[GEM_NAME]
@@ -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'
@@ -2,6 +2,5 @@
2
2
  # defaults file for qb.gitignore
3
3
 
4
4
  gitignore_dest: "{{ qb_dir }}"
5
- gitignore_content: "{{ lookup('file', 'gitignore/' + gitignore_name + '.gitignore') }}"
6
5
  gitignore_tag: "{{ gitignore_name }}.gitingore"
7
6
  gitignore_force: false
@@ -1,18 +1,39 @@
1
1
  ---
2
2
  # tasks file for qb.gitignore
3
3
 
4
- - name: create directory
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: create .gitignore
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: modify .gitignore
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.59
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-04-29 00:00:00.000000000 Z
11
+ date: 2017-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler