Skip to content

Commit caad419

Browse files
committed
Reworded clients page and changed nav links and rubocop
also devdata
1 parent e4b73f1 commit caad419

16 files changed

+207
-162
lines changed

.rubocop.yml

+43-14
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,58 @@
11
AllCops:
22
RunRailsCops: true
33
Exclude:
4-
- 'lib/tasks/cucumber.rake'
5-
- 'config/unicorn.rb'
6-
- 'db/**/*'
74
- 'Guardfile'
5+
- 'bin/**/*'
6+
- 'db/**/*'
87
- 'vendor/bundle/**/*'
98

10-
# Configuration parameters: EnforcedStyle, SupportedStyles.
11-
Style/StringLiterals:
12-
Enabled: false
13-
14-
# Offense count: 45
15-
# Configuration parameters: AllowURI.
169
Metrics/LineLength:
17-
Max: 112
10+
Max: 120
11+
12+
Metrics/MethodLength:
13+
Max: 10
14+
15+
Metrics/AbcSize:
16+
Max: 14
1817

19-
# We don't use this often but sometimes it improves readability
20-
# Configuration parameters: EnforcedStyle, SupportedStyles.
21-
Style/BracesAroundHashParameters:
18+
Metrics/ClassLength:
19+
Max: 100
20+
21+
Rails/Output:
22+
Enabled: false
23+
24+
Style/BlockDelimiters:
2225
Enabled: false
2326

2427
Style/Documentation:
2528
Enabled: false
2629

27-
# Configuration parameters: EnforcedStyle, SupportedStyles.
2830
Style/IndentHash:
2931
Enabled: false
32+
33+
Style/NumericLiterals:
34+
Enabled: false
35+
36+
Style/MultilineOperationIndentation:
37+
EnforcedStyle: indented
38+
39+
Style/SignalException:
40+
Enabled: false
41+
42+
Style/SingleSpaceBeforeFirstArg:
43+
Enabled: false
44+
45+
Style/StringLiterals:
46+
Enabled: false
47+
48+
# Style/StringLiterals:
49+
# EnforcedStyle: double_quotes
50+
51+
Style/SingleLineBlockParams:
52+
Enabled: false
53+
54+
Style/AlignParameters:
55+
Enabled: false
56+
57+
Style/FirstParameterIndentation:
58+
Enabled: false

Gemfile.lock

+9-9
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ GEM
4040
tzinfo (~> 1.1)
4141
addressable (2.3.6)
4242
arel (6.0.0)
43-
ast (2.0.0)
44-
astrolabe (1.3.0)
45-
parser (>= 2.2.0.pre.3, < 3.0)
43+
ast (2.1.0)
44+
astrolabe (1.3.1)
45+
parser (~> 2.2)
4646
aws-sdk (1.60.2)
4747
aws-sdk-v1 (= 1.60.2)
4848
aws-sdk-v1 (1.60.2)
@@ -206,10 +206,10 @@ GEM
206206
cocaine (~> 0.5.5)
207207
mime-types
208208
mimemagic (= 0.3.0)
209-
parser (2.2.0.2)
209+
parser (2.2.2.6)
210210
ast (>= 1.1, < 3.0)
211211
pg (0.17.1)
212-
powerpack (0.0.9)
212+
powerpack (0.1.1)
213213
pry (0.10.1)
214214
coderay (~> 1.1.0)
215215
method_source (~> 0.8.1)
@@ -287,16 +287,16 @@ GEM
287287
rspec-mocks (~> 3.1.0)
288288
rspec-support (~> 3.1.0)
289289
rspec-support (3.1.2)
290-
rubocop (0.28.0)
290+
rubocop (0.33.0)
291291
astrolabe (~> 1.3)
292-
parser (>= 2.2.0.pre.7, < 3.0)
293-
powerpack (~> 0.0.6)
292+
parser (>= 2.2.2.5, < 3.0)
293+
powerpack (~> 0.1)
294294
rainbow (>= 1.99.1, < 3.0)
295295
ruby-progressbar (~> 1.4)
296296
ruby-freshbooks (0.4.1)
297297
builder (>= 2.1.2)
298298
httparty (>= 0.5.0)
299-
ruby-progressbar (1.7.1)
299+
ruby-progressbar (1.7.5)
300300
ruby2ruby (2.1.3)
301301
ruby_parser (~> 3.1)
302302
sexp_processor (~> 4.0)

app/controllers/contracts_controller.rb

