gitius 0.2.4 → 0.2.5
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.lock +4 -4
- data/gitius.gemspec +2 -2
- data/lib/gitius/core.rb +8 -5
- data/lib/gitius/repository.rb +8 -8
- data/lib/gitius/version.rb +1 -1
- data/spec/gitius_spec.rb +16 -0
- data/spec/spec_helper.rb +4 -0
- metadata +6 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 63e066b8b78ada19081a34e0f05b0de5e79448fa6fc903feb656616a18391951
|
|
4
|
+
data.tar.gz: 6ac3a738eb5dbc9794cb71b266aae3315296c4d0c583563c18bda571d502afe1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: badddc259a35d9ca869b50cafe840a1245fa27bfcf3e0a9e995ca7c89e376206fd0ea6a62ea8c00a6f6dfd49d232bed2a669c42edfdb32988314cf5fc8ce95d8
|
|
7
|
+
data.tar.gz: 813c3ef3e5e3044ca05c9f011386bc26f18e4f0653244eeb795283d53f4c717f2cb31b39e348fcc726796abfc4865c05139df5e63088916a7ce2c41939bb60f6
|
data/Gemfile.lock
CHANGED
|
@@ -2,7 +2,7 @@ PATH
|
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
4
|
gitius (0.2.4)
|
|
5
|
-
octokit (= 4.
|
|
5
|
+
octokit (= 4.8.0)
|
|
6
6
|
thor (= 0.20.0)
|
|
7
7
|
|
|
8
8
|
GEM
|
|
@@ -20,10 +20,10 @@ GEM
|
|
|
20
20
|
multipart-post (>= 1.2, < 3)
|
|
21
21
|
json (2.1.0)
|
|
22
22
|
multipart-post (2.0.0)
|
|
23
|
-
octokit (4.
|
|
23
|
+
octokit (4.8.0)
|
|
24
24
|
sawyer (~> 0.8.0, >= 0.5.3)
|
|
25
25
|
public_suffix (3.0.1)
|
|
26
|
-
rake (
|
|
26
|
+
rake (12.3.0)
|
|
27
27
|
rspec (3.7.0)
|
|
28
28
|
rspec-core (~> 3.7.0)
|
|
29
29
|
rspec-expectations (~> 3.7.0)
|
|
@@ -55,7 +55,7 @@ DEPENDENCIES
|
|
|
55
55
|
bundler (~> 1.16)
|
|
56
56
|
codecov (= 0.1.10)
|
|
57
57
|
gitius!
|
|
58
|
-
rake (~>
|
|
58
|
+
rake (~> 12.3)
|
|
59
59
|
rspec (~> 3.0)
|
|
60
60
|
simplecov (= 0.15.1)
|
|
61
61
|
|
data/gitius.gemspec
CHANGED
|
@@ -16,11 +16,11 @@ Gem::Specification.new do |gem|
|
|
|
16
16
|
gem.executables = ['gitius']
|
|
17
17
|
gem.require_paths = ['lib']
|
|
18
18
|
|
|
19
|
-
gem.add_dependency 'octokit', '4.
|
|
19
|
+
gem.add_dependency 'octokit', '4.8.0'
|
|
20
20
|
gem.add_dependency 'thor', '0.20.0'
|
|
21
21
|
|
|
22
22
|
gem.add_development_dependency 'bundler', '~> 1.16'
|
|
23
|
-
gem.add_development_dependency 'rake', '~>
|
|
23
|
+
gem.add_development_dependency 'rake', '~> 12.3'
|
|
24
24
|
gem.add_development_dependency 'rspec', '~> 3.0'
|
|
25
25
|
gem.add_development_dependency 'simplecov', '= 0.15.1'
|
|
26
26
|
gem.add_development_dependency 'codecov', '= 0.1.10'
|
data/lib/gitius/core.rb
CHANGED
|
@@ -2,15 +2,17 @@ module Gitius
|
|
|
2
2
|
class Core < Base
|
|
3
3
|
include Gitius::Helpers
|
|
4
4
|
|
|
5
|
-
desc '
|
|
6
|
-
|
|
5
|
+
desc 'repository <command>', ''
|
|
6
|
+
subcommand 'repository', Repository
|
|
7
7
|
|
|
8
8
|
desc 'gist <command>', ''
|
|
9
|
-
|
|
9
|
+
subcommand 'gist', Gist
|
|
10
10
|
|
|
11
11
|
desc 'whoami', "Return user's github nickname"
|
|
12
|
+
option :name, aliases: '-n', type: :boolean
|
|
12
13
|
def whoami
|
|
13
|
-
|
|
14
|
+
name = if options[:name] then user.name else user.login end
|
|
15
|
+
puts name
|
|
14
16
|
rescue StandardError
|
|
15
17
|
puts 'Incorrect settings'
|
|
16
18
|
end
|
|
@@ -20,9 +22,10 @@ module Gitius
|
|
|
20
22
|
value.nil? ? puts(get_config(key)) : change_config(key, value)
|
|
21
23
|
end
|
|
22
24
|
|
|
25
|
+
map %w[--version -v] => :version
|
|
23
26
|
desc 'version', 'Return gitius version'
|
|
24
27
|
def version
|
|
25
|
-
puts "v#{VERSION}"
|
|
28
|
+
puts "v#{Gitius::VERSION}"
|
|
26
29
|
end
|
|
27
30
|
end
|
|
28
31
|
end
|
data/lib/gitius/repository.rb
CHANGED
|
@@ -2,10 +2,10 @@ class Repository < Thor
|
|
|
2
2
|
include Gitius::Helpers
|
|
3
3
|
|
|
4
4
|
desc 'create NAME', 'Create repository'
|
|
5
|
-
option :description, aliases:
|
|
6
|
-
option :homepage, aliases:
|
|
7
|
-
option :private, aliases:
|
|
8
|
-
option :auto_init, aliases:
|
|
5
|
+
option :description, aliases: ['-d', '--desc'], banner: '<text>'
|
|
6
|
+
option :homepage, aliases: ['--url', '-u'], banner: '<url>'
|
|
7
|
+
option :private, aliases: '-p'
|
|
8
|
+
option :auto_init, aliases: ['--init', '--auto', '-i']
|
|
9
9
|
def create(name)
|
|
10
10
|
response = client.create(name, options)
|
|
11
11
|
puts response.html_url, response.ssh_url
|
|
@@ -26,8 +26,8 @@ class Repository < Thor
|
|
|
26
26
|
def info(name)
|
|
27
27
|
puts client.forks(name) if options[:forks]
|
|
28
28
|
puts "last update: #{repo(name).created_at}"
|
|
29
|
-
rescue StandardError
|
|
30
|
-
puts
|
|
29
|
+
rescue StandardError
|
|
30
|
+
puts 'Invalid repository'
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
desc 'fork NAME', 'Fork repository'
|
|
@@ -35,7 +35,7 @@ class Repository < Thor
|
|
|
35
35
|
response = client.fork(name)
|
|
36
36
|
puts "#{name} forked", "url: #{response.html_url}",
|
|
37
37
|
"url: #{response.ssh_url}"
|
|
38
|
-
rescue StandardError
|
|
39
|
-
puts
|
|
38
|
+
rescue StandardError
|
|
39
|
+
puts 'Invalid repository'
|
|
40
40
|
end
|
|
41
41
|
end
|
data/lib/gitius/version.rb
CHANGED
data/spec/gitius_spec.rb
CHANGED
|
@@ -23,6 +23,22 @@ RSpec.describe Gitius do
|
|
|
23
23
|
expect { Gitius::Core.start(%w[repo delete ashanaakh/test-gitius]) }.not_to output("Error\n").to_stdout
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
+
it 'can fork and delete repository' do
|
|
27
|
+
Gitius::Core.start(%w[repo fork octokit/octokit.rb], debug: true)
|
|
28
|
+
expect { Gitius::Core.start(%w[repo delete ashanaakh/octokit.rb]) }
|
|
29
|
+
.not_to output("Invalid repository\n").to_stdout
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
it 'shows repository information' do
|
|
33
|
+
expect { Gitius::Core.start(%w[repo info octokit/octokit.rb], debug: true) }
|
|
34
|
+
.not_to output("Invalid repository\n").to_stdout
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
it 'can show username' do
|
|
38
|
+
expect { Gitius::Core.start(%w[whoami], debug: true) }
|
|
39
|
+
.not_to output("Incorrect settings\n").to_stdout
|
|
40
|
+
end
|
|
41
|
+
|
|
26
42
|
it 'can create and delete gist' do
|
|
27
43
|
File.write 'test.txt', 'text'
|
|
28
44
|
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gitius
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ali Shanaakh
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2018-01-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: octokit
|
|
@@ -16,14 +16,14 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - '='
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: 4.
|
|
19
|
+
version: 4.8.0
|
|
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: 4.
|
|
26
|
+
version: 4.8.0
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: thor
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -58,14 +58,14 @@ dependencies:
|
|
|
58
58
|
requirements:
|
|
59
59
|
- - "~>"
|
|
60
60
|
- !ruby/object:Gem::Version
|
|
61
|
-
version: '
|
|
61
|
+
version: '12.3'
|
|
62
62
|
type: :development
|
|
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: '12.3'
|
|
69
69
|
- !ruby/object:Gem::Dependency
|
|
70
70
|
name: rspec
|
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|