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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df344a99ced3ffa5aa14fd5e02c65b0dba783865e0de1a2a8890d60c503fa895
|
4
|
+
data.tar.gz: c73035a3d54a48e0408caaccd511fb870e8b146285fda027269a23e535c83837
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f06d1b999fc619fd52408cba7eeb68c3aec2ed329f05eb2d4f468cdc8773da5c839e38ab45f7a8bd1b701da44c5a3e56670686f36f639d4f167537bc3327cc5d
|
7
|
+
data.tar.gz: ebe553dbf002f9a6e142783543dc5cda05cac78dd76d53c0cbfaf733d7ae3fc5b438bc8c8a0570d7c9e731fa67a7907ad02cedf69eeca4e2c6fdec15aa68f28d
|
data/Gemfile
CHANGED
@@ -6,28 +6,15 @@ source "https://rubygems.org"
|
|
6
6
|
# Add dependencies to develop your gem here.
|
7
7
|
# Include everything needed to run rake, tests, features, etc.
|
8
8
|
group :development do
|
9
|
-
gem "rspec", "~> 3.5.0"
|
10
|
-
gem "rdoc", "~> 3.12"
|
11
|
-
# gem "bundler", "~> 1.0"
|
12
9
|
gem "juwelier", "~> 2.1.0"
|
13
|
-
gem "
|
14
|
-
gem "
|
15
|
-
gem "pry-byebug", "~> 3"
|
16
|
-
gem "pry-doc", "~> 0"
|
17
|
-
gem "pry-remote", "~> 0"
|
18
|
-
gem "pry-rescue", "~> 1"
|
19
|
-
gem "pry-stack_explorer", "~> 0"
|
10
|
+
gem "rdoc", ">= 6.3.1"
|
11
|
+
gem "rspec", "~> 3.5.0"
|
20
12
|
end
|
21
13
|
|
14
|
+
gem "actionview"
|
15
|
+
gem "ansispan"
|
16
|
+
gem "diffy"
|
17
|
+
gem "git"
|
18
|
+
gem "sinatra"
|
22
19
|
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
23
20
|
gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]
|
24
|
-
|
25
|
-
gem "tether-rails"
|
26
|
-
|
27
|
-
gem "octicons_helper"
|
28
|
-
|
29
|
-
gem "turbolinks", "~> 5"
|
30
|
-
|
31
|
-
gem "jquery-rails"
|
32
|
-
|
33
|
-
gem "git_clone_url"
|
data/Gemfile.lock
CHANGED
@@ -1,86 +1,64 @@
|
|
1
1
|
GEM
|
2
2
|
remote: https://rubygems.org/
|
3
3
|
specs:
|
4
|
-
|
5
|
-
|
6
|
-
nio4r (~> 2.0)
|
7
|
-
websocket-driver (>= 0.6.1)
|
8
|
-
actionmailer (5.2.3)
|
9
|
-
actionpack (= 5.2.3)
|
10
|
-
actionview (= 5.2.3)
|
11
|
-
activejob (= 5.2.3)
|
12
|
-
mail (~> 2.5, >= 2.5.4)
|
13
|
-
rails-dom-testing (~> 2.0)
|
14
|
-
actionpack (5.2.3)
|
15
|
-
actionview (= 5.2.3)
|
16
|
-
activesupport (= 5.2.3)
|
17
|
-
rack (~> 2.0)
|
18
|
-
rack-test (>= 0.6.3)
|
19
|
-
rails-dom-testing (~> 2.0)
|
20
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
21
|
-
actionview (5.2.3)
|
22
|
-
activesupport (= 5.2.3)
|
4
|
+
actionview (7.0.2.3)
|
5
|
+
activesupport (= 7.0.2.3)
|
23
6
|
builder (~> 3.1)
|
24
7
|
erubi (~> 1.4)
|
25
8
|
rails-dom-testing (~> 2.0)
|
26
|
-
rails-html-sanitizer (~> 1.
|
27
|
-
|
28
|
-
activesupport (= 5.2.3)
|
29
|
-
globalid (>= 0.3.6)
|
30
|
-
activemodel (5.2.3)
|
31
|
-
activesupport (= 5.2.3)
|
32
|
-
activerecord (5.2.3)
|
33
|
-
activemodel (= 5.2.3)
|
34
|
-
activesupport (= 5.2.3)
|
35
|
-
arel (>= 9.0)
|
36
|
-
activestorage (5.2.3)
|
37
|
-
actionpack (= 5.2.3)
|
38
|
-
activerecord (= 5.2.3)
|
39
|
-
marcel (~> 0.3.1)
|
40
|
-
activesupport (5.2.3)
|
9
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
10
|
+
activesupport (7.0.2.3)
|
41
11
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
42
|
-
i18n (>=
|
43
|
-
minitest (
|
44
|
-
tzinfo (~>
|
45
|
-
addressable (2.
|
46
|
-
public_suffix (>= 2.0.2, <
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
byebug (11.0.1)
|
52
|
-
coderay (1.1.2)
|
53
|
-
concurrent-ruby (1.1.5)
|
54
|
-
crass (1.0.4)
|
55
|
-
debug_inspector (0.0.3)
|
12
|
+
i18n (>= 1.6, < 2)
|
13
|
+
minitest (>= 5.1)
|
14
|
+
tzinfo (~> 2.0)
|
15
|
+
addressable (2.8.0)
|
16
|
+
public_suffix (>= 2.0.2, < 5.0)
|
17
|
+
ansispan (0.0.1)
|
18
|
+
builder (3.2.4)
|
19
|
+
concurrent-ruby (1.1.9)
|
20
|
+
crass (1.0.6)
|
56
21
|
descendants_tracker (0.0.4)
|
57
22
|
thread_safe (~> 0.3, >= 0.3.1)
|
58
|
-
diff-lcs (1.
|
59
|
-
|
60
|
-
erubi (1.
|
61
|
-
faraday (
|
23
|
+
diff-lcs (1.5.0)
|
24
|
+
diffy (3.4.0)
|
25
|
+
erubi (1.10.0)
|
26
|
+
faraday (1.10.0)
|
27
|
+
faraday-em_http (~> 1.0)
|
28
|
+
faraday-em_synchrony (~> 1.0)
|
29
|
+
faraday-excon (~> 1.1)
|
30
|
+
faraday-httpclient (~> 1.0)
|
31
|
+
faraday-multipart (~> 1.0)
|
32
|
+
faraday-net_http (~> 1.0)
|
33
|
+
faraday-net_http_persistent (~> 1.0)
|
34
|
+
faraday-patron (~> 1.0)
|
35
|
+
faraday-rack (~> 1.0)
|
36
|
+
faraday-retry (~> 1.0)
|
37
|
+
ruby2_keywords (>= 0.0.4)
|
38
|
+
faraday-em_http (1.0.0)
|
39
|
+
faraday-em_synchrony (1.0.0)
|
40
|
+
faraday-excon (1.1.0)
|
41
|
+
faraday-httpclient (1.0.1)
|
42
|
+
faraday-multipart (1.0.3)
|
62
43
|
multipart-post (>= 1.2, < 3)
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
44
|
+
faraday-net_http (1.0.1)
|
45
|
+
faraday-net_http_persistent (1.2.0)
|
46
|
+
faraday-patron (1.0.0)
|
47
|
+
faraday-rack (1.0.0)
|
48
|
+
faraday-retry (1.0.3)
|
49
|
+
git (1.10.2)
|
50
|
+
rchardet (~> 1.8)
|
51
|
+
github_api (0.19.0)
|
67
52
|
addressable (~> 2.4)
|
68
53
|
descendants_tracker (~> 0.0.4)
|
69
|
-
faraday (
|
54
|
+
faraday (>= 0.8, < 2)
|
70
55
|
hashie (~> 3.5, >= 3.5.2)
|
71
56
|
oauth2 (~> 1.0)
|
72
|
-
globalid (0.4.2)
|
73
|
-
activesupport (>= 4.2.0)
|
74
57
|
hashie (3.6.0)
|
75
|
-
highline (2.0.
|
76
|
-
i18n (1.
|
58
|
+
highline (2.0.3)
|
59
|
+
i18n (1.10.0)
|
77
60
|
concurrent-ruby (~> 1.0)
|
78
|
-
|
79
|
-
jquery-rails (4.3.5)
|
80
|
-
rails-dom-testing (>= 1, < 3)
|
81
|
-
railties (>= 4.2.0)
|
82
|
-
thor (>= 0.14, < 2.0)
|
83
|
-
json (1.8.6)
|
61
|
+
jar-dependencies (0.4.1)
|
84
62
|
juwelier (2.1.3)
|
85
63
|
builder
|
86
64
|
bundler (>= 1.13)
|
@@ -91,85 +69,51 @@ GEM
|
|
91
69
|
rake
|
92
70
|
rdoc
|
93
71
|
semver
|
94
|
-
jwt (2.
|
95
|
-
loofah (2.
|
72
|
+
jwt (2.3.0)
|
73
|
+
loofah (2.14.0)
|
96
74
|
crass (~> 1.0.2)
|
97
75
|
nokogiri (>= 1.5.9)
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
mimemagic (~> 0.3.2)
|
102
|
-
method_source (0.9.2)
|
103
|
-
mimemagic (0.3.3)
|
104
|
-
mini_mime (1.0.1)
|
105
|
-
mini_portile2 (2.4.0)
|
106
|
-
minitest (5.11.3)
|
107
|
-
multi_json (1.13.1)
|
76
|
+
mini_portile2 (2.8.0)
|
77
|
+
minitest (5.15.0)
|
78
|
+
multi_json (1.15.0)
|
108
79
|
multi_xml (0.6.0)
|
109
80
|
multipart-post (2.1.1)
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
81
|
+
mustermann (1.1.1)
|
82
|
+
ruby2_keywords (~> 0.0.1)
|
83
|
+
nokogiri (1.13.3)
|
84
|
+
mini_portile2 (~> 2.8.0)
|
85
|
+
racc (~> 1.4)
|
86
|
+
nokogiri (1.13.3-java)
|
87
|
+
racc (~> 1.4)
|
88
|
+
nokogiri (1.13.3-x64-mingw32)
|
89
|
+
racc (~> 1.4)
|
90
|
+
nokogiri (1.13.3-x86-mingw32)
|
91
|
+
racc (~> 1.4)
|
92
|
+
oauth2 (1.4.9)
|
93
|
+
faraday (>= 0.17.3, < 3.0)
|
115
94
|
jwt (>= 1.0, < 3.0)
|
116
95
|
multi_json (~> 1.3)
|
117
96
|
multi_xml (~> 0.5)
|
118
97
|
rack (>= 1.2, < 3)
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
pry (~> 0.10)
|
130
|
-
pry-doc (0.13.5)
|
131
|
-
pry (~> 0.11)
|
132
|
-
yard (~> 0.9.11)
|
133
|
-
pry-remote (0.1.8)
|
134
|
-
pry (~> 0.9)
|
135
|
-
slop (~> 3.0)
|
136
|
-
pry-rescue (1.5.0)
|
137
|
-
interception (>= 0.5)
|
138
|
-
pry (>= 0.12.0)
|
139
|
-
pry-stack_explorer (0.4.9.3)
|
140
|
-
binding_of_caller (>= 0.7)
|
141
|
-
pry (>= 0.9.11)
|
142
|
-
public_suffix (3.1.0)
|
143
|
-
rack (2.0.7)
|
144
|
-
rack-test (1.1.0)
|
145
|
-
rack (>= 1.0, < 3)
|
146
|
-
rails (5.2.3)
|
147
|
-
actioncable (= 5.2.3)
|
148
|
-
actionmailer (= 5.2.3)
|
149
|
-
actionpack (= 5.2.3)
|
150
|
-
actionview (= 5.2.3)
|
151
|
-
activejob (= 5.2.3)
|
152
|
-
activemodel (= 5.2.3)
|
153
|
-
activerecord (= 5.2.3)
|
154
|
-
activestorage (= 5.2.3)
|
155
|
-
activesupport (= 5.2.3)
|
156
|
-
bundler (>= 1.3.0)
|
157
|
-
railties (= 5.2.3)
|
158
|
-
sprockets-rails (>= 2.0.0)
|
98
|
+
psych (4.0.3)
|
99
|
+
stringio
|
100
|
+
psych (4.0.3-java)
|
101
|
+
jar-dependencies (>= 0.1.7)
|
102
|
+
public_suffix (4.0.6)
|
103
|
+
racc (1.6.0)
|
104
|
+
racc (1.6.0-java)
|
105
|
+
rack (2.2.3)
|
106
|
+
rack-protection (2.2.0)
|
107
|
+
rack
|
159
108
|
rails-dom-testing (2.0.3)
|
160
109
|
activesupport (>= 4.2.0)
|
161
110
|
nokogiri (>= 1.6)
|
162
|
-
rails-html-sanitizer (1.
|
163
|
-
loofah (~> 2.
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
rake (>= 0.8.7)
|
169
|
-
thor (>= 0.19.0, < 2.0)
|
170
|
-
rake (12.3.2)
|
171
|
-
rdoc (3.12.2)
|
172
|
-
json (~> 1.4)
|
111
|
+
rails-html-sanitizer (1.4.2)
|
112
|
+
loofah (~> 2.3)
|
113
|
+
rake (13.0.6)
|
114
|
+
rchardet (1.8.0)
|
115
|
+
rdoc (6.4.0)
|
116
|
+
psych (>= 4.0.0)
|
173
117
|
rspec (3.5.0)
|
174
118
|
rspec-core (~> 3.5.0)
|
175
119
|
rspec-expectations (~> 3.5.0)
|
@@ -183,55 +127,39 @@ GEM
|
|
183
127
|
diff-lcs (>= 1.2.0, < 2.0)
|
184
128
|
rspec-support (~> 3.5.0)
|
185
129
|
rspec-support (3.5.0)
|
130
|
+
ruby2_keywords (0.0.5)
|
186
131
|
semver (1.0.1)
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
sprockets (3.7.2)
|
194
|
-
concurrent-ruby (~> 1.0)
|
195
|
-
rack (> 1, < 3)
|
196
|
-
sprockets-rails (3.2.1)
|
197
|
-
actionpack (>= 4.0)
|
198
|
-
activesupport (>= 4.0)
|
199
|
-
sprockets (>= 3.0.0)
|
200
|
-
tether-rails (1.4.0)
|
201
|
-
rails (>= 3.1)
|
202
|
-
thor (0.20.3)
|
132
|
+
sinatra (2.2.0)
|
133
|
+
mustermann (~> 1.0)
|
134
|
+
rack (~> 2.2)
|
135
|
+
rack-protection (= 2.2.0)
|
136
|
+
tilt (~> 2.0)
|
137
|
+
stringio (3.0.1)
|
203
138
|
thread_safe (0.3.6)
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
websocket-driver (0.7.1)
|
211
|
-
websocket-extensions (>= 0.1.0)
|
212
|
-
websocket-extensions (0.1.4)
|
213
|
-
yard (0.9.19)
|
139
|
+
thread_safe (0.3.6-java)
|
140
|
+
tilt (2.0.10)
|
141
|
+
tzinfo (2.0.4)
|
142
|
+
concurrent-ruby (~> 1.0)
|
143
|
+
tzinfo-data (1.2021.5)
|
144
|
+
tzinfo (>= 1.0.0)
|
214
145
|
|
215
146
|
PLATFORMS
|
147
|
+
java
|
216
148
|
ruby
|
149
|
+
x64-mingw32
|
150
|
+
x86-mingw32
|
151
|
+
x86-mswin32
|
217
152
|
|
218
153
|
DEPENDENCIES
|
219
|
-
|
220
|
-
|
154
|
+
actionview
|
155
|
+
ansispan
|
156
|
+
diffy
|
157
|
+
git
|
221
158
|
juwelier (~> 2.1.0)
|
222
|
-
|
223
|
-
pry (~> 0)
|
224
|
-
pry-byebug (~> 3)
|
225
|
-
pry-doc (~> 0)
|
226
|
-
pry-remote (~> 0)
|
227
|
-
pry-rescue (~> 1)
|
228
|
-
pry-stack_explorer (~> 0)
|
229
|
-
rdoc (~> 3.12)
|
159
|
+
rdoc (>= 6.3.1)
|
230
160
|
rspec (~> 3.5.0)
|
231
|
-
|
232
|
-
tether-rails
|
233
|
-
turbolinks (~> 5)
|
161
|
+
sinatra
|
234
162
|
tzinfo-data
|
235
163
|
|
236
164
|
BUNDLED WITH
|
237
|
-
2.
|
165
|
+
2.1.4
|
data/README.markdown
CHANGED
@@ -2,15 +2,10 @@
|
|
2
2
|
|
3
3
|
An in-browser Git GUI for your Rails project.
|
4
4
|
|
5
|
-
WebGit is
|
5
|
+
WebGit is an embeddable Sinatra app that provides an in-browser visual interface to a simple but effective Git workflow. For educational purposes.
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
9
|
-
You need to have the `diff2html-cli` command available on your system. You can install it with:
|
10
|
-
|
11
|
-
```
|
12
|
-
npm install -g diff2html-cli
|
13
|
-
```
|
14
9
|
|
15
10
|
Add this line to your application's Gemfile:
|
16
11
|
|
@@ -18,9 +13,36 @@ Add this line to your application's Gemfile:
|
|
18
13
|
gem "web_git", git: "https://github.com/firstdraft/web_git"
|
19
14
|
```
|
20
15
|
|
21
|
-
And then execute:
|
16
|
+
And then execute the following command in a Terminal:
|
17
|
+
|
18
|
+
```bash
|
19
|
+
bundle install
|
20
|
+
```
|
21
|
+
|
22
|
+
In the directory of your Rails app run:
|
23
|
+
|
22
24
|
```bash
|
23
|
-
|
25
|
+
rails generate web_git:install
|
26
|
+
```
|
27
|
+
Then `rails server` and visit `/git`.
|
28
|
+
|
29
|
+
## Usage
|
30
|
+
|
31
|
+
In your Rails app
|
32
|
+
|
33
|
+
```ruby
|
34
|
+
# config.ru
|
35
|
+
# This file is used by Rack-based servers to start the application.
|
36
|
+
|
37
|
+
require_relative 'config/environment'
|
38
|
+
|
39
|
+
map '/git' do
|
40
|
+
run WebGit::Server
|
41
|
+
end
|
42
|
+
|
43
|
+
map '/' do
|
44
|
+
run Rails.application
|
45
|
+
end
|
24
46
|
```
|
25
47
|
|
26
48
|
## License
|
data/Rakefile
CHANGED
@@ -17,9 +17,9 @@ Juwelier::Tasks.new do |gem|
|
|
17
17
|
gem.homepage = "http://github.com/firstdraft/web_git"
|
18
18
|
gem.license = "MIT"
|
19
19
|
gem.summary = %Q{An in-browser Git GUI for your Rails project}
|
20
|
-
gem.description = %Q{WebGit is
|
21
|
-
gem.email = "raghu@firstdraft.com"
|
22
|
-
gem.authors = ["Raghu Betina"]
|
20
|
+
gem.description = %Q{WebGit is an embeddable Sinatra app that provides an in-browser visual interface to a simple but effective Git workflow. For educational purposes.}
|
21
|
+
gem.email = ["raghu@firstdraft.com", "jelani@firstdraft.com"]
|
22
|
+
gem.authors = ["Raghu Betina", "Jelani Woods"]
|
23
23
|
|
24
24
|
# dependencies defined in Gemfile
|
25
25
|
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0
|
1
|
+
0.1.0
|
@@ -0,0 +1,47 @@
|
|
1
|
+
module WebGit
|
2
|
+
class InstallGenerator < Rails::Generators::Base
|
3
|
+
def generate_server
|
4
|
+
|
5
|
+
filename = Rails.root.join("config.ru")
|
6
|
+
|
7
|
+
log :insert, "Updating config.ru to run apps in parallel."
|
8
|
+
if File.exists?(filename) && already_installed?
|
9
|
+
log :identical, "Skipping overrides."
|
10
|
+
else
|
11
|
+
contents = <<~RUBY
|
12
|
+
|
13
|
+
if Rails.env.development?
|
14
|
+
map '/git' do
|
15
|
+
run WebGit::Server
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
map '/' do
|
20
|
+
RUBY
|
21
|
+
|
22
|
+
filename = "config.ru"
|
23
|
+
match_text = "run Rails.application"
|
24
|
+
|
25
|
+
insert_into_file filename, contents, before: match_text
|
26
|
+
insert_into_file filename, "\nend", after: match_text, force: true
|
27
|
+
gsub_file filename, match_text, "\t#{match_text}"
|
28
|
+
end
|
29
|
+
|
30
|
+
expect_installed = run("which expect")
|
31
|
+
|
32
|
+
unless expect_installed
|
33
|
+
log :insert, "Installing expect."
|
34
|
+
run "sudo apt install -y expect"
|
35
|
+
else
|
36
|
+
log :identical, "expect already installed."
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def already_installed?
|
41
|
+
filename = Rails.root.join("config.ru")
|
42
|
+
contents = open(filename).read
|
43
|
+
|
44
|
+
contents.match?(/if\s*Rails.env.development\?\s*map\s*'\/git'\s*do\s*run\s*WebGit::Server\s*end\s*end/)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
#!/usr/bin/expect -f
|
2
|
+
#
|
3
|
+
# This Expect script was generated by autoexpect on Tue Jun 22 17:49:07 2021
|
4
|
+
# Expect and autoexpect were both written by Don Libes, NIST.
|
5
|
+
#
|
6
|
+
# Note that autoexpect does not guarantee a working script. It
|
7
|
+
# necessarily has to guess about certain things. Two reasons a script
|
8
|
+
# might fail are:
|
9
|
+
#
|
10
|
+
# 1) timing - A surprising number of programs (rn, ksh, zsh, telnet,
|
11
|
+
# etc.) and devices discard or ignore keystrokes that arrive "too
|
12
|
+
# quickly" after prompts. If you find your new script hanging up at
|
13
|
+
# one spot, try adding a short sleep just before the previous send.
|
14
|
+
# Setting "force_conservative" to 1 (see below) makes Expect do this
|
15
|
+
# automatically - pausing briefly before sending each character. This
|
16
|
+
# pacifies every program I know of. The -c flag makes the script do
|
17
|
+
# this in the first place. The -C flag allows you to define a
|
18
|
+
# character to toggle this mode off and on.
|
19
|
+
|
20
|
+
set force_conservative 0 ;# set to 1 to force conservative mode even if
|
21
|
+
;# script wasn't run conservatively originally
|
22
|
+
if {$force_conservative} {
|
23
|
+
set send_slow {1 .1}
|
24
|
+
proc send {ignore arg} {
|
25
|
+
sleep .1
|
26
|
+
exp_send -s -- $arg
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
30
|
+
#
|
31
|
+
# 2) differing output - Some programs produce different output each time
|
32
|
+
# they run. The "date" command is an obvious example. Another is
|
33
|
+
# ftp, if it produces throughput statistics at the end of a file
|
34
|
+
# transfer. If this causes a problem, delete these patterns or replace
|
35
|
+
# them with wildcards. An alternative is to use the -p flag (for
|
36
|
+
# "prompt") which makes Expect only look for the last line of output
|
37
|
+
# (i.e., the prompt). The -P flag allows you to define a character to
|
38
|
+
# toggle this mode off and on.
|
39
|
+
#
|
40
|
+
# Read the man page for more info.
|
41
|
+
#
|
42
|
+
# -Don
|
43
|
+
|
44
|
+
set email [lindex $argv 0];
|
45
|
+
set password [lindex $argv 1];
|
46
|
+
|
47
|
+
set timeout -1
|
48
|
+
spawn heroku login --interactive
|
49
|
+
match_max 100000
|
50
|
+
expect -re {(.|\n)*Enter your login credentials\r}
|
51
|
+
send -- "$email"
|
52
|
+
expect -exact "$email"
|
53
|
+
send -- "\r"
|
54
|
+
expect -re {(.|\n)*Password:}
|
55
|
+
send -- "$password"
|
56
|
+
expect -re {\*.*}
|
57
|
+
send -- "\r"
|
58
|
+
expect eof
|