web_git 0.0.2.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +7 -20
- data/Gemfile.lock +103 -175
- data/README.markdown +30 -8
- data/Rakefile +3 -3
- data/VERSION +1 -1
- data/lib/generators/web_git/install_generator.rb +47 -0
- data/lib/scripts/heroku_login.exp +58 -0
- data/lib/views/status.erb +381 -0
- data/lib/web_git/diff.rb +234 -0
- data/lib/web_git/exceptions.rb +3 -0
- data/lib/web_git/graph.rb +114 -0
- data/lib/web_git/heroku.rb +34 -0
- data/lib/web_git/string.rb +8 -0
- data/lib/web_git.rb +204 -7
- data/web_git.gemspec +33 -74
- metadata +36 -142
- data/ansi2html.sh +0 -514
- data/app/assets/javascripts/web_git/application.js +0 -22
- data/app/assets/javascripts/web_git/bootstrap.min.js +0 -6
- data/app/assets/javascripts/web_git/popper.min.js +0 -4
- data/app/assets/stylesheets/web_git/application.scss +0 -12
- data/app/assets/stylesheets/web_git/bootstrap.min.css +0 -6
- data/app/assets/stylesheets/web_git/font-awesome.min.css +0 -4
- data/app/assets/stylesheets/web_git/octicons.css +0 -5
- data/app/controllers/web_git/application_controller.rb +0 -5
- data/app/controllers/web_git/branches_controller.rb +0 -38
- data/app/controllers/web_git/commands_controller.rb +0 -50
- data/app/controllers/web_git/commits_controller.rb +0 -46
- data/app/views/layouts/web_git/application.html.erb +0 -39
- data/app/views/web_git/commands/hello.html.erb +0 -1
- data/app/views/web_git/commands/status.html.erb +0 -245
- data/config/routes.rb +0 -10
- data/lib/web_git/engine.rb +0 -9
- data/web_git-0.0.2.gem +0 -0
@@ -1,39 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>GitClient</title>
|
5
|
-
<%= csrf_meta_tags %>
|
6
|
-
|
7
|
-
<%= stylesheet_link_tag 'web_git/application', media: 'all', 'data-turbolinks-track': 'reload' %>
|
8
|
-
|
9
|
-
<%= javascript_include_tag 'web_git/application', 'data-turbolinks-track': 'reload' %>
|
10
|
-
</head>
|
11
|
-
|
12
|
-
<body>
|
13
|
-
<div class="container">
|
14
|
-
<% if notice.present? %>
|
15
|
-
<div class="row">
|
16
|
-
<div class="col">
|
17
|
-
<div class="alert alert-dismissable alert-success">
|
18
|
-
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
19
|
-
<%= notice %>
|
20
|
-
</div>
|
21
|
-
</div>
|
22
|
-
</div>
|
23
|
-
<% end %>
|
24
|
-
|
25
|
-
<% if alert.present? %>
|
26
|
-
<div class="row">
|
27
|
-
<div class="col">
|
28
|
-
<div class="alert alert-dismissable alert-warning">
|
29
|
-
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
30
|
-
<%= alert %>
|
31
|
-
</div>
|
32
|
-
</div>
|
33
|
-
</div>
|
34
|
-
<% end %>
|
35
|
-
|
36
|
-
<%= yield %>
|
37
|
-
</div>
|
38
|
-
</body>
|
39
|
-
</html>
|
@@ -1 +0,0 @@
|
|
1
|
-
We made it!
|
@@ -1,245 +0,0 @@
|
|
1
|
-
<div class="row mb-4">
|
2
|
-
<div class="col">
|
3
|
-
<div class="card">
|
4
|
-
<h1 class="card-header">
|
5
|
-
<% if @diff_html.present? %>
|
6
|
-
On branch <code><%= @current_branch %></code>
|
7
|
-
<% else %>
|
8
|
-
<code>git status</code>
|
9
|
-
<% end %>
|
10
|
-
</h1>
|
11
|
-
|
12
|
-
<div class="card-body">
|
13
|
-
<%# if false %>
|
14
|
-
<% unless @status.include?("nothing to commit, working tree clean") %>
|
15
|
-
<p class="h4 mb-3 text-center">
|
16
|
-
You have changes
|
17
|
-
</p>
|
18
|
-
|
19
|
-
<% if @status.include?("Untracked files") %>
|
20
|
-
<pre>
|
21
|
-
<%= simple_format @status.
|
22
|
-
gsub("(use \"git add <file>...\" to include in what will be committed)\n\n", "").
|
23
|
-
gsub("(use \"git add\" to track)\n", "")%>
|
24
|
-
</pre>
|
25
|
-
<% end %>
|
26
|
-
|
27
|
-
<% if @diff_html.present? %>
|
28
|
-
<%= @diff_html.html_safe %>
|
29
|
-
<% end %>
|
30
|
-
|
31
|
-
<p class="h4 mb-3 text-center">
|
32
|
-
What do you want to do?
|
33
|
-
</p>
|
34
|
-
|
35
|
-
<div class="row">
|
36
|
-
<div class="col">
|
37
|
-
<div class="card">
|
38
|
-
<div class="card-header h6">
|
39
|
-
Commit your changes to the current branch
|
40
|
-
</div>
|
41
|
-
|
42
|
-
<div class="card-body">
|
43
|
-
|
44
|
-
<%= form_tag commits_url do %>
|
45
|
-
<div class="form-group">
|
46
|
-
<%= label_tag :title %>
|
47
|
-
<%= text_field_tag :title, nil, placeholder: "Enter a title for your commit (required)...", class: "form-control", required: true, autofocus: true %>
|
48
|
-
</div>
|
49
|
-
|
50
|
-
<div class="form-group">
|
51
|
-
<%= label_tag :description %>
|
52
|
-
<%= text_area_tag :description, nil, placeholder: "Enter a longer description of your changes (optional)...", class: "form-control" %>
|
53
|
-
</div>
|
54
|
-
|
55
|
-
<%= button_tag class: "btn btn-primary btn-block", data: { toggle: "tooltip", html: true }, title: "<code>git add -A; git commit</code>" do %>
|
56
|
-
<%= octicon "git-commit", class: "mr-1" %>
|
57
|
-
|
58
|
-
Commit to <%= @current_branch %>
|
59
|
-
<% end %>
|
60
|
-
<% end %>
|
61
|
-
</div>
|
62
|
-
</div>
|
63
|
-
</div>
|
64
|
-
|
65
|
-
<div class="col">
|
66
|
-
<div class="row mb-2">
|
67
|
-
<div class="col">
|
68
|
-
<div class="card">
|
69
|
-
<div class="card-header h6">
|
70
|
-
Switch to a new branch
|
71
|
-
</div>
|
72
|
-
|
73
|
-
<div class="card-body">
|
74
|
-
<%= form_tag branch_url, class: "full-width mb-2" do %>
|
75
|
-
<div class="form-group">
|
76
|
-
<%= label_tag :name, nil, class: "sr-only" %>
|
77
|
-
<%= text_field_tag :name, nil, placeholder: "Enter a name for the branch to create...", class: "form-control" %>
|
78
|
-
</div>
|
79
|
-
<%= button_tag class: "btn btn-success btn-block", data: { toggle: "tooltip", html: true }, title: "<code>git checkout -b [NEW BRANCH NAME]</code>" do %>
|
80
|
-
|
81
|
-
<%= octicon "git-branch", class: "mr-1" %>
|
82
|
-
|
83
|
-
Create a new branch
|
84
|
-
<% end %>
|
85
|
-
<% end %>
|
86
|
-
</div>
|
87
|
-
</div>
|
88
|
-
</div>
|
89
|
-
</div>
|
90
|
-
|
91
|
-
<div class="row">
|
92
|
-
<div class="col">
|
93
|
-
<div class="card">
|
94
|
-
<div class="card-header h6">
|
95
|
-
Discard your changes
|
96
|
-
</div>
|
97
|
-
|
98
|
-
<div class="card-body">
|
99
|
-
<%= button_to commits_stash_url, class: "btn btn-danger btn-block", method: :post, data: { confirm: "Are you sure you want to discard these changes?", toggle: "tooltip", html: true }, title: "<code>git add -A; git stash</code>" do %>
|
100
|
-
<%= octicon "trashcan", class: "mr-1" %>
|
101
|
-
|
102
|
-
Discard all changes
|
103
|
-
<% end %>
|
104
|
-
</div>
|
105
|
-
</div>
|
106
|
-
</div>
|
107
|
-
</div>
|
108
|
-
</div>
|
109
|
-
</div>
|
110
|
-
|
111
|
-
<% else %>
|
112
|
-
|
113
|
-
<div class="row">
|
114
|
-
<div class="col">
|
115
|
-
<pre>
|
116
|
-
<%= simple_format @status %>
|
117
|
-
</pre>
|
118
|
-
|
119
|
-
<%= button_to commits_push_url, disabled: true, class: "btn btn-primary btn-block mb-4", data: { toggle: "tooltip", html: true }, title: "<code>git push</code>" do %>
|
120
|
-
<%= octicon "repo-push", class: "mr-1" %>
|
121
|
-
|
122
|
-
Push to GitHub
|
123
|
-
<% end %>
|
124
|
-
|
125
|
-
<% if @current_branch != "master" && @origin_url.present? %>
|
126
|
-
<%= link_to "https://github.com/#{@user}/#{@repo}/compare/master...#{@user}:#{@current_branch}?expand=1", class: "btn btn-primary btn-block mb-4", target: "_blank" do %>
|
127
|
-
<%= octicon "git-pull-request", class: "mr-1" %>
|
128
|
-
|
129
|
-
Open a pull request into master
|
130
|
-
<% end %>
|
131
|
-
<% end %>
|
132
|
-
|
133
|
-
<%= button_to commits_pull_url, disabled: true, class: "btn btn-primary btn-block mb-4", data: { toggle: "tooltip", html: true }, title: "<code>git pull</code>" do %>
|
134
|
-
<%= octicon "repo-pull", class: "mr-1" %>
|
135
|
-
|
136
|
-
Pull from GitHub
|
137
|
-
<% end %>
|
138
|
-
|
139
|
-
<p>
|
140
|
-
The last thing you did was:
|
141
|
-
</p>
|
142
|
-
|
143
|
-
<blockquote class="blockquote">
|
144
|
-
<%= @last_commit_message %>
|
145
|
-
</blockquote>
|
146
|
-
|
147
|
-
<%= link_to "#latest_diff_html", class: "btn btn-secondary btn-block mb-4", data: { toggle: "collapse" }, title: "git show" do %>
|
148
|
-
<%= octicon "eye", class: "mr-1" %>
|
149
|
-
|
150
|
-
Show last commit
|
151
|
-
<% end %>
|
152
|
-
|
153
|
-
<div id="latest_diff_html" class="collapse">
|
154
|
-
<iframe srcdoc="<%= @last_diff_html %>" width="100%" height="400" class="mb-3">
|
155
|
-
</iframe>
|
156
|
-
</div>
|
157
|
-
</div>
|
158
|
-
|
159
|
-
<div class="col">
|
160
|
-
<ul class="list-group">
|
161
|
-
<li class="list-group-item list-group-item-success">
|
162
|
-
New Branch
|
163
|
-
</li>
|
164
|
-
|
165
|
-
<li class="list-group-item">
|
166
|
-
<%= form_tag branch_url, class: "full-width mb-2" do %>
|
167
|
-
<div class="form-group">
|
168
|
-
<%= label_tag :name, "Go ahead, experiment!" %>
|
169
|
-
<%= text_field_tag :name, nil, placeholder: "Enter a name for the new branch...", class: "form-control" %>
|
170
|
-
</div>
|
171
|
-
<%= button_tag class: "btn btn-success btn-block", data: { toggle: "tooltip", html: true }, title: "<code>git checkout -b [BRANCH NAME]</code>" do %>
|
172
|
-
<%= octicon "git-branch", class: "mr-1" %>
|
173
|
-
|
174
|
-
Create branch
|
175
|
-
<% end %>
|
176
|
-
<% end %>
|
177
|
-
</li>
|
178
|
-
|
179
|
-
<li class="list-group-item list-group-item-info">
|
180
|
-
Existing branches
|
181
|
-
</li>
|
182
|
-
|
183
|
-
<% @branches.each do |branch| %>
|
184
|
-
<li class="list-group-item justify-content-between">
|
185
|
-
<%= branch %>
|
186
|
-
|
187
|
-
<div class="btn-group">
|
188
|
-
<%= link_to octicon("git-compare"), branch_url(name: branch), class: "btn btn-primary btn-sm", title: "Switch to branch<br><code>git checkout #{branch}</code>", data: { toggle: "tooltip", html: true } %>
|
189
|
-
|
190
|
-
<%= link_to octicon("trashcan"), branch_url(name: branch), method: :delete, class: "btn btn-warning btn-sm", data: { toggle: "tooltip", confirm: "Are you sure you want to delete #{branch}?" }, title: "Delete branch #{branch}" %>
|
191
|
-
</div>
|
192
|
-
</li>
|
193
|
-
<% end %>
|
194
|
-
</ul>
|
195
|
-
</div>
|
196
|
-
</div>
|
197
|
-
<% end %>
|
198
|
-
</div>
|
199
|
-
</div>
|
200
|
-
</div>
|
201
|
-
</div>
|
202
|
-
|
203
|
-
<div class="row mb-4">
|
204
|
-
<div class="col">
|
205
|
-
<div class="card">
|
206
|
-
<h2 class="card-header">
|
207
|
-
History
|
208
|
-
</h2>
|
209
|
-
|
210
|
-
<div class="card-body">
|
211
|
-
<p class="lead">Do you want to jump back in time and go down a different path?</p>
|
212
|
-
<%= form_tag branch_url do %>
|
213
|
-
<div class="form-group">
|
214
|
-
<%= label_tag :commit_hash, "Branch off of" %>
|
215
|
-
<%= text_field_tag :commit_hash, nil, placeholder: "Enter the sequence of digits preceding the commit (it's \"hash\") that you want to branch off of...", class: "form-control" %>
|
216
|
-
</div>
|
217
|
-
|
218
|
-
<div class="form-group">
|
219
|
-
<%= label_tag :name, "Branch name" %>
|
220
|
-
<%= text_field_tag :name, nil, placeholder: "Enter a name for the new branch...", class: "form-control" %>
|
221
|
-
</div>
|
222
|
-
|
223
|
-
<% if @diff_html.present? %>
|
224
|
-
<%= button_tag "Can't go back in time while you have pending changes. Commit or discard them first.", class: "btn btn-primary btn-block", disabled: true %>
|
225
|
-
<% else %>
|
226
|
-
<%= button_tag class: "btn btn-success btn-block", data: { toggle: "tooltip", html: true }, title: "<code>git checkout [OLD HASH]; git checkout -b [NEW BRANCH NAME]</code>" do %>
|
227
|
-
<%= octicon "git-branch", class: "mr-1" %>
|
228
|
-
|
229
|
-
Create a new branch off of previous commit
|
230
|
-
<% end %>
|
231
|
-
<% end %>
|
232
|
-
<% end %>
|
233
|
-
|
234
|
-
<pre>
|
235
|
-
<%= simple_format @log %>
|
236
|
-
</pre>
|
237
|
-
|
238
|
-
<% if @log_html.present? %>
|
239
|
-
<iframe srcdoc="<%= @log_html %>" width="100%" height="800" class="mb-3">
|
240
|
-
</iframe>
|
241
|
-
<% end %>
|
242
|
-
</div>
|
243
|
-
</div>
|
244
|
-
</div>
|
245
|
-
</div>
|
data/config/routes.rb
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
WebGit::Engine.routes.draw do
|
2
|
-
root to: 'commands#status'
|
3
|
-
get "status" => "commands#status"
|
4
|
-
resource :branch, only: [:create, :show, :destroy]
|
5
|
-
resources :commits, only: :create
|
6
|
-
post "commits/stash"
|
7
|
-
get "commits/push"
|
8
|
-
get "commits/pull"
|
9
|
-
get "commits/add"
|
10
|
-
end
|
data/lib/web_git/engine.rb
DELETED
data/web_git-0.0.2.gem
DELETED
Binary file
|