Skip to content

Commit 94312ee

Browse files
Satisfy Rubocop
1 parent 004bf68 commit 94312ee

File tree

7 files changed

+36
-12
lines changed

7 files changed

+36
-12
lines changed

.rubocop.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
inherit_from: .rubocop_todo.yml
2+
3+
AllCops:
4+
Exclude:
5+
- '*.gemspec'
6+
- 'spec/*_helper.rb'
7+
- 'Gemfile'
8+
- 'Rakefile'
9+
- 'Vagrantfile'
10+
11+
Documentation:
12+
Enabled: false

.rubocop_todo.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# This configuration was generated by
2+
# `rubocop --auto-gen-config`
3+
# on 2015-09-19 12:37:55 -0500 using RuboCop version 0.34.1.
4+
# The point is for the user to remove these configuration records
5+
# one by one as the offenses are removed from the code base.
6+
# Note that changes in the inspected code, or installation of new
7+
# versions of RuboCop, may require this file to be generated again.
8+
9+
# Offense count: 2
10+
# Configuration parameters: AllowURI, URISchemes.
11+
Metrics/LineLength:
12+
Max: 91

lib/critical_path_css/rails/engine.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ module Rails
33
class Engine < ::Rails::Engine
44
end
55
end
6-
end
6+
end

lib/critical_path_css/rails/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ module Rails
33
VERSION = '0.1.0'
44
PENTHOUSE_VERSION = '0.3.4'
55
end
6-
end
6+
end

lib/critical-path-css-rails.rb renamed to lib/critical_path_css_rails.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ module CriticalPathCss
44
CACHE_NAMESPACE = 'critical-path-css'
55
PENTHOUSE_PATH = "#{File.dirname(__FILE__)}/penthouse/penthouse.js"
66

7-
def self.generate (main_css_path, base_url, routes)
8-
full_main_css_path = "#{Rails.root.to_s}/public#{main_css_path}"
7+
def self.generate(main_css_path, base_url, routes)
8+
full_main_css_path = "#{Rails.root}/public#{main_css_path}"
99

1010
routes.each do |route|
1111
css = Phantomjs.run(PENTHOUSE_PATH, base_url + route, full_main_css_path)
1212
Rails.cache.write(route, css, namespace: CACHE_NAMESPACE)
1313
end
1414
end
1515

16-
def self.fetch (route)
16+
def self.fetch(route)
1717
Rails.cache.read(route, namespace: CACHE_NAMESPACE) || ''
1818
end
19-
end
19+
end

lib/generators/critical_path_css/install_generator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ def copy_rake_task
1010
copy_file "../../tasks/#{task_filename}", "lib/tasks/#{task_filename}"
1111
end
1212
end
13-
end
13+
end

lib/tasks/critical_path_css.rake

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
require 'critical-path-css-rails'
1+
require 'critical_path_css_rails'
22

33
namespace :critical_path_css do
44
@base_url = Rails.env.production? ? 'http://example.com' : 'http://localhost:3000'
5-
@routes = %w{
5+
@routes = %w(
66
/
7-
}
7+
)
88

9-
desc "Generate critical CSS for the routes defined"
10-
task :generate => :environment do
9+
desc 'Generate critical CSS for the routes defined'
10+
task generate: :environment do
1111
@main_css_path = ActionController::Base.helpers.stylesheet_path('application.css').to_s
1212

1313
CriticalPathCss.generate(@main_css_path, @base_url, @routes)

0 commit comments

Comments
 (0)