diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/test/test_monitoring.rb b/test/test_monitoring.rb
index abc1234..def5678 100644
--- a/test/test_monitoring.rb
+++ b/test/test_monitoring.rb
@@ -3,7 +3,7 @@ require File.join(File.dirname(__FILE__), 'helper')
class TestMonitor
- attr_reader :listening, :closed
+ attr_reader :listening, :closed, :accepted
def on_listening(addr, fd)
@listening = true
@@ -11,6 +11,10 @@
def on_closed(addr, fd)
@closed = true
+ end
+
+ def on_accepted(addr, fd)
+ @accepted = true
end
end
|
Update TestMonitor in case a port receives a connection during test
|
diff --git a/nil_conditional.gemspec b/nil_conditional.gemspec
index abc1234..def5678 100644
--- a/nil_conditional.gemspec
+++ b/nil_conditional.gemspec
@@ -4,11 +4,11 @@
Gem::Specification.new do |spec|
spec.name = 'nil_conditional'
- spec.version = '2.0.0'
+ spec.version = '2.0.1'
spec.authors = ['Grzegorz Bizon']
spec.email = ['grzegorz.bizon@ntsn.pl']
spec.summary = 'Nil Conditional Operator in Ruby'
- spec.homepage = 'http://github.com/grzesiek/nil-conditional'
+ spec.homepage = 'http://github.com/grzesiek/nil_conditional'
spec.license = 'MIT'
spec.files = `git ls-files -z`.split("\x0")
|
Change homepage URL for better compatibility with rubygems
|
diff --git a/lib/elasticsearch-node.rb b/lib/elasticsearch-node.rb
index abc1234..def5678 100644
--- a/lib/elasticsearch-node.rb
+++ b/lib/elasticsearch-node.rb
@@ -34,7 +34,7 @@ end
def self.version
- @version || ENV["ES_VERSION"] || "0.19.7"
+ @version || ENV["ES_VERSION"] || "0.20.1"
end
def self.windows?
|
Use 0.20.1 as new default ES_VERSION
|
diff --git a/lib/kosmos/package_dsl.rb b/lib/kosmos/package_dsl.rb
index abc1234..def5678 100644
--- a/lib/kosmos/package_dsl.rb
+++ b/lib/kosmos/package_dsl.rb
@@ -6,5 +6,8 @@ FileUtils.cp_r(File.join(self.class.download_dir, from),
File.join(self.class.ksp_path, destination))
end
+ def remove_filepath(filepath)
+ FileUtils.rm_r(File.join(self.class.ksp_path, filepath))
+ end
end
end
|
Add support to remove file or path
|
diff --git a/server/cookbooks/app-recipes-backend/metadata.rb b/server/cookbooks/app-recipes-backend/metadata.rb
index abc1234..def5678 100644
--- a/server/cookbooks/app-recipes-backend/metadata.rb
+++ b/server/cookbooks/app-recipes-backend/metadata.rb
@@ -10,4 +10,5 @@ depends 'apache2'
depends 'apt'
depends 'database'
-depends 'nodejs'+depends 'nginx'
+depends 'nodejs'
|
Add nginx as a dependency to app-recipes-backend
|
diff --git a/app/interactors/convert_tts.rb b/app/interactors/convert_tts.rb
index abc1234..def5678 100644
--- a/app/interactors/convert_tts.rb
+++ b/app/interactors/convert_tts.rb
@@ -35,7 +35,7 @@ TimetableSlot.new(slot_hash) do |s|
s.id = slot.id
s.parallel_id = parallel_id
- s.room = @rooms[room_code]
+ s.room = @rooms[room_code] if room_code
s.deleted_at = nil
end
end
|
Fix import of TimetableSlots without room
|
diff --git a/spec/controllers/contributors_controller_spec.rb b/spec/controllers/contributors_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/contributors_controller_spec.rb
+++ b/spec/controllers/contributors_controller_spec.rb
@@ -7,8 +7,14 @@ let!(:user) { create(:user) }
let!(:coach) { create(:coach) }
let!(:organizer) { create(:organizer) }
-
+
it 'returns json representation of user with relevant roles' do
+ get :index, format: :json
+ expect(assigns(:contributors).sort).to eq [coach, organizer].sort
+ end
+
+ it 'includes teamless organizers' do
+ organizer.roles.each { |r| r.update! team: nil }
get :index, format: :json
expect(assigns(:contributors).sort).to eq [coach, organizer].sort
end
|
Add spec for unteamed organizers
|
diff --git a/spec/lib/services/api/options_serializer_spec.rb b/spec/lib/services/api/options_serializer_spec.rb
index abc1234..def5678 100644
--- a/spec/lib/services/api/options_serializer_spec.rb
+++ b/spec/lib/services/api/options_serializer_spec.rb
@@ -0,0 +1,15 @@+RSpec.describe Api::OptionsSerializer do
+ it "returns some default values when the class is nil" do
+ actual = described_class.serialize(nil, :settings)
+
+ expected = {
+ :attributes => [],
+ :virtual_attributes => [],
+ :relationships => [],
+ :subcollections => [],
+ :data => {}
+ }
+
+ expect(actual).to eq(expected)
+ end
+end
|
Add a smoke test for OptionsSerializer
|
diff --git a/spec/unit/vagrant-proxyconf/config/proxy_spec.rb b/spec/unit/vagrant-proxyconf/config/proxy_spec.rb
index abc1234..def5678 100644
--- a/spec/unit/vagrant-proxyconf/config/proxy_spec.rb
+++ b/spec/unit/vagrant-proxyconf/config/proxy_spec.rb
@@ -0,0 +1,57 @@+require 'spec_helper'
+require 'vagrant-proxyconf/config/proxy'
+
+describe VagrantPlugins::ProxyConf::Config::Proxy do
+ before :each do
+ # Ensure tests are not affected by environment variables
+ %w[HTTP_PROXY HTTPS_PROXY FTP_PROXY NO_PROXY].each do |var|
+ ENV.delete("VAGRANT_#{var}")
+ end
+ end
+
+ subject do
+ described_class.new.tap do |config|
+ config.http = http_proxy
+ config.https = https_proxy
+ end
+ end
+ let(:http_proxy) { nil }
+ let(:https_proxy) { nil }
+
+ context "defaults" do
+ its(:http_user) { should be_nil }
+ its(:http_pass) { should be_nil }
+ its(:https_user) { should be_nil }
+ its(:https_pass) { should be_nil }
+ end
+
+ context "without userinfo" do
+ let(:http_proxy) { 'http://proxy.example.com:8123/' }
+ let(:https_proxy) { '' }
+
+ its(:http_user) { should be_nil }
+ its(:http_pass) { should be_nil }
+ its(:https_user) { should be_nil }
+ its(:https_pass) { should be_nil }
+ end
+
+ context "with username" do
+ let(:http_proxy) { 'http://foo@proxy.example.com:8123/' }
+ let(:https_proxy) { 'http://bar@localhost' }
+
+ its(:http_user) { should eq 'foo' }
+ its(:http_pass) { should be_nil }
+ its(:https_user) { should eq 'bar' }
+ its(:https_pass) { should be_nil }
+ end
+
+ context "with userinfo" do
+ let(:http_proxy) { 'http://foo:bar@proxy.example.com:8123/' }
+ let(:https_proxy) { 'http://:baz@localhost' }
+
+ its(:http_user) { should eq 'foo' }
+ its(:http_pass) { should eq 'bar' }
+ its(:https_user) { should eq '' }
+ its(:https_pass) { should eq 'baz' }
+ end
+end
|
Add unit tests for Config::Proxy class
|
diff --git a/app/models/concerns/tagging.rb b/app/models/concerns/tagging.rb
index abc1234..def5678 100644
--- a/app/models/concerns/tagging.rb
+++ b/app/models/concerns/tagging.rb
@@ -11,6 +11,8 @@ taggables = Array.new
taggables << self.reaction if defined? self.reaction
taggables << self.sample if defined? self.sample
+ taggables << self.wellplate if defined? self.wellplate
+ taggables << self.screen if defined? self.screen
taggables.each do |taggable|
taggable.update_tag
|
Update tag for wellplate and screen
|
diff --git a/lib/carbonmu/edge_router/telnet_connection.rb b/lib/carbonmu/edge_router/telnet_connection.rb
index abc1234..def5678 100644
--- a/lib/carbonmu/edge_router/telnet_connection.rb
+++ b/lib/carbonmu/edge_router/telnet_connection.rb
@@ -18,6 +18,7 @@
def run
info "*** Received telnet connection #{id} from #{socket.addr[2]}"
+ @player = Player.first
write "Connected. Your ID is #{id}\n"
loop do
async.handle_input(read)
|
Set player to superadmin for now on new connections.
|
diff --git a/lib/tasks/import/hits_mappings_relations.rake b/lib/tasks/import/hits_mappings_relations.rake
index abc1234..def5678 100644
--- a/lib/tasks/import/hits_mappings_relations.rake
+++ b/lib/tasks/import/hits_mappings_relations.rake
@@ -2,7 +2,7 @@
namespace :import do
desc 'Refresh c14nd path relations between hits and mappings'
- task :hits_mappings => :environment do
+ task :hits_mappings_relations => :environment do
Transition::Import::HitsMappingsRelations.refresh!
end
end
|
Rename the rake task to match its class
|
diff --git a/lib/yard/generators/method_signature_generator.rb b/lib/yard/generators/method_signature_generator.rb
index abc1234..def5678 100644
--- a/lib/yard/generators/method_signature_generator.rb
+++ b/lib/yard/generators/method_signature_generator.rb
@@ -1,35 +1,18 @@ module YARD
module Generators
class MethodSignatureGenerator < Base
+ include Helpers::MethodHelper
+
+ before_generate :has_signature?
+
def sections_for(object)
- [:main] if object.signature
+ [:main]
end
protected
- def format_def(object)
- object.signature.gsub(/^def\s*(?:.+?(?:\.|::)\s*)?/, '')
- end
-
- def format_return_types(object)
- typenames = "Object"
- if object.has_tag?(:return)
- types = object.tags(:return).map do |t|
- t.types.map do |type|
- type.gsub(/(^|[<>])\s*([^<>#]+)\s*(?=[<>]|$)/) {|m| $1 + linkify($2) }
- end
- end.flatten
- typenames = types.size == 1 ? types.first : "[#{types.join(", ")}]"
- end
- typenames
- end
-
- def format_block(object)
- if object.has_tag?(:yieldparam)
- "{|" + object.tags(:yieldparam).map {|t| t.name }.join(", ") + "| ... }"
- else
- ""
- end
+ def has_signature?(object)
+ object.signature ? true : false
end
end
end
|
Move method formatting helpers into MethodHelper
|
diff --git a/config/initializers/01_configure_from_env.rb b/config/initializers/01_configure_from_env.rb
index abc1234..def5678 100644
--- a/config/initializers/01_configure_from_env.rb
+++ b/config/initializers/01_configure_from_env.rb
@@ -13,7 +13,9 @@ end
if ENV['QUERY_CONCURRENCY']
- Pancakes::Config.from_env :query_concurrency, ENV['QUERY_CONCURRENCY'] || 16
+ Pancakes::Config.from_env :query_concurrency, ENV['QUERY_CONCURRENCY'].to_i
+else
+ Pancakes::Config.from_env :query_concurrency, 16
end
if %w(CAS_BASE_URL CAS_PROXY_CALLBACK_URL CAS_PROXY_RETRIEVAL_URL).all? { |e| ENV[e] }
|
Correct massive brain fart re: concurrency level setup.
|
diff --git a/config/initializers/carrier_wave.rb b/config/initializers/carrier_wave.rb
index abc1234..def5678 100644
--- a/config/initializers/carrier_wave.rb
+++ b/config/initializers/carrier_wave.rb
@@ -5,7 +5,7 @@ aws_access_key_id: ENV['S3_ACCESS_KEY'],
aws_secret_access_key: ENV['S3_SECRET_KEY'],
region: 'Tokyo',
- endpoint: 'leehana.s3-website-ap-northeast-1.amazonaws.com'
+ endpoint: 'https://leehana.s3-website-ap-northeast-1.amazonaws.com'
}
config.fog_directory = ENV['S3_BUCKET']
|
Modify AWS s3 endpoint url
|
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/admin_controller.rb
+++ b/app/controllers/admin_controller.rb
@@ -5,6 +5,7 @@
def restart
@user = User.find(session[:user_id])
+ Dir.mkdir('tmp') unless File.exists?(Rails.root.join('tmp'))
restart_txt_path = Rails.root.join('tmp', 'restart.txt')
logger.info "Restart initiated by #{@user && @user.name} (#{@user && @user.id})."
logger.info "touch-ing ${restart_txt_path}"
|
Make tmp dir for restart.txt if it doesn't exist
|
diff --git a/app/controllers/delay_controller.rb b/app/controllers/delay_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/delay_controller.rb
+++ b/app/controllers/delay_controller.rb
@@ -1,18 +1,18 @@ require_relative 'base_controller'
-
+require 'byebug'
module Slowwly
class DelayController < BaseController
- get '/delay/:delay/*' do |delay, _rest|
- set_request_params(delay)
- log_request(request_params)
+ get '/delay/:delay/*' do |*args|
+ set_request_params
+ log_request
sleep request_params.delay_secs
redirect request_params.url
end
- post '/delay/:delay/*' do |delay, _rest|
- set_request_params(delay)
- log_request(request_params)
+ post '/delay/:delay/*' do |*args|
+ set_request_params
+ log_request
sleep request_params.delay_secs
redirect request_params.url, 307
@@ -22,14 +22,14 @@
attr_reader :request_params
- def set_request_params(delay)
+ def set_request_params
@request_params ||= DelayRequest.new(
- delay: delay,
+ delay: params[:delay],
url: params[:splat].first
)
end
- def log_request(request_params)
+ def log_request
logger.info "Handle #{request.request_method} request: #{request_params}"
end
end
|
Tidy up DeejayController; bit of duplication but we will erradicate later :o
|
diff --git a/http_content_type.gemspec b/http_content_type.gemspec
index abc1234..def5678 100644
--- a/http_content_type.gemspec
+++ b/http_content_type.gemspec
@@ -13,7 +13,7 @@ s.description = 'This gem allows you to check the Content-Type of any HTTP-accessible asset.'
s.homepage = 'http://rubygems.org/gems/http_content_type'
- s.files = Dir.glob('lib/**/*') + %w[CHANGELOG.md LICENSE README.md]
+ s.files = Dir.glob('lib/**/*') + %w[CHANGELOG.md LICENSE.md README.md]
s.test_files = Dir.glob('spec/**/*')
s.require_paths = ['lib']
|
Fix file name in gemspec
|
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
@@ -19,6 +19,6 @@ end
def letsencrypt
- render text: "G__wcFN5HBF3wdt4715kV_ZC8dlsipOuAcomh6DiLI.8irEjcOIniTce4WuxcUwZtD9I8faf7-2HkDE5UsG6UM"
+ render text: "CG__wcFN5HBF3wdt4715kV_ZC8dlsipOuAcomh6DiLI.8irEjcOIniTce4WuxcUwZtD9I8faf7-2HkDE5UsG6UM"
end
end
|
Fix typo in verification string
|
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
@@ -0,0 +1,20 @@+get '/' do
+ erb :'index'
+end
+
+get '/users/new/?' do
+ @user = User.new
+ erb :'users/new'
+end
+
+post '/users/?' do
+ @user = User.new(params[:user])
+
+ if @user.save
+ else
+ @user
+ errors = @user.errors.full_messages
+
+ erb :'users/new', locals: { errors: errors }
+ end
+end
|
Add home route, user routes
|
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,5 +1,6 @@ class UsersController < ApplicationController
respond_to :html
+ before_filter :hide_filters!, only: [:show]
def show
@user = User.find(params[:id])
|
Hide filters in another couple of places
|
diff --git a/app/services/application_service.rb b/app/services/application_service.rb
index abc1234..def5678 100644
--- a/app/services/application_service.rb
+++ b/app/services/application_service.rb
@@ -8,7 +8,7 @@ # the Rails application name
def application_name
default = Rails.application.class.name.split("::").first
- Rails.configuration.x.application.fetch(:name, default).downcase
+ Rails.configuration.x.application.fetch(:name, default)
end
end
|
Change application name so it's not always lowercase
|
diff --git a/manifests/cf-manifest/spec/manifest_validation_spec.rb b/manifests/cf-manifest/spec/manifest_validation_spec.rb
index abc1234..def5678 100644
--- a/manifests/cf-manifest/spec/manifest_validation_spec.rb
+++ b/manifests/cf-manifest/spec/manifest_validation_spec.rb
@@ -0,0 +1,80 @@+require 'yaml'
+
+RSpec.describe "generic manifest validations" do
+ before :all do
+ @manifest = YAML.load_file(File.expand_path("../../upstream-cf-manifest.yml", __FILE__))
+ end
+
+ describe "name uniqueness" do
+ %w(
+ disk_pools
+ jobs
+ networks
+ releases
+ resource_pools
+ ).each do |resource_type|
+ specify "all #{resource_type} have a unique name" do
+ all_resource_names = @manifest.fetch(resource_type, []).map {|r| r["name"]}
+
+ duplicated_names = all_resource_names.select {|n| all_resource_names.count(n) > 1 }.uniq
+ expect(duplicated_names).to be_empty,
+ "found duplicate names (#{duplicated_names.join(',')}) for #{resource_type}"
+ end
+ end
+ end
+
+ describe "jobs cross-references" do
+ specify "all jobs reference resource_pools that exist" do
+ resource_pool_names = @manifest["resource_pools"].map {|r| r["name"]}
+
+ @manifest["jobs"].each do |job|
+ expect(resource_pool_names).to include(job["resource_pool"]),
+ "resource_pool #{job["resource_pool"]} not found for job #{job["name"]}"
+ end
+ end
+
+ specify "all job templates reference releases that exist" do
+ release_names = @manifest["releases"].map {|r| r["name"]}
+
+ @manifest["jobs"].each do |job|
+ job["templates"].each do |template|
+ expect(release_names).to include(template["release"]),
+ "release #{template["release"]} not found for template #{template["name"]} in job #{job["name"]}"
+ end
+ end
+ end
+
+ specify "all jobs reference networks that exist" do
+ network_names = @manifest["networks"].map {|n| n["name"]}
+
+ @manifest["jobs"].each do |job|
+ job["networks"].each do |network|
+ expect(network_names).to include(network["name"]),
+ "network #{network["name"]} not found for job #{job["name"]}"
+ end
+ end
+ end
+
+ specify "all jobs reference disk_pools that exist" do
+ disk_pool_names = @manifest.fetch("disk_pools", {}).map {|p| p["name"]}
+
+ @manifest["jobs"].each do |job|
+ next unless job["persistent_disk_pool"]
+
+ expect(disk_pool_names).to include(job["persistent_disk_pool"]),
+ "disk_pool #{job["persistent_disk_pool"]} not found for job #{job["name"]}"
+ end
+ end
+ end
+
+ describe "resource_pools cross-references" do
+ specify "all resource_pools reference networks that exist" do
+ network_names = @manifest["networks"].map {|n| n["name"]}
+
+ @manifest["resource_pools"].each do |pool|
+ expect(network_names).to include(pool["network"]),
+ "network #{pool["network"]} not found for resource_pool #{pool["name"]}"
+ end
+ end
+ end
+end
|
Add generic tests for manifest validity.
Initial tests that can be run against any Bosh manifest to validate some
basic properties. This initial pass only validates that resource names
are unique, and that all cross-references in the manifest exist.
These are currently applied against the combined upstream manifest.
|
diff --git a/acceptance/setup/foss_install.rb b/acceptance/setup/foss_install.rb
index abc1234..def5678 100644
--- a/acceptance/setup/foss_install.rb
+++ b/acceptance/setup/foss_install.rb
@@ -1,7 +1,7 @@ test_name "Install ACL Module on Master"
-step "Clone Git Repo"
-on master, "git clone https://github.com/cowofevil/puppetlabs-acl.git /etc/puppet/modules/acl"
+step "Clone Git Repo on Master"
+on(master, "git clone https://github.com/puppetlabs/puppetlabs-acl.git /etc/puppet/modules/acl")
step "Plug-in Sync Each Agent"
with_puppet_running_on master, :main => { :verbose => true, :daemonize => true } do
|
Fix incorrect Git repo for the FOSS install script
|
diff --git a/app/models/attachment.rb b/app/models/attachment.rb
index abc1234..def5678 100644
--- a/app/models/attachment.rb
+++ b/app/models/attachment.rb
@@ -14,4 +14,10 @@ def self.codes
[['Brief-Template', 'Prawn::LetterDocument']]
end
+
+ before_save :create_title
+ private
+ def create_title
+ self.title = file.filename if title.blank?
+ end
end
|
Use the file name as title when nothing is definied.
|
diff --git a/plugins/suppliers/lib/suppliers_plugin/terms_helper.rb b/plugins/suppliers/lib/suppliers_plugin/terms_helper.rb
index abc1234..def5678 100644
--- a/plugins/suppliers/lib/suppliers_plugin/terms_helper.rb
+++ b/plugins/suppliers/lib/suppliers_plugin/terms_helper.rb
@@ -1,6 +1,8 @@ module SuppliersPlugin::TermsHelper
Terms = [:consumer, :supplier]
+ # '.' ins't supported by the % format function (altought it works on some newer systems)
+ TermsSeparator = '_'
TermsVariations = [:singular, :plural]
TermsTransformations = [:capitalize]
TermsKeys = Terms.map do |term|
@@ -9,24 +11,36 @@
protected
- def translated_terms keys = TermsKeys, transformations = TermsTransformations
- @translated_terms ||= {}
+ def sub_separator str
+ str.gsub '.', TermsSeparator
+ end
+
+ def sub_separator_items str
+ str.gsub!(/\%\{[^\}]*\}/){ |x| sub_separator x }
+ str
+ end
+
+ def translated_terms keys = TermsKeys, transformations = TermsTransformations, sep = TermsSeparator
+ @translated_terms ||= HashWithIndifferentAccess.new
return @translated_terms unless @translated_terms.blank?
@terms_context ||= 'suppliers_plugin'
keys.each do |key|
translation = I18n.t "#{@terms_context}.terms.#{key}"
- @translated_terms["terms.#{key}"] = translation
+ new_key = sub_separator key
+ @translated_terms["terms#{sep}#{new_key}"] = translation
transformations.map do |transformation|
- @translated_terms["terms.#{key}.#{transformation}"] = translation.send transformation
+ @translated_terms["terms#{sep}#{new_key}#{sep}#{transformation}"] = translation.send transformation
end
end
@translated_terms
end
def t key, options = {}
- I18n.t(key, options) % translated_terms
+ translation = I18n.t key, options
+ sub_separator_items translation
+ translation % translated_terms
end
end
|
Fix use of format on older systems
|
diff --git a/app/graphql/inputs/user/login.rb b/app/graphql/inputs/user/login.rb
index abc1234..def5678 100644
--- a/app/graphql/inputs/user/login.rb
+++ b/app/graphql/inputs/user/login.rb
@@ -10,7 +10,8 @@
argument :login, String, required: true
argument :password, String, required: true
- argument :remember_me, Boolean, required: false
+ argument :remember_me, Boolean, required: false, default_value: false,
+ replace_null_with_default: true
end
end
end
|
Update the userLoginInput to default to "false".
Also replaces a null "remember_me" with the default
|
diff --git a/app/jobs/onceoff/grant_onebox.rb b/app/jobs/onceoff/grant_onebox.rb
index abc1234..def5678 100644
--- a/app/jobs/onceoff/grant_onebox.rb
+++ b/app/jobs/onceoff/grant_onebox.rb
@@ -0,0 +1,35 @@+module Jobs
+
+ class GrantOnebox < Jobs::Onceoff
+ sidekiq_options queue: 'low'
+
+ def execute_onceoff(args)
+ to_award = {}
+
+ Post.secured(Guardian.new)
+ .select(:id, :created_at, :raw, :user_id)
+ .visible
+ .public_posts
+ .where("raw like '%http%'")
+ .find_in_batches do |group|
+
+ group.each do |p|
+ # Note we can't use `p.cooked` here because oneboxes have been cooked out
+ cooked = PrettyText.cook(p.raw)
+ doc = Nokogiri::HTML::fragment(cooked)
+ if doc.search('a.onebox').size > 0
+ to_award[p.user_id] ||= { post_id: p.id, created_at: p.created_at }
+ end
+ end
+
+ end
+
+ badge = Badge.find(Badge::FirstOnebox)
+ to_award.each do |user_id, opts|
+ BadgeGranter.grant(badge, User.find(user_id), opts)
+ end
+ end
+
+ end
+
+end
|
Add onceoff job to backfill oneboxes
|
diff --git a/app/jobs/send_bulk_ticket_job.rb b/app/jobs/send_bulk_ticket_job.rb
index abc1234..def5678 100644
--- a/app/jobs/send_bulk_ticket_job.rb
+++ b/app/jobs/send_bulk_ticket_job.rb
@@ -0,0 +1,16 @@+class SendBulkTicketJob
+ include SuckerPunch::Job
+
+ def perform(conference, filter)
+
+ case filter
+ when 'accept'
+ conference.events.where(state: :accepting).map{|e| e.notify }
+ when 'reject'
+ conference.events.where(state: :rejecting).map{|e| e.notify }
+ when 'schedule'
+ conference.events.where(state: :confirmed).scheduled.map{|e| e.notify }
+ end
+
+ end
+end
|
Add a SuckerPunch job to transition events with their notify transition
|
diff --git a/plugins/provisioners/puppet/plugin.rb b/plugins/provisioners/puppet/plugin.rb
index abc1234..def5678 100644
--- a/plugins/provisioners/puppet/plugin.rb
+++ b/plugins/provisioners/puppet/plugin.rb
@@ -1,7 +1,7 @@ require "vagrant"
module VagrantPlugins
- module Pupppet
+ module Puppet
class Plugin < Vagrant.plugin("1")
name "puppet"
description <<-DESC
|
Fix typo to make puppet provisioners work again
|
diff --git a/metadata.rb b/metadata.rb
index abc1234..def5678 100644
--- a/metadata.rb
+++ b/metadata.rb
@@ -15,7 +15,7 @@ depends 'user'
depends 'partial_search'
depends 'sudo', '< 3.0.0'
-depends 'nagios', '< 8.0.0'
+depends 'nagios'
depends 'nrpe'
supports 'centos', '~> 6.0'
|
Remove dep lock on nagios < 8.0.0 since we need to update it now
|
diff --git a/metadata.rb b/metadata.rb
index abc1234..def5678 100644
--- a/metadata.rb
+++ b/metadata.rb
@@ -3,7 +3,7 @@ maintainer_email "msimons@inviqa.com"
license "Apache 2.0"
description "enable driving cookbooks that are not normally config driven to be so"
-version "1.3.6"
+version "1.3.7"
depends "apache2", "~> 1.8"
depends 'iptables-ng', '~> 2.2.0'
|
Bump up version to 1.3.7
|
diff --git a/app/models/borrow.rb b/app/models/borrow.rb
index abc1234..def5678 100644
--- a/app/models/borrow.rb
+++ b/app/models/borrow.rb
@@ -15,13 +15,7 @@ def due_date_in_words
words = time_ago_in_words(self.due_date)
self.due_date.past? ? "+#{words}" : "-#{words}"
- end
-
- def due_date= due_date
- unless due_date.empty?
- self.duration_in_days = DateTime.parse(due_date) - Date.today
- end
- end
+ end2
def overdue?
self.due_date < Date.today && !self.returned
|
Remove due_date= which wasn't being used.
|
diff --git a/features/step_definitions/filtering_steps.rb b/features/step_definitions/filtering_steps.rb
index abc1234..def5678 100644
--- a/features/step_definitions/filtering_steps.rb
+++ b/features/step_definitions/filtering_steps.rb
@@ -5,9 +5,9 @@ Then(/^I can get a list of all merger inquiries$/) do
visit finder_path('cma-cases')
page.should have_content('2 cases')
- page.should have_css('.results .document', count: 2)
+ page.should have_css('.filtered-results .document', count: 2)
- within '.results .document:nth-child(1)' do
+ within '.filtered-results .document:nth-child(1)' do
page.should have_link('HealthCorp / DrugInc merger inquiry')
page.should have_content('30 December 2003')
page.should have_content('Mergers')
@@ -16,5 +16,5 @@ select_filters('Case type' => 'Mergers')
page.should have_content('1 case')
- page.should have_css('.results .document', count: 1)
+ page.should have_css('.filtered-results .document', count: 1)
end
|
Update tests for new markup
|
diff --git a/async_invocation.gemspec b/async_invocation.gemspec
index abc1234..def5678 100644
--- a/async_invocation.gemspec
+++ b/async_invocation.gemspec
@@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = 'evt-async_invocation'
- s.version = '1.0.0.0'
+ s.version = '2.0.0.0'
s.summary = "Return value for async method that is accidentally invoked synchronously"
s.description = ' '
|
Package version is increased from 1.0.0.0 to 2.0.0.0
|
diff --git a/attr_sanitizable.gemspec b/attr_sanitizable.gemspec
index abc1234..def5678 100644
--- a/attr_sanitizable.gemspec
+++ b/attr_sanitizable.gemspec
@@ -10,8 +10,8 @@ s.homepage = 'https://github.com/aaronprice/attr_sanitizable'
s.license = 'MIT'
- s.add_dependency('activerecord', '~> 3.1', '>= 3.1')
- s.add_dependency('activesupport', '~> 3.1', '>= 3.1')
+ s.add_dependency('activerecord', '>= 3.1')
+ s.add_dependency('activesupport', '>= 3.1')
s.add_development_dependency('sqlite3', '~> 1.3')
s.add_development_dependency('rspec', '~> 2.0')
|
Allow inclusion in rails 4.
|
diff --git a/config/initializers/postgres_required_versions.rb b/config/initializers/postgres_required_versions.rb
index abc1234..def5678 100644
--- a/config/initializers/postgres_required_versions.rb
+++ b/config/initializers/postgres_required_versions.rb
@@ -5,13 +5,13 @@ end
def check_version
- msg = "The version of PostgreSQL being connected to is incompatible with #{Vmdb::Appliance.PRODUCT_NAME} (10 required)"
+ msg = "The version of PostgreSQL being connected to is incompatible with #{Vmdb::Appliance.PRODUCT_NAME} (13 required)"
- if postgresql_version < 90500
+ if postgresql_version < 100000
raise msg
end
- if postgresql_version < 100000 || postgresql_version >= 130000
+ if postgresql_version < 130000 || postgresql_version >= 140000
raise msg if Rails.env.production? && !ENV["UNSAFE_PG_VERSION"]
$stderr.puts msg
end
|
Allow pg 10-14+ in dev, require pg 13 in production
|
diff --git a/lib/active_mocker/mock.rb b/lib/active_mocker/mock.rb
index abc1234..def5678 100644
--- a/lib/active_mocker/mock.rb
+++ b/lib/active_mocker/mock.rb
@@ -1,3 +1,4 @@+require 'active_support/dependencies/autoload'
require 'active_support/hash_with_indifferent_access'
require 'active_support/core_ext/module/delegation'
require 'active_support/inflector'
|
Fix random build failure where active_support autoload can’t be found.
|
diff --git a/generator.rb b/generator.rb
index abc1234..def5678 100644
--- a/generator.rb
+++ b/generator.rb
@@ -0,0 +1,75 @@+require 'opus-ruby'
+require 'json'
+
+VERSION = '2.0.0'
+
+# Generate a 10-second long file, or however many seconds specified by console arguments
+duration = ARGV[0]&.to_i || 10
+
+# Generate a 60-sample long sine wave with an amplitude of 4095, as an array of integers
+def wave
+ [*0..60].map do |e|
+ (4095 * Math.sin(e * Math::PI / 60)).round
+ end
+end
+
+# Our wave needs to be 3840 bytes long, so multiply it by 64 (3840 / 60)
+long_wave = wave * 64
+
+# Pack the long_wave into a string
+packed = long_wave.pack('s<*')
+
+SAMPLE_RATE = 48_000 # Hz
+FRAME_SIZE = 960 # bytes
+CHANNELS = 2
+BITRATE = 64_000
+encoder = Opus::Encoder.new(SAMPLE_RATE, FRAME_SIZE, CHANNELS)
+encoder.bitrate = BITRATE
+packet = encoder.encode(packed, packed.length)
+
+# Create the dca file
+file = File.open('sine.dca', 'w')
+
+DCA_MAGIC = 'DCA1'.freeze
+file.write(DCA_MAGIC)
+
+metadata = {
+ dca: {
+ version: 1,
+ tool: {
+ name: 'sine.dca',
+ version: VERSION,
+ url: 'https://github.com/meew0/sine.dca',
+ author: 'meew0'
+ },
+ info: {
+ title: 'Sine Wave',
+ artist: 'Mathematics',
+ album: 'Trigonometry',
+ genre: 'math',
+ comments: "#{duration}-second sine wave",
+ cover: nil
+ },
+ origin: {
+ source: 'generated'
+ },
+ opus: {
+ mode: 'music',
+ sample_rate: SAMPLE_RATE,
+ frame_size: FRAME_SIZE,
+ abr: BITRATE,
+ channels: CHANNELS
+ },
+ extra: {}
+ }
+}
+metadata_json = metadata.to_json
+file.write([metadata_json.length].pack('l<')) # Metadata header
+file.write(metadata_json) # Metadata
+
+packets = duration * 50
+
+packets.times do
+ file.write([packet.length].pack('s<')) # Packet header
+ file.write(packet) # Packet
+end
|
Write a file to generate the sine.dca file
|
diff --git a/rails_event_store/lib/rails_event_store/client.rb b/rails_event_store/lib/rails_event_store/client.rb
index abc1234..def5678 100644
--- a/rails_event_store/lib/rails_event_store/client.rb
+++ b/rails_event_store/lib/rails_event_store/client.rb
@@ -10,10 +10,14 @@ dispatcher: RubyEventStore::ComposedDispatcher.new(
RailsEventStore::AfterCommitAsyncDispatcher.new(scheduler: ActiveJobScheduler.new(serializer: mapper.serializer)),
RubyEventStore::Dispatcher.new),
+ clock: default_clock,
+ correlation_id_generator: default_correlation_id_generator,
request_metadata: default_request_metadata)
super(repository: RubyEventStore::InstrumentedRepository.new(repository, ActiveSupport::Notifications),
mapper: RubyEventStore::Mappers::InstrumentedMapper.new(mapper, ActiveSupport::Notifications),
subscriptions: subscriptions,
+ clock: clock,
+ correlation_id_generator: correlation_id_generator,
dispatcher: RubyEventStore::InstrumentedDispatcher.new(dispatcher, ActiveSupport::Notifications)
)
@request_metadata = request_metadata
|
Allow to pass clock & correlation id generator
Use the same defaults as in RubyEventStore::Client
|
diff --git a/lib/buildr_plus/common.rb b/lib/buildr_plus/common.rb
index abc1234..def5678 100644
--- a/lib/buildr_plus/common.rb
+++ b/lib/buildr_plus/common.rb
@@ -20,7 +20,7 @@
BuildrPlus::FeatureManager.activate_features([:repositories, :idea_codestyle, :product_version, :dialect_mapping, :libs, :publish, :ci])
-BuildrPlus::FeatureManager.activate_features([:dbt]) if BuildrPlus::Util.is_dbt_gem_present?
-BuildrPlus::FeatureManager.activate_features([:domgen]) if BuildrPlus::Util.is_domgen_gem_present?
-BuildrPlus::FeatureManager.activate_features([:rptman]) if BuildrPlus::Util.is_rptman_gem_present?
-BuildrPlus::FeatureManager.activate_features([:sass]) if BuildrPlus::Util.is_sass_gem_present?
+BuildrPlus::FeatureManager.activate_feature(:dbt) if BuildrPlus::Util.is_dbt_gem_present?
+BuildrPlus::FeatureManager.activate_feature(:domgen) if BuildrPlus::Util.is_domgen_gem_present?
+BuildrPlus::FeatureManager.activate_feature(:rptman) if BuildrPlus::Util.is_rptman_gem_present?
+BuildrPlus::FeatureManager.activate_feature(:sass) if BuildrPlus::Util.is_sass_gem_present?
|
Simplify activation of single feature
|
diff --git a/app/controllers/ansible_playbook_controller.rb b/app/controllers/ansible_playbook_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/ansible_playbook_controller.rb
+++ b/app/controllers/ansible_playbook_controller.rb
@@ -18,7 +18,7 @@ private
def textual_group_list
- [%i(properties relationships), %i(tags)]
+ [%i(properties relationships)]
end
helper_method :textual_group_list
end
|
Remove tags from Ansible Playbook summary page
|
diff --git a/app/controllers/management/sites_controller.rb b/app/controllers/management/sites_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/management/sites_controller.rb
+++ b/app/controllers/management/sites_controller.rb
@@ -1,5 +1,5 @@ class Management::SitesController < ManagementController
- before_action :set_site_for_page
+ before_action :set_site, only: [:structure]
# GET /management/sites
# GET /management/sites.json
@@ -29,4 +29,10 @@ end
end
+ private
+ # Use callbacks to share common setup or constraints between actions.
+ def set_site
+ @site = Site.find_by({slug: params[:site_slug]})
+ end
+
end
|
Set site on structure page
|
diff --git a/app/controllers/settings/exports_controller.rb b/app/controllers/settings/exports_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/settings/exports_controller.rb
+++ b/app/controllers/settings/exports_controller.rb
@@ -1,6 +1,8 @@ # frozen_string_literal: true
class Settings::ExportsController < Settings::BaseController
+ include Authorization
+
def show
@export = Export.new(current_account)
@backups = current_user.backups
|
Fix data export page error
|
diff --git a/db/migrate/20161112202920_add_state_to_signups.rb b/db/migrate/20161112202920_add_state_to_signups.rb
index abc1234..def5678 100644
--- a/db/migrate/20161112202920_add_state_to_signups.rb
+++ b/db/migrate/20161112202920_add_state_to_signups.rb
@@ -1,5 +1,5 @@ class AddStateToSignups < ActiveRecord::Migration[5.0]
def change
- add_column :signups, :state, :string, null: false, index: true
+ add_column :signups, :state, :string, null: false, default: 'confirmed', index: true
end
end
|
Add default value to not-null column (not having one is illegal in SQLite)
|
diff --git a/app/serializers/api/v2/itinerary_serializer.rb b/app/serializers/api/v2/itinerary_serializer.rb
index abc1234..def5678 100644
--- a/app/serializers/api/v2/itinerary_serializer.rb
+++ b/app/serializers/api/v2/itinerary_serializer.rb
@@ -9,7 +9,8 @@ :transit_time,
:walk_distance,
:wait_time,
- :legs
+ :legs,
+ :duration
belongs_to :service
|
Add itinerary duration to serializer
|
diff --git a/lib/dimples/renderable.rb b/lib/dimples/renderable.rb
index abc1234..def5678 100644
--- a/lib/dimples/renderable.rb
+++ b/lib/dimples/renderable.rb
@@ -1,17 +1,28 @@ module Dimples
module Renderable
- def render(contents, context = {})
+ def render(context = {}, body = nil)
context[:site] ||= @site
context.merge!(type => Hashie::Mash.new(@metadata))
- output = rendering_engine.render(Object.new, context) { contents }
+ output = engine.render(scope, context) { body }
return output unless (template = @site.templates[@metadata[:layout]])
- template.render(output, context)
+ template.render(context, output)
end
- def rendering_engine
- @rendering_engine ||= begin
+ def scope
+ @scope ||= Object.new.tap do |scope|
+ scope.instance_variable_set(:@site, @site)
+ scope.instance_variable_set(:@metadata, {})
+
+ scope.class.send(:define_method, :render) do |layout, locals = {}|
+ @site.templates[layout]&.render(locals)
+ end
+ end
+ end
+
+ def engine
+ @engine ||= begin
callback = proc { @contents }
if @path
@@ -27,11 +38,3 @@ end
end
-# def self.render_scope
-# @render_scope ||= Object.new.tap do |scope|
-# method_name = :render_template
-# scope.class.send(:define_method, method_name) do |site, template, locals = {}|
-# site.templates[template]&.render(context: locals)
-# end
-# end
-# end
|
Switch the render param order, add the scope method
|
diff --git a/config/initializers/gds-sso.rb b/config/initializers/gds-sso.rb
index abc1234..def5678 100644
--- a/config/initializers/gds-sso.rb
+++ b/config/initializers/gds-sso.rb
@@ -2,5 +2,5 @@ config.user_model = "User"
config.oauth_id = ENV["OAUTH_ID"] || "abcdefg"
config.oauth_secret = ENV["OAUTH_SECRET"] || "secret"
- config.oauth_root_url = Plek.find("signon")
+ config.oauth_root_url = Plek.new.external_url_for("signon")
end
|
Use external_url_for when configuring GDS::SSO
This needs to be the external URL as it is accessed through a users
browser.
|
diff --git a/config/initializers/gds-sso.rb b/config/initializers/gds-sso.rb
index abc1234..def5678 100644
--- a/config/initializers/gds-sso.rb
+++ b/config/initializers/gds-sso.rb
@@ -2,5 +2,5 @@ config.user_model = "User"
config.oauth_id = 'abcdefgh12345678'
config.oauth_secret = 'secret'
- config.oauth_root_url = Plek.current.find("authentication")
+ config.oauth_root_url = Plek.current.find("signon")
end
|
Change Need-o-tron to use Signonotron2
|
diff --git a/lib/dotenv/environment.rb b/lib/dotenv/environment.rb
index abc1234..def5678 100644
--- a/lib/dotenv/environment.rb
+++ b/lib/dotenv/environment.rb
@@ -7,7 +7,7 @@
def load
read.each do |line|
- self[$1] = $2 || $3 if line =~ /\A(\w+)(?:=|: ?)(?:['"]([^'"]*)['"]|([^'"]*))\z/
+ self[$1] = $2 || $3 if line =~ /\A(?:export\s+)?(\w+)(?:=|: ?)(?:['"]([^'"]*)['"]|([^'"]*))\z/i
end
end
|
Allow for env variables set with 'export' keyword
|
diff --git a/lib/garelic/middleware.rb b/lib/garelic/middleware.rb
index abc1234..def5678 100644
--- a/lib/garelic/middleware.rb
+++ b/lib/garelic/middleware.rb
@@ -8,8 +8,17 @@ status, headers, response = @app.call(env)
if headers["Content-Type"] =~ /text\/html|application\/xhtml\+xml/
- body = response.body.gsub(Garelic::Timing, Garelic.report_user_timing_from_metrics(Garelic::Metrics))
- response = [body]
+ body = if response.kind_of?(Rack::Response)
+ response.body
+ elsif response.kind_of?(Array)
+ response.first
+ else
+ response
+ end
+ if body.kind_of?(String)
+ body.gsub!(Garelic::Timing, Garelic.report_user_timing_from_metrics(Garelic::Metrics))
+ response = [body]
+ end
end
Garelic::Metrics.reset!
|
Fix method missing on redirect response.
|
diff --git a/spec/unit/puppet/parser/functions/firewall_multi_spec.rb b/spec/unit/puppet/parser/functions/firewall_multi_spec.rb
index abc1234..def5678 100644
--- a/spec/unit/puppet/parser/functions/firewall_multi_spec.rb
+++ b/spec/unit/puppet/parser/functions/firewall_multi_spec.rb
@@ -0,0 +1,53 @@+require 'spec_helper'
+
+describe Puppet::Parser::Functions.function(:firewall_multi) do
+ let(:scope) { PuppetlabsSpec::PuppetInternals.scope }
+
+ it 'should exist' do
+ expect(Puppet::Parser::Functions.function('firewall_multi')).to eq 'function_firewall_multi'
+ end
+
+ context 'when given a wrong number of arguments' do
+ it 'should fail' do
+ expect {
+ scope.function_firewall_multi([])
+ }.to raise_error ArgumentError, /Wrong number of arguments given/
+ end
+ end
+
+ context 'when given the wrong type of arguments' do
+ it 'should fail' do
+ expect {
+ scope.function_firewall_multi(['I_am_not_a_hash'])
+ }.to raise_error ArgumentError, /first argument must be a hash/
+ end
+ end
+
+ context 'correctly parses a hash' do
+ input = {
+ '00100 accept inbound ssh' => {
+ 'action' => 'accept',
+ 'source' => ['1.1.1.1/24', '2.2.2.2/24'],
+ 'dport' => 22,
+ },
+ }
+
+ output = {
+ '00100 accept inbound ssh from 1.1.1.1/24' => {
+ 'action' => 'accept',
+ 'source' => '1.1.1.1/24',
+ 'dport' => 22,
+ },
+ '00100 accept inbound ssh from 2.2.2.2/24' => {
+ 'action' => 'accept',
+ 'source' => '2.2.2.2/24',
+ 'dport' => 22,
+ },
+ }
+
+ it 'should convert hash into expected format' do
+ expect(scope.function_firewall_multi([input])).to eq output
+ end
+ end
+end
+
|
Add unit tests for the function.
|
diff --git a/spec/lib/ec2-security-czar/security_group_spec.rb b/spec/lib/ec2-security-czar/security_group_spec.rb
index abc1234..def5678 100644
--- a/spec/lib/ec2-security-czar/security_group_spec.rb
+++ b/spec/lib/ec2-security-czar/security_group_spec.rb
@@ -0,0 +1,69 @@+require 'spec_helper.rb'
+require 'ec2-security-czar/security_group'
+
+module Ec2SecurityCzar
+ describe SecurityGroup do
+ let(:api) { double("API", name: 'test') }
+ let(:outbound_rule) {
+ {
+ zone: "Test Outbound",
+ justification: "Test outbound justification",
+ groups: [ 'test-outbound-group-id' ],
+ protocol: :udp,
+ port_range: '666'
+ }
+ }
+ let(:inbound_rule) {
+ {
+ zone: "Test Inbound",
+ justification: "Test inbound justification",
+ groups: [ 'test-inbound-group-id' ],
+ protocol: :tcp,
+ port_range: '999'
+ }
+ }
+
+ let(:rules_config) { { outbound: [outbound_rule], inbound: [inbound_rule] } }
+ let(:filename) { 'the/config/file' }
+
+ subject { SecurityGroup.new(api) }
+
+ before do
+ allow_any_instance_of(SecurityGroup).to receive(:config_filename).and_return(filename)
+ allow(YAML).to receive(:load_file).with(filename).and_return(rules_config)
+ allow(File).to receive(:exists?).with(filename).and_return(true)
+ allow(subject).to receive(:puts)
+ end
+
+ context "#update_rules" do
+ let(:delete_inbound) { double("Inbound rule to be deleted") }
+ let(:delete_outbound) { double("Outbound rule to be deleted") }
+ let(:addition_inbound) { double("Inbound rule to be added") }
+ let(:addition_outbound) { double("Outbound rule to be added") }
+
+ before do
+ allow(subject).to receive(:new_rules).with(:outbound).and_return([addition_outbound])
+ allow(subject).to receive(:new_rules).with(:inbound).and_return([addition_inbound])
+ allow(subject).to receive(:current_rules).with(:outbound).and_return([delete_outbound])
+ allow(subject).to receive(:current_rules).with(:inbound).and_return([delete_inbound])
+ end
+
+ it "revokes rules that have been deleted" do
+ allow(addition_outbound).to receive(:authorize!)
+ allow(addition_inbound).to receive(:authorize!)
+ expect(delete_inbound).to receive(:revoke!)
+ expect(delete_outbound).to receive(:revoke!)
+ subject.update_rules
+ end
+
+ it "authorizes rules that have been added" do
+ allow(delete_inbound).to receive(:revoke!)
+ allow(delete_outbound).to receive(:revoke!)
+ expect(addition_outbound).to receive(:authorize!).with(api)
+ expect(addition_inbound).to receive(:authorize!).with(api)
+ subject.update_rules
+ end
+ end
+
+ end
+end
|
Add specs for the security group class
|
diff --git a/test/bmff/box/test_edit.rb b/test/bmff/box/test_edit.rb
index abc1234..def5678 100644
--- a/test/bmff/box/test_edit.rb
+++ b/test/bmff/box/test_edit.rb
@@ -0,0 +1,26 @@+# coding: utf-8
+# vim: set expandtab tabstop=2 shiftwidth=2 softtabstop=2 autoindent:
+
+require_relative '../../minitest_helper'
+require 'bmff/box'
+require 'stringio'
+
+class TestBMFFBoxEdit < MiniTest::Unit::TestCase
+ def test_parse
+ io = StringIO.new("", "r+:ascii-8bit")
+ io.extend(BMFF::BinaryAccessor)
+ io.write_uint32(0)
+ io.write_ascii("edts")
+ size = io.pos
+ io.pos = 0
+ io.write_uint32(size)
+ io.pos = 0
+
+ box = BMFF::Box.get_box(io, nil)
+ assert_instance_of(BMFF::Box::Edit, box)
+ assert_equal(size, box.actual_size)
+ assert_equal("edts", box.type)
+ assert_equal([], box.children)
+ assert(box.container?)
+ end
+end
|
Add a test file for BMFF::Box::Edit.
|
diff --git a/db/migrate/20110627095017_add_new_event_type.rb b/db/migrate/20110627095017_add_new_event_type.rb
index abc1234..def5678 100644
--- a/db/migrate/20110627095017_add_new_event_type.rb
+++ b/db/migrate/20110627095017_add_new_event_type.rb
@@ -0,0 +1,17 @@+class AddNewEventType < ActiveRecord::Migration
+ def self.up
+ # insert news feed related event types
+ event_types = [
+ { :id => 39, :name => "PERSON JOIN" }
+ ]
+
+ event_types.each do |event_type|
+ et = EventType.new(:name => event_type[:name], :group => EventType::GROUP_NEWS_FEED)
+ et.id = event_type[:id]
+ et.save!
+ end
+ end
+
+ def self.down
+ end
+end
|
Add PERSON JOIN event type
|
diff --git a/db/migrate/20140428205755_add_slugs_to_ideas.rb b/db/migrate/20140428205755_add_slugs_to_ideas.rb
index abc1234..def5678 100644
--- a/db/migrate/20140428205755_add_slugs_to_ideas.rb
+++ b/db/migrate/20140428205755_add_slugs_to_ideas.rb
@@ -0,0 +1,9 @@+class AddSlugsToIdeas < ActiveRecord::Migration
+ def self.up
+ add_column :ideas, :slug, :string, :unique => true, :null => false
+ end
+
+ def self.down
+ remove_column :ideas, :slug
+ end
+end
|
Create migration to add slugs to Ideas
|
diff --git a/lib/peat/token_manager.rb b/lib/peat/token_manager.rb
index abc1234..def5678 100644
--- a/lib/peat/token_manager.rb
+++ b/lib/peat/token_manager.rb
@@ -2,14 +2,16 @@ module TokenManager
module_function
- def token
+ def token(fuel_client_id: nil, fuel_secret: nil)
fetch_token do
+ client_id = fuel_client_id || ENV['FUEL_CLIENT_ID'] || $fuel_client_id
+ secret = fuel_secret || ENV['FUEL_SECRET'] || $fuel_secret
connection.post do |req|
req.url 'requestToken'
req.headers['Content-Type'] = 'application/json'
req.body = {
- 'clientId' => ENV['FUEL_CLIENT_ID'] || $fuel_client_id,
- 'clientSecret' => ENV['FUEL_SECRET'] || $fuel_secret,
+ 'clientId' => client_id,
+ 'clientSecret' => secret,
}.to_json
end.body.merge('created_at' => Time.now)
end
|
Allow client id and secret to be provided in token call
|
diff --git a/hephaestus/lib/resque/entities_extraction_task.rb b/hephaestus/lib/resque/entities_extraction_task.rb
index abc1234..def5678 100644
--- a/hephaestus/lib/resque/entities_extraction_task.rb
+++ b/hephaestus/lib/resque/entities_extraction_task.rb
@@ -28,11 +28,11 @@ pos = token.pos
page = find_page(token.pos)
named_entity = NamedEntity.create({
- form: token.form,
+ form: token.form.gsub("_", " "),
lemma: token.lemma,
tag: token.tag,
prob: token.prob,
- text: token.form,
+ text: token.form.gsub("_", " "),
pos: pos,
inner_pos: { pid: page.id, from_pos: pos, to_pos: pos + token.form.length }
})
|
[hephaestus] Fix the way form is stored
|
diff --git a/spec/support/active_record_example_group.rb b/spec/support/active_record_example_group.rb
index abc1234..def5678 100644
--- a/spec/support/active_record_example_group.rb
+++ b/spec/support/active_record_example_group.rb
@@ -8,7 +8,7 @@ let(:task) { rake[self.class.description] }
let(:namespace) { self.class.description.split(':').first }
- before(:all) do
+ before(:each) do
ActiveRecord::Base.establish_connection(
:adapter => 'sqlite3',
:database => ':memory:'
|
Fix issue with database transactions in specs.
It seems that since upgrading to Rails 3.1 and a newer version of the
sqlite3 gem that we need to reconnect to the database after each spec,
otherwise the DDL operations are no longer being reset properly.
|
diff --git a/lib/email_address/active_record_validator.rb b/lib/email_address/active_record_validator.rb
index abc1234..def5678 100644
--- a/lib/email_address/active_record_validator.rb
+++ b/lib/email_address/active_record_validator.rb
@@ -37,9 +37,10 @@ return if r[f].nil?
e = Address.new(r[f])
unless e.valid?
- r.errors[f] << (@opt[:message] ||
- Config.error_messages[:invalid_address] ||
- "Invalid Email Address")
+ error_message = @opt[:message] ||
+ Config.error_messages[:invalid_address] ||
+ "Invalid Email Address"
+ r.errors.add(f, error_message)
end
end
|
Fix deprecation warning when adding error to Active Record object
In Rails 6.1, adding an error to an Active Record object using `<<`
will raise the following deprecation warning:
DEPRECATION WARNING: Calling `<<` to an ActiveModel::Errors message
array in order to add an error is deprecated. Please call
`ActiveModel::Errors#add` instead.
This commit fixes the issue by using `ActiveModel::Errors#add`.
|
diff --git a/etc/deploy/deploy.rb b/etc/deploy/deploy.rb
index abc1234..def5678 100644
--- a/etc/deploy/deploy.rb
+++ b/etc/deploy/deploy.rb
@@ -23,7 +23,8 @@ set :linked_dirs, [
fetch(:log_path),
fetch(:session_path),
- fetch(:web_path) + "/uploads"
+ fetch(:web_path) + "/uploads",
+ fetch(:var_path) + "/search_data"
]
|
Add search index to capistrano
|
diff --git a/metadata.rb b/metadata.rb
index abc1234..def5678 100644
--- a/metadata.rb
+++ b/metadata.rb
@@ -7,7 +7,7 @@ version "0.0.1"
recipe "mosquitto", "Includes the recipe to configure the broker"
-%w{ debian ubuntu }.each do |os|
+%w{ debian ubuntu mac_os_x }.each do |os|
supports os
end
|
Mark OSX as supported (via homebrew)
|
diff --git a/spec/mailers/previews/alert_mailer_preview.rb b/spec/mailers/previews/alert_mailer_preview.rb
index abc1234..def5678 100644
--- a/spec/mailers/previews/alert_mailer_preview.rb
+++ b/spec/mailers/previews/alert_mailer_preview.rb
@@ -0,0 +1,9 @@+class AlertMailerPreview < ActionMailer::Preview
+ def alert_email
+ user = User.first
+ broken_scrapers = Scraper.first(2)
+ successful_scrapers = Scraper.last(2)
+
+ AlertMailer.alert_email(user, broken_scrapers, successful_scrapers)
+ end
+end
|
Add a basic mailer preview for the alert emails
|
diff --git a/lib/miq_automation_engine/service_models/miq_ae_service_event_stream.rb b/lib/miq_automation_engine/service_models/miq_ae_service_event_stream.rb
index abc1234..def5678 100644
--- a/lib/miq_automation_engine/service_models/miq_ae_service_event_stream.rb
+++ b/lib/miq_automation_engine/service_models/miq_ae_service_event_stream.rb
@@ -9,5 +9,9 @@ expose :dest_vm, :association => true, :method => :dest_vm_or_template
expose :dest_host, :association => true
expose :service, :association => true
+
+ def event_namespace
+ object_class.name
+ end
end
end
|
Automate model changes for event switchboard.
All MiqEvent and EmsEvent are sent to automate for process.
Add EventStream#event_namespace to category the event object.
(transferred from ManageIQ/manageiq@559bd25f277d9ec169a82bdebd8d52f10cc00f82)
|
diff --git a/test/metamagic_test.rb b/test/metamagic_test.rb
index abc1234..def5678 100644
--- a/test/metamagic_test.rb
+++ b/test/metamagic_test.rb
@@ -10,4 +10,14 @@
assert_equal %{<title>My Title</title>\n<meta content="My description." name="description" />\n<meta content="One, Two, Three" name="keywords" />}, metamagic
end
+
+ test "not adding existing meta tags" do
+ meta title: "Test Title",
+ description: "Test description."
+
+ meta title: "Second Title",
+ description: "Second description."
+
+ assert_equal %{<title>Test Title</title>\n<meta content="Test description." name="description" />}, metamagic
+ end
end
|
Test not adding existing meta tags
|
diff --git a/spec/controllers/events_controller_spec.rb b/spec/controllers/events_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/events_controller_spec.rb
+++ b/spec/controllers/events_controller_spec.rb
@@ -10,6 +10,7 @@
describe "GET 'index.ics'" do
it "returns http success" do
+ event = FactoryGirl.create(:event)
get 'index', format: 'ics'
response.should be_success
end
|
Add an event to the calendar test
|
diff --git a/spec/private/dispatch/route_params_spec.rb b/spec/private/dispatch/route_params_spec.rb
index abc1234..def5678 100644
--- a/spec/private/dispatch/route_params_spec.rb
+++ b/spec/private/dispatch/route_params_spec.rb
@@ -0,0 +1,19 @@+require File.join(File.dirname(__FILE__), "spec_helper")
+require 'rack/mock'
+require 'stringio'
+Merb.start :environment => 'test',
+ :adapter => 'runner',
+ :merb_root => File.dirname(__FILE__) / 'fixture'
+
+describe Merb::Dispatcher, "route params" do
+ before(:each) do
+ env = Rack::MockRequest.env_for("/foo/bar/54")
+ env['REQUEST_URI'] = "/foo/bar/54" # MockRequest doesn't set this
+ @controller = Merb::Dispatcher.handle(env, StringIO.new)
+ end
+
+ it "should properly set the route params" do
+ @controller.request.route_params[:id].should == '54'
+ end
+
+end
|
Add prelim spec for route_params
Spec passes, but issue still persists. Hmm...
|
diff --git a/test/test_reporting.rb b/test/test_reporting.rb
index abc1234..def5678 100644
--- a/test/test_reporting.rb
+++ b/test/test_reporting.rb
@@ -1,12 +1,12 @@-if ENV['SIMPLECOV']
+unless ENV['SIMPLECOV'].nil?
require 'simplecov'
SimpleCov.start
end
-if ENV['JENKINS_URL']
+unless ENV['CODECLIMATE_REPO_TOKEN'].nil?
require 'codeclimate-test-reporter'
CodeClimate::TestReporter.start
+end
- require 'coveralls'
- Coveralls.wear!
-end
+require 'coveralls'
+Coveralls.wear! if Coveralls.will_run?
|
Fix test coverage reporting during CI
|
diff --git a/pgn.gemspec b/pgn.gemspec
index abc1234..def5678 100644
--- a/pgn.gemspec
+++ b/pgn.gemspec
@@ -18,6 +18,8 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]
+ spec.add_dependency "whittle"
+
spec.add_development_dependency "bundler", "~> 1.3"
spec.add_development_dependency "rake"
end
|
Use whittle gem for parsing
|
diff --git a/lib/aptible/api/image.rb b/lib/aptible/api/image.rb
index abc1234..def5678 100644
--- a/lib/aptible/api/image.rb
+++ b/lib/aptible/api/image.rb
@@ -8,6 +8,7 @@ field :git_ref
field :docker_repo
field :docker_ref
+ field :dualstack_hint
field :created_at, type: Time
field :updated_at, type: Time
end
|
Add dualstack_hint field on Image
|
diff --git a/app/controllers/concerns/persistent_warnings.rb b/app/controllers/concerns/persistent_warnings.rb
index abc1234..def5678 100644
--- a/app/controllers/concerns/persistent_warnings.rb
+++ b/app/controllers/concerns/persistent_warnings.rb
@@ -3,7 +3,7 @@ extend ActiveSupport::Concern
included do
- after_action :set_persistent_warning, unless: -> { request.xhr? }
+ before_action :set_persistent_warning, unless: -> { request.xhr? }
end
def set_persistent_warning
|
Decrease importance of persistent warnings on controllers
Notices set in another actions should overwrite the persistent ones.
|
diff --git a/db/migrate/002_add_user_id_to_pureftpd_users.rb b/db/migrate/002_add_user_id_to_pureftpd_users.rb
index abc1234..def5678 100644
--- a/db/migrate/002_add_user_id_to_pureftpd_users.rb
+++ b/db/migrate/002_add_user_id_to_pureftpd_users.rb
@@ -0,0 +1,9 @@+class AddUserIdToPureftpdUsers < ActiveRecord::Migration
+ def self.up
+ add_column :pureftpd_users, :user_id, :integer
+ end
+
+ def self.down
+ remove_column :pureftpd_users, :user_id
+ end
+end
|
Add a user_id column to the pureftpd_users table.
|
diff --git a/lib/data_mapper/constraints/adapters/extension.rb b/lib/data_mapper/constraints/adapters/extension.rb
index abc1234..def5678 100644
--- a/lib/data_mapper/constraints/adapters/extension.rb
+++ b/lib/data_mapper/constraints/adapters/extension.rb
@@ -4,7 +4,7 @@ module Extension
# Include the corresponding Constraints module into a adapter class
#
- # @param [String] const_name
+ # @param [Symbol] const_name
# demodulized name of the adapter class to include corresponding
# constraints module into
#
|
Correct documented type of arg.
|
diff --git a/lib/generators/brightcontent/install_generator.rb b/lib/generators/brightcontent/install_generator.rb
index abc1234..def5678 100644
--- a/lib/generators/brightcontent/install_generator.rb
+++ b/lib/generators/brightcontent/install_generator.rb
@@ -23,6 +23,10 @@ copy_file "../../../../app/assets/stylesheets/brightcontent/custom.css", "app/assets/stylesheets/brightcontent/custom.css"
copy_file "../../../../app/assets/javascripts/brightcontent/custom.js", "app/assets/stylesheets/brightcontent/custom.js"
end
+
+ def setup_directory
+ empty_directory "app/controllers/brightcontent"
+ end
end
end
end
|
Create empty dir in controllers at install
|
diff --git a/config/initializers/check_migration_version.rb b/config/initializers/check_migration_version.rb
index abc1234..def5678 100644
--- a/config/initializers/check_migration_version.rb
+++ b/config/initializers/check_migration_version.rb
@@ -3,7 +3,7 @@ # skip when run from tasks like rake db:migrate, or from Capistrano rules
# that need to run before the migration rule
current_version = ActiveRecord::Migrator.current_version rescue 0
-highest_version = Dir.glob("#{RAILS_ROOT}/db/migrate/*.rb" ).map { |f|
+highest_version = Dir.glob("#{Rails.root}/db/migrate/*.rb" ).map { |f|
f.match(/(\d+)_.*\.rb$/) ? $1.to_i : 0
}.max
|
Update migration check for rails 3
|
diff --git a/spec/requests/request_spec_helpers.rb b/spec/requests/request_spec_helpers.rb
index abc1234..def5678 100644
--- a/spec/requests/request_spec_helpers.rb
+++ b/spec/requests/request_spec_helpers.rb
@@ -2,7 +2,8 @@ def logon(project, release)
# We need to 'grant' permissions UserSession#current_user in order to bypass authorisation rules
# (Note: this will only work with the RackTest driver)
- user = User.create!(:name => 'Bob', :email => 'bob@nocompany.com', :password => 'secret', :release => release, :project => project)
+ user = User.create!(:name => 'Bob', :email => 'bob@nocompany.com', :password => 'secret', :password_confirmation => 'secret',
+ :release => release, :project => project)
session = UserSession.new({})
session.login(user)
UserSession.stub(:new).and_return(session)
|
Fix specs that were regressed by the validations on password confirmation
|
diff --git a/lib/myhub.rb b/lib/myhub.rb
index abc1234..def5678 100644
--- a/lib/myhub.rb
+++ b/lib/myhub.rb
@@ -10,6 +10,23 @@ set :logging, true
# Your code here ...
+ get "/" do
+ api = Github.new
+ # get stuff from github
+ erb :index, locals: { issues: stuff }
+ end
+
+ put "/issue/:id" do
+ api = Github.new
+ api.reopen_issue(params["id"].to_i)
+ "Cool cool cool"
+ end
+
+ delete "/issue/:id" do
+ api = Github.new
+ api.close_issue(params["id"].to_i)
+ "Cool cool cool"
+ end
run! if app_file == $0
end
|
Add a bit more structure.
|
diff --git a/images/spec/lib/refinery/images/options_spec.rb b/images/spec/lib/refinery/images/options_spec.rb
index abc1234..def5678 100644
--- a/images/spec/lib/refinery/images/options_spec.rb
+++ b/images/spec/lib/refinery/images/options_spec.rb
@@ -3,13 +3,37 @@ module Refinery
describe Images::Options do
describe ".reset!" do
- it "should set options back to their default values" do
+ it "should set max_image_size back to the default value" do
Images::Options.max_image_size.should == Images::Options::DEFAULT_MAX_IMAGE_SIZE
Images::Options.max_image_size += 1
Images::Options.max_image_size.should_not == Images::Options::DEFAULT_MAX_IMAGE_SIZE
Images::Options.reset!
Images::Options.max_image_size.should == Images::Options::DEFAULT_MAX_IMAGE_SIZE
end
+
+ it "should set pages_per_dialog back to the default value" do
+ Images::Options.pages_per_dialog.should == Images::Options::DEFAULT_PAGES_PER_DIALOG
+ Images::Options.pages_per_dialog += 1
+ Images::Options.pages_per_dialog.should_not == Images::Options::DEFAULT_PAGES_PER_DIALOG
+ Images::Options.reset!
+ Images::Options.pages_per_dialog.should == Images::Options::DEFAULT_PAGES_PER_DIALOG
+ end
+
+ it "should set pages_per_dialog_that_have_size_options back to the default value" do
+ Images::Options.pages_per_dialog_that_have_size_options.should == Images::Options::DEFAULT_PAGES_PER_DIALOG_THAT_HAVE_SIZE_OPTIONS
+ Images::Options.pages_per_dialog_that_have_size_options += 1
+ Images::Options.pages_per_dialog_that_have_size_options.should_not == Images::Options::DEFAULT_PAGES_PER_DIALOG_THAT_HAVE_SIZE_OPTIONS
+ Images::Options.reset!
+ Images::Options.pages_per_dialog_that_have_size_options.should == Images::Options::DEFAULT_PAGES_PER_DIALOG_THAT_HAVE_SIZE_OPTIONS
+ end
+
+ it "should set pages_per_admin_index back to the default value" do
+ Images::Options.pages_per_admin_index.should == Images::Options::DEFAULT_PAGES_PER_ADMIN_INDEX
+ Images::Options.pages_per_admin_index += 1
+ Images::Options.pages_per_admin_index.should_not == Images::Options::DEFAULT_PAGES_PER_ADMIN_INDEX
+ Images::Options.reset!
+ Images::Options.pages_per_admin_index.should == Images::Options::DEFAULT_PAGES_PER_ADMIN_INDEX
+ end
end
end
end
|
Improve test coverage for options reset for images engine
|
diff --git a/lib/scamp.rb b/lib/scamp.rb
index abc1234..def5678 100644
--- a/lib/scamp.rb
+++ b/lib/scamp.rb
@@ -15,7 +15,7 @@ include Users
attr_accessor :channels, :user_cache, :channel_cache
- attr :matchers, :api_key, :subdomain
+ attr_accessor :matchers, :api_key, :subdomain
def initialize(options = {})
options ||= {}
|
Use attr_accessor to be 1.8 friendly
|
diff --git a/test/breadcrumb_test.rb b/test/breadcrumb_test.rb
index abc1234..def5678 100644
--- a/test/breadcrumb_test.rb
+++ b/test/breadcrumb_test.rb
@@ -5,6 +5,8 @@ tracked_in 'tracking_key'
owns :a_owned_key
+
+ member_of_set :id => :a_set_of_things
end
before do
@@ -19,6 +21,10 @@
it 'can own a key' do
assert_equal [:a_owned_key], TestBreadcrumb.owned_keys
+ end
+
+ it 'can be a member of a set' do
+ assert_equal [[:id, :a_set_of_things]], TestBreadcrumb.member_of_sets
end
it 'will register tracked keys in tracked_in' do
|
Add test 'can be a member of a set'
|
diff --git a/lib/utils.rb b/lib/utils.rb
index abc1234..def5678 100644
--- a/lib/utils.rb
+++ b/lib/utils.rb
@@ -8,7 +8,7 @@ results = []
blocks.each do |b|
info = yield b
- results.push(*info)
+ results.concat [*info]
end
results
end
|
Use concat instead of push to avoid stack too deep error
array.push *foo will break if foo is too long, because it adds each item to the stack.
|
diff --git a/lib/carto/visualization_invalidation_service.rb b/lib/carto/visualization_invalidation_service.rb
index abc1234..def5678 100644
--- a/lib/carto/visualization_invalidation_service.rb
+++ b/lib/carto/visualization_invalidation_service.rb
@@ -2,7 +2,7 @@ class VisualizationInvalidationService
def initialize(visualization)
@visualization = visualization
- @invalidate_affected_maps = false
+ @invalidate_affected_visualizations = false
end
def invalidate
@@ -12,7 +12,7 @@ end
def with_invalidation_of_affected_visualizations
- @invalidate_affected_maps = true
+ @invalidate_affected_visualizations = true
self
end
|
Use the same variable for affected visualization invalidation
|
diff --git a/lib/ventriloquist/cap/linux/rvm_install_ruby.rb b/lib/ventriloquist/cap/linux/rvm_install_ruby.rb
index abc1234..def5678 100644
--- a/lib/ventriloquist/cap/linux/rvm_install_ruby.rb
+++ b/lib/ventriloquist/cap/linux/rvm_install_ruby.rb
@@ -6,7 +6,7 @@ def self.rvm_install_ruby(machine, version)
if ! machine.communicate.test("rvm list | grep #{version}")
machine.env.ui.info("Installing Ruby #{version}")
- machine.communicate.sudo("rvm install #{version}")
+ machine.communicate.execute("rvm install #{version}")
# FIXME: THIS IS DEBIAN SPECIFIC
machine.communicate.sudo("apt-get install -y libxslt1-dev")
end
|
Revert "Fix ruby installation with RVM"
This reverts commit 37eab68f0e31a6f4d5e1191920cebe43f3f79ecc.
|
diff --git a/test/core_ext/name_error_extension_test.rb b/test/core_ext/name_error_extension_test.rb
index abc1234..def5678 100644
--- a/test/core_ext/name_error_extension_test.rb
+++ b/test/core_ext/name_error_extension_test.rb
@@ -37,11 +37,3 @@ assert_equal 1, error.to_s.scan("Did you mean?").count
end
end
-
-class DeprecatedIgnoreCallersTest < Minitest::Test
- def test_ignore
- assert_output nil, "IGNORED_CALLERS has been deprecated and has no effect.\n" do
- DidYouMean::IGNORED_CALLERS << /( |`)do_not_correct_typo'/
- end
- end
-end
|
Remove the test for a deprecated feature
|
diff --git a/test/decorators/update_json_decorator_test.rb b/test/decorators/update_json_decorator_test.rb
index abc1234..def5678 100644
--- a/test/decorators/update_json_decorator_test.rb
+++ b/test/decorators/update_json_decorator_test.rb
@@ -20,7 +20,9 @@ end
it "has the date published" do
- @parsed_json["created_at"].must_equal(@update.created_at)
+ json_time = Time.parse(@parsed_json["created_at"])
+
+ json_time.to_i.must_equal(@update.created_at.to_i)
end
it "has the url to just that update" do
|
Make a test comparing times use seconds since the epoch to avoid dealing with date formats
|
diff --git a/test/cookbooks/python-webapp-test/metadata.rb b/test/cookbooks/python-webapp-test/metadata.rb
index abc1234..def5678 100644
--- a/test/cookbooks/python-webapp-test/metadata.rb
+++ b/test/cookbooks/python-webapp-test/metadata.rb
@@ -6,4 +6,4 @@ long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '1.0.0'
-depends 'python-webapp-cookbook'
+depends 'python-webapp'
|
Update dependencies for cookbook name change
|
diff --git a/app/controllers/sprangular/products_controller.rb b/app/controllers/sprangular/products_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/sprangular/products_controller.rb
+++ b/app/controllers/sprangular/products_controller.rb
@@ -1,6 +1,7 @@ class Sprangular::ProductsController < Sprangular::BaseController
def index
- @products = product_scope.where("spree_prices.amount IS NOT NULL").where("spree_prices.currency" => current_currency) unless Spree::Config.show_products_without_price
+ @products = product_scope
+ @products = @products.where("spree_prices.amount IS NOT NULL").where("spree_prices.currency" => current_currency) unless Spree::Config.show_products_without_price
@products = @products.ransack(params[:q]).result if params[:q]
@products = @products.distinct.page(params[:page]).per(params[:per_page])
@cache_key = [I18n.locale, @current_user_roles.include?('admin'), current_currency, params[:q], params[:per_page], params[:per_page]]
|
Fix bug in products/controller when `Config.show_products_without_price == true`
|
diff --git a/vendor/engines/c2po/app/models/purchase_order_account.rb b/vendor/engines/c2po/app/models/purchase_order_account.rb
index abc1234..def5678 100644
--- a/vendor/engines/c2po/app/models/purchase_order_account.rb
+++ b/vendor/engines/c2po/app/models/purchase_order_account.rb
@@ -12,13 +12,14 @@ desc
end
-
def self.need_reconciling(facility)
- account_ids = OrderDetail.joins(:order, :account).
- select('DISTINCT(order_details.account_id) AS account_id').
- where('orders.facility_id = ? AND accounts.type = ? AND order_details.state = ? AND statement_id IS NOT NULL', facility.id, model_name, 'complete').
- all
-
- find(account_ids.collect{|a| a.account_id})
+ where(id: OrderDetail
+ .joins(:order, :account)
+ .select('DISTINCT(order_details.account_id) AS account_id')
+ .where('orders.facility_id' => facility.id)
+ .where('accounts.type' => model_name)
+ .where('order_details.state' => 'complete')
+ .where('statement_id IS NOT NULL')
+ .pluck(:account_id))
end
end
|
Bring PurchaseOrderAccount in line with CreditCardAccount
|
diff --git a/bosh_agent/lib/bosh_agent/platform/ubuntu/password.rb b/bosh_agent/lib/bosh_agent/platform/ubuntu/password.rb
index abc1234..def5678 100644
--- a/bosh_agent/lib/bosh_agent/platform/ubuntu/password.rb
+++ b/bosh_agent/lib/bosh_agent/platform/ubuntu/password.rb
@@ -4,13 +4,10 @@ class Platform::Ubuntu::Password
def update(settings)
- if bosh_settings = settings['env']['bosh']
-
- # TODO - also support user/password hash override
- if bosh_settings['password']
- update_passwords(bosh_settings['password'])
- end
-
+ bosh_settings = settings['env']['bosh']
+ # TODO - also support user/password hash override
+ if bosh_settings['password']
+ update_passwords(bosh_settings['password'])
end
end
|
Fix bug if statement(always true)
The if statement in platform/ubuntu/password.rb is always true.
|
diff --git a/core/app/interactors/interactors/channels/add_fact.rb b/core/app/interactors/interactors/channels/add_fact.rb
index abc1234..def5678 100644
--- a/core/app/interactors/interactors/channels/add_fact.rb
+++ b/core/app/interactors/interactors/channels/add_fact.rb
@@ -9,7 +9,7 @@ command :"channels/add_fact", @fact, @channel
if @fact.site
- command :'site/add_top_topic', @fact.site.id.to_i, @channel.topic.id.to_s
+ command :'site/add_top_topic', @fact.site.id.to_i, @channel.topic.slug_title
end
command :create_activity, @channel.created_by, :added_fact_to_channel, @fact, @channel
|
Fix adding of top topic to site, use slug_title instead of id
|
diff --git a/DeskAPIClient.podspec b/DeskAPIClient.podspec
index abc1234..def5678 100644
--- a/DeskAPIClient.podspec
+++ b/DeskAPIClient.podspec
@@ -5,8 +5,8 @@ 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", :branch => 'tickets/APIC-127-remove-dependency-on-main-queue-for-api-callbacks' }
- s.platform = :ios, '7.0'
+ s.source = { :git => "https://github.com/forcedotcom/DeskApiClient-ObjC.git", :branch => 'develop' }
+ s.platform = :ios, '8.0'
s.source_files = 'DeskAPIClient/DeskAPIClient/*.{h,m}', 'DeskAPIClient/DeskAPIClient/**/*.{h,m}'
s.requires_arc = true
end
|
Change podfile to point to develop branch.
|
diff --git a/test/spec/write_spec.rb b/test/spec/write_spec.rb
index abc1234..def5678 100644
--- a/test/spec/write_spec.rb
+++ b/test/spec/write_spec.rb
@@ -23,8 +23,8 @@ end
assert event_ids == %w(
- 00000001-0000-0000-0000-000000000000
- 00000002-0000-0000-0000-000000000000
+ 00000001-4000-8000-0000-000000000000
+ 00000002-4000-8000-0000-000000000000
)
end
end
|
Update test to account for updated id format in controls.
|
diff --git a/test/unit/round_test.rb b/test/unit/round_test.rb
index abc1234..def5678 100644
--- a/test/unit/round_test.rb
+++ b/test/unit/round_test.rb
@@ -43,4 +43,9 @@ r.expire_time = now - 2.hours
assert_equal 0, r.seconds_left
end
+
+ test "winner returns nil if no donations" do
+ round = Round.new
+ assert_nil round.winner
+ end
end
|
Test Round.winner returns nil if no donations
|
diff --git a/lib/blaze.rb b/lib/blaze.rb
index abc1234..def5678 100644
--- a/lib/blaze.rb
+++ b/lib/blaze.rb
@@ -1,7 +1,32 @@-require "torrent/blaze/version"
+require "blaze/version"
+require "optparse"
+module Blaze
+ class CLI
+ def start
+ options = {}
+ opt_parse = OptionParser.new do |opt|
+ opt.banner = "Usage: opt_parser COMMAND [OPTIONS]"
+ opt.separator ""
+ opt.separator "Commands"
+ opt.separator " torrent: magnet uri link"
+ opt.separator ""
+ opt.separator "Options"
-module Torrent
- module Blaze
- # Your code goes here...
- end
+ opt.on("-t", "--torrent TORRENT", "Magnet uri link to a torrent") do |torrent|
+ options[:torrent] = torrent
+ end
+
+ opt.on("-o", "--output Download Directory", "Path to downaload directory") do |output|
+ options[:output] = output
+ end
+
+ opt.on("-h","--help","help") do
+ puts opt_parser
+ end
+
+ opt_parser.parse!
+ end
+
+ end
+ end
end
|
Add optparsing to CLI class
|
diff --git a/app/controllers/subscribem/accounts_controller.rb b/app/controllers/subscribem/accounts_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/subscribem/accounts_controller.rb
+++ b/app/controllers/subscribem/accounts_controller.rb
@@ -8,12 +8,15 @@ end
def create
account = Subscribem::Account.create(account_params)
+ env['warden'].set_user(account.owner, scope: :user)
+ env['warden'].set_user(account, scope: :account)
flash[:success] = "Your account has been successfully created."
redirect_to subscribem.root_url
end
private
def account_params
- params.require(:account).permit(:name)
+ params.require(:account).permit(:name, {owner_attributes: [
+ :email, :password, :password_confirmation ]})
end
end
end
|
Set warden with account and user info
|
diff --git a/lib/day09.rb b/lib/day09.rb
index abc1234..def5678 100644
--- a/lib/day09.rb
+++ b/lib/day09.rb
@@ -7,17 +7,15 @@ end
def parse_day9_lines(lines, default_distance)
- graph = Hash.new(default_distance)
- lines.each do |line|
+ lines.reduce(Hash.new(default_distance)) do |graph, line|
parts = line.split
city1 = parts[0]
city2 = parts[2]
distance = parts[4]
graph[[city1, city2]] = distance.to_i
graph[[city2, city1]] = distance.to_i
+ graph
end
-
- graph
end
def path_lengths(graph)
|
Make day 9 a bit more functional.
|
diff --git a/app/serializers/trade/taxon_concept_serializer.rb b/app/serializers/trade/taxon_concept_serializer.rb
index abc1234..def5678 100644
--- a/app/serializers/trade/taxon_concept_serializer.rb
+++ b/app/serializers/trade/taxon_concept_serializer.rb
@@ -1,3 +1,7 @@ class Trade::TaxonConceptSerializer < ActiveModel::Serializer
attributes :id, :full_name, :author_year, :rank_name
+
+ def full_name
+ object.full_name + " (#{object.name_status})"
+ end
end
|
Include name_status on the trade admin interface
|
diff --git a/lib/ditty/helpers/authentication.rb b/lib/ditty/helpers/authentication.rb
index abc1234..def5678 100644
--- a/lib/ditty/helpers/authentication.rb
+++ b/lib/ditty/helpers/authentication.rb
@@ -9,8 +9,7 @@ module Authentication
def current_user
return anonymous_user if current_user_id.nil?
- @users ||= Hash.new { |h, k| h[k] = User[k] }
- @users[current_user_id]
+ User[current_user_id]
end
def current_user=(user)
@@ -37,15 +36,13 @@ end
def logout
- env['rack.session'].delete('user_id')
+ env['rack.session'].delete('user_id') unless env['rack.session'].nil?
+ env.delete('omniauth.auth')
end
def anonymous_user
- return @anonymous_user if defined? @anonymous_user
- @anonymous_user ||= begin
- role = ::Ditty::Role.where(name: 'anonymous').first
- ::Ditty::User.where(roles: role).first unless role.nil?
- end
+ role = ::Ditty::Role.where(name: 'anonymous').first
+ ::Ditty::User.where(roles: role).first unless role.nil?
end
end
|
chore: Remove memoization from Authentication helper.
This is an attempt to make ditty more thread safe. If you need caching, using memcache or something
|
diff --git a/lib/yurei.rb b/lib/yurei.rb
index abc1234..def5678 100644
--- a/lib/yurei.rb
+++ b/lib/yurei.rb
@@ -4,13 +4,22 @@ module Yurei
class << self
-
+
def phantomjs_path
- bin_path = File.join vendor_path, 'phantomjs', '1.7.0', 'macosx', 'bin', 'phantomjs'
+ bin_path = File.join vendor_path, 'phantomjs', '1.7.0'
+
+ case platform
+ when 'linux' then
+ bin_path = File.join bin_path, 'linux-x86_64', 'bin', 'phantomjs'
+ when 'darwin' then
+ bin_path = File.join bin_path, 'macosx', 'bin', 'phantomjs'
+ end
+
+ bin_path
end
def casperjs_path
- cj_path = File.join vendor_path, 'casperjs'
+ File.join vendor_path, 'casperjs'
end
def vendor_path
@@ -21,6 +30,14 @@ File.dirname(File.dirname(File.expand_path(__FILE__)))
end
+ def platform
+ case RbConfig::CONFIG['host_os'].downcase
+ when /linux/ then 'linux'
+ when /darwin/ then 'darwin'
+ else 'unsupported'
+ end
+ end
+
end
end
|
Added: Support for 64-bit Ubuntu Lucid (10.04)
|
diff --git a/i18n_alchemy.gemspec b/i18n_alchemy.gemspec
index abc1234..def5678 100644
--- a/i18n_alchemy.gemspec
+++ b/i18n_alchemy.gemspec
@@ -14,9 +14,8 @@
s.rubyforge_project = "i18n_alchemy"
- s.files = `git ls-files`.split("\n")
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
+ s.files = Dir["CHANGELOG.md", "MIT-LICENSE", "README.md", "lib/**/*"]
+ s.test_files = Dir["test/**/*"]
s.require_paths = ["lib"]
s.add_dependency "activerecord", "~> 3.0"
|
Change gemspec to avoid subshells [ci skip]
More information at
http://tenderlovemaking.com/2011/12/05/profiling-rails-startup-with-dtrace/
Thanks @rafaelfranca
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.