diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -9,6 +9,13 @@ DAY = Time.utc(2010, 3, 1) WEDNESDAY = Time.utc(2010, 6, 23, 5, 0, 0) +WORLD_TIME_ZONES = [ + 'Pacific/Midway', # -1100 + 'America/Adak', # -1000 / -0900 + 'Europe/London', # +0000 / +0100 + 'Pacific/Wellington', # +1200 / +1300 + 'Pacific/Fiji' # +1200 +] RSpec.configure do |config| @@ -20,4 +27,23 @@ example.run unless defined? ActiveSupport::Time end + config.around :each do |example| + if zone = example.metadata[:system_time_zone] + @orig_zone = ENV['TZ'] + ENV['TZ'] = zone + example.run + ENV['TZ'] = @orig_zone + else + example.run + end + end + + config.before :each do + if time_args = @example.metadata[:system_time] + case time_args + when Array then Time.stub!(:now).and_return Time.local(*time_args) + when Time then Time.stub!(:now).and_return time_args + end + end + end end
Add helper for system environment TZ testing
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,3 +1,5 @@+require 'backports' + require 'dm-core/spec/setup' require 'dm-core/spec/lib/adapter_helpers'
Add backports to spec helper to allow specs to run under 1.8.7
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,27 +1,15 @@ require 'serverspec' -require 'net/ssh' - -include SpecInfra::Helper::DetectOS -include SpecInfra::Helper::Exec -include SpecInfra::Helper::Ssh if ENV['RAKE_ANSIBLE_USE_VAGRANT'] require 'lib/vagrant' - conn = Vagrant.new + c = Vagrant.new else require 'lib/docker' - conn = Docker.new + c = Docker.new end -RSpec.configure do |config| - config.before :all do - config.host = conn.ssh_host - opts = Net::SSH::Config.for(config.host) - opts[:port] = conn.ssh_port - opts[:keys] = conn.ssh_keys - opts[:auth_methods] = Net::SSH::Config.default_auth_methods - config.ssh = Net::SSH.start(conn.ssh_host, conn.ssh_user, opts) - end -end +set :backend, :ssh +set :host, c.ssh_host +set :ssh_options, :user => c.ssh_user, :port => c.ssh_port, :keys => c.ssh_keys
Update integration testing to work with Serverspec 2.N
diff --git a/lib/file_data/formats/exif/exif_data.rb b/lib/file_data/formats/exif/exif_data.rb index abc1234..def5678 100644 --- a/lib/file_data/formats/exif/exif_data.rb +++ b/lib/file_data/formats/exif/exif_data.rb @@ -16,6 +16,7 @@ end end + # Hash with convenience methods for accessing known Exif tag values by name class ExifHash < BasicObject all_tags = ExifTags.tag_groups.values.map{|x| x.values}.flatten tags_map = all_tags.each_with_object({}) do |tag, hash| @@ -25,8 +26,11 @@ define_method(:method_missing) do |method_name, *args| known_name = tags_map[method_name.to_s.tr('_', '').upcase] - return @hash.send(method_name, *args) if known_name.nil? - return @hash[known_name] + if known_name.nil? + @hash.send(method_name, *args) + else + @hash[known_name] + end end def initialize
Clean up the if/else block in method_missing for ExifHash and add a class comment
diff --git a/lib/mongomodel/support/configuration.rb b/lib/mongomodel/support/configuration.rb index abc1234..def5678 100644 --- a/lib/mongomodel/support/configuration.rb +++ b/lib/mongomodel/support/configuration.rb @@ -4,7 +4,12 @@ module MongoModel class Configuration def initialize(options) - @options = DEFAULTS.merge(options).stringify_keys + case options + when Hash + @options = DEFAULTS.merge(options).stringify_keys + when String + @options = parse(options) + end end def host @@ -44,5 +49,18 @@ def self.defaults new({}) end + + private + def parse(str) + uri = URI.parse(str) + + { + 'host' => uri.host, + 'port' => uri.port, + 'database' => uri.path.gsub(/^\//, ''), + 'username' => uri.user, + 'password' => uri.password + } + end end end
Add support for connection string
diff --git a/lib/processor/metric_results_checker.rb b/lib/processor/metric_results_checker.rb index abc1234..def5678 100644 --- a/lib/processor/metric_results_checker.rb +++ b/lib/processor/metric_results_checker.rb @@ -1,22 +1,29 @@ module Processor class MetricResultsChecker < ProcessingStep protected + + def metric_key(metric) + metric.metric_collector_name.to_s + "#" + metric.code.to_s + "#" + metric.scope.to_s + end def self.task(context) wanted_metrics = {} context.native_metrics.each do |metric_collector_name, metric_configurations| - metric_configurations.each { |metric_configuration| wanted_metrics[metric_configuration.metric] = metric_configuration } + metric_configurations.each { |metric_configuration| + wanted_metrics[metric_key(metric_configuration.metric)] = metric_configuration + } end context.processing.module_results.each do |module_result| metrics_check_list = wanted_metrics.clone - module_result.metric_results.each { |metric_result| metrics_check_list.delete(metric_result.metric) } + module_result.metric_results.each { |metric_result| + metrics_check_list.delete(metric_key(metric_result.metric)) + } metrics_check_list.each do |metric, metric_configuration| - MetricResult.create(metric: metric, - value: default_value_from(metric), + MetricResult.create(value: default_value_from(metric), module_result: module_result, metric_configuration_id: metric_configuration.id) end
Fix metric checker adding defaults even if results existed
diff --git a/lib/puppet/provider/yumgroup/default.rb b/lib/puppet/provider/yumgroup/default.rb index abc1234..def5678 100644 --- a/lib/puppet/provider/yumgroup/default.rb +++ b/lib/puppet/provider/yumgroup/default.rb @@ -10,7 +10,7 @@ groups = [] # get list of all groups - yum_content = yum('grouplist') + yum_content = yum('grouplist').split("\n") # turn of collecting to avoid lines like 'Loaded plugins' collect_groups = false
Fix bug in yumgroup provider
diff --git a/db/migrate/20120506041011_create_radio_assignments.rb b/db/migrate/20120506041011_create_radio_assignments.rb index abc1234..def5678 100644 --- a/db/migrate/20120506041011_create_radio_assignments.rb +++ b/db/migrate/20120506041011_create_radio_assignments.rb @@ -3,6 +3,7 @@ create_table :radio_assignments do |t| t.integer :radio_id t.integer :volunteer_id + t.string :state # This moves to radios in a later migration t.timestamps end
Fix a migration that breaks a clean install
diff --git a/PathMenu.podspec b/PathMenu.podspec index abc1234..def5678 100644 --- a/PathMenu.podspec +++ b/PathMenu.podspec @@ -4,7 +4,7 @@ s.summary = "Path 4.2 menu using CoreAnimation in Swift." s.homepage = 'https://github.com/pixyzehn/PathMenu' s.license = { :type => 'MIT', :file => 'LICENSE' } - s.author = { "pixyzehn" => "civokjots0109@gmail.com" } + s.author = { "Nagasawa Hiroki" => "civokjots10@gmail.com" } s.requires_arc = true s.ios.deployment_target = "8.0" s.source = { :git => "https://github.com/pixyzehn/PathMenu.git", :tag => "#{s.version}" }
Update podspec for correct author
diff --git a/config/initializers/airbrake.rb b/config/initializers/airbrake.rb index abc1234..def5678 100644 --- a/config/initializers/airbrake.rb +++ b/config/initializers/airbrake.rb @@ -1,19 +1,23 @@-require 'airbrake/sidekiq/error_handler' +if ENV['AIRBRAKE_PROJECT_ID'].present? && ENV['AIRBRAKE_API_KEY'].present? -Airbrake.configure do |c| - c.project_id = ENV['AIRBRAKE_PROJECT_ID'] - c.project_key = ENV['AIRBRAKE_API_KEY'] - c.root_directory = Rails.root - c.logger = Rails.logger - c.environment = Rails.env - c.ignore_environments = %w[test development] + require 'airbrake/sidekiq/error_handler' - # A list of parameters that should be filtered out of what is sent to - # Airbrake. By default, all "password" attributes will have their contents - # replaced. - # https://github.com/airbrake/airbrake-ruby#blacklist_keys - # Alternatively, you can integrate with Rails' filter_parameters. - # Read more: https://goo.gl/gqQ1xS - # c.blacklist_keys = Rails.application.config.filter_parameters - c.blacklist_keys = [/password/i, /authorization/i] + Airbrake.configure do |c| + c.project_id = ENV['AIRBRAKE_PROJECT_ID'] + c.project_key = ENV['AIRBRAKE_API_KEY'] + c.root_directory = Rails.root + c.logger = Rails.logger + c.environment = Rails.env + c.ignore_environments = %w[development test] + + # A list of parameters that should be filtered out of what is sent to + # Airbrake. By default, all "password" attributes will have their contents + # replaced. + # https://github.com/airbrake/airbrake-ruby#blacklist_keys + # Alternatively, you can integrate with Rails' filter_parameters. + # Read more: https://goo.gl/gqQ1xS + # c.blacklist_keys = Rails.application.config.filter_parameters + c.blacklist_keys = [/password/i, /authorization/i] + end + end
Allow apps to run without Airbrake
diff --git a/config/initializers/rummager.rb b/config/initializers/rummager.rb index abc1234..def5678 100644 --- a/config/initializers/rummager.rb +++ b/config/initializers/rummager.rb @@ -5,7 +5,12 @@ Whitehall.government_search_client = GdsApi::Rummager.new(Rummageable.rummager_host + Whitehall.government_search_index_name) Whitehall.detailed_guidance_search_client = GdsApi::Rummager.new(Rummageable.rummager_host + Whitehall.detailed_guidance_search_index_name) -Whitehall.mainstream_search_client = GdsApi::Rummager.new(Rummageable.rummager_host + '') + +# We're still using two Rummager instances until Mainstream is upgraded, at which point we can +# connect to a single instance that provides access to multiple indexes. +mainstream_rummager_service_name = 'search' +mainstream_rummager_host = Plek.current.find(mainstream_rummager_service_name) +Whitehall.mainstream_search_client = GdsApi::Rummager.new(mainstream_rummager_host + '/search') unless Rails.env.production? || ENV["RUMMAGER_HOST"] Rummageable.implementation = Rummageable::Fake.new
Connect to two Rummager endpoints We need to continue to access both 'whitehall-search' and 'search' Rummager instances until mainstream's Rummager is using Elastic Search, at which point we should be able to migrate to a single instance.
diff --git a/lib/troo.rb b/lib/troo.rb index abc1234..def5678 100644 --- a/lib/troo.rb +++ b/lib/troo.rb @@ -45,12 +45,11 @@ @kernel.exit(0) rescue Troo::InvalidAccessToken - @stderr.puts 'Your Trello access credentials have expired, ' \ - ' please renew and try again.' + @stderr.puts 'Your Trello access credentials have expired ' \ + 'or are invalid, please renew and try again.' @kernel.exit(1) - rescue SocketError - @stderr.puts 'Cannot continue, no network connection.' - @kernel.exit(1) + ensure + $stdin, $stdout, $stderr = STDIN, STDOUT, STDERR end end end
Reset stdin, stdout and stderr before exiting.
diff --git a/spec/ci/yarn_pnp_spec.rb b/spec/ci/yarn_pnp_spec.rb index abc1234..def5678 100644 --- a/spec/ci/yarn_pnp_spec.rb +++ b/spec/ci/yarn_pnp_spec.rb @@ -5,7 +5,7 @@ app = Hatchet::Runner.new( "spec/fixtures/repos/yarn-pnp-zero-install", config: { "NODE_MODLES_CACHE": "false" } - } + ) app.deploy do |app| expect(successful_body(app).strip).to eq("Hello from yarn-pnp-zero-install") end
Fix pnp spec syntax error
diff --git a/workers/command_runner.rb b/workers/command_runner.rb index abc1234..def5678 100644 --- a/workers/command_runner.rb +++ b/workers/command_runner.rb @@ -23,6 +23,7 @@ result = socket.gets("\n") logger.info "[CommandRunner] Result: #{result}" $redis.set("dda:#{command_id}", result) + socket.close end rescue Timeout::Error logger.info "[CommandRunner] Command Timed Out"
Add closing the socket after received result
diff --git a/lib/ardes/response_for/bc.rb b/lib/ardes/response_for/bc.rb index abc1234..def5678 100644 --- a/lib/ardes/response_for/bc.rb +++ b/lib/ardes/response_for/bc.rb @@ -0,0 +1,16 @@+module Ardes + module ResponseFor + module Bc + def self.included(base) + base.class_eval do + alias_method_chain :template_exists?, :response_for + end + end + + protected + def template_exists_with_repsonse_for? + action_responses.any? || template_exists_without_repsonse_for? + end + end + end +end
Add BC module with tmeplate_exists? stuff
diff --git a/lib/hotdog/commands/hosts.rb b/lib/hotdog/commands/hosts.rb index abc1234..def5678 100644 --- a/lib/hotdog/commands/hosts.rb +++ b/lib/hotdog/commands/hosts.rb @@ -7,11 +7,6 @@ if args.empty? result = execute("SELECT DISTINCT host_id FROM hosts_tags").to_a.reduce(:+) else - if args.map { |host_name| glob?(host_name) }.all? - args.each do |host_name| - execute("INSERT OR IGNORE INTO hosts (name) VALUES (?)", host_name) - end - end result = args.map { |host_name| if glob?(host_name) execute(<<-EOS, host_name).map { |row| row.first }
Remove useless `IGNORE INTO` queries
diff --git a/lib/pxcbackup/remote_repo.rb b/lib/pxcbackup/remote_repo.rb index abc1234..def5678 100644 --- a/lib/pxcbackup/remote_repo.rb +++ b/lib/pxcbackup/remote_repo.rb @@ -35,7 +35,7 @@ def stream_command(backup) verify(backup) - "#{@which.s3cmd.shellescape} get #{backup.path.shellescape} -" + "#{@which.s3cmd.shellescape} get --no-progress #{backup.path.shellescape} -" end end end
Add workaround for broken s3cmd
diff --git a/lib/rubycritic/turbulence.rb b/lib/rubycritic/turbulence.rb index abc1234..def5678 100644 --- a/lib/rubycritic/turbulence.rb +++ b/lib/rubycritic/turbulence.rb @@ -13,9 +13,9 @@ def data @paths.zip(churn, complexity).map do |path_info| { - name: path_info[0], - x: path_info[1], - y: path_info[2] + :name => path_info[0], + :x => path_info[1], + :y => path_info[2] } end end
Use Ruby 1.8's hash syntax Consistency is important
diff --git a/lib/syoboi_calendar/agent.rb b/lib/syoboi_calendar/agent.rb index abc1234..def5678 100644 --- a/lib/syoboi_calendar/agent.rb +++ b/lib/syoboi_calendar/agent.rb @@ -1,3 +1,5 @@+require "uri" + module SyoboiCalendar module Agent extend self @@ -34,7 +36,7 @@ # change hash into URL query string def querinize(hash) - "?" + hash.map { |k, v| "#{k}=#{v}" }.join("&") + "?" + hash.map { |k, v| "#{k}=#{URI.encode(v.to_s)}" }.join("&") end def agent
Fix bug: encode uri query
diff --git a/app/models/feed.rb b/app/models/feed.rb index abc1234..def5678 100644 --- a/app/models/feed.rb +++ b/app/models/feed.rb @@ -10,7 +10,7 @@ def favicon url = URI.parse(self.url) - "#{url.scheme}://plus.google.com/_/favicon?domain=#{url.host}" + "#{url.scheme||"http"}://plus.google.com/_/favicon?domain=#{url.host||self.url}" end def unread_count()
Set default value in-case url can not be parsed
diff --git a/app/models/plot.rb b/app/models/plot.rb index abc1234..def5678 100644 --- a/app/models/plot.rb +++ b/app/models/plot.rb @@ -1,9 +1,9 @@ class Plot < ApplicationRecord validates :plot_id, presence: true - validates :latitude, presence: true, numericality: { greater_than: 0 } - validates :longitude, presence: true, numericality: { greater_than: 0 } - validates :elevation, numericality: { greater_than: 0, allow_nil: true } - validates :area, numericality: { greater_than: 0, allow_nil: true } + validates_numericality_of :latitude, greater_than: 0, allow_nil: true + validates_numericality_of :longitude, greater_than: 0, allow_nil: true + validates_numericality_of :elevation, greater_than: 0, allow_nil: true + validates_numericality_of :area, greater_than: 0, allow_nil: true validates :location_description, presence: true validates :aspect, presence: true validates :origin, presence: true
Undo validation changes, it broke too many tests and should be a different issue at this point
diff --git a/app/models/span.rb b/app/models/span.rb index abc1234..def5678 100644 --- a/app/models/span.rb +++ b/app/models/span.rb @@ -14,7 +14,7 @@ belongs_to :trace belongs_to :platform - has_many :traces, foreign_key: :origin_id, dependent: :destroy, inverse_of: :spans + has_many :traces, foreign_key: :origin_id, dependent: :destroy, inverse_of: :origin class << self def retention(period, time = Time.zone.now)
Fix wrong inverse_of resulting in wrongly preloaded data The wrong inverse_of resulted in the following issue when preloaded relations on spans: irb(main):005:0> t.spans.map(&:trace_id).uniq => [<UUID4:3b25610a-145c-49d6-bedf-b0e10b86b174>] irb(main):006:0> t.spans.includes(:traces).map(&:trace_id).uniq => [<UUID4:3b25610a-145c-49d6-bedf-b0e10b86b174>, <UUID4:7c50fe4f-4a1a-4602-90a7-e2699be56f8e>, <UUID4:5d5fcf3a-b4f8-4854-b137-41d14e8672c3>]
diff --git a/app/models/user.rb b/app/models/user.rb index abc1234..def5678 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -8,6 +8,11 @@ has_many :questions has_many :answers has_many :likes + + has_attached_file :avatar, styles: { thumb: "100x100>" }, default_url: "/images/users/:id/:style/:basename.:extension" + validates_attachment_presence :photo + validates_attachment_size :photo, less_than: 5.megabytes + validates_attachment_content_type :avatar, content_type: ['image/jpeg', 'image/png'] def to_s email
Add validations to User model
diff --git a/test/helper.rb b/test/helper.rb index abc1234..def5678 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -5,20 +5,20 @@ require 'minitest/autorun' require 'usesthis' +require 'json' require 'little-fixtures' -require 'yaml' def test_configuration - Dimples::Configuration.new( - 'source_path' => File.join(__dir__, 'source'), - 'destination_path' => File.join( + { + source_path: File.join(__dir__, 'source'), + destination_path: File.join( File::SEPARATOR, 'tmp', "usesthis-#{Time.new.to_i}" ), - 'class_overrides' => { - 'site' => 'UsesThis::Site', - 'post' => 'UsesThis::Interview' + class_overrides: { + site: 'UsesThis::Site', + post: 'UsesThis::Interview' } - ) + } end def fixtures
Switch test_configuration to return a hash with symbols.
diff --git a/test/helper.rb b/test/helper.rb index abc1234..def5678 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -11,6 +11,9 @@ class Dbt::TestCase < Minitest::Test def setup + Dbt::Config.default_search_dirs = nil + Dbt::Config.default_no_create = nil + Dbt::Config.config_filename = nil end def teardown
Reset state at the start of the run
diff --git a/test/helper.rb b/test/helper.rb index abc1234..def5678 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -8,4 +8,5 @@ body.each { |line| arr << line } flunk "#{arr.inspect} != #{expected.inspect}" unless arr == expected + print "." end
Add a print for assert_response success.
diff --git a/test/helper.rb b/test/helper.rb index abc1234..def5678 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -16,7 +16,7 @@ @config ||= Dimples::Configuration.new( 'source_path' => File.join(__dir__, 'source'), 'destination_path' => site_destination, - 'categories' => [{ 'slug' => 'a', 'name' => 'A' }] + 'category_names' => { 'green' => 'G R E E N' } ) end @@ -24,7 +24,6 @@ File.join(File::SEPARATOR, 'tmp', "dimples-#{Time.new.to_i}") end -def render_template(filename, locals = {}) - template = Tilt.new(File.join(__dir__, 'templates', "#{filename}.erb")) - template.render(nil, locals) +def read_fixture(filename, locals = {}) + File.read(File.join(__dir__, 'fixtures', "#{filename}.html")) end
Fix the category name configuration, change render_template to read_fixture.
diff --git a/lib/bigcommerce/resources/store/store_information.rb b/lib/bigcommerce/resources/store/store_information.rb index abc1234..def5678 100644 --- a/lib/bigcommerce/resources/store/store_information.rb +++ b/lib/bigcommerce/resources/store/store_information.rb @@ -7,28 +7,32 @@ include Bigcommerce::Request.new 'store' property :id + property :logo + property :name + property :phone property :domain - property :name property :address - property :phone + property :currency + property :features + property :language + property :timezone + property :plan_name + property :plan_level + property :secure_url property :admin_email property :order_email - property :language - property :currency + property :weight_units + property :decimal_places property :currency_symbol + property :dimension_units property :decimal_separator property :thousands_separator - property :decimal_places + property :dimension_decimal_token + property :currency_symbol_location property :dimension_decimal_places - property :dimension_decimal_token + property :active_comparison_modules property :dimension_thousands_token - property :currency_symbol_location property :is_price_entered_with_tax - property :active_comparison_modules - property :weight_units - property :dimension_units - property :plan_name - property :logo def self.info get path.build
Add attributes to store information endpoint
diff --git a/lib/active_model/serializer/railtie.rb b/lib/active_model/serializer/railtie.rb index abc1234..def5678 100644 --- a/lib/active_model/serializer/railtie.rb +++ b/lib/active_model/serializer/railtie.rb @@ -1,10 +1,9 @@ module ActiveModel class Railtie < Rails::Railtie initializer 'generators' do |app| - require 'rails/generators' + app.load_generators require 'active_model/serializer/generators/serializer/serializer_generator' require 'active_model/serializer/generators/serializer/scaffold_controller_generator' - Rails::Generators.configure!(app.config.generators) require 'active_model/serializer/generators/resource_override' end end
Make sure generator hooks get run Use Rails::Engine#load_generators instead of require + Rails::Generators::configure!.
diff --git a/lib/acts_as_notifiable/notification.rb b/lib/acts_as_notifiable/notification.rb index abc1234..def5678 100644 --- a/lib/acts_as_notifiable/notification.rb +++ b/lib/acts_as_notifiable/notification.rb @@ -1,18 +1,31 @@ module ActsAsNotifiable - class Notification < ActiveRecord::Base - include ActsAsNotifiable::DeliveryMethods + module Notification + extend ActiveSupport::Concern - before_create :notifiable_before_create - after_create :notifiable_after_create + included do + class_eval do + include ActsAsNotifiable::DeliveryMethods + + before_create :notifiable_before_create + after_create :notifiable_after_create + + scope :apn, where(:apns => true) + scope :unprocessed, where(:apn_processed => false) + end + end def notifiable_before_create notifiable_callback(notifiable, :before_create) notifiable_callback(self, :before_create) + + true end def notifiable_after_create notifiable_callback(notifiable, :after_create) notifiable_callback(self, :after_create) + + true end def notifiable_callback(obj, chain)
Use composition instead of inheritance for base ActsAsNotifiable::Notification
diff --git a/spec/elasticsearch/motd_product_spec.rb b/spec/elasticsearch/motd_product_spec.rb index abc1234..def5678 100644 --- a/spec/elasticsearch/motd_product_spec.rb +++ b/spec/elasticsearch/motd_product_spec.rb @@ -4,6 +4,6 @@ describe file('/etc/product') do it { should be_file } - it { should contain "Base Image: #{attr[:base_name]} #{attr[:base_version]}" } + it { should contain "Base Image: #{property[:base_name]} #{property[:base_version]}" } end
Update for latest version of serverspec
diff --git a/spec/features/admin/newsletters_spec.rb b/spec/features/admin/newsletters_spec.rb index abc1234..def5678 100644 --- a/spec/features/admin/newsletters_spec.rb +++ b/spec/features/admin/newsletters_spec.rb @@ -0,0 +1,22 @@+require 'rails_helper' + +feature 'Admin newsletters emails' do + + let(:download_button_text) { 'Download zip with users list' } + + background do + @admin = create(:administrator) + login_as(@admin.user) + visit admin_newsletters_path + end + + scenario 'Index' do + expect(page).to have_content download_button_text + end + + scenario 'Download newsletter email zip' do + click_link download_button_text + expect( Zip::InputStream.open(StringIO.new(page.body)).get_next_entry.get_input_stream {|is| is.read } ).to include @admin.user.email + end +end +
Add feature scenario for Newsletter admin section, including email zip download
diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index abc1234..def5678 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -0,0 +1,9 @@+require 'rails_helper' + +RSpec.describe ApplicationHelper do + describe 'markdown' do + it 'converts the provided markdown source to html' do + expect(markdown('# hello')).to eql("<h1 id=\"hello\">hello</h1>\n") + end + end +end
Test that markdown helper works
diff --git a/lib/vagrant-proxyconf/cap/linux/docker_proxy_conf.rb b/lib/vagrant-proxyconf/cap/linux/docker_proxy_conf.rb index abc1234..def5678 100644 --- a/lib/vagrant-proxyconf/cap/linux/docker_proxy_conf.rb +++ b/lib/vagrant-proxyconf/cap/linux/docker_proxy_conf.rb @@ -17,6 +17,21 @@ "/etc/sysconfig/#{docker_command}" elsif machine.communicate.test('ls /var/lib/boot2docker/') "/var/lib/boot2docker/profile" + elsif machine.communicate.test('ps -p1 | grep systemd') + machine.communicate.tap do |comm| + src_file = "/lib/systemd/system/#{docker_command}.service" + dst_file = "/etc/systemd/system/#{docker_command}.service" + tmp_file = "/tmp/#{docker_command}.service" + env_file = "EnvironmentFile=-\\/etc\\/default\\/#{docker_command}" + comm.sudo("sed -e 's/\\[Service\\]/[Service]\\n#{env_file}/g' #{src_file} > #{tmp_file}") + unless comm.test("diff #{tmp_file} #{dst_file}") + # update config and restart docker when config changed + comm.sudo("mv -f #{tmp_file} #{dst_file}") + comm.sudo('systemctl daemon-reload') + end + comm.sudo("rm -f #{tmp_file}") + end + "/etc/default/#{docker_command}" else "/etc/default/#{docker_command}" end
Use the coreOS style configuration for systemd-based Ubuntu/Deb hosts.
diff --git a/spec/locotimezone/configuration_spec.rb b/spec/locotimezone/configuration_spec.rb index abc1234..def5678 100644 --- a/spec/locotimezone/configuration_spec.rb +++ b/spec/locotimezone/configuration_spec.rb @@ -0,0 +1,73 @@+require 'spec_helper' + +describe 'Configuring Locotimezone' do + let :default_attributes do + { + latitude: :latitude, + longitude: :longitude, + timezone_id: :timezone_id + } + end + + subject do + Locotimezone + end + + before :each do + subject.configure { |config| config.google_api_key = '123' } + end + + it 'configures with an API key' do + expect(subject.configuration.google_api_key).to eq '123' + end + + it 'sets default data model attributes' do + expect(subject.configuration.attributes).to eq default_attributes + end + + describe 'overriding default attributes' do + before :each do + subject.configure do |config| + config.attributes = { + latitude: :lat, + longitude: :lng, + timezone_id: :tid + } + end + end + + it 'overrides the latitude default' do + expect(subject.configuration.attributes[:latitude]).to eq :lat + end + + it 'overrides the longitude default' do + expect(subject.configuration.attributes[:longitude]).to eq :lng + end + + it 'overrides the timezone default' do + expect(subject.configuration.attributes[:timezone_id]).to eq :tid + end + end + + describe 'resetting the configuration' do + before :each do + subject.configure do |config| + config.google_api_key = '123' + config.attributes = { + latitude: :lat, + longitude: :lng, + timezone_id: :tid + } + end + subject.reset_configuration + end + + it 'clears the API key' do + expect(subject.configuration.google_api_key).to be nil + end + + it 'resets the attributes back to the defaults' do + expect(subject.configuration.attributes).to eq default_attributes + end + end +end
Convert configuration test to spec
diff --git a/Casks/order-of-twilight.rb b/Casks/order-of-twilight.rb index abc1234..def5678 100644 --- a/Casks/order-of-twilight.rb +++ b/Casks/order-of-twilight.rb @@ -0,0 +1,10 @@+class OrderOfTwilight < Cask + version :latest + sha256 :no_check + + url 'http://stabyourself.net/dl.php?file=orderoftwilight/orderoftwilight-osx.zip' + homepage 'http://stabyourself.net/orderoftwilight/' + license :oss + + app 'Order of Twilight.app' +end
Add Order of Twilight cask
diff --git a/Casks/you-need-a-budget.rb b/Casks/you-need-a-budget.rb index abc1234..def5678 100644 --- a/Casks/you-need-a-budget.rb +++ b/Casks/you-need-a-budget.rb @@ -0,0 +1,6 @@+class YouNeedABudget < Cask + url 'http://www.youneedabudget.com/CDNOrigin/download/ynab4/liveCaptive/Mac/YNAB4_LiveCaptive_4.1.553.dmg' + homepage 'http://www.youneedabudget.com/' + version '4.1.553' + sha1 'bf10b82ecf741d4655ab864717e307eb1858e385' +end
Add You Need A Budget
diff --git a/UPnAtom.podspec b/UPnAtom.podspec index abc1234..def5678 100644 --- a/UPnAtom.podspec +++ b/UPnAtom.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'UPnAtom' - s.version = '0.0.1.beta.2' + s.version = '0.0.1.beta.3' s.license = { :type => 'MIT', :file => 'LICENSE' } s.summary = 'An open source Universal Plug and Play library with a focus on media streaming coordination using the UPnP A/V profile.' s.homepage = 'https://github.com/master-nevi/UPnAtom'
Update cocoa pod version for release.
diff --git a/Casks/gog-galaxy.rb b/Casks/gog-galaxy.rb index abc1234..def5678 100644 --- a/Casks/gog-galaxy.rb +++ b/Casks/gog-galaxy.rb @@ -0,0 +1,15 @@+cask :v1 => 'gog-galaxy' do + version '1.0.0.836' + sha256 '878319173e0f157981fd3d5009e451653024bdb8e3b4f0ff5565c491ba815f4d' + + url "http://cdn.gog.com/open/galaxy/client/galaxy_client_#{version}.pkg" + name 'GOG Galaxy Client' + homepage 'http://www.gog.com/galaxy' + license :gratis + tags :vendor => 'GOG' + + pkg "galaxy_client_#{version}.pkg" + + uninstall :pkgutil => "com.gog.galaxy.galaxy_client_#{version}.pkg", + :delete => '/Applications/GalaxyClient.app' +end
Add GOG.com Galaxy Client v1.0.0.836 Fix trailing whitespace in GOG.com Galaxy Client Cask
diff --git a/Casks/opera-beta.rb b/Casks/opera-beta.rb index abc1234..def5678 100644 --- a/Casks/opera-beta.rb +++ b/Casks/opera-beta.rb @@ -1,6 +1,6 @@ cask :v1 => 'opera-beta' do - version '29.0.1795.35' - sha256 '0b6ee1cad2b335bd95c1c77c24e13fabad80419f430a91e10ea62a4574064cac' + version '29.0.1795.41' + sha256 'e7f013637993189ee96409fd647bbc00fa94bde544e2604c36cde230ad717063' url "http://get.geo.opera.com/pub/opera-beta/#{version}/mac/Opera_beta_#{version}_Setup.dmg" homepage 'http://www.opera.com/computer/beta'
Upgrade Opera Beta.app to v29.0.1795.41
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -12,3 +12,4 @@ supports 'ubuntu' supports 'centos', '~> 6.0' +supports 'amazon'
Add support for Amazon Linux
diff --git a/DBCamera.podspec b/DBCamera.podspec index abc1234..def5678 100644 --- a/DBCamera.podspec +++ b/DBCamera.podspec @@ -9,7 +9,7 @@ s.platform = :ios, '6.0' s.requires_arc = true - s.dependency 'CLImageEditor/AllTools', '0.0.8' + s.dependency 'CLImageEditor/AllTools', '0.0.9' s.source_files = 'DBCamera/*.{h,m}' s.resource = ['DBCamera/Resources/*.{xib,xcassets}', 'DBCamera/Localizations/**']
Use new version of CLImageEditor Option to set black theme Signed-off-by: Ross Gallagher <43dae9a5c38ae5bc7931494ec65ea7b344ce97f5@rossgallagher.co.uk>
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -3,6 +3,6 @@ maintainer_email 'ops@simple.com' license 'Apache 2.0' description 'Installs RabbitMQ, an Erlang message queue application' -version '1.0.0' +version '1.1.0' depends 'erlang'
[1.1.0] Allow hashes as values/input to config parameters
diff --git a/lib/kafka/protocol/produce_response.rb b/lib/kafka/protocol/produce_response.rb index abc1234..def5678 100644 --- a/lib/kafka/protocol/produce_response.rb +++ b/lib/kafka/protocol/produce_response.rb @@ -45,7 +45,7 @@ partition: decoder.int32, error_code: decoder.int16, offset: decoder.int64, - timestamp: decoder.int64, + timestamp: Time.at(decoder.int64/1000.0), ) end
Convert the timestamp to a Time object
diff --git a/spec/qb_integration/service/account_spec.rb b/spec/qb_integration/service/account_spec.rb index abc1234..def5678 100644 --- a/spec/qb_integration/service/account_spec.rb +++ b/spec/qb_integration/service/account_spec.rb @@ -12,7 +12,7 @@ account = subject.find_by_name "Inventory Asset" expect(account.id).to be - expect(account.active).to be + expect(account).to be_active expect(account.name).to eq "Inventory Asset" end end
Use new quickbooks-ruby api for booleans
diff --git a/AppController.rb b/AppController.rb index abc1234..def5678 100644 --- a/AppController.rb +++ b/AppController.rb @@ -34,8 +34,18 @@ @webview_controller.load_url "http://127.0.0.1:3301/?q=#{search_field.stringValue.to_s}" end + def webViewFinishedLoading(aNotification) + @searchProgressIndicator.stopAnimation(nil) + end + + def applicationDidFinishLaunching(aNotification) + OSX::NSNotificationCenter.defaultCenter.objc_send :addObserver, self, + :selector, 'webViewFinishedLoading:', + :name, OSX::WebViewProgressFinishedNotification, + :object, nil + end + def applicationWillTerminate(aNotification) - puts 'quit' @camp_kari.terminate end
Stop the progress indicator when the webview posts a "done loading" notification. git-svn-id: f20da03e3c54bdd0425edde46a83a0733af7cd3b@18 7a99d2f0-d533-0410-96fe-f25cb2755c1e
diff --git a/lib/swagger_docs_generator/metadata.rb b/lib/swagger_docs_generator/metadata.rb index abc1234..def5678 100644 --- a/lib/swagger_docs_generator/metadata.rb +++ b/lib/swagger_docs_generator/metadata.rb @@ -14,7 +14,7 @@ def construct_swagger_file hash = {} SwaggerDocsGenerator::Metadata.protected_instance_methods.each do |method| - hash.merge!(send(method)) + hash.merge!(send(method)) unless @config.send(method).blank? end hash end
Test if element is empty
diff --git a/form_object_model.gemspec b/form_object_model.gemspec index abc1234..def5678 100644 --- a/form_object_model.gemspec +++ b/form_object_model.gemspec @@ -4,8 +4,8 @@ Gem::Specification.new do |gem| gem.authors = ["Sean Geoghegan", "Aaron Beckerman"] gem.email = ["sean@seangeo.me", "aaron@aaronbeckerman.com"] - gem.description = %q{An OO form testing helper that makes Capayaba-based form testing easy.} - gem.summary = %q{An OO form testing helper that makes Capayaba-based form testing easy.} + gem.description = %q{An OO form testing helper that makes Capybara-based form testing easy.} + gem.summary = %q{An OO form testing helper that makes Capybara-based form testing easy.} gem.homepage = "https://github.com/reinteractive-open/form-object-model" gem.files = `git ls-files`.split($\)
Fix typo in gem description and summary.
diff --git a/lib/outbrain/api/promoted_link_performance_report.rb b/lib/outbrain/api/promoted_link_performance_report.rb index abc1234..def5678 100644 --- a/lib/outbrain/api/promoted_link_performance_report.rb +++ b/lib/outbrain/api/promoted_link_performance_report.rb @@ -4,8 +4,8 @@ module Api class PromotedLinkPerformanceReport < Report PATH = 'performanceByPromotedLink' - - def self.path(campaign_id) + + def self.path(options) "campaigns/#{options.fetch(:campaign_id)}/#{PATH}/" end end
Fix path method for promoted links preformance report
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.3.0' + s.version = '0.4.0' s.license = 'MIT' s.summary = 'League of Legends chat service library for iOS and OS X.' s.homepage = 'https://github.com/jcouture/Folklore'
Set the version number to 0.4.0.
diff --git a/Formula/exult.rb b/Formula/exult.rb index abc1234..def5678 100644 --- a/Formula/exult.rb +++ b/Formula/exult.rb @@ -1,32 +1,31 @@ require 'formula' -# TODO we shouldn't be installing .apps if there is an option +class Exult <Formula + head 'http://exult.svn.sourceforge.net/svnroot/exult/exult/trunk', + :revision => '6317' + homepage 'http://exult.sourceforge.net/' -class Exult <Formula - # Use a specific revision that is known to compile (on Snow Leopard too.) - head 'http://exult.svn.sourceforge.net/svnroot/exult/exult/trunk', :revision => '6128' - homepage 'http://exult.sourceforge.net/' - depends_on 'sdl' depends_on 'sdl_mixer' - + depends_on 'libvorbis' + aka 'ultima7' - + def install # Yes, really. Goddamnit. inreplace "autogen.sh", "libtoolize", "glibtoolize" - + system "./autogen.sh" system "./configure", "--prefix=#{prefix}", "--disable-debug", "--disable-dependency-tracking", "--disable-sdltest" - + system "make" system "make bundle" prefix.install "Exult.app" end - + def caveats; "Cocoa app installed to #{prefix}\n\n"\ "Note that this includes only the game engine; you will need to supply your own\n"\
Update Exult and use vorbis.
diff --git a/Formula/maven.rb b/Formula/maven.rb index abc1234..def5678 100644 --- a/Formula/maven.rb +++ b/Formula/maven.rb @@ -1,7 +1,7 @@ require 'formula' class Maven <Formula - @url='http://apache.mirrors.timporter.net/maven/binaries/apache-maven-2.2.1-bin.tar.gz' + @url='http://www.apache.org/dist/maven/binaries/apache-maven-2.2.1-bin.tar.gz' @version="2.2.1" @homepage='http://maven.apache.org/' @md5='3f829ed854cbacdaca8f809e4954c916'
Use the backup Apache mirrors instead of another mirror that might go down unnoticed. Signed-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com>
diff --git a/stripe.gemspec b/stripe.gemspec index abc1234..def5678 100644 --- a/stripe.gemspec +++ b/stripe.gemspec @@ -24,5 +24,10 @@ lib/stripe.rb lib/stripe/version.rb lib/data/ca-certificates.crt + vendor/stripe-json/lib/json/pure.rb + vendor/stripe-json/lib/json/common.rb + vendor/stripe-json/lib/json/version.rb + vendor/stripe-json/lib/json/pure/generator.rb + vendor/stripe-json/lib/json/pure/parser.rb } end
Add vendored JSON to gemspec
diff --git a/spec/requests/users_spec.rb b/spec/requests/users_spec.rb index abc1234..def5678 100644 --- a/spec/requests/users_spec.rb +++ b/spec/requests/users_spec.rb @@ -0,0 +1,12 @@+require 'spec_helper' + +feature 'Users' do + background do + 1.upto(100) {|i| User.create! :name => "user#{'%03d' % i}" } + end + scenario 'Basic API pagination' do + visit '/users' + + JSON.parse(page.body).should == 1.upto(25).map {|i| "user#{'%03d' % i}" } + end +end
Make sure that kaminari works inside a Grape app
diff --git a/test/assets_test.rb b/test/assets_test.rb index abc1234..def5678 100644 --- a/test/assets_test.rb +++ b/test/assets_test.rb @@ -0,0 +1,34 @@+require 'test_helper' +require 'coffee-rails' + +class AssetsTest < ActiveSupport::TestCase + def setup + require "rails" + require "action_controller/railtie" + require "sprockets/railtie" + + @app = Class.new(Rails::Application) + @app.config.active_support.deprecation = :stderr + @app.config.assets.enabled = true + @app.config.assets.cache_store = [ :file_store, "#{tmp_path}/cache" ] + @app.paths["log"] = "#{tmp_path}/log/test.log" + @app.initialize! + end + + def teardown + FileUtils.rm_rf "#{tmp_path}/cache" + FileUtils.rm_rf "#{tmp_path}/log" + File.delete "#{tmp_path}/coffee-script.js" + end + + test "coffee-script.js is included in Sprockets environment" do + @app.assets["coffee-script"].write_to("#{tmp_path}/coffee-script.js") + + assert_match "/lib/assets/javascripts/coffee-script.js.erb", @app.assets["coffee-script"].pathname.to_s + assert_match "this.CoffeeScript", File.open("#{tmp_path}/coffee-script.js").read + end + + def tmp_path + "#{File.dirname(__FILE__)}/tmp" + end +end
Add test for inclusion of coffee-script.js in asset pipeline
diff --git a/test/helper.rb b/test/helper.rb index abc1234..def5678 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -1,8 +1,8 @@ require 'bundler/setup' require 'test/unit' -$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) -$LOAD_PATH.unshift(File.dirname(__FILE__)) +$LOAD_PATH.unshift(File.join(__dir__, '..', 'lib')) +$LOAD_PATH.unshift(__dir__) require 'fluent/test' unless ENV.has_key?('VERBOSE') nulllogger = Object.new
Use `__dir__` instead of `File.dirname(__FILE__)`
diff --git a/test/helper.rb b/test/helper.rb index abc1234..def5678 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -15,7 +15,7 @@ def test_configuration @config ||= Dimples::Configuration.new( 'source_path' => File.join(__dir__, 'source'), - 'destination_path' => File.join('tmp', "dimples-#{Time.new.to_i}"), + 'destination_path' => File.join(File::SEPARATOR, 'tmp', "dimples-#{Time.new.to_i}"), 'categories' => [{ 'slug' => 'a', 'name' => 'A' }] ) end
Switch back to using /tmp.
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 @@ -6,6 +6,23 @@ require 'knapsack_pro' # CUSTOM_CONFIG_GOES_HERE +KnapsackPro::Hooks::Queue.before_queue do |queue_id| + print '-'*20 + print 'Before Queue Hook - run before test suite' + print '-'*20 +end + +KnapsackPro::Hooks::Queue.after_subset_queue do |queue_id, subset_queue_id| + print '-'*20 + print 'After Subset Queue Hook - run after subset of test suite' + print '-'*20 +end + +KnapsackPro::Hooks::Queue.after_queue do |queue_id| + print '-'*20 + print 'After Queue Hook - run after test suite' + print '-'*20 +end knapsack_pro_adapter = KnapsackPro::Adapters::MinitestAdapter.bind knapsack_pro_adapter.set_test_helper_path(__FILE__)
Add queue mode hooks to minitest test helper
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 @@ -2,6 +2,8 @@ require 'minitest/unit' require 'purdytest' require 'did_you_mean' + +puts "DidYouMean version: #{DidYouMean::VERSION}" module DidYouMean::TestHelper def assert_correction(expected, array)
Print out the version of did you mean to test against
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 @@ -21,3 +21,11 @@ end end end + +class ActionView::TestCase + teardown :clear_html_cache + + def clear_html_cache + AssetHat.html_cache = {} + end +end
Clear AssetHat.html_cache after every test
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 @@ -18,10 +18,8 @@ def self.should_serialize_to_wire_format(*expected_bytes) should "serialize to the byte string [#{expected_bytes.map { |b| sprintf("%02X", b) }.join(' ')}]" do - actual = @message.to_wire_format - expected_bytes.each_with_index do |expected_byte, i| - assert_equal actual[i], expected_byte - end + actual_bytes = @message.to_wire_format.unpack('C*') + assert_equal actual_bytes, expected_bytes end end
Make sure the shoulda macro is checking the entire 'actual' array, not just the bytes that appear in the 'expected' value
diff --git a/tests/proxy_test.rb b/tests/proxy_test.rb index abc1234..def5678 100644 --- a/tests/proxy_test.rb +++ b/tests/proxy_test.rb @@ -24,13 +24,15 @@ timeout -= 1 end + response = nil + Net::HTTP.start('localhost', 8080) do |http| req = Net::HTTP::Get.new('/') req.basic_auth 'USERNAME', 'PASSWORD' response = http.request(req) - status = JSON.parse(response.body)['ok'] - assert_equal status, true end + + assert_equal "200", response.code end end
[TEST] Fix test for the Nginx proxy failing on Elasticsearch 1.0
diff --git a/db/migrate/20151211135032_create_heartbeats.rb b/db/migrate/20151211135032_create_heartbeats.rb index abc1234..def5678 100644 --- a/db/migrate/20151211135032_create_heartbeats.rb +++ b/db/migrate/20151211135032_create_heartbeats.rb @@ -3,8 +3,7 @@ create_table :heartbeats do |t| t.integer :device_id t.integer :reporting_device_id - - t.timestamps null: false + t.datetime :created_at, nil: false end end end
Remove updated_at column from heartbeats table
diff --git a/db/migrate/20160513160206_initial_migration.rb b/db/migrate/20160513160206_initial_migration.rb index abc1234..def5678 100644 --- a/db/migrate/20160513160206_initial_migration.rb +++ b/db/migrate/20160513160206_initial_migration.rb @@ -9,7 +9,7 @@ end create_table :tags do |t| - t.string :name + t.string :name, index: true t.timestamps null: false end
Add index to tags table in InitialMigration
diff --git a/mrbgem.rake b/mrbgem.rake index abc1234..def5678 100644 --- a/mrbgem.rake +++ b/mrbgem.rake @@ -4,11 +4,7 @@ spec.add_test_dependency 'mruby-io', :mgem => 'mruby-io' def maxminddb_origin_path - if File.exist?("../test/fixtures/GeoLite2-City.mmdb.gz") - "#{build.build_dir}/../../../test/fixtures/GeoLite2-City.mmdb" - else - "#{build.build_dir}/../mrbgems/mruby-maxminddb/test/fixtures/GeoLite2-City.mmdb" - end + "#{dir}/test/fixtures/GeoLite2-City.mmdb" end maxminddb_ci_path = "#{build.build_dir}/../maxminddb-fixtures/GeoLite2-City.mmdb"
Use `dir` method intead to get fixture path.
diff --git a/Kickflip.podspec b/Kickflip.podspec index abc1234..def5678 100644 --- a/Kickflip.podspec +++ b/Kickflip.podspec @@ -10,7 +10,7 @@ s.platform = :ios, '7.0' s.source = { :git => "https://github.com/Kickflip/kickflip-ios-sdk.git", :tag => "0.9" } - s.source_files = 'Kickflip', 'Kickflip/**/*.{h,m}' + s.source_files = 'Kickflip', 'Kickflip/**/*.{h,m,mm,cpp}' s.requires_arc = true
Make sure to add all the source files
diff --git a/thinreports.gemspec b/thinreports.gemspec index abc1234..def5678 100644 --- a/thinreports.gemspec +++ b/thinreports.gemspec @@ -16,8 +16,10 @@ s.required_ruby_version = '>= 2.4.0' - s.files = `git ls-files`.split($\) - s.require_path = 'lib' + s.files = Dir.chdir(File.expand_path('..', __FILE__)) do + `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^test/}) } + end + s.require_paths = ['lib'] s.add_dependency 'prawn', '~> 2.2.0'
Reduce size of the package file
diff --git a/spec/lib/rory/route_spec.rb b/spec/lib/rory/route_spec.rb index abc1234..def5678 100644 --- a/spec/lib/rory/route_spec.rb +++ b/spec/lib/rory/route_spec.rb @@ -5,4 +5,11 @@ expect(route.name).to eq 'pigeons_index' end end + + describe "#path_params" do + it "extracts params from path into hash" do + route = described_class.new('/spoons/:spoon_id/forks/:fork_id', :to => 'cutlery#index') + expect(route.path_params('spoons/4/forks/yay')).to eq({ :spoon_id => "4", :fork_id => "yay" }) + end + end end
Add a missing Route spec
diff --git a/spec/models/contact_spec.rb b/spec/models/contact_spec.rb index abc1234..def5678 100644 --- a/spec/models/contact_spec.rb +++ b/spec/models/contact_spec.rb @@ -0,0 +1,40 @@+require "spec_helper" + +describe Contact do + it "is valid with a firstname, lastname and email" do + contact = Contact.new( + firstname: "Aaron", + lastname: "Summer", + email: "tester@example.com" + ) + expect(contact).to be_valid + end + + it "is invalid without a firstname" do + expect(Contact.new(firstname: nil)).to have(1).errors_on(:firstname) + end + + it "is invalid withour a lastname" do + expect(Contact.new(lastname: nil)).to have(1).errors_on(:lastname) + end + + it "is invalid without an email address" do + expect(Contact.new(email: nil)).to have(1).errors_on(:email) + end + + it "is invalid with a duplicate email address" do + Contact.create( + firstname: "Joe", + lastname: "Tester", + email: "tester@example.com" + ) + contact = Contact.create( + firstname: "Jane", + lastname: "Tester", + email: "tester@example.com" + ) + expect(contact).to have(1).errors_on(:email) + end + + it "returns a contact's full name as a string" +end
Write specs of Contact model
diff --git a/lib/brain.rb b/lib/brain.rb index abc1234..def5678 100644 --- a/lib/brain.rb +++ b/lib/brain.rb @@ -21,8 +21,11 @@ end response = http.request req json_response = JSON.parse(response.body, symbolize_names: true) - yield response, json_response if block_given? - return response, json_response + if block_given? + yield response, json_response + else + return response, json_response + end end end
Return yield result if block was given
diff --git a/puppet-lint-duplicate_class_parameters-check.gemspec b/puppet-lint-duplicate_class_parameters-check.gemspec index abc1234..def5678 100644 --- a/puppet-lint-duplicate_class_parameters-check.gemspec +++ b/puppet-lint-duplicate_class_parameters-check.gemspec @@ -22,7 +22,7 @@ spec.add_development_dependency 'rspec', '~> 3.9.0' spec.add_development_dependency 'rspec-its', '~> 1.0' spec.add_development_dependency 'rspec-collection_matchers', '~> 1.0' - spec.add_development_dependency 'rubocop', '~> 0.83.0' + spec.add_development_dependency 'rubocop', '~> 0.84.0' spec.add_development_dependency 'rake', '~> 13.0.0' spec.add_development_dependency 'rspec-json_expectations', '~> 2.2' spec.add_development_dependency 'simplecov', '~> 0.18.0'
Update rubocop requirement from ~> 0.83.0 to ~> 0.84.0 Updates the requirements on [rubocop](https://github.com/rubocop-hq/rubocop) to permit the latest version. - [Release notes](https://github.com/rubocop-hq/rubocop/releases) - [Changelog](https://github.com/rubocop-hq/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop-hq/rubocop/compare/v0.83.0...v0.84.0) Signed-off-by: dependabot-preview[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com>
diff --git a/config/initializers/kaminari_config.rb b/config/initializers/kaminari_config.rb index abc1234..def5678 100644 --- a/config/initializers/kaminari_config.rb +++ b/config/initializers/kaminari_config.rb @@ -1,5 +1,5 @@ Kaminari.configure do |config| - config.default_per_page = 2 + config.default_per_page = 10 # config.max_per_page = nil # config.window = 4 # config.outer_window = 0
Change default per page to something sensible other than 2... lol
diff --git a/db/seeds/expense_types.rb b/db/seeds/expense_types.rb index abc1234..def5678 100644 --- a/db/seeds/expense_types.rb +++ b/db/seeds/expense_types.rb @@ -1,2 +1,14 @@-ExpenseType.find_or_create_by(name: 'Travel') -ExpenseType.find_or_create_by(name: 'Hotel') +[ + 'Conference and View - Car', + 'Conference and View - Hotel stay', + 'Conference and View - Train', + 'Conference and View - Travel time', + 'Costs Judge application fee', + 'Costs Judge Preparation award', + 'Travel and Hotel - Car', + 'Travel and Hotel - Conference and View', + 'Travel and Hotel - Hotel stay', + 'Travel and Hotel - Train', +].each do |expense_type_name| + ExpenseType.find_or_create_by!(name: expense_type_name) +end
Set up default expense types
diff --git a/pages/spec/lib/pages_spec.rb b/pages/spec/lib/pages_spec.rb index abc1234..def5678 100644 --- a/pages/spec/lib/pages_spec.rb +++ b/pages/spec/lib/pages_spec.rb @@ -26,7 +26,32 @@ describe ".default_parts_for" do context "with no view template" do it "returns the default page parts" do - expect(subject.default_parts_for(Page.new)).to eq subject.default_parts_for + expect(subject.default_parts_for(Page.new)).to eq subject.default_parts + end + end + + context "with registered type" do + let(:type_name) { "custom_type" } + before { Pages::Types.registered.register(type_name) { |type| type.parts = type_parts } } + after { Pages::Types.registered.delete(Pages::Types.registered.find_by_name(type_name)) } + + context "page parts specified as array of hashes (part attributes)" do + let(:type_parts) { [{slug: "body", title: "Body"}] } + it "returns the parts for the type" do + type_parts = Pages::Types.registered.find_by_name(type_name).parts + page = Page.new(view_template: type_name) + expect(subject.default_parts_for(page)).to eq type_parts + end + end + + context "page parts specified as array of strings" do + let(:type_parts) { %w[Body] } + it "returns the parts for the type as a hash" do + page = Page.new(view_template: type_name) + expect(subject.default_parts_for(page)).to eq [{slug: "body", title: "Body"}] + end + + xit "warns that this configuration format is deprecated" end end end
Implement failing tests that demonstrate the desired behaviour
diff --git a/spec/controllers/activity_streams/photos_controller_spec.rb b/spec/controllers/activity_streams/photos_controller_spec.rb index abc1234..def5678 100644 --- a/spec/controllers/activity_streams/photos_controller_spec.rb +++ b/spec/controllers/activity_streams/photos_controller_spec.rb @@ -0,0 +1,30 @@+require 'spec_helper' + +describe ActivityStreams::PhotosController do + describe '#create' do + before do + @json = JSON.parse <<JSON + {"activity":{"actor":{"url":"http://cubbi.es/daniel","displayName":"daniel","objectType":"person"},"published":"2011-05-19T18:12:23Z","verb":"save","object":{"objectType":"photo","url":"http://i658.photobucket.com/albums/uu308/R3b3lAp3/Swagger_dog.jpg","image":{"url":"http://i658.photobucket.com/albums/uu308/R3b3lAp3/Swagger_dog.jpg","width":637,"height":469}},"provider":{"url":"http://cubbi.es/","displayName":"Cubbi.es"}}} +JSON + end + it 'allows token authentication' do + bob.reset_authentication_token! + get :create, @json.merge!(:auth_token => bob.authentication_token) + response.should be_success + warden.should be_authenticated + end + + # It is unclear why this test fails. An equivalent cucumber feature passes in features/logs_in_and_out.feature. +=begin + it 'does not store a session' do + bob.reset_authentication_token! + get :create, @json.merge!(:auth_token => bob.authentication_token) + photo = ActivityStreams::Photo.where(:author_id => bob.person.id).first + warden.should be_authenticated + get :show, :id => photo.id + warden.should_not be_authenticated + response.should redirect_to new_user_session_path + end +=end + end +end
Add in photoscontroller spec for as
diff --git a/homebrew/terraform-inventory.rb b/homebrew/terraform-inventory.rb index abc1234..def5678 100644 --- a/homebrew/terraform-inventory.rb +++ b/homebrew/terraform-inventory.rb @@ -3,8 +3,8 @@ head "https://github.com/adammck/terraform-inventory.git" # Update these when a new version is released - url "https://github.com/adammck/terraform-inventory/archive/v0.4.tar.gz" - sha1 "e878196877f068d49970c7f2b1ce32cc09a6ee02" + url "https://github.com/adammck/terraform-inventory/archive/v0.5.tar.gz" + sha1 "8dcb83171d5cf323d6d4a52779f91aeaed2f195e" depends_on "go" => :build
Update homebrew script to download version 0.5
diff --git a/app/models/web_hook.rb b/app/models/web_hook.rb index abc1234..def5678 100644 --- a/app/models/web_hook.rb +++ b/app/models/web_hook.rb @@ -9,7 +9,7 @@ validates :url, presence: true, format: { - with: /(^$)|(^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$)/ix, + with: URI::regexp(%w(http https)), message: "should be a valid url" } def execute(data)
Use URI::regexp for validating WebHook urls
diff --git a/lib/active_merchant/billing/integrations/ipay88.rb b/lib/active_merchant/billing/integrations/ipay88.rb index abc1234..def5678 100644 --- a/lib/active_merchant/billing/integrations/ipay88.rb +++ b/lib/active_merchant/billing/integrations/ipay88.rb @@ -21,14 +21,14 @@ self.merch_key = key end - # The requery URL upon returning from iPay88 + # The URL to POST your payment form to def self.service_url - "https://www.mobile88.com/epayment/enquiry.asp" + "https://www.mobile88.com/epayment/entry.asp" end - # The URL to POST your payment form to + # The requery URL upon returning from iPay88 def self.entry_url - "https://www.mobile88.com/epayment/entry.asp" + "https://www.mobile88.com/epayment/enquiry.asp" end def self.return(query_string)
Swap service_url and entry_url to play nice with ActiveMerchant's payment_service_for view helper
diff --git a/lib/active_support/cache/memcached_snappy_store.rb b/lib/active_support/cache/memcached_snappy_store.rb index abc1234..def5678 100644 --- a/lib/active_support/cache/memcached_snappy_store.rb +++ b/lib/active_support/cache/memcached_snappy_store.rb @@ -32,8 +32,6 @@ def deserialize_entry(compressed_value) decompressed_value = compressed_value.nil? ? compressed_value : Snappy.inflate(compressed_value) super(decompressed_value) - rescue Snappy::Error - nil end end end
Remove no longer necessary rescue Snappy::Error.
diff --git a/guideline.gemspec b/guideline.gemspec index abc1234..def5678 100644 --- a/guideline.gemspec +++ b/guideline.gemspec @@ -7,10 +7,10 @@ gem.name = "guideline" gem.version = Guideline::VERSION gem.authors = ["Ryo NAKAMURA"] - gem.email = ["ryo-nakamura@cookpad.com"] - gem.description = %q{TODO: Write a gem description} - gem.summary = %q{TODO: Write a gem summary} - gem.homepage = "" + gem.email = ["r7kamura@gmail.com"] + gem.description = "Guideline.gem checks if your code observes your coding guidelines" + gem.summary = "The guideline of your code" + gem.homepage = "https://github.com/r7kamura/guideline" gem.files = `git ls-files`.split($/) gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
Write the detail of gemspec
diff --git a/lib/fog/hp/requests/compute_v2/list_servers.rb b/lib/fog/hp/requests/compute_v2/list_servers.rb index abc1234..def5678 100644 --- a/lib/fog/hp/requests/compute_v2/list_servers.rb +++ b/lib/fog/hp/requests/compute_v2/list_servers.rb @@ -4,6 +4,9 @@ class Real # List all servers (IDs and names only) + # + # ==== Parameters + # * options<~Hash>: # # ==== Returns # * response<~Excon::Response>: @@ -12,11 +15,12 @@ # * 'id'<~Integer> - UUId of server # * 'name'<~String> - Name of server # * 'links'<~Array> - array of server links - def list_servers + def list_servers(options = {}) request( :expects => 200, :method => 'GET', - :path => 'servers' + :path => 'servers', + :query => options ) end @@ -24,12 +28,12 @@ class Mock - def list_servers + def list_servers(options = {}) response = Excon::Response.new data = list_servers_detail.body['servers'] servers = [] for server in data - servers << server.reject { |key, value| !['id', 'name', 'links', 'uuid'].include?(key) } + servers << server.reject { |key, value| !['id', 'name', 'links'].include?(key) } end response.status = 200 response.body = { 'servers' => servers }
[hp|compute_v2] Add filter options to query for servers.
diff --git a/spec/features/fluentd/setting/out_stdout_spec.rb b/spec/features/fluentd/setting/out_stdout_spec.rb index abc1234..def5678 100644 --- a/spec/features/fluentd/setting/out_stdout_spec.rb +++ b/spec/features/fluentd/setting/out_stdout_spec.rb @@ -2,6 +2,6 @@ describe "out_stdout", stub: :daemon do before { login_with exists_user } - it_should_behave_like "configurable daemon settings", "out_stdout", "match", "stdout.**" + it_should_behave_like "configurable daemon settings", "out_stdout", "pattern", "stdout.**" end
Use `pattern` instead of `match` Signed-off-by: Kenji Okimoto <7a4b90a0a1e6fc688adec907898b6822ce215e6c@clear-code.com>
diff --git a/cocoaseeds.gemspec b/cocoaseeds.gemspec index abc1234..def5678 100644 --- a/cocoaseeds.gemspec +++ b/cocoaseeds.gemspec @@ -23,7 +23,7 @@ s.executables = %w{ seed } s.require_paths = %w{ lib } - s.add_runtime_dependency "xcodeproj", "~> 1.0.0" + s.add_runtime_dependency "xcodeproj", ">= 0.28" s.add_runtime_dependency "colorize", "~> 0.7.0" s.required_ruby_version = ">= 2.0.0"
Make the version check more liberal
diff --git a/cookbooks/lib/features/mongodb_spec.rb b/cookbooks/lib/features/mongodb_spec.rb index abc1234..def5678 100644 --- a/cookbooks/lib/features/mongodb_spec.rb +++ b/cookbooks/lib/features/mongodb_spec.rb @@ -24,8 +24,9 @@ before :all do sh("sudo service #{mongodb_service_name} start") procwait(/\bmongod\b/) + sleep 3 # HACK: thanks a bunch, Mongo sh('mongo --eval "db.testData.insert( { x : 6 } );"') - sleep 3 # HACK: thanks a bunch, Mongo + sleep 3 # HACK: thanks a bunch more, Mongo end after :all do
Add even more sleepies to the mongo specs
diff --git a/core/app/mailers/spree/order_mailer.rb b/core/app/mailers/spree/order_mailer.rb index abc1234..def5678 100644 --- a/core/app/mailers/spree/order_mailer.rb +++ b/core/app/mailers/spree/order_mailer.rb @@ -1,26 +1,35 @@ module Spree class OrderMailer < BaseMailer def confirm_email(order, resend = false) - @order = order.respond_to?(:id) ? order : Spree::Order.find(order) - subject = (resend ? "[#{Spree.t(:resend).upcase}] " : '') - subject += "#{Spree::Store.current.name} #{Spree.t('order_mailer.confirm_email.subject')} ##{@order.number}" + @order = find_order(order) + subject = build_subject(Spree.t('order_mailer.confirm_email.subject'), resend) + mail(to: @order.email, from: from_address, subject: subject) end def cancel_email(order, resend = false) - @order = order.respond_to?(:id) ? order : Spree::Order.find(order) - subject = (resend ? "[#{Spree.t(:resend).upcase}] " : '') - subject += "#{Spree::Store.current.name} #{Spree.t('order_mailer.cancel_email.subject')} ##{@order.number}" + @order = find_order(order) + subject = build_subject(Spree.t('order_mailer.cancel_email.subject'), resend) + mail(to: @order.email, from: from_address, subject: subject) end def inventory_cancellation_email(order, inventory_units, resend = false) - @order = order - @inventory_units = inventory_units + @order, @inventory_units = find_order(order), inventory_units + subject = build_subject(Spree.t('order_mailer.inventory_cancellation.subject'), resend) + mail(to: @order.email, from: from_address, subject: subject) + end + + private + + def find_order(order) + @order = order.respond_to?(:id) ? order : Spree::Order.find(order) + end + + def build_subject(subject_text, resend) subject = (resend ? "[#{Spree.t(:resend).upcase}] " : '') - subject += "#{Spree::Config[:site_name]} #{Spree.t('order_mailer.inventory_cancellation.subject')} ##{@order.number}" - mail(to: @order.email, from: from_address, subject: subject) + subject += "#{Spree::Config[:site_name]} #{subject_text} ##{@order.number}" end end end
Refactor order mailer for code reuse Conflicts: core/app/mailers/spree/order_mailer.rb
diff --git a/lib/bulk_processor/job.rb b/lib/bulk_processor/job.rb index abc1234..def5678 100644 --- a/lib/bulk_processor/job.rb +++ b/lib/bulk_processor/job.rb @@ -18,11 +18,9 @@ end end handler_class.complete(payload, successes, failures, nil) - rescue => error - handler_class.complete(payload, successes, failures, error) rescue Exception => exception handler_class.complete(payload, successes, failures, exception) - raise + raise unless exception.is_a?(StandardError) end end end
Simplify exception handling in Job
diff --git a/lib/cooperator/context.rb b/lib/cooperator/context.rb index abc1234..def5678 100644 --- a/lib/cooperator/context.rb +++ b/lib/cooperator/context.rb @@ -29,7 +29,7 @@ end def failure? - _failure + self[:_failure] end def include?(key)
Use new accessor for failure predicate
diff --git a/vendor/rspec_on_rails/lib/tasks/bootstrap_rspec.rake b/vendor/rspec_on_rails/lib/tasks/bootstrap_rspec.rake index abc1234..def5678 100644 --- a/vendor/rspec_on_rails/lib/tasks/bootstrap_rspec.rake +++ b/vendor/rspec_on_rails/lib/tasks/bootstrap_rspec.rake @@ -1,4 +1,8 @@-task :pre_commit => [:clobber_sqlite, :migrate, :generate_rspec, :specs, :spec] +# We have to make sure the rspec lib above gets loaded rather than the gem one (in case it's installed) +$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + '/../../../../lib')) +require 'spec/rake/spectask' + +task :pre_commit => [:clobber_sqlite, :migrate, :generate_rspec, :spec, :specs] task :clobber_sqlite do rm_rf 'db/*.db' @@ -9,9 +13,8 @@ raise "Failed to generate rspec environment" if $? != 0 end -task :specs do - command = "spec specs" - puts `#{command}` - raise "rspec_on_rails specs failed (stand in ~/vendor/rspec_on_rails and run '#{command}' to see details)" if $? != 0 +desc "Run the specs for RSpec on Rails itself" +Spec::Rake::SpecTask.new(:specs) do |t| + t.spec_files = FileList['specs/*_spec.rb'] end
Make sure we load the rspec above, not the gem git-svn-id: f1a1267e29db6ed751edc5bdb54cf7d87c16124a@852 410327ef-2207-0410-a325-f78bbcb22a5a
diff --git a/lib/catarse_stripe/engine.rb b/lib/catarse_stripe/engine.rb index abc1234..def5678 100644 --- a/lib/catarse_stripe/engine.rb +++ b/lib/catarse_stripe/engine.rb @@ -7,13 +7,13 @@ class Mapper def mount_catarse_stripe_at(catarse_stripe) scope :payment do - get '/stripe/:id/review' => 'catarse_stripe/payment/stripe#review', :as => 'review_stripe' - post '/stripe/notifications' => 'catarse_stripe/payment/stripe#ipn', :as => 'ipn_stripe' - match '/stripe/:id/notifications' => 'catarse_stripe/payment/stripe#notifications', :as => 'notifications_stripe' - match '/stripe/:id/pay' => 'catarse_stripe/payment/stripe#pay', :as => 'pay_stripe' - match '/stripe/:id/success' => 'catarse_stripe/payment/stripe#success', :as => 'success_stripe' - match '/stripe/:id/cancel' => 'catarse_stripe/payment/stripe#cancel', :as => 'cancel_stripe' - match '/stripe/:id/charge' => 'catarse_stripe/payment/stripe#charge', :as => 'charge_stripe' + get '/payment/stripe/:id/review' => 'catarse_stripe/payment/stripe#review', :as => 'payment_review_stripe' + post '/payment/stripe/notifications' => 'catarse_stripe/payment/stripe#ipn', :as => 'payment_ipn_stripe' + match '/payment/stripe/:id/notifications' => 'catarse_stripe/payment/stripe#notifications', :as => 'payment_notifications_stripe' + match '/payment/stripe/:id/pay' => 'catarse_stripe/payment/stripe#pay', :as => 'payment_pay_stripe' + match '/payment/stripe/:id/success' => 'catarse_stripe/payment/stripe#success', :as => 'payment_success_stripe' + match '/payment/stripe/:id/cancel' => 'catarse_stripe/payment/stripe#cancel', :as => 'payment_cancel_stripe' + match '/payment/stripe/:id/charge' => 'catarse_stripe/payment/stripe#charge', :as => 'payment_charge_stripe' end end end
Change route to share application
diff --git a/lib/ettu/configuration.rb b/lib/ettu/configuration.rb index abc1234..def5678 100644 --- a/lib/ettu/configuration.rb +++ b/lib/ettu/configuration.rb @@ -45,7 +45,7 @@ class LateLoadAssets < LateLoad def defaults - Array.new(::ActionView::Base.assets_manifest.assets.keys) + ::ActionView::Base.assets_manifest.assets.keys end end end
Fix recursion error in JRuby and RBX
diff --git a/lib/frecon/base/object.rb b/lib/frecon/base/object.rb index abc1234..def5678 100644 --- a/lib/frecon/base/object.rb +++ b/lib/frecon/base/object.rb @@ -8,5 +8,9 @@ # <http://opensource.org/licenses/MIT>. class Object + + # Alias #is_a? to #is_an?. This allows us to write more + # proper-English-y code. alias_method :is_an?, :is_a? + end
Add a little bit of explanation for the Object class (and whitespace)
diff --git a/lib/ice_cube/null_i18n.rb b/lib/ice_cube/null_i18n.rb index abc1234..def5678 100644 --- a/lib/ice_cube/null_i18n.rb +++ b/lib/ice_cube/null_i18n.rb @@ -7,13 +7,19 @@ base = base[options[:count] == 1 ? "one" : "other"] if options[:count] - if base.is_a?(Hash) - return base.each_with_object({}) do |(key, value), hash| - hash[key.is_a?(String) ? key.to_sym : key] = value + case base + when Hash + base.each_with_object({}) do |(k, v), hash| + hash[k.is_a?(String) ? k.to_sym : k] = v end + when Array + base.each_with_index.each_with_object({}) do |(v, k), hash| + hash[k] = v + end + else + return base unless base.include?('%{') + base % options end - - options.reduce(base) { |result, (find, replace)| result.gsub("%{#{find}}", "#{replace}") } end def self.l(date_or_time, options = {})
Use % string interpolation for translations Instead of traversing the string to replace multiple options, use built-in ruby methods to interpolate string templates in a single pass.
diff --git a/lib/iridium/dev_server.rb b/lib/iridium/dev_server.rb index abc1234..def5678 100644 --- a/lib/iridium/dev_server.rb +++ b/lib/iridium/dev_server.rb @@ -11,6 +11,8 @@ def app Rack::Builder.new do + use Middleware::RackLintCompatibility + Iridium.application.config.middleware.each do |middleware| use middleware.name, *middleware.args, &middleware.block end
Use rack lint campat in dev
diff --git a/lib/factory_girl/strategy.rb b/lib/factory_girl/strategy.rb index abc1234..def5678 100644 --- a/lib/factory_girl/strategy.rb +++ b/lib/factory_girl/strategy.rb @@ -9,38 +9,6 @@ class Strategy #:nodoc: include Observable - # Generates an association using the current build strategy. - # - # Arguments: - # name: (Symbol) - # The name of the factory that should be used to generate this - # association. - # attributes: (Hash) - # A hash of attributes that should be overridden for this association. - # - # Returns: - # The generated association for the current build strategy. Note that - # associations are not generated for the attributes_for strategy. Returns - # nil in this case. - # - # Example: - # - # factory :user do - # # ... - # end - # - # factory :post do - # # ... - # author { |post| post.association(:user, :name => 'Joe') } - # end - # - # # Builds (but doesn't save) a Post and a User - # FactoryGirl.build(:post) - # - # # Builds and saves a User, builds a Post, assigns the User to the - # # author association, and saves the Post. - # FactoryGirl.create(:post) - # def association(runner, overrides) raise NotImplementedError, "Strategies must return an association" end
Remove comment since the behavior it describes has been moved
diff --git a/rubicure_fuzzy_match.gemspec b/rubicure_fuzzy_match.gemspec index abc1234..def5678 100644 --- a/rubicure_fuzzy_match.gemspec +++ b/rubicure_fuzzy_match.gemspec @@ -22,7 +22,7 @@ spec.add_dependency "rubicure", "~> 0.4.7" spec.add_dependency "fuzzy_match", "~> 2.1.0" - spec.add_development_dependency "bundler", "~> 1.11" + spec.add_development_dependency "bundler", "~> 1.12" spec.add_development_dependency "rake", "~> 10.0" spec.add_development_dependency "test-unit", "~> 3.2.1" end
Upgrade bundler version to "~> 1.12"
diff --git a/db/data_migration/20130408135638_detailed_guidance_categories_for_defra.rb b/db/data_migration/20130408135638_detailed_guidance_categories_for_defra.rb index abc1234..def5678 100644 --- a/db/data_migration/20130408135638_detailed_guidance_categories_for_defra.rb +++ b/db/data_migration/20130408135638_detailed_guidance_categories_for_defra.rb @@ -0,0 +1,47 @@+defra_categories = [ + { + parent_title: "Businesses and self-employed", + parent_tag: "business/waste-environment", + title: "Climate change planning and preparation", + description: "Includes information for local authorities and infrastructure companies on climate change adaptation" + }, + { + parent_title: "Coasts, countryside and creatures", + parent_tag: "citizenship/coasts-countryside", + title: "Flooding and coastal change", + description: "Includes guidance on flood risk management" + }, + { + parent_title: "Waste and environmental impact", + parent_tag: "business/waste-environment", + title: "Healthcare waste management", + description: "Includes guidance on disposal of healthcare waste management" + }, + { + parent_title: "Recycling, rubbish, streets and roads", + parent_tag: "housing/recycling-rubbish", + title: "Beach and street cleanliness", + description: "Includes litter and fouling, the Total Environment Initiative and the Household Reward and Recognition Scheme" + }, + { + parent_title: "Travel abroad", + parent_tag: "abroad/travel-abroad", + title: "Pet travel and welfare", + description: "Includes travelling with assistance dogs, quarantine and animal welfare legislation" + }, + { + parent_title: "Coasts, countryside and creatures", + parent_tag: "citizenship/coasts-countryside", + title: "Wildlife and habitat conservation", + description: "Includes biodiversity offsetting, habitat conservation and managing protected areas" + } +] + +defra_categories.each do |row| + if MainstreamCategory.find_by_title(row[:title]) + puts "Mainstream category '#{row[:title]}' already exists, skipping" + else + category = MainstreamCategory.create!(row.merge(slug: row[:title].parameterize)) + puts "Created mainstream category: #{category.id}: '#{category.title}'" + end +end
Add detailed guidance categories for defra
diff --git a/db/migrate/20200730144201_remove_fk_constraints_for_asset_user_accesses.rb b/db/migrate/20200730144201_remove_fk_constraints_for_asset_user_accesses.rb index abc1234..def5678 100644 --- a/db/migrate/20200730144201_remove_fk_constraints_for_asset_user_accesses.rb +++ b/db/migrate/20200730144201_remove_fk_constraints_for_asset_user_accesses.rb @@ -0,0 +1,23 @@+# +# Copyright (C) 2020 - present Instructure, Inc. +# +# This file is part of Canvas. +# +# Canvas is free software: you can redistribute it and/or modify it under +# the terms of the GNU Affero General Public License as published by the Free +# Software Foundation, version 3 of the License. +# +# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more +# details. +# +# You should have received a copy of the GNU Affero General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. +class RemoveFkConstraintsForAssetUserAccesses < ActiveRecord::Migration[5.2] + tag :predeploy + + def change + remove_foreign_key :asset_user_accesses, :accounts, column: :root_account_id, if_exists: true + end +end
Remove RA id FK constraint on asset_user_accesses Although we're not sure why, there are lots of asset_user_accesses with a cross-shard context and thus would have a cross-shard root account ID. flag=none closes INTEROP-6042 Test plan: - run migration and make sure you can set root_account_id to a global ID e.g. 12340000000000123 on a AssetUserAccess - set it back to null - run `rake db:migrate:down VERSION=20200730144201` and make sure that you cannot set root_account to a global ID anymove Change-Id: Idf1db168c52e0d76bdaeed9e02466fe465276e89 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/243922 Tested-by: Service Cloud Jenkins <9144042a601061f88f1e1d7a1753ea3e2972119d@instructure.com> Reviewed-by: Ryan Hawkins <867bc579926fa7e8ba296eacccde2d03d9fb556c@instructure.com> Reviewed-by: Ethan Vizitei <73eeb0b2f65d05a906adf3b21ee1f9f5a2aa3c1c@instructure.com> QA-Review: Ryan Hawkins <867bc579926fa7e8ba296eacccde2d03d9fb556c@instructure.com> Product-Review: Ethan Vizitei <73eeb0b2f65d05a906adf3b21ee1f9f5a2aa3c1c@instructure.com>
diff --git a/Casks/ccmenu.rb b/Casks/ccmenu.rb index abc1234..def5678 100644 --- a/Casks/ccmenu.rb +++ b/Casks/ccmenu.rb @@ -2,7 +2,7 @@ version '1.7' sha256 '974a2022dbc9494958334ee8f02e08df7ed184e1f421a53d623dfbeaadf08a2c' - url 'https://downloads.sourceforge.net/project/ccmenu/CCMenu/1.7/ccmenu-1.7-b.dmg' + url "https://downloads.sourceforge.net/project/ccmenu/CCMenu/#{version}/ccmenu-#{version}-b.dmg" appcast 'http://ccmenu.sourceforge.net/update-stable.xml' homepage 'http://ccmenu.sourceforge.net/'
Update CCMenu: version number in url stanza Updated to [facilitate future updates][ref]. [ref]: https://github.com/caskroom/homebrew-cask/pull/4910
diff --git a/Casks/itrash.rb b/Casks/itrash.rb index abc1234..def5678 100644 --- a/Casks/itrash.rb +++ b/Casks/itrash.rb @@ -0,0 +1,24 @@+cask :v1 => 'itrash' do + + if MacOS.version <= :leopard + version '1.5.5' + sha256 'e45ba193c93e3ddf7ac439d035a82f0e9fde5630a308a490d456f0eef6277e6b' + + url "http://www.osxbytes.com/iTrash#{version.gsub('.','')}.dmg" + elsif MacOS.version <= :mavericks + version '2.2.1' + sha256 '58255c7bbc09d9d37db9021a772fc436bd16eab64e89cdccfefff4e360122e7d' + + url "http://www.osxbytes.com/iTrash#{version.gsub('.','')}.dmg" + else + version :latest + sha256 :no_check + + url 'http://www.osxbytes.com/iTrash.dmg' + end + + homepage 'http://www.osxbytes.com/page10/' + license :commercial + + app 'iTrash.app' +end
Add iTrash.app v3.0.2 and versions for older OS X versions
diff --git a/Casks/tg-pro.rb b/Casks/tg-pro.rb index abc1234..def5678 100644 --- a/Casks/tg-pro.rb +++ b/Casks/tg-pro.rb @@ -1,6 +1,6 @@ cask :v1 => 'tg-pro' do - version '2.7.4' - sha256 '94df19f67316c900929542445d7d0b86a97c6605bb353b492b12306663d0cd58' + version '2.8' + sha256 '6fd5902c492b8ae5e547b69f68325e224893bddfd55c60ea596715c6b89b2cde' url "http://www.tunabellysoftware.com/resources/TGPro_#{version.gsub('.','_')}.zip" name 'TG Pro'
Update TG Pro.app to v2.8