diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/lib/hairballs.rb b/lib/hairballs.rb
index abc1234..def5678 100644
--- a/lib/hairballs.rb
+++ b/lib/hairballs.rb
@@ -1,8 +1,10 @@ require_relative 'hairballs/version'
+require_relative 'hairballs/helpers'
require_relative 'hairballs/theme'
+class Hairballs
+ extend Helpers
-class Hairballs
def self.themes
@themes ||= []
end
@@ -17,7 +19,7 @@
def self.use_theme(theme_name)
switch_to = themes.find { |theme| theme.name == theme_name }
- fail 'meow' unless switch_to
+ fail "Theme not found: :#{theme_name}." unless switch_to
puts "found theme: #{switch_to.name}"
switch_to.use!
|
Use helpers in base class
|
diff --git a/lib/qu/worker.rb b/lib/qu/worker.rb
index abc1234..def5678 100644
--- a/lib/qu/worker.rb
+++ b/lib/qu/worker.rb
@@ -39,14 +39,12 @@ end
def start
- Qu.logger.info "Starting worker #{id}"
handle_signals
Qu.backend.register_worker(self)
loop { work }
rescue Abort => e
# Ok, we'll shut down, but give us a sec
ensure
- Qu.logger.info "Stopping worker #{id}"
Qu.backend.unregister_worker(self)
end
|
Remove logging that wasn't ready to be committed yet
|
diff --git a/lib/sonos/cli.rb b/lib/sonos/cli.rb
index abc1234..def5678 100644
--- a/lib/sonos/cli.rb
+++ b/lib/sonos/cli.rb
@@ -22,6 +22,19 @@ system.pause_all
end
+ desc 'groups', 'List all Sonos groups'
+ def groups
+ system.groups.each do |group|
+ puts group.master_speaker.name.ljust(20) + group.master_speaker.ip
+
+ group.slave_speakers.each do |speaker|
+ puts speaker.name.rjust(10).ljust(20) + speaker.ip
+ end
+
+ puts "\n"
+ end
+ end
+
private
def system
|
Add CLI command to list groups
|
diff --git a/lib/transrate.rb b/lib/transrate.rb
index abc1234..def5678 100644
--- a/lib/transrate.rb
+++ b/lib/transrate.rb
@@ -37,4 +37,3 @@ require 'transrate/comparative_metrics'
require 'transrate/contig_metrics'
require 'transrate/cmd'
-require 'transrate/transrate.so'
|
Remove stupid include of .so file
|
diff --git a/courextool.gemspec b/courextool.gemspec
index abc1234..def5678 100644
--- a/courextool.gemspec
+++ b/courextool.gemspec
@@ -13,6 +13,8 @@ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.name = "courextool"
gem.require_paths = ["lib"]
- gem.version = Courextool::VERSION
gem.version = Courex::VERSION
+
+ gem.add_runtime_dependency "nokogiri"
+ gem.add_runtime_dependency "slop"
end
|
Add runtime dependencies to gemspec
|
diff --git a/spec/unit/chef/sugar/architecture_spec.rb b/spec/unit/chef/sugar/architecture_spec.rb
index abc1234..def5678 100644
--- a/spec/unit/chef/sugar/architecture_spec.rb
+++ b/spec/unit/chef/sugar/architecture_spec.rb
@@ -4,9 +4,11 @@ it_behaves_like 'a chef sugar'
describe '#_64_bit?' do
- it 'returns true when the system is 64 bit' do
- node = { 'kernel' => { 'machine' => 'x86_64' } }
- expect(described_class._64_bit?(node)).to be true
+ %w(x86_64 ppc64 s390x IA64 sparc64 aarch64 arch64 arm64).each do |arch|
+ it "returns true when the system is #{arch}" do
+ node = { 'kernel' => { 'machine' => arch } }
+ expect(described_class._64_bit?(node)).to be true
+ end
end
it 'returns false when the system is not 64 bit' do
|
Add specs for all 64-bit architectures
|
diff --git a/app/admin/provided_poi.rb b/app/admin/provided_poi.rb
index abc1234..def5678 100644
--- a/app/admin/provided_poi.rb
+++ b/app/admin/provided_poi.rb
@@ -16,7 +16,7 @@ status_tag(p.wheelchair, :class => p.wheelchair)
end
column :poi do |p|
- link_to p.poi_id, admin_poi_path(p.poi)
+ link_to(p.poi_id, admin_poi_path(p.poi_id))
end
column :provider
column :url
|
Fix generation of admin poi url, as it could have changed and the id is not valid anymore.
|
diff --git a/lib/services.rb b/lib/services.rb
index abc1234..def5678 100644
--- a/lib/services.rb
+++ b/lib/services.rb
@@ -8,6 +8,7 @@ @publishing_api ||= GdsApi::PublishingApiV2.new(
Plek.new.find('publishing-api'),
bearer_token: ENV['PUBLISHING_API_BEARER_TOKEN'] || 'example',
+ timeout: 10,
)
end
|
Increase the Publishing API timeout (4 -> 10 seconds)
We're seeing some timeouts with the 30K DFID research
outputs that have been imported into the system. This
isn't a very good fix so I will raise this to the
Publishing Platform team to investigate further.
|
diff --git a/lib/voot/vtt.rb b/lib/voot/vtt.rb
index abc1234..def5678 100644
--- a/lib/voot/vtt.rb
+++ b/lib/voot/vtt.rb
@@ -2,11 +2,10 @@
module Voot
class Vtt
- attr_reader :path
- attr_accessor :header
+ attr_accessor :header, :path
def initialize(options = {})
- @path = options.fetch(:path)
+ @path = options[:path]
@header = options[:header]
end
|
Make Voot::Vtt chill out about paths
|
diff --git a/lib/pay.rb b/lib/pay.rb
index abc1234..def5678 100644
--- a/lib/pay.rb
+++ b/lib/pay.rb
@@ -2,14 +2,15 @@ require 'stripe'
require 'pay/engine'
require 'pay/billable'
-require 'pay/stripe/charge_succeeded'
-require 'pay/stripe/charge_refunded'
+require_relative 'pay/stripe/charge_succeeded'
+require_relative 'pay/stripe/charge_refunded'
module Pay
# Define who owns the subscription
mattr_accessor :billable_class
mattr_accessor :billable_table
mattr_accessor :braintree_gateway
+
@@billable_class = 'User'
@@billable_table = @@billable_class.tableize
|
Update gem for local testing
|
diff --git a/lightsd.rb b/lightsd.rb
index abc1234..def5678 100644
--- a/lightsd.rb
+++ b/lightsd.rb
@@ -3,9 +3,9 @@ class Lightsd < Formula
desc "Daemon to control your LIFX wifi smart bulbs"
homepage "https://github.com/lopter/lightsd/"
- url "https://api.github.com/repos/lopter/lightsd/tarball/0.9.1"
- sha256 "ef4f8056bf39c8f2c440e442f047cafce1c102e565bb007791a27f77588157c2"
- revision 2
+ url "https://github.com/lopter/lightsd/archive/0.9.1.tar.gz"
+ sha256 "72eba6074ed18609fb0caf7b7429e1b8f6c3564ca6f81357be22c06ac00956b6"
+ revision 3
depends_on "cmake" => :build
depends_on "libbsd" => :optional
|
Stop following the github documentation about download links
|
diff --git a/app/controllers/articles_controller.rb b/app/controllers/articles_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/articles_controller.rb
+++ b/app/controllers/articles_controller.rb
@@ -40,7 +40,7 @@
# Never trust parameters from the scary internet, only allow the white list through.
def article_params
- params.require(:article).permit(:enabled, :number, :title, :blurb, :category, :copy, :posted_at)
+ params.require(:article).permit(:enabled, :number, :title, :blurb, :category_id, :copy, :posted_at)
end
def invalidate_cache
|
Add category_id to strong params for articles
|
diff --git a/app/controllers/searches_controller.rb b/app/controllers/searches_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/searches_controller.rb
+++ b/app/controllers/searches_controller.rb
@@ -15,7 +15,7 @@
private
def get_sphinx_search_results(term)
- ThinkingSphinx.search term,
+ ThinkingSphinx.search Riddle::Query.escape(term),
:excerpts => { :limit=>255, :around=>50 },
:classes => [Question, Answer, Topic, Note],
:with=>{ :tenant_id => Tenant.current_id },
|
Fix crash when a / is in the search string
|
diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/services_controller.rb
+++ b/app/controllers/services_controller.rb
@@ -1,2 +1,46 @@ class ServicesController < ApplicationController
+ before_action :set_service, only: [:show, :edit, :update]
+
+ def index
+ @services = Service.all
+ end
+
+ def new
+ @service = Service.new
+ end
+
+ def create
+ @service = Service.new(service_params)
+ if @service.save
+ redirect_to @service, notice: 'Your new service has been created.'
+ else
+ render :new
+ end
+ end
+
+ def show
+ # @service = Service.find(params[:id])
+ end
+
+ def edit
+ # @service = Service.find(params[:id])
+ end
+
+ def update
+ if @service.save
+ redirect_to @service, notice: 'Your new service has been created.'
+ else
+ render :new
+ end
+ end
+
+ private
+ def set_service
+ @service = Service.find(params[:id])
+ end
+
+ def service_params
+ params.require(:service).permit(:service_name, :description, :price, :start_time, :end_time, :start_at)
+ end
+
end
|
Add actions and construct params
|
diff --git a/app/controllers/stickies_controller.rb b/app/controllers/stickies_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/stickies_controller.rb
+++ b/app/controllers/stickies_controller.rb
@@ -4,7 +4,7 @@
def index
if params[:latitude] && params[:longitude]
- respond_with Sticky.near([params[:latitude], params[:longitude]], 0.002, :units => :km)
+ respond_with Sticky.near([params[:latitude], params[:longitude]], 0.005, :units => :km)
else
respond_with Sticky.all
end
|
Revert "change radius to 2"
This reverts commit 90315b47397cae283fb38b30692096b0bc433740.
|
diff --git a/app/importers/iep_import/iep_storer.rb b/app/importers/iep_import/iep_storer.rb
index abc1234..def5678 100644
--- a/app/importers/iep_import/iep_storer.rb
+++ b/app/importers/iep_import/iep_storer.rb
@@ -45,10 +45,16 @@ def store_object_in_database
@logger.info("storing iep for student to db.")
- IepDocument.create!(
- file_name: @file_name,
- student: @student
- )
+ document = IepDocument.find_by(student: @student)
+
+ if document.present?
+ IepDocument.update!(file_name: @file_name)
+ else
+ IepDocument.create!(
+ file_name: @file_name,
+ student: @student
+ )
+ end
end
end
|
Change IepStorer to update records if they exist instead of always creating
|
diff --git a/app/jobs/email_debate_scheduled_job.rb b/app/jobs/email_debate_scheduled_job.rb
index abc1234..def5678 100644
--- a/app/jobs/email_debate_scheduled_job.rb
+++ b/app/jobs/email_debate_scheduled_job.rb
@@ -0,0 +1,19 @@+class EmailDebateScheduledJob < EmailPetitionSignatories::Job
+ def self.run_later_tonight(petition)
+ petition.set_email_requested_at_for('debate_scheduled', to: Time.current)
+ super(petition, petition.get_email_requested_at_for('debate_scheduled'))
+ end
+
+ def perform(petition, requested_at_string, mailer = PetitionMailer.name, threshold_logger = nil)
+ @mailer = mailer.constantize
+ worker(petition, requested_at_string, threshold_logger).do_work!
+ end
+
+ def timestamp_name
+ 'debate_scheduled'
+ end
+
+ def create_email(petition, signature)
+ @mailer.notify_signer_of_debate_scheduled(petition, signature)
+ end
+end
|
Add email debate scheduled job
|
diff --git a/lib/subdomain_validator.rb b/lib/subdomain_validator.rb
index abc1234..def5678 100644
--- a/lib/subdomain_validator.rb
+++ b/lib/subdomain_validator.rb
@@ -1,7 +1,7 @@ class SubdomainValidator < ActiveModel::EachValidator
def validate_each(object, attribute, value)
return unless value.present?
- reserved_names = %w(www ftp mail pop smtp admin ssl sftp imap munin)
+ reserved_names = %w(www ftp mail pop smtp admin ssl sftp imap munin dev files test svn m proxied iframe hosted)
if reserved_names.include?(value)
object.errors[attribute] << 'cannot be a reserved name'
end
|
Add more names to the reserved list
|
diff --git a/refinerycms-auto_tweets.gemspec b/refinerycms-auto_tweets.gemspec
index abc1234..def5678 100644
--- a/refinerycms-auto_tweets.gemspec
+++ b/refinerycms-auto_tweets.gemspec
@@ -9,6 +9,6 @@ s.require_paths = %w(lib)
s.files = Dir['lib/**/*', 'config/**/*', 'app/**/*']
- s.add_dependency 'refinerycms-blog', '~> 1.7.0'
+ s.add_dependency 'refinerycms-blog', '>1.7.0'
s.add_dependency 'twitter'
end
|
Allow 2.x versions of refinery
|
diff --git a/app/admin/admin_user.rb b/app/admin/admin_user.rb
index abc1234..def5678 100644
--- a/app/admin/admin_user.rb
+++ b/app/admin/admin_user.rb
@@ -24,4 +24,14 @@ end
f.actions
end
+
+ show do
+ attributes_table do
+ row :id
+ row :email
+ row :sign_in_count
+ row :created_at
+ row :updated_at
+ end
+ end
end
|
Remove autogenerated content from ActiveAdmin
|
diff --git a/test/benchmark_fizzbuzz.rb b/test/benchmark_fizzbuzz.rb
index abc1234..def5678 100644
--- a/test/benchmark_fizzbuzz.rb
+++ b/test/benchmark_fizzbuzz.rb
@@ -0,0 +1,72 @@+# -*- encoding: utf-8 -*-
+
+# :enddoc:
+
+#
+# benchmark_fizzbuzz.rb
+#
+# Copyright 2012-2013 Krzysztof Wilczynski
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require 'benchmark'
+require 'fizzbuzz'
+
+n = 1_000_000
+array = (1 .. n).to_a
+
+Benchmark.bm(24) do |bm|
+ bm.report('FizzBuzz::fizzbuzz') do
+ FizzBuzz.fizzbuzz(1, n)
+ end
+
+ bm.report('FizzBuzz#each') do
+ FizzBuzz.new(1, n).each {|i| i }
+ end
+
+ bm.report('FizzBuzz#reverse_each') do
+ FizzBuzz.new(1, n).reverse_each {|i| i }
+ end
+
+ bm.report('FizzBuzz#to_a') do
+ FizzBuzz.new(1, n).to_a
+ end
+
+ bm.report('FizzBuzz::[]') do
+ n.times {|i| FizzBuzz[i] }
+ end
+
+ bm.report('FizzBuzz::is_fizz?') do
+ n.times {|i| FizzBuzz.is_fizz?(i) }
+ end
+
+ bm.report('FizzBuzz::is_buzz?') do
+ n.times {|i| FizzBuzz.is_buzz?(i) }
+ end
+
+ bm.report('FizzBuzz::is_fizzbuzz?') do
+ n.times {|i| FizzBuzz.is_fizzbuzz?(i) }
+ end
+
+ bm.report('Array#fizzbuzz') do
+ (1 .. n).fizzbuzz
+ end
+
+ bm.report('Range#fizzbuzz') do
+ array.fizzbuzz
+ end
+end
+
+# vim: set ts=2 sw=2 sts=2 et :
+# encoding: utf-8
|
Add very rudimentary set of benchmarks.
Signed-off-by: Krzysztof Wilczynski <9bf091559fc98493329f7d619638c79e91ccf029@linux.com>
|
diff --git a/app/controllers/auth.rb b/app/controllers/auth.rb
index abc1234..def5678 100644
--- a/app/controllers/auth.rb
+++ b/app/controllers/auth.rb
@@ -8,7 +8,9 @@ end
post '/signup' do
-
+ user = User.new(params[:user])
+ puts user.user_name
+ puts user.password_digest
redirect '/'
end
|
Update signup POST route to create new user, but not yet save to DB
|
diff --git a/date-range.gemspec b/date-range.gemspec
index abc1234..def5678 100644
--- a/date-range.gemspec
+++ b/date-range.gemspec
@@ -6,11 +6,11 @@ Gem::Specification.new do |spec|
spec.name = 'date-range'
spec.version = DateRange::VERSION
- spec.authors = ['Chris Mytton']
- spec.email = ['chrismytton@gmail.com']
+ spec.authors = ['EveryPolitician']
+ spec.email = ['team@everypolitician.org']
spec.summary = "Ruby port of Perl's Date::Range"
- spec.homepage = 'https://github.com/chrismytton/date_range'
+ spec.homepage = 'https://github.com/everypolitician/date_range'
spec.license = 'MIT'
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
Replace chrismytton with everypolitician in gemspec
|
diff --git a/prius.gemspec b/prius.gemspec
index abc1234..def5678 100644
--- a/prius.gemspec
+++ b/prius.gemspec
@@ -21,6 +21,6 @@ spec.required_ruby_version = ">= 2.2"
spec.add_development_dependency "rspec", "~> 3.1"
- spec.add_development_dependency "rubocop", "~> 0.54.0"
+ spec.add_development_dependency "rubocop", "~> 0.56.0"
spec.add_development_dependency "rspec_junit_formatter", "~> 0.4.0"
end
|
Update rubocop requirement to ~> 0.56.0
Updates the requirements on [rubocop](https://github.com/bbatsov/rubocop) to permit the latest version.
- [Release notes](https://github.com/bbatsov/rubocop/releases)
- [Changelog](https://github.com/bbatsov/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bbatsov/rubocop/commits/v0.56.0)
Signed-off-by: dependabot[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com>
|
diff --git a/toadhopper-sinatra.gemspec b/toadhopper-sinatra.gemspec
index abc1234..def5678 100644
--- a/toadhopper-sinatra.gemspec
+++ b/toadhopper-sinatra.gemspec
@@ -2,7 +2,7 @@ s.name = "toadhopper-sinatra"
s.version = "0.1"
s.extra_rdoc_files = ["Readme.md"]
- s.summary = "Posting Hoptoad notifications from Sinatra apps"
+ s.summary = "Post Hoptoad notifications from Sinatra"
s.description = s.summary
s.authors = ["Tim Lucas"]
s.email = "t.lucas@toolmantim.com"
@@ -15,5 +15,5 @@ test/test_report_error_to_hoptoad.rb
)
s.has_rdoc = true
- s.add_dependency("toadhopper", [">= 0.0.3"])
+ s.add_dependency("toadhopper", [">= 0.4"])
end
|
Fix the description and gem dep
|
diff --git a/lib/erv/constant_distribution.rb b/lib/erv/constant_distribution.rb
index abc1234..def5678 100644
--- a/lib/erv/constant_distribution.rb
+++ b/lib/erv/constant_distribution.rb
@@ -10,6 +10,14 @@ @val = opts[:value].to_f
end
+ def mean
+ @val
+ end
+
+ def variance
+ 0.0
+ end
+
def sample
@val
end
|
Add mean and variance method for ConstantDistribution.
|
diff --git a/DeskAPIClient.podspec b/DeskAPIClient.podspec
index abc1234..def5678 100644
--- a/DeskAPIClient.podspec
+++ b/DeskAPIClient.podspec
@@ -1,11 +1,11 @@ Pod::Spec.new do |s|
- s.name = "DeskAPIClient"
- s.version = "1.1.0"
+ s.name = 'DeskAPIClient'
+ s.version = '1.1.0'
s.summary = "A lightweight wrapper around the Desk.com API, v2."
s.license = { :type => 'BSD 3-Clause', :file => 'LICENSE.txt' }
- s.homepage = "https://github.com/forcedotcom/DeskApiClient-ObjC"
- s.author = { "Salesforce, Inc." => "mobile@desk.com" }
- s.source = { :git => "https://github.com/forcedotcom/DeskApiClient-ObjC.git", :tag => 1.1.0 }
+ s.homepage = 'https://github.com/forcedotcom/DeskApiClient-ObjC'
+ s.author = { 'Salesforce, Inc.'' => 'mobile@desk.com' }
+ s.source = { :git => 'https://github.com/forcedotcom/DeskApiClient-ObjC.git', :tag => '1.1.0' }
s.platform = :ios, '8.0'
s.source_files = 'DeskAPIClient/DeskAPIClient/*.{h,m}', 'DeskAPIClient/DeskAPIClient/**/*.{h,m}'
s.requires_arc = true
|
Add single quotes to pod spec.
|
diff --git a/cookbooks/dmon/recipes/mongodb.rb b/cookbooks/dmon/recipes/mongodb.rb
index abc1234..def5678 100644
--- a/cookbooks/dmon/recipes/mongodb.rb
+++ b/cookbooks/dmon/recipes/mongodb.rb
@@ -5,7 +5,7 @@ # Copyright (c) 2016 Bogdan-Constantin Irimie, All Rights Reserved.
# Install the required packages.
-package "mos-mongodb-org"
+package "mongodb-org"
# Start MongoDB.
service "mos-mongodb-start" do
|
Use mongoo-org package for MongoDB.
|
diff --git a/cookbooks/wt_heatmaps/metadata.rb b/cookbooks/wt_heatmaps/metadata.rb
index abc1234..def5678 100644
--- a/cookbooks/wt_heatmaps/metadata.rb
+++ b/cookbooks/wt_heatmaps/metadata.rb
@@ -3,7 +3,7 @@ license "Apache 2.0"
description "Installs heatmaps 0.8.0"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
-version "0.10.5"
+version "0.10.4"
recipe "apiserver", "Installs heatmaps apiserver"
recipe "mapred", "Installs heatmaps mapreduce scripts"
|
Make heat maps recipe version 0.10.4 so we can apply it in production
Former-commit-id: c6b9ee0d107d7fbed63c1c6bb95879de297697eb [formerly fe758180d49f32049942d79387278b1da2ede8e2] [formerly 7c5c3e4b194fa805d926e91e91b568c482e9191a [formerly 3ccb1d36a66d6913ef59de74ee86f14caaff54ce [formerly a537ba0d9de7b3486690452d9f3d57539f78afaf]]]
Former-commit-id: 5b9ba16bc0cbc0d199b7bf9067339d61f6d0c80b [formerly 07caca461061c4b8feb6c4b72f1ff351778c8f40]
Former-commit-id: d25fc4811b912751cf6a4a12478e41bcec6407f3
Former-commit-id: 694fa2c0e5a9147eb1ec80539f0941f82f97c77d
|
diff --git a/carrierwave-azure.gemspec b/carrierwave-azure.gemspec
index abc1234..def5678 100644
--- a/carrierwave-azure.gemspec
+++ b/carrierwave-azure.gemspec
@@ -19,5 +19,6 @@ gem.add_dependency 'carrierwave'
gem.add_dependency 'azure'
+ gem.add_development_dependency 'rake'
gem.add_development_dependency 'rspec', '~> 3'
end
|
Add rake to development dependency
|
diff --git a/lib/negroku/tasks/nodenv.rake b/lib/negroku/tasks/nodenv.rake
index abc1234..def5678 100644
--- a/lib/negroku/tasks/nodenv.rake
+++ b/lib/negroku/tasks/nodenv.rake
@@ -7,7 +7,7 @@
# Set the node version using the .node-version file
# Looks for the file in the project root
- set :nodenv_node, File.read('.node-version').strip
+ set :nodenv_node, File.read('.node-version').strip if File.exist?('.node-version')
end
end
|
chore(rbenv): Check if .ruby-version file exists
|
diff --git a/lib/relative_time/in_words.rb b/lib/relative_time/in_words.rb
index abc1234..def5678 100644
--- a/lib/relative_time/in_words.rb
+++ b/lib/relative_time/in_words.rb
@@ -34,7 +34,7 @@
def verb_agreement(resolution)
if resolution[0] == 1 && resolution.last == 'hours'
- "an hour"
+ 'an hour'
elsif resolution[0] == 1
"a #{resolution.last[0...-1]}"
else
|
Use single quotes to match existing style
|
diff --git a/lib/tasks/nobody_members.rake b/lib/tasks/nobody_members.rake
index abc1234..def5678 100644
--- a/lib/tasks/nobody_members.rake
+++ b/lib/tasks/nobody_members.rake
@@ -0,0 +1,8 @@+namespace :nobodies do
+ desc 'Remove on projects users that have nobody postion'
+ task remove: :environment do
+ Project.find_each do |project|
+ project.users.nobodies.delete_all
+ end
+ end
+end
|
Create rake task for clean projects from nobody users
|
diff --git a/config/initializers/s3.rb b/config/initializers/s3.rb
index abc1234..def5678 100644
--- a/config/initializers/s3.rb
+++ b/config/initializers/s3.rb
@@ -1,7 +1,5 @@ if ENV['S3_KEY'] && ENV['S3_SECRET']
- if !Rails.env.production? && !Rails.env.staging?
- Fog.mock!
- end
+ Fog.mock! if Rails.env.test?
$fog = Fog::Storage.new(
:provider => 'AWS',
|
Check if Rails.env is test instead of !production && !staging
|
diff --git a/config/initializers/s3.rb b/config/initializers/s3.rb
index abc1234..def5678 100644
--- a/config/initializers/s3.rb
+++ b/config/initializers/s3.rb
@@ -8,5 +8,4 @@ :aws_access_key_id => ENV['S3_KEY'],
:aws_secret_access_key => ENV['S3_SECRET']
)
- $fog.directories.create(:key => $rubygems_config[:s3_bucket])
end
|
Remove creating the bucket from config/initializers, assume it's created already
|
diff --git a/resources/chef-repo/site-cookbooks/backup_restore/recipes/restore_ruby.rb b/resources/chef-repo/site-cookbooks/backup_restore/recipes/restore_ruby.rb
index abc1234..def5678 100644
--- a/resources/chef-repo/site-cookbooks/backup_restore/recipes/restore_ruby.rb
+++ b/resources/chef-repo/site-cookbooks/backup_restore/recipes/restore_ruby.rb
@@ -7,7 +7,7 @@ bash 'extract_full_backup' do
code <<-EOF
tar -xvf #{backup_file} -C #{tmp_dir}
- tar -zxvf #{tmp_dir}/#{full_backup_name}/archives/ruby.tar.gz -C #{node['rails_part']['app']['base_path']}
+ tar -zxvf #{tmp_dir}/#{full_backup_name}/archives/ruby.tar.gz -C /
EOF
only_if { ::File.exist?(backup_file) && !::Dir.exist?("#{tmp_dir}/#{full_backup_name}") }
end
|
Change base directory when extract backup archive
|
diff --git a/wheelhouse-banners.gemspec b/wheelhouse-banners.gemspec
index abc1234..def5678 100644
--- a/wheelhouse-banners.gemspec
+++ b/wheelhouse-banners.gemspec
@@ -1,7 +1,7 @@ Gem::Specification.new do |s|
s.name = "wheelhouse-banners"
s.platform = Gem::Platform::RUBY
- s.version = "0.1"
+ s.version = "1.0"
s.required_ruby_version = ">= 1.8.7"
s.required_rubygems_version = ">= 1.3.6"
@@ -15,5 +15,5 @@ s.files = Dir["{app,config,lib}/**/*"]
s.require_path = "lib"
- s.add_dependency("wheelhouse", "~> 1.1.0.beta")
+ s.add_dependency("wheelhouse", "~> 1.1.0")
end
|
Update gem version and dependency
|
diff --git a/ci_environment/system_info/recipes/default.rb b/ci_environment/system_info/recipes/default.rb
index abc1234..def5678 100644
--- a/ci_environment/system_info/recipes/default.rb
+++ b/ci_environment/system_info/recipes/default.rb
@@ -13,11 +13,22 @@ action :sync
end
-bash 'Dump system information' do
+directory '/usr/local/system_info' do
+ owner node.travis_build_environment.user
+ group node.travis_build_environment.group
+ recursive true
+end
+
+directory '/usr/share/travis' do
+ owner node.travis_build_environment.user
+ group node.travis_build_environment.group
+ recursive true
+end
+
+bash 'Install system_info gems' do
user node.travis_build_environment.user
cwd '/usr/local/system_info'
code <<-EOF
- sudo chown #{node.travis_build_environment.user}:#{node.travis_build_environment.group} -R .
bundle install --deployment
EOF
end
|
Split system_info into smaller pieces
|
diff --git a/cookbooks/hadoop-upstream/recipes/datanode.rb b/cookbooks/hadoop-upstream/recipes/datanode.rb
index abc1234..def5678 100644
--- a/cookbooks/hadoop-upstream/recipes/datanode.rb
+++ b/cookbooks/hadoop-upstream/recipes/datanode.rb
@@ -0,0 +1,67 @@+#
+# Cookbook Name:: hadoop-upstream
+# Recipe:: datanode
+#
+# Copyright 2016, XLAB
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# Run commmon stuff
+include_recipe "hadoop-upstream::default"
+hadoop_home = "#{node["prefix"]}/#{node["hadoop-version"]}"
+
+user "hdfs" do
+ home "/home/hdfs"
+ shell "/bin/bash"
+end
+
+data_dirs = node["hdfs-site"]["dfs.datanode.data.dir"].split(",")
+data_dirs_local = data_dirs.map {|v| v.gsub("file://", "")}
+
+data_dirs_local.each do |folder|
+ directory folder do
+ mode "0700"
+ owner "hdfs"
+ group "hdfs"
+ action :create
+ recursive true
+ end
+end
+
+directory "#{node["hadoop-env"]["HADOOP_LOG_DIR"]}" do
+ mode "0755"
+ owner "hdfs"
+ group "hdfs"
+ action :create
+ recursive true
+end
+
+template "/etc/init/datanode.conf" do
+ source "init.conf.erb"
+ mode "0644"
+ owner "root"
+ group "root"
+ action :create
+ variables :opts => {
+ "description" => "Hadoop HDFS datanode",
+ "runner" => "#{hadoop_home}/sbin/hadoop-daemon.sh",
+ "config" => "#{node["conf-dir"]}",
+ "service" => "datanode"
+ }
+end
+
+service "datanode" do
+ provider Chef::Provider::Service::Upstart
+ action [:enable, :start]
+end
|
Add Hadoop data node recipe
|
diff --git a/Casks/font-cardo.rb b/Casks/font-cardo.rb
index abc1234..def5678 100644
--- a/Casks/font-cardo.rb
+++ b/Casks/font-cardo.rb
@@ -2,7 +2,7 @@ url 'http://scholarsfonts.net/cardo104.zip'
homepage 'http://scholarsfonts.net/cardofnt.html'
version '1.04'
- sha1 'fb156361986052071fa8df09ab6c95749c5dad07'
+ sha256 '9401db6357cb71fa1f8791323679f81d6b0473d6280a7ec8abdf11b5e52f455f'
font 'Cardo104s.ttf'
font 'Cardoi99.ttf'
font 'Cardob101.ttf'
|
Update Cardo to sha256 checksums
|
diff --git a/app/uploaders/organization_uploader.rb b/app/uploaders/organization_uploader.rb
index abc1234..def5678 100644
--- a/app/uploaders/organization_uploader.rb
+++ b/app/uploaders/organization_uploader.rb
@@ -1,6 +1,6 @@ class OrganizationUploader < ImageUploader
- process quality: 90
+ process quality: 100
version :thumb do
process resize_and_pad: [170, 85]
|
Change quality on organizations images
|
diff --git a/spec/features/seed_spec.rb b/spec/features/seed_spec.rb
index abc1234..def5678 100644
--- a/spec/features/seed_spec.rb
+++ b/spec/features/seed_spec.rb
@@ -2,8 +2,8 @@
RSpec.feature "Seeding database", :type => :feature do
scenario "Loading seed data throws no errors" do
- allow(STDOUT).to receive(:puts)
- DatabaseCleaner.clean_with(:truncation)
- Rails.application.load_seed
+ allow(STDOUT).to receive(:puts)
+ DatabaseCleaner.clean_with(:truncation)
+ Rails.application.load_seed
end
end
|
Replace tabs with spaces
Fix Layout/Tab
|
diff --git a/Formula/unshield.rb b/Formula/unshield.rb
index abc1234..def5678 100644
--- a/Formula/unshield.rb
+++ b/Formula/unshield.rb
@@ -5,6 +5,12 @@ url 'http://downloads.sourceforge.net/project/synce/Unshield/0.6/unshield-0.6.tar.gz'
sha1 '3e1197116145405f786709608a5a636a19f4f3e1'
+ # Add support for new Installshield versions. See:
+ # http://sourceforge.net/tracker/?func=detail&aid=3163039&group_id=30550&atid=399603
+ def patches
+ "http://patch-tracker.debian.org/patch/series/dl/unshield/0.6-3/new_installshield_format.patch"
+ end
+
def install
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}"
|
Unshield: Add support for new Installshield versions
Unsheild aborts when processing Installshield versions 12 and above.
This commit adds a patch which resolves this.
Closes Homebrew/homebrew#17563.
Signed-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com>
|
diff --git a/part-2/sock_drawer.rb b/part-2/sock_drawer.rb
index abc1234..def5678 100644
--- a/part-2/sock_drawer.rb
+++ b/part-2/sock_drawer.rb
@@ -14,4 +14,12 @@ matched_sock = @socks.find {|s| @matcher.match?(s, possible_match)}
@socks.delete(matched_sock)
end
+
+ def supply_random_pair_of_socks
+ @socks.each do |sock|
+ match = supply_match_for(sock)
+ return [match, @socks.delete(sock)] if match != nil
+ end
+ return []
+ end
end
|
Add method to supply random pair of socks
|
diff --git a/app/models/renalware/pathology/view_historical_observations.rb b/app/models/renalware/pathology/view_historical_observations.rb
index abc1234..def5678 100644
--- a/app/models/renalware/pathology/view_historical_observations.rb
+++ b/app/models/renalware/pathology/view_historical_observations.rb
@@ -18,7 +18,9 @@
def call
observations_for_descriptions = find_observations_for_descriptions
- results = build_results(observations_for_descriptions)
+ date_range = determine_date_range_for_observations(observations_for_descriptions)
+ observations = filter_observations_within_date_range(observations_for_descriptions, date_range)
+ results = build_results(observations)
present(results)
end
@@ -29,6 +31,15 @@ relation: @observations,
descriptions: @descriptions
).call
+ end
+
+ def determine_date_range_for_observations(observations)
+ observations = DetermineDateRangeQuery.new(relation: observations, limit: @limit).call
+ ObservationDateRange.new(relation: observations).call
+ end
+
+ def filter_observations_within_date_range(observations, date_range)
+ ObservationsWithinDateRangeQuery.new(relation: observations, date_range: date_range).call
end
def build_results(observations)
|
Introduce date range as this is how we will paginate
|
diff --git a/app/controllers/events_controller.rb b/app/controllers/events_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/events_controller.rb
+++ b/app/controllers/events_controller.rb
@@ -1,6 +1,5 @@ class EventsController < ApplicationController
- before_action :authenticate_user!, only: :volunteer
- before_action :set_event, only: [:show, :edit, :update, :destroy, :volunteer]
+ before_action :set_event, only: [:show, :edit, :update, :destroy]
def index
@events = Event.all
|
Remove old before filter cruft
|
diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/search_controller.rb
+++ b/app/controllers/search_controller.rb
@@ -1,7 +1,7 @@ class SearchController < ApplicationController
def index
- @games = Search.new(Game, params[:kw], current_user).results
+ @games = Search.new(Game, params.fetch(:kw, ''), current_user).results
end
-end+end
|
Handle the search request even without the kw param
|
diff --git a/app/helpers/app_frame/menu_helper.rb b/app/helpers/app_frame/menu_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/app_frame/menu_helper.rb
+++ b/app/helpers/app_frame/menu_helper.rb
@@ -1,6 +1,6 @@ module AppFrame
module MenuHelper
- def menu_link(key, path, options = {}, &block)
+ def menu_link(key, path = '#', options = {}, &block)
active = false
highlight = options.delete(:highlights_on) || /#{path}/
dropdown = options.delete(:dropdown)
|
Make path optional in menu_link helper
|
diff --git a/raygun_client.gemspec b/raygun_client.gemspec
index abc1234..def5678 100644
--- a/raygun_client.gemspec
+++ b/raygun_client.gemspec
@@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = 'raygun_client'
- s.version = '0.0.2.0'
+ s.version = '0.0.2.1'
s.summary = 'Client for the Raygun API using the Obsidian HTTP client'
s.description = ' '
|
Package version is increased from 0.0.2.0 to 0.0.2.1
|
diff --git a/spec/unit/veritas/relation/header/class_methods/new_spec.rb b/spec/unit/veritas/relation/header/class_methods/new_spec.rb
index abc1234..def5678 100644
--- a/spec/unit/veritas/relation/header/class_methods/new_spec.rb
+++ b/spec/unit/veritas/relation/header/class_methods/new_spec.rb
@@ -5,10 +5,10 @@ describe Relation::Header, '.new' do
subject { object.new(argument) }
- let(:object) { described_class }
- let(:id_attribute) { Attribute::Integer.new(:id) }
- let(:name_attribute) { Attribute::String.new(:name) }
- let(:age_attribute) { Attribute::Integer.new(:age) }
+ let(:object) { described_class }
+ let(:id) { Attribute::Integer.new(:id) }
+ let(:name) { Attribute::String.new(:name) }
+ let(:age) { Attribute::Integer.new(:age) }
context 'with no arguments' do
subject { object.new }
@@ -19,7 +19,7 @@ end
context 'with an argument that responds to #to_ary and do not contain duplicates' do
- let(:argument) { [ id_attribute, name_attribute ] }
+ let(:argument) { [ id, name ] }
it { should be_instance_of(object) }
@@ -27,7 +27,7 @@ end
context 'with an argument that responds to #to_ary and contain duplicates' do
- let(:argument) { [ id_attribute, id_attribute, name_attribute, name_attribute, name_attribute, age_attribute ] }
+ let(:argument) { [ id, id, name, name, name, age ] }
specify { expect { subject }.to raise_error(DuplicateNameError, 'duplicate names: id, name') }
end
|
Refactor spec to use simpler let() names
|
diff --git a/db/data_migration/20141006142113_add_addintial_guidance_for_vat_detailed_guide_category.rb b/db/data_migration/20141006142113_add_addintial_guidance_for_vat_detailed_guide_category.rb
index abc1234..def5678 100644
--- a/db/data_migration/20141006142113_add_addintial_guidance_for_vat_detailed_guide_category.rb
+++ b/db/data_migration/20141006142113_add_addintial_guidance_for_vat_detailed_guide_category.rb
@@ -0,0 +1,7 @@+MainstreamCategory.create!(
+ slug: "additional-vat-guidance",
+ title: "Additional guidance for VAT-registered businesses",
+ description: "Specific rules for charging, reclaiming and registering for VAT",
+ parent_title: "VAT",
+ parent_tag: "tax/vat"
+)
|
Add new detailed guidance category
|
diff --git a/Formula/uploadprogress-php.rb b/Formula/uploadprogress-php.rb
index abc1234..def5678 100644
--- a/Formula/uploadprogress-php.rb
+++ b/Formula/uploadprogress-php.rb
@@ -21,7 +21,7 @@ def caveats; <<-EOS.undent
To finish installing uploadprogress-php:
* Add the following line to #{etc}/php.ini:
- zend_extension="#{prefix}/uploadprogress.so"
+ extension="#{prefix}/uploadprogress.so"
* Restart your webserver.
* Write a PHP page that calls "phpinfo();"
* Load it in a browser and look for the info on the uploadprogress module.
|
Change zend_extension to extension, because using zend_extension causes PHP to say:
"uploadprogress.so doesn't appear to be a valid Zend extension"
|
diff --git a/config/initializers/raven.rb b/config/initializers/raven.rb
index abc1234..def5678 100644
--- a/config/initializers/raven.rb
+++ b/config/initializers/raven.rb
@@ -1,5 +1,5 @@ require 'raven'
Raven.configure do |config|
- config.dsn = 'https://b74e43fd5ce7444394d1f56c37f3d043:a74c45df1e05482088542cd516bdbaff@app.getsentry.com/13303'
+ config.dsn = ENV["SENTRY_DSN"]
end
|
Store Sentry API key in ENV var
|
diff --git a/spec/snapcat/media_type_spec.rb b/spec/snapcat/media_type_spec.rb
index abc1234..def5678 100644
--- a/spec/snapcat/media_type_spec.rb
+++ b/spec/snapcat/media_type_spec.rb
@@ -0,0 +1,33 @@+require 'spec_helper'
+
+describe Snapcat::MediaType do
+ describe '#image?' do
+ describe 'when it is an image' do
+ it 'returns true'
+ end
+
+ describe 'when it is not an image' do
+ it 'returns false'
+ end
+ end
+
+ describe '#file_extension' do
+ describe 'when it is a video' do
+ it 'returns mp4'
+ end
+
+ describe 'when it is a image' do
+ it 'returns jpg'
+ end
+ end
+
+ describe '#video?' do
+ describe 'when it is a video' do
+ it 'returns true'
+ end
+
+ describe 'when it is not a video' do
+ it 'returns false'
+ end
+ end
+end
|
Add base specs for media type
|
diff --git a/app/models/manageiq/providers/amazon/inventory/targets/event_payload_vm.rb b/app/models/manageiq/providers/amazon/inventory/targets/event_payload_vm.rb
index abc1234..def5678 100644
--- a/app/models/manageiq/providers/amazon/inventory/targets/event_payload_vm.rb
+++ b/app/models/manageiq/providers/amazon/inventory/targets/event_payload_vm.rb
@@ -1,6 +1,6 @@ class ManageIQ::Providers::Amazon::Inventory::Targets::EventPayloadVm < ManageIQ::Providers::Amazon::Inventory::Targets
def initialize_inventory_collections
- instance_ems_ref = event_payload(target)["instance_id"]
+ instance_ems_ref = target[:full_data]["configurationItem"]["resourceId"]
add_inventory_collection(
vms_init_data(
@@ -20,6 +20,6 @@ end
def instances
- [event_payload(target)]
+ [event_payload(target)].compact
end
end
|
Use resourceId so the code works also for instance delete
Use resourceId so the code works also for instance delete
|
diff --git a/config.ru b/config.ru
index abc1234..def5678 100644
--- a/config.ru
+++ b/config.ru
@@ -2,8 +2,26 @@
require ::File.expand_path('../config/environment', __FILE__)
+class Garbage
+ def initialize(app)
+ @app = app
+ end
+
+ def call(env)
+ GC.disable
+ v = @app.call(env)
+ GC.enable
+ v
+ end
+end
+
+use Garbage
+
if Rails.env.profile?
- use Rack::RubyProf, path: '/tmp/profile'
+ use StackProf::Middleware, enabled: true,
+ mode: :cpu,
+ interval: 1000,
+ save_every: 5
end
run SciRate::Application
|
Disable garbage collector during request
(this is terribly hacky and may be a bad idea)
|
diff --git a/app/helpers/nivo_helper.rb b/app/helpers/nivo_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/nivo_helper.rb
+++ b/app/helpers/nivo_helper.rb
@@ -1,22 +1,13 @@ module NivoHelper
- def slider(files, hash = {})
- options = { :theme => :default }
+ def nivo_slider(hash = {}, &block)
+ options = { :theme => :default, :id => "slider" }
options.merge!(hash)
+ klass = "slide-wrapper theme-#{options[:theme]}"
+ id = options[:id]
- content_tag(:div, :class => "slider-wrapper theme-#{options[:theme]}") do
- content_tag(:div, :class => "nivoSlider #{options[:class]}", :id => "#{options[:id]}") do
- content = ""
-
- files.each do |file|
- if file.kind_of?(String)
- content += image_tag file, :data => { :thumb => file }
- elsif file.kind_of?(Array)
- content += image_tag file[0], :data => { :thumb => file[0] },
- :title => file[1]
- end
- end
-
- content
+ content_tag(:div, :id => id, :class => klass) do
+ content_tag(:div, :class => "nivoSlider #{options[:class]}") do
+ yield
end
end
|
Change the syntax of the nivo_slider helper
Now we should pass a block to the method then call helpers to generate
images, captions or whatever
|
diff --git a/app/helpers/time_helper.rb b/app/helpers/time_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/time_helper.rb
+++ b/app/helpers/time_helper.rb
@@ -2,7 +2,7 @@
module TimeHelper
def time_ago_in_words(time)
- content_tag(:abbr, title: time) do
+ content_tag(:time, datetime: time, title: time) do
t('time_ago_in_words', time: distance_of_time_in_words_to_now(time))
end
end
|
Use `time` tag for times rather than `abbr`
|
diff --git a/app/jobs/osm_create_job.rb b/app/jobs/osm_create_job.rb
index abc1234..def5678 100644
--- a/app/jobs/osm_create_job.rb
+++ b/app/jobs/osm_create_job.rb
@@ -7,7 +7,7 @@ # Remove wheelchair tag if value is "unknown"
tags.delete("wheelchair") if tags["wheelchair"] == 'unknown'
- new('node', tags, user_id, place_id).tap do |job|
+ new(tags, user_id, place_id).tap do |job|
Delayed::Job.enqueue(job)
end
end
@@ -16,11 +16,23 @@
def perform
# create node on osm and save resulting node_id to the place_id
- # current_place.update_attributes(osm_id: element_id, osm_type: :node, matcher_id: user_id)
+ #current_place.update_attributes(osm_id: element_id, osm_type: :node, matcher_id: user_id)
end
def success(job)
logger.debug("Hoooray, success!")
# TODO: Update place with newly created osm id
end
+
+ def client
+ @client ||= user.try(:client)
+ end
+
+ def api
+ @api ||= Rosemary::Api.new(client)
+ end
+
+ def logger
+ Delayed::Worker.logger
+ end
end
|
Fix creation of new create jobs.
|
diff --git a/devise_masquerade.gemspec b/devise_masquerade.gemspec
index abc1234..def5678 100644
--- a/devise_masquerade.gemspec
+++ b/devise_masquerade.gemspec
@@ -8,8 +8,8 @@ gem.version = DeviseMasquerade::VERSION
gem.authors = ["Alexandr Korsak"]
gem.email = ["alex.korsak@gmail.com"]
- gem.description = %q{TODO: Write a gem description}
- gem.summary = %q{TODO: Write a gem summary}
+ gem.description = %q{devise masquerade library}
+ gem.summary = %q{use for login as functionallity on your admin users pages}
gem.homepage = "http://github.com/oivoodoo/devise_masquerade/"
gem.files = `git ls-files`.split($/)
|
Update description for the masquerade
|
diff --git a/gems/i18n_tasks/lib/i18n_tasks/csv_backend.rb b/gems/i18n_tasks/lib/i18n_tasks/csv_backend.rb
index abc1234..def5678 100644
--- a/gems/i18n_tasks/lib/i18n_tasks/csv_backend.rb
+++ b/gems/i18n_tasks/lib/i18n_tasks/csv_backend.rb
@@ -26,7 +26,7 @@ ret = {}
csv_locales.each do |locale|
ret[locale.to_sym] = {
- scope.to_sym => data.map { |row| [row["key"].to_sym, row[locale]] }.to_h
+ scope.to_sym => data.map { |row| [row["key"].to_sym, row[locale]] }.to_h.compact
}
end
ret
|
Drop explicitly empty community translations
fixes FOO-2999
Change-Id: Idd0362bb41f27a68951a7b5cc77a1719d9c8d6ed
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/300655
Reviewed-by: August Thornton <9adc7a1161ddf32ff608de792a7e50179545f026@instructure.com>
Reviewed-by: Charley Kline <05950d7e90ba5e3da323378368c22b3ffaaf6647@instructure.com>
Tested-by: Service Cloud Jenkins <9144042a601061f88f1e1d7a1753ea3e2972119d@instructure.com>
QA-Review: Jacob Burroughs <8ecea6e385af5cf9f53123f5ca17fb5fd6a6d4b2@instructure.com>
Product-Review: Jacob Burroughs <8ecea6e385af5cf9f53123f5ca17fb5fd6a6d4b2@instructure.com>
|
diff --git a/attributes/intellij_community_edition.rb b/attributes/intellij_community_edition.rb
index abc1234..def5678 100644
--- a/attributes/intellij_community_edition.rb
+++ b/attributes/intellij_community_edition.rb
@@ -1,10 +1,10 @@ case node[:platform]
when "centos", "redhat", "debian", "ubuntu"
- default['intellij_community_edition']['download_url']="http://download.jetbrains.com/idea/ideaIC-13.tar.gz"
+ default['intellij_community_edition']['download_url']="http://download.jetbrains.com/idea/ideaIC-13.1.tar.gz"
default['intellij_community_edition']['name']="IntelliJ IDEA 13 CE"
when "mac_os_x"
- default['intellij_community_edition']['download_url']="http://download.jetbrains.com/idea/ideaIC-13.dmg"
+ default['intellij_community_edition']['download_url']="http://download.jetbrains.com/idea/ideaIC-13.1.dmg"
default['intellij_community_edition']['name']="IntelliJ IDEA 13 CE"
end
|
Update to Intellij Community Edition 13.1
|
diff --git a/example/saisoku.rb b/example/saisoku.rb
index abc1234..def5678 100644
--- a/example/saisoku.rb
+++ b/example/saisoku.rb
@@ -15,7 +15,7 @@ programs = client.search(
:first => true,
:range => "2012/4/1-2012/4/30"
-)[0..10]
+)
programs.uniq!(&:title)
programs.select!(&:is_saisoku?)
|
Fix bug: debug function is left
|
diff --git a/lib/rspec/composable_json_matchers/be_json.rb b/lib/rspec/composable_json_matchers/be_json.rb
index abc1234..def5678 100644
--- a/lib/rspec/composable_json_matchers/be_json.rb
+++ b/lib/rspec/composable_json_matchers/be_json.rb
@@ -1,3 +1,5 @@+require 'rspec/matchers/composable'
+
module RSpec
module ComposableJSONMatchers
# @api private
|
Add missing require for 'rspec/matchers/composable'
|
diff --git a/lib/chef_zero/endpoints/user_association_request_endpoint.rb b/lib/chef_zero/endpoints/user_association_request_endpoint.rb
index abc1234..def5678 100644
--- a/lib/chef_zero/endpoints/user_association_request_endpoint.rb
+++ b/lib/chef_zero/endpoints/user_association_request_endpoint.rb
@@ -16,8 +16,18 @@ json = JSON.parse(request.body, :create_additions => false)
association_request_path = [ 'organizations', orgname, 'association_requests', username ]
if json['response'] == 'accept'
+ users = get_data(request, [ 'organizations', orgname, 'groups', 'users' ])
+ users = JSON.parse(users, :create_additions => false)
+
delete_data(request, association_request_path)
create_data(request, [ 'organizations', orgname, 'users' ], username, '{}')
+
+ # Add the user to the users group if it isn't already there
+ if !users['users'] || !users['users'].include?(username)
+ users['users'] ||= []
+ users['users'] |= [ username ]
+ set_data(request, [ 'organizations', orgname, 'groups', 'users' ], JSON.pretty_generate(users))
+ end
elsif json['response'] == 'reject'
delete_data(request, association_request_path)
else
|
Add users to the users group in an org if not already there
|
diff --git a/spec/integration/renalware/session_timeout/session_expiry_spec.rb b/spec/integration/renalware/session_timeout/session_expiry_spec.rb
index abc1234..def5678 100644
--- a/spec/integration/renalware/session_timeout/session_expiry_spec.rb
+++ b/spec/integration/renalware/session_timeout/session_expiry_spec.rb
@@ -5,9 +5,9 @@ describe "Session timeout", type: :system, js: true do
around do |example|
original_session_timeout = Devise.timeout_in
- # see sessions_controller.js - we set the session timeout to be in the past
- # because we add an X second buffer in that file.
- Devise.timeout_in = -20.seconds
+ # see sessions_controller.js - we set the session timeout to be almost in the past
+ # because we add an 10 second buffer in that file.
+ Devise.timeout_in = -8.seconds
example.run
|
Fix intermittently failing session timeout spec
|
diff --git a/pushpop.gemspec b/pushpop.gemspec
index abc1234..def5678 100644
--- a/pushpop.gemspec
+++ b/pushpop.gemspec
@@ -9,8 +9,8 @@ s.authors = ["Josh Dzielak"]
s.email = "josh@keen.io"
s.homepage = "https://github.com/pushpop-project/pushpop"
- s.summary = "Share data between services at regular intervals"
- s.description = "Pushpop is a simple but powerful Ruby app that sends notifications about events captured with Keen IO."
+ s.summary = "A framework for scheduled integrations between popular services"
+ s.description = "Pushpop is a powerful framework for taking actions and integrating services at regular intervals."
s.add_dependency "clockwork"
|
Update gemspec to match readme
|
diff --git a/Timepiece.podspec b/Timepiece.podspec
index abc1234..def5678 100644
--- a/Timepiece.podspec
+++ b/Timepiece.podspec
@@ -1,6 +1,6 @@ Pod::Spec.new do |s|
s.name = "Timepiece"
- s.version = `git describe --tags --abbrev=0`
+ s.version = "0.4.2"
s.summary = "Intuitive NSDate extensions in Swift"
s.homepage = "https://github.com/naoty/Timepiece"
s.license = { :type => "MIT", :file => "LICENSE" }
|
Fix the specification of version on podspec
The previous definition causes users not to install from master.
|
diff --git a/lib/dat/science/result.rb b/lib/dat/science/result.rb
index abc1234..def5678 100644
--- a/lib/dat/science/result.rb
+++ b/lib/dat/science/result.rb
@@ -44,7 +44,11 @@
def serialized_exception
return nil unless exception
- { :class => exception.class.name, :message => exception.message }
+ {
+ :class => exception.class.name,
+ :message => exception.message,
+ :backtrace => exception.backtrace
+ }
end
def raised?
|
Include backtrace in serialized exception payload
|
diff --git a/lib/facter/esx_version.rb b/lib/facter/esx_version.rb
index abc1234..def5678 100644
--- a/lib/facter/esx_version.rb
+++ b/lib/facter/esx_version.rb
@@ -10,27 +10,31 @@ if File::executable?("/usr/sbin/dmidecode")
result = Facter::Util::Resolution.exec("/usr/sbin/dmidecode 2>&1")
if result
- bios_address = /^BIOS Information$.+?Address: (0x[0-9A-F]{5})$/m.match(result)[1]
+ begin
+ bios_address = /^BIOS Information$.+?Address: (0x[0-9A-F]{5})$/m.match(result)[1]
- case bios_address
- when '0xE8480'
- '2.5'
- when '0xE7C70'
- '3.0'
- when '0xE7910'
- '3.5'
- when '0xEA6C0'
- '4'
- when '0xEA550'
- '4 update 1'
- when '0xEA2E0'
- '4.1'
- when '0xE72C0'
- '5'
- when '0xEA0C0'
- '5.1'
- else
- "unknown, please report #{bios_address}"
+ case bios_address
+ when '0xE8480'
+ '2.5'
+ when '0xE7C70'
+ '3.0'
+ when '0xE7910'
+ '3.5'
+ when '0xEA6C0'
+ '4'
+ when '0xEA550'
+ '4 update 1'
+ when '0xEA2E0'
+ '4.1'
+ when '0xE72C0'
+ '5'
+ when '0xEA0C0'
+ '5.1'
+ else
+ "unknown, please report #{bios_address}"
+ end
+ rescue
+ 'n/a'
end
end
end
|
Handle case where facter is run as a non-root user
|
diff --git a/lib/fulcrum/attachment.rb b/lib/fulcrum/attachment.rb
index abc1234..def5678 100644
--- a/lib/fulcrum/attachment.rb
+++ b/lib/fulcrum/attachment.rb
@@ -19,10 +19,24 @@ end
def create(file, attrs = {})
- file = Faraday::UploadIO.new(file, nil)
response = call(:post, create_action, attrs)
- call(:put, response['url'], {file: file})
+ binary_upload(file, response['url'], attrs[:file_size])
{ name: attrs[:name], attachment_id: response['id'] }
+ end
+
+ private
+
+ def binary_upload(file, url, file_size)
+ connection = Faraday.new(url: url) do |faraday|
+ faraday.request :multipart
+ faraday.adapter :net_http
+ end
+ connection.put do |req|
+ req.headers['Content-Type'] = 'octet/stream'
+ req.headers['Content-Length'] = "#{file_size}"
+ req.headers['Content-Transfer-Encoding'] = 'binary'
+ req.body = Faraday::UploadIO.new(file, 'octet/stream')
+ end
end
end
end
|
Add binary upload feature for any file
|
diff --git a/lib/guard/simple_shell.rb b/lib/guard/simple_shell.rb
index abc1234..def5678 100644
--- a/lib/guard/simple_shell.rb
+++ b/lib/guard/simple_shell.rb
@@ -1,4 +1,3 @@-require 'guard/guard'
require 'rainbow'
module Guard
class Simpleshell < Plugin
|
Remove guard require for guard 2.0
|
diff --git a/lib/transpec/rspec_dsl.rb b/lib/transpec/rspec_dsl.rb
index abc1234..def5678 100644
--- a/lib/transpec/rspec_dsl.rb
+++ b/lib/transpec/rspec_dsl.rb
@@ -3,18 +3,28 @@ # Aliases by Capybara:
# https://github.com/jnicklas/capybara/blob/2.2.0/lib/capybara/rspec/features.rb
+# rubocop:disable LineLength
+
module Transpec
module RSpecDSL
+ # https://github.com/rspec/rspec-core/blob/77cc21e/lib/rspec/core/example_group.rb#L239-L265
+ # https://github.com/rspec/rspec-core/blob/77cc21e/lib/rspec/core/shared_example_group.rb#L50-L61
EXAMPLE_GROUP_METHODS = [
+ :example_group,
:describe, :context,
+ :xdescribe, :xcontext,
+ :fdescribe, :fcontext,
:shared_examples, :shared_context, :share_examples_for, :shared_examples_for,
:feature # Capybara
].freeze
+ # https://github.com/rspec/rspec-core/blob/77cc21e/lib/rspec/core/example_group.rb#L130-L171
EXAMPLE_METHODS = [
:example, :it, :specify,
- :focus, :focused, :fit,
- :pending, :xexample, :xit, :xspecify,
+ :focus, :fexample, :fit, :fspecify,
+ :focused, # TODO: Support conversion
+ :xexample, :xit, :xspecify,
+ :skip, :pending,
:scenario, :xscenario # Capybara
].freeze
|
Add alises of example group and example DSL
|
diff --git a/app/controllers/articles_controller.rb b/app/controllers/articles_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/articles_controller.rb
+++ b/app/controllers/articles_controller.rb
@@ -11,7 +11,7 @@ end
@breadcrumb_trails = @article.categories.map do |category|
- Core::BreadcrumbsReader.new(category.id, category_tree).call << category
+ Core::BreadcrumbsReader.new(category.id, category_tree).call { [] } << category
end
render Feature.active?(:left_hand_nav) ? :show_v2 : :show
|
Return empty array when BreadcrumbReader doesn't find the node
|
diff --git a/app/controllers/salaries_controller.rb b/app/controllers/salaries_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/salaries_controller.rb
+++ b/app/controllers/salaries_controller.rb
@@ -18,7 +18,7 @@ def select_employee
# Allow pre-seeding some parameters
salary_params = {
- :customer_id => current_tenant.company.id,
+ :employer_id => current_tenant.company.id,
:state => 'booked',
:duration_from => Date.today,
:duration_to => Date.today.in(30.days).to_date
|
Use employer_id instead of customer_id when building salary_params.
|
diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/sessions_controller.rb
+++ b/app/controllers/sessions_controller.rb
@@ -1,6 +1,6 @@ class SessionsController < ApplicationController
def new
- redirect_to leads_path if @current_user
+ redirect_to leads_path if current_user
end
def create
|
Fix redirect_to leads if user is logged
|
diff --git a/elasticsearch-client.gemspec b/elasticsearch-client.gemspec
index abc1234..def5678 100644
--- a/elasticsearch-client.gemspec
+++ b/elasticsearch-client.gemspec
@@ -22,7 +22,7 @@ s.add_dependency 'faraday', '~> 0.9'
s.add_dependency 'faraday_middleware', '~> 0.9'
s.add_dependency 'excon'
- s.add_dependency 'yajl-ruby', '~> 1.1.0'
+ s.add_dependency 'yajl-ruby', '~> 1.2.0'
s.add_development_dependency 'rake'
s.add_development_dependency 'minitest'
|
Update yajl-ruby dependency to get the fixes in 1.2.*
|
diff --git a/logstash-devutils.gemspec b/logstash-devutils.gemspec
index abc1234..def5678 100644
--- a/logstash-devutils.gemspec
+++ b/logstash-devutils.gemspec
@@ -6,7 +6,7 @@ files = %x{git ls-files}.split("\n")
spec.name = "logstash-devutils"
- spec.version = "0.0.18"
+ spec.version = "0.0.19"
spec.summary = "logstash-devutils"
spec.description = "logstash-devutils"
spec.license = "Apache 2.0"
@@ -31,4 +31,5 @@ spec.add_runtime_dependency "insist", "1.0.0" # (Apache 2.0 license)
spec.add_runtime_dependency "kramdown"
spec.add_runtime_dependency "stud", " >= 0.0.20"
+ spec.add_runtime_dependency "fivemat"
end
|
Add fivemat as a dependency
Fivemat give just the right amount of verbosity for the rspec output
Fixes #44
|
diff --git a/app/models/edition/supporting_pages.rb b/app/models/edition/supporting_pages.rb
index abc1234..def5678 100644
--- a/app/models/edition/supporting_pages.rb
+++ b/app/models/edition/supporting_pages.rb
@@ -1,22 +1,8 @@ module Edition::SupportingPages
extend ActiveSupport::Concern
- class Trait < Edition::Traits::Trait
- def process_associations_after_save(edition)
- @edition.supporting_pages.each do |sd|
- new_supporting_page = edition.supporting_pages.create(sd.attributes.except("id", "edition_id"))
- new_supporting_page.update_column(:slug, sd.slug)
- sd.attachments.each do |attachment|
- new_supporting_page.attachments << attachment.class.new(attachment.attributes)
- end
- end
- end
- end
-
- included do
- has_many :supporting_pages, foreign_key: :edition_id, dependent: :delete_all
-
- add_trait Trait
+ def supporting_pages
+ related_editions.where(type: 'SupportingPage')
end
def allows_supporting_pages?
@@ -26,4 +12,4 @@ def has_supporting_pages?
supporting_pages.any?
end
-end+end
|
Rewrite the supporting pages mixin.
Currently used only by Policy.
|
diff --git a/config/initializers/trusted_proxy_fix.rb b/config/initializers/trusted_proxy_fix.rb
index abc1234..def5678 100644
--- a/config/initializers/trusted_proxy_fix.rb
+++ b/config/initializers/trusted_proxy_fix.rb
@@ -0,0 +1,8 @@+# This is a fix for to prevent resuest.remote_ip from returning the squid proxy IP
+# instead of the user's actual ip. This is not for security, but for comment spam
+# reporting to Askimet
+#
+# This has been fixed for Rails 2.3.5 (http://github.com/rails/rails/commit/654568e71b1ee36a04acef74b1a8ce4737050882)
+# we're simply awaiting its release with this fix.
+
+ActionController::AbstractRequest.const_set("TRUSTED_PROXIES", /^72\.2\.4\.176$|^127\.0\.0\.1$|^(10|172\.(1[6-9]|2[0-9]|30|31)|192\.168)\./i)
|
Add trusted proxy fix initializer.
|
diff --git a/rspec-tabular.gemspec b/rspec-tabular.gemspec
index abc1234..def5678 100644
--- a/rspec-tabular.gemspec
+++ b/rspec-tabular.gemspec
@@ -19,7 +19,7 @@ spec.require_paths = ['lib']
spec.add_runtime_dependency 'rspec-core', '>= 2.99.0'
- spec.add_development_dependency 'bundler', '~> 1.9'
+ spec.add_development_dependency 'bundler', '~> 1.7'
spec.add_development_dependency 'rake', '~> 10.0'
spec.add_development_dependency 'rspec', '~> 2.99.0'
spec.add_development_dependency 'rubocop', '>= 0.30.0'
|
Set bundler to 1.7 which is supported by TravisCI
|
diff --git a/cookbooks/chef/attributes/default.rb b/cookbooks/chef/attributes/default.rb
index abc1234..def5678 100644
--- a/cookbooks/chef/attributes/default.rb
+++ b/cookbooks/chef/attributes/default.rb
@@ -5,7 +5,7 @@ default[:chef][:server][:version] = "12.0.8-1"
# Set the default client version
-default[:chef][:client][:version] = "12.7.2-1"
+default[:chef][:client][:version] = "12.8.1-1"
# A list of gems needed by chef recipes
default[:chef][:gems] = []
|
Update chef client to 12.8.1
|
diff --git a/lib/boxcar/api/smart.rb b/lib/boxcar/api/smart.rb
index abc1234..def5678 100644
--- a/lib/boxcar/api/smart.rb
+++ b/lib/boxcar/api/smart.rb
@@ -3,9 +3,7 @@ module Boxcar
module Smart
def temperature
- raw_temp = `smartctl -d ata -A /dev/#{device} | grep -i temperature`
- temp = raw_temp.match(/(\d+)(?:.?\(Min\/Max.+\))?$/)
- temp[1] if temp
+ raw_value device, 'Temperature_Celsius'
end
def device_model
@@ -18,12 +16,16 @@
def info
return {} unless Boxcar::Helpers.unraid?
- @info ||= parse_smart_info
+ @info ||= device_information
end
private
- def parse_smart_info
+ def raw_value(device, param)
+ `smartctl -d ata -A /dev/#{device} | grep #{param} | awk '{ print $10; }' 2>/dev/null`
+ end
+
+ def device_information
raw_info = `smartctl -i /dev/#{device}`
refined_info = raw_info.scan(/(^[\w\s]+):\s+(.+$)/)
Hash[*refined_info.flatten]
|
Refactor reading values from SMART
|
diff --git a/_plugins/feed_url_filter.rb b/_plugins/feed_url_filter.rb
index abc1234..def5678 100644
--- a/_plugins/feed_url_filter.rb
+++ b/_plugins/feed_url_filter.rb
@@ -0,0 +1,11 @@+# https://github.com/jessecrouch/jekyll-rss-absolute-urls
+module Jekyll
+ module RSSURLFilter
+ def relative_urls_to_absolute(input,url)
+ #url = "http://blog.jbfavre.org"
+ input.gsub('src="/', 'src="' + url + '/').gsub('href="/', 'href="' + url + '/')
+ end
+ end
+end
+
+Liquid::Template.register_filter(Jekyll::RSSURLFilter)
|
Add plugin to get absolute urls in feeds
|
diff --git a/lib/camcorder/errors.rb b/lib/camcorder/errors.rb
index abc1234..def5678 100644
--- a/lib/camcorder/errors.rb
+++ b/lib/camcorder/errors.rb
@@ -21,7 +21,7 @@ @side_effects = side_effects
end
def message
- "Recording for #{klass}.#{name} with args: #{args} and side_effects=#{side_effects} has changed. Consider using using `methods_with_side_effects`."
+ "Recording for #{klass}.#{name} with args: #{args} and side_effects=#{side_effects} has changed. Consider using `methods_with_side_effects`."
end
end
|
Remove duplicated 'using' in error message
|
diff --git a/app/controllers/spree/admin/look_book_image_products_controller.rb b/app/controllers/spree/admin/look_book_image_products_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/spree/admin/look_book_image_products_controller.rb
+++ b/app/controllers/spree/admin/look_book_image_products_controller.rb
@@ -5,7 +5,7 @@ def update_positions
ActiveRecord::Base.transaction do
params[:positions].each do |id, index|
- model_class.find(id).insert_at(index)
+ model_class.find(id).set_list_position(index)
end
end
|
Use set_list_position in update positions for products
|
diff --git a/activejob/lib/active_job.rb b/activejob/lib/active_job.rb
index abc1234..def5678 100644
--- a/activejob/lib/active_job.rb
+++ b/activejob/lib/active_job.rb
@@ -41,5 +41,4 @@
autoload :TestCase
autoload :TestHelper
- autoload :QueryTags
end
|
Remove autoload to unused constant
|
diff --git a/assets/config/redmine/smtp_settings.rb b/assets/config/redmine/smtp_settings.rb
index abc1234..def5678 100644
--- a/assets/config/redmine/smtp_settings.rb
+++ b/assets/config/redmine/smtp_settings.rb
@@ -8,7 +8,7 @@ :domain => "{{SMTP_DOMAIN}}",
:user_name => "{{SMTP_USER}}",
:password => "{{SMTP_PASS}}",
- :authentication => :login,
+ :authentication => {{SMTP_AUTHENTICATION}},
:enable_starttls_auto => {{SMTP_STARTTLS}}
}
end
|
Fix SMTP Authentification not exist in smtp config
Forget {{}} in smtp file and :login not replaced by init script
|
diff --git a/spec/workers/curry/import_unknown_pull_request_commit_authors_worker_spec.rb b/spec/workers/curry/import_unknown_pull_request_commit_authors_worker_spec.rb
index abc1234..def5678 100644
--- a/spec/workers/curry/import_unknown_pull_request_commit_authors_worker_spec.rb
+++ b/spec/workers/curry/import_unknown_pull_request_commit_authors_worker_spec.rb
@@ -2,10 +2,15 @@
describe Curry::ImportUnknownPullRequestCommitAuthorsWorker do
+ before do
+ allow(Curry::ClaValidationWorker).to receive(:perform_async)
+ allow_any_instance_of(Curry::ImportUnknownPullRequestCommitAuthors).
+ to receive(:import)
+ end
+
+ let(:pull_request) { create(:pull_request) }
+
it 'imports commit authors from the given Pull Request' do
- allow(Curry::ClaValidationWorker).to receive(:perform_async)
-
- pull_request = create(:pull_request)
expect_any_instance_of(Curry::ImportUnknownPullRequestCommitAuthors).
to receive(:import)
@@ -14,9 +19,9 @@ end
it 'runs the ClaValidationWorker' do
- pull_request = create(:pull_request)
expect(Curry::ClaValidationWorker).
- to receive(:perform_async)
+ to receive(:perform_async).
+ with(pull_request.id)
worker = Curry::ImportUnknownPullRequestCommitAuthorsWorker.new
worker.perform(pull_request.id)
|
Clarify commit author import collaborators
These specs now document which messages we expect to send to
collaborators. They're also more protected from changes to the internals
of the collaborators.
|
diff --git a/ael_tracker.gemspec b/ael_tracker.gemspec
index abc1234..def5678 100644
--- a/ael_tracker.gemspec
+++ b/ael_tracker.gemspec
@@ -18,7 +18,7 @@ spec.add_development_dependency "webmock"
spec.add_development_dependency 'json'
- spec.files = `git ls-files`.split($/)
+ spec.files = `git ls-files`.split("\n")
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]
|
Change gemspec for push to rubygems
|
diff --git a/lib/gds_api/helpers.rb b/lib/gds_api/helpers.rb
index abc1234..def5678 100644
--- a/lib/gds_api/helpers.rb
+++ b/lib/gds_api/helpers.rb
@@ -24,6 +24,7 @@ Object::const_defined?(:PANOPTICON_API_CREDENTIALS) ? PANOPTICON_API_CREDENTIALS : {}
end
+ # This method is deprecated. Use content_api.artefact instead.
def fetch_artefact(params)
panopticon_api.artefact_for_slug(params[:slug]) || OpenStruct.new(section: 'missing', need_id: 'missing', kind: 'missing')
end
|
Add deprecation notice to fetch_artefact method
|
diff --git a/lib/auth/gds_sso.rb b/lib/auth/gds_sso.rb
index abc1234..def5678 100644
--- a/lib/auth/gds_sso.rb
+++ b/lib/auth/gds_sso.rb
@@ -36,11 +36,11 @@ end
def oauth_id
- ENV.fetch("OAUTH_ID", "")
+ ENV.fetch("GDS_SSO_OAUTH_ID", "")
end
def oauth_secret
- ENV.fetch("OAUTH_SECRET", "")
+ ENV.fetch("GDS_SSO_OAUTH_SECRET", "")
end
end
end
|
Rename GDS SSO env vars
These were renamed in Puppet [1] to better explain usage in their name,
and this change has been deployed to production already. Most applications
don't use these env vars manually and instead use the
gds-sso gem [2], however as Search API is a Sinatra app rather than
Rails it has it's own rather special configuration.
[1]: https://github.com/alphagov/govuk-puppet/pull/10832
[2]: https://github.com/alphagov/gds-sso
|
diff --git a/core/lib/spree/testing_support/factories/inventory_unit_factory.rb b/core/lib/spree/testing_support/factories/inventory_unit_factory.rb
index abc1234..def5678 100644
--- a/core/lib/spree/testing_support/factories/inventory_unit_factory.rb
+++ b/core/lib/spree/testing_support/factories/inventory_unit_factory.rb
@@ -5,8 +5,18 @@
FactoryBot.define do
factory :inventory_unit, class: 'Spree::InventoryUnit' do
+ transient do
+ order nil
+ end
+
variant
- line_item { build(:line_item, variant: variant) }
+ line_item do
+ if order
+ build(:line_item, variant: variant, order: order)
+ else
+ build(:line_item, variant: variant)
+ end
+ end
state 'on_hand'
shipment { build(:shipment, state: 'pending', order: line_item.order) }
# return_authorization
|
Allow passing order to inventory_unit factory
|
diff --git a/lib/quality/version.rb b/lib/quality/version.rb
index abc1234..def5678 100644
--- a/lib/quality/version.rb
+++ b/lib/quality/version.rb
@@ -4,5 +4,5 @@ # reek, flog, flay and rubocop and makes sure your numbers don't get
# any worse over time.
module Quality
- VERSION = '23.0.1'
+ VERSION = '23.0.2'
end
|
Check for symlinks or submodules
|
diff --git a/lib/simplemvc/utils.rb b/lib/simplemvc/utils.rb
index abc1234..def5678 100644
--- a/lib/simplemvc/utils.rb
+++ b/lib/simplemvc/utils.rb
@@ -1,14 +1,14 @@ class String
def to_snake_case
self.gsub("::", "/").
- gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2'). # FOOBar => foo_bar
- gsub(/([a-z\d])(A-Z)/, '\1_\2'). #FO86OBar => fo_86_o_bar
+ gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
+ gsub(/([a-z\d])([A-Z])/,'\1_\2').
tr("-", "_").
downcase
end
def to_camel_case
- return self if self !~ "_" && self =~ /[A-Z]+*./
+ return self if self !~ /_/ && self =~ /[A-Z]+*./
split('_').map { |str| str.capitalize }.join # snake_case => SnakeCase
end
end
|
Fix some regex at controller render method
|
diff --git a/lib/slim_migrations.rb b/lib/slim_migrations.rb
index abc1234..def5678 100644
--- a/lib/slim_migrations.rb
+++ b/lib/slim_migrations.rb
@@ -13,7 +13,7 @@
# initialize migrations with <tt>migration do</tt> instead of <tt>class SomeMigration < ActiveRecord::Migration</tt>
def migration(&block)
- if caller[0].rindex(/(?:[0-9]+)_([_a-z0-9]*).rb:\d+(?::in `.*')?$/)
+ if caller[0].rindex(/\/(?:[0-9]+)_([_a-z0-9]*).rb:\d+(?::in `.*')?$/)
m = Object.const_set $1.camelize, Class.new(ActiveRecord::Migration)
m.class_eval(&block) # 3.1
else
|
Fix regex that creates migration class
Previously the regex would be incorrect if the migration name included a digit and a underscore, e.g. 'add_foo1_to_products'.
|
diff --git a/lib/squall/dns_zone.rb b/lib/squall/dns_zone.rb
index abc1234..def5678 100644
--- a/lib/squall/dns_zone.rb
+++ b/lib/squall/dns_zone.rb
@@ -27,7 +27,7 @@ #
# Returns a Hash.
def create(options = {})
- response = request(:post, "/dns_zones.json", query: { pack: options })
+ response = request(:post, "/dns_zones.json", default_params(options))
response['dns_zone']
end
|
Use default params for DNS zones
|
diff --git a/lib/van_helsing/git.rb b/lib/van_helsing/git.rb
index abc1234..def5678 100644
--- a/lib/van_helsing/git.rb
+++ b/lib/van_helsing/git.rb
@@ -6,6 +6,7 @@ queue %{
echo "-----> Cloning from the Git repository"
git clone "#{settings.repository!}" . -n --recursive &&
+ git rev-parse "#{revision}" 1>/dev/null &&
git checkout "#{revision}" 2>/dev/null &&
rm -rf .git
}
|
Fix the 'Git failing without warning' bug when the current rev hasn't been pushed.
|
diff --git a/lib/generators/atlassian_jwt_authentication/templates/jwt_token.rb b/lib/generators/atlassian_jwt_authentication/templates/jwt_token.rb
index abc1234..def5678 100644
--- a/lib/generators/atlassian_jwt_authentication/templates/jwt_token.rb
+++ b/lib/generators/atlassian_jwt_authentication/templates/jwt_token.rb
@@ -5,4 +5,6 @@ <% end %>
has_many :jwt_users, dependent: :destroy
-end+
+ attr_accessible :addon_key, :client_key, :shared_secret, :product_type
+end
|
Add attr_accessible for JwtToken fields.
|
diff --git a/app/jobs/application_job.rb b/app/jobs/application_job.rb
index abc1234..def5678 100644
--- a/app/jobs/application_job.rb
+++ b/app/jobs/application_job.rb
@@ -1,15 +1,14 @@ require 'newrelic_rpm'
class ApplicationJob < ActiveJob::Base
- around_perform :use_db_pool
rescue_from(StandardError) do |e|
NewRelic::Agent.notice_error(e)
end
- def use_db_pool(job)
+ around_perform do |job, block|
ActiveRecord::Base.connection_pool.with_connection do
- yield
+ block.call
end
end
end
|
Update around_perform syntax for ApplicationJob
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.