diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/app/decorators/tenant_decorator.rb b/app/decorators/tenant_decorator.rb index abc1234..def5678 100644 --- a/app/decorators/tenant_decorator.rb +++ b/app/decorators/tenant_decorator.rb @@ -1,5 +1,9 @@ class TenantDecorator < Draper::Decorator delegate_all + + def link + h.link_to object.name, object + end def title object.logo.exists? ? h.image_tag(object.logo.url(:navbar)) : object.name
Add method that was accidently removed
diff --git a/TodUni/db/migrate/20160531212401_rename_stages_to_phases.rb b/TodUni/db/migrate/20160531212401_rename_stages_to_phases.rb index abc1234..def5678 100644 --- a/TodUni/db/migrate/20160531212401_rename_stages_to_phases.rb +++ b/TodUni/db/migrate/20160531212401_rename_stages_to_phases.rb @@ -0,0 +1,10 @@+class RenameStagesToPhases < ActiveRecord::Migration + def change + rename_table :stages, :phases + change_table :phases do |t| + t.rename :stage_num, :phase_number + t.rename :due_date, :date_end + t.date :date_beginning + end + end +end
Rename table stages to phases, rename column stage_num to phase_number and due_date to date_end, add column date_beginning
diff --git a/app/models/chargify_transaction.rb b/app/models/chargify_transaction.rb index abc1234..def5678 100644 --- a/app/models/chargify_transaction.rb +++ b/app/models/chargify_transaction.rb @@ -6,7 +6,45 @@ validates_presence_of :chargify_subscription_id + after_create :create_shop_order + def memo self.data ? self.data['memo'] : nil end + + def create_shop_order + if self.charge_type == 'Payment' && self.success + adr = { + :first_name => self.chargify_subscription.billing_first_name, + :last_name => self.chargify_subscription.billing_last_name, + :address => self.chargify_subscription.billing_address, + :city => self.chargify_subscription.billing_city, + :state => self.chargify_subscription.billing_state, + :zip => self.chargify_subscription.billing_zip, + :country => self.chargify_subscription.billing_country + } + + order = Shop::ShopOrder.create( + :end_user_id => self.chargify_subscription.end_user_id, + :name => self.chargify_subscription.end_user.name, + :ordered_at => self.created_at, + :currency => 'USD', + :state => 'success', + :subtotal => self.amount, + :total => self.amount, + :tax => 0.0, + :shipping => 0.0, + :shipping_address => adr, + :billing_address => adr) + order.update_attribute(:state,'paid') + + order.order_items.create(:item_name => self.chargify_subscription.chargify_plan.name, + :order_item => self.chargify_subscription.chargify_plan, + :currency => 'USD', + :unit_price => self.amount, + :quantity => 1, + :subtotal => self.amount) + order + end + end end
Create shop orders for payments.
diff --git a/app/models/sms/adapters/factory.rb b/app/models/sms/adapters/factory.rb index abc1234..def5678 100644 --- a/app/models/sms/adapters/factory.rb +++ b/app/models/sms/adapters/factory.rb @@ -19,7 +19,6 @@ # creates an instance of the specified adapter def create(name_or_class, config:) return nil if name_or_class.nil? - config ||= configatron if name_or_class.is_a?(String) unless self.class.name_is_valid?(name_or_class) raise ArgumentError, "invalid adapter name '#{name_or_class}'"
10398: Remove leftover confgatron in sms adapters
diff --git a/app/resources/api/user_resource.rb b/app/resources/api/user_resource.rb index abc1234..def5678 100644 --- a/app/resources/api/user_resource.rb +++ b/app/resources/api/user_resource.rb @@ -3,7 +3,7 @@ class UserResource < JSONAPI::Resource include Pundit::Resource - attributes :name, :email + attributes :name, :email, :password, :password_confirmation has_many :decks has_many :contributions
Add password attributes to User resource
diff --git a/app.rb b/app.rb index abc1234..def5678 100644 --- a/app.rb +++ b/app.rb @@ -20,7 +20,8 @@ set :username, config['username'] set :password, config['password'] - set :redis, Redis.new(:host => config['redis_host'], :port => config['redis_port'], :db => config['redis_db']) + uri = URI.parse(ENV["REDISCLOUD_URL"]) + set :redis, Redis.new(:host => uri.host, :port => uri.port, :password => uri.password) end
Use env var to get redis cloud config
diff --git a/spec/controllers/application_controller/advanced_search_spec.rb b/spec/controllers/application_controller/advanced_search_spec.rb index abc1234..def5678 100644 --- a/spec/controllers/application_controller/advanced_search_spec.rb +++ b/spec/controllers/application_controller/advanced_search_spec.rb @@ -0,0 +1,19 @@+describe ProviderForemanController, "::AdvancedSearch" do + before :each do + stub_user(:features => :all) + controller.instance_variable_set(:@sb, {}) + end + + describe "#adv_search_redraw_left_div" do + before :each do + controller.instance_variable_set(:@sb, :active_tree => :configuration_manager_cs_filter_tree) + end + + it "calls build_configuration_manager_cs_filter_tree method in Config Mgmt Configured Systems when saving a filter" do + allow(controller).to receive(:adv_search_redraw_listnav_and_main) + + expect(controller).to receive(:build_configuration_manager_cs_filter_tree).once + controller.send(:adv_search_redraw_left_div) + end + end +end
Add spec test for build_configuration_manager_cs_filter_tree Add a spec test for build_configuration_manager_cs_filter_tree method which should be called when saving a filter in Configuration -> Management -> Configured Systems accordion.
diff --git a/spec/factories/course_assessment_answer_multiple_responses.rb b/spec/factories/course_assessment_answer_multiple_responses.rb index abc1234..def5678 100644 --- a/spec/factories/course_assessment_answer_multiple_responses.rb +++ b/spec/factories/course_assessment_answer_multiple_responses.rb @@ -5,5 +5,17 @@ question do build(:course_assessment_question_multiple_response, assessment: assessment).question end + + trait :wrong do + after(:build) do |answer| + answer.options = answer.question.options - answer.question.options.correct + end + end + + trait :correct do + after(:build) do |answer| + answer.options = answer.question.options.correct + end + end end end
Add correct and wrong traits to MRQ answers.
diff --git a/app/controllers/questions.rb b/app/controllers/questions.rb index abc1234..def5678 100644 --- a/app/controllers/questions.rb +++ b/app/controllers/questions.rb @@ -1,6 +1,7 @@ get '/questions' do #list all - @posts = Post.all + @questions = Question.all erb :questions_show + erb :index end get '/questions/new' do #get create form (must precede the /:id route which will catch all) @@ -13,9 +14,9 @@ end post '/questions' do #post create form to perform create - @question=Question.create( - title = params[:title] - text = params[:text] + @question = Question.create( + title = params[:title], + text = params[:text], user_id = 3 #need current user from session ) redirect "/questions/:#{@question.id}"
Edit question controller variable names
diff --git a/test/slim_spec.rb b/test/slim_spec.rb index abc1234..def5678 100644 --- a/test/slim_spec.rb +++ b/test/slim_spec.rb @@ -6,22 +6,23 @@ describe 'Slim hack' do it 'adds @dataRole alias' do - Slim::Template.new { '.name@nameField' }.render.should == - '<div class="name" data-role="nameField"></div>' + expect(Slim::Template.new { '.name@nameField' }.render).to eq( + '<div class="name" data-role="nameField"></div>') end it 'supports multiple roles' do - Slim::Template.new { '@a@b' }.render.should == '<div data-role="a b"></div>' + expect(Slim::Template.new { '@a@b' }.render).to eq( + '<div data-role="a b"></div>') end it 'adds @@dataBlock alias' do - Slim::Template.new { '.name@@control' }.render.should == - '<div class="name" data-block="control"></div>' + expect(Slim::Template.new { '.name@@control' }.render).to eq( + '<div class="name" data-block="control"></div>') end it 'supports multiple bloks' do - Slim::Template.new { '@@a@@b' }.render.should == - '<div data-block="a b"></div>' + expect(Slim::Template.new { '@@a@@b' }.render).to eq( + '<div data-block="a b"></div>') end end
Use expect syntax in RSpec
diff --git a/lib/rom/yesql/relation/class_interface.rb b/lib/rom/yesql/relation/class_interface.rb index abc1234..def5678 100644 --- a/lib/rom/yesql/relation/class_interface.rb +++ b/lib/rom/yesql/relation/class_interface.rb @@ -14,10 +14,9 @@ # # @api public def dataset(name = Undefined) - return @dataset if name == Undefined - @dataset = name + name = relation_name.to_sym if name == Undefined define_query_methods(self, Relation.queries[name] || {}) - @dataset + ->(*) { self } end end end
Revise dataset to define query and return self Dataset needs to return the relation under Rom 5
diff --git a/HSGoogleDrivePicker.podspec b/HSGoogleDrivePicker.podspec index abc1234..def5678 100644 --- a/HSGoogleDrivePicker.podspec +++ b/HSGoogleDrivePicker.podspec @@ -19,7 +19,7 @@ s.requires_arc = true s.dependency 'AsyncImageView' - s.dependency 'GoogleAPIClient/Drive' + s.dependency 'Google-API-Client/Drive' s.dependency 'SVPullToRefresh' end
Revert "Set new GoogleApiClient podname"
diff --git a/examples/fiber-sieve.rb b/examples/fiber-sieve.rb index abc1234..def5678 100644 --- a/examples/fiber-sieve.rb +++ b/examples/fiber-sieve.rb @@ -0,0 +1,31 @@+ +require 'fiber' + +PRINTER = Fiber.new do |i| + while true + puts i + i = Fiber.yield + end +end + +def worker + Fiber.new do |prime| + PRINTER.resume(prime) + + w = worker + + while true + i = Fiber.yield + + if i % prime != 0 + w.resume(i) + end + end + end +end + +WORKER = worker + +(2..2000).each do |i| + WORKER.resume(i) +end
Add a Sieve example using plain fibers
diff --git a/lib/after_do/logging/aspect.rb b/lib/after_do/logging/aspect.rb index abc1234..def5678 100644 --- a/lib/after_do/logging/aspect.rb +++ b/lib/after_do/logging/aspect.rb @@ -7,18 +7,18 @@ end def log_start(target_method) - target_class.before target_method do |*args, _| + target_class.before target_method do |*args, object| method = "#{target_class}##{target_method}" - log_step('Started', method, args) + log_step('Started', object, method, args) end end def log_finish(target_method) - target_class.after target_method do |*args, _| + target_class.after target_method do |*args, object| method = "#{target_class}##{target_method}" - log_step('Finished', method, args) + log_step('Finished', object, method, args) end end @@ -28,10 +28,14 @@ private - def log_step(prefix, method, args) + def log_step(prefix, object, method, args) arg_text = args.map(&:inspect).join(', ') - msg = "#{prefix}: #{method}(#{arg_text})" + msg = "#{prefix}#{id(object)}: #{method}(#{arg_text})" logger.info(msg) + end + + def id(object) + "[#{id}]" if object.respond_to?(:id) end end end
Include id on log message
diff --git a/lib/generators/rails_settings/templates/create_settings.rb b/lib/generators/rails_settings/templates/create_settings.rb index abc1234..def5678 100644 --- a/lib/generators/rails_settings/templates/create_settings.rb +++ b/lib/generators/rails_settings/templates/create_settings.rb @@ -1,4 +1,4 @@-class CreateRailsSettingsTables < ActiveRecord::Migration +class CreateSettings < ActiveRecord::Migration def self.up create_table :settings, :force => true do |t| t.string :var, :null => false
Fix naming of create settings migration.
diff --git a/lib/generators/spree_shipwire/install/install_generator.rb b/lib/generators/spree_shipwire/install/install_generator.rb index abc1234..def5678 100644 --- a/lib/generators/spree_shipwire/install/install_generator.rb +++ b/lib/generators/spree_shipwire/install/install_generator.rb @@ -1,6 +1,7 @@ module SpreeShipwire module Generators class InstallGenerator < Rails::Generators::Base + source_root File.expand_path("../templates", __FILE__) class_option :auto_run_migrations, type: :boolean, default: false
Add source_route for install generator
diff --git a/lib/gitlab/importers/common_metrics/prometheus_metric_enums.rb b/lib/gitlab/importers/common_metrics/prometheus_metric_enums.rb index abc1234..def5678 100644 --- a/lib/gitlab/importers/common_metrics/prometheus_metric_enums.rb +++ b/lib/gitlab/importers/common_metrics/prometheus_metric_enums.rb @@ -38,5 +38,3 @@ end end end - -::Gitlab::Importers::CommonMetrics::PrometheusMetricEnums.prepend EE::Gitlab::Importers::CommonMetrics::PrometheusMetricEnums
Remove prepending of EE module
diff --git a/features/support/vcr.rb b/features/support/vcr.rb index abc1234..def5678 100644 --- a/features/support/vcr.rb +++ b/features/support/vcr.rb @@ -1,4 +1,5 @@ require 'vcr' +require 'dotenv/load' VCR.configure do |c| c.cassette_library_dir = 'features/cassettes' @@ -30,3 +31,6 @@ c.filter_sensitive_data('<API_KEY>') { ENV['ALGOLIA_API_KEY'] } c.filter_sensitive_data('<APP_ID>') { ENV['ALGOLIA_APP_ID'] } end + +Algolia.init application_id: ENV['ALGOLIA_APP_ID'], + api_key: ENV['ALGOLIA_API_KEY']
Add Algolia init ENV vars for specs - In case a cassette needs to be re-recorded the keys are needed. It is not immediately clear in dev why the spec is returning 403 while the keys are correct in .env
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 @@ -15,7 +15,7 @@ # ActionMailer::Base.default_url_options[:protocol] = 'https' ActionMailer::Base.default_url_options[:host] = - YAML.load_file(File.join(Rails.root, "config/gitorious.yml"))["gitorious_host"] + YAML.load_file(File.join(RAILS_ROOT, "config/gitorious.yml"))[RAILS_ENV]["gitorious_host"] config.action_mailer.raise_delivery_errors = false config.action_mailer.delivery_method = :test ExceptionNotifier.exception_recipients = YAML.load_file(File.join(RAILS_ROOT,
Include the RAILS_ENV when setting the :host url for actionmailer
diff --git a/test/integration/helpers/serverspec/shared_serverspec/server_ports.rb b/test/integration/helpers/serverspec/shared_serverspec/server_ports.rb index abc1234..def5678 100644 --- a/test/integration/helpers/serverspec/shared_serverspec/server_ports.rb +++ b/test/integration/helpers/serverspec/shared_serverspec/server_ports.rb @@ -1,6 +1,26 @@ shared_examples "server_ports" do - describe "NFS Server Ports" do - describe port(32678) do + context "Portmap daemon" do + describe port(111) do + it { should be_listening.with('tcp') } + it { should be_listening.with('udp') } + end + end + + context "Stat daemon" do + describe port(32765) do + it { should be_listening.with('tcp') } + end + end + + context "Mount daemon" do + describe port(32767) do + it { should be_listening.with('tcp') } + it { should be_listening.with('udp') } + end + end + + context "Lock daemon" do + describe port(32768) do it { should be_listening.with('tcp') } it { should be_listening.with('udp') } end
Add more port checks, and fix a typo in lock daemon check
diff --git a/spec/build_process_spec.rb b/spec/build_process_spec.rb index abc1234..def5678 100644 --- a/spec/build_process_spec.rb +++ b/spec/build_process_spec.rb @@ -28,4 +28,21 @@ build[:output].chomp.should == "test build succeeded" end + it "Should catch failed builds" do + watcher = Juici::Watcher.instance.start + build = Juici::Build.new(parent: "test project", + environment: {}, + command: "lol command not found") + $build_queue << build + + # Wait a reasonable time for build to finish + # TODO: This can leverage the hooks system + # TODO: Easer will be to have worker.block or something + sleep 2 + + build.reload + build[:status].should == :failed + build[:output].chomp.should == "" + end + end
Add spec for failed builds
diff --git a/spec/factories/patterns.rb b/spec/factories/patterns.rb index abc1234..def5678 100644 --- a/spec/factories/patterns.rb +++ b/spec/factories/patterns.rb @@ -20,13 +20,13 @@ revision 'master' trait :platform do - name 'sample_platform_pattern' + sequence(:name) { |n| "platform_pattern-#{n}" } url 'https://example.com/cloudconductor-dev/sample_platform_pattern.git' type :platform end trait :optional do - name 'sample_optional_pattern' + sequence(:name) { |n| "optional_pattern-#{n}" } url 'https://example.com/cloudconductor-dev/sample_optional_pattern.git' type :optional end
Add sequence number on name of Pattern to avoid duplicated name
diff --git a/api/lib/spree/api/engine.rb b/api/lib/spree/api/engine.rb index abc1234..def5678 100644 --- a/api/lib/spree/api/engine.rb +++ b/api/lib/spree/api/engine.rb @@ -12,7 +12,7 @@ end config.view_versions = [1] - config.view_version_extraction_strategy = :http_parameter + config.view_version_extraction_strategy = :http_header initializer "spree.api.environment", :before => :load_config_initializers do |app| Spree::Api::Config = Spree::ApiConfiguration.new
[api] Fix view_version_extraction_strategy for versioncake config
diff --git a/app/helpers/icons_helper.rb b/app/helpers/icons_helper.rb index abc1234..def5678 100644 --- a/app/helpers/icons_helper.rb +++ b/app/helpers/icons_helper.rb @@ -1,7 +1,7 @@ module IconsHelper def boolean_to_icon(value) if value.to_s == "true" - content_tag :i, nil, class: 'icon-ok cgreen' + content_tag :i, nil, class: 'icon-circle cgreen' else content_tag :i, nil, class: 'icon-off clgray' end
Replace ok with circle for boolean icon Signed-off-by: Dmitriy Zaporozhets <be23d75b156792e5acab51b196a2deb155d35d6a@gmail.com>
diff --git a/app/mailers/error_mailer.rb b/app/mailers/error_mailer.rb index abc1234..def5678 100644 --- a/app/mailers/error_mailer.rb +++ b/app/mailers/error_mailer.rb @@ -4,7 +4,7 @@ @target_emails = ENV['ERROR_MAILER_LIST'].split(',') @subject = "ERROR: Student Insights ErrorMailer" @error_message = error.message - @error_backtrace = error.backtrace + @error_backtrace = error.backtrace || [] @extra_info = extra_info mail(
Update ErrorMailer to except unraised exceptions
diff --git a/app/mailers/event_mailer.rb b/app/mailers/event_mailer.rb index abc1234..def5678 100644 --- a/app/mailers/event_mailer.rb +++ b/app/mailers/event_mailer.rb @@ -1,7 +1,8 @@ class EventMailer < ApplicationMailer def event_info(to, email) @email = email - mail(to: to, + mail(from: @email.user.email, + to: to, subject: @email[:subject]) end end
Set the From in the event mailer to the user sending the mail
diff --git a/lib/heaven/provider/ansible.rb b/lib/heaven/provider/ansible.rb index abc1234..def5678 100644 --- a/lib/heaven/provider/ansible.rb +++ b/lib/heaven/provider/ansible.rb @@ -34,7 +34,7 @@ ].join(" ") deploy_string = ["ansible-playbook", "-i", ansible_hosts_file, ansible_site_file, - "--verbose", "--extra-vars", "'#{ansible_extra_vars}'", "-vvvv"] + "--verbose", "--extra-vars", ansible_extra_vars, "-vvvv"] log "Executing ansible: #{deploy_string.join(" ")}" execute_and_log(deploy_string, { "ANSIBLE_HOST_KEY_CHECKING" => 'false' }) end
Remove single quote in extra vars.
diff --git a/app/overrides/ean_fields.rb b/app/overrides/ean_fields.rb index abc1234..def5678 100644 --- a/app/overrides/ean_fields.rb +++ b/app/overrides/ean_fields.rb @@ -1,18 +1,14 @@-if Spree::Variant.first and Spree::Variant.first.respond_to? :ean - Spree::Product.class_eval do - attr_accessible :ean - end - Spree::Variant.class_eval do - attr_accessible :ean - end - Deface::Override.new(:virtual_path => "spree/admin/products/_form", - :name => "Add ean to product form", - :insert_after => "code[erb-silent]:contains('has_variants')", - :text => "<% unless @product.has_variants? %> <p> - <%= f.label :ean, t(:ean) %><br> - <%= f.text_field :ean, :size => 16 %> - </p> <%end%>", - :disabled => false) -else - puts "POS: EAN support disabled, run migration to activate" +Spree::Product.class_eval do +attr_accessible :ean end +Spree::Variant.class_eval do +attr_accessible :ean +end +Deface::Override.new(:virtual_path => "spree/admin/products/_form", + :name => "Add ean to product form", + :insert_after => "code[erb-silent]:contains('has_variants')", + :text => "<% unless @product.has_variants? %> <p> + <%= f.label :ean, t(:ean) %><br> + <%= f.text_field :ean, :size => 16 %> + </p> <%end%>", + :disabled => false)
Delete option to activate ean fields because it was causing problems
diff --git a/lib/jimsy/git/clone_service.rb b/lib/jimsy/git/clone_service.rb index abc1234..def5678 100644 --- a/lib/jimsy/git/clone_service.rb +++ b/lib/jimsy/git/clone_service.rb @@ -3,7 +3,7 @@ module Jimsy class Git class CloneService - SAFE_HOSTS = %w[github.com bitbucket.org].freeze + SAFE_HOSTS = %w[github.com bitbucket.org gitlab.com].freeze def initialize(uri, code_dir) @raw_uri = uri @@ -23,12 +23,16 @@ end def target_path - @target_path ||= File.join(code_dir, uri.host, uri_dir, uri_repo) + @target_path ||= File.join(code_dir, host_dir, project_dir) end private attr_reader :raw_uri, :code_dir + + def host_dir + uri.host.to_s.downcase + end def uri return @parsed_uri if @parsed_uri @@ -44,12 +48,12 @@ raw_uri =~ /^git@/ end - def uri_dir - File.dirname(uri.path) - end - - def uri_repo - File.basename(uri.path, ".git") + def project_dir + File.join(Pathname.new(uri.path).each_filename.map do |component| + component = component.downcase + component = component[0..-5] if component.end_with?(".git") + component + end) end end end
Handle arbitrarily nested project dirs.
diff --git a/core/env/element_reference_spec.rb b/core/env/element_reference_spec.rb index abc1234..def5678 100644 --- a/core/env/element_reference_spec.rb +++ b/core/env/element_reference_spec.rb @@ -15,10 +15,18 @@ it "returns nil if the variable isn't found" do ENV["this_var_is_never_set"].should == nil end + + it "returns only frozen values" do + ENV[@variable_name].frozen?.should == true + ENV["returns_only_frozen_values"] = "a non-frozen string" + ENV["returns_only_frozen_values"].frozen?.should == true + end ruby_version_is "1.9" do it "uses the locale encoding" do ENV[@variable_name].encoding.should == Encoding.find('locale') + ENV["uses_the_locale_encoding"] = "a binary string".force_encoding('binary') + ENV["uses_the_locale_encoding"].encoding.should == Encoding.find('locale') end end end
Add specs for ENV always producing frozen strings in locale encoding, regardless of incoming.
diff --git a/lib/json_test_data/data_structures/number.rb b/lib/json_test_data/data_structures/number.rb index abc1234..def5678 100644 --- a/lib/json_test_data/data_structures/number.rb +++ b/lib/json_test_data/data_structures/number.rb @@ -6,12 +6,13 @@ class << self def create(schema) - factor, minimum, maximum = schema.fetch(:multipleOf, nil), schema.fetch(:minimum, -infinity), schema.fetch(:maximum, infinity) + factor = schema.fetch(:multipleOf, nil) + minimum, maximum = schema.fetch(:minimum, -infinity), schema.fetch(:maximum, infinity) num = factor || 1 step_size = schema.fetch(:type) == "integer" ? 1 : 0.5 - adjust_for_maximum(number: num, maximum: maximum, step_size: factor || step_size) + num = adjust_for_maximum(number: num, maximum: maximum, step_size: factor || step_size) adjust_for_minimum(number: num, minimum: minimum, step_size: factor || step_size) end end
Fix issue with adjustments for maximum and minimum
diff --git a/cookbooks/install-editors/recipes/install-monodevelop.rb b/cookbooks/install-editors/recipes/install-monodevelop.rb index abc1234..def5678 100644 --- a/cookbooks/install-editors/recipes/install-monodevelop.rb +++ b/cookbooks/install-editors/recipes/install-monodevelop.rb @@ -1,4 +1,11 @@+bash "add mono develop apt repository" do + code <<-EOF + sudo add-apt-repository ppa:keks9n/monodevelop-latest -y + sudo apt-get update + EOF +end + #Install monodevelop -package "monodevelop-current" do +package "monodevelop-latest" do action :install end
Install monodevelop using the ppa
diff --git a/lib/mongoid/relations/eager.rb b/lib/mongoid/relations/eager.rb index abc1234..def5678 100644 --- a/lib/mongoid/relations/eager.rb +++ b/lib/mongoid/relations/eager.rb @@ -23,11 +23,9 @@ def preload(relations, docs) grouped_relations = relations.group_by(&:inverse_class_name) - grouped_relations.keys.each do |klass| - grouped_relations[klass] = grouped_relations[klass].group_by(&:relation) - end - grouped_relations.each do |_klass, associations| - associations.each do |relation, association| + grouped_relations.values.each do |associations| + associations.group_by(&:relation) + .each do |relation, association| relation.eager_load_klass.new(association, docs).run end end
Remove double iteration on grouped relations
diff --git a/lib/omniauth/strategies/gds.rb b/lib/omniauth/strategies/gds.rb index abc1234..def5678 100644 --- a/lib/omniauth/strategies/gds.rb +++ b/lib/omniauth/strategies/gds.rb @@ -20,7 +20,7 @@ end def user - @user ||= MultiJson.decode(access_token.get('/user.json').body)['user'] + @user ||= MultiJson.decode(access_token.get("/user.json?client_id=#{CGI.escape(options.client_id)}").body)['user'] end end
Include client_id when requesting user details. To fix a token transfer issue. See https://github.com/alphagov/signonotron2/pull/245 for more details.
diff --git a/lib/rooftop/algolia_search/post_searching.rb b/lib/rooftop/algolia_search/post_searching.rb index abc1234..def5678 100644 --- a/lib/rooftop/algolia_search/post_searching.rb +++ b/lib/rooftop/algolia_search/post_searching.rb @@ -9,9 +9,15 @@ module ClassMethods - def search(query, opts = {}) + def search(query, opts = {}, index_name=nil) opts = opts.with_indifferent_access - search_index.search(query, opts).with_indifferent_access + if index_name + index = replica_indexes.find {|i| i.name == index_name} + raise ArgumentError, "Unknown search index name: #{index_name}" if index.nil? + else + index = search_index + end + index.search(query, opts).with_indifferent_access end end
Add ability to search by a specific index name, by passing into search() as the third arg.
diff --git a/lib/quality/tools/punchlist.rb b/lib/quality/tools/punchlist.rb index abc1234..def5678 100644 --- a/lib/quality/tools/punchlist.rb +++ b/lib/quality/tools/punchlist.rb @@ -6,7 +6,7 @@ def punchlist_args glob = "--glob '#{source_files_glob}'" - regexp = "--regexp '#{punchlist_regexp}'" if punchlist_regexp + regexp = " --regexp '#{punchlist_regexp}'" if punchlist_regexp args = glob args += regexp if regexp
Fix issue with argument separation
diff --git a/lib/tasks/fetch_and_email.rake b/lib/tasks/fetch_and_email.rake index abc1234..def5678 100644 --- a/lib/tasks/fetch_and_email.rake +++ b/lib/tasks/fetch_and_email.rake @@ -18,6 +18,12 @@ end end - task fetch_and_email: [:fetch, :email] do + desc "Reset records" + task reset: :environment do + GithubUser.update_all has_new_comments: false + Gist.update_all new_comments: 0 + end + + task fetch_and_email: [:reset, :fetch, :email] do end end
Add rake task for resetting records
diff --git a/app/models/issue_tracker.rb b/app/models/issue_tracker.rb index abc1234..def5678 100644 --- a/app/models/issue_tracker.rb +++ b/app/models/issue_tracker.rb @@ -13,6 +13,7 @@ @tracker ||= begin klass = ErrbitPlugin::Registry.issue_trackers[self.type_tracker] || ErrbitPlugin::NoneIssueTracker + # TODO: we need to find out a better way to pass those config to the issue tracker klass.new(options.merge(github_repo: app.github_repo, bitbucket_repo: app.bitbucket_repo)) end end
Add TODO to issue tracker
diff --git a/app/models/listing_image.rb b/app/models/listing_image.rb index abc1234..def5678 100644 --- a/app/models/listing_image.rb +++ b/app/models/listing_image.rb @@ -4,7 +4,8 @@ has_attached_file :image, :storage => :s3, :s3_credentials => "#{Rails.root}/config/s3.yml", - :path => ":id/:style/:filename" + :path => ":id/:style/:filename", + :s3_permissions => :public_read before_save :set_complete_image_url
Make S3 images readable by default
diff --git a/app/models/order_updater.rb b/app/models/order_updater.rb index abc1234..def5678 100644 --- a/app/models/order_updater.rb +++ b/app/models/order_updater.rb @@ -7,10 +7,12 @@ end def update + return unless params[:order].present? update_notes update_details update_tracking_details update_address + update_ship_to_name update_status end @@ -21,22 +23,27 @@ end def update_notes - return unless params[:order].present? && params[:order].include?(:notes) + return unless params[:order].include?(:notes) order.notes = params[:order][:notes] end def update_tracking_details - return unless params[:order].present? && params[:order][:tracking_details].present? + return unless params[:order][:tracking_details].present? order.add_tracking_details(params) end def update_address - return unless params[:order].present? && params[:order][:ship_to_address].present? + return unless params[:order][:ship_to_address].present? order.ship_to_address = params[:order][:ship_to_address] end + def update_ship_to_name + return unless params[:order][:ship_to_name].present? + order.ship_to_name = params[:order][:ship_to_name] + end + def update_status - return unless params[:order].present? && params[:order][:status].present? + return unless params[:order][:status].present? order.update_status(params[:order][:status], params) end end
Fix ship_to_name not being saved
diff --git a/app/models/multimodel_devise/concerns/token_authenticatable.rb b/app/models/multimodel_devise/concerns/token_authenticatable.rb index abc1234..def5678 100644 --- a/app/models/multimodel_devise/concerns/token_authenticatable.rb +++ b/app/models/multimodel_devise/concerns/token_authenticatable.rb @@ -12,7 +12,7 @@ if auth_token.blank? self.auth_token = ::MultimodelDevise::AuthToken.new( authentication_token: generate_authentication_token, - token_generated_at: DateTime.new, + token_generated_at: DateTime.now, token_authenticable: self ) end @@ -28,7 +28,7 @@ def update_auth_token self.auth_token.update_attributes( authentication_token: generate_authentication_token, - token_generated_at: DateTime.new + token_generated_at: DateTime.now ) end end
Fix typo: Should be DateTime.now instead of DateTime.new
diff --git a/db/migrate/20170322171523_add_owner_to_common_tasks.rb b/db/migrate/20170322171523_add_owner_to_common_tasks.rb index abc1234..def5678 100644 --- a/db/migrate/20170322171523_add_owner_to_common_tasks.rb +++ b/db/migrate/20170322171523_add_owner_to_common_tasks.rb @@ -1,5 +1,5 @@ class AddOwnerToCommonTasks < ActiveRecord::Migration def change - add_reference :common_tasks, :owner, index: true, foreign_key: true + add_reference :common_tasks, :owner, index: true, foreign_key: { to_table: :users } end end
Fix foreign key problem in postgresql Since the CommonTask#owner reference is actually referencing the users table then a :to_table option needs to be added to the foreign key attributed to keep it from trying to use a non-existant owners table rather than the appropriate users table.
diff --git a/app/controllers/refinery/products/admin/products_controller.rb b/app/controllers/refinery/products/admin/products_controller.rb index abc1234..def5678 100644 --- a/app/controllers/refinery/products/admin/products_controller.rb +++ b/app/controllers/refinery/products/admin/products_controller.rb @@ -43,7 +43,7 @@ end def check_category_ids - product_params[:category_ids] ||= [] + params[:product][:category_ids] ||= [] end end end
Fix the ability to remove all categories from a product
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 @@ -0,0 +1,8 @@+rails_root = ENV['RAILS_ROOT'] || File.dirname(__FILE__) + '/../..' +rails_env = ENV['RAILS_ENV'] || 'development' +config_file = File.join(rails_root, 'config', 'resque.yml') + +if File.exists?(config_file) + resque_config = YAML.load_file(config_file) + Resque.redis = resque_config[rails_env] +end
Add an initializer to allow custom Resque configs
diff --git a/Sage.podspec b/Sage.podspec index abc1234..def5678 100644 --- a/Sage.podspec +++ b/Sage.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "Sage" - s.version = "2.0.0" + s.version = "2.0.1" s.summary = "A cross-platform chess library for Swift." s.homepage = "https://github.com/nvzqz/#{s.name}" s.license = { :type => "Apache License, Version 2.0", :file => "LICENSE.txt" }
Update podspec for version 2.0.1
diff --git a/app/controllers/neighborly/balanced/bankaccount/payments_controller.rb b/app/controllers/neighborly/balanced/bankaccount/payments_controller.rb index abc1234..def5678 100644 --- a/app/controllers/neighborly/balanced/bankaccount/payments_controller.rb +++ b/app/controllers/neighborly/balanced/bankaccount/payments_controller.rb @@ -1,9 +1,5 @@ module Neighborly::Balanced::Bankaccount - class PaymentsController < ActionController::Base - def new - prepare_new_view - end - + class PaymentsController < AccountsController def create attach_bank_to_customer update_customer
Extend payments controller from accounts controller
diff --git a/em-jack.gemspec b/em-jack.gemspec index abc1234..def5678 100644 --- a/em-jack.gemspec +++ b/em-jack.gemspec @@ -18,7 +18,7 @@ s.add_dependency 'eventmachine', ['>= 0.12.10'] s.add_development_dependency 'bundler', ['~> 1.0.13'] - s.add_development_dependency 'rake', ['~> 0.8.7'] + s.add_development_dependency 'rake', ['>= 0.8.7'] s.add_development_dependency 'rspec', ['~> 2.6'] s.files = `git ls-files`.split("\n")
Make our Rake requirement more liberal
diff --git a/AMPopTip.podspec b/AMPopTip.podspec index abc1234..def5678 100644 --- a/AMPopTip.podspec +++ b/AMPopTip.podspec @@ -17,5 +17,6 @@ s.swift_version = '5.0' s.source_files = 'Source/*.swift' s.requires_arc = true + s.weak_framework = 'SwiftUI' s.social_media_url = 'https://twitter.com/theandreamazz' end
Add SwiftUI as weak_framework to podspec
diff --git a/Casks/prepros.rb b/Casks/prepros.rb index abc1234..def5678 100644 --- a/Casks/prepros.rb +++ b/Casks/prepros.rb @@ -4,17 +4,4 @@ version '4.0.1' sha256 '84510d1252274898b0fc4f95828b60e29a2c946a158bbf7d3188611c62dcd3b1' link 'Prepros.app' - after_install do - # re: https://github.com/phinze/homebrew-cask/issues/2859, - # /usr/bin/unzip loses executable bits in this archive for - # unknown reasons - system <<-EOBASH - /usr/bin/find '#{destination_path}' -type f -print0 | \ - /usr/bin/xargs -0 /usr/bin/file | \ - /usr/bin/egrep ' Mach-O (executable|dynamically)' | \ - /usr/bin/cut -f1 -d: | \ - /usr/bin/perl -pe 's{\\n}{\\000}' | \ - /usr/bin/xargs -0 /bin/chmod a+x - EOBASH - end end
Remove Prepos after_install permissions hack `/usr/bin/unzip` is no longer used. `ditto` correctly preserves these permissions.
diff --git a/Folklore.podspec b/Folklore.podspec index abc1234..def5678 100644 --- a/Folklore.podspec +++ b/Folklore.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'Folklore' - s.version = '0.2.1' + s.version = '0.2.2' s.license = 'MIT' s.summary = 'League of Legends chat service library for iOS and OS X.' s.homepage = 'https://github.com/jcouture/Folklore' @@ -8,11 +8,11 @@ s.source = { :git => 'https://github.com/jcouture/Folklore.git', :tag => s.version.to_s } s.source_files = 'Folklore' s.requires_arc = true - + s.xcconfig = { 'HEADER_SEARCH_PATHS' => '"$(SDKROOT)/usr/include/libxml2"' } - + s.osx.deployment_target = '10.7' s.ios.deployment_target = '6.0' - + s.dependency 'XMPPFramework', '~> 3.6.2' -end+end
Set the version number to 0.2.2.
diff --git a/db/migrate/20180822021048_create_active_encode_encode_records.rb b/db/migrate/20180822021048_create_active_encode_encode_records.rb index abc1234..def5678 100644 --- a/db/migrate/20180822021048_create_active_encode_encode_records.rb +++ b/db/migrate/20180822021048_create_active_encode_encode_records.rb @@ -1,4 +1,4 @@-class CreateActiveEncodeEncodeRecords < ActiveRecord::Migration[5.2] +class CreateActiveEncodeEncodeRecords < ActiveRecord::Migration[5.0] def change create_table :active_encode_encode_records do |t| t.string :global_id
Reduce migration version to accommodate rails 5.0+
diff --git a/VoucherifySwiftSdk.podspec b/VoucherifySwiftSdk.podspec index abc1234..def5678 100644 --- a/VoucherifySwiftSdk.podspec +++ b/VoucherifySwiftSdk.podspec @@ -22,7 +22,7 @@ s.source = { :git => 'https://github.com/voucherifyio/voucherify-ios-sdk.git', :tag => s.version.to_s } s.social_media_url = 'https://twitter.com/hashtag/voucherify' - s.ios.deployment_target = '8.0' + s.ios.deployment_target = '9.0' s.source_files = 'VoucherifySwiftSdk/Classes/**/*' s.dependency 'Alamofire', '~> 4.2'
Update deployment target from 8.0 to 9.0
diff --git a/plugins/commands/plugin/command/uninstall.rb b/plugins/commands/plugin/command/uninstall.rb index abc1234..def5678 100644 --- a/plugins/commands/plugin/command/uninstall.rb +++ b/plugins/commands/plugin/command/uninstall.rb @@ -16,8 +16,8 @@ return if !argv raise Vagrant::Errors::CLIInvalidUsage, :help => opts.help.chomp if argv.length < 1 - # Uninstall the gem - action(Action.action_uninstall, :plugin_name => argv[0]) + # Uninstall the gems + argv.each{ |gem| action(Action.action_uninstall, :plugin_name => gem) } # Success, exit status 0 0
Allow `vagrant (un)install plugin1 plugin2 plugin3`
diff --git a/db/migrate/20121030103500_add_skip_missing_email_alert_flag.rb b/db/migrate/20121030103500_add_skip_missing_email_alert_flag.rb index abc1234..def5678 100644 --- a/db/migrate/20121030103500_add_skip_missing_email_alert_flag.rb +++ b/db/migrate/20121030103500_add_skip_missing_email_alert_flag.rb @@ -0,0 +1,9 @@+class AddSkipMissingEmailAlertFlag < ActiveRecord::Migration + def self.up + add_column :operators, :skip_missing_email_alert, :boolean, :null => false, :default => false + end + + def self.down + remove_column :operators, :skip_missing_email_alert + end +end
Add boolean flag for skipping alerts about not having an email address for an operator - to be used when there genuinely isn't an email address to be found.
diff --git a/populus.gemspec b/populus.gemspec index abc1234..def5678 100644 --- a/populus.gemspec +++ b/populus.gemspec @@ -18,7 +18,7 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] - spec.add_dependency "specinfra" + spec.add_dependency "sshkit" spec.add_dependency "colorize" spec.add_dependency "slack-notifier"
Use sshkit rather than specinfra...
diff --git a/postpwn.gemspec b/postpwn.gemspec index abc1234..def5678 100644 --- a/postpwn.gemspec +++ b/postpwn.gemspec @@ -8,8 +8,8 @@ spec.version = Postpwn::VERSION spec.authors = ["TJ Stankus"] spec.email = ["tjstankus@gmail.com"] - spec.summary = %q{A writing tool.} - spec.description = %q{A writing and blogging tool.} + spec.summary = %q{An experimental writing tool.} + spec.description = %q{An experiment in writing, learning, and blogging.} spec.homepage = "" spec.license = "MIT"
Edit gemspec summary and description
diff --git a/app/controllers/neighborly/balanced/bankaccount/accounts_controller.rb b/app/controllers/neighborly/balanced/bankaccount/accounts_controller.rb index abc1234..def5678 100644 --- a/app/controllers/neighborly/balanced/bankaccount/accounts_controller.rb +++ b/app/controllers/neighborly/balanced/bankaccount/accounts_controller.rb @@ -19,7 +19,7 @@ unless customer_bank_accounts.any? { |c| c.id.eql? bank_account } unstore_all_bank_accounts # The reload here is needed because of Balanced conflit error - customer.reload.add_bank_account(resource_params.fetch(:use_bank)) + customer.reload.add_bank_account(bank_account) end end
Use bank_account variable on attach new bank account
diff --git a/react-native-google-analytics-bridge.podspec b/react-native-google-analytics-bridge.podspec index abc1234..def5678 100644 --- a/react-native-google-analytics-bridge.podspec +++ b/react-native-google-analytics-bridge.podspec @@ -0,0 +1,33 @@+require "json" + +package = JSON.parse(File.read(File.join(__dir__, "package.json"))) +ios_root = 'ios/RCTGoogleAnalyticsBridge' +galib_root = ios_root+'/google-analytics-lib' + +Pod::Spec.new do |s| + s.name = "react-native-google-analytics-bridge" + s.version = package["version"] + s.summary = package["description"] + s.author = "Idéhub AS" + + s.homepage = package["homepage"] + + s.license = package["license"] + s.platform = :ios, "7.0" + + s.source = { :git => "https://github.com/idehub/react-native-google-analytics-bridge", :tag => "#{s.version}" } + + s.dependency "React" + + s.frameworks = 'CoreData', 'SystemConfiguration' + s.libraries = 'z', 'sqlite3.0','GoogleAnalyticsServices','AdIdAccess' + + s.vendored_libraries = + galib_root+'/libGoogleAnalyticsServices.a', + galib_root+'/libAdIdAccess.a' + + s.source_files = + galib_root+'/*.{h}', + ios_root+'/RCTGoogleAnalyticsBridge/*.{h,m}' + +end
Add podspec so that the library can be installed as a pod
diff --git a/recipes/sysv.rb b/recipes/sysv.rb index abc1234..def5678 100644 --- a/recipes/sysv.rb +++ b/recipes/sysv.rb @@ -6,7 +6,7 @@ template '/etc/init.d/docker' do source "docker.sysv.erb" - mode '0644' + mode '0755' owner 'root' group 'root' not_if 'test -f /etc/init.d/docker'
Fix mode on docker SysV init script
diff --git a/app/controllers/admin/pages_controller.rb b/app/controllers/admin/pages_controller.rb index abc1234..def5678 100644 --- a/app/controllers/admin/pages_controller.rb +++ b/app/controllers/admin/pages_controller.rb @@ -1,7 +1,7 @@ # encoding: UTF-8 class Admin::PagesController < AdminController before_filter :find_page, :only => [:edit, :update, :destroy] - after_filter :expire_cache, :only => [:update] + after_filter :expire_cache, :only => [:create, :update] def index @pages = Page.all @@ -46,6 +46,7 @@ end def expire_cache + expire_fragment "fragments/layouts/friends_and_links" expire_action :controller => '/static', :action => :show, :id => @page end end
Expire footer cache when a static page is added
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 @@ -21,9 +21,7 @@ helper_method :current_user def require_staff - if current_user - redirect_to "/" unless current_user.staff? - end + redirect_to "/" unless current_user.staff? end def ssl_configured? @@ -31,7 +29,7 @@ end def is_staff? - current_user.staff? + current_user && current_user.staff? end def ensure_team
Fix in the right location
diff --git a/app/roles.rb b/app/roles.rb index abc1234..def5678 100644 --- a/app/roles.rb +++ b/app/roles.rb @@ -6,7 +6,7 @@ # Assuming case-sensitive, case-matched to Discord roles public_roles = [ 'Roleplayers', - 'Safarians' + 'Luchadors' ] command :role, description: "Add or remove a public role on yourself", usage: "role <rolename>\nAvailable roles:\n- #{public_roles.join("\n- ")}" do |event, *role_name|
Replace safarians with luchadors for HWCC
diff --git a/app/decorators/registry_item_decorator.rb b/app/decorators/registry_item_decorator.rb index abc1234..def5678 100644 --- a/app/decorators/registry_item_decorator.rb +++ b/app/decorators/registry_item_decorator.rb @@ -1,9 +1,5 @@ class RegistryItemDecorator < MiqDecorator - def self.fonticon - nil - end - - def fileicon - "100/#{image_name.downcase}.png" + def fonticon + image_name == 'registry_string_items' ? 'ff ff-file-txt-o' : 'ff ff-file-bin-o' end end
Use fonticons instead of fileicons in the RegistryItemDecorator
diff --git a/app/mailers/maintenance.rb b/app/mailers/maintenance.rb index abc1234..def5678 100644 --- a/app/mailers/maintenance.rb +++ b/app/mailers/maintenance.rb @@ -3,7 +3,7 @@ def account_removal_warning(user) @user = user - @login_url = new_user_session_path + @login_url = new_user_session_url @pod_url = AppConfig.environment.url @after_days = AppConfig.settings.maintenance.remove_old_users.after_days.to_s @remove_after = @user.remove_after
Use _url, not _path, in mailers
diff --git a/clock.rb b/clock.rb index abc1234..def5678 100644 --- a/clock.rb +++ b/clock.rb @@ -26,6 +26,17 @@ :"sample#active_xfer_count" => active_xfer_count) end + every(15.minutes, "run-scheduled-transfers") do + # This only really needs to run once an hour, but no harm comes + # from running it more frequently, so let's try several times an + # hour to avoid problems + schedule_time = Time.now + resolver = Transferatu::ScheduleResolver.new + processor = Transferatu::ScheduleProcessor.new(resolver) + manager = Transferatu::ScheduleManager.new(processor) + manager.run_schedules(scheduled_time) + end + every(4.hours, "mark-restart") do Transferatu::AppStatus.mark_update end
Add scheduled transfer creation to Clockwork
diff --git a/app/models/music_search.rb b/app/models/music_search.rb index abc1234..def5678 100644 --- a/app/models/music_search.rb +++ b/app/models/music_search.rb @@ -6,6 +6,12 @@ belongs_to :result, polymorphic: true def self.search(query) - super.preload(:result).map(&:result) + Rails.cache.fetch([cache_key, query]) do + super.preload(:result).map(&:result) + end + end + + def self.cache_key + ['MusicSearch', Album.maximum(:updated_at).to_i, Artist.maximum(:updated_at).to_i, Song.maximum(:updated_at).to_i].join('/') end end
Add basic caching to results
diff --git a/app/models/user_session.rb b/app/models/user_session.rb index abc1234..def5678 100644 --- a/app/models/user_session.rb +++ b/app/models/user_session.rb @@ -1,13 +1,13 @@ class UserSession < Authlogic::Session::Base - pds_url Settings.login.pds_url - calling_system Settings.login.calling_system + pds_url (ENV['PDS_URL'] || 'https://login.library.nyu.edu') + calling_system 'marli' anonymous true - redirect_logout_url Settings.login.redirect_logout_url - + redirect_logout_url 'http://bobcat.library.nyu.edu' + def additional_attributes h = {} return h unless pds_user - h[:marli_admin] = true if Settings.login.default_admins.include? pds_user.uid + h[:marli_admin] = true if default_admins.include? pds_user.uid patron = Exlibris::Aleph::Patron.new(patron_id: pds_user.nyuidn) addr_info = patron.address h[:address] = {} @@ -17,5 +17,9 @@ h[:address][:postal_code] = addr_info["z304_zip"]["__content__"] return h end - -end+ + private + def default_admins + (Figs.env['MARLI_DEFAULT_ADMINS'] || []) + end +end
Use the Figs environment variables for the default admins and the AuthPds settings
diff --git a/spec/bipbip/plugin/command_status_spec.rb b/spec/bipbip/plugin/command_status_spec.rb index abc1234..def5678 100644 --- a/spec/bipbip/plugin/command_status_spec.rb +++ b/spec/bipbip/plugin/command_status_spec.rb @@ -5,10 +5,10 @@ describe Bipbip::Plugin::CommandStatus do command = 'echo "foo" > /dev/stdout; echo "bar" > /dev/stderr; exit 42;' - logger_file = Tempfile.new('bipbip-mock-logger') - logger = Logger.new(logger_file.path) - plugin = Bipbip::Plugin::CommandStatus.new('cmd-status', { 'command' => command }, 0.1) - agent = Bipbip::Agent.new(Bipbip::Config.new([plugin], [], logger)) + let(:logger_file) { Tempfile.new('bipbip-mock-logger') } + let(:logger) { Logger.new(logger_file.path) } + let(:plugin) { Bipbip::Plugin::CommandStatus.new('cmd-status', { 'command' => command }, 0.1) } + let(:agent) { Bipbip::Agent.new(Bipbip::Config.new([plugin], [], logger)) } it 'should collect status:42' do thread = Thread.new { agent.run }
Use rspec "let" to set test instances
diff --git a/config/initializers/spree.rb b/config/initializers/spree.rb index abc1234..def5678 100644 --- a/config/initializers/spree.rb +++ b/config/initializers/spree.rb @@ -1,6 +1,5 @@ # Spree Configuration SESSION_KEY = '_spree_session_id' -FLAT_SHIPPING_RATE = 10 # applies only to the flat rate shipping option #require 'spree/support/core_ext/array/conversions'
Remove legacy FLAT_SHIPPING_RATE variable (replaced by FlatRateShipping extension)
diff --git a/lib/api_key.rb b/lib/api_key.rb index abc1234..def5678 100644 --- a/lib/api_key.rb +++ b/lib/api_key.rb @@ -1,6 +1,6 @@ module APIKey module ClassMethods - attr_accessor :default_api_key + attr_accessor :api_key end def self.included( klass ) @@ -10,6 +10,6 @@ attr_writer :api_key def api_key - @api_key || self.class.default_api_key + @api_key || self.class.api_key end end
Refactor default key call to match instance call. The class and instance method names were out of sync. It feels like it should make more sense to make them the same.
diff --git a/config/puma.rb b/config/puma.rb index abc1234..def5678 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -8,8 +8,8 @@ port ENV['PORT'] || 3000 environment ENV['RACK_ENV'] || 'development' -on_worker_boot do +#on_worker_boot do # Worker specific setup for Rails 4.1+ # See: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot - ActiveRecord::Base.establish_connection -end +# ActiveRecord::Base.establish_connection +#end
Remove ActiveRecord booter from Puma.rb
diff --git a/config/routes.rb b/config/routes.rb index abc1234..def5678 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -2,6 +2,7 @@ namespace :api do namespace :v1 do resources :farms + resources :depots end end resources :farms
Add API route for depot resource.
diff --git a/config/routes.rb b/config/routes.rb index abc1234..def5678 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -5,6 +5,12 @@ ) get "/rebuild-healthcheck", to: proc { [200, {}, %w[OK]] } + + get "/healthcheck/live", to: proc { [200, {}, %w[OK]] } + get "/healthcheck/ready", to: GovukHealthcheck.rack_response( + GovukHealthcheck::SidekiqRedis, + ) + post "/preview", to: "govspeak#preview" get "/error", to: "passthrough#error"
Add RFC 141 healthcheck endpoints Once govuk-puppet has been updated, the old endpoint can be removed. See the RFC for more details.
diff --git a/config/routes.rb b/config/routes.rb index abc1234..def5678 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -17,6 +17,7 @@ get :toggle_used get :toggle_interesting get :toggle_visible + resources :comments, only: [:new, :edit, :create, :update, :destroy] end resources :games, except: [:index] do resources :posts, only: [:new, :edit, :create, :update, :destroy] do
Add comments resource under idea
diff --git a/corgi.rb b/corgi.rb index abc1234..def5678 100644 --- a/corgi.rb +++ b/corgi.rb @@ -0,0 +1,8 @@+ +# Handle command-line arguments immediately. +if ARGV.size != 1 + puts "Usage: #{__FILE__} path/to/file.cg" + exit +else + path = ARGV.first +end
Read the path as the first command-line argument.
diff --git a/app/controllers/basechurch/v1/announcements_controller.rb b/app/controllers/basechurch/v1/announcements_controller.rb index abc1234..def5678 100644 --- a/app/controllers/basechurch/v1/announcements_controller.rb +++ b/app/controllers/basechurch/v1/announcements_controller.rb @@ -1,3 +1,3 @@ class Basechurch::V1::AnnouncementsController < Basechurch::ApplicationController - before_action :authenticate_user!, except: [:show] + before_action :authenticate_user!, except: [:show, :index] end
Allow unauthenticated users to view bulletin list
diff --git a/app/controllers/corporate_information_pages_controller.rb b/app/controllers/corporate_information_pages_controller.rb index abc1234..def5678 100644 --- a/app/controllers/corporate_information_pages_controller.rb +++ b/app/controllers/corporate_information_pages_controller.rb @@ -3,7 +3,6 @@ def show @corporate_information_page = @document - @corporate_information_page.extend(UseSlugAsParam) if @organisation.is_a? WorldwideOrganisation render 'show_worldwide_organisation'
Remove redundant workaround in CIP controller.
diff --git a/spec/application/commands/dispatcher_spec.rb b/spec/application/commands/dispatcher_spec.rb index abc1234..def5678 100644 --- a/spec/application/commands/dispatcher_spec.rb +++ b/spec/application/commands/dispatcher_spec.rb @@ -0,0 +1,21 @@+require 'spec_helper' +require 'travis/worker/application/commands/dispatcher' + +describe Travis::Worker::Application::Commands::Dispatcher do + describe 'start' do + let(:amqp_connection) { stub('connection', create_channel: amqp_channel) } + let(:amqp_channel) { stub('channel', :prefetch= => nil, :queue => amqp_queue, :fanout => nil) } + let(:amqp_queue) { stub('queue', bind: nil, subscribe: amqp_consumer) } + let(:amqp_consumer) { stub('consumer', cancel!: nil, shutdown!: nil) } + let(:pool) { stub('pool') } + + before do + Travis::Amqp.expects(:connection).returns(amqp_connection) + end + + it 'subscribes to a queue' do + amqp_queue.expects(:subscribe) + described_class.new(pool).start + end + end +end
Add basic specs for dispatcher command
diff --git a/spec/controllers/comments_controller_spec.rb b/spec/controllers/comments_controller_spec.rb index abc1234..def5678 100644 --- a/spec/controllers/comments_controller_spec.rb +++ b/spec/controllers/comments_controller_spec.rb @@ -9,8 +9,9 @@ end it 'does not save a comment without a body' do + @question = create(:question, id: 1) expect{ - post :create, comment: attributes_for(:invalid_comment) + post :create, comment: attributes_for(:invalid_comment, commentable_id: 1, commentable_type: 'Question') }.to change(Comment, :count).by(0) end end
Update attributes in post create spec test.
diff --git a/spec/features/visitor_create_contact_spec.rb b/spec/features/visitor_create_contact_spec.rb index abc1234..def5678 100644 --- a/spec/features/visitor_create_contact_spec.rb +++ b/spec/features/visitor_create_contact_spec.rb @@ -5,4 +5,14 @@ visit '/contacts' expect(page).to have_content I18n.t 'contacts.message' end + + scenario "allows a guest to create contact" do + visit '/contacts' + + fill_in 'contact_email', :with => 'user@example.com' # use name from id="contact_email" + fill_in 'contact_message', :with => 'something' # use name from id="contact_message" + click_button 'Send message' + + expect(page).to have_content 'Thanks!' + end end
Update contact tests (allows a guest to create contact)
diff --git a/stanza-linux.rb b/stanza-linux.rb index abc1234..def5678 100644 --- a/stanza-linux.rb +++ b/stanza-linux.rb @@ -1,4 +1,4 @@-class LbstanzaLinux < Formula +class StanzaLinux < Formula desc "An optionally-typed, general-purpose programming language from the University of California, Berkeley." homepage "http://lbstanza.org" url "http://lbstanza.org/resources/stanza/lstanza.zip"
Rename formula to proper class
diff --git a/lib/dc_metro/api_base.rb b/lib/dc_metro/api_base.rb index abc1234..def5678 100644 --- a/lib/dc_metro/api_base.rb +++ b/lib/dc_metro/api_base.rb @@ -20,7 +20,7 @@ req.params = camel_params(params) end end - # TODO Mkae a Response model instead + # TODO Make a Response model instead OpenStruct.new(response.body) end
Fix spelling error in comment
diff --git a/lib/bundler/cli/binstubs.rb b/lib/bundler/cli/binstubs.rb index abc1234..def5678 100644 --- a/lib/bundler/cli/binstubs.rb +++ b/lib/bundler/cli/binstubs.rb @@ -21,7 +21,7 @@ end gems.each do |gem_name| - spec = installer.specs.find {|s| s.name == gem_name } + spec = Bundler.definition.specs.find {|s| s.name == gem_name } unless spec raise GemNotFound, Bundler::CLI::Common.gem_not_found_message( gem_name, Bundler.definition.specs
[Binstubs] Update for Installer not inheriting from Environment
diff --git a/activejob/activejob.gemspec b/activejob/activejob.gemspec index abc1234..def5678 100644 --- a/activejob/activejob.gemspec +++ b/activejob/activejob.gemspec @@ -18,5 +18,6 @@ s.files = Dir['CHANGELOG.md', 'MIT-LICENSE', 'README.md', 'lib/**/*'] s.require_path = 'lib' + s.add_dependency 'activesupport', version s.add_dependency 'globalid', '>= 0.2.3' end
[ActiveJob] Add activesupport as dependency [ci skip]
diff --git a/app/helpers/filter_helper.rb b/app/helpers/filter_helper.rb index abc1234..def5678 100644 --- a/app/helpers/filter_helper.rb +++ b/app/helpers/filter_helper.rb @@ -3,26 +3,26 @@ tags = Tag.where(tag_type: tag_type, parent_id: nil) tags_with_labels = tags.map {|tag| [tag.title, tag.tag_id] } - options = [["All", nil]] + tags_with_labels + options = [["All", ""]] + tags_with_labels - options_for_select(options, selected_value) + options_for_select(options, selected_value || "") end def options_from_formats_for_select(selected_value=nil) formats_with_labels = Artefact::FORMATS.sort.map {|format| [ format.underscore.humanize, format ] } - options = [["All", nil]] + formats_with_labels + options = [["All", ""]] + formats_with_labels - options_for_select(options, selected_value) + options_for_select(options, selected_value || "") end def options_from_states_for_select(selected_value=nil) states_with_labels = Artefact::STATES.sort.map {|state| [ state.humanize, state ] } - options = [["All", nil]] + states_with_labels + options = [["All", ""]] + states_with_labels - options_for_select(options, selected_value) + options_for_select(options, selected_value || "") end end
Fix the selected value of filter box when blank When there's no filter applied, the select box should explicitly mark the "All" option as "selected".
diff --git a/app/helpers/emoji_helper.rb b/app/helpers/emoji_helper.rb index abc1234..def5678 100644 --- a/app/helpers/emoji_helper.rb +++ b/app/helpers/emoji_helper.rb @@ -1,13 +1,13 @@ module EmojiHelper - def emojify(content) - h(content).to_str.gsub(/:([\w+-]+):/) do |match| - if emoji = Emoji.find_by_alias($1) - %(<img alt="#$1" src="#{image_path("emoji/#{emoji.image_filename}")}" style="vertical-align:middle" width="20" height="20" />) - else - match - end - end.html_safe if content.present? - end + def emojify(content) + h(content).to_str.gsub(/:([\w+-]+):/) do |match| + if emoji = Emoji.find_by_alias($1) + %(<img alt="#$1" src="#{image_path("emoji/#{emoji.image_filename}")}" style="vertical-align:middle" width="64" height="64" />) + else + match + end + end.html_safe if content.present? + end end
Change emoji size to 64x64
diff --git a/app/helpers/steps_helper.rb b/app/helpers/steps_helper.rb index abc1234..def5678 100644 --- a/app/helpers/steps_helper.rb +++ b/app/helpers/steps_helper.rb @@ -7,7 +7,6 @@ def active_step_for_feature(object, feature_name) object.participatory_process - .includes(:steps) .steps.where(active: true).order('position desc') .to_a.find{ |s| s.flags.include? feature_name } end
Remove wrong usage of eager loading
diff --git a/app/mailers/admin_mailer.rb b/app/mailers/admin_mailer.rb index abc1234..def5678 100644 --- a/app/mailers/admin_mailer.rb +++ b/app/mailers/admin_mailer.rb @@ -6,7 +6,7 @@ def new_profile_confirmed(profile) @profile = profile @url = 'https://github.com/rubymonsters/speakerinnen_liste/wiki/Approve-new-Speakerinnen*-so-they-get-published' - mail(to: 'christiane@speakerinnen.org, annalist@riseup.net, maren.heltsche@gmail.com', subject: 'Publish new Speakerinnen Profile') + mail(to: 'christiane@speakerinnen.org, maren@speakerinnen.org', subject: 'Publish new Speakerinnen Profile') end def profile_published(profile)
Remove one email address and change another
diff --git a/db/migrate/20170822111025_update_buffer_slider_step_size.rb b/db/migrate/20170822111025_update_buffer_slider_step_size.rb index abc1234..def5678 100644 --- a/db/migrate/20170822111025_update_buffer_slider_step_size.rb +++ b/db/migrate/20170822111025_update_buffer_slider_step_size.rb @@ -0,0 +1,18 @@+class UpdateBufferSliderStepSize < ActiveRecord::Migration[5.0] + def up + inputs.update_all(step_value: 0.5) + end + + def down + inputs.update_all(step_value: 1.0) + end + + private + + def inputs + InputElement.where(key: %i[ + households_flexibility_space_heating_buffer_size + households_flexibility_water_heating_buffer_size + ]) + end +end
Update step size of buffer size sliders
diff --git a/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fills/fill/pattern_fill.rb b/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fills/fill/pattern_fill.rb index abc1234..def5678 100644 --- a/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fills/fill/pattern_fill.rb +++ b/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fills/fill/pattern_fill.rb @@ -22,9 +22,9 @@ node.xpath('*').each do |node_child| case node_child.name when 'fgColor' - @foreground_color = Color.parse_color_tag(node_child) + @foreground_color = OoxmlColor.new(parent: self).parse(node_child) when 'bgColor' - @background_color = Color.parse_color_tag(node_child) + @background_color = OoxmlColor.new(parent: self).parse(node_child) end end self
Support of OoxmlColor in parse xlsx fg and bg color
diff --git a/config/initializers/cookies_serializer.rb b/config/initializers/cookies_serializer.rb index abc1234..def5678 100644 --- a/config/initializers/cookies_serializer.rb +++ b/config/initializers/cookies_serializer.rb @@ -1,3 +1,3 @@ # Be sure to restart your server when you modify this file. -Rails.application.config.action_dispatch.cookies_serializer = :marshal +Rails.application.config.action_dispatch.cookies_serializer = :json
Replace cookie serializer format according to new rails version
diff --git a/samples/shadow_client_samples/samples_shadow_client_getting_started.rb b/samples/shadow_client_samples/samples_shadow_client_getting_started.rb index abc1234..def5678 100644 --- a/samples/shadow_client_samples/samples_shadow_client_getting_started.rb +++ b/samples/shadow_client_samples/samples_shadow_client_getting_started.rb @@ -0,0 +1,22 @@+require "aws_iot_device" + +host = "AWS IoT endpoint" +port = 8883 +thing = "Thing Name" +root_ca_path = "Path to your CA certificate" +private_key_path = "Path to your private key" +certificate_path = "Path to your certificate" + +shadow_client = AwsIotDevice::MqttShadowClient::ShadowClient.new +shadow_client.configure_endpoint(host, port) +shadow_client.configure_credentials(root_ca_path, private_key_path, certificate_path) +shadow_client.create_shadow_handler_with_name(thing, true) + +shadow_client.connect +shadow_client.get_shadow do |message| + # Do what you want with the get_shadow's answer + p ":)" +end +sleep 2 #Timer to ensure that the answer is received + +shadow_client.disconnect
Add getting started samples file
diff --git a/RNViewShot.podspec b/RNViewShot.podspec index abc1234..def5678 100644 --- a/RNViewShot.podspec +++ b/RNViewShot.podspec @@ -0,0 +1,18 @@+require 'json' +version = JSON.parse(File.read('package.json'))["version"] + +Pod::Spec.new do |s| + + s.name = "RNViewShot" + s.version = version + s.summary = "Capture a React Native view to an image" + s.homepage = "https://github.com/gre/react-native-view-shot" + s.license = "MIT" + s.author = { "Gaëtan Renaudeau" => "renaudeau.gaetan@gmail.com" } + s.platform = :ios, "7.0" + s.source = { :git => "https://github.com/gre/react-native-view-shot.git", :tag => "v#{s.version}" } + s.source_files = 'ios/*.{h,m}' + s.preserve_paths = "**/*.js" + s.dependency 'React' + +end
Add podspec for CocoaPods support
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,5 +29,5 @@ config.time_zone = "Eastern Time (US & Canada)" - ENV['SSL_CERT_FILE'] = "/Users/jimmylo/cacert.pem" + ENV['SSL_CERT_FILE'] = "/Users/jimmy/cacert.pem" end
Change location of SSL cert file
diff --git a/config/initializers/carrierwave.rb b/config/initializers/carrierwave.rb index abc1234..def5678 100644 --- a/config/initializers/carrierwave.rb +++ b/config/initializers/carrierwave.rb @@ -4,6 +4,10 @@ provider: "AWS", aws_access_key_id: ENV["AWS_ACCESS_KEY_ID"], aws_secret_access_key: ENV["AWS_SECRET_ACCESS_KEY"], + region: ENV["AWS_S3_REGION"] || "us-east-1", + host: ENV["AWS_HOST"] || "s3.amazonaws.com", + endpoint: ENV["AWS_S3_ENDPOINT"] || nil, + path_style: ENV["AWS_S3_PATH_STYLE"] || false, } config.fog_directory = ENV["AWS_S3_BUCKET"] config.max_file_size = 5.megabytes
S3: Support non-AWS object storage for CarrierWave Same changes as for Fog
diff --git a/lib/handlebars_assets.rb b/lib/handlebars_assets.rb index abc1234..def5678 100644 --- a/lib/handlebars_assets.rb +++ b/lib/handlebars_assets.rb @@ -10,7 +10,7 @@ autoload(:Handlebars, 'handlebars_assets/handlebars') autoload(:TiltHandlebars, 'handlebars_assets/tilt_handlebars') - if defined?(Rails) + if defined?(Rails && ::Rails::Engine) require 'handlebars_assets/engine' else require 'sprockets'
Check for Rails 3 features Check for ::Rails::Engine when deciding whether to use the Rails 3 code. This allows projects running Rails 2 + Sprockets to still use handlebars_assets.
diff --git a/share/osxsub.rb b/share/osxsub.rb index abc1234..def5678 100644 --- a/share/osxsub.rb +++ b/share/osxsub.rb @@ -2,8 +2,8 @@ class Osxsub < Formula homepage 'https://github.com/mwunsch/osxsub' - url 'https://github.com/mwunsch/osxsub/tarball/v0.1.2' - sha1 '93c766bfde5aa27c186018d4450c0c41ddae6ffa' + url 'https://github.com/mwunsch/osxsub/tarball/v0.2.0' + sha1 'dd2385baa671a72aa8bab40fbd18d3e1295a74b4' head 'https://github.com/mwunsch/osxsub.git' def install
Update Homebrew formula for v0.2.0
diff --git a/lib/frecon/request_error.rb b/lib/frecon/request_error.rb index abc1234..def5678 100644 --- a/lib/frecon/request_error.rb +++ b/lib/frecon/request_error.rb @@ -10,34 +10,32 @@ require "json" class RequestError < StandardError + attr_reader :return_value + def initialize(code, message = nil, context = nil) @code = code @message = message @context = context - # If @message is a String or an Array, - # generate a JSON string for the body and - # store it in the @body variable. + # When @message is a String or an Array, + # the return_value is set to a Sinatra-compliant + # Array with @code being the first element and the + # response body being the stringification of the + # JSON stringification of @context and @message. # - # Notice that if @message is nil, neither - # of these is tripped, so @body becomes nil. - # This means that #return_value will instead - # return just @code, which is similar to the - # previous behavior. - @body = case @message - when String - JSON.generate({ context: @context, errors: [ @message ] }) - when Array - JSON.generate({ context: @context, errors: @message }) - end - end - - # A Sinatra-compliant return value. - def return_value - if @body - [@code, @body] - else - @code - end + # If @message is a String, it is first put into an + # array. + # + # If @message is neither a String nor an Array, + # @return_value becomes simply @code. + @return_value = + case @message + when String + [@code, JSON.generate({ context: @context, errors: [ @message ] })] + when Array + [@code, JSON.generate({ context: @context, errors: @message })] + else + @code + end end end
Make RequestErrors a bit more concise. Everything works just the same. Also, this case-when syntax follows [this][styleguide-ref]. [styleguide-ref]: https://github.com/bbatsov/ruby-style-guide/blob/master/README.md#indent-conditional-assignment
diff --git a/lib/hanzo/modules/deploy.rb b/lib/hanzo/modules/deploy.rb index abc1234..def5678 100644 --- a/lib/hanzo/modules/deploy.rb +++ b/lib/hanzo/modules/deploy.rb @@ -25,6 +25,7 @@ def deploy branch = ask "-----> Branch to deploy in #{@env} [HEAD]: " + branch = 'HEAD' if branch.empty? `git push -f #{@env} #{branch}:master` end
Add default branch to HEAD
diff --git a/lib/mako/commands/new.rb b/lib/mako/commands/new.rb index abc1234..def5678 100644 --- a/lib/mako/commands/new.rb +++ b/lib/mako/commands/new.rb @@ -3,17 +3,25 @@ module Mako class New # Copies template files stored in ../lib/templates to specified directory. + # If the directory specified doesn't exist, it will be created. # If no directory is specified, it defaults to the current directory. def self.perform(args) location = args.size < 1 ? Dir.pwd : File.expand_path(args.join(' '), Dir.pwd) + create_dir(File.basename(location)) if location != Dir.pwd && File.directory?(location) copy_templates(location) - Mako.logger.info "Created new Mako instalation in #{location}" + Mako.logger.info "Created new Mako installation in #{location}" end private + # @private + # Copies source templates to specified path. + def self.copy_templates(path) + FileUtils.cp_r "#{Mako.config.source_templates}/.", path + end - def copy_templates(path) - FileUtils.cp_r Mako.config.source_templates, path + # If the directory does not exist, create the specified directory. + def self.create_dir(path) + FileUtils.mkdir path end end end
Create the directory in PATH if it doesn't exist