diff stringlengths 65 26.7k | message stringlengths 7 9.92k |
|---|---|
diff --git a/rumember.gemspec b/rumember.gemspec
index abc1234..def5678 100644
--- a/rumember.gemspec
+++ b/rumember.gemspec
@@ -12,7 +12,7 @@ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
- s.add_runtime_dependency("json", ["~> 1.8.0"])
+ s.add_runtime_dependency("json", ["~> 2.0"])
s.add_runtime_dependency("launchy", ["~> 2"])
s.add_development_dependency("rake", ["< 11"])
| Bump to json version compatible with Ruby 3.0
References https://github.com/tpope/vim-fugitive/issues/1666
|
diff --git a/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_coordinateResolution.rb b/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_coordinateResolution.rb
index abc1234..def5678 100644
--- a/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_coordinateResolution.rb
+++ b/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_coordinateResolution.rb
@@ -0,0 +1,29 @@+# mdJson 2.0 writer - coordinate resolution
+
+# History:
+# Stan Smith 2017-10-20 original script
+
+require 'jbuilder'
+
+module ADIWG
+ module Mdtranslator
+ module Writers
+ module MdJson
+
+ module CoordinateResolution
+
+ def self.build(hCoordRes)
+
+ Jbuilder.new do |json|
+ json.abscissaResolutionX hCoordRes[:abscissaResolutionX]
+ json.ordinateResolutionY hCoordRes[:ordinateResolutionY]
+ json.unitOfMeasure hCoordRes[:unitOfMeasure]
+ end
+
+ end # build
+ end # CoordinateResolution
+
+ end
+ end
+ end
+end
| Add mdJson readers for 'coordinateResolution'
include minitest
|
diff --git a/INAppStoreWindow.podspec b/INAppStoreWindow.podspec
index abc1234..def5678 100644
--- a/INAppStoreWindow.podspec
+++ b/INAppStoreWindow.podspec
@@ -1,12 +1,12 @@ Pod::Spec.new do |s|
- s.name = 'INAppStoreWindow'
- s.version = '1.3'
- s.summary = 'Mac App Store style NSWindow subclass.'
- s.homepage = 'https://github.com/indragiek/INAppStoreWindow'
- s.author = { 'Indragie Karunaratne' => 'i@indragie.com' }
- s.source_files = '*.{h,m}'
- s.source = { :git => 'https://github.com/indragiek/INAppStoreWindow.git', :tag => 'v1.3' }
- s.platform = :osx
- s.requires_arc = true
- s.license = { :type => 'BSD', :text => 'INAppStoreWindow is licensed under the BSD license.'}
+ s.name = 'INAppStoreWindow'
+ s.version = '1.4'
+ s.summary = 'Mac App Store style NSWindow subclass.'
+ s.homepage = 'https://github.com/indragiek/INAppStoreWindow'
+ s.author = { 'Indragie Karunaratne' => 'i@indragie.com' }
+ s.source_files = 'INAppStoreWindow'
+ s.source = { :git => 'https://github.com/indragiek/INAppStoreWindow.git', :tag => 'v1.4' }
+ s.platform = :osx
+ s.requires_arc = true
+ s.license = { :type => 'BSD', :text => 'INAppStoreWindow is licensed under the BSD license.'}
end | Update pod spec for v1.4
|
diff --git a/scissors.gemspec b/scissors.gemspec
index abc1234..def5678 100644
--- a/scissors.gemspec
+++ b/scissors.gemspec
@@ -20,6 +20,7 @@ gem.add_development_dependency 'rspec'
gem.add_development_dependency 'simplecov'
gem.add_development_dependency 'cane'
+ gem.add_development_dependency 'debugger'
gem.add_dependency 'rack'
end
| Make debugger available for development
|
diff --git a/features/support/start_app.rb b/features/support/start_app.rb
index abc1234..def5678 100644
--- a/features/support/start_app.rb
+++ b/features/support/start_app.rb
@@ -2,15 +2,22 @@ require 'timeout'
require 'httparty'
+# get the address and port if present (e.g. when running on c9.io)
+host = ENV['IP'] || 'localhost'
+port = ENV['PORT'] || '9999'
+url = "http://#{host}:#{port}"
+puts host
+puts "starting app on #{url}"
+
# Start the app
-server = ChildProcess.build('rackup', '--port', '9999')
+server = ChildProcess.build('rackup', '--host', host, '--port', port)
server.start
# Wait a bit until it is has fired up...
Timeout.timeout(3) do
loop do
begin
- HTTParty.get('http://localhost:9999')
+ HTTParty.get("#{url}")
break
rescue Errno::ECONNREFUSED =>
try_again
@@ -21,5 +28,6 @@
# Stop the app when all the tests finish
at_exit do
+ puts "shutting down app on #{url}"
server.stop
end
| Update cucumber setup to allow running on c9.io
|
diff --git a/spec/unit/search/presenters/highlighted_description_spec.rb b/spec/unit/search/presenters/highlighted_description_spec.rb
index abc1234..def5678 100644
--- a/spec/unit/search/presenters/highlighted_description_spec.rb
+++ b/spec/unit/search/presenters/highlighted_description_spec.rb
@@ -1,28 +1,28 @@ require 'spec_helper'
RSpec.describe Search::HighlightedDescription do
- it "adds_highlighting_if_present" do
+ it "adds highlighting if present" do
raw_result = {
- "fields" => { "description" => "I will be hightlighted." },
- "highlight" => { "description" => ["I will be <mark>hightlighted</mark>."] }
+ "fields" => { "description" => "I will be highlighted." },
+ "highlight" => { "description" => ["I will be <mark>highlighted</mark>."] }
}
highlighted_description = described_class.new(raw_result).text
- expect(highlighted_description).to eq("I will be <mark>hightlighted</mark>.")
+ expect(highlighted_description).to eq("I will be <mark>highlighted</mark>.")
end
- it "uses_default_description_if_hightlight_not_found" do
+ it "uses default description if highlight not found" do
raw_result = {
- "fields" => { "description" => "I will not be hightlighted & escaped." }
+ "fields" => { "description" => "I will not be highlighted & escaped." }
}
highlighted_description = described_class.new(raw_result).text
- expect(highlighted_description).to eq("I will not be hightlighted & escaped.")
+ expect(highlighted_description).to eq("I will not be highlighted & escaped.")
end
- it "truncates_default_description_if_hightlight_not_found" do
+ it "truncates default description if highlight not found" do
raw_result = {
"fields" => { "description" => ("This is a sentence that is too long." * 10) }
}
@@ -33,7 +33,7 @@ expect(highlighted_description.ends_with?('…')).to be_truthy
end
- it "returns_empty_string_if_theres_no_description" do
+ it "returns empty string if theres no description" do
raw_result = {
"fields" => { "description" => nil }
}
| Fix test names and typos in description highlighting spec
|
diff --git a/Casks/pandoc.rb b/Casks/pandoc.rb
index abc1234..def5678 100644
--- a/Casks/pandoc.rb
+++ b/Casks/pandoc.rb
@@ -1,7 +1,7 @@ class Pandoc < Cask
+ url 'https://pandoc.googlecode.com/files/pandoc-1.12.3.pkg.zip'
homepage 'http://johnmacfarlane.net/pandoc'
- url 'https://pandoc.googlecode.com/files/pandoc-1.12.3.pkg.zip'
version '1.12.3'
- sha1 '3fbdcbebb7f0fc966918933d792a08bbeda127c1'
+ sha256 '10d0de017e262fb875bf66497fa256cb4e30a33975c3c0f8f67a0ac9f2381cf8'
install 'pandoc-1.12.3.pkg'
end
| Correct field order in Pandoc Cask
Update to use SHA256 |
diff --git a/test/controllers/search_controller_test.rb b/test/controllers/search_controller_test.rb
index abc1234..def5678 100644
--- a/test/controllers/search_controller_test.rb
+++ b/test/controllers/search_controller_test.rb
@@ -1,14 +1,4 @@ require 'test_helper'
class SearchControllerTest < ActionController::TestCase
- test "should get search" do
- get :search
- assert_response :success
- end
-
- test "should get autocomplete" do
- get :autocomplete
- assert_response :success
- end
-
end
| Remove SearchControllerTest, it depends on elasticsearch
|
diff --git a/config/deploy.rb b/config/deploy.rb
index abc1234..def5678 100644
--- a/config/deploy.rb
+++ b/config/deploy.rb
@@ -1,14 +1,12 @@ set :application, "sanctionwatch"
set :domain, "sanctionwatch.net"
-set :repository, "http://svn.jsboulanger.com/sanction-watch/trunk/"
+set :repository, "git@github.com:jsboulanger/sanction-watch.git"
set :user, "root"
-#set :repository, "set your repository location here"
+set :scm, :git
set :use_sudo, false
set :deploy_to, "/var/www/#{application}"
-
-set :scm_username, "capistrano"
-set :scm_password, ""
+set :deploy_via, :remote_cache
role :app, domain
role :web, domain
@@ -25,4 +23,4 @@ run "cp -Rf #{shared_path}/config/* #{release_path}/config/"
run "ln -s #{shared_path}/data #{release_path}/data"
end
-after "deploy:update_code", :update_config+after "deploy:update_code", :update_config
| Deploy from public github repo
|
diff --git a/db/migrate/20160406101826_change_unique_index_on_taxon_concept_references.rb b/db/migrate/20160406101826_change_unique_index_on_taxon_concept_references.rb
index abc1234..def5678 100644
--- a/db/migrate/20160406101826_change_unique_index_on_taxon_concept_references.rb
+++ b/db/migrate/20160406101826_change_unique_index_on_taxon_concept_references.rb
@@ -0,0 +1,21 @@+class ChangeUniqueIndexOnTaxonConceptReferences < ActiveRecord::Migration
+ def up
+ remove_index "taxon_concept_references",
+ name: "index_taxon_concept_references_on_tc_id_is_std_is_cascaded"
+
+ add_index "taxon_concept_references", ["taxon_concept_id", "reference_id", "is_standard", "is_cascaded"], name: "index_taxon_concept_references_on_tc_id_is_std_is_cascaded", unique: true
+
+ remove_index "taxon_concept_references",
+ name: "index_taxon_concept_references_on_taxon_concept_id_and_ref_id"
+ end
+
+ def down
+ remove_index "taxon_concept_references",
+ name: "index_taxon_concept_references_on_tc_id_is_std_is_cascaded"
+
+ add_index "taxon_concept_references", ["taxon_concept_id", "reference_id", "is_standard", "is_cascaded"], name: "index_taxon_concept_references_on_tc_id_is_std_is_cascaded"
+
+ add_index "taxon_concept_references", ["taxon_concept_id", "reference_id"],
+ name: "index_taxon_concept_references_on_taxon_concept_id_and_ref_id"
+ end
+end
| Add uniqueness to already existing index on taxon_concept_references and remove the obsolete one
|
diff --git a/db/migrate/20170729084620_remove_person_id_from_gobierto_calendars_events.rb b/db/migrate/20170729084620_remove_person_id_from_gobierto_calendars_events.rb
index abc1234..def5678 100644
--- a/db/migrate/20170729084620_remove_person_id_from_gobierto_calendars_events.rb
+++ b/db/migrate/20170729084620_remove_person_id_from_gobierto_calendars_events.rb
@@ -10,8 +10,11 @@
GobiertoCalendars::Event.all.each do |e|
if p = GobiertoPeople::Person.find_by(id: e.person_id)
- e.collection = p.events_collection
+ collection = p.events_collection
+ e.collection = collection
e.save!
+
+ collection.append(e)
end
end
| Append events to collection items
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,3 +1,5 @@+require 'trackable_items'
+# Routes needs more thought since some default routes in ArchivesCentral are taking precedence.
ActionController::Routing::Routes.draw do |map|
map.resources :tracking_lists, :only => [:show]
end | Add require to fix missing route
Signed-off-by: Chris Toynbee <9bf3774ab19e71b4502fac9bd506468044cb6bd6@gmail.com>
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -22,6 +22,11 @@ GovukHealthcheck::ActiveRecord,
)
+ get "/healthcheck/live", to: proc { [200, {}, %w[OK]] }
+ get "/healthcheck/ready", to: GovukHealthcheck.rack_response(
+ GovukHealthcheck::ActiveRecord,
+ )
+
get "/stats", to: "stats#index"
root to: redirect("/applications", status: 302)
| Add RFC 141 healthcheck endpoints
Once govuk-puppet has been updated, the old endpoint can be removed.
See the RFC for more details.
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -23,6 +23,4 @@
delete '/:run', to: 'runs#delete', as: :delete
post '/:run/disown', to: 'runs#disown', as: :disown
-
- get '/games/:game', to: 'games#show'
end
| Remove unused (for now) game path
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -12,7 +12,9 @@ get :sell
get :reclaim
end
- resources :ideas
+ resources :ideas do
+ get :toggle_used
+ end
resources :games, except: [:index] do
resources :posts, only: [:new, :edit, :create, :update, :destroy] do
resources :comments, only: [:new, :edit, :create, :update, :destroy]
| Add route 'toggle_used' to Ideas
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -7,7 +7,7 @@ end
def matches?(request)
- request.format == mime_type
+ request.format == mime_type || request.format == '*/*'
end
end
| Allow curl to get HTML
|
diff --git a/MOAspects.podspec b/MOAspects.podspec
index abc1234..def5678 100644
--- a/MOAspects.podspec
+++ b/MOAspects.podspec
@@ -7,7 +7,7 @@ s.author = { "Hiromi Motodera" => "moai.motodera@gmail.com" }
s.source = { :git => "https://github.com/MO-AI/MOAspects.git", :tag => "#{s.version}", :submodules => true }
s.source_files = 'MOAspects/*.{h,m,swift}'
- s.ios.deployment_target = "6.0"
+ s.ios.deployment_target = "8.0"
s.osx.deployment_target = "10.8"
s.requires_arc = true
end
| Update pod spec for deployment target iOS 8.0
|
diff --git a/run.rb b/run.rb
index abc1234..def5678 100644
--- a/run.rb
+++ b/run.rb
@@ -4,21 +4,25 @@
matches = MatchImporter.new("bl1", 2012).matches
-predictor = PredictionFactory::PreviousMatch.new
evaluator = Evaluation::Kicktipp
+predictors = [ PredictionFactory::PreviousMatch.new ]
-predictions = matches.collect do |match|
- predictor.predict match
+scores = predictors.collect do |predictor|
+ predictions = matches.collect do |match|
+ predictor.predict match
+ end
+
+ predictions.compact!
+
+ scores = predictions.collect do |prediction|
+ eval = evaluator.new(prediction, prediction.match)
+ score = eval.evaluate
+
+ score
+ end
+
+ total_score = scores.reduce(:+)
+ [predictor.class.name, total_score]
end
-predictions.compact!
-
-scores = predictions.collect do |prediction|
- eval = evaluator.new(prediction, prediction.match)
- score = eval.evaluate
-
- score
-end
-
-total_score = scores.reduce(:+)
-p total_score+p scores | Prepare for using and comparing multiple prediction factories.
|
diff --git a/BlockTypeDescription.podspec b/BlockTypeDescription.podspec
index abc1234..def5678 100644
--- a/BlockTypeDescription.podspec
+++ b/BlockTypeDescription.podspec
@@ -9,4 +9,6 @@ :tag => '0.1.0' }
s.source_files = 'BlockTypeDescription'
s.requires_arc = true
+ s.ios.deployment_target = '4.0'
+ s.osx.deployment_target = '10.6'
end
| Add deployment targets for iOS and OS X
|
diff --git a/Casks/intellij-idea-ultimate-eap.rb b/Casks/intellij-idea-ultimate-eap.rb
index abc1234..def5678 100644
--- a/Casks/intellij-idea-ultimate-eap.rb
+++ b/Casks/intellij-idea-ultimate-eap.rb
@@ -1,10 +1,10 @@ class IntellijIdeaUltimateEap < Cask
- version '139.144.2'
- sha256 '49ef8ac753287031ae3ed604bbfd7a19e46359b318ac581db0a6100fb5ae0beb'
+ version '139.222.5'
+ sha256 '172f9b8fd38a8062250b2fbde7f66e81d07cd43029842fe5080ac00bff8d65ee'
url "http://download.jetbrains.com/idea/ideaIU-#{version}.dmg"
homepage 'https://confluence.jetbrains.com/display/IDEADEV/IDEA+14+EAP'
- license :unknown
+ license :commercial
app 'IntelliJ IDEA 14 EAP.app'
end
| Update IntelliJ IDEA Ultimate EAP to 139.222.5
|
diff --git a/spec/application_spec.rb b/spec/application_spec.rb
index abc1234..def5678 100644
--- a/spec/application_spec.rb
+++ b/spec/application_spec.rb
@@ -7,10 +7,19 @@ let(:client_id) { ENV["GITHUB_CLIENT_ID"] }
let(:client_secret) { ENV["GITHUB_CLIENT_SECRET"] }
+ describe "GET /" do
+ context "when the app is not authorised" do
+ it "redirects to request authorisation" do
+ get "/"
+ expect(last_response.status).to eq(302)
+ expect(last_response.location).to eq("http://example.org/auth/facebook")
+ end
+ end
+ end
+
describe "GET /privacy" do
it "shows the privacy page" do
get "/privacy"
-
expect(last_response.status).to eq(200)
expect(last_response.body).to \
include("The Campaign Monitor Subscribe Form app respect's the privacy of people who use it")
| Add simple spec for unauthed / request
|
diff --git a/api/ruby/team_audit.rb b/api/ruby/team_audit.rb
index abc1234..def5678 100644
--- a/api/ruby/team_audit.rb
+++ b/api/ruby/team_audit.rb
@@ -0,0 +1,72 @@+# GitHub & GitHub Enterprise Team auditor
+# =======================================
+#
+# Usage: ruby team_audit.rb <orgname>
+#
+# These environment variables must be set:
+# - GITHUB_TOKEN: A valid personal access token with Organzation admin priviliges
+# - GITHUB_API_ENDPOINT: A valid GitHub/GitHub Enterprise API endpoint URL
+# (use http://api.github.com for GitHub.com auditing)
+#
+# Requires the Octokit Rubygem: https://github.com/octokit/octokit.rb
+
+require 'octokit.rb'
+
+begin
+ ACCESS_TOKEN = ENV.fetch("GITHUB_TOKEN")
+ API_ENDPOINT = ENV.fetch("GITHUB_API_ENDPOINT")
+rescue KeyError
+ $stderr.puts "To run this script, please set the following environment variables:"
+ $stderr.puts "- GITHUB_TOKEN: A valid personal access token with Organzation admin priviliges"
+ $stderr.puts "- GITHUB_API_ENDPOINT: A valid GitHub/GitHub Enterprise API endpoint URL"
+ $stderr.puts " (use http://api.github.com for GitHub.com auditing)"
+ exit 1
+end
+
+Octokit.configure do |kit|
+ kit.api_endpoint = API_ENDPOINT
+ kit.access_token = ACCESS_TOKEN
+ kit.auto_paginate = true
+end
+
+if ARGV.length != 1
+ $stderr.puts "Pass a valid Organization name to audit."
+ exit 1
+end
+
+ORG = ARGV[0].to_s
+
+client = Octokit::Client.new
+
+begin
+ teams = client.organization_teams(ORG)
+rescue Octokit::NotFound
+ puts "FATAL: Organization not found with name: #{ORG} at #{API_ENDPOINT}."
+end
+
+dirname = [ORG, Date.today.to_s].join('-')
+
+unless File.exists? dirname
+ dir = Dir.mkdir dirname
+end
+
+teams.each do |team|
+ # Create Team Member Sheet
+ begin
+ m_filename = [team[:name], "Members"].join(' - ')
+ File.open("#{dirname}/#{m_filename}.csv", 'w') { |f| f.write client.team_members(team[:id]).map { |m| [m[:login], m[:site_admin]].join(', ') }.unshift('username, site_admin').join("\n") }
+ rescue Octokit::NotFound
+ puts "You do not have access to view members in #{team[:name]}"
+
+ end
+
+ # Create Team Repos Sheet
+ begin
+ m_filename = [team[:name], "Repositories"].join(' - ')
+ File.open("#{dirname}/#{m_filename}.csv", 'w') { |f| f.write client.team_repositories(team[:id]).map { |m| [m[:full_name], team[:permission]].join(', ') }.unshift('repo_name, access').join("\n") }
+ rescue Octokit::NotFound
+ puts "You do not have access to view repositories in #{team[:name]}"
+ end
+end
+
+puts "Output written to #{dirname}/"
| Create a script for auditing team members and repos
This allows an admin to get a CSV output of all members and repositories for all teams within an organization |
diff --git a/app/models/document.rb b/app/models/document.rb
index abc1234..def5678 100644
--- a/app/models/document.rb
+++ b/app/models/document.rb
@@ -33,10 +33,18 @@ def breadcrumbs
if document['details']['breadcrumbs'].present?
document['details']['breadcrumbs'].map do |breadcrumb|
- OpenStruct.new(link: breadcrumb['base_path'], label: breadcrumb['section_id'])
+ Breadcrumb.new(link: breadcrumb['base_path'], label: breadcrumb['section_id'])
end
else
[]
+ end
+ end
+
+ class Breadcrumb
+ attr_reader :link, :label
+ def initialize(link:, label:)
+ @link = link
+ @label = label
end
end
| Stop using an openstruct for breadcrumbs
The details for the breadcrumbs are static by now so we're not
getting any benefit to using an openstruct, but we do gain all the
downsides.
|
diff --git a/CSURITemplate.podspec b/CSURITemplate.podspec
index abc1234..def5678 100644
--- a/CSURITemplate.podspec
+++ b/CSURITemplate.podspec
@@ -11,14 +11,4 @@ s.source_files = 'CSURITemplate', 'CSURITemplate/**/*.{h,m}'
s.public_header_files = 'CSURITemplate/CSURITemplate.h'
s.requires_arc = true
- s.documentation = {
- :appledoc => [
- '--project-name', 'CSURITemplate',
- '--project-company', 'Cogenta Systems Ltd',
- '--docset-copyright', 'Cogenta Systems Ltd',
- '--ignore', 'Common',
- '--index-desc', 'README.md',
- '--no-keep-undocumented-objects',
- '--no-keep-undocumented-members',
- ]}
end
| Remove documentation instructions from podspec.
CocoaPods has removed appledoc support in favour of CocoaDocs. |
diff --git a/Casks/loadmytracks.rb b/Casks/loadmytracks.rb
index abc1234..def5678 100644
--- a/Casks/loadmytracks.rb
+++ b/Casks/loadmytracks.rb
@@ -2,10 +2,11 @@ version :latest
sha256 :no_check
- url 'http://www.cluetrust.com/Downloads/LoadMyTracks.dmg'
- appcast 'http://www.cluetrust.com/AppCasts/LoadMyTracks.xml'
+ # cluetrust.com is the official download host per the product homepage
+ url 'https://www.cluetrust.com/Downloads/LoadMyTracks.dmg'
+ appcast 'https://www.cluetrust.com/AppCasts/LoadMyTracks.xml'
name 'LoadMyTracks'
- homepage 'http://www.cluetrust.com/loadmytracks.html'
+ homepage 'http://www.loadmytracks.com/'
license :unknown # todo: change license and remove this comment; ':unknown' is a machine-generated placeholder
app 'LoadMyTracks.app'
| Fix homepage and update url and appcast to use SSL in LoadMyTracks Cask
Product has now his own homepage on a new domain.
The url and appcast stanza URL is already getting redirected to HTTPS. Using the HTTPS URL directly
makes it more secure and saves a HTTP round-trip."
|
diff --git a/carrierwave-cascade.gemspec b/carrierwave-cascade.gemspec
index abc1234..def5678 100644
--- a/carrierwave-cascade.gemspec
+++ b/carrierwave-cascade.gemspec
@@ -8,8 +8,15 @@ spec.version = Carrierwave::Cascade::VERSION
spec.authors = ["Kevin Glowacz"]
spec.email = ["kevin@glowacz.info"]
- spec.description = %q{TODO: Write a gem description}
- spec.summary = %q{TODO: Write a gem summary}
+ spec.description = %q{A storage plugin for carrierwave that will
+ retrieving files from a secondary storageif the file is not present in the
+ primary storage. New files will always be stored in the primary storage.
+ This is perfect for use while migrating from one storage to another, or to
+ avoid polluting a production environment when running a staging mirror.
+ }
+ spec.summary = %q{Retrieve from a secondary storage when the file is
+ not in the primary storage.
+ }
spec.homepage = ""
spec.license = "MIT"
| Add gem summary and description
|
diff --git a/recipes/steam_controller_udev_rules.rb b/recipes/steam_controller_udev_rules.rb
index abc1234..def5678 100644
--- a/recipes/steam_controller_udev_rules.rb
+++ b/recipes/steam_controller_udev_rules.rb
@@ -24,6 +24,7 @@
template '/etc/udev/rules.d/99-steam-controller-uinput.rules' do
source 'steam/steam-controller-perms.rules.erb'
+ variables({group: node[:desktop][:user][:group]})
mode 0444
notifies :run, 'execute[udev-reload-uinput-driver]', :immediately
end
| Correct permissions for x360 gamepad emulation by steam controllers
|
diff --git a/ws/ws_server.rb b/ws/ws_server.rb
index abc1234..def5678 100644
--- a/ws/ws_server.rb
+++ b/ws/ws_server.rb
@@ -14,15 +14,15 @@ ws = Faye::WebSocket.new(env)
ws.on :open do |event|
- p [:open, ws.object_id]
+ puts "Incoming WS connection - object ID: #{event.object_id}"
end
ws.on :message do |event|
- p [:message, event.data]
+ puts "Received message: #{event.data}"
end
ws.on :close do |event|
- p [:close, ws.object_id, event.code, event.reason]
+ puts "Closing WS connection from #{event.object_id} (code: #{event.code}, reason: '#{event.reason}')"
ws = nil
end
| Make some more custom WS debug messages
|
diff --git a/lib/tilt/prawn.rb b/lib/tilt/prawn.rb
index abc1234..def5678 100644
--- a/lib/tilt/prawn.rb
+++ b/lib/tilt/prawn.rb
@@ -33,7 +33,7 @@ end
def evaluate(scope, locals, &block)
- scope = scope ? scope.dup : BasicObject.new
+ scope = scope ? scope.dup : Object.new
pdf = engine.new
if data.respond_to?(:call)
locals.each do |key, val|
| Use Object instead of BasicObject as default scope
|
diff --git a/db/data_migration/20150730134022_republish_routes_for_all_detailed_guides.rb b/db/data_migration/20150730134022_republish_routes_for_all_detailed_guides.rb
index abc1234..def5678 100644
--- a/db/data_migration/20150730134022_republish_routes_for_all_detailed_guides.rb
+++ b/db/data_migration/20150730134022_republish_routes_for_all_detailed_guides.rb
@@ -1,7 +1,20 @@ require 'plek'
require 'gds_api/router'
+class GdsApi::UrlArbiter < GdsApi::Base
+ def publishing_app_for_path(path)
+ response = get_json("#{endpoint}/paths#{path}")
+ response["publishing_app"] if response
+ end
+
+ def set_publishing_app_for_path(path, app)
+ put_json!("#{endpoint}/paths#{path}", "publishing_app" => app)
+ end
+end
+
+
router_api = GdsApi::Router.new(Plek.find('router-api'))
+url_arbiter = GdsApi::UrlArbiter.new(Plek.find('url-arbiter'))
scope = Document.distinct.
joins(:editions).
@@ -13,6 +26,13 @@ scope.each_with_index do |guide, i|
if guide.ever_published_editions.any?
slug = guide.slug.sub(%r{^deleted-}, '')
+ publishing_app = url_arbiter.publishing_app_for_path("/#{slug}")
+ if publishing_app && publishing_app != "whitehall"
+ puts "WARNING: Couldn't add route for /#{slug}, owned by #{publishing_app}"
+ next
+ elsif publishing_app.nil?
+ url_arbiter.set_publishing_app_for_path("/#{slug}", "whitehall")
+ end
puts "Adding route #{i+1}/#{count} for /#{slug}"
router_api.add_route("/#{slug}", "exact", "whitehall-frontend")
end
| Check with url-arbiter before adding route
Before re-registering the route, check with url-arbiter that whitehall
owns the url. If it’s owned by another app, skip it. If url-arbiter
doesn’t know about it, reserve it for whitehall.
This uses a dummy API adapter for url-arbiter because adding the
govuk-client-url_arbiter gem for this one-shot script didn’t seem like
a good idea.
|
diff --git a/Casks/psequel.rb b/Casks/psequel.rb
index abc1234..def5678 100644
--- a/Casks/psequel.rb
+++ b/Casks/psequel.rb
@@ -1,11 +1,11 @@ cask :v1 => 'psequel' do
- version :latest
- sha256 :no_check
+ version '1.1.2'
+ sha256 '19c2721002ed35e899bfdc9fd1a52f1d8cbc42e869b407eaf536ce82a32763f5'
- url 'http://www.psequel.com/download'
+ url "http://www.psequel.com/download?version=#{version}"
name 'PSequel'
homepage 'http://www.psequel.com'
- license :unknown # todo: change license and remove this comment; ':unknown' is a machine-generated placeholder
+ license :closed
app 'PSequel.app'
end
| Fix URL in Psequel.app Cask
URL was unversioned and failed to download.
Also fixed version to 1.1.2 as 1.2.0 is not stable.
|
diff --git a/spec/controllers/projects/protected_tags_controller_spec.rb b/spec/controllers/projects/protected_tags_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/projects/protected_tags_controller_spec.rb
+++ b/spec/controllers/projects/protected_tags_controller_spec.rb
@@ -8,4 +8,21 @@ get(:index, namespace_id: project.namespace.to_param, project_id: project)
end
end
+
+ describe "DELETE #destroy" do
+ let(:project) { create(:project, :repository) }
+ let(:protected_tag) { create(:protected_tag, :developers_can_create, project: project) }
+ let(:user) { create(:user) }
+
+ before do
+ project.add_master(user)
+ sign_in(user)
+ end
+
+ it "deletes the protected tag" do
+ delete(:destroy, namespace_id: project.namespace.to_param, project_id: project, id: protected_tag.id)
+
+ expect { ProtectedTag.find(protected_tag.id) }.to raise_error(ActiveRecord::RecordNotFound)
+ end
+ end
end
| Add spec for deleting protected tags
|
diff --git a/kentucky.gemspec b/kentucky.gemspec
index abc1234..def5678 100644
--- a/kentucky.gemspec
+++ b/kentucky.gemspec
@@ -23,8 +23,8 @@ s.require_paths = ["lib"]
s.add_dependency('sass', '~> 3.4')
- s.add_dependency('thor', '>= 0')
+ s.add_dependency('thor', '~> 0')
- s.add_development_dependency('aruba', '>= 0')
- s.add_development_dependency('rake', '>= 0')
+ s.add_development_dependency('aruba', '= 0.4.11')
+ s.add_development_dependency('rake', '~> 0')
end
| Update semantic version calls to dependencies
|
diff --git a/config/deploy/production.rb b/config/deploy/production.rb
index abc1234..def5678 100644
--- a/config/deploy/production.rb
+++ b/config/deploy/production.rb
@@ -8,14 +8,14 @@
# Extended Server Syntax
# ======================
-server 'zerocred.club', user: 'deploy', roles: %w{web app db}
+server '104.236.111.107', user: 'deploy', roles: %w{web app db}
# you can set custom ssh options
# it's possible to pass any option but you need to keep in mind that net/ssh understand limited list of options
# you can see them in [net/ssh documentation](http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start)
# set it globally
set :ssh_options, {
- keys: %w(~/.ssh/zerocred-deploy),
+ keys: %w(~/.ssh/digitalocean-deploy),
forward_agent: true,
auth_methods: %w(publickey)
}
| Fix IP address & deploy key
|
diff --git a/schema.gemspec b/schema.gemspec
index abc1234..def5678 100644
--- a/schema.gemspec
+++ b/schema.gemspec
@@ -2,7 +2,7 @@ Gem::Specification.new do |s|
s.name = 'schema'
s.summary = "Primitives for schema and structure"
- s.version = '0.4.2.0'
+ s.version = '0.4.3.0'
s.description = ' '
s.authors = ['The Eventide Project']
| Package version is increased from 0.4.2.0 to 0.4.3.0
|
diff --git a/app/helpers/static_helper.rb b/app/helpers/static_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/static_helper.rb
+++ b/app/helpers/static_helper.rb
@@ -1,9 +1,12 @@ # typed: false
# frozen_string_literal: true
+require "sorbet-runtime"
+
module StaticHelper
# For sorbet
- include GeneratedUrlHelpersModule
+ # See https://sorbet.org/docs/error-reference#4002
+ T.unsafe(self).include Rails.application.routes.url_helpers
include ActionView::Helpers::OutputSafetyHelper
include ActionView::Helpers::UrlHelper
| Fix for recent type changes
|
diff --git a/app/mailers/devise_mailer.rb b/app/mailers/devise_mailer.rb
index abc1234..def5678 100644
--- a/app/mailers/devise_mailer.rb
+++ b/app/mailers/devise_mailer.rb
@@ -1,4 +1,4 @@ class DeviseMailer < Devise::Mailer
- default from: "GitLab <#{Gitlab.config.gitlab.email_from}>"
+ default from: "#{Gitlab.config.gitlab.email_display_name} <#{Gitlab.config.gitlab.email_from}>"
default reply_to: Gitlab.config.gitlab.email_reply_to
end
| Use the configured display name in e-mails from Devise mailer
|
diff --git a/app/models/effective/post.rb b/app/models/effective/post.rb
index abc1234..def5678 100644
--- a/app/models/effective/post.rb
+++ b/app/models/effective/post.rb
@@ -8,7 +8,7 @@ belongs_to :user
structure do
- title :string, :validates => [:presence]
+ title :string, :validates => [:presence, :length => {:maximum => 255}]
category :string, :validates => [:presence]
published_at :datetime, :validates => [:presence]
| Add maxlength validation to title
|
diff --git a/spec/bike_test.rb b/spec/bike_test.rb
index abc1234..def5678 100644
--- a/spec/bike_test.rb
+++ b/spec/bike_test.rb
@@ -32,11 +32,7 @@ #actaul value
actual_value = bike.is_cool?
- if actual_value == expected_value
- print '.'
- else
- raise "Test failed. Expected #{expected_value} to equal #{actual_value}"
- end
+ assert_equal(expected_value, actual_value)
end
def test_blue_bikes_are_not_cool
@@ -48,11 +44,7 @@ #actaul value
actual_value = bike.is_cool?
- if actual_value == expected_value
- print '.'
- else
- raise "Test failed. Expected #{expected_value} to equal #{actual_value}"
- end
+ assert_equal(expected_value, actual_value)
end
test_ask_bike_for_color
| Use helper across the board
|
diff --git a/spec/cats_spec.rb b/spec/cats_spec.rb
index abc1234..def5678 100644
--- a/spec/cats_spec.rb
+++ b/spec/cats_spec.rb
@@ -0,0 +1,22 @@+require 'spec_helper'
+
+describe Cats do
+ it 'should have a version number' do
+ ::Cats::VERSION.wont_be_nil
+ end
+
+ it 'should generate cat facts' do
+ Cats.fact(0).must_equal []
+
+ Cats.fact.length.must_equal 1
+ Cats.fact(1).length.must_equal 1
+ Cats.fact(10).length.must_equal 10
+
+ #Cats.fact(1000).length.must_equal 1000
+ Cats.fact 1000
+
+ Cats.fact(10).each { |fact| fact.must_be_instance_of String }
+
+ proc { Cats.fact(-1) }.must_raise ArgumentError
+ end
+end
| Add initial tests for Cats
|
diff --git a/test/integration/mongod-lwrp/serverspec/mongod_lwrp_spec.rb b/test/integration/mongod-lwrp/serverspec/mongod_lwrp_spec.rb
index abc1234..def5678 100644
--- a/test/integration/mongod-lwrp/serverspec/mongod_lwrp_spec.rb
+++ b/test/integration/mongod-lwrp/serverspec/mongod_lwrp_spec.rb
@@ -4,7 +4,7 @@ include Serverspec::Helper::Exec
include Serverspec::Helper::DetectOS
-describe file("/etc/mongodb/mongod.conf") do
+describe file("/etc/mongodb/mongod-primary.conf") do
it { should be_file }
it { should contain "port = 27018" }
it { should contain "dbpath = /var/lib/mongo_data/mongod-primary" }
| Fix typo in integration test
|
diff --git a/db/migrate/20160902122721_drop_gitorious_field_from_application_settings.rb b/db/migrate/20160902122721_drop_gitorious_field_from_application_settings.rb
index abc1234..def5678 100644
--- a/db/migrate/20160902122721_drop_gitorious_field_from_application_settings.rb
+++ b/db/migrate/20160902122721_drop_gitorious_field_from_application_settings.rb
@@ -7,7 +7,11 @@ def up
require 'yaml'
- yaml = connection.execute('SELECT import_sources FROM application_settings;').values[0][0]
+ yaml = if Gitlab::Database.postgresql?
+ connection.execute('SELECT import_sources FROM application_settings;').values[0][0]
+ else
+ connection.execute('SELECT import_sources FROM application_settings;').first[0]
+ end
yaml = YAML.safe_load(yaml)
yaml.delete 'gitorious'
| Support MySQL too, when removing gitorious from import_sources
|
diff --git a/db/data_migration/20210304152459_update_pa_ur_attachments_to_pa_pk.rb b/db/data_migration/20210304152459_update_pa_ur_attachments_to_pa_pk.rb
index abc1234..def5678 100644
--- a/db/data_migration/20210304152459_update_pa_ur_attachments_to_pa_pk.rb
+++ b/db/data_migration/20210304152459_update_pa_ur_attachments_to_pa_pk.rb
@@ -0,0 +1,9 @@+attachments = Attachment.where(locale: "pa-ur")
+
+document_ids = Edition.distinct.where(id: attachments.select(:attachable_id)).pluck(:document_id)
+
+attachments.update_all(locale: "pa-pk")
+
+document_ids.each do |id|
+ PublishingApiDocumentRepublishingWorker.perform_async_in_queue("bulk_republishing", id)
+end
| Migrate Attachments with pa-ur locale to pa-pk
|
diff --git a/spec/helper.rb b/spec/helper.rb
index abc1234..def5678 100644
--- a/spec/helper.rb
+++ b/spec/helper.rb
@@ -1,5 +1,9 @@ $:.unshift File.expand_path('..', __FILE__)
$:.unshift File.expand_path('../../lib', __FILE__)
+
+major, minor, patch = RUBY_VERSION.split('.')
+$KCODE = 'UTF8' if major.to_i == 1 && minor.to_i < 9
+
require 'simplecov'
SimpleCov.start
require 'twitter'
| Set KCODE in Ruby versions < 1.9 for twitter-text
|
diff --git a/test/models/site_test.rb b/test/models/site_test.rb
index abc1234..def5678 100644
--- a/test/models/site_test.rb
+++ b/test/models/site_test.rb
@@ -2,12 +2,12 @@
class SiteTest < ActiveSupport::TestCase
setup do
- @site = Site.create(name: "name",
- js_url: "http://example.com/application.js",
- css_url: "http://example.com/application.css")
- @post = @site.posts.create(title: "title", body: "body", original_id: 1)
+ @site = Site.create!(name: "name",
+ js_url: "http://example.com/application.js",
+ css_url: "http://example.com/application.css")
+ @post = @site.posts.create!(title: "title", body: "body", original_id: 1)
Tempfile.open do |file|
- @post.images.create(image: file)
+ @post.images.create!(image: file)
end
end
| Use `create!` instead of `create`
Because `create!` raises an error when failed to create record.
|
diff --git a/recipes/default.rb b/recipes/default.rb
index abc1234..def5678 100644
--- a/recipes/default.rb
+++ b/recipes/default.rb
@@ -18,7 +18,7 @@ # limitations under the License.
if platform?('windows')
- if node['platform_version'].to_i >= 6
+ if node['platform_version'].to_f >= 6.1
windows_package 'Microsoft .NET Framework 4 Client Profile' do
source node['ms_dotnet4']['http_url']
installer_type :custom
| Fix the platform version detection
Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
|
diff --git a/test/helpers/auth_helper.rb b/test/helpers/auth_helper.rb
index abc1234..def5678 100644
--- a/test/helpers/auth_helper.rb
+++ b/test/helpers/auth_helper.rb
@@ -7,8 +7,10 @@ # Gets an auth token for the provided user
#
def auth_token(user = User.first)
- user.extend_authentication_token(true)
- user.auth_token
+ token = user.valid_auth_tokens().first
+ return token.auth_token unless token.nil?
+
+ return user.generate_authentication_token!().auth_token
end
#
| TEST: Fix auth token generation in test helper
|
diff --git a/recipes/default.rb b/recipes/default.rb
index abc1234..def5678 100644
--- a/recipes/default.rb
+++ b/recipes/default.rb
@@ -1,5 +1,13 @@ app = search(:aws_opsworks_app).first
app_path = "/srv/#{app['shortname']}"
+
+package "git" do
+ # workaround for:
+ # WARNING: The following packages cannot be authenticated!
+ # liberror-perl
+ # STDERR: E: There are problems and -y was used without --force-yes
+ options "--force-yes" if node["platform"] == "ubuntu" && node["platform_version"] == "14.04"
+end
application app_path do
javascript "4"
| Install git, with force where needed
|
diff --git a/recipes/default.rb b/recipes/default.rb
index abc1234..def5678 100644
--- a/recipes/default.rb
+++ b/recipes/default.rb
@@ -24,6 +24,6 @@ post_install_action node['chef_client_updater']['post_install_action']
download_url_override node['chef_client_updater']['download_url_override'] if node['chef_client_updater']['download_url_override']
checksum node['chef_client_updater']['checksum'] if node['chef_client_updater']['checksum']
- upgrade_delay node['chef_client_updater']['upgrade_delay'] if node['chef_client_updater']['upgrade_delay']
+ upgrade_delay node['chef_client_updater']['upgrade_delay'].nil? ? 30 : node['chef_client_updater']['upgrade_delay']
product_name node['chef_client_updater']['product_name'] if node['chef_client_updater']['product_name']
end
| Fix warning '/ST is earlier than current time'
Signed-off-by: Yury Levin <641503cf3d0489830b4ee74da6f72799d880a3d9@gmail.com>
|
diff --git a/test/test_application.rb b/test/test_application.rb
index abc1234..def5678 100644
--- a/test/test_application.rb
+++ b/test/test_application.rb
@@ -1,6 +1,15 @@ require_relative 'test_helper'
+class TestController < Rulers::Controller
+ def index
+ 'Hello!'
+ end
+end
+
class TestApp < Rulers::Application
+ def get_controller_and_action
+ ['TestController', 'index']
+ end
end
class RulersAppTest < Test::Unit::TestCase
| Update to mock controller in test
|
diff --git a/test/test_doctor_command.rb b/test/test_doctor_command.rb
index abc1234..def5678 100644
--- a/test/test_doctor_command.rb
+++ b/test/test_doctor_command.rb
@@ -1,7 +1,7 @@ require 'helper'
require 'jekyll/commands/doctor'
-class TestDoctorCommand < Test::Unit::TestCase
+class TestDoctorCommand < JekyllUnitTest
context 'urls only differ by case' do
setup do
clear_dest
| Change TestDoctorCommand to JekyllUnitTest since Test constant doesn't necessarily exist
|
diff --git a/railties/lib/rails/generators/rails/plugin_new/templates/test/test_helper.rb b/railties/lib/rails/generators/rails/plugin_new/templates/test/test_helper.rb
index abc1234..def5678 100644
--- a/railties/lib/rails/generators/rails/plugin_new/templates/test/test_helper.rb
+++ b/railties/lib/rails/generators/rails/plugin_new/templates/test/test_helper.rb
@@ -10,6 +10,6 @@ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
# Load fixtures from the engine
-if ActiveSupport::TestCase.method_defined?(:fixture_path)
+if ActiveSupport::TestCase.method_defined?(:fixture_path=)
ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
-end+end
| Check for existence of exactly the called `fixture_path=` method
|
diff --git a/db/migrate/20200312145819_add_root_account_id_to_wiki_pages.rb b/db/migrate/20200312145819_add_root_account_id_to_wiki_pages.rb
index abc1234..def5678 100644
--- a/db/migrate/20200312145819_add_root_account_id_to_wiki_pages.rb
+++ b/db/migrate/20200312145819_add_root_account_id_to_wiki_pages.rb
@@ -0,0 +1,32 @@+#
+# Copyright (C) 2020 - present Instructure, Inc.
+#
+# This file is part of Canvas.
+#
+# Canvas is free software: you can redistribute it and/or modify
+# the terms of the GNU Affero General Public License as publishe
+# Software Foundation, version 3 of the License.
+#
+# Canvas is distributed in the hope that it will be useful, but
+# WARRANTY; without even the implied warranty of MERCHANTABILITY
+# A PARTICULAR PURPOSE. See the GNU Affero General Public Licens
+# details.
+#
+# You should have received a copy of the GNU Affero General Publ
+# with this program. If not, see <http://www.gnu.org/licenses/>.
+
+class AddRootAccountIdToWikiPages < ActiveRecord::Migration[5.2]
+ include MigrationHelpers::AddColumnAndFk
+
+ tag :predeploy
+ disable_ddl_transaction!
+
+ def up
+ add_column_and_fk :wiki_pages, :root_account_id, :accounts
+ add_index :wiki_pages, :root_account_id, algorithm: :concurrently
+ end
+
+ def down
+ remove_column :wiki_pages, :root_account_id
+ end
+end
| Add root account id to wiki pages
Close PLAT-5577
Test Plan:
- Verify migrations run
- Verify the root_account_id can be set on a WikiPage record
Change-Id: I537982140e9ae23a018c07f069dbb7d60454ccd8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/229755
Tested-by: Service Cloud Jenkins <9144042a601061f88f1e1d7a1753ea3e2972119d@instructure.com>
QA-Review: Weston Dransfield <e9203059795dc94e28a8831c65eb7869e818825e@instructure.com>
Product-Review: Weston Dransfield <e9203059795dc94e28a8831c65eb7869e818825e@instructure.com>
Reviewed-by: Clint Furse <b31c824c483447b2438702c2da6f729b3ebb9b50@instructure.com>
Reviewed-by: Cody Cutrer <c4fe2b1d90ef8f2548c8aeabfa633434316f0305@instructure.com>
|
diff --git a/devise-two-factor.gemspec b/devise-two-factor.gemspec
index abc1234..def5678 100644
--- a/devise-two-factor.gemspec
+++ b/devise-two-factor.gemspec
@@ -24,9 +24,9 @@ s.add_runtime_dependency 'devise'
s.add_runtime_dependency 'rotp'
- s.add_development_dependency 'bundler', '~> 1.0'
+ s.add_development_dependency 'bundler', '> 1.0'
s.add_development_dependency 'rspec', '~> 2.8'
- s.add_development_dependency 'simplecov', '>= 0'
+ s.add_development_dependency 'simplecov'
s.add_development_dependency 'faker'
s.add_development_dependency 'timecop'
end
| Change dependency locking for bundler and simplecov
|
diff --git a/app/calculators/replacement_cost_plus_interest_calculator.rb b/app/calculators/replacement_cost_plus_interest_calculator.rb
index abc1234..def5678 100644
--- a/app/calculators/replacement_cost_plus_interest_calculator.rb
+++ b/app/calculators/replacement_cost_plus_interest_calculator.rb
@@ -16,8 +16,8 @@ Rails.logger.debug "ReplacementCostPlusInterestCalculator.calculate(asset)"
# Get the replacement cost of the asset
- initial_cost = asset.cost
- Rails.logger.debug "initial_cost #{initial_cost}"
+ replacement_cost = asset.policy_analyzer.get_replacement_cost
+ Rails.logger.debug "initial_cost #{replacement_cost}"
if on_date.nil?
replacement_year = current_planning_year_year
@@ -33,7 +33,7 @@ # interest rate as decimal
inflation_rate = asset.policy_analyzer.get_annual_inflation_rate / 100.0
- future_cost(initial_cost, num_years_to_replacement, inflation_rate)
+ future_cost(replacement_cost, num_years_to_replacement, inflation_rate)
end
| Fix bug in replacement cost calculator
|
diff --git a/app/presenters/renalware/renal/clinical_summary_presenter.rb b/app/presenters/renalware/renal/clinical_summary_presenter.rb
index abc1234..def5678 100644
--- a/app/presenters/renalware/renal/clinical_summary_presenter.rb
+++ b/app/presenters/renalware/renal/clinical_summary_presenter.rb
@@ -37,13 +37,13 @@ patient = Renalware::Letters.cast_patient(@patient)
patient.letters
.approved
- .limit(6)
- .reverse
.with_main_recipient
.with_letterhead
.with_author
.with_event
.with_patient
+ .limit(6)
+ .reverse
end
def present_letters(letters)
| Fix issue in order of scopes
|
diff --git a/NPAudioStream.podspec b/NPAudioStream.podspec
index abc1234..def5678 100644
--- a/NPAudioStream.podspec
+++ b/NPAudioStream.podspec
@@ -1,6 +1,6 @@ Pod::Spec.new do |s|
s.name = 'NPAudioStream'
- s.version = '0.1.1'
+ s.version = '0.1.2'
s.license = 'MIT'
s.summary = 'NPAudioStream is an easily controllable, robust audio streaming library for iOS and Mac OS X.'
s.homepage = 'https://github.com/NoonPacific/NPAudioStream'
| Update version number to 0.1.2
|
diff --git a/rocketjob.gemspec b/rocketjob.gemspec
index abc1234..def5678 100644
--- a/rocketjob.gemspec
+++ b/rocketjob.gemspec
@@ -1,5 +1,7 @@+$:.push File.expand_path("../lib", __FILE__)
+
# Maintain your gem's version:
-require_relative 'lib/rocket_job/version'
+require 'rocket_job/version'
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
| Make bundler work on JRuby
|
diff --git a/db/seeds.rb b/db/seeds.rb
index abc1234..def5678 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -20,4 +20,6 @@ end
end
-Vote.create!(winner_id: 1, loser_id: 2)
+(0..100).each do |num|
+ Vote.create!(winner_id: rand(0..1000), loser_id: rand(0..1000))
+end
| Add votes to seed file for travis purposes
|
diff --git a/db/seeds.rb b/db/seeds.rb
index abc1234..def5678 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -1,7 +1,25 @@-# This file should contain all the record creation needed to seed the database with its default values.
-# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
-#
-# Examples:
-#
-# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
-# Mayor.create(name: 'Emanuel', city: cities.first)
+msg = Venue.create!(
+ :name => "Madison Square Garden",
+ :sgID => 1,
+ :location => "New York City",
+ :left_aisle => "a",
+ :right_aisle => "k",
+ :closest_to_exit => "",
+ :first_floor => "",
+ :quiet => "",
+ :wheelchair => true,
+ :listening_device => true
+),
+
+radioCity = Venue.create!(
+ :name => "Radio City Music Hall",
+ :sgID => 2,
+ :location => "New York City",
+ :left_aisle => {"floor" => 1, "100s" => 1, "200s" => 1},
+ :right_aisle => {"floor" => 22, "100s" => 20, "200s" => 22},
+ :closest_to_exit => {"floor" => 5, "100s" => 1, "200s" => 1},
+ :first_floor => "0..10",
+ :quiet => "112",
+ :wheelchair => true,
+ :listening_device => true
+ ) | Add seed file with partial information for msg and radio city.
|
diff --git a/telemetry-logger.gemspec b/telemetry-logger.gemspec
index abc1234..def5678 100644
--- a/telemetry-logger.gemspec
+++ b/telemetry-logger.gemspec
@@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = 'telemetry-logger'
- s.version = '0.1.8'
+ s.version = '0.1.9'
s.summary = 'Logging to STDERR with coloring and levels of severity'
s.description = ' '
| Package version increased from 0.1.8 to 0.1.9
|
diff --git a/test/hjstemplate_test.rb b/test/hjstemplate_test.rb
index abc1234..def5678 100644
--- a/test/hjstemplate_test.rb
+++ b/test/hjstemplate_test.rb
@@ -7,6 +7,7 @@ assert_response :success
assert_select 'head script[src^="/assets/templates/test"]', true, @response.body
end
+
end
class HjsTemplateTest < IntegrationTest
@@ -24,7 +25,7 @@ end
test "should unbind mustache templates" do
- get "/assets/templates/hairy.mustache"
+ get "/assets/templates/hairy.js"
assert_response :success
assert_match /Ember\.TEMPLATES\["hairy(\.mustache)?"\] = Ember\.(?:Handlebars|HTMLBars)\.template\(/m, @response.body
assert_match /function .*unbound|"name":"unbound"/m, @response.body
| Fix to update path to template
|
diff --git a/services/QuillComprehension/app/graphql/types/response_type.rb b/services/QuillComprehension/app/graphql/types/response_type.rb
index abc1234..def5678 100644
--- a/services/QuillComprehension/app/graphql/types/response_type.rb
+++ b/services/QuillComprehension/app/graphql/types/response_type.rb
@@ -6,8 +6,13 @@ field :text, String, null: false
field :metrics, Types::MetricsType, null: false
+ field :latest_metrics, Types::MetricsType, null: false
def metrics
object.all_metrics
end
+
+ def latest_metrics
+ object.latest_metrics
+ end
end | Add Graphql endpoint for LatestMetrics
|
diff --git a/svgeez.gemspec b/svgeez.gemspec
index abc1234..def5678 100644
--- a/svgeez.gemspec
+++ b/svgeez.gemspec
@@ -19,7 +19,7 @@ spec.require_paths = ['lib']
spec.add_runtime_dependency 'listen', '~> 3.0'
- spec.add_runtime_dependency 'mercenary'
+ spec.add_runtime_dependency 'mercenary', '~> 0.3'
spec.add_development_dependency 'bundler', '~> 1.10'
spec.add_development_dependency 'rake', '~> 10.0'
| Update gemspec with versioned Mercenary.
|
diff --git a/test/helper.rb b/test/helper.rb
index abc1234..def5678 100644
--- a/test/helper.rb
+++ b/test/helper.rb
@@ -1,5 +1,3 @@-$:<< File.expand_path('../../lib', __FILE__)
-
require 'minitest/autorun'
require 'minitest/emoji'
require 'pry'
| Remove redundant addition to $LOAD_PATH
|
diff --git a/spec/features/linking_spec.rb b/spec/features/linking_spec.rb
index abc1234..def5678 100644
--- a/spec/features/linking_spec.rb
+++ b/spec/features/linking_spec.rb
@@ -26,4 +26,15 @@ page.ui.class
}.from(BarPage).to(FooPage)
end
+
+ scenario "UI is reloaded independently per session" do
+ using_session :other do
+ visit "foo.html"
+ page.ui.click_bar
+
+ expect(page.ui.class).to eq(BarPage)
+ end
+
+ expect(page.ui.class).to eq(FooPage)
+ end
end
| Add a preliminary test for multiple session support
This passes for Rack::Test but may fail for Poltergeist.
|
diff --git a/spec/functions/concat_spec.rb b/spec/functions/concat_spec.rb
index abc1234..def5678 100644
--- a/spec/functions/concat_spec.rb
+++ b/spec/functions/concat_spec.rb
@@ -27,4 +27,9 @@ expect(result).to(eq(['1','2','3',['4','5'],'6']))
end
+ it "should leave the original array intact" do
+ array_original = ['1','2','3']
+ result = scope.function_concat([array_original,['4','5','6']])
+ array_original.should(eq(['1','2','3']))
+ end
end
| Introduce test for array destruction
It was discovered that the concat array modifies the arrays passed to it
as an argument as a side effect. This test will ensure that doesn't
happen again.
|
diff --git a/spec/models/responses_spec.rb b/spec/models/responses_spec.rb
index abc1234..def5678 100644
--- a/spec/models/responses_spec.rb
+++ b/spec/models/responses_spec.rb
@@ -2,4 +2,13 @@ describe Response do
let!(:response) { Response.new(body: "comments comments") }
it { should respond_to :body }
+
+ context "validations" do
+ it { should validate_presence_of :body }
+ end
+
+ context "associations" do
+ it { should belong_to :user }
+ it { should belong_to :rant }
+ end
end
| Add 3 more model exmaples for Response
|
diff --git a/spec/views/tags_views_spec.rb b/spec/views/tags_views_spec.rb
index abc1234..def5678 100644
--- a/spec/views/tags_views_spec.rb
+++ b/spec/views/tags_views_spec.rb
@@ -1,7 +1,7 @@ require 'spec_helper'
describe "TagViews" do
- before do
+ before(:each) do
@tag1 = create(:tag, name: "tag1")
@tag2 = create(:tag, name: "tag2")
@tag3 = create(:tag, name: "tag3")
| Remove ambiguity in 'before' block
Remove ambiguity by specifying that the 'before' block is being
executed before each 'describe' block below it.
|
diff --git a/app/controllers/coursewareable/api/v1/classrooms_controller.rb b/app/controllers/coursewareable/api/v1/classrooms_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/coursewareable/api/v1/classrooms_controller.rb
+++ b/app/controllers/coursewareable/api/v1/classrooms_controller.rb
@@ -2,33 +2,31 @@ # [Coursewareable::Classroom] API controller
class ClassroomsController < ApplicationController
+ # Lists available classrooms
def index
classrooms = current_resource_owner.classrooms
render :json => classrooms
end
+ # Lists classroom details
def show
- classroom = Coursewareable::Classroom.find(params[:id])
+ classroom = current_resource_owner.classrooms.find(params[:id])
render :json => classroom
end
- # Render the collaborators of a specified classroom
- # This method is the same as #show, but this render just collaborations
+ # Render the classrooms collaborators
def collaborators
- # @collaborators includes owner and collaborations
- classroom = Coursewareable::Classroom.find(params[:classroom_id])
- classroom[:include_collaborations] = true
- render :json => classroom
+ classroom = current_resource_owner.classrooms.find(params[:classroom_id])
+ render :json => classroom.collaborators, :root => :collaborators
end
# Render the timeline of classroom
def timeline
- classroom = Coursewareable::Classroom.find(params[:classroom_id])
+ classroom = current_resource_owner.classrooms.find(params[:classroom_id])
+ timeline = classroom.all_activities.limit(
+ params[:limit]).offset(params[:offset])
- # Paginate the timeline
- timeline = classroom.all_activities.limit(params[:limit]).offset(params[:offset])
-
- render :json => timeline
+ render :json => timeline, :root => :activities
end
end
end
| Send requests to resource owner instead of querying everyhing globally. |
diff --git a/spec/controllers/neighborly/balanced/bankaccount/payments_controller_spec.rb b/spec/controllers/neighborly/balanced/bankaccount/payments_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/neighborly/balanced/bankaccount/payments_controller_spec.rb
+++ b/spec/controllers/neighborly/balanced/bankaccount/payments_controller_spec.rb
@@ -1,5 +1,17 @@ require 'spec_helper'
describe Neighborly::Balanced::Bankaccount::PaymentsController do
+ routes { Neighborly::Balanced::Bankaccount::Engine.routes }
+ describe "GET 'new'" do
+ let(:current_user) { double('User').as_null_object }
+ before do
+ controller.stub(:current_user).and_return(current_user)
+ end
+
+ it 'request should be successfuly' do
+ get :new, contribution_id: 42
+ expect(response.status).to eq 200
+ end
+ end
end
| Add a basic spec for payments controller
|
diff --git a/spec/event_spec.rb b/spec/event_spec.rb
index abc1234..def5678 100644
--- a/spec/event_spec.rb
+++ b/spec/event_spec.rb
@@ -0,0 +1,23 @@+require_relative 'helper_spec'
+
+describe Analytics do
+
+ before :each do
+ Analytics.configure "UA-XYZABCZA-1", "AnalyticsTest"
+ end
+
+ it 'should be able to log events with just a category and action' do
+ result = Analytics.event! "Category", "Action"
+ result.is_a?(Thread).should be_true
+ end
+
+ it 'should be able to accept optional parameters' do
+ result = Analytics.event! "Category", "Action", :label => "myLabel", :value => 1
+ result.is_a?(Thread).should be_true
+ end
+
+ it 'should ignore unknown parameters' do
+ result = Analytics.event! "Category", "Action", :mySpecialVar => "myspecialvar"
+ result.is_a?(Thread).should be_true
+ end
+end
| Add prelim event logging spec
|
diff --git a/config/deploy.rb b/config/deploy.rb
index abc1234..def5678 100644
--- a/config/deploy.rb
+++ b/config/deploy.rb
@@ -34,3 +34,5 @@
# Default value for keep_releases is 5
set :keep_releases, 3
+
+set :rvm_ruby_version, '2.3.3@trinity'
| Set rvm gemset in Capfile
|
diff --git a/core/app/mailers/user_mailer.rb b/core/app/mailers/user_mailer.rb
index abc1234..def5678 100644
--- a/core/app/mailers/user_mailer.rb
+++ b/core/app/mailers/user_mailer.rb
@@ -1,4 +1,6 @@ class UserMailer < ActionMailer::Base
+ include Resque::Mailer
+
default from: "no-reply@factlink.com"
def welcome_instructions(user)
| Include Rescue::Mailer in the UserMailer
Signed-off-by: tomdev <96835dd8bfa718bd6447ccc87af89ae1675daeca@codigy.nl>
|
diff --git a/adn-cli.gemspec b/adn-cli.gemspec
index abc1234..def5678 100644
--- a/adn-cli.gemspec
+++ b/adn-cli.gemspec
@@ -1,17 +1,17 @@ # -*- encoding: utf-8 -*-
-require File.expand_path('../lib/adn/version', __FILE__)
+require File.expand_path('../lib/adn/cli/version', __FILE__)
Gem::Specification.new do |gem|
- gem.authors = ["Justin Balthrop"]
- gem.email = ["git@justinbalthrop.com"]
+ gem.authors = ["Justin Balthrop", "Peter Hellberg"]
+ gem.email = ["git@justinbalthrop.com", "peter@c7.se"]
gem.description = %q{App.net command line}
gem.summary = %q{Command line client for App.net}
- gem.homepage = "http://github.com/ninjudd/adn"
+ gem.homepage = "https://github.com/adn-rb/adn-cli"
gem.files = `git ls-files`.split($\)
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
- gem.name = "adn"
+ gem.name = "adn-cli"
gem.require_paths = ["lib"]
- gem.version = Adn::VERSION
+ gem.version = ADN::CLI::VERSION
end
| Use ADN::CLI::VERSION as the version number, added myself to the list of authors, changed the homepage. |
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -6,7 +6,7 @@ devise_scope :user do
get "/users/sign_out" => "devise/sessions#destroy"
resource :setup do
- resources :seeds, only: [:index] if Rails.env.development? || Rails.env.testing?
+ resources :seeds, only: [:index] if Rails.env.development? || Rails.env.dev?
resources :projects, only: [:create] do
resource :main_entity_group, only: [:create, :update]
resources :packages, only: [:new, :create] do
| Allow seeds controller on dev (not testing)
|
diff --git a/congress.gemspec b/congress.gemspec
index abc1234..def5678 100644
--- a/congress.gemspec
+++ b/congress.gemspec
@@ -4,7 +4,7 @@ Gem::Specification.new do |gem|
gem.add_dependency 'faraday', '~> 0.7'
gem.add_dependency 'faraday_middleware', '~> 0.7'
- gem.add_dependency 'hashie', '~> 1.1'
+ gem.add_dependency 'hashie', '~> 2.0'
gem.add_dependency 'multi_json', '~> 1.0'
gem.add_dependency 'rash', '~> 0.3'
gem.add_development_dependency 'bundler', '~> 1.0'
| Update hashie dependency to version ~> 2.0
|
diff --git a/antwrap.gemspec b/antwrap.gemspec
index abc1234..def5678 100644
--- a/antwrap.gemspec
+++ b/antwrap.gemspec
@@ -8,13 +8,13 @@
SPEC = Gem::Specification.new do |s|
s.name = 'Antwrap'
- s.version = '0.2'
+ s.version = '0.3'
s.author = 'Caleb Powell'
s.email = 'caleb.powell@gmail.com'
s.homepage = 'http://rubyforge.org/projects/antwrap/'
s.platform = Gem::Platform::RUBY
- s.summary = "A JRuby module that wraps the Apache Ant build tool"
- candidates = Dir.glob("{lib,test}/**/*")
+ s.summary = "A JRuby module that wraps the Apache Ant build tool, enabling Ant Tasks to be invoked from a JRuby script."
+ candidates = Dir.glob("{lib,test,docs}/**/*")
s.files = candidates.delete_if do |item|
item.include?(".svn")
end
| Update the gemspec. Version number is now at 0.3.
|
diff --git a/db/migrate/20170126160535_add_originally_published_at_to_nppf_manual.rb b/db/migrate/20170126160535_add_originally_published_at_to_nppf_manual.rb
index abc1234..def5678 100644
--- a/db/migrate/20170126160535_add_originally_published_at_to_nppf_manual.rb
+++ b/db/migrate/20170126160535_add_originally_published_at_to_nppf_manual.rb
@@ -0,0 +1,36 @@+# The history
+# -----------
+#
+# In the previous migration we change the manual with slug
+# guidance/national-planning-policy-framework to have a public timestamp of
+# 23 March 2012. We didn't persist this information in our DB because there
+# was no functionality for that. Now that there is, we update the DB to pretend
+# the migration update was done via the UI.
+class AddOriginallyPublishedAtToNppfManual < Mongoid::Migration
+ def self.up
+ original_publication_timestamp = Date.new(2012, 3, 27).to_time
+ manual = ManualRecord.find_by(slug: "guidance/national-planning-policy-framework")
+ latest, *others = manual.editions.sort_by(&:version_number).reverse
+ others.each do |edition|
+ edition.originally_published_at = original_publication_timestamp
+ edition.use_originally_published_at_for_public_timestamp = true
+ edition.save
+ end
+ latest.originally_published_at = original_publication_timestamp
+ # ideally we'd set this to false because we don't want future
+ # updates to keep the public_updated_at timestamp set to 2012, but
+ # if this is published and we set it to false then republishing this
+ # edition wouldn't set it correctly which is bad. If it's a draft
+ # however then we'd rather it did the least surprising thing for users
+ # which is to not use the originally published at timestamp for the
+ # next major edition
+ latest.use_originally_published_at_for_public_timestamp = (latest.state == "published")
+ latest.save
+ end
+
+ def self.down
+ # It's possible to reverse this, but it's meaningless to do so as it leaves
+ # the data broken, so we're making this irreversible too
+ raise IrreversibleMigration
+ end
+end
| Add migration to add original publication date to a manual
This is the national planning policy framework manual that we had to set
the first_published_at and public_updated_at timestamps of in #788. We
set the originally_published_at and use_originally_published_at_for_public_timestamp
values that we would have used in #788 had they been present. One
minor issue is that we have to set the toggle to true on the latest
edition in order to make sure that a republish would do the right thing,
this does mean however that any future edition would inherit that value and
persist the older date.
|
diff --git a/db/migrate/20200312152659_add_root_account_id_to_rubric_associations.rb b/db/migrate/20200312152659_add_root_account_id_to_rubric_associations.rb
index abc1234..def5678 100644
--- a/db/migrate/20200312152659_add_root_account_id_to_rubric_associations.rb
+++ b/db/migrate/20200312152659_add_root_account_id_to_rubric_associations.rb
@@ -0,0 +1,32 @@+#
+# Copyright (C) 2020 - present Instructure, Inc.
+#
+# This file is part of Canvas.
+#
+# Canvas is free software: you can redistribute it and/or modify
+# the terms of the GNU Affero General Public License as publishe
+# Software Foundation, version 3 of the License.
+#
+# Canvas is distributed in the hope that it will be useful, but
+# WARRANTY; without even the implied warranty of MERCHANTABILITY
+# A PARTICULAR PURPOSE. See the GNU Affero General Public Licens
+# details.
+#
+# You should have received a copy of the GNU Affero General Publ
+# with this program. If not, see <http://www.gnu.org/licenses/>.
+
+class AddRootAccountIdToRubricAssociations < ActiveRecord::Migration[5.2]
+ include MigrationHelpers::AddColumnAndFk
+
+ tag :predeploy
+ disable_ddl_transaction!
+
+ def up
+ add_column_and_fk :rubric_associations, :root_account_id, :accounts
+ add_index :rubric_associations, :root_account_id, algorithm: :concurrently
+ end
+
+ def down
+ remove_column :rubric_associations, :root_account_id
+ end
+end
| Add root account to rubric associations
Closes PLAT-5575
flag=none
Test Plan:
- Verify migrations run
- Verify a root_account_id can be set on a RubricAssociation record
Change-Id: I5dfe80ccd1cd3f0a2cc42f9411d860ef5f77034a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/229765
Tested-by: Service Cloud Jenkins <9144042a601061f88f1e1d7a1753ea3e2972119d@instructure.com>
QA-Review: Weston Dransfield <e9203059795dc94e28a8831c65eb7869e818825e@instructure.com>
Product-Review: Weston Dransfield <e9203059795dc94e28a8831c65eb7869e818825e@instructure.com>
Reviewed-by: Clint Furse <b31c824c483447b2438702c2da6f729b3ebb9b50@instructure.com>
Reviewed-by: Cody Cutrer <c4fe2b1d90ef8f2548c8aeabfa633434316f0305@instructure.com>
|
diff --git a/lib/ar_transaction_changes.rb b/lib/ar_transaction_changes.rb
index abc1234..def5678 100644
--- a/lib/ar_transaction_changes.rb
+++ b/lib/ar_transaction_changes.rb
@@ -26,7 +26,7 @@ @transaction_changed_attributes = nil
end
else
- def run_callbacks(kind)
+ def run_callbacks(kind, *args)
ret = super
case kind.to_sym
when :create, :update
| Allow additional arguments to run_callbacks for rails 3.2
ActiveSupport::Callbacks#run_callbacks is defined as
def run_callbacks(kind, *args, &block)
in rails 3.2, then the `*args` argument was removed in rails 4.0, so
ar_transaction_changes should allow these additional arguments to be passed
in.
|
diff --git a/lib/bundler/build_metadata.rb b/lib/bundler/build_metadata.rb
index abc1234..def5678 100644
--- a/lib/bundler/build_metadata.rb
+++ b/lib/bundler/build_metadata.rb
@@ -28,7 +28,9 @@ # If Bundler has been installed without its .git directory and without a
# commit instance variable then we can't determine its commits SHA.
git_dir = File.join(File.expand_path("../../..", __FILE__), ".git")
- return "unknown" unless File.directory?(git_dir)
+ # Check for both a file or folder because RubyGems runs Bundler's test suite in a submodule
+ # which does not have a .git folder
+ return "unknown" unless File.exist?(git_dir)
# Otherwise shell out to git.
@git_commit_sha = Dir.chdir(File.expand_path("..", __FILE__)) do
| Check for file or folder when checking for git hash in build metadata
|
diff --git a/lib/digitec_watcher/mailer.rb b/lib/digitec_watcher/mailer.rb
index abc1234..def5678 100644
--- a/lib/digitec_watcher/mailer.rb
+++ b/lib/digitec_watcher/mailer.rb
@@ -14,7 +14,7 @@ @last_delivery = notification.last_delivery
article = notification.article_title
mail(:to => notification.recipients,
- :from => "Digitec Watcher <noreply@nibor.org>",
+ :from => "Digitec Watcher <digitec_watcher@example.org>",
:subject => "#{article}") do |format|
format.text
end
| Change "From" of notification mails
Maybe it would be a good idea to make it configurable, but "meh" for
now.
|
diff --git a/lib/foodcritic/rules/fc042.rb b/lib/foodcritic/rules/fc042.rb
index abc1234..def5678 100644
--- a/lib/foodcritic/rules/fc042.rb
+++ b/lib/foodcritic/rules/fc042.rb
@@ -1,5 +1,5 @@ rule "FC042", "Prefer include_recipe to require_recipe" do
- tags %w{correctness deprecated}
+ tags %w{correctness deprecated chef15}
recipe do |ast|
field(ast, "require_recipe")
end
| Add chef15 tag to FC042
We've removed this old method from Chef 15.
Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
|
diff --git a/generators/acts_as_licensed_migration/templates/migration.rb b/generators/acts_as_licensed_migration/templates/migration.rb
index abc1234..def5678 100644
--- a/generators/acts_as_licensed_migration/templates/migration.rb
+++ b/generators/acts_as_licensed_migration/templates/migration.rb
@@ -7,7 +7,7 @@ t.boolean :is_available
t.string :image_url
t.boolean :is_creative_commons
- t.text :metadata
+ t.text :metadata, :null => true
t.timestamps
end
| Refinement: Allow null values in metadata column
|
diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/home_controller.rb
+++ b/app/controllers/home_controller.rb
@@ -15,13 +15,13 @@ end
def app_status
- status = begin
- Rails::Sequel.connection.select('OK').first.values.include?('OK') ? 200 : 500
- rescue Exception => e
- 500
- end
-
- head status
+ db_ok = Rails::Sequel.connection.select('OK').first.values.include?('OK')
+ redis_ok = $tables_metadata.dbsize
+ api_ok = true
+ head (db_ok && redis_ok && api_ok) ? 200 : 500
+ rescue
+ Rails.logger.info "======== status method failed: #{$!}"
+ head 500
end
end
| Monitor redis in status url
|
diff --git a/lib/rp_capistrano/newrelic.rb b/lib/rp_capistrano/newrelic.rb
index abc1234..def5678 100644
--- a/lib/rp_capistrano/newrelic.rb
+++ b/lib/rp_capistrano/newrelic.rb
@@ -5,31 +5,12 @@ def self.load_into(configuration)
configuration.load do
after 'deploy:update', 'rp:newrelic:enable_monitoring'
- after 'rp:newrelic:enable_monitoring', 'rp:newrelic:deploy'
- after 'rp:newrelic:deploy', 'newrelic:notice_deployment'
+ after 'rp:newrelic:enable_monitoring', 'newrelic:notice_deployment'
namespace :rp do
namespace :newrelic do
task :enable_monitoring, :roles => :web do
run "cp #{release_path}/config/newrelic.enable.yml #{release_path}/config/newrelic.yml"
- end
-
- desc "Sets newrelic deployment parameters"
- task :deploy, :except => { :no_release => true } do
-
- set :fresh_revision, fetch(:previous_revision, 'HEAD^3')
- set :newrelic_revision, fetch(:note, fetch(:fresh_revision, 'HEAD'))
- set :newrelic_appname, fetch(:app_name)
- set :newrelic_desc, `uname -a`
-
- run "cd #{fetch(:release_path)} && git log --no-color --pretty=format:' * %an: %s' --abbrev-commit --no-merges #{fetch(:fresh_revision, 'HEAD^3')}..HEAD", :roles => :app, :only => { :primary => true } do |ch, stream, data|
- set :newrelic_changelog, data
- end
-
- puts " ** CHANGES ======================================================"
- puts fetch(:newrelic_changelog, " ! Unable to get changes")
- puts " ** =============================================================="
- puts "\n"
end
end
end
| Remove custom new relic deploy task
|
diff --git a/core/lib/generators/refinery/engine/templates/config/routes.rb b/core/lib/generators/refinery/engine/templates/config/routes.rb
index abc1234..def5678 100644
--- a/core/lib/generators/refinery/engine/templates/config/routes.rb
+++ b/core/lib/generators/refinery/engine/templates/config/routes.rb
@@ -5,15 +5,15 @@ resources :<%= class_name.pluralize.underscore.downcase %>, :only => [:index, :show]
end
<% end %>
-
# Admin routes
namespace :<%= namespacing.underscore %>, :path => '' do
- namespace :admin, :path => 'refinery/<%= namespacing.underscore %>' do
- resources :<%= class_name.pluralize.underscore.downcase %><%= ", :path => ''" if namespacing.underscore.pluralize == class_name.pluralize.underscore.downcase %>, :except => :show do
+ namespace :admin, :path => 'refinery<%= "/#{namespacing.underscore}" if namespacing.underscore != plural_name %>' do
+ resources :<%= class_name.pluralize.underscore.downcase %>, :except => :show do
collection do
post :update_positions
end
end
end
end
+
end
| Insert the namespace into the admin path if it's different to the plural_name.
|
diff --git a/lib/travis/shell/generator.rb b/lib/travis/shell/generator.rb
index abc1234..def5678 100644
--- a/lib/travis/shell/generator.rb
+++ b/lib/travis/shell/generator.rb
@@ -12,7 +12,7 @@
def generate(ignore_taint = false)
lines = Array(handle(nodes)).flatten
- script = lines.join("\n").strip
+ script = lines.each { |l| puts l if l.tainted? }.join("\n").strip
raise TaintedOutput if !ignore_taint && script.tainted?
script = unindent(script)
script = normalize_newlines(script)
| Print line if it is tainted
|
diff --git a/lib/web_bouncer/middleware.rb b/lib/web_bouncer/middleware.rb
index abc1234..def5678 100644
--- a/lib/web_bouncer/middleware.rb
+++ b/lib/web_bouncer/middleware.rb
@@ -20,7 +20,7 @@ r.is 'auth/logout' do
Matcher.call(OauthContainer['oauth.logout'].call) do |m|
m.success do |value|
- env[:account] = value
+ session[:account] = value
end
m.failure do |v|
@@ -35,7 +35,7 @@
Matcher.call(action.call) do |m|
m.success do |value|
- env[:account] = value
+ session[:account] = value
end
m.failure do |v|
| Use session instead env variable
|
diff --git a/app/mailers/course/mailer.rb b/app/mailers/course/mailer.rb
index abc1234..def5678 100644
--- a/app/mailers/course/mailer.rb
+++ b/app/mailers/course/mailer.rb
@@ -31,7 +31,7 @@ def user_registered_email(course, course_user)
@course = course
@course_user = course_user
- @recipient = Struct.new(:name).new(name: t('course.mailer.user_registered_email.recipients'))
+ @recipient = OpenStruct.new(name: t('course.mailer.user_registered_email.recipients'))
mail(to: @course.managers.map(&:user).map(&:email),
subject: t('.subject', course: @course.title))
| Fix wrong recipient name in greetings
|
diff --git a/features/support/hooks.rb b/features/support/hooks.rb
index abc1234..def5678 100644
--- a/features/support/hooks.rb
+++ b/features/support/hooks.rb
@@ -1,7 +1,10 @@+
+# Before each scenario...
Before do
- CouchRestRails::Tests.setup
+# CouchRestRails::Tests.setup
end
+# After each scenario...
After do
- CouchRestRails::Tests.teardown
+# CouchRestRails::Tests.teardown
end | Disable database refresh between each scenario |
diff --git a/app/models/manual_with_sections.rb b/app/models/manual_with_sections.rb
index abc1234..def5678 100644
--- a/app/models/manual_with_sections.rb
+++ b/app/models/manual_with_sections.rb
@@ -1,6 +1,4 @@-require "delegate"
-
-class ManualWithSections < SimpleDelegator
+class ManualWithSections
attr_writer :sections, :removed_sections
def initialize(manual, sections: [], removed_sections: [])
@@ -8,7 +6,6 @@ @sections = sections
@removed_sections = removed_sections
@section_builder = SectionBuilder.new
- super(manual)
end
def sections
@@ -21,7 +18,7 @@
def build_section(attributes)
section = section_builder.call(
- self,
+ manual,
attributes
)
| Use explicit delegation from ManualWithSections to Manual
Instead of the implicit delegation provided by `SimpleDelegator`.
|
diff --git a/delayed_job_data_mapper.gemspec b/delayed_job_data_mapper.gemspec
index abc1234..def5678 100644
--- a/delayed_job_data_mapper.gemspec
+++ b/delayed_job_data_mapper.gemspec
@@ -19,6 +19,7 @@ s.add_runtime_dependency 'dm-aggregates'
s.add_runtime_dependency 'delayed_job', '3.0.0.pre2'
s.add_runtime_dependency 'i18n'
+ s.add_runtime_dependency 'tzinfo'
s.add_development_dependency 'rake'
s.add_development_dependency 'rspec'
s.add_development_dependency 'dm-migrations'
| Declare TZInfo as a runtime dependency. |
diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/pages_controller.rb
+++ b/app/controllers/pages_controller.rb
@@ -7,7 +7,7 @@ tpl = (params[:layout] || 'hero').to_sym
tpl = :hero unless [:email, :hero, :simple].include? tpl
file = 'user_mailer/welcome_email'
- @user = User.first || User.new
+ @user = User.new FactoryGirl.attributes_for(:user)
render file, layout: "emails/#{tpl}"
if params[:premail] == 'true'
puts "\n!!! USING PREMAILER !!!\n\n"
| Use a mock user object in email preview
Security issue. |
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -1,7 +1,11 @@ class UsersController < ApplicationController
def show
- @user = User.find(params[:id])
+ if(params[:id] == "me")
+ @user = current_user
+ else
+ @user = User.find(params[:id])
+ end
maybe_redirect(@user.check_permissions(current_user))
@user.save_as_view(session)
@lists = @user.lists
| Add static link to the "me" user.
|
diff --git a/cruise_config.rb b/cruise_config.rb
index abc1234..def5678 100644
--- a/cruise_config.rb
+++ b/cruise_config.rb
@@ -1,4 +1,4 @@ Project.configure do |project|
- project.email_notifier.emails = ['scott@butlerpress.com']
+ project.email_notifier.emails = ['scott@butlerpress.com', "wsbaracing@gmail.com"]
project.build_command = "./script/cruise_build.rb #{project.name}"
end
| Add WSBA admin email to cc.rb CI notifications
|
diff --git a/app/models/mixins/archived_mixin.rb b/app/models/mixins/archived_mixin.rb
index abc1234..def5678 100644
--- a/app/models/mixins/archived_mixin.rb
+++ b/app/models/mixins/archived_mixin.rb
@@ -2,18 +2,18 @@ extend ActiveSupport::Concern
included do
- scope :archived, -> { where.not(:deleted_on => nil) }
- scope :active, -> { where(:deleted_on => nil) }
+ scope :archived, -> { where(:deleted => true) }
+ scope :active, -> { where(:deleted => false) }
belongs_to :old_ext_management_system, :foreign_key => :old_ems_id, :class_name => 'ExtManagementSystem'
end
def archived?
- !active?
+ deleted?
end
def active?
- deleted_on.nil?
+ !deleted?
end
# Needed for metrics
| Use deleted boolean for active/archived scopes
Use deleted boolean for active/archived scopes, since using
boolean with a partial index is much faster.
|
diff --git a/app/controllers/dataset_files_controller.rb b/app/controllers/dataset_files_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/dataset_files_controller.rb
+++ b/app/controllers/dataset_files_controller.rb
@@ -13,6 +13,7 @@ dataset_file_id = params[:dataset_file_id]
@dataset_file = DatasetFile.find(dataset_file_id)
@s3_file = FileStorageService.get_temporary_download_url(@dataset_file.storage_key)
+ render_403_permissions unless current_user == @dataset.user || admin_user
end
def download
| Add restriction for non owner of dataset collection - 403
|
diff --git a/metadata.rb b/metadata.rb
index abc1234..def5678 100644
--- a/metadata.rb
+++ b/metadata.rb
@@ -10,6 +10,7 @@ supports 'centos'
supports 'debian'
supports 'fedora'
+supports 'freebsd'
supports 'mac_os_x', '>= 10.6.0'
supports 'mac_os_x_server', '>= 10.6.0'
supports 'oracle'
| Add `freebsd` to supports list |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.