diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/db/migrate/20171107185100_add_unique_index_on_common_id_at_subscriptions_and_sub_payments.rb b/db/migrate/20171107185100_add_unique_index_on_common_id_at_subscriptions_and_sub_payments.rb index abc1234..def5678 100644 --- a/db/migrate/20171107185100_add_unique_index_on_common_id_at_subscriptions_and_sub_payments.rb +++ b/db/migrate/20171107185100_add_unique_index_on_common_id_at_subscriptions_and_sub_payments.rb @@ -0,0 +1,15 @@+class AddUniqueIndexOnCommonIdAtSubscriptionsAndSubPayments < ActiveRecord::Migration + def up + execute %Q{ + create unique index uniq_common_id_at_subscriptions on subscriptions(common_id); + create unique index uniq_common_id_at_subscription_payments on subscription_payments(common_id); +} + end + + def down + execute %Q{ + drop index if exists uniq_common_id_at_subscriptions; + drop index if exists uniq_common_id_at_subscription_payments; +} + end +end
Add unique index common_id on subscription / subscription_payments
diff --git a/lib/london_bike_hire_cli.rb b/lib/london_bike_hire_cli.rb index abc1234..def5678 100644 --- a/lib/london_bike_hire_cli.rb +++ b/lib/london_bike_hire_cli.rb @@ -1,19 +1,4 @@-require_relative 'london_bike_hire_cli/application' -require_relative 'london_bike_hire_cli/basic_renderer' -require_relative 'london_bike_hire_cli/controller' -require_relative 'london_bike_hire_cli/feed_parser' -require_relative 'london_bike_hire_cli/geocoding_adapter' -require_relative 'london_bike_hire_cli/query_response' -require_relative 'london_bike_hire_cli/station' -require_relative 'london_bike_hire_cli/repository/repo' -require_relative 'london_bike_hire_cli/repository/in_memory_store_adapter' -require_relative 'london_bike_hire_cli/repository/station_store' -require_relative 'london_bike_hire_cli/repository/station_repo' -require_relative 'london_bike_hire_cli/repository/spatial_search_adapter' -require_relative 'london_bike_hire_cli/queries/stations_by_name' -require_relative 'london_bike_hire_cli/queries/stations_near' -require_relative 'london_bike_hire_cli/station_not_found_error' -require_relative 'london_bike_hire_cli/version' +Dir[File.dirname(__FILE__) + "/london_bike_hire_cli/**/*.rb"].each { |file| require file } module LondonBikeHireCli DEFAULT_SEARCH_LIMIT = 5
Tidy up the require statements
diff --git a/lib/pdfkit/configuration.rb b/lib/pdfkit/configuration.rb index abc1234..def5678 100644 --- a/lib/pdfkit/configuration.rb +++ b/lib/pdfkit/configuration.rb @@ -1,10 +1,10 @@ class PDFKit class Configuration - attr_accessor :meta_tag_prefix, :wkhtmltopdf, :default_options + attr_accessor :meta_tag_prefix, :default_options + attr_writer :wkhtmltopdf def initialize @meta_tag_prefix = 'pdfkit-' - @wkhtmltopdf = `which wkhtmltopdf`.chomp @default_options = { :disable_smart_shrinking => true, :page_size => 'Letter', @@ -14,6 +14,10 @@ :margin_left => '0.75in', :encoding => "UTF-8" } + end + + def wkhtmltopdf + @wkhtmltopdf ||= `which wkhtmltopdf`.chomp end end
Change from always executing `which wkhtmltopdf` to only executing it if the binary file's location is not explicitly stated in config.
diff --git a/db/migrate/20170705110801_adjust_full_text_index_on_projects.rb b/db/migrate/20170705110801_adjust_full_text_index_on_projects.rb index abc1234..def5678 100644 --- a/db/migrate/20170705110801_adjust_full_text_index_on_projects.rb +++ b/db/migrate/20170705110801_adjust_full_text_index_on_projects.rb @@ -0,0 +1,26 @@+class AdjustFullTextIndexOnProjects < ActiveRecord::Migration + def change + execute %Q{ +CREATE OR REPLACE FUNCTION public.generate_project_full_text_index(project projects) + RETURNS tsvector + LANGUAGE plpgsql + STABLE +AS $function$ + DECLARE + full_text_index tsvector; + BEGIN + + full_text_index := setweight(to_tsvector('portuguese', unaccent(coalesce(project.name::text, ''))), 'A') || + setweight(to_tsvector('portuguese', unaccent(coalesce(project.permalink::text, ''))), 'C') || + setweight(to_tsvector('portuguese', unaccent(coalesce(project.headline::text, ''))), 'B') || + setweight(to_tsvector('portuguese', unaccent(coalesce((SELECT c.name_pt FROM categories c WHERE c.id = project.category_id)::text, ''))), 'B') || + setweight(to_tsvector('portuguese', unaccent(coalesce((select array_agg(t.name)::text from public.taggings ta join public_tags t on t.id = ta.public_tag_id where ta.project_id = project.id)::text, ''))), 'B') || + setweight(to_tsvector('portuguese', unaccent(coalesce((SELECT u.public_name FROM users u WHERE u.id = project.user_id)::text, ''))), 'C'); + + RETURN full_text_index; + END + $function$ + +} + end +end
Use public_name on project index
diff --git a/db/migrate/20170717105219_copy_confirmed_at_from_enterprises_to_spree_users.rb b/db/migrate/20170717105219_copy_confirmed_at_from_enterprises_to_spree_users.rb index abc1234..def5678 100644 --- a/db/migrate/20170717105219_copy_confirmed_at_from_enterprises_to_spree_users.rb +++ b/db/migrate/20170717105219_copy_confirmed_at_from_enterprises_to_spree_users.rb @@ -0,0 +1,5 @@+class CopyConfirmedAtFromEnterprisesToSpreeUsers < ActiveRecord::Migration + def up + execute "UPDATE spree_users SET confirmed_at = enterprises.confirmed_at FROM enterprises WHERE spree_users.email = enterprises.email AND enterprises.confirmed_at IS NOT NULL" + end +end
Add migration to confirm already confirmed email addresses
diff --git a/lib/nmap/uptime.rb b/lib/nmap/uptime.rb index abc1234..def5678 100644 --- a/lib/nmap/uptime.rb +++ b/lib/nmap/uptime.rb @@ -13,7 +13,7 @@ # @since 0.6.1 # def to_s - "uptime: #{@seconds} (#{@lastboot})" + "uptime: #{self.seconds} (#{self.lastboot})" end end
Use methods instead of ivars.
diff --git a/modules/nginx/spec/defines/nginx_config_vhost_default_spec.rb b/modules/nginx/spec/defines/nginx_config_vhost_default_spec.rb index abc1234..def5678 100644 --- a/modules/nginx/spec/defines/nginx_config_vhost_default_spec.rb +++ b/modules/nginx/spec/defines/nginx_config_vhost_default_spec.rb @@ -9,7 +9,7 @@ context 'with no params' do it 'should install a default vhost that 404s' do should contain_nginx__config__site('donkey') - .with_content(/listen.*default_server;/) + .with_content(/listen.*\s+default_server;/) .with_content(/return\s+404;/) end end @@ -20,7 +20,7 @@ end it 'should install a default vhost that returns that status code' do should contain_nginx__config__site('donkey') - .with_content(/listen.*default_server;/) + .with_content(/listen.*\s+default_server;/) .with_content(/return\s+418;/) end end
Fix nginx default vhost spec
diff --git a/lib/express_templates/macro.rb b/lib/express_templates/macro.rb index abc1234..def5678 100644 --- a/lib/express_templates/macro.rb +++ b/lib/express_templates/macro.rb @@ -33,6 +33,7 @@ @options.merge!(child_or_option) when child_or_option.kind_of?(Symbol) @options.merge!(id: child_or_option.to_s) + when child_or_option.nil? else @children << child_or_option end
Allow nils passed as an option to do nothing
diff --git a/lib/rcoli/utils.rb b/lib/rcoli/utils.rb index abc1234..def5678 100644 --- a/lib/rcoli/utils.rb +++ b/lib/rcoli/utils.rb @@ -0,0 +1,14 @@+module RCoLi + + module Properties + + def setter(name) + define_method(name) do |value| + ivar = "@#{name}" + instance_variable_set(ivar, value) + end + end + + end + +end
Support for properties in DSL
diff --git a/spec/controllers/dashboards_controller_spec.rb b/spec/controllers/dashboards_controller_spec.rb index abc1234..def5678 100644 --- a/spec/controllers/dashboards_controller_spec.rb +++ b/spec/controllers/dashboards_controller_spec.rb @@ -0,0 +1,37 @@+describe DashboardsController do + render_views + + describe "Student dashboard" do + let(:course2) { FactoryGirl.create(:given_course)} + + before :all do + @student = FactoryGirl.create(:student_registered_for_course).student + @group = FactoryGirl.create(:lab_group, given_course: @student.given_courses.first) + @lab = FactoryGirl.create(:lab, given_course: @student.given_courses.first) + @group.add_student(@student) + @lab.add_group!(@group) + end + + before :each do + login_as(@student) + visit dashboard_path(role: "student") + end + + it "shows a particular course" do + page.should have_content(@lab.given_course.course.course_codes.first.code) + end + + it "shows two courses" do + course2.register_student(@student) + page.should have_content(@lab.given_course.course.course_codes.first.code) + page.should have_content(course2.course.course_codes.first.code) + end + + it "shows a lab" do + page.should have_content(@lab.name) + end + end + + describe "Assistant" do + end +end
Add spec for dashboards controller
diff --git a/dress_up.gemspec b/dress_up.gemspec index abc1234..def5678 100644 --- a/dress_up.gemspec +++ b/dress_up.gemspec @@ -7,11 +7,9 @@ s.version = DressUp::VERSION s.authors = ["Morgan Brown"] s.email = ["brown.mhg@gmail.com"] - s.homepage = "" - s.summary = %q{TODO: Write a gem summary} + s.homepage = "https://github.com/mhgbrown/dress_up" + s.summary = "Enable and disable sets of method overrides" s.description = %q{TODO: Write a gem description} - - s.rubyforge_project = "dress_up" s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
Add homepage and summary information
diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index abc1234..def5678 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -1,6 +1,6 @@ class HomeController < ApplicationController def index - @subscriber_count = User.count + @subscriber_count = Subscription.count @story_count = Story.count @letter_count = Letter.count end
Use subscription instead of user for counts
diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index abc1234..def5678 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -19,7 +19,7 @@ class HomeController < ApplicationController def index @picture = Picture.random - authorize! :show, @picture + authorize! :show, @picture unless @picture.nil? end end
Fix for homepage and permissions when there are no images at all.
diff --git a/config/initializers/govuk_admin_template.rb b/config/initializers/govuk_admin_template.rb index abc1234..def5678 100644 --- a/config/initializers/govuk_admin_template.rb +++ b/config/initializers/govuk_admin_template.rb @@ -1,4 +1,4 @@-GovukAdminTemplate.environment_style = ENV['RAILS_ENV'] +GovukAdminTemplate.environment_style = Rails.env.staging? ? 'preview' : ENV['RAILS_ENV'] GovukAdminTemplate.configure do |c| c.app_title = 'Appointment Planner'
Fix colour of environment label/favicon on staging
diff --git a/db/migrate/20150429170813_fix_email_from.rb b/db/migrate/20150429170813_fix_email_from.rb index abc1234..def5678 100644 --- a/db/migrate/20150429170813_fix_email_from.rb +++ b/db/migrate/20150429170813_fix_email_from.rb @@ -21,10 +21,11 @@ email = members[post.from_name] || Person.where_name_or_number_like(post.from_name).last.try(:email) if email.nil? puts "!! '#{post.from_name}' not found" + email = "help@obra.org" else puts "OK #{post.from_name} to #{email}" - post.update_column :from_email, email end + post.update_column :from_email, email end end end
Use help@obra.org for posts missing from email
diff --git a/db/migrate/20110316184212_questionnaire_flag_defaults.rb b/db/migrate/20110316184212_questionnaire_flag_defaults.rb index abc1234..def5678 100644 --- a/db/migrate/20110316184212_questionnaire_flag_defaults.rb +++ b/db/migrate/20110316184212_questionnaire_flag_defaults.rb @@ -0,0 +1,20 @@+class QuestionnaireFlagDefaults < ActiveRecord::Migration + def self.up + no_preview = Questionnaire.all(:conditions => { :allow_preview => false }).each + + change_column :questionnaires, :allow_preview, :boolean, :null => false, :default => true + transaction do + no_preview.each do |q| + q.allow_preview = false + q.save(false) + end + end + + change_column :questionnaires, :allow_delete_responses, :boolean, :null => false, :default => false + end + + def self.down + change_column :questionnaires, :allow_preview, :boolean, :null => true, :default => nil + change_column :questionnaires, :allow_delete_responses, :boolean, :null => true, :default => nil + end +end
Change questionnaire flags to explicit defaults
diff --git a/db/migrate/20161011074820_add_index_to_database_hosts.rb b/db/migrate/20161011074820_add_index_to_database_hosts.rb index abc1234..def5678 100644 --- a/db/migrate/20161011074820_add_index_to_database_hosts.rb +++ b/db/migrate/20161011074820_add_index_to_database_hosts.rb @@ -0,0 +1,15 @@+Sequel.migration do + no_transaction # indexes need to be created outside of the transaction + + up do + Rails::Sequel.connection.run %{ + CREATE INDEX CONCURRENTLY "users_database_host_index" ON "users" ("database_host"); + } + end + + down do + Rails::Sequel.connection.run %{ + DROP INDEX CONCURRENTLY IF EXISTS "users_database_host_index"; + } + end +end
Add index to database_host (for metrics)
diff --git a/app/helpers/requests_helper.rb b/app/helpers/requests_helper.rb index abc1234..def5678 100644 --- a/app/helpers/requests_helper.rb +++ b/app/helpers/requests_helper.rb @@ -13,4 +13,17 @@ def format_http_header(word) word.gsub(/\w+|-/, &:capitalize) end + + # Determine if the response is JSON. + # + # Using the content-type header, check if JSON is defined within it. + # + # Returns boolean. + def is_json_response? + if @response_data['headers']['content-type'].include? 'json' + return true + else + return false + end + end end
Create helper for checking JSON responses
diff --git a/app/mailers/timeslot_mailer.rb b/app/mailers/timeslot_mailer.rb index abc1234..def5678 100644 --- a/app/mailers/timeslot_mailer.rb +++ b/app/mailers/timeslot_mailer.rb @@ -9,4 +9,16 @@ @timeslot = timeslot mail to: @timeslot.student.email, subject: "Mentor Me Scheduling Notification" end + + def tutor_cancel(timeslot, student) + @timeslot = timeslot + @student = student + mail to: @timeslot.tutor.email, subject: "Mentor Me Cancellation Notification" + end + + def student_cancel(timeslot, student) + @timeslot = timeslot + @student = student + mail to: @student.email, subject: "Mentor Me Cancellation Notification" + end end
Add timeslot mailer methods for cancellations Add methods to timeslot mailer to issue emails to the affected student and tutor when a session is canceled by either of them.
diff --git a/app/services/import_stories.rb b/app/services/import_stories.rb index abc1234..def5678 100644 --- a/app/services/import_stories.rb +++ b/app/services/import_stories.rb @@ -14,6 +14,11 @@ Story.delete_all end + def filterByTag tags + allowedTags = ["climatewatch", "ndcsdg", "esp", "ndc"] + return tags if allowedTags.any? { |allowedTag| tags.downcase.include? allowedTag } + end + def import_stories existing = Story.count url = 'http://www.wri.org/blog/rss2.xml' @@ -28,8 +33,8 @@ published_at: published_at) story.link = feed.channel.link + item.link.split(/href="|">/)[1].sub!(/^\//, '') story.background_image_url = item.enclosure ? item.enclosure.url : '' - story.tags = item.category ? item.category.content : '' - story.save + story.tags = item.category ? filterByTag(item.category.content) : nil + story.save if story.tags end puts "#{Story.count - existing} new stories" end
Add filtering by tag logic to stories import
diff --git a/Casks/segger-embedded-studio-for-risc-v.rb b/Casks/segger-embedded-studio-for-risc-v.rb index abc1234..def5678 100644 --- a/Casks/segger-embedded-studio-for-risc-v.rb +++ b/Casks/segger-embedded-studio-for-risc-v.rb @@ -0,0 +1,12 @@+cask 'segger-embedded-studio-for-risc-v' do + version '3.52a' + sha256 '04b17efd94dec6505f4906007f2408b750903e497de36f91809dac162968595e' + + url "https://www.segger.com/downloads/embedded-studio/Setup_EmbeddedStudio_RISCV_v#{version.no_dots}_macos_x64.dmg" + name 'Embedded Studio for RISC-V' + homepage 'https://www.segger.com/products/development-tools/embedded-studio' + + pkg "Install SEGGER Embedded Studio for RISC-V #{version}.pkg" + + uninstall pkgutil: "com.rowley.crossworks.riscv_segger_studio.#{version}" +end
Add SEGGER Embedded Studio for RISC-V V3.52a
diff --git a/bosh-director/db/migrations/director/20140124225348_proper_pk_for_attributes.rb b/bosh-director/db/migrations/director/20140124225348_proper_pk_for_attributes.rb index abc1234..def5678 100644 --- a/bosh-director/db/migrations/director/20140124225348_proper_pk_for_attributes.rb +++ b/bosh-director/db/migrations/director/20140124225348_proper_pk_for_attributes.rb @@ -0,0 +1,15 @@+Sequel.migration do + change do + add_column :director_attributes, :temp_name, String, null: true + self[:director_attributes].update(temp_name: :name) + + alter_table :director_attributes do + drop_column :name + rename_column :temp_name, :name + add_index [:name], unique:true, name: 'unique_attribute_name' + set_column_not_null :name + + add_primary_key :id + end + end +end
Fix for mysql primary key bug Signed-off-by: Rob Day-Reynolds <904086f049d807ae99640dbdfde98536a5822f56@pivotallabs.com>
diff --git a/lib/active_record/prunable.rb b/lib/active_record/prunable.rb index abc1234..def5678 100644 --- a/lib/active_record/prunable.rb +++ b/lib/active_record/prunable.rb @@ -34,8 +34,8 @@ destroyed = prune_by_method - if destroyed.any? - logger.info "#{destroyed.size} records have been pruned." + if destroyed > 0 + logger.info "#{destroyed} records have been pruned." else logger.info "Nothing to prune." end @@ -71,7 +71,7 @@ if prune_method == :delete prunable.delete_all else - prunable.destroy_all + prunable.destroy_all.size end end end
Return number of removed records.
diff --git a/ZIPFoundation.podspec b/ZIPFoundation.podspec index abc1234..def5678 100644 --- a/ZIPFoundation.podspec +++ b/ZIPFoundation.podspec @@ -11,7 +11,7 @@ s.ios.deployment_target = '9.0' s.osx.deployment_target = '10.11' s.tvos.deployment_target = '9.0' - s.watchos.deployment_target = '4.0' + s.watchos.deployment_target = '2.0' s.source_files = 'Sources/ZIPFoundation/*.swift' end
Revert "Fixed watchOS deployment target for CocoaPods" This reverts commit 8ad242a491de1f266b54546553e9bd2d8470509b.
diff --git a/lib/chefspec/matchers/file.rb b/lib/chefspec/matchers/file.rb index abc1234..def5678 100644 --- a/lib/chefspec/matchers/file.rb +++ b/lib/chefspec/matchers/file.rb @@ -17,7 +17,7 @@ chef_run.resources.any? do |resource| resource_type(resource) == 'remote_file' && resource.path == path && - attributes.all? { |k,v| resource[k] == attributes[k] } + attributes.all? { |k,v| resource.send(k) == attributes[k] } end end end
Access resource attributes by method instead keys. This fixes the following error: Failure/Error: expect(chef_run).to create_remote_file_with_attributes('...') NoMethodError: undefined method `[]' for Chef::Resource::RemoteFile NOTE: We have no covering spec for this since resources are faked by hashes (which obviously respond to `[]').
diff --git a/spec/higher_level_api/integration/alternate_exchanges_spec.rb b/spec/higher_level_api/integration/alternate_exchanges_spec.rb index abc1234..def5678 100644 --- a/spec/higher_level_api/integration/alternate_exchanges_spec.rb +++ b/spec/higher_level_api/integration/alternate_exchanges_spec.rb @@ -14,8 +14,8 @@ ch = connection.create_channel q = ch.queue("", :exclusive => true) - fe = ch.fanout("hot_bunnies.extensions.alternate_xchanges.fanout1") - de = ch.direct("hot_bunnies.extensions.alternate_xchanges.direct1", :arguments => { + fe = ch.fanout("march_hare.extensions.alternate_xchanges.fanout1") + de = ch.direct("march_hare.extensions.alternate_xchanges.direct1", :arguments => { "alternate-exchange" => fe.name })
Use march_hare in these names
diff --git a/failsafe.gemspec b/failsafe.gemspec index abc1234..def5678 100644 --- a/failsafe.gemspec +++ b/failsafe.gemspec @@ -8,7 +8,7 @@ s.platform = Gem::Platform::RUBY s.authors = ["Alex Sharp"] s.email = ["ajsharp@gmail.com"] - s.homepage = "https://github.com/ajsharp/failsafe" + s.homepage = "https://github.com/zaarly/failsafe" s.summary = %q{Tiny little library for silently handling errors so they don't interrupt program flow.} s.description = %q{}
Change homepage location in gemspec
diff --git a/spec/samples/rubySyntaxParts/aggregation/multipleAggregation.rb b/spec/samples/rubySyntaxParts/aggregation/multipleAggregation.rb index abc1234..def5678 100644 --- a/spec/samples/rubySyntaxParts/aggregation/multipleAggregation.rb +++ b/spec/samples/rubySyntaxParts/aggregation/multipleAggregation.rb @@ -0,0 +1,59 @@+require 'set' + +class Class1 + + attr_accessor :value + + def initialize(value) + @value = value + end + + def print_value() + puts @value + end + +end + +class Class2 + + def initialize() + @value = 10 + end + +end + +class Class3 + + def initialize(value) + @value = value + end + +end + +class Class4 + + def initialize(value) + @value = value + end + +end + +class Class5 + + attr_accessor :class1, :class2, :class3, :class4, :class5, :class6 + + @class1 = Class1.new(10) + @class2 = Class2 . new + + def initialize() + @class3 = Class3.new(20) + @class4 = Array.new + @class5 = Set.new + @class6 = Class1.new + end + + def print_value + puts @class.print_value() + end + +end
Create aggregation sample for second parser Signed-off-by: Lucas Moura <143f96f992bf3dc84afaa2cc3d6d759a2b3ef261@gmail.com>
diff --git a/spec/subscriber_spec.rb b/spec/subscriber_spec.rb index abc1234..def5678 100644 --- a/spec/subscriber_spec.rb +++ b/spec/subscriber_spec.rb @@ -2,9 +2,24 @@ describe Hearst::Subscriber do - it 'auto-registers itself with Hearst' - it 'validates required parameters' - it 'stores event and exchange configuration on class' - it 'raises error if .process is not implemented' + class TestSubscriber + include Hearst::Subscriber + subscribes event: 'foo/bar', exchange: 'foo-exchange' + end + + it 'auto-registers itself with Hearst' do + expect(Hearst.subscribers).to include(TestSubscriber) + end + + it 'stores event and exchange configuration on class' do + expect(TestSubscriber.event).to eq('foo/bar') + expect(TestSubscriber.exchange).to eq('foo-exchange') + end + + it 'raises error if .process is not implemented' do + expect { + TestSubscriber.process(pay: 'load') + }.to raise_error(NotImplementedError) + end end
Test subscriber hooks for registering and processing
diff --git a/sprinkle-script.gemspec b/sprinkle-script.gemspec index abc1234..def5678 100644 --- a/sprinkle-script.gemspec +++ b/sprinkle-script.gemspec @@ -18,6 +18,7 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] + spec.dependency "sprinkle" spec.add_development_dependency "bundler", "~> 1.5" spec.add_development_dependency "rake" spec.add_development_dependency "rspec"
Add sprinkle as a dependency
diff --git a/lib/rubocop/cop/naming/binary_operator_parameter_name.rb b/lib/rubocop/cop/naming/binary_operator_parameter_name.rb index abc1234..def5678 100644 --- a/lib/rubocop/cop/naming/binary_operator_parameter_name.rb +++ b/lib/rubocop/cop/naming/binary_operator_parameter_name.rb @@ -18,7 +18,7 @@ 'name its argument `other`.' OP_LIKE_METHODS = %i[eql? equal?].freeze - BLACKLISTED = %i[+@ -@ [] []= << === `].freeze + EXCLUDED = %i[+@ -@ [] []= << === `].freeze def_node_matcher :op_method_candidate?, <<~PATTERN (def [#op_method? $_] (args $(arg [!:other !:_other])) _) @@ -33,7 +33,7 @@ private def op_method?(name) - return false if BLACKLISTED.include?(name) + return false if EXCLUDED.include?(name) !/\A\w/.match?(name) || OP_LIKE_METHODS.include?(name) end
Use EXCLUDED in BinaryOperatorParameterName cop Prefer EXCLUDED to BLACKLIST in code as well as in cop config names.
diff --git a/interactive_git_branch_deleter.rb b/interactive_git_branch_deleter.rb index abc1234..def5678 100644 --- a/interactive_git_branch_deleter.rb +++ b/interactive_git_branch_deleter.rb @@ -13,7 +13,7 @@ response = gets.chomp.strip.downcase if response == 'y' - command = "git branch -d #{branch}" + command = "git branch -D #{branch}" stdout, stderr, status = Open3.capture3(command) end end
Allow deletion of unmerged branches Calling git branch with the `-d` flag will only delete a branch if it has been fully merged with its parent (usually master). In this case, if the user explicitly chooses to delete a local branch, we want to honour this request regardless of whether the branch has been merged. This commit swaps `-d` with `-D`, which will proceed with the deletion regardless of merge status.
diff --git a/modules/govuk_ghe_vpn/spec/classes/govuk_ghe_vpn_spec.rb b/modules/govuk_ghe_vpn/spec/classes/govuk_ghe_vpn_spec.rb index abc1234..def5678 100644 --- a/modules/govuk_ghe_vpn/spec/classes/govuk_ghe_vpn_spec.rb +++ b/modules/govuk_ghe_vpn/spec/classes/govuk_ghe_vpn_spec.rb @@ -0,0 +1,9 @@+require_relative '../../../../spec_helper' + +describe 'govuk_ghe_vpn', :type => :class do + + it { is_expected.to compile } + it { is_expected.to compile.with_all_deps } + it { is_expected.to contain_class('govuk_ghe_vpn') } + +end
Add class specs for govuk_ghe_vpn
diff --git a/lib/faker/default/computer.rb b/lib/faker/default/computer.rb index abc1234..def5678 100644 --- a/lib/faker/default/computer.rb +++ b/lib/faker/default/computer.rb @@ -32,17 +32,16 @@ ## # Produces the name of a computer os. # - # @param platform [String] optionally specify the platform + # @param platform [String] optionally specify the platform `linux`, `macos`, or `windows`. # @return [String] # # @example # Faker::Computer.os #=> "RHEL 6.10" # # @faker.version next - def os(platform:) + def os(platform: self.platform) platform = self.platform unless fetch_all('computer.platform').include?(platform) - platform = search_format(platform) - fetch("computer.#{platform}.os") + fetch("computer.os.#{platform.downcase}") end ##
Fix an error for `Faker::Computer.os` Follow up to #1948. This PR fixes the following error for `Faker::Computer.os`. ```console % cd path/to/faker-ruby/faker % bundle exec ruby -Itest test/test_determinism.rb Loaded suite test/test_determinism (snip) test/test_determinism.rb:13:in `test_determinism' test/test_determinism.rb:13:in `each_index' 11: def test_determinism 12: Faker::Config.random = Random.new(42) 13: @all_methods.each_index do |index| => 14: store_result @all_methods[index] 15: end 16: 17: @first_run.freeze test/test_determinism.rb:14:in `block in test_determinism' test/test_determinism.rb:34:in `store_result' test/test_determinism.rb:37:in `rescue in store_result' Error: test_determinism(TestDeterminism): RuntimeError: Faker::Computer.os raised "missing keyword: :platform" ```
diff --git a/lib/kosmos/packages/ferram.rb b/lib/kosmos/packages/ferram.rb index abc1234..def5678 100644 --- a/lib/kosmos/packages/ferram.rb +++ b/lib/kosmos/packages/ferram.rb @@ -4,4 +4,9 @@ homepage 'http://forum.kerbalspaceprogram.com/threads/20451-0-23-5-Ferram-Aerospace-Research-v0-13-3-4-30-14' url 'https://github.com/ferram4/Ferram-Aerospace-Research/releases/download/v0.13.3/FerramAerospaceResearch_v0_13_3.zip' + + def install + merge_directory 'GameData' + merge_directory 'Ships' + end end
Add a working package for Ferram Aerospace Research. I have installed and uninstalled this mod a few dozen times today.
diff --git a/lib/llt/review/api/helpers.rb b/lib/llt/review/api/helpers.rb index abc1234..def5678 100644 --- a/lib/llt/review/api/helpers.rb +++ b/lib/llt/review/api/helpers.rb @@ -12,7 +12,12 @@ def arethusa(rev, gold = nil, chunk = nil, word = nil) #"http://sosol.perseids.org/tools/arethusa/app/#/perseidslataldt?doc=#{rev}" - "http://85.127.253.84:8081/app/#/review_test?doc=#{rev}&gold=#{gold}" + route = "http://85.127.253.84:8081/app/#/review_test?doc=#{rev}&gold=#{gold}" + if chunk || word + route << "&chunk=#{chunk}" if chunk + route << "&w=#{word}" if word + end + route end def to_tooltip(cat, v)
Use the chunk param in Arethusa routes
diff --git a/lib/modules/module_weather.rb b/lib/modules/module_weather.rb index abc1234..def5678 100644 --- a/lib/modules/module_weather.rb +++ b/lib/modules/module_weather.rb @@ -20,7 +20,7 @@ private def find_weather - uri = "http://m.foreca.fi/index.php?l=100658225" + uri = "http://m.foreca.fi/old/index.php?l=100658225" reply = fetch_uri(uri) return "" if (reply.code != "200")
Fix URL for Foreca service Signed-off-by: Aki Saarinen <278bc57fbbff6b7b38435aea0f9d37e3d879167e@akisaarinen.fi>
diff --git a/opal-activesupport.gemspec b/opal-activesupport.gemspec index abc1234..def5678 100644 --- a/opal-activesupport.gemspec +++ b/opal-activesupport.gemspec @@ -21,5 +21,6 @@ gem.require_paths = ['lib'] gem.add_dependency 'opal', '~> 0.4.2' + gem.add_development_dependency 'rake' gem.add_development_dependency 'opal-spec', '~> 0.2.17' end
Add rake to dev deps
diff --git a/spec/dummy/config/initializers/monologue.rb b/spec/dummy/config/initializers/monologue.rb index abc1234..def5678 100644 --- a/spec/dummy/config/initializers/monologue.rb +++ b/spec/dummy/config/initializers/monologue.rb @@ -1,4 +1,4 @@ Monologue.config do |monologue| - monologue.image_upload.max_picture_size = 100.kilobytes + monologue.image_upload.max_picture_size = 2.megabytes monologue.image_upload.upload_path = "monologue" end
Change default for max picture size in dummy app
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 @@ -19,11 +19,12 @@ # Print deprecation notices to the Rails logger. config.active_support.deprecation = :log + config.log_level = :info # Debug mode disables concatenation and preprocessing of assets. # This option may cause significant delays in view rendering with a large # number of complex assets. - config.assets.debug = true + config.assets.debug = false end # From https://gist.github.com/MyArtChannel/941174 :
Speed up dev mode for production.
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,4 +4,5 @@ config.s3_access_key_id = s3[:access_key_id] config.s3_secret_access_key = s3[:secret_access_key] config.s3_bucket = s3[:bucket_name] + config.s3_cnamed = (RAILS_ENV == 'production') end
Switch assets to S3 cnamed urls.
diff --git a/config/initializers/hoptoad.rb b/config/initializers/hoptoad.rb index abc1234..def5678 100644 --- a/config/initializers/hoptoad.rb +++ b/config/initializers/hoptoad.rb @@ -1,3 +1,3 @@ HoptoadNotifier.configure do |config| - config.api_key = '86a3b1ba9ee92b6bfc5cb1840e9ae3df' + config.api_key = ENV['HOPTOAD_API_KEY'] end
Use a env variable for the Hoptoad API key instead of hardcoding it
diff --git a/db/data_migrations/20190228161327_resolve_zero_percent_measures_on_cigarettes.rb b/db/data_migrations/20190228161327_resolve_zero_percent_measures_on_cigarettes.rb index abc1234..def5678 100644 --- a/db/data_migrations/20190228161327_resolve_zero_percent_measures_on_cigarettes.rb +++ b/db/data_migrations/20190228161327_resolve_zero_percent_measures_on_cigarettes.rb @@ -0,0 +1,24 @@+TradeTariffBackend::DataMigrator.migration do + name "Remove new 0% measures cigarette types" + + up do + applicable do + Measure::Operation.where(measure_sid: -499434, measure_type_id: 'FAA', goods_nomenclature_item_id: '2402201000').any? + Measure::Operation.where(measure_sid: -501457, measure_type_id: 'FAA', goods_nomenclature_item_id: '2402900000').any? + # -501457 2402900000 + # -499434 2402201000 + end + + apply do + Measure::Operation.where(measure_sid: -499434, measure_type_id: 'FAA', goods_nomenclature_item_id: '2402201000').delete + Measure::Operation.where(measure_sid: -501457, measure_type_id: 'FAA', goods_nomenclature_item_id: '2402900000').delete + Measure::Operation.where(measure_sid: -490646).update(validity_end_date: nil) + Measure::Operation.where(measure_sid: -490647).update(validity_end_date: nil) + end + end + + down do + applicable { false } + apply {} # noop + end +end
Add data migration to remove CHIEF 0% duty measures We noticed while testing another feature that CHIEF had included 0% duty measures for cigarettes again. To resolve this we've removed the 0% measures and re-enabled the existing measures that had the proper rates.
diff --git a/lib/charts/map.rb b/lib/charts/map.rb index abc1234..def5678 100644 --- a/lib/charts/map.rb +++ b/lib/charts/map.rb @@ -42,7 +42,7 @@ # Make sure chart dimensions are within Google's 440x220 limit. # def validate_dimensions - if @width > 440 or @height > 220 + if width > 440 or height > 220 raise DimensionsError, "Map dimensions may not exceed 440x220 pixels" end end
Remove references to instance variables (use getter methods instead).
diff --git a/lib/express_templates/compiler.rb b/lib/express_templates/compiler.rb index abc1234..def5678 100644 --- a/lib/express_templates/compiler.rb +++ b/lib/express_templates/compiler.rb @@ -1,6 +1,15 @@ module ExpressTemplates module Compiler def compile(template_or_src=nil, &block) + + if block + begin + block.source + rescue + raise "block must have source - did you do compile(&:label) ?" + end + end + template, src = _normalize(template_or_src) expander = Expander.new(template)
Add helpful error message if developer makes type-o
diff --git a/lib/cowboy/fft.rb b/lib/cowboy/fft.rb index abc1234..def5678 100644 --- a/lib/cowboy/fft.rb +++ b/lib/cowboy/fft.rb @@ -1,4 +1,32 @@ module Cowboy + class Frequencies + attr_reader :dc, :unshifted, :freq + + def initialize(unshifted_array) + @unshifted = unshifted_array + @dc = unshifted_array[0].real + n = unshifted_array.size + @freq = [] + for i in (n/2...n) + @freq << unshifted_array[i].abs + end + for i in (0...n/2) + @freq << unshifted_array[i].abs + end + end + + def buckets(sample_rate=nil) + sample_rate ||= @freq.size + nyquist = sample_rate/2 + a = [] + n = @freq.size + for i in (0..n) + a << -nyquist + (2 * nyquist/n) * i + end + return a + end + end + def Cowboy::fft(arr, w=Hamming, n=29) if !w.nil? window = w.new(n)
Add frequencies class to do shift and include frequency buckets.
diff --git a/lib/guaranteed_queue/configure.rb b/lib/guaranteed_queue/configure.rb index abc1234..def5678 100644 --- a/lib/guaranteed_queue/configure.rb +++ b/lib/guaranteed_queue/configure.rb @@ -6,5 +6,5 @@ region: ENV['AWS_REGION'] || 'us-east-1', dead_letter_poll_interval_seconds: 30, message_failures_allowed: 0, - stub_requests: ENV['RACK_ENV'] == 'test' || ENV['RAILS_ENV'] == 'test' + stub_requests: ENV['RACK_ENV'] == 'test' || ENV['RAILS_ENV'] == 'test' || ENV['RAILS_ENV'] == 'development' )
Allow for development rack to block queues
diff --git a/lib/frizz/sync.rb b/lib/frizz/sync.rb index abc1234..def5678 100644 --- a/lib/frizz/sync.rb +++ b/lib/frizz/sync.rb @@ -18,7 +18,7 @@ local_index.delete(local_path) else puts "#{local_path}: updated".green - remote.upload file_for(local_path), local_path + remote.upload local.file_for(local_path), local_path local_index.delete(local_path) end end
Fix bug preventing deploys from replacing existing files that have changed
diff --git a/lib/redch/sos/client/templates.rb b/lib/redch/sos/client/templates.rb index abc1234..def5678 100644 --- a/lib/redch/sos/client/templates.rb +++ b/lib/redch/sos/client/templates.rb @@ -25,22 +25,21 @@ raise ArgumentError, "String or Symbol expected" end - raise ArgumentError, "Hash expected" if !data.nil? and !data.is_a?(Hash) + raise ArgumentError, "Hash expected" unless data.nil? || data.is_a?(Hash) - find_template(settings.templates_folder, template_name) do |file| - template = compile_template(file) + find(settings.templates_folder, template_name) do |file| + template = compile(file) template.render(data) end end - def find_template(folder, name) + def find(folder, name) yield File.join(folder, "#{name}.#{settings.extension}") end - def compile_template(file) - fd = File.open(file, "r").read - template = Slim::Template.new { fd } - template + def compile(file) + content = File.open(file, "r").read + Slim::Template.new { content } end end @@ -50,4 +49,5 @@ end end -end+end +
Remove useless namespace in method names
diff --git a/lib/cap_recipes/tasks/ruby19/install.rb b/lib/cap_recipes/tasks/ruby19/install.rb index abc1234..def5678 100644 --- a/lib/cap_recipes/tasks/ruby19/install.rb +++ b/lib/cap_recipes/tasks/ruby19/install.rb @@ -5,7 +5,7 @@ namespace :ruby19 do - set :ruby_ver, 'ruby-1.9.2-p180' + set :ruby_ver, 'ruby-1.9.3-p385' set(:ruby_src){"ftp://ftp.ruby-lang.org/pub/ruby/1.9/#{ruby_ver}.tar.bz2"} set :base_ruby_path, '/usr'
Update Ruby to the latest version for security (CVE-2013-0256) http://www.ruby-lang.org/en/news/2013/02/06/rdoc-xss-cve-2013-0256/
diff --git a/lib/chef/knife/cloudformation_export.rb b/lib/chef/knife/cloudformation_export.rb index abc1234..def5678 100644 --- a/lib/chef/knife/cloudformation_export.rb +++ b/lib/chef/knife/cloudformation_export.rb @@ -1,4 +1,3 @@-require 'pathname' require 'knife-cloudformation/cloudformation_base' require 'knife-cloudformation/export' @@ -9,6 +8,8 @@ include KnifeCloudformation::KnifeBase banner 'knife cloudformation export NAME' + + # TODO: Add option for s3 exports option(:path, :long => '--export-path PATH',
Add a note about remote upload
diff --git a/app/models/concerns/recurring_ride_coordinator_scheduler.rb b/app/models/concerns/recurring_ride_coordinator_scheduler.rb index abc1234..def5678 100644 --- a/app/models/concerns/recurring_ride_coordinator_scheduler.rb +++ b/app/models/concerns/recurring_ride_coordinator_scheduler.rb @@ -4,7 +4,7 @@ extend ActiveSupport::Concern include ScheduleAttributes - NON_RIDE_COORDINATOR_ATTRIBUTES = %w(id recurrence schedule_yaml created_at updated_at lock_version) + NON_RIDE_COORDINATOR_ATTRIBUTES = %w(id recurrence schedule_yaml created_at updated_at lock_version start_date end_date) included do end
Add start_date and end_date to NON_RIDE_COORDINATOR_ATTRIBUTES
diff --git a/test/test_cli.rb b/test/test_cli.rb index abc1234..def5678 100644 --- a/test/test_cli.rb +++ b/test/test_cli.rb @@ -1,4 +1,5 @@-require_relative 'helper' +$LOAD_PATH.unshift(File.dirname(__FILE__)) +require 'helper' class TestCLI < Test::Unit::TestCase context "Tracking's CLI" do
Stop using require_relative for CLI test
diff --git a/activesupport/lib/active_support/vendor.rb b/activesupport/lib/active_support/vendor.rb index abc1234..def5678 100644 --- a/activesupport/lib/active_support/vendor.rb +++ b/activesupport/lib/active_support/vendor.rb @@ -1,13 +1,16 @@+def ActiveSupport.requirable?(file) + $LOAD_PATH.any? { |p| Dir.glob("#{p}/#{file}.*").any? } +end + [%w(builder 2.1.2), %w(i18n 0.1.3), %w(memcache-client 1.7.5), %w(tzinfo 0.3.13)].each do |lib, version| - # Try to activate a gem ~> satisfying the requested version first. - begin - gem lib, "~> #{version}" - # Use the vendored lib if the gem's missing or we aren't using RubyGems. - rescue LoadError, NoMethodError - # Skip if there's already a vendored lib already provided. - if $LOAD_PATH.grep(Regexp.new(lib)).empty? - # Push, not unshift, so the vendored lib is lowest priority. - $LOAD_PATH << File.expand_path("#{File.dirname(__FILE__)}/vendor/#{lib}-#{version}/lib") + # If the lib is not already requirable + unless ActiveSupport.requirable? lib + # Try to activate a gem ~> satisfying the requested version first. + begin + gem lib, "~> #{version}" + # Use the vendored lib if the gem's missing or we aren't using RubyGems. + rescue LoadError, NoMethodError + $LOAD_PATH.unshift File.expand_path("#{File.dirname(__FILE__)}/vendor/#{lib}-#{version}/lib") end end end
Check if the lib is in the load path and requirable before attempting to activate the gem version
diff --git a/app/controllers/posts/abouts_controller.rb b/app/controllers/posts/abouts_controller.rb index abc1234..def5678 100644 --- a/app/controllers/posts/abouts_controller.rb +++ b/app/controllers/posts/abouts_controller.rb @@ -9,7 +9,7 @@ # GET /abouts # GET /abouts.json def index - @abouts = About.online + @abouts = About.online.includes(:referencement) seo_tag_index category end @@ -20,13 +20,13 @@ private def set_about - @about = About.friendly.find(params[:id]) + @about = About.includes(:referencement).friendly.find(params[:id]) @element = @about end def set_commentable @commentable = @element - @comments = @commentable.comments.page params[:page] + @comments = @commentable.comments.includes(:user).page params[:page] @comment = Comment.new end
Improve way SQL request are made
diff --git a/app/serializers/task_comment_serializer.rb b/app/serializers/task_comment_serializer.rb index abc1234..def5678 100644 --- a/app/serializers/task_comment_serializer.rb +++ b/app/serializers/task_comment_serializer.rb @@ -1,5 +1,5 @@ class TaskCommentSerializer < ActiveModel::Serializer - attributes :id, :comment, :created_at, :comment_by, :recipient_id, :is_new + attributes :id, :comment, :created_at, :comment_by, :is_new def comment_by object.user.name
QUALITY: Remove recipient_id from comment serializer
diff --git a/Casks/handbrakecli-nightly.rb b/Casks/handbrakecli-nightly.rb index abc1234..def5678 100644 --- a/Casks/handbrakecli-nightly.rb +++ b/Casks/handbrakecli-nightly.rb @@ -1,6 +1,6 @@ cask :v1 => 'handbrakecli-nightly' do - version '6559svn' - sha256 'b66feea96cb15ab7f54498235670ead24245af51e339b7218eabc58446692e17' + version '6562svn' + sha256 'fb93b620e1b106695183fd507c445da209351773c7719ef4144e9957cdbd5c86' url "http://download.handbrake.fr/nightly/HandBrake-#{version}-MacOSX.6_CLI_x86_64.dmg" homepage 'http://handbrake.fr'
Update HandbrakeCLI Nightly to v6562svn HandBrakeCLI Nightly Build 6562svn released 2014-11-27.
diff --git a/app/models/account.rb b/app/models/account.rb index abc1234..def5678 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -14,7 +14,7 @@ store_accessor :contact_information, :address, :country, :public_email, :telefon, :fax, :website validates :name, :users, presence: true - validates :subdomain, uniqueness: true, allow_nil: true + validates :subdomain, uniqueness: true, allow_blank: true validates :subdomain, exclusion: { in: %w(www app admin api backend reckoning) } validates_associated :users
Fix Validation for Account Subdomain
diff --git a/lib/onfido/api.rb b/lib/onfido/api.rb index abc1234..def5678 100644 --- a/lib/onfido/api.rb +++ b/lib/onfido/api.rb @@ -1,29 +1,10 @@-require 'onfido/address_picker' - module Onfido class API - include Requestable - include AddressPicker - - def url_for(path) - Onfido.endpoint + path - end - def method_missing(method, *args) - if [:get, :post].include?(method.to_sym) - make_request(url: args.first.fetch(:url), payload: args.first.fetch(:payload), method: method.to_sym) - else - raise NoMethodError.new("undefined method '#{method}' for #{self.class}") - end - end - - private - - def headers - { - 'Authorization' => "Token token=#{Onfido.api_key}", - 'Accept' => "application/json" - } + klass = method.to_s.capitalize + Object.const_get("Onfido::#{klass}").new + rescue + raise NoMethodError.new("undefined method '#{method}' for #{self.class}") end end end
Make an API wrapper around the endpoints for better calling Now you have to explicitely call a resource before calling its endpoint. It makes things clearer and will keep consistency between the endpoints as well e.g. api = Onfido::API.new api.applicant.find('applicant_id') api.address.find('postcode')
diff --git a/app/controllers/application_controller/sysprep_answer_file.rb b/app/controllers/application_controller/sysprep_answer_file.rb index abc1234..def5678 100644 --- a/app/controllers/application_controller/sysprep_answer_file.rb +++ b/app/controllers/application_controller/sysprep_answer_file.rb @@ -1,7 +1,7 @@ class ApplicationController module SysprepAnswerFile def upload_sysprep_file - @_params.delete :commit + @_params.delete(:commit) @upload_sysprep_file = true @edit = session[:edit] build_grid @@ -13,8 +13,7 @@ add_flash(msg) rescue => bang @edit[:new][:sysprep_upload_text] = nil - msg = _("Error during Sysprep \"%{params}\" file upload: %{message}") % - {:params => params[:upload][:file].original_filename, :message => bang.message} + msg = _("Error during Sysprep \"%{params}\" file upload: %{message}") % {:params => params[:upload][:file].original_filename, :message => bang.message} add_flash(msg, :error) end else
Fix rubocop warnings in ApplicationController::SysprepAnswerFile
diff --git a/magic_grid.gemspec b/magic_grid.gemspec index abc1234..def5678 100644 --- a/magic_grid.gemspec +++ b/magic_grid.gemspec @@ -15,7 +15,7 @@ # s.has_rdoc = 'yard' s.files = Dir["lib/**/*"] + ["MIT-LICENSE", "Rakefile", "README.md"] - s.test_files = Dir["{spec,test}/**/*"] - Dir["test/dummy/tmp/*", "test/dummy/db/*.sqlite3", "test/dummy/log/*.log"] + s.test_files = Dir["{spec,test}/**/*"] - Dir["test/dummy/tmp/**/*", "test/dummy/db/*.sqlite3", "test/dummy/log/*.log"] s.add_dependency "rails", ">= 3.1.0" s.add_dependency "will_paginate", "~> 3.0.0"
Make file gemspec a little more aggressive with file filtering
diff --git a/app/models/meeting.rb b/app/models/meeting.rb index abc1234..def5678 100644 --- a/app/models/meeting.rb +++ b/app/models/meeting.rb @@ -6,7 +6,7 @@ def display_date datetime = date.to_datetime - weekday = DateTime::DAYNAMES[datetime.cwday] + weekday = DateTime::DAYNAMES[datetime.cwday == 7 ? 0 : datetime.cwday] month = DateTime::MONTHNAMES[datetime.month] day = datetime.day year = datetime.year
Change display_date method to account for the fact that the day might be Sunday
diff --git a/Casks/font-league-gothic.rb b/Casks/font-league-gothic.rb index abc1234..def5678 100644 --- a/Casks/font-league-gothic.rb +++ b/Casks/font-league-gothic.rb @@ -4,7 +4,7 @@ url 'http://files.theleagueofmoveabletype.com/downloads/theleagueof-league-gothic-64c3ede.zip' homepage 'https://www.theleagueofmoveabletype.com/league-gothic' - license :unknown + license :ofl font 'theleagueof-league-gothic-64c3ede/LeagueGothic-CondensedItalic.otf' font 'theleagueof-league-gothic-64c3ede/LeagueGothic-CondensedRegular.otf'
Update League Gothic license to ofl
diff --git a/app/models/comment.rb b/app/models/comment.rb index abc1234..def5678 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -1,5 +1,7 @@ class Comment < ActiveRecord::Base + belongs_to :author, class_name: User + has_many :votes, :as => :voteable - belongs_to :author, class_name: User - has_many :votes + validates :body, presence: true + validates :author, presence: true end
Add validations and polymorphic relationship
diff --git a/weakling.gemspec b/weakling.gemspec index abc1234..def5678 100644 --- a/weakling.gemspec +++ b/weakling.gemspec @@ -9,7 +9,6 @@ s.email = ["headius@headius.com"] s.files = Dir['{lib,ext,examples,test}/**/*'] + Dir['{*.txt,*.gemspec,Rakefile}'] s.homepage = "http://github.com/headius/weakling" - s.rdoc_options = ["--main", "README.txt"] s.require_paths = ["lib"] s.summary = "A modified WeakRef impl for JRuby plus some weakref-related tools" s.test_files = Dir["test/test*.rb"]
Remove --main rdoc thing from gemspec.
diff --git a/week-5/gps2_2.rb b/week-5/gps2_2.rb index abc1234..def5678 100644 --- a/week-5/gps2_2.rb +++ b/week-5/gps2_2.rb @@ -0,0 +1,27 @@+# Method to create a list +# input: string of items separated by spaces (example: "carrots apples cereal pizza") +# steps: + # [fill in any steps here] + # set default quantity + # print the list to the console [can you use one of your other methods here?] +# output: [what data type goes here, array or hash?] + +# Method to add an item to a list +# input: item name and optional quantity +# steps: +# output: + +# Method to remove an item from the list +# input: +# steps: +# output: + +# Method to update the quantity of an item +# input: +# steps: +# output: + +# Method to print a list and make it look pretty +# input: +# steps: +# output:
Add file for GPS 2.2
diff --git a/restful_adhearsion.gemspec b/restful_adhearsion.gemspec index abc1234..def5678 100644 --- a/restful_adhearsion.gemspec +++ b/restful_adhearsion.gemspec @@ -9,6 +9,6 @@ s.files = ["lib/restful_adhearsion.rb", "LICENSE", "README.textile", "restful_adhearsion.gemspec"] s.require_paths = ["lib"] - s.add_dependency("json", ">=", "1.1.3") - s.add_dependency("rest-client", ">=", "0.8.2") + s.add_dependency "json", [">= 1.1.3"] + s.add_dependency "rest-client", [">= 0.8.2"] end
Fix dependency version requirements in gemspec
diff --git a/db/migrate/20150629080516_change_registry_id_from_namespace.rb b/db/migrate/20150629080516_change_registry_id_from_namespace.rb index abc1234..def5678 100644 --- a/db/migrate/20150629080516_change_registry_id_from_namespace.rb +++ b/db/migrate/20150629080516_change_registry_id_from_namespace.rb @@ -6,6 +6,9 @@ registry = Registry.first if registry Namespace.where(registry_id: nil).update_all(registry_id: registry.id) + PublicActivity::Activity. + where(trackable_type: 'Namespace'). + update_all(trackable_id: registry.id) else fail <<-HERE.strip_heredoc It appears that you dont have a Registry!
Update the migrator to also update the activities
diff --git a/init.rb b/init.rb index abc1234..def5678 100644 --- a/init.rb +++ b/init.rb @@ -1,8 +1,7 @@-unless RAILS_ENV == 'production' - begin - require 'action_profiler' - ActionController::Base.send :include, ActionController::ActionProfiler - rescue LoadError - ActionController::Base.logger.info "`gem install ruby-prof` to enable action profiling! Then add ?profile=true to any URL to embed a call graph profiling the page load." - end +begin + require 'action_profiler' + ActionController::Base.send :include, ActionController::ActionProfiler + ActionController::Base.logger.info "Action profiling enabled. Add around_filter :action_profiler to ApplicationController then append ?profile=true to any URL to embed a call graph." +rescue LoadError + ActionController::Base.logger.info "`gem install ruby-prof` to enable action profiling." end
Enable in production env also since we require an explicit around_filter now. Use the :if option on around_filter to limit profiling to a specific domain, for example.
diff --git a/init.rb b/init.rb index abc1234..def5678 100644 --- a/init.rb +++ b/init.rb @@ -3,15 +3,15 @@ Redmine::Plugin.register :redmine_dashboard do name 'Redmine Dashboard plugin' author 'Jan Graichen' - description 'Add a task dashboard to Redmine' + description 'Add a task board and a planning board to Redmine' version '2.0.dev' url 'https://github.com/jgraichen/redmine_dashboard' author_url 'mailto:jg@altimos.de' project_module :dashboard do - permission :rdb_view_dashboards, { :dashboard => [:taskboard, :planboard] } - permission :rdb_configure_dashboards, { :dashboard => [:configure] } + permission :view_dashboards, { :rdb_dashboard => [:index], :rdb_taskboard => [:index], :rdb_planningboard => [:index] } + permission :configure_dashboards, { :rdb_dashboard => [:configure] } end - menu :project_menu, :dashboard, { :controller => 'dashboard', :action => 'taskboard' }, :after => :new_issue + menu :project_menu, :dashboard, { :controller => 'rdb_dashboard', :action => 'index' }, :after => :new_issue end
Improve plugin description; Fix pathes, controller names and permissions.
diff --git a/cookbooks/lib/features/jdk_spec.rb b/cookbooks/lib/features/jdk_spec.rb index abc1234..def5678 100644 --- a/cookbooks/lib/features/jdk_spec.rb +++ b/cookbooks/lib/features/jdk_spec.rb @@ -1,4 +1,5 @@-describe 'jdk installation' do +# FIXME: remove `dev` tag ASAF +describe 'jdk installation', dev: true do describe command('java -version') do its(:exit_status) { should eq 0 } end
Tag the jdk specs `dev` since the edge images are busted
diff --git a/core/spec/screenshots/tour_spec.rb b/core/spec/screenshots/tour_spec.rb index abc1234..def5678 100644 --- a/core/spec/screenshots/tour_spec.rb +++ b/core/spec/screenshots/tour_spec.rb @@ -21,7 +21,6 @@ end it 'Interests page should be the same' do - create :user # HACK create user with id 2 (so the next user has an id that is not hardcoded in TopWithAuthorityForGraphUserId Query) @user1 = create :user Pavlov.command :"users/add_handpicked_user", @user1.id.to_s
Revert "avoid using user 2" This reverts commit ff2b2e99b71191f3b5c33ac8f7bdeea11d8d3a19.
diff --git a/Casks/mamp.rb b/Casks/mamp.rb index abc1234..def5678 100644 --- a/Casks/mamp.rb +++ b/Casks/mamp.rb @@ -1,6 +1,6 @@ cask :v1 => 'mamp' do - version '3.3' - sha256 'fb50cfbf54c82f92808ae46bef50944a1c40fc607b43ad1767c78edc18d0b1d1' + version '3.4' + sha256 '4351c048f770b99bc69da6d5240e7b1cff2dbaef485dec7e04327187f3d8df55' url "https://downloads.mamp.info/MAMP-PRO/releases/#{version}/MAMP_MAMP_PRO_#{version}.pkg" name 'MAMP'
Update MAMP to version 3.4
diff --git a/db/migrate/20160914151500_add_pos_attribute_to_spree_order.rb b/db/migrate/20160914151500_add_pos_attribute_to_spree_order.rb index abc1234..def5678 100644 --- a/db/migrate/20160914151500_add_pos_attribute_to_spree_order.rb +++ b/db/migrate/20160914151500_add_pos_attribute_to_spree_order.rb @@ -1,5 +1,8 @@ class AddPosAttributeToSpreeOrder < ActiveRecord::Migration def change - add_column :spree_orders, :pos, :boolean + # NOTE: This field already exists on some of our host projects. + unless column_exists? :spree_orders, :pos + add_column :spree_orders, :pos, :boolean + end end end
Check if the field already exists before creating it Since this fields already exists on our main host project, the migration is unable to run and it halts the whole process.
diff --git a/schema-evolution-manager.gemspec b/schema-evolution-manager.gemspec index abc1234..def5678 100644 --- a/schema-evolution-manager.gemspec +++ b/schema-evolution-manager.gemspec @@ -8,6 +8,7 @@ s.files = %w( README.md ) s.files += Dir.glob("bin/**/*") s.files += Dir.glob("lib/**/*") + s.files += Dir.glob("scripts/**/*") s.files += Dir.glob("template/**/*") s.executables = Dir.entries("bin").select {|f| !File.directory? f} end
Add scripts directory, so that initial sem stuff is created
diff --git a/db/migrate/006_create_snippet_revisions.rb b/db/migrate/006_create_snippet_revisions.rb index abc1234..def5678 100644 --- a/db/migrate/006_create_snippet_revisions.rb +++ b/db/migrate/006_create_snippet_revisions.rb @@ -4,7 +4,7 @@ t.integer :snippet_id t.integer :number t.string :name - t.string :content + t.text :content t.string :filter_id, :limit => 25 t.timestamps
Use text instead of varchar(255) for snippets content, varchar(255) is too small for content
diff --git a/mongoid_auto_increment_id.gemspec b/mongoid_auto_increment_id.gemspec index abc1234..def5678 100644 --- a/mongoid_auto_increment_id.gemspec +++ b/mongoid_auto_increment_id.gemspec @@ -17,5 +17,5 @@ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } s.require_paths = ["lib"] - s.add_dependency "mongoid", [">= 2.0.0"] + s.add_dependency "mongoid", ["~> 2.2.0"] end
Remove low version of Mongoid support, lock on 2.2.0
diff --git a/attributes/default.rb b/attributes/default.rb index abc1234..def5678 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -1,5 +1,5 @@ # installation -default.sensu.version = "0.9.13" +default.sensu.version = "0.9.13-1" default.sensu.use_unstable_repo = false default.sensu.directory = "/etc/sensu" default.sensu.log_directory = "/var/log/sensu"
Add build number to version
diff --git a/Casks/flowdock.rb b/Casks/flowdock.rb index abc1234..def5678 100644 --- a/Casks/flowdock.rb +++ b/Casks/flowdock.rb @@ -1,7 +1,7 @@ class Flowdock < Cask - url 'https://d2ph5hv9wbwvla.cloudfront.net/mac/Flowdock_v1_1_0.zip' + url 'https://flowdock-resources.s3.amazonaws.com/mac/Flowdock.zip' homepage 'https://www.flowdock.com/help/desktop' - version '1.1.0' - sha1 '62332957d869b813c9402d24e2bbaa79dece0bd0' + version 'latest' + no_checksum link 'Flowdock.app' end
Update Flowdock to use version 'latest' & no_checksum
diff --git a/Casks/qlc-plus.rb b/Casks/qlc-plus.rb index abc1234..def5678 100644 --- a/Casks/qlc-plus.rb +++ b/Casks/qlc-plus.rb @@ -0,0 +1,10 @@+cask 'qlc-plus' do + version '4.11.1' + sha256 'd34804876fbac6fa6c1a5a4310d15cbdcf1423d460a9242b8f43453da4c964ec' + + url "http://qlcplus.org/downloads/#{version}/QLC+_#{version}.dmg" + name 'Q Light Controller+' + homepage 'http://qlcplus.org/' + + app 'QLC+.app' +end
Add new cask QLC+.app v4.11.1
diff --git a/lib/rails_best_practices/reviews/not_rescue_exception_review.rb b/lib/rails_best_practices/reviews/not_rescue_exception_review.rb index abc1234..def5678 100644 --- a/lib/rails_best_practices/reviews/not_rescue_exception_review.rb +++ b/lib/rails_best_practices/reviews/not_rescue_exception_review.rb @@ -18,7 +18,7 @@ # check rescue node to see if its type is Exception add_callback :start_rescue do |rescue_node| if rescue_node.exception_classes.any? { |rescue_class| "Exception" == rescue_class.to_s } - add_error "not rescue Exception", rescue_node.file, rescue_node.exception_classes.first.line_number + add_error "Don't rescue Exception", rescue_node.file, rescue_node.exception_classes.first.line_number end end end
Fix grammar for "Not rescue Exception" This is not a grammatically correct sentence. The class should also probably be renamed.
diff --git a/lib/piggybak_braintree/payment_decorator.rb b/lib/piggybak_braintree/payment_decorator.rb index abc1234..def5678 100644 --- a/lib/piggybak_braintree/payment_decorator.rb +++ b/lib/piggybak_braintree/payment_decorator.rb @@ -6,8 +6,14 @@ attr_accessor :payment_method_nonce validates :payment_method_nonce, presence: true - validates :month, presence: true, unless: :payment_method_nonce - validates :year, presence: true, unless: :payment_method_nonce + + [:month, :year].each do |field| + _validators.reject!{ |key, _| key == field } + + _validate_callbacks.reject! do |callback| + callback.raw_filter.attributes == [field] + end + end def process(order) return true unless self.new_record?
Remove validations if nonce presence
diff --git a/lib/ragnarson/stylecheck/rubocop_helpers.rb b/lib/ragnarson/stylecheck/rubocop_helpers.rb index abc1234..def5678 100644 --- a/lib/ragnarson/stylecheck/rubocop_helpers.rb +++ b/lib/ragnarson/stylecheck/rubocop_helpers.rb @@ -6,6 +6,22 @@ module RubocopHelpers class << self def config + if project_config_exists? + project_config_path + else + stylecheck_config_path + end + end + + def project_config_exists? + File.exist?(project_config_path) + end + + def project_config_path + File.join(Dir.pwd, "config", "rubocop.yml") + end + + def stylecheck_config_path File.join(Ragnarson::Stylecheck.root, "config", "rubocop.yml") end end
Allow to use local rubocop config by rake task. In some projects rubocop returns: ``` (Using Ruby 2.0 parser; configure using TargetRubyVersion parameter, under AllCops) ``` Different projects using different ruby versions. To fix this problem user should set TargetRubyVersion inside rubocop config. ``` inherit_gem: ragnarson-stylecheck: config/rubocop.yml AllCops: TargetRubyVersion: 2.3 ```
diff --git a/lib/vagrant-notify/action/check_provider.rb b/lib/vagrant-notify/action/check_provider.rb index abc1234..def5678 100644 --- a/lib/vagrant-notify/action/check_provider.rb +++ b/lib/vagrant-notify/action/check_provider.rb @@ -9,6 +9,8 @@ def call(env) env[:result] = true + # Call the next if we have one (but we shouldn't, since this + # middleware is built to run with the Call-type middlewares) @app.call env end end
Make sure everyone knows that CheckProvider is meant to be used along with vagrant's builtin Call action
diff --git a/app/models/organization.rb b/app/models/organization.rb index abc1234..def5678 100644 --- a/app/models/organization.rb +++ b/app/models/organization.rb @@ -17,7 +17,7 @@ # Get more information for that organisation data = octokit_client.organization(nickname) org = Organization.create( - uid: uid, nickname: nickname, name: data.name, blog: data.blog, + uid: uid, nickname: data.login, name: data.name, blog: data.blog, company: data.company, email: data.email, gravatar_url: data.rels[:avatar].href) end
Update org nickname from latest data
diff --git a/app/models/user_profile.rb b/app/models/user_profile.rb index abc1234..def5678 100644 --- a/app/models/user_profile.rb +++ b/app/models/user_profile.rb @@ -10,6 +10,8 @@ # class UserProfile < ActiveRecord::Base + attr_accessible :picture, :retained_picture, :website, :about + image_accessor :picture do storage_path :generate_picture_path end
Allow users to set their picture, website and about text.
diff --git a/lib/generators/social_stream/documents/install_generator.rb b/lib/generators/social_stream/documents/install_generator.rb index abc1234..def5678 100644 --- a/lib/generators/social_stream/documents/install_generator.rb +++ b/lib/generators/social_stream/documents/install_generator.rb @@ -9,4 +9,16 @@ Rake::Task['railties:install:migrations'].reenable Rake::Task['social_stream_documents_engine:install:migrations'].invoke end + + def require_javascripts + inject_into_file 'app/assets/javascripts/application.js', + "//= require social_stream-documents\n", + :before => '//= require_tree .' + end + + def require_stylesheets + inject_into_file 'app/assets/stylesheets/application.css', + " *= require social_stream-documents\n", + :before => ' *= require_tree .' + end end
Add javascripts and stylesheets to generator
diff --git a/chef/roles/vagrant.rb b/chef/roles/vagrant.rb index abc1234..def5678 100644 --- a/chef/roles/vagrant.rb +++ b/chef/roles/vagrant.rb @@ -37,4 +37,10 @@ :elasticsearch => { :allocated_memory => "512m", }, + + :torquebox => { + :backstage => { + :password => "admin", + }, + }, })
Set a default password for Backstage for local Vagrant development.
diff --git a/Silica.podspec b/Silica.podspec index abc1234..def5678 100644 --- a/Silica.podspec +++ b/Silica.podspec @@ -9,7 +9,7 @@ s.license = 'MIT' s.authors = { "Ian Ynda-Hummel" => "ianynda@gmail.com", "Steven Degutis" => "steven@cleancoders.com" } s.platform = :osx, '10.8' - s.source = { :git => "https://github.com/SiO2/Silica.git", :tag => '0.1.5' } + s.source = { :git => "https://github.com/ianyh/Silica.git", :tag => '0.1.5', :submodules => true } s.source_files = 'Silica', 'Silica/**/*.{h,m}', 'CGSInternal/*.h' s.exclude_files = 'Silica/Exclude' s.frameworks = 'AppKit', 'IOKit', 'Carbon'
Mark the pod as having submodules
diff --git a/spec/lib/requeue_content_spec.rb b/spec/lib/requeue_content_spec.rb index abc1234..def5678 100644 --- a/spec/lib/requeue_content_spec.rb +++ b/spec/lib/requeue_content_spec.rb @@ -19,7 +19,7 @@ expect(PublishingAPI.service(:queue_publisher)).to receive(:send_message) .exactly(1) .times - .with(a_hash_including(content_id: content_item1.content_id)) + .with(a_hash_including(:content_id)) RequeueContent.new(number_of_items: 1).call end end
Make flaky test less specific This test is a bit flaky and sometimes breaks CI. Neither ContentItemFilter or ContentItem define an ordering, so it looks like this is non deterministic. I think all we really expect here is that one of the content items is returned, it doesn't matter which one.
diff --git a/app/controllers/concerns/webhook_validations.rb b/app/controllers/concerns/webhook_validations.rb index abc1234..def5678 100644 --- a/app/controllers/concerns/webhook_validations.rb +++ b/app/controllers/concerns/webhook_validations.rb @@ -6,7 +6,7 @@ if valid_incoming_webhook_address? true else - render :status => 404, :json => "{}" + render :json => {}, :status => :not_found end end
Use :not_found instead of 404
diff --git a/app/controllers/property_elements_controller.rb b/app/controllers/property_elements_controller.rb index abc1234..def5678 100644 --- a/app/controllers/property_elements_controller.rb +++ b/app/controllers/property_elements_controller.rb @@ -7,7 +7,7 @@ @property_elements = @property.property_elements if @property_elements.empty? flash[:error] = "La propiedad no tiene elementos" - redirect_to user_property_path(@user.id, @property.id) + redirect_to new_user_property_property_element_path(@user.id, @property.id) end end
Fix bug redirecting to new when property has no elements.
diff --git a/Formula/parity.rb b/Formula/parity.rb index abc1234..def5678 100644 --- a/Formula/parity.rb +++ b/Formula/parity.rb @@ -2,9 +2,9 @@ class Parity < Formula homepage "https://github.com/thoughtbot/parity" - url "https://github.com/thoughtbot/parity/releases/download/v0.9.1/parity-0.9.1-osx.tar.gz" - version "0.9.1" - sha256 "da0de0d6cc3990fd14e990753ad193221ee3a2ee61f8dd8b537aae54c1e9f141" + url "https://github.com/thoughtbot/parity/releases/download/v0.9.2/parity-0.9.1-osx.tar.gz" + version "0.9.2" + sha256 "d56827ce379958b5abe386f6afff3b012275f43a6d982f524c54bb8a790cee20" depends_on "git" depends_on "heroku-toolbelt"
Update Parity formula for v0.9.2 * Faster deploys, less interaction with development-machine Rake
diff --git a/robot-name/robot_name_test.rb b/robot-name/robot_name_test.rb index abc1234..def5678 100644 --- a/robot-name/robot_name_test.rb +++ b/robot-name/robot_name_test.rb @@ -4,7 +4,7 @@ class RobotTest < MiniTest::Unit::TestCase def test_has_name # rubocop:disable Lint/AmbiguousRegexpLiteral - assert_match /^[a-zA-Z]{2}\d{3}$/, Robot.new.name + assert_match /^[A-Z]{2}\d{3}$/, Robot.new.name # rubocop:enable Lint/AmbiguousRegexpLiteral end @@ -30,7 +30,7 @@ name2 = robot.name assert name != name2 # rubocop:disable Lint/AmbiguousRegexpLiteral - assert_match /^[a-zA-Z]{2}\d{3}$/, name2 + assert_match /^[A-Z]{2}\d{3}$/, name2 # rubocop:enable Lint/AmbiguousRegexpLiteral end end
Remove lower-case letters from regex In the README for this problem the letters are always in upper case. And in the example solution, the `alphabet` method only returns upper case. So I didn't think the tests needed to check for lower case letters.
diff --git a/Verso.podspec b/Verso.podspec index abc1234..def5678 100644 --- a/Verso.podspec +++ b/Verso.podspec @@ -12,8 +12,7 @@ s.source = { :git => "https://github.com/eTilbudsavis/ios-verso.git", - :tag => "v" + s.version.to_s, - :submodules => true + :tag => "v" + s.version.to_s } s.public_header_files = "Verso/ETA_VersoPagedView.h"
Remove submodules from podspec source
diff --git a/IDPDesign.podspec b/IDPDesign.podspec index abc1234..def5678 100644 --- a/IDPDesign.podspec +++ b/IDPDesign.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "IDPDesign" - s.version = "0.1.0" + s.version = "0.2.0" s.summary = "Placeholder" s.description = <<-DESC Placeholder
Update pod version to 0.2.0
diff --git a/app/models/concerns/media_screenshot_archiver.rb b/app/models/concerns/media_screenshot_archiver.rb index abc1234..def5678 100644 --- a/app/models/concerns/media_screenshot_archiver.rb +++ b/app/models/concerns/media_screenshot_archiver.rb @@ -1,27 +1,27 @@ module MediaScreenshotArchiver extend ActiveSupport::Concern - def screenshot_script=(script) - @screenshot_script = script - end - - def screenshot_script - @screenshot_script - end - - def screenshot_path - base_url = CONFIG['public_url'] || self.request.base_url - URI.join(base_url, 'screenshots/', Media.image_filename(self.url)).to_s - end - - def archive_to_screenshot - url = self.url - picture = self.screenshot_path - path = File.join(Rails.root, 'public', 'screenshots', Media.image_filename(url)) - FileUtils.ln_sf File.join(Rails.root, 'public', 'pending_picture.png'), path - self.data['screenshot'] = picture - self.data['screenshot_taken'] = 0 - key_id = self.key ? self.key.id : nil - ScreenshotWorker.perform_async(url, picture, key_id, self.screenshot_script) - end +# def screenshot_script=(script) +# @screenshot_script = script +# end +# +# def screenshot_script +# @screenshot_script +# end +# +# def screenshot_path +# base_url = CONFIG['public_url'] || self.request.base_url +# URI.join(base_url, 'screenshots/', Media.image_filename(self.url)).to_s +# end +# +# def archive_to_screenshot +# url = self.url +# picture = self.screenshot_path +# path = File.join(Rails.root, 'public', 'screenshots', Media.image_filename(url)) +# FileUtils.ln_sf File.join(Rails.root, 'public', 'pending_picture.png'), path +# self.data['screenshot'] = picture +# self.data['screenshot_taken'] = 0 +# key_id = self.key ? self.key.id : nil +# ScreenshotWorker.perform_async(url, picture, key_id, self.screenshot_script) +# end end
Comment file related to screenshot archiver, that is not being used
diff --git a/Support/spec/spec_helper.rb b/Support/spec/spec_helper.rb index abc1234..def5678 100644 --- a/Support/spec/spec_helper.rb +++ b/Support/spec/spec_helper.rb @@ -5,7 +5,7 @@ module Spec::Example::ExampleMethods def set_env - root = File.expand_path(File.dirname(__FILE__) + '/../../../rspec') + root = File.expand_path(File.dirname(__FILE__) + '/../../../example_rails_app/vendor/plugins/rspec') ENV['TM_SPEC'] = "ruby -I\"#{root}/lib\" \"#{root}/bin/spec\"" ENV['TM_RSPEC_HOME'] = "#{root}" ENV['TM_PROJECT_DIRECTORY'] = File.expand_path(File.dirname(__FILE__))
Move relative location of rspec (core) directory.
diff --git a/rb/spec/unit/selenium/webdriver/remote/http/default_spec.rb b/rb/spec/unit/selenium/webdriver/remote/http/default_spec.rb index abc1234..def5678 100644 --- a/rb/spec/unit/selenium/webdriver/remote/http/default_spec.rb +++ b/rb/spec/unit/selenium/webdriver/remote/http/default_spec.rb @@ -29,6 +29,8 @@ http.proxy_port.should == 8080 http.proxy_user.should == "foo" http.proxy_pass.should == "bar" + + http.address.should == "example.com" end it "raises an error if the proxy is not an HTTP proxy" do
JariBakken: Update spec to check host of proxied HTTP client. git-svn-id: aa1aa1384423cb28c2b1e29129bb3a91de1d9196@10680 07704840-8298-11de-bf8c-fd130f914ac9
diff --git a/scss-lint.gemspec b/scss-lint.gemspec index abc1234..def5678 100644 --- a/scss-lint.gemspec +++ b/scss-lint.gemspec @@ -13,7 +13,7 @@ s.summary = 'SCSS lint tool' s.description = 'Opinionated tool that tells you whether or not your SCSS is "bad"' - s.files = `git ls-files -- lib`.split("\n") + s.files = Dir['lib/**/*.rb'] s.executables = ['scss-lint'] s.require_paths = ['lib']
Remove gemspec dependency on `git` Shelling out is unecessary, especially since no .rb files are gitignore'd. Using the same thing I did for `overcommit`: https://github.com/causes/overcommit/blob/master/overcommit.gemspec#L20-L22 Change-Id: I3fb732dc5e5c59cd618d34e7373084fcf9c238b3 Reviewed-on: https://gerrit.causes.com/23262 Tested-by: jenkins <d95b56ce41a2e1ac4cecdd398defd7414407cc08@causes.com> Reviewed-by: Shane da Silva <6f6e68d1df92f30cb4b3ce35260ddf94a402f33d@causes.com>