diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -8,3 +8,6 @@ depends 'hostsfile' depends 'chef-vault' + +supports 'redhat', '>= 7.1' +supports 'centos', '>= 7.1'
Add the platforms supported by this cookbook
diff --git a/spec/controllers/api_controller_spec.rb b/spec/controllers/api_controller_spec.rb index abc1234..def5678 100644 --- a/spec/controllers/api_controller_spec.rb +++ b/spec/controllers/api_controller_spec.rb @@ -0,0 +1,40 @@+# encoding: UTF-8 +require File.dirname(__FILE__) + "/../spec_helper" + +describe ApiController do + controller(ApiController) do + def index + render nothing: true + end + end + + describe "#set_content_type" do + context "on json format" do + it "should set json content type" do + get :index, format: 'json' + response.content_type.should == 'application/json' + end + end + + context "on xml format" do + it "should set xml content type" do + get :index, format: 'xml' + response.content_type.should == 'application/xml' + end + end + + context "on msgpack format" do + it "should set msgpack content type" do + get :index, format: 'msgpack' + response.content_type.should == 'application/x-msgpack' + end + end + + context "on unsupported format" do + it "should respond with http not acceptable" do + get :index, format: 'bson' + response.status.should == 406 + end + end + end +end
Add api controller spec testing content type filter
diff --git a/spec/views/cases/index.html.erb_spec.rb b/spec/views/cases/index.html.erb_spec.rb index abc1234..def5678 100644 --- a/spec/views/cases/index.html.erb_spec.rb +++ b/spec/views/cases/index.html.erb_spec.rb @@ -14,7 +14,7 @@ assign(:state_objects, State.all) render - expect(rendered).to match /John Doe/m - expect(rendered).to match /Jimmy Doe/m + expect(rendered).to match(/John Doe/m) + expect(rendered).to match(/Jimmy Doe/m) end end
Put parens around ambiguous arguments - spec/views/cases/show.html.erb_spec.rb - put parens around ambiguous regular expression arguments Updates #1145
diff --git a/db/migrate/20160106214719_add_composite_primary_keys_to_join_tables.rb b/db/migrate/20160106214719_add_composite_primary_keys_to_join_tables.rb index abc1234..def5678 100644 --- a/db/migrate/20160106214719_add_composite_primary_keys_to_join_tables.rb +++ b/db/migrate/20160106214719_add_composite_primary_keys_to_join_tables.rb @@ -0,0 +1,33 @@+class AddCompositePrimaryKeysToJoinTables < ActiveRecord::Migration + TABLE_MAP = { + "cloud_tenants_vms" => "cloud_tenant_id, vm_id", + "conditions_miq_policies" => "miq_policy_id, condition_id", + "configuration_locations_configuration_profiles" => "configuration_location_id, configuration_profile_id", + "configuration_organizations_configuration_profiles" => "configuration_organization_id, configuration_profile_id", + "configuration_profiles_configuration_tags" => "configuration_profile_id, configuration_tag_id", + "configuration_tags_configured_systems" => "configured_system_id, configuration_tag_id", + "container_groups_container_services" => "container_service_id, container_group_id", + "customization_scripts_operating_system_flavors" => "customization_script_id, operating_system_flavor_id", + "direct_configuration_profiles_configuration_tags" => "configuration_profile_id, configuration_tag_id", + "direct_configuration_tags_configured_systems" => "configured_system_id, configuration_tag_id", + "key_pairs_vms" => "authentication_id, vm_id", + "miq_groups_users" => "miq_group_id, user_id", + "miq_roles_features" => "miq_user_role_id, miq_product_feature_id", + "miq_servers_product_updates" => "product_update_id, miq_server_id", + "network_ports_security_groups" => "network_port_id, security_group_id", + "security_groups_vms" => "security_group_id, vm_id", + "storages_vms_and_templates" => "storage_id, vm_or_template_id" + }.freeze + + def up + TABLE_MAP.each do |table, key| + execute("ALTER TABLE #{table} ADD PRIMARY KEY (#{key})") + end + end + + def down + TABLE_MAP.keys.each do |table| + execute("ALTER TABLE #{table} DROP CONSTRAINT #{table}_pkey") + end + end +end
Add migration to create composite primary keys for join tables pglogical requires a primary key for all tables which will be replicating UPDATE and DELETE commands. https://trello.com/c/bRx6yN0C
diff --git a/test/property_test.rb b/test/property_test.rb index abc1234..def5678 100644 --- a/test/property_test.rb +++ b/test/property_test.rb @@ -5,7 +5,7 @@ it "returns the current 'last' value of the Stream" do button = Button.new stream = Frappuccino::Stream.new(button) - stepper = Frappuccino::Property.new(:not_pushed, button) + stepper = Frappuccino::Property.new(:not_pushed, stream) button.push assert_equal :pushed, stepper.now
Fix warnings for unused variable in Property test :blush:
diff --git a/lib/pry/commands/ls/instance_vars.rb b/lib/pry/commands/ls/instance_vars.rb index abc1234..def5678 100644 --- a/lib/pry/commands/ls/instance_vars.rb +++ b/lib/pry/commands/ls/instance_vars.rb @@ -0,0 +1,37 @@+require 'pry/commands/ls/interrogateable' + +class Pry + class Command::Ls < Pry::ClassCommand + class InstanceVars < Pry::Command::Ls::Formatter + + include Pry::Command::Ls::Interrogateable + + def initialize(interrogatee, has_any_opts, opts) + @interrogatee = interrogatee + @has_any_opts = has_any_opts + @default_switch = opts[:ivars] + end + + def correct_opts? + super || !@has_any_opts + end + + def output_self + ivars = if Object === @interrogatee + Pry::Method.safe_send(@interrogatee, :instance_variables) + else + [] #TODO: BasicObject support + end + kvars = Pry::Method.safe_send(interrogatee_mod, :class_variables) + ivars_out = output_section('instance variables', format(:instance_var, ivars)) + kvars_out = output_section('class variables', format(:class_var, kvars)) + ivars_out + kvars_out + end + + def format(type, vars) + vars.sort_by { |var| var.to_s.downcase }.map { |var| color(type, var) } + end + + end + end +end
Refactor the way how `ls` displays ivars
diff --git a/jefferies_tube.gemspec b/jefferies_tube.gemspec index abc1234..def5678 100644 --- a/jefferies_tube.gemspec +++ b/jefferies_tube.gemspec @@ -20,7 +20,7 @@ spec.add_development_dependency "awesome_print" spec.add_development_dependency "bundler" - spec.add_development_dependency "pry" + spec.add_development_dependency "pry", '~> 0.13' spec.add_development_dependency "rake" spec.add_development_dependency "rspec", '~> 3.0'
Add minimum version to pry to ensure compatibility `Pry::Prompt` was added in v0.13.0, so make that the minimum.
diff --git a/kernel/delta/kernel.rb b/kernel/delta/kernel.rb index abc1234..def5678 100644 --- a/kernel/delta/kernel.rb +++ b/kernel/delta/kernel.rb @@ -6,11 +6,11 @@ ctx = myself.sender if myself.send_private? - raise NameError, "undefined local variable or method `#{meth}' for #{inspect}" + Kernel.raise NameError, "undefined local variable or method `#{meth}' for #{inspect}" elsif self.__kind_of__ Class or self.__kind_of__ Module - raise NoMethodError.new("No method '#{meth}' on #{self} (#{self.__class__})", ctx, args) + Kernel.raise NoMethodError.new("No method '#{meth}' on #{self} (#{self.__class__})", ctx, args) else - raise NoMethodError.new("No method '#{meth}' on an instance of #{self.__class__}.", ctx, args) + Kernel.raise NoMethodError.new("No method '#{meth}' on an instance of #{self.__class__}.", ctx, args) end end
Make sure we call Kernel's raise when in a Thread
diff --git a/libraries/provider_git_client_osx.rb b/libraries/provider_git_client_osx.rb index abc1234..def5678 100644 --- a/libraries/provider_git_client_osx.rb +++ b/libraries/provider_git_client_osx.rb @@ -4,7 +4,7 @@ class Osx < Chef::Provider::GitClient include Chef::DSL::IncludeRecipe - provides :git_client, os: 'mac_os_x' + provides :git_client, platform: 'mac_os_x' action :install do dmg_package 'GitOSX-Installer' do
Fix git_client resource on OS X to actually fire Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
diff --git a/tasks/update_download_stats.rake b/tasks/update_download_stats.rake index abc1234..def5678 100644 --- a/tasks/update_download_stats.rake +++ b/tasks/update_download_stats.rake @@ -0,0 +1,15 @@+desc 'Update the statistics stored for next version' +task 'update_downstream_build_stats' do + + changelog = IO.read('CHANGELOG.md') + ENV['PREVIOUS_PRODUCT_VERSION'] ||= changelog[/^### \[v(\d+\.\d+)\]/, 1] + + next_version = ENV['PRODUCT_VERSION'] + unless next_version + version_parts = ENV['PREVIOUS_PRODUCT_VERSION'].split('.') + next_version = "#{version_parts[0]}.#{sprintf('%02d', version_parts[1].to_i + 1)}" + ENV['PRODUCT_VERSION'] = next_version + end + + sh "buildr clean arez:downstream-test:test DOWNSTREAM=no TEST=only GWT=no PRODUCT_VERSION=#{ENV['PRODUCT_VERSION']} STORE_BUILD_STATISTICS=true" +end
Add task that generates build statistics for next version
diff --git a/lib/SassyLists.rb b/lib/SassyLists.rb index abc1234..def5678 100644 --- a/lib/SassyLists.rb +++ b/lib/SassyLists.rb @@ -5,8 +5,8 @@ # Version is a number. If a version contains alphas, it will be created as a prerelease version # Date is in the form of YYYY-MM-DD module SassyLists - VERSION = "0.3.0" - DATE = "2013-11-04" + VERSION = "0.3.1" + DATE = "2013-11-05" end module Sass::Script::Functions
Update repo to last sources
diff --git a/lib/accounting/bank.rb b/lib/accounting/bank.rb index abc1234..def5678 100644 --- a/lib/accounting/bank.rb +++ b/lib/accounting/bank.rb @@ -2,6 +2,6 @@ class Bank < ActiveRecord::Base has_many :accounts - belongs_to :vcard, :class_name => 'Vcards::Vcard' + has_vcards end end
Use has_vcards from vcards plugin.
diff --git a/lib/ffmpeg_composer.rb b/lib/ffmpeg_composer.rb index abc1234..def5678 100644 --- a/lib/ffmpeg_composer.rb +++ b/lib/ffmpeg_composer.rb @@ -3,9 +3,9 @@ class FFmpegComposer def initialize(path, options={}) - @path = path - @fps = options.fetch(:fps) - @width = options.fetch(:width) - @height = options.fetch(:height) + @path = path.to_s + @fps = options.fetch(:fps).to_i + @width = options.fetch(:width).to_i + @height = options.fetch(:height).to_i end end
Make sure everything is typed correctly So we don't have to handle that from C code
diff --git a/lib/gondler/package.rb b/lib/gondler/package.rb index abc1234..def5678 100644 --- a/lib/gondler/package.rb +++ b/lib/gondler/package.rb @@ -7,6 +7,7 @@ @commit = options[:commit] @os = options[:os] @group = options[:group] + @fix = options[:fix] || false @flag = options[:flag] end
Add fix option to Package
diff --git a/spec/eval_spec.rb b/spec/eval_spec.rb index abc1234..def5678 100644 --- a/spec/eval_spec.rb +++ b/spec/eval_spec.rb @@ -0,0 +1,42 @@+require File.expand_path(File.dirname(__FILE__) + '/spec_helper') +require 'drug-bot/plugins/eval' + +describe "Eval" do + before(:each) do + @bot = stub + @eval = Eval.new(@bot) + @connection = ConnectionMock.new + end + + it "should eval ruby code" do + message = { :channel => "#test", :message => "% 1 + 1", :nick => "LTe" } + EM.run do + @eval.call(@connection, message) + eventually(true) { @connection.messages.include? "2" } + end + end + + it "@codegram should give me a t-shirt" do + message = { :channel => "#test", :message => "% \"@codegram\"", :nick => "LTe" } + EM.run do + @eval.call(@connection, message) + eventually(true) { @connection.messages.include? "@codegram" } + end + end + + it "should not eval system method" do + message = { :channel => "#test", :message => "% system('rm -rf /')", :nick => "LTe" } + EM.run do + @eval.call(@connection, message) + eventually(true) { @connection.messages.include? "Error: Insecure operation - system" } + end + end + + it "should not crash after raise Exception" do + message = { :channel => "#test", :message => "% raise Exception", :nick => "LTe" } + EM.run do + @eval.call(@connection, message) + eventually(true) { @connection.messages.include? "Error: Exception" } + end + end +end
Add tests for eval plugin.
diff --git a/migrate/20190923133742_add_global_values_to_aichi11_targets_table.rb b/migrate/20190923133742_add_global_values_to_aichi11_targets_table.rb index abc1234..def5678 100644 --- a/migrate/20190923133742_add_global_values_to_aichi11_targets_table.rb +++ b/migrate/20190923133742_add_global_values_to_aichi11_targets_table.rb @@ -0,0 +1,7 @@+class AddGlobalValuesToAichi11TargetsTable < ActiveRecord::Migration[5.0] + def change + add_column :aichi11_targets, :representative_global_value, :float + add_column :aichi11_targets, :well_connected_global_value, :float + add_column :aichi11_targets, :importance_global_value, :float + end +end
Add representative, well_connected and importance values
diff --git a/lib/optical/spotter.rb b/lib/optical/spotter.rb index abc1234..def5678 100644 --- a/lib/optical/spotter.rb +++ b/lib/optical/spotter.rb @@ -35,7 +35,7 @@ def name name = @treatments.first.safe_name.tr(" ",'_').tr("/","_") - if @controls.size > 0 && @controls[0] + if has_control?() name += "_" + @controls.first.safe_name.tr(" ",'_').tr("/","_") end name @@ -43,14 +43,20 @@ private - def data_dir() + def has_control?() + @controls.size > 0 && @controls[0] end end + File.exists?(spotfile_path()) File.join(@base_dir,name) + File.exists?(spotfile_path()) + File.exists?(spotfile_path()) + File.exists?(spotfile_path()) end def spotfile_path() base = File.basename(@treatments.first.safe_name,".bam") File.join(data_dir(),base) + ".spot.out" end -end + + def data_dir()
Enable checking if spot already done
diff --git a/app/controllers/comable/apartment/application_controller.rb b/app/controllers/comable/apartment/application_controller.rb index abc1234..def5678 100644 --- a/app/controllers/comable/apartment/application_controller.rb +++ b/app/controllers/comable/apartment/application_controller.rb @@ -36,12 +36,20 @@ fail 'Please implement this method' end - def after_sign_in_path_for(_resource) - comable_apartment.root_path + def after_sign_in_path_for(_resource_or_scope) + case resource_name + when :root_user + comable_apartment.root_path + # TODO: Delegate to Comable::ApplicationHelper + when :admin_user + comable.admin_root_path + else + session.delete(:user_return_to) || comable.root_path + end end - def after_sign_out_path_for(_resource) - comable_apartment.new_root_user_session_path + def after_sign_out_path_for(scope) + after_sign_in_path_for(scope) end end end
Fix the after sign in/out path to redirect
diff --git a/lib/web_game_engine.rb b/lib/web_game_engine.rb index abc1234..def5678 100644 --- a/lib/web_game_engine.rb +++ b/lib/web_game_engine.rb @@ -1,9 +1,10 @@ $: << File.dirname(__FILE__) +require 'game_engine' -class WebGameEngine +class WebGameEngine < GameEngine - attr_accessor :ttt_board - attr_reader :player_1, :player_2, :rules + # attr_accessor :ttt_board + # attr_reader :player_1, :player_2, :rules def initialize(args) @ttt_board = args.fetch(:ttt_board, nil)
Refactor to inherit from game engine super class
diff --git a/spec/unit/virtus/class_methods/attributes_spec.rb b/spec/unit/virtus/class_methods/attributes_spec.rb index abc1234..def5678 100644 --- a/spec/unit/virtus/class_methods/attributes_spec.rb +++ b/spec/unit/virtus/class_methods/attributes_spec.rb @@ -16,8 +16,7 @@ it { should be_instance_of(Virtus::AttributeSet) } it 'returns a deprecation warning' do - lambda { subject }.should change { $stderr.string.dup }.from('').to( - "#{object}.attributes is deprecated. Use #{object}.attribute_set instead: #{__FILE__}:4\n" - ) + subject + $stderr.string.should =~ /\A#{object}.attributes is deprecated. Use #{object}.attribute_set instead: #{__FILE__}:4\b/ end end
Fix spec to pass under ruby 1.9
diff --git a/lib/tasks/om.rake b/lib/tasks/om.rake index abc1234..def5678 100644 --- a/lib/tasks/om.rake +++ b/lib/tasks/om.rake @@ -1,7 +1,12 @@ namespace :om do desc "Fetch data for all cafeterias" task :fetch => :environment do + date = Time.zone.now.to_date + Cafeteria.all.each do |cafeteria| + next if cafeteria.last_fetched_at.to_date == date + next if Time.zone.now.hour < cafeteria.fetch_hour + begin cafeteria.fetch rescue Error => e
Add time preconditions to rake task
diff --git a/libraries/_autoload.rb b/libraries/_autoload.rb index abc1234..def5678 100644 --- a/libraries/_autoload.rb +++ b/libraries/_autoload.rb @@ -1,5 +1,5 @@ begin - gem 'docker-api', '= 1.32.1' + gem 'docker-api', '= 1.31.0' rescue LoadError unless defined?(ChefSpec) run_context = Chef::RunContext.new(Chef::Node.new, {}, Chef::EventDispatch::Dispatcher.new) @@ -7,7 +7,7 @@ require 'chef/resource/chef_gem' docker = Chef::Resource::ChefGem.new('docker-api', run_context) - docker.version '= 1.32.1' + docker.version '= 1.31.0' docker.run_action(:install) end end
Revert "updating docker-api gem version" This reverts commit 8460758881e0c1dcc81a3a932343055415fc403d.
diff --git a/qa/qa/specs/features/browser_ui/2_plan/issue/issue_suggestions_spec.rb b/qa/qa/specs/features/browser_ui/2_plan/issue/issue_suggestions_spec.rb index abc1234..def5678 100644 --- a/qa/qa/specs/features/browser_ui/2_plan/issue/issue_suggestions_spec.rb +++ b/qa/qa/specs/features/browser_ui/2_plan/issue/issue_suggestions_spec.rb @@ -9,12 +9,12 @@ Runtime::Browser.visit(:gitlab, Page::Main::Login) Page::Main::Login.perform(&:sign_in_using_credentials) - project = Resource::Project.fabricate! do |resource| + project = Resource::Project.fabricate_via_api! do |resource| resource.name = 'project-for-issue-suggestions' resource.description = 'project for issue suggestions' end - Resource::Issue.fabricate! do |issue| + Resource::Issue.fabricate_via_browser_ui! do |issue| issue.title = issue_title issue.project = project end
Update e2e test with more explicit methods This goes in accordance with https://bit.ly/2Z1RdjZ
diff --git a/panter-rails-deploy.gemspec b/panter-rails-deploy.gemspec index abc1234..def5678 100644 --- a/panter-rails-deploy.gemspec +++ b/panter-rails-deploy.gemspec @@ -1,7 +1,6 @@ Gem::Specification.new do |gem| gem.name = 'panter-rails-deploy' gem.version = '1.3.5' - gem.date = '2017-01-06' gem.summary = 'Capistrano setup for Panter Rails Hosting' gem.authors = [ 'Markus Koller', 'Beat Seeliger' ] gem.email = 'mak@panter.ch'
Remove static date from gemspec
diff --git a/simplecov.gemspec b/simplecov.gemspec index abc1234..def5678 100644 --- a/simplecov.gemspec +++ b/simplecov.gemspec @@ -14,7 +14,7 @@ gem.required_ruby_version = ">= 1.8.7" - gem.add_dependency "json", "~> 1.8" + gem.add_dependency "json", ">= 1.8" gem.add_dependency "simplecov-html", "~> 0.10.0" gem.add_dependency "docile", "~> 1.1.0"
CHANGE update json to >= 1.8 for CVE-2020-10663
diff --git a/spec/overcommit/hook/post_merge/submodule_status_spec.rb b/spec/overcommit/hook/post_merge/submodule_status_spec.rb index abc1234..def5678 100644 --- a/spec/overcommit/hook/post_merge/submodule_status_spec.rb +++ b/spec/overcommit/hook/post_merge/submodule_status_spec.rb @@ -0,0 +1,38 @@+require 'spec_helper' + +describe Overcommit::Hook::PostMerge::SubmoduleStatus do + let(:config) { Overcommit::ConfigurationLoader.default_configuration } + let(:context) { double('context') } + subject { described_class.new(config, context) } + + let(:result) { double('result') } + + before do + result.stub(:stdout).and_return("#{prefix}#{random_hash} sub (heads/master)") + subject.stub(:execute).and_return(result) + end + + context 'when submodule is up to date' do + let(:prefix) { '' } + + it { should pass } + end + + context 'when submodule is uninitialized' do + let(:prefix) { '-' } + + it { should warn(/uninitialized/) } + end + + context 'when submodule is outdated' do + let(:prefix) { '+' } + + it { should warn(/out of date/) } + end + + context 'when submodule has merge conflicts' do + let(:prefix) { 'U' } + + it { should warn(/merge conflicts/) } + end +end
Add specs for SubmoduleStatus post-merge hook
diff --git a/lib/mongo_benchpress/mongo_mapper_bp.rb b/lib/mongo_benchpress/mongo_mapper_bp.rb index abc1234..def5678 100644 --- a/lib/mongo_benchpress/mongo_mapper_bp.rb +++ b/lib/mongo_benchpress/mongo_mapper_bp.rb @@ -1,7 +1,5 @@ require 'mongo_mapper' require File.join( File.dirname(__FILE__), 'base' ) -require File.join( File.dirname(__FILE__), 'models', 'mongo_mapper_models.rb' ) - module MongoBenchpress class MongoMapperBp < MongoBenchpress::Base @@ -26,6 +24,7 @@ super( options ) ::MongoMapper.connection = self.connection ::MongoMapper.database = self.db.name + require File.join( File.dirname(__FILE__), 'models', 'mongo_mapper_models.rb' ) end end end
Move require models to after connection for mongo mapper
diff --git a/lib/plugins/commit_msg/russian_novel.rb b/lib/plugins/commit_msg/russian_novel.rb index abc1234..def5678 100644 --- a/lib/plugins/commit_msg/russian_novel.rb +++ b/lib/plugins/commit_msg/russian_novel.rb @@ -0,0 +1,30 @@+module Causes::GitHook + class RussianNovel < HookSpecificCheck + include HookRegistry + + RUSSIAN_NOVEL_LENGTH = 30 + def run_check + count = 0 + commit_message.find do |line| + count += 1 unless comment?(line) + diff_started?(line) + end + + if count > RUSSIAN_NOVEL_LENGTH + return :warn, 'You seem to have authored a Russian novel; congratulations!' + end + + :good + end + + private + + def diff_started?(line) + line =~ /^diff --git / + end + + def comment?(line) + line =~ /^#/ + end + end +end
Add "Russian Novel" easter egg To surprise and delight. Change-Id: I49350c9d9a974cfc9f786d0d0c23937812ded029 Reviewed-on: https://gerrit.causes.com/22229 Tested-by: Greg Hurrell <79e2475f81a6317276bf7cbb3958b20d289b78df@causes.com> Reviewed-by: Shane da Silva <6f6e68d1df92f30cb4b3ce35260ddf94a402f33d@causes.com>
diff --git a/lib/stroke_counter/typist/assessment.rb b/lib/stroke_counter/typist/assessment.rb index abc1234..def5678 100644 --- a/lib/stroke_counter/typist/assessment.rb +++ b/lib/stroke_counter/typist/assessment.rb @@ -1,6 +1,10 @@ module StrokeCounter class Typist module Assessment + FILENAMES = { + en: 'constitution_of_the_united_states.txt', + ja: 'constitution_of_japan.txt', + } def path_to_file(filename = nil) filename ||= 'constitution_of_japan.txt' File.join 'lib', 'stroke_counter', 'texts', filename @@ -10,7 +14,8 @@ File.new(path_to_file(filename), 'r') end - def assess(filename: nil) + def assess(filename: nil, lang: nil) + filename = FILENAMES[lang.to_sym] if lang text_file(filename: filename).each_line do |line| type_language(line) end
Use constitution of the united states when :en lang given
diff --git a/logstream.gemspec b/logstream.gemspec index abc1234..def5678 100644 --- a/logstream.gemspec +++ b/logstream.gemspec @@ -3,12 +3,14 @@ Gem::Specification.new do |s| s.name = "logstream" - s.version = "0.0.5" + s.version = "0.0.6" s.date = Time.now.strftime("%Y-%m-%d") s.author = "Barry Jaspan" s.email = "barry.jaspan@acquia.com" s.homepage = "https://github.com/acquia/logstream" + + s.licenses = ['MIT'] s.summary = "Acquia Logstream tools and library" s.description = "Logstream is an Acquia service for streaming logs from Acquia Cloud." @@ -22,4 +24,6 @@ s.add_runtime_dependency('faye-websocket', ['~> 0.8.0']) s.add_runtime_dependency('json', ['~> 1.7.7']) s.add_runtime_dependency('thor', ['~> 0.19.1']) + + s.required_ruby_version = '>= 1.9.3' end
Set minimum ruby version as well as license in gemspec
diff --git a/0_code_wars/split_in_parts.rb b/0_code_wars/split_in_parts.rb index abc1234..def5678 100644 --- a/0_code_wars/split_in_parts.rb +++ b/0_code_wars/split_in_parts.rb @@ -0,0 +1,9 @@+# http://www.codewars.com/kata/5650ab06d11d675371000003 +# --- iteration 1 --- +def split_in_parts (str, len) + str.chars + .each_slice(len) + .to_a + .map(&:join) + .join(" ") +end
Add code wars (7) - split in parts
diff --git a/spec/fabricators/event_fabricator.rb b/spec/fabricators/event_fabricator.rb index abc1234..def5678 100644 --- a/spec/fabricators/event_fabricator.rb +++ b/spec/fabricators/event_fabricator.rb @@ -9,4 +9,5 @@ teacher_ids ['vomackar'] student_ids ['skocdpet'] event_type 'lecture' + deleted false end
Set deleted in event fabricator to false
diff --git a/spec/controllers/home_controller_spec.rb b/spec/controllers/home_controller_spec.rb index abc1234..def5678 100644 --- a/spec/controllers/home_controller_spec.rb +++ b/spec/controllers/home_controller_spec.rb @@ -2,9 +2,16 @@ describe HomeController do describe "GET 'index'" do - it "should be successful" do + it 'should be successful' do get 'index' response.should be_success end end + + describe "GET 'learn_more'" do + it 'should be successful' do + get 'learn_more' + response.should be_success + end + end end
Add Home Learn More RSpec Test Add controller spec test for the learn more action.
diff --git a/spec/controllers/tags_controller_spec.rb b/spec/controllers/tags_controller_spec.rb index abc1234..def5678 100644 --- a/spec/controllers/tags_controller_spec.rb +++ b/spec/controllers/tags_controller_spec.rb @@ -20,12 +20,12 @@ describe "#show" do it "has a 200 status code" do - get :show, {id: 2} + get :show, {id: 5} expect(response.status).to eq(200) end it "renders show template" do - get :show, {id: 2} + get :show, {id: 5} expect(response).to render_template("show") end
Make change to comply with circle ci tests
diff --git a/lib/active_record/turntable/active_record_ext/association_preloader.rb b/lib/active_record/turntable/active_record_ext/association_preloader.rb index abc1234..def5678 100644 --- a/lib/active_record/turntable/active_record_ext/association_preloader.rb +++ b/lib/active_record/turntable/active_record_ext/association_preloader.rb @@ -11,13 +11,21 @@ def records_for_with_turntable(ids) returning_scope = records_for_without_turntable(ids) - if sharded_by_same_key? && owners_have_same_shard_key? - returning_scope = returning_scope.where(klass.turntable_shard_key => owners.first.send(klass.turntable_shard_key)) + if should_use_shard_key? && owners_have_same_shard_key? + returning_scope = returning_scope.where(klass.turntable_shard_key => owners.first.send(foreign_shard_key)) end returning_scope end private + + def foreign_shard_key + options[:foreign_shard_key] || model.turntable_shard_key + end + + def should_use_shard_key? + sharded_by_same_key? || !!options[:foreign_shard_key] + end def sharded_by_same_key? model.turntable_enabled? && @@ -26,7 +34,7 @@ end def owners_have_same_shard_key? - owners.map(&klass.turntable_shard_key).uniq.size == 1 + owners.map(&foreign_shard_key).uniq.size == 1 end end end
Fix preload association to use option `:foreign_shard_key
diff --git a/cricos_scrape.gemspec b/cricos_scrape.gemspec index abc1234..def5678 100644 --- a/cricos_scrape.gemspec +++ b/cricos_scrape.gemspec @@ -3,10 +3,10 @@ Gem::Specification.new do |spec| spec.name = 'cricos_scrape' spec.version = CricosScrape::VERSION - spec.authors = ['Toàn Lê'] - spec.email = ['ktoanlba@gmail.com'] + spec.authors = ['Trung Lê', 'Toàn Lê'] + spec.email = ['trung.le@ruby-journal.com', 'ktoanlba@gmail.com'] spec.summary = %q{Cricos Scrape} - spec.description = %q{Scrape Institutions, Courses, Contacts from CRIOS} + spec.description = %q{Scrape Institutions, Courses, Contacts from CRICOS} spec.homepage = 'https://github.com/ruby-journal/cricos_scrape.rb' spec.license = 'MIT' @@ -25,4 +25,4 @@ spec.add_development_dependency 'rspec-its', '~> 1.0' spec.add_runtime_dependency 'mechanize', '~> 2.7' -end+end
Add Trung into gem spec
diff --git a/spec/unit/rom/environment/schema_spec.rb b/spec/unit/rom/environment/schema_spec.rb index abc1234..def5678 100644 --- a/spec/unit/rom/environment/schema_spec.rb +++ b/spec/unit/rom/environment/schema_spec.rb @@ -5,6 +5,7 @@ describe Environment, '#schema' do let(:repositories) { Hash.new } let(:object) { Environment.build(repositories) } + let(:block) { Proc.new {} } before do stub(Schema).build(repositories) { schema } @@ -12,8 +13,6 @@ describe 'with a block' do subject { object.schema(&block) } - - let(:block) { Proc.new {} } fake(:schema) @@ -30,7 +29,7 @@ it 'calls the schema' do expect(subject).to be(schema) - expect(schema).not_to have_received.call + expect(schema).not_to have_received.call(&block) end end end
Fix (?) spec on rbx
diff --git a/messaging.gemspec b/messaging.gemspec index abc1234..def5678 100644 --- a/messaging.gemspec +++ b/messaging.gemspec @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = 'evt-messaging' - s.version = '0.28.0.1' + s.version = '0.29.0.0' s.summary = 'Common primitives for platform-specific messaging implementations for Eventide' s.description = ' '
Package version is increased from 0.28.0.1 to 0.29.0.0
diff --git a/Casks/handbrakecli-nightly.rb b/Casks/handbrakecli-nightly.rb index abc1234..def5678 100644 --- a/Casks/handbrakecli-nightly.rb +++ b/Casks/handbrakecli-nightly.rb @@ -1,10 +1,12 @@ cask :v1 => 'handbrakecli-nightly' do - version '6782svn' - sha256 'a661254da12a5fcaaab80b822bed78e8e000800042380bf3ccdfacf017cdb7fa' + version '6822svn' + sha256 '06b3024888643041779f4ac301266739ef6a6c4a30972a951aec881fb28f50c3' url "http://download.handbrake.fr/nightly/HandBrake-#{version}-MacOSX.6_CLI_x86_64.dmg" homepage 'http://handbrake.fr' license :gpl + depends_on :macos => '>= :snow_leopard' + binary 'HandBrakeCLI' end
Update HandbrakeCLI Nightly to v6822svn HandBrakeCLI Nightly v6822svn built 2015-01-28.
diff --git a/spec/factories.rb b/spec/factories.rb index abc1234..def5678 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -13,7 +13,7 @@ factory :bus_assignment_response, class: Struct do BusNumber { generate(:string) } - StudentNumber { generate(:string) } + StudentNo { generate(:string) } days 'MTWHF' parentfirstname { generate(:string) } parentlastname { generate(:string) }
Correct bus assignment response factory
diff --git a/spec/factories.rb b/spec/factories.rb index abc1234..def5678 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -4,6 +4,7 @@ factory :scraper do name 'my_scraper' + full_name 'mlandauer/my_scraper' owner end
Include default value in factory `full_name` is used in GitHub validations so we need something here. Just using a full_name we already have a VCR recording for.
diff --git a/nodenv.rb b/nodenv.rb index abc1234..def5678 100644 --- a/nodenv.rb +++ b/nodenv.rb @@ -2,7 +2,7 @@ homepage "https://github.com/OiNutter/nodenv" head "https://github.com/OiNutter/nodenv.git" url "https://github.com/OiNutter/nodenv/archive/v0.2.0.tar.gz" - sha1 "ce66e6a546ad92b166c4133796df11cd9fbbbd5f" + sha256 "3e0c8f81407741ac4b8ca4a07e03269e13ff00e15057f8fbdf0a195068043b60" def install prefix.install "bin", "libexec"
Use sha256 instead of deprecated sha1 stanza
diff --git a/Casks/tresorit.rb b/Casks/tresorit.rb index abc1234..def5678 100644 --- a/Casks/tresorit.rb +++ b/Casks/tresorit.rb @@ -5,7 +5,7 @@ # windows.net is the official download host per the vendor homepage url 'https://installerstorage.blob.core.windows.net/public/install/Tresorit.dmg' name 'Tresorit' - homepage 'http://tresorit.com' + homepage 'https://tresorit.com/' license :unknown # todo: change license and remove this comment; ':unknown' is a machine-generated placeholder app 'Tresorit.app'
Fix homepage to use SSL in Tresorit Cask The HTTP URL is already getting redirected to HTTPS. Using the HTTPS URL directly makes it more secure and saves a HTTP round-trip.
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 (transferred from ManageIQ/manageiq@40302b168463700ee1c087126de9aad2eba200be)
diff --git a/query_string_search.gemspec b/query_string_search.gemspec index abc1234..def5678 100644 --- a/query_string_search.gemspec +++ b/query_string_search.gemspec @@ -6,8 +6,8 @@ Gem::Specification.new do |spec| spec.name = "query_string_search" spec.version = QueryStringSearch::VERSION - spec.authors = ["Ian Whitney"] - spec.email = ["whit0694@umn.edu"] + spec.authors = ["Ian Whitney", "Debbie Gillespie", "Davin Lagerroos"] + spec.email = ["asrwebteam@umn.edu"] spec.summary = %q{Provides a standard way to do searches using query strings in an API endpoint} spec.homepage = "https://github.com/umn-asr/query_string_search" spec.license = ""
Add team members and team-wide email
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,7 +1,7 @@ require 'rubygems' require 'test/unit' require 'yaml' -require 'activerecord' +require 'active_record' $:.unshift File.join(File.dirname(__FILE__), '../lib') @@ -10,7 +10,7 @@ def load_schema config = YAML::load(IO.read(File.dirname(__FILE__) + '/database.yml')) ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + "/debug.log") - db_adapter = ENV['DB'] + db_adapter = ENV['DB'] || 'sqlite3' # no DB passed, try sqlite3 by default db_adapter ||=
Make sqlite3 default DB driver.
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index abc1234..def5678 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -14,13 +14,4 @@ .to eql [user.last_name, user.first_name].join(', ') end end - describe 'self.fallback' do - it 'returns the fallback user if one is present' do - fallback = create :user, is_fallback: true - expect(User.fallback).to eql fallback - end - it 'returns nil if no fallback user is present' do - expect(User.fallback).to be nil - end - end end
Remove tests for disused model method
diff --git a/Library/Homebrew/utils/shebang.rb b/Library/Homebrew/utils/shebang.rb index abc1234..def5678 100644 --- a/Library/Homebrew/utils/shebang.rb +++ b/Library/Homebrew/utils/shebang.rb @@ -6,14 +6,19 @@ # # @api private module Shebang + extend T::Sig + module_function # Specification on how to rewrite a given shebang. # # @api private class RewriteInfo + extend T::Sig + attr_reader :regex, :max_length, :replacement + sig { params(regex: Regexp, max_length: Integer, replacement: T.any(String, Pathname)).void } def initialize(regex, max_length, replacement) @regex = regex @max_length = max_length @@ -27,6 +32,7 @@ # rewrite_shebang detected_python_shebang, bin/"script.py" # # @api public + sig { params(rewrite_info: RewriteInfo, paths: T::Array[T.any(String, Pathname)]).void } def rewrite_shebang(rewrite_info, *paths) paths.each do |f| f = Pathname(f)
Add type signatures to `Utils::Shebang`.
diff --git a/fcc_reboot.gemspec b/fcc_reboot.gemspec index abc1234..def5678 100644 --- a/fcc_reboot.gemspec +++ b/fcc_reboot.gemspec @@ -5,7 +5,7 @@ gem.add_dependency 'faraday', '~> 0.7' gem.add_dependency 'faraday_middleware', '~> 0.7' gem.add_dependency 'hashie', '~> 1.2' - gem.add_dependency 'multi_json', '~> 1.0' + gem.add_dependency 'multi_json', '~> 1.3' gem.add_development_dependency 'rake' gem.add_development_dependency 'rdiscount' gem.add_development_dependency 'rspec'
Update multi_json dependancy to 1.3
diff --git a/app/models/spree/pay_easy.rb b/app/models/spree/pay_easy.rb index abc1234..def5678 100644 --- a/app/models/spree/pay_easy.rb +++ b/app/models/spree/pay_easy.rb @@ -5,6 +5,7 @@ has_many :payments, as: :source validates :email, :given_name, :family_name, :given_name_kana, :family_name_kana, presence: true + validates :phone, numericality: true, allow_nil: true def actions %w{capture void}
Add validation for phone attribute
diff --git a/week-5/acct_groups.rb b/week-5/acct_groups.rb index abc1234..def5678 100644 --- a/week-5/acct_groups.rb +++ b/week-5/acct_groups.rb @@ -0,0 +1,40 @@+=begin +--pseudocode-- +input: array of dbc students +output: an array of arrays +steps: +take the number of elements in the input array mod 4 to see how many there will be left over if there are groups of four +IF it is less than 3 add each to a group of 4 to make 0-2 groups of 5 + ELSE if it is 3 make one group of 3 and the rest groups of 4 +END IF + +create an empty container to store the groups of students +WHILE there are still students left to be grouped + put the first four students into the container of groups and remove them from the original list +END WHILE + +=end + +peers = ["Alivia Blount","Alyssa Page","Alyssa Ransbury","Andria Reta","Austin Dorff","Autumn McFeeley","Ayaz Uddin","Ben Giamarino","Benjamin Heidebrink","Bethelhem Assefa","Bobby Reith","Dana Breen","Brett Ripley","Rene Castillo","Justin J Chang","Ché Sanders","Chris Henderson","Chris Pon","Colette Pitamba","Connor Reaumond","Cyrus Vattes","Dan Heintzelman","David Lange","Eduardo Bueno","Liz Roche","Emmanuel Kaunitz","FJ","Frankie Pangilinan","Ian Fricker","Ian Thorp","Ivy Vetor","Jack Baginski","Jack Hamilton","JillianC","John Craigie","John Holman","John Maguire","John Pults","Jones Melton","Tyler Keating","Kenton Lin","Kevin Serrano","wolv","Kyle Rombach","Laura Montoya","Luis Ybarra","Charlotte Manetta","Marti Osteyee-Hoffman","Megan Swanby","Mike London","Michael Wang","Michael Yao","Mike Gwozdek","Miqueas Hernandez","Mitchell Kroska","Norberto Caceres","Patrick Skelley","Peter Kang","Philip Chung","Phillip Barnett","Pietro Martini","Robbie Santos","Rokas Simkonis","Ronu Ghoshal","Ryan Nebuda","Ryan Smith","Saralis Rivera","Sam Assadi","Spencer Alexander","Stephanie Major","Taylor Daugherty","Thomas Farr","Maeve Tierney","Tori Huang","Alexander Williams","Victor Wong","Xin Zhang","Zach Barton"] + +def accountability_groups(arr) + divisible_by_4 = arr.length % 4 + groups = [] + + if divisible_by_4 == 3 + groups << arr.shift(3) + else + while divisible_by_4 > 0 + groups << arr.shift(5) + divisible_by_4 -= 1 + end + end + + while arr.length > 0 + groups << arr.shift(4) + end + + groups +end + +
Create MVP for accountability groups
diff --git a/test/serializr_generator_test.rb b/test/serializr_generator_test.rb index abc1234..def5678 100644 --- a/test/serializr_generator_test.rb +++ b/test/serializr_generator_test.rb @@ -23,4 +23,12 @@ assert_match(/attributes :id, :name, :email/, content) end end + + test '--parent usage' do + run_generator %w(User --parent Serializr) + + assert_file "app/serializers/user_serializer.rb" do |content| + assert_match(/class UserSerializer < Serializr/, content) + end + end end
Test out the --parent usage
diff --git a/cirrus.gemspec b/cirrus.gemspec index abc1234..def5678 100644 --- a/cirrus.gemspec +++ b/cirrus.gemspec @@ -17,5 +17,6 @@ gem.add_development_dependency("minitest", "~> 3.3.0") + gem.add_dependency("rake", "~> 0.9.2.2") gem.add_dependency("redis", "~> 3.0.1") end
Include rake in the gemspec
diff --git a/lib/conjur/rack/user.rb b/lib/conjur/rack/user.rb index abc1234..def5678 100644 --- a/lib/conjur/rack/user.rb +++ b/lib/conjur/rack/user.rb @@ -18,7 +18,7 @@ else [ tokens[0], tokens[1..-1].join('/') ] end - [ conjur_account, role_kind, roleid ].join(':') + [ account, role_kind, roleid ].join(':') end def role
Fix a bug in Conjur::Rack::User
diff --git a/git-review.gemspec b/git-review.gemspec index abc1234..def5678 100644 --- a/git-review.gemspec +++ b/git-review.gemspec @@ -2,12 +2,13 @@ Gem::Specification.new do |s| s.name = 'git-review' - s.version = '2.0.0' + s.version = '2.0.1' s.date = Time.now.strftime('%F') s.summary = 'Facilitates GitHub code reviews' s.homepage = 'http://github.com/b4mboo/git-review' s.email = 'bamberger.dominik@gmail.com' s.authors = ['Dominik Bamberger'] + s.license = 'MIT' s.files = %w( LICENSE ) s.files += Dir.glob('lib/**/*') @@ -16,12 +17,12 @@ s.executables = %w( git-review ) s.description = 'Manage review workflow for projects hosted on GitHub (using pull requests).' - s.add_runtime_dependency 'launchy' - s.add_runtime_dependency 'yajl-ruby' - s.add_runtime_dependency 'hashie' - s.add_runtime_dependency 'gli', '~> 2.8.0' - s.add_runtime_dependency 'octokit', '~> 2.0.0' - s.add_development_dependency 'rspec', '>= 2.13.0' - s.add_development_dependency 'guard', '>= 2.0.3' - s.add_development_dependency 'guard-rspec', '>= 3.1.0' + s.add_runtime_dependency 'launchy', '~> 0' + s.add_runtime_dependency 'yajl-ruby', '~> 0' + s.add_runtime_dependency 'hashie', '~> 0' + s.add_runtime_dependency 'gli', '~> 2.8' + s.add_runtime_dependency 'octokit', '~> 4.3' + s.add_development_dependency 'rspec', '~> 2.13' + s.add_development_dependency 'guard', '~> 2.0' + s.add_development_dependency 'guard-rspec', '~> 3.1' end
Update octokit to the most recent version, cleanup gemspec
diff --git a/db/data_migration/20170727112620_rename_democratic_republic_of_congo.rb b/db/data_migration/20170727112620_rename_democratic_republic_of_congo.rb index abc1234..def5678 100644 --- a/db/data_migration/20170727112620_rename_democratic_republic_of_congo.rb +++ b/db/data_migration/20170727112620_rename_democratic_republic_of_congo.rb @@ -0,0 +1,6 @@+# Change country name from Democratic Republic of Congo to +# Democratic Republic of the Congo +WorldLocation + .find_by(slug: "democratic-republic-of-the-congo") + .translation + .update(name: "Democratic Republic of the Congo")
Rename Democratic Republic of the Congo As a result of the change in the name of Democratic Republic of Congo to Democratic Republic of the Congo, this commit setups a migration to achieve this. Previous attempt only changed the slug in pull request 2776.
diff --git a/lib/dynamic_sitemaps.rb b/lib/dynamic_sitemaps.rb index abc1234..def5678 100644 --- a/lib/dynamic_sitemaps.rb +++ b/lib/dynamic_sitemaps.rb @@ -5,22 +5,28 @@ require "dynamic_sitemaps/sitemap_result" module DynamicSitemaps - DEFAULT_PER_PAGE = 2 + DEFAULT_PER_PAGE = 1000 DEFAULT_FOLDER = "sitemaps" + DEFAULT_INDEX_FILE_NAME = "sitemap.xml" + DEFAULT_ALWAYS_GENERATE_INDEX = false class << self - attr_writer :path, :relative_path, :folder, :config_path + attr_writer :path, :folder, :index_file_name, :always_generate_index, :config_path def generate_sitemap DynamicSitemaps::Generator.generate end # Configure DynamicSitemaps. + # Defaults: # # DynamicSitemaps.configure do |config| - # config.path = "/my/sitemaps/folder" - # config.config_path = Rails.root.join("config", "custom", "sitemap.rb") - # config.relative_path = "/custom-folder/sitemaps" + # config.path = Rails.root.join("public") + # config.folder = "sitemaps" + # config.index_file_name = "sitemap.xml" + # config.always_generate_index = false + # config.config_path = Rails.root.join("config", "sitemap.rb") + # end def configure yield self end @@ -33,6 +39,15 @@ @path ||= Rails.root.join("public") end + def index_file_name + @index_file_name ||= DEFAULT_INDEX_FILE_NAME + end + + def always_generate_index + return @always_generate_index if instance_variable_defined?(:@always_generate_index) + @always_generate_index = DEFAULT_ALWAYS_GENERATE_INDEX + end + def config_path @config_path ||= Rails.root.join("config", "sitemap.rb") end
Add some more config options
diff --git a/lib/facter/alt_fqdns.rb b/lib/facter/alt_fqdns.rb index abc1234..def5678 100644 --- a/lib/facter/alt_fqdns.rb +++ b/lib/facter/alt_fqdns.rb @@ -19,26 +19,16 @@ 'storage_mgmt', 'tenant', 'management', + 'ctlplane', ].each do |network| Facter.add('fqdn_' + network) do setcode do - external_hostname_parts = [ + hostname_parts = [ Facter.value(:hostname), network.gsub('_', ''), Facter.value(:domain), ].reject { |part| part.nil? || part.empty? } - external_hostname_parts.join(".") + hostname_parts.join(".") end end end -# map ctlplane network to management fqdn -Facter.add('fqdn_ctlplane') do - setcode do - hostname_parts = [ - Facter.value(:hostname), - 'management', - Facter.value(:domain), - ].reject { |part| part.nil? || part.empty? } - hostname_parts.join(".") - end -end
Fix value of ctlplane fqdn fact This fact was being retrieving the value of the hostname for the management network. We should instead be using a value set explicitly in t-h-t. Depends-On: Idb3ca22ac136691b0bff6f94524d133a4fa10617 Change-Id: I6fcf7c7853071a9f3377aec475308bc8d10d5b33 Related-Bug: #1621742
diff --git a/lib/gitolite/ssh_key.rb b/lib/gitolite/ssh_key.rb index abc1234..def5678 100644 --- a/lib/gitolite/ssh_key.rb +++ b/lib/gitolite/ssh_key.rb @@ -17,7 +17,7 @@ end #Get our owner and location - File.basename(key) =~ /^(\w+(?:@\w+\.\D{2,4})?)(?:@(\w+))?.pub$/i + File.basename(key) =~ /^(\w+(?:@(?:\w+\.)+\D{2,4})?)(?:@(\w+))?.pub$/i @owner = $1 @location = $2
Tweak the multikey regex to allow for emails like foo.bar.com
diff --git a/lib/hamster/core_ext.rb b/lib/hamster/core_ext.rb index abc1234..def5678 100644 --- a/lib/hamster/core_ext.rb +++ b/lib/hamster/core_ext.rb @@ -1,3 +1,2 @@ require "hamster/core_ext/enumerable" -require "hamster/core_ext/enumerator" require "hamster/core_ext/io"
Remove reference to source file which no longer exists
diff --git a/lib/kigoapi/property.rb b/lib/kigoapi/property.rb index abc1234..def5678 100644 --- a/lib/kigoapi/property.rb +++ b/lib/kigoapi/property.rb @@ -32,12 +32,6 @@ def address addr = "#{self.addr1} #{self.street_no}" - - unless self.addr2.blank? - addr += ", #{self.addr2}" - end - - addr += ", #{self.city}, #{self.postcode}" end private @@ -54,4 +48,4 @@ self.class.send(:define_method, name, &block) end end -end+end
Address returns street + street no only
diff --git a/lib/s3_file_uploader.rb b/lib/s3_file_uploader.rb index abc1234..def5678 100644 --- a/lib/s3_file_uploader.rb +++ b/lib/s3_file_uploader.rb @@ -12,7 +12,6 @@ directory.files.create( key: filename, body: csv, - public: true, ) end end
Remove public=>true from upload parameters
diff --git a/db/migrate/20190212153832_change_final_legal_document_id_to_bigint.rb b/db/migrate/20190212153832_change_final_legal_document_id_to_bigint.rb index abc1234..def5678 100644 --- a/db/migrate/20190212153832_change_final_legal_document_id_to_bigint.rb +++ b/db/migrate/20190212153832_change_final_legal_document_id_to_bigint.rb @@ -0,0 +1,15 @@+class ChangeFinalLegalDocumentIdToBigint < ActiveRecord::Migration[6.0] + def up + change_column :agreements, :final_legal_document_id, :bigint + change_column :final_legal_document_pages, :final_legal_document_id, :bigint + change_column :final_legal_document_variable_options, :final_legal_document_id, :bigint + change_column :final_legal_document_variables, :final_legal_document_id, :bigint + end + + def down + change_column :agreements, :final_legal_document_id, :integer + change_column :final_legal_document_pages, :final_legal_document_id, :integer + change_column :final_legal_document_variable_options, :final_legal_document_id, :integer + change_column :final_legal_document_variables, :final_legal_document_id, :integer + end +end
Update final_legal_document_id foreign key to bigint
diff --git a/spec/acceptance/concat_spec.rb b/spec/acceptance/concat_spec.rb index abc1234..def5678 100644 --- a/spec/acceptance/concat_spec.rb +++ b/spec/acceptance/concat_spec.rb @@ -29,7 +29,7 @@ pp = <<-EOS $output = concat(['1','2','3'],['4','5','6'],['7','8','9']) validate_array($output) - if size($output) != 6 { + if size($output) != 9 { fail("${output} should have 9 elements.") } EOS
Fix bad check in test
diff --git a/spec/support/person_matcher.rb b/spec/support/person_matcher.rb index abc1234..def5678 100644 --- a/spec/support/person_matcher.rb +++ b/spec/support/person_matcher.rb @@ -18,8 +18,10 @@ :groups, :ids, :last_name, + :mailbox, :majors, :middle_name, + :minors, :partial_ssn, :pay_type, :phones,
Add new person attributes to tests
diff --git a/postmark-rails.gemspec b/postmark-rails.gemspec index abc1234..def5678 100644 --- a/postmark-rails.gemspec +++ b/postmark-rails.gemspec @@ -5,7 +5,6 @@ s.name = %q{postmark-rails} s.version = Postmark::Rails::VERSION s.authors = ["Petyo Ivanov", "Ilya Sabanin", "Artem Chistyakov"] - s.date = %q{2010-11-22} s.description = %q{Use this plugin in your rails applications to send emails through the Postmark API} s.email = %q{ilya@wildbit.com} s.homepage = %q{http://postmarkapp.com}
Remove date attribute from the gemspec.
diff --git a/app/models/email_processor.rb b/app/models/email_processor.rb index abc1234..def5678 100644 --- a/app/models/email_processor.rb +++ b/app/models/email_processor.rb @@ -11,7 +11,9 @@ newsletter_id: newsletter.id, to: @email.to[0][:email], from: @email.from[:email], - subject: @email.subject, + raw_text: @email.raw_text, + raw_html: @email.raw_html, + raw_body: @email.raw_body, body: @email.body ) end
Save the content from the email request
diff --git a/app/controllers/categories_controller.rb b/app/controllers/categories_controller.rb index abc1234..def5678 100644 --- a/app/controllers/categories_controller.rb +++ b/app/controllers/categories_controller.rb @@ -27,6 +27,9 @@ if params[:party] promises = promises.includes(:party). where("parties.slug = ?", params[:party]) + else + # TODO: extract to scope + promises = promises.sort_by { |e| [e.party.in_government? ? 0 : 1, e.party.name]} end @promises_by_party = promises.group_by(&:party);
Fix sort order of promises in CategoriesController.
diff --git a/app/controllers/milestones_controller.rb b/app/controllers/milestones_controller.rb index abc1234..def5678 100644 --- a/app/controllers/milestones_controller.rb +++ b/app/controllers/milestones_controller.rb @@ -1,9 +1,11 @@ class MilestonesController < ApplicationController def complete_view_lesson_tutorial - milestone = Milestone.find_by(name: 'View Lessons Tutorial') - if !milestone.users.find_by(id: current_user.id) - current_user.milestones.push(milestone) + if current_user + milestone = Milestone.find_by(name: 'View Lessons Tutorial') + if !milestone.users.find_by(id: current_user.id) + current_user.milestones.push(milestone) + end end render json: {} end
Make sure current user exists.
diff --git a/app/controllers/validators_controller.rb b/app/controllers/validators_controller.rb index abc1234..def5678 100644 --- a/app/controllers/validators_controller.rb +++ b/app/controllers/validators_controller.rb @@ -14,17 +14,30 @@ def autofill dataset = DataKitten::Dataset.new(access_url: params[:url]) if dataset.supported? + distributions = [] + + dataset.distributions.each do |distribution| + distributions << { + :title => distribution.title, + :description => distribution.description, + :access_url => distribution.access_url, + :extension => distribution.format.extension, + :open => distribution.format.open?, + :structured => distribution.format.structured? + } + end + render :json => { - :title => dataset.data_title, - :description => dataset.description, - :publishers => dataset.publishers, - :rights => dataset.rights, - :licenses => dataset.licenses, - :update_frequency => dataset.update_frequency, - :keywords => dataset.keywords, - :distributions => dataset.distributions, - :release_date => dataset.issued, - :modified_date => dataset.modified, + :title => dataset.data_title, + :description => dataset.description, + :publishers => dataset.publishers, + :rights => dataset.rights, + :licenses => dataset.licenses, + :update_frequency => dataset.update_frequency, + :keywords => dataset.keywords, + :distributions => distributions, + :release_date => dataset.issued, + :modified_date => dataset.modified, :temporal_coverage => dataset.temporal } else
Add `distribution.open` and `distribution.structured` to JSON response
diff --git a/test/exercism/trail_test.rb b/test/exercism/trail_test.rb index abc1234..def5678 100644 --- a/test/exercism/trail_test.rb +++ b/test/exercism/trail_test.rb @@ -8,7 +8,7 @@ attr_reader :trail, :one, :two def setup - @trail = Trail.new('go', ['one', 'two'], '/tmp') + @trail = Trail.new('Go', ['one', 'two'], '/tmp') @one = Exercise.new('go', 'one') @two = Exercise.new('go', 'two') end @@ -17,9 +17,13 @@ assert_equal 'go', trail.language end + def test_name + assert_equal 'Go', trail.name + end + def test_catch_up_missed_exercise slugs = %w(chicken suit one garden two cake) - trail = Trail.new('go', slugs, '/tmp') + trail = Trail.new('Go', slugs, '/tmp') exercise = trail.after(two, %w(chicken suit garden)) assert_equal one, exercise
Update trail test to reflect new behavior
diff --git a/test/helpers/auth_helper.rb b/test/helpers/auth_helper.rb index abc1234..def5678 100644 --- a/test/helpers/auth_helper.rb +++ b/test/helpers/auth_helper.rb @@ -37,12 +37,13 @@ # # Alias for above for nicer usage (e.g., get with_auth_token "http://") # - def with_auth_token(data) - add_auth_token data + def with_auth_token(data, user = User.first) + add_auth_token data, user end module_function :auth_token module_function :add_auth_token module_function :auth_token_for_user + module_function :with_auth_token end end
FIX: Add missing module function for with_auth_token
diff --git a/test/manual/test_pageant.rb b/test/manual/test_pageant.rb index abc1234..def5678 100644 --- a/test/manual/test_pageant.rb +++ b/test/manual/test_pageant.rb @@ -0,0 +1,35 @@+# $ ruby -Ilib -Itest -rrubygems test/manual/test_pageant.rb + +# +# Tests for communication capability with Pageant process running in +# different UAC context. +# +# Test prerequisite: +# - Pageant process running on machine in different UAC context from +# the command prompt running the test. +# + +require 'common' +require 'net/ssh/authentication/agent' + +module Authentication + + class TestPageant < Test::Unit::TestCase + + def test_agent_should_be_able_to_negotiate + assert_nothing_raised(Net::SSH::Authentication::AgentNotAvailable) { agent.negotiate! } + end + + private + + def agent(auto=:connect) + @agent ||= begin + agent = Net::SSH::Authentication::Agent.new + agent.connect! if auto == :connect + agent + end + end + + end + +end
Add manual test for Pageant negotiation.
diff --git a/models.rb b/models.rb index abc1234..def5678 100644 --- a/models.rb +++ b/models.rb @@ -58,7 +58,7 @@ before_create :adjust_url def adjust_url - if self.author_url !~ /^http:\/\// + if self.author_url.present? and (self.author_url !~ /^http:\/\//) self.author_url = "http://#{author_url}" end end
Fix bug where blank websites got a http prefix
diff --git a/ffi-locale.gemspec b/ffi-locale.gemspec index abc1234..def5678 100644 --- a/ffi-locale.gemspec +++ b/ffi-locale.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = 'ffi-locale' - s.version = '0.2.1' + s.version = '0.2.2' s.platform = Gem::Platform::RUBY s.authors = `git log --format="%aN" | sort -u`.split("\n") s.email = 'k33rni@gmail.com' @@ -19,8 +19,6 @@ s.test_files = `git ls-files {test,spec}/*`.split("\n") s.require_paths = ['lib'] - s.required_ruby_version = '>= 1.9' - s.add_runtime_dependency 'ffi', '>= 1.0.7' s.add_development_dependency 'minitest', '>= 5.7' s.add_development_dependency 'simplecov'
Drop required_ruby_version from Gemspec. Bump version.
diff --git a/test/controllers/thincloud/authentication/sessions_controller_test.rb b/test/controllers/thincloud/authentication/sessions_controller_test.rb index abc1234..def5678 100644 --- a/test/controllers/thincloud/authentication/sessions_controller_test.rb +++ b/test/controllers/thincloud/authentication/sessions_controller_test.rb @@ -3,10 +3,22 @@ module Thincloud::Authentication describe SessionsController do describe "GET new" do - before { get :new } - it { assert_response :success } - it { assert_template :new } + describe "when not logged in" do + before { get :new } + + it { assert_response :success } + it { assert_template :new } + end + + describe "when logged in" do + before do + SessionsController.any_instance.stubs(:logged_in?).returns(true) + get :new + end + + it { assert_redirected_to "/" } + end end describe "DELETE destroy" do
Add test for after login path redirection.
diff --git a/ast/terminal.rb b/ast/terminal.rb index abc1234..def5678 100644 --- a/ast/terminal.rb +++ b/ast/terminal.rb @@ -7,12 +7,18 @@ # TODO: Make this faster (regex is slow) # TODO: Emphasis RESERVED_CHARACTERS = [ - '_', '#', '\\', '%' + '_', '#', '%' # '//' ] def self.character_escape(text) + # backslashes are weird, since they are evaluated twice by gsub and + # everything gets super confusing. We just handle the case explicitly here. + text.gsub!('\\', '\\\\\\') + RESERVED_CHARACTERS.each do |char| text.gsub!(char, "\\#{char}") end + + text end
Fix weirdness with backslash escaping
diff --git a/spec/factories/factories.rb b/spec/factories/factories.rb index abc1234..def5678 100644 --- a/spec/factories/factories.rb +++ b/spec/factories/factories.rb @@ -10,4 +10,10 @@ description { "my savings budget" } user end + + factory :budget_item do + name { "Budget Item" } + amount { 500.00 } + notebook + end end
Add budget item as a factory
diff --git a/app/services/mysql_service.rb b/app/services/mysql_service.rb index abc1234..def5678 100644 --- a/app/services/mysql_service.rb +++ b/app/services/mysql_service.rb @@ -1,20 +1,21 @@ class MysqlService < BaseService def default_environment_variables { - 'MYSQL_ROOT_PASSWORD' => SecureRandom.hex + 'MYSQL_ROOT_PASSWORD' => SecureRandom.hex, + 'MYSQL_ROOT_USERNAME' => 'root' } end def required_environment_variables - ['MYSQL_ROOT_PASSWORD'] + ['MYSQL_ROOT_PASSWORD', 'MYSQL_ROOT_USERNAME'] end def connection_string - "mysql://root:#{service.environment_variables['MYSQL_ROOT_PASSWORD']}@#{service.host}:#{service.port}" + "mysql://#{service.environment_variables['MYSQL_ROOT_USERNAME']}:#{service.environment_variables['MYSQL_ROOT_PASSWORD']}@#{service.host}:#{service.port}" end def connection_command - "mysql -h#{service.host} -uroot -p#{service.environment_variables['MYSQL_ROOT_PASSWORD']} -P#{service.port}" + "mysql -h#{service.host} -u#{service.environment_variables['MYSQL_ROOT_USERNAME']} -p#{service.environment_variables['MYSQL_ROOT_PASSWORD']} -P#{service.port}" end def container_port @@ -23,7 +24,7 @@ def backup_environment_variables { - DB_USER: 'root', + DB_USER: service.environment_variables['MYSQL_ROOT_USERNAME'], DB_HOST: service.host, DB_PORT: service.port, DB_PASS: service.environment_variables['MYSQL_ROOT_PASSWORD'],
Use env vars for mysql username
diff --git a/spec/factories/sequences.rb b/spec/factories/sequences.rb index abc1234..def5678 100644 --- a/spec/factories/sequences.rb +++ b/spec/factories/sequences.rb @@ -1,5 +1,5 @@ FactoryGirl.define do sequence(:name) { |i| "Name_#{i}" } - sequence(:email) { |i| "user_#{i}@mail.com" } + sequence(:email) { |i| "user_#{SecureRandom.hex(4)}@mail.com" } sequence(:title) { |i| "Title_#{i}" } end
Make email in User factory been more randomic
diff --git a/spec/shoes/download_spec.rb b/spec/shoes/download_spec.rb index abc1234..def5678 100644 --- a/spec/shoes/download_spec.rb +++ b/spec/shoes/download_spec.rb @@ -7,6 +7,11 @@ let(:args) { {:save => "nasa50th.gif"} } subject{ Shoes::Download.new app, name, args, &block } + after do + sleep 1 until subject.finished? + File.delete args[:save] + end + it "should have started? and finished? methods" do subject.should respond_to :started? subject.should respond_to :finished?
Clean up downloaded file after test
diff --git a/lib/miq_automation_engine/service_models/miq_ae_service_miq_request.rb b/lib/miq_automation_engine/service_models/miq_ae_service_miq_request.rb index abc1234..def5678 100644 --- a/lib/miq_automation_engine/service_models/miq_ae_service_miq_request.rb +++ b/lib/miq_automation_engine/service_models/miq_ae_service_miq_request.rb @@ -26,7 +26,7 @@ association :approvers def set_message(value) - object_send(:update_attributes, :message => value) + object_send(:update_attributes, :message => value.try!(:truncate, 255)) end def description=(new_description)
Fix validate_quota method to properly set the request.message for quota exceeded and modified tests to check request.message. https://bugzilla.redhat.com/show_bug.cgi?id=1333698 (transferred from ManageIQ/manageiq@df1a627d3529374ab053ab9bfa3cc50f05bbaf87)
diff --git a/boss.rb b/boss.rb index abc1234..def5678 100644 --- a/boss.rb +++ b/boss.rb @@ -16,9 +16,15 @@ config = repos[data['repository']['name']] Net::SSH.start(config['host'], config['user'], :keys => [config['key']]) do |ssh| if data['ref'] == 'refs/heads/master' and !data['forced'] and data['commits'].length > 0 - output = ssh.exec! "cd #{config['path']} && git pull origin master && bin/rake assets:precompile && unicornd upgrade" + output = ssh.exec! "cd #{config['path']} && git pull origin master && bin/rake assets:precompile" puts output - if output['Upgrade Complete'] then [200, 'Deploy completed.'] else [500, 'Deploy failed.'] end + if config['service'] == 'thin' + ssh.exec! "sudo service thin restart" + [200, 'Deploy completed.'] + else + output = ssh.exec! "unicornd upgrade" + if output['Upgrade Complete'] then [200, 'Deploy completed.'] else [500, 'Deploy failed.'] end + end else [422, 'Payload isn\'t for master or doesn\'t contain any commits.'] end
Add support for thin server
diff --git a/vin_query.gemspec b/vin_query.gemspec index abc1234..def5678 100644 --- a/vin_query.gemspec +++ b/vin_query.gemspec @@ -8,7 +8,7 @@ gem.summary = 'A ruby library for accessing vinquery.com' gem.description = 'A ruby library for fetching and parsing VIN information from vinquery.com, a vehicle identification number decoding service.' gem.homepage = 'https://github.com/jyunderwood/vin_query' - + gem.licenses = ['MIT'] gem.authors = ['Jonathan Underwood'] gem.email = ['jonathan@jyunderwood.com'] @@ -17,6 +17,8 @@ gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) gem.require_paths = ['lib'] + gem.required_ruby_version = '>= 2.0.0' + gem.add_dependency 'nokogiri', '> 1.5' gem.add_development_dependency 'rake'
Add license and required ruby version to gemspec
diff --git a/lib/engineyard-cloud-client/version.rb b/lib/engineyard-cloud-client/version.rb index abc1234..def5678 100644 --- a/lib/engineyard-cloud-client/version.rb +++ b/lib/engineyard-cloud-client/version.rb @@ -1,7 +1,7 @@ # This file is maintained by a herd of rabid monkeys with Rakes. module EY class CloudClient - VERSION = '2.1.1' + VERSION = '2.1.2-pre.1' end end # Please be aware that the monkeys like tho throw poo sometimes.
Add .pre for next release
diff --git a/rails_sortable.gemspec b/rails_sortable.gemspec index abc1234..def5678 100644 --- a/rails_sortable.gemspec +++ b/rails_sortable.gemspec @@ -24,4 +24,5 @@ s.add_development_dependency "sqlite3", "~> 1.4.0" s.add_development_dependency "rspec-rails", "~> 3.9.0" s.add_development_dependency "pry-rails", "~> 0.3.0" + s.add_development_dependency "puma", "~> 5.4.0" end
Add puma dependency for ruby-3.x
diff --git a/db/migrate/20141219034321_add_permalink_to_enterprises.rb b/db/migrate/20141219034321_add_permalink_to_enterprises.rb index abc1234..def5678 100644 --- a/db/migrate/20141219034321_add_permalink_to_enterprises.rb +++ b/db/migrate/20141219034321_add_permalink_to_enterprises.rb @@ -5,6 +5,7 @@ Enterprise.all.each do |enterprise| counter = 1 permalink = enterprise.name.parameterize + permalink = "my-enterprise-name" if permalink = "" while Enterprise.find_by_permalink(permalink) do permalink = enterprise.name.parameterize + counter.to_s counter += 1 @@ -17,6 +18,6 @@ end def down - add_column :enterprises, :permalink + remove_column :enterprises, :permalink end end
Fix permalink migration to handle blank auto-generated permalinks and fixed down migration
diff --git a/server.rb b/server.rb index abc1234..def5678 100644 --- a/server.rb +++ b/server.rb @@ -4,13 +4,10 @@ Dumbstore::App.register_all! # routes -get '/' do - erb :index -end - -get '/apps' do - erb :apps -end +get('/') { erb :index } +get('/apps') { @apps = Dumbstore::Text.apps.merge(Dumbstore::Voice.apps).values.uniq; erb :apps } +get('/about') { erb :about } +get('/documentation') { erb :documentation } post '/voice' do @params = params @@ -42,4 +39,4 @@ erb :text_error end end -end +end
Send apps hash to /apps view
diff --git a/app/controllers/admin/site_customization/pages_controller.rb b/app/controllers/admin/site_customization/pages_controller.rb index abc1234..def5678 100644 --- a/app/controllers/admin/site_customization/pages_controller.rb +++ b/app/controllers/admin/site_customization/pages_controller.rb @@ -35,7 +35,7 @@ private def page_params - attributes = [:slug, :more_info_flag, :print_content_flag, :status, :locale] + attributes = [:slug, :more_info_flag, :print_content_flag, :status] params.require(:site_customization_page).permit(*attributes, translation_params(SiteCustomization::Page)
Remove reference to site customization page locale We don't use that attribute since we added translations for this model.
diff --git a/lib/active_set/processors/filter/active_record_adapter.rb b/lib/active_set/processors/filter/active_record_adapter.rb index abc1234..def5678 100644 --- a/lib/active_set/processors/filter/active_record_adapter.rb +++ b/lib/active_set/processors/filter/active_record_adapter.rb @@ -11,9 +11,7 @@ return @set unless @set.respond_to? :to_sql return @set unless attribute_is_field? - @set.includes(@structure_path.to_h) - .references(@structure_path.to_h) - .where(arel_operation) + query end private @@ -22,6 +20,12 @@ return false unless attribute_model attribute_model.attribute_names .include?(@structure_path.attribute) + end + + def query + @set.includes(@structure_path.to_h) + .references(@structure_path.to_h) + .where(arel_operation) end def arel_operation
Move the main query logic for filtering with AR into a method
diff --git a/db/migrate/20130808142341_change_data_type_for_spree_stock_offers_merchant.rb b/db/migrate/20130808142341_change_data_type_for_spree_stock_offers_merchant.rb index abc1234..def5678 100644 --- a/db/migrate/20130808142341_change_data_type_for_spree_stock_offers_merchant.rb +++ b/db/migrate/20130808142341_change_data_type_for_spree_stock_offers_merchant.rb @@ -0,0 +1,14 @@+class ChangeDataTypeForSpreeStockOffersMerchant < ActiveRecord::Migration + def change + add_column :spree_stock_offers, :merchant_tmp, :boolean + + Spree::StockOffer.reset_column_information + Spree::StockOffer.find(:all).each do |t| + t.merchant_tmp = (t.merchant == '0' ? false : true) + t.save + end + + remove_column :spree_stock_offers, :merchant + rename_column :spree_stock_offers, :merchant_tmp, :merchant + end +end
Change :merchant field to boolean.
diff --git a/Formula/bartycrouch.rb b/Formula/bartycrouch.rb index abc1234..def5678 100644 --- a/Formula/bartycrouch.rb +++ b/Formula/bartycrouch.rb @@ -1,10 +1,10 @@ class Bartycrouch < Formula desc "Incrementally update/translate your Strings files" homepage "https://github.com/Flinesoft/BartyCrouch" - url "https://github.com/Flinesoft/BartyCrouch.git", :tag => "4.7.1", :revision => "c83fe72d329ffbe2afda6b980c62060699ef6bb7" + url "https://github.com/Flinesoft/BartyCrouch.git", :tag => "4.8.0", :revision => "e2cd0f35fb13b596196091a9ae8de67857e3479a" head "https://github.com/Flinesoft/BartyCrouch.git" - depends_on :xcode => ["12.0", :build] + depends_on :xcode => ["13.0", :build] def install system "make", "install", "prefix=#{prefix}"
Update formula to version 4.8.0
diff --git a/api/lib/tasks/heroku_scheduler.rake b/api/lib/tasks/heroku_scheduler.rake index abc1234..def5678 100644 --- a/api/lib/tasks/heroku_scheduler.rake +++ b/api/lib/tasks/heroku_scheduler.rake @@ -28,4 +28,9 @@ task queue_activate_clubs_job: :environment do ActivateClubsJob.perform_later end + + desc 'Schedule OpsAccountabilityJob' + task queue_ops_accountability_job: :environment do + OpsAccountabilityJob.perform_later + end end
Add OpsAccountabilityJob to Heroku scheduler Fix #138
diff --git a/db/migrate/20160503092026_move_user_status_to_circle_role.rb b/db/migrate/20160503092026_move_user_status_to_circle_role.rb index abc1234..def5678 100644 --- a/db/migrate/20160503092026_move_user_status_to_circle_role.rb +++ b/db/migrate/20160503092026_move_user_status_to_circle_role.rb @@ -1,12 +1,21 @@+class User < ActiveRecord::Base + enum status: %i(pending active blocked) +end + +class Circle::Role < ActiveRecord::Base + enum status: %i(pending active blocked) +end + class MoveUserStatusToCircleRole < ActiveRecord::Migration - - STATUS_MAP = %i(pending active blocked) def up add_column :circle_roles, :status, :integer User.find_each do |user| - status_id = STATUS_MAP.index(user.status) - user.circle_roles.each { |role| role.update_attribute(:status, status_id) } + if user.status + user.circle_roles.each { |role| role.update_attribute(:status, user.status) } + else + puts "User #{user.id} has status nil, not updating status on circle roles." + end end remove_column :users, :status end @@ -14,9 +23,14 @@ def down add_column :users, :status, :integer User.find_each do |user| - status_id = STATUS_MAP.index(:active) # hard fix - user.update_attribute(:status, status_id) + if user.circle_roles.present? + status = user.circle_roles.present? && user.circle_roles.all?(&:active?) ? :active : :pending + user.update_attribute(:status, status) + else + user.update_attribute(:status, nil) + end end remove_column :circle_roles, :status end + end
Fix user status migration (sorry …)
diff --git a/spec/fixtures/print_interpreter_spec.rb b/spec/fixtures/print_interpreter_spec.rb index abc1234..def5678 100644 --- a/spec/fixtures/print_interpreter_spec.rb +++ b/spec/fixtures/print_interpreter_spec.rb @@ -1,4 +1,4 @@ unless defined?(RSpec) puts ENV["RUBY_EXE"] - puts ruby_cmd("nil").split.first + puts ruby_cmd(nil).split.first end
Use ruby_cmd(nil) to get the interpreter + flags
diff --git a/lib/libraetd/app/controllers/version_controller.rb b/lib/libraetd/app/controllers/version_controller.rb index abc1234..def5678 100644 --- a/lib/libraetd/app/controllers/version_controller.rb +++ b/lib/libraetd/app/controllers/version_controller.rb @@ -5,10 +5,10 @@ # the response class VersionResponse - attr_accessor :version + attr_accessor :build - def initialize( version ) - @version = version + def initialize( build ) + @build = build end end
Update the version endpoint response to match what the standard tester expects
diff --git a/spec/unit/article_image_service_spec.rb b/spec/unit/article_image_service_spec.rb index abc1234..def5678 100644 --- a/spec/unit/article_image_service_spec.rb +++ b/spec/unit/article_image_service_spec.rb @@ -2,25 +2,11 @@ require_relative "../../lib/persistence/article_service" describe Persistence::ArticleService do - let(:storage) { - Fog.mock! - - fog = Fog::Storage.new( - :provider => "AWS", - :aws_access_key_id => "", - :aws_secret_access_key => "" - ) - - FOG.directories.create( - :key => "test", - :public => true - ) - } - + let(:storage) { TestFogBucket.new } let(:service) { Persistence::ArticleImageService.new(storage) } describe "#upload" do - it "uploads the file" do + it "uploads the file publically" do file = { :filename => "test.png", :tempfile => Tempfile.new("test.png") } id = "1" @@ -28,6 +14,33 @@ expect(storage.files.length).to eq(1) expect(storage.files.first.key).to eq("article1-test.png") + expect(storage.files.first.body).to eq(file[:tempfile]) + expect(storage.files.first.public).to eq(true) + end + end + + private + + class TestFogBucket + def initialize + @files = [] + end + + def files + self + end + + def create(file) + @files << OpenStruct.new(file) + OpenStruct.new(:public_url => "") + end + + def length + @files.length + end + + def first + @files.first end end end
Use fake fog for article image service spec
diff --git a/lib/openc_bot/templates/lib/company_fetcher_bot.rb b/lib/openc_bot/templates/lib/company_fetcher_bot.rb index abc1234..def5678 100644 --- a/lib/openc_bot/templates/lib/company_fetcher_bot.rb +++ b/lib/openc_bot/templates/lib/company_fetcher_bot.rb @@ -1,14 +1,54 @@ # encoding: UTF-8 -require 'company_fetcher_bot' +require 'openc_bot' +require 'openc_bot/company_fetcher_bot' # you may need to require other libraries here # # require 'nokogiri' # require 'openc_bot/helpers/dates' -# require 'openc_bot/helpers/incremental_search' module MyModule - extend CompanyFetcherBot + extend OpencBot + # This adds the CompanyFetcherBot functionality + extend OpencBot::CompanyFetcherBot + extend self # make these methods as Module methods, rather than instance ones + # If the register has a GET'able URL based on the company_number define it here. This should mean that + # #fetch_datum 'just works'. + def computed_registry_url(company_number) + # e.g. + # "http://some,register.com/path/to/#{company_number}" + end + + # This is the primary method for getting companies from the register. By default it uses the #fetch_data + # method defined in IncrementalSearch helper module, which increments through :company_number identifiers. + # See helpers/incremental_search.rb for details + # Override this if a different method for iterating companies is going to done (e.g. an alpha search, or + # parsing a CSV file) + def fetch_data + super + end + + # This is called by #update_datum (defined in the IncrementalSearch helper module), which updates the + # information for a given company_number. This allows the individual records to be updated, for example, + # via the 'Update from Register' button on the company page on OpenCorporates. This method is also called + # by the #fetch_data method in the case of incremental_searches. + # By default it calls #fetch_registry_page with the company_number and returns the result in a hash, + # with :company_page as a key. This will then be processed or parsed by the #process_datum method, + # and the result will be saved by #update_datum, and also returned in a form that can be used by the + # main OpenCorporates system + # This hash can contain other data, such as a page of filings or shareholdings, and the hash will be + # converted to json, and stored in the database in the row for that company number, under the :data key, + # so that it can be reused or referred it in the future. + # {:company_page => company_page_html, :filings_page => filings_page_html} + def fetch_datum(company_number) + super + end + + # This method must be defined for all bots that can fetch and process individual records, including + # incremental, and alpha searchers. Where the bot cannot do this (e.g. where the underlying data is + # only available as a CSV file, it can be left as a stub method) + def process_datum(datum_hash) + end end
Add documentation, stub methods to CompanyFetcherBot template
diff --git a/lib/sequel_mapper/queryable_lazy_dataset_loader.rb b/lib/sequel_mapper/queryable_lazy_dataset_loader.rb index abc1234..def5678 100644 --- a/lib/sequel_mapper/queryable_lazy_dataset_loader.rb +++ b/lib/sequel_mapper/queryable_lazy_dataset_loader.rb @@ -1,31 +1,33 @@ require "forwardable" -class QueryableLazyDatasetLoader - extend Forwardable - include Enumerable +module SequelMapper + class QueryableLazyDatasetLoader + extend Forwardable + include Enumerable - def initialize(database_enum, loader, association_mapper = :mapper_not_provided) - @database_enum = database_enum - @loader = loader - @association_mapper = association_mapper - end + def initialize(database_enum, loader, association_mapper = :mapper_not_provided) + @database_enum = database_enum + @loader = loader + @association_mapper = association_mapper + end - attr_reader :database_enum, :loader - private :database_enum, :loader + attr_reader :database_enum, :loader + private :database_enum, :loader - def_delegators :database_enum, :where + def_delegators :database_enum, :where - def eager_load(association_name) - @association_mapper.eager_load_association(database_enum, association_name) - end + def eager_load(association_name) + @association_mapper.eager_load_association(database_enum, association_name) + end - def where(criteria) - self.class.new(database_enum.where(criteria), loader) - end + def where(criteria) + self.class.new(database_enum.where(criteria), loader) + end - def each(&block) - database_enum - .map(&loader) - .each(&block) + def each(&block) + database_enum + .map(&loader) + .each(&block) + end end end
Put QuerableLazyDatasetLoader in namespace module
diff --git a/rack-unreloader.gemspec b/rack-unreloader.gemspec index abc1234..def5678 100644 --- a/rack-unreloader.gemspec +++ b/rack-unreloader.gemspec @@ -15,4 +15,6 @@ Rack::Unreloader is a rack middleware that reloads application files when it detects changes, unloading constants defined in those files before reloading. END + s.add_development_dependency "minitest", '>=5.6.1' + s.add_development_dependency "minitest-hooks" end
Add development dependency on minitest-hooks and minitest