diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/spec/functional/fc108_spec.rb b/spec/functional/fc108_spec.rb
index abc1234..def5678 100644
--- a/spec/functional/fc108_spec.rb
+++ b/spec/functional/fc108_spec.rb
@@ -30,4 +30,14 @@ EOF
it { is_expected.to_not violate_rule }
end
+
+ context "with a cookbook with a custom resource where a property contains a name symbol" do
+ recipe_file <<-EOF
+ property :foo, Symbol, default: :name
+
+ action :create do
+ end
+ EOF
+ it { is_expected.to_not violate_rule }
+ end
end
|
Add functional spec for a :name symbol
Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
|
diff --git a/app/mailers/project_notification_mailer.rb b/app/mailers/project_notification_mailer.rb
index abc1234..def5678 100644
--- a/app/mailers/project_notification_mailer.rb
+++ b/app/mailers/project_notification_mailer.rb
@@ -0,0 +1,26 @@+class ProjectNotificationMailer < ApplicationMailer
+ attr_reader :project_check
+
+ def check_reminder(notification, project_check)
+ @project_check = project_check
+ mail(to: compose_email,
+ subject: compose_subject) do |format|
+ format.text { render inline: notification }
+ end
+ end
+
+ private
+
+ def compose_subject
+ "Reminders: next #{project_check.reminder.name}
+ in #{project_check.project.name}"
+ end
+
+ def compose_email
+ "#{slugified_project_name}-team@netguru.pl"
+ end
+
+ def slugified_project_name
+ project_check.project.name.sub(" ", "-")
+ end
+end
|
Add mailer for sending reminding's notifications
|
diff --git a/spec/support/email_helpers.rb b/spec/support/email_helpers.rb
index abc1234..def5678 100644
--- a/spec/support/email_helpers.rb
+++ b/spec/support/email_helpers.rb
@@ -7,9 +7,13 @@ end
end
-def receive_incoming_mail(email_name, email_to, email_from = 'geraldinequango@localhost')
- email_name = file_fixture_name(email_name)
- content = File.open(email_name, 'rb') { |f| f.read }
+def receive_incoming_mail(email_name_or_string, email_to, email_from = 'geraldinequango@localhost')
+ email_name = file_fixture_name(email_name_or_string)
+ content = if File.exist?(email_name)
+ File.open(email_name, 'rb') { |f| f.read }
+ else
+ email_name_or_string
+ end
content.gsub!('EMAIL_TO', email_to)
content.gsub!('EMAIL_FROM', email_from)
RequestMailer.receive(content)
|
Allow receive_incoming_mail to receive a String
You can now send a string rather than a filename to the
receive_incoming_mail spec helper.
For example:
spam_email = <<-EOF
From: EMAIL_FROM
To: FOI Person <EMAIL_TO>
Subject: Test Email
Plz buy my spam
EOF
receive_incoming_mail(spam_email,
info_request.incoming_email,
'spammer@example.com')
|
diff --git a/tzinfo.gemspec b/tzinfo.gemspec
index abc1234..def5678 100644
--- a/tzinfo.gemspec
+++ b/tzinfo.gemspec
@@ -14,4 +14,27 @@ s.require_path = 'lib'
s.extra_rdoc_files = ['README', 'CHANGES', 'LICENSE']
s.required_ruby_version = '>= 1.8.6'
+
+ s.post_install_message = <<END
+
+TZInfo Timezone Data has been Moved
+===================================
+
+The timezone data previously included with TZInfo as Ruby modules has now been
+moved to a separate tzinfo-data gem. TZInfo also now supports using the system
+zoneinfo files on Linux, Mac OS X and other Unix operating systems.
+
+If you want to continue using the Ruby timezone modules, or you are using an
+operating system that does not include zoneinfo files (such as
+Microsoft Windows), you will need to install tzinfo-data by running:
+
+gem install tzinfo-data
+
+If tzinfo-data is installed, TZInfo will use the Ruby timezone modules.
+Otherwise, it will attempt to find the system zoneinfo files. Please refer to
+the TZInfo documentation (available from http://tzinfo.rubyforge.org) for
+further information.
+
+END
+
end
|
Add a post_install_message to the gem to inform users that the Ruby data modules have been moved.
|
diff --git a/app/controllers/rpt/tournament_reports_controller.rb b/app/controllers/rpt/tournament_reports_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/rpt/tournament_reports_controller.rb
+++ b/app/controllers/rpt/tournament_reports_controller.rb
@@ -7,7 +7,7 @@ @tournament = Tournament.yr(@year).find(params[:id])
@page_title = @tournament.name
- @players = @tournament.attendees.where(:cancelled => false)
+ @players = @tournament.attendees.where(:cancelled => false).order('rank ASC')
@aga_member_info = AGATDList.data
|
Order players in tournament reports by rank
|
diff --git a/app/helpers/provider_configuration_manager_helper.rb b/app/helpers/provider_configuration_manager_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/provider_configuration_manager_helper.rb
+++ b/app/helpers/provider_configuration_manager_helper.rb
@@ -13,8 +13,7 @@ def textual_hostname
{:label => _("Hostname"),
:icon => "ff ff-configured-system",
- :value => @record.hostname,
- }
+ :value => @record.hostname, }
end
def textual_ipmi_present
@@ -33,8 +32,7 @@ {:label => _("Provider"),
:image => @record.configuration_manager.decorate.fileicon,
:value => @record.configuration_manager.try(:name),
- :explorer => true
- }
+ :explorer => true}
end
def textual_zone
|
Fix rubocop warnings in ProviderConfigurationManagerHelper
|
diff --git a/lib/drug-bot/plugins/reddit.rb b/lib/drug-bot/plugins/reddit.rb
index abc1234..def5678 100644
--- a/lib/drug-bot/plugins/reddit.rb
+++ b/lib/drug-bot/plugins/reddit.rb
@@ -21,6 +21,7 @@ def call(connection, message)
if message[:command] == "JOIN" && message[:nick] == connection.options[:nick]
EventMachine::add_periodic_timer(30) do
+ @last_update = Time.now
c_http = EM::Protocols::HttpClient2.connect 'www.reddit.com', 80
http = c_http.get "/r/ruby/.rss"
@@ -36,7 +37,6 @@ end
def save
- @last_update = Time.now
file = File.open(@config + "/last_update.yml", "w"){|f| f.write YAML::dump(@last_update)}
end
end
|
Move last update before request
|
diff --git a/lib/facebooker/models/album.rb b/lib/facebooker/models/album.rb
index abc1234..def5678 100644
--- a/lib/facebooker/models/album.rb
+++ b/lib/facebooker/models/album.rb
@@ -5,7 +5,7 @@ class Album
include Model
attr_accessor :aid, :cover_pid, :owner, :name, :created,
- :modified, :description, :location, :link, :size
+ :modified, :description, :location, :link, :size, :visible
end
end
|
Add :visible attr_accessor to Facebooker:Album model
|
diff --git a/lib/facter/java_patch_level.rb b/lib/facter/java_patch_level.rb
index abc1234..def5678 100644
--- a/lib/facter/java_patch_level.rb
+++ b/lib/facter/java_patch_level.rb
@@ -14,7 +14,7 @@ setcode do
java_version = Facter.value(:java_version)
if java_version.nil?
- "NOT_INSTALLED"
+ "JAVA_NOT_INSTALLED"
else
java_patch_level = java_version.strip.split('_')[1]
end
|
Change to more specific message about java
|
diff --git a/lib/bundler_help.rb b/lib/bundler_help.rb
index abc1234..def5678 100644
--- a/lib/bundler_help.rb
+++ b/lib/bundler_help.rb
@@ -4,7 +4,7 @@ paths = [File.expand_path('.'), File.expand_path('..')]
paths.each do |path|
path_arr = path.split(File::SEPARATOR).map {|x| x=='' ? File::SEPARATOR : x}
- while path_arr.length > 0 do
+ until path_arr.empty? do
test = File.join(path_arr, dir_name)
return test if Dir.exists?(test)
path_arr.pop
|
Allow other engines to be checked out in parallel with stash_engine as well as in subdirectories
|
diff --git a/core/process/times_spec.rb b/core/process/times_spec.rb
index abc1234..def5678 100644
--- a/core/process/times_spec.rb
+++ b/core/process/times_spec.rb
@@ -25,7 +25,7 @@ skip "getrusage is not supported on this environment"
end
- found = (max * 10).times.find do
+ found = (max * 100).times.find do
time = Process.times.utime
('%.6f' % time).end_with?('000')
end
|
Increase the number of Process.times attempts
CI of 5806c54447439f2ba22892e4045e78dd80f96f0c did not succeed
https://travis-ci.org/github/ruby/ruby/jobs/668072714
|
diff --git a/descendants_tracker.gemspec b/descendants_tracker.gemspec
index abc1234..def5678 100644
--- a/descendants_tracker.gemspec
+++ b/descendants_tracker.gemspec
@@ -16,7 +16,7 @@ gem.test_files = `git ls-files -- spec/unit`.split($/)
gem.extra_rdoc_files = %w[LICENSE README.md TODO]
- gem.add_development_dependency('rake', '~> 10.0.3')
- gem.add_development_dependency('rspec', '~> 1.3.2')
- gem.add_development_dependency('yard', '~> 0.8.4.1')
+ gem.add_development_dependency('rake', '~> 10.0.4')
+ gem.add_development_dependency('rspec', '~> 2.13.0')
+ gem.add_development_dependency('yard', '~> 0.8.5.2')
end
|
Upgrade gem dependencies in gemspec
|
diff --git a/config/application.rb b/config/application.rb
index abc1234..def5678 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -22,5 +22,12 @@
# Do not swallow errors in after_commit/after_rollback callbacks.
config.api_only = false
+
+ config.action_dispatch.default_headers = {
+ 'Access-Control-Allow-Origin' => ENV['ACCESS_CONTROL_ALLOW_ORIGIN'] || '*',
+ 'Access-Control-Allow-Credentials' => 'true',
+ 'Access-Control-Request-Method' => '*',
+ 'Access-Control-Allow-Headers' => 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Mx-ReqToken,X-Requested-With',
+ }
end
end
|
Add CORS headers: use ENV['ACCESS_CONTROL_ALLOW_ORIGIN']
|
diff --git a/config/application.rb b/config/application.rb
index abc1234..def5678 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -6,6 +6,24 @@ require 'rack/gridfs'
Bundler.require(:default, Rails.env) if defined?(Bundler)
+
+# Allow datajam_* engines to override Datajam core classes
+require 'active_support/dependencies'
+module ActiveSupport::Dependencies
+ alias_method :require_or_load_without_multiple, :require_or_load
+ def require_or_load(file_name, const_path = nil)
+ require_or_load_without_multiple(file_name, const_path)
+ if file_name.starts_with?(Rails.root.to_s + '/app')
+ relative_name = file_name.gsub(Rails.root.to_s, '')
+ @engine_paths ||= Rails::Application::Railties.engines.collect{|engine| engine.config.root.to_s }
+ @datajam_engine_paths ||= @engine_paths.reject{ |path| path.split('/').last.match(/^datajam_/).blank? }
+ @datajam_engine_paths.each do |path|
+ engine_file = File.join(path, relative_name)
+ require_or_load_without_multiple(engine_file, const_path) if File.file?(engine_file)
+ end
+ end
+ end
+end
module Datajam
class Application < Rails::Application
|
Allow datajam_* engines to override Datajam core classes
|
diff --git a/Formula/git.rb b/Formula/git.rb
index abc1234..def5678 100644
--- a/Formula/git.rb
+++ b/Formula/git.rb
@@ -15,7 +15,7 @@ ENV['NO_FINK']='1'
ENV['NO_DARWIN_PORTS']='1'
- system "./configure --prefix='#{prefix}' --disable-debug"
+ system "./configure --prefix=#{prefix}"
system "make install"
# these files are exact copies of the git binary, so like the contents
@@ -26,7 +26,7 @@ (bin+fn).unlink
(bin+fn).make_link bin+'git'
end
-
+
# we could build the manpages ourselves, but the build process depends
# on many other packages, and is somewhat crazy, this way is easier
GitManuals.new.brew { man.install Dir['*'] }
|
Fix some "GCC cannot create executables"
This regards Issue Homebrew/homebrew#30.
Turns out -march=native isn't supported by Apple's GCC, but while investigating it I found they'd back ported the -march=core2 option, so we win anyway.
Logic reverted to how it was yesterday.
I moved the gcc options stuff back to brewkit.rb as we manipulate the cflags more later and it seemed bad form to split the logic for this area over two files.
Additionally the brew command exits immediately on powerpc now. Brewkit doesn't throw as theoretically it is a useful library file for other projects.
|
diff --git a/Formula/kpt.rb b/Formula/kpt.rb
index abc1234..def5678 100644
--- a/Formula/kpt.rb
+++ b/Formula/kpt.rb
@@ -15,8 +15,8 @@ class Kpt < Formula
desc "Toolkit to manage,and apply Kubernetes Resource config data files"
homepage "https://googlecontainertools.github.io/kpt"
- url "https://github.com/GoogleContainerTools/kpt/archive/v0.14.0.tar.gz"
- sha256 "44ceedf39e753b3767c6e6a05f38b784ac06f31523e2a84f53e9798ab60c1ad7"
+ url "https://github.com/GoogleContainerTools/kpt/archive/v0.15.0.tar.gz"
+ sha256 "ce53ca42c991224e725d34b41f7646d53d98e6d19702562e049a2cf21c00984b"
depends_on "go" => :build
|
Update homebrew version to v0.15.0
|
diff --git a/lib/naifa/config.rb b/lib/naifa/config.rb
index abc1234..def5678 100644
--- a/lib/naifa/config.rb
+++ b/lib/naifa/config.rb
@@ -13,7 +13,7 @@ def self.settings
@settings ||= begin
loaded_settings = YAML.load(File.read('.naifa')).with_indifferent_access if File.exists?('.naifa')
- if !loaded_settings.nil? && loaded_settings[:version] != SETTINGS_VERSION
+ if !loaded_settings.nil? && loaded_settings.delete(:version) != SETTINGS_VERSION
raise 'Configuration file version is not supported. Please upgrade!'
end
loaded_settings
|
Delete version from the settings to avoid getting a version command.
|
diff --git a/lib/plover/files.rb b/lib/plover/files.rb
index abc1234..def5678 100644
--- a/lib/plover/files.rb
+++ b/lib/plover/files.rb
@@ -11,7 +11,11 @@ def by_role(role)
@yaml_hash.select {|server| server[:role] == role}
end
-
+
+ def by_roles(*roles)
+ @yaml_hash.select {|server| roles.include?(server[:role])}
+ end
+
def write
File.open(@path, 'w') do |out|
puts "Writing out #{@path}"
|
Add by_roles for multirole finding.
|
diff --git a/spec/features/import_csv_data_spec.rb b/spec/features/import_csv_data_spec.rb
index abc1234..def5678 100644
--- a/spec/features/import_csv_data_spec.rb
+++ b/spec/features/import_csv_data_spec.rb
@@ -12,6 +12,6 @@
it "can import csv data" do
visit display_csv_user_competition_import_results_path(User.first, @competition)
- expect(page).to have_content 'Import CSV Data'
+ expect(page).to have_content 'CSV Import'
end
end
|
Fix import feature spec (broken due to text search)
|
diff --git a/spec/support/concerns/content_type.rb b/spec/support/concerns/content_type.rb
index abc1234..def5678 100644
--- a/spec/support/concerns/content_type.rb
+++ b/spec/support/concerns/content_type.rb
@@ -15,6 +15,6 @@ end
it '#respond_to?' do
- expect(build(klass)).to respond_to(:column)
+ expect(build(klass)).to respond_to(:column, :parent, :content_type_is?)
end
end
|
Add more respond_to checks for the content type shared examples.
|
diff --git a/test/integration/test_listing_scenarios.rb b/test/integration/test_listing_scenarios.rb
index abc1234..def5678 100644
--- a/test/integration/test_listing_scenarios.rb
+++ b/test/integration/test_listing_scenarios.rb
@@ -30,6 +30,7 @@ expected_output << "1. Eat tiger meat\n"
expected_output << "2. Swallow a pencil\n"
expected_output << "3. Exit\n"
+ expected_output << exit_from(pipe)
pipe.close_write
shell_output = pipe.read
end
|
Fix final highline errors printed in test output.
|
diff --git a/spec/commands/remove_spec.rb b/spec/commands/remove_spec.rb
index abc1234..def5678 100644
--- a/spec/commands/remove_spec.rb
+++ b/spec/commands/remove_spec.rb
@@ -0,0 +1,40 @@+# frozen_string_literal: true
+
+RSpec.describe "bundle remove", :focus do
+ context "remove a specific gem from gemfile when gem is present in gemfile" do
+ before do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+ gem "rails"
+ gem "rack"
+ G
+ end
+
+ it "removes successfully" do
+ bundle "remove rack"
+ expect(out).to include("rack(>= 0) was removed.")
+ end
+
+ it "displays warning that gemfile is empty when removing last gem" do
+ bundle "remove rails"
+ bundle "remove rack"
+ expect(out).to include("rack(>= 0) was removed.")
+ expect(out).to include("The Gemfile specifies no dependencies")
+ end
+ end
+
+ context "remove a specific gem from gemfile when gem is not present in gemfile" do
+ before do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+ gem "rails"
+ G
+ end
+
+ it "throws error" do
+ bundle "remove rack"
+ expect(out).to include("You cannot remove a gem which not specified in Gemfile.")
+ expect(out).to include("rack is not specified in Gemfile so not removed.")
+ end
+ end
+end
|
Add specs for remove command
|
diff --git a/spec/defines/archive_spec.rb b/spec/defines/archive_spec.rb
index abc1234..def5678 100644
--- a/spec/defines/archive_spec.rb
+++ b/spec/defines/archive_spec.rb
@@ -10,7 +10,7 @@ end
context 'without parameters' do
- it { expect { is_expected.to compile.with_all_deps }.to raise_error(/Must pass url/) }
+ it { expect { is_expected.to compile.with_all_deps }.to raise_error(/Must pass/) }
end
context 'with url, without target' do
|
Fix unit tests on ruby 1.8.7
|
diff --git a/spec/sorted_pipeline_spec.rb b/spec/sorted_pipeline_spec.rb
index abc1234..def5678 100644
--- a/spec/sorted_pipeline_spec.rb
+++ b/spec/sorted_pipeline_spec.rb
@@ -15,10 +15,9 @@ end
it "uses sorted input files for #output_files" do
- # only 2 files in this test. Return 1 so the
- # first comparison reorders the array
+ # Reverse sort
pipeline.comparator = proc { |f1, f2|
- 1
+ f2 <=> f1
}
pipeline.input_files = [input_file("jquery.js"), input_file("jquery_ui.js")]
|
Fix test failure caused by JRuby's different handling of sort
|
diff --git a/lib/benchmark/memory.rb b/lib/benchmark/memory.rb
index abc1234..def5678 100644
--- a/lib/benchmark/memory.rb
+++ b/lib/benchmark/memory.rb
@@ -1,5 +1,4 @@ require "benchmark/memory/errors"
-require "benchmark/memory/helpers"
require "benchmark/memory/job"
require "benchmark/memory/version"
@@ -13,7 +12,7 @@ # @return [Report]
def memory
unless block_given?
- fail ConfigurationError, "You did you give a test block to your call to `Benchmark.memory`".freeze
+ fail ConfigurationError, "You did not give a test block to your call to `Benchmark.memory`".freeze
end
job = Job.new
|
Remove an unnecessary require and fix a typo
|
diff --git a/lib/capistrano/setup.rb b/lib/capistrano/setup.rb
index abc1234..def5678 100644
--- a/lib/capistrano/setup.rb
+++ b/lib/capistrano/setup.rb
@@ -1,10 +1,15 @@ include Capistrano::DSL
-load 'capistrano/defaults.rb'
+namespace :load do
+ task :defaults do
+ load 'capistrano/defaults.rb'
+ load 'config/deploy.rb'
+ end
+end
stages.each do |stage|
Rake::Task.define_task(stage) do
- load "config/deploy.rb"
+ invoke 'load:defaults'
load "config/deploy/#{stage}.rb"
load "capistrano/#{fetch(:scm)}.rb"
set(:stage, stage.to_sym)
@@ -13,5 +18,4 @@ end
end
-
require 'capistrano/dotfile'
|
Add a task to load defaults
Now gems can implement a 'load:defaults' task in order to set any
defaults that may rely on other varibles set in stage configuration.
namespace :load do
task :defaults do
set :my_file, release_path.join('my_file')
end
end
|
diff --git a/lib/rbNFA.rb b/lib/rbNFA.rb
index abc1234..def5678 100644
--- a/lib/rbNFA.rb
+++ b/lib/rbNFA.rb
@@ -51,8 +51,22 @@ end
end
+ class ZeroOrOneToken
+ def initialize
+ raise "Use as class constant"
+ end
+
+ def self.cover(char)
+ return char == "?"
+ end
+
+ def self.create(char)
+ return self
+ end
+ end
+
class Lexer
- @@tokens = [ LiteralToken, OneOrMoreToken, ZeroOrMoreToken]
+ @@tokens = [ LiteralToken, OneOrMoreToken, ZeroOrMoreToken, ZeroOrOneToken]
def lex(regexp)
regexp.chars.map do |char|
|
Add implementation for zero or one token in lexer
|
diff --git a/.test.rb b/.test.rb
index abc1234..def5678 100644
--- a/.test.rb
+++ b/.test.rb
@@ -1,8 +1,9 @@-Test.run(:common) do |run|
+Test.run(:default) do |run|
run.files << 'test/*_case.rb'
end
Test.run(:cov) do |run|
+ run.files << 'test/*_case.rb'
SimpleCov.start do |cov|
cov.coverage_dir = 'log/coverage'
end
|
Use default rather than common. [admin]
|
diff --git a/rucs.rb b/rucs.rb
index abc1234..def5678 100644
--- a/rucs.rb
+++ b/rucs.rb
@@ -0,0 +1,8 @@+#!/usr/bin/ruby
+
+# The URL's to download the customer data.
+DATA = [];
+
+(0..9).each do |termination|
+ DATA.push("http://www.set.gov.py/portal/PARAGUAY-SET/detail?folder-id=repository:collaboration:/sites/PARAGUAY-SET/categories/SET/Informes%20Periodicos/listado-de-ruc-con-sus-equivalencias&content-id=/repository/collaboration/sites/PARAGUAY-SET/documents/informes-periodicos/ruc/ruc#{termination}.zip")
+end
|
Add the base URL to download data
|
diff --git a/lib/bluster.rb b/lib/bluster.rb
index abc1234..def5678 100644
--- a/lib/bluster.rb
+++ b/lib/bluster.rb
@@ -7,7 +7,6 @@
module Bluster
def self.create_cluster(name, listener, options = {})
- config = Bluster::ClusterConfig.create(options)
- Ordasity::Cluster.new(name, listener, config)
+ Ordasity::Cluster.new(name, listener, ClusterConfig.create(options))
end
end
|
Remove superfluous variable in Bluster.create_cluster
|
diff --git a/lib/chamber.rb b/lib/chamber.rb
index abc1234..def5678 100644
--- a/lib/chamber.rb
+++ b/lib/chamber.rb
@@ -3,8 +3,6 @@ require 'chamber/rails'
module Chamber
- extend self
-
def load(options = {})
self.instance = Instance.new(options)
end
@@ -38,4 +36,12 @@ def respond_to_missing?(name, include_private = false)
instance.respond_to?(name, include_private)
end
+
+ module_function :load,
+ :to_s,
+ :env,
+ :instance,
+ :instance=,
+ :method_missing,
+ :respond_to_missing?
end
|
Style: Convert 'extend self' to 'module_function'
--------------------------------------------------------------------------------
Change-Id: I706c404fae374cd39acf66131b099dd1ebf91296
Signed-off-by: Jeff Felchner <8a84c204e2d4c387d61d20f7892a2bbbf0bc8ae8@thekompanee.com>
|
diff --git a/recipes/nginx.rb b/recipes/nginx.rb
index abc1234..def5678 100644
--- a/recipes/nginx.rb
+++ b/recipes/nginx.rb
@@ -1,3 +1,5 @@+# Encoding: utf-8
+
# Cookbook Name:: roundcube
# Recipe:: nginx
#
|
Add encoding header back CHEF-3304 - use modification of config.rb instead as workaround.
|
diff --git a/lib/solidus.rb b/lib/solidus.rb
index abc1234..def5678 100644
--- a/lib/solidus.rb
+++ b/lib/solidus.rb
@@ -7,8 +7,8 @@ begin
require 'protected_attributes'
puts "*" * 75
- puts "[FATAL] Spree does not work with the protected_attributes gem installed!"
- puts "You MUST remove this gem from your Gemfile. It is incompatible with Spree."
+ puts "[FATAL] Solidus does not work with the protected_attributes gem installed!"
+ puts "You MUST remove this gem from your Gemfile. It is incompatible with Solidus."
puts "*" * 75
exit
rescue LoadError
|
Change a reference from Spree to Solidus
|
diff --git a/test/unit/callbacks_test.rb b/test/unit/callbacks_test.rb
index abc1234..def5678 100644
--- a/test/unit/callbacks_test.rb
+++ b/test/unit/callbacks_test.rb
@@ -5,7 +5,15 @@ self.table_name = 'issues'
string :description
- %w(before_validation after_validation after_save after_create after_update after_destroy).each do |method|
+ %w(
+ before_validation
+ after_validation
+ before_save
+ after_save
+ after_create
+ after_update
+ after_destroy
+ ).each do |method|
send(method) do
callback_history << method
end
@@ -23,7 +31,14 @@ test 'create' do
issue = TestIssue.create
- assert_equal ['before_validation', 'after_validation', 'after_save', 'after_create'], issue.callback_history
+ expected = %w(
+ before_validation
+ after_validation
+ before_save
+ after_save
+ after_create
+ )
+ assert_equal expected, issue.callback_history
end
test 'update' do
@@ -32,7 +47,7 @@
issue.update_attribute :description, 'foo'
- assert_equal ['after_save', 'after_update'], issue.callback_history
+ assert_equal %w(before_save after_save after_update), issue.callback_history
end
test 'destroy' do
|
Test the before_save callback, for completeness
|
diff --git a/lib/multiple_man/cli.rb b/lib/multiple_man/cli.rb
index abc1234..def5678 100644
--- a/lib/multiple_man/cli.rb
+++ b/lib/multiple_man/cli.rb
@@ -17,7 +17,7 @@
def set_opts
on('--seed', 'listen to the seeding queue') do
- options[:mode] == :seed
+ options[:mode] = :seed
end
on('-e', '--environment-path PATH', 'Set the path to load the web framework (default: config/environment)') do |value|
options[:environment_path] = value
|
Fix seeding mode in CLI
|
diff --git a/lib/poms/api/request.rb b/lib/poms/api/request.rb
index abc1234..def5678 100644
--- a/lib/poms/api/request.rb
+++ b/lib/poms/api/request.rb
@@ -1,4 +1,6 @@ require 'poms/api/auth'
+require 'open-uri'
+require 'addressable/uri'
module Poms
module Api
@@ -9,13 +11,12 @@ # URI to be called and the key, secret and origin that are needed for
# authentication.
#
- # @param uri The full URI to call on the Poms API
+ # @param uri An instance of an Addressable::URI of the requested uri
# @param key The api key
# @param secret The secret that goes with the api key
# @param origin The whitelisted origin for this api key
def initialize(uri, key, secret, origin)
@uri = uri
- @path = URI(@uri).path
@key = key
@secret = secret
@origin = origin
@@ -23,20 +24,19 @@
# Executes the request.
def call
- open(@uri, headers)
+ open @uri.to_s, headers
end
-
- private
def headers
date = Time.now.rfc822
origin = @origin
- message = Auth.message(@path, @origin, date)
+ message = Auth.message(@uri, @origin, date)
encoded_message = Auth.encode(@secret, message)
{
'Origin' => origin,
'X-NPO-Date' => date,
- 'Authorization' => "NPO #{@key}:#{encoded_message}"
+ 'Authorization' => "NPO #{@key}:#{encoded_message}",
+ 'accept' => 'application/json'
}
end
end
|
Use addressable uri object in Poms::Api::Request + set json accept header
|
diff --git a/lib/sensu-plugin/cli.rb b/lib/sensu-plugin/cli.rb
index abc1234..def5678 100644
--- a/lib/sensu-plugin/cli.rb
+++ b/lib/sensu-plugin/cli.rb
@@ -52,9 +52,9 @@ rescue SystemExit => e
exit e.status
rescue Exception => e
- self.new.critical "Check failed to run: #{e.message}, #{e.backtrace}"
+ check.critical "Check failed to run: #{e.message}, #{e.backtrace}"
end
- self.new.warning "Check did not exit! You should call an exit code method."
+ check.warning "Check did not exit! You should call an exit code method."
end
end
|
Use the runtime class's output methods, not the base class
|
diff --git a/lib/dm-is-read_only.rb b/lib/dm-is-read_only.rb
index abc1234..def5678 100644
--- a/lib/dm-is-read_only.rb
+++ b/lib/dm-is-read_only.rb
@@ -1,3 +1,5 @@ require 'dm-core'
require 'dm-is-read_only/is/read_only'
require 'dm-is-read_only/is/version'
+
+DataMapper::Model.append_extensions DataMapper::Is::ReadOnly
|
Use DataMapper::Model.append_extension to register the plugin.
|
diff --git a/test/api/units/feedback_test.rb b/test/api/units/feedback_test.rb
index abc1234..def5678 100644
--- a/test/api/units/feedback_test.rb
+++ b/test/api/units/feedback_test.rb
@@ -10,7 +10,6 @@ end
def test_get_awaiting_feedback
- random_unitrole = UnitRole.tutors.sample
user = User.first
unit = Unit.first
@@ -25,4 +24,20 @@ assert_json_matches_model response, expected, ['id']
end
end
+
+ def test_tasks_for_task_inbox
+ user = User.first
+ unit = Unit.first
+
+ expected_response = unit.tasks_for_task_inbox(user)
+
+ get with_auth_token "/api/units/#{unit.id}/tasks/inbox", user
+
+ assert_equal 200, last_response.status
+
+ # check each is the same
+ last_response_body.zip(expected_response).each do |response, expected|
+ assert_json_matches_model response, expected, ['id']
+ end
+ end
end
|
TEST: Add new test for inbox endpoint
|
diff --git a/test/fog/xml/connection_test.rb b/test/fog/xml/connection_test.rb
index abc1234..def5678 100644
--- a/test/fog/xml/connection_test.rb
+++ b/test/fog/xml/connection_test.rb
@@ -2,7 +2,7 @@ require "fog"
# Note this is going to be part of fog-xml eventually
-class TestFogXMLConnection < Minitest::Test
+class Fog::XML::ConnectionTest < Minitest::Test
def setup
@connection = Fog::XML::Connection.new("http://localhost")
end
|
Rename testing class to fit filename
`TestFogXMLConnection` didn't really match with the file name of
`test/fog/xml/connection_test.rb` due to the namespacing and placement
of "Test"
|
diff --git a/Planet.podspec b/Planet.podspec
index abc1234..def5678 100644
--- a/Planet.podspec
+++ b/Planet.podspec
@@ -1,6 +1,6 @@ Pod::Spec.new do |s|
s.name = 'Planet'
- s.version = '0.1.0'
+ s.version = '0.2.0'
s.summary = 'A country picker'
s.description = 'A country picker view controller'
s.homepage = 'https://github.com/kwallet/planet'
@@ -11,7 +11,7 @@
s.source = {git: 'https://github.com/kwallet/planet.git', tag: s.version}
- s.platform = :ios, '9.3'
+ s.platform = :ios, '10.0'
s.source_files = "Planet", 'Classes/**/*.{h,m,swift}'
s.resources = 'Planet/Planet.xcassets'
|
Update Podspec, bump version to 0.2.0
|
diff --git a/test/unit/router_bridge_test.rb b/test/unit/router_bridge_test.rb
index abc1234..def5678 100644
--- a/test/unit/router_bridge_test.rb
+++ b/test/unit/router_bridge_test.rb
@@ -4,22 +4,22 @@
class MarplesTestDouble
def initialize
- @runers = []
+ @listeners = []
end
def when(application, object_type, action, &block)
- @runers << [application, object_type, action, block]
+ @listeners << [application, object_type, action, block]
end
def publish(application, object_type, action, object)
- @runers
- .select { |runer| runer_matches?(runer, [application, object_type, action]) }
- .each { |runer| runer[3].call(object) }
+ @listeners
+ .select { |listener| listener_matches?(listener, [application, object_type, action]) }
+ .each { |listener| listener[3].call(object) }
end
- def runer_matches?(runer, message)
+ def listener_matches?(listener, message)
message.each_index.all? do |i|
- runer[i] == '*' || runer[i] == message[i]
+ listener[i] == '*' || listener[i] == message[i]
end
end
|
Remove tests taht are no longer valid
|
diff --git a/test/models/inclusion_test.rb b/test/models/inclusion_test.rb
index abc1234..def5678 100644
--- a/test/models/inclusion_test.rb
+++ b/test/models/inclusion_test.rb
@@ -1,6 +1,7 @@ # Encoding: utf-8
require 'test_helper'
+# Test inclusion model
class InclusionTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
|
Add header to inclusion model test
|
diff --git a/core/db/migrate/20100506180619_add_icon_to_taxons.rb b/core/db/migrate/20100506180619_add_icon_to_taxons.rb
index abc1234..def5678 100644
--- a/core/db/migrate/20100506180619_add_icon_to_taxons.rb
+++ b/core/db/migrate/20100506180619_add_icon_to_taxons.rb
@@ -1,11 +1,15 @@ class AddIconToTaxons < ActiveRecord::Migration
def self.up
+ # legacy table support
+ Spree::Taxon.table_name = "taxons"
# skip this migration if the attribute already exists because of advanced taxon extension
return if Spree::Taxon.new.respond_to? :icon_file_name
add_column :taxons, :icon_file_name, :string
add_column :taxons, :icon_content_type, :string
add_column :taxons, :icon_file_size, :integer
add_column :taxons, :icon_updated_at, :datetime
+
+ Spree::Taxon.table_name = "spree_taxons"
end
def self.down
|
Add legacy table support ot add icon to taxons migration
|
diff --git a/init.rb b/init.rb
index abc1234..def5678 100644
--- a/init.rb
+++ b/init.rb
@@ -1,7 +1,7 @@ lib_dir = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift lib_dir unless $LOAD_PATH.include?(lib_dir)
-libraries_dir = ENV['LIBRARIES_DIR']
+libraries_dir = ENV['LIBRARIES_HOME']
unless libraries_dir.nil?
libraries_dir = File.expand_path(libraries_dir)
$LOAD_PATH.unshift libraries_dir unless $LOAD_PATH.include?(libraries_dir)
|
Package version set to 0.1.0.0
|
diff --git a/lib/gfspark/app.rb b/lib/gfspark/app.rb
index abc1234..def5678 100644
--- a/lib/gfspark/app.rb
+++ b/lib/gfspark/app.rb
@@ -18,8 +18,13 @@ @options = load_default_settings
try_url(args) || try_path(args) || try_default(args)
- unless @url && @service && @section && @graph
- puts "Invalid Arguments"
+ required_args = [:url, :service, :section, :graph]
+ unless required_args.map(&:to_s).map(&"@".method(:+)).map(&method(:instance_variable_get)).inject(true, :&)
+ puts "Invalid Arguments: check arguments or your .gfspark file"
+ required_args.each do |n|
+ puts " #{n} is required" unless instance_variable_get("@#{n}")
+ end
+ puts ""
@valid = false
return
end
|
Improve error message on invalid arguments
|
diff --git a/lib/git_crecord.rb b/lib/git_crecord.rb
index abc1234..def5678 100644
--- a/lib/git_crecord.rb
+++ b/lib/git_crecord.rb
@@ -32,13 +32,13 @@
def self.help
puts <<EOS
-usage: git crecord [<options>]'
+usage: git crecord [<options>]
--no-untracked-files -- ignore untracked files
- --version -- show version information'
- -h -- this help message'
+ --version -- show version information
+ -h -- this help message
- in-program commands:'
+ in-program commands:
#{UI::HelpWindow::CONTENT.gsub(/^/, ' ')}
EOS
end
|
Remove wrong ' from help output
|
diff --git a/lib/yeb/command.rb b/lib/yeb/command.rb
index abc1234..def5678 100644
--- a/lib/yeb/command.rb
+++ b/lib/yeb/command.rb
@@ -26,7 +26,7 @@ parts << "cd #{cwd}"
end
- parts << command
+ parts << "exec #{command}"
combined = parts.join(" && ")
|
Use exec when starting apps
|
diff --git a/app/controllers/projects/compare_controller.rb b/app/controllers/projects/compare_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/projects/compare_controller.rb
+++ b/app/controllers/projects/compare_controller.rb
@@ -14,9 +14,9 @@ compare_result = CompareService.new.execute(
current_user,
@project,
- base_ref,
+ head_ref,
@project,
- head_ref
+ base_ref
)
@commits = compare_result.commits
|
Fix variable order on compare page
Signed-off-by: Dmitriy Zaporozhets <be23d75b156792e5acab51b196a2deb155d35d6a@gmail.com>
|
diff --git a/app/lib/registries/world_locations_registry.rb b/app/lib/registries/world_locations_registry.rb
index abc1234..def5678 100644
--- a/app/lib/registries/world_locations_registry.rb
+++ b/app/lib/registries/world_locations_registry.rb
@@ -43,15 +43,7 @@ end
def fetch_locations_from_worldwide_api
- GdsApi::Worldwide.new(worldwide_api_endpoint).world_locations.with_subsequent_pages.to_a
- end
-
- def worldwide_api_endpoint
- if !Rails.env.production? || ENV["HEROKU_APP_NAME"].present?
- Plek.new.website_root
- else
- Plek.find("whitehall-frontend")
- end
+ Services.worldwide_api.world_locations.with_subsequent_pages.to_a
end
end
end
|
Revert "Use Internal Worldwide API"
|
diff --git a/ork-encryption.gemspec b/ork-encryption.gemspec
index abc1234..def5678 100644
--- a/ork-encryption.gemspec
+++ b/ork-encryption.gemspec
@@ -0,0 +1,28 @@+Gem::Specification.new do |s|
+ s.name = 'ork-encryption'
+ s.version = '0.0.1'
+ s.date = Time.now.strftime('%Y-%m-%d')
+ s.summary = 'Ruby modeling layer for Riak.'
+ s.summary = 'A simple encryption library for Ork::Documents stored in riak.'
+ s.description = 'Ork is a small Ruby modeling layer for Riak, inspired by Ohm.'
+ s.description = 'Encrypt documents persisted on Riak DB. Inspired in ripple-encryption'
+ s.authors = ['Emiliano Mancuso']
+ s.email = ['emiliano.mancuso@gmail.com']
+ s.homepage = 'http://github.com/emancu/ork-encryption'
+ s.license = 'MIT'
+
+ s.files = Dir[
+ 'README.md',
+ 'rakefile',
+ 'lib/**/*.rb',
+ '*.gemspec'
+ ]
+ s.test_files = Dir['test/*.*']
+
+ s.add_dependency 'riak-client'
+ s.add_dependency 'ork', "~> 0.1.1"
+ s.add_development_dependency 'protest'
+ s.add_development_dependency 'mocha'
+ s.add_development_dependency 'coveralls'
+end
+
|
Define gem spec. Launch version 0.0.1
|
diff --git a/app/forms/gobierto_admin/gobierto_citizens_charters/charter_form.rb b/app/forms/gobierto_admin/gobierto_citizens_charters/charter_form.rb
index abc1234..def5678 100644
--- a/app/forms/gobierto_admin/gobierto_citizens_charters/charter_form.rb
+++ b/app/forms/gobierto_admin/gobierto_citizens_charters/charter_form.rb
@@ -13,7 +13,7 @@ validates :title_translations, translated_attribute_presence: true
def available_services
- services_relation
+ services_relation.order(Arel.sql("title_translations->'#{I18n.locale}' ASC"))
end
def attributes_assignments
|
Return alphabetically ordered available services in charters form
|
diff --git a/lib/odf/spreadsheet.rb b/lib/odf/spreadsheet.rb
index abc1234..def5678 100644
--- a/lib/odf/spreadsheet.rb
+++ b/lib/odf/spreadsheet.rb
@@ -16,8 +16,7 @@ end
def content
- xml = Builder::XmlMarkup.new
- xml.table:table, 'table:name' => @title do
+ Builder::XmlMarkup.new.table:table, 'table:name' => @title do |xml|
xml << children_content
end
end
|
Save a line by inlining builder boilerplate
darcs-hash:20081112183332-49d33-8943f3b695daefb20c783ebfbe4b13bcff1a0ec4.gz
|
diff --git a/lib/opal/nodes/defs.rb b/lib/opal/nodes/defs.rb
index abc1234..def5678 100644
--- a/lib/opal/nodes/defs.rb
+++ b/lib/opal/nodes/defs.rb
@@ -23,6 +23,10 @@ def wrap_with_definition
unshift "Opal.defs(", expr(recvr), ", '$#{mid}', "
push ")"
+
+ if expr?
+ wrap '(', ", nil) && '#{mid}'"
+ end
end
end
end
|
Return method name from singleton method definition.
|
diff --git a/environment/kernel/beta.rb b/environment/kernel/beta.rb
index abc1234..def5678 100644
--- a/environment/kernel/beta.rb
+++ b/environment/kernel/beta.rb
@@ -20,4 +20,6 @@
load 'beta/comparable.rb'
-load 'beta/regexp.rb'+load 'beta/regexp.rb'
+
+ENV = {} # TODO: Make this not a stub.
|
Add empty stub for ENV.
|
diff --git a/lib/pg_search/tasks.rb b/lib/pg_search/tasks.rb
index abc1234..def5678 100644
--- a/lib/pg_search/tasks.rb
+++ b/lib/pg_search/tasks.rb
@@ -12,6 +12,7 @@ You must pass a model as an argument.
Example: rake pg_search:multisearch:rebuild[BlogPost]
MESSAGE
+
model_class = args.model.classify.constantize
connection = PgSearch::Document.connection
original_schema_search_path = connection.schema_search_path
|
Add empty line after guard clause.
|
diff --git a/lib/rack/serverinfo.rb b/lib/rack/serverinfo.rb
index abc1234..def5678 100644
--- a/lib/rack/serverinfo.rb
+++ b/lib/rack/serverinfo.rb
@@ -1,19 +1,31 @@ require 'rack-plastic'
+require 'etc'
module Rack
class Serverinfo < Plastic
def change_nokogiri_doc(doc)
- h1 = create_node(doc, "div", "Hostname: #{hostname}")
- h1['style'] = style
+ badge = doc.create_element 'div', style: style
- append_to_body(doc, h1)
+ server_info_text.each do |info|
+ badge.add_child(doc.create_element('p', info, style: 'margin: 0'))
+ end
+
+ append_to_body(doc, badge)
doc
end
private
+
+ def server_info_text
+ @server_info_text ||= [
+ "Hostname: #{hostname}",
+ "User: #{user}",
+ "Rails-Env: #{rails_env}",
+ ]
+ end
def style
@style ||= [
@@ -26,7 +38,16 @@ 'background-color: black;',
'opacity: 0.5;',
'color: white;',
+ 'font-size: 10px;',
].join
+ end
+
+ def user
+ @user ||= Etc.getlogin
+ end
+
+ def rails_env
+ @rails_env ||= ENV['RAILS_ENV']
end
def hostname
|
Create the information badge proper.
|
diff --git a/lib/snowball/roller.rb b/lib/snowball/roller.rb
index abc1234..def5678 100644
--- a/lib/snowball/roller.rb
+++ b/lib/snowball/roller.rb
@@ -1,4 +1,5 @@ require "open3"
+require 'pathname'
module Snowball
EXECUTABLE = Pathname.new(__FILE__).join("../../../", "bin/roll.js").realpath
|
Add missing require for 'pathname'.
|
diff --git a/lib/tasks/package.rake b/lib/tasks/package.rake
index abc1234..def5678 100644
--- a/lib/tasks/package.rake
+++ b/lib/tasks/package.rake
@@ -1,17 +1,21 @@ require 'noosfero'
desc "Generate source tarball"
-task :package do
+task :package => 'package:clobber' do
begin
sh 'test -d .git'
rescue
puts "** The `package` task only works from within #{Noosfero::PROJECT}'s git repository."
fail
end
- rm_rf 'pkg'
release = "#{Noosfero::PROJECT}-#{Noosfero::VERSION}"
target = "pkg/#{release}"
mkdir_p target
sh "git archive HEAD | (cd #{target} && tar x)"
sh "cd pkg && tar czf #{release}.tar.gz #{release}"
end
+
+task :clobber => 'package:clobber'
+task 'package:clobber' do
+ rm_rf 'pkg'
+end
|
Remove pkg/ directory on `rake clobber`
|
diff --git a/lib/tasks/signers.rake b/lib/tasks/signers.rake
index abc1234..def5678 100644
--- a/lib/tasks/signers.rake
+++ b/lib/tasks/signers.rake
@@ -4,15 +4,15 @@ # Usage: rake signers:export:icla after="#{date after which to find new ICLA signers}"
desc 'Given a date, export as CSV ICLA signatures from users after that date'
task icla: :environment do
- date = Time.zone.parse(ENV['date'])
- puts IclaSignature.earliest.where('signed_at > ?', date).as_csv
+ date = Time.zone.parse(ENV['date'] || '1970-01-01')
+ puts IclaSignature.earliest.where('signed_at > ?', date).chronological.as_csv
end
# Usage: rake signers:export:ccla after="#{date after which to find new CCLA signers}"
desc 'Given a date, export as CSV CCLA signatures from organizations after that date'
task ccla: :environment do
- date = Time.zone.parse(ENV['date'])
- puts CclaSignature.earliest_by_user.where('signed_at > ?', date).as_csv
+ date = Time.zone.parse(ENV['date'] || '1970-01-01')
+ puts CclaSignature.earliest_by_user.where('signed_at > ?', date).chronological.as_csv
end
end
end
|
Include default start date and chrono sort in CLA export rake tasks
|
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
@@ -14,7 +14,8 @@ @printer = printer
end
- def print(label)
+ def print(label, ip)
+ @remote_ip = ip
tempfile = label.persist
send_to_printer tempfile.path
end
@@ -28,13 +29,8 @@
def send_to_printer(path)
puts "* * * * * * * * * * * * * * * * * * * * * * * * Sending file to printer #{@printer} * * * * * * * * * * * * * * * * * * * * * * * * * "
- # My ip is 192.168.101.99
- `lp -h 192.168.101.128 -d #{@printer} -o raw #{path}`
- # if RUBY_PLATFORM =~ /darwin/
- # `lpr -h 192.168.101.99 -P #{@printer} -o raw #{path}`
- # else
- # `lp -h 192.168.101.99 -d #{@printer} -o raw #{path}`
- # end
+ `lp -h #{@remote_ip} -d #{@printer} -o raw #{path}`
+
end
end
end
|
Send job to requester ip
|
diff --git a/lib/zen/package/all.rb b/lib/zen/package/all.rb
index abc1234..def5678 100644
--- a/lib/zen/package/all.rb
+++ b/lib/zen/package/all.rb
@@ -3,10 +3,10 @@ # foreign keys might not work.
require __DIR__('settings/lib/settings')
require __DIR__('users/lib/users')
+require __DIR__('dashboard/lib/dashboard')
require __DIR__('sections/lib/sections')
require __DIR__('comments/lib/comments')
require __DIR__('categories/lib/categories')
require __DIR__('custom_fields/lib/custom_fields')
require __DIR__('menus/lib/menus')
require __DIR__('extensions/lib/extensions')
-require __DIR__('dashboard/lib/dashboard')
|
Load the dashboard package after the users package
Signed-off-by: Yorick Peterse <82349cb6397bb932b4bf3561b4ea2fad50571f50@gmail.com>
|
diff --git a/rails-footnotes.gemspec b/rails-footnotes.gemspec
index abc1234..def5678 100644
--- a/rails-footnotes.gemspec
+++ b/rails-footnotes.gemspec
@@ -18,7 +18,6 @@
s.add_development_dependency "rspec-rails"
s.add_development_dependency "capybara"
- s.add_development_dependency "pry-byebug"
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
Remove pry-byebug from gemspec since it's not compatible with all rubies
|
diff --git a/spec/features/manage_volume_price_models_feature_spec.rb b/spec/features/manage_volume_price_models_feature_spec.rb
index abc1234..def5678 100644
--- a/spec/features/manage_volume_price_models_feature_spec.rb
+++ b/spec/features/manage_volume_price_models_feature_spec.rb
@@ -0,0 +1,26 @@+require 'spec_helper'
+
+RSpec.feature 'Managing volume price models' do
+ stub_authorization!
+
+ scenario 'a admin can create and remove volume price models', :js do
+ visit spree.admin_volume_price_models_path
+ expect(page).to have_content('Volume Price Models')
+
+ click_on 'New Volume Price Model'
+ fill_in 'Name', with: 'Discount'
+ within '#volume_prices' do
+ fill_in 'volume_price_model_volume_prices_attributes_0_name', with: '5 pieces discount'
+ select 'Total price', from: 'volume_price_model_volume_prices_attributes_0_discount_type'
+ fill_in 'volume_price_model_volume_prices_attributes_0_range', with: '1..5'
+ fill_in 'volume_price_model_volume_prices_attributes_0_amount', with: '1'
+ end
+ click_on 'Create'
+
+ within 'tr.volume_price.fields' do
+ expect(page).to have_field('volume_price_model_volume_prices_attributes_0_name', with: '5 pieces discount')
+ page.find('a[data-action="remove"]').click
+ expect(page).to_not have_field('volume_price_model_volume_prices_attributes_0_name', with: '5 pieces discount')
+ end
+ end
+end
|
Add feature spec for volume price models
|
diff --git a/desktop.gemspec b/desktop.gemspec
index abc1234..def5678 100644
--- a/desktop.gemspec
+++ b/desktop.gemspec
@@ -23,5 +23,6 @@
spec.add_development_dependency "bundler", "~> 1.6"
spec.add_development_dependency "minitest", "~> 5.3"
+ spec.add_development_dependency "pry", "~> 0.9.12"
spec.add_development_dependency "rake", "~> 10.3"
end
|
Add pry as development dependency
|
diff --git a/providers/common.rb b/providers/common.rb
index abc1234..def5678 100644
--- a/providers/common.rb
+++ b/providers/common.rb
@@ -1,3 +1,5 @@+include_recipe 'git'
+
action :install do
if new_resource.create_user
|
Include git recipe to install git
|
diff --git a/app/controllers/brexit_landing_page_controller.rb b/app/controllers/brexit_landing_page_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/brexit_landing_page_controller.rb
+++ b/app/controllers/brexit_landing_page_controller.rb
@@ -5,6 +5,7 @@ skip_before_action :set_expiry
before_action -> { set_expiry(1.minute) }
before_action -> { set_slimmer_headers(remove_search: true, show_accounts: logged_in? ? "signed-in" : "signed-out") }
+ after_action :set_slimmer_template
around_action :switch_locale
def show
@@ -19,7 +20,7 @@ private
def set_slimmer_template
- set_gem_layout_full_width
+ slimmer_template "gem_layout_full_width"
end
def taxon
|
Fix Explore header being applied to Brexit pages
We should exclude the Brexit pages from the Explore Super Menu AB Test as they need to keep the Sign In link.
|
diff --git a/app/controllers/observer_controller/site_stats.rb b/app/controllers/observer_controller/site_stats.rb
index abc1234..def5678 100644
--- a/app/controllers/observer_controller/site_stats.rb
+++ b/app/controllers/observer_controller/site_stats.rb
@@ -7,12 +7,8 @@ @site_data = SiteData.new.get_site_data
# Add some extra stats.
- @site_data[:observed_taxa] = Name.connection.select_value(%(
- SELECT COUNT(DISTINCT name_id) FROM observations
- ))
- @site_data[:listed_taxa] = Name.connection.select_value(%(
- SELECT COUNT(*) FROM names
- ))
+ @site_data[:observed_taxa] = Observation.distinct.count(:name_id)
+ @site_data[:listed_taxa] = Name.count
# Get the last six observations whose thumbnails are highly rated.
query = Query.lookup(:Observation, :all,
|
Replace SiteStats sql with ActiveRecord queries
|
diff --git a/test/commands/restart_test.rb b/test/commands/restart_test.rb
index abc1234..def5678 100644
--- a/test/commands/restart_test.rb
+++ b/test/commands/restart_test.rb
@@ -1,21 +1,14 @@ module Byebug
- class RestartExample
- def concat_args(a, b, c)
- a.to_s + b.to_s + c.to_s
- end
- end
-
+ #
+ # Tests restarting functionality.
+ #
class RestartTestCase < TestCase
- def setup
- @example = lambda do
- byebug
- a = ARGV[0]
- b = ARGV[1]
- c = ARGV[2]
- RestartExample.new.concat_args(a, b, c)
- end
-
- super
+ def program
+ strip_line_numbers <<-EOC
+ 1: byebug
+ 2:
+ 3: ARGV.join(' ')
+ EOC
end
def must_restart(cmd = nil)
@@ -28,7 +21,7 @@ must_restart(cmd)
enter 'restart 1 2'
- debug_proc(@example)
+ debug_code(program)
check_output_includes "Re exec'ing:", "\t#{cmd}"
end
@@ -36,7 +29,7 @@ must_restart
enter 'restart'
- debug_proc(@example)
+ debug_code(program)
check_output_includes 'Byebug was not called from the outset...'
check_output_includes \
"Program #{Byebug.debugged_program} not executable... " \
|
Migrate restart tests to use debug_code method
|
diff --git a/knife-cloudformation.gemspec b/knife-cloudformation.gemspec
index abc1234..def5678 100644
--- a/knife-cloudformation.gemspec
+++ b/knife-cloudformation.gemspec
@@ -10,11 +10,10 @@ s.description = 'Knife tooling for Cloud Formation'
s.require_path = 'lib'
s.add_dependency 'chef'
- s.add_dependency 'fog', '~> 1.17'
+ s.add_dependency 'miasma'
s.add_dependency 'unf'
s.add_dependency 'net-sftp'
s.add_dependency 'sparkle_formation', '~> 0.2.0'
s.add_dependency 'redis-objects'
- s.add_dependency 'attribute_struct', '~> 0.2.0'
s.files = Dir['**/*']
end
|
Remove fog dependency. Add miasma dependency.
|
diff --git a/db/samples.rb b/db/samples.rb
index abc1234..def5678 100644
--- a/db/samples.rb
+++ b/db/samples.rb
@@ -12,4 +12,6 @@ fixtures = File.join('db/fixtures', "#{File.basename(file, '.*')}.yml")
FileUtils.touch(fixtures)
ActiveRecord::Fixtures.create_fixtures(*db_args)
+ # Now that ActiveRecord::Fixtures is happy, let's remove the file
+ FileUtils.rm(fixtures, force: true)
end
|
Remove build artifact after rake db:sample
|
diff --git a/AXSwift.podspec b/AXSwift.podspec
index abc1234..def5678 100644
--- a/AXSwift.podspec
+++ b/AXSwift.podspec
@@ -1,6 +1,6 @@ Pod::Spec.new do |s|
s.name = 'AXSwift'
- s.version = '0.1.0'
+ s.version = '0.1.3'
s.summary = 'Swift wrapper for Mac accessibility APIs'
s.description = <<-DESC
@@ -24,7 +24,7 @@
s.osx.deployment_target = '10.10'
- s.source_files = 'Sources/*'
+ s.source_files = 'Sources/*.{swift,h}'
s.public_header_files = 'Sources/*.h'
s.frameworks = 'Cocoa'
|
Fix Info.plist issue in podspec, bump version
Fixes #4.
|
diff --git a/lives_resolver.rb b/lives_resolver.rb
index abc1234..def5678 100644
--- a/lives_resolver.rb
+++ b/lives_resolver.rb
@@ -0,0 +1,72 @@+require 'factual'
+require 'mongo'
+require 'pry'
+require 'csv'
+
+class LivesResolver
+
+ include Mongo
+ # Set up (or re-establish connection to) data store
+ @@mongo_client = MongoClient.new("localhost", 27017)
+ @@db = @@mongo_client.db("factual-test")
+ @@coll = @@db["factual-data-2"]
+
+ def resolve_csv(file_path)
+ factual = Factual.new(ENV["FACTUAL_KEY"], ENV["FACTUAL_SECRET"], debug: false)
+ counter = 1
+ CSV.foreach(file_path, :headers => :true) do |row|
+ if @@coll.find("id"=>row["id"]).to_a.count == 0
+ hash_input = { name: row["name"], address: row["address1"], locality: "San Francisco", region: "CA", postcode: row["zip"] }
+ lives_id = row["id"]
+ begin
+ query = factual.resolve(hash_input)
+ factual_response = query.first
+ if query.first == nil
+ p "#{counter}: nil response from Factual"
+ #binding.pry
+ else
+ p "#{counter}: hit!"
+ end
+ rescue Timeout::Error
+ p "#{counter} Timeout Error"
+ factual_response = "factual-timeout"
+ end
+ insert_hash = { id: lives_id, lives_data: hash_input, factual_data: factual_response }
+ test_insert = @@coll.insert(insert_hash)
+ else
+ p "#{counter} skipping -- already done (or to be skipped)"
+ end
+ counter += 1
+ end
+ end
+
+ def output_unmatched_to_json(input_csv_path, output_csv_path)
+ opened_file = File.open(input_csv_path) { |f| f.read }
+ parsed_lives_data = CSV.parse opened_file, headers: true
+
+ # For each restaurant in CSV without Factual data in Mongo, create a JSON object with LIVES data and Yelp ID
+ output_data = Array.new
+ output_data[0] = parsed_lives_data.headers
+ parsed_lives_data.each do |lives_csv_row|
+ mongo_result = @@coll.find("id"=>lives_csv_row["id"]).first
+ if mongo_result["factual_data"] == nil or mongo_result["factual_data"] == "factual-timeout"
+ output_data << lives_csv_row
+ end
+ end
+ CSV.open(output_csv_path, "w") do |output_csv_object|
+ output_data.each do |data_row|
+ output_csv_object << data_row
+ end
+ end
+ end
+
+end
+
+
+#LivesResolver.resolve_csv("./lives-sf.csv")
+
+#l = LivesResolver.new
+#l.output_unmatched_to_json("./lives-sf.csv", "./unmatched-LIVES-SF-restaurants.csv")
+
+
+
|
Refactor to decent shape, and add CSV creator (new approach to Factual calls untested)
|
diff --git a/rspec-benchmark.gemspec b/rspec-benchmark.gemspec
index abc1234..def5678 100644
--- a/rspec-benchmark.gemspec
+++ b/rspec-benchmark.gemspec
@@ -19,8 +19,8 @@
spec.required_ruby_version = '>= 2.0.0'
- #spec.add_dependency 'benchmark-trend', '~> 0.1.0'
- spec.add_dependency 'benchmark-perf', '~> 0.2.0'
+ # spec.add_dependency 'benchmark-trend', '~> 0.1.0'
+ spec.add_dependency 'benchmark-perf', '~> 0.3.0'
spec.add_dependency 'rspec', '>= 3.0.0', '< 4.0.0'
spec.add_development_dependency 'bundler', '~> 1.16'
|
Change to update benchmark-perf dependency
|
diff --git a/analyze_job.rb b/analyze_job.rb
index abc1234..def5678 100644
--- a/analyze_job.rb
+++ b/analyze_job.rb
@@ -11,10 +11,11 @@ return {:exit_status => 0}
end
begin
- log_file = File.open(File.join(@base_dir,@sample_id,"logs","#{@sample_id}_full_worker.txt"),"w+")
+ log_file = File.open(File.join(@base_dir,"logs","#{@sample_id}_full_worker.txt"),"w+")
log_file.sync = true
logger = OMRF::FstreamLogger.new(log_file,log_file)
- cmd = "#{@base_dir}/#{@sample_id}/analyze.sh"
+ conf_file = File.join(@base_dir,"..","..","metadata","analysis_config.yml")
+ cmd = "analyze_sequence_to_snps.rb -d 0 --local -o #{@base_dir} -c #{conf_file} #{@sample_id}"
c = OMRF::LoggedExternalCommand.new(cmd,logger)
if c.run
return {:exit_status => 0}
|
Change to call analyze_.... directly with the local option
|
diff --git a/test/integration/test_add.rb b/test/integration/test_add.rb
index abc1234..def5678 100644
--- a/test/integration/test_add.rb
+++ b/test/integration/test_add.rb
@@ -0,0 +1,28 @@+require_relative '../test_helper'
+
+class TestAddIntegration < LDAPIntegrationTestCase
+ def setup
+ super
+ @ldap.authenticate "cn=admin,dc=rubyldap,dc=com", "passworD1"
+
+ @dn = "uid=added-user1,ou=People,dc=rubyldap,dc=com"
+ end
+
+ def test_add
+ attrs = {
+ objectclass: %w(top inetOrgPerson organizationalPerson person),
+ uid: "added-user1",
+ cn: "added-user1",
+ sn: "added-user1",
+ mail: "added-user1@rubyldap.com"
+ }
+
+ assert @ldap.add(dn: @dn, attributes: attrs), @ldap.get_operation_result.inspect
+
+ assert result = @ldap.search(base: @dn, scope: Net::LDAP::SearchScope_BaseObject).first
+ end
+
+ def teardown
+ @ldap.delete dn: @dn
+ end
+end
|
Add integration test for adding a person entry
|
diff --git a/BHCDatabase/test/models/funder_test.rb b/BHCDatabase/test/models/funder_test.rb
index abc1234..def5678 100644
--- a/BHCDatabase/test/models/funder_test.rb
+++ b/BHCDatabase/test/models/funder_test.rb
@@ -1,5 +1,6 @@ require 'test_helper'
+# FunderTest contains the model tests for a Funder
class FunderTest < ActiveSupport::TestCase
def setup
@@ -36,7 +37,7 @@ end
test "description shouldn't be too long" do
- @funder.description = 'a' * 65537
+ @funder.description = 'a' * 65_537
assert_not @funder.valid?
end
|
Write model tests for an a funder.
|
diff --git a/ext/leveldb_native/extconf.rb b/ext/leveldb_native/extconf.rb
index abc1234..def5678 100644
--- a/ext/leveldb_native/extconf.rb
+++ b/ext/leveldb_native/extconf.rb
@@ -1,4 +1,6 @@ require 'mkmf'
+
+dir_config('leveldb')
have_library "leveldb" or abort "Can't find leveldb library."
|
Allow configuration of lib and include path through 'leveldb' name
|
diff --git a/lib/jekyll-github-metadata/ghp_metadata_generator.rb b/lib/jekyll-github-metadata/ghp_metadata_generator.rb
index abc1234..def5678 100644
--- a/lib/jekyll-github-metadata/ghp_metadata_generator.rb
+++ b/lib/jekyll-github-metadata/ghp_metadata_generator.rb
@@ -12,21 +12,7 @@ Jekyll::GitHubMetadata.log :debug, "Initializing..."
@site = site
site.config["github"] = github_namespace
-
- # Set `site.url` and `site.baseurl` if unset and in production mode.
- if Jekyll.env == "production"
- html_url = URI(drop.url)
-
- # baseurl tho
- if site.config["baseurl"].to_s.empty? && !["", "/"].include?(html_url.path)
- site.config["baseurl"] = html_url.path
- end
-
- # remove path so URL doesn't have baseurl in it
- html_url.path = ""
- site.config["url"] ||= html_url.to_s
- end
-
+ set_url_and_baseurl_fallbacks!
@site = nil
end
@@ -46,6 +32,22 @@ def drop
@drop ||= MetadataDrop.new(site)
end
+
+ # Set `site.url` and `site.baseurl` if unset and in production mode.
+ def set_url_and_baseurl_fallbacks!
+ return unless Jekyll.env == "production"
+
+ parsed_url = URI(drop.url)
+
+ # baseurl tho
+ if site.config["baseurl"].to_s.empty? && !["", "/"].include?(parsed_url.path)
+ site.config["baseurl"] = parsed_url.path
+ end
+
+ # remove path so URL doesn't have baseurl in it
+ parsed_url.path = ""
+ site.config["url"] ||= parsed_url.to_s
+ end
end
end
end
|
Refactor so rubocop is happy
|
diff --git a/lib/smartdown_adapter/previous_question_presenter.rb b/lib/smartdown_adapter/previous_question_presenter.rb
index abc1234..def5678 100644
--- a/lib/smartdown_adapter/previous_question_presenter.rb
+++ b/lib/smartdown_adapter/previous_question_presenter.rb
@@ -18,9 +18,12 @@ when Smartdown::Api::MultipleChoice
smartdown_previous_question.options.find{|option| option.value == response_key}.label
when Smartdown::Api::DateQuestion
- response_key
+ #TODO: formatting date here until we return answer object as part of previous question object
+ #and we can use the smartdown humanize methods
+ Date.parse(response_key).strftime("%-d %B %Y")
when Smartdown::Api::SalaryQuestion
- response_key
+ salary_array = response_key.split("-")
+ "#{salary_array[0]} per #{salary_array[1]}"
end
end
|
Format dates and salaries in previous answers
Temporary fix for upcoming user research until smartdown PreviousQuestion
returns an Answer object on which we call the humanize methods
|
diff --git a/example/config.ru b/example/config.ru
index abc1234..def5678 100644
--- a/example/config.ru
+++ b/example/config.ru
@@ -1,7 +1,6 @@ require File.expand_path("../../lib/rack/jekyll", __FILE__)
# Middleware
-use Rack::ShowStatus # Nice looking 404s and other messages
use Rack::ShowExceptions # Nice looking errors
run Rack::Jekyll.new
|
Remove Rack::ShowStatus middleware from demo site
Testing is easier when responses are not modified.
|
diff --git a/Casks/jabref.rb b/Casks/jabref.rb
index abc1234..def5678 100644
--- a/Casks/jabref.rb
+++ b/Casks/jabref.rb
@@ -1,11 +1,25 @@ cask 'jabref' do
- version '2.10'
- sha256 'c63a49e47a43bdb026dde7fb695210d9a3f8c0e71445af7d6736c5379b23baa2'
+ version '3.2'
+ sha256 'ddde9938c3d5092ffe2ba2ecd127439de4ae304d783b5e33056951f449a185b5'
- url "http://downloads.sourceforge.net/project/jabref/jabref/#{version}/JabRef-#{version}-OSX.zip"
+ # sourceforge.net/project/jabref was verified as official when first introduced to the cask
+ url "http://downloads.sourceforge.net/project/jabref/v#{version}/JabRef_macos_#{version.dots_to_underscores}.dmg"
+ appcast 'https://github.com/JabRef/jabref/releases.atom',
+ checkpoint: '397228862c29af39b57e97e0a4337508d56fadd96289ecf54a8369955c9d2e21'
name 'JabRef'
- homepage 'http://jabref.sourceforge.net/'
+ homepage 'http://www.jabref.org/'
license :gpl
- app 'JabRef.app'
+ installer script: 'JabRef Installer.app/Contents/MacOS/JavaApplicationStub',
+ args: [
+ '-q',
+ '-VcreateDesktopLinkAction$Boolean=false',
+ '-VaddToDockAction$Boolean=false',
+ '-VshowFileAction$Boolean=false',
+ '-Vsys.installationDir=/Applications',
+ '-VexecutionLauncherAction$Boolean=false',
+ ],
+ sudo: false
+
+ uninstall delete: '/Applications/JabRef.app'
end
|
Update JabRef to version (3.2)
updated jabref (3.2)
Update JabRef (3.2) with comments modification
replace with #{version.dots_to_underscores} to convert version number
comments removed
|
diff --git a/Casks/python.rb b/Casks/python.rb
index abc1234..def5678 100644
--- a/Casks/python.rb
+++ b/Casks/python.rb
@@ -4,7 +4,7 @@
url "https://www.python.org/ftp/python/#{version}/python-#{version}-macosx10.6.pkg"
name 'Python'
- homepage 'http://www.python.org/'
+ homepage 'https://www.python.org/'
license :oss
pkg "python-#{version}-macosx10.6.pkg"
|
Fix homepage to use SSL in Python 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/spec/output_web_spec.rb b/spec/output_web_spec.rb
index abc1234..def5678 100644
--- a/spec/output_web_spec.rb
+++ b/spec/output_web_spec.rb
@@ -1,6 +1,6 @@ describe "indexed file" do
let(:output_dir) do
- Pathname.new(File.expand_path(ENV["TMPDIR"] + "/docroot"))
+ Pathname.new(File.expand_path("#{ENV['TMPDIR']}/docroot"))
end
let(:raw_fixture) do
@@ -12,7 +12,7 @@ end
it "writes permalinks with trailing slashes to standard index" do
- puts raw_fixture
+ expect(raw_fixture.output).to eq(output_dir)
#writer = Yarrow::Output::Web::IndexedFile.new(io_obj, output_dir)
#writer.write(Pathname.new("/collection/topic/"), "<h1>Index</h1>")
end
|
Fix bug in new test spec for output writing
This class requires the new config system so hasn’t been fully completed
yet—no need for the test to be breaking though.
|
diff --git a/emcee.gemspec b/emcee.gemspec
index abc1234..def5678 100644
--- a/emcee.gemspec
+++ b/emcee.gemspec
@@ -10,8 +10,8 @@ s.authors = ["Andrew Huth"]
s.email = ["andrew@huth.me"]
s.homepage = "https://github.com/ahuth/emcee"
- s.summary = "Add web components to the asset pipeline."
- s.description = "Add web components to the rails asset pipeline"
+ s.summary = "Add web components to the Rails asset pipeline."
+ s.description = "Add web components to the Rails asset pipeline"
s.license = "MIT"
s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"]
|
Make summary and description the same
|
diff --git a/Backchannel.podspec b/Backchannel.podspec
index abc1234..def5678 100644
--- a/Backchannel.podspec
+++ b/Backchannel.podspec
@@ -1,13 +1,14 @@ Pod::Spec.new do |s|
s.name = "Backchannel"
- s.version = "0.0.1"
- s.summary = "A short description of Backchannel."
+ s.version = "1.0"
+ s.license = 'MIT'
+ s.summary = "Backchannel is a service for bringing discussion to your app’s beta."
s.author = { "Soroush Khanlou" => "soroush@backchannel.io" }
s.social_media_url = "https://twitter.com/backchannelio"
s.platform = :ios, "8.0"
-
- s.source = { :git => "https://github.com/backchannel/BackchannelSDK-iOS", :tag => s.version.to_s }
+ s.homepage = "https://backchannel.io/"
+ s.source = { :git => "https://github.com/backchannel/BackchannelSDK-iOS.git", :tag => s.version.to_s }
s.source_files = "Source", "Source/**.{h,m}", "Source/**/*.{h,m}"
s.resources = "Resources/Images.xcassets"
|
Update Podspec in prepration for pushing it to CocoaPods trunk
|
diff --git a/lib/markdown_ruby_documentation/summary.rb b/lib/markdown_ruby_documentation/summary.rb
index abc1234..def5678 100644
--- a/lib/markdown_ruby_documentation/summary.rb
+++ b/lib/markdown_ruby_documentation/summary.rb
@@ -8,23 +8,29 @@ end
def title
- [format_class(subject), *ancestors.map { |a| create_link(a) }].join(" < ")
+ [format_class(subject), *ancestors_links].join(" < ")
end
def summary
- "Descendants: #{descendants_links}" if descendants.count >= 1
+ "Descendants: #{descendants_links.join(", ")}" if descendants.present?
end
private
+ def ancestors_links
+ ancestors.map(&method(:create_link))
+ end
+
def descendants_links
- descendants.map { |d| create_link(d) }.join(", ")
+ descendants.map(&method(:create_link))
end
def descendants
- @descendants ||= ObjectSpace.each_object(Class).select do |klass|
- klass < subject && !(klass == InstanceToClassMethods)
- end.sort_by(&:name)
+ @descendants ||= begin
+ ObjectSpace.each_object(Class).select do |klass|
+ klass.try!(:name) && klass < subject && !(klass.name.to_s.include?("InstanceToClassMethods"))
+ end.sort_by(&:name)
+ end
end
def ancestors
|
Fix use of InstanceToClassMethods String match
|
diff --git a/lib/site-inspector/checks/accessibility.rb b/lib/site-inspector/checks/accessibility.rb
index abc1234..def5678 100644
--- a/lib/site-inspector/checks/accessibility.rb
+++ b/lib/site-inspector/checks/accessibility.rb
@@ -1,5 +1,6 @@ require 'json'
require 'open3'
+require 'mkmf'
class SiteInspector
class Endpoint
@@ -23,29 +24,37 @@
private
+ def pa11y_installed?
+ !`which pa11y`.empty?
+ end
+
def pa11y(standard)
- standards = {
- section508: 'Section508',
- wcag2a: 'WCAG2A',
- wcag2aa: 'WCAG2AA',
- wcag2aaa: 'WCAG2AAA'
- }
- standard = standards[standard]
+ if pa11y_installed?
+ standards = {
+ section508: 'Section508',
+ wcag2a: 'WCAG2A',
+ wcag2aa: 'WCAG2AA',
+ wcag2aaa: 'WCAG2AAA'
+ }
+ standard = standards[standard]
- cmd = "pa11y #{endpoint.uri} -s #{standard} -r json"
- response = ""
- error = nil
+ cmd = "pa11y #{endpoint.uri} -s #{standard} -r json"
+ response = ""
+ error = nil
+
+ Open3.popen3(cmd) do |stdin, stdout, stderr, wait_thr|
+ response = stdout.read
+ error = stderr.read
+ end
- Open3.popen3(cmd) do |stdin, stdout, stderr, wait_thr|
- response = stdout.read
- error = stderr.read
- end
+ if error && !error.empty?
+ raise error
+ end
- if error
- raise error
+ JSON.parse(response)
+ else
+ raise "pa11y not found. To install: [sudo] npm install -g pa11y"
end
-
- JSON.parse(response)
end
end
|
Check if pa11y is installed before running it.
|
diff --git a/lib/stockboy/providers/ftp/sftp_adapter.rb b/lib/stockboy/providers/ftp/sftp_adapter.rb
index abc1234..def5678 100644
--- a/lib/stockboy/providers/ftp/sftp_adapter.rb
+++ b/lib/stockboy/providers/ftp/sftp_adapter.rb
@@ -35,7 +35,7 @@ end
def modification_time(file_name)
- stat(file_name).mtime
+ (mtime = stat(file_name).mtime) && Time.at(mtime)
end
def size(file_name)
|
Fix mtime returning a raw integer from SFTP adapter
|
diff --git a/lib/tasks/lead_organisation_publisher.rake b/lib/tasks/lead_organisation_publisher.rake
index abc1234..def5678 100644
--- a/lib/tasks/lead_organisation_publisher.rake
+++ b/lib/tasks/lead_organisation_publisher.rake
@@ -0,0 +1,22 @@+namespace :publishing_api do
+ desc "populate publishing api with lead organisations"
+ task publish_lead_organisations: :environment do
+ Policy.find_each do |policy|
+
+ links_payload = {
+ links: {
+ organisations: policy.organisation_content_ids
+ }
+ }
+
+ lead_organisation = policy.organisation_content_ids.first
+
+ if lead_organisation
+ links_payload[:links][:lead_organisations] = [ lead_organisation ]
+ end
+
+ puts "Publishing '#{policy.name}' orgs to publishing-api"
+ Services.publishing_api.put_links(policy.content_id, links_payload)
+ end
+ end
+end
|
Add rake task to publish orgs to publishing-api
We are migrating this app to use publishing-api's V2 endpoints. This rake task
is for registering the first organisation of each policy as lead organisation in
the publishing api.
We're also taking the opportunity to republish the whole lot of policy
organisations to publishing api just to make sure its database is in sync with
the one used by policy-publisher.
Part of:
https://trello.com/c/BQDQ824W/468-use-publishing-api-v2-for-policy-publisher
|
diff --git a/rbx/compiler/ast/identifier.rb b/rbx/compiler/ast/identifier.rb
index abc1234..def5678 100644
--- a/rbx/compiler/ast/identifier.rb
+++ b/rbx/compiler/ast/identifier.rb
@@ -42,10 +42,10 @@ def bytecode(g)
if constant?
Rubinius::AST::ConstantAccess.new(line, name).bytecode(g)
+ elsif class_variable?
+ Rubinius::AST::ClassVariableAccess.new(line, name).bytecode(g)
elsif instance_variable?
Rubinius::AST::InstanceVariableAccess.new(line, name).bytecode(g)
- elsif class_variable?
- Rubinius::AST::ClassVariableAccess.new(line, name).bytecode(g)
else
Rubinius::AST::LocalVariableAccess.new(line, name).bytecode(g)
end
|
Check for class variable access first since otherwise it would probably always default to instance variable access.
|
diff --git a/settings.example.rb b/settings.example.rb
index abc1234..def5678 100644
--- a/settings.example.rb
+++ b/settings.example.rb
@@ -1,9 +1,4 @@ module Settings
- Player = Struct.new(
- 'Player',
- :user_id, :auth_token, :flash_code, :faction_id, :faction_name, :platform
- )
-
TYRANT_VERSION = raise 'You must set a tyrant version'
USER_AGENT = raise 'You must set a user agent'
TYRANT_DIR = raise 'You must set a Tyrant directory'
@@ -15,13 +10,13 @@ FACTIONS_YAML = "#{TYRANT_DIR}/factions.yaml"
PLAYERS = {
- 'myplayer' => Player.new(
- 123456,
- '111111222222333333444444555555666666777777888888999999aaaaaabbbb',
- 'ccccccddddddeeeeeeffffff00000011',
- 78910002,
- 'My Faction',
- 'kg'
- ),
+ 'myplayer' => {
+ user_id: 123456,
+ auth_token: '111111222222333333444444555555666666777777888888999999aaaaaabbbb',
+ flash_code: 'ccccccddddddeeeeeeffffff00000011',
+ faction_id: 78910002,
+ faction_name: 'My Faction',
+ platform: 'kg',
+ }
}
end
|
settings: Use a hash instead of a struct
The advantage of this scheme is that every parameter in the PLAYERS
array is given a clear label for its purpose.
The disadvantage is that there is no checking for whether someone typos
factoin_id: rather than faction_id: or similar. The next commit solves
this.
|
diff --git a/Casks/adium-beta.rb b/Casks/adium-beta.rb
index abc1234..def5678 100644
--- a/Casks/adium-beta.rb
+++ b/Casks/adium-beta.rb
@@ -3,8 +3,15 @@ sha256 'e7690718f14defa3bc08cd3949a4eab52e942abd47f7ac2ce7157ed7295658c6'
url "https://adiumx.cachefly.net/Adium_#{version}.dmg"
+ name 'Adium'
homepage 'https://beta.adium.im/'
- license :oss
+ license :gpl
app 'Adium.app'
+
+ zap :delete => [
+ '~/Library/Caches/Adium',
+ '~/Library/Caches/com.adiumX.adiumX',
+ '~/Library/Preferences/com.adiumX.adiumX.plist',
+ ]
end
|
Add missing stanzas to Adium Beta
|
diff --git a/lib/github_api/error/not_acceptable.rb b/lib/github_api/error/not_acceptable.rb
index abc1234..def5678 100644
--- a/lib/github_api/error/not_acceptable.rb
+++ b/lib/github_api/error/not_acceptable.rb
@@ -3,7 +3,7 @@ module Github #:nodoc
# Raised when GitHub returns the HTTP status code 406
module Error
- class NotAcceptable < GithubError
+ class NotAcceptable < ServiceError
http_status_code 406
def initialize(response)
|
Change to inherit from service errors.
|
diff --git a/Casks/transporter-desktop.rb b/Casks/transporter-desktop.rb
index abc1234..def5678 100644
--- a/Casks/transporter-desktop.rb
+++ b/Casks/transporter-desktop.rb
@@ -1,11 +1,11 @@ cask :v1 => 'transporter-desktop' do
- version '3.0.21_17012'
- sha256 '48d36d53f6484364b3df93ccd054a30028b0f4fcb169c2d8475ca64ef108f510'
+ version '3.1.15_18289'
+ sha256 'fecf3b1944832261900237537962a4783d709caa96c3e93ec2d828b88425ec8e'
# connecteddata.com is the official download host per the vendor homepage
url "https://secure.connecteddata.com/mac/2.5/software/Transporter_Desktop_#{version}.dmg"
homepage 'http://www.filetransporter.com/'
- license :unknown # todo: change license and remove this comment; ':unknown' is a machine-generated placeholder
+ license :commercial
app 'Transporter Desktop.app'
end
|
Update Transporter Desktop version to 3.1.15
This commit updates the version number, the SHA, and the license
type to :commercial.
|
diff --git a/lib/cloud_cost_tracker/extensions/fog_model.rb b/lib/cloud_cost_tracker/extensions/fog_model.rb
index abc1234..def5678 100644
--- a/lib/cloud_cost_tracker/extensions/fog_model.rb
+++ b/lib/cloud_cost_tracker/extensions/fog_model.rb
@@ -0,0 +1,17 @@+module CloudCostTracker
+ module Extensions
+ # Adds convenience methods to Fog::Model instances for tracking billing info
+ module FogModel
+
+ # an Array of pairs of Strings
+ attr_accessor :billing_codes
+
+ end
+ end
+end
+
+module Fog
+ class Model
+ include CloudCostTracker::Extensions::FogModel
+ end
+end
|
Add billing_codes extension to Fog::Model
|
diff --git a/lib/atpay_rest/dashboard.rb b/lib/atpay_rest/dashboard.rb
index abc1234..def5678 100644
--- a/lib/atpay_rest/dashboard.rb
+++ b/lib/atpay_rest/dashboard.rb
@@ -20,7 +20,7 @@ end
def self.create_managed_account(session, organization_sid)
- _response = session.conn.post("/api/v4/rest/organizations/#{organization_sid}/managed_account", args)
+ _response = session.conn.post("/api/v4/rest/organizations/#{organization_sid}/managed_account")
_response.body
end
end
|
Remove unnecessary args in Dashboard.create_managed_account
|
diff --git a/actionmailbox/test/unit/test_helper_test.rb b/actionmailbox/test/unit/test_helper_test.rb
index abc1234..def5678 100644
--- a/actionmailbox/test/unit/test_helper_test.rb
+++ b/actionmailbox/test/unit/test_helper_test.rb
@@ -20,21 +20,25 @@
mail = inbound_email.mail
- assert_equal 2, mail.parts.count
- assert_equal mail.text_part.to_s, <<~TEXT.chomp
+ expected_mail_text_part = <<~TEXT.chomp
Content-Type: text/plain;\r
charset=UTF-8\r
Content-Transfer-Encoding: 7bit\r
\r
Hello, world
TEXT
- assert_equal mail.html_part.to_s, <<~HTML.chomp
+
+ expected_mail_html_part = <<~HTML.chomp
Content-Type: text/html;\r
charset=UTF-8\r
Content-Transfer-Encoding: 7bit\r
\r
<h1>Hello, world</h1>
HTML
+
+ assert_equal 2, mail.parts.count
+ assert_equal expected_mail_text_part, mail.text_part.to_s
+ assert_equal expected_mail_html_part, mail.html_part.to_s
end
end
end
|
Correct the assertion argument order
|
diff --git a/lib/mill/resources/google_site_verification.rb b/lib/mill/resources/google_site_verification.rb
index abc1234..def5678 100644
--- a/lib/mill/resources/google_site_verification.rb
+++ b/lib/mill/resources/google_site_verification.rb
@@ -13,7 +13,7 @@ end
def load
- @content = "google-site-verification: #{@key}\n"
+ @content = "google-site-verification: #{@key}.html\n"
super
end
|
Write correct Google site verification key.
|
diff --git a/gemnasium.gemspec b/gemnasium.gemspec
index abc1234..def5678 100644
--- a/gemnasium.gemspec
+++ b/gemnasium.gemspec
@@ -6,6 +6,7 @@ gem.description = "Safely upload your dependency files (Gemfile, Gemfile.lock, *.gemspec, package.json, npm-shrinkwrap.json) on gemnasium.com to track dependencies and get notified about updates and security advisories."
gem.summary = gem.description
gem.homepage = "https://gemnasium.com/"
+ gem.license = 'MIT'
gem.files = `git ls-files`.split($\)
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
Add license information to gemspec
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.