repomachine 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: efbcf3dcd7a9722cdcb52381edd9a2e973bb2cf7
4
+ data.tar.gz: c2a8c8595519239f8e5b7edc06313936b913cade
5
+ SHA512:
6
+ metadata.gz: d57bf3160be89ea0eb3db6eea330ad3689b46bf1532375cf3c62b93e003783ee21a3e1aed7ab190b3ffe97da5816ffaeea490241805bd8219d53bb401691cb5a
7
+ data.tar.gz: 3102f4ba5f270c6a37778c158476c293bd0f0770ade316c0b9f0e3c16e4f98fa5ec86d613acba38dd4fabfee80e754e1dfb4c3ec99f1015fa59b307e63cf5498
data/.gitignore ADDED
@@ -0,0 +1,19 @@
1
+ *.gem
2
+ *.swp
3
+ *.rbc
4
+ .bundle
5
+ .config
6
+ .yardoc
7
+ Gemfile.lock
8
+ InstalledFiles
9
+ _yardoc
10
+ coverage
11
+ doc/
12
+ lib/bundler/man
13
+ pkg
14
+ rdoc
15
+ spec/reports
16
+ test/tmp
17
+ test/version_tmp
18
+ tmp
19
+ bin/testapp
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ language: ruby
2
+ rvm:
3
+ - "2.1.1"
4
+ gemfile: Gemfile
5
+
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+ gem 'hub', '~> 1.12'
3
+ gem 'commander', '~> 4.1'
4
+ # Specify your gem's dependencies in repomachine.gemspec
5
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Mayur Rokade
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,33 @@
1
+ # Repomachine
2
+ [![Build Status](https://travis-ci.org/mayuroks/repomachine.svg?branch=master)](https://travis-ci.org/mayuroks/repomachine)
3
+
4
+ Making Github repos and managing SSH keys made easy. Seriously !!
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'repomachine'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install repomachine
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it ( http://github.com/<my-github-username>/repomachine/fork )
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
30
+
31
+ ## TODO
32
+ 1. Dont create SSH keys for existing repos
33
+ 2. After Keys creation move them to .ssh/ dir
data/Rakefile ADDED
@@ -0,0 +1,9 @@
1
+ require "bundler/gem_tasks"
2
+ desc "The default task"
3
+ task :default do
4
+ puts "A Rake Task and Build Complete"
5
+ end
6
+ desc "The another task"
7
+ task :another do
8
+ puts "A Rake Task and Build Complete"
9
+ end
data/bin/repomachine ADDED
@@ -0,0 +1,66 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubygems'
4
+ require 'commander/import'
5
+ require 'fileutils'
6
+
7
+ program :version, '0.0.1'
8
+ program :description, "** Creating github repos and managing SSH keys made easy **\n\n\tSee git help [command] for commands usage"
9
+ program :help_formatter, :compact
10
+
11
+ command :create do |c|
12
+ c.syntax = 'gitshit create [options]'
13
+ c.summary = 'Create a repo on github'
14
+ c.description = ''
15
+ c.example 'description', 'Creates Repo from preset directory'
16
+ c.example 'create', 'gitshit create -n REPONAME'
17
+ c.option '--name REPONAME',String,'short alias -n'
18
+ c.action do |args, options|
19
+ # Do something or c.when_called Gitshit::Commands::Create
20
+ #options.default :n => 'whoa_repo',
21
+ # :name => 'whoa_repo'
22
+ say "Creating #{options.name} Here"
23
+ puts `git init`
24
+ system("hub create #{options.name}")
25
+ #puts "EXIT CODE #{$?.exitstatus}"
26
+ url = `git config --get remote.origin.url`
27
+ system("git remote remove origin")
28
+ url.sub!(/.com/, "-#{options.name}")
29
+ system("git remote add origin #{url}")
30
+ puts `git remote -v`
31
+ puts "Creating SSH keys now"
32
+ %x{ssh-keygen -t rsa -f "#{options.name}_key" -C "github_#{options.name}" -N ""}
33
+ puts "\nCopying keys to #{File.expand_path('~/.ssh/')}"
34
+ Dir["./#{options.name}_key*"].select {|f| FileUtils.cp File.expand_path(f), File.expand_path("~/.ssh/")}
35
+ if File.exist?(File.expand_path("~/.ssh/config"))
36
+ puts "CONFIG EXISTS"
37
+ else
38
+ puts "CONFIG NOEXIST"
39
+ end
40
+ puts "ADD THIS in begining of your #{File.expand_path("~/.ssh/config")}
41
+ \nHost github-#{options.name}\n\tHostName github.com\n\tUser git\n\tIdentityFile ~/.ssh/#{options.name}_key\n"
42
+ end
43
+ end
44
+
45
+ command :show do |c|
46
+ c.syntax = 'gitshit show [options]'
47
+ c.summary = 'Show current config'
48
+ c.description = ''
49
+ c.example 'description', 'command example'
50
+ c.option '--some-switch', 'Some switch that does something'
51
+ c.action do |args, options|
52
+ # Do something or c.when_called Gitshit::Commands::Show
53
+ end
54
+ end
55
+
56
+ command :verbose do |c|
57
+ c.syntax = 'gitshit verbose [options]'
58
+ c.summary = 'No reason'
59
+ c.description = ''
60
+ c.example 'description', 'command example'
61
+ c.option '--some-switch', 'Some switch that does something'
62
+ c.action do |args, options|
63
+ # Do something or c.when_called Gitshit::Commands::Verbose
64
+ end
65
+ end
66
+
@@ -0,0 +1,5 @@
1
+ require "repomachine/version"
2
+
3
+ module Repomachine
4
+ # Your code goes here...
5
+ end
@@ -0,0 +1,3 @@
1
+ module Repomachine
2
+ VERSION = "0.2.0"
3
+ end
@@ -0,0 +1,28 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'repomachine/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "repomachine"
8
+ spec.version = Repomachine::VERSION
9
+ spec.authors = ["Mayur Rokade"]
10
+ spec.email = ["mayur.r@directi.com"]
11
+ spec.summary = %q{Making Github repos and managing SSH keys made easy. Seriously !!}
12
+ spec.description = %q{longer description. Optional.}
13
+ spec.homepage = "https://github.com/mayuroks/repomachine"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.files << "bin/repomachine"
22
+ spec.executables << "repomachine"
23
+
24
+ spec.add_dependency "hub", "~> 1.12"
25
+ spec.add_dependency "octokit", "~> 2.7"
26
+ spec.add_development_dependency "bundler", "~> 1.5"
27
+ spec.add_development_dependency "rake"
28
+ end
metadata ADDED
@@ -0,0 +1,111 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: repomachine
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Mayur Rokade
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-03-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: hub
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.12'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.12'
27
+ - !ruby/object:Gem::Dependency
28
+ name: octokit
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.7'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.7'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.5'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.5'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: longer description. Optional.
70
+ email:
71
+ - mayur.r@directi.com
72
+ executables:
73
+ - repomachine
74
+ extensions: []
75
+ extra_rdoc_files: []
76
+ files:
77
+ - ".gitignore"
78
+ - ".travis.yml"
79
+ - Gemfile
80
+ - LICENSE.txt
81
+ - README.md
82
+ - Rakefile
83
+ - bin/repomachine
84
+ - lib/repomachine.rb
85
+ - lib/repomachine/version.rb
86
+ - repomachine.gemspec
87
+ homepage: https://github.com/mayuroks/repomachine
88
+ licenses:
89
+ - MIT
90
+ metadata: {}
91
+ post_install_message:
92
+ rdoc_options: []
93
+ require_paths:
94
+ - lib
95
+ required_ruby_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
100
+ required_rubygems_version: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ requirements: []
106
+ rubyforge_project:
107
+ rubygems_version: 2.2.2
108
+ signing_key:
109
+ specification_version: 4
110
+ summary: Making Github repos and managing SSH keys made easy. Seriously !!
111
+ test_files: []