githubrepo 0.2.0 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -2
- data/README.md +11 -12
- data/Rakefile +1 -1
- data/bin/githubrepo +17 -8
- data/lib/githubrepo.rb +4 -4
- data/lib/githubrepo/version.rb +1 -1
- metadata +3 -4
- data/Pryfile +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d7f66425e7be09b5a8e92824eb2fec9034530ad
|
4
|
+
data.tar.gz: f3f3f33a704005cd393c3595aa1f4c358a3ace8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ff23a45ee84e6408bd231ef71f3f517d0d1286c3eb16599d49fa01af365d98685451832037aa80f2cb008c2188e01d23ae7b7a6ee74fb00b087905b269a44e2
|
7
|
+
data.tar.gz: d7c4c6b313958868d9a508775a9f312003850d422870c17291e3f22f4c691fdea916cf9ba73439de63aa140fbd27c0dd89eaf4b4188216ea4144166ce766eae3
|
data/.gitignore
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
pkg
|
2
|
-
.idea
|
3
|
-
Gemfile.lock
|
2
|
+
.idea/
|
3
|
+
Gemfile.lock
|
data/README.md
CHANGED
@@ -1,32 +1,31 @@
|
|
1
1
|
# Githubrepo
|
2
|
+
This gem is a Command Line Interface to do only thing... create GitHub repositories.
|
2
3
|
|
3
4
|
## Installation
|
4
5
|
|
5
|
-
|
6
|
-
|
7
|
-
gem 'githubrepo'
|
8
|
-
|
9
|
-
And then execute:
|
10
|
-
|
11
|
-
$ bundle
|
12
|
-
|
13
|
-
Or install it yourself as:
|
6
|
+
Download this gem:
|
14
7
|
|
15
8
|
$ gem install githubrepo
|
16
9
|
|
17
10
|
|
18
11
|
## Usage
|
19
12
|
|
20
|
-
$ githubrepo create REPOSITORY_NAME
|
21
|
-
|
13
|
+
$ githubrepo create REPOSITORY_NAME
|
14
|
+
$ githubrepo REPOSITORY_NAME
|
15
|
+
|
22
16
|
|
17
|
+
The default operation on githubrepo is to create, so you can skip the create action.
|
23
18
|
For more details use help flag:
|
24
19
|
|
25
20
|
$ githubrepo --help
|
26
21
|
|
27
22
|
|
28
|
-
##
|
23
|
+
## Development
|
24
|
+
To run the app in IRB for debugging run
|
29
25
|
|
26
|
+
$ rake console
|
27
|
+
$ Githubrepo.create(attributes)
|
28
|
+
|
30
29
|
|
31
30
|
## Contributing
|
32
31
|
|
data/Rakefile
CHANGED
data/bin/githubrepo
CHANGED
@@ -4,44 +4,53 @@ require File.expand_path '../lib/githubrepo', File.dirname(__FILE__)
|
|
4
4
|
require 'commander/import'
|
5
5
|
|
6
6
|
program :name, 'githubrepo'
|
7
|
-
program :version, '0.2.
|
7
|
+
program :version, '0.2.2'
|
8
8
|
program :description, 'Create GitHub repositories from the command line.
|
9
|
+
|
9
10
|
OSX: repository URL is automatically copied to clipboard.
|
10
11
|
Linux: install xclip (sudo apt-get xclip) and URL will auto copy to clipboard.
|
11
12
|
Windows: run "gem install ffi" and URL will auto copy to clipboard.'
|
13
|
+
|
12
14
|
program :help, 'Author', 'Elikem Adadevoh <elikem@gmail.com>'
|
13
15
|
|
14
16
|
command :create do |c|
|
15
17
|
c.syntax = 'githubrepo create [options]'
|
16
18
|
|
17
|
-
c.description = 'githubrepo create REPO_NAME'
|
19
|
+
c.description = 'githubrepo create REPO_NAME -d REPO_DESCRIPTION'
|
18
20
|
|
19
|
-
c.example 'usage
|
20
|
-
c.example 'usage
|
21
|
+
c.example 'usage', 'githubrepo create REPO_NAME'
|
22
|
+
c.example 'usage', 'githubrepo REPO_NAME'
|
23
|
+
c.example 'description', 'githubrepo create REPO_NAME -d "short description"'
|
21
24
|
|
22
|
-
|
23
|
-
#c.example 'description', 'githubrepo create REPO_NAME -d "short description"'
|
24
|
-
#c.option '--description STRING', String, 'A short description of the repository'
|
25
|
+
c.option '--description STRING', String, 'A short description of the repository'
|
25
26
|
|
26
27
|
c.action do |args, options|
|
27
28
|
repository = args.shift
|
29
|
+
description = options.description
|
30
|
+
|
31
|
+
# check for repository argument
|
28
32
|
if repository.nil?
|
33
|
+
puts 'repository'
|
29
34
|
puts 'invalid option -- githubrepo create REPO_NAME'
|
30
35
|
exit
|
31
36
|
end
|
32
37
|
|
38
|
+
# get and check name
|
33
39
|
username = ask "'Username for 'https://github.com': "
|
34
40
|
if username.length == 0
|
35
41
|
puts 'invalid option -- please enter a username'
|
36
42
|
exit
|
37
43
|
end
|
38
44
|
|
45
|
+
# set password
|
39
46
|
password = ask('Password: ') { |char| char.echo = false }
|
40
47
|
|
41
|
-
|
48
|
+
# package attributes for http api payload
|
49
|
+
cli({ :repository => repository, :description => description, :username => username, :password => password })
|
42
50
|
end
|
43
51
|
end
|
44
52
|
|
53
|
+
# set default action for gem
|
45
54
|
default_command :create
|
46
55
|
|
47
56
|
def cli(attributes)
|
data/lib/githubrepo.rb
CHANGED
@@ -29,10 +29,8 @@ module Githubrepo
|
|
29
29
|
},
|
30
30
|
|
31
31
|
:body => {
|
32
|
-
'name' => attributes[:repository]
|
33
|
-
|
34
|
-
# feature coming at a future date
|
35
|
-
#'description' => description
|
32
|
+
'name' => attributes[:repository],
|
33
|
+
'description' => attributes[:description]
|
36
34
|
}.to_json
|
37
35
|
)
|
38
36
|
|
@@ -68,6 +66,8 @@ module Githubrepo
|
|
68
66
|
Clipboard.copy clone_url
|
69
67
|
puts "If xclip is installed, repository URL has been added to your clipboard."
|
70
68
|
puts "debian/ubuntu: apt-get install xclip"
|
69
|
+
|
70
|
+
# Add windows support in the future
|
71
71
|
# elsif OS.windows?
|
72
72
|
# Clipboard.copy clone_url
|
73
73
|
# # Will Clipboard output clone_url to console if ffi is not installed?
|
data/lib/githubrepo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: githubrepo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elikem Adadevoh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -136,7 +136,6 @@ files:
|
|
136
136
|
- Gemfile
|
137
137
|
- Gemfile.lock
|
138
138
|
- LICENSE.txt
|
139
|
-
- Pryfile
|
140
139
|
- README.md
|
141
140
|
- Rakefile
|
142
141
|
- bin/githubrepo
|
@@ -163,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
163
162
|
version: '0'
|
164
163
|
requirements: []
|
165
164
|
rubyforge_project:
|
166
|
-
rubygems_version: 2.
|
165
|
+
rubygems_version: 2.2.2
|
167
166
|
signing_key:
|
168
167
|
specification_version: 4
|
169
168
|
summary: CLI to create repositories
|
data/Pryfile
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
load 'bin/githubrepo.rb'
|