atlassian-stash 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/bin/stash +12 -7
- data/lib/atlassian/stash/git.rb +4 -0
- 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: f108029674203b07feb43c788c21b500f2a681d6
|
4
|
+
data.tar.gz: 969ff0cb30cf6bb55fa6f137714aaf7b7ea8db50
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 283e3979a42e790293548dc7a5e5f0164c16e185dd7361b2853e7dd1a5b6b2e2114484f0817ebb39db3a930f90c771553e73c71d4735b5674eaa336c831e3cd8
|
7
|
+
data.tar.gz: db3063ea5662fbd4d1a9ad9ae065130d9e65aff823bf66e58a4b6087d9f7239cceee67a7268f4a290cf8915dcf163337a6b1bf7681247f604d6c705d3a776e6c
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.1
|
data/bin/stash
CHANGED
@@ -14,21 +14,26 @@ program :description, "Provides convenient functions for interacting with Atlass
|
|
14
14
|
include Atlassian::Stash
|
15
15
|
include Atlassian::Stash::Git
|
16
16
|
|
17
|
-
$
|
17
|
+
$configFileName = ".stashconfig.yml"
|
18
|
+
$configFile = File.join(ENV['HOME'], $configFileName)
|
18
19
|
|
19
20
|
def load_config
|
20
21
|
raise "No Stash configuration found; please run configure" unless File.exists? $configFile
|
21
22
|
config = YAML.load_file($configFile)
|
22
23
|
raise "Stash configuration file is incomplete, please re-run configure" unless config['username'] and config['stash_url']
|
23
|
-
config.merge! repo_config
|
24
|
+
config.merge! repo_config if repo_config
|
24
25
|
config
|
25
26
|
end
|
26
27
|
|
27
28
|
def repo_config
|
28
29
|
return @repo_config if @repo_config
|
29
|
-
|
30
|
-
|
31
|
-
|
30
|
+
|
31
|
+
repo_root = get_repo_root_directory.strip
|
32
|
+
repo_directory = Pathname.new(repo_root)
|
33
|
+
stash_config = repo_directory + $configFileName
|
34
|
+
if (stash_config.exist? && stash_config.file?)
|
35
|
+
@repo_config = YAML.load_file(stash_config)
|
36
|
+
end
|
32
37
|
@repo_config
|
33
38
|
end
|
34
39
|
|
@@ -66,7 +71,7 @@ end
|
|
66
71
|
|
67
72
|
command 'pull-request' do |c|
|
68
73
|
def extract_reviewers(args = [])
|
69
|
-
default_reviewers = Array(repo_config[:reviewers])
|
74
|
+
default_reviewers = repo_config.nil? ? [] : Array(repo_config[:reviewers])
|
70
75
|
default_reviewers.concat args.collect { |user|
|
71
76
|
user[1..-1] if user.start_with?("@")
|
72
77
|
}.compact
|
@@ -90,7 +95,7 @@ command 'pull-request' do |c|
|
|
90
95
|
source = args.shift
|
91
96
|
if args.empty? or args.first.start_with?("@")
|
92
97
|
target = source
|
93
|
-
source = get_current_branch
|
98
|
+
source = get_current_branch
|
94
99
|
reviewers = extract_reviewers args
|
95
100
|
else
|
96
101
|
target = args.shift
|
data/lib/atlassian/stash/git.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: atlassian-stash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seb Ruiz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: git
|