diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/lib/mobility/backend/active_record/column/query_methods.rb b/lib/mobility/backend/active_record/column/query_methods.rb index abc1234..def5678 100644 --- a/lib/mobility/backend/active_record/column/query_methods.rb +++ b/lib/mobility/backend/active_record/column/query_methods.rb @@ -4,13 +4,16 @@ def initialize(attributes, **options) super attributes_extractor = @attributes_extractor - - define_method :where! do |opts, *rest| + @opts_converter = opts_converter = lambda do |opts| if i18n_keys = attributes_extractor.call(opts) opts = opts.with_indifferent_access i18n_keys.each { |attr| opts[Column.column_name_for(attr)] = opts.delete(attr) } end - super(opts, *rest) + return opts + end + + define_method :where! do |opts, *rest| + super(opts_converter.call(opts), *rest) end attributes.each do |attribute| @@ -22,15 +25,11 @@ def extended(relation) super - attributes_extractor = @attributes_extractor + opts_converter = @opts_converter mod = Module.new do define_method :not do |opts, *rest| - if i18n_keys = attributes_extractor.call(opts) - opts = opts.with_indifferent_access - i18n_keys.each { |attr| opts[Column.column_name_for(attr)] = opts.delete(attr) } - end - super(opts, *rest) + super(opts_converter.call(opts), *rest) end end relation.model.mobility_where_chain.prepend(mod)
Refactor AR Column backend QueryMethods class
diff --git a/test/integration/remote_install_test/serverspec/install_spec.rb b/test/integration/remote_install_test/serverspec/install_spec.rb index abc1234..def5678 100644 --- a/test/integration/remote_install_test/serverspec/install_spec.rb +++ b/test/integration/remote_install_test/serverspec/install_spec.rb @@ -4,6 +4,6 @@ describe 'bash' do describe command('/usr/local/bin/bash --version') do - its(:stdout) { should match /4\.3/ } + its(:stdout) { should match('4.3') } end end
Fix Rubocop style error in integration test
diff --git a/connectwise_sdk.gemspec b/connectwise_sdk.gemspec index abc1234..def5678 100644 --- a/connectwise_sdk.gemspec +++ b/connectwise_sdk.gemspec @@ -19,8 +19,8 @@ spec.require_paths = ["lib"] spec.add_development_dependency "bundler", "~> 1.3" - spec.add_development_dependency "rake" - spec.add_development_dependency "rspec" + spec.add_development_dependency "rake", "~>10.3" + spec.add_development_dependency "rspec", "~>3.0" spec.add_runtime_dependency "savon", "~> 2.0" end
Update gemspec to specify versions of dev dependencies
diff --git a/app/views/api/v1/performances/index.json.jbuilder b/app/views/api/v1/performances/index.json.jbuilder index abc1234..def5678 100644 --- a/app/views/api/v1/performances/index.json.jbuilder +++ b/app/views/api/v1/performances/index.json.jbuilder @@ -1,14 +1,14 @@ json.array! @performances do |performance| json.id performance.id.to_s - json.stage_time performance.stage_time - json.category_name performance.category.name - json.age_group performance.age_group - json.associated_host_name performance.associated_host.name - json.associated_host_country performance.associated_host.country.country_code.upcase + json.stageTime performance.stage_time + json.categoryName performance.category.name + json.ageGroup performance.age_group + json.associatedHostName performance.associated_host.name + json.associatedHostCountry performance.associated_host.country.country_code.upcase json.appearances performance.appearances.role_order do |appearance| - json.participant_name appearance.participant.full_name - json.instrument_name appearance.instrument.name + json.participantName appearance.participant.full_name + json.instrumentName appearance.instrument.name json.role appearance.role.slug end end
Use camelCase in /performances API response
diff --git a/lib/locations_ng/city.rb b/lib/locations_ng/city.rb index abc1234..def5678 100644 --- a/lib/locations_ng/city.rb +++ b/lib/locations_ng/city.rb @@ -1,36 +1,27 @@ module LocationsNg class City - @@all_cities + @all_cities = LoadFile.read('cities') class << self def all - load_cities - end - - def state_query(state) - state == 'federal_capital_territory' ? 'fct' : state + @all_cities end def cities(state) - load_cities - state_query = self.state_query(state.downcase.gsub(' ', '_')) - - city_index = @@all_cities.index{ |c| c['alias'] == state_query } + state_query = state_query(state.downcase.gsub(' ', '_')) + city_index = @all_cities.index{ |c| c['alias'] == state_query } unless city_index.nil? - return @@all_cities[city_index]['cities'] + return @all_cities[city_index]['cities'] end {message: "No cities found for '#{state}'", status: 404} end private - def load_cities - @@all_cities ||= YAML.load(File.read(files_location 'cities')) - end - def files_location(file) - File.expand_path("../locations/#{file}.yml", __FILE__) + def state_query(state) + state == 'federal_capital_territory' ? 'fct' : state end end end
Refactor City class to use new LoadFile class, and use instance vars.
diff --git a/lib/slocstar/settings.rb b/lib/slocstar/settings.rb index abc1234..def5678 100644 --- a/lib/slocstar/settings.rb +++ b/lib/slocstar/settings.rb @@ -30,7 +30,12 @@ def repos - @repos ||= ENV['SLOCSTAR_REPOS'] || Dir.mktmpdir('slocstar-') + unless @repos + @repos = ENV['SLOCSTAR_REPOS'] || File.join(Dir.tmpdir, 'slocstar-repos') + Dir.mkdir(@repos) unless Dir.exists?(@repos) + end + + @repos end
Fix default path to slocstar repos
diff --git a/daimon_news_blog/daimon_news_blog.gemspec b/daimon_news_blog/daimon_news_blog.gemspec index abc1234..def5678 100644 --- a/daimon_news_blog/daimon_news_blog.gemspec +++ b/daimon_news_blog/daimon_news_blog.gemspec @@ -9,9 +9,9 @@ s.version = DaimonNewsBlog::VERSION s.authors = ["Masafumi Yokoyama"] s.email = ["yokoyama@clear-code.com"] - s.homepage = "TODO" - s.summary = "TODO: Summary of DaimonNewsBlog." - s.description = "TODO: Description of DaimonNewsBlog." + s.homepage = "" + s.summary = "" + s.description = "" s.license = "MIT" s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"]
Remove TODO in gemspec to build gem
diff --git a/spec/govuk_mirrorer/mirrorer_spec.rb b/spec/govuk_mirrorer/mirrorer_spec.rb index abc1234..def5678 100644 --- a/spec/govuk_mirrorer/mirrorer_spec.rb +++ b/spec/govuk_mirrorer/mirrorer_spec.rb @@ -0,0 +1,15 @@+require 'spec_helper' + +describe GovukMirrorer do + + describe "top-level run method" do + it "should construct a new crawler with the configuration, and start it" do + GovukMirrorer::Configurer.should_receive(:run).and_return(:a_config_hash) + stub_crawler = stub("GovukMirrorer::Crawler") + GovukMirrorer::Crawler.should_receive(:new).with(:a_config_hash).and_return(stub_crawler) + stub_crawler.should_receive(:crawl) + + GovukMirrorer.run + end + end +end
Add spec for top-level run method
diff --git a/spec/services/deal_all_cards_spec.rb b/spec/services/deal_all_cards_spec.rb index abc1234..def5678 100644 --- a/spec/services/deal_all_cards_spec.rb +++ b/spec/services/deal_all_cards_spec.rb @@ -0,0 +1,25 @@+require 'pp' +require 'rails_helper' + +RSpec.describe DealAllCards do + DECK_SIZE = 43 + + describe "#call" do + subject(:service) { DealAllCards.new(game) } + + let(:game) { Game.create! } + + before do + service.call + game.reload + end + + it "adds a CardDealt event to the game" do + expect(game.events.first).to be_instance_of CardDealt + end + + it "adds one event to the game for each card in the deck" do + expect(game.events).to have_exactly(DECK_SIZE).items + end + end +end
Add RSpec test for DealAllCards
diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb index abc1234..def5678 100644 --- a/config/initializers/mime_types.rb +++ b/config/initializers/mime_types.rb @@ -1,3 +1,4 @@+# Encoding: utf-8 # Be sure to restart your server when you modify this file. # Add new mime types for use in respond_to blocks:
Clean up MIME types script
diff --git a/ordering/assigner.rb b/ordering/assigner.rb index abc1234..def5678 100644 --- a/ordering/assigner.rb +++ b/ordering/assigner.rb @@ -32,7 +32,6 @@ state do scratch :holder, [:array] - scratch :holder2, [:array] end bloom :grouping do
Remove unused collection from AggAssign.
diff --git a/core/process/detach_spec.rb b/core/process/detach_spec.rb index abc1234..def5678 100644 --- a/core/process/detach_spec.rb +++ b/core/process/detach_spec.rb @@ -5,12 +5,17 @@ platform_is_not :windows do it "returns a thread" do pid = Process.fork { Process.exit! } - Process.detach(pid).should be_kind_of(Thread) + thr = Process.detach(pid) + thr.should be_kind_of(Thread) + timeout(3) { thr.join } end it "produces the exit Process::Status as the thread value" do pid = Process.fork { Process.exit! } - status = Process.detach(pid).value + thr = Process.detach(pid) + timeout(3) { thr.join } + + status = thr.value status.should be_kind_of(Process::Status) status.pid.should == pid end @@ -18,8 +23,8 @@ platform_is_not :openbsd do it "reaps the child process's status automatically" do pid = Process.fork { Process.exit! } - th = Process.detach(pid) - timeout(3) { th.join } + thr = Process.detach(pid) + timeout(3) { thr.join } lambda { Process.waitpid(pid) }.should raise_error(Errno::ECHILD) end end @@ -27,12 +32,18 @@ ruby_version_is "1.9" do it "sets the :pid thread-local to the PID" do pid = Process.fork { Process.exit! } - Process.detach(pid)[:pid].should == pid + thr = Process.detach(pid) + timeout(3) { thr.join } + + thr[:pid].should == pid end it "provides a #pid method on the returned thread which returns the PID" do pid = Process.fork { Process.exit! } - Process.detach(pid).pid.should == pid + thr = Process.detach(pid) + timeout(3) { thr.join } + + thr.pid.should == pid end end end
Make sure we join the returned thread before continuing
diff --git a/spec/includes/pages_controller_include_spec.rb b/spec/includes/pages_controller_include_spec.rb index abc1234..def5678 100644 --- a/spec/includes/pages_controller_include_spec.rb +++ b/spec/includes/pages_controller_include_spec.rb @@ -1,15 +1,11 @@ require 'spec_helper' -class TestPagesController < ApplicationController - include Cmtool::Includes::PagesController -end - -describe TestPagesController, type: :controller do +describe PagesController, type: :controller do describe 'sitemap' do it 'returns a proper sitemap' do create_pages_tree get :sitemap, format: 'xml' - expect( response.body ).to include "<url><loc>/en/child2.2</loc></url>" + expect( response.body ).to include "<loc>http://test.host/en/child2.2</loc>" end end end
Test controller page includes by means of real application controller spec
diff --git a/app/controllers/blogs_controller.rb b/app/controllers/blogs_controller.rb index abc1234..def5678 100644 --- a/app/controllers/blogs_controller.rb +++ b/app/controllers/blogs_controller.rb @@ -1,9 +1,9 @@ class BlogsController < ApplicationController before_filter :authenticate_user! + before_filter :get_club, :only => [ :create, :show_all ] before_filter :get_blog, :only => [ :edit, :update, :change_image, :upload_image ] def create - @club = Club.find params[:club_id] @blog = @club.blogs.new authorize! :create, @blog @@ -28,6 +28,10 @@ respond_with_bip @blog end + def show_all + @blogs = @club.blogs + end + def change_image authorize! :update, @blog end @@ -44,6 +48,10 @@ private + def get_club + @club = Club.find params[:club_id] + end + def get_blog @blog = Blog.find params[:id] end
Add show_all Action to Blogs Controller Update the Blogs controller to include a show_all action.
diff --git a/app/controllers/check_controller.rb b/app/controllers/check_controller.rb index abc1234..def5678 100644 --- a/app/controllers/check_controller.rb +++ b/app/controllers/check_controller.rb @@ -3,11 +3,23 @@ class CheckController < ApplicationController def index url = sanitized_url + target = params[:target] + + connection = "" + size = "" + if target == "mobile" + connection = "mobilefast3g" + size = "357x627" + else + connection = "cable" + size = "1280x1024" + end jsonFile = Tempfile.new('bnb') harFile = Tempfile.new('bnb') browser = Rails.configuration.browser - cmd = "browsertime -u #{url} -b #{browser} -n 1 --filename #{jsonFile.path} --harFile #{harFile.path}" + cmd = "browsertime -u #{url} -b #{browser} -w #{size} --connection #{connection} -n 1 --filename #{jsonFile.path} --harFile #{harFile.path}" + Rails.logger.info cmd stdout,stderr,status = Open3.capture3(cmd) if status.success? render json: {stats: JSON.parse(jsonFile.read), har: JSON.parse(harFile.read)}
Add new parameter to check command
diff --git a/app/controllers/flags_controller.rb b/app/controllers/flags_controller.rb index abc1234..def5678 100644 --- a/app/controllers/flags_controller.rb +++ b/app/controllers/flags_controller.rb @@ -32,7 +32,9 @@ def update flag = Flag.find(params[:id]) flag.update_attributes(flag_params) - redirect_to :action => :show + respond_to do |format| + format.html { redirect_to :action => :show } + end end private
Prepare to handle JS updates.
diff --git a/app/controllers/stats_controller.rb b/app/controllers/stats_controller.rb index abc1234..def5678 100644 --- a/app/controllers/stats_controller.rb +++ b/app/controllers/stats_controller.rb @@ -2,9 +2,9 @@ def show shas = params[:repos].to_s.split(',') repos = if shas.present? - Repository.where(:access_token => shas).pluck(:id, :name) + Repository.where(:access_token => shas).pluck(:id, :full_name) else - Repository.pluck(:id, :name) + Repository.pluck(:id, :full_name) end chain_start = Commit.where(:repository_id => repos.map(&:first)) render json: {
Return repository full name in stats controller
diff --git a/Casks/iterm2-nightly.rb b/Casks/iterm2-nightly.rb index abc1234..def5678 100644 --- a/Casks/iterm2-nightly.rb +++ b/Casks/iterm2-nightly.rb @@ -1,8 +1,8 @@ cask :v1 => 'iterm2-nightly' do - version :latest - sha256 :no_check + version '2_9_20151006' + sha256 '1b066544e3c2507c0ec43d6999ed5b450589651fc519f490dc289fb1a4a3d936' - url 'https://www.iterm2.com/nightly/latest' + url "https://www.iterm2.com/downloads/nightly/iTerm2-#{version}-nightly.zip" appcast 'https://iterm2.com/appcasts/nightly.xml' name 'iTerm2' name 'iTerm 2'
Switch Iterm2 Nightly to versioned download
diff --git a/app/models/restaurant/daily_menu.rb b/app/models/restaurant/daily_menu.rb index abc1234..def5678 100644 --- a/app/models/restaurant/daily_menu.rb +++ b/app/models/restaurant/daily_menu.rb @@ -10,7 +10,7 @@ def self.broadcast of_today.group_by(&:restaurant).each_pair do |restaurant, daily_menus| - message = "*Heute (#{daily_menus.first.date.strftime('%F')}) im #{restaurant.class.name.demodulize}:*\n" + message = String.new("*Heute (#{Date.today.strftime('%F')}) im #{restaurant.class.name.demodulize}:*\n") daily_menus.each do |daily_menu| message << "• #{daily_menu.content}\n"
Use mutable string for broadcast message
diff --git a/app/policies/conversation_policy.rb b/app/policies/conversation_policy.rb index abc1234..def5678 100644 --- a/app/policies/conversation_policy.rb +++ b/app/policies/conversation_policy.rb @@ -1,6 +1,10 @@ class ConversationPolicy < ApplicationPolicy def show? @record.users.include? @user + end + + def create? + @record.initiator == @user end class Scope < Scope def resolve
Add a pundit policy to authorize conversation creation
diff --git a/Casks/revisions-beta.rb b/Casks/revisions-beta.rb index abc1234..def5678 100644 --- a/Casks/revisions-beta.rb +++ b/Casks/revisions-beta.rb @@ -0,0 +1,11 @@+cask :v1 => 'revisions-beta' do + version '2.1-r928' + sha256 'fb91a2dd876becd034445813bac037cf99cb4f3691f2d140c6425fe52427789f' + + url "https://revisionsapp.com/downloads/revisions-#{version}-public-beta.dmg" + name 'Revisions' + homepage 'https://revisionsapp.com/' + license :commercial + + app 'Revisions.app' +end
Add Revisions beta version 2.1 This commit adds a new cask for the Revisions app. I haven't included a comment to say where the download link was obtained as it is from a public page on the vendor site: https://www.revisionsapp.com/releases
diff --git a/sastrawi.gemspec b/sastrawi.gemspec index abc1234..def5678 100644 --- a/sastrawi.gemspec +++ b/sastrawi.gemspec @@ -6,7 +6,7 @@ Gem::Specification.new do |spec| spec.name = "sastrawi" spec.version = Sastrawi::VERSION - spec.required_ruby_version = ">= 1.9.3" + spec.required_ruby_version = ">= 2.4.5" spec.authors = ["Andrias Meisyal"] spec.email = ["andriasonline@gmail.com"]
Use Ruby 2.4.5 as the minimum Ruby required version
diff --git a/test/test_yuimaru.rb b/test/test_yuimaru.rb index abc1234..def5678 100644 --- a/test/test_yuimaru.rb +++ b/test/test_yuimaru.rb @@ -2,7 +2,7 @@ class TestYuimaru < Test::Unit::TestCase def test_sequence - seq = Yuimaru.sequence(<<~SEQ) + seq = Yuimaru.sequence(<<-SEQ) # assign $_ should be ignored $_ = :hi "alice" >> "hi bob" >> "bob"
Update test for ruby 2.2, 2.1
diff --git a/plastic_wrap.gemspec b/plastic_wrap.gemspec index abc1234..def5678 100644 --- a/plastic_wrap.gemspec +++ b/plastic_wrap.gemspec @@ -17,5 +17,5 @@ gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) gem.require_paths = ["lib"] gem.add_dependency('actionpack', '~> 3.2.0') - gem.add_dependency('active_support', '~> 3.2.0') + gem.add_dependency('activesupport', '~> 3.2.0') end
Use correct name for active_support which doesn't follow standards
diff --git a/MBContactPicker.podspec b/MBContactPicker.podspec index abc1234..def5678 100644 --- a/MBContactPicker.podspec +++ b/MBContactPicker.podspec @@ -12,19 +12,20 @@ our company used in the past. My main goal when I created this library was to build something that behaved and felt like the native mail app's contact selector. - My secondary goal was to make using it extremely simple while still providing + My secondary goal was to make using it extremely simple while still providing a high level of flexibility for projects that need it. DESC s.homepage = "http://github.com/Citrrus/MBContactPicker" s.license = 'MIT' - s.author = { + s.author = { "Matt Bowman" => "mbowman@citrrus.com", "Matt Hupman" => "mhupman@citrrus.com" } s.platform = :ios, '7.0' s.source = { :git => "https://github.com/Citrrus/MBContactPicker.git", :tag => git_tag } - s.source_files = 'MBContactPicker' + s.source_files = 'MBContactPicker' s.requires_arc = true + s.frameworks = 'UIKit' end
Add UIKit as a framework dependency
diff --git a/migrate_storage_size_from_metadata.rb b/migrate_storage_size_from_metadata.rb index abc1234..def5678 100644 --- a/migrate_storage_size_from_metadata.rb +++ b/migrate_storage_size_from_metadata.rb @@ -0,0 +1,95 @@+#!/usr/bin/env ruby + +require "rubygems" +require "bundler/setup" +require "rest_client" +require "redis" +require "yaml" +require "logger" +require "active_support/core_ext/hash" + +class Migrator + + attr_accessor :username, :base_url, :environment, :settings, :logger + + def initialize(username) + @username = username + + @environment = ENV["ENVIRONMENT"] || "staging" + @settings = YAML.load(File.read('config.yml'))[@environment] + + @logger = Logger.new("log/migrate_storage_size_from_metadata.log") + log_level = ENV["LOGLEVEL"] || "INFO" + logger.level = Kernel.const_get "Logger::#{log_level}" + logger.progname = username + end + + def migrate + logger.info "Starting migration for '#{username}'" + begin + write_storage_size_from_redis_metadata(username) + rescue Exception => ex + logger.error "Error setting storage size from metadata for '#{username}': #{ex}" + # write username to file for later reference + File.open('log/failed_migration.log', 'a') { |f| f.puts username } + exit 1 + end + logger.info "Finished migration for '#{username}'" + end + + def redis + @redis ||= Redis.new(@settings["redis"].symbolize_keys) + end + + def write_storage_size_from_redis_metadata(user) + lua_script = <<-EOF + local user = ARGV[1] + local total_size = 0 + local size_key = KEYS[1] + + local function get_size_from_items(parent, directory) + local path + if parent == "/" then + path = directory + else + path = parent..directory + end + local items = redis.call("smembers", "rs:m:"..user..":"..path..":items") + for index, name in pairs(items) do + local redis_key = "rs:m:"..user..":" + + redis_key = redis_key..path..name + + -- if it's a directory, get the items inside of it + if string.match(name, "/$") then + get_size_from_items(path, name) + -- if it's a file, get its size + else + local file_size = redis.call("hget", redis_key, "s") + total_size = total_size + file_size + end + end + end + + get_size_from_items("", "") -- Start from the root + + redis.call("set", size_key, total_size) + EOF + + redis.eval(lua_script, ["rs:s:#{user}", "test"], [user]) + end + +end + +username = ARGV[0] + +unless username + puts "No username given." + puts "Usage:" + puts "ENVIRONMENT=staging ./migrate_storage_size_from_metadata.rb <username>" + exit 1 +end + +migrator = Migrator.new username +migrator.migrate +
Add a script to calculate a user's storage size from the metadata... ... And write it to Redis Usage: ENVIRONMENT=development ./migrate_storage_size_from_metadata.rb username
diff --git a/Lasagna-Cookies.podspec b/Lasagna-Cookies.podspec index abc1234..def5678 100644 --- a/Lasagna-Cookies.podspec +++ b/Lasagna-Cookies.podspec @@ -6,7 +6,7 @@ s.screenshots = "https://a248.e.akamai.net/camo.github.com/2c2a1ef5202365d376ace3d003c9b293894d0cd2/687474703a2f2f692e696d6775722e636f6d2f4e4756546770706c2e706e67" s.license = 'BSD' s.author = { "Kévin Bessière" => "bessiere.kevin@gmail.com" } - s.source = { :git => "https://github.com/kbessiere/Lasagna-Cookies.got", :tag => "1.0.0" } + s.source = { :git => "https://github.com/kbessiere/Lasagna-Cookies.git", :tag => "1.0.0" } s.platform = :ios s.source_files = 'Classes' s.resources = "Ressources/*"
Correct of cocoapod config file
diff --git a/lib/chef/knife/cloudformation_validate.rb b/lib/chef/knife/cloudformation_validate.rb index abc1234..def5678 100644 --- a/lib/chef/knife/cloudformation_validate.rb +++ b/lib/chef/knife/cloudformation_validate.rb @@ -15,6 +15,7 @@ def run file = load_template_file ui.info "#{ui.color('Cloud Formation Validation: ', :bold)} #{Chef::Config[:knife][:cloudformation][:file].sub(Dir.pwd, '').sub(%r{^/}, '')}" + file = KnifeCloudformation::Utils::StackParameterScrubber.scrub!(file) file = translate_template(file) begin result = provider.stacks.build(
Scrub parameters prior to validation
diff --git a/db/migrate/20161218150218_add_epix_fields_to_sandbox_template.rb b/db/migrate/20161218150218_add_epix_fields_to_sandbox_template.rb index abc1234..def5678 100644 --- a/db/migrate/20161218150218_add_epix_fields_to_sandbox_template.rb +++ b/db/migrate/20161218150218_add_epix_fields_to_sandbox_template.rb @@ -0,0 +1,13 @@+class AddEpixFieldsToSandboxTemplate < ActiveRecord::Migration + def change + add_column :trade_sandbox_template, :epix_created_at, :timestamp + add_column :trade_sandbox_template, :epix_updated_at, :timestamp + add_column :trade_sandbox_template, :epix_created_by_id, :integer + add_column :trade_sandbox_template, :epix_updated_by_id, :integer + + change_column_null :trade_annual_report_uploads, :created_at, true + change_column_null :trade_annual_report_uploads, :updated_at, true + change_column_null :trade_sandbox_template, :created_at, true + change_column_null :trade_sandbox_template, :updated_at, true + end +end
Add epix timestamps and created/updated by to sandbox
diff --git a/spec/features/creating_team_spec.rb b/spec/features/creating_team_spec.rb index abc1234..def5678 100644 --- a/spec/features/creating_team_spec.rb +++ b/spec/features/creating_team_spec.rb @@ -8,4 +8,5 @@ When { click_link_or_button "Create Team" } Then { expect(Team.find_by(name: "Team A")).to be_persisted } + Then { expect(Team.find_by(name: "Team A").leader).to eql(current_account) } end
Make sure that current account is the leader of the team
diff --git a/lib/gemstash/migrations/03_cached_gems.rb b/lib/gemstash/migrations/03_cached_gems.rb index abc1234..def5678 100644 --- a/lib/gemstash/migrations/03_cached_gems.rb +++ b/lib/gemstash/migrations/03_cached_gems.rb @@ -17,7 +17,7 @@ String :resource_type, size: 191, null: false DateTime :created_at, null: false DateTime :updated_at, null: false - index [:upstream_id, :name, :resource_type], unique: true + index [:upstream_id, :resource_type, :name], unique: true index [:name] end end
Move resource_type up in the index
diff --git a/spec/griddler/configuration_spec.rb b/spec/griddler/configuration_spec.rb index abc1234..def5678 100644 --- a/spec/griddler/configuration_spec.rb +++ b/spec/griddler/configuration_spec.rb @@ -23,17 +23,13 @@ end it 'stores a processor_class' do - class DummyProcessor - def self.process(email) - true - end + dummy_processor = Class.new + + Griddler.configure do |config| + config.processor_class = dummy_processor end - Griddler.configure do |config| - config.processor_class = DummyProcessor - end - - Griddler.configuration.processor_class.should eq ::DummyProcessor + Griddler.configuration.processor_class.should eq dummy_processor end end end
Use local state for testing This avoids creating a globally-available class.
diff --git a/lib/magellan/gcs/proxy/expand_variable.rb b/lib/magellan/gcs/proxy/expand_variable.rb index abc1234..def5678 100644 --- a/lib/magellan/gcs/proxy/expand_variable.rb +++ b/lib/magellan/gcs/proxy/expand_variable.rb @@ -7,7 +7,7 @@ class InvalidReferenceError < StandardError end - + module_function def dig_variables(variable_ref, data) @@ -52,14 +52,8 @@ end case value - when String - if quote_string - value.to_json - else - value - end - else - value.to_json + when String then quote_string ? value.to_json : value + else value.to_json end end end
:shirt: Use tertiary operator instead of if statement
diff --git a/spec/unit/advance_spec.rb b/spec/unit/advance_spec.rb index abc1234..def5678 100644 --- a/spec/unit/advance_spec.rb +++ b/spec/unit/advance_spec.rb @@ -0,0 +1,23 @@+# coding: utf-8 + +require 'spec_helper' + +RSpec.describe TTY::ProgressBar, '.advance' do + let(:output) { StringIO.new('', 'w+') } + + it "allows to go back" do + progress = TTY::ProgressBar.new("[:bar]", output: output, total: 10) + 5.times { progress.advance(1) } + expect(progress.current).to eq(5) + 5.times { progress.advance(-1) } + expect(progress.current).to eq(1) + end + + it "cannot backtrack on finished" do + progress = TTY::ProgressBar.new("[:bar]", output: output, total: 10) + 10.times { progress.advance(1) } + expect(progress.current).to eq(10) + 5.times { progress.advance(-1) } + expect(progress.current).to eq(10) + end +end
Add tests for advance behaviour.
diff --git a/lib/rails_dev_tweaks/granular_autoload/matchers/asset_matcher.rb b/lib/rails_dev_tweaks/granular_autoload/matchers/asset_matcher.rb index abc1234..def5678 100644 --- a/lib/rails_dev_tweaks/granular_autoload/matchers/asset_matcher.rb +++ b/lib/rails_dev_tweaks/granular_autoload/matchers/asset_matcher.rb @@ -1,7 +1,7 @@ class RailsDevTweaks::GranularAutoload::Matchers::AssetMatcher def call(request) - main_mount = request.headers['action_dispatch.routes'].set.recognize(request) + main_mount = request.headers['action_dispatch.routes'].set.dup.recognize(request) # Unwind until we have an actual app while main_mount != nil
Fix routing-filter params being lost by duplicating the route set before calling recognize.
diff --git a/spec/support/oauth.rb b/spec/support/oauth.rb index abc1234..def5678 100644 --- a/spec/support/oauth.rb +++ b/spec/support/oauth.rb @@ -2,8 +2,9 @@ def construct_oauth_service(model) FakeWeb.allow_net_connect = false qb_key = "key" + qb_secret = "secreet" @realm_id = "9991111222" - @oauth_consumer = OAuth::Consumer.new(qb_key, qb_key, { + @oauth_consumer = OAuth::Consumer.new(qb_key, qb_secret, { :site => "https://oauth.intuit.com", :request_token_path => "/oauth/v1/get_request_token", :authorize_path => "/oauth/v1/get_access_token",
Add back qb_secret from recent PR but instead properly pass it in as the second arg of OAuth::Consumer.new
diff --git a/app/controllers/admin/edition_world_locations_controller.rb b/app/controllers/admin/edition_world_locations_controller.rb index abc1234..def5678 100644 --- a/app/controllers/admin/edition_world_locations_controller.rb +++ b/app/controllers/admin/edition_world_locations_controller.rb @@ -5,7 +5,7 @@ def index @featured_editions = @world_location.featured_edition_world_locations - @editions = @world_location.published_edition_world_locations.order("editions.public_timestamp DESC") + @editions = @world_location.published_edition_world_locations end def edit
Revert "Reorder documents so featuring a doc is quicker" This reverts commit a919267e98a439193757a9578f639f9cebaefe8b.
diff --git a/lib/rspec-2/rails/generators/install_generator.rb b/lib/rspec-2/rails/generators/install_generator.rb index abc1234..def5678 100644 --- a/lib/rspec-2/rails/generators/install_generator.rb +++ b/lib/rspec-2/rails/generators/install_generator.rb @@ -25,7 +25,6 @@ end def manifest - empty_directory 'spec/controllers' empty_directory 'spec/acceptance/support' template "acceptance_helper.rb", "spec/acceptance/acceptance_helper.rb" copy_file "helpers.rb", "spec/acceptance/support/helpers.rb"
Remove wrong directory being created in the install generator
diff --git a/lib/transition/import/mappings_from_host_paths.rb b/lib/transition/import/mappings_from_host_paths.rb index abc1234..def5678 100644 --- a/lib/transition/import/mappings_from_host_paths.rb +++ b/lib/transition/import/mappings_from_host_paths.rb @@ -8,9 +8,10 @@ def self.refresh!(site) start 'Creating mappings from HostPaths' do Transition::History.as_a_user(user) do - raise RuntimeError, "Postgres TODO 2: #{self}.#{__method__} - \n\t" \ - 'Sloppy GROUP BY' - site_paths = site.host_paths.where('mapping_id is null').group('c14n_path_hash').pluck(:path) + site_paths = site.host_paths + .select('MIN(host_paths.path) AS path') + .where('mapping_id is null').group('c14n_path_hash').map(&:path) + site_paths.each do |uncanonicalized_path| # Try to create them (there may be duplicates in the set and they may # already exist).
Fix mappings from host paths * We really need the GROUP BY, and the way we tell Postgres that the path is effectively represented by the hash is to use MIN as the aggregate. We can no longer use #pluck as this will affect the SELECTed field, but we can get the same behaviour by simple #map.
diff --git a/lib/travis/enqueue/services/enqueue_jobs/limit.rb b/lib/travis/enqueue/services/enqueue_jobs/limit.rb index abc1234..def5678 100644 --- a/lib/travis/enqueue/services/enqueue_jobs/limit.rb +++ b/lib/travis/enqueue/services/enqueue_jobs/limit.rb @@ -22,7 +22,7 @@ private def running - @running ||= Job.owned_by(owner).running.count + @running ||= Job.owned_by(owner).running.count(:id) end def max_queueable
Improve one of the queries related to queueing
diff --git a/week-5/acct_groups.rb b/week-5/acct_groups.rb index abc1234..def5678 100644 --- a/week-5/acct_groups.rb +++ b/week-5/acct_groups.rb @@ -0,0 +1,22 @@+# In this challenge, you will make your own method to automatically create accountability groups from a list of names. You'll want to make of the People in your cohort. Try to get everyone into an accountability group of 4 or 5. Be sure everyone is in a group of at least 3 -- It's no fun if someone is in a group by themself or with one other person. + +#Pseudocode: +# Create a method that will make acc. groups from a list of names. +# Try to get everyone in to a group of 3 to 5 People from the argument copperheads. +# Print out the new groups of 5 +# INPUT: Takes in the data from an array. +# OUTPUT: Prints out new groups of people for their acc. group assignment. + +# Initial Solution_____________________________________________________________ + +copperheads = ["Joshua Abrams", "Syema Ailia", "Kris Bies", "Alexander Blair", "Andrew Blum", "Jacob Boer", "Steven Broderick", "Ovi Calvo", "Danielle Cameron", "Eran Chazan", "Jonathan Chen", "Un Choi", "Kevin Corso", "Eric Dell'Aringa", "Eunice Do", "Ronny Ewanek", "John Paul Chaufan Field", "Eric Freeburg", "Jeff George", "Jamar Gibbs", "Paul Gaston Gouron", "Gabrielle Gustilo", "Marie-France Han", "Noah Heinrich", "Jack Huang", "Max Iniguez", "Mark Janzer", "Michael Jasinski", "Lars Johnson", "Joshua Kim", "James Kirkpatrick", "Christopher Lee", "Isaac Lee", "Joseph Marion", "Kevin Mark", "Bernadette Masciocchi", "Bryan Munroe", "Becca Nelson", "Van Phan", "John Polhill", "Jeremy Powell", "Jessie Richardson", "David Roberts", "Armani Saldana", "Chris Savage", "Parminder Singh", "Kyle Smith", "Aaron Tsai", "Douglas Tsui", "Deanna Warren", "Peter Wiebe", "Daniel Woznicki", "Jay Yee", "Nicole Yee", "Bruno Zatta"] + +def acc_group(copperheads) + copperheads.each_slice(5){|slice| p slice} +end + +p acc_group(copperheads) + +# Refactor Solution_____________________________________________________________ + +# Reflection____________________________________________________________________
Add the acct_group file with solution
diff --git a/app/models/chouette/timeband.rb b/app/models/chouette/timeband.rb index abc1234..def5678 100644 --- a/app/models/chouette/timeband.rb +++ b/app/models/chouette/timeband.rb @@ -14,6 +14,8 @@ validates :start_time, :end_time, presence: true validates_with TimebandValidator + default_scope { order(:start_time) } + def self.object_id_key "Timeband" end
Add default order for Timebands
diff --git a/Casks/lytro-desktop.rb b/Casks/lytro-desktop.rb index abc1234..def5678 100644 --- a/Casks/lytro-desktop.rb +++ b/Casks/lytro-desktop.rb @@ -1,11 +1,11 @@ cask :v1 => 'lytro-desktop' do - version '4.2.1' - sha256 '5ebe2cdd0b80749f3ad97fd319ab6c4cea4045f6705d10ce28b191935bbf561b' + version '4.3.1' + sha256 '3f368066d97230b71ffb81f0d0468bb459e2cf615fb02cd6b4cdeebd3b25ba60' # amazonaws.com is the official download host per the appcast feed - url 'https://s3.amazonaws.com/lytro-distro/lytro-150408.69.dmg' + url 'https://s3.amazonaws.com/lytro-distro/lytro-150724.96.dmg' appcast 'https://pictures.lytro.com/support/software_update', - :sha256 => 'e54d512a31f7c221da16d2af9cf4eebef353bb47ca07a6811c4bfaeaae4dddf1' + :sha256 => 'a24271bb26982429e8e42ff2f3e1ab3d1690192cc2acc2ce36346ed4302e5904' name 'Lytro Desktop' homepage 'https://www.lytro.com/' license :gratis
Update Lytro Desktop to 4.3.1
diff --git a/app/models/spree/license_key.rb b/app/models/spree/license_key.rb index abc1234..def5678 100644 --- a/app/models/spree/license_key.rb +++ b/app/models/spree/license_key.rb @@ -7,6 +7,7 @@ attr_accessible :license_key, :inventory_unit_id, :variant_id scope :available, where(inventory_unit_id: nil) + scope :used, where('inventory_unit_id IS NOT NULL') def self.assign_license_keys!(inventory_unit) transaction do
Add scope for used license keys. Change-Id: Ie9a3eb9ebf3b137a5ad72e9c3c07e6f8634251a9
diff --git a/lib/appsignal/integrations/sinatra.rb b/lib/appsignal/integrations/sinatra.rb index abc1234..def5678 100644 --- a/lib/appsignal/integrations/sinatra.rb +++ b/lib/appsignal/integrations/sinatra.rb @@ -1,3 +1,5 @@+require 'appsignal' + Appsignal.logger.info('Loading Sinatra integration') app_settings = ::Sinatra::Application.settings
Add appsignal require to Sinatra integration
diff --git a/lib/cloud_conductor/stack_observer.rb b/lib/cloud_conductor/stack_observer.rb index abc1234..def5678 100644 --- a/lib/cloud_conductor/stack_observer.rb +++ b/lib/cloud_conductor/stack_observer.rb @@ -30,13 +30,12 @@ Log.debug ' Status is CREATE_COMPLETE' outputs = system.outputs - next if outputs['EIP'].nil? + next if outputs['FrontendAddress'].nil? - ip_address = outputs['EIP'] - Log.debug " Outputs has EIP(#{ip_address})" + ip_address = outputs['FrontendAddress'] + Log.debug " Outputs has FrontendAddress(#{ip_address})" - `curl http://#{ip_address}/` - + Log.debug `serf info -rpc-addr=#{ip_address}:7373 -format=json` next if $CHILD_STATUS.exitstatus != 0 Log.info " Instance is running on #{ip_address}, CloudConductor will register host to zabbix."
Change check logic to notice a completion of stack
diff --git a/spec/lib/nil_spec.rb b/spec/lib/nil_spec.rb index abc1234..def5678 100644 --- a/spec/lib/nil_spec.rb +++ b/spec/lib/nil_spec.rb @@ -2,7 +2,7 @@ describe NilClass do it "should respond to entitle" do - expect(nil.entitle).to eq nil + expect(nil.entitle).to eq '' end it "should respond to tex_quote" do
Fix nil spec for entitle.
diff --git a/spec_support.gemspec b/spec_support.gemspec index abc1234..def5678 100644 --- a/spec_support.gemspec +++ b/spec_support.gemspec @@ -15,9 +15,7 @@ s.description = "Add useful spec/support functionalities that come back in each project" s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"] - s.test_files = Dir["test/**/*"] + s.test_files = Dir["spec/**/*"] - s.add_dependency "rspec" - - s.add_development_dependency "sqlite3" + s.add_development_dependency "rspec" end
Correct the dependencies in the gemspec
diff --git a/lib/two_factor_authentication/hooks/two_factor_authenticatable.rb b/lib/two_factor_authentication/hooks/two_factor_authenticatable.rb index abc1234..def5678 100644 --- a/lib/two_factor_authentication/hooks/two_factor_authenticatable.rb +++ b/lib/two_factor_authentication/hooks/two_factor_authenticatable.rb @@ -1,11 +1,9 @@ Warden::Manager.after_authentication do |user, auth, options| reset_otp_state_for(user) - expected_cookie_value = "#{user.class}-#{user.id}" - actual_cookie_value = auth.env["action_dispatch.cookies"].signed[TwoFactorAuthentication::REMEMBER_TFA_COOKIE_NAME] - if actual_cookie_value.nil? - bypass_by_cookie = false - else + if auth.env["action_dispatch.cookies"] + expected_cookie_value = "#{user.class}-#{user.id}" + actual_cookie_value = auth.env["action_dispatch.cookies"].signed[TwoFactorAuthentication::REMEMBER_TFA_COOKIE_NAME] bypass_by_cookie = actual_cookie_value == expected_cookie_value end
Fix crash in warden hook It seems that in some cases `action_dispatch.cookies` is not set in the environment during the `after_authentication` hook.
diff --git a/config/initializers/i18n.rb b/config/initializers/i18n.rb index abc1234..def5678 100644 --- a/config/initializers/i18n.rb +++ b/config/initializers/i18n.rb @@ -2,4 +2,4 @@ I18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')] I18n.default_locale = :de I18n::Backend::Simple.send(:include, I18n::Backend::Cache) -I18n.cache_store = ActiveSupport::Cache.lookup_store(:mem_cache_store)+I18n.cache_store = ActiveSupport::Cache.lookup_store(:memory_store)
Use memory store fir I18n caching.
diff --git a/app/models/api_scope.rb b/app/models/api_scope.rb index abc1234..def5678 100644 --- a/app/models/api_scope.rb +++ b/app/models/api_scope.rb @@ -19,7 +19,7 @@ validates :host, :presence => true, :format => { - :with => CommonValidations::HOST_FORMAT, + :with => CommonValidations::HOST_FORMAT_WITH_WILDCARD, :message => :invalid_host_format, } validates :path_prefix,
Fix so API scopes can be created for wildcard hosts. https://github.com/18F/api.data.gov/issues/249
diff --git a/lib/tic_tac_toe_ai/computer_player.rb b/lib/tic_tac_toe_ai/computer_player.rb index abc1234..def5678 100644 --- a/lib/tic_tac_toe_ai/computer_player.rb +++ b/lib/tic_tac_toe_ai/computer_player.rb @@ -1,12 +1,16 @@ class ComputerPlayer - attr_accessor :minimax + attr_accessor :minimax, :char - def initialize(minimax = Minimax) + def initialize(char, minimax = Minimax) self.minimax = minimax + self.char = char end def get_next_move(board) minimax_result = self.minimax.run(board) + (0..8).each do |i| + minimax_result[i] -= 2 if minimax_result[i] == 0 + end best_move_from minimax_result end
Add char attribute back to computer player
diff --git a/PromiseSignals.podspec b/PromiseSignals.podspec index abc1234..def5678 100644 --- a/PromiseSignals.podspec +++ b/PromiseSignals.podspec @@ -8,9 +8,9 @@ s.description = 'Extends PromiseKit with Signals that can resolve multiple times. Based on PromiseKit.' s.license = { :type => 'MIT', :file => 'LICENSE' } - s.author = { "Markus Gasser" => "markus.gasser@konoma.ch" } + s.author = { 'Markus Gasser' => 'markus.gasser@konoma.ch' } - s.source = { :git => "git@github.com/konoma/promise-signals-ios.git", :tag => '0.1.0' } + s.source = { :git => 'https://github.com/konoma/promise-signals-ios.git', :tag => '0.1.0' } s.platform = :ios, '8.0' s.requires_arc = true
Fix source tag in podspec
diff --git a/spec/factories/jobs.rb b/spec/factories/jobs.rb index abc1234..def5678 100644 --- a/spec/factories/jobs.rb +++ b/spec/factories/jobs.rb @@ -6,7 +6,7 @@ title { Faker::Lorem.sentence } description { Faker::Lorem.paragraph } - trait :draft_job do + trait :draft do state :draft title nil description nil
Fix name of draft job trait
diff --git a/sample/basic/channels/main_channel.rb b/sample/basic/channels/main_channel.rb index abc1234..def5678 100644 --- a/sample/basic/channels/main_channel.rb +++ b/sample/basic/channels/main_channel.rb @@ -14,37 +14,33 @@ # tick_note 24, 47 # B # tick_note 28, 48 # C - tick_note 0, 36 - tick_note 8, 36 + play(36).at(0) + play(36).at(8) - tick_note 16, 43 - tick_note 24, 43 + play(43).at(16) + play(43).at(24) - tick_note 32, 45 - tick_note 40, 45 + play(45).at(32) + play(45).at(40) - tick_note 48, 43 + play(43).at(48) - tick_note 64, 41 - tick_note 72, 41 + play(41).at(64) + play(41).at(72) - tick_note 80, 40 - tick_note 88, 40 + play(40).at(80) + play(40).at(88) - tick_note 96, 38 - tick_note 104, 38 + play(38).at(96) + play(38).at(104) - tick_note 112, 36 + play(36).at(112) + # # Will play note 36 on every tick divisible by 4 # with a 0 offset and velocity of 40 # - mod_note(4, 36, 0, 40) - mod_note(8, 40) - mod_note(12, 43) - mod_note(16, 38) - mod_note(32, 127, 0, 50) - mod_note(124, 55) + play(36).every(4) end end
Fix basic sample for latest changes
diff --git a/jsonapi-matchers.gemspec b/jsonapi-matchers.gemspec index abc1234..def5678 100644 --- a/jsonapi-matchers.gemspec +++ b/jsonapi-matchers.gemspec @@ -21,6 +21,7 @@ spec.add_dependency "activesupport", ">= 4.0", "< 6" spec.add_dependency "awesome_print" + spec.add_development_dependency "bump", "~> 0.9.0" spec.add_development_dependency "bundler", "~> 1.12" spec.add_development_dependency "rake", "~> 10.0" spec.add_development_dependency "rspec", "~> 3.0"
Add 'bump' gem to make versioning easier.
diff --git a/spec/active_set/sort/processor_spec.rb b/spec/active_set/sort/processor_spec.rb index abc1234..def5678 100644 --- a/spec/active_set/sort/processor_spec.rb +++ b/spec/active_set/sort/processor_spec.rb @@ -0,0 +1,114 @@+# frozen_string_literal: true + +require 'spec_helper' +require 'ostruct' + +RSpec.describe ActiveSet::SortProcessor do + let(:processor) { described_class.new(set, filter_structure) } + + context 'when set is Enumerable' do + include_context 'for enumerable sets' + + before(:each) do + foo.tap do |foo| + foo.bignum = 2**64 + foo.boolean = true + foo.date = 1.day.from_now.to_date + foo.datetime = 1.day.from_now.to_datetime + foo.float = 1.11 + foo.integer = 1 + foo.nil = nil + foo.string = 'aaa' + foo.symbol = :aaa + foo.time = 1.day.from_now.to_time + end + foo.assoc = foo + + bar.tap do |bar| + bar.bignum = 3**64 + bar.boolean = false + bar.date = 1.day.ago.to_date + bar.datetime = 1.day.ago.to_datetime + bar.float = 2.22 + bar.integer = 2 + bar.nil = '' + bar.string = 'zzz' + bar.symbol = :zzz + bar.time = 1.day.ago.to_time + end + bar.assoc = bar + end + + let(:set) { enumerable_set } + + describe '#process' do + subject { processor.process } + + context 'with a complex query' do + context do + let(:filter_structure) do + { + string: :asc, + assoc: { + string: :asc + } + } + end + + it { expect(subject.map(&:id)).to eq [foo.id, bar.id] } + end + + context do + let(:filter_structure) do + { + string: :asc, + assoc: { + string: :desc + } + } + end + + it { expect(subject.map(&:id)).to eq [bar.id, foo.id] } + end + end + end + end + + context 'when set is ActiveRecord::Relation' do + include_context 'for active record sets' + + let(:set) { active_record_set } + + describe '#process' do + subject { processor.process } + + context 'with a complex query' do + context do + let(:filter_structure) do + { + string: :asc, + assoc: { + string: :asc + } + } + end + + it { expect(subject.map(&:id)).to eq [foo.id, bar.id] } + end + + context do + let(:filter_structure) do + { + string: :asc, + assoc: { + string: :desc + } + } + end + + it { expect(subject.map(&:id)).to eq [foo.id, bar.id] } + end + end + end + end +end
Add back the accidentally deleted spec
diff --git a/jekyll-invoice.gemspec b/jekyll-invoice.gemspec index abc1234..def5678 100644 --- a/jekyll-invoice.gemspec +++ b/jekyll-invoice.gemspec @@ -21,7 +21,7 @@ spec.add_runtime_dependency "jekyll", "~> 3.3.0" - spec.add_development_dependency "bundler", "~> 1.5" + spec.add_development_dependency "bundler", "~> 2.0" spec.add_development_dependency "rake" spec.add_development_dependency "minitest", "~> 5.0" end
Update bundler requirement from ~> 1.5 to ~> 2.0 Updates the requirements on [bundler](https://github.com/bundler/bundler) to permit the latest version. - [Release notes](https://github.com/bundler/bundler/releases) - [Changelog](https://github.com/bundler/bundler/blob/master/CHANGELOG.md) - [Commits](https://github.com/bundler/bundler/compare/v1.5.0...v2.0.2) Signed-off-by: dependabot-preview[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com>
diff --git a/_plugins/mesos-video.rb b/_plugins/mesos-video.rb index abc1234..def5678 100644 --- a/_plugins/mesos-video.rb +++ b/_plugins/mesos-video.rb @@ -7,7 +7,7 @@ end def render(context) - "<div class=\"video-lecture-container\"><iframe class=\"smart-player-embed-container-iframe\" id=\"embeddedSmartPlayerInstance\" src=\"https://advanced-mesos-course.s3-website-us-east-1.amazonaws.com/#{@videoFile}/media/index_player.html?embedIFrameId=embeddedSmartPlayerInstance\" scrolling=\"no\" frameborder=\"0\" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></div>" + "<div class=\"video-lecture-container\"><iframe class=\"smart-player-embed-container-iframe\" id=\"embeddedSmartPlayerInstance\" src=\"https://s3.amazonaws.com/advanced-mesos-course/#{@videoFile}/media/index_player.html?embedIFrameId=embeddedSmartPlayerInstance\" scrolling=\"no\" frameborder=\"0\" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></div>" end end end
Use correct URL for https
diff --git a/rack-ip_address_restriction.gemspec b/rack-ip_address_restriction.gemspec index abc1234..def5678 100644 --- a/rack-ip_address_restriction.gemspec +++ b/rack-ip_address_restriction.gemspec @@ -22,4 +22,5 @@ spec.add_development_dependency "bundler", "~> 1.12" spec.add_development_dependency "rake", "~> 10.0" spec.add_development_dependency "rspec", "~> 3.0" + spec.add_development_dependency "rack-contrib" end
Add development dependency rack-contrib to test.
diff --git a/saltstack/test/spec/server/nodejs_spec.rb b/saltstack/test/spec/server/nodejs_spec.rb index abc1234..def5678 100644 --- a/saltstack/test/spec/server/nodejs_spec.rb +++ b/saltstack/test/spec/server/nodejs_spec.rb @@ -2,10 +2,15 @@ describe 'nodejs' do describe command('/usr/bin/node -v') do - its(:stdout) { should include('v6.') } + its(:stdout) { should include('v8.') } end describe command('/usr/bin/yarn --version') do its(:stdout) { should include('1.') } end + + describe file('/opt/nvm/nvm.sh') do + it { should be_readable ) } + end + end
Update tests for nodejs 8 and nvm
diff --git a/delayed_job_mongoid.gemspec b/delayed_job_mongoid.gemspec index abc1234..def5678 100644 --- a/delayed_job_mongoid.gemspec +++ b/delayed_job_mongoid.gemspec @@ -14,7 +14,7 @@ s.require_paths = ['lib'] s.test_files = Dir.glob('spec/**/*') - s.add_runtime_dependency 'mongoid', '~> 2.0.0.beta' + s.add_runtime_dependency 'mongoid', '~> 2.0.0.rc' s.add_runtime_dependency 'delayed_job', '~> 2.1.1' s.add_development_dependency 'rspec', '>= 2.0' end
Update for the mongoid release candiate.
diff --git a/lib/airplay/server/browser.rb b/lib/airplay/server/browser.rb index abc1234..def5678 100644 --- a/lib/airplay/server/browser.rb +++ b/lib/airplay/server/browser.rb @@ -11,19 +11,24 @@ def self.browse @servers = [] - DNSSD.browse!(Airplay::Protocol::SEARCH) do |reply| - resolver = DNSSD::Service.new - target, port = nil - resolver.resolve(reply) do |resolved| - port = resolved.port - target = resolved.target - break unless resolved.flags.more_coming? + timeout 3 do + DNSSD.browse!(Airplay::Protocol::SEARCH) do |reply| + resolver = DNSSD::Service.new + target, port = nil + resolver.resolve(reply) do |resolved| + port = resolved.port + target = resolved.target + break unless resolved.flags.more_coming? + end + info = Socket.getaddrinfo(target, nil, Socket::AF_INET) + ip_address = info[0][2] + @servers << Airplay::Server::Node.new(reply.name, reply.domain, ip_address, port) + break unless reply.flags.more_coming? end - info = Socket.getaddrinfo(target, nil, Socket::AF_INET) - ip_address = info[0][2] - @servers << Airplay::Server::Node.new(reply.name, reply.domain, ip_address, port) - break unless reply.flags.more_coming? end + rescue Timeout::Error + raise Airplay::Client::ServerNotFoundError + else @servers end
Add timeout when doing lookup
diff --git a/walmart_open.gemspec b/walmart_open.gemspec index abc1234..def5678 100644 --- a/walmart_open.gemspec +++ b/walmart_open.gemspec @@ -19,7 +19,6 @@ spec.require_paths = ["lib"] spec.add_dependency "httparty", "~> 0.10" - spec.add_dependency "addressable", "~> 2.0" spec.add_development_dependency "bundler", "~> 1.3" spec.add_development_dependency "rake"
Remove addressable gem, we don't need it
diff --git a/lib/elocal_capistrano/puma.rb b/lib/elocal_capistrano/puma.rb index abc1234..def5678 100644 --- a/lib/elocal_capistrano/puma.rb +++ b/lib/elocal_capistrano/puma.rb @@ -1,21 +1,22 @@ Capistrano::Configuration.instance.load do + set(:puma_application_name) { "#{application}_puma" } namespace :puma do namespace :upstart do - %w(start stop status).each do |t| - desc "Perform #{t} of the api_puma service" + %w(reload start stop status).each do |t| + desc "Perform #{t} of the _puma service" task t, roles: :app, except: { no_release: true } do - sudo "#{t} api_puma" + sudo "#{t} #{puma_application_name}" end end - desc 'Perform a restart of the api_puma service' + desc 'Perform a restart of the application puma service' task :restart, roles: :app, except: { no_release: true } do run <<-CMD - pid=`status api_puma | grep -o -E '[0-9]+'`; + pid=`status #{puma_application_name} | grep -o -E '[0-9]+'`; if [ -z $pid ]; then - sudo start api_puma; + sudo start #{puma_application_name}; else - kill -USR1 $pid; + sudo reload #{puma_application_name}; fi CMD end
Allow application name configuration, use reload
diff --git a/lib/hal_client/retryinator.rb b/lib/hal_client/retryinator.rb index abc1234..def5678 100644 --- a/lib/hal_client/retryinator.rb +++ b/lib/hal_client/retryinator.rb @@ -1,6 +1,14 @@ require 'hal_client/null_logger' class HalClient + + # Retries http requests that meet certain conditions -- we want to retry if we got a 500 level + # (server) error but not if we got a 400 level (client) error. We want to retry if we rescue an + # HttpError (likely a network issue) but not more general exceptions that likely indicate another + # problem that should be surfaced. + + # Example usage: + # Retryinator.call { fetch_http_response } class Retryinator attr_reader :max_tries, :interval, :logger
Add class comment to Retryinator class
diff --git a/tasks/build-binary/run.rb b/tasks/build-binary/run.rb index abc1234..def5678 100644 --- a/tasks/build-binary/run.rb +++ b/tasks/build-binary/run.rb @@ -1,7 +1,7 @@ #!/usr/bin/env ruby # encoding: utf-8 -task_root_dir = File.expand_path(File.join(File.dirname(__FILE__), '..','..')) +task_root_dir = File.expand_path(File.join(File.dirname(__FILE__), '..','..', '..')) require "#{task_root_dir}/buildpacks-ci/lib/concourse-binary-builder"
Fix relative pathing for build-binary script [#126369115]
diff --git a/lib/logstash-logger/device.rb b/lib/logstash-logger/device.rb index abc1234..def5678 100644 --- a/lib/logstash-logger/device.rb +++ b/lib/logstash-logger/device.rb @@ -15,6 +15,7 @@ autoload :Stdout, 'logstash-logger/device/stdout' def self.new(opts) + opts = opts.dup type = opts.delete(:type) || DEFAULT_TYPE device_klass_for(type).new(opts)
Update Device.new to not mutate passed options This fixes an issue I was having were part of my configuration was being deleted once it got into this method.
diff --git a/test/unit/wdpa/pame_importer_test.rb b/test/unit/wdpa/pame_importer_test.rb index abc1234..def5678 100644 --- a/test/unit/wdpa/pame_importer_test.rb +++ b/test/unit/wdpa/pame_importer_test.rb @@ -31,8 +31,5 @@ pame_evaluations = PameEvaluation.all assert_equal 9, pame_evaluations.count - - hidden_pame_evaluation = PameEvaluation.find(64) - assert_nil hidden_pame_evaluation.protected_area_id end end
Remove unnecessary part of the test (cherry picked from commit e4538e6f0f97dac3ecd4185e9f4ec0163ea4e3a1)
diff --git a/test/test_faker_number.rb b/test/test_faker_number.rb index abc1234..def5678 100644 --- a/test/test_faker_number.rb +++ b/test/test_faker_number.rb @@ -5,16 +5,20 @@ def setup @tester = Faker::Number end - + def test_number assert @tester.number(10).match(/[0-9]{10}/) + 10.times do |digits| + digits += 1 + assert @tester.number(digits).match(/^[0-9]{#{digits}}$/) + end end def test_decimal assert @tester.decimal(2).match(/[0-9]{2}\.[0-9]{2}/) assert @tester.decimal(4, 5).match(/[0-9]{4}\.[0-9]{5}/) end - + def test_digit assert @tester.digit.match(/[0-9]{1}/) end
Test correct number of digits Added test from https://github.com/stympy/faker/pull/147 that verifies behavior in 722041c
diff --git a/lib/framework/version.rb b/lib/framework/version.rb index abc1234..def5678 100644 --- a/lib/framework/version.rb +++ b/lib/framework/version.rb @@ -3,7 +3,7 @@ # ** DO NOT CHANGE THE FOLLOWING UNLESS YOU KNOW WHAT YOU'RE DOING!! ** CORE = 'core-six' MAJOR = '4.00' - MINOR = '156' + MINOR = '157' BUILD = '20140128' # Internal constant used to discriminate between all the existing and
Update build revision for previous commit
diff --git a/Casks/android-studio.rb b/Casks/android-studio.rb index abc1234..def5678 100644 --- a/Casks/android-studio.rb +++ b/Casks/android-studio.rb @@ -1,7 +1,7 @@ class AndroidStudio < Cask - url 'http://dl.google.com/dl/android/studio/ide-zips/0.5.2/android-studio-ide-135.1078000-mac.zip' + url 'http://dl.google.com/dl/android/studio/ide-zips/0.5.3/android-studio-ide-135.1092050-mac.zip' homepage 'https://developer.android.com/sdk/installing/studio.html' - version '0.5.2 build-135.1078000' - sha256 '4646b6c420f2221c748dd00233c17ccfac2b8bae0e9d7ad6775bfae936db3bb2' + version '0.5.3 build-135.1092050' + sha256 '8558836c6a2e0108fceded0af7a01ac6896f20a25bb00ef2184817acfaa91c2d' link 'Android Studio.app' end
Upgrade Android Studio.app to v0.5.3 build-135.1092050
diff --git a/lib/tasks/scheduler.rake b/lib/tasks/scheduler.rake index abc1234..def5678 100644 --- a/lib/tasks/scheduler.rake +++ b/lib/tasks/scheduler.rake @@ -0,0 +1,14 @@+desc "This task is called hourly to sync github data" + +task :sync_github_data => :environment do + puts "Updating github user data..." + + max_records = ENV["LIMIT"] + User.order("last_sync desc").limit(max_records).each do |user| + puts "syncing #{user.github_id}..." + + user.sync_github_data + end + + puts "done." +end
Add rake task to sync user data from github
diff --git a/lib/bra/baps/models.rb b/lib/bra/baps/models.rb index abc1234..def5678 100644 --- a/lib/bra/baps/models.rb +++ b/lib/bra/baps/models.rb @@ -17,6 +17,8 @@ def create root do + log :log + hash :x_baps, :x_baps do hash :server, :x_baps_server do constants @baps_config, :x_baps_server_constant
Add logger to BAPS model.
diff --git a/spec/airbrush/publishers/memcache_spec.rb b/spec/airbrush/publishers/memcache_spec.rb index abc1234..def5678 100644 --- a/spec/airbrush/publishers/memcache_spec.rb +++ b/spec/airbrush/publishers/memcache_spec.rb @@ -34,7 +34,7 @@ it 'should calculate a unique memcache queue name for publishing results' it 'should publish the given results to the remote memcache server' do - @server.should_receive(:set).with('my result', @results).and_return + @server.should_receive(:set).with('result-queue', @results).and_return @memcache.publish(@results) end
Update spec following queue name change git-svn-id: 6d9b9a8f21f96071dc3ac7ff320f08f2a342ec80@31 daa9635f-4444-0410-9b3d-b8c75a019348
diff --git a/lib/dmm-ruby/client.rb b/lib/dmm-ruby/client.rb index abc1234..def5678 100644 --- a/lib/dmm-ruby/client.rb +++ b/lib/dmm-ruby/client.rb @@ -4,10 +4,10 @@ require 'faraday_middleware' module DMM + API_URL = 'http://affiliate-api.dmm.com' + API_VERSION = '2.00' + class Client - API_URL = 'http://affiliate-api.dmm.com' - API_VERSION = '2.00' - attr_reader :api_id, :affiliate_id def initialize(api_id, affiliate_id) @@ -32,6 +32,7 @@ :timestamp => Time.now, :site => 'DMM.com', # Change this to 'DMM.co.jp' for R18. }.update(params) + connection(options).get('/', default_params) end end
Move constants to upward namespace.
diff --git a/spec/unit/ducktrap/formatter/body_spec.rb b/spec/unit/ducktrap/formatter/body_spec.rb index abc1234..def5678 100644 --- a/spec/unit/ducktrap/formatter/body_spec.rb +++ b/spec/unit/ducktrap/formatter/body_spec.rb @@ -0,0 +1,19 @@+require 'spec_helper' + +describe Ducktrap::Formatter, '#body' do + let(:object) { described_class.new(output) } + + let(:output) { StringIO.new } + + subject { object.body(node) } + + let(:node) { [Ducktrap::Node::Noop.instance, Ducktrap::Node::Noop.instance] } + + it 'should print node with members' do + subject + output.rewind + output.read.should eql(" body:\n Ducktrap::Node::Noop\n Ducktrap::Node::Noop\n") + end + + it_should_behave_like 'a command method' +end
Kill remaning mutants in Formatter
diff --git a/lib/cocoapods/generator/copy_resources_script.rb b/lib/cocoapods/generator/copy_resources_script.rb index abc1234..def5678 100644 --- a/lib/cocoapods/generator/copy_resources_script.rb +++ b/lib/cocoapods/generator/copy_resources_script.rb @@ -8,12 +8,12 @@ { case $1 in *\.xib) - echo "ibtool --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename $1 .xib`.nib ${SRCROOT}/Pods/$1 --sdk ${SDKROOT}" - ibtool --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename $1 .xib`.nib" "${SRCROOT}/Pods/$1" --sdk "${SDKROOT}" + echo "ibtool --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename $1 .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" + ibtool --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename $1 .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" ;; *) - echo "cp -R ${SRCROOT}/Pods/$1 ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" - cp -R "${SRCROOT}/Pods/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + echo "cp -R ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + cp -R "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" ;; esac }
Use PODS_ROOT instead of hardcoding SRCROOT/Pods in the copy resources script
diff --git a/lib/dry/view/errors.rb b/lib/dry/view/errors.rb index abc1234..def5678 100644 --- a/lib/dry/view/errors.rb +++ b/lib/dry/view/errors.rb @@ -1,5 +1,7 @@ module Dry class View + # Error raised when template could not be found within a view's configured + # paths class TemplateNotFoundError < StandardError def initialize(template_name, lookup_paths) msg = [
Add doc string for error class
diff --git a/spec/jobs/github_commits_jobs_spec.rb b/spec/jobs/github_commits_jobs_spec.rb index abc1234..def5678 100644 --- a/spec/jobs/github_commits_jobs_spec.rb +++ b/spec/jobs/github_commits_jobs_spec.rb @@ -0,0 +1,15 @@+require 'spec_helper' + +describe GithubCommitsJob do + describe '.job' do + before do + FactoryGirl.create_list(:project, 9, github_url: nil) + FactoryGirl.create_list(:project, 3, github_url: 'http://github.com/project') + end + + it 'updates commit counts for projects that have a github_url' do + expect(CommitCount).to receive(:update_commit_counts_for).with(an_instance_of(Project)).exactly(3).times + GithubCommitsJob.run + end + end +end
Test for GitHub Commit Count Job
diff --git a/lib/models/metadata.rb b/lib/models/metadata.rb index abc1234..def5678 100644 --- a/lib/models/metadata.rb +++ b/lib/models/metadata.rb @@ -9,7 +9,7 @@ field :description, type: Hash, default: {} field :datatype, type: String - validates_inclusion_of :type, in: ['chart', 'tasklist', 'target', 'pie'], allow_nil: true + validates_inclusion_of :type, in: ['chart', 'tasklist', 'target', 'pie', 'number'], allow_nil: true validates_inclusion_of :datatype, in: ['percentage', 'currency'], allow_nil: true index({ name: 1 }, { background: true })
Allow number to be specified as default
diff --git a/lib/models/tag_type.rb b/lib/models/tag_type.rb index abc1234..def5678 100644 --- a/lib/models/tag_type.rb +++ b/lib/models/tag_type.rb @@ -1,6 +1,7 @@ class TagType < ActiveRecord::Base ALLOWED_LABELS = [ + 'uprn', 'saon', 'paon', 'street',
Add UPRN to allowed labels list
diff --git a/test/ext/module_test.rb b/test/ext/module_test.rb index abc1234..def5678 100644 --- a/test/ext/module_test.rb +++ b/test/ext/module_test.rb @@ -0,0 +1,34 @@+require_relative '../needs' + +class ModuleTest < LibraryTest + setup do + @before = Smeltery::Storage.cache.size + end + + teardown do + Smeltery::Storage.cache = Array.new + end + + test 'users' do + models = Smeltery::Module.models(:users) + assert @before < Smeltery::Storage.cache.size + assert_equal models.last.class, Smeltery::Furnace::Model + end + + test 'user comments' do + models = Smeltery::Module.models(:user_comments) + assert @before < Smeltery::Storage.cache.size + assert_equal models.last.class, Smeltery::Furnace::Model + end + + test 'resources clones' do + models = Smeltery::Module.models(:resources_clones) + assert @before < Smeltery::Storage.cache.size + assert_equal models.last.class, Smeltery::Furnace::Model + end + + test 'method missing' do + model = Smeltery::Module.new.users(:admin) + assert_equal model.class, User + end +end
Add tests for module extension.
diff --git a/effective_slugs.gemspec b/effective_slugs.gemspec index abc1234..def5678 100644 --- a/effective_slugs.gemspec +++ b/effective_slugs.gemspec @@ -12,6 +12,7 @@ s.homepage = "https://github.com/code-and-effect/effective_slugs" s.summary = "Automatically generate URL-appropriate slugs when saving a record." s.description = "Automatically generate URL-appropriate slugs when saving a record." + s.licenses = ['MIT'] s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.md"] s.test_files = Dir["spec/**/*"]
Add a license to gem spec
diff --git a/lib/ssrs/datasource.rb b/lib/ssrs/datasource.rb index abc1234..def5678 100644 --- a/lib/ssrs/datasource.rb +++ b/lib/ssrs/datasource.rb @@ -3,14 +3,8 @@ BASE_PATH = 'DataSources' attr_accessor :name, :host, :instance, :database, :datasource_id, :username, :password - def initialize(name, database_key) + def initialize(name) self.name = name - config = SSRS.config_for_env( database_key, DB_ENV ) - self.host = config["host"] - self.instance = config["instance"] - self.database = config["database"] - self.username = config["username"] - self.password = config["password"] self.datasource_id = SSRS::UUID.create.to_s end
Stop DataSource going and looking up its configuration and instead expect the caller to configure the DataSource
diff --git a/lib/tasks/install.rake b/lib/tasks/install.rake index abc1234..def5678 100644 --- a/lib/tasks/install.rake +++ b/lib/tasks/install.rake @@ -1,17 +1,18 @@ namespace :spree_simple_product_translations do desc "Copies all migrations and assets (NOTE: This will be obsolete with Rails 3.1)" task :install do - Rake::Task['spree_simple_product_translations:install:migrations'].invoke + # Rake::Task['spree_simple_product_translations:install:migrations'].invoke Rake::Task['spree_simple_product_translations:install:assets'].invoke end namespace :install do - desc "Copies all migrations (NOTE: This will be obsolete with Rails 3.1)" - task :migrations do - source = File.join(File.dirname(__FILE__), '..', '..', 'db') - destination = File.join(Rails.root, 'db') - Spree::FileUtilz.mirror_files(source, destination) - end + # desc "Copies all migrations (NOTE: This will be obsolete with Rails 3.1)" + # task :migrations do + # source = File.join(File.dirname(__FILE__), '..', '..', 'db') + # destination = File.join(Rails.root, 'db') + # puts "INFO: Mirroring migrations from #{source} to #{destination}" + # Spree::FileUtilz.mirror_files(source, destination) + # end desc "Copies all assets (NOTE: This will be obsolete with Rails 3.1)" task :assets do @@ -21,5 +22,4 @@ Spree::FileUtilz.mirror_files(source, destination) end end - -end+end
Remove migrations mirroring rake task since there are no migrations to mirror.
diff --git a/htmlbeautifier.gemspec b/htmlbeautifier.gemspec index abc1234..def5678 100644 --- a/htmlbeautifier.gemspec +++ b/htmlbeautifier.gemspec @@ -15,7 +15,7 @@ s.require_paths = ["lib"] - s.required_ruby_version = '>= 1.9.2' + s.required_ruby_version = '>= 2.6.0' s.add_development_dependency "rake", "~> 0" s.add_development_dependency "rspec", "~> 3"
Drop support for unmaintained Ruby versions
diff --git a/config/software/gtar.rb b/config/software/gtar.rb index abc1234..def5678 100644 --- a/config/software/gtar.rb +++ b/config/software/gtar.rb @@ -15,9 +15,9 @@ # name "gtar" -default_version "1.2.9" +default_version "1.29" -version("1.2.9") { source md5: "2e115fe26e435e33b0d5c022e4490567" } +version("1.29") { source md5: "c57bd3e50e43151442c1995f6236b6e9" } license "GPL-3.0" license_file "COPYING"
Fix version copy paste typo
diff --git a/lib/yubioath/select.rb b/lib/yubioath/select.rb index abc1234..def5678 100644 --- a/lib/yubioath/select.rb +++ b/lib/yubioath/select.rb @@ -0,0 +1,28 @@+require 'bindata' + +module YubiOATH + class Select + def self.send(aid:, to:) + Response.read(to.transmit(Request.new(aid: aid).to_binary_s)) + end + + class Request < BinData::Record + uint8 :cla, value: CLA + uint8 :ins, value: 0xA4 + uint8 :p1, value: 0x04 + uint8 :p2, value: 0x00 + uint8 :aid_length, value: -> { aid.length } + array :aid, type: :uint8 + end + + class Response < BinData::Record + uint8 :version_tag, assert: 0x79 + uint8 :version_length + array :version, type: :uint8, initial_length: :version_length + + uint8 :name_tag, assert: 0x71 + uint8 :name_length + array :name, type: :uint8, initial_length: :name_length + end + end +end
Call the Select instruction using `YubiOATH::Select`
diff --git a/spec/integration/cancel_task_spec.rb b/spec/integration/cancel_task_spec.rb index abc1234..def5678 100644 --- a/spec/integration/cancel_task_spec.rb +++ b/spec/integration/cancel_task_spec.rb @@ -11,9 +11,10 @@ expect(output).to match(/Task #{task_id} is getting canceled/) expect(exit_code).to eq(0) - error_event = events(task_id).last['error'] - expect(error_event['code']).to eq(10001) - expect(error_event['message']).to eq("Task #{task_id} cancelled") + task_event = events(task_id).last + expect(task_event).to include('error') + expect(task_event['error']['code']).to eq(10001) + expect(task_event['error']['message']).to eq("Task #{task_id} cancelled") end def events(task_id)
Make cancel task test fail with better error
diff --git a/spec/lib/river_notifications_spec.rb b/spec/lib/river_notifications_spec.rb index abc1234..def5678 100644 --- a/spec/lib/river_notifications_spec.rb +++ b/spec/lib/river_notifications_spec.rb @@ -27,9 +27,11 @@ describe "update" do it "publishes the post together with changed_attributes" do + ActiveRecord::Base.observers.disable :all p = Post.create!(:canonical_path => 'this.that', :document => {:text => 'blipp'}) p.published = true p.document = {:text => 'jumped over the lazy dog'} + ActiveRecord::Base.observers.enable :all RiverNotifications.any_instance.should_receive(:publish!) do |arg| arg[:event].should eq :update arg[:uid].should_not be nil
Disable observer so we dont needlessly attempt a rabbit connection in pebblebed::river
diff --git a/spec/private_attr/everywhere_spec.rb b/spec/private_attr/everywhere_spec.rb index abc1234..def5678 100644 --- a/spec/private_attr/everywhere_spec.rb +++ b/spec/private_attr/everywhere_spec.rb @@ -8,13 +8,13 @@ it 'requiring only private_attr keeps Classes and Modules intact' do require 'private_attr' - -> { class Cla; private_attr_reader :priv; end }.must_raise NoMethodError - -> { module Mod; private_attr_reader :priv; end }.must_raise NoMethodError + Class.new.private_methods.wont_include :private_attr_reader + Module.new.private_methods.wont_include :private_attr_reader end it 'requiring private_attr/everywhere adds it to all Classes and Modules' do require 'private_attr/everywhere' - class Cla; private_attr_reader :priv; end - module Mod; private_attr_reader :priv; end + Class.new.private_methods.must_include :private_attr_reader + Module.new.private_methods.must_include :private_attr_reader end end
Switch to better private_attr/everywhere test assertions
diff --git a/spec/unit/postmark/inflector_spec.rb b/spec/unit/postmark/inflector_spec.rb index abc1234..def5678 100644 --- a/spec/unit/postmark/inflector_spec.rb +++ b/spec/unit/postmark/inflector_spec.rb @@ -0,0 +1,24 @@+require 'spec_helper' + +describe Postmark::Inflector do + + describe ".to_postmark" do + it 'converts rubyish underscored format to camel cased symbols accepted by the Postmark API' do + subject.to_postmark(:foo_bar).should == 'FooBar' + subject.to_postmark(:_bar).should == 'Bar' + subject.to_postmark(:really_long_long_long_long_symbol).should == 'ReallyLongLongLongLongSymbol' + end + + it 'accepts strings as well' do + subject.to_postmark('foo_bar').should == 'FooBar' + end + end + + describe ".to_ruby" do + it 'converts camel cased symbols returned by the Postmark API to underscored Ruby symbols' do + subject.to_ruby('FooBar').should == :foo_bar + subject.to_ruby('LongTimeAgoInAFarFarGalaxy').should == :long_time_ago_in_a_far_far_galaxy + subject.to_ruby('ABCDEFG').should == :a_b_c_d_e_f_g + end + end +end
Add a spec for Postmark::Inflector.
diff --git a/db/migrate/20150324163317_move_fax_from_offer_to_contact_person.rb b/db/migrate/20150324163317_move_fax_from_offer_to_contact_person.rb index abc1234..def5678 100644 --- a/db/migrate/20150324163317_move_fax_from_offer_to_contact_person.rb +++ b/db/migrate/20150324163317_move_fax_from_offer_to_contact_person.rb @@ -0,0 +1,14 @@+class MoveFaxFromOfferToContactPerson < ActiveRecord::Migration + def change + add_column :contact_people, :fax_area_code, :string, limit: 6 + add_column :contact_people, :fax_number, :string, limit: 32 + + Offer.find_each do |offer| + cp = ContactPerson.new(fax_number: offer.fax) + cp.save(validate: false) + offer.contact_people << cp + end + + remove_column :offers, :fax, :string + end +end
Add migration to move fax from offers to contact_people
diff --git a/app/models/campaign.rb b/app/models/campaign.rb index abc1234..def5678 100644 --- a/app/models/campaign.rb +++ b/app/models/campaign.rb @@ -9,7 +9,7 @@ has_many :purchases has_many :rewards has_many :heroes, -> { order(user_character: :desc) } - has_many :items + has_many :items, -> { order(sold: :asc, updated_at: :desc) } validates :name, presence: :true validates :game_master, presence: :true
Sort items- not sold are on top
diff --git a/app/models/gem_typo.rb b/app/models/gem_typo.rb index abc1234..def5678 100644 --- a/app/models/gem_typo.rb +++ b/app/models/gem_typo.rb @@ -8,9 +8,8 @@ end def protected_typo? - gem_typo_exceptions = GemTypoException.all.pluck(:name) - return false if gem_typo_exceptions.include?(@rubygem_name) - + return false if GemTypoException.where('upper(name) = upper(?)', @rubygem_name).any? + return false if published_exact_name_matches.any? match = matched_protected_gem_names.select(:id, :name).first @@ -23,10 +22,7 @@ private def published_exact_name_matches - Rubygem.joins(:versions).where( - "versions.yanked_at IS NULL AND upper(rubygems.name) = upper(?)", - @rubygem_name - ) + RubyGem.with_versions.where('upper(rubygems.name) = upper(?)', @rubygem_name) end def matched_protected_gem_names
Refactor database queries for exceptions and published Gem names 1. Refactor published_exact_name_matches to use existing Scope 2. Updated GemTypoException check to use database instead of array search
diff --git a/app/models/question.rb b/app/models/question.rb index abc1234..def5678 100644 --- a/app/models/question.rb +++ b/app/models/question.rb @@ -1,6 +1,20 @@ class Question < ActiveRecord::Base belongs_to :user has_many :answers, dependent: :destroy + has_many :votes, as: :voteable, dependent: :destroy has_many :comments, as: :commentable, dependent: :destroy - has_many :votes, as: :voteable, dependent: :destroy + + def net_votes + upvotes - downvotes + end + + private + + def upvotes + votes.where(upvote: true).count + end + + def downvotes + votes.where(upvote: false).count + end end
Add methods for vote counts
diff --git a/Casks/yubikey-personalization-gui.rb b/Casks/yubikey-personalization-gui.rb index abc1234..def5678 100644 --- a/Casks/yubikey-personalization-gui.rb +++ b/Casks/yubikey-personalization-gui.rb @@ -1,6 +1,6 @@ cask :v1 => 'yubikey-personalization-gui' do - version '3.1.18' - sha256 'b6acac4b25cc0758e3333ee11ef9fdd966766e063cb051a9f9092bb5bf8e0dc0' + version '3.1.20' + sha256 '6b0ba303d52f86f971d7fe8e4fb2cc0b05a1ef9c4b4167090dd6a5ef23e10e01' url "https://developers.yubico.com/yubikey-personalization-gui/Releases/yubikey-personalization-gui-#{version}.pkg" name 'YubiKey Personalization GUI'
Upgrade YubiKey Personalization Tool.app to v3.1.20
diff --git a/app/controllers/spree/home_controller_decorator.rb b/app/controllers/spree/home_controller_decorator.rb index abc1234..def5678 100644 --- a/app/controllers/spree/home_controller_decorator.rb +++ b/app/controllers/spree/home_controller_decorator.rb @@ -2,13 +2,13 @@ def index slider = Spree::Taxon.where(:name => 'Slider').first - @slider_products = slider.products.active.uniq if slider + @slider_products = slider.products.active.to_a.uniq if slider featured = Spree::Taxon.where(:name => 'Featured').first - @featured_products = featured.products.active.uniq if featured + @featured_products = featured.products.active.to_a.uniq if featured latest = Spree::Taxon.where(:name => 'Latest').first - @latest_products = latest.products.active.uniq if latest + @latest_products = latest.products.active.to_a.uniq if latest end end
Fix sliders when using postgres
diff --git a/rb/spec/integration/selenium/webdriver/chrome/driver_spec.rb b/rb/spec/integration/selenium/webdriver/chrome/driver_spec.rb index abc1234..def5678 100644 --- a/rb/spec/integration/selenium/webdriver/chrome/driver_spec.rb +++ b/rb/spec/integration/selenium/webdriver/chrome/driver_spec.rb @@ -0,0 +1,24 @@+module Selenium + module WebDriver + module Firefox + + describe Driver do + it "should accept an array of custom command line switches" do + begin + driver = Selenium::WebDriver.for :chrome, :switches => ["--disable-translate"] + ensure + driver.quit if driver + end + end + + it "should raise ArgumentError if :switches is not an Array" do + lambda { + Selenium::WebDriver.for(:chrome, :switches => "--foo") + }.should raise_error(ArgumentError) + end + end + + end # Chrome + end # WebDriver +end # Selenium +
JariBakken: Add missing file from last commit. git-svn-id: 4179480af2c2519a5eb5e1e9b541cbdf5cf27696@12313 07704840-8298-11de-bf8c-fd130f914ac9