github-pr 0.1.2 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 18be422d2b23695606b9e6d25cd249151d6b4255
4
- data.tar.gz: 1c0d362f371228688faac8e38bb039767b821eb9
3
+ metadata.gz: 0d9e31620e9fa376ef53932d193a653196e017cc
4
+ data.tar.gz: e15553bca567c78481828507eb22860a36c76283
5
5
  SHA512:
6
- metadata.gz: b89d7837843752c3bf82f1e966745c1af3c8a1f41288c4d45527eec6fef8d6a19b08e70c21eed80b50e099bcc83a0fa8ffb0e2a109ce377aeae0e814fa5994a7
7
- data.tar.gz: ee93766cc84c64e33d4c919d7b55a30aac4cd9a28cf22d384a5d0a841f83e1f72222a2bf40b9cf9245c654c0d75772288bce3edc7759ef298943e7d2a93673f4
6
+ metadata.gz: 7e585f60431886c9364736b622cc2abffa55845ced35d38a40974535cf61f2755054355fe7751be11a8b31622c93a40b0efddc63922189a6ae97bbe7d67dd465
7
+ data.tar.gz: bddb97a45bef454ec9137b213e8ec1aebab3ba4ad396b2e0e4d5e3d981e1828bf8ff766fc21f020ddd40c377d86cbd8857a6f83b45d7b4737200cd5da443eb10
data/lib/github-pr/cli.rb CHANGED
@@ -32,6 +32,9 @@ module GitHubPr
32
32
  opts.on("-g", "--github-token GITHUBTOKEN", "Generated user token from GitHub") do |t|
33
33
  options[:token] = t
34
34
  end
35
+ opts.on("-u", "--url GITHUBURL", "GitHub repo url, optional. We will try to get url from git.") do |t|
36
+ options[:url] = t
37
+ end
35
38
  end.parse!(argv)
36
39
 
37
40
  raise 'You must assign to someone' if options[:assign].nil?
@@ -41,6 +44,7 @@ module GitHubPr
41
44
  options[:feature] = self.current_branch if options[:feature].nil?
42
45
  options[:title] = options[:feature] if options[:title].nil?
43
46
  options[:token] = options[:token] if options[:token].nil?
47
+ options[:url] = options[:url] if options[:url].nil?
44
48
 
45
49
  return options
46
50
  end
@@ -17,7 +17,8 @@ module GitHubPr
17
17
  end
18
18
  end
19
19
  def postPrivate(client, options)
20
- repo_url = Poster.repo_url()
20
+ repo_url = options[:url]
21
+ repo_url = Poster.repo_url() if repo_url.nil?
21
22
  repo = cut_scheme_and_host(repo_url)
22
23
  pull_request = client.create_pull_request(repo,
23
24
  options[:base],
@@ -37,6 +37,16 @@ module GitHubPr
37
37
  end
38
38
  end
39
39
 
40
+ describe "when passed token, assagnee and repo url" do
41
+ it "must contain assign field" do
42
+ options = CLI.parse(['-a', 'hovox', '-g', 'sometoken', '-u', 'https://somegithuburl.com'])
43
+ options[:token].must_equal 'sometoken'
44
+ options[:base].must_equal 'master'
45
+ options[:assign].must_equal 'hovox'
46
+ options[:url].must_equal 'https://somegithuburl.com'
47
+ end
48
+ end
49
+
40
50
  end
41
51
 
42
52
  end
data/test/test_token.rb CHANGED
@@ -28,7 +28,7 @@ module GitHubPr
28
28
  end
29
29
 
30
30
  it "must return token from file if exists" do
31
- some_token = '1aa277306fdadcfd64739a174fc4da09f8ddeea0'
31
+ some_token = '14bebe34582d1dc606d72f36df0886d699ff04e5'
32
32
  path = File.expand_path '~/.config/gh-pr-token'
33
33
  # puts 'cache path is:' + path
34
34
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github-pr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hovhannes Safaryan