diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/db/data_migration/20160913172039_add_related_mainstream_record_for_detailed_guides.rb b/db/data_migration/20160913172039_add_related_mainstream_record_for_detailed_guides.rb
index abc1234..def5678 100644
--- a/db/data_migration/20160913172039_add_related_mainstream_record_for_detailed_guides.rb
+++ b/db/data_migration/20160913172039_add_related_mainstream_record_for_detailed_guides.rb
@@ -0,0 +1,55 @@+RelatedMainstream.destroy_all
+
+guides = DetailedGuide.where([
+ "related_mainstream_content_url IS NOT NULL
+ AND related_mainstream_content_url != ''
+ AND state != 'superseded'"
+ ])
+related_mainstream_not_found = []
+n = 0
+guides.each do |guide|
+ guide.send(:fetch_related_mainstream_content_ids)
+ if guide.content_ids[0].nil?
+ related_mainstream_not_found << guide.id
+ else
+ n+=1
+ end
+ guide.send(:persist_content_ids)
+ p "#{n}/#{guides.count}"
+ p guide.related_mainstream
+end
+
+p "---"
+p "Additional related mainstream content"
+p "---"
+
+additional_guides = DetailedGuide.where([
+ "additional_related_mainstream_content_url IS NOT NULL
+ AND additional_related_mainstream_content_url != ''
+ AND state != 'superseded'"
+ ])
+additional_related_mainstream_not_found = []
+n = 0
+additional_guides.each do |guide|
+ guide.send(:fetch_related_mainstream_content_ids)
+ if guide.content_ids[0].nil?
+ additional_related_mainstream_not_found << guide.id
+ else
+ n+=1
+ end
+ guide.send(:persist_content_ids)
+ p "#{n}/#{additional_guides.count}"
+ p guide.related_mainstream
+end
+
+p "Related mainstream found: #{n}/#{guides.count}"
+p "Additional related mainstream found: #{n}/#{additional_guides.count}"
+p "---"
+p "Guides where related mainstream was not found: #{related_mainstream_not_found}"
+p "Guides where additional related mainstream was not found: #{additional_related_mainstream_not_found}"
+p "---"
+p "Related mainstream urls not found"
+related_mainstream_not_found.each { |id| p DetailedGuide.find(id).related_mainstream_content_url }
+p "---"
+p "Additional related mainstream urls not found"
+additional_related_mainstream_not_found.each { |id| p DetailedGuide.find(id).additional_related_mainstream_content_url }
|
Create RelatedMainstream record for existing guides
Published detailed guides with related mainstream urls need to
find the content_id of the content item and persist it.
|
diff --git a/test/test_default_commands/test_find_method.rb b/test/test_default_commands/test_find_method.rb
index abc1234..def5678 100644
--- a/test/test_default_commands/test_find_method.rb
+++ b/test/test_default_commands/test_find_method.rb
@@ -1,35 +1,42 @@ require 'helper'
-MyKlass = Class.new do
- def hello
- "timothy"
- end
- def goodbye
- "jenny"
- end
-end
-
-describe "find-command" do
- describe "find matching methods by name regex (-n option)" do
- it "should find a method by regex" do
- mock_pry("find-method hell MyKlass").should =~ /MyKlass.*?hello/m
+# we turn off the test for MRI 1.8 because our source_location hack
+# for C methods actually runs the methods - and since it runs ALL
+# methods (in an attempt to find a match) it runs 'exit' and aborts
+# the test, causing a failure. We should fix this in the future by
+# blacklisting certain methods for 1.8 MRI (such as exit, fork, and so on)
+if !(RUBY_VERSION["1.8"] && !defined?(RUBY_ENGINE))
+ MyKlass = Class.new do
+ def hello
+ "timothy"
end
-
- it "should NOT match a method that does not match the regex" do
- mock_pry("find-method hell MyKlass").should.not =~ /MyKlass.*?goodbye/m
+ def goodbye
+ "jenny"
end
end
- describe "find matching methods by content regex (-c option)" do
- it "should find a method by regex" do
- mock_pry("find-method -c timothy MyKlass").should =~ /MyKlass.*?hello/m
+ describe "find-command" do
+ describe "find matching methods by name regex (-n option)" do
+ it "should find a method by regex" do
+ mock_pry("find-method hell MyKlass").should =~ /MyKlass.*?hello/m
+ end
+
+ it "should NOT match a method that does not match the regex" do
+ mock_pry("find-method hell MyKlass").should.not =~ /MyKlass.*?goodbye/m
+ end
end
- it "should NOT match a method that does not match the regex" do
- mock_pry("find-method timothy MyKlass").should.not =~ /MyKlass.*?goodbye/m
+ describe "find matching methods by content regex (-c option)" do
+ it "should find a method by regex" do
+ mock_pry("find-method -c timothy MyKlass").should =~ /MyKlass.*?hello/m
+ end
+
+ it "should NOT match a method that does not match the regex" do
+ mock_pry("find-method timothy MyKlass").should.not =~ /MyKlass.*?goodbye/m
+ end
end
+
end
-
+
+ Object.remove_const(:MyKlass)
end
-
-Object.remove_const(:MyKlass)
|
Revert "Revert "prevent find_method test running on MRI 1.8""
This reverts commit c2f06f3da27e30fa2ebdb68ba4f9e384df64607f.
Should not have been reverted...
|
diff --git a/app/controllers/announce_controller.rb b/app/controllers/announce_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/announce_controller.rb
+++ b/app/controllers/announce_controller.rb
@@ -31,9 +31,9 @@ faye.update
end
- channel '/announce' do
- monitor :publish do
- ApplicationHelper.log "Client #{client_id} published #{data.inspect} to #{channel}."
- end
- end
+ # channel '/announce' do
+ # monitor :publish do
+ # ApplicationHelper.log "Client #{client_id} published #{data.inspect} to #{channel}."
+ # end
+ # end
end
|
Disable /announce logging monitor so production env works
This bug in faye-rails is preventing us from starting in production mode:
https://github.com/jamesotron/faye-rails/issues/27
|
diff --git a/app/controllers/feedback_controller.rb b/app/controllers/feedback_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/feedback_controller.rb
+++ b/app/controllers/feedback_controller.rb
@@ -6,7 +6,7 @@ # 3 or later. See the LICENSE file.
class FeedbackController < ApplicationController
- before_filter :authenticate_user!
+ before_filter :authenticate_user!, except: [:webconf]
def webconf
feedback_url = current_site.feedback_url
|
Add authentication to Feedback form
refs #1554
|
diff --git a/app/controllers/patients_controller.rb b/app/controllers/patients_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/patients_controller.rb
+++ b/app/controllers/patients_controller.rb
@@ -35,6 +35,8 @@ end
end
+ private
+
def patients_params
params.require(:patient).permit(:first_name, :last_name, :birthday, :gender, :height, :weight, :email)
end
|
Add private declaration to patients controller
|
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -1,7 +1,7 @@ class ProjectsController < ApplicationController
def new
- if true #is_professor?
+ if is_professor?
#@professor = current_professor
@students = Student.all
@project = Project.new
@@ -11,10 +11,9 @@ end
def create
- if true #is_professor?
- new_project = Project.new(title: params[:project][:title], hypothesis: params[:project][:hypothesis], summary: params[:project][:summary], time_budget: params[:project][:time_budget], professor_id: 1)
+ if is_professor?
+ new_project = Project.new(title: params[:project][:title], hypothesis: params[:project][:hypothesis], summary: params[:project][:summary], time_budget: params[:project][:time_budget], professor_id: current_user)
if new_project.save
- p params
# Create a record for each new array of students.
i = 1
while i < params[:students][:ids].length + 1
|
Integrate the helper methods back into the projects controller and remove the p params
|
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
@@ -6,7 +6,8 @@ end
def make_teacher
- if current_user.update(role: 'teacher', email: params[:email])
+ params[:role] = 'teacher' unless params[:role] == 'student'
+ if current_user.update(role: params[:role], email: params[:email])
render json: {status: 200}
else
render json: {errors: 'Please enter a valid email address.'}, status: 422
|
Allow make_teachers to make students
|
diff --git a/app/models/ontology/import_mappings.rb b/app/models/ontology/import_mappings.rb
index abc1234..def5678 100644
--- a/app/models/ontology/import_mappings.rb
+++ b/app/models/ontology/import_mappings.rb
@@ -1,4 +1,7 @@ class Ontology
+ # An ontology being imported into is in this context not only a Mapping with
+ # kind 'import' but any kind of mapping. Otherwise the target ontology's view,
+ # alignment, etc. is invalid.
module ImportMappings
extend ActiveSupport::Concern
@@ -32,7 +35,7 @@ protected
def import_mappings
- Mapping.where(source_id: id, kind: 'import')
+ Mapping.where(source_id: id)
end
def import_mappings_from_other_files
|
Remove mapping kind 'import' restriction.
|
diff --git a/lib/graphql/tracing/skylight_tracing.rb b/lib/graphql/tracing/skylight_tracing.rb
index abc1234..def5678 100644
--- a/lib/graphql/tracing/skylight_tracing.rb
+++ b/lib/graphql/tracing/skylight_tracing.rb
@@ -18,6 +18,12 @@ if (query = data[:query])
title = query.selected_operation_name || "<anonymous>"
category = platform_key
+ # Assign the endpoint so that queries will be grouped
+ current_instance = Skylight::Instrumenter.instance
+ if current_instance
+ endpoint = "GraphQL/#{query.operation_type}.#{title}"
+ current_instance.current_trace.endpoint = endpoint
+ end
elsif key.start_with?("execute_field")
title = platform_key
category = key
|
Support grouping by "endpoint" with skylight instrumentation
This will cause queries with the same name to be grouped together
|
diff --git a/lib/serverspec/type/x509_private_key.rb b/lib/serverspec/type/x509_private_key.rb
index abc1234..def5678 100644
--- a/lib/serverspec/type/x509_private_key.rb
+++ b/lib/serverspec/type/x509_private_key.rb
@@ -3,8 +3,8 @@ module Serverspec::Type
class X509PrivateKey < Base
def valid?
- runner_res = @runner.run_command("openssl rsa -in #{name} -check -noout")
- ( runner_res.exit_status == 0 && runner_res.stdout.chomp == 'RSA key ok' )
+ runner_res = @runner.run_command("echo | openssl rsa -in #{name} -check -noout -passin #{@options[:passin] || "stdin"}")
+ ( runner_res.exit_status == 0 && runner_res.stdout.chomp == 'RSA key ok' ) && (!@options.has_key?(:passin) || encrypted?)
end
def encrypted?
@@ -13,7 +13,7 @@
def has_matching_certificate?(cert_file)
h1 = @runner.run_command("openssl x509 -noout -modulus -in #{cert_file}")
- h2 = @runner.run_command("openssl rsa -noout -modulus -in #{name}")
+ h2 = @runner.run_command("echo | openssl rsa -noout -modulus -in #{name} -passin #{@options[:passin] || "stdin"}")
(h1.stdout == h2.stdout) && (h1.exit_status == 0) && (h2.exit_status == 0)
end
end
|
Add support for X.509 encrypted private key
X509PrivateKey#valid?
- uses the @options[:passin] as the argument for "openssl rsa -passin" option
- if the @options[:passin] is set, it requires that the private key be encrypted
- if the @options[:passin] is not set, "echo | openssl rsa -passin stdin" is used so the check will not stop responding if the private key is encrypted and the password is not provided
X509PrivateKey#has_matching_certificate?
- uses the @options[:passin] as the argument for "openssl rsa -passin" option
- if the @options[:passin] is not set, "echo | openssl rsa -passin stdin" is used so the check will not stop responding if the private key is encrypted and the password is not provided
Usage:
description x509_private_key(KEY_FILE, {:passin => "pass:PASSPHRASE"}) do
it { is_expected.to be_encrypted }
it { is_expected.to be_valid }
it { is_expected.to have_matching_certificate(crt) }
end
|
diff --git a/lib/trogdir_api_client/configuration.rb b/lib/trogdir_api_client/configuration.rb
index abc1234..def5678 100644
--- a/lib/trogdir_api_client/configuration.rb
+++ b/lib/trogdir_api_client/configuration.rb
@@ -7,18 +7,20 @@
attr_accessor :scheme
attr_accessor :host
+ attr_accessor :port
attr_accessor :script_name
attr_accessor :version
def initialize
@scheme = 'https'
@host = 'api.biola.edu'
+ @port = nil
@script_name = 'directory'
@version = 'v1'
end
def base_url
- URI.join(root_url, "/#{script_name}/", version).to_s
+ URI.join(root_url.to_s, "/#{script_name}/", version).to_s
end
def credentials
@@ -28,7 +30,7 @@ private
def root_url
- URI::Generic.build(scheme: scheme, host: host)
+ URI::Generic.build(scheme: scheme, host: host, port: port)
end
end
-end+end
|
Support specifying port in Trogdir URL
|
diff --git a/lib/hyperflow-amqp-executor.rb b/lib/hyperflow-amqp-executor.rb
index abc1234..def5678 100644
--- a/lib/hyperflow-amqp-executor.rb
+++ b/lib/hyperflow-amqp-executor.rb
@@ -36,7 +36,7 @@ data = payload
data['timestamp'] = Time.now.utc.to_f
data['type'] = type
- data['worker'] = @id
+ data['executor'] = @id
EM.next_tick do
logger.debug "Publishing event #{type}"
@events_exchange.publish(JSON.dump(data), content_type: 'application/json', routing_key: routing_key)
|
Change worker id to executor id key name
|
diff --git a/lib/rehearsal/configuration.rb b/lib/rehearsal/configuration.rb
index abc1234..def5678 100644
--- a/lib/rehearsal/configuration.rb
+++ b/lib/rehearsal/configuration.rb
@@ -3,9 +3,31 @@ attr_accessor :auth_envs, :banner_envs, :enabled
def initialize
+ initialize_from_hidden_file!
+
@auth_envs ||= [:staging]
@banner_envs ||= [:staging]
- @enabled = !@enabled.nil?
+ @enabled = true if enabled.nil?
+ end
+
+ private
+ def initialize_from_hidden_file!
+ return unless File.exist?(hidden_file_path)
+
+ file = File.open(hidden_file_path)
+ config = YAML.load(file)
+
+ config.each do |attr, value|
+ if value.respond_to?(:split)
+ value = value.split(',').map(&:strip).map(&:to_sym)
+ end
+
+ self.send("#{attr}=", value)
+ end
+ end
+
+ def hidden_file_path
+ "#{Rails.root}/.rehearsal"
end
end
end
|
Allow config to read from hidden .rehearsal user config
|
diff --git a/lib/rspec/request_describer.rb b/lib/rspec/request_describer.rb
index abc1234..def5678 100644
--- a/lib/rspec/request_describer.rb
+++ b/lib/rspec/request_describer.rb
@@ -48,7 +48,7 @@
let(:endpoint_segments) do
current_example = RSpec.respond_to?(:current_example) ? RSpec.current_example : example
- current_example.full_description.match(/(#{SUPPORTED_METHODS.join("|")}) ([\/a-z0-9_:\-]+)/).to_a
+ current_example.full_description.match(/(#{SUPPORTED_METHODS.join("|")}) (\S+)/).to_a
end
let(:method) do
|
Allow any non-space characters in URL path
|
diff --git a/spec/ico_validator_spec.rb b/spec/ico_validator_spec.rb
index abc1234..def5678 100644
--- a/spec/ico_validator_spec.rb
+++ b/spec/ico_validator_spec.rb
@@ -9,10 +9,12 @@ describe IcoValidator do
subject { Validatable.new }
- it 'ICO is valid with string value in right format' do
- subject.ico = '61499609'
+ ['61499609', '25275500', '29233011'].each do |valid_ico|
+ it "ICO #{valid_ico} is valid" do
+ subject.ico = valid_ico
- expect(subject).to be_valid
+ expect(subject).to be_valid
+ end
end
it "ICO is valid with integer value in right format" do
|
Add test for full test coverage
|
diff --git a/spec/models/course_spec.rb b/spec/models/course_spec.rb
index abc1234..def5678 100644
--- a/spec/models/course_spec.rb
+++ b/spec/models/course_spec.rb
@@ -6,5 +6,11 @@ expect(factory).to be_valid, lambda { factory.errors.full_messages.join("\n") }
end
+ it "saves department as uppercase" do
+ FactoryGirl.create(:course, department: "mAtH")
+ saved = Course.first
+ expect(saved[:department]).to eq("MATH")
+ end
+
it "allows no null values"
end
|
Add model test for uppercase callback
|
diff --git a/db/migrate/20150615080039_delete_policies_and_supporting_pages.rb b/db/migrate/20150615080039_delete_policies_and_supporting_pages.rb
index abc1234..def5678 100644
--- a/db/migrate/20150615080039_delete_policies_and_supporting_pages.rb
+++ b/db/migrate/20150615080039_delete_policies_and_supporting_pages.rb
@@ -0,0 +1,77 @@+class DeletePoliciesAndSupportingPages < ActiveRecord::Migration
+ def up
+ document_ids = Document.where(document_type: [
+ "SupportingPage",
+ "Policy",
+ ]).pluck(:id)
+
+ edition_ids = Edition.where(document_id: document_ids).pluck(:id)
+
+ puts "Deleting data (but not tables) for #{edition_ids.count} policy and supporting page editions and #{document_ids.count} documents"
+
+ [
+ ClassificationFeaturing,
+ ConsultationParticipation,
+ EditionAuthor,
+ EditionDependency,
+ EditionMainstreamCategory,
+ EditionOrganisation,
+ EditionPolicyGroup,
+ EditionRelation,
+ EditionRoleAppointment,
+ EditionStatisticalDataSet,
+ EditionWorldLocation,
+ EditionWorldwideOrganisation,
+ EditorialRemark,
+ FactCheckRequest,
+ Image,
+ NationInapplicability,
+ RecentEditionOpening,
+ Response,
+ SpecialistSector,
+ Unpublishing,
+ ].each do |edition_join_model|
+ join_models = edition_join_model.where(edition_id: edition_ids)
+ puts "Deleting all #{join_models.count} #{edition_join_model} edition join models"
+ join_models.delete_all
+ end
+
+ [
+ DocumentCollectionGroupMembership,
+ DocumentSource,
+ EditionRelation,
+ EditionStatisticalDataSet,
+ Feature,
+ ].each do |document_join_model|
+ join_models = document_join_model.where(document_id: document_ids)
+ puts "Deleting all #{join_models.count} #{document_join_model} document join models"
+ join_models.delete_all
+ end
+
+ puts "Deleting all edition dependencies"
+ EditionDependency.where(
+ dependable_id: edition_ids,
+ dependable_type: "Edition",
+ ).delete_all
+
+ db = Edition.connection
+
+ %w[
+ editioned_supporting_page_mappings
+ featured_items
+ featured_topics_and_policies_lists
+ supporting_page_redirects
+ ].each do |table|
+ puts "Deleting all #{table}"
+ db.delete("DELETE FROM #{table}")
+ end
+
+ puts "Deleting all editions"
+ Edition.find(edition_ids).each do |edition|
+ Whitehall.edition_services.deleter(edition).perform!
+ end
+ end
+end
+
+class Policy < Edition; end
+class SupportingPage < Edition; end
|
Delete all supporting page and policy data.
This needs to execute before the code is loaded
in order to prevent STI issues when the editions
try to be loaded via associations such as featuring.
Keeps documents, editions, and edition translations
as per usual deletion mechanism.
|
diff --git a/db/migrate/20210120205850_move_default_settings_to_root_config.rb b/db/migrate/20210120205850_move_default_settings_to_root_config.rb
index abc1234..def5678 100644
--- a/db/migrate/20210120205850_move_default_settings_to_root_config.rb
+++ b/db/migrate/20210120205850_move_default_settings_to_root_config.rb
@@ -0,0 +1,21 @@+# frozen_string_literal: true
+
+class MoveDefaultSettingsToRootConfig < ActiveRecord::Migration[6.0]
+ def up
+ return unless configatron.key?(:default_settings)
+ root_setting = Setting.root
+ root_setting.default_outgoing_sms_adapter = fetch_default_setting(:outgoing_sms_adapter)
+ root_setting.twilio_account_sid = fetch_default_setting(:twilio_account_sid)
+ root_setting.twilio_auth_token = fetch_default_setting(:twilio_auth_token)
+ root_setting.twilio_phone_number = fetch_default_setting(:twilio_phone_number)
+ root_setting.frontlinecloud_api_key = fetch_default_setting(:frontlinecloud_api_key)
+ root_setting.save!
+ end
+
+ private
+
+ def fetch_default_setting(key)
+ return unless configatron.default_settings.key?(key)
+ configatron.default_settings[key]
+ end
+end
|
10398: Add migration to move configatron default settings to root config
|
diff --git a/spec/protocop/wire_spec.rb b/spec/protocop/wire_spec.rb
index abc1234..def5678 100644
--- a/spec/protocop/wire_spec.rb
+++ b/spec/protocop/wire_spec.rb
@@ -0,0 +1,32 @@+require "spec_helper"
+
+describe Protocop::Wire do
+
+ describe "::VARINT" do
+
+ it "returns 0" do
+ expect(Protocop::Wire::VARINT).to eq(0)
+ end
+ end
+
+ describe "::BIT64" do
+
+ it "returns 1" do
+ expect(Protocop::Wire::BIT64).to eq(1)
+ end
+ end
+
+ describe "::LENGTH" do
+
+ it "returns 2" do
+ expect(Protocop::Wire::LENGTH).to eq(2)
+ end
+ end
+
+ describe "::BIT32" do
+
+ it "returns 5" do
+ expect(Protocop::Wire::BIT32).to eq(5)
+ end
+ end
+end
|
Add specs for wire to guard constant change
|
diff --git a/lib/graphql/railtie.rb b/lib/graphql/railtie.rb
index abc1234..def5678 100644
--- a/lib/graphql/railtie.rb
+++ b/lib/graphql/railtie.rb
@@ -15,12 +15,22 @@ Dir[dir].each do |file|
# Members (types, interfaces, etc.)
if file =~ /.*_(type|interface|enum|union|)\.rb$/
- upgrader = GraphQL::Upgrader::Member.new File.read(file)
- next unless upgrader.upgradeable?
+ Rake::Task["graphql:upgrade:member"].execute(Struct.new(:member_file).new(file))
+ end
+ end
+ end
- puts "- Transforming #{file}"
- File.open(file, 'w') { |f| f.write upgrader.upgrade }
- end
+ namespace :upgrade do
+ task :schema, [:schema_file] do |t, args|; end
+
+ task :member, [:member_file] do |t, args|
+ member_file = args.member_file
+
+ upgrader = GraphQL::Upgrader::Member.new File.read(member_file)
+ next unless upgrader.upgradeable?
+
+ puts "- Transforming #{member_file}"
+ File.open(member_file, 'w') { |f| f.write upgrader.upgrade }
end
end
end
|
Move member logic into seperate task
|
diff --git a/lib/optical/library.rb b/lib/optical/library.rb
index abc1234..def5678 100644
--- a/lib/optical/library.rb
+++ b/lib/optical/library.rb
@@ -20,4 +20,26 @@ def add_fastqc_path(path)
@fastqc_paths << path
end
+
+ def load_stats()
+ IO.foreach(@qc_path) do |line|
+ next if 0 == $.
+ (name,number_unique_mapped_reads,number_multiple_hit_reads,
+ number_unmapped_reads,number_total_reads,number_total_mapped_reads,
+ number_genomic_positions_with_single_unique_read_mapped,
+ number_genomic_positions_with_greater_than_one_unique_read_mapped,
+ number_total_genomic_positions_with_unique_read_mapped) = line.chomp.split(/\t/)
+ @name = name
+ @mapping_counts = {
+ "number unique mapped reads" => number_unique_mapped_reads.to_i,
+ "number multiple hit reads" => number_multiple_hit_reads.to_i,
+ "number unmapped reads" => number_unmapped_reads.to_i,
+ "number total reads" => number_total_reads.to_i,
+ "number total mapped reads" => number_total_mapped_reads.to_i,
+ "number genomic positions with single unique read mapped" => number_genomic_positions_with_single_unique_read_mapped.to_i,
+ "number genomic positions with greater than one unique read mapped" => number_genomic_positions_with_greater_than_one_unique_read_mapped.to_i,
+ "number total genomic positions with unique read mapped" => number_total_genomic_positions_with_unique_read_mapped.to_i
+ }
+ end
+ end
end
|
Add method to read in the _alignment_qc.txt data
Let the library know how to read in its own data file & put them in a
handy hash for use down the road in the report
|
diff --git a/lib/peaberry/dot_js.rb b/lib/peaberry/dot_js.rb
index abc1234..def5678 100644
--- a/lib/peaberry/dot_js.rb
+++ b/lib/peaberry/dot_js.rb
@@ -33,8 +33,9 @@ end
[ Rack::Utils.status_code(:ok), headers, body.lines ]
- rescue => e
- [ Rack::Utils.status_code(:internal_server_error), headers, [e.message]]
+ rescue ExecJS::ProgramError => e # CoffeeScript->JavaScript
+ @sprockets.send(:expire_index!)
+ raise e.class, e.message.sub(%r<^(\s+\(in) .*/(\.js/)>) { "#$1 #$2" }
end
end
|
Handle errors during compilation of CoffeeScript.
|
diff --git a/lib/spicerack_usage.rb b/lib/spicerack_usage.rb
index abc1234..def5678 100644
--- a/lib/spicerack_usage.rb
+++ b/lib/spicerack_usage.rb
@@ -8,11 +8,19 @@ end
def display_message
- puts ("\n" + usage_file) unless ENV['GEM_TESTING']
+ puts ("\n" + usage_file) if usage_file? unless ENV['GEM_TESTING']
+ end
+
+ def usage_file?
+ File.exist?(usage_file_path)
end
def usage_file
- File.read(File.expand_path("../spices/#{spice}/USAGE", __FILE__))
+ File.read(usage_file_path)
+ end
+
+ def usage_file_path
+ File.expand_path("../spices/#{spice}/USAGE", __FILE__)
end
end
|
Print usage message only when there is a file
|
diff --git a/omnibus/config/software/opscode-pushy-server.rb b/omnibus/config/software/opscode-pushy-server.rb
index abc1234..def5678 100644
--- a/omnibus/config/software/opscode-pushy-server.rb
+++ b/omnibus/config/software/opscode-pushy-server.rb
@@ -17,7 +17,7 @@ name "opscode-pushy-server"
default_version "1.1.0"
-source git: "git://opscode/opscode-pushy-server"
+source git: "git://github.com/opscode/opscode-pushy-server"
dependency "erlang"
dependency "rebar"
|
Use public github url format.
|
diff --git a/todo.gemspec b/todo.gemspec
index abc1234..def5678 100644
--- a/todo.gemspec
+++ b/todo.gemspec
@@ -20,6 +20,7 @@
spec.add_development_dependency "bundler", "~> 1.3"
spec.add_development_dependency "rake"
+ spec.add_development_dependency "rspec", "~> 2.6"
spec.add_runtime_dependency "main", ">= 2.8.2"
spec.add_runtime_dependency "highline", ">= 1.4.0"
|
Add rspec dependency for testing
Signed-off-by: Aniket Pant <b1c1d8736f20db3fb6c1c66bb1455ed43909f0d8@aniketpant.com>
|
diff --git a/spec/integration/chief_transformer/operations/tame_update_spec.rb b/spec/integration/chief_transformer/operations/tame_update_spec.rb
index abc1234..def5678 100644
--- a/spec/integration/chief_transformer/operations/tame_update_spec.rb
+++ b/spec/integration/chief_transformer/operations/tame_update_spec.rb
@@ -0,0 +1,41 @@+require 'spec_helper'
+
+describe ChiefTransformer::Processor::TameUpdate do
+ before(:all) { preload_standing_data }
+ after(:all) { clear_standing_data }
+
+ let(:sample_operation_date) { Date.new(2013,8,5) }
+
+ let(:chief_update) {
+ create :chief_update, :applied, issue_date: sample_operation_date
+ }
+
+ describe '#process' do
+ context 'TAME has last effective date' do
+ let(:last_effective_date) { DateTime.parse("2009-11-15 11:00:00") }
+
+ let!(:measure) {
+ create :measure,
+ :national,
+ validity_start_date: DateTime.parse("2008-12-15 11:00:00"),
+ goods_nomenclature_item_id: '0101010100',
+ measure_type_id: 'VTS'
+ }
+
+ let!(:tame) { create(:tame, amend_indicator: "U",
+ fe_tsmp: DateTime.parse("2008-11-15 11:00:00"),
+ le_tsmp: last_effective_date,
+ msrgp_code: "VT",
+ msr_type: "S",
+ tty_code: "813",
+ adval_rate: 15.000,
+ origin: chief_update.filename) }
+
+ before { ChiefTransformer::Processor::TameUpdate.new(tame).process }
+
+ it 'ends measure setting its validity end date to TAME last effective timestap' do
+ expect(measure.reload.validity_end_date.to_date).to eq last_effective_date.to_date
+ end
+ end
+ end
+end
|
Add ChiefTransformer tame update spec
|
diff --git a/lib/arbre/html/text_node.rb b/lib/arbre/html/text_node.rb
index abc1234..def5678 100644
--- a/lib/arbre/html/text_node.rb
+++ b/lib/arbre/html/text_node.rb
@@ -22,6 +22,10 @@ @content = string
end
+ def class_list
+ []
+ end
+
def tag_name
nil
end
|
Fix searching elements by class name from a tree including a text node by implementing the missing class_list method
|
diff --git a/lib/bundle/brew_services.rb b/lib/bundle/brew_services.rb
index abc1234..def5678 100644
--- a/lib/bundle/brew_services.rb
+++ b/lib/bundle/brew_services.rb
@@ -11,18 +11,16 @@ end
def self.started?(name)
- if @started_services.nil?
- @started_services ||= []
- @started_names ||= []
- `brew services list`.lines.grep(/started/).map do |s|
- s.split(/\s+/).each do |fname, state, user, plist|
- @started_services << Hash[:name => fname, :user => user, :plist => plist]
- @started_names << fname
- end
- end
- end
-
- @started_names.include? name
+ @raw_started_services ||= `brew services list`.lines.grep(/started/)
+ @started_services ||= []
+ @started_names ||= []
+ @raw_started_services.map do |s|
+ s.split(/\s+/).each do |fname, state, user, plist|
+ @started_services << Hash[:name => fname, :user => user, :plist => plist]
+ @started_names << fname
+ end
+ end
+ @started_names.include? name
end
end
end
|
Remove leading "if" decreased coverage
|
diff --git a/lib/combustion/generator.rb b/lib/combustion/generator.rb
index abc1234..def5678 100644
--- a/lib/combustion/generator.rb
+++ b/lib/combustion/generator.rb
@@ -23,8 +23,10 @@ template "templates/database.yml", "spec/internal/config/database.yml"
template "templates/schema.rb", "spec/internal/db/schema.rb"
template "templates/config.ru", "config.ru"
- create_file "spec/internal/public/favicon.ico"
- create_file "spec/internal/log/.gitignore" do
+
+ create_file "spec/internal/app/assets/config/manifest.js"
+ create_file "spec/internal/public/favicon.ico"
+ create_file "spec/internal/log/.gitignore" do
"*.log"
end
end
|
Create placeholder JS manifest file.
As discussed in #102.
|
diff --git a/Casks/python33.rb b/Casks/python33.rb
index abc1234..def5678 100644
--- a/Casks/python33.rb
+++ b/Casks/python33.rb
@@ -1,8 +1,8 @@ cask :v1 => 'python33' do
- version '3.4.3'
+ version '3.3.5'
sha256 '7e59f823f82da5ec7e2af4449a5e33c09f5b755a8acd9cec98371da8c2b2b52b'
- url "https://www.python.org/ftp/python/#{version}/python-#{version}-macosx10.6.pkg"
+ url "https://www.python.org/ftp/python/#{version}/python-#{version}-macosx10.6.dmg"
homepage 'https://www.python.org/'
license :oss
|
Revert incorrect changes to Python3 Cask
Leave updated homepage URL in place
|
diff --git a/spec/acceptance/orchestrator/organizer_action_combination_spec.rb b/spec/acceptance/orchestrator/organizer_action_combination_spec.rb
index abc1234..def5678 100644
--- a/spec/acceptance/orchestrator/organizer_action_combination_spec.rb
+++ b/spec/acceptance/orchestrator/organizer_action_combination_spec.rb
@@ -12,9 +12,9 @@
it 'responds to both actions and organizers' do
result = OrchestratorTestReduce.run({ :number => 0 }, [
- TestDoubles::AddTwoOrganizer,
- TestDoubles::AddOneAction
- ])
+ TestDoubles::AddTwoOrganizer,
+ TestDoubles::AddOneAction
+ ])
expect(result).to be_success
expect(result.number).to eq(3)
@@ -22,10 +22,10 @@
it 'fails fast by skipping proceeding actions/organizers after failure' do
result = OrchestratorTestReduce.run({ :number => 0 }, [
- TestDoubles::AddTwoOrganizer,
- TestDoubles::FailureAction,
- TestDoubles::AddOneAction
- ])
+ TestDoubles::AddTwoOrganizer,
+ TestDoubles::FailureAction,
+ TestDoubles::AddOneAction
+ ])
expect(result).not_to be_success
expect(result.number).to eq(2)
|
Fix Rubocop warnings - indentation
|
diff --git a/app/controllers/devise/two_step_verification_session_controller.rb b/app/controllers/devise/two_step_verification_session_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/devise/two_step_verification_session_controller.rb
+++ b/app/controllers/devise/two_step_verification_session_controller.rb
@@ -10,17 +10,15 @@ render(:show) && return if params[:code].nil?
if current_user.authenticate_otp(params[:code])
- expires_seconds = User::REMEMBER_2SV_SESSION_FOR
- if expires_seconds && expires_seconds > 0
- cookies.signed['remember_2sv_session'] = {
- value: {
- user_id: current_user.id,
- valid_until: expires_seconds.from_now,
- secret_hash: Digest::SHA256.hexdigest(current_user.otp_secret_key)
- },
- expires: expires_seconds.from_now
- }
- end
+ cookies.signed['remember_2sv_session'] = {
+ value: {
+ user_id: current_user.id,
+ valid_until: User::REMEMBER_2SV_SESSION_FOR.from_now,
+ secret_hash: Digest::SHA256.hexdigest(current_user.otp_secret_key)
+ },
+ expires: User::REMEMBER_2SV_SESSION_FOR.from_now
+ }
+
warden.session(:user)['need_two_step_verification'] = false
bypass_sign_in current_user
set_flash_message :notice, :success
|
Remove unnecessary conditional in cookie setting for 2SV
This conditional is always true, since `expires_seconds` is a constant
that is set in the User model, and never overridden.
I'm unsure why this conditional ever existed - ideas welcome.
|
diff --git a/db/migrate/20160329121128_add_permission_id_fk_to_visualization.rb b/db/migrate/20160329121128_add_permission_id_fk_to_visualization.rb
index abc1234..def5678 100644
--- a/db/migrate/20160329121128_add_permission_id_fk_to_visualization.rb
+++ b/db/migrate/20160329121128_add_permission_id_fk_to_visualization.rb
@@ -1,8 +1,12 @@ Sequel.migration do
up do
- alter_table :visualizations do
- set_column_allow_null :permission_id, false
- add_foreign_key [:permission_id], :permissions, null: false
+ Rails::Sequel.connection.transaction do
+ load File.join(Rails.root, 'Rakefile')
+ Rake::Task['cartodb:permissions:fill_missing_permissions'].invoke(true)
+ alter_table :visualizations do
+ set_column_allow_null :permission_id, false
+ add_foreign_key [:permission_id], :permissions, null: false
+ end
end
end
|
Call permissions rake from migration
|
diff --git a/app/workers/commit_monitor_handlers/batch/github_pr_commenter/migration_date_checker.rb b/app/workers/commit_monitor_handlers/batch/github_pr_commenter/migration_date_checker.rb
index abc1234..def5678 100644
--- a/app/workers/commit_monitor_handlers/batch/github_pr_commenter/migration_date_checker.rb
+++ b/app/workers/commit_monitor_handlers/batch/github_pr_commenter/migration_date_checker.rb
@@ -23,9 +23,9 @@
def bad_migrations
@bad_migrations ||=
- diff_files_for_commit_range.select do |f|
- next unless f.include?("db/migrate/")
- valid_timestamp?(File.basename(f).split("_").first)
+ migration_files.reject do |f|
+ ts = File.basename(f).split("_").first
+ valid_timestamp?(ts)
end
end
@@ -35,6 +35,12 @@ false
end
+ def migration_files
+ diff_files_for_commit_range.select do |f|
+ f.include?("db/migrate/")
+ end
+ end
+
def diff_files_for_commit_range
branch.repo.with_git_service do |git|
git.diff_details(*commit_range).keys
|
Fix inverse logic in MigrationDateChecker
|
diff --git a/lib/syoboemon/query_generator/todays_programs.rb b/lib/syoboemon/query_generator/todays_programs.rb
index abc1234..def5678 100644
--- a/lib/syoboemon/query_generator/todays_programs.rb
+++ b/lib/syoboemon/query_generator/todays_programs.rb
@@ -23,7 +23,7 @@ filer: "0",
count: "3000",
days: "1",
- titlefmt: "$(StTime)-$(ShortTitle) $(SubTitleB)-$(ChName)-$(TID)-$(Cat)"
+ titlefmt: "$(StTime)-$(ShortTitle)-$(SubTitleB)-$(ChName)-$(TID)-$(Cat)"
}
end
end
|
Change titlefmt of API parameter
|
diff --git a/test/fixtures/cookbooks/selenium_test/recipes/package.rb b/test/fixtures/cookbooks/selenium_test/recipes/package.rb
index abc1234..def5678 100644
--- a/test/fixtures/cookbooks/selenium_test/recipes/package.rb
+++ b/test/fixtures/cookbooks/selenium_test/recipes/package.rb
@@ -1,6 +1,6 @@ case node[:platform_family]
when 'debian'
- # firefox runs at compile time and firefox package is not up to date on Ubuntu 14.04-1
+ # firefox runs at compile time and firefox package is not up to date on Ubuntu
execute 'sudo apt-get update' do
action :nothing
end.run_action(:run)
@@ -13,7 +13,10 @@ action :nothing
end.run_action(:install)
when 'rhel'
- include_recipe 'yum'
+ # firefox runs at compile time and firefox package is not up to date on CentOS
+ execute 'yum update -y' do
+ action :nothing
+ end.run_action(:run)
# selenium-webdriver includes ffi which requires the following dependencies
package 'gcc'
|
Fix firefox undefined symbol: g_type_check_instance_is_fundamentally_a
|
diff --git a/app/workers/clever_student_importer_worker.rb b/app/workers/clever_student_importer_worker.rb
index abc1234..def5678 100644
--- a/app/workers/clever_student_importer_worker.rb
+++ b/app/workers/clever_student_importer_worker.rb
@@ -1,7 +1,7 @@ class CleverStudentImporterWorker
include Sidekiq::Worker
- def perform(classroom_ids, district_token, requesters)
+ def perform(classroom_ids, district_token)
puts "Running Clever student import in the background"
classrooms = Classroom.unscoped.where(id: classroom_ids)
CleverIntegration::Importers::Students.run(classrooms, district_token, CleverIntegration::Requesters.section)
|
Remove requesters argument from the perform function in CleverStudentImportWorker
|
diff --git a/lib/resque/geocoder_jobs.rb b/lib/resque/geocoder_jobs.rb
index abc1234..def5678 100644
--- a/lib/resque/geocoder_jobs.rb
+++ b/lib/resque/geocoder_jobs.rb
@@ -3,7 +3,7 @@ @queue = :geocodings
def self.perform(options = {})
- geocoding = Geocodings[options.symbolize_keys[:job_id]].run!
+ geocoding = Geocoding[options.symbolize_keys[:job_id]].run!
end
end
|
Fix error on Geocoding job
|
diff --git a/lib/rom/support/registry.rb b/lib/rom/support/registry.rb
index abc1234..def5678 100644
--- a/lib/rom/support/registry.rb
+++ b/lib/rom/support/registry.rb
@@ -19,7 +19,7 @@
def each(&block)
return to_enum unless block
- elements.each(&block)
+ elements.each { |element| yield(element) }
end
def [](key)
|
Use nested block when iterating (turns out it is faster)
|
diff --git a/texas.gemspec b/texas.gemspec
index abc1234..def5678 100644
--- a/texas.gemspec
+++ b/texas.gemspec
@@ -1,6 +1,3 @@-#$:.unshift('lib')
-#require 'texas'
-
Gem::Specification.new do |s|
s.author = "René Föhring"
s.email = 'rf@bamaru.de'
|
Remove comment at beginning of gemspec
|
diff --git a/Casks/epic.rb b/Casks/epic.rb
index abc1234..def5678 100644
--- a/Casks/epic.rb
+++ b/Casks/epic.rb
@@ -1,9 +1,9 @@ cask :v1 => 'epic' do
- version '37_4'
- sha256 'b3dcd0d0e101629342d13c8683f3801412517274c75a70645d38813c07030a48'
+ version :latest
+ sha256 :no_check
- # rackcdn.com is the official download host per the vendor homepage
- url "https://ed5b681d56298a85550d-7d665255a6e48f36b11ee3cfeece77e0.ssl.cf1.rackcdn.com/epic_mac_#{version}_alternative/Epic.dmg"
+ # kxcdn.com is the official download host per the vendor homepage
+ url 'https://macepic-cbe.kxcdn.com/Alt/Epic.dmg'
appcast 'https://updates.epicbrowser.com/mac_updates/appcast.xml'
homepage 'http://www.epicbrowser.com'
license :unknown # todo: change license and remove this comment; ':unknown' is a machine-generated placeholder
|
Update Epic Browser to latest version
|
diff --git a/test/factories/patient.rb b/test/factories/patient.rb
index abc1234..def5678 100644
--- a/test/factories/patient.rb
+++ b/test/factories/patient.rb
@@ -1,7 +1,7 @@ FactoryGirl.define do
factory :patient do
name 'New Patient'
- primary_phone '123-123-1234'
+ sequence(:primary_phone, 100) { |n| "127-#{n}-1111" }
spanish false
created_by { FactoryGirl.create(:user) }
initial_call_date { 2.days.ago }
|
Update Patient factory to sequence phone numbers - necessary with uniqueness constraint on primary_phone
|
diff --git a/test/perfecta_test.rb b/test/perfecta_test.rb
index abc1234..def5678 100644
--- a/test/perfecta_test.rb
+++ b/test/perfecta_test.rb
@@ -3,13 +3,22 @@ class PerfectaTest < MiniTest::Unit::TestCase
describe 'Perfecta client' do
- it 'is initialized with an email and password' do
- client = Perfecta::Client.new do |c|
- c.email = 'email'
+
+ before do
+ @client = Perfecta::Client.new do |c|
+ c.email = 'email@ddress'
c.password = 'password'
end
+ end
- client.must_be_instance_of Perfecta::Client
+ it 'is initialized with an email and password' do
+ @client.must_be_instance_of Perfecta::Client
end
+
+ it "sets the email and password vars" do
+ @client.email.must_equal 'email@ddress'
+ @client.password.must_equal 'password'
+ end
+
end
end
|
Test email and password is set
|
diff --git a/app/models/course/assessment/question/text_response_comprehension_solution.rb b/app/models/course/assessment/question/text_response_comprehension_solution.rb
index abc1234..def5678 100644
--- a/app/models/course/assessment/question/text_response_comprehension_solution.rb
+++ b/app/models/course/assessment/question/text_response_comprehension_solution.rb
@@ -5,6 +5,7 @@ enum solution_type: [:compre_keyword, :compre_lifted_word]
before_validation :remove_blank_solution,
+ :set_dummy_solution_lemma,
:strip_whitespace_solution,
:strip_whitespace_solution_lemma
@@ -27,6 +28,11 @@ solution.reject!(&:blank?)
end
+ # TODO: Remove this function when lemmatiser is implemented
+ def set_dummy_solution_lemma
+ self.solution_lemma = solution
+ end
+
def strip_whitespace_solution
solution.each(&:strip!)
end
|
Set dummy `solution_lemma` value for TextResponseComprehensionSolution
TODO: To revert this commit when lemmatiser is implemented.
|
diff --git a/app/models/manageiq/providers/amazon/inventory/persister/target_collection.rb b/app/models/manageiq/providers/amazon/inventory/persister/target_collection.rb
index abc1234..def5678 100644
--- a/app/models/manageiq/providers/amazon/inventory/persister/target_collection.rb
+++ b/app/models/manageiq/providers/amazon/inventory/persister/target_collection.rb
@@ -5,10 +5,6 @@
def targeted?
true
- end
-
- def strategy
- :local_db_find_missing_references
end
def initialize_inventory_collections
|
Use the persister strategy from core
|
diff --git a/wasabi.gemspec b/wasabi.gemspec
index abc1234..def5678 100644
--- a/wasabi.gemspec
+++ b/wasabi.gemspec
@@ -19,6 +19,7 @@ s.add_dependency "mime-types", "< 2.0.0"
s.add_development_dependency "rake", "~> 0.9"
+ s.add_development_dependency "transpec"
s.add_development_dependency "rspec", "~> 2.14"
s.files = `git ls-files`.split("\n")
|
Add transpec as a dev dependency
|
diff --git a/app.rb b/app.rb
index abc1234..def5678 100644
--- a/app.rb
+++ b/app.rb
@@ -20,7 +20,7 @@ post '/webhook' do
content_type :json
- restart_travis_build(@request_payload['repository'])
+ restart_travis_build(@request_payload['repository'], @request_payload['default_branch'])
status 200
body ''
|
Use the branch from the webhook payload
|
diff --git a/app.rb b/app.rb
index abc1234..def5678 100644
--- a/app.rb
+++ b/app.rb
@@ -1,6 +1,6 @@ require 'rubygems'
require 'sinatra'
-require 'sinatra/reloader'
+#require 'sinatra/reloader'
get '/' do
erb "Hello! <a href=\"https://github.com/bootstrap-ruby/sinatra-bootstrap\">Original</a> pattern has been modified for <a href=\"http://rubyschool.us/\">Ruby School</a>"
|
Disable sinatra-reloader, because it does not working.
|
diff --git a/app.rb b/app.rb
index abc1234..def5678 100644
--- a/app.rb
+++ b/app.rb
@@ -25,7 +25,11 @@
get '/' do
- redirect '/index'
+ redirect '/_index'
+end
+
+get '/:page.md' do
+ File.read(File.join(PAGE_ROOT, params[:page] + ".md"))
end
get '/:page' do
|
Switch to _index, add a markdown route
|
diff --git a/bot.rb b/bot.rb
index abc1234..def5678 100644
--- a/bot.rb
+++ b/bot.rb
@@ -5,32 +5,34 @@ # Using the tinyURL API
bot = Cinch::Bot.new do
- configure do |c|
- c.server = "irc.freenode.org"
- c.channels = ["#hardorange"]
- c.nick = "Stumpy"
- end
+ configure do |c|
+ raise "Environment Variable for Server not Set." unless ENV.has_key?("server")
+ raise "Environment Variable for Channel not Set." unless ENV.has_key?("channel")
+ c.server = ENV['server']
+ c.channels = ENV['channel']
+ c.nick = "Stumpy"
+ end
- helpers do
- def shorten(url)
- url = open("http://tinyurl.com/api-create.php?url=#{URI.escape(url)}").read
- url == "Error" ? nil : url
- rescue OpenURI::HTTPError
- nil
+ helpers do
+ def shorten(url)
+ url = open("http://tinyurl.com/api-create.php?url=#{URI.escape(url)}").read
+ url == "Error" ? nil : url
+ rescue OpenURI::HTTPError
+ nil
+ end
end
- end
- on :channel, /^!stumpy (.+)/ do |m, url_list|
- urls = URI.extract(url_list, ["http","https"])
+ on :channel, /^!stumpy (.+)/ do |m, url_list|
+ urls = URI.extract(url_list, ["http","https"])
- unless urls.empty?
- short_urls = urls.map {|url| shorten(url) }.compact
+ unless urls.empty?
+ short_urls = urls.map {|url| shorten(url) }.compact
- unless short_urls.empty?
- m.reply short_urls.join("\n")
- end
+ unless short_urls.empty?
+ m.reply short_urls.join("\n")
+ end
+ end
end
- end
end
bot.start
|
Update the server and channel config to be an environment variable
|
diff --git a/tests/spec/requests/caching_spec.rb b/tests/spec/requests/caching_spec.rb
index abc1234..def5678 100644
--- a/tests/spec/requests/caching_spec.rb
+++ b/tests/spec/requests/caching_spec.rb
@@ -0,0 +1,37 @@+require 'net/http'
+require 'spec_helper'
+
+RSpec.feature "Caching headers are provided for assets ", type: :request do
+ let(:index_uri) { URI(Capybara.app_host) }
+
+ describe "the index page" do
+ let(:one_day_s) { 24 * 60 * 60 }
+
+ it "is cached for one day" do
+ Net::HTTP.start(index_uri.host, index_uri.port) do |http|
+ request = Net::HTTP::Get.new(index_uri)
+ response = http.request(request)
+
+ expect(response['cache-control']).to match(/public.*max-age.*=.*#{one_day_s}/)
+ expect(response['last-modified']).to_not be_nil
+ end
+ end
+ end
+
+ describe "an asset" do
+ let(:index_body) { Net::HTTP.get(index_uri) }
+ let(:index_page) { Capybara.string(index_body) }
+ let(:asset_path) { index_page.first('body script', visible: false)[:src] }
+ let(:asset_uri) { URI.join(index_uri, asset_path) }
+ let(:one_year_s) { 365 * 24 * 60 * 60 }
+
+ it 'is cached for one year' do
+ Net::HTTP.start(asset_uri.host, asset_uri.port) do |http|
+ request = Net::HTTP::Get.new(asset_uri)
+ response = http.request(request)
+ expect(response['cache-control']).to match(/public.*max-age.*=.*#{one_year_s}/)
+ expect(response['last-modified']).to_not be_nil
+ end
+ end
+ end
+end
|
Test that the assets are cached
|
diff --git a/app/controllers/admin/base_controller.rb b/app/controllers/admin/base_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/admin/base_controller.rb
+++ b/app/controllers/admin/base_controller.rb
@@ -8,7 +8,7 @@
def limit_edition_access!
unless @edition.accessible_by?(current_user)
- render :forbidden, status: 403
+ render "admin/editions/forbidden", status: 403
end
end
end
|
Add helper method for limiting edition access
|
diff --git a/environment.rb b/environment.rb
index abc1234..def5678 100644
--- a/environment.rb
+++ b/environment.rb
@@ -25,5 +25,6 @@ # Set up the controllers and helpers
Dir[APP_ROOT.join('app', 'models', '*.rb')].each { |file| require file }
Dir[APP_ROOT.join('app', 'controllers', '*.rb')].each { |file| require file }
+Dir[APP_ROOT.join('app', 'helpers', '*.rb')].each { |file| require file }
require APP_ROOT.join('database')
|
Add Helpers stuff to environement
|
diff --git a/core/db/migrate/20151220072838_remove_shipping_method_id_from_spree_orders.rb b/core/db/migrate/20151220072838_remove_shipping_method_id_from_spree_orders.rb
index abc1234..def5678 100644
--- a/core/db/migrate/20151220072838_remove_shipping_method_id_from_spree_orders.rb
+++ b/core/db/migrate/20151220072838_remove_shipping_method_id_from_spree_orders.rb
@@ -0,0 +1,13 @@+class RemoveShippingMethodIdFromSpreeOrders < ActiveRecord::Migration
+ def up
+ if column_exists?(:spree_orders, :shipping_method_id, :integer)
+ remove_column :spree_orders, :shipping_method_id, :integer
+ end
+ end
+
+ def down
+ unless column_exists?(:spree_orders, :shipping_method_id, :integer)
+ add_column :spree_orders, :shipping_method_id, :integer
+ end
+ end
+end
|
Remove shipping_method_id from order since shipping_method is not related to order
|
diff --git a/app/models/cloud_model/workers/components/ruby_component_worker.rb b/app/models/cloud_model/workers/components/ruby_component_worker.rb
index abc1234..def5678 100644
--- a/app/models/cloud_model/workers/components/ruby_component_worker.rb
+++ b/app/models/cloud_model/workers/components/ruby_component_worker.rb
@@ -5,7 +5,7 @@ def build build_path
# Ruby deps needed for most rails projects
# TODO: Consider separating them to more Components
- packages = %w(ruby git)
+ packages = %w(ruby ruby-dev git)
packages += %w(zlib1g-dev libxml2-dev) # Nokogiri
packages << 'ruby-bcrypt' # bcrypt
packages << 'nodejs' # JS interpreter
@@ -13,7 +13,8 @@ packages << 'libxml2-utils' # xmllint (TODO: needed for some rails projects, make this configurable)
packages << 'libxslt-dev' # libxml (TODO: needed for some rails projects, make this configurable)
chroot! build_path, "apt-get install #{packages * ' '} -y", "Failed to install packages for deployment of rails app"
- chroot! build_path, "gem install bundler", "Failed to install bundler"
+ chroot! build_path, "gem install bundler", "Failed to install current bundler"
+ chroot! build_path, "gem install bundler -v '~>1.0'", "Failed to install legacy bundler v1"
end
end
end
|
Install ruby-dev and bundler v1 on ruby component for backward compatibility and being able to compile gems again
|
diff --git a/tests/header_tests.rb b/tests/header_tests.rb
index abc1234..def5678 100644
--- a/tests/header_tests.rb
+++ b/tests/header_tests.rb
@@ -3,7 +3,7 @@ with_rackup('response_header.ru') do
tests('Response#get_header') do
- connection = Excon.new('http://foo.com:8080', :proxy => 'http://localhost:9292')
+ connection = Excon.new('http://foo.com:8080', :proxy => 'http://127.0.0.1:9292')
response = connection.request(:method => :get, :path => '/foo')
tests('with variable header capitalization') do
|
Remove another instance of 'localhost' in tests.
|
diff --git a/run.rb b/run.rb
index abc1234..def5678 100644
--- a/run.rb
+++ b/run.rb
@@ -29,10 +29,10 @@ css_file.write("/* #{e} */\n")
# Change programming language name
css_name = to_css_name(e);
+ # Adding css color class
+ css_file.write(".ghc-#{css_name} { color: #{i['color']}; }\n")
# Adding css background-color class
css_file.write(".ghc-#{css_name}-bg { background-color: #{i['color']}; }\n")
- # Adding css color class
- css_file.write(".ghc-#{css_name} { color: #{i['color']}; }\n")
end
end
|
Change order of lines to be more redeable
|
diff --git a/spec/classes/munin_master_spec.rb b/spec/classes/munin_master_spec.rb
index abc1234..def5678 100644
--- a/spec/classes/munin_master_spec.rb
+++ b/spec/classes/munin_master_spec.rb
@@ -6,7 +6,7 @@ it { should compile }
it {
should contain_package('munin')
- should contain_file('/etc/munin/munin.conf')\
+ should contain_file('/etc/munin/munin.conf')
.with_content(/^graph_strategy cgi$/)
}
end
|
Remove newline escape before method - (ruby1.8)
|
diff --git a/akephalos.gemspec b/akephalos.gemspec
index abc1234..def5678 100644
--- a/akephalos.gemspec
+++ b/akephalos.gemspec
@@ -10,7 +10,7 @@ s.platform = ENV["PLATFORM"] || "ruby"
s.authors = ["Bernerd Schaefer"]
s.email = "bj.schaefer@gmail.com"
- s.homepage = "https://github.com/Nerian/akephalos"
+ s.homepage = "https://github.com/Nerian/akephalos2"
s.summary = "Headless Browser for Integration Testing with Capybara"
s.description = s.summary
s.rubyforge_project = "akephalos"
|
Correct the home page at gemspec
|
diff --git a/spec/factories/share_facebooks.rb b/spec/factories/share_facebooks.rb
index abc1234..def5678 100644
--- a/spec/factories/share_facebooks.rb
+++ b/spec/factories/share_facebooks.rb
@@ -2,6 +2,7 @@ factory :share_facebook, :class => 'Share::Facebook' do
title "MyString"
description "MyText"
+ page
end
end
|
Update factory with page association
|
diff --git a/spec/lib/sufia/id_service_spec.rb b/spec/lib/sufia/id_service_spec.rb
index abc1234..def5678 100644
--- a/spec/lib/sufia/id_service_spec.rb
+++ b/spec/lib/sufia/id_service_spec.rb
@@ -11,44 +11,6 @@ it "should not mint the same id twice in a row" do
other_id = Sufia::IdService.mint
other_id.should_not == @id
- end
- it "should create many unique ids" do
- a = []
- threads = (1..10).map do
- Thread.new do
- 100.times do
- a << Sufia::IdService.mint
- end
- end
- end
- threads.each(&:join)
- a.uniq.count.should == a.count
- end
- it "should create many unique ids when hit by multiple processes " do
- rd, wr = IO.pipe
- 2.times do
- pid = fork do
- rd.close
- threads = (1..10).map do
- Thread.new do
- 20.times do
- wr.write Sufia::IdService.mint
- wr.write " "
- end
- end
- end
- threads.each(&:join)
- wr.close
- end
- end
- wr.close
- 2.times do
- Process.wait
- end
- s = rd.read
- rd.close
- a = s.split(" ")
- a.uniq.count.should == a.count
end
end
end
|
Remove expensive specs that make sure noids can be minted in a multi-threaded environment. The noid library already has tests around multi-threading, and these specs take nearly a minute to finish on Travis.
|
diff --git a/extra/update_watch.rb b/extra/update_watch.rb
index abc1234..def5678 100644
--- a/extra/update_watch.rb
+++ b/extra/update_watch.rb
@@ -1,7 +1,7 @@ require 'rubygems'
require 'sinatra'
require 'json'
-set :port, 3123
+set :port, 3124
set :environment, :production
enable :lock
Dir.chdir(File.dirname(__FILE__) + "/..")
|
Watch for updates on port 3124.
|
diff --git a/SVGgh.podspec b/SVGgh.podspec
index abc1234..def5678 100644
--- a/SVGgh.podspec
+++ b/SVGgh.podspec
@@ -1,7 +1,7 @@ Pod::Spec.new do |s|
s.name = 'SVGgh'
-s.version = '1.4.0'
+s.version = '1.5'
s.license = 'MIT'
s.tvos.deployment_target = '9.0'
s.ios.deployment_target = '7.0'
@@ -9,7 +9,7 @@ s.summary = "SVG Rendering Library for iOS"
s.homepage = 'https://github.com/GenerallyHelpfulSoftware/SVGgh'
s.author = { 'Glenn R. Howes' => 'glenn@genhelp.com' }
-s.source = { :git => 'https://github.com/GenerallyHelpfulSoftware/SVGgh.git', :tag => "v1.4.0" }
+s.source = { :git => 'https://github.com/GenerallyHelpfulSoftware/SVGgh.git', :tag => "v1.5" }
s.ios.source_files = 'SVGgh/**/*{.h,m}'
s.tvos.source_files = 'SVGgh/**/*{.h,m}'
|
Update Cocoapods Spec to be 1.5
|
diff --git a/app/models/app.rb b/app/models/app.rb
index abc1234..def5678 100644
--- a/app/models/app.rb
+++ b/app/models/app.rb
@@ -1,5 +1,5 @@ class App < ActiveRecord::Base
- validates :name, :format => {:with => /\A[a-z0-9_]+\z/, :message => "Needs to be one word that can be lower case letters, numbers or underscores"}, :uniqueness => true
+ validates :name, presence: true, format: {with: /\A[a-z0-9_]+\z/, message: "Needs to be one word that can be lower case letters, numbers or underscores"}, uniqueness: true
validates :description, presence: true
# A big fat WARNING: if you ever decide to expose the Cuttlefish SMTP server to the internet
|
Make name a required field
|
diff --git a/app/controllers/accounts/sign_out_controller.rb b/app/controllers/accounts/sign_out_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/accounts/sign_out_controller.rb
+++ b/app/controllers/accounts/sign_out_controller.rb
@@ -2,6 +2,7 @@ around_filter :render_trigger_event_on_social_account_error
def destroy
+ forget_me current_user
sign_out
render_trigger_event 'account_success', interactor(:'users/get_non_signed_in')
end
|
Destroy remeber me cookie on signout
|
diff --git a/app/controllers/admin/leaderboard_controller.rb b/app/controllers/admin/leaderboard_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/admin/leaderboard_controller.rb
+++ b/app/controllers/admin/leaderboard_controller.rb
@@ -1,19 +1,29 @@ class Admin::LeaderboardController < AdminController
def index
- sql = "SELECT COUNT(*) AS activity_count, (SELECT users.username FROM users WHERE users.id = activities.actor_id) FROM activities WHERE activities.actor_type = 'User' GROUP BY actor_id ORDER BY activity_count DESC LIMIT 200"
- values = ActiveRecord::Base.connection.execute(sql).values
- @data = values.map do |v|
- { 'user' => user = User.where(username: v.last).first,
- 'activity_count' => v.first,
- 'daily_avg' => v.first.to_i / ((Time.now - user.created_at) / (60 * 60 * 24.0)),
- 'joined_at' => user.created_at}
+ counts = Activity.where(actor_type: 'User').
+ group(:actor_id).
+ order('count_all DESC').
+ limit(200).
+ count
+
+ @data = counts.map do |user_id, count|
+ user = User.find(user_id)
+
+ {
+ user: user,
+ activity_count: count,
+ daily_avg: count / ((Time.now - user.created_at) / 1.day),
+ joined_at: user.created_at
+ }.with_indifferent_access
end
+
case params[:sort]
when 'daily_avg'
- @data = @data.sort_by{|x| -x['daily_avg']}
+ @data = @data.sort_by { |x| -x[:daily_avg] }
when 'joined_at'
- @data = @data.sort_by{|x| x['joined_at']}
+ @data = @data.sort_by { |x| x[:joined_at] }
end
+
@data
end
end
|
Swap out the raw SQL for ActiveRecord stuff
|
diff --git a/sidekiq-pool.gemspec b/sidekiq-pool.gemspec
index abc1234..def5678 100644
--- a/sidekiq-pool.gemspec
+++ b/sidekiq-pool.gemspec
@@ -18,7 +18,7 @@ spec.executables = ['sidekiq-pool']
spec.require_paths = ['lib']
- spec.add_dependency 'sidekiq', '~> 4.0'
+ spec.add_dependency 'sidekiq', '>= 4.0', '< 5.1'
spec.add_development_dependency 'bundler', '~> 1.11'
spec.add_development_dependency 'rake', '~> 10.0'
|
Add support for Sidekiq 5.0
|
diff --git a/app/helpers/storytime/dashboard/media_helper.rb b/app/helpers/storytime/dashboard/media_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/storytime/dashboard/media_helper.rb
+++ b/app/helpers/storytime/dashboard/media_helper.rb
@@ -2,13 +2,15 @@ module Dashboard
module MediaHelper
def show_media_insert_button?
- referrer_action = request.referrer.nil? ? nil : request.referrer.split("/").last
- params[:controller].split("/").last != "media" || referrer_action == "edit"
+ !show_large_gallery?
end
def show_large_gallery?
referrer_action = request.referrer.nil? ? nil : request.referrer.split("/").last
- params[:controller].split("/").last != "media" || referrer_action != "edit"
+ controller = params[:controller].split("/").last
+ action = params[:action]
+
+ controller == "media" && action == "index" || controller == "media" && action == "create" && referrer_action == "media"
end
def gallery_type
|
Improve logic for show_large_gallery helper
|
diff --git a/vmdb/app/models/dialog_field_check_box.rb b/vmdb/app/models/dialog_field_check_box.rb
index abc1234..def5678 100644
--- a/vmdb/app/models/dialog_field_check_box.rb
+++ b/vmdb/app/models/dialog_field_check_box.rb
@@ -42,7 +42,7 @@ end
def required_value_error?
- @value != "t"
+ value != "t"
end
def values_from_automate
|
Fix mistake of using @value instead of value
|
diff --git a/restful_clicktocall.rb b/restful_clicktocall.rb
index abc1234..def5678 100644
--- a/restful_clicktocall.rb
+++ b/restful_clicktocall.rb
@@ -1,6 +1,6 @@ methods_for :rpc do
# Helps the GUI determine whether the call is still active.
- def call_with_destination(destination)
+ def restful_call_with_destination(destination)
ahn_log.click_to_call "Finding call with destination #{destination.inspect} in #{Adhearsion.active_calls.size} active calls"
status = find_call_by_destination(destination) ? "alive" : "dead"
{:result => status}
@@ -8,7 +8,7 @@
# Traverses Adhearsion's data structure for active calls and returns
# the proper channel name that Asterisk needs to hangup a call.
- def hangup_channel_with_destination(destination)
+ def restful_hangup_channel_with_destination(destination)
if found_call = find_call_by_destination(destination)
Adhearsion::VoIP::Asterisk.manager_interface.hangup found_call.variables[:channel]
{:channel => found_call.variables[:channel]}
|
Rename some RPC methods to restful
|
diff --git a/Popsicle.podspec b/Popsicle.podspec
index abc1234..def5678 100644
--- a/Popsicle.podspec
+++ b/Popsicle.podspec
@@ -1,6 +1,6 @@ Pod::Spec.new do |s|
s.name = "Popsicle"
- s.version = "1.0.0"
+ s.version = "1.1.0"
s.summary = "Simple, extensible value interpolation framework"
s.homepage = "https://github.com/Dromaguirre/Popsicle"
s.author = { "David Roman" => "dromaguirre@gmail.com" }
|
Update CocoaPods spec for 1.1.0 release
|
diff --git a/vagrant-openstack-plugin.gemspec b/vagrant-openstack-plugin.gemspec
index abc1234..def5678 100644
--- a/vagrant-openstack-plugin.gemspec
+++ b/vagrant-openstack-plugin.gemspec
@@ -15,7 +15,7 @@ gem.add_runtime_dependency "fog", ">= 1.16.0"
gem.add_development_dependency "rake"
- gem.add_development_dependency "rspec", "~> 2.13.0"
+ gem.add_development_dependency "rspec", "~> 2.14.0"
gem.files = `git ls-files`.split($/)
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
Upgrade rspec to 2.14 first
|
diff --git a/config/initializers/enable_words_to_avoid_highlighting.rb b/config/initializers/enable_words_to_avoid_highlighting.rb
index abc1234..def5678 100644
--- a/config/initializers/enable_words_to_avoid_highlighting.rb
+++ b/config/initializers/enable_words_to_avoid_highlighting.rb
@@ -1,2 +1,9 @@-# this feature flag gets overridden on deploy
-ENABLE_WORDS_TO_AVOID_HIGHLIGHTING = !Rails.env.production?
+if ENV.has_key?("HIGHLIGHT_WORDS_TO_AVOID")
+ enabled = "true" == ENV["HIGHLIGHT_WORDS_TO_AVOID"]
+else
+ enabled = !Rails.env.production?
+end
+
+# Typically this isn't enabled in production
+# It is primarily used as a training feature.
+ENABLE_WORDS_TO_AVOID_HIGHLIGHTING = enabled
|
Configure admin UI using HIGHLIGHT_WORDS_TO_AVOID env var
|
diff --git a/QTPaySDK.podspec b/QTPaySDK.podspec
index abc1234..def5678 100644
--- a/QTPaySDK.podspec
+++ b/QTPaySDK.podspec
@@ -1,23 +1,23 @@ Pod::Spec.new do |s|
-s.name = "QTPaySDK"
-s.version = "0.0.4"
-s.summary = "A Pay SDK of QFPay Inc. Include WeChat Pay, AliPay etc."
-s.description = <<-DESC
-A Pay SDK of QFPay Inc. Include WeChat Pay, AliPay etc.
-* Enables every transaction.
-DESC
-s.homepage = "http://www.qfpay.com/"
-s.author = { "bjxiaowanzi" => "zhoucheng@qfpay.com" }
-s.license = "MIT"
-s.ios.platform = :ios, '6.0'
-s.source = { :git => "https://github.com/bjxiaowanzi/QTPaySDK-iOS.git", :tag => "#{s.version}" }
-s.requires_arc = true
-s.ios.public_header_files = "**/*.framework/**/*.h"
-s.vendored_libraries = "**/*.a"
-s.vendored_frameworks = "**/*.framework"
-s.preserve_paths = "**/*.framework"
-s.resources = "**/*.bundle"
-s.frameworks = 'Foundation', 'UIKit', 'CoreLocation', 'SystemConfiguration', 'MobileCoreServices'
-s.libraries = ["z", "c++", "sqlite3"]
-s.xcconfig = { "OTHER_LDFLAGS" => "-lObjC",'LD_RUNPATH_SEARCH_PATHS' => '"$(SRCROOT)/**/*.framework"' }
+ s.name = "QTPaySDK"
+ s.version = "0.0.4"
+ s.summary = "A Pay SDK of QFPay Inc. Include WeChat Pay, AliPay etc."
+ s.description = <<-DESC
+ A Pay SDK of QFPay Inc. Include WeChat Pay, AliPay etc.
+ * Enables every transaction.
+ DESC
+ s.homepage = "http://www.qfpay.com/"
+ s.author = { "bjxiaowanzi" => "zcheng.1988@163.com" }
+ s.license = "MIT"
+ s.ios.platform = :ios, '6.0'
+ s.source = { :git => "https://github.com/bjxiaowanzi/QTPaySDK-iOS.git", :tag => "#{s.version}" }
+ s.requires_arc = true
+ s.ios.public_header_files = "**/*.framework/**/*.h"
+ s.vendored_libraries = "**/*.a"
+ s.vendored_frameworks = "**/*.framework"
+ s.preserve_paths = "**/*.framework"
+ s.resources = "**/*.bundle"
+ s.frameworks = 'Foundation', 'UIKit', 'CoreLocation', 'SystemConfiguration', 'MobileCoreServices'
+ s.libraries = ["z", "c++", "sqlite3"]
+ s.xcconfig = { "OTHER_LDFLAGS" => "-lObjC",'LD_RUNPATH_SEARCH_PATHS' => '"$(SRCROOT)/**/*.framework"' }
end
|
Update podspec file's author from zhoucheng@qfpay.com to zcheng.1988@163.com
|
diff --git a/app/controllers/activities_controller.rb b/app/controllers/activities_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/activities_controller.rb
+++ b/app/controllers/activities_controller.rb
@@ -1,14 +1,20 @@ class ActivitiesController < ApplicationController
+ before_action :find_activity, only: [:show]
def index
- @activities = Activity.all
+ @activities = Activity.all
end
def show
- if params[:id] =~ /\A\d+\z/
- @activity = Activity.find(params[:id])
- redirect_to activity_path(@activity)
- else
- @activity = Activity.find_by(permalink: params[:id])
- end
+
end
+
+ protected
+
+ def find_activity
+ @activity = begin
+ Activity.find_by(permalink: params[:id])
+ rescue ActiveRecord::RecordNotFound
+ Activity.find(params[:id])
+ end
+ end
end
|
Fix exception when permalink is number
|
diff --git a/lib/modules/download/generators/pdf.rb b/lib/modules/download/generators/pdf.rb
index abc1234..def5678 100644
--- a/lib/modules/download/generators/pdf.rb
+++ b/lib/modules/download/generators/pdf.rb
@@ -1,4 +1,6 @@ class Download::Generators::Pdf < Download::Generators::Base
+ include ActionController::UrlFor
+
TYPE = 'pdf'
def initialize(zip_path, identifier)
@@ -8,7 +10,7 @@
def generate
rasterizer = Rails.root.join('vendor/assets/javascripts/rasterize.js')
- url = url_for(action: :show, params)
+ url = url_for(params)
`phantomjs #{rasterizer} '#{url}' #{dest_pdf} A4`
end
@@ -22,7 +24,9 @@
def params
{
- key => @identifier
+ 'controller' => controller,
+ 'action' => :show,
+ key => @identifier,
'for_pdf' => true
}
end
@@ -31,6 +35,10 @@ id_is_integer? ? 'id' : 'iso'
end
+ def controller
+ id_is_integer? ? 'protected_areas' : 'country'
+ end
+
def id_is_integer?
# 'a-non-numeric-string'.to_i == 0
# 0.to_s != 'a-non-numeric-string'
|
Fix syntax error and url generator method
|
diff --git a/db/migrate/20151001182928_update_users_full_text_index.rb b/db/migrate/20151001182928_update_users_full_text_index.rb
index abc1234..def5678 100644
--- a/db/migrate/20151001182928_update_users_full_text_index.rb
+++ b/db/migrate/20151001182928_update_users_full_text_index.rb
@@ -0,0 +1,36 @@+class UpdateUsersFullTextIndex < ActiveRecord::Migration
+ def up
+ execute <<-SQL
+ SET LOCAL STATEMENT_TIMEOUT to 0;
+ CREATE OR REPLACE FUNCTION public.update_users_full_text_index()
+ RETURNS trigger
+ LANGUAGE plpgsql
+ AS $function$
+ BEGIN
+ NEW.full_text_index := to_tsvector(NEW.id::text) ||
+ to_tsvector(unaccent(NEW.name)) ||
+ to_tsvector(unaccent(NEW.email));
+ RETURN NEW;
+ END;
+ $function$;
+
+ CREATE TRIGGER update_users_full_text_index
+ BEFORE INSERT OR UPDATE OF id, name, email
+ ON users FOR EACH ROW
+ EXECUTE PROCEDURE public.update_users_full_text_index();
+
+ UPDATE public.users SET
+ email = coalesce(email, 'contato+user' || id::text || '@catarse.me');
+ ALTER TABLE public.users ALTER email SET NOT NULL;
+ ALTER TABLE public.users ALTER full_text_index SET NOT NULL;
+ SQL
+ end
+
+ def down
+ execute <<-SQL
+ DROP FUNCTION public.update_users_full_text_index() CASCADE;
+ ALTER TABLE public.users ALTER email DROP NOT NULL;
+ ALTER TABLE public.users ALTER full_text_index DROP NOT NULL;
+ SQL
+ end
+end
|
Add triggers to update users_full_text_index
|
diff --git a/db/migrate/20170704094757_add_render_timeouts_to_users.rb b/db/migrate/20170704094757_add_render_timeouts_to_users.rb
index abc1234..def5678 100644
--- a/db/migrate/20170704094757_add_render_timeouts_to_users.rb
+++ b/db/migrate/20170704094757_add_render_timeouts_to_users.rb
@@ -4,8 +4,9 @@
migration(
Proc.new do
- add_column :users, :user_render_timeout, :integer, null: true
- add_column :users, :database_render_timeout, :integer, null: true
+ # The 0 value means: "apply default render timeouts" (defined by the tiler)
+ add_column :users, :user_render_timeout, :integer, default: 0, null: false
+ add_column :users, :database_render_timeout, :integer, default: 0, null: false
end,
Proc.new do
drop_column :users, :user_render_timeout
|
Change default value of render timeout columns
|
diff --git a/Swinject.podspec b/Swinject.podspec
index abc1234..def5678 100644
--- a/Swinject.podspec
+++ b/Swinject.podspec
@@ -1,6 +1,6 @@ Pod::Spec.new do |s|
s.name = "Swinject"
- s.version = "2.0.0-beta.1"
+ s.version = "2.0.0-beta.2"
s.summary = "Dependency injection framework for Swift"
s.description = <<-DESC
Swinject is a dependency injection framework for Swift, to manage the dependencies of types in your system.
|
Set the version number to 2.0.0 (beta.2). [skip ci]
|
diff --git a/ci_environment/phpbuild/attributes/default.rb b/ci_environment/phpbuild/attributes/default.rb
index abc1234..def5678 100644
--- a/ci_environment/phpbuild/attributes/default.rb
+++ b/ci_environment/phpbuild/attributes/default.rb
@@ -1,5 +1,5 @@ default[:phpbuild][:git][:repository] = "git://github.com/CHH/php-build.git"
-default[:phpbuild][:git][:revision] = "387e802443af2254576ef386ea16fe874c628b5b"
+default[:phpbuild][:git][:revision] = "598990a18687be7d2a465429de784d581afe8a18"
default[:phpbuild][:phpunit_plugin][:git][:repository] = "git://github.com/CHH/php-build-plugin-phpunit.git"
default[:phpbuild][:phpunit_plugin][:git][:revision] = "a6a5ce4a5126b90a02dd473b63f660515de7d183"
|
Update php-build to fix permissions issue.
|
diff --git a/lib/ghee/api/gists.rb b/lib/ghee/api/gists.rb
index abc1234..def5678 100644
--- a/lib/ghee/api/gists.rb
+++ b/lib/ghee/api/gists.rb
@@ -5,7 +5,7 @@ #
module API
- # The Gists class handles all of the Github Gist
+ # The Gists module handles all of the Github Gist
# API endpoints
#
module Gists
|
Revert "Fix incorrect comment on Gists"
This reverts commit 34bf218a9d42fc5467cd4de2f62f2bcc519de3e5.
|
diff --git a/lib/json_reference.rb b/lib/json_reference.rb
index abc1234..def5678 100644
--- a/lib/json_reference.rb
+++ b/lib/json_reference.rb
@@ -1,5 +1,5 @@-require "json_pointer"
require "uri"
+require_relative "json_pointer"
module JsonReference
class Reference
@@ -14,6 +14,7 @@ if uri && !uri.empty?
@uri = URI.parse(uri)
end
+ @pointer ||= ""
else
@pointer = ref
end
|
Fix small gotcha in JSON reference for when there is a URL but no pointer
|
diff --git a/lib/redmine_charts.rb b/lib/redmine_charts.rb
index abc1234..def5678 100644
--- a/lib/redmine_charts.rb
+++ b/lib/redmine_charts.rb
@@ -11,7 +11,7 @@ module RedmineCharts
def self.has_sub_issues_functionality_active
- (Redmine::VERSION.to_a <=> [0,9,4,'devel']) >= 0
+ ((Redmine::VERSION.to_a <=> [0,9,5]) >= 0) or (Redmine::VERSION.to_a == [0,9,4,'devel'])
end
end
|
Check if current version of Redmine supports subissues
|
diff --git a/lib/sinatra/sequel.rb b/lib/sinatra/sequel.rb
index abc1234..def5678 100644
--- a/lib/sinatra/sequel.rb
+++ b/lib/sinatra/sequel.rb
@@ -40,7 +40,7 @@ def create_migrations_table
database.create_table? :migrations do
primary_key :id
- text :name, :null => false, :index => true
+ String :name, :null => false, :index => true
timestamp :ran_at
end
end
|
Fix for "BLOB/TEXT column 'name' used in key specification without a key length" error when using MySQL (migrations table)
|
diff --git a/config/initializers/exception_notification.rb b/config/initializers/exception_notification.rb
index abc1234..def5678 100644
--- a/config/initializers/exception_notification.rb
+++ b/config/initializers/exception_notification.rb
@@ -1,6 +1,6 @@ if Rails.env.to_s != 'development'
EmopDashboard::Application.config.middleware.use ExceptionNotification::Rack,
- :ignore_crawlers => %w{Googlebot bingbot EasouSpider},
+ :ignore_crawlers => %w{Googlebot bingbot EasouSpider scan},
:email => {
:email_prefix => Rails.application.secrets.exception_notifier['email_prefix'],
:sender_address => Rails.application.secrets.exception_notifier['sender_address'],
|
Add keyword 'scan' to excluded crawlers for exception notifications
|
diff --git a/omnibus/config/software/chef-dk-complete.rb b/omnibus/config/software/chef-dk-complete.rb
index abc1234..def5678 100644
--- a/omnibus/config/software/chef-dk-complete.rb
+++ b/omnibus/config/software/chef-dk-complete.rb
@@ -22,9 +22,6 @@ if windows?
dependency "chef-dk-env-customization"
dependency "chef-dk-powershell-scripts"
- # TODO can this be safely moved to before the chef-dk?
- # It would make caching better ...
- dependency "ruby-windows-devkit"
end
dependency "chef-dk-cleanup"
@@ -34,3 +31,7 @@ dependency "openssl-customization"
dependency "stunnel" if fips_mode?
+
+# This *has* to be last, as it mutates the build environment and causes all
+# compilations that use ./configure et all (the msys env) to break
+dependency "ruby-windows-devkit"
|
Move devkit to the very end
Signed-off-by: Scott Hain <54f99c3933fb11a028e0e31efcf2f4c9707ec4bf@chef.io>
|
diff --git a/lib/generators/ruby_rabbitmq_janus/migration_generator.rb b/lib/generators/ruby_rabbitmq_janus/migration_generator.rb
index abc1234..def5678 100644
--- a/lib/generators/ruby_rabbitmq_janus/migration_generator.rb
+++ b/lib/generators/ruby_rabbitmq_janus/migration_generator.rb
@@ -1,21 +1,24 @@ # frozen_string-literal: true
-require 'rails/generators/active_record'
+if defined?(ActiveRecord)
+ require 'rails/generators/active_record'
-module RubyrabbitmqJanus
- module Generators
- class MigrationGenerator < ::Rails::Generators::Base
- include Rails::Generators::Migration
- source_root File.expand_path('../templates', __FILE__)
- desc 'Installs RubyRabbitmqJanus migration file.'
+ module RubyrabbitmqJanus
+ module Generators
+ class MigrationGenerator < ::Rails::Generators::Base
+ include Rails::Generators::Migration
+ desc 'Installs RubyRabbitmqJanus migration file.'
- def install
- migration_template 'migration.rb',
- 'db/migrate/create_ruby_rabbitmq_janus_tables.rb'
- end
+ source_root File.expand_path('../templates', __FILE__)
- def self.next_migration_number(dirname)
- ActiveRecord::Generators::Base.next_migration_number(dirname)
+ def install
+ migration_template 'migration.rb',
+ 'db/migrate/create_ruby_rabbitmq_janus_tables.rb'
+ end
+
+ def self.next_migration_number(dirname)
+ ActiveRecord::Generators::Base.next_migration_number(dirname)
+ end
end
end
end
|
Configure generator for create migration with Active Record [skip ci]
|
diff --git a/axiom.gemspec b/axiom.gemspec
index abc1234..def5678 100644
--- a/axiom.gemspec
+++ b/axiom.gemspec
@@ -10,7 +10,7 @@ gem.description = 'Simplifies querying of structured data using relational algebra'
gem.summary = 'Ruby Relational Algebra'
gem.homepage = 'https://github.com/dkubb/axiom'
- gem.licenses = 'MIT'
+ gem.license = 'MIT'
gem.require_paths = %w[lib]
gem.files = `git ls-files`.split("\n")
|
Change gemspec to use a singular license
|
diff --git a/black_list.rb b/black_list.rb
index abc1234..def5678 100644
--- a/black_list.rb
+++ b/black_list.rb
@@ -5,5 +5,5 @@ BlackList = [
["coq-compcert.3.1.0", "Error: Corrupted compiled interface"],
["coq-compcert.3.3.0", "Error: Corrupted compiled interface"],
- ["coq-ltac2.0.3", "coq-ltac2 -> coq >= 8.10"]
+ ["coq-ltac2.0.3", "While removing coq"]
]
|
Update the black-list for ltac2 due to truncated logs
|
diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb
index abc1234..def5678 100644
--- a/spec/spec_helper_acceptance.rb
+++ b/spec/spec_helper_acceptance.rb
@@ -1,6 +1,6 @@ require 'beaker-rspec'
-install_puppet_agent_on hosts, {}
+install_puppet_on hosts, {}
RSpec.configure do |c|
# Project root
|
Use Puppet 3 in acceptance tests
|
diff --git a/spec/arborist/event/node_spec.rb b/spec/arborist/event/node_spec.rb
index abc1234..def5678 100644
--- a/spec/arborist/event/node_spec.rb
+++ b/spec/arborist/event/node_spec.rb
@@ -0,0 +1,59 @@+#!/usr/bin/env rspec -cfd
+
+require_relative '../../spec_helper'
+
+require 'arborist/node'
+require 'arborist/subscription'
+require 'arborist/event/node'
+
+
+describe Arborist::Event::Node do
+
+ let( :node ) do
+ TestNode.new( 'foo' ) do
+ parent 'bar'
+ description "A testing node"
+ tags :yelp, :yank, :yore, :yandex
+
+ update(
+ "tcp_socket_connect" => {
+ "time" => "2016-02-25 16:04:35 -0800",
+ "duration" => 0.020619
+ }
+ )
+ end
+ end
+ let( :event ) { described_class.new(node) }
+
+
+
+ it "matches match-anything subscriptions" do
+ sub = Arborist::Subscription.new {}
+ expect( event ).to match( sub )
+ end
+
+
+ it "matches subscriptions which have matching criteria" do
+ criteria = {
+ tag: node.tags.last,
+ status: node.status
+ }
+ sub = Arborist::Subscription.new( nil, criteria ) {}
+
+ expect( event ).to match( sub )
+ end
+
+
+ it "matches subscriptions which have non-matching negative criteria" do
+ pending "Adding negative criteria to subscriptions"
+ negative_criteria = {
+ tag: 'nope'
+ }
+ sub = Arborist::Subscription.new( nil, {}, negative_criteria ) {}
+
+ expect( event ).to match( sub )
+ end
+
+
+end
+
|
Add specs for the node event base class
|
diff --git a/spec/chef/recipes/gitaly_spec.rb b/spec/chef/recipes/gitaly_spec.rb
index abc1234..def5678 100644
--- a/spec/chef/recipes/gitaly_spec.rb
+++ b/spec/chef/recipes/gitaly_spec.rb
@@ -13,6 +13,13 @@ end
it_behaves_like "enabled runit service", "gitaly", "root", "root"
+
+ it 'creates expected directories with correct permissions' do
+ expect(chef_run).to create_directory('/var/opt/gitlab/gitaly').with(user: 'git', mode: '0700')
+ expect(chef_run).to create_directory('/var/log/gitlab/gitaly').with(user: 'git', mode: '0700')
+ expect(chef_run).to create_directory('/opt/gitlab/etc/gitaly')
+ expect(chef_run).to create_file('/opt/gitlab/etc/gitaly/PATH')
+ end
end
context 'when gitaly is disabled' do
@@ -21,5 +28,11 @@ end
it_behaves_like "disabled runit service", "gitaly"
+
+ it 'does not create the gitaly directories' do
+ expect(chef_run).to_not create_directory('/var/opt/gitlab/gitaly')
+ expect(chef_run).to_not create_directory('/var/log/gitlab/gitaly')
+ expect(chef_run).to_not create_directory('/opt/gitlab/etc/gitaly')
+ end
end
end
|
Add gitaly tests for the directory creation
|
diff --git a/json_spec.gemspec b/json_spec.gemspec
index abc1234..def5678 100644
--- a/json_spec.gemspec
+++ b/json_spec.gemspec
@@ -17,4 +17,7 @@ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.executables = `git ls-files -- bin/*`.split("\n").map{|f| File.basename(f) }
s.require_paths = ["lib"]
+
+ s.add_dependency "json", "~> 1.0"
+ s.add_dependency "rspec", "~> 2.0"
end
|
Add json and rspec dependencies
|
diff --git a/wkhtmltopdf-heroku.gemspec b/wkhtmltopdf-heroku.gemspec
index abc1234..def5678 100644
--- a/wkhtmltopdf-heroku.gemspec
+++ b/wkhtmltopdf-heroku.gemspec
@@ -6,7 +6,7 @@ s.required_ruby_version = '>= 1.8.7'
s.authors = ["Brad Phelan"]
- s.date = "2015-03-19"
+ s.date = "2015-07-15"
s.description = "wkhtmltopdf binaries heroku"
s.email = "bradphelan@xtargets.com"
s.executables = ["wkhtmltopdf-linux-amd64"]
|
Update gemspec with current date
|
diff --git a/spec/endpoints_spec.rb b/spec/endpoints_spec.rb
index abc1234..def5678 100644
--- a/spec/endpoints_spec.rb
+++ b/spec/endpoints_spec.rb
@@ -11,12 +11,12 @@ describe '#configure payload' do
it 'should add an extra variable to the base_uri' do
client = MakePrintable::Client.new
- expect(client.configure_payload(variable: true)).to eq "http://api.makeprintable.com/?api_key=123apikey&api_secret=123apisecret&variable=true"
+ expect(client.configure_payload('/', variable: true)).to eq "http://api.makeprintable.com/?api_key=123apikey&api_secret=123apisecret&variable=true"
end
it 'should have no problems chaining variables' do
client = MakePrintable::Client.new
- expect(client.configure_payload(variable1: true, variable2: false)).to eq "http://api.makeprintable.com/?api_key=123apikey&api_secret=123apisecret&variable1=true&variable2=false"
+ expect(client.configure_payload('/', variable1: true, variable2: false)).to eq "http://api.makeprintable.com/?api_key=123apikey&api_secret=123apisecret&variable1=true&variable2=false"
end
end
end
|
Fix specs for new base_uri method
|
diff --git a/services/dataservices-metrics/lib/geocoder_usage_metrics.rb b/services/dataservices-metrics/lib/geocoder_usage_metrics.rb
index abc1234..def5678 100644
--- a/services/dataservices-metrics/lib/geocoder_usage_metrics.rb
+++ b/services/dataservices-metrics/lib/geocoder_usage_metrics.rb
@@ -32,7 +32,7 @@ def check_valid_data(service, metric, amount = 0)
raise ArgumentError.new('Invalid service') unless VALID_SERVICES.include?(service)
raise ArgumentError.new('Invalid metric') unless VALID_METRICS.include?(metric)
- raise ArgumentError.new('Invalid geocoder metric amount') if !amount.nil? and amount < 0
+ raise ArgumentError.new('Invalid geocoder metric amount') if amount.nil? || amount <= 0
end
end
end
|
Fix bug in GeocoderUsageMetrics amount checks
|
diff --git a/spec/acceptance/parameter_spec.rb b/spec/acceptance/parameter_spec.rb
index abc1234..def5678 100644
--- a/spec/acceptance/parameter_spec.rb
+++ b/spec/acceptance/parameter_spec.rb
@@ -0,0 +1,48 @@+require 'spec_helper_acceptance'
+
+describe 'rabbitmq parameter on a vhost:' do
+
+ context "create parameter resource" do
+ it 'should run successfully' do
+ pp = <<-EOS
+ if $::osfamily == 'RedHat' {
+ class { 'erlang': epel_enable => true }
+ Class['erlang'] -> Class['::rabbitmq']
+ }
+ class { '::rabbitmq':
+ service_manage => true,
+ port => '5672',
+ delete_guest_user => true,
+ admin_enable => true,
+ }
+
+ rabbitmq_plugin { [ 'rabbitmq_federation_management', 'rabbitmq_federation' ]:
+ ensure => present
+ } ~> Service['rabbitmq-server']
+
+ rabbitmq_vhost { 'fedhost':
+ ensure => present,
+ } ->
+
+ rabbitmq_parameter { 'documentumFed@fedhost':
+ component_name => 'federation-upstream',
+ value => {
+ 'uri' => 'amqp://server',
+ 'expires' => '3600000',
+ },
+ }
+ EOS
+
+ apply_manifest(pp, :catch_failures => true)
+ apply_manifest(pp, :catch_changes => true)
+ end
+
+ it 'should have the parameter' do
+ shell('rabbitmqctl list_parameters -p fedhost') do |r|
+ expect(r.stdout).to match(/federation-upstream.*documentumFed.*expires.*3600000/)
+ expect(r.exit_code).to be_zero
+ end
+ end
+
+ end
+end
|
[MODULES-2281] Add acceptance tests for rabbitmq_parameter
This is an addition to PR 390
|
diff --git a/dcpu16/instructions/set.rb b/dcpu16/instructions/set.rb
index abc1234..def5678 100644
--- a/dcpu16/instructions/set.rb
+++ b/dcpu16/instructions/set.rb
@@ -10,20 +10,49 @@
def execute(emulator)
value = case @b
+ when 0x00..0x07
+ emulator.registers[@b]
+ when 0x08..0x0F
+ emulator.memory[emulator.registers[@b - 0x08]]
+ when 0x10..0x17
+ emulator.memory[@next_word_b + emulator.registers[@b - 0x10]]
+ when 0x1b
+ emulator.sp
+ when 0x1c
+ emulator.pc
+ when 0x1d
+ 0
when 0x1E
emulator.memory[@next_word_b]
when 0x1F
@next_word_b
+ when 0x20..0x3f
+ @b - 0x20
+ else
+ raise "Unknown value: #{@b.to_s(16)}!"
end
case @a
when 0x00..0x07
emulator.registers[@a] = value
- when 0x1e
+ when 0x08..0x0F
+ emulator.memory[emulator.registers[@a - 0x08]] = value
+ when 0x10..0x17
+ emulator.memory[@next_word_a + emulator.registers[@a - 0x10]] = value
+ when 0x1b
+ emulator.sp = value
+ when 0x1c
+ emulator.pc = value
+ when 0x1d
+ p "You tried to assign 0!"
+ when 0x1E
emulator.memory[@next_word_a] = value
- when 0x1f
+ when 0x1F
+ p "You tried to assign a literal value!"
+ when 0x20..0x3f
p "You tried to assign a literal value!"
end
+
end
end
end
|
Complete most of SET instruction. Does not implement stack cases
|
diff --git a/Casks/omnioutliner-beta.rb b/Casks/omnioutliner-beta.rb
index abc1234..def5678 100644
--- a/Casks/omnioutliner-beta.rb
+++ b/Casks/omnioutliner-beta.rb
@@ -1,8 +1,8 @@ cask :v1 => 'omnioutliner-beta' do
- version '4.3.x-r235551'
- sha256 '8584a222621871aa178d27ab5ebba3da042f1ef8b269390148c5e26fe0b8bc50'
+ version '4.3.x-r238997'
+ sha256 '7abf46e9183ba617edc9d80e7587a32e3e555d5ca5868668f5bb7759f7b472c5'
- url "http://omnistaging.omnigroup.com/omnioutliner-4/releases/OmniOutliner-#{version.sub(%r{.*-},'')}-Test.dmg"
+ url "http://omnistaging.omnigroup.com/omnioutliner-4/releases/OmniOutliner-#{version}-Test.dmg"
name 'OmniOutliner'
homepage 'http://omnistaging.omnigroup.com/omnioutliner-4/'
license :commercial
|
Update URL for Omnioutliner Betas
The URL pattern used for Omnioutliner was updated. This commit
updates the url stanza format, and takes the opportunity to
update the version and sha256 stanzas at the same time.
|
diff --git a/Library/Homebrew/test/lib/config.rb b/Library/Homebrew/test/lib/config.rb
index abc1234..def5678 100644
--- a/Library/Homebrew/test/lib/config.rb
+++ b/Library/Homebrew/test/lib/config.rb
@@ -1,6 +1,6 @@ require "tmpdir"
-HOMEBREW_TEMP = Pathname.new(ENV["HOMEBREW_TEMP"] || "/tmp")
+HOMEBREW_TEMP = Pathname.new(ENV["HOMEBREW_TEMP"] || Dir.tmpdir)
TEST_TMPDIR = ENV.fetch("HOMEBREW_TEST_TMPDIR") { |k|
dir = Dir.mktmpdir("homebrew_tests", HOMEBREW_TEMP)
|
Use Dir.tmpdir rather than /tmp in test environment
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.