diff stringlengths 65 26.7k | message stringlengths 7 9.92k |
|---|---|
diff --git a/lib/alter_mvc/constants.rb b/lib/alter_mvc/constants.rb
index abc1234..def5678 100644
--- a/lib/alter_mvc/constants.rb
+++ b/lib/alter_mvc/constants.rb
@@ -2,6 +2,6 @@
VIEWABLE_ACTIONS = %w{new show edit}
- RESPONDER_TYPES = %w{html js json}
+ RESPONDER_TYPES = %w{html js format}
end | Change json to format in responder types
|
diff --git a/Objection.podspec b/Objection.podspec
index abc1234..def5678 100644
--- a/Objection.podspec
+++ b/Objection.podspec
@@ -8,4 +8,7 @@ s.source_files = 'Source'
s.license = "https://github.com/atomicobject/objection/blob/master/LICENSE"
s.requires_arc = true
+
+ s.ios.deployment_target = '5.0'
+ s.osx.deployment_target = '10.7'
end
| Set deployment targets for iOS and OS X.
Signed-off-by: Justin DeWind <d58224c8587ca4c648fb37249b0d2e6771601768@atomicobject.com>
|
diff --git a/lib/bitflyer/executions.rb b/lib/bitflyer/executions.rb
index abc1234..def5678 100644
--- a/lib/bitflyer/executions.rb
+++ b/lib/bitflyer/executions.rb
@@ -1,8 +1,8 @@ module Bitflyer
module Executions
def self.all(options = {})
- result = Bitflyer::Net.get("/v1/executions", options)
- JSON.parse(result).map do |execution|
+ executions = Bitflyer::Net.get("/v1/executions", options)
+ JSON.parse(executions).map do |execution|
Bitflyer::Execution.new(execution)
end
end
| Change name to make more sense
|
diff --git a/core/app/models/spree/stock/estimator.rb b/core/app/models/spree/stock/estimator.rb
index abc1234..def5678 100644
--- a/core/app/models/spree/stock/estimator.rb
+++ b/core/app/models/spree/stock/estimator.rb
@@ -15,7 +15,7 @@
shipping_methods.each do |shipping_method|
cost = calculate_cost(shipping_method, package)
- shipping_rates << shipping_method.shipping_rates.new(:cost => cost)
+ shipping_rates << shipping_method.shipping_rates.new(:cost => cost) unless cost.nil?
end
shipping_rates.sort_by! { |r| r.cost || 0 }
| Allow shipping calculators to return nil values if no service is matched.
With shipping calculators returning 0, we run the risk of choosing and charging
a cost of $0 in cases where for example spree_active_shipping has a failed rate
query with the carrier API. This could be a very expensive mistake.
Current problem as it stands is that with spree_active_shipping returning nil, if
the calculator returns nil, no other rate options are tried and the customer sees
no shipping options in checkout.
This fixes https://github.com/spree/spree_active_shipping/issues/104
Fixes #3588
Fixes spree/spree_active_shipping#104
|
diff --git a/lib/serf/message.rb b/lib/serf/message.rb
index abc1234..def5678 100644
--- a/lib/serf/message.rb
+++ b/lib/serf/message.rb
@@ -17,10 +17,6 @@ send 'kind=', self.to_s.tableize.singularize
class_attribute :model_name
send 'model_name=', self.to_s
- end
-
- def kind
- self.class.kind
end
def to_hash
| Remove 'kind' instance method because it is shadowed.
Details:
* Our ActiveSupport class_attribute declaration for:kind
creates accessors for both the class and instances.
Instances will default to the class value, but may have its own
set instance values... this is a bit dangerous if we're
creating new Serf Messages by merging attributes of others.
(#to_hash vs #attributes) in Serf Messages.
|
diff --git a/week-4/defining-variables.rb b/week-4/defining-variables.rb
index abc1234..def5678 100644
--- a/week-4/defining-variables.rb
+++ b/week-4/defining-variables.rb
@@ -0,0 +1,39 @@+#Solution Below
+first_name = "Catie"
+last_name = "Stallings"
+age = 25
+
+
+
+# RSpec Tests. They are included in this file because the local variables you are creating are not accessible across files. If we try to run these files as a separate file per normal operation, the local variable checks will return nil.
+
+
+describe 'first_name' do
+ it "is defined as a local variable" do
+ expect(defined?(first_name)).to eq 'local-variable'
+ end
+
+ it "is a String" do
+ expect(first_name).to be_a String
+ end
+end
+
+describe 'last_name' do
+ it "is defined as a local variable" do
+ expect(defined?(last_name)).to eq 'local-variable'
+ end
+
+ it "be a String" do
+ expect(last_name).to be_a String
+ end
+end
+
+describe 'age' do
+ it "is defined as a local variable" do
+ expect(defined?(age)).to eq 'local-variable'
+ end
+
+ it "is an integer" do
+ expect(age).to be_a Fixnum
+ end
+end
| Add completed solution for 4.2.1 Defining Variables
|
diff --git a/Swizzlean.podspec b/Swizzlean.podspec
index abc1234..def5678 100644
--- a/Swizzlean.podspec
+++ b/Swizzlean.podspec
@@ -1,6 +1,6 @@ Pod::Spec.new do |s|
s.name = 'Swizzlean'
- s.version = '0.1.0'
+ s.version = '0.1.1'
s.summary = 'A quick and lean way to swizzle methods for your Objective-C development needs.'
s.homepage = 'https://github.com/rbaumbach/Swizzlean'
s.license = { :type => 'MIT', :file => 'MIT.LICENSE' }
| Update podspec from 0.1.0 to 0.1.1
|
diff --git a/lib/symgate/type.rb b/lib/symgate/type.rb
index abc1234..def5678 100644
--- a/lib/symgate/type.rb
+++ b/lib/symgate/type.rb
@@ -21,11 +21,11 @@ end
end
- protected
-
def self.hash_value_with_optional_namespace(namespace, key, hash)
hash[key] || hash["#{namespace}:#{key}".to_sym]
end
+
+ protected
# override this to return an array of symbols for your class variables
# :nocov:
| Move static method outside 'protected' section
|
diff --git a/lib/tasks/lint.rake b/lib/tasks/lint.rake
index abc1234..def5678 100644
--- a/lib/tasks/lint.rake
+++ b/lib/tasks/lint.rake
@@ -1,7 +1,9 @@-require "rubocop/rake_task"
+unless Rails.env.production?
+ require "rubocop/rake_task"
-RuboCop::RakeTask.new(:lint) do |t|
- t.patterns = %w(app bin config Gemfile lib spec)
- t.formatters = %w(clang)
- t.options = %w(--parallel)
+ RuboCop::RakeTask.new(:lint) do |t|
+ t.patterns = %w(app bin config Gemfile lib spec)
+ t.formatters = %w(clang)
+ t.options = %w(--parallel)
+ end
end
| Fix deployment error due to missing rubocop
rubocop-govuk is only a dev dependency, so this task causes an error when run in production mode:
15:32:26 *** [err :: backend-2.backend.staging.publishing.service.gov.uk] rake aborted!
15:32:26 *** [err :: backend-2.backend.staging.publishing.service.gov.uk] LoadError: cannot load such file -- rubocop/rake_task |
diff --git a/lib/rspec/sidekiq/matchers/have_enqueued_job.rb b/lib/rspec/sidekiq/matchers/have_enqueued_job.rb
index abc1234..def5678 100644
--- a/lib/rspec/sidekiq/matchers/have_enqueued_job.rb
+++ b/lib/rspec/sidekiq/matchers/have_enqueued_job.rb
@@ -28,7 +28,8 @@ def negative_failure_message
"expected to not have an enqueued #{@klass} job with arguments #{@expected_arguments}"
end
+ alias_method :failure_message_when_negated, :negative_failure_message
end
end
end
-end+end
| Fix for RSpec 3 Support |
diff --git a/lib/paperclip-optimizer.rb b/lib/paperclip-optimizer.rb
index abc1234..def5678 100644
--- a/lib/paperclip-optimizer.rb
+++ b/lib/paperclip-optimizer.rb
@@ -3,14 +3,21 @@ require 'paperclip-optimizer/processor'
module PaperclipOptimizer
- DEFAULT_SETTINGS = {
+ DEFAULT_OPTIONS = {
+ skip_missing_workers: true,
+ advpng: false,
+ gifsicle: false,
+ jhead: false,
+ jpegoptim: false,
+ jpegrecompress: false,
+ jpegtran: false,
+ optipng: false,
pngcrush: false,
pngout: false,
- advpng: false,
- jpegoptim: false,
- gifsicle: false
+ pngquant: false,
+ svgo: false
}.freeze
-
+
# Helper class for capturing ImageOptims error output and redirecting it
# to Paperclips logger instance
class StdErrCapture
| Disable all compressors by default, ignore missing binaries
image_optim defaults to enabling every supported binary, and therefor
requiring its presence. We skip_missing_workers, so that when image_optim
starts supporting a new one which we do not yet disable, uploads do not
start breaking due to the missing compression binary.
|
diff --git a/event_store-messaging.gemspec b/event_store-messaging.gemspec
index abc1234..def5678 100644
--- a/event_store-messaging.gemspec
+++ b/event_store-messaging.gemspec
@@ -2,7 +2,7 @@ Gem::Specification.new do |s|
s.name = 'event_store-messaging'
s.summary = 'Messaging primitives for EventStore using the EventStore Client HTTP library'
- s.version = '0.2.0.0'
+ s.version = '0.2.0.1'
s.authors = ['']
s.require_paths = ['lib']
s.files = Dir.glob('{lib}/**/*')
| Package version is increased from 0.2.0.0 to 0.2.0.1
|
diff --git a/Subtitler.podspec b/Subtitler.podspec
index abc1234..def5678 100644
--- a/Subtitler.podspec
+++ b/Subtitler.podspec
@@ -9,7 +9,7 @@ s.source = { :git => 'https://github.com/mvader/subtitler.git', :tag => '0.1.0' }
s.ios.deployment_target = '8.0'
- s.osx.deployment_target = '10.9'
+ s.osx.deployment_target = '10.10'
s.source_files = 'subtitler/*.swift'
| Make OS X 10.10 the minimum deployment target
|
diff --git a/ReactNativeExceptionHandler.podspec b/ReactNativeExceptionHandler.podspec
index abc1234..def5678 100644
--- a/ReactNativeExceptionHandler.podspec
+++ b/ReactNativeExceptionHandler.podspec
@@ -8,8 +8,6 @@
# Let the main package.json decide the version number for the pod
package_version = pkg_version.call
-# Use the same RN version that the JS tools use
-react_native_version = pkg_version.call('../react-native')
Pod::Spec.new do |s|
s.name = "ReactNativeExceptionHandler"
@@ -26,6 +24,6 @@ s.source = { :git => "https://github.com/master-atul/react-native-exception-handler.git", :tag => s.version.to_s }
s.source_files = "ios/*.{h,m}"
- s.dependency "React", react_native_version
+ s.dependency "React"
end
| Remove automatic `React` version detection due to inability to access external file
|
diff --git a/week-5/pad-array/my_solution.rb b/week-5/pad-array/my_solution.rb
index abc1234..def5678 100644
--- a/week-5/pad-array/my_solution.rb
+++ b/week-5/pad-array/my_solution.rb
@@ -37,18 +37,15 @@ def pad(array, min_size, value = nil) #non-destructive
if array.length >= min_size
return array
-
-
end
- dif = min_size - array.length
- dif.times do
- new_ray = Array.new(dif) #{|x| x = value }
-
+ new_array = array.clone
+ dif = min_size - new_array.length
+ dif.times do
+ new_array.push(value)
end
- return new_ray
-
- end
-pad([1, 3, 5], 5)
+ return new_array
+end
+# pad([1, 3, 5], 5)
# 3. Refactored Solution
| Add edit of my peer 5.2 pad
|
diff --git a/lib/tasks/om.rake b/lib/tasks/om.rake
index abc1234..def5678 100644
--- a/lib/tasks/om.rake
+++ b/lib/tasks/om.rake
@@ -0,0 +1,8 @@+namespace :om do
+ desc "Fetch data for all cafeterias"
+ task :fetch => :environment do
+ Cafeteria.all.each do |cafeteria|
+ cafeteria.fetch
+ end
+ end
+end
| Add rake tasks for fetch cafetera data
|
diff --git a/builder/test-integration/spec/hypriotos-image/kernel_modules_spec.rb b/builder/test-integration/spec/hypriotos-image/kernel_modules_spec.rb
index abc1234..def5678 100644
--- a/builder/test-integration/spec/hypriotos-image/kernel_modules_spec.rb
+++ b/builder/test-integration/spec/hypriotos-image/kernel_modules_spec.rb
@@ -1,5 +1,5 @@ Specinfra::Runner.run_command('modprobe snd_bcm2835')
-describe kernel_module('snd_bcm2835') do
- it { should be_loaded }
-end
+# describe kernel_module('snd_bcm2835') do
+# it { should be_loaded }
+# end
| Remove integrations tests for module snd_bcm2835
Signed-off-by: Dieter Reuter <554783fc552b5b2a46dd3d7d7b9b2cce9a82c122@me.com>
|
diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/groups_controller.rb
+++ b/app/controllers/groups_controller.rb
@@ -25,16 +25,20 @@ end
def destroy
- group = Group.find(params[:id])
+ @group = Group.find(params[:id])
respond_to do |format|
- if group.destroy
- format.json { render json: { group: group, message: 'Group deleted with success.' }, status: :created, location: group }
+ if destroy_group_tasks && @group.destroy
+ format.json { render json: { group: @group, message: 'Group deleted with success.' }, status: :created, location: @group }
end
end
end
private
+ def destroy_group_tasks
+ Task.where(group: @group).each{ |task| task.destroy }
+ end
+
def group_params
params.require(:group).permit(:name)
end
| Destroy tasks when group is deleted
|
diff --git a/app/controllers/latest_controller.rb b/app/controllers/latest_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/latest_controller.rb
+++ b/app/controllers/latest_controller.rb
@@ -29,16 +29,16 @@ end
def page_params
- { page: filtered_params.fetch(:page, 0) }
+ { page: params.fetch(:page, 0) }
end
def subject_id
- filtered_params[subject_param].first
+ params[subject_param].first
end
def subject_param
supported_subjects.find do |param_name|
- filtered_params[param_name].present? && filtered_params[param_name].is_a?(Array)
+ params[param_name].present? && params[param_name].is_a?(Array)
end
end
@@ -49,8 +49,4 @@ def redirect_unless_subject
redirect_to atom_feed_path unless subject
end
-
- def filtered_params
- params.permit(:page, departments: [], topical_events: [], world_locations: [])
- end
end
| Revert "Permit parameters in latest controller"
|
diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/search_controller.rb
+++ b/app/controllers/search_controller.rb
@@ -4,5 +4,6 @@ @scrapers = Scraper.search @q, fields: [{full_name: :word_middle}, :description, {scraped_domain_names: :word_end}], highlight: true, page: params[:page], per_page: 10
@owners = Owner.search @q, highlight: {fields: [:nickname, :name, :company, :blog]}, page: params[:page], per_page: 10
@type = params[:type]
+ @show = params[:show]
end
end
| Add a 'show' param for controlling results filters
|
diff --git a/lib/bank_scrap.rb b/lib/bank_scrap.rb
index abc1234..def5678 100644
--- a/lib/bank_scrap.rb
+++ b/lib/bank_scrap.rb
@@ -2,9 +2,9 @@ require 'bank_scrap/cli'
require 'bank_scrap/bank'
-# TODO: load banks dynamically
-require 'bank_scrap/banks/bankinter'
-require 'bank_scrap/banks/bbva'
-
module BankScrap
+ # autoload only requires the file when the specified
+ # constant is used for the first time
+ autoload :Bankinter, 'bank_scrap/banks/bankinter'
+ autoload :Bbva, 'bank_scrap/banks/bbva'
end
| Use dynamic loading for banks
|
diff --git a/app/models/concerns/service_mixin.rb b/app/models/concerns/service_mixin.rb
index abc1234..def5678 100644
--- a/app/models/concerns/service_mixin.rb
+++ b/app/models/concerns/service_mixin.rb
@@ -10,7 +10,6 @@ def call(*args)
raise "no block given" unless block_given?
synchronize { yield new(*args) }
- nil
end
private
| Change ServiceMixin.call to return the yield result for better chaining.
|
diff --git a/nokogiri_truncate_html.gemspec b/nokogiri_truncate_html.gemspec
index abc1234..def5678 100644
--- a/nokogiri_truncate_html.gemspec
+++ b/nokogiri_truncate_html.gemspec
@@ -4,7 +4,7 @@
Gem::Specification.new do |gem|
gem.name = "nokogiri_truncate_html"
- gem.version = '0.0.3'
+ gem.version = '0.0.4'
gem.authors = ["Ian White", "Derek Kraan"]
gem.email = ["derek@springest.com"]
gem.description = %q{truncate_html helper that is html and html entities friendly}
@@ -16,9 +16,9 @@ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.require_paths = ['lib']
- gem.add_dependency "nokogiri", "~> 1.5.8"
- gem.add_dependency "activesupport", "~> 3.2.13"
- gem.add_dependency "htmlentities", "~> 4.3.1"
+ gem.add_dependency "nokogiri", ">= 1.5.8"
+ gem.add_dependency "activesupport", ">= 3.2.13"
+ gem.add_dependency "htmlentities", ">= 4.3.1"
gem.add_development_dependency "rspec", ">2"
end
| Update dependencies for Rails 4
|
diff --git a/db/migrate/20161124020918_add_scores_indexes_to_top_topics.rb b/db/migrate/20161124020918_add_scores_indexes_to_top_topics.rb
index abc1234..def5678 100644
--- a/db/migrate/20161124020918_add_scores_indexes_to_top_topics.rb
+++ b/db/migrate/20161124020918_add_scores_indexes_to_top_topics.rb
@@ -0,0 +1,9 @@+class AddScoresIndexesToTopTopics < ActiveRecord::Migration
+ def change
+ add_index :top_topics, :daily_score
+ add_index :top_topics, :weekly_score
+ add_index :top_topics, :monthly_score
+ add_index :top_topics, :yearly_score
+ add_index :top_topics, :all_score
+ end
+end
| PERF: Add score indexes for top topics.
|
diff --git a/Casks/macgdbp.rb b/Casks/macgdbp.rb
index abc1234..def5678 100644
--- a/Casks/macgdbp.rb
+++ b/Casks/macgdbp.rb
@@ -0,0 +1,7 @@+class Macgdbp < Cask
+ url 'https://www.bluestatic.org/downloads/macgdbp/macgdbp-1.5.zip'
+ homepage 'https://www.bluestatic.org/software/macgdbp/'
+ version '1.5'
+ sha256 '90697835c77c0a294cea7aec62276fbf6920763968e5c77a0791199c7d718744'
+ link 'MacGDBp.app'
+end
| Add cask for MacGDBp app
A little client for Xdebug
|
diff --git a/Casks/vivaldi.rb b/Casks/vivaldi.rb
index abc1234..def5678 100644
--- a/Casks/vivaldi.rb
+++ b/Casks/vivaldi.rb
@@ -1,5 +1,5 @@ cask :v1 => 'vivaldi' do
- version '1.0.162.4'
+ version '1.0.162.9'
sha256 :no_check # required as upstream package is updated in-place
url "https://vivaldi.com/download/Vivaldi_TP3.#{version}.dmg"
| Upgrade Vivaldi.app to v1.0.162.9 (Technical Preview 3)
|
diff --git a/config/unicorn/production.rb b/config/unicorn/production.rb
index abc1234..def5678 100644
--- a/config/unicorn/production.rb
+++ b/config/unicorn/production.rb
@@ -6,7 +6,7 @@ stderr_path "#{root_dir}/log/unicorn.log"
stdout_path "#{root_dir}/log/unicorn.log"
-worker_processes Integer(ENV["WEB_CONCURRENCY"])
+worker_processes Integer(ENV["WEB_CONCURRENCY"] || 3)
timeout 30
preload_app true
| Add default value for unicorn web concurrency
|
diff --git a/lib/ninja.rb b/lib/ninja.rb
index abc1234..def5678 100644
--- a/lib/ninja.rb
+++ b/lib/ninja.rb
@@ -11,10 +11,10 @@ # ===----------------------------------------------------------------------=== #
module Ninja
- require 'ninja/version'
- require 'ninja/delegator'
- require 'ninja/variable'
- require 'ninja/rule'
- require 'ninja/build'
- require 'ninja/file'
+ require_relative 'ninja/version'
+ require_relative 'ninja/delegator'
+ require_relative 'ninja/variable'
+ require_relative 'ninja/rule'
+ require_relative 'ninja/build'
+ require_relative 'ninja/file'
end
| Use `require_relative` instead of `require`.
Prevent conflicts, and more importantly, not be dependent on search path.
|
diff --git a/lib/token.rb b/lib/token.rb
index abc1234..def5678 100644
--- a/lib/token.rb
+++ b/lib/token.rb
@@ -1,7 +1,6 @@ class Token
def initialize(char)
raise 'Only one character is allowed' unless char.size == 1
-
@char = char
end
| Remove blank line from Token initializer
|
diff --git a/Casks/font-source-code-pro.rb b/Casks/font-source-code-pro.rb
index abc1234..def5678 100644
--- a/Casks/font-source-code-pro.rb
+++ b/Casks/font-source-code-pro.rb
@@ -1,16 +1,16 @@ cask :v1 => 'font-source-code-pro' do
- version '1.017'
- sha256 '8136b4686309c428ef073356ab178c2f7e8f7b6fadd5a6c61b6a20646377b21f'
+ version '1.017R'
+ sha256 '0c3065b2f411a117e85a2a0e8d66f9276821cd1e2a6853063f7e9a213bc9ec45'
- url "http://downloads.sourceforge.net/sourceforge/sourcecodepro.adobe/SourceCodePro_FontsOnly-#{version}.zip"
- homepage 'http://store1.adobe.com/cfusion/store/html/index.cfm?store=OLS-US&event=displayFontPackage&code=1960'
+ url "https://github.com/adobe-fonts/source-code-pro/archive/#{version}.zip"
+ homepage 'http://adobe-fonts.github.io/source-code-pro/'
license :ofl
- font "SourceCodePro_FontsOnly-#{version}/OTF/SourceCodePro-Black.otf"
- font "SourceCodePro_FontsOnly-#{version}/OTF/SourceCodePro-Bold.otf"
- font "SourceCodePro_FontsOnly-#{version}/OTF/SourceCodePro-ExtraLight.otf"
- font "SourceCodePro_FontsOnly-#{version}/OTF/SourceCodePro-Light.otf"
- font "SourceCodePro_FontsOnly-#{version}/OTF/SourceCodePro-Medium.otf"
- font "SourceCodePro_FontsOnly-#{version}/OTF/SourceCodePro-Regular.otf"
- font "SourceCodePro_FontsOnly-#{version}/OTF/SourceCodePro-Semibold.otf"
+ font "source-code-pro-#{version}/OTF/SourceCodePro-Black.otf"
+ font "source-code-pro-#{version}/OTF/SourceCodePro-Bold.otf"
+ font "source-code-pro-#{version}/OTF/SourceCodePro-ExtraLight.otf"
+ font "source-code-pro-#{version}/OTF/SourceCodePro-Light.otf"
+ font "source-code-pro-#{version}/OTF/SourceCodePro-Medium.otf"
+ font "source-code-pro-#{version}/OTF/SourceCodePro-Regular.otf"
+ font "source-code-pro-#{version}/OTF/SourceCodePro-Semibold.otf"
end
| Switch source-code-pro to GitHub-hosted package
|
diff --git a/UIColor-HNExtensions.podspec b/UIColor-HNExtensions.podspec
index abc1234..def5678 100644
--- a/UIColor-HNExtensions.podspec
+++ b/UIColor-HNExtensions.podspec
@@ -22,4 +22,5 @@
s.source = { :git => "https://github.com/henrinormak/UIColor-HNExtensions.git", :tag => "0.1" }
s.source_files = 'UIColor+HNExtensions.{h,m}'
+ s.requires_arc = true
end
| Make sure ARC is required
|
diff --git a/test/tunefish_test.rb b/test/tunefish_test.rb
index abc1234..def5678 100644
--- a/test/tunefish_test.rb
+++ b/test/tunefish_test.rb
@@ -37,4 +37,18 @@ assert_equal "youtube", activities.first.provider
end
end
+
+ class UserTest < Minitest::Test
+ def test_it_exists_and_has_attributes
+ user = User.new("name" => "John Doe", "photo" => "example.com/img", "id" => "1", "activity_ids" => ["1", "2"])
+ assert_equal "John Doe", user.name
+ end
+ end
+
+ class ActivityTest < Minitest::Test
+ def test_it_exists_and_has_attributes
+ activity = Activity.new("id" => "1", "url" => "http://aurl.com", "provider" => "youtube")
+ assert_equal "youtube", activity.provider
+ end
+ end
end
| Add unit tests for User and Activity
|
diff --git a/CSStickyHeaderFlowLayout.podspec b/CSStickyHeaderFlowLayout.podspec
index abc1234..def5678 100644
--- a/CSStickyHeaderFlowLayout.podspec
+++ b/CSStickyHeaderFlowLayout.podspec
@@ -1,6 +1,6 @@ Pod::Spec.new do |s|
s.name = "CSStickyHeaderFlowLayout"
- s.version = "0.2.11"
+ s.version = "0.2.10"
s.summary = "Parallax and Sticky header done right using UICollectionViewLayout"
s.description = <<-DESC
UICollectionView are flexible and you can use supplementary views to
| Revert "Change version in podspecs"
This reverts commit d8f019517b89c05364b383cfc516044bbc7e785e.
|
diff --git a/spec/requests/releases/get_releases_spec.rb b/spec/requests/releases/get_releases_spec.rb
index abc1234..def5678 100644
--- a/spec/requests/releases/get_releases_spec.rb
+++ b/spec/requests/releases/get_releases_spec.rb
@@ -16,13 +16,18 @@
group = create(:group, name: "my_group")
artist = create(:artist, name: "my_artist")
- release = create(:release, name: "my_release", groups: [group], artists: [artist])
+ release_b = create(:release, name: "my_release_b", groups: [group], artists: [artist])
+ release_a = create(:release, name: "my_release_a", groups: [group], artists: [artist])
+ release_c = create(:release, name: "my_release_c", groups: [group], artists: [artist])
post graphql_path, params: { query: query_string }
- expect(response_body.dig("data", "releases", 0, "id")).to eq release.id
- expect(response_body.dig("data", "releases", 0, "name")).to eq "my_release"
+ expect(response_body.dig("data", "releases", 0, "id")).to eq release_a.id
+ expect(response_body.dig("data", "releases", 0, "name")).to eq "my_release_a"
expect(response_body.dig("data", "releases", 0, "groups", 0, "name")).to eq "my_group"
expect(response_body.dig("data", "releases", 0, "artists", 0, "name")).to eq "my_artist"
+
+ expect(response_body.dig("data", "releases", 1, "id")).to eq release_b.id
+ expect(response_body.dig("data", "releases", 2, "id")).to eq release_c.id
end
end
| Check if releases returns alphabetically
|
diff --git a/spec/serf/middleware/policy_checker_spec.rb b/spec/serf/middleware/policy_checker_spec.rb
index abc1234..def5678 100644
--- a/spec/serf/middleware/policy_checker_spec.rb
+++ b/spec/serf/middleware/policy_checker_spec.rb
@@ -10,10 +10,9 @@ context 'when policy raises error' do
it 'should not call app' do
+ uncalled_mock = double 'uncalled mock'
app = described_class.new(
- proc { |parcel|
- fail 'app was called'
- },
+ uncalled_mock,
policy_chain: [
PassingPolicy.new,
FailingPolicy.new,
@@ -29,7 +28,7 @@ context 'when all policies pass' do
it 'should call the app' do
- parcel = double('parcel')
+ parcel = double 'parcel'
parcel.should_receive :some_success
app = described_class.new(
proc { |parcel|
@@ -47,14 +46,14 @@ it 'should iterate the policy chain' do
count = 10
policy_chain = (1..count).map { |i|
- policy = double('policy')
+ policy = double 'policy'
policy.should_receive(:check!).once do |parcel|
parcel.check_called
end
policy
}
- parcel = double('parcel')
+ parcel = double 'parcel'
parcel.should_receive(:check_called).exactly(count).times
parcel.should_receive :some_success
| Clean up PolicyChecker Spec for complete code coverage.
Details:
* Used a mock instead of a proc that raises an error.
* Remove unneeded parens for 'double'
|
diff --git a/app/admin/post.rb b/app/admin/post.rb
index abc1234..def5678 100644
--- a/app/admin/post.rb
+++ b/app/admin/post.rb
@@ -6,7 +6,9 @@ f.semantic_errors
f.inputs except: [:source_url, :thumbnail_url]
f.has_many :images, allow_destroy: true, heading: false, new_record: true do |image_form|
- image_form.input :image, as: :file, hint: image_form.template.image_tag(image_form.object.image)
+ image_form.input(:image,
+ as: :file,
+ hint: (image_form.template.image_tag(image_form.object.image) if image_form.object.image?))
end
f.actions
end
| Stop to display empty image
|
diff --git a/app/controllers/stats_controller.rb b/app/controllers/stats_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/stats_controller.rb
+++ b/app/controllers/stats_controller.rb
@@ -9,9 +9,9 @@ def create
if authorized?
StatsD.increment(params[:key])
- render(nothing: true)
+ head(:ok, content_length: 0)
else
- render(nothing: true, status: :forbidden)
+ head(:forbidden, content_length: 0)
end
end
| Set content length header to 0 on stats post responses.
This is a workaround for what seems like a Varnish bug. Without
the content length header, rails generates an empty response with
transfer-encoding chunked. This is valid but Varnish removes the
transfer encoding header, creating a response without content length
or chunked encoding. This invalid response causes upstream ELBs to
return 502 bad gateway.
|
diff --git a/storext-override.gemspec b/storext-override.gemspec
index abc1234..def5678 100644
--- a/storext-override.gemspec
+++ b/storext-override.gemspec
@@ -17,7 +17,7 @@ s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.md"]
s.add_dependency "rails"
- s.add_dependency "storext"
+ s.add_dependency "storext", ">= 1.0"
s.add_development_dependency "sqlite3"
s.add_development_dependency "rspec-rails"
| Set tighter dependency on storext
|
diff --git a/app/app.rb b/app/app.rb
index abc1234..def5678 100644
--- a/app/app.rb
+++ b/app/app.rb
@@ -1,6 +1,6 @@ module Nilgiri
class App < Padrino::Application
- register SassInitializer
+ register SassInitializer unless Padrino.env == :production
use ActiveRecord::ConnectionAdapters::ConnectionManagement
register Padrino::Rendering
register Padrino::Mailer
| Use sass compiler only if the environment is not production.
|
diff --git a/model/document.rb b/model/document.rb
index abc1234..def5678 100644
--- a/model/document.rb
+++ b/model/document.rb
@@ -1,6 +1,8 @@ require "csv"
class Document
+ BLOCK_SEPARATOR = ".\n"
+
def lang
self.app == :mapa76 ? :es : :en
end
| Add lost BLOCK_SEPARATOR constant, used by LayoutAnalyzerTask
|
diff --git a/db/migrate/20160406101826_change_unique_index_on_taxon_concept_references.rb b/db/migrate/20160406101826_change_unique_index_on_taxon_concept_references.rb
index abc1234..def5678 100644
--- a/db/migrate/20160406101826_change_unique_index_on_taxon_concept_references.rb
+++ b/db/migrate/20160406101826_change_unique_index_on_taxon_concept_references.rb
@@ -0,0 +1,21 @@+class ChangeUniqueIndexOnTaxonConceptReferences < ActiveRecord::Migration
+ def up
+ remove_index "taxon_concept_references",
+ name: "index_taxon_concept_references_on_tc_id_is_std_is_cascaded"
+
+ add_index "taxon_concept_references", ["taxon_concept_id", "reference_id", "is_standard", "is_cascaded"], name: "index_taxon_concept_references_on_tc_id_is_std_is_cascaded", unique: true
+
+ remove_index "taxon_concept_references",
+ name: "index_taxon_concept_references_on_taxon_concept_id_and_ref_id"
+ end
+
+ def down
+ remove_index "taxon_concept_references",
+ name: "index_taxon_concept_references_on_tc_id_is_std_is_cascaded"
+
+ add_index "taxon_concept_references", ["taxon_concept_id", "reference_id", "is_standard", "is_cascaded"], name: "index_taxon_concept_references_on_tc_id_is_std_is_cascaded"
+
+ add_index "taxon_concept_references", ["taxon_concept_id", "reference_id"],
+ name: "index_taxon_concept_references_on_taxon_concept_id_and_ref_id"
+ end
+end
| Add uniqueness to already existing index on taxon_concept_references and remove the obsolete one
|
diff --git a/sparkle_formation.gemspec b/sparkle_formation.gemspec
index abc1234..def5678 100644
--- a/sparkle_formation.gemspec
+++ b/sparkle_formation.gemspec
@@ -15,5 +15,5 @@ s.add_dependency 'bogo'
s.add_development_dependency 'minitest'
s.executables << 'generate_sparkle_docs'
- s.files = Dir['lib/**/*'] + %w(sparkle_formation.gemspec README.md CHANGELOG.md LICENSE)
+ s.files = Dir['{lib,docs}/**/*'] + %w(sparkle_formation.gemspec README.md CHANGELOG.md LICENSE)
end
| Include the docs directory when building gem
|
diff --git a/config.rb b/config.rb
index abc1234..def5678 100644
--- a/config.rb
+++ b/config.rb
@@ -12,6 +12,7 @@
# You can select your preferred output style here (can be overridden via the command line):
# output_style = :expanded or :nested or :compact or :compressed
+output_style = :expanded
# To enable relative paths to assets via compass helper functions. Uncomment:
#relative_assets = true
| Set default output style to be expanded.
|
diff --git a/config.ru b/config.ru
index abc1234..def5678 100644
--- a/config.ru
+++ b/config.ru
@@ -1,4 +1,5 @@ require './app'
+use Rack::Deflater
run Rack::Cascade.new [
Transitmix::Routes::Status,
Transitmix::Routes::Lines,
| Enable Rack::Deflater for gzip support.
|
diff --git a/config.ru b/config.ru
index abc1234..def5678 100644
--- a/config.ru
+++ b/config.ru
@@ -2,8 +2,8 @@
# Ensure your sources (and smoke) are required before smoke-rack
require 'examples/smoke-source'
-require 'lib/smoke-rack'
-use Smoke::Rack
+require 'lib/rack/smoke'
+use Rack::Smoke
run Sinatra::Application
get '/' do
| Use new namespace and rack-like paths |
diff --git a/app/serializers/board_serializer.rb b/app/serializers/board_serializer.rb
index abc1234..def5678 100644
--- a/app/serializers/board_serializer.rb
+++ b/app/serializers/board_serializer.rb
@@ -5,7 +5,7 @@ all_attributes
attribute :latest_discussion
can_filter_by :subject_default
- can_sort_by :position, :last_comment_created_at
+ can_sort_by :id, :position, :last_comment_created_at
embed_attributes_from :project
self.default_sort = 'position,-last_comment_created_at'
self.preloads = [:latest_discussion]
| Allow BoardSerializer to sort by id |
diff --git a/spec/lib/documentation/person_namespace_spec.rb b/spec/lib/documentation/person_namespace_spec.rb
index abc1234..def5678 100644
--- a/spec/lib/documentation/person_namespace_spec.rb
+++ b/spec/lib/documentation/person_namespace_spec.rb
@@ -0,0 +1,20 @@+require 'spec_helper'
+
+describe "the 'person' namespace example" do
+ class Person
+ attr_reader :first_name
+ def initialize
+ @first_name = "Colin"
+ end
+ end
+
+ class MyConsole < Rink::Console
+ option :namespace => Person.new
+ end
+
+ subject { MyConsole.new(:input => StringIO.new(""), :output => StringIO.new("")) }
+
+ it "should autocomplete properly" do
+ subject.send(:autocomplete, "firs").should == ['first_name']
+ end
+end
| Add test for autocompletion within example namespace
|
diff --git a/app/helpers/filter_helper.rb b/app/helpers/filter_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/filter_helper.rb
+++ b/app/helpers/filter_helper.rb
@@ -11,7 +11,7 @@ end
def filter_remove_option_link(site, type, type_sym)
- link_to site_mappings_path(site, params.except(type_sym, :page)), title: 'Remove filter', class: 'filter-option filter-selected' do
+ link_to site_mappings_path(params.except(type_sym, :page)), title: 'Remove filter', class: 'filter-option filter-selected' do
"<span class=\"glyphicon glyphicon-remove\"></span><span class=\"rm\">Remove</span> #{type}".html_safe
end
end
| Fix generation of links to remove individual filters
The links to remove individual filters from the mappings index pages
were being wrongly generated by the site_mappings_path helper using
the site_id from the params hash as the format, for example:
/sites/aaib/mappings.aaib?type=redirect
Visiting those links raised ActionController::UnknownFormat, so 3 features
were failing.
This started happening between Rails 4.1.9 and 4.1.10, and it seems to be
related to changes to handling of positional arguments which were backported
to 4.1.10 [1]. Those changes were made by @evilstreak and @tekin to fix
a bug they encountered in Whitehall [2] and the comment there explains
more of the context.
In this case we were passing the site object to the helper method as well as
site_id appearing in params, and the latter was being interpreted as the
format. To work around this we're no longer passing the site object, only
the params.
[1]: https://github.com/rails/rails/pull/18803
[2]: https://github.com/alphagov/whitehall/commit/5d46001d7846a85180327797f95c72abbeac3b5e
|
diff --git a/Swinject.podspec b/Swinject.podspec
index abc1234..def5678 100644
--- a/Swinject.podspec
+++ b/Swinject.podspec
@@ -1,6 +1,6 @@ Pod::Spec.new do |s|
s.name = "Swinject"
- s.version = "0.1"
+ s.version = "0.2"
s.summary = "Dependency injection framework for Swift"
s.description = <<-DESC
Swinject is a dependency injection framework for Swift, to manage the dependencies of types in your system.
| Update podspec version to 0.2 for Swift 2.
|
diff --git a/asciimath.gemspec b/asciimath.gemspec
index abc1234..def5678 100644
--- a/asciimath.gemspec
+++ b/asciimath.gemspec
@@ -19,6 +19,6 @@ spec.require_paths = ["lib"]
spec.add_development_dependency "bundler", "> 0"
- spec.add_development_dependency "rake", ">= 12.3.3"
+ spec.add_development_dependency "rake", "~> 13.0.0"
spec.add_development_dependency "rspec", "~> 3.9.0"
end
| Update Rake version spec to ~> 13.0.0
|
diff --git a/db/data_migration/20130327153531_add_force_publish_anything_to_gds_inside_government_team.rb b/db/data_migration/20130327153531_add_force_publish_anything_to_gds_inside_government_team.rb
index abc1234..def5678 100644
--- a/db/data_migration/20130327153531_add_force_publish_anything_to_gds_inside_government_team.rb
+++ b/db/data_migration/20130327153531_add_force_publish_anything_to_gds_inside_government_team.rb
@@ -0,0 +1,8 @@+force_publish_robot_user = ForcePublisher::Worker.new.user
+if force_publish_robot_user.nil?
+ puts "User for Force Publisher is not present! - can't escalate permissions!"
+else
+ puts "Allowing User for Force Publisher (#{force_publish_robot_user.name}[#{force_publish_robot_user.id}]) to force publish anything"
+ force_publish_robot_user.permissions << User::Permissions::FORCE_PUBLISH_ANYTHING
+ force_publish_robot_user.save!
+end
| Add force publish anything to the user used by the force publisher
|
diff --git a/simple_bootstrap_form.gemspec b/simple_bootstrap_form.gemspec
index abc1234..def5678 100644
--- a/simple_bootstrap_form.gemspec
+++ b/simple_bootstrap_form.gemspec
@@ -20,7 +20,7 @@
spec.add_development_dependency "bundler", "~> 1.5"
spec.add_development_dependency "rake"
- spec.add_development_dependency "rspec-rails", ">= 3.0.0.beta1"
+ spec.add_development_dependency "rspec-rails", ">= 3.0.0.beta2"
spec.add_development_dependency "sqlite3"
spec.add_development_dependency "nokogiri" # used by has_element matcher
spec.add_runtime_dependency "rails", ">= 4"
| Update rspec-rails 3.0.0.beta1 -> 3.0.0.beta2
|
diff --git a/messaging.gemspec b/messaging.gemspec
index abc1234..def5678 100644
--- a/messaging.gemspec
+++ b/messaging.gemspec
@@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = 'evt-messaging'
- s.version = '0.27.0.0'
+ s.version = '0.27.0.1'
s.summary = 'Common primitives for platform-specific messaging implementations for Eventide'
s.description = ' '
| Package version is increased from 0.27.0.0 to 0.27.0.1
|
diff --git a/messaging.gemspec b/messaging.gemspec
index abc1234..def5678 100644
--- a/messaging.gemspec
+++ b/messaging.gemspec
@@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = 'messaging'
- s.version = '0.7.0.0'
+ s.version = '0.7.1.0'
s.summary = 'Messaging primitives for Eventide'
s.description = ' '
| Package version is increased from 0.7.0.0 to 0.7.1.0
|
diff --git a/app/workers/fetch_travels.rb b/app/workers/fetch_travels.rb
index abc1234..def5678 100644
--- a/app/workers/fetch_travels.rb
+++ b/app/workers/fetch_travels.rb
@@ -18,18 +18,19 @@ @to = to
setup_worker_key([@from, @to])
if :must_stop == track_in_redis # End tje worker right now
- logger.warn("Discover that we MUST STOP. Certainly a duplicated request.")
+ logger.warn("stop=#{from} to=#{to} Discover that we MUST STOP. Certainly a duplicated request.")
return true
end
#@tr.next(from: from, to: to)
@tr.next(from: from)
@tr.trains.each do |train|
- logger.info("stop=#{from} train=#{train.inspect}")
+ logger.info("stop=#{from} to=#{to} train=#{train.inspect}")
t = Travel.add_travel(train: train, stop: from)
puts t.inspect
#puts t.max_delta
#puts t.final_delta
end
- FetchTravels.perform_in(1.minute)
+ logger.info("stop=#{from} to=#{to} Scheduled back in 1 minute")
+ FetchTravels.perform_in(1.minute, from, to)
end
end
| Fix reschedule and better logging
|
diff --git a/spec/models/revision_spec.rb b/spec/models/revision_spec.rb
index abc1234..def5678 100644
--- a/spec/models/revision_spec.rb
+++ b/spec/models/revision_spec.rb
@@ -2,11 +2,47 @@
describe Revision do
- describe "revision methods" do
- it "should create Revision objects" do
- revision = build(:revision)
- revision.update
- expect(revision).to be
+ describe '#update' do
+ it 'should update a revision with new data' do
+ revision = build(:revision,
+ id: 1,
+ article_id: 1,
+ )
+ revision.update({
+ user_id: 1,
+ views: 9000
+ })
+ expect(revision.views).to eq(9000)
+ expect(revision.user_id).to eq(1)
+ end
+ end
+
+ describe '.update_all_revisions' do
+ it 'should fetch revisions for all courses' do
+ VCR.use_cassette 'revisions/update_all_revisions' do
+ # Try it with no courses.
+ Revision.update_all_revisions
+
+ # Now add a course with a user.
+ build(:course,
+ id: 1,
+ start: '2014-01-01'.to_date,
+ end: '2015-01-01'.to_date,
+ ).save
+ build(:user,
+ id: 1,
+ wiki_id: 'Ragesoss',
+ ).save
+ build(:courses_user,
+ id: 1,
+ user_id: 1,
+ course_id: 1,
+ ).save
+
+ # Try it again with data to pull.
+ #FIXME: This update
+ #Revision.update_all_revisions
+ end
end
end
| Expand testing of Revision model.
|
diff --git a/db/migrate/20161014085122_add_builder_enabled_to_organizations.rb b/db/migrate/20161014085122_add_builder_enabled_to_organizations.rb
index abc1234..def5678 100644
--- a/db/migrate/20161014085122_add_builder_enabled_to_organizations.rb
+++ b/db/migrate/20161014085122_add_builder_enabled_to_organizations.rb
@@ -4,10 +4,8 @@ add_column :builder_enabled, :boolean, null: false, default: false
end
- Rails::Sequel.connection.run('UPDATE users SET builder_enabled = true WHERE builder_enabled IS NULL')
alter_table :users do
set_column_default :builder_enabled, false
- set_column_not_null :builder_enabled
end
end
@@ -17,7 +15,6 @@ end
alter_table :users do
- set_column_allow_null :builder_enabled
set_column_default :builder_enabled, true
end
end
| Change migration, allow users nulls (inherit from org)
|
diff --git a/lib/web_inspector/inspector.rb b/lib/web_inspector/inspector.rb
index abc1234..def5678 100644
--- a/lib/web_inspector/inspector.rb
+++ b/lib/web_inspector/inspector.rb
@@ -25,19 +25,22 @@ end
def links
- links = []
+ return @links if @links
+
+ @links = []
@page.css("a").each do |a|
- links.push((a[:href].to_s.start_with? @url.to_s) ? a[:href] : URI.join(@url, a[:href]).to_s) if (a and a[:href])
+ @links.push((a[:href].to_s.start_with? @url.to_s) ? a[:href] : URI.join(@url, a[:href]).to_s) if (a and a[:href])
end
- return links
end
def images
- images = []
+ return @images if @images
+
+ @images = []
@page.css("img").each do |img|
- images.push((img[:src].to_s.start_with? @url.to_s) ? img[:src] : URI.join(url, img[:src]).to_s) if (img and img[:src])
+ @images.push((img[:src].to_s.start_with? @url.to_s) ? img[:src] : URI.join(url, img[:src]).to_s) if (img and img[:src])
end
- return images
+ return @images
end
private
| Store links and images to speed up secondary calls to the corresponding functions.
|
diff --git a/recipes/default.rb b/recipes/default.rb
index abc1234..def5678 100644
--- a/recipes/default.rb
+++ b/recipes/default.rb
@@ -32,12 +32,12 @@ end
chef_gem 'unf' do
- action :nothing
-end.run_action(:install)
+ compile_time true
+end
# TODO: Remove this once the gem_hell cookbook is ready to roll
chef_gem 'fog' do
- action :nothing
+ compile_time true
version node['et_fog']['version']
-end.run_action(:install)
+end
| Use compile_time property to make gems install at compile_time
|
diff --git a/lib/fOOrth.rb b/lib/fOOrth.rb
index abc1234..def5678 100644
--- a/lib/fOOrth.rb
+++ b/lib/fOOrth.rb
@@ -20,7 +20,7 @@ #<br>Returns
#* A version string; <major>.<minor>.<step>
def self.version
- "00.06.00"
+ "00.00.00"
end
#The virtual machine is the heart of the fOOrth language system that is
| Reset version number to 00.00.00. This is new code!
|
diff --git a/lib/fezzik.rb b/lib/fezzik.rb
index abc1234..def5678 100644
--- a/lib/fezzik.rb
+++ b/lib/fezzik.rb
@@ -13,6 +13,9 @@ Rake::Task["fezzik:#{task}"].invoke
end
puts "[success]".green
+ rescue SystemExit => e
+ puts "[fail]".red
+ exit 1
rescue Exception => e
puts e.message
puts e.backtrace
| Allow tasks to exit with an error code without dumping a backtrace.
|
diff --git a/spec/acceptance/login_spec.rb b/spec/acceptance/login_spec.rb
index abc1234..def5678 100644
--- a/spec/acceptance/login_spec.rb
+++ b/spec/acceptance/login_spec.rb
@@ -13,5 +13,6 @@ scenario "Con contraseña incorrecta" do
login_with(email: usuario.email, password: "incorrecta")
page.should have_error
+ current_path.should == login_page
end
end
| Test de la página redirigida.
|
diff --git a/lib/sastrawi/stemmer/context/visitor/remove_inflectional_particle.rb b/lib/sastrawi/stemmer/context/visitor/remove_inflectional_particle.rb
index abc1234..def5678 100644
--- a/lib/sastrawi/stemmer/context/visitor/remove_inflectional_particle.rb
+++ b/lib/sastrawi/stemmer/context/visitor/remove_inflectional_particle.rb
@@ -1,3 +1,8 @@+##
+# Remove inflectional particle
+# Asian J. (2007) "Effective Techniques for Indonesian Text Retrieval" page 60
+# http://researchbank.rmit.edu.au/eserv/rmit:6312/Asian.pdf
+
module Sastrawi
module Stemmer
module Context
@@ -16,6 +21,9 @@ end
end
+ ##
+ # Remove inflectional particle: lah|kah|tah|pun
+
def remove(word)
word.sub(/-*(lah|kah|tah|pun)$/, '')
end
| Add comments to "RemoveInflectionalParticle" class
|
diff --git a/lib/commands/clone_command.rb b/lib/commands/clone_command.rb
index abc1234..def5678 100644
--- a/lib/commands/clone_command.rb
+++ b/lib/commands/clone_command.rb
@@ -8,7 +8,7 @@ action "Cloning" do
FileUtils.rm_rf(mod.work_dir)
- Cheetah.run "git", "clone", "git://github.com/yast/yast-#{mod.name}.git", mod.work_dir
+ Cheetah.run "git", "clone", "git@github.com:yast/yast-#{mod.name}.git", mod.work_dir
end
end
end
| Use SSH URLs for cloning from GitHub
This will allow us to push stuff from work and result dirs back to
GitHub repos during the final compilation.
|
diff --git a/lib/dyndnsd/generator/bind.rb b/lib/dyndnsd/generator/bind.rb
index abc1234..def5678 100644
--- a/lib/dyndnsd/generator/bind.rb
+++ b/lib/dyndnsd/generator/bind.rb
@@ -7,6 +7,7 @@ @ttl = config['ttl']
@dns = config['dns']
@email_addr = config['email_addr']
+ @additional_zone_content = config['additional_zone_content']
end
def generate(zone)
@@ -22,6 +23,8 @@ out << "#{name} IN A #{ip}"
end
out << ""
+ out << @additional_zone_content
+ out << ""
out.join("\n")
end
end
| Allow additional raw zone content for Bind generator
|
diff --git a/lib/facebook_places/client.rb b/lib/facebook_places/client.rb
index abc1234..def5678 100644
--- a/lib/facebook_places/client.rb
+++ b/lib/facebook_places/client.rb
@@ -23,7 +23,7 @@ fields: fields.join(','),
center: center,
distance: distance,
- categories: categories.join(','),
+ 'categories[]' => categories,
access_token: access_token
}
Place.search(options)
| Fix 'param categories must be an array'
|
diff --git a/lib/metacrunch/transformer.rb b/lib/metacrunch/transformer.rb
index abc1234..def5678 100644
--- a/lib/metacrunch/transformer.rb
+++ b/lib/metacrunch/transformer.rb
@@ -4,6 +4,7 @@ require_relative "./transformer/helper"
attr_accessor :source, :target, :options
+ attr_reader :step
def initialize(source:nil, target:nil, options: {})
@@ -14,11 +15,13 @@
def transform(step_class = nil, &block)
if block_given?
- Step.new(self).instance_eval(&block)
+ @step = Step.new(self)
+ @step.instance_eval(&block)
else
raise ArgumentError, "You need to provide a STEP or a block" if step_class.nil?
clazz = step_class.is_a?(Class) ? step_class : step_class.to_s.constantize
- clazz.new(self).perform
+ @step = clazz.new(self)
+ @step.perform
end
end
| Allow public access to the step instance.
This is useful for tests.
|
diff --git a/lib/paginate_link_renderer.rb b/lib/paginate_link_renderer.rb
index abc1234..def5678 100644
--- a/lib/paginate_link_renderer.rb
+++ b/lib/paginate_link_renderer.rb
@@ -0,0 +1,8 @@+#
+# = The Paginate Table Link Renderer
+#
+class PaginateLinkRenderer < WillPaginate::LinkRenderer
+ def page_link(page, text, attributes = {})
+ @template.link_to_function text, "Paginate.Page.getInstance().table.fetch(#{page})", attributes
+ end
+end
| Make paginate table skin work
|
diff --git a/app/helpers/sitemap_helper.rb b/app/helpers/sitemap_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/sitemap_helper.rb
+++ b/app/helpers/sitemap_helper.rb
@@ -9,17 +9,12 @@ add legal_notices_path, priority: 0.7, changefreq: 'monthly' if Category.find_by(name: 'LegalNotice').menu_online
end
- def blog_module
- add blogs_path, priority: 0.7, changefreq: 'monthly'
- Blog.online.find_each do |blog|
- add blog_path(blog), priority: 0.7, changefreq: 'monthly'
- end
- end
-
- def event_module
- add events_path, priority: 0.7, changefreq: 'monthly'
- Event.online.find_each do |event|
- add event_path(event), priority: 0.7, changefreq: 'monthly'
+ [Blog, Event].each do |mod|
+ define_method "#{mod.to_s.underscore}_module" do
+ add send("#{mod.to_s.underscore.pluralize}_path"), priority: 0.7, changefreq: 'monthly'
+ mod.online.find_each do |resource|
+ add send("#{mod.to_s.underscore}_path", resource), priority: 0.7, changefreq: 'monthly'
+ end
end
end
| Refactor sitemap helper methods in a cleaner way
|
diff --git a/lib/tasks/publishing_api.rake b/lib/tasks/publishing_api.rake
index abc1234..def5678 100644
--- a/lib/tasks/publishing_api.rake
+++ b/lib/tasks/publishing_api.rake
@@ -16,7 +16,7 @@ tags.find_each do |tag|
retries = 0
begin
- PublishingAPINotifier.send_to_publishing_api(tag)
+ PublishingAPINotifier.new(tag).send_single_tag_to_publishing_api
rescue GdsApi::TimedOutException, Timeout::Error => e
retries += 1
if retries <= 3
| Send single tags to content store in rake task
The rake task currently publishes all tags, *and* their dependent tags,
doing a lot of duplicate work. This commit restricts the rake task to
only publish a single tag.
|
diff --git a/sansa-and-xor/sansa-and-xor.rb b/sansa-and-xor/sansa-and-xor.rb
index abc1234..def5678 100644
--- a/sansa-and-xor/sansa-and-xor.rb
+++ b/sansa-and-xor/sansa-and-xor.rb
@@ -1,6 +1,6 @@ #!/usr/bin/env ruby
-DEBUG=true
+DEBUG=false
gets.to_i.times do
n = gets.to_i
| Set Sansa and XOR to debug false
Passing in hackerrank, so move on.
|
diff --git a/libraries/language_install.rb b/libraries/language_install.rb
index abc1234..def5678 100644
--- a/libraries/language_install.rb
+++ b/libraries/language_install.rb
@@ -0,0 +1,105 @@+#
+# Copyright 2015, Chef Software, Inc.
+#
+# 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_relative '_helper'
+require_relative '_prefix'
+
+class Chef
+ class Resource::LanguageInstall < Resource::LWRPBase
+ include Languages::Prefix
+
+ actions :install
+ default_action :install
+
+ attribute :version, kind_of: String, name_attribute: true, required: true
+ attribute :prefix, kind_of: String, default: lazy { |r| r.default_prefix(r.version) }
+ end
+
+ class Provider::LanguageInstall < Provider::LWRPBase
+ include Languages::Helper
+
+ def whyrun_supported?
+ true
+ end
+
+ action(:install) do
+ if installed?
+ Chef::Log.debug("#{new_resource} installed - skipping")
+ else
+ converge_by("install #{new_resource}") do
+ install_dependencies
+ install
+ end
+ end
+ end
+
+ #
+ # Determines if a language is installed at a particular version.
+ #
+ # @return [Boolean]
+ #
+ def installed?
+ raise NotImplementedError
+ end
+
+ #
+ # Installs required dependencies required to compile or extract a
+ # a language.
+ #
+ def install_dependencies
+ recipe_eval do
+ run_context.include_recipe 'chef-sugar::default'
+ run_context.include_recipe 'build-essential::default'
+
+ case node.platform_family
+ when 'debian'
+ package 'curl'
+ package 'git'
+ package 'libxml2-dev'
+ package 'libxslt-dev'
+ package 'zlib1g-dev'
+ package 'ncurses-dev'
+ package 'libssl-dev'
+ when 'freebsd'
+ package 'textproc/libxml2'
+ package 'textproc/libxslt'
+ package 'devel/ncurses'
+ package 'libssl-dev'
+ when 'mac_os_x'
+ package 'libxml2'
+ package 'libxslt'
+ package 'openssl'
+ when 'rhel'
+ package 'curl'
+ package 'bzip2'
+ package 'git'
+ package 'libxml2-devel'
+ package 'libxslt-devel'
+ package 'ncurses-devel'
+ package 'zlib-devel'
+ package 'openssl-devel'
+ end
+ end
+ end
+
+ #
+ # Performs the actual install of a language.
+ #
+ def install
+ raise NotImplementedError
+ end
+ end
+end
| Add base `LanguageInstall` resource/provider classes
These classes define the shared attributes and core action along with
some abstract methods each provider must implement.
|
diff --git a/test/integration/cases/apache2_bootstrap.rb b/test/integration/cases/apache2_bootstrap.rb
index abc1234..def5678 100644
--- a/test/integration/cases/apache2_bootstrap.rb
+++ b/test/integration/cases/apache2_bootstrap.rb
@@ -8,7 +8,7 @@
def write_berksfile
File.open('Berksfile', 'w') do |f|
- f.puts "site :opscode"
+ f.puts 'source "https://supermarket.chef.io"'
f.puts "cookbook 'apache2'"
end
end
| Update berkshelf source for latest format
|
diff --git a/modules/govuk_jenkins/spec/classes/govuk_jenkins__jobs__each_spec.rb b/modules/govuk_jenkins/spec/classes/govuk_jenkins__jobs__each_spec.rb
index abc1234..def5678 100644
--- a/modules/govuk_jenkins/spec/classes/govuk_jenkins__jobs__each_spec.rb
+++ b/modules/govuk_jenkins/spec/classes/govuk_jenkins__jobs__each_spec.rb
@@ -5,12 +5,10 @@
# TODO: make the specs work for these
BROKEN_SPECS = %w[
- copy_data_from_staging_to_aws.pp
deploy_cdn.pp
deploy_puppet.pp
smokey.pp
update_cdn_dictionaries.pp
- whitehall_update_integration_data.pp
]
# test everything apart from known broken exceptions
| Remove references to old spec files
These files no longer exist in govuk-puppet.
|
diff --git a/spec/pages/profile_page.rb b/spec/pages/profile_page.rb
index abc1234..def5678 100644
--- a/spec/pages/profile_page.rb
+++ b/spec/pages/profile_page.rb
@@ -1,5 +1,19 @@+# @author Dumitru Ursu
+# Page Object for the user profile page
class ProfilePage
include Capybara::DSL
+ include Warden::Test::Helpers
+ include Rails.application.routes.url_helpers
+ def initialize(user)
+ @user = user
+ login_as @user
+ end
+
+ def locale(lang)
+ visit edit_user_registration_path(:en)
+ select lang, from: 'user_language'
+ fill_in 'user_current_password', with: @user.password
+ click_button 'Update'
+ end
end
-
| Add locale switching in Profile page
|
diff --git a/spec/teamsnap_init_spec.rb b/spec/teamsnap_init_spec.rb
index abc1234..def5678 100644
--- a/spec/teamsnap_init_spec.rb
+++ b/spec/teamsnap_init_spec.rb
@@ -27,5 +27,18 @@ :backup_cache => false)
}.to raise_error(TeamSnap::Error, /You are not authorized to access this resource/)
end
+
+ it "allows url to be specified" do
+ connection = instance_double("Faraday::Connection")
+ response = instance_double("Faraday::Response")
+ allow(connection).to receive(:get) { response }
+ allow(response).to receive(:success?) { false }
+ allow(connection).to receive(:in_parallel) { false }
+
+ expect(Faraday).to receive(:new).with(hash_including(
+ :url => "https://api.example.com")) { connection }
+
+ TeamSnap.init(:token => "mytoken", :url => "https://api.example.com")
+ end
end
end
| Add spec for overriding the default url
|
diff --git a/app/helpers/reactjs_helper.rb b/app/helpers/reactjs_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/reactjs_helper.rb
+++ b/app/helpers/reactjs_helper.rb
@@ -8,7 +8,7 @@ def react(name, data = {})
uid = unique_html_id('react')
capture do
- concat(tag('div', :id => uid))
+ concat(content_tag('div', nil, :id => uid))
concat(javascript_tag("ManageIQ.component.componentFactory('#{j(name)}', '##{j(uid)}', #{data.to_json})"))
end
end
| Make sure that react helper always closes the div tag
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1593152
|
diff --git a/themes/densitypop/app.rb b/themes/densitypop/app.rb
index abc1234..def5678 100644
--- a/themes/densitypop/app.rb
+++ b/themes/densitypop/app.rb
@@ -6,5 +6,5 @@ #
# Put your assets in public/densitypop.
#
-# use Rack::Static, :urls => ["/densitypop"], :root => "themes/densitypop/public"
+use Rack::Static, :urls => ["/images"], :root => "themes/densitypop/public"
| Load static images in theme |
diff --git a/app/models/allele_registry.rb b/app/models/allele_registry.rb
index abc1234..def5678 100644
--- a/app/models/allele_registry.rb
+++ b/app/models/allele_registry.rb
@@ -23,7 +23,7 @@ end
def allele_registry_url(coordinate_string)
- URI.encode("http://reg.test.genome.network/allele?hgvs=#{coordinate_string}")
+ URI.encode("http://reg.genome.network/allele?hgvs=#{coordinate_string}")
end
def cache_key(variant_id)
| Update the URL for the allele registry to the production server
|
diff --git a/app/models/publication_log.rb b/app/models/publication_log.rb
index abc1234..def5678 100644
--- a/app/models/publication_log.rb
+++ b/app/models/publication_log.rb
@@ -16,7 +16,8 @@
def self.change_notes_for(slug)
with_slug_prefix(slug)
- .sort_by(&:published_at)
+ .order([:created_at, :asc])
+ .to_a
.uniq { |publication|
[publication.slug, publication.version_number]
}
| Move sort in Publication.change_notes_for to mongo
It will probably be marginally faster to do it there so why not.
|
diff --git a/tests/aws/requests/rds/instance_option_tests.rb b/tests/aws/requests/rds/instance_option_tests.rb
index abc1234..def5678 100644
--- a/tests/aws/requests/rds/instance_option_tests.rb
+++ b/tests/aws/requests/rds/instance_option_tests.rb
@@ -5,7 +5,7 @@
body = Fog::AWS[:rds].describe_orderable_db_instance_options('mysql').body
- returns(100) {body['DescribeOrderableDBInstanceOptionsResult']['OrderableDBInstanceOptions'].length}
+ returns(2) {body['DescribeOrderableDBInstanceOptionsResult']['OrderableDBInstanceOptions'].length}
group = body['DescribeOrderableDBInstanceOptionsResult']['OrderableDBInstanceOptions'].first
returns( true ) { group['MultiAZCapable'] }
| Adjust number of items returned for test
|
diff --git a/config/initializers/flow_preview.rb b/config/initializers/flow_preview.rb
index abc1234..def5678 100644
--- a/config/initializers/flow_preview.rb
+++ b/config/initializers/flow_preview.rb
@@ -1,4 +1,10 @@-FLOW_REGISTRY_OPTIONS = {show_drafts: true, show_transitions: false}
+# This file potentially overwritten on deploy
+
+if Rails.env.production?
+ FLOW_REGISTRY_OPTIONS = {}
+else
+ FLOW_REGISTRY_OPTIONS = {show_drafts: true}
+end
# Uncomment the following to run smartanswers with the test flows instead of the real ones
#
| Disable drafts by default in RAILS_ENV=production
To reduce the chance of a misconfiguration revealing draft content in
production, this changes the default config to not show drafts unless
explicitly overridden.
This removes the `show_transitions: false` option because that's already
the default value for it.
|
diff --git a/config/software/td-agent-cleanup.rb b/config/software/td-agent-cleanup.rb
index abc1234..def5678 100644
--- a/config/software/td-agent-cleanup.rb
+++ b/config/software/td-agent-cleanup.rb
@@ -2,6 +2,7 @@ #version '' # git ref
dependency "td-agent"
+dependency "td-agent-files"
build do
block do
@@ -18,5 +19,9 @@ end
FileUtils.rm_rf(["#{gem_dir}/test", "{gem_dir}/spec"])
}
+
+ if windows?
+ FileUtils.rm_rf("/opt/#{project_name}/etc/init.d")
+ end
end
end
| Remove unused directories on Windows
|
diff --git a/administrate-field-paperclip.gemspec b/administrate-field-paperclip.gemspec
index abc1234..def5678 100644
--- a/administrate-field-paperclip.gemspec
+++ b/administrate-field-paperclip.gemspec
@@ -15,7 +15,7 @@ gem.test_files = `git ls-files -- {test,spec,features}/*`.split('\n')
gem.add_dependency 'administrate', '~> 0.4'
- gem.add_dependency 'rails', '>= 4.2', '< 5.1'
+ gem.add_dependency 'rails', '>= 4.2', '< 6'
gem.add_development_dependency 'byebug'
gem.add_development_dependency 'factory_girl'
| Support all Rails 5 releases
|
diff --git a/features/support/capybara.rb b/features/support/capybara.rb
index abc1234..def5678 100644
--- a/features/support/capybara.rb
+++ b/features/support/capybara.rb
@@ -1,11 +1,11 @@ # Configure Capybara
require 'capybara/poltergeist'
Capybara.configure do |config|
+ # config.default_driver = :selenium
+ # Capybara.default_wait_time = 120
Capybara.register_driver :poltergeist do |app|
Capybara::Poltergeist::Driver.new(app, timeout: 120, js_errors: true, phantomjs_options: ['--load-images=no'])
end
- # config.default_driver = :selenium
config.default_driver = :poltergeist
config.javascript_driver = :poltergeist
- Capybara.default_wait_time = 25
end
| Comment out the Capybara default timeout and just use the Poltergeist one
|
diff --git a/vendor/plugins/sfu_course_copy_importer/init.rb b/vendor/plugins/sfu_course_copy_importer/init.rb
index abc1234..def5678 100644
--- a/vendor/plugins/sfu_course_copy_importer/init.rb
+++ b/vendor/plugins/sfu_course_copy_importer/init.rb
@@ -14,7 +14,8 @@ :requires_file_upload => false,
:skip_conversion_step => true,
:required_options_validator => Canvas::Migration::Validators::CourseCopyValidator,
- :required_settings => [:source_course_id]
+ :required_settings => [:source_course_id],
+ :valid_contexts => %w{Course}
},
}
end
| Fix course copy migration regression
The regression prevented users from importing courses using our version
of the plugin. It was introduced in f8400335 when the migrations
controller started checking for valid contexts. This fix is based on
2ba4531f (default_plugins.rb:140).
|
diff --git a/lib/delayed/serialization/data_mapper.rb b/lib/delayed/serialization/data_mapper.rb
index abc1234..def5678 100644
--- a/lib/delayed/serialization/data_mapper.rb
+++ b/lib/delayed/serialization/data_mapper.rb
@@ -1,12 +1,21 @@ # encoding: utf-8
-DataMapper::Resource.class_eval do
- yaml_as "tag:ruby.yaml.org,2002:DataMapper"
+if YAML.parser.class.name =~ /syck/i
+ DataMapper::Resource.class_eval do
+ yaml_as "tag:ruby.yaml.org,2002:DataMapper"
- def self.yaml_new(klass, tag, val)
- klass.get!(val['id'])
+ def self.yaml_new(klass, tag, val)
+ klass.get!(val['attributes']['id'])
+ end
+
+ def to_yaml_properties
+ ['@attributes']
+ end
end
-
- def to_yaml_properties
- ['@id']
+else
+ DataMapper::Resource.class_eval do
+ def encode_with(coder)
+ coder["attributes"] = @attributes
+ coder.tag = ['!ruby/DataMapper', self.class.name].join(':')
+ end
end
end
| Add an encoder for psych parsing. |
diff --git a/lib/green-button-data/parser/interval.rb b/lib/green-button-data/parser/interval.rb
index abc1234..def5678 100644
--- a/lib/green-button-data/parser/interval.rb
+++ b/lib/green-button-data/parser/interval.rb
@@ -12,6 +12,14 @@ normalize_epoch t
end
+ def start_at
+ Time.at(normalize_epoch(@start)).utc.to_datetime
+ end
+
+ def end_at
+ Time.at(normalize_epoch(@start + @duration)).utc.to_datetime
+ end
+
# Standard ESPI namespacing
element :'espi:duration', class: Integer, as: :duration
element :'espi:start', class: Integer, as: :start
| Add computed attributes that return in DateTime objects
|
diff --git a/lib/exact_target/subscriber.rb b/lib/exact_target/subscriber.rb
index abc1234..def5678 100644
--- a/lib/exact_target/subscriber.rb
+++ b/lib/exact_target/subscriber.rb
@@ -1,6 +1,7 @@ module ExactTarget
class Subscriber
include ActiveModel::Model
+ include ActiveRecord::AttributeAssignment if defined?(ActiveRecord::AttributeAssignment)
attr_accessor :email, :travel_weekly, :enews, :travel_especials, :ins_enews, :deals_discounts, :fleet_contact,
:new_member_series, :personal_vehicle_reminder, :business_vehicle_reminder, :associate_vehicle_reminder,
| Make this compatible with more recent Rails versions that support more advanced functionality.
|
diff --git a/lib/liquid-renderer/railtie.rb b/lib/liquid-renderer/railtie.rb
index abc1234..def5678 100644
--- a/lib/liquid-renderer/railtie.rb
+++ b/lib/liquid-renderer/railtie.rb
@@ -10,7 +10,8 @@
ActionController::Renderers.add :liquid do |content, options|
content_type = options.delete(:content_type) || 'text/html'
- render :text => LiquidRenderer.render(content, options), :content_type => content_type
+ status = options.delete(:status) || :ok
+ render text: LiquidRenderer.render(content, options), content_type: content_type, status: status
end
end
end
| Add status override to liquid rendering
|
diff --git a/lib/oboefu/inst/action_view.rb b/lib/oboefu/inst/action_view.rb
index abc1234..def5678 100644
--- a/lib/oboefu/inst/action_view.rb
+++ b/lib/oboefu/inst/action_view.rb
@@ -27,11 +27,10 @@
def render(options = {}, locals = {}, &block)
opts = {}
- puts options.inspect
opts[:partial] = options[:partial] if options.has_key?(:partial)
opts[:file] = options[:file] if options.has_key?(:file)
- Oboe::API.start_trace_with_target('render', opts) do
+ Oboe::API.trace('partial', opts) do
render_without_oboe(options, locals, &block)
end
end
| Use Oboe::API.trace and not start_trace_with_target
|
diff --git a/lib/poly_delegate/delegator.rb b/lib/poly_delegate/delegator.rb
index abc1234..def5678 100644
--- a/lib/poly_delegate/delegator.rb
+++ b/lib/poly_delegate/delegator.rb
@@ -25,5 +25,13 @@ def instance_variable_set(sym, value)
@__delegated_object__.instance_variable_set(sym, value)
end
+
+ def __undelegated_get__(sym)
+ __instance_variable_get__(sym)
+ end
+
+ def __undelegated_set__(sym, value)
+ __instance_variable_set__(sym, value)
+ end
end
end
| Add undelegated getter/setter methods to Delegator.
|
diff --git a/spec/active_record/mti_spec.rb b/spec/active_record/mti_spec.rb
index abc1234..def5678 100644
--- a/spec/active_record/mti_spec.rb
+++ b/spec/active_record/mti_spec.rb
@@ -10,6 +10,10 @@ end
end
+ it "root has the right value" do
+ expect(ActiveRecord::MTI.root).not_to be_nil
+ end
+
end
end
| Add coverage for AR::MTI.root helper
|
diff --git a/spec/features/missions_spec.rb b/spec/features/missions_spec.rb
index abc1234..def5678 100644
--- a/spec/features/missions_spec.rb
+++ b/spec/features/missions_spec.rb
@@ -1,6 +1,6 @@ require 'rails_helper'
-RSpec.feature "Mission", type: :feature, js: true do
+RSpec.feature "Mission", type: :feature do
scenario "renders Mission component" do
visit "/"
expect(page).to have_content "Less than 5% of cancer patients participate in clinical trials despite having a participant satisfaction rate of more than 90%."
| Remove js: true from Capybara test
|
diff --git a/carrierwave-imagesorcery.gemspec b/carrierwave-imagesorcery.gemspec
index abc1234..def5678 100644
--- a/carrierwave-imagesorcery.gemspec
+++ b/carrierwave-imagesorcery.gemspec
@@ -10,7 +10,9 @@
gem.extra_rdoc_files = ["README.md"]
gem.rdoc_options = ["--main"]
- gem.add_development_dependency "rspec"
+ gem.add_development_dependency 'rspec', '~> 2.12.0'
+ gem.add_development_dependency 'rake','~> 10.0.2'
+ gem.add_development_dependency 'subexec', '~> 0.2.2'
gem.add_dependency 'carrierwave'
gem.add_dependency 'image_sorcery'
| Add development dependencies to gemspec
|
diff --git a/lib/em-kannel/test_helper.rb b/lib/em-kannel/test_helper.rb
index abc1234..def5678 100644
--- a/lib/em-kannel/test_helper.rb
+++ b/lib/em-kannel/test_helper.rb
@@ -8,8 +8,13 @@
Client.class_eval do
def fake_response
+ guid = UUID.new.generate
+
status = OpenStruct.new(status: 202)
- http = OpenStruct.new(response_header: status)
+ http = OpenStruct.new(
+ response_header: status,
+ response: "0: Accepted for delivery: #{guid}"
+ )
Response.new(http, Time.now)
end
| Add fake guid to test helper response
|
diff --git a/lib/fabulator/wlc/actions.rb b/lib/fabulator/wlc/actions.rb
index abc1234..def5678 100644
--- a/lib/fabulator/wlc/actions.rb
+++ b/lib/fabulator/wlc/actions.rb
@@ -4,12 +4,12 @@
require 'fabulator/wlc/actions/make-asset-available'
+ Fabulator::Core::Actions::Lib.structural 'module', Fabulator::Core::StateMachine
+
module WLC
module Actions
- class Lib
- include Fabulator::ActionLib
-
- register_namespace WLC_NS
+ class Lib < Fabulator::TagLib
+ namespace WLC_NS
action 'make-asset-available', MakeAssetAvailable
end
| Work with fabulator-0.0.7; have 'module' as a top-level structural element
|
diff --git a/lib/factory_bot/decorator.rb b/lib/factory_bot/decorator.rb
index abc1234..def5678 100644
--- a/lib/factory_bot/decorator.rb
+++ b/lib/factory_bot/decorator.rb
@@ -17,5 +17,9 @@ def send(symbol, *args, &block)
__send__(symbol, *args, &block)
end
+
+ def self.const_missing(name)
+ ::Object.const_get(name)
+ end
end
end
| Revert "Remove redundant const_missing class method."
This reverts commit df5471078ce1fd45f094ad77c892ee9657d13c92.
|
diff --git a/lib/fivemat/minitest/unit.rb b/lib/fivemat/minitest/unit.rb
index abc1234..def5678 100644
--- a/lib/fivemat/minitest/unit.rb
+++ b/lib/fivemat/minitest/unit.rb
@@ -1,8 +1,11 @@ require 'minitest/unit'
+require 'fivemat/elapsed_time'
module Fivemat
module MiniTest
class Unit < ::MiniTest::Unit
+ include ElapsedTime
+
def _run_suites(suites, type)
offset = 0
suites.reject do |suite|
@@ -11,7 +14,9 @@ suite.send("#{type}_methods").grep(filter).empty?
end.map do |suite|
print "#{suite} "
+ start_time = Time.now
result = _run_suite suite, type
+ print_elapsed_time $stdout, start_time
puts
report.each_with_index do |msg, i|
puts "%3d) %s" % [offset + i + 1, msg.gsub(/\n/, "\n ")]
| Support elapsed time in MiniTest formatter.
|
diff --git a/lib/garage_client/request.rb b/lib/garage_client/request.rb
index abc1234..def5678 100644
--- a/lib/garage_client/request.rb
+++ b/lib/garage_client/request.rb
@@ -24,6 +24,8 @@ request.url(path, params)
request.body = body if body
request.headers.update(options[:headers]) if options[:headers]
+ request.options.timeout = options[:timeout] if options[:timeout]
+ request.options.open_timeout = options[:open_timeout] if options[:open_timeout]
end
options[:raw] ? response : GarageClient::Response.new(self, response)
end
| Add :timeout and :open_timeout option
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.