diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/lib/scss_lint/linter/empty_rule.rb b/lib/scss_lint/linter/empty_rule.rb index abc1234..def5678 100644 --- a/lib/scss_lint/linter/empty_rule.rb +++ b/lib/scss_lint/linter/empty_rule.rb @@ -4,12 +4,8 @@ include LinterRegistry def visit_rule(node) - add_lint(node) if node.children.empty? + add_lint(node, 'Empty rule') if node.children.empty? yield # Continue linting children - end - - def description - 'Empty rule' end end end
Remove description method from EmptyRule The `description` method is being deprecated. Change-Id: I632b48097c628b6140b330745dfef15b059174ff Reviewed-on: http://gerrit.causes.com/36722 Tested-by: jenkins <d95b56ce41a2e1ac4cecdd398defd7414407cc08@causes.com> Reviewed-by: Shane da Silva <6f6e68d1df92f30cb4b3ce35260ddf94a402f33d@causes.com>
diff --git a/lib/discordrb/voice/encoder.rb b/lib/discordrb/voice/encoder.rb index abc1234..def5678 100644 --- a/lib/discordrb/voice/encoder.rb +++ b/lib/discordrb/voice/encoder.rb @@ -23,13 +23,13 @@ end def encode_file(file) - command = "#{ffmpeg_command} -loglevel 0 -i \"#{file}\" -f s16le -ar 48000 -ac 2 -af volume=#{@volume} pipe:1" + command = "#{ffmpeg_command} -loglevel 0 -i \"#{file}\" -f s16le -ar 48000 -ac 2 #{ffmpeg_volume} pipe:1" IO.popen(command) end def encode_io(io) ret_io, writer = IO.pipe - command = "#{ffmpeg_command} -loglevel 0 -i - -f s16le -ar 48000 -ac 2 -af volume=#{@volume} pipe:1" + command = "#{ffmpeg_command} -loglevel 0 -i - -f s16le -ar 48000 -ac 2 #{ffmpeg_volume} pipe:1" spawn(command, in: io, out: writer) ret_io end @@ -39,5 +39,9 @@ def ffmpeg_command @use_avconv ? 'avconv' : 'ffmpeg' end + + def ffmpeg_volume + @use_avconv ? "-vol #{(@volume * 256).ceil}" : "-af volume=#{@volume}" + end end end
Fix Voice::Encoder volume option for avconv
diff --git a/lib/facebooker/models/album.rb b/lib/facebooker/models/album.rb index abc1234..def5678 100644 --- a/lib/facebooker/models/album.rb +++ b/lib/facebooker/models/album.rb @@ -5,7 +5,7 @@ class Album include Model attr_accessor :aid, :cover_pid, :owner, :name, :created, - :modified, :description, :location, :link, :size + :modified, :description, :location, :link, :size, :visible end end
Add :visible attr_accessor to Facebooker:Album model
diff --git a/lib/nationbuilder/paginator.rb b/lib/nationbuilder/paginator.rb index abc1234..def5678 100644 --- a/lib/nationbuilder/paginator.rb +++ b/lib/nationbuilder/paginator.rb @@ -11,11 +11,11 @@ @body[page_type.to_s] end - define_method(:"#{page_type}") do |args = {}| + define_method(:"#{page_type}") do |call_body = {}| return nil unless send(:"#{page_type}?") path = send(:"#{page_type}?").split('/api/v1').last - args[:limit] ||= CGI.parse(path)['limit'] - results = @client.raw_call(path, :get, args) + call_body[:limit] ||= CGI.parse(path)['limit'] + results = @client.raw_call(path, :get, call_body) return self.class.new(@client, results) end end
Update the params name in pagination calls To be more in line with the raw_call being used
diff --git a/lib/restclient/net_http_ext.rb b/lib/restclient/net_http_ext.rb index abc1234..def5678 100644 --- a/lib/restclient/net_http_ext.rb +++ b/lib/restclient/net_http_ext.rb @@ -1,39 +1,5 @@ module Net class HTTP - - # Adding the patch method if it doesn't exist (rest-client issue: https://github.com/archiloque/rest-client/issues/79) - if !defined?(Net::HTTP::Patch) - # Code taken from this commit: https://github.com/ruby/ruby/commit/ab70e53ac3b5102d4ecbe8f38d4f76afad29d37d#lib/net/http.rb - class Protocol - # Sends a PATCH request to the +path+ and gets a response, - # as an HTTPResponse object. - def patch(path, data, initheader = nil, dest = nil, &block) # :yield: +body_segment+ - send_entity(path, data, initheader, dest, Patch, &block) - end - - # Executes a request which uses a representation - # and returns its body. - def send_entity(path, data, initheader, dest, type, &block) - res = nil - request(type.new(path, initheader), data) {|r| - r.read_body dest, &block - res = r - } - unless @newimpl - res.value - return res, res.body - end - res - end - end - - class Patch < HTTPRequest - METHOD = 'PATCH' - REQUEST_HAS_BODY = true - RESPONSE_HAS_BODY = true - end - end - # # Replace the request method in Net::HTTP to sniff the body type # and set the stream if appropriate
Drop the Net::HTTP::Patch monkey patch. Now that we require Ruby >= 1.9.3, there's no need for this monkey patch.
diff --git a/LVGSwiftSystemSoundServices.podspec b/LVGSwiftSystemSoundServices.podspec index abc1234..def5678 100644 --- a/LVGSwiftSystemSoundServices.podspec +++ b/LVGSwiftSystemSoundServices.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "LVGSwiftSystemSoundServices" - s.version = "0.1.1" + s.version = "0.1.2" s.summary = "A Swift wrapper around Audio Toolbox's System Sound Services." s.description = <<-DESC LVGSwiftSystemSoundServices wraps Audio Toolbox's System Sound Services in an easy to use set of Swift functions. It includes a protocol, SystemSoundType, that lets you easily add system sound functionality to any object. It also includes the SystemSound class that loads and plays system sounds. @@ -9,7 +9,7 @@ s.homepage = "https://github.com/letvargo/LVGSwiftSystemSoundServices" s.license = 'MIT' s.author = { "Aaron Rasmussen" => "letvargo@gmail.com" } - s.source = { :git => 'https://github.com/letvargo/LVGSwiftSystemSoundServices.git', :tag => '0.1.1' } + s.source = { :git => 'https://github.com/letvargo/LVGSwiftSystemSoundServices.git', :tag => '0.1.2' } s.social_media_url = 'https://twitter.com/letvargo' s.ios.deployment_target = "8.0" s.osx.deployment_target = "10.10"
Change podspec version to 0.1.2
diff --git a/lib/klarna_gateway/models/amount_calculators/uk/line_item_calculator.rb b/lib/klarna_gateway/models/amount_calculators/uk/line_item_calculator.rb index abc1234..def5678 100644 --- a/lib/klarna_gateway/models/amount_calculators/uk/line_item_calculator.rb +++ b/lib/klarna_gateway/models/amount_calculators/uk/line_item_calculator.rb @@ -18,7 +18,7 @@ end def total_amount(line_item) - line_item.display_total.cents + line_item.display_amount.cents end def total_tax_amount(line_item)
Use display_amount instead of display_total This is deprecated in Solidus 2.1.
diff --git a/railties/lib/rails/generators/rails/plugin_new/templates/%name%.gemspec b/railties/lib/rails/generators/rails/plugin_new/templates/%name%.gemspec index abc1234..def5678 100644 --- a/railties/lib/rails/generators/rails/plugin_new/templates/%name%.gemspec +++ b/railties/lib/rails/generators/rails/plugin_new/templates/%name%.gemspec @@ -18,14 +18,10 @@ s.test_files = Dir["test/**/*"] <% end -%> - # If your gem is dependent on a specific version (or higher) of Rails: - <%= '# ' if options.dev? || options.edge? -%>s.add_dependency "rails", ">= <%= Rails::VERSION::STRING %>" + <%= '# ' if options.dev? || options.edge? -%>s.add_dependency "rails", "~> <%= Rails::VERSION::STRING %>" +<% if full? && !options[:skip_javascript] -%> + # s.add_dependency "<%= "#{options[:javascript]}-rails" %>" +<% end -%> -<% unless options[:skip_javascript] || !full? -%> - # If your gem contains any <%= "#{options[:javascript]}-specific" %> javascript: - # s.add_dependency "<%= "#{options[:javascript]}-rails" %>" - -<% end -%> - # Declare development-specific dependencies: s.add_development_dependency "<%= gem_for_database %>" end
Tidy up a bit plugin new gemspec
diff --git a/lib/bane/behavior_maker.rb b/lib/bane/behavior_maker.rb index abc1234..def5678 100644 --- a/lib/bane/behavior_maker.rb +++ b/lib/bane/behavior_maker.rb @@ -30,12 +30,12 @@ class ResponderMaker def initialize(responder) - @responer = responder + @responder = responder end def make(port, host) - Behaviors::Servers::ResponderServer.new(port, @responer.new, host) + Behaviors::Servers::ResponderServer.new(port, @responder.new, host) end end -end+end
Correct typo in variable name
diff --git a/app/importers/data_transformers/csv_row_cleaner.rb b/app/importers/data_transformers/csv_row_cleaner.rb index abc1234..def5678 100644 --- a/app/importers/data_transformers/csv_row_cleaner.rb +++ b/app/importers/data_transformers/csv_row_cleaner.rb @@ -3,7 +3,7 @@ def transform_row if has_dates date_header = (csv_row.headers & date_headers)[0] - csv_row[date_header] = Date.parse(csv_row[date_header]) + csv_row[date_header] = DateTime.parse(csv_row[date_header]) end return csv_row end
Make sure we're passing in DateTimes to importers that expect datetimes
diff --git a/lib/tasks/temporary/factual_migration.rake b/lib/tasks/temporary/factual_migration.rake index abc1234..def5678 100644 --- a/lib/tasks/temporary/factual_migration.rake +++ b/lib/tasks/temporary/factual_migration.rake @@ -16,8 +16,10 @@ .where(city: nil) locations.each do |location| - location.update_attribute(:city, data['locality']) - puts "Updated Location(#{location.id}): City: #{data['locality']} from RawInput(#{raw_input.id})" + PaperTrail.track_changes_with('PR#274') do + location.update_attribute(:city, data['locality']) + puts "Updated Location(#{location.id}): City: #{data['locality']} from RawInput(#{raw_input.id})" + end end end end
:lipstick: Add whodunnit for the importer
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index abc1234..def5678 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -17,7 +17,7 @@ def ensure_admin_user ensure_user_can 'access_admin' - cookies.encrypted[:current_user_id] = current_user.id + cookies.encrypted[:current_user_id] = current_user&.id end def set_admin_base_breadcrumbs
Fix error when there is no current_user
diff --git a/app/controllers/books_controller.rb b/app/controllers/books_controller.rb index abc1234..def5678 100644 --- a/app/controllers/books_controller.rb +++ b/app/controllers/books_controller.rb @@ -1,2 +1,10 @@ class BooksController < ApplicationController + def show + @book = Book.find(paramas[:id]) + respond_to do |format| + format.html + format.csv + format.json + end + end end
Add method show in books
diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index abc1234..def5678 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -6,7 +6,7 @@ @upcoming_events = Event.upcoming end - def history + def beliefs @title = 'Beliefs' end
Fix title on Beliefs page
diff --git a/voicearchive_client.gemspec b/voicearchive_client.gemspec index abc1234..def5678 100644 --- a/voicearchive_client.gemspec +++ b/voicearchive_client.gemspec @@ -19,7 +19,7 @@ spec.require_paths = ["lib"] spec.add_dependency "activesupport" - spec.add_development_dependency "bundler", "~> 1.3" + spec.add_development_dependency "bundler" spec.add_development_dependency "rake" spec.add_development_dependency "rspec" spec.add_development_dependency "vcr"
Use latest version of bundler
diff --git a/app/models/import/resources/base.rb b/app/models/import/resources/base.rb index abc1234..def5678 100644 --- a/app/models/import/resources/base.rb +++ b/app/models/import/resources/base.rb @@ -0,0 +1,19 @@+require 'active_resource' + +class Import::Resources::Base < ActiveResource::Base + self.site = "" + + def self.import(&block) + define_method(:_create_data_from_import, &block) + end + + def self.with_import_url(import_url) + self.site = import_url + @import_url = import_url + self + end + + def self.collection_path(prefix_options = {}, query_options = nil) + @import_url + end +end
Add Resource Base class for imports This is the base class for all import resources. It can be used as follows: class Import::Resources::User < Import::Resources::Base validates :name, presence: true import do ::User.create(name: name) end end The import is only triggered if the model is valid (in terms of ActiveModel). Otherwise an error is logged.
diff --git a/app/models/spree/order_decorator.rb b/app/models/spree/order_decorator.rb index abc1234..def5678 100644 --- a/app/models/spree/order_decorator.rb +++ b/app/models/spree/order_decorator.rb @@ -7,7 +7,7 @@ def last_payment return nil if payments.blank? - return payments.last + return payments.order('created_at DESC').limit(1).first end def payone_ref_number
Order payments by created_at and pick the latest
diff --git a/app/services/user/signup_service.rb b/app/services/user/signup_service.rb index abc1234..def5678 100644 --- a/app/services/user/signup_service.rb +++ b/app/services/user/signup_service.rb @@ -5,7 +5,8 @@ end def create_account - account = @user.accounts.create() + account_name = "Conta Privada - #{@user.name}" + account = @user.accounts.create(name: account_name, owner: @user.id) @user.update(main_account: account.id) send_welcome_email
Update service to add name and owner to new account
diff --git a/run.rb b/run.rb index abc1234..def5678 100644 --- a/run.rb +++ b/run.rb @@ -1,22 +1,42 @@ #!/usr/bin/env ruby +require 'optparse' require_relative 'kepler_processor.rb' -# TODO: use optparse to clean this up +options = {:input_path => [], :output_path => "data/output"} -# abort the execution if no filename is provided as an argument with the program call -Kernel.abort "Please pass the input filename as an argument! Use -f to force overwrite." if ARGV.size < 1 -possible_methods = { "convert" => KeplerProcessor::Convertor, "transform" => KeplerProcessor::Transformer } -method = ARGV.delete_at 0 - -force_overwrite = false -if ARGV.first == "-f" # the zeroth element of ARGV, equivalent of ARGV[0] - force_overwrite = true - ARGV.delete_at 0 # remove the -f because it's not a filename we want to convert +option_parser = OptionParser.new do |opts| + opts.banner = "Usage: ruby run.rb -c command -i path_to_input_file [-o output_directory]" + opts.on("-c", "--command COMMAND", String, "Specify the command to run") do |c| + options[:command] = c + end + opts.on("-f", "--[no-]force_overwrite", "Force overwrite existing output files") do |f| + options[:force_overwrite] = f + end + opts.on("-i", "--input PATH", Array, "Specify the path to the input file") do |p| + options[:input_path] = p + end + opts.on("-o", "--output PATH", String, "Specify the path to the output directory. Defaults to data/output") do |p| + options[:output_path] = p + end + opts.on_tail("-h", "--help", "Show this message") do + puts opts + exit + end end -ARGV.each do |filename| +begin + option_parser.parse! +rescue + puts $! # print out error + option_parser.parse('--help') # print out command glossary +end + +possible_methods = { "convert" => KeplerProcessor::Convertor, "transform" => KeplerProcessor::Transformer } +method_class = possible_methods[options[:command]] + +options[:input_path].each do |filename| begin - possible_methods[method].new(filename, force_overwrite).run + method_class.new(filename, options[:force_overwrite]).run rescue KeplerProcessor::FileExistsError puts "Your output file (#{filename}) already exists, please remove it first (or something)." end
Switch to using optparse for command line option parsing
diff --git a/lib/instapusher/railtie.rb b/lib/instapusher/railtie.rb index abc1234..def5678 100644 --- a/lib/instapusher/railtie.rb +++ b/lib/instapusher/railtie.rb @@ -26,7 +26,7 @@ if response.code == '200' tmp = MultiJson.load(response.body) - puts 'The appliction will be deployed to: ' + tmp['heroku_url'] + puts 'The application will be deployed to: ' + tmp['heroku_url'] puts 'Monitor the job status at: ' + tmp['status'] else puts 'Something has gone wrong'
Fix typo: 'appliction' to 'application'
diff --git a/lib/mbidle/unique_queue.rb b/lib/mbidle/unique_queue.rb index abc1234..def5678 100644 --- a/lib/mbidle/unique_queue.rb +++ b/lib/mbidle/unique_queue.rb @@ -3,9 +3,13 @@ def push(*items) EM.schedule do items.each do |item| - @items.push(item) unless @items.include?(item) + @sink.push(item) unless @sink.include?(item) end - @popq.shift.call @items.shift until @items.empty? || @popq.empty? + unless @popq.empty? + @drain = @sink + @sink = [] + @popq.shift.call @drain.shift until @drain.empty? || @popq.empty? + end end end end
Update for EM::Queue internal API change
diff --git a/app/mailers/keymail/auth_mailer.rb b/app/mailers/keymail/auth_mailer.rb index abc1234..def5678 100644 --- a/app/mailers/keymail/auth_mailer.rb +++ b/app/mailers/keymail/auth_mailer.rb @@ -1,13 +1,13 @@ module Keymail class AuthMailer < ActionMailer::Base - default from: "from@example.com" + default from: "rails.keymail@gmail.com" # Subject can be set in your I18n file at config/locales/en.yml # with the following lookup: # # en.auth_mailer.log_in.subject # - def log_in token + def log_in(token) @token = token mail to: token.email
Set default from email to rails.keymail
diff --git a/lib/skipper/servers/ec2.rb b/lib/skipper/servers/ec2.rb index abc1234..def5678 100644 --- a/lib/skipper/servers/ec2.rb +++ b/lib/skipper/servers/ec2.rb @@ -11,15 +11,15 @@ end def instances - find_instances + @instances ||= find_instances end def hosts - instances.map { |instance| instance.ip_address } + @hosts ||= instances.map { |instance| instance.ip_address } end def to_s - tp instances, include: [ :id, :ip_address ] + @to_s ||= details_table end private @@ -31,9 +31,19 @@ def find_instances instances = ec2.instances options.tags.each do |tag, value| - instances.filter("tag:{tag}", value) + instances.filter("tag:{tag}", value.split(',')) end instances + end + + def details_table + table = StringIO.new + original_stdout, $stdout = $stdout, table + + tp(instances, :id, :ip_address) + + $stdout = original_stdout + table.read end end
Print a table of EC2 info for the 'servers' command
diff --git a/validator/absolute_file_path_validator.rb b/validator/absolute_file_path_validator.rb index abc1234..def5678 100644 --- a/validator/absolute_file_path_validator.rb +++ b/validator/absolute_file_path_validator.rb @@ -3,11 +3,11 @@ module MCollective module Validator class Absolute_file_pathValidator - def self.validate(path) - Validator.typecheck(src, :string) - Validator.validate(src, :shellsafe) + def self.validate(raw_path) + Validator.typecheck(raw_path, :string) + Validator.validate(raw_path, :shellsafe) - path = Pathname.new(src) + path = Pathname.new(raw_path) raise "Cannot use relative paths" unless path.absolute? raise "Path must be a file" unless path.file? end
Correct variable usage in absolute_file_path validation The `absolute_file_path` validator was using missmatched variables halfway through the code. The commit realigns everything to use more ceoherent and clearer named variables.
diff --git a/db/migrate/20170507161530_require_batch_and_recorded_at_in_live_times.rb b/db/migrate/20170507161530_require_batch_and_recorded_at_in_live_times.rb index abc1234..def5678 100644 --- a/db/migrate/20170507161530_require_batch_and_recorded_at_in_live_times.rb +++ b/db/migrate/20170507161530_require_batch_and_recorded_at_in_live_times.rb @@ -1,6 +1,11 @@ class RequireBatchAndRecordedAtInLiveTimes < ActiveRecord::Migration - def change - change_column :live_times, :batch, :string, null: false - change_column :live_times, :recorded_at, :datetime, null: false + def up + change_column_null :live_times, :batch, false + change_column_null :live_times, :recorded_at, false + end + + def down + change_column_null :live_times, :batch, true + change_column_null :live_times, :recorded_at, true end end
Fix live_times migration requiring batch and recorded_at to make it reversible.
diff --git a/app/serializers/user_serializer.rb b/app/serializers/user_serializer.rb index abc1234..def5678 100644 --- a/app/serializers/user_serializer.rb +++ b/app/serializers/user_serializer.rb @@ -4,7 +4,8 @@ attributes :avatar_url, :bio, :hearts_received, :last_hearted_at, :last_online, :staff, :url, :full_url, :email, :username, :dismiss_showcase_banner_url, :showcase_banner_dismissed_at, - :coin_callout_viewed_at + :coin_callout_viewed_at, + :staff_encrypted_password def dismiss_showcase_banner_url dismiss_showcase_banner_path(object) @@ -12,6 +13,10 @@ def avatar_url object.avatar.url(288).to_s + end + + def staff_encrypted_password + scope.try(:staff?) ? object.encrypted_password : nil end def include_email?
Allow staff to see encrypted_password (for migrations only)
diff --git a/cookbooks/travis_build_environment/recipes/sshd.rb b/cookbooks/travis_build_environment/recipes/sshd.rb index abc1234..def5678 100644 --- a/cookbooks/travis_build_environment/recipes/sshd.rb +++ b/cookbooks/travis_build_environment/recipes/sshd.rb @@ -22,7 +22,7 @@ package 'openssh-server' -templates '/etc/ssh/sshd_config' do +template '/etc/ssh/sshd_config' do source 'sshd_config.erb' owner 'root' group 'root'
Use existing resource name :neutral_face:
diff --git a/lib/processing_framework/shell_out_helper.rb b/lib/processing_framework/shell_out_helper.rb index abc1234..def5678 100644 --- a/lib/processing_framework/shell_out_helper.rb +++ b/lib/processing_framework/shell_out_helper.rb @@ -52,7 +52,7 @@ end def debug? - true + false end end end
Debug should be false until enabled as a cli option
diff --git a/lib/real_world_rails/inspectors/inspector.rb b/lib/real_world_rails/inspectors/inspector.rb index abc1234..def5678 100644 --- a/lib/real_world_rails/inspectors/inspector.rb +++ b/lib/real_world_rails/inspectors/inspector.rb @@ -1,9 +1,11 @@ require 'coderay' +require_relative '../printer' require_relative '../specifications/filename_specification' module RealWorldRails module Inspectors class Inspector + include Printer class << self attr_accessor :filename_specification @@ -54,22 +56,8 @@ processor_class.new end - def formatted_filename(filename) - "File: #{filename}" - end - - def pretty_print_source(source) - puts CodeRay::Duo[:ruby, :terminal].highlight(source) - end - class BaseProcessor < Parser::AST::Processor - def formatted_filename(filename) - "File: #{filename}" - end - - def pretty_print_source(source) - puts CodeRay::Duo[:ruby, :terminal].highlight(source) - end + include Printer end end
Use pretty print powers from Printer module
diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb index abc1234..def5678 100644 --- a/config/initializers/wrap_parameters.rb +++ b/config/initializers/wrap_parameters.rb @@ -8,6 +8,6 @@ # end # To enable root element in JSON for ActiveRecord objects. -# ActiveSupport.on_load(:active_record) do -# self.include_root_in_json = true -# end +ActiveSupport.on_load(:active_record) do + self.include_root_in_json = false +end
Make sure root element is not being returned
diff --git a/cookbooks/burthorpe/recipes/default.rb b/cookbooks/burthorpe/recipes/default.rb index abc1234..def5678 100644 --- a/cookbooks/burthorpe/recipes/default.rb +++ b/cookbooks/burthorpe/recipes/default.rb @@ -4,3 +4,10 @@ quiet false action [:install, :dump_autoload] end + +bash "migrate_db" do + user "vagrant" + code <<-EOH + php /vagrant/burthorpe/artisan migrate + EOH +end
Migrate database after composer install
diff --git a/core/spec/lib/spree/core/testing_support/factories/variant_property_rule_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/variant_property_rule_factory_spec.rb index abc1234..def5678 100644 --- a/core/spec/lib/spree/core/testing_support/factories/variant_property_rule_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/variant_property_rule_factory_spec.rb @@ -0,0 +1,14 @@+ENV['NO_FACTORIES'] = "NO FACTORIES" + +require 'spec_helper' +require 'spree/testing_support/factories/variant_property_rule_factory' + +RSpec.describe 'variant property rule factory' do + let(:factory_class) { Spree::VariantPropertyRule } + + describe 'variant property rule' do + let(:factory) { :variant_property_rule } + + it_behaves_like 'a working factory' + end +end
Test variant property rule factory
diff --git a/lib/extensions/generic_view_paths.rb b/lib/extensions/generic_view_paths.rb index abc1234..def5678 100644 --- a/lib/extensions/generic_view_paths.rb +++ b/lib/extensions/generic_view_paths.rb @@ -3,7 +3,7 @@ class PathSet attr_accessor :active_scaffold_paths - def find_template_with_active_scaffold(original_template_path, format = nil) + def find_template_with_active_scaffold(original_template_path, format = nil, html_fallback = true) begin find_template_without_active_scaffold(original_template_path, format) rescue MissingTemplate
Fix for latest rails edge
diff --git a/passkeep2.gemspec b/passkeep2.gemspec index abc1234..def5678 100644 --- a/passkeep2.gemspec +++ b/passkeep2.gemspec @@ -20,6 +20,8 @@ gem.test_files = Dir['spec/**/*'] gem.require_paths = ['lib'] + gem.add_dependency 'trollop', '~> 2.1', '>= 2.1.2' + gem.add_development_dependency 'bundler', '~> 1.10' gem.add_development_dependency 'rake', '~> 10.0' gem.add_development_dependency 'rspec', '~> 3.0'
Add trollop as a dependency
diff --git a/app/helpers/repos_helper.rb b/app/helpers/repos_helper.rb index abc1234..def5678 100644 --- a/app/helpers/repos_helper.rb +++ b/app/helpers/repos_helper.rb @@ -1,6 +1,6 @@ module ReposHelper def wanna_triage_button(repo, html_class: "") - path = user_signed_in? ? repo_subscriptions_path(repo_id: repo.id) : user_omniauth_authorize_path(:github) + path = user_signed_in? ? repo_subscriptions_path(repo_id: repo.id) : user_omniauth_authorize_path(:github, origin: request.fullpath) button_to "I Want to Triage #{repo.path}", path, class: "button #{html_class}" end -end+end
Add origin path to authorize path helper
diff --git a/lib/rembrandt/engines/web_service.rb b/lib/rembrandt/engines/web_service.rb index abc1234..def5678 100644 --- a/lib/rembrandt/engines/web_service.rb +++ b/lib/rembrandt/engines/web_service.rb @@ -1,3 +1,4 @@+require 'net/http' require 'uri' module Rembrandt
Add missing require for net/http
diff --git a/lib/services/notification_service.rb b/lib/services/notification_service.rb index abc1234..def5678 100644 --- a/lib/services/notification_service.rb +++ b/lib/services/notification_service.rb @@ -1,5 +1,5 @@ # -# Copyright (C) 2014 Instructure, Inc. +# Copyright (C) 2014-2016 Instructure, Inc. # # This file is part of Canvas. # @@ -20,25 +20,34 @@ module Services class NotificationService - DEFAULT_CONFIG = { - notification_service_queue_name: 'notification-service' - }.freeze + def self.process(global_id, body, type, to) + return unless notification_queue.present? - def self.process(global_id, body, type, to) - self.notification_queue.send_message({ - 'global_id' => global_id, - 'type' => type, - 'message' => body, - 'target' => to, - 'request_id' => RequestContextGenerator.request_id + notification_queue.send_message({ + global_id: global_id, + type: type, + message: body, + target: to, + request_id: RequestContextGenerator.request_id }.to_json) end - def self.notification_queue - return @notification_queue if defined?(@notification_queue) - @config ||= DEFAULT_CONFIG.merge(ConfigFile.load('notification_service').try(:symbolize_keys)) - sqs = AWS::SQS.new(@config) - @notification_queue = sqs.queues.named(@config[:notification_service_queue_name]) + class << self + private + + def notification_queue + return nil if config.blank? + + @notification_queue ||= begin + queue_name = config['notification_service_queue_name'] + sqs = AWS::SQS.new(config) + sqs.queues.named(queue_name) + end + end + + def config + ConfigFile.load('notification_service') || {} + end end end end
Fix nil value loading notification service config Closes CNVS-27564 Avoids causing a crash when configuration for the notification service is absent but feature flags are enabled. Also removes the default config options, meaning that notification_service_queue_name is now required in the config. Test plan: - Remove config/notification_service.yml - Enable the notification service - Message delivery should fail silently - Put in invalid credentials - It should explode - Put in correct credentials - It should work Change-Id: I68559c17c08f8efdbd9e2bf478ce0b6795f471bf Reviewed-on: https://gerrit.instructure.com/74621 Tested-by: Jenkins Reviewed-by: Steven Burnett <a0b450117c5d20a22d5c4d52bb8ae13adee003d8@instructure.com> Reviewed-by: Christina Wuest <54afda8c1ceb6b42b1ea3027c45a7930c54ff01c@instructure.com> QA-Review: Gentry Beckmann <f487939f789774cca922ca5b886632de73477ea0@instructure.com> Product-Review: Gentry Beckmann <f487939f789774cca922ca5b886632de73477ea0@instructure.com>
diff --git a/tasks/finalize-buildpack/run.rb b/tasks/finalize-buildpack/run.rb index abc1234..def5678 100644 --- a/tasks/finalize-buildpack/run.rb +++ b/tasks/finalize-buildpack/run.rb @@ -8,4 +8,8 @@ buildpack_repo_dir = 'buildpack' uncached_buildpack_dir = 'pivotal-buildpacks' +ENV['GOPATH']=buildpack_repo_dir +ENV['GOBIN']="#{buildpack_repo_dir}/.bin" +ENV['PATH']="#{buildpack_repo_dir}/.bin:#{ENV['PATH']}" + BuildpackFinalizer.new(artifact_dir, version, buildpack_repo_dir, uncached_buildpack_dir).run
Set GOPATH, GOBIN, PATH for finalizing Signed-off-by: Sam Coward <f2d9ddb83d985bcf331a113cd487aeceb5e618e4@pivotal.io>
diff --git a/bin/testsave.rb b/bin/testsave.rb index abc1234..def5678 100644 --- a/bin/testsave.rb +++ b/bin/testsave.rb @@ -0,0 +1,64 @@+#!/usr/bin/env ruby + +require 'gst' + +Gst.init +$stderr.puts "INFO: Using #{Gst.version_string}" + +unless ARGV.length == 1 + $stderr.puts "Usage: #{__FILE__} <filename>" + exit 1 +end + +def make_element(factory,name) + element = Gst::ElementFactory.make(factory, name) + if !element + $stderr.puts "FATAL: Couldn't make element #{name} from factory #{factory}" + exit 2 + end + element +end + +# Setup the elements +pipeline = Gst::Pipeline.new("None") +videosrc = make_element("videotestsrc","videotestsrc") +encoder = make_element("x264enc","x264enc") +queue = make_element("queue","source") +avimux = make_element("avimux","avimux") +filesink = make_element("filesink","filesink") +filesink.location = ARGV[0] + +# Setup the pipeline +pipeline.add(videosrc, encoder, queue, avimux, filesink) +videosrc >> encoder >> queue >> avimux >> filesink + +pad = avimux.get_static_pad("src") +pad.add_probe(Gst::PadProbeType.BUFFER) do |info, data| + +end +exit 2 + +# create the program's main loop +loop = GLib::MainLoop.new(nil, false) + +# listen to playback events +bus = pipeline.bus +bus.add_watch do |bus, message| + #case message.type + #when Gst::Message::EOS + # loop.quit + #when Gst::Message::ERROR + # p message.parse + # loop.quit + #end + true +end + +# start playing +pipeline.play +begin + loop.run +rescue Interrupt +ensure + pipeline.stop +end
Add the older ruby test
diff --git a/db/migrate/20151103154104_add_buffers_and_add_buffers_to_load_profiles.rb b/db/migrate/20151103154104_add_buffers_and_add_buffers_to_load_profiles.rb index abc1234..def5678 100644 --- a/db/migrate/20151103154104_add_buffers_and_add_buffers_to_load_profiles.rb +++ b/db/migrate/20151103154104_add_buffers_and_add_buffers_to_load_profiles.rb @@ -1,5 +1,7 @@ class AddBuffersAndAddBuffersToLoadProfiles < ActiveRecord::Migration def change + Technology.reset_column_information + # # Space heating space_heaters = Technology.where("`key` LIKE 'households_space_heater_heatpump%'")
Fix buffer migration when run during a deploy Multiple migrations; a previous migration added the "composite" column, this migration needs to reload the Technology class to ensure the change is picked up.
diff --git a/nyan-cat-formatter.gemspec b/nyan-cat-formatter.gemspec index abc1234..def5678 100644 --- a/nyan-cat-formatter.gemspec +++ b/nyan-cat-formatter.gemspec @@ -6,8 +6,8 @@ s.authors = ["Matt Sears"] s.email = ["matt@mattsears.com"] s.homepage = "" - s.summary = %q{TODO: Write a gem summary} - s.description = %q{TODO: Write a gem description} + s.summary = %q{Nyan Cat inspired RSpec formatter! } + s.description = %q{Nyan Cat inspired RSpec formatter! } s.rubyforge_project = "nyan-cat-formatter"
Update the name and description of the gem
diff --git a/features/step_definitions/guard_brakeman_steps.rb b/features/step_definitions/guard_brakeman_steps.rb index abc1234..def5678 100644 --- a/features/step_definitions/guard_brakeman_steps.rb +++ b/features/step_definitions/guard_brakeman_steps.rb @@ -10,7 +10,7 @@ Then /^guard should rescan the application$/ do type "e" # exit - assert_partial_output 'rescanning ["app/controllers/application_controller.rb"], running all checks', all_output + assert_matching_output 'rescanning \[?"?app\/controllers\/application_controller.rb"?\]?, running all checks', all_output end Then /^guard should scan the application$/ do
Fix tests on all builds
diff --git a/party_prawn_submarine/constants.rb b/party_prawn_submarine/constants.rb index abc1234..def5678 100644 --- a/party_prawn_submarine/constants.rb +++ b/party_prawn_submarine/constants.rb @@ -18,4 +18,7 @@ # The name of the font to use for text FONT_NAME = Gosu::default_font_name + # The text height of the buttons + BT_TEXT_HEIGHT = 30 + end
Add constant for button text height
diff --git a/rails_stdout_logging.gemspec b/rails_stdout_logging.gemspec index abc1234..def5678 100644 --- a/rails_stdout_logging.gemspec +++ b/rails_stdout_logging.gemspec @@ -7,6 +7,7 @@ gem.description = %q{Sets Rails to log to stdout} gem.summary = %q{Overrides Rails' built in logger to send all logs to stdout} gem.homepage = "https://github.com/heroku/rails_stdout_logging" + gem.license = 'MIT' gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } gem.files = `git ls-files`.split("\n")
Add license to gemspec, is MIT per https://github.com/pivotal/LicenseFinder
diff --git a/lib/omniauth/strategies/cronofy_service_account.rb b/lib/omniauth/strategies/cronofy_service_account.rb index abc1234..def5678 100644 --- a/lib/omniauth/strategies/cronofy_service_account.rb +++ b/lib/omniauth/strategies/cronofy_service_account.rb @@ -5,7 +5,7 @@ option :client_options, { :site => ::OmniAuth::Strategies::Cronofy.app_url, - :authorize_url => "#{::OmniAuth::Strategies::Cronofy.app_url}/service_accounts/oauth/authorize", + :authorize_url => "#{::OmniAuth::Strategies::Cronofy.app_url}/enterprise_connect/oauth/authorize", } def request_phase
Change service_account to enterprise_connect in oauth url
diff --git a/test/support/fake_udp_socket.rb b/test/support/fake_udp_socket.rb index abc1234..def5678 100644 --- a/test/support/fake_udp_socket.rb +++ b/test/support/fake_udp_socket.rb @@ -1,5 +1,8 @@ class FakeUdpSocket + attr_reader :buffer + TimingRegex = /\:\d+\|ms\Z/ + CounterRegex = /\:\d+\|c\Z/ def initialize @buffer = [] @@ -17,15 +20,28 @@ @buffer = [] end - def timer?(metric) - timing_messages = @buffer.grep(TimingRegex) - metric_names = timing_messages.map { |op| op.gsub(TimingRegex, '') } - metric_names.include?(metric) + def timer_metrics + @buffer.grep(TimingRegex) end - def counter?(metric, incr_by = 1) - counter_message = "#{metric}:#{incr_by}|c" - @buffer.include?(counter_message) + def timer_metric_names + timer_metrics.map { |op| op.gsub(TimingRegex, '') } + end + + def timer?(metric) + timer_metric_names.include?(metric) + end + + def counter_metrics + @buffer.grep(CounterRegex) + end + + def counter_metric_names + counter_metrics.map { |op| op.gsub(CounterRegex, '') } + end + + def counter?(metric) + counter_metric_names.include?(metric) end def inspect
Break down fake udp socket methods a bit more.
diff --git a/app/controllers/api/messages_controller.rb b/app/controllers/api/messages_controller.rb index abc1234..def5678 100644 --- a/app/controllers/api/messages_controller.rb +++ b/app/controllers/api/messages_controller.rb @@ -3,7 +3,7 @@ def index @account = Account.find(params.fetch(:account)) authorize_account_read!(@account) - @messages = account.messages + @messages = @account.messages respond_with(@messages) end
Fix bug when listing messages in api
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -10,5 +10,5 @@ supports os end -source_url 'https://github.com/chef-cookbooks/ohai' if respond_to?(:source_url) -issues_url 'https://github.com/chef-cookbooks/ohai/issues' if respond_to?(:issues_url) +source_url 'https://github.com/chef-cookbooks/ohai' +issues_url 'https://github.com/chef-cookbooks/ohai/issues'
Remove Chef 11 combatibility check
diff --git a/creek.gemspec b/creek.gemspec index abc1234..def5678 100644 --- a/creek.gemspec +++ b/creek.gemspec @@ -25,5 +25,5 @@ spec.add_development_dependency 'rspec', '~> 2.13.0' spec.add_dependency 'nokogiri', '~> 1.6.0' - spec.add_dependency 'rubyzip', '~> 0.9.9' + spec.add_dependency 'rubyzip', '>= 1.0.0' end
Change rubyzip dependency to >= 1.0
diff --git a/hero_rspec.rb b/hero_rspec.rb index abc1234..def5678 100644 --- a/hero_rspec.rb +++ b/hero_rspec.rb @@ -11,4 +11,14 @@ expect(hero.power_up).to eq 110 end + it "can power down" do + hero = Hero.new 'mike' + expect(hero.power_down).to eq 90 + end + + it "displays full hero info" do + hero = Hero.new 'mike', 25 + expect(hero.hero_info).to eq "Mike has a health of 25" + end + end
Add tests for all methods
diff --git a/pointme.gemspec b/pointme.gemspec index abc1234..def5678 100644 --- a/pointme.gemspec +++ b/pointme.gemspec @@ -1,6 +1,7 @@ # encoding: utf-8 -require "lib/pointme/version" +$:.push File.expand_path "../lib", __FILE__ +require "pointme/version" Gem::Specification.new do |s| s.name = "pointme"
Change way of requiring version file
diff --git a/pipeline/app/controllers/application_controller.rb b/pipeline/app/controllers/application_controller.rb index abc1234..def5678 100644 --- a/pipeline/app/controllers/application_controller.rb +++ b/pipeline/app/controllers/application_controller.rb @@ -1,5 +1,6 @@-class ApplicationController < ActionController::Base +class ApplicationController < ActionController::API # Prevent CSRF attacks by raising an exception. # For APIs, you may want to use :null_session instead. - protect_from_forgery with: :exception + # protect_from_forgery with: :exception + include ActionController::Serialization end
Change controller to API and desired responses to JSON objs
diff --git a/spec/integration/draft_js_compiler_spec.rb b/spec/integration/draft_js_compiler_spec.rb index abc1234..def5678 100644 --- a/spec/integration/draft_js_compiler_spec.rb +++ b/spec/integration/draft_js_compiler_spec.rb @@ -10,8 +10,12 @@ [block1, block2, block2, block1] } + let(:output_html) { + "<h2 data-key='a34sd'>Heading</h2><ul><li data-key='dodnk'>I am more <a data-entity-key='3' href='http://makenosound.com'>content</a>.</li><li data-key='dodnk'>I am more <a data-entity-key='3' href='http://makenosound.com'>content</a>.</li></ul><h2 data-key='a34sd'>Heading</h2>" + } + it "works" do - expect(compiler.call(ast)).to_not be_nil + expect(compiler.call(ast)).to eq(output_html) end
Add expected html output to test.
diff --git a/jekyll-materialdocs.gemspec b/jekyll-materialdocs.gemspec index abc1234..def5678 100644 --- a/jekyll-materialdocs.gemspec +++ b/jekyll-materialdocs.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |spec| spec.name = "jekyll-materialdocs" - spec.version = "1.1.2" + spec.version = "1.2.0" spec.authors = ["James King"] spec.email = ["hello@chromaticaldesign.com"] @@ -10,7 +10,7 @@ spec.homepage = "https://github.com/chromatical/jekyll-materialdocs" spec.license = "MIT" - spec.files = `git ls-files -z`.split("\x0").select { |f| f.match(%r{^(_layouts|_includes|LICENSE|README)}i) } + spec.files = `git ls-files -z`.split("\x0").select { |f| f.match(%r{^(assets|_layouts|_includes|LICENSE|README)}i) } spec.add_runtime_dependency "jekyll", "~> 3.4"
Fix gemspec and bump version
diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb index abc1234..def5678 100644 --- a/config/initializers/secret_token.rb +++ b/config/initializers/secret_token.rb @@ -0,0 +1 @@+Wheelomatic9000::Application.config.secret_token = ENV['SECRET_TOKEN'] || bde8eee598129768ea1d58f28d614ae4db919496f0170dd68b3ee6f2bbb2c6406faf87919a2b22d3e56b41059df5f4227afd7a476231f2e58e599431f00020d9
Set an env secret token and use default if none
diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb index abc1234..def5678 100644 --- a/config/initializers/secret_token.rb +++ b/config/initializers/secret_token.rb @@ -9,4 +9,4 @@ # Make sure your secret_key_base is kept private # if you're sharing your code publicly. -Community::Application.config.secret_key_base = 'aa4499f74569d7cfc9608471298e7d4a8cb7860bdb831fea2db67865aee9a095a8e86ac6058fe7eb588a23fe51495ca76d33eeca4359618deb4a9129e703f9bb' +Community::Application.config.secret_key_base = ENV['SECRET_TOKEN']
Remove SECRET_TOKEN and calculate a new one
diff --git a/lib/generators/sample_plugin/install_generator.rb b/lib/generators/sample_plugin/install_generator.rb index abc1234..def5678 100644 --- a/lib/generators/sample_plugin/install_generator.rb +++ b/lib/generators/sample_plugin/install_generator.rb @@ -27,10 +27,10 @@ def create_seed_file vendor "seeds.rb" do # Table created by plugin - test = Test.new - test.test_id = 234 - test.test_name = "plgin test" - test.save! + # test = Test.new + # test.test_id = 234 + # test.test_name = "plgin test" + # test.save! #Table that is in application hickwall = Hickwall.new @@ -39,6 +39,10 @@ end end + def generate_forums_table + generate "scaffold", "forums title:string description:text" + end + end end
Use genrate scaffold generator method
diff --git a/lib/netsuite/records/vendor_payment_apply_list.rb b/lib/netsuite/records/vendor_payment_apply_list.rb index abc1234..def5678 100644 --- a/lib/netsuite/records/vendor_payment_apply_list.rb +++ b/lib/netsuite/records/vendor_payment_apply_list.rb @@ -1,31 +1,11 @@ module NetSuite module Records - class VendorPaymentApplyList - include Support::Fields + class VendorPaymentApplyList < Support::Sublist include Namespaces::TranPurch - fields :apply + sublist :apply, VendorPaymentApply - def initialize(attributes = {}) - initialize_from_attributes_hash(attributes) - end - - def apply=(applies) - case applies - when Hash - @applies = [VendorPaymentApply.new(applies)] - when Array - @applies = applies.map { |apply| VendorPaymentApply.new(apply) } - end - end - - def applies - @applies ||= [] - end - - def to_record - { "#{record_namespace}:apply" => applies.map(&:to_record) } - end + alias :applies :apply end end
Refactor VendorPaymentApplyList to use Support::Sublist
diff --git a/growl-test.rb b/growl-test.rb index abc1234..def5678 100644 --- a/growl-test.rb +++ b/growl-test.rb @@ -1,7 +1,11 @@+require 'rubygems' +require 'bundler/setup' + require 'growl' -Growl.notify { - self.message = "<a href='http://www.google.com'>This is a test!</a>" - self.icon = :Safari - sticky! -} +notify = Growl.new +notify.title = "Hello, World!" +notify.message = "This is a message to you!" +notify.url = "https://google.com" + +notify.run
Add url to growl test file; update code
diff --git a/webapp/plugins/raw_handler/raw_handler.rb b/webapp/plugins/raw_handler/raw_handler.rb index abc1234..def5678 100644 --- a/webapp/plugins/raw_handler/raw_handler.rb +++ b/webapp/plugins/raw_handler/raw_handler.rb @@ -10,4 +10,8 @@ app.headers({"Content-Type" => "text/plain"}) end + action :write do |path, app| + app.body("Wrote #{path} with:\n\n#{app.params[:content]}") + end + end
Add write action placeholder for raw handler
diff --git a/lib/hubdown/page_builder.rb b/lib/hubdown/page_builder.rb index abc1234..def5678 100644 --- a/lib/hubdown/page_builder.rb +++ b/lib/hubdown/page_builder.rb @@ -0,0 +1,53 @@+module Hubdown + class PageBuilder + + def initialize body + @body = body + end + + def get_page + page = "#{get_head}#{@body}#{get_closing}" + page + end + + def get_head + opening = <<EOF + <!DOCTYPE html> + <html> + <head> + <title>OUTPUT</title> + <link href="https://a248.e.akamai.net/assets.github.com/assets/github-8dd5c1a834790ecb6b900ff7b2d9a1377fd5aef1.css" media="screen" rel="stylesheet" type="text/css" /> + <link href="https://a248.e.akamai.net/assets.github.com/assets/github2-4591451faf42b997173d752065f048736e6f9872.css" media="screen" rel="stylesheet" type="text/css" /> + <style> + #wrapper { + width: 920px; + margin: 20px auto; + } + </style> + </head> + + <body> + <div id="wrapper"> + <div id="slider"> + <div class="frames"> + <div class="frame"> + <div id="readme" class="clearfix announce instapaper_body md"> + <span class="name">FILE_NAME</span> + <article class="markdown-body entry-content"> +EOF + end + + def get_closing + closing = <<EOF + </article> + </div> + </div> + </div> + </div> + </div> + </body> + </html> +EOF + end + end +end
Add object for creating page PageBuilder will have the responsibility of creating a full functioning page. This may mean offloading to ERB or scraping CSS links in the future
diff --git a/routes/general.rb b/routes/general.rb index abc1234..def5678 100644 --- a/routes/general.rb +++ b/routes/general.rb @@ -3,11 +3,6 @@ module Routing module General def self.registered(app) - app.head '/' do - status :ok - body "" - end - app.get '/' do # Total uploads # Disabled until I have time to cache this route
Disable my weird, custom head request response
diff --git a/cognizant.gemspec b/cognizant.gemspec index abc1234..def5678 100644 --- a/cognizant.gemspec +++ b/cognizant.gemspec @@ -19,6 +19,11 @@ gem.add_development_dependency "redcarpet" gem.add_development_dependency "yard" + # cognizantd gem.add_dependency "eventmachine" gem.add_dependency "state_machine" + + # cognizant + gem.add_dependency "gli" + gem.add_dependency "formatador" end
Add gli and formatador to dependencies.
diff --git a/Casks/cycling74-max.rb b/Casks/cycling74-max.rb index abc1234..def5678 100644 --- a/Casks/cycling74-max.rb +++ b/Casks/cycling74-max.rb @@ -4,7 +4,7 @@ url "http://filepivot.appspot.com/projects/maxmspjitter/files/Max#{version.sub('-','_').gsub('.','')}.dmg" name 'Max' - homepage 'http://cycling74.com' + homepage 'https://cycling74.com/' license :commercial tags :vendor => 'Cycling ‘74'
Fix homepage to use SSL in Max Cask The HTTP URL is already getting redirected to HTTPS. Using the HTTPS URL directly makes it more secure and saves a HTTP round-trip.
diff --git a/lib/tasks/factory_girl.rake b/lib/tasks/factory_girl.rake index abc1234..def5678 100644 --- a/lib/tasks/factory_girl.rake +++ b/lib/tasks/factory_girl.rake @@ -0,0 +1,18 @@+namespace :factory_girl do + desc "Verify that all FactoryGirl factories are valid" + task lint: :environment do + if Rails.env.test? + require "factory_girl_rails" + # TODO: Remove patching of Sequel + require_relative "../../spec/support/sequel" + + DatabaseCleaner.clean_with(:truncation) + DatabaseCleaner.cleaning do + FactoryGirl.lint(traits: true) + end + else + system("bundle exec rake factory_girl:lint RAILS_ENV='test'") + fail if $?.exitstatus.nonzero? + end + end +end
Add Rake task for Factory linting
diff --git a/lib/tasks/kaleidoscope.rake b/lib/tasks/kaleidoscope.rake index abc1234..def5678 100644 --- a/lib/tasks/kaleidoscope.rake +++ b/lib/tasks/kaleidoscope.rake @@ -0,0 +1,9 @@+module Kaleidoscope + module Task + def self.obtain_class + class_name = ENV['CLASS'] || ENV['class'] + raise "Must specify CLASS" unless class_name + class_name + end + end +end
Add rake task to lib
diff --git a/EPSCommandCell.podspec b/EPSCommandCell.podspec index abc1234..def5678 100644 --- a/EPSCommandCell.podspec +++ b/EPSCommandCell.podspec @@ -22,4 +22,5 @@ s.source_files = 'Pod/Classes' s.public_header_files = 'Pod/Classes/**/*.h' + s.dependency 'ReactiveCocoa', '~> 2.3' end
Add RAC as a dependency.
diff --git a/redhead.gemspec b/redhead.gemspec index abc1234..def5678 100644 --- a/redhead.gemspec +++ b/redhead.gemspec @@ -9,7 +9,6 @@ s.files = Dir["{lib/**/*,test/**/*}"] + %w[redhead.gemspec .gemtest LICENSE Gemfile rakefile README.md] s.require_path = "lib" s.test_files = Dir["test/*"] - s.has_rdoc = false s.add_development_dependency "rake" s.add_development_dependency "rspec" end
Remove deprecated has_rdoc= from gemspec.
diff --git a/spec/node_spec.rb b/spec/node_spec.rb index abc1234..def5678 100644 --- a/spec/node_spec.rb +++ b/spec/node_spec.rb @@ -2,18 +2,21 @@ describe DripDrop::Node do describe "initialization" do - before do - @ddn = DripDrop::Node.new {} + before(:all) do + @ddn = DripDrop::Node.new { + zmq_subscribe(rand_addr,:bind) #Keeps ZMQMachine Happy + } @ddn.start - sleep 0.1 + sleep 1 end it "should start EventMachine" do - pending("This seems to work in practice, but we get false negatives") + pending "This is not repeatedly reliable" EM.reactor_running?.should be_true end it "should start ZMQMachine" do + pending "This is not repeatedly reliable" @ddn.zm_reactor.running?.should be_true end @@ -24,15 +27,16 @@ describe "shutdown" do before do - @ddn = DripDrop::Node.new {} + @ddn = DripDrop::Node.new { + zmq_subscribe(rand_addr,:bind) #Keeps ZMQMachine Happy + } @ddn.start - sleep 0.1 + sleep 0.1 @ddn.stop rescue nil sleep 0.1 end it "should stop EventMachine" do - pending("This seems to work in practice, but we get false negatives") EM.reactor_running?.should be_false end
Speed up node reactor start/stop test.
diff --git a/scripts/chrome.rb b/scripts/chrome.rb index abc1234..def5678 100644 --- a/scripts/chrome.rb +++ b/scripts/chrome.rb @@ -1,6 +1,33 @@ require 'tmpdir' +require 'os' def run_chrome(language) + if OS.mac? + run_chrome_macos(language) + elsif OS.windows? + run_chrome_windows(language) + else + $stderr.puts "Launching Chrome on this OS (#{RUBY_PLATFORM}) is not implemented." + end +end + +def run_chrome_windows(language) + user_data_dir = Dir.mktmpdir('marinara') + extension_dir = File.join(Dir.pwd, 'package') + + args = [ + '--no-first-run', + "--lang=#{language}", + "--user-data-dir=#{user_data_dir}", + "--load-extension=#{extension_dir}", + 'about:blank' + ] + + puts "Running Chrome with locale #{language}." + system('\Program Files (x86)\Google\Chrome\Application\chrome.exe', *args) +end + +def run_chrome_macos(language) user_data_dir = Dir.mktmpdir('marinara') extension_dir = File.join(Dir.pwd, 'package')
Add ability to launch Chrome on Windows from scripts.
diff --git a/spec/adapters/spec_helper.rb b/spec/adapters/spec_helper.rb index abc1234..def5678 100644 --- a/spec/adapters/spec_helper.rb +++ b/spec/adapters/spec_helper.rb @@ -1,7 +1,7 @@ require 'rubygems' -require File.join(File.dirname(__FILE__), '../spec_config.rb') unless Object.const_defined?('Sequel') $:.unshift(File.join(File.dirname(__FILE__), "../../lib/")) require 'sequel_core' Sequel.quote_identifiers = false end +require File.join(File.dirname(__FILE__), '../spec_config.rb')
Load sequel_core before spec_config in the adapter specs
diff --git a/spec/models/safe_erb_spec.rb b/spec/models/safe_erb_spec.rb index abc1234..def5678 100644 --- a/spec/models/safe_erb_spec.rb +++ b/spec/models/safe_erb_spec.rb @@ -0,0 +1,20 @@+require File.dirname(__FILE__) + '/../spec_helper' + +# Verify that our safe_erb patches are working. +describe "An ERB template" do + before :each do + @template = ERB.new('<%= var %>') + end + + it "should not raise an error when untained values are interpolated" do + var = "foo" + assert_equal var, @template.result(binding) + end + + it "should raise an error when tained values are interpolated" do + assert_raise RuntimeError do + var = "foo".taint + @template.result(binding) + end + end +end
Add test cases verifying that SafeERB works If an upgrade to Rails breaks SafeERB, we'd like to find out.
diff --git a/test/integration/search_test.rb b/test/integration/search_test.rb index abc1234..def5678 100644 --- a/test/integration/search_test.rb +++ b/test/integration/search_test.rb @@ -0,0 +1,40 @@+require 'test_helper' + +class SearchTest < ActionDispatch::IntegrationTest + setup do + setup_groonga_database + @current_site = create(:site) + @other_site = create(:site) + switch_domain(@current_site.fqdn) + @indexer = PostIndexer.new + end + + teardown do + teardown_groonga_database + end + + test 'only posts of the current site' do + create_post(@current_site, 'current site', 'contents...') + create_post(@other_site, 'other site', 'contents...') + + visit '/' + + fill_in 'query[keywords]', with: 'contents' + + click_on 'search' + + within('main') do + assert_equal '「contents」を含む記事は1件見つかりました。', find('p').text + within('ol') do + assert_equal 'current site', find('a').text + end + end + end + + private + + def create_post(site, title, body) + post = create(:post, site: site, title: title, body: body) + @indexer.add(post) + end +end
Add a test for only posts of the current site
diff --git a/lib/quotes.rb b/lib/quotes.rb index abc1234..def5678 100644 --- a/lib/quotes.rb +++ b/lib/quotes.rb @@ -1,13 +1,12 @@ require 'quotes/version' -# require all support files -require_relative 'quotes/support/validation_helpers' +require './lib/quotes/helpers/validation_helpers' -require_relative 'quotes/entities' -require_relative 'quotes/services' -require_relative 'quotes/gateways' -require_relative 'quotes/tasks' -require_relative 'quotes/use_cases' +require './lib/quotes/entities' +require './lib/quotes/services' +require './lib/quotes/gateways' +require './lib/quotes/tasks' +require './lib/quotes/use_cases' module Quotes end
Use 'require' rather than require_relative
diff --git a/spec/lib/user_importer_spec.rb b/spec/lib/user_importer_spec.rb index abc1234..def5678 100644 --- a/spec/lib/user_importer_spec.rb +++ b/spec/lib/user_importer_spec.rb @@ -1,10 +1,10 @@ require 'rails_helper' describe 'UserImporter' do - + let(:filename) { File.join(Rails.root, "spec", "resources", "anonymized_user_data.xlsx") } + let(:subject) { UserImporter.new(filename) } it 'instantiates with a filename' do - filename = File.join(Rails.root, "spec", "resources", "anonymized_user_data.xlsx") - expect { UserImporter.new(filename) }.to_not raise_error + expect { subject }.to_not raise_error end end
Add filename & subject to let blocks in importer spec
diff --git a/spec/models/instrument_spec.rb b/spec/models/instrument_spec.rb index abc1234..def5678 100644 --- a/spec/models/instrument_spec.rb +++ b/spec/models/instrument_spec.rb @@ -2,4 +2,5 @@ describe Instrument do it { should respond_to(:questions) } + it { should respond_to(:surveys) } end
Add surveys to instrument spec
diff --git a/spec/url_referenceable_spec.rb b/spec/url_referenceable_spec.rb index abc1234..def5678 100644 --- a/spec/url_referenceable_spec.rb +++ b/spec/url_referenceable_spec.rb @@ -7,4 +7,9 @@ end describe MockUrlReferenceable do + describe '#url' do + end + + describe '#parent_url' do + end end
Add stubs for the expected methods.
diff --git a/lib/gitlab.rb b/lib/gitlab.rb index abc1234..def5678 100644 --- a/lib/gitlab.rb +++ b/lib/gitlab.rb @@ -0,0 +1,55 @@+require 'gitlab' +require 'httparty' +require 'retries' + +module Provider + # GitLab SSH public key provider + class GitLab + # @param [Hash] options GitLab credentials for Gitlab::Client + # @option options [String] :private_token OAuth2 access token for + # authentication + # @option options [String] :endpoint Base URL for API requests. + # default: https://api.gitlab.com/v3 + def initialize(options = {}) + default_options = { endpoint: ENV['GITLAB_API_ENDPOINT'] || 'https://gitlab.com/api/v3' } + @client = Gitlab.client(default_options.merge(options)) + current_user = @client.user + @web_url = current_user.web_url.gsub(current_user.username, '') + @is_admin = current_user.is_admin + end + + # @param [String] group GitLab group + # @return [Hash] Hash with keys by username with +SortedSet+s + def keys_for_whole_group(group) + #@client.group_members(group).each do |member| + # keys_for_user(member.username) + #end + keys_for_members(@client.group_members(group)) + end + + # @param [String] user + # @return [Array] array of keys + private def keys_for_user(user) + with_retries do + if @is_admin + # get using the api, availabe only to admins currently + @client.ssh_keys(user).map(&:key) + else + # get via the web, from user.keys + san_pattern = /[^\p{alpha}0-9\.\-]/ # works with international letters too + resp = HTTParty.get("#{@web_url}/#{user.gsub(san_pattern, '')}.keys") + raise 'can\'t retrieve key' unless resp.code == 200 + resp.body.split("\n") + end + end + end + + private def keys_for_members(members) + credentials = {} + members.each do |member| + credentials[member.username] = SortedSet.new keys_for_user(member.username) + end + credentials + end + end +end
Add GitLab SSH key provider
diff --git a/lib/laadur.rb b/lib/laadur.rb index abc1234..def5678 100644 --- a/lib/laadur.rb +++ b/lib/laadur.rb @@ -1,33 +1,21 @@ require "laadur/version" require 'optparse' -require 'pp' module Laadur class CLI def initialize - puts 'test' - options = {} - - optparse = OptionParser.new do|opts| - # TODO: Put command-line options here - - # This displays the help screen, all programs are - # assumed to have this option. - opts.on( '-h', '--help', 'Display this screen' ) do - puts opts - exit + o = OptionParser.new do |o| + o.banner = "Available options: " + o.on('-o', '--option', String, 'this option does nothing ') do |test| + p test.to_s end end - # Parse the command-line. Remember there are two forms - # of the parse method. The 'parse' method simply parses - # ARGV, while the 'parse!' method parses ARGV and removes - # any options found there, as well as any parameters for - # the options. What's left is the list of files to resize. - optparse.parse! - - pp "Options:", options - pp "ARGV:", ARGV - + begin o.parse! ARGV + rescue OptionParser::InvalidOption => e + puts e + puts o + exit 1 + end end end -end +end
Raise intelligent error on invalid argument
diff --git a/lib/resume.rb b/lib/resume.rb index abc1234..def5678 100644 --- a/lib/resume.rb +++ b/lib/resume.rb @@ -3,8 +3,7 @@ module Resume VERSION = '1.0' - # REMOTE_REPO = "https://raw.githubusercontent.com/paulfioravanti/resume/master" - REMOTE_REPO = "https://raw.githubusercontent.com/paulfioravanti/resume/ja-resume-refactor" + REMOTE_REPO = "https://raw.githubusercontent.com/paulfioravanti/resume/master" def self.generate CLI::Application.start
Change repo to point at master
diff --git a/extras/c12.rb b/extras/c12.rb index abc1234..def5678 100644 --- a/extras/c12.rb +++ b/extras/c12.rb @@ -0,0 +1,57 @@+require 'open3' +require 'tempfile' + +def to_c(input, regs) + prologue = [ + '#include <stdio.h>', + 'int main() {', + ] + regs.map { |k, v| + " int #{k} = #{v};" + } + + come_from = Hash.new { |h, k| h[k] = [] } + + body = input.map.with_index { |line, i| + words = line.split + case words[0] + when 'cpy'; "#{words[2]} = #{words[1]};" + when 'inc'; "++#{words[1]};" + when 'dec'; "--#{words[1]};" + when 'jnz' + target = i + Integer(words[2]) + come_from[target] << i + "if (#{words[1]} != 0) { goto line#{target}; } // line #{i}" + end + }.flat_map.with_index { |line, i| [ + ("line#{i}: // from #{come_from[i]}" if come_from.has_key?(i)), + " #{line}", + ].compact } + + epilogue = [ + ' printf("%d\n", a);', + ' return 0;', + '}', + ] + + prologue + body + epilogue +end + +cval = begin + arg = ARGV.find { |x| x.start_with?(?-) && x.include?(?c) } + arg ? Integer(arg[(arg.index(?c) + 1)..-1]) : 0 +end + +verbose = ARGV.any? { |a| a.start_with?(?-) && a.include?(?v) } +ARGV.reject! { |x| x.start_with?(?-) } +code = to_c(ARGF.readlines, {a: 0, b: 0, c: cval, d: 0}) +puts code if verbose + +OUTPUT = 'compiled' + +File.delete(OUTPUT) if File.exist?(OUTPUT) + +Open3.popen2('gcc', '-O2', '-xc', "-o#{OUTPUT}", ?-) { |stdin, stdout, _| + stdin.puts(code) +} + +system("./#{OUTPUT}")
Add day 12 C compiler
diff --git a/spec/factories.rb b/spec/factories.rb index abc1234..def5678 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -35,6 +35,7 @@ fork false homepage 'http://rubyonrails.org' github_organisation + stargazers_count 10_000 end factory :user do
Add stargazers_count to repo factory
diff --git a/spec/factories.rb b/spec/factories.rb index abc1234..def5678 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -1,11 +1,16 @@ FactoryGirl.define do + factory :hero do + name 'McCree' + role 'offense' + end + factory :map do - name "Dorado" - map_type "escort" + name 'Dorado' + map_type 'escort' end factory :map_segment do map - name "Attacking: Payload 1" + name 'Attacking: Payload 1' end end
Add Hero factory for tests
diff --git a/spec/feed_spec.rb b/spec/feed_spec.rb index abc1234..def5678 100644 --- a/spec/feed_spec.rb +++ b/spec/feed_spec.rb @@ -33,7 +33,7 @@ expect(fetcher_object_id_1).to eq(fetcher_object_id_2) end - it 'raises RSSCache::Feed::FormatError on non-RSS and non-Atom feeds' do + it 'raises RSSCache::Feed::FormatError on unsupported feeds' do error = RSSCache::Feed::FormatError expect { RSSCache::Feed.new url: @xml_feed_url }.to raise_error(error) end
Make spec description a little less ambiguous
diff --git a/VENPromotionsManager.podspec b/VENPromotionsManager.podspec index abc1234..def5678 100644 --- a/VENPromotionsManager.podspec +++ b/VENPromotionsManager.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "VENPromotionsManager" - s.version = "0.2.0" + s.version = "0.2.1" s.summary = "Definition, management and control of in-app location based promotions." s.description = <<-DESC VENPromotionsManager enables easy definition, management and control of in-app location based promotions including the following:
Update podspec version to 0.2.1
diff --git a/lib/aws/xray/client.rb b/lib/aws/xray/client.rb index abc1234..def5678 100644 --- a/lib/aws/xray/client.rb +++ b/lib/aws/xray/client.rb @@ -22,7 +22,7 @@ sock = @sock || UDPSocket.new begin - len = sock.send(payload, 0, @host, @port) + len = sock.send(payload, Socket::MSG_DONTWAIT, @host, @port) $stderr.puts("Can not send all bytes: #{len} sent") if payload.size != len rescue SystemCallError, SocketError => e begin
Set Socket::MSG_DONTWAIT not to be blocked I don't have problems without this flag, but it might be blocked in some cases (still I'm not sure).
diff --git a/lib/nanoc-nbconvert.rb b/lib/nanoc-nbconvert.rb index abc1234..def5678 100644 --- a/lib/nanoc-nbconvert.rb +++ b/lib/nanoc-nbconvert.rb @@ -0,0 +1,9 @@+require 'nanoc' + +module Nanoc + module Filters + autoload 'NBConvert', 'nanoc/filters/nbconvert' + + Nanoc::Filter.register '::Nanoc::Filters::NBConvert', :nbconvert + end +end
Add the missing file, bump the version to 0.1.1.-a
diff --git a/lib/pry-rescue/rack.rb b/lib/pry-rescue/rack.rb index abc1234..def5678 100644 --- a/lib/pry-rescue/rack.rb +++ b/lib/pry-rescue/rack.rb @@ -0,0 +1,10 @@+require 'pry-rescue' +class PryRescue + def initialize(app) + @app = app + end + + def call(env) + Pry::rescue{ @app.call(env) } + end +end
Add a Rack Middleware, thanks blaines http://news.ycombinator.com/item?id=4439989
diff --git a/lib/retention_magic.rb b/lib/retention_magic.rb index abc1234..def5678 100644 --- a/lib/retention_magic.rb +++ b/lib/retention_magic.rb @@ -6,6 +6,7 @@ end mattr_accessor :activation_counter_columns do [] + end mattr_accessor :retention_models do [] end
Fix error in RetentionMagic config
diff --git a/src/helpers/error_handler.rb b/src/helpers/error_handler.rb index abc1234..def5678 100644 --- a/src/helpers/error_handler.rb +++ b/src/helpers/error_handler.rb @@ -1,7 +1,7 @@ module ErrorHandler def self.registered(app) app.error 404 do - json message: 'Not Found' + json message: 'Not Found' if response.body.empty? end app.error 500 do Log.error "#{env['sinatra.error'].class}: #{env['sinatra.error'].message}"
Return original response body when response body already exists
diff --git a/fluffle.gemspec b/fluffle.gemspec index abc1234..def5678 100644 --- a/fluffle.gemspec +++ b/fluffle.gemspec @@ -14,14 +14,14 @@ s.required_ruby_version = '>= 2.1' - s.add_dependency 'bunny', '~> 2.6.1' - s.add_dependency 'concurrent-ruby', '~> 1.0.2' - s.add_dependency 'oj', '~> 2.17.1' - s.add_dependency 'uuidtools', '~> 2.1.5' + s.add_dependency 'bunny', '~> 2.6' + s.add_dependency 'concurrent-ruby', '~> 1.0' + s.add_dependency 'oj', '~> 2.17' + s.add_dependency 'uuidtools', '~> 2.1' - s.add_development_dependency 'pry', '~> 0.10.1' - s.add_development_dependency 'rake', '~> 11.2.2' - s.add_development_dependency 'rspec', '~> 3.4.0' + s.add_development_dependency 'pry', '~> 0.10' + s.add_development_dependency 'rake', '~> 11.0' + s.add_development_dependency 'rspec', '~> 3.0' s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- test/*`.split("\n")
Update gemspec dependency versions to be more lenient
diff --git a/closed_issues.rb b/closed_issues.rb index abc1234..def5678 100644 --- a/closed_issues.rb +++ b/closed_issues.rb @@ -18,8 +18,8 @@ results.reject { |i| !i.pull_request? } puts "Milestone Statistics for: #{results.first.milestone.title}" -puts "NUMBER,AUTHOR,ASSIGNEE,LABELS" +puts "NUMBER,TITLE,AUTHOR,ASSIGNEE,LABELS" puts "--------------------------------------------------" results.each do |i| - puts "#{i.number},#{i.user.login},#{i.assignee && i.assignee.login},#{i.labels.collect(&:name).join(" ")}" + puts "#{i.number},#{i.title},#{i.user.login},#{i.assignee && i.assignee.login},#{i.labels.collect(&:name).join(" ")}" end
Add Title of PR to output Need the Title of the PR to figure out what might be able to go in the changelog.
diff --git a/config/initializers/host.rb b/config/initializers/host.rb index abc1234..def5678 100644 --- a/config/initializers/host.rb +++ b/config/initializers/host.rb @@ -1,5 +1,25 @@-HOST = ENV['HOST'] || { - 'development' => 'http://localhost:3000', +development_host = if Rails.env.development? + port = ENV['PORT'] || 3000 + if ENV['START_LOCALTUNNEL'] + tunnel = LocalTunnel::Tunnel.new(port, nil) + response = tunnel.register_tunnel + + "http://#{response['host']}".tap do |localtunnel_host| + `echo #{localtunnel_host} > .localtunnel_host` + Rails.logger.info("Wrote to .localtunnel_host #{localtunnel_host}") + Process.detach fork { tunnel.start_tunnel } + end + elsif ENV['READ_LOCALTUNNEL'] + `cat .localtunnel_host`.strip.tap do |localtunnel_host| + Rails.logger.info("Read from .localtunnel_host #{localtunnel_host}") + end + else + "http://localhost:#{port}" + end +end + +HOST = ENV['HOST'] || ENV['CANONICAL_URL'] || { + 'development' => development_host, 'test' => 'http://example.com', 'production' => 'http://clahub.com' }[Rails.env]
Allow HOST to be set by CANONICAL_HOST env var
diff --git a/config/initializers/rack-attack.rb b/config/initializers/rack-attack.rb index abc1234..def5678 100644 --- a/config/initializers/rack-attack.rb +++ b/config/initializers/rack-attack.rb @@ -11,7 +11,7 @@ headers = { 'X-RateLimit-Limit' => match_data[:limit].to_s, 'X-RateLimit-Remaining' => '0', - 'X-RateLimit-Reset' => (now + (match_data[:period] - now.to_i % match_data[:period])).to_s + 'X-RateLimit-Reset' => (now + (match_data[:period] - now.to_i % match_data[:period])).iso8601(6) } [429, headers, [{ error: 'Throttled' }.to_json]]
Fix reset date format when rate limited
diff --git a/test/unit/helpers/locations_options_helper_test.rb b/test/unit/helpers/locations_options_helper_test.rb index abc1234..def5678 100644 --- a/test/unit/helpers/locations_options_helper_test.rb +++ b/test/unit/helpers/locations_options_helper_test.rb @@ -14,7 +14,7 @@ end option_set.css("option")[1].tap do |option| - assert_equal nil, option.attributes["selected"] + assert_nil option.attributes["selected"] assert_equal location.name, option.text assert_equal location.slug, option["value"] end @@ -25,7 +25,7 @@ option_set = Nokogiri::HTML::DocumentFragment.parse(locations_options([location])) option_set.css("option")[0].tap do |option| - assert_equal nil, option.attributes["selected"] + assert_nil option.attributes["selected"] assert_equal "All locations", option.text assert_equal "all", option["value"] end
Fix deprecation calling assert_equal nil Fix the deprecation: ``` DEPRECATED: Use assert_nil if expecting nil from test/unit/helpers/locations_options_helper_test.rb:17. This will fail in Minitest 6. ```
diff --git a/smoke_test/steps/prison_booking_cancelled.rb b/smoke_test/steps/prison_booking_cancelled.rb index abc1234..def5678 100644 --- a/smoke_test/steps/prison_booking_cancelled.rb +++ b/smoke_test/steps/prison_booking_cancelled.rb @@ -14,7 +14,7 @@ private def expected_email_subject - 'CANCELLED: %s on %s' % [ + 'CANCELLED: Visit for %s on %s' % [ state.prisoner.full_name, state.first_slot_date_prison_format ]
Fix email expectation in smoke test Test was expecting subject with format 'CANCELLED: %s on %s' but email subject is 'CANCELLED: Visit for %s on %s'
diff --git a/config/deploy.rb b/config/deploy.rb index abc1234..def5678 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -1,4 +1,14 @@-require 'formaggio/capistrano' +require 'formaggio/capistrano/default_attributes' +require 'formaggio/capistrano/figs' +require 'formaggio/capistrano/config' +require 'formaggio/capistrano/assets' +require 'formaggio/capistrano/bundler' +require 'formaggio/capistrano/cache' +require 'formaggio/capistrano/multistage' +require 'formaggio/capistrano/rvm' +require 'formaggio/capistrano/environment' +require 'formaggio/capistrano/server/passenger' + set :app_title, 'getit' set :stages, ['staging', 'qa', 'production', 'reindex'] set :rvm_ruby_string, "ruby-2.5.5"
Remove formaggio tagging for production
diff --git a/config/routes.rb b/config/routes.rb index abc1234..def5678 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -2,7 +2,7 @@ # Put this before Devise during the transition so the old tests still work. devise_for :users, controllers: { registrations: :registrations } # The following should be where Devise goes after login. - get "user_root_path", to: "outages#index" + get "user_root", to: "outages#index" root "welcome#index"
Fix the route after login.
diff --git a/config/routes.rb b/config/routes.rb index abc1234..def5678 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,11 @@ Issuet::Application.routes.draw do - root 'home#index' - devise_for :users + devise_scope :user do + authenticated :user do + root 'home#index', as: :authenticated_root + end + unauthenticated :user do + root 'devise/sessions#new', as: :unauthenticated_root + end + end end
Change roots for authed and non-authed users
diff --git a/spec/authorization_spec.rb b/spec/authorization_spec.rb index abc1234..def5678 100644 --- a/spec/authorization_spec.rb +++ b/spec/authorization_spec.rb @@ -12,7 +12,7 @@ it 'returns the correct metadata', vcr: { cassette_name: 'authorization' } do expect(authorization.expires).to be_a(Time) - expect(authorization.expires).to be_within(1.second).of Time.mktime(2015, 12, 14, 21, 46, 33) + expect(authorization.expires).to be_within(1.second).of Time.gm(2015, 12, 14, 21, 46, 33) end context '#http01' do
Change from Time::mktime to Time::gm in test because .mktime uses the local timezone and the test fails if it runs on a machine configured with another timezone