diff stringlengths 65 26.7k | message stringlengths 7 9.92k |
|---|---|
diff --git a/cf_spec/unit/python_unit_specs_spec.rb b/cf_spec/unit/python_unit_specs_spec.rb
index abc1234..def5678 100644
--- a/cf_spec/unit/python_unit_specs_spec.rb
+++ b/cf_spec/unit/python_unit_specs_spec.rb
@@ -0,0 +1,19 @@+$: << 'cf_spec'
+require 'cf_spec_helper'
+require 'open3'
+
+describe 'python unit tests' do
+ let(:python_unit_test_command) { './run_tests.sh' }
+
+ it "should all pass" do
+ _, stdout, stderr, wait_thr = Open3.popen3(python_unit_test_command)
+ exit_status = wait_thr.value
+ unless exit_status.success?
+ puts "Python Unit Tests stdout:"
+ puts stdout.read
+ puts "Python Unit Tests stderr:"
+ puts stderr.read
+ end
+ expect(wait_thr.value).to eq(0)
+ end
+end
| Add rspec test that runs python unit test suite
- Prints unit test suite stdout and stderr in failure case
Signed-off-by: David Jahn <ea2208fe99a56ed20c9ae20b0a1446b61f13a269@gmail.com>
|
diff --git a/app/controllers/teams/members_controller.rb b/app/controllers/teams/members_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/teams/members_controller.rb
+++ b/app/controllers/teams/members_controller.rb
@@ -43,7 +43,7 @@ protected
def team_member
- @member ||= user_team.members.find(params[:id])
+ @member ||= user_team.members.find_by_username(params[:id])
end
end
| Update user finding (by username) in teams members (team of users) controller
|
diff --git a/breadcrumbs_on_rails_to_gretel.gemspec b/breadcrumbs_on_rails_to_gretel.gemspec
index abc1234..def5678 100644
--- a/breadcrumbs_on_rails_to_gretel.gemspec
+++ b/breadcrumbs_on_rails_to_gretel.gemspec
@@ -15,12 +15,15 @@ spec.license = "MIT"
spec.files = Dir['lib/**/*.rb'] + Dir['lib/tasks/*.rake']
- spec.test_files = spec.files.grep(%r{^spec/})
+ spec.test_files = Dir['spec/*_spec.rb']
spec.require_paths = ['lib', 'lib/tasks']
spec.required_ruby_version = ">= 2.0.0"
spec.add_dependency "rails", ">= 3.0.0"
- spec.add_development_dependency "ruby2ruby"
- spec.add_development_dependency "bundler", "~> 1.8"
- spec.add_development_dependency "rake", "~> 10.0"
-end
+ spec.add_dependency "ruby2ruby"
+ spec.add_dependency "ruby_parser"
+
+ spec.add_development_dependency "pry"
+ spec.add_development_dependency "rspec"
+ spec.add_development_dependency "rake"
+end | Update some dependencies for tests
|
diff --git a/app/controllers/spree/api/variants_controller_decorator.rb b/app/controllers/spree/api/variants_controller_decorator.rb
index abc1234..def5678 100644
--- a/app/controllers/spree/api/variants_controller_decorator.rb
+++ b/app/controllers/spree/api/variants_controller_decorator.rb
@@ -0,0 +1,11 @@+Spree::Api::VariantsController.class_eval do
+ def update
+ authorize! :update, Spree::Variant
+ @variant = Spree::Variant.find(params[:id])
+ if @variant.update_attributes(params[:variant])
+ respond_with(@variant, :status => 200, :default_template => :show)
+ else
+ invalid_resource!(@product)
+ end
+ end
+end | Change update method to avoid ActiveRecord::ReadOnly when updating variant
|
diff --git a/app/serializers/trade/shipment_api_from_view_serializer.rb b/app/serializers/trade/shipment_api_from_view_serializer.rb
index abc1234..def5678 100644
--- a/app/serializers/trade/shipment_api_from_view_serializer.rb
+++ b/app/serializers/trade/shipment_api_from_view_serializer.rb
@@ -1,9 +1,42 @@ class Trade::ShipmentApiFromViewSerializer < ActiveModel::Serializer
- attributes :id , :year, :appendix, :taxon, :class, :order, :family, :genus,
+ attributes :id , :year, :appendix, :taxon, :klass, :order, :family, :genus,
:term, :importer_reported_quantity, :exporter_reported_quantity,
:unit, :importer, :importer_iso, :exporter, :exporter_iso, :origin, :purpose, :source,
:import_permit, :export_permit, :origin_permit, :issue_type,
:compliance_type_taxonomic_rank
+
+
+ def importer
+ object.importer || object.attributes["importer"]
+ end
+
+ def exporter
+ object.exporter || object.attributes["exporter"]
+ end
+
+ def origin
+ object.origin || object.attributes["origin"]
+ end
+
+ def term
+ object.term || object.attributes["term"]
+ end
+
+ def unit
+ object.unit || object.attributes["unit"]
+ end
+
+ def source
+ object.source || object.attributes["source"]
+ end
+
+ def purpose
+ object.purpose || object.attributes["purpose"]
+ end
+
+ def klass
+ object.attributes["class"]
+ end
def importer_reported_quantity
object.attributes['importer_reported_quantity'] || object.attributes['importer_quantity']
| Add missing fields and fix existing ones
|
diff --git a/spec/support/helpers/authorization_request_helper.rb b/spec/support/helpers/authorization_request_helper.rb
index abc1234..def5678 100644
--- a/spec/support/helpers/authorization_request_helper.rb
+++ b/spec/support/helpers/authorization_request_helper.rb
@@ -30,7 +30,7 @@ end
def i_should_be_on_client_callback(client)
- client.redirect_uri.should == "#{current_uri.scheme}://#{current_uri.hostname}#{current_uri.path}"
+ client.redirect_uri.should == "#{current_uri.scheme}://#{current_uri.host}#{current_uri.path}"
end
end
| Use host instead of hostname for URI
|
diff --git a/app/helpers/form_helper.rb b/app/helpers/form_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/form_helper.rb
+++ b/app/helpers/form_helper.rb
@@ -7,7 +7,7 @@ content_tag(:ul) do
object.errors.values.flatten.map do |err|
content_tag(:li, err)
- end.join
+ end.join.html_safe
end
end
end
| Mark validation errors as HTML-safe
|
diff --git a/app/models/app_settings.rb b/app/models/app_settings.rb
index abc1234..def5678 100644
--- a/app/models/app_settings.rb
+++ b/app/models/app_settings.rb
@@ -1,3 +1,7 @@ class AppSettings < Settingslogic
- source Rails.root.join("config/app_settings.yml")
+ # This points at /var/vcap/packages, not /var/vcap/jobs which is where
+ # BOSH renders the config templates.
+ #source Rails.root.join("config/app_settings.yml")
+
+ source '/var/vcap/jobs/cf-mysql-broker/config/app_settings.yml'
end | Use correct path to app settings.
|
diff --git a/app/models/progress_bar.rb b/app/models/progress_bar.rb
index abc1234..def5678 100644
--- a/app/models/progress_bar.rb
+++ b/app/models/progress_bar.rb
@@ -17,6 +17,11 @@ line_progress.times { line_fill_part += "=" }
(40 - line_progress).times { line_empty_part += " " }
- return "\r #{@file_name} [#{line_fill_part}#{line_empty_part}] #{percentage_progress} (#{n} out of #{@total_size})"
+ header = "#{@file_name}"
+ filler_space = ' ' * (24 - @file_name.size)
+ bar_body = "[#{line_fill_part}#{line_empty_part}] "
+ progress_text = "#{percentage_progress} (#{n} out of #{@total_size}) "
+
+ "\r " + header + filler_space + bar_body + ' ' + progress_text
end
end
| Make progress bars line up nicely
Like this:
students_export.txt [========================================] 100% (5017 out of 5017)
assessment_export.txt [====== ] 16% (21899 out of 133358)
Instead of this:
students_export.txt [========================================] 100% (5017 out of 5017)
assessment_export.txt [====== ] 16% (21899 out of 133358)
|
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
@@ -8,12 +8,9 @@
def call
@game.with_lock do
- assert_game_ready &&
- remove_pending &&
- shuffle_deck &&
- give_players_cards &&
- play_first_card &&
- save_game!
+ flag_started!
+
+ shuffle_deck && divvy_up_cards! if errors.none?
end
@errors.none?
@@ -21,27 +18,34 @@
private
- def assert_game_ready
- return true if @game.ready?
- @errors.push "game not ready to start"
- false
+ def check_game_ready
+ if @game.ready?
+ true
+ else
+ @errors.push "game not ready to start"
+ false
+ end
end
- def remove_pending
- if @game.pending
- @game.pending = false
- return true
+ def flag_started!
+ if !@game.ready?
+ @errors.push "game not ready to start"
+ elsif !@game.pending
+ @errors.push "game already started"
+ else
+ return @game.update!(pending: false)
end
-
- @errors.push "game already started"
- false
end
def shuffle_deck
@deck = Deck::PLATONIC.shuffle
end
- def give_players_cards
+ def divvy_up_cards!
+ give_players_cards! && play_first_card!
+ end
+
+ def give_players_cards!
@game.players.each do |player|
@deck.pop(5).each do |card|
player.pickup!(card)
@@ -49,15 +53,11 @@ end
end
- def play_first_card
+ def play_first_card!
first_card = @deck.pop
dealer = @game.players.first
dealer.pickup!(first_card)
dealer.play!(first_card)
end
-
- def save_game!
- @game.save!
- end
end
| Refactor StartGame service for readability
|
diff --git a/test/form_forms/elements/block_test.rb b/test/form_forms/elements/block_test.rb
index abc1234..def5678 100644
--- a/test/form_forms/elements/block_test.rb
+++ b/test/form_forms/elements/block_test.rb
@@ -0,0 +1,32 @@+require 'test_helper'
+
+class FieldsetTest < ActionView::TestCase
+ test "create a block" do
+ with_form_for(@user) do |form|
+ form.block(:red_box, :div, :class => "red_box") do |block|
+ block.field(:credit_card) {|f| f.input :credit_card}
+ end
+ end
+
+ assert_select 'form > div.red_box input.string#user_credit_card'
+ end
+
+ test "allow nesting of blocks" do
+ with_form_for(@user) do |form|
+ form.block(:main, :div, :id => 'main') do |outer|
+ outer.fieldset(:payment, :id => "payment") do |inner|
+ inner.legend "These are some fields"
+ inner.field(:credit_card) {|f| f.input :credit_card}
+ end
+
+ outer.field(:name) {|f| f.input :name}
+ end
+ end
+
+ assert_no_select 'fieldset#main > legend'
+ assert_select 'form > div#main > div > input.string#user_name'
+
+ assert_select 'form > div#main > fieldset#payment > legend', "These are some fields"
+ assert_select 'form > div#main > fieldset#payment input.string#user_credit_card'
+ end
+end | Add tests for block elements
|
diff --git a/lib/lita/handlers/greet.rb b/lib/lita/handlers/greet.rb
index abc1234..def5678 100644
--- a/lib/lita/handlers/greet.rb
+++ b/lib/lita/handlers/greet.rb
@@ -2,7 +2,7 @@ module Handlers
class Greet < Handler
- route(/^(hello|hi|good morning|howdy|yo!?$|hey).*/i, :say_hello)
+ route(/^(hello|hi|good morning|howdy|yo!?$|hey) .*/i, :say_hello)
route(/^welcome (.+)/i, :welcome)
def say_hello(response)
| Fix the regex to only respond to Hi not High
Signed-off-by: Jeroen van Baarsen <2e488d5cebaf6d2832884be70e328933bd4c80ab@gmail.com>
|
diff --git a/XINGAPIClientTester.podspec b/XINGAPIClientTester.podspec
index abc1234..def5678 100644
--- a/XINGAPIClientTester.podspec
+++ b/XINGAPIClientTester.podspec
@@ -9,7 +9,7 @@ 'XING iOS Team' => 'iphonedev@xing.com'
}
s.source = {
- :git => 'https://github.com/xing/XINGAPIClientTester',
+ :git => 'https://github.com/xing/XINGAPIClientTesteri.git',
:tag => '0.0.1'
}
s.source_files = '*.{h,m}'
| Append git to repo url
|
diff --git a/lib/opal/magic_comments.rb b/lib/opal/magic_comments.rb
index abc1234..def5678 100644
--- a/lib/opal/magic_comments.rb
+++ b/lib/opal/magic_comments.rb
@@ -1,8 +1,8 @@ # frozen_string_literal: true
module Opal::MagicComments
- MAGIC_COMMENT_RE = /\A# *([\w_]+) *: *([\w_]+) *$/.freeze
- EMACS_MAGIC_COMMENT_RE = /\A# *-\*- *([\w_]+) *: *([\w_]+) *-\*- *$/.freeze
+ MAGIC_COMMENT_RE = /\A# *(\w+) *: *(\w+) *$/.freeze
+ EMACS_MAGIC_COMMENT_RE = /\A# *-\*- *(\w+) *: *(\w+) *-\*- *$/.freeze
def self.parse(sexp, comments)
flags = {}
| Fix "duplicated range" regexp warning
|
diff --git a/lib/shp_api/rescue_from.rb b/lib/shp_api/rescue_from.rb
index abc1234..def5678 100644
--- a/lib/shp_api/rescue_from.rb
+++ b/lib/shp_api/rescue_from.rb
@@ -35,7 +35,13 @@ c = Object.const_get(class_name)
return nil unless c.respond_to?(method)
- ::Opbeat.capture_exception(exception, user: current_user)
+ ::Opbeat.capture_exception(
+ exception,
+ user: {
+ id: current_user.try(:id),
+ email: current_user.try(:email)
+ }
+ )
end
end
| Fix for including user when calling opbeat.
|
diff --git a/lib/spectifly/xsd/types.rb b/lib/spectifly/xsd/types.rb
index abc1234..def5678 100644
--- a/lib/spectifly/xsd/types.rb
+++ b/lib/spectifly/xsd/types.rb
@@ -9,7 +9,8 @@ 'integer',
'non_negative_integer',
'positive_integer',
- 'decimal'
+ 'decimal',
+ 'base64_binary'
]
Extended = Spectifly::Types::Extended
| Add base64_binary native type to XSD builder |
diff --git a/lib/query_string_search/search_option.rb b/lib/query_string_search/search_option.rb
index abc1234..def5678 100644
--- a/lib/query_string_search/search_option.rb
+++ b/lib/query_string_search/search_option.rb
@@ -3,12 +3,10 @@ attr_reader :attribute, :desired_value, :operator
def initialize(raw_query)
- parsed_query = /(?<attribute>\w+)(?<operator>\W+)(?<value>.+)/.match(raw_query)
- if parsed_query
- self.attribute = parsed_query[:attribute]
- self.desired_value = parsed_query[:value]
- self.operator = parsed_query[:operator]
- end
+ parsed_query = KeyValue.parse(raw_query)
+ self.attribute = parsed_query.attribute
+ self.desired_value = parsed_query.desired_value
+ self.operator = parsed_query.operator
end
def attribute
@@ -19,4 +17,19 @@
attr_writer :attribute, :desired_value, :operator
end
+
+ class KeyValue
+ attr_accessor :attribute, :desired_value, :operator
+
+ def self.parse(raw_query)
+ new(/(?<attribute>\w+)(?<operator>\W+)(?<desired_value>.+)/.match(raw_query))
+ end
+
+ def initialize(match_data)
+ match_data = match_data ? match_data : {}
+ self.attribute = match_data[:attribute]
+ self.desired_value = match_data[:desired_value]
+ self.operator = match_data[:operator]
+ end
+ end
end
| Move parsing into its own class
This is mostly a fix for a RuboCop complaint, but I do like having this
one class responsible for the parsing and the handling of unparsable
key/value pairs
|
diff --git a/lib/static_sync/storage.rb b/lib/static_sync/storage.rb
index abc1234..def5678 100644
--- a/lib/static_sync/storage.rb
+++ b/lib/static_sync/storage.rb
@@ -12,15 +12,16 @@ end
def sync
- remote_tags = []
+ remote_keys = []
remote_directory.files.each do |file|
- remote_tags << file.etag
+ remote_keys << [file.key, file.etag]
end
Dir.chdir(@config.source) do
local_files.each do |file|
- current_file = @meta.for(file)
+ current_file = @meta.for(file)
+ current_file_key = [current_file[:key], current_file[:etag]]
- unless remote_tags.include?(current_file[:etag])
+ unless remote_keys.include?(current_file_key)
log.info("Uploading #{file}") if @config.log
begin
remote_directory.files.create(current_file)
| Allow files to be renamed.
|
diff --git a/lib/tasks/encrypted_test_file_names.rake b/lib/tasks/encrypted_test_file_names.rake
index abc1234..def5678 100644
--- a/lib/tasks/encrypted_test_file_names.rake
+++ b/lib/tasks/encrypted_test_file_names.rake
@@ -19,15 +19,8 @@ raise('Provide adapter name like rspec, minitest, test_unit, cucumber, spinach')
end
- test_files =
- if adapter_class == KnapsackPro::Adapters::RSpecAdapter && KnapsackPro::Config::Env.rspec_split_by_test_examples?
- detector = KnapsackPro::TestCaseDetectors::RSpecTestExampleDetector.new
- detector.generate_json_report
- detector.test_file_example_paths
- else
- test_file_pattern = KnapsackPro::TestFilePattern.call(adapter_class)
- KnapsackPro::TestFileFinder.call(test_file_pattern)
- end
+ test_file_pattern = KnapsackPro::TestFilePattern.call(adapter_class)
+ test_files = KnapsackPro::TestFileFinder.call(test_file_pattern)
test_file_names = []
test_files.each do |t|
| Test examples encryption is a disabled feature for RSpec. Let's remove it from the rake task.
Related: https://github.com/KnapsackPro/knapsack_pro-ruby/pull/176/files
Related old commit:
https://github.com/KnapsackPro/knapsack_pro-ruby/commit/96ec95d6c697a8b8753583615fca5a5a0416162c
|
diff --git a/test/unit/github_fetcher/email_test.rb b/test/unit/github_fetcher/email_test.rb
index abc1234..def5678 100644
--- a/test/unit/github_fetcher/email_test.rb
+++ b/test/unit/github_fetcher/email_test.rb
@@ -24,7 +24,7 @@ VCR.use_cassette "bad_fetch_emails" do
email_fetcher = GithubFetcher::Email.new(token: 'asdf')
- assert_equal email_fetcher.as_json, [{}]
+ assert_equal email_fetcher.as_json, {"message"=>"Bad credentials", "documentation_url"=>"https://developer.github.com/v3"}
end
end
end
| Update test, no idea what changed
|
diff --git a/app/models/admin_ability.rb b/app/models/admin_ability.rb
index abc1234..def5678 100644
--- a/app/models/admin_ability.rb
+++ b/app/models/admin_ability.rb
@@ -8,6 +8,7 @@ elsif user.mod?
can :read, ActiveAdmin::Page, name: "Dashboard"
can :manage, Event
+ can :manage, Speaker
end
end
end
| Allow moderator users to manage Speakers
|
diff --git a/core/spec/models/comable/theme_spec.rb b/core/spec/models/comable/theme_spec.rb
index abc1234..def5678 100644
--- a/core/spec/models/comable/theme_spec.rb
+++ b/core/spec/models/comable/theme_spec.rb
@@ -12,4 +12,28 @@ it { is_expected.to validate_length_of(:description).is_at_most(255) }
it { is_expected.to validate_length_of(:homepage).is_at_most(255) }
it { is_expected.to validate_length_of(:author).is_at_most(255) }
+
+ describe '#default_version' do
+ it 'returns the string' do
+ expect(subject.default_version).to be_a(String)
+ end
+ end
+
+ describe '#to_param' do
+ it 'returns #name' do
+ expect(subject.to_param).to eq(subject.name)
+ end
+ end
+
+ describe '#display_name' do
+ it 'returns #display when #display is present' do
+ subject.display = 'Sample Theme'
+ expect(subject.display_name).to eq(subject.display)
+ end
+
+ it 'returns #name when #display is blank' do
+ subject.display = ''
+ expect(subject.display_name).to eq(subject.name)
+ end
+ end
end
| Add tests for the model
|
diff --git a/Casks/keka.rb b/Casks/keka.rb
index abc1234..def5678 100644
--- a/Casks/keka.rb
+++ b/Casks/keka.rb
@@ -6,7 +6,7 @@ appcast 'http://update.kekaosx.com',
:sha256 => '7d5bf4d33a9c889b33bc5ba8e168deeb86abed84b1fd3deaebe4d85f34a80a32'
homepage 'http://kekaosx.com/'
- license :unknown # todo: change license and remove this comment; ':unknown' is a machine-generated placeholder
+ license :gratis
app 'Keka.app'
| Add license info for Keka
To quote the "About Keka" menu:
> The source code of Keka 1.0 will be not public due to some legal
> issues.
I determined this to be a gratis license.
|
diff --git a/Casks/rdio.rb b/Casks/rdio.rb
index abc1234..def5678 100644
--- a/Casks/rdio.rb
+++ b/Casks/rdio.rb
@@ -3,5 +3,5 @@ homepage 'http://www.rdio.com'
version 'latest'
no_checksum
- link :app, 'Rdio.app'
+ link 'Rdio.app'
end
| Remove :app designation from Rdio link |
diff --git a/sso-auth.gemspec b/sso-auth.gemspec
index abc1234..def5678 100644
--- a/sso-auth.gemspec
+++ b/sso-auth.gemspec
@@ -23,6 +23,7 @@
s.add_development_dependency 'annotate'
s.add_development_dependency 'rails'
+ s.add_development_dependency 'activeresource'
s.add_development_dependency 'rspec-rails'
s.add_development_dependency 'shoulda-matchers'
s.add_development_dependency 'sqlite3'
| Use activeresource as development dependency
|
diff --git a/config/application.rb b/config/application.rb
index abc1234..def5678 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -19,7 +19,7 @@ module SeattlerbOrg
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
- config.load_defaults 6.1
+ config.load_defaults 7.0
# Configuration for the application, engines, and railties goes here.
#
| Bump to default 7.0 config
|
diff --git a/config/application.rb b/config/application.rb
index abc1234..def5678 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -20,6 +20,7 @@ config.crazy_egg_url = '//dnn506yrbagrg.cloudfront.net/pages/scripts/0018/4438.js'
config.google_tag_manager_id = 'GTM-WVFLH9'
+ config.time_zone = 'Europe/London'
config.chat_opening_hours = OpeningHours.new('8:00 AM', '10:00 PM')
config.chat_opening_hours.update(:sat, '09:00 AM', '10:00 PM')
config.chat_opening_hours.update(:sun, '10:00 AM', '10:00 PM')
| Set the timezone so the opening hours respects BST
|
diff --git a/config/application.rb b/config/application.rb
index abc1234..def5678 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -29,7 +29,7 @@ # Set rack-cors configs
config.middleware.insert_before 0, "Rack::Cors" do
allow do
- origins '*'
+ origins 'https://nusmods.com', 'http://staging.nusmods.com'
resource '*', :headers => :any, :methods => [:get, :post, :put, :delete, :options]
end
end
| Tweak CORS headers to only allow from `nusmods.com` and `staging.nusmods.com`
|
diff --git a/config/application.rb b/config/application.rb
index abc1234..def5678 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -22,10 +22,5 @@
config.assets.enabled = true
config.assets.initialize_on_precompile = false
-
- initializer(:load_constants) do
- require Rails.root.join("lib/constants.rb").to_s
- end
-
end
end
| Remove loading of constants from lib
|
diff --git a/rom.gemspec b/rom.gemspec
index abc1234..def5678 100644
--- a/rom.gemspec
+++ b/rom.gemspec
@@ -16,8 +16,8 @@ gem.license = 'MIT'
gem.required_ruby_version = '~> 2.0'
- gem.add_runtime_dependency 'transproc', '~> 0.1.2'
- gem.add_runtime_dependency 'equalizer', '~> 0.0', '>= 0.0.9'
+ gem.add_runtime_dependency 'transproc', '~> 0.1.2'
+ gem.add_runtime_dependency 'equalizer', '~> 0.0', '>= 0.0.9'
gem.add_development_dependency 'rake', '~> 10.3'
gem.add_development_dependency 'rspec-core', '~> 3.2'
| Fix whitespace in gemspec [ci skip]
|
diff --git a/cookbooks/wordpress/recipes/default.rb b/cookbooks/wordpress/recipes/default.rb
index abc1234..def5678 100644
--- a/cookbooks/wordpress/recipes/default.rb
+++ b/cookbooks/wordpress/recipes/default.rb
@@ -32,7 +32,7 @@ apache_module "rewrite"
fail2ban_filter "wordpress" do
- source "http://plugins.svn.wordpress.org/wp-fail2ban/trunk/wordpress.conf"
+ source "http://plugins.svn.wordpress.org/wp-fail2ban/trunk/wordpress-hard.conf"
end
fail2ban_jail "wordpress" do
| Fix wp-fail2ban recipe for upstream changes
|
diff --git a/app/views/lives/show.json.jbuilder b/app/views/lives/show.json.jbuilder
index abc1234..def5678 100644
--- a/app/views/lives/show.json.jbuilder
+++ b/app/views/lives/show.json.jbuilder
@@ -1,4 +1,4 @@ json.cache! @live do
json.partial! 'lives/live', live: @live
- json.songs @live.songs, partial: 'songs/song', as: :song
+ json.songs @live.songs.played_order, partial: 'songs/song', as: :song
end
| Fix the order of songs
|
diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb
index abc1234..def5678 100644
--- a/config/initializers/mime_types.rb
+++ b/config/initializers/mime_types.rb
@@ -2,6 +2,11 @@
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
+Mime::Type.register "font/truetype", :ttf
+Mime::Type.register "font/opentype", :otf
+Mime::Type.register "application/vnd.ms-fontobject", :eot
+Mime::Type.register "application/x-font-woff", :woff
+
Mime::Type.register_alias "text/html", :full
Mime::Type.register_alias "text/html", :mobile
Mime::Type.register_alias "text/javascript", :jsmobile
| Add mime types for fonts
|
diff --git a/config/initializers/wicked_pdf.rb b/config/initializers/wicked_pdf.rb
index abc1234..def5678 100644
--- a/config/initializers/wicked_pdf.rb
+++ b/config/initializers/wicked_pdf.rb
@@ -8,16 +8,16 @@ #
# https://github.com/mileszs/wicked_pdf/blob/master/README.md
-if Rails.env.staging?
- WickedPdf.config = {
+# if Rails.env.staging?
+# WickedPdf.config = {
# Path to the wkhtmltopdf executable: This usually isn't needed if using
# one of the wkhtmltopdf-binary family of gems.
- exe_path: '/var/www/webroot/ROOT/vendor/bundle/ruby/2.3.0/gems/wkhtmltopdf-binary-0.12.3.1/bin/wkhtmltopdf',
+ # exe_path: '/var/www/webroot/ROOT/vendor/bundle/ruby/2.3.0/gems/wkhtmltopdf-binary-0.12.3.1/bin/wkhtmltopdf',
# or
# exe_path: Gem.bin_path('wkhtmltopdf-binary', 'wkhtmltopdf')
# Layout file to be used for all PDFs
# (but can be overridden in `render :pdf` calls)
# layout: 'pdf.html',
- }
-end+ # }
+# end | Remove path to wkhtml on staging
|
diff --git a/db/migrate/20190212150652_change_agreement_id_to_bigint.rb b/db/migrate/20190212150652_change_agreement_id_to_bigint.rb
index abc1234..def5678 100644
--- a/db/migrate/20190212150652_change_agreement_id_to_bigint.rb
+++ b/db/migrate/20190212150652_change_agreement_id_to_bigint.rb
@@ -0,0 +1,23 @@+class ChangeAgreementIdToBigint < ActiveRecord::Migration[6.0]
+ def up
+ change_column :agreements, :id, :bigint
+
+ change_column :agreement_events, :agreement_id, :bigint
+ change_column :agreement_tags, :agreement_id, :bigint
+ change_column :agreement_transaction_audits, :agreement_id, :bigint
+ change_column :agreement_transactions, :agreement_id, :bigint
+ change_column :agreement_variables, :agreement_id, :bigint
+ change_column :requests, :agreement_id, :bigint
+ end
+
+ def down
+ change_column :agreements, :id, :integer
+
+ change_column :agreement_events, :agreement_id, :integer
+ change_column :agreement_tags, :agreement_id, :integer
+ change_column :agreement_transaction_audits, :agreement_id, :integer
+ change_column :agreement_transactions, :agreement_id, :integer
+ change_column :agreement_variables, :agreement_id, :integer
+ change_column :requests, :agreement_id, :integer
+ end
+end
| Update agreement_id primary and foreign keys to bigint
|
diff --git a/mongoid.gemspec b/mongoid.gemspec
index abc1234..def5678 100644
--- a/mongoid.gemspec
+++ b/mongoid.gemspec
@@ -21,7 +21,7 @@
s.add_dependency("activemodel", [">= 4.0.0"])
s.add_dependency("tzinfo", [">= 0.3.37"])
- s.add_dependency("moped", ["~> 2.0.beta6"])
+ s.add_dependency("moped", ["~> 2.0.0.rc1"])
s.add_dependency("origin", ["~> 2.1"])
s.files = Dir.glob("lib/**/*") + %w(CHANGELOG.md LICENSE README.md Rakefile)
| Use moped 2.0.0.rc1 on gemspec
|
diff --git a/db/migrate/20160414123914_add_filters_to_entitlements.rb b/db/migrate/20160414123914_add_filters_to_entitlements.rb
index abc1234..def5678 100644
--- a/db/migrate/20160414123914_add_filters_to_entitlements.rb
+++ b/db/migrate/20160414123914_add_filters_to_entitlements.rb
@@ -1,5 +1,12 @@ class AddFiltersToEntitlements < ActiveRecord::Migration[5.0]
+ class Entitlement < ActiveRecord::Base; end
+
def change
add_column :entitlements, :filters, :text
+
+ # HACK, this shouldn't be required, figure out why. :cry:
+ # Without this, migrate fails when you go from "latest schema" down to:
+ # 20160317194215_remove_miq_user_role_from_miq_groups.rb
+ Entitlement.reset_column_information
end
end
| Hack: Reset rails' column cache for Entitlement for now. :confused:
Caused by #8102
Without this, migrate fails when you go from "latest schema" down to:
20160317194215_remove_miq_user_role_from_miq_groups.rb:
`PG::UndefinedColumn: ERROR: column entitlements.filters does not exist`
Clearly, this isn't the right fix because then we'd have to reset column
information everytime we add/remove a column in case "some other migration" tries
to use that table's stub model. That would be bad. :cry:
|
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
@@ -12,7 +12,7 @@ end
def query_user_session(token)
- UserSession.where(token: token).first
+ UserSession.where(token: token, archived: false).first
end
def user_session_active?(user_session)
| Add check for archived sessions in query_user_session
|
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
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
- # protect_from_forgery
+ protect_from_forgery
before_action :ensure_open_conversation_storage
def after_sign_in_path_for(resource)
| Revert "disable csrf to test faye"
This reverts commit 3803c416825b1899295898b66ed3a2c8890544de.
|
diff --git a/app/serializers/api/partner_serializer.rb b/app/serializers/api/partner_serializer.rb
index abc1234..def5678 100644
--- a/app/serializers/api/partner_serializer.rb
+++ b/app/serializers/api/partner_serializer.rb
@@ -1,5 +1,10 @@ class Api::PartnerSerializer < ActiveModel::Serializer
- attributes :id, :name, :url, :logo, :logo_dimensions, :contact_name, :contact_email
+ attributes :id, :name, :url, :logo, :logo_size, :contact_name, :contact_email
+
+ def logo_size
+ dimensions = object.logo_dimensions.split('x')
+ { width: dimensions[0].to_i, height: dimensions[1].to_i}
+ end
end
| Split logo size in width and height obj
|
diff --git a/lib/sections/soulbind_data.rb b/lib/sections/soulbind_data.rb
index abc1234..def5678 100644
--- a/lib/sections/soulbind_data.rb
+++ b/lib/sections/soulbind_data.rb
@@ -8,7 +8,7 @@ @character.data['current_soulbind'] = SOULBIND_NAME[soulbind["soulbind"]["name"]] || soulbind["soulbind"]["name"]
conduits_found = 0
- soulbind["traits"].each do |trait|
+ (soulbind["traits"] || []).each do |trait|
next unless socket = trait["conduit_socket"]
conduits_found += 1
| Handle case where a soulbind doesn't have any traits (?).
|
diff --git a/lib/slingshot/results/item.rb b/lib/slingshot/results/item.rb
index abc1234..def5678 100644
--- a/lib/slingshot/results/item.rb
+++ b/lib/slingshot/results/item.rb
@@ -9,7 +9,7 @@ def initialize(args={})
if args.respond_to?(:each_pair)
args.each_pair do |key, value|
- self[key.to_sym] = value.is_a?(Hash) ? self.class.new(value) : value
+ self[key.to_sym] = value.respond_to?(:to_hash) ? self.class.new(value) : value
end
super.replace self
else
| [REFACTORING] Use message based type detection in Results::Item
|
diff --git a/lib/travis-deploy-logs/app.rb b/lib/travis-deploy-logs/app.rb
index abc1234..def5678 100644
--- a/lib/travis-deploy-logs/app.rb
+++ b/lib/travis-deploy-logs/app.rb
@@ -1,4 +1,5 @@ require "sinatra/base"
+require 'rack/utils'
require "travis/config"
module TravisDeployLogs
@@ -18,7 +19,9 @@
configure :production do
use Rack::Auth::Basic do |username, password|
- username == TravisDeployLogs.config.basic_username && password == TravisDeployLogs.config.basic_password
+ basic_username = TravisDeployLogs.config.basic_username
+ basic_password = TravisDeployLogs.config.basic_password
+ Rack::Utils.secure_compare(username, basic_username) && Rack::Utils.secure_compare(password, basic_password)
end
end
| Use Rack::Utils.secure_compare for basic auth check |
diff --git a/libraries/glassfish_helper.rb b/libraries/glassfish_helper.rb
index abc1234..def5678 100644
--- a/libraries/glassfish_helper.rb
+++ b/libraries/glassfish_helper.rb
@@ -15,7 +15,7 @@ class RealityForge #nodoc
module GlassFish #nodoc
class << self
- # Return the current domain name
+ # Return the current glassfish domain name
#
# The domain is typically set when configuration run starts
#
@@ -25,7 +25,7 @@ domain_key
end
- # Set the current domain name
+ # Set the current glassfish domain name
#
def set_current_domain(node, domain_key)
node.run_state['glassfish_domain'] = domain_key
| Improve the doc comments so that they are more specific
|
diff --git a/app/controllers/news_items_controller.rb b/app/controllers/news_items_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/news_items_controller.rb
+++ b/app/controllers/news_items_controller.rb
@@ -1,9 +1,10 @@ class NewsItemsController < ApplicationController
include NewsItemsHelper
+ before_filter :load_networks, :only => [:index, :search]
+
def index
get_news_items
- @networks = Network.all
end
def sort_options
@@ -26,4 +27,8 @@ model = model_name.classify.constantize
@news_items = model.with_sort(params[:sort_by]).by_network(current_network).paginate(:page => params[:page])
end
+
+ def load_networks
+ @networks = Network.all
+ end
end
| Load networks for browsing and searching news items
|
diff --git a/app/mailers/maktoub/newsletter_mailer.rb b/app/mailers/maktoub/newsletter_mailer.rb
index abc1234..def5678 100644
--- a/app/mailers/maktoub/newsletter_mailer.rb
+++ b/app/mailers/maktoub/newsletter_mailer.rb
@@ -19,7 +19,7 @@
premailer = Premailer.new(render("maktoub/newsletters/#{newsletter_name}").to_s,
with_html_string: true,
- link_query_string: CGI::escape("utm_source=newsletter&utm_medium=email&utm_campaign=#{@subject}")
+ link_query_string: "utm_source=newsletter&utm_medium=email&utm_campaign=#{CGI::escape(@subject)}"
)
mail(mail_fields) do |format|
| Fix to Google Analytics parameters |
diff --git a/app/services/process_mentions_service.rb b/app/services/process_mentions_service.rb
index abc1234..def5678 100644
--- a/app/services/process_mentions_service.rb
+++ b/app/services/process_mentions_service.rb
@@ -28,7 +28,7 @@ status.mentions.each do |mention|
mentioned_account = mention.account
- next if status.private_visibility? && !mentioned_account.following?(status.account)
+ next if status.private_visibility? && (!mentioned_account.following?(status.account) || !mentioned_account.local?)
if mentioned_account.local?
NotifyService.new.call(mentioned_account, mention)
| Fix undesired delivering of private toot to remote accounts that follow author
|
diff --git a/config/initializers/prefetch_gem_updates.rb b/config/initializers/prefetch_gem_updates.rb
index abc1234..def5678 100644
--- a/config/initializers/prefetch_gem_updates.rb
+++ b/config/initializers/prefetch_gem_updates.rb
@@ -1,2 +1,4 @@ require "plugin" # Avoid: RuntimeError Circular dependency detected while autoloading constant Plugin
-AllPluginCheckUpdateJob.perform_later
+unless Rails.env.test?
+ AllPluginCheckUpdateJob.perform_later
+end
| Stop checking plugin updates when test
Signed-off-by: Kenji Okimoto <7a4b90a0a1e6fc688adec907898b6822ce215e6c@clear-code.com>
|
diff --git a/flatware.gemspec b/flatware.gemspec
index abc1234..def5678 100644
--- a/flatware.gemspec
+++ b/flatware.gemspec
@@ -32,7 +32,7 @@ s.executables = ['flatware']
s.rubygems_version = '1.8.10'
s.add_dependency %(ffi-rzmq), '~> 2.0'
- s.add_dependency %(thor), '~> 0.13'
+ s.add_dependency %(thor), '< 2.0'
s.add_development_dependency %(aruba), '~> 0.14'
s.add_development_dependency %(rake), '~> 10.1.0'
end
| Update thor version to allow rails 6.1 compatibility
|
diff --git a/tools/purge_duplicate_rubyrep_triggers.rb b/tools/purge_duplicate_rubyrep_triggers.rb
index abc1234..def5678 100644
--- a/tools/purge_duplicate_rubyrep_triggers.rb
+++ b/tools/purge_duplicate_rubyrep_triggers.rb
@@ -0,0 +1,57 @@+# This script removes triggers that could cause issues with rubyrep.
+# When tables are renamed, the rubyrep trigger should be removed and recreated.
+# When they are not, it is possible to end up with multiple triggers on the renamed table.
+# Both triggers will run, but the old one will insert pending changes for a table that no longer exists.
+# When this happens with high-churn tables it can cause the replicate process to timeout.
+
+require 'pg'
+
+TRIGGER_QUERY = <<-SQL.freeze
+SELECT relname, array_agg(tgname) AS triggers
+FROM
+ pg_trigger t JOIN
+ pg_class c ON t.tgrelid = c.oid
+WHERE
+ t.tgname like 'rr%'
+GROUP BY relname
+SQL
+
+def sql_array_to_ruby(sql_arr)
+ # the array is returned like: "{value1,value2,value3}"
+ # so we cut out the brackets and split on commas
+ sql_arr[1..-2].split(",")
+end
+
+def drop_triggers(conn, table, triggers)
+ triggers.each do |trigger|
+ puts "Dropping trigger #{trigger} from table #{table}"
+ conn.async_exec("DROP TRIGGER IF EXISTS #{trigger} ON #{table}")
+ conn.async_exec("DROP FUNCTION IF EXISTS #{trigger}()")
+ end
+end
+
+begin
+ conn = PG.connect(:dbname => "vmdb_production")
+rescue PG::Error => e
+ puts e.message
+ puts "Please run this script on the appliance where the database is running"
+ exit
+end
+
+conn.async_exec(TRIGGER_QUERY).each do |tt|
+ triggers = sql_array_to_ruby(tt["triggers"])
+ table = tt["relname"]
+
+ to_drop = triggers.reject { |t| t =~ /rr\d_#{table}/ }
+ next if to_drop.empty?
+
+ puts "This operation will drop the following trigger(s) on #{table}:"
+ puts to_drop.join(", ").to_s
+ puts "Do you want to continue? (Y/N)"
+
+ until %w(y n).include?(answer = gets.to_s.strip.downcase)
+ puts "Please enter Y to continue or N to skip these triggers"
+ end
+
+ drop_triggers(conn, table, to_drop) if answer == "y"
+end
| Add a script to remove out of date rubyrep triggers
When a table which is being replicated is renamed the rubyrep
trigger should be dropped and recreated to ensure only rows
referencing the new table are inserted into rr_pending_changes.
If this is not done properly, triggers referencing the old table
name will remain functional on the renamed table. This has been
seen to cause the replicate process to time out when it happens with
high-churn tables.
https://bugzilla.redhat.com/show_bug.cgi?id=1323951
|
diff --git a/tasks/rspec.rake b/tasks/rspec.rake
index abc1234..def5678 100644
--- a/tasks/rspec.rake
+++ b/tasks/rspec.rake
@@ -17,5 +17,5 @@ desc "Run the specs under spec/models"
Spec::Rake::SpecTask.new do |t|
t.spec_opts = ['--options', "spec/spec.opts"]
- t.spec_files = FileList['spec/*_spec.rb']
+ t.spec_files = FileList['spec/**/*_spec.rb']
end
| Fix the rake 'spec' task to see all of the specs, including those in subdirectories.
|
diff --git a/si-parse.rb b/si-parse.rb
index abc1234..def5678 100644
--- a/si-parse.rb
+++ b/si-parse.rb
@@ -36,7 +36,7 @@ end
# Increment progress bar
- ProgressBar.create(:title => "Records processed", :starting_at => index, :total => num_records, :format => '|%b>>%i| %p%% %t', :throttle_rate => 0.2)
+ ProgressBar.create(:title => "Records processed", :starting_at => index+1, :total => num_records, :format => '|%b>>%i| %p%% %t', :throttle_rate => 0.2)
end
puts "Finished."
| Increment progress bar AFTER parsing each record
|
diff --git a/lib/roo.rb b/lib/roo.rb
index abc1234..def5678 100644
--- a/lib/roo.rb
+++ b/lib/roo.rb
@@ -6,6 +6,7 @@ autoload :GenericSpreadsheet, 'roo/generic_spreadsheet'
autoload :Openoffice, 'roo/openoffice'
+ autoload :Libreoffice, 'roo/openoffice'
autoload :Excel, 'roo/excel'
autoload :Excelx, 'roo/excelx'
autoload :Excel2003XML, 'roo/excel2003xml'
| Fix that Libreoffice wasn't declared for autoload. |
diff --git a/lib/git_compound/repository/remote_file/github_strategy.rb b/lib/git_compound/repository/remote_file/github_strategy.rb
index abc1234..def5678 100644
--- a/lib/git_compound/repository/remote_file/github_strategy.rb
+++ b/lib/git_compound/repository/remote_file/github_strategy.rb
@@ -12,8 +12,7 @@
def initialize(source, ref, file)
super
- @uri = github_uri
- @response = http_response(@uri)
+ @uri = github_uri
end
def contents
@@ -27,6 +26,7 @@ end
def exists?
+ @response ||= http_response(@uri)
@response.code == 200.to_s
end
| Reduce github remote file strategy initialization overhead
|
diff --git a/config/boot.rb b/config/boot.rb
index abc1234..def5678 100644
--- a/config/boot.rb
+++ b/config/boot.rb
@@ -2,3 +2,14 @@ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
+
+require 'rails/commands/server'
+module Rails
+ class Server
+ def default_options
+ super.merge({
+ :Port => 8080
+ })
+ end
+ end
+end
| Change port number to 8080
|
diff --git a/lib/rubocop/cop/lint/string_conversion_in_interpolation.rb b/lib/rubocop/cop/lint/string_conversion_in_interpolation.rb
index abc1234..def5678 100644
--- a/lib/rubocop/cop/lint/string_conversion_in_interpolation.rb
+++ b/lib/rubocop/cop/lint/string_conversion_in_interpolation.rb
@@ -22,12 +22,13 @@ MSG_SELF = 'Use `self` instead of `Object#to_s` in ' \
'interpolation.'.freeze
+ def_node_matcher :to_s_without_args?, '(send _ :to_s)'
+
def on_dstr(node)
node.each_child_node(:begin) do |begin_node|
final_node = begin_node.children.last
- next unless final_node && final_node.send_type? &&
- final_node.method?(:to_s) && !final_node.arguments?
+ next unless to_s_without_args?(final_node)
add_offense(final_node, location: :selector)
end
@@ -35,7 +36,7 @@
def autocorrect(node)
lambda do |corrector|
- receiver, _method_name, *_args = *node
+ receiver = node.receiver
corrector.replace(
node.source_range,
if receiver
| Use node_matcher for better readability
|
diff --git a/sql.gemspec b/sql.gemspec
index abc1234..def5678 100644
--- a/sql.gemspec
+++ b/sql.gemspec
@@ -17,7 +17,9 @@ gem.test_files = `git ls-files -- spec/{unit,integration}`.split($/)
gem.extra_rdoc_files = %w[LICENSE README.md CONTRIBUTING.md TODO]
- gem.add_runtime_dependency('ast', '~> 1.0.2')
+ gem.add_runtime_dependency('ast', '~> 1.0.2')
+ gem.add_runtime_dependency('adamantium', '~> 0.0.7')
+ gem.add_runtime_dependency('ice_nine', '~> 0.7.0')
gem.add_development_dependency('bundler', '~> 1.3', '>= 1.3.5')
end
| Add ice_nine and adamantium as dependencies
|
diff --git a/test/tea_test.rb b/test/tea_test.rb
index abc1234..def5678 100644
--- a/test/tea_test.rb
+++ b/test/tea_test.rb
@@ -0,0 +1,25 @@+require 'test_helper'
+
+class ActsAsHavingStringId::TeaTest < ActiveSupport::TestCase
+ test "encrypting a number gives expected results" do
+ tea = ActsAsHavingStringId::TEA.new('test')
+ plaintext = 10414838284579674484
+ encrypted = tea.encrypt(plaintext)
+ assert_equal 5979036006718970748, encrypted
+ end
+
+ test "decrypting encrypted numbers give the numbers back" do
+ tea = ActsAsHavingStringId::TEA.new('test')
+ (1..100000).each do |plaintext|
+ encrypted = tea.encrypt(plaintext)
+ decrypted = tea.decrypt(encrypted)
+ assert_equal plaintext, decrypted
+ end
+ end
+
+ test "encrypting with different keys yield different results" do
+ tea = ActsAsHavingStringId::TEA.new('test')
+ tea2 = ActsAsHavingStringId::TEA.new('test2')
+ assert_not_equal tea.encrypt(123), tea2.encrypt(123)
+ end
+end
| Add a few more tests
|
diff --git a/config/initializers/maslow.rb b/config/initializers/maslow.rb
index abc1234..def5678 100644
--- a/config/initializers/maslow.rb
+++ b/config/initializers/maslow.rb
@@ -1,3 +1,3 @@ require 'gds_api/maslow'
-Whitehall.maslow = GdsApi::Maslow.new(Plek.find('maslow'))
+Whitehall.maslow = GdsApi::Maslow.new(Plek.new.external_url_for('maslow'))
| Use external URLs for Maslow
This uses the new external_url_for method in Plek, which handles
environments where the URLs for internal and external routing are
different.
|
diff --git a/config/initializers/resque.rb b/config/initializers/resque.rb
index abc1234..def5678 100644
--- a/config/initializers/resque.rb
+++ b/config/initializers/resque.rb
@@ -1,3 +1,13 @@ if ENV["REDISCLOUD_URL"]
Resque.redis = ENV["REDISCLOUD_URL"]
end
+
+Resque.before_fork do
+ defined?(ActiveRecord::Base) and
+ ActiveRecord::Base.connection.disconnect!
+end
+
+Resque.after_fork do
+ defined?(ActiveRecord::Base) and
+ ActiveRecord::Base.establish_connection
+end
| Drop Resque's pre-fork DB connection
|
diff --git a/config/environments/development.rb b/config/environments/development.rb
index abc1234..def5678 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -29,4 +29,6 @@
# Expands the lines which load the assets
config.assets.debug = true
+ config.assets.check_precompiled_asset = false
+
end
| Add check_precompiled_asset false to ensure dev servers run immediately.
|
diff --git a/redcarpet-abbreviations.gemspec b/redcarpet-abbreviations.gemspec
index abc1234..def5678 100644
--- a/redcarpet-abbreviations.gemspec
+++ b/redcarpet-abbreviations.gemspec
@@ -18,6 +18,6 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]
- spec.add_development_dependency "bundler", "~> 1.7"
+ spec.add_development_dependency "bundler", "~> 2.0"
spec.add_development_dependency "rake", "~> 12.3"
end
| Update bundler requirement from ~> 1.7 to ~> 2.0
Updates the requirements on [bundler](https://github.com/bundler/bundler) to permit the latest version.
- [Release notes](https://github.com/bundler/bundler/releases)
- [Changelog](https://github.com/bundler/bundler/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bundler/bundler/commits/v2.0.0)
Signed-off-by: dependabot[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com> |
diff --git a/lib/graphql/tracing/appsignal_tracing.rb b/lib/graphql/tracing/appsignal_tracing.rb
index abc1234..def5678 100644
--- a/lib/graphql/tracing/appsignal_tracing.rb
+++ b/lib/graphql/tracing/appsignal_tracing.rb
@@ -14,7 +14,22 @@ "execute_query_lazy" => "execute.graphql",
}
+ # @param set_action_name [Boolean] If true, the GraphQL operation name will be used as the transaction name.
+ # This is not advised if you run more than one query per HTTP request, for example, with `graphql-client` or multiplexing.
+ # It can also be specified per-query with `context[:set_appsignal_action_name]`.
+ def initialize(options = {})
+ @set_action_name = options.fetch(:set_action_name, false)
+ super
+ end
+
def platform_trace(platform_key, key, data)
+ if key == "execute_query"
+ set_this_txn_name = data[:query].context[:set_appsignal_action_name]
+ if set_this_txn_name == true || (set_this_txn_name.nil? && @set_action_name)
+ Appsignal::Transaction.current.set_action(transaction_name(data[:query]))
+ end
+ end
+
Appsignal.instrument(platform_key) do
yield
end
| Add set_action_name option to AppsignalTracing
|
diff --git a/spec/windward_spec.rb b/spec/windward_spec.rb
index abc1234..def5678 100644
--- a/spec/windward_spec.rb
+++ b/spec/windward_spec.rb
@@ -1,29 +1,29 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
-describe "Windward", vcr: true do
- describe "Weather" do
- it "should get new windward weather" do
+describe 'Windward', vcr: true do
+ describe 'Weather' do
+ it 'should get new windward weather' do
expect(Windward::Weather.new).to_not be_nil
end
- it "should returns regions list" do
+ it 'should returns regions list' do
weather = Windward::Weather.new
- expect(weather.regions).to include "Alsace"
+ expect(weather.regions).to include 'Alsace'
end
- it "should return a hash with slug value and previsions of region" do
+ it 'should return a hash with slug value and previsions of region' do
weather = Windward::Weather.new
- expect(weather.region "Alsace").to match a_hash_including("slug", "value", "previsions")
+ expect(weather.region 'Alsace').to match a_hash_including('slug', 'value', 'previsions')
end
- it "should return a hash that contains a previsions hash of region" do
+ it 'should return a hash that contains a previsions hash of region' do
weather = Windward::Weather.new
- expect(weather.region("Alsace")["previsions"].values[0]).to match a_hash_including("temps", "temper", "city")
+ expect(weather.region('Alsace')['previsions'].values[0]).to match a_hash_including('temps', 'temper', 'city')
end
- it "should return only previsions hash of region" do
+ it 'should return only previsions hash of region' do
weather = Windward::Weather.new
- expect(weather.previsions("Alsace").values[0]).to match a_hash_including("temps", "temper", "city")
+ expect(weather.previsions('Alsace').values[0]).to match a_hash_including('temps', 'temper', 'city')
end
end
end
| Use quote instead of double quote
|
diff --git a/cookbooks/main/recipes/default.rb b/cookbooks/main/recipes/default.rb
index abc1234..def5678 100644
--- a/cookbooks/main/recipes/default.rb
+++ b/cookbooks/main/recipes/default.rb
@@ -21,6 +21,6 @@ end
end
-[ "git", "nodejs" ].each do |package_name|
+[ "git", "nodejs", "libsqlite3-dev", "sqlite3"].each do |package_name|
package package_name
end
| Install libsqlite3-dev and sqlite3 on vagrant up
|
diff --git a/capistrano-chatwork.gemspec b/capistrano-chatwork.gemspec
index abc1234..def5678 100644
--- a/capistrano-chatwork.gemspec
+++ b/capistrano-chatwork.gemspec
@@ -18,7 +18,7 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ['lib']
- spec.add_runtime_dependency 'capistrano', '< 3.0.0'
+ spec.add_runtime_dependency 'capistrano'
spec.add_development_dependency 'bundler', '~> 1.5'
spec.add_development_dependency 'rake'
| Remove specific version of capistrano
|
diff --git a/rails_generators/pickle/templates/env.rb b/rails_generators/pickle/templates/env.rb
index abc1234..def5678 100644
--- a/rails_generators/pickle/templates/env.rb
+++ b/rails_generators/pickle/templates/env.rb
@@ -4,7 +4,7 @@ # Example of configuring pickle:
#
# Pickle.configure do |config|
-# config.adaptors = [:machinist]
+# config.adapters = [:machinist]
# config.map 'I', 'myself', 'me', 'my', :to => 'user: "me"'
# end
<%- end -%>
| Fix confusing generator comment (adaptor => adapter)
|
diff --git a/rb/lib/selenium/webdriver/common/wait.rb b/rb/lib/selenium/webdriver/common/wait.rb
index abc1234..def5678 100644
--- a/rb/lib/selenium/webdriver/common/wait.rb
+++ b/rb/lib/selenium/webdriver/common/wait.rb
@@ -3,14 +3,14 @@ class Wait
DEFAULT_TIMEOUT = 5
- DEFAULT_INTERVAL = 0.5
+ DEFAULT_INTERVAL = 0.2
#
# Create a new Wait instance
#
# @param [Hash] opts Options for this instance
# @option opts [Numeric] :timeout (5) Seconds to wait before timing out.
- # @option opts [Numeric] :interval (0.5) Seconds to sleep between polls.
+ # @option opts [Numeric] :interval (0.2) Seconds to sleep between polls.
# @option opts [String] :message Exception mesage if timed out.
def initialize(opts = {})
| JariBakken: Reduce the polling interval in Ruby's Wait class.
r15890
|
diff --git a/activejob-lock.gemspec b/activejob-lock.gemspec
index abc1234..def5678 100644
--- a/activejob-lock.gemspec
+++ b/activejob-lock.gemspec
@@ -13,7 +13,7 @@ s.homepage = 'http://github.com/idolweb/activejob-lock'
s.license = "MIT"
- s.files = `git ls-files -z`.split("\x0")
+ s.files = `git ls-files`.split($\)
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
s.test_files = s.files.grep(%r{^(test|spec|features)/})
s.require_paths = ["lib"]
| Fix invalid byte sequence in US-ASCII
|
diff --git a/capybara-mechanize.gemspec b/capybara-mechanize.gemspec
index abc1234..def5678 100644
--- a/capybara-mechanize.gemspec
+++ b/capybara-mechanize.gemspec
@@ -1,4 +1,3 @@-# -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
require "capybara/mechanize/version"
@@ -8,7 +7,6 @@
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Jeroen van Dijk"]
- s.date = Date.today.to_s
s.summary = %q{RackTest driver for Capybara with remote request support}
s.description = %q{RackTest driver for Capybara, but with remote request support thanks to mechanize}
| Remove date from gemsepc, Date w/o require can errors
Other widely used gems do not specify `date`, we won't either.
Closes #45. Thanks @emmanne08, @aaronchi
|
diff --git a/TestHarness/Cucumber/features/step_definitions/AdditionSteps.rb b/TestHarness/Cucumber/features/step_definitions/AdditionSteps.rb
index abc1234..def5678 100644
--- a/TestHarness/Cucumber/features/step_definitions/AdditionSteps.rb
+++ b/TestHarness/Cucumber/features/step_definitions/AdditionSteps.rb
@@ -5,6 +5,10 @@
Given(/^I have entered (\d+) into the calculator$/) do |arg1|
@numbersList << arg1.to_i
+end
+
+Given(/^I have entered (\d+)\.(\d+) into the calculator$/) do |arg1, arg2|
+ expect("this is a hacky way of making the scenario with a non-integer number").to eql("fail")
end
When(/^I press add$/) do
@@ -16,3 +20,7 @@ Then(/^the result should be (\d+) on the screen$/) do |arg1|
expect(@result).to eql(arg1.to_i)
end
+
+Then(/^the result should be (\d+)\.(\d+) on the screen$/) do |arg1, arg2|
+ expect("this is a hacky way of making the scenario with a non-integer number").to eql("fail")
+end
| Make the scenario with the non-integer number fail
|
diff --git a/app/representers/api/address_representer.rb b/app/representers/api/address_representer.rb
index abc1234..def5678 100644
--- a/app/representers/api/address_representer.rb
+++ b/app/representers/api/address_representer.rb
@@ -11,6 +11,6 @@ property :country
def self_url(address)
- api_account_address_path(address.account)
+ api_account_address_path(address.account) if address.account
end
end
| Make sure account actually exists
|
diff --git a/webapp/config.ru b/webapp/config.ru
index abc1234..def5678 100644
--- a/webapp/config.ru
+++ b/webapp/config.ru
@@ -13,7 +13,7 @@
if run_static_site
static_controller = Sinatra.new do
- REACT_BUILD_PATH = File.dirname(__FILE__) + '/../../../meter-reader-react/build'
+ REACT_BUILD_PATH = File.join(__dir__, "../../meter-reader-react/build")
set :public_folder, REACT_BUILD_PATH
| Change local path to react webapp build location
|
diff --git a/apps/tweets.rb b/apps/tweets.rb
index abc1234..def5678 100644
--- a/apps/tweets.rb
+++ b/apps/tweets.rb
@@ -11,7 +11,6 @@ Example: <code>tweets twitter</code>
DESCRIPTION
text_id 'tweets'
- voice_id 'tweets'
def tweets params
username = params['Body']
@@ -28,8 +27,4 @@ def text params
"<Response><Sms>#{tweets(params)}</Sms></Response>"
end
-
- def voice params
- "<Response><Say voice='woman'>#{tweets(params)}</Say></Response>"
- end
end | Remove voice support from tweet app
|
diff --git a/app/views/renalware/api/v1/patients/patients/show.json.jbuilder b/app/views/renalware/api/v1/patients/patients/show.json.jbuilder
index abc1234..def5678 100644
--- a/app/views/renalware/api/v1/patients/patients/show.json.jbuilder
+++ b/app/views/renalware/api/v1/patients/patients/show.json.jbuilder
@@ -12,6 +12,7 @@ json.born_on patient.born_on&.to_s
json.died_on patient.died_on&.to_s
json.sex patient.sex&.code
-json.ethnicity patient.ethnicity&.code
+json.ethnicity patient.ethnicity&.name
json.medications_url api_v1_patient_medications_prescriptions_url(patient_id: patient)
json.hd_profile_url api_v1_patient_hd_current_profile_url(patient_id: patient)
+# TODO: HD Profile link to have at least site and schedule
| Use name not code for ethnicity in API
|
diff --git a/features/support/admin_taxonomy_helper.rb b/features/support/admin_taxonomy_helper.rb
index abc1234..def5678 100644
--- a/features/support/admin_taxonomy_helper.rb
+++ b/features/support/admin_taxonomy_helper.rb
@@ -24,11 +24,3 @@ end
end
World(AdminTaxonomyHelper)
-
-Around do |_, block|
- redis = Redis.new
- Redis.new = nil
- block.call
-ensure
- Redis.new = redis
-end
| Remove obsolete block (we're always getting a new redis now)
|
diff --git a/app/helpers/application_helper/button/orchestration_template_edit_remove.rb b/app/helpers/application_helper/button/orchestration_template_edit_remove.rb
index abc1234..def5678 100644
--- a/app/helpers/application_helper/button/orchestration_template_edit_remove.rb
+++ b/app/helpers/application_helper/button/orchestration_template_edit_remove.rb
@@ -2,12 +2,14 @@ def calculate_properties
super
if @view_context.x_active_tree == :ot_tree && @record
- self[:enabled] = !@record.in_use?
- self[:title] = if self[:id] =~ /_edit$/
- _('Orchestration Templates that are in use cannot be edited')
- else
- _('Orchestration Templates that are in use cannot be removed')
- end
+ if @record.in_use?
+ self[:enabled] = false
+ self[:title] = if self[:id] =~ /_edit$/
+ _('Orchestration Templates that are in use cannot be edited')
+ else
+ _('Orchestration Templates that are in use cannot be removed')
+ end
+ end
end
end
end
| Fix misleading tooltip in orchestration template toolbar
Tooltip telling the orchestration template cannot be removed / edited
needs to be put in place only if the template is in use (not in
call cases).
https://bugzilla.redhat.com/show_bug.cgi?id=1295941
|
diff --git a/spec/lib/chamber/commands/secure_spec.rb b/spec/lib/chamber/commands/secure_spec.rb
index abc1234..def5678 100644
--- a/spec/lib/chamber/commands/secure_spec.rb
+++ b/spec/lib/chamber/commands/secure_spec.rb
@@ -1,5 +1,6 @@ require 'rspectacular'
require 'chamber/commands/secure'
+require 'fileutils'
module Chamber
module Commands
@@ -11,6 +12,7 @@ encryption_key: rootpath + '../spec_key'} }
it 'can return values formatted as environment variables' do
+ ::FileUtils.mkdir_p rootpath + 'settings' unless ::File.exist? rootpath + 'settings'
::File.open(settings_filename, 'w') do |file|
file.write <<-HEREDOC
test:
| Fix failing spec when directory didn't exist before spec was run
|
diff --git a/config/initializers/cve_2015_3226_fix.rb b/config/initializers/cve_2015_3226_fix.rb
index abc1234..def5678 100644
--- a/config/initializers/cve_2015_3226_fix.rb
+++ b/config/initializers/cve_2015_3226_fix.rb
@@ -1,3 +1,4 @@+raise "Check monkey patch for CVE-2015-3226 is still needed" unless Rails::VERSION::STRING == '3.2.22'
module ActiveSupport
module JSON
module Encoding
| Update monkey patch to include raise
|
diff --git a/lib/yard/generators/class_generator.rb b/lib/yard/generators/class_generator.rb
index abc1234..def5678 100644
--- a/lib/yard/generators/class_generator.rb
+++ b/lib/yard/generators/class_generator.rb
@@ -1,6 +1,8 @@ module YARD
module Generators
class ClassGenerator < Base
+ before_generate :is_class?
+
def sections_for(object)
[
:header,
@@ -11,9 +13,8 @@ AttributesGenerator,
ConstantsGenerator,
ConstructorGenerator,
- MethodSummaryGenerator.new(options, :ignore_serializer => true,
- :scope => :instance, :visibility => :public
- )
+ G(MethodSummaryGenerator, :scope => :instance, :visibility => :public),
+ G(MethodDetailsGenerator, :scope => :instance, :visibility => :public)
]
]
end
| Add visibility grouping generators to class generator
|
diff --git a/debian/ruby-tests.rake b/debian/ruby-tests.rake
index abc1234..def5678 100644
--- a/debian/ruby-tests.rake
+++ b/debian/ruby-tests.rake
@@ -4,3 +4,8 @@ t.libs << 'lib' << 'test'
t.test_files = FileList['test/**/*_test.rb']
end
+
+at_exit do
+ filepath = File.join(File.dirname(__FILE__),'..','tmp')
+ system('rm', '-rf', filepath)
+end
| Add code to remove tmp folder
|
diff --git a/TheOpenCMS/DeployTool/kit/rails/_deploy.rb b/TheOpenCMS/DeployTool/kit/rails/_deploy.rb
index abc1234..def5678 100644
--- a/TheOpenCMS/DeployTool/kit/rails/_deploy.rb
+++ b/TheOpenCMS/DeployTool/kit/rails/_deploy.rb
@@ -46,13 +46,12 @@ ts_restart
cron_restart
+ app_release_info
app_server_restart
nginx_restart
release_cleanup
letsencript_info
-
sidekiq_restart
- app_release_info
end
end
| Change an order of commands
|
diff --git a/app/models/category.rb b/app/models/category.rb
index abc1234..def5678 100644
--- a/app/models/category.rb
+++ b/app/models/category.rb
@@ -14,7 +14,7 @@
attr_accessible :name, :permalink, :issued, :order_articles, :mode
- scope :issued, -> { where(issued: true) }
+ scope :issued, ->(value = true) { where(issued: value) }
scope :non_issued, -> { where(issued: false) }
def ordered
| Change Category.issued scope so you can parse value
|
diff --git a/app/models/gem_typo.rb b/app/models/gem_typo.rb
index abc1234..def5678 100644
--- a/app/models/gem_typo.rb
+++ b/app/models/gem_typo.rb
@@ -7,7 +7,7 @@
DOWNLOADS_THRESHOLD = 10_000_000
SIZE_THRESHOLD = 4
- EXCEPTIONS = %w[strait].freeze
+ EXCEPTIONS = %w[strait upguard].freeze
def initialize(rubygem_name)
@rubygem_name = rubygem_name.downcase
| Add upguard to typo exception list
https://help.rubygems.org/discussions/problems/36770-gem-push-name-is-too-close-to-typo-protected-gem
|
diff --git a/app/controllers/religions_controller.rb b/app/controllers/religions_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/religions_controller.rb
+++ b/app/controllers/religions_controller.rb
@@ -7,7 +7,7 @@
def content_param_list
%i(
- name description other_name universe_id
+ name description other_names universe_id
origin_story
teachings prophecies places_of_worship worship_services obligations paradise
initiation rituals holidays
| Fix typo in religion "other names" field strong param |
diff --git a/lib/honeybadger/integrations/delayed_job.rb b/lib/honeybadger/integrations/delayed_job.rb
index abc1234..def5678 100644
--- a/lib/honeybadger/integrations/delayed_job.rb
+++ b/lib/honeybadger/integrations/delayed_job.rb
@@ -1,9 +1,9 @@ module Honeybadger
Dependency.register do
- requirement { defined?(Delayed::Plugins::Plugin) }
- requirement { defined?(Delayed::Worker.plugins) }
+ requirement { defined?(::Delayed::Plugins::Plugin) }
+ requirement { defined?(::Delayed::Worker.plugins) }
requirement do
- if delayed_job_honeybadger = defined?(Delayed::Plugins::Honeybadger)
+ if delayed_job_honeybadger = defined?(::Delayed::Plugins::Honeybadger)
Honeybadger.write_verbose_log("Support for Delayed Job has been moved " \
"to the honeybadger gem. Please remove " \
"delayed_job_honeybadger from your " \
@@ -14,7 +14,7 @@
injection do
require 'honeybadger/integrations/delayed_job/plugin'
- Delayed::Worker.plugins << Integrations::DelayedJob::Plugin
+ ::Delayed::Worker.plugins << Integrations::DelayedJob::Plugin
end
end
end
| Use top level classes during detection.
|
diff --git a/spec/features/show_user_spec.rb b/spec/features/show_user_spec.rb
index abc1234..def5678 100644
--- a/spec/features/show_user_spec.rb
+++ b/spec/features/show_user_spec.rb
@@ -9,7 +9,7 @@ scenario 'User has a radar' do
create(:radar, name: 'March 2014')
visit radars_path
- within ('.radars') do
+ within('.radars') do
expect(page).to have_text('March 2014')
end
end
| Fix syntax to keep Rubocop happy |
diff --git a/spec/models/clubs_users_spec.rb b/spec/models/clubs_users_spec.rb
index abc1234..def5678 100644
--- a/spec/models/clubs_users_spec.rb
+++ b/spec/models/clubs_users_spec.rb
@@ -4,6 +4,8 @@ it { should belong_to :club }
it { should belong_to :user }
+ it { should ensure_inclusion_of(:type).in_array [ :basic, :pro ] }
+
it "can be instantiated" do
ClubsUsers.new.should be_an_instance_of(ClubsUsers)
end
| Add Test for Enumeration of Membership Type
Add a test to ensure that the ClubsUsers 'type' attribute falls within
the expected realm of membership types.
|
diff --git a/app/graphql/mutations/copy_site_view.rb b/app/graphql/mutations/copy_site_view.rb
index abc1234..def5678 100644
--- a/app/graphql/mutations/copy_site_view.rb
+++ b/app/graphql/mutations/copy_site_view.rb
@@ -0,0 +1,38 @@+module Mutations
+ class CopySiteView < BaseMutation
+ field :site_view, Types::SiteViewType, null: true
+ field :errors, [String], null: true
+
+ argument :name, String, required: true
+ argument :url, String, required: false
+ argument :description, String, required: false
+ argument :default, Boolean, required: true
+ argument :site_id, Integer, required: true
+ argument :site_view_id, Integer, required: true
+
+ def resolve(args)
+ site = Site.find_by(id: args[:site_id])
+ if site.nil?
+ return { site_view: nil, errors: ["Site not found"] }
+ end
+ original_view = site.site_views.find_by(id: args[:site_view_id] )
+ view = site.site_views.new(name:args[:name], default: args[:default], url: args[:url], description: args[:description], updates:original_view.updates)
+ if view.save
+ { site_view: view, errors: nil }
+ else
+ { site_view: nil, errors: view.errors.full_messages }
+ end
+ end
+
+ def authorized?(args)
+ site = Site.find_by(id: args[:site_id])
+ return false if site.blank?
+
+ current_user.present? && (
+ current_user.has_role?(:admin) ||
+ current_user.has_role?(:site_owner, site) ||
+ current_user.has_role?(:site_editor, site)
+ )
+ end
+ end
+end
| Copy Site View endpoint in graphql
|
diff --git a/core/app/models/spree/order_populator.rb b/core/app/models/spree/order_populator.rb
index abc1234..def5678 100644
--- a/core/app/models/spree/order_populator.rb
+++ b/core/app/models/spree/order_populator.rb
@@ -10,6 +10,7 @@ end
def populate(variant_id, quantity, options = {})
+ ActiveSupport::Deprecation.warn "OrderPopulator is deprecated and will be removed from Spree 3, use OrderContents with order.contents.add instead.", caller
# protect against passing a nil hash being passed in
# due to an empty params[:options]
attempt_cart_add(variant_id, quantity, options || {})
| Add deprecation warning for OrderPopulator.
|
diff --git a/lib/rails_admin/config/actions/data_type.rb b/lib/rails_admin/config/actions/data_type.rb
index abc1234..def5678 100644
--- a/lib/rails_admin/config/actions/data_type.rb
+++ b/lib/rails_admin/config/actions/data_type.rb
@@ -6,7 +6,7 @@ register_instance_option :visible? do
if authorized?
model = bindings[:abstract_model].model_name.constantize rescue nil
- model.try(:data_type).present?
+ (data_type = model.try(:data_type)).present? && !data_type.is_a?(Setup::BuildInDataType)
else
false
end
| Hide data type actions for build in models
|
diff --git a/lib/specinfra/command/linux/base/selinux.rb b/lib/specinfra/command/linux/base/selinux.rb
index abc1234..def5678 100644
--- a/lib/specinfra/command/linux/base/selinux.rb
+++ b/lib/specinfra/command/linux/base/selinux.rb
@@ -2,11 +2,11 @@ class << self
def check_has_mode(mode, policy = nil)
cmd = ""
- cmd += "test ! -f /etc/selinux/config || (" if mode == "disabled"
- cmd += "getenforce | grep -i -- #{escape(mode)}"
+ cmd += "test ! -f /etc/selinux/config || ( " if mode == "disabled"
+ cmd += "(getenforce | grep -i -- #{escape(mode)})"
+ cmd += " || (getenforce | grep -i -- #{escape('permissive')}) )" if mode == "disabled"
cmd += %Q{ && grep -iE -- '^\\s*SELINUX=#{escape(mode)}\\>' /etc/selinux/config}
cmd += %Q{ && grep -iE -- '^\\s*SELINUXTYPE=#{escape(policy)}\\>' /etc/selinux/config} if policy != nil
- cmd += ")" if mode == "disabled"
cmd
end
end
| Change check mode shell command
|
diff --git a/lib/travis/build/appliances/update_glibc.rb b/lib/travis/build/appliances/update_glibc.rb
index abc1234..def5678 100644
--- a/lib/travis/build/appliances/update_glibc.rb
+++ b/lib/travis/build/appliances/update_glibc.rb
@@ -8,8 +8,8 @@ sh.export 'DEBIAN_FRONTEND', 'noninteractive', echo: true
sh.cmd <<-EOF
if [ ! $(uname|grep Darwin) ]; then
- sudo -E apt-get -yq update &>> ~/apt-get-update.log"
- sudo -E apt-get -yq --no-install-suggests --no-install-recommends "--force-yes install libc6"
+ sudo -E apt-get -yq update &>> ~/apt-get-update.log
+ sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes install libc6
fi
EOF
end
| Fix string quotaton for sudo
|
diff --git a/db/migrations/003_add_offence_details.rb b/db/migrations/003_add_offence_details.rb
index abc1234..def5678 100644
--- a/db/migrations/003_add_offence_details.rb
+++ b/db/migrations/003_add_offence_details.rb
@@ -0,0 +1,12 @@+class AddOffenceDetails < Sequel::Migration
+ def up
+ alter_table(:businesses) do
+ add_column :description, String, :text => true
+ add_column :date, String
+ end
+ end
+
+ def down
+ end
+end
+
| Add db column so we can store descriptions
|
diff --git a/test/quicktest.ru b/test/quicktest.ru
index abc1234..def5678 100644
--- a/test/quicktest.ru
+++ b/test/quicktest.ru
@@ -0,0 +1,5 @@+$:.unshift File.expand_path(File.join(File.dirname(__FILE__), *%w[.. lib]))
+require "rack/webtranslateit"
+Dir.chdir File.dirname(__FILE__)
+use Rack::Webtranslateit
+run proc{|env| Rack::Response.new(["All Good!"]).finish }
| Add a rackup file to allow quick smoke testing. |
diff --git a/config/initializers/i18n.rb b/config/initializers/i18n.rb
index abc1234..def5678 100644
--- a/config/initializers/i18n.rb
+++ b/config/initializers/i18n.rb
@@ -1,6 +1,8 @@ I18n.enforce_available_locales = true
-if Rails.env.development? || Rails.env.test?
- I18n.exception_handler = lambda do |exception, locale, key, options|
- raise "missing translation: #{key}"
+if Object.const_defined?(:ZineDistro) && ZineDistro.const_defined?(:Application)
+ if Rails.env.development? || Rails.env.test?
+ I18n.exception_handler = lambda do |_exception, locale, key, _options|
+ fail "missing translation: #{key} for #{locale}"
+ end
end
end
| Check if the Rails constant is available
Exceptions for missing exceptions should be raised in development mode
or in CI
|
diff --git a/config/initializers/aws.rb b/config/initializers/aws.rb
index abc1234..def5678 100644
--- a/config/initializers/aws.rb
+++ b/config/initializers/aws.rb
@@ -1,3 +1,5 @@+Aws.config[:log_level] = :debug
+
AWS_CONFIG = { stub_responses: ENV['AWS_STUB'].present? }.freeze
AWS_COGNITO = Aws::CognitoIdentityProvider::Client.new(AWS_CONFIG)
| Reduce AWS log level to debug
|
diff --git a/app/models/social_networking/profile.rb b/app/models/social_networking/profile.rb
index abc1234..def5678 100644
--- a/app/models/social_networking/profile.rb
+++ b/app/models/social_networking/profile.rb
@@ -30,11 +30,7 @@ end
def user_name
- if participant.is_admin
- "ThinkFeelDo"
- else
- participant.display_name
- end
+ participant.display_name
end
end
end
| Change how default admin name is handled
* Remove `ThinkFeelDo` as default admin name
* Applications will now set their own default admin name by overriding `user_name` in the Profile class
[Finished: #97469840]
|
diff --git a/app/models/spree/gateway/pin_gateway.rb b/app/models/spree/gateway/pin_gateway.rb
index abc1234..def5678 100644
--- a/app/models/spree/gateway/pin_gateway.rb
+++ b/app/models/spree/gateway/pin_gateway.rb
@@ -6,5 +6,10 @@ def provider_class
ActiveMerchant::Billing::PinGateway
end
+
+ # Pin does not appear to support authorizing transactions yet
+ def auto_capture
+ true
+ end
end
end
| [Pin] Set auto_capture to always be true so authorize is not attempted
Fixes #106
|
diff --git a/test/test_user.rb b/test/test_user.rb
index abc1234..def5678 100644
--- a/test/test_user.rb
+++ b/test/test_user.rb
@@ -42,4 +42,20 @@ #end
end
+ def test_reset_password
+ u = "alan" + rand(10000000000000).to_s
+ data = {
+ :username => u,
+ :password => "secret"
+ }
+
+ user = Parse::User.new(data)
+
+ user.save
+
+ reset_password = Parse::User.reset_password(u)
+
+ assert true
+ end
+
end
| Test for password reset fix
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.