web_git 0.0.4 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '09cf35d48d6e94108eeb74ad251d935c3fe1f5e3eafac0456d91785f01c1f1f3'
4
- data.tar.gz: 90c36850cdece9f97ea4d05ae4c6f1941b4a0152e2a25f24141e3ba994625412
3
+ metadata.gz: df344a99ced3ffa5aa14fd5e02c65b0dba783865e0de1a2a8890d60c503fa895
4
+ data.tar.gz: c73035a3d54a48e0408caaccd511fb870e8b146285fda027269a23e535c83837
5
5
  SHA512:
6
- metadata.gz: ca0177255ea588700af60733decd1046ae34a17423c0cab82a65388613f4676f3dd639390b1f0536a918f0bf71ab64c0f5dfd306ff2dbe07b962b8f73017ecf6
7
- data.tar.gz: 37114fdf1558caa2659bc9d8dfa8159be5cfbbfac34461a13a1b22ab2a2420cfd29ed3766dc10a0dd9aec2e9062a84482936d98ec19c12702d2a4eed95499bb9
6
+ metadata.gz: f06d1b999fc619fd52408cba7eeb68c3aec2ed329f05eb2d4f468cdc8773da5c839e38ab45f7a8bd1b701da44c5a3e56670686f36f639d4f167537bc3327cc5d
7
+ data.tar.gz: ebe553dbf002f9a6e142783543dc5cda05cac78dd76d53c0cbfaf733d7ae3fc5b438bc8c8a0570d7c9e731fa67a7907ad02cedf69eeca4e2c6fdec15aa68f28d
data/Gemfile CHANGED
@@ -6,31 +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 "simplecov", ">= 0"
14
- gem "pry", "~> 0"
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"
22
16
  gem "diffy"
17
+ gem "git"
18
+ gem "sinatra"
23
19
  # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
24
20
  gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]
25
-
26
- gem "tether-rails"
27
-
28
- gem "octicons_helper"
29
-
30
- gem "turbolinks", "~> 5"
31
-
32
- gem "jquery-rails"
33
-
34
- gem "git_clone_url"
35
-
36
- gem "yard", ">= 0.9.20"
data/Gemfile.lock CHANGED
@@ -1,87 +1,64 @@
1
1
  GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
- actioncable (5.2.3)
5
- actionpack (= 5.2.3)
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.0, >= 1.0.3)
27
- activejob (5.2.3)
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 (>= 0.7, < 2)
43
- minitest (~> 5.1)
44
- tzinfo (~> 1.1)
45
- addressable (2.6.0)
46
- public_suffix (>= 2.0.2, < 4.0)
47
- arel (9.0.0)
48
- binding_of_caller (0.8.0)
49
- debug_inspector (>= 0.0.1)
50
- builder (3.2.3)
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.3)
59
- diffy (3.3.0)
60
- docile (1.3.2)
61
- erubi (1.8.0)
62
- faraday (0.15.4)
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)
63
43
  multipart-post (>= 1.2, < 3)
64
- git (1.5.0)
65
- git_clone_url (2.0.0)
66
- uri-ssh_git (>= 2.0)
67
- github_api (0.18.2)
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)
68
52
  addressable (~> 2.4)
69
53
  descendants_tracker (~> 0.0.4)
70
- faraday (~> 0.8)
54
+ faraday (>= 0.8, < 2)
71
55
  hashie (~> 3.5, >= 3.5.2)
72
56
  oauth2 (~> 1.0)
73
- globalid (0.4.2)
74
- activesupport (>= 4.2.0)
75
57
  hashie (3.6.0)
76
- highline (2.0.2)
77
- i18n (1.6.0)
58
+ highline (2.0.3)
59
+ i18n (1.10.0)
78
60
  concurrent-ruby (~> 1.0)
