sanelint 0.1.1 → 1.0.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
  SHA1:
3
- metadata.gz: cc85ea74de47b387775f34e827e9c11d25eb5594
4
- data.tar.gz: 69b64a8ade3cef20fa47daf628edc332b62fd60f
3
+ metadata.gz: 9a3483b9aba844ac10705259db29d175f20a307e
4
+ data.tar.gz: c5a5146197ca7835117b1daa7803a2db6159c93b
5
5
  SHA512:
6
- metadata.gz: ffe36a81f8f2b13b89094776b2ee59377585ca3cbd8cc99cfabde9f2547f9f0b65547e9205785b3b8697d8200edfe377e79d2572a6b4fd9ba9cc40f4979f9da1
7
- data.tar.gz: e24d1b9cf27160fa63059b03450590afe60d1842c135aac5b6cf981969b62b79355c85817714c2ba3637a986ba0afcac0e12363a2e05f934a76caf0d337791d3
6
+ metadata.gz: af50341fc86fd10e16571053ed17b212aef4a35c60e357903bdc831120629bd227d7e7d2df77b0157acdbb78d6bba59efcd00b163d5fb53227f898556dd2817b
7
+ data.tar.gz: 791bc10ece4b1c774c0694eab835ad3974d94ab71a984b266f97ed0fc0261a14859cf1601762e6d181ba578c4483b63bf263c0fde5eaa64587afa5f467a52929
data/.gitignore CHANGED
@@ -1,17 +1,9 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- doc/
11
- lib/bundler/man
12
- pkg
13
- rdoc
14
- spec/reports
15
- test/tmp
16
- test/version_tmp
17
- tmp
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/README.md CHANGED
@@ -1,32 +1,58 @@
1
1
  # Sanelint
2
2
 
3
- Code lint utility with sane configuration
3
+ This gem encapsulate rubocop config for [Monterail](monterail.com).
4
4
 
5
5
  ## Installation
6
6
 
7
- ```bash
8
- gem install sanelint
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'sanelint'
9
11
  ```
10
12
 
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install sanelint
20
+
11
21
  ## Usage
12
22
 
13
- Go to project directory and nd then execute:
23
+ You need to tell RuboCop to load the Sanelint config. There are three ways to do this:
24
+
25
+ ### RuboCop configuration file
26
+
27
+ Put this into your `.rubocop.yml`:
28
+
29
+ ```yaml
30
+ require: rubocop-cask
31
+ ```
32
+
33
+ Now you can run `rubocop` and it will automatically load the RuboCop Cask cops together with the standard cops.
34
+
35
+ ### Command line
14
36
 
15
37
  ```bash
16
- sanelint
38
+ rubocop --require rubocop-cask
17
39
  ```
18
40
 
19
- ## About
41
+ ### Rake task
20
42
 
21
- sanelint make use of two well known projects:
43
+ ```ruby
44
+ RuboCop::RakeTask.new do |task|
45
+ task.requires << 'rubocop-cask'
46
+ end
47
+ ```
48
+
49
+ ## Development
22
50
 
