git-it 0.0.5 → 0.0.6

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.rdoc CHANGED
@@ -17,6 +17,6 @@ Open current branch in the web. Use it as an easy way to issue pull request in g
17
17
 
18
18
  == Documentation
19
19
 
20
- API Documentation is available {here}[http://more-ron.github.com/git-it/index.html]. Recommend starting with GitIt::Controller.
20
+ API Documentation is available {here}[http://more-ron.github.com/git-it/index.html]. Recommend starting with GitIt::Commander.
21
21
 
22
22
  :include:git-it.rdoc
data/bin/git-it CHANGED
@@ -42,7 +42,7 @@ command :opened_in_the_web do |c|
42
42
  c.flag :site
43
43
 
44
44
  c.action do |global_options,options,args|
45
- GitIt::Controller.new(global_options).open_in_the_web(args, options)
45
+ GitIt::Commander.new(global_options).open_in_the_web(args, options)
46
46
  end
47
47
  end
48
48
 
@@ -2,7 +2,7 @@ require 'rugged'
2
2
  # require 'debugger'
3
3
 
4
4
  # Grand central station for git it commands
5
- class GitIt::Controller
5
+ class GitIt::Commander
6
6
 
7
7
  attr_reader :repository
8
8
  attr_reader :git_object
@@ -11,7 +11,7 @@ class GitIt::Controller
11
11
  # * --help - Show this message
12
12
  # * -p, --path=path - repository path (default: {{present_working_directory}})
13
13
  # * -s, --sha=sha - SHA1 (default: {{current_head}})
14
- # * --version -
14
+ # * --version - Show gem's version
15
15
  def initialize(options)
16
16
  @global_options = options
17
17
  @repository = Rugged::Repository.new( get_path(options[:path]) )
@@ -31,7 +31,9 @@ class GitIt::Controller
31
31
  github_link = remote_origin_url.gsub("git@github.com:", "https://github.com/")
32
32
  # => https://github.com/more-ron/git-it.git
33
33
 
34
- branch_name = closest_remote_branch.target.gsub("refs/remotes/origin/", "")
34
+ branch_name = closest_remote_branch.name.gsub("origin/", "")
35
+ # origin/gh-pages => gh-pages
36
+ branch_name = closest_remote_branch.target.gsub("refs/remotes/origin/", "") if branch_name == "HEAD"
35
37
  # refs/remotes/origin/master => master
36
38
 
37
39
  github_link = github_link.gsub(".git", "/tree/#{ branch_name }")
@@ -1,3 +1,3 @@
1
1
  module GitIt
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
data/lib/git-it.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'git-it/version.rb'
2
2
  require 'git-it/global_helper.rb'
3
- require 'git-it/controller.rb'
3
+ require 'git-it/commander.rb'
4
4
 
5
5
  # Add requires for other files you add to your project here, so
6
6
  # you just need to require this one file in your bin file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-it
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:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-15 00:00:00.000000000 Z
12
+ date: 2013-02-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -117,7 +117,7 @@ extra_rdoc_files:
117
117
  - git-it.rdoc
118
118
  files:
119
119
  - bin/git-it
120
- - lib/git-it/controller.rb
120
+ - lib/git-it/commander.rb
121
121
  - lib/git-it/global_helper.rb
122
122
  - lib/git-it/version.rb
123
123
  - lib/git-it.rb