github_helper 1.0.0 → 1.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.
data/README.md CHANGED
@@ -23,10 +23,17 @@ Just install the gem using :
23
23
 
24
24
  gem install github_helper
25
25
 
26
+ ## Configuration
27
+ The first time you run a `ghh` command in your git repository, a prompt will ask you your credentials (**But won't store** your password, only the OAuth token) and your target user/repo.
28
+
29
+ It will then save the configuration in `.git/githelper.config.yml`
30
+
26
31
  ## Usage
32
+ The **"fast mode"** just needs the `-f` option. It will take your latest commit message and use it as the Pull request's title. Optionnaly, you can use `-fm [message]` to commit/push/open the PR.
33
+
27
34
  To add an issue ID to the Pull request's description, just use the `-i` option.
28
35
 
29
- To get some help, just run `ghh -h`
36
+ To get some more help, just run `ghh -h`
30
37
 
31
38
  Here are the detailed options :
32
39
 
@@ -45,3 +52,8 @@ Here are the detailed options :
45
52
  -v, --verbose Enables verbose mode
46
53
  -h, --help Displays this screen
47
54
 
55
+ ### ToDo list
56
+ * More documentation
57
+ * A commit-amending feature ?
58
+ * A better error handling
59
+ * Share a single token over multiple repos
@@ -12,6 +12,8 @@ Gem::Specification.new do |gem|
12
12
  gem.summary = %q{A useful tool to commit, push to remote and open a pull request, in a single line.}
13
13
  gem.homepage = "https://github.com/Esya/GithubHelper"
14
14
 
15
+ gem.post_install_message = "GithubHelper is ready!\nJust type ghh in your terminal in a git folder to start using it."
16
+
15
17
  gem.files = `git ls-files`.split($/)
16
18
  gem.executables << 'ghh'
17
19
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
@@ -1,12 +1,18 @@
1
+ require 'io/console'
2
+
1
3
  # First time run ? Let's make the config file !
2
4
  class GithubHelper::FirstTime
3
5
  include HTTParty
4
6
  base_uri 'https://api.github.com'
5
7
 
6
8
  # Outputs the string as a question then waits for the user input
7
- def ask(string,default=nil)
9
+ def ask(string,hidden=false,default=nil)
8
10
  puts string
9
- input = gets.strip
11
+ if hidden
12
+ input = STDIN.noecho {|i| i.gets}.chomp
13
+ else
14
+ input = gets.strip
15
+ end
10
16
  puts ""
11
17
  input = (input == "") ? default : input
12
18
  end
@@ -34,7 +40,7 @@ class GithubHelper::FirstTime
34
40
  def fillArray!
35
41
  puts "Setting your credentials"
36
42
  user = ask("What's your github user name (Won't work with your email) ?")
37
- password = ask("What's your git password ?\n(This won't be logged, used to get an OAuth token)")
43
+ password = ask("What's your git password ?\n(This won't be logged, used to get an OAuth token)",true)
38
44
  self.class.basic_auth user, password
39
45
 
40
46
  @config['credentials']['user'] = user
@@ -45,7 +51,7 @@ class GithubHelper::FirstTime
45
51
  @config['remote']['repo'] = ask("What's the user's repo ?")
46
52
 
47
53
  puts "Writing to config file : .git/githelper.config.yml"
48
- header = "# GitHelper.rb config file\n# You can edit your credentials here\n"
54
+ header = "# GithubHelper config file\n# You can edit your configuration here\n"
49
55
  yaml = @config.to_yaml
50
56
 
51
57
  output = header + yaml
@@ -1,3 +1,3 @@
1
1
  module GithubHelper
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -81,7 +81,9 @@ files:
81
81
  - lib/github_helper/version.rb
82
82
  homepage: https://github.com/Esya/GithubHelper
83
83
  licenses: []
84
- post_install_message:
84
+ post_install_message: ! 'GithubHelper is ready!
85
+
86
+ Just type ghh in your terminal in a git folder to start using it.'
85
87
  rdoc_options: []
86
88
  require_paths:
87
89
  - lib
@@ -105,3 +107,4 @@ specification_version: 3
105
107
  summary: A useful tool to commit, push to remote and open a pull request, in a single
106
108
  line.
107
109
  test_files: []
110
+ has_rdoc: