githat 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ ZTYwODFlZDU4ZjQ2YTU0MTBhYjI2ZTk1OTg1NjZhMGYxMTUzYmU0Ng==
5
+ data.tar.gz: !binary |-
6
+ ZDY2MmUxYjViOTFjMDdmNmJjNTFhNzg5MWI2NmE5NmRhMWFjOGNmOQ==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ MWExYjg3Mzc4YWE4NDdmMjU0N2Q3MjJjNjkzNDc2NjQ4ODkxNWQ5MGE2YTVh
10
+ YTU1OGZmMmVhOWEzNjVhNzc3NGM5YmQ0YTM1NmJiZmRhOGMyZDFkOGNmYjVl
11
+ NDI2NTRhODY5MzVmNmY4YTdhNWU2N2U0YzhjN2VjNGQ3ZTMwYzU=
12
+ data.tar.gz: !binary |-
13
+ ZjI0YmQyYTY3ZWUwOWFjNWI0MzQzMGFkNmIwMzM3YjJjZjdmYmVkN2IwN2Uy
14
+ OWNhOGZlNmE1MDk3NjM2M2NlZGQ4NGYyYTY5NDQ4MzExYTYyYjY2NDEwZDRj
15
+ MmM5OTMyMDIxMmIwODFhZjI3NTUzNjQ4MGYxMWY5ZWFmMDBmNjU=
@@ -0,0 +1,6 @@
1
+ language: ruby
2
+ branches:
3
+ only:
4
+ - master
5
+ rvm:
6
+ - 1.9.3
data/Gemfile CHANGED
@@ -1,9 +1,9 @@
1
1
  source "http://rubygems.org"
2
2
 
3
- gem "bundler", "~> 1.0"
4
- gem "jeweler", "~> 1.8.3"
5
- gem "pygments.rb", "~> 0.3.1"
3
+ gem "bundler"
4
+ gem "jeweler"
5
+ gem "pygments.rb"
6
6
 
7
7
  group :development do
8
- gem "rspec", "~> 2.11.0"
8
+ gem "rspec"
9
9
  end
@@ -1,36 +1,70 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- diff-lcs (1.1.3)
5
- git (1.2.5)
6
- jeweler (1.8.3)
7
- bundler (~> 1.0)
4
+ addressable (2.3.5)
5
+ builder (3.2.2)
6
+ descendants_tracker (0.0.3)
7
+ diff-lcs (1.2.5)
8
+ faraday (0.9.0)
9
+ multipart-post (>= 1.2, < 3)
10
+ git (1.2.6)
11
+ github_api (0.11.1)
12
+ addressable (~> 2.3)
13
+ descendants_tracker (~> 0.0.1)
14
+ faraday (~> 0.8, < 0.10)
15
+ hashie (>= 1.2)
16
+ multi_json (>= 1.7.5, < 2.0)
17
+ nokogiri (~> 1.6.0)
18
+ oauth2
19
+ hashie (2.0.5)
20
+ highline (1.6.20)
21
+ jeweler (2.0.0)
22
+ builder
23
+ bundler (>= 1.0)
8
24
  git (>= 1.2.5)
25
+ github_api
26
+ highline (>= 1.6.15)
27
+ nokogiri (>= 1.5.10)
9
28
  rake
10
29
  rdoc
11
- json (1.7.5)
12
- posix-spawn (0.3.6)
13
- pygments.rb (0.3.2)
30
+ json (1.8.1)
31
+ jwt (0.1.10)
32
+ multi_json (>= 1.5)
33
+ mini_portile (0.5.2)
34
+ multi_json (1.8.4)
35
+ multi_xml (0.5.5)
36
+ multipart-post (2.0.0)
37
+ nokogiri (1.6.1)
38
+ mini_portile (~> 0.5.0)
39
+ oauth2 (0.9.3)
40
+ faraday (>= 0.8, < 0.10)
41
+ jwt (~> 0.1.8)
42
+ multi_json (~> 1.3)
43
+ multi_xml (~> 0.5)
44
+ rack (~> 1.2)
45
+ posix-spawn (0.3.8)
46
+ pygments.rb (0.5.4)
14
47
  posix-spawn (~> 0.3.6)
15
48
  yajl-ruby (~> 1.1.0)
16
- rake (0.9.2.2)
17
- rdoc (3.12)
49
+ rack (1.5.2)
50
+ rake (10.1.1)
51
+ rdoc (4.1.1)
18
52
  json (~> 1.4)