79
- interception (0.5)
80
- jquery-rails (4.3.5)
81
- rails-dom-testing (>= 1, < 3)
82
- railties (>= 4.2.0)
83
- thor (>= 0.14, < 2.0)
84
- json (1.8.6)
61
+ jar-dependencies (0.4.1)
85
62
  juwelier (2.1.3)
86
63
  builder
87
64
  bundler (>= 1.13)
@@ -92,85 +69,51 @@ GEM
92
69
  rake
93
70
  rdoc
94
71
  semver
95
- jwt (2.2.1)
96
- loofah (2.2.3)
72
+ jwt (2.3.0)
73
+ loofah (2.14.0)
97
74
  crass (~> 1.0.2)
98
75
  nokogiri (>= 1.5.9)
99
- mail (2.7.1)
100
- mini_mime (>= 0.1.1)
101
- marcel (0.3.3)
102
- mimemagic (~> 0.3.2)
103
- method_source (0.9.2)
104
- mimemagic (0.3.3)
105
- mini_mime (1.0.2)
106
- mini_portile2 (2.4.0)
107
- minitest (5.11.3)
108
- multi_json (1.13.1)
76
+ mini_portile2 (2.8.0)
77
+ minitest (5.15.0)
78
+ multi_json (1.15.0)
109
79
  multi_xml (0.6.0)
110
80
  multipart-post (2.1.1)
111
- nio4r (2.4.0)
112
- nokogiri (1.10.3)
113
- mini_portile2 (~> 2.4.0)
114
- oauth2 (1.4.1)
115
- faraday (>= 0.8, < 0.16.0)
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)
116
94
  jwt (>= 1.0, < 3.0)
117
95
  multi_json (~> 1.3)
118
96
  multi_xml (~> 0.5)
119
97
  rack (>= 1.2, < 3)
120
- octicons (9.1.1)
121
- nokogiri (>= 1.6.3.1)
122
- octicons_helper (9.1.1)
123
- octicons (= 9.1.1)
124
- rails
125
- pry (0.12.2)
126
- coderay (~> 1.1.0)
127
- method_source (~> 0.9.0)
128
- pry-byebug (3.7.0)
129
- byebug (~> 11.0)
130
- pry (~> 0.10)
131
- pry-doc (0.13.5)
132
- pry (~> 0.11)
133
- yard (~> 0.9.11)
134
- pry-remote (0.1.8)
135
- pry (~> 0.9)
136
- slop (~> 3.0)
137
- pry-rescue (1.5.0)
138
- interception (>= 0.5)
139
- pry (>= 0.12.0)
140
- pry-stack_explorer (0.4.9.3)
141
- binding_of_caller (>= 0.7)
142
- pry (>= 0.9.11)
143
- public_suffix (3.1.1)
144
- rack (2.0.7)
145
- rack-test (1.1.0)
146
- rack (>= 1.0, < 3)
147
- rails (5.2.3)
148
- actioncable (= 5.2.3)
149
- actionmailer (= 5.2.3)
150
- actionpack (= 5.2.3)
151
- actionview (= 5.2.3)
152
- activejob (= 5.2.3)
153
- activemodel (= 5.2.3)
154
- activerecord (= 5.2.3)
155
- activestorage (= 5.2.3)
156
- activesupport (= 5.2.3)
157
- bundler (>= 1.3.0)
158
- railties (= 5.2.3)
159
- 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
160
108
  rails-dom-testing (2.0.3)
161
109
  activesupport (>= 4.2.0)
162
110
  nokogiri (>= 1.6)
163
- rails-html-sanitizer (1.0.4)
164
- loofah (~> 2.2, >= 2.2.2)
165
- railties (5.2.3)
166
- actionpack (= 5.2.3)
167
- activesupport (= 5.2.3)
168
- method_source
169
- rake (>= 0.8.7)
170
- thor (>= 0.19.0, < 2.0)
171
- rake (12.3.2)
172
- rdoc (3.12.2)
173
- 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)
174
117
  rspec (3.5.0)
