diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/lib/redmine_git_hosting/patches/user_patch.rb b/lib/redmine_git_hosting/patches/user_patch.rb
index abc1234..def5678 100644
--- a/lib/redmine_git_hosting/patches/user_patch.rb
+++ b/lib/redmine_git_hosting/patches/user_patch.rb
@@ -7,17 +7,37 @@ base.class_eval do
unloadable
+ attr_accessor :status_has_changed
+
has_many :gitolite_public_keys, :dependent => :destroy
before_destroy :delete_ssh_keys, prepend: true
+
+ after_save :check_if_status_changed
+
+ after_commit ->(obj) { obj.update_repositories }, on: :update
end
end
module InstanceMethods
+
def gitolite_identifier
"#{RedmineGitolite::ConfigRedmine.get_setting(:gitolite_identifier_prefix)}#{self.login.underscore}".gsub(/[^0-9a-zA-Z\-]/, '_')
+ end
+
+
+ protected
+
+
+ def update_repositories
+ if status_has_changed
+ git_projects = self.projects.uniq.select{|p| p.gitolite_repos.any?}.map{|project| project.id}
+
+ RedmineGitolite::GitHosting.logger.info { "User status has changed, update projects" }
+ RedmineGitolite::GitHosting.resync_gitolite({ :command => :update_projects, :object => git_projects })
+ end
end
@@ -26,6 +46,15 @@
def delete_ssh_keys
RedmineGitolite::GitHosting.logger.info { "User '#{self.login}' has been deleted from Redmine delete membership and SSH keys !" }
+ end
+
+
+ def check_if_status_changed
+ if self.status_changed?
+ self.status_has_changed = true
+ else
+ self.status_has_changed = false
+ end
end
end
|
Update projects when locking/unlocking user
|
diff --git a/test/test_helper.rb b/test/test_helper.rb
index abc1234..def5678 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -1,5 +1,7 @@-require 'bundler'
-Bundler.require :development, :test
+ENV['RAILS_ENV'] ||= 'test'
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
+require 'bundler/setup'
+Bundler.require :default, :test
require 'second_base'
require 'active_support/test_case'
require 'active_support/testing/autorun'
|
Allow non bundle exec `$ ruby -I"test:lib" ...` test style to work.
|
diff --git a/db/migrate/20220626134554_remove_ban_related_field_from_users.rb b/db/migrate/20220626134554_remove_ban_related_field_from_users.rb
index abc1234..def5678 100644
--- a/db/migrate/20220626134554_remove_ban_related_field_from_users.rb
+++ b/db/migrate/20220626134554_remove_ban_related_field_from_users.rb
@@ -0,0 +1,7 @@+class RemoveBanRelatedFieldFromUsers < ActiveRecord::Migration[6.1]
+ def change
+ remove_column :users, :permanently_banned, :boolean, default: false
+ remove_column :users, :ban_reason, :string, default: nil
+ remove_column :users, :banned_until, :datetime, default: nil
+ end
+end
|
Remove old ban fields from user table
|
diff --git a/test/integration/instrumentation_test.rb b/test/integration/instrumentation_test.rb
index abc1234..def5678 100644
--- a/test/integration/instrumentation_test.rb
+++ b/test/integration/instrumentation_test.rb
@@ -28,23 +28,23 @@
def test_does_not_log_counter_on_exception
begin
- ActiveSupport::Notifications.instrument "test.harness", :gauge => { :id => "test-gauge" }, :counter => {:id => 'test-counter', :value => 5 } do |args|
+ ActiveSupport::Notifications.instrument "counter_test.harness", :counter => true do |args|
raise
end
rescue
end
- assert_counter_not_logged "test-counter"
+ assert_counter_not_logged "counter_test.harness"
end
def test_does_log_gauge_on_exception
begin
- ActiveSupport::Notifications.instrument "test.harness", :gauge => { :id => "test-gauge" }, :counter => {:id => 'test-counter', :value => 5 } do |args|
+ ActiveSupport::Notifications.instrument "gauge_test.harness", :gauge => true do |args|
raise
end
rescue
end
- assert_gauge_logged "test-gauge"
+ assert_gauge_logged "gauge_test.harness"
end
end
|
Simplify instrumentation for exception tests
|
diff --git a/test/html5/test_scrub.rb b/test/html5/test_scrub.rb
index abc1234..def5678 100644
--- a/test/html5/test_scrub.rb
+++ b/test/html5/test_scrub.rb
@@ -4,7 +4,7 @@ include Loofah
def test_scrub_css
- assert Loofah::HTML5::Scrub.scrub_css("background: #ABC012"), "background: #ABC012"
- assert Loofah::HTML5::Scrub.scrub_css("background: #abc012"), "background: #abc012"
+ assert_equal Loofah::HTML5::Scrub.scrub_css("background: #ABC012"), "background:#ABC012;"
+ assert_equal Loofah::HTML5::Scrub.scrub_css("background: #abc012"), "background:#abc012;"
end
end
|
Fix test for style attribute scrubbing
|
diff --git a/test/unit/support/shared/base_context.rb b/test/unit/support/shared/base_context.rb
index abc1234..def5678 100644
--- a/test/unit/support/shared/base_context.rb
+++ b/test/unit/support/shared/base_context.rb
@@ -25,6 +25,6 @@ f.flush
end
- return Pathname.new(f.path)
+ return Pathname.new(f)
end
end
|
Fix issue with Tempfile in test being deleted
|
diff --git a/test/test_girl_friday.rb b/test/test_girl_friday.rb
index abc1234..def5678 100644
--- a/test/test_girl_friday.rb
+++ b/test/test_girl_friday.rb
@@ -9,8 +9,8 @@
describe '.status' do
before do
- q1 = GirlFriday::Queue.new(:q1) do; end
- q2 = GirlFriday::Queue.new(:q2) do; end
+ GirlFriday::Queue.new(:q1) do; end
+ GirlFriday::Queue.new(:q2) do; end
end
it 'provides a status structure for each live queue' do
hash = GirlFriday.status
@@ -22,8 +22,8 @@
describe '.shutdown!' do
before do
- q1 = GirlFriday::Queue.new(:q1) do; end
- q2 = GirlFriday::Queue.new(:q2) do; end
+ GirlFriday::Queue.new(:q1) do; end
+ GirlFriday::Queue.new(:q2) do; end
end
it 'provides a status structure for each live queue' do
a = Time.now
|
Remove 'assigned but unused variable' warning
Ruby 2.0.0-preview2
|
diff --git a/api/app/serializers/relation_info_serializer.rb b/api/app/serializers/relation_info_serializer.rb
index abc1234..def5678 100644
--- a/api/app/serializers/relation_info_serializer.rb
+++ b/api/app/serializers/relation_info_serializer.rb
@@ -6,8 +6,8 @@ data = super
data['start_date'] = object.start_date.to_date.iso8601 if object.start_date.present?
data['end_date'] = object.end_date.to_date.iso8601 if object.end_date.present?
- data['title'] = object.relation_type.title if object.relation_type.title.present?
- data['title_reverse'] = object.relation_type.title_reverse if object.relation_type.title_reverse.present?
+ data['title'] = object.relation_type.title if object.relation_type && object.relation_type.title.present?
+ data['title_reverse'] = object.relation_type.title_reverse if object.relation_type && object.relation_type.title_reverse.present?
data
end
|
Fix for non existing relation_type
|
diff --git a/app/workers/fetch_developer_languages_worker.rb b/app/workers/fetch_developer_languages_worker.rb
index abc1234..def5678 100644
--- a/app/workers/fetch_developer_languages_worker.rb
+++ b/app/workers/fetch_developer_languages_worker.rb
@@ -9,8 +9,11 @@ # Update languages in a transaction block
Developer.connection_pool.with_connection do
developer = Developer.find_by_login(login)
- developer.update!(platforms: languages) unless developer.nil?
+ developer.update!(platforms: languages)
end
+
+ rescue ActiveRecord::RecordNotFound
+ 'No connection found'
ensure
ActiveRecord::Base.clear_active_connections!
|
Add rescue block and remove unless
|
diff --git a/lib/generators/templates/controllers/registrations_controller.rb b/lib/generators/templates/controllers/registrations_controller.rb
index abc1234..def5678 100644
--- a/lib/generators/templates/controllers/registrations_controller.rb
+++ b/lib/generators/templates/controllers/registrations_controller.rb
@@ -30,7 +30,7 @@ private
def setup_<%= identity_model %>
- <%= identity_model_class %>.verify_signature!(TokenVerification::EMAIL_CONFIRMATION, params.require(:email_confirmation_token)) do |record, expires_at|
+ <%= identity_model_class %>.verify_signature!(Identity::EMAIL_CONFIRMATION_KEY, params.require(:email_confirmation_token)) do |record, expires_at|
if expires_at < Time.current
redirect_to(root_path, alert: t(:'auto_auth.registrations.expired'))
else
|
Use some other existing constant for verifier
|
diff --git a/lib/impressionist/models/mongoid/impressionist/impressionable.rb b/lib/impressionist/models/mongoid/impressionist/impressionable.rb
index abc1234..def5678 100644
--- a/lib/impressionist/models/mongoid/impressionist/impressionable.rb
+++ b/lib/impressionist/models/mongoid/impressionist/impressionable.rb
@@ -4,28 +4,21 @@ # extends AS::Concern
include Impressionist::IsImpressionable
- ## TODO: Make it readable
+ # Overides impressionist_count in order to provide mongoid compability
+ def impressionist_count(options={})
- # Overides impressionist_count in order to provied
- # mongoid compability
- def impressionist_count(options={})
- options.
- reverse_merge!(
- :filter=>:request_hash,
- :start_date=>nil,
- :end_date=>Time.now)
+ # Uses these options as defaults unless overridden in options hash
+ options.reverse_merge!(:filter => :request_hash, :start_date => nil, :end_date => Time.now)
- imps = options[:start_date].blank? ?
- impressions :
- impressions.
- between(created_at: options[:start_date]..options[:end_date])
+ # If a start_date is provided, finds impressions between then and the end_date.
+ # Otherwise returns all impressions
+ imps = options[:start_date].blank? ? impressions :
+ impressions.between(created_at: options[:start_date]..options[:end_date])
- filter = options[:filter]
- filter == :all ?
- imps.count :
- imps.where(filter.ne => nil).
- distinct(filter).count
+ # Count all distinct impressions unless the :all filter is provided
+ distinct = options[:filter] != :all
+ distinct ? imps.where(filter.ne => nil).distinct(filter).count : imps.count
end
end
|
Refactor override of impressionist_count for mongoid compatibility to fit the same style as the default AR version
|
diff --git a/test/unit/charge_and_ship_order_command_test.rb b/test/unit/charge_and_ship_order_command_test.rb
index abc1234..def5678 100644
--- a/test/unit/charge_and_ship_order_command_test.rb
+++ b/test/unit/charge_and_ship_order_command_test.rb
@@ -0,0 +1,69 @@+#--
+# Project: google_checkout4r
+# File: test/unit/charge_order_command_test.rb
+# Author: George Palmer <george.palmer at gmail dot com>
+# Copyright: (c) 2010 by George Palmer
+# License: MIT License as follows:
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the
+# following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
+# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#++
+
+require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
+
+require 'google4r/checkout'
+
+require 'test/frontend_configuration'
+
+# Tests for the ChargeOrderCommand class.
+class Google4R::Checkout::ChargeAndShipOrderCommandTest < Test::Unit::TestCase
+ include Google4R::Checkout
+
+ def setup
+ @frontend = Frontend.new(FRONTEND_CONFIGURATION)
+ @command = @frontend.create_charge_and_ship_order_command
+ @command.google_order_number = '1234-5678-ABCD-1234'
+ @command.amount = Money.new(1000, 'GBP')
+ end
+
+ def test_behaves_correctly
+ [ :google_order_number, :amount, :send_email, :carrier, :tracking_number ].each do |symbol|
+ assert_respond_to @command, symbol
+ end
+ end
+
+ def test_xml_without_amount
+ @command.amount = nil
+ assert_no_command_element_exists("amount", @command)
+ end
+
+ def test_accessors
+ assert_equal('1234-5678-ABCD-1234', @command.google_order_number)
+ assert_equal(Money.new(1000, 'GBP'), @command.amount)
+ end
+
+ def test_xml_generation
+ assert_command_element_text_equals("10.00", "> amount[currency=GBP]", @command)
+ end
+
+ def test_to_xml_does_not_raise_exception
+ assert_nothing_raised { @command.to_xml }
+ end
+
+end
|
Add support for ChargeAndShipOrder command
|
diff --git a/spec/dummy/config/initializers/feedy.rb b/spec/dummy/config/initializers/feedy.rb
index abc1234..def5678 100644
--- a/spec/dummy/config/initializers/feedy.rb
+++ b/spec/dummy/config/initializers/feedy.rb
@@ -1,3 +1,3 @@-Feedy.anonymous_feedback = false
+Feedy.anonymous_feedback = true
Feedy.user_class = "User"
Feedy.current_user_helper = :current_user
|
Use anonymous feedback for the dummy app
|
diff --git a/spec/features/campaign_articles_spec.rb b/spec/features/campaign_articles_spec.rb
index abc1234..def5678 100644
--- a/spec/features/campaign_articles_spec.rb
+++ b/spec/features/campaign_articles_spec.rb
@@ -18,4 +18,10 @@ visit "/campaigns/#{campaign.slug}/articles"
expect(page).to have_content('ExampleArticle')
end
+
+ it 'shows an explanation when there are too many articles' do
+ allow_any_instance_of(CoursesPresenter).to receive(:too_many_articles?).and_return(true)
+ visit "/campaigns/#{campaign.slug}/articles"
+ expect(page).to have_content('article list for this campaign is too long to be displayed')
+ end
end
|
Add test for 'too many articles' handling on Campaign articles tab
|
diff --git a/spec/lib/attributes/association_spec.rb b/spec/lib/attributes/association_spec.rb
index abc1234..def5678 100644
--- a/spec/lib/attributes/association_spec.rb
+++ b/spec/lib/attributes/association_spec.rb
@@ -0,0 +1,19 @@+describe Adminable::Attributes::Association do
+ let!(:reflection) do
+ User.reflect_on_all_associations.find { |a| a.name == :blog_posts }
+ end
+ let!(:association) { Adminable::Attributes::Association.new(reflection) }
+ let!(:blog_post) { FactoryGirl.create(:blog_post) }
+
+ describe '@model' do
+ it 'has ResourceConcern included' do
+ expect(association.model.first).to respond_to(:adminable_name)
+ end
+ end
+
+ describe '#options_for_select' do
+ it 'returns all entries for association model' do
+ expect(association.options_for_select).to match_array(blog_post)
+ end
+ end
+end
|
Add specs for Attributes::Association class
|
diff --git a/config/initializers/nuclear_secrets.rb b/config/initializers/nuclear_secrets.rb
index abc1234..def5678 100644
--- a/config/initializers/nuclear_secrets.rb
+++ b/config/initializers/nuclear_secrets.rb
@@ -20,7 +20,6 @@ shared_auth_secret: String,
secret_key_base: String,
secret_token: NilClass,
- deploy_env: String,
canvas_proctor_url: String,
scorm_url: String,
scorm_api_path: String,
|
Remove deploy_env from required secrets. It is now optional as an extra secret.
Nuclear secrets now allows optional extra secrets.
|
diff --git a/pages/app/controllers/refinery/pages/admin/preview_controller.rb b/pages/app/controllers/refinery/pages/admin/preview_controller.rb
index abc1234..def5678 100644
--- a/pages/app/controllers/refinery/pages/admin/preview_controller.rb
+++ b/pages/app/controllers/refinery/pages/admin/preview_controller.rb
@@ -5,10 +5,12 @@ include Pages::InstanceMethods
include Pages::RenderOptions
+ before_filter :find_page
+
layout :layout
def show
- render_with_templates? page, :template => template
+ render_with_templates? @page, :template => template
end
protected
|
Use find_page as a before filter and use @page.
The method find_page does not always returns the page. It returns he params hash in the case of hash assignation (preview existing pages).
This break previews view view_templates as object methods are called in RenderOptions::render_options_for_template.
|
diff --git a/core/config/initializers/spree_user.rb b/core/config/initializers/spree_user.rb
index abc1234..def5678 100644
--- a/core/config/initializers/spree_user.rb
+++ b/core/config/initializers/spree_user.rb
@@ -3,7 +3,7 @@ # are still doing for compatability, but with a warning.
Spree::Core::Engine.config.to_prepare do
- unless Spree.user_class.included_modules.include?(Spree::UserMethods)
+ if Spree.user_class && !Spree.user_class.included_modules.include?(Spree::UserMethods)
ActiveSupport::Deprecation.warn "#{Spree.user_class} must include Spree::UserMethods"
Spree.user_class.include Spree::UserMethods
end
|
Fix initialization if Spree.user_class is not set
For example, when running the install generator.
|
diff --git a/db/seeds.rb b/db/seeds.rb
index abc1234..def5678 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -1,6 +1,5 @@ # This env var is set by the beforeTest action in our Jenkinsfile
unless ENV.key?("RUNNING_IN_CI")
# See app/tasks/seed_database
- ImportOrganisations.new.call
SeedDatabase.instance.run
end
|
Remove import organisations from db:seed
ImportOrganisations.new.call involves pulling data dynamically in from
GOV.UK. This makes it an extremely complicated approach to seeding a
database, and causes a bunch of misery in spinning up a production-like
environment for GOV.UK (as is the case with publishing_e2e_tests [1]) as
you need Whitehall to have published data, that data to make it to
Search API, Router to be running and then Collections running - a heck
of a lot for a db:seed!
It's unclear why this is needed, the SeedDatabase step will create a
single organisation (HMRC) which is probably all that is needed.
This simplifies this just to the more basic seed call.
|
diff --git a/db/seeds.rb b/db/seeds.rb
index abc1234..def5678 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -5,3 +5,21 @@ #
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
# Mayor.create(name: 'Emanuel', city: cities.first)
+
+User.destroy_all
+Experience.destroy_all
+
+u = User.create!(
+ first_name: "John",
+ last_name: "Smith",
+ email: "john@smith.com",
+ username: "jsmith",
+ password_digest: "password"
+ )
+
+u.experiences.create!(
+ title: "Trip to Hot Doug's",
+ start_date: DateTime.now.to_date,
+ end_date: DateTime.now.to_date,
+ description: "Hot Doug's is closed now :("
+ )
|
Add user and experience to seed file
|
diff --git a/spec/cc/engine/csslint_spec.rb b/spec/cc/engine/csslint_spec.rb
index abc1234..def5678 100644
--- a/spec/cc/engine/csslint_spec.rb
+++ b/spec/cc/engine/csslint_spec.rb
@@ -0,0 +1,28 @@+require 'cc/engine/csslint'
+require 'tmpdir'
+
+module CC
+ module Engine
+ describe CSSlint do
+ let(:code) { Dir.mktmpdir }
+ let(:lint) { CSSlint.new(directory: code, io: nil, engine_config: {}) }
+ let(:content) { '#id { color: red; }' }
+
+ describe '#run' do
+ it 'analyzes *.css files' do
+ create_source_file('foo.css', content)
+ expect{ lint.run }.to output(/Don't use IDs in selectors./).to_stdout
+ end
+
+ it "doesn't analyze *.scss files" do
+ create_source_file('foo.scss', content)
+ expect{ lint.run }.to_not output.to_stdout
+ end
+
+ def create_source_file(path, content)
+ File.write(File.join(code, path), content)
+ end
+ end
+ end
+ end
+end
|
Add spec for including only *.css files
|
diff --git a/ehjob_authentication.gemspec b/ehjob_authentication.gemspec
index abc1234..def5678 100644
--- a/ehjob_authentication.gemspec
+++ b/ehjob_authentication.gemspec
@@ -19,7 +19,5 @@ s.add_dependency "omniauth"
s.add_dependency "omniauth-facebook"
s.add_dependency "omniauth-linkedin-oauth2"
- s.add_dependency "httparty"
s.add_development_dependency "debugger"
- s.add_development_dependency "sqlite3"
end
|
Remove dependencies out of gem spec to avoid gems confliction
|
diff --git a/app/views/api/v1/relics/_relic.json.jbuilder b/app/views/api/v1/relics/_relic.json.jbuilder
index abc1234..def5678 100644
--- a/app/views/api/v1/relics/_relic.json.jbuilder
+++ b/app/views/api/v1/relics/_relic.json.jbuilder
@@ -30,8 +30,11 @@ end
json.photos relic.photos
-json.place_id relic.place.id
-json.place_name relic.place.name
-json.commune_name relic.place.commune.name
-json.district_name relic.place.commune.district.voivodeship.name
-json.voivodeship_name relic.place.commune.district.voivodeship.name
+
+if relic.place
+ json.place_id relic.place.id
+ json.place_name relic.place.name
+ json.commune_name relic.place.commune.name
+ json.district_name relic.place.commune.district.name
+ json.voivodeship_name relic.place.commune.district.voivodeship.name
+end
|
fix: Check if relic has a valid place
|
diff --git a/features/step_definitions/shared.rb b/features/step_definitions/shared.rb
index abc1234..def5678 100644
--- a/features/step_definitions/shared.rb
+++ b/features/step_definitions/shared.rb
@@ -1,5 +1,5 @@ When(/^I visit the (.*) path$/) do |route|
- visit eval(route.gsub(' ', '_') + '_path')
+ visit eval(route.tr(' ', '_') + '_path')
end
When(/^I click "([^"]*)"$/) do |arg|
|
Use tr instead of gsub
|
diff --git a/spec/models/tournament_spec.rb b/spec/models/tournament_spec.rb
index abc1234..def5678 100644
--- a/spec/models/tournament_spec.rb
+++ b/spec/models/tournament_spec.rb
@@ -31,4 +31,29 @@ end
end
end
+
+ describe "Creation" do
+ let(:creator) {
+ FactoryGirl::create(:user)
+ }
+
+ let(:tournament_attrs) {
+ FactoryGirl::attributes_for(:tournament)
+ }
+ context "with creator specified" do
+ it "Adds creator as an admin after the club is created" do
+ tournament_attrs["creator"] = creator
+ tournament = Tournament.create(tournament_attrs)
+ expect(TournamentAdmin.exists?(tournament_id: tournament.id, user_id: creator.id)).to be true
+ end
+ end
+
+ context "without creator specified" do
+ it "Does not change admn count after the tournament is created" do
+ expect {
+ Tournament.create(tournament_attrs)
+ }.not_to change(TournamentAdmin, :count)
+ end
+ end
+ end
end
|
Add test for creatoin of initial admin for tournament
The functionality was there, but was not tested
|
diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb
index abc1234..def5678 100644
--- a/spec/spec_helper_acceptance.rb
+++ b/spec/spec_helper_acceptance.rb
@@ -6,17 +6,17 @@ run_puppet_install_helper unless ENV['BEAKER_provision'] == 'no'
RSpec.configure do |c|
- install_module_on(hosts)
- install_module_dependencies_on(hosts)
-
# Readable test descriptions
c.formatter = :documentation
# Configure all nodes in nodeset
c.before :suite do
+ install_module
+ install_module_dependencies
+
hosts.each do |host|
# python is pre-requisite to the python_path fact.
- on host, puppet('resource', 'package', 'python', 'ensure=installed')
+ host.install_package('python')
end
end
end
|
Clean up acceptance spec helper
|
diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb
index abc1234..def5678 100644
--- a/spec/spec_helper_acceptance.rb
+++ b/spec/spec_helper_acceptance.rb
@@ -20,8 +20,8 @@ # Readable test descriptions
c.formatter = :documentation
c.before :suite do
- puppet_module_install(:source => proj_root, :module_name => 'rabbitmq')
hosts.each do |host|
+ copy_module_to(host, :source => proj_root, :module_name => 'rabbitmq')
shell("/bin/touch #{default['puppetpath']}/hiera.yaml")
shell('puppet module install puppetlabs-stdlib', { :acceptable_exit_codes => [0,1] })
|
Remove puppet_module_install in favor of copy_module_to
|
diff --git a/spec/unit/result_queue_spec.rb b/spec/unit/result_queue_spec.rb
index abc1234..def5678 100644
--- a/spec/unit/result_queue_spec.rb
+++ b/spec/unit/result_queue_spec.rb
@@ -10,6 +10,7 @@ describe "#push and #clear" do
it "should add items and remove all items from the result queue" do
ids = (1..100).to_a.shuffle
+ result_queue # Initialize before it's accessed by different threads.
threads = ids.each_slice(25).to_a.map do |id_set|
Thread.new do
|
Fix another intermittent spec failure.
|
diff --git a/story.rb b/story.rb
index abc1234..def5678 100644
--- a/story.rb
+++ b/story.rb
@@ -0,0 +1,35 @@+require 'yaml'
+
+information = YAML.load(File.open("data.yml"))
+
+# Extract from corpus and save in variables
+def extract_paragraphs(hash)
+ array = []
+ hash.keys.each do |key|
+ array << hash[key]["Paragraphs"]
+ end
+ array.flatten.shuffle
+end
+
+fd_propaganda = extract_paragraphs(information["Frankenisten_Destroyer_Propaganda"])
+pro_tech_propaganda = extract_paragraphs(information["Pro_Tech_Propaganda"])
+missions = extract_paragraphs(information["Missions"])
+backstories = extract_paragraphs(information["Worldbuilding"])
+
+# Set Up Track
+track = [fd_propaganda, pro_tech_propaganda, missions, backstories]
+
+# set up blank story
+story = []
+
+number_of_rounds = 4
+
+number_of_rounds.times do |round|
+ number_of_checkpoints = track.length
+ number_of_checkpoints.times do |checkpoint_index|
+ checkpoint = track[checkpoint_index]
+ story << checkpoint.pop
+ end
+end
+
+puts story
|
Set up proof of concept program
|
diff --git a/vagrant-cucumber.gemspec b/vagrant-cucumber.gemspec
index abc1234..def5678 100644
--- a/vagrant-cucumber.gemspec
+++ b/vagrant-cucumber.gemspec
@@ -26,6 +26,7 @@
s.add_runtime_dependency 'cucumber', '~>1.3.2'
s.add_runtime_dependency 'to_regexp', '>=0.2.1'
+ s.add_runtime_dependency 'sahara', '~>0.0.17'
s.files = files
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
gemspec: Add sahara to runtime dependency
|
diff --git a/spec/default/etckeeper_spec.rb b/spec/default/etckeeper_spec.rb
index abc1234..def5678 100644
--- a/spec/default/etckeeper_spec.rb
+++ b/spec/default/etckeeper_spec.rb
@@ -1,3 +1,20 @@ require 'spec_helper'
# write up RSpec integration tests here
+%w{
+ git
+ etckeeper
+}.each do |pkg|
+ describe package(pkg) do
+ it { should be_installed }
+ end
+end
+
+describe file('/etc/etckeeper') do
+ it { should be_directory }
+end
+
+describe file('/etc/etckeeper/etckeeper.conf') do
+ it { should be_file }
+ its(:content) { should match /VCS="git"/ }
+end
|
Add integration tests for etckeeper
|
diff --git a/spec/resque-job_logger_spec.rb b/spec/resque-job_logger_spec.rb
index abc1234..def5678 100644
--- a/spec/resque-job_logger_spec.rb
+++ b/spec/resque-job_logger_spec.rb
@@ -2,6 +2,10 @@
describe Resque::Plugins::JobLogger do
include PerformJob
+
+ it "complies with recommended practices" do
+ expect { Resque::Plugin.lint(Resque::Plugins::JobLogger) }.to_not raise_error
+ end
it "supplies the around_perform_log_job hook" do
LoggedJob.methods.should include :around_perform_log_job
|
[master] Add lint test to spec.
|
diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb
index abc1234..def5678 100644
--- a/spec/spec_helper_acceptance.rb
+++ b/spec/spec_helper_acceptance.rb
@@ -18,6 +18,7 @@ # Install module and dependencies
hosts.each do |host|
copy_module_to(host, source: proj_root, module_name: 'vim')
+ on host, puppet('module install puppet-extlib'), acceptable_exit_codes: [0, 1]
on host, puppet('module install puppetlabs-stdlib'), acceptable_exit_codes: [0, 1]
end
end
|
Add missing dependency for Beaker tests
|
diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb
index abc1234..def5678 100644
--- a/spec/spec_helper_acceptance.rb
+++ b/spec/spec_helper_acceptance.rb
@@ -18,6 +18,7 @@ on host, puppet('module', 'install', 'puppetlabs-stdlib'), { :acceptable_exit_codes => [0] }
on host, puppet('module', 'install', 'puppetlabs-concat'), { :acceptable_exit_codes => [0] }
on host, puppet('module', 'install', 'puppet-yum'), { :acceptable_exit_codes => [0] }
+ on host, puppet('module', 'install', 'yuav-monitoring_facts'), { :acceptable_exit_codes => [0] }
install_package host, 'git'
modulepath = host.puppet['modulepath']
modulepath = modulepath.split(':').first if modulepath
|
Add monitoring facts to acceptance tests
|
diff --git a/spec/yars/atomic_queue_spec.rb b/spec/yars/atomic_queue_spec.rb
index abc1234..def5678 100644
--- a/spec/yars/atomic_queue_spec.rb
+++ b/spec/yars/atomic_queue_spec.rb
@@ -0,0 +1,28 @@+describe Yars::AtomicQueue do
+ let(:q) { Yars::AtomicQueue.new }
+ let(:data){ %w(one two three four) }
+
+ describe '#push' do
+ it 'can be pushed to' do
+ data.each { |num| q << num }
+ expect(q.size).to eq 4
+ end
+ end
+
+
+ describe '#pop' do
+ before { data.each { |num| q << num } }
+
+ it 'can be popped from' do
+ data.each { |num| expect(q.pop).to eq num }
+ end
+
+ context 'when the queue is empty' do
+ before { (q.size + 10).times { q.pop } }
+
+ it 'does not create a negative size' do
+ expect(q.size).to eq 0
+ end
+ end
+ end
+end
|
Add specs for sequential queue
|
diff --git a/db/migrate/20130611210815_increase_snippet_text_column_size.rb b/db/migrate/20130611210815_increase_snippet_text_column_size.rb
index abc1234..def5678 100644
--- a/db/migrate/20130611210815_increase_snippet_text_column_size.rb
+++ b/db/migrate/20130611210815_increase_snippet_text_column_size.rb
@@ -0,0 +1,9 @@+class IncreaseSnippetTextColumnSize < ActiveRecord::Migration
+ def up
+ # MYSQL LARGETEXT for snippet
+ change_column :snippets, :content, :text, :limit => 4294967295
+ end
+
+ def down
+ end
+end
|
Increase snippet content column size.
This will fix issue #3904
|
diff --git a/builder/test-integration/spec/hypriotos-image/base/kernel_spec.rb b/builder/test-integration/spec/hypriotos-image/base/kernel_spec.rb
index abc1234..def5678 100644
--- a/builder/test-integration/spec/hypriotos-image/base/kernel_spec.rb
+++ b/builder/test-integration/spec/hypriotos-image/base/kernel_spec.rb
@@ -1,14 +1,10 @@ require 'spec_helper'
describe command('uname -r') do
- its(:stdout) { should match /4.4.39(-v7)?+/ }
+ its(:stdout) { should match /4.9.13-bee42-v8/ }
its(:exit_status) { should eq 0 }
end
-describe file('/lib/modules/4.4.39-hypriotos+/kernel') do
+describe file('/lib/modules/4.9.13-bee42-v8/kernel') do
it { should be_directory }
end
-
-describe file('/lib/modules/4.4.39-hypriotos-v7+/kernel') do
- it { should be_directory }
-end
|
Fix integrations tests for kernel version
Signed-off-by: Dieter Reuter <554783fc552b5b2a46dd3d7d7b9b2cce9a82c122@me.com>
|
diff --git a/promo/app/models/spree/user_decorator.rb b/promo/app/models/spree/user_decorator.rb
index abc1234..def5678 100644
--- a/promo/app/models/spree/user_decorator.rb
+++ b/promo/app/models/spree/user_decorator.rb
@@ -1,5 +1,5 @@ if Spree.user_class
Spree.user_class.class_eval do
- has_and_belongs_to_many :roles, :class_name => "Spree::Role", :foreign_key => :user_id, :join_table_name => "spree_roles_users"
+ has_and_belongs_to_many :roles, :class_name => "Spree::Role", :foreign_key => :user_id, :join_table => "spree_roles_users"
end
end
|
[promo] Use join_table, not join_table name in user decorator
|
diff --git a/features/step_definitions/renalware/peritonitis_episodes_steps.rb b/features/step_definitions/renalware/peritonitis_episodes_steps.rb
index abc1234..def5678 100644
--- a/features/step_definitions/renalware/peritonitis_episodes_steps.rb
+++ b/features/step_definitions/renalware/peritonitis_episodes_steps.rb
@@ -3,6 +3,21 @@ patient: @patty,
user: @clyde,
diagnosed_on: "10-10-2016"
+ )
+
+ record_organism_for(
+ infectable: @patty.peritonitis_episodes.last!,
+ organism_name: "Acineobactor"
+ )
+
+ record_medication_for(
+ treatable: @patty.peritonitis_episodes.last!,
+ drug_name: "Ciprofloxacin Infusion",
+ dose: "100 ml",
+ route_name: "PO",
+ frequency: "once a day",
+ starts_on: "10-10-2015",
+ provider: "GP"
)
end
|
Add missing organism and medication to episode
- these are required when the episode is revised
|
diff --git a/env_bang.gemspec b/env_bang.gemspec
index abc1234..def5678 100644
--- a/env_bang.gemspec
+++ b/env_bang.gemspec
@@ -9,8 +9,8 @@ spec.authors = ["Jonathan Camenisch"]
spec.email = ["jonathan@camenisch.net"]
spec.summary = %q{Do a bang-up job managing your environment variables}
- spec.description = %q{}
- spec.homepage = ""
+ spec.description = %q{ENV! provides a thin wrapper around ENV to encourage central, self-documenting configuration and helpful error message.}
+ spec.homepage = "https://github.com/jcamenisch/ENV_BANG"
spec.license = "MIT"
spec.files = `git ls-files`.split($/)
|
Add gem description & homepage
|
diff --git a/spec/models/vote_spec.rb b/spec/models/vote_spec.rb
index abc1234..def5678 100644
--- a/spec/models/vote_spec.rb
+++ b/spec/models/vote_spec.rb
@@ -0,0 +1,19 @@+require 'spec_helper'
+
+describe Vote do
+
+ it "is valid with a user_id and question_id" do
+ vote = Vote.new(user_id: 1, question_id: 1)
+ expect(vote).to be_valid
+ end
+
+ it "should be invalid without a user_id" do
+ vote = Vote.new(track_id: 1)
+ expect(vote).to have(1).errors_on(:user_id)
+ end
+
+ it "should be invalid without a track_id" do
+ vote = Vote.new(user_id: 1)
+ expect(vote).to have(1).errors_on(:track_id)
+ end
+end
|
Add validation tests for votes
|
diff --git a/edurange.gemspec b/edurange.gemspec
index abc1234..def5678 100644
--- a/edurange.gemspec
+++ b/edurange.gemspec
@@ -27,4 +27,5 @@ gem.add_runtime_dependency "sqlite3"
gem.add_runtime_dependency "thread"
gem.add_runtime_dependency "erubis"
+ gem.add_runtime_dependency "unix-crypt" # For generating hashes for linux
end
|
Add unix-crypt gem to generate hashes
|
diff --git a/test/spec/connection/close.rb b/test/spec/connection/close.rb
index abc1234..def5678 100644
--- a/test/spec/connection/close.rb
+++ b/test/spec/connection/close.rb
@@ -0,0 +1,16 @@+require_relative './connection_spec_init'
+
+context 'Connection' do
+ test 'Closing' do
+ socket = StringIO.new
+ io = StringIO.new
+
+ connection = Connection.new socket, io, 0
+
+ connection.close
+
+ assert connection.closed?
+ assert socket.closed?
+ assert io.closed?
+ end
+end
|
Test connection closing in an SSL compliant way
|
diff --git a/db/migrate/20160524110518_add_columns_to_users.rb b/db/migrate/20160524110518_add_columns_to_users.rb
index abc1234..def5678 100644
--- a/db/migrate/20160524110518_add_columns_to_users.rb
+++ b/db/migrate/20160524110518_add_columns_to_users.rb
@@ -2,7 +2,7 @@ def change
add_column :users, :provider, :string
add_column :users, :uid, :string
- add_column :users, :first_name, :string
- add_column :users, :last_name, :string
+ add_column :users, :first_name, :string, :default => nil
+ add_column :users, :last_name, :string, :default => nil
end
end
|
Make Alert Layout, add provider, uid, first/last name to users
|
diff --git a/db/migrate/20160616094245_statistics_precision.rb b/db/migrate/20160616094245_statistics_precision.rb
index abc1234..def5678 100644
--- a/db/migrate/20160616094245_statistics_precision.rb
+++ b/db/migrate/20160616094245_statistics_precision.rb
@@ -1,5 +1,6 @@ class StatisticsPrecision < ActiveRecord::Migration
def change
- change_column :device_statistics, :value, :decimal, precision: 10, scale: 10
+ remove_column :device_statistics, :value
+ add_column :device_statistics, :value, :decimal, precision: 10, scale: 10
end
end
|
Remove and re-add values column
|
diff --git a/activemodel/lib/active_model/mass_assignment_security/sanitizer.rb b/activemodel/lib/active_model/mass_assignment_security/sanitizer.rb
index abc1234..def5678 100644
--- a/activemodel/lib/active_model/mass_assignment_security/sanitizer.rb
+++ b/activemodel/lib/active_model/mass_assignment_security/sanitizer.rb
@@ -3,17 +3,15 @@ class Sanitizer
# Returns all attributes not denied by the authorizer.
def sanitize(attributes, authorizer)
- sanitized_attributes = attributes.reject { |key, value| authorizer.deny?(key) }
- debug_protected_attribute_removal(attributes, sanitized_attributes)
+ rejected = []
+ sanitized_attributes = attributes.reject do |key, value|
+ rejected << key if authorizer.deny?(key)
+ end
+ process_removed_attributes(rejected) unless rejected.empty?
sanitized_attributes
end
protected
-
- def debug_protected_attribute_removal(attributes, sanitized_attributes)
- removed_keys = attributes.keys - sanitized_attributes.keys
- process_removed_attributes(removed_keys) if removed_keys.any?
- end
def process_removed_attributes(attrs)
raise NotImplementedError, "#process_removed_attributes(attrs) suppose to be overwritten"
|
Speed up mass assignment by avoiding extra loops.
|
diff --git a/app/controllers/glome_oauth/oauth2_controller.rb b/app/controllers/glome_oauth/oauth2_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/glome_oauth/oauth2_controller.rb
+++ b/app/controllers/glome_oauth/oauth2_controller.rb
@@ -10,25 +10,34 @@ app_name = params[:client_id]
redirect_uri = params[:redirect_uri]
client_secret = "secret"
+ client_secret = params[:client_secret]
response_type = "token"
- password = "ZeiChey0chatie9ohsah"
- grant_type = "password"
+ #password = "ZeiChey0chatie9ohsah"
+ password = ""
+ #resp_type = "grant_type"
+ #grant_type = "password"
+ grant_type = "code"
+ resp_type = "response_type"
+ static_client_secret = "Zi1taishurooGhaye7BeeB8phiey2u"
+ client_secret = static_client_secret if client_secret.nil? || client_secret.empty?
email = app_name + "@example.com"
user = FakeOauth2User.new(:email => email, :password=> password)
#user = Gms::Account.new(:name => email, :password=>password)
user.save
u = FakeOauth2User.find_by_email(email)
- application = Doorkeeper::Application.new(name: app_name, redirect_uri: params[:redirect_uri])
+ #application = Doorkeeper::Application.new(name: app_name, redirect_uri: params[:redirect_uri])
+ application = FakeOauth2Application.new(name: app_name, redirect_uri: params[:redirect_uri], uid: app_name, secret: client_secret)
r = application.save
- @authorization_url = request.protocol() + request.host_with_port() + "/oauth/token"
+ @authorization_url = request.protocol() + request.host_with_port() + "/auth/oauth/authorize"
@client_id = application.uid
@redirect_uri = redirect_uri
@client_secret = application.secret
@username = email
@password = password
@grant_type = grant_type
+ @resp_type = resp_type
render template: "oauth2/grant"
end
|
Set client_secret, grant_type, create fake application
|
diff --git a/app/controllers/kebapress/hq/posts_controller.rb b/app/controllers/kebapress/hq/posts_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/kebapress/hq/posts_controller.rb
+++ b/app/controllers/kebapress/hq/posts_controller.rb
@@ -30,7 +30,7 @@ @post = Kebapress::Post.find(params[:id])
@post.commentable = false unless params[:commentable]
- @post.published = false unless params[:published]
+ @post.published = params[:post][:published] ? true : false
@post.published_at ||= Time.now if @post.published
@post.update(post_params)
|
Fix published boolean attribute error
|
diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/omniauth_callbacks_controller.rb
+++ b/app/controllers/omniauth_callbacks_controller.rb
@@ -6,6 +6,7 @@ id = auth[:uid]
login = auth[:info][:nickname]
image = auth[:info][:image]
+ token = auth[:credentials][:token]
@user = User.where(id: id).first_or_create(
login: login,
@@ -13,7 +14,16 @@ avatar_url: image,
rank: 0,
)
+ register_token(id, token)
+
sign_in @user
redirect_to @user
end
+
+ private
+
+ def register_token(user_id, token)
+ access_token = AccessToken.where(user_id: user_id).first_or_create(token: token)
+ access_token.update(token: token) if access_token.token != token
+ end
end
|
Store access token in login
|
diff --git a/app/controllers/user/registrations_controller.rb b/app/controllers/user/registrations_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/user/registrations_controller.rb
+++ b/app/controllers/user/registrations_controller.rb
@@ -1,5 +1,6 @@ class User::RegistrationsController < Devise::RegistrationsController
before_filter :configure_sign_up_params, only: [:create]
+ layout 'dashboard'
# before_filter :configure_account_update_params, only: [:update]
# GET /resource/sign_up
@@ -50,7 +51,7 @@
# The path used after sign up.
def after_sign_up_path_for(resource)
- dashboard_account
+ dashboard_account_path
end
# The path used after sign up for inactive accounts.
|
Fix redirect path after signup
|
diff --git a/app/models/manageiq/providers/storage_manager.rb b/app/models/manageiq/providers/storage_manager.rb
index abc1234..def5678 100644
--- a/app/models/manageiq/providers/storage_manager.rb
+++ b/app/models/manageiq/providers/storage_manager.rb
@@ -15,5 +15,10 @@ :foreign_key => :parent_ems_id,
:class_name => "ManageIQ::Providers::BaseManager",
:autosave => true
+
+ class << model_name
+ define_method(:route_key) { "ems_storages" }
+ define_method(:singular_route_key) { "ems_storage" }
+ end
end
end
|
Define model_name with route keys for the StorageManager model
|
diff --git a/app/representers/api/musical_work_representer.rb b/app/representers/api/musical_work_representer.rb
index abc1234..def5678 100644
--- a/app/representers/api/musical_work_representer.rb
+++ b/app/representers/api/musical_work_representer.rb
@@ -9,7 +9,7 @@ property :label
property :album
property :year
- property :excerpt_length, as: :length
+ property :excerpt_length, as: :duration
def self_url(musical_work)
polymorphic_path([:api, musical_work.story, musical_work])
|
Use duration rather than length for musical works
Having a `length` property does not seem to play well with the front end
|
diff --git a/app/workers/asset_manager_update_asset_worker.rb b/app/workers/asset_manager_update_asset_worker.rb
index abc1234..def5678 100644
--- a/app/workers/asset_manager_update_asset_worker.rb
+++ b/app/workers/asset_manager_update_asset_worker.rb
@@ -1,12 +1,12 @@ class AssetManagerUpdateAssetWorker < WorkerBase
- def perform(legacy_url_path, attributes = {})
+ def perform(legacy_url_path, new_attributes = {})
asset_manager = Services.asset_manager
gds_api_response = asset_manager.whitehall_asset(legacy_url_path).to_hash
- keys = attributes.keys
- unless gds_api_response.slice(*keys) == attributes.slice(*keys)
+ keys = new_attributes.keys
+ unless gds_api_response.slice(*keys) == new_attributes.slice(*keys)
asset_url = gds_api_response['id']
asset_id = asset_url[/\/assets\/(.*)/, 1]
- Services.asset_manager.update_asset(asset_id, attributes)
+ Services.asset_manager.update_asset(asset_id, new_attributes)
end
end
end
|
Rename attributes -> new_attributes in AssetManagerUpdateAssetWorker
I'm about to make some changes to this class and this will make them
easier.
|
diff --git a/Casks/intellij-idea-ce.rb b/Casks/intellij-idea-ce.rb
index abc1234..def5678 100644
--- a/Casks/intellij-idea-ce.rb
+++ b/Casks/intellij-idea-ce.rb
@@ -1,6 +1,6 @@ cask :v1 => 'intellij-idea-ce' do
- version '15.0'
- sha256 'e9d0f479e692463cda6ab81deda93d4145fb01968bb802a0d7be35e3e0eee73d'
+ version '15.0.1'
+ sha256 '70715153d78808493bd6f3da839b2f6872e4f94c423ca1f0d9fc848503a7e3ff'
url "https://download.jetbrains.com/idea/ideaIC-#{version}-custom-jdk-bundled.dmg"
name 'IntelliJ IDEA Community Edition'
|
Upgrade IntelliJ IDEA CE to 15.0.1.
|
diff --git a/test/helpers/magic_test_helper.rb b/test/helpers/magic_test_helper.rb
index abc1234..def5678 100644
--- a/test/helpers/magic_test_helper.rb
+++ b/test/helpers/magic_test_helper.rb
@@ -1,12 +1,38 @@ # frozen_string_literal: true
module MagicTestHelpers
- def capture_stderr
- require 'stringio'
- saved_stderr, $stderr = $stderr, StringIO.new
- [yield, $stderr.string]
- ensure
- $stderr = saved_stderr
+ def capture_stderr(children: false)
+ require 'thread'
+ semaphore = Mutex.new
+ if children
+ require 'tempfile'
+ captured_stderr = Tempfile.new('captured_stderr')
+ semaphore.synchronize do
+ backup_stderr = $stderr.dup
+ $stderr.reopen captured_stderr
+ begin
+ yield
+ $stderr.rewind
+ captured_stderr.read
+ ensure
+ captured_stderr.unlink
+ $stderr.reopen backup_stderr
+ end
+ end
+ else
+ require 'stringio'
+ captured_stderr = StringIO.new
+ semaphore.synchronize do
+ backup_stderr = $stderr
+ $stderr = captured_stderr
+ begin
+ yield
+ ensure
+ $stderr = backup_stderr
+ end
+ end
+ captured_stderr.string
+ end
end
def with_fixtures(fixtures = 'fixtures', &block)
|
Refactor the capture_stderr helper to capture child processes output
Signed-off-by: Krzysztof Wilczyński <5f1c0be89013f8fde969a8dcb2fa1d522e94ee00@linux.com>
|
diff --git a/test/orm_ext/activerecord_test.rb b/test/orm_ext/activerecord_test.rb
index abc1234..def5678 100644
--- a/test/orm_ext/activerecord_test.rb
+++ b/test/orm_ext/activerecord_test.rb
@@ -4,11 +4,33 @@
context "The ActiveRecord extension" do
setup do
- @account = ActiveRecordAccount.create
+ ActiveRecordTransaction.delete_all
end
should "be able to find the object in the database" do
- assert_equal @account, ActiveRecordAccount._t_find(@account.id)
+ account = ActiveRecordAccount.create
+ assert_equal account, ActiveRecordAccount._t_find(account.id)
+ end
+
+ should "be able to find the associates of an object" do
+ transaction_1 = ActiveRecordTransaction.create(:mongo_mapper_person_id => 'abc123')
+ transaction_2 = ActiveRecordTransaction.create(:mongo_mapper_person_id => 'abc123')
+ transaction_3 = ActiveRecordTransaction.create(:mongo_mapper_person_id => 'xyz456')
+ assert_set_equal [transaction_1, transaction_2], ActiveRecordTransaction._t_find_associates(:mongo_mapper_person_id, 'abc123')
+ end
+
+ should "be able to associate many objects with the given object" do
+ transaction = ActiveRecordTransaction.create
+ transaction._t_associate_many(:mongo_mapper_people, ['abc123', 'def456', 'ghi789'])
+ rows = ActiveRecordTransaction.connection.execute("select mongo_mapper_person_id from active_record_transactions_mongo_mapper_people where active_record_transaction_id = #{transaction.id}")
+ ids = []; rows.each { |r| ids << r[0] }; ids
+ assert_set_equal ['abc123', 'def456', 'ghi789'], ids
+ end
+
+ should "be able to get the ids of the objects associated with the given object" do
+ transaction = ActiveRecordTransaction.create
+ transaction._t_associate_many(:mongo_mapper_people, ['abc123', 'def456', 'ghi789'])
+ assert_set_equal ['abc123', 'def456', 'ghi789'], transaction._t_get_associate_ids(:mongo_mapper_people)
end
end
|
Add some tests for the activerecord extension
|
diff --git a/test/unit/policy_team_test.rb b/test/unit/policy_team_test.rb
index abc1234..def5678 100644
--- a/test/unit/policy_team_test.rb
+++ b/test/unit/policy_team_test.rb
@@ -6,15 +6,15 @@ refute policy_team.valid?
end
- test "should be invalid without an email" do
+ test "should be valid without an email" do
policy_team = build(:policy_team, email: "")
- refute policy_team.valid?
+ assert policy_team.valid?
end
- test "should be invalid without a unique email" do
+ test "should be valid without a unique email" do
existing_policy_team = create(:policy_team)
new_policy_team = build(:policy_team, email: existing_policy_team.email)
- refute new_policy_team.valid?
+ assert new_policy_team.valid?
end
test "should be invalid without a valid email" do
|
Fix tests on policy team
|
diff --git a/TodUni/spec/support/project_attributes.rb b/TodUni/spec/support/project_attributes.rb
index abc1234..def5678 100644
--- a/TodUni/spec/support/project_attributes.rb
+++ b/TodUni/spec/support/project_attributes.rb
@@ -0,0 +1,11 @@+def project_attributes(overrides = {})
+ {
+ name: "Test project",
+ description: "This projects is a test",
+ coordinates: "21.1250° N, 101.6860° W",
+ date_beginning: Date.new(2016,06,01),
+ date_end: Date.new(2016,12,31),
+ budget: 10000,
+ status: 1
+ }.merger(overrides)
+end
|
Add projects_attributes support ruby class for testing
|
diff --git a/db/migrate/20160527152831_unset_local_authority_contact_details.rb b/db/migrate/20160527152831_unset_local_authority_contact_details.rb
index abc1234..def5678 100644
--- a/db/migrate/20160527152831_unset_local_authority_contact_details.rb
+++ b/db/migrate/20160527152831_unset_local_authority_contact_details.rb
@@ -0,0 +1,17 @@+class UnsetLocalAuthorityContactDetails < Mongoid::Migration
+ def self.up
+ LocalAuthority.all.each do |authority|
+ authority.unset(:contact_address)
+ authority.unset(:contact_phone)
+ authority.unset(:contact_url)
+ authority.unset(:contact_email)
+ puts "unset contact details for #{authority.name}"
+ end
+ end
+
+ def self.down
+ # This is a destructive migration so the data can't be recovered from here.
+ # Revert the associated changes to the LocalContactImporter and run that to
+ # re-import the contact details instead.
+ end
+end
|
Delete existing local authority contact details
We don't need these any more.
|
diff --git a/frontend/app/views/format/_canadian_highlander.rb b/frontend/app/views/format/_canadian_highlander.rb
index abc1234..def5678 100644
--- a/frontend/app/views/format/_canadian_highlander.rb
+++ b/frontend/app/views/format/_canadian_highlander.rb
@@ -0,0 +1,12 @@+%p
+ %em Canadian Highlander
+ is an unofficial competitive non-rotating Singleton Constructed format. It uses 100-card decks without commanders.
+
+%p
+ Canadian Highlander's most distinctive feature is the points list, which allows the restriction of powerful cards in a singleton format without resorting to power-level bans. A deck can have up to 10 points. Lore Seeker automatically updates to the newest points list at least once per week.
+
+%p
+ %a{href: "https://canadianhighlander.wordpress.com/"} Official website
+
+%p
+ = search_help "restricted:canlander", "All cards on the points list"
|
Add format page for Canadian Highlander
|
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -1,7 +1,7 @@ class ApplicationController < ActionController::Base
include Slimmer::Headers
include Slimmer::SharedTemplates
- before_filter :set_slimmer_headers, :set_robots_headers
+ before_filter :set_slimmer_headers
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
@@ -14,20 +14,6 @@ response.headers[Slimmer::Headers::TEMPLATE_HEADER] = "header_footer_only"
end
- def set_robots_headers
- if finders_excluded_from_robots.include?(finder_slug)
- response.headers["X-Robots-Tag"] = "none"
- end
- end
-
- def finders_excluded_from_robots
- [
- 'aaib-reports',
- 'maib-reports',
- 'raib-reports',
- ]
- end
-
def finder_slug
params[:slug]
end
|
Allow robots to crawl reports
AAIB, MAIB and RAIB have now transitioned.
We now want the reports to appear in Google so they can be found by
users.
|
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -23,7 +23,8 @@ def default_url_options(options = {})
if I18n.locale != I18n.default_locale
{ locale: I18n.locale }.merge options
+ else
+ options
end
- options
end
end
|
Fix for passing along the locale param
I broke this in an earlier commit...
|
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -1,6 +1,7 @@ class ApplicationController < ActionController::Base
before_filter :prepare_nav
+ before_filter :update_sanitized_params, if: :devise_controller?
rescue_from CanCan::AccessDenied do |exception|
redirect_to root_path, :alert => exception.message
@@ -23,6 +24,10 @@ end
end
+ def update_sanitized_params
+ devise_parameter_sanitizer.for(:sign_up) {|u| u.permit(:email, :password, :password_confirmation, :name, :phone)}
+ end
+
# Method name must match with `config.authentication_method`
# in `config/initializers/active_admin.rb`
def authenticate_active_admin_user!
|
Add additional allowed parameters name and phone to devise controller (required for Rails 4 strong parameters).
|
diff --git a/app/extractors/bundestag_pdf_extractor.rb b/app/extractors/bundestag_pdf_extractor.rb
index abc1234..def5678 100644
--- a/app/extractors/bundestag_pdf_extractor.rb
+++ b/app/extractors/bundestag_pdf_extractor.rb
@@ -16,12 +16,13 @@ .gsub("\n", ' ')
.gsub(/\s+/, ' ')
.strip
+ .gsub(/\p{Other}/, '') # invisible chars & private use unicode
.sub(/^der\s/, '')
.sub(/\s\(.+\)$/, '') # remove city
.sub(/^Kleine\s+Anfrage\s+der\s+Abgeordneten\s+/, '') # duplicate prefix
people << person unless person.blank? || person == 'weiterer Abgeordneter'
end
- parties << m[1].gsub("\n", ' ').strip.sub(/^der\s/, '').sub(/\.$/, '')
+ parties << m[1].gsub("\n", ' ').strip.gsub(/\p{Other}/, '').sub(/^der\s/, '').sub(/\.$/, '')
end
{ people: people, parties: parties }
|
Remove private use unicode characters from names
|
diff --git a/app/models/block_layout.rb b/app/models/block_layout.rb
index abc1234..def5678 100644
--- a/app/models/block_layout.rb
+++ b/app/models/block_layout.rb
@@ -5,10 +5,12 @@
validates_presence_of :display_name
- scope :default_layout, -> { BlockLayout.find_by_slug('default') }
-
def self.resource_description
"A block layout is a grouping of blocks that may appear in a particular part of the page. For example, you may have block layouts that apply to the sidebar or header areas of a page."
+ end
+
+ def self.default_layout
+ BlockLayout.find_by_slug('default')
end
def slug_attribute
|
Move BlockLayout default_layout scope to class method
Rails 6.1 adds a deprecation notice related to class level scopes in
this instance.
|
diff --git a/app/models/organization.rb b/app/models/organization.rb
index abc1234..def5678 100644
--- a/app/models/organization.rb
+++ b/app/models/organization.rb
@@ -9,7 +9,7 @@ before_save :add_county
def add_county
- return unless county.nil? && primary_address
+ return if county.present? || addresses.empty?
if changed_attributes.keys.include?("addresses_attributes")
fetch_geocoding_data do |result|
self.county = result.address_components.find { |component|
|
Clean up return statement for readability
|
diff --git a/app/models/spree/credit_card_decorator.rb b/app/models/spree/credit_card_decorator.rb
index abc1234..def5678 100644
--- a/app/models/spree/credit_card_decorator.rb
+++ b/app/models/spree/credit_card_decorator.rb
@@ -0,0 +1,10 @@+module Spree
+ module CreditCardDecorator
+ def set_last_digits
+ self.last_digits ||= number.to_s.length <= 4 ? number : number.to_s.slice(-4..-1)
+ end
+
+ end
+end
+
+::Spree::CreditCard.prepend(::Spree::CreditCardDecorator)
|
Add card decorator to unify method last_digits
|
diff --git a/app/services/start_game.rb b/app/services/start_game.rb
index abc1234..def5678 100644
--- a/app/services/start_game.rb
+++ b/app/services/start_game.rb
@@ -40,14 +40,9 @@ end
def give_players_cards
- # each player picks up 5 cards
@game.players.each do |player|
@deck.pop(5).each do |card|
- @game.actions.create!(
- player: player,
- card: card,
- affect: Action::PICKUP,
- )
+ player.pickup(@game, card)
end
end
end
@@ -56,13 +51,8 @@ first_card = @deck.pop
dealer = @game.players.first
- [ Action::PICKUP, Action::PLAY ].each do |action_affect|
- @game.actions.create!(
- player: dealer,
- card: first_card,
- affect: action_affect,
- )
- end
+ dealer.pickup(@game, first_card)
+ dealer.play(@game, first_card)
end
def save_game
|
Refactor StartGame service to use convenience methods play/pickup
|
diff --git a/filmbuff.gemspec b/filmbuff.gemspec
index abc1234..def5678 100644
--- a/filmbuff.gemspec
+++ b/filmbuff.gemspec
@@ -11,6 +11,7 @@ s.description = 'Film Buff provides a Ruby wrapper for IMDb\'s JSON API, ' <<
'which is the fastest and easiest way to get information ' <<
'from IMDb.'
+ s.license = 'MIT'
s.required_ruby_version = '>= 2.0.0'
|
Add MIT license to gemspec
|
diff --git a/lib/tasks/database_record_validator.rb b/lib/tasks/database_record_validator.rb
index abc1234..def5678 100644
--- a/lib/tasks/database_record_validator.rb
+++ b/lib/tasks/database_record_validator.rb
@@ -32,9 +32,9 @@ end
end
- # TODO - make this dynamic?
def models
- [LinkSet, Link]
+ Rails.application.eager_load!
+ ActiveRecord::Base.descendants
end
end
end
|
Make DatabaseRecordValidator dynamically read tables
|
diff --git a/lib/web_console/exception_extension.rb b/lib/web_console/exception_extension.rb
index abc1234..def5678 100644
--- a/lib/web_console/exception_extension.rb
+++ b/lib/web_console/exception_extension.rb
@@ -0,0 +1,17 @@+module WebConsole
+ module ExceptionExtension
+ prepend_features Exception
+
+ def set_backtrace(*)
+ if caller_locations.none? { |loc| loc.path == __FILE__ }
+ @__web_console_bindings_stack = binding.callers.drop(1)
+ end
+
+ super
+ end
+
+ def __web_console_bindings_stack
+ @__web_console_bindings_stack || []
+ end
+ end
+end
|
Add exception extension to retrieve the stacktrace binding
|
diff --git a/app/workers/repository_download_worker.rb b/app/workers/repository_download_worker.rb
index abc1234..def5678 100644
--- a/app/workers/repository_download_worker.rb
+++ b/app/workers/repository_download_worker.rb
@@ -1,6 +1,6 @@ class RepositoryDownloadWorker
include Sidekiq::Worker
- sidekiq_options unique: true
+ sidekiq_options queue: :critical, unique: true
def perform(class_name, name)
klass = "Repositories::#{class_name}".constantize
|
Make repo downloads more important
|
diff --git a/test/unit/tracker_sparql_cursor_test.rb b/test/unit/tracker_sparql_cursor_test.rb
index abc1234..def5678 100644
--- a/test/unit/tracker_sparql_cursor_test.rb
+++ b/test/unit/tracker_sparql_cursor_test.rb
@@ -4,18 +4,18 @@ describe "#get_string" do
before do
conn = Tracker::SparqlConnection.get_direct nil
- @cursor = conn.query "SELECT ?url WHERE { ?x a nie:InformationElement; nie:url ?url. }", nil
+ @cursor = conn.query "SELECT 'Foo' { }", nil
@cursor.next nil
end
it "returns just the string value" do
- assert_instance_of String, @cursor.get_string(0)
+ @cursor.get_string(0).must_equal "Foo"
end
it "can safely be called twice" do
@cursor.get_string(0)
- assert_instance_of String, @cursor.get_string(0)
+ @cursor.get_string(0).must_equal "Foo"
end
end
end
|
Use simpler SPARQL query that does not require Tracker to have data.
|
diff --git a/OAuthSwift.podspec b/OAuthSwift.podspec
index abc1234..def5678 100644
--- a/OAuthSwift.podspec
+++ b/OAuthSwift.podspec
@@ -9,7 +9,7 @@ s.source = { :git => 'https://github.com/dongri/OAuthSwift.git', :tag => s.version }
s.source_files = 'OAuthSwift/*.swift'
s.ios.deployment_target = '8.0'
- s.osx.deployment_target = '10.9'
+ s.osx.deployment_target = '10.10'
s.requires_arc = false
end
|
Fix error: `'parentViewController' is only available on OS X 10.10 or newer`
|
diff --git a/recipes/munin_sidekiq_memory.rb b/recipes/munin_sidekiq_memory.rb
index abc1234..def5678 100644
--- a/recipes/munin_sidekiq_memory.rb
+++ b/recipes/munin_sidekiq_memory.rb
@@ -2,7 +2,6 @@ notifies :restart, "service[munin-node]"
end
-cookbook_file File.join(node['munin']['plugin_dir'], 'omnibus_gitlab_sidekiq_rss') do
- mode "0755"
+munin_plugin 'omnibus_gitlab_sidekiq_rss' do
notifies :restart, "service[munin-node]"
end
|
Use munin_plugin to render the plugin
|
diff --git a/fit-commit.gemspec b/fit-commit.gemspec
index abc1234..def5678 100644
--- a/fit-commit.gemspec
+++ b/fit-commit.gemspec
@@ -12,7 +12,6 @@ gem.description = "A Git hook to validate your commit messages based on community standards."
gem.files = `git ls-files`.split("\n")
gem.executables = ["fit-commit"]
- gem.default_executable = "fit-commit"
gem.test_files = `git ls-files -- test/*`.split("\n")
gem.require_paths = ["lib"]
gem.extra_rdoc_files = ["README.md"]
|
Remove deprecated default_executable gem attribute
|
diff --git a/assignments/assignment1.rb b/assignments/assignment1.rb
index abc1234..def5678 100644
--- a/assignments/assignment1.rb
+++ b/assignments/assignment1.rb
@@ -24,13 +24,5 @@ note.play(@duration.text.to_i, @amplitude.text.to_i)
end
end
- # require 'jsound'
- # output = JSound::Midi::OUTPUTS.find /SimpleSynth/ if output.nil?
- # stack margin: 10 do
- # @play_midi = button("Play the tone with frequency #{frequency} for #{duration} seconds via SympleSynth") do
- # @note = Ceely::Note.new(@frequency.text.to_i)
- # @note.play_midi(duration, output)
- # end
- # end
end
end
|
Remove MIDI :poop: since it's not being used :rainbow:
|
diff --git a/plugins/distribution/test/unit/distribution_plugin_session_test.rb b/plugins/distribution/test/unit/distribution_plugin_session_test.rb
index abc1234..def5678 100644
--- a/plugins/distribution/test/unit/distribution_plugin_session_test.rb
+++ b/plugins/distribution/test/unit/distribution_plugin_session_test.rb
@@ -10,6 +10,7 @@
@node = DistributionPluginNode.create!(:profile => @profile, :role => 'collective')
@node.products = @profile.products.map { |p| DistributionPluginSessionProduct.create!(:product => p) }
+ DistributionPluginDeliveryMethod.create! :name => 'at home', :delivery_type => 'pickup', :node => @node
@session = DistributionPluginSession.create!(:node => @node)
end
@@ -17,4 +18,11 @@ assert_equal @session.products.collect(&:product_id), @node.products.collect(&:id)
end
+ should 'have at least one delivery method unless in edition status' do
+ session = DistributionPluginSession.create! :node => @node, :name => "Testes batidos", :start => DateTime.now, :status => 'edition'
+ assert session
+ session.status = 'orders'
+ assert_nil session.save!
+ end
+
end
|
Add validation test to session
|
diff --git a/lib/ares.rb b/lib/ares.rb
index abc1234..def5678 100644
--- a/lib/ares.rb
+++ b/lib/ares.rb
@@ -7,9 +7,10 @@ require 'ico-validator'
module Ares
- cattr_accessor :timeout do
- 5
- end
+ DEFAULT_TIMEOUT = 5
+
+ @@timeout = DEFAULT_TIMEOUT
+ mattr_accessor :timeout
class << self
include Ares::Logging
|
Use mattr_accessor and make 5 seconds as constant
|
diff --git a/fork_break.gemspec b/fork_break.gemspec
index abc1234..def5678 100644
--- a/fork_break.gemspec
+++ b/fork_break.gemspec
@@ -10,8 +10,8 @@ gem.homepage = 'http://github.com/forkbreak/fork_break'
gem.licenses = ['MIT']
gem.files = `git ls-files`.split($OUTPUT_RECORD_SEPARATOR)
- gem.executables = gem.files.grep(/^bin\//).map { |f| File.basename(f) }
- gem.test_files = gem.files.grep(/^(test|spec|features)\//)
+ gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.name = 'fork_break'
gem.require_paths = ['lib']
gem.version = ForkBreak::VERSION
|
Update regex syntax in gemspec
Gemspec was failing builds due to
fork_break.gemspec:14:38: C: Use %r around regular expression.
gem.test_files = gem.files.grep(/^(test|spec|features)\//)
Updated the regular expressions
|
diff --git a/lib/bson.rb b/lib/bson.rb
index abc1234..def5678 100644
--- a/lib/bson.rb
+++ b/lib/bson.rb
@@ -3,8 +3,20 @@ require "bson/types"
require "bson/version"
+# Determin if we are using JRuby or not.
+#
+# @example Are we running with JRuby?
+# jruby?
+#
+# @return [ true, false ] If JRuby is our vm.
+#
+# @since 2.0.0
+def jruby?
+ RUBY_ENGINE == "jruby"
+end
+
begin
- require "bson/native"
+ jruby? ? require("bson/native.jar") : require("bson/native")
rescue LoadError
$stderr.puts("BSON is using the pure Ruby buffer implementation.")
end
|
Update requires with jruby example
|
diff --git a/jirabot.rb b/jirabot.rb
index abc1234..def5678 100644
--- a/jirabot.rb
+++ b/jirabot.rb
@@ -1,4 +1,7 @@ require 'slack-ruby-bot'
+require "net/https"
+require "uri"
+require "JSON"
class JiraBot < SlackRubyBot::Bot
match(/([a-z]+-[0-9]+)/i) do |client, data, issues|
@@ -14,9 +17,29 @@ # Now grab everything that looks like a JIRA ticket, dump it into an array, grab uniques.
tomatch.scan(/([a-z]+-[0-9]+)/i) do |i,j|
- results << 'https://ticketfly.jira.com/browse/'+i.upcase
+ results << i.upcase
end
- client.say(channel: data.channel, text: results.uniq.join("\n"))
+ results.uniq.each do |ticket|
+ url = ENV["JIRA_PREFIX"]+"rest/api/latest/issue/"+ticket
+ direct = ENV["JIRA_PREFIX"]+"browse/"+ticket
+ uri = URI.parse(url)
+ http = Net::HTTP.new(uri.host, uri.port)
+ http.use_ssl = true
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
+
+ request = Net::HTTP::Get.new(uri.request_uri)
+ request.basic_auth(ENV["JIRA_USER"],ENV["JIRA_PASS"])
+ response = http.request(request)
+ body = JSON.parse(response.body)
+ if response.code == "200"
+ message = "#{direct}\n\n#{body['fields']['summary']}\n#{body['fields']['issuetype']['name']} (#{body['fields']['status']['name']})"
+ else
+ message = direct
+ end
+ client.say(channel: data.channel, text: message)
+ end
+
+
end
end
|
Call JIRA and fetch issue details
|
diff --git a/app/models/address.rb b/app/models/address.rb
index abc1234..def5678 100644
--- a/app/models/address.rb
+++ b/app/models/address.rb
@@ -1,5 +1,8 @@ class Address < ActiveRecord::Base
belongs_to :user
+ validates :user, presence: true
+ validates :title, :receiver, :street, :country, :state,
+ :city, :postal_code, presence: true
def country_name
country_iso = ISO3166::Country[country]
|
Add validations for Address model
|
diff --git a/app/models/service.rb b/app/models/service.rb
index abc1234..def5678 100644
--- a/app/models/service.rb
+++ b/app/models/service.rb
@@ -28,7 +28,7 @@ validates_with_method :service_type_exists?
def service_type
- service_type_type.to_s.constantize
+ service_type_type.to_s # TODO .constantize
end
def service_type_exists?
|
Comment out use of constantize
Signed-off-by: Alex Coles <60c6d277a8bd81de7fdde19201bf9c58a3df08f4@alexcolesportfolio.com>
|
diff --git a/gemfresh.gemspec b/gemfresh.gemspec
index abc1234..def5678 100644
--- a/gemfresh.gemspec
+++ b/gemfresh.gemspec
@@ -1,6 +1,6 @@ Gem::Specification.new do |s|
s.name = 'gemfresh'
- s.version = '1.0.2'
+ s.version = '1.0.3'
s.platform = Gem::Platform::RUBY
s.authors = ['Jon Williams']
s.email = ['jon@jonathannen.com']
|
Move to 1.0.3 bugfix release
|
diff --git a/spec/certificate_validation_spec.rb b/spec/certificate_validation_spec.rb
index abc1234..def5678 100644
--- a/spec/certificate_validation_spec.rb
+++ b/spec/certificate_validation_spec.rb
@@ -19,7 +19,8 @@ 'Mozilla NSS' => true,
'Microsoft' => true,
'Apple' => true,
- 'Java 6' => true
+ 'Java 6' => true,
+ 'Google' => true
}
end
end
|
Add the new Google entry.
|
diff --git a/spec/grape/integration/rack_spec.rb b/spec/grape/integration/rack_spec.rb
index abc1234..def5678 100644
--- a/spec/grape/integration/rack_spec.rb
+++ b/spec/grape/integration/rack_spec.rb
@@ -21,7 +21,7 @@
unless RUBY_PLATFORM == 'java'
major, minor, release = Rack.release.split('.').map(&:to_i)
- pending 'Rack 1.5.3 or 1.6.1 required' unless major >= 1 && ((minor == 5 && release >= 3) || (minor >= 6))
+ pending 'Rack >= 1.5 required' unless ((major == 1 && minor >= 5) || (major > 1))
end
expect(JSON.parse(app.call(env)[2].body.first)['params_keys']).to match_array('test')
|
Check for Rack >= 1.5
|
diff --git a/spec/mailers/admin_notifier_spec.rb b/spec/mailers/admin_notifier_spec.rb
index abc1234..def5678 100644
--- a/spec/mailers/admin_notifier_spec.rb
+++ b/spec/mailers/admin_notifier_spec.rb
@@ -1,5 +1,26 @@ require "rails_helper"
RSpec.describe AdminNotifierMailer, type: :mailer do
- #pending "add some examples to (or delete) #{__FILE__}"
+
+ describe 'Email notification' do
+ let(:matrix) { SubmittedMatrix.new({submitter_name: "John Lennon and Paul McCartney",
+ submitter_email: "paul@thebeatles.com",
+ display_email: "false",
+ name: "Help!",
+ kind: "Other",
+ notes: "Help, I need somebody.\nHelp, not just anybody.\nHelp, you know I need someone.\nHelp!",
+ submitter_url: "www.google.com",
+ submitter_confidentiality: "true",
+ ip: "127.0.0.1"}) }
+ let(:mail) { AdminNotifierMailer.send_matrix_submitted_email(matrix) }
+
+ it 'renders the subject' do
+ expect(mail.subject).to eq('[SuiteSparse Matrix Collection] New Matrix Submitted!')
+ end
+
+ it 'renders the sender email' do
+ expect(mail.body.encoded)
+ .to match(/.*paul@thebeatles\.com.*/)
+ end
+ end
end
|
Add test for notification email
|
diff --git a/capistrano-fanfare.gemspec b/capistrano-fanfare.gemspec
index abc1234..def5678 100644
--- a/capistrano-fanfare.gemspec
+++ b/capistrano-fanfare.gemspec
@@ -14,4 +14,7 @@ gem.name = "capistrano-fanfare"
gem.require_paths = ["lib"]
gem.version = Capistrano::Fanfare::VERSION
+
+ gem.add_dependency "capistrano", "~> 2.9"
+ gem.add_dependency "capistrano_colors", "~> 0.5"
end
|
Add capistrano and capistrano_colors as dependencies.
|
diff --git a/lib/kari.rb b/lib/kari.rb
index abc1234..def5678 100644
--- a/lib/kari.rb
+++ b/lib/kari.rb
@@ -0,0 +1,48 @@+require 'camping'
+
+Camping.goes :Kari
+
+module Kari
+ module Controllers
+ class Index < R '/'
+ def get
+ render :index
+ end
+ end
+ end
+
+ module Views
+ def layout
+ xhtml_strict do
+ head do
+ title 'Kari · Search for Ruby documentation'
+ end
+ body do
+ yield
+ end
+ end
+ end
+
+ def index
+ h1 'Welcome to Kari, please enter your search'
+ _form
+ end
+
+ def result
+ h1 "Results for: #{@q}"
+ _form
+ self << @results
+ end
+
+ def _form
+ form :action => '/', :method => 'get' do
+ div do
+ label do
+ text 'Search:'
+ input :type => 'text', :name => 'q', :class => 'search', :value => '', :size => 60
+ end
+ end
+ end
+ end
+ end
+end
|
Add an initial Kari camping app to the main source tree.
git-svn-id: e0fade74c25be90edb0606ce8d40d6c0447cda8b@54 7a99d2f0-d533-0410-96fe-f25cb2755c1e
|
diff --git a/lib/wanikani/recent_unlocks.rb b/lib/wanikani/recent_unlocks.rb
index abc1234..def5678 100644
--- a/lib/wanikani/recent_unlocks.rb
+++ b/lib/wanikani/recent_unlocks.rb
@@ -10,31 +10,15 @@ return api_response["requested_information"]
end
- # Gets the recent unlocked radicals.
- #
- # @param [Integer] limit the total number of items returned.
- # @return [Array] Returns hashes of unlocked radicals and related information.
- def self.radicals(limit = 10)
+ private
+
+ def self.method_missing(name, *args)
+ super unless [:radicals, :vocabulary, :kanji].include?(name)
+
+ limit = args.shift || 10
+ type = name == :radicals ? name.to_s.chop! : name.to_s
unlock_list = self.list(limit)
- return unlock_list.select { |unlock| unlock["type"] == "radical" }
- end
-
- # Gets the recent unlocked vocabulary.
- #
- # @param [Integer] limit the total number of items returned.
- # @return [Array] Returns hashes of unlocked vocabulary and related information.
- def self.vocabulary(limit = 10)
- unlock_list = self.list(limit)
- return unlock_list.select { |unlock| unlock["type"] == "vocabulary" }
- end
-
- # Gets the recent unlocked Kanji.
- #
- # @param [Integer] limit the total number of items returned.
- # @return [Array] Returns hashes of unlocked Kanji and related information.
- def self.kanji(limit = 10)
- unlock_list = self.list(limit)
- return unlock_list.select { |unlock| unlock["type"] == "kanji" }
+ return unlock_list.select { |unlock| unlock["type"] == type }
end
end
end
|
Clean up RecentUnlocks code duplication
|
diff --git a/data-exploration/enrich_outsourcer_csv.rb b/data-exploration/enrich_outsourcer_csv.rb
index abc1234..def5678 100644
--- a/data-exploration/enrich_outsourcer_csv.rb
+++ b/data-exploration/enrich_outsourcer_csv.rb
@@ -1,21 +1,21 @@ # rubocop:disable all
+# Use a CSV with Burden IDs to create a new CSV with complementary data from Burden
+#
# Usage:
-# From a Burden `gris console`:
+# From within a Burden `gris console`:
#
-# load '/path/to/this/file.rb'
+# load '/full/path/to/enrich_outsourcer_csv.rb'
# input_file = "/Users/lancew/Code/bearden/data/outsourcers/artist-rosters/01/artist-rosters-batch-1-combined.csv"
-# output_file = "/Users/lancew/Code/bearden/data/outsourcers/artist-rosters/01/burden-artist-rosters-batch-1-combined.csv"
-# EnrichOutsourcerCSV.create_burden_csv(input_file, output_file)
+# EnrichOutsourcerCSV.create_burden_csv(input_file)
class EnrichOutsourcerCSV
- def create_burden_csv(input_file, output_file)
- new(input_file, output_file).create_burden_csv
+ def create_burden_csv(input_file)
+ new(input_file).create_burden_csv
end
- def initialize(input_file, output_file)
+ def initialize(input_file)
@input_file = input_file
- @output_file = output_file
end
def self.create_burden_csv
@@ -28,4 +28,13 @@ )
end
end
+
+ private
+
+ def output_file
+ path = @input_file.split('/')
+ file_name = path.pop
+ (path << "burden-complement-#{file_name}").join('/')
+ end
+
end
|
Refactor so you don't have to define an output file
|
diff --git a/lib/nehm.rb b/lib/nehm.rb
index abc1234..def5678 100644
--- a/lib/nehm.rb
+++ b/lib/nehm.rb
@@ -1,10 +1,11 @@-require 'colored'
require 'highline'
require 'nehm/applescript'
-require 'nehm/argument_processor'
+require 'nehm/argument_parser'
require 'nehm/artwork'
require 'nehm/cfg'
+require 'nehm/command'
+require 'nehm/command_manager'
require 'nehm/configure'
require 'nehm/client'
require 'nehm/get'
@@ -14,6 +15,7 @@ require 'nehm/playlist'
require 'nehm/playlist_manager'
require 'nehm/track'
+require 'nehm/ui'
require 'nehm/user'
require 'nehm/user_manager'
require 'nehm/version'
@@ -22,22 +24,7 @@ def self.start(args)
init unless initialized?
- command = args.shift
- case command
- when 'get'
- Get[:get, args]
- when 'dl'
- Get[:dl, args]
- when 'configure'
- Configure.menu
- when 'version'
- puts Nehm::VERSION
- when 'help', nil
- Help.show(args.first)
- else
- puts "Invalid command '#{command}'".red
- puts "Input #{'nehm help'.yellow} for all avalaible commands"
- end
+ CommandManager.run(args)
end
module_function
|
Add some dependencies and edit Nehm.start command
|
diff --git a/plugins/delivery/models/delivery_plugin/option.rb b/plugins/delivery/models/delivery_plugin/option.rb
index abc1234..def5678 100644
--- a/plugins/delivery/models/delivery_plugin/option.rb
+++ b/plugins/delivery/models/delivery_plugin/option.rb
@@ -1,4 +1,7 @@ class DeliveryPlugin::Option < Noosfero::Plugin::ActiveRecord
+
+ # FIXME: some unknown code is overwriting this to orders_cycle_plugin_cycles
+ set_table_name 'delivery_plugin_options'
belongs_to :delivery_method, :class_name => 'DeliveryPlugin::Method'
belongs_to :owner, :polymorphic => true
|
Fix weird issue on has_many association with polymorphic
|
diff --git a/knockout_forms-rails.gemspec b/knockout_forms-rails.gemspec
index abc1234..def5678 100644
--- a/knockout_forms-rails.gemspec
+++ b/knockout_forms-rails.gemspec
@@ -22,5 +22,5 @@ spec.add_development_dependency "rake"
spec.add_runtime_dependency "railties", [">= 3.1", "< 5"]
- spec.add_runtime_dependency "actionview"
+ spec.add_runtime_dependency "actionview", [">= 3", "< 5"]
end
|
Set dependency version for actionview
|
diff --git a/sample-apps/ruby-with-services/cloudcredo.rb b/sample-apps/ruby-with-services/cloudcredo.rb
index abc1234..def5678 100644
--- a/sample-apps/ruby-with-services/cloudcredo.rb
+++ b/sample-apps/ruby-with-services/cloudcredo.rb
@@ -9,14 +9,14 @@ end
get '/' do
- 'CloudCredo help you deliver value with Cloud Foundry!'
+ 'CloudCredo helps you deliver value with Cloud Foundry!'
end
get '/set/:key/to/:value' do
$redis.set(params[:key], params[:value])
"set #{params[:key]} to #{params[:value]}"
end
-
+
get '/get/:key' do
$redis.get(params[:key])
end
|
Fix typo in Ruby default app
|
diff --git a/spec/factories/organizations.rb b/spec/factories/organizations.rb
index abc1234..def5678 100644
--- a/spec/factories/organizations.rb
+++ b/spec/factories/organizations.rb
@@ -11,6 +11,7 @@ organization_type_id { 2 }
sequence(:name) { |n| "Org #{n}" }
short_name {name}
+ legal_name {name}
license_holder { true }
end
|
[TTPLAT-1117] Add legal name to organization factories.
|
diff --git a/spec/features/generator_spec.rb b/spec/features/generator_spec.rb
index abc1234..def5678 100644
--- a/spec/features/generator_spec.rb
+++ b/spec/features/generator_spec.rb
@@ -4,6 +4,7 @@ scenario 'stylesheets assets files are added' do
application_css_file = IO.read("#{dummy_app_path}/app/assets/stylesheets/application.css")
+ expect(File).to exist("#{dummy_app_path}/app/assets/stylesheets/_settings.scss")
expect(File).to exist("#{dummy_app_path}/app/assets/stylesheets/foundation_and_overrides.scss")
expect(application_css_file).to match(/require foundation_and_overrides/)
end
|
Update stylesheets assets files test to check for _settings.scss presence
|
diff --git a/lib/gitlab/build/get/geo/trigger.rb b/lib/gitlab/build/get/geo/trigger.rb
index abc1234..def5678 100644
--- a/lib/gitlab/build/get/geo/trigger.rb
+++ b/lib/gitlab/build/get/geo/trigger.rb
@@ -9,7 +9,7 @@
class <<self
def get_project_path
- 'gitlab-org/quality/gitlab-environment-toolkit-configs/Geo'
+ 'gitlab-org/geo-team/geo-ci'
end
def get_access_token
@@ -18,7 +18,7 @@
def get_params(image: nil)
{
- 'ref' => 'main',
+ 'ref' => Gitlab::Util.get_env('GET_GEO_REF') || 'main',
'token' => Gitlab::Util.get_env('GET_GEO_QA_TRIGGER_TOKEN'),
'variables[ENVIRONMENT_ACTION]' => 'tmp-env',
'variables[QA_IMAGE]' => Gitlab::Util.get_env('QA_IMAGE') || 'master',
|
Update to use new repository
* Geo specific CI jobs were moved to a separate project
|
diff --git a/lib/booking_locations/api.rb b/lib/booking_locations/api.rb
index abc1234..def5678 100644
--- a/lib/booking_locations/api.rb
+++ b/lib/booking_locations/api.rb
@@ -19,6 +19,7 @@ def headers_and_options
{}.tap do |hash|
hash[:read_timeout] = read_timeout
+ hash[:open_timeout] = open_timeout
hash['Authorization'] = "Bearer #{bearer_token}" if bearer_token
hash['Accept'] = 'application/json'
end
@@ -35,5 +36,9 @@ def read_timeout
ENV.fetch('BOOKING_LOCATIONS_API_READ_TIMEOUT', 5).to_i
end
+
+ def open_timeout
+ ENV.fetch('BOOKING_LOCATIONS_API_OPEN_TIMEOUT', 5).to_i
+ end
end
end
|
Allow open timeout to be configurable
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.