diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/metadata.rb b/metadata.rb
index abc1234..def5678 100644
--- a/metadata.rb
+++ b/metadata.rb
@@ -5,6 +5,7 @@ description "Installs and configures Rundeck 2.0"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "2.0.4"
+depends "runit"
depends "sudo"
depends "java"
depends "apache2"
|
Revert "remove the runit dependency"
This reverts commit c970574c6323d61ba71ea27e770b5b5188217344 [formerly c970574c6323d61ba71ea27e770b5b5188217344 [formerly 22f0fef602c93cdf7224d09a1d3ffbccd53ae458]].
Former-commit-id: 6213ab53718192e50121eff248f7cb2ad2c59444
Former-commit-id: 8549816b14475fbf69b4974e4f4ff82980c098dc
|
diff --git a/metadata.rb b/metadata.rb
index abc1234..def5678 100644
--- a/metadata.rb
+++ b/metadata.rb
@@ -2,7 +2,7 @@ maintainer_email "stefan@02strich.de"
license "MIT"
description "Installs/Configures mpd"
-long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
+long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "0.0.2"
recipe "mpd::default" "Install and configure primary mpd instance"
|
Fix name of Readme file
|
diff --git a/lib/cellular/models/sms.rb b/lib/cellular/models/sms.rb
index abc1234..def5678 100644
--- a/lib/cellular/models/sms.rb
+++ b/lib/cellular/models/sms.rb
@@ -28,11 +28,11 @@ end
def save(options)
- raise NotImplementerError
+ raise NotImplementedError
end
def receive(options)
- raise NotImplementerError
+ raise NotImplementedError
end
def delivered?
|
Fix typo in SMS class
|
diff --git a/lib/prelay/lookup_by_id.rb b/lib/prelay/lookup_by_id.rb
index abc1234..def5678 100644
--- a/lib/prelay/lookup_by_id.rb
+++ b/lib/prelay/lookup_by_id.rb
@@ -2,23 +2,28 @@
module Prelay
module LookupById
+ attr_reader :object
+
def self.included(base)
base.argument :id, :id
base.prepend PrependedMethods
end
- attr_reader :relay_id
-
module PrependedMethods
def mutate(id:, **args)
- @relay_id = ID.parse(id, expected_type: self.class.type)
- super(**args)
- end
+ @object = ID.parse(id, expected_type: self.class.type).get
- def object
- # This loads all fields from the DB, but that's ok, since
- # validations/callbacks could touch any column anyway.
- @object ||= @relay_id.get
+ if @object.nil?
+ # Return the values that are necessary for the GraphQL gem to work,
+ # but let them all be nil.
+ r = {}
+ self.class.result_fields.each_value do |result_field|
+ r[result_field.normalized_name] = nil
+ end
+ r
+ else
+ super(**args)
+ end
end
end
end
|
Update LookupById to not even run the mutation if the object isn't found, since that's what we generally want anyway.
|
diff --git a/lib/rbnacl/serializable.rb b/lib/rbnacl/serializable.rb
index abc1234..def5678 100644
--- a/lib/rbnacl/serializable.rb
+++ b/lib/rbnacl/serializable.rb
@@ -9,7 +9,7 @@ #
# @return [String] a string representing this key
def inspect
- "#<#{self.class}:#{to_s(:hex)[0,8]}>"
+ "#<#{self.class}:#{Util.bytes2hex(to_bytes)[0,8]}>"
end
end
end
|
Fix hex conversion in Serializable
|
diff --git a/lib/sub_diff/diff_match.rb b/lib/sub_diff/diff_match.rb
index abc1234..def5678 100644
--- a/lib/sub_diff/diff_match.rb
+++ b/lib/sub_diff/diff_match.rb
@@ -2,7 +2,7 @@
module SubDiff
class DiffMatch < SimpleDelegator
- attr_reader :prefix, :suffix, :replacement
+ attr_reader :replacement, :prefix, :suffix
alias_method :match, :__getobj__
|
Reorder attr readers in `DiffMatch`
|
diff --git a/lib/webdrive/api/client.rb b/lib/webdrive/api/client.rb
index abc1234..def5678 100644
--- a/lib/webdrive/api/client.rb
+++ b/lib/webdrive/api/client.rb
@@ -24,7 +24,7 @@ end
def call(*method)
- @server.call(@rpc_key, @auth_key, *method)
+ @server.call(@rpc_key, @auth_key, method)
end
def login(*options)
@@ -35,6 +35,7 @@ private
def extract_options(*keys, values)
+ values = values.last if values.length == 1
if values.is_a? Hash
keys.map do |option|
values[option]
|
Fix issues with the extract options method
|
diff --git a/twitter-text.gemspec b/twitter-text.gemspec
index abc1234..def5678 100644
--- a/twitter-text.gemspec
+++ b/twitter-text.gemspec
@@ -1,6 +1,6 @@ spec = Gem::Specification.new do |s|
s.name = "twitter-text"
- s.version = "1.3.0"
+ s.version = "1.3.1"
s.authors = ["Matt Sanford", "Patrick Ewing", "Ben Cherry", "Britt Selvitelle", "Raffi Krikorian"]
s.email = ["matt@twitter.com", "patrick.henry.ewing@gmail.com", "bcherry@gmail.com", "bs@brittspace.com", "raffi@twitter.com"]
s.homepage = "http://twitter.com"
|
Update gem version to v1.3.1
|
diff --git a/server.rb b/server.rb
index abc1234..def5678 100644
--- a/server.rb
+++ b/server.rb
@@ -29,7 +29,7 @@ 'email' => params[:stripeEmail],
'reason' => params[:reason]
},
- :description => "Charge for test@example.com"
+ :description => "Cashin Charge"
)
'success'
end
|
Remove example description from Strip charge
|
diff --git a/builder/test/image_spec.rb b/builder/test/image_spec.rb
index abc1234..def5678 100644
--- a/builder/test/image_spec.rb
+++ b/builder/test/image_spec.rb
@@ -26,7 +26,7 @@ context "Binary dpkg" do
let(:stdout) { run_mounted("file-architecture /usr/bin/dpkg").stdout }
- it "is compiled for ARM architecture" do
+ it "is compiled for ARM aarch64 architecture" do
expect(stdout).to contain('aarch64')
end
end
@@ -43,11 +43,11 @@ end
end
- context "Docker service file" do
- let(:stdout) { run_mounted("cat /etc/systemd/system/docker.service.d/overlay.conf").stdout }
+ context "Docker systemd service file" do
+ let(:stdout) { run_mounted("cat /lib/systemd/system/docker.service").stdout }
- it "Daemon uses overlay storage driver" do
- expect(stdout).to contain("--storage-driver overlay")
+ it "Docker Engine is installed" do
+ expect(stdout).to contain("/usr/bin/dockerd")
end
end
end
|
Fix test if Docker Engine is installed
Signed-off-by: Dieter Reuter <554783fc552b5b2a46dd3d7d7b9b2cce9a82c122@me.com>
|
diff --git a/SBObjectiveCWrapper.podspec b/SBObjectiveCWrapper.podspec
index abc1234..def5678 100644
--- a/SBObjectiveCWrapper.podspec
+++ b/SBObjectiveCWrapper.podspec
@@ -13,7 +13,7 @@ s.ios.deployment_target = "8.0"
s.watchos.deployment_target = "2.0"
s.tvos.deployment_target = "9.0"
- s.osx.deployment_target = "10.9"
+ s.osx.deployment_target = "10.11"
s.source = { :git => "https://github.com/SwiftyBeaver/SBObjectiveCWrapper.git", :tag => "v" + s.version.to_s }
s.source_files = "sources"
s.dependency 'SwiftyBeaver', '~> 0.5'
|
Update OS X deployment target in pod spec.
|
diff --git a/plugins/suppliers/models/suppliers_plugin/distributed_product.rb b/plugins/suppliers/models/suppliers_plugin/distributed_product.rb
index abc1234..def5678 100644
--- a/plugins/suppliers/models/suppliers_plugin/distributed_product.rb
+++ b/plugins/suppliers/models/suppliers_plugin/distributed_product.rb
@@ -8,7 +8,6 @@ named_scope :with_product_category_id, lambda { |id| { :conditions => ['products_2.product_category_id' => id] } }
validates_presence_of :supplier
- validate :dont_distribute_own
def price
supplier_price = self.supplier_product ? self.supplier_product.price : nil
@@ -19,8 +18,4 @@
protected
- def dont_distribute_own
- self.errors.add :base, I18n.t('suppliers_plugin.models.base_product.own_distribution_error') if self.supplier.profile == self.profile
- end
-
end
|
suppliers: Remove validation for own product
|
diff --git a/lib/tasks/statistics_announcements_intents.rake b/lib/tasks/statistics_announcements_intents.rake
index abc1234..def5678 100644
--- a/lib/tasks/statistics_announcements_intents.rake
+++ b/lib/tasks/statistics_announcements_intents.rake
@@ -0,0 +1,17 @@+namespace :statistics_announcements do
+ desc "Updates the publish intent for StatisticsAnnouncements scheduled for release in the future"
+ task put_intents_for_scheduled: :environment do
+ latest_join_sql = <<-SQL
+ statistics_announcement_dates.created_at = (
+ select max(statistics_announcement_dates.created_at)
+ from statistics_announcement_dates
+ where statistics_announcement_dates.statistics_announcement_id = statistics_announcements.id
+ )
+ SQL
+ statistics_announcements = StatisticsAnnouncement
+ .joins(:statistics_announcement_dates)
+ .where("statistics_announcement_dates.release_date > ?", Date.current)
+ .where(latest_join_sql)
+ statistics_announcements.each(&:update_publish_intent)
+ end
+end
|
Add rake task to update `StatisticsAnnouncement` publish intent
This rake task is required to send a `publish_intent` to the
PublishingAPI for any existing `StatisticsAnnouncement` with a release
date in the future. It is a follow up commit to
https://github.com/alphagov/whitehall/pull/2538
|
diff --git a/lib/yard/server/commands/static_file_command.rb b/lib/yard/server/commands/static_file_command.rb
index abc1234..def5678 100644
--- a/lib/yard/server/commands/static_file_command.rb
+++ b/lib/yard/server/commands/static_file_command.rb
@@ -5,6 +5,8 @@ module Commands
class StaticFileCommand < Base
include WEBrick::HTTPUtils
+
+ DefaultMimeTypes['js'] = 'text/javascript'
STATIC_PATHS = [
File.join(YARD::TEMPLATE_ROOT, 'default', 'fulldoc', 'html'),
|
Add mime type for javascript (WEBrick does not have this defined)
|
diff --git a/resources/chef-repo/site-cookbooks/nginx_part/recipes/configure.rb b/resources/chef-repo/site-cookbooks/nginx_part/recipes/configure.rb
index abc1234..def5678 100644
--- a/resources/chef-repo/site-cookbooks/nginx_part/recipes/configure.rb
+++ b/resources/chef-repo/site-cookbooks/nginx_part/recipes/configure.rb
@@ -29,3 +29,7 @@ group 'root'
mode '0644'
end
+
+service "nginx" do
+ action :restart
+end
|
Add resource to restart nginx
|
diff --git a/example/environment.rb b/example/environment.rb
index abc1234..def5678 100644
--- a/example/environment.rb
+++ b/example/environment.rb
@@ -4,7 +4,6 @@
require 'oauth2/provider'
OAuth2::Provider.realm = 'Notes App'
-OAuth2::Provider.mode = 'development'
require 'models/connection'
require 'models/user'
|
Remove mode setting from example app.
|
diff --git a/config/initializers/env.rb b/config/initializers/env.rb
index abc1234..def5678 100644
--- a/config/initializers/env.rb
+++ b/config/initializers/env.rb
@@ -1,5 +1,5 @@ ENV["G5_HUB_ENTRIES_URL"] ||= case Rails.env
- when "production" then "https://g5-hub.herokuapp.com"
+ when "production" then "http://hub.g5dxm.com"
when "development" then "http://g5-hub.dev"
when "test" then "http://g5-hub.test"
end
|
Fix the client uid format
So it will match what is in the hub and therefore G5Updatable
|
diff --git a/Casks/handbrakecli-nightly.rb b/Casks/handbrakecli-nightly.rb
index abc1234..def5678 100644
--- a/Casks/handbrakecli-nightly.rb
+++ b/Casks/handbrakecli-nightly.rb
@@ -1,6 +1,6 @@ cask :v1 => 'handbrakecli-nightly' do
- version '6752svn'
- sha256 'a9b2d95e47a72b5cd918bd3b2d8f2064cec1b5f8b96b441dabc60af63aefa4d2'
+ version '6782svn'
+ sha256 'a661254da12a5fcaaab80b822bed78e8e000800042380bf3ccdfacf017cdb7fa'
url "http://download.handbrake.fr/nightly/HandBrake-#{version}-MacOSX.6_CLI_x86_64.dmg"
homepage 'http://handbrake.fr'
|
Update HandbrakeCLI Nightly to v6782svn
HandBrakeCLI Nightly v6782svn built 2015-01-21.
|
diff --git a/Casks/handbrakecli-nightly.rb b/Casks/handbrakecli-nightly.rb
index abc1234..def5678 100644
--- a/Casks/handbrakecli-nightly.rb
+++ b/Casks/handbrakecli-nightly.rb
@@ -1,6 +1,6 @@ class HandbrakecliNightly < Cask
- version '6452svn'
- sha256 'cce4733a704bab3d0314d8950b98c2cdce4ed47e4e838727f8e996a3f5cfa537'
+ version '6469svn'
+ sha256 '0eb150843aa2a7f2f23ad1c9359478e1843f26fc12d50a0c55a8fc92f0a7d398'
url "http://download.handbrake.fr/nightly/HandBrake-#{version}-MacOSX.6_CLI_x86_64.dmg"
homepage 'http://handbrake.fr'
|
Update HandBrakeCLI Nightly to v6469svn
HandBrakeCLI Nightly Build 6469svn released 2014-10-26.
|
diff --git a/lib/metaforce.rb b/lib/metaforce.rb
index abc1234..def5678 100644
--- a/lib/metaforce.rb
+++ b/lib/metaforce.rb
@@ -23,6 +23,7 @@
# Performs a login and retrurns the session
def login(options={})
+ options = HashWithIndifferentAccess.new(options)
username = options.fetch(:username, ENV['SALESFORCE_USERNAME'])
password = options.fetch(:password, ENV['SALESFORCE_PASSWORD'])
security_token = options.fetch(:security_token, ENV['SALESFORCE_SECURITY_TOKEN'])
|
Use hash with indifferent access.
|
diff --git a/app/controllers/session.rb b/app/controllers/session.rb
index abc1234..def5678 100644
--- a/app/controllers/session.rb
+++ b/app/controllers/session.rb
@@ -12,16 +12,20 @@ end
post '/session/data' do
- p params
interval_info = params["session"]
session = Session.create()
+
counter = 0
while interval_info[counter.to_s]
current_interval = interval_info[counter.to_s]
driver = User.find_by(email:current_interval['drive'])
navigator = User.find_by(email:current_interval['navigate'])
- session.users = [driver, navigator] if counter == 0
+ if counter == 0
+ session.users = [driver, navigator]
+ session.feedbacks.create(giver: driver, receiver: navigator)
+ session.feedbacks.create(giver: navigator, receiver: driver)
+ end
session.intervals.create(active_time: current_interval["timeWorked"], pause_time: current_interval["timePaused"], driver: driver, navigator: navigator)
counter += 1
|
Add Feedback Association to Session For Later Use
|
diff --git a/app/mailers/poll_mailer.rb b/app/mailers/poll_mailer.rb
index abc1234..def5678 100644
--- a/app/mailers/poll_mailer.rb
+++ b/app/mailers/poll_mailer.rb
@@ -36,7 +36,7 @@ locale: locale_for(user),
to: user.email,
utm_hash: utm_hash,
- subject_key: "poll_mailer.#{action_name}_subject"
+ subject_key: "poll_mailer.#{action_name}_subject",
subject_params: {
poll_title: poll.title,
poll_author: poll.author.name
|
Fix poll mailer syntax error
|
diff --git a/app/models/notification.rb b/app/models/notification.rb
index abc1234..def5678 100644
--- a/app/models/notification.rb
+++ b/app/models/notification.rb
@@ -30,10 +30,9 @@ end
def text_bindings
- h = {}
- h[:initiator] = { :text => initiator.name } if initiator
- h[:subject] = { :text => subject.name } if subject
- h[:cause] = { :text => cause.name } if cause
- h
+ [:initiator, :subject, :cause].each_with_object({}) do |key, result|
+ value = public_send(key)
+ result[key] = { :text => value.name } if value
+ end
end
end
|
Use loop to avoid code repetition
|
diff --git a/lib/mongo/rails/instrumentation/railtie.rb b/lib/mongo/rails/instrumentation/railtie.rb
index abc1234..def5678 100644
--- a/lib/mongo/rails/instrumentation/railtie.rb
+++ b/lib/mongo/rails/instrumentation/railtie.rb
@@ -19,12 +19,13 @@ def instrument(clazz, methods)
clazz.module_eval do
methods.each do |m|
- class_eval %{def #{m}_with_instrumentation(*args, &block)
- ActiveSupport::Notifications.instrumenter.instrument "mongo.mongo", :name => "#{m}" do
- #{m}_without_instrumentation(*args, &block)
+ class_eval <<-CODE, __FILE__, __LINE__ + 1
+ def #{m}_with_instrumentation(*args, &block)
+ ActiveSupport::Notifications.instrumenter.instrument "mongo.mongo", :name => "#{m}" do
+ #{m}_without_instrumentation(*args, &block)
+ end
end
- end
- }
+ CODE
alias_method_chain m, :instrumentation
end
|
Include stack trace information for instrumented methods.
Fixes #2.
|
diff --git a/lib/proxy_pac_rb/cli/compress_proxy_pac.rb b/lib/proxy_pac_rb/cli/compress_proxy_pac.rb
index abc1234..def5678 100644
--- a/lib/proxy_pac_rb/cli/compress_proxy_pac.rb
+++ b/lib/proxy_pac_rb/cli/compress_proxy_pac.rb
@@ -19,9 +19,12 @@ @linter = ProxyPacLinter.new
end
+ def load_files
+ @proxy_pacs.each { |p| @loader.load(p) }
+ end
+
def test_proxy_pac
@proxy_pacs.keep_if do |p|
- @loader.load(p)
@linter.lint(p)
if p.valid?
|
Load files before linting them. It's more logical
|
diff --git a/lib/servitude/environment_configuration.rb b/lib/servitude/environment_configuration.rb
index abc1234..def5678 100644
--- a/lib/servitude/environment_configuration.rb
+++ b/lib/servitude/environment_configuration.rb
@@ -6,7 +6,7 @@ class EnvironmentConfiguration < Servitude::Configuration
def for_env
- _config.send( _config.environment )
+ send( environment )
end
end
|
Fix issue with environment configuration.
|
diff --git a/Formula/solr.rb b/Formula/solr.rb
index abc1234..def5678 100644
--- a/Formula/solr.rb
+++ b/Formula/solr.rb
@@ -10,9 +10,9 @@ end_script
class Solr <Formula
- url 'http://apache.deathculture.net/lucene/solr/1.3.0/apache-solr-1.3.0.tgz'
+ url 'http://apache.deathculture.net/lucene/solr/1.4.0/apache-solr-1.4.0.tgz'
homepage 'http://lucene.apache.org/solr/'
- md5 '23774b077598c6440d69016fed5cc810'
+ md5 '1cc3783316aa1f95ba5e250a4c1d0451'
def install
prefix.mkpath
|
Update Solr Formula to 1.4.0
|
diff --git a/core/spec/controllers/spree/admin/mail_methods_controller_spec.rb b/core/spec/controllers/spree/admin/mail_methods_controller_spec.rb
index abc1234..def5678 100644
--- a/core/spec/controllers/spree/admin/mail_methods_controller_spec.rb
+++ b/core/spec/controllers/spree/admin/mail_methods_controller_spec.rb
@@ -13,14 +13,14 @@ context "#create" do
it "should reinitialize the mail settings" do
Spree::Core::MailSettings.should_receive :init
- spree_put :create, { :id => "456", :mail_method_parmas => { :environment => "foo" } }
+ spree_put :create, { :id => "456", :mail_method => {:environment => "foo"}}
end
end
context "#update" do
it "should reinitialize the mail settings" do
Spree::Core::MailSettings.should_receive :init
- spree_put :update, { :id => "456", :mail_method_params => { :environment => "foo" } }
+ spree_put :update, { :id => "456", :mail_method => {:environment => "foo"}}
end
end
|
Remove order reference from mailMethodsController spec and fix param names
Conflicts:
core/spec/controllers/spree/admin/mail_methods_controller_spec.rb
|
diff --git a/app/screens/info_screen.rb b/app/screens/info_screen.rb
index abc1234..def5678 100644
--- a/app/screens/info_screen.rb
+++ b/app/screens/info_screen.rb
@@ -17,7 +17,9 @@ if navigationType == UIWebViewNavigationTypeLinkClicked ||
navigationType == UIWebViewNavigationTypeOther
url = request.URL.absoluteString
- unless url =~ /\Afile/ or url =~ /vimeo.com\// or /itunes.apple.com/
+ puts "[[[ REQUEST URL]]] => #{url}" if BW2.debug?
+
+ unless url =~ /\Afile/ or url =~ /vimeo.com\// or url =~ /itunes.apple.com/ or url =~ /vimeocdn.com\//
puts "- URL stopped! (#{url})" if BW2.debug?
return false
end
|
Fix crash problem in screen for Vimeo video
- Adapt to new Vimeo access specifications
=> it alos needs access to 'vimeocdn.com' now
|
diff --git a/app/models/tuner.rb b/app/models/tuner.rb
index abc1234..def5678 100644
--- a/app/models/tuner.rb
+++ b/app/models/tuner.rb
@@ -19,6 +19,8 @@ def logs_since(time_interval)
query = RecentLog.where(:tuner_id => id)
- query.where('created_at > ? ', time_interval.date_range.begin.utc) unless time_interval.all_interval?
+ query = query.where('created_at > ? ', time_interval.date_range.begin.utc) unless time_interval.all_interval?
+
+ return query
end
end
|
Fix Tuner.logs_since returning nil for Log.all_interval
|
diff --git a/app/workers/repository_check/single_repository_worker.rb b/app/workers/repository_check/single_repository_worker.rb
index abc1234..def5678 100644
--- a/app/workers/repository_check/single_repository_worker.rb
+++ b/app/workers/repository_check/single_repository_worker.rb
@@ -5,13 +5,18 @@
def perform(project_id)
project = Project.find(project_id)
+
+ save_result(project, !check)
+ end
+
+ private
+
+ def save_result(project, failure)
project.update_columns(
- last_repository_check_failed: !check(project),
+ last_repository_check_failed: failure,
last_repository_check_at: Time.now
)
end
-
- private
def check(project)
check_repo(project) && check_wiki_repo(project)
|
Make it easier to override how to save the results
|
diff --git a/Library/Formula/subversion.rb b/Library/Formula/subversion.rb
index abc1234..def5678 100644
--- a/Library/Formula/subversion.rb
+++ b/Library/Formula/subversion.rb
@@ -1,14 +1,14 @@ require 'brewkit'
class SubversionDeps <Formula
- @url='http://subversion.tigris.org/downloads/subversion-deps-1.6.3.tar.bz2'
- @md5='22d3687ae93648fcecf945c045931272'
+ @url='http://subversion.tigris.org/downloads/subversion-deps-1.6.5.tar.bz2'
+ @md5='8272316e1670d4d2bea451411e438bde'
end
class Subversion <Formula
- @url='http://subversion.tigris.org/downloads/subversion-1.6.3.tar.bz2'
+ @url='http://subversion.tigris.org/downloads/subversion-1.6.5.tar.bz2'
@homepage='http://subversion.tigris.org/'
- @md5='8bf7637ac99368db0890e3f085fa690d'
+ @md5='1a53a0e72bee0bf814f4da83a9b6a636'
def install
# Slot dependencies into place
@@ -17,14 +17,15 @@ d.install Dir['*']
end
- # Use existing system zlib
- # Use dep-provided other libraries
+ # Use existing system zlib, dep-provided other libraries
# Don't mess with Apache modules (since we're not sudo)
system "./configure", "--disable-debug",
"--prefix=#{prefix}",
+ "--with-ssl",
"--with-zlib=/usr/lib",
"--disable-mod-activation",
- "--without-apache-libexecdir"
+ "--without-apache-libexecdir",
+ "--without-berkeley-db"
system "make"
system "make install"
end
|
Update Subersion to 1.6.5, add SSL support, turn off BDB support.
|
diff --git a/config.ru b/config.ru
index abc1234..def5678 100644
--- a/config.ru
+++ b/config.ru
@@ -3,6 +3,7 @@
Bundler.require(:default)
-require './app'
+$LOAD_PATH.unshift(::File.expand_path('lib', ::File.dirname(__FILE__)))
+require 'nesta/app'
run Nesta::App
|
Load local code in development.
|
diff --git a/config.ru b/config.ru
index abc1234..def5678 100644
--- a/config.ru
+++ b/config.ru
@@ -3,7 +3,7 @@
Bundler.require
-require "try-redis.rb"
+require "./try-redis.rb"
use Rack::Static, :urls => %w( /css /images /javascripts ), :root => "public"
|
Add path to main lib.
|
diff --git a/config.ru b/config.ru
index abc1234..def5678 100644
--- a/config.ru
+++ b/config.ru
@@ -4,4 +4,8 @@ Bundler.require
require './app'
+
+# So that log output doesn't get buffered
+$stdout.sync = true
+
run Sinatra::Application
|
Stop log output from being buffered
|
diff --git a/app/form_objects/create_turn_form_object.rb b/app/form_objects/create_turn_form_object.rb
index abc1234..def5678 100644
--- a/app/form_objects/create_turn_form_object.rb
+++ b/app/form_objects/create_turn_form_object.rb
@@ -4,11 +4,10 @@ def initialize(params)
@params = params
@coordinates = extract_coordinates
- @player = params.require(:player_id)
end
def valid?
- !@coordinates.nil? && !@player.nil?
+ !@coordinates.nil?
end
private
|
Remove player_id param check from CreateTurnFormObject
|
diff --git a/guard-cucumber.gemspec b/guard-cucumber.gemspec
index abc1234..def5678 100644
--- a/guard-cucumber.gemspec
+++ b/guard-cucumber.gemspec
@@ -16,7 +16,7 @@ s.rubyforge_project = 'guard-cucumber'
s.add_dependency 'guard', '>= 0.8.3'
- s.add_dependency 'cucumber', '>= 0.10'
+ s.add_dependency 'cucumber', '>= 1.2.0'
s.add_development_dependency 'bundler', '~> 1.0'
s.add_development_dependency 'rspec', '~> 2.8'
|
Add Cucumber 1.2.0 as dependency.
A change in the Cucumber formatter API must be reflected in the
Guard Cucumber notification formatter.
|
diff --git a/lib/encryptable.rb b/lib/encryptable.rb
index abc1234..def5678 100644
--- a/lib/encryptable.rb
+++ b/lib/encryptable.rb
@@ -2,36 +2,38 @@ # licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
- module Encryptable
- def signable_string
- raise NotImplementedException("Override this in your encryptable class")
- end
-
- def signature_valid?
- verify_signature(creator_signature, person)
- end
-
- def verify_signature(signature, person)
- if person.nil?
- Rails.logger.info("Verifying sig on #{signable_string} but no person is here")
- return false
- elsif person.public_key.nil?
- Rails.logger.info("Verifying sig on #{signable_string} but #{person.name} has no key")
- return false
- elsif signature.nil?
- Rails.logger.info("Verifying sig on #{signable_string} but #{person.name} did not sign")
- return false
- end
- Rails.logger.debug("Verifying sig on #{signable_string} from person #{person.name}")
- validity = person.public_key.verify "SHA", Base64.decode64(signature), signable_string
- Rails.logger.debug("Validity: #{validity}")
- validity
- end
-
- def sign_with_key(key)
- Rails.logger.debug("Signing #{signable_string}")
- Base64.encode64(key.sign "SHA", signable_string)
- end
-
+module Encryptable
+ def signable_string
+ raise NotImplementedException("Override this in your encryptable class")
end
+ def signature_valid?
+ verify_signature(creator_signature, person)
+ end
+
+ def verify_signature(signature, person)
+ if person.nil?
+ Rails.logger.info("event=verify_signature status=abort reason=no_person model_id=#{id}")
+ return false
+ elsif person.public_key.nil?
+ Rails.logger.info("event=verify_signature status=abort reason=no_key model_id=#{id}")
+ return false
+ elsif signature.nil?
+ Rails.logger.info("event=verify_signature status=abort reason=no_signature model_id=#{id}")
+ return false
+ end
+ log_string = "event=verify_signature status=complete model_id=#{id}"
+ validity = person.public_key.verify "SHA", Base64.decode64(signature), signable_string
+ log_string += " validity=#{validity}"
+ Rails.logger.info(log_string)
+ validity
+ end
+
+ def sign_with_key(key)
+ sig = Base64.encode64(key.sign "SHA", signable_string)
+ Rails.logger.info("event=sign_with_key status=complete model_id=#{id}")
+ sig
+ end
+
+end
+
|
Fix log statements in Encryptable
|
diff --git a/lib/fraggle-synchrony/fraggle/client.rb b/lib/fraggle-synchrony/fraggle/client.rb
index abc1234..def5678 100644
--- a/lib/fraggle-synchrony/fraggle/client.rb
+++ b/lib/fraggle-synchrony/fraggle/client.rb
@@ -1,14 +1,19 @@ module Fraggle
class Client
- %w{rev set get del stat}.each do |cmd|
+ %w{rev set get del stat getdir walk}.each do |cmd|
class_eval <<-CODE
alias :a#{cmd} :#{cmd}
- def #{cmd}(*args)
+ def #{cmd}(*args, &blk)
f = Fiber.current
+ blk = proc{ |v| v } if !block_given?
cb = proc { |e, err|
- f.resume e || err
+ if err
+ f.resume err
+ else
+ f.resume blk.call(e)
+ end
}
a#{cmd}(*args, &cb)
|
Handle blocks passed to functions
This means we can implement getdir and walk.
|
diff --git a/lib/rpush/daemon/interruptible_sleep.rb b/lib/rpush/daemon/interruptible_sleep.rb
index abc1234..def5678 100644
--- a/lib/rpush/daemon/interruptible_sleep.rb
+++ b/lib/rpush/daemon/interruptible_sleep.rb
@@ -1,17 +1,22 @@-require 'monitor'
-
module Rpush
module Daemon
class InterruptibleSleep
def sleep(duration)
@thread = Thread.new { Kernel.sleep duration }
Thread.pass
- @thread.join
+
+ begin
+ @thread.join
+ rescue StandardError # rubocop:disable Lint/HandleExceptions
+ @thread = nil
+ end
end
def stop
@thread.kill if @thread
rescue StandardError # rubocop:disable Lint/HandleExceptions
+ ensure
+ @thread = nil
end
end
end
|
Handle exceptions when joining sleep thread in InterruptibleSleep.
|
diff --git a/lib/travis/logs/sidekiq/send_timings.rb b/lib/travis/logs/sidekiq/send_timings.rb
index abc1234..def5678 100644
--- a/lib/travis/logs/sidekiq/send_timings.rb
+++ b/lib/travis/logs/sidekiq/send_timings.rb
@@ -14,9 +14,9 @@ sidekiq_options queue: 'send_timing', retry: 3,
unique: :until_and_while_executing
- def perform(log_id)
- Travis::Honeycomb.context.set('log_id', log_id)
- Travis::Logs::Services::SendTimings.new(log_id).run
+ def perform(job_id)
+ Travis::Honeycomb.context.set('job_id', job_id)
+ Travis::Logs::Services::SendTimings.new(job_id).run
end
end
end
|
Use more descriptive name for arg
|
diff --git a/models/season.rb b/models/season.rb
index abc1234..def5678 100644
--- a/models/season.rb
+++ b/models/season.rb
@@ -1,6 +1,10 @@ require 'time'
class Season < ActiveRecord::Base
+ validates :name, presence: true, uniqueness: true
+ validates :start, presence: true
+ validates :expiry, presence: true
+
def self.for(time)
t = nil
case time
|
Add validations for Season model.
|
diff --git a/lib/whitehall/abbreviation_extractor.rb b/lib/whitehall/abbreviation_extractor.rb
index abc1234..def5678 100644
--- a/lib/whitehall/abbreviation_extractor.rb
+++ b/lib/whitehall/abbreviation_extractor.rb
@@ -33,15 +33,8 @@ )
end
- # Because the govspeak helpers in whitehall rely on rendering partials, we
- # need to make sure the view paths are set, otherwise the helpers can't find
- # the partials.
def helpers
- @helpers ||= begin
- helpers = ApplicationController.helpers
- helpers.view_paths = ApplicationController.view_paths
- helpers
- end
+ @helpers ||= ApplicationController.new.helpers
end
end
end
|
Use controller instance helpers proxy
|
diff --git a/LineKit.podspec b/LineKit.podspec
index abc1234..def5678 100644
--- a/LineKit.podspec
+++ b/LineKit.podspec
@@ -1,7 +1,7 @@ Pod::Spec.new do |s|
s.name = "LineKit"
s.version = "1.4.1"
- s.summary = "Share to Naver Line from your apps."
+ s.summary = "Share to LINE from your apps."
s.homepage = "https://github.com/dlackty/LineKit"
s.license = { :type => 'MIT', :file => 'LICENSE' }
@@ -12,6 +12,8 @@ s.source_files = 'LineKit/*.{h,m}'
s.resources = "LineKit/images/*.png"
+ s.frameworks = 'UIKit', 'Foundation'
+
s.social_media_url = "https://twitter.com/dlackty"
s.requires_arc = true
end
|
Add framework and change description of podspec
|
diff --git a/jenkins-cli.rb b/jenkins-cli.rb
index abc1234..def5678 100644
--- a/jenkins-cli.rb
+++ b/jenkins-cli.rb
@@ -7,6 +7,15 @@ bottle :unneeded
depends_on :java => "1.7+"
+
+ # modified from http://www.rubydoc.info/github/Homebrew/homebrew/Pathname:write_jar_script
+ def write_jar_script(target_jar, script_name, java_opts = "", use_jenkins_key = false)
+ mkpath
+ (self+script_name).write <<-EOS.undent
+ #!/bin/bash
+ exec java #{java_opts} -jar #{target_jar} #{use_jenkins_key ? '-i ~/.ssh/jenkins_rsa' : ''} "$@"
+ EOS
+ end
def install
system "jar", "xvf", "jenkins.war"
|
Allow using a special ssh key that doesn't prompt for a password.
|
diff --git a/lib/tzinfo/data.rb b/lib/tzinfo/data.rb
index abc1234..def5678 100644
--- a/lib/tzinfo/data.rb
+++ b/lib/tzinfo/data.rb
@@ -20,4 +20,11 @@ # THE SOFTWARE.
#++
+# Top level module for TZInfo.
+module TZInfo
+ # Top level module for TZInfo::Data.
+ module Data
+ end
+end
+
require 'tzinfo/data/version'
|
Add documentation comments for TZInfo and TZInfo::Data modules.
Avoids blank pages being generated by RDoc and the licence being used as
documentation by YARD.
|
diff --git a/apps/rails_turbo_assets.rb b/apps/rails_turbo_assets.rb
index abc1234..def5678 100644
--- a/apps/rails_turbo_assets.rb
+++ b/apps/rails_turbo_assets.rb
@@ -1,5 +1,13 @@+#
+# There are a few requirement for theses tasks to work as intentended :
+#
+# - You must set :deploy_via, :remote_cache
+# - The cached copy was synced previously during deployment
+# (otherwise real_revision might not be yet fetch on the cached copy)
+
set(:skip_assets_precompile) do
- run_locally("#{source.local.log(current_revision, revision)} --oneline vendor/assets/ app/assets/ | wc -l").to_i == 0
+ cached_copy = File.join(shared_path, fetch(:repository_cache, "cached-copy"))
+ run("cd #{cached_copy} && #{source.log(current_revision, real_revision)} --oneline vendor/assets/ app/assets/ | wc -l").to_i == 0
end
namespace :deploy do
|
Use remote repository for assets precompiling check
|
diff --git a/ruby_event_store_rom_sql/lib/ruby_event_store/expected_version.rb b/ruby_event_store_rom_sql/lib/ruby_event_store/expected_version.rb
index abc1234..def5678 100644
--- a/ruby_event_store_rom_sql/lib/ruby_event_store/expected_version.rb
+++ b/ruby_event_store_rom_sql/lib/ruby_event_store/expected_version.rb
@@ -3,8 +3,10 @@ POSITION_DEFAULT = -1.freeze
NOT_RESOLVED = Object.new.freeze
- def self.any
- new(:any)
+ class << self
+ %i[any none auto].each do |name|
+ define_method(name) { new(name) }
+ end
end
attr_reader :expected
|
Add helper methods for :any, :none and :auto
|
diff --git a/lib/cli.rb b/lib/cli.rb
index abc1234..def5678 100644
--- a/lib/cli.rb
+++ b/lib/cli.rb
@@ -24,6 +24,7 @@ stdout.puts("Done!".green)
rescue NoMethodError => e
stdout.puts("Error: #{e.message}\n".red)
+ stdout.puts e.backtrace.join("\n\t")
end
end
|
Add backtrace to error output
|
diff --git a/spec/features/tournaments_spec.rb b/spec/features/tournaments_spec.rb
index abc1234..def5678 100644
--- a/spec/features/tournaments_spec.rb
+++ b/spec/features/tournaments_spec.rb
@@ -17,8 +17,13 @@ visit tournaments_path(year: admin.year)
expect(page).to have_text 'Order'
fill_in "ordinals[#{tournament1.id}]", with: 2
- fill_in "ordinals[#{tournament2.id}]", with: 1
+ fill_in "ordinals[#{tournament2.id}]", with: 3
click_button 'Update Order'
expect(page).to have_text 'Order updated'
+
+ tournament1.reload
+ tournament2.reload
+ expect(tournament1.ordinal).to eq(2)
+ expect(tournament2.ordinal).to eq(3)
end
end
|
Test db is correctly updated
|
diff --git a/spec/libs/weather_grabber_spec.rb b/spec/libs/weather_grabber_spec.rb
index abc1234..def5678 100644
--- a/spec/libs/weather_grabber_spec.rb
+++ b/spec/libs/weather_grabber_spec.rb
@@ -0,0 +1,26 @@+require 'spec_helper'
+require_relative '../../lib/weather_grabber'
+
+describe WeatherGrabber, :vcr do
+
+ before :all do
+ @weather = WeatherGrabber.new
+ end
+
+ it "should give back the last time there was rain" do
+ @weather.last_rain.should == "About 5 minutes ago"
+ end
+
+ it "should give back the next time there will be rain" do
+ @weather.next_rain.should == "In about 2 hours"
+ end
+
+ it "should give back the current temperature" do
+ @weather.temperature.should == 3
+ end
+
+ it "should give back the outlook" do
+ @weather.outlook.should == "Rainy"
+ end
+
+end
|
Add test for weather grabber
|
diff --git a/spec/models/project_total_spec.rb b/spec/models/project_total_spec.rb
index abc1234..def5678 100644
--- a/spec/models/project_total_spec.rb
+++ b/spec/models/project_total_spec.rb
@@ -2,25 +2,25 @@
RSpec.describe ProjectTotal, type: :model do
before do
- @project_id = create(:contribution, value: 10.0, payment_service_fee: 1, state: 'pending').project_id
- create(:contribution, value: 10.0, payment_service_fee: 1, state: 'confirmed', project_id: @project_id)
- create(:contribution, value: 10.0, payment_service_fee: 1, state: 'waiting_confirmation', project_id: @project_id)
- create(:contribution, value: 10.0, payment_service_fee: 1, state: 'refunded', project_id: @project_id)
- create(:contribution, value: 10.0, payment_service_fee: 1, state: 'requested_refund', project_id: @project_id)
+ @project_id = create(:contribution, :pending, value: 10.0, payment_service_fee: 1).project_id
+ create(:contribution, :confirmed, value: 10.0, payment_service_fee: 1, project_id: @project_id)
+ create(:contribution, :waiting_confirmation, value: 10.0, payment_service_fee: 1, project_id: @project_id)
+ create(:contribution, :refunded, value: 10.0, payment_service_fee: 1, project_id: @project_id)
+ create(:contribution, :requested_refund, value: 10.0, payment_service_fee: 1, project_id: @project_id)
end
describe "#pledged" do
subject{ ProjectTotal.where(project_id: @project_id).first.pledged }
- it{ is_expected.to eq(30) }
+ it{ is_expected.to eq(20) }
end
describe "#total_contributions" do
subject{ ProjectTotal.where(project_id: @project_id).first.total_contributions }
- it{ is_expected.to eq(3) }
+ it{ is_expected.to eq(2) }
end
describe "#total_payment_service_fee" do
subject { ProjectTotal.where(project_id: @project_id).first.total_payment_service_fee }
- it { is_expected.to eq(3) }
+ it { is_expected.to eq(2) }
end
end
|
Update ProjectView tests to validate his new behavior
|
diff --git a/spec/planning_center/base_spec.rb b/spec/planning_center/base_spec.rb
index abc1234..def5678 100644
--- a/spec/planning_center/base_spec.rb
+++ b/spec/planning_center/base_spec.rb
@@ -26,20 +26,20 @@ attrs = { 'id' => 123 }
expect(
PlanningCenter::Base.new(attrs, client).respond_to?(:id)
- ).to be_true
+ ).to be true
end
it 'responds to methods with nil values' do
attrs = { 'name' => nil }
expect(
PlanningCenter::Base.new(attrs, client).respond_to?(:name)
- ).to be_true
+ ).to be true
end
it 'does not respond to methods not matching hash keys' do
expect(
PlanningCenter::Base.new({}, client).respond_to?(:giraffe)
- ).to be_false
+ ).to be false
end
end
end
|
Fix RSpec 3 deprecation warnings
|
diff --git a/spec/puppetfiler/metadata_spec.rb b/spec/puppetfiler/metadata_spec.rb
index abc1234..def5678 100644
--- a/spec/puppetfiler/metadata_spec.rb
+++ b/spec/puppetfiler/metadata_spec.rb
@@ -6,7 +6,7 @@ Puppetfiler::Metadata.new('./data/simple_metadata.json')
}
- describe 'instance variables' do
+ describe 'initialization / instance variables' do
it 'sets the path' do
expect(md.path).to eq('./data/simple_metadata.json')
end
|
Change to more apprioriate description
|
diff --git a/Casks/phpstorm-eap.rb b/Casks/phpstorm-eap.rb
index abc1234..def5678 100644
--- a/Casks/phpstorm-eap.rb
+++ b/Casks/phpstorm-eap.rb
@@ -1,6 +1,6 @@ cask :v1 => 'phpstorm-eap' do
- version '141.176'
- sha256 'a5c70789db4aa13c938de761029b15b2348b0a39f7ac549eaa7c82434373caed'
+ version '141.332'
+ sha256 'bddb92b2397798ec634de89e64d3ca797cd47c8efbec8c4fec29d878cbc4b0e8'
url "http://download.jetbrains.com/webide/PhpStorm-EAP-#{version}.dmg"
homepage 'http://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Early+Access+Program'
|
Update PhpStorm-EAP.app to version 141.332.
|
diff --git a/test/tc_terminal.rb b/test/tc_terminal.rb
index abc1234..def5678 100644
--- a/test/tc_terminal.rb
+++ b/test/tc_terminal.rb
@@ -10,6 +10,14 @@
bloom do
saw_input <= stdio
+ end
+end
+
+class StdioEcho
+ include Bud
+
+ bloom do
+ stdio <~ stdio {|s| ["Saw: #{s.line}"]}
end
end
@@ -29,4 +37,20 @@ assert_equal(input_lines.map{|l| [l]}.sort, rv.sort)
b.stop
end
+
+ def test_stdio_pipe
+ in_read, in_write = IO.pipe
+ out_read, out_write = IO.pipe
+
+ b = StdioEcho.new(:stdin => in_read, :stdout => out_write)
+ b.run_bg
+
+ ["foo", "bar", "baz"].each do |str|
+ in_write.puts(str)
+ rv = out_read.gets
+ assert_equal("Saw: #{str}\n", rv)
+ end
+
+ b.stop
+ end
end
|
Add test case for stdio.
Check that reading from / writing to pipe IO objects works. This functionality
is being used by the UCLA folks, so it seems prudent to verify that it works.
|
diff --git a/spec/support/time_travel.rb b/spec/support/time_travel.rb
index abc1234..def5678 100644
--- a/spec/support/time_travel.rb
+++ b/spec/support/time_travel.rb
@@ -17,8 +17,8 @@ raise ArgumentError, "time must be String, Time, or Date: #{time.inspect}"
end
- Time.stub!(:now).and_return(time)
- Date.stub!(:today).and_return(date)
+ Time.stub(:now).and_return(time)
+ Date.stub(:today).and_return(date)
end
def stop_time
|
Fix deprecated method warnings in specs
|
diff --git a/test/test_helper.rb b/test/test_helper.rb
index abc1234..def5678 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -1,7 +1,7 @@ require 'simplecov'
require 'minitest/rg'
-SimpleCov.minimum_coverage_by_file 100
+SimpleCov.minimum_coverage_by_file 90
SimpleCov.start do
add_filter '/test/'
end
|
Reduce minimum test coverage to 90%
Zero tolerance really means zero room for common sense. There are some
lines that are just stupid to test; doing so would inflate the tests for
no benefit.
In the future, we will review the coverage reports and ensure that all
logic is tested, not necessarily all code.
|
diff --git a/test/test_helper.rb b/test/test_helper.rb
index abc1234..def5678 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -23,7 +23,7 @@
class CreateAllTables < ActiveRecord::Migration
def self.up
- create_table(:users) {|t| t.string :first_name; t.integer :last_name }
+ create_table(:users) {|t| t.string :first_name }
end
end
ActiveRecord::Migration.verbose = false
|
Remove last_name column from User table
We are not using it.
https://travis-ci.org/yuki24/did_you_mean/jobs/40365201#L76-L78
|
diff --git a/test/test_helper.rb b/test/test_helper.rb
index abc1234..def5678 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -1,4 +1,5 @@ # coding: UTF-8
+$:.unshift(File.expand_path('../../lib', __FILE__))
Encoding.default_internal = 'UTF-8' if defined? Encoding
require 'test/unit'
|
Add lib to the load path
This allows us to run the test suite without `bundle exec` or run a
single test without having to push lib to the load path.
|
diff --git a/test/test_helper.rb b/test/test_helper.rb
index abc1234..def5678 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -14,6 +14,7 @@
def self.inherited(mod)
mod.app = Object.const_get(mod.to_s[/\w+/])
+ super
end
class << self
|
Make tests run in MiniTest
|
diff --git a/test/test_helper.rb b/test/test_helper.rb
index abc1234..def5678 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -10,3 +10,9 @@ if RUBY_VERSION >= "1.9"
MiniTest::Reporters.use!(MiniTest::Reporters::SpecReporter.new)
end
+
+puts "Webhookr #{Webhookr::VERSION}"
+puts "Webhookr::Mailchimp #{Webhookr::Mailchimp::VERSION}"
+puts "Rails #{Rails::VERSION::STRING}"
+puts "Ruby #{RUBY_VERSION}-p#{RUBY_PATCHLEVEL} - #{RbConfig::CONFIG['RUBY_INSTALL_NAME']}"
+
|
Add version information to test output.
|
diff --git a/big_decimal_helper.gemspec b/big_decimal_helper.gemspec
index abc1234..def5678 100644
--- a/big_decimal_helper.gemspec
+++ b/big_decimal_helper.gemspec
@@ -16,5 +16,5 @@ gem.version = BigDecimalHelper::VERSION
gem.add_development_dependency 'rake', '~> 0.9.2.2'
- gem.add_development_dependency 'rspec', '~> 2.11.0'
+ gem.add_development_dependency 'rspec', '~> 2.14.1'
end
|
Update RSpec to ~> 2.14.1
|
diff --git a/buildr_plus.gemspec b/buildr_plus.gemspec
index abc1234..def5678 100644
--- a/buildr_plus.gemspec
+++ b/buildr_plus.gemspec
@@ -25,6 +25,6 @@ s.rdoc_options = %w(--line-numbers --inline-source --title buildr_plus)
s.add_dependency 'reality-core', '>= 1.8.0'
- s.add_dependency 'reality-naming', '>= 1.9.0'
+ s.add_dependency 'reality-naming', '>= 1.13.0'
s.add_dependency 'zapwhite', '= 2.10.0'
end
|
Move reality-naming to a later version
|
diff --git a/tzinfo-data.gemspec b/tzinfo-data.gemspec
index abc1234..def5678 100644
--- a/tzinfo-data.gemspec
+++ b/tzinfo-data.gemspec
@@ -14,5 +14,5 @@ s.add_runtime_dependency 'tzinfo', '>= 1.0.0'
s.extra_rdoc_files = ['README.md', 'LICENSE']
s.rdoc_options = %w[--title TZInfo::Data --main README.md --exclude definitions --exclude indexes]
- s.required_ruby_version = '>= 1.8.6'
+ s.required_ruby_version = '>= 1.8.7'
end
|
Raise minimum Ruby version to 1.8.7.
minitest v5 is not compatible with Ruby 1.8.6.
|
diff --git a/core/db/migrate/20150528125647_delete_inventory_units_without_shipment.rb b/core/db/migrate/20150528125647_delete_inventory_units_without_shipment.rb
index abc1234..def5678 100644
--- a/core/db/migrate/20150528125647_delete_inventory_units_without_shipment.rb
+++ b/core/db/migrate/20150528125647_delete_inventory_units_without_shipment.rb
@@ -7,7 +7,9 @@ Spree::Order.where(id: order_ids).find_each do |order|
# Order may not be completed but have shipped
# shipments if it has a pending unreturned exchange
- next if order.completed? || order.shipments.any? { |s| s.shipped? }
+ next if order.completed?
+ next if order.canceled?
+ next if order.shipments.any? { |s| s.shipped? || s.ready? || s.canceled? }
say "Removing inventory units without shipment for order ##{order.number}"
order.transaction do
order.inventory_units.destroy_all
|
Update conditions under which the orders are updated
Do not destroy the shipments/inventory units for cancelled orders or orders that have shipments that have either been cancelled or are ready.
|
diff --git a/lib/backup/template.rb b/lib/backup/template.rb
index abc1234..def5678 100644
--- a/lib/backup/template.rb
+++ b/lib/backup/template.rb
@@ -26,7 +26,11 @@ ##
# Returns a String object containing the contents of the file (in the context of the binding if any)
def result(file)
- ERB.new(file_contents(file), nil, "<>").result(binding)
+ if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.0.0")
+ ERB.new(file_contents(file), trim_mode: "<>")
+ else
+ ERB.new(file_contents(file), nil, "<>")
+ end.result(binding)
end
private
|
fix: Handle deprecation in ERB.new arguments
|
diff --git a/app/models/intervention.rb b/app/models/intervention.rb
index abc1234..def5678 100644
--- a/app/models/intervention.rb
+++ b/app/models/intervention.rb
@@ -2,10 +2,6 @@ belongs_to :student
belongs_to :educator
belongs_to :intervention_type
- belongs_to :school_year
- belongs_to :student_school_year
- before_save :assign_to_school_year
- after_create :assign_to_student_school_year
validates :student, :intervention_type, :start_date, presence: true
validate :end_date_cannot_come_before_start_date
@@ -21,19 +17,6 @@ errors.add(:end_date, "can't be before start date")
end
end
- end
-
- ## SCHOOL YEARS ##
-
- def assign_to_school_year
- self.school_year = DateToSchoolYear.new(start_date).convert
- end
-
- def assign_to_student_school_year
- self.student_school_year = StudentSchoolYear.where({
- student_id: student.id, school_year_id: school_year.id
- }).first_or_create!
- save
end
## CHARTS ##
|
Remove before/after events assigning student school years
|
diff --git a/app/models/organization.rb b/app/models/organization.rb
index abc1234..def5678 100644
--- a/app/models/organization.rb
+++ b/app/models/organization.rb
@@ -26,23 +26,4 @@ )
end
- # Search for an Organization
- # @param params can be a Hash of attributes to search on Organization
- # or a String
- # @param one whether to return one record or a list of possible match
- # @param limit number whether to limit the results or not
- def search(params, one, limit)
- results = []
- if params.is_a? Hash
- matches = []
- params.each do |k,v|
- matches << arel_table[k].matches("%#{v}%")
- end
- results = where(matches.reduce(:or)).limit(limit || one && 1)
- elsif params.is_a? String
- results = where(arel_table[:name].matches("%#{params}%")).limit(limit || one && 1)
- end
-
- one.nil? ? results : results.first
- end
end
|
fix(models/orga): Remove useless method on the orga model
|
diff --git a/lib/que/adapters/pg.rb b/lib/que/adapters/pg.rb
index abc1234..def5678 100644
--- a/lib/que/adapters/pg.rb
+++ b/lib/que/adapters/pg.rb
@@ -1,12 +1,14 @@+require 'monitor'
+
module Que
class PG < Adapter
def initialize(pg)
- @pg = pg
- @mutex = Mutex.new
+ @pg = pg
+ @monitor = Monitor.new
end
def checkout
- @mutex.synchronize { yield @pg }
+ @monitor.synchronize { yield @pg }
end
end
end
|
Make sure that locking the bare PG connection is reentrant.
|
diff --git a/lib/registered_path.rb b/lib/registered_path.rb
index abc1234..def5678 100644
--- a/lib/registered_path.rb
+++ b/lib/registered_path.rb
@@ -18,8 +18,8 @@ { :conditions => {:scope => scope} }
}
- after_update { |r| PathRegistry.notify :update, self }
- after_destroy { |r| PathRegistry.notify :destroy, self }
+ after_update { |r| PathRegistry.notify :update, r }
+ after_destroy { |r| PathRegistry.notify :destroy, r }
protected
def assign_scope
|
Use instance as parameter, not class.
|
diff --git a/lib/solusvm/general.rb b/lib/solusvm/general.rb
index abc1234..def5678 100644
--- a/lib/solusvm/general.rb
+++ b/lib/solusvm/general.rb
@@ -0,0 +1,22 @@+module Solusvm
+ class General < Base
+ def nodes(type)
+ type.strip!
+ validate_server_type!(type)
+ perform_request(:action => 'listnodes', :type => type)
+ returned_paramaters['nodes']
+ end
+
+ def templates(type)
+ validate_server_type!(type)
+ perform_request(:action => 'listtemplates', :type => type)
+ returned_paramaters['templates']
+ end
+
+ def node_statistics(nodeid)
+ perform_request(:action => 'node-statistics', :nodeid => nodeid)
+ returned_paramaters
+ end
+
+ end
+end
|
Add General. This methods have no real home ATM
|
diff --git a/lib/swarker/service.rb b/lib/swarker/service.rb
index abc1234..def5678 100644
--- a/lib/swarker/service.rb
+++ b/lib/swarker/service.rb
@@ -2,8 +2,8 @@ class Service
DEFAULT_SCHEMA = {
swagger: '2.0'.freeze,
- consumes: 'application/json'.freeze,
- produces: 'application/json'.freeze,
+ consumes: ['application/json'.freeze],
+ produces: ['application/json'.freeze],
info: { version: '1.0'.freeze }
}
|
Fix Service::DEFAULT_SCHEMA: `consumes` and `:produces` are arrays
|
diff --git a/lib/tasks/migrate.rake b/lib/tasks/migrate.rake
index abc1234..def5678 100644
--- a/lib/tasks/migrate.rake
+++ b/lib/tasks/migrate.rake
@@ -1,7 +1,7 @@ namespace :migrate do
task :swap_old_tag_uniqueness_index => :environment do
Tag.collection.drop_index('tag_id_1') # this is the generated name for the unique index of tags by tag_id
- Tag.collection.create_index([ [:tag_id, Mongo::ASCENDING], [:tag_type, Mongo::ASCENDING] ], unique: true)
+ Rake::Task["db:mongoid:create_indexes"].invoke
end
desc "Sets the businesslink legacy source on all business proposition content"
|
Use Mongoid's rake task to create index
|
diff --git a/lib/zebra/print_job.rb b/lib/zebra/print_job.rb
index abc1234..def5678 100644
--- a/lib/zebra/print_job.rb
+++ b/lib/zebra/print_job.rb
@@ -24,8 +24,8 @@
def check_existent_printers(printer)
existent_printers = Cups.show_destinations
- logger.info "EXISTENT PRINTERS: \n"
- existent_printers.each { |x| logger.info x }
+ puts "EXISTENT PRINTERS: \n"
+ existent_printers.each { |x| puts x }
raise UnknownPrinter.new(printer) unless existent_printers.include?(printer)
end
|
Fix log output statements in print job
|
diff --git a/config/appconfig.rb b/config/appconfig.rb
index abc1234..def5678 100644
--- a/config/appconfig.rb
+++ b/config/appconfig.rb
@@ -11,4 +11,3 @@ $stderr.puts %[FATAL: Unable to load config]
exit 1
end
-
|
Update for changed cloud_controller_ng config path
|
diff --git a/spec/script/mailin_spec.rb b/spec/script/mailin_spec.rb
index abc1234..def5678 100644
--- a/spec/script/mailin_spec.rb
+++ b/spec/script/mailin_spec.rb
@@ -32,6 +32,8 @@ ir = info_requests(:other_request)
incoming_message = ir.incoming_messages[0]
incoming_message.fully_destroy
+ # And get rid of any remaining purge requests
+ PurgeRequest.destroy_all
end
end
|
Deal with further side effects of stuff done outside of a transaction in tests
|
diff --git a/spec/support/vcr_loader.rb b/spec/support/vcr_loader.rb
index abc1234..def5678 100644
--- a/spec/support/vcr_loader.rb
+++ b/spec/support/vcr_loader.rb
@@ -9,5 +9,4 @@ c.filter_sensitive_data('<QT_KEY>') { qt_keys[0] }
c.filter_sensitive_data('<QT_KEY_2>') { qt_keys[1] }
c.hook_into :webmock
- c.debug_logger = $stderr
end
|
Remove the debug logger for cassettes
|
diff --git a/app/models/agenda_day.rb b/app/models/agenda_day.rb
index abc1234..def5678 100644
--- a/app/models/agenda_day.rb
+++ b/app/models/agenda_day.rb
@@ -2,7 +2,7 @@
class AgendaDay < ApplicationRecord
has_many :times, class_name: 'AgendaTime', inverse_of: :day,
- dependent: :destroy
+ dependent: :destroy, foreign_key: :day_id
validates :label, presence: true
|
Add missing foreign_key config for agenda day association
|
diff --git a/app/models/sound_trek.rb b/app/models/sound_trek.rb
index abc1234..def5678 100644
--- a/app/models/sound_trek.rb
+++ b/app/models/sound_trek.rb
@@ -1,5 +1,5 @@ class SoundTrek < ApplicationRecord
validates :location_id, :title, presence: true
belongs_to :trekker, class_name: "User"
- belongs_to :location
+ belongs_to :location, dependent: :destroy
end
|
Add dependent destroy to locations for soundtreks so that pins do not show up on the map when a user deletes soundtrek
|
diff --git a/realtime.gemspec b/realtime.gemspec
index abc1234..def5678 100644
--- a/realtime.gemspec
+++ b/realtime.gemspec
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
s.name = "realtime"
s.version = Realtime::VERSION
- s.authors = ["Mike Atlas", "Ahmad Abdel-Yaman (@ayaman)"]
+ s.authors = ["Mike Atlas", "Ahmad Abdel-Yaman (@ayaman)", "Nick Prokesch (@prokizzle)"]
s.email = ["mike.atlas@gmail.com"]
s.homepage = "http://mikeatlas.github.io/realtime-rails/"
s.summary = "Realtime support for Rails applications."
|
Update gemspec to include credit for @ayaman & @prokizzle
|
diff --git a/atspi_app_driver.gemspec b/atspi_app_driver.gemspec
index abc1234..def5678 100644
--- a/atspi_app_driver.gemspec
+++ b/atspi_app_driver.gemspec
@@ -20,9 +20,9 @@ 'Gemfile'
]
- s.add_dependency('gir_ffi', ['~> 0.13.0'])
+ s.add_dependency('gir_ffi', ['~> 0.14.0'])
s.add_development_dependency('bundler')
- s.add_development_dependency('gir_ffi-gtk', ['~> 0.13.0'])
+ s.add_development_dependency('gir_ffi-gtk', ['~> 0.14.0'])
s.add_development_dependency('minitest', ['~> 5.5'])
s.add_development_dependency('rake', ['~> 12.0'])
end
|
Update gir_ffi and gir_ffi-gtk to 0.14.0
|
diff --git a/evalso.gemspec b/evalso.gemspec
index abc1234..def5678 100644
--- a/evalso.gemspec
+++ b/evalso.gemspec
@@ -18,6 +18,7 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]
+ spec.add_runtime_dependency "httparty"
spec.add_development_dependency "bundler", "~> 1.3"
spec.add_development_dependency "rake"
end
|
Add httparty as a runtime dependency.
|
diff --git a/db/migrate/20081211204952_create_attendees.rb b/db/migrate/20081211204952_create_attendees.rb
index abc1234..def5678 100644
--- a/db/migrate/20081211204952_create_attendees.rb
+++ b/db/migrate/20081211204952_create_attendees.rb
@@ -7,10 +7,11 @@ end
add_index :attendees, [:member_id, :raid_id], :unique => true
+ add_index :attendees, :member_id
+ add_index :attendees, :raid_id
end
def self.down
- remove_index :attendees, :column => [:member_id, :raid_id]
drop_table :attendees
end
end
|
Add indexes to Attendees for some important performance. That table's gonna be biiiiiig.
|
diff --git a/ext/extconf.rb b/ext/extconf.rb
index abc1234..def5678 100644
--- a/ext/extconf.rb
+++ b/ext/extconf.rb
@@ -4,6 +4,9 @@ # See COPYING for license details.
require 'mkmf'
+
+# Compile as C99
+$CFLAGS += " -std=c99"
if ARGV.include?("--use-float") || ARGV.include?("-F")
$CFLAGS += " -DUSE_FLOAT"
|
Add flag to compile as C99.
Because screw C89.
|
diff --git a/ext/commonmarker/extconf.rb b/ext/commonmarker/extconf.rb
index abc1234..def5678 100644
--- a/ext/commonmarker/extconf.rb
+++ b/ext/commonmarker/extconf.rb
@@ -10,6 +10,12 @@
CMARK_DIR = File.expand_path(File.join(File.dirname(__FILE__), 'cmark'))
CMARK_BUILD_DIR = File.join(CMARK_DIR, 'build')
+
+# TODO: we need to clear out the build dir that's erroneously getting packaged
+# this causes problems, as Linux installation is expecting OS X output
+if File.directory?(CMARK_BUILD_DIR) && !File.exist?(ROOT_TMP)
+ FileUtils.rm_rf(CMARK_BUILD_DIR)
+end
FileUtils.mkdir_p(CMARK_BUILD_DIR)
Dir.chdir(CMARK_BUILD_DIR) do
|
Remove packaged build directory prior to installation
|
diff --git a/app/controllers/capacities_controller.rb b/app/controllers/capacities_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/capacities_controller.rb
+++ b/app/controllers/capacities_controller.rb
@@ -1,8 +1,8 @@ class CapacitiesController < ApplicationController
- def new
- @project = Project.find(params[:project_id])
- end
+ def new
+ @project = Project.find(params[:project_id])
+ end
def create
capacity = current_account.capacities.create(capacity_params.merge(project_id: params[:project_id]))
|
Convert to spaces in capacity controller
|
diff --git a/app/controllers/node_types_controller.rb b/app/controllers/node_types_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/node_types_controller.rb
+++ b/app/controllers/node_types_controller.rb
@@ -1,8 +1,4 @@ class NodeTypesController < ApplicationController
- inherit_resources
-
- actions :show
-
def index
@node_types = NodeType.all
@@ -16,7 +12,8 @@ end
def show
- show! do |format|
+ @node_type = NodeType.find(params[:id])
+ respond_to do |format|
format.json { render json: { node_type: @node_type.as_api_response(:ember) }.to_json }
end
end
|
Convert show action to not use inherited_resources
|
diff --git a/db/dev_seeds/sdg.rb b/db/dev_seeds/sdg.rb
index abc1234..def5678 100644
--- a/db/dev_seeds/sdg.rb
+++ b/db/dev_seeds/sdg.rb
@@ -1,3 +1,21 @@ section "Creating Sustainable Development Goals" do
load Rails.root.join("db", "sdg.rb")
+
+ SDG::Target.sample(30).each do |target|
+ title = "Title for default locale"
+ description = "Description for default locale"
+ rand(2..3).times do |n|
+ local_target = SDG::LocalTarget.create!(code: "#{target.code}.#{n + 1}",
+ title: title,
+ description: description,
+ target: target)
+ random_locales.map do |locale|
+ Globalize.with_locale(locale) do
+ local_target.title = "Title for locale #{locale}"
+ local_target.description = "Description for locale #{locale}"
+ local_target.save!
+ end
+ end
+ end
+ end
end
|
Add SDG local targets to development seeds
|
diff --git a/exercises/run-length-encoding/.meta/generator/run_length_encoding_cases.rb b/exercises/run-length-encoding/.meta/generator/run_length_encoding_cases.rb
index abc1234..def5678 100644
--- a/exercises/run-length-encoding/.meta/generator/run_length_encoding_cases.rb
+++ b/exercises/run-length-encoding/.meta/generator/run_length_encoding_cases.rb
@@ -1,6 +1,10 @@ require 'generator/exercise_cases'
class RunLengthEncodingCase < Generator::ExerciseCase
+
+ def name
+ super.sub('test_',"test_#{property}_")
+ end
def workload
indent_lines([
|
Add method name to test name.
Adds encode_ or decode_ as a prefix to all tests depending on the method
being tested.
This fixes a name collision bug between:
def test_empty_string for encode
and
def test_empty_string for decode
|
diff --git a/mrblib/default_trap.rb b/mrblib/default_trap.rb
index abc1234..def5678 100644
--- a/mrblib/default_trap.rb
+++ b/mrblib/default_trap.rb
@@ -2,5 +2,7 @@ case sig
when "INT"
Signal.trap(sig) { raise Interrupt, "" }
+ when "HUP", "TERM", "QUIT", "ALRM", "USR1", "USR2"
+ Signal.trap(sig) { raise SignalException.new("SIG#{sig}", no) }
end
end
|
Set default trap functions same as CRuby
|
diff --git a/fuubar.gemspec b/fuubar.gemspec
index abc1234..def5678 100644
--- a/fuubar.gemspec
+++ b/fuubar.gemspec
@@ -29,5 +29,5 @@ s.require_paths = ['lib']
s.add_dependency 'rspec', '~> 2.0'
- s.add_dependency 'ruby-progressbar', '~> 1.0'
+ s.add_dependency 'ruby-progressbar', '~> 1.3'
end
|
Upgrade ruby-progressbar to the latest version
|
diff --git a/app/helpers/address_helper.rb b/app/helpers/address_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/address_helper.rb
+++ b/app/helpers/address_helper.rb
@@ -1,7 +1,7 @@ module AddressHelper
def hidden_tr_if(condition, attributes = {})
- attributes["style"] = "visibility:hidden;" if condition
+ attributes["style"] = "display:none;" if condition
attrs = tag_options(attributes.stringify_keys)
"<tr #{attrs}>"
end
|
Use display:none to to hide secondardy contact, instead of visibility:hidden
|
diff --git a/app/helpers/sidebar_helper.rb b/app/helpers/sidebar_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/sidebar_helper.rb
+++ b/app/helpers/sidebar_helper.rb
@@ -20,8 +20,14 @@ end
def experiment_action_to_link_to(experiment)
- # TODO
- canvas_experiment_path(experiment)
+ case action_name
+ when 'samples'
+ return samples_experiment_path(experiment)
+ when 'archive'
+ return module_archive_experiment_url(experiment)
+ else
+ return canvas_experiment_path(experiment)
+ end
end
def module_action_to_link_to(my_module)
|
Update experiment links on sidebar between actions
|
diff --git a/test/controllers/optional_modules/blogs/blog_categories_controller_test.rb b/test/controllers/optional_modules/blogs/blog_categories_controller_test.rb
index abc1234..def5678 100644
--- a/test/controllers/optional_modules/blogs/blog_categories_controller_test.rb
+++ b/test/controllers/optional_modules/blogs/blog_categories_controller_test.rb
@@ -5,8 +5,97 @@ # == BlogCategoriesController Test
#
class BlogCategoriesControllerTest < ActionController::TestCase
+ include Devise::TestHelpers
+ include Rails.application.routes.url_helpers
+
+ setup :initialize_test
+
+ #
+ # == Routes / Templates / Responses
+ #
test 'should get show' do
- get :show
- assert_response :success
+ @locales.each do |locale|
+ I18n.with_locale(locale) do
+ get :show, locale: locale.to_s, id: @blog_category
+ assert_response :success
+ end
+ end
+ end
+
+ test 'assert integrity of request for each locales' do
+ @locales.each do |locale|
+ I18n.with_locale(locale) do
+ get :show, locale: locale.to_s, id: @blog_category
+ assert_equal request.path_parameters[:id], @blog_category.slug
+ assert_equal request.path_parameters[:locale], locale.to_s
+ end
+ end
+ end
+
+ #
+ # == Menu offline
+ #
+ test 'should render 404 if menu item is offline' do
+ @menu.update_attribute(:online, false)
+ assert_not @menu.online, 'menu item should be offline'
+
+ @locales.each do |locale|
+ I18n.with_locale(locale.to_s) do
+ assert_raises(ActionController::RoutingError) do
+ get :show, locale: locale.to_s, id: @blog_category
+ end
+ end
+ end
+ end
+
+ #
+ # == Module disabled
+ #
+ test 'should render 404 if module is disabled' do
+ disable_optional_module @super_administrator, @blog_module, 'Blog' # in test_helper.rb
+ @locales.each do |locale|
+ I18n.with_locale(locale.to_s) do
+ assert_raises(ActionController::RoutingError) do
+ get :show, locale: locale.to_s, id: @blog_category
+ end
+ end
+ end
+ end
+
+ #
+ # == Maintenance
+ #
+ test 'should render maintenance if enabled and not connected' do
+ assert_maintenance_frontend(:show, @blog_category)
+ end
+
+ test 'should not render maintenance even if enabled and SA' do
+ sign_in @super_administrator
+ assert_no_maintenance_frontend(:show, @blog_category)
+ end
+
+ test 'should not render maintenance even if enabled and Admin' do
+ sign_in @administrator
+ assert_no_maintenance_frontend(:show, @blog_category)
+ end
+
+ test 'should render maintenance if enabled and subscriber' do
+ sign_in @subscriber
+ assert_maintenance_frontend(:show, @blog_category)
+ end
+
+ private
+
+ def initialize_test
+ @locales = I18n.available_locales
+ @setting = settings(:one)
+ @menu = menus(:blog)
+
+ @blog_module = optional_modules(:blog)
+ @blog_category = blog_categories(:one)
+
+ @subscriber = users(:alice)
+ @administrator = users(:bob)
+ @super_administrator = users(:anthony)
end
end
|
Add tests for BlogCategories controller
|
diff --git a/app/processors/application.rb b/app/processors/application.rb
index abc1234..def5678 100644
--- a/app/processors/application.rb
+++ b/app/processors/application.rb
@@ -1,7 +1,21 @@ class ApplicationProcessor < ActiveMessaging::Processor
def ActiveMessaging.logger
- @@logger = Logger.new(File.join(RAILS_ROOT, "log", "message_processing.log"))
+ @@logger ||= begin
+ logger = ActiveSupport::BufferedLogger.new(File.join(RAILS_ROOT, "log", "message_processing.log"))
+ logger.level = ActiveSupport::BufferedLogger.const_get(Rails.configuration.log_level.to_s.upcase)
+ if Rails.configuration.environment == "production"
+ logger.auto_flushing = false
+ end
+ logger
+ rescue StandardError => e
+ logger = ActiveSupport::BufferedLogger.new(STDERR)
+ logger.level = ActiveSupport::BufferedLogger::WARN
+ logger.warn(
+ "Rails Error: Unable to access log file. Please ensure that #{configuration.log_path} exists and is chmod 0666. " +
+ "The log level has been raised to WARN and the output directed to STDERR until the problem is fixed."
+ )
+ end
end
# Default on_error implementation - logs standard errors but keeps processing. Other exceptions are raised.
|
Use the BufferedLogger from ActiveSupport for message process loggin
|
diff --git a/test/unit/callback_helper_test.rb b/test/unit/callback_helper_test.rb
index abc1234..def5678 100644
--- a/test/unit/callback_helper_test.rb
+++ b/test/unit/callback_helper_test.rb
@@ -2,19 +2,21 @@ require "gir_ffi/callback_helper"
describe GirFFI::CallbackHelper do
- describe ".map_single_callback_arg" do
- it "correctly maps a :struct type" do
- GirFFI.setup :GObject
+ describe "::map_single_callback_arg" do
+ it "maps a :struct type by building the type and wrapping the argument in it" do
+ cinfo = get_introspection_data 'GObject', 'ClosureMarshal'
+ ainfo = cinfo.args[0]
+ ifinfo = ainfo.argument_type.interface
- cl = GObject::Closure.new_simple GObject::Closure::Struct.size, nil
+ assert_equal :struct, ifinfo.info_type
- cinfo = GObjectIntrospection::IRepository.default.find_by_name 'GObject', 'ClosureMarshal'
- ainfo = cinfo.args[0]
+ struct_class = Class.new
+ mock(GirFFI::Builder).build_class(ifinfo) { struct_class }
+ mock(struct_class).wrap("dummy") { "good-result" }
- r = GirFFI::CallbackHelper.map_single_callback_arg cl.to_ptr, ainfo
+ r = GirFFI::CallbackHelper.map_single_callback_arg "dummy", ainfo
- assert_instance_of GObject::Closure, r
- assert_equal r.to_ptr, cl.to_ptr
+ assert_equal "good-result", r
end
end
end
|
Test callback helper without setting up GObject.
|
diff --git a/lib/hosted_graphite/tcp.rb b/lib/hosted_graphite/tcp.rb
index abc1234..def5678 100644
--- a/lib/hosted_graphite/tcp.rb
+++ b/lib/hosted_graphite/tcp.rb
@@ -1,8 +1,13 @@ module HostedGraphite
class TCP < Protocol
private
- def build_message(name, value)
- message = [name, value].join(' ') + "\n"
+ def build_message(name, value, timestamp = nil)
+ if timestamp
+ message = [name, value, timestamp].join(' ') + "\n"
+ else
+ message = [name, value].join(' ') + "\n"
+ end
+
[@api_key, message].join('.')
end
|
Configure TCP protocol to accept an optional timestamp
|
diff --git a/lib/mutant/node_helpers.rb b/lib/mutant/node_helpers.rb
index abc1234..def5678 100644
--- a/lib/mutant/node_helpers.rb
+++ b/lib/mutant/node_helpers.rb
@@ -15,10 +15,14 @@ end
module_function :s
- NAN = s(:begin, s(:send, s(:float, 0.0), :/, s(:args, s(:float, 0.0))))
- NEGATIVE_INFINITY = s(:begin, s(:send, s(:float, -1.0), :/, s(:args, s(:float, 0.0))))
- INFINITY = s(:begin, s(:send, s(:float, 1.0), :/, s(:args, s(:float, 0.0))))
- NEW_OBJECT = s(:send, s(:const, s(:cbase), :Object), :new)
+ NAN =
+ s(:begin, s(:send, s(:float, 0.0), :/, s(:args, s(:float, 0.0))))
+ INFINITY =
+ s(:begin, s(:send, s(:float, 1.0), :/, s(:args, s(:float, 0.0))))
+ NEW_OBJECT =
+ s(:send, s(:const, s(:cbase), :Object), :new)
+ NEGATIVE_INFINITY =
+ s(:begin, s(:send, s(:float, -1.0), :/, s(:args, s(:float, 0.0))))
RAISE = s(:send, nil, :raise)
|
Fix style issues in Mutant::NodeHelpers
|
diff --git a/roles/tilecache.rb b/roles/tilecache.rb
index abc1234..def5678 100644
--- a/roles/tilecache.rb
+++ b/roles/tilecache.rb
@@ -13,7 +13,7 @@ :sources => ["nginx"]
},
:nginx => {
- :access_log => nil
+ :access_log => false
},
:sysctl => {
:network_conntrack_time_wait => {
|
Disable nginx logging on tile caches
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.