+3-5
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@ class ContractsController < ApplicationController
22
before_action :hide_nav
33

44
def view
5-
client = OpenStruct.new({
6-
name: 'vRide Inc.',
7-
full_address: 'vRide, Inc., 568 Broadway, Ste 603a, New York, NY. 10012',
8-
accepted_date: '10/20/2014'
9-
})
5+
client = OpenStruct.new(name: 'vRide Inc.',
6+
full_address: 'vRide, Inc., 568 Broadway, Ste 603a, New York, NY. 10012',
7+
accepted_date: '10/20/2014')
108
@content = render_to_string partial: 'msa', locals: { client: client }
119
end
1210
end

app/models/blog_entry.rb

+6-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ class BlogEntry < ActiveRecord::Base
33
medium: '300x300>'
44
}
55

6-
validates_attachment_content_type :blog_image, content_type: /\Aimage\/.*\Z/
6+
validates_attachment_content_type :blog_image, content_type: %r{\Aimage/.*\Z}
77

88
def self.update_blog(blog_rss_url = ENV['BLOG_RSS_URL'])
99
blog = Feedjira::Feed.fetch_and_parse(blog_rss_url)
@@ -15,15 +15,17 @@ def self.create_or_update_entries(entries)
1515
end
1616

1717
def self.create_or_update_entry(entry)
18-
blog_entry = where(guid: entry.id).first_or_initialize
19-
blog_entry.assign_attributes(
18+
find_entry(entry).update!(
2019
name: entry.title,
2120
summary: entry.summary,
2221
url: entry.url,
2322
published_at: entry.published,
2423
blog_image: entry.image || extract_image(entry.content)
2524
)
26-
blog_entry.save!
25+
end
26+
27+
def self.find_entry(entry)
28+
where(guid: entry.id).first_or_initialize
2729
end
2830

2931
def self.extract_image(content)

app/views/application/_navbar.html.erb

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
<div class="right-nav">
88
<ul class="js-nav-menu navigation-menu">
99
<li><%= link_to "Services", root_path(anchor: "services") %></li>
10-
<li><%= link_to "Clients", root_path(anchor: "clients") %></li>
10+
<li><%= link_to "Clients", clients_path %></li>
1111
<li><%= link_to "Team", root_path(anchor: "team") %></li>
1212
<li><%= link_to "Contact", root_path(anchor: "contact") %></li>
13-
<li><%= link_to "Blog", root_path(anchor: "recent-articles") %></li>
13+
<li><%= link_to "Blog", "http://wizard.codes/", target: '_blank' %></li>
1414
</ul>
1515
</div>
1616
</div>

app/views/home/clients.html.erb

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<article class="casestudies-container">
22
<h2>Featured Clients</h2>
3-
<p class="tagline">We work with small businesses owners to solve the challenges within their industries. Our websites are custom built using the latest technology, automated testing, and modern design.
4-
<%= render 'winnower' %>
5-
<%= render 'bakecycle' %>
6-
<%= render 'one_month' %>
3+
<p class="tagline">
4+
We work with various sized organizations, from YC backed startups to large established firms. We help them tackle the difficult problems to grow their apps into what they should to be.
5+
</p>
6+
<%= render "winnower" %>
7+
<%= render "bakecycle" %>
8+
<%= render "one_month" %>
79
</article>

config.ru

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# This file is used by Rack-based servers to start the application.
22

3-
require ::File.expand_path('../config/environment', __FILE__)
3+
require ::File.expand_path('../config/environment', __FILE__)
44
run Rails.application

config/initializers/session_store.rb

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
# Be sure to restart your server when you modify this file.
22

3-
WizardDevelopment::Application.config.session_store :cookie_store, {
4-
key: '_wizarddevelopment_com_session'
5-
}
3+
WizardDevelopment::Application.config.session_store :cookie_store, key: '_wizarddevelopment_com_session'

config/unicorn.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
timeout((ENV['WEB_TIMEOUT'] || 5).to_i)
44
preload_app true
55

6-
76
before_fork do |_server, _worker|
87
Signal.trap 'TERM' do
98
puts 'Unicorn master intercepting TERM and sending myself QUIT instead'
@@ -21,4 +20,4 @@
2120
end
2221

2322
ActiveRecord::Base.establish_connection if defined?(ActiveRecord::Base)
24-
end
23+
end

db/seeds.rb

-51
This file was deleted.

lib/tasks/cucumber.rake

+46-44
Original file line numberDiff line numberDiff line change
@@ -4,62 +4,64 @@
44
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
55
# files.
66

7+
unless ARGV.any? { |a| a =~ /^gems/ } # Don't load anything when running the gems:* tasks
78

8-
unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks
9+
vendored_cucumber_bin = Dir["#{Rails.root}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
10+
$LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil?
911

10-
vendored_cucumber_bin = Dir["#{Rails.root}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
11-
$LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil?
12+
begin
13+
require 'cucumber/rake/task'
1214

13-
begin
14-
require 'cucumber/rake/task'
15+
namespace :cucumber do
16+
Cucumber::Rake::Task.new({ ok: 'test:prepare' }, 'Run features that should pass') do |t|
17+
t.binary = vendored_cucumber_bin # If nil, the gem's binary is used.
18+
t.fork = true # You may get faster startup if you set this to false
19+
t.profile = 'default'
20+
end
1521

16-
namespace :cucumber do
17-
Cucumber::Rake::Task.new({:ok => 'test:prepare'}, 'Run features that should pass') do |t|
18-
t.binary = vendored_cucumber_bin # If nil, the gem's binary is used.
19-
t.fork = true # You may get faster startup if you set this to false
20-
t.profile = 'default'
21-
end
22-
23-
Cucumber::Rake::Task.new({:wip => 'test:prepare'}, 'Run features that are being worked on') do |t|
24-
t.binary = vendored_cucumber_bin
25-
t.fork = true # You may get faster startup if you set this to false
26-
t.profile = 'wip'
27-
end
22+
Cucumber::Rake::Task.new({ wip: 'test:prepare' }, 'Run features that are being worked on') do |t|
23+
t.binary = vendored_cucumber_bin
24+
t.fork = true # You may get faster startup if you set this to false
25+
t.profile = 'wip'
26+
end
2827

29-
Cucumber::Rake::Task.new({:rerun => 'test:prepare'}, 'Record failing features and run only them if any exist') do |t|
30-
t.binary = vendored_cucumber_bin
31-
t.fork = true # You may get faster startup if you set this to false
32-
t.profile = 'rerun'
33-
end
28+
Cucumber::Rake::Task.new({
29+
rerun: 'test:prepare'
30+
},
31+
'Record failing features and run only them if any exist') do |t|
32+
t.binary = vendored_cucumber_bin
33+
t.fork = true # You may get faster startup if you set this to false
34+
t.profile = 'rerun'
35+
end
3436

35-
desc 'Run all features'
36-
task :all => [:ok, :wip]
37+
desc 'Run all features'
38+
task all: [:ok, :wip]
3739

38-
task :statsetup do
39-
require 'rails/code_statistics'
40-
::STATS_DIRECTORIES << %w(Cucumber\ features features) if File.exist?('features')
41-
::CodeStatistics::TEST_TYPES << "Cucumber features" if File.exist?('features')
40+
task :statsetup do
41+
require 'rails/code_statistics'
42+
::STATS_DIRECTORIES << %w(Cucumber\ features features) if File.exist?('features')
43+
::CodeStatistics::TEST_TYPES << "Cucumber features" if File.exist?('features')
44+
end
4245
end
43-
end
44-
desc 'Alias for cucumber:ok'
45-
task :cucumber => 'cucumber:ok'
46+
desc 'Alias for cucumber:ok'
47+
task cucumber: 'cucumber:ok'
4648

47-
task :default => :cucumber
49+
task default: :cucumber
4850

49-
task :features => :cucumber do
50-
STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***"
51-
end
51+
task features: :cucumber do
52+
STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***"
53+
end
5254

53-
# In case we don't have the generic Rails test:prepare hook, append a no-op task that we can depend upon.
54-
task 'test:prepare' do
55-
end
55+
# In case we don't have the generic Rails test:prepare hook, append a no-op task that we can depend upon.
56+
task 'test:prepare' do
57+
end
5658

57-
task :stats => 'cucumber:statsetup'
58-
rescue LoadError
59-
desc 'cucumber rake task not available (cucumber not installed)'
60-
task :cucumber do
61-
abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
59+
task stats: 'cucumber:statsetup'
60+
rescue LoadError
61+
desc 'cucumber rake task not available (cucumber not installed)'
62+
task :cucumber do
63+
abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
64+
end
6265
end
63-
end
6466

6567
end

0 commit comments

Comments
 (0)