diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -7,4 +7,16 @@ add_filter '/db/' end +# Configure a test database +require 'active_record' + +ENV['RACK_ENV'] = 'test' + +ActiveRecord::Base.establish_connection( + adapter: 'sqlite3', + database: 'memory' +) +require_relative '../db/schema.rb' + +# Pull in the code require_relative '../lib/cyclid'
Create a test database & load the AR schema.
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -29,4 +29,4 @@ require 'support/transport' require 'support/files' -ENV['ELECTRIC_SHEEPS_HOME'] = Dir.mktmpdir +ENV['ELECTRIC_SHEEP_HOME'] = Dir.mktmpdir
Use the appropriate environment variable in specs
diff --git a/spec/test_helper.rb b/spec/test_helper.rb index abc1234..def5678 100644 --- a/spec/test_helper.rb +++ b/spec/test_helper.rb @@ -1,8 +1,5 @@ # Inspiration gained from Thinking Sphinx's test suite. # Pat Allan is a genius. - -puts "WTF STILL BROKEN" -puts Time.zone class TestHelper attr_accessor :host, :username, :password
Revert "and one's still failing... figuring out what zone the server's in" This reverts commit 8301bddc0d28a022dec97857fe31db2301cd0745.
diff --git a/test/client_test.rb b/test/client_test.rb index abc1234..def5678 100644 --- a/test/client_test.rb +++ b/test/client_test.rb @@ -19,7 +19,14 @@ subscription_info = fixture('subscription_info.json') # TODO: Add header for response stub_request(:get, "https://dash-replenishment-service-na.amazon.com/subscriptionInfo") - .to_return(body: subscription_info, status: 200) + .to_return( + body: subscription_info, + status: 200, + headers: { + 'X-Amzn-Requestid' => 'd296d296-d1d1-1111-8c8c-0b43820b4382', + 'X-Amz-Date' => 'Mon, 02 Jan 2017 22:35:53 GMT' + } + ) end test 'requests the correct resource' do ret = @drs.subscription_info
Add headers to response in test
diff --git a/test/test_helper.rb b/test/test_helper.rb index abc1234..def5678 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,21 +1,3 @@-# Set the default environment to sqlite3's in_memory database -ENV['RAILS_ENV'] ||= 'in_memory' - -# Load the Rails environment and testing framework -require "#{File.dirname(__FILE__)}/app_root/config/environment" -require 'test_help' - -# Undo changes to RAILS_ENV -silence_warnings {RAILS_ENV = ENV['RAILS_ENV']} - -# Run the migrations -ActiveRecord::Migrator.migrate("#{Rails.root}/db/migrate") - -# Set default fixture loading properties -ActiveSupport::TestCase.class_eval do - self.use_transactional_fixtures = true - self.use_instantiated_fixtures = false - self.fixture_path = "#{File.dirname(__FILE__)}/fixtures" - - fixtures :all -end +require 'active_support/all' +require 'minitest/autorun' +require 'netzke-core'
Make unit tests outside of test app running
diff --git a/test/test_helper.rb b/test/test_helper.rb index abc1234..def5678 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -2,7 +2,7 @@ require 'rubygems' require 'test/unit' -require 'mocha' +require 'mocha/setup' unless(TEST_LIVE_API) require 'webmock/test_unit' @@ -18,4 +18,4 @@ end #load(File.join('unit', 'test_direct_require.rb'), true) -system('ruby ' + File.expand_path(File.join(File.dirname(__FILE__), 'unit', 'test_direct_require.rb')))+system('ruby ' + File.expand_path(File.join(File.dirname(__FILE__), 'unit', 'test_direct_require.rb')))
Update mocha require statement to the new 'mocha/setup' file
diff --git a/test/test_helper.rb b/test/test_helper.rb index abc1234..def5678 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -33,3 +33,20 @@ end require 'aviator/core' + +at_exit do + # Load all requests so that they are reported by SimpleCov + request_file_paths = Dir.glob(Pathname.new(__FILE__).join( + '..', '..', 'lib', 'aviator', + 'openstack', '**', '*.rb' + ).expand_path + ) + + request_file_paths.each do |path| + # Ignore the load errors since all we want is for + # SimpleCov to detect the request file. + begin + Kernel.load(path, true) + rescue e; end + end +end
Load request files at exit
diff --git a/spec/samples/rubySyntaxParts/conditionalStatment/inlineConditional.rb b/spec/samples/rubySyntaxParts/conditionalStatment/inlineConditional.rb index abc1234..def5678 100644 --- a/spec/samples/rubySyntaxParts/conditionalStatment/inlineConditional.rb +++ b/spec/samples/rubySyntaxParts/conditionalStatment/inlineConditional.rb @@ -0,0 +1,19 @@+class FunctionAbstract + + attr_accessor :type + + def initialize(pFunctionName) + return nil if pFunctionName.nil? or !pFunctionName.is_a? String + + @name = pFunctionName + @visibility = "public" + @manager = String.new + end + + def killTest(name) + if name.nil? or age.is_a? String + puts "me" + end + end + +end
Add sample to catch bug.
diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb index abc1234..def5678 100644 --- a/config/initializers/wrap_parameters.rb +++ b/config/initializers/wrap_parameters.rb @@ -4,6 +4,7 @@ # Enable parameter wrapping for JSON. ActiveSupport.on_load(:action_controller) do + include ActionController::ParamsWrapper wrap_parameters format: [:json] if respond_to?(:wrap_parameters) end
Add explicit support for params wrapper
diff --git a/lib/uuid_mixin.rb b/lib/uuid_mixin.rb index abc1234..def5678 100644 --- a/lib/uuid_mixin.rb +++ b/lib/uuid_mixin.rb @@ -1,22 +1,17 @@ module UuidMixin extend ActiveSupport::Concern included do - before_validation :set_guid, :on => :create if respond_to?(:before_validation) + default_value_for(:guid, :allows_nil => false) { SecureRandom.uuid } validates :guid, :uniqueness => true, :presence => true end def dup - super.tap { |obj| obj.guid = nil } + super.tap { |obj| obj.guid = SecureRandom.uuid } end private - def set_guid - self.guid ||= SecureRandom.uuid if self.respond_to?(:guid) && self.respond_to?(:guid=) - end - def default_name_to_guid - set_guid self.name ||= self.guid if self.respond_to?(:guid) && self.respond_to?(:name) && self.respond_to?(:name=) end end
Switch to default_value_for rather than custom logic
diff --git a/spec/gitprep_spec.rb b/spec/gitprep_spec.rb index abc1234..def5678 100644 --- a/spec/gitprep_spec.rb +++ b/spec/gitprep_spec.rb @@ -17,4 +17,8 @@ .with(checkout_branch: "latest") end + it 'creates a template with attributes' do + expect(chef_run).to create_template("/var/lib/gitprep/gitprep.conf") + end + end
Add template example (just check create on default file path)
diff --git a/spec/models/collection_spec.rb b/spec/models/collection_spec.rb index abc1234..def5678 100644 --- a/spec/models/collection_spec.rb +++ b/spec/models/collection_spec.rb @@ -1,34 +1,37 @@ require 'spec_helper' -describe Collection, :type => :model do - before do - @user = FactoryGirl.create(:user) - @collection = Collection.new(title: "test collection").tap do |c| - c.apply_depositor_metadata(@user.user_key) +describe Collection do + let(:user) { create(:user) } + let(:collection) do + Collection.new(title: "test collection") do |c| + c.apply_depositor_metadata(user) end end - it "should have open visibility" do - @collection.save - expect(@collection.read_groups).to eq ['public'] + it "has open visibility" do + collection.save + expect(collection.read_groups).to eq ['public'] end - it "should not allow a collection to be saved without a title" do - @collection.title = nil - expect{ @collection.save! }.to raise_error(ActiveFedora::RecordInvalid) + it "validates title" do + collection.title = nil + expect(collection).not_to be_valid end describe "::bytes" do - subject { @collection.bytes } + subject { collection.bytes } + context "with no items" do - before { @collection.save } + before { collection.save } it { is_expected.to eq 0 } end context "with two 50 byte files" do let(:bitstream) { double("content", size: "50")} let(:file) { mock_model GenericFile, content: bitstream } - before { allow(@collection).to receive(:members).and_return([file, file]) } + + before { allow(collection).to receive(:members).and_return([file, file]) } + it { is_expected.to eq 100 } end
Refactor spec to use let and get rid of tap
diff --git a/spec/node/node_version_spec.rb b/spec/node/node_version_spec.rb index abc1234..def5678 100644 --- a/spec/node/node_version_spec.rb +++ b/spec/node/node_version_spec.rb @@ -13,3 +13,10 @@ its(:stdout) { should contain('v4.4.4') } end end + +# Node 6.x +if property[:name] =~ /v6./ + describe command('node -v') do + its(:stdout) { should contain('v6.1.0') } + end +end
Test for Node.js 6.x image
diff --git a/test/sepa/banks/nordea/nordea_renew_cert_request_soap_builder_test.rb b/test/sepa/banks/nordea/nordea_renew_cert_request_soap_builder_test.rb index abc1234..def5678 100644 --- a/test/sepa/banks/nordea/nordea_renew_cert_request_soap_builder_test.rb +++ b/test/sepa/banks/nordea/nordea_renew_cert_request_soap_builder_test.rb @@ -29,4 +29,11 @@ test 'sender id is properly set' do assert_equal @params[:customer_id], @doc.at("xmlns|SenderId", xmlns: 'http://bxd.fi/CertificateService').content end + + test 'request id is properly_set' do + request_id_node = @doc.at('xmlns|RequestId', xmlns: 'http://bxd.fi/CertificateService') + + assert request_id_node.content =~ /^[0-9A-F]+$/i + assert_equal 34, request_id_node.content.length + end end
Test that request id is properly set
diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index abc1234..def5678 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -4,12 +4,12 @@ run_puppet_install_helper install_module_on(hosts) -install_module_from_forge_on(hosts, 'puppetlabs-stdlib', '= 4.11.0') -install_module_from_forge_on(hosts, 'puppetlabs-concat', '= 2.1.0') -install_module_from_forge_on(hosts, 'willdurand-composer', '= 1.1.1') +install_module_from_forge_on(hosts, 'puppetlabs-stdlib', '= 4.25.1') +install_module_from_forge_on(hosts, 'puppetlabs-concat', '= 4.2.1') +install_module_from_forge_on(hosts, 'willdurand-composer', '= 1.2.6') install_module_from_forge_on(hosts, 'camptocamp-archive', '= 0.8.1') # test dependencies -install_module_from_forge_on(hosts, 'puppetlabs-apache', '= 2.3.0') +install_module_from_forge_on(hosts, 'puppetlabs-apache', '= 3.1.0') RSpec.configure do |c| c.formatter = :documentation
Update dependencies used for acceptance tests
diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index abc1234..def5678 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -1,22 +1,17 @@-require 'beaker-rspec/spec_helper' -require 'beaker-rspec/helpers/serverspec' +require 'beaker-rspec' +require 'beaker-puppet' require 'beaker/puppet_install_helper' +require 'beaker/module_install_helper' run_puppet_install_helper unless ENV['BEAKER_provision'] == 'no' RSpec.configure do |c| - # Project root - proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..')) - # Readable test descriptions c.formatter = :documentation # Configure all nodes in nodeset c.before :suite do - # Install module and dependencies - puppet_module_install(source: proj_root, module_name: 'community_kickstarts') - hosts.each do |host| - on host, puppet('module', 'install', 'puppetlabs-stdlib'), acceptable_exit_codes: [0, 1] - end + install_module + install_module_dependencies end end
Clean up acceptance spec helper
diff --git a/lib/centable.rb b/lib/centable.rb index abc1234..def5678 100644 --- a/lib/centable.rb +++ b/lib/centable.rb @@ -1,4 +1,23 @@ require "centable/engine" module Centable + extend ActiveSupport::Concern + + module ClassMethods + def cent_column(attribute, options={}) + cents_col = "#{attribute.to_s}_cents".to_sym + define_method("#{attribute.to_s}=") do |val| + num_val = cast_to_numeric(val) + self[cents_col] = num_val.nil? ? 0 : (num_val*100).to_i + end + + define_method("#{attribute.to_s}") do + self[cents_col] ? BigDecimal(self[cents_col])/100 : self[cents_col] + end + end + end + + def cast_to_numeric(value) + value.is_a?(String) ? value.to_big_decimal : value + end end
Add main logic to Centable
diff --git a/Formula/neon.rb b/Formula/neon.rb index abc1234..def5678 100644 --- a/Formula/neon.rb +++ b/Formula/neon.rb @@ -9,7 +9,15 @@ :provided_by_osx end + def options + [ + ['--universal', 'Build as a Universal Intel binary.'] + ] + end + def install + ENV.universal_binary if ARGV.include? '--universal' + system "./configure", "--prefix=#{prefix}", "--disable-debug", "--enable-shared",
Add --universal option to Neon
diff --git a/lib/weekly_commits/cli.rb b/lib/weekly_commits/cli.rb index abc1234..def5678 100644 --- a/lib/weekly_commits/cli.rb +++ b/lib/weekly_commits/cli.rb @@ -12,8 +12,15 @@ type: :numeric, desc: 'Relative week number. e.g. -w=1 for last week. 0 = current week.', aliases: '-w', - default: 0 + default: 0, } + + method_option :show_committer, { + type: :boolean, + desc: 'Display committer with each commit message. e.g. Did stuff (Dorian Karter)', + default: false, + } + def weekly_commits relative_week = options[:week] beg_week = relative_week.week.ago.beginning_of_week @@ -22,8 +29,10 @@ date = beg_week + day_count.days week_title = date.strftime('%a, %e %b %Y') git_date_format = date.strftime('%Y-%m-%e') + committer = options[:show_committer] ? ' (%cn)' : '' - commits = `git --no-pager log --after='#{git_date_format} 00:00' --before='#{git_date_format} 23:59' --pretty=format:'%s'` + commits = `git --no-pager log --after='#{git_date_format} 00:00' --before='#{git_date_format} 23:59' --pretty=format:'%s#{committer}'` + puts week_title.yellow puts commits
Add ability to show committer
diff --git a/activerecord/test/cases/adapters/mysql/quoting_test.rb b/activerecord/test/cases/adapters/mysql/quoting_test.rb index abc1234..def5678 100644 --- a/activerecord/test/cases/adapters/mysql/quoting_test.rb +++ b/activerecord/test/cases/adapters/mysql/quoting_test.rb @@ -9,15 +9,11 @@ end def test_type_cast_true - c = Column.new(nil, 1, Type::Boolean.new) - assert_equal 1, @conn.type_cast(true, nil) - assert_equal 1, @conn.type_cast(true, c) + assert_equal 1, @conn.type_cast(true) end def test_type_cast_false - c = Column.new(nil, 1, Type::Boolean.new) - assert_equal 0, @conn.type_cast(false, nil) - assert_equal 0, @conn.type_cast(false, c) + assert_equal 0, @conn.type_cast(false) end end end
Stop relying on columns in mysql quoting tests The behavior tested by the removed lines is sufficiently covered elsewhere.
diff --git a/vagrant-blocker.gemspec b/vagrant-blocker.gemspec index abc1234..def5678 100644 --- a/vagrant-blocker.gemspec +++ b/vagrant-blocker.gemspec @@ -14,8 +14,8 @@ spec.homepage = 'https://github.com/vStone/vagrant-blocker' spec.license = 'MIT' - spec.files = `git ls-files -z`.split("\x0") - spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } - spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) - spec.require_paths = ['lib'] + spec.files = `git ls-files -z`.split("\x0") - ['.gitignore', '.rubocop.yml', 'Rakefile', 'Gemfile'] + spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } + spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) + spec.require_paths = ['lib'] end
Exclude some files from the generated gem
diff --git a/app/models/solidus_avatax_certified/request/get_tax.rb b/app/models/solidus_avatax_certified/request/get_tax.rb index abc1234..def5678 100644 --- a/app/models/solidus_avatax_certified/request/get_tax.rb +++ b/app/models/solidus_avatax_certified/request/get_tax.rb @@ -5,7 +5,7 @@ class GetTax < SolidusAvataxCertified::Request::Base def generate promotion_discount = order.all_adjustments.promotion.eligible.sum(:amount).abs - manual_discount = order.all_adjustments.where(source: nil).eligible.sum(:amount).abs + manual_discount = order.all_adjustments.where('amount < 0').where(source: nil).eligible.sum(:amount).abs { createTransactionModel: {
Fix positive amount adjustments being considered as discounts
diff --git a/app/controllers/trackchanges_controller.rb b/app/controllers/trackchanges_controller.rb index abc1234..def5678 100644 --- a/app/controllers/trackchanges_controller.rb +++ b/app/controllers/trackchanges_controller.rb @@ -1,5 +1,4 @@ class TrackchangesController < ApplicationController - skip_before_action :verify_authenticity_token def get_changes date1_start, date1_end, date2_start, date2_end, phrase = track_changes_params @@ -25,21 +24,14 @@ end def get_filtered_listings(date_start, date_end, phrase) - # date_range_listings = Listing.date_range(date_start, date_end) - # if date_range_listings.is_a? String - # # No listings found - # date_range_listings = [] - # else - # date_range_listings = date_range_listings.select {|listing| listing.check_phrase(phrase)} - # end - + date_range_listings = Listing.date_range(date_start, date_end) phrases_found = [] - for listing in Listing.all() + for listing in date_range_listings if listing.check_phrase(phrase) phrases_found.push(listing) end end - return listings_found + return phrases_found end end
Connect track changes function to fixed Listing.date_range()
diff --git a/SisGPWeb/spec/models/projeto_spec.rb b/SisGPWeb/spec/models/projeto_spec.rb index abc1234..def5678 100644 --- a/SisGPWeb/spec/models/projeto_spec.rb +++ b/SisGPWeb/spec/models/projeto_spec.rb @@ -10,5 +10,10 @@ subject(:projeto) { Projeto.new(nome: "teste", descricao: "teste01", dataInicio: nil, dataFim: nil)} context "validations" do let(:user) {Usuario.create(:nome =>"test", :login=>"123455", :email=>"a@a.com",:password=>"123456", :password_confirmation=>"123456", :telefone=>"123456")} + + it "should add responsable" do + projeto.adicionar_dono(user.id) + expect((projeto.donos[1])).to equal(nil) + end end end
Create it of rspec projeto test
diff --git a/test/cases/queuing_test.rb b/test/cases/queuing_test.rb index abc1234..def5678 100644 --- a/test/cases/queuing_test.rb +++ b/test/cases/queuing_test.rb @@ -23,6 +23,7 @@ result = HelloJob.enqueue_at 1.second.ago, "Jamie" assert result rescue NotImplementedError + skip end end end
Make it clear that the later test is skipped for adapters that do not implement it
diff --git a/services/campfire.rb b/services/campfire.rb index abc1234..def5678 100644 --- a/services/campfire.rb +++ b/services/campfire.rb @@ -9,5 +9,6 @@ payload['commits'].each do |commit| room.speak "[#{repository}/#{branch}] #{commit['message']} - #{commit['author']['name']} (#{commit['url']})" end + room.leave campfire.logout end
Make sure we log out of the room before we try to logout of the service.
diff --git a/app/controllers/events_controller.rb b/app/controllers/events_controller.rb index abc1234..def5678 100644 --- a/app/controllers/events_controller.rb +++ b/app/controllers/events_controller.rb @@ -1,6 +1,6 @@ class EventsController < ApplicationController load_resource :find_by => :slug - load_and_authorize_resource :except => :index + load_and_authorize_resource :except => [:index, :previous] def index @current_events = Event.current.include_subevents
Remove auth requirement for event archive
diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index abc1234..def5678 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -9,7 +9,7 @@ if emails && groupName emails.each do |email| user = User.find_by(email: email) - if user + if user && user != creator group.members << user else return render json: {errors: "Invalid email(s)" }, status: 422 @@ -31,6 +31,7 @@ def joined_groups user = User.find(session[:user_id]) groups = user.groups + p groups render json: { groups: groups } end
Refactor group creation to refuse adding creator as a member
diff --git a/lib/poke/map.rb b/lib/poke/map.rb index abc1234..def5678 100644 --- a/lib/poke/map.rb +++ b/lib/poke/map.rb @@ -6,7 +6,7 @@ include Poke::ReadMap # Params required at initialization. - PARAMS_REQUIRED = {:map_file} + PARAMS_REQUIRED = [:map_file] # Creates a Map object. #
Fix PARAMS_REQUIRED const, should be an array, not a hash
diff --git a/libraries/s3.rb b/libraries/s3.rb index abc1234..def5678 100644 --- a/libraries/s3.rb +++ b/libraries/s3.rb @@ -14,7 +14,7 @@ def s3_obj require 'aws-sdk' - remote_path = new_resource.remote_path + remote_path = new_resource.remote_path.dup remote_path.sub!(%r{^/*}, '') Chef::Log.debug("Initializing the S3 Object for bucket: #{new_resource.bucket} path: #{remote_path}")
Resolve frozen string warning on Chef 13 Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
diff --git a/RMStore.podspec b/RMStore.podspec index abc1234..def5678 100644 --- a/RMStore.podspec +++ b/RMStore.podspec @@ -1,11 +1,11 @@ Pod::Spec.new do |s| s.name = "RMStore" - s.version = "0.2" + s.version = "0.3" s.license = "Apache 2.0" s.summary = "A lightweight iOS framework for In-App Purchases." s.homepage = "https://github.com/robotmedia/RMStore" s.author = 'Hermes Pique' - s.source = { :git => "https://github.com/robotmedia/RMStore.git", :tag => "{spec.version}" } + s.source = { :git => "https://github.com/robotmedia/RMStore.git", :tag => "#{s.version}" } s.platform = :ios, '5.0' s.source_files = 'RMStore' s.frameworks = 'StoreKit'
Fix podspec and increase version
diff --git a/spec/api_key_spec.rb b/spec/api_key_spec.rb index abc1234..def5678 100644 --- a/spec/api_key_spec.rb +++ b/spec/api_key_spec.rb @@ -10,19 +10,29 @@ describe APIKey do let( :apiKeyClass ) { APIKey } - it "sets the default key to nil" do - apiKeyClass.default_api_key.should be_nil + context "for the Class" do + it "sets the default key to nil" do + apiKeyClass.default_api_key.should be_nil + end + + describe "#default_api_key" do + it "allows a default key to be set" do + apiKeyClass.default_api_key = "a default key" + apiKeyClass.default_api_key.should == "a default key" + end + + it "retains only the last default key set" do + apiKeyClass.default_api_key = "a default key" + apiKeyClass.default_api_key.should == "a default key" + apiKeyClass.default_api_key = "new key set" + apiKeyClass.default_api_key.should == "new key set" + end + end end - it "allows a default key to be set" do - apiKeyClass.default_api_key = "a default key" - apiKeyClass.default_api_key.should == "a default key" - end - - it "retains only the last key set" do - apiKeyClass.default_api_key = "a default key" - apiKeyClass.default_api_key.should == "a default key" - apiKeyClass.default_api_key = "new key set" - apiKeyClass.default_api_key.should == "new key set" + context "as an instance" do + describe "#api_key" do + it "returns the class default key" + end end end
Add context to test cases.
diff --git a/test/minitest/fail_test.rb b/test/minitest/fail_test.rb index abc1234..def5678 100644 --- a/test/minitest/fail_test.rb +++ b/test/minitest/fail_test.rb @@ -0,0 +1,8 @@+require 'test_helper' + +class FailTest < ActiveSupport::TestCase + # uncomment if you would like to run failing test + #def test_failure + #assert_equal 1, 2 + #end +end
Add fail test example for minitest
diff --git a/spec/lib/cuttlefish_smtp_server_spec.rb b/spec/lib/cuttlefish_smtp_server_spec.rb index abc1234..def5678 100644 --- a/spec/lib/cuttlefish_smtp_server_spec.rb +++ b/spec/lib/cuttlefish_smtp_server_spec.rb @@ -5,7 +5,9 @@ describe '#receive_message' do it 'can queue large messages' do connection = CuttlefishSmtpConnection.new('') - connection.current.data = 'foobar' * 1000000 + # This data is still about double what should fit in a TEXT + # Something six times bigger than this causes mysql to lose connection on OS X for Matthew + connection.current.data = 'a' * 1000000 connection.receive_message end end
Patch up test that fails only on os x
diff --git a/korma.rb b/korma.rb index abc1234..def5678 100644 --- a/korma.rb +++ b/korma.rb @@ -24,11 +24,14 @@ def update(entity, columns, *predicates) binds = [] + column_sql = column_sql(columns, binds) where = predicates.any? ? ' WHERE ' : '' predicate_sql = column_sql(predicates, binds) - ["UPDATE #{entity.tablename} SET #{column_sql}#{where}#{predicate_sql}", binds] + sql = "UPDATE #{entity.tablename} SET #{column_sql}#{where}#{predicate_sql}" + + [sql, binds] end end
Use temp sql var to improve return val readability
diff --git a/features/step_definitions/cli_steps.rb b/features/step_definitions/cli_steps.rb index abc1234..def5678 100644 --- a/features/step_definitions/cli_steps.rb +++ b/features/step_definitions/cli_steps.rb @@ -36,3 +36,8 @@ # For some reason, Cucumber drops the last newline from every docstring... @output.string.should include expand(text + "\n") end + +Then 'it outputs progress like' do |pattern| + # For some reason, Cucumber drops the last newline from every docstring... + @output.string.should match Regexp.new(expand(pattern + "\n")) +end
Add a step to verify progress with a pattern
diff --git a/ruby_event_store-rom/spec/rom/adapters/memory/relations/stream_entries_spec.rb b/ruby_event_store-rom/spec/rom/adapters/memory/relations/stream_entries_spec.rb index abc1234..def5678 100644 --- a/ruby_event_store-rom/spec/rom/adapters/memory/relations/stream_entries_spec.rb +++ b/ruby_event_store-rom/spec/rom/adapters/memory/relations/stream_entries_spec.rb @@ -7,5 +7,36 @@ let(:rom_helper) { SpecHelper.new } it_behaves_like :stream_entries_relation, Relations::StreamEntries + + specify '#insert raises errors' do + relation = rom_helper.env.container.relations[:stream_entries] + + stream_entries = [ + {stream: 'stream', position: 0, event_id: id1 = SecureRandom.uuid}, + {stream: 'stream', position: 1, event_id: SecureRandom.uuid}, + {stream: 'stream', position: 2, event_id: SecureRandom.uuid} + ] + + relation.command(:create).call(stream_entries) + + conflicting_event_id = {stream: 'stream', position: 3, event_id: id1, created_at: Time.now} + + expect(relation.to_a.size).to eq(3) + expect do + relation.insert(conflicting_event_id) + end.to raise_error do |ex| + expect(ex).to be_a(RubyEventStore::ROM::TupleUniquenessError) + expect(ex.message).to eq("Uniquness violated for stream (\"stream\") and event_id (\"#{id1}\")") + end + + conflicting_position = {stream: 'stream', position: 2, event_id: SecureRandom.uuid, created_at: Time.now} + + expect do + relation.insert(conflicting_position) + end.to raise_error do |ex| + expect(ex).to be_a(RubyEventStore::ROM::TupleUniquenessError) + expect(ex.message).to eq("Uniquness violated for stream (\"stream\") and position (2)") + end + end end end
Add tests for uniquness exceptions in Memory adapter
diff --git a/db/data_migration/20200716103130_redirect_sage_policy_groups_to_org_page.rb b/db/data_migration/20200716103130_redirect_sage_policy_groups_to_org_page.rb index abc1234..def5678 100644 --- a/db/data_migration/20200716103130_redirect_sage_policy_groups_to_org_page.rb +++ b/db/data_migration/20200716103130_redirect_sage_policy_groups_to_org_page.rb @@ -0,0 +1,20 @@+SLUGS = %w[ + scientific-advisory-group-for-emergencies-sage + scientific-advisory-group-for-emergencies-sage-coronavirus-covid-19-response +].freeze + +REDIRECT_PATH = "/government/organisations/scientific-advisory-group-for-emergencies".freeze + +SLUGS.each do |slug| + group = PolicyGroup.find_by(slug: slug) + unless group + puts "could not find #{slug}" + next + end + + content_id = group.content_id + group.delete + PublishingApiRedirectWorker.new.perform(content_id, REDIRECT_PATH, "en") + + puts "#{slug} -> #{REDIRECT_PATH}" +end
Add data migration to redirect SAGE policy groups to org page
diff --git a/app/presenters/download_state.rb b/app/presenters/download_state.rb index abc1234..def5678 100644 --- a/app/presenters/download_state.rb +++ b/app/presenters/download_state.rb @@ -3,9 +3,10 @@ class DownloadState < Presenter STANDARD_COLUMNS = [ - {label: "Name", method: :name}, - {label: "URI", property: "ukhpi:refRegion"}, - {label: "GSS", method: :gss} + {label: "Name"}, + {label: "URI"}, + {label: "GSS"}, + {label: "Period"} ] @@ -14,14 +15,14 @@ end def rows - # TODO cmd.cmd.results.map {|r| as_row( r )} end def as_row( r ) uri = r["ukhpi:refRegion"]["@id"] region = Regions.lookup_region( uri ) + date = r["ukhpi:refPeriod"]["@value"] - [region.label, uri, region.gss] + visible_aspects.map {|a| r["ukhpi:#{a}"]} + [region.label, uri, region.gss, date] + visible_aspects.map {|a| r["ukhpi:#{a}"]} end end
Add date to CSV download
diff --git a/app/controllers/errors_controller.rb b/app/controllers/errors_controller.rb index abc1234..def5678 100644 --- a/app/controllers/errors_controller.rb +++ b/app/controllers/errors_controller.rb @@ -11,6 +11,7 @@ if Rails.application.config.whoopsie.enable report = params[:error_report] report.merge!(params[:extra]) if params[:extra] + report.merge!(headers: request.headers.to_h) ExceptionNotifier.notify_exception JavaScriptError.new(report["message"]), data: report render plain: "error acknowledged" else
Add request headers to JS error report
diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index abc1234..def5678 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -1,4 +1,9 @@ class PhotosController < ApplicationController def create + @photo = Photo.new + @photo.photo = params[:Filedata] + @photo.user_id = current_user.id + @photo.save + render text: @photo.photo.url end end
Add the create method for uploading the photo and return the url of the photo to the form.
diff --git a/app/controllers/pusher_controller.rb b/app/controllers/pusher_controller.rb index abc1234..def5678 100644 --- a/app/controllers/pusher_controller.rb +++ b/app/controllers/pusher_controller.rb @@ -1,11 +1,31 @@ class PusherController < ApplicationController def groupauth - response = Pusher[params[:channel_name]].authenticate(params[:socket_id], {user_id: current_user.id}) - render json: response + if authorize_presence_channel + response = Pusher[params[:channel_name]].authenticate(params[:socket_id], {user_id: current_user.id}) + render json: response + else + render :text => "Forbidden", :status => '403' + end end def auth - response = Pusher[params[:channel_name]].authenticate(params[:socket_id]) - render json: response + if authorize_private_channel + response = Pusher[params[:channel_name]].authenticate(params[:socket_id]) + render json: response + else + render :text => "Forbidden", :status => '403' + end + end + + private + + def authorize_presence_channel + channel_postfix = params[:channel_name].sub('presence-', '') + current_user.group.id == channel_postfix.to_i + end + + def authorize_private_channel + request = Request.find_by(id: params[:request_id]) + request.is_party_to?(current_user) end end
Add authentication of subscription to a channel in the Pusher Controller. This implements both presence channel authorization (used for the river) as well as private channel authorization (used for private messages).
diff --git a/app/controllers/review_controller.rb b/app/controllers/review_controller.rb index abc1234..def5678 100644 --- a/app/controllers/review_controller.rb +++ b/app/controllers/review_controller.rb @@ -5,11 +5,11 @@ # Once you are on the review dialog/page # all interaction with the web server is via the # differ-controller. - set_footer_info + set_bar_info @version = kata.schema.version @title = 'review:' + kata.id + @avatar_name = kata.avatar_name @avatar_index = kata.avatar_index - @avatar_name = kata.avatar_name @was_index = was_index @now_index = now_index @filename = params['filename'] @@ -19,8 +19,9 @@ private - def set_footer_info + def set_bar_info @id = kata.id + @group_id = kata.group.id @display_name = kata.manifest.display_name @exercise = kata.manifest.exercise end
Fix [dashboard] button on review/show page
diff --git a/app/controllers/robots_controller.rb b/app/controllers/robots_controller.rb index abc1234..def5678 100644 --- a/app/controllers/robots_controller.rb +++ b/app/controllers/robots_controller.rb @@ -2,6 +2,7 @@ # == RobotsController # class RobotsController < ActionController::Base + skip_before_action :set_optional_modules, :set_adult_validation, :set_menu_elements, :set_background, :set_host_name, :set_newsletter_user, :set_search_autocomplete, :set_slider, :set_socials_network layout false def index
Add skip_before_action to RobotsController to avoid unnecessary actions
diff --git a/app/controllers/static_controller.rb b/app/controllers/static_controller.rb index abc1234..def5678 100644 --- a/app/controllers/static_controller.rb +++ b/app/controllers/static_controller.rb @@ -1,4 +1,6 @@ class StaticController < ApplicationController + before_filter :require_user, :only => :follow + def homepage @list_class = "" render :layout => false @@ -15,4 +17,8 @@ def contact @title = "contact us" end + + def follow + @title = "follow a user" + end end
Add a title variable for the static 'follow' page and make sure logged out users shouldn't be able to access it without logging in.
diff --git a/app/models/spree/refund_decorator.rb b/app/models/spree/refund_decorator.rb index abc1234..def5678 100644 --- a/app/models/spree/refund_decorator.rb +++ b/app/models/spree/refund_decorator.rb @@ -4,15 +4,13 @@ delegate :pos_refunded, to: :reimbursement def perform! - if reimbursement.present? && pos_refunded? - return_all_inventory_unit!(reimbursement) - try_set_order_to_return!(reimbursement) - update_order + super unless pos_refunded? - return true - else - super - end + return_all_inventory_unit!(reimbursement) + try_set_order_to_return!(reimbursement) + update_order + + true end private
Use guard clause instead of if else statement
diff --git a/test/integration/user_search_test.rb b/test/integration/user_search_test.rb index abc1234..def5678 100644 --- a/test/integration/user_search_test.rb +++ b/test/integration/user_search_test.rb @@ -20,4 +20,22 @@ assert page.has_content? @guide.title end + + test "selecting another user" do + @guides = FactoryGirl.build_list(:guide_edition, 2) + other_user = FactoryGirl.create(:user, name: "Bob", uid: "bob") + + # Assigning manually so it doesn't show up in Alice's list too + @guides[0].assigned_to_id = other_user.id + @guides[0].save! + + visit "/admin/user_search" + select other_user.name, from: "Filter by user" + click_button "Filter" + wait_until { page.has_content? "User search" } + + assert page.has_content? @guides[0].title + refute page.has_content? @guides[1].title + end + end
Test viewing publications for another user.
diff --git a/arcanist.rb b/arcanist.rb index abc1234..def5678 100644 --- a/arcanist.rb +++ b/arcanist.rb @@ -3,11 +3,11 @@ class Arcanist < Formula resource "libphutil" do url "https://github.com/facebook/libphutil.git" - sha1 "" + sha256 "" end homepage "https://github.com/facebook/arcanist" head "git://github.com/facebook/arcanist.git" - sha1 "" + sha256 "" version "1" def install system "cp", "-r", ".", prefix
Use `sha256` instead of `sha1` ``` Error: Invalid formula: /usr/local/Homebrew/Library/Taps/ryfow/homebrew-phabricator/arcanist.rb Calling Resource#sha1 is disabled! Use Resource#sha256 instead. ```
diff --git a/db/data_migration/20130705084817_fix_somali_embassy.rb b/db/data_migration/20130705084817_fix_somali_embassy.rb index abc1234..def5678 100644 --- a/db/data_migration/20130705084817_fix_somali_embassy.rb +++ b/db/data_migration/20130705084817_fix_somali_embassy.rb @@ -0,0 +1,5 @@+# WorldwideOrganisations have an implicit office, which was already +# updated in 20130701154722_update_fco_embassy.rb. This cleans up the +# actual org we wanted to update. +wwo = WorldwideOrganisation.find_by_slug "british-office-for-somalia" +wwo.update_column(:slug, "british-embassy-mogadishu")
Fix Somalian embassy slug correctly https://www.pivotaltracker.com/story/show/51980679
diff --git a/app/controllers/fluentd/settings/histories_controller.rb b/app/controllers/fluentd/settings/histories_controller.rb index abc1234..def5678 100644 --- a/app/controllers/fluentd/settings/histories_controller.rb +++ b/app/controllers/fluentd/settings/histories_controller.rb @@ -22,7 +22,7 @@ if @fluentd.agent.dryrun flash = { success: t('messages.dryrun_is_passed') } else - flash = { danger: @fluentd.agent.recent_errors(1).first[:subject] } + flash = { danger: @fluentd.agent.log_tail(1).first } end redirect_to daemon_setting_history_path(params[:id]), flash: flash end
Revert "Ensure message as error" (logged_errors method is in the bug) This reverts commit 8571bb04ee46a0e26193fa6dfb5857813744ff89.
diff --git a/lib/generators/open_stax/rescue_from/install/templates/rescue_from.rb b/lib/generators/open_stax/rescue_from/install/templates/rescue_from.rb index abc1234..def5678 100644 --- a/lib/generators/open_stax/rescue_from/install/templates/rescue_from.rb +++ b/lib/generators/open_stax/rescue_from/install/templates/rescue_from.rb @@ -1,7 +1,7 @@ require 'rescue_from' OpenStax::RescueFrom.configure do |config| - config.raise_exceptions = !Rails.application.config.consider_all_requests_local + config.raise_exceptions = Rails.application.config.consider_all_requests_local # config.application_name = 'Tutor'
Fix the backwards asetting for raising exceptions
diff --git a/bosh-dev/lib/bosh/dev/tasks/bat.rake b/bosh-dev/lib/bosh/dev/tasks/bat.rake index abc1234..def5678 100644 --- a/bosh-dev/lib/bosh/dev/tasks/bat.rake +++ b/bosh-dev/lib/bosh/dev/tasks/bat.rake @@ -8,16 +8,17 @@ desc 'Run BAT tests' RSpec::Core::RakeTask.new(:bat) do |t| - cd 'bat' - t.pattern = %w[spec/env_spec.rb spec/bat/*_spec.rb] + bats_root = File.expand_path('../../../../../../bat', File.dirname(__FILE__)) + t.pattern = %W[#{bats_root}/spec/env_spec.rb #{bats_root}/spec/bat/*_spec.rb] t.rspec_opts = rspec_opts end + namespace :bat do desc 'Verify BAT environment' RSpec::Core::RakeTask.new(:env) do |t| - cd 'bat' - t.pattern = 'spec/env_spec.rb' + cd File.expand_path('../../../../../../bat', File.dirname(__FILE__)) + t.pattern = %W[#{bats_root}/spec/env_spec.rb] t.rspec_opts = rspec_opts end end
Use full path, working dir is not the project root on CI
diff --git a/test/mailers/unit_mail_test.rb b/test/mailers/unit_mail_test.rb index abc1234..def5678 100644 --- a/test/mailers/unit_mail_test.rb +++ b/test/mailers/unit_mail_test.rb @@ -18,4 +18,20 @@ assert_equal unit.active_projects.count + 1, ActionMailer::Base.deliveries.count end + def test_send_portfolio_ready_from_main_convenor + unit = FactoryBot.create :unit + convenor = FactoryBot.create :user, :convenor + + ur = unit.employ_staff convenor, Role.convenor + + unit.update main_convenor: ur + + project = unit.active_projects.first + + mail = PortfolioEvidenceMailer.portfolio_ready(project) + + assert_equal 1, mail.from().count + assert_equal convenor.email, mail.from().first + end + end
TEST: Check that portfolio ready comes from main convenor
diff --git a/db/migrate/20170630063557_register_functions_vector.rb b/db/migrate/20170630063557_register_functions_vector.rb index abc1234..def5678 100644 --- a/db/migrate/20170630063557_register_functions_vector.rb +++ b/db/migrate/20170630063557_register_functions_vector.rb @@ -5,7 +5,7 @@ command = "plugin_register functions/vector" case when Redmine::Database.postgresql? - execute("select pgroonga.command('#{command}')") + execute("select pgroonga_command('#{command}')") when Redmine::Database.mysql? execute("select mroonga_command('#{command}')") else @@ -16,7 +16,7 @@ command = "plugin_unregister functions/vector" case when Redmine::Database.postgresql? - execute("select pgroonga.command('#{command}')") + execute("select pgroonga_command('#{command}')") when Redmine::Database.mysql? execute("select mroonga_command('#{command}')") else
Use pgroonga_command instead of pgroonga.command
diff --git a/core/lib/spree/testing_support/factories/zone_factory.rb b/core/lib/spree/testing_support/factories/zone_factory.rb index abc1234..def5678 100644 --- a/core/lib/spree/testing_support/factories/zone_factory.rb +++ b/core/lib/spree/testing_support/factories/zone_factory.rb @@ -13,5 +13,9 @@ factory :zone, class: Spree::Zone do name { generate(:random_string) } description { generate(:random_string) } + + trait :with_country do + countries { [create(:country)] } + end end end
Add :with_country trait for Zone factory
diff --git a/ipsum.rb b/ipsum.rb index abc1234..def5678 100644 --- a/ipsum.rb +++ b/ipsum.rb @@ -5,7 +5,7 @@ require_relative 'headline.rb' class Ipsum - def text_paragraph(options={}) + def self.text_paragraph(options={}) paragraph = Paragraph.new( min_sentences: options[:min_sentences], max_sentences: options[:max_sentences]) @@ -13,7 +13,7 @@ TextParagraph.new(paragraph: paragraph) end - def html_paragraph(options={}) + def self.html_paragraph(options={}) paragraph = Paragraph.new( min_sentences: options[:min_sentences], max_sentences: options[:max_sentences]) @@ -22,7 +22,7 @@ HtmlParagraph.new(paragraph: paragraph, links: links) end - def haml_paragraph(options={}) + def self.haml_paragraph(options={}) paragraph = Paragraph.new( min_sentences: options[:min_sentences], max_sentences: options[:max_sentences]) @@ -31,28 +31,7 @@ HamlParagraph.new(paragraph: paragraph, links: links) end - def headline(options={}) + def self.headline(options={}) Headline.new(options).complete_text end - - private - - def paragraph - Paragraph.new( - min_sentences: options[:min_sentences], - max_sentences: options[:max_sentences]) - end end - -ipsum = Ipsum.new -ipsum.text_paragraph -ipsum.text_paragraph min_sentences: 3, max_sentences: 4 - -ipsum.html_paragraph -ipsum.html_paragraph links: true, min_sentences: 3, max_sentences: 4 - -ipsum.haml_paragraph -ipsum.haml_paragraph min_sentences: 3, max_sentences: 4, links: true - -ipsum.headline min_words: 3, max_words: 4 -ipsum.headline period: true
Use class methods in Ipsum class Also remove executable testing code.
diff --git a/test/integration/configuration/serverspec/localhost/configure_spec.rb b/test/integration/configuration/serverspec/localhost/configure_spec.rb index abc1234..def5678 100644 --- a/test/integration/configuration/serverspec/localhost/configure_spec.rb +++ b/test/integration/configuration/serverspec/localhost/configure_spec.rb @@ -17,15 +17,7 @@ it { should be_mode 644 } end - describe file('/etc/init.d/kafka') do - it { should be_a_file } - it { should be_owned_by('root') } - it { should be_grouped_into('root') } - it { should be_mode 755 } - end - describe service('kafka') do - let(:path) { '/sbin:/usr/sbin' } it { should be_enabled } end end
Remove init file requirement from configuration integration test
diff --git a/test/features/create_overheards_test.rb b/test/features/create_overheards_test.rb index abc1234..def5678 100644 --- a/test/features/create_overheards_test.rb +++ b/test/features/create_overheards_test.rb @@ -1,4 +1,5 @@ require_relative 'helper' + class TestCreateOverheards < FeatureTest def test_creating_a_valid_overheard random_fake_quote = Faker::Lorem.sentence @@ -10,4 +11,17 @@ assert_content random_fake_quote end + + def test_creating_an_invalid_overheard + visit "/" + click_on "Add Overheard" + + click_on "Create Overheard" + + assert_equal "/overheards", page.current_path + # We want to stay on the /overheards page and re-show the form. + + assert_content "Body cannot be empty" + # Prove we see an error message + end end
Test creating an invalid overheard Our test trys to create an overheard without a body. In this case, we want our user to stay on the same page and see a nice error message. Unfortunately, it looks like we redirect to "/" even if the user doesn't provide a body. How sad!
diff --git a/lib/plugins/extension_patches/lib/routing_extension.rb b/lib/plugins/extension_patches/lib/routing_extension.rb index abc1234..def5678 100644 --- a/lib/plugins/extension_patches/lib/routing_extension.rb +++ b/lib/plugins/extension_patches/lib/routing_extension.rb @@ -9,19 +9,9 @@ base.class_eval do alias :draw_without_plugin_routes :draw alias :draw :draw_with_plugin_routes - alias :rails_reload :reload - alias :reload :force_reload end end - def force_reload - if RAILS_ENV == 'development' - load! - else - rails_reload - end - end - def draw_with_plugin_routes draw_without_plugin_routes do |mapper| add_extension_routes(mapper)
Revert "Revert "Backported change from radiant CMS to fix extension routes loading."" This reverts commit f7b4439ba38a2f67ef7509d014227f3070a766d4.
diff --git a/spec/support/capybara/custom_extensions.rb b/spec/support/capybara/custom_extensions.rb index abc1234..def5678 100644 --- a/spec/support/capybara/custom_extensions.rb +++ b/spec/support/capybara/custom_extensions.rb @@ -23,7 +23,7 @@ raise "Element still moving after #{checks} checks" if check == checks current = native.location - sleep 0.2 if ENV['CI'] + sleep 0.2 break if previous == current previous = current
Maintenance: Make login clue check Capybara system tests more robust in local environments.
diff --git a/Applications/projectb.rb b/Applications/projectb.rb index abc1234..def5678 100644 --- a/Applications/projectb.rb +++ b/Applications/projectb.rb @@ -6,7 +6,7 @@ cmake do option :BUILD_WITH_A, :BOOLEAN, desc: 'Build with A' - option :ProjectA_DIR, :PATH, cond: :BUILD_WITH_A, default: ProjectA.new.prefix.join('share', 'projecta', 'cmake').to_s + option :ProjectA_DIR, :PATH, cond: :BUILD_WITH_A, default: lambda { ProjectA.new.prefix.join('share', 'projecta', 'cmake').to_s } end ctest
Read the prefix of another project must be delayed
diff --git a/app/models/spree/bp_order_row.rb b/app/models/spree/bp_order_row.rb index abc1234..def5678 100644 --- a/app/models/spree/bp_order_row.rb +++ b/app/models/spree/bp_order_row.rb @@ -18,7 +18,7 @@ magnitude: @line_item.quantity }, rowValue: { - taxCode: 'T', + taxCode: 'T4', rowNet: { currencyCode: Spree::Config[:currency], value: @line_item.price.to_f @@ -31,4 +31,4 @@ } end end -end+end
Use T4 taxCode by default
diff --git a/Casks/rstudio-preview.rb b/Casks/rstudio-preview.rb index abc1234..def5678 100644 --- a/Casks/rstudio-preview.rb +++ b/Casks/rstudio-preview.rb @@ -1,7 +1,7 @@ class RstudioPreview < Cask - url 'https://s3.amazonaws.com/rstudio-dailybuilds/RStudio-0.98.806.dmg' + url 'https://s3.amazonaws.com/rstudio-dailybuilds/RStudio-0.98.932.dmg' homepage 'http://www.rstudio.com/ide/download/preview' - version '0.98.806' - sha256 'a6a20ef021c10d395aeeb1057a69d8da9e349a7aa9b6a9e44df76767299b22a5' + version '0.98.932' + sha256 'ca652a4afd70eeb6cc7d5a016312ba535f0a000f97deec6e2367503045666c1e' link 'RStudio.app' end
Update RStudio preview to version 0.98.932
diff --git a/test/sepa/banks/op/op_renew_cert_request_soap_builder_test.rb b/test/sepa/banks/op/op_renew_cert_request_soap_builder_test.rb index abc1234..def5678 100644 --- a/test/sepa/banks/op/op_renew_cert_request_soap_builder_test.rb +++ b/test/sepa/banks/op/op_renew_cert_request_soap_builder_test.rb @@ -0,0 +1,26 @@+require 'test_helper' + +class OpRenewCertRequestSoapBuilderTest < ActiveSupport::TestCase + setup do + @params = op_renew_certificate_params + + # Convert the keys here since the conversion is usually done by the client and these tests + # bypass the client + @params[:own_signing_certificate] = x509_certificate(@params[:own_signing_certificate]) + @params[:signing_private_key] = rsa_key(@params[:signing_private_key]) + + @doc = Nokogiri::XML(Sepa::SoapBuilder.new(@params).to_xml) + end + + test "validates against schema" do + assert_valid_against_schema 'soap.xsd', @doc + end + + test 'application request is inserted properly' do + ar_node = @doc.at("xmlns|ApplicationRequest", xmlns: 'http://mlp.op.fi/OPCertificateService') + ar_doc = Nokogiri::XML(decode(ar_node.content)) + + assert ar_doc.respond_to?(:canonicalize) + assert_equal @params[:customer_id], ar_doc.at_css("CustomerId").content + end +end
Add OP renew cert soap test
diff --git a/spec/conversation_spec.rb b/spec/conversation_spec.rb index abc1234..def5678 100644 --- a/spec/conversation_spec.rb +++ b/spec/conversation_spec.rb @@ -10,18 +10,15 @@ context 'when clicking on the Outdated Diff Comments buttons' do it 'shows and hides the comments on the outdated diffs' do - outdated_comments = driver.find_elements(:css, '#r55944545, #discussion_r84420650') + driver.find_element(:class, 'epr-show-outdated-comments').click + outdated_comment = nil + Selenium::WebDriver::Wait.new.until do + outdated_comment = driver.find_element(:id, 'discussion_r84420650') + end + expect(outdated_comment).to be_displayed - [ - ['epr-show-outdated-comments', true], - ['epr-hide-outdated-comments', false], - ].each do |class_name, displayed| - expect { - driver.find_element(:class, class_name).click - }.to change { - outdated_comments.map(&:displayed?).uniq - }.from([!displayed]).to([displayed]) - end + driver.find_element(:class, 'epr-hide-outdated-comments').click + expect(outdated_comment).not_to be_displayed end end end
Fix outdated diff comments test It looks like GitHub now loads some of these outdated comments via AJAX and not on the initial page load.
diff --git a/stateful_enum.gemspec b/stateful_enum.gemspec index abc1234..def5678 100644 --- a/stateful_enum.gemspec +++ b/stateful_enum.gemspec @@ -24,4 +24,5 @@ spec.add_development_dependency "minitest", "~> 5.0" spec.add_development_dependency 'rails' spec.add_development_dependency 'sqlite3' + spec.add_development_dependency 'ruby-graphviz' end
Add 'ruby-graphviz' gem to development_dependency When `bundle exec rake` to run tests locally, ruby-graphviz is needed. Sure `bundle exec rake test:all` ensures the gem is installed for all rails versions, but `bundle exec rake test` (the default task) fails without 'ruby-graphviz'.
diff --git a/spec/models/users_spec.rb b/spec/models/users_spec.rb index abc1234..def5678 100644 --- a/spec/models/users_spec.rb +++ b/spec/models/users_spec.rb @@ -4,7 +4,7 @@ describe "associations" do it { should have_many(:initiated_conversations).with_foreign_key 'initiator_id' } - it { should have_many(:received_conversations).with_foreign_key 'received_id' } + it { should have_many(:received_conversations).with_foreign_key 'receiver_id' } # For some reason the PM one isn't working even though shoulda has methods for both dependent destroy and foreign keys, so ¯\_(ツ)_/¯ it { should have_many(:sent_stars) } it { should have_many(:received_stars) }
Fix typo in user model test
diff --git a/peddler.gemspec b/peddler.gemspec index abc1234..def5678 100644 --- a/peddler.gemspec +++ b/peddler.gemspec @@ -11,6 +11,7 @@ gem.homepage = 'http://github.com/hakanensari/peddler' gem.summary = %q{Wraps the Amazon MWS APIs} gem.description = %q{A Ruby interface to the Amazon MWS API} + gem.license = 'MIT' gem.files = Dir.glob('lib/**/*') + %w(LICENSE README.md) gem.test_files = Dir.glob('test/**/*')
Add license to gem spec
diff --git a/AmazeKit.podspec b/AmazeKit.podspec index abc1234..def5678 100644 --- a/AmazeKit.podspec +++ b/AmazeKit.podspec @@ -1,11 +1,11 @@ Pod::Spec.new do |s| s.name = 'AmazeKit' - s.version = '0.0.2' + s.version = '0.1.0' s.authors = {'Jeff Kelley' => 'SlaunchaMan@gmail.com'} s.license = 'Proprietary' s.homepage = 'https://github.com/detroit-labs/AmazeKit' s.summary = 'AmazeKit is a library for rendering beautiful images in your iOS app' - s.source = { :git => 'git@github.com:detroit-labs/AmazeKit.git', :tag => '0.0.2' } + s.source = { :git => 'git@github.com:detroit-labs/AmazeKit.git', :tag => '0.1.0' } s.platform = :ios s.source_files = 'AmazeKit/AmazeKit/*.{h,m}' end
Correct version number in podspec file.
diff --git a/deadly_serious.gemspec b/deadly_serious.gemspec index abc1234..def5678 100644 --- a/deadly_serious.gemspec +++ b/deadly_serious.gemspec @@ -4,20 +4,22 @@ require 'deadly_serious/version' Gem::Specification.new do |spec| - spec.name = "deadly_serious" + spec.name = 'deadly_serious' spec.version = DeadlySerious::VERSION - spec.authors = ["Ronie Uliana"] - spec.email = ["ronie.uliana@gmail.com"] + spec.authors = ['Ronie Uliana'] + spec.email = ['ronie.uliana@gmail.com'] spec.description = %q{Flow Based Programming Engine mechanically sympathetic to *nix.} - spec.summary = %q{Flow Based Programming engine that relies on named pipes and Linux processes (sorry, it not works on Windows right now). That means it uses "mechanical sympathy" with the Operating System, i.e., the S.O. is *part* of the program, it's not something *below* it.} - spec.homepage = "https://github.com/ruliana/deadly_serious" - spec.license = "MIT" + spec.summary = %q{Flow Based Programming engine that relies on named pipes and Linux processes (sorry, it not works on Windows right now). That means it uses 'mechanical sympathy' with the Operating System, i.e., the S.O. is *part* of the program, it's not something *below* it.} + spec.homepage = 'https://github.com/ruliana/deadly_serious' + spec.license = 'MIT' spec.files = `git ls-files`.split($/) spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) - spec.require_paths = ["lib"] + spec.require_paths = ['lib'] - spec.add_development_dependency "bundler", "~> 1.3" - spec.add_development_dependency "rake" + spec.add_development_dependency 'bundler', '~> 1.3' + spec.add_development_dependency 'rake' + + spec.add_dependency 'json' end
Add "json" gem as dependency
diff --git a/cookbooks/rails/recipes/databases.rb b/cookbooks/rails/recipes/databases.rb index abc1234..def5678 100644 --- a/cookbooks/rails/recipes/databases.rb +++ b/cookbooks/rails/recipes/databases.rb @@ -10,18 +10,18 @@ if app_info['database_info'] database_info = app_info['database_info'] + database_name = app_info['database_info']['database'] mysql_connection_info = {:host => "localhost", :username => "root", :password => node['mysql']['server_root_password']} - mysql_database database_info['database'] do + mysql_database database_name do connection(mysql_connection_info) end - mysql_database_user app do + mysql_database_user database_name do connection(mysql_connection_info) username database_info['username'] password database_info['password'] - database_name database_info['database'] table "*" host "localhost" action :grant
Update database cookbook with correct database info.
diff --git a/spec/threasy/work_spec.rb b/spec/threasy/work_spec.rb index abc1234..def5678 100644 --- a/spec/threasy/work_spec.rb +++ b/spec/threasy/work_spec.rb @@ -6,6 +6,10 @@ end describe "#enqueue" do + it "should have a method for enqueing" do + expect(@work.respond_to?(:enqueue)).to be_true + end + it "should allow a job object to be enqueued and worked" do job = double("job") expect(job).to receive(:perform).once
Add simple spec to test webhooks
diff --git a/modules/govuk_docker/spec/classes/govuk_docker_spec.rb b/modules/govuk_docker/spec/classes/govuk_docker_spec.rb index abc1234..def5678 100644 --- a/modules/govuk_docker/spec/classes/govuk_docker_spec.rb +++ b/modules/govuk_docker/spec/classes/govuk_docker_spec.rb @@ -0,0 +1,8 @@+require_relative '../../../../spec_helper' + +describe 'govuk_docker', :type => :class do + + it { is_expected.to compile } + + it { is_expected.to compile.with_all_deps } +end
Add basic compile tests for the new class.
diff --git a/config/schedule.rb b/config/schedule.rb index abc1234..def5678 100644 --- a/config/schedule.rb +++ b/config/schedule.rb @@ -21,3 +21,7 @@ rake 'clear_expired_sessions' rake 'clear_old_mappings_batches' end + +every :day, at: ['12:30am', '12:30pm'] do + rake 'import:hits:refresh_materialized' +end
Refresh materialized views twice a day * Why twice? Because it's relatively cheap and I don't like the thought of all hits, all-time being increasingly inaccurate as the day goes on (especially if traffic spikes are likely)
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 @@ -6,20 +6,20 @@ def word_for_change(change) case change.downcase - when 'a' then return 'Added' - when 'd' then return 'Deleted' - when 'm' then return 'Modified' - when 'mv' then return 'Moved' - when 'cp' then return 'Copied' + when 'a' then 'Added' + when 'd' then 'Deleted' + when 'm' then 'Modified' + when 'mv' then 'Moved' + when 'cp' then 'Copied' else return change end end def highlight_as(filename) case filename.split('.').last.downcase - when 'js', 'as' then return 'javascript' - when 'rb', 'rakefile' then return 'ruby' - when 'rhtml', 'erb', 'html', 'xml' then return 'html' + when 'js', 'as' then 'javascript' + when 'rb', 'rakefile' then 'ruby' + when 'rhtml', 'erb', 'html', 'xml' then 'html' else 'plain' end end
Remove returns from case statements git-svn-id: 00255c29502d8dc24a666882d37304e67b560e94@1520 8456e5f2-bb15-0410-bd20-b44782a1fb1e
diff --git a/lib/scrapescrobbler/listener.rb b/lib/scrapescrobbler/listener.rb index abc1234..def5678 100644 --- a/lib/scrapescrobbler/listener.rb +++ b/lib/scrapescrobbler/listener.rb @@ -45,7 +45,7 @@ end lastfm = Lastfm.new Config['api_key'], Config['api_secret'] - lastfm.session = Config['session'] + lastfm.session = Config['session']['key'] lastfm end end
Update session key management for lastfm 1.5.1.
diff --git a/lib/gui.rb b/lib/gui.rb index abc1234..def5678 100644 --- a/lib/gui.rb +++ b/lib/gui.rb @@ -0,0 +1,86 @@+require 'gosu' +require_relative 'world.rb' + +class GameOfLifeWindow < Gosu::Window + + def initialize(width=500, height=500) + @width = width + @height = height + super width, height, false + self.caption = "Conway's Game of Life by Sparsh Saxena" + + # Colors + @background_color = Gosu::Color.new(0xffdedede) + @alive_color = Gosu::Color.new(0xff121212) + @dead_color = Gosu::Color.new(0xffededed) + + # Game + @grid_size = 20 + @col_width = width / @grid_size + @row_height = height / @grid_size + + @world = World.new(@grid_size) + @world.grid.randomly_populate + + @generation = 0 + end + + def update + @world.update_world + @generation += 1 + puts "Generation No: #{@generation}" + end + + def draw + draw_background + + @world.grid.cells.each do |row_cells| + row_cells.each do |cell| + x_start = cell.x * @col_width + y_start = cell.y * @row_height + if cell.is_alive? + draw_alive_cell(x_start, y_start) + else + draw_dead_cell(x_start, y_start) + end + end + end + + end + + def button_down(id) + case id + when Gosu::KbSpace + @world.grid.randomly_populate + when Gosu::KbEscape + close + end + end + + def needs_cursor?; true; end + + def draw_background + draw_quad(0, 0, @background_color, + width, 0, @background_color, + width, height, @background_color, + 0, height, @background_color) + end + + def draw_alive_cell(x_start, y_start) + draw_quad(x_start, y_start, @alive_color, + x_start+(@col_width-1), y_start, @alive_color, + x_start+(@col_width-1), y_start+(@row_height-1), @alive_color, + x_start, y_start+(@row_height-1), @alive_color) + end + + def draw_dead_cell(x_start, y_start) + draw_quad(x_start, y_start, @dead_color, + x_start+(@col_width-1), y_start, @dead_color, + x_start+(@col_width-1), y_start+(@row_height-1), @dead_color, + x_start, y_start+(@row_height-1), @dead_color) + end + +end + +# This Gosu GUI implementation is taken from: +# www.github.com/derekbarber/game_of_life/blob/master/gosu.rb
Add GUI for the game This uses Gosu library for ruby.
diff --git a/oboe.gemspec b/oboe.gemspec index abc1234..def5678 100644 --- a/oboe.gemspec +++ b/oboe.gemspec @@ -13,7 +13,7 @@ s.extra_rdoc_files = ["LICENSE"] s.files = `git ls-files`.split("\n") s.extensions = ['ext/oboe_metal/extconf.rb'] - s.test_files = Dir.glob("{spec}/**/*.rb") + s.test_files = Dir.glob("{test}/**/*.rb") s.add_development_dependency 'rake' s.add_development_dependency 'minitest' s.add_development_dependency 'bson'
Update gemspec to include new test files.
diff --git a/test/linked_rails.rb b/test/linked_rails.rb index abc1234..def5678 100644 --- a/test/linked_rails.rb +++ b/test/linked_rails.rb @@ -17,6 +17,13 @@ rescue LoadError end +if defined?(Rails::Application) # Rails 3 + class TestApp < Rails::Application + config.root = File.join(File.dirname(__FILE__), "../..") + end + Rails.application = TestApp +end + ActionController::Base.logger = Logger.new(nil) # Load plugins from test/plugins.
Make tests Rails 3 compatible.
diff --git a/APESuperHUD.podspec b/APESuperHUD.podspec index abc1234..def5678 100644 --- a/APESuperHUD.podspec +++ b/APESuperHUD.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "APESuperHUD" s.summary = "A simple way to display a HUD with a message or progress information in your application." - s.version = "1.1" + s.version = "1.1.1" s.homepage = "https://github.com/apegroup/APESuperHUD" s.license = 'MIT' s.author = { "apegroup AB" => "support@apegroup.com" }
Update pod spec with new version number
diff --git a/lib/rom.rb b/lib/rom.rb index abc1234..def5678 100644 --- a/lib/rom.rb +++ b/lib/rom.rb @@ -1,3 +1,4 @@+require 'descendants_tracker' require 'equalizer' require 'inflecto'
Revert "No need to require unused DescendantsTracker" It breaks the build because of missing ThreadSafe? Needs further investigation. This reverts commit 6565b89ea70b377981a0e19e98bedf989bbfb62e.
diff --git a/HSClusterMapView.podspec b/HSClusterMapView.podspec index abc1234..def5678 100644 --- a/HSClusterMapView.podspec +++ b/HSClusterMapView.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "HSClusterMapView" - s.version = "1.0.4" + s.version = "1.0.5" s.summary = "A GMSMapView subclass which clusters GMSMarkers within close proximity." s.description = "A GMSMapView subclass which clusters groups of GMSMarkers and replaces them with single GMSMarkers, enabling the developer to generate custom UIImages for each cluster on the fly. It also includes a GMSMapView subclass, HSMapView, which does not cluster GMSMarkers, but instead keeps track of the GMSMarkers on the map internally, eliminating the need to store them elsewhere. HSMapView aims to provide a clean map interface to work with the Google Maps for iOS SDK." s.homepage = "https://github.com/hotschedules/HSClusterMapView"
Update .podspec for 1.0.5 release
diff --git a/providers/apt_repository.rb b/providers/apt_repository.rb index abc1234..def5678 100644 --- a/providers/apt_repository.rb +++ b/providers/apt_repository.rb @@ -27,7 +27,7 @@ mode "0644" variables( :name => name, - :config => new_resource.config.gsub(/^ */,''), + :config => new_resource.config.gsub(/^ */,'') ) cookbook "sys" notifies :run, "execute[#{apt_update}]", :immediately
Remove trailing comma that fools Ruby 1.8 parser
diff --git a/Casks/mini-metro.rb b/Casks/mini-metro.rb index abc1234..def5678 100644 --- a/Casks/mini-metro.rb +++ b/Casks/mini-metro.rb @@ -1,7 +1,7 @@ class MiniMetro < Cask - url 'http://static.dinopoloclub.com/minimetro/builds/alpha9/MiniMetro-alpha9d-osx.zip' + url 'http://static.dinopoloclub.com/minimetro/builds/alpha9/MiniMetro-alpha9e-osx.zip' homepage 'http://dinopoloclub.com/minimetro/' - version 'Alpha 9d' - sha256 '6ab2aa60fe4d65f347b2277ebb6ddb3712ef1efa30c8489cc559e5d9f817881b' - link 'MiniMetro-alpha9d-osx.app', :target => 'Mini Metro.app' + version 'Alpha 9e' + sha256 'd2261a4e2ab6d71114af99524fa86c590b66f880c32c8546d556a2b80cc0be16' + link 'MiniMetro-alpha9e-osx.app', :target => 'Mini Metro.app' end
Update mini metro to Aplha 9e
diff --git a/Casks/slack-beta.rb b/Casks/slack-beta.rb index abc1234..def5678 100644 --- a/Casks/slack-beta.rb +++ b/Casks/slack-beta.rb @@ -1,8 +1,8 @@ class SlackBeta < Cask - version '0.60 (1700)' - sha256 '9245059fdad7914ec911eea121bcca5ccf716ea7b2fbeadc707e618692db89a1' + version '0.69 (2350)' + sha256 '7a6be7418e27970b38f20c8e2516386e346e7b731ee814d15f5a40794b440cdd' - url 'https://rink.hockeyapp.net/api/2/apps/06bd6493684f65a3b8f47aca92c9006e/app_versions/8?format=zip&avtoken=06be73491158dac7555587b2b79f9897a8b4827d' + url 'https://rink.hockeyapp.net/api/2/apps/06bd6493684f65a3b8f47aca92c9006e/app_versions/14?format=zip&avtoken=991dc9c0a3318d490712fb26e821ff2ab0a5fe24' homepage 'https://slack.com/' license :closed
Upgrade Slack Beta to 0.69 (2350).
diff --git a/cookbooks/ruby/attributes/default.rb b/cookbooks/ruby/attributes/default.rb index abc1234..def5678 100644 --- a/cookbooks/ruby/attributes/default.rb +++ b/cookbooks/ruby/attributes/default.rb @@ -1,6 +1,6 @@-default[:ruby][:version] = if node[:lsb][:release].to_f < 20.04 - "2.5" +default[:ruby][:version] = if node[:lsb][:release].to_f < 22.04 + "2.7" else - "2.7" + "3.0" end default[:ruby][:bundle] = "/usr/bin/bundle#{node[:ruby][:version]}"
Use ruby 3.0 on Ubuntu 22.04
diff --git a/lib/background_runner.rb b/lib/background_runner.rb index abc1234..def5678 100644 --- a/lib/background_runner.rb +++ b/lib/background_runner.rb @@ -29,7 +29,7 @@ # background jobs. def self.runner - BackgroundRunner.const_get Squash::Configuration.concurrency.background_runner.to_sym + BackgroundRunner.const_get Squash::Configuration.concurrency.background_runner.to_sym, false end # Shortcut for `BackgroundRunner.runner.run`.
Fix load issue with background runners
diff --git a/Casks/sequel-pro-nightly.rb b/Casks/sequel-pro-nightly.rb index abc1234..def5678 100644 --- a/Casks/sequel-pro-nightly.rb +++ b/Casks/sequel-pro-nightly.rb @@ -1,8 +1,8 @@ cask :v1 => 'sequel-pro-nightly' do - version '4293' - sha256 '8d75ee4c5198de7bfde6a3fb5578812c1dbe13e08f6451dc219f31fc0d3ef722' + version '36c6eeb3a2' + sha256 '3a74e3c37fec5118a3576c8fa00fce2962b0b14335a2e71f4aa35b064578a6c3' - url 'http://nightly.sequelpro.com/builds/Sequel_Pro_r0c2ea8b95e.dmg' + url 'http://nightly.sequelpro.com/builds/Sequel_Pro_r36c6eeb3a2.dmg' homepage 'http://nightly.sequelpro.com/' license :unknown
Upgrade Sequel Pro.app from 0c2ea8b95e to f36c6eeb3a2
diff --git a/lib/botr/http/uri_ext.rb b/lib/botr/http/uri_ext.rb index abc1234..def5678 100644 --- a/lib/botr/http/uri_ext.rb +++ b/lib/botr/http/uri_ext.rb @@ -0,0 +1,28 @@+module URI + + # FIX: For some reason, the Bits on the Run API doesn't support the encoding + # of spaces to "+". As such, (ASCII space) will encode to "%20". + TBLENCWWWCOMP__ = TBLENCWWWCOMP_.dup + TBLENCWWWCOMP__[' '] = '%20' + TBLENCWWWCOMP__.freeze + + def self.encode_www_form_component(str, enc=nil) + str = str.to_s.dup + + if str.encoding != Encoding::ASCII_8BIT + if enc && enc != Encoding::ASCII_8BIT + str.encode!(Encoding::UTF_8, invalid: :replace, undef: :replace) + str.encode!(enc, fallback: ->(x){"&#{x.ord};"}) + end + str.force_encoding(Encoding::ASCII_8BIT) + end + str.gsub!(/[^*\-.0-9A-Z_a-z]/, TBLENCWWWCOMP__) + str.force_encoding(Encoding::US_ASCII) + end + + def self.decode_www_form_component(str, enc=Encoding::UTF_8) + raise ArgumentError, "invalid %-encoding (#{str})" unless /\A[^%]*(?:%\h\h[^%]*)*\z/ =~ str + str.b.gsub(/\+|%\h\h/, TBLENCWWWCOMP__).force_encoding(enc) + end + +end
Patch URI to encode ASCII spaces as "%20".
diff --git a/templates/test_job.rb b/templates/test_job.rb index abc1234..def5678 100644 --- a/templates/test_job.rb +++ b/templates/test_job.rb @@ -1,4 +1,4 @@-# To queue with resque-scheduler: TestJob.wait(5.second).perform_later +# To queue with resque-scheduler: TestJob.wait(5.seconds).perform_later class TestJob < ApplicationJob queue_as :default
Fix typo in test job
diff --git a/Formula/cfitsio.rb b/Formula/cfitsio.rb index abc1234..def5678 100644 --- a/Formula/cfitsio.rb +++ b/Formula/cfitsio.rb @@ -1,4 +1,10 @@ require 'formula' + +class CfitsioExamples < Formula + url 'http://heasarc.gsfc.nasa.gov/docs/software/fitsio/cexamples/cexamples.zip' + md5 '31a5f5622a111f25bee5a3fda2fdac28' + version '2010.08.19' +end class Cfitsio < Formula url 'ftp://heasarc.gsfc.nasa.gov/software/fitsio/c/cfitsio3280.tar.gz' @@ -6,10 +12,33 @@ md5 'fdb9c0f51678b47e78592c70fb5dc793' version '3.28' + def options + [ + ['--with-examples', "Compile and install example programs from http://heasarc.gsfc.nasa.gov/docs/software/fitsio/cexamples.html as well as fpack and funpack"] + ] + end + def install # --disable-debug and --disable-dependency-tracking are not recognized by configure system "./configure", "--prefix=#{prefix}" system "make shared" system "make install" + + if ARGV.include? '--with-examples' + system "make fpack funpack" + bin.install ['fpack', 'funpack'] + + # fetch, compile and install examples programs + CfitsioExamples.new.brew do + mkdir 'bin' + Dir.glob('*.c').each do |f| + # compressed_fits.c does not work (obsolete function call) + if f != 'compress_fits.c' + system "#{ENV.compiler} #{f} -I#{include} -L#{lib} -lcfitsio -lm -o bin/#{f.sub('.c','')}" + end + end + bin.install Dir['bin/*'] + end + end end end
CFitsIO: Add option to install example programs Added the option --with-examples to the cfitsio formula, that downloads, compiles and installs some useful programs, like listhead, modhead, etc. Signed-off-by: Charlie Sharpsteen <828d338a9b04221c9cbe286f50cd389f68de4ecf@sharpsteen.net>
diff --git a/lib/octostar/services/new_project_saver.rb b/lib/octostar/services/new_project_saver.rb index abc1234..def5678 100644 --- a/lib/octostar/services/new_project_saver.rb +++ b/lib/octostar/services/new_project_saver.rb @@ -7,12 +7,11 @@ def call(id) account = account_repo.find_with_projects(id) project_names = account.projects.map(&:name) - projects = StarredProjectsGetter.new.call(account) + projects = StarredProjectsGetter.new + .call(account) + .select { |p| !project_names.include?(p[:name]) } - projects.each do |project| - next if project_names.include?(project[:name]) - project_repo.create(project) - end + project_repo.create(projects) end private
Save all repos as a bulk
diff --git a/lib/vcr/cassette/serializers/compressed.rb b/lib/vcr/cassette/serializers/compressed.rb index abc1234..def5678 100644 --- a/lib/vcr/cassette/serializers/compressed.rb +++ b/lib/vcr/cassette/serializers/compressed.rb @@ -28,7 +28,7 @@ # @return [String] the compressed cassette data def serialize(hash) string = VCR::Cassette::Serializers::YAML.serialize(hash) - Zlib.deflate(string) + Zlib::Deflate.deflate(string) end # Deserializes the given compressed cassette data. @@ -36,7 +36,7 @@ # @param [String] string the compressed YAML cassette data # @return [Hash] the deserialized object def deserialize(string) - yaml = Zlib.inflate(string) + yaml = Zlib::Inflate.inflate(string) VCR::Cassette::Serializers::YAML.deserialize(yaml) end end
Fix Zlib use to work under JRuby
diff --git a/lib/mymoip/validators.rb b/lib/mymoip/validators.rb index abc1234..def5678 100644 --- a/lib/mymoip/validators.rb +++ b/lib/mymoip/validators.rb @@ -3,12 +3,10 @@ private def valid_url?(url) - begin - uri = URI.parse(url) - uri.kind_of?(URI::HTTP) or uri.kind_of?(URI::HTTPS) - rescue URI::InvalidURIError - false - end + uri = URI.parse(url) + uri.kind_of?(URI::HTTP) or uri.kind_of?(URI::HTTPS) + rescue URI::InvalidURIError + false end end end
Remove unnecessary block in url validator
diff --git a/test/test_jade-rails.rb b/test/test_jade-rails.rb index abc1234..def5678 100644 --- a/test/test_jade-rails.rb +++ b/test/test_jade-rails.rb @@ -16,4 +16,13 @@ assert_equal Jade.compile('string of jade'), Jade.compile(io) end + def test_compilation_error + assert_raise ExecJS::ProgramError do + Jade.compile <<-JADE + else + .foo + JADE + end + end + end
Test Suite: Add test coverage for compilation errors.
diff --git a/test/unit/round_test.rb b/test/unit/round_test.rb index abc1234..def5678 100644 --- a/test/unit/round_test.rb +++ b/test/unit/round_test.rb @@ -26,4 +26,13 @@ assert_equal r2.url, r.url assert_equal r2.expire_time, r.expire_time end + + test "seconds_left returns time until round expires" do + r = Round.new + + now = Time.now + r.expire_time = now + 1.hours + + assert r.seconds_left - 1.hours < 1 + end end
Test Round.seconds_left returns time until round expires
diff --git a/lib/sass/plugin/rails.rb b/lib/sass/plugin/rails.rb index abc1234..def5678 100644 --- a/lib/sass/plugin/rails.rb +++ b/lib/sass/plugin/rails.rb @@ -12,7 +12,7 @@ if defined?(ActionController::Metal) # Rails >= 3.0 require 'sass/plugin/rack' - ActionController::Metal.use(Sass::Plugin::Rack) + Rails.configuration.middleware.use(Sass::Plugin::Rack) elsif defined?(ActionController::Dispatcher) && defined?(ActionController::Dispatcher.middleware) # Rails >= 2.3
[Sass] Load Sass::Plugin::Rack into Rails.configuration, not Metal in Rails 3. Closes gh-190
diff --git a/lib/specjour/db_scrub.rb b/lib/specjour/db_scrub.rb index abc1234..def5678 100644 --- a/lib/specjour/db_scrub.rb +++ b/lib/specjour/db_scrub.rb @@ -5,15 +5,10 @@ begin require 'rake' extend Rake::DSL if defined?(Rake::DSL) - if defined?(Rails) && Rails.version =~ /^3/ + if defined?(Rails) Rake::Task.define_task(:environment) { } load 'rails/tasks/misc.rake' load 'active_record/railties/databases.rake' - else - load 'tasks/misc.rake' - load 'tasks/databases.rake' - Rake::Task["db:structure:dump"].clear - Rake::Task["environment"].clear end rescue LoadError Specjour.logger.debug "Failed to load Rails rake tasks"
Drop Rails 2 support in DbScrub
diff --git a/lib/trello_newsletter.rb b/lib/trello_newsletter.rb index abc1234..def5678 100644 --- a/lib/trello_newsletter.rb +++ b/lib/trello_newsletter.rb @@ -1,5 +1,12 @@ require "trello_newsletter/version" +require "trello" -module TrelloNewsletter - # Your code goes here... +Trello.configure do |config| + config.developer_public_key = ENV['TRELLO_DEVELOPER_PUBLIC_KEY'] + config.member_token = ENV['TRELLO_MEMBER_TOKEN'] end + +class TrelloNewsletter + boards = Trello::Board.all + puts boards +end
Add trello configuration to gem This commit should print out all the boards you have in your account.
diff --git a/recipes/zookeeper_status.rb b/recipes/zookeeper_status.rb index abc1234..def5678 100644 --- a/recipes/zookeeper_status.rb +++ b/recipes/zookeeper_status.rb @@ -2,9 +2,19 @@ # Cookbook Name:: cerner_kafka # Recipe:: zookeeper_status - +<<-comment execute 'check zookeeper' do action :run command " nc -z #{node["kafka"]["zookeepers"].first} 2181 " returns [0] end +comment + + + +ruby_block "Zookeeper Status Check" do + block do + fail "Zookeeper not Running" + end + not_if "nc -z #{node['kafka']['zookeepers'].first} 2181" +end
Change way to check Zookeeper service