diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/lib/support/requires.rb b/lib/support/requires.rb index abc1234..def5678 100644 --- a/lib/support/requires.rb +++ b/lib/support/requires.rb @@ -10,7 +10,10 @@ def initialize @ignorable_source_files = [File.join('support', 'requires.rb'), File.join('raml_poliglota.rb')] - @dir_order = ['configuration', 'model', 'support', 'helper', 'validation', 'parser', 'generator'] + @dir_order = [ + 'configuration', 'model', 'support', 'helper', 'validation', + 'parser', File.join('code', 'builder'), File.join('code', 'generator') + ] @lib_dir = File.dirname(__FILE__).sub /\/support$/, '' end
Add requirement to "code" folder.
diff --git a/lib/cargo.rb b/lib/cargo.rb index abc1234..def5678 100644 --- a/lib/cargo.rb +++ b/lib/cargo.rb @@ -1,12 +1,17 @@+require 'thread' + module Cargo VERSION = "0.0.3" REGISTRY = {} + SEMAPHORE = Mutex.new def import(file) - REGISTRY.fetch(file.sub(/\.rb$/, '').freeze) do |name| - load("#{name}.rb", true) - REGISTRY[name] = Thread.current[:cargo].tap do - Thread.current[:cargo] = nil + SEMAPHORE.synchronize do + REGISTRY.fetch(file.sub(/\.rb$/, '').freeze) do |name| + load("#{name}.rb", true) + REGISTRY[name] = Thread.current[:cargo].tap do + Thread.current[:cargo] = nil + end end end end
Add a mutex and sync call around import
diff --git a/lib/cassy.rb b/lib/cassy.rb index abc1234..def5678 100644 --- a/lib/cassy.rb +++ b/lib/cassy.rb @@ -8,6 +8,7 @@ def self.draw_routes Rails.application.routes.draw do scope(:path => "cas") do + root :to => "cassy/sessions#new" get 'login', :to => "cassy/sessions#new" post 'login', :to => "cassy/sessions#create" @@ -16,6 +17,8 @@ get 'serviceValidate', :to => "cassy/sessions#service_validate" get 'proxyValidate', :to => "cassy/sessions#proxy_validate" end + # TODO: Discover why we need to define this route separately. + get 'proxyValidate', :to => "cassy/sessions#proxy_validate" end end
Add /cas and /proxyValidate routes
diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index abc1234..def5678 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -1,6 +1,6 @@ module UsersHelper def profile_image(user, size=24) - image_tag user.authorizations && !user.authorizations.empty? ? user.authorizations.first.image : '', :width => size + image_tag user.authorizations && !user.authorizations.empty? ? user.authorizations.first.image : 'pomodoro-technique.png', :width => size end def user_name(user)
Fix "ActionView::Template::Error ( isn't precompiled)"
diff --git a/app/models/contact_group.rb b/app/models/contact_group.rb index abc1234..def5678 100644 --- a/app/models/contact_group.rb +++ b/app/models/contact_group.rb @@ -7,7 +7,10 @@ belongs_to :organisation - after_save :publish_finder + # The line below is commented out in order to disable publishing of + # Finders until we have Contacts within the Elastic Search index. + # + # after_save :publish_finder friendly_id :title, use: :history
Disable Finder publishing for now Publishing the Finder will take over the Index page for Contacts and as they don't yet exist in the search index there's then no way to browse them. This commit disables the Finder publishing temporarily by commenting it out and explaining why it is commented.
diff --git a/lib/ratch.rb b/lib/ratch.rb index abc1234..def5678 100644 --- a/lib/ratch.rb +++ b/lib/ratch.rb @@ -22,7 +22,7 @@ require 'ratch/utils/cli' require 'ratch/utils/pom' require 'ratch/utils/rdoc' -#require 'ratch/utils/email' +require 'ratch/utils/email' #require 'ratch/utils/tar' #require 'ratch/utils/zlib'
Load email helpers by default.
diff --git a/app/services/ical_reader.rb b/app/services/ical_reader.rb index abc1234..def5678 100644 --- a/app/services/ical_reader.rb +++ b/app/services/ical_reader.rb @@ -1,7 +1,6 @@ require 'http' class IcalReader < BaseReader - ALLOWED_LOCATIONS = ['Dresden', 'SLUB'] class << self def cronjob UserGroup.with_ical.each do |account| @@ -27,9 +26,6 @@ end def parse_event(calendar_event) - return if !calendar_event.location - return if !ALLOWED_LOCATIONS.any?{|loc| calendar_event.location.downcase.include?(loc.downcase) } - event = Event.where(link: calendar_event.url, user_group_id: @user_group.id).first_or_initialize event.assign_attributes( text: calendar_event.summary,
Remove location filter for icalreader
diff --git a/loaf.gemspec b/loaf.gemspec index abc1234..def5678 100644 --- a/loaf.gemspec +++ b/loaf.gemspec @@ -17,7 +17,7 @@ spec.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } spec.require_paths = ["lib"] - spec.add_dependency 'rails', '>= 3.1' + spec.add_dependency 'rails', '>= 3.2' spec.add_development_dependency 'bundler', '~> 1.5' spec.add_development_dependency 'rake'
Change to increase rails version
diff --git a/opal/clearwater.rb b/opal/clearwater.rb index abc1234..def5678 100644 --- a/opal/clearwater.rb +++ b/opal/clearwater.rb @@ -1,5 +1,6 @@ require 'browser' require 'clearwater/component' require 'clearwater/svg_component' +require 'clearwater/cached_render' require 'clearwater/link' require 'clearwater/application'
Include CachedRender support by default
diff --git a/callcredit.gemspec b/callcredit.gemspec index abc1234..def5678 100644 --- a/callcredit.gemspec +++ b/callcredit.gemspec @@ -8,6 +8,7 @@ gem.add_development_dependency 'rspec', '~> 3.0.0' gem.add_development_dependency 'webmock', '~> 1.18.0' + gem.add_development_dependency 'rubocop' gem.authors = ['Grey Baker'] gem.description = "Ruby wrapper for Callcredit's CallValidate API"
Add Rubocop to development dependencies
diff --git a/lmtp.gemspec b/lmtp.gemspec index abc1234..def5678 100644 --- a/lmtp.gemspec +++ b/lmtp.gemspec @@ -14,7 +14,7 @@ spec.authors = ["Marvin Gülker"] spec.email = "quintus@quintilianus.eu" spec.files = Dir["lib/**/*.rb", "README.rdoc", "LICENSE"] - spec.homepage = "http://todo.invalid" + spec.homepage = "https://github.com/Quintus/ruby-lmtp" spec.license = "BSD" spec.platform = Gem::Platform::RUBY
Fix homepage link in gemspec
diff --git a/hello_sign.gemspec b/hello_sign.gemspec index abc1234..def5678 100644 --- a/hello_sign.gemspec +++ b/hello_sign.gemspec @@ -13,8 +13,8 @@ gem.license = 'MIT' gem.require_paths = ['lib'] - gem.files += Dir.glob('lib/**/*.rb') - gem.test_files += Dir.glob('spec/**/*') + gem.files = Dir['lib/**/*.rb'] + gem.test_files = Dir['spec/**/*'] gem.add_dependency 'faraday', '~> 0.8'
Change to [] globbing syntax
diff --git a/EnvoyAmbassador.podspec b/EnvoyAmbassador.podspec index abc1234..def5678 100644 --- a/EnvoyAmbassador.podspec +++ b/EnvoyAmbassador.podspec @@ -12,6 +12,6 @@ git: 'https://github.com/envoy/Ambassador.git', tag: 'v0.0.1-alpha-1' } - spec.source_files = 'Ambassador/*.swift' + spec.source_files = 'Ambassador/*.swift', 'Ambassador/**/*.swift' spec.dependency 'Embassy', '~> 1.0' end
Fix podspec doesn't include right files issue
diff --git a/subtle.gemspec b/subtle.gemspec index abc1234..def5678 100644 --- a/subtle.gemspec +++ b/subtle.gemspec @@ -16,4 +16,10 @@ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) } gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) gem.require_paths = ["lib"] + + gem.add_dependency "parslet" + + %w{rspec guard-rspec simplecov pry pry-debugger}.each do |name| + gem.add_development_dependency name + end end
Add parslet, rspec, guard-rspec, simplecov, pry and pry-debugger gems.
diff --git a/app/uploaders/avatar_uploader.rb b/app/uploaders/avatar_uploader.rb index abc1234..def5678 100644 --- a/app/uploaders/avatar_uploader.rb +++ b/app/uploaders/avatar_uploader.rb @@ -30,7 +30,7 @@ image_path("#{Cloudsdale.config['asset_url']}/assets/fallback/#{mounted_as}/" + [version_name, "#{model.avatar_namespace}.png"].compact.join('_')) end - after :store, :purge_from_cdn + after :store, :purge_from_cdn, :set_avatar_uploaded_at after :remove, :purge_from_cdn protected @@ -45,4 +45,10 @@ end end + # Private: Sets the avatar upload date on model. + # Returns the date the avatar was uploaded. + def set_avatar_uploaded_at + model.avatar_uploaded_at = DateTime.now if model.respond_to?(:avatar_uploaded_at) + end + end
Manage avatar upload date from uploader.
diff --git a/app/controllers/api/v1/organizations_controller.rb b/app/controllers/api/v1/organizations_controller.rb index abc1234..def5678 100644 --- a/app/controllers/api/v1/organizations_controller.rb +++ b/app/controllers/api/v1/organizations_controller.rb @@ -6,6 +6,7 @@ #thanks to the 'api-pagination' gem after_filter only: [:index] { paginate(:orgs) } after_filter only: [:search] { paginate(:results) } + after_filter only: [:nearby] { paginate(:nearby) } caches :index, :show, :search, :caches_for => 5.minutes @@ -20,7 +21,8 @@ def nearby org = Organization.find(params[:id]) - expose org.nearbys(current_radius) + @nearby = org.nearbys(current_radius).page(params[:page]).per(30) + expose @nearby end def search
Add pagination to nearby endpoint
diff --git a/commands/reload.rb b/commands/reload.rb index abc1234..def5678 100644 --- a/commands/reload.rb +++ b/commands/reload.rb @@ -14,6 +14,7 @@ $SETTINGS = load_sensitive_settings $settings_file return $SETTINGS == nil ? "Unable to reload settings" : "Settings reloaded" end + return "" end # Essential to make commands a singleton
Return an empty string if unauthorized
diff --git a/Support/spec/cucumber/mate/table_aligner_spec.rb b/Support/spec/cucumber/mate/table_aligner_spec.rb index abc1234..def5678 100644 --- a/Support/spec/cucumber/mate/table_aligner_spec.rb +++ b/Support/spec/cucumber/mate/table_aligner_spec.rb @@ -8,6 +8,13 @@ unaligned = " | a |b|\n|c| d |" TableAligner.new.align(unaligned).should == " | a | b |\n | c | d |" end + + it "should align a table with multi-byte UTF8 values" do + unaligned = " | a |b|\n" + + " |÷| d |" + TableAligner.new.align(unaligned).should == " | a | b |\n" + + " | ÷ | d |" + end end end end
Add spec for multibyte UTF8 table alignment Signed-off-by: Ben Mabey <73675debcd8a436be48ec22211dcf44fe0df0a64@benmabey.com>
diff --git a/generators/facebook_user/templates/controller.rb b/generators/facebook_user/templates/controller.rb index abc1234..def5678 100644 --- a/generators/facebook_user/templates/controller.rb +++ b/generators/facebook_user/templates/controller.rb @@ -27,7 +27,7 @@ end def after_facebook_login_url - url_for(:controller=>request.request_uri,:only_path=>true) + request.request_uri end
Fix redirect url in plugin
diff --git a/brew/cask/awsaml.rb b/brew/cask/awsaml.rb index abc1234..def5678 100644 --- a/brew/cask/awsaml.rb +++ b/brew/cask/awsaml.rb @@ -1,6 +1,6 @@ cask 'awsaml' do - version '2.2.0' - sha256 'f9a0a74c3630cc6a53b5d68bb34cd545827f9541b6393046bfff88b1658de4ae' + version '2.2.1' + sha256 '616fde14a614c77220529a70fbcf172a6e8a2a8bbd802af9451b07a732cf9056' url "https://github.com/rapid7/awsaml/releases/download/v#{version}/awsaml-v#{version}-darwin-x64.zip" appcast 'https://github.com/rapid7/awsaml/releases.atom'
Update brew cask for 2.2.1
diff --git a/Casks/box-sync.rb b/Casks/box-sync.rb index abc1234..def5678 100644 --- a/Casks/box-sync.rb +++ b/Casks/box-sync.rb @@ -2,7 +2,8 @@ version :latest sha256 :no_check - url 'https://box.com/sync4mac' + # boxcdn.net is the official download host per the vendor homepage + url 'https://e3.boxcdn.net/box-installers/sync/Sync+4+External/Box%20Sync%20Installer.dmg' name 'Box Sync' homepage 'https://sites.box.com/sync4/' license :gratis
Update download URL for Box Sync
diff --git a/ConfigKit.podspec b/ConfigKit.podspec index abc1234..def5678 100644 --- a/ConfigKit.podspec +++ b/ConfigKit.podspec @@ -3,7 +3,7 @@ Pod::Spec.new do |s| s.name = 'ConfigKit' - s.version = '1.2.2' + s.version = '1.2.3' s.summary = 'Configuration toolkit.' s.description = <<-DESC
Modify : pod spec 1.2.3
diff --git a/capybara-ui.gemspec b/capybara-ui.gemspec index abc1234..def5678 100644 --- a/capybara-ui.gemspec +++ b/capybara-ui.gemspec @@ -14,6 +14,8 @@ spec.files = `git ls-files`.split($/) spec.test_files = spec.files.grep(/^spec/) + spec.add_dependency "capybara", "~> 2.2" + spec.add_development_dependency "bundler", "~> 1.3" spec.add_development_dependency "rake", "~> 10.1" end
Add Capybara as a runtime dependency
diff --git a/js_invoker.gemspec b/js_invoker.gemspec index abc1234..def5678 100644 --- a/js_invoker.gemspec +++ b/js_invoker.gemspec @@ -22,4 +22,7 @@ spec.add_development_dependency "bundler", "~> 1.6" spec.add_development_dependency "rake" spec.add_development_dependency "rspec-rails" + spec.add_development_dependency "rails", "=3.2.21" + spec.add_development_dependency "capybara-webkit" + spec.add_development_dependency "sqlite3" end
Add gem for test_apps to gemspec
diff --git a/msfl.gemspec b/msfl.gemspec index abc1234..def5678 100644 --- a/msfl.gemspec +++ b/msfl.gemspec @@ -6,29 +6,8 @@ s.description = "Serializers, validators, and other tasty goodness for the Mattermark Semantic Filter Language in Ruby." s.authors = ["Courtland Caldwell"] s.email = 'courtland@mattermark.com' - s.files = [ - "lib/msfl.rb", - - "lib/msfl/configuration.rb", - "lib/msfl/datasets.rb", - "lib/msfl/parsers.rb", - "lib/msfl/types.rb", - "lib/msfl/validators.rb", - - "lib/msfl/datasets/base.rb", - "lib/msfl/datasets/movies.rb", - - "lib/msfl/parsers/json.rb", - - "lib/msfl/types/set.rb", - - "lib/msfl/validators/definitions.rb", - "lib/msfl/validators/semantic.rb", - - "lib/msfl/validators/definitions/hash_key.rb", - - - ] + s.files = `git ls-files`.split("\n") + s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") s.homepage = 'https://github.com/caldwecr/msfl' s.add_runtime_dependency "json", "~> 1.7"
Switch to convenience approach for gemspec files
diff --git a/config/schedule.rb b/config/schedule.rb index abc1234..def5678 100644 --- a/config/schedule.rb +++ b/config/schedule.rb @@ -1,5 +1,3 @@ every 1.day, at: '4:30 am' do - job_type :rake, "cd /srv/frontend/ && source /etc/mas/environment && RAILS_ENV=production bundle exec rake :task --silent :output" - - rake 'feed:store' # from the PACs engine + command "cd /srv/frontend/ && source /etc/mas/environment && RAILS_ENV=production bundle exec rake feed:store" end
Add rake feed store to whenever
diff --git a/test/unit/rails_ops/operation/model/create_test.rb b/test/unit/rails_ops/operation/model/create_test.rb index abc1234..def5678 100644 --- a/test/unit/rails_ops/operation/model/create_test.rb +++ b/test/unit/rails_ops/operation/model/create_test.rb @@ -0,0 +1,52 @@+require 'test_helper' + +class RailsOps::Operation::Model::CreateTest < ActiveSupport::TestCase + include TestHelper + + BASIC_OP = Class.new(RailsOps::Operation::Model::Create) do + model Group + end + + def test_basic + op = BASIC_OP.run!(group: { name: 'test', color: 'red' }) + + assert_equal 'test', op.model.name + assert_equal 'red', op.model.color + assert op.model.persisted? + refute op.model.changed? + end + + def test_model_extension + cls = Class.new(RailsOps::Operation::Model::Create) do + model Group do + validates :color, presence: true + end + end + + assert cls.new.model.class < Group + + assert_raises ActiveRecord::RecordInvalid do + cls.run!(group: { name: 'test' }) + end + end + + def test_parent_op + op = BASIC_OP.new + assert_equal op, op.model.parent_op + end + + def test_always_extend_model_class + assert RailsOps::Operation::Model::Create.always_extend_model_class? + end + + def test_build + op = BASIC_OP.new + op.build_model + + assert op.instance_variable_get(:@model) + + assert_raises_with_message RuntimeError, 'Model can only be built once.' do + op.build_model + end + end +end
Add test for model creation
diff --git a/modules/govuk_jenkins/spec/classes/govuk_jenkins__jobs__each_spec.rb b/modules/govuk_jenkins/spec/classes/govuk_jenkins__jobs__each_spec.rb index abc1234..def5678 100644 --- a/modules/govuk_jenkins/spec/classes/govuk_jenkins__jobs__each_spec.rb +++ b/modules/govuk_jenkins/spec/classes/govuk_jenkins__jobs__each_spec.rb @@ -8,6 +8,8 @@ copy_data_from_integration_to_aws.pp copy_data_from_staging_to_aws.pp copy_data_from_production_to_aws.pp + copy_attachments_to_integration.pp + copy_attachments_to_staging.pp copy_data_to_integration.pp copy_data_to_staging.pp deploy_cdn.pp
Exclude new jobs from being run in specs The `@environment_variables` variable doesn’t seem to be getting passed through in specs, so following the pattern of other copy_data jobs and adding them to this list.
diff --git a/Formula/bartycrouch.rb b/Formula/bartycrouch.rb index abc1234..def5678 100644 --- a/Formula/bartycrouch.rb +++ b/Formula/bartycrouch.rb @@ -1,7 +1,7 @@ class Bartycrouch < Formula desc "Incrementally update/translate your Strings files" homepage "https://github.com/Flinesoft/BartyCrouch" - url "https://github.com/Flinesoft/BartyCrouch.git", :tag => "4.1.0", :revision => "be2404129aa6141b00a2e7fd61e7dd8ab088d1d6" + url "https://github.com/Flinesoft/BartyCrouch.git", :tag => "4.1.1", :revision => "201b0b02c196dcda14c806a539ab963284abeeaf" head "https://github.com/Flinesoft/BartyCrouch.git" depends_on :xcode => ["11.4", :build]
Update Formula to version 4.1.1
diff --git a/Formula/bartycrouch.rb b/Formula/bartycrouch.rb index abc1234..def5678 100644 --- a/Formula/bartycrouch.rb +++ b/Formula/bartycrouch.rb @@ -1,10 +1,10 @@ class Bartycrouch < Formula desc "Incrementally update/translate your Strings files" homepage "https://github.com/Flinesoft/BartyCrouch" - url "https://github.com/Flinesoft/BartyCrouch.git", :tag => "4.0.0", :revision => "3afdce4b875b6e8a573eaa30a225e709b7ee7b0a" + url "https://github.com/Flinesoft/BartyCrouch.git", :tag => "4.0.1", :revision => "b7e940a6383c9d1f013288081dcc2a395c68448b" head "https://github.com/Flinesoft/BartyCrouch.git" - depends_on :xcode => ["10.0", :build] + depends_on :xcode => ["10.2", :build] def install system "make", "install", "prefix=#{prefix}"
Update formula to version 4.0.1
diff --git a/lib/notifiable/mpns/nverinaud/single_notifier.rb b/lib/notifiable/mpns/nverinaud/single_notifier.rb index abc1234..def5678 100644 --- a/lib/notifiable/mpns/nverinaud/single_notifier.rb +++ b/lib/notifiable/mpns/nverinaud/single_notifier.rb @@ -8,9 +8,22 @@ protected def enqueue(notification, device_token) + + data = {} - options = {content: notification.message} - response = MicrosoftPushNotificationService.send_notification device_token.token, :toast, options + # title + title = notification.provider_value(device_token.provider, :title) + data[:title] = title if title + + # content + content = notification.provider_value(device_token.provider, :message) + data[:content] = content if content + + # custom attributes + custom_attributes = notification.provider_value(device_token.provider, :params) + data.merge!({:params => custom_attributes}) if custom_attributes + + response = MicrosoftPushNotificationService.send_notification device_token.token, :toast, data case response.code.to_i when 200
Update notifier to pass title and custom attributes
diff --git a/app/controllers/v3/auth/federation_controller.rb b/app/controllers/v3/auth/federation_controller.rb index abc1234..def5678 100644 --- a/app/controllers/v3/auth/federation_controller.rb +++ b/app/controllers/v3/auth/federation_controller.rb @@ -5,13 +5,17 @@ include TokenRespondable def oidc - @credentials = ::Auth::Oidc.unified_credentials(ENV.select { |name| name.start_with?('OIDC') }) - headers[x_subject_token_header_key] = Utils::Tokenator.to_token(@credentials.to_hash) - respond_with token_response + auth_response(::Auth::Oidc, 'OIDC') end def voms - @credentials = ::Auth::Voms.unified_credentials(ENV.select { |name| name.start_with?('GRST', 'SSL') }) + auth_response(::Auth::Voms, 'SSL', 'GRST') + end + + private + + def auth_response(type, *filters) + @credentials = type.unified_credentials(ENV.select { |name| name.start_with?(*filters) }) headers[x_subject_token_header_key] = Utils::Tokenator.to_token(@credentials.to_hash) respond_with token_response end
Remove duplications in federation controller
diff --git a/app/models/metric/ci_mixin/long_term_averages.rb b/app/models/metric/ci_mixin/long_term_averages.rb index abc1234..def5678 100644 --- a/app/models/metric/ci_mixin/long_term_averages.rb +++ b/app/models/metric/ci_mixin/long_term_averages.rb @@ -25,7 +25,7 @@ def averages_over_time_period(col, typ) # TODO: Deal with choosing the right TimeProfile. See #generate_vim_performance_operating_range # For now just use the one vpor which is tied to the default TimeProfile. - vpor = vim_performance_operating_ranges.first + vpor = vim_performance_operating_ranges.detect(&:time_profile_id) vpor.nil? ? 0 : vpor.values_to_metrics["#{col}_#{typ}_over_time_period"] end end
Fix issue where backporting would not false detect nil time_profile_id
diff --git a/app/helpers/alertify_helper.rb b/app/helpers/alertify_helper.rb index abc1234..def5678 100644 --- a/app/helpers/alertify_helper.rb +++ b/app/helpers/alertify_helper.rb @@ -1,5 +1,5 @@ module AlertifyHelper - ALERT_TYPES = [:error, :info, :success, :warning] unless const_defined?(:ALERT_TYPES) + ALERT_TYPES = ['error', 'info', 'success', 'warning'] unless const_defined?(:ALERT_TYPES) def alertify_flash jsReturn = javascript_tag() @@ -7,8 +7,8 @@ # Skip empty messages, e.g. for devise messages set to nothing in a locale file. next if message.blank? - type = :success if type == :notice - type = :error if type == :alert + type = 'success' if type == 'notice' + type = 'error' if type == 'alert' next unless ALERT_TYPES.include?(type) js_alertify = ""
Add helper for rails 4+
diff --git a/app/policies/project_policy.rb b/app/policies/project_policy.rb index abc1234..def5678 100644 --- a/app/policies/project_policy.rb +++ b/app/policies/project_policy.rb @@ -25,7 +25,7 @@ def permitted_attributes if user.present? && (!record.instance_of?(Project) || fully_editable?) - { project: record.attribute_names.map(&:to_sym) + [:location] } + { project: record.attribute_names.map(&:to_sym) + [:location, :tag_list] } else { project: [:about, :video_url, :uploaded_image, :hero_image, :headline, :budget,
Add tag_list attribute to permitted attrs on project policy
diff --git a/app/views/needs/show.json.rabl b/app/views/needs/show.json.rabl index abc1234..def5678 100644 --- a/app/views/needs/show.json.rabl +++ b/app/views/needs/show.json.rabl @@ -6,10 +6,10 @@ child :writing_department => :writing_team do attribute :id, :name end - -child :fact_checkers do + +child :fact_checkers => :fact_checkers do attribute :email -end +end child :policy_departments => :policy_owners do attribute :id, :name
Fix for empty attribute but
diff --git a/Fetchable.podspec b/Fetchable.podspec index abc1234..def5678 100644 --- a/Fetchable.podspec +++ b/Fetchable.podspec @@ -17,7 +17,7 @@ :commit => 'fdaf35f17fd279397d1ae5a79db76afc8c841797' } - spec.source_files = 'Fetchable/**/*.{h,m}' + spec.source_files = 'Classes/**/*.{h,m}' spec.framework = 'CoreData' spec.requires_arc = true
Update spec.source_files after folder rename
diff --git a/Formula/parity.rb b/Formula/parity.rb index abc1234..def5678 100644 --- a/Formula/parity.rb +++ b/Formula/parity.rb @@ -2,9 +2,9 @@ class Parity < Formula homepage "https://github.com/thoughtbot/parity" - url "https://github.com/thoughtbot/parity/releases/download/v0.9.2/parity-0.9.2-osx.tar.gz" - version "0.9.2.1" sha256 "d56827ce379958b5abe386f6afff3b012275f43a6d982f524c54bb8a790cee20" + url "https://github.com/thoughtbot/parity/releases/download/v0.9.2/parity-0.9.1-osx.tar.gz" + version "0.9.2" depends_on "git" depends_on "heroku-toolbelt" @@ -16,9 +16,17 @@ bin.install "bin/development", "bin/staging", "bin/production" end + devel do + url "https://github.com/thoughtbot/parity/releases/download/v0.9.3.beta/parity-0.9.3.beta-osx.tar.gz" + + depends_on "git" + depends_on "heroku-toolbelt" + depends_on "postgres" + end + test do system "#{bin}/development", "--version" + system "#{bin}/production", "--version" system "#{bin}/staging", "--version" - system "#{bin}/production", "--version" end end
Create development version of Parity forumla This change adds a `devel` version of the Parity forumla that can be used to test the packaged executables without pushing a new version prematurely to users. Documentation: https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Formula-Cookbook.md#unstable-versions-devel-head
diff --git a/Formula/sphinx.rb b/Formula/sphinx.rb index abc1234..def5678 100644 --- a/Formula/sphinx.rb +++ b/Formula/sphinx.rb @@ -13,6 +13,7 @@ config_args = ["--prefix=#{prefix}", "--disable-debug", "--disable-dependency-tracking"] # configure script won't auto-select PostgreSQL config_args << "--with-pgsql" if `/usr/bin/which pg_config`.size > 0 + config_args << "--without-mysql" if `/usr/bin/which mysqld`.size <= 0 system "./configure", *config_args system "make install"
Fix Sphinx formula to pass --without-mysql if which fails to find mysqld Signed-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com>
diff --git a/multipost.rb b/multipost.rb index abc1234..def5678 100644 --- a/multipost.rb +++ b/multipost.rb @@ -1,7 +1,7 @@ module Jekyll class MultiPost < Post - # Initialize this Post instance. + # Initialize this Multipost instance. # # site - The Site. # base - The String path to the dir containing the post file.
Change back 'Post' to 'Multipost' in TomDoc
diff --git a/recipes/default.rb b/recipes/default.rb index abc1234..def5678 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -8,7 +8,7 @@ # # apt -include_recipe 'apt' +include_recipe 'desktop::apt' # Hardware. include_recipe 'desktop::bluetooth'
Configure apt before moving on
diff --git a/app/concerns/processors/showcaser.rb b/app/concerns/processors/showcaser.rb index abc1234..def5678 100644 --- a/app/concerns/processors/showcaser.rb +++ b/app/concerns/processors/showcaser.rb @@ -8,6 +8,8 @@ class Showcaser extend Resque::Plugins::HerokuAutoscaler + @queue = 'processors' + class << self def perform key Original.find(key).compress(100).resize(2500, 1667).to(:fit).watermark.save
Add Showcaser processor jobs onto a queue
diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index abc1234..def5678 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -1,6 +1,6 @@ class PhotosController < ApplicationController def index - @photos = Photo.all + @photos = Photo.all.sort {|p, q| q.years_string <=> p.years_string } end def new
Sort photos on index in reverse order
diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index abc1234..def5678 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -7,6 +7,7 @@ @users = User.search(params[:q]).records.to_a end + # GET /autocomplete.json?term=rails def autocomplete @posts = Post.search(params[:term]) @users = User.search(params[:term])
Add a comment for future reference
diff --git a/lib/compath/guide.rb b/lib/compath/guide.rb index abc1234..def5678 100644 --- a/lib/compath/guide.rb +++ b/lib/compath/guide.rb @@ -35,7 +35,7 @@ def object_key if directory? - if @scan_children + if !has_directory_child? || @scan_children pathname.to_s + '/' else pathname.to_s + '/**/*' @@ -48,5 +48,9 @@ def object_value @description end + + def has_directory_child? + pathname.children.any?(&:directory?) + end end end
Add `**/*` only for the path which has one or more children of directory
diff --git a/lib/findrepos/cli.rb b/lib/findrepos/cli.rb index abc1234..def5678 100644 --- a/lib/findrepos/cli.rb +++ b/lib/findrepos/cli.rb @@ -3,13 +3,13 @@ module Findrepos class CLI < Thor - desc 'list', 'lists all Git repositories in the current directory' + desc 'list [DIRECTORY]', 'lists all Git repositories in the given directory' option :recursive, desc: 'finds Git repositories in subdirectories recursively', type: :boolean, aliases: :'-r' - def list - Findrepos.list(recursive: options[:recursive]).each do |repo| + def list(directory = '.') + Findrepos.list(directory, recursive: options[:recursive]).each do |repo| if Findrepos.clean?(repo) say_status 'clean', repo, :green else
Allow the user to specify a directory for the list command
diff --git a/lib/google/errors.rb b/lib/google/errors.rb index abc1234..def5678 100644 --- a/lib/google/errors.rb +++ b/lib/google/errors.rb @@ -1,5 +1,78 @@ module Google + # Signet::AuthorizationError + # Not part of Google Calendar API Errors + class HTTPAuthorizationFailed < StandardError; end + + # Google Calendar API Errors per documentation + # https://developers.google.com/google-apps/calendar/v3/errors + + # 400: Bad Request + # + # User error. This can mean that a required field or parameter has not been + # provided, the value supplied is invalid, or the combination of provided + # fields is invalid. class HTTPRequestFailed < StandardError; end - class HTTPAuthorizationFailed < StandardError; end + + # 401: Invalid Credentials + # + # Invalid authorization header. The access token you're using is either + # expired or invalid. + class InvalidCredentialsError < StandardError; end + + # 403: Daily Limit Exceeded + # + # The Courtesy API limit for your project has been reached. + class DailyLimitExceededError < StandardError; end + + # 403: User Rate Limit Exceeded + # + # The per-user limit from the Developer Console has been reached. + class UserRateLimitExceededError < StandardError; end + + # 403: Rate Limit Exceeded + # + # The user has reached Google Calendar API's maximum request rate per + # calendar or per authenticated user. + class RateLimitExceededError < StandardError; end + + # 403: Calendar usage limits exceeded + # + # The user reached one of the Google Calendar limits in place to protect + # Google users and infrastructure from abusive behavior. + class CalendarUsageLimitExceededError < StandardError; end + + # 404: Not Found + # + # The specified resource was not found. class HTTPNotFound < StandardError; end + + # 409: The requested identifier already exists + # + # An instance with the given ID already exists in the storage. + class RequestedIdentifierAlreadyExistsError < StandardError; end + + # 410: Gone + # + # SyncToken or updatedMin parameters are no longer valid. This error can also + # occur if a request attempts to delete an event that has already been + # deleted. + class GoneError < StandardError; end + + # 412: Precondition Failed + # + # The etag supplied in the If-match header no longer corresponds to the + # current etag of the resource. + class PreconditionFailedError < StandardError; end + + # 500: Backend Error + # + # An unexpected error occurred while processing the request. + class BackendError < StandardError; end + + # + # 403: Forbidden Error + # + # User has no authority to conduct the requested operation on the resource. + # This is not a part of official Google Calendar API Errors documentation. + class ForbiddenError < StandardError; end end
Add Google Calendar API Errors Signed-off-by: Bonghyun Kim <fbc2a31a9a8531983f3717da27fe00fe3b544a20@gmail.com>
diff --git a/config/initializers/clearance.rb b/config/initializers/clearance.rb index abc1234..def5678 100644 --- a/config/initializers/clearance.rb +++ b/config/initializers/clearance.rb @@ -1,5 +1,5 @@ Clearance.configure do |config| - config.mailer_sender = "donotreply@rubygems.org" + config.mailer_sender = "help@rubygems.org" config.secure_cookie = true unless Rails.env.test? || Rails.env.development? config.password_strategy = Clearance::PasswordStrategies::BCryptMigrationFromSHA1 end
Use the new help@rubygems.org address instead of donotreply
diff --git a/config/initializers/overrides.rb b/config/initializers/overrides.rb index abc1234..def5678 100644 --- a/config/initializers/overrides.rb +++ b/config/initializers/overrides.rb @@ -0,0 +1,26 @@+# Patch ActiveJob Sidekiq adapter to Rails 5 behavior +# THIS IS BAD. REMOVE WHEN UPDATING TO RAILS 5! + +ActiveJob::QueueAdapters::SidekiqAdapter.class_eval do + class << self + + def enqueue(job) #:nodoc: + #Sidekiq::Client does not support symbols as keys + job.provider_job_id = Sidekiq::Client.push \ + 'class' => JobWrapper, + 'wrapped' => job.class.to_s, + 'queue' => job.queue_name, + 'args' => [ job.serialize ] + end + + def enqueue_at(job, timestamp) #:nodoc: + job.provider_job_id = Sidekiq::Client.push \ + 'class' => JobWrapper, + 'wrapped' => job.class.to_s, + 'queue' => job.queue_name, + 'args' => [ job.serialize ], + 'at' => timestamp + end + + end +end
Patch Sidekiq adapter to Rails 5 behavior
diff --git a/config/initializers/rack_cors.rb b/config/initializers/rack_cors.rb index abc1234..def5678 100644 --- a/config/initializers/rack_cors.rb +++ b/config/initializers/rack_cors.rb @@ -1,8 +1,8 @@ if defined? Rack::Cors Rails.configuration.middleware.insert_before 0, Rack::Cors do allow do - origins Rails.application.secrets.host - resource '/assets/*' + origins "*" + resource "/assets/*" end end -end+end
Allow asset CORS from all origins.
diff --git a/lib/puppet-syntax.rb b/lib/puppet-syntax.rb index abc1234..def5678 100644 --- a/lib/puppet-syntax.rb +++ b/lib/puppet-syntax.rb @@ -8,9 +8,9 @@ @exclude_paths = [] @future_parser = false @hieradata_paths = [ - "**/data/**/*.*yaml", - "hieradata/**/*.*yaml", - "hiera*.*yaml" + "**/data/**/*.*{yaml,yml}", + "hieradata/**/*.*{yaml,yml}", + "hiera*.*{yaml,yml}" ] @fail_on_deprecation_notices = true @app_management = Puppet.version.to_i >= 5 ? true : false
Allow .yml as an extension for YAML files. Without this patch, only files ending in .yaml will be checked. This allows files to also end with .yml.
diff --git a/lib/tasks/users.rake b/lib/tasks/users.rake index abc1234..def5678 100644 --- a/lib/tasks/users.rake +++ b/lib/tasks/users.rake @@ -0,0 +1,23 @@+# frozen_string_literal: true + +namespace :users do + desc 'Renames users with email-like usernames' + task remove_email_like_usernames: :environment do + target = User.where("username REGEXP '[^@]+@[^@]+'") + + STDOUT.print "About to rename #{target.size} users. Continue? (y/n)" + abort unless STDIN.gets.chomp == 'y' + + target.find_each do |user| + sanitized_username = user.username.gsub(/@.*/, '') + + new_username = if User.exists?(username: sanitized_username) + sanitized_username + '0' + else + sanitized_username + end + + user.update!(username: new_username) + end + end +end
Add a task to change email-like usernames
diff --git a/lib/yomou/atomapi.rb b/lib/yomou/atomapi.rb index abc1234..def5678 100644 --- a/lib/yomou/atomapi.rb +++ b/lib/yomou/atomapi.rb @@ -1,3 +1,5 @@+require "feedjira" + module Yomou module Atomapi @@ -5,10 +7,33 @@ desc "allnovel", "" def allnovel + url = "http://api.syosetu.com/allnovel.Atom" + feed = Feedjira::Feed.fetch_and_parse(url) + feed.entries.each_with_index do |entry, index| + ncode = extract_ncode(entry.entry_id) + printf("%4d %s: %s\n", index+1, ncode, entry.title) + end end desc "user USER_ID", "" def user(user_id) + url = "http://api.syosetu.com/writernovel/#{user_id}.Atom" + feed = Feedjira::Feed.fetch_and_parse(url) + feed.entries.each_with_index do |entry, index| + ncode = extract_ncode(entry.links[0]) + printf("%4d %s: %s\n", index+1, ncode, entry.title) + end + end + + private + + def extract_ncode(item) + if item =~ /.+\/(n\w+)\/\d+\// + ncode = $1.upcase + elsif item =~ /.+\/(n\w+)\// + ncode = $1.upcase + end + ncode end end
Support to show Atom feed
diff --git a/lib/calculatorapp.rb b/lib/calculatorapp.rb index abc1234..def5678 100644 --- a/lib/calculatorapp.rb +++ b/lib/calculatorapp.rb @@ -43,7 +43,7 @@ if fields.include?(:jsonp_callback) && !fields[:jsonp_callback].empty? content_type :js - return "#{request.GET['jsonp_callback']}(#{response.to_json})" + next "#{request.GET['jsonp_callback']}(#{response.to_json})" end content_type :json
Use next instead of return
diff --git a/lib/dirty_history.rb b/lib/dirty_history.rb index abc1234..def5678 100644 --- a/lib/dirty_history.rb +++ b/lib/dirty_history.rb @@ -6,5 +6,7 @@ autoload :DirtyHistoryRecord, "dirty_history/dirty_history_record" require "dirty_history/dirty_history_mixin" +ActiveRecord::Base.send :include, DirtyHistory::Mixin + $LOAD_PATH.shift
Include into AR outside of mixin file so it can be tested
diff --git a/lib/frecon/server.rb b/lib/frecon/server.rb index abc1234..def5678 100644 --- a/lib/frecon/server.rb +++ b/lib/frecon/server.rb @@ -27,6 +27,9 @@ protected + def self.setup!(server: %w[thin HTTP webrick], host: "localhost", port: 4567, environment: FReCon.environment) + end + def self.run! set :environment, FReCon.environment Database.setup(FReCon.environment)
Create an empty Server.setup! method. This method will hold the business logic for bootstrapping within Sinatra.
diff --git a/lib/gemini/orders.rb b/lib/gemini/orders.rb index abc1234..def5678 100644 --- a/lib/gemini/orders.rb +++ b/lib/gemini/orders.rb @@ -8,7 +8,7 @@ def self.cancel(options = {}) Gemini.sanity_check! - Gemini::Net.post("/v1/me/cancelchildorder", options) + Gemini::Net.post("/v1/me/order/cancel", options) end end end
Correct URL for cancelling order
diff --git a/config/schedule.rb b/config/schedule.rb index abc1234..def5678 100644 --- a/config/schedule.rb +++ b/config/schedule.rb @@ -25,7 +25,7 @@ # Remove old sessions from database every 1.day, :at => '4:42 am' do - rake "housekeeping:session_cleanup", :environment => [:production, :staging] + rake "housekeeping:session_cleanup", :environment => :production end every 1.hour do
Fix environment in cron tab.
diff --git a/auth-key.rb b/auth-key.rb index abc1234..def5678 100644 --- a/auth-key.rb +++ b/auth-key.rb @@ -0,0 +1,12 @@+#This uses the Github API wrapped in the github_api gem. +#Authentication data has been figured out and is the basic stuff below. +#For more info and documentation, check out: +#http://developer.github.com/v3/ +#https://github.com/peter-murach/github + +require 'github_api' + +github = Github.new do |config| + config.oauth_token = 'a2ee8af1802be1417e4fcc79595fbcc16f67959c' + config.ssl = {:verify => false} +end
Add basic authentication information in order to be able to interact with the Github API
diff --git a/lib/childprocess/unix/process.rb b/lib/childprocess/unix/process.rb index abc1234..def5678 100644 --- a/lib/childprocess/unix/process.rb +++ b/lib/childprocess/unix/process.rb @@ -71,7 +71,7 @@ exec(*@args) } - Process.detach(@pid) if @detach + ::Process.detach(@pid) if @detach end end # Process
Call the right Process class.
diff --git a/lib/craigslister/craigslister.rb b/lib/craigslister/craigslister.rb index abc1234..def5678 100644 --- a/lib/craigslister/craigslister.rb +++ b/lib/craigslister/craigslister.rb @@ -15,11 +15,7 @@ end def scrape - scraper.scrape - end - - def links - scraper.links + Scraper.new(url, base_url).scrape end def url @@ -29,10 +25,6 @@ end private - - def scraper - Scraper.new(url, base_url) - end def base_url "https://#{area}.craigslist.org"
Remove uneeded links method from Craigslister
diff --git a/semantology.gemspec b/semantology.gemspec index abc1234..def5678 100644 --- a/semantology.gemspec +++ b/semantology.gemspec @@ -15,6 +15,8 @@ s.required_ruby_version = '>= 2.2.0' s.add_runtime_dependency 'nokogiri', ['~> 1.6'] + s.add_runtime_dependency 'rdf', ['~> 1.1'] + s.add_runtime_dependency 'linkeddata', ['~> 1.1'] s.add_development_dependency 'bundler', ['~> 1.6'] s.add_development_dependency 'rake', ['~> 10.3']
Add "rdf" and "linkeddata" as dependencies
diff --git a/spec/integration/chainable_validator_spec.rb b/spec/integration/chainable_validator_spec.rb index abc1234..def5678 100644 --- a/spec/integration/chainable_validator_spec.rb +++ b/spec/integration/chainable_validator_spec.rb @@ -31,23 +31,23 @@ end it 'works' do - expect { rom.command(:users).create.call(name: 'John', email: 'john@doe.org') } - .to change(rom.relation(:users), :count).by 1 + expect { rom.commands[:users].create.call(name: 'John', email: 'john@doe.org') } + .to change(rom.relations[:users], :count).by 1 end it 'runs validations' do - validated_command = (user_validator >> rom.command(:users).create) + validated_command = (user_validator >> rom.commands[:users].create) expect { validated_command.call({}) }.to raise_error(ROM::Model::ValidationError) end it 'calls the nested command when validations pass' do - validated_command = (user_validator >> rom.command(:users).create) + validated_command = (user_validator >> rom.commands[:users].create) attributes = user_attrs.new(name: 'John', email: 'john@doe.org') expect { validated_command.call(attributes) - }.to change(rom.relation(:users), :count).by 1 + }.to change(rom.relations[:users], :count).by 1 end end
Replace command references to account for deprecation warnings
diff --git a/spec/mailers/feedback_request_mailer_spec.rb b/spec/mailers/feedback_request_mailer_spec.rb index abc1234..def5678 100644 --- a/spec/mailers/feedback_request_mailer_spec.rb +++ b/spec/mailers/feedback_request_mailer_spec.rb @@ -13,5 +13,6 @@ FeedbackRequestMailer.request_feedback(session, member, feedback_request).deliver expect(email.subject).to eq(email_subject) + expect(email.parts.first.body.raw_source).to include feedback_url(feedback_request.token) end end
Improve Feedback request mailer spec
diff --git a/spec/models/species/documents_export_spec.rb b/spec/models/species/documents_export_spec.rb index abc1234..def5678 100644 --- a/spec/models/species/documents_export_spec.rb +++ b/spec/models/species/documents_export_spec.rb @@ -39,6 +39,7 @@ specify "when file not cached it should be generated" do subject.export File.file?(subject.file_name).should be_true + File.size(subject.file_name).should be > 0 end specify "when file cached it should not be generated" do FileUtils.touch(subject.file_name)
Test to make sure the generated file is not empty
diff --git a/spec/nymphia/dsl/context/use_gateway_spec.rb b/spec/nymphia/dsl/context/use_gateway_spec.rb index abc1234..def5678 100644 --- a/spec/nymphia/dsl/context/use_gateway_spec.rb +++ b/spec/nymphia/dsl/context/use_gateway_spec.rb @@ -0,0 +1,12 @@+require 'spec_helper' + +describe Nymphia::DSL::Context::UseGateway do + subject(:use_gateway) { Nymphia::DSL::Context::UseGateway.new('context', 'name') } + + describe '.new' do + it 'has @context and @result' do + expect(use_gateway.instance_variable_get(:@context)).to eq 'context' + expect(use_gateway.instance_variable_get(:@result)).to eq 'name' + end + end +end
Create a spec for Nymphia::DSL::Context::UseGateway
diff --git a/RZPoseurWebView.podspec b/RZPoseurWebView.podspec index abc1234..def5678 100644 --- a/RZPoseurWebView.podspec +++ b/RZPoseurWebView.podspec @@ -8,7 +8,7 @@ Features: * Delegate-compatible replacement for UIWebView that's backed by WKWebView. - * If WKWebView is not available, RZPoseurWebView falls back on UIWebView. + * If WKWebView is not available, RZPoseurWebView falls back on UIWebView. DESC s.homepage = "https://github.com/Raizlabs/RZPoseurWebView"
Correct tabs to spaces in podspec.
diff --git a/spec/percona/quickbackup_spec.rb b/spec/percona/quickbackup_spec.rb index abc1234..def5678 100644 --- a/spec/percona/quickbackup_spec.rb +++ b/spec/percona/quickbackup_spec.rb @@ -0,0 +1,7 @@+require 'spec_helper' + +# Check to see if QuickBackup works +# see http://wiki.joyent.com/jpc2/Joyent+Quickbackup+for+Percona+MySQL+Server +describe command("quickbackup-percona backup") do + it { should return_exit_status 0 } +end
Test to see if QuickBackup works
diff --git a/lib/smbglobal-sms.rb b/lib/smbglobal-sms.rb index abc1234..def5678 100644 --- a/lib/smbglobal-sms.rb +++ b/lib/smbglobal-sms.rb @@ -1,8 +1,7 @@ require "smbglobal_sms/version" require "smbglobal_sms/config" - -autoload :Request, 'smbglobal_sms/request' -autoload :Response, 'smbglobal_sms/response' +require "smbglobal_sms/request" +require "smbglobal_sms/response" SmbglobalSms.configure do |config| config.host_name = "http://api.smbglobal.net"
Remove autoload and require directly
diff --git a/lib/xmlrpc_server.rb b/lib/xmlrpc_server.rb index abc1234..def5678 100644 --- a/lib/xmlrpc_server.rb +++ b/lib/xmlrpc_server.rb @@ -0,0 +1,14 @@+require 'xmlrpc/server' +require 'pp' + +server = XMLRPC::Server.new(8080) + +server.add_handler('postTopic') do |options| + puts '-' * 50 + puts 'postTopic received with the following options:' + pp options + + { 'result' => 'success', 'topic_id' => '12345' } +end + +server.serve
Add a simple script that can be used as an XMLRPC server for testing
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 @@ -23,4 +23,11 @@ class ActionDispatch::IntegrationTest # Make the Capybara DSL available in all integration tests include Capybara::DSL -end+end + +class ActionController::TestCase + include Devise::TestHelpers + def set_project(project) + session[:current_project_id] = project.id + end +end
Test helper to set a project
diff --git a/test/test_helper.rb b/test/test_helper.rb index abc1234..def5678 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,8 +1,4 @@ require 'bundler' -Bundler.require - -$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) - +Bundler.require :development, :test require 'secondbase' - require 'minitest/autorun'
Use bundler to load things for test helper.
diff --git a/lib/sisimai/reason/systemfull.rb b/lib/sisimai/reason/systemfull.rb index abc1234..def5678 100644 --- a/lib/sisimai/reason/systemfull.rb +++ b/lib/sisimai/reason/systemfull.rb @@ -27,7 +27,14 @@ return false end - def true; return nil; end + # The bounce reason is system full or not + # @param [Sisimai::Data] argvs Object to be detected the reason + # @return [True,False] true: is system full + # false: is not system full + # @see http://www.ietf.org/rfc/rfc2822.txt + def true(_argvs) + return nil + end end end
Add method comment to true() method
diff --git a/lib/vagrant-rsync-back/plugin.rb b/lib/vagrant-rsync-back/plugin.rb index abc1234..def5678 100644 --- a/lib/vagrant-rsync-back/plugin.rb +++ b/lib/vagrant-rsync-back/plugin.rb @@ -24,7 +24,7 @@ I18n.reload! end - command "rsync-back" do + command("rsync-back", primary: false) do setup_i18n require_relative "command/rsync_back"
Make this a non-primary command. This mirrors the other rsync commands.
diff --git a/lib/vault-tools/core_db_tasks.rb b/lib/vault-tools/core_db_tasks.rb index abc1234..def5678 100644 --- a/lib/vault-tools/core_db_tasks.rb +++ b/lib/vault-tools/core_db_tasks.rb @@ -7,6 +7,7 @@ desc "Pull db/structure.sql from api HEAD" task :pull_core do steps = [] + steps << 'mkdir -p contrib/' steps << 'cd contrib/' if File.exists?('contrib/core') steps << 'rm -rf core'
Create contrib dir if does not exist.
diff --git a/cookbooks/kernel/kernel-4.1.1.rb b/cookbooks/kernel/kernel-4.1.1.rb index abc1234..def5678 100644 --- a/cookbooks/kernel/kernel-4.1.1.rb +++ b/cookbooks/kernel/kernel-4.1.1.rb @@ -17,7 +17,7 @@ end execute "setup building kernel" do - command "chown -R #{node["rbenv"]["user"]}.#{node["rbenv"]["user"]} #{build_dir}" + command "chown -R #{node["rbenv"]["user"]}.#{node["rbenv"]["user"]} #{build_dir} /home/#{node["rbenv"]["user"]}/rpmbuild" end execute "build kernel" do
Change owner of persistent storage dir
diff --git a/lita-youtube.gemspec b/lita-youtube.gemspec index abc1234..def5678 100644 --- a/lita-youtube.gemspec +++ b/lita-youtube.gemspec @@ -1,12 +1,13 @@ Gem::Specification.new do |spec| spec.name = "lita-youtube" - spec.version = "0.0.2" + spec.version = "0.0.3" spec.authors = ["Jimmy Cuadra"] spec.email = ["jimmy@jimmycuadra.com"] spec.description = %q{A Lita handler for displaying YouTube video information.} spec.summary = %q{A Lita handler for displaying YouTube video information.} spec.homepage = "https://github.com/jimmycuadra/lita-youtube" spec.license = "MIT" + spec.metadata = { "lita_plugin_type" => "handler" } spec.files = `git ls-files`.split($/) spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
Add plugin type metadata and bump version to 0.0.3.
diff --git a/lib/imdb/season.rb b/lib/imdb/season.rb index abc1234..def5678 100644 --- a/lib/imdb/season.rb +++ b/lib/imdb/season.rb @@ -9,7 +9,8 @@ end def episode(number) - episodes.fetch(number-1, nil) + i = episodes.index{|ep| ep.episode == number} + (i.nil? ? nil : episodes[i]) end def episodes
Fix the .episode() method too.
diff --git a/lib/lexhub/base.rb b/lib/lexhub/base.rb index abc1234..def5678 100644 --- a/lib/lexhub/base.rb +++ b/lib/lexhub/base.rb @@ -1,11 +1,11 @@ module Lexhub class Base private - def _collect(collection_method, api_method) + def _collect(collection_item, api_method) results = [] response(api_method).each_page do |page| - results += page.collect(&collection_method) + results += page.collect(&collection_item) end results
Fix code with new arg names
diff --git a/lib/models/show.rb b/lib/models/show.rb index abc1234..def5678 100644 --- a/lib/models/show.rb +++ b/lib/models/show.rb @@ -1,8 +1,23 @@-# A class to hold the data for a Show, woah - +# The Show class holds data for a specific show. In addition to being a data +# container, it also provides for matching a search term. The following +# (read-only) attributes are available: +# +# title: (string) The show's title +# url: (string) The URL slug of the show +# rss: (string) The RSS feed URL of the show +# aliases: (array[string]) An array of aliases that can additionally match +# the show class Show attr_reader :title, :url, :rss, :aliases + # param json_hash: (hash) A hash of show data with the following keys: + # title: (string) The show's title + # url: (string) The URL slug of the show + # rss: (string) The RSS feed URL of the show + # aliases: (array[string]) [Optional] An array of aliases + # NOTE: json_hash is just a hash, and doesn't need anything to do with JSON + # + # The aliases will all be downcased before being stored internally def initialize(json_hash) @title = json_hash["title"] @url = json_hash["url"] @@ -12,6 +27,11 @@ end end + # Tests if a search term matches this show, against a variety of checks. + # param search_term: (string) The term to search against + # returns: (boolean) True if matched, false otherwise + # The search term is compared case-insensitively against the various fields. + # It is tested against aliases, the URL slug, and then the show title. def matches?(search_term) search_term = search_term.downcase @@ -20,14 +40,17 @@ private + # Tests if search_term exactly matches the URL slug def matches_url?(search_term) url.downcase == search_term end + # Tests if the search term is contained in the show title def matches_title?(search_term) title.downcase.include? search_term end + # Tests if the search term exactly matches one of the aliases def matches_alias?(search_term) aliases.include? search_term end
Add documentation to the Show model.
diff --git a/lib/reuser/role.rb b/lib/reuser/role.rb index abc1234..def5678 100644 --- a/lib/reuser/role.rb +++ b/lib/reuser/role.rb @@ -1,5 +1,11 @@ module ReUser class Role + attr_reader :name + + def permissions + @permissions.keys + end + def initialize name, permissions=[] @name = name @permissions = {}
Revert "removed the accessors for ReUser::Role" This reverts commit 81c81ae7741e48cf4f49676dabc3d9e2175f2f62.
diff --git a/snogmetrics.gemspec b/snogmetrics.gemspec index abc1234..def5678 100644 --- a/snogmetrics.gemspec +++ b/snogmetrics.gemspec @@ -1,5 +1,9 @@ # -*- encoding: utf-8 -*- -require File.expand_path('../lib/snogmetrics', __FILE__) + +lib = File.expand_path('../lib', __FILE__) +$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) + +require 'snogmetrics' Gem::Specification.new do |s| s.name = 'snogmetrics' @@ -14,15 +18,15 @@ s.required_rubygems_version = '>= 1.3.6' s.rubyforge_project = 'snogmetrics' - s.add_development_dependency 'bundler', '~> 1.0.0' - s.add_development_dependency 'rake', '~> 0.8.7' + s.add_development_dependency 'bundler' + s.add_development_dependency 'rake' s.add_development_dependency 'yard' s.add_development_dependency 'BlueCloth' - s.add_development_dependency 'rails' + s.add_development_dependency 'rails', '~> 4.2' s.add_development_dependency 'rspec' - s.add_development_dependency 'rcov' + s.add_development_dependency 'rubocop' s.files = `git ls-files`.split("\n") - s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact + s.executables = `git ls-files`.split("\n").map { |f| f =~ /^bin\/(.*)/ ? Regexp.last_match(1) : nil }.compact s.require_path = 'lib' end
Update development dependencies and load entire lib file Changes: - Remove version requirements for old versions of bundler and rake - Target Rails 4.2 (for now) - Remove rcov because of build error (see https://github.com/relevance/rcov/issues/99)
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 @@ -6,7 +6,10 @@ coveralls }.each { |f| require f } -SimpleCov.formatters << SimpleCov::Formatter::HTMLFormatter +SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ + SimpleCov::Formatter::HTMLFormatter, + Coveralls::SimpleCov::Formatter +] SimpleCov.start %w{
[SPEC] Fix code coverage reporting: Re-enable Coveralls
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 @@ -33,3 +33,13 @@ end Dir[Pathname(__FILE__).dirname.join('shared/*.rb').to_s].each { |f| puts f; require f } + +RSpec.configure do |config| + config.before do + @constants = Object.constants + end + + config.after do + (Object.constants - @constants).each { |name| Object.send(:remove_const, name) } + end +end
Automate const removal in specs
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 @@ -17,6 +17,10 @@ exit end +Rails.application.configure do + config.assets.precompile += %w(logo/spree_50.png favicon.ico) +end + require 'rspec/rails' require 'ffaker'
Fix issues with running tests locally Because spree_social is an engine, before you run tests, you need to run `rake test_app`. This will generate a dummy Rails app located in `spec/dummy` that is used to initialize the engine. The problem is, this app doesn't seem to be complete: when running the feature tests, I was getting errors indicating that `logo/spree_50.png` and `favicon.ico` were outside of the bundle and needed to be included. I'm not sure if this is fixed in later versions of Spree, but to ensure this doesn't happen again, I've modified spec_helper.rb to add them to `Rails.application.configuration.assets.precompile`.
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,6 +10,7 @@ Dir[File.join(File.dirname(__FILE__), "support/**/*.rb")].each {|f| require f } TestApplication::Application.initialize! +NetSuiteRails::PollTimestamp.delete_all RSpec.configure do |config| config.color = true
Clear out all timestamps before running tests
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -7,6 +7,4 @@ Bundler.require :default, :test -require 'pry' - RSpec.configure(&:raise_errors_for_deprecations!)
Remove pry require from spec helper.
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 @@ -1,9 +1,5 @@-# This file was generated by the `rspec --init` command. Conventionally, all -# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. -# Require this file using `require "spec_helper"` to ensure that it is only -# loaded once. -# -# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration +$LOAD_PATH << File.join(File.dirname(__FILE__), '../lib') + RSpec.configure do |config| config.treat_symbols_as_metadata_keys_with_true_values = true config.run_all_when_everything_filtered = true
Add lib to spec load path
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 @@ -2,16 +2,16 @@ require 'rubygems' +$:.unshift File.expand_path('../../lib', __FILE__) + require 'tokyocabinet' require 'active_record' - -$:.unshift File.expand_path('../../lib', __FILE__) - -require 'myaso' if RUBY_VERSION == '1.8' gem 'minitest' end + +require 'minitest/autorun' require 'fileutils' require 'tmpdir' @@ -23,6 +23,6 @@ end end -require 'minitest/autorun' +require 'myaso' Dir[File.expand_path('../support/**/*.rb', __FILE__)].each { |f| require f }
Change the approach of Myaso loading because of SimpleCov nuances [ci skip]
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 @@ -2,6 +2,7 @@ require 'chefspec/berkshelf' RSpec.configure do |config| - config.color = true - config.log_level = :error + config.color = true # Use color in STDOUT + config.formatter = :documentation # Use the specified formatter + config.log_level = :error # Avoid deprecation notice SPAM end
Use our standard spec helper Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
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 @@ -15,9 +15,19 @@ match do |markdown| @expected = html.strip - parser = Redcarpet::Markdown.new(described_class) + instance = Middleman::HashiCorp::RedcarpetHTML.new + instance.middleman_app = middleman_app + + parser = Redcarpet::Markdown.new(instance) @actual = parser.render(markdown).strip @expected == @actual end end + +# The default middleman application server. +# +# @return [Middleman::Application] +def middleman_app + @app ||= Middleman::Application.server.inst +end
Use a default middleman application
diff --git a/refinerycms-retailers.gemspec b/refinerycms-retailers.gemspec index abc1234..def5678 100644 --- a/refinerycms-retailers.gemspec +++ b/refinerycms-retailers.gemspec @@ -15,9 +15,10 @@ s.files = Dir["{app,config,db,lib}/**/*"] + ["readme.md"] # Runtime dependencies - s.add_dependency 'refinerycms-core', '~> 3.0.0' - s.add_dependency 'acts_as_indexed', '~> 0.8.0' - s.add_dependency 'carmen-rails', '~> 1.0.1' + s.add_dependency 'refinerycms-core', '~> 3.0.0' + s.add_dependency 'acts_as_indexed', '~> 0.8.0' + s.add_dependency 'carmen-rails', '~> 1.0.1' + s.add_dependency 'actionview-encoded_mail_to', '~> 1.0.5' # Development dependencies (usually used for testing) s.add_development_dependency 'refinerycms-testing', '~> 3.0.0'
Add actionview-encoded_mail_to dependency for email :encode option drop from Rails 4.0+
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"] || "abcdefghjasndjkasndassetmanager" + config.oauth_secret = ENV["OAUTH_SECRET"] || "secret" config.oauth_root_url = Plek.current.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/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb index abc1234..def5678 100644 --- a/config/initializers/sidekiq.rb +++ b/config/initializers/sidekiq.rb @@ -9,7 +9,7 @@ Sidekiq.configure_server do |config| config.redis = redis_params - config.average_scheduled_poll_interval = 5 + config.average_scheduled_poll_interval = 1 end Sidekiq.configure_client do |config|
Change polling interval 5sec -> 1sec
diff --git a/config/deploy/production.rb b/config/deploy/production.rb index abc1234..def5678 100644 --- a/config/deploy/production.rb +++ b/config/deploy/production.rb @@ -5,5 +5,5 @@ server 'osirixnodes.com', user: 'deploy', roles: %w{web app db}, primary: true set :deploy_to, "/home/#{fetch(:deploy_user)}/apps/#{fetch(:full_app_name)}" set :rails_env, :production -set :unicorn_worker_count, 5 +set :unicorn_worker_count, 4 set :enable_ssl, true
Decrease Unicorn workers from 5 to 4 ...because we got some out of memory errors in production: E, [2014-12-23T07:41:25.036177 #28797] ERROR -- : Cannot allocate memory - fork(2) (Errno::ENOMEM)
diff --git a/drug-bot/lib/drug-bot/helpers.rb b/drug-bot/lib/drug-bot/helpers.rb index abc1234..def5678 100644 --- a/drug-bot/lib/drug-bot/helpers.rb +++ b/drug-bot/lib/drug-bot/helpers.rb @@ -13,9 +13,7 @@ end def on_join?(connection, message) - puts message[:command] == :JOIN - puts message[:command] - message[:command] == :join && message[:nick] == connection.connection.options[:nick] + message[:command] == :join && message[:nick] == connection.nick end def create_database(file, container, variable)
Remove puts. Use new .nick accessor
diff --git a/app/controllers/players/registrations_controller.rb b/app/controllers/players/registrations_controller.rb index abc1234..def5678 100644 --- a/app/controllers/players/registrations_controller.rb +++ b/app/controllers/players/registrations_controller.rb @@ -45,4 +45,9 @@ devise_parameter_sanitizer.for(:sign_up) << :name devise_parameter_sanitizer.sanitize(:sign_up) end + + def account_update_params + devise_parameter_sanitizer.for(:account_update) << :name + devise_parameter_sanitizer.sanitize(:account_update) + end end
Allow to update player's name.
diff --git a/spec/dummy/app/controllers/entries_controller.rb b/spec/dummy/app/controllers/entries_controller.rb index abc1234..def5678 100644 --- a/spec/dummy/app/controllers/entries_controller.rb +++ b/spec/dummy/app/controllers/entries_controller.rb @@ -17,7 +17,7 @@ end def create - @entry = Entry.create(params[:entry]) + @entry = Entry.create(params[:entry].permit(:title, :body)) redirect_to @entry end @@ -27,7 +27,7 @@ def update @entry = Entry.find(params[:id]) - @entry.update_attributes(params[:entry]) + @entry.update_attributes(params[:entry].permit(:title, :body)) redirect_to @entry end end
Fix ActiveModel::ForbiddenAttributesError in dummy app
diff --git a/govuk-client-url_arbiter.gemspec b/govuk-client-url_arbiter.gemspec index abc1234..def5678 100644 --- a/govuk-client-url_arbiter.gemspec +++ b/govuk-client-url_arbiter.gemspec @@ -8,9 +8,8 @@ spec.version = Govuk::Client::UrlArbiter::VERSION spec.authors = ["Alex Tomlins"] spec.email = ["alex.tomlins@digital.cabinet-office.gov.uk"] - spec.summary = %q{TODO: Write a short summary. Required.} - spec.description = %q{TODO: Write a longer description. Optional.} - spec.homepage = "" + spec.summary = %q{API client for the url-arbiter} + spec.homepage = "https://github.com/alphagov/govuk-client-url_arbiter" spec.license = "MIT" spec.files = `git ls-files -z`.split("\x0")
Update summary and homepage in gemspec
diff --git a/robot-name/robot_name_test.rb b/robot-name/robot_name_test.rb index abc1234..def5678 100644 --- a/robot-name/robot_name_test.rb +++ b/robot-name/robot_name_test.rb @@ -29,6 +29,7 @@ robot.reset name2 = robot.name assert name != name2 + assert_equal name2, robot.name, "Command/Query Separation: query methods should generally not change object state" # rubocop:disable Lint/AmbiguousRegexpLiteral assert_match /^[A-Z]{2}\d{3}$/, name2 # rubocop:enable Lint/AmbiguousRegexpLiteral
Fix test suite for robot-name excercise