gitomator 0.1.2.3 → 0.1.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/lib/gitomator/github/hosting_provider.rb +3 -0
- data/lib/gitomator/github/model/hosted_repo.rb +22 -2
- data/lib/gitomator/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63d26ef4d07cd46da6107fc24fe962779c219e7a
|
4
|
+
data.tar.gz: 77d4514e8a6d8392ba2f834dba3fa6ccdc97bf4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca3b9a633e659b4a099dae88337a887b3fd2be9948d432b41dd5075599994767f38f61bf8122a5c5142d0004c1b95bac0b7c65b418885433f11ebc5e6b9d8faf
|
7
|
+
data.tar.gz: a18a2dc58487423e77fe3f29ea86f9c697087e51ddcd25ce83b3aefa885a0e5b1aa561064b7a0768392c8e93483d31831098e6bd60cef6ca6410ab6843b15eef
|
data/README.md
CHANGED
@@ -34,6 +34,7 @@ hosting:
|
|
34
34
|
provider: github
|
35
35
|
access_token: YOUR-GITHUB-ACCESS-TOKEN
|
36
36
|
organization: YOUR-GITHUB-ORGANIZATION
|
37
|
+
default_protocol: ssh # This line is optional
|
37
38
|
|
38
39
|
ci:
|
39
40
|
provider: travis_pro
|
@@ -43,6 +44,8 @@ ci:
|
|
43
44
|
|
44
45
|
> * You can read more about how to [create an access token on GitHub](https://github.com/blog/1509-personal-api-tokens).
|
45
46
|
> * If you don't use Travis CI, feel free to omit the `ci` configuration
|
47
|
+
> * The `hosting`'s `default_protocol` can be either `https` or `ssh`.
|
48
|
+
If it is not specified, then `https` will be the default protocol.
|
46
49
|
> * You can specify a different path (other than `~/.gitomator`) for you configuration file, by setting the `GITOMATOR_CONTEXT` environment variable.
|
47
50
|
> * **Important:** Keep your credentials safe!
|
48
51
|
The `.gitomator` file is local to your machine, and should *not* be committed to version control.
|
@@ -17,6 +17,9 @@ module Gitomator
|
|
17
17
|
#
|
18
18
|
def self.from_config(config = {})
|
19
19
|
org = config['organization'] || config[:organization]
|
20
|
+
if config['default_protocol']
|
21
|
+
Gitomator::GitHub::Model::HostedRepo::default_protocol= config['default_protocol']
|
22
|
+
end
|
20
23
|
return new(Gitomator::GitHub::github_client_from_config(config), org)
|
21
24
|
end
|
22
25
|
|
@@ -3,6 +3,21 @@ module Gitomator
|
|
3
3
|
module Model
|
4
4
|
class HostedRepo
|
5
5
|
|
6
|
+
@@default_protocol = :https
|
7
|
+
|
8
|
+
def self.default_protocol
|
9
|
+
@@default_protocol
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.default_protocol=protocol
|
13
|
+
protocol = protocol.to_sym
|
14
|
+
raise "Invalid protocol #{protocol}" unless [:https, :ssh].include? protocol
|
15
|
+
@@default_protocol = protocol
|
16
|
+
end
|
17
|
+
|
18
|
+
|
19
|
+
#-----------------------------------------------------------------------
|
20
|
+
|
6
21
|
|
7
22
|
#
|
8
23
|
# @param gh_repo [Sawyer::Resource]
|
@@ -20,8 +35,13 @@ module Gitomator
|
|
20
35
|
@r.full_name
|
21
36
|
end
|
22
37
|
|
23
|
-
def url
|
24
|
-
|
38
|
+
def url(protocol=nil)
|
39
|
+
protocol ||= HostedRepo::default_protocol()
|
40
|
+
if protocol.to_sym == :ssh
|
41
|
+
return @r.ssh_url
|
42
|
+
else
|
43
|
+
return @r.clone_url
|
44
|
+
end
|
25
45
|
end
|
26
46
|
|
27
47
|
def properties
|
data/lib/gitomator/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitomator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.2.
|
4
|
+
version: 0.1.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joey Freund
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -212,7 +212,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
212
212
|
version: '0'
|
213
213
|
requirements: []
|
214
214
|
rubyforge_project:
|
215
|
-
rubygems_version: 2.6.
|
215
|
+
rubygems_version: 2.6.12
|
216
216
|
signing_key:
|
217
217
|
specification_version: 4
|
218
218
|
summary: Automation tools for Git repo organizations.
|