diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/app/controllers/students_controller.rb b/app/controllers/students_controller.rb index abc1234..def5678 100644 --- a/app/controllers/students_controller.rb +++ b/app/controllers/students_controller.rb @@ -15,7 +15,7 @@ end @intervention = Intervention.new - @interventions = @student.interventions + @interventions = @student.interventions.order(start_date: :desc) @roster_url = homeroom_path(@student.homeroom) @csv_url = student_path(@student) + ".csv"
Order interventions list by start date + Resolves #304
diff --git a/app/controllers/v1/clubs_controller.rb b/app/controllers/v1/clubs_controller.rb index abc1234..def5678 100644 --- a/app/controllers/v1/clubs_controller.rb +++ b/app/controllers/v1/clubs_controller.rb @@ -1,57 +1,59 @@-class V1::ClubsController < ApplicationController - before_action :find_club, only: [:show, :update, :destroy] +module V1 + class ClubsController < ApplicationController + before_action :find_club, only: [:show, :update, :destroy] - def index - render json: Club.all - end + def index + render json: Club.all + end - def create - club = Club.new(club_params) + def create + club = Club.new(club_params) - if club.save - render json: club, status: 201 - else - render json: { errors: club.errors }, status: 422 + if club.save + render json: club, status: 201 + else + render json: { errors: club.errors }, status: 422 + end + end + + def show + if @club.nil? + render(json: { error: 'Club not found' }, status: 404) && return + end + + render json: @club + end + + def update + if @club.nil? + render(json: { error: 'Club not found' }, status: 404) && return + end + + if @club.update_attributes(club_params) + render json: @club, status: 200 + else + render json: { errors: @club.errors }, status: 422 + end + end + + def destroy + if @club + @club.destroy + + render json: { status: 'success' }, status: 200 + else + render json: { error: 'Club not found' }, status: 404 + end + end + + protected + + def club_params + params.permit(:name, :address, :source, :notes) + end + + def find_club + @club = Club.find_by(id: params[:id]) end end - - def show - if @club.nil? - render(json: { error: 'Club not found' }, status: 404) && return - end - - render json: @club - end - - def update - if @club.nil? - render(json: { error: 'Club not found' }, status: 404) && return - end - - if @club.update_attributes(club_params) - render json: @club, status: 200 - else - render json: { errors: @club.errors }, status: 422 - end - end - - def destroy - if @club - @club.destroy - - render json: { status: 'success' }, status: 200 - else - render json: { error: 'Club not found' }, status: 404 - end - end - - protected - - def club_params - params.permit(:name, :address, :source, :notes) - end - - def find_club - @club = Club.find_by(id: params[:id]) - end end
Improve module syntax in V1::ClubsController
diff --git a/app/representers/answer_representer.rb b/app/representers/answer_representer.rb index abc1234..def5678 100644 --- a/app/representers/answer_representer.rb +++ b/app/representers/answer_representer.rb @@ -11,4 +11,5 @@ property :user_id property :answer_text property :details_text + property :matrix_answer end
Add matrix_answer property to answer object
diff --git a/04_encrypted_rooms.rb b/04_encrypted_rooms.rb index abc1234..def5678 100644 --- a/04_encrypted_rooms.rb +++ b/04_encrypted_rooms.rb @@ -0,0 +1,20 @@+ROOM = %r{^(?<name>[-a-z]+)(?<sector>\d+)\[(?<sum>[a-z]{5})\]$} + +input = ARGF.each_line.map { |l| ROOM.match(l) } + +real = input.select { |i| + freq = i[:name].each_char.tally + freq.delete(?-) + freq.sort_by { |a, b| [-b, a] }.map(&:first).take(5).join == i[:sum] +} + +puts real.sum { |i| Integer(i[:sector]) } + +alpha = 'abcdefghijklmnopqrstuvwxyz'.freeze + +names = real.map { |r| + shift = Integer(r[:sector]) % 26 + r[:name].tr(alpha, alpha.chars.rotate(shift).join) + r[:sector] +} + +puts names.grep(/north/)
Add day 04: Encrypted Rooms
diff --git a/app/controllers/api/decks_controller.rb b/app/controllers/api/decks_controller.rb index abc1234..def5678 100644 --- a/app/controllers/api/decks_controller.rb +++ b/app/controllers/api/decks_controller.rb @@ -13,7 +13,11 @@ return super unless media_types_for('Accept').include? MEDIA_TYPE deck = Deck.find params[:id] - raise Pundit::NotAuthorizedError unless DeckPolicy.new(current_user, deck).show? + + # Authorize show + scope = DeckPolicy::Scope.new(current_user, Deck).resolve + raise Pundit::NotAuthorizedError unless scope.where(:id => deck.id).exists? + context[:policy_used]&.call render :body => deck.content, :content_type => 'text/html' end @@ -22,7 +26,10 @@ return super unless request.content_type == MEDIA_TYPE deck = Deck.find params[:id] + + # Authorize update raise Pundit::NotAuthorizedError unless DeckPolicy.new(current_user, deck).update? + context[:policy_used]&.call deck.content = Nokogiri::HTML5.fragment(request.body.read).to_html deck.author = current_user
Refactor DecksController authorization to use scope
diff --git a/app/controllers/factories_controller.rb b/app/controllers/factories_controller.rb index abc1234..def5678 100644 --- a/app/controllers/factories_controller.rb +++ b/app/controllers/factories_controller.rb @@ -18,7 +18,8 @@ tables = ActiveRecord::Base.connection.tables tables.delete 'schema_migrations' tables.each do |table| - ActiveRecord::Base.connection.execute("TRUNCATE #{table} CASCADE") + table_name = ActionController::Base.helpers.sanitize(table) + ActiveRecord::Base.connection.execute("TRUNCATE #{table_name} CASCADE") end render json: {}, status: 204 else
Fix potential sql injection warning
diff --git a/app/jobs/scheduled/poll_feed.rb b/app/jobs/scheduled/poll_feed.rb index abc1234..def5678 100644 --- a/app/jobs/scheduled/poll_feed.rb +++ b/app/jobs/scheduled/poll_feed.rb @@ -32,8 +32,10 @@ url = i.link url = i.id if url.blank? || url !~ /^https?\:\/\// - content = CGI.unescapeHTML(i.content.scrub) - TopicEmbed.import(user, url, i.title, content) + content = i.content || i.description + if content + TopicEmbed.import(user, url, i.title, CGI.unescapeHTML(content.scrub)) + end end end
FIX: Support feeds with `description` as well as `content`
diff --git a/app/presenters/field/embed_presenter.rb b/app/presenters/field/embed_presenter.rb index abc1234..def5678 100644 --- a/app/presenters/field/embed_presenter.rb +++ b/app/presenters/field/embed_presenter.rb @@ -2,7 +2,7 @@ COMPACT_WIDTH = 300 COMPACT_HEIGHT = 150 - def input(form, method, options = {}) + def input(form, method, options={}) if field.iframe? form.text_area(method, input_defaults(options)) elsif field.url? @@ -11,10 +11,12 @@ end def value + return nil if raw_value.blank? + if field.iframe? raw_value&.html_safe compact? ? raw_value&.gsub(/width=["']\d+["']/, "width=\"#{COMPACT_WIDTH}\"")&.gsub(/height=["']\d+["']/, "height=\"#{COMPACT_HEIGHT}\"")&.html_safe : raw_value&.html_safe - elsif field.url? && raw_value + elsif field.url? "<iframe width='#{compact? ? COMPACT_WIDTH : field.iframe_width}' height='#{compact? ? COMPACT_HEIGHT : field.iframe_height}' style='border: none;' src='#{raw_value}'></iframe>".html_safe end end
Fix empty url embed field
diff --git a/job_status_generation.rb b/job_status_generation.rb index abc1234..def5678 100644 --- a/job_status_generation.rb +++ b/job_status_generation.rb @@ -8,7 +8,7 @@ rep << "In progress. Downloaded #{mb_downloaded.round(2)} MB, #{error_count.to_i} errors encountered." rep << "See the ArchiveBot dashboard for more information." elsif completed? - rep << "Archived to #{archive_url}." + rep << "WARC: #{archive_url}" if (t = ttl) rep << "Eligible for rearchival in #{formatted_ttl(t)}."
Remove period at end of URL given in !status. Some IRC clients interpret the period as part of the URL, which can cause retrieval errors.
diff --git a/app/models/blog.rb b/app/models/blog.rb index abc1234..def5678 100644 --- a/app/models/blog.rb +++ b/app/models/blog.rb @@ -24,7 +24,8 @@ def identity_file_by_name(name) result = nil name = name.downcase - Rails.logger.debug{"Blog.identity_file_by_name searching for: #{name}"} + name2 = name.gsub(" ", "_") + Rails.logger.debug{"Blog.identity_file_by_name searching for: #{name} or #{name2}"} self.blog_files.each do |blog_file| checkname = blog_file.identity_file.file_file_name.downcase i = checkname.rindex(".") @@ -32,7 +33,7 @@ checkname = checkname[0..i-1] end Rails.logger.debug{"Blog.identity_file_by_name comparing: #{checkname}"} - if checkname == name + if checkname == name || checkname == name2 result = blog_file.identity_file end end
Allow mediawiki image reference by upload page name
diff --git a/app/models/page.rb b/app/models/page.rb index abc1234..def5678 100644 --- a/app/models/page.rb +++ b/app/models/page.rb @@ -38,9 +38,9 @@ end def valid_parents - Page.all.to_a.delete_if { |page| - page == self || descendants.include?(page) - } + Page.all.select do |page| + page != self && !descendants.include?(page) + end end def depth
Rewrite valid_parents method a bit prettier
diff --git a/app/models/trip.rb b/app/models/trip.rb index abc1234..def5678 100644 --- a/app/models/trip.rb +++ b/app/models/trip.rb @@ -11,6 +11,6 @@ validates :event_id, :presence => true def due_date - Time.new(date.year, date.month, date.day, 0, 0, 0) + DateTime.new(date.year, date.month, date.day, 21, 0, 0).yesterday end end
Edit due_date to comply current specifications
diff --git a/lib/sandthorn_sequel_projection/projection.rb b/lib/sandthorn_sequel_projection/projection.rb index abc1234..def5678 100644 --- a/lib/sandthorn_sequel_projection/projection.rb +++ b/lib/sandthorn_sequel_projection/projection.rb @@ -6,7 +6,7 @@ def_delegator self, :identifier - attr_reader :db_connection, :event_handlers + attr_reader :db_connection, :event_handlers, :tracker def initialize(db_connection = nil) @db_connection = db_connection || SandthornSequelProjection.configuration.projections_driver @@ -20,7 +20,7 @@ def update! tracker.process_events do |batch| - handlers.handle(batch) + event_handlers.handle(self, batch) end end
Add tracker accessor and use correct var name for event_handlers
diff --git a/lib/sidekiq_unique_jobs/lock/until_timeout.rb b/lib/sidekiq_unique_jobs/lock/until_timeout.rb index abc1234..def5678 100644 --- a/lib/sidekiq_unique_jobs/lock/until_timeout.rb +++ b/lib/sidekiq_unique_jobs/lock/until_timeout.rb @@ -2,8 +2,11 @@ module Lock class UntilTimeout < UntilExecuted def unlock(scope) - return true if scope.to_sym == :server - fail ArgumentError, "#{scope} middleware can't #{__method__} #{unique_key}" + if scope.to_sym == :server + return true + else + fail ArgumentError, "#{scope} middleware can't #{__method__} #{unique_key}" + end end def execute(_callback)
Reduce number of created strings
diff --git a/test/models/user_test.rb b/test/models/user_test.rb index abc1234..def5678 100644 --- a/test/models/user_test.rb +++ b/test/models/user_test.rb @@ -28,4 +28,20 @@ @user.email = "a" * 244 + "@example.com" assert_not @user.valid? end + + test 'email validation should accept valid email addresses' do + valid_addresses = %w[user@example.com USER@foo.COM A_US-ER@foo.bar.org first.last@foo.jp alice+bob@baz.cn] + valid_addresses.each do |address| + @user.email = address + assert @user.valid?, "#{address.inspect} should be valid" + end + end + + test 'email validation should reject invalid email addresses' do + invalid_addresses = %w[blahblah user@example,com user_at_foo.org user.name@example. foo@bar_baz.com foo@bar+baz.com] + invalid_addresses.each do |address| + @user.email = address + assert_not @user.valid?, "#{address.inspect} should be invalid" + end + end end
Add email validation tests for user
diff --git a/db/migrate/20130528220144_create_invitational_invitations.rb b/db/migrate/20130528220144_create_invitational_invitations.rb index abc1234..def5678 100644 --- a/db/migrate/20130528220144_create_invitational_invitations.rb +++ b/db/migrate/20130528220144_create_invitational_invitations.rb @@ -1,6 +1,6 @@ class CreateInvitationalInvitations < ActiveRecord::Migration def change - create_table :invitations do |t| + create_table :invitational_invitations do |t| t.string :email t.integer :role t.references :invitable, polymorphic: true @@ -12,8 +12,8 @@ t.timestamps end - add_index :invitations, :invitable_id - add_index :invitations, :invitable_type - add_index :invitations, :user_id + add_index :invitational_invitations, :invitable_id + add_index :invitational_invitations, :invitable_type + add_index :invitational_invitations, :user_id end end
Fix the migration to be correct for an engine
diff --git a/db/migrate/20160503092026_move_user_status_to_circle_role.rb b/db/migrate/20160503092026_move_user_status_to_circle_role.rb index abc1234..def5678 100644 --- a/db/migrate/20160503092026_move_user_status_to_circle_role.rb +++ b/db/migrate/20160503092026_move_user_status_to_circle_role.rb @@ -1,9 +1,11 @@ class MoveUserStatusToCircleRole < ActiveRecord::Migration + + STATUS_MAP = %i(pending active blocked) def up add_column :circle_roles, :status, :integer User.find_each do |user| - status_id = User.statuses[user.status] + status_id = STATUS_MAP.index(user.status) user.circle_roles.each { |role| role.update_attribute(:status, status_id) } end remove_column :users, :status @@ -13,7 +15,7 @@ add_column :users, :status, :integer User.find_each do |user| status = user.circle_roles.pluck(:status).include?(User.statuses[:pending]) ? :pending : :active - status_id = User.statuses[status] + status_id = STATUS_MAP.index(status) user.update_attribute(:status, status_id) end remove_column :circle_roles, :status
Fix migration; status isn't on the user any more.
diff --git a/nyny.gemspec b/nyny.gemspec index abc1234..def5678 100644 --- a/nyny.gemspec +++ b/nyny.gemspec @@ -19,6 +19,7 @@ spec.require_paths = ["lib"] spec.add_dependency "rack" + spec.add_dependency "tilt" spec.add_development_dependency "bundler", "~> 1.3" spec.add_development_dependency "rake" spec.add_development_dependency "rspec"
Add tilt as an explicit dependency
diff --git a/lib/ticket_evolution/core/collection.rb b/lib/ticket_evolution/core/collection.rb index abc1234..def5678 100644 --- a/lib/ticket_evolution/core/collection.rb +++ b/lib/ticket_evolution/core/collection.rb @@ -1,6 +1,7 @@ module TicketEvolution class Collection - attr_accessor :total_entries, :per_page, :current_page, :entries, :status_code, :unique_categories + attr_accessor :total_entries, :per_page, :current_page, :entries, :status_code, + :unique_categories, :balance_sum, :total_sum include Enumerable @@ -25,6 +26,8 @@ end } values[:unique_categories] = response.body['unique_categories'] if response.body['unique_categories'] + values[:balance_sum] = response.body['balance_sum'] if response.body['balance_sum'] + values[:total_sum] = response.body['total_sum'] if response.body['total_sum'] new(values) end end
Add handling for possible total_sum and balance_sum list values
diff --git a/lib/warden/github/rails/test_helpers.rb b/lib/warden/github/rails/test_helpers.rb index abc1234..def5678 100644 --- a/lib/warden/github/rails/test_helpers.rb +++ b/lib/warden/github/rails/test_helpers.rb @@ -15,6 +15,30 @@ end class MockUser < ::Warden::GitHub::User + attr_reader :memberships + + def initialize(*args) + super + @memberships = { :team => [], :org => [], :org_public => [] } + end + + def stub_membership(args) + args.each do |key, value| + memberships.fetch(key) << value + end + end + + def team_member?(id) + memberships[:team].include?(id) + end + + def organization_member?(id) + memberships[:org].include?(id) + end + + def organization_public_member?(id) + memberships[:org_public].include?(id) + end end end end
Add ability to stub memberships on mock user
diff --git a/recipes/_apt.rb b/recipes/_apt.rb index abc1234..def5678 100644 --- a/recipes/_apt.rb +++ b/recipes/_apt.rb @@ -6,3 +6,11 @@ # include_recipe "apt::default" + +# XXX: work around bug in postgresql cookbook +# https://github.com/elm-city-craftworks/practicing-ruby-cookbook/issues/24 +stamp_file = "/var/lib/apt/periodic/update-success-stamp" +execute "apt-get update" do + action :nothing +end.run_action(:run) unless ::File.exists?(stamp_file) && + ::File.mtime(stamp_file) < Time.now - 86_400
Work around bug in postgresql cookbook Addresses https://github.com/elm-city-craftworks/practicing-ruby-cookbook/issues/24
diff --git a/kmeans-clusterer.gemspec b/kmeans-clusterer.gemspec index abc1234..def5678 100644 --- a/kmeans-clusterer.gemspec +++ b/kmeans-clusterer.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = 'kmeans-clusterer' - s.version = '0.5.2' + s.version = '0.5.3' s.date = '2015-02-07' s.summary = "k-means clustering" s.description = "k-means clustering. Uses NArray for fast calculations." @@ -9,4 +9,5 @@ s.files = ["lib/kmeans-clusterer.rb"] s.homepage = 'https://github.com/gbuesing/kmeans-clusterer' s.license = 'MIT' + s.add_runtime_dependency 'narray', '~> 0.6' end
Add runtime gem dependency for narray. Version 0.5.3
diff --git a/lib/garnish/presenter.rb b/lib/garnish/presenter.rb index abc1234..def5678 100644 --- a/lib/garnish/presenter.rb +++ b/lib/garnish/presenter.rb @@ -3,6 +3,8 @@ extend ActiveSupport::Concern included do + include InstanceMethods + attr_accessor :template end @@ -12,10 +14,13 @@ end end - protected + module InstanceMethods - def method_missing(method, *args, &block) - self.template.send(method, *args, &block) unless @template.blank? + protected + + def method_missing(method, *args, &block) + self.template.send(method, *args, &block) unless @template.blank? + end end end
Move the instance methods into a module for inclusion as per ActiveSupport::Concern warnings.
diff --git a/datastax_rails.gemspec b/datastax_rails.gemspec index abc1234..def5678 100644 --- a/datastax_rails.gemspec +++ b/datastax_rails.gemspec @@ -12,6 +12,7 @@ s.homepage = "https://github.com/jasonmk/datastax_rails" s.summary = "A Ruby-on-Rails interface to Datastax Enterprise" s.description = "A Ruby-on-Rails interface to Datastax Enterprise. Intended for use with the DSE search nodes." + s.license = 'MIT' s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"] s.test_files = Dir["spec/**/*"]
Add license to gemspec file
diff --git a/recipes/server_windows_install.rb b/recipes/server_windows_install.rb index abc1234..def5678 100644 --- a/recipes/server_windows_install.rb +++ b/recipes/server_windows_install.rb @@ -7,7 +7,7 @@ opts = [] opts << '/S' -opts << "/D=#{node['gocd']['server']['work_dir']}" +opts << "/D='#{node['gocd']['server']['work_dir'].gsub('/', '\\')}'" if defined?(Chef::Provider::Package::Windows) package 'Go Server' do
Fix slashes being passed in incorrectly when work_dir is specified
diff --git a/rr.gemspec b/rr.gemspec index abc1234..def5678 100644 --- a/rr.gemspec +++ b/rr.gemspec @@ -18,7 +18,6 @@ 'CHANGES.md', 'CREDITS.md', 'Gemfile', - 'Gemfile.lock', 'LICENSE', 'README.md', 'Rakefile',
Remove Gemfile.lock from the gemspec It's absent from the repo, so trying to use `gem 'rr', github: 'rr/rr'` will result in a warning from Bundler.
diff --git a/lib/mnemosyne/builder.rb b/lib/mnemosyne/builder.rb index abc1234..def5678 100644 --- a/lib/mnemosyne/builder.rb +++ b/lib/mnemosyne/builder.rb @@ -27,7 +27,9 @@ meta: payload[:meta] end - Span.bulk_insert do |worker| + # `Span.column_names` is required to force bulk insert plugin + # to process `id` column too. + Span.bulk_insert(*Span.column_names) do |worker| Array(payload[:span]).each do |data| worker.add \ id: data[:uuid],
Fix issue on bulk insert leaving UUID out * Bulk insert plugin ignores given ID column value unless column list is manually specified and including ID column
diff --git a/lib/perpetuity/config.rb b/lib/perpetuity/config.rb index abc1234..def5678 100644 --- a/lib/perpetuity/config.rb +++ b/lib/perpetuity/config.rb @@ -14,7 +14,7 @@ adapter = args.shift db_name = args.shift options = args.shift || {} - adapter_class = Perpetuity.const_get(adapter(adapter)) + adapter_class = adapter(adapter) @db = adapter_class.new(options.merge(db: db_name)) end @@ -28,7 +28,7 @@ options = args.shift || {} protocol = uri.scheme - klass = Perpetuity.const_get(adapter(protocol)) + klass = adapter(protocol) db_options = { db: uri.path[1..-1], username: uri.user, @@ -44,11 +44,13 @@ end def self.adapters - @adapters ||= { - dynamodb: 'DynamoDB', - mongodb: 'MongoDB', - postgres: 'Postgres', - } + if @adapters.nil? + @adapters = {} + @adapters[:dynamodb] = Perpetuity::DynamoDB if defined?(Perpetuity::DynamoDB) + @adapters[:mongodb] = Perpetuity::MongoDB if defined?(Perpetuity::MongoDB) + @adapters[:postgres] = Perpetuity::Postgres if defined?(Perpetuity::Postgres) + end + @adapters end def adapter name
Refactor Perpetuity::Configuration.adapters to contain classes. We were using strings before, because adapter classes may not exist. We'll check to ensure they're defined instead, before adding them.
diff --git a/db/migrate/20151201200312_create_minimalist_theme.rb b/db/migrate/20151201200312_create_minimalist_theme.rb index abc1234..def5678 100644 --- a/db/migrate/20151201200312_create_minimalist_theme.rb +++ b/db/migrate/20151201200312_create_minimalist_theme.rb @@ -0,0 +1,37 @@+class CreateMinimalistTheme < ActiveRecord::Migration + tag :predeploy + + NAME = "Minimalist Theme" + + def up + variables = { + "ic-brand-primary"=>"#2773e2", + "ic-brand-button--secondary-bgd"=>"#4d4d4d", + "ic-link-color"=>"#1d6adb", + "ic-brand-global-nav-bgd"=>"#f2f2f2", + "ic-brand-global-nav-ic-icon-svg-fill"=>"#444444", + "ic-brand-global-nav-menu-item__text-color"=>"#444444", + "ic-brand-global-nav-avatar-border"=>"#444444", + "ic-brand-global-nav-logo-bgd"=>"#4d4d4d", + "ic-brand-watermark-opacity"=>"1", + "ic-brand-Login-body-bgd-color"=>"#f2f2f2", + "ic-brand-Login-body-bgd-shadow-color"=>"#f2f2f2", + "ic-brand-Login-Content-bgd-color"=>"#ffffff", + "ic-brand-Login-Content-border-color"=>"#efefef", + "ic-brand-Login-Content-label-text-color"=>"#444444", + "ic-brand-Login-Content-password-text-color"=>"#444444", + "ic-brand-Login-Content-button-bgd"=>"#2773e2", + "ic-brand-Login-footer-link-color"=>"#2773e2", + "ic-brand-Login-instructure-logo"=>"#aaaaaa" + } + bc = BrandConfig.new(variables: variables) + bc.name = NAME + bc.share = true + bc.save! + bc.save_scss_file! + end + + def down + BrandConfig.where(name: NAME).delete_all + end +end
Add Minimalist Theme to Theme Editor Fixes: CNVS-25766 This is the first of four themes we are going to add to Theme Editor's default offerings. Test plan: - Pull down the patchset, migrate your database, and restart Canvas - Open Theme Editor. Make sure you have delayed jobs running in the background: script/delayed_job run - You should now see the Minimalist theme listed in the select input: http://screencast.com/t/m7RvtWpDuZFw - If you lose all your styles after doing this, you might need to run: bundle exec rake brand_configs:generate_and_upload_all ... then restart. - Canvas should now look Minimalist! http://screencast.com/t/NCYCNjcc2lc Change-Id: I04c093a8dd7e6d989c3b83656354ce0cdb38ea27 Reviewed-on: https://gerrit.instructure.com/68008 Reviewed-by: Ryan Shaw <ea3cd978650417470535f3a4725b6b5042a6ab59@instructure.com> Product-Review: Pam Hiett <7b533437add1ce4ea4ed79979fa88e0e484e554b@instructure.com> Tested-by: Jenkins QA-Review: Michael Hargiss <59e3fde81b8d9a4f5e0cc016a3c2695591912604@instructure.com>
diff --git a/lib/tasks/scheduler.rake b/lib/tasks/scheduler.rake index abc1234..def5678 100644 --- a/lib/tasks/scheduler.rake +++ b/lib/tasks/scheduler.rake @@ -11,15 +11,22 @@ f[:entries].present? }.map { |f| "Create #{f[:entries].count} entries and #{f[:tracks].count} tracks from #{f[:feed].id}" }.join("\n") - notify_slack message + puts "Finish crawling." - Entry.update_visuals - + puts "Clearing cache entries..." Topic.all.each do |topic| topic.delete_cache_entries topic.delete_cache_mix_entries end + User.delete_cache_of_entries_of_all_user + + notify_slack message + + puts "Updating entry visual..." + Entry.update_visuals + puts "Updated entry visual." + puts "Finish!" end desc "Create latest entries as daily top keyword"
Clear entries of user subscriptions after crawling
diff --git a/Casks/omnigraffle5.rb b/Casks/omnigraffle5.rb index abc1234..def5678 100644 --- a/Casks/omnigraffle5.rb +++ b/Casks/omnigraffle5.rb @@ -0,0 +1,10 @@+cask :v1 => 'omnigraffle5' do + version '5.4.4' + sha256 '7bcc64093f46bd4808b1a4cb86cf90c0380a5c5ffffd55ce8f742712818558df' + + url "http://www.omnigroup.com/ftp/pub/software/MacOSX/10.6/OmniGraffle-#{version}.dmg" + homepage 'http://www.omnigroup.com/products/omnigraffle' + license :closed + + app 'OmniGraffle 5.app' +end
Add OmniGraffle 5 Standard cask Fix token name Add OmniGraffle 5 Standard cask Fix token name
diff --git a/lib/buildr_plus/features/whitespace.rb b/lib/buildr_plus/features/whitespace.rb index abc1234..def5678 100644 --- a/lib/buildr_plus/features/whitespace.rb +++ b/lib/buildr_plus/features/whitespace.rb @@ -16,7 +16,7 @@ desc 'Check all whitespace is normalized.' task 'whitespace:check' do output = `bundle exec zapwhite -d #{File.dirname(Buildr.application.buildfile.to_s)} --check-only` - unless output.empty? + unless $?.exitstatus != 0 puts output raise 'Whitespace has not been normalized. Please run "buildr whitespace:fix" and commit changes.' end
Check error code rather than standard out as other tools in chain (i.e bundler) can emit text to stdout
diff --git a/timestamp_scopes.gemspec b/timestamp_scopes.gemspec index abc1234..def5678 100644 --- a/timestamp_scopes.gemspec +++ b/timestamp_scopes.gemspec @@ -8,7 +8,8 @@ gem.version = TimestampScopes::VERSION gem.authors = ["Jake Moffatt"] gem.email = ["jakeonrails@gmail.com"] - gem.summary = "ActiveRecord scopes for timestamp columns with handy DSL" + gem.summary = "ActiveRecord scopes for timestamp columns" + gem.description = "Dynamically add useful timestamp scopes to your ActiveRecord models!" gem.homepage = "https://github.com/jakeonrails/timestamp_scopes" gem.files = `git ls-files`.split($/)
Add gem description to gemspec
diff --git a/lib/first_click_free/helpers/google.rb b/lib/first_click_free/helpers/google.rb index abc1234..def5678 100644 --- a/lib/first_click_free/helpers/google.rb +++ b/lib/first_click_free/helpers/google.rb @@ -27,12 +27,12 @@ # Returns true if the hostname ends with googlebot.com and the # forward DNS lookup IP address matches the request's remote IP address. def verify_googlebot_domain - hostname = Resolve.getname(request.remote_ip) + hostname = Resolv.getname(request.remote_ip) # Structure of lookup return is: # ["AF_INET", 80, "66.249.66.1", "66.249.66.1", 2, 2, 17] - ip = Socket.getaddrinfo(hostname, "http").first[3] + ip = Socket.getaddrinfo(hostname, "http").first[2] - hostname =~ /\.googlebot.com\Z/ && ip == request.remote_ip + hostname =~ /.googlebot.com\Z/ && ip == request.remote_ip end end
Fix Ruby class name, and update how IP address is indexed
diff --git a/app/components/sdg/goals/icon_component.rb b/app/components/sdg/goals/icon_component.rb index abc1234..def5678 100644 --- a/app/components/sdg/goals/icon_component.rb +++ b/app/components/sdg/goals/icon_component.rb @@ -7,7 +7,7 @@ end def image_path - "sdg/#{folder}/goal_#{code}.png" + "sdg/#{locale}/goal_#{code}.png" end private @@ -16,9 +16,9 @@ goal.code_and_title end - def folder - [*I18n.fallbacks[I18n.locale], "default"].find do |locale| - AssetFinder.find_asset("sdg/#{locale}/goal_#{code}.png") + def locale + [*I18n.fallbacks[I18n.locale], "default"].find do |fallback| + AssetFinder.find_asset("sdg/#{fallback}/goal_#{code}.png") end end end
Rename folder method in SDG icon component The method name was a bit confusing because it returned a locale.
diff --git a/app/controllers/api/accounts_controller.rb b/app/controllers/api/accounts_controller.rb index abc1234..def5678 100644 --- a/app/controllers/api/accounts_controller.rb +++ b/app/controllers/api/accounts_controller.rb @@ -3,7 +3,7 @@ def index @accounts = Account.all - @accounts = @accounts.order(:name) + @accounts = @accounts.includes(:account_group).order('account_groups.name ASC').order(:name) respond_with @accounts end
Sort accounts by account group name, then by name.
diff --git a/app/controllers/concerns/course_manager.rb b/app/controllers/concerns/course_manager.rb index abc1234..def5678 100644 --- a/app/controllers/concerns/course_manager.rb +++ b/app/controllers/concerns/course_manager.rb @@ -3,7 +3,7 @@ def append_course(list_name, course) current_user.send(list_name).push(course) - save_course('新增') + save_course(list_name, '新增') end def delete_course(list_name, course) @@ -12,10 +12,10 @@ else current_user.send("#{list_name}=", []) end - save_course('刪除') + save_course(list_name, '刪除') end - def save_course(action) + def save_course(list_name, action) if current_user.save respond_to do |format| format.html { redirect_to action: :show, notice: "#{action}成功" }
Fix list_name missing in save_course action
diff --git a/app/models/concerns/identifiable_by_key.rb b/app/models/concerns/identifiable_by_key.rb index abc1234..def5678 100644 --- a/app/models/concerns/identifiable_by_key.rb +++ b/app/models/concerns/identifiable_by_key.rb @@ -0,0 +1,17 @@+module IdentifiableByKey + extend ActiveSupport::Concern + + included do + before_create :add_key + end + + protected + + def add_key + p "\nAdding key\n" + self.key = loop do + tmp = SecureRandom.urlsafe_base64(4, false) + break tmp unless self.class.where(key: tmp).exists? + end + end +end
Add concern to create unique keys
diff --git a/cookbooks/nginx/attributes/passenger.rb b/cookbooks/nginx/attributes/passenger.rb index abc1234..def5678 100644 --- a/cookbooks/nginx/attributes/passenger.rb +++ b/cookbooks/nginx/attributes/passenger.rb @@ -3,5 +3,5 @@ # node.default["nginx"]["passenger"]["version"] = "3.0.12" node.default["nginx"]["passenger"]["root"] = "/usr/lib/ruby/gems/1.8/gems/passenger-3.0.12" -node.default["nginx"]["passenger"]["ruby"] = %x{which ruby}.chomp +node.default["nginx"]["passenger"]["ruby"] = "" node.default["nginx"]["passenger"]["max_pool_size"] = 10
Remove the nginx attribute that breaks nginx on Windows nodes
diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index abc1234..def5678 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -12,7 +12,7 @@ def second_welcome_email(user) @user = user @first_entry = user.entries.first - @first_entry_filepicker_url = filepicker_image_url(@first_entry.image_url, w: 300, h: 300, fit: 'max', cache: true, rotate: :exif) if @first_entry.image_url.present? + @first_entry_filepicker_url = filepicker_image_url(@first_entry.image_url, w: 300, h: 300, fit: 'max', cache: true, rotate: :exif) if @first_entry.present? && @first_entry.image_url.present? mail(from: "Dabble Me <#{user.user_key}@#{ENV['SMTP_DOMAIN']}>", to: user.email, subject: "Congrats on writing your first entry!") end end
Check for entry before calling image_url
diff --git a/app/models/load_profile.rb b/app/models/load_profile.rb index abc1234..def5678 100644 --- a/app/models/load_profile.rb +++ b/app/models/load_profile.rb @@ -16,7 +16,7 @@ def calculate_demand if (8..23).to_a.include? self.hour # oversimplified parabola - self.demand = -0.1 * ((self.hour - 15) ** 2) + 4 + self.demand = -0.1 * ((0.42 * self.hour - 5) ** 4) + 100 end end end
Use a nicer equation for load profile.
diff --git a/app/models/offsite_link.rb b/app/models/offsite_link.rb index abc1234..def5678 100644 --- a/app/models/offsite_link.rb +++ b/app/models/offsite_link.rb @@ -11,7 +11,7 @@ end unless url_is_gov_uk?(host) || url_is_gov_wales?(host) || url_is_whitelisted?(host) - errors.add(:base, "Please enter a valid GOV.UK URL, such as https://www.gov.uk/jobsearch") + errors.add(:base, "Please enter a valid government URL, such as https://www.gov.uk/jobsearch") end rescue URI::InvalidURIError errors.add(:base, "Please enter a valid URL, such as https://www.gov.uk/jobsearch")
Update `OffsiteLink` url validation message Removed the instruction to add a GOV.UK url as that is no longer accurate. Other URLs are also allowed.
diff --git a/lib/tasks/internet_box_logger_tasks.rb b/lib/tasks/internet_box_logger_tasks.rb index abc1234..def5678 100644 --- a/lib/tasks/internet_box_logger_tasks.rb +++ b/lib/tasks/internet_box_logger_tasks.rb @@ -10,7 +10,7 @@ def ibl_gem_path spec = Gem::Specification.find_by_name('internet_box_logger') - File.expand_path "../#{spec.name}", spec.spec_dir + spec.gem_dir end end
Fix ogf method that returns the root path of the gem
diff --git a/cookbooks/travis_internal_bastion/attributes/default.rb b/cookbooks/travis_internal_bastion/attributes/default.rb index abc1234..def5678 100644 --- a/cookbooks/travis_internal_bastion/attributes/default.rb +++ b/cookbooks/travis_internal_bastion/attributes/default.rb @@ -1,4 +1,5 @@ include_attribute 'travis_internal_base' +override['openssh']['server']['force_command'] = '/usr/sbin/login_duo' +override['openssh']['server']['log_level'] = 'VERBOSE' override['openssh']['server']['permit_tunnel'] = 'no' -override['openssh']['server']['force_command'] = '/usr/sbin/login_duo'
Set ssh server logging to VERBOSE on bastion
diff --git a/startup.rb b/startup.rb index abc1234..def5678 100644 --- a/startup.rb +++ b/startup.rb @@ -1,7 +1,8 @@ ## This file is loaded by irb -r ## So, setup any necessary configuration variables / executables here -## Remove previous gem installation +## Remove all previous gem installations +`gem uninstall -Ia cb-api` `rm -rf pkg/` ## Install local source code as gem
Remove all previous gem versions before reinstalling
diff --git a/lib/groupify/adapter/active_record/polymorphic_collection.rb b/lib/groupify/adapter/active_record/polymorphic_collection.rb index abc1234..def5678 100644 --- a/lib/groupify/adapter/active_record/polymorphic_collection.rb +++ b/lib/groupify/adapter/active_record/polymorphic_collection.rb @@ -39,7 +39,16 @@ def build_query(&group_membership_filter) query = Groupify.group_membership_klass.where.not(:"#{@source}_id" => nil) query = query.instance_eval(&group_membership_filter) if block_given? - query = query.group(["#{@source}_id", "#{@source}_type"]).includes(@source) + query = query.includes(@source) + query = case ::ActiveRecord::Base.connection.adapter_name.downcase + when /postgres/, /pg/ + id_column = ActiveRecord.quote(Groupify.group_membership_klass, "#{@source}_id") + type_column = ActiveRecord.quote(Groupify.group_membership_klass, "#{@source}_type") + query.select("DISTINCT ON (#{id_column}, #{type_column}) *") + else #when /mysql/, /sqlite/ + query.group(["#{@source}_id", "#{@source}_type"]) + end + query end end
Fix postgres by changing from `GROUP BY` to `DISTINCT ON`
diff --git a/lib/fakie/java_script.rb b/lib/fakie/java_script.rb index abc1234..def5678 100644 --- a/lib/fakie/java_script.rb +++ b/lib/fakie/java_script.rb @@ -7,8 +7,8 @@ def js_context @@_js_context ||= begin require 'execjs' - source = File.open('lib/fakie/js/libphonenumber.js').read - source += File.open('lib/fakie/js/fakie.js').read + source = File.open(File.join(__FILE__, '../js/libphonenumber.js')).read + source += File.open(File.join(__FILE__, '../js/fakie.js')).read ExecJS.compile(source) end end
Use a better path when loading JavaScripts
diff --git a/event_store-messaging.gemspec b/event_store-messaging.gemspec index abc1234..def5678 100644 --- a/event_store-messaging.gemspec +++ b/event_store-messaging.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |s| s.name = 'event_store-messaging' s.summary = 'Messaging primitives for EventStore using the EventStore Client HTTP library' - s.version = '0.0.2.8' + s.version = '0.1.0.0' s.authors = [''] s.require_paths = ['lib'] s.files = Dir.glob('{lib}/**/*')
Package version increased from 0.0.2.8 to 0.1.0.0
diff --git a/Library/Formula/wxmac.rb b/Library/Formula/wxmac.rb index abc1234..def5678 100644 --- a/Library/Formula/wxmac.rb +++ b/Library/Formula/wxmac.rb @@ -1,9 +1,15 @@ require 'formula' class Wxmac <Formula - url 'http://downloads.sourceforge.net/project/wxwindows/wxMac/2.8.10/wxMac-2.8.10.tar.bz2' + url 'http://downloads.sourceforge.net/project/wxwindows/2.8.11/wxMac-2.8.11.tar.bz2' homepage 'http://www.wxwidgets.org' - md5 '67e5eb6823907081fc979d41e00f93d7' + md5 '8d84bfdc43838e2d2f75031f62d1864f' + + def caveats; <<-EOS.undent + wxWidgets 2.8.x builds 32-bit only, so you probably won't be able to use it + for other Homebrew-installed softare on Snow Leopard (like Erlang). + EOS + end def install # Force i386
Update wxWidgets to 2.8.11 and add caveats.
diff --git a/examples/enum_select_paged.rb b/examples/enum_select_paged.rb index abc1234..def5678 100644 --- a/examples/enum_select_paged.rb +++ b/examples/enum_select_paged.rb @@ -6,4 +6,4 @@ alfabet = ('A'..'Z').to_a -prompt.enum_select('Which letter?', alfabet, per_page: 4) +prompt.enum_select('Which letter?', alfabet, per_page: 4, cycle: true, default: 2)
Change example to demonstrate cycling
diff --git a/lib/jekyll/assets_plugin/environment.rb b/lib/jekyll/assets_plugin/environment.rb index abc1234..def5678 100644 --- a/lib/jekyll/assets_plugin/environment.rb +++ b/lib/jekyll/assets_plugin/environment.rb @@ -35,6 +35,9 @@ self.cache = Sprockets::Cache::FileStore.new cache_path end + # reset cache if config changed + self.version = site.assets_config.marshal_dump + # bind jekyll and Sprockets context together context_class.instance_variable_set :@site, site context_class.send :include, Patches::ContextPatch
Reset cache upon config change
diff --git a/lib/netsuite/records/record_ref_list.rb b/lib/netsuite/records/record_ref_list.rb index abc1234..def5678 100644 --- a/lib/netsuite/records/record_ref_list.rb +++ b/lib/netsuite/records/record_ref_list.rb @@ -1,28 +1,10 @@ module NetSuite module Records - class RecordRefList - include Support::Fields + class RecordRefList < Support::Sublist include Support::Records include Namespaces::PlatformCore - fields :record_ref - - def initialize(attrs = {}) - initialize_from_attributes_hash(attrs) - end - - def record_ref=(items) - case items - when Hash - self.record_ref << RecordRef.new(items) - when Array - items.each { |ref| self.record_ref << RecordRef.new(ref) } - end - end - - def record_ref - @record_ref ||= [] - end + sublist :record_ref, RecordRef def to_record {
Refactor RecordRefList to use Support::Sublist
diff --git a/db/data_migration/20160525093035_republish_publications_to_publishing_api.rb b/db/data_migration/20160525093035_republish_publications_to_publishing_api.rb index abc1234..def5678 100644 --- a/db/data_migration/20160525093035_republish_publications_to_publishing_api.rb +++ b/db/data_migration/20160525093035_republish_publications_to_publishing_api.rb @@ -1,3 +1,3 @@ Publication.includes(:document).find_each do |pub| - Whitehall::PublishingApi.republish_document_async(pub.document) + Whitehall::PublishingApi.republish_document_async(pub.document, bulk: true) end
Send republish jobs to correct queue
diff --git a/lib/react/rails/controller_lifecycle.rb b/lib/react/rails/controller_lifecycle.rb index abc1234..def5678 100644 --- a/lib/react/rails/controller_lifecycle.rb +++ b/lib/react/rails/controller_lifecycle.rb @@ -4,9 +4,11 @@ extend ActiveSupport::Concern included do - # use old names to support Rails 3 - before_filter :setup_react_component_helper - after_filter :teardown_react_component_helper + # use both names to support Rails 3..5 + before_action_with_fallback = begin method(:before_action); rescue method(:before_filter); end + after_action_with_fallback = begin method(:after_action); rescue method(:after_filter); end + before_action_with_fallback.call :setup_react_component_helper + after_action_with_fallback.call :teardown_react_component_helper attr_reader :__react_component_helper end
Support controller callbacks for Rails 3..5 `before_filter` is deprecated in Rails 5 and will disappear in 5.1 This change begins using `before_action`, with a fallback to `before_filter` if `before_action` is not available. closes #404
diff --git a/lib/swagger_docs_generator/generator.rb b/lib/swagger_docs_generator/generator.rb index abc1234..def5678 100644 --- a/lib/swagger_docs_generator/generator.rb +++ b/lib/swagger_docs_generator/generator.rb @@ -44,7 +44,7 @@ def agregate_metadata case defined?(Rails) && Rails.env when 'production' || 'test' - write_inswagger_file.to_json + write_in_swagger_file.to_json else JSON.pretty_generate write_in_swagger_file end
Fix json file writing in production/test env
diff --git a/lib/timeline_fu/acts_as_event_target.rb b/lib/timeline_fu/acts_as_event_target.rb index abc1234..def5678 100644 --- a/lib/timeline_fu/acts_as_event_target.rb +++ b/lib/timeline_fu/acts_as_event_target.rb @@ -5,6 +5,8 @@ end module ClassMethods + # Who's this timeline for? User? Person? + # Go and put acts_as_event_target in the model's class definition. def acts_as_event_target has_many :timeline_events, :as => :target end
Add comment to help understand the meaning of aaet
diff --git a/spec/regression/regression_spec.rb b/spec/regression/regression_spec.rb index abc1234..def5678 100644 --- a/spec/regression/regression_spec.rb +++ b/spec/regression/regression_spec.rb @@ -3,7 +3,7 @@ describe "regression test" do command("#{File.expand_path("../../../bin/foodcritic", __FILE__)} --no-progress --tags any .", allow_error: true) - IO.readlines(File.expand_path("../cookbooks.txt", __FILE__)).each do |line| + File.readlines(File.expand_path("../cookbooks.txt", __FILE__)).each do |line| name, ref = line.strip.split(":") context "with cookbook #{name}", "regression_#{name}" => true do @@ -13,7 +13,7 @@ end it "should match expected output" do - expected_output = IO.readlines(File.expand_path("../expected/#{name}.txt", __FILE__)) + expected_output = File.readlines(File.expand_path("../expected/#{name}.txt", __FILE__)) expected_output.each do |expected_line| expect(subject.stdout).to include expected_line end
Use File not IO for regression Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
diff --git a/lib/vagrant-cachier/bucket/apt_lists.rb b/lib/vagrant-cachier/bucket/apt_lists.rb index abc1234..def5678 100644 --- a/lib/vagrant-cachier/bucket/apt_lists.rb +++ b/lib/vagrant-cachier/bucket/apt_lists.rb @@ -7,6 +7,10 @@ end def install + # Apt lists bucket can't be used on windows hosts + # https://github.com/fgrehm/vagrant-cachier/issues/106 + return if Vagrant::Util::Platform.windows? + if guest.capability?(:apt_lists_dir) guest_path = guest.capability(:apt_lists_dir)
Disable apt-lists bucket for windows hosts Fixes GH-106
diff --git a/robot.gemspec b/robot.gemspec index abc1234..def5678 100644 --- a/robot.gemspec +++ b/robot.gemspec @@ -3,7 +3,7 @@ require "robot/version" Gem::Specification.new do |s| - s.name = "robot" + s.name = "scheduled-robot" s.version = Robot::VERSION::STRING s.platform = Gem::Platform::RUBY s.authors = ["Dray Lacy", "Grady Griffin", "Brian Fisher"]
Update name to not conflict with already existing gem
diff --git a/lib/lita-meetup-rsvps.rb b/lib/lita-meetup-rsvps.rb index abc1234..def5678 100644 --- a/lib/lita-meetup-rsvps.rb +++ b/lib/lita-meetup-rsvps.rb @@ -5,6 +5,38 @@ class MeetupRsvps < Handler end + # How often we should poll for new events/meetups from your groups. + config :events_poll_interval, type: Integer, default: 3600 + + # Configure the Meetup you want to poll and the channel you want it to + # output it in. + config :events, type: Hash, required: true + + # * Poll for new events + # * Compare the events received with the ones stored in redis + # * Send triggers for the events which weren't in redis + # * In the trigger do + # ** Send trigger for rsvps + # ** Send trigger for event_comments + # ** Save the current event in redis + # + # http://www.meetup.com/meetup_api/docs/2/events/ + # https://api.meetup.com/2/events?group_urlname=STHLM-Lounge-Hackers&page=20&key=7714627f7e7d61275a161303b3e3332 + # + # http://www.meetup.com/meetup_api/docs/stream/2/rsvps/#http + # http://stream.meetup.com/2/rsvps?event_id=XXX&since_mtime=restart_from + # + # http://www.meetup.com/meetup_api/docs/stream/2/event_comments/#http + # http://stream.meetup.com/2/event_comments?event_id=XXX&since_mtime=restart_from + # + # every 60 robot.trigger :check_alive, :room: room, :meetup-url: "sthlm-lounge-hackers" + # check_alive + # redis-lock || return + # Net::HTTP payload[:meedup-url] do + # robot.send_message payload[:room] MEOW + # end + # end + Lita.register_handler(MeetupRsvps) end end
Add the basic idea and a few config options
diff --git a/lib/models/mm_adapter.rb b/lib/models/mm_adapter.rb index abc1234..def5678 100644 --- a/lib/models/mm_adapter.rb +++ b/lib/models/mm_adapter.rb @@ -23,7 +23,7 @@ user = MmUser.new attributes puts user.inspect puts user.to_json - user.save + user.id = nil unless user.save user end
Reset id if save fails A nil id tells us that the save failed, but MongoMapper sets id on all new instances.
diff --git a/lib/prawn/emoji/image.rb b/lib/prawn/emoji/image.rb index abc1234..def5678 100644 --- a/lib/prawn/emoji/image.rb +++ b/lib/prawn/emoji/image.rb @@ -22,7 +22,7 @@ private def codepoint - @codepoint ||= @unicode.codepoints.map { |c| c.to_s(16) }.join('-').downcase + @codepoint ||= @unicode.codepoints.map { |c| '%04x' % c.to_s }.join('-').downcase end end end
Fix truncation of longer emoji codepoints
diff --git a/lib/renderer/graphviz.rb b/lib/renderer/graphviz.rb index abc1234..def5678 100644 --- a/lib/renderer/graphviz.rb +++ b/lib/renderer/graphviz.rb @@ -8,6 +8,7 @@ g[:splines] = :true g[:sep] = 1 g[:concentrate] = :true + g[:rankdir] = "LR" } @file_name = file_name @config = config @@ -27,4 +28,4 @@ @g.output(opts) end end -end+end
Use add rankdir option to improve the look Right now all networks are source nodes and this way have a rank of 0 means they are all placed on top, side by side. In a network with a lot of subnets the picture becomes wider which makes it hard to read and complicated to scroll. With this change, the graph direction switches from top to down to left to right and this way subnets will belisted on the left side. Pictures now become higher instead of wider and become a bit easier to navigate, since nodes also becomes closer since they take way less space. Signed-off-by: Sheogorath <1c2647ce2ee8a4ec8e5c8b1b245ca38f94844bab@shivering-isles.com>
diff --git a/spec/support/controller_macros.rb b/spec/support/controller_macros.rb index abc1234..def5678 100644 --- a/spec/support/controller_macros.rb +++ b/spec/support/controller_macros.rb @@ -3,17 +3,16 @@ def login_admin before(:each) do @request.env["devise.mapping"] = Devise.mappings[:admin] - sign_in FactoryGirl.create(:admin) # Using factory girl as an example + @user = FactoryGirl.create(:admin) + sign_in @user end end def login_user before(:each) do @request.env["devise.mapping"] = Devise.mappings[:user] - user = FactoryGirl.create(:user) - #we don't use :confirmable module for now, so the following line is useless - # user.confirm! #or set a confirmed_at inside the factory. - sign_in user + @user = FactoryGirl.create(:user) + sign_in @user end end end
Define user as an instance variable in spec/support login macros. Not really BDD, but it will help check some things in controller specs.
diff --git a/script/export_to_csv.rb b/script/export_to_csv.rb index abc1234..def5678 100644 --- a/script/export_to_csv.rb +++ b/script/export_to_csv.rb @@ -0,0 +1,9 @@+puts PositionApplication.where(:created_at.gte => '2015-05-04').select { |pa| pa.call && pa.call.workflow == :workflow_administration_election}.map { |pa| + u = pa.user + row = [u.first_name, u.last_name, u.email, pa.position, "'#{pa.call.title}'", "'#{pa.custom['degree']}'", pa.custom['available'], u.edu_data['A_PROGRAM']] + pa.recommendations.each do |r| + u = r.user + row += [u.first_name, u.last_name, u.email, u.edu_data['A_PROGRAM']] + end + row.join(",") +}.join("\n")
Add script used to export HYY elections
diff --git a/example/simple_client.rb b/example/simple_client.rb index abc1234..def5678 100644 --- a/example/simple_client.rb +++ b/example/simple_client.rb @@ -0,0 +1,8 @@+#!/usr/bin/ruby + +require 'net/ajp13/client' + +Net::AJP13::Client.start('localhost',3009) do |client| + puts client.get('/index.jsp').body +end +
Add a simple AJP13 test client.
diff --git a/db/migrate/20150206000001_create_vip.rb b/db/migrate/20150206000001_create_vip.rb index abc1234..def5678 100644 --- a/db/migrate/20150206000001_create_vip.rb +++ b/db/migrate/20150206000001_create_vip.rb @@ -24,6 +24,9 @@ :Admin => { :null => true, }, + :Agent => { + :null => true, + }, }, :view => { '-all-' => {
Allow agents to set vip attribute.
diff --git a/lib/active_merchant/billing/stripe_gateway_decorator.rb b/lib/active_merchant/billing/stripe_gateway_decorator.rb index abc1234..def5678 100644 --- a/lib/active_merchant/billing/stripe_gateway_decorator.rb +++ b/lib/active_merchant/billing/stripe_gateway_decorator.rb @@ -7,7 +7,13 @@ commit(:post, "customers/#{CGI.escape(customer)}/sources/#{bank_account_token}/verify", amounts: options[:amounts]) end - + + def retrieve(source, **options) + customer = source.gateway_customer_profile_id + bank_account_token = source.gateway_payment_profile_id + commit(:get, "customers/#{CGI.escape(customer)}/bank_accounts/#{bank_account_token}") + end + private def headers(options = {})
Add retrieve action for ach bank_accounts
diff --git a/config/initializers/pusher.rb b/config/initializers/pusher.rb index abc1234..def5678 100644 --- a/config/initializers/pusher.rb +++ b/config/initializers/pusher.rb @@ -0,0 +1,5 @@+require 'pusher' + +Pusher.url = "https://545220afdca7480dd648:10d35535615aa40e73f4@api.pusherapp.com/apps/151280" + +Pusher.logger = Rails.logger
Add the Pusher.com initializer file.
diff --git a/scripts/make-package.rb b/scripts/make-package.rb index abc1234..def5678 100644 --- a/scripts/make-package.rb +++ b/scripts/make-package.rb @@ -1,16 +1,19 @@+require 'json' +require 'zip/zip' + unversioned = `git ls-files -o src`.strip if !unversioned.empty? puts "Error: Unversioned files in tree, exiting.\n#{unversioned}" exit 1 end -version = `jq -r .version src/manifest.json`.strip -if version.empty? - puts 'Error: Package version not found in manifest.json, exiting.' - exit 1 +version = JSON.load(File.read('src/manifest.json'))['version'] +out = "marinara-#{version}.zip" + +Zip::ZipFile::open(out, 'w') do |zip| + Dir['src/**/*'].each do |path| + zip.add(path.sub(/^src\//, ''), path) + end end -out = "marinara-#{version}.zip" -`(cd src && zip -r - .) > #{out}` - puts "Package created: #{out}."
Update package creation to use Ruby zip library instead of OS zip utility.
diff --git a/callcredit.gemspec b/callcredit.gemspec index abc1234..def5678 100644 --- a/callcredit.gemspec +++ b/callcredit.gemspec @@ -6,7 +6,7 @@ gem.add_runtime_dependency 'nokogiri', '~> 1.4' gem.add_runtime_dependency 'unicode_utils', '~> 1.4.0' - gem.add_development_dependency 'rspec', '~> 3.7.0' + gem.add_development_dependency 'rspec', '~> 3.8.0' gem.add_development_dependency 'webmock', '~> 3.4.0' gem.add_development_dependency 'rubocop'
Update rspec requirement from ~> 3.7.0 to ~> 3.8.0 Updates the requirements on [rspec](https://github.com/rspec/rspec) to permit the latest version. - [Release notes](https://github.com/rspec/rspec/releases) - [Commits](https://github.com/rspec/rspec/commits/v3.8.0) Signed-off-by: dependabot[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com>
diff --git a/activerecord/test/support/connection.rb b/activerecord/test/support/connection.rb index abc1234..def5678 100644 --- a/activerecord/test/support/connection.rb +++ b/activerecord/test/support/connection.rb @@ -13,8 +13,7 @@ def self.connect puts "Using #{connection_name}" - file = File.open('debug.log', 'w') - ActiveRecord::Model.logger = ActiveSupport::Logger.new(file) + ActiveRecord::Model.logger = ActiveSupport::Logger.new("debug.log") ActiveRecord::Model.configurations = connection_config ActiveRecord::Model.establish_connection 'arunit' ARUnit2Model.establish_connection 'arunit2'
Revert "truncate debug.log on each test run" This reverts commit 98043c689f945cabffc043f4bdc80ab2a7edc763. Because if every time `debug.log` is truncated, developers have no way to see the previous ActiveRecord unit test results. `debug.log` file can be easily reduced by executing `$ touch /dev/null > debug.log` periodically.
diff --git a/lib/rails-csv-fixtures/active_record_csv_fixtures.rb b/lib/rails-csv-fixtures/active_record_csv_fixtures.rb index abc1234..def5678 100644 --- a/lib/rails-csv-fixtures/active_record_csv_fixtures.rb +++ b/lib/rails-csv-fixtures/active_record_csv_fixtures.rb @@ -9,27 +9,30 @@ alias_method_chain :read_fixture_files, :csv_support end - def read_fixture_files_with_csv_support - if ::File.file?(csv_file_path) - read_csv_fixture_files + def read_fixture_files_with_csv_support(*args) + if ::File.file?(csv_file_path(*args)) + read_csv_fixture_files(*args) else - read_fixture_files_without_csv_support + read_fixture_files_without_csv_support(*args) end end - def read_csv_fixture_files - reader = CSV.parse(erb_render(IO.read(csv_file_path))) + def read_csv_fixture_files(*args) + fixtures = fixtures() || {} + reader = CSV.parse(erb_render(IO.read(csv_file_path(*args)))) header = reader.shift i = 0 reader.each do |row| data = {} row.each_with_index { |cell, j| data[header[j].to_s.strip] = cell.nil? ? nil : cell.to_s.strip } - fixtures["#{@class_name.to_s.underscore}_#{i+=1}"] = ActiveRecord::Fixture.new(data, model_class) + class_name = (args.second || @class_name) + fixtures["#{class_name.to_s.underscore}_#{i+=1}"] = ActiveRecord::Fixture.new(data, model_class) end + fixtures end - def csv_file_path - @path + '.csv' + def csv_file_path(*args) + (args.first || @path) + '.csv' end def erb_render(fixture_content)
Fix compatibility with Rails 4.1.0 The changes should be backwards compatible, but have not yet been tested with older versions of Rails.
diff --git a/ext/rkerberos/extconf.rb b/ext/rkerberos/extconf.rb index abc1234..def5678 100644 --- a/ext/rkerberos/extconf.rb +++ b/ext/rkerberos/extconf.rb @@ -4,6 +4,10 @@ have_header('krb5.h') have_library('krb5') + +unless pkg_config('com_err') + puts 'warning: com_err not found, usually a dependency for kadm5clnt' +end if have_header('kadm5/admin.h') have_library('kadm5clnt')
Fix kadm5clnt build issue on EL6 Explicitly require com_err to populate the include path and fix kadm5/admin.h error on EL6 with e2fsprogs 1.41, which doesn't have /usr/include/com_err.h.
diff --git a/AnalyticsSwift.podspec b/AnalyticsSwift.podspec index abc1234..def5678 100644 --- a/AnalyticsSwift.podspec +++ b/AnalyticsSwift.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = 'AnalyticsSwift' - spec.version = '0.1.0' + spec.version = '0.2.0' spec.license = { :type => 'MIT' } @@ -16,4 +16,4 @@ spec.osx.deployment_target = '10.9' spec.requires_arc = true -end+end
Increment spec version to indicate swift2
diff --git a/Casks/intellij-idea.rb b/Casks/intellij-idea.rb index abc1234..def5678 100644 --- a/Casks/intellij-idea.rb +++ b/Casks/intellij-idea.rb @@ -1,6 +1,6 @@ cask :v1 => 'intellij-idea' do - version '14.1.2' - sha256 'ea3326004a8e1dd113ea54b825494f60be0f506c5e6a25743481a719931ce896' + version '14.1.3' + sha256 'a7045dd58a6d632724a0444b46b71de55ee237a8f8fa31aa9a82b685d8d8bef2' url "http://download.jetbrains.com/idea/ideaIU-#{version}.dmg" name 'IntelliJ IDEA'
Upgrade Intellij Idea to 14.1.3
diff --git a/sequel-annotate.gemspec b/sequel-annotate.gemspec index abc1234..def5678 100644 --- a/sequel-annotate.gemspec +++ b/sequel-annotate.gemspec @@ -2,7 +2,6 @@ s.name = 'sequel-annotate' s.version = '1.2.0' s.platform = Gem::Platform::RUBY - s.has_rdoc = true s.extra_rdoc_files = ["README.rdoc", "CHANGELOG", "MIT-LICENSE"] s.rdoc_options += ["--quiet", "--line-numbers", "--inline-source", '--title', 'sequel-annotate: Annotate Sequel models with schema information', '--main', 'README.rdoc'] s.license = "MIT"
Remove has_rdoc from gemspec, since it is deprecated
diff --git a/roles/web.rb b/roles/web.rb index abc1234..def5678 100644 --- a/roles/web.rb +++ b/roles/web.rb @@ -17,8 +17,8 @@ :pool_idle_time => 0 }, :web => { - :status => "database_readonly", - :database_host => "db-slave", + :status => "online", + :database_host => "db", :readonly_database_host => "db-slave" } )
Revert "Switch site to readonly mode on ramoth" This reverts commit b7ef775848df23afe2d99f4f09fa04189190a5f7.
diff --git a/app/controllers/questions_controller.rb b/app/controllers/questions_controller.rb index abc1234..def5678 100644 --- a/app/controllers/questions_controller.rb +++ b/app/controllers/questions_controller.rb @@ -10,6 +10,8 @@ def show @question = Question.find(params[:id]) @answer = current_user.answers.build + @question_comments = @question.comments + @comment = Comment.new end def new
Create empty comment for rendering the comment box and retreive all comments for a question
diff --git a/app/controllers/responses_controller.rb b/app/controllers/responses_controller.rb index abc1234..def5678 100644 --- a/app/controllers/responses_controller.rb +++ b/app/controllers/responses_controller.rb @@ -1,6 +1,7 @@ class ResponsesController < ApplicationController def index - @responses = Response.all + @project = Project.find(params[:project_id]) + @responses = @project.responses.all respond_to do |format| format.csv { render text: @responses.to_csv } end
Fix export all responses for project bug
diff --git a/KMSWebRTCCall.podspec b/KMSWebRTCCall.podspec index abc1234..def5678 100644 --- a/KMSWebRTCCall.podspec +++ b/KMSWebRTCCall.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "KMSWebRTCCall" - s.version = "1.0.3" + s.version = "1.0.4" s.summary = "Kurento Media Server iOS Web RTC Call." s.homepage = "https://github.com/sdkdimon/kms-ios-webrtc-call" s.license = { :type => 'MIT', :file => 'LICENSE' }
Update pod spec to v1.0.4
diff --git a/source/feed.xml.builder b/source/feed.xml.builder index abc1234..def5678 100644 --- a/source/feed.xml.builder +++ b/source/feed.xml.builder @@ -16,7 +16,7 @@ xml.id URI.join(site_url, article.url) xml.published article.date.to_time.iso8601 xml.updated File.mtime(article.source_file).iso8601 - xml.author { xml.name "Article Author" } + xml.author { xml.name blog_author } # xml.summary article.summary, "type" => "html" xml.content article.body, "type" => "html" end
Fix "Article Author" being used Atom feed.
diff --git a/net_http_ssl_fix.gemspec b/net_http_ssl_fix.gemspec index abc1234..def5678 100644 --- a/net_http_ssl_fix.gemspec +++ b/net_http_ssl_fix.gemspec @@ -14,5 +14,6 @@ s.files = `git ls-files`.split("\n") s.require_paths = ['lib'] + s.add_development_dependency 'rake', '~> 11.1.2' s.add_development_dependency 'rspec', '~> 3.4.0' end
Add rake as development dependency
diff --git a/test/performance/rollenspiel/role_grantee_performance_test.rb b/test/performance/rollenspiel/role_grantee_performance_test.rb index abc1234..def5678 100644 --- a/test/performance/rollenspiel/role_grantee_performance_test.rb +++ b/test/performance/rollenspiel/role_grantee_performance_test.rb @@ -22,7 +22,10 @@ end end - assert time < 0.1, "expected #{time} < 0.1" + expected_max_time = 0.1 + expected_max_time = 0.2 if RUBY_VERSION =~ /^1\./ + + assert time < expected_max_time, "expected #{time} < #{expected_max_time}" end end end if ENV['BENCHMARK']
Fix performance test for ruby 1.x.
diff --git a/co_aspects.gemspec b/co_aspects.gemspec index abc1234..def5678 100644 --- a/co_aspects.gemspec +++ b/co_aspects.gemspec @@ -24,7 +24,7 @@ spec.add_dependency 'activesupport', '>= 3.0' - spec.add_development_dependency 'bundler', '~> 1.10' + spec.add_development_dependency 'bundler', '~> 1.9' spec.add_development_dependency 'rake', '~> 10.0' spec.add_development_dependency 'rspec' end
Downgrade bundler version for circleci
diff --git a/sprockets-rails.gemspec b/sprockets-rails.gemspec index abc1234..def5678 100644 --- a/sprockets-rails.gemspec +++ b/sprockets-rails.gemspec @@ -11,12 +11,12 @@ s.files = Dir["README.md", "lib/**/*.rb", "MIT-LICENSE"] - s.required_ruby_version = '>= 1.9.3' + s.required_ruby_version = '>= 2.5' s.add_dependency "sprockets", ">= 3.0.0" - s.add_dependency "actionpack", ">= 4.0" - s.add_dependency "activesupport", ">= 4.0" - s.add_development_dependency "railties", ">= 4.0" + s.add_dependency "actionpack", ">= 5.2" + s.add_dependency "activesupport", ">= 5.2" + s.add_development_dependency "railties", ">= 5.2" s.add_development_dependency "rake" s.add_development_dependency "sass" s.add_development_dependency "uglifier"
Update gemspec with minimum ruby/rails versions
diff --git a/spec/factories/notes.rb b/spec/factories/notes.rb index abc1234..def5678 100644 --- a/spec/factories/notes.rb +++ b/spec/factories/notes.rb @@ -8,7 +8,7 @@ is_citation true lang 'en' listable true - external_updated_at 1.day.ago + sequence(:external_updated_at) { |n| (1000 - n).days.ago } sequence(:id) { |n| "#{n}" } title { 'Fixed note title' } word_count nil
Revert change in date sequencing
diff --git a/app/controllers/spree/base_controller.rb b/app/controllers/spree/base_controller.rb index abc1234..def5678 100644 --- a/app/controllers/spree/base_controller.rb +++ b/app/controllers/spree/base_controller.rb @@ -0,0 +1,16 @@+require 'cancan' +require_dependency 'spree/core/controller_helpers/strong_parameters' + +class Spree::BaseController < ApplicationController + include Spree::Core::ControllerHelpers::Auth + include Spree::Core::ControllerHelpers::RespondWith + include Spree::Core::ControllerHelpers::SSL + include Spree::Core::ControllerHelpers::Common + include Spree::Core::ControllerHelpers::Search + include Spree::Core::ControllerHelpers::StrongParameters + include Spree::Core::ControllerHelpers::Search + + respond_to :html +end + +require 'spree/i18n/initializer'
Bring base controller from spree
diff --git a/config/schedule.rb b/config/schedule.rb index abc1234..def5678 100644 --- a/config/schedule.rb +++ b/config/schedule.rb @@ -24,7 +24,7 @@ # Learn more: http://github.com/javan/whenever # stagger jobs by offsetting with current time -time = Time.zone.now +time = Time.new # define cron strings nightly_cron_str = time.min.to_s + ' 5 * * *'
Remove Rails dependency from whenever.rb Resolves #1542 - whoops
diff --git a/lib/convection/model/diff.rb b/lib/convection/model/diff.rb index abc1234..def5678 100644 --- a/lib/convection/model/diff.rb +++ b/lib/convection/model/diff.rb @@ -7,6 +7,7 @@ # Difference between an item in two templates ## class Diff + include Comparable extend Mixin::Colorize attr_reader :key @@ -46,11 +47,17 @@ [action, message, color] end - def ==(other) - @key == other.key && - @ours == other.ours && - @theirs == other.theirs && - @action == other.action + def <=>(other) + value = @key <=> other.key + return value if value != 0 + + value = @ours <=> other.ours + return value if value != 0 + + value = @theirs <=> other.theirs + return value if value != 0 + + @action <=> other.action end end end
Allow Diff objects to be sorted in addition to checking for equality.
diff --git a/lib/data_mapper/alias_set.rb b/lib/data_mapper/alias_set.rb index abc1234..def5678 100644 --- a/lib/data_mapper/alias_set.rb +++ b/lib/data_mapper/alias_set.rb @@ -1,7 +1,6 @@ module DataMapper class AliasSet include Enumerable - include Adamantium attr_reader :prefix
Make AliasSet mutable (at least for now) Adamantium is doing too much freezing here. Making AliasSet immutable results in "can't modify frozen object" during EV/EC attribute mapper finalization
diff --git a/app/models/news.rb b/app/models/news.rb index abc1234..def5678 100644 --- a/app/models/news.rb +++ b/app/models/news.rb @@ -1,2 +1,13 @@ class News < ActiveRecord::Base + validates :title, :sub_title, :body, :image_url, presence: true + validates_length_of :title, :minimum => 5 + validates_length_of :title, :maximum => 60 + + validates_length_of :sub_title, :minimum => 5 + validates_length_of :sub_title, :maximum => 60 + + validates :image_url, allow_blank: true, format: { + with: %r{\.(gif|jpg|png)\Z}i, + message: 'must be a URL for GIF, JPG or PNG image.' + } end
Add title, subtitle, body, image_url validation for News
diff --git a/app/models/page.rb b/app/models/page.rb index abc1234..def5678 100644 --- a/app/models/page.rb +++ b/app/models/page.rb @@ -1,5 +1,6 @@ class Page < ActiveRecord::Base belongs_to :parent, class_name: "Page", foreign_key: "parent_id" + has_many :pages, class_name: "Page", foreign_key: "parent_id" def level self.parent.present? ? self.parent.level + 1 : 1
Add has many relation to Page
diff --git a/app/models/silo.rb b/app/models/silo.rb index abc1234..def5678 100644 --- a/app/models/silo.rb +++ b/app/models/silo.rb @@ -14,7 +14,7 @@ index silo_type: 1 def to_json - @json ||= Multijson.encode bag + @json ||= MultiJson.encode bag end class << self
Use MultiJson, not Multijson, which doesn't exist
diff --git a/app/models/user.rb b/app/models/user.rb index abc1234..def5678 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -13,14 +13,9 @@ has_many :subscriptions, :class_name => ClubsUsers - has_attached_file :icon, :styles => { :medium => "256x256>", :thumb => "100x100>", :tiny => "50x50>" }, - :default_url => Settings.users[:default_icon] - validates :name, :presence => true, :uniqueness => true validates :email, :presence => true, :uniqueness => true validates :description, :presence => { :message => "for user can't be blank" }, :on => :update - - validates_attachment_content_type :icon, :content_type => [ 'image/jpeg', 'image/gif', 'image/png', 'image/tiff' ] def memberships Club.find subscriptions.map(&:club_id) @@ -28,6 +23,7 @@ def assign_defaults self.description = Settings.users[:default_description] + self.icon = Settings.users[:default_icon] end private
Update User for Icon and Default Update the User model to ensure that the icon attribute is a string rather than an attached image, and default the icon when the user is initialized.
diff --git a/app/models/user.rb b/app/models/user.rb index abc1234..def5678 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -8,5 +8,5 @@ validates :email, email: true # customized validity check in app/validators/website_validator.rb - validates :website, website: true + validates :website, website: true, allow_blank: true end
Allow blank field for website url
diff --git a/lib/access_lint/audit.rb b/lib/access_lint/audit.rb index abc1234..def5678 100644 --- a/lib/access_lint/audit.rb +++ b/lib/access_lint/audit.rb @@ -4,6 +4,7 @@ module AccessLint class Audit RUNNER_PATH = File.expand_path("../../../vendor/access-lint/bin/auditor.js", __FILE__) + HTML_CS_PATH = File.expand_path("../../../vendor/squizlabs/PhantomJS", __FILE__) def initialize(target) @target = target @@ -25,7 +26,11 @@ arguments = runner.fetch('additional_arguments') || {} arguments = arguments.values.any? ? arguments.values.join(' ') : '' - "phantomjs #{RUNNER_PATH} #{@target} #{arguments}" + if rule_set_name == :html_codesniffer + "cd #{HTML_CS_PATH} && phantomjs HTMLCS_Run.js #{@target} #{arguments}" + else + "phantomjs #{RUNNER_PATH} #{@target} #{arguments}" + end end end end
Add support for HTML CodeSniffer
diff --git a/lib/dialogue/storable.rb b/lib/dialogue/storable.rb index abc1234..def5678 100644 --- a/lib/dialogue/storable.rb +++ b/lib/dialogue/storable.rb @@ -13,8 +13,7 @@ if present present = keys.all? do |key| !data[key].nil? && - (!data[key].respond_to?(:empty?) || - (data[key].respond_to?(:empty?) && !data[key].empty?)) + (!data[key].respond_to?(:empty?) || !data[key].empty?) end end present
Refactor to simplify the boolean logic
diff --git a/config/initializers/database_connection.rb b/config/initializers/database_connection.rb index abc1234..def5678 100644 --- a/config/initializers/database_connection.rb +++ b/config/initializers/database_connection.rb @@ -1,11 +1,11 @@-Rails.application.config.after_initialize do - ActiveRecord::Base.connection_pool.disconnect! +#Rails.application.config.after_initialize do + #ActiveRecord::Base.connection_pool.disconnect! - ActiveSupport.on_load(:active_record) do - config = ActiveRecord::Base.configurations[Rails.env] || - Rails.application.config.database_configuration[Rails.env] - config['reaping_frequency'] = ENV['DB_REAP_FREQ'] || 10 # seconds - config['pool'] = ENV['DB_POOL'] || ENV['MAX_THREADS'] || 5 - ActiveRecord::Base.establish_connection(config) - end -end + #ActiveSupport.on_load(:active_record) do + #config = ActiveRecord::Base.configurations[Rails.env] || + #Rails.application.config.database_configuration[Rails.env] + #config['reaping_frequency'] = ENV['DB_REAP_FREQ'] || 10 # seconds + #config['pool'] = ENV['DB_POOL'] || ENV['MAX_THREADS'] || 5 + #ActiveRecord::Base.establish_connection(config) + #end +#end
Remove the database connection pooling code for now
diff --git a/lib/docs/scrapers/jquery/jquery_core.rb b/lib/docs/scrapers/jquery/jquery_core.rb index abc1234..def5678 100644 --- a/lib/docs/scrapers/jquery/jquery_core.rb +++ b/lib/docs/scrapers/jquery/jquery_core.rb @@ -1,7 +1,7 @@ module Docs class JqueryCore < Jquery self.name = 'jQuery' - self.release = 'up to 2.2.3' + self.release = 'up to 2.2.4' self.base_url = 'https://api.jquery.com/' self.initial_paths = %w(/index/index)
Update jQuery documentation (up to 2.2.4)