19
- rspec (2.11.0)
20
- rspec-core (~> 2.11.0)
21
- rspec-expectations (~> 2.11.0)
22
- rspec-mocks (~> 2.11.0)
23
- rspec-core (2.11.1)
24
- rspec-expectations (2.11.3)
25
- diff-lcs (~> 1.1.3)
26
- rspec-mocks (2.11.2)
53
+ rspec (2.14.1)
54
+ rspec-core (~> 2.14.0)
55
+ rspec-expectations (~> 2.14.0)
56
+ rspec-mocks (~> 2.14.0)
57
+ rspec-core (2.14.7)
58
+ rspec-expectations (2.14.4)
59
+ diff-lcs (>= 1.1.3, < 2.0)
60
+ rspec-mocks (2.14.4)
27
61
  yajl-ruby (1.1.0)
28
62
 
29
63
  PLATFORMS
30
64
  ruby
31
65
 
32
66
  DEPENDENCIES
33
- bundler (~> 1.0)
34
- jeweler (~> 1.8.3)
35
- pygments.rb (~> 0.3.1)
36
- rspec (~> 2.11.0)
67
+ bundler
68
+ jeweler
69
+ pygments.rb
70
+ rspec
data/README.mkd CHANGED
@@ -1,4 +1,6 @@
1
- githat
1
+ # githat [![Build Status](https://secure.travis-ci.org/bernardofire/githat.png?branch=master)][travis]
2
+
3
+ [travis]: http://travis-ci.org/bernardofire/githat
2
4
  ======
3
5
 
4
6
  Git diff with code syntax highlight
@@ -36,3 +38,7 @@ Copyright
36
38
  Copyright (c) 2012 Bernardo B. Marques. See LICENSE.txt for
37
39
  further details.
38
40
 
