diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/app/models/startup.rb b/app/models/startup.rb index abc1234..def5678 100644 --- a/app/models/startup.rb +++ b/app/models/startup.rb @@ -1,6 +1,5 @@ class Startup < ActiveRecord::Base belongs_to :user - # has_and_belongs_to_many :markets # Alias for acts_as_taggable_on :tags acts_as_ordered_taggable acts_as_ordered_taggable_on :markets @@ -10,17 +9,4 @@ validates_length_of :name, :maximum => 40 validates_length_of :pitch, :maximum => 100 - # def markets=(markets) - # markets = markets.split(",") - - # existing_markets = Market.where(name: markets) - - # self.markets << existing_markets - - # (markets - existing_markets.map(&:name)).each do |name| - # self.markets << Market.create(name: name) - # end - - # end - end
Remove commented out markets setter method
diff --git a/SwiftyReceiptValidator.podspec b/SwiftyReceiptValidator.podspec index abc1234..def5678 100644 --- a/SwiftyReceiptValidator.podspec +++ b/SwiftyReceiptValidator.podspec @@ -11,7 +11,7 @@ s.swift_version = '5.0' s.requires_arc = true -s.ios.deployment_target = '10.3' +s.ios.deployment_target = '11.0' s.source = { :git => 'https://github.com/crashoverride777/swifty-receipt-validator.git',
Update pod spec deployment target to ios 11.0
diff --git a/attributes/default.rb b/attributes/default.rb index abc1234..def5678 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -21,4 +21,4 @@ default[:seyren][:application_name] = 'seyren' default[:seyren][:application_path] = '/opt/seyren' default[:seyren][:application_version] = '1.0.0' -default[:seyren][:war_uri] = 'https://github.com/scobal/seyren/releases/download/1.0.0/seyren-1.0.0.war' +default[:seyren][:war_uri] = 'http://dl.bintray.com/obazoud/generic/seyren-web-1.0.0.war'
Change war uri to bintray. Chef have some probleme with github's redirect.
diff --git a/test/tss_test.rb b/test/tss_test.rb index abc1234..def5678 100644 --- a/test/tss_test.rb +++ b/test/tss_test.rb @@ -6,6 +6,6 @@ end def test_it_does_something_useful - assert false + assert true end end
Make all skeleton tests pass to test travis-ci integration
diff --git a/app/models/fluentd/agent/td_agent/unix.rb b/app/models/fluentd/agent/td_agent/unix.rb index abc1234..def5678 100644 --- a/app/models/fluentd/agent/td_agent/unix.rb +++ b/app/models/fluentd/agent/td_agent/unix.rb @@ -4,16 +4,20 @@ module Unix def start backup_running_config do - detached_command('/etc/init.d/td-agent start') + detached_command("systemctl start td-agent.service") end end def stop - detached_command('/etc/init.d/td-agent stop') + detached_command("systemctl stop td-agent.service") end def restart - detached_command('/etc/init.d/td-agent restart') + detached_command("systemctl restart td-agent.service") + end + + def reload + detached_command("systemctl reload td-agent.service") end end end
Use systemctl instead of /etc/init.d/td-agent Because td-agent3 supports systemd. Signed-off-by: Kenji Okimoto <7a4b90a0a1e6fc688adec907898b6822ce215e6c@clear-code.com>
diff --git a/app/presenters/jadu_xml/file_presenter.rb b/app/presenters/jadu_xml/file_presenter.rb index abc1234..def5678 100644 --- a/app/presenters/jadu_xml/file_presenter.rb +++ b/app/presenters/jadu_xml/file_presenter.rb @@ -8,7 +8,7 @@ end def checksum - Digest::MD5.file(represented.path).hexdigest + Digest::MD5.hexdigest(represented.read) end end end
Use hexdigest so we get the checksum when we use S3
diff --git a/app/serializers/api/v1/user_serializer.rb b/app/serializers/api/v1/user_serializer.rb index abc1234..def5678 100644 --- a/app/serializers/api/v1/user_serializer.rb +++ b/app/serializers/api/v1/user_serializer.rb @@ -11,11 +11,42 @@ end link(:self) { api_user_path(object.id) } - link(:github) { "https://github.com/#{object.github_handle}" } - link(:linkedin) { "https://linkedin.com/in/#{object.linkedin_handle}" } - link(:medium) { "https://medium.com/@#{object.medium_handle}" } - link(:tumblr) { object.tumblr_url } - link(:twitter) { "https://twitter.com/#{object.twitter_handle}" } + link(:github) { + { + meta: { + rel: 'github', + title: "@#{object.github_handle}" + }, + href: "https://github.com/#{object.github_handle}" + } + } + link(:linkedin) { + { + meta: { + rel: 'linkedin', + title: object.linkedin_handle + }, + href: "https://linkedin.com/in/#{object.linkedin_handle}" + } + } + link(:medium) { + { + meta: { + rel: 'medium', + title: "@#{object.medium_handle}" + }, + href: "https://medium.com/@#{object.medium_handle}" + } + } + link(:twitter) { + { + meta: { + rel: 'twitter', + title: "@#{object.twitter_handle}", + }, + href: "https://twitter.com/#{object.twitter_handle}" + } + } has_many :projects has_many :skills
Return metadata for user links in V1 API
diff --git a/lib/buckaruby/currency.rb b/lib/buckaruby/currency.rb index abc1234..def5678 100644 --- a/lib/buckaruby/currency.rb +++ b/lib/buckaruby/currency.rb @@ -3,5 +3,7 @@ module Buckaruby module Currency EURO = "EUR" + BRITISH_POUND = "GBP" + US_DOLLAR = "USD" end end
Add currencies GBP and USD.
diff --git a/spec/support/shoulda/matchers/rails_shim.rb b/spec/support/shoulda/matchers/rails_shim.rb index abc1234..def5678 100644 --- a/spec/support/shoulda/matchers/rails_shim.rb +++ b/spec/support/shoulda/matchers/rails_shim.rb @@ -0,0 +1,27 @@+# monkey patch which fixes serialization matcher in Rails 5 +# https://github.com/thoughtbot/shoulda-matchers/issues/913 +# This can be removed when a new version of shoulda-matchers +# is released +module Shoulda + module Matchers + class RailsShim + def self.serialized_attributes_for(model) + if defined?(::ActiveRecord::Type::Serialized) + # Rails 5+ + serialized_columns = model.columns.select do |column| + model.type_for_attribute(column.name).is_a?( + ::ActiveRecord::Type::Serialized + ) + end + + serialized_columns.inject({}) do |hash, column| # rubocop:disable Style/EachWithObject + hash[column.name.to_s] = model.type_for_attribute(column.name).coder + hash + end + else + model.serialized_attributes + end + end + end + end +end
Fix shoulda-matchers in Rails 5 Backports a fix for https://github.com/thoughtbot/shoulda-matchers/issues/913. This can be removed once new shoulda-matchers version is released.
diff --git a/lib/kosmos/package_dsl.rb b/lib/kosmos/package_dsl.rb index abc1234..def5678 100644 --- a/lib/kosmos/package_dsl.rb +++ b/lib/kosmos/package_dsl.rb @@ -6,9 +6,5 @@ FileUtils.cp_r(File.join(@download_dir, from), File.join(@ksp_path, destination)) end - - def remove(path, opts = {}) - FileUtils.rm_rf(File.join(@ksp_path, path)) - end end end
Revert "add the options for packages to remove file or folders in their install scripts"
diff --git a/test/test_verbose_formatter.rb b/test/test_verbose_formatter.rb index abc1234..def5678 100644 --- a/test/test_verbose_formatter.rb +++ b/test/test_verbose_formatter.rb @@ -1,14 +1,29 @@ require_relative './helper' class VerboseFormatterTest < Test::Unit::TestCase + class ErrorHighlightDummyFormatter + def message_for(spot) + "" + end + end + def setup require_relative File.join(DidYouMean::TestHelper.root, 'verbose') DidYouMean.formatter = DidYouMean::VerboseFormatter.new + + if defined?(ErrorHighlight) + @error_highlight_old_formatter = ErrorHighlight.formatter + ErrorHighlight.formatter = ErrorHighlightDummyFormatter.new + end end def teardown DidYouMean.formatter = DidYouMean::PlainFormatter.new + + if defined?(ErrorHighlight) + ErrorHighlight.formatter = @error_highlight_old_formatter + end end def test_message
Disable error_highlight when testing did_you_mean Fixes #160
diff --git a/app/helpers/campaign_helper.rb b/app/helpers/campaign_helper.rb index abc1234..def5678 100644 --- a/app/helpers/campaign_helper.rb +++ b/app/helpers/campaign_helper.rb @@ -6,27 +6,24 @@ end def formatted_organisation_name(publication) - organisation_name = organisation_attr(publication, 'formatted_name') || "" + organisation_name = organisation_attributes(publication).fetch("formatted_name", "") ERB::Util.html_escape(organisation_name).strip.gsub(/(?:\r?\n)/, "<br/>").html_safe end def organisation_url(publication) - organisation_attr(publication, 'url') + organisation_attributes(publication)["url"] end def organisation_crest(publication) - organisation_attr(publication, 'crest') + organisation_attributes(publication)["crest"] end def organisation_brand_colour(publication) - organisation_attr(publication, 'brand_colour') + organisation_attributes(publication)["brand_colour"] end private - - def organisation_attr(publication, attr_name) - if org_attrs = publication.details['organisation'] - org_attrs[attr_name] - end + def organisation_attributes(publication) + publication.details.fetch("organisation", {}) end end
Refactor campaign helper organisation methods Previously the organisation_attr method was doing 2 things - • checking the publication has organisation details • accessing a value from those details Refactored to only do the checking, as we want to use the attributes in a different way to fix a bug.
diff --git a/app/models/product_category.rb b/app/models/product_category.rb index abc1234..def5678 100644 --- a/app/models/product_category.rb +++ b/app/models/product_category.rb @@ -9,6 +9,9 @@ scope :by_enterprise, lambda { |enterprise| { :joins => :products, :conditions => ['products.profile_id = ?', enterprise.id] + }} + scope :by_environment, lambda { |environment| { + :conditions => ['environment_id = ?', environment.id] }} scope :unique_by_level, lambda { |level| { :select => "DISTINCT ON (filtered_category) split_part(path, '/', #{level}) AS filtered_category, categories.*"
Add scope to search product categories by environment
diff --git a/lib/archetype/resourceful/parameters.rb b/lib/archetype/resourceful/parameters.rb index abc1234..def5678 100644 --- a/lib/archetype/resourceful/parameters.rb +++ b/lib/archetype/resourceful/parameters.rb @@ -6,7 +6,7 @@ included do define_method "#{resource_instance_name}_params" do context = action_name.to_sym - attr_params = resourceful.attributes(context).map(&:param) + attr_params = attributes.for(context).map(&:param) params.require(resource_instance_name).permit(attr_params) end protected "#{resource_instance_name}_params"
Fix params for extracted attributes
diff --git a/config/application.rb b/config/application.rb index abc1234..def5678 100644 --- a/config/application.rb +++ b/config/application.rb @@ -22,5 +22,7 @@ # Do not swallow errors in after_commit/after_rollback callbacks. config.active_record.raise_in_transactional_callbacks = true + + config.time_zone = "America/Los_Angeles" end end
Configure timezone so times show in Pacific time by default
diff --git a/lib/codelation/development/dot_files.rb b/lib/codelation/development/dot_files.rb index abc1234..def5678 100644 --- a/lib/codelation/development/dot_files.rb +++ b/lib/codelation/development/dot_files.rb @@ -6,12 +6,16 @@ # Install dot files and load them into ~/.bash_profile def install_dot_files + # Copy dot files to user's home directory copy_file "dot_files/.codelation.bash", "~/.codelation.bash" copy_file "dot_files/.git-completion.bash", "~/.git-completion.bash" copy_file "dot_files/.git-prompt.sh", "~/.git-prompt.sh" copy_file "dot_files/.jshintrc", "~/.jshintrc" copy_file "dot_files/.rubocop.yml", "~/.rubocop.yml" copy_file "dot_files/.scss-lint.yml", "~/.scss-lint.yml" + + # Add `source ~/.codelation.bash` to ~/.bash_profile if it doesn't exist + append_to_file "~/.bash_profile", "source ~/.codelation.bash" end end end
Add source ~/.codelation.bash to ~/.bash_profile
diff --git a/config/application.rb b/config/application.rb index abc1234..def5678 100644 --- a/config/application.rb +++ b/config/application.rb @@ -1,16 +1,9 @@ require File.expand_path('../boot', __FILE__) -# Silence warnings while loading Rails gems, since we're using Ruby 2.6 and Rails 4, -# we would otherwise get "warning: BigDecimal.new is deprecated; use BigDecimal() method instead." -old_verbose, $VERBOSE = $VERBOSE, nil -begin - require 'active_record/railtie' - require 'action_controller/railtie' - require 'action_mailer/railtie' - require 'sprockets/railtie' -ensure - $VERBOSE = old_verbose -end +require 'active_record/railtie' +require 'action_controller/railtie' +require 'action_mailer/railtie' +require 'sprockets/railtie' I18n.config.enforce_available_locales = false
Revert "silence warnings while loading rails gems" This reverts commit 171ea5edcd8ca5374deb809690f86f61caeba8d9.
diff --git a/config/application.rb b/config/application.rb index abc1234..def5678 100644 --- a/config/application.rb +++ b/config/application.rb @@ -21,6 +21,7 @@ # config.i18n.default_locale = :de config.assets.precompile << /\.(?:svg|eot|woff|ttf)$/ + config.assets.precompile << 'base.js' # Required for working dashboard JSON PUTs. # See http://stackoverflow.com/a/25428800/915941.
Add base.js to assets:precompile list. base.js was not being precompiled in production, which broke pages that relied on its presence.
diff --git a/config/application.rb b/config/application.rb index abc1234..def5678 100644 --- a/config/application.rb +++ b/config/application.rb @@ -24,7 +24,7 @@ # Do not swallow errors in after_commit/after_rollback callbacks. config.active_record.raise_in_transactional_callbacks = true - # Here we're storing our worklist (XML) files for dcm4che's dcmof. - config.worklist_dir = ENV['MWL_DIR'] || File.join(Rails.root, 'worklist') + # Where should Mowoli store the XML files for dcm4che2? + config.worklist_dir = ENV.fetch('MWL_DIR') end end
Raise error if variable MWL_DIR is not set.
diff --git a/config/initializers/cookies_serializer.rb b/config/initializers/cookies_serializer.rb index abc1234..def5678 100644 --- a/config/initializers/cookies_serializer.rb +++ b/config/initializers/cookies_serializer.rb @@ -1,3 +1,3 @@ # Be sure to restart your server when you modify this file. -Rails.application.config.action_dispatch.cookies_serializer = :json +# Rails.application.config.action_dispatch.cookies_serializer = :json
Fix bug with devise and mongoid current_user, user_signed_in ... works :)
diff --git a/app/application.rb b/app/application.rb index abc1234..def5678 100644 --- a/app/application.rb +++ b/app/application.rb @@ -2,25 +2,18 @@ module CherryTomato class Application < Sinatra::Base - use AssetLoader + use AssetsHelper + use SessionsHelper + + helpers SessionsHelper::UserSession + + # Twitter auth + use OmniAuth::Builder do + provider :twitter, ENV['TWITTER_KEY'], ENV['TWITTER_SECRET'] + end get '/' do erb :timer - end - - # Twitter auth - use OmniAuth::Builder do - provider :twitter, 'key', 'secret' - end - - configure do - enable :sessions - end - - helpers do - def current_user? - session[:user] - end end get '/public' do @@ -28,7 +21,7 @@ end get '/private' do - halt(401, 'Unauthorized') unless current_user? + halt(401, 'Unauthorized') unless logged_in? 'private' end @@ -37,12 +30,24 @@ end get '/auth/twitter/callback' do - session[:user] = true - env['omniauth.auth'] + response = env['omniauth.auth'] + + if response + user_repo = ROMConfig.new.repository(UserRepository) + user = user_repo.by_uid(response.uid) + unless user + user = user_repo.create(username: response.info.nickname, uid: response.uid) + end + + session[:user] = user.to_h + redirect to '/' + else + halt(401, 'Unauthorized') + end end get '/logout' do - session[:user] = nil + logout! "Logged out" end end
Add after Twitter login logic
diff --git a/spec/requests/healthcheck_spec.rb b/spec/requests/healthcheck_spec.rb index abc1234..def5678 100644 --- a/spec/requests/healthcheck_spec.rb +++ b/spec/requests/healthcheck_spec.rb @@ -1,6 +1,13 @@ RSpec.describe "/healthcheck" do + before do + get "/healthcheck" + end + + it "returns a 200 HTTP status" do + expect(response).to have_http_status(:ok) + end + it "returns database connection status" do - get "/healthcheck" json = JSON.parse(response.body) expect(json["checks"]).to include("database_connectivity")
Add 200 ok healthcheck test
diff --git a/spec/unit/install_command_spec.rb b/spec/unit/install_command_spec.rb index abc1234..def5678 100644 --- a/spec/unit/install_command_spec.rb +++ b/spec/unit/install_command_spec.rb @@ -18,11 +18,23 @@ describe "When the Podfile does not specify the xcodeproject" do before do config.stubs(:rootspec).returns(Pod::Podfile.new { platform :ios; dependency 'AFNetworking'}) + @installer = Pod::Command::Install.new(Pod::Command::ARGV.new) end - it "raises an informative error if the xcodproj is not specified in the podfile" do - installer = Pod::Command::Install.new(Pod::Command::ARGV.new) - should.raise(Pod::Informative) { installer.run } + it "raises an informative error" do + should.raise(Pod::Informative) { @installer.run } end + end + + describe "When the Podfile specifies xcodeproj to an invalid path" do + before do + config.stubs(:rootspec).returns(Pod::Podfile.new { platform :ios; xcodeproj 'nonexistent/project.xcodeproj'; dependency 'AFNetworking'}) + @installer = Pod::Command::Install.new(Pod::Command::ARGV.new) + end + + it "raises an informative error" do + should.raise(Pod::Informative) {@installer.run} + end + end end
Raise an informative error when Podfile specifies xcodeproj to an invalid path
diff --git a/app/models/user.rb b/app/models/user.rb index abc1234..def5678 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -15,18 +15,16 @@ end def self.find(id) return nil unless id.present? - Rails.cache.fetch("/api/users/#{id}.json") do user = super id - user.groups.each do |group| + user.relationships.each do |group| user.groups = OpenStruct.new(group.attributes).to_h end user - end end def committees @committees ||= Committee.all.select do |c| - groups.include?(c.slug) + relationships.each { | relationship | relationship.superGroup.include?(c.slug) } end end
Fix drop down menu authentication
diff --git a/app/models/user.rb b/app/models/user.rb index abc1234..def5678 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,9 +1,14 @@ class User < ActiveRecord::Base before_save :set_permission - has_one :recent_post, class_name: "Space", foreign_key: "poster_id" + has_many :spaces, foreign_key: "poster_id" has_one :recent_claim, class_name: "Space", foreign_key: "claimer_id" + def recent_post + self.spaces[-1].id + end + private + def set_permission if self.spaces_posted/self.spaces_consumed < 0.8
Fix some shit...delete post issues. Add associaiton
diff --git a/lib/analytical/modules/google_universal.rb b/lib/analytical/modules/google_universal.rb index abc1234..def5678 100644 --- a/lib/analytical/modules/google_universal.rb +++ b/lib/analytical/modules/google_universal.rb @@ -20,6 +20,8 @@ ga('create', '#{options[:key]}', '#{options[:domain]}'); ga('send', 'pageview'); + // Adjust bounce rate to only visitors that spend less than 15 sec on page + setTimeout(“ga(‘send’,’event’,’Valid Pageview’,’time on page more than 15 seconds’)”,15000); </script> HTML
Add bounce rate fix to Google UA settings
diff --git a/lib/rubocop/cop/rspec/instance_variable.rb b/lib/rubocop/cop/rspec/instance_variable.rb index abc1234..def5678 100644 --- a/lib/rubocop/cop/rspec/instance_variable.rb +++ b/lib/rubocop/cop/rspec/instance_variable.rb @@ -23,6 +23,8 @@ MESSAGE = 'Use `let` instead of an instance variable'.freeze + include RuboCop::RSpec::SpecOnly + EXAMPLE_GROUP_METHODS = RuboCop::RSpec::Language::ExampleGroups::ALL + RuboCop::RSpec::Language::SharedGroups::ALL
Change RSpec/InstanceVariable to only check specs Fixes #115
diff --git a/config/application.rb b/config/application.rb index abc1234..def5678 100644 --- a/config/application.rb +++ b/config/application.rb @@ -24,6 +24,5 @@ config.autoload_paths += Dir["#{config.root}/lib/**/"] config.assets.precompile += %w( bootstrap-material.css ) config.active_record.raise_in_transactional_callbacks = true - config.cache_store = :dalli_store end end
Remove dalli store from global config
diff --git a/lib/active_ums/extensions/kaminari.rb b/lib/active_ums/extensions/kaminari.rb index abc1234..def5678 100644 --- a/lib/active_ums/extensions/kaminari.rb +++ b/lib/active_ums/extensions/kaminari.rb @@ -44,5 +44,6 @@ end ActiveUMS::Base.send(:include, Kaminari::ActiveUMS::ActiveUMSExtension) +ActiveUMS::Relation.send(:include, Kaminari::ActiveUMS::ActiveUMSExtension) ActiveUMS::Relation.send(:include, Kaminari::PageScopeMethods) ActiveUMS::Relation.send(:include, Kaminari::ActiveUMS::ActiveUMSCriteriaMethods)
Include ActiveUMSExtension to Relation for Kaminari extension
diff --git a/mipt/app/controllers/courses_controller.rb b/mipt/app/controllers/courses_controller.rb index abc1234..def5678 100644 --- a/mipt/app/controllers/courses_controller.rb +++ b/mipt/app/controllers/courses_controller.rb @@ -1,5 +1,6 @@ class CoursesController < ApplicationController def index + @courses = Course.all end def new
Complete index action in courses controller
diff --git a/btc_ticker.gemspec b/btc_ticker.gemspec index abc1234..def5678 100644 --- a/btc_ticker.gemspec +++ b/btc_ticker.gemspec @@ -21,7 +21,7 @@ spec.require_paths = ["lib"] spec.add_development_dependency "bundler", "~> 1.14" - spec.add_development_dependency "rake", "~> 10.0" + spec.add_development_dependency "rake", "~> 12.0" spec.add_development_dependency "rspec", "~> 3.0" spec.add_development_dependency "webmock", "~> 2.3"
Update Rake from 10.0 to 12.0
diff --git a/lib/rails_4_session_flash_backport.rb b/lib/rails_4_session_flash_backport.rb index abc1234..def5678 100644 --- a/lib/rails_4_session_flash_backport.rb +++ b/lib/rails_4_session_flash_backport.rb @@ -7,6 +7,8 @@ require 'rails_4_session_flash_backport/rails2/session_with_indifferent_access' when 3 require 'rails_4_session_flash_backport/rails3/flash_hash' +when 4 + Rails.logger.warn "You're on Rails 4 so it's probably safe to remove the rails_4_session_flash_backport gem!" else Rails.logger.warn "rails_4_session_flash_backport doesnt yet do anything on Rails #{Rails.version}" end
Add Rails 4 specific warning
diff --git a/lib/trogdir/versions/v1/photos_api.rb b/lib/trogdir/versions/v1/photos_api.rb index abc1234..def5678 100644 --- a/lib/trogdir/versions/v1/photos_api.rb +++ b/lib/trogdir/versions/v1/photos_api.rb @@ -21,8 +21,8 @@ params do requires :type, type: Symbol, values: Photo::TYPES requires :url, type: String - optional :height, type: Integer - optional :width, type: Integer + requires :height, type: Integer + requires :width, type: Integer end post do present @person.photos.create!(clean_params(except: :person_id)), with: PhotoEntity
Make photo height and width required to match the requirements of the model
diff --git a/library/zlib/gzipwriter/write_spec.rb b/library/zlib/gzipwriter/write_spec.rb index abc1234..def5678 100644 --- a/library/zlib/gzipwriter/write_spec.rb +++ b/library/zlib/gzipwriter/write_spec.rb @@ -31,6 +31,6 @@ Zlib::GzipWriter.wrap @io do |gzio| gzio.write input end - @io.string.size.should == 8174 + @io.string.size.should == 8176 end end
Fix expectation in a zlib spec
diff --git a/config/initializers/gds-sso.rb b/config/initializers/gds-sso.rb index abc1234..def5678 100644 --- a/config/initializers/gds-sso.rb +++ b/config/initializers/gds-sso.rb @@ -1,6 +1,6 @@ GDS::SSO.config do |config| config.user_model = "User" - config.oauth_id = ENV["OAUTH_ID"] - config.oauth_secret = ENV["OAUTH_SECRET"] + config.oauth_id = ENV["OAUTH_ID"] || "abcdefg" + config.oauth_secret = ENV["OAUTH_SECRET"] || "secret" config.oauth_root_url = Plek.find("signon") end
Add fallback OAuth ID and secret This commit adds a fallback OAuth ID and secret. This will allow the signon-munging script for development to configure signon for this app locally.
diff --git a/spec/helpers/application_helper/buttons/instance_migrate.rb b/spec/helpers/application_helper/buttons/instance_migrate.rb index abc1234..def5678 100644 --- a/spec/helpers/application_helper/buttons/instance_migrate.rb +++ b/spec/helpers/application_helper/buttons/instance_migrate.rb @@ -0,0 +1,40 @@+describe ApplicationHelper::Button::InstanceMigrate do + describe '#disabled?' do + it "when the live migrate action is available then the button is not disabled" do + view_context = setup_view_context_with_sandbox({}) + button = described_class.new( + view_context, {}, {"record" => object_double(VmCloud.new, :is_available? => true)}, {} + ) + expect(button.disabled?).to be false + end + + it "when the live migrate action is unavailable then the button is disabled" do + view_context = setup_view_context_with_sandbox({}) + button = described_class.new( + view_context, {}, {"record" => object_double(VmCloud.new, :is_available? => false)}, {} + ) + expect(button.disabled?).to be true + end + end + + describe '#calculate_properties' do + it "when the live migrate action is unavailable the button has the error in the title" do + view_context = setup_view_context_with_sandbox({}) + button = described_class.new( + view_context, {}, {"record" => object_double( + VmCloud.new, :is_available? => false, :is_available_now_error_message => "unavailable")}, {} + ) + button.calculate_properties + expect(button[:title]).to eq("unavailable") + end + + it "when the live migrate is avaiable, the button has no error in the title" do + view_context = setup_view_context_with_sandbox({}) + button = described_class.new( + view_context, {}, {"record" => object_double(VmCloud.new, :is_available? => true)}, {} + ) + button.calculate_properties + expect(button[:title]).to be nil + end + end +end
Add test for the Live Migrate button class
diff --git a/spec/unit/rom/support/deprecations_spec.rb b/spec/unit/rom/support/deprecations_spec.rb index abc1234..def5678 100644 --- a/spec/unit/rom/support/deprecations_spec.rb +++ b/spec/unit/rom/support/deprecations_spec.rb @@ -3,7 +3,7 @@ RSpec.describe ROM::Deprecations do let(:log_file) do - Tempfile.new + Tempfile.new('rom_deprecations') end before do
Fix specs for older rubies
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index abc1234..def5678 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -2,4 +2,24 @@ # Prevent CSRF attacks by raising an exception. # For APIs, you may want to use :null_session instead. protect_from_forgery with: :exception + + before_action :configure_permitted_parameters, if: :devise_controller? + + after_filter :store_location + + def store_location + session[:previous_url] = + request.fullpath if !request.fullpath.match('/customers') && + !request.fullpath.match('/shops') && !request.xhr? + end + + def after_sign_in_path_for(_resource) + # session[:previous_url] || root_path + root_path + end + + def configure_permitted_parameters + devise_parameter_sanitizer.for(:sign_up) << :email + devise_parameter_sanitizer.for(:sign_in) << :email + end end
Configure devise methods in application controller
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index abc1234..def5678 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -3,8 +3,21 @@ # For APIs, you may want to use :null_session instead. protect_from_forgery with: :exception + before_action :set_locale + helper_method :course_slug_path def course_slug_path(slug) course_path(:id => slug).gsub("%2F", "/") end + + def set_locale + I18n.locale = params[:locale] || I18n.default_locale + end + + def default_url_options(options = {}) + if I18n.locale != I18n.default_locale + { locale: I18n.locale }.merge options + end + options + end end
Add locale handling to the controller This will parse the "locale" parameter, and append to any local URLs. Use it like: http://localhost:3000/?locale=es
diff --git a/app/mailers/semi_static/comment_mailer.rb b/app/mailers/semi_static/comment_mailer.rb index abc1234..def5678 100644 --- a/app/mailers/semi_static/comment_mailer.rb +++ b/app/mailers/semi_static/comment_mailer.rb @@ -5,7 +5,7 @@ email = SemiStatic::Engine.config.has?('comment_email') || SemiStatic::Engine.config.has?('contact_email') @comment = comment - @host = SemiStatic::Engine.config.mail_host + @host = URI.parse(SemiStatic::Engine.config.localeDomains[@comment.entry.tag.locale]).host @locale = :en mail(:from => SemiStatic::Engine.config.mailer_from, :to => email, :subject => subject) end
Fix host name bug in URL for blog comments
diff --git a/app/overrides/add_klarna_error_message.rb b/app/overrides/add_klarna_error_message.rb index abc1234..def5678 100644 --- a/app/overrides/add_klarna_error_message.rb +++ b/app/overrides/add_klarna_error_message.rb @@ -1,10 +1,3 @@-Deface::Override.new( - virtual_path: "spree/admin/orders/edit", - insert_top: "[data-hook='admin_order_edit_header']", - name: "add_klarna_error_message", - partial: "spree/admin/orders/error_message" -) - Deface::Override.new( virtual_path: "spree/admin/orders/customer_details/_form", insert_top: "[data-hook='admin_customer_detail_form_fields']",
Remove Klarna warning message from Shipments As the information that is displayed in shipments will not affect Klarana's security information it is safe to modify it.
diff --git a/app/serializers/feed_import_serializer.rb b/app/serializers/feed_import_serializer.rb index abc1234..def5678 100644 --- a/app/serializers/feed_import_serializer.rb +++ b/app/serializers/feed_import_serializer.rb @@ -29,6 +29,8 @@ :created_at, :updated_at + has_many :feed_schedule_imports + def feed_onestop_id object.feed.onestop_id end
Add has_many :feed_schedule_imports to FeedImport serializer
diff --git a/spec/default_spec.rb b/spec/default_spec.rb index abc1234..def5678 100644 --- a/spec/default_spec.rb +++ b/spec/default_spec.rb @@ -21,7 +21,7 @@ let(:chef_run) do ChefSpec::SoloRunner.new( platform: 'centos', - version: '6.8' + version: '6.9' ).converge(described_recipe) end
Update specs to the latest platform versions Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
diff --git a/app/services/network_visibility_service.rb b/app/services/network_visibility_service.rb index abc1234..def5678 100644 --- a/app/services/network_visibility_service.rb +++ b/app/services/network_visibility_service.rb @@ -4,15 +4,15 @@ field_names_to_edit = [] if show_dns_settings?(sysprep_enabled, supports_pxe, supports_iso) - field_names_to_edit += [:addr_mode, :dns_suffixes, :dns_servers] + field_names_to_edit += %i(addr_mode dns_suffixes dns_servers) if show_ip_settings?(addr_mode, supports_pxe, supports_iso) - field_names_to_edit += [:ip_addr, :subnet_mask, :gateway] + field_names_to_edit += %i(ip_addr subnet_mask gateway) else - field_names_to_hide += [:ip_addr, :subnet_mask, :gateway] + field_names_to_hide += %i(ip_addr subnet_mask gateway) end else - field_names_to_hide += [:addr_mode, :ip_addr, :subnet_mask, :gateway, :dns_servers, :dns_suffixes] + field_names_to_hide += %i(addr_mode ip_addr subnet_mask gateway dns_servers dns_suffixes) end {:hide => field_names_to_hide, :edit => field_names_to_edit}
Fix rubocop warnings in NetworkVisibilityService
diff --git a/spec/quantum_spec.rb b/spec/quantum_spec.rb index abc1234..def5678 100644 --- a/spec/quantum_spec.rb +++ b/spec/quantum_spec.rb @@ -8,7 +8,7 @@ end describe '.leap' do - the_past = Time.new(1956, 9, 13, 15, 00) + let(:the_past) { Time.new(1956, 9, 13, 15, 00) } it 'changes the current time' do Quantum.leap(the_past) @@ -17,8 +17,8 @@ end describe '.leap_back' do - the_present = Time.new - the_past = Time.new(1972, 6, 15, 15, 00) + let(:the_present) { Time.new } + let(:the_past) { Time.new(1972, 6, 15, 15, 00) } it 'returns to the present time' do Quantum.leap(the_past)
Use let instead of local variables
diff --git a/app/views/api/v1/notes/index.json.jbuilder b/app/views/api/v1/notes/index.json.jbuilder index abc1234..def5678 100644 --- a/app/views/api/v1/notes/index.json.jbuilder +++ b/app/views/api/v1/notes/index.json.jbuilder @@ -2,5 +2,8 @@ # json.extract! note, :id, :title, :body_text, :body_html, :created_at, :updated_at json.id note.id json.title note.title + json.body_text note.body_text + json.body_html note.body_html + json.created_at note.created_at json.url api_v1_note_url(note, format: :json, api_key: params[:api_key]) end
Add other notes attributes to returned JSON
diff --git a/app/models/manageiq/providers/ansible_operations_workflow.rb b/app/models/manageiq/providers/ansible_operations_workflow.rb index abc1234..def5678 100644 --- a/app/models/manageiq/providers/ansible_operations_workflow.rb +++ b/app/models/manageiq/providers/ansible_operations_workflow.rb @@ -0,0 +1,92 @@+class ManageIQ::Providers::AnsibleOperationsWorkflow < Job + def self.create_job(env_vars, extra_vars, playbook_path, timeout: 1.hour, poll_interval: 1.minute) + options = { + :env_vars => env_vars, + :extra_vars => extra_vars, + :playbook_path => playbook_path, + :timeout => timeout, + :poll_interval => poll_interval, + } + + super(name, options) + end + + def pre_playbook + # A step before running the playbook for any optional setup tasks + queue_signal(:run_playbook) + end + + def run_playbook + env_vars, extra_vars, playbook_path = options.values_at(:env_vars, :extra_vars, :playbook_path) + + uuid = Ansible::Runner.run_async(env_vars, extra_vars, playbook_path) + if uuid.nil? + queue_signal(:error) + else + context[:ansible_runner_uuid] = uuid + update_attributes!(:context => context) + + queue_signal(:poll_runner) + end + end + + def poll_runner + if Ansible::Runner.running?(context[:ansible_runner_uuid]) + queue_signal(:poll_runner, :deliver_on => deliver_on) + else + queue_signal(:post_playbook) + end + end + + def post_playbook + # A step after running the playbook for any optional cleanup tasks + queue_signal(:finish) + end + + alias initializing dispatch_start + alias start pre_playbook + alias finish process_finished + alias abort_job process_abort + alias cancel process_cancel + alias error process_error + + protected + + def queue_signal(*args, deliver_on: nil) + role = options[:role] || "ems_operations" + priority = options[:priority] || MiqQueue::NORMAL_PRIORITY + + MiqQueue.put( + :class_name => self.class.name, + :method_name => "signal", + :instance_id => id, + :priority => priority, + :role => role, + :zone => zone, + :task_id => guid, + :args => args, + :deliver_on => deliver_on, + :server_guid => MiqServer.my_server.guid, + ) + end + + def deliver_on + Time.now.utc + options[:poll_interval] + end + + def load_transitions + self.state ||= 'initialize' + + { + :initializing => {'initialize' => 'waiting_to_start'}, + :start => {'waiting_to_start' => 'pre_playbook'}, + :run_playbook => {'pre_playbook' => 'running'}, + :poll_runner => {'running' => 'running'}, + :post_playbook => {'running' => 'post_playbook'}, + :finish => {'*' => 'finished'}, + :abort_job => {'*' => 'aborting'}, + :cancel => {'*' => 'canceling'}, + :error => {'*' => '*'} + } + end +end
Add a state machine for long ansible operations This adds a Job state machine for long running async ansible operations.
diff --git a/rails/attributes/rails.rb b/rails/attributes/rails.rb index abc1234..def5678 100644 --- a/rails/attributes/rails.rb +++ b/rails/attributes/rails.rb @@ -4,4 +4,4 @@ # log rotation via logrotate default[:rails][:logrotate][:interval] = 'daily' -default[:rails][:logrotate][:keep_for] = 365+default[:rails][:logrotate][:keep_for] = 7
Change default number of days logs hang out for now that we back them up off server.
diff --git a/railties/lib/rails/cli.rb b/railties/lib/rails/cli.rb index abc1234..def5678 100644 --- a/railties/lib/rails/cli.rb +++ b/railties/lib/rails/cli.rb @@ -6,7 +6,7 @@ Rails::ScriptRailsLoader.exec_script_rails! require 'rails/ruby_version_check' -Signal.trap("INT") { puts; exit } +Signal.trap("INT") { puts; exit(1) } if ARGV.first == 'plugin' ARGV.shift
Exit with non-zero to signal failure.
diff --git a/lib/ello/kinesis_consumer/s3_processor.rb b/lib/ello/kinesis_consumer/s3_processor.rb index abc1234..def5678 100644 --- a/lib/ello/kinesis_consumer/s3_processor.rb +++ b/lib/ello/kinesis_consumer/s3_processor.rb @@ -7,15 +7,10 @@ def run! @stream_reader.run! do |record, opts| @logger.debug "#{opts[:schema_name]}: #{record}" - upload_record_to_s3(opts) + obj = s3_bucket.object("#{ENV['KINESIS_STREAM_NAME']}/#{opts[:shard_id]}/#{opts[:sequence_number]}") + obj.put(body: opts[:raw_data], server_side_encryption: 'AES256') end end - - def upload_record_to_s3(opts) - obj = s3_bucket.object("#{ENV['KINESIS_STREAM_NAME']}/#{opts[:shard_id]}/#{opts[:sequence_number]}") - obj.put(body: opts[:raw_data], server_side_encryption: 'AES256') - end - add_transaction_tracer :upload_record_to_s3, category: :task private
Revert "Add new relic tracking for s3 uploads" This reverts commit 20e9a892ed7b75853192b5bfeaf00b49654bf47e.
diff --git a/lib/mindbody-api/services/site_service.rb b/lib/mindbody-api/services/site_service.rb index abc1234..def5678 100644 --- a/lib/mindbody-api/services/site_service.rb +++ b/lib/mindbody-api/services/site_service.rb @@ -5,7 +5,7 @@ operation :get_sites operation :get_locations, :locals => false - operation :get_activation_code, :locals => false + operation :get_activation_code operation :get_programs operation :get_session_types operation :get_resources
Add ability to pass locals to activation code
diff --git a/railties/test/commands/runner_test.rb b/railties/test/commands/runner_test.rb index abc1234..def5678 100644 --- a/railties/test/commands/runner_test.rb +++ b/railties/test/commands/runner_test.rb @@ -0,0 +1,61 @@+# frozen_string_literal: true + +require "isolation/abstract_unit" +require "rails/command" +require "rails/commands/runner/runner_command" + +class Rails::RunnerTest < ActiveSupport::TestCase + include ActiveSupport::Testing::Isolation + + setup :build_app + teardown :teardown_app + + def test_rails_runner_with_stdin + command_output = `echo "puts 'Hello world'" | #{app_path}/bin/rails runner -` + + assert_equal <<~OUTPUT, command_output + Hello world + OUTPUT + end + + def test_rails_runner_with_file + # We intentionally define a file with a name that matches the one of the + # script that we want to run to ensure that runner executes the latter one. + app_file "lib/foo.rb", "# Lib file" + + app_file "foo.rb", <<-RUBY + puts "Hello world" + RUBY + + assert_equal <<~OUTPUT, run_runner_command("foo.rb") + Hello world + OUTPUT + end + + def test_rails_runner_with_ruby_code + assert_equal <<~OUTPUT, run_runner_command('puts "Hello world"') + Hello world + OUTPUT + end + + def test_rails_runner_with_syntax_error_in_ruby_code + command_output = run_runner_command("This is not ruby code", allow_failure: true) + + assert_match(/Please specify a valid ruby command/, command_output) + assert_equal 1, $?.exitstatus + end + + def test_rails_runner_with_name_error_in_ruby_code + assert_raise(NameError) { IDoNotExist } + + command_output = run_runner_command("IDoNotExist.new", allow_failure: true) + + assert_match(/Please specify a valid ruby command/, command_output) + assert_equal 1, $?.exitstatus + end + + private + def run_runner_command(argument, allow_failure: false) + rails "runner", argument, allow_failure: allow_failure + end +end
Add tests for rails runner * Refs #42007
diff --git a/app/models/breeze/pay_online/payment_form.rb b/app/models/breeze/pay_online/payment_form.rb index abc1234..def5678 100644 --- a/app/models/breeze/pay_online/payment_form.rb +++ b/app/models/breeze/pay_online/payment_form.rb @@ -18,8 +18,10 @@ save_data_to controller.session unless self.next.next? # TODO: I think we need to overwrite this bit - application = form.application_class.factory(self) - application.save + Payment.create! :name => request.params[:form][:customer_name], + :email => request.params[:form][:email], + :reference => request.params[:form][:reference], + :amount => request.params[:form][:amount] end controller.redirect_to form.permalink and return false end @@ -29,8 +31,10 @@ controller.redirect_to form.permalink and return false end end - - super # this could be problematic + Rails.logger.debug 'here' + Breeze::Content::PageView.instance_method(:render!).bind(self).call + Rails.logger.debug 'and here' + #super # this could be problematic end end
Create payment instead of Application
diff --git a/Casks/a-better-finder-rename.rb b/Casks/a-better-finder-rename.rb index abc1234..def5678 100644 --- a/Casks/a-better-finder-rename.rb +++ b/Casks/a-better-finder-rename.rb @@ -0,0 +1,7 @@+class ABetterFinderRename < Cask + url 'http://www.publicspace.net/download/ABFRX.dmg' + homepage 'http://www.publicspace.net/ABetterFinderRename/' + version 'latest' + no_checksum + link 'A Better Finder Rename 9.app' +end
Add A Better Findeer Ranem app
diff --git a/Casks/synology-cloud-station.rb b/Casks/synology-cloud-station.rb index abc1234..def5678 100644 --- a/Casks/synology-cloud-station.rb +++ b/Casks/synology-cloud-station.rb @@ -1,6 +1,6 @@ cask :v1 => 'synology-cloud-station' do - version '3.2-3484' - sha256 'aa544573ca9f7d3cb6693cba2406901a8b5e241eba0ed12762346c2f31b7c0cd' + version '3.2-3487' + sha256 'c2446bb15ce0e113253635a3457643c260f9c92cf9aec5e4d69b5d49c2592631' url "https://global.download.synology.com/download/Tools/CloudStation/#{version}/Mac/Installer/synology-cloud-station-#{version.sub(%r{.*-},'')}.dmg" name 'Synology Cloud Station'
Update Synology Cloud Station to v3.2-3487
diff --git a/spec/acceptance/statsd_exporter_spec.rb b/spec/acceptance/statsd_exporter_spec.rb index abc1234..def5678 100644 --- a/spec/acceptance/statsd_exporter_spec.rb +++ b/spec/acceptance/statsd_exporter_spec.rb @@ -0,0 +1,54 @@+require 'spec_helper_acceptance' + +describe 'prometheus statsd exporter' do + it 'statsd_exporter works idempotently with no errors' do + pp = 'include prometheus::statsd_exporter' + # Run it twice and test for idempotency + apply_manifest(pp, catch_failures: true) + apply_manifest(pp, catch_changes: true) + end + + describe 'prometheus statsd exporter version 0.5.0' do + it ' statsd_exporter installs with version 0.5.0' do + pp = "class {'prometheus::statsd_exporter': version => '0.5.0' }" + # Run it twice and test for idempotency + apply_manifest(pp, catch_failures: true) + apply_manifest(pp, catch_changes: true) + end + describe process('statsd_exporter') do + its(:args) { is_expected.to match %r{\ -statsd.mapping-config} } + end + describe service('statsd_exporter') do + it { is_expected.to be_running } + it { is_expected.to be_enabled } + end + describe port(9102) do + it { is_expected.to be_listening.with('tcp6') } + end + describe port(9125) do + it { is_expected.to be_listening.with('udp6') } + end + end + + describe 'prometheus statsd exporter version 0.7.0' do + it ' statsd_exporter installs with version 0.7.0' do + pp = "class {'prometheus::statsd_exporter': version => '0.7.0' }" + # Run it twice and test for idempotency + apply_manifest(pp, catch_failures: true) + apply_manifest(pp, catch_changes: true) + end + describe process('statsd_exporter') do + its(:args) { is_expected.to match %r{\ --statsd.mapping-config} } + end + describe service('statsd_exporter') do + it { is_expected.to be_running } + it { is_expected.to be_enabled } + end + describe port(9102) do + it { is_expected.to be_listening.with('tcp6') } + end + describe port(9125) do + it { is_expected.to be_listening.with('udp6') } + end + end +end
Add acceptance test for statsd_exporter
diff --git a/spec/features/pages/revisioning_spec.rb b/spec/features/pages/revisioning_spec.rb index abc1234..def5678 100644 --- a/spec/features/pages/revisioning_spec.rb +++ b/spec/features/pages/revisioning_spec.rb @@ -0,0 +1,27 @@+require 'spec_helper' + +describe 'pages revisioning' do + + before :each do + login_as_admin + georgia_page = create(:georgia_page) + visit georgia.page_path(georgia_page) + end + + it 'starts a new draft' do + click_link 'Start a new draft' + page.should have_content('draft') + end + + it 'asks for a review' do + click_link 'Start a new draft' + click_link 'Ask for Review' + end + + it 'approves a review' do + click_link 'Start a new draft' + click_link 'Ask for Review' + click_link 'Approve' + end + +end
Add basic revisioning flow spec
diff --git a/spec/helpers/fortitude_rails_helpers.rb b/spec/helpers/fortitude_rails_helpers.rb index abc1234..def5678 100644 --- a/spec/helpers/fortitude_rails_helpers.rb +++ b/spec/helpers/fortitude_rails_helpers.rb @@ -4,6 +4,16 @@ def rails_server_project_root @rails_server_project_root ||= File.expand_path(File.join(File.dirname(__FILE__), '../..')) end + + def rails_server_additional_gemfile_lines + [ + "gem 'fortitude', :path => '#{rails_server_project_root}'" + ] + end + + def rails_server_default_version + ENV['FORTITUDE_SPECS_RAILS_VERSION'] + end end end end
Move the last of the Fortitude-specific stuff back into this gem.
diff --git a/spec/integration/serializable_spec.rb b/spec/integration/serializable_spec.rb index abc1234..def5678 100644 --- a/spec/integration/serializable_spec.rb +++ b/spec/integration/serializable_spec.rb @@ -4,7 +4,10 @@ class Serializable include Memoizable - def method; end + + def method + rand(10000) + end memoize :method end @@ -12,8 +15,20 @@ let(:serializable) do Serializable.new end + + before do + serializable.method # Call the method to trigger lazy memoization + end + it 'is serializable with Marshal' do - serializable.method # Call the method to trigger lazy memoization expect { Marshal.dump(serializable) }.not_to raise_error end + + it 'is deserializable with Marshal' do + serialized = Marshal.dump(serializable) + deserialized = Marshal.load(serialized) + + expect(deserialized).to be_an_instance_of(Serializable) + expect(deserialized.method).to eql(serializable.method) + end end
Add integration test for deserialization with Marshal
diff --git a/lib/capistrano/tasks/copy.rake b/lib/capistrano/tasks/copy.rake index abc1234..def5678 100644 --- a/lib/capistrano/tasks/copy.rake +++ b/lib/capistrano/tasks/copy.rake @@ -2,11 +2,14 @@ archive_name = "archive.tar.gz" include_dir = fetch(:include_dir) || "*" - exclude_dir = fetch(:exclude_dir) || "" + exclude_dir = Array(fetch(:exclude_dir)) + + exclude_args = exclude_dir.map { |dir| "--exclude '#{dir}'"} desc "Archive files to #{archive_name}" file archive_name => FileList[include_dir].exclude(archive_name) do |t| - sh "tar -cvzf #{t.name} #{t.prerequisites.join(" ")}" + (exclude_dir.empty? ? "" : " --exclude #{exclude_dir}") + cmd = ["tar -cvzf #{t.name}", *exclude_args, *t.prerequisites] + sh cmd.join(' ') end desc "Deploy #{archive_name} to release_path"
Fix --exclude argument order to work on OS X. Allow exlude_dir to be an Array
diff --git a/lib/jimsy/git/clone_service.rb b/lib/jimsy/git/clone_service.rb index abc1234..def5678 100644 --- a/lib/jimsy/git/clone_service.rb +++ b/lib/jimsy/git/clone_service.rb @@ -6,7 +6,7 @@ SAFE_HOSTS = %w[github.com bitbucket.org].freeze def initialize(uri, code_dir) - @uri = URI(uri) + @raw_uri = uri @code_dir = File.expand_path(code_dir) end @@ -28,7 +28,21 @@ private - attr_reader :uri, :code_dir + attr_reader :raw_uri, :code_dir + + def uri + return @parsed_uri if @parsed_uri + return @parsed_uri = parse_git_uri if git_uri? + @parsed_uri = URI(raw_uri) + end + + def parse_git_uri + URI("ssh://#{raw_uri.sub(':', '/')}") + end + + def git_uri? + raw_uri =~ /^git@/ + end def uri_dir File.dirname(uri.path)
Make `git clone` work with ssh non-urls.
diff --git a/lib/list_pull_requests/user.rb b/lib/list_pull_requests/user.rb index abc1234..def5678 100644 --- a/lib/list_pull_requests/user.rb +++ b/lib/list_pull_requests/user.rb @@ -25,12 +25,16 @@ puts "Retrieving list of pulls....".red page = 1 begin - json = JSON.parse(open(url + "&page=#{page}").read) - amount ||= json["total_count"] - json["items"].each do |pr| - all << ListPullRequests::Pr.new(pr["pull_request"]["url"], pr["html_url"], pr["title"], pr["created_at"]) - end - page += 1 + # begin + json = JSON.parse(open(url + "&page=#{page}").read) + amount ||= json["total_count"] + json["items"].each do |pr| + all << ListPullRequests::Pr.new(pr["pull_request"]["url"], pr["html_url"], pr["title"], pr["created_at"]) + end + page += 1 + # rescue OpenURI::HTTPError + # puts "error control" + # end end until all.count == amount all end
Add preliminary error control for open-uri
diff --git a/lib/tasks/metadata_tagger.rake b/lib/tasks/metadata_tagger.rake index abc1234..def5678 100644 --- a/lib/tasks/metadata_tagger.rake +++ b/lib/tasks/metadata_tagger.rake @@ -2,5 +2,5 @@ desc "Apply metadata from the json file" task :tag_metadata do - Indexer::MetadataTagger.amend_indexes_for_file(file_path) + Indexer::MetadataTagger.amend_all_metadata end
Call 'amend_all_metadata' in tag_metadata task This was renamed in 1645f66.
diff --git a/dots-formatter/ruby/dots-formatter.gemspec b/dots-formatter/ruby/dots-formatter.gemspec index abc1234..def5678 100644 --- a/dots-formatter/ruby/dots-formatter.gemspec +++ b/dots-formatter/ruby/dots-formatter.gemspec @@ -1,12 +1,12 @@ # encoding: utf-8 Gem::Specification.new do |s| - s.name = 'dots-formatter' + s.name = 'cucumber-formatter-dots' s.version = '1.0.0' s.authors = ["Matt Wynne", "Aslak Hellesøy"] s.description = 'Dots formatter for cucumber' s.summary = "#{s.name}-#{s.version}" s.email = 'cukes@googlegroups.com' - s.homepage = "https://github.com/cucumber/cucumber-formatter-ruby" + s.homepage = "https://github.com/cucumber/dots-formatter-ruby" s.platform = Gem::Platform::RUBY s.license = "MIT" s.required_ruby_version = ">= 1.9.3"
Rename dots formatter Ruby gem to be idiomatic
diff --git a/db/migrate/20160117202815_create_sendings.rb b/db/migrate/20160117202815_create_sendings.rb index abc1234..def5678 100644 --- a/db/migrate/20160117202815_create_sendings.rb +++ b/db/migrate/20160117202815_create_sendings.rb @@ -0,0 +1,11 @@+class CreateSendings < ActiveRecord::Migration + def change + create_table :sendings do |t| + t.references :notification, index: true, foreign_key: true + t.string :type + t.timestamp :sending_at + + t.timestamps null: false + end + end +end
Add sending migration to create sendings table
diff --git a/features/support/app_installation_hooks.rb b/features/support/app_installation_hooks.rb index abc1234..def5678 100644 --- a/features/support/app_installation_hooks.rb +++ b/features/support/app_installation_hooks.rb @@ -8,11 +8,13 @@ scenario = scenario.scenario_outline if scenario.respond_to?(:scenario_outline) feature = scenario.feature - if FeatureMemory.feature != feature || ENV['RESET_BETWEEN_SCENARIOS'] == '1' + # Changes default behaviour to only reinstall on new test runs to encourage + # separating scenarios into multiple feature files. + if FeatureMemory.feature == nil || ENV['RESET_BETWEEN_SCENARIOS'] == '1' if ENV['RESET_BETWEEN_SCENARIOS'] == '1' log 'New scenario - reinstalling apps' else - log 'First scenario in feature - reinstalling apps' + log 'First scenario of new test run - reinstalling apps' end uninstall_apps
Change default behaviour to not reinstall apps when starting a new feature file
diff --git a/wateringServer/spec/controllers/waterings_controller_spec.rb b/wateringServer/spec/controllers/waterings_controller_spec.rb index abc1234..def5678 100644 --- a/wateringServer/spec/controllers/waterings_controller_spec.rb +++ b/wateringServer/spec/controllers/waterings_controller_spec.rb @@ -19,10 +19,16 @@ end describe 'POST #create' do - it 'can create the new' do + it 'can create the new watering' do post :create, params: { plant_id: plant.id, watering: { amount: 200, date: Date.today()}} expect(Watering.last.amount).to eq 200 end + + it 'can pass errors back after a failure' do + post :create, params: { plant_id: plant.id, watering: { amount: 200, + date: ""}} + expect(assigns(:errors)).to eq ["Date can't be blank"] + end end end
Add test for errors on post to waterings
diff --git a/core/main/def_spec.rb b/core/main/def_spec.rb index abc1234..def5678 100644 --- a/core/main/def_spec.rb +++ b/core/main/def_spec.rb @@ -1,14 +1,27 @@ require File.expand_path('../../../spec_helper', __FILE__) require File.expand_path('../fixtures/classes', __FILE__) + +script_binding = binding describe "main#def" do after :each do Object.send(:remove_method, :foo) end - it "sets the visibility of the given method to private" do + it "sets the visibility of the given method to private for TOPLEVEL_BINDING" do eval "def foo; end", TOPLEVEL_BINDING Object.should have_private_method(:foo) end + + it "sets the visibility of the given method to private for the script binding" do + eval "def foo; end", script_binding + Object.should have_private_method(:foo) + end + + it "sets the visibility of the given method to private when defined in a block" do + eval "1.times { def foo; end }", script_binding + Object.should have_private_method(:foo) + end + end
Add specs for visibility of top level methods and script binding
diff --git a/lib/capistrano-nvie-git-workflow/tasks.rb b/lib/capistrano-nvie-git-workflow/tasks.rb index abc1234..def5678 100644 --- a/lib/capistrano-nvie-git-workflow/tasks.rb +++ b/lib/capistrano-nvie-git-workflow/tasks.rb @@ -28,13 +28,18 @@ end task :set_from_tag do - ENV['git_log_command'] = 'log --pretty=format:"%h %ad %s [%an]" --date=short' unless ENV['git_log_command'] if fetch(:stage) == :production _cset :from_tag, choose_deployment_tag + else + set :branch, choose_deployment_branch end end - before "git:commit_log", "git:set_from_tag" + task :set_log_command do + ENV['git_log_command'] = fetch(:git_log_command, 'log --pretty=format:"%h %ad %s [%an]" --date=short') unless ENV['git_log_command'] + end + + before "git:commit_log", "git:set_from_tag", "git:set_log_command" end
Choose deployment branch before git:commit_log
diff --git a/lib/elmas/resources/sales_invoice_line.rb b/lib/elmas/resources/sales_invoice_line.rb index abc1234..def5678 100644 --- a/lib/elmas/resources/sales_invoice_line.rb +++ b/lib/elmas/resources/sales_invoice_line.rb @@ -16,7 +16,7 @@ SHARED_LINE_ATTRIBUTES.inject( [ :employee, :end_time, :line_number, :start_time, :subscription, - :VAT_amount_DC, :VAT_amount_FC + :VAT_amount_DC, :VAT_amount_FC, :GL_account ], :<< )
Support setting ledger id on invoice lines
diff --git a/lib/coderay/encoders/token_class_filter.rb b/lib/coderay/encoders/token_class_filter.rb index abc1234..def5678 100644 --- a/lib/coderay/encoders/token_class_filter.rb +++ b/lib/coderay/encoders/token_class_filter.rb @@ -21,8 +21,9 @@ end def text_token text, kind - [text, kind] if !@exclude.include?(kind) && - (@include == :all || @include.include?(kind)) + [text, kind] if \ + (@include == :all || @include.include?(kind)) && + !(@exclude == :all || @exclude.include?(kind)) end end
TokenClassFilter: Support for :exclud => :all. git-svn-id: 3003a0d67ecddf9b67dc4af6cf35c502b83f6d3b@370 282260fa-4eda-c845-a9f0-6527b7353f92
diff --git a/lib/to_source/proc/parser19/extensions.rb b/lib/to_source/proc/parser19/extensions.rb index abc1234..def5678 100644 --- a/lib/to_source/proc/parser19/extensions.rb +++ b/lib/to_source/proc/parser19/extensions.rb @@ -4,12 +4,15 @@ module Extensions module Result + POS, TYP, VAL = 0, 1, 2 + ROW, COL= 0, 1 + def same_as_curr_line same_line(curr_line) end def curr_line - curr[0][0] + curr[POS][ROW] end def curr @@ -20,11 +23,11 @@ ( # ignore the current node self[0..-2].reverse.take_while do |e| - if e[1] == :on_semicolon && e[-1] == ';' + if e[TYP] == :on_semicolon && e[VAL] == ';' false - elsif e[0][0] == line + elsif e[POS][ROW] == line true - elsif e[1] == :on_sp && e[-1] == "\\\n" + elsif e[TYP] == :on_sp && e[VAL] == "\\\n" line -= 1 true end @@ -35,14 +38,14 @@ def keywords(*types) ( types = [types].flatten - select{|e| e[1] == :on_kw && (types.empty? or types.include?(e[-1])) } + select{|e| e[TYP] == :on_kw && (types.empty? or types.include?(e[VAL])) } ).extend(Extensions::Result) end def non_spaces(*types) ( types = [types].flatten - reject{|e| e[1] == :on_sp && (types.empty? or types.include?(e[-1])) } + reject{|e| e[TYP] == :on_sp && (types.empty? or types.include?(e[VAL])) } ).extend(Extensions::Result) end
Use constants instead of literal to ease maintenance.
diff --git a/lib/puppet/functions/get_opengrok_fname.rb b/lib/puppet/functions/get_opengrok_fname.rb index abc1234..def5678 100644 --- a/lib/puppet/functions/get_opengrok_fname.rb +++ b/lib/puppet/functions/get_opengrok_fname.rb @@ -4,7 +4,7 @@ end def get_opengrok_fname(opengrok_url) - a = opengrok_url.lines('/') + a = opengrok_url.split('/') a.last end
Use split rather than lines Signed-off-by: Jordan Conway <bb3bf96ee76b8b43aa7e5815135ed8d69362d4f1@linuxfoundation.org>
diff --git a/nanoc/lib/nanoc/filters/erb.rb b/nanoc/lib/nanoc/filters/erb.rb index abc1234..def5678 100644 --- a/nanoc/lib/nanoc/filters/erb.rb +++ b/nanoc/lib/nanoc/filters/erb.rb @@ -27,7 +27,7 @@ # Get result trim_mode = params[:trim_mode] - erb = ::ERB.new(content, nil, trim_mode) + erb = ::ERB.new(content, trim_mode: trim_mode) erb.filename = filename erb.result(assigns_binding) end
Switch ERB to use keyword arguments Positional arguments were deprecated in Ruby 3. Change is backwards-compatible to Ruby 2.3. Resolves #1547.
diff --git a/spec/factories/axiom_selection_factory.rb b/spec/factories/axiom_selection_factory.rb index abc1234..def5678 100644 --- a/spec/factories/axiom_selection_factory.rb +++ b/spec/factories/axiom_selection_factory.rb @@ -1,14 +1,34 @@ FactoryGirl.define do factory :axiom_selection do - association :proof_attempt_configuration + after(:build) do |axiom_selection| + unless axiom_selection.proof_attempt_configuration + proof_attempt = build :proof_attempt + axiom_selection.proof_attempt_configuration = + proof_attempt.proof_attempt_configuration + end + end end factory :manual_axiom_selection do + after(:build) do |mas| + unless mas.proof_attempt_configuration + proof_attempt = build :proof_attempt + mas.axiom_selection.proof_attempt_configuration = + proof_attempt.proof_attempt_configuration + end + end end factory :sine_axiom_selection do commonness_threshold { 0 } depth_limit { -1 } tolerance { 1.0 } + after(:build) do |sas| + unless sas.proof_attempt_configuration + proof_attempt = build :proof_attempt + sas.axiom_selection.proof_attempt_configuration = + proof_attempt.proof_attempt_configuration + end + end end end
Fix axiom selection factories not properly creating ProofAttempts.
diff --git a/app/models/fan.rb b/app/models/fan.rb index abc1234..def5678 100644 --- a/app/models/fan.rb +++ b/app/models/fan.rb @@ -18,7 +18,7 @@ end def debut_show - @debut_show ||= shows.last + @debut_show ||= shows.ordered.last end def shows_since_debut
Order shows properly for debut
diff --git a/spec/lib/training/training_loader_spec.rb b/spec/lib/training/training_loader_spec.rb index abc1234..def5678 100644 --- a/spec/lib/training/training_loader_spec.rb +++ b/spec/lib/training/training_loader_spec.rb @@ -1,24 +1,55 @@ # frozen_string_literal: true + require 'rails_helper' require "#{Rails.root}/lib/training/training_loader" require "#{Rails.root}/lib/training_slide" describe TrainingLoader do describe '#load_content' do - let(:content_class) { TrainingSlide } + before do + allow(Features).to receive(:wiki_trainings?).and_return(true) + end + let(:subject) do TrainingLoader.new(content_class: content_class, path_to_yaml: "#{Rails.root}/training_content/none/*.yml", trim_id_from_filename: false, - wiki_base_page: 'Training modules/dashboard/slides-test') + wiki_base_page: wiki_base_page) end - before do - allow(Features).to receive(:wiki_trainings?).and_return(true) + + describe 'for slides' do + let(:content_class) { TrainingSlide } + let(:wiki_base_page) { 'Training modules/dashboard/slides-test' } + + it 'returns an array of training content' do + VCR.use_cassette 'training/load_from_wiki' do + slides = subject.load_content + expect(slides.first.content).not_to be_empty + end + end end - it 'returns an array of training content' do - VCR.use_cassette 'training/load_from_wiki' do - slides = subject.load_content - expect(slides.first.content).not_to be_empty + + describe 'for modules' do + let(:content_class) { TrainingModule } + let(:wiki_base_page) { 'Training modules/dashboard/modules-test' } + + it 'returns an array of training content' do + VCR.use_cassette 'training/load_from_wiki' do + modules = subject.load_content + expect(modules.first.slug).not_to be_empty + end + end + end + + describe 'for libraries' do + let(:content_class) { TrainingLibrary } + let(:wiki_base_page) { 'Training modules/dashboard/libraries-test' } + + it 'returns an array of training content' do + VCR.use_cassette 'training/load_from_wiki' do + libraries = subject.load_content + expect(libraries.first.slug).not_to be_empty + end end end end
Extend TrainingLoader spec to test all training content classes
diff --git a/app/mailers/team_user_mailer.rb b/app/mailers/team_user_mailer.rb index abc1234..def5678 100644 --- a/app/mailers/team_user_mailer.rb +++ b/app/mailers/team_user_mailer.rb @@ -6,8 +6,7 @@ @team = team @requestor = requestor @url = URI.join(origin, "/members") - @handle = requestor.provider.blank? ? requestor.email : "#{requestor.login} at #{requester.provider}" - puts @handle + @handle = requestor.provider.blank? ? requestor.email : "#{requestor.login} at #{requestor.provider}" owners = team.owners if !owners.empty? && !owners.include?(@requestor) recipients = owners.map(&:email).reject{ |m| m.blank? }
Fix team link and add user handle to email
diff --git a/app/models/categories/gender.rb b/app/models/categories/gender.rb index abc1234..def5678 100644 --- a/app/models/categories/gender.rb +++ b/app/models/categories/gender.rb @@ -20,5 +20,13 @@ "M" end end + + def men? + gender == "M" + end + + def women? + gender == "F" + end end end
Add men? and women? convenience methods
diff --git a/app/models/unit_activity_set.rb b/app/models/unit_activity_set.rb index abc1234..def5678 100644 --- a/app/models/unit_activity_set.rb +++ b/app/models/unit_activity_set.rb @@ -1,6 +1,8 @@ class UnitActivitySet < ActiveRecord::Base belongs_to :unit belongs_to :activity_type + + has_many :campus_activity_sets # Always check for presence of whole model instead of id # So validate presence of unit not unit_id
ENHANCE: Add has many relationship between unit and campus sets
diff --git a/app/presenters/gui_presenter.rb b/app/presenters/gui_presenter.rb index abc1234..def5678 100644 --- a/app/presenters/gui_presenter.rb +++ b/app/presenters/gui_presenter.rb @@ -3,8 +3,8 @@ attr_reader :guis_info def initialize - @yaml = YAML.load_file('resources/guis.yml') - @guis_info = @yaml["guis"] + yaml = YAML.load_file('resources/guis.yml') + @guis_info = yaml["guis"] end @@instance = GuiPresenter.new
Remove unneeded instance variable from GUI yaml parser
diff --git a/lib/jwt/jwk/rsa.rb b/lib/jwt/jwk/rsa.rb index abc1234..def5678 100644 --- a/lib/jwt/jwk/rsa.rb +++ b/lib/jwt/jwk/rsa.rb @@ -1,4 +1,6 @@ # frozen_string_literal: true + +require 'forwardable' module JWT module JWK
Add forwardable dependency for JWK RSA KeyFinder Fixes #316.
diff --git a/lib/rbvmomi/pbm.rb b/lib/rbvmomi/pbm.rb index abc1234..def5678 100644 --- a/lib/rbvmomi/pbm.rb +++ b/lib/rbvmomi/pbm.rb @@ -0,0 +1,66 @@+# Copyright (c) 2012 VMware, Inc. All Rights Reserved. +require 'rbvmomi' + +module RbVmomi + +# A connection to one vSphere ProfileBasedManagement endpoint. +# @see #serviceInstance +class PBM < Connection + # Connect to a vSphere ProfileBasedManagement endpoint + # + # @param [VIM] Connection to main vSphere API endpoint + # @param [Hash] opts The options hash. + # @option opts [String] :host Host to connect to. + # @option opts [Numeric] :port (443) Port to connect to. + # @option opts [Boolean] :ssl (true) Whether to use SSL. + # @option opts [Boolean] :insecure (false) If true, ignore SSL certificate errors. + # @option opts [String] :path (/pbm/sdk) SDK endpoint path. + # @option opts [Boolean] :debug (false) If true, print SOAP traffic to stderr. + def self.connect vim, opts = {} + fail unless opts.is_a? Hash + opts[:host] = vim.host + opts[:ssl] = true unless opts.member? :ssl or opts[:"no-ssl"] + opts[:insecure] ||= false + opts[:port] ||= (opts[:ssl] ? 443 : 80) + opts[:path] ||= '/pbm/sdk' + opts[:ns] ||= 'urn:pbm' + rev_given = opts[:rev] != nil + opts[:rev] = '1.0' unless rev_given + opts[:debug] = (!ENV['RBVMOMI_DEBUG'].empty? rescue false) unless opts.member? :debug + + new(opts).tap do |pbm| + pbm.vcSessionCookie = vim.cookie.split('"')[1] + end + end + + def vcSessionCookie= cookie + @vcSessionCookie = cookie + end + + def rev= x + super + @serviceContent = nil + end + + # Return the ServiceInstance + # + # The ServiceInstance is the root of the vSphere inventory. + def serviceInstance + @serviceInstance ||= VIM::PbmServiceInstance self, 'ServiceInstance' + end + + # Alias to serviceInstance.RetrieveServiceContent + def serviceContent + @serviceContent ||= serviceInstance.RetrieveServiceContent + end + + # @private + def pretty_print pp + pp.text "PBM(#{@opts[:host]})" + end + + add_extension_dir File.join(File.dirname(__FILE__), "pbm") + load_vmodl(ENV['VMODL'] || File.join(File.dirname(__FILE__), "../../vmodl.db")) +end + +end
Add connection endpoint for PBM. Not functional without API definitions
diff --git a/lib/tasks/tmp.rake b/lib/tasks/tmp.rake index abc1234..def5678 100644 --- a/lib/tasks/tmp.rake +++ b/lib/tasks/tmp.rake @@ -8,6 +8,7 @@ Vendor.each(&:status) end + desc "Rebuilds the MPL Download .zip for all installed bundles" task mpl_download_rebuild: [:environment] do puts 'Rebuilding all MPL Downloads...' Bundle.all.each do |bundle| @@ -23,3 +24,7 @@ Rake::Task['tmp:cache:rebuild'].invoke Rake::Task['tmp:cache:mpl_download_rebuild'].invoke end + +Rake::Task['bundle:download_and_install'].enhance do + Rake::Task['tmp:cache:mpl_download_rebuild'].invoke +end
Add a description to the mpl_download_rebuild task, and add that task to the bundle:download_and_install task after bundle installation
diff --git a/doc/rc_alive_check.rb b/doc/rc_alive_check.rb index abc1234..def5678 100644 --- a/doc/rc_alive_check.rb +++ b/doc/rc_alive_check.rb @@ -0,0 +1,49 @@+#!/usr/bin/env ruby + +require 'rubygems' +require 'omf_common' + +unless ARGV[0] && ARGV[1] + puts "Missing argument: The credential to connect to your XMPP(Openfire) server and id of your Resource Controller" + puts "usage: rc_alice_check.rb <credential xmpp://user:password@localhost> <id of resource proxy>" + exit 2 +end + +user = ARGV[0] +resource_id = ARGV[1] + +everything_ok = false + +OmfCommon.init(:development, communication: { url: user }) do + OmfCommon.comm.on_connected do |comm| + info "Connected as #{comm.jid}" + + comm.subscribe(resource_id) do |res| + unless res.error? + res.request([:uid]) do |reply_msg| + unless reply_msg.error? + info "Resource UID >> #{reply_msg[:uid]}" + info "Resource type >> #{reply_msg[:type]}" + + everything_ok = true + else + error res.inspect + end + end + else + error res.inspect + end + + OmfCommon.eventloop.after(5) do + if everything_ok + info "Resource #{resource_id} is up and running" + else + error "Resource #{resource_id} is NOT running properly" + end + comm.disconnect + end + end + + comm.on_interrupted { warn 'Interuppted...'; comm.disconnect } + end +end
Add a simple script to check if rc alive
diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index abc1234..def5678 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -3,7 +3,7 @@ end def search - @query = params[:query].blank? ? '*' : params[:query] + @query = params[:query].presence || '*' @recipes = Recipe.search @query end
Rewrite query handling in a more idiomatic way
diff --git a/app/models/concerns/crop_search.rb b/app/models/concerns/crop_search.rb index abc1234..def5678 100644 --- a/app/models/concerns/crop_search.rb +++ b/app/models/concerns/crop_search.rb @@ -4,7 +4,14 @@ included do #################################### # Elastic search configuration - searchkick word_start: %i(name alternate_names scientific_names), case_sensitive: false + searchkick word_start: %i(name alternate_names scientific_names), + case_sensitive: false, + merge_mappings: true, + mappings: { + properties: { + created_at: {type: :integer} + } + } # Special scope to control if it's in the search index scope :search_import, -> { includes(:scientific_names, :photos) }
Add ElasticSearch mappings, to fix intermittent errors
diff --git a/app/mutations/tool_slots/create.rb b/app/mutations/tool_slots/create.rb index abc1234..def5678 100644 --- a/app/mutations/tool_slots/create.rb +++ b/app/mutations/tool_slots/create.rb @@ -2,11 +2,15 @@ class Create < Mutations::Command required do model :device, class: Device + integer :tool_bay_id + end + + optional do + integer :tool_id string :name integer :x integer :y integer :z - integer :tool_bay_id end def validate
Make fields optional on API
diff --git a/spec/system/common_patterns_spec.rb b/spec/system/common_patterns_spec.rb index abc1234..def5678 100644 --- a/spec/system/common_patterns_spec.rb +++ b/spec/system/common_patterns_spec.rb @@ -18,13 +18,16 @@ it "should support an 'include' directive at the end of postgresql.conf" do pending('no support for include directive with centos 5/postgresql 8.1', :if => (node.facts['osfamily'] == 'RedHat' and node.facts['lsbmajdistrelease'] == '5')) + pp = <<-EOS class { 'postgresql::server': } - $extras = "/tmp/include.conf" + $extras = "/etc/postgresql-include.conf" file { $extras: content => 'max_connections = 123', + seltype => 'postgresql_db_t', + seluser => 'system_u', notify => Class['postgresql::server::service'], }
Fix selinux permissions for fedora tests Signed-off-by: Ken Barber <470bc578162732ac7f9d387d34c4af4ca6e1b6f7@bob.sh>
diff --git a/app/representers/api/episode_representer.rb b/app/representers/api/episode_representer.rb index abc1234..def5678 100644 --- a/app/representers/api/episode_representer.rb +++ b/app/representers/api/episode_representer.rb @@ -1,8 +1,15 @@ # encoding: utf-8 class Api::EpisodeRepresenter < Api::BaseRepresenter - property :guid + # the guid that shows up in the rss feed + property :item_guid, as: :guid + + # the guid generated by feeder, used in API requests + property :guid, as: :id + + # an original guid for an imported feed, overrides the feeder generated guid property :original_guid + property :prx_uri property :created_at property :updated_at
Make the guid match what is in the feed, also return episode id and original/override guid as read only
diff --git a/react-native-mapbox-gl.podspec b/react-native-mapbox-gl.podspec index abc1234..def5678 100644 --- a/react-native-mapbox-gl.podspec +++ b/react-native-mapbox-gl.podspec @@ -14,4 +14,5 @@ s.source_files = "ios/RCTMGL/**/*.{h,m}" s.vendored_frameworks = 'ios/Mapbox.framework' + s.dependency 'React' end
[iOS] Add React dependency to Podspec Support older versions of Swift by allowing `use_frameworks!` in CocoaPods
diff --git a/config/initializers/requires.rb b/config/initializers/requires.rb index abc1234..def5678 100644 --- a/config/initializers/requires.rb +++ b/config/initializers/requires.rb @@ -2,5 +2,5 @@ require 'nokogiri' require 'hdo/storting_importer' -require 'hdo/stats/vote_scorer' -require 'hdo/stats/vote_counts' +require_dependency 'hdo/stats/vote_scorer' +require_dependency 'hdo/stats/vote_counts'
Make sure VoteScorer/VoteCounts are reloaded in dev.
diff --git a/spec/javascripts/support/jasmine_helper.rb b/spec/javascripts/support/jasmine_helper.rb index abc1234..def5678 100644 --- a/spec/javascripts/support/jasmine_helper.rb +++ b/spec/javascripts/support/jasmine_helper.rb @@ -12,4 +12,8 @@ # Jasmine.configure do |config| # config.prevent_phantom_js_auto_install = true # end -# + +Jasmine.configure do |config| + # Enable console.log for debugging + config.show_console_log = true +end
Allow console.log in Jasmine tests, for debugging
diff --git a/ruby/nested_data_structures.rb b/ruby/nested_data_structures.rb index abc1234..def5678 100644 --- a/ruby/nested_data_structures.rb +++ b/ruby/nested_data_structures.rb @@ -42,8 +42,7 @@ puts freeway[:white_honda][:people] freeway[:black_mini][:no_of_cupholders] = 4 -puts freeway[:black_mini][:no_of_cupholders +puts freeway[:black_mini][:no_of_cupholders] -
Add missing bracket to last line of code
diff --git a/cli_tools.gemspec b/cli_tools.gemspec index abc1234..def5678 100644 --- a/cli_tools.gemspec +++ b/cli_tools.gemspec @@ -10,7 +10,7 @@ spec.email = ["alex@kukushk.in"] spec.description = %q{A collection of helper methods for ruby CLI applications} spec.summary = %q{CLI application helper methods} - spec.homepage = "" + spec.homepage = "http://github.com/kukushkin/cli_tools" spec.license = "MIT" spec.files = `git ls-files`.split($/)
Set gem homepage to github
diff --git a/config/initializers/barclaycard.rb b/config/initializers/barclaycard.rb index abc1234..def5678 100644 --- a/config/initializers/barclaycard.rb +++ b/config/initializers/barclaycard.rb @@ -6,4 +6,4 @@ EPDQ.config pspid: ENV.fetch('EPDQ_PSPID'), sha_type: :sha256, sha_in: ENV.fetch('EPDQ_SECRET_IN'), sha_out: ENV.fetch('EPDQ_SECRET_OUT'), - test_mode: !Rails.env.production? + test_mode: ENV['ENV'] == 'prod' ? false : true
Use BarclayCard test gateway on all hosts except where ENV == 'prod'
diff --git a/spec/unit/plugins/solaris2/memory_spec.rb b/spec/unit/plugins/solaris2/memory_spec.rb index abc1234..def5678 100644 --- a/spec/unit/plugins/solaris2/memory_spec.rb +++ b/spec/unit/plugins/solaris2/memory_spec.rb @@ -20,7 +20,7 @@ before(:each) do @plugin = get_plugin("solaris2/memory") allow(@plugin).to receive(:collect_os).and_return("solaris2") - allow(@plugin).to receive(:shell_out).with("prtconf -m").and_return(mock_shell_out(0, "8194\n", "")) + allow(@plugin).to receive(:shell_out).with("prtconf | grep Memory").and_return(mock_shell_out(0, "Memory size: 8194 Megabytes\n", "")) end it "should get the total memory" do
Update solaris2 memory spec to match memory command
diff --git a/config/metrics.rb b/config/metrics.rb index abc1234..def5678 100644 --- a/config/metrics.rb +++ b/config/metrics.rb @@ -31,7 +31,7 @@ code: code, method: env['REQUEST_METHOD'].downcase, host: env['HTTP_HOST'].to_s, - path: env['PATH_INFO'], + path: env, app: "specialcollections" } end
Troubleshoot what's in the environment
diff --git a/config/unicorn.rb b/config/unicorn.rb index abc1234..def5678 100644 --- a/config/unicorn.rb +++ b/config/unicorn.rb @@ -1,6 +1,7 @@ # config/unicorn.rb worker_processes Integer(ENV["WEB_CONCURRENCY"] || 3) -timeout( ENV["WEB_TIMEOUT"] || 15) +timeout Integer(ENV["WEB_TIMEOUT"] || 20) + preload_app true before_fork do |server, worker|
[FIX] Handle conversion of string to integer from env
diff --git a/spec/controllers/sessions_controller_spec.rb b/spec/controllers/sessions_controller_spec.rb index abc1234..def5678 100644 --- a/spec/controllers/sessions_controller_spec.rb +++ b/spec/controllers/sessions_controller_spec.rb @@ -0,0 +1,32 @@+require 'rails_helper' + +describe SessionsController do + let(:eveanandi) {User.create(name: "Eveanandi", email: "meerrrrr@rrrrr.com", password: "catscatscats")} + before(:each) do + stub_current_user eveanandi + stub_authorize_user! + end + + context "create" do + it "redirects to root path after logging in" do + params = {email: eveanandi.email, password: eveanandi.password} + p params + post(:create, params) + expect(response).to redirect_to root_path + end + + it "redirects to login path after bad login in" do + params = {email: "WAHHHHH@cry.com", password: "allthedogs"} + post(:create, params) + expect(response).to redirect_to login_path + end + end + + context "destroy" do + it "logs out the user" do + delete(:destroy) + expect(response).to redirect_to login_path + end + end + +end
Add sessions controller spec file