diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/brain_love.gemspec b/brain_love.gemspec index abc1234..def5678 100644 --- a/brain_love.gemspec +++ b/brain_love.gemspec @@ -16,5 +16,6 @@ gem.version = BrainLove::VERSION gem.add_development_dependency "rspec" + gem.add_development_dependency "rake" gem.add_runtime_dependency "parslet" end
Add rake as dev dependency
diff --git a/lib/bridges/tiny_mce/lib/tiny_mce_bridge.rb b/lib/bridges/tiny_mce/lib/tiny_mce_bridge.rb index abc1234..def5678 100644 --- a/lib/bridges/tiny_mce/lib/tiny_mce_bridge.rb +++ b/lib/bridges/tiny_mce/lib/tiny_mce_bridge.rb @@ -11,7 +11,7 @@ action_link_close.apply(this); }; |) if using_tiny_mce? - active_scaffold_includes_without_tiny_mce(frontend) + include_tiny_mce_if_needed + (tiny_mce_js || '') + active_scaffold_includes_without_tiny_mce(frontend) + (include_tiny_mce_if_needed || '') + (tiny_mce_js || '') end alias_method_chain :active_scaffold_includes, :tiny_mce end
Fix tiny_mce bridge for controllers which don't use tiny_mce
diff --git a/lib/g5_authenticatable_api/rails_helpers.rb b/lib/g5_authenticatable_api/rails_helpers.rb index abc1234..def5678 100644 --- a/lib/g5_authenticatable_api/rails_helpers.rb +++ b/lib/g5_authenticatable_api/rails_helpers.rb @@ -1,7 +1,14 @@ module G5AuthenticatableApi module RailsHelpers def authenticate_api_user! - raise 'implement authenticate_api_user!' + unless warden.try(:authenticated?) + render status: :unauthorized, + text: {error: 'Unauthorized'}.to_json + end + end + + def warden + request.env['warden'] end end end
Check warden user in rails before_filter
diff --git a/lib/infinity_test/strategy/auto_discover.rb b/lib/infinity_test/strategy/auto_discover.rb index abc1234..def5678 100644 --- a/lib/infinity_test/strategy/auto_discover.rb +++ b/lib/infinity_test/strategy/auto_discover.rb @@ -26,8 +26,10 @@ strategy_to_run.strategy_name else message = <<-MESSAGE - The InfinityTest::Strategy::AutoDiscover doen't discover nothing to run. + + The InfinityTest::Strategy::AutoDiscover doesn't discover nothing to run. Do you pass more than one ruby version to run and do you have some strategy(Rvm, Rbenv) installed? + MESSAGE raise Exception, message end
Add a new line in the strategy exception message
diff --git a/integration-tests/spec/spec_helper.rb b/integration-tests/spec/spec_helper.rb index abc1234..def5678 100644 --- a/integration-tests/spec/spec_helper.rb +++ b/integration-tests/spec/spec_helper.rb @@ -10,6 +10,31 @@ config.before(:suite) do Java::IoWunderboss::WunderBoss.register_language('ruby', 'io.wunderboss.ruby.RubyApplication') WUNDERBOSS = Java::IoWunderboss::WunderBoss.new('web_host' => 'localhost', 'web_port' => '8080') + begin + Capybara.visit "/" + rescue Exception => ex + if ex.message.include?('phantomjs') + $stderr.puts <<-EOF + + + +======================================================================== + +It looks like phantomjs was not found. Ensure it is installed and +available in your $PATH. See http://phantomjs.org/download.html for +details. + +======================================================================== + + + +EOF + $stderr.puts ex.message + exit 1 + else + raise ex + end + end end config.after(:suite) do
Check for phantomjs before running the entire test suite
diff --git a/config/schedule.rb b/config/schedule.rb index abc1234..def5678 100644 --- a/config/schedule.rb +++ b/config/schedule.rb @@ -1,7 +1,5 @@ set :bundle_command, "/home/deploy/.rbenv/versions/2.3.1/bin/bundle exec" set :output, { error: '/var/www/shared/cron.front.error.log', standard: '/var/www/shared/cron.front.log' } -env :MAILCHIMP_API_KEY, ENV['MAILCHIMP_API_KEY'] - every 1.day, :at => '1:30 am' do rake "iom:update_sites" rake "iom:update_tag_project_counts"
Revert "add env var to whenever config" This reverts commit 21d61b61ced9755338694fde0860238ddcbf171a.
diff --git a/test/features/can_login_test.rb b/test/features/can_login_test.rb index abc1234..def5678 100644 --- a/test/features/can_login_test.rb +++ b/test/features/can_login_test.rb @@ -24,6 +24,7 @@ choose 'project_report_process_status_unmet' # TODO: Need to make this test work. # Disabling for now so it won't break the build. - # assert page.find('#report_process_enough')['src'].include? 'result_symbol_x' + # assert page.find('#report_process_enough')['src'].include?( + # 'result_symbol_x') end end
Fix overly long line in test Signed-off-by: David A. Wheeler <9ae72d22d8b894b865a7a496af4fab6320e6abb2@dwheeler.com>
diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index abc1234..def5678 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -4,7 +4,7 @@ def gravatar_for(user, options = { size: 50 }) gravatar_id = Digest::MD5::hexdigest(user.email.downcase) size = options[:size] - gravatar_url = "http://gravatar.com/avatar/#{gravatar_id}.png?s=#{size}" + gravatar_url = "https://secure.gravatar.com/avatar/#{gravatar_id}.png?s=#{size}" image_tag(gravatar_url, alt: user.name, class: "gravatar") end end
Change to loading gravatars via https to avoid browser security warnings
diff --git a/lib/active_record/composed_of_enum.rb b/lib/active_record/composed_of_enum.rb index abc1234..def5678 100644 --- a/lib/active_record/composed_of_enum.rb +++ b/lib/active_record/composed_of_enum.rb @@ -16,11 +16,7 @@ base = options[:base] enum_column = :"#{part}_cd" - base.class_attribute( - enum_column, - :instance_reader => false, - :instance_reader => false - ) + base.class_attribute(enum_column, :instance_accessor => false) enumeration = options[:enumeration]
Remove duplicate :instance_reader, change to :instance_accessor.
diff --git a/lib/http_eventstore/api/connection.rb b/lib/http_eventstore/api/connection.rb index abc1234..def5678 100644 --- a/lib/http_eventstore/api/connection.rb +++ b/lib/http_eventstore/api/connection.rb @@ -15,6 +15,8 @@ content_type: APP_JSON } ) do |builder| + builder.request :retry, max: 4, interval: 0.05, + interval_randomness: 0.5, backoff_factor: 2 builder.adapter Faraday.default_adapter builder.response :json, content_type: APP_JSON builder.response :mashify
Use the Faraday retry plugin to ameliorate possible ES performance problems
diff --git a/StartAppsKitExtensions.podspec b/StartAppsKitExtensions.podspec index abc1234..def5678 100644 --- a/StartAppsKitExtensions.podspec +++ b/StartAppsKitExtensions.podspec @@ -26,7 +26,7 @@ s.osx.deployment_target = '10.10' s.source_files = 'Sources' -s.frameworks = 'Foundation', 'UIKit' +s.frameworks = 'Foundation' #s.dependency 'SwifterSwift', '~> 4.0'
Fix de requirement de UIKit
diff --git a/akismet.gemspec b/akismet.gemspec index abc1234..def5678 100644 --- a/akismet.gemspec +++ b/akismet.gemspec @@ -10,7 +10,7 @@ s.platform = Gem::Platform::RUBY s.authors = [ 'Jonah Burke' ] s.email = [ 'jonah@bigthink.com' ] - s.homepage = '' + s.homepage = 'http://github.com/bigthink/akismet' s.summary = 'A Ruby client for the Akismet API' s.description = s.summary
Add home page to gemspec
diff --git a/vendor/plugins/refinery_settings/app/controllers/admin/refinery_settings_controller.rb b/vendor/plugins/refinery_settings/app/controllers/admin/refinery_settings_controller.rb index abc1234..def5678 100644 --- a/vendor/plugins/refinery_settings/app/controllers/admin/refinery_settings_controller.rb +++ b/vendor/plugins/refinery_settings/app/controllers/admin/refinery_settings_controller.rb @@ -14,13 +14,13 @@ def find_all_refinery_settings @refinery_settings = RefinerySetting.find :all, :order => "name ASC", - :conditions => current_user.has_role?(:superuser) ? nil : ["restricted IS NOT ?", true] + :conditions => current_user.has_role?(:superuser) ? nil : ["restricted <> ?", true] end def paginate_all_refinery_settings @refinery_settings = RefinerySetting.paginate :page => params[:page], :order => "name ASC", - :conditions => current_user.has_role?(:superuser) ? nil : ["restricted IS NOT ?", true] + :conditions => current_user.has_role?(:superuser) ? nil : ["restricted <> ?", true] end private
Fix for Mysql Specific code
diff --git a/nivo-rails.gemspec b/nivo-rails.gemspec index abc1234..def5678 100644 --- a/nivo-rails.gemspec +++ b/nivo-rails.gemspec @@ -8,8 +8,8 @@ gem.version = Nivo::Rails::VERSION gem.authors = ["Robin Dupret"] gem.email = ["robin.dupret@gmail.com"] - gem.description = %q{TODO: Write a gem description} - gem.summary = %q{TODO: Write a gem summary} + gem.description = %q{Nivo slider with Ruby on Rails} + gem.summary = %q{This gem allows you to use Nivo slider with Ruby on Rails} gem.homepage = "" gem.files = `git ls-files`.split($/)
Add a summary and description for the gem
diff --git a/app.rb b/app.rb index abc1234..def5678 100644 --- a/app.rb +++ b/app.rb @@ -21,7 +21,7 @@ end def message_for_new_pr(pr) - "PR: #{pr['head']['repo']['name']}/#{pr['number']} - <a href='#{pr['html_url']}' >#{pr['title']}</a> (#{pr['user']['login']})" + "#{pr['head']['repo']['name']}/#{pr['number']} - <a href='#{pr['html_url']}' >#{pr['title']}</a> (#{pr['user']['login']})" end def message_for_pr_merge(pr) @@ -33,7 +33,7 @@ end def send_to_operations_talk(msg) - hipchat_client['Operations talk'].send('Github', msg, color: "green") + hipchat_client['Operations talk'].send('Github', msg) end def hipchat_client
Use yellow for merged notifications
diff --git a/lib/pith/plugins/publication/input.rb b/lib/pith/plugins/publication/input.rb index abc1234..def5678 100644 --- a/lib/pith/plugins/publication/input.rb +++ b/lib/pith/plugins/publication/input.rb @@ -1,39 +1,50 @@ require "pith/input" require "time" + +module Pith + module Plugins + module Publication + + module TemplateMethods + + def published? + !published_at.nil? + end + + def published_at + parse_date(meta["published"]) + end + + def updated_at + parse_date(meta["updated"]) || published_at + end + + private + + def parse_date(date_string) + Time.parse(date_string) if date_string + end + + end + + end + end +end module Pith module Input class Abstract - + def published? false end - + end class Template - - def published? - !published_at.nil? - end - - def published_at - parse_date(meta["published"]) - end - - def updated_at - parse_date(meta["updated"]) || published_at - end - - private - - def parse_date(date_string) - Time.parse(date_string) if date_string - end - + include Pith::Plugins::Publication::TemplateMethods end end end -
Refactor again, to ease testing.
diff --git a/jsoneur/service.rb b/jsoneur/service.rb index abc1234..def5678 100644 --- a/jsoneur/service.rb +++ b/jsoneur/service.rb @@ -27,10 +27,12 @@ end def set_faraday_defaults(faraday) - faraday.adapter Faraday.default_adapter faraday.request :json + faraday.response :mashify faraday.response :json, :content_type => /\bjson$/ + + faraday.adapter Faraday.default_adapter end def get(params = {})
Change order of faraday settings
diff --git a/spec/08xhr_spec.rb b/spec/08xhr_spec.rb index abc1234..def5678 100644 --- a/spec/08xhr_spec.rb +++ b/spec/08xhr_spec.rb @@ -0,0 +1,99 @@+#!/usr/bin/env rspec + +require 'v8' + +require 'noms/command/xmlhttprequest' + +describe NOMS::Command::XMLHttpRequest do + + before(:all) do + # I'm going to go with this class variable for now + NOMS::Command::XMLHttpRequest.origin = 'http://localhost:8787/' + end + + context 'from ruby' do + + before(:each) do + @xhr = NOMS::Command::XMLHttpRequest.new + end + + describe '#readyState' do + it 'should be 0' do + expect(@xhr.readyState).to eq 0 + end + end + + describe 'statuses' do + it 'should be equal to the correct number' do + expect(@xhr.OPENED).to eq 1 + expect(@xhr.HEADERS_RECEIVED).to eq 2 + expect(@xhr.LOADING).to eq 3 + expect(@xhr.DONE).to eq 4 + end + end + + describe '#open' do + # open, send, check readyState and responseText + + it 'should retrieve web content' do + @xhr.open('GET', 'http://localhost:8787/files/data.json', false) + @xhr.send() + expect(@xhr.responseText).to match /^\[/ + end + + it 'should raise an error on different-origin' do + expect { + @xhr.open('GET', 'http://localhost:8786/files/data.json', false) + }.to raise_error NOMS::Command::Error + end + + end + + describe '#setRequestHeader' do + @xhr.setRequestHeader('Accept', 'text/plain') + expect(@xhr.headers['Accept']).to eq 'text/plain' + end + + describe '#onreadystatechange' do + + end + + describe '#abort' do + + end + + end + + context 'from javascript' do + + before(:each) do + @v8 = V8::Context.new + @v8[:XMLHttpRequest] = NOMS::Command::XMLHttpRequest + @v8.eval 'var xhr = new XMLHttpRequest()' + end + + describe '#open' do + # open, send, check readyState and responseText + it 'should retrieve web content' do + @v8.eval 'xhr.open("GET", "http://localhost:8787/files/data.json", false)' + @v8.eval 'xhr.send()' + expect(@v8.eval 'xhr.readyState').to eq 4 + expect(@v8.eval 'xhr.responseText').to match(/^\[/) + end + end + + describe '#setRequestHeader' do + + end + + describe '#onreadystatechange' do + + end + + describe '#abort' do + + end + + end + +end
Add failing tests for spec
diff --git a/app/helpers/admin/document_collection_helper.rb b/app/helpers/admin/document_collection_helper.rb index abc1234..def5678 100644 --- a/app/helpers/admin/document_collection_helper.rb +++ b/app/helpers/admin/document_collection_helper.rb @@ -1,55 +1,12 @@ module Admin::DocumentCollectionHelper - class DocumentCollectionGroupSelector - class OrganisationPresenter - def initialize(organisation) - @organisation = organisation - end - - def name - @organisation.name - end - - def document_collection_groups - @organisation.document_collections.map do |collection| - collection.groups.map { |group| GroupPresenter.new(group) } - end.flatten + def document_collection_select_options(edition, user, selected_ids) + options = Rails.cache.fetch("document_collection_select_options", expires_in: 30.minutes) do + DocumentCollection.alphabetical.map do |collection| + collection.groups.map do |group| + ["#{collection.title} (#{group.heading})", group.id] + end end end - - class GroupPresenter - def initialize(group) - @group = group - end - - def group_id - @group.id - end - - def collection_and_group_name - "#{@group.document_collection.title} (#{@group.heading})" - end - end - - def organisations_for_select(user) - orgs = Organisation.scoped.with_translations.to_a - collection = orgs.reject { |org| org == user.organisation } - if user.organisation - users_org = orgs.detect { |org| org == user.organisation } - collection.unshift(users_org) - end - collection.map { |org| OrganisationPresenter.new(org) } - end - end - - def document_collection_select_options(edition, user, selected_ids) - collection = DocumentCollectionGroupSelector.new.organisations_for_select(user) - option_groups_from_collection_for_select( - collection, - :document_collection_groups, - :name, - :group_id, - :collection_and_group_name, - selected_ids - ) + options_for_select(options, selected_ids) end end
Fix document collection menu on speed tagging page Document collections are no longer organised by organisation, so it no longer makes sense to group them in that way.
diff --git a/app/views/api/v1/wallpapers/index.json.jbuilder b/app/views/api/v1/wallpapers/index.json.jbuilder index abc1234..def5678 100644 --- a/app/views/api/v1/wallpapers/index.json.jbuilder +++ b/app/views/api/v1/wallpapers/index.json.jbuilder @@ -1,4 +1,9 @@ json.partial! 'api/v1/shared/paging', collection: @wallpapers + +json.facets do + json.tags @wallpapers.facets['tag']['terms'] + json.categories @wallpapers.facets['category']['terms'] +end json.wallpapers @wallpapers do |wallpaper| json.(wallpaper, :id, :purity, :favourites_count)
Include facets in wallpaper index api
diff --git a/ruby/vampires.rb b/ruby/vampires.rb index abc1234..def5678 100644 --- a/ruby/vampires.rb +++ b/ruby/vampires.rb @@ -0,0 +1,14 @@+puts "what's your name?" +name = gets.chomp + +puts "How old are you?" +age = gets.chomp + +puts "What year were you born?" +birthyear = gets.chomp + +puts "Our company cafeteria serves garlic bread. Should we order some for you?" +garlic = gets.chomp + +puts "Would you like to enroll in the company’s health insurance?" +insurance = gets.chomp
Set up initial questions for vampire detection survey
diff --git a/ruby_hue.gemspec b/ruby_hue.gemspec index abc1234..def5678 100644 --- a/ruby_hue.gemspec +++ b/ruby_hue.gemspec @@ -20,5 +20,5 @@ gem.add_development_dependency "rspec", "~> 2.13.0" gem.add_development_dependency "awesome_print", "~> 1.1.0" - gem.add_runtime_dependency "httparty" + gem.add_runtime_dependency "httparty", "~> 0.10.2" end
Add specific version for httparty to gemspec.
diff --git a/spec/dummy/app/models/user.rb b/spec/dummy/app/models/user.rb index abc1234..def5678 100644 --- a/spec/dummy/app/models/user.rb +++ b/spec/dummy/app/models/user.rb @@ -8,6 +8,9 @@ attr_accessible :email, :password, :password_confirmation, :remember_me # attr_accessible :title, :body - # TODO: temporary, so that mweb_events/events/show won't break - attr_accessor :name + # TODO: temporary accessors, so that the gem won't break when accessing them + attr_accessor :name, :time_zone + def admin? + true + end end
Add missing attributes on User
diff --git a/PIAPIEnvironmentManager.podspec b/PIAPIEnvironmentManager.podspec index abc1234..def5678 100644 --- a/PIAPIEnvironmentManager.podspec +++ b/PIAPIEnvironmentManager.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "PIAPIEnvironmentManager" - s.version = "0.4.0" + s.version = “0.4.1” s.summary = "PiOS PIAPIEnvironmentManager pod to help iOS Engineers manage API Environments." s.description = <<-DESC PiOS PIAPIEnvironmentManager pod to help iOS Engineers manage API Environments in a simple way,
Update podspec version to 0.4.1
diff --git a/Casks/papers.rb b/Casks/papers.rb index abc1234..def5678 100644 --- a/Casks/papers.rb +++ b/Casks/papers.rb @@ -1,7 +1,7 @@ class Papers < Cask - url 'http://www.papersapp.com/papers/download/mac' + url 'http://www.papersapp.com/papers2/download' homepage 'http://www.papersapp.com/papers/' - version 'latest' + version '2' no_checksum link 'Papers2.app' end
Fix link for Papers 2
diff --git a/Casks/gmail-notifr.rb b/Casks/gmail-notifr.rb index abc1234..def5678 100644 --- a/Casks/gmail-notifr.rb +++ b/Casks/gmail-notifr.rb @@ -1,6 +1,7 @@ class GmailNotifr < Cask - url 'https://github.com/downloads/ashchan/gmail-notifr/GmailNotifr-0.6.4.zip' + url 'https://s3.amazonaws.com/assets.ashchan.com/gmailnotifr/GmailNotifr-0.8.0.zip' homepage 'http://ashchan.com/projects/gmail-notifr' - version '0.6.4' - sha1 '330a87bb9e0ed6209e6ad3f1d09e79b4c92674ef' + version '0.8.0' + sha1 '69bce66f01a0a8df2e7d44f49630d7c612bb2233' + link 'Gmail Notifr.app' end
Update GmailNotifr to v. 0.8.0 and add link
diff --git a/Casks/webstorm-eap.rb b/Casks/webstorm-eap.rb index abc1234..def5678 100644 --- a/Casks/webstorm-eap.rb +++ b/Casks/webstorm-eap.rb @@ -1,6 +1,6 @@ cask :v1 => 'webstorm-eap' do - version '141.224' - sha256 '262841715a4db53a4c2f1db268c16905875e933ab8d45e730894f2a888b80a88' + version '141.1108' + sha256 'ba572e9784a50c01bc750206781927812fc32c380a4fc697175325477228e971' url "http://download.jetbrains.com/webstorm/WebStorm-EAP-#{version}.dmg" homepage 'https://confluence.jetbrains.com/display/WI/WebStorm+10+EAP'
Upgrade WebStorm EAP to 141.1108 Signed-off-by: Koichi Shiraishi <41a18128582fec5418c0a92661f7d4b13d21d912@gmail.com>
diff --git a/pokeratlas_page.rb b/pokeratlas_page.rb index abc1234..def5678 100644 --- a/pokeratlas_page.rb +++ b/pokeratlas_page.rb @@ -1,11 +1,11 @@ # The base page object for pages on PokerAtlas. -#require_relative 'subscribe_modal' +require_relative 'subscribe_modal' require 'addressable' class PokerAtlasPage - #include SubscribeModal + include SubscribeModal @@url = "http://www.pokeratlas.com/" @@ -22,6 +22,6 @@ def get # Gets the page that this page object models page_to_get = Addressable::URI.parse(@@url).join(@baseurl).to_s @driver.get page_to_get - #self.close_subscribe_modal_if_visible + self.close_subscribe_modal_if_visible end end
Enable support for automatically closing subscribe dialog
diff --git a/db/migrate/20140811213904_modify_spree_store_credit_payment_method_to_be_back_end_only.rb b/db/migrate/20140811213904_modify_spree_store_credit_payment_method_to_be_back_end_only.rb index abc1234..def5678 100644 --- a/db/migrate/20140811213904_modify_spree_store_credit_payment_method_to_be_back_end_only.rb +++ b/db/migrate/20140811213904_modify_spree_store_credit_payment_method_to_be_back_end_only.rb @@ -0,0 +1,15 @@+class ModifySpreeStoreCreditPaymentMethodToBeBackEndOnly < ActiveRecord::Migration + def up + payment_method = Spree::PaymentMethod.find_by(type: 'Spree::PaymentMethod::StoreCredit') + return unless payment_method + payment_method.display_on = 'back_end' + payment_method.save! + end + + def down + payment_method = Spree::PaymentMethod.find_by(type: 'Spree::PaymentMethod::StoreCredit') + return unless payment_method + payment_method.display_on = nil + payment_method.save! + end +end
Make store credit payment method back end only. If the store credit payment method is visible on the front end it will cause an error due to missing templates.
diff --git a/Casks/opera-beta.rb b/Casks/opera-beta.rb index abc1234..def5678 100644 --- a/Casks/opera-beta.rb +++ b/Casks/opera-beta.rb @@ -1,6 +1,6 @@ cask :v1 => 'opera-beta' do - version '29.0.1795.35' - sha256 '0b6ee1cad2b335bd95c1c77c24e13fabad80419f430a91e10ea62a4574064cac' + version '29.0.1795.41' + sha256 'e7f013637993189ee96409fd647bbc00fa94bde544e2604c36cde230ad717063' url "http://get.geo.opera.com/pub/opera-beta/#{version}/mac/Opera_beta_#{version}_Setup.dmg" homepage 'http://www.opera.com/computer/beta'
Upgrade Opera Beta.app to v29.0.1795.41
diff --git a/lib/data_tables.rb b/lib/data_tables.rb index abc1234..def5678 100644 --- a/lib/data_tables.rb +++ b/lib/data_tables.rb @@ -1,6 +1,6 @@ module DataTables def self.root - @root ||= Pathname.new(File.dirname(File.expand_path(File.dirname(__FILE__), '/../'))) + @root ||= Pathname.new(File.expand_path('../', File.dirname(__FILE__))) end end
Clean up root path expansion utility
diff --git a/bisleri.gemspec b/bisleri.gemspec index abc1234..def5678 100644 --- a/bisleri.gemspec +++ b/bisleri.gemspec @@ -6,7 +6,7 @@ Gem::Specification.new do |spec| spec.name = "bisleri" spec.version = Bisleri::VERSION - spec.authors = ["Emil Soman, Kashyap Kondamudi"] + spec.authors = ["Emil Soman", "Kashyap Kondamudi"] spec.email = ["emil.soman@gmail.com"] spec.description = %q{Bisleri is a simple HTTP 1.1 server which uses EventMachine} spec.summary = %q{A simple HTTP 1.1 server using EventMachine}
Fix author list in gemspec
diff --git a/lib/fog/dnsimple/models/dns/record.rb b/lib/fog/dnsimple/models/dns/record.rb index abc1234..def5678 100644 --- a/lib/fog/dnsimple/models/dns/record.rb +++ b/lib/fog/dnsimple/models/dns/record.rb @@ -25,7 +25,7 @@ end def destroy - service.delete_record(zone.domain, identity) + service.delete_record(zone.id, identity) true end
Use the id for deletion also
diff --git a/Casks/burp-suite.rb b/Casks/burp-suite.rb index abc1234..def5678 100644 --- a/Casks/burp-suite.rb +++ b/Casks/burp-suite.rb @@ -6,5 +6,5 @@ name 'Burp Suite' homepage 'https://portswigger.net/burp/' - + installer manual: 'Burp Suite Free Edition Installer.app' end
Add artifact stanza for the manual installer
diff --git a/Casks/firefox-ux.rb b/Casks/firefox-ux.rb index abc1234..def5678 100644 --- a/Casks/firefox-ux.rb +++ b/Casks/firefox-ux.rb @@ -0,0 +1,7 @@+class FirefoxUx < Cask + url 'https://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-ux/firefox-29.0a1.en-US.mac.dmg' + homepage 'http://people.mozilla.org/~jwein/ux-nightly/' + version '29.0a1' + sha1 'be5c293d961d40d2c3aa5f6fcd3d973c68667985' + link 'FirefoxUX.app' +end
Add cask for Firefox UX channel build Not the same as Nightly as far as I understand.
diff --git a/Casks/moneydance.rb b/Casks/moneydance.rb index abc1234..def5678 100644 --- a/Casks/moneydance.rb +++ b/Casks/moneydance.rb @@ -0,0 +1,11 @@+cask :v1 => 'moneydance' do + version '2015 build 1145' + sha256 'e740d4214b43c16dc30c48da854576a2b4e6359ce4ea8bb40ae726539ebcd68e' + + url 'http://infinitekind.com/stabledl/2015/Moneydance.zip' + name 'Moneydance' + homepage 'http://infinitekind.com/moneydance' + license :commercial + + app 'Moneydance.app' +end
Add Moneydance.app v2015 build 1145
diff --git a/Casks/tower-beta.rb b/Casks/tower-beta.rb index abc1234..def5678 100644 --- a/Casks/tower-beta.rb +++ b/Casks/tower-beta.rb @@ -1,9 +1,9 @@ cask :v1 => 'tower-beta' do - version '2.2.2-281' - sha256 '83fdbb887c394ed0f76bf91c66972d28bc6d36f144c21dfd582ccb09d5e19864' + version '2.2.3-285' + sha256 'c9d79a6a8bfc298f38a2d7dbe724d71468f86c1de09fabd1d9da754fd8a40f74' # amazonaws.com is the official download host per the vendor homepage - url "https://fournova-app-updates.s3.amazonaws.com/apps/tower2-mac/281-3f2b7672/Tower-2-#{version}.zip" + url "https://fournova-app-updates.s3.amazonaws.com/apps/tower2-mac/285-e057eb4f/Tower-2-#{version}.zip" appcast 'https://updates.fournova.com/updates/tower2-mac/beta' name 'Tower' homepage 'http://www.git-tower.com/'
Update Tower beta to version 2.2.3 This commit updates the version, sha256 and url stanzas.
diff --git a/lib/resque/automatic_geocoder_jobs.rb b/lib/resque/automatic_geocoder_jobs.rb index abc1234..def5678 100644 --- a/lib/resque/automatic_geocoder_jobs.rb +++ b/lib/resque/automatic_geocoder_jobs.rb @@ -0,0 +1,10 @@+# encoding: utf-8 +module Resque + class AutomaticGeocoderJobs + @queue = :automatic_geocodings + + def self.perform(options={}) + AutomaticGeocoding[options.symbolize_keys[:job_id]].run + end + end +end
Add automatic geocoder resque job
diff --git a/spec/models/invoice_spec.rb b/spec/models/invoice_spec.rb index abc1234..def5678 100644 --- a/spec/models/invoice_spec.rb +++ b/spec/models/invoice_spec.rb @@ -16,8 +16,6 @@ end context "when amount is nil" do - before(:all) { subject.amount = nil } - its(:to_s) { should == "" } end
Remove the setter of amount cause is now obsolete.
diff --git a/lib/caliph/testing/record-commands.rb b/lib/caliph/testing/record-commands.rb index abc1234..def5678 100644 --- a/lib/caliph/testing/record-commands.rb +++ b/lib/caliph/testing/record-commands.rb @@ -15,7 +15,7 @@ attr_accessor :command_recording_path def command_recording_path - @command_recording_path ||= ENV['MATTOCK_CMDREC'] + @command_recording_path ||= ENV['CALIPH_CMDREC'] end def emit_recording @@ -23,7 +23,7 @@ if command_recording_path io = File.open(command_recording_path, "w") else - io.puts "Set MATTOCK_CMDREC to write to a path" + io.puts "Set CALIPH_CMDREC to write to a path" end @@commands.each do |pair| io.puts "[/#{pair[0]}/, #{[pair[1].exit_code, pair[1].streams].inspect}]"
Remove ENV reference to Mattock
diff --git a/imagemagick/recipes/rmagick.rb b/imagemagick/recipes/rmagick.rb index abc1234..def5678 100644 --- a/imagemagick/recipes/rmagick.rb +++ b/imagemagick/recipes/rmagick.rb @@ -22,7 +22,13 @@ when "redhat", "centos", "fedora" package "ImageMagick-devel" when "debian", "ubuntu" - package "libmagickwand-dev" + package value_for_platform( + "ubuntu" => { + "8.04" => "libmagick9-dev", + "8.10" => "libmagick9-dev", + }, + "default" => { "default" => "libmagickwand-dev" } + ) end gem_package "rmagick"
Use libmagick9-dev for the dev libraries on Ubuntu 8.04 and 8.10 The package changed to libmagickwand-dev after 8.10.
diff --git a/app/workers/image_recreator.rb b/app/workers/image_recreator.rb index abc1234..def5678 100644 --- a/app/workers/image_recreator.rb +++ b/app/workers/image_recreator.rb @@ -2,7 +2,9 @@ include Sidekiq::Worker def perform(image_id, version = nil) - record = Image.find(image_id) - record.image.recreate_versions!(*Array(version).compact!) + ActiveRecord::Base.connection_pool.with_connection do + record = Image.find(image_id) + record.image.recreate_versions!(*Array(version).compact!) + end end end
Use connection pool in worker
diff --git a/lib/waldo/scope.rb b/lib/waldo/scope.rb index abc1234..def5678 100644 --- a/lib/waldo/scope.rb +++ b/lib/waldo/scope.rb @@ -13,7 +13,7 @@ if @block.respond_to?(:call) model.instance_exec(value, &@block) - elsif model.respond_to?(@block) + elsif @block && model.respond_to?(@block) model.send(@block, value) elsif model.respond_to?(@name) model.send(@name, value) @@ -32,14 +32,14 @@ end def call(value, model) - if value == @criteria + if value.to_s == @criteria.to_s @value = true if @block.respond_to?(:call) model.instance_exec(value, &@block) - elsif model.respond_to?(@block) - model.send(@block, value) elsif model.respond_to?(@criteria) model.send(@criteria) + elsif @block && model.respond_to?(@block) + model.send(@block, value) else model end
Fix comparison and call order of BoolScope
diff --git a/test/factories/attachments.rb b/test/factories/attachments.rb index abc1234..def5678 100644 --- a/test/factories/attachments.rb +++ b/test/factories/attachments.rb @@ -1,11 +1,13 @@ FactoryGirl.define do + sequence(:attachment_ordering) + factory :file_attachment do ignore do file { File.open(Rails.root.join('test', 'fixtures', 'greenpaper.pdf')) } end sequence(:title) { |index| "file-attachment-title-#{index}" } - sequence(:ordering) + ordering { generate(:attachment_ordering) } after(:build) do |attachment, evaluator| attachment.attachment_data ||= build(:attachment_data, file: evaluator.file) end @@ -19,7 +21,7 @@ factory :html_attachment do sequence(:title) { |index| "html-attachment-title-#{index}" } - sequence(:ordering) + ordering { generate(:attachment_ordering) } body 'Attachment body' end end
Use a global sequence for attachment ordering This should fix an intermittent test failure when HTML and File attachments are built in the same test without being given an explicit ordering.
diff --git a/Hydrant.podspec b/Hydrant.podspec index abc1234..def5678 100644 --- a/Hydrant.podspec +++ b/Hydrant.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "Hydrant" - s.version = "2.0.0-alpha.2" + s.version = "2.0.0" s.summary = "A simple data mapper / object serializer for objective-c" s.description = <<-DESC
Set version to 2.0.0 in podspec
diff --git a/spec/job_spec.rb b/spec/job_spec.rb index abc1234..def5678 100644 --- a/spec/job_spec.rb +++ b/spec/job_spec.rb @@ -21,7 +21,7 @@ context "db_time_now" do it "should return time in current time zone if set" do Time.zone = 'Eastern Time (US & Canada)' - Delayed::Job.db_time_now.zone.should == 'EST' + %w(EST EDT).should include(Delayed::Job.db_time_now.zone) end it "should return UTC time if that is the AR default" do @@ -33,7 +33,7 @@ it "should return local time if that is the AR default" do Time.zone = 'Central Time (US & Canada)' ActiveRecord::Base.default_timezone = :local - Delayed::Job.db_time_now.zone.should == 'CST' + %w(CST CDT).should include(Delayed::Job.db_time_now.zone) end end
Fix test for daylight saving time
diff --git a/spec/pod_spec.rb b/spec/pod_spec.rb index abc1234..def5678 100644 --- a/spec/pod_spec.rb +++ b/spec/pod_spec.rb @@ -0,0 +1,11 @@+require 'spec_helper' + +describe Cocoapods::Search::Pod do + context 'proxy settings' do + before do + @pod = Cocoapods::Search::Pod.new + end + subject { @pod } + its(:has_github) { should be_false } + end +end
Add test initilize of Pod カバレッジ100%にするために Podの初期値としてhas_githubにfalseが設定されているテストを追加
diff --git a/Library/Homebrew/utils/puts_columns.rb b/Library/Homebrew/utils/puts_columns.rb index abc1234..def5678 100644 --- a/Library/Homebrew/utils/puts_columns.rb +++ b/Library/Homebrew/utils/puts_columns.rb @@ -4,21 +4,19 @@ def puts_columns(*objects, gap_size: 2) objects.flatten! - if objects.empty? || (respond_to?(:tty?) ? !tty? : !$stdout.tty?) + fallback = proc do puts(*objects) return end + fallback.call if objects.empty? + fallback.call if respond_to?(:tty?) ? !tty? : !$stdout.tty? + console_width = Tty.width - object_lengths = objects.map { |obj| Tty.strip_ansi(obj.to_s).length } - cols = (console_width + gap_size) / (object_lengths.max + gap_size) - if cols < 2 - puts(*objects) - return - end + fallback.call if cols < 2 rows = (objects.count + cols - 1) / cols cols = (objects.count + rows - 1) / rows # avoid empty trailing columns
Use `proc` to fallback to `puts`.
diff --git a/bin/check_google_doc_export.rb b/bin/check_google_doc_export.rb index abc1234..def5678 100644 --- a/bin/check_google_doc_export.rb +++ b/bin/check_google_doc_export.rb @@ -0,0 +1,29 @@+#!/usr/bin/env ruby + +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # +# +# Script to check that google doc export works as expected. +# +# Usage: +# +# ./bin/check_google_doc_export.rb +# +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # + +require 'net/http' +require 'uri' +require_relative '../lib/article_json' + +doc_id = "1E4lncZE2jDkbE34eDyYQmXKA9O26BHUiwguz4S9qyE8" +url = "https://docs.google.com/feeds/download/documents/export/Export?id=#{doc_id}&exportFormat=html" +expected_document = JSON.parse(File.read('spec/fixtures/reference_document_parsed.json')) + +exported_doc = Net::HTTP.get(URI.parse(url)) + +document = JSON.parse(ArticleJSON::Article.from_google_doc_html(exported_doc).to_json) + +if document != expected_document + raise 'Google doc export doesn\'t work as espected' +end + +puts 'Google doc export worked as expected'
Add an script to check the google doc export format Adds an script that downloads an exported version of the reference document and checks that we can parse it correctly. This way we can easily know if google has made any change to the export format.
diff --git a/lib/emeril/metadata_chopper.rb b/lib/emeril/metadata_chopper.rb index abc1234..def5678 100644 --- a/lib/emeril/metadata_chopper.rb +++ b/lib/emeril/metadata_chopper.rb @@ -31,7 +31,7 @@ end end - def method_missing(meth, *args, &block) + def method_missing(meth, *args, &_block) self[meth] = args.first end end
Refactor rename method param to signal it is unused (style).
diff --git a/lib/patronus_fati/bit_field.rb b/lib/patronus_fati/bit_field.rb index abc1234..def5678 100644 --- a/lib/patronus_fati/bit_field.rb +++ b/lib/patronus_fati/bit_field.rb @@ -29,7 +29,7 @@ end def set_bit(bit) - raise ArgumentError unless valid_bit?(bit) + raise ArgumentError, "Bit #{bit} is out of range of #{tracked_count}" unless valid_bit?(bit) self.bits |= (1 << bit - 1) end
Make argument error more specific
diff --git a/lib/resque/failure/multiple.rb b/lib/resque/failure/multiple.rb index abc1234..def5678 100644 --- a/lib/resque/failure/multiple.rb +++ b/lib/resque/failure/multiple.rb @@ -54,10 +54,6 @@ def self.remove(index) classes.each { |klass| klass.remove(index) } end - - def self.each(offset, limit, queue, class_name, &block) - classes.first.each(offset, limit, queue, class_name, &block) - end end end end
Remove duplicate each definition after a merge
diff --git a/lib/retryable_record/import.rb b/lib/retryable_record/import.rb index abc1234..def5678 100644 --- a/lib/retryable_record/import.rb +++ b/lib/retryable_record/import.rb @@ -1,5 +1,6 @@ require 'retryable_record' +# Extend Ruby's Kernel module module Kernel # Retryable operations on an ActiveRecord +record+. #
Make Inch not display purple anymore :heart:
diff --git a/lib/tasks/article_keyword.rake b/lib/tasks/article_keyword.rake index abc1234..def5678 100644 --- a/lib/tasks/article_keyword.rake +++ b/lib/tasks/article_keyword.rake @@ -0,0 +1,32 @@+require 'csv' + +namespace :article_keyword do + desc "Export Articles and their Keywords into a CSV for easy editing." + task :export => :environment do + logger = GdsApi::Base.logger = Logger.new(STDERR).tap { |l| l.level = Logger::INFO } + logger.info "Exporting articles..." + + count = 0 + number_of_editions_without_tags = 0 + + CSV.open("data/article_keywords.csv", "wb") do |csv| + csv << ["artefact_id", "type", "slug", "artefact_name", "keyword_1", "keyword_2", "etc"] + + Artefact.all.each_with_index do |artefact, index| + begin + count += 1 + puts artefact.kind + keywords = artefact.tags.select do |tag| + tag.tag_type == 'keyword' + end + if keywords.count == 0 + csv << [artefact.id, artefact.kind, artefact.slug, artefact.name] + number_of_editions_without_tags += 1 + end + end + end + end + + logger.info "Found #{number_of_editions_without_tags} editions without keywords." + end +end
Add job to export all articles which don't have keywords linked
diff --git a/lib/trogdir/versions/v1/api.rb b/lib/trogdir/versions/v1/api.rb index abc1234..def5678 100644 --- a/lib/trogdir/versions/v1/api.rb +++ b/lib/trogdir/versions/v1/api.rb @@ -13,7 +13,7 @@ before { authenticate! } rescue_from Mongoid::Errors::DocumentNotFound do |e| - error! "404 Not Found", 404 + Rack::Response.new([{error: '404 Not Found'}.to_json], 404, {'Content-type' => 'application/json'}) end mount PeopleAPI
Fix error on Mongoid DocumentNotFound
diff --git a/lib/content_for_once/helpers.rb b/lib/content_for_once/helpers.rb index abc1234..def5678 100644 --- a/lib/content_for_once/helpers.rb +++ b/lib/content_for_once/helpers.rb @@ -4,7 +4,7 @@ @contents ||= Hash.new {|h, k| h[k] = '' } name = name.to_sym - @contents[name].concat(capture(&block)) + @contents[name].concat(capture(&block)) if capture(&block).present? @contents[name] = @contents[name].scan(/<\w+(?:\s+[^>]+)?\/?>*<\/\w+>|<\w+(?:\s+[^>]+)?\/?>/).uniq.join @contents.each do |name, content|
Fix concat to nil problem
diff --git a/lib/fact_check_email_handler.rb b/lib/fact_check_email_handler.rb index abc1234..def5678 100644 --- a/lib/fact_check_email_handler.rb +++ b/lib/fact_check_email_handler.rb @@ -11,13 +11,9 @@ def initialize self.errors = [] end - - def is_relevant_message?(message) - message.to.any? { |to| to.match(/factcheck\+#{Plek.current.environment}-(.+?)@alphagov.co.uk/) } - end def process_message(message) - if is_relevant_message?(message) + if message.to.any? { |to| to.match(/factcheck\+#{Plek.current.environment}-(.+?)@alphagov.co.uk/) } return FactCheckMessageProcessor.process(message, $1) end
Fix bug in picking up publication ID from email addresses
diff --git a/lib/github_cli/apis/watching.rb b/lib/github_cli/apis/watching.rb index abc1234..def5678 100644 --- a/lib/github_cli/apis/watching.rb +++ b/lib/github_cli/apis/watching.rb @@ -7,31 +7,31 @@ def list(user, repo, params, format) output format do - github_api.repos.watching.list user, repo, params + github_api.activity.watching.list user, repo, params end end def watched(params, format) output format do - github_api.repos.watching.watched params + github_api.activity.watching.watched params end end def watching?(user, repo, params, format) output format do - github_api.repos.watching.watching? user, repo, params + github_api.activity.watching.watching? user, repo, params end end def start(user, repo, params, format) output format do - github_api.repos.watching.watch user, repo, params + github_api.activity.watching.watch user, repo, params end end def stop(user, repo, params, format) output format do - github_api.repos.watching.unwatch user, repo, params + github_api.activity.watching.unwatch user, repo, params end end end
Update to use new activity scope.
diff --git a/lib/rrj/rabbit/listener/base.rb b/lib/rrj/rabbit/listener/base.rb index abc1234..def5678 100644 --- a/lib/rrj/rabbit/listener/base.rb +++ b/lib/rrj/rabbit/listener/base.rb @@ -15,7 +15,7 @@ @rabbit = rabbit.channel subscribe_queue rescue - raise Errors::Rabbit::Listener::Initialize + raise Errors::Rabbit::Listener::Base::Initialize end # Listen a queue and return a body response @@ -27,7 +27,7 @@ end yield response.event, response rescue - raise Errors::Rabbit::Listener::ListenEvents + raise Errors::Rabbit::Listener::Base::ListenEvents end private
Fix namespace raise exception rabbit listener
diff --git a/lib/vines/stanza/dialback.rb b/lib/vines/stanza/dialback.rb index abc1234..def5678 100644 --- a/lib/vines/stanza/dialback.rb +++ b/lib/vines/stanza/dialback.rb @@ -11,19 +11,16 @@ def process id, from, to = %w[id from to].map {|a| @node[a] } key = @node.text - # Maybe select by id? + outbound_stream = router.stream_by_id(id) - - # Turn into error ? unless outbound_stream && outbound_stream.state.is_a?(Stream::Server::Outbound::AuthDialbackResult) - @stream.write(%Q{<db:verify from="#{to}" to=#{from} id=#{id} type="error"><error type="cancel"><item-not-found xmlns="#{NAMESPACES[:stanzas]}" /></error></db:verify>}) + @stream.write(%Q{<db:verify from="#{to}" to="#{from}" id="#{id}" type="error"><error type="cancel"><item-not-found xmlns="#{NAMESPACES[:stanzas]}"/></error></db:verify>}) return end secret = outbound_stream.state.dialback_secret - type = Kit.dialback_key(secret, from, to, id) == key ? VALID_TYPE : INVALID_TYPE - @stream.write(%Q{<db:verify from="#{to}" to="#{from}" id="#{id}" type="#{type}" />}) + @stream.write(%Q{<db:verify from="#{to}" to="#{from}" id="#{id}" type="#{type}"/>}) end end end
Fix invalid xml error msg
diff --git a/TVMLKitchen.podspec b/TVMLKitchen.podspec index abc1234..def5678 100644 --- a/TVMLKitchen.podspec +++ b/TVMLKitchen.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "TVMLKitchen" - s.version = "0.1.0" + s.version = "0.3.0" s.summary = "Swifty TVML template manager with or without client-server" s.description = <<-DESC TVML is a good choice, when you prefer simplicity over dynamic UIKit implementation. TVMLKitchen helps to manage your TVML with or without additional client-server. Put TVML templates in Main Bundle, then you're ready to go.
Update podspec to latest tag
diff --git a/kernel/core/autoload.rb b/kernel/core/autoload.rb index abc1234..def5678 100644 --- a/kernel/core/autoload.rb +++ b/kernel/core/autoload.rb @@ -11,7 +11,6 @@ end def call - Autoload.remove(path) require(path) scope.const_get(name) end
Remove redundant call to Autoload.remove
diff --git a/lib/krypt/ossl/pkcs5.rb b/lib/krypt/ossl/pkcs5.rb index abc1234..def5678 100644 --- a/lib/krypt/ossl/pkcs5.rb +++ b/lib/krypt/ossl/pkcs5.rb @@ -13,5 +13,5 @@ def pbkdf2_hmac(pass, salt, iter, keylen, digest) Krypt::PBKDF2.new(digest).generate(pass, salt, iter, keylen) end - end + end unless defined? OpenSSL::PKCS5 end
Define PKCS5 module only if it doesn't exist yet
diff --git a/lib/rails_xss_helper.rb b/lib/rails_xss_helper.rb index abc1234..def5678 100644 --- a/lib/rails_xss_helper.rb +++ b/lib/rails_xss_helper.rb @@ -38,12 +38,5 @@ end alias_method_chain :content_tag_string, :escaping end - - module TextHelper - def simple_format_with_escaping(text, html_options={}) - simple_format_without_escaping(ERB::Util.h(text), options) - end - alias_method_chain :simple_format, :escaping - end end end
Revert "Add simple_format protection" shouldn't be protected This reverts commit 96cb0059f79d62e3660a926f89d1d0dcc04d1647.
diff --git a/lib/scanny/rake_task.rb b/lib/scanny/rake_task.rb index abc1234..def5678 100644 --- a/lib/scanny/rake_task.rb +++ b/lib/scanny/rake_task.rb @@ -17,6 +17,8 @@ attr_accessor :path # raise exception on error attr_accessor :fail_on_error + # ruby mode + attr_accessor :ruby_mode def initialize(name=:scanny) @name = name @@ -26,6 +28,7 @@ @strict = nil @path = nil @fail_on_error = nil + @ruby_mode = nil yield self if block_given? define @@ -36,11 +39,12 @@ task name do cmd = ["scanny"] - cmd << ["-i"] + [@include] unless @include.empty? - cmd << ["-d"] + [@disable] unless @disable.empty? - cmd << ["-f #{@format}"] if @format - cmd << ["-s"] if @strict - cmd << [@path] if @path + cmd << ["-i"] + [@include] unless @include.empty? + cmd << ["-d"] + [@disable] unless @disable.empty? + cmd << ["-f #{@format}"] if @format + cmd << ["-s"] if @strict + cmd << ["-m #{@ruby_mode}"] if @ruby_mode + cmd << [@path] if @path cmd = cmd.flatten.join(" ") unless system(cmd)
Add implementation for RakeTask and ruby_mode
diff --git a/lib/tasks/comments.rake b/lib/tasks/comments.rake index abc1234..def5678 100644 --- a/lib/tasks/comments.rake +++ b/lib/tasks/comments.rake @@ -1,10 +1,9 @@ namespace :comments do desc "Move posts to polymophic subject" - task move_posts_to_subject: :environment do + task copy_posts_to_subject: :environment do Comment.all.each do |comment| next unless comment.post.present? comment.subject = comment.post - comment.post = nil comment.save end end
Update rake to not clear post from comment
diff --git a/Casks/google-music-manager.rb b/Casks/google-music-manager.rb index abc1234..def5678 100644 --- a/Casks/google-music-manager.rb +++ b/Casks/google-music-manager.rb @@ -0,0 +1,7 @@+class GoogleMusicManager < Cask + url 'https://dl.google.com/dl/androidjumper/mac/718015/musicmanager.dmg' + homepage 'https://music.google.com' + version '1.0.71.8015' + sha1 '1f695cb8b08606476a3a12acd86a0a2d36da81a5' + link 'MusicManager.app' +end
Add cask for Google Music Manager. Upload music from your computer to Google Play with the Music Manager desktop application and listen to the music you love anywhere you have Internet access.
diff --git a/examples/simple.rb b/examples/simple.rb index abc1234..def5678 100644 --- a/examples/simple.rb +++ b/examples/simple.rb @@ -0,0 +1,20 @@+#! /usr/bin/env ruby + +require 'cloud_shaped' +require 'yaml' + +template = CloudShaped.template do + + self.description = "Make a bucket" + + self.metadata["foo"] = { + "bar" => "baz" + } + + def_resource "myBucket", "AWS::S3::Bucket" do |b| + b["BucketName"] = "my-bucket" + end + +end + +puts YAML.dump(template)
Add an example showing description and metadata.
diff --git a/palletjack.gemspec b/palletjack.gemspec index abc1234..def5678 100644 --- a/palletjack.gemspec +++ b/palletjack.gemspec @@ -4,7 +4,7 @@ s.summary = 'Lightweight Configuration Management Database' s.description = File.read(File.join(File.dirname(__FILE__), 'README.md')) s.homepage = 'https://github.com/saab-simc-admin/palletjack' - s.version = '0.0.1' + s.version = '0.0.2' s.author = 'Calle Englund' s.email = 'calle.englund@saabgroup.com' s.license = 'MIT' @@ -15,7 +15,8 @@ s.add_runtime_dependency 'kvdag', '~>0' s.files = [ 'README.md', 'LICENSE' ] s.files += Dir['lib/**/*.rb'] - s.executables = [] + s.files += Dir['bin/*'] + s.executables = ['dump_pallet'] s.test_files = Dir['test/test*.rb'] s.has_rdoc = true end
Add the dump_pallet script and bump version to 0.0.2
diff --git a/tet.gemspec b/tet.gemspec index abc1234..def5678 100644 --- a/tet.gemspec +++ b/tet.gemspec @@ -1,12 +1,16 @@ Gem::Specification.new do |s| - s.name = 'tet' - s.version = '1.0.0' - s.date = '2016-04-06' + s.name = 'tet' + s.version = '1.0.0' + s.date = '2016-04-06' + s.summary = "Barely a test framework" + s.homepage = 'https://github.com/justcolin/tet' s.description = "A very minimal test framework designed for simple projects. A couple of features, relatively nice looking output, and nothing else. Does the world need another test framework? No. Is Tet the product boredom and yak shaving? Yes." - s.authors = ['Colin Fulton'] - s.email = 'justcolin@gmail.com' - s.files = ['lib/tet.rb', 'lib/tests.rb'] - s.homepage = 'https://github.com/justcolin/tet' - s.license = 'BSD-3-Clause' + + s.authors = ['Colin Fulton'] + s.email = 'justcolin@gmail.com' + s.license = 'BSD-3-Clause' + + s.files = ['lib/tet.rb', 'lib/tests.rb'] + s.required_ruby_version = '>= 2.1.3' end
Add a required_ruby_version after testing the gem
diff --git a/lib/benchtool/curl-cmd-builder.rb b/lib/benchtool/curl-cmd-builder.rb index abc1234..def5678 100644 --- a/lib/benchtool/curl-cmd-builder.rb +++ b/lib/benchtool/curl-cmd-builder.rb @@ -5,9 +5,11 @@ @params = params @options = options # Sample curl status cmd - # curl -IL --cookies '#{cookies}' --header '#{header}' "#{url}" + # Flag --insecure allows use of self-signed certs + # curl -siL --insecure --cookies '#{cookies}' --header '#{header}' "#{url}" @parts = { :base => "curl -siL ", + :insecure => "--insecure ", :cookies => "--cookie '%s' ", :header => "--header '%s' ", :url => "'%s'",
Add insecure flag so we can use self-signed certs
diff --git a/lib/geocoder/lookups/nominatim.rb b/lib/geocoder/lookups/nominatim.rb index abc1234..def5678 100644 --- a/lib/geocoder/lookups/nominatim.rb +++ b/lib/geocoder/lookups/nominatim.rb @@ -10,16 +10,7 @@ def results(query, reverse = false) return [] unless doc = fetch_data(query, reverse) - if doc.kind_of?(Array) - if doc.any? - return doc[0]['place_id'] != "" ? doc : [] - else - warn "Address not found or Nominatim Geocoding API error." - return [] - end - else - return doc['place_id'] != "" ? doc = [] << doc : [] - end + doc.is_a?(Array) ? doc : [doc] end def query_url(query, reverse = false)
Simplify code and don't warn.
diff --git a/lib/gir_ffi-gtk/message_dialog.rb b/lib/gir_ffi-gtk/message_dialog.rb index abc1234..def5678 100644 --- a/lib/gir_ffi-gtk/message_dialog.rb +++ b/lib/gir_ffi-gtk/message_dialog.rb @@ -15,12 +15,14 @@ class MessageDialog alias old_initialize initialize + # rubocop:disable Style/FormatStringToken def initialize(parent, flags, type, buttons, message) ptr = Gtk::Lib.gtk_message_dialog_new(parent, flags, type, buttons, '%s', :string, message) store_pointer(ptr) end + # rubocop:enable Style/FormatStringToken remove_method :old_initialize end
Disable FormatStringToken for gtk format string
diff --git a/lib/mini_form/nested_validator.rb b/lib/mini_form/nested_validator.rb index abc1234..def5678 100644 --- a/lib/mini_form/nested_validator.rb +++ b/lib/mini_form/nested_validator.rb @@ -5,17 +5,17 @@ def validate_each(record, _, relation) return if relation.valid? - if relation.errors.respond_to?(:attribute_names) - # Support for Rails 6.1+ where accessing ActiveModel::Errors as a hash has been + if record.errors.respond_to?(:merge!) + # Rails 6.1+ where accessing ActiveModel::Errors as a hash has been # deprecated and the errors array is frozen. For this reason we use the new # method merge!() which appends the errors as NestedErrors to the array. "This is the way." - relation.errors.attribute_names.each do |name| - record.errors.merge!(relation.errors) - end - else - relation.errors.each do |name, value| - record.errors.add name, value - end + record.errors.merge!(relation.errors) + return + end + + # Rails < 6.1 + relation.errors.each do |name, value| + record.errors.add name, value end end end
Fix copy/paste error that put the merge!() call within a loop
diff --git a/cucover.gemspec b/cucover.gemspec index abc1234..def5678 100644 --- a/cucover.gemspec +++ b/cucover.gemspec @@ -9,12 +9,12 @@ s.date = '2009-03-18' s.description = s.summary = 'Cucover is a thin wrapper for Cucumber which makes it lazy.' s.email = 'matt@mattwynne.net' - s.files = Dir['lib/**/*.rb'] + Dir['bin/*'] + ["README.markdown"] + s.files = ["lib/cucover.rb", "bin/cucover", "README.markdown"] s.has_rdoc = false s.homepage = 'http://github.com/mattwynne/cucover' s.require_paths = ["lib", "bin"] s.rubyforge_project = 'cucover' - s.rubygems_version = '1.3.0' + s.rubygems_version = '1.3.1' s.add_dependency 'cucumber', '>= 0.2' s.add_dependency 'rcov', '>= 0.8.1.5'
Use specific files in gemspec to please github
diff --git a/src/testup.rb b/src/testup.rb index abc1234..def5678 100644 --- a/src/testup.rb +++ b/src/testup.rb @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------- # -# Copyright 2013-2016 Trimble Inc. +# Copyright 2013-2018 Trimble Inc. # License: The MIT License (MIT) # #------------------------------------------------------------------------------- @@ -37,7 +37,7 @@ ex = SketchupExtension.new(PLUGIN_NAME, loader) ex.description = 'Test suite utility for SketchUp.' ex.version = PLUGIN_VERSION - ex.copyright = 'Trimble Navigation Limited © 2016' + ex.copyright = 'Trimble Inc. © 2013-2018' ex.creator = 'SketchUp' Sketchup.register_extension(ex, true) file_loaded(__FILE__)
Correct lingering Trimble Navigation reference.
diff --git a/syllabus.gemspec b/syllabus.gemspec index abc1234..def5678 100644 --- a/syllabus.gemspec +++ b/syllabus.gemspec @@ -8,8 +8,8 @@ spec.version = Syllabus::VERSION spec.authors = ['Kentaro Kuribayashi'] spec.email = ['kentarok@gmail.com'] - spec.description = %q{TODO: Write a gem description} - spec.summary = %q{TODO: Write a gem summary} + spec.description = %q{Yet Another Configuration Management Tool in the Era of Immutable Infrastructure} + spec.summary = %q{Yet Another Configuration Management Tool in the Era of Immutable Infrastructure} spec.homepage = '' spec.license = 'MIT'
Add summary to .spec file
diff --git a/core/features/support/paths.rb b/core/features/support/paths.rb index abc1234..def5678 100644 --- a/core/features/support/paths.rb +++ b/core/features/support/paths.rb @@ -1,4 +1,12 @@ module NavigationHelpers + class RoutesProxy + include Rails.application.routes.url_helpers + end + + def spree_core + ActionDispatch::Routing::RoutesProxy.new(Spree::Core::Engine.routes, RoutesProxy.new) + end + # Maps a name to a path. Used by the # # When /^I go to (.+)$/ do |page_name| @@ -7,17 +15,16 @@ # def path_to(page_name) case page_name - when /the home\s?page/ - '/' + root_path when /the admin home page/ - '/admin' + admin_path when /the sign in page/ new_user_session_path when /the sign up page/ new_user_registration_path when /an invalid taxon page/ - "/t/totally_bogus_taxon" + "/t/totally_bogus_taxon" # Add more mappings here.
[core] Add a RoutesProxy so that we can do things like spree_core.root_path in Cucumber features
diff --git a/test/features/add_transaction_test.rb b/test/features/add_transaction_test.rb index abc1234..def5678 100644 --- a/test/features/add_transaction_test.rb +++ b/test/features/add_transaction_test.rb @@ -0,0 +1,25 @@+require "test_helper" + +class AddTransactionTest < Capybara::Rails::TestCase + test "add a new transaction" do + visit new_transaction_path + + select 'William', from: 'transaction_sender_id' + select 'Harry', from: 'transaction_receiver_id' + select 'helping me out', from: 'transaction_activity_id' + fill_in 'transaction_amount', with: '99' + click_button 'Give kudos' + + assert_equal dashboard_path, current_location + + within '#most-recent' do + assert_content page, "99 ₭ from WILLIAM to HARRY for HELPING ME OUT" + end + + within '#progress-label' do + # 1342 + 99 = 1441 + assert_content page, "1.441 ₭" + end + end +end +
Add feature test for adding a transaction
diff --git a/app/models/progress_update.rb b/app/models/progress_update.rb index abc1234..def5678 100644 --- a/app/models/progress_update.rb +++ b/app/models/progress_update.rb @@ -2,7 +2,7 @@ class ProgressUpdate < ApplicationRecord belongs_to :project belongs_to :user - has_many :comments + has_many :comments, dependent: :destroy def self.add_and_update_project(params, word_format, project) update = self.new
Delete comments when user update is deleted
diff --git a/db/migrate/20120824165019_add_permission_for_send_mail_to_members_to_admin_and_moderator_roles.rb b/db/migrate/20120824165019_add_permission_for_send_mail_to_members_to_admin_and_moderator_roles.rb index abc1234..def5678 100644 --- a/db/migrate/20120824165019_add_permission_for_send_mail_to_members_to_admin_and_moderator_roles.rb +++ b/db/migrate/20120824165019_add_permission_for_send_mail_to_members_to_admin_and_moderator_roles.rb @@ -0,0 +1,23 @@+class AddPermissionForSendMailToMembersToAdminAndModeratorRoles < ActiveRecord::Migration + def self.up + Environment.all.map(&:id).each do |id| + role = Profile::Roles.admin(id) + role.permissions += ['send_mail_to_members'] + role.save! + role = Profile::Roles.moderator(id) + role.permissions += ['send_mail_to_members'] + role.save! + end + end + + def self.down + Environment.all.map(&:id).each do |id| + role = Profile::Roles.admin(id) + role.permissions -= ['send_mail_to_members'] + role.save! + role = Profile::Roles.moderator(id) + role.permissions -= ['send_mail_to_members'] + role.save! + end + end +end
Add the new permission to the 'admin' and 'moderator' roles in all environments (ActionItem2388)
diff --git a/app/models/spina/blog/post.rb b/app/models/spina/blog/post.rb index abc1234..def5678 100644 --- a/app/models/spina/blog/post.rb +++ b/app/models/spina/blog/post.rb @@ -18,7 +18,7 @@ before_save :set_published_at # Create a 301 redirect if the slug changed - after_save :rewrite_rule, if: -> { saved_change_to_slug? } + after_save :rewrite_rule, if: -> { saved_change_to_slug? }, on: :update scope :available, -> { where('published_at <= ?', Time.zone.now) } scope :future, -> { where('published_at >= ?', Time.zone.now) } @@ -36,8 +36,10 @@ end def rewrite_rule - RewriteRule.create(old_path: "/blog/posts/#{slug_before_last_save}", - new_path: "/blog/posts/#{slug}") + ::Spina::RewriteRule.create( + old_path: "/blog/posts/#{slug_before_last_save}", + new_path: "/blog/posts/#{slug}" + ) end end end
Use top level namespace to ensure reloading works properly
diff --git a/erudite.gemspec b/erudite.gemspec index abc1234..def5678 100644 --- a/erudite.gemspec +++ b/erudite.gemspec @@ -1,10 +1,8 @@ # coding: utf-8 - -require_relative 'lib/erudite/version' Gem::Specification.new do |gem| gem.name = 'erudite' - gem.version = Erudite::VERSION.to_s + gem.version = '0.2.0' gem.summary = 'Executable documentation.' gem.description = gem.summary gem.homepage = 'https://github.com/tfausak/erudite'
Revert "Dynamically load the version from Erudite::VERSION" This reverts commit e77c6a962259d4181cbb90cfc19e40cb818ab02d.
diff --git a/spec/features/submission_print_rate_spec.rb b/spec/features/submission_print_rate_spec.rb index abc1234..def5678 100644 --- a/spec/features/submission_print_rate_spec.rb +++ b/spec/features/submission_print_rate_spec.rb @@ -17,8 +17,8 @@ login_as(user, scope: :user) visit submission_path(submission.id) - expect(page).to have_selector('table tr', count: rates_number) - expect(page).to have_text("#{sample_nickname}: #{sample_value}") + expect(page).to have_css('div.submission-rate', count: rates_number) + expect(page).to have_text("#{sample_nickname} rated #{sample_value}") end end @@ -26,7 +26,7 @@ it "does not show rates in submission view" do login_as(user, scope: :user) visit submission_path(submission.id) - expect(page).to have_selector('table tr', count: 0) + expect(page).to have_css('div.submission-rate', count: 0) end end end
Fix a spec for now - should be rewritten!
diff --git a/rack-github_webhooks.gemspec b/rack-github_webhooks.gemspec index abc1234..def5678 100644 --- a/rack-github_webhooks.gemspec +++ b/rack-github_webhooks.gemspec @@ -18,8 +18,8 @@ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ['lib'] - spec.add_development_dependency 'bundler', '~> 1.10' - spec.add_development_dependency 'rake', '~> 10.0' + spec.add_development_dependency 'bundler', '>= 1.10' + spec.add_development_dependency 'rake' spec.add_development_dependency 'minitest' spec.add_development_dependency 'pry' spec.add_development_dependency 'rack-test'
Allow using current versions of bundler, rake
diff --git a/rspec-sitemap-matchers.gemspec b/rspec-sitemap-matchers.gemspec index abc1234..def5678 100644 --- a/rspec-sitemap-matchers.gemspec +++ b/rspec-sitemap-matchers.gemspec @@ -14,4 +14,6 @@ gem.name = "rspec-sitemap-matchers" gem.require_paths = ["lib"] gem.version = RSpec::Sitemap::Matchers::VERSION + + gem.add_development_dependency 'rake' end
Add rake as a development dependency.
diff --git a/lib/datr/queue.rb b/lib/datr/queue.rb index abc1234..def5678 100644 --- a/lib/datr/queue.rb +++ b/lib/datr/queue.rb @@ -6,11 +6,11 @@ @elements = [] end - def put(elem) + def insert elem @elements << elem end - def pop + def remove @elements.delete_at(0) end @@ -18,6 +18,10 @@ @elements.first end + def size + @elements.size + end + end end
Change a bit the Datr::Queue's method signatures
diff --git a/OSX/saldl.rb b/OSX/saldl.rb index abc1234..def5678 100644 --- a/OSX/saldl.rb +++ b/OSX/saldl.rb @@ -1,9 +1,9 @@ class Saldl < Formula desc "CLI downloader optimized for speed and early preview." homepage "https://saldl.github.io" - url "https://github.com/saldl/saldl/archive/v30.tar.gz" - version "30" - sha256 "54f0887ef32ceff1af46e30cf06202a2a9cead4a19d575d22feaad44f92d4d9e" + url "https://github.com/saldl/saldl/archive/v31.tar.gz" + version "31" + sha256 "146a980ae2109a391c7a8ab6a1c525458db9bf18f3f0477731c9b876630078b4" head do # git describe does not work with shallow clones
OSX: Update Homebrew formula for v31 Signed-off-by: Mohammad Alsaleh <6c225a8dcf0f3ea8ab31a8a88dea0c937d544fc7@gmail.com>
diff --git a/spec/guest_spec.rb b/spec/guest_spec.rb index abc1234..def5678 100644 --- a/spec/guest_spec.rb +++ b/spec/guest_spec.rb @@ -0,0 +1,65 @@+require_relative '../lib/guest.rb' + +describe Guest do + let (:guest) { Guest.new({guest_money: 200, guest_bet: 0}) } + + it "is created with a session array" do + expect(Guest.new([])).to be_a Guest + end + + it "should have 200 dollars by default" do + expect(guest.money).to eq 200 + end + + it "should be nothing by default" do + expect(guest.bet).to eq 0 + end + + describe "betting" do + it "will subtract money from the guest" do + guest.place_bet! 10 + expect(guest.money).to eq 190 + end + + it "will set the players bet according to the amount bet" do + guest.place_bet! 10 + expect(guest.bet).to eq 10 + end + end + + it "will earn twice the amounte bet after winning" do + guest.place_bet! 10 + guest.win! + expect(guest.money).to eq 210 + end + + it "will earn its money back after pushing" do + guest.place_bet! 10 + guest.push! + expect(guest.money).to eq 200 + end + + it "will have lost its money after losing" do + guest.place_bet! 10 + guest.lose! + expect(guest.money).to eq 190 + end + + it "can have its money reset to 200" do + guest.reset_money! + expect(guest.money).to eq 200 + end + + describe "being broke" do + it "is not broke if it has more than 0 dollars" do + guest.reset_money! + expect(guest.is_broke?).not_to be true + end + + it "is broke if it has 0 dollars" do + guest.place_bet! 200 + guest.lose! + expect(guest.is_broke?).to be true + end + end +end
Write a spec suite for the guest class.
diff --git a/spec/proxy_spec.rb b/spec/proxy_spec.rb index abc1234..def5678 100644 --- a/spec/proxy_spec.rb +++ b/spec/proxy_spec.rb @@ -21,9 +21,22 @@ @proxy.edits -= 1 @proxy.edits.should == 1 end - it "should update the total when the buckets are updated" do - @proxy.should == 3 - @proxy.comments += 2 - @proxy.should == 5 + describe "when the buckets are updated" do + it "should update the total" do + @proxy.should == 3 + @proxy.comments += 2 + @proxy.should == 5 + end + it "should keep the bucket values independent of each other" do + @proxy.comments += 1 + @proxy.comments.should == 2 + @proxy.edits -= 1 + @proxy.edits.should == 1 + end + end + describe "for a non-existent bucket" do + it "should raise a NoMethodError" do + lambda { @proxy.not_there }.should raise_error(NoMethodError) + end end end
Add a couple more key specs.
diff --git a/pipedrive.gemspec b/pipedrive.gemspec index abc1234..def5678 100644 --- a/pipedrive.gemspec +++ b/pipedrive.gemspec @@ -25,5 +25,6 @@ gem.add_development_dependency('bundler') gem.add_development_dependency('rake') gem.add_development_dependency('rspec', '>= 3.0') + gem.add_development_dependency('rubocop') gem.add_development_dependency('webmock') end
Add rubocop to dev dependency
diff --git a/actionpack/lib/action_controller/metal/exceptions.rb b/actionpack/lib/action_controller/metal/exceptions.rb index abc1234..def5678 100644 --- a/actionpack/lib/action_controller/metal/exceptions.rb +++ b/actionpack/lib/action_controller/metal/exceptions.rb @@ -30,9 +30,6 @@ class MissingFile < ActionControllerError #:nodoc: end - class RenderError < ActionControllerError #:nodoc: - end - class SessionOverflowError < ActionControllerError #:nodoc: DEFAULT_MESSAGE = 'Your session data is larger than the data column in which it is to be stored. You must increase the size of your data column if you intend to store large data.'
Remove AC::RenderError class second declaration
diff --git a/jschematic.gemspec b/jschematic.gemspec index abc1234..def5678 100644 --- a/jschematic.gemspec +++ b/jschematic.gemspec @@ -3,10 +3,19 @@ s.version = '0.0.1' s.authors = ["Mike Sassak"] s.description = "JSON Schema v3 Validator" + s.summary = "jschematic #{s.version}" + s.email = "msassak@gmail.com" s.homepage = "https://github.com/msassak/jschematic" s.add_development_dependency 'cucumber' s.add_development_dependency 'rspec' s.add_development_dependency 'yajl-ruby' s.add_development_dependency 'jsonschema' + + s.rubygems_version = "1.3.7" + s.files = `git ls-files`.split("\n") + s.test_files = `git ls-files -- {spec,features}/*`.split("\n") + s.extra_rdoc_files = ["LICENSE", "README.md"] + s.rdoc_options = ["--charset=UTF-8"] + s.require_path = "lib" end
Include the right stuff in the gemspec
diff --git a/VMDE/extconf.rb b/VMDE/extconf.rb index abc1234..def5678 100644 --- a/VMDE/extconf.rb +++ b/VMDE/extconf.rb @@ -15,13 +15,13 @@ if RbConfig::CONFIG['host_os'].index("linux") puts "Linux system detected" - $CFLAGS += " -Wall -O4 -O -pthread -malign-double " + $CXXFLAGS += " -Wall -O4 -O -pthread -malign-double " else - $CFLAGS += " -Wall -O3 " + $CXXFLAGS += " -Wall -O3 " end +$CXXFLAGS += " -I../lib/SOIL/src -fPIC " -$LOCAL_LIBS+="../lib/SOIL/lib/libSOIL.a" -$INCLUDE += " -I../lib/SOIL/src " +$LOCAL_LIBS+="../lib/SOIL/lib/libSOIL.so" $libs += %w( -lGLEW -lGLU -lglfw -lrt -lportaudio -lasound -lXrandr -lXinerama -lXi -lXcursor -lXrender
Change SOIL to dynamic lib Signed-off-by: Cheng Cao <f82fd421a071e898477b279d460f8204bae370d8@163.com>
diff --git a/lib/extensions/cached_attrs.rb b/lib/extensions/cached_attrs.rb index abc1234..def5678 100644 --- a/lib/extensions/cached_attrs.rb +++ b/lib/extensions/cached_attrs.rb @@ -15,7 +15,7 @@ cached_attr attr_name do result = [] - block.call result + instance_exec result, &block result end
Fix context lost issue in cached_array_attr
diff --git a/lib/cms/attribute/association.rb b/lib/cms/attribute/association.rb index abc1234..def5678 100644 --- a/lib/cms/attribute/association.rb +++ b/lib/cms/attribute/association.rb @@ -5,7 +5,7 @@ def options_for_select(entry) self.klass.all.reject{ |e| e == entry }.collect do |e| - [e.try(:name) || e.try(:title) || e.id, e.id] + [e.try(:email) || e.try(:login) || e.try(:name) || e.try(:title) || e.id, e.id] end end end
Add email and login to options_for_select method for assotiations
diff --git a/lib/armok/token.rb b/lib/armok/token.rb index abc1234..def5678 100644 --- a/lib/armok/token.rb +++ b/lib/armok/token.rb @@ -5,7 +5,7 @@ class Token attr_accessor :pre, :key, :values, :post - def initialize(s = '', pre = '', key = '', values = [], post = '') + def initialize(s = '', pre = '', post = '', key = '', values = []) @pre = pre @post = post parse(s) unless s.empty? @@ -14,14 +14,14 @@ def parse(s) @values = s.split(COLON) @key = @values.shift - Token.new('', @pre, @key, @values, @post) + Token.new('', @pre, @post, @key, @values) end def to_s if @values.empty? - "#{pre}[#{key}]#{post}" + "#{@pre}[#{@key}]#{@post}" else - "#{pre}[#{[@key, @values].join(COLON)}]#{post}" + "#{@pre}[#{[@key, @values].join(COLON)}]#{@post}" end end end
Make parse methods return clones for method-chaining
diff --git a/lib/heaven/provider/ansible.rb b/lib/heaven/provider/ansible.rb index abc1234..def5678 100644 --- a/lib/heaven/provider/ansible.rb +++ b/lib/heaven/provider/ansible.rb @@ -35,7 +35,7 @@ deploy_string = ["ANSIBLE_HOST_KEY_CHECKING=false", "ansible-playbook", "-i", ansible_hosts_file, ansible_site_file, - "--verbose", "--extra-vars", ansible_extra_vars] + "--verbose", "--extra-vars", "'#{ansible_extra_vars}'"] log "Executing ansible: #{deploy_string.join(" ")}" execute_and_log(deploy_string) end
Fix bugs in extra vars.
diff --git a/spec/cwm_spec.rb b/spec/cwm_spec.rb index abc1234..def5678 100644 --- a/spec/cwm_spec.rb +++ b/spec/cwm_spec.rb @@ -21,6 +21,9 @@ if t.name =~ /1018/ pending("matcher does not stop") next + elsif t.rdf_type == "CwmProofTest" + pending("proofs not supported") + next end t.run_test do |rdf_string| t.debug = [] @@ -33,7 +36,7 @@ end g end - rescue #Spec::Expectations::ExpectationNotMetError => e + rescue Spec::Expectations::ExpectationNotMetError => e if t.status == "pending" pending("Formulae not supported") { raise } else
Mark CwmProofTests as pending, until proofs are supported (if ever).
diff --git a/lib/galera_cluster_migrations.rb b/lib/galera_cluster_migrations.rb index abc1234..def5678 100644 --- a/lib/galera_cluster_migrations.rb +++ b/lib/galera_cluster_migrations.rb @@ -7,7 +7,7 @@ require 'galera_cluster_migrations/railtie' if defined?(Rails) included do - def set_db_to_rsu + def enable_rsu say "Setting wsrep_OSU_method to RSU" unless [:development, :test].include?(Rails.env) execute "SET GLOBAL wsrep_OSU_method=RSU" @@ -29,7 +29,7 @@ end end - def set_db_to_toi + def enable_toi say "Setting wsrep_OSU_method to TOI" unless [:development, :test].include?(Rails.env) execute "SET GLOBAL wsrep_OSU_method=TOI"
Rename set_db_to_rsu to enable_rsu and set_db_to_toi to enable_toi.