hull 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/hull/command.rb +10 -7
  2. metadata +5 -5
@@ -61,23 +61,25 @@ module Hull
61
61
  end
62
62
 
63
63
  def remote
64
- @remote ||= repo.config['hull.remote'] || 'origin'
64
+ @remote ||= (repo.config['hull.remote'] || 'origin')
65
65
  end
66
66
 
67
67
  def github_url
68
68
  @github_url ||=
69
69
  begin
70
- _, owner, project = repo.config["remote.#{remote}.url"].match(/^git@github.com:([^\/]*)\/(.*)(\.git)?/).to_a
70
+ unless valid_repository?(repo)
71
+ raise InvalidRepository.new("Must be a GitHub repository")
72
+ end
73
+ _, owner, project = repo.config["remote.#{remote}.url"].match(/^git@github.com:([^\/]*)\/(.*)/).to_a
74
+ project.gsub!(/\.git$/, '')
75
+ puts owner
76
+ puts project
71
77
  "https://github.com/api/v2/json/pulls/#{owner}/#{project}"
72
78
  end
73
79
  end
74
80
 
75
81
  def repo
76
- @repo ||= Grit::Repo.new(".")
77
- unless valid_repository?(@repo)
78
- raise InvalidRepository.new("#{remote} must be a GitHub repository")
79
- end
80
- @repo
82
+ @repo = Grit::Repo.new(".")
81
83
  end
82
84
 
83
85
  def get_json(url)
@@ -87,6 +89,7 @@ module Hull
87
89
  api_token
88
90
  ]
89
91
  }
92
+ puts url, options
90
93
  JSON.load(open(url, options))
91
94
  end
92
95
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hull
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-01-20 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
16
- requirement: &70175716646940 !ruby/object:Gem::Requirement
16
+ requirement: &70277235187960 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70175716646940
24
+ version_requirements: *70277235187960
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: grit
27
- requirement: &70175716646500 !ruby/object:Gem::Requirement
27
+ requirement: &70277235187520 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70175716646500
35
+ version_requirements: *70277235187520
36
36
  description: Code Review helper using GitHub's Pull Requests
37
37
  email: hc5duke@gmail.com
38
38
  executables: