diff stringlengths 65 26.7k | message stringlengths 7 9.92k |
|---|---|
diff --git a/capybara-slow_finder_errors.gemspec b/capybara-slow_finder_errors.gemspec
index abc1234..def5678 100644
--- a/capybara-slow_finder_errors.gemspec
+++ b/capybara-slow_finder_errors.gemspec
@@ -17,5 +17,5 @@
spec.add_development_dependency "bundler", "~> 1.7"
spec.add_development_dependency "rake", "~> 10.0"
- spec.add_dependency "capybara", "~> 2.5"
+ spec.add_dependency "capybara", "~> 3.0"
end
| Add support to capybara v3
|
diff --git a/lib/tree_rb/extension_digest.rb b/lib/tree_rb/extension_digest.rb
index abc1234..def5678 100644
--- a/lib/tree_rb/extension_digest.rb
+++ b/lib/tree_rb/extension_digest.rb
@@ -1,6 +1,6 @@ # -*- coding: utf-8 -*-
-if RUBY_VERSION =~ /1\.8/
+if RUBY_VERSION =~ /\A1\.8/
# std lib
require 'md5'
else
| Fix detection of ruby version x.1.8
Version 2.1.8 should not be detected as 1.8.
|
diff --git a/spec/controllers/content_controller_spec.rb b/spec/controllers/content_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/content_controller_spec.rb
+++ b/spec/controllers/content_controller_spec.rb
@@ -1,7 +1,7 @@ require 'spec_helper'
describe ContentsController do
- context(:upload) do
+ context('#upload') do
let(:name){ "sakuratrick" }
it "create new content from uploaded file" do
@@ -14,5 +14,13 @@ expect(Content.last.size).to eq(file.size)
expect(Content.last.kind).to eq(Content::Kind::Text)
end
+
+ it "create new content from uploaded file with default name" do
+ file = fixture_file_upload("files/test.txt", "text/plain")
+ expect do
+ post :upload, content: {file: file}
+ end.to change{Content.count}.by 1
+ expect(Content.last.name).to eq("test.txt")
+ end
end
end
| Add spec for content default name
|
diff --git a/app/mailers/new_instructor_enrollment_mailer.rb b/app/mailers/new_instructor_enrollment_mailer.rb
index abc1234..def5678 100644
--- a/app/mailers/new_instructor_enrollment_mailer.rb
+++ b/app/mailers/new_instructor_enrollment_mailer.rb
@@ -4,6 +4,7 @@ def self.send_staff_alert(course:, adder:, new_instructor:)
return unless Features.email?
staffer = SpecialUsers.classroom_program_manager
+ return unless staffer
email(course, staffer, adder, new_instructor).deliver_now
end
| Add guard clause to NewInstructorEnrollmentMailer
|
diff --git a/UrbandManager.podspec b/UrbandManager.podspec
index abc1234..def5678 100644
--- a/UrbandManager.podspec
+++ b/UrbandManager.podspec
@@ -1,19 +1,18 @@ Pod::Spec.new do |s|
- # 1
- s.name = 'UrbandManager'
- s.version = '0.0.7'
- s.ios.deployment_target = '11.0'
- s.summary = 'By far the most fantastic urband manager I have seen in my entire life. No joke.'
+ s.name = 'UrbandManager'
+ s.version = '0.0.8'
+ s.ios.deployment_target = '11.0'
+ s.summary = 'By far the most fantastic urband manager I have seen in my entire life. No joke.'
- s.description = <<-DESC
- This fantastics manager allows you to control the best smartband I have seen in my entire life.
- DESC
+ s.description = <<-DESC
+ This fantastics manager allows you to control the best smartband I have seen in my entire life.
+ DESC
- s.homepage = 'https://github.com/CoatlCo/UrbandManager'
- s.license = { :type => 'MIT', :file => 'LICENSE.md' }
- s.author = { 'specktro' => 'specktro@nonull.mx' }
- s.source = { :git => 'https://github.com/CoatlCo/UrbandManager.git', :tag => "#{s.version}" }
+ s.homepage = 'https://github.com/CoatlCo/UrbandManager'
+ s.license = { :type => 'MIT', :file => 'LICENSE.md' }
+ s.author = { 'specktro' => 'specktro@nonull.mx' }
+ s.source = { :git => 'https://github.com/CoatlCo/UrbandManager.git', :tag => "#{s.version}" }
s.framework = "CoreBluetooth"
- s.source_files = 'UrbandManager/manager/UrbandManager.swift', 'UrbandManager/utilities/Utilities.swift'
+ s.source_files = 'UrbandManager/manager/UrbandManager.swift', 'UrbandManager/utilities/Utilities.swift'
end
| chore: Update pod version to integrate with development
|
diff --git a/actionpack/test/controller/api/with_helpers_test.rb b/actionpack/test/controller/api/with_helpers_test.rb
index abc1234..def5678 100644
--- a/actionpack/test/controller/api/with_helpers_test.rb
+++ b/actionpack/test/controller/api/with_helpers_test.rb
@@ -15,6 +15,12 @@ end
end
+class SubclassWithHelpersController < WithHelpersController
+ def with_helpers
+ render plain: self.class.helpers.my_helper
+ end
+end
+
class WithHelpersTest < ActionController::TestCase
tests WithHelpersController
@@ -24,3 +30,13 @@ assert_equal "helper", response.body
end
end
+
+class SubclassWithHelpersTest < ActionController::TestCase
+ tests WithHelpersController
+
+ def test_with_helpers
+ get :with_helpers
+
+ assert_equal "helper", response.body
+ end
+end
| Add test to make sure subclasses also get helpers
|
diff --git a/app/controllers/api/v2/events_controller.rb b/app/controllers/api/v2/events_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/api/v2/events_controller.rb
+++ b/app/controllers/api/v2/events_controller.rb
@@ -2,8 +2,6 @@ module Api
module V2
class EventsController < ApiController
- PAGINATE_PER = 100
-
before_action :prepare_model
def index
| Set page size for events API to default
|
diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/registrations_controller.rb
+++ b/app/controllers/registrations_controller.rb
@@ -1,8 +1,6 @@ class RegistrationsController < Devise::RegistrationsController
def create
build_resource(sign_up_params)
-
- debugger
resource.class.transaction do
resource.save
| Remove debugger request in Registrations Controller
|
diff --git a/gears/carto_gears_api/spec/carto_gears_api/queue/generic_job_spec.rb b/gears/carto_gears_api/spec/carto_gears_api/queue/generic_job_spec.rb
index abc1234..def5678 100644
--- a/gears/carto_gears_api/spec/carto_gears_api/queue/generic_job_spec.rb
+++ b/gears/carto_gears_api/spec/carto_gears_api/queue/generic_job_spec.rb
@@ -8,7 +8,8 @@ from = 'support@carto.com'
to = 'backend@carto.com'
subject = 'test email'
- CartoGearsApi::Mailers::TestMail.any_instance.should_receive(:test_mail).with(from, to, subject)
+ # CartoGearsApi::Mailers::TestMail.any_instance.should_receive(:test_mail).with(from, to, subject)
+ Object.any_instance.should_receive(:test_mail).with(from, to, subject)
CartoGearsApi::Queue::GenericJob.perform('CartoGearsApi::Mailers::TestMail', :test_mail, from, to, subject)
end
end
| Fix Gears test for Rails 4
There is some interaction going on with reflected instantiations
so even though the previous code worked in Rails 3, it doesn't now
|
diff --git a/app/helpers/application_helper/button/instance_attach.rb b/app/helpers/application_helper/button/instance_attach.rb
index abc1234..def5678 100644
--- a/app/helpers/application_helper/button/instance_attach.rb
+++ b/app/helpers/application_helper/button/instance_attach.rb
@@ -1,6 +1,6 @@ class ApplicationHelper::Button::InstanceAttach < ApplicationHelper::Button::Basic
def disabled?
- if @record.cloud_tenant.cloud_volumes.where(:status => 'available').count.zero?
+ if @record.cloud_tenant.nil? || @record.cloud_tenant.cloud_volumes.where(:status => 'available').count.zero?
@error_message = _("There are no Cloud Volumes available to attach to this Instance.")
end
@error_message.present?
| Check for presence of cloud tenant before checking it for volumes
|
diff --git a/app/models/spree/fulfillment/configuration.rb b/app/models/spree/fulfillment/configuration.rb
index abc1234..def5678 100644
--- a/app/models/spree/fulfillment/configuration.rb
+++ b/app/models/spree/fulfillment/configuration.rb
@@ -8,7 +8,7 @@ preference :load_most_recent_reports, :boolean, default: false
def amazon_provider
- @amazon_provider ||= Providers::Amazon::Provider.new
+ @amazon_provider ||= ::Spree::Fulfillment::Providers::Amazon::Provider.new
end
end
end | Fix lazy loading of amazon provider
|
diff --git a/db/migrate/20091007165821_merge_and_remove_document_natures.rb b/db/migrate/20091007165821_merge_and_remove_document_natures.rb
index abc1234..def5678 100644
--- a/db/migrate/20091007165821_merge_and_remove_document_natures.rb
+++ b/db/migrate/20091007165821_merge_and_remove_document_natures.rb
@@ -0,0 +1,35 @@+class MergeAndRemoveDocumentNatures < ActiveRecord::Migration
+ def self.up
+ add_column :document_templates, :code, :string, :limit=>32
+ add_column :document_templates, :family, :string, :limit=>32
+ add_column :document_templates, :to_archive, :boolean
+
+ for nature in select_all("SELECT * FROM document_natures")
+ execute "UPDATE document_templates SET code='#{nature['code'].gsub('\'','\'\'')}', family='#{nature['family'].gsub('\'','\'\'')}', to_archive=CAST('#{nature['to_archive']}' AS BOOLEAN) WHERE nature_id=#{nature['id']}"
+ end
+
+ remove_column :document_templates, :nature_id
+ drop_table :document_natures
+ end
+
+ def self.down
+ create_table :document_natures do |t|
+ t.column :name, :string, :null=>false
+ t.column :code, :string, :null=>false
+ t.column :to_archive, :boolean, :null=>false, :default=>false
+ t.column :family, :string
+ t.column :company_id, :integer, :null=>false, :references=>:companies
+ end
+ add_index :document_natures, :company_id
+ add_column :document_templates, :nature_id, :integer
+
+ for nature in select_all("SELECT * FROM document_templates")
+ id = insert "INSERT INTO document_natures (created_at, updated_at, company_id, name, code, family, to_archive) SELECT CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, #{nature['company_id']}, '#{nature['name'].gsub('\'','\'\'')}', '#{nature['code'].gsub('\'','\'\'')}', '#{nature['family'].gsub('\'','\'\'')}', CAST('#{nature['to_archive']}' AS BOOLEAN)"
+ execute "UPDATE document_templates SET nature_id=#{id} WHERE id=#{nature['id']}"
+ end
+
+ remove_column :document_templates, :code
+ remove_column :document_templates, :family
+ remove_column :document_templates, :to_archive
+ end
+end
| Add the forgottten migrtion which permits to delete document_natures
git-svn-id: ca470d9146711862cf4ac2dac85cf4a5bf568169@1217 67a09383-3dfa-4221-8551-890bac9c277c
|
diff --git a/Muon.podspec b/Muon.podspec
index abc1234..def5678 100644
--- a/Muon.podspec
+++ b/Muon.podspec
@@ -12,7 +12,6 @@ s.source = { :git => "https://github.com/younata/Muon.git" }
s.source_files = "Muon", "Muon/**/*.{swift,h,m}"
- s.framework = "XCTest"
s.requires_arc = true
end
| Remove XCTest framework from podspec.
|
diff --git a/docs/salesforce_scripts/connect_courses_to_salesforce.rb b/docs/salesforce_scripts/connect_courses_to_salesforce.rb
index abc1234..def5678 100644
--- a/docs/salesforce_scripts/connect_courses_to_salesforce.rb
+++ b/docs/salesforce_scripts/connect_courses_to_salesforce.rb
@@ -31,11 +31,15 @@ def search_salesforce_for(course)
# some characters are not allowed in Salesforce queries, including colon, dash, apostrophe
sanitized_title = course.title.gsub(/[:\-\']/, '')
- @client.search('FIND {' + sanitized_title + '} RETURNING Course__c (Course_Dashboard__c, Id)')
+ @client.search('FIND {' + sanitized_title + '} RETURNING Course__c (Course_Dashboard__c, Course_Page__c, Id)')
end
def includes_course_slug?(record, slug)
record_url = record.Course_Dashboard__c
+ unless record_url
+ record_url = record.Course_Page__c
+ puts record_url
+ end
return false unless record_url
return true if record_url.include? slug
return true if record_url.include? CGI.escape(slug).gsub('%2F', '/')
| Update Salesforce connection script to handle old course urls
|
diff --git a/provisioner/spec/automator_spec.rb b/provisioner/spec/automator_spec.rb
index abc1234..def5678 100644
--- a/provisioner/spec/automator_spec.rb
+++ b/provisioner/spec/automator_spec.rb
@@ -2,4 +2,22 @@
describe Automator do
+ # Set these up once
+ before :all do
+ %w(bootstrap install configure initialize start stop remove).each do |taskname|
+ instance_variable_set("@task_#{taskname}", {'taskName' => taskname})
+ instance_variable_set("@automator_#{taskname}", Automator.new(instance_variable_get("@task_#{taskname}")))
+ end
+ end
+
+ describe '#new' do
+ %w(bootstrap install configure initialize start stop remove).each do |taskname|
+ it "creates an instance of Automator for taskName=#{taskname}" do
+ instance_variable_get("@automator_#{taskname}").should be_an_instance_of Automator
+ end
+ it "creates task instance variable for taskName=#{taskname}" do
+ instance_variable_get("@automator_#{taskname}").task.should eql instance_variable_get("@task_#{taskname}")
+ end
+ end
+ end
end
| Create a task instance variable for each task type and create an instance of Automator for each, then test that each gets created
|
diff --git a/cookbooks/travis_build_environment/recipes/couchdb.rb b/cookbooks/travis_build_environment/recipes/couchdb.rb
index abc1234..def5678 100644
--- a/cookbooks/travis_build_environment/recipes/couchdb.rb
+++ b/cookbooks/travis_build_environment/recipes/couchdb.rb
@@ -27,12 +27,21 @@ group 'root'
mode 0o644
end
-
-cookbook_file '/etc/couchdb/local.d/erlang_query_server.ini' do
- source 'erlang_query_server.ini'
- owner 'root'
- group 'root'
- mode 0o644
+case node['lsb']['codename']
+when 'trusty' , 'xenia'
+ cookbook_file '/etc/couchdb/local.d/erlang_query_server.ini' do
+ source 'erlang_query_server.ini'
+ owner 'root'
+ group 'root'
+ mode 0o644
+ end
+when 'bionic'
+ cookbook_file '/opt/etc/couchdb/local.d/erlang_query_server.ini' do
+ source 'erlang_query_server.ini'
+ owner 'root'
+ group 'root'
+ mode 0o644
+ end
end
apt_repository 'couchdb' do
| Install erlang query server configure in bionic due to upstream's change
|
diff --git a/minimal-mistakes-jekyll.gemspec b/minimal-mistakes-jekyll.gemspec
index abc1234..def5678 100644
--- a/minimal-mistakes-jekyll.gemspec
+++ b/minimal-mistakes-jekyll.gemspec
@@ -15,7 +15,8 @@ f.match(%r{^(assets|_(includes|layouts|sass)/|(LICENSE|README|CHANGELOG)((\.(txt|md|markdown)|$)))}i)
end
- spec.add_development_dependency "jekyll", "~> 3.3"
+ spec.add_dependency "jekyll", "~> 3.3"
+
spec.add_development_dependency "bundler", "~> 1.12"
spec.add_development_dependency "rake", "~> 10.0"
| Add Jekyll v3.3 as dependency
|
diff --git a/spec/helpers/application_helper/buttons/orchestration_stack_retire_now_spec.rb b/spec/helpers/application_helper/buttons/orchestration_stack_retire_now_spec.rb
index abc1234..def5678 100644
--- a/spec/helpers/application_helper/buttons/orchestration_stack_retire_now_spec.rb
+++ b/spec/helpers/application_helper/buttons/orchestration_stack_retire_now_spec.rb
@@ -0,0 +1,18 @@+describe ApplicationHelper::Button::OrchestrationStackRetireNow do
+ let(:view_context) { setup_view_context_with_sandbox({}) }
+ let(:record) { FactoryGirl.create(:orchestration_stack, :retired => retired) }
+ let(:button) { described_class.new(view_context, {}, {'record' => record}, {}) }
+
+ describe '#calculate_properties' do
+ before { button.calculate_properties }
+
+ context 'when Orchestration Stack is retired' do
+ let(:retired) { true }
+ it_behaves_like 'a disabled button', 'Orchestration Stack is already retired'
+ end
+ context 'when OrchestrationStack is not retired' do
+ let(:retired) { false }
+ it_behaves_like 'an enabled button'
+ end
+ end
+end
| Create spec examples for OrchestrationStackRetireNow button class
|
diff --git a/cookbooks/nagios-xi/recipes/default.rb b/cookbooks/nagios-xi/recipes/default.rb
index abc1234..def5678 100644
--- a/cookbooks/nagios-xi/recipes/default.rb
+++ b/cookbooks/nagios-xi/recipes/default.rb
@@ -11,7 +11,7 @@
if node.platform == "centos"
- ["php-ldap" "procmail" ].each do |svc|
+%w["php-ldap" "procmail" ].each do |svc|
package pkg do
action :install
end
| Fix some bad ruby in the nagios-xi recipe
Former-commit-id: 1df14a0d4506b057f5752c08d6fe1d390d7ce392 [formerly 16cc13ed1fbd5ca596c7b468ad9858b542dc388e] [formerly 6eb599da4a86545f6a3091e77893bfa2854e1d3d [formerly 723a5bd5231be7759e2cb22cd73f0db281492175]]
Former-commit-id: 10f8d17d133b68fa1c3fa352ec800e7b7a4d5302 [formerly 79ec7d11dcc28f923a4b0385998b06c8c6cc4535]
Former-commit-id: a26874d2d32572cd243d9ed2640cc722d6d13935 |
diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/user_controller.rb
+++ b/app/controllers/user_controller.rb
@@ -1,4 +1,6 @@ class UserController < ApplicationController
+ before_filter :authenticate, except: [:comments]
+
def bookmark_contents
data = client.bookmark_contents(page_params)
@contents = data.contents
@@ -55,6 +57,10 @@ end
private
+ def authenticate
+ redirect_to :login unless authenticated?
+ end
+
def handle_remote
begin
yield
| Add authenticate filter to user actions.
|
diff --git a/msgpack-rpc-over-http.gemspec b/msgpack-rpc-over-http.gemspec
index abc1234..def5678 100644
--- a/msgpack-rpc-over-http.gemspec
+++ b/msgpack-rpc-over-http.gemspec
@@ -17,7 +17,7 @@
gem.add_runtime_dependency "rack"
gem.add_runtime_dependency "msgpack", "~> 0.5.5"
- gem.add_runtime_dependency "celluloid", "~> 0.12.3"
+ gem.add_runtime_dependency "celluloid", "~> 0.16.0"
gem.add_runtime_dependency "httpclient"
gem.add_development_dependency "rake"
| Fix broken celluloid dependent version
* celluloid 0.12.x depends on any versions of celluloid/timers
* but celluloid/timers newly released versions isn't compatible w/ celluloid 0.12.x
* so tests fails
* With celluloid 0.16.0, tests runs successfully
|
diff --git a/modules/requests_unsupported.rb b/modules/requests_unsupported.rb
index abc1234..def5678 100644
--- a/modules/requests_unsupported.rb
+++ b/modules/requests_unsupported.rb
@@ -10,10 +10,6 @@ def find_all(*)
raise Unsupported, "this model may not use the #{__method__} method."
end
-
- def find(*)
- raise Unsupported, "this model may not use the #{__method__} method."
- end
end
private_constant :Unsupported
| Allow the `find` method for "unsupported" models
|
diff --git a/lib/RubyWings.rb b/lib/RubyWings.rb
index abc1234..def5678 100644
--- a/lib/RubyWings.rb
+++ b/lib/RubyWings.rb
@@ -1,4 +1,19 @@ require 'RubyWings/version'
+
+
+# Make access to hash values easier
+class ::Nil
+ def blank?
+ true
+ end
+end
+
+class ::String
+ def blank?
+ empty?
+ end
+end
+
module RubyWings
# Your code goes here...
| [FEATURE] Add blank? method known from Rails
|
diff --git a/stemcell.gemspec b/stemcell.gemspec
index abc1234..def5678 100644
--- a/stemcell.gemspec
+++ b/stemcell.gemspec
@@ -18,6 +18,5 @@ gem.require_paths = ["lib"]
gem.add_runtime_dependency 'trollop', '~> 2.0'
gem.add_runtime_dependency 'aws-sdk', '~> 1.9'
- gem.add_runtime_dependency 'fog', '~> 1.10'
end
| Remove fog dependency since we're not using it now
|
diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb
index abc1234..def5678 100644
--- a/config/initializers/secret_token.rb
+++ b/config/initializers/secret_token.rb
@@ -4,4 +4,4 @@ # If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
-Wmsb::Application.config.secret_token = 'ff13a48a6e8bb755a1841f11d45b0c482253a3779dd09e778b45a5dfb3d7ce31d7e204e5c34237bb19ee99c2dafcba0d0dad89138cb41f1786e3134b336e553c'
+Wmsb::Application.config.secret_token = ENV['SECRET_TOKEN'] || 'ff13a48a6e8bb755a1841f11d45b0c482253a3779dd09e778b45a5dfb3d7ce31d7e204e5c34237bb19ee99c2dafcba0d0dad89138cb41f1786e3134b336e553c'
| Set secret token from environment variable
|
diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb
index abc1234..def5678 100644
--- a/config/initializers/secret_token.rb
+++ b/config/initializers/secret_token.rb
@@ -4,4 +4,4 @@ # If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
-MemberDirectory::Application.config.secret_token = '94949ffc3a55ce7afdd582199e38aa1f826d6843003a732b6ee1a37ace5f7207a8638ad39c9e2f84ab386a7357cf2380297a60bf1fe7db93cf1bae033451e011'
+MemberDirectory::Application.config.secret_token = ENV['SESSION_SECRET_DIRECTORY'] || SecureRandom.hex(32)
| Remove session secret from version control
Because duh. Allow setting by env var, or generate a random one if missing (only really for development/test)
|
diff --git a/business.gemspec b/business.gemspec
index abc1234..def5678 100644
--- a/business.gemspec
+++ b/business.gemspec
@@ -23,5 +23,5 @@ spec.add_development_dependency "gc_ruboconfig", "~> 2.23.0"
spec.add_development_dependency "rspec", "~> 3.1"
spec.add_development_dependency "rspec_junit_formatter", "~> 0.4.1"
- spec.add_development_dependency "rubocop", "~> 1.6.0"
+ spec.add_development_dependency "rubocop", "~> 1.8.0"
end
| Update rubocop requirement from ~> 1.6.0 to ~> 1.8.0
Updates the requirements on [rubocop](https://github.com/rubocop-hq/rubocop) to permit the latest version.
- [Release notes](https://github.com/rubocop-hq/rubocop/releases)
- [Changelog](https://github.com/rubocop-hq/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop-hq/rubocop/compare/v1.6.0...v1.8.0)
Signed-off-by: dependabot-preview[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com> |
diff --git a/lib/awestruct/textilable.rb b/lib/awestruct/textilable.rb
index abc1234..def5678 100644
--- a/lib/awestruct/textilable.rb
+++ b/lib/awestruct/textilable.rb
@@ -4,11 +4,14 @@ def render(context)
rendered = ''
begin
+ # security and rendering restrictions
+ # ex. site.textile = ['no_span_caps']
+ restrictions = (site.textile || []).map { |r| r.to_sym }
# a module of rule functions is included in RedCloth using RedCloth.send(:include, MyRules)
# rule functions on that module are activated by setting the property site.textile_rules
# ex. site.textile_rules = ['emoticons']
rules = context.site.textile_rules ? context.site.textile_rules.map { |r| r.to_sym } : []
- rendered = RedCloth.new( context.interpolate_string( raw_page_content ) ).to_html(*rules)
+ rendered = RedCloth.new( context.interpolate_string( raw_page_content ), restrictions ).to_html(*rules)
rescue => e
puts e
puts e.backtrace
| Add textile security & rendering restrictions config
|
diff --git a/lib/fhir/handmade/coding.rb b/lib/fhir/handmade/coding.rb
index abc1234..def5678 100644
--- a/lib/fhir/handmade/coding.rb
+++ b/lib/fhir/handmade/coding.rb
@@ -11,10 +11,15 @@
def initialize(raw_attrs)
attrs = raw_attrs.dup
+ system = attrs[:system]
- if attrs[:system].respond_to?(:uri)
- attrs[:system] = attrs[:system].uri
- end
+ attrs[:system] = if system.respond_to?(:uri)
+ system.uri
+ elsif system.is_a?(Symbol)
+ Fhir::CodeSystem[system].uri
+ else
+ system
+ end
super(attrs)
end
| Allow to use symbolic CS name in constructor of Fhir::Coding.
|
diff --git a/lib/chrono_model/railtie.rb b/lib/chrono_model/railtie.rb
index abc1234..def5678 100644
--- a/lib/chrono_model/railtie.rb
+++ b/lib/chrono_model/railtie.rb
@@ -2,9 +2,7 @@ class Railtie < ::Rails::Railtie
ActiveRecord::Tasks::DatabaseTasks.register_task /chronomodel/, ActiveRecord::Tasks::PostgreSQLDatabaseTasks
- setup = lambda { ActiveRecord::Base.connection.chrono_setup }
-
- initializer :chrono_initialize, &setup
+ setup = proc { ActiveRecord::Base.connection.chrono_setup! }
rake_tasks do
load 'chrono_model/schema_format.rake'
| Remove Rails initializer, to follow Rails' behaviour :grinning:
The initializer would trigger a database connection and check for
needed upgrades. Rails currently does not have this behavior, and
it connects to the database when an ActiveRecord is referenced.
This change makes ChronoModel do its stuff when it is actually
requested, following Rails' behavior.
|
diff --git a/lib/git_sentiment/format.rb b/lib/git_sentiment/format.rb
index abc1234..def5678 100644
--- a/lib/git_sentiment/format.rb
+++ b/lib/git_sentiment/format.rb
@@ -8,9 +8,12 @@ end
def file_path
- @file_path ||= File.open("git-sentiment.#{name.downcase}", 'w') do |file|
+ @file_path ||= begin
+ file = File.open("git-sentiment.#{name.downcase}", 'w')
file.write formatted
- end.path
+ file.close
+ file.path
+ end
end
def name
| Return file path instead of exit code
|
diff --git a/lib/global_session/rails.rb b/lib/global_session/rails.rb
index abc1234..def5678 100644
--- a/lib/global_session/rails.rb
+++ b/lib/global_session/rails.rb
@@ -1,7 +1,8 @@ basedir = File.dirname(__FILE__)
require 'rack/contrib/cookies'
-
+require 'actionpack'
+require 'action_controller'
#Require the files necessary for Rails integration
require 'global_session/rack'
| Add some requires so we can activate GlobalSession the right way. |
diff --git a/lib/csv2avro/avro_writer.rb b/lib/csv2avro/avro_writer.rb
index abc1234..def5678 100644
--- a/lib/csv2avro/avro_writer.rb
+++ b/lib/csv2avro/avro_writer.rb
@@ -17,11 +17,11 @@ end
def writer_schema
- avro_writer.datum_writer.writers_schema
+ @avro_writer.datum_writer.writers_schema
end
def write(hash)
- avro_writer << hash
+ @avro_writer << hash
end
end
end
| Use ivar when calling dependency |
diff --git a/lib/four_chan.rb b/lib/four_chan.rb
index abc1234..def5678 100644
--- a/lib/four_chan.rb
+++ b/lib/four_chan.rb
@@ -0,0 +1,101 @@+require 'nokogiri'
+require 'open-uri'
+require 'fileutils'
+
+class FourChan
+ BASE_URL = "http://boards.4chan.org"
+ BOARDS = ["b", "x", "a", "pol", "soc", "s4s"]
+ BASE_PATH = "assets"
+
+ class NotUserImageException < StandardError; end
+ class ExtensionNotSupportedException < StandardError; end
+
+ def initialize
+ @image_names = []
+ @load_index = -1
+
+ @save_lock = Mutex.new
+ @load_lock = Mutex.new
+
+ 3.times { Thread.new { download_random_image } }
+ end
+
+ def random_image_path
+ Thread.new { download_random_image }
+
+ image_name = @load_lock.synchronize do
+ index = [@load_index + 1, @image_names.count].min
+ image_name = @image_names.at(index)
+ @load_index = index
+ image_name
+ end
+
+ "assets/#{image_name}"
+ end
+
+ def release_asset(path)
+ name = path.split("/").last
+
+ @save_lock.synchronize do
+ index = @image_names.index(name)
+ @image_names.slice!(index)
+ end
+
+ FileUtils.rm_rf(path)
+ end
+
+ def clean_up
+ @save_lock.synchronize do
+ @image_names.each do |name|
+ FileUtils.rm_rf("assets/#{name}")
+ end
+
+ @image_names.clear
+ end
+ end
+
+ private
+
+ def download_random_image
+ image_url = random_image_url
+ image_name = image_url.split("/").last
+ extension = image_name.split(".").last
+
+ @save_lock.synchronize do
+ @image_names << image_name
+ image_name
+ end
+
+ open("assets/#{image_name}", 'wb') do |file|
+ file << open("http://#{image_url}").read
+ end
+ end
+
+ def random_page_url
+ board = BOARDS.sample
+ page = Random.rand(10)
+
+ url = "#{BASE_URL}/#{board}/#{page}"
+ end
+
+ def random_image_url
+ html = Nokogiri::HTML(open(random_page_url))
+ images = html.css("img")
+ count = images.count
+ image_url = images.at(Random.rand(count)).attributes["src"].value
+
+ raise NotUserImageException unless image_url.include?("//i.4cdn.org")
+
+ extension = image_url.split(".").last
+
+ raise ExtensionNotSupportedException unless ["jpg", "png"].include?(extension)
+
+ image_url.gsub!("//i.4cdn.org", "i.4cdn.org")
+ rescue NotUserImageException, ExtensionNotSupportedException
+ retries ||= 0
+
+ retry if (retries += 1) < 10
+
+ return nil
+ end
+end
| Add loading of random images from 4chan
|
diff --git a/app/models/api_key.rb b/app/models/api_key.rb
index abc1234..def5678 100644
--- a/app/models/api_key.rb
+++ b/app/models/api_key.rb
@@ -9,6 +9,7 @@ #
class ApiKey < ActiveRecord::Base
+ attr_accessible :access_token
before_create :generate_access_token
private
| Allow editing of api key access token
|
diff --git a/app/models/invoice.rb b/app/models/invoice.rb
index abc1234..def5678 100644
--- a/app/models/invoice.rb
+++ b/app/models/invoice.rb
@@ -11,7 +11,7 @@ validates_presence_of :customer, :company, :title, :amount, :state
# Bookings
- has_many :bookings, :as => :reference
+ has_many :bookings, :as => :reference, :dependent => :destroy
def build_booking
booking = bookings.build(:amount => amount, :value_date => value_date)
| Destroy associated bookings for Invoice.
|
diff --git a/config/initializers/dashboard_trial.rb b/config/initializers/dashboard_trial.rb
index abc1234..def5678 100644
--- a/config/initializers/dashboard_trial.rb
+++ b/config/initializers/dashboard_trial.rb
@@ -1,6 +1,7 @@-Rails.configuration.dashboard_trial = %w[
- Belmarsh
- Cardiff
- Coldingley
- Pentonville
+Rails.configuration.dashboard_trial = [
+ 'Belmarsh',
+ 'Cardiff',
+ 'Coldingley',
+ 'Pentonville',
+ 'Wormwood Scrubs'
]
| Add Wormwood Scrubs to the trial
|
diff --git a/lib/foreman/export/nginx.rb b/lib/foreman/export/nginx.rb
index abc1234..def5678 100644
--- a/lib/foreman/export/nginx.rb
+++ b/lib/foreman/export/nginx.rb
@@ -1,6 +1,6 @@ module Foreman
module Export
- class Nginx
+ class Nginx < Foreman::Export::Base
def export
super
| Use the right base class
|
diff --git a/approximately.gemspec b/approximately.gemspec
index abc1234..def5678 100644
--- a/approximately.gemspec
+++ b/approximately.gemspec
@@ -25,7 +25,7 @@
spec.add_dependency 'activerecord'
- spec.add_development_dependency 'bundler', '~> 1.3'
+ spec.add_development_dependency 'bundler', ">= 2.2.33"
spec.add_development_dependency 'rake'
spec.add_development_dependency 'rspec', '~> 2.14'
spec.add_development_dependency 'pry'
| Update Bundler to non-vulnerable version
|
diff --git a/lib/roper/repository/active_record/client_repository.rb b/lib/roper/repository/active_record/client_repository.rb
index abc1234..def5678 100644
--- a/lib/roper/repository/active_record/client_repository.rb
+++ b/lib/roper/repository/active_record/client_repository.rb
@@ -11,7 +11,7 @@ def new(attributes = {})
instance = model_class.new(attributes)
instance.client_id = UUIDTools::UUID.random_create.to_s
- instance.client_secret = Digest::SHA1.hexdigest(UUIDTools::UUID.random_create.to_s)
+ instance.client_secret = UUIDTools::UUID.random_create.to_s
instance
end
| Remove unnecessary double hash of client_secret
|
diff --git a/lib/tor_proxy.rb b/lib/tor_proxy.rb
index abc1234..def5678 100644
--- a/lib/tor_proxy.rb
+++ b/lib/tor_proxy.rb
@@ -5,24 +5,18 @@
module Tor
class Proxy
- def initialize host = 'localhost', port = 9050
+ def initialize(host = 'localhost', port = 9050)
unless Tor.available?
raise <<-EOS
Tor isn't installed. Install Tor to use this module.
See http://torproject.org or `brew install tor`.
EOS
end
-
@proxy = Net::HTTP.SOCKSProxy host, port
end
- def get url
- @proxy.get URI.parse(url)
- end
-
- def self.get url
- @@proxy ||= self.new
- @@proxy.get url
+ def method_missing(m, *args, &block)
+ @proxy.send(m, *args, &block)
end
end
end
| Replace Tor::Proxy instance methods with a method_missing that delegates
to the underlying Net::HTTP.SOCKSProxy instance.
|
diff --git a/king_konf.gemspec b/king_konf.gemspec
index abc1234..def5678 100644
--- a/king_konf.gemspec
+++ b/king_konf.gemspec
@@ -20,7 +20,7 @@
spec.require_paths = ["lib"]
- spec.add_development_dependency "bundler", "~> 1.15"
+ spec.add_development_dependency "bundler", "~> 2"
spec.add_development_dependency "rake", "~> 10.0"
spec.add_development_dependency "rspec", "~> 3.0"
spec.add_development_dependency "rspec_junit_formatter"
| Update the dev dependency on Bundler
|
diff --git a/acts_as_paranoid.gemspec b/acts_as_paranoid.gemspec
index abc1234..def5678 100644
--- a/acts_as_paranoid.gemspec
+++ b/acts_as_paranoid.gemspec
@@ -24,4 +24,5 @@ spec.add_development_dependency "bundler", "~> 1.5"
spec.add_development_dependency "rake"
spec.add_development_dependency "rdoc"
+ spec.add_development_dependency "minitest", "~> 4.0"
end
| Add minitest as development dependency to let tests run on Ruby 1.8
|
diff --git a/jobs/languages.rb b/jobs/languages.rb
index abc1234..def5678 100644
--- a/jobs/languages.rb
+++ b/jobs/languages.rb
@@ -29,7 +29,7 @@ }
languages
- .select { |_, val| val > 0.01 }
+ .select { |_, val| val.fdiv(sum) > 0.01 }
.sort_by{ |_, val| val }
.reverse
.each do |lang, val|
| Fix language selection in sorting.
|
diff --git a/db/migrate/20130912021553_create_distributors_payment_methods.rb b/db/migrate/20130912021553_create_distributors_payment_methods.rb
index abc1234..def5678 100644
--- a/db/migrate/20130912021553_create_distributors_payment_methods.rb
+++ b/db/migrate/20130912021553_create_distributors_payment_methods.rb
@@ -1,4 +1,9 @@ class CreateDistributorsPaymentMethods < ActiveRecord::Migration
+ class Spree::PaymentMethod < ActiveRecord::Base
+ belongs_to :distributor, class_name: 'Enterprise'
+ has_and_belongs_to_many :distributors, join_table: 'distributors_payment_methods', :class_name => 'Enterprise', association_foreign_key: 'distributor_id'
+ end
+
def up
create_table :distributors_payment_methods, :id => false do |t|
t.references :distributor
| Fix migration - dependency on modified model relations
|
diff --git a/db/migrate/20140828062935_add_division_id_to_policy_divisions.rb b/db/migrate/20140828062935_add_division_id_to_policy_divisions.rb
index abc1234..def5678 100644
--- a/db/migrate/20140828062935_add_division_id_to_policy_divisions.rb
+++ b/db/migrate/20140828062935_add_division_id_to_policy_divisions.rb
@@ -3,7 +3,7 @@ add_column :policy_divisions, :division_id, :integer
PolicyDivision.reset_column_information
PolicyDivision.all.find_each do |pd|
- division = Division.find_by!(date: pd.division_date, number: pd.division_number, house: pd.house)
+ division = Division.find_by!(date: pd.read_attribute(:division_date), number: pd.read_attribute(:division_number), house: pd.read_attribute(:house))
pd.update!(division_id: division.id)
end
end
| Read attributes directly since they're delegated to non-existent model
|
diff --git a/app/controllers/gobierto_budgets/budget_lines_controller.rb b/app/controllers/gobierto_budgets/budget_lines_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/gobierto_budgets/budget_lines_controller.rb
+++ b/app/controllers/gobierto_budgets/budget_lines_controller.rb
@@ -19,9 +19,6 @@ @place = INE::Places::Place.find_by_slug params[:slug]
@year = params[:year]
@code = params[:code]
- if @code.include?('-')
- redirect_to gobierto_budgets_budget_line_path(params[:slug], @year, @code.tr('-0', ''), params[:kind], params[:area]) and return
- end
@kind = ( %w{income i}.include?(params[:kind].downcase) ? GobiertoBudgets::BudgetLine::INCOME : GobiertoBudgets::BudgetLine::EXPENSE )
@area_name = params[:area] || 'economic'
| Fix redirect for level 4 category
|
diff --git a/lib/lagomorph/supervisor.rb b/lib/lagomorph/supervisor.rb
index abc1234..def5678 100644
--- a/lib/lagomorph/supervisor.rb
+++ b/lib/lagomorph/supervisor.rb
@@ -9,7 +9,7 @@ end
def route(queue_name, worker_class, options = {})
- prefetch = options.fetch :prefetch, 10
+ prefetch = options.fetch :prefetch, 1
durable = options.fetch :durable, false
subscribers = options.fetch :subscribers, 1
| Use prefetch 1 by default since concurrency is via multiple subscribes
Each subscription will use a separate consumer, and hence having
a higher value than 1 means a single thread (one per consumer)
will back up.
|
diff --git a/aurb.gemspec b/aurb.gemspec
index abc1234..def5678 100644
--- a/aurb.gemspec
+++ b/aurb.gemspec
@@ -1,14 +1,18 @@ Gem::Specification.new do |s|
s.name = 'aurb'
s.version = '0.5.2'
- s.date = '2009-04-07'
- s.summary = 'A simple AUR utility'
- s.email = 'gigamo@gmail.com'
- s.homepage = 'http://github.com/gigamo/aurb'
+ s.date = %q{2009-04-07}
+ s.summary = %q{A simple AUR utility}
+ s.email = %q{gigamo@gmail.com}
+ s.homepage = %q{http://github.com/gigamo/aurb}
s.description = s.summary
- s.rubyforge_project = 'aurb'
- s.has_rdoc = false
+ s.rubyforge_project = %q{aurb}
+ s.executables = ['aurb']
+ s.has_rdoc = true
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Aurb", "--main", "README"]
s.authors = ['Gigamo']
s.files = ['bin/aurb', 'aurb.gemspec', 'README']
- s.bindir = 'bin'
+ s.bindir = %q{bin}
+ s.add_dependency 'json'
+ s.add_dependency 'facets'
end
| Add dependencies and executable to the Gem. Maybe it will work properly now. |
diff --git a/app.rb b/app.rb
index abc1234..def5678 100644
--- a/app.rb
+++ b/app.rb
@@ -1,5 +1,7 @@ require 'sinatra'
require 'haml'
+
+set :port, 3000
# GET home page.
get '/' do
| Set the default port to 3000
|
diff --git a/init.rb b/init.rb
index abc1234..def5678 100644
--- a/init.rb
+++ b/init.rb
@@ -1,6 +1,6 @@ =begin
-*- coding: utf-8 -*-
-Copyright (C) 2014 MATOBA Akihiro <matobaa+github@gmail.com>
+Copyright (C) 2014,2021 MATOBA Akihiro <matobaa+github@gmail.com>
All rights reserved.
This software is licensed as described in the file LICENSE, which
@@ -11,12 +11,12 @@ name 'LDRize plugin'
author 'Akihiro MATOBA'
description 'vi-like keyboard navigation with j or k key'
- version '0.0.1'
+ version '0.0.2'
url 'https://github.com/matobaa/redmine_ld_rize'
author_url 'https://www.github.com/matobaa'
end
-class LDRizeHooks < Redmine::Hook::ViewListener
+Class.new(Redmine::Hook::ViewListener) do |c|
def view_layouts_base_html_head(context = { })
javascript_include_tag('ld_rize.js', :plugin => 'redmine_ld_rize') +
stylesheet_link_tag('ld_rize.css', :plugin => 'redmine_ld_rize')
| Fix a bug on reload by Zeitwerk.
Thanks for an advice by tohosaku
|
diff --git a/test/test_all.rb b/test/test_all.rb
index abc1234..def5678 100644
--- a/test/test_all.rb
+++ b/test/test_all.rb
@@ -3,5 +3,5 @@ #puts Net::SSH::Version::CURRENT
require 'common'
Dir.chdir(File.dirname(__FILE__)) do
- Dir['**/test_*.rb'].each { |file| require(file) }
+ Dir['**/test_*.rb'].each { |file| require(file) unless file == File.basename(__FILE__) }
end | Remove a warning "loading in progress, circular require considered harmful" in test
|
diff --git a/ruby/iteration.rb b/ruby/iteration.rb
index abc1234..def5678 100644
--- a/ruby/iteration.rb
+++ b/ruby/iteration.rb
@@ -1,16 +1,10 @@ def bag_search
- bag = ["wallet", "phone", "calculator", "gum", "key"]
- puts bag
- puts "This is right before our block"
- yield
- puts "Our block just ran. Wasn't it great?"
+ item1 = "wallet"
+ item2 = "keys"
+ puts "I'm about to look in your bag"
+ yield(item1, item2)
+ puts "Now I know what's in your bag."
end
-bag_search do |item|
- if bag.include? (item)
- puts "You've got it in the bag!"
- else
- puts "Better luck next time"
- end
-end+bag_search {|item1, item2| puts "Your bag has #{item1} and #{item2}"} | Add code for method that takes a block
|
diff --git a/lib/rollbar/rails_runner.rb b/lib/rollbar/rails_runner.rb
index abc1234..def5678 100644
--- a/lib/rollbar/rails_runner.rb
+++ b/lib/rollbar/rails_runner.rb
@@ -18,6 +18,12 @@ end
end
+ attr_reader :command
+
+ def initialize
+ @command = ARGV[0]
+ end
+
def run
prepare_environment
@@ -34,13 +40,13 @@
Module.module_eval(<<-EOL,__FILE__,__LINE__ + 2)
#{string_to_eval}
- EOL
+ EOL
end
def rollbar_managed
yield
rescue => e
- Rollbar.error(e)
+ Rollbar.scope(:context => command).error(e)
raise
end
| Send running command as context to our API.
|
diff --git a/app/models/study_updater.rb b/app/models/study_updater.rb
index abc1234..def5678 100644
--- a/app/models/study_updater.rb
+++ b/app/models/study_updater.rb
@@ -1,8 +1,8 @@ class StudyUpdater
def update_studies(nct_ids:)
+ destroy_old_records(nct_ids)
nct_ids.each do |nct_id|
@client = ClinicalTrials::Client.new(search_term: nct_id)
- destroy_old_record(nct_id)
create_new_xml_record(nct_id)
create_new_study(nct_id)
end
@@ -10,14 +10,15 @@
private
- def destroy_old_record(nct_id)
- xml = StudyXmlRecord.find_by(nct_id: nct_id)
- study = Study.find_by(nct_id: nct_id)
+ def destroy_old_records(nct_ids)
+ xml_records = StudyXmlRecord.where(nct_id: nct_ids)
+ studies = Study.where(nct_id: nct_ids)
- xml.try(:destroy)
- puts "Destroyed #{xml}"
- study.try(:destroy)
- puts "Destroyed #{study}"
+ puts "Destroying #{xml_records.count} xml records"
+ xml_records.try(:destroy_all)
+
+ puts "Destroying #{studies.count} studies and their related tables"
+ studies.try(:destroy_all)
end
def create_new_xml_record(nct_id)
| Delete studies in one fell swoop.
|
diff --git a/lib/whipped-cream/server.rb b/lib/whipped-cream/server.rb
index abc1234..def5678 100644
--- a/lib/whipped-cream/server.rb
+++ b/lib/whipped-cream/server.rb
@@ -39,7 +39,7 @@ end
def start_web(options = {})
- options = options.merge({ app: web, port: port })
+ options = { app: web, port: port }.merge(options)
Rack::Server.start options
end
| Fix port number with daemonization
Thor options hash is actually a HashWithIndifferentAccess, and calling #merge
on it creates a hash with string keys, which Rack::Server does not accept
[fix #20]
|
diff --git a/lib/tasks/data_hygiene.rake b/lib/tasks/data_hygiene.rake
index abc1234..def5678 100644
--- a/lib/tasks/data_hygiene.rake
+++ b/lib/tasks/data_hygiene.rake
@@ -32,4 +32,9 @@ call_change_note_remover(args[:content_id], args[:locale], args[:query], dry_run: false)
end
end
+
+ desc "Bulk update the organisations associated with documents."
+ task :bulk_update_organisation, %i(csv_filename) => :environment do |_, args|
+ DataHygiene::BulkOrganisationUpdater.call(args[:csv_filename])
+ end
end
| Add a Rake task for bulk updating organisations
This uses the bulk organisation updater class to perform the actual
change.
|
diff --git a/lib/tasks/i18n_hygiene.rake b/lib/tasks/i18n_hygiene.rake
index abc1234..def5678 100644
--- a/lib/tasks/i18n_hygiene.rake
+++ b/lib/tasks/i18n_hygiene.rake
@@ -1,5 +1,18 @@ namespace :i18n do
namespace :hygiene do
+
+ desc "Check there are no values containing return symbols"
+ task check_return_symbols: :environment do
+ puts "Checking that no values contain return symbols i.e. U+23CE ..."
+
+ keys_with_return_symbols = I18n::Hygiene::KeysWithReturnSymbol.new
+
+ keys_with_return_symbols.each { |key| puts "- #{key}" }
+
+ puts "Finished checking.\n\n"
+
+ exit(1) if keys_with_return_symbols.any?
+ end
desc "Check there are no values containing scripts"
task check_script_tags: :environment do
| Copy check_return_symbols rake task from TC
|
diff --git a/test/models/gobierto_data/favorite_test.rb b/test/models/gobierto_data/favorite_test.rb
index abc1234..def5678 100644
--- a/test/models/gobierto_data/favorite_test.rb
+++ b/test/models/gobierto_data/favorite_test.rb
@@ -0,0 +1,15 @@+# frozen_string_literal: true
+
+require "test_helper"
+
+module GobiertoData
+ class FavoriteTest < ActiveSupport::TestCase
+ def subject
+ @subject ||= gobierto_data_favorites(:dennis_users_dataset_favorite)
+ end
+
+ def test_valid
+ assert subject.valid?
+ end
+ end
+end
| Add model test of GobiertoData::Favorite
|
diff --git a/recipes/diff_merge.rb b/recipes/diff_merge.rb
index abc1234..def5678 100644
--- a/recipes/diff_merge.rb
+++ b/recipes/diff_merge.rb
@@ -13,9 +13,8 @@ end
# Configure git unless otherwise requested
-node["diffmerge"] ||= {}
-node["diffmerge"]["configure-git"] ||= 1
-if node["diffmerge"]["configure-git"] != 0
+diffmerge = node["diffmerge"] || {}
+if (diffmerge["configure-git"] || 1) != 0
[
%q[git config --global diff.tool diffmerge],
| Change use of 'node' configuration to avoid Chef warning
|
diff --git a/features/steps/awesome_events_steps.rb b/features/steps/awesome_events_steps.rb
index abc1234..def5678 100644
--- a/features/steps/awesome_events_steps.rb
+++ b/features/steps/awesome_events_steps.rb
@@ -9,7 +9,8 @@ end
When /^I create a group object$/ do
- @group = AwesomeEvents::Upcoming::Group.new(:api_key => @api_key, :id => @group_id)
+ @config = AwesomeEvents::Upcoming::Config.new(:api_key => @api_key)
+ @group = AwesomeEvents::Upcoming::Group.new(:id => @group_id, :config => @config)
end
When /^I lookup group's upcoming events$/ do
| Modify test interface to use new config object. |
diff --git a/spec/lib/danger/request_sources/support/get_ignored_violation_spec.rb b/spec/lib/danger/request_sources/support/get_ignored_violation_spec.rb
index abc1234..def5678 100644
--- a/spec/lib/danger/request_sources/support/get_ignored_violation_spec.rb
+++ b/spec/lib/danger/request_sources/support/get_ignored_violation_spec.rb
@@ -16,5 +16,14 @@ expect(result).to eq ["This build didn't pass tests"]
end
end
+
+ context "With specific ignore sentence contains escapted quote" do
+ it "returns content in the quotes" do
+ sentence = %("ignoring this:\r\n>Danger: Ignore \"`TophatModels.v20` changed.\"")
+ result = described_class.new(sentence).call
+
+ expect(result).to eq [%(`TophatModels.v20` changed.)]
+ end
+ end
end
end
| Add a real-world case for GetIgnoredViolation
|
diff --git a/spec/services/merge_requests/merge_request_diff_cache_service_spec.rb b/spec/services/merge_requests/merge_request_diff_cache_service_spec.rb
index abc1234..def5678 100644
--- a/spec/services/merge_requests/merge_request_diff_cache_service_spec.rb
+++ b/spec/services/merge_requests/merge_request_diff_cache_service_spec.rb
@@ -6,7 +6,7 @@ describe '#execute' do
it 'retrieves the diff files to cache the highlighted result' do
merge_request = create(:merge_request)
- cache_key = [merge_request.merge_request_diff, 'highlighted-diff-files', Gitlab::Diff::FileCollection::MergeRequest.default_options]
+ cache_key = [merge_request.merge_request_diff, 'highlighted-diff-files', Gitlab::Diff::FileCollection::MergeRequestDiff.default_options]
expect(Rails.cache).to receive(:read).with(cache_key).and_return({})
expect(Rails.cache).to receive(:write).with(cache_key, anything)
| Fix merge request diff cache service spec
Signed-off-by: Dmitriy Zaporozhets <be23d75b156792e5acab51b196a2deb155d35d6a@gmail.com>
|
diff --git a/app/models/assessment.rb b/app/models/assessment.rb
index abc1234..def5678 100644
--- a/app/models/assessment.rb
+++ b/app/models/assessment.rb
@@ -7,7 +7,7 @@
def self.star_math; where(family: "STAR", subject: "Math").last_or_missing end
- def self.star_reading; where(family: "MCAS", subject: "Math").last_or_missing end
+ def self.star_reading; where(family: "STAR", subject: "Reading").last_or_missing end
def self.map_test; where(family: "MAP").last_or_missing end
| Fix copy/paste mistake. Thank you specs for catching this! :100:
|
diff --git a/app/models/log/filter.rb b/app/models/log/filter.rb
index abc1234..def5678 100644
--- a/app/models/log/filter.rb
+++ b/app/models/log/filter.rb
@@ -7,8 +7,8 @@ end
def results
- clauses.reduce(collection) do |search_query, clause|
- filter_clause(search_query, clause)
+ clauses.reduce(collection) do |collection, clause|
+ filter(collection, clause)
end
end
@@ -35,7 +35,7 @@ clauses
end
- def filter_clause(collection, clause)
+ def filter(collection, clause)
if clause.respond_to?(:keys)
collection.where(clause)
else
| Rename methods to improve intent
|
diff --git a/gears/carto_gears_api/spec/carto_gears_api/users_service_spec.rb b/gears/carto_gears_api/spec/carto_gears_api/users_service_spec.rb
index abc1234..def5678 100644
--- a/gears/carto_gears_api/spec/carto_gears_api/users_service_spec.rb
+++ b/gears/carto_gears_api/spec/carto_gears_api/users_service_spec.rb
@@ -5,26 +5,23 @@ describe '#logged_user' do
module CartoDB; end
- let(:id) { 'b51e56fb-f3c9-463f-b950-d9be188551e5' }
- let(:username) { 'wadus_username' }
- let(:email) { 'wadus@carto.com' }
-
let(:service) { CartoGearsApi::Users::UsersService.new }
# This test is 100% bound to implementation. It's mostly a PoC for unit testing
# within Gears and should not be used as an example.
it 'returns the logged user based on subdomain and warden' do
- user = double
- user.stub(:id).and_return(id)
- user.stub(:username).and_return(username)
- user.stub(:email).and_return(email)
- user.stub(:organization).and_return(nil)
- user.stub(:feature_flags).and_return([])
+ user = CartoGearsApi::Users::User.with(
+ id: 'b51e56fb-f3c9-463f-b950-d9be188551e5',
+ username: 'wadus_username',
+ email: 'wadus@carto.com',
+ organization: nil,
+ feature_flags: [],
+ can_change_email: true)
warden = double
warden.should_receive(:user).once.and_return(user)
request = double
request.should_receive(:env).once.and_return('warden' => warden)
- CartoDB.should_receive(:extract_subdomain).with(request).and_return(username)
+ CartoDB.should_receive(:extract_subdomain).with(request).and_return(user.username)
logged_user = service.logged_user(request)
logged_user.email.should eq user.email
| Replace user double with value
|
diff --git a/carrierwave-blitline.gemspec b/carrierwave-blitline.gemspec
index abc1234..def5678 100644
--- a/carrierwave-blitline.gemspec
+++ b/carrierwave-blitline.gemspec
@@ -24,4 +24,5 @@ spec.add_development_dependency "bundler", "~> 1.13"
spec.add_development_dependency "rake", "~> 10.0"
spec.add_development_dependency "rspec"
+ spec.add_development_dependency "rspec_junit_formatter"
end
| Add rspec_junit_formatter gem for CircleCI tests
|
diff --git a/super_settings.gemspec b/super_settings.gemspec
index abc1234..def5678 100644
--- a/super_settings.gemspec
+++ b/super_settings.gemspec
@@ -18,5 +18,6 @@
s.add_development_dependency "sqlite3"
s.add_development_dependency "rspec"
+ s.add_development_dependency "rubocop"
s.add_development_dependency "simplecov"
end
| Add rubocop as development dependency
|
diff --git a/super_settings.gemspec b/super_settings.gemspec
index abc1234..def5678 100644
--- a/super_settings.gemspec
+++ b/super_settings.gemspec
@@ -18,5 +18,6 @@
s.add_development_dependency "sqlite3"
s.add_development_dependency "rspec"
+ s.add_development_dependency "rubocop"
s.add_development_dependency "simplecov"
end
| Add rubocop as development dependency
|
diff --git a/db/migrate/20140328162816_create_lost_missing_long_overdues.rb b/db/migrate/20140328162816_create_lost_missing_long_overdues.rb
index abc1234..def5678 100644
--- a/db/migrate/20140328162816_create_lost_missing_long_overdues.rb
+++ b/db/migrate/20140328162816_create_lost_missing_long_overdues.rb
@@ -9,7 +9,7 @@ t.string :status
t.integer :checkouts
t.string :location
- t.array :note
+ t.text :note
t.string :call_number
t.string :volume
t.string :barcode
| Change Array to Text in migration
|
diff --git a/spec/requests/pwb/sessions_spec.rb b/spec/requests/pwb/sessions_spec.rb
index abc1234..def5678 100644
--- a/spec/requests/pwb/sessions_spec.rb
+++ b/spec/requests/pwb/sessions_spec.rb
@@ -8,8 +8,6 @@ end
it "signs user in and out" do
- # user = User.create!(email: "user@example.org", password: "very-secret")
-
sign_in @admin_user
get pwb.admin_path
# byebug
@@ -21,6 +19,10 @@ expect(response).to redirect_to(pwb.new_user_session_path)
end
+
+ after(:all) do
+ @agency.destroy
+ @admin_user.destroy
+ end
end
-
end
| Clean up in sessions spec
|
diff --git a/config/initializers/carrierwave.rb b/config/initializers/carrierwave.rb
index abc1234..def5678 100644
--- a/config/initializers/carrierwave.rb
+++ b/config/initializers/carrierwave.rb
@@ -5,4 +5,15 @@ config.ignore_integrity_errors = false
config.ignore_processing_errors = false
config.ignore_download_errors = false
+
+ # Configure fog for AWS s3
+ config.fog_credentials = {
+ :provider => 'AWS', # required
+ :aws_access_key_id => 'xxx', # required
+ :aws_secret_access_key => 'yyy', # required
+ :region => 'eu-west-1' # optional, defaults to 'us-east-1'
+ }
+ config.fog_directory = 'name_of_your_aws_bucket' # required
+ # see https://github.com/jnicklas/carrierwave#using-amazon-s3
+ # for more optional configuration
end
| Add example configs for fog
|
diff --git a/config/initializers/carrierwave.rb b/config/initializers/carrierwave.rb
index abc1234..def5678 100644
--- a/config/initializers/carrierwave.rb
+++ b/config/initializers/carrierwave.rb
@@ -4,10 +4,10 @@ provider: 'AWS',
aws_access_key_id: ENV['AWS_ACCESS_KEY_ID'],
aws_secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'],
- region: ENV['S3_REGION'],
- path_style: true
+ region: ENV['S3_REGION']
}
config.fog_directory = ENV['S3_BUCKET_NAME']
+ config.asset_host = "https://s3.amazonaws.com/#{config.fog_directory}"
config.storage = :fog
else
| Set asset host for path-style S3 URLs
Signed-off-by: Max Fierke <0706025b2bbcec1ed8d64822f4eccd96314938d0@maxfierke.com>
|
diff --git a/config/software/oc-pushy-pedant.rb b/config/software/oc-pushy-pedant.rb
index abc1234..def5678 100644
--- a/config/software/oc-pushy-pedant.rb
+++ b/config/software/oc-pushy-pedant.rb
@@ -15,7 +15,7 @@ #
name "oc-pushy-pedant"
-default_version "2.0.0-alpha.3"
+default_version "2.0.0-alpha.3.1"
# TODO: use the public git:// uri once this repo is public
source git: "git@github.com:opscode/oc-pushy-pedant"
| Update pedant to relax timing constraints
Update oc-pushy-pedant to 2.0.0-alpha.3.1
|
diff --git a/config/deploy.rb b/config/deploy.rb
index abc1234..def5678 100644
--- a/config/deploy.rb
+++ b/config/deploy.rb
@@ -12,14 +12,19 @@ role :app, domain
role :db, domain, :primary => true
-# Passenger
require 'bundler/deployment'
namespace :deploy do
- task :start do ; end
- task :stop do ; end
+ task :start do
+ # ...
+ end
+
+ task :stop do
+ # ...
+ end
+
task :restart, :roles => :app, :except => { :no_release => true } do
- run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
+ # ...
end
task :symlink_config do
| Remove Passenger specific Cap tasks |
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,6 +1,6 @@ Ecm::Links::Backend::Engine.routes.draw do
- backend_resources :categories
- backend_resources :links
+ resources :categories
+ resources :links
root to: 'home#index'
end
| Use default methods for routing.
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -8,10 +8,6 @@ get "/signup", to: "users#new"
post "/signup", to: "users#create"
-
- #get "/login", to: "sessions#new"
-
- #post "/login", to: "sessions#create"
get "/main", to: "main_chat#index", as: :main_chat
| Add /callback route for SoundCloud auth
|
diff --git a/test/test_quill_builder_html.rb b/test/test_quill_builder_html.rb
index abc1234..def5678 100644
--- a/test/test_quill_builder_html.rb
+++ b/test/test_quill_builder_html.rb
@@ -5,12 +5,26 @@ def test_convert_text_only
input = {
ops: [
+ { insert: "aaa\n" },
+ ]
+ }
+ output = Quill::Builder::HTML.new(input.to_json).convert_to_lines
+ expect = [
+ { block: :p, inlines: [ { attrs: [], text: 'aaa' } ] }
+ ]
+ assert_equal(expect, output)
+ end
+
+ def test_convert_text_only_with_newline
+ input = {
+ ops: [
{ insert: "aaa\nbbb\n" },
]
}
- output = Quill::Builder::HTML.new(input.to_json).convert_intermediate
+ output = Quill::Builder::HTML.new(input.to_json).convert_to_lines
expect = [
- { attrs: [], text: "aaa\nbbb\n" }
+ { block: :p, inlines: [ { attrs: [], text: 'aaa' } ] },
+ { block: :p, inlines: [ { attrs: [], text: 'bbb' } ] }
]
assert_equal(expect, output)
end
@@ -26,11 +40,16 @@ { insert: "a\n" }
]
}
- output = Quill::Builder::HTML.new(input.to_json).convert_intermediate
+ output = Quill::Builder::HTML.new(input.to_json).convert_to_lines
expect = [
- { text: 'a', attrs: [] },
- { text: 'aaaa', attrs: [["<b>", "</b>"]] },
- { text: "a\n", attrs: [] }
+ {
+ block: :p,
+ inlines: [
+ { attrs: [], text: 'a' },
+ { attrs: [['<b>', '</b>']], text: 'aaaa' },
+ { attrs: [], text: 'a' }
+ ]
+ }
]
assert_equal(expect, output)
end
| Fix tests for new logic
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -3,6 +3,7 @@ namespace 'oauth2' do
resources :authorizations, :only => :create
end
- match 'oauth2/authorize', :to => 'oauth2/authorizations#new'
- post 'oauth2/token', :to => proc { |env| TokenEndpoint.new.call(env) }
+
+ match 'oauth2/authorize' => 'oauth2/authorizations#new'
+ post 'oauth2/token' => TokenEndpoint.new
end
| Use latest Rails 3 router syntax
I'm assuming TokenEndpoint.new responds to `#call` and returns something like `[status, headers, body]`. If not the lambda may still be required. The `:to => path` is not however. |
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -9,5 +9,7 @@ match '/access_violation' => 'home#access_violation', :as => :access_violation
end
- resources :clubs, :only => [ :edit, :update ]
+ resources :clubs, :only => [ :edit, :update ] do
+ resources :courses, :only => [ :create ]
+ end
end
| Add Club Courses Create Route
Add a route for creating a Club Course.
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,6 +1,7 @@ CouchI18n::Engine.routes.draw do
root :to => "translations#index"
- resources :translations, constraints: {id: /[\w:\.]+/} do
+ # allow escaped forms (%+) and unescaped forms (: ) (note the space!!) as id
+ resources :translations, constraints: {id: /[\w:% \.\+]+/} do
collection do
post :export
post :import
| Allow spaces in translation ids
|
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,6 @@ Rails.application.routes.draw do
+ root 'admin/sites#index'
+
namespace :admin do
root 'root#index'
| Set root route to prevent 404 error
|
diff --git a/lib/miniphonic.rb b/lib/miniphonic.rb
index abc1234..def5678 100644
--- a/lib/miniphonic.rb
+++ b/lib/miniphonic.rb
@@ -13,7 +13,10 @@ end
def connect
- connection = Faraday.new(url: 'https://auphonic.com')
+ connection = Faraday.new(url: 'https://auphonic.com') do |con|
+ con.request :multipart
+ con.adapter :net_http
+ end
connection.basic_auth user, password
connection
end
| Add minimal middleware stack (for file upload)
|
diff --git a/core/app/classes/formatted_comment_content.rb b/core/app/classes/formatted_comment_content.rb
index abc1234..def5678 100644
--- a/core/app/classes/formatted_comment_content.rb
+++ b/core/app/classes/formatted_comment_content.rb
@@ -11,19 +11,17 @@
private
- AUTO_LINK_RE = %r{(?:(http|https)://|www\.)[^\s<\u00A0]+}i
- FACTLINK_PRETTY_URL = %r{#{FactlinkUI::Application.config.core_url}/[a-z0-9\-_]+/f/([0-9]+)}i
+ AUTO_LINK_RE = %r{(?:(?<scheme>http|https)://|www\.)[^\s<\u00A0]+}i
+ FACTLINK_PRETTY_URL = %r{#{FactlinkUI::Application.config.core_url}/[a-z0-9\-_]+/f/(?<id>[0-9]+)}i
def urls_to_link_tags text
text.gsub(AUTO_LINK_RE) do |href|
- scheme = Regexp.last_match[1]
-
link_text = href
- href = 'http://' + href unless scheme
+ href = 'http://' + href unless Regexp.last_match[:scheme]
case href
when FACTLINK_PRETTY_URL
- factlink_link_tag Regexp.last_match[1]
+ factlink_link_tag Regexp.last_match[:id]
else
content_tag :a, link_text, href: href, target: '_blank'
end
| Use named groups in regexes
|
diff --git a/lib/active_set.rb b/lib/active_set.rb
index abc1234..def5678 100644
--- a/lib/active_set.rb
+++ b/lib/active_set.rb
@@ -50,6 +50,6 @@
def transform(instructions)
transformer = TransformProcessor.new(@set, instructions)
- self.class.new(transformer.process)
+ transformer.process
end
end
| Fix bug where `transform` method tried to return a new instance of ActiveSet
It should simply returned the transformed value
|
diff --git a/lib/arg-parser.rb b/lib/arg-parser.rb
index abc1234..def5678 100644
--- a/lib/arg-parser.rb
+++ b/lib/arg-parser.rb
@@ -39,15 +39,28 @@ arg
end
def arg_for_option option
- opt = self.get_arg_for_option option
- yield opt
+ begin
+ opt = self.get_arg_for_option option
+ rescue ParseError => error
+ end
+
+ if error
+ yield opt, error
+ else
+ yield opt
+ end
end
end
if __FILE__ == $0
x = ArgParser.new ARGV
- x.arg_for_option "-b" do |x|
+ x.arg_for_option "-b" do |x, e|
+ if e
+ puts e.message
+ puts e.object
+ exit -1
+ end
puts x
end
| Improve error handling in argument blocks.
|
diff --git a/lib/bitmap_cli.rb b/lib/bitmap_cli.rb
index abc1234..def5678 100644
--- a/lib/bitmap_cli.rb
+++ b/lib/bitmap_cli.rb
@@ -23,6 +23,7 @@ clear_image
when 'L'
puts 'L'
+ colour_pixel(*args)
when 'V'
puts 'Vertical Line'
when 'H'
@@ -47,4 +48,14 @@ puts "Image not initialized"
end
end
+
+ def colour_pixel(*args)
+ begin
+ @image.set_pixel_colour(*args)
+ rescue NoMethodError => e
+ puts "Image not initialized"
+ rescue ArgumentError => a
+ puts "Incorrect number of arguments for command, requires x-position, y-position & colour"
+ end
+ end
end
| Add command for colouring a single pixel |
diff --git a/lib/librarian/puppet/environment.rb b/lib/librarian/puppet/environment.rb
index abc1234..def5678 100644
--- a/lib/librarian/puppet/environment.rb
+++ b/lib/librarian/puppet/environment.rb
@@ -13,6 +13,14 @@ def install_path
project_path.join("modules")
end
+
+ def cache_path
+ project_path.join(".tmp/librarian/cache")
+ end
+
+ def scratch_path
+ project_path.join(".tmp/librarian/scratch")
+ end
end
end
end
| Change the temp dir to be a hidden folder
|
diff --git a/lib/vpn_module.rb b/lib/vpn_module.rb
index abc1234..def5678 100644
--- a/lib/vpn_module.rb
+++ b/lib/vpn_module.rb
@@ -24,6 +24,8 @@ return certificate_bundle.presigned_url(:get, expires_in: 10.minutes.to_i) if certificate_bundle.exists?
create_certificate_for(filename)
nil
+ rescue # If S3 errors for any reason then we return nil so that the application does not error
+ nil
end
def cert_ready_for?(filename)
@@ -34,10 +36,14 @@
def bucket_file_exists?(filename)
@bucket_connection.object(filename).exists?
+ rescue
+ false
end
def create_certificate_for(filename)
@bucket_connection.object(filename).put
+ rescue
+ false
end
end
end
| Add rescue statements for S3 so that S3 does not cause our whole site to not work if it goes down
|
diff --git a/lib/netzke/core/component_config.rb b/lib/netzke/core/component_config.rb
index abc1234..def5678 100644
--- a/lib/netzke/core/component_config.rb
+++ b/lib/netzke/core/component_config.rb
@@ -1,12 +1,12 @@ module Netzke::Core
class ComponentConfig < ActiveSupport::OrderedOptions
def initialize(name)
- @name = name.to_s
+ self.name = name.to_s
end
def set_defaults!
- self.item_id ||= @name # default item_id
- self.klass ||= @name.camelize.constantize # default klass
+ self.item_id ||= name # default item_id
+ self.klass ||= name.camelize.constantize # default klass
end
end
end
| Make child component name accessible by +config.name+
|
diff --git a/spec/unit/search/presenters/highlighted_title_spec.rb b/spec/unit/search/presenters/highlighted_title_spec.rb
index abc1234..def5678 100644
--- a/spec/unit/search/presenters/highlighted_title_spec.rb
+++ b/spec/unit/search/presenters/highlighted_title_spec.rb
@@ -1,7 +1,7 @@ require 'spec_helper'
RSpec.describe Search::HighlightedTitle do
- it "title_highlighted" do
+ it "highlights the title" do
title = described_class.new({
"fields" => { "title" => "A Title" },
"highlight" => { "title" => ["A Highlighted Title"] }
@@ -10,7 +10,7 @@ expect(title.text).to eq("A Highlighted Title")
end
- it "fallback_title_is_escaped" do
+ it "escapes the title when it falls back to the unhighlighted title" do
title = described_class.new({
"fields" => { "title" => "A & Title" },
})
| Tidy up names of highlighted title test
These tests were automatically migrated from Minitest to RSpec.
|
diff --git a/lib/rakuten_web_service/response.rb b/lib/rakuten_web_service/response.rb
index abc1234..def5678 100644
--- a/lib/rakuten_web_service/response.rb
+++ b/lib/rakuten_web_service/response.rb
@@ -11,22 +11,21 @@ @json[key]
end
- def []=(key, value)
- @json[key] = value
- end
-
def each
resources.each do |resource|
yield resource
end
end
- def page
- @json['page']
+ %w[count hits page first last carrier pageCount].each do |name|
+ method_name = name.gsub(/([a-z])([A-Z]{1})/) { "#{$1}_#{$2.downcase}" }
+ define_method method_name do
+ self[name]
+ end
end
def resources
- @resource_class.parse_response(@json)
+ @resources ||= @resource_class.parse_response(@json)
end
def has_next_page?
@@ -34,7 +33,7 @@ end
def last_page?
- page >= @json['pageCount']
+ page >= page_count
end
end
end
| Define methods of RWS::Response to fetch overall information
|
diff --git a/lib/rdf/allegro_graph/repository.rb b/lib/rdf/allegro_graph/repository.rb
index abc1234..def5678 100644
--- a/lib/rdf/allegro_graph/repository.rb
+++ b/lib/rdf/allegro_graph/repository.rb
@@ -1,11 +1,6 @@ module RDF::AllegroGraph
# An AllegroGraph RDF repository.
class Repository < AbstractRepository
-
-
- #--------------------------------------------------------------------
- # @group RDF::Repository methods
-
# Create a new AllegroGraph repository adapter.
#
# @param [Hash{Symbol => Object}] options
@@ -22,7 +17,5 @@ def session
Session.new(@repo)
end
-
- protected
end
end
| Repository: Remove leftover cruft from refactoring
|
diff --git a/lib/tasks/auto_annotate_models.rake b/lib/tasks/auto_annotate_models.rake
index abc1234..def5678 100644
--- a/lib/tasks/auto_annotate_models.rake
+++ b/lib/tasks/auto_annotate_models.rake
@@ -20,7 +20,7 @@ 'exclude_fixtures' => 'false',
'exclude_factories' => 'false',
'ignore_model_sub_dir' => 'true',
- 'skip_on_db_migrate' => 'true',
+ 'skip_on_db_migrate' => 'false',
'format_bare' => 'true',
'format_rdoc' => 'false',
'format_markdown' => 'false',
@@ -30,5 +30,5 @@ )
end
- Annotate.load_tasks if ENV.key? 'ENABLE_ANNOTATIONS'
+ Annotate.load_tasks unless ENV.key? 'DISABLE_ANNOTATIONS'
end
| Make disable annotate more intuitive.
Leave default behavior on db:migrate to autorun but check for disable instead of enable flag.
Annotate will not run by default if in "development", but only if 'DISABLE_ANNOTATIONS = true' is an ENV variable
|
diff --git a/roles/milkywan.rb b/roles/milkywan.rb
index abc1234..def5678 100644
--- a/roles/milkywan.rb
+++ b/roles/milkywan.rb
@@ -10,7 +10,7 @@ :hosted_by => "MilkyWan",
:location => "France",
:networking => {
- :nameservers => ["130.117.11.11", "2a0b:cbc0:42::42"],
+ :nameservers => ["8.8.8.8", "2a0b:cbc0:42::42"],
:roles => {
:external => {
:zone => "osm"
| Use a working IPv4 resolved for necrosan
|
diff --git a/lib/vim-flavor/versionconstraint.rb b/lib/vim-flavor/versionconstraint.rb
index abc1234..def5678 100644
--- a/lib/vim-flavor/versionconstraint.rb
+++ b/lib/vim-flavor/versionconstraint.rb
@@ -34,11 +34,15 @@
def compatible?(version)
if qualifier == '~>'
- self.base_version.bump() > version and version >= self.base_version
+ PlainVersion === version and
+ self.base_version.bump() > version and
+ version >= self.base_version
elsif qualifier == '>='
- version >= self.base_version
+ PlainVersion === version and
+ version >= self.base_version
elsif qualifier == 'branch:'
- version.branch == self.base_version.branch
+ BranchVersion === version and
+ version.branch == self.base_version.branch
else
raise NotImplementedError
end
| Support changing type of VersionConstraint
|
diff --git a/lib/elasticsearch/bulk_index_worker.rb b/lib/elasticsearch/bulk_index_worker.rb
index abc1234..def5678 100644
--- a/lib/elasticsearch/bulk_index_worker.rb
+++ b/lib/elasticsearch/bulk_index_worker.rb
@@ -4,6 +4,7 @@ module Elasticsearch
class BulkIndexWorker
include Sidekiq::Worker
+ sidekiq_options :retry => 5
def logger
Logging.logger[self]
| Make the indexing worker retry fewer times.
The default number of retries is 25, with exponential backoff, which
will cause a request to be retried for about three weeks after it's
initially submitted. By this time, there's a good chance the document
will be out of date anyway. Five retries over about 7 minutes seems like
a far more sensible default.
See <https://github.com/mperham/sidekiq/wiki/Error-Handling>.
|
diff --git a/lib/feed2email.rb b/lib/feed2email.rb
index abc1234..def5678 100644
--- a/lib/feed2email.rb
+++ b/lib/feed2email.rb
@@ -1,19 +1,19 @@+require 'feed2email/config'
+require 'feed2email/logger'
+
module Feed2Email
CONFIG_DIR = File.expand_path('~/.feed2email')
- def self.config
- @config ||= Config.new(File.join(CONFIG_DIR, 'config.yml'))
- end
+ def self.config; @config end
- def self.logger
- @logger ||= Logger.new(config['log_path'], config['log_level'],
- config['log_shift_age'], config['log_shift_size'])
- end
+ def self.logger; @logger end
def self.log(*args)
logger.log(*args) # delegate
end
+
+ @config = Config.new(File.join(CONFIG_DIR, 'config.yml'))
+
+ @logger = Logger.new(config['log_path'], config['log_level'],
+ config['log_shift_age'], config['log_shift_size'])
end
-
-require 'feed2email/config'
-require 'feed2email/logger'
| Use instance variables in module scope
|
diff --git a/lib/gmo-payment-carrier/http/client.rb b/lib/gmo-payment-carrier/http/client.rb
index abc1234..def5678 100644
--- a/lib/gmo-payment-carrier/http/client.rb
+++ b/lib/gmo-payment-carrier/http/client.rb
@@ -46,7 +46,7 @@ Response.new(
connection.send(
request_method,
- URI.escape(path),
+ path,
params,
headers,
)
| Fix URI.escape is obsolete warnings
The "path" of GMOPaymentCarrier::Const::API_INFOS is specified.
So, no encoding is required.
|
diff --git a/equalizer.gemspec b/equalizer.gemspec
index abc1234..def5678 100644
--- a/equalizer.gemspec
+++ b/equalizer.gemspec
@@ -12,12 +12,12 @@ gem.homepage = 'https://github.com/dkubb/equalizer'
gem.licenses = 'MIT'
- gem.required_ruby_version = '>= 1.8.7'
-
gem.require_paths = %w[lib]
gem.files = `git ls-files`.split("\n")
gem.test_files = `git ls-files -- spec/{unit,integration}`.split("\n")
gem.extra_rdoc_files = %w[LICENSE README.md CONTRIBUTING.md]
+ gem.required_ruby_version = '>= 1.8.7'
+
gem.add_development_dependency('bundler', '~> 1.3', '>= 1.3.5')
end
| Move require statement closer to other dependencies
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.