git_presenter 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +6 -6
- data/Gemfile.lock +24 -19
- data/VERSION +1 -1
- data/bin/git-presenter +2 -2
- data/git_presenter.gemspec +15 -15
- data/spec/bugs/max_10_commits_being_parsed_spec.rb +1 -1
- data/spec/integration/initialize_presentation_spec.rb +6 -6
- data/spec/integration/moving_through_presentation_spec.rb +18 -18
- data/spec/integration/start_presentation_spec.rb +5 -5
- data/spec/integration/update_presentation_spec.rb +4 -4
- data/spec/lib/git_presenter/presentation_spec.rb +17 -17
- data/spec/lib/git_presenter/slide_spec.rb +8 -8
- metadata +26 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16d1088ab5afeafb7357fb67a07d0b80c29715b75f0e90ba7fcc549f58cdeb84
|
4
|
+
data.tar.gz: fe4948246f729b01c8678e11f03f8bdbd979b3988d896edd7142c35dd3c23ec8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab27a51ae79c16e0dc42775ecec088f135b405864487e44dcb01a35345711374e4614a5b9d3a83aac5bdd5cc1ce57f358fa48cf6bff9d8c1e3f484433f6cdbf0
|
7
|
+
data.tar.gz: 9ccf1f24f2d908b2fb1b98b4936a027cae95f29d1f933a36b3df22e9bab20574e0e78a434f4d5ff4adfa185f6540e2bee13056694ca79cb04926759b59c7ba24
|
data/Gemfile
CHANGED
@@ -3,14 +3,14 @@ source "http://rubygems.org"
|
|
3
3
|
# Example:
|
4
4
|
# gem "activesupport", ">= 2.3.5"
|
5
5
|
#
|
6
|
-
gem "git"
|
7
|
-
gem 'launchy',
|
6
|
+
gem "git", "1.8.1"
|
7
|
+
gem 'launchy', "2.5.0"
|
8
8
|
|
9
9
|
# Add dependencies to develop your gem here.
|
10
10
|
# Include everything needed to run rake, tests, features, etc.
|
11
11
|
group :development do
|
12
|
-
gem "pry"
|
13
|
-
gem "rspec", "
|
14
|
-
gem "bundler"
|
15
|
-
gem 'jeweler',
|
12
|
+
gem "pry", "0.14.1"
|
13
|
+
gem "rspec", "3.10.0"
|
14
|
+
gem "bundler", "2.2.3"
|
15
|
+
gem 'jeweler', "2.3.5"
|
16
16
|
end
|
data/Gemfile.lock
CHANGED
@@ -10,7 +10,7 @@ GEM
|
|
10
10
|
diff-lcs (1.4.4)
|
11
11
|
faraday (0.9.2)
|
12
12
|
multipart-post (>= 1.2, < 3)
|
13
|
-
ffi (1.
|
13
|
+
ffi (1.15.0-java)
|
14
14
|
git (1.8.1)
|
15
15
|
rchardet (~> 1.8)
|
16
16
|
github_api (0.11.3)
|
@@ -35,7 +35,7 @@ GEM
|
|
35
35
|
rake
|
36
36
|
rdoc
|
37
37
|
semver2
|
38
|
-
jwt (2.2.
|
38
|
+
jwt (2.2.3)
|
39
39
|
launchy (2.5.0)
|
40
40
|
addressable (~> 2.7)
|
41
41
|
method_source (1.0.0)
|
@@ -46,16 +46,16 @@ GEM
|
|
46
46
|
nokogiri (1.6.8.1)
|
47
47
|
mini_portile2 (~> 2.1.0)
|
48
48
|
nokogiri (1.6.8.1-java)
|
49
|
-
oauth2 (1.4.
|
49
|
+
oauth2 (1.4.7)
|
50
50
|
faraday (>= 0.8, < 2.0)
|
51
51
|
jwt (>= 1.0, < 3.0)
|
52
52
|
multi_json (~> 1.3)
|
53
53
|
multi_xml (~> 0.5)
|
54
54
|
rack (>= 1.2, < 3)
|
55
|
-
pry (0.
|
55
|
+
pry (0.14.1)
|
56
56
|
coderay (~> 1.1)
|
57
57
|
method_source (~> 1.0)
|
58
|
-
pry (0.
|
58
|
+
pry (0.14.1-java)
|
59
59
|
coderay (~> 1.1)
|
60
60
|
method_source (~> 1.0)
|
61
61
|
spoon (~> 0.0)
|
@@ -67,14 +67,19 @@ GEM
|
|
67
67
|
rake (13.0.3)
|
68
68
|
rchardet (1.8.0)
|
69
69
|
rdoc (6.3.0)
|
70
|
-
rspec (
|
71
|
-
rspec-core (~>
|
72
|
-
rspec-expectations (~>
|
73
|
-
rspec-mocks (~>
|
74
|
-
rspec-core (
|
75
|
-
|
76
|
-
|
77
|
-
|
70
|
+
rspec (3.10.0)
|
71
|
+
rspec-core (~> 3.10.0)
|
72
|
+
rspec-expectations (~> 3.10.0)
|
73
|
+
rspec-mocks (~> 3.10.0)
|
74
|
+
rspec-core (3.10.1)
|
75
|
+
rspec-support (~> 3.10.0)
|
76
|
+
rspec-expectations (3.10.1)
|
77
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
78
|
+
rspec-support (~> 3.10.0)
|
79
|
+
rspec-mocks (3.10.2)
|
80
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
81
|
+
rspec-support (~> 3.10.0)
|
82
|
+
rspec-support (3.10.2)
|
78
83
|
semver2 (3.4.2)
|
79
84
|
spoon (0.0.6)
|
80
85
|
ffi
|
@@ -86,12 +91,12 @@ PLATFORMS
|
|
86
91
|
ruby
|
87
92
|
|
88
93
|
DEPENDENCIES
|
89
|
-
bundler
|
90
|
-
git
|
91
|
-
jeweler (
|
92
|
-
launchy (
|
93
|
-
pry
|
94
|
-
rspec (
|
94
|
+
bundler (= 2.2.3)
|
95
|
+
git (= 1.8.1)
|
96
|
+
jeweler (= 2.3.5)
|
97
|
+
launchy (= 2.5.0)
|
98
|
+
pry (= 0.14.1)
|
99
|
+
rspec (= 3.10.0)
|
95
100
|
|
96
101
|
BUNDLED WITH
|
97
102
|
2.2.3
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.4.0
|
data/bin/git-presenter
CHANGED
data/git_presenter.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: git_presenter 1.
|
5
|
+
# stub: git_presenter 1.4.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "git_presenter".freeze
|
9
|
-
s.version = "1.
|
9
|
+
s.version = "1.4.0"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
13
13
|
s.authors = ["Colin Gemmell".freeze]
|
14
|
-
s.date = "2021-01
|
14
|
+
s.date = "2021-05-01"
|
15
15
|
s.description = "Code presentation tool using git".freeze
|
16
16
|
s.email = "pythonandchips@gmail.com".freeze
|
17
17
|
s.executables = ["git-presenter".freeze]
|
@@ -57,19 +57,19 @@ Gem::Specification.new do |s|
|
|
57
57
|
end
|
58
58
|
|
59
59
|
if s.respond_to? :add_runtime_dependency then
|
60
|
-
s.add_runtime_dependency(%q<git>.freeze, ["
|
61
|
-
s.add_runtime_dependency(%q<launchy>.freeze, ["
|
62
|
-
s.add_development_dependency(%q<pry>.freeze, ["
|
63
|
-
s.add_development_dependency(%q<rspec>.freeze, ["
|
64
|
-
s.add_development_dependency(%q<bundler>.freeze, ["
|
65
|
-
s.add_development_dependency(%q<jeweler>.freeze, ["
|
60
|
+
s.add_runtime_dependency(%q<git>.freeze, ["= 1.8.1"])
|
61
|
+
s.add_runtime_dependency(%q<launchy>.freeze, ["= 2.5.0"])
|
62
|
+
s.add_development_dependency(%q<pry>.freeze, ["= 0.14.1"])
|
63
|
+
s.add_development_dependency(%q<rspec>.freeze, ["= 3.10.0"])
|
64
|
+
s.add_development_dependency(%q<bundler>.freeze, ["= 2.2.3"])
|
65
|
+
s.add_development_dependency(%q<jeweler>.freeze, ["= 2.3.5"])
|
66
66
|
else
|
67
|
-
s.add_dependency(%q<git>.freeze, ["
|
68
|
-
s.add_dependency(%q<launchy>.freeze, ["
|
69
|
-
s.add_dependency(%q<pry>.freeze, ["
|
70
|
-
s.add_dependency(%q<rspec>.freeze, ["
|
71
|
-
s.add_dependency(%q<bundler>.freeze, ["
|
72
|
-
s.add_dependency(%q<jeweler>.freeze, ["
|
67
|
+
s.add_dependency(%q<git>.freeze, ["= 1.8.1"])
|
68
|
+
s.add_dependency(%q<launchy>.freeze, ["= 2.5.0"])
|
69
|
+
s.add_dependency(%q<pry>.freeze, ["= 0.14.1"])
|
70
|
+
s.add_dependency(%q<rspec>.freeze, ["= 3.10.0"])
|
71
|
+
s.add_dependency(%q<bundler>.freeze, ["= 2.2.3"])
|
72
|
+
s.add_dependency(%q<jeweler>.freeze, ["= 2.3.5"])
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
@@ -7,7 +7,7 @@ describe "presentation should parse all commits for a repo" do
|
|
7
7
|
|
8
8
|
it "should parse more than 10 commits" do
|
9
9
|
@helper.initialise_presentation({:no_of_commits => 13}) do |commits, yaml|
|
10
|
-
yaml["slides"].length.
|
10
|
+
expect(yaml["slides"].length).to eql 13
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -10,37 +10,37 @@ describe "initializing a presentation" do
|
|
10
10
|
context ".presentation file" do
|
11
11
|
it "should be written to root directory" do
|
12
12
|
@helper.initialise_presentation do
|
13
|
-
File.exists?(".presentation").
|
13
|
+
expect(File.exists?(".presentation")).to be_truthy
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
17
|
it "should have a slides node" do
|
18
18
|
@helper.initialise_presentation do |commits, yaml|
|
19
|
-
yaml["slides"].
|
19
|
+
expect(yaml["slides"]).not_to be_nil
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
23
|
it 'should have a branch note' do
|
24
24
|
@helper.initialise_presentation do |commits, yaml|
|
25
|
-
yaml["branch"].
|
25
|
+
expect(yaml["branch"]).not_to be_nil
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
29
|
it "should contain a line for each commit to the repository" do
|
30
30
|
@helper.initialise_presentation do |commits, yaml|
|
31
|
-
yaml["slides"].length.
|
31
|
+
expect(yaml["slides"].length).not_to eql commits.length
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
35
|
it "first line should contain the first commit number" do
|
36
36
|
@helper.initialise_presentation({:delay => true}) do |commits, yaml|
|
37
|
-
yaml["slides"][0]["slide"]["commit"].
|
37
|
+
expect(yaml["slides"][0]["slide"]["commit"]).to eql commits.first.sha
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
41
|
it "second line should contain the second commit number" do
|
42
42
|
@helper.initialise_presentation({:delay => true}) do |commits, yaml|
|
43
|
-
yaml["slides"][1]["slide"]["commit"].
|
43
|
+
expect(yaml["slides"][1]["slide"]["commit"]).to eql commits[1].sha
|
44
44
|
end
|
45
45
|
end
|
46
46
|
end
|
@@ -11,7 +11,7 @@ describe "while giving presentation" do
|
|
11
11
|
it "should move to the next commit" do
|
12
12
|
@helper.start_presentation do |commits, presenter|
|
13
13
|
presenter.execute("next")
|
14
|
-
@helper.head_position.
|
14
|
+
expect(@helper.head_position).to eql commits[1].sha
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
@@ -19,7 +19,7 @@ describe "while giving presentation" do
|
|
19
19
|
@helper.start_presentation do |commits, presenter|
|
20
20
|
presenter.execute("next")
|
21
21
|
presenter.execute("next")
|
22
|
-
@helper.head_position.
|
22
|
+
expect(@helper.head_position).to eql commits[2].sha
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
@@ -30,7 +30,7 @@ describe "while giving presentation" do
|
|
30
30
|
presenter.execute("next")
|
31
31
|
@helper.edit_file("inner commit")
|
32
32
|
presenter.execute("next")
|
33
|
-
@helper.head_position.
|
33
|
+
expect(@helper.head_position).to eql commits[2].sha
|
34
34
|
end
|
35
35
|
end
|
36
36
|
end
|
@@ -42,7 +42,7 @@ describe "while giving presentation" do
|
|
42
42
|
presenter.execute("next")
|
43
43
|
presenter.execute("next")
|
44
44
|
presenter.execute("next")
|
45
|
-
@helper.head_position.
|
45
|
+
expect(@helper.head_position).to eql commits[2].sha
|
46
46
|
end
|
47
47
|
end
|
48
48
|
end
|
@@ -53,7 +53,7 @@ describe "while giving presentation" do
|
|
53
53
|
presenter.execute("next")
|
54
54
|
presenter.execute("next")
|
55
55
|
presenter.execute("back")
|
56
|
-
@helper.head_position.
|
56
|
+
expect(@helper.head_position).to eql commits[1].sha
|
57
57
|
end
|
58
58
|
end
|
59
59
|
end
|
@@ -67,7 +67,7 @@ describe "while giving presentation" do
|
|
67
67
|
presenter.execute("back")
|
68
68
|
presenter.execute("back")
|
69
69
|
presenter.execute("back")
|
70
|
-
@helper.head_position.
|
70
|
+
expect(@helper.head_position).to eql commits[0].sha
|
71
71
|
end
|
72
72
|
end
|
73
73
|
end
|
@@ -78,7 +78,7 @@ describe "while giving presentation" do
|
|
78
78
|
presenter.execute("next")
|
79
79
|
presenter.execute("next")
|
80
80
|
presenter.execute("start")
|
81
|
-
@helper.head_position.
|
81
|
+
expect(@helper.head_position).to eql commits[0].sha
|
82
82
|
end
|
83
83
|
end
|
84
84
|
end
|
@@ -87,7 +87,7 @@ describe "while giving presentation" do
|
|
87
87
|
it "should move the last commit" do
|
88
88
|
@helper.start_presentation do |commits, presenter|
|
89
89
|
presenter.execute("end")
|
90
|
-
@helper.head_position.
|
90
|
+
expect(@helper.head_position).to eql commits.last.sha
|
91
91
|
end
|
92
92
|
end
|
93
93
|
end
|
@@ -96,7 +96,7 @@ describe "while giving presentation" do
|
|
96
96
|
it "should checkout the specific commit" do
|
97
97
|
@helper.start_presentation do |commits, presenter|
|
98
98
|
presenter.execute("2")
|
99
|
-
@helper.head_position.
|
99
|
+
expect(@helper.head_position).to eql commits[1].sha
|
100
100
|
end
|
101
101
|
end
|
102
102
|
end
|
@@ -106,7 +106,7 @@ describe "while giving presentation" do
|
|
106
106
|
@helper.start_presentation do |commits, presenter|
|
107
107
|
expected_output = (["*#{commits.first.sha[0..9]}, #{commits.first.message}"] + commits[1..-1].map{|commit| "#{commit.sha[0..9]}, #{commit.message}"}).join("\n")
|
108
108
|
presentation = presenter.execute("list")
|
109
|
-
presentation.
|
109
|
+
expect(presentation).to eql expected_output
|
110
110
|
end
|
111
111
|
end
|
112
112
|
end
|
@@ -127,7 +127,7 @@ help/h: display this message
|
|
127
127
|
exit: exit from the presentation
|
128
128
|
EOH
|
129
129
|
message = presenter.execute("help")
|
130
|
-
message.
|
130
|
+
expect(message).to eql help_text
|
131
131
|
end
|
132
132
|
end
|
133
133
|
end
|
@@ -138,7 +138,7 @@ EOH
|
|
138
138
|
@helper.start_presentation([:run => "echo hello world"]) do |commits, presenter|
|
139
139
|
presenter.execute("next")
|
140
140
|
presenter.execute("next")
|
141
|
-
presenter.execute("next").strip.
|
141
|
+
expect(presenter.execute("next").strip).to eql "hello world"
|
142
142
|
end
|
143
143
|
end
|
144
144
|
end
|
@@ -148,7 +148,7 @@ EOH
|
|
148
148
|
command_line_helper = CommandLineHelper.capture_output
|
149
149
|
@helper.start_presentation([:run => "echo hello world",:on_slide => 2]) do |commits, presenter|
|
150
150
|
presenter.execute("next")
|
151
|
-
presenter.execute("next").
|
151
|
+
expect(presenter.execute("next")).to eql "#{commits[2].message}\nhello world\n"
|
152
152
|
end
|
153
153
|
end
|
154
154
|
end
|
@@ -158,7 +158,7 @@ EOH
|
|
158
158
|
command_line_helper = CommandLineHelper.capture_output
|
159
159
|
@helper.start_presentation do |commits, presenter|
|
160
160
|
presenter.execute("!echo hello world")
|
161
|
-
command_line_helper.command_output.strip.
|
161
|
+
expect(command_line_helper.command_output.strip).to end_with "hello world"
|
162
162
|
end
|
163
163
|
end
|
164
164
|
end
|
@@ -167,7 +167,7 @@ EOH
|
|
167
167
|
it "should open the with launchy" do
|
168
168
|
command_line_helper = CommandLineHelper.capture_output
|
169
169
|
@helper.start_presentation([:launch => 'readme', :on_slide => 2]) do |commits, presenter|
|
170
|
-
Launchy.
|
170
|
+
expect(Launchy).to receive(:open).with('readme').once
|
171
171
|
presenter.execute("next")
|
172
172
|
presenter.execute("next")
|
173
173
|
end
|
@@ -179,8 +179,8 @@ EOH
|
|
179
179
|
@helper.start_presentation do |commits, presenter|
|
180
180
|
presenter.execute("next")
|
181
181
|
presenter.execute("exit")
|
182
|
-
@helper.current_branch.
|
183
|
-
@helper.current_branch.
|
182
|
+
expect(@helper.current_branch).not_to be_nil
|
183
|
+
expect(@helper.current_branch).to eql "master"
|
184
184
|
end
|
185
185
|
end
|
186
186
|
end
|
@@ -189,7 +189,7 @@ EOH
|
|
189
189
|
it "should set the current slide to commit" do
|
190
190
|
@helper.start_presentation([], 1) do |commits, presenter|
|
191
191
|
presenter.execute("list")
|
192
|
-
presenter.current_slide.commit.
|
192
|
+
expect(presenter.current_slide.commit).to eql commits[1].sha
|
193
193
|
end
|
194
194
|
end
|
195
195
|
end
|
@@ -13,32 +13,32 @@ describe "starting a presentation" do
|
|
13
13
|
Dir.chdir(presentation_dir) do
|
14
14
|
presenter = GitPresenter.new(".", false)
|
15
15
|
presentation = presenter.execute('start')
|
16
|
-
presentation.slides.length.
|
16
|
+
expect(presentation.slides.length).to eql 4
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
20
|
it "first commit should be first commit in file" do
|
21
21
|
@helper.start_presentation do |commits, presenter|
|
22
|
-
presenter.slides[0].commit.
|
22
|
+
expect(presenter.slides[0].commit).to eql commits[0].sha
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
26
|
it "second commit should be second commit in file" do
|
27
27
|
@helper.start_presentation do |commits, presenter|
|
28
|
-
presenter.slides[1].commit.
|
28
|
+
expect(presenter.slides[1].commit).to eql commits[1].sha
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
32
|
it "the last commit should be a command" do
|
33
33
|
command = "echo hello world"
|
34
34
|
@helper.start_presentation([:run => command]) do |commits, presenter|
|
35
|
-
presenter.slides[3].run.
|
35
|
+
expect(presenter.slides[3].run).to eql command
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
39
|
it "should have the presentation at first commit" do
|
40
40
|
@helper.start_presentation do |commits, presenter|
|
41
|
-
@helper.head_position.
|
41
|
+
expect(@helper.head_position).to eql commits.first.sha
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|
@@ -10,7 +10,7 @@ describe "update presentation with any new commits" do
|
|
10
10
|
commits = @helper.initialise_presentation({:delay => true})
|
11
11
|
new_commit = @helper.edit_file_and_commit("forth commit", "d")
|
12
12
|
@helper.update_presentation do |yaml|
|
13
|
-
yaml["slides"].length.
|
13
|
+
expect(yaml["slides"].length).to eql (commits.length + 1)
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
@@ -18,7 +18,7 @@ describe "update presentation with any new commits" do
|
|
18
18
|
commits = @helper.initialise_presentation({:delay => true})
|
19
19
|
new_commit = @helper.edit_file_and_commit("forth commit", "d")
|
20
20
|
@helper.update_presentation do |yaml|
|
21
|
-
yaml["slides"].last["slide"]["commit"].
|
21
|
+
expect(yaml["slides"].last["slide"]["commit"]).to eql new_commit.sha
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
@@ -27,7 +27,7 @@ describe "update presentation with any new commits" do
|
|
27
27
|
removed_commit = @helper.remove_from_presentation_at(1)
|
28
28
|
new_commit = @helper.edit_file_and_commit("forth commit", "d")
|
29
29
|
@helper.update_presentation do |yaml|
|
30
|
-
yaml["slides"].length.
|
30
|
+
expect(yaml["slides"].length).to eql (commits.length)
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
@@ -36,7 +36,7 @@ describe "update presentation with any new commits" do
|
|
36
36
|
removed_commit = @helper.remove_from_presentation_at(1)
|
37
37
|
new_commit = @helper.edit_file_and_commit("forth commit", "d")
|
38
38
|
@helper.update_presentation
|
39
|
-
@command_line.command_output.
|
39
|
+
expect(@command_line.command_output).to include "Your presentation has been updated"
|
40
40
|
end
|
41
41
|
|
42
42
|
end
|
@@ -22,16 +22,16 @@ describe GitPresenter::Presentation do
|
|
22
22
|
it "should display the current position" do
|
23
23
|
fake_shell.should_receive(:run).with("git rev-parse HEAD").and_return("0")
|
24
24
|
presenter = GitPresenter::Presentation.new(presentation, fake_shell)
|
25
|
-
presenter.status_line.
|
25
|
+
expect(presenter.status_line).to eql "1/3 >"
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
29
|
|
30
30
|
context "when calculating the position" do
|
31
31
|
it "should return the index of the current commit" do
|
32
|
-
fake_shell.
|
32
|
+
expect(fake_shell).to receive(:run).with("git rev-parse HEAD").and_return("0")
|
33
33
|
presenter = GitPresenter::Presentation.new(presentation, fake_shell)
|
34
|
-
presenter.position.
|
34
|
+
expect(presenter.position).to eql 0
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
@@ -42,59 +42,59 @@ describe GitPresenter::Presentation do
|
|
42
42
|
end
|
43
43
|
|
44
44
|
context "with bash command" do
|
45
|
-
it { given_command("!echo hello world").
|
45
|
+
it { expect(given_command("!echo hello world")).to eql :command }
|
46
46
|
end
|
47
47
|
|
48
48
|
context "with next" do
|
49
|
-
it { given_command("next").
|
49
|
+
it { expect(given_command("next")).to eql :next }
|
50
50
|
end
|
51
51
|
|
52
52
|
context "with next" do
|
53
|
-
it { given_command("n").
|
53
|
+
it { expect(given_command("n")).to eql :next }
|
54
54
|
end
|
55
55
|
|
56
56
|
context "with back" do
|
57
|
-
it { given_command("back").
|
57
|
+
it { expect(given_command("back")).to eql :previous }
|
58
58
|
end
|
59
59
|
|
60
60
|
context "with b" do
|
61
|
-
it { given_command("b").
|
61
|
+
it { expect(given_command("b")).to eql :previous }
|
62
62
|
end
|
63
63
|
|
64
64
|
context "with start" do
|
65
|
-
it { given_command("start").
|
65
|
+
it { expect(given_command("start")).to eql :start }
|
66
66
|
end
|
67
67
|
|
68
68
|
context "with s" do
|
69
|
-
it { given_command("s").
|
69
|
+
it { expect(given_command("s")).to eql :start }
|
70
70
|
end
|
71
71
|
|
72
72
|
context "with end" do
|
73
|
-
it { given_command("end").
|
73
|
+
it { expect(given_command("end")).to eql :end }
|
74
74
|
end
|
75
75
|
|
76
76
|
context "with e" do
|
77
|
-
it { given_command("e").
|
77
|
+
it { expect(given_command("e")).to eql :end }
|
78
78
|
end
|
79
79
|
|
80
80
|
context "with list" do
|
81
|
-
it { given_command("list").
|
81
|
+
it { expect(given_command("list")).to eql :list }
|
82
82
|
end
|
83
83
|
|
84
84
|
context "with l" do
|
85
|
-
it { given_command("l").
|
85
|
+
it { expect(given_command("l")).to eql :list }
|
86
86
|
end
|
87
87
|
|
88
88
|
context "with any number" do
|
89
|
-
it { given_command("6").
|
89
|
+
it { expect(given_command("6")).to eql :commit}
|
90
90
|
end
|
91
91
|
|
92
92
|
context "with h" do
|
93
|
-
it { given_command("h").
|
93
|
+
it { expect(given_command("h")).to eql :help}
|
94
94
|
end
|
95
95
|
|
96
96
|
context "with help" do
|
97
|
-
it { given_command("help").
|
97
|
+
it { expect(given_command("help")).to eql :help}
|
98
98
|
end
|
99
99
|
|
100
100
|
context "with exit" do
|
@@ -4,12 +4,12 @@ describe GitPresenter::Slide do
|
|
4
4
|
context "when displaying as string" do
|
5
5
|
it "should write out the commit id and the message" do
|
6
6
|
slide = GitPresenter::Slide.new({"commit" => "012345678901234567890","message" => "message"})
|
7
|
-
slide.to_s.
|
7
|
+
expect(slide.to_s).to eql "0123456789, message"
|
8
8
|
end
|
9
9
|
|
10
10
|
it "should not blow up if no command exists" do
|
11
11
|
slide = GitPresenter::Slide.new({"run" => "echo hello world"})
|
12
|
-
slide.to_s.
|
12
|
+
expect(slide.to_s).to eql "run: echo hello world"
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
@@ -18,7 +18,7 @@ describe GitPresenter::Slide do
|
|
18
18
|
it "should run that command" do
|
19
19
|
command_line_helper = CommandLineHelper.capture_output
|
20
20
|
slide = GitPresenter::Slide.new({"run" => "echo hello world"})
|
21
|
-
slide.execute.strip.
|
21
|
+
expect(slide.execute.strip).to eql "hello world"
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
@@ -27,24 +27,24 @@ describe GitPresenter::Slide do
|
|
27
27
|
command_line_helper = CommandLineHelper.capture_output
|
28
28
|
slide = GitPresenter::Slide.new({"commit" => "number", "message" => "checkout", "run" => "echo hello world"})
|
29
29
|
slide.stub(:checkout).and_return("checkout\n")
|
30
|
-
slide.execute.
|
30
|
+
expect(slide.execute).to eql "checkout\nhello world\n"
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
34
|
context "when slide contains a launch command" do
|
35
35
|
it "should launch the application for the file type" do
|
36
36
|
command_line_helper = CommandLineHelper.capture_output
|
37
|
-
Launchy.
|
37
|
+
expect(Launchy).to receive(:open).with("readme").once
|
38
38
|
slide = GitPresenter::Slide.new({"launch" => "readme"})
|
39
39
|
slide.execute
|
40
40
|
end
|
41
41
|
|
42
42
|
it "should not try and launch if no launch supplied" do
|
43
43
|
command_line_helper = CommandLineHelper.capture_output
|
44
|
-
Launchy.
|
44
|
+
expect(Launchy).to receive(:open).with("readme").never
|
45
45
|
slide = GitPresenter::Slide.new({"commit" => "number", "message" => "checkout", "run" => "echo hello world"})
|
46
46
|
slide.stub(:checkout).and_return("checkout\n")
|
47
|
-
slide.execute.
|
47
|
+
expect(slide.execute).to eql "checkout\nhello world\n"
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
@@ -53,7 +53,7 @@ describe GitPresenter::Slide do
|
|
53
53
|
command_line_helper = CommandLineHelper.capture_output
|
54
54
|
slide = GitPresenter::Slide.new({"commit" => "number", "message" => "checkout"})
|
55
55
|
slide.stub(:checkout).and_return("checkout\n")
|
56
|
-
slide.execute.
|
56
|
+
expect(slide.execute).to eql "checkout\n"
|
57
57
|
end
|
58
58
|
end
|
59
59
|
end
|
metadata
CHANGED
@@ -1,99 +1,99 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git_presenter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Colin Gemmell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-01
|
11
|
+
date: 2021-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: git
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 1.8.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 1.8.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: launchy
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 2.5.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 2.5.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: pry
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - '='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 0.14.1
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - '='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 0.14.1
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 3.10.0
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 3.10.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: bundler
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - '='
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 2.2.3
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - '='
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: 2.2.3
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: jeweler
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - '='
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: 2.3.5
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - '='
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: 2.3.5
|
97
97
|
description: Code presentation tool using git
|
98
98
|
email: pythonandchips@gmail.com
|
99
99
|
executables:
|