From 3601ebda79b84c3ea4b21f0e2b91003f206c342a Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Wed, 20 May 2015 18:39:33 -0400 Subject: [PATCH 1/3] Update spring, re-run binstubs --- Gemfile.lock | 2 +- bin/rails | 5 ++--- bin/rake | 5 ++--- bin/spring | 11 ++++------- 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 9ea77151c74d..340b9f6e3c8b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -589,7 +589,7 @@ GEM capybara (>= 2.0.0) railties (>= 3) spinach (>= 0.4) - spring (1.3.3) + spring (1.3.6) spring-commands-rspec (1.0.4) spring (>= 0.9.1) spring-commands-spinach (1.0.0) diff --git a/bin/rails b/bin/rails index 7feb6a30e696..215a2ea01f02 100755 --- a/bin/rails +++ b/bin/rails @@ -3,6 +3,5 @@ begin load File.expand_path("../spring", __FILE__) rescue LoadError end -APP_PATH = File.expand_path('../../config/application', __FILE__) -require_relative '../config/boot' -require 'rails/commands' +require 'bundler/setup' +load Gem.bin_path('rails', 'rails') diff --git a/bin/rake b/bin/rake index 8017a0271d21..0fb4e07e13ab 100755 --- a/bin/rake +++ b/bin/rake @@ -3,6 +3,5 @@ begin load File.expand_path("../spring", __FILE__) rescue LoadError end -require_relative '../config/boot' -require 'rake' -Rake.application.run +require 'bundler/setup' +load Gem.bin_path('rake', 'rake') diff --git a/bin/spring b/bin/spring index 253ec37c3451..7b45d374fcd9 100755 --- a/bin/spring +++ b/bin/spring @@ -1,17 +1,14 @@ #!/usr/bin/env ruby -# This file loads spring without using Bundler, in order to be fast -# It gets overwritten when you run the `spring binstub` command +# This file loads spring without using Bundler, in order to be fast. +# It gets overwritten when you run the `spring binstub` command. unless defined?(Spring) require "rubygems" require "bundler" - if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ spring \((.*?)\)$.*?^$/m) - ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR) - ENV["GEM_HOME"] = "" - Gem.paths = ENV - + if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m) + Gem.paths = { "GEM_PATH" => [Bundler.bundle_path.to_s, *Gem.path].uniq } gem "spring", match[1] require "spring/binstub" end From 9789b56a319a885e1086f3475814477946ccb548 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Wed, 20 May 2015 19:22:00 -0400 Subject: [PATCH 2/3] Update ffaker gem Adds a version requirement which it didn't have before, at 2.0.0. This version has breaking API changes in that the namespace is now `FFaker` instead of `Faker`. --- Gemfile | 2 +- Gemfile.lock | 10 +++++----- db/fixtures/development/04_project.rb | 4 ++-- db/fixtures/development/05_users.rb | 6 +++--- db/fixtures/development/07_milestones.rb | 2 +- db/fixtures/development/09_issues.rb | 4 ++-- db/fixtures/development/10_merge_requests.rb | 4 ++-- db/fixtures/development/12_snippets.rb | 4 ++-- db/fixtures/development/13_comments.rb | 4 ++-- features/steps/project/hooks.rb | 2 +- spec/factories.rb | 16 ++++++++-------- spec/features/admin/admin_hooks_spec.rb | 2 +- spec/mailers/notify_spec.rb | 4 ++-- spec/requests/api/projects_spec.rb | 4 ++-- 14 files changed, 34 insertions(+), 34 deletions(-) diff --git a/Gemfile b/Gemfile index 59adf6d2d65d..276efd0db050 100644 --- a/Gemfile +++ b/Gemfile @@ -239,7 +239,7 @@ group :development, :test do gem 'minitest', '~> 5.3.0' # Generate Fake data - gem "ffaker" + gem 'ffaker', '~> 2.0.0' # Guard gem 'guard-rspec' diff --git a/Gemfile.lock b/Gemfile.lock index 340b9f6e3c8b..a384ccb1d61d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -176,7 +176,7 @@ GEM faraday_middleware (0.9.0) faraday (>= 0.7.4, < 0.9) fastercsv (1.5.5) - ffaker (1.22.1) + ffaker (2.0.0) ffi (1.9.8) fog (1.21.0) fog-brightbox @@ -547,9 +547,9 @@ GEM sdoc (0.3.20) json (>= 1.1.3) rdoc (~> 3.10) - seed-fu (2.3.1) - activerecord (>= 3.1, < 4.2) - activesupport (>= 3.1, < 4.2) + seed-fu (2.3.5) + activerecord (>= 3.1, < 4.3) + activesupport (>= 3.1, < 4.3) select2-rails (3.5.2) thor (~> 0.14) settingslogic (2.0.9) @@ -713,7 +713,7 @@ DEPENDENCIES email_spec enumerize factory_girl_rails - ffaker + ffaker (~> 2.0.0) fog (~> 1.14) font-awesome-rails (~> 4.2) foreman diff --git a/db/fixtures/development/04_project.rb b/db/fixtures/development/04_project.rb index ae4c0550a4f8..878397709241 100644 --- a/db/fixtures/development/04_project.rb +++ b/db/fixtures/development/04_project.rb @@ -23,7 +23,7 @@ name: group_path.titleize, path: group_path ) - group.description = Faker::Lorem.sentence + group.description = FFaker::Lorem.sentence group.save group.add_owner(User.first) @@ -35,7 +35,7 @@ import_url: url, namespace_id: group.id, name: project_path.titleize, - description: Faker::Lorem.sentence, + description: FFaker::Lorem.sentence, visibility_level: Gitlab::VisibilityLevel.values.sample } diff --git a/db/fixtures/development/05_users.rb b/db/fixtures/development/05_users.rb index 24952a1f6616..378354efd5a0 100644 --- a/db/fixtures/development/05_users.rb +++ b/db/fixtures/development/05_users.rb @@ -2,9 +2,9 @@ (2..20).each do |i| begin User.create!( - username: Faker::Internet.user_name, - name: Faker::Name.name, - email: Faker::Internet.email, + username: FFaker::Internet.user_name, + name: FFaker::Name.name, + email: FFaker::Internet.email, confirmed_at: DateTime.now, password: '12345678' ) diff --git a/db/fixtures/development/07_milestones.rb b/db/fixtures/development/07_milestones.rb index 2296821e528b..a43116829d97 100644 --- a/db/fixtures/development/07_milestones.rb +++ b/db/fixtures/development/07_milestones.rb @@ -3,7 +3,7 @@ (1..5).each do |i| milestone_params = { title: "v#{i}.0", - description: Faker::Lorem.sentence, + description: FFaker::Lorem.sentence, state: ['opened', 'closed'].sample, } diff --git a/db/fixtures/development/09_issues.rb b/db/fixtures/development/09_issues.rb index e8b01b46d221..c636e96381ca 100644 --- a/db/fixtures/development/09_issues.rb +++ b/db/fixtures/development/09_issues.rb @@ -2,8 +2,8 @@ Project.all.each do |project| (1..10).each do |i| issue_params = { - title: Faker::Lorem.sentence(6), - description: Faker::Lorem.sentence, + title: FFaker::Lorem.sentence(6), + description: FFaker::Lorem.sentence, state: ['opened', 'closed'].sample, milestone: project.milestones.sample, assignee: project.team.users.sample diff --git a/db/fixtures/development/10_merge_requests.rb b/db/fixtures/development/10_merge_requests.rb index f9b2fd8b05fd..0825776ffaad 100644 --- a/db/fixtures/development/10_merge_requests.rb +++ b/db/fixtures/development/10_merge_requests.rb @@ -10,8 +10,8 @@ params = { source_branch: source_branch, target_branch: target_branch, - title: Faker::Lorem.sentence(6), - description: Faker::Lorem.sentences(3).join(" "), + title: FFaker::Lorem.sentence(6), + description: FFaker::Lorem.sentences(3).join(" "), milestone: project.milestones.sample, assignee: project.team.users.sample } diff --git a/db/fixtures/development/12_snippets.rb b/db/fixtures/development/12_snippets.rb index b3a6f39c7d5d..3bd4b442adea 100644 --- a/db/fixtures/development/12_snippets.rb +++ b/db/fixtures/development/12_snippets.rb @@ -28,8 +28,8 @@ class Member < ActiveRecord::Base PersonalSnippet.seed(:id, [{ id: i, author_id: user.id, - title: Faker::Lorem.sentence(3), - file_name: Faker::Internet.domain_word + '.rb', + title: FFaker::Lorem.sentence(3), + file_name: FFaker::Internet.domain_word + '.rb', visibility_level: Gitlab::VisibilityLevel.values.sample, content: content, }]) diff --git a/db/fixtures/development/13_comments.rb b/db/fixtures/development/13_comments.rb index d37be53c7b93..566c07056387 100644 --- a/db/fixtures/development/13_comments.rb +++ b/db/fixtures/development/13_comments.rb @@ -6,7 +6,7 @@ note_params = { noteable_type: 'Issue', noteable_id: issue.id, - note: Faker::Lorem.sentence, + note: FFaker::Lorem.sentence, } Notes::CreateService.new(project, user, note_params).execute @@ -21,7 +21,7 @@ note_params = { noteable_type: 'MergeRequest', noteable_id: mr.id, - note: Faker::Lorem.sentence, + note: FFaker::Lorem.sentence, } Notes::CreateService.new(project, user, note_params).execute diff --git a/features/steps/project/hooks.rb b/features/steps/project/hooks.rb index 4b1352025934..d06905285fe3 100644 --- a/features/steps/project/hooks.rb +++ b/features/steps/project/hooks.rb @@ -23,7 +23,7 @@ class Spinach::Features::ProjectHooks < Spinach::FeatureSteps end step 'I submit new hook' do - @url = Faker::Internet.uri("http") + @url = FFaker::Internet.uri("http") fill_in "hook_url", with: @url expect { click_button "Add Web Hook" }.to change(ProjectHook, :count).by(1) end diff --git a/spec/factories.rb b/spec/factories.rb index 26e8a795fa40..b7b2a1dac8e3 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -2,23 +2,23 @@ FactoryGirl.define do sequence :sentence, aliases: [:title, :content] do - Faker::Lorem.sentence + FFaker::Lorem.sentence end sequence :name do - Faker::Name.name + FFaker::Name.name end sequence :file_name do - Faker::Internet.user_name + FFaker::Internet.user_name end - sequence(:url) { Faker::Internet.uri('http') } + sequence(:url) { FFaker::Internet.uri('http') } factory :user, aliases: [:author, :assignee, :owner, :creator] do - email { Faker::Internet.email } + email { FFaker::Internet.email } name - sequence(:username) { |n| "#{Faker::Internet.user_name}#{n}" } + sequence(:username) { |n| "#{FFaker::Internet.user_name}#{n}" } password "12345678" confirmed_at { Time.now } confirmation_token { nil } @@ -122,12 +122,12 @@ factory :email do user email do - Faker::Internet.email('alias') + FFaker::Internet.email('alias') end factory :another_email do email do - Faker::Internet.email('another.alias') + FFaker::Internet.email('another.alias') end end end diff --git a/spec/features/admin/admin_hooks_spec.rb b/spec/features/admin/admin_hooks_spec.rb index 25862614d284..00906e8087a0 100644 --- a/spec/features/admin/admin_hooks_spec.rb +++ b/spec/features/admin/admin_hooks_spec.rb @@ -26,7 +26,7 @@ describe "New Hook" do before do - @url = Faker::Internet.uri("http") + @url = FFaker::Internet.uri("http") visit admin_hooks_path fill_in "hook_url", with: @url expect { click_button "Add System Hook" }.to change(SystemHook, :count).by(1) diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb index 37607b55eb1e..c40ae7b57039 100644 --- a/spec/mailers/notify_spec.rb +++ b/spec/mailers/notify_spec.rb @@ -185,7 +185,7 @@ context 'for issues' do let(:issue) { create(:issue, author: current_user, assignee: assignee, project: project) } - let(:issue_with_description) { create(:issue, author: current_user, assignee: assignee, project: project, description: Faker::Lorem.sentence) } + let(:issue_with_description) { create(:issue, author: current_user, assignee: assignee, project: project, description: FFaker::Lorem.sentence) } describe 'that are new' do subject { Notify.new_issue_email(issue.assignee_id, issue.id) } @@ -273,7 +273,7 @@ context 'for merge requests' do let(:merge_author) { create(:user) } let(:merge_request) { create(:merge_request, author: current_user, assignee: assignee, source_project: project, target_project: project) } - let(:merge_request_with_description) { create(:merge_request, author: current_user, assignee: assignee, source_project: project, target_project: project, description: Faker::Lorem.sentence) } + let(:merge_request_with_description) { create(:merge_request, author: current_user, assignee: assignee, source_project: project, target_project: project, description: FFaker::Lorem.sentence) } describe 'that are new' do subject { Notify.new_merge_request_email(merge_request.assignee_id, merge_request.id) } diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb index aada7febf6c1..46cd26eb9270 100644 --- a/spec/requests/api/projects_spec.rb +++ b/spec/requests/api/projects_spec.rb @@ -165,7 +165,7 @@ it "should assign attributes to project" do project = attributes_for(:project, { path: 'camelCasePath', - description: Faker::Lorem.sentence, + description: FFaker::Lorem.sentence, issues_enabled: false, merge_requests_enabled: false, wiki_enabled: false @@ -274,7 +274,7 @@ it 'should assign attributes to project' do project = attributes_for(:project, { - description: Faker::Lorem.sentence, + description: FFaker::Lorem.sentence, issues_enabled: false, merge_requests_enabled: false, wiki_enabled: false From 11af51613d219aecd2a8cdce879d983f82434d47 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Wed, 20 May 2015 19:50:35 -0400 Subject: [PATCH 3/3] Fix bin/rails binstub --- bin/rails | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/rails b/bin/rails index 215a2ea01f02..7feb6a30e696 100755 --- a/bin/rails +++ b/bin/rails @@ -3,5 +3,6 @@ begin load File.expand_path("../spring", __FILE__) rescue LoadError end -require 'bundler/setup' -load Gem.bin_path('rails', 'rails') +APP_PATH = File.expand_path('../../config/application', __FILE__) +require_relative '../config/boot' +require 'rails/commands'