diff stringlengths 65 26.7k | message stringlengths 7 9.92k |
|---|---|
diff --git a/features/lib/step_definitions/wire_steps.rb b/features/lib/step_definitions/wire_steps.rb
index abc1234..def5678 100644
--- a/features/lib/step_definitions/wire_steps.rb
+++ b/features/lib/step_definitions/wire_steps.rb
@@ -11,7 +11,7 @@ end
Given /^I have environment variable (\w+) set to "([^"]*)"$/ do |variable, value|
- set_env_var(variable, value)
+ set_env(variable, value)
end
module WireHelper
@@ -36,13 +36,3 @@ After('@wire') do
stop_wire_server
end
-
-module CucumberHelper
- def set_env_var(variable, value)
- @original_env_vars ||= {}
- @original_env_vars[variable] = ENV[variable]
- ENV[variable] = value
- end
-end
-
-World(CucumberHelper)
| Use Aruba API method to set environment variable
|
diff --git a/lib/embarista/tasks/set_current_index.rb b/lib/embarista/tasks/set_current_index.rb
index abc1234..def5678 100644
--- a/lib/embarista/tasks/set_current_index.rb
+++ b/lib/embarista/tasks/set_current_index.rb
@@ -3,10 +3,11 @@
module Embarista
class SetCurrentIndexTask < ::Rake::TaskLib
- attr_accessor :name, :app, :redis
+ attr_accessor :name, :app, :key, :redis
- def initialize(name = :set_current_index)
+ def initialize(name = :set_current_index, key = 'index')
@name = name
+ @key = key
yield self if block_given?
@@ -18,11 +19,11 @@
private
def define
- set_current_task = task name, :manifest_id do |t, args|
+ set_current_task = task(name, :manifest_id) do |t, args|
manifest_id = args[:manifest_id] || App.env.to_s
- puts "redis.set('#{app}:index:current', '#{manifest_id}')"
- redis.set("#{app}:index:current", manifest_id)
+ puts "redis.set('#{app}:#{key}:current', '#{manifest_id}')"
+ redis.set("#{app}:#{key}:current", manifest_id)
end
set_current_task.add_description "Activates a manifest in the given #{App.env_var}"
end
| Add support for setting redis keys besides "index". To be used for A/B testing different branches.
|
diff --git a/lib/foreman_tasks/dynflow/persistence.rb b/lib/foreman_tasks/dynflow/persistence.rb
index abc1234..def5678 100644
--- a/lib/foreman_tasks/dynflow/persistence.rb
+++ b/lib/foreman_tasks/dynflow/persistence.rb
@@ -11,9 +11,9 @@ begin
on_execution_plan_save(execution_plan_id, value)
rescue => e
- ForemanTasks.world.logger.error('Error on on_execution_plan_save event')
- ForemanTasks.world.logger.error(e.message)
- ForemanTasks.world.logger.error(e.backtrace.join("\n"))
+ ForemanTasks.dynflow.world.logger.error('Error on on_execution_plan_save event')
+ ForemanTasks.dynflow.world.logger.error(e.message)
+ ForemanTasks.dynflow.world.logger.error(e.backtrace.join("\n"))
end
end
end
| Update the way to get to the dynflow logger
|
diff --git a/lib/mongo_session_store/mongoid_store.rb b/lib/mongo_session_store/mongoid_store.rb
index abc1234..def5678 100644
--- a/lib/mongo_session_store/mongoid_store.rb
+++ b/lib/mongo_session_store/mongoid_store.rb
@@ -4,6 +4,7 @@ module ActionDispatch
module Session
class MongoidStore < MongoStoreBase
+ BINARY_CLASS = defined?(Moped::BSON::Binary) ? Moped::BSON::Binary : BSON::Binary
class Session
include Mongoid::Document
@@ -12,15 +13,38 @@ store_in :collection => MongoSessionStore.collection_name
field :_id, :type => String
+ field :data, :type => BINARY_CLASS, :default => -> { marshaled_binary({}) }
+ attr_accessible :_id, :data if respond_to?(:attr_accessible)
- field :data, :type => Moped::BSON::Binary, :default => Moped::BSON::Binary.new(:generic, Marshal.dump({}))
+ def marshaled_binary(data)
+ self.class.marshaled_binary(data)
+ end
- attr_accessible :_id, :data
+ def self.marshaled_binary(data)
+ if BINARY_CLASS.to_s == 'BSON::Binary'
+ BSON::Binary.new(Marshal.dump(data), :generic)
+ else
+ Moped::BSON::Binary.new(:generic, Marshal.dump(data))
+ end
+ end
end
private
def pack(data)
- Moped::BSON::Binary.new(:generic, Marshal.dump(data))
+ session_class.marshaled_binary(data)
+ end
+
+ def unpack(packed)
+ return nil unless packed
+ Marshal.load(extract_data(packed))
+ end
+
+ def extract_data(packed)
+ if packed.class.to_s == 'BSON::Binary'
+ packed.data
+ else
+ packed.to_s
+ end
end
end
end
| Fix MongoidStore for Mongoid 4 while remaining Mongoid 3 compatible.
|
diff --git a/lib/moysklad/entities/attribute_value.rb b/lib/moysklad/entities/attribute_value.rb
index abc1234..def5678 100644
--- a/lib/moysklad/entities/attribute_value.rb
+++ b/lib/moysklad/entities/attribute_value.rb
@@ -1,9 +1,10 @@ module Moysklad::Entities
class AttributeValue < Virtus::Attribute
def coerce(value)
- if value.is_a? String
+ case value
+ when String, Float
value
- elsif value.is_a? ::Hash
+ when Hash
if value['meta']['type'] == 'customentity'
CustomEntity.new value
else
| Add float to attribute value
|
diff --git a/lib/scss_lint/linter/shorthand_linter.rb b/lib/scss_lint/linter/shorthand_linter.rb
index abc1234..def5678 100644
--- a/lib/scss_lint/linter/shorthand_linter.rb
+++ b/lib/scss_lint/linter/shorthand_linter.rb
@@ -30,18 +30,17 @@
def valid_shorthand?(shorthand)
values = shorthand.split(/\s+/)
+ top, right, bottom, left = values
- if values[0] == values[1] &&
- values[1] == values[2] &&
- values[2] == values[3]
+ if top == right && right == bottom && bottom == left
false
- elsif values[0] == values[1] && values[2].nil? && values[3].nil?
+ elsif top == right && bottom.nil? && left.nil?
false
- elsif values[0] == values[2] && values[1] == values[3]
+ elsif top == bottom && right == left
false
- elsif values[0] == values[2] && values[3].nil?
+ elsif top == bottom && left.nil?
false
- elsif values[1] == values[3]
+ elsif right == left
false
else
true
| Improve clarity of shorthand linter through naming
This commit improves the clarity of the shorthand linter by assigning
the values of the array that contains a property's shorthand values to
named variables that correspond to their placement (top, right, bottom,
and left).
Related Story:
http://www.pivotaltracker.com/story/show/43148129
("Teach scss-lint about missed shorthand case")
Change-Id: Idc8833d36f2857eb56f7bada40674d5ba88ead14
Reviewed-on: https://gerrit.causes.com/17754
Reviewed-by: Lann Martin <564fa7a717c51b612962ea128f146981a0e99d90@causes.com>
Tested-by: Joe Lencioni <1dd72cf724deaab5db236f616560fc7067b734e1@causes.com>
|
diff --git a/lib/events/action_event.rb b/lib/events/action_event.rb
index abc1234..def5678 100644
--- a/lib/events/action_event.rb
+++ b/lib/events/action_event.rb
@@ -32,8 +32,8 @@
def block
blocked_user = @channel.find_user_by_id(@message['content']['user'])
- @channel.remove_user_by_id(@message['content']['user'])
if blocked_user
+ @channel.remove_user_by_id(blocked_user.id)
render_kick(@user.irc_host, blocked_user.nick, @channel.irc_id)
end
end
| Use user.id instead of non-parsed ID.
|
diff --git a/tools/dockerhub-ci-clean.rb b/tools/dockerhub-ci-clean.rb
index abc1234..def5678 100644
--- a/tools/dockerhub-ci-clean.rb
+++ b/tools/dockerhub-ci-clean.rb
@@ -0,0 +1,17 @@+#!/usr/bin/env ruby
+
+require_relative '../features/support/dockerhub'
+require_relative '../cli/lib/rbld_reg_dockerhub'
+require_relative '../features/support/test_constants'
+
+def cred(name)
+ ENV["RBLD_CREDENTIAL_#{name.upcase}"]
+end
+
+path = Class.new.extend(RebuildTestConstants).dockerhub_namespace
+
+dh_registry = Rebuild::Registry::DockerHub::API.new(path)
+dh = Rebuild::DockerHub.new(cred('username'), cred('password'))
+
+repos = dh_registry.search_repos
+dh.kill_repos(repos)
| tools: Add script for DockerHub CI account cleanup
[ci skip]
Signed-off-by: Dmitry Fleytman <a8cf97adadec4e1b734a39bc5aea71b5741cfca1@daynix.com>
|
diff --git a/Wrap.podspec b/Wrap.podspec
index abc1234..def5678 100644
--- a/Wrap.podspec
+++ b/Wrap.podspec
@@ -1,6 +1,6 @@ Pod::Spec.new do |s|
s.name = "Wrap"
- s.version = "1.1"
+ s.version = "1.1.1"
s.summary = "The easy to use Swift JSON encoder"
s.description = <<-DESC
Wrap is an easy to use Swift JSON encoder. Don't spend hours writing JSON encoding code - just wrap it instead!
@@ -15,7 +15,7 @@ s.osx.deployment_target = "10.10"
s.watchos.deployment_target = "2.0"
s.tvos.deployment_target = "9.0"
- s.source = { :git => "https://github.com/JohnSundell/Wrap.git", :tag => "1.1" }
- s.source_files = "Wrap.swift"
+ s.source = { :git => "https://github.com/JohnSundell/Wrap.git", :tag => "1.1.1" }
+ s.source_files = "Sources/Wrap.swift"
s.framework = "Foundation"
end
| Bump Podspec to 1.1.1 and update Sources directory reference |
diff --git a/lib/share_notify/api_v2.rb b/lib/share_notify/api_v2.rb
index abc1234..def5678 100644
--- a/lib/share_notify/api_v2.rb
+++ b/lib/share_notify/api_v2.rb
@@ -8,10 +8,9 @@
base_uri ShareNotify.config.fetch('host', 'https://staging.osf.io')
- # @param [String] token is optional but some actions will not be successful without it
- def initialize(_token = nil)
+ def initialize
@headers = {
- 'Authorization' => "Bearer #{ShareNotify.config.fetch('token', nil)}",
+ 'Authorization' => "Bearer #{ShareNotify.config.fetch('token')}",
'Content-Type' => 'application/vnd.api+json'
}
end
| Change ApiV2 to raise exception if token is unconfigured
Also remove unused parameter.
|
diff --git a/Cedar.podspec b/Cedar.podspec
index abc1234..def5678 100644
--- a/Cedar.podspec
+++ b/Cedar.podspec
@@ -11,7 +11,9 @@ s.osx.deployment_target = '10.7'
s.ios.deployment_target = '6.0'
s.source_files = 'Source/**/*.{h,m,mm}'
+ s.public_header_files = 'Source/Headers/Public/**/*.{h}'
s.osx.exclude_files = '**/iPhone/**'
+ s.ios.exclude_files = '**/OSX/**'
# Versions of this pod >= 0.9.0 require C++11.
# https://github.com/pivotal/cedar/issues/47
| Update podspec to respect project & public headers
- Also exclude OS X matchers from the iOS pod
|
diff --git a/lib/travis/queue/docker.rb b/lib/travis/queue/docker.rb
index abc1234..def5678 100644
--- a/lib/travis/queue/docker.rb
+++ b/lib/travis/queue/docker.rb
@@ -4,7 +4,7 @@ class Queue
class Docker < Struct.new(:repo, :job, :config)
def apply?
- return false if force_precise_sudo_required?
+ return 'required' if force_precise_sudo_required?
return specified if specified?
default
end
| Return the correct value when forcing sudo required :sweat_smile:
|
diff --git a/lib/tytus/compatibility.rb b/lib/tytus/compatibility.rb
index abc1234..def5678 100644
--- a/lib/tytus/compatibility.rb
+++ b/lib/tytus/compatibility.rb
@@ -1,19 +1,21 @@ # encoding: utf-8
-if Rails.version.to_i < 3
- def rails_3
- false
- end
+if defined? Rails
+ if Rails.version.to_i < 3
+ def rails_3
+ false
+ end
- def rails_2
- yield
- end
-else
- def rails_3
- yield
- end
+ def rails_2
+ yield
+ end
+ else
+ def rails_3
+ yield
+ end
- def rails_2
- false
+ def rails_2
+ false
+ end
end
end
| Add check for rails gem existance.
|
diff --git a/ci_environment/networking_basic/recipes/default.rb b/ci_environment/networking_basic/recipes/default.rb
index abc1234..def5678 100644
--- a/ci_environment/networking_basic/recipes/default.rb
+++ b/ci_environment/networking_basic/recipes/default.rb
@@ -25,6 +25,9 @@ 'curl',
'wget',
'rsync',
+ # libldap resolves dependency hell around libcurl4-openssl-dev. MK.
+ "libldap-2.4.2",
+ "libldap2-dev",
"libcurl4-openssl-dev"
]
| Resolve dependency hell in network_basic
|
diff --git a/lib/usable/config_multi.rb b/lib/usable/config_multi.rb
index abc1234..def5678 100644
--- a/lib/usable/config_multi.rb
+++ b/lib/usable/config_multi.rb
@@ -10,7 +10,7 @@ methods.each do |name|
config._spec[name] = nil
config._spec.define_singleton_method(name) do
- other._spec.singleton_method(name).call
+ other._spec.public_method(name).call
end
end
config
| Use public_method instead of singleton_method for ruby 2.0 support
|
diff --git a/lib/active_record/connection_adapters/oracle_enhanced/column.rb b/lib/active_record/connection_adapters/oracle_enhanced/column.rb
index abc1234..def5678 100644
--- a/lib/active_record/connection_adapters/oracle_enhanced/column.rb
+++ b/lib/active_record/connection_adapters/oracle_enhanced/column.rb
@@ -4,7 +4,7 @@ module ConnectionAdapters #:nodoc:
module OracleEnhanced
class Column < ActiveRecord::ConnectionAdapters::Column
- attr_reader :table_name, :nchar, :virtual_column_data_default, :returning_id #:nodoc:
+ attr_reader :table_name, :virtual_column_data_default, :returning_id #:nodoc:
def initialize(name, default, sql_type_metadata = nil, null = true, table_name = nil, virtual = false, returning_id = nil, comment = nil) #:nodoc:
@virtual = virtual
| Remove non-existent `:nchar` from attr_reader
|
diff --git a/ruby_svg_light.gemspec b/ruby_svg_light.gemspec
index abc1234..def5678 100644
--- a/ruby_svg_light.gemspec
+++ b/ruby_svg_light.gemspec
@@ -1,32 +1,25 @@-require 'rake/gempackagetask'
NAME = "ruby_svg_light"
Dir.chdir( './lib/')
-require NAME
+puts require NAME
Dir.chdir( './../')
-spec = Gem::Specification.new do |s|
+Gem::Specification.new do |s|
s.name = NAME
- s.version = RubyIt::VERSION
+ s.version = RubySVGLight::VERSION
s.platform = Gem::Platform::RUBY
- s.summary = ''
+ s.summary = 'Basic Helper for creating SVG Files'
s.homepage = 'http://amaras-tech.co.uk/software/RubySVGLight'
s.authors = "Morgan Prior"
s.email = NAME + "_gem@amaras-tech.co.uk"
- s.description = <<-eos
-
- eos
- s.files = ["bin/#{NAME}"]
- s.files += Dir.glob("LICENSE.rtf")
- s.files += Dir.glob("examples/*")
- s.files += Dir.glob("lib/**/*")
- s.files += Dir.glob("spec/*")
- s.bindir = 'bin'
+ s.description = %{A basic library for building SVG files. Not all properties of SVG are supported}
+ s.files = [Dir.glob("LICENSE.rtf")]
+ s.files += Dir.glob("examples/*")
+ s.files += Dir.glob("lib/**/*")
+ s.files += Dir.glob("spec/*")
+
+
- s.executables = [NAME]
- s.has_rdoc = false
+end
- end
- Rake::GemPackageTask.new(spec).define
-
| Update to gemspec, works with latest gem build |
diff --git a/lib/dug.rb b/lib/dug.rb
index abc1234..def5678 100644
--- a/lib/dug.rb
+++ b/lib/dug.rb
@@ -10,7 +10,7 @@
module Dug
LABEL_RULE_TYPES = %w(organization repository reason state)
- GITHUB_REASONS = %w(author comment mention team_mention state_change assign manual subscribed)
+ GITHUB_REASONS = %w(author comment mention team_mention state_change assign manual subscribed push)
ISSUE_STATES = %(merged closed reopened)
def self.authorize!
| Add 'push' to valid Github notification reasons
|
diff --git a/AFDateHelper.podspec b/AFDateHelper.podspec
index abc1234..def5678 100644
--- a/AFDateHelper.podspec
+++ b/AFDateHelper.podspec
@@ -9,19 +9,20 @@
Pod::Spec.new do |s|
s.name = "AFDateHelper"
- s.version = "3.3.1"
+ s.version = "3.3.2"
s.summary = "NSDate Extension for Swift 2.0"
s.description = <<-DESC
Extension for NSDate in Swift for creating, modifying or comparing dates.
DESC
s.homepage = "https://github.com/melvitax/AFDateHelper"
- s.screenshots = "https://raw.githubusercontent.com/melvitax/AFDateHelper/master/Screenshot.png"
+ s.screenshots = "https://raw.githubusercontent.com/melvitax/AFDateHelper/master/Screenshot.png"
s.license = 'MIT'
s.author = { "Melvin Rivera" => "melvin@allforces.com" }
s.source = { :git => "https://github.com/melvitax/AFDateHelper.git", :tag => s.version.to_s }
# s.social_media_url = 'https://twitter.com/melvitax'
s.platform = :ios, '8.0'
+ s.platform = :tvos, '9.0'
s.requires_arc = true
s.source_files = 'AFDateHelper/**/*'
| Add tvOS support and bump to 3.3.2
|
diff --git a/Blindside.podspec b/Blindside.podspec
index abc1234..def5678 100644
--- a/Blindside.podspec
+++ b/Blindside.podspec
@@ -10,6 +10,7 @@
s.ios.deployment_target = '5.0'
s.osx.deployment_target = '10.7'
+ s.watchos.deployment_target = '2.0'
s.source_files = "{Source,Headers}/**/*.{h,m}"
s.public_header_files = 'Headers/Public/*.{h}'
| Declare watchOS support in the podspec
|
diff --git a/app/controllers/spree/subscriptions_controller.rb b/app/controllers/spree/subscriptions_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/spree/subscriptions_controller.rb
+++ b/app/controllers/spree/subscriptions_controller.rb
@@ -28,6 +28,6 @@ end
def subscription_params
- params.permit(subscription: [:reorder_on, :interval])
+ params.permit([:reorder_on, :interval])
end
end
| Revert "fix not whitelisting nested params"
This reverts commit 38cd2df8bf75ffea3904b99bdbbac576c5692a77.
|
diff --git a/lib/kosmos/packages/environmental_visual_enhancements.rb b/lib/kosmos/packages/environmental_visual_enhancements.rb
index abc1234..def5678 100644
--- a/lib/kosmos/packages/environmental_visual_enhancements.rb
+++ b/lib/kosmos/packages/environmental_visual_enhancements.rb
@@ -0,0 +1,22 @@+class EnvironmentalVisualEnhancementsHighRes < Kosmos::Package
+ title 'Environmental Visual Enhancements - High Resolution'
+ aliases 'environmental visual enhancements - high res',
+ 'environmental visual enhancements'
+
+ url 'https://github.com/rbray89/EnvironmentalVisualEnhancements/releases/download/Release-7-3/EnvironmentalVisualEnhancements-7-3.zip'
+
+ def install
+ merge_directory 'GameData'
+ end
+end
+
+class EnvironmentalVisualEnhancementsLowRes < Kosmos::Package
+ title 'Environmental Visual Enhancements - Low Resolution'
+ aliases 'environmental visual enhancements - low res'
+
+ url 'https://github.com/rbray89/EnvironmentalVisualEnhancements/releases/download/Release-7-3LR/EnvironmentalVisualEnhancements-7-3-LR.zip'
+
+ def install
+ merge_directory 'GameData'
+ end
+end
| Add a package for Environmental Visual Enhancements.
Two separate packages are there for the two different resolution levels.
|
diff --git a/core/app/controllers/users/passwords_controller.rb b/core/app/controllers/users/passwords_controller.rb
index abc1234..def5678 100644
--- a/core/app/controllers/users/passwords_controller.rb
+++ b/core/app/controllers/users/passwords_controller.rb
@@ -1,24 +1,3 @@ class Users::PasswordsController < Devise::PasswordsController
-
layout "one_column"
-
- def edit
- if params[:msg] # Warning! Also used for logging in unconfirmed users who request new password
- @user = User.where(reset_password_token: params[:reset_password_token].to_s).first
-
- if @user
- @user.skip_confirmation!
- @user.save(validate: false)
-
- sign_in @user, bypass: true
- redirect_to after_sign_in_path_for(@user).to_s
- else
- redirect_to new_user_session_path,
- notice: 'Your account is already set up. Please log in to continue.'
- end
- else
- super
- end
- end
-
end
| Remove old approval flow, just have people use the reset password functionality
|
diff --git a/app/controllers/renalware/hd/dashboards_controller.rb b/app/controllers/renalware/hd/dashboards_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/renalware/hd/dashboards_controller.rb
+++ b/app/controllers/renalware/hd/dashboards_controller.rb
@@ -10,7 +10,7 @@ preference_set = PreferenceSet.for_patient(@patient).first_or_initialize
profile = Profile.for_patient(@patient).first_or_initialize
sessions = Session.for_patient(@patient).limit(10).ordered
- dry_weights = DryWeight.for_patient(@patient).limit(10).ordered
+ dry_weights = DryWeight.for_patient(@patient).limit(10).includes(:assessor).ordered
render locals: {
preference_set: preference_set,
| Fix N+1 query loading DryWeights in HD Dashboard
|
diff --git a/lib/exceptionally_beautiful/tasks/exceptionally_beautiful.rake b/lib/exceptionally_beautiful/tasks/exceptionally_beautiful.rake
index abc1234..def5678 100644
--- a/lib/exceptionally_beautiful/tasks/exceptionally_beautiful.rake
+++ b/lib/exceptionally_beautiful/tasks/exceptionally_beautiful.rake
@@ -2,6 +2,7 @@ desc "Cache all Exceptionally Beautiful error pages in your application's public folder"
task :cache => :environment do
app = ActionDispatch::Integration::Session.new(Rails.application)
+ app.https!
ExceptionallyBeautiful.errors.each do |error_code|
app.get "/#{error_code}"
| Enable HTTPS handling in caching Rake task.
|
diff --git a/lib/build_log_parser/matchers/duration_matcher.rb b/lib/build_log_parser/matchers/duration_matcher.rb
index abc1234..def5678 100644
--- a/lib/build_log_parser/matchers/duration_matcher.rb
+++ b/lib/build_log_parser/matchers/duration_matcher.rb
@@ -6,7 +6,7 @@ /ran [\d]+ tests in (.*)\n?/i,
/time: (.*), memory:/i,
/[\d]+ passing (.*)/,
- /executed [\d]+ of [\d]+ \w+ \(([\d\.]+) secs\)/
+ /executed [\d]+ of [\d]+ [\w]+ \(([\d\.]+ [\w]+) /i
]
def fetch_duration(str)
| Fix invalid js duration pattern
|
diff --git a/lib/codesake/dawn/kb/owasp_ror_cheatsheet/csrf.rb b/lib/codesake/dawn/kb/owasp_ror_cheatsheet/csrf.rb
index abc1234..def5678 100644
--- a/lib/codesake/dawn/kb/owasp_ror_cheatsheet/csrf.rb
+++ b/lib/codesake/dawn/kb/owasp_ror_cheatsheet/csrf.rb
@@ -0,0 +1,28 @@+module Codesake
+ module Dawn
+ module Kb
+ module OwaspRorCheatSheet
+ class Csrf
+ include PatternMatchCheck
+
+ def initialize
+ message = "Ruby on Rails has specific, built in support for CSRF tokens. To enable it, or ensure that it is enabled, find the base ApplicationController and look for the protect_from_forgery directive. Note that by default Rails does not provide CSRF protection for any HTTP GET request."
+
+ super({
+ :name=>"Owasp Ror CheatSheet: Cross Site Request Forgery",
+ :kind=>Codesake::Dawn::KnowledgeBase::PATTERN_MATCH_CHECK,
+ :applies=>["rails"],
+ :glob=>"application_controller.rb",
+ :aux_links=>["https://www.owasp.org/index.php/Ruby_on_Rails_Cheatsheet"],
+ :message=>message,
+ :attack_pattern => ["protect_from_forgery"],
+ :negative_search=>true
+ })
+ # @debug = true
+ end
+
+ end
+ end
+ end
+ end
+end
| Test for CSRF protection token presence. It's a negative pattern
matching search... if the pattern has been found, the vuln? method
returns false; true otherwise.
|
diff --git a/lib/generators/vitrage/templates/vitrage_piece.rb b/lib/generators/vitrage/templates/vitrage_piece.rb
index abc1234..def5678 100644
--- a/lib/generators/vitrage/templates/vitrage_piece.rb
+++ b/lib/generators/vitrage/templates/vitrage_piece.rb
@@ -6,5 +6,5 @@
default_scope -> { order(ordn: :asc, id: :asc) }
- ITEM_KINDS = [ ] # add items class names # TODO move to yml config
+ ITEM_KINDS = [ ] # add items class names
end
| Remove TODO comment about config yml file
|
diff --git a/lib/moyashi/spectrum_parsers/sample_txt_parser.rb b/lib/moyashi/spectrum_parsers/sample_txt_parser.rb
index abc1234..def5678 100644
--- a/lib/moyashi/spectrum_parsers/sample_txt_parser.rb
+++ b/lib/moyashi/spectrum_parsers/sample_txt_parser.rb
@@ -0,0 +1,44 @@+class SampleTxtParser < Moyashi::SpectrumParser::Base
+ define_name "TXT by LabSolutions (Shimadzu)."
+
+ define_description "This is a samlpe parser. You can find a sample input file 'sample_spectrum.txt' in in path-to-moyashi/samples foulder."
+
+ add_required_label :spectrum_sample_id, white_list: "", uniqueness: true
+ add_required_label :total_intensity, white_list: "", uniqueness: false
+
+ define_params do |p|
+ p.float :m_z_start, default: 10.0, html_name: 'm/z start'
+ p.float :m_z_end, default: 2000.0, html_name: 'm/z end'
+ p.float :m_z_interval, default: 0.1, html_name: 'm/z interval'
+ p.file :spectrum, presence: true
+ end
+
+ define_parser do |record, params|
+ record.spectrum_sample_id = File.basename(params.spectrum.original_filename, ".*")
+
+ # Filter to detect header of each spectrum raw file.
+ filter = /\[MS\ Spectrum\]\n
+ .+?
+ Profile\sData\n
+ .+?
+ m\/z\tAbsolute\ Intensity\tRelative\ Intensity\n
+ (.*?)\n\n/xm
+ raw_spectrum = params.spectrum.read.gsub(/\r\n?/, "\n")
+ spectra = raw_spectrum.scan(filter).flatten
+
+ m_z = make_m_z_collection(params.m_z_start, params.m_z_end, params.m_z_interval)
+
+ spectra.map do |text|
+ new_record = record.dup
+ intensities = text.split("\n").map{|v| v.split("\t") }
+
+ spectrum = m_z.zip(intensities.map{|v| v[1].to_i }).select{|v| v[0] && v[1] }
+
+ new_record.spectrum = spectrum
+
+ new_record.total_intensity = sprintf("%.2e", spectrum.inject(0){|s,i| s + i[1] })
+
+ new_record
+ end
+ end
+end | Add a new sample parser.
|
diff --git a/lib/resource_index.rb b/lib/resource_index.rb
index abc1234..def5678 100644
--- a/lib/resource_index.rb
+++ b/lib/resource_index.rb
@@ -36,7 +36,7 @@ def self.setup_sql_client
if RUBY_PLATFORM == "java"
@opts[:adapter] = "jdbc"
- @opts[:uri] = "jdbc:mysql://#{opts[:host]}:#{opts[:port]}/#{opts[:database]}?user=#{opts[:username]}&password=#{opts[:password]}"
+ @opts[:uri] = "jdbc:mysql://#{@opts[:host]}:#{@opts[:port]}/#{@opts[:database]}?user=#{@opts[:username]}&password=#{@opts[:password]}"
end
@opts[:adapter] ||= "mysql2"
@client = Sequel.connect(@opts)
| Move local var to inst var
|
diff --git a/Casks/makemkv.rb b/Casks/makemkv.rb
index abc1234..def5678 100644
--- a/Casks/makemkv.rb
+++ b/Casks/makemkv.rb
@@ -1,6 +1,6 @@ cask :v1 => 'makemkv' do
- version '1.9.5'
- sha256 '091a7ae803296783f018682bda2099d53a3d4fff61560836888ac4e73607a75e'
+ version '1.9.6'
+ sha256 'ef555f8e98ff059baa91144162f81f07cfa57f3bdaa48acaa57350bee5d43363'
url "http://www.makemkv.com/download/makemkv_v#{version}_osx.dmg"
name 'MakeMKV'
| Update MakeMKV to version 1.9.6 |
diff --git a/Casks/cevelop.rb b/Casks/cevelop.rb
index abc1234..def5678 100644
--- a/Casks/cevelop.rb
+++ b/Casks/cevelop.rb
@@ -0,0 +1,13 @@+cask 'cevelop' do
+ version '1.4.0-201603071314'
+ sha256 '9199a6e5978e608e51de95e165f13acfdec49d265fef4bf4df5b93973f6cf2ae'
+
+ url "https://www.cevelop.com/cevelop/downloads/cevelop-#{version}-macosx.cocoa.x86_64.tar.gz"
+ name 'Cevelop'
+ homepage 'https://www.cevelop.com/'
+ license :gratis
+
+ depends_on arch: :x86_64
+
+ app 'Cevelop.app'
+end
| Add Cevelop C++ IDE v1.4.0
Cevelop extends Eclipse CDT with many additional features: CUTE unit
testing with Test Driven Development support, new refactorings and
quick fixes, and much more. And it's free!
It is developed by the Institute for Software at The University of Applied
Sciences in Rapperswil, Switzerland (HSR) within the context of the
REPARA project, co-funded by the European Commission within the Seventh Framework Programme
|
diff --git a/Casks/eclipse.rb b/Casks/eclipse.rb
index abc1234..def5678 100644
--- a/Casks/eclipse.rb
+++ b/Casks/eclipse.rb
@@ -1,7 +1,7 @@ class Eclipse < Cask
homepage 'http://eclipse.org'
- url 'http://eclipse.mirror.kangaroot.net/eclipse/downloads/drops4/R-4.2.2-201302041200/eclipse-SDK-4.2.2-macosx-cocoa-x86_64.tar.gz'
- version '4.2.2'
- sha1 '209ee0aa194aea5869c56546eb77f89da515252d'
+ url 'http://download.eclipse.org/technology/epp/downloads/release/kepler/R/eclipse-standard-kepler-R-macosx-cocoa-x86_64.tar.gz'
+ version '4.3'
+ sha1 'c9aeb9ba9db87d8d5c81b6abf9c11283f15a0cd2'
link 'Eclipse.app'
end
| Update Eclipse to version 4.3 Kepler
|
diff --git a/Casks/macdown.rb b/Casks/macdown.rb
index abc1234..def5678 100644
--- a/Casks/macdown.rb
+++ b/Casks/macdown.rb
@@ -1,6 +1,6 @@ class Macdown < Cask
version '0.2.4'
- sha256 '8720bb9644b391a9a6fa06af50a57f7fff495c2da80573fc0077445d9ca67367'
+ sha256 'd8bdec9c696a70ca88a885fad0d5f1804501921d48ea875ac08e3f5b0a9fe859'
url "http://macdown.uranusjr.com/download/v#{version}/"
appcast 'http://macdown.uranusjr.com/sparkle/macdown/appcast.xml'
| Fix SHA 256 hash for MacDown 0.2.4
|
diff --git a/Casks/shuttle.rb b/Casks/shuttle.rb
index abc1234..def5678 100644
--- a/Casks/shuttle.rb
+++ b/Casks/shuttle.rb
@@ -1,7 +1,7 @@ class Shuttle < Cask
- url 'https://github.com/fitztrev/shuttle/releases/download/v1.1.1/Shuttle.dmg'
+ url 'https://github.com/fitztrev/shuttle/releases/download/v1.1.2/Shuttle.dmg'
homepage 'http://fitztrev.github.io/shuttle/'
- version '1.1.1'
- sha1 '0abd1b042b46d996e5643c21a658ff10877417e6'
+ version '1.1.2'
+ sha1 '70ef2c86f6af51621b165bb642c49d0fecf90d90'
link 'Shuttle.app'
end
| Update Shuttle from version 1.1.1 to 1.1.2
|
diff --git a/GPUImage.podspec b/GPUImage.podspec
index abc1234..def5678 100644
--- a/GPUImage.podspec
+++ b/GPUImage.podspec
@@ -8,7 +8,6 @@ s.source = { :git => 'https://github.com/hyperconnect/GPUImage.git', :branch => "cocoapods" }
s.source_files = 'framework/Source/**/*.{h,m}'
- s.resources = 'framework/Resources/*.png'
s.requires_arc = true
s.xcconfig = { 'CLANG_MODULES_AUTOLINK' => 'YES' }
| Remove resource files from framework
|
diff --git a/SpeedLog.podspec b/SpeedLog.podspec
index abc1234..def5678 100644
--- a/SpeedLog.podspec
+++ b/SpeedLog.podspec
@@ -14,7 +14,11 @@ s.source = { :git => "https://github.com/kostiakoval/SpeedLog.git", :tag => s.version.to_s }
s.social_media_url = 'https://twitter.com/kostiakoval'
- s.platform = :ios, '8.0'
+ s.ios.deployment_target = '8.0'
+ s.osx.deployment_target = '10.9'
+ s.watchos.deployment_target = '2.0'
+ s.tvos.deployment_target = '9.0'
+
s.requires_arc = true
s.source_files = 'SpeedLog/*.swift'
| Add OSX,WatchOS and TVOS to podspec |
diff --git a/script/post_split.rb b/script/post_split.rb
index abc1234..def5678 100644
--- a/script/post_split.rb
+++ b/script/post_split.rb
@@ -0,0 +1,36 @@+new_subject = 'test subject'
+reply_user = 'Throne3d'
+reply_id = 1024
+
+Post.transaction do
+ user = User.find_by(username: reply_user)
+ abort("needs user") unless user
+ reply = Reply.find_by(user_id: user.id, id: reply_id)
+ abort("couldn't find reply") unless reply
+ post = reply.post
+ puts "splitting post #{post.id}: #{post.subject}"
+
+ first_reply = post.replies.where('id > ?', reply.id).order('id asc').first
+ other_replies = post.replies.where('id > ?', first_reply.id).order('id asc')
+ puts "from after reply #{reply.id} (#{first_reply} onwards)"
+ new_post = Post.new
+
+ [:character_id, :icon_id, :character_alias_id, :user_id, :content, :created_at, :updated_at].each do |atr|
+ new_value = first_reply.send(atr)
+ puts "new_post.#{atr} = #{new_value.inspect}"
+ new_post.send(atr.to_s + '=', new_value)
+ end
+
+ [:board_id, :section_id].each do |atr|
+ new_value = post.send(atr)
+ puts "new_post.#{atr} = #{new_value.inspect}"
+ new_post.send(atr.to_s + '=', new_value)
+ end
+ puts "new subject: #{new_subject}"
+ new_post.subject = new_subject
+ new_post.save!
+ puts "new post: https://glowfic.com/posts/#{new_post.id}"
+
+ puts "now updating #{other_replies.count} replies to be in post ID #{new_post.id}"
+ other_replies.update_all(post_id: new_post.id)
+end
| Add basic script for post splitter
|
diff --git a/lib/gitlab_update.rb b/lib/gitlab_update.rb
index abc1234..def5678 100644
--- a/lib/gitlab_update.rb
+++ b/lib/gitlab_update.rb
@@ -13,6 +13,11 @@ end
def exec
+ # Skip update hook for local push when key_id is nil
+ # It required for gitlab instance to make local pushes
+ # without validation of access
+ exit 0 if @key_id.nil?
+
if api.allowed?('git-receive-pack', @repo_name, @key_id, @refname)
exit 0
else
| Allow local pushes without update check
|
diff --git a/Casks/air-connect.rb b/Casks/air-connect.rb
index abc1234..def5678 100644
--- a/Casks/air-connect.rb
+++ b/Casks/air-connect.rb
@@ -6,7 +6,7 @@ name 'Air Connect'
appcast 'http://avatron.com/updates/software/airconnect_mac/appcast.xml',
:sha256 => 'af9bc6dc41bc632995c4e49b958a5623bc091ac0fe1fb337fbc9a571cfc1e85b'
- homepage 'http://www.avatron.com/get-air-connect/'
+ homepage 'https://avatron.com/get-air-connect/'
license :gratis
app 'Air Connect.app'
| Fix homepage to use SSL in Air Connect Cask
The HTTP URL is already getting redirected to HTTPS. Using the HTTPS URL directly
makes it more secure and saves a HTTP round-trip.
|
diff --git a/Casks/sketch-beta.rb b/Casks/sketch-beta.rb
index abc1234..def5678 100644
--- a/Casks/sketch-beta.rb
+++ b/Casks/sketch-beta.rb
@@ -1,8 +1,8 @@ cask :v1 => 'sketch-beta' do
- version '3.2.1'
- sha256 '75be5326ae7c6d639effb112c5a4f7c93e55e786d7c807a01e80a9479455699c'
+ version '3.2.2'
+ sha256 '275633effb38fa6e2d963efaa8a2fa9e614638fff67db89ab34acc1e7a469a8e'
- url 'https://rink.hockeyapp.net/api/2/apps/0172d48cceec171249a8d850fb16276b/app_versions/64?format=zip&avtoken=772f3a4aa948c0f0ffe925c35a81648c8f40d69d'
+ url 'https://rink.hockeyapp.net/api/2/apps/0172d48cceec171249a8d850fb16276b/app_versions/65?format=zip&avtoken=4cf67d09dadfaa99e993df78664101d36228f5c0'
homepage 'http://bohemiancoding.com/sketch/beta/'
license :unknown
| Upgrade Sketch Beta to v3.2.2
|
diff --git a/Casks/tor-browser.rb b/Casks/tor-browser.rb
index abc1234..def5678 100644
--- a/Casks/tor-browser.rb
+++ b/Casks/tor-browser.rb
@@ -2,6 +2,6 @@ url 'https://www.torproject.org/dist/torbrowser/3.5.1/TorBrowserBundle-3.5.1-osx32_en-US.zip'
homepage 'https://www.torproject.org/projects/torbrowser.html'
version '3.5.1'
- sha1 'd155070b90d9244d52663b7fcf4127c8b24f5be5'
+ sha256 '81305a009a1d939621ac1e651d7a1bf6569ff7b714bf3e1cf0b7cd4890f80e3d'
link 'TorBrowserBundle_en-US.app'
end
| Update Tor Browser checksum to SHA256 |
diff --git a/lib/poke/controls.rb b/lib/poke/controls.rb
index abc1234..def5678 100644
--- a/lib/poke/controls.rb
+++ b/lib/poke/controls.rb
@@ -1,5 +1,5 @@ module Poke
-
+ # The +Controls+ controller handles keyboard input from the user.
class Controls
PARAMS_REQUIRED = [:window]
| Add Controls class doc header
|
diff --git a/lib/wkcheck/stats.rb b/lib/wkcheck/stats.rb
index abc1234..def5678 100644
--- a/lib/wkcheck/stats.rb
+++ b/lib/wkcheck/stats.rb
@@ -0,0 +1,38 @@+module WKCheck
+ class Stats
+ def study_queue
+ queue = Wanikani::StudyQueue.queue
+ lessons = queue["lessons_available"]
+ reviews = queue["reviews_available"]
+ next_review_date = Time.at(queue["next_review_date"]).localtime.strftime("%A, %B %-d at %-l:%M %p")
+ queue_message(lessons, reviews, next_review_date)
+ end
+
+ def level_progression
+ progress = Wanikani::Level.progression
+ message = "Your progress for level #{progress["current_level"]}:\n".color(:green)
+ message += progression_message(progress, "radicals")
+ message += progression_message(progress, "kanji")
+ end
+
+ private
+
+ def queue_message(lessons, reviews, next_review_date)
+ if lessons.zero? && reviews.zero?
+ message = "You have no lessons or reviews now! You'll have some more on #{next_review_date.bright}.".color(:green)
+ else
+ lessons_msg = lessons.zero? ? "no".color(:green) : lessons.to_s.color(:red)
+ reviews_msg = reviews.zero? ? "no".color(:green) : reviews.to_s.color(:red)
+ message = "You have #{lessons_msg} lessons pending"
+ message += "\nYou have #{reviews_msg} reviews pending"
+ message += "\nYou have more reviews coming your way on #{next_review_date.bright.color(:green)}." unless reviews.zero?
+ message
+ end
+ end
+
+ def progression_message(progress, group)
+ percent = ((progress["#{group}_progress"].to_f / progress["#{group}_total"].to_f) * 100).round(1).to_s
+ "#{progress["#{group}_progress"]} out of #{progress["#{group}_total"]} #{group.capitalize} (#{percent.bright}%)\n".color(:cyan)
+ end
+ end
+end
| Move WKCheck::Stats into its own file
|
diff --git a/ext/ruby_generator/extconf.rb b/ext/ruby_generator/extconf.rb
index abc1234..def5678 100644
--- a/ext/ruby_generator/extconf.rb
+++ b/ext/ruby_generator/extconf.rb
@@ -1,8 +1,7 @@ unless defined?(JRUBY_VERSION)
begin
require 'mkmf'
-
- include_directory = File.expand_path(File.join(File.dirname(__FILE__), "..", "protobuf-2.4.1", "src"))
+ include_directory = File.expand_path(ENV['PROTOC_SRC'] || File.join(File.dirname(__FILE__), "..", "protobuf-2.4.1", "src"))
$CPPFLAGS << " -I#{include_directory}"
$CPPFLAGS << " -Wall "
| Allow setting protoc source as an environment variable when compiling
|
diff --git a/spec/node/npm_spec.rb b/spec/node/npm_spec.rb
index abc1234..def5678 100644
--- a/spec/node/npm_spec.rb
+++ b/spec/node/npm_spec.rb
@@ -0,0 +1,84 @@+require 'spec_helper'
+
+describe command('npm -v') do
+ its(:exit_status) { should eq 0 }
+end
+
+# Install various popular packages.
+# See https://www.npmjs.com/browse/star for source of some of these
+
+describe command('npm install -g json') do
+ its(:exit_status) { should eq 0 }
+end
+
+describe command('json --version') do
+ its(:exit_status) { should eq 0 }
+end
+
+describe command('npm rm -g json') do
+ its(:exit_status) { should eq 0 }
+end
+
+describe command('which json') do
+ its(:exit_status) { should eq 1 }
+end
+
+describe command('npm install -g gulp-cli') do
+ its(:exit_status) { should eq 0 }
+end
+
+describe command('gulp -h') do
+ its(:exit_status) { should eq 0 }
+end
+
+describe command('npm rm -g gulp-cli') do
+ its(:exit_status) { should eq 0 }
+end
+
+describe command('which gulp') do
+ its(:exit_status) { should eq 1 }
+end
+
+describe command('npm install async') do
+ its(:exit_status) { should eq 0 }
+end
+
+describe command('npm install bunyan') do
+ its(:exit_status) { should eq 0 }
+end
+
+describe command('npm install express') do
+ its(:exit_status) { should eq 0 }
+end
+
+describe command('npm install hapi') do
+ its(:exit_status) { should eq 0 }
+end
+
+describe command('npm install mocha') do
+ its(:exit_status) { should eq 0 }
+end
+
+describe command('npm install moment') do
+ its(:exit_status) { should eq 0 }
+end
+
+describe command('npm install mongoose') do
+ its(:exit_status) { should eq 0 }
+end
+
+describe command('npm install request') do
+ its(:exit_status) { should eq 0 }
+end
+
+describe command('npm install restify') do
+ its(:exit_status) { should eq 0 }
+end
+
+describe command('npm install socket.io') do
+ its(:exit_status) { should eq 0 }
+end
+
+describe command('npm install underscore') do
+ its(:exit_status) { should eq 0 }
+end | Add some tests for npm and packages
|
diff --git a/spec/support/rails.rb b/spec/support/rails.rb
index abc1234..def5678 100644
--- a/spec/support/rails.rb
+++ b/spec/support/rails.rb
@@ -7,10 +7,12 @@ config.active_support.deprecation = :log
if Rails::VERSION::STRING >= "4.0.0"
+ config.eager_load = false
config.secret_token = 'existing secret token'
config.secret_key_base = 'new secret key base'
end
end
end
-RetinaRailsTest::Application.initialize!+
+RetinaRailsTest::Application.initialize!
| Fix Rails deprecation warning about missing config
|
diff --git a/spec/unit/eql_spec.rb b/spec/unit/eql_spec.rb
index abc1234..def5678 100644
--- a/spec/unit/eql_spec.rb
+++ b/spec/unit/eql_spec.rb
@@ -1,32 +1,47 @@ # frozen_string_literal: true
-RSpec.describe TTY::Table, '#eql?' do
- let(:rows) { [['a1', 'a2'], ['b1', 'b2']] }
- let(:object) { described_class.new rows }
+RSpec.describe TTY::Table, "#eql?" do
+ let(:rows) { [%w[a1 a2], %w[b1 b2]] }
- subject { object.eql?(other) }
+ describe "#==" do
+ it "is equivalent with the same table" do
+ object = described_class.new(rows)
+ expect(object).to eq(object)
+ end
- describe '#inspect' do
- it { expect(object.inspect).to match(/#<TTY::Table/) }
- end
+ it "is not equivalent with different table" do
+ expect(described_class.new(rows)).to_not eq(described_class.new(rows))
+ end
- context 'with the same object' do
- let(:other) { object }
-
- it { is_expected.to eql(true) }
-
- it 'is symmetric' do
- is_expected.to eql(other.eql?(object))
+ it "is not equivalent to another type" do
+ expect(described_class.new(rows)).to_not eq(:other)
end
end
- context 'with an equivalent object' do
- let(:other) { object.dup }
+ describe "#eql?" do
+ it "is equal with the same table object" do
+ object = described_class.new(rows)
+ expect(object).to eql(object)
+ end
- it { is_expected.to eql(true) }
+ it "is not equal with different table" do
+ expect(described_class.new(rows)).to_not eql(described_class.new(rows))
+ end
- it 'is symmetric' do
- is_expected.to eql(other.eql?(object))
+ it "is not equal to another type" do
+ expect(described_class.new(rows)).to_not eql(:other)
+ end
+ end
+
+ describe "#inspect" do
+ it "displays object information" do
+ expect(described_class.new(rows).inspect).to match(/#<TTY::Table header=nil rows=\[(.*?)\] orientation=(.*?) original_rows=nil original_columns=nil/)
+ end
+ end
+
+ describe "#hash" do
+ it "calculates object hash" do
+ expect(described_class.new(rows).hash).to be_a_kind_of(Numeric)
end
end
end
| Change to capture table equality behaviour
|
diff --git a/Casks/handbrake.rb b/Casks/handbrake.rb
index abc1234..def5678 100644
--- a/Casks/handbrake.rb
+++ b/Casks/handbrake.rb
@@ -1,6 +1,6 @@ cask :v1 => 'handbrake' do
- version '0.9.9'
- sha256 '050f9d0d3a126b25d24cb4971062d66f4f975317b6586f8c288795c17a0c05f9'
+ version '0.10.0'
+ sha256 'c26a1a37d03c977e0296f0198ce11bf74ee5da8aa410ea3b5eef6449e0aa3c9c'
url "http://handbrake.fr/rotation.php?file=HandBrake-#{version}-MacOSX.6_GUI_x86_64.dmg"
appcast 'http://handbrake.fr/appcast.x86_64.xml',
| Update Handbrake to version 0.10.0
|
diff --git a/db/migrate/20190221195601_change_pg_search_document_id_to_bigint.rb b/db/migrate/20190221195601_change_pg_search_document_id_to_bigint.rb
index abc1234..def5678 100644
--- a/db/migrate/20190221195601_change_pg_search_document_id_to_bigint.rb
+++ b/db/migrate/20190221195601_change_pg_search_document_id_to_bigint.rb
@@ -0,0 +1,13 @@+class ChangePgSearchDocumentIdToBigint < ActiveRecord::Migration[6.0]
+ def up
+ change_column :pg_search_documents, :id, :bigint
+
+ change_column :pg_search_documents, :searchable_id, :bigint
+ end
+
+ def down
+ change_column :pg_search_documents, :id, :integer
+
+ change_column :pg_search_documents, :searchable_id, :integer
+ end
+end
| Update pg_search_document_id primary and foreign keys to bigint
|
diff --git a/uchiwa.gemspec b/uchiwa.gemspec
index abc1234..def5678 100644
--- a/uchiwa.gemspec
+++ b/uchiwa.gemspec
@@ -20,6 +20,8 @@ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.require_paths = ['lib']
+ spec.add_runtime_dependency 'hyperclient'
+
spec.add_development_dependency 'bundler', '~> 1.7'
spec.add_development_dependency 'pry'
spec.add_development_dependency 'rake', '~> 10.0'
| Add hyperclient as runtime dependency
|
diff --git a/spec/unit/mutant/mutator/node/literal/nil_spec.rb b/spec/unit/mutant/mutator/node/literal/nil_spec.rb
index abc1234..def5678 100644
--- a/spec/unit/mutant/mutator/node/literal/nil_spec.rb
+++ b/spec/unit/mutant/mutator/node/literal/nil_spec.rb
@@ -4,9 +4,7 @@ let(:source) { 'nil' }
let(:mutations) do
- mutations = []
-
- mutations << 'Object.new'
+ [ '::Object.new' ]
end
it_should_behave_like 'a mutator'
| Fix literal nil mutator specs
|
diff --git a/db/migrate/20110418123354_remove_project_owner.rb b/db/migrate/20110418123354_remove_project_owner.rb
index abc1234..def5678 100644
--- a/db/migrate/20110418123354_remove_project_owner.rb
+++ b/db/migrate/20110418123354_remove_project_owner.rb
@@ -1,9 +1,13 @@+require 'migration_helpers'
+
class RemoveProjectOwner < ActiveRecord::Migration
+ extend MigrationHelpers
def self.up
+ remove_foreign_key :projects, :users
remove_column :projects, :user_id
end
def self.down
add_column :projects, :user_id, :integer
end
-end
+end | Drop constraint before removing column.
|
diff --git a/Formula/phpunit.rb b/Formula/phpunit.rb
index abc1234..def5678 100644
--- a/Formula/phpunit.rb
+++ b/Formula/phpunit.rb
@@ -2,10 +2,12 @@
class Phpunit < Formula
homepage 'http://phpunit.de/manual/current/en/'
- url 'http://pear.phpunit.de/get/phpunit-3.7.24.phar'
- sha1 'de677ba60b2ccd135002d02501cde16a471503f5'
+ url 'https://github.com/sebastianbergmann/phpunit/releases/download/3.7.27/phpunit.phar'
+ sha1 'dc693b34a62644f61cfc01a22d9654ff4b8764af'
+ version '3.7.27'
def install
+ mv "phpunit.phar", "phpunit-#{version}.phar"
libexec.install "phpunit-#{version}.phar"
sh = libexec + "phpunit"
sh.write("#!/usr/bin/env bash\n\n/usr/bin/env php -d allow_url_fopen=On -d detect_unicode=Off #{libexec}/phpunit-#{version}.phar $*")
| Upgrade PHPUnit from 3.7.24 to 3.7.27
|
diff --git a/app/classes/query/species_list_pattern_search.rb b/app/classes/query/species_list_pattern_search.rb
index abc1234..def5678 100644
--- a/app/classes/query/species_list_pattern_search.rb
+++ b/app/classes/query/species_list_pattern_search.rb
@@ -0,0 +1,20 @@+class Query::SpeciesListPatternSearch < Query::SpeciesList
+ include Query::Initializers::PatternSearch
+
+ def parameter_declarations
+ super.merge(
+ pattern: :string
+ )
+ end
+
+ def initialize_flavor
+ search = google_parse_pattern
+ add_search_conditions(search,
+ "species_lists.title",
+ "COALESCE(species_lists.notes,'')",
+ "IF(locations.id,locations.name,species_lists.where)"
+ )
+ add_join(:locations!)
+ super
+ end
+end
| Complete SpeciesList subclass query definitions
Add SpeciesListPatternSearch
|
diff --git a/app/jobs/email_duplicate_signatures_email_job.rb b/app/jobs/email_duplicate_signatures_email_job.rb
index abc1234..def5678 100644
--- a/app/jobs/email_duplicate_signatures_email_job.rb
+++ b/app/jobs/email_duplicate_signatures_email_job.rb
@@ -9,10 +9,10 @@ def perform(signature)
if rate_limit.exceeded?(signature)
signature.fraudulent!
- else
- mailer.send(email, signature).deliver_now
- Signature.increment_counter(:email_count, signature.id)
end
+
+ mailer.send(email, signature).deliver_now
+ Signature.increment_counter(:email_count, signature.id)
end
private
| Send duplicate email message to fraudulent signatures too
|
diff --git a/app/models/jellyfish_demo/product_type/server.rb b/app/models/jellyfish_demo/product_type/server.rb
index abc1234..def5678 100644
--- a/app/models/jellyfish_demo/product_type/server.rb
+++ b/app/models/jellyfish_demo/product_type/server.rb
@@ -6,7 +6,7 @@
transaction do
[
- set('Server Instance', '11ca0e0e-617d-45f3-b10a-acf42d5e6ecc', provider_type: 'JellyfishDemo::Provider::Demo', active: 'false')
+ set('Demo Instance', '11ca0e0e-617d-45f3-b10a-acf42d5e6ecc', provider_type: 'JellyfishDemo::Provider::Demo', active: 'false')
].each do |s|
create! s.merge!(type: 'JellyfishDemo::ProductType::Server')
end
@@ -14,7 +14,7 @@ end
def description
- 'Server Instance'
+ 'Demo Instance'
end
def tags
| Make description more generic for product type
|
diff --git a/app/controllers/backend/cells/quandl_cells_controller.rb b/app/controllers/backend/cells/quandl_cells_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/backend/cells/quandl_cells_controller.rb
+++ b/app/controllers/backend/cells/quandl_cells_controller.rb
@@ -5,7 +5,7 @@ finish = start >> 12 - 1
#params[:threshold] = 183.50
dataset = params[:dataset] || "CHRIS/LIFFE_EBM4"
- token = Identifier.where(nature: :quandl_token).first || "BwQESxTYjPRj58EbvzQA"
+ token = Identifier.where(nature: :quandl_token).first.value || "BwQESxTYjPRj58EbvzQA"
url = "https://www.quandl.com/api/v1/datasets/#{dataset}.json?auth_token=#{token}&trim_start=#{start}&trim_end=#{finish}"
url = "https://www.quandl.com/api/v1/datasets/#{dataset}.json?auth_token=#{token}"
data = JSON.load(open(url))
| Fix token value in quandl cell
|
diff --git a/lib/rails/generators/dragonfly/dragonfly_generator.rb b/lib/rails/generators/dragonfly/dragonfly_generator.rb
index abc1234..def5678 100644
--- a/lib/rails/generators/dragonfly/dragonfly_generator.rb
+++ b/lib/rails/generators/dragonfly/dragonfly_generator.rb
@@ -8,7 +8,7 @@ private
def generate_secret
- rand(1e32).to_s(36)
+ SecureRandom.hex(36)
end
if RUBY_VERSION > "1.9"
| Replace rand function with more secure SecureRandom.hex
Standard rand function can be predictable under some edge cases or if running the function multiple times. |
diff --git a/lib/sync_checker/formats/document_collection_check.rb b/lib/sync_checker/formats/document_collection_check.rb
index abc1234..def5678 100644
--- a/lib/sync_checker/formats/document_collection_check.rb
+++ b/lib/sync_checker/formats/document_collection_check.rb
@@ -0,0 +1,45 @@+module SyncChecker
+ module Formats
+ class DocumentCollectionCheck < EditionBase
+ def root_path
+ "/government/collections/"
+ end
+
+ def rendering_app
+ Whitehall::RenderingApp::WHITEHALL_FRONTEND
+ end
+
+ def checks_for_live(locale)
+ super
+ end
+
+ def expected_details_hash(edition)
+ super.merge(
+ collection_groups: collection_groups(edition)
+ )
+ end
+
+ private
+
+ def top_level_fields_hash(edition, locale)
+ super.merge(
+ { first_published_at: edition.first_published_at }
+ )
+ end
+
+ def collection_groups(edition)
+ edition.groups.map do |group|
+ {
+ title: group.heading,
+ body: govspeak_renderer.govspeak_to_html(group.body),
+ documents: group.documents.collect(&:content_id)
+ }.stringify_keys
+ end
+ end
+
+ def govspeak_renderer
+ @govspeak_renderer ||= Whitehall::GovspeakRenderer.new
+ end
+ end
+ end
+end
| Add initial DocumentCollection sync check
|
diff --git a/spec/features/course/admin/announcement_settings_spec.rb b/spec/features/course/admin/announcement_settings_spec.rb
index abc1234..def5678 100644
--- a/spec/features/course/admin/announcement_settings_spec.rb
+++ b/spec/features/course/admin/announcement_settings_spec.rb
@@ -0,0 +1,31 @@+require 'rails_helper'
+
+RSpec.feature 'Course: Administration: Announcement' do
+ let!(:instance) { create(:instance) }
+
+ with_tenant(:instance) do
+ let(:user) { create(:administrator) }
+ let(:course) { create(:course, creator: user) }
+
+ context 'As a Course Administrator' do
+ before { login_as(user, scope: :user) }
+
+ scenario 'I can change the announcement pagination settings' do
+ visit course_admin_announcements_path(course)
+
+ invalid_pagination_count = -1
+ valid_pagination_count = 100
+
+ fill_in 'announcement_settings_pagination', with: invalid_pagination_count
+ click_button 'update'
+ expect(page).to have_css('div.has-error')
+
+ fill_in 'announcement_settings_pagination', with: valid_pagination_count
+ click_button 'update'
+ expect(page).
+ to have_selector('div', text: I18n.t('course.admin.announcement_settings.update.success'))
+ expect(page).to have_field('announcement_settings_pagination', with: valid_pagination_count)
+ end
+ end
+ end
+end
| Add specs for announcement settings
|
diff --git a/spec/192.168.8.6/network_spec.rb b/spec/192.168.8.6/network_spec.rb
index abc1234..def5678 100644
--- a/spec/192.168.8.6/network_spec.rb
+++ b/spec/192.168.8.6/network_spec.rb
@@ -5,6 +5,5 @@ end
describe host('192.168.8.7') do
- # ping
it { should be_reachable }
end
| Delete comment which is as same as the code
|
diff --git a/spec/build/job/test/perl_spec.rb b/spec/build/job/test/perl_spec.rb
index abc1234..def5678 100644
--- a/spec/build/job/test/perl_spec.rb
+++ b/spec/build/job/test/perl_spec.rb
@@ -21,7 +21,7 @@ job.install.should == 'perl Makefile.PL && make test'
end
end
- end
+
context "when project uses neither Build.PL nor Makefile.PL" do
it 'returns "make test"' do
job.expects(:uses_module_build?).returns(false)
@@ -30,5 +30,4 @@ end
end
end
-
end
| Correct syntax error in the Perl builder spec
|
diff --git a/app/controllers/api/sign_ins_controller.rb b/app/controllers/api/sign_ins_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/api/sign_ins_controller.rb
+++ b/app/controllers/api/sign_ins_controller.rb
@@ -1,6 +1,12 @@ module Api
class SignInsController < BaseController
skip_before_action :authenticate!
+
+ def create
+ build_resource
+
+ resource.save!
+ end
private
| Fix api sign ins controller
|
diff --git a/app/views/spree/products/index.rss.builder b/app/views/spree/products/index.rss.builder
index abc1234..def5678 100644
--- a/app/views/spree/products/index.rss.builder
+++ b/app/views/spree/products/index.rss.builder
@@ -1,15 +1,15 @@-xml.instruct! :xml, :version=>"1.0"
+xml.instruct! :xml, :version=>"1.0"
xml.rss(:version=>"2.0", "xmlns:g" => "http://base.google.com/ns/1.0"){
xml.channel{
- xml.title("#{Spree::Config[:site_name]}")
- xml.link("http://#{Spree::Config[:site_url]}")
- xml.description("Find out about new products on http://#{Spree::Config[:site_url]} first!")
+ xml.title(current_store.name)
+ xml.link("http://#{current_store.url}")
+ xml.description("Find out about new products on http://#{current_store.url} first!")
xml.language('en-us')
@products.each do |product|
xml.item do
xml.title(product.name)
xml.description((product.images.count > 0 ? link_to(image_tag(product.images.first.attachment.url(:product)), product_url(product)) : '') + simple_format(product.description))
- xml.author(Spree::Config[:site_url])
+ xml.author(current_store.url)
xml.pubDate((product.available_on || product.created_at).strftime("%a, %d %b %Y %H:%M:%S %z"))
xml.link(product_url(product))
xml.guid(product.id)
| Replace deprecated spree config props
These configs no longer work, but we have helpers to do the same.
|
diff --git a/spec/factories/drop.rb b/spec/factories/drop.rb
index abc1234..def5678 100644
--- a/spec/factories/drop.rb
+++ b/spec/factories/drop.rb
@@ -3,6 +3,9 @@ sequence(:title) { |n| "Title #{n}"}
sequence(:sc_track) { |n| n }
sequence(:sc_user_id) { |n| n }
+ latitude 53.5
+ longitude 13.7
+
trait :with_place do
place # association :place, factory: :place
| Add lat and long to the factories
|
diff --git a/spec/machete/dsl/pattern_spec.rb b/spec/machete/dsl/pattern_spec.rb
index abc1234..def5678 100644
--- a/spec/machete/dsl/pattern_spec.rb
+++ b/spec/machete/dsl/pattern_spec.rb
@@ -0,0 +1,17 @@+require "spec_helper"
+
+describe "patterns" do
+ describe "method name" do
+ it "returns true when method name is equal" do
+ Machete.matches?('find_by_id'.to_ast, 'Send<name = :find_by_id>').should be_true
+ end
+
+ it "returns true when method name begins with find" do
+ Machete.matches?('find_by_id'.to_ast, 'Send<name ^= :find>').should be_true
+ end
+
+ it "return false when method name does not begin with find" do
+ Machete.matches?('find_by_id'.to_ast, 'Send<name ^= :_find>').should be_false
+ end
+ end
+end | Add pattern spec for method name regexp
|
diff --git a/app/serializers/avatar_serializer.rb b/app/serializers/avatar_serializer.rb
index abc1234..def5678 100644
--- a/app/serializers/avatar_serializer.rb
+++ b/app/serializers/avatar_serializer.rb
@@ -1,7 +1,13 @@ class AvatarSerializer < ApplicationSerializer
attributes :username, :avatar_url
+ attributes :url
def avatar_url
object.avatar.url(288).to_s
end
+
+ def url
+ user_path(object)
+ end
+
end
| Add links to core team avatars.
|
diff --git a/spec/ubuntu/corepackages_spec.rb b/spec/ubuntu/corepackages_spec.rb
index abc1234..def5678 100644
--- a/spec/ubuntu/corepackages_spec.rb
+++ b/spec/ubuntu/corepackages_spec.rb
@@ -36,3 +36,6 @@ it { should be_installed }
end
+describe package('whiptail') do
+ it { should be_installed }
+end
| Make sure whiptail is installed
|
diff --git a/rptman.gemspec b/rptman.gemspec
index abc1234..def5678 100644
--- a/rptman.gemspec
+++ b/rptman.gemspec
@@ -3,13 +3,6 @@ spec.version = `git describe`.strip.split('-').first
spec.authors = ['Peter Donald']
spec.email = ["peter@realityforge.org"]
- spec.homepage = "http://github.com/realityforge/buildr-bnd"
- spec.summary = "Buildr extension for packaging OSGi bundles using bnd"
- spec.description = <<-TEXT
-This is a buildr extension for packaging OSGi bundles using Bnd.
- TEXT
- spec.files = Dir['{lib,spec}/**/*', '*.gemspec'] +
- ['LICENSE', 'README.rdoc', 'CHANGELOG', 'Rakefile']
spec.homepage = "http://github.com/stocksoftware/rptman"
spec.summary = "Tool for managing SSRS reports"
| Remove cruft from other gem
|
diff --git a/Casks/postbox.rb b/Casks/postbox.rb
index abc1234..def5678 100644
--- a/Casks/postbox.rb
+++ b/Casks/postbox.rb
@@ -1,11 +1,25 @@ cask :v1 => 'postbox' do
- version :latest
- sha256 :no_check
+ version '4.0.0'
+ sha256 '50502ad03e12366d5fbc7c9624a53dc7dfb9b1b3c23d72cd05a694a2b79f48ec'
- url 'http://www.postbox-inc.com/php/download.php?a=3011m'
+ # amazonaws.com is the official download host per the vendor homepage
+ url "https://s3.amazonaws.com/download.getpostbox.com/installers/#{version}/2_08c63331d92b59d2d99abea0a6eae8c0/postbox-#{version}-mac64.dmg"
name 'Postbox'
homepage 'http://www.postbox-inc.com/'
- license :unknown # todo: change license and remove this comment; ':unknown' is a machine-generated placeholder
+ license :commercial
+ tags :vendor => 'Postbox'
+ depends_on :macos => '>= :mavericks'
+ depends_on :arch => :x86_64
app 'Postbox.app'
+
+ zap :delete => [
+ '~/Library/Application Support/Postbox',
+ '~/Library/Caches/com.crashlytics.data/com.postbox-inc.postbox',
+ '~/Library/Caches/com.postbox-inc.postbox',
+ '~/Library/Caches/Postbox',
+ '~/Library/PDF Services/Mail PDF with Postbox',
+ '~/Library/Preferences/com.postbox-inc.postbox.plist',
+ '~/Library/Saved Application State/com.postbox-inc.postbox.savedState',
+ ]
end
| Update Postbox.app to 4.0.0, add stanzas
added comment per note in #11150: https://github.com/caskroom/homebrew-cask/pull/11150/files#r30196521
|
diff --git a/Casks/cog.rb b/Casks/cog.rb
index abc1234..def5678 100644
--- a/Casks/cog.rb
+++ b/Casks/cog.rb
@@ -3,6 +3,7 @@ sha256 '1cc55f718a15810cccc5141312c01079e1da230a2412e4bc66c172de7aee36fe'
# the stable package on sourceforge is a bzip-inside-bzip that we can't handle
+
url "http://cogx.org/nightly_builds/cog-#{version}.tbz"
appcast 'http://mamburu.net/cog/stable.xml',
checkpoint: 'f5770d73ad0c4a19af24cf25195c01d1cc05b937a79416fe82ead0949beee62e'
| Fix `url` stanza comment for Cog.
|
diff --git a/Chelu/c62.rb b/Chelu/c62.rb
index abc1234..def5678 100644
--- a/Chelu/c62.rb
+++ b/Chelu/c62.rb
@@ -0,0 +1,21 @@+# Given a list of lists of strings such as:
+# {("a1", "a2"),
+# ("b1")
+# ("c1", "c2", "c3")}
+# Print them in this order: "a1", "b1", "c1", "a2", "c2", "c3"
+#
+# Again choice of data structure makes or breaks this problem.
+#
+
+a= [["a1", "a2"],
+ ["b1"],
+ ["c1", "c2", "c3"]]
+
+result = []
+a.map{ |x| x.size }.max.times do
+ a.each do |x|
+ result << x.shift unless !x.any?
+ end
+end
+
+puts result.inspect
| Print them in the order ^_^
|
diff --git a/Formula/shared-desktop-ontologies.rb b/Formula/shared-desktop-ontologies.rb
index abc1234..def5678 100644
--- a/Formula/shared-desktop-ontologies.rb
+++ b/Formula/shared-desktop-ontologies.rb
@@ -1,9 +1,9 @@ require 'formula'
class SharedDesktopOntologies <Formula
- url 'http://downloads.sourceforge.net/project/oscaf/shared-desktop-ontologies/0.2/shared-desktop-ontologies-0.2.tar.bz2'
+ url 'http://downloads.sourceforge.net/project/oscaf/shared-desktop-ontologies/0.5/shared-desktop-ontologies-0.5.tar.bz2'
homepage 'http://sourceforge.net/apps/trac/oscaf/'
- md5 '6c004e1c377f768cae5b321bc111876b'
+ md5 '067ec9023c4a48e0d53fb15484d78971'
depends_on 'cmake' => :build
| Update Shared Desktop Ontologies to 0.5.
|
diff --git a/lib/vagrant-ca-certificates/cap/redhat/helpers.rb b/lib/vagrant-ca-certificates/cap/redhat/helpers.rb
index abc1234..def5678 100644
--- a/lib/vagrant-ca-certificates/cap/redhat/helpers.rb
+++ b/lib/vagrant-ca-certificates/cap/redhat/helpers.rb
@@ -7,7 +7,7 @@ # bundles must be managed manually.
def self.legacy_certificate_bundle?(sh)
command = %q(R=$(sed -E "s/.* ([0-9])\.([0-9]+) .*/\\1.\\2/" /etc/redhat-release))
- sh.test(%Q(#{command} && [[ $R =~ ^5 || $R =~ ^6\.[0-4]+ ]]), shell: '/bin/bash')
+ sh.test(%Q(#{command} && [[ $R =~ ^5 || $R =~ ^6\.[0-4]+ ]]), shell: '/bin/bash') || !sh.test("rpm -q --verify --nomtime ca-certificates", shell:'/bin/bash')
end
end
end
| Add additional check for legacy cerificate bundle
|
diff --git a/lib/backlog_kit/client/git.rb b/lib/backlog_kit/client/git.rb
index abc1234..def5678 100644
--- a/lib/backlog_kit/client/git.rb
+++ b/lib/backlog_kit/client/git.rb
@@ -1,6 +1,13 @@ module BacklogKit
class Client
+
+ # Methods for the Git API
module Git
+
+ # Get list of git repositories
+ #
+ # @param project_id_or_key [Integer, String] Project id or project key
+ # @return [BacklogKit::Response] List of git repositories
def get_git_repositories(project_id_or_key)
get('git/repositories', project_id_or_key: project_id_or_key)
end
| Add documentation for the Git API
|
diff --git a/bundler/benchmarks/bm_bundle_exec_shell.rb b/bundler/benchmarks/bm_bundle_exec_shell.rb
index abc1234..def5678 100644
--- a/bundler/benchmarks/bm_bundle_exec_shell.rb
+++ b/bundler/benchmarks/bm_bundle_exec_shell.rb
@@ -0,0 +1,19 @@+require_relative 'support/benchmark_bundler.rb'
+require 'bundler/cli'
+
+noop_gem = Pathname(__FILE__).expand_path + '../gems/noop-gem'
+
+Dir.mktmpdir do |dir|
+ Dir.chdir(dir) do
+ File.write('Gemfile', <<-GEMFILE)
+ source 'https://rubygems.org'
+ gem 'rails'
+ gem 'noop-gem', path: '#{noop_gem}'
+ GEMFILE
+ system("bundle install --quiet")
+
+ Benchmark.do_benchmark('bundle exec shell') do
+ system("bundle exec 'noop-gem foo bar'")
+ end
+ end
+end
| Add a bundle exec benchmark that uses a shell
|
diff --git a/Casks/jabref.rb b/Casks/jabref.rb
index abc1234..def5678 100644
--- a/Casks/jabref.rb
+++ b/Casks/jabref.rb
@@ -1,7 +1,7 @@ class Jabref < Cask
- url 'http://downloads.sourceforge.net/project/jabref/jabref/2.9.2/JabRef-2.9.2-OSX.zip'
+ url 'http://downloads.sourceforge.net/project/jabref/jabref/2.10/JabRef-2.10-OSX.zip'
homepage 'http://jabref.sourceforge.net/'
- version '2.9.2'
- sha256 'f4e6b74e87cf56e3d8a09228c2876588fff2fa152f9d033fb11c7b0d1bc2b40b'
+ version '2.10'
+ sha256 'c63a49e47a43bdb026dde7fb695210d9a3f8c0e71445af7d6736c5379b23baa2'
link 'JabRef.app'
end
| Update of JabRef to version 2.10 |
diff --git a/Casks/jubler.rb b/Casks/jubler.rb
index abc1234..def5678 100644
--- a/Casks/jubler.rb
+++ b/Casks/jubler.rb
@@ -0,0 +1,7 @@+class Jubler < Cask
+ url 'http://jubler.googlecode.com/files/Jubler-4.6.1.dmg'
+ homepage 'http://www.jubler.org/'
+ version '4.6.1'
+ sha1 'ad61a8e19c05f5491be7cc192cf9d6e43386ff49'
+ link :app, 'Jubler.app'
+end
| Add Jubler (Version 4.6.1) Cask
|
diff --git a/PFIncrementalStore.podspec b/PFIncrementalStore.podspec
index abc1234..def5678 100644
--- a/PFIncrementalStore.podspec
+++ b/PFIncrementalStore.podspec
@@ -16,5 +16,6 @@
s.requires_arc = true
- s.dependency 'Parse-iOS-SDK'
-end+ s.ios.dependency 'Parse-iOS-SDK'
+ s.osx.dependency 'Parse-OSX-SDK'
+end
| Use Proper Dependencies in Podspec
We're currently using the Parse iOS SDK on both the iOS and OS X
platform, however we should be using the appropriate SDKS for the
platforms.
[#2]
|
diff --git a/lib/pacto/contract_factory.rb b/lib/pacto/contract_factory.rb
index abc1234..def5678 100644
--- a/lib/pacto/contract_factory.rb
+++ b/lib/pacto/contract_factory.rb
@@ -1,9 +1,10 @@ module Pacto
class ContractFactory
- attr_reader :preprocessor
+ attr_reader :preprocessor, :schema
def initialize(options = {})
@preprocessor = options[:preprocessor] || NoOpProcessor.new
+ @schema = options[:schema] || MetaSchema.new
end
def build_from_file(contract_path, host)
@@ -13,10 +14,6 @@ request = Request.new(host, definition['request'])
response = Response.new(definition['response'])
Contract.new(request, response, contract_path)
- end
-
- def schema
- @schema ||= MetaSchema.new
end
def load(contract_name, host = nil)
| Move factory schema config to initialization
|
diff --git a/features/step_definitions/price_paid_stated_step_definitions.rb b/features/step_definitions/price_paid_stated_step_definitions.rb
index abc1234..def5678 100644
--- a/features/step_definitions/price_paid_stated_step_definitions.rb
+++ b/features/step_definitions/price_paid_stated_step_definitions.rb
@@ -15,9 +15,10 @@ latest_price_paid_stated = @title[:price_paid_stated]
label_index = page.all(:css, '#property-summary > dt').map(&:text).find_index('Price paid/stated')
price_stated = page.all(:css, '#property-summary > dd')[label_index].text
- expect(price_stated).to be latest_price_paid_stated[:text]
+ expect(price_stated).to eq latest_price_paid_stated[:text]
end
Then(/^I don't see 'not available' in the price paid or stated part of the summary$/) do
+ expect(content).to have_no_content 'Price paid/stated'
expect(content).to have_no_content 'not available'
end
| Check that price paid/stated label not there if no price paid/stated
|
diff --git a/penning.rb b/penning.rb
index abc1234..def5678 100644
--- a/penning.rb
+++ b/penning.rb
@@ -1,8 +1,8 @@-require 'sinatra'
+require 'sinatra/base'
require 'sinatra/asset_pipeline'
require 'i18n'
-I18n.load_path += Dir[File.join(File.dirname(__FILE__), 'config/locales', '*.yml').to_s]
+I18n.load_path += Dir[File.join(File.dirname(__FILE__), 'config/locales', '*.yml')]
require_relative 'helpers/url_helper'
| Update require statement, remove extraneous to_s call
|
diff --git a/lib/cellular/models/sms.rb b/lib/cellular/models/sms.rb
index abc1234..def5678 100644
--- a/lib/cellular/models/sms.rb
+++ b/lib/cellular/models/sms.rb
@@ -16,14 +16,7 @@ end
def deliver
- @delivery_status, @delivery_message = @backend.deliver(
- recipient: @recipient,
- sender: @sender,
- price: @price,
- country_code: @country_code,
- message: @message
- )
-
+ @delivery_status, @delivery_message = @backend.deliver options
@delivered = true
end
| Refactor SMS.deliver to use SMS.options |
diff --git a/lib/celluloid/responses.rb b/lib/celluloid/responses.rb
index abc1234..def5678 100644
--- a/lib/celluloid/responses.rb
+++ b/lib/celluloid/responses.rb
@@ -2,22 +2,22 @@ # Responses to calls
class Response
attr_reader :call, :value
-
+
def initialize(call, value)
@call, @value = call, value
end
end
-
+
# Call completed successfully
class SuccessResponse < Response; end
-
+
# Call was aborted due to caller error
class ErrorResponse < Response
def value
if super.is_a? AbortError
# Aborts are caused by caller error, so ensure they capture the
# caller's backtrace instead of the receiver's
- raise super.cause.class.new(super.cause.message)
+ raise super.cause.exception(super.cause.message)
else
raise super
end
| [BUGFIX] Maintain instance variables when raising an aborted exception in the caller context |
diff --git a/Library/Homebrew/formula_support.rb b/Library/Homebrew/formula_support.rb
index abc1234..def5678 100644
--- a/Library/Homebrew/formula_support.rb
+++ b/Library/Homebrew/formula_support.rb
@@ -14,6 +14,10 @@ case @reason
when :provided_pre_mountain_lion
MacOS.version < :mountain_lion
+ when :provided_until_xcode43
+ MacOS::Xcode.version < "4.3"
+ when :provided_until_xcode5
+ MacOS::Xcode.version < "5.0"
else
true
end
@@ -32,6 +36,10 @@
#{@explanation}
EOS
+ when :provided_until_xcode43
+ "Xcode provides this software prior to version 4.3.\n\n#{explanation}"
+ when :provided_until_xcode5
+ "Xcode provides this software prior to version 5.\n\n#{explanation}"
else
@reason
end.strip
| Add keg-only reason symbols for Xcode 4.3 and Xcode 5
Closes Homebrew/homebrew#28095.
|
diff --git a/lib/dm-is-state_machine.rb b/lib/dm-is-state_machine.rb
index abc1234..def5678 100644
--- a/lib/dm-is-state_machine.rb
+++ b/lib/dm-is-state_machine.rb
@@ -16,11 +16,9 @@
# Include the plugin in Resource
module DataMapper
- module Resource
- module ClassMethods
- include DataMapper::Is::StateMachine
- end # module ClassMethods
- end # module Resource
+ module Model
+ include DataMapper::Is::StateMachine
+ end # module Model
end # module DataMapper
# An alternative way to do the same thing as above:
| Change usage of DataMapper::Resource::ClassMethods to use Model
|
diff --git a/app/helpers/facets_helper.rb b/app/helpers/facets_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/facets_helper.rb
+++ b/app/helpers/facets_helper.rb
@@ -8,11 +8,6 @@ @response.facet_counts["facet_fields"].keys
end
- def facet_field_labels
- # Blacklight reports this as DEPRECATED
- Hash[facet_field_names.map {|f| [f,f.titleize]}]
- end
-
def facet_configuration_for_field(field)
Blacklight::Configuration::FacetField.new(:field => field, :label => field.titleize)
end
| Remove unnecessary, deprecated overridden method
|
diff --git a/lib/dmm-crawler/ranking.rb b/lib/dmm-crawler/ranking.rb
index abc1234..def5678 100644
--- a/lib/dmm-crawler/ranking.rb
+++ b/lib/dmm-crawler/ranking.rb
@@ -34,7 +34,7 @@ end
def discriminate_submedia(submedia)
- return submedia if %w(all weekly cg game voice).include?(submedia)
+ return submedia if %w(all comic cg game voice).include?(submedia)
raise TypeError
end
end
| Fix the code for chech an argument
|
diff --git a/app/controllers/exam_authorization_requests_controller.rb b/app/controllers/exam_authorization_requests_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/exam_authorization_requests_controller.rb
+++ b/app/controllers/exam_authorization_requests_controller.rb
@@ -2,6 +2,7 @@
before_action :set_registration!
before_action :verify_registration_opened!
+ before_action :verify_registration_in_current_organization!
def create
authorization_request = @registration.authorization_requests.find_or_create_by! user: current_user do |it|
@@ -30,6 +31,10 @@ @registration = ExamRegistration.find(authorization_request_params[:exam_registration_id])
end
+ def verify_registration_in_current_organization!
+ raise Mumuki::Domain::NotFoundError unless @registration.organization == Organization.current
+ end
+
def verify_registration_opened!
raise Mumuki::Domain::GoneError if @registration.ended?
end
| Fix issue with invalid organization
|
diff --git a/lib/fastlane/new_action.rb b/lib/fastlane/new_action.rb
index abc1234..def5678 100644
--- a/lib/fastlane/new_action.rb
+++ b/lib/fastlane/new_action.rb
@@ -31,10 +31,9 @@ Helper.log.info "Created new action file '#{path}'. Edit it to implement your custom action.".green
end
- private
-
def self.name_valid?(name)
name == name.downcase && name.length > 0 && !name.include?('.')
end
+ private_class_method :name_valid?
end
end
| Fix useless private access modifier
|
diff --git a/lib/fieldhand/datestamp.rb b/lib/fieldhand/datestamp.rb
index abc1234..def5678 100644
--- a/lib/fieldhand/datestamp.rb
+++ b/lib/fieldhand/datestamp.rb
@@ -6,7 +6,7 @@ class Datestamp
def self.parse(datestamp)
if datestamp.size == 10
- ::Date.xmlschema(datestamp)
+ ::Date.strptime(datestamp)
else
::Time.xmlschema(datestamp)
end
@@ -14,8 +14,9 @@
def self.unparse(datestamp)
return datestamp if datestamp.is_a?(::String)
+ return datestamp.xmlschema if datestamp.respond_to?(:xmlschema)
- datestamp.xmlschema
+ datestamp.strftime
end
end
end
| Support date parsing in older Rubies
Date did not gain xmlschema parsing and formatting until Ruby 1.9.1 but
the same can be achieved through strptime and strftime.
|
diff --git a/lib/hirb/views/mongo_db.rb b/lib/hirb/views/mongo_db.rb
index abc1234..def5678 100644
--- a/lib/hirb/views/mongo_db.rb
+++ b/lib/hirb/views/mongo_db.rb
@@ -1,6 +1,9 @@ module Hirb::Views::MongoDb #:nodoc:
def mongoid__document_view(obj)
- {:fields=>['_id'] + obj.class.fields.keys}
+ fields = obj.class.fields.keys
+ fields.delete('_id')
+ fields.unshift('_id')
+ {:fields=>fields}
end
def mongo_mapper__document_view(obj)
@@ -11,4 +14,4 @@ alias_method :mongo_mapper__embedded_document_view, :mongo_mapper__document_view
end
-Hirb::DynamicView.add Hirb::Views::MongoDb, :helper=>:auto_table+Hirb::DynamicView.add Hirb::Views::MongoDb, :helper=>:auto_table
| Remove duplicate _id field in mongoid
|
diff --git a/spec/weary/middleware/basic_auth_spec.rb b/spec/weary/middleware/basic_auth_spec.rb
index abc1234..def5678 100644
--- a/spec/weary/middleware/basic_auth_spec.rb
+++ b/spec/weary/middleware/basic_auth_spec.rb
@@ -10,12 +10,12 @@ end
it_behaves_like "a Rack application" do
- subject { described_class.new(@request, ["mwunsch", "secret"]) }
+ subject { described_class.new(@request, "mwunsch", "secret") }
let(:env) { @request.env }
end
it "prepares the Authorization header for the request" do
- middleware = described_class.new(@request, ["mwunsch", "secret"])
+ middleware = described_class.new(@request, "mwunsch", "secret")
middleware.call(@request.env)
a_request(:get, @url).should have_been_made
end
| Fix spec failures in Jruby 1.9 mode
|
diff --git a/cookbooks/percona_mysql/recipes/default.rb b/cookbooks/percona_mysql/recipes/default.rb
index abc1234..def5678 100644
--- a/cookbooks/percona_mysql/recipes/default.rb
+++ b/cookbooks/percona_mysql/recipes/default.rb
@@ -16,6 +16,8 @@ # See the License for the specific language governing permissions and
# limitations under the License.
#
+
+include_recipe "apt"
template "/etc/apt/sources.list.d/my_sources.list" do
variables :version => node['lsb']['codename']
| Fix percona recipe by including apt recipe
|
diff --git a/lib/fastly-rails.rb b/lib/fastly-rails.rb
index abc1234..def5678 100644
--- a/lib/fastly-rails.rb
+++ b/lib/fastly-rails.rb
@@ -7,23 +7,22 @@
attr_reader :client, :configuration
- def configuration
+ def self.configuration
@configuration ||= Configuration.new
end
- def configure
+ def self.configure
yield configuration if block_given?
end
- def client
- raise NoAuthCredentialsProvidedError unless configuration.authenticatable?
- @client ||= Client.new(
- :api_key => configuration.api_key,
- :user => configuration.user,
- :password => configuration.password,
- )
+ def self.client
+ raise NoAuthCredentialsProvidedError unless configuration.authenticatable?
+
+ @client ||= Client.new(
+ :api_key => configuration.api_key,
+ :user => configuration.user,
+ :password => configuration.password,
+ )
end
- extend self
-
end
| Use `self.method` instead of `extend self`
|
diff --git a/app/decorators/gobierto_people/person_term_decorator.rb b/app/decorators/gobierto_people/person_term_decorator.rb
index abc1234..def5678 100644
--- a/app/decorators/gobierto_people/person_term_decorator.rb
+++ b/app/decorators/gobierto_people/person_term_decorator.rb
@@ -0,0 +1,38 @@+# frozen_string_literal: true
+
+module GobiertoPeople
+ class PersonTermDecorator < BaseDecorator
+ def initialize(term)
+ @object = term
+ end
+
+ def people
+ return GobiertoPeople::Person.none unless association_with_people
+ GobiertoPeople::Person.where(association_with_people => object)
+ end
+
+ def events
+ collections_table = GobiertoCommon::Collection.table_name
+ site.events.distinct.includes(:collection).where(collections_table => { container: people })
+ end
+
+ def site
+ @site ||= object.vocabulary.site
+ end
+
+ protected
+
+ def association_with_people
+ @association_with_people ||= begin
+ return unless people_settings.present?
+ GobiertoPeople::Person.vocabularies.find do |_, setting|
+ people_settings.send(setting).to_i == object.vocabulary_id.to_i
+ end&.first
+ end
+ end
+
+ def people_settings
+ @people_settings ||= site.gobierto_people_settings
+ end
+ end
+end
| Define PersonTermDecorator for association of people with political_groups vocabulary
|
diff --git a/app/presenters/api/mainstream_category_tag_presenter.rb b/app/presenters/api/mainstream_category_tag_presenter.rb
index abc1234..def5678 100644
--- a/app/presenters/api/mainstream_category_tag_presenter.rb
+++ b/app/presenters/api/mainstream_category_tag_presenter.rb
@@ -1,6 +1,7 @@ class Api::MainstreamCategoryTagPresenter
include Rails.application.routes.url_helpers
include PublicDocumentRoutesHelper
+ include MainstreamCategoryRoutesHelper
def initialize(categories)
@categories = categories
@@ -29,17 +30,4 @@ }
end
- def detailed_guide_url(guide)
- h.api_detailed_guide_url guide.document, host: h.public_host
- end
-
- def related_json
- model.published_related_detailed_guides.map do |guide|
- {
- id: detailed_guide_url(guide),
- title: guide.title,
- web_url: h.public_document_url(guide)
- }
- end
- end
-end
+ end
| Make sure we included the right URL helpers
|
diff --git a/lib/solidus_i18n/engine.rb b/lib/solidus_i18n/engine.rb
index abc1234..def5678 100644
--- a/lib/solidus_i18n/engine.rb
+++ b/lib/solidus_i18n/engine.rb
@@ -5,15 +5,6 @@ engine_name 'solidus_i18n'
config.autoload_paths += %W(#{config.root}/lib)
-
- initializer 'solidus.i18n' do |app|
- SolidusI18n::Engine.instance_eval do
- pattern = pattern_from app.config.i18n.available_locales
-
- add("config/locales/#{pattern}/*.{rb,yml}")
- add("config/locales/#{pattern}.{rb,yml}")
- end
- end
initializer 'solidus.i18n.environment', before: :load_config_initializers do |app|
I18n.locale = app.config.i18n.default_locale if app.config.i18n.default_locale
@@ -27,17 +18,5 @@ end
config.to_prepare(&method(:activate).to_proc)
-
- protected
-
- def self.add(pattern)
- files = Dir[File.join(File.dirname(__FILE__), '../..', pattern)]
- I18n.load_path.concat(files)
- end
-
- def self.pattern_from(args)
- array = Array(args || [])
- array.blank? ? '*' : "{#{array.join ','}}"
- end
end
end
| Remove weird locale load_path configuration
As far as I can tell engines do this by default and this is unnecessary.
|
diff --git a/lib/forty_facets/filter/scope_filter_definition.rb b/lib/forty_facets/filter/scope_filter_definition.rb
index abc1234..def5678 100644
--- a/lib/forty_facets/filter/scope_filter_definition.rb
+++ b/lib/forty_facets/filter/scope_filter_definition.rb
@@ -2,7 +2,7 @@ class ScopeFilterDefinition < FilterDefinition
class ScopeFilter < Filter
def active?
- definition.options[:pass_value] ? value.present? : '1'
+ definition.options[:pass_value] ? value.present? : value == '1'
end
def selected
@@ -28,7 +28,7 @@ search_instance.class.new_unwrapped(new_params, search_instance.root)
end
- def add(value = nil)
+ def add(value = '1')
new_params = search_instance.params || {}
new_params[definition.request_param] = value
search_instance.class.new_unwrapped(new_params, search_instance.root)
@@ -38,7 +38,5 @@ def build_filter(search_instance, value)
ScopeFilter.new(self, search_instance, value)
end
-
end
end
-
| Fix scope filter default behaviour
Bug: when not using pass_value (which is the default) scope filters are currently always `active?` and can not be toggled because calling `add` without parameter is a noop. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.