diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/db/migrate/20110109130532_devise_create_users.rb b/db/migrate/20110109130532_devise_create_users.rb
index abc1234..def5678 100644
--- a/db/migrate/20110109130532_devise_create_users.rb
+++ b/db/migrate/20110109130532_devise_create_users.rb
@@ -4,12 +4,10 @@ t.string :name
t.string :login
t.string :email
- t.oauth2_authenticatable
t.timestamps
end
add_index :users, :login, :unique => true
- add_index :users, :oauth2_uid, :unique => true
end
def self.down
|
Revert "Revert "Removed devise oauth in migration""
This reverts commit 66eaabd008c382a0f4e5bf34a48f89fddd1416f6.
|
diff --git a/lib/infrataster/rspec.rb b/lib/infrataster/rspec.rb
index abc1234..def5678 100644
--- a/lib/infrataster/rspec.rb
+++ b/lib/infrataster/rspec.rb
@@ -6,23 +6,23 @@ RSpec.configure do |config|
config.include Infrataster::Helpers::RSpecHelper
+ fetch_current_example = RSpec.respond_to?(:current_example) ?
+ proc { RSpec.current_example }
+ : proc { |context| context.example }
+
config.before(:all) do
@infrataster_context = Infrataster::Contexts.from_example(self.class)
end
config.before(:each) do
- if defined?(RSpec.current_example)
- example = RSpec.current_example
- end
- @infrataster_context = Infrataster::Contexts.from_example(example)
- @infrataster_context.before_each(example) if @infrataster_context.respond_to?(:before_each)
+ current_example = fetch_current_example.call(self)
+ @infrataster_context = Infrataster::Contexts.from_example(current_example)
+ @infrataster_context.before_each(current_example) if @infrataster_context.respond_to?(:before_each)
end
config.after(:each) do
- if defined?(RSpec.current_example)
- example = RSpec.current_example
- end
- @infrataster_context.after_each(example) if @infrataster_context.respond_to?(:after_each)
+ current_example = fetch_current_example.call(self)
+ @infrataster_context.after_each(current_example) if @infrataster_context.respond_to?(:after_each)
end
config.after(:all) do
@@ -31,4 +31,3 @@ end
end
end
-
|
Change how to get current example that return nil in ver 2.14.x
|
diff --git a/lib/integrity/project.rb b/lib/integrity/project.rb
index abc1234..def5678 100644
--- a/lib/integrity/project.rb
+++ b/lib/integrity/project.rb
@@ -7,9 +7,9 @@
property :id, Integer, :serial => true
property :name, String, :nullable => false
- property :uri, URI, :nullable => false
+ property :uri, URI, :nullable => false, :length => 255
property :branch, String, :nullable => false, :default => "master"
- property :command, String, :nullable => false, :default => "rake"
+ property :command, String, :nullable => false, :length => 255, :default => "rake"
property :public, Boolean, :default => true
def build
|
Allow longer uris and commands in Project
|
diff --git a/lib/split/cli/session.rb b/lib/split/cli/session.rb
index abc1234..def5678 100644
--- a/lib/split/cli/session.rb
+++ b/lib/split/cli/session.rb
@@ -29,7 +29,7 @@
def config_split!
Split.redis = options.fetch :redis_url, ENV.fetch('REDIS_URL', 'localhost:6379')
- Split.redis.namespace = options.fetch :redis_namespace, ENV['REDIS_NAMESPACE']
+ Split.redis.namespace = options.fetch :redis_namespace, ENV.fetch('REDIS_NAMESPACE', 'split')
Split.configure do |config|
config.persistence = Split::Persistence::RedisAdapter.with_config(lookup_by: -> (cli) { cli.session_id })
|
Add a default namespace that isn’t nil
|
diff --git a/lib/tasks/ember-cli.rake b/lib/tasks/ember-cli.rake
index abc1234..def5678 100644
--- a/lib/tasks/ember-cli.rake
+++ b/lib/tasks/ember-cli.rake
@@ -1,6 +1,6 @@-namespace "ember-cli" do
+namespace :ember do
desc "Runs `ember build` for each App"
- task compile: :install_dependencies do
+ task compile: :install do
EmberCLI.compile!
end
@@ -10,9 +10,9 @@ end
desc "Installs each EmberCLI app's dependencies"
- task install_dependencies: :environment do
+ task install: :environment do
EmberCLI.install_dependencies!
end
end
-task "assets:precompile" => "ember-cli:compile" unless EmberCLI.skip?
+task "assets:precompile" => "ember:compile" unless EmberCLI.skip?
|
Rename rake namespace to ember
|
diff --git a/natero/lib/natero/base.rb b/natero/lib/natero/base.rb
index abc1234..def5678 100644
--- a/natero/lib/natero/base.rb
+++ b/natero/lib/natero/base.rb
@@ -15,7 +15,10 @@ end
def self.endpoint_path
- raise NotImplementedError.new('This method needs to be overridden in a child class.')
+ raise NotImplementedError.new(
+ 'This method needs to be overridden in a child class. Proper implementation should return an array where '\
+ 'each index contains a different part of the path. For example: [\'test\', \'best\'] becomes \'/test/best/\'.'
+ )
end
def self.json_data(body)
|
Add better error message when a child class doesn't implement endpoint_path.
|
diff --git a/app/controllers/concerns/sufia/contact_form_controller_behavior.rb b/app/controllers/concerns/sufia/contact_form_controller_behavior.rb
index abc1234..def5678 100644
--- a/app/controllers/concerns/sufia/contact_form_controller_behavior.rb
+++ b/app/controllers/concerns/sufia/contact_form_controller_behavior.rb
@@ -8,7 +8,7 @@ @contact_form = ContactForm.new(params[:contact_form])
@contact_form.request = request
# not spam and a valid form
- if @contact_form.respond_to?(:deliver_now) ? @contact_form.deliver_now : @contact_form.deliver
+ if @contact_form.deliver
flash.now[:notice] = 'Thank you for your message!'
after_deliver
@contact_form = ContactForm.new
|
Refactor contact form to call deliver.
the contact form is a MailForm object and doesn't support deliver_now.
|
diff --git a/init.rb b/init.rb
index abc1234..def5678 100644
--- a/init.rb
+++ b/init.rb
@@ -1,5 +1,3 @@ require 'social_stream'
SocialStream::Rails::Common.inflections
-
-AssetBundler.paths += Array(File.join(File.dirname(__FILE__), 'app', 'assets'))
|
Remove obsolete reference to AssetBundler
|
diff --git a/install.rb b/install.rb
index abc1234..def5678 100644
--- a/install.rb
+++ b/install.rb
@@ -24,6 +24,7 @@ else
policy :provision, :roles => :provision do
NODE_CONFIG['packages'].each do |package, options|
+ options ||= {}
requires package, options.symbolize_keys
end
end
|
Fix when options is nil
|
diff --git a/config/default_config.rb b/config/default_config.rb
index abc1234..def5678 100644
--- a/config/default_config.rb
+++ b/config/default_config.rb
@@ -9,4 +9,4 @@ CONFIG['url_base'] ||= 'http://' + CONFIG['server_host']
# Set secure to false by default due to ssl requirement
-CONFIG['secure'] = 'false'
+CONFIG['secure'] ||= 'false'
|
Correct way to define default.
--HG--
branch : 3.2.0-release
|
diff --git a/spec/acceptance/support/selenium_find_patch.rb b/spec/acceptance/support/selenium_find_patch.rb
index abc1234..def5678 100644
--- a/spec/acceptance/support/selenium_find_patch.rb
+++ b/spec/acceptance/support/selenium_find_patch.rb
@@ -0,0 +1,15 @@+# REMOVE THIS FILE WHEN
+# http://code.google.com/p/selenium/issues/detail?id=2287
+# http://code.google.com/p/selenium/issues/detail?id=2099
+# GET FIXED
+
+class Capybara::Selenium::Driver
+ def find(selector)
+ begin
+ browser.find_elements(:xpath, selector).map { |node| Capybara::Selenium::Node.new(self, node) }
+ rescue Selenium::WebDriver::Error::InvalidSelectorError, Selenium::WebDriver::Error::UnhandledError
+ sleep 1
+ browser.find_elements(:xpath, selector).map { |node| Capybara::Selenium::Node.new(self, node) }
+ end
+ end
+end
|
Patch for Selenium intermittent errors
|
diff --git a/spec/support/fixtures_generation/prover_output_generator.rb b/spec/support/fixtures_generation/prover_output_generator.rb
index abc1234..def5678 100644
--- a/spec/support/fixtures_generation/prover_output_generator.rb
+++ b/spec/support/fixtures_generation/prover_output_generator.rb
@@ -3,7 +3,7 @@ module FixturesGeneration
class ProverOutputGenerator < DirectHetsGenerator
NODES = %w(CounterSatisfiable Theorem)
- PROVERS = %w(MathServeBroker SPASS Vampire darwin darwin-non-fd eprover)
+ PROVERS = %w(SPASS darwin darwin-non-fd eprover)
protected
def perform(file)
|
Remove MathServe from prover output generator.
|
diff --git a/rome.rb b/rome.rb
index abc1234..def5678 100644
--- a/rome.rb
+++ b/rome.rb
@@ -1,10 +1,10 @@ class Rome < Formula
desc "A shared cache tool for Carthage on S3"
homepage "https://github.com/blender/Rome"
- url "https://github.com/blender/Rome/releases/download/v0.12.0.31/rome.zip"
- sha256 "3ad1d0ff2eaee5614c48db5f26c4c5383790ba9d8cda44d850f8893e41eb1c61"
+ url "https://github.com/blender/Rome/releases/download/v0.13.0.33/rome.zip"
+ sha256 "ffc96682355c534d6dbbd8f2410c945145bc46af2fda69f3cdffc5cf0090add1"
- version "0.12.0.31"
+ version "0.13.0.33"
bottle :unneeded
|
Update Rome formula to v0.13.0.33
|
diff --git a/core/app/models/spree/wallet/add_payment_sources_to_wallet.rb b/core/app/models/spree/wallet/add_payment_sources_to_wallet.rb
index abc1234..def5678 100644
--- a/core/app/models/spree/wallet/add_payment_sources_to_wallet.rb
+++ b/core/app/models/spree/wallet/add_payment_sources_to_wallet.rb
@@ -13,7 +13,11 @@ def add_to_wallet
if !order.temporary_payment_source && order.user
# select valid sources
- sources = order.payments.valid.map(&:source).uniq.compact.select(&:reusable?)
+ payments = order.payments.valid
+ sources = payments.map(&:source).
+ uniq.
+ compact.
+ select { |p| p.try(:reusable?) }
# add valid sources to wallet and optionally set a default
if sources.any?
|
Update add_after_order_complete for non-PaymentSource sources
For any stores using legacy payment sources that do not inherit from
PaymentSource.
|
diff --git a/app/controllers/about_controller.rb b/app/controllers/about_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/about_controller.rb
+++ b/app/controllers/about_controller.rb
@@ -5,7 +5,7 @@ end
def projects
- @projects = Project.all.sort_by { |p| p.name.downcase }
+ @projects = Project.includes(:members).all.sort_by { |p| p.name.downcase }
end
def join_us
|
Use scope and includes for projects
|
diff --git a/app/controllers/blogs_controller.rb b/app/controllers/blogs_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/blogs_controller.rb
+++ b/app/controllers/blogs_controller.rb
@@ -1,5 +1,6 @@ class BlogsController < ApplicationController
before_filter :authenticate_user!
+ before_filter :get_blog, :only => [ :edit, :update, :change_image, :upload_image ]
def create
@club = Club.find params[:club_id]
@@ -14,10 +15,36 @@ end
def edit
- @blog = Blog.find params[:id]
-
authorize! :edit, @blog
@club = @blog.club
end
+
+ def update
+ authorize! :update, @blog
+
+ @blog.update_attributes params[:blog]
+
+ respond_with_bip @blog
+ end
+
+ def change_image
+ authorize! :update, @blog
+ end
+
+ def upload_image
+ authorize! :update, @blog
+
+ if @blog.update_attributes params[:blog]
+ redirect_to edit_blog_path(@blog)
+ else
+ render :change_image, :formats => [ :js ]
+ end
+ end
+
+ private
+
+ def get_blog
+ @blog = Blog.find params[:id]
+ end
end
|
Update Blog Controller for update Actions
Update the Blog controller to include all corresponding actions to
update a Blog.
|
diff --git a/google_analytics.gemspec b/google_analytics.gemspec
index abc1234..def5678 100644
--- a/google_analytics.gemspec
+++ b/google_analytics.gemspec
@@ -1,13 +1,13 @@ spec = Gem::Specification.new do |s|
s.name = 'google_analytics'
- s.version = '1.1'
- s.date = "2008-11-11"
+ s.version = '1.1.1'
+ s.date = "2009-01-02"
s.author = 'Graeme Mathieson'
s.email = 'mathie@rubaidh.com'
s.has_rdoc = true
- s.homepage = 'http://github.com/rubaidh/google_analytics/tree/master'
- s.summary = "[Rails] This is a quick 'n' dirty module to easily enable" +
- 'Google Analytics support in your application.'
+ s.homepage = 'http://rubaidh.com/portfolio/open-source/google-analytics/'
+ s.summary = "[Rails] Easily enable Google Analytics support in your Rails application."
+
s.description = 'By default this gem will output google analytics code for' +
"every page automatically, if it's configured correctly." +
"This is done by adding:\n" +
|
Bump the version, tweak the summary and set the correct home page.
Signed-off-by: Collective Idea <59bd0a3ff43b32849b319e645d4798d8a5d1e889@collectiveidea.com>
|
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -16,6 +16,9 @@
def show
find_user
+ if (current_user != @user) || @user.blank?
+ redirect_to root_path
+ end
end
def edit
|
Create if statement that redirects logged in users home if they try to access a profile page that isn't theirs
|
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -1,6 +1,13 @@ class UsersController < ApplicationController
def create
+ @user = User.new(user_params)
+ if @user.save
+ sesssion[:user_id] = @user.user_id
+ redirect_to user_show_path(@user)
+ else
+ redirect_to :back
+ end
end
def new
|
Make create controller for Users
|
diff --git a/app/models/riews/filter_criteria.rb b/app/models/riews/filter_criteria.rb
index abc1234..def5678 100644
--- a/app/models/riews/filter_criteria.rb
+++ b/app/models/riews/filter_criteria.rb
@@ -7,7 +7,8 @@ 1 => 'NULL',
2 => 'NOT NULL',
3 => '=',
- 4 => 'IN'
+ 4 => 'IN',
+ 5 => 'LIKE'
}
end
@@ -32,6 +33,8 @@ query.where.not(field_name => nil)
when 3, 4
query.where(field_name => arguments.pluck(:value))
+ when 5
+ query.where("#{field_name} LIKE ?", "#{arguments.first.value}") if arguments.any?
else
query
end
|
Add LIKE operator to query
|
diff --git a/app/controllers/fae/setup_controller.rb b/app/controllers/fae/setup_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/fae/setup_controller.rb
+++ b/app/controllers/fae/setup_controller.rb
@@ -1,6 +1,7 @@ module Fae
class SetupController < ActionController::Base
+ before_action :check_roles
layout 'devise'
def first_user
@@ -15,10 +16,6 @@ super_admin = Fae::Role.find_by_name('super admin')
@user.role = super_admin
@user.active = true
-
- if Fae::Role.all.empty?
- logger.error("Role 'super admin' does not exist in Fae::Role, run rake fae:seed_db")
- end
if @user.save
sign_in(@user)
@@ -39,5 +36,10 @@ params.require(:user).permit(:email, :first_name, :last_name, :password, :password_confirmation)
end
+ def check_roles
+ if Fae::Role.all.empty?
+ raise "Role 'super admin' does not exist in Fae::Role, run rake fae:seed_db"
+ end
+ end
end
end
|
Raise exception if roles do not exist upon first user creation
|
diff --git a/lib/colossus/configuration.rb b/lib/colossus/configuration.rb
index abc1234..def5678 100644
--- a/lib/colossus/configuration.rb
+++ b/lib/colossus/configuration.rb
@@ -9,7 +9,7 @@ def initialize
@ttl = 10
@seconds_before_ttl_check = 2
- @engine = Colossus::Engine::Memory
+ @engine = Colossus::Engine::MemoryThreadSafe
@secret_key = ''
@writer_token = ''
end
|
Replace default engine with ThreadSafe
|
diff --git a/app/models/comment/callbacks.rb b/app/models/comment/callbacks.rb
index abc1234..def5678 100644
--- a/app/models/comment/callbacks.rb
+++ b/app/models/comment/callbacks.rb
@@ -1,6 +1,6 @@ class Comment
- def before_save
+ def before_create
self.target ||= project
set_status_and_assigned if self.target.is_a?(Task)
|
Revert "Task should assign target, status and assigned on save, not only on create"
This reverts commit 6fab90c877ffa0f6f382a34603cb84705ff4a07c.
|
diff --git a/lib/jekyll-github-metadata.rb b/lib/jekyll-github-metadata.rb
index abc1234..def5678 100644
--- a/lib/jekyll-github-metadata.rb
+++ b/lib/jekyll-github-metadata.rb
@@ -30,6 +30,10 @@ @values ||= Hash.new
end
+ def clear_values!
+ @values = Hash.new
+ end
+
def to_h
values
end
|
Add a way to clear out all the values.
|
diff --git a/mrblib/vec.rb b/mrblib/vec.rb
index abc1234..def5678 100644
--- a/mrblib/vec.rb
+++ b/mrblib/vec.rb
@@ -2,6 +2,7 @@ # Vec クラスのための Array クラス拡張メソッド
#
class Array
+
def to_v
if size == 0
Vec::new 0.0, 0.0, 0.0
@@ -13,5 +14,14 @@ Vec::new x, y, z
end
end
+
+ def x; (self[0] ||= 0).to_f end
+ def y; (self[1] ||= 0).to_f end
+ def z; (self[2] ||= 0).to_f end
+
+ def x=(val); self[0] = val end
+ def y=(val); self[1] = val end
+ def z=(val); self[2] = val end
+
end
|
Add x, y and x method to Array class.
|
diff --git a/db/migrate/20110724140336_add_name_scope_sequence_index_on_slugs.rb b/db/migrate/20110724140336_add_name_scope_sequence_index_on_slugs.rb
index abc1234..def5678 100644
--- a/db/migrate/20110724140336_add_name_scope_sequence_index_on_slugs.rb
+++ b/db/migrate/20110724140336_add_name_scope_sequence_index_on_slugs.rb
@@ -0,0 +1,9 @@+class AddNameScopeSequenceIndexOnSlugs < ActiveRecord::Migration
+ def self.up
+ add_index :slugs, [:name, :scope, :sequence], :name => 'index_slugs_on_name_scope_and_sequence'
+ end
+
+ def self.down
+ remove_index :slugs, 'name_scope_and_sequence'
+ end
+end
|
Index on slugs without type - doesn't seem to be used in same clause when looking up scoped slugs.
|
diff --git a/app/tasks/create_server_task.rb b/app/tasks/create_server_task.rb
index abc1234..def5678 100644
--- a/app/tasks/create_server_task.rb
+++ b/app/tasks/create_server_task.rb
@@ -11,11 +11,11 @@
def process
@server = @wizard.create_server
- MonitorServer.perform_in(MonitorServer::POLL_INTERVAL.seconds, @server.id, @user.id)
if @wizard.build_errors.length > 0
errors.concat @wizard.build_errors
false
else
+ MonitorServer.perform_in(MonitorServer::POLL_INTERVAL.seconds, @server.id, @user.id)
true
end
end
|
Monitor server only if build succeeded
|
diff --git a/test/unit/helpers/filter_routes_helper_test.rb b/test/unit/helpers/filter_routes_helper_test.rb
index abc1234..def5678 100644
--- a/test/unit/helpers/filter_routes_helper_test.rb
+++ b/test/unit/helpers/filter_routes_helper_test.rb
@@ -1,7 +1,7 @@ require 'test_helper'
class FilterRoutesHelperTest < ActionView::TestCase
- [:announcements, :publications, :policies, :detailed_guides].each do |filter|
+ [:announcements, :publications, :policies].each do |filter|
test "uses the organisation to generate the route to #{filter} filter" do
organisation = create(:organisation)
assert_equal send("#{filter}_path", departments: [organisation.slug]), send("#{filter}_filter_path", organisation)
|
Remove broken test to fix build.
This broke the build because this whole file wasn't being included
in builds until I renamed the file with a `_test.rb` suffix.
The `detailed_guides_filter_path` was actually removed two months
ago: 5b2498f841af1dd1fc88015c2cf3da23b0cb7a57
|
diff --git a/lib/rubycritic/cli/options.rb b/lib/rubycritic/cli/options.rb
index abc1234..def5678 100644
--- a/lib/rubycritic/cli/options.rb
+++ b/lib/rubycritic/cli/options.rb
@@ -24,9 +24,9 @@ file_hash = file_options.to_h
argv_hash = argv_options.to_h
- file_hash.merge(argv_hash) { |_, file_option, argv_option|
+ file_hash.merge(argv_hash) do |_, file_option, argv_option|
argv_option.nil? ? file_option : argv_option
- }
+ end
end
end
end
|
Switch to do-end style block to make rubocop happy.
|
diff --git a/lib/specjour/socket_helper.rb b/lib/specjour/socket_helper.rb
index abc1234..def5678 100644
--- a/lib/specjour/socket_helper.rb
+++ b/lib/specjour/socket_helper.rb
@@ -9,11 +9,11 @@ end
def hostname
- @hostname ||= Socket.gethostname
+ Socket.gethostname
end
def local_ip
- @local_ip ||= UDPSocket.open {|s| s.connect('74.125.224.103', 1); s.addr.last }
+ UDPSocket.open {|s| s.connect('74.125.224.103', 1); s.addr.last }
end
def current_uri
|
Fix rsync "file has vanished" bug
By not caching the hostname and ip address, a specjour listener can be
left running and will function correctly as it moves from one network
(ip) to another. This was a very annoying problem, and thus, a
significant fix.
|
diff --git a/test/integration/help_cookies_test.rb b/test/integration/help_cookies_test.rb
index abc1234..def5678 100644
--- a/test/integration/help_cookies_test.rb
+++ b/test/integration/help_cookies_test.rb
@@ -0,0 +1,23 @@+require "integration_test_helper"
+
+class HelpCookiesTest < ActionDispatch::IntegrationTest
+ context "rendering the cookies setting page" do
+ setup do
+ payload = {
+ base_path: "/help/cookies",
+ format: "special_route",
+ title: "Cookies on GOV.UK",
+ description: "You can choose which cookies you're happy for GOV.UK to use.",
+ }
+ content_store_has_item('/help/cookies', payload)
+ end
+
+ should "render the cookies setting page correctly" do
+ visit "/help/cookies"
+
+ within '#content' do
+ assert_has_component_title "Cookies on GOV.UK"
+ end
+ end
+ end
+end
|
Add integration test for /help/cookies
|
diff --git a/lib/user_wiki_macro/macros.rb b/lib/user_wiki_macro/macros.rb
index abc1234..def5678 100644
--- a/lib/user_wiki_macro/macros.rb
+++ b/lib/user_wiki_macro/macros.rb
@@ -16,10 +16,21 @@ user = User.find_by_login(username)
return nil unless user
- content_tag :span, class: "user-wiki-macro user-wiki-macro-user" do
- label = avatar(user, size: UserWikiMacro.determine_size(options))
- label += content_tag(:span, user.login)
- link_to label, user_path(user)
+ image = avatar(user, size: UserWikiMacro.determine_size(options))
+
+ css = ["user-wiki-macro user-wiki-macro-user"]
+ label = []
+
+ if image.present?
+ css << "user-wiki-macro-user-with-avatar"
+ label << image
+ label << content_tag(:span, user.login)
+ else
+ label << user.login
+ end
+
+ content_tag :span, class: css do
+ link_to label.join.html_safe, user_path(user)
end
end
end
|
Handle situations without user avatars
In case the user has no avatar, simple print the linked login
|
diff --git a/lib/amf_socket/rpc_request.rb b/lib/amf_socket/rpc_request.rb
index abc1234..def5678 100644
--- a/lib/amf_socket/rpc_request.rb
+++ b/lib/amf_socket/rpc_request.rb
@@ -28,8 +28,6 @@ object = {}
object[:type] = 'rpcResponse'
object[:response] = {}
- object[:response][:command] = command
- object[:response][:params] = params
object[:response][:messageId] = message_id
object[:response][:result] = result
|
Remove unused data from rpc responses.
|
diff --git a/lib/mspec/runner/exception.rb b/lib/mspec/runner/exception.rb
index abc1234..def5678 100644
--- a/lib/mspec/runner/exception.rb
+++ b/lib/mspec/runner/exception.rb
@@ -34,10 +34,9 @@ end
def backtrace
- @backtrace_filter ||= MSpecScript.config[:backtrace_filter]
+ @backtrace_filter ||= MSpecScript.config[:backtrace_filter] || %r{(?:/bin/mspec|/lib/mspec/)}
bt = @exception.backtrace || []
-
bt.select { |line| $MSPEC_DEBUG or @backtrace_filter !~ line }.join("\n")
end
end
|
Add a default backtrace_filter in MSpec
* Useful when run without a .mspec config file.
|
diff --git a/lib/feed2email.rb b/lib/feed2email.rb
index abc1234..def5678 100644
--- a/lib/feed2email.rb
+++ b/lib/feed2email.rb
@@ -4,7 +4,7 @@ require 'feed2email/logger'
module Feed2Email
- CONFIG_DIR = File.expand_path('~/.feed2email')
+ CONFIG_DIR = File.join(ENV['HOME'], '.feed2email')
def self.config
@config ||= Config.new(File.join(CONFIG_DIR, 'config.yml'))
|
Use ENV['HOME'] instead of expanding ~
|
diff --git a/lib/tasks/refresh_tokens.rake b/lib/tasks/refresh_tokens.rake
index abc1234..def5678 100644
--- a/lib/tasks/refresh_tokens.rake
+++ b/lib/tasks/refresh_tokens.rake
@@ -1,9 +1,9 @@ desc "refresh access tokens for google accounts"
task :refresh_tokens => :environment do
#Google
- Authorization.where(provider:"google_oauth2").each do |g|
+ User.all.each do |user|
begin
- g.refresh_access_token("https://accounts.google.com/o/oauth2/token",ENV['OMNIAUTH_PROVIDER_KEY'],ENV['OMNIAUTH_PROVIDER_SECRET'])
+ user.refresh_access_token("https://accounts.google.com/o/oauth2/token",ENV['OMNIAUTH_PROVIDER_KEY'],ENV['OMNIAUTH_PROVIDER_SECRET'])
rescue
end
end
|
Correct refresh access token task. Old one was copypasta
|
diff --git a/lib/interactor.rb b/lib/interactor.rb
index abc1234..def5678 100644
--- a/lib/interactor.rb
+++ b/lib/interactor.rb
@@ -5,7 +5,6 @@ def self.included(base)
base.class_eval do
extend ClassMethods
- include InstanceMethods
attr_reader :context
end
@@ -17,39 +16,37 @@ end
end
- module InstanceMethods
- def initialize(context = {})
- @context = Context.build(context)
- setup
- end
+ def initialize(context = {})
+ @context = Context.build(context)
+ setup
+ end
- def setup
- end
+ def setup
+ end
- def perform
- end
+ def perform
+ end
- def rollback
- end
+ def rollback
+ end
- def success?
- context.success?
- end
+ def success?
+ context.success?
+ end
- def failure?
- context.failure?
- end
+ def failure?
+ context.failure?
+ end
- def fail!(*args)
- context.fail!(*args)
- end
+ def fail!(*args)
+ context.fail!(*args)
+ end
- def method_missing(method, *)
- context.fetch(method) { super }
- end
+ def method_missing(method, *)
+ context.fetch(method) { super }
+ end
- def respond_to_missing?(method, *)
- context.key?(method) || super
- end
+ def respond_to_missing?(method, *)
+ context.key?(method) || super
end
end
|
Remove excess module for instance methods
|
diff --git a/app/models/dessert_location.rb b/app/models/dessert_location.rb
index abc1234..def5678 100644
--- a/app/models/dessert_location.rb
+++ b/app/models/dessert_location.rb
@@ -11,4 +11,16 @@ def self.skip_check_attributes
["visited"]
end
+
+ def self.category_split_button_link
+ Rails.application.routes.url_helpers.send("#{self.table_name}_map_path")
+ end
+
+ def self.category_split_button_title
+ I18n.t("myplaceonline.general.map")
+ end
+
+ def self.category_split_button_icon
+ "navigation"
+ end
end
|
Add map button to dessert locations
|
diff --git a/app/controllers/api/v1/students_controller.rb b/app/controllers/api/v1/students_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/api/v1/students_controller.rb
+++ b/app/controllers/api/v1/students_controller.rb
@@ -9,7 +9,10 @@
if registration.valid?
registration.save
- render :json => registration.attributes
+ attributes = registration.attributes
+ attributes.delete(:password)
+ attributes.delete(:password_confirmation)
+ render :json => attributes
else
error(registration.errors)
end
|
Remove password from registration response
There does not seem to be a need for sending the password back in plain text
[#135156275]
|
diff --git a/lib/squeezable.rb b/lib/squeezable.rb
index abc1234..def5678 100644
--- a/lib/squeezable.rb
+++ b/lib/squeezable.rb
@@ -3,9 +3,8 @@ def squeeze
result = []
previous = nil
- iterator = self.each
- loop do
- a = iterator.next
+ for i in (0...self.length)
+ a = self[i]
result << a unless previous == a
previous = a
end
|
Use for loop instead of iterator for Squeezable.
|
diff --git a/refinerycms-news.gemspec b/refinerycms-news.gemspec
index abc1234..def5678 100644
--- a/refinerycms-news.gemspec
+++ b/refinerycms-news.gemspec
@@ -13,7 +13,7 @@ s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- spec/*`.split("\n")
- s.add_dependency 'refinerycms-core', '~> 2.1.0.dev'
- s.add_dependency 'refinerycms-settings', '~> 2.1.0.dev'
+ s.add_dependency 'refinerycms-core', '~> 2.1.0'
+ s.add_dependency 'refinerycms-settings', '~> 2.1.0'
s.add_dependency 'friendly_id', '~> 4.0.9'
end
|
Use non dev version for Refinery extension versions.
|
diff --git a/lib/tasks/db.rake b/lib/tasks/db.rake
index abc1234..def5678 100644
--- a/lib/tasks/db.rake
+++ b/lib/tasks/db.rake
@@ -3,9 +3,9 @@ namespace :db do
desc 'Bootstrap the database for the current RAILS_ENV (create, setup & seed if the database does not exist)'
task bootstrap: :environment do
+ Rake::Task['db:create'].invoke
if ActiveRecord::Base.connection.tables.empty?
puts 'Bootstrapping the database...'
- Rake::Task['db:create'].invoke
Rake::Task['db:setup'].invoke
Rake::Task['db:seed'].invoke
else
|
Fix database setup in dev-env
The postgres image does not come with pre-configured osem
databases per environment. Calling db:create doesn't hurt if the
databases already exist, so let's do it every time we bootstrap.
|
diff --git a/hero_mapper/app/controllers/heroes_controller.rb b/hero_mapper/app/controllers/heroes_controller.rb
index abc1234..def5678 100644
--- a/hero_mapper/app/controllers/heroes_controller.rb
+++ b/hero_mapper/app/controllers/heroes_controller.rb
@@ -13,19 +13,11 @@ # Will need to offset by 100 every call, 15 times to populate database
# Some results are organizations such as H.Y.D.R.A
# Some comics are collections of individual issues
- # url = "https://gateway.marvel.com:443/v1/public/characters?limit=100&offset=10&ts=#{timestamp}&apikey=#{ENV['MARVEL_PUBLIC']}&hash=#{marvel_hash}"
- # debugger
- # uri = URI(url)
- # response = Net::HTTP.get(uri)
- # @response = JSON.parse(response)
- # render json: JSON.parse(response)
-
- # test
- # <% @response['data']['results'].each do |hero| %>
- # <%= hero['name'] %>
- # <% end %>
- # render "heroes"
- Heroe.save_hero_data
+ api_data_total = Heroe.marvel_api_call['data']['total']
+ if api_data_total > Heroe.count
+ Heroe.save_hero_data
+ end
+
end
end
|
Create condition to only save to database when there are new entries
|
diff --git a/redic.gemspec b/redic.gemspec
index abc1234..def5678 100644
--- a/redic.gemspec
+++ b/redic.gemspec
@@ -6,9 +6,10 @@ s.summary = "Lightweight Redis Client"
s.description = "Lightweight Redis Client"
s.authors = ["Michel Martens", "Cyril David"]
- s.email = ["michel@soveran.com", "me@cyrildavid.com"]
+ s.email = ["michel@soveran.com", "cyx@cyx.is"]
s.homepage = "https://github.com/amakawa/redic"
s.files = `git ls-files`.split("\n")
s.license = "MIT"
- s.add_dependency "redis"
+
+ s.add_dependency "hiredis"
end
|
Update cyx email, and the dependencies.
|
diff --git a/Casks/protege.rb b/Casks/protege.rb
index abc1234..def5678 100644
--- a/Casks/protege.rb
+++ b/Casks/protege.rb
@@ -2,7 +2,7 @@ version '5.0.0'
sha256 'cc5dc98cb41a59fb86a710a61249437f1f9d1b4b79eb989b1ff5055df0722540'
- # https://github.com/protegeproject/protege-distribution was verified as official when first introduced to the cask
+ # github.com/protegeproject/protege-distribution was verified as official when first introduced to the cask
url "https://github.com/protegeproject/protege-distribution/releases/download/protege-#{version}/Protege-#{version}-os-x.zip"
appcast 'https://github.com/protegeproject/protege-distribution/releases.atom',
checkpoint: '85a7963eb388f3eaca03ab284323423a4c3659fa2939b183c1a46ef222c6293c'
|
Fix `url` stanza comment for Protégé.
|
diff --git a/spec/decorators/app_decorator_spec.rb b/spec/decorators/app_decorator_spec.rb
index abc1234..def5678 100644
--- a/spec/decorators/app_decorator_spec.rb
+++ b/spec/decorators/app_decorator_spec.rb
@@ -21,4 +21,18 @@ subject.participating_brigade_links.should == ''
end
end
+
+ describe '#picture_gallary' do
+
+ it 'returns nil when there are no pictures' do
+ application = AppDecorator.new(FactoryGirl.build(:application))
+ application.picture_gallary.should be_nil
+ end
+
+ it 'returns raw html for a picture gallary when there is more than one picture' do
+ VCR.use_cassette(:s3_file_save) { @app_with_pics = FactoryGirl.create(:application_with_four_pictures) }
+ application_with_pictures = AppDecorator.new(@app_with_pics)
+ application_with_pictures.picture_gallary.should match /ul class="thumbnails"/
+ end
+ end
end
|
Add more test coverage for app decorator's picture_gallary method
|
diff --git a/spec/features/manage_comments_spec.rb b/spec/features/manage_comments_spec.rb
index abc1234..def5678 100644
--- a/spec/features/manage_comments_spec.rb
+++ b/spec/features/manage_comments_spec.rb
@@ -1,3 +1,4 @@+# encoding: UTF-8
require 'acceptance_helper'
feature 'Managing comments' do
|
Fix specs for ruby 1.9.
|
diff --git a/spec/processor/data_processor_spec.rb b/spec/processor/data_processor_spec.rb
index abc1234..def5678 100644
--- a/spec/processor/data_processor_spec.rb
+++ b/spec/processor/data_processor_spec.rb
@@ -0,0 +1,20 @@+require 'spec_helper_lite'
+require 'processor/data_processor'
+
+describe Processor::DataProcessor do
+ it "should have a name equals to underscored class name" do
+ subject.name.should eq "processor_data_processor"
+ end
+
+ it "should be done when there are 0 records to process" do
+ records = []
+ subject.done?(records).should be true
+ end
+
+ %w[done? fetch_records total_records process].each do |method_name|
+ it "should respond to #{method_name}" do
+ subject.should respond_to method_name
+ end
+ end
+end
+
|
Add missing tests to DataProcessor
|
diff --git a/Formula/gsoap.rb b/Formula/gsoap.rb
index abc1234..def5678 100644
--- a/Formula/gsoap.rb
+++ b/Formula/gsoap.rb
@@ -0,0 +1,17 @@+require 'formula'
+
+class Gsoap < Formula
+ url 'http://downloads.sourceforge.net/project/gsoap2/gSOAP/gsoap_2.8.6.zip'
+ homepage 'http://www.cs.fsu.edu/~engelen/soap.html'
+ md5 'c0b962c6216bcf59255dc4288783252f'
+
+ def install
+ ENV.deparallelize
+ system './configure', "--prefix=#{prefix}"
+ system 'make install'
+ end
+
+ def test
+ system "soapcpp2 -v"
+ end
+end
|
Add gSOAP formula, version 2.8.6
Closes Homebrew/homebrew#6210.
Signed-off-by: Mike McQuaid <a17fed27eaa842282862ff7c1b9c8395a26ac320@mikemcquaid.com>
|
diff --git a/hephaestus/lib/tasks/process.rake b/hephaestus/lib/tasks/process.rake
index abc1234..def5678 100644
--- a/hephaestus/lib/tasks/process.rake
+++ b/hephaestus/lib/tasks/process.rake
@@ -31,6 +31,12 @@ process(MentionsFinderTask)
end
+ desc 'Run indexer task for all documents available'
+ task indexer: :environment do
+ IndexerTask.create_index force: true
+ process(IndexerTask)
+ end
+
desc 'Run all tasks for all documets'
task all: :environment do
Rake::Task["process:extraction"].invoke
|
[hephaestus] Add indexer task to cli tasks
|
diff --git a/spec/puppet-lint/plugins/check_strings/puppet_url_without_modules_spec.rb b/spec/puppet-lint/plugins/check_strings/puppet_url_without_modules_spec.rb
index abc1234..def5678 100644
--- a/spec/puppet-lint/plugins/check_strings/puppet_url_without_modules_spec.rb
+++ b/spec/puppet-lint/plugins/check_strings/puppet_url_without_modules_spec.rb
@@ -26,7 +26,7 @@ context 'double string wrapped puppet:// urls' do
let(:code) { File.read('spec/fixtures/test/manifests/url_interpolation.pp') }
- it 'should only detect a single problem' do
+ it 'should detect several problems' do
expect(problems).to have(4).problem
end
|
Fix the spec name again
|
diff --git a/spec/support/utilities.rb b/spec/support/utilities.rb
index abc1234..def5678 100644
--- a/spec/support/utilities.rb
+++ b/spec/support/utilities.rb
@@ -2,10 +2,10 @@ match do |events|
events.select { |event| event.name.to_s == expected.to_s }.any?
end
- failure_message_for_should do |events|
+ failure_message do |events|
"expected that #{event_names(events)} would contain an event with the name #{expected}"
end
- failure_message_for_should_not do |events|
+ failure_message_when_negated do |events|
"expected that #{event_names(events)} would not contain an event with the name #{expected}"
end
|
Convert specs to RSpec 3.4.4 syntax with Transpec
This conversion is done by Transpec 3.2.1 with the following command:
transpec
* 1 conversion
from: failure_message_for_should { }
to: failure_message { }
* 1 conversion
from: failure_message_for_should_not { }
to: failure_message_when_negated { }
For more details: https://github.com/yujinakayama/transpec#supported-conversions
|
diff --git a/messaging.gemspec b/messaging.gemspec
index abc1234..def5678 100644
--- a/messaging.gemspec
+++ b/messaging.gemspec
@@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = 'messaging'
- s.version = '0.4.1.1'
+ s.version = '0.5.0.0'
s.summary = 'Messaging primitives for Eventide'
s.description = ' '
|
Package version increased from 0.4.1.1 to 0.5.0.0
|
diff --git a/db/data_migration/20150615092751_replace_policy_admin_links.rb b/db/data_migration/20150615092751_replace_policy_admin_links.rb
index abc1234..def5678 100644
--- a/db/data_migration/20150615092751_replace_policy_admin_links.rb
+++ b/db/data_migration/20150615092751_replace_policy_admin_links.rb
@@ -20,7 +20,7 @@
edition_ids = Edition.where(state: Edition::PUBLICLY_VISIBLE_STATES + Edition::PRE_PUBLICATION_STATES).pluck(:id)
-edition_ids.each_slice(50).with_index do |ids, index|
+edition_ids.each_slice(1000).with_index do |ids, index|
puts "Starting batch #{index}"
pid = fork do
|
Increase the batch size of admin URL data migration.
Increasing from 50 to 1000 increases the transient
memory usage from 350MB to 550MB but decreases the
time per 1000 editions from 50s to 30s.
|
diff --git a/lib/contentful_middleman/version_hash.rb b/lib/contentful_middleman/version_hash.rb
index abc1234..def5678 100644
--- a/lib/contentful_middleman/version_hash.rb
+++ b/lib/contentful_middleman/version_hash.rb
@@ -12,7 +12,7 @@
def write_for_space_with_entries(space_name, entries)
sorted_entries = entries.sort {|a, b| a.id <=> b.id}
- ids_and_revisions_string = sorted_entries.map {|e| "#{e.id}#{e.revision}"}.join
+ ids_and_revisions_string = sorted_entries.map {|e| "#{e.id}#{e.updated_at}"}.join
entries_hash = Digest::SHA1.hexdigest( ids_and_revisions_string )
File.open(hashfilename(space_name), 'w') { |file| file.write(entries_hash) }
|
Use the updated_at value rather than the version to calculate the hash
When using the preview api the revision field won't change unless the
entry is republished. This meant that even if the data in the entries
changed the version hash would stay the same
|
diff --git a/ruby/lumidatum_client/lumidatum_client.gemspec b/ruby/lumidatum_client/lumidatum_client.gemspec
index abc1234..def5678 100644
--- a/ruby/lumidatum_client/lumidatum_client.gemspec
+++ b/ruby/lumidatum_client/lumidatum_client.gemspec
@@ -4,7 +4,7 @@
Gem::Specification.new do |spec|
spec.name = "lumidatum_client"
- spec.version = "0.1.0"
+ spec.version = "0.1.2"
spec.authors = ["Mat Lee"]
spec.email = ["matt@lumidatum.com"]
spec.summary = %q{}
@@ -16,4 +16,6 @@ spec.executables = ["lumidatum_client"]
spec.test_files = ["tests/test_client_unit_tests.rb"]
spec.require_paths = ["lib"]
+
+ spec.add_runtime_dependency("httpclient", "~> 2.8")
end
|
Fix for dependency installation failure.
|
diff --git a/spec/routing/catch_all_spec.rb b/spec/routing/catch_all_spec.rb
index abc1234..def5678 100644
--- a/spec/routing/catch_all_spec.rb
+++ b/spec/routing/catch_all_spec.rb
@@ -24,4 +24,13 @@ path: 'foo/bar/baz'
)
end
+
+ it 'GET /foo/bar.js' do
+ expect(get: '/foo/bar.js').to route_to(
+ controller: 'catch_all',
+ action: 'resolve',
+ path: 'foo/bar',
+ format: 'js'
+ )
+ end
end
|
Tweak the catch all routing spec.
|
diff --git a/lib/generators/mtgextractor_generator.rb b/lib/generators/mtgextractor_generator.rb
index abc1234..def5678 100644
--- a/lib/generators/mtgextractor_generator.rb
+++ b/lib/generators/mtgextractor_generator.rb
@@ -2,10 +2,11 @@
module MTGExtractor
class MTGExtractorGenerator < ::Rails::Generators::Base
+ namespace 'mtgextractor'
+
include Rails::Generators::Migration
source_root File.expand_path('../templates', __FILE__)
- desc "add the migrations"
def self.next_migration_number(path)
unless @prev_migration_nr
@prev_migration_nr = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i
@@ -15,14 +16,17 @@ @prev_migration_nr.to_s
end
- def create_migration_file
+ def create_migration_files
migration_template "create_cards.rb", "db/migrate/create_cards.rb"
end
def copy_card_classes
copy_file "card.rb", "app/models/card.rb"
- copy_file "set.rb", "app/models/set.rb"
- copy_file "card_type.rb", "app/models/card_type.rb"
+ end
+
+ def install
+ create_migration_files
+ copy_card_classes
end
end
end
|
Test working generator with just card class and migration
|
diff --git a/spec/acceptance/server_spec.rb b/spec/acceptance/server_spec.rb
index abc1234..def5678 100644
--- a/spec/acceptance/server_spec.rb
+++ b/spec/acceptance/server_spec.rb
@@ -3,7 +3,11 @@ describe 'stns::server class' do
let(:manifest) {
<<-EOS
- include ::stns::server
+ class { '::stns::server':
+ port => 1104,
+ user => 'sample',
+ password => 's@mp1e',
+ }
EOS
}
@@ -31,9 +35,9 @@
describe file('/etc/stns/stns.conf') do
it { should be_file }
- its(:content) { should match /^port\s+=\s+\d+$/ }
- its(:content) { should match /^user\s+=\s+".*"$/ }
- its(:content) { should match /^password\s+=\s+".*"$/ }
+ its(:content) { should match /^port\s+=\s+1104$/ }
+ its(:content) { should match /^user\s+=\s+"sample"$/ }
+ its(:content) { should match /^password\s+=\s+"s@mp1e"$/ }
end
describe service('stns') do
|
Customize parameters on acceptance tests
|
diff --git a/spec/support/spec_perimeter.rb b/spec/support/spec_perimeter.rb
index abc1234..def5678 100644
--- a/spec/support/spec_perimeter.rb
+++ b/spec/support/spec_perimeter.rb
@@ -7,9 +7,9 @@ can :view, String
end
- subscribe :dining, :eat, :evented
- subscribe :puppets, :dress, ->(event) {
- @dressed = true
+ subscribe :eating, :eat, :evented
+ subscribe :puppets, :play, ->(event, purpose) {
+ purpose.sandbox.testing.dress!
}
# should pass and return the child
@@ -47,9 +47,17 @@ @evented == true ? true : false
end
+ expose :dress!
+ def dress!
+ unguarded
+ @dressed = true
+ end
+
def puppet_dressed?
+ unguarded
@dressed == true ? true : false
end
sandbox :sandboxed, :not_guarded, :guarded, :unsafe, :evented
+ expose :puppet_dressed?
end
|
Make relaying of events testable
|
diff --git a/spec/hosts/environment_spec.rb b/spec/hosts/environment_spec.rb
index abc1234..def5678 100644
--- a/spec/hosts/environment_spec.rb
+++ b/spec/hosts/environment_spec.rb
@@ -4,7 +4,8 @@ context 'without an explicit environment setting' do
it { should contain_file('environment').with_path('rp_env') }
end
- context 'when specifying an explicit environment' do
+ # Broken on ~> 3.8.5 since PUP-5522
+ context 'when specifying an explicit environment', :unless => (Puppet.version >= '3.8.5' && Puppet.version.to_i < 4) do
let(:environment) { 'test_env' }
it { should contain_file('environment').with_path('test_env') }
it { should contain_file('conditional_file') }
|
Disable environment override test on Puppet ~> 3.8.5
Broken since PUP-5522 (puppetlabs/puppet@8136aff1), without a clear
solution.
|
diff --git a/manifests/cf-manifest/spec/manifest/release_versions_spec.rb b/manifests/cf-manifest/spec/manifest/release_versions_spec.rb
index abc1234..def5678 100644
--- a/manifests/cf-manifest/spec/manifest/release_versions_spec.rb
+++ b/manifests/cf-manifest/spec/manifest/release_versions_spec.rb
@@ -0,0 +1,23 @@+require 'uri'
+
+RSpec.describe "release versions" do
+ matcher :match_version_from_url do |url|
+ match do |version|
+ if url =~ %r{\?v=(.+)\z}
+ url_version = $1
+ elsif url =~ %r{-([\d.]+)\.tgz\z}
+ url_version = $1
+ else
+ raise "Failed to extract version from URL '#{url}'"
+ end
+ version == url_version
+ end
+ end
+
+ specify "release versions match their download URL version" do
+ manifest_with_defaults.fetch("releases").each do |release|
+ expect(release.fetch('version')).to match_version_from_url(release.fetch('url')),
+ "expected release #{release['name']} version #{release['version']} to have matching version in URL: #{release['url']}"
+ end
+ end
+end
|
Add test that release versions match URLs
We've hit problems where release URLs get updated, but the corresponding
version field doesn't. This adds a test to catch this early.
|
diff --git a/lib/server_metrics/collectors/network.rb b/lib/server_metrics/collectors/network.rb
index abc1234..def5678 100644
--- a/lib/server_metrics/collectors/network.rb
+++ b/lib/server_metrics/collectors/network.rb
@@ -9,7 +9,7 @@ lines.each do |line|
iface, rest = line.split(':', 2).collect { |e| e.strip }
interfaces << iface
- next unless iface =~ /venet|eth/
+ next if iface =~ /lo/
found = true
cols = rest.split(/\s+/)
|
Change from whitelisting to blacklisting interfaces. Exclude only loopback interface by default
|
diff --git a/lib/carrierwave/storage/webdav.rb b/lib/carrierwave/storage/webdav.rb
index abc1234..def5678 100644
--- a/lib/carrierwave/storage/webdav.rb
+++ b/lib/carrierwave/storage/webdav.rb
@@ -29,7 +29,7 @@ true
end
def url(options = {})
- "http://files.redcursor.net/#{path}"
+ "https://redcursor.net/#{path}"
end
end
|
Make new file URLS default to main host and https
|
diff --git a/private_address_check.gemspec b/private_address_check.gemspec
index abc1234..def5678 100644
--- a/private_address_check.gemspec
+++ b/private_address_check.gemspec
@@ -17,7 +17,7 @@ spec.files = Dir.glob("{lib,test}/**/*.rb") + %w[CODE_OF_CONDUCT.md Gemfile LICENSE.txt README.md Rakefile]
spec.require_paths = ["lib"]
- spec.required_ruby_version ">= 2.0.0"
+ spec.required_ruby_version = ">= 2.0.0"
spec.add_development_dependency "bundler", "~> 1.12"
spec.add_development_dependency "rake", "~> 10.0"
|
Fix error in gemspec with specifying Ruby version
|
diff --git a/spec/integration/okapi.rb b/spec/integration/okapi.rb
index abc1234..def5678 100644
--- a/spec/integration/okapi.rb
+++ b/spec/integration/okapi.rb
@@ -3,6 +3,7 @@ describe Okapi do
class TestClass
attr_accessor :username
+ attr_hider :password
def initialize(username, password)
@username = username
@@ -10,7 +11,16 @@ end
end
- it "should show the name and value of the username"
+ before do
+ @instance = TestClass.new('myusername', 'mypassword')
+ @inspect = @instance.inspect
+ end
- it "should not show the name neither the value of the username"
+ it "should show the name and value of the username" do
+ @inspect.should =~ /@username=\"myusername\"/
+ end
+
+ it "should not show the name neither the value of the username" do
+ @inspect.should_not =~ /@password=\"mypassword\"/
+ end
end
|
Implement tests for the behaviour
|
diff --git a/spec/features/phenotype_recommendation_spec.rb b/spec/features/phenotype_recommendation_spec.rb
index abc1234..def5678 100644
--- a/spec/features/phenotype_recommendation_spec.rb
+++ b/spec/features/phenotype_recommendation_spec.rb
@@ -0,0 +1,63 @@+RSpec.feature 'Phenotype recommendation' do
+ let!(:user) { create(:user) }
+ let!(:phenotype1) do
+ create(:phenotype, characteristic: 'Eye count',
+ description: 'How many eyes do you have?')
+ end
+ let!(:phenotype2) do
+ create(:phenotype, characteristic: 'Tentacle count',
+ description: 'How many tentacles do you have?')
+ end
+ let!(:phenotype3) do
+ create(:phenotype, characteristic: 'Beard color',
+ description: 'What is the color of your beard?')
+ end
+ let(:other_user) { create(:user) }
+
+ before do
+ sign_in(user)
+
+ create(:user_phenotype, user: other_user, phenotype: phenotype1, variation: '10')
+ create(:user_phenotype, user: other_user, phenotype: phenotype2, variation: '1000')
+ create(:user_phenotype, user: other_user, phenotype: phenotype3, variation: 'red')
+
+ PhenotypeRecommender.new.update
+ VariationRecommender.new.update
+ end
+
+ scenario 'the user enters a new variation' do
+ visit('/phenotypes')
+ click_on('Eye count')
+ # fill_in('Enter your phenotype now', with: '10') # TODO: Make this work
+ fill_in('user_phenotype[variation]', with: '10')
+ click_on('Submit your variation')
+
+ expect(page).to have_content('Similar Variations')
+ expect(page).to have_content((<<-TXT).strip_heredoc)
+ You have just entered that 10 is your variation for the phenotype Eye \
+ count. Below you can find 2 phenotypes and the answers which are \
+ most-often entered by users who also gave 10 as their variation for Eye \
+ count.
+ TXT
+ expect(page).to have_content((<<-TXT).strip_heredoc)
+ Tentacle count Users with phenotypic variation similar to yours often \
+ gave 1000 as variation for this phenotype. What about you?
+ TXT
+ expect(page).to have_content((<<-TXT).strip_heredoc)
+ Beard color Users with phenotypic variation similar to yours often gave \
+ red as variation for this phenotype. What about you?
+ TXT
+
+ expect(page).to have_content('Similar Phenotypes')
+ expect(page).to have_content((<<-TXT).strip_heredoc)
+ Below you can find 2 phenotypes which are often entered by users who \
+ provided us with any information about Eye count.
+ TXT
+ expect(page).to have_content(
+ 'Tentacle count Description: How many tentacles do you have?'
+ )
+ expect(page).to have_content(
+ 'Beard color Description: What is the color of your beard?'
+ )
+ end
+end
|
Add test for phenotype/variation recommendation
|
diff --git a/lib/yaccl/model/object_factory.rb b/lib/yaccl/model/object_factory.rb
index abc1234..def5678 100644
--- a/lib/yaccl/model/object_factory.rb
+++ b/lib/yaccl/model/object_factory.rb
@@ -4,8 +4,10 @@ def self.create(repository_id, raw)
base_type_id = if raw[:properties]
raw[:properties][:'cmis:baseTypeId'][:value]
+ elsif raw[:succinctProperties]
+ raw[:succinctProperties][:'cmis:baseTypeId']
else
- raw[:succinctProperties][:'cmis:baseTypeId']
+ raise "Unexpected raw: #{raw}"
end
case base_type_id
|
Raise when raw body nonsensical.
|
diff --git a/app/models/user.rb b/app/models/user.rb
index abc1234..def5678 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -4,7 +4,7 @@ validates :username, presence: { message: "Username field can't be left blank"}, length: { in: 4..15, message: 'Username must be between 4-15 characters in length' }, uniqueness: { message: 'Username is already taken'}
# email validation still needs email format validation
validates :email, presence: { message: "Email can't be left blank" }, uniqueness: { message: "Email is already taken"}
- validates :password, presence: true, length: { in: 4..10 }
+ validates :password, presence: { message: "Password field can't be left blank" }, length: { in: 4..10, message: "Password must be between 4-15 characters in length" }
- has_secure_password
+ has_secure_password validations: false
end
|
Update User model password validations. Turn off has_secure_password validations to avoid repeat error for empty password field
|
diff --git a/library/drb/start_service_spec.rb b/library/drb/start_service_spec.rb
index abc1234..def5678 100644
--- a/library/drb/start_service_spec.rb
+++ b/library/drb/start_service_spec.rb
@@ -3,35 +3,26 @@ require 'drb'
describe "DRb.start_service" do
- before :all do
- @port = 9001 + (Process.pid & 7 )
+ before :each do
+ @server = DRb.start_service("druby://localhost:0", TestServer.new)
end
- before :each do
- @url = "druby://localhost:#{@port}"
- @port += 1
+ after :each do
+ DRb.stop_service if @server
end
it "runs a basic remote call" do
- lambda { DRb.current_server }.should raise_error(DRb::DRbServerNotFound)
- server = DRb.start_service(@url, TestServer.new)
- DRb.current_server.should == server
- obj = DRbObject.new(nil, @url)
+ DRb.current_server.should == @server
+ obj = DRbObject.new(nil, @server.uri)
obj.add(1,2,3).should == 6
- DRb.stop_service
- lambda { DRb.current_server }.should raise_error(DRb::DRbServerNotFound)
end
it "runs a basic remote call passing a block" do
- lambda { DRb.current_server }.should raise_error(DRb::DRbServerNotFound)
- server = DRb.start_service(@url, TestServer.new)
- DRb.current_server.should == server
- obj = DRbObject.new(nil, @url)
+ DRb.current_server.should == @server
+ obj = DRbObject.new(nil, @server.uri)
obj.add_yield(2) do |i|
i.should == 2
i+1
end.should == 4
- DRb.stop_service
- lambda { DRb.current_server }.should raise_error(DRb::DRbServerNotFound)
end
end
|
Fix DRb.start_service to use any available port
git-svn-id: ab86ecd26fe50a6a239cacb71380e346f71cee7d@58995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
diff --git a/app/models/user.rb b/app/models/user.rb
index abc1234..def5678 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -5,6 +5,8 @@ has_many :comments
has_many :votes
+ validates :name, presence: true, length: {in: 8..20}
+ validates :email, presence: true
end
|
Include validations for name and email
|
diff --git a/app/models/vote.rb b/app/models/vote.rb
index abc1234..def5678 100644
--- a/app/models/vote.rb
+++ b/app/models/vote.rb
@@ -1,4 +1,6 @@ class Vote < ActiveRecord::Base
belongs_to :user
belongs_to :votable, polymorphic: true
+
+ validates :is_up, :user_id, :votable_id, presence: true
end
|
Add validations to Vote model
|
diff --git a/lib/capybara/rspec/features.rb b/lib/capybara/rspec/features.rb
index abc1234..def5678 100644
--- a/lib/capybara/rspec/features.rb
+++ b/lib/capybara/rspec/features.rb
@@ -1,28 +1,45 @@-module Capybara
- module Features
- def self.included(base)
- base.instance_eval do
- alias :background :before
- alias :scenario :it
- alias :xscenario :xit
- alias :given :let
- alias :given! :let!
- alias :feature :describe
+if RSpec::Version::STRING.to_f >= 3.0
+ RSpec.shared_context "Capybara Features", :capybara_feature => true do
+ instance_eval do
+ alias background before
+ alias given let
+ alias given! let!
+ end
+ end
+
+ RSpec.configure do |config|
+ config.alias_example_group_to :feature, :capybara_feature => true, :type => :feature
+ config.alias_example_to :scenario
+ config.alias_example_to :xscenario, :skip => "Temporarily disabled with xscenario"
+ # config.alias_example_to :fscenario, :focus => true
+ end
+else
+ module Capybara
+ module Features
+ def self.included(base)
+ base.instance_eval do
+ alias :background :before
+ alias :scenario :it
+ alias :xscenario :xit
+ alias :given :let
+ alias :given! :let!
+ alias :feature :describe
+ end
end
end
end
-end
-def self.feature(*args, &block)
- options = if args.last.is_a?(Hash) then args.pop else {} end
- options[:capybara_feature] = true
- options[:type] = :feature
- options[:caller] ||= caller
- args.push(options)
+ def self.feature(*args, &block)
+ options = if args.last.is_a?(Hash) then args.pop else {} end
+ options[:capybara_feature] = true
+ options[:type] = :feature
+ options[:caller] ||= caller
+ args.push(options)
- #call describe on RSpec in case user has expose_dsl_globally set to false
- RSpec.describe(*args, &block)
-end
+ #call describe on RSpec in case user has expose_dsl_globally set to false
+ RSpec.describe(*args, &block)
+ end
-RSpec.configuration.include Capybara::Features, :capybara_feature => true
+ RSpec.configuration.include Capybara::Features, :capybara_feature => true
+end
|
Support RSpec expose_dsl_globally configuration option
|
diff --git a/lib/halfday/yard/capistrano.rb b/lib/halfday/yard/capistrano.rb
index abc1234..def5678 100644
--- a/lib/halfday/yard/capistrano.rb
+++ b/lib/halfday/yard/capistrano.rb
@@ -1,17 +1,19 @@ Capistrano::Configuration.instance(:must_exist).load do
- after 'deploy:create_symlink', 'yard:generate'
+ if defined?(Yard)
+ after 'deploy:create_symlink', 'yard:generate'
- namespace :yard do
+ namespace :yard do
- desc "Update the documentation alone before a release`"
- task :generate, :roles => :app do
- # Build the documentation for the application and make it public
- run "mkdir #{current_path}/doc"
- run "cd #{current_path} && #{bundle_cmd} exec yard doc RAILS_ENV=#{stage}"
- run "mv #{current_path}/doc #{current_path}/public/doc"
+ desc "Update the documentation alone before a release`"
+ task :generate, :roles => :app do
+ # Build the documentation for the application and make it public
+ run "mkdir #{current_path}/doc"
+ run "cd #{current_path} && #{bundle_cmd} exec yard doc RAILS_ENV=#{stage}"
+ run "mv #{current_path}/doc #{current_path}/public/doc"
+ end
+
end
-
end
end
|
Stop running yard:generate unless Yard is defined
|
diff --git a/lib/lyricfy/providers/wikia.rb b/lib/lyricfy/providers/wikia.rb
index abc1234..def5678 100644
--- a/lib/lyricfy/providers/wikia.rb
+++ b/lib/lyricfy/providers/wikia.rb
@@ -17,9 +17,13 @@
private
+ def prepare_parameter(parameter)
+ a = parameter.gsub(/\W/, '')
+ end
+
def format_parameters
- artist_name = tilde_to_vocal(self.parameters[:artist_name]).gsub(" ", "_")
- song_name = tilde_to_vocal(self.parameters[:song_name]).gsub(" ", "_")
+ artist_name = prepare_parameter(tilde_to_vocal(self.parameters[:artist_name]).gsub(" ", "_"))
+ song_name = prepare_parameter(tilde_to_vocal(self.parameters[:song_name]).gsub(" ", "_"))
"#{artist_name}:#{song_name}"
end
|
Replace any non-word in parameters for Wikia
|
diff --git a/lib/ws_light/set/random_set.rb b/lib/ws_light/set/random_set.rb
index abc1234..def5678 100644
--- a/lib/ws_light/set/random_set.rb
+++ b/lib/ws_light/set/random_set.rb
@@ -13,9 +13,8 @@ end
def generate_set
- length = type == :double ? Strip::LENGTH * 2 : Strip::LENGTH
set = []
- length.times do
+ @full_length.times do
set << Color.random
end
set
|
[BUGFIX] Use existing full_length instance var
|
diff --git a/vagrant/prompt_example.rb b/vagrant/prompt_example.rb
index abc1234..def5678 100644
--- a/vagrant/prompt_example.rb
+++ b/vagrant/prompt_example.rb
@@ -0,0 +1,15 @@+Vagrant.configure('2') do |config|
+
+ # Use %q to avoid nested here-doc issue with vim-ruby syntax highlighting.
+ config.vm.provision :shell, :inline => %q!
+cat <<BASHRC > /home/vagrant/.bashrc.local
+# prompt
+PS1='\[\033[00;01m \u@\h:\w \033[00m\]\n\$ '
+BASHRC
+
+line="source /home/vagrant/.bashrc.local"
+file="/home/vagrant/.bashrc"
+grep -qFx "$line" "$file" || echo "$line" >> "$file"
+ !
+
+end
|
Add an example to show how to customize vagrant prompt
|
diff --git a/test/features/list_overheards_test.rb b/test/features/list_overheards_test.rb
index abc1234..def5678 100644
--- a/test/features/list_overheards_test.rb
+++ b/test/features/list_overheards_test.rb
@@ -2,12 +2,23 @@
class TestListOverheards < FeatureTest
def test_visiting_the_home_page_reveals_overheards
-
Overheard.create({ :body => "Well, when you put it that way I am a horrible person..."})
visit "/"
assert_content "Well, when you put it that way"
+ end
+
+ def test_searching_for_overheards_from_the_home_page
+ Overheard.create({ :body => "Foo"})
+ Overheard.create({ :body => "Baz"})
+
+ visit "/"
+ fill_in "Search", { :with => "Foo" }
+ click_on "Search Overheards"
+
+ assert_content "Foo"
+ refute_content "Baz"
end
def test_listing_overheards_as_json
|
Write test for user searching Overheards
First things first, we write a test. Here we're expecting the page to
have:
1. Have an input field labeled `Search`
2. A button labeled `Search Overheards`
Once the `Search Overheards` button is clicked; we're expecting to
*only* see quotes which have the word "Foo" in them.
|
diff --git a/promo/app/controllers/spree/checkout_controller_decorator.rb b/promo/app/controllers/spree/checkout_controller_decorator.rb
index abc1234..def5678 100644
--- a/promo/app/controllers/spree/checkout_controller_decorator.rb
+++ b/promo/app/controllers/spree/checkout_controller_decorator.rb
@@ -22,19 +22,19 @@ state_callback(:after)
else
flash[:error] = t(:payment_processing_failed)
- respond_with(@order, :location => checkout_state_path(@order.state))
+ redirect_to checkout_state_path(@order.state)
return
end
if @order.state == 'complete' || @order.completed?
flash.notice = t(:order_processed_successfully)
flash[:commerce_tracking] = 'nothing special'
- respond_with(@order, :location => completion_route)
+ redirect_to completion_route
else
- respond_with(@order, :location => checkout_state_path(@order.state))
+ redirect_to checkout_state_path(@order.state)
end
else
- respond_with(@order) { |format| format.html { render :edit } }
+ render :edit
end
end
|
[promo] Remove excessive respond_with usage in CheckoutControllerDecorator
|
diff --git a/spec/integration_spec.rb b/spec/integration_spec.rb
index abc1234..def5678 100644
--- a/spec/integration_spec.rb
+++ b/spec/integration_spec.rb
@@ -32,11 +32,11 @@ end
before do
- described_class.setup(Db.shards_config)
+ Post.setup(Db.shards_config)
end
after do
- described_class.disconnect_all
+ Post.handler.disconnect_all
end
context 'no shard set' do
@@ -49,11 +49,11 @@
context 'shard set' do
it 'executes the query on the selected shard' do
- described_class.using('shard1') do
+ Post.using('shard1') do
expect(Post.pluck(:title)).to eql(['post from shard1'])
end
- described_class.using('shard2') do
+ Post.using('shard2') do
expect(Post.pluck(:title)).to eql(['post from shard2'])
end
end
|
Test inherited class on integration spec
|
diff --git a/features/support/steps/cli_steps.rb b/features/support/steps/cli_steps.rb
index abc1234..def5678 100644
--- a/features/support/steps/cli_steps.rb
+++ b/features/support/steps/cli_steps.rb
@@ -5,12 +5,9 @@ def _execute(exec)
Dir.chdir(@__root) do
Bundler.with_clean_env do
- Open3.popen2e(exec) do |_, stdout_err, wait_thr|
- exit_status = wait_thr.value
- stdout_err = stdout_err.read
+ out, err, status = Open3.capture3('bash', '-lc', exec)
- @last_process = [exit_status.to_i, stdout_err]
- end
+ @last_process = [Integer(status), out, err]
end
end
end
|
Adjust steps to run on JRuby
|
diff --git a/symfony/recipes/daemon.rb b/symfony/recipes/daemon.rb
index abc1234..def5678 100644
--- a/symfony/recipes/daemon.rb
+++ b/symfony/recipes/daemon.rb
@@ -16,7 +16,7 @@ if daemon[:symfony].present? and !daemon[:symfony]
cmd = "#{daemon[:command]}"
else
- cmd = "#{deploy[:deploy_to]}/current/#{node[:symfony][:console]} #{daemon[:command]} --env=prod"
+ cmd = "#{deploy[:deploy_to]}/current/#{node[:symfony][:console]} --env=prod #{daemon[:command]}"
end
template "/etc/supervisor/conf.d/#{app_name}-#{daemon[:name]}.conf" do
|
Move --prod so that command is the last argument
|
diff --git a/lib/cookbook-release/commit.rb b/lib/cookbook-release/commit.rb
index abc1234..def5678 100644
--- a/lib/cookbook-release/commit.rb
+++ b/lib/cookbook-release/commit.rb
@@ -11,7 +11,7 @@ end
def patch?
- !!(self[:subject] =~ /\bfix\b/i)
+ !!(self[:subject] =~ /\bfix\b/i) || !!(self[:subject] =~ /\bbugfix\b/i)
end
def minor?
|
Add bugfix is "patch" level detection
|
diff --git a/lib/filepicker_rails/engine.rb b/lib/filepicker_rails/engine.rb
index abc1234..def5678 100644
--- a/lib/filepicker_rails/engine.rb
+++ b/lib/filepicker_rails/engine.rb
@@ -10,7 +10,7 @@
initializer 'filepicker_rails.action_controller' do |app|
ActiveSupport.on_load(:action_controller) do
- helper FilepickerRails::ApplicationHelper
+ ::ActionController::Base.helper(FilepickerRails::ApplicationHelper)
end
end
end
|
Fix helper inclusion for Rails 5
Calling the `helper` method after upgrading to Rails 5 resulted in the
following error:
undefined method 'helper' for ActionController::API:Class
This commit follows the lead of the following commit on another project:
https://github.com/weppos/breadcrumbs_on_rails/commit/3a3ac0c0d42bb0535418942e9051d687661582e5
|
diff --git a/lib/mdi_cloud_decoder/track.rb b/lib/mdi_cloud_decoder/track.rb
index abc1234..def5678 100644
--- a/lib/mdi_cloud_decoder/track.rb
+++ b/lib/mdi_cloud_decoder/track.rb
@@ -37,7 +37,7 @@ end
def method_missing(method_sym, *arguments, &block)
- @fields[method_sym.to_s.upcase] if @fields.include?(method_sym.to_s.upcase)
+ @fields[method_sym.to_s.upcase] # Return nil if not present
end
end
end
|
Return nil if field was not provided
|
diff --git a/lib/rspec/expect_it/helpers.rb b/lib/rspec/expect_it/helpers.rb
index abc1234..def5678 100644
--- a/lib/rspec/expect_it/helpers.rb
+++ b/lib/rspec/expect_it/helpers.rb
@@ -38,6 +38,14 @@ expect(result)
end
+ def expect_its(method)
+ ExpectItsExpectationTarget.new(self, method)
+ end
+
+ def expect_its!(method)
+ expect(subject.send(method))
+ end
+
class ExpectItExpectationTarget
attr_accessor :context, :subject
@@ -72,6 +80,21 @@ end
end
end
+
+ class ExpectItsExpectationTarget < ExpectItExpectationTarget
+ attr_accessor :method
+
+ def initialize(context, method)
+ super(context)
+ self.method = method
+ end
+
+ private
+
+ def get_subject
+ context.subject.send(method)
+ end
+ end
end
end
end
|
Revert "Removed `expect_its` and `expect_its!` methods."
This reverts commit b38c6267c348d5643f8004ffac5478064edb70cc.
|
diff --git a/lib/secret_bambino/bambinos.rb b/lib/secret_bambino/bambinos.rb
index abc1234..def5678 100644
--- a/lib/secret_bambino/bambinos.rb
+++ b/lib/secret_bambino/bambinos.rb
@@ -2,6 +2,10 @@ class Bambinos
def init(filename)
load_from_yaml(filename)
+ end
+
+ def assigned_bambinos
+ @assigned_bambinos ||= shuffle(@bambinos)
end
private
@@ -9,6 +13,17 @@ def load_from_yaml(filename)
data = YAML::load(File.open(filename))
@bambinos = data['bambinos']
- end
+ end
+
+ # variant of Fisher-Yates shuffle (ie. not the same as array.shuffle)
+ def shuffle(ary)
+ ary_dup = ary.dup
+ n = ary_dup.length
+ (0...n).each do |i|
+ j = rand([i+1, n-1].min...n)
+ ary_dup[i], ary_dup[j] = ary_dup[j], ary_dup[i]
+ end
+ ary_dup
+ end
end
end
|
Create list of assigned Bambinos.
|
diff --git a/lib/tasks/db_create_admin.rake b/lib/tasks/db_create_admin.rake
index abc1234..def5678 100644
--- a/lib/tasks/db_create_admin.rake
+++ b/lib/tasks/db_create_admin.rake
@@ -3,7 +3,8 @@ namespace :db do
desc "Create an admin user."
task :create_admin, [:password] => :environment do |_t, args|
- u = User.new(login: "admin", name: "Admin", email: Cnfg.webmaster_emails.first, admin: true)
+ u = User.new(login: "admin", name: "Admin", email: Cnfg.webmaster_emails.first,
+ admin: true, pref_lang: "en")
admin_password = args[:password] || User.random_password
u.password = u.password_confirmation = admin_password
|
10398: Make create_admin task set pref_lang
|
diff --git a/lib/tasks/redmine_jenkins.rake b/lib/tasks/redmine_jenkins.rake
index abc1234..def5678 100644
--- a/lib/tasks/redmine_jenkins.rake
+++ b/lib/tasks/redmine_jenkins.rake
@@ -1,18 +1,16 @@+require 'ci/reporter/rake/rspec'
+
namespace :redmine_jenkins do
+
+ namespace :ci do
+ ENV["CI_REPORTS"] = Rails.root.join('junit').to_s
+ task :all => ['ci:setup:rspec', 'spec']
+ end
+
desc "Show library version"
task :version do
puts "Redmine Jenkins #{version("plugins/redmine_jenkins/init.rb")}"
- end
-
-
- desc "Start unit tests"
- task :test => :default
- task :default => [:environment] do
- RSpec::Core::RakeTask.new(:spec) do |config|
- config.rspec_opts = "plugins/redmine_jenkins/spec --color"
- end
- Rake::Task["spec"].invoke
end
|
Add rake task to launch tests
|
diff --git a/app/helpers/survey_helper.rb b/app/helpers/survey_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/survey_helper.rb
+++ b/app/helpers/survey_helper.rb
@@ -1,5 +1,5 @@ module SurveyHelper
def survey_url
- 'https://forms.gle/MXbpmLTPdJnVLDdc8'
+ 'https://forms.gle/KAyvks7aourQmk3q8'
end
end
|
Update survey link to Mk 2 survey
|
diff --git a/config/deploy.rb b/config/deploy.rb
index abc1234..def5678 100644
--- a/config/deploy.rb
+++ b/config/deploy.rb
@@ -10,3 +10,5 @@
append :linked_files, 'config/database.yml'
append :linked_dirs, '.bundle', 'log', 'tmp/pids'
+
+set :passenger_restart_with_sudo, true
|
Use sudo to restart passenger
|
diff --git a/app/models/benchmark_type.rb b/app/models/benchmark_type.rb
index abc1234..def5678 100644
--- a/app/models/benchmark_type.rb
+++ b/app/models/benchmark_type.rb
@@ -1,5 +1,5 @@ class BenchmarkType < ActiveRecord::Base
- default_scope { order("#{self.table_name} ASC") }
+ default_scope { order("#{self.table_name}.category ASC") }
has_many :benchmark_runs, dependent: :destroy
belongs_to :repo
|
Add missing column in default scope.
|
diff --git a/app/services/diff_outputs.rb b/app/services/diff_outputs.rb
index abc1234..def5678 100644
--- a/app/services/diff_outputs.rb
+++ b/app/services/diff_outputs.rb
@@ -9,16 +9,16 @@
File.readlines(filename1).zip(File.readlines(filename2)).each do |line1, line2|
line_counter += 1
- stripped_line1 = line1.nil? ? line1 : line1.strip
- stripped_line2 = line2.nil? ? line2 : line2.strip
+ stripped_line1 = line1.nil? ? '' : line1.strip
+ stripped_line2 = line2.nil? ? '' : line2.strip
if stripped_line1 != stripped_line2
unless stripped_line1.blank? && stripped_line2.blank?
puts "Difference at line #{ line_counter }:"
puts "=== #{ filename1 }"
- puts "> #{ line1 }"
+ puts "> #{ stripped_line1[0..100] }"
puts "=== #{ filename2 }"
- puts "< #{ line2 }"
+ puts "< #{ stripped_line2[0..100] }"
return false
end
end
|
Fix the file differ to handle long outputs.
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -2,6 +2,7 @@
PhotoAlbum::Application.routes.draw do
root 'albums#index'
+ get '/albums', to: redirect('/')
get "/auth/:provider/callback" => "sessions#create"
delete "/signout" => "sessions#destroy", :as => :signout
|
Add redirect from /albums to root
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,4 +1,4 @@-ActionController::Routing::Routes.draw do |map|
+Rails.application.routes.draw do |map|
map.namespace(:admin_data) do |admin_data|
|
Fix DEPRECATION WARNING: ActionController::Routing::Routes is deprecated.
|
diff --git a/breakpoint.gemspec b/breakpoint.gemspec
index abc1234..def5678 100644
--- a/breakpoint.gemspec
+++ b/breakpoint.gemspec
@@ -16,8 +16,8 @@ s.licenses = ["MIT", "GPL-2.0"]
# Gem Files
- s.files = ["README.markdown"]
- s.files += ["CHANGELOG.markdown"]
+ s.files = ["README.md"]
+ s.files += ["CHANGELOG.md"]
s.files += Dir.glob("lib/**/*.*")
s.files += Dir.glob("stylesheets/**/*.*")
|
Fix filenames for README & CHANGELOG in the gemspec.
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,9 +1,10 @@ Rails.application.routes.draw do
devise_for :users
get 'w_elcome/index'
+ resources :notes
+ authenticated :user do
+ root 'notes#index', as: "authenticated_root"
+ end
root 'w_elcome#index'
-
-resources :notes
-
end
|
Change root based on if user_signed_in?
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -9,5 +9,5 @@ resources :projects, only: [:create] do
collection { get :random }
end
- get ':username/:repo' => "projects#show", as: :project
+ get ':username/:repo' => "projects#show", as: :project, constraints: { repo: /[^\/]*/ }
end
|
Update project url for dot names.
|
diff --git a/bank_job.gemspec b/bank_job.gemspec
index abc1234..def5678 100644
--- a/bank_job.gemspec
+++ b/bank_job.gemspec
@@ -19,6 +19,7 @@ spec.require_paths = ["lib"]
spec.add_runtime_dependency 'mechanize', '~> 2.7'
+ spec.add_runtime_dependency 'hashie', '~> 2.0.5'
spec.add_development_dependency "bundler", "~> 1.3"
spec.add_development_dependency "rake"
|
Add runtime dependency hashie to gemspec
|
diff --git a/lib/braingasm/options.rb b/lib/braingasm/options.rb
index abc1234..def5678 100644
--- a/lib/braingasm/options.rb
+++ b/lib/braingasm/options.rb
@@ -22,9 +22,9 @@ end
end
- def self.handle_options(options)
- Options[:eof] = 0 if options[:zero]
- Options[:eof] = -1 if options[:negative]
- Options[:eof] = nil if options[:as_is]
+ def self.handle_options(command_line_options)
+ Options[:eof] = 0 if command_line_options[:zero]
+ Options[:eof] = -1 if command_line_options[:negative]
+ Options[:eof] = nil if command_line_options[:as_is]
end
end
|
Rename method argument for clarification
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.