diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/lib/checks/check_nested_attributes.rb b/lib/checks/check_nested_attributes.rb index abc1234..def5678 100644 --- a/lib/checks/check_nested_attributes.rb +++ b/lib/checks/check_nested_attributes.rb @@ -0,0 +1,32 @@+require 'checks/base_check' +require 'processors/lib/find_call' + +class CheckNestedAttributes < BaseCheck + Checks.add self + + def run_check + version = tracker.config[:rails_version] + + if (version == "2.3.9" or version == "3.0.0") and uses_nested_attributes? + message = "Vulnerability in nested attributes (CVE-2010-3933). Upgrade to Rails version " + + if version == "2.3.9" + message << "2.3.10" + else + message << "3.0.1" + end + + warn :warning_type => "Nested Attributes", + :message => message, + :confidence => CONFIDENCE[:high] + end + end + + def uses_nested_attributes? + tracker.models.each do |name, model| + return true if model[:options][:accepts_nested_attributes_for] + end + + false + end +end
Add check for vulnerability in nested attributes http://groups.google.com/group/rubyonrails-security/browse_thread/thread/f9f913d328dafe0c
diff --git a/spec/product/reports_spec.rb b/spec/product/reports_spec.rb index abc1234..def5678 100644 --- a/spec/product/reports_spec.rb +++ b/spec/product/reports_spec.rb @@ -0,0 +1,27 @@+describe 'YAML reports' do + let(:report_dirs) { [REPORTS_FOLDER, "#{TIMELINES_FOLDER}/miq_reports"] } + let(:report_yamls) { report_dirs.collect { |dir| Dir.glob(File.join(dir, "**", "*.yaml")) }.flatten } + let!(:user) { FactoryGirl.create(:user_with_group) } + + # TODO: CHARTS_REPORTS_FOLDER + + before :each do + EvmSpecHelper.local_miq_server + @user = FactoryGirl.create(:user_with_group) + end + + it 'is not empty' do + expect(report_yamls.length).to be > 0 + end + + it 'can be build even though without data' do + report_yamls.each do |yaml| + report_data = YAML.load(File.open(yaml)) + report_data.delete('menu_name') + report = MiqReport.new(report_data) + expect(report.table).to be_nil + report.generate_table(:userid => @user.userid) + expect(report.table).to be_kind_of(Ruport::Data::Table) + end + end +end
Test all report recipes from product/ directory.
diff --git a/spec/pvoutput/client_spec.rb b/spec/pvoutput/client_spec.rb index abc1234..def5678 100644 --- a/spec/pvoutput/client_spec.rb +++ b/spec/pvoutput/client_spec.rb @@ -21,7 +21,7 @@ end it 'adds a status' do - body = 'd=20150101&t=00%3A00&v1=100&v2=50&v6=200' + body = 'd=20150101&t=00%3A00&v1=100&v2=50&v5=30&v6=200' headers = { 'X-Pvoutput-Apikey' => 'secret', 'X-Pvoutput-Systemid' => '1234',
Fix addstatus test for temperature
diff --git a/lib/fabrication/schematic/attribute.rb b/lib/fabrication/schematic/attribute.rb index abc1234..def5678 100644 --- a/lib/fabrication/schematic/attribute.rb +++ b/lib/fabrication/schematic/attribute.rb @@ -1,6 +1,7 @@ class Fabrication::Schematic::Attribute - attr_accessor :klass, :name, :params, :value + attr_accessor :klass, :name, :value + attr_writer :params def initialize(klass, name, value, params={}, &block) self.klass = klass
Define only writer because reader is defined below
diff --git a/spec/unit/recipes/cacher-client_spec.rb b/spec/unit/recipes/cacher-client_spec.rb index abc1234..def5678 100644 --- a/spec/unit/recipes/cacher-client_spec.rb +++ b/spec/unit/recipes/cacher-client_spec.rb @@ -2,24 +2,34 @@ describe 'apt::cacher-client' do context 'no server' do - let(:chef_run) { ChefSpec::ServerRunner.new.converge(described_recipe) } + let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) } - # it 'does not create 01proxy file' do - # expect(chef_run).not_to create_file('/etc/apt/apt.conf.d/01proxy') - # end + before do + stub_command("grep Acquire::http::Proxy /etc/apt/apt.conf").and_return(false) + end + + it 'does not create 01proxy file' do + expect(chef_run).not_to create_file('/etc/apt/apt.conf.d/01proxy') + end end context 'server provided' do let(:chef_run) do - runner = ChefSpec::ServerRunner.new - runner.node.set['apt']['cacher_ipaddress'] = '22.33.44.55' - runner.node.set['apt']['cacher_port'] = '9876' + runner = ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04') + runner.node.set['apt']['cacher_client']['cacher_server'] = { + host: 'localhost', + port: 9876, + proxy_ssl: true + } runner.converge('apt::cacher-client') end - # it 'creates 01proxy file' do - # expect(chef_run).to render_file('/etc/apt/apt.conf.d/01proxy').with_content() - # expect(chef_run).to create_file_with_content('/etc/apt/apt.conf.d/01proxy', 'Acquire::http::Proxy "http://22.33.44.55:9876";') - # end + before do + stub_command("grep Acquire::http::Proxy /etc/apt/apt.conf").and_return(false) + end + + it 'creates 01proxy file' do + expect(chef_run).to render_file('/etc/apt/apt.conf.d/01proxy').with_content('Acquire::http::Proxy "http://localhost:9876";') + end end end
Fix the cacher client specs Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
diff --git a/lib/gap_intelligence/models/record.rb b/lib/gap_intelligence/models/record.rb index abc1234..def5678 100644 --- a/lib/gap_intelligence/models/record.rb +++ b/lib/gap_intelligence/models/record.rb @@ -33,7 +33,7 @@ private def convert_value_to(klass, value) - return value if klass.nil? || value.is_a?(klass) + return value if klass.nil? || value.nil? || value.is_a?(klass) case klass.to_s when 'Date', 'Time'
Fix converting attribute value if value is nil
diff --git a/lib/active_mocker/mock/collection.rb b/lib/active_mocker/mock/collection.rb index abc1234..def5678 100644 --- a/lib/active_mocker/mock/collection.rb +++ b/lib/active_mocker/mock/collection.rb @@ -16,8 +16,8 @@ end extend ::Forwardable - def_delegators :@collection, :take, :push, :clear, :first, :last, :concat, :replace, :distinct, :uniq, :count, :size, :length, :empty?, :any?, :many?, :include?, :delete - alias distinct uniq + def_delegators :@collection, :take, :push, :clear, :first, :last, :concat, :replace, :uniq, :count, :size, :length, :empty?, :any?, :many?, :include?, :delete + alias_method :distinct, :uniq def select(&block) collection.select(&block)
Fix Ruby warning where distinct was being redefined.
diff --git a/spec/models/answer_connection_spec.rb b/spec/models/answer_connection_spec.rb index abc1234..def5678 100644 --- a/spec/models/answer_connection_spec.rb +++ b/spec/models/answer_connection_spec.rb @@ -20,4 +20,16 @@ expect(relationship_type(AnswerConnection, :answer_2)).to eq(:belongs_to) end end + + describe ".similarity" do + let(:answer_1) { create(:answer) } + let(:answer_2) { create(:answer) } + let(:result) { AnswerConnection.similarity(answer_1, answer_2) } + + before { AnswerConnection.create!(answer_1: answer_1, answer_2: answer_2, similarity: 100) } + + it "returns the similarity of a connection" do + expect(result).to eq(100) + end + end end
Add a test to 'similarity' method
diff --git a/spec/requests/api/v1/question_spec.rb b/spec/requests/api/v1/question_spec.rb index abc1234..def5678 100644 --- a/spec/requests/api/v1/question_spec.rb +++ b/spec/requests/api/v1/question_spec.rb @@ -28,4 +28,24 @@ @json.first.should have_key('question_identifier') @json.first['question_identifier'].should == @questions.first.question_identifier end + + describe "translation text" do + before :each do + @translation = create(:question_translation) + get '/api/v1/questions' + @json = JSON.parse(response.body) + end + + it "should add a new question for the translation" do + expect(@json.length).to eq(6) + end + + it "has the correct translation text" do + @json.last['translations'].first['text'].should == @translation.text + end + + it "has the correct translation text" do + @json.last['translations'].first['language'].should == @translation.language + end + end end
Add test for translations api
diff --git a/lib/porthos/mongo_mapper/extensions.rb b/lib/porthos/mongo_mapper/extensions.rb index abc1234..def5678 100644 --- a/lib/porthos/mongo_mapper/extensions.rb +++ b/lib/porthos/mongo_mapper/extensions.rb @@ -34,17 +34,15 @@ elsif value.nil? || value.to_s == '' nil else - value['field'].to_sym.public_send(value['operator'] || 'desc') + field, operator = value.split('.') + self.new(field.to_sym, operator) end end end module InstanceMethods def to_mongo - { - "field" => self.field.to_s, - "operator" => self.operator.to_s - } + "#{field.to_s}.#{operator}" end end end
Save SymbolOperator as a simple string
diff --git a/lib/scss_lint/reporter/xml_reporter.rb b/lib/scss_lint/reporter/xml_reporter.rb index abc1234..def5678 100644 --- a/lib/scss_lint/reporter/xml_reporter.rb +++ b/lib/scss_lint/reporter/xml_reporter.rb @@ -6,12 +6,13 @@ output << '<lint>' lints.group_by(&:filename).each do |filename, file_lints| - output << "<file name='#{filename}'>" + output << "<file name=#{filename.encode(:xml => :attr)}>" + file_lints.each do |lint| - output << "<issue line='#{lint.line}' " << - "severity='#{lint.severity}' " << - "reason='#{lint.description}' />" + output << "<issue line=\"#{lint.line}\" " << + "severity=\"#{lint.severity}\" " << + "reason=#{lint.description.encode(:xml => :attr)} />" end output << '</file>'
Update XmlReporter to XML encode attribute strings Avoids problem where filename or description contains illegal XML characters (like an ampersand) by escaping the output. Change-Id: I161de23cd8d52d5b8bab540457fd5fcb4d44add9 Reviewed-on: http://gerrit.causes.com/37215 Tested-by: jenkins <d95b56ce41a2e1ac4cecdd398defd7414407cc08@causes.com> Reviewed-by: Shane da Silva <6f6e68d1df92f30cb4b3ce35260ddf94a402f33d@causes.com>
diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index abc1234..def5678 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -0,0 +1,50 @@+# This file is copied to spec/ when you run 'rails generate rspec:install' +ENV['RAILS_ENV'] ||= 'test' +require 'spec_helper' +require File.expand_path('../../config/environment', __FILE__) +require 'rspec/rails' +# Add additional requires below this line. Rails is not loaded until this point! + +# Requires supporting ruby files with custom matchers and macros, etc, in +# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are +# run as spec files by default. This means that files in spec/support that end +# in _spec.rb will both be required and run as specs, causing the specs to be +# run twice. It is recommended that you do not name files matching this glob to +# end with _spec.rb. You can configure this pattern with the --pattern +# option on the command line or in ~/.rspec, .rspec or `.rspec-local`. +# +# The following line is provided for convenience purposes. It has the downside +# of increasing the boot-up time by auto-requiring all files in the support +# directory. Alternatively, in the individual `*_spec.rb` files, manually +# require only the support files necessary. +# +# Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f } + +# Checks for pending migrations before tests are run. +# If you are not using ActiveRecord, you can remove this line. +ActiveRecord::Migration.maintain_test_schema! + +RSpec.configure do |config| + # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures + config.fixture_path = "#{::Rails.root}/spec/fixtures" + + # If you're not using ActiveRecord, or you'd prefer not to run each of your + # examples within a transaction, remove the following line or assign false + # instead of true. + config.use_transactional_fixtures = true + + # RSpec Rails can automatically mix in different behaviours to your tests + # based on their file location, for example enabling you to call `get` and + # `post` in specs under `spec/controllers`. + # + # You can disable this behaviour by removing the line below, and instead + # explicitly tag your specs with their type, e.g.: + # + # RSpec.describe UsersController, :type => :controller do + # # ... + # end + # + # The different available types are documented in the features, such as in + # https://relishapp.com/rspec/rspec-rails/docs + config.infer_spec_type_from_file_location! +end
Fix configuration for travis and coveralls
diff --git a/spec/version_spec.rb b/spec/version_spec.rb index abc1234..def5678 100644 --- a/spec/version_spec.rb +++ b/spec/version_spec.rb @@ -0,0 +1,23 @@+#!/usr/bin/env ruby +# Copyright 2009 Wincent Colaiuta +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +require File.join(File.dirname(__FILE__), 'spec_helper.rb') +require 'wikitext/version' + +describe Wikitext, 'versioning' do + it 'should provide a version string' do + Wikitext::VERSION.should be_instance_of(String) + end +end
Add specs for version module Signed-off-by: Wincent Colaiuta <c76ac2e9cd86441713c7dfae92c451f3e6d17fdc@wincent.com>
diff --git a/config/initializers/websocket_server.rb b/config/initializers/websocket_server.rb index abc1234..def5678 100644 --- a/config/initializers/websocket_server.rb +++ b/config/initializers/websocket_server.rb @@ -2,7 +2,6 @@ require 'rubyception/subscriber' require 'rubyception/catcher' -::Rails.logger.auto_flushing = true Rubyception::WebsocketServer.sockets = [] Rubyception::WebsocketServer.new
Remove auto flushing of the log file
diff --git a/lib/esortcode/errors.rb b/lib/esortcode/errors.rb index abc1234..def5678 100644 --- a/lib/esortcode/errors.rb +++ b/lib/esortcode/errors.rb @@ -3,7 +3,7 @@ # request returns an error value. class ResponseError < RuntimeError attr_reader :response - def initialize(msg, response) + def initialize(msg = nil, response = nil) super(msg) @response = response end @@ -19,7 +19,7 @@ # else will result in this error being raised. class InvalidSortcode < RuntimeError attr_reader :sort_code - def initialize(msg, sort_code) + def initialize(msg = nil, sort_code = nil) super(msg) @sort_code = sort_code end @@ -30,7 +30,7 @@ # eight digits. class InvalidAccountNumber < RuntimeError attr_reader :account_number - def initialize(msg, account_number) + def initialize(msg = nil, account_number = nil) super(msg) @account_number = account_number end @@ -41,7 +41,7 @@ # is composed of digits. class InvalidCreditCardNumber < RuntimeError attr_reader :card_number - def initialize(msg, card_number) + def initialize(msg = nil, card_number = nil) super(msg) @card_number = card_number end
Make exception initialise params optional
diff --git a/lib/furnace/type/top.rb b/lib/furnace/type/top.rb index abc1234..def5678 100644 --- a/lib/furnace/type/top.rb +++ b/lib/furnace/type/top.rb @@ -1,7 +1,7 @@ module Furnace class Type::Top class << self - def normalize(params) + def normalize(*params) params end
Fix a bug in Type::Top.normalize.
diff --git a/knife-server.gemspec b/knife-server.gemspec index abc1234..def5678 100644 --- a/knife-server.gemspec +++ b/knife-server.gemspec @@ -16,6 +16,7 @@ gem.version = Knife::Server::VERSION gem.add_dependency "fog", "~> 1.3" + gem.add_dependency "net-ssh" gem.add_dependency "chef", ">= 0.10.10" gem.add_dependency "knife-ec2", "~> 0.5.12"
Add net-ssh as a gem dependency.
diff --git a/lib/girlscout/config.rb b/lib/girlscout/config.rb index abc1234..def5678 100644 --- a/lib/girlscout/config.rb +++ b/lib/girlscout/config.rb @@ -1,11 +1,11 @@ # frozen_string_literal: true module GirlScout - DEFAULT_API_PREFIX = 'https://api.helpscout.net/v1' + DEFAULT_API_PREFIX = 'https://api.helpscout.net/v2' class Config class << self - attr_accessor :api_key + attr_accessor :client_id, :client_secret attr_writer :api_prefix def api_prefix @@ -13,7 +13,8 @@ end def reset! - @api_key = nil + @client_id = nil + @client_secret = nil @api_prefix = DEFAULT_API_PREFIX end end
Update api prefix from v1 to v2
diff --git a/lib/haskii/bar_chart.rb b/lib/haskii/bar_chart.rb index abc1234..def5678 100644 --- a/lib/haskii/bar_chart.rb +++ b/lib/haskii/bar_chart.rb @@ -16,6 +16,8 @@ .map { |line| line.join("") } end + private + def generate_matrix row_sequence = @frequences.map { |number| generate_row(number) } Matrix[*row_sequence]
Read about attributs and methods
diff --git a/lib/magic_grid/order.rb b/lib/magic_grid/order.rb index abc1234..def5678 100644 --- a/lib/magic_grid/order.rb +++ b/lib/magic_grid/order.rb @@ -1,6 +1,6 @@ module MagicGrid module Order - class Unordered < BasicObject + class Unordered def self.css_class 'sort-none' end
Remove reference to BasicObject, it wasn't introduced until 1.9
diff --git a/lib/web_console/repl.rb b/lib/web_console/repl.rb index abc1234..def5678 100644 --- a/lib/web_console/repl.rb +++ b/lib/web_console/repl.rb @@ -30,8 +30,8 @@ end private - def derive_adaptee_constant_from(adapter_class, suffix = 'REPL') - "::#{adapter_class.name.split('::').last.gsub(/#{suffix}$/i, '')}".constantize + def derive_adaptee_constant_from(cls, suffix = 'REPL') + "::#{cls.name.split('::').last.gsub(/#{suffix}$/i, '')}".constantize end end end
Use a saner names in derive_adaptee_constant_from
diff --git a/cookbooks/apple_osx_updates/recipes/mac.rb b/cookbooks/apple_osx_updates/recipes/mac.rb index abc1234..def5678 100644 --- a/cookbooks/apple_osx_updates/recipes/mac.rb +++ b/cookbooks/apple_osx_updates/recipes/mac.rb @@ -12,7 +12,7 @@ app "OSXUpd10.8.4" volumes_dir "OS X 10.8.4 Update" dmg_name "OSXUpd10.8.4" - source "http://ims-chef.wesleyan.edu/os_x/os_x_updates/OSXUpd10.8.4.dmg" + source "http://ims-chef.wesleyan.edu/os_x/apple_osx_updates/OSXUpd10.8.4.dmg" checksum "07d0a381f54911c6ae4f764452d308d439c30e0a3737ea43d1cd3dd24b205296" action :install type "pkg"
Fix source path for apple_osx_updates
diff --git a/lib/authenticator.rb b/lib/authenticator.rb index abc1234..def5678 100644 --- a/lib/authenticator.rb +++ b/lib/authenticator.rb @@ -1,8 +1,8 @@ module HonestRenter class Authenticator class << self - def from_secret_key_member_id(*_) - raise 'secret key auth is not supported at this time' + def from_secret_key_member_id(secret_key, member_id) + SecretKeyMemberIdAuthenticator.new(secret_key, member_id) end def from_address_and_password(address, password) @@ -16,6 +16,37 @@ def session build_session + end + end + + class SecretKeyMemberIdAuthenticator < Authenticator + require 'openssl' + + ONE_HOUR = 3600 + + def after_initialize(secret_key, member_id) + @secret_key = secret_key + @member_id = member_id + end + + def build_session + json_hash = JSON(raw_hash) + digest = OpenSSL::Digest.new('sha256') + encoded = OpenSSL::HMAC.hexdigest(digest, @secret_key, json_hash) + + HonestRenter::Session.new(encoded, json_hash) + end + + def raw_hash + now = Time.now + + { + apiKey: ENV['HONEST_RENTER_API_KEY'], + authorization: 'member', + expires: now.to_i + ONE_HOUR, + person: @member_id, + renewableUntil: now.to_i + (3 * ONE_HOUR) + } end end
Revert "Remove secret key auth" This reverts commit 8b12940bad4cb336e6151539c93e65a40e7dd623.
diff --git a/lib/bummr/updater.rb b/lib/bummr/updater.rb index abc1234..def5678 100644 --- a/lib/bummr/updater.rb +++ b/lib/bummr/updater.rb @@ -19,7 +19,12 @@ system("bundle update #{gem[:name]}") updated_version = updated_version_for(gem) - message = "Update #{gem[:name]} from #{gem[:installed]} to #{updated_version}" + + if (updated_version) + message = "Update #{gem[:name]} from #{gem[:installed]} to #{updated_version}" + else + message = "Update dependencies for #{gem[:name]}" + end if gem[:installed] == updated_version log("#{gem[:name]} not updated") @@ -36,10 +41,9 @@ end def updated_version_for(gem) - if (gem[:name].include?("(") && gem[:name].include?(")")) + begin `bundle list | grep " #{gem[:name]} "`.split('(')[1].split(')')[0] - else - "?" + rescue Error end end end
Deal with updating gem dependencies only
diff --git a/lib/clog/transmit.rb b/lib/clog/transmit.rb index abc1234..def5678 100644 --- a/lib/clog/transmit.rb +++ b/lib/clog/transmit.rb @@ -2,13 +2,12 @@ require 'uri' class Transmit - attr_accessor :uri, :port, :api_token, :data + attr_accessor :api_token, :data, :uri def initialize(url, api_token, data) @api_token = api_token @data = data @uri = URI(url) - @port = uri.port end def http
Remove unused variable from Transmit class. The port variable is not used can be removed in favor of using the port number from URI.
diff --git a/lib/deterministic.rb b/lib/deterministic.rb index abc1234..def5678 100644 --- a/lib/deterministic.rb +++ b/lib/deterministic.rb @@ -1,4 +1,6 @@ require "deterministic/version" + +warn "WARN: Deterministic is meant to run on Ruby 2+" if RUBY_VERSION.to_f < 2 module Deterministic; end
Add warning for Ruby < 2
diff --git a/lib/popular_items.rb b/lib/popular_items.rb index abc1234..def5678 100644 --- a/lib/popular_items.rb +++ b/lib/popular_items.rb @@ -6,7 +6,11 @@ def initialize(panopticon_api_credentials, logger = nil) publisher = GdsApi::Panopticon.new(Plek.current_env, panopticon_api_credentials) - @items = publisher.curated_lists || [] # TODO: is this the best place? + begin + @items = publisher.curated_lists || {} + rescue NoMethodError # HACK HACK HACK, but it's being deleted imminently + @items = {} + end @logger = logger || NullLogger.instance end
Fix display of popular items with filthy hackery. Again, since this is being replaced very soon with frontend browse pages, it's not worth the time it would take to fix it properly.
diff --git a/Casks/gifloopcoder.rb b/Casks/gifloopcoder.rb index abc1234..def5678 100644 --- a/Casks/gifloopcoder.rb +++ b/Casks/gifloopcoder.rb @@ -2,6 +2,7 @@ version '1.3.5' sha256 '0b6f7d85d5e7dc95967f93cd645302da7aac4c9d8fbf0029d6886bd99931e849' + # github.com/bit101/gifloopcoder was verified as official when first introduced to the cask url "https://github.com/bit101/gifloopcoder/releases/download/#{version}/glc-osx-#{version}.zip" appcast 'https://github.com/bit101/gifloopcoder/releases.atom', checkpoint: '5b76b8584760da71679c101cfdb082b930952a78b5bd6a17a4029ce5a395887c'
Fix `url` stanza comment for GIFLoopCoder.
diff --git a/Casks/micro-snitch.rb b/Casks/micro-snitch.rb index abc1234..def5678 100644 --- a/Casks/micro-snitch.rb +++ b/Casks/micro-snitch.rb @@ -1,6 +1,6 @@ cask :v1 => 'micro-snitch' do - version '1.1.1' - sha256 '494eedf1a8f87cb846eb37279bca7aecd851157bdd31347ab8e1d8f219613680' + version '1.1.2' + sha256 'a1d49f8a94524d0d242fb505dac24dc1f8f152bd7794fa5a0f0215366f63f367' url "https://obdev.at/downloads/MicroSnitch/MicroSnitch-#{version}.zip" name 'Micro Snitch'
Upgrade Micro Snitch.app to v1.1.2
diff --git a/Casks/neteasemusic.rb b/Casks/neteasemusic.rb index abc1234..def5678 100644 --- a/Casks/neteasemusic.rb +++ b/Casks/neteasemusic.rb @@ -1,9 +1,9 @@ cask :v1 => 'neteasemusic' do - version '1.4.0' - sha256 'e617ccc626c2275638ee731af0dcfd955b327bb581b5b8b1caa91f69c055e3e1' + version '1.4.0_418' + sha256 'da5e545bbe213a7f073602519da29c3d4d68bb25de99804c4dd61dd6d02dc763' # 126.net is the official download host per the vendor homepage - url "http://s1.music.126.net/download/osx/NeteaseMusic_#{version}_392_web.dmg" + url "http://s1.music.126.net/download/osx/NeteaseMusic_#{version}_web.dmg" name '网易云音乐' name 'NetEase cloud music' homepage 'http://music.163.com/#/download'
Upgrade Netease Music to v1.4.0.418
diff --git a/cookbooks/ondemand_base/recipes/centos.rb b/cookbooks/ondemand_base/recipes/centos.rb index abc1234..def5678 100644 --- a/cookbooks/ondemand_base/recipes/centos.rb +++ b/cookbooks/ondemand_base/recipes/centos.rb @@ -1,6 +1,9 @@-#Make sure that this recipe only runs on CentOS/RHEL systems -if platform?("redhat", "centos") +#Make sure that this recipe only runs on ubuntu systems +if platform?("centos") +#Base recipes necessary for a functioning system +include_recipe "sudo" +#include_recipe "ad-likewise" include_recipe "openssh" include_recipe "ntp" @@ -9,9 +12,32 @@ include_recipe "man" include_recipe "networking_basic" + # Install useful tools %w{ mtr strace iotop }.each do |pkg| package pkg end +# Used for password string generation +package "ruby-shadow" + +#Pull authorization data from the authorization data bag +auth_config = data_bag_item('authorization', "ondemand") + +# set root password from authorization databag +#user "root" do +# password auth_config['root_password'] +#end + +# add non-root user from authorization databag +if auth_config['alternate_user'] + user auth_config['alternate_user'] do + password auth_config['alternate_pass'] + if auth_config['alternate_uid'] + uid auth_config['alternate_uid'] + end + not_if "grep #{auth_config['alternate_user']} /etc/passwd" + end end + +end
Update CentOS recipe to the latest rev to include setting up the bobo account and sudo
diff --git a/sample/spec/spec_helper.rb b/sample/spec/spec_helper.rb index abc1234..def5678 100644 --- a/sample/spec/spec_helper.rb +++ b/sample/spec/spec_helper.rb @@ -4,6 +4,7 @@ require File.expand_path("../dummy/config/environment", __FILE__) require 'rspec/rails' require 'ffaker' +require 'spree_sample' RSpec.configure do |config| config.color = true
Add require spree_sample to spec helper to prevent failure when running build.sh.
diff --git a/test/models/optional_modules/guest_books/guest_book_test.rb b/test/models/optional_modules/guest_books/guest_book_test.rb index abc1234..def5678 100644 --- a/test/models/optional_modules/guest_books/guest_book_test.rb +++ b/test/models/optional_modules/guest_books/guest_book_test.rb @@ -1,7 +1,58 @@ require 'test_helper' class GuestBookTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end + setup :initialize_test + + # + # == Validation + # + test 'should be able to create if all good' do + guest_book = GuestBook.new(content: 'youpi', username: 'leila', email: 'leila@skywalker.sw', lang: 'fr') + assert guest_book.valid? + assert guest_book.errors.keys.empty? + assert_not guest_book.validated? + end + + test 'should not be able to create if empty' do + guest_book = GuestBook.new + assert_not guest_book.valid? + assert_equal [:username, :email, :content, :lang], guest_book.errors.keys + end + + # Robots thinks it's valid but nothing is created by controller + test 'should not be able to create if captcha filled' do + guest_book = GuestBook.new(content: 'youpi', nickname: 'youpi', username: 'leila', email: 'leila@skywalker.sw', lang: 'fr') + assert guest_book.valid? + assert guest_book.errors.keys.empty? + end + + test 'should not be able to create if lang is not allowed' do + guest_book = GuestBook.new(content: 'youpi', username: 'leila', email: 'leila@skywalker.sw', lang: 'zh') + assert_not guest_book.valid? + assert_equal [:lang], guest_book.errors.keys + end + + test 'should not be able to create if email is not valid' do + guest_book = GuestBook.new(content: 'youpi', username: 'leila', email: 'fakemail', lang: 'fr') + assert_not guest_book.valid? + assert_equal [:email], guest_book.errors.keys + end + + test 'should have validated column to 1 if option disabled' do + assert @guest_book_setting.should_validate? + @guest_book_setting.update_attribute(:should_validate, false) + assert_not @guest_book_setting.should_validate? + + guest_book = GuestBook.new(content: 'youpi', username: 'leila', email: 'leila@skywalker.sw', lang: 'fr') + assert guest_book.valid? + assert guest_book.errors.keys.empty? + assert guest_book.validated?, 'guest_book should be automatically validated' + end + + private + + def initialize_test + @guest_book_setting = guest_book_settings(:one) + @guest_book = guest_books(:fr_validate) + end end
Add tests for GuestBook model
diff --git a/core/app/helpers/spree/taxons_helper.rb b/core/app/helpers/spree/taxons_helper.rb index abc1234..def5678 100644 --- a/core/app/helpers/spree/taxons_helper.rb +++ b/core/app/helpers/spree/taxons_helper.rb @@ -7,12 +7,12 @@ # to show the most popular products for a particular taxon (that is an exercise left to the developer.) def taxon_preview(taxon, max = 4) price_scope = Spree::Price.where(current_pricing_options.search_arguments) - products = taxon.active_products.joins(:prices).merge(price_scope).select("DISTINCT (spree_products.id), spree_products.*, spree_products_taxons.position").limit(max) + products = taxon.active_products.joins(:prices).merge(price_scope).select("DISTINCT spree_products.*, spree_products_taxons.position").limit(max) if products.size < max products_arel = Spree::Product.arel_table taxon.descendants.each do |descendent_taxon| to_get = max - products.length - products += descendent_taxon.active_products.joins(:prices).merge(price_scope).select("DISTINCT (spree_products.id), spree_products.*, spree_products_taxons.position").where(products_arel[:id].not_in(products.map(&:id))).limit(to_get) + products += descendent_taxon.active_products.joins(:prices).merge(price_scope).select("DISTINCT spree_products.*, spree_products_taxons.position").where(products_arel[:id].not_in(products.map(&:id))).limit(to_get) break if products.size >= max end end
Remove redundant select for `id` attr on `Spree::TaxonsHelper` The SQL queries specified on said helper on lines 10 and 15 were redundantly selecting the `id` attribute for `spree_products` table, which caused MySQL to raise an exception about a duplicate column name since said attribute is already being selected through the `spree_products.*` statement
diff --git a/llt-assessor.gemspec b/llt-assessor.gemspec index abc1234..def5678 100644 --- a/llt-assessor.gemspec +++ b/llt-assessor.gemspec @@ -9,7 +9,7 @@ spec.authors = ["LFDM"] spec.email = ["1986gh@gmail.com"] spec.summary = %q{Provides various grading/assessment mechanisma on top off llt-diff} - spec.description = %q{TODO: Write a longer description. Optional.} + spec.description = spec.summary spec.homepage = "" spec.license = "MIT" @@ -22,4 +22,7 @@ spec.add_development_dependency "rake" spec.add_development_dependency "rspec" spec.add_development_dependency "simplecov", "~> 0.7" + + spec.add_dependency 'llt-core' + spec.add_dependency 'llt-diff' end
Add summary and dependencies in gemspec
diff --git a/lib/metasploit_data_models/engine.rb b/lib/metasploit_data_models/engine.rb index abc1234..def5678 100644 --- a/lib/metasploit_data_models/engine.rb +++ b/lib/metasploit_data_models/engine.rb @@ -11,7 +11,7 @@ # Remove ActiveSupport::Dependencies loading paths to save time during constant resolution and to ensure that # metasploit_data_models is properly declaring all autoloads and not falling back on ActiveSupport::Dependencies - config.paths.each_value do |path| + config.paths.values do |path| path.skip_autoload! path.skip_autoload_once! path.skip_eager_load!
Fix problem with autoload path resetting
diff --git a/config/initializers/backport_pg_10_support_to_rails_4.rb b/config/initializers/backport_pg_10_support_to_rails_4.rb index abc1234..def5678 100644 --- a/config/initializers/backport_pg_10_support_to_rails_4.rb +++ b/config/initializers/backport_pg_10_support_to_rails_4.rb @@ -0,0 +1,46 @@+require 'active_record/connection_adapters/postgresql/schema_statements' + +# +# Monkey-patch the refused Rails 4.2 patch at https://github.com/rails/rails/pull/31330 +# +# Updates sequence logic to support PostgreSQL 10. +# + +module ActiveRecord + module ConnectionAdapters + module PostgreSQL + module SchemaStatements + # Resets the sequence of a table's primary key to the maximum value. + def reset_pk_sequence!(table, pk = nil, sequence = nil) #:nodoc: + unless pk && sequence + default_pk, default_sequence = pk_and_sequence_for(table) + + pk ||= default_pk + sequence ||= default_sequence + end + + if @logger && pk && !sequence + @logger.warn "#{table} has primary key #{pk} with no default sequence" + end + + if pk && sequence + quoted_sequence = quote_table_name(sequence) + max_pk = select_value("SELECT MAX(#{quote_column_name pk}) FROM #{quote_table_name(table)}") + if max_pk.nil? + if postgresql_version >= 100000 + minvalue = select_value("SELECT seqmin FROM pg_sequence WHERE seqrelid = #{quote(quoted_sequence)}::regclass") + else + minvalue = select_value("SELECT min_value FROM #{quoted_sequence}") + end + end + + select_value <<-end_sql, 'SCHEMA' + SELECT setval(#{quote(quoted_sequence)}, #{max_pk ? max_pk : minvalue}, #{max_pk ? true : false}) + end_sql + end + end + end + end + end +end +
Support pg 10 for Rails 4.2
diff --git a/config/initializers/backport_pg_10_support_to_rails_4.rb b/config/initializers/backport_pg_10_support_to_rails_4.rb index abc1234..def5678 100644 --- a/config/initializers/backport_pg_10_support_to_rails_4.rb +++ b/config/initializers/backport_pg_10_support_to_rails_4.rb @@ -0,0 +1,44 @@+# +# Monkey-patch the refused Rails 4.2 patch at https://github.com/rails/rails/pull/31330 +# +# Updates sequence logic to support PostgreSQL 10. +# +# TODO: Remvoe when upgrading to Rails 5 + +module ActiveRecord + module ConnectionAdapters + module PostgreSQL + module SchemaStatements + # Resets the sequence of a table's primary key to the maximum value. + def reset_pk_sequence!(table, pk = nil, sequence = nil) #:nodoc: + unless pk and sequence + default_pk, default_sequence = pk_and_sequence_for(table) + + pk ||= default_pk + sequence ||= default_sequence + end + + if @logger && pk && !sequence + @logger.warn "#{table} has primary key #{pk} with no default sequence" + end + + if pk && sequence + quoted_sequence = quote_table_name(sequence) + max_pk = select_value("SELECT MAX(#{quote_column_name pk}) FROM #{quote_table_name(table)}") + if max_pk.nil? + if postgresql_version >= 100000 + minvalue = select_value("SELECT seqmin FROM pg_sequence WHERE seqrelid = #{quote(quoted_sequence)}::regclass") + else + minvalue = select_value("SELECT min_value FROM #{quoted_sequence}") + end + end + + select_value <<-end_sql, 'SCHEMA' + SELECT setval(#{quote(quoted_sequence)}, #{max_pk ? max_pk : minvalue}, #{max_pk ? true : false}) + end_sql + end + end + end + end + end +end
Repair PK Reset. Fixes 719 See https://github.com/rails/rails/issues/28780 for details
diff --git a/lib/organic-sitemap/redis_manager.rb b/lib/organic-sitemap/redis_manager.rb index abc1234..def5678 100644 --- a/lib/organic-sitemap/redis_manager.rb +++ b/lib/organic-sitemap/redis_manager.rb @@ -2,29 +2,41 @@ class RedisManager def self.add(key) return unless key - OrganicSitemap.configuration. - redis_connection. - zadd(OrganicSitemap.configuration.storage_key, - (DateTime.now + OrganicSitemap.configuration.expiry_time.to_i).to_time.to_i, - key) + redis_connection.zadd(storage_key, (DateTime.now + expiry_time).to_time.to_i, key) end def self.clean_set(time = Time.now) - OrganicSitemap.configuration. - redis_connection. - zremrangebyscore(OrganicSitemap.configuration.storage_key, - "-inf", - time.to_i) + redis_connection.zremrangebyscore(storage_key, "-inf", time.to_i) end def self.sitemap_urls(from: nil, to: nil) from = from ? from.to_time.to_i : '-inf' to = to ? to.to_time.to_i : '+inf' - OrganicSitemap.configuration. - redis_connection. - zrangebyscore(OrganicSitemap.configuration.storage_key, - from, - to) + redis_connection.zrangebyscore(storage_key, from, to) + end + + def self.remove_key(key: nil) + return if key.nil? + redis_connection.zrem(storage_key, key) + end + + def self.remove_keys(keys: []) + return unless keys.any? + keys.each do |key| + remove_key key + end + end + private + def self.redis_connection + OrganicSitemap.configuration.redis_connection + end + + def self.storage_key + OrganicSitemap.configuration.storage_key + end + + def self.expiry_time + OrganicSitemap.configuration.expiry_time.to_i end end end
Add remove_key and remove_keys functions on redis manager
diff --git a/lib/overriaktion/mocked_responses.rb b/lib/overriaktion/mocked_responses.rb index abc1234..def5678 100644 --- a/lib/overriaktion/mocked_responses.rb +++ b/lib/overriaktion/mocked_responses.rb @@ -0,0 +1,5 @@+module Overriaktion + module MockedResponses + RIAK_CLUSTERS = '[{"created_at":"2011-10-10T03:31:34Z","id":1,"name":"Localhost","updated_at":"2011-10-10T03:31:34Z","user_id":1}]' + end +end
Add mocked response for riak clusters.
diff --git a/lib/stackprofiler/filters/js_tree.rb b/lib/stackprofiler/filters/js_tree.rb index abc1234..def5678 100644 --- a/lib/stackprofiler/filters/js_tree.rb +++ b/lib/stackprofiler/filters/js_tree.rb @@ -17,7 +17,13 @@ end text = escaped.join("<br> ↳ ") - children = root.children.map { |n| filter(n, frames) } + sorted_children = root.children.sort_by do |child| + addr = child.content[:addrs].first.to_i + frame = frames[addr] + frame[:samples] + end.reverse + + children = sorted_children.map { |n| filter(n, frames) } open = root.content.has_key?(:open) ? root.content[:open] : frame[:total_samples] > 100 {text: text, state: {opened: open}, children: children, icon: false, data: {addrs: addrs}} end
Sort tree branches by sample count
diff --git a/lib/walmart_open/commerce_request.rb b/lib/walmart_open/commerce_request.rb index abc1234..def5678 100644 --- a/lib/walmart_open/commerce_request.rb +++ b/lib/walmart_open/commerce_request.rb @@ -11,6 +11,7 @@ def build_url(client) url = "https://#{client.config.commerce_domain}" url << "/#{client.config.commerce_version}" + url << "/qa" if client.config.debug url << "/#{path}" url << params_to_query_string(build_params(client)) end
Add "qa" to url in debug mode
diff --git a/lib/generators/invitational/install/install_generator.rb b/lib/generators/invitational/install/install_generator.rb index abc1234..def5678 100644 --- a/lib/generators/invitational/install/install_generator.rb +++ b/lib/generators/invitational/install/install_generator.rb @@ -15,6 +15,10 @@ end template "invitation.rb", "app/models/invitation.rb" + end + + def add_to_gemfile + gem "cancancan" end def ability_model
Put the code back in to add the gem to the gemfile until we figure out the issue around this
diff --git a/lib/axiom/types/date_time.rb b/lib/axiom/types/date_time.rb index abc1234..def5678 100644 --- a/lib/axiom/types/date_time.rb +++ b/lib/axiom/types/date_time.rb @@ -7,13 +7,13 @@ class DateTime < Object extend ValueComparable - NSEC_IN_SECONDS = 1 - Rational(1, 10**9) + MAXIMUM_NSEC_IN_SECONDS = 1 - Rational(1, 10**9) primitive ::DateTime coercion_method :to_datetime minimum primitive.new(1, 1, 1) - maximum primitive.new(9999, 12, 31, 23, 59, 59 + NSEC_IN_SECONDS) + maximum primitive.new(9999, 12, 31, 23, 59, 59 + MAXIMUM_NSEC_IN_SECONDS) end # class DateTime end # module Types
Rename constant to be more clear
diff --git a/lib/catarse_stripe/engine.rb b/lib/catarse_stripe/engine.rb index abc1234..def5678 100644 --- a/lib/catarse_stripe/engine.rb +++ b/lib/catarse_stripe/engine.rb @@ -5,8 +5,8 @@ #end module ActionDispatch::Routing class Mapper - def mount_catarse_stripe_at(payment) - scope payment do + def mount_catarse_stripe_at(catarse_stripe) + namespace :payment do get '/stripe/:id/review' => 'stripe#review', :as => 'review_stripe' post '/stripe/notifications' => 'stripe#ipn', :as => 'ipn_stripe' match '/stripe/:id/notifications' => 'stripe#notifications', :as => 'notifications_stripe'
Change route to share application
diff --git a/spec/install/force_spec.rb b/spec/install/force_spec.rb index abc1234..def5678 100644 --- a/spec/install/force_spec.rb +++ b/spec/install/force_spec.rb @@ -33,5 +33,14 @@ expect(out).to include "Using bundler 1.10.4" end + it "works on first bundle install" do + bundle "install --force" + + expect(out).to include "Installing rack 1.0.0" + should_be_installed "rack 1.0.0" + expect(exitstatus).to eq(0) if exitstatus + end + + end end
Add test to ensure that bundle install --force works even when bundle is not yet created
diff --git a/lib/docker/release/runner.rb b/lib/docker/release/runner.rb index abc1234..def5678 100644 --- a/lib/docker/release/runner.rb +++ b/lib/docker/release/runner.rb @@ -14,6 +14,7 @@ def precheck! check_for_unstaged_changes! + check_for_changelog! end def perform!
Add back the changelog check
diff --git a/spree_mercado_pago.gemspec b/spree_mercado_pago.gemspec index abc1234..def5678 100644 --- a/spree_mercado_pago.gemspec +++ b/spree_mercado_pago.gemspec @@ -10,13 +10,13 @@ s.license = 'MIT' s.add_dependency 'spree_core', '~> 3.2.0.rc1' - s.add_dependency 'rest-client', '~> 1.7' + s.add_dependency 'rest-client', '~> 2.0' s.add_development_dependency 'ffaker', '~> 2.2' s.add_development_dependency 'factory_girl', '~> 4.4' s.add_development_dependency 'rspec-rails', '~> 3.5' s.add_development_dependency 'sass-rails', '~> 5.0' - s.add_development_dependency 'coffee-rails', '~> 4.1' + s.add_development_dependency 'coffee-rails', '~> 4.2' s.add_development_dependency 'sqlite3', '~> 1.3' s.add_development_dependency 'binding_of_caller' s.add_development_dependency 'better_errors'
Update rest-client & coffee-rails dependencies
diff --git a/sprockets-redirect.gemspec b/sprockets-redirect.gemspec index abc1234..def5678 100644 --- a/sprockets-redirect.gemspec +++ b/sprockets-redirect.gemspec @@ -1,7 +1,8 @@ Gem::Specification.new do |s| - s.name = 'sprockets-redirect' - s.version = '0.3.0' - s.date = '2014-12-30' + s.name = "sprockets-redirect" + s.version = "0.3.0" + s.authors = ["Prem Sichanugrist"] + s.email = "s@sikac.hu" s.homepage = "https://github.com/sikachu/sprockets-redirect" s.summary = "Redirect assets with no digest request to a filename with digest version." @@ -10,27 +11,25 @@ redirect a request with no digest in the file name to the version with digest in the file name. EOS + s.license = "MIT" s.files = [ - 'lib/sprockets-redirect.rb', - 'lib/sprockets/redirect.rb', - 'LICENSE', - 'README.md' + "lib/sprockets-redirect.rb", + "lib/sprockets/redirect.rb", + "LICENSE", + "README.md" ] s.platform = Gem::Platform::RUBY s.require_path = "lib" s.extra_rdoc_files = Dir["README*"] - s.add_dependency 'rack' - s.add_dependency 'activesupport', '>= 3.1.0' - s.add_development_dependency 'appraisal', '>= 1.0.0.beta2' - s.add_development_dependency 'bundler' - s.add_development_dependency 'mocha' - s.add_development_dependency 'rake' - s.add_development_dependency 'rack-test' - s.add_development_dependency 'rails' - - s.authors = ["Prem Sichanugrist"] - s.email = "s@sikac.hu" + s.add_dependency "rack" + s.add_dependency "activesupport", ">= 3.1.0" + s.add_development_dependency "appraisal", ">= 1.0.0.beta2" + s.add_development_dependency "bundler" + s.add_development_dependency "mocha" + s.add_development_dependency "rake" + s.add_development_dependency "rack-test" + s.add_development_dependency "rails" end
Update style in gemspec file
diff --git a/spec/active_set/paginate/enumerable_adapter_spec.rb b/spec/active_set/paginate/enumerable_adapter_spec.rb index abc1234..def5678 100644 --- a/spec/active_set/paginate/enumerable_adapter_spec.rb +++ b/spec/active_set/paginate/enumerable_adapter_spec.rb @@ -0,0 +1,66 @@+# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe ActiveSet::PaginateProcessor::EnumerableAdapter do + include_context 'for enumerable sets' + + let(:adapter) { described_class.new(enumerable_set, instruction) } + let(:instruction) { ActiveSet::Instructions::Entry.new(page, size) } + + subject { adapter.process[:set] } + + context 'when page size is smaller than set size' do + let(:size) { 1 } + + context 'when on first page' do + let(:page) { 1 } + + it { expect(subject.pluck(:id)).to eq [foo.id] } + end + + context 'when on last page' do + let(:page) { 2 } + + it { expect(subject.pluck(:id)).to eq [bar.id] } + end + + context 'when on irrational page' do + let(:page) { 10 } + + it { expect(subject.pluck(:id)).to eq [] } + end + end + + context 'when page size is equal to set size' do + let(:size) { enumerable_set.count } + + context 'when on only page' do + let(:page) { 1 } + + it { expect(subject.pluck(:id)).to eq [foo.id, bar.id] } + end + + context 'when on irrational page' do + let(:page) { 10 } + + it { expect(subject.pluck(:id)).to eq [] } + end + end + + context 'when page size is greater than set size' do + let(:size) { enumerable_set.count + 1 } + + context 'when on only page' do + let(:page) { 1 } + + it { expect(subject.pluck(:id)).to eq [foo.id, bar.id] } + end + + context 'when on irrational page' do + let(:page) { 10 } + + it { expect(subject.pluck(:id)).to eq [] } + end + end +end
Add tests for the updated EnumerableAdapter for the PaginateProcessor
diff --git a/spec/models/course/condition/survey_ability_spec.rb b/spec/models/course/condition/survey_ability_spec.rb index abc1234..def5678 100644 --- a/spec/models/course/condition/survey_ability_spec.rb +++ b/spec/models/course/condition/survey_ability_spec.rb @@ -0,0 +1,17 @@+# frozen_string_literal: true +require 'rails_helper' + +RSpec.describe Course::Condition::Survey do + let!(:instance) { Instance.default } + with_tenant(:instance) do + subject { Ability.new(user) } + let(:course) { create(:course) } + let(:condition) { create(:survey_condition, course: course) } + + context 'when the user is a Course Staff' do + let(:user) { create(:course_manager, course: course).user } + + it { is_expected.to be_able_to(:manage, condition) } + end + end +end
Add permission test for survey condition
diff --git a/lib/rubygems/tasks/build/tar.rb b/lib/rubygems/tasks/build/tar.rb index abc1234..def5678 100644 --- a/lib/rubygems/tasks/build/tar.rb +++ b/lib/rubygems/tasks/build/tar.rb @@ -8,7 +8,8 @@ FLAGS = { :bz2 => 'j', :gz => 'x', - :xz => 'J' + :xz => 'J', + nil => '' } attr_accessor :format
Handle when :format is nil.
diff --git a/test/fake_app/sinatra_app.rb b/test/fake_app/sinatra_app.rb index abc1234..def5678 100644 --- a/test/fake_app/sinatra_app.rb +++ b/test/fake_app/sinatra_app.rb @@ -11,6 +11,8 @@ @users = User.page params[:page] erb <<-ERB.dup <%= @users.map(&:name).join("\n") %> +<%= link_to_previous_page @users, 'previous page', class: 'prev' %> +<%= link_to_next_page @users, 'next page', class: 'next' %> <%= paginate @users %> ERB end
Make sure that link_to_{previous,next}_page is working
diff --git a/nutshell-crm.gemspec b/nutshell-crm.gemspec index abc1234..def5678 100644 --- a/nutshell-crm.gemspec +++ b/nutshell-crm.gemspec @@ -11,6 +11,7 @@ s.summary = "A Ruby wrapper for Nutshell CRM's API" s.description = "Description" + s.add_development_dependency 'rake' s.add_development_dependency 'yard' s.add_development_dependency 'json' s.add_development_dependency 'httparty'
Add rake as dev dependency.
diff --git a/plugins/kernel_v2/config/vm_provider.rb b/plugins/kernel_v2/config/vm_provider.rb index abc1234..def5678 100644 --- a/plugins/kernel_v2/config/vm_provider.rb +++ b/plugins/kernel_v2/config/vm_provider.rb @@ -30,6 +30,7 @@ @logger.info("Configuring provider #{@name} with #{config_class}") @config = config_class.new block.call(@config) if block + @config.finalize! end end end
Call `finalize!` properly on provider configurations
diff --git a/spec/factories/course_assessment_question_programming.rb b/spec/factories/course_assessment_question_programming.rb index abc1234..def5678 100644 --- a/spec/factories/course_assessment_question_programming.rb +++ b/spec/factories/course_assessment_question_programming.rb @@ -3,7 +3,8 @@ class: Course::Assessment::Question::Programming, parent: :course_assessment_question do transient do - template_file_count 1 + template_file_count 0 + template_package false end memory_limit 32 @@ -14,5 +15,9 @@ build(:course_assessment_question_programming_template_file, question: nil) end end + file do + File.new(File.join(Rails.root, 'spec/fixtures/course/'\ + 'programming_question_template.zip')) if template_package + end end end
Implement creating a question package as part of the programming question factory.
diff --git a/lib/mrdrive_notification_api/easy_setup.rb b/lib/mrdrive_notification_api/easy_setup.rb index abc1234..def5678 100644 --- a/lib/mrdrive_notification_api/easy_setup.rb +++ b/lib/mrdrive_notification_api/easy_setup.rb @@ -21,11 +21,19 @@ WrongConfigException.missing_config(:publish_key) end - puts "#{publish_key} et #{subscribe_key}" + stdout_logger = Logger.new(STDOUT) pubnub = Pubnub.new( :publish_key => publish_key, - :subscribe_key => subscribe_key + :subscribe_key => subscribe_key, + :error_callback => lambda { |msg| + puts "Error callback says: #{msg.inspect}" + }, + :connect_callback => lambda { |msg| + puts "CONNECTED: #{msg.inspect}" + }, + :logger => stdout_logger ) + NotificationService.instance.pubnub = pubnub NotificationService.instance.channel_prefix = channel_prefix
Add stdout logger and callback for error in Pubsub initiation
diff --git a/lib/mymoip/requests/transparent_request.rb b/lib/mymoip/requests/transparent_request.rb index abc1234..def5678 100644 --- a/lib/mymoip/requests/transparent_request.rb +++ b/lib/mymoip/requests/transparent_request.rb @@ -17,21 +17,19 @@ end def success? - @response && @response["EnviarInstrucaoUnicaResponse"]["Resposta"]["Status"] == "Sucesso" - rescue NoMethodError => e + @response["EnviarInstrucaoUnicaResponse"]["Resposta"]["Status"] == "Sucesso" + rescue NoMethodError false end def token - @response["EnviarInstrucaoUnicaResponse"]["Resposta"]["Token"] || nil - rescue NoMethodError => e - nil + @response["EnviarInstrucaoUnicaResponse"]["Resposta"]["Token"] + rescue NoMethodError end def id @response["EnviarInstrucaoUnicaResponse"]["Resposta"]["ID"] - rescue NoMethodError => e - nil + rescue NoMethodError end end
Remove unused variable in rescue statements
diff --git a/firmata.gemspec b/firmata.gemspec index abc1234..def5678 100644 --- a/firmata.gemspec +++ b/firmata.gemspec @@ -17,6 +17,6 @@ gem.add_development_dependency("pry") - gem.add_runtime_dependency("serialport", ["~> 1.1.0"]) + gem.add_runtime_dependency("hybridgroup-serialport") gem.add_runtime_dependency("event_spitter") end
Update gemspec to use hybridgroup-serialport
diff --git a/test/countries/uy_test.rb b/test/countries/uy_test.rb index abc1234..def5678 100644 --- a/test/countries/uy_test.rb +++ b/test/countries/uy_test.rb @@ -0,0 +1,22 @@+require File.expand_path(File.dirname(__FILE__) + '/../test_helper') + +## Uruguay +# source: http://en.wikipedia.org/wiki/Telephone_numbers_in_Uruguay +class UYTest < Test::Unit::TestCase + + # 02 Montevideo + def test_montevideo + parse_test('+598 2 1234567', '598', '2', '1234567') + end + + # 042 Maldonado + def test_maldonado + parse_test('+598 42 123456', '598', '42', '123456') + end + + # 09 Mobile phones + def test_mobile_phones + parse_test('+598 99 570110', '598', '99', '570110') + end + +end
Add tests for Uruguay area code change
diff --git a/test/restful-api/src/spec/ruby/user_actions_spec.rb b/test/restful-api/src/spec/ruby/user_actions_spec.rb index abc1234..def5678 100644 --- a/test/restful-api/src/spec/ruby/user_actions_spec.rb +++ b/test/restful-api/src/spec/ruby/user_actions_spec.rb @@ -2,12 +2,7 @@ describe "POST" do def user_action(description, context) - <<-JSON - { - description: description, - context: context - } - JSON + "{description: #{description}, context: #{context}}" end it "should successfully create a user action" do
Update integration spec helper to use variables passed to it.
diff --git a/lib/eye/patch/capistrano3.rb b/lib/eye/patch/capistrano3.rb index abc1234..def5678 100644 --- a/lib/eye/patch/capistrano3.rb +++ b/lib/eye/patch/capistrano3.rb @@ -4,6 +4,9 @@ set :eye_config, -> { "config/eye.yml" } set :eye_bin, -> { "eye-patch" } set :eye_roles, -> { :app } + + set :rvm_map_bins, fetch(:rvm_map_bins, []).push(fetch(:eye_bin)) + set :rbenv_map_bins, fetch(:rbenv_map_bins, []).push(fetch(:eye_bin)) set :bundle_bins, fetch(:bundle_bins, []).push(fetch(:eye_bin)) end end
Add rvm and rbenv prefix hooks
diff --git a/lib/niman/cli/application.rb b/lib/niman/cli/application.rb index abc1234..def5678 100644 --- a/lib/niman/cli/application.rb +++ b/lib/niman/cli/application.rb @@ -7,6 +7,8 @@ desc "apply", "Applies a Nimanfile" def apply Niman::Recipe.from_file + rescue LoadError => e + error e.message end end end
Print nice error message when Nimanfile was not found
diff --git a/lib/redis/store/interface.rb b/lib/redis/store/interface.rb index abc1234..def5678 100644 --- a/lib/redis/store/interface.rb +++ b/lib/redis/store/interface.rb @@ -5,8 +5,16 @@ super(key) end + REDIS_SET_OPTIONS = %i(ex px nx xx keepttl).freeze + private_constant :REDIS_SET_OPTIONS + def set(key, value, options = nil) - super(key, value, options || {}) + if options && REDIS_SET_OPTIONS.any? { |k| options.key?(k) } + kwargs = REDIS_SET_OPTIONS.each_with_object({}) { |key, h| h[key] = options[key] if options.key?(key) } + super(key, value, **kwargs) + else + super(key, value) + end end def setnx(key, value, options = nil)
Fix compatibility with redis-rb 4.2
diff --git a/lib/dpl/provider/heroku/git_deploy_key.rb b/lib/dpl/provider/heroku/git_deploy_key.rb index abc1234..def5678 100644 --- a/lib/dpl/provider/heroku/git_deploy_key.rb +++ b/lib/dpl/provider/heroku/git_deploy_key.rb @@ -7,6 +7,7 @@ end def check_auth + super setup_git_ssh end
Revert "Remove explicit need for Heroku authentication." This reverts commit 5e7c3d84fb62e41bf209782a890cdebf3901c669.
diff --git a/lib/tasks/specification.rake b/lib/tasks/specification.rake index abc1234..def5678 100644 --- a/lib/tasks/specification.rake +++ b/lib/tasks/specification.rake @@ -7,9 +7,20 @@ rulesets = Ruleset.subclasses + base_variables = { + "Applicant Number" => { + :name => "Applicant Number", + :type => "Integer" + }, + "State" => { + :name => "State", + :type => "Char(2)" + } + } + configs = rulesets.inject({}){|h, r| h.merge r.configs} - outputs = rulesets.inject({}){|h, r| h.merge r.outputs} - inputs = rulesets.inject({}){|h, r| h.merge r.inputs}.select{|k,_| !(outputs.member? k)} + outputs = base_variables.merge(rulesets.inject({}){|h, r| h.merge r.outputs}) + inputs = base_variables.merge(rulesets.inject({}){|h, r| h.merge r.inputs}.select{|k,_| !(outputs.member? k)}) default_configs = configs.select{|_,v| v.has_key? :default}.inject({}){|new_hash, (k,v)| new_hash.merge({k => v[:default]})}
Add Applicant Number and State
diff --git a/lib/yard/code_objects/namespace_object.rb b/lib/yard/code_objects/namespace_object.rb index abc1234..def5678 100644 --- a/lib/yard/code_objects/namespace_object.rb +++ b/lib/yard/code_objects/namespace_object.rb @@ -3,8 +3,8 @@ attr_reader :children, :cvars, :meths, :constants, :mixins def initialize(namespace, name, *args, &block) - @children = [] - @mixins = [] + @children = CodeObjectList.new(self) + @mixins = CodeObjectList.new(self) super end
Use CodeObjectList again for @children and @mixins (specs work again)
diff --git a/activerecord/test/cases/adapters/mysql2/quoting_test.rb b/activerecord/test/cases/adapters/mysql2/quoting_test.rb index abc1234..def5678 100644 --- a/activerecord/test/cases/adapters/mysql2/quoting_test.rb +++ b/activerecord/test/cases/adapters/mysql2/quoting_test.rb @@ -7,14 +7,14 @@ test 'quoted date precision for gte 5.6.4' do @connection.stubs(:full_version).returns('5.6.4') - @connection.remove_instance_variable(:@version) + @connection.remove_instance_variable(:@version) if @connection.instance_variable_defined?(:@version) t = Time.now.change(usec: 1) assert_match(/\.000001\z/, @connection.quoted_date(t)) end test 'quoted date precision for lt 5.6.4' do @connection.stubs(:full_version).returns('5.6.3') - @connection.remove_instance_variable(:@version) + @connection.remove_instance_variable(:@version) if @connection.instance_variable_defined?(:@version) t = Time.now.change(usec: 1) refute_match(/\.000001\z/, @connection.quoted_date(t)) end
Remove @connection instance variable only when defined
diff --git a/app/decorators/vm_or_template_decorator.rb b/app/decorators/vm_or_template_decorator.rb index abc1234..def5678 100644 --- a/app/decorators/vm_or_template_decorator.rb +++ b/app/decorators/vm_or_template_decorator.rb @@ -12,4 +12,8 @@ def supports_console? console_supported?('spice') || console_supported?('vnc') end + + def supports_cockpit? + supports_launch_cockpit? + end end
Add "supports_cockpit?" to decorators so that it is accessible through the API.
diff --git a/app/controllers/islay/admin/asset_library_controller.rb b/app/controllers/islay/admin/asset_library_controller.rb index abc1234..def5678 100644 --- a/app/controllers/islay/admin/asset_library_controller.rb +++ b/app/controllers/islay/admin/asset_library_controller.rb @@ -1,26 +1,22 @@-module Islay - module Admin - class AssetLibraryController < ApplicationController - header 'Asset Library' - nav_scope :asset_library +class Islay::Admin::AssetsController < Islay::Admin::ApplicationController + header 'Asset Library' + nav_scope :asset_library - def index - @groups = AssetGroup.summary.order('name') - @latest_assets = Asset.limit(11).order("updated_at DESC") - @asset_tags = AssetTag.order('name') - end + def index + @groups = AssetGroup.summary.order('name') + @latest_assets = Asset.limit(11).order("updated_at DESC") + @asset_tags = AssetTag.order('name') + end - def browser - @albums = AssetGroup.of(params[:only]).order('name ASC') + def browser + @albums = AssetGroup.of(params[:only]).order('name ASC') - @assets = if params[:only] - Asset.summaries.of(params[:only]) - else - Asset.latest - end + @assets = if params[:only] + Asset.summaries.of(params[:only]) + else + Asset.latest + end - render :layout => false - end - end + render :layout => false end end
Tweak the namespacing of the asset library controller
diff --git a/app/controllers/spree/admin/user_sessions_controller.rb b/app/controllers/spree/admin/user_sessions_controller.rb index abc1234..def5678 100644 --- a/app/controllers/spree/admin/user_sessions_controller.rb +++ b/app/controllers/spree/admin/user_sessions_controller.rb @@ -11,7 +11,7 @@ def create if @user = login(params[:email], params[:password], params[:remember_me]) flash[:success] = Spree.t(:logged_in_succesfully) - redirect_back_or_default(admin_orders_path) + redirect_back_or_default(after_admin_logged_in_path) else flash.now[:error] = t('sorcery.failure.invalid_key_or_passowrd') render :new @@ -32,4 +32,8 @@ redirect_to(session["spree_user_return_to"] || default) session["spree_user_return_to"] = nil end + + def after_admin_logged_in_path + admin_orders_path + end end
Allow to customize the path redirect to after admin logged in In main application, override the after_admin_logged_in_path method to customize.
diff --git a/app/jobs/nexudus/billing/tariffs/import.rb b/app/jobs/nexudus/billing/tariffs/import.rb index abc1234..def5678 100644 --- a/app/jobs/nexudus/billing/tariffs/import.rb +++ b/app/jobs/nexudus/billing/tariffs/import.rb @@ -0,0 +1,11 @@+module Nexudus::Jobs::Billing + class Tariff + include Sidekiq::Worker + + sidekiq_options queue: :nexudus, retry: true + + def perform + Nexudus::Import::Billing::Tariff.instance.update + end + end +end
Add Sidekiq job for retrieving tariffs.
diff --git a/app/serializer/favourite_object/favourite_serializer.rb b/app/serializer/favourite_object/favourite_serializer.rb index abc1234..def5678 100644 --- a/app/serializer/favourite_object/favourite_serializer.rb +++ b/app/serializer/favourite_object/favourite_serializer.rb @@ -2,6 +2,12 @@ root :favourites attributes :id, :target_id, :target_type, :is_favourited, :description, :third_party_flag, :data + embed :ids, :include => true + has_one :target, polymorphic: true + + def include_target? + (object.third_party_flag != true) + end def description if self.object.third_party_flag == true
Include associated target objects in serialized JSON
diff --git a/app/models/solidus_affirm/configuration.rb b/app/models/solidus_affirm/configuration.rb index abc1234..def5678 100644 --- a/app/models/solidus_affirm/configuration.rb +++ b/app/models/solidus_affirm/configuration.rb @@ -21,5 +21,15 @@ def callback_controller_name @callback_controller_name ||= "affirm" end + + # Allows overriding the main checkout payload serializer + # @!attribute [rw] checkout_payload_serializer + # @see SolidusAffirm::CheckoutPayloadSerializer + # @return [Class] The serializer class that will be used for serializing + # the +SolidusAffirm::CheckoutPayload+ object. + attr_writer :checkout_payload_serializer + def checkout_payload_serializer + @checkout_payload_serializer ||= SolidusAffirm::CheckoutPayloadSerializer + end end end
Make the affirm payload serializer configurable To be able to easily override the serializer that is parsing the CheckoutPayload object to generate the correct JSON payload we introduce and configuration for that. Users can now set the `SolidusAffirm::Config.checkout_payload_serializer` to their own implementation.
diff --git a/gyapbox.gemspec b/gyapbox.gemspec index abc1234..def5678 100644 --- a/gyapbox.gemspec +++ b/gyapbox.gemspec @@ -18,6 +18,7 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] - spec.add_development_dependency "bundler", "~> 1.6" + spec.add_development_dependency "bundler" spec.add_development_dependency "rake" + spec.add_development_dependency "rspec" end
Add RSpec to development dependencies
diff --git a/app/models/manageiq/providers/amazon/network_manager/security_group.rb b/app/models/manageiq/providers/amazon/network_manager/security_group.rb index abc1234..def5678 100644 --- a/app/models/manageiq/providers/amazon/network_manager/security_group.rb +++ b/app/models/manageiq/providers/amazon/network_manager/security_group.rb @@ -1,3 +1,2 @@ class ManageIQ::Providers::Amazon::NetworkManager::SecurityGroup < ::SecurityGroup - has_many :vms, -> { distinct }, :through => :network_ports, :source => :device, :source_type => 'VmOrTemplate' end
Move SecurityGroup relations to base class Move SecurityGroup relations to base class
diff --git a/test/helper.rb b/test/helper.rb index abc1234..def5678 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -1,4 +1,5 @@ require 'tempfile' +require 'minitest/test' require 'simplecov' require 'coveralls'
Make running tests via Rubinius (but not via Travis) pass.
diff --git a/lib/active_record/connection_adapters/oracle_enhanced/column_dumper.rb b/lib/active_record/connection_adapters/oracle_enhanced/column_dumper.rb index abc1234..def5678 100644 --- a/lib/active_record/connection_adapters/oracle_enhanced/column_dumper.rb +++ b/lib/active_record/connection_adapters/oracle_enhanced/column_dumper.rb @@ -23,8 +23,4 @@ end end end - - module ColumnDumper #:nodoc: - prepend ConnectionAdapters::OracleEnhanced::ColumnDumper - end end
Remove incorrect prepend to `ActiveRecord::ColumnDumper` * `ActiveRecord::ColumnDumper` does not exist, it is harmless but should not exist. * This module is included here: https://github.com/rsim/oracle-enhanced/blob/master/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb#L166 ```ruby include ActiveRecord::ConnectionAdapters::OracleEnhanced::ColumnDumper ```
diff --git a/spec/features/groups/user_browse_projects_group_page_spec.rb b/spec/features/groups/user_browse_projects_group_page_spec.rb index abc1234..def5678 100644 --- a/spec/features/groups/user_browse_projects_group_page_spec.rb +++ b/spec/features/groups/user_browse_projects_group_page_spec.rb @@ -21,7 +21,7 @@ visit projects_group_path(group) expect(page).to have_link project.name - expect(page).to have_xpath("//span[@class='label label-warning']", text: 'archived') + expect(page).to have_xpath("//span[@class='badge badge-warning']", text: 'archived') end end end
Fix user browse projects group page spec
diff --git a/lib/fssm.rb b/lib/fssm.rb index abc1234..def5678 100644 --- a/lib/fssm.rb +++ b/lib/fssm.rb @@ -12,6 +12,7 @@ end end +$:.unshift(File.dirname(__FILE__)) require 'pathname' require 'fssm/ext' require 'fssm/support' @@ -21,3 +22,5 @@ require "fssm/backends/#{FSSM::Support.backend.downcase}" FSSM::Backends::Default = FSSM::Backends.const_get(FSSM::Support.backend) +$:.shift +
Handle load path in case FSSM isn't on the load path when required.
diff --git a/diorama.gemspec b/diorama.gemspec index abc1234..def5678 100644 --- a/diorama.gemspec +++ b/diorama.gemspec @@ -15,13 +15,12 @@ s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.md"] - s.add_dependency "rails", "~> 3.2.21" + s.add_dependency "rails", "~> 3.2" - s.add_development_dependency "capybara" - s.add_development_dependency "factory_girl" - s.add_development_dependency "simplecov" - s.add_development_dependency "sqlite3" - s.add_development_dependency "rspec-rails" - s.add_development_dependency "test-unit" - s.add_development_dependency "sqlite3" + s.add_development_dependency "capybara", "~> 1.1" + s.add_development_dependency "factory_girl", "~> 4.5" + s.add_development_dependency "simplecov", "~> 0.10" + s.add_development_dependency "sqlite3", "~> 1.3" + s.add_development_dependency "rspec-rails", "~> 3.3" + s.add_development_dependency "test-unit", "~> 3.1" end
Add version info for gems so that we don't get warnings.
diff --git a/test/test_docopt.rb b/test/test_docopt.rb index abc1234..def5678 100644 --- a/test/test_docopt.rb +++ b/test/test_docopt.rb @@ -1,49 +1,12 @@ require 'test/unit' +require 'pathname' class DocoptTest < Test::Unit::TestCase - def setup - $LOAD_PATH << File.dirname(__FILE__) - load 'example.rb' + + TOPDIR = Pathname.new(__FILE__).dirname.dirname + + def test_docopt_reference_testcases + puts + assert system('python', "test/language_agnostic_tester.py", "test/testee.rb", chdir: TOPDIR) end - - def get_options(argv=[]) - begin - Docopt($DOC, { :argv => argv }) - rescue SystemExit => ex - nil - end - end - - def test_size - options = get_options(['arg']) - assert_equal 16, options.size - end - - def test_option - options = get_options(['arg']) - assert_equal ".svn,CVS,.bzr,.hg,.git", options['--exclude'] - end - - def test_values - options = get_options(['arg']) - assert !options['--help'] - assert !options['-h'] - assert !options['--version'] - assert !options['-v'] - assert !options['--verbose'] - assert !options['--quiet'] - assert !options['-q'] - assert !options['--repeat'] - assert !options['-r'] - assert_equal ".svn,CVS,.bzr,.hg,.git", options['--exclude'] - assert_equal "*.rb", options['--filename'] - assert !options['--select'] - assert !options['--ignore'] - assert !options['--show-source'] - assert !options['--statistics'] - assert !options['--count'] - assert !options['--benchmark'] - assert !options['--testsuite'] - assert !options['--doctest'] - end -end+end
Fix `rake test` to run reference testcases
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,6 +1,3 @@-require 'rubygems' -require 'bundler/setup' - $:.unshift(File.dirname(__FILE__) + '/../lib') $:.unshift(File.dirname(__FILE__)) @@ -10,18 +7,14 @@ require 'shoulda' require 'flexmock/test_unit' +raise "Missing required DB environment variable" unless ENV['DB'] + database_yml = File.dirname(__FILE__) + '/config/database.yml' ETL::Engine.init(:config => database_yml) ETL::Engine.logger = Logger.new(STDOUT) # ETL::Engine.logger.level = Logger::DEBUG ETL::Engine.logger.level = Logger::FATAL -db = YAML::load(IO.read(database_yml))['operational_database']['adapter'] -# allow both mysql2 and mysql adapters -db = db.gsub('mysql2', 'mysql') -raise "Unsupported test db '#{db}'" unless ['mysql', 'postgresql'].include?(db) - -require "connection/#{db}/connection" ActiveRecord::Base.establish_connection :operational_database ETL::Execution::Job.delete_all
Clean up our test helper
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,7 +1,7 @@ if defined?(Rake) && (RUBY_ENGINE != 'jruby' || org.jruby.RubyInstanceConfig.FULL_TRACE_ENABLED) require 'simplecov' SimpleCov.start - SimpleCov.minimum_coverage 85 + SimpleCov.minimum_coverage 83 end $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
Decrease required coverage percentage since it is difficult to test platform specific code and VCS related code
diff --git a/lib/dest.rb b/lib/dest.rb index abc1234..def5678 100644 --- a/lib/dest.rb +++ b/lib/dest.rb @@ -1,5 +1,13 @@-require "dest/version" +require_relative "dest/version" module Dest - # Your code goes here... + + def self.test_file(file_path) + parsed_output = Parser.parse(file_path) + result = Evaluator.new(parsed_output).evaluate + + result_for_formatting = {:file_path => file_path, :result => result} + Formatter.new(result_for_formatting).print + end + end
Add core method that tests a single file ( parses, evaluates and formats )
diff --git a/lib/selected.rb b/lib/selected.rb index abc1234..def5678 100644 --- a/lib/selected.rb +++ b/lib/selected.rb @@ -19,9 +19,9 @@ def controller_matches(controller_name) if controller_name.respond_to?(:=~) - params[:controller] =~ controller_name.to_s + controller_name =~ params[:controller] else - params[:controller] == controller_name.to_s + controller_name.to_s == params[:controller] end end
Fix order in regex matching
diff --git a/liftoff.gemspec b/liftoff.gemspec index abc1234..def5678 100644 --- a/liftoff.gemspec +++ b/liftoff.gemspec @@ -13,6 +13,7 @@ gem.homepage = "" gem.add_dependency "commander", "~> 4.1.2" + gem.add_dependency "xcodeproj", "~> 0.3.4" gem.files = `git ls-files`.split($/) gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
Add xcodeproj as a dependency
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -1,7 +1,7 @@ name 'unifi' maintainer 'Greg Albrecht' maintainer_email 'gba@onbeep.com' -license 'Apache License, Version 2.0' +license 'Apache 2.0' description 'Installs/Configures Ubiquiti UniFi server.' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) version IO.read(File.join(File.dirname(__FILE__), 'VERSION')) rescue '1.0.0'
Use the standard license text This lets scanners detect it correctly
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -10,4 +10,4 @@ if respond_to?(:issues_url) issues_url 'https://github.com/GSI-HPC/sys-chef-cookbook/issues' end -version '1.43.1' +version '1.44.0'
Implement handling of multiple recipients in sys_mail_alias
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -9,4 +9,4 @@ long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) version '0.1.0' -depends 'nginx' +depends 'nginx', '~> 2.7'
Use pessimistic operator for depends
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,4 +6,4 @@ replaces 'vagrant_rbenv' -depends 'rbenv', '1.6.5' +depends 'rbenv', '1.7.1'
Update dependency on rbenv cookbook
diff --git a/recipes/_nginx.rb b/recipes/_nginx.rb index abc1234..def5678 100644 --- a/recipes/_nginx.rb +++ b/recipes/_nginx.rb @@ -6,8 +6,9 @@ # # Override default Nginx attributes -node.set["nginx"]["worker_processes"] = 4 -node.set["nginx"]["worker_connections"] = 768 +node.set["nginx"]["worker_processes"] = 4 +node.set["nginx"]["worker_connections"] = 768 +node.set["nginx"]["default_site_enabled"] = false # Install Nginx and set up nginx.conf include_recipe "nginx::default" @@ -47,8 +48,3 @@ nginx_site "practicingruby" do enable true end - -# Disable default site -nginx_site "default" do - enable false -end
Disable Nginx's default site via node attribute
diff --git a/SHSegueBlocks.podspec b/SHSegueBlocks.podspec index abc1234..def5678 100644 --- a/SHSegueBlocks.podspec +++ b/SHSegueBlocks.podspec @@ -30,5 +30,5 @@ s.source_files = "#{name}/**/*.{h,m}" s.requires_arc = true - spec.dependency 'SHObjectUserInfo', '~> 1.0' + s.dependency 'SHObjectUserInfo', '~> 1.0' end
Switch to s from spec
diff --git a/unparser-cli_wrapper.gemspec b/unparser-cli_wrapper.gemspec index abc1234..def5678 100644 --- a/unparser-cli_wrapper.gemspec +++ b/unparser-cli_wrapper.gemspec @@ -19,6 +19,7 @@ spec.require_paths = ['lib'] spec.add_dependency 'unparser' + spec.add_dependency 'diff-lcs'# until unparser v0.1.17 spec.add_development_dependency 'bundler', '~> 1.7' spec.add_development_dependency 'rake', '~> 10.0' end
Add diff-lcs dependency until unparser v0.1.17
diff --git a/nib.gemspec b/nib.gemspec index abc1234..def5678 100644 --- a/nib.gemspec +++ b/nib.gemspec @@ -29,5 +29,5 @@ s.add_development_dependency('guard-rspec') s.add_development_dependency('guard-rubocop') s.add_development_dependency('simplecov') - s.add_development_dependency('codeclimate-test-reporter', '~> 1.0.5') + s.add_development_dependency('codeclimate-test-reporter', '~> 1.0.6') end
Use latest version of code-climate-test-reporter A recent release will (hopefully) fix issues with reporting test coverage from Codeship. https://github.com/codeclimate/ruby-test-reporter/pull/172
diff --git a/test/cleaning_test.rb b/test/cleaning_test.rb index abc1234..def5678 100644 --- a/test/cleaning_test.rb +++ b/test/cleaning_test.rb @@ -0,0 +1,21 @@+require 'test_helper' + +describe 'Redis::Breadcrumb' do + before do + Redis::Breadcrumb.redis = MockRedis.new + end + + it 'will clean up currently defined keys' do + class CleanUpCurrentKeys < Redis::Breadcrumb + owns :a_key + end + + CleanUpCurrentKeys.redis.set 'a_key', 'hello' + + assert_equal 'hello', CleanUpCurrentKeys.redis.get('a_key') + + CleanUpCurrentKeys.clean! + + assert_nil CleanUpCurrentKeys.redis.get('a_key') + end +end
Add 'will clean up currently defined keys' test
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -5,6 +5,7 @@ description "Installs and configures Rundeck 2.0" long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) version "2.0.4" +depends "runit" depends "sudo" depends "java" depends "apache2"
Revert "remove the runit dependency" This reverts commit c970574c6323d61ba71ea27e770b5b5188217344 [formerly 22f0fef602c93cdf7224d09a1d3ffbccd53ae458]. Former-commit-id: 6213ab53718192e50121eff248f7cb2ad2c59444
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -14,6 +14,6 @@ depends "t3-chef-vault", "~> 1.0.0" depends "t3-mysql", "~> 0.1.3" -depends "php", "= 1.1.2" +depends "php", "= 1.5.0" depends "ssh", "= 0.6.6" depends "build-essential" , "= 6.0.4"
[TASK] Raise dependency for php cookbook to 1.5.0
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -2,11 +2,15 @@ maintainer 'Chef Software, Inc.' maintainer_email 'cookbooks@chef.io' license 'Apache 2.0' -description 'Installs/Configures yum-elrepo' +description 'Installs and configures the elrepo yum repository' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) version '0.2.2' -depends 'yum', '~> 3.0' +depends 'yum', '~> 3.2' source_url 'https://github.com/chef-cookbooks/yum-elrepo' if respond_to?(:source_url) issues_url 'https://github.com/chef-cookbooks/yum-elrepo/issues' if respond_to?(:issues_url) + +%w(amazon centos fedora oracle redhat scientific).each do |os| + supports os +end
Improve description, bump requirement to yum 3.2
diff --git a/db/migrate/101_add_hash_to_info_request.rb b/db/migrate/101_add_hash_to_info_request.rb index abc1234..def5678 100644 --- a/db/migrate/101_add_hash_to_info_request.rb +++ b/db/migrate/101_add_hash_to_info_request.rb @@ -6,7 +6,7 @@ # Create the missing events for requests already sent InfoRequest.all.each do |info_request| - info_request.idhash = Digest::SHA1.hexdigest(info_request.id.to_s + Configuration::incoming_email_secret)[0,8] + info_request.idhash = Digest::SHA1.hexdigest(info_request.id.to_s + AlaveteliConfiguration::incoming_email_secret)[0,8] info_request.save! end change_column :info_requests, :idhash, :string, :null => false
Update reference to Configuration to reflect name change to AlaveteliConfiguration