gub 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 13347212ee0df95482e921cd191da7ecec690901
4
- data.tar.gz: a1800e5d9860ec2b824a6c1c17bcfba05efbe5e9
3
+ metadata.gz: 3c545f5df605b71f6616e721cb7cede555e6f27b
4
+ data.tar.gz: 35c55cf02011c7f5429cf1d8613ad775589caf4c
5
5
  SHA512:
6
- metadata.gz: ae93c287218cc9747f73002cc90b4646531b90a79ba900a6b579b64f1b4c0f15828318b257e75e1029a2ab87d149ae842ae0213b6afa6b150020e55a0544b7c6
7
- data.tar.gz: b3adbc543bc3042f632dfd73eb5a54b0c9eca7c2efa4436129b6228aefe425924b8aa77d553334d1bcb13f3dc0e469806100615c44e1940f5f75bc6bdc676d09
6
+ metadata.gz: b29a59c7b85457da01e38dfc53a825526c0e527129fb04596ad860da5b03cadbd89cd2e7031e675139f30fbf43404c12dd65c56a14b89aacf8b6b199227b1cff
7
+ data.tar.gz: 7d77d4cad52a3aba03447d358a577b1ef5e0f885f31f28aa6f6167f740653f3e56a3d6394343a92001cbe0340c9302ace20752f63ae7e33f84f6748082826525
data/lib/gub/cli.rb CHANGED
@@ -13,17 +13,20 @@ module Gub
13
13
  def repos
14
14
  rows = []
15
15
  id = 0
16
- Gub.github.repos.list.each do |repo|
17
- id = id.next
18
- rows << [id, repo.full_name]
19
- end
20
- Gub.github.orgs.list.each do |org|
21
- Gub.github.repos.list(org: org.login).each do |repo|
16
+ table = Terminal::Table.new(headings: ['#', 'Repository']) do |t|
17
+ Gub.github.repos.each do |repo|
22
18
  id = id.next
23
- rows << [id, repo.full_name]
19
+ t.add_row [id, repo.full_name]
20
+ end
21
+ Gub.github.orgs.each do |org|
22
+ t.add_separator
23
+ Gub.github.organization_repositories(org.login).each do |repo|
24
+ id = id.next
25
+ t.add_row [id, repo.full_name]
26
+ end
24
27
  end
25
28
  end
26
- say table rows, ['#', 'Repository']
29
+ puts table
27
30
  end
28
31
 
29
32
  desc 'issue [id]', 'Show a Github issue'
@@ -161,7 +164,7 @@ module Gub
161
164
 
162
165
  private
163
166
  def table rows, header = []
164
- Terminal::Table.new :headings => header, :rows => rows
167
+ Terminal::Table.new headings: header, rows: rows
165
168
  end
166
169
 
167
170
  # Source: https://github.com/rails/rails/actionpack/lib/action_view/helpers/text_helper.rb
@@ -8,6 +8,8 @@ module Gub
8
8
  else
9
9
  self.full_name = full_name
10
10
  end
11
+ # Strip .git from the name
12
+ self.full_name = self.full_name.split('.').first
11
13
  if self.full_name.nil? || self.full_name.empty?
12
14
  Gub.log.fatal 'Unable to find repo name'
13
15
  exit 1
@@ -74,7 +76,7 @@ module Gub
74
76
  end
75
77
 
76
78
  def parent
77
- self.info.parent.full_name if self.info.parent
79
+ self.info.parent.full_name.split('.').first if self.info.parent
78
80
  end
79
81
 
80
82
  def sync
data/lib/gub/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Gub
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Omar Abdel-Wahab
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-01 00:00:00.000000000 Z
11
+ date: 2013-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler