octopush 0.0.2 → 0.0.3
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/lib/gictocat.rb +2 -2
- data/lib/octopush.rb +16 -13
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b49caddf4e326d14fb74e6197cab8772cca9b2d1
|
4
|
+
data.tar.gz: ca7a907d3e95664da25a5a4d73eb65f9f1a5221d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c739131f90ed570300383fd2b858b2b1bb92a02f3aefa4428bf51d913e55142aa5874ac860e8a4570f21613a5f1c9dc2ca67133a1ef18250c1df150961158127
|
7
|
+
data.tar.gz: 1c8839803aa6ed517d3a8508f33a36382e532785d915cb030986bc8cc7e22630fc9a9e0718ad45997b21530c974848678ae90891a113ab99de62565f2ce10c43
|
data/lib/gictocat.rb
CHANGED
@@ -2,7 +2,7 @@ require 'colorize'
|
|
2
2
|
require 'github_api'
|
3
3
|
|
4
4
|
# mix in model for very simple github repo manipulation
|
5
|
-
# requires class to respond to
|
5
|
+
# requires class to respond to repository_name, username, password
|
6
6
|
module Gictocat
|
7
7
|
|
8
8
|
def initialize_repo(repository_name = repository_name)
|
@@ -32,7 +32,7 @@ module Gictocat
|
|
32
32
|
|
33
33
|
def add_github_remote(remote_name = 'origin')
|
34
34
|
puts "#{cyan_arrow} Adding GitHub as a remote"
|
35
|
-
`git remote add #{remote_name} https://github.com/#{
|
35
|
+
`git remote add #{remote_name} https://github.com/#{username}/#{repository_name}.git`
|
36
36
|
end
|
37
37
|
|
38
38
|
def push_repo
|
data/lib/octopush.rb
CHANGED
@@ -16,44 +16,47 @@ class Octopush < Thor
|
|
16
16
|
Dir.chdir("./#{repository_name}")
|
17
17
|
add_and_commit_readme
|
18
18
|
push_to_github
|
19
|
+
puts "#{cyan_arrow} done."
|
19
20
|
end
|
20
21
|
|
21
|
-
desc "create_config", "Creates an empty octopush configuration in ~/.octopushrc"
|
22
|
-
def create_config
|
23
|
-
create_empty_configuration
|
24
|
-
end
|
25
22
|
|
26
23
|
private
|
27
24
|
|
28
25
|
def repository_name
|
29
26
|
@repository_name
|
30
|
-
end
|
31
27
|
|
28
|
+
end
|
32
29
|
def username
|
33
|
-
return
|
34
|
-
|
30
|
+
return @username if @username
|
31
|
+
if configuration['username'] && configuration['username'] != '<your_username>'
|
32
|
+
@username = configuration['username']
|
33
|
+
else
|
34
|
+
@username = ask "GitHub Username:"
|
35
|
+
end
|
35
36
|
end
|
36
37
|
|
37
38
|
def password
|
38
|
-
return
|
39
|
-
|
39
|
+
return @password if @password
|
40
|
+
if configuration['password'] && configuration['password'] != '<your_password>'
|
41
|
+
@password = configuration['password']
|
42
|
+
else
|
43
|
+
@password = ask "GitHub Password:", echo: false
|
44
|
+
end
|
40
45
|
end
|
41
46
|
|
42
47
|
def configuration
|
43
48
|
begin
|
44
49
|
@configuration ||= YAML.load(File.read(CONFIGURATION_FILE))
|
45
50
|
rescue
|
46
|
-
|
51
|
+
create_empty_configuration
|
47
52
|
return @configuration = {} # an empty configuration..
|
48
53
|
end
|
49
54
|
end
|
50
55
|
|
51
56
|
def create_empty_configuration
|
57
|
+
puts "#{red_arrow} Configuration not found. Edit your ~/.octopushrc for storing credentials"
|
52
58
|
configuration ="username: <your_username>\npassword: <your_password>"
|
53
59
|
File.open(CONFIGURATION_FILE, 'wb') { |f| f.write(configuration) }
|
54
|
-
|
55
|
-
puts "#{red_arrow} No configuration found!"
|
56
|
-
puts "Initialized configuration file in ~/.octopushrc"
|
57
60
|
end
|
58
61
|
|
59
62
|
def red_arrow
|