Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.3.0 #34

Merged
merged 30 commits into from
Sep 10, 2014
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
3014746
Remove 'grit' from gemspec and add 'rugged'
mmozuras Jul 13, 2014
b5df669
Move Rugged::Patch out of Diff namespace
mmozuras Jul 13, 2014
d04a0ef
Remove patches that are not needed with rugged '0.2.1'
mmozuras Jul 13, 2014
65ce672
Passing parents.first is no longer necessary for diff
mmozuras Jul 13, 2014
e013c9b
Add 'pry' as development dependency
mmozuras Jul 13, 2014
e329818
Use Rugged::Blame to find the commit line
mmozuras Jul 13, 2014
5a1d93d
Bump octokit from 2.7.0 to 3.2.0
mmozuras Jul 27, 2014
27895e6
Upgrade rspec to 3.0.0
mmozuras Jul 27, 2014
16e68af
To find commit location, use orig_ instead of final_start_line_number
mmozuras Jul 27, 2014
6b09caa
Use additional tracking options for more accurate blaming
mmozuras Jul 27, 2014
90f5bb7
Get rid of Rugged monkey patches, move them to Pronto::Git namespace
mmozuras Jul 29, 2014
064f42f
Extract Git::Patches, Git::Repository and Git::Remote
mmozuras Jul 30, 2014
27ed09e
Move #blame to Patch from Line
mmozuras Jul 30, 2014
6a7c001
Some specs for Git::Line
mmozuras Aug 3, 2014
ed3688b
Use Forwardable in Git::Line
mmozuras Aug 3, 2014
565345e
Some specs for Git::Patch
mmozuras Aug 3, 2014
befc3e7
Use Forwardable in Git::Patch
mmozuras Aug 3, 2014
62c3ea9
Replace usages of OpenStruct in specs to double()
mmozuras Aug 3, 2014
b5f80b6
More pessimistic dependencies of rugged and thor
mmozuras Aug 3, 2014
fbf8d76
Extract Pronto::Github to be used by multiple formatters
mmozuras Aug 3, 2014
8002773
More specs for Git::Patch
mmozuras Aug 3, 2014
0eabaa4
Extract comment related stuff to Pronto::Github
mmozuras Aug 3, 2014
e498de7
Add CHANGELOG.md
mmozuras Aug 10, 2014
d8064e9
Performance improvement - cache comments retrieved from GitHub
mmozuras Aug 10, 2014
d4cb558
Add '--exit-code' option for 'pronto run'
mmozuras Aug 10, 2014
b2575d7
Extract Git::Patches#find_line from Git::Line
mmozuras Aug 19, 2014
013c4c4
Return a path instead of string from Repository#path
mmozuras Aug 19, 2014
d10596b
Formatter for GitHub pull requests
mmozuras Aug 19, 2014
b74d51c
Fix: pass position when creating Comment from GitHub responses
mmozuras Aug 19, 2014
122c62a
Bump version to 0.3.0
mmozuras Aug 19, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
More specs for Git::Patch
  • Loading branch information
mmozuras committed Sep 10, 2014
commit 800277358634d138a36eb885ba4b59c03dacc4a4
4 changes: 2 additions & 2 deletions lib/pronto/git/patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ def blame(lineno)

def lines
@lines ||= begin
hunks.map do |hunk|
hunks.flat_map do |hunk|
hunk.lines.map { |line| Line.new(line, self, hunk) }
end.flatten.compact
end
end
end

Expand Down
18 changes: 18 additions & 0 deletions spec/pronto/git/patch_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,24 @@ module Git
let(:rugged_patch) { double(stat: [5, 17]) }
it { should == 17 }
end

describe '#lines' do
subject { patch.lines }

let(:hunks) { [double(lines: [1, 2]), double(lines: [3])] }
let(:rugged_patch) { double(hunks: hunks) }
its(:count) { should == 3 }
end

describe '#new_file_full_path' do
subject { patch.new_file_full_path }

let(:rugged_patch) do
double(delta: double(new_file: { path: 'test.md' }))
end
let(:repo) { double(path: '/house/of/cards/orig.md') }
its(:to_s) { should == '/house/of/cards/test.md' }
end
end
end
end