diff stringlengths 65 26.7k | message stringlengths 7 9.92k |
|---|---|
diff --git a/attributes/default.rb b/attributes/default.rb
index abc1234..def5678 100644
--- a/attributes/default.rb
+++ b/attributes/default.rb
@@ -1,2 +1,2 @@-default['lvm']['di-ruby-lvm']['version'] = '0.1.3'
-default['lvm']['di-ruby-lvm-attrib']['version'] = '0.0.21'
+default['lvm']['di-ruby-lvm']['version'] = '0.2.1'
+default['lvm']['di-ruby-lvm-attrib']['version'] = '0.0.23'
| Use the latest di-ruby-lvm-attrib and di-ruby-lvm gems
|
diff --git a/examples/consumer-group.rb b/examples/consumer-group.rb
index abc1234..def5678 100644
--- a/examples/consumer-group.rb
+++ b/examples/consumer-group.rb
@@ -0,0 +1,26 @@+$LOAD_PATH.unshift(File.expand_path("../../lib", __FILE__))
+
+require "kafka"
+
+logger = Logger.new(STDOUT)
+brokers = ENV.fetch("KAFKA_BROKERS", "localhost:9092").split(",")
+
+# Make sure to create this topic in your Kafka cluster or configure the
+# cluster to auto-create topics.
+topic = "text"
+
+kafka = Kafka.new(
+ seed_brokers: brokers,
+ client_id: "test",
+ socket_timeout: 20,
+ logger: logger,
+)
+
+consumer = kafka.consumer(group_id: "test")
+consumer.subscribe(topic)
+
+trap("TERM") { consumer.stop }
+
+consumer.each_message do |message|
+ puts message.value
+end
| Add simple consumer group example
|
diff --git a/test/integration/helpers/serverspec/spec_helper.rb b/test/integration/helpers/serverspec/spec_helper.rb
index abc1234..def5678 100644
--- a/test/integration/helpers/serverspec/spec_helper.rb
+++ b/test/integration/helpers/serverspec/spec_helper.rb
@@ -1,10 +1,7 @@ # encoding: utf-8
+require 'serverspec'
-require 'serverspec'
-require 'pathname'
-
-include Serverspec::Helper::Exec
-include Serverspec::Helper::DetectOS
+set :backend, :exec
require 'mesosphere_installation'
require 'source_installation'
| Switch to rspec 3 format
|
diff --git a/priority_test.gemspec b/priority_test.gemspec
index abc1234..def5678 100644
--- a/priority_test.gemspec
+++ b/priority_test.gemspec
@@ -5,11 +5,11 @@ Gem::Specification.new do |s|
s.name = "priority_test"
s.version = PriorityTest::VERSION
- s.authors = ["Jingwen Owen Ou"]
+ s.authors = ["Owen Ou"]
s.email = ["jingweno@gmail.com"]
s.homepage = ""
- s.summary = %q{TODO: Write a gem summary}
- s.description = %q{TODO: Write a gem description}
+ s.summary = %q{Run tests in priority}
+ s.description = %q{Run tests in priority}
s.rubyforge_project = "priority_test"
| Add summary to gem file
|
diff --git a/lib/kaminari/mongoid/mongoid_extension.rb b/lib/kaminari/mongoid/mongoid_extension.rb
index abc1234..def5678 100644
--- a/lib/kaminari/mongoid/mongoid_extension.rb
+++ b/lib/kaminari/mongoid/mongoid_extension.rb
@@ -21,7 +21,7 @@ super
kls.send(:include, Kaminari::Mongoid::MongoidExtension::Document.dup)
end
- end if Mongoid::VERSION < '5.0.0'
+ end if ::Mongoid::VERSION < '5.0.0'
end
end
end
| Fix issue with Mongoid::VERSION namespace |
diff --git a/lib/sidekiq/limit_fetch/global/monitor.rb b/lib/sidekiq/limit_fetch/global/monitor.rb
index abc1234..def5678 100644
--- a/lib/sidekiq/limit_fetch/global/monitor.rb
+++ b/lib/sidekiq/limit_fetch/global/monitor.rb
@@ -2,10 +2,9 @@ module Monitor
extend self
- HEARTBEAT_NAMESPACE = 'heartbeat:'
- PROCESSOR_NAMESPACE = 'processor:'
-
- HEARTBEAT_TTL = 18
+ HEARTBEAT_PREFIX = 'heartbeat:'
+ PROCESS_SET = 'processes'
+ HEARTBEAT_TTL = 18
REFRESH_TIMEOUT = 10
def start!(ttl=HEARTBEAT_TTL, timeout=REFRESH_TIMEOUT)
@@ -23,7 +22,7 @@ def update_heartbeat(ttl)
Sidekiq.redis do |it|
it.pipelined do
- it.set processor_key, true
+ it.sadd PROCESS_SET, Selector.uuid
it.set heartbeat_key, true
it.expire heartbeat_key, ttl
end
@@ -32,26 +31,22 @@
def invalidate_old_processors
Sidekiq.redis do |it|
- it.keys(PROCESSOR_NAMESPACE + '*').each do |processor|
- processor.sub! PROCESSOR_NAMESPACE, ''
+ it.smembers(PROCESS_SET).each do |processor|
next if it.get heartbeat_key processor
- it.del processor_key processor
%w(limit_fetch:probed:* limit_fetch:busy:*).each do |pattern|
it.keys(pattern).each do |queue|
it.lrem queue, 0, processor
end
end
+
+ it.srem processor
end
end
end
def heartbeat_key(processor=Selector.uuid)
- HEARTBEAT_NAMESPACE + processor
- end
-
- def processor_key(processor=Selector.uuid)
- PROCESSOR_NAMESPACE + processor
+ HEARTBEAT_PREFIX + processor
end
end
end
| Replace keys(processor:*) calls with iteration over set key
|
diff --git a/lib/tasks/larp_library/elasticsearch.rake b/lib/tasks/larp_library/elasticsearch.rake
index abc1234..def5678 100644
--- a/lib/tasks/larp_library/elasticsearch.rake
+++ b/lib/tasks/larp_library/elasticsearch.rake
@@ -1,10 +1,10 @@ namespace :larp_library do
namespace :elasticsearch do
- desc "Create indexes and import all records"
+ desc 'Create indexes and import all records'
task setup: :environment do
[Project, Tag].each do |klass|
puts "Importing #{klass.count} #{klass.name.pluralize}"
- klass.__elasticsearch__.create_index! force: true
+ klass.__elasticsearch__.create_index! force: klass.__elasticsearch__.index_exists?
klass.import
end
end
| Work around a logging bug
|
diff --git a/test/cookbooks/java_test/recipes/oracle.rb b/test/cookbooks/java_test/recipes/oracle.rb
index abc1234..def5678 100644
--- a/test/cookbooks/java_test/recipes/oracle.rb
+++ b/test/cookbooks/java_test/recipes/oracle.rb
@@ -15,17 +15,22 @@ mode 00644
end
+jdk_install_flavor = 'oracle'
+jdk_version = 7
+java_home = "/usr/lib/jvm/java-#{ jdk_version }-#{ jdk_install_flavor }"
+
Chef::Log.info('Testing management of "oracle_jdk"')
java 'oracle_jdk' do
install_type :tar
install_options(
source: '/tmp/java.tar.gz',
jce_source: '/tmp/jce.zip',
- destination: '/opt',
+ destination: java_home,
strip_leading: true,
- provider: :oracle,
- version: 7,
- update: 45,
install_jce: true
)
end
+
+java_alternatives 'oracle_jdk' do
+ java_location java_home
+end
| Test with java_alternatives as well. The test tar.gz needs to be updated to reflect a more real example of java, have been testing with proper upstream java.tar.gz but not including it in here for obvious reasons.
|
diff --git a/lib/chef/audit/reporter/json_file.rb b/lib/chef/audit/reporter/json_file.rb
index abc1234..def5678 100644
--- a/lib/chef/audit/reporter/json_file.rb
+++ b/lib/chef/audit/reporter/json_file.rb
@@ -1,4 +1,4 @@-autoload :JSON, "json"
+require_relative "../../json_compat"
class Chef
module Audit
@@ -9,7 +9,7 @@ end
def send_report(report)
- File.write(@path, JSON.generate(report))
+ File.write(@path, Chef::JSONCompat.to_json(report))
end
end
end
| Use infra-client json lib in JsonFile reporter.
Signed-off-by: Pete Higgins <e3b6cda228242c30b711ac17cb264f1dbadfd0b6@peterhiggins.org>
|
diff --git a/test_site/datamapper_setup.rb b/test_site/datamapper_setup.rb
index abc1234..def5678 100644
--- a/test_site/datamapper_setup.rb
+++ b/test_site/datamapper_setup.rb
@@ -3,6 +3,6 @@ require "dm-transactions"
require "data_objects"
require "do_sqlite3"
-DataMapper.setup(:default, {:adapter => "sqlite3", :database => "db/#{SE_TEST_FRAMEWORK}.datamapper.sqlite3" })
+DataMapper.setup(:default, "sqlite3:db/#{SE_TEST_FRAMEWORK}.datamapper.sqlite3")
%w'dm_employee dm_group dm_position dm_officer dm_meeting'.each{|x| require "model/#{x}"}
require 'model/dm_resources'
| Use URL for setting up datamapper, the hash syntax doesn't seem to work in 1.0.2 on ruby 1.9
|
diff --git a/lib/prequel/expressions/not_equal.rb b/lib/prequel/expressions/not_equal.rb
index abc1234..def5678 100644
--- a/lib/prequel/expressions/not_equal.rb
+++ b/lib/prequel/expressions/not_equal.rb
@@ -2,7 +2,7 @@ module Expressions
class NotEqual < Predicate
def type
- :Neq
+ :NotEqual
end
def operator_sql
| Update wire representation of NotEqual predicate
|
diff --git a/lib/redmine_git_hosting/utils/git.rb b/lib/redmine_git_hosting/utils/git.rb
index abc1234..def5678 100644
--- a/lib/redmine_git_hosting/utils/git.rb
+++ b/lib/redmine_git_hosting/utils/git.rb
@@ -17,10 +17,11 @@ #
# here, name can have many components.
- @@refcomp = "[\\.\\-\\w_\\*]+"
+ REF_COMPONENT_PART = '[\\.\\-\\w_\\*]+'
+ REF_COMPONENT_REGEX = /^(refs\/)?((#{REF_COMPONENT_PART})\/)?(#{REF_COMPONENT_PART}(\/#{REF_COMPONENT_PART})*)$/
def refcomp_parse(spec)
- if (refcomp_parse = spec.match(/^(refs\/)?((#{@@refcomp})\/)?(#{@@refcomp}(\/#{@@refcomp})*)$/))
+ if (refcomp_parse = spec.match(REF_COMPONENT_REGEX))
if refcomp_parse[1]
# Should be first class. If no type component, return fail
if refcomp_parse[3]
| Replace class variable by a constant
|
diff --git a/lib/travis/api/app/helpers/accept.rb b/lib/travis/api/app/helpers/accept.rb
index abc1234..def5678 100644
--- a/lib/travis/api/app/helpers/accept.rb
+++ b/lib/travis/api/app/helpers/accept.rb
@@ -4,7 +4,7 @@ module Helpers
module Accept
HEADER_FORMAT = /vnd\.travis-ci\.(\d+)\+(\w+)/
- DEFAULT_VERSION = 'v2'
+ DEFAULT_VERSION = 'v1'
DEFAULT_FORMAT = 'json'
def accept_version
| Use API v1 by default
|
diff --git a/files/brews/gh.rb b/files/brews/gh.rb
index abc1234..def5678 100644
--- a/files/brews/gh.rb
+++ b/files/brews/gh.rb
@@ -6,7 +6,7 @@ homepage 'https://github.com/jingweno/gh'
url "https://github.com/jingweno/gh/archive/#{VERSION}.tar.gz"
sha1 '1e4ca70ebf018ae192a641f18b735beca5df5c31'
- version VERSION
+ version "#{VERSION}-boxen1"
head 'https://github.com/jingweno/gh.git'
| Add boxen one as the version
|
diff --git a/backend/app/helpers/comable/admin/navigations_helper.rb b/backend/app/helpers/comable/admin/navigations_helper.rb
index abc1234..def5678 100644
--- a/backend/app/helpers/comable/admin/navigations_helper.rb
+++ b/backend/app/helpers/comable/admin/navigations_helper.rb
@@ -12,7 +12,7 @@ fields = f.fields_for(association, new_object, child_index: index) do |builder|
render(association.to_s.singularize + '_fields', f: builder)
end
- button_tag(name, type: :button, class: 'add_fields btn btn-default pull-right', data: { index: index, fields: fields.gsub("\n", '') })
+ button_tag(name, type: :button, class: 'add_fields btn btn-default pull-right', data: { index: index, fields: fields.delete("\n") })
end
end
end
| Refactor with rubocop: gsub => delete
|
diff --git a/app/decorators/models/spree/product_duplicator_decorator.rb b/app/decorators/models/spree/product_duplicator_decorator.rb
index abc1234..def5678 100644
--- a/app/decorators/models/spree/product_duplicator_decorator.rb
+++ b/app/decorators/models/spree/product_duplicator_decorator.rb
@@ -0,0 +1,24 @@+module Spree
+ module ProductDuplicatorSoundDecorator
+
+ def duplicate_master
+ master = product.master
+ new_master = super
+ if new_master
+ new_master.sounds = master.sounds.map { |sound| duplicate_sound sound } if @include_images
+ end
+ new_master
+ end
+
+ def duplicate_sound(sound)
+ new_sound = sound.dup
+ new_sound.assign_attributes(:attachment => sound.attachment.clone)
+ new_sound
+ end
+
+ end
+
+ Spree::ProductDuplicator.class_eval do
+ prepend ProductDuplicatorSoundDecorator
+ end
+end
| Duplicate sounds when master is duplicated.
|
diff --git a/recipes/change-apt.rb b/recipes/change-apt.rb
index abc1234..def5678 100644
--- a/recipes/change-apt.rb
+++ b/recipes/change-apt.rb
@@ -1,6 +1,9 @@ # update /etc/apt/sources.list at compile time
-e = execute "sed -i 's/us.archive.ubuntu.com/ftp.jaist.ac.jp/' /etc/apt/sources.list ; apt-get update" do
- action :nothing
+case node.platform
+when "ubuntu"
+ e = execute "sed -i 's/us.archive.ubuntu.com/ftp.jaist.ac.jp/' /etc/apt/sources.list ; apt-get update" do
+ action :nothing
+ end
+
+ e.run_action(:run)
end
-
-e.run_action(:run)
| Change apt source only if OS is Ubuntu
|
diff --git a/core/lib/spree/testing_support/factories/stock_transfer_factory.rb b/core/lib/spree/testing_support/factories/stock_transfer_factory.rb
index abc1234..def5678 100644
--- a/core/lib/spree/testing_support/factories/stock_transfer_factory.rb
+++ b/core/lib/spree/testing_support/factories/stock_transfer_factory.rb
@@ -1,13 +1,13 @@ FactoryGirl.define do
factory :stock_transfer, class: Spree::StockTransfer do
- source_location Spree::StockLocation.new(name: "Source Location", code: "SRC", admin_name: "Source")
+ source_location { Spree::StockLocation.create!(name: "Source Location", code: "SRC", admin_name: "Source") }
factory :stock_transfer_with_items do
+ destination_location { Spree::StockLocation.create!(name: "Destination Location", code: "DEST", admin_name: "Destination") }
+
after(:create) do |stock_transfer, evaluator|
variant_1 = create(:variant)
variant_2 = create(:variant)
-
- stock_transfer.destination_location = Spree::StockLocation.new(name: "Destination Location", code: "DEST", admin_name: "Destination")
variant_1.stock_items.find_by(stock_location: stock_transfer.source_location).set_count_on_hand(10)
variant_2.stock_items.find_by(stock_location: stock_transfer.source_location).set_count_on_hand(10)
@@ -20,9 +20,8 @@ end
factory :receivable_stock_transfer_with_items do
- destination_location Spree::StockLocation.new(name: "Destination Location", code: "DEST", admin_name: "Destination")
- finalized_at Time.now
- shipped_at Time.now
+ finalized_at { Time.now }
+ shipped_at { Time.now }
end
end
end
| Fix issues with stock_transfer factory
A stock location was being created at load time, outside of running
specs. Times were also being read at load time, instead of in a spec.
With this fix stock_transfers_controller can run with random ordering.
|
diff --git a/OSX/saldl.rb b/OSX/saldl.rb
index abc1234..def5678 100644
--- a/OSX/saldl.rb
+++ b/OSX/saldl.rb
@@ -1,9 +1,9 @@ class Saldl < Formula
desc "CLI downloader optimized for speed and early preview."
homepage "https://saldl.github.io"
- url "https://github.com/saldl/saldl/archive/v29.tar.gz"
- version "29"
- sha256 "8b0d5d28fe891e5e2f5f3fd4f14642860ce763e85c159b2bcb9b913282026eaa"
+ url "https://github.com/saldl/saldl/archive/v30.tar.gz"
+ version "30"
+ sha256 "54f0887ef32ceff1af46e30cf06202a2a9cead4a19d575d22feaad44f92d4d9e"
head do
# git describe does not work with shallow clones
| OSX: Update Homebrew formula for v30
Signed-off-by: Mohammad Alsaleh <6c225a8dcf0f3ea8ab31a8a88dea0c937d544fc7@gmail.com>
|
diff --git a/human_player.rb b/human_player.rb
index abc1234..def5678 100644
--- a/human_player.rb
+++ b/human_player.rb
@@ -7,14 +7,14 @@ end
def take_turn
- move = get_move
- man = take_man(move.first)
+ seq = get_move
+ man = take_man(seq.shift)
if man.nil?
raise InvalidMoveError.new
end
- (man.slide(move.last) || man.jump(move.last)) or raise InvalidMoveError.new
+ man.move(seq)
end
protected
@@ -26,16 +26,16 @@
def get_move
move = gets.chomp
- parse_move(move)
+ parse_input(move)
+ end
+
+ def parse_input(move)
+ chain = move.split(",")
+ chain.map { |link| parse_move(link) }
end
def parse_move(move)
- start, target = move.split(",")
- start = start.split("")
- target = target.split("")
- start.map! {|e| Integer(e) }
- target.map! {|e| Integer(e) }
- [start, target]
+ move.split("").map { |digit| Integer(digit) }
end
end
| Rewrite player move parsing to support entire movement chains
|
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -39,8 +39,14 @@ content_tag(:dd, (options[:url] ? link_to(options[:value], options[:url]) : options[:value]))
end
- def gravatar_for(user)
- gravatar_image_tag(user.email, :alt => user.display_name, :title => user.display_name, :class => "avatar")
+ def gravatar_for(user, options)
+ options.reverse_merge!(:class => "avatar", :size => 64)
+ gravatar_image_tag(user.email, :alt => user.display_name,
+ :title => user.display_name,
+ :class => options[:class],
+ :width => options[:size],
+ :height => options[:size],
+ :gravatar => { :size => options[:size] })
end
def markdownize(text)
| Create a helper for displaying gravatars. [Story1567591] |
diff --git a/app/models/translated_sentence.rb b/app/models/translated_sentence.rb
index abc1234..def5678 100644
--- a/app/models/translated_sentence.rb
+++ b/app/models/translated_sentence.rb
@@ -3,9 +3,9 @@ belongs_to :audience, class_name: Ontology.to_s
belongs_to :sentence
belongs_to :symbol_mapping
- has_one :locid, through: :sentence
delegate :name, to: :sentence
+ delegate :locid, to: :sentence
attr_accessible :audience, :ontology, :sentence, :symbol_mapping
attr_accessible :translated_text
| Change has_one locid to delegate
|
diff --git a/instrumental_agent.gemspec b/instrumental_agent.gemspec
index abc1234..def5678 100644
--- a/instrumental_agent.gemspec
+++ b/instrumental_agent.gemspec
@@ -7,8 +7,8 @@ s.authors = ["Elijah Miller", "Christopher Zelenak", "Kristopher Chambers", "Matthew Hassfurder"]
s.email = ["support@instrumentalapp.com"]
s.homepage = "http://github.com/expectedbehavior/instrumental_agent"
- s.summary = %q{Agent for reporting data to instrumentalapp.com}
- s.description = %q{Track anything.}
+ s.summary = %q{Custom metric monitoring for Ruby applications via Instrumental}
+ s.description = %q{This agent supports Instrumental custom metric monitoring for Ruby applications. It provides high-data reliability at high scale, without ever blocking your process or causing an exception.}
s.license = "MIT"
| Update gemspec description and summary |
diff --git a/lib/active_set/instructions/entry/keypath.rb b/lib/active_set/instructions/entry/keypath.rb
index abc1234..def5678 100644
--- a/lib/active_set/instructions/entry/keypath.rb
+++ b/lib/active_set/instructions/entry/keypath.rb
@@ -17,21 +17,23 @@
def attribute
attribute = @path.last
- return attribute.sub(operator_regex, '') if attribute.match operator_regex
+ return attribute.sub(operator_regex, '') if attribute&.match operator_regex
attribute
end
def operator
attribute = @path.last
- return attribute[operator_regex, 1] if attribute.match operator_regex
+ return attribute[operator_regex, 1] if attribute&.match operator_regex
'=='
end
def associations_array
+ return [] unless @path.any?
@path.slice(0, @path.length - 1)
end
def associations_hash
+ return {} unless @path.any?
associations_array.reverse.reduce({}) { |a, e| { e => a } }
end
| Make the Instructions Keypath class more resilient against nils
|
diff --git a/lib/itunes_connect/autoingestion/ingester.rb b/lib/itunes_connect/autoingestion/ingester.rb
index abc1234..def5678 100644
--- a/lib/itunes_connect/autoingestion/ingester.rb
+++ b/lib/itunes_connect/autoingestion/ingester.rb
@@ -5,7 +5,7 @@ class Ingester
attr_reader :username, :password, :vendor_id, :report_type, :report_subtype, :date_type, :date
- def initialize(username: , password: , vendor_id: , report_type: 'Sales', report_subtype: 'Summary', date_type: 'Daily', date: Date.today)
+ def initialize(username: , password: , vendor_id: , report_type: 'Sales', report_subtype: 'Summary', date_type: 'Daily', date: (Date.today - 1))
@username = username
@password = password
@vendor_id = vendor_id
| Change default date to yesterday
|
diff --git a/rake-nvie-git-workflow.gemspec b/rake-nvie-git-workflow.gemspec
index abc1234..def5678 100644
--- a/rake-nvie-git-workflow.gemspec
+++ b/rake-nvie-git-workflow.gemspec
@@ -16,6 +16,4 @@ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.require_paths = ["lib"]
-
- gem.add_dependency "version", "~> 1.0.0"
end
| Remove dependency on 'version' gem
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,3 +1,4 @@+ENV['GEM_ENV'] = 'test'
require 'simplecov'
require 'support/logistic_reverse_helper'
@@ -20,12 +21,12 @@
config.before do
CorreiosSigep.configure do |config|
- config.user = 'user'
- config.password = 'password'
- config.administrative_code = '12345'
- config.card = 'card'
- config.contract = '67890'
- config.service_code = 'service_code'
+ config.user = '60618043'
+ config.password = '8o8otn'
+ config.administrative_code = '08082650'
+ config.card = '0057018901'
+ config.contract = '9912208555'
+ config.service_code = '41076'
end
end
end
| Add an Environment to identify when is a test and the correct homolog correios config
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -11,14 +11,6 @@ add_group "Relation", "lib/data_mapper/relation"
add_group "Relationship", "lib/data_mapper/relationship"
add_group "Engine", "lib/data_mapper/engine"
- end
-end
-
-if RUBY_VERSION < '1.9'
- class OpenStruct
- def id
- @table.fetch(:id) { super }
- end
end
end
| Remove duplicate OpenStruct monkey patch for specs |
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,7 +1,9 @@ # frozen_string_literal: true
require 'simplecov'
-SimpleCov.start
+SimpleCov.start do
+ add_filter('spec')
+end
require 'webmock/rspec'
| Exclude spec/ dir from coverage
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -11,6 +11,8 @@
config.example_status_persistence_file_path = 'tmp/rspec_examples.txt'
+ config.default_formatter = 'doc'
+
config.before(:all) do
add_fakes_to_path
create_tmp_directory
| Use doc formatter for welaika-suspenders tests
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -2,7 +2,7 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'rspec/its'
-require 'simplecov'
+require 'simplecov' # Used filters are defined in /.simplecov
require 'opt_parse_validator'
FIXTURES = Pathname.new(File.expand_path(File.join(File.dirname(__FILE__), 'fixtures')))
@@ -12,10 +12,6 @@ SimpleCov.formatter = Coveralls::SimpleCov::Formatter
end
-SimpleCov.start do
- add_filter '/spec/'
-end
-
# See http://betterspecs.org/
RSpec.configure do |config|
config.expect_with :rspec do |c|
| Remove useless Simplecov filters (automatically loaded via .simplecov) |
diff --git a/sparql/fix_removed_ico.ru b/sparql/fix_removed_ico.ru
index abc1234..def5678 100644
--- a/sparql/fix_removed_ico.ru
+++ b/sparql/fix_removed_ico.ru
@@ -0,0 +1,21 @@+PREFIX adms: <http://www.w3.org/ns/adms#>
+PREFIX rov: <http://www.w3.org/ns/regorg#>
+PREFIX schema: <http://schema.org/>
+PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
+
+WITH <http://linked.opendata.cz/resource/dataset/isvz.cz>
+INSERT {
+ ?organization rov:registration ?registration .
+ ?registration a adms:Identifier ;
+ skos:notation ?ico ;
+ skos:inScheme <http://linked.opendata.cz/resource/concept-scheme/CZ-ICO> .
+}
+WHERE {
+ ?organization a schema:Organization .
+ FILTER STRSTARTS(STR(?organization), "http://linked.opendata.cz/resource/business-entity/CZ")
+ FILTER NOT EXISTS {
+ ?organization rov:registration [] .
+ }
+ BIND (STRAFTER(STR(?organization), "http://linked.opendata.cz/resource/business-entity/CZ") AS ?ico)
+ BIND (IRI(CONCAT("http://linked.opendata.cz/resource/isvz.cz/identifier/", ?ico)) AS ?registration)
+}
| Add IČO for newly linked organizations
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -19,3 +19,8 @@ AppStore::Emigrant::Cache.clear!
include AppStore::Emigrant
+
+# Convenience method to retrieve a fixture
+def fixture name
+ File.read ROOT + '/fixtures/' + name
+end
| Add convenience method to retrieve a fixture
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -9,6 +9,7 @@ :operatingsystemrelease => '7.0',
:fqdn => 'patchwork.example.com',
:hostname => 'patchwork',
+ :virtualenv_version => '1.10.1'
}
c.hiera_config = File.expand_path(File.join(__FILE__, '../fixtures/hiera.yaml'))
end
| Add an explicit virtualenv version to spec facts
Signed-off-by: Trevor Bramwell <9318f446584e3f6cf68dea37a1a9fde63cb30ce1@linuxfoundation.org>
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,4 +1,4 @@+require 'coveralls'
+Coveralls.wear!
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'strut'
-require 'coveralls'
-Coveralls.wear!
| Fix order of wearing coveralls (!).
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -2,7 +2,6 @@ ENV["RAILS_ENV"] = 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
-require 'rspec/autorun'
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
| Remove autorun to facilitate zeus
|
diff --git a/spec/plugin/controllers/rdb/boards_controller_spec.rb b/spec/plugin/controllers/rdb/boards_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/plugin/controllers/rdb/boards_controller_spec.rb
+++ b/spec/plugin/controllers/rdb/boards_controller_spec.rb
@@ -11,9 +11,11 @@ it { expect(subject.status).to eq 200 }
describe 'JSON body' do
- subject { JSON.load(super().body).symbolize_keys }
+ subject { JSON.load super().body }
- it { should eq id: board.id, name: 'My Board' }
+ it { expect(subject.keys).to eq %w(id name engine) }
+ it { expect(subject['id']).to eq board.id }
+ it { expect(subject['name']).to eq board.name }
end
end
end
| Fix test stubs for API boards controller |
diff --git a/spec/features/cli_spec.rb b/spec/features/cli_spec.rb
index abc1234..def5678 100644
--- a/spec/features/cli_spec.rb
+++ b/spec/features/cli_spec.rb
@@ -0,0 +1,15 @@+RSpec.describe 'The `radius` CLI:', type: :feature do
+
+ def bin_radius
+ @_bin_radius ||= if File.exist?('sbin/radius')
+ 'sbin/radius'
+ else
+ 'bundle exec radius'
+ end
+ end
+
+ it 'running `radius` is successful' do
+ expect(system bin_radius).to be true
+ end
+
+end
| Include basic sanity check for executable.
|
diff --git a/history_book.gemspec b/history_book.gemspec
index abc1234..def5678 100644
--- a/history_book.gemspec
+++ b/history_book.gemspec
@@ -19,9 +19,9 @@ s.add_dependency 'activesupport', '>= 3.0'
s.add_dependency 'multi_json', '>= 1.0'
- s.add_development_dependency 'rspec', '~> 2.11'
- s.add_development_dependency 'rake'
- s.add_development_dependency 'sequel', '~> 3.40'
- s.add_development_dependency 'sqlite3-ruby', '~> 1.3'
- s.add_development_dependency 'yajl-ruby', '~> 1.1'
+ s.add_development_dependency 'rspec', '2.13.0'
+ s.add_development_dependency 'rake', '10.0.3'
+ s.add_development_dependency 'sequel', '3.46.0'
+ s.add_development_dependency 'sqlite3', '1.3.7'
+ s.add_development_dependency 'yajl-ruby', '1.1.0'
end
| Update development dependencies in gemspec
|
diff --git a/test/matcher_test.rb b/test/matcher_test.rb
index abc1234..def5678 100644
--- a/test/matcher_test.rb
+++ b/test/matcher_test.rb
@@ -40,8 +40,10 @@
group 'returns instance of the given class if the matcher returns truthy' do
assert do
- build_matcher(MockResult, proc { true })
- .call.is_a? MockResult
+ given_class = Class.new
+
+ build_matcher(given_class, proc { true })
+ .call.is_a? given_class
end
end
| Make test a little more reliable
|
diff --git a/ruby/alias_manager.rb b/ruby/alias_manager.rb
index abc1234..def5678 100644
--- a/ruby/alias_manager.rb
+++ b/ruby/alias_manager.rb
@@ -27,11 +27,18 @@ p new_consonants
end
-#Generate new first names
+#Generate new names
screen = "clear"
puts "Hello agent. What is your first and last name?"
+name = gets.chomp.downcase.split(" ")
+name.rotate
+name.class
+name.join('')
+
+
+
name = gets.chomp.chars.map(&:downcase)
p name
name.class
| Set up array and string methods for alias
|
diff --git a/ruby/puppy_methods.rb b/ruby/puppy_methods.rb
index abc1234..def5678 100644
--- a/ruby/puppy_methods.rb
+++ b/ruby/puppy_methods.rb
@@ -1,9 +1,68 @@ class Puppy
+
+ # called each time .new is used
+ def initialize
+ puts "Initializing new puppy instance"
+ end
def fetch(toy)
puts "I brought back the #{toy}!"
toy
end
+ def speak(num)
+ num.times { puts "Woof!" }
+ end
+
+ def roll_over
+ puts "*rolls over*"
+ end
+
+ def dog_years(human_years)
+ human_years * 7
+ end
+
+ def plays_dead
+ puts "*plays dead*"
+ end
+
end
+doggy = Puppy.new
+doggy.fetch("ball")
+doggy.speak(3)
+doggy.roll_over
+puts doggy.dog_years(10)
+doggy.plays_dead
+puts "\n"
+
+class Kitten
+
+ def initialize
+ puts "Initializing kitten instance"
+ end
+
+ def hiss(cat_name, human_name)
+ puts "#{cat_name} hissed at #{human_name}"
+ end
+
+ def puke
+ puts "*pukes on rug*"
+ end
+
+end
+
+cat_array = []
+
+50.times do
+ cat_array << Kitten.new
+end
+
+names = ["Bob", "Sally", "Nancy", "Steve", "John"]
+cat_names = ["Felix", "Garfield", "Tom", "Kerouac"]
+
+cat_array.each do |kitten|
+ kitten.hiss(cat_names[rand(4)], names[rand(5)])
+ kitten.puke
+ puts "\n"
+end | Update puppy methods file with custom methods and cat class
|
diff --git a/app/models/arp.rb b/app/models/arp.rb
index abc1234..def5678 100644
--- a/app/models/arp.rb
+++ b/app/models/arp.rb
@@ -7,11 +7,10 @@ end
def self.present_users
- User.joins(:network_devices)
- .where(network_devices: {
- mac_address: all.map(&:mac_address),
- use_for_presence: true})
- .group('users.id')
+ User.joins(:network_devices).where(network_devices: {
+ mac_address: all.map(&:mac_address),
+ use_for_presence: true
+ }).uniq
end
def self.mac_by_ip_address(ip_address)
| Use a uniq call instead of group_by for present users
|
diff --git a/spec/slide_rule/distance_calculators/levenshtein_spec.rb b/spec/slide_rule/distance_calculators/levenshtein_spec.rb
index abc1234..def5678 100644
--- a/spec/slide_rule/distance_calculators/levenshtein_spec.rb
+++ b/spec/slide_rule/distance_calculators/levenshtein_spec.rb
@@ -1,11 +1,19 @@ require 'spec_helper'
describe ::SlideRule::DistanceCalculators::Levenshtein do
+ let(:subject) { described_class.new }
+
it 'should calculate perfect match' do
- expect(described_class.new.calculate('this is a test', 'this is a test')).to eq(0.0)
+ expect(subject.calculate('this is a test', 'this is a test')).to eq(0.0)
end
it 'should calculate distance as distance divided by length of longest string' do
- expect(described_class.new.calculate('this is a test', 'this is a test!').round(4)).to eq((1.0 / 15).round(4))
+ expect(subject.calculate('this is a test', 'this is a test!').round(4)).to eq((1.0 / 15).round(4))
+ end
+
+ it 'should handle nils' do
+ expect(subject.calculate(nil, nil)).to eq(0.0)
+ expect(subject.calculate(nil, 'goodbye')).to eq(1.0)
+ expect(subject.calculate('hello', nil)).to eq(1.0)
end
end
| Add specs to ensure nils work correctly with leveshtein calculator
|
diff --git a/i18n-hygiene.gemspec b/i18n-hygiene.gemspec
index abc1234..def5678 100644
--- a/i18n-hygiene.gemspec
+++ b/i18n-hygiene.gemspec
@@ -1,10 +1,10 @@ Gem::Specification.new do |s|
s.name = 'i18n-hygiene'
- s.version = '0.1.0'
+ s.version = '1.0.0'
s.license = 'MIT'
s.summary = "A linter for translation data in ruby applications"
- s.description = "Provides a rake task that checks locale data for likely issues. Intended to be used in build pipelines to detect problems before they reach production"
- s.authors = [ "Nick Browne"," Keith Pitty" ]
+ s.description = "Provides a configurable rake task that checks locale data for likely issues. Intended to be used in build pipelines to detect problems before they reach production"
+ s.authors = [ "Eleanor Kiefel Haggerty", "Keith Pitty", "Nick Browne" ]
s.email = "dev@theconversation.edu.au"
s.files = `git ls-files -- lib/*`.split("\n")
s.homepage = 'https://github.com/conversation/i18n-hygiene'
| Update gemspec in preparation for 1.0.0
|
diff --git a/spec/functions/camelCaseFunction_spec.rb b/spec/functions/camelCaseFunction_spec.rb
index abc1234..def5678 100644
--- a/spec/functions/camelCaseFunction_spec.rb
+++ b/spec/functions/camelCaseFunction_spec.rb
@@ -1,8 +1,8 @@ require 'spec_helper'
describe 'camelCaseFunction' do
- it { is_expected.not_to be_nil }
- it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /Requires 1 argument/) }
- it { is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError, /Argument must be a string/) }
- it { is_expected.to run.with_params('test').and_return('test') }
+ it { should_not be_nil }
+ it { should run.with_params().and_raise_error(Puppet::ParseError, /Requires 1 argument/) }
+ it { should run.with_params(1).and_raise_error(Puppet::ParseError, /Argument must be a string/) }
+ it { should run.with_params('test').and_return('test') }
end
| Convert tests over to should syntax to keep old rspec happy
|
diff --git a/spec/models/content_configuration_spec.rb b/spec/models/content_configuration_spec.rb
index abc1234..def5678 100644
--- a/spec/models/content_configuration_spec.rb
+++ b/spec/models/content_configuration_spec.rb
@@ -10,8 +10,7 @@ end
def image_exist?(default_url)
- image_path = default_url.gsub(%r{/assets/}, '/assets/images/')
- File.exist?(File.join(Rails.root, 'app', image_path))
+ File.exist?(File.join(Rails.root, 'public', default_url))
end
end
end
| Update content config spec to use new default image paths
|
diff --git a/spec/unit/converters/convert_file_spec.rb b/spec/unit/converters/convert_file_spec.rb
index abc1234..def5678 100644
--- a/spec/unit/converters/convert_file_spec.rb
+++ b/spec/unit/converters/convert_file_spec.rb
@@ -13,6 +13,6 @@ expect(::File.basename(answer)).to eq('test.txt')
expect(::File.read(answer)).to eq('foobar')
- ::File.unlink('test.txt')
+ ::File.unlink('test.txt') unless Gem.win_platform?
end
end
| Change to skip deletion on windows
|
diff --git a/lib/auto_html/filters/twitter.rb b/lib/auto_html/filters/twitter.rb
index abc1234..def5678 100644
--- a/lib/auto_html/filters/twitter.rb
+++ b/lib/auto_html/filters/twitter.rb
@@ -10,7 +10,10 @@ uri = URI("https://api.twitter.com/1/statuses/oembed.json")
uri.query = URI.encode_www_form(params)
- response = JSON.parse(Net::HTTP.get(uri))
+ http = Net::HTTP.new(uri.host, uri.port)
+ http.use_ssl = true
+
+ response = JSON.parse(http.get(uri.request_uri).body)
response["html"]
end
end
| Fix tests for Ruby 1.9.3
|
diff --git a/lib/geocoder/lookups/geocodio.rb b/lib/geocoder/lookups/geocodio.rb
index abc1234..def5678 100644
--- a/lib/geocoder/lookups/geocodio.rb
+++ b/lib/geocoder/lookups/geocodio.rb
@@ -10,7 +10,7 @@
def query_url(query)
path = query.reverse_geocode? ? "reverse" : "geocode"
- "#{protocol}://api.geocod.io/v1/#{path}?#{url_query_string(query)}"
+ "#{protocol}://api.geocod.io/v1.2/#{path}?#{url_query_string(query)}"
end
def results(query)
| Update geocod.io to use most recent API version |
diff --git a/lib/govuk_mirrorer/configurer.rb b/lib/govuk_mirrorer/configurer.rb
index abc1234..def5678 100644
--- a/lib/govuk_mirrorer/configurer.rb
+++ b/lib/govuk_mirrorer/configurer.rb
@@ -13,11 +13,15 @@ o.on('--site-root URL',
"Base URL to mirror from",
" falls back to MIRRORER_SITE_ROOT env variable") {|root| options[:site_root] = root }
+
+ o.separator "Logging:"
o.on('--logfile FILE', "Enable logging to a file") { |file| options[:logfile] = file }
o.on('--loglevel LEVEL', 'DEBUG/INFO/WARN/ERROR, it defaults to INFO') do |level|
options[:log_level] = level
end
o.on('-v', '--verbose', 'sets loglevel to DEBUG') { |level| options[:log_level] = 'DEBUG' }
+
+ o.separator ""
o.on('-h', '--help') { puts o; exit }
o.parse!(args)
end
| Tidy up option help output a little. |
diff --git a/lib/inch_ci/worker/build_json.rb b/lib/inch_ci/worker/build_json.rb
index abc1234..def5678 100644
--- a/lib/inch_ci/worker/build_json.rb
+++ b/lib/inch_ci/worker/build_json.rb
@@ -16,7 +16,17 @@ @branch_name = json['branch_name'] || json['travis_branch']
@revision = json['revision'] || json['travis_commit']
@nwo = json['nwo'] || json['travis_repo_slug']
- @url = json['git_repo_url']
+ @url = json['git_repo_url']
+ end
+
+ def travis?
+ !json['travis'].nil?
+ end
+
+ def to_h(include_objects: true)
+ h = json.dup
+ h.delete('objects') unless include_objects
+ h
end
end
end
| Add helper methods to JSONDump
|
diff --git a/lib/model_stubbing/extensions.rb b/lib/model_stubbing/extensions.rb
index abc1234..def5678 100644
--- a/lib/model_stubbing/extensions.rb
+++ b/lib/model_stubbing/extensions.rb
@@ -24,6 +24,7 @@ end
def setup_fixtures
+ ModelStubbing.records.clear
return unless self.class.definition
unless self.class.definition_inserted
self.class.definition.insert!
| Clear stubbing records between tests, to prevent re-use of modified instantiated stub -- thnx D. Bell
Signed-off-by: Lawrence Pit <16a7a9a98a176e034f87aae1f0f4d1a652d7c013@gmail.com>
|
diff --git a/lib/polytexnic/commands/build.rb b/lib/polytexnic/commands/build.rb
index abc1234..def5678 100644
--- a/lib/polytexnic/commands/build.rb
+++ b/lib/polytexnic/commands/build.rb
@@ -7,6 +7,9 @@ raise 'Invalid format' unless Polytexnic::FORMATS.include?(format)
print "Building #{format.upcase}..."
builder_for(format).build!
+ if format == 'html'
+ puts "Tralics debug information ouput to log/tralics.log"
+ end
puts "Done."
end
| Add note about Tralics log
|
diff --git a/config/application.rb b/config/application.rb
index abc1234..def5678 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -14,6 +14,7 @@ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
config.time_zone = 'Pacific Time (US & Canada)'
+ config.active_record.default_timezone = :local
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
| Revert "Stop setting activerecord time to local"
This reverts commit 1bcff70a0c7b9f78949fe881b4f2823ceb2b1a7e.
|
diff --git a/bin/prebuild.rb b/bin/prebuild.rb
index abc1234..def5678 100644
--- a/bin/prebuild.rb
+++ b/bin/prebuild.rb
@@ -9,14 +9,14 @@ platformFiles = [];
Dir.foreach('resources/images') do |filename|
ext = File.extname(filename);
+ if filename.include? '~'
+ filename = filename.sub(/(\w)~.+/, '\1') + ext
+ end
+ if platformFiles.include? filename
+ next
+ end
+ platformFiles << filename
if formats.include? ext
- if filename.include? '~'
- filename = filename.sub(/(\w)~.+/, '\1') + ext
- if platformFiles.include? filename
- next
- end
- platformFiles << filename
- end
json['resources']['media'] << {
type: ext[1..-1],
file: "images/#{filename}",
| Fix bad generation when multiple files have the same name
|
diff --git a/lib/capistrano_nrel_ext/actions/install_deploy_files.rb b/lib/capistrano_nrel_ext/actions/install_deploy_files.rb
index abc1234..def5678 100644
--- a/lib/capistrano_nrel_ext/actions/install_deploy_files.rb
+++ b/lib/capistrano_nrel_ext/actions/install_deploy_files.rb
@@ -7,7 +7,7 @@ remote_deploy_file_paths.each do |remote_deploy_file_path|
install_remote_path = remote_deploy_file_path.gsub(/\.deploy$/, "")
- if(exists?(:rails_env) && rails_env != "development")
+ if(exists?(:rails_env) && rails_env == "development")
# In development mode, don't overwrite any existing files.
commands << "rsync -a --ignore-existing #{remote_deploy_file_path} #{install_remote_path}"
else
| Fix deploy file installation in non-development mode.
|
diff --git a/LYPopView.podspec b/LYPopView.podspec
index abc1234..def5678 100644
--- a/LYPopView.podspec
+++ b/LYPopView.podspec
@@ -3,12 +3,12 @@
Pod::Spec.new do |s|
s.name = 'LYPopView'
- s.version = '0.1.6'
+ s.version = '0.1.7'
s.summary = 'pop view.'
s.description = <<-DESC
a pop view.
-message, table.
+message, table, date.
DESC
s.homepage = 'https://github.com/blodely/LYPopView'
| Modify : pod spec file
|
diff --git a/app/models/obs_factory/distribution_strategy_factory_ppc.rb b/app/models/obs_factory/distribution_strategy_factory_ppc.rb
index abc1234..def5678 100644
--- a/app/models/obs_factory/distribution_strategy_factory_ppc.rb
+++ b/app/models/obs_factory/distribution_strategy_factory_ppc.rb
@@ -19,6 +19,10 @@ 'ports/ppc/factory'
end
+ def openqa_version
+ 'Tumbleweed PowerPC'
+ end
+
def repo_url
'http://download.opensuse.org/ports/ppc/factory/repo/oss/media.1/build'
end
| Set TW version for PowerPC
Signed-off-by: Dinar Valeev <5117617bf147dfe0d669bc60877f607cdec8696e@suse.com>
|
diff --git a/NNNetwork.podspec b/NNNetwork.podspec
index abc1234..def5678 100644
--- a/NNNetwork.podspec
+++ b/NNNetwork.podspec
@@ -9,7 +9,7 @@ s.ios.deployment_target = '5.0'
s.osx.deployment_target = '10.7'
s.source_files = 'NNNetwork'
- s.resources = 'Resources'
+ s.resources = 'Resources/*.png'
s.ios.frameworks = 'Security', 'MobileCoreServices', 'SystemConfiguration', 'UIKit'
s.osx.frameworks = 'Security', 'CoreServices', 'SystemConfiguration'
s.requires_arc = true
| Fix "Could not inspect the application package." installation issue
https://github.com/CocoaPods/CocoaPods/issues/800 |
diff --git a/lib/bundler/vendor/postit/lib/postit/installer.rb b/lib/bundler/vendor/postit/lib/postit/installer.rb
index abc1234..def5678 100644
--- a/lib/bundler/vendor/postit/lib/postit/installer.rb
+++ b/lib/bundler/vendor/postit/lib/postit/installer.rb
@@ -8,9 +8,9 @@ if Gem::Specification.respond_to?(:find_by_name)
!Gem::Specification.find_by_name('bundler', @bundler_version).nil?
else
- dep = Gem::Dependency.new('bundler', @bundler_version)
+ requirement = Gem::Requirement.new(@bundler_version)
Gem.source_index.gems.values.any? do |s|
- dep.match?(s.name, s.version)
+ s.name == 'bundler' && requirement.satisfied_by?(s.version)
end
end
rescue LoadError
@@ -19,7 +19,7 @@
def install!
return if installed?
- require "rubygems/dependency_installer"
+ require 'rubygems/dependency_installer'
installer = Gem::DependencyInstaller.new
installer.install('bundler', @bundler_version)
installer.installed_gems
| [PostIt] Update for support for RubyGems 1.3.6
|
diff --git a/lib/g5_authentication_client/auth_token_helper.rb b/lib/g5_authentication_client/auth_token_helper.rb
index abc1234..def5678 100644
--- a/lib/g5_authentication_client/auth_token_helper.rb
+++ b/lib/g5_authentication_client/auth_token_helper.rb
@@ -5,11 +5,11 @@ begin
response = yield cached_username_pw_access_token
rescue RestClient::ExceptionWithResponse => e
- if e.response.code.to_i == 401
- @cached_username_pw_access_token = nil
- response = yield cached_username_pw_access_token
- end
- response
+ response = e.response
+ end
+ if response.code.to_i == 401
+ @cached_username_pw_access_token = nil
+ response = yield cached_username_pw_access_token
end
end
| Refactor to include case where no exception raised
|
diff --git a/lib/gitlab/health_checks/simple_abstract_check.rb b/lib/gitlab/health_checks/simple_abstract_check.rb
index abc1234..def5678 100644
--- a/lib/gitlab/health_checks/simple_abstract_check.rb
+++ b/lib/gitlab/health_checks/simple_abstract_check.rb
@@ -15,14 +15,13 @@ end
def metrics
- with_timing method(:check) do |result, elapsed|
- Rails.logger.error("#{human_name} check returned unexpected result #{result}") unless is_successful?(result)
- [
- metric("#{metric_prefix}_timeout", result.is_a?(Timeout::Error) ? 1 : 0),
- metric("#{metric_prefix}_success", is_successful?(result) ? 1 : 0),
- metric("#{metric_prefix}_latency_seconds", elapsed)
- ]
- end
+ result, elapsed = with_timing(&method(:check))
+ Rails.logger.error("#{human_name} check returned unexpected result #{result}") unless is_successful?(result)
+ [
+ metric("#{metric_prefix}_timeout", result.is_a?(Timeout::Error) ? 1 : 0),
+ metric("#{metric_prefix}_success", is_successful?(result) ? 1 : 0),
+ metric("#{metric_prefix}_latency_seconds", elapsed)
+ ]
end
private
| Fix redis check with_timing method usage
|
diff --git a/SWXMLHash.podspec b/SWXMLHash.podspec
index abc1234..def5678 100644
--- a/SWXMLHash.podspec
+++ b/SWXMLHash.podspec
@@ -7,6 +7,7 @@ s.authors = { 'David Mohundro' => 'david@mohundro.com' }
s.requires_arc = true
+ s.pod_target_xcconfig = { 'SWIFT_VERSION' => '2.3' }
s.osx.deployment_target = '10.9'
s.ios.deployment_target = '8.0'
| Add `SWIFT_VERSION` xcconfig to podspec
|
diff --git a/lib/adapters.rb b/lib/adapters.rb
index abc1234..def5678 100644
--- a/lib/adapters.rb
+++ b/lib/adapters.rb
@@ -0,0 +1,43 @@+module ActiveRecord
+ module ConnectionAdapters
+ class AbstractAdapter
+ # By default, the SQL is used
+ def substr(string, from, count)
+ return "SUBSTR(#{string}, #{from.to_i}, #{from.to_i})"
+ end
+
+ def trim(string)
+ return "TRIM(#{string})"
+ end
+
+ def length(string)
+ return "LENGTH(#{string})"
+ end
+
+ def concatenate(*strings)
+ return strings.join("||")
+ end
+ end
+
+
+ class SQLServerAdapter
+ def substr(string, from, count)
+ return "SUBSTRING(#{string}, #{from.to_i}, #{from.to_i})"
+ end
+
+ def trim(string)
+ return "LTRIM(RTRIM(#{string}))"
+ end
+
+ def length(string)
+ return "LEN(#{string})"
+ end
+
+ def concatenate(*strings)
+ return strings.join("+")
+ end
+ end
+
+ end
+end
+
| Add missing file for migrations
git-svn-id: f16a2f23d171dee4464daf87d70b3f1ae0981068@1605 67a09383-3dfa-4221-8551-890bac9c277c
|
diff --git a/lib/cerberus/publisher/mail.rb b/lib/cerberus/publisher/mail.rb
index abc1234..def5678 100644
--- a/lib/cerberus/publisher/mail.rb
+++ b/lib/cerberus/publisher/mail.rb
@@ -1,6 +1,10 @@ require 'action_mailer'
require 'cerberus/publisher/base'
-require 'cerberus/publisher/netsmtp_tls_fix'
+
+if RUBY_VERSION > '1.8.2'
+ #This hack works only on 1.8.4
+ require 'cerberus/publisher/netsmtp_tls_fix'
+end
class Cerberus::Publisher::Mail < Cerberus::Publisher::Base
def self.publish(state, manager, options)
| Use TLS hack only on Ruby 1.8.4
git-svn-id: 6b26ca77393dff49db3326cae3426b51e4e94954@90 65aa75ef-ce15-0410-bc34-cdc86d5f77e6
|
diff --git a/recipes/repo_passenger.rb b/recipes/repo_passenger.rb
index abc1234..def5678 100644
--- a/recipes/repo_passenger.rb
+++ b/recipes/repo_passenger.rb
@@ -17,6 +17,7 @@
if platform_family?('debian')
include_recipe 'apt::default'
+ package 'ca-certificates'
apt_repository 'phusionpassenger' do
uri 'https://oss-binaries.phusionpassenger.com/apt/passenger'
| Install 'ca-certificates' packages with passenger
It's a dependency according to https://www.phusionpassenger.com/library/install/nginx/install/oss/jessie/#step-1:-install-passenger-packages |
diff --git a/core/lib/spree/testing_support/factories/address_factory.rb b/core/lib/spree/testing_support/factories/address_factory.rb
index abc1234..def5678 100644
--- a/core/lib/spree/testing_support/factories/address_factory.rb
+++ b/core/lib/spree/testing_support/factories/address_factory.rb
@@ -1,6 +1,5 @@ require 'spree/testing_support/factories/state_factory'
require 'spree/testing_support/factories/country_factory'
-require 'twitter_cldr'
FactoryGirl.define do
factory :address, class: Spree::Address do
@@ -16,7 +15,7 @@ address1 '10 Lovely Street'
address2 'Northwest'
city 'Herndon'
- zipcode { TwitterCldr::Shared::PostalCodes.for_territory(country_iso_code).sample.first }
+ zipcode { FFaker::AddressUS.zip_code }
phone '555-555-0199'
alternative_phone '555-555-0199'
| Use FFaker instead of Twitter CLDr in Address factory
In the address factory, we were using Twitter CLDR for generating
sample zip codes. We can just as well use FFaker, which conveniently
comes with an address faking module for different countries.
Our default address is in the USA, so we can use the FFaker::AddressUS
module.
|
diff --git a/lib/forematter/commands/add.rb b/lib/forematter/commands/add.rb
index abc1234..def5678 100644
--- a/lib/forematter/commands/add.rb
+++ b/lib/forematter/commands/add.rb
@@ -18,8 +18,8 @@ class Add < Forematter::CommandRunner
def run
files.each do |file|
- old = file[field].to_ruby || []
fail "#{field} is not an array" unless old.is_a?(Array)
+ old = file.key?(field) ? file[field].to_ruby : []
add = options[:'allow-dupes'] ? values : values.select { |v| !old.include?(v) }
next if add.empty?
add.each { |v| old << v }
| Fix to_ruby conversion on nil values
See #2 |
diff --git a/lib/healthy/a19/name_parser.rb b/lib/healthy/a19/name_parser.rb
index abc1234..def5678 100644
--- a/lib/healthy/a19/name_parser.rb
+++ b/lib/healthy/a19/name_parser.rb
@@ -29,10 +29,6 @@
private
- def source
- message.fetch('MSH').fetch('MSH.4').fetch('MSH.4.1')
- end
-
def names
names = {}
message.fetch('PID').fetch('PID.5').each do |record|
| Remove no longer needed source method
|
diff --git a/lib/jekyll-paginate_command.rb b/lib/jekyll-paginate_command.rb
index abc1234..def5678 100644
--- a/lib/jekyll-paginate_command.rb
+++ b/lib/jekyll-paginate_command.rb
@@ -5,9 +5,9 @@ module Jekyll
module PaginateCommand
DEFAULTS = {
- 'paginate_per_page' => 10,
+ 'paginate_per_page' => 10,
'paginate_relative_path' => '/page:num/',
- 'paginate_destination' => 'paginations'
+ 'paginate_destination' => File.join(Dir.pwd, 'paginations')
}
end
end
| Change the paginate_destination value to the absolute path
|
diff --git a/lib/kosmos/packages/toolbar.rb b/lib/kosmos/packages/toolbar.rb
index abc1234..def5678 100644
--- a/lib/kosmos/packages/toolbar.rb
+++ b/lib/kosmos/packages/toolbar.rb
@@ -1,9 +1,9 @@ class Toolbar < Kosmos::Package
title 'Toolbar Plugin'
aliases 'toolbar'
- url 'http://blizzy.de/toolbar/Toolbar-1.7.2.zip'
+ url 'http://blizzy.de/toolbar/Toolbar-1.7.3.zip'
def install
- merge_directory 'Toolbar-1.7.2/GameData'
+ merge_directory 'Toolbar-1.7.3/GameData'
end
end
| Update the package for Toolbar.
|
diff --git a/db/migrate/20130905204142_use_text_datatype_for_title_and_entry_id.rb b/db/migrate/20130905204142_use_text_datatype_for_title_and_entry_id.rb
index abc1234..def5678 100644
--- a/db/migrate/20130905204142_use_text_datatype_for_title_and_entry_id.rb
+++ b/db/migrate/20130905204142_use_text_datatype_for_title_and_entry_id.rb
@@ -0,0 +1,11 @@+class UseTextDatatypeForTitleAndEntryId < ActiveRecord::Migration
+ def up
+ change_column :stories, :title, :text
+ change_column :stories, :entry_id, :text
+ end
+
+ def self.down
+ change_column :stories, :title, :string
+ change_column :stories, :entry_id, :string
+ end
+end
| Use text datatype for title and entry_id
|
diff --git a/plugins/fb_app/lib/fb_app_plugin/link_renderer.rb b/plugins/fb_app/lib/fb_app_plugin/link_renderer.rb
index abc1234..def5678 100644
--- a/plugins/fb_app/lib/fb_app_plugin/link_renderer.rb
+++ b/plugins/fb_app/lib/fb_app_plugin/link_renderer.rb
@@ -1,5 +1,5 @@ # add target attribute to links
-class FbAppPlugin::LinkRenderer < WillPaginate::ViewHelpers::LinkRenderer
+class FbAppPlugin::LinkRenderer < WillPaginate::ActionView::LinkRenderer
def prepare collection, options, template
super
@@ -7,8 +7,8 @@
protected
- #def link text, target, attributes = {}
- #@template.link_to text, @template.url_for(target), attributes.merge(target: '')
- #end
+ def default_url_params
+ {target: ''}
+ end
end
| Move to another will_paginate class
|
diff --git a/lib/puppet_x/puppetlabs/aws.rb b/lib/puppet_x/puppetlabs/aws.rb
index abc1234..def5678 100644
--- a/lib/puppet_x/puppetlabs/aws.rb
+++ b/lib/puppet_x/puppetlabs/aws.rb
@@ -7,7 +7,7 @@ if ENV['AWS_REGION'] and not ENV['AWS_REGION'].empty?
[ENV['AWS_REGION']]
else
- ec2_client(region: default_region).describe_regions.data.regions.map(&:region_name)
+ ec2_client(default_region).describe_regions.data.regions.map(&:region_name)
end
end
| Fix incorrect parameters to ec2_client
- Code was initially refactored to support 1.9.3, by removing named
parameters (a Ruby 2 feature), in:
5a3c0b899c91f7080a12c8faf3d733fbe32e7915
That fix was incomplete and some additional related changes were
made to address default params and the Aws client initializers in:
95ed3e0d2536cf94fcfe17cc158e53ca27873bfb
Unfortunately, one line was missed that creates the ec2_client
instance. Instead of passing an expected string (previously done
via named argument), the code is now passing a hash where a String
is expected, and this was caught during acceptance tests.
|
diff --git a/spec/models/alternative_name_spec.rb b/spec/models/alternative_name_spec.rb
index abc1234..def5678 100644
--- a/spec/models/alternative_name_spec.rb
+++ b/spec/models/alternative_name_spec.rb
@@ -23,12 +23,8 @@ describe AlternativeName do
before(:each) do
@valid_attributes = {
- :name => "value for name",
+ :alternative_locality_id => 2,
:locality_id => 1,
- :short_name => "value for short_name",
- :qualifier_name => "value for qualifier_name",
- :qualifier_locality => "value for qualifier_locality",
- :qualifier_district => "value for qualifier_district",
:creation_datetime => Time.now,
:modification_datetime => Time.now,
:revision_number => "value for revision_number",
| Update spec for new data format.
|
diff --git a/app/controllers/user_sessions_controller.rb b/app/controllers/user_sessions_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/user_sessions_controller.rb
+++ b/app/controllers/user_sessions_controller.rb
@@ -1,6 +1,10 @@ class UserSessionsController < ApplicationController
def new
- @user = User.new
+ if current_user.present?
+ redirect_back_or_to root_path
+ else
+ @user = User.new
+ end
end
def create
@@ -9,7 +13,7 @@ if @user = login(params[:email], params[:password], params[:remember])
@item = find_next_item(@user)
- redirect_back_or_to item_url(@item, notice: 'Login successful')
+ redirect_back_or_to item_url(@item), notice: 'Login successful'
else
flash.now[:alert] = 'Login failed'
render action: 'new'
| Stop Already Login Users From Going Back To Login
Because this is a better user experience were the user should not be
able to go back to the login after they login.
|
diff --git a/app/helpers/snl_admin/application_helper.rb b/app/helpers/snl_admin/application_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/snl_admin/application_helper.rb
+++ b/app/helpers/snl_admin/application_helper.rb
@@ -1,6 +1,6 @@ module SnlAdmin
module ApplicationHelper
- def nav_link(resource, options={})
+ def nav_link(resource, options = {})
resource = resource.to_s
klass = resource.classify.safe_constantize
title = klass.model_name.plural.titleize if klass
@@ -8,8 +8,13 @@
name = options.delete(:name) || title
path_options = options.delete(:path_options) || {}
- path = options.delete(:path) || send("#{resource}_path", path_options) rescue '#not-implemented'
- matches_controller_name = controller_name == resource
+ path = options.delete(:path) ||
+ send("#{resource}_path", path_options) rescue '#not-implemented'
+ if (match_action = options.delete(:match_action))
+ matches_controller_name = action_name == match_action
+ else
+ matches_controller_name = controller_name == resource
+ end
matches_path_options = true
path_options.each do |key, value|
matches_path_options = params[key] == value
@@ -19,5 +24,25 @@ link_to(name, path, options)
end
end
+
+ def activity_with_subdomain_link(activity)
+ encyclopedia = Encyclopedia.with_id(activity.encyclopedia_id || 1)
+ main_app.view_url(activity.article_url,
+ subdomain: Subdomainer.for(encyclopedia.subdomain))
+ end
+
+ def article_with_subdomain_link(article)
+ main_app.view_url(article.permalink,
+ subdomain: Subdomainer.for(article.encyclopedia.subdomain))
+ end
+
+ def activity_partial_for(activity_key)
+ {
+ 'improvement.accept' => 'accepted',
+ 'improvement.accept_revised' => 'accepted',
+ 'article.accept' => 'accepted',
+ 'article.accept_revised' => 'accepted'
+ }[activity_key] || 'default'
+ end
end
end
| Add helper methods and upgrade nav links
|
diff --git a/lib/walmart_open/auth_token.rb b/lib/walmart_open/auth_token.rb
index abc1234..def5678 100644
--- a/lib/walmart_open/auth_token.rb
+++ b/lib/walmart_open/auth_token.rb
@@ -13,7 +13,8 @@ end
def expired?
- Time.now >= expiration_time
+ buffer = 30 # seconds
+ Time.now + buffer >= expiration_time
end
def authorization_header
| Add some buffer time to expiration
|
diff --git a/lib/nagiosplugin/plugin.rb b/lib/nagiosplugin/plugin.rb
index abc1234..def5678 100644
--- a/lib/nagiosplugin/plugin.rb
+++ b/lib/nagiosplugin/plugin.rb
@@ -6,38 +6,49 @@ :unknown => 3,
}
+ PluginError = Class.new(StandardError)
+
class Plugin
def self.check!
plugin = self.new
plugin.check
+ rescue Exception => e
+ puts [plugin.prefix, e.to_s].join(' ')
+ else
+ puts plugin.message
ensure
- puts plugin.message
exit plugin.code
end
def check
measure if respond_to?(:measure)
- @status = [:critical, :warning, :ok].select { |s| send("#{s}?") }.first
- raise "All status checks returned false!" if @status.nil?
- rescue => e
- @info_text = e.to_s
+ set_status
+ rescue Exception
+ @status = :unknown
raise
end
def message
- "#{service.upcase} #{status.upcase}: #{@info_text}"
+ [prefix, (output if respond_to?(:output))].compact.join(' ')
end
- def service
- self.class.name
+ def prefix
+ "#{self.class.name.upcase} #{status.upcase}:"
+ end
+
+ def code
+ EXIT_CODES[status]
end
def status
@status || :unknown
end
-
- def code
- EXIT_CODES[status]
+
+ protected
+
+ def set_status
+ @status = [:critical, :warning, :ok].select { |s| send("#{s}?") }.first
+ raise PluginError, "All status checks returned false!" if @status.nil?
end
def ok?
| Replace @info_text by optional output method
|
diff --git a/lib/migrator.rb b/lib/migrator.rb
index abc1234..def5678 100644
--- a/lib/migrator.rb
+++ b/lib/migrator.rb
@@ -7,7 +7,7 @@ end
def self.available_migrations
- Dir["#{migrations_path}/[0-9]*_*.rb"].sort_by { |name| name.scan(/\d+/).first.to_i }
+ Dir["#{migrations_path}/[0-9]*_*.rb"].sort
end
def self.needed_migrations(from)
| Fix a bug in the automated migration process. Under some undefined circumstances (reproduced on Debian wit Ruby ruby 1.9.2p136 but not on Mac OS 10.8 Ruby 1.9.3p194), administrator would be kicked out of the application because the sort_by{} would get confused where a sort is enough. Tested on both environments
|
diff --git a/lib/migrator.rb b/lib/migrator.rb
index abc1234..def5678 100644
--- a/lib/migrator.rb
+++ b/lib/migrator.rb
@@ -7,7 +7,7 @@ end
def self.available_migrations
- Dir["#{migrations_path}/[0-9]*_*.rb"].sort
+ Dir["#{migrations_path}/[1-9]*_*.rb"].sort_by { |name| name.scan(/\d+/).first.to_i }
end
def self.current_schema_version
| Fix admin/ migration problem with 0_initial_schema, from Eridius
git-svn-id: 70ab0960c3db1cbf656efd6df54a8f3de72dc710@607 820eb932-12ee-0310-9ca8-eeb645f39767
|
diff --git a/lib/sass/rails/template.rb b/lib/sass/rails/template.rb
index abc1234..def5678 100644
--- a/lib/sass/rails/template.rb
+++ b/lib/sass/rails/template.rb
@@ -41,7 +41,7 @@ }
}
- sass_config = context.environment.context_class.sass_config.merge(options)
+ sass_config = context.class.sass_config.merge(options)
engine = ::Sass::Engine.new(data, sass_config)
css = engine.render
| Access sass config from context class
|
diff --git a/config/environments/production.rb b/config/environments/production.rb
index abc1234..def5678 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -14,7 +14,7 @@ config.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
- config.assets.js_compressor = :uglifier
+ # config.assets.js_compressor = :uglifier
config.assets.compile = false
config.assets.digest = true
config.log_level = :info
| Stop Minification to fix JS issues
|
diff --git a/spec/lib/form_spec.rb b/spec/lib/form_spec.rb
index abc1234..def5678 100644
--- a/spec/lib/form_spec.rb
+++ b/spec/lib/form_spec.rb
@@ -8,9 +8,9 @@
let(:resource) { client.forms }
- include_examples 'list resource'
- include_examples 'find resource'
- include_examples 'create resource'
- include_examples 'update resource'
- include_examples 'delete resource'
+ include_examples 'lists resource'
+ include_examples 'finds resource'
+ include_examples 'creates resource'
+ include_examples 'updates resource'
+ include_examples 'deletes resource'
end
| Update example use in form spec
|
diff --git a/db/seeds.rb b/db/seeds.rb
index abc1234..def5678 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -1,5 +1,5 @@+Post.delete_all
User.delete_all
-Post.delete_all
users = JSON.parse(
File.open(Rails.root.join('spec', 'fixtures', 'users.json'), "r") { |f| f.read }
| Fix order of deletes for foreign key constrain problem
|
diff --git a/spec/helpers/application_helper/buttons/db_delete_sepc.rb b/spec/helpers/application_helper/buttons/db_delete_sepc.rb
index abc1234..def5678 100644
--- a/spec/helpers/application_helper/buttons/db_delete_sepc.rb
+++ b/spec/helpers/application_helper/buttons/db_delete_sepc.rb
@@ -0,0 +1,18 @@+describe ApplicationHelper::Button::DbDelete do
+ let(:view_context) { setup_view_context_with_sandbox({}) }
+ let(:dashboard) { FactoryGirl.create(:miq_widget_set, :read_only => read_only) }
+ let(:button) { described_class.new(view_context, {}, {'db' => dashboard}, {}) }
+
+ describe '#calculate_properties' do
+ before { button.calculate_properties }
+
+ context 'when dashboard is read-only' do
+ let(:read_only) { true }
+ it_behaves_like 'a disabled button', 'Default Dashboard cannot be deleted'
+ end
+ context 'when dashboard is writable' do
+ let(:read_only) { false }
+ it_behaves_like 'an enabled button'
+ end
+ end
+end
| Create spec examples for DbDelete button class
|
diff --git a/app/controllers/api/stateless/braintree/subscriptions_controller.rb b/app/controllers/api/stateless/braintree/subscriptions_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/api/stateless/braintree/subscriptions_controller.rb
+++ b/app/controllers/api/stateless/braintree/subscriptions_controller.rb
@@ -14,7 +14,7 @@ result = ::Braintree::Subscription.cancel(@subscription.subscription_id)
if result.success?
@subscription.destroy
- render json: { success: true }
+ render json: @subscription.slice(:id, :subscription_id)
else
render json: { success: false, errors: result.errors }
end
| Return ID and subcription id
|
diff --git a/server.rb b/server.rb
index abc1234..def5678 100644
--- a/server.rb
+++ b/server.rb
@@ -1,15 +1,21 @@+require "blurrily/map"
require "json"
require "sinatra"
PRACTICES = JSON.parse(File.read("data/general-medical-practices.json"))
+
+SEARCH_INDEX = Blurrily::Map.new
+PRACTICES.each.with_index do |practice, index|
+ SEARCH_INDEX.put(practice.fetch("name"), index)
+end
def all_practices
PRACTICES
end
def practices_matching(search_term)
- all_practices.select { |practice|
- practice.fetch("name").downcase.include?(search_term)
+ SEARCH_INDEX.find(search_term).map { |index, _, _|
+ PRACTICES.fetch(index)
}
end
| Use fuzzy search for finding practices
This means if you search for "neeman" you can also find "Neaman", and if
you search for "lake side" you can also find "Lakeside".
It still only searches against practice name.
|
diff --git a/server.rb b/server.rb
index abc1234..def5678 100644
--- a/server.rb
+++ b/server.rb
@@ -1,9 +1,9 @@ require 'socket';
s = TCPServer.new(80);
loop {
- Thread.start(s.accept) { |c|
- c.gets "\n\r";
- c.puts "HTTP/1.1 410 Gone";
- c.close;
- }
-}+ Thread.start(s.accept) { |c|
+ c.gets "\n\r";
+ c.puts "HTTP/1.1 410 Gone";
+ c.close;
+ }
+}
| Use tabs instead of spaces
|
diff --git a/app/models/budget/result.rb b/app/models/budget/result.rb
index abc1234..def5678 100644
--- a/app/models/budget/result.rb
+++ b/app/models/budget/result.rb
@@ -10,7 +10,7 @@
def calculate_winners
reset_winners
- investments.each do |investment|
+ investments.compatible.each do |investment|
@current_investment = investment
set_winner if inside_budget?
end
| Use compatible filter when calculating budget heading winners
|
diff --git a/lib/asciidoctor/doctest.rb b/lib/asciidoctor/doctest.rb
index abc1234..def5678 100644
--- a/lib/asciidoctor/doctest.rb
+++ b/lib/asciidoctor/doctest.rb
@@ -3,16 +3,13 @@ module Asciidoctor
module DocTest
- BUILTIN_EXAMPLES_PATH = Pathname.new(
+ @examples_path = Pathname.new(
'../../data/examples/asciidoc').expand_path(__dir__).to_s.freeze
- @examples_path = [ BUILTIN_EXAMPLES_PATH ]
-
- class << self
- # @return [Array<String>] paths of the directories where to look for the
- # examples suites. Use +unshift+ to add your paths before the built-in
- # reference input examples (default: +["{asciidoctor-doctest}/data/examples/asciidoc"]+).
- attr_accessor :examples_path
+ # @return [Array<String>] paths of the built-in input examples. It always
+ # returns a new array.
+ def self.examples_path
+ [ @examples_path ]
end
end
end
| Change DocTest.examples_path to be read-only
|
diff --git a/test/unit/mailbox/routing_test.rb b/test/unit/mailbox/routing_test.rb
index abc1234..def5678 100644
--- a/test/unit/mailbox/routing_test.rb
+++ b/test/unit/mailbox/routing_test.rb
@@ -20,4 +20,11 @@ ApplicationMailbox.route @inbound_email
assert_equal "Discussion: Let's debate these attachments", $processed
end
+
+ test "delayed routing" do
+ perform_enqueued_jobs only: ActionMailroom::DeliverInboundEmailToMailroomJob do
+ another_inbound_email = create_inbound_email("welcome.eml", status: :pending)
+ assert_equal "Discussion: Let's debate these attachments", $processed
+ end
+ end
end
| Test routing runs through a job kicked off by the inbound email
|
diff --git a/db/migrate/20160322165836_add_not_null_constraint_to_layers_kind.rb b/db/migrate/20160322165836_add_not_null_constraint_to_layers_kind.rb
index abc1234..def5678 100644
--- a/db/migrate/20160322165836_add_not_null_constraint_to_layers_kind.rb
+++ b/db/migrate/20160322165836_add_not_null_constraint_to_layers_kind.rb
@@ -0,0 +1,13 @@+Sequel.migration do
+ up do
+ alter_table :layers do
+ set_column_not_null(:kind)
+ end
+ end
+
+ down do
+ alter_table :layers do
+ set_column_allow_null(:kind)
+ end
+ end
+end
| Add migration to add not null to layers.kind
|
diff --git a/lib/cms/engine.rb b/lib/cms/engine.rb
index abc1234..def5678 100644
--- a/lib/cms/engine.rb
+++ b/lib/cms/engine.rb
@@ -1,5 +1,9 @@ module Cms
class Engine < ::Rails::Engine
isolate_namespace Cms
+
+ ActionDispatch::Reloader.to_prepare do
+ require_dependency Cms::Engine.root.join('app/controllers/cms/resources_controller.rb')
+ end
end
end
| Add resources controller to ActionDispatch::Reloader
|
diff --git a/hark.gemspec b/hark.gemspec
index abc1234..def5678 100644
--- a/hark.gemspec
+++ b/hark.gemspec
@@ -4,7 +4,7 @@ require 'hark/version'
Gem::Specification.new do |spec|
- spec.name = "ianwhite-hark"
+ spec.name = "heed"
spec.version = Hark::VERSION
spec.authors = ["Ian White"]
spec.email = ["ian.w.white@gmail.com"]
| Change gem name to 'heed'
|
diff --git a/faye-rails.gemspec b/faye-rails.gemspec
index abc1234..def5678 100644
--- a/faye-rails.gemspec
+++ b/faye-rails.gemspec
@@ -18,6 +18,7 @@ s.add_development_dependency "rspec"
s.add_development_dependency "rspec-rails"
s.add_development_dependency "database_cleaner"
+ s.add_development_dependency "thin"
s.files = %w(README.md) + Dir["lib/**/*", "vendor/**/*"]
| Add thin as a development dependency.
|
diff --git a/spec/acceptance/basic_trove_spec.rb b/spec/acceptance/basic_trove_spec.rb
index abc1234..def5678 100644
--- a/spec/acceptance/basic_trove_spec.rb
+++ b/spec/acceptance/basic_trove_spec.rb
@@ -11,52 +11,7 @@ include ::openstack_integration::rabbitmq
include ::openstack_integration::mysql
include ::openstack_integration::keystone
-
- rabbitmq_user { 'trove':
- admin => true,
- password => 'an_even_bigger_secret',
- provider => 'rabbitmqctl',
- require => Class['rabbitmq'],
- }
-
- rabbitmq_user_permissions { 'trove@/':
- configure_permission => '.*',
- write_permission => '.*',
- read_permission => '.*',
- provider => 'rabbitmqctl',
- require => Class['rabbitmq'],
- }
-
- # Trove resources
- class { '::trove':
- database_connection => 'mysql+pymysql://trove:a_big_secret@127.0.0.1/trove?charset=utf8',
- default_transport_url => 'rabbit://trove:an_even_bigger_secret@127.0.0.1:5672/',
- nova_proxy_admin_pass => 'a_big_secret',
- }
- class { '::trove::db::mysql':
- password => 'a_big_secret',
- }
- class { '::trove::keystone::auth':
- password => 'a_big_secret',
- }
- class { '::trove::keystone::authtoken':
- password => 'a_big_secret',
- }
- class { '::trove::api':
- debug => true,
- }
- class { '::trove::client': }
- class { '::trove::conductor':
- debug => true,
- }
- if ($::operatingsystem == 'Ubuntu') and (versioncmp($::operatingsystemmajrelease, '16') >= 0) {
- warning('trove::taskmanager is disabled now, not working correctly on Xenial.')
- } else {
- class { '::trove::taskmanager':
- debug => true,
- }
- }
- class { '::trove::quota': }
+ include ::openstack_integration::trove
EOS
| Switch acceptance test to use integration classes
Change-Id: I92d8f7657c9ff097f7f23244c7452478621199ee
|
diff --git a/lib/fuci/rspec.rb b/lib/fuci/rspec.rb
index abc1234..def5678 100644
--- a/lib/fuci/rspec.rb
+++ b/lib/fuci/rspec.rb
@@ -2,6 +2,7 @@ class RSpec < Fuci::Tester
FAILURE_INDICATOR = 'Failed examples:'
BASE_COMMAND = 'rspec'
+ FAIL_FILE_CAPTURE = /rspec (.*) #/
def indicates_failure? log
log.include? FAILURE_INDICATOR
@@ -18,7 +19,7 @@ end
def failures log
- log.scan(/rspec (.*) #/).join ' '
+ log.scan(FAIL_FILE_CAPTURE).join ' '
end
end
end
| Put fail file capture regex to constant
|
diff --git a/spec/factories/oauth_application.rb b/spec/factories/oauth_application.rb
index abc1234..def5678 100644
--- a/spec/factories/oauth_application.rb
+++ b/spec/factories/oauth_application.rb
@@ -7,6 +7,6 @@ sequence(:secret) { |n| "secret#{n}" }
redirect_uri "https://example.com"
scopes "read write"
- association :owner, factory: :user
+ association :owner, factory: :registered_user
end
end
| Create setting when oauth application has been created on factory
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.