ghrepo 0.0.1

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 ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ ZDU3YTA2M2RmZTAwNDI0MDAxNWJhM2VlMWQ1NDc3ZTE4NTQ5M2RiMw==
5
+ data.tar.gz: !binary |-
6
+ ODkwZTU4MjU1MmU5YWZkZDljMDAyZTJjMTk3M2FlNzRlZDYxZTMxNA==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ MWNkNzFlNWU1ZmZiOTVmN2U0ZDVlZTdiOTA3OWM4Zjk4OGFlMWI5YjZiYTE4
10
+ M2UyZjM4YjI4NTFjMGFmOWNhMDdkMjM1YTE0YjBkZWYxN2MyOTg1ZDk3YTFj
11
+ NDNkMDAxMDNiNmFiZGJiOGI1YzM3NzRmMWMzMWFmM2Q3MTFlNmE=
12
+ data.tar.gz: !binary |-
13
+ OGEzMDgxODZiNzA1ZjVkMGZiOGNiMWFmODVlYjM2OTdmOGJiYTllMmZjMzE3
14
+ Y2Q1ZjFiNjVmOTBlZWY2ZWRiNGQ3N2Y0OGM1OTM3YTQ3YTRkMzhjNzU0OGY3
15
+ NTEzNmM4NjU1ZGU0OGMwNmRmMzhjZTI2Y2UzZjg4MWQ3MGVkOTg=
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in ghrepo.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 TODO: Write your name
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # Ghrepo
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'ghrepo'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install ghrepo
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/ghrepo ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'ghrepo'
4
+
5
+ Ghrepo.start(ARGV)
data/ghrepo.gemspec ADDED
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'ghrepo/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "ghrepo"
8
+ spec.version = Ghrepo::VERSION
9
+ spec.authors = ["Chris DeLauder", "Sam Samskies", "Kelly Puckett", "Brantley Beaird"]
10
+ spec.email = ["cdelauder@gmail.com"]
11
+ spec.description = %q{Create a GitHub repo from the command line}
12
+ spec.summary = %q{Create a Github repo from the command line}
13
+ spec.homepage = "https://github.com/cdelauder/ghrepo"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = ["ghrepo"]
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.3"
22
+ spec.add_development_dependency "rake"
23
+ spec.add_development_dependency "pry"
24
+ end
25
+
data/lib/ghrepo.rb ADDED
@@ -0,0 +1,71 @@
1
+ # encoding: utf-8
2
+
3
+ require "ghrepo/version"
4
+ require "json"
5
+ require "io/console"
6
+
7
+ module Ghrepo
8
+
9
+ extend self
10
+
11
+ def start(args)
12
+ if args.any?
13
+ repo_name = args.pop
14
+ credentials = set_credentials(args)
15
+ response = `curl -u "#{credentials[:username]}:#{credentials[:password]}" https://api.github.com/user/repos -d '{"name":"'#{repo_name}'"}'`
16
+ git_url = JSON.parse(response)[credentials[:url]]
17
+
18
+ `git clone "#{git_url}"`
19
+ else
20
+ puts "RTFM dummy!"
21
+ puts <<-eos
22
+ ░░░░░░░░░▄░░░░░░░░░░░░░░▄░░░░
23
+ ░░░░░░░░▌▒█░░░░░░░░░░░▄▀▒▌░░░
24
+ ░░░░░░░░▌▒▒█░░░░░░░░▄▀▒▒▒▐░░░
25
+ ░░░░░░░▐▄▀▒▒▀▀▀▀▄▄▄▀▒▒▒▒▒▐░░░
26
+ ░░░░░▄▄▀▒░▒▒▒▒▒▒▒▒▒█▒▒▄█▒▐░░░
27
+ ░░░▄▀▒▒▒░░░▒▒▒░░░▒▒▒▀██▀▒▌░░░
28
+ ░░▐▒▒▒▄▄▒▒▒▒░░░▒▒▒▒▒▒▒▀▄▒▒▌░░
29
+ ░░▌░░▌█▀▒▒▒▒▒▄▀█▄▒▒▒▒▒▒▒█▒▐░░
30
+ ░▐░░░▒▒▒▒▒▒▒▒▌██▀▒▒░░░▒▒▒▀▄▌░
31
+ ░▌░▒▄██▄▒▒▒▒▒▒▒▒▒░░░░░░▒▒▒▒▌░
32
+ ▀▒▀▐▄█▄█▌▄░▀▒▒░░░░░░░░░░▒▒▒▐░
33
+ ▐▒▒▐▀▐▀▒░▄▄▒▄▒▒▒▒▒▒░▒░▒░▒▒▒▒▌
34
+ ▐▒▒▒▀▀▄▄▒▒▒▄▒▒▒▒▒▒▒▒░▒░▒░▒▒▐░
35
+ ░▌▒▒▒▒▒▒▀▀▀▒▒▒▒▒▒░▒░▒░▒░▒▒▒▌░
36
+ ░▐▒▒▒▒▒▒▒▒▒▒▒▒▒▒░▒░▒░▒▒▄▒▒▐░░
37
+ ░░▀▄▒▒▒▒▒▒▒▒▒▒▒░▒░▒░▒▄▒▒▒▒▌░░
38
+ ░░░░▀▄▒▒▒▒▒▒▒▒▒▒▄▄▄▀▒▒▒▒▄▀░░░
39
+ ░░░░░░▀▄▄▄▄▄▄▀▀▀▒▒▒▒▒▄▄▀░░░░░
40
+ ░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▀▀░░░░░░░░
41
+ eos
42
+ puts "such moron very dumb"
43
+ end
44
+ end
45
+
46
+ def prompt_password
47
+ puts "password > "
48
+ password = STDIN.noecho(&:gets).chomp
49
+ end
50
+
51
+ def set_url(args)
52
+ args.include?('-ssl') ? 'ssh_url' : 'git_url'
53
+ end
54
+
55
+ def set_username
56
+ ENV['GHREPO_USERNAME'] || prompt_username
57
+ end
58
+
59
+ def prompt_username
60
+ puts "github username > "
61
+ username = STDIN.gets.chomp
62
+ end
63
+
64
+ def set_password
65
+ ENV['GHREPO_KEY'] || prompt_password
66
+ end
67
+
68
+ def set_credentials(args)
69
+ {url: set_url(args), username: set_username, password: set_password}
70
+ end
71
+ end
@@ -0,0 +1,3 @@
1
+ module Ghrepo
2
+ VERSION = "0.0.1"
3
+ end
metadata ADDED
@@ -0,0 +1,99 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ghrepo
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Chris DeLauder
8
+ - Sam Samskies
9
+ - Kelly Puckett
10
+ - Brantley Beaird
11
+ autorequire:
12
+ bindir: bin
13
+ cert_chain: []
14
+ date: 2014-06-07 00:00:00.000000000 Z
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: bundler
18
+ requirement: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ~>
21
+ - !ruby/object:Gem::Version
22
+ version: '1.3'
23
+ type: :development
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '1.3'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rake
32
+ requirement: !ruby/object:Gem::Requirement
33
+ requirements:
34
+ - - ! '>='
35
+ - !ruby/object:Gem::Version
36
+ version: '0'
37
+ type: :development
38
+ prerelease: false
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ - !ruby/object:Gem::Dependency
45
+ name: pry
46
+ requirement: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - ! '>='
49
+ - !ruby/object:Gem::Version
50
+ version: '0'
51
+ type: :development
52
+ prerelease: false
53
+ version_requirements: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ! '>='
56
+ - !ruby/object:Gem::Version
57
+ version: '0'
58
+ description: Create a GitHub repo from the command line
59
+ email:
60
+ - cdelauder@gmail.com
61
+ executables:
62
+ - ghrepo
63
+ extensions: []
64
+ extra_rdoc_files: []
65
+ files:
66
+ - .gitignore
67
+ - Gemfile
68
+ - LICENSE.txt
69
+ - README.md
70
+ - Rakefile
71
+ - bin/ghrepo
72
+ - ghrepo.gemspec
73
+ - lib/ghrepo.rb
74
+ - lib/ghrepo/version.rb
75
+ homepage: https://github.com/cdelauder/ghrepo
76
+ licenses:
77
+ - MIT
78
+ metadata: {}
79
+ post_install_message:
80
+ rdoc_options: []
81
+ require_paths:
82
+ - lib
83
+ required_ruby_version: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - ! '>='
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ required_rubygems_version: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - ! '>='
91
+ - !ruby/object:Gem::Version
92
+ version: '0'
93
+ requirements: []
94
+ rubyforge_project:
95
+ rubygems_version: 2.1.5
96
+ signing_key:
97
+ specification_version: 4
98
+ summary: Create a Github repo from the command line
99
+ test_files: []