sah 0.0.10 → 0.0.11

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 161e4df3c4dfc208f124837647d60065c8f912e0
4
- data.tar.gz: 022de9c23c9c0e8d2082fd13935e2869c11b91c4
3
+ metadata.gz: f4ce5e276d4ed9cf5530715653dcd53ebfb3d85a
4
+ data.tar.gz: cbde0a3c90358917d784c1c21809c8c8f8d7290b
5
5
  SHA512:
6
- metadata.gz: bb87ed8c0ed8e53681afb97e364c2f7f76f81c198e97c9775b9d0f0a4298e9062791d45ab188103e045855df1919e1739689be25652fac2bf938f805cfd0792c
7
- data.tar.gz: b7b8125d1bd18a7b84b75874255ad4df6c40027adb85332029e769e18fe4b325e1e2959cfc3aeaab3feb07bfcb488621c47e79e7bfb92e80620830b4bab7bdb9
6
+ metadata.gz: 6f8a902d17c4f785a5edc0b8c73f962d325efbe2e6c303bf2796d8111b24f0925f86b8f84954e6a8c5cfc9f16b071e0569d5a3a205e374706d79bd09587b6e86
7
+ data.tar.gz: b1c0c66496e0232d7d4d0fda0ecf910a523df626020f76fbfc29e01d72d1e5d93cb4baf191bf8ffa3c00b3196cd495ea767f3bd948ebd2db92b9b1ba285352f7
data/README.md CHANGED
@@ -58,14 +58,14 @@ If you use multiple Bitbucket Server, define profile(s) and specify it.
58
58
 
59
59
  ### clone
60
60
 
61
- sah clone PROJECT/REPO
62
- > git clone ssh://git@example.com:7999/PROJECT/REPO
61
+ sah clone PROJECT/REPO [DIR]
62
+ > git clone ssh://git@example.com:7999/PROJECT/REPO [DIR]
63
63
 
64
- sah clone REPO
65
- > git clone ssh://git@example.com:7999/~YOUR_NAME/ERPO
64
+ sah clone REPO [DIR]
65
+ > git clone ssh://git@example.com:7999/~YOUR_NAME/ERPO [DIR]
66
66
 
67
- sah clone ~USERNAME/REPO
68
- > git clone ssh://git@example.com:7999/~USERNAME/REPO
67
+ sah clone ~USERNAME/REPO [DIR]
68
+ > git clone ssh://git@example.com:7999/~USERNAME/REPO [DIR]
69
69
 
70
70
  ### create
71
71
 
data/lib/sah/cli.rb CHANGED
@@ -104,18 +104,18 @@ module Sah
104
104
  Launchy.open(url, debug: config.verbose)
105
105
  end
106
106
 
107
- desc "clone REPOS", "Clone repository"
107
+ desc "clone REPO [DIR]", "Clone repository"
108
108
  long_desc <<-LONG_DESCRIPTION
109
- sah clone PROJECT/REPO
110
- \x5> git clone ssh://git@example.com:7999/PROJECT/REPO
109
+ sah clone PROJECT/REPO [DIR]
110
+ \x5> git clone ssh://git@example.com:7999/PROJECT/REPO [DIR]
111
111
 
112
- sah clone REPO
113
- \x5> git clone ssh://git@example.com:7999/~YOUR_NAME/REPO
112
+ sah clone REPO [DIR]
113
+ \x5> git clone ssh://git@example.com:7999/~YOUR_NAME/REPO [DIR]
114
114
 
115
- sah clone ~USERNAME/REPO
116
- \x5> git clone ssh://git@example.com:7999/~USERNAME/REPO
115
+ sah clone ~USERNAME/REPO [DIR]
116
+ \x5> git clone ssh://git@example.com:7999/~USERNAME/REPO [DIR]
117
117
  LONG_DESCRIPTION
118
- def clone(arg)
118
+ def clone(arg, dir=nil)
119
119
  repository_slug, project_key = arg.split("/").reverse
120
120
  project_key ||= "~#{config.user}"
121
121
  res = api.show_repository(project_key, repository_slug)
@@ -125,7 +125,9 @@ module Sah
125
125
  repository = res.body
126
126
  remote_url =
127
127
  repository["links"]["clone"].find{ |e| e["name"] == config.protocol }["href"]
128
- system "git", "clone", remote_url
128
+ options = ["clone", remote_url]
129
+ options << dir if dir
130
+ system "git", *options
129
131
  end
130
132
 
131
133
  desc "create [PROJECT]", "Create repository"
@@ -292,7 +294,7 @@ module Sah
292
294
  puts res.body["links"]["self"].first["href"]
293
295
  end
294
296
 
295
- desc "repository PROJECT[/REPOS]", "Show repository information"
297
+ desc "repository PROJECT[/REPO]", "Show repository information"
296
298
  long_desc <<-LONG_DESCRIPTION
297
299
  sah repository PROJECT
298
300
  \x5# list repositories
data/lib/sah/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Sah
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
3
3
  end
@@ -0,0 +1,34 @@
1
+ #compdef sah
2
+
3
+ _sah() {
4
+ local -a commands
5
+ commands=(
6
+ 'browse: Browse repository'
7
+ 'clone: Clone repository'
8
+ 'create: Create repository'
9
+ 'fork: Fork repository'
10
+ 'help: Describe available commands or one specific command'
11
+ 'project: Show project information'
12
+ 'pull-request: Create pull request'
13
+ 'repository: Show repository information'
14
+ 'upstream: Show upstream information'
15
+ 'user: Show user information'
16
+ 'version: Display the version of this command'
17
+ )
18
+
19
+ if (( CURRENT == 2 )); then
20
+ _describe -t commands "commands" commands
21
+ elif (( CURRENT == 3)); then
22
+ case $words[2] in
23
+ help)
24
+ _describe -t commands "commands" commands
25
+ ;;
26
+ *)
27
+ ;;
28
+ esac
29
+ fi
30
+
31
+ return
32
+ }
33
+
34
+ _sah "$@"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sah
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - f440
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-11-06 00:00:00.000000000 Z
11
+ date: 2015-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -186,6 +186,7 @@ files:
186
186
  - lib/sah/cli.rb
187
187
  - lib/sah/config.rb
188
188
  - lib/sah/version.rb
189
+ - misc/zsh-completion/_sah
189
190
  - sah.gemspec
190
191
  homepage: https://github.com/f440/sah
191
192
  licenses: