diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/Futuristic.podspec b/Futuristic.podspec index abc1234..def5678 100644 --- a/Futuristic.podspec +++ b/Futuristic.podspec @@ -17,6 +17,4 @@ s.dependency 'Result', '~> 2.1' s.requires_arc = true - - s.pod_target_xcconfig = { 'SWIFT_VERSION' => '2.3' } end
Remove swift version from podspec
diff --git a/db/migrate/20190125170630_add_reset_password_token_index_to_spree_users.rb b/db/migrate/20190125170630_add_reset_password_token_index_to_spree_users.rb index abc1234..def5678 100644 --- a/db/migrate/20190125170630_add_reset_password_token_index_to_spree_users.rb +++ b/db/migrate/20190125170630_add_reset_password_token_index_to_spree_users.rb @@ -0,0 +1,32 @@+class AddResetPasswordTokenIndexToSpreeUsers < SolidusSupport::Migration[4.2] + # We're not using the standard Rails index name because somebody could have + # already added that index to the table. By using a custom name we ensure + # that the index can effectively be added and removed via migrations/rollbacks + # without having any impact on such installations. The index name is Rails + # standard name + "_solidus_auth_devise"; the length is 61 chars which is + # still OK for Sqlite, mySQL and Postgres. + def custom_index_name + 'index_spree_users_on_reset_password_token_solidus_auth_devise' + end + + def default_index_exists? + index_exists?(:spree_users, :reset_password_token) + end + + def custom_index_exists? + index_exists?(:spree_users, :reset_password_token, name: custom_index_name) + end + + def up + Spree::User.reset_column_information + if Spree::User.column_names.include?('reset_password_token') && !default_index_exists? && !custom_index_exists? + add_index :spree_users, :reset_password_token, unique: true, name: custom_index_name + end + end + + def down + if custom_index_exists? + remove_index :spree_users, name: custom_index_name + end + end +end
Add DB index to `reset_password_token` field This field should have an index in order to ensure uniqueness also at DB level and to speed up search performances. The index is added only if it does not exist yet and if the field actually exists on the DB. This index is present also in DB migrations generated by Devise gem. In order to be nice to installations that may have already added the index with the standard Rails/Devise name, the migration uses a custom name. This helps avoiding issues when rolling back the migration.
diff --git a/spec/mailers/user_mailer_spec.rb b/spec/mailers/user_mailer_spec.rb index abc1234..def5678 100644 --- a/spec/mailers/user_mailer_spec.rb +++ b/spec/mailers/user_mailer_spec.rb @@ -1,6 +1,7 @@ require "spec_helper" RSpec.describe UserMailer, type: :mailer do + before { ResqueSpec.reset! } describe "#post_has_new_reply" do it "sends email" do ActionMailer::Base.deliveries.clear
Reset ResqueSpec before each UserMailer test Running the test suite with 'bundle exec rspec --seed 58707' used to make tests fail, as it ran these out of order and the tests were not resetting the queues appropriately. This fixes that.
diff --git a/app/services/git_log_importer.rb b/app/services/git_log_importer.rb index abc1234..def5678 100644 --- a/app/services/git_log_importer.rb +++ b/app/services/git_log_importer.rb @@ -46,10 +46,18 @@ end def handle_author_data(mapped_result:) - Author.find_or_create_by!( - email: mapped_result.author_email, - name: mapped_result.author_name - ) + author = Author.find_by(email: mapped_result.author_email) + + unless author.present? + author = Author.new( + email: mapped_result.author_email, + name: mapped_result.author_name + ) + + author.save! + end + + author end class MappedResult < OpenStruct
Make the author finding more tolerant
diff --git a/spec/lib/lipo_spec.rb b/spec/lib/lipo_spec.rb index abc1234..def5678 100644 --- a/spec/lib/lipo_spec.rb +++ b/spec/lib/lipo_spec.rb @@ -5,18 +5,17 @@ describe '#bundle_path' do subject { lipo.bundle_path } - it { should match(/spec\/resources\/chou.app/) } + it { is_expected.to match(/spec\/resources\/chou.app/) } end describe '#plist_path' do subject{ lipo.send(:plist_path) } - it { should match(/spec\/resources\/chou.app\/Info.plist/) } + it { is_expected.to match(/spec\/resources\/chou.app\/Info.plist/) } end describe '#binary_path' do subject{ lipo.send(:binary_path) } - it { should match('/spec/resources/chou.app/chou') } - it { should match(/spec\/resources\/chou.app\/chou/) } + it { is_expected.to match(/spec\/resources\/chou.app\/chou/) } end describe '#info' do
Use rspec expect syntax instead of should
diff --git a/omf_rc_shm.gemspec b/omf_rc_shm.gemspec index abc1234..def5678 100644 --- a/omf_rc_shm.gemspec +++ b/omf_rc_shm.gemspec @@ -20,6 +20,7 @@ spec.add_development_dependency "bundler", "~> 1.3" spec.add_development_dependency "rake" spec.add_runtime_dependency "omf_rc", "~> 6.0.5" + spec.add_runtime_dependency "json-jwt" spec.add_runtime_dependency "cronedit" spec.add_runtime_dependency "listen" end
Add json-jwt since local comm use json
diff --git a/spec/server/rack_adapter_spec.rb b/spec/server/rack_adapter_spec.rb index abc1234..def5678 100644 --- a/spec/server/rack_adapter_spec.rb +++ b/spec/server/rack_adapter_spec.rb @@ -12,7 +12,7 @@ end it "should pass up to the next middleware on 404" do - @superapp.should_receive(:call).and_return([200, {}, 'OK']) - @app.call(Rack::MockRequest.env_for('/INVALID')).should == [200, {}, 'OK'] + @superapp.should_receive(:call).and_return([200, {}, ['OK']]) + @app.call(Rack::MockRequest.env_for('/INVALID')).should == [200, {}, ['OK']] end end
Fix specs to use proper rack protocol
diff --git a/Casks/scansnap-manager-s1500.rb b/Casks/scansnap-manager-s1500.rb index abc1234..def5678 100644 --- a/Casks/scansnap-manager-s1500.rb +++ b/Casks/scansnap-manager-s1500.rb @@ -0,0 +1,16 @@+cask 'scansnap-manager-s1500' do + version :latest + sha256 :no_check + + # pfultd.com is the official download host per the vendor homepage + url 'http://origin.pfultd.com/downloads/IMAGE/driver/ss/mgr/m-s1500/MacS1500ManagerV32L80WW.dmg' + name 'ScanSnap Manager for Fujitsu ScanSnap s1500' + homepage 'https://www.fujitsu.com/global/support/products/computing/peripheral/scanners/scansnap/software/s1500.html' + license :gratis + + depends_on :macos => '>= :lion' + + pkg 'ScanSnap Manager.pkg' + + uninstall :pkgutil => 'jp.co.pfu.ScanSnap.*' +end
Add ScanSnap Manager for Fujitsu ScanSnap s1500
diff --git a/lib/ffi.rb b/lib/ffi.rb index abc1234..def5678 100644 --- a/lib/ffi.rb +++ b/lib/ffi.rb @@ -1,4 +1,5 @@-if !defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby" +if !defined?(RUBY_ENGINE) || RUBY_ENGINE == 'ruby' || RUBY_ENGINE == 'rbx' + Object.send(:remove_const, :FFI) if defined?(::FFI) begin if RUBY_VERSION =~ /1.8/ require '1.8/ffi_c'
Enable loading FFI gem on rubinius
diff --git a/LightRoute.podspec b/LightRoute.podspec index abc1234..def5678 100644 --- a/LightRoute.podspec +++ b/LightRoute.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "LightRoute" - s.version = "2.1.17" + s.version = "2.1.18" s.summary = "LightRoute is easy transition between view controllers and support many popylar arhitectures" s.description = <<-DESC LightRoute is easy transition between view controllers and support many popylar arhitectures. This framework very flow for settings your transition and have userfriendly API.
Update spec to version 2.1.18
diff --git a/test/unit/remotely_exceptional_test.rb b/test/unit/remotely_exceptional_test.rb index abc1234..def5678 100644 --- a/test/unit/remotely_exceptional_test.rb +++ b/test/unit/remotely_exceptional_test.rb @@ -12,10 +12,13 @@ should "be defined" do assert_kind_of Module, subject end + end + end - should "have a version" do - assert_match(/\d+\.\d+\.\d+/, Subject::VERSION) - end + context Subject.name do + subject { Subject } + should "have a version" do + assert_match(/\d+\.\d+\.\d+/, Subject::VERSION) end end end
Move version test to different context
diff --git a/app/controllers/artists_controller.rb b/app/controllers/artists_controller.rb index abc1234..def5678 100644 --- a/app/controllers/artists_controller.rb +++ b/app/controllers/artists_controller.rb @@ -18,7 +18,8 @@ def index @artists = Artist.all.order('LOWER(name)') - @chart_data = Artist.joins(:glass_art_pieces).group('Artists.id', 'Artists.name').count.map { |k, v| [k.last, v] } + @chart_data = Artist.joins(:glass_art_pieces). + group('Artists.id', 'Artists.name').order('count_all DESC').limit(10).count.map { |k, v| [k.last, v] } end private
Make this cart only top 10 too
diff --git a/app/controllers/follows_controller.rb b/app/controllers/follows_controller.rb index abc1234..def5678 100644 --- a/app/controllers/follows_controller.rb +++ b/app/controllers/follows_controller.rb @@ -1,12 +1,15 @@ class FollowsController < ApplicationController def create - current_user.followees << User.find(params[:id]) + user = User.find(params[:followee_id]) + current_user.follow(user) + redirect_to user end def destroy - user = User.find(params[:id]) - user.followers.delete(current_user) + user = Follow.find(params[:id]).followee + current_user.unfollow(user) + redirect_to user end end
Update create and destroy actions
diff --git a/db/migrate/20121005142110_regenerate_err_fingerprints.rb b/db/migrate/20121005142110_regenerate_err_fingerprints.rb index abc1234..def5678 100644 --- a/db/migrate/20121005142110_regenerate_err_fingerprints.rb +++ b/db/migrate/20121005142110_regenerate_err_fingerprints.rb @@ -10,8 +10,10 @@ :environment => err.environment, :api_key => err.app.api_key } - fingerprint = Digest::SHA1.hexdigest(fingerprint_source.to_s) - err.update_attribute(:fingerprint, fingerprint) + err.update_attribute( + :fingerprint, + Fingerprint.generate(err.notices.first, err.app.api_key) + ) end end end
Update migration to generate fingerprint in best system See #557
diff --git a/app/serializers/comment_serializer.rb b/app/serializers/comment_serializer.rb index abc1234..def5678 100644 --- a/app/serializers/comment_serializer.rb +++ b/app/serializers/comment_serializer.rb @@ -2,7 +2,7 @@ embed :ids attributes :id, :body, :created_at - has_one :task, embed: :id, polymorpic: true + has_one :task, embed: :id, polymorphic: true, include: true has_one :commenter, serializer: UserSerializer, include: true, root: :users has_one :comment_look, include: true, embed: :ids
Fix typo. Include task in comment payload. [Fixes #77048202]
diff --git a/app/serializers/subject_serializer.rb b/app/serializers/subject_serializer.rb index abc1234..def5678 100644 --- a/app/serializers/subject_serializer.rb +++ b/app/serializers/subject_serializer.rb @@ -10,7 +10,6 @@ can_include :project, :collections def locations - @model.locations.order("\"media\".\"metadata\"->>'index' ASC").map do |loc| { loc.content_type => loc.url_for_format(@context[:url_format] || :get)
Remove blank line at start of method body
diff --git a/api/app/policies/new_club_application_policy.rb b/api/app/policies/new_club_application_policy.rb index abc1234..def5678 100644 --- a/api/app/policies/new_club_application_policy.rb +++ b/api/app/policies/new_club_application_policy.rb @@ -32,6 +32,6 @@ private def user_added? - record.users.include? user + record.users.exists? user.id end end
Reduce unneeded DB calls when checking if user_added?
diff --git a/test/integration/request_test.rb b/test/integration/request_test.rb index abc1234..def5678 100644 --- a/test/integration/request_test.rb +++ b/test/integration/request_test.rb @@ -23,13 +23,13 @@ visit root_path # common for all paths - assert_equal 1, aggregate['request.time.total'][:count], 'should record total time' + assert_equal 1, aggregate['request.time'][:count], 'should record total time' assert_equal 1, aggregate['request.time.db'][:count], 'should record db time' assert_equal 1, aggregate['request.time.view'][:count], 'should record view time' # status specific - assert_equal 1, aggregate['request.status.200.time.total'][:count] - assert_equal 1, aggregate['request.status.2xx.time.total'][:count] + assert_equal 1, aggregate['request.status.200.time'][:count] + assert_equal 1, aggregate['request.status.2xx.time'][:count] end test 'track exceptions' do
Fix tests for dropping .total suffix
diff --git a/backbone_fixtures_rails.gemspec b/backbone_fixtures_rails.gemspec index abc1234..def5678 100644 --- a/backbone_fixtures_rails.gemspec +++ b/backbone_fixtures_rails.gemspec @@ -1,5 +1,6 @@ # -*- encoding: utf-8 -*- -require_relative 'lib/backbone_fixtures_rails/version' +$:.push File.expand_path("../lib", __FILE__) +require 'backbone_fixtures_rails/version' Gem::Specification.new do |s| s.name = "backbone_fixtures_rails"
Fix relative require problem in gemspec
diff --git a/cobbler/snippets/client.rb b/cobbler/snippets/client.rb index abc1234..def5678 100644 --- a/cobbler/snippets/client.rb +++ b/cobbler/snippets/client.rb @@ -6,9 +6,15 @@ #if $getVar('proxy', '') != "" http_proxy '$proxy' https_proxy '$proxy' +ENV['http_proxy'] = '$proxy' +ENV['https_proxy'] = '$proxy' +ENV['HTTP_PROXY'] = '$proxy' +ENV['HTTPS_PROXY'] = '$proxy' #end if #if $getVar('ignore_proxy', '') != "" no_proxy '$ignore_proxy' +ENV['no_proxy'] = '$ignore_proxy' +ENV['NO_PROXY'] = '$ignore_proxy' #end if #if $getVar('chef_node_name', '') != "" node_name '$chef_node_name'
Set proxy env variable so that rubygems works Change-Id: Ia07abee94484137a870c0dd07678bde293e86d7f
diff --git a/promisepay.gemspec b/promisepay.gemspec index abc1234..def5678 100644 --- a/promisepay.gemspec +++ b/promisepay.gemspec @@ -10,8 +10,10 @@ spec.email = ['[email protected]'] spec.summary = 'Gem to wrap promisepay.com API.' spec.description = 'Gem to wrap promisepay.com API.' - spec.homepage = '' + spec.homepage = 'https://github.com/PromisePay/promisepay-ruby' spec.license = 'MIT' + + spec.required_ruby_version = '>= 1.9.3' spec.files = `git ls-files -z`.split("\x0") spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
Add homepage and required ruby version to gemspec file
diff --git a/test/helper.rb b/test/helper.rb index abc1234..def5678 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -14,6 +14,13 @@ Sauce.config do |c| c[:start_tunner] = ENV['RUN_ON_SAUCE'] c[:browsers] = [ - ["OS X 10.10", "Chrome", "39"] # TBD + + ['OS X 10.10', 'Chrome', '40'], + ['OS X 10.10', 'Firefox', '35.0'], + ['OS X 10.10', 'Safari', '8.0'], + + ['Windows 7', 'Chrome', '40'], + ['Windows 7', 'Firefox', '35.0'], + ['Windows 7', 'Safari', '5.1'] ] end
Add more platforms to sauce's 'browsers' config
diff --git a/test/helper.rb b/test/helper.rb index abc1234..def5678 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -1,8 +1,11 @@ # -*- encoding: utf-8 -*- +require 'coveralls' require 'test/unit' require 'fluent/test' require 'fluent/plugin/in_udp_event' + +Coveralls.wear! unless defined?(Test::Unit::AssertionFailedError) class Test::Unit::AssertionFailedError < StandardError
Add coveralls when running tests
diff --git a/lib/banjo.rb b/lib/banjo.rb index abc1234..def5678 100644 --- a/lib/banjo.rb +++ b/lib/banjo.rb @@ -17,6 +17,11 @@ end def self.load_channels + load_channels! + rescue Exception + end + + def self.load_channels! Dir['./channels/*.rb'].each do |file| load file end @@ -31,10 +36,7 @@ EventMachine.run do n = 0 EM.add_periodic_timer(tempo_in_ms) do - begin - Banjo.load_channels - rescue Exception - end + Banjo.load_channels if n == 0 Banjo::Channel.channels.each do |klass| channel = klass.new(n)
Refactor a bit how channels are loaded
diff --git a/recipes/default.rb b/recipes/default.rb index abc1234..def5678 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -12,7 +12,7 @@ package 'munin-node' do action :install notifies :run, "execute[clean-default-plugins]" -# notifies :run, "execute[clean-default-plugin-conf]" + notifies :run, "execute[clean-default-plugin-conf]" end file "/etc/munin/munin-node.conf" do
Clean plugin-conf.d too after install
diff --git a/lib/i18n_rails_helpers/railtie.rb b/lib/i18n_rails_helpers/railtie.rb index abc1234..def5678 100644 --- a/lib/i18n_rails_helpers/railtie.rb +++ b/lib/i18n_rails_helpers/railtie.rb @@ -0,0 +1,10 @@+require 'i18n_rails_helpers' +require 'rails' + +module I18nRailsHelpers + class Railtie < Rails::Railtie + initializer :after_initialize do + ActionController::Base.helper I18nRailsHelpers + end + end +end
Add Railtie for Rails 3 compatibility.
diff --git a/lib/kitty_events/handle_worker.rb b/lib/kitty_events/handle_worker.rb index abc1234..def5678 100644 --- a/lib/kitty_events/handle_worker.rb +++ b/lib/kitty_events/handle_worker.rb @@ -4,7 +4,11 @@ module KittyEvents class HandleWorker < ActiveJob::Base def perform(event, object) - self.class.parent.handle(event, object) + if self.class.respond_to?(:module_parent) + self.class.module_parent.handle(event, object) + else + self.class.parent.handle(event, object) + end end end end
Fix breakage resulting from Rails 6 upgrade Use Module.module_parent instead of Module.parent because Rails deprecated the parent() method in 6 and removed it in 6.1. This is part of the Rails 6.1.4 upgrade.
diff --git a/lib/lobster/abstract_attribute.rb b/lib/lobster/abstract_attribute.rb index abc1234..def5678 100644 --- a/lib/lobster/abstract_attribute.rb +++ b/lib/lobster/abstract_attribute.rb @@ -1,5 +1,7 @@ # Custom class attributes. class Class + + private # Defines an abstract method. # The method will throw a {NotImplementedError} when invoked.
Make abstract method private to class definitions
diff --git a/lib/tasks/pretty_flash_tasks.rake b/lib/tasks/pretty_flash_tasks.rake index abc1234..def5678 100644 --- a/lib/tasks/pretty_flash_tasks.rake +++ b/lib/tasks/pretty_flash_tasks.rake @@ -1,7 +1,7 @@ namespace :pretty_flash do desc "Copies assets to proper application directories" task :install do - ASSETS = File.join(File.dirname(__FILE__), '..', 'assets') + ASSETS = File.join(File.dirname(__FILE__), ['..', '..'].join(File::SEPARATOR), 'assets') Dir.glob("#{ASSETS}/*").each do |folder| folder_name = folder.gsub(/\/.+\//, '') destination = File.join(Rails.public_path, folder_name)
Use correct path to find assets
diff --git a/test/all_basic.rb b/test/all_basic.rb index abc1234..def5678 100644 --- a/test/all_basic.rb +++ b/test/all_basic.rb @@ -5,15 +5,15 @@ module Test - module Unit - class TestCase - alias :_old_run_ :run - def run(result, &blk) - puts "Running #{@method_name}" - _old_run_(result, &blk) - end - end - end + module Unit + class TestCase + alias :_old_run_ :run + def run(result, &blk) + puts "Running #{@method_name}" + _old_run_(result, &blk) + end + end + end end @@ -30,3 +30,5 @@ require 'ImageList1.rb' require 'ImageList2.rb' require 'Image_attributes.rb' +require 'Pixel.rb' +require 'Magick.rb'
Include Magick.rb and Pixel.rb suites
diff --git a/test/rack_test.rb b/test/rack_test.rb index abc1234..def5678 100644 --- a/test/rack_test.rb +++ b/test/rack_test.rb @@ -9,7 +9,7 @@ context "A Rack app" do app { lambda { [200, {}, "Hello, World!"] } } - context "on a GET" do + context "serving a GET request to '/'" do setup { get '/' } asserts(:status).equals(200) asserts(:body).equals("Hello, World!")
Use better wording in the tests
diff --git a/spec/factories/community_factory.rb b/spec/factories/community_factory.rb index abc1234..def5678 100644 --- a/spec/factories/community_factory.rb +++ b/spec/factories/community_factory.rb @@ -5,5 +5,6 @@ sequence(:name) { |n| "Community #{n}" } sequence(:abbrv) { |n| "C#{n % 10}" } sequence(:slug) { |n| "community#{n}" } + country_code { "US" } end end
797: Set country code in community factory
diff --git a/spec/models/user_shared_examples.rb b/spec/models/user_shared_examples.rb index abc1234..def5678 100644 --- a/spec/models/user_shared_examples.rb +++ b/spec/models/user_shared_examples.rb @@ -6,12 +6,11 @@ shared_examples_for "user models" do describe '#get_twitter_imports_count' do + include_context 'users helper' it "should count tweet imports" do - u1 = create_user(email: '[email protected]', username: 'ub1', password: 'admin123') - st = SearchTweet.new - st.user = u1 + st.user = @user1 st.table_id = '96a86fb7-0270-4255-a327-15410c2d49d4' st.data_import_id = '96a86fb7-0270-4255-a327-15410c2d49d4' st.service_item_id = '555' @@ -19,9 +18,7 @@ st.state = ::SearchTweet::STATE_COMPLETE st.save - get_twitter_imports_count_by_user_id(u1.id).should == 5 - - u1.destroy + get_twitter_imports_count_by_user_id(@user1.id).should == 5 end end
Refactor user test using users helper
diff --git a/spec/earth_spec.rb b/spec/earth_spec.rb index abc1234..def5678 100644 --- a/spec/earth_spec.rb +++ b/spec/earth_spec.rb @@ -21,31 +21,4 @@ Earth.resources.should include('Industry') end end - - describe '.database_configurations' do - it 'reads configuration from a yaml file' do - require 'sandbox' - require 'fileutils' - Sandbox.play do |path| - Dir.chdir path do - FileUtils.mkdir 'config' - File.open 'config/database.yml', 'w' do |f| - f.puts <<-YML - test: - adapter: mysql - database: just_a_test - YML - end - - Earth.database_configurations['test'].should == { - 'adapter' => 'mysql', - 'database' => 'just_a_test' - } - end - end - end - it "defaults to Earth's test environment" do - Earth.database_configurations['test']['database'].should == 'test_earth' - end - end end
Fix earth spec for removal of config management
diff --git a/tools/purge_archived_storages.rb b/tools/purge_archived_storages.rb index abc1234..def5678 100644 --- a/tools/purge_archived_storages.rb +++ b/tools/purge_archived_storages.rb @@ -7,9 +7,12 @@ end if opts[:dry_run] - puts "\n" - puts "* This is a dry run and will not modify the database" - puts "* To actually delete archived datastores pass --no-dry-run\n\n" + puts "**** This is a dry run and will not modify the database" + puts " To actually purge the storages pass --no-dry-run" +else + puts "**** This will modify your database ****" + puts " Press Enter to Continue: " + STDIN.getc end active_storage_ids = HostStorage.pluck(:storage_id).uniq
Add an explicit "Press Enter to Continue"
diff --git a/scoped_search.gemspec b/scoped_search.gemspec index abc1234..def5678 100644 --- a/scoped_search.gemspec +++ b/scoped_search.gemspec @@ -1,7 +1,7 @@ Gem::Specification.new do |s| s.name = 'scoped_search' - s.version = '0.7.1' - s.date = '2008-10-11' + s.version = '0.7.2' + s.date = '2008-10-24' s.summary = "A Rails plugin to search your models using a named_scope" s.description = "Scoped search makes it easy to search your ActiveRecord-based models. It will create a named scope according to a provided query string. The named_scope can be used like any other named_scope, so it can be cchained or combined with will_paginate."
Set gem version to 0.7.2
diff --git a/Casks/sencha.rb b/Casks/sencha.rb index abc1234..def5678 100644 --- a/Casks/sencha.rb +++ b/Casks/sencha.rb @@ -1,6 +1,6 @@ cask :v1 => 'sencha' do - version '5.1.1.39' - sha256 'bb3de716b825fe9f8908f96a3f7570499ffbf41bac860a16f57f680b3cd341ad' + version '5.1.3.61' + sha256 '6083490b578191d2b8307b375e115c93c2223683e49636893edadfa1d76a412c' url "http://cdn.sencha.com/cmd/#{version}/SenchaCmd-#{version}-osx.app.zip" name 'Sencha Cmd'
Update to Sencha Cmd 5.1.3.61
diff --git a/Casks/mono-mre.rb b/Casks/mono-mre.rb index abc1234..def5678 100644 --- a/Casks/mono-mre.rb +++ b/Casks/mono-mre.rb @@ -1,6 +1,6 @@ cask :v1 => 'mono-mre' do - version '3.10.0' - sha256 'c9973d1206a36b71964a8b173d452780c19200cac2955723e0d48f969a3f6d28' + version '3.12.0' + sha256 'af104354a7445f5565aa438bd172824bd00088b6a737b371cce09a15b9ca0491' url "http://download.mono-project.com/archive/#{version}/macos-10-x86/MonoFramework-MRE-#{version}.macos10.xamarin.x86.pkg" homepage 'http://mono-project.com'
Upgrade Mono MRE to 3.12.0
diff --git a/Changeset.podspec b/Changeset.podspec index abc1234..def5678 100644 --- a/Changeset.podspec +++ b/Changeset.podspec @@ -10,7 +10,7 @@ spec.source = { :git => 'https://github.com/osteslag/Changeset.git', :tag => "v#{spec.version}" } spec.source_files = 'Sources/*.swift' spec.requires_arc = true - spec.swift_version = '4.0' + spec.swift_version = '4.2' spec.ios.deployment_target = '8.0' spec.tvos.deployment_target = '9.0' spec.osx.deployment_target = '10.9'
Update Swift version in .podspec
diff --git a/textrazor.gemspec b/textrazor.gemspec index abc1234..def5678 100644 --- a/textrazor.gemspec +++ b/textrazor.gemspec @@ -24,4 +24,5 @@ spec.add_development_dependency "bundler", "~> 1.3" spec.add_development_dependency "rake", "~> 10.4" spec.add_development_dependency "rspec", "~> 3.0.0" + spec.add_development_dependency "dotenv", "~> 2.0" end
Add 'dotenv' as development dependency Signed-off-by: Aymeric Brisse <[email protected]>
diff --git a/CoreHound.podspec b/CoreHound.podspec index abc1234..def5678 100644 --- a/CoreHound.podspec +++ b/CoreHound.podspec @@ -11,7 +11,7 @@ s.requires_arc = true s.source_files = 'Pod/**/*.{h,m}' - s.private_header_files = "{Pod/Model/Internal/**/*.h,Pod/**/*+Internal.h,Pod/Network/Internal/**/*.h}" + s.private_header_files = "Pod/Model/Internal/**/*.h", "Pod/**/*+Internal.h", "Pod/Network/Internal/**/*.h" s.resources = ['Pod/Resources/*.cer']
Update private header pattern in podspec
diff --git a/lib/s3_file.rb b/lib/s3_file.rb index abc1234..def5678 100644 --- a/lib/s3_file.rb +++ b/lib/s3_file.rb @@ -3,7 +3,7 @@ def url s3 = AWS::S3.new bucket = s3.buckets["gradecraft-#{Rails.env}"] - return bucket.objects[CGI::unescape(filepath || filename)].url_for(:read, :expires => 15 * 60).to_s #15 minutes + return bucket.objects[CGI::unescape(filepath)].url_for(:read, :expires => 15 * 60).to_s #15 minutes end private
Remove check for older files. Rake task now takes care of this.
diff --git a/traceview.gemspec b/traceview.gemspec index abc1234..def5678 100644 --- a/traceview.gemspec +++ b/traceview.gemspec @@ -1,9 +1,9 @@ $:.push File.expand_path("../lib", __FILE__) -require "oboe/version" +require "traceview/version" Gem::Specification.new do |s| - s.name = %q{oboe} - s.version = Oboe::Version::STRING + s.name = %q{traceview} + s.version = TraceView::Version::STRING s.date = Time.now.strftime('%Y-%m-%d') s.license = "AppNeta Open License, Version 1.0" @@ -12,7 +12,7 @@ s.email = %q{[email protected]} s.homepage = %q{http://www.appneta.com/products/traceview/} s.summary = %q{AppNeta TraceView performance instrumentation gem for Ruby} - s.description = %q{The oboe gem provides TraceView instrumentation for MRI Ruby, JRuby and related frameworks.} + s.description = %q{The TraceView gem provides performance instrumentation for MRI Ruby, JRuby and related frameworks.} s.extra_rdoc_files = ["LICENSE"] s.files = `git ls-files`.split("\n")
Swap calls to Oboe with TraceView
diff --git a/i_am_valid.gemspec b/i_am_valid.gemspec index abc1234..def5678 100644 --- a/i_am_valid.gemspec +++ b/i_am_valid.gemspec @@ -28,5 +28,6 @@ s.test_files = Dir["{test,spec,features}/**/*"] s.require_paths = ["lib"] #= Manifest =# + + s.add_dependency 'activerecord', '~> 3.1' end -
Add active_record as a dependency
diff --git a/Formula/attica.rb b/Formula/attica.rb index abc1234..def5678 100644 --- a/Formula/attica.rb +++ b/Formula/attica.rb @@ -0,0 +1,14 @@+require 'formula' + +class Attica <Formula + url 'ftp://ftp.kde.org/pub/kde/stable/attica/attica-0.1.2.tar.bz2' + homepage 'http://www.kde.org/' + md5 '8b4207dbc0a826d422632bdb9c50d51a' + + depends_on 'cmake' + + def install + system "cmake . #{std_cmake_parameters}" + system "make install" + end +end
Add formula for Attica 0.1.2.
diff --git a/recipes/default.rb b/recipes/default.rb index abc1234..def5678 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -1,5 +1,4 @@ # -# Author:: Matt Ray <[email protected]> # Cookbook:: drbd # Recipe:: default # @@ -20,11 +19,8 @@ # prime the search to avoid 2 masters node.save -if node['drbd']['custom_repo'] != true - case node['platform'] - when 'redhat', 'centos', 'fedora', 'amazon', 'scientific', 'oracle' - include_recipe 'yum-elrepo' - end +unless node['drbd']['custom_repo'] + include_recipe 'yum-elrepo' if platform_family?('rhel', 'fedora') end drbd_packages = value_for_platform_family(
Simplify the platform check logic a bit Signed-off-by: Tim Smith <[email protected]>
diff --git a/recipes/default.rb b/recipes/default.rb index abc1234..def5678 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -16,7 +16,7 @@ action :install end -node['rvm']['user_installs'] = [ +node['default']['rvm']['user_installs'] = [ { 'user' => 'rubygems_app', 'default_ruby' => '2.0.0', 'rubies' => ['2.0.0']
Fix Node attributes are read-only when you do not specify which precedence level to set. To set an attribute
diff --git a/Curry.podspec b/Curry.podspec index abc1234..def5678 100644 --- a/Curry.podspec +++ b/Curry.podspec @@ -12,6 +12,7 @@ spec.source = { :git => 'https://github.com/thoughtbot/curry.git', :tag => "v#{spec.version}" } spec.source_files = 'Source/**/*.{h,swift}' spec.requires_arc = true + spec.swift_versions = [3.0, 4.0, 5.0] spec.ios.deployment_target = '8.0' spec.osx.deployment_target = '10.9' spec.watchos.deployment_target = '2.0'
Add supported Swift versions to the podspec Turns out we support a bunch of swift versions
diff --git a/lib/generators/react_on_rails/templates/dev_tests/spec/simplecov_helper.rb b/lib/generators/react_on_rails/templates/dev_tests/spec/simplecov_helper.rb index abc1234..def5678 100644 --- a/lib/generators/react_on_rails/templates/dev_tests/spec/simplecov_helper.rb +++ b/lib/generators/react_on_rails/templates/dev_tests/spec/simplecov_helper.rb @@ -10,7 +10,7 @@ SimpleCov.start("rails") do # Consider the entire gem project as the root # (typically this will be the folder named "react_on_rails") - gem_root_path = File.expand_path("../../../../.", __FILE__) + gem_root_path = File.expand_path("../../../../../.", __FILE__) root gem_root_path # Don't report anything that has "spec" in the path
Fix where coverage folder is being output for generated apps
diff --git a/LunchOverflow/spec/models/user_spec.rb b/LunchOverflow/spec/models/user_spec.rb index abc1234..def5678 100644 --- a/LunchOverflow/spec/models/user_spec.rb +++ b/LunchOverflow/spec/models/user_spec.rb @@ -0,0 +1,10 @@+require 'rails_helper' + +describe User do + + describe "Database tests" do + it { should have_db_column(:user_name).of_type(:string) } + it { should have_db_column(:email).of_type(:string) } + it { should have_db_column(:password_digest).of_type(:string) } + end +end
Add Database tests for User
diff --git a/SwiftyAds.podspec b/SwiftyAds.podspec index abc1234..def5678 100644 --- a/SwiftyAds.podspec +++ b/SwiftyAds.podspec @@ -18,7 +18,7 @@ s.source_files = 'Sources/**/*.{h,m,swift}' -s.dependency 'Google-Mobile-Ads-SDK', '~> 7.6' -s.dependency 'PersonalizedAdConsent' +s.dependency 'Google-Mobile-Ads-SDK', '7.69.0' +s.dependency 'PersonalizedAdConsent', '1.0.5' end
Update pod spec dependency version
diff --git a/TJDropbox.podspec b/TJDropbox.podspec index abc1234..def5678 100644 --- a/TJDropbox.podspec +++ b/TJDropbox.podspec @@ -14,9 +14,10 @@ s.source_files = "TJDropbox/*.{h,m}" s.osx.exclude_files = "TJDropbox/TJDropboxAuthenticationViewController.{h,m}" + s.tvos.exclude_files = "TJDropbox/TJDropboxAuthenticationViewController.{h,m}" s.ios.deployment_target = "8.0" s.osx.deployment_target = "10.9" + s.tvos.deployment_target = "9.0" # s.watchos.deployment_target = "2.0" - # s.tvos.deployment_target = "9.0" end
Add tvOS support to podspec.
diff --git a/phantomjs.gemspec b/phantomjs.gemspec index abc1234..def5678 100644 --- a/phantomjs.gemspec +++ b/phantomjs.gemspec @@ -9,9 +9,9 @@ gem.homepage = "https://github.com/colszowka/phantomjs-gem" gem.license = 'MIT' - gem.add_development_dependency 'poltergeist' - gem.add_development_dependency 'capybara', '~> 2.0.0' - gem.add_development_dependency 'rspec', ">= 2.11.0" + gem.add_development_dependency 'poltergeist', '~> 1.5' + gem.add_development_dependency 'capybara', '~> 2.4' + gem.add_development_dependency 'rspec', "~> 2.99" gem.add_development_dependency 'simplecov' gem.add_development_dependency 'rake'
Fix the build by adjusting dependency version specs
diff --git a/poke-api.gemspec b/poke-api.gemspec index abc1234..def5678 100644 --- a/poke-api.gemspec +++ b/poke-api.gemspec @@ -20,5 +20,5 @@ spec.add_runtime_dependency 'httpclient', '2.8.0' spec.add_runtime_dependency 'geocoder', '1.3.7' spec.add_runtime_dependency 'google-protobuf', '~> 3.0.0.alpha' - spec.add_runtime_dependency 'gpsoauth-rb', '0.1.1' + spec.add_runtime_dependency 'gpsoauth-rb', '0.1.2' end
Update GPSOAuth gem version to 0.1.2 This allows for backwards compatibility with older Ruby versions.
diff --git a/verbalize.gemspec b/verbalize.gemspec index abc1234..def5678 100644 --- a/verbalize.gemspec +++ b/verbalize.gemspec @@ -24,6 +24,6 @@ spec.add_development_dependency 'rake', '~> 12.3' spec.add_development_dependency 'rspec' spec.add_development_dependency 'coveralls' - spec.add_development_dependency 'rubocop', '0.45' + spec.add_development_dependency 'rubocop', '0.74.0' spec.add_development_dependency 'pry' end
Update rubocop requirement from = 0.45 to = 0.74.0 Updates the requirements on [rubocop](https://github.com/rubocop-hq/rubocop) to permit the latest version. - [Release notes](https://github.com/rubocop-hq/rubocop/releases) - [Changelog](https://github.com/rubocop-hq/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop-hq/rubocop/compare/v0.45.0...v0.74.0) Signed-off-by: dependabot-preview[bot] <[email protected]>
diff --git a/lib/rescue_tracer/railtie.rb b/lib/rescue_tracer/railtie.rb index abc1234..def5678 100644 --- a/lib/rescue_tracer/railtie.rb +++ b/lib/rescue_tracer/railtie.rb @@ -1,7 +1,9 @@ module RescueTracer class Railtie < Rails::Railtie initializer "rescue_tracer" do - ActionController::Base.send(:include, RescueTracer::Traceable) + ActiveSupport.on_load(:action_controller) do + ActionController::Base.send(:include, RescueTracer::Traceable) + end end end end
Use AS.on_load when touching AC::Base in the initializer
diff --git a/lib/strava/l10n/tx_config.rb b/lib/strava/l10n/tx_config.rb index abc1234..def5678 100644 --- a/lib/strava/l10n/tx_config.rb +++ b/lib/strava/l10n/tx_config.rb @@ -10,7 +10,10 @@ config.get_groups().each do |group| if group == 'main' main = config[group] - @lang_map = Strava::L10n::TxConfig.parse_lang_map(main['lang_map']) + @lang_map = {} + if main['lang_map'] + @lang_map = Strava::L10n::TxConfig.parse_lang_map(main['lang_map']) + end else @resources.push(Strava::L10n::TxConfig.parse_resource(group, config[group])) end
Make lang_map optional in txconfig
diff --git a/test_bed.gemspec b/test_bed.gemspec index abc1234..def5678 100644 --- a/test_bed.gemspec +++ b/test_bed.gemspec @@ -4,9 +4,12 @@ Gem::Specification.new do |gem| gem.authors = ["TheHamon"] gem.email = ["[email protected]"] - gem.description = %q{TODO: Write a gem description} - gem.summary = %q{TODO: Write a gem summary} + gem.description = %q{ The gem is intended to simplify developer's live when dealing with pivotal tracker (PT) and git. } + gem.summary = %q{ } gem.homepage = "" + + gem.add_runtime_dependency "grit" + gem.add_runtime_dependency "pivotal-tracker" gem.files = `git ls-files`.split($\) gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
Add gems for fetching information from PT and git repository
diff --git a/examples/logging_aspect.rb b/examples/logging_aspect.rb index abc1234..def5678 100644 --- a/examples/logging_aspect.rb +++ b/examples/logging_aspect.rb @@ -13,8 +13,9 @@ require 'aspector' class LoggingAspect < Aspector::Base + ALL_METHODS = /.*/ - around /.*/, :except => [:class], :context_arg => true do |context, *args, &block| + around ALL_METHODS, :except => :class, :context_arg => true do |context, *args, &block| class_method = "#{self.class}.#{context.method_name}" puts "Entering #{class_method}: #{args.join(',')}" result = block.call *args
Make aspect more readable by defining constants for all methods pattern
diff --git a/web/lib/models.rb b/web/lib/models.rb index abc1234..def5678 100644 --- a/web/lib/models.rb +++ b/web/lib/models.rb @@ -1,4 +1,4 @@-DB = Sequel.connect(ENV['DATABASE_URL'], pool_timeout: 25) +DB = Sequel.connect(ENV['DATABASE_URL'], max_connections: 12 , pool_timeout: 60) class Package < Sequel::Model end
Increase pool timeout, add more connections
diff --git a/Ruby/lib/mini_profiler/storage/redis_store.rb b/Ruby/lib/mini_profiler/storage/redis_store.rb index abc1234..def5678 100644 --- a/Ruby/lib/mini_profiler/storage/redis_store.rb +++ b/Ruby/lib/mini_profiler/storage/redis_store.rb @@ -7,6 +7,7 @@ def initialize(args) @args = args || {} @prefix = @args.delete(:prefix) || 'MPRedisStore' + @redis_connection = @args.delete(:connection) end def save(page_struct) @@ -35,6 +36,7 @@ private def redis + return @redis_connection if @redis_connection require 'redis' unless defined? Redis Redis.new @args end
Implement external connection creation in RedisStore
diff --git a/test/system/navbar_brand_test.rb b/test/system/navbar_brand_test.rb index abc1234..def5678 100644 --- a/test/system/navbar_brand_test.rb +++ b/test/system/navbar_brand_test.rb @@ -0,0 +1,12 @@+# frozen_string_literal: true + +require 'application_system_test_case' + +class NavbarBrandTest < ApplicationSystemTestCase + test 'the navbar brand logo goes to the root path' do + when_current_user_is :driver + visit root_url + assert_selector '.navbar a.navbar-brand' + assert find('.navbar a.navbar-brand')['href'].include? root_url[0..-2] + end +end
Test the navbar brand bar
diff --git a/lib/boxcar/command/server.rb b/lib/boxcar/command/server.rb index abc1234..def5678 100644 --- a/lib/boxcar/command/server.rb +++ b/lib/boxcar/command/server.rb @@ -16,7 +16,7 @@ end def stop - pid = `cat tmp/pids/thin.pid`.chomp + pid = `cd #{current_path}; cat tmp/pids/thin.pid`.chomp `kill -9 #{pid}` `rm #{current_path}/tmp/pids/thin.pid` puts "Boxcar stopped"
Fix possible bug with thin pid
diff --git a/lib/celluloid/cpu_counter.rb b/lib/celluloid/cpu_counter.rb index abc1234..def5678 100644 --- a/lib/celluloid/cpu_counter.rb +++ b/lib/celluloid/cpu_counter.rb @@ -18,7 +18,7 @@ else Dir["/sys/devices/system/cpu/cpu*"].select { |n| n=~/cpu\d+/ }.count end - when 'mingw', 'mswin' + when 'mingw', 'mswin', 'cygwin' @cores = Integer(ENV["NUMBER_OF_PROCESSORS"][/\d+/]) when 'freebsd' @cores = Integer(`sysctl hw.ncpu`[/\d+/])
Use Windows NUMBER_OF_PROCESSORS for Cygwin
diff --git a/lib/unicode/display_width.rb b/lib/unicode/display_width.rb index abc1234..def5678 100644 --- a/lib/unicode/display_width.rb +++ b/lib/unicode/display_width.rb @@ -3,11 +3,13 @@ module Unicode module DisplayWidth + DEPTHS = [0x10000, 0x1000, 0x100, 0x10].freeze + def self.of(string, ambiguous = 1, overwrite = {}) - res = string.unpack('U*').inject(0){ |total_width, codepoint| + res = string.unpack('U*'.freeze).inject(0){ |total_width, codepoint| index_or_value = INDEX codepoint_depth_offset = codepoint - [0x10000, 0x1000, 0x100, 0x10].each{ |depth| + DEPTHS.each{ |depth| index_or_value = index_or_value[codepoint_depth_offset / depth] codepoint_depth_offset = codepoint_depth_offset % depth break unless index_or_value.is_a? Array
Increase performance and decrease memory usage
diff --git a/app/workers/concerns/project_import_options.rb b/app/workers/concerns/project_import_options.rb index abc1234..def5678 100644 --- a/app/workers/concerns/project_import_options.rb +++ b/app/workers/concerns/project_import_options.rb @@ -1,9 +1,9 @@ module ProjectImportOptions extend ActiveSupport::Concern + IMPORT_RETRY_COUNT = 5 + included do - IMPORT_RETRY_COUNT = 5 - sidekiq_options retry: IMPORT_RETRY_COUNT, status_expiration: StuckImportJobsWorker::IMPORT_JOBS_EXPIRATION # We only want to mark the project as failed once we exhausted all retries
Remove warning noise in ProjectImportOptions Squlches these warnings: ``` /opt/gitlab/embedded/service/gitlab-rails/app/workers/concerns/project_import_options.rb:5: warning: already initialized constant ProjectImportOptions::IMPORT_RETRY_COUNT /opt/gitlab/embedded/service/gitlab-rails/app/workers/concerns/project_import_options.rb:5: warning: previous definition of IMPORT_RETRY_COUNT was here ```
diff --git a/raptor.gemspec b/raptor.gemspec index abc1234..def5678 100644 --- a/raptor.gemspec +++ b/raptor.gemspec @@ -4,6 +4,8 @@ require 'raptor/version' Gem::Specification.new do |spec| + spec.required_ruby_version = '>= 2.0.0' + spec.name = 'raptor' spec.version = Raptor::VERSION spec.date = Time.now.strftime( '%Y-%m-%d' ) @@ -23,4 +25,5 @@ spec.add_development_dependency 'bundler', '~> 1.3' spec.add_development_dependency 'rake' + spec.add_development_dependency 'rspec' end
gemspec: Set Ruby 2.0.0 as minimum accepted version
diff --git a/reagan.gemspec b/reagan.gemspec index abc1234..def5678 100644 --- a/reagan.gemspec +++ b/reagan.gemspec @@ -8,18 +8,18 @@ s.description = s.summary s.authors = ['Tim Smith'] s.email = '[email protected]' + s.homepage = 'http://www.github.com/tas50/reagan' + s.license = 'Apache-2.0' + s.required_ruby_version = '>= 1.9.3' s.add_dependency 'octokit', '~> 3.0' s.add_dependency 'chef', '~> 11.0' s.add_dependency 'ridley', '~> 4.0' s.add_development_dependency 'rake', '~> 10.0' - s.files = %w(Rakefile README.md LICENSE bin/reagan reagan.yml.EXAMPLE reagan_test.yml.EXAMPLE) + Dir.glob('lib/*') - s.homepage = - 'http://www.github.com/tas50/reagan' - s.license = 'Apache-2.0' - s.executables << 'reagan' - s.required_ruby_version = '>= 1.9.3' + s.files = `git ls-files -z`.split("\x0") + s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) } + s.require_paths = ['lib'] s.extra_rdoc_files = ['README.md'] s.rdoc_options = ['--line-numbers', '--inline-source', '--title', 'reagan', '--main', 'README.md'] end
Automate files / executables in the gemspec
diff --git a/lib/synapse_payments/request.rb b/lib/synapse_payments/request.rb index abc1234..def5678 100644 --- a/lib/synapse_payments/request.rb +++ b/lib/synapse_payments/request.rb @@ -2,7 +2,6 @@ class Request HEADERS = { - 'Accept' => 'application/json', 'User-Agent' => "SynapsePaymentsRubyGem/#{SynapsePayments::VERSION}", 'X-Ruby-Version' => RUBY_VERSION, 'X-Ruby-Platform' => RUBY_PLATFORM @@ -32,7 +31,7 @@ 'X-SP-USER' => "#{@oauth_key}|#{@fingerprint}", 'X-SP-USER-IP' => '' }) - HTTP.headers(headers).timeout(@client.timeout_options) + HTTP.headers(headers).accept(:json).timeout(@client.timeout_options) end def fail_or_return_response_body(code, body)
Use HTTP's accept method for specifying JSON I’ve noticed some sporadic incorrect text/html mime type errors when we are expecting JSON consistently. While the library supports specifying it in a few different ways I’m going to stick with this one for now.
diff --git a/lib/end_view/rails_layout.rb b/lib/end_view/rails_layout.rb index abc1234..def5678 100644 --- a/lib/end_view/rails_layout.rb +++ b/lib/end_view/rails_layout.rb @@ -14,12 +14,12 @@ private - def stylesheet_args - ['application', { media: 'all', 'data-turbolinks-track' => true }] + def stylesheet_link_tag + super('application', media: 'all', 'data-turbolinks-track' => true ) end - def javascript_args - ['application', { 'data-turbolinks-track' => true }] + def javascript_include_tag + super('application', 'data-turbolinks-track' => true ) end end end @@ -30,7 +30,7 @@ %html %head %title= @title - = stylesheet_link_tag(*stylesheet_args) - = javascript_include_tag(*javascript_args) + = stylesheet_link_tag + = javascript_include_tag = csrf_meta_tags %body= yield
Use super instead of splat
diff --git a/lib/properties/generators.rb b/lib/properties/generators.rb index abc1234..def5678 100644 --- a/lib/properties/generators.rb +++ b/lib/properties/generators.rb @@ -1,3 +1,4 @@ require "properties/generators/character" +require "properties/generators/float" require "properties/generators/integer" require "properties/generators/string"
Implement a Float generator (squash into previous)
diff --git a/cmc.rb b/cmc.rb index abc1234..def5678 100644 --- a/cmc.rb +++ b/cmc.rb @@ -3,7 +3,7 @@ class Cmc < Formula homepage "https://github.com/ClockworkNet/cmc" url "https://github.com/ClockworkNet/cmc/archive/1.0.1.tar.gz" - sha1 "ba6502a6b034ab7af44e7a7152f78f9ba65fa14a" + sha256 "bc9a35770c365ef254e39ead061aab2dc29ada04d053387b7ee0a0e955853910" def install bin.install "cmc"
Replace deprecated sha1 with sha256
diff --git a/ruby/spec/bson/nil_class_spec.rb b/ruby/spec/bson/nil_class_spec.rb index abc1234..def5678 100644 --- a/ruby/spec/bson/nil_class_spec.rb +++ b/ruby/spec/bson/nil_class_spec.rb @@ -2,11 +2,15 @@ require "spec_helper" describe NilClass do - let(:type) { 10.chr } - let(:obj) { nil } - let(:bson) { BSON::NO_VALUE } - it_behaves_like "a bson element" - it_behaves_like "a serializable bson element" - it_behaves_like "a deserializable bson element" + describe "#to_bson/#from_bson" do + + let(:type) { 10.chr } + let(:obj) { nil } + let(:bson) { BSON::NO_VALUE } + + it_behaves_like "a bson element" + it_behaves_like "a serializable bson element" + it_behaves_like "a deserializable bson element" + end end
Reformat nil spec for consistency
diff --git a/spec/happy_spec.rb b/spec/happy_spec.rb index abc1234..def5678 100644 --- a/spec/happy_spec.rb +++ b/spec/happy_spec.rb @@ -0,0 +1,19 @@+require 'spec_helper' + +describe Happy do + describe '#env' do + it "is a StringInquirer instance describing the RACK environment" do + Happy.env.should be_kind_of(ActiveSupport::StringInquirer) + end + + it "provides #development?, #production? etc." do + ENV.should_receive(:[]).twice.with('RACK_ENV').and_return('development') + Happy.env.should be_development + Happy.env.should_not be_production + + ENV.should_receive(:[]).twice.with('RACK_ENV').and_return('production') + Happy.env.should be_production + Happy.env.should_not be_development + end + end +end
Add some specs for the Happy module.
diff --git a/spec/store_spec.rb b/spec/store_spec.rb index abc1234..def5678 100644 --- a/spec/store_spec.rb +++ b/spec/store_spec.rb @@ -25,6 +25,23 @@ end end + describe 'default config' do + context 'with RACK_ENV not explicitly configured in database.yml' do + before do + @stashed_rack_env = ENV['RACK_ENV'] + ENV['RACK_ENV'] = 'production' + end + + after do + ENV['RACK_ENV'] = @stashed_rack_env + end + + it "says prefix is test_" do + store.config['http_port'].should == 8098 + end + end + end + describe '#config' do context 'with RACK_ENV=test' do before do
Add test to demonstrate default configuration not being read.
diff --git a/spec/features/event_join_spec.rb b/spec/features/event_join_spec.rb index abc1234..def5678 100644 --- a/spec/features/event_join_spec.rb +++ b/spec/features/event_join_spec.rb @@ -1,15 +1,24 @@ require 'rails_helper' RSpec.feature 'User joins an event', js: true do - before { create(:event) } + before { @event = create(:event) } scenario "User visits event page when not logged in" do - puts Event.all.count - visit event_path(Event.first) + visit event_path(@event) expect(page).not_to have_button("Join") expect(page).not_to have_button("Watch") expect(page).not_to have_button("Back Out") expect(page).not_to have_content("Number attending from your school") expect(page).to have_button("Log in") end + + scenario "User visits event page when logged in" do + log_in + visit event_path(@event) + expect(page).to have_button("Join") + expect(page).to have_button("Watch") + expect(page).not_to have_button("Back Out") + expect(page).to have_content("Number attending from your school") + expect(page).not_to have_button("Log in") + end end
Add spec for visiting event page when logged in
diff --git a/spec/models/given_course_spec.rb b/spec/models/given_course_spec.rb index abc1234..def5678 100644 --- a/spec/models/given_course_spec.rb +++ b/spec/models/given_course_spec.rb @@ -6,12 +6,12 @@ end it "requires a when" do - Factory.build(:given_course, :when => nil).should_not be_valid + Factory.build(:given_course, when: nil).should_not be_valid Factory.build(:given_course).should be_valid end it "requires an examiner" do - Factory.build(:given_course, examiner: nil).should_not be_valid + Factory.build(:given_course, examiners: []).should_not be_valid Factory.build(:given_course).should be_valid end end @@ -28,7 +28,7 @@ end it "should have a examiner" do - given_course.examiner.should_not be_nil + given_course.should have_at_least(1).examiners end it "should have a list of assistents" do
Fix GivenCourse spec. GivenCourse does no longer exists
diff --git a/spec/status_change_event_spec.rb b/spec/status_change_event_spec.rb index abc1234..def5678 100644 --- a/spec/status_change_event_spec.rb +++ b/spec/status_change_event_spec.rb @@ -9,13 +9,13 @@ @type = 'pass_now_fail' @file = 'file' @inner_event = PassOrFailEvent.new(*(1..7)) - @event = StatusChangeEvent.new(@test, @lines, @inner_event) + @event = StatusChangeEvent.new(@test, @file, @inner_event) end subject { @event } - its(:type) { should == @test } - its(:file) { should == @file } + its(:type) { should == @test } + its(:file) { should == @file } its(:event) { should == @inner_event } end end
Fix status change event spec using wrong variable
diff --git a/spec/support/database_cleaner.rb b/spec/support/database_cleaner.rb index abc1234..def5678 100644 --- a/spec/support/database_cleaner.rb +++ b/spec/support/database_cleaner.rb @@ -8,13 +8,11 @@ end config.before do - is_rack = Capybara.current_driver == :rack_test - - DatabaseCleaner.strategy = is_rack ? :transaction : :truncation + DatabaseCleaner.strategy = Capybara.current_driver == :rack_test ? :transaction : :truncation DatabaseCleaner.start end - config.after do + config.append_after do DatabaseCleaner.clean end end
Adjust when the database cleaner runs to prevent deadlocks.
diff --git a/scripts/update-apidoc.rb b/scripts/update-apidoc.rb index abc1234..def5678 100644 --- a/scripts/update-apidoc.rb +++ b/scripts/update-apidoc.rb @@ -14,7 +14,7 @@ def extract_version(path) IO.readlines(path).each do |l| #if md = l.strip.match(/VERSION\s*=\s*[\'\"]?([^\'\"]+)/i) - if md = l.strip.match(/apidoc.+http\:\/\/www.apidoc.me\/flow\/api\/([\d\.]+)/i) + if md = l.strip.match(/apidoc.+http\:\/\/.+\/flow\/api\/([\d\.]+)/i) return md[1] end end
Use broader regexp for extracting version
diff --git a/lib/comp_player.rb b/lib/comp_player.rb index abc1234..def5678 100644 --- a/lib/comp_player.rb +++ b/lib/comp_player.rb @@ -1,3 +1,5 @@+require 'pry' + class CompPlayer def minimax(board, rules, increment = 10) @@ -12,6 +14,8 @@ board.valid_slots.send(board.whose_turn(:max_by, :min_by)){|index| minimax(board.move(index), rules)} end - + def comp_move(board, rules) + board.move(optimal_move(board, rules)) + end end
Add comp_move method to class
diff --git a/lib/desktop/osx.rb b/lib/desktop/osx.rb index abc1234..def5678 100644 --- a/lib/desktop/osx.rb +++ b/lib/desktop/osx.rb @@ -2,6 +2,7 @@ module Desktop class OSX + attr_reader :desktop_image_path class DesktopImagePermissionsError < StandardError; end def self.desktop_image=(image) @@ -10,6 +11,10 @@ def self.update_desktop_image_permissions self.new.update_desktop_image_permissions + end + + def initialize(desktop_image_path = nil) + @desktop_image_path = desktop_image_path || default_desktop_image_path end def desktop_image=(image) @@ -44,7 +49,7 @@ system 'killall Dock' end - def desktop_image_path + def default_desktop_image_path '/System/Library/CoreServices/DefaultDesktop.jpg' end
Allow OSX default desktop image to be customized
diff --git a/week-4/define-method/defining_variable_spec.rb b/week-4/define-method/defining_variable_spec.rb index abc1234..def5678 100644 --- a/week-4/define-method/defining_variable_spec.rb +++ b/week-4/define-method/defining_variable_spec.rb @@ -0,0 +1,10 @@+require_relative "my_solution" + +describe 'do_something' do + it 'is defined as a method' do + expect(defined?(do_something)).to eq 'method' + end + it 'should accept exactly three parameters passed to the method' do + expect(method(:do_something).arity).to eq 3 + end +end
Add rspec file for challenge 4.3 release 2
diff --git a/schema.gemspec b/schema.gemspec index abc1234..def5678 100644 --- a/schema.gemspec +++ b/schema.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |s| s.name = 'evt-schema' s.summary = "Primitives for schema and data structure" - s.version = '1.1.0.1' + s.version = '1.2.0.0' s.description = ' ' s.authors = ['The Eventide Project']
Package version is increased from 1.1.0.1 to 1.2.0.0
diff --git a/schlep.gemspec b/schlep.gemspec index abc1234..def5678 100644 --- a/schlep.gemspec +++ b/schlep.gemspec @@ -20,6 +20,11 @@ s.add_runtime_dependency "redis" + if RUBY_VERSION =~ /1.8/ + s.add_runtime_dependency "json" + s.add_runtime_dependency "system_timer" + end + s.add_development_dependency "guard-test" s.add_development_dependency "shoulda" end
Add redis and json dependencies for 1.8
diff --git a/peat.gemspec b/peat.gemspec index abc1234..def5678 100644 --- a/peat.gemspec +++ b/peat.gemspec @@ -18,6 +18,10 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] + spec.add_dependency 'faraday' + spec.add_dependency 'activesupport' + + spec.add_development_dependency 'rspec' spec.add_development_dependency "bundler", "~> 1.6" spec.add_development_dependency "rake" end
Add faraday and activesupport as dependencies
diff --git a/rom-yaml.gemspec b/rom-yaml.gemspec index abc1234..def5678 100644 --- a/rom-yaml.gemspec +++ b/rom-yaml.gemspec @@ -18,7 +18,7 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ['lib'] - spec.add_runtime_dependency "rom", "~> 1.0.0" + spec.add_runtime_dependency "rom", "~> 2.0" spec.add_development_dependency 'bundler' spec.add_development_dependency 'rake'
Update ROM dependency to 2.0
diff --git a/rom-yaml.gemspec b/rom-yaml.gemspec index abc1234..def5678 100644 --- a/rom-yaml.gemspec +++ b/rom-yaml.gemspec @@ -18,7 +18,7 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ['lib'] - spec.add_runtime_dependency 'rom', '~> 0.8', '>= 0.8.0' + spec.add_runtime_dependency 'rom', '~> 0.9', '>= 0.9.0' spec.add_development_dependency 'bundler' spec.add_development_dependency 'rake'
Update rom dep in gemspec
diff --git a/spec/component/ancestors_spec.rb b/spec/component/ancestors_spec.rb index abc1234..def5678 100644 --- a/spec/component/ancestors_spec.rb +++ b/spec/component/ancestors_spec.rb @@ -0,0 +1,40 @@+# GitCompound +# +module GitCompound + describe Component do + before do + git_build_test_environment! + component_dir = @base_component_dir + @component = Component.new(:base_component) do + branch 'master' + source component_dir + destination 'some destination' + end + + end + + describe 'base component ancestors' do + it 'should be empty array' do + expect(@component.ancestors).to be [] + end + end + + describe 'leaf component ancestors' do + before do + required_component = @component.manifest.components[:required_component_1] + leaf_component = required_component.manifest.components[:leaf_component_1] + @ancestors = leaf_component.ancestors + end + + it 'should be array of component instances' do + expect do + @ancestors.all? { |ancestor| ancessor.instance_of?(Component) } + end.to be true + end + + it 'should have expected size' do + expect(@ancestors.size).to be 2 + end + end + end +end
Add red spec for component ancestors
diff --git a/spec/features/clubs/view_spec.rb b/spec/features/clubs/view_spec.rb index abc1234..def5678 100644 --- a/spec/features/clubs/view_spec.rb +++ b/spec/features/clubs/view_spec.rb @@ -1,11 +1,11 @@ require 'spec_helper.rb' feature "Viewing a Club", js: true do - let(:club1) {FactoryGirl::create(:club)} + let(:club1) {FactoryGirl::create(:club_with_players, players_count: 5)} let(:club2) {FactoryGirl::create(:club)} scenario "view one Club" do - club1 + players = club1.players club2 visit "#/clubs" click_on club1.name @@ -14,10 +14,35 @@ expect(page).to have_content(club1.city) expect(page).to have_content(club1.description) + for player in players do + expect(page).to have_content(player.name) + expect(page).to have_content(player.surname) + end + click_on "index-club" expect(page).not_to have_content(club1.description) expect(page).not_to have_content(club2.description) + end + + scenario "go from club to one of it's players" do + players = club1.players + club2 + visit "#/clubs" + click_on club1.name + + for player in players do + expect(page).to have_content(player.name) + expect(page).to have_content(player.surname) + end + + pl1 = players[0] + click_on "#{pl1.name}-#{pl1.surname}-link" + + tokens = pl1.rank.split('_') + expect(page).to have_content(pl1.name) + expect(page).to have_content(pl1.surname) + expect(page).to have_content("#{tokens[1]} #{tokens[0].upcase}") end end
Add checking players presence in clubs view feature spec
diff --git a/lib/raml_models.rb b/lib/raml_models.rb index abc1234..def5678 100644 --- a/lib/raml_models.rb +++ b/lib/raml_models.rb @@ -1 +1,5 @@-Dir["File.dirname(__FILE__)/raml"].each {|file| require file} +require_relative "./raml_models/api" +require_relative "./raml_models/body" +require_relative "./raml_models/method" +require_relative "./raml_models/resource" +require_relative "./raml_models/response"
Fix requires because they aren't working
diff --git a/app/controllers/site_controller.rb b/app/controllers/site_controller.rb index abc1234..def5678 100644 --- a/app/controllers/site_controller.rb +++ b/app/controllers/site_controller.rb @@ -27,12 +27,13 @@ end def export - zipfile_name = Tempfile.new() + export_path = Rails.root.join('tmp') # for Heroku https://devcenter.heroku.com/articles/cedar-migration + zipfile_name = Tempfile.new('export-', export_path) Zip::File.open(zipfile_name.path, Zip::File::CREATE) do |zipfile| Word.all.find_in_batches do |batch| batch.each do |w| - temp_file = Tempfile.new() + temp_file = Tempfile.new('md-', export_path) temp_file.puts w.to_middleman temp_file.close zipfile.add("#{w.title}_#{w.id}.md", temp_file.path)
Change Tempfile path for Heroku
diff --git a/app/modules/kpi/estadistica_kpi.rb b/app/modules/kpi/estadistica_kpi.rb index abc1234..def5678 100644 --- a/app/modules/kpi/estadistica_kpi.rb +++ b/app/modules/kpi/estadistica_kpi.rb @@ -1,5 +1,3 @@-# coding: UTF-8 - require 'active_support/concern' module Kpi::EstadisticaKpi @@ -12,7 +10,7 @@ belongs_to :usuario, class_name: ::Kpi::Clases.usuario_extern - scope :ultima_semana, -> { having("MIN(created_at) >= ? AND MIN(created_at) < ?", 1.week.ago.to_date, Time.now.to_date) } + scope :ultima_semana, -> { having('MIN(created_at) BETWEEN ? AND ?', 1.week.ago, Time.current) } scope :primera_participacion_del_usuario, -> { select('usuario_id, MIN(created_at) AS fecha_primera_participacion').group(:usuario_id) } end end
Use SQL BETWEEN & remove unneeded .to_date
diff --git a/Casks/electron.rb b/Casks/electron.rb index abc1234..def5678 100644 --- a/Casks/electron.rb +++ b/Casks/electron.rb @@ -2,6 +2,7 @@ version '1.2.5' sha256 'd27f0e1f7712c01e49e3bbf40e741be39fc21790b4206edd1e141a6b75ead9e5' + # github.com/atom/electron was verified as official when first introduced to the cask url "https://github.com/atom/electron/releases/download/v#{version}/electron-v#{version}-darwin-x64.zip" appcast 'https://github.com/atom/electron/releases.atom', checkpoint: '8def9dee4c6e474c0dc2196f41f18c6e0a47b315b9546a64c24063362de3fd71'
Fix `url` stanza comment for Electron.
diff --git a/app/lib/deck.rb b/app/lib/deck.rb index abc1234..def5678 100644 --- a/app/lib/deck.rb +++ b/app/lib/deck.rb @@ -1,6 +1,6 @@ class Deck DEFAULT_SUITS = %w(spades clubs diamonds hearts) - DEFAULT_RANKS = %w(ace one two three four five six seven eight nine ten jack queen king) + DEFAULT_RANKS = %w(ace two three four five six seven eight nine ten jack queen king) def initialize(suits, ranks) @suits = suits
Remove 'one' from default ranks
diff --git a/Casks/owncloud.rb b/Casks/owncloud.rb index abc1234..def5678 100644 --- a/Casks/owncloud.rb +++ b/Casks/owncloud.rb @@ -4,7 +4,7 @@ url "https://download.owncloud.com/desktop/stable/ownCloud-#{version}.pkg" homepage 'http://owncloud.com' - license :unknown + license :gpl pkg "ownCloud-#{version}.pkg"
Change ownCloud license to GPL See: https://github.com/owncloud/mirall/blob/master/COPYING
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index abc1234..def5678 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -9,7 +9,7 @@ menu.item "York", "/by_province/York" end - Page.content_types.each do |type| + Page.content_types.reject { |t| t == "page" }.each do |type| menu.item type.pluralize, content_type_path(type), :class => "type" end
Remove page from the index list
diff --git a/lib/totem/shell.rb b/lib/totem/shell.rb index abc1234..def5678 100644 --- a/lib/totem/shell.rb +++ b/lib/totem/shell.rb @@ -16,7 +16,7 @@ env_path = 'config/environment.rb' if File.exists?(env_path) load(env_path) - else + elsif args[0] != 'new' puts "Unable to find #{env_path}. You must run this command from your project root directory." exit end
Fix for creating new projects.
diff --git a/app/presenters/confirmation_presenter.rb b/app/presenters/confirmation_presenter.rb index abc1234..def5678 100644 --- a/app/presenters/confirmation_presenter.rb +++ b/app/presenters/confirmation_presenter.rb @@ -41,10 +41,6 @@ end end - def payment_type - payment_failed? ? :payment_not_processed : :normal - end - def attachment_filenames @attachment_filenames ||= \ [claim_details_rtf, additional_claimants_csv].
Remove unused private method from confirmation presenter
diff --git a/app/services/follower_notifier.rb b/app/services/follower_notifier.rb index abc1234..def5678 100644 --- a/app/services/follower_notifier.rb +++ b/app/services/follower_notifier.rb @@ -34,7 +34,7 @@ #{times_text} Full results for #{effort_data[:full_name]} here: https://www.opensplittime.org/efforts/#{effort_data[:effort_slug]} -Full results for #{effort_data[:event_name]} here: https://www.opensplittime.org/events/#{effort_data[:event_slug]} +Full results for #{effort_data[:event_name]} here: https://www.opensplittime.org/events/#{effort_data[:event_slug]}/spread Thank you for using OpenSplitTime! MESSAGE
Change FollowerNotifier event link to spread page.