atlassian-stash 0.1.9 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +4 -4
- data/README.md +73 -18
- data/VERSION +1 -1
- data/lib/atlassian/stash/pull_request.rb +3 -2
- data/lib/atlassian/util/text_util.rb +3 -3
- metadata +18 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d0009ed8acaad9711ee3e29dbe108de0b0d2f75
|
4
|
+
data.tar.gz: 2bf41f992cf2678e4c2ef53c9f2a9253e14af500
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ac4b1f8d5130864804dc8188ad38091fd2855ad7d8fc0d853967bdbba83f74beadb328e9c1525f88789318e9f9f90ef474cee7d7a6cdecb3a0949b199282470
|
7
|
+
data.tar.gz: 176a1f547d3102e85f3034e79dfee1ccb3cdb18754b1058a3efcd07e9d534d248e51348ac28c600f65e522b7a667513b8f265ef04813250a4d5d502f8ffd55a6
|
data/Gemfile
CHANGED
@@ -3,10 +3,10 @@ source "http://rubygems.org"
|
|
3
3
|
# Example:
|
4
4
|
# gem "activesupport", ">= 2.3.5"
|
5
5
|
|
6
|
-
gem "git"
|
7
|
-
gem "json"
|
8
|
-
gem "commander"
|
9
|
-
gem "launchy"
|
6
|
+
gem "git", "~> 1.2.5"
|
7
|
+
gem "json", "~> 1.7.5"
|
8
|
+
gem "commander", "~> 4.1.2"
|
9
|
+
gem "launchy", "~> 2.4.2"
|
10
10
|
|
11
11
|
# Add dependencies to develop your gem here.
|
12
12
|
# Include everything needed to run rake, tests, features, etc.
|
data/README.md
CHANGED
@@ -3,8 +3,10 @@
|
|
3
3
|
## Installing this tool
|
4
4
|
This command line helper for Stash is written in Ruby and is deployed as a [Ruby Gem](https://rubygems.org/gems/atlassian-stash/). Installation is easy, simply run the following command
|
5
5
|
|
6
|
-
|
7
|
-
|
6
|
+
```
|
7
|
+
#!text
|
8
|
+
$> gem install atlassian-stash
|
9
|
+
```
|
8
10
|
|
9
11
|
(Protip: you might need to `sudo`)
|
10
12
|
|
@@ -14,35 +16,58 @@ Once the gem is installed, the command `stash` will be in your `$PATH`
|
|
14
16
|
Run `stash configure`. This will prompt for details about your Stash instance. If no password is provided, then you will be prompted for a password when executing commands to Stash. Currently, the password is stored in plain text in a configuration file, `~/.stashconfig.yml` which is protected with a permission bit of `0600`.
|
15
17
|
|
16
18
|
### Creating a pull request
|
17
|
-
Use the `pull-request` command to create a pull request in Stash.
|
19
|
+
Use the `pull-request` command to create a pull request in Stash. For example:
|
18
20
|
|
19
|
-
|
20
|
-
|
21
|
-
|
21
|
+
```
|
22
|
+
#!text
|
23
|
+
$> stash pull-request topicBranch master @michael
|
24
|
+
Create a pull request from branch 'topicBranch' into 'master' with 'michael' added as a reviewer
|
25
|
+
```
|
22
26
|
|
23
27
|
See the usage for command details
|
24
28
|
|
25
|
-
|
26
|
-
|
29
|
+
```
|
30
|
+
#!text
|
31
|
+
$> stash help pull-request
|
32
|
+
```
|
27
33
|
|
28
34
|
### Opening the Stash web UI
|
29
35
|
Use the `browse` command to open the Stash UI for your repository in the browser.
|
30
36
|
|
31
|
-
|
32
|
-
|
33
|
-
|
37
|
+
```
|
38
|
+
#!text
|
39
|
+
$> stash browse -b develop
|
40
|
+
Open the browser at the Stash repository page for the branch 'develop'
|
41
|
+
```
|
34
42
|
|
35
43
|
For more options, see the help
|
36
44
|
|
37
|
-
|
38
|
-
|
45
|
+
```
|
46
|
+
#!text
|
47
|
+
stash help browse
|
48
|
+
```
|
49
|
+
|
50
|
+
## Configuration options
|
51
|
+
|
52
|
+
Running `stash configure` will prepopulate `~/.stashconfig.yml` with a variety of options. Complete options are:
|
53
|
+
|
54
|
+
```
|
55
|
+
#!yaml
|
56
|
+
username: seb # username to connect to stash server.
|
57
|
+
password: s3cr3t # password for user. If ommitted, you will be prompted at the terminal when making a request to Stash
|
58
|
+
stash_url: https://stash.server.com # fully qualified stash url
|
59
|
+
open: true # opens newly created pull requests in the browser
|
60
|
+
ssl_no_verify: true # do not check ssl certificates for the configured stash server
|
61
|
+
```
|
39
62
|
|
40
63
|
## Troubleshooting
|
41
64
|
Q: I installed the gem, but the `stash` command doesn't work.
|
42
65
|
A: Do you have another command called `stash` or do you have an alias? Have a look where the command maps to
|
43
66
|
|
44
|
-
|
45
|
-
|
67
|
+
```
|
68
|
+
#!text
|
69
|
+
$> which -a stash
|
70
|
+
```
|
46
71
|
|
47
72
|
Then check the value of your $PATH
|
48
73
|
|
@@ -52,8 +77,38 @@ Thanks! Please [fork this project](https://bitbucket.org/atlassian/stash-command
|
|
52
77
|
### Build instructions
|
53
78
|
Building this gem is easy. To get started, run the following commands:
|
54
79
|
|
55
|
-
|
56
|
-
|
57
|
-
|
80
|
+
```
|
81
|
+
#!text
|
82
|
+
$> gem install bundler
|
83
|
+
$> bundle install
|
84
|
+
```
|
58
85
|
|
59
86
|
Now start hacking, and run the stash command by invoking `./bin/stash command`
|
87
|
+
|
88
|
+
### Testing
|
89
|
+
|
90
|
+
Easy:
|
91
|
+
|
92
|
+
```
|
93
|
+
$> rake test
|
94
|
+
```
|
95
|
+
|
96
|
+
### Releasing
|
97
|
+
|
98
|
+
#### Bumping versions
|
99
|
+
|
100
|
+
Use `rake version`:
|
101
|
+
|
102
|
+
```
|
103
|
+
version -- displays the current version
|
104
|
+
version:bump:major -- bump the major version by 1
|
105
|
+
version:bump:minor -- bump the a minor version by 1
|
106
|
+
version:bump:patch -- bump the patch version by 1
|
107
|
+
version:write -- writes out an explicit version
|
108
|
+
```
|
109
|
+
|
110
|
+
#### Releasing
|
111
|
+
|
112
|
+
```
|
113
|
+
$> rake release
|
114
|
+
```
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
@@ -28,11 +28,12 @@ module Atlassian
|
|
28
28
|
}
|
29
29
|
@resource = {
|
30
30
|
'title' => title,
|
31
|
-
'description' => description,
|
32
31
|
'fromRef' => fromRef,
|
33
32
|
'toRef' => toRef
|
34
33
|
}
|
35
34
|
|
35
|
+
@resource["description"] = description unless description.empty?
|
36
|
+
|
36
37
|
@resource["reviewers"] = reviewers.collect { |r|
|
37
38
|
{
|
38
39
|
'user' => {
|
@@ -73,7 +74,7 @@ module Atlassian
|
|
73
74
|
req.basic_auth username, password
|
74
75
|
req.body = resource.to_json
|
75
76
|
http = Net::HTTP.new(uri.host, uri.port, proxy_addr, proxy_port)
|
76
|
-
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
77
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE if @config["ssl_no_verify"]
|
77
78
|
http.use_ssl = uri.scheme.eql?("https")
|
78
79
|
|
79
80
|
response = http.start {|conn| conn.request(req) }
|
@@ -11,7 +11,7 @@ module Atlassian
|
|
11
11
|
issue_key_regex = /([A-Z]{1,10}-\d+)/
|
12
12
|
branch_components = branch_name.split(issue_key_regex);
|
13
13
|
|
14
|
-
parts = branch_components.each_with_index.map { |value, index|
|
14
|
+
parts = branch_components.each_with_index.map { |value, index|
|
15
15
|
(index % 2 === 0) ? value.gsub(/[\-_]/, ' ') : value
|
16
16
|
}
|
17
17
|
|
@@ -24,8 +24,8 @@ module Atlassian
|
|
24
24
|
str = str.to_s
|
25
25
|
return '' if str.empty?
|
26
26
|
|
27
|
-
str
|
27
|
+
str.slice(0, 1).upcase + str.slice(1, str.length)
|
28
28
|
end
|
29
29
|
end
|
30
30
|
end
|
31
|
-
end
|
31
|
+
end
|
metadata
CHANGED
@@ -1,71 +1,71 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: atlassian-stash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
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-
|
11
|
+
date: 2014-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: git
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 1.2.5
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 1.2.5
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: json
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 1.7.5
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 1.7.5
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: commander
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 4.1.2
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 4.1.2
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: launchy
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 2.4.2
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 2.4.2
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: shoulda
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|