diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/spec/version_history_spec.rb b/spec/version_history_spec.rb index abc1234..def5678 100644 --- a/spec/version_history_spec.rb +++ b/spec/version_history_spec.rb @@ -1,7 +1,6 @@ require 'turntables/version_history' describe VersionHistory do - context "<<AR>> pattern specification" do it "should respond to class method check" do VersionHistory.should respond_to(:check) @@ -31,4 +30,26 @@ VersionHistory.should respond_to(:to_version_history) end end + + context "Attributes" do + before(:each) do + @version_history = VersionHistory.new(1,"asdf") + end + + it "should have an id" do + @version_history.should respond_to(:id) + end + + it "should have a version" do + @version_history.should respond_to(:version) + end + + it "should have a date" do + @version_history.should respond_to(:date) + end + + it "should have a comment" do + @version_history.should respond_to(:comment) + end + end end
Test for version history attributes
diff --git a/lib/australium/event_filters.rb b/lib/australium/event_filters.rb index abc1234..def5678 100644 --- a/lib/australium/event_filters.rb +++ b/lib/australium/event_filters.rb @@ -25,6 +25,7 @@ event_filter :map_starts, MapStart event_filter :connects, PlayerConnect event_filter :disconnects, PlayerDisconnect + event_filter :entrances, PlayerEnterGame event_filter :role_changes, PlayerRoleChange event_filter :team_joins, PlayerJoinTeam event_filter :kills, PlayerKill
EventFilters: Add friendly name for PlayerEnterGame
diff --git a/lib/bouncer/preemptive_rules.rb b/lib/bouncer/preemptive_rules.rb index abc1234..def5678 100644 --- a/lib/bouncer/preemptive_rules.rb +++ b/lib/bouncer/preemptive_rules.rb @@ -9,19 +9,25 @@ def self.try(context, renderer) request = context.request - if request.host == 'www.environment-agency.gov.uk' - if request.non_canonicalised_fullpath =~ %r{^/homeandleisure/floods/riverlevels(/.*)?$}i + case request.host + + when 'www.environment-agency.gov.uk' + case request.non_canonicalised_fullpath + when %r{^/homeandleisure/floods/riverlevels(/.*)?$}i redirect("http://apps.environment-agency.gov.uk/river-and-sea-levels#{$1}") - elsif request.non_canonicalised_fullpath =~ %r{^/homeandleisure/floods/((cy/)?(34678|34681|147053)\.aspx(\?.*)?)$}i + when %r{^/homeandleisure/floods/((cy/)?(34678|34681|147053)\.aspx(\?.*)?)$}i redirect("http://apps.environment-agency.gov.uk/flood/#{$1}") end - elsif request.host == 'www.businesslink.gov.uk' - if request.non_canonicalised_fullpath =%r{^(.*site=230.*)$}i + + when 'www.businesslink.gov.uk' + case request.non_canonicalised_fullpath + when %r{^(.*site=230.*)$}i redirect("http://business.wales.gov.uk#{$1}") - elsif request.non_canonicalised_fullpath =%r{^(.*site=191.*)$}i + when %r{^(.*site=191.*)$}i redirect("http://www.nibusinessinfo.co.uk#{$1}") end end + end end end
Refactor pre-emptive rules to be case-based
diff --git a/libraries/provider_docker_service.rb b/libraries/provider_docker_service.rb index abc1234..def5678 100644 --- a/libraries/provider_docker_service.rb +++ b/libraries/provider_docker_service.rb @@ -50,9 +50,6 @@ action :restart do end - - action :enable do - end end end end
Remove nonexistent action :enable from docker_service
diff --git a/app/controllers/events_controller.rb b/app/controllers/events_controller.rb index abc1234..def5678 100644 --- a/app/controllers/events_controller.rb +++ b/app/controllers/events_controller.rb @@ -1,11 +1,14 @@ class EventsController < ApplicationController def index - @event = Event.current - @track = Track.new(IntervalDecorator.decorate(@event.intervals).to_ary, TalkDecorator.decorate(@event.talks).to_ary) respond_to do |format| - format.html { render :index } format.json { render :json => Event.limit(5) } + format.html do + @event = Event.current + @track = Track.new(IntervalDecorator.decorate(@event.intervals).to_ary, TalkDecorator.decorate(@event.talks).to_ary) + + render :index + end end end end
Select desnecessário caso acessar solicitando json
diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index abc1234..def5678 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -4,7 +4,10 @@ def assign user = current_user - user.group_id = find_group(params[:address]) + + group = find_group(params[:address]) + + user.group_id = group.id if user.save redirect_to root_path @@ -17,7 +20,31 @@ private def find_group(address_hash) - Group.find_by(address_hash).id + normalized_address_params = normalize_address_params(params[:address]) + Group.find_or_create_by(normalized_address_params) end + def normalize_address_params(address_hash) + base_api_endpoint = URI("https://api.smartystreets.com/street-address") + + secrets = {'auth-id' => ENV['SMARTY_STREETS_AUTH_ID'], 'auth-token' => ENV['SMARTY_STREETS_AUTH_TOKEN']} + + query = secrets.merge(address_hash) + + base_api_endpoint.query = URI.encode_www_form(query) + + api_response = Net::HTTP.get_response(base_api_endpoint) + + results = JSON.parse(api_response.body) + + clean_results(results.first["components"]) + end + + def clean_results(hash) + unnecessary_keys = %w(plus4_code delivery_point delivery_point_check_digit) + + unnecessary_keys.each { |key| hash.delete(key) } + + hash + end end
Add logic to the Groups Controller to use the Smarty Street API for finding an address.
diff --git a/app/controllers/static_controller.rb b/app/controllers/static_controller.rb index abc1234..def5678 100644 --- a/app/controllers/static_controller.rb +++ b/app/controllers/static_controller.rb @@ -1,6 +1,6 @@ class StaticController < ApplicationController def homepage - @projects = Project.limit(200).sample(14).sort_by(&:name) + @projects = Project.active.limit(200).sample(14).sort_by(&:name) @users = User.order('pull_requests_count desc').limit(200).sample(45) @pull_requests = PullRequest.year(current_year).order('created_at desc').limit(5) @quote = Quote.random
Use active scope to retrieve projects for homepage - Ref Issue 405 (https://github.com/andrew/24pullrequests/issues/405)
diff --git a/app/services/git_tag_push_service.rb b/app/services/git_tag_push_service.rb index abc1234..def5678 100644 --- a/app/services/git_tag_push_service.rb +++ b/app/services/git_tag_push_service.rb @@ -1,8 +1,12 @@ class GitTagPushService attr_accessor :project, :user, :push_data + def execute(project, user, oldrev, newrev, ref) @project, @user = project, user @push_data = create_push_data(oldrev, newrev, ref) + + create_push_event + project.repository.expire_cache project.execute_hooks(@push_data.dup, :tag_push_hooks) end @@ -24,4 +28,13 @@ } } end + + def create_push_event + Event.create!( + project: project, + action: Event::PUSHED, + data: push_data, + author_id: push_data[:user_id] + ) + end end
Create event and clear cache on new trag push Signed-off-by: Dmitriy Zaporozhets <be23d75b156792e5acab51b196a2deb155d35d6a@gmail.com>
diff --git a/imfilters.gemspec b/imfilters.gemspec index abc1234..def5678 100644 --- a/imfilters.gemspec +++ b/imfilters.gemspec @@ -13,7 +13,7 @@ s.summary = "Create named scopes for filtering" s.description = "Create named scopes for filtering" - s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"] + s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rst"] s.test_files = Dir["test/**/*"] s.add_dependency "rails", ">= 3.1.0", "< 4.0.0"
Update renamed README in gemspec.
diff --git a/test/spec/server.rb b/test/spec/server.rb index abc1234..def5678 100644 --- a/test/spec/server.rb +++ b/test/spec/server.rb @@ -2,7 +2,7 @@ describe 'Server' do specify 'Request and Response' do - counter = 1 + counter = (ENV['COUNTER'] || '1').to_i HTTP::Server::Controls::ExampleServer.run do |port, scheduler| uri = URI::HTTP.build :host => 'localhost', :port => port, :path => '/countdown'
Allow counter to be variable by ENV
diff --git a/test/test_camera.rb b/test/test_camera.rb index abc1234..def5678 100644 --- a/test/test_camera.rb +++ b/test/test_camera.rb @@ -12,7 +12,6 @@ end def setup - @window = TWindow.new @player = Player.new @camera = Poke::Camera.new(window: @window, player: @player) end
Remove Camera test Window assignment for now
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 @@ -29,4 +29,4 @@ require 'minitest/autorun' # So we can be sure we have coverage on the whole lib directory: -Dir.glob('lib/*.rb').each { |file| require file.gsub(%r{(^lib\/|\.rb$)}, '') } +Dir.glob('lib/**/*.rb').each { |file| require file.gsub(%r{(^lib\/|\.rb$)}, '') }
Make sure we're including subdirectories as well. The commit that removed require_all didn't include the subdirectories of `lib` in the test_helper. This wasn't obvious because if you're testing everything at once it worked fine because all the files include each other in a useful order. If you are only testing one file you can run into problems. Fix this by including files from the subdirectories of `lib/` too.
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 @@ -28,4 +28,10 @@ Phoner::Phone.default_country_code = nil Phoner::Phone.default_area_code = nil end + + def default_test + klass = self.class.to_s + ancestors = (self.class.ancestors - [self.class]).collect { |ancestor| ancestor.to_s } + super unless klass =~ /TestCase/ or ancestors.first =~ /TestCase/ + end end
Stop the "no tests were specified" nonsense
diff --git a/lib/flying_sphinx/controller.rb b/lib/flying_sphinx/controller.rb index abc1234..def5678 100644 --- a/lib/flying_sphinx/controller.rb +++ b/lib/flying_sphinx/controller.rb @@ -5,10 +5,11 @@ def index(*indices) options = indices.last.is_a?(Hash) ? indices.pop : {} + async = indices.any? && !options[:verbose] FlyingSphinx::IndexRequest.cancel_jobs - request = FlyingSphinx::IndexRequest.new indices + request = FlyingSphinx::IndexRequest.new indices, async request.index puts request.status_message if options[:verbose]
Use async approach for delta indexing.
diff --git a/lib/fpgrowth/fp_tree/builder.rb b/lib/fpgrowth/fp_tree/builder.rb index abc1234..def5678 100644 --- a/lib/fpgrowth/fp_tree/builder.rb +++ b/lib/fpgrowth/fp_tree/builder.rb @@ -6,7 +6,7 @@ module FpTree module Builder - def self.build(transactions, threshold=50) + def self.build(transactions, threshold=1) first_pass = FirstPass.new(threshold) supports = first_pass.execute(transactions) second_pass = SecondPass.new(supports, threshold)
Set default thershold to 1
diff --git a/lib/git_evolution/repository.rb b/lib/git_evolution/repository.rb index abc1234..def5678 100644 --- a/lib/git_evolution/repository.rb +++ b/lib/git_evolution/repository.rb @@ -17,7 +17,10 @@ since_option = "--since '#{since}'" Dir.chdir(dir) do - return `git --no-pager log -z #{since_option if since} -L#{start_line},#{end_line}:#{file} --follow #{file}` + return `git --no-pager log -p -z\ + #{since_option if since}\ + #{"-L#{start_line},#{end_line}:#{file}" if start_line && end_line}\ + --follow #{file}` end end end
Fix git log for when no range was specified When no range was specified the following arguments were passed to git log: `-L,:<file>`. While it was still valid for the whole file it was restricted to the bounds of the current file's state (i.e., 1:10, which then restricted how far back the history will go by the nature of the `-L` argument. This commit conditionally removes the `-L` argument if there is no starting or ending lines specified. This allows the history to go 'all' the way back while following the file movements. Slight refactor to improve readability of the ever growing git command.
diff --git a/lib/deploy/eb/platform.rb b/lib/deploy/eb/platform.rb index abc1234..def5678 100644 --- a/lib/deploy/eb/platform.rb +++ b/lib/deploy/eb/platform.rb @@ -1,5 +1,11 @@+require 'open3' + module Eb class Platform + def self.configured? + Open3.popen3("eb list") { |i, o, e, t| t.value }.exitstatus == 0 + end + def initialize(opts) @eb = opts[:eb] @tag = opts[:tag]
Add method to check if current folder is set up for EB
diff --git a/DateRangePicker.podspec b/DateRangePicker.podspec index abc1234..def5678 100644 --- a/DateRangePicker.podspec +++ b/DateRangePicker.podspec @@ -18,6 +18,4 @@ s.requires_arc = true s.frameworks = 'AppKit', 'Foundation' s.swift_versions = ['4.2', '5'] - - s.xcconfig = { 'EMBEDDED_CONTENT_CONTAINS_SWIFT' => 'YES' } end
Remove EMBEDDED_CONTENT_CONTAINS_SWIFT from the Podspec (oops).
diff --git a/lib/rrj/models/active_record.rb b/lib/rrj/models/active_record.rb index abc1234..def5678 100644 --- a/lib/rrj/models/active_record.rb +++ b/lib/rrj/models/active_record.rb @@ -1,4 +1,6 @@ # frozen_string_literal: true + +# :reek:UtilityFunction module RubyRabbitmqJanus module Models @@ -26,6 +28,13 @@ def set(attributes) update_columns(attributes) end + + # Destroy data to column + # + # @param [Array] List to attribute to delete in document + def unset(attributes) + Hash[attributes.map { |key, _value| [key, nil] }] + end end end end
Add unset method for disable JanusInstance with ActiveRecord
diff --git a/lib/specinfra/backend/docker.rb b/lib/specinfra/backend/docker.rb index abc1234..def5678 100644 --- a/lib/specinfra/backend/docker.rb +++ b/lib/specinfra/backend/docker.rb @@ -50,7 +50,7 @@ begin container.start begin - stdout, stderr = container.attach + stdout, stderr = container.attach(:logs => true) result = container.wait return CommandResult.new :stdout => stdout.join, :stderr => stderr.join, :exit_status => result['StatusCode']
Set logs = true when attaching to Docker backend In the Docker API v1.15 logs=true is required to capture stdout and stderr logs stdout - if logs=true, return stdout log, if stream=true, attach to stdout. Default false https://docs.docker.com/reference/api/docker_remote_api_v1.15/
diff --git a/lib/rubocop/cop/rails/output.rb b/lib/rubocop/cop/rails/output.rb index abc1234..def5678 100644 --- a/lib/rubocop/cop/rails/output.rb +++ b/lib/rubocop/cop/rails/output.rb @@ -8,20 +8,16 @@ MSG = 'Do not write to stdout. ' \ 'Use Rails\' logger if you want to log.'.freeze - BLACKLIST = [:puts, - :print, - :p, - :pp, - :pretty_print, - :ap].freeze + def_node_matcher :output?, <<-PATTERN + (send nil {:ap :p :pp :pretty_print :print :puts} $...) + PATTERN def on_send(node) - receiver, method_name, *args = *node - return unless receiver.nil? && - !args.empty? && - BLACKLIST.include?(method_name) + output?(node) do |args| + return if args.empty? - add_offense(node, :selector) + add_offense(node, :selector) + end end end end
Modify Rails/Output to use NodePattern
diff --git a/Bypass.podspec b/Bypass.podspec index abc1234..def5678 100644 --- a/Bypass.podspec +++ b/Bypass.podspec @@ -1,26 +1,25 @@ Pod::Spec.new do |s| - s.name = "Bypass" - s.version = "1.0" - s.summary = "Skip the HTML, Bypass takes markdown and renders it directly on Android and iOS." - s.homepage = "http://uncodin.github.com/bypass/" - - s.license = 'Apache License, Version 2.0' - - s.authors = { "Colin Edwards" => "colin@recursivepenguin.com", "Damian Carrillo" => "dcarrillo@ironclad.mobi" } - s.source = { :git => "https://github.com/Uncodin/bypass.git", :tag => "cocoapods1.0" } - - s.platform = :ios - - s.source_files = 'dep/libsoldout/markdown.{h,c}', - 'dep/libsoldout/buffer.{h,c}', - 'dep/libsoldout/array.{h,c}', - 'src/*.{h,cpp}', - 'platform/ios/Bypass/Bypass/*.{h,mm,pch}', - - s.public_header_files = 'platform/ios/Bypass/Bypass/*.h' - - s.frameworks = "CoreText", "Foundation", "UIKit" - - s.dependency 'boost/string_algorithms-includes' - s.requires_arc = false + s.name = 'Bypass' + s.version = '1.0.1' + s.license = 'Apache License, Version 2.0' + s.summary = 'Bypass - Bypass renders markdown directly to UIViews instead of using an intermediary HTML format.' + s.homepage = 'http://uncodin.github.io/bypass/' + s.authors = { + 'Damian Carrillo' => 'damian@uncod.in', + 'Colin Edwards' => 'colin@uncod.in' + } + s.platform = :ios, '6.0' + s.ios.frameworks = 'Foundation', 'UIKit', 'QuartzCore', 'CoreGraphics', 'CoreText' + s.ios.requires_arc = true + s.xcconfig = { 'OTHER_LDFLAGS' => '-lstdc++' } + s.compiler_flags = '-stdlib=libc++' + s.source = { + :git => 'https://github.com/Uncodin/bypass-ios.git', + :tag => '1.0.1', + :submodules => true + } + s.source_files = + 'Bypass/*.{h,m,mm}', + 'Libraries/bypass-core/src/*.{h,cpp}', + 'Libraries/bypass-core/src/soldout/*.{h,c}' end
Revert "Pod spec go back to 1.0" This reverts commit 68c69c768c1f5e65b481fbe2697a6fc9273840d3.
diff --git a/lib/engineyard/version.rb b/lib/engineyard/version.rb index abc1234..def5678 100644 --- a/lib/engineyard/version.rb +++ b/lib/engineyard/version.rb @@ -1,4 +1,4 @@ module EY - VERSION = '2.1.3' + VERSION = '2.1.4.pre' ENGINEYARD_SERVERSIDE_VERSION = ENV['ENGINEYARD_SERVERSIDE_VERSION'] || '2.1.4' end
Add .pre for next release
diff --git a/lib/resque_job_logging.rb b/lib/resque_job_logging.rb index abc1234..def5678 100644 --- a/lib/resque_job_logging.rb +++ b/lib/resque_job_logging.rb @@ -1,5 +1,6 @@ module ResqueJobLogging def around_perform_log_job(*args) + Rails.logger.auto_flushing=1 log_string = "event=resque_job job=#{self} " error = nil time = Benchmark.realtime{
Set auto_flushing to 1 explicitly
diff --git a/lib/tasks/gitlab/dev.rake b/lib/tasks/gitlab/dev.rake index abc1234..def5678 100644 --- a/lib/tasks/gitlab/dev.rake +++ b/lib/tasks/gitlab/dev.rake @@ -4,10 +4,7 @@ task :ee_compat_check, [:branch] => :environment do |_, args| opts = if ENV['CI'] - { - branch: ENV['CI_BUILD_REF_NAME'], - ce_repo: ENV['CI_BUILD_REPO'] - } + { branch: ENV['CI_BUILD_REF_NAME'] } else unless args[:branch] puts "Must specify a branch as an argument".color(:red)
Use the public CE repo URL instead of the one used in the runner This will prevent the task to advertise using https://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@gitlab.com/gitlab-org/gitlab-ce.git when https://gitlab.com/gitlab-org/gitlab-ce.git is enough Signed-off-by: Rémy Coutable <4ea0184b9df19e0786dd00b28e6daa4d26baeb3e@rymai.me>
diff --git a/Casks/gisto.rb b/Casks/gisto.rb index abc1234..def5678 100644 --- a/Casks/gisto.rb +++ b/Casks/gisto.rb @@ -1,6 +1,6 @@ cask :v1 => 'gisto' do - version '0.3.0' - sha256 '803a15125b69486012f72a42dd20f7a63b51dc2d445082303cb3b96cdb622667' + version '0.3.1' + sha256 '93df9da2888f1cca3e649ccc30b8c4784e95ad22000c77d684d89363d873cbba' url "http://download.gistoapp.com/Gisto-#{version}-OSX_x86_64.dmg" appcast 'http://www.gistoapp.com/GistoAppCast.xml'
Update Gisto to version 0.3.1
diff --git a/UPCarouselFlowLayout.podspec b/UPCarouselFlowLayout.podspec index abc1234..def5678 100644 --- a/UPCarouselFlowLayout.podspec +++ b/UPCarouselFlowLayout.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "UPCarouselFlowLayout" - s.version = "1.1.0" + s.version = "1.1.1" s.summary = "A fancy carousel flow layout for UICollectionView." s.description = "UPCarouselFlowLayout is a fancy carousel flow layout for UICollectionView. It comes with a paginated effect and it shrinks and makes transparent the side items."
Update pod version to 1.1.1
diff --git a/lib/curryable/parameter_list.rb b/lib/curryable/parameter_list.rb index abc1234..def5678 100644 --- a/lib/curryable/parameter_list.rb +++ b/lib/curryable/parameter_list.rb @@ -12,15 +12,15 @@ list.select(&:positional?) end - def required_positional - positional.select(&:required?) - end - def required_keywords list.select(&:keyword?).select(&:required?) end private + + def required_positional + positional.select(&:required?) + end def list @list ||= @raw_list.map { |type, name| Parameter.new(type, name) }
Remove method from `ParameterList` public interface
diff --git a/kotoba.gemspec b/kotoba.gemspec index abc1234..def5678 100644 --- a/kotoba.gemspec +++ b/kotoba.gemspec @@ -22,7 +22,7 @@ gem.executables = ["kotoba"] gem.version = Kotoba::VERSION - gem.add_dependency "prawn" + gem.add_dependency "prawn", "~> 1.0.0.rc" gem.add_dependency "thor" gem.add_dependency "kramdown" gem.add_dependency "htmlentities"
Set prawn version to use The 2011 0.12.0 version works less well with certain options.
diff --git a/lib/errawr/rails.rb b/lib/errawr/rails.rb index abc1234..def5678 100644 --- a/lib/errawr/rails.rb +++ b/lib/errawr/rails.rb @@ -1,7 +1,15 @@-require "errawr/rails/version" +require 'active_support/rescuable' +require 'errawr' +require 'errawr/http' + +require 'errawr/rails/renderable' +require 'errawr/rails/json' +require 'errawr/rails/version' module Errawr module Rails - # Your code goes here... + def self.included(base) + base.send(:include, Errawr::ClassMethods) + end end end
Include Errawr methods when including Errawr::Rails in controller.
diff --git a/lib/ffi-rxs/libc.rb b/lib/ffi-rxs/libc.rb index abc1234..def5678 100644 --- a/lib/ffi-rxs/libc.rb +++ b/lib/ffi-rxs/libc.rb @@ -1,9 +1,9 @@ # encoding: utf-8 module LibC - extend ::FFI::Library + extend FFI::Library # figures out the correct libc for each platform including Windows - library = ffi_lib(::FFI::Library::LIBC).first + library = ffi_lib(FFI::Library::LIBC).first # Size_t not working properly on Windows find_type(:size_t) rescue typedef(:ulong, :size_t)
Revert "Further Travis CI investigation" This reverts commit 23cf1f699e566206c9ffe85b0130f68d78a79cf2.
diff --git a/lib/grunt/responses/messages.rb b/lib/grunt/responses/messages.rb index abc1234..def5678 100644 --- a/lib/grunt/responses/messages.rb +++ b/lib/grunt/responses/messages.rb @@ -9,7 +9,7 @@ if response.text =~ command_regex handle_command $~[1], $~[2] elsif response.text =~ assignment_regex - handle_assignment *$~ + handle_assignment $~[1], $~[2] end end end
Use explicit arguments instead of splat operator
diff --git a/lib/Peppermill.rb b/lib/Peppermill.rb index abc1234..def5678 100644 --- a/lib/Peppermill.rb +++ b/lib/Peppermill.rb @@ -15,6 +15,7 @@ end on :connect do |m| + unset_mode 'x' User('nickserv').send("identify #{ENV['PASSWORD']}") end end
Disable mode X on bot
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -26,5 +26,4 @@ depends 'pkgutil', '~> 0.0' depends 'windows', '~> 1.30' depends 'wix', '~> 1.1' -depends 'yum', '~> 3.1' depends 'yum-epel', '~> 0.3'
Remove direct dependency on yum
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) version '0.0.1' -recipe 'kafka', 'Setups up install environment' +recipe 'kafka', 'Setups up Kafka environment with directories and configuration files' recipe 'kafka::source', 'Downloads, compiles and installs Kafka from source releases' recipe 'kafka::binary', 'Downloads, extracts and installs Kafka from binary releases' recipe 'kafka::standalone', 'Setups standalone ZooKeeper instance using the ZooKeeper version that is bundled with Kafka'
Add somewhat better description of default recipe
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -8,7 +8,6 @@ supports 'centos' supports 'redhat' -supports 'amazon' depends 'build-essential', '~> 2.2.3' depends 'ark', '~> 0.9.0'
Remove amazon support since it hasn't been tested.
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -5,7 +5,7 @@ license 'Apache 2.0' description 'Installs and configures Chef Server 12' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -depends 'chef-ingredient', '~ 1.1' +depends 'chef-ingredient', '~> 1.1' supports 'redhat' supports 'centos'
Fix typo on the constraint Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -8,8 +8,8 @@ source_url 'https://github.com/patcon/chef-letsencrypt-boulder-server' version '0.1.1' -supports 'ubuntu' -supports 'centos' +supports 'ubuntu', '= 14.04' +supports 'centos', '~> 7' depends 'golang' depends 'rabbitmq'
Add more specific platform constraint.
diff --git a/lib/artwork.rb b/lib/artwork.rb index abc1234..def5678 100644 --- a/lib/artwork.rb +++ b/lib/artwork.rb @@ -3,7 +3,7 @@ require 'artwork/model' require 'artwork/view' require 'artwork/controller' -require 'artwork/engine' if Rails.const_defined?(:Engine) +require 'artwork/engine' if Object.const_defined?(:Rails) and Rails.const_defined?(:Engine) module Artwork extend Configuration
Allow Artwork to be required without loading Rails Useful for the tests.
diff --git a/worker_host/jruby/recipes/default.rb b/worker_host/jruby/recipes/default.rb index abc1234..def5678 100644 --- a/worker_host/jruby/recipes/default.rb +++ b/worker_host/jruby/recipes/default.rb @@ -1,3 +1,5 @@+ENV['PATH'] = "#{ENV['PATH']}:/opt/jruby/bin" + include_recipe "java" package "libjffi-jni" do @@ -11,3 +13,10 @@ dpkg_package "/var/tmp/#{node[:jruby][:deb]}" do action :install end + +%w{rake bundler}.each do |gem| + gem_package gem do + gem_binary "/opt/jruby/bin/jgem" + action :install + end +end
Add jruby bin dir to path. Install basic gems.
diff --git a/lib/dctvbot.rb b/lib/dctvbot.rb index abc1234..def5678 100644 --- a/lib/dctvbot.rb +++ b/lib/dctvbot.rb @@ -1,7 +1,17 @@-require 'cinch' +class DCTVBot < Cinch::Bot + def initialize(&b) + super -class DCTVBot < Cinch::Bot - def initialize(*args) - super + # Handle SIGINT (Ctrl-C) + trap "SIGINT" do + debug "Caught SIGINT, quitting..." + self.quit + end + + # Handle SIGTERM (Kill Command) + trap "SIGTERM" do + debug "Caught SIGTERM, quitting..." + self.quit + end end end
Update DCTVBot to handle Ctrl-C and Kill
diff --git a/lib/david/trap.rb b/lib/david/trap.rb index abc1234..def5678 100644 --- a/lib/david/trap.rb +++ b/lib/david/trap.rb @@ -1,10 +1,12 @@-class Trap - def initialize(value) - @value = value - end +module David + class Trap + def initialize(value = nil) + @value = value + end - def method_missing(method, *args) - p method, caller[0] - @value.send(method, *args) + def method_missing(method, *args) + p method, caller[0] + @value.send(method, *args) unless @value.nil? + end end end
Make wrapped object optional for Trap.
diff --git a/lib/version_info.rb b/lib/version_info.rb index abc1234..def5678 100644 --- a/lib/version_info.rb +++ b/lib/version_info.rb @@ -11,7 +11,7 @@ # end # module VersionInfo - GITHUB_REPO_OWNER = 'churchio'.freeze + GITHUB_REPO_OWNER = 'seven1m'.freeze GITHUB_REPO_NAME = 'onebody'.freeze def current_version
Fix repo owner in version check
diff --git a/lib/mdwnin/app.rb b/lib/mdwnin/app.rb index abc1234..def5678 100644 --- a/lib/mdwnin/app.rb +++ b/lib/mdwnin/app.rb @@ -32,6 +32,16 @@ haml :form, locals: { document: Document.new } end + get "/gh/:user/:repo" do + uri = URI("https://raw.github.com/#{params[:user]}/#{params[:repo]}/master/README.md") + content = Net::HTTP.get(uri).force_encoding('utf-8') + + document = Document.new(raw_body: content) + document.compile + + haml :read_only, locals: { document: document } + end + get "/:key" do document = Document.first(key: params[:key])
Add an unsafe GitHub README renderer
diff --git a/db/migrate/20180227144608_historical_recovery_targets_distributions.rb b/db/migrate/20180227144608_historical_recovery_targets_distributions.rb index abc1234..def5678 100644 --- a/db/migrate/20180227144608_historical_recovery_targets_distributions.rb +++ b/db/migrate/20180227144608_historical_recovery_targets_distributions.rb @@ -0,0 +1,24 @@+class HistoricalRecoveryTargetsDistributions < ActiveRecord::Migration + def up + products_without_production = LandParcel.where(activity_production_id: nil) + + ActivityProduction.all.each do |activity_production| + language = activity_production.creator.language + + computed_support_name = [] + computed_support_name << activity_production.activity.name + computed_support_name << activity_production.campaign.name if activity_production.campaign + computed_support_name << :rank.t(number: activity_production.rank_number, locale: language) + + finded_land_parcel = products_without_production + .where("name like ?", "%#{computed_support_name.join(' ')}%") + + if finded_land_parcel.any? + finded_land_parcel.first.update_attribute(:activity_production_id, activity_production.id) + end + end + end + + def down + end +end
Add migration to historical recovery
diff --git a/Formula/gearman.rb b/Formula/gearman.rb index abc1234..def5678 100644 --- a/Formula/gearman.rb +++ b/Formula/gearman.rb @@ -1,9 +1,9 @@ require 'formula' class Gearman <Formula - url 'http://launchpad.net/gearmand/trunk/0.12/+download/gearmand-0.12.tar.gz' + url 'http://launchpad.net/gearmand/trunk/0.15/+download/gearmand-0.15.tar.gz' homepage 'http://gearman.org/' - md5 '6e88a6bfb26e50d5aed37d143184e7f2' + md5 'd394214d3cddc5af237d73befc7e3999' depends_on 'libevent'
Update Gearmand to version 0.15 Signed-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com>
diff --git a/app/models/event.rb b/app/models/event.rb index abc1234..def5678 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -24,6 +24,13 @@ # messsage: "%{value} is not a valid event status" } + # All events for a Convention must have a unique title. Ignore any events + # that with a status of "Dropped" or "Rejected". If they have a duplicate + # title we don't care. + validates_uniqueness_of :title, + scope: :convention, + conditions: -> { where.not(status: ['Dropped', 'Rejected']) } + # Runs specify how many instances of this event there are on the schedule. # An event may have 0 or more runs. has_many :runs
Add validation to check for unique titles within a convention
diff --git a/cookbooks/travis_ci_standard/spec/riak_spec.rb b/cookbooks/travis_ci_standard/spec/riak_spec.rb index abc1234..def5678 100644 --- a/cookbooks/travis_ci_standard/spec/riak_spec.rb +++ b/cookbooks/travis_ci_standard/spec/riak_spec.rb @@ -1,7 +1,6 @@ describe 'riak installation', sudo: true do before :all do sh('sudo riak start') - sleep 10 end describe package('riak') do @@ -17,7 +16,13 @@ its(:stdout) { should match(/^pong$/) } end - describe command('sudo riak-admin test') do + describe command( + 'for n in 0 1 2 3 4 ; do ' \ + 'sudo riak-admin test || true ; ' \ + 'echo ; ' \ + 'sleep 1 ; ' \ + 'done' + ) do its(:stdout) { should match(/^Successfully completed 1 read\/write cycle/) end end
Add some retry bits to the riak-admin spec
diff --git a/lib/methane.rb b/lib/methane.rb index abc1234..def5678 100644 --- a/lib/methane.rb +++ b/lib/methane.rb @@ -19,7 +19,7 @@ options = Slop.parse(:help => true, :multiple_switches => false) do banner "methane [options]" on :c, :config=, 'Use a different config file than ~/.methane/config' - on :d, :debug=, 'Enable debugging.' + on :d, :debug, 'Enable debugging.' on :v, :version do puts "Methane Campfire Client v.#{Methane::VERSION}" exit
Debug should be just a flag.
diff --git a/lib/vagrant-google/action/terminate_instance.rb b/lib/vagrant-google/action/terminate_instance.rb index abc1234..def5678 100644 --- a/lib/vagrant-google/action/terminate_instance.rb +++ b/lib/vagrant-google/action/terminate_instance.rb @@ -27,8 +27,9 @@ server = env[:google_compute].servers.get(env[:machine].id, env[:machine].provider_config.zone) # Destroy the server and remove the tracking ID + # destroy() is called with 'false' to disable asynchronous execution. env[:ui].info(I18n.t("vagrant_google.terminating")) - server.destroy if not server.nil? + server.destroy(false) if not server.nil? env[:machine].id = nil @app.call(env)
Disable asyncronous execution on termination.
diff --git a/HandySwift.podspec b/HandySwift.podspec index abc1234..def5678 100644 --- a/HandySwift.podspec +++ b/HandySwift.podspec @@ -17,7 +17,7 @@ s.social_media_url = "https://twitter.com/Dschee" s.ios.deployment_target = "8.0" - s.osx.deployment_target = "10.9" + s.osx.deployment_target = "10.10" s.tvos.deployment_target = "9.0" s.source = { :git => "https://github.com/Flinesoft/HandySwift.git", :tag => "1.1.0" }
Update osx deployment target for CocoaPods
diff --git a/cronitor.gemspec b/cronitor.gemspec index abc1234..def5678 100644 --- a/cronitor.gemspec +++ b/cronitor.gemspec @@ -18,8 +18,8 @@ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ['lib'] - spec.add_development_dependency 'bundler', '~> 1.10' - spec.add_development_dependency 'rake', '~> 10.0' + spec.add_development_dependency 'bundler' + spec.add_development_dependency 'rake' spec.add_development_dependency 'rspec', '~> 3.3' spec.add_development_dependency 'pry', '~> 0.10' spec.add_development_dependency 'webmock', '~> 3.1'
Drop version pins for bundler + rake
diff --git a/PFIncrementalStore.podspec b/PFIncrementalStore.podspec index abc1234..def5678 100644 --- a/PFIncrementalStore.podspec +++ b/PFIncrementalStore.podspec @@ -1,4 +1,7 @@ Pod::Spec.new do |s| + s.deprecated = true + + s.name = "PFIncrementalStore" s.version = "0.2.0" s.summary = "Core Data Persistence with Parse, an NSIncrementalStore subclass."
Update podspec marking pod as deprecated
diff --git a/Static.podspec b/Static.podspec index abc1234..def5678 100644 --- a/Static.podspec +++ b/Static.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = 'Static' - spec.version = '2.0' + spec.version = '2.0.0' spec.summary = 'Simple static table views for iOS in Swift.' spec.description = 'Static provides simple static table views for iOS in Swift.' spec.homepage = 'https://github.com/venmo/static'
Change podspec version reference to 2.0.0 to match tag
diff --git a/lib/elastictastic/new_relic_instrumentation.rb b/lib/elastictastic/new_relic_instrumentation.rb index abc1234..def5678 100644 --- a/lib/elastictastic/new_relic_instrumentation.rb +++ b/lib/elastictastic/new_relic_instrumentation.rb @@ -11,14 +11,14 @@ included do include NewRelic::Agent::MethodTracer - add_method_tracer :create, 'ElasticSearch/#{args[1].classify}#create' - add_method_tracer :delete, 'ElasticSearch/#{args[1].classify + "#" if args[1]}/delete' - add_method_tracer :get, 'ElasticSearch/#{args[1].classify}#get' - add_method_tracer :mget, 'ElasticSearch/mget' - add_method_tracer :put_mapping, 'ElasticSearch/#{args[1].classify}#put_mapping' - add_method_tracer :scroll, 'ElasticSearch/scroll' - add_method_tracer :search, 'ElasticSearch/#{args[1].classify}#search' - add_method_tracer :update, 'ElasticSearch/#{args[1].classify}#update' + add_method_tracer :create, 'Database/ElasticSearch/create' + add_method_tracer :delete, 'Database/ElasticSearch/delete' + add_method_tracer :get, 'Database/ElasticSearch/get' + add_method_tracer :mget, 'Database/ElasticSearch/mget' + add_method_tracer :put_mapping, 'Database/ElasticSearch/put_mapping' + add_method_tracer :scroll, 'Database/ElasticSearch/scroll' + add_method_tracer :search, 'Database/ElasticSearch/search' + add_method_tracer :update, 'Database/ElasticSearch/update' end end end
Change format of NewRelic categories
diff --git a/LockBlocks.podspec b/LockBlocks.podspec index abc1234..def5678 100644 --- a/LockBlocks.podspec +++ b/LockBlocks.podspec @@ -1,12 +1,12 @@ Pod::Spec.new do |s| s.name = 'LockBlocks' - s.version = '0.0.1' + s.version = '0.0.2' s.platform = :ios s.license = 'BSD' s.homepage = 'http://github.com/natep/LockBlocks' s.summary = 'Adds block methods to Obj-C Lock objects. Also adds a Read/Write Lock class.' s.author = { 'Nate Petersen' => 'nate@digitalrickshaw.com' } - s.source = { :git => 'https://github.com/natep/LockBlocks.git', :tag => '0.0.1' } + s.source = { :git => 'https://github.com/natep/LockBlocks.git', :tag => "#{s.version}" } s.source_files = 'LockBlocks/Classes' s.requires_arc = true end
Update podspec for version 0.0.2
diff --git a/spec/features/hamburger_menu_spec.rb b/spec/features/hamburger_menu_spec.rb index abc1234..def5678 100644 --- a/spec/features/hamburger_menu_spec.rb +++ b/spec/features/hamburger_menu_spec.rb @@ -0,0 +1,18 @@+# frozen_string_literal: true + +require 'rails_helper' + +describe 'Hamburger navigation menu', type: :feature, js: true do + let(:course) { create(:course) } + + it 'works when the window is narrow' do + visit "/courses/#{course.slug}" + expect(page).to have_content 'Help' + page.current_window.resize_to(500, 500) + expect(page).not_to have_content 'Help' + find('.bm-burger-button').click + expect(page).to have_content 'Explore' + find('.bm-menu-active').click + expect(page).not_to have_content 'Explore' + end +end
Add simple browser test for mobile layout nav menu
diff --git a/api/entities/standard_set.rb b/api/entities/standard_set.rb index abc1234..def5678 100644 --- a/api/entities/standard_set.rb +++ b/api/entities/standard_set.rb @@ -9,22 +9,17 @@ expose :title, documentation: {desc: "Title of the set"} expose :subject, documentation: {desc: "The subject"} expose :educationLevels, documentation: {desc: "An array of education levels", values: ::StandardSet::EDUCATION_LEVELS } - expose :cspStatus, safe: true do - expose :value, safe: true - expose :notes, safe: true + expose :cspStatus, safe: true do |doc, opts| + doc[:cspStatus].to_hash end - expose :license, safe: true do - expose :title, safe: true - expose :URL, safe: true - expose :rightsHolder, safe: true + expose :license, safe: true do |doc, opts| + doc[:license].to_hash end - expose :document, safe: true do - expose :title, safe: true - expose :sourceURL, safe: true + expose :document, safe: true do |doc, opts| + doc[:document].to_hash end - expose :jurisdiction, safe: true do - expose :title, safe: true - expose :id, safe: true + expose :jurisdiction, safe: true do |doc, opts| + doc[:jurisdiction].to_hash end expose :standards_map, as: :standards @@ -38,9 +33,6 @@ } end - # expose :standards, documentation: {desc: "A map of standards"} do |doc, options| - - # end end end end
Use to_hash instead of trying to serialize
diff --git a/lib/travis/build/appliances/update_rubygems.rb b/lib/travis/build/appliances/update_rubygems.rb index abc1234..def5678 100644 --- a/lib/travis/build/appliances/update_rubygems.rb +++ b/lib/travis/build/appliances/update_rubygems.rb @@ -14,6 +14,10 @@ } if [[ \$(vers2int \`gem --version\`) -lt \$(vers2int "%s") ]]; then + echo "" + echo "** Updating RubyGems to the latest version for security reasons. **" + echo "** If you need an older version, you can downgrade with 'gem update --system OLD_VERSION'. **" + echo "" gem update --system fi EORVMHOOK
Add warning to the RVM hook
diff --git a/app/helpers/photos_helper.rb b/app/helpers/photos_helper.rb index abc1234..def5678 100644 --- a/app/helpers/photos_helper.rb +++ b/app/helpers/photos_helper.rb @@ -1,38 +1,55 @@ module PhotosHelper def crop_image_path(crop, full_size: false) - photo_or_placeholder(crop, full_size: full_size) - end - - def garden_image_path(garden, full_size: false) - photo_or_placeholder(garden, full_size: full_size) - end - - def planting_image_path(planting, full_size: false) - photo_or_placeholder(planting, full_size: full_size) - end - - def harvest_image_path(harvest, full_size: false) - photo_or_placeholder(harvest, full_size: full_size) - end - - def seed_image_path(seed, full_size: false) - photo_or_placeholder(seed, full_size: full_size) - end - - private - - def photo_or_placeholder(item, full_size: false) - if item.default_photo.present? - item_photo(item, full_size: full_size) + if crop.default_photo.present? + photo = crop.default_photo + full_size ? photo.fullsize_url : photo.thumbnail_url else placeholder_image end end - def item_photo(item, full_size:) - photo = item.default_photo - full_size ? photo.fullsize_url : photo.thumbnail_url + def garden_image_path(garden, full_size: false) + if garden.default_photo.present? + photo = garden.default_photo + full_size ? photo.fullsize_url : photo.thumbnail_url + else + placeholder_image + end end + + def planting_image_path(planting, full_size: false) + if planting.photos.present? + photo = planting.photos.order(date_taken: :desc).first + full_size ? photo.fullsize_url : photo.thumbnail_url + else + placeholder_image + end + end + + def harvest_image_path(harvest, full_size: false) + if harvest.photos.present? + photo = harvest.photos.order(date_taken: :desc).first + full_size ? photo.fullsize_url : photo.thumbnail_url + elsif harvest.planting.present? + planting_image_path(harvest.planting, full_size: full_size) + else + placeholder_image + end + end + + def seed_image_path(seed, full_size: false) + if seed.default_photo.present? + photo = seed.default_photo + full_size ? photo.fullsize_url : photo.thumbnail_url + elsif seed.crop.default_photo.present? + photo = seed.crop.default_photo + full_size ? photo.fullsize_url : photo.thumbnail_url + else + placeholder_image + end + end + + private def placeholder_image 'placeholder_150.png'
Revert "DRY the photos helper" This reverts commit 798fff43cf2c2606c5ed8987843a7fd151f6200d.
diff --git a/app/models/galleries_icon.rb b/app/models/galleries_icon.rb index abc1234..def5678 100644 --- a/app/models/galleries_icon.rb +++ b/app/models/galleries_icon.rb @@ -6,10 +6,6 @@ after_create :set_has_gallery after_destroy :unset_has_gallery validates :gallery_id, uniqueness: { scope: :icon_id } - - def set_has_gallery - icon.update_attributes(has_gallery: true) - end def unset_has_gallery return if icon.galleries.present?
Remove duplicate set_has_gallery from GalleriesIcon
diff --git a/lib/baler/parser/document.rb b/lib/baler/parser/document.rb index abc1234..def5678 100644 --- a/lib/baler/parser/document.rb +++ b/lib/baler/parser/document.rb @@ -19,7 +19,7 @@ end def relative_elements_for(path, index = nil) - if context_path.nil? + if context_path.nil? or context_path.strip == '' absolute_elements_for(path, index) elsif not index absolute_elements_for absolute_path(path)
Use absolute_elements when the context path is blank
diff --git a/spec/data_spec.rb b/spec/data_spec.rb index abc1234..def5678 100644 --- a/spec/data_spec.rb +++ b/spec/data_spec.rb @@ -11,7 +11,7 @@ expect { Indicators::Data.new('some string') }.to raise_error end it "contains dividends hash from securities gem" do - expect { Indicators::Data.new(Securities::Stock.new(["aapl"]).history(:start_date => '2012-08-01', :end_date => '2012-08-10', :periods => :dividends).results) }.to raise_error + expect { Indicators::Data.new(Securities::Stock.new(["aapl"]).history(:start_date => '2012-08-01', :end_date => '2012-08-10', :periods => :dividends)) }.to raise_error end end @@ -20,7 +20,7 @@ expect { Indicators::Data.new([1, 2, 3]) }.not_to raise_error end it "is a hash" do - expect { Indicators::Data.new(Securities::Stock.new(["aapl"]).history(:start_date => '2012-08-01', :end_date => '2012-08-03', :periods => :daily).results) }.not_to raise_error + expect { Indicators::Data.new(Securities::Stock.new(["aapl"]).history(:start_date => '2012-08-01', :end_date => '2012-08-03', :periods => :daily)) }.not_to raise_error end end
Repair specs after Securities update
diff --git a/spec/game_spec.rb b/spec/game_spec.rb index abc1234..def5678 100644 --- a/spec/game_spec.rb +++ b/spec/game_spec.rb @@ -12,8 +12,8 @@ end describe '#prompt_user_for_input' do - it 'ask users to input the position on available spots where they want to place an X' do - expect(new_game.prompt_user_for_input).to include("Enter a number 0, 1, 2, 3, 4, 5, 6, 7, 8 to place an X") + it 'ask users to input the position on all available slots where they want to place an X' do + expect(new_game.prompt_user_for_input).to eq("Enter a number 0, 1, 2, 3, 4, 5, 6, 7, 8 to place an X") end end
Update spot to slot to be consistent with other test
diff --git a/spec/memo_spec.rb b/spec/memo_spec.rb index abc1234..def5678 100644 --- a/spec/memo_spec.rb +++ b/spec/memo_spec.rb @@ -23,7 +23,7 @@ expect(actual.first).to eq(actual.last) end - specify 'memoized rules change between multiple runs' do + specify 'memoized rules are stored between multiple runs' do grammar = Calyx::Grammar.new do rule :start, '{flower}{flower}{flower}' rule :flower, :@flowers
Clarify the purpose of the test
diff --git a/lib/generators/redactor/templates/base/carrierwave/uploaders/redactor_rails_document_uploader.rb b/lib/generators/redactor/templates/base/carrierwave/uploaders/redactor_rails_document_uploader.rb index abc1234..def5678 100644 --- a/lib/generators/redactor/templates/base/carrierwave/uploaders/redactor_rails_document_uploader.rb +++ b/lib/generators/redactor/templates/base/carrierwave/uploaders/redactor_rails_document_uploader.rb @@ -2,7 +2,8 @@ class RedactorRailsDocumentUploader < CarrierWave::Uploader::Base include RedactorRails::Backend::CarrierWave - storage :fog + # storage :fog + storage :file def store_dir "system/redactor_assets/documents/#{model.id}"
Make :file the default storage with reminder that :fog is available
diff --git a/app/controllers/admin/categories_controller.rb b/app/controllers/admin/categories_controller.rb index abc1234..def5678 100644 --- a/app/controllers/admin/categories_controller.rb +++ b/app/controllers/admin/categories_controller.rb @@ -19,7 +19,17 @@ def update @category = Category.find(params[:id]) - @category.update(category_params) + @category.assign_attributes category_params + + if @category.name_changed? + existing_category = Category.where(name: @category.name).where.not(id: @category.id).first + if existing_category + @category.replace_with existing_category + @category = existing_category + end + end + @category.save! + # parent_id could be nil, so can't use @category.children if @category.parent_id @children = @category.parent.children
Replace category with existing if name has changed to exisiting category
diff --git a/app/controllers/incident_reports_controller.rb b/app/controllers/incident_reports_controller.rb index abc1234..def5678 100644 --- a/app/controllers/incident_reports_controller.rb +++ b/app/controllers/incident_reports_controller.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true class IncidentReportsController < ApplicationController - # TODO: access control + # set_report handles access control for member routes. before_action :set_report def update @@ -21,5 +21,7 @@ def set_report @report = IncidentReport.find params.require(:id) @incident = @report.incident + return if @current_user.staff? + deny_access and return unless @report.user == @current_user end end
Add access control to incident reports controller
diff --git a/app/presenters/tree_builder_template_filter.rb b/app/presenters/tree_builder_template_filter.rb index abc1234..def5678 100644 --- a/app/presenters/tree_builder_template_filter.rb +++ b/app/presenters/tree_builder_template_filter.rb @@ -11,4 +11,8 @@ :autoload => false ) end + + def root_options + [_("All Templates"), _("All of the Templates that I can see")] + end end
Add correct root to TreeBuilderTemplateFilter
diff --git a/db/migrate/20151210190211_delete_related_scheme_info_from_relation_types.rb b/db/migrate/20151210190211_delete_related_scheme_info_from_relation_types.rb index abc1234..def5678 100644 --- a/db/migrate/20151210190211_delete_related_scheme_info_from_relation_types.rb +++ b/db/migrate/20151210190211_delete_related_scheme_info_from_relation_types.rb @@ -0,0 +1,9 @@+class DeleteRelatedSchemeInfoFromRelationTypes < ActiveRecord::Migration + def change + change_table :dcs_relation_types do |t| + t.remove :related_metadata_scheme + t.remove :scheme_URI + t.remove :scheme_type + end + end +end
Remove relatedScheme info fields form Relation Types
diff --git a/db/migrate/20180801142224_add_name_translations_and_slug_to_vocabularies.rb b/db/migrate/20180801142224_add_name_translations_and_slug_to_vocabularies.rb index abc1234..def5678 100644 --- a/db/migrate/20180801142224_add_name_translations_and_slug_to_vocabularies.rb +++ b/db/migrate/20180801142224_add_name_translations_and_slug_to_vocabularies.rb @@ -5,7 +5,7 @@ add_column :vocabularies, :name_translations, :jsonb add_column :vocabularies, :slug, :string GobiertoCommon::Vocabulary.all.each do |vocabulary| - vocabulary.update(name_translations: localized_name_attr(vocabulary), slug: slug(vocabulary)) + vocabulary.update_columns(name_translations: localized_name_attr(vocabulary), slug: slug(vocabulary)) end remove_column :vocabularies, :name end @@ -13,18 +13,18 @@ def down add_column :vocabularies, :name, :string GobiertoCommon::Vocabulary.all.each do |vocabulary| - vocabulary.update(name: delocalized_name_attr(vocabulary)) + vocabulary.update_columns(name: delocalized_name_attr(vocabulary)) end remove_column :vocabularies, :slug remove_column :vocabularies, :name_translations end def localized_name_attr(vocabulary) - { vocabulary.site.configuration.default_locale => vocabulary.name } + { vocabulary.site.configuration.default_locale => vocabulary.attributes["name"] } end def slug(vocabulary) - slug_core = vocabulary.name.tr(" ", "_").parameterize + slug_core = vocabulary.attributes["name"].tr(" ", "_").parameterize return slug_core unless vocabulary.site.vocabularies.where(slug: slug_core).exists? "#{ slug_core }-#{ vocabulary.site.vocabularies.where(slug: slug_core).count + 1 }" end
Update migration to work with vocabularies validations
diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index abc1234..def5678 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -1,6 +1,9 @@ # Be sure to restart your server when you modify this file. -Publisher::Application.config.session_store :cookie_store, :key => '_publisher_session' +Publisher::Application.config.session_store :cookie_store, + :key => '_publisher_session', + :secure => Rails.env.production?, + :http_only => true # Use the database for sessions instead of the cookie-based default, # which shouldn't be used to store highly confidential information
Set cookies to only be served over https and to be http only
diff --git a/app/controllers/conversations_controller.rb b/app/controllers/conversations_controller.rb index abc1234..def5678 100644 --- a/app/controllers/conversations_controller.rb +++ b/app/controllers/conversations_controller.rb @@ -16,17 +16,12 @@ flash[:danger] = "A student will initiate conversation." else if Mentor.mentor_available_chat? + conversation = Conversation.new + conversation.create_student(id: current_student.id) mentor = Mentor.first_mentor_available_chat - prev_convos = Conversation.where(:student_id => current_student.id, :mentor_id => mentor.id).size - if prev_convos != 0 - conversation = Conversation.new - conversation.create_student(id: current_student.id) - conversation.create_mentor(id: mentor.id) - conversation.save! - flash[:success] = "Congradulations! You have been paird with #{mentor.email}" - else - flash[:info] = "You have an existing chat with #{mentor.email}" - end + conversation.create_mentor(id: mentor.id) + conversation.save! + flash[:success] = "Congradulations! You have been paird with #{mentor.email}" else flash[:danger] = "Mentor is not available at the moment" end
Revert "added logic to convo controller" This reverts commit 8169bd1b79face53b87b344f121584a782cb6ab8.
diff --git a/app/helpers/admin_event_proposals_helper.rb b/app/helpers/admin_event_proposals_helper.rb index abc1234..def5678 100644 --- a/app/helpers/admin_event_proposals_helper.rb +++ b/app/helpers/admin_event_proposals_helper.rb @@ -1,7 +1,7 @@ module AdminEventProposalsHelper def event_proposal_badge_class(event_proposal) case event_proposal.status - when 'pending' then 'badge-light' + when 'proposed' then 'badge-light' when 'reviewing' then 'badge-info' when 'accepted' then 'badge-success' when 'rejected' then 'badge-danger'
Use the right state name
diff --git a/app/helpers/rawnet_admin/resource_helper.rb b/app/helpers/rawnet_admin/resource_helper.rb index abc1234..def5678 100644 --- a/app/helpers/rawnet_admin/resource_helper.rb +++ b/app/helpers/rawnet_admin/resource_helper.rb @@ -1,5 +1,7 @@ module RawnetAdmin module ResourceHelper + EXCLUDED_SCOPES = [:page, :per] + def show_link_to(route, text='Show', options={}) icon_link_to text, route, 'search', options end @@ -45,7 +47,7 @@ end def no_scopes_applied? - (((controller.scopes_configuration.try(:keys) || []) & current_scopes.keys) - [:page]).empty? + (((controller.scopes_configuration.try(:keys) || []) & current_scopes.keys) - EXCLUDED_SCOPES).empty? end end end
Add :per to excluded scopes
diff --git a/app/helpers/xdomain_rails/xdomain_helper.rb b/app/helpers/xdomain_rails/xdomain_helper.rb index abc1234..def5678 100644 --- a/app/helpers/xdomain_rails/xdomain_helper.rb +++ b/app/helpers/xdomain_rails/xdomain_helper.rb @@ -2,15 +2,19 @@ module XdomainHelper def xdomain_masters(domains=nil) domains = (domains || master_domains).to_json.html_safe - javascript_include_tag("xdomain") + javascript_tag("xdomain.masters(#{domains})") + xdomain_script_tag + javascript_tag("xdomain.masters(#{domains})") end def xdomain_slaves(domains=nil) domains = (domains || slave_domains).to_json.html_safe - javascript_include_tag("xdomain") + javascript_tag("xdomain.slaves(#{domains})") + xdomain_script_tag + javascript_tag("xdomain.slaves(#{domains})") end private + + def xdomain_script_tag + javascript_tag(Rails.application.assets.find_asset("xdomain").source) + end def configuration Rails.configuration.xdomain
Embed xdomain javascript instead of making request
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -9,6 +9,5 @@ RSpec.configure do |config| config.mock_with :rspec - config.fixture_path = ::Rails.root.join('spec', 'fixtures') config.use_transactional_fixtures = true end
Remove unneeded fixture path setting.
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -10,7 +10,7 @@ Sinatra::Base.set :raise_errors, true Sinatra::Base.set :logging, false -require 'application' +require File.join(File.dirname(__FILE__), '../application') # establish in-memory database for testing DataMapper.setup(:default, "sqlite3::memory:")
Support for Ruby 1.9.x (thanks flexd!)
diff --git a/asg_results.rb b/asg_results.rb index abc1234..def5678 100644 --- a/asg_results.rb +++ b/asg_results.rb @@ -0,0 +1,34 @@+#!/usr/bin/env ruby +# +# usage: grep "SLEEP " ~/tmp/asgs_test.txt | grep -v echo | sort -n -k 2 | awk 'BEGIN { OLD=-1 } { print $2,$4,$6 }' | asg_results.rb +# +# reads from STDIN where the first number is seconds, 2nd, successes, 3rd, failurs +# +# 75 5 0 +# +# output +# +# 0 ***** +# + +seconds=0 +successes=0 +failures=0 +b=[] + +puts "|Delay (seconds)|# of tests|Success Rate (%)|Success Rate Histogram |" +puts "|--:|--:|--:|:--|" + +STDIN.read.split("\n").each do |a| + b = a.split + if seconds / 5 != b[0].to_i / 5 + puts "| #{seconds} | #{successes + failures} | #{successes*100/(successes+failures)} | #{'*'*(successes*25/(successes+failures))} |" + seconds=b[0].to_i + successes=b[1].to_i + failures=b[2].to_i + else + successes += b[1].to_i + failures += b[2].to_i + end +end +puts "| #{seconds} | #{successes + failures} | #{successes*100/(successes+failures)} | #{'*'*(successes*25/(successes+failures))} |"
Format ASG results in a Markdown-friendly way
diff --git a/chronicle_extension.rb b/chronicle_extension.rb index abc1234..def5678 100644 --- a/chronicle_extension.rb +++ b/chronicle_extension.rb @@ -3,8 +3,8 @@ class ChronicleExtension < Radiant::Extension version "1.0" - description "Describe your extension here" - url "http://yourwebsite.com/chronicle" + description "Keeps historical versions of pages and allows drafts of published pages." + url "http://github.com/jgarber/radiant-chronicle-extension/" define_routes do |map| map.namespace :admin, :member => { :remove => :get } do |admin|
Update extension description and URL.
diff --git a/core/db/migrate/20160207191757_add_id_column_to_earlier_habtm_tables.rb b/core/db/migrate/20160207191757_add_id_column_to_earlier_habtm_tables.rb index abc1234..def5678 100644 --- a/core/db/migrate/20160207191757_add_id_column_to_earlier_habtm_tables.rb +++ b/core/db/migrate/20160207191757_add_id_column_to_earlier_habtm_tables.rb @@ -0,0 +1,16 @@+class AddIdColumnToEarlierHabtmTables < ActiveRecord::Migration + def up + add_column :spree_option_type_prototypes, :id, :primary_key + add_column :spree_option_value_variants, :id, :primary_key + add_column :spree_order_promotions, :id, :primary_key + add_column :spree_product_promotion_rules, :id, :primary_key + add_column :spree_promotion_rule_users, :id, :primary_key + add_column :spree_property_prototypes, :id, :primary_key + add_column :spree_role_users, :id, :primary_key + add_column :spree_shipping_method_zones, :id, :primary_key + end + + def down + raise ActiveRecord::IrreversibleMigration + end +end
Add id to HABTM tables which were converted to has_many: through
diff --git a/app/models/url_cache.rb b/app/models/url_cache.rb index abc1234..def5678 100644 --- a/app/models/url_cache.rb +++ b/app/models/url_cache.rb @@ -23,7 +23,7 @@ end def download_url(url, to_path) - status, stdout, stderr = systemu(['wget', '--timeout', '10', '--tries', '1', '-O', to_path, url]) + status, stdout, stderr = systemu(['wget', '--no-check-certificate', '--timeout', '10', '--tries', '1', '-O', to_path, url]) FileUtils.touch(to_path) return true end
Add --no-check-certificate flag to wget
diff --git a/lib/rack/handler/rack_jax.rb b/lib/rack/handler/rack_jax.rb index abc1234..def5678 100644 --- a/lib/rack/handler/rack_jax.rb +++ b/lib/rack/handler/rack_jax.rb @@ -18,7 +18,7 @@ puts 'Creating server...' server = create_server(wrapp, port.to_i) - puts 'Starting server...' + puts "Starting server on port #{port}..." server.listen server.serve end
Print the listening port in server startup
diff --git a/appsignal-moped.gemspec b/appsignal-moped.gemspec index abc1234..def5678 100644 --- a/appsignal-moped.gemspec +++ b/appsignal-moped.gemspec @@ -17,8 +17,8 @@ s.require_path = 'lib' - s.add_dependency 'appsignal' - s.add_dependency 'moped', '~> 1.0' + s.add_dependency 'appsignal', '> 0.5' + s.add_dependency 'moped', '> 1.0' s.add_development_dependency 'rake' s.add_development_dependency 'rspec'
Correct versions for appsignal and moped
diff --git a/lib/signup/product_helper.rb b/lib/signup/product_helper.rb index abc1234..def5678 100644 --- a/lib/signup/product_helper.rb +++ b/lib/signup/product_helper.rb @@ -20,7 +20,7 @@ when :individual 108 else - raise ArgumentError.new("Unknown product name #{product}") + raise ArgumentError.new("Unknown product value #{product}") end end @@ -34,7 +34,7 @@ when :sponsor, :partner 3 else - raise ArgumentError.new("Unknown product name #{product}") + raise ArgumentError.new("Unknown product duration #{product}") end end @@ -45,7 +45,7 @@ when :sponsor, :partner, :individual 'YEAR' else - raise ArgumentError.new("Unknown product name #{product}") + raise ArgumentError.new("Unknown product basis #{product}") end end
Change the exception description for each method We can see where it came from more easily and it makes things clearer
diff --git a/SwinjectAutoregistration.podspec b/SwinjectAutoregistration.podspec index abc1234..def5678 100644 --- a/SwinjectAutoregistration.podspec +++ b/SwinjectAutoregistration.podspec @@ -18,5 +18,5 @@ s.requires_arc = true s.source_files = 'Sources/**/*.{swift,h}' - s.dependency 'Swinject', '~> 2.0.0' + s.dependency 'Swinject', '>= 2.0.0' end
Make Swinject dependency version at least 2.0.0
diff --git a/ruby-skype.gemspec b/ruby-skype.gemspec index abc1234..def5678 100644 --- a/ruby-skype.gemspec +++ b/ruby-skype.gemspec @@ -15,6 +15,7 @@ s.required_ruby_version = '~> 1.9' s.add_development_dependency 'yard' + s.add_development_dependency 'rake' s.platform = ENV['GEM_PLATFORM'] case ENV['GEM_PLATFORM']
Add rake as a development dependency
diff --git a/config/initializers/content_security_policy.rb b/config/initializers/content_security_policy.rb index abc1234..def5678 100644 --- a/config/initializers/content_security_policy.rb +++ b/config/initializers/content_security_policy.rb @@ -14,11 +14,7 @@ # # Specify URI for violation reports # # policy.report_uri "/csp-violation-report-endpoint" - if Rails.env.development? - policy.script_src :self, :https, :unsafe_eval, :unsafe_inline - else - policy.script_src :self, :https, :unsafe_inline - end + policy.script_src :self, :https, :unsafe_inline end # If you are using UJS then enable automatic nonce generation
Allow eval in prod environment, to support use of Vue templates
diff --git a/spec/controllers/user/emails_controller_spec.rb b/spec/controllers/user/emails_controller_spec.rb index abc1234..def5678 100644 --- a/spec/controllers/user/emails_controller_spec.rb +++ b/spec/controllers/user/emails_controller_spec.rb @@ -8,13 +8,25 @@ before { sign_in(user) } describe '#destroy' do - subject { delete :destroy, id: user.emails.first } + subject { delete :destroy, id: user.send(:default_email_record) } - context 'when user only have one email' do + context 'when the user only has one email address' do it 'cannot be deleted' do expect { subject }.to change { user.emails.count }.by(0) end it { is_expected.to redirect_to(user_emails_path) } + end + + context 'when destroying a primary email' do + let!(:non_primary_email) { create(:user_email, user: user, primary: false) } + it 'deletes the primary email' do + expect { subject }.to change { user.emails.count }.by(-1) + end + + it 'sets another email as primary' do + subject + expect(non_primary_email.reload).to be_primary + end end end
Add specs to test that when destroy a primary email of user
diff --git a/spec/views/essences/essence_text_editor_spec.rb b/spec/views/essences/essence_text_editor_spec.rb index abc1234..def5678 100644 --- a/spec/views/essences/essence_text_editor_spec.rb +++ b/spec/views/essences/essence_text_editor_spec.rb @@ -3,6 +3,18 @@ describe 'alchemy/essences/_essence_text_editor' do let(:essence) { Alchemy::EssenceText.new(body: '1234') } let(:content) { Alchemy::Content.new(essence: essence) } + + context 'with no input type set' do + before do + allow(view).to receive(:content_label).and_return("1e Zahl") + allow(content).to receive(:settings).and_return({}) + end + + it "renders an input field of type number" do + render partial: "alchemy/essences/essence_text_editor", locals: {content: content, options: {}, html_options: {}} + expect(rendered).to have_selector('input[type="text"]') + end + end context 'with a different input type set' do before do
Add test for the default input behaviour
diff --git a/rs-api-tools.gemspec b/rs-api-tools.gemspec index abc1234..def5678 100644 --- a/rs-api-tools.gemspec +++ b/rs-api-tools.gemspec @@ -1,7 +1,7 @@ Gem::Specification.new do |s| s.name = 'rs-api-tools' - s.version = '0.0.8' - s.date = '2013-11-04' + s.version = '0.0.9' + s.date = '2013-11-05' s.summary = "rs-api-tools" s.description = "RightScale API Command Line Tools." s.authors = ["Chris Fordham"]
Bump to 0.0.9 in gemspec.
diff --git a/active_interaction.gemspec b/active_interaction.gemspec index abc1234..def5678 100644 --- a/active_interaction.gemspec +++ b/active_interaction.gemspec @@ -10,7 +10,7 @@ spec.description = spec.summary spec.homepage = 'https://github.com/orgsync/active_interaction' spec.authors = ['Aaron Lasseigne', 'Taylor Fausak'] - spec.email = ['aaron.lasseigne@gmail.com', 'taylor@orgsync.com'] + spec.email = ['aaron.lasseigne@gmail.com', 'taylor@fausak.me'] spec.license = 'MIT' # Files
Switch to my personal email address
diff --git a/lib/github/s3_uploader.rb b/lib/github/s3_uploader.rb index abc1234..def5678 100644 --- a/lib/github/s3_uploader.rb +++ b/lib/github/s3_uploader.rb @@ -3,7 +3,7 @@ module Github class S3Uploader def upload(path, metadata) - RestClient.post("http://github.s3.amazonaws.com/", [ + RestClient.post(metadata["s3_url"], [ ["key", "#{metadata["prefix"]}#{metadata["name"]}"], ["acl", metadata["acl"]], ["success_action_redirect", metadata["redirect"]],
Use the S3 URL returned by the Github API.
diff --git a/lib/her/json_api/model.rb b/lib/her/json_api/model.rb index abc1234..def5678 100644 --- a/lib/her/json_api/model.rb +++ b/lib/her/json_api/model.rb @@ -17,7 +17,11 @@ @type = name.demodulize.tableize def self.parse(data) - data.fetch(:attributes).merge(data.slice(:id)) + if data[:attributes].nil? + data + else + data.fetch(:attributes).merge(data.slice(:id)) + end end def self.to_params(attributes, changes={})
Handle parsing fields_for type attributes
diff --git a/lib/nyny/request_scope.rb b/lib/nyny/request_scope.rb index abc1234..def5678 100644 --- a/lib/nyny/request_scope.rb +++ b/lib/nyny/request_scope.rb @@ -1,30 +1,20 @@ module NYNY class RequestScope - attr_reader :request, :response + extend Forwardable def self.add_helper_module m include m end + attr_reader :request, :response + def_delegators :request, :params, :session, :cookies def initialize request @request = request @response = Response.new '', 200, {'Content-Type' => 'text/html'} end - def params - request.params - end - def headers hash={} response.headers.merge! hash - end - - def session - request.session - end - - def cookies - request.cookies end def status code
Use forwardable to shorten the code
diff --git a/lib/buildr_plus/features/iris_audit.rb b/lib/buildr_plus/features/iris_audit.rb index abc1234..def5678 100644 --- a/lib/buildr_plus/features/iris_audit.rb +++ b/lib/buildr_plus/features/iris_audit.rb @@ -12,4 +12,4 @@ # limitations under the License. # -BuildrPlus::FeatureManager.feature(:iris_audit => [:keycloak]) +BuildrPlus::FeatureManager.feature(:iris_audit)
Remove incorrect relationship to keycloak facet
diff --git a/resources/site.rb b/resources/site.rb index abc1234..def5678 100644 --- a/resources/site.rb +++ b/resources/site.rb @@ -19,8 +19,8 @@ attribute :root, :kind_of => String, :default => "/var/www" attribute :index, :kind_of => String, :default => "index.html index.htm" attribute :slashlocation, :kind_of => String, :default => "try_files $uri $uri/" -attribute :phpfpm, :kind_of => [ TrueClass, FalseClass ], :default => false -attribute :accesslog, :kind_of => [ TrueClass, FalseClass ], :default => true +attribute :phpfpm, :kind_of => [TrueClass, FalseClass], :default => false +attribute :accesslog, :kind_of => [TrueClass, FalseClass], :default => true attribute :templatecookbook, :kind_of => String, :default => "nginx" attribute :templatesource, :kind_of => String, :default => "site.erb"
Remove spaces inside hard brackets
diff --git a/lib/spree/chimpy/controller_filters.rb b/lib/spree/chimpy/controller_filters.rb index abc1234..def5678 100644 --- a/lib/spree/chimpy/controller_filters.rb +++ b/lib/spree/chimpy/controller_filters.rb @@ -11,7 +11,7 @@ def find_mail_chimp_params mc_eid = params[:mc_eid] || session[:mc_eid] mc_cid = params[:mc_cid] || session[:mc_cid] - if (mc_eid || mc_cid) && session[:order_id] + if (mc_eid || mc_cid) && (session[:order_id] || params[:record_mc_details]) attributes = {campaign_id: mc_cid, email_id: mc_eid} if current_order(create_order_if_necessary: true).source
Save order source also if record_ms_details params is present This way, we do not need to set session[:order_id]
diff --git a/spec/factories/feature_flags.rb b/spec/factories/feature_flags.rb index abc1234..def5678 100644 --- a/spec/factories/feature_flags.rb +++ b/spec/factories/feature_flags.rb @@ -1,6 +1,6 @@ FactoryGirl.define do factory :feature_flag, class: 'Carto::FeatureFlag' do - sequence(:id) + id { Time.now.utc.to_i } sequence(:name) { |n| "feature-flag-name-#{n}" } restricted { true }
Fix FeatureFlag id issue with FactoryGirl
diff --git a/app/helpers/textual_mixins/textual_advanced_settings.rb b/app/helpers/textual_mixins/textual_advanced_settings.rb index abc1234..def5678 100644 --- a/app/helpers/textual_mixins/textual_advanced_settings.rb +++ b/app/helpers/textual_mixins/textual_advanced_settings.rb @@ -2,7 +2,7 @@ def textual_advanced_settings num = @record.number_of(:advanced_settings) h = {:label => _("Advanced Settings"), :icon => "pficon pficon-settings", :value => num} - if num > 0 + if num.positive? h[:title] = _("Show the advanced settings on this VM") h[:explorer] = true h[:link] = url_for_only_path(:action => 'advanced_settings', :id => @record, :db => controller.controller_name)
Fix rubocop warning in TextualMixins::TextualAdvancedSettings