175
118
  rspec-core (~> 3.5.0)
176
119
  rspec-expectations (~> 3.5.0)
@@ -184,57 +127,39 @@ GEM
184
127
  diff-lcs (>= 1.2.0, < 2.0)
185
128
  rspec-support (~> 3.5.0)
186
129
  rspec-support (3.5.0)
130
+ ruby2_keywords (0.0.5)
187
131
  semver (1.0.1)
188
- simplecov (0.17.0)
189
- docile (~> 1.1)
190
- json (>= 1.8, < 3)
191
- simplecov-html (~> 0.10.0)
192
- simplecov-html (0.10.2)
193
- slop (3.6.0)
194
- sprockets (3.7.2)
195
- concurrent-ruby (~> 1.0)
196
- rack (> 1, < 3)
197
- sprockets-rails (3.2.1)
198
- actionpack (>= 4.0)
199
- activesupport (>= 4.0)
200
- sprockets (>= 3.0.0)
201
- tether-rails (1.4.0)
202
- rails (>= 3.1)
203
- 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)
204
138
  thread_safe (0.3.6)
205
- turbolinks (5.2.0)
206
- turbolinks-source (~> 5.2)
207
- turbolinks-source (5.2.0)
208
- tzinfo (1.2.5)
209
- thread_safe (~> 0.1)
210
- uri-ssh_git (2.0.0)
211
- websocket-driver (0.7.1)
212
- websocket-extensions (>= 0.1.0)
213
- websocket-extensions (0.1.4)
214
- yard (0.9.20)
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)
215
145
 
216
146
  PLATFORMS
147
+ java
217
148
  ruby
149
+ x64-mingw32
150
+ x86-mingw32
151
+ x86-mswin32
218
152
 
219
153
  DEPENDENCIES
154
+ actionview
155
+ ansispan
220
156
  diffy
221
- git_clone_url
222
- jquery-rails
157
+ git
223
158
  juwelier (~> 2.1.0)
224
- octicons_helper
225
- pry (~> 0)
226
- pry-byebug (~> 3)
227
- pry-doc (~> 0)
228
- pry-remote (~> 0)
229
- pry-rescue (~> 1)
230
- pry-stack_explorer (~> 0)
231
- rdoc (~> 3.12)
159
+ rdoc (>= 6.3.1)
232
160
  rspec (~> 3.5.0)
233
- simplecov
234
- tether-rails
235
- turbolinks (~> 5)
161
+ sinatra
236
162
  tzinfo-data
237
- yard (>= 0.9.20)
238
163
 
239
164
  BUNDLED WITH
240
- 2.0.2
165
+ 2.1.4
data/README.markdown CHANGED
@@ -2,11 +2,10 @@
2
2
 
3
3
  An in-browser Git GUI for your Rails project.
4
4
 
5
- WebGit is a Rails Engine that provides an in-browser visual interface to a simple but effective Git workflow. For educational purposes.
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
- ```
10
9
 
11
10
  Add this line to your application's Gemfile:
12
11
 
@@ -14,9 +13,36 @@ Add this line to your application's Gemfile:
14
13
  gem "web_git", git: "https://github.com/firstdraft/web_git"
15
14
  ```
16
15
 
17
- And then execute:
16
+ And then execute the following command in a Terminal:
17
+
18
18
  ```bash
19
- $ bundle
19
+ bundle install
20
+ ```
21
+
22
+ In the directory of your Rails app run:
23
+
24
+ ```bash
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
20
46
  ```
21
47
 
22
48
  ## License
data/Rakefile CHANGED
@@ -17,8 +17,8 @@ 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 a Rails Engine that provides an in-browser visual interface to a simple but effective Git workflow. For educational purposes.}
21
- gem.email = "raghu@firstdraft.com"
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
22
  gem.authors = ["Raghu Betina", "Jelani Woods"]
23
23
 
24
24
  # dependencies defined in Gemfile
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.4
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