githat 0.0.8 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.mkd CHANGED
@@ -7,6 +7,17 @@ Example with ruby code:
7
7
 
8
8
  ![githat](https://raw.github.com/bernardofire/githat/master/githat.png)
9
9
 
10
+ Install
11
+ -------
12
+ `$ [sudo] gem install githat`
13
+
14
+ Use
15
+ ---
16
+ `$ git hat`
17
+
18
+ you can choose the files:
19
+
20
+ `$ git hat foo.rb bar.py`
10
21
 
11
22
  Contributing to githat
12
23
  ----------------------
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.8
1
+ 0.1.0
data/githat.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "githat"
8
- s.version = "0.0.8"
8
+ s.version = "0.1.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Bernardo B. Marques"]
12
- s.date = "2012-10-24"
12
+ s.date = "2012-11-28"
13
13
  s.description = "git diff with code syntax highlight"
14
14
  s.email = "bernardo.fire@gmail.com"
15
15
  s.executables = ["git-hat"]
data/lib/githat.rb CHANGED
@@ -4,7 +4,7 @@ module Diff
4
4
  def main(argv=nil)
5
5
  output = ''
6
6
  infos = files_infos(argv)
7
- infos.each do |file|
7
+ infos.map do |file|
8
8
  output << parse_diff(file)
9
9
  end
10
10
  output
@@ -25,11 +25,11 @@ module Diff
25
25
  heads, codes = splited[:heads], splited[:codes]
26
26
  complete_file_diff = ''
27
27
 
28
- (0...heads.size).each do |i|
28
+ (0...heads.size).map do |i|
29
29
  parsed_head = parse_with_diff(heads[i])
30
30
  parsed_code = parse_with_lang(codes[i], extension)
31
31
  parsed_code = parse_with_diff(parsed_code)
32
- complete_file_diff << (parsed_head + parsed_code + "\n")
32
+ complete_file_diff << (parsed_head << parsed_code << "\n")
33
33
  end
34
34
 
35
35
  complete_file_diff
data/spec/githat_spec.rb CHANGED
@@ -20,6 +20,8 @@ describe "Githat" do
20
20
  file_extension('foo.rb').should == :rb
21
21
  file_extension('bar.js').should == :js
22
22
  file_extension('foobar').should == :text
23
+ file_extension('Gemfile').should == :rb
24
+ file_extension('Rakefile').should == :rb
23
25
  end
24
26
 
25
27
  it "files_infos (with argv)" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: githat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-24 00:00:00.000000000 Z
12
+ date: 2012-11-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -113,7 +113,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
113
113
  version: '0'
114
114
  segments:
115
115
  - 0
116
- hash: 4000078314473639876
116
+ hash: 2035371917580343289
117
117
  required_rubygems_version: !ruby/object:Gem::Requirement
118
118
  none: false
119
119
  requirements: