git-it 0.0.9 → 0.1.0
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/bin/git-it +27 -2
- data/lib/git-it.rb +17 -2
- data/lib/git-it/commander.rb +8 -5
- data/lib/git-it/{link_generator.rb → url_generator.rb} +4 -4
- data/lib/git-it/version.rb +1 -1
- metadata +19 -3
data/bin/git-it
CHANGED
@@ -2,8 +2,6 @@
|
|
2
2
|
|
3
3
|
require 'gli'
|
4
4
|
require 'git-it'
|
5
|
-
require 'rugged'
|
6
|
-
require 'launchy'
|
7
5
|
|
8
6
|
extend GitIt::GlobalHelper
|
9
7
|
include GLI::App
|
@@ -65,6 +63,33 @@ command :pulled do |c|
|
|
65
63
|
end
|
66
64
|
end
|
67
65
|
|
66
|
+
# ===========================
|
67
|
+
# = Future verbs to support =
|
68
|
+
# ===========================
|
69
|
+
|
70
|
+
# git it dated
|
71
|
+
# - displays dates of branches stating with the most dated to the newest
|
72
|
+
|
73
|
+
# git it branched
|
74
|
+
# - creates and checkouts a branch based on a given phrase
|
75
|
+
|
76
|
+
# git it tagged
|
77
|
+
# - tags current head given a phrase
|
78
|
+
|
79
|
+
# git it tested
|
80
|
+
# - runs new tests added or modified in the current head since master (cucumber features)
|
81
|
+
|
82
|
+
# git it removed
|
83
|
+
# - removes current branch from remote repository
|
84
|
+
|
85
|
+
# git it pruned
|
86
|
+
# - trims branches not found remotely
|
87
|
+
|
88
|
+
# git it gemmed
|
89
|
+
# - updates version, packages and pushes to http://rubygems.org/ (gems made out of gli)
|
90
|
+
|
91
|
+
|
92
|
+
|
68
93
|
# ====================
|
69
94
|
# = Before and After =
|
70
95
|
# ====================
|
data/lib/git-it.rb
CHANGED
@@ -1,7 +1,22 @@
|
|
1
|
+
# =================================
|
2
|
+
# = Current version of the matrix =
|
3
|
+
# =================================
|
1
4
|
require 'git-it/version'
|
2
|
-
|
5
|
+
|
6
|
+
# ==================================
|
7
|
+
# = Does the commading around here =
|
8
|
+
# ==================================
|
3
9
|
require 'git-it/commander'
|
4
|
-
|
10
|
+
|
11
|
+
# ================
|
12
|
+
# = Links to web =
|
13
|
+
# ================
|
14
|
+
require 'git-it/url_generator'
|
15
|
+
|
16
|
+
# ================================
|
17
|
+
# = Not much of a help right not =
|
18
|
+
# ================================
|
19
|
+
require 'git-it/global_helper'
|
5
20
|
|
6
21
|
# Add requires for other files you add to your project here, so
|
7
22
|
# you just need to require this one file in your bin file
|
data/lib/git-it/commander.rb
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
require 'rugged'
|
2
|
+
require 'launchy'
|
3
|
+
|
1
4
|
module GitIt
|
2
5
|
# Grand central station for git it commands
|
3
6
|
class Commander
|
@@ -34,7 +37,7 @@ module GitIt
|
|
34
37
|
@git_object = get_object( options[:sha] )
|
35
38
|
@test_mode = options[:test]
|
36
39
|
|
37
|
-
@
|
40
|
+
@url_generator = UrlGenerator.new( @repository.config["remote.origin.url"] )
|
38
41
|
end
|
39
42
|
|
40
43
|
|
@@ -57,7 +60,7 @@ module GitIt
|
|
57
60
|
|
58
61
|
if _closest_branch
|
59
62
|
branch_name = clean_branch_name_for( _closest_branch )
|
60
|
-
link = @
|
63
|
+
link = @url_generator.branch_url( branch_name )
|
61
64
|
|
62
65
|
launch link
|
63
66
|
else
|
@@ -82,7 +85,7 @@ module GitIt
|
|
82
85
|
|
83
86
|
if _closest_branch
|
84
87
|
branch_name = clean_branch_name_for( _closest_branch )
|
85
|
-
link = @
|
88
|
+
link = @url_generator.compare_branches_url( branch_name, options[:to] || "master" )
|
86
89
|
|
87
90
|
launch link
|
88
91
|
else
|
@@ -107,7 +110,7 @@ module GitIt
|
|
107
110
|
|
108
111
|
if _closest_branch
|
109
112
|
branch_name = clean_branch_name_for( _closest_branch )
|
110
|
-
link = @
|
113
|
+
link = @url_generator.pull_request_url( branch_name, options[:to] || "master" )
|
111
114
|
|
112
115
|
launch link
|
113
116
|
else
|
@@ -164,7 +167,7 @@ module GitIt
|
|
164
167
|
end
|
165
168
|
|
166
169
|
def closest_branch
|
167
|
-
|
170
|
+
closest_local_branch || closest_remote_branch
|
168
171
|
end
|
169
172
|
|
170
173
|
def clean_branch_name_for( branch )
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module GitIt
|
2
2
|
# Link generator compatible with GitHub like site UI
|
3
|
-
class
|
3
|
+
class UrlGenerator
|
4
4
|
|
5
5
|
# git@github.com:more-ron/git-it.git
|
6
6
|
attr_reader :repository_url
|
@@ -17,17 +17,17 @@ module GitIt
|
|
17
17
|
end
|
18
18
|
|
19
19
|
# https://github.com/more-ron/git-it/tree/gh-pages
|
20
|
-
def
|
20
|
+
def branch_url(branch_name)
|
21
21
|
"https://#{@site}/#{@user}/#{@proj}/tree/#{branch_name}"
|
22
22
|
end
|
23
23
|
|
24
24
|
# https://github.com/more-ron/git-it/compare/master...gh-pages
|
25
|
-
def
|
25
|
+
def compare_branches_url(to, from = "master")
|
26
26
|
"https://#{@site}/#{@user}/#{@proj}/compare/#{from}...#{to}"
|
27
27
|
end
|
28
28
|
|
29
29
|
# https://github.com/more-ron/git-it/pull/new/more-ron:master...gh-pages
|
30
|
-
def
|
30
|
+
def pull_request_url(source, destination = "master")
|
31
31
|
"https://#{@site}/#{@user}/#{@proj}/pull/new/#{@user}:#{destination}...#{source}"
|
32
32
|
end
|
33
33
|
|
data/lib/git-it/version.rb
CHANGED
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
|
4
|
+
version: 0.1.0
|
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-
|
12
|
+
date: 2013-03-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -43,6 +43,22 @@ dependencies:
|
|
43
43
|
- - ! '>='
|
44
44
|
- !ruby/object:Gem::Version
|
45
45
|
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rspec
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
46
62
|
- !ruby/object:Gem::Dependency
|
47
63
|
name: aruba
|
48
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -118,7 +134,7 @@ extra_rdoc_files:
|
|
118
134
|
files:
|
119
135
|
- lib/git-it/commander.rb
|
120
136
|
- lib/git-it/global_helper.rb
|
121
|
-
- lib/git-it/
|
137
|
+
- lib/git-it/url_generator.rb
|
122
138
|
- lib/git-it/version.rb
|
123
139
|
- lib/git-it.rb
|
124
140
|
- bin/git-it
|