23
- - [rails_best_practices](https://github.com/railsbp/rails_best_practices)
24
- - [brakeman](https://github.com/presidentbeef/brakeman)
51
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
52
+
53
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
25
54
 
26
55
  ## Contributing
27
56
 
28
- 1. Fork it ( http://github.com/monterail/sanelint/fork )
29
- 2. Create your feature branch (`git checkout -b my-new-feature`)
30
- 3. Commit your changes (`git commit -am 'Add some feature'`)
31
- 4. Push to the branch (`git push origin my-new-feature`)
32
- 5. Create new Pull Request
57
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/sanelint.
58
+
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "sanelint"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,82 @@
1
+ require: rubocop-rspec
2
+
3
+ AllCops:
4
+ DisplayCopNames: true
5
+ Exclude:
6
+ - 'config.ru'
7
+ - 'Rakefile'
8
+ - 'db/migrate/*'
9
+ - 'db/schema.rb'
10
+ - 'config/**/*'
11
+ - 'bin/*'
12
+ - 'script/*'
13
+ # Other common or autogenerated ignores
14
+ - 'lib/tasks/cucumber.rake'
15
+ # Project specific ignores goes here
16
+
17
+ Rails:
18
+ Enabled: true
19
+
20
+ Documentation:
21
+ Exclude:
22
+ - 'app/controllers/**/*.rb'
23
+ - 'app/helpers/**/*.rb'
24
+ - 'app/mailers/**/*.rb'
25
+
26
+
27
+ Style/BarePercentLiterals:
28
+ EnforcedStyle: percent_q
29
+
30
+ Style/EmptyLineBetweenDefs:
31
+ AllowAdjacentOneLineDefs: true
32
+
33
+ Style/MultilineOperationIndentation:
34
+ EnforcedStyle: indented
35
+
36
+ Style/StringLiterals:
37
+ EnforcedStyle: double_quotes
38
+
39
+ Style/StringLiteralsInInterpolation:
40
+ EnforcedStyle: double_quotes
41
+
42
+ Style/BracesAroundHashParameters:
43
+ EnforcedStyle: context_dependent
44
+
45
+ Style/TrailingCommaInArguments:
46
+ EnforcedStyleForMultiline: comma
47
+
48
+ Style/TrailingCommaInLiteral:
49
+ EnforcedStyleForMultiline: comma
50
+
51
+ Style/DoubleNegation:
52
+ Enabled: false
53
+
54
+ Style/SingleLineBlockParams:
55
+ Enabled: false
56
+
57
+ Style/ParallelAssignment:
58
+ Enabled: false
59
+
60
+ Style/Lambda:
61
+ Enabled: false
62
+
63
+
64
+ Metrics/LineLength:
65
+ Max: 100
66
+
67
+ Metrics/ClassLength:
68
+ Max: 150
69
+
70
+ Metrics/ModuleLength:
71
+ Max: 150
72
+
73
+
74
+ Lint/EndAlignment:
75
+ AlignWith: variable
76
+
77
+ Lint/AssignmentInCondition:
78
+ Enabled: false
79
+
80
+ Lint/AmbiguousRegexpLiteral:
81
+ Exclude:
82
+ - 'features/step_definitions/**/*.rb'
@@ -0,0 +1,23 @@
1
+ module RuboCop
2
+ module Sanelint
3
+ # After
4
+ # https://github.com/nevir/rubocop-rspec/blob/v1.4.1/lib/rubocop/rspec/inject.rb
5
+ # https://github.com/caskroom/rubocop-cask/blob/v0.6.1/lib/rubocop/cask/inject.rb
6
+ # Because RuboCop doesn't yet support plugins, we have to monkey patch in a
7
+ # bit of our configuration.
8
+ module Inject
9
+ DEFAULT_FILE = File.expand_path(
10
+ '../../../../config/default.yml', __FILE__
11
+ )
12
+
13
+ def self.defaults!
14
+ hash = ConfigLoader.send(:load_yaml_configuration, DEFAULT_FILE)
15
+ config = Config.new(hash, DEFAULT_FILE)
16
+ puts "configuration from #{DEFAULT_FILE}" if ConfigLoader.debug?
17
+ config = ConfigLoader.merge_with_default(config, DEFAULT_FILE)
18
+
19
+ ConfigLoader.instance_variable_set(:@default_configuration, config)
20
+ end
21
+ end
22
+ end
23
+ end
@@ -1,3 +1,3 @@
1
1
  module Sanelint
2
- VERSION = "0.1.1"
2
+ VERSION = "1.0.0"
3
3
  end
data/lib/sanelint.rb CHANGED
@@ -1,183 +1,6 @@
1
1
  require "sanelint/version"
2
2
 
3
- require "tempfile"
4
- module Sanelint
5
- class Linter < Struct.new(:root)
6
- def call
7
- raise "Not Implemented"
8
- end
3
+ require "rubocop"
4
+ require "rubocop/sanelint/inject"
9
5
 
10
- def lint
11
- call
12
- end
13
-
14
- def output
15
- @output ||= JSON.parse(File.read(output_file))
16
- end
17
-
18
- def output_file
19
- @output_file ||= Tempfile.new(["sanelint", ".json"]).path
20
- end
21
- end
22
-
23
- class Entry < Struct.new(:level, :file, :line, :message, :code, :link,
24
- :git_commit, :git_username, :git_date)
25
-
26
- def initialize(attrs = {})
27
- super()
28
-
29
- attrs.each {|k,v| send("#{k}=", v) }
30
- end
31
- end
32
- end
33
-
34
-
35
- require "brakeman"
36
- module Sanelint
37
- class Brakeman < Linter
38
- def call
39
- ::Brakeman.run(options)
40
-
41
- ["warnings", "errors"].inject([]) do |list, type|
42
- entries = output[type].map do |e|
43
- Entry.new(
44
- :level => type,
45
- :file => e["file"],
46
- :line => e["line"],
47
- :message => e["message"],
48
- :code => e["code"],
49
- :link => e["link"]
50
- )
51
- end
52
-
53
- list + entries
54
- end
55
- end
56
-
57
-
58
- def options
59
- {
60
- :app_path => root,
61
- :print_report => true,
62
- :interprocedural => true,
63
- :summary_only => true,
64
- :output_files => [output_file]
65
- }
66
- end
67
- end
68
- end
69
-
70
-
71
- require "rails_best_practices"
72
- module Sanelint
73
- class RailsBestPractices < Linter
74
- def call
75
- analyzer = ::RailsBestPractices::Analyzer.new(root, options)
76
- analyzer.analyze
77
- analyzer.output
78
-
79
- output.map {|e| Entry.new(e) }
80
- end
81
-
82
- def options
83
- {
84
- "with-git" => true,
85
- "format" => "html",
86
- "template" => results_template_path,
87
- "output-file" => output_file
88
- }
89
- end
90
-
91
- def results_template_path
92
- File.expand_path("../sanelint/rails_best_practices/results.html.erb", __FILE__)
93
- end
94
- end
95
- end
96
-
97
-
98
-
99
- module Sanelint
100
- class Runner < Struct.new(:root)
101
- LINTERS = [
102
- Sanelint::RailsBestPractices,
103
- Sanelint::Brakeman
104
- ]
105
-
106
- def call
107
- run_linters
108
- fill_missing_info
109
- print_report
110
- save_report
111
- end
112
-
113
- def run_linters
114
- @entries = LINTERS.inject([]) do |entries, linter_klazz|
115
- linter = linter_klazz.new(root)
116
- entries + linter.lint
117
- end
118
- end
119
-
120
- def fill_missing_info
121
- @entries.each do |entry|
122
- if info = blame(entry.file, entry.line)
123
- entry.git_commit = info[:commit]
124
- entry.git_date = info[:date]
125
- entry.git_username = info[:user]
126
- entry.code = info[:code]
127
- end
128
- end
129
- end
130
-
131
- def blame(file, line)
132
- line = line.to_s.split(',').first
133
-
134
- # taken from rails_best_practices
135
- info = `cd #{root} && git blame -L #{line},+1 #{file}`
136
- if m = info.strip.match(/^\^?([0-9a-f]+)\s\((.+)\s+(\d{4}-\d{2}-\d{2}).+?\)(.+)$/)
137
- {
138
- :commit => m[1],
139
- :user => m[2],
140
- :date => m[3],
141
- :code => m[4]
142
- }
143
- else
144
- nil
145
- end
146
- end
147
-
148
- def git_repo
149
- @git_repo ||= `git remote -v`[/github\.com(?:\/|:)(.+\/.+).git/, 1]
150
- end
151
-
152
- def print_report
153
- long_file = @entries.map {|e| e.file.size + e.line.to_s.size }.max
154
-
155
- puts
156
- @entries.each do |entry|
157
- puts "%-8s %-15s %-#{long_file+2}s %-40s" % [
158
- entry.git_commit,
159
- entry.git_username,
160
- "#{entry.file}:#{entry.line}",
161
- entry.message
162
- ]
163
- end
164
- puts
165
- end
166
-
167
- def save_report
168
- renderer = ERB.new(report_template)
169
- report = renderer.result(binding)
170
- File.open(File.join(root, "sanelint.html"), "w") {|f| f.write report }
171
- puts "Report saved to sanelint.html"
172
- end
173
-
174
- def report_template
175
- File.read(File.expand_path("../sanelint/report.html.erb", __FILE__))
176
- end
177
- end
178
-
179
- def self.run!
180
- runner = Runner.new(Dir.pwd)
181
- runner.call
182
- end
183
- end
6
+ RuboCop::Sanelint::Inject.defaults!
data/sanelint.gemspec CHANGED
@@ -6,21 +6,21 @@ require 'sanelint/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "sanelint"
8
8
  spec.version = Sanelint::VERSION
9
- spec.authors = ["Tymon Tobolski"]
10
- spec.email = ["tymon.tobolski@monterail.com"]
11
- spec.summary = %q{Sane Ruby/Rails linter.}
12
- spec.description = %q{Ruby/Rails linter. Sane stuff only}
13
- spec.homepage = ""
14
- spec.license = "MIT"
9
+ spec.authors = ["Michał Simka"]
10
+ spec.email = ["michal.simka@monterail.com"]
15
11
 
16
- spec.files = `git ls-files -z`.split("\x0")
17
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
12
+ spec.summary = %q{Gem to encapsulate Monterail's company-wide rubocop setup.}
13
+ spec.description = %q{Gem to encapsulate Monterail's company-wide rubocop setup.}
14
+ spec.homepage = "https://github.com/monterail/sanelint"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
+ spec.bindir = "exe"
18
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency "rails_best_practices"
22
- spec.add_dependency "brakeman"
21
+ spec.add_runtime_dependency "rubocop", "~> 0.40.0"
22
+ spec.add_runtime_dependency "rubocop-rspec", "~> 1.5.0"
23
23
 
24
- spec.add_development_dependency "bundler", "~> 1.5"
25
- spec.add_development_dependency "rake"
24
+ spec.add_development_dependency "bundler", "~> 1.10"
25
+ spec.add_development_dependency "rake", "~> 10.0"
26
26
  end
metadata CHANGED
@@ -1,93 +1,91 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sanelint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
- - Tymon Tobolski
7
+ - Michał Simka
8
8
  autorequire:
9
- bindir: bin
9
+ bindir: exe
10
10
  cert_chain: []
11
- date: 2014-05-18 00:00:00.000000000 Z
11
+ date: 2016-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rails_best_practices
14
+ name: rubocop
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 0.40.0
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: '0'
26
+ version: 0.40.0
27
27
  - !ruby/object:Gem::Dependency
28
- name: brakeman
28
+ name: rubocop-rspec
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: 1.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: '0'
40
+ version: 1.5.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.5'
47
+ version: '1.10'
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: '1.5'
54
+ version: '1.10'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '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: '0'
69
- description: Ruby/Rails linter. Sane stuff only
68
+ version: '10.0'
69
+ description: Gem to encapsulate Monterail's company-wide rubocop setup.
70
70
  email:
71
- - tymon.tobolski@monterail.com
72
- executables:
73
- - sanelint
71
+ - michal.simka@monterail.com
72
+ executables: []
74
73
  extensions: []
75
74
  extra_rdoc_files: []
76
75
  files:
77
- - .gitignore
76
+ - ".gitignore"
78
77
  - Gemfile
79
- - LICENSE.txt
80
78
  - README.md
81
79
  - Rakefile
82
- - bin/sanelint
80
+ - bin/console
81
+ - bin/setup
82
+ - config/default.yml
83
+ - lib/rubocop/sanelint/inject.rb
83
84
  - lib/sanelint.rb
84
- - lib/sanelint/rails_best_practices/results.html.erb
85
- - lib/sanelint/report.html.erb
86
85
  - lib/sanelint/version.rb
87
86
  - sanelint.gemspec
88
- homepage: ''
89
- licenses:
90
- - MIT
87
+ homepage: https://github.com/monterail/sanelint
88
+ licenses: []
91
89
  metadata: {}
92
90
  post_install_message:
93
91
  rdoc_options: []
@@ -95,18 +93,18 @@ require_paths:
95
93
  - lib
96
94
  required_ruby_version: !ruby/object:Gem::Requirement
97
95
  requirements:
98
- - - '>='
96
+ - - ">="
99
97
  - !ruby/object:Gem::Version
100
98
  version: '0'
101
99
  required_rubygems_version: !ruby/object:Gem::Requirement
102
100
  requirements:
103
- - - '>='
101
+ - - ">="
104
102
  - !ruby/object:Gem::Version
105
103
  version: '0'
106
104
  requirements: []
107
105
  rubyforge_project:
108
- rubygems_version: 2.1.11
106
+ rubygems_version: 2.4.5
109
107
  signing_key:
110
108
  specification_version: 4
111
- summary: Sane Ruby/Rails linter.
109
+ summary: Gem to encapsulate Monterail's company-wide rubocop setup.
112
110
  test_files: []
data/LICENSE.txt DELETED
@@ -1,22 +0,0 @@
1
- Copyright (c) 2014 Tymon Tobolski
2
-
3
- MIT License
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/bin/sanelint DELETED
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
4
- require "sanelint"
5
- Sanelint.run!
@@ -1,13 +0,0 @@
1
- <%=
2
- @errors.map do |error|
3
- {
4
- :level => "warning",
5
- :file => error.short_filename,
6
- :line => error.line_number,
7
- :message => error.message,
8
- :link => error.url,
9
- :git_commit => error.git_commit,
10
- :git_username => error.git_username
11
- }
12
- end.to_json
13
- %>
@@ -1,95 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8">
5
- <title><%= File.basename(root) %> Sanelint Report</title>
6
-
7
- <link href='http://fonts.googleapis.com/css?family=Inconsolata' rel='stylesheet' type='text/css'>
8
-
9
- <style>
10
- /* Eric Meyer's Reset CSS v2.0 - http://cssreset.com */
11
- html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{border:0;font-size:100%;font:inherit;vertical-align:baseline;margin:0;padding:0}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:none}table{border-collapse:collapse;border-spacing:0}
12
-
13
- body {
14
- font-size: 14px;
15
- font-family: 'Inconsolata', monospace;
16
-
17
- width:1200px;
18
- margin: 20px auto;
19
- }
20
-
21
- table {
22
- border-collapse: collapse;
23
- border: 0px;
24
- }
25
-
26
- tr:nth-child(even) {background: #e4e4e4}
27
- tr:nth-child(odd) {background: #f4f4f4}
28
-
29
- td {
30
- padding: 15px 10px;
31
- }
32
- tr.small > td {
33
- color: #333;
34
- padding: 15px 10px;
35
- padding-bottom: 0px;
36
- }
37
- td.narrow {
38
- width:20px;
39
- }
40
- td.wide {
41
- max-width:570px;
42
- }
43
-
44
- a {
45
- text-decoration: none;
46
- color: #f56200;
47
- }
48
- .code {
49
- padding: 5px;
50
- border-radius: 3px;
51
- background-color: #556;
52
- color: #ddd;
53
- line-height: 1.5em;
54
- }
55
-
56
- </style>
57
-
58
- </head>
59
- <body>
60
- <div class="container">
61
-
62
- <table>
63
-
64
- <% @entries.each_with_index do |entry, index| %>
65
-
66
- <tr class="small">
67
- <td class="narrow">
68
- <%= index + 1 %>
69
- </td>
70
-
71
- <td class="wide">
72
- <%= entry.git_date %>, <%= entry.git_username %>
73
- <br />
74
- <% if entry.link %>
75
- <a href="<%= entry.link %>"><%= entry.message %></a>
76
- <% else %>
77
- <%= entry.message %>
78
- <% end %>
79
- </td>
80
-
81
- <td class="wide">
82
- <%= entry.file %>:<%= entry.line %> →
83
- <a href="http://github.com/<%= git_repo %>/commit/<%= entry.git_commit %>"><%= entry.git_commit %></a>
84
- <br />
85
- <div class="code"><%= entry.line %>: <%= entry.code %></div>
86
- </td>
87
- </tr>
88
-
89
- <% end %>
90
-
91
- </table>
92
- </div>
93
-
94
- </body>
95
- </html>