diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
---|---|
diff --git a/test/controllers/gobierto_people/people_controller_test.rb b/test/controllers/gobierto_people/people_controller_test.rb
index abc1234..def5678 100644
--- a/test/controllers/gobierto_people/people_controller_test.rb
+++ b/test/controllers/gobierto_people/people_controller_test.rb
@@ -0,0 +1,79 @@+# frozen_string_literal: true
+
+require "test_helper"
+
+class GobiertoPeople::PeopleeControllerTest < GobiertoControllerTest
+
+ def setup
+ %w(agendas gifts invitations trips).each do |submodule|
+ enable_submodule(site, submodule)
+ end
+ super
+ end
+
+ def site
+ @site_with_module_enabled ||= sites(:madrid)
+ end
+
+ def person
+ @person ||= gobierto_people_people(:richard)
+ end
+
+ def set_default_dates(options = {})
+ conf = site.configuration
+ conf.raw_configuration_variables = <<-YAML
+gobierto_people_default_filter_start_date: "#{options[:start_date]}"
+gobierto_people_default_filter_end_date: "#{options[:end_date]}"
+ YAML
+ site.save
+ end
+
+ def wide_date_range_params
+ @wide_date_range_params ||= { start_date: 10.years.ago.strftime("%Y-%m-%d"), end_date: 10.years.from_now.strftime("%Y-%m-%d") }
+ end
+
+ def test_redirect_without_default_dates
+ with_current_site(site) do
+ get gobierto_people_person_path(person.slug)
+ assert_response :success
+
+ person.events.destroy_all
+ person.received_gifts.destroy_all
+ person.invitations.destroy_all
+
+ get gobierto_people_person_path(person.slug)
+ assert_response :success
+
+ person.trips.destroy_all
+
+ get gobierto_people_person_path(person.slug)
+ assert_response :success
+ end
+ end
+
+ def test_redirect_with_default_dates
+ with_current_site(site) do
+ set_default_dates(wide_date_range_params)
+ get gobierto_people_person_path(person.slug)
+ assert_response :success
+
+ person.events.destroy_all
+
+ get gobierto_people_person_path(person.slug)
+ assert_response :success
+
+
+ person.events.destroy_all
+ person.invitations.destroy_all
+ person.trips.destroy_all
+
+ get gobierto_people_person_path(person.slug)
+ assert_response :redirect
+ assert_redirected_to(gobierto_people_person_gifts_path(@person.slug))
+
+ get gobierto_people_person_path(person.slug, start_date: "2012-01-01", end_date: "2019-01-01")
+ assert_response :redirect
+ assert_redirected_to(gobierto_people_person_gifts_path(@person.slug, start_date: "2012-01-01", end_date: "2019-01-01"))
+ end
+ end
+end
|
Add tests for redirections on person show
|
diff --git a/autorun.rb b/autorun.rb
index abc1234..def5678 100644
--- a/autorun.rb
+++ b/autorun.rb
@@ -0,0 +1,14 @@+mtimes = {}
+
+loop do
+ Dir.glob("*.{rb,csv}") do |path|
+ mtime = File.mtime(path)
+ if mtimes[path].nil? or
+ mtimes[path] != mtime
+ system("ruby", "test-calculator.rb")
+ mtimes[path] = mtime
+ end
+ end
+
+ sleep 1
+end
|
Revert "Remove a needless file"
This reverts commit 1c1e8f3caf32bd75fdb6ee9a84d0a7e580f0467b.
Because I still need you.
|
diff --git a/roles/rails.rb b/roles/rails.rb
index abc1234..def5678 100644
--- a/roles/rails.rb
+++ b/roles/rails.rb
@@ -1,3 +1,3 @@ name 'rails'
description 'This role configures a Rails stack using Unicorn'
-run_list "recipe[apt]", "recipe[build-essential]", "recipe[percona_mysql]", "recipe[packages]", "recipe[ruby_build]", "recipe[bundler]", "recipe[bluepill]", "recipe[nginx]", "recipe[rails]", "recipe[ruby_build]", "recipe[rbenv::user]", "recipe[backup]", "recipe[rails::databases]", "recipe[git]", "recipe[ssh_deploy_keys]", "recipe[wkhtmltopdf]", "recipe[postfix]"
+run_list "recipe[apt]", "recipe[build-essential]", "recipe[percona_mysql]", "recipe[packages]", "recipe[bundler]", "recipe[bluepill]", "recipe[nginx]", "recipe[rails]", "recipe[ruby_build]", "recipe[rbenv::user]", "recipe[backup]", "recipe[rails::databases]", "recipe[git]", "recipe[ssh_deploy_keys]", "recipe[wkhtmltopdf]", "recipe[postfix]"
|
Remove duplicate recipe from run_list.
|
diff --git a/app/controllers/api/v2/root_controller.rb b/app/controllers/api/v2/root_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/api/v2/root_controller.rb
+++ b/app/controllers/api/v2/root_controller.rb
@@ -23,13 +23,11 @@ end
def not_found
- resp = {
- meta: {
- status: 404,
- notice: "Resource does not exist."
- }
- }
- respond_with resp, status: 200
+ add_error(
+ type: :routing,
+ message: "Resource could not be found. Are you sure this is what you're looking for?"
+ )
+ respond_with_resource(nil, status: 404)
end
end
|
Use the right conventions for the not_found endpoint.
|
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -17,4 +17,10 @@ # Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
+
+ # If a User is denied access for an action, return them back to the last page they could view.
+ rescue_from CanCan::AccessDenied do |exception|
+ flash[:error] = "#{exception}"
+ redirect_to root_path
+ end
end
|
Add rescue action for CanCan::AccessDenied
|
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -1,3 +1,13 @@ class ApplicationController < ActionController::Base
protect_from_forgery
+
+ def after_sign_in_path_for(resource)
+ lists_path
+ end
+
+
+
+
end
+
+
|
Change redirect on sign in to lists_path
|
diff --git a/lib/markdown-ui/tag/tag_klass.rb b/lib/markdown-ui/tag/tag_klass.rb
index abc1234..def5678 100644
--- a/lib/markdown-ui/tag/tag_klass.rb
+++ b/lib/markdown-ui/tag/tag_klass.rb
@@ -0,0 +1,38 @@+class TagKlass
+ def content
+ @content.strip unless @content.nil?
+ end
+
+ def klass
+ MarkdownUI::KlassUtil.new(@klass).klass unless @klass.nil?
+ end
+
+ def _id
+ if @id
+ " id=\'#{@id.split.join('-')}\'"
+ end
+ end
+
+ def data
+ if @data
+ _data, attribute, value = @data.split(':')
+ " data-#{attribute}=\'#{value}\'"
+ else
+ nil
+ end
+ end
+
+ def _input_id
+ if @id
+ " placeholder=\'#{@id.capitalize}\'"
+ end
+ end
+
+ def input_content
+ if @content
+ " type=\'#{@content.strip.downcase}\'"
+ else
+ nil
+ end
+ end
+end
|
[Refactor] Move common/shared methods to a superclass
|
diff --git a/lib/pgbackups-archive/storage.rb b/lib/pgbackups-archive/storage.rb
index abc1234..def5678 100644
--- a/lib/pgbackups-archive/storage.rb
+++ b/lib/pgbackups-archive/storage.rb
@@ -10,11 +10,11 @@
def connection
Fog::Storage.new({
- provider: "AWS",
- aws_access_key_id: ENV["PGBACKUPS_AWS_ACCESS_KEY_ID"],
- aws_secret_access_key: ENV["PGBACKUPS_AWS_SECRET_ACCESS_KEY"],
- region: ENV["PGBACKUPS_REGION"],
- persistent: false
+ :provider => "AWS",
+ :aws_access_key_id => ENV["PGBACKUPS_AWS_ACCESS_KEY_ID"],
+ :aws_secret_access_key => ENV["PGBACKUPS_AWS_SECRET_ACCESS_KEY"],
+ :region => ENV["PGBACKUPS_REGION"],
+ :persistent => false
})
end
@@ -23,7 +23,7 @@ end
def store
- bucket.files.create key: @key, body: @file, :public => false
+ bucket.files.create :key => @key, :body => @file, :public => false
end
end
|
Use Ruby 1.8-compatible hash syntax
|
diff --git a/lib/earth/fuel/greenhouse_gas.rb b/lib/earth/fuel/greenhouse_gas.rb
index abc1234..def5678 100644
--- a/lib/earth/fuel/greenhouse_gas.rb
+++ b/lib/earth/fuel/greenhouse_gas.rb
@@ -4,4 +4,10 @@ data_miner do
tap "Brighter Planet's greenhouse gas data", Earth.taps_server
end
+
+ class << self
+ def [](abbreviation)
+ find_by_abbreviation abbreviation.to_s
+ end
+ end
end
|
Allow GreenhouseGas lookup using GreenhouseGas[abbreviation]
|
diff --git a/parser.gemspec b/parser.gemspec
index abc1234..def5678 100644
--- a/parser.gemspec
+++ b/parser.gemspec
@@ -24,4 +24,5 @@ spec.add_development_dependency 'bundler', '~> 1.3'
spec.add_development_dependency 'rake', '~> 10.0'
spec.add_development_dependency 'racc'
+ spec.add_development_dependency 'minitest', '~> 4.7.0'
end
|
Use modern minitest from rubygems
The minitest shipped with ruby does not have all assertions.
|
diff --git a/lib/poise_ruby/ruby_providers.rb b/lib/poise_ruby/ruby_providers.rb
index abc1234..def5678 100644
--- a/lib/poise_ruby/ruby_providers.rb
+++ b/lib/poise_ruby/ruby_providers.rb
@@ -19,7 +19,7 @@
module PoiseRuby
- # Inversion providers for the ruby resource.
+ # Inversion providers for the ruby_runtime resource.
#
# @since 2.0.0
module RubyProviders
|
Update comment for new name.
|
diff --git a/api/app/models/sections.rb b/api/app/models/sections.rb
index abc1234..def5678 100644
--- a/api/app/models/sections.rb
+++ b/api/app/models/sections.rb
@@ -1,4 +1,5 @@ class Section < Sequel::Model(:sections)
+ include Length
include StartYear
many_to_one :line
@@ -9,18 +10,6 @@
def city
self.line.city
- end
-
- def srid
- city.srid || 3857
- end
-
- def set_length
- self.length = self.calculate_length
- end
-
- def calculate_length
- Sequel.lit("ST_Length(ST_Transform(geometry, #{self.srid}))::int")
end
def feature
|
Revert "Adds length hotfix to Section"
This reverts commit ccb3fdf9ff39b00ae24439d733046d7e08bf1d87.
|
diff --git a/lib/resque/server/test_helper.rb b/lib/resque/server/test_helper.rb
index abc1234..def5678 100644
--- a/lib/resque/server/test_helper.rb
+++ b/lib/resque/server/test_helper.rb
@@ -3,11 +3,11 @@
module Resque
module TestHelper
- class Test::Unit::TestCase
+ class ActiveSupport::TestCase
include Rack::Test::Methods
def app
Resque::Server.new
- end
+ end
def self.should_respond_with_success
test "should respond with success" do
|
Use ActiveSupport::TestCase for resque/web test helper
|
diff --git a/BHCDatabase/test/models/question_test.rb b/BHCDatabase/test/models/question_test.rb
index abc1234..def5678 100644
--- a/BHCDatabase/test/models/question_test.rb
+++ b/BHCDatabase/test/models/question_test.rb
@@ -1,7 +1,40 @@ require 'test_helper'
+# QuestionTest is the generic model test for a question.
class QuestionTest < ActiveSupport::TestCase
- # test "the truth" do
- # assert true
- # end
+ def setup
+ @question = questions(:one)
+ end
+
+ test 'should be valid' do
+ assert @question.valid?
+ end
+
+ test 'question should be present' do
+ @question.question = ''
+ assert_not @question.valid?
+ end
+
+ test "question shouldn't be too long" do
+ @question.question = 'a' * 65_537
+ assert_not @question.valid?
+ end
+
+ test 'visible should be present' do
+ @question.visible = nil
+ assert_not @question.valid?
+ end
+
+ test 'question_type should be present' do
+ @question.question_type = nil
+ assert_not @question.valid?
+ end
+
+ test 'question should be unique' do
+ @duplicate_question = @question.dup
+ assert @duplicate_question.question == @question.question
+ assert_no_difference 'Question.count' do
+ @duplicate_question.save
+ end
+ end
end
|
Add model tests for question.
|
diff --git a/spec/ifd_spec.rb b/spec/ifd_spec.rb
index abc1234..def5678 100644
--- a/spec/ifd_spec.rb
+++ b/spec/ifd_spec.rb
@@ -0,0 +1,17 @@+require 'file_data/formats/exif/ifd'
+require 'file_data/formats/exif/exif_stream'
+require 'support/test_stream'
+
+RSpec.describe FileData::Ifd do
+ let(:exif) { FileData::Ifd.new(FileData::ExifStream.new(stream)) }
+ let(:bytes) do
+ [0, 0] #empty ifd
+ end
+ let(:stream) { TestStream.get_stream(bytes) }
+
+ context 'when given an empty ifd' do
+ it 'returns an empty array of tags' do
+ expect(exif.tags.to_a).to be_empty
+ end
+ end
+end
|
Improve test coverage for ifd.rb
|
diff --git a/bosh-director/lib/bosh/director/api/cloud_config_manager.rb b/bosh-director/lib/bosh/director/api/cloud_config_manager.rb
index abc1234..def5678 100644
--- a/bosh-director/lib/bosh/director/api/cloud_config_manager.rb
+++ b/bosh-director/lib/bosh/director/api/cloud_config_manager.rb
@@ -21,21 +21,24 @@ private
def validate_manifest!(cloud_config)
- # FIXME: pass in null ip/networking objects
- # these objects won't work if you actually try to reserve IPs with them since the cloud_planner is empty,
- # but we really just need to validate the manifest, we don't care about the subnets being able to reserve IPs here
- cloud_planner = Bosh::Director::DeploymentPlan::CloudPlanner.new({
- networks: [],
- disk_pools: [],
- availability_zones: [],
- resource_pools: [],
- compilation: nil,
- })
- ip_provider_factory = Bosh::Director::DeploymentPlan::IpProviderFactory.new(cloud_planner.model, Config.logger, global_networking: cloud_planner.using_global_networking?)
- global_network_resolver = Bosh::Director::DeploymentPlan::GlobalNetworkResolver.new(cloud_planner)
+ # FIXME: we really just need to validate the manifest, we don't care about the subnets being able to reserve IPs here
+ ip_provider_factory = NullIpProviderFactory.new
+ global_network_resolver = NullGlobalNetworkResolver.new
parser = Bosh::Director::DeploymentPlan::CloudManifestParser.new(Config.logger)
_ = parser.parse(cloud_config.manifest, ip_provider_factory, global_network_resolver) # valid if this doesn't blow up
+ end
+
+ class NullIpProviderFactory
+ def create(*args)
+ nil
+ end
+ end
+
+ class NullGlobalNetworkResolver
+ def reserved_legacy_ranges(something)
+ []
+ end
end
end
end
|
Make bad dependencies more obvious
Use null objects since we're not expecting them to be used for anything.
We need the IpProviderFactory and GlobalNetworkResolver when parsing so
we can give subnets an IpProvider. This is kind of crazy, especially in
api/cloud_config_manager where we're really just trying to validate a
manifest, not reserve any IPs.
IP reservation probably needs a refactor so that parsing no longer
depends on these objects.
Signed-off-by: Luke Woydziak <[email protected]>
|
diff --git a/test/test_once.rb b/test/test_once.rb
index abc1234..def5678 100644
--- a/test/test_once.rb
+++ b/test/test_once.rb
@@ -28,4 +28,23 @@ assert_equal 2, n
end
+ def test_once_recursive
+ n = 0
+ @loop.add_once {
+ n += 1
+ @loop.add_once {
+ n += 1
+ @loop.add_once(0.1) {
+ n += 1
+ @loop.quit
+ }
+ }
+
+ @loop.add_once { n += 1 }
+ }
+
+ @loop.run
+ assert_equal 4, n
+ end
+
end
|
Add some tests for recursive add_once
|
diff --git a/lib/reporter/writers/circonus.rb b/lib/reporter/writers/circonus.rb
index abc1234..def5678 100644
--- a/lib/reporter/writers/circonus.rb
+++ b/lib/reporter/writers/circonus.rb
@@ -5,15 +5,22 @@ class Circonus
attr_reader :uri
- ::OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
-
def initialize(url)
@uri = URI(url)
end
def write(body)
- Net::HTTP.start(uri.hostname, uri.port) do |http|
+ Net::HTTP.start(uri.hostname, uri.port, http_options) do |http|
+ http.use_ssl = true if uri.scheme == 'https'
http.request_post(uri.path, body)
+ end
+ rescue Zlib::BufError
+ end
+
+ def http_options
+ {}.tap do |options|
+ options[:use_ssl] = uri.scheme == 'https'
+ options[:verify_mode] = OpenSSL::SSL::VERIFY_NONE
end
end
end
|
Include http options to net/http to allow ssl to work
Circonus http trap link to the IP address of the enterprise
broker, so cert validation is not going to work
|
diff --git a/lib/spontaneous/rack/back/map.rb b/lib/spontaneous/rack/back/map.rb
index abc1234..def5678 100644
--- a/lib/spontaneous/rack/back/map.rb
+++ b/lib/spontaneous/rack/back/map.rb
@@ -15,10 +15,14 @@ if content_model::Page.count == 0
406
else
- path = params[:splat].first
+ path = remove_trailing_slashes(params[:splat].first)
page = site[path]
json site.map(page.id)
end
end
+
+ def remove_trailing_slashes(path)
+ path.gsub(/\/+$/, '')
+ end
end
end
|
Remove trailing slashes before looking up pages
|
diff --git a/lib/travis/build/script/perl6.rb b/lib/travis/build/script/perl6.rb
index abc1234..def5678 100644
--- a/lib/travis/build/script/perl6.rb
+++ b/lib/travis/build/script/perl6.rb
@@ -17,14 +17,22 @@ sh.echo 'Please open any issues at https://github.com/travis-ci/travis-ci/issues/new', ansi: :red
sh.echo 'Installing Rakudo (MoarVM)', ansi: :yellow
- sh.cmd 'git clone https://github.com/rakudo/rakudo.git'
- sh.cmd 'cd rakudo'
- sh.cmd 'sudo perl Configure.pl --backends=moar --gen-nqp --gen-moar --prefix=/usr'
- sh.cmd 'sudo make install'
+ sh.cmd 'git clone https://github.com/tadzik/rakudobrew.git $HOME/.rakudobrew'
+ sh.export 'PATH', '$HOME/.rakudobrew/bin:$PATH', echo: false
+ end
+
+ def export
+ super
+ sh.export 'TRAVIS_PERL6_VERSION', version, echo: false
end
def setup
super
+ if version == "latest"
+ sh.cmd 'rakudobrew build moar', assert: false
+ else
+ sh.cmd "rakudobrew triple #{version} #{version} #{version}", assert: false
+ end
end
def announce
@@ -39,6 +47,13 @@ sh.cmd 'make test'
end
+ def cache_slug
+ super << '--perl6-' << version
+ end
+
+ def version
+ config[:perl6].to_s
+ end
end
end
end
|
Rewrite build script to use rakudobrew
rakudobrew is like perlbrew for Perl6 and is able to build individual
Perl6 versions which the previous code was not able to do. This makes the
script now more flexible, and can accept
perl6:
- 2015.04
- latest
in the `.travis.yml` file.
|
diff --git a/config/initializers/constants.rb b/config/initializers/constants.rb
index abc1234..def5678 100644
--- a/config/initializers/constants.rb
+++ b/config/initializers/constants.rb
@@ -4,4 +4,4 @@ MAX_LOCATION_RESULTS = 10
# how many supporters to display initially
-SUPPORTER_MAX = 1+SUPPORTER_MAX = 4
|
Change default supporters to 4
|
diff --git a/config/initializers/dragonfly.rb b/config/initializers/dragonfly.rb
index abc1234..def5678 100644
--- a/config/initializers/dragonfly.rb
+++ b/config/initializers/dragonfly.rb
@@ -6,8 +6,6 @@ datastore :file,
root_path: Rails.root.join('uploads/pictures').to_s,
store_meta: false
- url_format '/pictures/:job/:basename.:format'
- url_path_prefix Alchemy::MountPoint.get
end
# Attachments
|
Remove the Dragonfly url_format configuration
It is not used anyway and relies on the Alchemy mount point, which is not availble while initializing the app. That makes it impossible to install alchemy in the app.
|
diff --git a/scss_lint.gemspec b/scss_lint.gemspec
index abc1234..def5678 100644
--- a/scss_lint.gemspec
+++ b/scss_lint.gemspec
@@ -28,5 +28,5 @@ s.add_dependency 'rake', '~> 10.0'
s.add_dependency 'sass', '~> 3.4.15'
- s.add_development_dependency 'rspec', '~> 3.3.0'
+ s.add_development_dependency 'rspec', '~> 3.4.0'
end
|
Upgrade RSpec to 3.4.x series for Travis builds
|
diff --git a/spec/buildr/jaxb_xjc/jaxb_xjc_spec.rb b/spec/buildr/jaxb_xjc/jaxb_xjc_spec.rb
index abc1234..def5678 100644
--- a/spec/buildr/jaxb_xjc/jaxb_xjc_spec.rb
+++ b/spec/buildr/jaxb_xjc/jaxb_xjc_spec.rb
@@ -0,0 +1,30 @@+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
+
+XSD_FILE = File.expand_path(File.dirname(__FILE__) + '/../../fixtures/wildfire-1.3.xsd')
+
+describe "Buildr::JaxbXjc" do
+ describe "compiled with specified xsd" do
+ before do
+ @foo = define "foo" do
+ project.version = "2.1.3"
+ compile.from compile_jaxb(XSD_FILE, "-quiet", :package => "org.foo.api")
+ package :jar
+ end
+ task('compile').invoke
+ end
+
+ it "produce .java files in the correct location" do
+ File.should be_exist(@foo._("target/generated/jaxb/org/foo/api/Agency.java"))
+ File.should be_exist(@foo._("target/generated/jaxb/org/foo/api/LatLongCoordinate.java"))
+ File.should be_exist(@foo._("target/generated/jaxb/org/foo/api/ObjectFactory.java"))
+ File.should be_exist(@foo._("target/generated/jaxb/org/foo/api/Wildfire.java"))
+ end
+
+ it "produce .class files in the correct location" do
+ File.should be_exist(@foo._("target/classes/org/foo/api/Agency.class"))
+ File.should be_exist(@foo._("target/classes/org/foo/api/LatLongCoordinate.class"))
+ File.should be_exist(@foo._("target/classes/org/foo/api/ObjectFactory.class"))
+ File.should be_exist(@foo._("target/classes/org/foo/api/Wildfire.class"))
+ end
+ end
+end
|
Add some basic specs for extension
|
diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/api_controller.rb
+++ b/app/controllers/api_controller.rb
@@ -5,7 +5,9 @@
def change_query_order
unless params[:order] == nil
- @@order = params[:order].to_sym
+ order_direction = params[:order].split(".")
+
+ @@order = (order_direction.length == 1) ? order_direction[0].to_sym : "#{order_direction[0]} #{order_direction[1]}"
end
end
end
|
Add Control Over Order Direction In URL For API
|
diff --git a/app/controllers/rdb_controller.rb b/app/controllers/rdb_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/rdb_controller.rb
+++ b/app/controllers/rdb_controller.rb
@@ -37,14 +37,6 @@ def show
end
- def update
- if !(err = @board.engine.update(params)).eql?(true) # Error hash
- render status: 422, json: {errors: err}
- else
- render json: @board
- end
- end
-
def context
board.sources.first.context
end
|
Remove old update method from RdbController.
* Method was moved to Rdb::BoardsController (API).
|
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -1,2 +1,17 @@ module ApplicationHelper
+
+ # Set class on active navigation items
+ def nav_link(text, link)
+ recognized = Rails.application.routes.recognize_path(link)
+ if recognized[:controller] == params[:controller] && recognized[:action] == params[:action]
+ content_tag(:li, :class => "active") do
+ link_to( text, link)
+ end
+ else
+ content_tag(:li) do
+ link_to( text, link)
+ end
+ end
+ end
+
end
|
Add helper to set class on active navigation items
|
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -1,3 +1,17 @@ # The parent helper for all helpers
module ApplicationHelper
+ def bootstrap_class_for(flash_type)
+ case flash_type
+ when 'success'
+ 'success' # Green
+ when 'error'
+ 'danger' # Red
+ when 'alert'
+ 'warning' # Yellow
+ when 'notice'
+ 'info' # Blue
+ else
+ flash_type
+ end
+ end
end
|
Change flash messages to bootstrap class
|
diff --git a/ice_nine.gemspec b/ice_nine.gemspec
index abc1234..def5678 100644
--- a/ice_nine.gemspec
+++ b/ice_nine.gemspec
@@ -9,7 +9,7 @@ gem.email = [ '[email protected]' ]
gem.description = 'Deep Freeze Ruby Objects'
gem.summary = gem.description
- gem.homepage = "https://github.com/dkubb/ice_nine"
+ gem.homepage = 'https://github.com/dkubb/ice_nine'
gem.require_paths = %w[ lib ]
gem.files = `git ls-files`.split("\n")
|
Change double quotes to single quotes
|
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -20,7 +20,8 @@ end
def markdown(text)
- opts = { :fenced_code_blocks => true }
- Redcarpet::Markdown.new(MarkdownHTML, opts).render(text).html_safe
+ extensions = { :fenced_code_blocks => true }
+ render_opts = { :filter_html => true, :no_styles => true, :safe_links_only => true }
+ Redcarpet::Markdown.new(MarkdownHTML.new(render_opts), extensions).render(text).html_safe
end
end
|
Make markdown a bit safer
|
diff --git a/app/helpers/social_meta_helper.rb b/app/helpers/social_meta_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/social_meta_helper.rb
+++ b/app/helpers/social_meta_helper.rb
@@ -3,7 +3,7 @@ if Symbol === content
tag(:meta, property: "og:#{name}", content: t(content, interpolation.merge(scope: :'metadata.open_graph')))
elsif name == 'image'
- tag(:meta, property: "og:image", content: path_to_image(content))
+ tag(:meta, property: "og:image", content: url_to_image(content))
else
tag(:meta, property: "og:#{name}", content: content)
end
@@ -13,7 +13,7 @@ if Symbol === content
tag(:meta, name: "twitter:#{name}", content: t(content, interpolation.merge(scope: :'metadata.twitter')))
elsif name == 'image'
- tag(:meta, name: "twitter:image", content: path_to_image(content))
+ tag(:meta, name: "twitter:image", content: url_to_image(content))
else
tag(:meta, name: "twitter:#{name}", content: content)
end
|
Fix bug where open graph and Twitter cards expect an image URL
not a path (even though they figure it out ;)
|
diff --git a/app/models/appendable/reaction.rb b/app/models/appendable/reaction.rb
index abc1234..def5678 100644
--- a/app/models/appendable/reaction.rb
+++ b/app/models/appendable/reaction.rb
@@ -10,7 +10,7 @@ before_destroy do
Notification.denotify parent.user, self unless parent.user == user
user.decrement! :smiled_count
- answer.decrement! :smile_count
+ parent.decrement! :smile_count
end
def notification_type(*_args)
|
Replace usage of `answer` in `before_destroy` of Reaction with `parent`
|
diff --git a/app/models/manager_refresh/dto.rb b/app/models/manager_refresh/dto.rb
index abc1234..def5678 100644
--- a/app/models/manager_refresh/dto.rb
+++ b/app/models/manager_refresh/dto.rb
@@ -1,13 +1,13 @@ module ManagerRefresh
class Dto
- attr_reader :dto_collection, :data
+ attr_reader :dto_collection, :data, :object
delegate :manager_ref, :to => :dto_collection
def initialize(dto_collection, data)
@dto_collection = dto_collection
- # TODO(lsmola) filter the data according to attributes and throw exception using non recognized attr
@data = data
+ @built_data = nil
end
def manager_uuid
@@ -15,7 +15,7 @@ end
def id
- data[:id]
+ object.id
end
def [](key)
@@ -26,15 +26,29 @@ data[key] = value
end
- def object
- data[:_object]
+ def load
+ object
+ end
+
+ def build_object(built_object)
+ self.object = built_object
+ end
+
+ def save
+ ret = object.save
+ object.send(:clear_association_cache)
+ ret
end
def attributes
+ unless dto_collection.attributes_blacklist.blank?
+ data.delete_if { |key, _value| dto_collection.attributes_blacklist.include?(key) }
+ end
+
data.transform_values! do |value|
- if value.kind_of? ::ManagerRefresh::DtoLazy
+ if loadable?(value)
value.load
- elsif value.kind_of?(Array) && value.any? { |x| x.kind_of? ::ManagerRefresh::DtoLazy }
+ elsif value.kind_of?(Array) && value.any? { |x| loadable?(x) }
value.compact.map(&:load).compact
else
value
@@ -49,5 +63,15 @@ def inspect
to_s
end
+
+ private
+
+ def object=(built_object)
+ @object = built_object
+ end
+
+ def loadable?(value)
+ value.kind_of?(::ManagerRefresh::DtoLazy) || value.kind_of?(::ManagerRefresh::Dto)
+ end
end
end
|
Make DTO properly loadable and saveable
Make DTO properly loadable and saveable. Obtaining attributes
is getting rid of blacklisted attrs.
|
diff --git a/lib/vhdl_connector/presenters.rb b/lib/vhdl_connector/presenters.rb
index abc1234..def5678 100644
--- a/lib/vhdl_connector/presenters.rb
+++ b/lib/vhdl_connector/presenters.rb
@@ -4,7 +4,7 @@ class EntityPresenter
extend Forwardable
def_instance_delegators :@entity,
- :name, :generics, :ports
+ :name, :generics, :ports, :local_name
def initialize(entity_wrapper)
@entity = entity_wrapper
end
|
Add delegate local_name to entity_wrapper
|
diff --git a/private_pub.ru b/private_pub.ru
index abc1234..def5678 100644
--- a/private_pub.ru
+++ b/private_pub.ru
@@ -0,0 +1,10 @@+# Run with: rackup private_pub.ru -s thin -E production
+require "bundler/setup"
+require "yaml"
+require "faye"
+require "private_pub"
+
+Faye::WebSocket.load_adapter('thin')
+
+PrivatePub.load_config(File.expand_path("../config/private_pub.yml", __FILE__), ENV["RAILS_ENV"] || "development")
+
|
Fix getting back to heroku
|
diff --git a/core/spec/models/tracker_spec.rb b/core/spec/models/tracker_spec.rb
index abc1234..def5678 100644
--- a/core/spec/models/tracker_spec.rb
+++ b/core/spec/models/tracker_spec.rb
@@ -1,6 +1,6 @@ require 'spec_helper'
-describe Tracker do
+describe Spree::Tracker do
context "validations" do
it { should have_valid_factory(:tracker) }
|
Fix reference in Tracker spec
|
diff --git a/lib/engineyard/version.rb b/lib/engineyard/version.rb
index abc1234..def5678 100644
--- a/lib/engineyard/version.rb
+++ b/lib/engineyard/version.rb
@@ -1,4 +1,4 @@ module EY
- VERSION = '2.0.9'
+ VERSION = '2.0.10.pre'
ENGINEYARD_SERVERSIDE_VERSION = ENV['ENGINEYARD_SERVERSIDE_VERSION'] || '2.0.3'
end
|
Add .pre for next release
|
diff --git a/app/models/concerns/devise_guest/user_concern.rb b/app/models/concerns/devise_guest/user_concern.rb
index abc1234..def5678 100644
--- a/app/models/concerns/devise_guest/user_concern.rb
+++ b/app/models/concerns/devise_guest/user_concern.rb
@@ -3,7 +3,7 @@ extend ActiveSupport::Concern
included do
- belongs_to :owner_user, class_name: "User"
+ belongs_to :owner_user, class_name: "User", optional: true
has_many :guest_users, class_name: "User", foreign_key: :owner_user_id
end
|
Mark owner as optional (Rails 5.2)
|
diff --git a/lib/puppet/type/mongodb_database.rb b/lib/puppet/type/mongodb_database.rb
index abc1234..def5678 100644
--- a/lib/puppet/type/mongodb_database.rb
+++ b/lib/puppet/type/mongodb_database.rb
@@ -5,7 +5,7 @@
newparam(:name, :namevar=>true) do
desc "The name of the database."
- newvalues(/^\w+$/)
+ newvalues(/^(\w|-)+$/)
end
newparam(:tries) do
|
Allow hyphens in database names.
|
diff --git a/lib/travis/api/app/endpoint/logs.rb b/lib/travis/api/app/endpoint/logs.rb
index abc1234..def5678 100644
--- a/lib/travis/api/app/endpoint/logs.rb
+++ b/lib/travis/api/app/endpoint/logs.rb
@@ -7,7 +7,9 @@ # Fetches a log by its *id*.
get '/:id' do |id|
result = service(:find_log, params).run
- if result && params[:cors_hax] && result.archived? && result.respond_to?(:archived_url)
+ halt 404 if result.nil?
+
+ if params[:cors_hax] && result.archived? && result.respond_to?(:archived_url)
redirect result.archived_url, 307
else
respond_with result
|
Halt early if no log is found
|
diff --git a/ext/integration.rb b/ext/integration.rb
index abc1234..def5678 100644
--- a/ext/integration.rb
+++ b/ext/integration.rb
@@ -20,9 +20,9 @@ end
#run_test("-r test.ar myfile")
-#run_test("-t test.ar")
+run_test("-t test.ar")
run_test("-tv test.ar")
-#run_test("-p test.ar")
-#run_test("-pv test.ar")
-#run_test("-x test.ar")
-#run_test("-xv test.ar")
+run_test("-p test.ar")
+run_test("-pv test.ar")
+run_test("-x test.ar")
+run_test("-xv test.ar")
|
Enable all tests that pass
|
diff --git a/name_resolution/name_resolver.rb b/name_resolution/name_resolver.rb
index abc1234..def5678 100644
--- a/name_resolution/name_resolver.rb
+++ b/name_resolution/name_resolver.rb
@@ -5,10 +5,20 @@ default: 8.8.8.8
resolve_address:
default: google.com
+ timeout:
+ default: 30
EOS
+ # Doesn't work :(
+ TIMEOUT=77
def build_report
resolver = Resolv::DNS.new(:nameserver => [option(:nameserver)])
+
+ # Only Ruby >= 2.0.0 supports setting a timeout.
+ # Without this DNS timeouts will raise a PluginTimeoutError
+ if resolver.respond_to? :timeouts=
+ resolver.timeouts = option(:timeout)
+ end
begin
resolver.getaddress(option(:resolve_address))
|
Set timeout for newer ruby versions
|
diff --git a/lib/devise/models/suspendable.rb b/lib/devise/models/suspendable.rb
index abc1234..def5678 100644
--- a/lib/devise/models/suspendable.rb
+++ b/lib/devise/models/suspendable.rb
@@ -27,21 +27,21 @@ suspended? ? :suspended : super
end
- # Suspends the user in the database.
+ # Return value is checked, so don't raise
+ # error on validation failures
+ # rubocop:disable Rails/SaveBang
def suspend(reason)
- self.reason_for_suspension = reason
- self.suspended_at = Time.zone.now
GovukStatsd.increment("users.suspend")
- save!
+ update(reason_for_suspension: reason,
+ suspended_at: Time.zone.now)
end
+ # rubocop:enable Rails/SaveBang
- # un-suspends the user in the database.
def unsuspend
- self.reason_for_suspension = nil
- self.suspended_at = nil
- self.unsuspended_at = Time.zone.now
- self.password = SecureRandom.hex
- save!
+ update(password: SecureRandom.hex,
+ unsuspended_at: Time.zone.now,
+ suspended_at: nil,
+ reason_for_suspension: nil)
end
def suspended?
|
Fix buggy auto-correct for Rails/SaveBang
The return value of these methods is checked for validation errors,
so we should not throw an exception here.
|
diff --git a/lib/geocoder/lookups/mapquest.rb b/lib/geocoder/lookups/mapquest.rb
index abc1234..def5678 100644
--- a/lib/geocoder/lookups/mapquest.rb
+++ b/lib/geocoder/lookups/mapquest.rb
@@ -3,10 +3,6 @@
module Geocoder::Lookup
class Mapquest < Base
-
- def map_link_url(coordinates)
- "http://www.openstreetmap.org/?lat=#{coordinates[0]}&lon=#{coordinates[1]}&zoom=15&layers=M"
- end
private # ---------------------------------------------------------------
|
Remove map_link_url (was for wrong provider).
|
diff --git a/lib/public_body_categories_en.rb b/lib/public_body_categories_en.rb
index abc1234..def5678 100644
--- a/lib/public_body_categories_en.rb
+++ b/lib/public_body_categories_en.rb
@@ -17,8 +17,11 @@ "Health Boards",
[ "dhb", "District Health Board", "District Health Board"],
"Schools",
+ [ "contributing_school", "Contributing schools", "Primary schools" ],
[ "primary_school", "Primary schools", "Primary schools" ],
[ "secondary_school", "Secondary schools", "Secondary schools"],
+ [ "composite_school", "Composite schools", "Composite schools"],
+ [ "private_school", "Private schools", "Private schools"],
[ "university", "University", "University"],
"Popular agencies",
[ "popular_agency", "Popular agencies", "Popular agencies"]
|
Update categories to include private, contributing, composite schools
|
diff --git a/lib/workerholic/job_processor.rb b/lib/workerholic/job_processor.rb
index abc1234..def5678 100644
--- a/lib/workerholic/job_processor.rb
+++ b/lib/workerholic/job_processor.rb
@@ -18,6 +18,9 @@ StatsStorage.update_historical_stats('completed_jobs', job.klass.to_s)
# @logger.info("Completed: your job from class #{job.klass} was completed on #{job.statistics.completed_at}.")
+
+ # forces AR to release idle connections back to the pool
+ ActiveRecord::Base.clear_active_connections! if defined?(Rails)
job_result
rescue Exception => e
|
Fix for ActiveRecord connections timeout
|
diff --git a/lib/active_enumerable.rb b/lib/active_enumerable.rb
index abc1234..def5678 100644
--- a/lib/active_enumerable.rb
+++ b/lib/active_enumerable.rb
@@ -8,7 +8,6 @@ require "active_enumerable/scope_method"
require "active_enumerable/scopes"
require "active_enumerable/where"
-require "active_enumerable/find"
require "active_enumerable/queries"
require "active_enumerable/english_dsl"
|
Remove require for deleted file
|
diff --git a/lib/autotest/discover.rb b/lib/autotest/discover.rb
index abc1234..def5678 100644
--- a/lib/autotest/discover.rb
+++ b/lib/autotest/discover.rb
@@ -3,6 +3,7 @@ if ENV['AUTOFEATURE'] =~ /true/i
"cucumber"
elsif ENV['AUTOFEATURE'] =~ /false/i
+ # noop
else
puts "(Not running features. To run features in autotest, set AUTOFEATURE=true.)"
end
|
Make autotest code a bit clearer
|
diff --git a/lib/paperclip-defaults.rb b/lib/paperclip-defaults.rb
index abc1234..def5678 100644
--- a/lib/paperclip-defaults.rb
+++ b/lib/paperclip-defaults.rb
@@ -15,7 +15,8 @@ paperclip_options = ::Rails.application.config.paperclip_defaults.merge(options)
if paperclip_options[:default_asset_url]
begin
- paperclip_options[:default_url] = ActionController::Base.new.view_context.asset_path(paperclip_options[:default_asset_url])
+ default_asset_url = paperclip_options[:default_asset_url].respond_to?(:call) ? paperclip_options[:default_asset_url].call : paperclip_options[:default_asset_url]
+ paperclip_options[:default_url] = ActionController::Base.new.view_context.asset_path(default_asset_url)
rescue StandardError => e
::Rails.logger.warn("Could not set default asset url for '#{paperclip_options[:default_asset_url]}'")
end
|
Allow Proc for default_asset_url option
|
diff --git a/lib/ppcurses/form/form.rb b/lib/ppcurses/form/form.rb
index abc1234..def5678 100644
--- a/lib/ppcurses/form/form.rb
+++ b/lib/ppcurses/form/form.rb
@@ -27,10 +27,12 @@
def set_selected_element(new_element)
- if @selected_element.nil?
- @selected_element = new_element
+
+ unless @selected_element.nil?
+ @selected_element.selected=false
end
+ @selected_element = new_element
@selected_element.selected=true
end
@@ -39,6 +41,7 @@ def handle_input
set_selected_element(@elements[0])
+ show
while 1
c = @win.getch
@@ -51,13 +54,15 @@ end
if c == KEY_UP
- #@selected_element = @selected_element - 1
- # TODO -- give focus to previous element
+ selected_index = @elements.index(@selected_element)
+ set_selected_element(@elements[selected_index-1])
+ show
end
if c == KEY_DOWN
- #@selected_element = @selected_element + 1
- # TODO -- check bounds/use datastructure
+ selected_index = @elements.index(@selected_element)
+ set_selected_element(@elements[selected_index+1])
+ show
end
# @sub_menu.handle_menu_selection(c) if not_processed && @sub_menu
|
Allow selection back and forth. No range checking yet.
|
diff --git a/spec/helper.rb b/spec/helper.rb
index abc1234..def5678 100644
--- a/spec/helper.rb
+++ b/spec/helper.rb
@@ -15,6 +15,8 @@ require 'dotenv'
Dotenv.load
+ENV["API_KEY"] ||= "thisisisapikey"
+ENV["SHARED_SECRET"] ||= "thisisisisisshared_secret"
#WebMock.disable_net_connect!(:allow => 'coveralls.io')
|
Add default API_KEY, SHARED_SECRET for travis ci.
|
diff --git a/app/controllers/dashboards_controller.rb b/app/controllers/dashboards_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/dashboards_controller.rb
+++ b/app/controllers/dashboards_controller.rb
@@ -2,6 +2,6 @@ before_action :authenticate_user!
def show
- @posts = Post.all
+ @posts = Post.all.includes(:user)
end
end
|
Use ActiveRecord's includes finder to avoid N+1 problem
|
diff --git a/src/fieri/app/controllers/fieri/jobs_controller.rb b/src/fieri/app/controllers/fieri/jobs_controller.rb
index abc1234..def5678 100644
--- a/src/fieri/app/controllers/fieri/jobs_controller.rb
+++ b/src/fieri/app/controllers/fieri/jobs_controller.rb
@@ -4,9 +4,10 @@ class JobsController < ApplicationController
def create
CookbookWorker.perform_async(job_params)
- render text: "ok"
+ render json: { status: 'ok' }.to_json
rescue ActionController::ParameterMissing => e
- render status: 400, text: "Error: #{e.message}"
+ render status: 400, json: { status: 'error',
+ message: e.message }
end
private
|
Change to JSON responses from /jobs
|
diff --git a/lib/yourls/requestable.rb b/lib/yourls/requestable.rb
index abc1234..def5678 100644
--- a/lib/yourls/requestable.rb
+++ b/lib/yourls/requestable.rb
@@ -3,7 +3,6 @@ require 'rest_client'
def already_shortened?
- binding.pry
regex = Regexp.new(domain)
@url =~ regex
end
@@ -46,7 +45,6 @@ def host
config.api_endpoint
end
-<<<<<<< HEAD
def domain
config.domain
@@ -55,7 +53,5 @@ def config
Yourls::Configuration
end
-=======
->>>>>>> 5993439... Add primary code
end
end
|
Remove binding.pry and resolve merge conflict
|
diff --git a/spec/models/notification_subscriptions_spec.rb b/spec/models/notification_subscriptions_spec.rb
index abc1234..def5678 100644
--- a/spec/models/notification_subscriptions_spec.rb
+++ b/spec/models/notification_subscriptions_spec.rb
@@ -4,7 +4,7 @@ let(:property) { FactoryGirl.create(:property) }
context "given a normal web form create (non-bulk)" do
it "calls the send_confirmation_email callback" do
- NotificationSubscription.any_instance.stub(:send_confirmation_email).and_return(:confirmation_email_sent)
+ NotificationSubscription.any_instance.stub(:send_confirmation_email)
@ns = NotificationSubscription.new(:property_id => property.id, :email => "[email protected]")
@ns.should_receive(:send_confirmation_email)
@ns.save
@@ -12,7 +12,7 @@ end
context "given the intent to insert without confirmation emails" do
it "can create a subscription without triggering an email" do
- NotificationSubscription.any_instance.stub(:send_confirmation_email).and_return(:confirmation_email_sent)
+ NotificationSubscription.any_instance.stub(:send_confirmation_email)
@ns = NotificationSubscription.new(:property_id => property.id, :email => "[email protected]", :bulk_added => true)
@ns.should_not_receive(:send_confirmation_email)
@ns.save
|
Remove some extraneously chained calls in the stubbing for the notification subscription tests
|
diff --git a/core/enumerator/next_spec.rb b/core/enumerator/next_spec.rb
index abc1234..def5678 100644
--- a/core/enumerator/next_spec.rb
+++ b/core/enumerator/next_spec.rb
@@ -24,4 +24,15 @@ @enum.rewind
@enum.next.should == 1
end
+
+ it "restarts the enumerator if an exception terminated a previous iteration" do
+ exception = StandardError.new
+ enum = Enumerator.new do
+ raise exception
+ end
+
+ result = 2.times.map { enum.next rescue $! }
+
+ result.should == [exception, exception]
+ end
end
|
Add spec for restarting failed enumerator
See jruby/jruby#6157 for a CSV test that failed due to this
missing behavior in JRuby, specifically the comments here:
https://github.com/jruby/jruby/issues/6157#issuecomment-619200136
|
diff --git a/spec/save_spec.rb b/spec/save_spec.rb
index abc1234..def5678 100644
--- a/spec/save_spec.rb
+++ b/spec/save_spec.rb
@@ -20,10 +20,4 @@ allow(game).to receive(:wrong_entry).and_return(true)
end
end
-
- context 'load_data' do
- it 'returns array' do
- expect(save.load_data[3]).to eq 7
- end
- end
end
|
Add tests for save and files dependent on it
|
diff --git a/ghq.rb b/ghq.rb
index abc1234..def5678 100644
--- a/ghq.rb
+++ b/ghq.rb
@@ -8,6 +8,8 @@
version HOMEBREW_GHQ_VERSION
head 'https://github.com/motemen/ghq', :using => :git, :branch => 'master'
+
+ option 'without-completions', 'Disable zsh completions'
if build.head?
depends_on 'go' => :build
@@ -22,6 +24,10 @@
ENV['GOPATH'] = gopath
system 'make', 'BUILD_FLAGS=-o ghq'
+
+ if build.with? 'completions'
+ zsh_completion.install 'zsh/_ghq'
+ end
end
bin.install 'ghq'
|
Install zsh completion by default
|
diff --git a/lib/munge/core/source.rb b/lib/munge/core/source.rb
index abc1234..def5678 100644
--- a/lib/munge/core/source.rb
+++ b/lib/munge/core/source.rb
@@ -15,8 +15,7 @@ end
def build(**args)
- pruned_args = args.select { |k, v| %i(relpath content frontmatter stat).include?(k) }
- @item_factory.build(**pruned_args)
+ @item_factory.build(**prune_args(args))
end
def each
@@ -35,6 +34,12 @@ def [](id)
@items[id]
end
+
+ private
+
+ def prune_args(args)
+ args.select { |k, v| %i(relpath content frontmatter stat).include?(k) }
+ end
end
end
end
|
Refactor pruned_args into its own method
|
diff --git a/lib/pay/braintree/api.rb b/lib/pay/braintree/api.rb
index abc1234..def5678 100644
--- a/lib/pay/braintree/api.rb
+++ b/lib/pay/braintree/api.rb
@@ -2,7 +2,7 @@ module Braintree
module Api
def self.set_api_keys
- environment = get_key_for(:environment)
+ environment = get_key_for(:environment, "sandbox")
merchant_id = get_key_for(:merchant_id)
public_key = get_key_for(:public_key)
private_key = get_key_for(:private_key)
@@ -15,12 +15,12 @@ )
end
- def self.get_key_for(name)
+ def self.get_key_for(name, default="")
env = Rails.env.to_sym
secrets = Rails.application.secrets
credentials = Rails.application.credentials
- secrets.dig(env, :braintree, name) || credentials.dig(env, :braintree, name) || ENV["BRAINTREE_#{name.upcase}"]
+ secrets.dig(env, :braintree, name) || credentials.dig(env, :braintree, name) || ENV["BRAINTREE_#{name.upcase}"] || default
end
end
end
|
Add default for braintree gateway
|
diff --git a/lib/sinja/sequel/core.rb b/lib/sinja/sequel/core.rb
index abc1234..def5678 100644
--- a/lib/sinja/sequel/core.rb
+++ b/lib/sinja/sequel/core.rb
@@ -14,7 +14,11 @@ c.conflict_exceptions << ::Sequel::ConstraintViolation
c.not_found_exceptions << ::Sequel::NoMatchingRow
c.validation_exceptions << ::Sequel::ValidationFailed
- c.validation_formatter = ->(e) { e.errors.keys.zip(e.errors.full_messages) }
+ c.validation_formatter = proc do |e|
+ lookup = e.model.class.associations.to_set
+ e.errors.keys.zip(e.errors.full_messages)
+ .map { |a| a << :relationships if lookup.include?(a.first) }
+ end
end
base.prepend Pagination if ::Sequel::Model.db.dataset.respond_to?(:paginate)
|
Enhance validation formatter to indicate relationships
|
diff --git a/config/schedule.rb b/config/schedule.rb
index abc1234..def5678 100644
--- a/config/schedule.rb
+++ b/config/schedule.rb
@@ -34,3 +34,7 @@ every :weekday, at: '0.00am' do
runner "ClosePetitionsJob.perform_later"
end
+
+every :weekday, at: '0.00am' do
+ runner "DebatedPetitionsJob.perform_later"
+end
|
Mark petitions as debated every midnight
|
diff --git a/ruboty.gemspec b/ruboty.gemspec
index abc1234..def5678 100644
--- a/ruboty.gemspec
+++ b/ruboty.gemspec
@@ -20,7 +20,7 @@ spec.add_dependency "bundler"
spec.add_dependency "dotenv"
spec.add_dependency "mem"
- spec.add_dependency "slop"
+ spec.add_dependency "slop", '~> 3'
spec.add_development_dependency "codeclimate-test-reporter", ">= 0.3.0"
spec.add_development_dependency "rake"
spec.add_development_dependency "rspec", "2.14.1"
|
Use slop v3 becouse v4 does not have compatibility with pry
|
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 = 'evt-schema'
s.summary = "Primitives for schema and structure"
- s.version = '0.7.0.0'
+ s.version = '0.7.1.0'
s.description = ' '
s.authors = ['The Eventide Project']
|
Package version is increased from 0.7.0.0 to 0.7.0.1
|
diff --git a/lib/crepe/versioning/endpoint.rb b/lib/crepe/versioning/endpoint.rb
index abc1234..def5678 100644
--- a/lib/crepe/versioning/endpoint.rb
+++ b/lib/crepe/versioning/endpoint.rb
@@ -2,6 +2,7 @@
module Crepe
module Versioning
+ # Crepe::Endpoint needs a format override.
module Endpoint
# The most acceptable format requested, e.g. +:json+.
#
|
Add explanatory comment to Crepe::Versioning::Endpoint
Signed-off-by: David Celis <[email protected]>
|
diff --git a/test/integration/urgent_cases_test.rb b/test/integration/urgent_cases_test.rb
index abc1234..def5678 100644
--- a/test/integration/urgent_cases_test.rb
+++ b/test/integration/urgent_cases_test.rb
@@ -0,0 +1,31 @@+require 'test_helper'
+
+class UrgentCasesTest < ActionDispatch::IntegrationTest
+ before do
+ Capybara.current_driver = :poltergeist
+ @patient = create :patient, name: 'Susan Everyteen'
+ @pregnancy = create :pregnancy, patient: @patient, urgent_flag: true
+ @user = create :user
+ log_in_as @user
+ end
+
+ after do
+ Capybara.use_default_driver
+ end
+
+ describe 'urgent cases section' do
+ it 'should not let you add urgent cases to call list' do
+ within :css, '#urgent_pregnancies_content' do
+ assert has_text? @patient.name
+ refute has_link? 'Add'
+ end
+ end
+
+ it 'should not let you remove urgent cases' do
+ within :css, '#urgent_pregnancies_content' do
+ assert has_text? @patient.name
+ refute has_link? 'Remove'
+ end
+ end
+ end
+end
|
Add integration test for urgent_cases with add/remove link test
|
diff --git a/spec/racket.rb b/spec/racket.rb
index abc1234..def5678 100644
--- a/spec/racket.rb
+++ b/spec/racket.rb
@@ -11,8 +11,9 @@ SimpleCov.formatter = SimpleCov::Formatter::Codecov
end
-TEST_DEFAULT_APP_DIR = File.absolute_path(File.join(File.dirname(__FILE__), 'test_default_app'))
-TEST_CUSTOM_APP_DIR = File.absolute_path(File.join(File.dirname(__FILE__), 'test_custom_app'))
+TEST_DIR = File.absolute_path(File.dirname(__FILE__))
+TEST_DEFAULT_APP_DIR = File.join(TEST_DIR, 'test_default_app')
+TEST_CUSTOM_APP_DIR = File.join(TEST_DIR, 'test_custom_app')
require 'racket'
@@ -22,9 +23,9 @@ require 'rack/test'
require 'bacon'
-require_relative '_request.rb'
+require File.join(TEST_DIR, '_request.rb')
-Dir.chdir(TEST_DEFAULT_APP_DIR) { require_relative '_default.rb' }
-Dir.chdir(TEST_CUSTOM_APP_DIR) { require_relative '_custom.rb' }
+Dir.chdir(TEST_DEFAULT_APP_DIR) { require File.join(TEST_DIR, '_default.rb') }
+Dir.chdir(TEST_CUSTOM_APP_DIR) { require File.join(TEST_DIR, '_custom.rb') }
-require_relative '_invalid.rb'
+require File.join(TEST_DIR, '_invalid.rb')
|
Fix strange path brokenness in test suite on JRuby 9000
|
diff --git a/lib/api_logging.rb b/lib/api_logging.rb
index abc1234..def5678 100644
--- a/lib/api_logging.rb
+++ b/lib/api_logging.rb
@@ -1,4 +1,4 @@-class ApiLogging
+module ApiLogging
extend ActiveSupport::Concern
API_LOGGER = ActiveSupport::TaggedLogging.new(Rails.logger)
|
Switch ApiLogging to be a module
|
diff --git a/sippy_cup.gemspec b/sippy_cup.gemspec
index abc1234..def5678 100644
--- a/sippy_cup.gemspec
+++ b/sippy_cup.gemspec
@@ -18,7 +18,7 @@ s.require_paths = ["lib"]
s.add_runtime_dependency 'packetfu'
- s.add_runtime_dependency 'nokogiri', ["~> 1.5.0"]
+ s.add_runtime_dependency 'nokogiri', ["~> 1.6.0"]
s.add_development_dependency 'guard-rspec'
s.add_development_dependency 'rspec', ["~> 2.11"]
|
Update Nokogiri version to 1.6.0
|
diff --git a/xcodeproj.gemspec b/xcodeproj.gemspec
index abc1234..def5678 100644
--- a/xcodeproj.gemspec
+++ b/xcodeproj.gemspec
@@ -4,15 +4,15 @@ Gem::Specification.new do |s|
s.name = "xcodeproj"
s.version = Xcodeproj::VERSION
- s.date = "2011-11-10"
+ s.date = Date.today
s.license = "MIT"
s.email = "[email protected]"
s.homepage = "https://github.com/cocoapods/xcodeproj"
s.authors = ["Eloy Duran"]
- s.summary = "Create and modify Xcode projects from MacRuby."
+ s.summary = "Create and modify Xcode projects from Ruby."
s.description = %(
- Xcodeproj lets you create and modify Xcode projects from MacRuby. Script
+ Xcodeproj lets you create and modify Xcode projects from Ruby. Script
boring management tasks or build Xcode-friendly libraries. Also includes
support for Xcode workspaces (.xcworkspace) and configuration files (.xcconfig).
).strip.gsub(/\s+/, ' ')
|
Remove MacRuby references from gemspec.
|
diff --git a/lib/build/icons.rb b/lib/build/icons.rb
index abc1234..def5678 100644
--- a/lib/build/icons.rb
+++ b/lib/build/icons.rb
@@ -8,6 +8,7 @@ file = Build.icons_path + "#{team.slug}.png"
unless file.exist?
+ next if team.logo.start_with?("http://na.lolesports.com")
puts "Downloading #{team.logo}"
body = URI.parse("http://am-a.akamaihd.net/image/?f=#{team.logo}&resize=50:50").read
img = Magick::Image.from_blob(body)[0]
|
Fix error loading invalid icon
|
diff --git a/test/integration/compute/instance_groups/test_instance_group_managers.rb b/test/integration/compute/instance_groups/test_instance_group_managers.rb
index abc1234..def5678 100644
--- a/test/integration/compute/instance_groups/test_instance_group_managers.rb
+++ b/test/integration/compute/instance_groups/test_instance_group_managers.rb
@@ -1,7 +1,7 @@ require "helpers/integration_test_helper"
require "integration/factories/instance_group_manager_factory"
-class TestInstanceGroupManager < FogIntegrationTest
+class TestInstanceGroupManagers < FogIntegrationTest
include TestCollection
def setup
|
Fix a typo in IGM test class
|
diff --git a/lib/hashie/hash.rb b/lib/hashie/hash.rb
index abc1234..def5678 100644
--- a/lib/hashie/hash.rb
+++ b/lib/hashie/hash.rb
@@ -15,8 +15,8 @@ end
# The C geneartor for the json gem doesn't like mashies
- def to_json
- to_hash.to_json
+ def to_json(*args)
+ to_hash.to_json(*args)
end
end
end
|
Allow for arguments in to_json
|
diff --git a/lib/ruby_screen.rb b/lib/ruby_screen.rb
index abc1234..def5678 100644
--- a/lib/ruby_screen.rb
+++ b/lib/ruby_screen.rb
@@ -1,7 +1,9 @@ $:.unshift File.dirname(__FILE__)
require 'preferences_loader'
-require 'configuration/description'
-require 'configuration/generator'
+
+%w[description generator].each do |f|
+ require "configuration/#{f}"
+end
module RubyScreen
def self.process(arguments)
|
Refactor loading of RubyScreen::Configuration source
|
diff --git a/Library/Contributions/cmds/brew-tests.rb b/Library/Contributions/cmds/brew-tests.rb
index abc1234..def5678 100644
--- a/Library/Contributions/cmds/brew-tests.rb
+++ b/Library/Contributions/cmds/brew-tests.rb
@@ -0,0 +1,29 @@+require 'utils'
+
+Dir.chdir HOMEBREW_REPOSITORY + "Library/Homebrew/test"
+
+$tests_passed = true
+
+def test t
+ test_passed = system "/usr/bin/ruby test_#{t}.rb"
+ $tests_passed &&= test_passed
+ puts; puts "#" * 80; puts
+end
+
+test "bucket"
+test "formula"
+test "versions"
+test "checksums"
+test "inreplace"
+test "hardware"
+test "formula_install"
+test "patching"
+test "external_deps"
+test "pathname_install"
+test "utils"
+test "ARGV"
+test "ENV"
+test "updater"
+test "string"
+
+exit $tests_passed ? 0 : 1
|
Add brew tests command to run all unit tests.
|
diff --git a/recipes/write_graphite_plugin.rb b/recipes/write_graphite_plugin.rb
index abc1234..def5678 100644
--- a/recipes/write_graphite_plugin.rb
+++ b/recipes/write_graphite_plugin.rb
@@ -0,0 +1,29 @@+#
+# Copyright Peter Donald
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+include_recipe "collectd"
+
+execute "install collectd-write_graphite" do
+ command <<CMD
+cd /usr/src
+rm -rf collectd-write_graphite
+git clone [email protected]:jssjr/collectd-write_graphite.git collectd-write_graphite
+cd collectd-write_graphite
+make
+make install
+CMD
+ creates "#{node[:collectd][:plugin_dir]}/write_graphite.so"
+end
|
Introduce a recipe for write-graphite plugin
|
diff --git a/events_calendar_extension.rb b/events_calendar_extension.rb
index abc1234..def5678 100644
--- a/events_calendar_extension.rb
+++ b/events_calendar_extension.rb
@@ -7,11 +7,10 @@ url "http://github.com/davec/radiant-events-calendar-extension"
def activate
- admin.tabs.add "Events", "/admin/events", :after => "Layouts"
+ tab "Content" do
+ add_item "Events", "/admin/events", :after => "Pages"
+ end
Page.send :include, EventsCalendarTags
end
- def deactivate
- end
-
end
|
Update tabs for Radiant 0.9
|
diff --git a/test/helper.rb b/test/helper.rb
index abc1234..def5678 100644
--- a/test/helper.rb
+++ b/test/helper.rb
@@ -15,7 +15,7 @@ def test_configuration
@config ||= Dimples::Configuration.new(
'source_path' => File.join(__dir__, 'source'),
- 'destination_path' => File.join(__dir__, 'tmp', "dimples-#{Time.new.to_i}"),
+ 'destination_path' => File.join('tmp', "dimples-#{Time.new.to_i}"),
'categories' => [{ 'slug' => 'a', 'name' => 'A' }]
)
end
|
Tweak the destination path again.
|
diff --git a/test/helper.rb b/test/helper.rb
index abc1234..def5678 100644
--- a/test/helper.rb
+++ b/test/helper.rb
@@ -1,15 +1,16 @@ ENV["RAILS_ENV"] = "test"
-require File.expand_path("../../test/dummy/config/environment.rb", __FILE__)
+require File.expand_path("../../test/dummy/config/environment.rb", __FILE__)
require 'minitest/autorun'
require 'webmock/minitest'
+
+WebMock.disable_net_connect!(allow_localhost: true)
module MiniTest
class Test
def setup
WebMock.reset!
- WebMock.disable_net_connect!(allow_localhost: true)
ElasticRecord::Config.models.each do |model|
model.elastic_index.enable_deferring!
|
Move disable_net_connect outside of setup
|
diff --git a/db/migrate/20110113192701_add_file_meta_to_image.rb b/db/migrate/20110113192701_add_file_meta_to_image.rb
index abc1234..def5678 100644
--- a/db/migrate/20110113192701_add_file_meta_to_image.rb
+++ b/db/migrate/20110113192701_add_file_meta_to_image.rb
@@ -0,0 +1,19 @@+class AddFileMetaToImage < ActiveRecord::Migration
+ def self.up
+ change_table :images do |t|
+ t.integer :size # bytes
+ t.integer :width
+ t.integer :height
+ t.string :original_filename
+ end
+ end
+
+ def self.down
+ change_table :images do |t|
+ t.remove :size
+ t.remove :width
+ t.remove :height
+ t.remove :original_filename
+ end
+ end
+end
|
Add size, width, height, orig filename to image
|
diff --git a/leaflet-rails.gemspec b/leaflet-rails.gemspec
index abc1234..def5678 100644
--- a/leaflet-rails.gemspec
+++ b/leaflet-rails.gemspec
@@ -22,4 +22,8 @@ s.add_development_dependency "rspec"
s.add_development_dependency "simplecov-rcov"
s.add_development_dependency "pry"
+ s.add_development_dependency "actionpack", '>= 3.2.0'
+ s.add_development_dependency "activesupport", '>= 3.2.0'
+ s.add_development_dependency "activemodel", '>= 3.2.0'
+ s.add_development_dependency "railties", '>= 3.2.0'
end
|
Add the Rails stuff we need
|
diff --git a/lib/archive/tar/stream_reader.rb b/lib/archive/tar/stream_reader.rb
index abc1234..def5678 100644
--- a/lib/archive/tar/stream_reader.rb
+++ b/lib/archive/tar/stream_reader.rb
@@ -6,6 +6,8 @@ block_size: 2 ** 19,
reload_time: 32
}.merge(options)
+
+ stream = IO.new(stream) if io.is_a? Integer
if options[:compression] == :auto
raise "Automatic compression is not available for streams"
|
Allow fd's for StreamReader.initialize as stream
|
diff --git a/lib/finite_machine/async_call.rb b/lib/finite_machine/async_call.rb
index abc1234..def5678 100644
--- a/lib/finite_machine/async_call.rb
+++ b/lib/finite_machine/async_call.rb
@@ -2,25 +2,14 @@
module FiniteMachine
# An asynchronouse call representation
+ #
+ # Used internally by {EventQueue} to schedule events
+ #
+ # @api private
class AsyncCall
include Threadable
- attr_threadsafe :context
-
- attr_threadsafe :callable
-
- attr_threadsafe :arguments
-
- attr_threadsafe :block
-
- # Create an AsynCall
- #
- # @api private
- def initialize
- @mutex = Mutex.new
- end
-
- # Build asynchronous call instance
+ # Create asynchronous call instance
#
# @param [Object] context
# @param [Callable] callable
@@ -28,18 +17,18 @@ # @param [#call] block
#
# @example
- # AsyncCall.build(self, Callable.new(:method), :a, :b)
+ # AsyncCall.new(context, Callable.new(:method), :a, :b)
#
# @return [self]
#
# @api public
- def self.build(context, callable, *args, &block)
- instance = new
- instance.context = context
- instance.callable = callable
- instance.arguments = args
- instance.block = block
- instance
+ def initialize(context, callable, *args, &block)
+ @context = context
+ @callable = callable
+ @arguments = args.dup
+ @block = block
+ @mutex = Mutex.new
+ freeze
end
# Dispatch the event to the context
@@ -52,5 +41,15 @@ callable.call(context, *arguments, &block)
end
end
+
+ protected
+
+ attr_threadsafe :context
+
+ attr_threadsafe :callable
+
+ attr_threadsafe :arguments
+
+ attr_threadsafe :block
end # AsyncCall
end # FiniteMachine
|
Change async call to be immutable and simplify.
|
diff --git a/lib/relix/indexes/primary_key.rb b/lib/relix/indexes/primary_key.rb
index abc1234..def5678 100644
--- a/lib/relix/indexes/primary_key.rb
+++ b/lib/relix/indexes/primary_key.rb
@@ -7,7 +7,7 @@ end
def filter(r, object, value)
- !r.zrank(name, value)
+ !r.zscore(name, value)
end
def query(r, value)
|
Use redis command with a lower time complexity to filter primary key indexes.
zrank is O(log(N)): http://redis.io/commands/zrank
zscore is O(1): http://redis.io/commands/zscore
|
diff --git a/lib/timezone_parser/zone_info.rb b/lib/timezone_parser/zone_info.rb
index abc1234..def5678 100644
--- a/lib/timezone_parser/zone_info.rb
+++ b/lib/timezone_parser/zone_info.rb
@@ -18,12 +18,8 @@ self
end
- def isValid?(name)
- false
- end
-
def getData
- @Data
+ raise StandardError, '#getData must be implemented in subclass'
end
def getOffsets
@@ -54,20 +50,5 @@ @Metazones
end
- def self.isValid?(name)
- false
- end
-
- def self.getOffsets(name)
- nil
- end
-
- def self.getTimezones(name)
- nil
- end
-
- def self.getMetazones(name)
- nil
- end
end
end
|
Remove some methods from ZoneInfo class
|
diff --git a/lib/fog/rackspace/models/identity/users.rb b/lib/fog/rackspace/models/identity/users.rb
index abc1234..def5678 100644
--- a/lib/fog/rackspace/models/identity/users.rb
+++ b/lib/fog/rackspace/models/identity/users.rb
@@ -18,6 +18,8 @@ new(data)
rescue Excon::Errors::NotFound
nil
+ rescue Excon::Errors::NotAuthorized
+ nil
end
def get_by_name(user_name)
@@ -25,6 +27,8 @@ new(data)
rescue Excon::Errors::NotFound
nil
+ rescue Excon::Errors::NotAuthorized
+ nil
end
end
end
|
[rackspace|identity] Handle NotAuthorized respones from the identity API in the user model
|
diff --git a/lib/metriks-addons.rb b/lib/metriks-addons.rb
index abc1234..def5678 100644
--- a/lib/metriks-addons.rb
+++ b/lib/metriks-addons.rb
@@ -2,5 +2,5 @@ require 'metriks/signalfx_reporter'
module MetriksAddons
- VERSION = '2.2.4'
+ VERSION = '2.2.5'
end
|
Update version to 2.2.5 for release
|
diff --git a/lib/reserved_words.rb b/lib/reserved_words.rb
index abc1234..def5678 100644
--- a/lib/reserved_words.rb
+++ b/lib/reserved_words.rb
@@ -7,7 +7,7 @@ @reserved_words = DEFAULT_WORDS.dup
def self.list
- @reserved_words
+ @reserved_words.uniq
end
def self.add(word)
|
Add uniq to list method
|
diff --git a/lib/wikitext/rails.rb b/lib/wikitext/rails.rb
index abc1234..def5678 100644
--- a/lib/wikitext/rails.rb
+++ b/lib/wikitext/rails.rb
@@ -16,10 +16,10 @@
module Wikitext
class TemplateHandler
-
- # tested with Rails 2.2.2: the API has now changed so many times that I'm no longer going to support older versions of Rails
def self.call template
'template.source.w'
end
end
end
+
+ActionView::Template.register_template_handler :wikitext, Wikitext::TemplateHandler
|
Add back template handler registration
In copying over the fix I inadvertantly ripped out a crucial line
required for the template handler to take effect.
Signed-off-by: Wincent Colaiuta <[email protected]>
|
diff --git a/dbsync.gemspec b/dbsync.gemspec
index abc1234..def5678 100644
--- a/dbsync.gemspec
+++ b/dbsync.gemspec
@@ -20,7 +20,7 @@
# specify any dependencies here; for example:
# s.add_development_dependency "rspec"
- s.add_runtime_dependency "activesupport", "~> 3.2.8"
- s.add_runtime_dependency "activerecord", "~> 3.2.8"
- s.add_runtime_dependency "railties", "~> 3.2.8"
+ s.add_runtime_dependency "activesupport", ">= 3.2.8"
+ s.add_runtime_dependency "activerecord", "=> 3.2.8"
+ s.add_runtime_dependency "railties", "=> 3.2.8"
end
|
Add support for rails 4
|
diff --git a/smarteru.gemspec b/smarteru.gemspec
index abc1234..def5678 100644
--- a/smarteru.gemspec
+++ b/smarteru.gemspec
@@ -9,16 +9,18 @@ s.email = ['[email protected]']
s.description = 'Ruby wrapper for Smarteru API'
s.summary = 'Allows access to a Smarteru API operations http://help.smarteru.com/'
+ s.homepage = 'http://github.com/eyecuelab/smarteru'
+ s.license = 'MIT'
s.files = Dir['{lib}/**/*'] + ['MIT-LICENSE', 'Rakefile', 'README.md']
s.test_files = Dir['test/**/*']
s.require_paths = ['lib']
- s.add_dependency('rest-client', '>= 1.7')
- s.add_dependency('libxml-ruby', '>= 2.8')
- s.add_dependency('xmlhasher', '>= 0.0.6')
+ s.add_dependency('rest-client', '~> 1.7')
+ s.add_dependency('libxml-ruby', '~> 2.8')
+ s.add_dependency('xmlhasher', '~> 0.0.6')
- s.add_development_dependency('rdoc')
- s.add_development_dependency('rake', '>= 0.9.3')
- s.add_development_dependency('webmock', '>= 1.8.0')
+ s.add_development_dependency('rdoc', '~> 4.2')
+ s.add_development_dependency('rake', '~> 10.4')
+ s.add_development_dependency('webmock', '~> 1.8')
end
|
Update gemspec
- Info and dependencies versions
|
diff --git a/spec/chek_spec.rb b/spec/chek_spec.rb
index abc1234..def5678 100644
--- a/spec/chek_spec.rb
+++ b/spec/chek_spec.rb
@@ -6,22 +6,22 @@ describe Chek do
it "normal require" do
expect { require 'foobar-can-not-require' }.to raise_error(LoadError)
- expect { require 'foobar-normal' }.to_not raise_error(LoadError)
+ expect { require 'foobar-normal' }.not_to raise_error(LoadError)
FoobarNormal.piyo.should == "piyopiyo"
end
context 'β' do
it "require" do
expect { β 'foobar-can-not-require' }.to raise_error(LoadError)
- expect { β 'foobar-with-chek' }.to_not raise_error(LoadError)
+ expect { β 'foobar-with-chek' }.not_to raise_error(LoadError)
FoobarWithChek.piyo.should == "piyopiyo"
end
end
context 'β' do
it "does not require" do
- expect { β 'foobar-can-not-require' }.to_not raise_error(LoadError)
- expect { β 'foobar-without-chek' }.to_not raise_error(LoadError)
+ expect { β 'foobar-can-not-require' }.not_to raise_error(LoadError)
+ expect { β 'foobar-without-chek' }.not_to raise_error(LoadError)
expect { FoobarWithoutChek.piyo }.to raise_error(NameError)
end
end
|
Fix for newer rspec version
|
diff --git a/app/controllers/static_pages_controller.rb b/app/controllers/static_pages_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/static_pages_controller.rb
+++ b/app/controllers/static_pages_controller.rb
@@ -2,7 +2,7 @@ def home
today = Time.zone.today
@song = Rails.cache.fetch("pickup/#{today}", expires_in: 1.day) { Song.includes(playings: :user).pickup(today) }
- @lives = Live.includes(:songs).performed.where('date >= ?', 1.month.ago)
+ @lives = Live.includes(:songs).performed.order_by_date.where('date >= ?', 1.month.ago)
return unless logged_in?
@regular_meeting = Rails.cache.fetch("regular_meeting/#{today}", expires_in: 1.day) do
RegularMeeting.new(today)
|
Fix the order of latest songs
|
diff --git a/app/demo_data/fake_event_note_generator.rb b/app/demo_data/fake_event_note_generator.rb
index abc1234..def5678 100644
--- a/app/demo_data/fake_event_note_generator.rb
+++ b/app/demo_data/fake_event_note_generator.rb
@@ -14,7 +14,8 @@ educator_id: educator.id,
event_note_type_id: EventNoteType.all.sample.id,
recorded_at: @date,
- text: sample_text
+ text: sample_text,
+ is_restricted: false
}
end
|
Update fake event note generator
|
diff --git a/packer/tests/spec/spec_helper.rb b/packer/tests/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/packer/tests/spec/spec_helper.rb
+++ b/packer/tests/spec/spec_helper.rb
@@ -1,7 +1,6 @@ require 'serverspec'
-include SpecInfra::Helper::Exec
-include SpecInfra::Helper::DetectOS
+set :backend, :exec
RSpec.configure do |c|
if ENV['ASK_SUDO_PASSWORD']
|
Set backend as exec for serverspec
|
diff --git a/features/support/omniauth.rb b/features/support/omniauth.rb
index abc1234..def5678 100644
--- a/features/support/omniauth.rb
+++ b/features/support/omniauth.rb
@@ -0,0 +1,25 @@+FACEBOOK_INFO = {
+ "id" => "12345",
+ "link" => "http://facebook.com/john_doe",
+ "email" => "[email protected]",
+ "first_name" => "John",
+ "last_name" => "Doe",
+ "website" => "http://www.example.com"
+}
+
+Before("@omniauth_test") do
+ OmniAuth.config.test_mode = true
+
+ # the symbol passed to mock_auth is the same as the name of the provider set up in the initializer
+ OmniAuth.config.mock_auth[:facebook] = {
+ "uid" => "12345",
+ "provider" => "facebook",
+ "user_info" => { "nickname" => "Johny" },
+ "credentials" => { "token" => "exampletoken" },
+ "extra" => { "user_hash" => FACEBOOK_INFO }
+ }
+end
+
+After("@omniauth_test") do
+ OmniAuth.config.test_mode = false
+end
|
Add OmniAuth config for mocking Facebook authentication.
|
diff --git a/fixture_dependencies.gemspec b/fixture_dependencies.gemspec
index abc1234..def5678 100644
--- a/fixture_dependencies.gemspec
+++ b/fixture_dependencies.gemspec
@@ -8,7 +8,6 @@ s.files = ["README.md", "MIT-LICENSE"] + Dir['lib/**/*.rb']
s.extra_rdoc_files = ["MIT-LICENSE"]
s.require_paths = ["lib"]
- s.has_rdoc = true
s.rdoc_options = %w'--inline-source --line-numbers README.md lib'
s.license = 'MIT'
s.homepage = "https://github.com/jeremyevans/fixture_dependencies"
|
Remove has_rdoc from gemspec, since it is deprecated
|
diff --git a/app/serializers/api/v1/ndc_sdg/meta_serializer.rb b/app/serializers/api/v1/ndc_sdg/meta_serializer.rb
index abc1234..def5678 100644
--- a/app/serializers/api/v1/ndc_sdg/meta_serializer.rb
+++ b/app/serializers/api/v1/ndc_sdg/meta_serializer.rb
@@ -2,9 +2,12 @@ module V1
module NdcSdg
class MetaSerializer < ActiveModel::Serializer
- has_many :sectors
- has_many :targets
- has_many :goals
+ has_many :sectors,
+ serializer: Api::V1::NdcSdg::SectorSerializer
+ has_many :targets,
+ serializer: Api::V1::NdcSdg::TargetSerializer
+ has_many :goals,
+ serializer: Api::V1::NdcSdg::GoalSerializer
end
end
end
|
Fix bug happening in production
Rails was not using the correct serializers for the
collections presented on the `/ndcs/sdgs` api endpoint.
This PR explicitly tells which serializers to be used in
the `has_many` relations of `NdcsSdgs` `MetaSerializer`.
To reproduce this weird behaviour locally, you can set
`config.eager_load = true` in `config/environments/development.rb`
|
diff --git a/Casks/nomachine.rb b/Casks/nomachine.rb
index abc1234..def5678 100644
--- a/Casks/nomachine.rb
+++ b/Casks/nomachine.rb
@@ -4,7 +4,7 @@
url "http://download.nomachine.com/download/#{version.split('.')[0..1].join('.')}/MacOSX/nomachine_#{version}.dmg"
name 'NoMachine'
- homepage 'http://www.nomachine.com'
+ homepage 'https://www.nomachine.com/'
license :unknown # todo: change license and remove this comment; ':unknown' is a machine-generated placeholder
pkg 'NoMachine.pkg'
|
Fix homepage to use SSL in NoMachine Cask
The HTTP 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/db/migrate/3_no_null_counters.rb b/db/migrate/3_no_null_counters.rb
index abc1234..def5678 100644
--- a/db/migrate/3_no_null_counters.rb
+++ b/db/migrate/3_no_null_counters.rb
@@ -0,0 +1,11 @@+class NoNullCounters < ActiveRecord::Migration
+ def up
+ change_column :tags, :taggings_count, :integer, :default => 0,
+ :null => false
+ end
+
+ def down
+ change_column :tags, :taggings_count, :integer, :default => 0,
+ :null => true
+ end
+end
|
Add a null constraint for taggings_count column.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.