41
+
42
+
43
+ [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/bernardofire/githat/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
44
+
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.2.0
@@ -2,14 +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: githat 0.2.0 ruby lib
5
6
 
6
7
  Gem::Specification.new do |s|
7
8
  s.name = "githat"
8
- s.version = "0.1.0"
9
+ s.version = "0.2.0"
9
10
 
10
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib"]
11
13
  s.authors = ["Bernardo B. Marques"]
12
- s.date = "2012-11-28"
14
+ s.date = "2014-01-17"
13
15
  s.description = "git diff with code syntax highlight"
14
16
  s.email = "bernardo.fire@gmail.com"
15
17
  s.executables = ["git-hat"]
@@ -20,6 +22,7 @@ Gem::Specification.new do |s|
20
22
  s.files = [
21
23
  ".document",
22
24
  ".rspec",
25
+ ".travis.yml",
23
26
  "Gemfile",
24
27
  "Gemfile.lock",
25
28
  "LICENSE.txt",
@@ -30,34 +33,34 @@ Gem::Specification.new do |s|
30
33
  "githat.gemspec",
31
34
  "githat.png",
32
35
  "lib/githat.rb",
36
+ "lib/pagination.rb",
33
37
  "spec/githat_spec.rb",
34
38
  "spec/spec_helper.rb"
35
39
  ]
36
40
  s.homepage = "http://github.com/bernardofire/githat"
37
41
  s.licenses = ["MIT"]
38
- s.require_paths = ["lib"]
39
- s.rubygems_version = "1.8.24"
42
+ s.rubygems_version = "2.2.1"
40
43
  s.summary = nil
41
44
 
42
45
  if s.respond_to? :specification_version then
43
- s.specification_version = 3
46
+ s.specification_version = 4
44
47
 
45
48
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
46
- s.add_runtime_dependency(%q<bundler>, ["~> 1.0"])
47
- s.add_runtime_dependency(%q<jeweler>, ["~> 1.8.3"])
48
- s.add_runtime_dependency(%q<pygments.rb>, ["~> 0.3.1"])
49
- s.add_development_dependency(%q<rspec>, ["~> 2.11.0"])
49
+ s.add_runtime_dependency(%q<bundler>, [">= 0"])
50
+ s.add_runtime_dependency(%q<jeweler>, [">= 0"])
51
+ s.add_runtime_dependency(%q<pygments.rb>, [">= 0"])
52
+ s.add_development_dependency(%q<rspec>, [">= 0"])
50
53
  else
51
- s.add_dependency(%q<bundler>, ["~> 1.0"])
52
- s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
53
- s.add_dependency(%q<pygments.rb>, ["~> 0.3.1"])
54
- s.add_dependency(%q<rspec>, ["~> 2.11.0"])
54
+ s.add_dependency(%q<bundler>, [">= 0"])
55
+ s.add_dependency(%q<jeweler>, [">= 0"])
56
+ s.add_dependency(%q<pygments.rb>, [">= 0"])
57
+ s.add_dependency(%q<rspec>, [">= 0"])
55
58
  end
56
59
  else
57
- s.add_dependency(%q<bundler>, ["~> 1.0"])
58
- s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
59
- s.add_dependency(%q<pygments.rb>, ["~> 0.3.1"])
60
- s.add_dependency(%q<rspec>, ["~> 2.11.0"])
60
+ s.add_dependency(%q<bundler>, [">= 0"])
61
+ s.add_dependency(%q<jeweler>, [">= 0"])
62
+ s.add_dependency(%q<pygments.rb>, [">= 0"])
63
+ s.add_dependency(%q<rspec>, [">= 0"])
61
64
  end
62
65
  end
63
66
 
@@ -1,4 +1,5 @@
1
1
  require 'pygments.rb'
2
+ require 'pagination'
2
3
 
3
4
  module Diff
4
5
  def main(argv=nil)
@@ -0,0 +1,32 @@
1
+ # code from http://nex-3.com/posts/73-git-style-automatic-paging-in-ruby
2
+
3
+ def paginate
4
+ # doesn't run under Windows
5
+ require 'rbconfig'
6
+ return if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/
7
+
8
+ return unless STDOUT.tty?
9
+
10
+ read, write = IO.pipe
11
+
12
+ unless Kernel.fork # child process
13
+ STDOUT.reopen(write)
14
+ STDERR.reopen(write) if STDERR.tty?
15
+ read.close
16
+ write.close
17
+ return
18
+ end
19
+
20
+ # parent process becomes pager
21
+ STDIN.reopen(read)
22
+ read.close
23
+ write.close
24
+
25
+ ENV['LESS'] = 'FSRX' # Don't page if the input is short enough
26
+
27
+ Kernel.select [STDIN] # Wait until we have input before we start the pager
28
+ pager = ENV['PAGER'] || 'less'
29
+ exec pager rescue exec '/bin/sh', '-c', pager
30
+ end
31
+
32
+ paginate
@@ -1,47 +1,46 @@
1
1
  require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
2
 
3
- describe "Githat" do
4
- before(:each) { extend Diff }
5
3
 
6
- describe Diff do
7
- describe "ensure some methods are mocked" do
8
- it "files_names" do
9
- files_names.should == ['.gitignore', 'lib/githat.rb']
10
- end
4
+ describe "Githat::Diff" do
5
+ before(:each) { extend Diff }
11
6
 
12
- it "file_diff" do
13
- file_diff('githat_spec.rb').should == _1_file_2_heads
14
- end
7
+ describe "ensure some methods are mocked" do
8
+ it "files_names" do
9
+ files_names.should == ['.gitignore', 'lib/githat.rb']
15
10
  end
16
11
 
17
- it "file_extension" do
18
- file_extension('Makefile').should == :makefile
19
- file_extension('.gitignore').should == :text
20
- file_extension('foo.rb').should == :rb
21
- file_extension('bar.js').should == :js
22
- file_extension('foobar').should == :text
23
- file_extension('Gemfile').should == :rb
24
- file_extension('Rakefile').should == :rb
12
+ it "file_diff" do
13
+ file_diff('githat_spec.rb').should == _1_file_2_heads
25
14
  end
15
+ end
26
16
 
27
- it "files_infos (with argv)" do
28
- gh_spec = files_infos(['spec/githat_spec.rb']).should == _1_file_2_heads_diff
29
- end
17
+ it "file_extension" do
18
+ file_extension('Makefile').should == :makefile
19
+ file_extension('.gitignore').should == :text
20
+ file_extension('foo.rb').should == :rb
21
+ file_extension('bar.js').should == :js
22
+ file_extension('foobar').should == :text
23
+ file_extension('Gemfile').should == :rb
24
+ file_extension('Rakefile').should == :rb
25
+ end
30
26
 
31
- it "files_names" do
32
- files_names.should == ['.gitignore', 'lib/githat.rb']
33
- end
27
+ it "files_infos (with argv)" do
28
+ files_infos(['spec/githat_spec.rb']).should == _1_file_2_heads_diff
29
+ end
34
30
 
35
- it "split_heads" do
36
- split_heads(_1_file_2_heads).should == _1_file_2_heads_splited[:heads]
37
- end
31
+ it "files_names" do
32
+ files_names.should == ['.gitignore', 'lib/githat.rb']
33
+ end
38
34
 
39
- it "split_codes" do
40
- split_codes(_1_file_2_heads).should == _1_file_2_heads_splited[:codes]
41
- end
35
+ it "split_heads" do
36
+ split_heads(_1_file_2_heads).should == _1_file_2_heads_splited[:heads]
37
+ end
42
38
 
43
- it "split_diff" do
44
- split_diff(_1_file_2_heads).should == _1_file_2_heads_splited
45
- end
39
+ it "split_codes" do
40
+ split_codes(_1_file_2_heads).should == _1_file_2_heads_splited[:codes]
41
+ end
42
+
43
+ it "split_diff" do
44
+ split_diff(_1_file_2_heads).should == _1_file_2_heads_splited
46
45
  end
47
46
  end
metadata CHANGED
@@ -1,80 +1,71 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: githat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
5
- prerelease:
4
+ version: 0.2.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Bernardo B. Marques
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-11-28 00:00:00.000000000 Z
11
+ date: 2014-01-17 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ~>
17
+ - - ! '>='
20
18
  - !ruby/object:Gem::Version
21
- version: '1.0'
19
+ version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ~>
24
+ - - ! '>='
28
25
  - !ruby/object:Gem::Version
29
- version: '1.0'
26
+ version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: jeweler
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ~>
31
+ - - ! '>='
36
32
  - !ruby/object:Gem::Version
37
- version: 1.8.3
33
+ version: '0'
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ~>
38
+ - - ! '>='
44
39
  - !ruby/object:Gem::Version
45
- version: 1.8.3
40
+ version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: pygments.rb
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ~>
45
+ - - ! '>='
52
46
  - !ruby/object:Gem::Version
53
- version: 0.3.1
47
+ version: '0'
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ~>
52
+ - - ! '>='
60
53
  - !ruby/object:Gem::Version
61
- version: 0.3.1
54
+ version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: rspec
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ~>
59
+ - - ! '>='
68
60
  - !ruby/object:Gem::Version
69
- version: 2.11.0
61
+ version: '0'
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ~>
66
+ - - ! '>='
76
67
  - !ruby/object:Gem::Version
77
- version: 2.11.0
68
+ version: '0'
78
69
  description: git diff with code syntax highlight
79
70
  email: bernardo.fire@gmail.com
80
71
  executables:
@@ -86,6 +77,7 @@ extra_rdoc_files:
86
77
  files:
87
78
  - .document
88
79
  - .rspec
80
+ - .travis.yml
89
81
  - Gemfile
90
82
  - Gemfile.lock
91
83
  - LICENSE.txt
@@ -96,34 +88,31 @@ files:
96
88
  - githat.gemspec
97
89
  - githat.png
98
90
  - lib/githat.rb
91
+ - lib/pagination.rb
99
92
  - spec/githat_spec.rb
100
93
  - spec/spec_helper.rb
101
94
  homepage: http://github.com/bernardofire/githat
102
95
  licenses:
103
96
  - MIT
97
+ metadata: {}
104
98
  post_install_message:
105
99
  rdoc_options: []
106
100
  require_paths:
107
101
  - lib
108
102
  required_ruby_version: !ruby/object:Gem::Requirement
109
- none: false
110
103
  requirements:
111
104
  - - ! '>='
112
105
  - !ruby/object:Gem::Version
113
106
  version: '0'
114
- segments:
115
- - 0
116
- hash: 2035371917580343289
117
107
  required_rubygems_version: !ruby/object:Gem::Requirement
118
- none: false
119
108
  requirements:
120
109
  - - ! '>='
121
110
  - !ruby/object:Gem::Version
122
111
  version: '0'
123
112
  requirements: []
124
113
  rubyforge_project:
125
- rubygems_version: 1.8.24
114
+ rubygems_version: 2.2.1
126
115
  signing_key:
127
- specification_version: 3
116
+ specification_version: 4
128
117
  summary: ''
129
118
  test_files: []