diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/lib/github_api/validations.rb b/lib/github_api/validations.rb
index abc1234..def5678 100644
--- a/lib/github_api/validations.rb
+++ b/lib/github_api/validations.rb
@@ -18,6 +18,7 @@ VALID_API_KEYS = [
'page',
'per_page',
+ 'auto_pagination',
'jsonp_callback'
]
|
Allow auto pagination through params filter.
|
diff --git a/lib/figurine/collaborator.rb b/lib/figurine/collaborator.rb
index abc1234..def5678 100644
--- a/lib/figurine/collaborator.rb
+++ b/lib/figurine/collaborator.rb
@@ -14,11 +14,11 @@ attributes = attributes.slice(*whitelist) unless whitelist.empty?
@attributes = (given[:id] ? attributes.merge!(:id => given[:id]) : attributes)
@attributes.each do |name, val|
- self.class.define_method name do
+ self.class.send(:define_method, name) do
attributes[name]
end
- self.class.define_method "#{name}=" do |val|
+ self.class.send(:define_method, "#{name}=") do |val|
attributes[name] = val
end
end
|
Use send to call define_method
|
diff --git a/lib/modules/autocompletion.rb b/lib/modules/autocompletion.rb
index abc1234..def5678 100644
--- a/lib/modules/autocompletion.rb
+++ b/lib/modules/autocompletion.rb
@@ -1,34 +1,29 @@ module Autocompletion
- AUTOCOMPLETION_KEY = "autocompletion"
+ AUTOCOMPLETION_KEY = "autocompletion".freeze
+ IDENTIFIER_FIELDS = {
+ 'protected_area' => :wdpa_id,
+ 'country' => :iso_3
+ }.freeze
- def self.lookup term
- limit = {limit: [0, 5]}
+ def self.lookup(term, search_index=Search::PA_INDEX)
+ search = Search.search(term.downcase, {}, search_index)
- $redis.zrangebylex(AUTOCOMPLETION_KEY, "(#{term.downcase}", "+", limit).map do |result|
- result = result.split("||")
+ results = search.results.objects.values.compact.flatten
- term = result[0]
- name = result[1]
- type = result[2]
- identifier = result[3]
+ results.map do |result|
+ name = result.name
+ type = result.class.name.underscore
+ identifier = result.send(identifier_field(type))
- url = type == 'protected_area' ? "/#{identifier}" : "/country/#{identifier}"
+ url = type == 'country' ? "/country/#{identifier}" : "/#{identifier}"
{ title: name, url: url }
end
end
- def self.populate
- ProtectedArea.pluck(:name, :wdpa_id).each do |name, wdpa_id|
- $redis.zadd(AUTOCOMPLETION_KEY, 0, "#{name.downcase}||#{name}||protected_area||#{wdpa_id}")
- end
+ private
- Country.pluck(:name, :iso).each do |name, iso|
- $redis.zadd(AUTOCOMPLETION_KEY, 0, "#{name.downcase}||#{name}||country||#{iso}")
- end
- end
-
- def self.drop
- $redis.del(AUTOCOMPLETION_KEY)
+ def self.identifier_field(type)
+ IDENTIFIER_FIELDS[type] || :id
end
end
|
Refactor autocomplete to use ElasticSearch and without limit
|
diff --git a/lib/perspectives/responder.rb b/lib/perspectives/responder.rb
index abc1234..def5678 100644
--- a/lib/perspectives/responder.rb
+++ b/lib/perspectives/responder.rb
@@ -1,13 +1,13 @@ module Perspectives
class Responder < ActionController::Responder
def to_html
- return super unless resource.is_a?(Perspectives::Base)
+ return super unless controller.__send__(:perspectives_enabled_action?)
render text: resource.to_html, layout: :default
end
def to_json
- return super unless resource.is_a?(Perspectives::Base)
+ return super unless controller.__send__(:perspectives_enabled_action?)
render json: resource
end
|
Use perspectives_enabled_action? instead of type check
|
diff --git a/lib/nylas/current_account.rb b/lib/nylas/current_account.rb
index abc1234..def5678 100644
--- a/lib/nylas/current_account.rb
+++ b/lib/nylas/current_account.rb
@@ -16,5 +16,6 @@ attribute :organization_unit, :string
attribute :provider, :string
attribute :sync_state, :string
+ attribute :linked_at, :unix_timestamp
end
end
|
Add new `linked_at` field to CurrentAccount
|
diff --git a/lib/tty/prompt/reader/mode.rb b/lib/tty/prompt/reader/mode.rb
index abc1234..def5678 100644
--- a/lib/tty/prompt/reader/mode.rb
+++ b/lib/tty/prompt/reader/mode.rb
@@ -19,7 +19,7 @@ #
# @api public
def echo(is_on = true, &block)
- if is_on
+ if is_on || @input.tty?
yield
else
@input.noecho(&block)
@@ -32,7 +32,7 @@ #
# @api public
def raw(is_on = true, &block)
- if is_on
+ if is_on && !@input.tty?
@input.raw(&block)
else
yield
|
Change to check if tty is available.
|
diff --git a/lib/volt/extra_core/object.rb b/lib/volt/extra_core/object.rb
index abc1234..def5678 100644
--- a/lib/volt/extra_core/object.rb
+++ b/lib/volt/extra_core/object.rb
@@ -1,3 +1,5 @@+require 'volt/utils/ejson'
+
class Object
# Setup a default pretty_inspect
# alias_method :pretty_inspect, :inspect
@@ -13,7 +15,7 @@ # TODO: Need a real implementation of this
def deep_clone
if RUBY_PLATFORM == 'opal'
- JSON.parse(to_json)
+ Volt::EJSON.parse(Volt::EJSON.stringify(self))
else
Marshal.load(Marshal.dump(self))
end
|
Support dates in deep_clone (to fix query issue)
|
diff --git a/doc/ex/watermark.rb b/doc/ex/watermark.rb
index abc1234..def5678 100644
--- a/doc/ex/watermark.rb
+++ b/doc/ex/watermark.rb
@@ -7,19 +7,15 @@ # Make a watermark from the word "RMagick"
mark = Magick::Image.new(140, 40) {self.background_color = "none"}
gc = Magick::Draw.new
-if RUBY_PLATFORM =~ /mswin32/
- offset = -5
-else
- offset = -35
-end
-gc.annotate(mark, 0, 0, 0, offset, "RMagick") do
+
+gc.annotate(mark, 0, 0, 0, -5, "RMagick") do
gc.gravity = Magick::CenterGravity
gc.pointsize = 32
- if RUBY_PLATFORM =~ /mswin32/
- gc.font_family = "Georgia"
- else
- gc.font_family = "Times"
- end
+ if RUBY_PLATFORM =~ /mswin32/
+ gc.font_family = "Georgia"
+ else
+ gc.font_family = "Times"
+ end
gc.fill = "white"
gc.stroke = "none"
end
|
Use same offset for both *nix an Win32.
|
diff --git a/lib/ruboty/handlers/snack.rb b/lib/ruboty/handlers/snack.rb
index abc1234..def5678 100644
--- a/lib/ruboty/handlers/snack.rb
+++ b/lib/ruboty/handlers/snack.rb
@@ -19,7 +19,7 @@ on(
/お腹すいた\z/i,
name: "feed_snack",
- description: "おやつくれます"
+ description: "Gives you some snacks"
)
def feed_snack(message)
|
:pencil2: Fix description for a handler
|
diff --git a/lib/custodian/samplers/darwin/ram.rb b/lib/custodian/samplers/darwin/ram.rb
index abc1234..def5678 100644
--- a/lib/custodian/samplers/darwin/ram.rb
+++ b/lib/custodian/samplers/darwin/ram.rb
@@ -0,0 +1,29 @@+module Custodian
+ module Samplers
+
+ class RAM < Custodian::Samplers::Sampler
+ describe "RAM usage"
+
+ def sample
+ vmstat = `vm_stat`
+
+ pages_free = vmstat[/Pages free: +([0-9]+)/, 1].to_i + vmstat[/Pages speculative: +([0-9]+)/, 1].to_i
+ pages_inactive = vmstat[/Pages inactive: +([0-9]+)/, 1].to_i
+ pages_active = vmstat[/Pages active: +([0-9]+)/, 1].to_i
+ pages_wired = vmstat[/Pages wired down: +([0-9]+)/, 1].to_i
+ page_ins = vmstat[/Pageins: +([0-9]+)/, 1].to_i
+ page_outs = vmstat[/Pageouts: +([0-9]+)/, 1].to_i
+
+ {
+ "Free" => "#{pages_free * 4096 / 1024 / 1024} MB",
+ "Inactive" => "#{pages_inactive * 4096 / 1024 / 1024} MB",
+ "Active" => "#{pages_active * 4096 / 1024 / 1024} MB",
+ "Wired" => "#{pages_wired * 4096 / 1024 / 1024} MB",
+ "Page ins" => "#{page_ins * 4096 / 1024 / 1024} MB",
+ "Page outs" => "#{page_outs * 4096 / 1024 / 1024} MB"
+ }
+ end
+ end
+
+ end
+end
|
Implement RAM sampler for darwin
|
diff --git a/lib/formalist/form/validity_check.rb b/lib/formalist/form/validity_check.rb
index abc1234..def5678 100644
--- a/lib/formalist/form/validity_check.rb
+++ b/lib/formalist/form/validity_check.rb
@@ -41,7 +41,9 @@ def visit_many(node)
_name, _type, errors, _attributes, _child_template, children = node
- errors.empty? && children.map { |child| visit(child) }.all?
+ # The `children`` parameter for `many` elements is for some reason
+ # doubly nested right now, so we need to flatten it.
+ errors.empty? && children.flatten(1).map { |child| visit(child) }.all?
end
def visit_section(node)
|
Fix issue with validity check and `many` elements
|
diff --git a/lib/less/rails/semantic_ui/engine.rb b/lib/less/rails/semantic_ui/engine.rb
index abc1234..def5678 100644
--- a/lib/less/rails/semantic_ui/engine.rb
+++ b/lib/less/rails/semantic_ui/engine.rb
@@ -9,7 +9,7 @@ %w(stylesheets javascripts fonts images).each do |sub|
app.config.assets.paths << root.join('assets', sub).to_s
end
- app.config.assets.precompile << %r(semantic_ui/themes/.*\.(?:eot|svg|ttf|woff|png)$)
+ app.config.assets.precompile << %r(semantic_ui/themes/.*\.(?:eot|svg|ttf|woff|png|gif)$)
end
end
|
Add gif extension to precompile
|
diff --git a/app/controllers/georgia/concerns/revisioning.rb b/app/controllers/georgia/concerns/revisioning.rb
index abc1234..def5678 100644
--- a/app/controllers/georgia/concerns/revisioning.rb
+++ b/app/controllers/georgia/concerns/revisioning.rb
@@ -7,8 +7,6 @@ include Helpers
included do
-
- before_filter :prepare_revision, only: [:review, :approve, :decline, :revert]
def review
@revision.review
@@ -39,11 +37,6 @@
private
- def prepare_revision
- @page = Georgia::Page.find(params[:page_id])
- @revision = Georgia::Revision.find(params[:id])
- end
-
def notify(message)
Notifier.notify_editors(message, url_for(action: :edit, controller: controller_name, id: @page.id)).deliver
end
|
Fix double instantiation of @page and @revision
|
diff --git a/test/data_mapper/schema_test.rb b/test/data_mapper/schema_test.rb
index abc1234..def5678 100644
--- a/test/data_mapper/schema_test.rb
+++ b/test/data_mapper/schema_test.rb
@@ -0,0 +1,13 @@+require 'test_helper'
+
+class DataMapperSchemaTest < ActiveSupport::TestCase
+ test 'required explicitly set to false' do
+ DataMapper::Property.required(true)
+ model = Class.new(User)
+ model.apply_devise_schema :required_string, String, :required => true
+ model.apply_devise_schema :not_required_string, String
+ assert model.properties['required_string'].required?
+ assert !model.properties['not_required_string'].required?
+ DataMapper::Property.required(false)
+ end
+end
|
Add test for explicitly setting required option to false in apply_schema
Not sure if this is the best way to test it, but seems to work.
|
diff --git a/app/jobs/welcome_email_job.rb b/app/jobs/welcome_email_job.rb
index abc1234..def5678 100644
--- a/app/jobs/welcome_email_job.rb
+++ b/app/jobs/welcome_email_job.rb
@@ -2,7 +2,7 @@ queue_as :mailer
def perform(user_id)
- user = User.find(user_id)
- UserMailer.welcome_email(user).deliver_now
+ user = User.find_by(user_id)
+ UserMailer.welcome_email(user).deliver_now if user
end
end
|
Make minor fixes in WelcomeEmailJob
|
diff --git a/app/models/services/tumblr.rb b/app/models/services/tumblr.rb
index abc1234..def5678 100644
--- a/app/models/services/tumblr.rb
+++ b/app/models/services/tumblr.rb
@@ -1,4 +1,5 @@ class Services::Tumblr < Service
+ include Rails.application.routes.url_helpers
include SocialHelper::TumblrMethods
def provider
|
Fix `Services::Tumblr` not being able to post
|
diff --git a/app/models/wisdom/question.rb b/app/models/wisdom/question.rb
index abc1234..def5678 100644
--- a/app/models/wisdom/question.rb
+++ b/app/models/wisdom/question.rb
@@ -8,9 +8,5 @@
validates :text, :presence => true
validates :title, :presence => true
- before_save do
- self.slug = slug.downcase.parameterize
- end
-
end
end
|
Fix broken model, Question slug is not a thing.
|
diff --git a/lib/pakyow/app/routes/file_routes.rb b/lib/pakyow/app/routes/file_routes.rb
index abc1234..def5678 100644
--- a/lib/pakyow/app/routes/file_routes.rb
+++ b/lib/pakyow/app/routes/file_routes.rb
@@ -32,6 +32,11 @@ data = Pakyow::Console::FileStore.instance.data(params[:file_id], request_context: self)
end
+ if config.env == :production
+ res.headers['Cache-Control'] = 'public, max-age=31536000'
+ res.headers['Vary'] = 'Accept-Encoding'
+ end
+
send(data, Rack::Mime.mime_type(file[:ext]))
else
handle 404
|
Set cache headers in production
|
diff --git a/lib/travis/nightly_builder/runner.rb b/lib/travis/nightly_builder/runner.rb
index abc1234..def5678 100644
--- a/lib/travis/nightly_builder/runner.rb
+++ b/lib/travis/nightly_builder/runner.rb
@@ -22,7 +22,9 @@ "#{Time.now.utc.strftime('%Y-%m-%d-%H-%M-%S')}"
config = {}
- unless env.empty?
+ if env.empty?
+ message = format(message, nil)
+ else
config = {
'env' => {
'global' => env
@@ -30,8 +32,6 @@ }
message = format(message, "; (#{env})")
- else
- message = format(message, nil)
end
conn.post do |req|
|
Address a rubocop gripe for unless
|
diff --git a/lib/warden/jwt_auth/token_decoder.rb b/lib/warden/jwt_auth/token_decoder.rb
index abc1234..def5678 100644
--- a/lib/warden/jwt_auth/token_decoder.rb
+++ b/lib/warden/jwt_auth/token_decoder.rb
@@ -7,6 +7,9 @@ include JWTAuth::Import['secret']
# Decodes the payload from a JWT as a hash
+ #
+ # @see JWT.decode for all the exceptions than can be raised when given
+ # token is invalid
#
# @param token [String] a JWT
# @return [Hash] payload decoded from the JWT
|
Add a note about exceptions that can be raised when decoding
|
diff --git a/lib/skynet/splitter.rb b/lib/skynet/splitter.rb
index abc1234..def5678 100644
--- a/lib/skynet/splitter.rb
+++ b/lib/skynet/splitter.rb
@@ -4,10 +4,10 @@ module Splitter
def self.clean(path_info)
path_info_string = path_info.to_s
-
raise SkynetMethodError unless path_info_string.include?("_")
- path_info_string.split("_")
+ path_array = path_info_string.split("_")
+ [path_array[0], path_array[1..-1].join]
end
end
end
|
Add patch for mutli-word routes
|
diff --git a/lib/solid/arguments.rb b/lib/solid/arguments.rb
index abc1234..def5678 100644
--- a/lib/solid/arguments.rb
+++ b/lib/solid/arguments.rb
@@ -28,8 +28,8 @@
# Context var
var, *methods = arg.split('.')
- object = Solid.unproxify(context[var])
- return methods.inject(object) { |obj, method| obj.public_send(method) }
+ object = context[var]
+ return Solid.unproxify(methods.inject(object) { |obj, method| obj.public_send(method) })
end
def parse(context)
|
Fix unproxify only the result of context var attributes access
|
diff --git a/lib/tasks/webpack.rake b/lib/tasks/webpack.rake
index abc1234..def5678 100644
--- a/lib/tasks/webpack.rake
+++ b/lib/tasks/webpack.rake
@@ -6,6 +6,6 @@ webpack_bin = Rails.root.join("node_modules", ".bin", "webpack")
FileUtils.mkdir_p destdir
- system "#{webpack_bin} --json > #{destdir}/manifest.json"
+ sh "#{webpack_bin} --json > #{destdir}/manifest.json"
end
end
|
Use sh, not system, in rake task so it dies if it fails
|
diff --git a/test/bonk_test.rb b/test/bonk_test.rb
index abc1234..def5678 100644
--- a/test/bonk_test.rb
+++ b/test/bonk_test.rb
@@ -18,5 +18,16 @@
assert_equal @object, temp_obj
end
+
+ def test_bonk_returns_the_value_of_the_block
+ assert_equal :funky_monkey, @object.bonk{ :funky_monkey }
+ end
+
+ def test_bonk_does_replace_its_callee
+ obj_id = @object.object_id
+ @object.bonk{ |o| o = :a_funkier_monkey_than_ever }
+
+ assert_equal obj_id, @object.object_id
+ end
end
|
Define bonk semantics completely via tests.
|
diff --git a/test/gcloud/pubsub/subscription/test_delete.rb b/test/gcloud/pubsub/subscription/test_delete.rb
index abc1234..def5678 100644
--- a/test/gcloud/pubsub/subscription/test_delete.rb
+++ b/test/gcloud/pubsub/subscription/test_delete.rb
@@ -0,0 +1,66 @@+# Copyright 2015 Google Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+require "helper"
+
+describe Gcloud::Pubsub::Subscription, :delete, :mock_pubsub do
+ let(:topic_name) { "topic-name-goes-here" }
+ let(:sub_name) { "subscription-name-goes-here" }
+ let(:sub_json) { subscription_json topic_name, sub_name }
+ let(:sub_hash) { JSON.parse sub_json }
+ let :subscription do
+ Gcloud::Pubsub::Subscription.from_gapi sub_hash, pubsub.connection
+ end
+
+ it "can delete itself" do
+ mock_connection.delete "/v1beta2/projects/#{project}/subscriptions/#{sub_name}" do |env|
+ [200, {"Content-Type"=>"application/json"}, ""]
+ end
+
+ subscription.delete
+ end
+
+ describe "lazy subscription object of a subscription that does exist" do
+ let :subscription do
+ Gcloud::Pubsub::Subscription.new_lazy sub_name,
+ pubsub.connection
+ end
+
+ it "can delete itself" do
+ mock_connection.delete "/v1beta2/projects/#{project}/subscriptions/#{sub_name}" do |env|
+ [200, {"Content-Type"=>"application/json"}, ""]
+ end
+
+ subscription.delete
+ end
+ end
+
+ describe "lazy subscription object of a subscription that does not exist" do
+ let :subscription do
+ Gcloud::Pubsub::Subscription.new_lazy sub_name,
+ pubsub.connection
+ end
+
+ it "raises NotFoundError when deleting itself" do
+ mock_connection.delete "/v1beta2/projects/#{project}/subscriptions/#{sub_name}" do |env|
+ [404, {"Content-Type"=>"application/json"},
+ not_found_error_json(sub_name)]
+ end
+
+ expect do
+ subscription.delete
+ end.must_raise Gcloud::Pubsub::NotFoundError
+ end
+ end
+end
|
Add test coverage for lazy Subscription delete
|
diff --git a/test/integration/engine_test.rb b/test/integration/engine_test.rb
index abc1234..def5678 100644
--- a/test/integration/engine_test.rb
+++ b/test/integration/engine_test.rb
@@ -6,10 +6,9 @@ include RouteTranslator::ConfigurationHelper
def test_with_engine_inside_localized_block
- skip 'Regression with Rails 5.1.3. See #172'
get '/engine_es'
assert_response :success
- assert_equal '/blorgh/posts', response.body
+ assert_equal '/es/blorgh/posts', response.body
end
def test_with_engine_outside_localized_block
|
Change test as per Rails 5.1.3 change
We are going to assume that Rails is providing the correct behaviour
for this use case, so we change the test accordingly to make it pass.
Ref: ccfa785535d912c3529b0562d9f2e7a2dc4b7ed7@ff7f4a7 rails/rails#29662
Close: #172
|
diff --git a/Casks/phpstorm-eap.rb b/Casks/phpstorm-eap.rb
index abc1234..def5678 100644
--- a/Casks/phpstorm-eap.rb
+++ b/Casks/phpstorm-eap.rb
@@ -2,19 +2,28 @@ version '141.1717'
sha256 'af6087323b15205d10ede18e4aea176c6dab569adc47d0eb00d4de07ad88693d'
- url "http://download.jetbrains.com/webide/PhpStorm-EAP-#{version}.dmg"
- homepage 'http://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Early+Access+Program'
+ url "https://download.jetbrains.com/webide/PhpStorm-EAP-#{version}.dmg"
+ name 'PhpStorm EAP'
+ homepage 'https://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Early+Access+Program'
license :commercial
app 'PhpStorm EAP.app'
- postflight do
- plist_set(':JVMOptions:JVMVersion', '1.6+')
- end
+ zap :delete => [
+ '~/Library/Application Support/WebIde90',
+ '~/Library/Caches/WebIde90',
+ '~/Library/Logs/WebIde90',
+ '~/Library/Preferences/WebIde90',
+ '~/Library/Preferences/com.jetbrains.PhpStorm-EAP.plist',
+ '~/.WebIde90',
+ ]
- zap :delete => [
- '~/Library/Application Support/WebIde80',
- '~/Library/Preferences/WebIde80',
- '~/Library/Preferences/com.jetbrains.PhpStorm-EAP.plist',
- ]
+ caveats <<-EOS.undent
+ #{token} requires Java 6 like any other IntelliJ-based IDE.
+ You can install it with
+ brew cask install caskroom/homebrew-versions/java6
+ The vendor (JetBrains) doesn't support newer versions of Java (yet)
+ due to several critical issues, see details at
+ https://intellij-support.jetbrains.com/entries/27854363
+ EOS
end
|
Upgrade PhpStorm EAP to 141.1717
Upgrade PhpStorm EAP to 141.1717 - feedback from @sebroeder & @vitorgalvao
|
diff --git a/lib/vagrant-butcher.rb b/lib/vagrant-butcher.rb
index abc1234..def5678 100644
--- a/lib/vagrant-butcher.rb
+++ b/lib/vagrant-butcher.rb
@@ -11,14 +11,12 @@ begin
require "hashie"
require "hashie/logger"
- # Based on Hashie's recommendation to disable warnings:
- # https://github.com/intridea/hashie#how-does-mash-handle-conflicts-with-pre-existing-methods
- class Response < Hashie::Mash
- disable_warnings
- end
- # Alternatively, completely silence the logger as done in Berkshelf:
- # https://github.com/berkshelf/berkshelf/pull/1668/files
- # Hashie.logger = Logger.new(nil)
+ # We cannot `disable_warnings` in a subclass because
+ # Hashie::Mash is used directly in the Ridley dependency:
+ # https://github.com/berkshelf/ridley/search?q=Hashie&unscoped_q=Hashie
+ # Therefore, we completely silence the Hashie logger as done in Berkshelf:
+ # https://github.com/berkshelf/berkshelf/pull/1668/files#diff-3eca4e8b32b88ae6a1f14498e3ef7b25R5
+ Hashie.logger = Logger.new(nil)
rescue LoadError
# intentionally left blank
end
|
Fix logger spam by silencing the Hashie logger
We cannot `disable_warnings` in a subclass because
Hashie::Mash is used directly in the Ridley dependency:
https://github.com/berkshelf/ridley/search?q=Hashie&unscoped_q=Hashie
Hashie's recommendation to disable warnings requires subclassing:
https://github.com/intridea/hashie#how-does-mash-handle-conflicts-with-pre-existing-methods
and `disable_warnings` of `Hashie::Mash` is not supported:
https://github.com/intridea/hashie/pull/395/files#diff-167a475bc5a73269819928a9da362073R77
```ruby
class MyResponseClass < Hashie::Mash
disable_warnings
end
```
Therefore, we completely silence the Hashie logger as done in Berkshelf:
https://github.com/berkshelf/berkshelf/pull/1668/files#diff-3eca4e8b32b88ae6a1f14498e3ef7b25R5
|
diff --git a/lib/yarn/error_page.rb b/lib/yarn/error_page.rb
index abc1234..def5678 100644
--- a/lib/yarn/error_page.rb
+++ b/lib/yarn/error_page.rb
@@ -4,7 +4,8 @@
def serve_404_page
@response.status = 404
- @response.body = ["<html><head><title>404</title></head><body><h1>File: #{@request[:uri][:path]} does not exist.</h1></body><html>"]
+ fn = @request[:uri][:path] if @request
+ @response.body = ["<html><head><title>404</title></head><body><h1>File #{fn} does not exist.</h1></body><html>"]
end
def serve_500_page
|
Fix for error page if parse failes
|
diff --git a/bosh_deployment_resource.gemspec b/bosh_deployment_resource.gemspec
index abc1234..def5678 100644
--- a/bosh_deployment_resource.gemspec
+++ b/bosh_deployment_resource.gemspec
@@ -10,6 +10,7 @@ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]
+ spec.add_dependency "bosh_cli"
spec.add_dependency "minitar"
spec.add_development_dependency "bundler", "~> 1.7"
|
Add bosh_cli gem to gemspec
|
diff --git a/spec/magic_lamp_config.rb b/spec/magic_lamp_config.rb
index abc1234..def5678 100644
--- a/spec/magic_lamp_config.rb
+++ b/spec/magic_lamp_config.rb
@@ -1,23 +1,26 @@-require "database_cleaner"
+require 'database_cleaner'
require 'factory_girl'
-FactoryGirl.find_definitions #It looks like requiring factory_girl _should_ do this automatically, but it doesn't seem to work
-FactoryGirl.class_eval do
- def self.create_with_privileged_mode *args
- disable_authorization_checks {create_without_privileged_mode(*args)}
+# This config file is executed twice for some reason, so the following prevents the factories loading twice and causing
+# an exception
+unless (FactoryGirl.factory_by_name(:user) rescue nil)
+ FactoryGirl.find_definitions #It looks like requiring factory_girl _should_ do this automatically, but it doesn't seem to work
+
+ FactoryGirl.class_eval do
+ def self.create_with_privileged_mode *args
+ disable_authorization_checks {create_without_privileged_mode(*args)}
+ end
+
+ def self.build_with_privileged_mode *args
+ disable_authorization_checks {build_without_privileged_mode(*args)}
+ end
+
+ class_alias_method_chain :create, :privileged_mode
+ class_alias_method_chain :build, :privileged_mode
end
-
- def self.build_with_privileged_mode *args
- disable_authorization_checks {build_without_privileged_mode(*args)}
- end
-
- class_alias_method_chain :create, :privileged_mode
- class_alias_method_chain :build, :privileged_mode
end
-
MagicLamp.configure do |config|
-
#Dir[Rails.root.join("spec", "support", "magic_lamp_helpers/**/*.rb")].each { |f| load f }
DatabaseCleaner.strategy = :transaction
@@ -29,5 +32,4 @@ config.after_each do
DatabaseCleaner.clean
end
-
-end+end
|
Stop factory girl loading twice
|
diff --git a/spec/models/image_spec.rb b/spec/models/image_spec.rb
index abc1234..def5678 100644
--- a/spec/models/image_spec.rb
+++ b/spec/models/image_spec.rb
@@ -1,7 +1,17 @@ require 'rails_helper'
RSpec.describe Image, :type => :model do
- pending "add some examples to (or delete) #{__FILE__}"
+
+ describe 'validations' do
+ [:direct_upload_url, :vehicle_id].each do |attr|
+ it "is invalid when #{attr} is not provided" do
+ image = build(:image, attr => nil)
+ image.valid?
+ expect(image.errors[attr]).to include("can't be blank")
+ end
+ end
+ end
+
end
# == Schema Information
|
Test required attributes on Image
|
diff --git a/spec/unit/support_spec.rb b/spec/unit/support_spec.rb
index abc1234..def5678 100644
--- a/spec/unit/support_spec.rb
+++ b/spec/unit/support_spec.rb
@@ -3,26 +3,41 @@ before do
@app = TestDelegate.new
@screen = BasicScreen.new
+ @tab_screen = TabScreen.new
+ @table_screen = TestTableScreen.new
+ @web_screen = TestWebScreen.new
end
it "has a convenience method for UIApplication.sharedApplication" do
@app.app.should == UIApplication.sharedApplication
@screen.app.should == UIApplication.sharedApplication
+ @tab_screen.app.should == UIApplication.sharedApplication
+ @table_screen.app.should == UIApplication.sharedApplication
+ @web_screen.app.should == UIApplication.sharedApplication
end
it "has a convenience method for UIApplication.sharedApplication.delegate" do
@app.app_delegate.should == UIApplication.sharedApplication.delegate
@screen.app_delegate.should == UIApplication.sharedApplication.delegate
+ @tab_screen.app_delegate.should == UIApplication.sharedApplication.delegate
+ @table_screen.app_delegate.should == UIApplication.sharedApplication.delegate
+ @web_screen.app_delegate.should == UIApplication.sharedApplication.delegate
end
it "has a convenience method for UIApplication.sharedApplication.delegate.window" do
@app.app_window.should == UIApplication.sharedApplication.delegate.window
@screen.app_window.should == UIApplication.sharedApplication.delegate.window
+ @tab_screen.app_window.should == UIApplication.sharedApplication.delegate.window
+ @table_screen.app_window.should == UIApplication.sharedApplication.delegate.window
+ @web_screen.app_window.should == UIApplication.sharedApplication.delegate.window
end
it "has a try method" do
@app.try(:some_method).should == nil
@screen.try(:some_method).should == nil
+ @tab_screen.try(:some_method).should == nil
+ @table_screen.try(:some_method).should == nil
+ @web_screen.try(:some_method).should == nil
end
end
|
Make sure the support methods make it into all screens
|
diff --git a/lib/human_error/errors/crud_errors/resource_persistence_error.rb b/lib/human_error/errors/crud_errors/resource_persistence_error.rb
index abc1234..def5678 100644
--- a/lib/human_error/errors/crud_errors/resource_persistence_error.rb
+++ b/lib/human_error/errors/crud_errors/resource_persistence_error.rb
@@ -11,10 +11,6 @@
def http_status
422
- end
-
- def knowledgebase_article_id
- '1234567890'
end
def developer_message
|
Bugfix: Remove a manual reference to `knowledgebase_article_id`
We changed this a while back to be performed in the base class, we just missed
removing this one.
--------------------------------------------------------------------------------
Change-Id: I98ec5a71a704fbc7e98ac0bc97816fd2368bad02
Signed-off-by: Jeff Felchner <8a84c204e2d4c387d61d20f7892a2bbbf0bc8ae8@thekompanee.com>
|
diff --git a/spec/controllers/welcome_controller_spec.rb b/spec/controllers/welcome_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/welcome_controller_spec.rb
+++ b/spec/controllers/welcome_controller_spec.rb
@@ -0,0 +1,27 @@+require 'rails_helper'
+
+describe WelcomeController do
+ let(:user) { FactoryGirl.create(:user) }
+
+ context "user is not signed in" do
+ describe "GET index" do
+ it "should redirect the user to login_path" do
+ get (:index)
+ expect(response).to redirect_to(login_path)
+ end
+ end
+ end
+
+ context "user is signed in" do
+ before(:each) do
+ allow_any_instance_of(UserActionsController).to receive(:current_user).and_return(user)
+ end
+
+ describe "GET index" do
+ it "should render the index template" do
+ get (:index)
+ expect(response).to render_template(:index)
+ end
+ end
+ end
+end
|
Add the test suite for the Welcome Controller.
100 test coverage; all tests passing.
|
diff --git a/spec/knapsack_pro/test_file_cleaner_spec.rb b/spec/knapsack_pro/test_file_cleaner_spec.rb
index abc1234..def5678 100644
--- a/spec/knapsack_pro/test_file_cleaner_spec.rb
+++ b/spec/knapsack_pro/test_file_cleaner_spec.rb
@@ -1,19 +1,11 @@ describe KnapsackPro::TestFileCleaner do
describe '.clean' do
+ let(:test_file_path) { './models/user_spec.rb' }
+
subject { described_class.clean(test_file_path) }
- context "removes ./ " do
- let(:test_file_path) { './models/user_spec.rb' }
- it 'removes ./ from the begining of the test file path' do
- expect(subject).to eq 'models/user_spec.rb'
- end
- end
-
- context "removes , " do
- let(:test_file_path) { 'models/user_spec.rb,' }
- it 'removes , from the end of the test file path' do
- expect(subject).to eq 'models/user_spec.rb'
- end
+ it 'removes ./ from the begining of the test file path' do
+ expect(subject).to eq 'models/user_spec.rb'
end
end
end
|
Revert "remove , from end of the test file path"
This reverts commit 77320671361585abd43ef793a9a20628f51c87ba.
|
diff --git a/NuimoSwift.podspec b/NuimoSwift.podspec
index abc1234..def5678 100644
--- a/NuimoSwift.podspec
+++ b/NuimoSwift.podspec
@@ -1,6 +1,6 @@ Pod::Spec.new do |s|
s.name = "NuimoSwift"
- s.version = "0.5.1"
+ s.version = "0.6.0"
s.summary = "Swift library for connecting and communicating with Senic's Nuimo controllers"
s.description = <<-DESC
Swift library for connecting and communicating with Senic's Nuimo controllers
@@ -17,7 +17,7 @@ s.ios.deployment_target = "8.0"
s.osx.deployment_target = "10.9"
- s.source = { :git => "https://github.com/getSenic/nuimo-swift.git", :tag => "v#{s.version}" }
+ s.source = { :git => "https://github.com/getSenic/nuimo-swift.git", :tag => "#{s.version}" }
s.framework = 'CoreBluetooth'
s.source_files = "SDK/*.swift"
end
|
Set podspec version to 0.6.0
|
diff --git a/tinyforth.gemspec b/tinyforth.gemspec
index abc1234..def5678 100644
--- a/tinyforth.gemspec
+++ b/tinyforth.gemspec
@@ -20,4 +20,5 @@
spec.add_development_dependency "bundler", "~> 1.5"
spec.add_development_dependency "rake"
+ spec.add_development_dependency "rspec"
end
|
Add rspec as a dev dependency
|
diff --git a/Maths/07-Multiplication-Tables/solutions/josh-lang-multiplication-tables.rb b/Maths/07-Multiplication-Tables/solutions/josh-lang-multiplication-tables.rb
index abc1234..def5678 100644
--- a/Maths/07-Multiplication-Tables/solutions/josh-lang-multiplication-tables.rb
+++ b/Maths/07-Multiplication-Tables/solutions/josh-lang-multiplication-tables.rb
@@ -0,0 +1,26 @@+def mult_tab(rows, cols)
+ ary = []
+
+ # Calculate
+ (1..rows).each do |row|
+ (1..cols).each do |col|
+ ary << row * col
+ end
+ end
+
+ # Print nice table
+ max_dig = ary.max.to_s.size
+
+ ary.each_slice(cols) do |sli|
+ slice = sli.map do |pro|
+ pro_dig = pro.to_s.size
+ offset = ' ' * (max_dig - pro_dig)
+ pro = offset + pro.to_s
+ end
+
+ puts slice.join(' ')
+ end
+
+ # Return array
+ ary.uniq!
+end
|
Add solution for multiplication tables
|
diff --git a/lazy_resource.gemspec b/lazy_resource.gemspec
index abc1234..def5678 100644
--- a/lazy_resource.gemspec
+++ b/lazy_resource.gemspec
@@ -18,5 +18,5 @@ gem.add_dependency 'activemodel', '~> 3.1'
gem.add_dependency 'activesupport', '~> 3.1'
gem.add_dependency 'json', '>= 1.5.2'
- gem.add_dependency 'typhoeus', '0.6.3'
+ gem.add_dependency 'typhoeus', '0.6.6'
end
|
Update Typhoeus to the latest version.
|
diff --git a/homebrew/gh.rb b/homebrew/gh.rb
index abc1234..def5678 100644
--- a/homebrew/gh.rb
+++ b/homebrew/gh.rb
@@ -10,13 +10,13 @@
homepage "https://github.com/jingweno/gh"
head "https://github.com/jingweno/gh.git"
- url "https://github.com/jingweno/gh/releases/download/v#{VERSION}/gh_#{VERSION}-snapshot_darwin_#{ARCH}.tar.gz"
+ url "https://github.com/jingweno/gh/releases/download/v#{VERSION}/gh_#{VERSION}-snapshot_darwin_#{ARCH}.zip"
version VERSION
def install
bin.install "gh"
- bash_completion.install "etc/gh.bash_completion.sh"
- zsh_completion.install "etc/gh.zsh_completion" => "_gh"
+ bash_completion.install "gh.bash_completion.sh"
+ zsh_completion.install "gh.zsh_completion" => "_gh"
end
def caveats; <<-EOS.undent
|
Fix homebrew download url and autocomplete scripts url
|
diff --git a/railsdav.gemspec b/railsdav.gemspec
index abc1234..def5678 100644
--- a/railsdav.gemspec
+++ b/railsdav.gemspec
@@ -1,6 +1,6 @@ Gem::Specification.new do |s|
s.name = 'railsdav'
- s.version = '0.0.8'
+ s.version = '0.0.9'
s.date = Time.now
s.authors = ['Willem van Kerkhof']
s.licenses = ['MIT']
@@ -8,5 +8,6 @@ s.summary = %q{Make your Rails 3/4 resources accessible via WebDAV}
s.homepage = %q{http://github.com/wvk/railsdav}
s.description = %q{Provides basic Rails 3/Rails 4 extensions for making your business resources accessible via WebDAV. This gem does by no means by no means implement the full WebDAV semantics, but it suffices to access your app with client(-libs) such as Konqueror, cadaver, davfs2 or NetDrive}
- s.files = %w(README.md init.rb lib/railsdav.rb lib/railsdav/routing_extensions.rb lib/railsdav/request_extensions.rb lib/railsdav/renderer/response_collector.rb lib/railsdav/renderer/response_type_selector.rb lib/railsdav/controller_extensions.rb lib/railsdav/renderer.rb)
+ s.files = %w(README.md init.rb lib/railsdav.rb lib/railsdav/routing_extensions.rb lib/railsdav/request_extensions.rb lib/railsdav/renderer/response_collector.rb lib/railsdav/renderer/response_type_selector.rb lib/railsdav/controller_extensions.rb lib/railsdav/renderer.rb railsdav/renderer/resource_descriptor.rb
+)
end
|
Fix missing file in gemspec
|
diff --git a/SubCommander.podspec b/SubCommander.podspec
index abc1234..def5678 100644
--- a/SubCommander.podspec
+++ b/SubCommander.podspec
@@ -8,9 +8,25 @@ s.homepage = "http://github.com/substantial/SubCommander"
s.license = 'MIT'
s.author = { "Mike Judge" => "mikelovesrobots@gmail.com" }
- s.platform = :ios, '6.0'
- s.source = { :git => "https://github.com/substantial/SubCommander.git", :tag => "0.0.1" }
+ s.platform = :ios, '5.0'
+ s.source = { :git => "https://github.com/substantial/SubCommander.git", :tag => s.version.to_s }
s.source_files = 'Classes', 'Classes/**/*.{h,m}'
s.requires_arc = true
- s.dependency 'AFNetworking', '1.3.1'
+ s.dependency 'AFNetworking', '~> 1.3.2'
+ s.prefix_header_contents = <<-EOS
+#import <Availability.h>
+
+#define _AFNETWORKING_PIN_SSL_CERTIFICATES_
+
+#if __IPHONE_OS_VERSION_MIN_REQUIRED
+ #import <SystemConfiguration/SystemConfiguration.h>
+ #import <MobileCoreServices/MobileCoreServices.h>
+ #import <Security/Security.h>
+#else
+ #import <SystemConfiguration/SystemConfiguration.h>
+ #import <CoreServices/CoreServices.h>
+ #import <Security/Security.h>
+#endif
+EOS
+
end
|
Fix podspec to get rid of frustrating AFNetworking warnings
|
diff --git a/lib/mymoip/request.rb b/lib/mymoip/request.rb
index abc1234..def5678 100644
--- a/lib/mymoip/request.rb
+++ b/lib/mymoip/request.rb
@@ -2,7 +2,7 @@ class Request
include HTTParty
- attr_reader :id, :data, :response
+ attr_reader :id, :response
def initialize(id)
@id = id
|
Remove unused data attribute accessor from Request class
|
diff --git a/lib/tasks/report.rake b/lib/tasks/report.rake
index abc1234..def5678 100644
--- a/lib/tasks/report.rake
+++ b/lib/tasks/report.rake
@@ -20,11 +20,11 @@ task email_mixpanel_usage: :environment do
# Heroku scheduler can only trigger daily, so this only emails
# a report once a week.
- return unless Date.today.sunday?
-
- mailgun_url = MixpanelReport.mailgun_url_from_env(ENV)
- mixpanel_api_secret = ENV['MIXPANEL_API_SECRET']
- target_emails = ENV['USAGE_REPORT_EMAILS_LIST'].split(',')
- MixpanelReport.new(mixpanel_api_secret).run_and_email!(mailgun_url, target_emails)
+ if Date.today.sunday?
+ mailgun_url = MixpanelReport.mailgun_url_from_env(ENV)
+ mixpanel_api_secret = ENV['MIXPANEL_API_SECRET']
+ target_emails = ENV['USAGE_REPORT_EMAILS_LIST'].split(',')
+ MixpanelReport.new(mixpanel_api_secret).run_and_email!(mailgun_url, target_emails)
+ end
end
end
|
Fix return in rake task
|
diff --git a/protokoll.gemspec b/protokoll.gemspec
index abc1234..def5678 100644
--- a/protokoll.gemspec
+++ b/protokoll.gemspec
@@ -19,5 +19,5 @@
s.add_dependency("rails", "~> 4.0", "> 4.0")
- s.add_development_dependency "sqlite3", '~> 0'
+ s.add_development_dependency "sqlite3", '~> 1'
end
|
Fix sqlite3 dependency issue in development
|
diff --git a/nokogiri/google_finance/spec/stock_trend_spec.rb b/nokogiri/google_finance/spec/stock_trend_spec.rb
index abc1234..def5678 100644
--- a/nokogiri/google_finance/spec/stock_trend_spec.rb
+++ b/nokogiri/google_finance/spec/stock_trend_spec.rb
@@ -3,6 +3,8 @@ describe StockTrend do
let(:s) { StockTrend.new }
+ let(:html) { s.html }
+ let(:data) { html.css(s.trend_id) }
describe 'variables' do
# check google finance url
@@ -18,15 +20,28 @@ end
# check data array to be empty
- it 'should have an empty array for data' do
- expect(s.data.length).to be(0)
+ # it 'should have an empty array for data' do
+ # expect(s.data.length).to be(0)
+ # end
+ end
+
+ describe '#html' do
+ it 'returns a Nokogiri object back' do
+ expect(html.text).to be_instance_of(String)
end
end
- pending '#html' do
- it 'returns a Nokogiri object back' do
- html = s.html
- expect(html).to be_instance_of(Nokogiri)
+ describe '#parse_trend' do
+ it 'returns html back' do
+ result = data[0].first[1]
+ expect(result).to be_instance_of(String)
+ end
+ end
+
+ describe '#convert_obj_to_text' do
+ it 'returns back an array' do
+ arr = s.convert_obj_to_text(data)
+ expect(arr.empty?).to be false
end
end
end
|
Remove 'Popular searches...' from data and add headers constant'
|
diff --git a/test/api/group_sets_api_test.rb b/test/api/group_sets_api_test.rb
index abc1234..def5678 100644
--- a/test/api/group_sets_api_test.rb
+++ b/test/api/group_sets_api_test.rb
@@ -11,12 +11,22 @@ Rails.application
end
- def test_get_all_groups_in_unit
+ def test_get_all_groups_in_unit_with_authorization
# Create unit
newUnit = FactoryBot.create(:unit)
- # Create admin
- adminUser = FactoryBot.create(:user, :admin)
- get with_auth_token "/unit/#{newUnit.id}/groups",adminUser
+
+ get with_auth_token "/api/units/#{newUnit.id}/groups",newUnit.main_convenor_user
+ assert_equal 200, last_response.status
+ end
+
+ def test_get_all_groups_in_unit_without_authorization
+ # Create unit
+ newUnit = FactoryBot.create(:unit)
+ # Create student
+ studentUser = FactoryBot.create(:user, :student)
+
+ get with_auth_token "/api/units/#{newUnit.id}/groups",studentUser
+ assert_equal 403, last_response.status
end
end
|
FIX: Change get tests for group_sets_api
|
diff --git a/Casks/plex-media-server.rb b/Casks/plex-media-server.rb
index abc1234..def5678 100644
--- a/Casks/plex-media-server.rb
+++ b/Casks/plex-media-server.rb
@@ -1,7 +1,7 @@ class PlexMediaServer < Cask
- url 'http://downloads.plexapp.com/plex-media-server/0.9.8.4.125-ffe2a5d/PlexMediaServer-0.9.8.4.125-ffe2a5d-OSX.dmg'
+ url 'http://downloads.plexapp.com/plex-media-server/0.9.8.14.263-139ddbc/PlexMediaServer-0.9.8.14.263-139ddbc-OSX.zip'
homepage 'http://plexapp.com'
- version '0.9.8.4.125'
- sha1 'b24af8d1448c7f93be401e688f825282a0bfb125'
+ version '0.9.8.14.263'
+ sha1 '3a86c0d043936ca127b70f4253128a26da8b2377'
link 'Plex Media Server.app'
end
|
Update Plex Media Server to 0.9.8.14.263
|
diff --git a/Apic.podspec b/Apic.podspec
index abc1234..def5678 100644
--- a/Apic.podspec
+++ b/Apic.podspec
@@ -8,9 +8,10 @@
s.platform = :ios, "8.0"
s.source = { :git => "https://github.com/JuanjoArreola/Apic.git", :tag => "version_1.1" }
- s.source_files = "Apic/*.swift"
+ s.source_files = "Apic/*.swift"
+ s.resources = "Apic/apic_properties.plist"
s.requires_arc = true
- s.framework = "SystemConfiguration"
+ s.framework = "SystemConfiguration"
s.dependency "Alamofire", "~> 3.1.5"
end
|
Fix properties file in podspec
|
diff --git a/examples/console/spec/console_spec.rb b/examples/console/spec/console_spec.rb
index abc1234..def5678 100644
--- a/examples/console/spec/console_spec.rb
+++ b/examples/console/spec/console_spec.rb
@@ -36,6 +36,8 @@
it "can handle panics" do
expect { console.freak_out }.to raise_error(RuntimeError, "Aaaaahhhhh!!!!!")
+ # Do it twice to make sure we cleaned up correctly the first time
+ expect { console.freak_out }.to raise_error(RuntimeError, "Aaaaahhhhh!!!!!")
end
it "can handle invalid arguments" do
|
Add failing test for rb_raise leaks
|
diff --git a/chbs.gemspec b/chbs.gemspec
index abc1234..def5678 100644
--- a/chbs.gemspec
+++ b/chbs.gemspec
@@ -14,4 +14,6 @@ gem.name = "chbs"
gem.require_paths = ["lib"]
gem.version = Chbs::VERSION
+
+ gem.add_development_dependency('nokogiri')
end
|
Add dev dependency on nokogiri (for corpuscle)
|
diff --git a/lib/hatchet.rb b/lib/hatchet.rb
index abc1234..def5678 100644
--- a/lib/hatchet.rb
+++ b/lib/hatchet.rb
@@ -17,6 +17,7 @@ end
def self.git_branch
+ return ENV['TRAVIS_BRANCH'] if ENV['TRAVIS_BRANCH']
out = `git describe --contains --all HEAD`.strip
raise "Attempting to find current branch name. Error: Cannot describe git: #{out}" unless $?.success?
out
|
Use travis branch if present
|
diff --git a/lib/hostess.rb b/lib/hostess.rb
index abc1234..def5678 100644
--- a/lib/hostess.rb
+++ b/lib/hostess.rb
@@ -2,7 +2,7 @@
class Hostess < Sinatra::Base
def serve
- send_file(File.expand_path(File.join(Geminabox.data, *request.path_info)))
+ send_file(File.expand_path(File.join(Geminabox.data, *request.path_info)), :type => response['Content-Type'])
end
%w[/specs.4.8.gz
|
Fix 'Unknown media type: ".rz"' Errors.
Sinatra 1.1.0 bails violently when mime type not given explicitly.
|
diff --git a/lib/iso8601.rb b/lib/iso8601.rb
index abc1234..def5678 100644
--- a/lib/iso8601.rb
+++ b/lib/iso8601.rb
@@ -1,6 +1,8 @@ module ISO8601
VERSION = "0.1"
end
+
+require "time"
require "iso8601/errors"
require "iso8601/atoms"
|
ADD require time for dateTime
|
diff --git a/lib/judopay.rb b/lib/judopay.rb
index abc1234..def5678 100644
--- a/lib/judopay.rb
+++ b/lib/judopay.rb
@@ -6,7 +6,7 @@
module Judopay
class << self
- attr_accessor :configuration
+ attr_accessor :configuration, :logger
end
def self.configure
|
Allow Judopay.logger to be set
|
diff --git a/lib/dimples/page.rb b/lib/dimples/page.rb
index abc1234..def5678 100644
--- a/lib/dimples/page.rb
+++ b/lib/dimples/page.rb
@@ -12,6 +12,7 @@ attr_accessor :extension
attr_accessor :layout
attr_accessor :contents
+ attr_accessor :output_directory
def initialize(site, path = nil)
@site = site
@@ -20,37 +21,36 @@
if @path
@filename = File.basename(@path, File.extname(@path))
+ @output_directory = File.dirname(@path).gsub(
+ @site.source_paths[:pages],
+ @site.output_paths[:site]
+ )
+
read_with_front_matter
else
@filename = 'index'
@contents = ''
+ @output_directory = @site.output_paths[:site]
end
end
- def output_path(parent_path)
- parts = [parent_path]
-
- unless @path.nil?
- parts << File.dirname(@path).gsub(@site.source_paths[:pages], '')
- end
-
- parts << "#{@filename}.#{@extension}"
-
- File.join(parts)
+ def output_path
+ File.join(@output_directory, "#{@filename}.#{@extension}")
end
- def write(path, context = {})
- output = context ? render(context) : contents
- parent_path = File.dirname(path)
+ def write(context = {})
+ FileUtils.mkdir_p(@output_directory) unless Dir.exist?(@output_directory)
- FileUtils.mkdir_p(parent_path) unless Dir.exist?(parent_path)
-
- File.open(path, 'w+') do |file|
- file.write(output)
+ File.open(output_path, 'w+') do |file|
+ file.write(context ? render(context) : contents)
end
rescue SystemCallError => e
error_message = "Failed to write #{path} (#{e.message})"
raise Errors::PublishingError, error_message
end
+
+ def inspect
+ "#<Dimples::Page @output_path=#{output_path}>"
+ end
end
end
|
Simplify the output_path and write methods, add an output_directory accessor and inspect method.
|
diff --git a/Casks/android-studio.rb b/Casks/android-studio.rb
index abc1234..def5678 100644
--- a/Casks/android-studio.rb
+++ b/Casks/android-studio.rb
@@ -1,8 +1,8 @@ class AndroidStudio < Cask
- version '0.8.3 build-135.1281642'
- sha256 'fcc6a0b4817e83bc6251764637041e90db7c8df65e7a362e50b9083664cee0f9'
+ version '0.8.4 build-135.1295215'
+ sha256 '595d0f24bc02e3be3ff3d2e4dc7c623d3bbf5a57fd26b48c3613e9292e8fc5ec'
- url 'https://dl.google.com/dl/android/studio/ide-zips/0.8.3/android-studio-ide-135.1281642-mac.zip'
+ url 'https://dl.google.com/dl/android/studio/ide-zips/0.8.4/android-studio-ide-135.1295215-mac.zip'
homepage 'https://developer.android.com/sdk/installing/studio.html'
link 'Android Studio.app'
|
Upgrade Android Studio.app to v0.8.4 build-135.1295215
|
diff --git a/Casks/beyond-compare.rb b/Casks/beyond-compare.rb
index abc1234..def5678 100644
--- a/Casks/beyond-compare.rb
+++ b/Casks/beyond-compare.rb
@@ -8,6 +8,8 @@ license :commercial
app 'Beyond Compare.app'
+ binary 'Beyond Compare.app/Contents/MacOS/BCompare'
+ binary 'Beyond Compare.app/Contents/MacOS/bcomp'
postflight do
suppress_move_to_applications
|
Add binaries for Beyond Compare
|
diff --git a/rails_template.rb b/rails_template.rb
index abc1234..def5678 100644
--- a/rails_template.rb
+++ b/rails_template.rb
@@ -12,6 +12,7 @@
gem_group :development, :test do
gem 'irbtools', require: 'irbtools/binding'
+ gem 'awesome_print'
end
run("bundle install")
|
Make awesome_print a default gem in rails
|
diff --git a/lib/juici/routes.rb b/lib/juici/routes.rb
index abc1234..def5678 100644
--- a/lib/juici/routes.rb
+++ b/lib/juici/routes.rb
@@ -1,33 +1,34 @@ module Juici
module Router
include Routes
+ URL_PART = /[\w\/. %]+/
def build_new_path
"/builds/new"
end
def build_list_path
- %r{^/builds/(?<project>[\w\/]+)/list$}
+ %r{^/builds/(?<project>#{URL_PART})/list$}
end
def build_rebuild_path
- %r{^/builds/(?<project>[\w\/]+)/rebuild/(?<id>[^/]*)$}
+ %r{^/builds/(?<project>#{URL_PART})/rebuild/(?<id>[^/]*)$}
end
def build_edit_path
- %r{^/builds/(?<project>[\w\/]+)/edit/(?<id>[^/]*)$}
+ %r{^/builds/(?<project>#{URL_PART})/edit/(?<id>[^/]*)$}
end
def build_show_path
- %r{^/builds/(?<project>[\w\/]+)/show/(?<id>[^/]*)$}
+ %r{^/builds/(?<project>#{URL_PART})/show/(?<id>[^/]*)$}
end
def build_output_path
- %r{^/builds/(?<project>[\w\/]+)/(?<id>[^/]*)/_output$}
+ %r{^/builds/(?<project>#{URL_PART})/(?<id>[^/]*)/_output$}
end
def build_trigger_path
- %r{^/trigger/(?<project>[\w\/]+)$}
+ %r{^/trigger/(?<project>#{URL_PART})$}
end
end
|
Handle spaces and dots in project names
|
diff --git a/recipes/server.rb b/recipes/server.rb
index abc1234..def5678 100644
--- a/recipes/server.rb
+++ b/recipes/server.rb
@@ -23,8 +23,8 @@ include_recipe 'gluster::server_setup'
include_recipe 'gluster::server_extend' if node['gluster']['server']['server_extend_enabled']
include_recipe 'gluster::volume_extend' if begin
- Gem::Specification.find_by_name('di-ruby-lvm')
+ Gem::Specification.find_by_name('chef-ruby-lvm')
rescue Gem::LoadError
- Chef::Log.info('not including gluster::volume_extend since di-ruby-lvm was not found')
+ Chef::Log.info('not including gluster::volume_extend since chef-ruby-lvm was not found')
return false
end
|
Update lvm cookbook ruby-lvm dependency
As Stated in the chef-lvm cookbook, the now used lvm dependency is not the same.
This change works now on my environment and (as a bonus) bring the reproducibility of my gluster cookbook usage on bento/fedora-26.
Thank you for this cookbook, it's really easy to use and is very useful.
Regards,
|
diff --git a/lib/scorm/errors.rb b/lib/scorm/errors.rb
index abc1234..def5678 100644
--- a/lib/scorm/errors.rb
+++ b/lib/scorm/errors.rb
@@ -1,10 +1,14 @@ module Scorm
module Errors
class InvalidManifest < RuntimeError; end
- class NoMetadataError < InvalidManifest; end
- class DuplicateMetadataError < InvalidManifest; end
- class NoOrganizationsError < InvalidManifest; end
- class DuplicateOrganizationsError < InvalidManifest; end
+ class RequiredItemMissing < InvalidManifest; end
+ class DuplicateItem < InvalidManifest; end
+
+ class NoMetadataError < RequiredItemMissing; end
+ class DuplicateMetadataError < DuplicateItem; end
+ class NoOrganizationsError < RequiredItemMissing; end
+ class DuplicateOrganizationsError < DuplicateItem; end
+
class UnsupportedSCORMVersion < RuntimeError; end
class InvalidSCORMVersion < InvalidManifest; end
end
|
Add RequiredItemMissing and DuplicateItem exceptions.
NoMetadataError/NoOrganizationsError and their related "too-many" exceptions is too specific,
and we would like to avoid adding those kinds of exceptions every time the standard requires
one, and only one, of some kind of element.
Therefore, introduce the RequiredItemMissing and DuplicateItem, and have the more specific inherit from these
|
diff --git a/lib/troy/helpers.rb b/lib/troy/helpers.rb
index abc1234..def5678 100644
--- a/lib/troy/helpers.rb
+++ b/lib/troy/helpers.rb
@@ -6,8 +6,8 @@ CGI.escapeHTML(content)
end
- def t(*args)
- I18n.t(*args)
+ def t(*args, **kwargs)
+ I18n.t(*args, **kwargs)
end
def partial(name, locals = {})
|
Fix I18n issue with named args.
|
diff --git a/deploy/before_bundle.rb b/deploy/before_bundle.rb
index abc1234..def5678 100644
--- a/deploy/before_bundle.rb
+++ b/deploy/before_bundle.rb
@@ -7,5 +7,5 @@ sudo "echo 'date.timezone = America/Los_Angeles' > /etc/php/fpm-php5.4/ext-active/timezone.ini"
# kick composer install
-#run "curl -s https://getcomposer.org/installer | php -d allow_url_fopen=on"
-#run "php -d allow_url_fopen=on composer.phar install"+run "curl -s https://getcomposer.org/installer | php -d allow_url_fopen=on"
+run "php -d allow_url_fopen=on composer.phar install"
|
Revert "[ey] Let engineyard run composer"
This reverts commit b9dbe457b0430fc17beb7fb29961713e8919bad0.
|
diff --git a/lib/generators/unread/polymorphic_reader_migration/templates/unread_polymorphic_reader_migration.rb b/lib/generators/unread/polymorphic_reader_migration/templates/unread_polymorphic_reader_migration.rb
index abc1234..def5678 100644
--- a/lib/generators/unread/polymorphic_reader_migration/templates/unread_polymorphic_reader_migration.rb
+++ b/lib/generators/unread/polymorphic_reader_migration/templates/unread_polymorphic_reader_migration.rb
@@ -4,7 +4,7 @@ rename_column :read_marks, :user_id, :reader_id
add_column :read_marks, :reader_type, :string
execute "update read_marks set reader_type = 'User'"
- add_index :read_marks, [:reader_id, :reader_type, :readable_type, :readable_id], name: 'read_marks_reader_readable_index'
+ add_index :read_marks, [:reader_id, :reader_type, :readable_type, :readable_id], name: 'read_marks_reader_readable_index', unique: true
end
def self.down
|
Use unique index in upgrade migration, too
Belongs to #78
|
diff --git a/spec/rack/rejector_spec.rb b/spec/rack/rejector_spec.rb
index abc1234..def5678 100644
--- a/spec/rack/rejector_spec.rb
+++ b/spec/rack/rejector_spec.rb
@@ -1,11 +1,57 @@ require 'spec_helper'
+require 'rack'
describe Rack::Rejector do
- it 'has a version number' do
- expect(Rack::Rejector::VERSION).not_to be nil
+ let(:app) { ->(_env) { [200, {}, ['OK']] } }
+
+ it 'does not reject if the block is false' do
+ rejector = described_class.new(app) do |_request, _opts|
+ false
+ end
+ request = Rack::MockRequest.new(rejector)
+ response = request.post('some/path')
+
+ expect(response.status).to eq 200
+ expect(response.body).to eq 'OK'
+ p response.headers
end
- it 'does something useful' do
- expect(false).to eq(true)
+ it 'rejects if the block is true' do
+ rejector = described_class.new(app) do |_request, _opts|
+ true
+ end
+ request = Rack::MockRequest.new(rejector)
+ response = request.get('some/path')
+ expect(response.status).to eq 503
+ expect(response.body).to eq '503 SERVICE UNAVAILIBLE'
+ p response.headers
+ end
+
+ it 'uses the set opts if it rejects' do
+ rejector = described_class.new(app) do |_request, opts|
+ opts[:body] = 'teapot'
+ opts[:code] = 418
+ opts[:headers] = { X_TEST_HEADER: 'darjeeling' }
+ true
+ end
+ request = Rack::MockRequest.new(rejector)
+ response = request.get('some/path')
+
+ expect(response.i_m_a_teapot?).to be true # Status Code 418
+ expect(response.body).to eq 'teapot'
+ expect(response.headers).to include X_TEST_HEADER: 'darjeeling'
+ end
+
+ it 'does not use the set opts if it doesn\'t reject' do
+ rejector = described_class.new(app) do |_request, opts|
+ opts[:body] = 'teapot'
+ opts[:code] = 418
+ false
+ end
+ request = Rack::MockRequest.new(rejector)
+ response = request.get('some/path')
+
+ expect(response.i_m_a_teapot?).to_not be true # Status Code 418
+ expect(response.body).to_not eq 'teapot'
end
end
|
Add First Tests for Rejector Class
|
diff --git a/log-courier.gemspec b/log-courier.gemspec
index abc1234..def5678 100644
--- a/log-courier.gemspec
+++ b/log-courier.gemspec
@@ -1,6 +1,6 @@ Gem::Specification.new do |gem|
gem.name = 'log-courier'
- gem.version = '0.12'
+ gem.version = '0.13'
gem.description = 'Log Courier library'
gem.summary = 'Receive events from Log Courier and transmit between LogStash instances'
gem.homepage = 'https://github.com/driskell/log-courier'
@@ -10,11 +10,12 @@ gem.rubyforge_project = 'nowarning'
gem.require_paths = ['lib']
gem.files = %w(
+ lib/log-courier/client.rb
+ lib/log-courier/client_tls.rb
+ lib/log-courier/event_queue.rb
lib/log-courier/server.rb
lib/log-courier/server_tcp.rb
lib/log-courier/server_zmq.rb
- lib/log-courier/client.rb
- lib/log-courier/client_tls.rb
)
gem.add_runtime_dependency 'ffi-rzmq', '>= 2.0'
|
Mark versions as 0.13, add extra file to gem spec, and update change log
|
diff --git a/Formula/bats-support.rb b/Formula/bats-support.rb
index abc1234..def5678 100644
--- a/Formula/bats-support.rb
+++ b/Formula/bats-support.rb
@@ -4,7 +4,7 @@ url "https://github.com/ztombol/bats-support/archive/v0.2.0.tar.gz"
sha256 "9bfa93d2db046e375e31e4c6cbbe834b015c695862c2dca1b46b71401de1038d"
head "https://github.com/ztombol/bats-support.git"
- depends_on "bats"
+ depends_on "bats-core"
def install
mkdir "bats-support"
|
Update dependency from bats to bats-core
|
diff --git a/mail_logger.gemspec b/mail_logger.gemspec
index abc1234..def5678 100644
--- a/mail_logger.gemspec
+++ b/mail_logger.gemspec
@@ -4,7 +4,7 @@ require 'mail/logger/version'
Gem::Specification.new do |spec|
- spec.name = "email_logger"
+ spec.name = "mail-logger"
spec.version = Mail::Logger::VERSION
spec.authors = ["Josh McArthur"]
spec.email = ["joshua.mcarthur@gmail.com"]
|
Rename gem to not conflict with an existing gem
|
diff --git a/lib/spree/authentication_helpers.rb b/lib/spree/authentication_helpers.rb
index abc1234..def5678 100644
--- a/lib/spree/authentication_helpers.rb
+++ b/lib/spree/authentication_helpers.rb
@@ -2,25 +2,30 @@ module AuthenticationHelpers
def self.included(receiver)
receiver.send :helper_method, :spree_current_user
- receiver.send :helper_method, :spree_login_path
- receiver.send :helper_method, :spree_signup_path
- receiver.send :helper_method, :spree_logout_path
+
+ if Spree::Auth::Engine.frontend_available?
+ receiver.send :helper_method, :spree_login_path
+ receiver.send :helper_method, :spree_signup_path
+ receiver.send :helper_method, :spree_logout_path
+ end
end
def spree_current_user
current_spree_user
end
- def spree_login_path
- spree.login_path
- end
+ if Spree::Auth::Engine.frontend_available?
+ def spree_login_path
+ spree.login_path
+ end
- def spree_signup_path
- spree.signup_path
- end
+ def spree_signup_path
+ spree.signup_path
+ end
- def spree_logout_path
- spree.logout_path
+ def spree_logout_path
+ spree.logout_path
+ end
end
end
end
|
Add guard for frontend-based AuthenticationHelpers
These Spree::AuthenticationHelpers methods should only be available for
apps that have `solidus_frontend` available, as they are simply proxies
for route helpers provided by that gem.
Closes #59.
|
diff --git a/test/integration/flow_visualisation_test.rb b/test/integration/flow_visualisation_test.rb
index abc1234..def5678 100644
--- a/test/integration/flow_visualisation_test.rb
+++ b/test/integration/flow_visualisation_test.rb
@@ -0,0 +1,12 @@+require_relative '../integration_test_helper'
+
+class FlowVisualisationTest < ActionDispatch::IntegrationTest
+ SmartAnswer::FlowRegistry.instance.flows.each do |flow|
+ should "be able to visualise #{flow.name}" do
+ presenter = GraphPresenter.new(flow)
+ assertion_message = "The #{flow.name} Smart Answers isn't visualisable"
+
+ assert presenter.visualisable?, assertion_message
+ end
+ end
+end
|
Add test to ensure all flows are visualisable
We've gone to quite some effort to ensure that the graph visualisation
continues to work while we've been refactoring Smart Answers. I'm adding this
test to ensure that we don't undo that work in future.
This was highlighted by a proposed refactoring of benefit-cap-calculator (see
PR #2452) that results in the flow not being visualisable.
Assuming this commit, and the proposed benefit-cap-calculator refactoring make
it into master, we'll have to work out how to handle the broken visualisation.
|
diff --git a/test/integration/integration_test_helper.rb b/test/integration/integration_test_helper.rb
index abc1234..def5678 100644
--- a/test/integration/integration_test_helper.rb
+++ b/test/integration/integration_test_helper.rb
@@ -1,13 +1,13 @@ require File.expand_path(File.join(File.dirname(__FILE__), '../test_helper'))
config = File.join(TEST_PATH, 'config/braintree_auth.yml')
if File.exist?(config) && auth = YAML.load_file(config)
- Braintree::Configuration.environment = :sandbox
- Braintree::Configuration.merchant_id = auth['merchant_id']
- Braintree::Configuration.public_key = auth['public_key']
- Braintree::Configuration.private_key = auth['private_key']
+ BraintreeRails::Configuration.environment = :sandbox
+ BraintreeRails::Configuration.merchant_id = auth['merchant_id']
+ BraintreeRails::Configuration.public_key = auth['public_key']
+ BraintreeRails::Configuration.private_key = auth['private_key']
else
puts '*' * 80
puts "You need to provide real credentials in #{config} to run integration tests"
puts '*' * 80
exit(0)
-end+end
|
Set Braintree configurations through BraintreeRails in integration test helper
|
diff --git a/lib/catissue/domain/hash_code.rb b/lib/catissue/domain/hash_code.rb
index abc1234..def5678 100644
--- a/lib/catissue/domain/hash_code.rb
+++ b/lib/catissue/domain/hash_code.rb
@@ -7,9 +7,7 @@ # @return [Integer] a unique hash code
# @see #==
def hash
- # JRuby alert - JRuby 1.5 object_id can be a String, e.g. CollectionProtocol_null.
- # Work-around to the work-around is to make a unique object id in this aberrant case.
- @_hc ||= (Object.new.object_id * 31) + 17
+ proxy_object_id * 31 + 17
end
# Returns whether other is of type same type as this object with the same hash as this object.
|
Use caruby-core JRuby 1.5 bug work-around
|
diff --git a/config/schedule.rb b/config/schedule.rb
index abc1234..def5678 100644
--- a/config/schedule.rb
+++ b/config/schedule.rb
@@ -11,3 +11,7 @@ every :day, at: ['3:30am', '1:15pm'] do
rake 'import:whitehall:mappings'
end
+
+every :hour do
+ rake 'import:dns_details'
+end
|
Update Host CNAMEs every hour
This will mean that the transition status for a site will be more up-to-date
if it has transitioned today. Currently this happens at midnight when data is
imported from Redirector.
|
diff --git a/lib/traffic_light_controller/cli.rb b/lib/traffic_light_controller/cli.rb
index abc1234..def5678 100644
--- a/lib/traffic_light_controller/cli.rb
+++ b/lib/traffic_light_controller/cli.rb
@@ -6,6 +6,7 @@
class << self
def run
+ change_program_name
cli = self.new
cli.process_command_line_options
cli.run
@@ -35,6 +36,10 @@
attr_reader :server
+ def self.change_program_name
+ $0 = File.basename($0) << " (#{VERSION})"
+ end
+
def options_possible
[
['--help', '-h', GetoptLong::NO_ARGUMENT],
@@ -54,7 +59,7 @@
def version_info
<<-EOV
-traffic_light_controller (#{version_number})
+#{program_name}
https://github.com/jcmuller/traffic_light_controller
(c) 2012 Juan C. Muller
EOV
|
Add version to program name
|
diff --git a/lib/context/controller_helper.rb b/lib/context/controller_helper.rb
index abc1234..def5678 100644
--- a/lib/context/controller_helper.rb
+++ b/lib/context/controller_helper.rb
@@ -14,7 +14,7 @@ # end
def context_page(path=nil)
# TODO: Should restrict to published pages
- Page.find_by_path(path ||= params[:path])
+ Page.find_by_path(path || params[:path] || request.fullpath)
end
end
|
Use request.fullpath as the last resort for finding a path
This is for paths that are exclusively '/', so it may just be better to hardcode it to that.
|
diff --git a/lib/yard/handlers/method_handler.rb b/lib/yard/handlers/method_handler.rb
index abc1234..def5678 100644
--- a/lib/yard/handlers/method_handler.rb
+++ b/lib/yard/handlers/method_handler.rb
@@ -3,7 +3,7 @@
def process
mscope = scope
- meth = statement.tokens.to_s[/^def\s+([\s\w\:\.]+)/, 1].gsub(/\s+/,'')
+ meth = statement.tokens.to_s[/^def\s+([\s\w\:\.=<>\?^%\/\*]+)/, 1].gsub(/\s+/,'')
# Class method if prefixed by self(::|.) or Module(::|.)
if meth =~ /(?:#{NSEP}|\.)([^#{NSEP}\.]+)$/
|
Add support for non-alphanum methods.. specs to come
|
diff --git a/lib/hubble_api_client/request.rb b/lib/hubble_api_client/request.rb
index abc1234..def5678 100644
--- a/lib/hubble_api_client/request.rb
+++ b/lib/hubble_api_client/request.rb
@@ -28,7 +28,7 @@ if response.code == '200'
JSON.parse response.body, symbolize_names: true
else
- raise HubbleApiclientNotFound, "Error #{response.code}: #{response.body}"
+ raise HubbleApiClientNotFound, "Error #{response.code}: #{response.body}"
end
end
end
|
Update error class name with camel case
|
diff --git a/lib/language_pack/no_lockfile.rb b/lib/language_pack/no_lockfile.rb
index abc1234..def5678 100644
--- a/lib/language_pack/no_lockfile.rb
+++ b/lib/language_pack/no_lockfile.rb
@@ -1,7 +1,7 @@ require "language_pack"
-require "language_pack/base"
+require "language_pack/ruby"
-class LanguagePack::NoLockfile < LanguagePack::Base
+class LanguagePack::NoLockfile < LanguagePack::Ruby
def self.use?
!File.exists?("Gemfile.lock")
end
|
Allow Nolockfile to get to compile phase
Nolockfile does not define a number of things that base needs in terms of subclass overrides. By simply changing the parent class, we get reasonable versions of those things and allow the build to get as far as compile, so that the error can be emitted.
The error output without this change looks like:
```
[builder] -----> Compiling Ruby/NoLockfile
[builder]
[builder] !
[builder] ! must subclass
[builder] !
[builder] /cnb/buildpacks/heroku_ruby/0.0.1/lib/language_pack/base.rb:65:in `default_addons': must subclass (RuntimeError)
[builder] from /cnb/buildpacks/heroku_ruby/0.0.1/lib/language_pack/base.rb:124:in `build_release'
[builder] from /cnb/buildpacks/heroku_ruby/0.0.1/lib/language_pack/base.rb:132:in `write_release_toml'
[builder] from /cnb/buildpacks/heroku_ruby/0.0.1/lib/language_pack/base.rb:103:in `build'
[builder] from /cnb/buildpacks/heroku_ruby/0.0.1/bin/support/ruby_build:26:in `block (2 levels) in <main>'
[builder] from /cnb/buildpacks/heroku_ruby/0.0.1/lib/language_pack/base.rb:190:in `log'
[builder] from /cnb/buildpacks/heroku_ruby/0.0.1/bin/support/ruby_build:25:in `block in <main>'
[builder] from /cnb/buildpacks/heroku_ruby/0.0.1/lib/language_pack/instrument.rb:35:in `block in trace'
[builder] from /cnb/buildpacks/heroku_ruby/0.0.1/lib/language_pack/instrument.rb:18:in `block (2 levels) in instrument'
[builder] from /cnb/buildpacks/heroku_ruby/0.0.1/lib/language_pack/instrument.rb:40:in `yield_with_block_depth'
[builder] from /cnb/buildpacks/heroku_ruby/0.0.1/lib/language_pack/instrument.rb:17:in `block in instrument'
[builder] from /tmp/tmp.dL7R7BOXyl/lib/ruby/2.6.0/benchmark.rb:308:in `realtime'
[builder] from /cnb/buildpacks/heroku_ruby/0.0.1/lib/language_pack/instrument.rb:16:in `instrument'
[builder] from /cnb/buildpacks/heroku_ruby/0.0.1/lib/language_pack/instrument.rb:35:in `trace'
[builder] from /cnb/buildpacks/heroku_ruby/0.0.1/bin/support/ruby_build:21:in `<main>'
```
|
diff --git a/Casks/kobito.rb b/Casks/kobito.rb
index abc1234..def5678 100644
--- a/Casks/kobito.rb
+++ b/Casks/kobito.rb
@@ -0,0 +1,7 @@+class Kobito < Cask
+ url 'http://kobito.qiita.com/download/Kobito_v1.8.2.zip'
+ homepage 'http://kobito.qiita.com/'
+ version '1.8.2'
+ sha1 'eac47edd574380391044ea89486b14a0ec2b3a00'
+ link 'Kobito.app'
+end
|
Add new cask for Kobito
|
diff --git a/config/initializers/new_relic.rb b/config/initializers/new_relic.rb
index abc1234..def5678 100644
--- a/config/initializers/new_relic.rb
+++ b/config/initializers/new_relic.rb
@@ -1,4 +1,4 @@ # Ensure the agent is started using Unicorn
# This is needed when using Unicorn and preload_app is not set to true.
# See http://support.newrelic.com/kb/troubleshooting/unicorn-no-data
-NewRelic::Agent.after_fork(:force_reconnect => true) if defined? Unicorn+NewRelic::Agent.after_fork(force_reconnect: true) if defined? Unicorn
|
Use new style hash syntax.
|
diff --git a/lib/active_record_mysql_gone_patch.rb b/lib/active_record_mysql_gone_patch.rb
index abc1234..def5678 100644
--- a/lib/active_record_mysql_gone_patch.rb
+++ b/lib/active_record_mysql_gone_patch.rb
@@ -0,0 +1,18 @@+require 'active_record/connection_adapters/mysql_adapter'
+
+module ActiveRecord::ConnectionAdapters
+ class MysqlAdapter
+ alias_method :execute_without_retry, :execute
+ def execute(*args)
+ execute_without_retry(*args)
+ rescue ActiveRecord::StatementInvalid
+ if $!.message =~ /server has gone away/i
+ warn "Server timed out, retrying"
+ reconnect!
+ retry
+ end
+
+ raise
+ end
+ end
+end
|
Patch for server gone away
|
diff --git a/lib/dm-core/adapters/mysql_adapter.rb b/lib/dm-core/adapters/mysql_adapter.rb
index abc1234..def5678 100644
--- a/lib/dm-core/adapters/mysql_adapter.rb
+++ b/lib/dm-core/adapters/mysql_adapter.rb
@@ -13,14 +13,6 @@ # @api private
def supports_default_values? #:nodoc:
false
- end
-
- # TODO: once the driver's quoting methods become public, have
- # this method delegate to them instead
- # TODO: document
- # @api private
- def quote_name(name) #:nodoc:
- "`#{name.gsub('`', '``')}`"
end
# TODO: once the driver's quoting methods become public, have
|
Remove special quoting case for MySQL
* DO MySQL driver configures connection to allow ANSI compliant quotes
to be used. SQL should always be generated as ANSI compliant when
possible, and only when there is no other choice should we support
a special case.
|
diff --git a/test/servers/rackapp_6511.rb b/test/servers/rackapp_6511.rb
index abc1234..def5678 100644
--- a/test/servers/rackapp_6511.rb
+++ b/test/servers/rackapp_6511.rb
@@ -12,6 +12,11 @@ [200, {"Content-Type" => "application/json"}, ["[\"Stan\",\"is\",\"on\",\"the\",\"scene!\"]"]]
}
end
+ map "/error" do
+ run Proc.new { |env|
+ [500, {"Content-Type" => "application/json"}, ["[\"Stan\",\"is\",\"on\",\"the\",\"error!\"]"]]
+ }
+ end
}
Rack::Handler::Puma.run(app, {:Host => '127.0.0.1', :Port => 6511})
|
Add an error path that returns 500
|
diff --git a/spec/puppet-lint/check_conditionals_spec.rb b/spec/puppet-lint/check_conditionals_spec.rb
index abc1234..def5678 100644
--- a/spec/puppet-lint/check_conditionals_spec.rb
+++ b/spec/puppet-lint/check_conditionals_spec.rb
@@ -3,7 +3,9 @@ describe PuppetLint::Plugins::CheckConditionals do
subject do
klass = described_class.new
- klass.run(defined?(fullpath).nil? ? {:fullpath => ''} : {:fullpath => fullpath}, code)
+ fileinfo = {}
+ fileinfo[:fullpath] = defined?(fullpath).nil? ? '' : fullpath
+ klass.run(fileinfo, code)
klass
end
@@ -17,7 +19,14 @@ }"
}
- its(:problems) { should only_have_problem :kind => :warning, :message => "selector inside resource block", :linenumber => 3 }
+ its(:problems) do
+ should only_have_problem({
+ :kind => :warning,
+ :message => 'selector inside resource block',
+ :linenumber => 3,
+ :column => 16,
+ })
+ end
end
describe 'resource with a variable as a attr value' do
@@ -49,6 +58,13 @@ }"
}
- its(:problems) { should only_have_problem :kind => :warning, :message => "case statement without a default case", :linenumber => 2 }
+ its(:problems) do
+ should only_have_problem({
+ :kind => :warning,
+ :message => 'case statement without a default case',
+ :linenumber => 2,
+ :column => 7,
+ })
+ end
end
end
|
Add column numbers to CheckConditionals tests
|
diff --git a/scripts/resolve_dropbox_conflicts.rb b/scripts/resolve_dropbox_conflicts.rb
index abc1234..def5678 100644
--- a/scripts/resolve_dropbox_conflicts.rb
+++ b/scripts/resolve_dropbox_conflicts.rb
@@ -0,0 +1,17 @@+require 'fileutils'
+include FileUtils
+
+conflicts = `find ~/Dropbox -name "*conflicted*"`.split("\n")
+same, diff = conflicts.select { |conflict|
+ actual = conflict.sub(/ \(.*'s conflicted copy \d{4}-\d{2}-\d{2}\)/, '')
+ diff = `diff "#{actual}" "#{conflict}"`
+ diff.empty?
+}
+
+same.each do |conflict|
+ rm conflict
+end
+
+puts diff.map { |conflict|
+ [conflict, diff].join("\n")
+}.join("\n")
|
[meta] Add a script for resolving Dropbox conflicts
|
diff --git a/activesupport/lib/active_support/configuration_file.rb b/activesupport/lib/active_support/configuration_file.rb
index abc1234..def5678 100644
--- a/activesupport/lib/active_support/configuration_file.rb
+++ b/activesupport/lib/active_support/configuration_file.rb
@@ -32,7 +32,7 @@ require "erb"
File.read(content_path).tap do |content|
- if content.match?(/\U+A0/)
+ if content.include?("\u00A0")
warn "File contains invisible non-breaking spaces, you may want to remove those"
end
end
|
Fix ConfigurationFile check for non-breaking space
The regular expression used to check for non-breaking spaces is invalid,
but prints a warning ("Unknown escape \U is ignored: /\U+A0/") instead
of raising an error.
This commit fixes the check (and the warning).
|
diff --git a/Casks/crashplan.rb b/Casks/crashplan.rb
index abc1234..def5678 100644
--- a/Casks/crashplan.rb
+++ b/Casks/crashplan.rb
@@ -2,6 +2,7 @@ version '4.7.0'
sha256 'c36d7280038e576f70bce12f11cdfe6c2519c34d4b21f1681c59bac439a2c283'
+ # crashplan.com was verified as official when first introduced to the cask
url "http://download.crashplan.com/installs/mac/install/CrashPlan/CrashPlan_#{version}_Mac.dmg"
name 'CrashPlan'
homepage 'https://www.code42.com/crashplan/'
|
Fix `url` stanza comment for CrashPlan.
|
diff --git a/Casks/insomniax.rb b/Casks/insomniax.rb
index abc1234..def5678 100644
--- a/Casks/insomniax.rb
+++ b/Casks/insomniax.rb
@@ -1,8 +1,8 @@ class Insomniax < Cask
- version '2.1.3'
- sha256 '50f41f5f40bd7a8896139c838b48d07abc0ad28419650865187383d1b9165707'
+ version '2.1.4'
+ sha256 'c6594f663b90a1aab8187a8685bfe043f89f7a245c17b1fcfbb6978a83ed33c3'
- url 'https://www.macupdate.com/download/22211/insomniax-2.1.3.tgz'
+ url "http://insomniax.semaja2.net/InsomniaX-#{version}.tgz"
homepage 'http://semaja2.net/projects/insomniaxinfo/'
app 'InsomniaX.app'
|
Upgrade Insomniax to 2.1.4
Changed download link from MacUpdate to original source since MacUpdate
simply redirects users to the original source.
|
diff --git a/lib/active_record/validations/string_truncator.rb b/lib/active_record/validations/string_truncator.rb
index abc1234..def5678 100644
--- a/lib/active_record/validations/string_truncator.rb
+++ b/lib/active_record/validations/string_truncator.rb
@@ -17,6 +17,7 @@ if value.length > limit
self[field] = value.slice(0, limit)
end
+ return true # to make sure the callback chain doesn't halt
end
when :text
@@ -30,6 +31,7 @@ if value.bytesize > limit
self[field] = value.mb_chars.limit(limit).to_s
end
+ return true # to make sure the callback chain doesn't halt
end
end
end
|
Add return true to make clear the callback chain will never halt when using this in before_save instead of before_validation.
|
diff --git a/adamantium.gemspec b/adamantium.gemspec
index abc1234..def5678 100644
--- a/adamantium.gemspec
+++ b/adamantium.gemspec
@@ -13,7 +13,7 @@
gem.require_paths = %w[lib]
gem.files = `git ls-files`.split($/)
- gem.test_files = `git ls-files spec/{unit,integration}`.split($/)
+ gem.test_files = `git ls-files -- spec/{unit,integration}`.split($/)
gem.extra_rdoc_files = %w[LICENSE README.md TODO]
gem.add_runtime_dependency('backports', '~> 2.6.4')
|
Update git ls-files to use a separator after the options
|
diff --git a/app/overrides/add_print_invoice_to_admin_configuration_sidebar.rb b/app/overrides/add_print_invoice_to_admin_configuration_sidebar.rb
index abc1234..def5678 100644
--- a/app/overrides/add_print_invoice_to_admin_configuration_sidebar.rb
+++ b/app/overrides/add_print_invoice_to_admin_configuration_sidebar.rb
@@ -1,5 +1,5 @@-Deface::Override.new(virtual_path: 'spree/admin/shared/_configuration_menu',
+Deface::Override.new(virtual_path: 'spree/admin/shared/sub_menu/_configuration',
name: 'print_invoice_admin_configurations_menu',
- insert_bottom: '[data-hook="admin_configurations_sidebar_menu"], #admin_configurations_sidebar_menu[data-hook]',
+ insert_bottom: '[data-hook="admin_configurations_sidebar_menu"]',
text: '<%= configurations_sidebar_menu_item Spree.t(:settings, scope: :print_invoice), edit_admin_print_invoice_settings_path %>',
disabled: false)
|
Correct menu hook for Spree v3.0.0.beta
|
diff --git a/app/controllers/users/omniauth_callbacks_controller.rb b/app/controllers/users/omniauth_callbacks_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/users/omniauth_callbacks_controller.rb
+++ b/app/controllers/users/omniauth_callbacks_controller.rb
@@ -23,8 +23,8 @@ private
def no_email_error
- msg = "You need a public email address on GitHub to sign up"
- msg << "you can add an email, sign up for triage, then remove it from GitHub:<hr />"
+ msg = "You need a public email address on GitHub to sign up you can add"
+ msg << " an email, sign up for triage, then remove it from GitHub:<hr />"
msg << "<a href='https://github.com/settings/profile'>GitHub Profile</a>"
msg.html_safe
end
|
Add missing space on sign in no_email_error flash
|
diff --git a/app.rb b/app.rb
index abc1234..def5678 100644
--- a/app.rb
+++ b/app.rb
@@ -54,7 +54,7 @@ doctype 5
html
head
- meta charset='utf-8'
+ meta(charset='utf-8')
title = @title
body
== yield
|
Change meta tag to use parentheses around charset attribute
|
diff --git a/configs.rb b/configs.rb
index abc1234..def5678 100644
--- a/configs.rb
+++ b/configs.rb
@@ -8,7 +8,7 @@ PAAS_VENDOR_FOLDER = "vendor/cloudcontrol"
LIBYAML_VERSION = "0.1.4"
LIBYAML_PATH = "libyaml-#{LIBYAML_VERSION}"
- BUNDLER_VERSION = "1.6.3"
+ BUNDLER_VERSION = "1.7.13"
BUNDLER_GEM_PATH = "bundler-#{BUNDLER_VERSION}"
NODE_VERSION = "0.4.7"
NODE_JS_BINARY_PATH = "node-#{NODE_VERSION}"
|
Update bundler (1.6.3 -> 1.7.13)
|
diff --git a/spec/lib/assignments_manager_spec.rb b/spec/lib/assignments_manager_spec.rb
index abc1234..def5678 100644
--- a/spec/lib/assignments_manager_spec.rb
+++ b/spec/lib/assignments_manager_spec.rb
@@ -0,0 +1,37 @@+require 'rails_helper'
+require "#{Rails.root}/lib/assignments_manager"
+
+describe AssignmentsManager do
+ describe '.update_assignments' do
+ it 'creates new assignments for existing articles' do
+ course = create(:course, id: 1)
+ user = create(:user, id: 1)
+ create(:article, id: 1, namespace: 0, title: 'Existing_article')
+ params = { 'users' => [{ 'id' => 1, 'wiki_id' => 'Ragesock' }],
+ 'assignments' => [{ 'user_id' => 1,
+ 'article_title' => 'existing article',
+ 'role' => 0 }] }
+ allow(WikiEdits).to receive(:update_assignments)
+ allow(WikiEdits).to receive(:update_course)
+
+ AssignmentsManager.update_assignments(course, params, user)
+ expect(Assignment.last.article_title).to eq('Existing_article')
+ expect(Assignment.last.article_id).to eq(1)
+ end
+
+ it 'creates new assignments for non-existent articles' do
+ course = create(:course, id: 1)
+ user = create(:user, id: 1)
+ params = { 'users' => [{ 'id' => 1, 'wiki_id' => 'Ragesock' }],
+ 'assignments' => [{ 'user_id' => 1,
+ 'article_title' => 'existing article',
+ 'role' => 0 }] }
+ allow(WikiEdits).to receive(:update_assignments)
+ allow(WikiEdits).to receive(:update_course)
+
+ AssignmentsManager.update_assignments(course, params, user)
+ expect(Assignment.last.article_title).to eq('Existing_article')
+ expect(Assignment.last.article_id).to eq(nil)
+ end
+ end
+end
|
Add unit tests for AssignmentsManager
|
diff --git a/spec/routing/root_to_routing_spec.rb b/spec/routing/root_to_routing_spec.rb
index abc1234..def5678 100644
--- a/spec/routing/root_to_routing_spec.rb
+++ b/spec/routing/root_to_routing_spec.rb
@@ -0,0 +1,9 @@+require 'rails_helper'
+
+describe 'root' do
+ describe 'routing' do
+ it 'routes to home#index' do
+ expect(get: '/').to route_to('home#index')
+ end
+ end
+end
|
Add route spec for root url
|
diff --git a/app/controllers/mpa_controller.rb b/app/controllers/mpa_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/mpa_controller.rb
+++ b/app/controllers/mpa_controller.rb
@@ -15,8 +15,8 @@
def pept2data
peptides = params[:peptides] || []
- missed = params[:missed]
- @equate_il = params[:equate_il]
+ missed = params[:missed] || false
+ @equate_il = params[:equate_il].nil? ? true : params[:equate_il]
@peptides = Sequence
.includes(Sequence.lca_t_relation_name(@equate_il) => :lineage)
.where(sequence: peptides)
|
Fix equate_il must be boolean error
|
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
@@ -14,6 +14,6 @@ end
def find_and_replace_note_refs(text)
- text.gsub(/\s#(\d+)\s?/) { link_to "##{$1}", book_note_path(@book, $1) }
+ text.gsub(/\s#(\d+)\s?/) { " " + link_to("##{$1}", book_note_path(@book, $1)) }
end
end
|
Add space before note refs
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.