diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/features/support/allow_forgery_protection.rb b/features/support/allow_forgery_protection.rb
index abc1234..def5678 100644
--- a/features/support/allow_forgery_protection.rb
+++ b/features/support/allow_forgery_protection.rb
@@ -0,0 +1,3 @@+# Don't disable request forgery protection for features. We want to be sure that
+# authenticity_token is included in all forms which require it.
+ActionController::Base.allow_forgery_protection = true
|
Enable request forgery protection for features
Bulk edit without js has been broken for a few months due to a missing
authenticity_token, and we didn't notice. This change will mean that
features should fail if we do this again.
|
diff --git a/lib/analytics/scripts/usernames_to_csv.rb b/lib/analytics/scripts/usernames_to_csv.rb
index abc1234..def5678 100644
--- a/lib/analytics/scripts/usernames_to_csv.rb
+++ b/lib/analytics/scripts/usernames_to_csv.rb
@@ -3,9 +3,19 @@
require 'csv'
+# all the usernames
usernames = User.joins(:courses_users).uniq.pluck(:wiki_id)
CSV.open('/root/all_course_participants.csv', 'wb') do |csv|
usernames.each do |username|
csv << [username]
end
end
+
+# student usernames by cohort
+Cohort.all.each do |cohort|
+ CSV.open("/root/#{cohort.slug}_students.csv", 'wb') do |csv|
+ cohort.students.each do |student|
+ csv << [student.wiki_id]
+ end
+ end
+end
|
Document a script for creating student username CSVs by cohort
|
diff --git a/repo_man.gemspec b/repo_man.gemspec
index abc1234..def5678 100644
--- a/repo_man.gemspec
+++ b/repo_man.gemspec
@@ -10,7 +10,7 @@ spec.email = ["brook@codefellows.org"]
spec.summary = %q{Keep the repos under one roof.}
spec.description = %q{Track all the repos for a GitHub user from one parent directory}
- spec.homepage = "http://repoman.gem"
+ spec.homepage = "https://github.com/brookr/repo_man"
spec.license = "MIT"
spec.files = `git ls-files -z`.split("\x0")
|
Update homepage to repository URL.
|
diff --git a/plugins/providers/hyperv/action/package_vagrantfile.rb b/plugins/providers/hyperv/action/package_vagrantfile.rb
index abc1234..def5678 100644
--- a/plugins/providers/hyperv/action/package_vagrantfile.rb
+++ b/plugins/providers/hyperv/action/package_vagrantfile.rb
@@ -22,8 +22,9 @@ # have to worry about it.
def create_vagrantfile
File.open(File.join(@env["export.temp_dir"], "Vagrantfile"), "w") do |f|
+ mac_address = @env[:machine].provider.driver.read_mac_address
f.write(TemplateRenderer.render("package_Vagrantfile", {
- base_mac: @env[:machine].provider.driver.read_mac_address
+ base_mac: mac_address["mac"]
}))
end
end
|
Fix getting mac address from the driver.
|
diff --git a/lib/rubocop/cop/performance/fixed_size.rb b/lib/rubocop/cop/performance/fixed_size.rb
index abc1234..def5678 100644
--- a/lib/rubocop/cop/performance/fixed_size.rb
+++ b/lib/rubocop/cop/performance/fixed_size.rb
@@ -7,21 +7,22 @@ # Do not compute the size of statically sized objects.
class FixedSize < Cop
MSG = 'Do not compute the size of statically sized objects.'.freeze
- COUNTERS = [:count, :length, :size].freeze
- STATIC_SIZED_TYPES = [:array, :hash, :str, :sym].freeze
+
+ def_node_matcher :counter, <<-MATCHER
+ (send ${array hash str sym} {:count :length :size} $...)
+ MATCHER
def on_send(node)
- variable, method, arg = *node
- return unless variable
- return unless COUNTERS.include?(method)
- return unless STATIC_SIZED_TYPES.include?(variable.type)
- return if contains_splat?(variable)
- return if contains_double_splat?(variable)
- return if string_argument?(arg)
- if node.parent
- return if node.parent.casgn_type? || node.parent.block_type?
+ counter(node) do |variable, arg|
+ return if contains_splat?(variable)
+ return if contains_double_splat?(variable)
+ return if !arg.nil? && string_argument?(arg.first)
+ if node.parent
+ return if node.parent.casgn_type? || node.parent.block_type?
+ end
+
+ add_offense(node, :expression)
end
- add_offense(node, :expression)
end
private
|
Modify FixedSize to use NodePattern
|
diff --git a/neo4apis-activerecord.gemspec b/neo4apis-activerecord.gemspec
index abc1234..def5678 100644
--- a/neo4apis-activerecord.gemspec
+++ b/neo4apis-activerecord.gemspec
@@ -3,7 +3,7 @@
Gem::Specification.new do |s|
s.name = 'neo4apis-activerecord'
- s.version = '0.4.1'
+ s.version = '0.5.0'
s.required_ruby_version = '>= 1.9.1'
s.authors = 'Brian Underwood'
@@ -18,6 +18,6 @@ s.require_path = 'lib'
s.files = Dir.glob('{bin,lib,config}/**/*') + %w(README.md Gemfile neo4apis-activerecord.gemspec)
- s.add_dependency('neo4apis', '~> 0.4.0')
+ s.add_dependency('neo4apis', '~> 0.5.0')
s.add_dependency('activerecord', '~> 4.0')
end
|
Update dependency on neo4apis and bump minor version because it's easier
|
diff --git a/lib/critical_juncture/map/map_bookmarking.rb b/lib/critical_juncture/map/map_bookmarking.rb
index abc1234..def5678 100644
--- a/lib/critical_juncture/map/map_bookmarking.rb
+++ b/lib/critical_juncture/map/map_bookmarking.rb
@@ -1,4 +1,4 @@-module CloudKicker
+module Cloudkicker
module MapBookmarking
def add_bookmarking_functions
add_location_to_anchor
|
Fix module name so it loads correctly
|
diff --git a/lib/pacer/wrappers/wrapping_pipe_function.rb b/lib/pacer/wrappers/wrapping_pipe_function.rb
index abc1234..def5678 100644
--- a/lib/pacer/wrappers/wrapping_pipe_function.rb
+++ b/lib/pacer/wrappers/wrapping_pipe_function.rb
@@ -13,6 +13,10 @@ @wrapper = WrapperSelector.build back.element_type, extensions
end
+ def arity
+ block.arity
+ end
+
def compute(element)
e = wrapper.new element
e.graph = graph if e.respond_to? :graph=
@@ -21,6 +25,13 @@ end
alias call compute
+
+ def call_with_args(element, *args)
+ e = wrapper.new element
+ e.graph = graph if e.respond_to? :graph=
+ e.back = back if e.respond_to? :back=
+ block.call e, *args
+ end
end
class UnwrappingPipeFunction
@@ -30,6 +41,10 @@
def initialize(block)
@block = block
+ end
+
+ def arity
+ block.arity
end
def compute(element)
@@ -42,6 +57,15 @@ end
alias call compute
+
+ def call_with_args(element, *args)
+ e = block.call element, *args
+ if e.is_a? ElementWrapper
+ e.element
+ else
+ e
+ end
+ end
end
end
end
|
Add multi-arity block support to my PipeFunctions.
|
diff --git a/lib/paper_trail_scrapbook/version_helpers.rb b/lib/paper_trail_scrapbook/version_helpers.rb
index abc1234..def5678 100644
--- a/lib/paper_trail_scrapbook/version_helpers.rb
+++ b/lib/paper_trail_scrapbook/version_helpers.rb
@@ -52,9 +52,7 @@ config.invalid_whodunnit
end
- if instance.respond_to?(:to_whodunnit)
- return instance.to_whodunnit
- end
+ return instance.to_whodunnit if instance.respond_to?(:to_whodunnit)
instance.to_s
end
|
Use modifier form of if statement
|
diff --git a/lib/tasks/autocomplete_build_top_trumps.rake b/lib/tasks/autocomplete_build_top_trumps.rake
index abc1234..def5678 100644
--- a/lib/tasks/autocomplete_build_top_trumps.rake
+++ b/lib/tasks/autocomplete_build_top_trumps.rake
@@ -0,0 +1,40 @@+namespace :autocomplete do
+ desc 'Find all the titles and formats for the slugs in autocomplete-top-trumps.csv, writes out search-top-trumps.json'
+ task :build_top_trumps => :environment do
+ require 'csv'
+ require 'json'
+
+ input_file = "autocomplete-top-trumps.csv"
+ output_file = "search-top-trumps.json"
+ raise "Can't read #{input_file}" unless File.exist?(input_file)
+
+ docs = []
+ i = 0
+ CSV.foreach(input_file) do |row|
+ i +=1
+ next if i == 1
+ phrase, slug, weight = row
+ slug = slug.gsub('/', '')
+ a = Artefact.where(slug: slug).first
+ if a
+ docs << {
+ "title" => a.name,
+ "link" => "/" + a.slug,
+ "format" => a.kind,
+ "keywords" => phrase,
+ "weight" => weight
+ }
+ else
+ raise "Couldn't find slug '#{slug}'"
+ end
+ end
+
+ File.open(output_file, "w") do |f|
+ f << %q{if (typeof(GDS) == 'undefined') { GDS = {}; };} + "\n"
+ f << %q{GDS.search_top_trumps = }
+ f << JSON.dump(docs).gsub(/},{/, "},\n{")
+ f << ";\n"
+ end
+ end
+end
+
|
Add script to generate autocomplete search-top-trumps.js file.
|
diff --git a/test/controllers/admin_post_comments_controller_test.rb b/test/controllers/admin_post_comments_controller_test.rb
index abc1234..def5678 100644
--- a/test/controllers/admin_post_comments_controller_test.rb
+++ b/test/controllers/admin_post_comments_controller_test.rb
@@ -0,0 +1,74 @@+require 'test_helper'
+
+#
+# == Admin namespace
+#
+module Admin
+ #
+ # == HomesController test
+ #
+ class PostCommentsControllerTest < ActionController::TestCase
+ include Devise::TestHelpers
+
+ setup :initialize_test
+
+ test 'should redirect to users/sign_in if not logged in' do
+ sign_out @anthony
+ get :index
+ assert_redirected_to new_user_session_path
+ get :show, id: @comment.id
+ assert_redirected_to new_user_session_path
+ delete :destroy, id: @comment.id
+ assert_redirected_to new_user_session_path
+ end
+
+ test 'should show index page if logged in' do
+ get :index
+ assert_response :success
+ end
+
+ test 'should show show page if logged in' do
+ get :show, id: @comment.id
+ assert_response :success
+ end
+
+ test 'should not be able to show comments for other users' do
+ sign_in @alice
+ get :show, id: @comment.id
+ assert_redirected_to admin_dashboard_path
+ end
+
+ test 'should not be able to destroy administrator comments if subscriber' do
+ sign_in @alice
+ assert_no_difference ['Comment.count'] do
+ delete :destroy, id: @comment.id
+ end
+ assert_redirected_to admin_dashboard_path
+ end
+
+ test 'should destroy own comment' do
+ sign_in @alice
+ assert_difference ['Comment.count'], -1 do
+ delete :destroy, id: @comment_alice.id
+ end
+ assert_redirected_to admin_post_comments_path
+ end
+
+ test 'should destroy all comments if super_administrator' do
+ assert_difference ['Comment.count'], -1 do
+ delete :destroy, id: @comment_alice.id
+ end
+ assert_redirected_to admin_post_comments_path
+ end
+
+ private
+
+ def initialize_test
+ @anthony = users(:anthony)
+ @alice = users(:alice)
+ @comment = comments(:one)
+ @comment_alice = comments(:three)
+ sign_in @anthony
+ end
+ end
+end
|
Add tests for ActiveAdmin Comment resource
|
diff --git a/lib/cenit/handler.rb b/lib/cenit/handler.rb
index abc1234..def5678 100644
--- a/lib/cenit/handler.rb
+++ b/lib/cenit/handler.rb
@@ -27,7 +27,8 @@ root = self.model.pluralize
count = 0
self.payload[root].each do |obj|
- next if obj[:id].empty? rescue obj[:id] = obj[:id].to_s
+ next if obj[:id].nil? or obj[:id].empty?
+ obj[:id] = obj[:id].to_s
@object = klass.where(id: obj[:id]).first
@object ? @object.update_attributes(obj) : (@object = klass.new(obj))
count += 1 if @object.save
|
Update Handler for Request id =nill
|
diff --git a/lib/ruby-box/mock.rb b/lib/ruby-box/mock.rb
index abc1234..def5678 100644
--- a/lib/ruby-box/mock.rb
+++ b/lib/ruby-box/mock.rb
@@ -2,3 +2,13 @@ require "webmock"
require "ruby-box/mock/version"
require "ruby-box/mock/folder"
+
+module RubyBox
+ module Mock
+ def self.mock
+ folder = Folder.new
+ folder.stub_folder_requests
+ folder.stub_post_folder_request
+ end
+ end
+end
|
Add helper methods to stub all folder requests
|
diff --git a/lib/utensils/json.rb b/lib/utensils/json.rb
index abc1234..def5678 100644
--- a/lib/utensils/json.rb
+++ b/lib/utensils/json.rb
@@ -0,0 +1,55 @@+module JsonHelpers
+ def expect_json_response(path = nil)
+ expect(json_response(path))
+ end
+
+ def expect_json(body, path = nil)
+ expect(parse_json(body, path))
+ end
+
+ def json_response(path = nil)
+ parse_json(spec_type_agnostic_response_body, path)
+ end
+
+ private
+
+ def spec_type_agnostic_response_body
+ if respond_to?(:response_body)
+ response_body
+ else
+ response.body
+ end
+ end
+
+ # Stolen from https://github.com/collectiveidea/json_spec/blob/00855fdd9c2f8a8794eb418419202dc85ce0fa23/lib/json_spec/helpers.rb
+ def parse_json(json, path = nil)
+ ruby = MultiJson.decode("[#{json}]").first
+ result = value_at_json_path(ruby, path)
+
+ if result.respond_to?(:with_indifferent_access)
+ result.with_indifferent_access
+ else
+ result
+ end
+ end
+
+ def value_at_json_path(ruby, path)
+ return ruby unless path
+
+ path.split("/").inject(ruby) do |value, key|
+ case value
+ when Hash
+ value.fetch(key) { "Couldn't find JSON path #{path}" }
+ when Array
+ raise "Couldn't find JSON path #{path}" unless key =~ /^\d+$/
+ value.fetch(key.to_i) { raise "Couldn't find JSON path #{path}" }
+ else
+ raise "Couldn't find JSON path #{path}"
+ end
+ end
+ end
+end
+
+RSpec.configure do |config|
+ config.include JsonHelpers
+end
|
Add JSON support file, extracted from global-web
|
diff --git a/lib/watnow/config.rb b/lib/watnow/config.rb
index abc1234..def5678 100644
--- a/lib/watnow/config.rb
+++ b/lib/watnow/config.rb
@@ -4,7 +4,7 @@
# Default constants
FOLDER_IGNORE = %w(tmp node_modules db public log)
- FILE_EXTENSION_IGNORE = %w(tmproj)
+ FILE_EXTENSION_IGNORE = %w(tmproj markdown md txt)
PATTERNS = %w(TODO FIXME)
def self.included(base)
|
Update ignored file extension list
|
diff --git a/test/ffi-gobject_introspection/i_constant_info_test.rb b/test/ffi-gobject_introspection/i_constant_info_test.rb
index abc1234..def5678 100644
--- a/test/ffi-gobject_introspection/i_constant_info_test.rb
+++ b/test/ffi-gobject_introspection/i_constant_info_test.rb
@@ -1,21 +1,21 @@ require File.expand_path('../test_helper.rb', File.dirname(__FILE__))
describe GObjectIntrospection::IConstantInfo do
- describe "for GLib::ALLOCATOR_LIST, a constant of type :gint32" do
+ describe "for GLib::USEC_PER_SEC, a constant of type :gint32" do
before do
- @info = get_introspection_data 'GLib', 'ALLOCATOR_LIST'
+ @info = get_introspection_data 'GLib', 'USEC_PER_SEC'
end
it "returns :gint32 as its type" do
assert_equal :gint32, @info.constant_type.tag
end
- it "returns a value union with member :v_int32 with value 1" do
- assert_equal 1, @info.value_union[:v_int32]
+ it "returns a value union with member :v_int32 with value 1_000_000" do
+ assert_equal 1_000_000, @info.value_union[:v_int32]
end
it "returns 1 as its value" do
- assert_equal 1, @info.value
+ assert_equal 1_000_000, @info.value
end
end
end
|
Use different constant for testing IConstantInfo.
Fixes issue #25.
|
diff --git a/test/responses/custom/test_custom_tag_list_response.rb b/test/responses/custom/test_custom_tag_list_response.rb
index abc1234..def5678 100644
--- a/test/responses/custom/test_custom_tag_list_response.rb
+++ b/test/responses/custom/test_custom_tag_list_response.rb
@@ -17,7 +17,7 @@
should 'have tags' do
expected = %w(EXAMPLE-TAG EXAMPLE2-TAG)
- names = @tag_list_response.tags.keys
+ names = @tag_list_response.tags.keys.sort
assert_equal expected, names
end
|
Sort TagList tag names so tests pass
|
diff --git a/pry-vterm_aliases.gemspec b/pry-vterm_aliases.gemspec
index abc1234..def5678 100644
--- a/pry-vterm_aliases.gemspec
+++ b/pry-vterm_aliases.gemspec
@@ -10,7 +10,7 @@ s.add_dependency("pry", "~> 0.9.11")
s.add_development_dependency("rspec", "~> 2.12.0")
s.summary = "Enable your Bash and ZSH alises in Pry."
- s.description = "Enable your Bash and ZSH alises in Pry."
+ s.description = "Enable your Bash and ZSH alises in Pry shell."
s.homepage = "http://envygeeks.com/projects/pry-vterm_aliases/"
s.files = ["Readme.md", "Rakefile", "License", "Gemfile"] + Dir["lib/**/*"]
end
|
Change something to fix Travis.
|
diff --git a/active_record_deprecated_finders.gemspec b/active_record_deprecated_finders.gemspec
index abc1234..def5678 100644
--- a/active_record_deprecated_finders.gemspec
+++ b/active_record_deprecated_finders.gemspec
@@ -4,8 +4,8 @@ Gem::Specification.new do |gem|
gem.authors = ["Jon Leighton"]
gem.email = ["j@jonathanleighton.com"]
- gem.description = %q{TODO: Write a gem description}
- gem.summary = %q{TODO: Write a gem summary}
+ gem.description = %q{This gem will be used to extract and deprecate old-style finder option hashes in Active Record.}
+ gem.summary = %q{This gem will be used to extract and deprecate old-style finder option hashes in Active Record.}
gem.homepage = ""
gem.files = `git ls-files`.split($\)
|
Add description and summary to gempspec
|
diff --git a/config/deploy.rb b/config/deploy.rb
index abc1234..def5678 100644
--- a/config/deploy.rb
+++ b/config/deploy.rb
@@ -19,4 +19,10 @@ end
end
-after "deploy:restart", "deploy:cleanup"+namespace :staff do
+ task :update do
+ run "cd #{current_path}/staff/; php update_staff.php"
+ end
+end
+
+after "deploy:restart", "deploy:cleanup", "staff:update"
|
Add task to update staff profiles
|
diff --git a/spec/classes/example_spec.rb b/spec/classes/example_spec.rb
index abc1234..def5678 100644
--- a/spec/classes/example_spec.rb
+++ b/spec/classes/example_spec.rb
@@ -11,13 +11,13 @@ context "artifactory class without any parameters" do
it { is_expected.to compile.with_all_deps }
- it { is_expected.to contain_class('artifactory::params') }
+# it { is_expected.to contain_class('artifactory::params') }
it { is_expected.to contain_class('artifactory::install').that_comes_before('artifactory::config') }
it { is_expected.to contain_class('artifactory::config') }
it { is_expected.to contain_class('artifactory::service').that_subscribes_to('artifactory::config') }
it { is_expected.to contain_service('artifactory') }
- it { is_expected.to contain_package('artifactory').with_ensure('present') }
+ it { is_expected.to contain_package('jfrog-artifactory-oss').with_ensure('present') }
end
end
end
@@ -32,7 +32,7 @@ }
end
- it { expect { is_expected.to contain_package('artifactory') }.to raise_error(Puppet::Error, /Nexenta not supported/) }
+ it { expect { is_expected.to contain_package('jfrog-artifactory-oss') }.to raise_error(Puppet::Error, /Nexenta not supported/) }
end
end
end
|
Fix package name, and params test
|
diff --git a/spec/keyboard_events_spec.rb b/spec/keyboard_events_spec.rb
index abc1234..def5678 100644
--- a/spec/keyboard_events_spec.rb
+++ b/spec/keyboard_events_spec.rb
@@ -22,7 +22,7 @@
-describe "KeyPressed Event" do
+describe KeyPressed do
before :each do
@event = KeyPressed.new( :a, [:shift], "A" )
@@ -37,7 +37,7 @@ end
-describe "KeyReleased Event" do
+describe KeyReleased do
before :each do
@event = KeyReleased.new( :a, [:shift] )
|
Use the actual class constants in "describe _____ do".
|
diff --git a/spec/models/pictures_spec.rb b/spec/models/pictures_spec.rb
index abc1234..def5678 100644
--- a/spec/models/pictures_spec.rb
+++ b/spec/models/pictures_spec.rb
@@ -1,3 +1,5 @@+# frozen_string_literal: true
+
require 'spec_helper'
describe Picture do
@@ -12,7 +14,7 @@ end
it 'reports failed image processing' do
- data = {:data=>{:file_location=>"***", :parent=>{}}}
+ data = { data: { file_location: '***', parent: {} } }
error = an_instance_of(Errno::ENOENT)
get_errors = receive(:notify_exception).with(error, data).and_return(nil)
expect(ExceptionNotifier).to(get_errors)
|
[CodeFactor] Apply fixes to commit c014b1e
|
diff --git a/spec/unit/aggregates_spec.rb b/spec/unit/aggregates_spec.rb
index abc1234..def5678 100644
--- a/spec/unit/aggregates_spec.rb
+++ b/spec/unit/aggregates_spec.rb
@@ -3,11 +3,6 @@ require 'spec_helper'
describe Pariah::Dataset, "#aggregate" do
- def teardown
- super
- clear_indices
- end
-
it "specifies a list of fields to aggregate on" do
ds = FTS[:pariah_test_default].aggregate(:a, :b)
|
Fix extraneous index clearing in a spec.
|
diff --git a/app/controllers/organizers_controller.rb b/app/controllers/organizers_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/organizers_controller.rb
+++ b/app/controllers/organizers_controller.rb
@@ -41,7 +41,7 @@ private
def organizer_params
- params.require(:event).permit(
+ params.require(:organizer).permit(
:description,
:logo,
:name
|
Fix strong params for creating an org.
|
diff --git a/db/migrate/003_sql_session_store_setup.rb b/db/migrate/003_sql_session_store_setup.rb
index abc1234..def5678 100644
--- a/db/migrate/003_sql_session_store_setup.rb
+++ b/db/migrate/003_sql_session_store_setup.rb
@@ -0,0 +1,15 @@+class SqlSessionStoreSetup < ActiveRecord::Migration
+ def self.up
+ create_table "sessions", :options => "ENGINE=InnoDB" do |t|
+ t.column "session_id", :string
+ t.column "data", :text
+ t.column "created_at", :timestamp
+ t.column "updated_at", :timestamp
+ end
+ add_index "sessions", ["session_id"], :name => "sessions_session_id_idx", :unique => true
+ end
+
+ def self.down
+ drop_table "sessions"
+ end
+end
|
Add migration to create session table in the database.
|
diff --git a/db/migrate/20170613223606_create_users.rb b/db/migrate/20170613223606_create_users.rb
index abc1234..def5678 100644
--- a/db/migrate/20170613223606_create_users.rb
+++ b/db/migrate/20170613223606_create_users.rb
@@ -4,6 +4,7 @@ t.string :name, null: false
t.email :email, null: false
t.integer :admin_status, null: false
+ t.string :password_digest, null: false
t.timestamps, null: false
end
|
Add password column for Bcrypt gem in user migration
|
diff --git a/app/controllers/catalog_admin/categories_controller.rb b/app/controllers/catalog_admin/categories_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/catalog_admin/categories_controller.rb
+++ b/app/controllers/catalog_admin/categories_controller.rb
@@ -1,16 +1,14 @@ class CatalogAdmin::CategoriesController < CatalogAdmin::BaseController
layout "catalog_admin/setup/form"
- # TODO: Pundit-based authorization
- #
def new
build_category
- # authorize(@category)
+ authorize(@category)
end
def create
build_category
- # authorize(@category)
+ authorize(@category)
if @category.update(category_params)
redirect_to(after_create_path, :notice => created_message)
else
|
Enable authorization for categories actions
|
diff --git a/app/workers/course_data_update_worker.rb b/app/workers/course_data_update_worker.rb
index abc1234..def5678 100644
--- a/app/workers/course_data_update_worker.rb
+++ b/app/workers/course_data_update_worker.rb
@@ -14,6 +14,7 @@
def perform(course_id)
course = Course.find(course_id)
+ logger.info "Updating course: #{course.slug}"
UpdateCourseStats.new(course)
rescue StandardError => e
Sentry.capture_exception e
|
Add logging to pin down which course(s) are causing OOM problems
Sidekiq logs can be monitored in realtime via Nomad, so this should let me see which course updates are causing the Nomad jobs to be killed for OOM, so I can either optimize memory usage or find some other solution.
|
diff --git a/spec/cli_spec.rb b/spec/cli_spec.rb
index abc1234..def5678 100644
--- a/spec/cli_spec.rb
+++ b/spec/cli_spec.rb
@@ -2,7 +2,54 @@
describe Findrepos::CLI do
describe '#list' do
- it 'has tests'
+ before(:context) { create_repo_tree }
+
+ after(:context) { FileUtils.rm_r 'repos' }
+
+ context 'by default' do
+ it 'lists all clean and dirty Git repositories in the current ' \
+ 'directory' do
+ expect { Findrepos::CLI.start %w(list repos) }.to \
+ output("clean repos/a_clean_repo\ndirty repos/a_dirty_repo\n")
+ .to_stdout
+ end
+ end
+
+ context 'with --recursive' do
+ it 'lists all Git repositories in the current directory and all ' \
+ 'subdirectories' do
+ expect { Findrepos::CLI.start %w(list repos --recursive) }.to \
+ output("clean repos/a_clean_repo\ndirty repos/a_dirty_repo\nclean repos/repo_inside/another_repo\n").to_stdout
+ end
+ end
+
+ context 'with --verbose' do
+ it 'has tests'
+ end
+
+ context 'with --names' do
+ it 'lists all clean and dirty Git repositories in the current ' \
+ 'directory' do
+ expect { Findrepos::CLI.start %w(list repos --names) }.to \
+ output("repos/a_clean_repo\nrepos/a_dirty_repo\n").to_stdout
+ end
+ end
+
+ context 'with --filter' do
+ context 'when filter is "clean"' do
+ it 'only lists clean repositories' do
+ expect { Findrepos::CLI.start %w(list repos --filter=clean) }.to \
+ output("clean repos/a_clean_repo\n").to_stdout
+ end
+ end
+
+ context 'when filter is "dirty"' do
+ it 'only lists dirty repositories' do
+ expect { Findrepos::CLI.start %w(list repos --filter=dirty) }.to \
+ output("dirty repos/a_dirty_repo\n").to_stdout
+ end
+ end
+ end
end
describe '#say_git_status' do
|
Add specs for most of the options for "findrepos list"
|
diff --git a/files/unifiedpush-cookbooks/unifiedpush/recipes/cassandra_maintenance.rb b/files/unifiedpush-cookbooks/unifiedpush/recipes/cassandra_maintenance.rb
index abc1234..def5678 100644
--- a/files/unifiedpush-cookbooks/unifiedpush/recipes/cassandra_maintenance.rb
+++ b/files/unifiedpush-cookbooks/unifiedpush/recipes/cassandra_maintenance.rb
@@ -16,21 +16,17 @@ #
installation_dir = node['unifiedpush']['cassandra']['installation_dir']
+cassandra_user = node['unifiedpush']['cassandra']['user']
-cron 'cassandra-nodetool-nightly-repair' do
- minute "0"
- hour "1"
- user "root"
- command "#{installation_dir}/bin/nodetool repair -seq --trace > /tmp/nodetool-repair.log 2>&1"
+# Due to CASSANDRA-9143, DataStax recommends switching to full repairs
+# https://docs.datastax.com/en/cassandra/3.0/cassandra/tools/toolsRepair.html
+# Start every Suterday at 10PM EST
+cron 'cassandra-nodetool-weekly-full-repair' do
+ minute "1"
+ hour "3"
+ weekday '1'
+ user "#{cassandra_user}"
+ command "#{installation_dir}/bin/nodetool repair --full -pr -seq --trace > /tmp/nodetool-repair.log 2>&1"
not_if { !node['unifiedpush']['cassandra']['schedule_repairs'] }
end
-cron 'cassandra-nodetool-full-repair' do
- minute "0"
- hour "2"
- day '1'
- user "root"
- command "#{installation_dir}/bin/nodetool repair --full -seq --trace > /tmp/nodetool-repair.log 2>&1"
- not_if { !node['unifiedpush']['cassandra']['schedule_repairs'] }
-end
-
|
Switch to weekly full repairs
|
diff --git a/api/ruby/gonit_api.gemspec b/api/ruby/gonit_api.gemspec
index abc1234..def5678 100644
--- a/api/ruby/gonit_api.gemspec
+++ b/api/ruby/gonit_api.gemspec
@@ -3,6 +3,7 @@ require 'gonit_api/version'
Gem::Specification.new do |s|
+ s.author = "Doug MacEachern"
s.name = 'gonit_api'
s.version = GonitApi::VERSION
s.summary = 'Gonit API client'
|
Put Doug as gem author.
Change-Id: Iee7f3f24583016efeb90d58eaa93f32996961e1a
|
diff --git a/ifsc.gemspec b/ifsc.gemspec
index abc1234..def5678 100644
--- a/ifsc.gemspec
+++ b/ifsc.gemspec
@@ -19,6 +19,6 @@
s.add_runtime_dependency 'httparty', '~> 0.16'
- s.add_development_dependency 'rake', '~> 12.3'
+ s.add_development_dependency 'rake', '~> 13.0'
s.add_development_dependency 'rspec', '~> 3.8'
end
|
Update rake requirement from ~> 12.3 to ~> 13.0
Updates the requirements on [rake](https://github.com/ruby/rake) to permit the latest version.
- [Release notes](https://github.com/ruby/rake/releases)
- [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc)
- [Commits](https://github.com/ruby/rake/compare/v12.3.0...v13.0.0)
Signed-off-by: dependabot-preview[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com>
|
diff --git a/spec/support/setup_dirs.rb b/spec/support/setup_dirs.rb
index abc1234..def5678 100644
--- a/spec/support/setup_dirs.rb
+++ b/spec/support/setup_dirs.rb
@@ -1,5 +1,5 @@ dirs = []
dirs << Rails.root.join('public', 'uploads', 'failed_imports')
-dirs.each{|dir| Fileutils.mkdir_p dir unless Dir.exist? dir}
+dirs.each{|dir| FileUtils.mkdir_p dir unless Dir.exist? dir}
|
Fix stupid typo in specs support file
|
diff --git a/lib/g5_integrations_validations/site_link_inventory_validations.rb b/lib/g5_integrations_validations/site_link_inventory_validations.rb
index abc1234..def5678 100644
--- a/lib/g5_integrations_validations/site_link_inventory_validations.rb
+++ b/lib/g5_integrations_validations/site_link_inventory_validations.rb
@@ -11,7 +11,7 @@ 'rent_now',
'rent_now_or_reservation',
'rent_now_or_reservation_with_fee',
- "rent_now_or_quote",
+ "rent_now_or_inquiry",
"rent_now_or_call",
]
|
Fix CTA value for consistency (use inquiry, not quote)
|
diff --git a/AlamoFuzi.podspec b/AlamoFuzi.podspec
index abc1234..def5678 100644
--- a/AlamoFuzi.podspec
+++ b/AlamoFuzi.podspec
@@ -16,7 +16,7 @@ s.dependency "Alamofire", "~> 4.0"
s.dependency "Fuzi", "~> 1.0"
- # Uncomment for `pod lib lint`
- # s.xcconfig = { 'HEADER_SEARCH_PATHS' => '$(SDKROOT)/usr/include/libxml2' }
+ # Uncomment for linting
+ s.xcconfig = { 'HEADER_SEARCH_PATHS' => '$(SDKROOT)/usr/include/libxml2' }
end
|
Add header search paths for first `pod spec lint`
|
diff --git a/bowling.rb b/bowling.rb
index abc1234..def5678 100644
--- a/bowling.rb
+++ b/bowling.rb
@@ -15,6 +15,8 @@ q.subscribe(:block => true) do |delivery_info, properties, body|
@var = body
puts " [x] Received #{body}"
+ conn.close
+ exit(0)
end
rescue Interrupt => _
conn.close
|
Exit from MQ Listining Loop Added
|
diff --git a/business.gemspec b/business.gemspec
index abc1234..def5678 100644
--- a/business.gemspec
+++ b/business.gemspec
@@ -16,7 +16,6 @@ spec.licenses = ["MIT"]
spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]
|
Drop unused "executables" gemspec directive
This gem exposes no executables.
|
diff --git a/Casks/querious.rb b/Casks/querious.rb
index abc1234..def5678 100644
--- a/Casks/querious.rb
+++ b/Casks/querious.rb
@@ -2,7 +2,6 @@ version '2.0_beta44'
sha256 '005784b7055bcf4252eb575d27e0bf799e52b829677f42e8281d44fbb5b1796c'
- # store.araelium.com/querious was verified as official when first introduced to the cask
url "https://store.araelium.com/querious/downloads/versions/Querious#{version}.zip"
appcast 'https://arweb-assets.s3.amazonaws.com/downloads/querious/prerelease-updates.xml',
checkpoint: '2e570e2810574f79930e093f50af8682cfc7b43d1b84c0118ae1b2c9122e2fc5'
|
Fix `url` stanza comment for Querious 2.
|
diff --git a/app/models/blog_comment.rb b/app/models/blog_comment.rb
index abc1234..def5678 100644
--- a/app/models/blog_comment.rb
+++ b/app/models/blog_comment.rb
@@ -13,7 +13,7 @@ )
# Validate email format
- validates :email, :format => {:with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i, :message => 'Please check your email address is correct'}
+ validates :email, :format => {:with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i, :message => 'Please check your email address is correct'}
def self.summary
select(%{
|
Fix the blog comments validation
|
diff --git a/app/models/email_signup.rb b/app/models/email_signup.rb
index abc1234..def5678 100644
--- a/app/models/email_signup.rb
+++ b/app/models/email_signup.rb
@@ -13,13 +13,13 @@
def save
if valid?
- ensure_govdelivery_topic_exists
+ ensure_subscriber_list_exists
true
end
end
- def ensure_govdelivery_topic_exists
- @ensure_govdelivery_topic_exists ||=
+ def ensure_subscriber_list_exists
+ @ensure_subscriber_list_exists ||=
Services.email_alert_api.find_or_create_subscriber_list(criteria)
end
@@ -28,11 +28,11 @@ end
def topic_id
- ensure_govdelivery_topic_exists['subscriber_list']['gov_delivery_id']
+ ensure_subscriber_list_exists['subscriber_list']['gov_delivery_id']
end
def govdelivery_url
- ensure_govdelivery_topic_exists['subscriber_list']['subscription_url']
+ ensure_subscriber_list_exists['subscriber_list']['subscription_url']
end
def description
|
Fix subscriber list method naming
What are these "govdelivery topics" you speak of?
|
diff --git a/recipes/disabled.rb b/recipes/disabled.rb
index abc1234..def5678 100644
--- a/recipes/disabled.rb
+++ b/recipes/disabled.rb
@@ -0,0 +1,11 @@+include_recipe "iptables::default"
+
+service "iptables" do
+ action [:disable, :stop]
+ supports :status => true, :start => true, :stop => true, :restart => true
+end
+
+service "ip6tables" do
+ action [:disable, :stop]
+ supports :status => true, :start => true, :stop => true, :restart => true
+end
|
Add recipe to disable iptables and ip6tables altogether.
|
diff --git a/groupify.gemspec b/groupify.gemspec
index abc1234..def5678 100644
--- a/groupify.gemspec
+++ b/groupify.gemspec
@@ -25,6 +25,6 @@
gem.add_development_dependency "rspec", ">= 3"
- gem.add_development_dependency "database_cleaner"
+ gem.add_development_dependency "database_cleaner", "~> 1.3.0"
gem.add_development_dependency "appraisal"
end
|
Fix specs by locking down database_cleaner
|
diff --git a/Formula/mejsel.rb b/Formula/mejsel.rb
index abc1234..def5678 100644
--- a/Formula/mejsel.rb
+++ b/Formula/mejsel.rb
@@ -0,0 +1,22 @@+require "formula"
+
+class Mejsel < Formula
+ depends_on "chisel"
+
+ homepage "https://github.com/boerworz/mejsel"
+ url "https://github.com/Boerworz/mejsel/archive/v0.1.tar.gz"
+ sha1 "99890d32ca7237d4fb3e90142600b87f4fa1d408"
+
+ def install
+ libexec.install Dir["*.py"]
+ end
+
+ def caveats; <<-EOS.undent
+ Add the following line to ~/.lldbinit to load mejsel when Xcode launches:
+ script fblldb.loadCommandsInDirectory("#{opt_libexec}")
+
+ Make sure that line occurs after the line that imports Chisel:
+ command script import #{opt_libexec}/fblldb.py
+ EOS
+ end
+end
|
Add a Formula for Mejsel
|
diff --git a/features/support/env.xdatabase_cleaner.rb b/features/support/env.xdatabase_cleaner.rb
index abc1234..def5678 100644
--- a/features/support/env.xdatabase_cleaner.rb
+++ b/features/support/env.xdatabase_cleaner.rb
@@ -1,15 +1,6 @@ begin
require "database_cleaner"
require "database_cleaner/cucumber"
-
- # TODO: NJH add comment why this here
- # exceptions = %w(
- # episode_types
- # fluid_description
- # organism_codes
- # roles
- # transplants_registration_status_descriptions
- # )
exceptions = %w(
bag_types
@@ -17,14 +8,17 @@ drug_types
drug_types_drugs
edta_codes
+ episode_types
ethnicities
event_types
+ fluid_description
hospital_centres
medication_routes
modality_descriptions
modality_reasons
organism_codes
prd_descriptions
+ roles
transplant_registration_status_descriptions
)
|
Exclude all other seeded tables from the database cleaner
|
diff --git a/app/models/tag.rb b/app/models/tag.rb
index abc1234..def5678 100644
--- a/app/models/tag.rb
+++ b/app/models/tag.rb
@@ -1,6 +1,8 @@ class Tag < ActiveRecord::Base
- has_and_belongs_to_many :ideas
+ has_and_belongs_to_many :ideas,
+ -> { order('rating') },
+ join_table: "idea_tags"
validates :name, presence: true, uniqueness: {case_sensitive: false}
|
Add attributes for Tag's Idea association
Specify the ordering of ideas when looking up 'tag.ideas' along with
the join table to look in. By default, Rails would look for the
'ideas_tags' table which doesn't exist. Instead, 'idea_tags' was
created.
|
diff --git a/db/migrate/20190221200439_change_topic_id_to_bigint.rb b/db/migrate/20190221200439_change_topic_id_to_bigint.rb
index abc1234..def5678 100644
--- a/db/migrate/20190221200439_change_topic_id_to_bigint.rb
+++ b/db/migrate/20190221200439_change_topic_id_to_bigint.rb
@@ -0,0 +1,21 @@+class ChangeTopicIdToBigint < ActiveRecord::Migration[6.0]
+ def up
+ change_column :topics, :id, :bigint
+
+ change_column :notifications, :topic_id, :bigint
+ change_column :replies, :topic_id, :bigint
+ change_column :reply_users, :topic_id, :bigint
+ change_column :subscriptions, :topic_id, :bigint
+ change_column :topic_users, :topic_id, :bigint
+ end
+
+ def down
+ change_column :topics, :id, :integer
+
+ change_column :notifications, :topic_id, :integer
+ change_column :replies, :topic_id, :integer
+ change_column :reply_users, :topic_id, :integer
+ change_column :subscriptions, :topic_id, :integer
+ change_column :topic_users, :topic_id, :integer
+ end
+end
|
Update topic_id primary and foreign keys to bigint
|
diff --git a/spec/rb/factories.rb b/spec/rb/factories.rb
index abc1234..def5678 100644
--- a/spec/rb/factories.rb
+++ b/spec/rb/factories.rb
@@ -18,17 +18,3 @@ center { [Faker::Geolocation.lat, Faker::Geolocation.lng] }
end
end
-
-class Line
- # FactoryGirl expects a #save! method in order use create(:line)
- def save!
- save or raise 'ahhh invalid record!'
- end
-end
-
-class Map
- # FactoryGirl expects a #save! method in order use create(:line)
- def save!
- save or raise 'ahhh invalid record!'
- end
-end
|
Remove monkey patches since it's handled as a sequel plugin now
|
diff --git a/config/initializers/jsonapi_resources.rb b/config/initializers/jsonapi_resources.rb
index abc1234..def5678 100644
--- a/config/initializers/jsonapi_resources.rb
+++ b/config/initializers/jsonapi_resources.rb
@@ -7,6 +7,6 @@ config.top_level_meta_include_record_count = true
config.top_level_meta_record_count_key = :record_count
- config.top_level_meta_include_page_count = true
- config.top_level_meta_page_count_key = :page_count
+ # config.top_level_meta_include_page_count = true
+ # config.top_level_meta_page_count_key = :page_count
end
|
Remove top-level page count, because that's not an option in this version of JR.
|
diff --git a/Casks/trailer.rb b/Casks/trailer.rb
index abc1234..def5678 100644
--- a/Casks/trailer.rb
+++ b/Casks/trailer.rb
@@ -1,6 +1,6 @@ cask :v1 => 'trailer' do
- version '1.3.6'
- sha256 'e42dabd6b7759fdd9a816f0c04c2eb6f7dd15c21de47048d8228f6bffd6dc41d'
+ version '1.3.7'
+ sha256 '9f022093051d6512a888cb1a0760afebed51e7c9f33dd991a81218f492491e55'
url "https://ptsochantaris.github.io/trailer/trailer#{version.delete('.')}.zip"
appcast 'https://ptsochantaris.github.io/trailer/appcast.xml',
|
Update Trailer to version 1.3.7
This commit updates the version and sha256 stanzas.
|
diff --git a/app/models/developer.rb b/app/models/developer.rb
index abc1234..def5678 100644
--- a/app/models/developer.rb
+++ b/app/models/developer.rb
@@ -1,8 +1,7 @@ class Developer < ActiveRecord::Base
- # Include default devise modules. Others available are:
- # :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :trackable, :validatable, :omniauthable
-
+ store_accessor :data, :bio, :html_url, :avatar_url, :company,
+ :blog, :location, :followers, :public_gists, :public_repos, :email, :hireable
def self.whitelisted_attributes
all_attributes - protected_attributes
@@ -21,5 +20,4 @@ def self.protected_attributes
[:access_token, :provider, :uid, :email]
end
-
end
|
Add store accessor for json field
|
diff --git a/app/models/masq/signup.rb b/app/models/masq/signup.rb
index abc1234..def5678 100644
--- a/app/models/masq/signup.rb
+++ b/app/models/masq/signup.rb
@@ -42,7 +42,7 @@ end
def make_default_persona
- account.public_persona = account.personas.build(:title => "Standard")
+ account.public_persona = account.personas.build(:title => "Standard", :email => account.email)
account.public_persona.deletable = false
account.public_persona.save!
end
|
Set email in default "Standard" personna
When signing up an account, set the email in the created "Standard" persona with the account's email.
Some websites use emails to match their signed up users to the open id
result. This will allow newly masq signed up user accounts to work out
of the box with these sites.
|
diff --git a/MD5Digest.podspec b/MD5Digest.podspec
index abc1234..def5678 100644
--- a/MD5Digest.podspec
+++ b/MD5Digest.podspec
@@ -8,5 +8,6 @@ s.source = { :git => "https://github.com/Keithbsmiley/MD5Digest.git", :tag => s.version.to_s }
s.source_files = 'NSString+MD5.{h,m}'
s.requires_arc = true
+ s.platform = :ios
+ s.platform = :osx
end
-
|
Add specific platforms (exclude watchOS)
|
diff --git a/app/services/referrals/capture_referral_action_service.rb b/app/services/referrals/capture_referral_action_service.rb
index abc1234..def5678 100644
--- a/app/services/referrals/capture_referral_action_service.rb
+++ b/app/services/referrals/capture_referral_action_service.rb
@@ -8,7 +8,7 @@
def initialize(referral:, amount:, info:)
@referral = referral
- @amount = amount
+ @amount = amount # instance of Money
@info = info
end
@@ -37,7 +37,8 @@ end
def update_partner_amount
- partner.update(amount: partner.amount + amount)
+ partner.increase_amount(amount)
+ partner.save
end
end
end
|
Call method directly on partner (Logic moved to partner class)
|
diff --git a/app/models/user_mailer.rb b/app/models/user_mailer.rb
index abc1234..def5678 100644
--- a/app/models/user_mailer.rb
+++ b/app/models/user_mailer.rb
@@ -16,7 +16,7 @@ def setup_email(user)
self.current_theme = (APP_CONFIG[:theme]||'default')
@recipients = "#{user.email}"
- @from = APP_CONFIG[:help_email]
+ @from = APP_CONFIG[:admin_email]
@subject = "[#{APP_CONFIG[:site_name]}] "
@sent_on = Time.now
@body[:user] = user
|
Revert "Send mail from the help_email address."
This reverts commit 34fd640839541503515e68142a6f64b919ffedfc.
|
diff --git a/spec/factories/systems.rb b/spec/factories/systems.rb
index abc1234..def5678 100644
--- a/spec/factories/systems.rb
+++ b/spec/factories/systems.rb
@@ -14,7 +14,7 @@ # limitations under the License.
FactoryGirl.define do
factory :system, class: System do
- name 'stack-12345678'
+ sequence(:name) { |n| "stack-#{n}" }
template_parameters '{}'
parameters '{}'
pattern { create(:pattern) }
|
Change the system name to be unique
|
diff --git a/spec/lib/services_spec.rb b/spec/lib/services_spec.rb
index abc1234..def5678 100644
--- a/spec/lib/services_spec.rb
+++ b/spec/lib/services_spec.rb
@@ -0,0 +1,19 @@+require "spec_helper"
+
+RSpec.describe Services do
+ describe ".with_timeout" do
+ it "executes a block of code with the defined services timeout" do
+ options = described_class.publishing_api.client.options
+
+ # Set default timeout
+ options[:timeout] = 1
+
+ expect(options).to receive(:[]=).with(:timeout, 30).once.and_call_original.ordered
+ expect(options).to receive(:[]=).with(:timeout, 1).once.and_call_original.ordered
+
+ result = described_class.with_timeout(30) { 2 + 3 }
+
+ expect(result).to eq(5)
+ end
+ end
+end
|
Add test coverage for function
|
diff --git a/lib/generators/arrthorizer/install/install_generator.rb b/lib/generators/arrthorizer/install/install_generator.rb
index abc1234..def5678 100644
--- a/lib/generators/arrthorizer/install/install_generator.rb
+++ b/lib/generators/arrthorizer/install/install_generator.rb
@@ -11,7 +11,45 @@ copy_file "config.yml", "config/arrthorizer.yml"
end
+ def activate_filter
+ insert_into_file 'app/controllers/application_controller.rb', filter_code, after: /class ApplicationController.*$/
+ insert_into_file 'app/controllers/application_controller.rb', context_preparation_code, before: /end$\s*\z/
+ end
+
protected
+ def filter_code
+ <<-FILTER_CODE
+
+ # Activate Arrthorizer's authorization checks for each
+ # request to this controller's actions
+ requires_authorization
+ FILTER_CODE
+ end
+
+ def context_preparation_code
+ <<-PREPARATION_CODE
+
+ # By default, configure Arrthorizer to provide all params,
+ # except for :controller and :action, as context to all
+ # ContextRoles.
+ to_prepare_context do |c|
+ c.defaults do
+ # this block must return a Hash-like object. It is
+ # advisable to put actual objects in this hash instead
+ # of ids and such. The block is executed within the
+ # controller, so all methods defined on the controller
+ # are available in this block.
+ params.except(:controller, :action)
+ end
+
+ # for specific actions, additional context can be defined
+ # c.for_action(:new) do
+ # arrthorizer_defaults.merge(key: 'value')
+ # end
+ end
+ PREPARATION_CODE
+ end
+
def gitkeep_for(directory)
directory.join('.gitkeep')
end
|
Add controller configuration for arrthorizer:install generator
|
diff --git a/lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb b/lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb
index abc1234..def5678 100644
--- a/lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb
+++ b/lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb
@@ -30,6 +30,8 @@
# TODO Need to decide how we are going to ensure settings like these
# are always excluded from the user's project.
+ #
+ # See https://github.com/CocoaPods/CocoaPods/issues/1216
@xcconfig.attributes.delete('USE_HEADERMAP')
@xcconfig
|
Add link to ticket to TODO.
|
diff --git a/lib/discordrb/events/lifetime.rb b/lib/discordrb/events/lifetime.rb
index abc1234..def5678 100644
--- a/lib/discordrb/events/lifetime.rb
+++ b/lib/discordrb/events/lifetime.rb
@@ -22,4 +22,10 @@
# Event handler for {DisconnectEvent}
class DisconnectEventHandler < TrueEventHandler; end
+
+ # @see Discordrb::EventContainer#heartbeat
+ class HeartbeatEvent < LifetimeEvent; end
+
+ # Event handler for {HeartbeatEvent}
+ class HeartbeatEventHandler < TrueEventHandler; end
end
|
Define an event and handler class for heartbeat events
|
diff --git a/lib/netsuite/records/location.rb b/lib/netsuite/records/location.rb
index abc1234..def5678 100644
--- a/lib/netsuite/records/location.rb
+++ b/lib/netsuite/records/location.rb
@@ -4,8 +4,10 @@ include Support::Fields
include Support::RecordRefs
include Support::Actions
+ include Namespaces::ListAcct
- actions :get
+ actions :add, :delete, :get, :get_list, :get_select_value, :search,
+ :update, :upsert
fields :addr1, :addr2, :addr3, :addr_phone, :addr_text, :addressee, :attention, :city, :country, :include_children,
:is_inactive, :make_inventory_available, :make_inventory_available_store, :name, :override, :state, :tran_prefix, :zip
|
Add missing actions for Location
|
diff --git a/app/models/api/v3/converter_stats_presenter.rb b/app/models/api/v3/converter_stats_presenter.rb
index abc1234..def5678 100644
--- a/app/models/api/v3/converter_stats_presenter.rb
+++ b/app/models/api/v3/converter_stats_presenter.rb
@@ -1,7 +1,11 @@ module Api
module V3
class ConverterStatsPresenter
- ATTRIBUTES = [:number_of_units].freeze
+ ATTRIBUTES = [
+ :demand,
+ :electricity_output_capacity,
+ :number_of_units
+ ].freeze
attr_reader :key
|
Send demand and elec. capacity with converter stats
|
diff --git a/app/overrides/admin_configuration_decorator.rb b/app/overrides/admin_configuration_decorator.rb
index abc1234..def5678 100644
--- a/app/overrides/admin_configuration_decorator.rb
+++ b/app/overrides/admin_configuration_decorator.rb
@@ -1,5 +1,4 @@ Deface::Override.new(:virtual_path => "spree/admin/shared/_configuration_menu",
:name => "add_social_products_to_configurations_menu",
:insert_bottom => "[data-hook='admin_configurations_sidebar_menu']",
- :partial => "spree/admin/shared/configurations_menu_social_products",
- :disabled => false)
+ :partial => "spree/admin/shared/configurations_menu_social_products")
|
Remove Deface "disabled" option in decorator.
|
diff --git a/app/workers/package_manager_download_worker.rb b/app/workers/package_manager_download_worker.rb
index abc1234..def5678 100644
--- a/app/workers/package_manager_download_worker.rb
+++ b/app/workers/package_manager_download_worker.rb
@@ -4,11 +4,54 @@ include Sidekiq::Worker
sidekiq_options queue: :critical
- def perform(class_name, name)
- return unless class_name.present?
+ PLATFORMS = {
+ alcatraz: PackageManager::Alcatraz,
+ atom: PackageManager::Atom,
+ biicode: PackageManager::Biicode,
+ bower: PackageManager::Bower,
+ cargo: PackageManager::Cargo,
+ carthage: PackageManager::Carthage,
+ clojars: PackageManager::Clojars,
+ cocoapods: PackageManager::CocoaPods,
+ conda: PackageManager::Conda,
+ cpan: PackageManager::CPAN,
+ cran: PackageManager::CRAN,
+ dub: PackageManager::Dub,
+ elm: PackageManager::Elm,
+ emacs: PackageManager::Emacs,
+ go: PackageManager::Go,
+ hackage: PackageManager::Hackage,
+ haxelib: PackageManager::Haxelib,
+ hex: PackageManager::Hex,
+ homebrew: PackageManager::Homebrew,
+ inqlude: PackageManager::Inqlude,
+ jam: PackageManager::Jam,
+ julia: PackageManager::Julia,
+ maven: PackageManager::Maven,
+ meteor: PackageManager::Meteor,
+ nimble: PackageManager::Nimble,
+ npm: PackageManager::NPM,
+ nuget: PackageManager::NuGet,
+ packagist: PackageManager::Packagist,
+ platformio: PackageManager::PlatformIO,
+ pub: PackageManager::Pub,
+ puppet: PackageManager::Puppet,
+ purescript: PackageManager::PureScript,
+ pypi: PackageManager::Pypi,
+ racket: PackageManager::Racket,
+ rubygems: PackageManager::Rubygems,
+ shards: PackageManager::Shards,
+ sublime: PackageManager::Sublime,
+ swiftpm: PackageManager::SwiftPM,
+ wordpress: PackageManager::Wordpress,
+ }.freeze
+
+ def perform(platform_name, name)
+ platform = PLATFORMS[platform_name&.downcase&.to_sym]
+ raise "Platform '#{platform_name}' not found" unless platform
# need to maintain compatibility with things that pass in the name of the class under PackageManager module
- logger.info("Beginning update for #{class_name}/#{name}")
- class_name.constantize.update(name)
+ logger.info("Beginning update for #{platform.to_s.demodulize}/#{name}")
+ platform.update(name)
end
end
|
Allow for various capitalizations of platforms in download worker job
|
diff --git a/lib/signed_form/action_controller/permit_signed_params.rb b/lib/signed_form/action_controller/permit_signed_params.rb
index abc1234..def5678 100644
--- a/lib/signed_form/action_controller/permit_signed_params.rb
+++ b/lib/signed_form/action_controller/permit_signed_params.rb
@@ -3,6 +3,8 @@ module PermitSignedParams
def self.included(base)
base.prepend_before_filter :permit_signed_form_data
+
+ gem 'strong_parameters' unless defined?(::ActionController::Parameters)
end
def permit_signed_form_data
|
Add strong_parameters gem on the fly.
|
diff --git a/lib/travis/build/appliances/fix_container_based_trusty.rb b/lib/travis/build/appliances/fix_container_based_trusty.rb
index abc1234..def5678 100644
--- a/lib/travis/build/appliances/fix_container_based_trusty.rb
+++ b/lib/travis/build/appliances/fix_container_based_trusty.rb
@@ -6,19 +6,16 @@ module Build
module Appliances
class FixContainerBasedTrusty < Base
- REDIS_INIT = '/etc/init.d/redis-server'
- private_constant :REDIS_INIT
-
def apply
sh.if sh_is_linux? do
sh.if sh_is_trusty? do
- patch_redis_init
+ # NOTE: no fixes currently needed :tada:
end
end
end
def apply?
- true
+ false
end
private
@@ -30,15 +27,6 @@ def sh_is_trusty?
'$(lsb_release -sc 2>/dev/null) = trusty'
end
-
- def patch_redis_init
- sh.if "-f #{REDIS_INIT}" do
- sh.echo 'Patching redis-server init script', ansi: :yellow
- sh.raw(
- %(sudo sed -i '/ulimit -n/s/ulimit.*/: no ulimit/g' #{REDIS_INIT})
- )
- end
- end
end
end
end
|
Revert "Revert "Remove redis server patch for container-based trusty""
|
diff --git a/lib/delayed/plugins/exception_notifier.rb b/lib/delayed/plugins/exception_notifier.rb
index abc1234..def5678 100644
--- a/lib/delayed/plugins/exception_notifier.rb
+++ b/lib/delayed/plugins/exception_notifier.rb
@@ -3,7 +3,8 @@ class ExceptionNotifier < Plugin
module Notify
def error(job, exception)
- ::ExceptionNotifier::Notifier.background_exception_notification(exception).deliver
+ ::ExceptionNotifier::Notifier.background_exception_notification(exception,
+ :data => { :job_id => job.id, :queue => job.queue }).deliver
super if defined?(super)
end
end
|
Add job_id and queue to the report
|
diff --git a/lib/gir_ffi/unintrospectable_type_info.rb b/lib/gir_ffi/unintrospectable_type_info.rb
index abc1234..def5678 100644
--- a/lib/gir_ffi/unintrospectable_type_info.rb
+++ b/lib/gir_ffi/unintrospectable_type_info.rb
@@ -4,7 +4,6 @@ # Represents a type not found in the GIR, conforming, as needed, to the
# interface of GObjectIntrospection::IObjectInfo.
class UnintrospectableTypeInfo
- include InfoExt::FullTypeName
attr_reader :g_type
def initialize gtype, gir = GObjectIntrospection::IRepository.default, gobject = GObject
@@ -33,10 +32,6 @@ parent.namespace
end
- def safe_namespace
- parent.safe_namespace
- end
-
def interfaces
@gobject.type_interfaces(@g_type).map do |gtype|
@gir.find_by_gtype gtype
|
Remove unused methods from UnintrospectableTypeInfo
|
diff --git a/interactor-contracts.gemspec b/interactor-contracts.gemspec
index abc1234..def5678 100644
--- a/interactor-contracts.gemspec
+++ b/interactor-contracts.gemspec
@@ -18,7 +18,7 @@ spec.files += Dir["lib/**/*.rb"]
spec.require_paths = ["lib"]
- spec.add_dependency "dry-validation"
+ spec.add_dependency "dry-validation", "~> 0.10"
spec.add_dependency "interactor", "~> 3"
spec.add_development_dependency "bundler", "~> 1.11"
|
Put a version constraint on dry-validation
|
diff --git a/lib/blacksand/expire_pages.rb b/lib/blacksand/expire_pages.rb
index abc1234..def5678 100644
--- a/lib/blacksand/expire_pages.rb
+++ b/lib/blacksand/expire_pages.rb
@@ -8,7 +8,9 @@
def expire_cache_pages
- expire_page root_path if defined? root_path
+ if defined? Rails.application.routes.url_helpers.root_path
+ expire_page Rails.application.routes.url_helpers.root_path
+ end
# TODO: 有点暴力, 可以扫描缓存文件夹,挨个删除
Blacksand::Page.find_each do |p|
|
Fix expiring root path page
|
diff --git a/lib/bonz/mat_general_mixin.rb b/lib/bonz/mat_general_mixin.rb
index abc1234..def5678 100644
--- a/lib/bonz/mat_general_mixin.rb
+++ b/lib/bonz/mat_general_mixin.rb
@@ -20,6 +20,7 @@ end
# Convert to single channel. If already single channel, return :self:.
+ # Assumes any 3- or 4-channel image is BGR(A) (not HSV).
def to_gray
case channel
when 1 then self
@@ -30,6 +31,17 @@ end
end
+ # Convert to BGR. If already BGR, return :self:. Assumes any 3- or
+ # 4-channel image is already BGR(A) (not HSV).
+ def to_bgr
+ case channel
+ when 1 then self.GRAY2BGR
+ when 3 then self
+ when 4 then self.BGRA2BGR
+ else split.first
+ end
+ end
+
module ClassMethods
def new_sized(size)
new(size.height, size.width)
|
Bring in burn_kit and use colorize for 16uc1 debug labels
|
diff --git a/RealmSwift.podspec b/RealmSwift.podspec
index abc1234..def5678 100644
--- a/RealmSwift.podspec
+++ b/RealmSwift.podspec
@@ -18,6 +18,8 @@ s.dependency 'Realm', "= #{s.version}"
s.source_files = 'RealmSwift/*.swift'
+ s.preserve_paths = %w(build.sh)
+
s.ios.deployment_target = '8.0'
s.osx.deployment_target = '10.9'
end
|
[Podspec] Add build.sh to the preserve_paths
|
diff --git a/lib/podio/models/stream_activity_group.rb b/lib/podio/models/stream_activity_group.rb
index abc1234..def5678 100644
--- a/lib/podio/models/stream_activity_group.rb
+++ b/lib/podio/models/stream_activity_group.rb
@@ -23,6 +23,12 @@ }.body
end
+ def find_by_event_id(ref_type, ref_id, event_id)
+ member Podio.connection.get { |req|
+ req.url("/stream/#{ref_type}/#{ref_id}/group/#{event_id}")
+ }.body
+ end
+
def find_for_data_ref(ref_type, ref_id, data_ref_type, data_ref_id)
member Podio.connection.get { |req|
req.url("/stream/#{ref_type}/#{ref_id}/activity_group/#{data_ref_type}/#{data_ref_id}")
|
Add find_by_event_id for activity groups
|
diff --git a/SwiftyVK.podspec b/SwiftyVK.podspec
index abc1234..def5678 100644
--- a/SwiftyVK.podspec
+++ b/SwiftyVK.podspec
@@ -16,4 +16,5 @@ s.osx.source_files = "Library/UI/macOS"
s.ios.resources = "Library/Resources/Bundles/SwiftyVK_resources_iOS.bundle"
s.osx.resources = "Library/Resources/Bundles/SwiftyVK_resources_macOS.bundle"
+ s.static_framework = true
end
|
[Cocoapods] Support for building as a static library
|
diff --git a/abfab.gemspec b/abfab.gemspec
index abc1234..def5678 100644
--- a/abfab.gemspec
+++ b/abfab.gemspec
@@ -4,8 +4,8 @@ Gem::Specification.new do |gem|
gem.authors = ["Chris Hanks"]
gem.email = ["christopher.m.hanks@gmail.com"]
- gem.description = %q{TODO: Write a gem description}
- gem.summary = %q{TODO: Write a gem summary}
+ gem.description = %q{A/B testing with Redis.}
+ gem.summary = %q{Fabulous A/B testing with persistence to Redis.}
gem.homepage = ""
gem.files = `git ls-files`.split($\)
|
Set up a gem description and summary.
|
diff --git a/lib/easymon/checks/active_record_mysql_writeable_check.rb b/lib/easymon/checks/active_record_mysql_writeable_check.rb
index abc1234..def5678 100644
--- a/lib/easymon/checks/active_record_mysql_writeable_check.rb
+++ b/lib/easymon/checks/active_record_mysql_writeable_check.rb
@@ -2,8 +2,11 @@ class ActiveRecordMysqlWriteableCheck
attr_accessor :klass
- def initialize(klass)
+ def initialize(klass, makara = false)
self.klass = klass
+ @query = "SELECT @@read_only"
+ # Trick makara into using the primary db
+ @query += " for UPDATE" if makara
end
def check
@@ -18,7 +21,7 @@
private
def database_writeable?
- klass.connection.execute("SELECT @@read_only").entries.flatten.first == 0
+ klass.connection.execute(@query).entries.flatten.first == 0
rescue
false
end
|
Add a makara flag to enable usage with makara to hit the primary
|
diff --git a/lib/geokit/geocoders/ipstack.rb b/lib/geokit/geocoders/ipstack.rb
index abc1234..def5678 100644
--- a/lib/geokit/geocoders/ipstack.rb
+++ b/lib/geokit/geocoders/ipstack.rb
@@ -27,7 +27,7 @@ loc.lng = result['longitude']
loc.country_code = result['country_code']
loc.country = result['country_name']
- loc.success = !loc.city.nil?
+ loc.success = !loc.country_code.nil?
loc
end
|
Modify IPStack success to check the country code
|
diff --git a/app/controllers/api/v1/performances_controller.rb b/app/controllers/api/v1/performances_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/api/v1/performances_controller.rb
+++ b/app/controllers/api/v1/performances_controller.rb
@@ -6,27 +6,47 @@ return render nothing: true, status: :not_found
end
+ ## Getting parameters
+
venue = Venue.find(params[:venue_id]) rescue nil
- # Parse given date assuming contest's local time zone
- local_tz = contest.host.time_zone
+ local_tz = contest.host.time_zone # Assume contest's local time zone
date = local_tz.parse(params[:date]) rescue nil
contest_category = ContestCategory.find(params[:contest_category_id]) rescue nil
- # TODO: Figure out param combinations that should lead to:
- #
- # return render nothing: true, status: :not_found
+ if results_public_filter = params[:results_public]
+ # Active filter has 'true' or 'false' value, 'nil' means inactive
+ results_public_value = results_public_filter == "1" ? true : false
+ end
+ ## Validation
+
+ # Require both venue and date if either is present
+ if !venue && date || venue && !date
+ return render nothing: true, status: :bad_request
+ end
+
+ ## Filtering
+
+ # Filter by venue and date
if venue && date
@performances = contest.staged_performances(venue, date)
else
@performances = contest.performances
end
+ # Filter by contest category
if contest_category
@performances = @performances.in_contest_category(contest_category)
end
+
+ # Filter by result publicity
+ if !results_public_value.nil?
+ @performances = @performances.where(results_public: results_public_value)
+ end
+
+ ## Fetching associations
@performances = @performances.includes(
{ appearances: [:instrument, :participant] },
|
Enhance filtering of API /performances
Performances returned from the API can now be filtered by venue+date,
contest category, result publicity, or any combination thereof.
|
diff --git a/easing.gemspec b/easing.gemspec
index abc1234..def5678 100644
--- a/easing.gemspec
+++ b/easing.gemspec
@@ -9,8 +9,7 @@ spec.authors = ['Damián Silvani']
spec.email = ['munshkr@gmail.com']
spec.description = %q{Collection of common easing functions for Ruby}
- spec.summary = %q{A port of known Robert Penner's easing functions for
- Ruby, implemented both in pure-Ruby and with FFI}
+ spec.summary = %q{A port of known Robert Penner's easing functions for Ruby}
spec.homepage = 'http://munshkr.github.io/easing-ruby'
spec.license = 'MIT'
|
Remove bit about FFI in gemspec description
|
diff --git a/spec/carpet_spec.rb b/spec/carpet_spec.rb
index abc1234..def5678 100644
--- a/spec/carpet_spec.rb
+++ b/spec/carpet_spec.rb
@@ -4,20 +4,21 @@
describe Carpet do
- subject do
- window = Gosu::Window.new(9, 9, false)
- Carpet.new(window, 'spec/fixtures/capital_i.png', 'spec/fixtures/capital_i.png')
+ let(:window) do
+ Gosu::Window.new(9, 9, false)
end
describe '#x' do
it 'should start horizontally centered' do
- expect(subject.x).to eq(4)
+ carpet = Carpet.new(window, 'spec/fixtures/capital_i.png', 'spec/fixtures/capital_i.png')
+ expect(carpet.x).to eq(4)
end
end
describe '#y' do
it 'should start in the lower three-fifths of the window' do
- expect(subject.y).to eq(5)
+ carpet = Carpet.new(window, 'spec/fixtures/capital_i.png', 'spec/fixtures/capital_i.png')
+ expect(carpet.y).to eq(5)
end
end
|
Remove subject because it's confusing
|
diff --git a/lib/beans.rb b/lib/beans.rb
index abc1234..def5678 100644
--- a/lib/beans.rb
+++ b/lib/beans.rb
@@ -1,8 +1,8 @@ require 'beans/version'
require 'beans/registry'
-Dir[File.dirname(__FILE__) + '/beans/entities/**/*.rb'].each { |f| require f }
-Dir[File.dirname(__FILE__) + '/beans/use_cases/**/*.rb'].each { |f| require f }
+Dir[File.dirname(__FILE__) + '/beans/entities/**/*.rb'].sort.each { |f| require f }
+Dir[File.dirname(__FILE__) + '/beans/use_cases/**/*.rb'].sort.each { |f| require f }
module Beans
extend UseCases::Bean
|
Sort required files to 'fix' dependency issues
|
diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/comments_controller.rb
+++ b/app/controllers/comments_controller.rb
@@ -2,8 +2,7 @@
def create
@comment = Comment.new(comment_params)
- # change user_id to grab from current user
- @comment.assign_attributes(user_id: 1, spot_id: params[:spot_id])
+ @comment.assign_attributes(user: current_user, spot_id: params[:spot_id])
if @comment.save
redirect_to spot_path(params[:spot_id])
end
@@ -19,6 +18,27 @@ @comment = Comment.new
end
+ def destroy
+ @comment = Comment.find(params[:id])
+ @comment.destroy
+ redirect_to spots_path
+ end
+
+ def edit
+ @spot = Spot.find(params[:spot_id])
+ @comment = Comment.find(params[:id])
+ end
+
+ def update
+ @spot = Spot.find(params[:spot_id])
+ @comment = Comment.find(params[:id])
+ if @comment.update(comment_params)
+ redirect_to spot_path(@spot)
+ else
+ redirect_to edit_spot_comment_path(@spot, @comment)
+ end
+ end
+
private
def comment_params
|
Add update, edit and destroy methods for comments
|
diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/sessions_controller.rb
+++ b/app/controllers/sessions_controller.rb
@@ -1,6 +1,6 @@ # -*- coding: utf-8 -*-
class SessionsController < ApplicationController
- before_filter :logged_in_user, only: [:destroy]
+ before_action :logged_in_user, only: [:destroy]
def create
if valid_credentials?(params[:email], params[:password])
|
Fix DEPRECATION: Use before_action instead of before_filter
|
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
@@ -4,7 +4,7 @@
Coveralls.wear!
-SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new [
+SimpleCov.formatters = [
SimpleCov::Formatter::HTMLFormatter,
CodeClimate::TestReporter::Formatter,
Coveralls::SimpleCov::Formatter
|
Use alternative way for specifying multiple simplecov formatters
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -9,6 +9,12 @@
if ENV['COVERAGE'] == 'true'
require 'simplecov'
+ require 'coveralls'
+
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
+ SimpleCov::Formatter::HTMLFormatter,
+ Coveralls::SimpleCov::Formatter
+ ]
SimpleCov.start do
command_name 'spec:unit'
|
Add coveralls to spec helper
|
diff --git a/lib/ruboty/jira/actions/base.rb b/lib/ruboty/jira/actions/base.rb
index abc1234..def5678 100644
--- a/lib/ruboty/jira/actions/base.rb
+++ b/lib/ruboty/jira/actions/base.rb
@@ -37,7 +37,9 @@ end
def use_ssl
- ENV["JIRA_USE_SSL"] || true
+ value = ENV['JIRA_USE_SSL']
+ return value unless value.nil?
+ true
end
def memory
|
Fix return value when JIRA_USE_SSL is false
|
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
@@ -4,6 +4,7 @@ require 'rspec/rails'
require 'rspec/autorun'
require 'capybara/rails'
+require 'fabrication'
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
|
Initialize Factories for the 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
@@ -10,6 +10,7 @@ end
require 'rom'
+require 'byebug'
root = Pathname(__FILE__).dirname
|
Add byebug (useful for debugging)
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -9,8 +9,10 @@ require 'simplecov'
SimpleCov.start do
add_filter "/vendor/"
+ add_filter "/vendor.noindex/"
add_filter "/bin/"
add_filter "/spec/"
+ add_filter "/coverage/" # It used to do this for some reason, defensive of me.
end
|
Put some extra reins on Simplecov.
|
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,4 +7,7 @@ rescue LoadError
end
+# https://github.com/geemus/excon/issues/142#issuecomment-8531521
+Excon.defaults[:nonblock] = false if RUBY_PLATFORM == 'java'
+
require 'peddler'
|
Use blocking connect if running on JRuby
|
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
@@ -5,5 +5,5 @@ RSpec.configure do |config|
config.log_level = :error
config.platform = 'ubuntu'
- config.version = '12.04' # needs to be 13.04 when fauxhai gets that data
+ config.version = '14.04'
end
|
Set the spec ubuntu version to 14.04
|
diff --git a/lib/tasks/copy_taxon_title.rake b/lib/tasks/copy_taxon_title.rake
index abc1234..def5678 100644
--- a/lib/tasks/copy_taxon_title.rake
+++ b/lib/tasks/copy_taxon_title.rake
@@ -0,0 +1,12 @@+desc "copy taxons title field to internal name"
+task copy_taxons_title: :environment do
+ total = RemoteTaxons.new.search.search_response["total"]
+ taxons = RemoteTaxons.new.search(per_page: total).taxons
+
+ taxons.each do |taxon|
+ next unless taxon.internal_name.empty?
+
+ taxon.internal_name = taxon.title
+ Taxonomy::PublishTaxon.call(taxon: taxon)
+ end
+end
|
Add rake task to populate the taxons internal name
Some taxons internal name have not been populated, we solve this by using their title.
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -7,4 +7,5 @@ get "/auth/failure" => "auth0#failure"
post "/groups/assign", to: "groups#assign"
+
end
|
Add a route for requesting a chatpage.
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -6,6 +6,7 @@
get "/profile/:user_id", to: "users#show", as: 'user_profile'
get "/profile/:user_id/edit", to: "users#edit", as: 'edit_user_profile'
+ post "/profile/:user_id/update", to: "users#update", as: 'update_user_profile'
get "/profiles", to: "users#index", as: 'user_profiles'
get '/verification', to: 'verification#show'
|
Add update user profile route.
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -8,9 +8,11 @@ resources :shares, only: [:index, :create, :new]
resources :timeslots, only: [:update, :show]
+
namespace :api, defaults: {format: :json} do
patch 'timeslots/:id/cancel', to: 'timeslots#cancel', as: :cancel
resources :timeslots, only: [:index, :create, :update, :destroy]
+ resources :users, only: [:update]
end
get "/404", :to => "errors#not_found"
|
Add route for PATCH /api/users/:id
Add route to update user profile information.
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -13,6 +13,7 @@ match '/search/:loc_code' => 'schools#search', via: [:get], as: "search"
# misc
+ get '/bitly/new' => 'bitly#new'
# get '/random' => 'schools#random40'
|
Add route for ajax version of bitly linking - not being used right now
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,9 +1,10 @@ Rails.application.routes.draw do
- get 'static_pages/home'
-
# Render legal documents by using Keiyaku CSS
# https://github.com/cognitom/keiyaku-css
resources :docs, only: [:index, :show]
+
+ # Static Pages
+ root "static_pages#home"
# Redirects
get "/releases/2016/12/12/new-backend", to: redirect('/news/2016/12/12/new-backend')
@@ -19,7 +20,6 @@
# Default Scrivito routes. Adapt them to change the routing of CMS objects.
# See the documentation of 'scrivito_route' for a detailed description.
- scrivito_route '/', using: 'homepage'
scrivito_route '(/)(*slug-):id', using: 'slug_id'
scrivito_route '/*permalink', using: 'permalink', format: false
end
|
Change root routing from Scrivito to StaticPages
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,4 +1,5 @@ Rails.application.routes.draw do
root "welcome#index"
get '/issues', to: 'welcome#issues'
+ get '/positions', to: 'welcome#positions'
end
|
Add /positions route for ajax call.
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,8 +1,8 @@ Teikei::Application.routes.draw do
namespace :api do
namespace :v1 do
- resources :farms
- resources :depots
+ resources :farms, except: [:new, :edit]
+ resources :depots, except: [:new, :edit]
end
end
resources :farms
|
Disable actions unnecessary for APIs.
|
diff --git a/ext/extconf.rb b/ext/extconf.rb
index abc1234..def5678 100644
--- a/ext/extconf.rb
+++ b/ext/extconf.rb
@@ -2,7 +2,7 @@
dir_config('lua5.1')
-unless have_library('lua5.1', 'luaL_newstate')
+unless have_library('lua5.1', 'luaL_newstate') or have_library('lua.5.1', 'luaL_newstate')
puts ' extconf failure: need liblua5.1'
exit 1
end
|
Fix library search to accomodate different dot style.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.