diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/app/models/order_detail.rb b/app/models/order_detail.rb index abc1234..def5678 100644 --- a/app/models/order_detail.rb +++ b/app/models/order_detail.rb @@ -19,4 +19,8 @@ quantity: quantity } end + + def value + quantity * price + end end
Add value method to order details
diff --git a/lib/core_extensions/regexp/examples.rb b/lib/core_extensions/regexp/examples.rb index abc1234..def5678 100644 --- a/lib/core_extensions/regexp/examples.rb +++ b/lib/core_extensions/regexp/examples.rb @@ -29,5 +29,4 @@ end end -# Regexp#include is private for ruby 2.0 and below -Regexp.send(:include, CoreExtensions::Regexp::Examples) +Regexp.include(CoreExtensions::Regexp::Examples)
Drop workaround for ruby 2.0 support
diff --git a/core/app/models/spree/calculator.rb b/core/app/models/spree/calculator.rb index abc1234..def5678 100644 --- a/core/app/models/spree/calculator.rb +++ b/core/app/models/spree/calculator.rb @@ -17,12 +17,6 @@ ################################################################### def self.register(*klasses) - # @@calculators.add(self) - # klasses.each do |klass| - # klass = klass.constantize if klass.is_a?(String) - # klass.register_calculator(self) - # end - # self end # Returns all calculators applicable for kind of work
Remove commented out code from Calculator.register
diff --git a/SentryReactNative.podspec b/SentryReactNative.podspec index abc1234..def5678 100644 --- a/SentryReactNative.podspec +++ b/SentryReactNative.podspec @@ -18,8 +18,7 @@ s.preserve_paths = '*.js' s.dependency 'React' - s.dependency 'Sentry', '~> 3.0.1' - s.dependency 'KSCrash', '~> 1.15.8' + s.dependency 'Sentry/KSCrash', '~> 3.0.4' s.source_files = 'ios/RNSentry*.{h,m}' s.public_header_files = 'ios/RNSentry.h'
Update podspec to use subspec of KSCrash
diff --git a/app/models/owner.rb b/app/models/owner.rb index abc1234..def5678 100644 --- a/app/models/owner.rb +++ b/app/models/owner.rb @@ -37,10 +37,11 @@ def after_create super mail = Mail.new - mail.from 'info@cocoapods.org' - mail.to email - mail.subject 'This is a test email' - mail.body "Hi #{self.name}!" + mail.charset = 'UTF-8' + mail.from = 'info@cocoapods.org' + mail.to = email + mail.subject = 'This is a test email' + mail.body = "Hi #{self.name}!" mail.deliver! end end
[Owner] Set charset of email to UTF-8.
diff --git a/db/migrations/010_add_indexes_on_uuid_resources.rb b/db/migrations/010_add_indexes_on_uuid_resources.rb index abc1234..def5678 100644 --- a/db/migrations/010_add_indexes_on_uuid_resources.rb +++ b/db/migrations/010_add_indexes_on_uuid_resources.rb @@ -2,7 +2,7 @@ change do alter_table(:uuid_resources) do add_index :uuid - add_index [:model_class, :key] + add_index [:key, :model_class] end end end
Update index order to be able to use where clause with 'key' only
diff --git a/SGHTTPRequest.podspec b/SGHTTPRequest.podspec index abc1234..def5678 100644 --- a/SGHTTPRequest.podspec +++ b/SGHTTPRequest.podspec @@ -7,7 +7,7 @@ s.author = "SeatGeek" s.watchos.deployment_target = '2.0' s.ios.deployment_target = '7.0' - s.source = { :git => "https://github.com/seatgeek/SGHTTPRequest.git", :tag => "1.6.0" } + s.source = { :git => "https://github.com/seatgeek/SGHTTPRequest.git", :tag => "1.7.0" } s.source_files = 'SGHTTPRequest/**/*.{h,m}' s.requires_arc = true s.dependency "AFNetworking", '~>3.0'
Update pod spec to v1.7.0
diff --git a/bin/console.rb b/bin/console.rb index abc1234..def5678 100644 --- a/bin/console.rb +++ b/bin/console.rb @@ -5,4 +5,4 @@ require 'mote_sms' require 'irb' -IRB.start(__FILE__)+IRB.start(__FILE__)
Add line at the end of file
diff --git a/spec/mesos/slave_spec.rb b/spec/mesos/slave_spec.rb index abc1234..def5678 100644 --- a/spec/mesos/slave_spec.rb +++ b/spec/mesos/slave_spec.rb @@ -0,0 +1,79 @@+# encoding: utf-8 + +require 'spec_helper' + +describe 'mesos::slave' do + before do + File.stub(:exist?).and_call_original + File.stub(:exist?).with('/usr/local/sbin/mesos-master').and_return(false) + File.stub(:exists?).and_call_original + File.stub(:exists?).with('/usr/local/sbin/mesos-master').and_return(false) + + stub_command('test -L /usr/lib/libjvm.so') + stub_command("update-alternatives --display java | grep '/usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java - priority 1061'") + stub_command("/usr/bin/python -c 'import setuptools'") + end + + shared_examples_for 'a slave recipe' do + it 'creates deploy env template' do + expect(chef_run).to create_template '/usr/local/var/mesos/deploy/mesos-deploy-env.sh' + end + + it 'creates mesos slave env template' do + expect(chef_run).to create_template '/usr/local/var/mesos/deploy/mesos-slave-env.sh' + end + end + + context 'when installed from mesosphere' do + let :chef_run do + ChefSpec::Runner.new do |node| + node.set[:mesos][:type] = 'mesosphere' + node.set[:mesos][:slave][:master] = 'test-master' + node.set[:mesos][:mesosphere][:with_zookeeper] = true + end.converge(described_recipe) + end + + it_behaves_like 'an installation from mesosphere' + it_behaves_like 'a slave recipe' + + it 'creates /etc/mesos/zk' do + expect(chef_run).to create_template '/etc/mesos/zk' + end + + it 'creates /etc/default/mesos' do + expect(chef_run).to create_template '/etc/default/mesos' + end + + it 'creates /etc/default/mesos-slave' do + expect(chef_run).to create_template '/etc/default/mesos-slave' + end + + it 'creates /etc/mesos-slave' do + expect(chef_run).to create_directory '/etc/mesos-slave' + end + + it 'run a bash cleanup script' do + expect(chef_run).to run_bash('cleanup /etc/mesos-slave/') + end + + context 'configuration options in /etc/mesos-slave' do + pending + end + + it 'restarts mesos-slave service' do + expect(chef_run).to restart_service 'mesos-slave' + end + end + + context 'when installed from source' do + let :chef_run do + ChefSpec::Runner.new do |node| + node.set[:mesos][:type] = 'source' + node.set[:mesos][:slave][:master] = 'test-master' + end.converge(described_recipe) + end + + it_behaves_like 'an installation from source' + it_behaves_like 'a slave recipe' + end +end
Add unit tests for slave recipe
diff --git a/SPTDataLoader.podspec b/SPTDataLoader.podspec index abc1234..def5678 100644 --- a/SPTDataLoader.podspec +++ b/SPTDataLoader.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "SPTDataLoader" - s.version = "1.0.0" + s.version = "1.0.1" s.summary = "SPTDataLoader is Spotify's HTTP library for Objective-C" s.description = <<-DESC @@ -15,7 +15,7 @@ s.license = "Apache 2.0" s.author = { "Will Sackfield" => "sackfield@spotify.com" } s.platform = :ios, "7.0" - s.source = { :git => "https://github.com/spotify/SPTDataLoader.git", :tag => "1.0.0" } + s.source = { :git => "https://github.com/spotify/SPTDataLoader.git", :tag => "1.0.1" } s.source_files = "include/SPTDataLoader/*.h", "SPTDataLoader/*.{h,m}" s.public_header_files = "include/SPTDataLoader/*.h" s.xcconfig = { 'OTHER_LDFLAGS' => '-lObjC' }
Update podspec to reflect latest release * In the future we should do this on every release
diff --git a/active_decorator.gemspec b/active_decorator.gemspec index abc1234..def5678 100644 --- a/active_decorator.gemspec +++ b/active_decorator.gemspec @@ -13,7 +13,9 @@ s.summary = %q{A simple and Rubyish view helper for Rails} s.description = %q{A simple and Rubyish view helper for Rails} - s.files = `git ls-files`.split("\n") + s.files = Dir.chdir(File.expand_path('..', __FILE__)) do + `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } + end s.require_paths = ["lib"] s.add_dependency 'activesupport'
Exclude test files from the gem package
diff --git a/UIImageColors.podspec b/UIImageColors.podspec index abc1234..def5678 100644 --- a/UIImageColors.podspec +++ b/UIImageColors.podspec @@ -8,6 +8,6 @@ spec.source = { :git => "https://github.com/jathu/UIImageColors.git", :tag => spec.version } spec.ios.deployment_target = "8.0" - spec.source_files = "*.swift" + spec.source_files = "Sources/*.swift" spec.requires_arc = true end
Update podspec source files path
diff --git a/test/system/system_test.rb b/test/system/system_test.rb index abc1234..def5678 100644 --- a/test/system/system_test.rb +++ b/test/system/system_test.rb @@ -17,7 +17,7 @@ test = %Q("#{@here_path}/test_project/_output") truth = %Q("#{@here_path}/truth") assert_equal true, - system("diff --recursive #{test} #{truth}"), + system("diff --unified --recursive #{test} #{truth}"), "'diff' found differences between #{test} and #{truth}" end
Use unified 'diff' format in an effort to troubleshoot the failed RunCodeRun system test that succeeds on my local Ruby v1.9.1 installation >:-<
diff --git a/lib/rubocop/cop/lint/duplicate_case_condition.rb b/lib/rubocop/cop/lint/duplicate_case_condition.rb index abc1234..def5678 100644 --- a/lib/rubocop/cop/lint/duplicate_case_condition.rb +++ b/lib/rubocop/cop/lint/duplicate_case_condition.rb @@ -31,21 +31,11 @@ MSG = 'Duplicate `when` condition detected.' def on_case(case_node) - case_node.when_branches.each_with_object([]) do |when_node, previous| + case_node.when_branches.each_with_object(Set.new) do |when_node, previous| when_node.each_condition do |condition| - next unless repeated_condition?(previous, condition) - - add_offense(condition) + add_offense(condition) unless previous.add?(condition) end - - previous.push(when_node.conditions) end - end - - private - - def repeated_condition?(previous, condition) - previous.any? { |c| c.include?(condition) } end end end
Refactor Lint/DuplicateCaseCondition cop with Set
diff --git a/app/controllers/beacons_controller.rb b/app/controllers/beacons_controller.rb index abc1234..def5678 100644 --- a/app/controllers/beacons_controller.rb +++ b/app/controllers/beacons_controller.rb @@ -11,8 +11,13 @@ end def create - @beacon = Beacon.new - render action: 'new' + @beacon = Beacon.new(beacon_params) + + if @beacon.save + redirect_to @beacon, notice: 'Beacon was successfully created.' + else + render action: 'new' + end end def edit @@ -23,4 +28,8 @@ def delete end + + def beacon_params + params.require(:beacon).premit(:major, :minor) + end end
Create a beacon controller edits
diff --git a/app/controllers/players_controller.rb b/app/controllers/players_controller.rb index abc1234..def5678 100644 --- a/app/controllers/players_controller.rb +++ b/app/controllers/players_controller.rb @@ -4,6 +4,11 @@ def create @current_player2 = User.find_by(email: player_params[:email]) + if @current_player2 == current_user + @errors = ['You are already signed in!'] + return render 'new' + end + if @current_player2 && @current_player2.valid_password?(player_params[:password]) session[:player2] = @current_player2.id redirect_to root_path
Add logic to prevent user from signing in as user1 and 2
diff --git a/app/controllers/api/contests_controller.rb b/app/controllers/api/contests_controller.rb index abc1234..def5678 100644 --- a/app/controllers/api/contests_controller.rb +++ b/app/controllers/api/contests_controller.rb @@ -1,22 +1,23 @@ class Api::ContestsController < ApplicationController def show unless contest = Contest.find_by_id(params[:id]) - render(json: {}, status: 404) && return + render(json: {}, status: :not_found) && return end json_data = { + id: params[:id].to_i, name: params[:lang] == 'ja' ? contest.name_ja : contest.name_en, - description: params[:lang] == 'ja' ? contest.description_ja : contest.description_en, + description: params[:lang] == 'ja' ? contest.description_ja : contest.description_en } unless signed_in? - render(json: json_data.merge({joined: false}), status: 404) && return + render(json: json_data.merge(joined: false), status: :ok) && return end is_user_registered = contest.registered_by(current_user) if (!contest.ended? && !is_user_registered) || (!contest.started? && is_user_registered) - render(json: json_data.merge({joined: is_user_registered}), status: 404) && return + render(json: json_data.merge(joined: is_user_registered), status: :ok) && return end render json: {}
Fix Case 1 and 2
diff --git a/app/controllers/queries_controller.rb b/app/controllers/queries_controller.rb index abc1234..def5678 100644 --- a/app/controllers/queries_controller.rb +++ b/app/controllers/queries_controller.rb @@ -8,7 +8,7 @@ case params[:group_by] when "section" for section in @account.main_categories - @results += section.articles.find(:all, :limit => num_records ) + @results += @account.articles.find(:all, :conditions => { :section_id => section.id, :status => 'published' }, :limit => num_records, :order => "published_at DESC" ) end end
Refactor query on Queries controller.
diff --git a/app/controllers/posts/abouts_controller.rb b/app/controllers/posts/abouts_controller.rb index abc1234..def5678 100644 --- a/app/controllers/posts/abouts_controller.rb +++ b/app/controllers/posts/abouts_controller.rb @@ -18,7 +18,7 @@ # GET /a-propos/1.json def show redirect_to @about, status: :moved_permanently if request.path_parameters[:id] != @about.slug - seo_tag_show @about + seo_tag_show about end private
Use decorated version of object for seo_tag_show
diff --git a/age_jp.gemspec b/age_jp.gemspec index abc1234..def5678 100644 --- a/age_jp.gemspec +++ b/age_jp.gemspec @@ -18,7 +18,7 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] - spec.add_dependency "activesupport", '>= 3.2' + spec.add_dependency "activesupport", '>= 4.1' spec.add_development_dependency "bundler", ">= 1.0" spec.add_development_dependency "rake", ">= 10.0"
Set dependent activesupport version >= 4.1
diff --git a/lib/bond/completions/kernel.rb b/lib/bond/completions/kernel.rb index abc1234..def5678 100644 --- a/lib/bond/completions/kernel.rb +++ b/lib/bond/completions/kernel.rb @@ -1,6 +1,8 @@ complete(:methods=>%w{Kernel#raise Kernel#fail}) { objects_of(Class).select {|e| e < StandardError } } complete(:method=>%w{Kernel#system Kernel#exec}) {|e| - ENV['PATH'].split(File::PATH_SEPARATOR).uniq.map {|e| Dir.entries(e) }.flatten.uniq - ['.', '..'] + ENV['PATH'].split(File::PATH_SEPARATOR).uniq.map {|e| + File.directory?(e) ? Dir.entries(e) : [] + }.flatten.uniq - ['.', '..'] } complete(:method=>"Kernel#require", :search=>:files) { paths = $:.map {|e| Dir["#{e}/**/*.{rb,bundle,dll,so}"].map {|f| f.sub(e+'/', '') } }.flatten
Support entries in $PATH which do not exist Signed-off-by: Gabriel Horner <0ad009e2f1307e2b56a46d2786acc83aaf18056e@gmail.com>
diff --git a/candela.gemspec b/candela.gemspec index abc1234..def5678 100644 --- a/candela.gemspec +++ b/candela.gemspec @@ -19,4 +19,5 @@ s.add_dependency "rails", "~> 4.0.0" s.add_development_dependency "sqlite3" + s.add_development_dependency "capybara" end
Add capybara as a development dependency.
diff --git a/app/helpers/ads/application_helper.rb b/app/helpers/ads/application_helper.rb index abc1234..def5678 100644 --- a/app/helpers/ads/application_helper.rb +++ b/app/helpers/ads/application_helper.rb @@ -13,7 +13,6 @@ # TODO user can specifiy if he wanna load one ad in render time. banner = Banner.find_by_name name div_for banner, class: banner.name, data: {name: banner.name, width: banner.width, height: banner.height,} do - banner.name end end end
Remove banner name from div
diff --git a/app/models/conversation_summarizer.rb b/app/models/conversation_summarizer.rb index abc1234..def5678 100644 --- a/app/models/conversation_summarizer.rb +++ b/app/models/conversation_summarizer.rb @@ -20,7 +20,7 @@ end def first_message - self.conversation.messages.order('created_at DESC').first + conversation.first_message end end
Fix problem with the generated title
diff --git a/opal.gemspec b/opal.gemspec index abc1234..def5678 100644 --- a/opal.gemspec +++ b/opal.gemspec @@ -19,7 +19,7 @@ s.add_dependency 'source_map' - s.add_development_dependency 'mspec', '1.5.18' + s.add_development_dependency 'mspec', '1.5.20' s.add_development_dependency 'rake' s.add_development_dependency 'racc' s.add_development_dependency 'opal-sprockets', '~> 0.2.1'
Update to mspec 1.5.20 (latest) for running rubyspecs
diff --git a/lib/facter/sendmail_version.rb b/lib/facter/sendmail_version.rb index abc1234..def5678 100644 --- a/lib/facter/sendmail_version.rb +++ b/lib/facter/sendmail_version.rb @@ -4,7 +4,8 @@ # Facter.add(:sendmail_version) do setcode do - version = Facter::Util::Resolution.exec('sendmail -d0.4 -bv root') + command = 'sendmail -d0.4 -ODontProbeInterfaces=true -bv root' + version = Facter::Util::Resolution.exec(command) if version =~ /^Version ([0-9.]+)$/ $1 else
Set DontProbeInterfaces when getting sendmail version
diff --git a/lib/fluent/plugin/out_logio.rb b/lib/fluent/plugin/out_logio.rb index abc1234..def5678 100644 --- a/lib/fluent/plugin/out_logio.rb +++ b/lib/fluent/plugin/out_logio.rb @@ -9,6 +9,12 @@ config_param :output_type, :default => 'json' config_param :host, :string, :default => 'localhost' config_param :port, :integer, :default => 28777 + config_param :node, :string, :default => nil + config_param :stream, :string, :default => nil + config_param :log_level, :string, :default => 'info' + config_param :node_key_name, :string, :default => 'hostname' + config_param :stream_key_name, :string, :default => nil + config_param :log_level_key_name, :string, :default => nil def configure(conf) super @@ -31,9 +37,17 @@ end def emit(tag, es, chain) - es.each {|time,record| - @socket.puts "+log|#{tag}|#{record[:hostname] or Socket.gethostname}||#{@formatter.format(tag, time, record).chomp}\r\n" - } + es.each do |time,record| + stream = @stream ? @stream : tag + node = @node ? @node : Socket.gethostname + logLevel = @log_level + + stream = (record[@stream_key_name] or stream) if @stream_key_name + node = (record[@node_key_name] or node) if @node_key_name + logLevel = (record[@log_level_key_name] or logLevel) if @log_level_key_name + + @socket.puts "+log|#{stream}|#{node}|#{logLevel}|#{@formatter.format(tag, time, record).chomp}\r\n" + end chain.next rescue => e
Add more options for formatting the output
diff --git a/config/initializers/delayed_job_config.rb b/config/initializers/delayed_job_config.rb index abc1234..def5678 100644 --- a/config/initializers/delayed_job_config.rb +++ b/config/initializers/delayed_job_config.rb @@ -2,4 +2,5 @@ # Delayed::Worker.destroy_successful_jobs = false Delayed::Worker.sleep_delay = 60 Delayed::Worker.max_attempts = 25 -Delayed::Worker.max_run_time = 5.minutes+Delayed::Worker.max_run_time = 5.minutes +Delayed::Worker.logger = Rails.logger
Set Rails logger as delayed job logger
diff --git a/config/initializers/gravatar_image_tag.rb b/config/initializers/gravatar_image_tag.rb index abc1234..def5678 100644 --- a/config/initializers/gravatar_image_tag.rb +++ b/config/initializers/gravatar_image_tag.rb @@ -0,0 +1,8 @@+GravatarImageTag.configure do |config| +# config.default_image = nil # Set this to use your own default gravatar image rather then serving up Gravatar's default image [ 'http://example.com/images/default_gravitar.jpg', :identicon, :monsterid, :wavatar, 404 ]. +# config.filetype = nil # Set this if you require a specific image file format ['gif', 'jpg' or 'png']. Gravatar's default is png +# config.include_size_attributes = true # The height and width attributes of the generated img will be set to avoid page jitter as the gravatars load. Set to false to leave these attributes off. +# config.rating = nil # Set this if you change the rating of the images that will be returned ['G', 'PG', 'R', 'X']. Gravatar's default is G + config.size = 160 # Set this to globally set the size of the gravatar image returned (1..512). Gravatar's default is 80 +# config.secure = false # Set this to true if you require secure images on your pages. +end
Add initializer to configure gravatar image tags
diff --git a/lib/graphql/relay/page_info.rb b/lib/graphql/relay/page_info.rb index abc1234..def5678 100644 --- a/lib/graphql/relay/page_info.rb +++ b/lib/graphql/relay/page_info.rb @@ -5,8 +5,8 @@ PageInfo = GraphQL::ObjectType.define do name("PageInfo") description("Information about pagination in a connection.") - field :hasNextPage, !types.Boolean, "Indicates if there are more pages to fetch", property: :has_next_page - field :hasPreviousPage, !types.Boolean, "Indicates if there are any pages prior to the current page", property: :has_previous_page + field :hasNextPage, !types.Boolean, "Indicates if there are more pages to fetch (only meaningful if `first` argument is present)", property: :has_next_page + field :hasPreviousPage, !types.Boolean, "Indicates if there are any pages prior to the current page (only meaningful if `last` argument is present)", property: :has_previous_page field :startCursor, types.String, "When paginating backwards, the cursor to continue", property: :start_cursor field :endCursor, types.String, "When paginating forwards, the cursor to continue", property: :end_cursor default_relay true
Add some details to hasNextPage/hasPreviousPage descriptions.
diff --git a/chaplin.gemspec b/chaplin.gemspec index abc1234..def5678 100644 --- a/chaplin.gemspec +++ b/chaplin.gemspec @@ -14,7 +14,8 @@ gem.add_runtime_dependency "faraday" gem.add_runtime_dependency "mustache" - gem.add_development_dependency "pry" + gem.add_runtime_dependency "pry" + gem.add_development_dependency "rake" gem.add_development_dependency "rspec" gem.add_development_dependency "cucumber"
Add pry to runtime dependencies for debugging requests
diff --git a/core/lib/spree/core/controller_helpers.rb b/core/lib/spree/core/controller_helpers.rb index abc1234..def5678 100644 --- a/core/lib/spree/core/controller_helpers.rb +++ b/core/lib/spree/core/controller_helpers.rb @@ -1,10 +1,11 @@ module Spree module Core module ControllerHelpers - def self.included(base) - base.class_eval do + def self.included(klass) + klass.class_eval do include Spree::Core::ControllerHelpers::Common include Spree::Core::ControllerHelpers::Auth + include Spree::Core::ControllerHelpers::RespondWith include Spree::Core::ControllerHelpers::Order end end
Add Spree::Core::ControllerHelpers which can be included to include all its submodules
diff --git a/lib/jasmine-phantom/tasks.rake b/lib/jasmine-phantom/tasks.rake index abc1234..def5678 100644 --- a/lib/jasmine-phantom/tasks.rake +++ b/lib/jasmine-phantom/tasks.rake @@ -12,7 +12,10 @@ port = config.instance_variable_get :@jasmine_server_port script = File.join File.dirname(__FILE__), 'run-jasmine.js' - sh "phantomjs #{script} http://localhost:#{port}" + + pid = Process.spawn "phantomjs #{script} http://localhost:#{port}" + _, status = Process.waitpid2 pid + exit(1) unless status.success? end end end
Use Process.spawn instead of sh
diff --git a/app/serializers/user_profile_serializer.rb b/app/serializers/user_profile_serializer.rb index abc1234..def5678 100644 --- a/app/serializers/user_profile_serializer.rb +++ b/app/serializers/user_profile_serializer.rb @@ -1,3 +1,4 @@ class UserProfileSerializer < ActiveModel::Serializer attributes :nusnet_id, :name, :email, :gender, :faculty, :first_major, :second_major, :matriculation_year, :access_token + has_many :timetables, serializer: TimetableSerializer end
Include timetables in user profile payload
diff --git a/spec/unit/data_mapper/relation/mapper/class_methods/from_spec.rb b/spec/unit/data_mapper/relation/mapper/class_methods/from_spec.rb index abc1234..def5678 100644 --- a/spec/unit/data_mapper/relation/mapper/class_methods/from_spec.rb +++ b/spec/unit/data_mapper/relation/mapper/class_methods/from_spec.rb @@ -3,20 +3,12 @@ describe Relation::Mapper, '.from' do subject { described_class.from(other, name) } - let(:model) { - mock_model(:TestModel) - } + let(:model) { mock_model(:TestModel) } + let(:target_model) { mock_model(:Address) } - let(:other) { - model_class = model - address_model = mock_model('Address') - - Class.new(described_class) { - model model_class - map :id, Integer - has 1, :address, address_model - } - } + let(:other) { mock_mapper(model, [ attribute ], [ relationship ]) } + let(:attribute) { mock_attribute(:id, Integer) } + let(:relationship) { mock_relationship(:address, :source_model => model, :target_model => target_model) } context "with another mapper" do context "without a name" do
Fix Relation::Mapper.from spec under 1.8 rubies
diff --git a/kiwi/spec/controllers/questions_controller_spec.rb b/kiwi/spec/controllers/questions_controller_spec.rb index abc1234..def5678 100644 --- a/kiwi/spec/controllers/questions_controller_spec.rb +++ b/kiwi/spec/controllers/questions_controller_spec.rb @@ -7,7 +7,22 @@ expect(assigns(:questions)).to eq Question.all end + it "#new" do + get :new + end + context "#create" do + + it "creates a question with valid params" do + post :create, question: {title: "valid", content: "this is content"} + expect(Question.find(assigns[:question].id)).to be true + end + + it "doesn't create a question when params are invalid" do + post :create, question: {title: "invalid", content: ""} + expect(Question.find(assigns[:question].id)).to be false + end + end end
Add work on questions controller spec for create route
diff --git a/db/migrate/20140927001217_create_users.rb b/db/migrate/20140927001217_create_users.rb index abc1234..def5678 100644 --- a/db/migrate/20140927001217_create_users.rb +++ b/db/migrate/20140927001217_create_users.rb @@ -2,7 +2,7 @@ def change create_table :users do |t| t.string :email, null: false, unique: true - t.string :password_hash, null: false + t.string :password_digest, null: false t.timestamps end
Replace :password_hash with :password_digest as is required by the newer Bcrypt-Rails integration using the HasSecurePassword feature.
diff --git a/spec/rollbar/plugins/delayed_job/job_data_spec.rb b/spec/rollbar/plugins/delayed_job/job_data_spec.rb index abc1234..def5678 100644 --- a/spec/rollbar/plugins/delayed_job/job_data_spec.rb +++ b/spec/rollbar/plugins/delayed_job/job_data_spec.rb @@ -1,7 +1,20 @@ require 'spec_helper' - require 'rollbar/plugins/delayed_job/job_data' require 'delayed/backend/test' + +# In delayed_job/lib/delayed/syck_ext.rb YAML.load_dj +# is broken cause it's defined as an instance method +# instead of module/class method. This is breaking +# the tests for ruby 1.8.7 +if YAML.parser.class.name =~ /syck|yecht/i + module YAML + def self.load_dj(yaml) + # See https://github.com/dtao/safe_yaml + # When the method is there, we need to load our YAML like this... + respond_to?(:unsafe_load) ? load(yaml, :safe => false) : load(yaml) + end + end +end describe Rollbar::Delayed::JobData do describe '#to_hash' do
Fix tests for ruby 1.8.7
diff --git a/app/controllers/tweets.rb b/app/controllers/tweets.rb index abc1234..def5678 100644 --- a/app/controllers/tweets.rb +++ b/app/controllers/tweets.rb @@ -3,7 +3,7 @@ # end get '/tweets/index'do - @tweet = Tweet.all + @tweet = Tweet.order('id DESC') erb :'tweets/index' end
Modify get route to order all tweet entries by last tweet tweeted.
diff --git a/app/uploaders/site_figure_uploader.rb b/app/uploaders/site_figure_uploader.rb index abc1234..def5678 100644 --- a/app/uploaders/site_figure_uploader.rb +++ b/app/uploaders/site_figure_uploader.rb @@ -18,7 +18,7 @@ process resize_to_fill: [570, 360] def extension_whitelist - %w[png] + %w[png jpg jpeg] end def filename
Fix site figure file extension constraint incorrect
diff --git a/_plugins/geolookup.rb b/_plugins/geolookup.rb index abc1234..def5678 100644 --- a/_plugins/geolookup.rb +++ b/_plugins/geolookup.rb @@ -16,6 +16,11 @@ :lookup => :google ) response = Geocoder::search(query) + + if response.empty? + raise "#{query.inspect} is not a real place" + end + results = response[0].data File.write cache_file, JSON.generate(results) results
Raise exception when location doesn't exist
diff --git a/app/models/role_right.rb b/app/models/role_right.rb index abc1234..def5678 100644 --- a/app/models/role_right.rb +++ b/app/models/role_right.rb @@ -16,9 +16,6 @@ rr.group_id = new_group_id rr.save end - else - err_msg = 'No role_rights records found for group id #{root_id}' - raise Exception, err_msg end end
Fix issue when no role rights are defined
diff --git a/app/models/subscriber.rb b/app/models/subscriber.rb index abc1234..def5678 100644 --- a/app/models/subscriber.rb +++ b/app/models/subscriber.rb @@ -2,6 +2,7 @@ before_save :generate_private_code validates_uniqueness_of :email + validates_presence_of :email def generate_private_code self.private_code = SecureRandom.hex(6)
Validate that something was put into the email field on subscription signup
diff --git a/tasks/extconf/looksee.rake b/tasks/extconf/looksee.rake index abc1234..def5678 100644 --- a/tasks/extconf/looksee.rake +++ b/tasks/extconf/looksee.rake @@ -17,7 +17,7 @@ if Dir.glob("**/#{extension}.{o,so,dll}").length == 0 STDERR.puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" STDERR.puts "Gem actually failed to build. Your system is" - STDERR.puts "NOT configured properly to build #{GEM_NAME}." + STDERR.puts "NOT configured properly to build looksee." STDERR.puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" exit(1) end
Fix extconf:compile task when gem fails to build. Not sure where GEM_NAME is supposed to be defined. Probably a newgem bug.
diff --git a/spec/integration/integration_helper.rb b/spec/integration/integration_helper.rb index abc1234..def5678 100644 --- a/spec/integration/integration_helper.rb +++ b/spec/integration/integration_helper.rb @@ -20,6 +20,10 @@ @env += "#{name}=#{value} " end + def use_cucumber_config(file) + system("mv config/#{file} config/cucumber.yml") + end + # :reek:TooManyStatements def run_command(command) Bundler.with_clean_env do
Add method to setup cucumber.yml file to use
diff --git a/spec/lib/component_validations_spec.rb b/spec/lib/component_validations_spec.rb index abc1234..def5678 100644 --- a/spec/lib/component_validations_spec.rb +++ b/spec/lib/component_validations_spec.rb @@ -14,4 +14,34 @@ signup = Signup.new(@params) expect(signup).to be_valid end + + it "requires an account name" do + signup = Signup.new(@params.merge(:account_name => "")) + expect(signup).to_not be_valid + end + + it "requires an account subdomains" do + signup = Signup.new(@params.merge(:account_subdomain => "")) + expect(signup).to_not be_valid + end + + it "validates the format of the account subdomain" do + signup = Signup.new(@params.merge(:account_subdomain => "foo company")) + expect(signup).to_not be_valid + end + + it "requires a user name" do + signup = Signup.new(@params.merge(:user_name => "")) + expect(signup).to_not be_valid + end + + it "requires a user email" do + signup = Signup.new(@params.merge(:user_email => "")) + expect(signup).to_not be_valid + end + + it "validates the format of the user email" do + signup = Signup.new(@params.merge(:user_email => "jimexample.com")) + expect(signup).to_not be_valid + end end
Test validations on the signup model
diff --git a/spec/policies/account_geocoded_spec.rb b/spec/policies/account_geocoded_spec.rb index abc1234..def5678 100644 --- a/spec/policies/account_geocoded_spec.rb +++ b/spec/policies/account_geocoded_spec.rb @@ -4,9 +4,9 @@ describe 'Policies::AccountGeocoded' do describe '.entity_geocoded' do - context 'when entity have latitude and longitude' do + context 'when entity have address, latitude and longitude' do it 'should return true' do - entity = double('Entity', latitude: 10.0000, longitude: 10.0000) + entity = double('Entity', address: 'Address', latitude: 10.0000, longitude: 10.0000) result = Villeme::Policies::EntityGeocoded.is_geocoded?(entity) @@ -16,7 +16,7 @@ context 'when entity DO NOT have longitude' do it 'should return false' do - entity = double('Entity', latitude: 10.0000, longitude: nil) + entity = double('Entity', address: 'Address', latitude: 10.0000, longitude: nil) result = Villeme::Policies::EntityGeocoded.is_geocoded?(entity) @@ -27,7 +27,7 @@ context 'when entity DO NOT have latitude' do it 'should return false' do - entity = double('Entity', latitude: nil, longitude: 10.0000) + entity = double('Entity', address: 'Address', latitude: nil, longitude: 10.0000) result = Villeme::Policies::EntityGeocoded.is_geocoded?(entity) @@ -37,7 +37,7 @@ context 'when entity DO NOT have address' do it 'should return false' do - entity = double('Entity', address: nil) + entity = double('Entity', address: nil, latitude: nil, longitude: 10.0000) result = Villeme::Policies::EntityGeocoded.is_geocoded?(entity)
Adjust in RSpec test on policies
diff --git a/spec/dummy/config/initializers/secret_token.rb b/spec/dummy/config/initializers/secret_token.rb index abc1234..def5678 100644 --- a/spec/dummy/config/initializers/secret_token.rb +++ b/spec/dummy/config/initializers/secret_token.rb @@ -5,3 +5,4 @@ # Make sure the secret is at least 30 characters and all random, # no regular words or you'll be exposed to dictionary attacks. Dummy::Application.config.secret_token = '80d371f907c54c965d525303daef0e356b9ae418e8a0b0a5d3185336cf1465ca8484c98bf66d756e6828ef883f8f3c68cffbda007eb3c66e4729468b5b5db4cb' +Dummy::Application.config.secret_key_base = '49ade6ce637f129a386a7a4c662ba034dd49a8f3741f72ddc6dccf77d6171e33939d54489d92372177215b1f2a8e75216e8a732d250b0ca08f56172635db0bfd'
[JRO] Add `secret_key_base` to quell the warning Rails 4 noise
diff --git a/test/integration_helper.rb b/test/integration_helper.rb index abc1234..def5678 100644 --- a/test/integration_helper.rb +++ b/test/integration_helper.rb @@ -7,6 +7,7 @@ end def accounts + skip if ENV['SKIP_INTEGRATION'] YAML.load_file(File.expand_path('../fixtures/mws.yml', __FILE__)) rescue Errno::ENOENT skip('Credentials missing')
Add environment variable to skip integration tests
diff --git a/test/lsi/word_list_test.rb b/test/lsi/word_list_test.rb index abc1234..def5678 100644 --- a/test/lsi/word_list_test.rb +++ b/test/lsi/word_list_test.rb @@ -0,0 +1,33 @@+require_relative '../test_helper' + +class WordListTest < Test::Unit::TestCase + def test_size_does_not_count_words_twice + list = ClassifierReborn::WordList.new + assert list.size == 0 + + list.add_word('hello') + assert list.size == 1 + + list.add_word('hello') + assert list.size == 1 + + list.add_word('world') + assert list.size == 2 + end + + def test_brackets_return_correct_position_based_on_add_order + list = ClassifierReborn::WordList.new + list.add_word('hello') + list.add_word('world') + assert list['hello'] == 0 + assert list['world'] == 1 + end + + def test_word_for_index_returns_correct_word_based_on_add_order + list = ClassifierReborn::WordList.new + list.add_word('hello') + list.add_word('world') + assert list.word_for_index(0) == 'hello' + assert list.word_for_index(1) == 'world' + end +end
Add some tests for ClassifierRebord::WordList
diff --git a/core/spec/entities/menu/menu_entry_spec.rb b/core/spec/entities/menu/menu_entry_spec.rb index abc1234..def5678 100644 --- a/core/spec/entities/menu/menu_entry_spec.rb +++ b/core/spec/entities/menu/menu_entry_spec.rb @@ -3,5 +3,9 @@ module Abc describe MenuEntry do + it "wraps passed children" do + e = MenuEntry.new('My title', [{:title => 'Child 1'}]) + e.children.first.class.should == MenuEntry + end end end
Expand test coverage for menu_entry.
diff --git a/test/support/assertions.rb b/test/support/assertions.rb index abc1234..def5678 100644 --- a/test/support/assertions.rb +++ b/test/support/assertions.rb @@ -17,7 +17,7 @@ end assert(remaining.empty?, lambda do - "Expected #{mu_pp(collection)} to include only #{mu_pp(expected_elements)}" + "Expected\n\n#{mu_pp(collection)}\n\nto include only\n\n#{mu_pp(expected_elements)}" end) end end
Make collections stand out better in error message
diff --git a/stdlib/thread.rb b/stdlib/thread.rb index abc1234..def5678 100644 --- a/stdlib/thread.rb +++ b/stdlib/thread.rb @@ -0,0 +1,17 @@+class Thread + def self.current + @current ||= self.new + end + + def initialize + @vars = {} + end + + def [](key) + @vars[key] + end + + def []=(key, val) + @vars[key] = val + end +end
Add a stubbed Thread implementation for stdlib
diff --git a/test/unit/case_metadata.rb b/test/unit/case_metadata.rb index abc1234..def5678 100644 --- a/test/unit/case_metadata.rb +++ b/test/unit/case_metadata.rb @@ -4,7 +4,7 @@ testcase "VCLog" do test "VERSION is set" do - ::VCLog::VERSION.assert == File.read('profile/version').strip + ::VCLog::VERSION.assert == File.read('var/version').strip end end
Fix metadata test for new var location.
diff --git a/celluloid-zmq.gemspec b/celluloid-zmq.gemspec index abc1234..def5678 100644 --- a/celluloid-zmq.gemspec +++ b/celluloid-zmq.gemspec @@ -8,11 +8,7 @@ gem.summary = "Celluloid::ZMQ provides concurrent Celluloid actors that can listen for 0MQ events" gem.homepage = "http://github.com/tarcieri/dcell" - gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } - gem.files = `git ls-files`.split("\n") - gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") gem.name = "celluloid-zmq" - gem.require_paths = ["lib"] gem.version = Celluloid::ZMQ::VERSION gem.add_dependency "celluloid", ">= 0.6.2" @@ -23,4 +19,11 @@ gem.add_development_dependency "rake" gem.add_development_dependency "rspec", ">= 2.7.0" + + # Files + ignores = File.read(".gitignore").split(/\r?\n/).reject{ |f| f =~ /^(#.+|\s*)$/ }.map {|f| Dir[f] }.flatten + gem.files = (Dir['**/*','.gitignore'] - ignores).reject {|f| !File.file?(f) } + gem.test_files = (Dir['spec/**/*','.gitignore'] - ignores).reject {|f| !File.file?(f) } + # gem.executables = Dir['bin/*'].map { |f| File.basename(f) } + gem.require_paths = ['lib'] end
Use a better mechanism for locating files in the gemspec
diff --git a/powerdns_dyndns.gemspec b/powerdns_dyndns.gemspec index abc1234..def5678 100644 --- a/powerdns_dyndns.gemspec +++ b/powerdns_dyndns.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |spec| spec.name = 'powerdns_dyndns' - spec.version = '0.0.1' + spec.version = '0.0.2' spec.authors = ['henning mueller'] spec.email = ['mail@nning.io'] @@ -14,13 +14,13 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ['lib'] - spec.add_development_dependency 'bundler', '~> 1.7' - spec.add_development_dependency 'rake', '~> 10.0' - spec.add_development_dependency 'rspec', '~> 3.1.0' - spec.add_development_dependency 'sqlite3', '~> 1.3.10' + spec.add_development_dependency 'bundler', '~> 1.13' + spec.add_development_dependency 'rake', '~> 12.0' + spec.add_development_dependency 'rspec', '~> 3.5.0' + spec.add_development_dependency 'sqlite3', '~> 1.3.13' - spec.add_runtime_dependency 'powerdns_db_cli', '>= 0', '~> 0.0.1' - spec.add_runtime_dependency 'rack', '~> 1.5.2' - spec.add_runtime_dependency 'rack-test', '~> 0.6.2' - spec.add_runtime_dependency 'sinatra', '~> 1.4.5' + spec.add_runtime_dependency 'powerdns_db_cli', '>= 0', '~> 0.0.6' + spec.add_runtime_dependency 'rack', '~> 1.5.5' + spec.add_runtime_dependency 'rack-test', '~> 0.6.3' + spec.add_runtime_dependency 'sinatra', '~> 1.4.7' end
Update dependencies and bump version
diff --git a/bwoken.gemspec b/bwoken.gemspec index abc1234..def5678 100644 --- a/bwoken.gemspec +++ b/bwoken.gemspec @@ -10,6 +10,7 @@ gem.authors = ['Brad Grzesiak'] gem.email = ['brad@bendyworks.com'] gem.homepage = 'https://bendyworks.github.com/bwoken' + gem.license = 'MIT' gem.files = Dir['LICENSE', 'README.md', 'bin/**/*', 'lib/**/*'] gem.require_path = 'lib'
Add license line to gemspec
diff --git a/ops_genie_client.gemspec b/ops_genie_client.gemspec index abc1234..def5678 100644 --- a/ops_genie_client.gemspec +++ b/ops_genie_client.gemspec @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = 'ops_genie_client' - s.version = '0.2.1.1' + s.version = '0.2.2.0' s.summary = 'Client for the OpsGenie API using the Obsidian HTTP client' s.description = ' '
Package version is increased from 0.2.1.1 to 0.2.2.0
diff --git a/config/environment.rb b/config/environment.rb index abc1234..def5678 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -1,4 +1,4 @@-RAILS_GEM_VERSION = '2.3.8' unless defined? RAILS_GEM_VERSION +RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION require File.join(File.dirname(__FILE__), 'boot')
Switch back to Rails 2.3.5
diff --git a/app/models/meeting.rb b/app/models/meeting.rb index abc1234..def5678 100644 --- a/app/models/meeting.rb +++ b/app/models/meeting.rb @@ -1,2 +1,6 @@ class Meeting < ActiveRecord::Base + validates_presence_of :date + + scope :past, -> { where('date < ?', Date.today) } + scope :upcoming, -> { where('date >= ?', Date.today) } end
Validate presence of date and create past and upcoming scopes
diff --git a/test/module_youtube_test.rb b/test/module_youtube_test.rb index abc1234..def5678 100644 --- a/test/module_youtube_test.rb +++ b/test/module_youtube_test.rb @@ -11,7 +11,7 @@ should "detect and fetch raw youtube URL" do uri = "http://www.youtube.com/watch?v=bXjbMIZzAgs" - exp_result =/^Christmas Light Hero \(rating: [0-9.]+ \([0-9]+\), views: [0-9]+\)$/ + exp_result =/^Christmas Light Hero \(Original\) \(rating: [0-9.]+ \([0-9]+\), views: [0-9]+\)$/ @bot.expects(:send_privmsg).with("#channel", regexp_matches(exp_result)) @module.privmsg(@bot, "someone", "#channel", uri) end
Fix youtube module test because of changed title Author changed the title of the URL so the test broke. Well ;) Signed-off-by: Aki Saarinen <278bc57fbbff6b7b38435aea0f9d37e3d879167e@akisaarinen.fi>
diff --git a/test/module_youtube_test.rb b/test/module_youtube_test.rb index abc1234..def5678 100644 --- a/test/module_youtube_test.rb +++ b/test/module_youtube_test.rb @@ -11,7 +11,7 @@ should "detect and fetch raw youtube URL" do uri = "http://www.youtube.com/watch?v=bXjbMIZzAgs" - exp_result =/^Christmas Light Hero \(rating: [0-9.]+ \([0-9]+\), views: [0-9]+\)$/ + exp_result =/^Christmas Light Hero.* \(rating: [0-9.]+ \([0-9]+\), views: [0-9]+\)$/ @bot.expects(:send_privmsg).with("#channel", regexp_matches(exp_result)) @module.privmsg(@bot, "someone", "#channel", uri) end
Fix test for youtube module Video title had changed. Add a more tolerant regex. Signed-off-by: Aki Saarinen <278bc57fbbff6b7b38435aea0f9d37e3d879167e@akisaarinen.fi>
diff --git a/test/sti_test.rb b/test/sti_test.rb index abc1234..def5678 100644 --- a/test/sti_test.rb +++ b/test/sti_test.rb @@ -0,0 +1,33 @@+require File.expand_path("../helper.rb", __FILE__) + +class StiTest < MiniTest::Unit::TestCase + include FriendlyId::Test + + test "friendly_id should accept a base and a hash with single table inheritance" do + abstract_klass = Class.new(ActiveRecord::Base) do + extend FriendlyId + friendly_id :foo, :use => :slugged, :slug_column => :bar + end + klass = Class.new(abstract_klass) + assert klass < FriendlyId::Slugged + assert_equal :foo, klass.friendly_id_config.base + assert_equal :bar, klass.friendly_id_config.slug_column + end + + + test "friendly_id should accept a block with single table inheritance" do + abstract_klass = Class.new(ActiveRecord::Base) do + extend FriendlyId + friendly_id :foo do |config| + config.use :slugged + config.base = :foo + config.slug_column = :bar + end + end + klass = Class.new(abstract_klass) + assert klass < FriendlyId::Slugged + assert_equal :foo, klass.friendly_id_config.base + assert_equal :bar, klass.friendly_id_config.slug_column + end + +end
Add failing test for single table inheritance
diff --git a/test/integration/default/minitest/test_default.rb b/test/integration/default/minitest/test_default.rb index abc1234..def5678 100644 --- a/test/integration/default/minitest/test_default.rb +++ b/test/integration/default/minitest/test_default.rb @@ -7,6 +7,6 @@ it "check R version" do system('echo "q()" > /tmp/showversion.R') system('/usr/local/R-devel/bin/R CMD BATCH /tmp/showversion.R') - assert system('grep "R version 3.2.3 beta" showversion.Rout'), 'R version is not expected version. patched version is updated' + assert system('grep "R version 3.2.3 RC" showversion.Rout'), 'R version is not expected version. patched version is updated' end end
Update test case R version 3.2.3 RC
diff --git a/app/admin/artifact.rb b/app/admin/artifact.rb index abc1234..def5678 100644 --- a/app/admin/artifact.rb +++ b/app/admin/artifact.rb @@ -25,14 +25,14 @@ f.input :downloadable f.input :author f.input :file_hash - f.input :mirrors, input_html: { value: f.artifact.mirrors.join(',') } - f.input :more_info_urls, input_html: { value: f.artifact.more_info_urls.join(',') } + f.input :mirrors, input_html: { value: f.artifact.mirrors.try(:join, ',') } + f.input :more_info_urls, input_html: { value: f.artifact.more_info_urls.try(:join, ',') } f.input :license f.input :extra_license_text, as: :text f.input :stored_files - f.input :tag_list, input_html: { value: f.artifact.tag_list.join(',') } - f.input :software_list, input_html: { value: f.artifact.software_list.join(',') } - f.input :file_format_list, input_html: { value: f.artifact.file_format_list.join(',') } + f.input :tag_list, input_html: { value: f.artifact.tag_list.try(:join, ',') } + f.input :software_list, input_html: { value: f.artifact.software_list.try(:join, ',') } + f.input :file_format_list, input_html: { value: f.artifact.file_format_list.try(:join, ',') } end f.actions end
Correct tags, mirrors, etc in admin dashboard in case of nil values
diff --git a/lib/tasks/rename.rake b/lib/tasks/rename.rake index abc1234..def5678 100644 --- a/lib/tasks/rename.rake +++ b/lib/tasks/rename.rake @@ -1,6 +1,7 @@ namespace :rename do - desc "Renaming rapidfire_answer_groups to rapidfire_attempts" - task question_groups_to_surveys: :environment do + desc "Renaming rapidfire_answer_groups to rapidfire_attempts and rapidfire_question_groups to surveys" + task tables_answer_groups_and_question_groups: :environment do ActiveRecord::Migration.rename_table(:rapidfire_answer_groups, :rapidfire_attempts) + ActiveRecord::Migration.rename_table(:rapidfire_question_groups, :rapidfire_surveys) end end
Add task for renaming question_groups table to surveys
diff --git a/lib/webmock/server.rb b/lib/webmock/server.rb index abc1234..def5678 100644 --- a/lib/webmock/server.rb +++ b/lib/webmock/server.rb @@ -2,7 +2,7 @@ module WebMock module Server - STUB_URI = 'http://stubme' + STUB_URI = 'http://localhost:65534' autoload :Handler, "webmock/server/handler" autoload :API, "webmock/server/api"
Change internal stub URL to not timeout
diff --git a/app/models/ability.rb b/app/models/ability.rb index abc1234..def5678 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -1,7 +1,10 @@+# Clase que indica los permisos de los distintos usuarios a partir de su rol. + class Ability include CanCan::Ability - @@user + # Por defecto todos los {AdminUser usuarios} tienen permiso de lectura en + # todos los recursos. def initialize(user) @@user = user || AdminUser.new # Guest user can :read, :all @@ -10,6 +13,7 @@ end end + # Los administradores tienen todos los permisos. def admin can :manage, :all end @@ -18,6 +22,7 @@ can :manage, [Session, Area, Tag] end + # Administra {Asset documentos escaneados} y {Nota notas}. def mesa_de_entrada can :manage, [Asset, Nota, Pase] end
Add sample documentation on Ability.
diff --git a/tools-cd.gemspec b/tools-cd.gemspec index abc1234..def5678 100644 --- a/tools-cd.gemspec +++ b/tools-cd.gemspec @@ -9,8 +9,8 @@ spec.authors = ['Andrew Page'] spec.email = %w(andrew@andrewpage.me) - spec.summary = 'Collection of tools for automating a seedbox.' - spec.description = 'Collection of tools for automating a seedbox.' + spec.summary = 'Collection of tools for automating BitTorrent.' + spec.description = 'Collection of tools for provisioning, managing, and automating BitTorrent seedboxes.' spec.license = 'MIT' spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } @@ -21,6 +21,7 @@ spec.add_dependency 'activesupport', '~> 4.2.0' + # General Development Dependencies spec.add_development_dependency 'bundler' spec.add_development_dependency 'rake', '~> 10.0' spec.add_development_dependency 'pry'
Add more info to the description
diff --git a/db/seeds.rb b/db/seeds.rb index abc1234..def5678 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -0,0 +1,17 @@+# Model for creating a question and associated answer +# Question.create(text: "").answers << Answer.create(text: "") + + +# Theater_Screens_Screenings +Question.create!(text: "What is the relationship between a theater and a screen?").answers << Answer.create!(text: "has_many :screens") +Question.create!(text: "What is the relationship between a theater and a screening?").answers << Answer.create!(text: "has_many :screens") +Question.create!(text: "What is the relationship between a screen and a theater?").answers << Answer.create!(text: "belongs_to :theater") +Question.create!(text: "What is the relationship between a screen and a screening?").answers << Answer.create!(text: "has_many :screenings") +Question.create!(text: "What is the relationship between a screening and a screen?").answers << Answer.create!(text: "belongs_to :screen") + + + + + + +
Add questions and answers for Theaters_Screens_Screenings
diff --git a/db/seeds.rb b/db/seeds.rb index abc1234..def5678 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -1,7 +1,21 @@-# This file should contain all the record creation needed to seed the database with its default values. -# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). -# -# Examples: -# -# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) -# Mayor.create(name: 'Emanuel', city: cities.first) +10.times do { User.create!( username: Faker::Internet.user_name, email: Faker::Internet.email, password:"password" )} + +users = User.all + +#Make Questions: +users.each do |user| + user.create!() +end + +#Make Best Answers + +#Make Reg Answers + +#Make Comments on Questions + +#Make Comments on Answers + +#Make Votes on Questions + +#Make Votes on Answers +
Create users in seed file
diff --git a/db/seeds.rb b/db/seeds.rb index abc1234..def5678 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -7,7 +7,7 @@ # Mayor.create(name: 'Emanuel', city: cities.first) user_count = 25 user_count.times do - User.create(name: Faker::Name.name) + User.create(name: Faker::Name.name, image: Faker::Avatar.image) end user_ids = User.ids
Add user image to seed file
diff --git a/test/test_tmuxpowerline.rb b/test/test_tmuxpowerline.rb index abc1234..def5678 100644 --- a/test/test_tmuxpowerline.rb +++ b/test/test_tmuxpowerline.rb @@ -1,6 +1,6 @@ require 'helper' -class TestTmuxpowerline < Test::Unit::TestCase +class TestTmuxPowerline < Test::Unit::TestCase should "probably rename this file and start testing for real" do flunk "hey buddy, you should probably rename this file and start testing for real" end
Rename TestTmuxpowerline to use PascalCase
diff --git a/attributes/default.rb b/attributes/default.rb index abc1234..def5678 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -1,2 +1,7 @@-default['one_password']['version'] = '4.4.1' -default['one_password']['checksum'] = '007b554067cc0016bedfdcb75577f88b68daeabb5474a219960080e2e9159c90' +if node['platform_version'].split(".")[1] < 10 + default['one_password']['version'] = '4.4.3' + default['one_password']['checksum'] = '6657fc9192b67dde63fa9f67b344dc3bc6b7ff3e501d3dbe0f5712a41d8ee428' +else + default['one_password']['version'] = '5.1' + default['one_password']['checksum'] = 'cd47dcfc12af333e1b4b62a2431c7499635eab01d4c409d9c63baccdcededcee' +end
Update to 1Password 5.1 for >= Yosemite
diff --git a/attributes/default.rb b/attributes/default.rb index abc1234..def5678 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -28,7 +28,6 @@ whois tcpdump nmap - git-annex pwgen mg )
Remove git-annex from package list
diff --git a/attributes/default.rb b/attributes/default.rb index abc1234..def5678 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -27,9 +27,12 @@ when 'suse', 'fedora', 'rhel' default['memcached']['user'] = 'memcached' default['memcached']['group'] = 'memcached' -when 'debian', 'ubuntu' +when 'ubuntu' default['memcached']['user'] = 'memcache' default['memcached']['group'] = 'memcache' +when 'debian' + default['memcached']['user'] = 'nobody' + default['memcached']['group'] = 'nogroup' else default['memcached']['user'] = 'nobody' default['memcached']['user'] = 'nogroup'
[COOK-3682] Fix debian user and group Debian package does not create a `memcache` user, and it uses `nobody` in default config file. Signed-off-by: Seth Vargo <81550dbf04dfd8537ff7b3c014c6fbf86e0889dc@gmail.com>
diff --git a/benchmark-ips/bm_case.rb b/benchmark-ips/bm_case.rb index abc1234..def5678 100644 --- a/benchmark-ips/bm_case.rb +++ b/benchmark-ips/bm_case.rb @@ -0,0 +1,33 @@+Benchmark.ips do |x| + obj = Object.new + x.report("numeric statement") do + case 1 + when 4 then 4 + when 3 then 3 + when 2 then 2 + when 1 then 1 + end + nil + end + x.report("statement") do + case 1 + when 4 then 4 + when 3 then 3 + when 2 then 2 + when obj then :obj + when 1 then 1 + end + nil + end + x.report("expression") do + case 1 + when 4 then 4 + when 3 then 3 + when 2 then 2 + when obj then :obj + when 1 then 1 + end + end + + x.compare! +end
Add a bm-ips that checks perf on `case` w/ numbers
diff --git a/cleric.gemspec b/cleric.gemspec index abc1234..def5678 100644 --- a/cleric.gemspec +++ b/cleric.gemspec @@ -17,6 +17,7 @@ s.add_dependency 'ansi', '~> 1.4' s.add_dependency 'hipchat-api', '~> 1.0' + s.add_dependency 'git', '~> 1.2' s.add_dependency 'octokit', '~> 1.24' s.add_dependency 'thor', '~> 0.18' end
Add gem dependency git ~> 1.2
diff --git a/concord.gemspec b/concord.gemspec index abc1234..def5678 100644 --- a/concord.gemspec +++ b/concord.gemspec @@ -15,6 +15,8 @@ s.executables = [] s.require_paths = ['lib'] + s.required_ruby_version = '>= 1.9.3' + s.add_dependency('adamantium', '~> 0.2.0') s.add_dependency('equalizer', '~> 0.0.9') end
Add required ruby version to gemspec
diff --git a/config/puma.rb b/config/puma.rb index abc1234..def5678 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -1,9 +1,11 @@ #!/usr/bin/env puma + +rack_env = ENV.fetch('RACK_ENV', 'development') rackup DefaultRackup daemonize false -environment ENV.fetch('RACK_ENV', 'development') -workers ENV.fetch('WEB_CONCURRENCY', 2) unless Rails.env.development? +environment rack_env +workers ENV.fetch('WEB_CONCURRENCY', 2) unless rack_env == 'development' threads ENV.fetch('MAX_THREADS', 5), ENV.fetch('MAX_THREADS', 5) port ENV.fetch('PORT', 3000)
Use RACK_ENV to check for development environment The Rails constant isn't available when booting puma directly so use the environment variable to check for development mode.
diff --git a/chatwork-cli-get-rooms.rb b/chatwork-cli-get-rooms.rb index abc1234..def5678 100644 --- a/chatwork-cli-get-rooms.rb +++ b/chatwork-cli-get-rooms.rb @@ -1,27 +1,8 @@-require 'faraday' -require 'json' +require_relative './chatwork-cli-controller' -BASE_URI='https://api.chatwork.com/v1/' -API_TOKEN=ENV['CHATWORK_API_TOKEN'] - -GET_ROOMS='rooms' - -chatwork_connection = Faraday::Connection.new(url: BASE_URI) do |builder| - builder.use Faraday::Request::UrlEncoded - builder.use Faraday::Response::Middleware - builder.use Faraday::Adapter::NetHttp -end - -response = chatwork_connection.get do |request| - request.url GET_ROOMS - request.headers = { - 'X-ChatWorkToken' => API_TOKEN - } -end - -response.success? ? results = JSON.parse(response.body) : return +chatwork = ChatworkCliController.new +results = chatwork.get_unread_rooms results.each do |result| - puts result['name'] + ' : Unread [' + result['unread_num'].to_s + '] Mention [' + result['mention_num'].to_s + ']' unless result['unread_num'].zero? + puts result['name'] + ' : Unread [' + result['unread_num'].to_s + '] Mention [' + result['mention_num'].to_s + ']' end -
Modify to use the ChatworkCliController class
diff --git a/cronut.gemspec b/cronut.gemspec index abc1234..def5678 100644 --- a/cronut.gemspec +++ b/cronut.gemspec @@ -17,7 +17,7 @@ end spec.bindir = 'bin' - spec.executables = ['bin/cronut'] + spec.executables = ['cronut'] spec.require_paths = ['lib'] spec.add_development_dependency 'bundler', '~> 1.14'
Fix executable name in gemspec
diff --git a/src/app/models/providers/mock/mock_launchable.rb b/src/app/models/providers/mock/mock_launchable.rb index abc1234..def5678 100644 --- a/src/app/models/providers/mock/mock_launchable.rb +++ b/src/app/models/providers/mock/mock_launchable.rb @@ -5,13 +5,13 @@ # List all of the launchable items. # The list may be reduced by the information in the current context. def self.all filter=nil - connection = Provider.current.connect! - connection.launchables + connect! {|connection| connection.launchables} end def self.find(id) - connection = Provider.current.connect! - connection.launchables.find{ |launchable| launchable.id.to_s == id } + connect! do |connection| + connection.launchables.find{|launchable| launchable.id.to_s == id} + end end end end
Replace mock code to establish connection with new ProviderModel.connect! method
diff --git a/lib/conceptql/nodes/before.rb b/lib/conceptql/nodes/before.rb index abc1234..def5678 100644 --- a/lib/conceptql/nodes/before.rb +++ b/lib/conceptql/nodes/before.rb @@ -3,6 +3,10 @@ module ConceptQL module Nodes class Before < TemporalNode + def right_stream(db) + right.evaluate(db).from_self.group_by(:person_id).select(:person_id, Sequel.function(:max, :start_date).as(:start_date)).as(:r) + end + def where_clause Proc.new { l__end_date < r__start_date } end
Before: Reduce right stream to one result per person
diff --git a/check_everything.gemspec b/check_everything.gemspec index abc1234..def5678 100644 --- a/check_everything.gemspec +++ b/check_everything.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |gem| gem.name = 'check_everything' - gem.version = '0.2.8' + gem.version = '0.2.9' gem.date = '2014-02-12' gem.summary = "Check Everything" gem.description = "Open Frequently Used Websites from the Command Line!" @@ -11,5 +11,5 @@ gem.homepage = 'http://rubygems.org/gems/check_everything' gem.license = 'MIT' gem.extra_rdoc_files = ['README.md'] - gem.add_runtime_dependency "nokogiri", '~> 1.6', '>= 1.6.1' + gem.add_runtime_dependency "nokogiri", '~> 1.5.0' end
Update gemfile to require previous version of Nokogiri for Ruby 1.8.7 compatibility
diff --git a/lib/cumulonimbusfs/textkvs.rb b/lib/cumulonimbusfs/textkvs.rb index abc1234..def5678 100644 --- a/lib/cumulonimbusfs/textkvs.rb +++ b/lib/cumulonimbusfs/textkvs.rb @@ -5,8 +5,7 @@ class TextKeyValueStore def parse_directory(content) - content = Base64.decode64(content) - #puts "Parsing directory", content + #puts "Parsing directory", content.inspect if content.lines.first != "#D\n" puts "NOT A DIRECTORY" end @@ -21,20 +20,19 @@ content = files.each.collect { |n, w| "#{w[:type]} #{w[:key]} #{n}" }.join("\n") - Base64.encode64(header + content) + header + content end def parse_file(content) - content = Base64.decode64(content) #puts "Parsing file", content if content.lines.first != "#F\n" puts "NOT A FILE" end - content.split("\n", 2).last + Base64.decode64(content.split("\n", 2).last) end def gen_file(content) - Base64.encode64("#F\n" + content) + "#F\n" + Base64.encode64(content) end end
Remove extra base64 encoding from TextKeyValueStore
diff --git a/Casks/unsplash-wallpaper.rb b/Casks/unsplash-wallpaper.rb index abc1234..def5678 100644 --- a/Casks/unsplash-wallpaper.rb +++ b/Casks/unsplash-wallpaper.rb @@ -1,11 +1,11 @@ cask :v1 => 'unsplash-wallpaper' do - version '1330_1440930902' - sha256 'f85d5a05de54c9407f4d2287a2cba54bdb8f5a5f97c64a22b9da129d5a3bcf8c' + version '1341_1445283621' + sha256 '5683d617ffb5c9090bd356b864db6500665b9ca84ab61aaffdf154f4148d33fd' # devmate.com is the official download host per the vendor homepage url "https://dl.devmate.com/com.leonspok.osx.Unsplash-Wallpaper/#{version.sub(%r{_.*},'')}/#{version.sub(%r{.*_},'')}/UnsplashWallpaper-#{version.sub(%r{_.*},'')}.zip" appcast 'http://updateinfo.devmate.com/com.leonspok.osx.Unsplash-Wallpaper/updates.xml', - :sha256 => '949b1642f6dfefde4569d16363c353a56892d1771ba08a307f7d05fbe4063840' + :sha256 => '72fee1b20b7a639966c7a56b0f276f46df7866d0efa533e8cfd497a0ecfee72b' name 'Unsplash Wallpaper' homepage 'http://unsplash-wallpaper.tumblr.com' license :gratis
Upgrade Unsplash Wallpaper to 1.3.4
diff --git a/test/test_cruise_control.rb b/test/test_cruise_control.rb index abc1234..def5678 100644 --- a/test/test_cruise_control.rb +++ b/test/test_cruise_control.rb @@ -3,30 +3,54 @@ describe CiStatus::CruiseControl do - before { stub_request(:get, "http://example.com/cc.xml").to_return(:body => cc_fixture) } - subject { CiStatus::CruiseControl.new("http://example.com/cc.xml") } + describe "unauthenticated" do + before { stub_request(:get, "http://example.com/cc.xml").to_return(:body => cc_fixture) } + subject { CiStatus::CruiseControl.new("http://example.com/cc.xml") } - it "surfaces the input URL" do - assert_equal "http://example.com/cc.xml", subject.url - end + it "surfaces the input URL" do + assert_equal "http://example.com/cc.xml", subject.url + end - describe "#projects" do - it "returns the expected projects" do - assert_equal 3, subject.projects.size + describe "#projects" do + it "returns the expected projects" do + assert_equal 3, subject.projects.size - project = subject.projects.first + project = subject.projects.first - assert_equal "https://jenkins.example.com/job/Analytics/", project.url - assert_equal "Analytics", project.name - assert_equal "Success", project.status - assert project.success? + assert_equal "https://jenkins.example.com/job/Analytics/", project.url + assert_equal "Analytics", project.name + assert_equal "Success", project.status + assert project.success? + end + end + + describe "#[]" do + it "allows looking up by name" do + assert subject["Analytics"] + refute subject["Horseface"] + end end end - describe "#[]" do - it "allows looking up by name" do - assert subject["Analytics"] - refute subject["Horseface"] + describe "authenticated" do + username = "Sam" + password = "LovesPuppies" + url = "http://example.com/cc.xml" + before { stub_request(:get, "http://Sam:LovesPuppies@example.com/cc.xml").to_return(:body => cc_fixture) } + subject { CiStatus::CruiseControl.new(url, username, password) } + + it "surfaces the username" do + assert_equal username, subject.username + end + + it "surfaces the password" do + assert_equal password, subject.password + end + + describe "#projects" do + it "returns the expected projects" do + assert_equal 3, subject.projects.size + end end end
Add tests for basic authentication.
diff --git a/lib/firebolt/tasks/cache.rake b/lib/firebolt/tasks/cache.rake index abc1234..def5678 100644 --- a/lib/firebolt/tasks/cache.rake +++ b/lib/firebolt/tasks/cache.rake @@ -24,6 +24,7 @@ end end + desc 'Warm the cache with a new salt' task :warm do ::Firebolt.initialize! warmer = ::Firebolt.config.warmer
Add description to warm task
diff --git a/safe_email_name.gemspec b/safe_email_name.gemspec index abc1234..def5678 100644 --- a/safe_email_name.gemspec +++ b/safe_email_name.gemspec @@ -9,6 +9,6 @@ s.license = 'MIT' s.files = ['lib/safe_email_name.rb'] - s.add_dependency 'activesupport' - s.add_development_dependency 'rspec' + s.add_dependency 'activesupport', '~> 0' + s.add_development_dependency 'rspec', '~> 0' end
Update dependencies not-to be open ended
diff --git a/config/environment.rb b/config/environment.rb index abc1234..def5678 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -7,6 +7,8 @@ require_rel "../app/" require_rel "../lib/" + +GC::Profiler.enable Unsplash.configure do |config| config.application_id = ENV['UNSPLASH_ID']
Add GC::Profiler for New Relic
diff --git a/lib/i18n/tasks/ar/generate.rb b/lib/i18n/tasks/ar/generate.rb index abc1234..def5678 100644 --- a/lib/i18n/tasks/ar/generate.rb +++ b/lib/i18n/tasks/ar/generate.rb @@ -5,6 +5,7 @@ class << self def model lang result = Model.final_hash(lang).to_yaml + FileUtils.mkdir_p('config/locales') unless File.exists?('config/locales') File.open("config/locales/activerecord.models.#{lang}.yml", 'w+') {|f| f.write(result) } end
Create folder if don't exist
diff --git a/lib/kramdown/manpage/tasks.rb b/lib/kramdown/manpage/tasks.rb index abc1234..def5678 100644 --- a/lib/kramdown/manpage/tasks.rb +++ b/lib/kramdown/manpage/tasks.rb @@ -56,7 +56,10 @@ # def render(markdown,manpage) doc = Kramdown::Document.new(File.read(markdown),@options) - File.write(manpage,doc.to_manpage) + + File.open(manpage,'w') do |output| + output.write doc.to_manpage + end end end end
Use File.open instead of File.write for Ruby 1.8.x.
diff --git a/lib/metacrunch/file_writer.rb b/lib/metacrunch/file_writer.rb index abc1234..def5678 100644 --- a/lib/metacrunch/file_writer.rb +++ b/lib/metacrunch/file_writer.rb @@ -22,18 +22,28 @@ end def flush - io.flush if io + file_io.flush if file_io + gzip_io.flush if gzip_io end def close flush - io.close if io + file_io.close if file_io + gzip_io.close if gzip_io end private def io - @io ||= (@compressed == true) ? Zlib::GzipWriter.open(@path) : File.open(@path, "w") + @io ||= (@compressed == true) ? gzip_io : file_io + end + + def file_io + @file_io ||= File.open(@path, "w") + end + + def gzip_io + @gzip_io ||= Zlib::GzipWriter.open(@path) end end
Split up io into file_io and gzip_io to be more flexible for subclassing.
diff --git a/test/functional/admin/editions_controller_test.rb b/test/functional/admin/editions_controller_test.rb index abc1234..def5678 100644 --- a/test/functional/admin/editions_controller_test.rb +++ b/test/functional/admin/editions_controller_test.rb @@ -15,6 +15,6 @@ post :create, :guide_id => @guide.id assert_response 302 - assert_equal "Failed to create new edition", flash[:alert] + assert_equal "Failed to create new edition: couldn't initialise", flash[:alert] end end
Update test to reflect extended error messages on creating new edition
diff --git a/test/unit/edition_organisation_image_data_test.rb b/test/unit/edition_organisation_image_data_test.rb index abc1234..def5678 100644 --- a/test/unit/edition_organisation_image_data_test.rb +++ b/test/unit/edition_organisation_image_data_test.rb @@ -7,12 +7,12 @@ end test 'should be invalid if image is not 960x640px' do - image_data = build(:edition_organisation_image_data, file: File.open('test/fixtures/horrible-image.64x96.jpg')) + image_data = build(:edition_organisation_image_data, file: File.open(Rails.root.join('test/fixtures/horrible-image.64x96.jpg'))) refute image_data.valid? end test 'should be valid if legacy image is not 960x640px' do - image_data = build(:edition_organisation_image_data, file: File.open('test/fixtures/horrible-image.64x96.jpg')) + image_data = build(:edition_organisation_image_data, file: File.open(Rails.root.join('test/fixtures/horrible-image.64x96.jpg'))) image_data.save(validate: false) assert image_data.reload.valid? end
Use absolute paths to fixture image so test will run within an editor.
diff --git a/db/migrate/20200410144107_add_root_account_id_to_master_courses_child_content_tags.rb b/db/migrate/20200410144107_add_root_account_id_to_master_courses_child_content_tags.rb index abc1234..def5678 100644 --- a/db/migrate/20200410144107_add_root_account_id_to_master_courses_child_content_tags.rb +++ b/db/migrate/20200410144107_add_root_account_id_to_master_courses_child_content_tags.rb @@ -0,0 +1,32 @@+# +# Copyright (C) 2020 - present Instructure, Inc. +# +# This file is part of Canvas. +# +# Canvas is free software: you can redistribute it and/or modify +# the terms of the GNU Affero General Public License as publishe +# Software Foundation, version 3 of the License. +# +# Canvas is distributed in the hope that it will be useful, but +# WARRANTY; without even the implied warranty of MERCHANTABILITY +# A PARTICULAR PURPOSE. See the GNU Affero General Public Licens +# details. +# +# You should have received a copy of the GNU Affero General Publ +# with this program. If not, see <http://www.gnu.org/licenses/>. + +class AddRootAccountIdToMasterCoursesChildContentTags < ActiveRecord::Migration[5.2] + include MigrationHelpers::AddColumnAndFk + + tag :predeploy + disable_ddl_transaction! + + def up + add_column_and_fk :master_courses_child_content_tags, :root_account_id, :accounts + add_index :master_courses_child_content_tags, :root_account_id, algorithm: :concurrently + end + + def down + remove_column :master_courses_child_content_tags, :root_account_id + end +end
Add root account id to master_courses_child_content_tags Closes PLAT-5568 flag=none Test Plan: - Verify migrations run - Verify a root_account_id can be set on a MasterCourses::ChildContentTag record - Verify MasterCourses::ChildContentTag always live on the same shard as their root account Change-Id: Ie4247064bfc1fa329f9af92805e8b7df55d37308 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/233666 Tested-by: Service Cloud Jenkins <9144042a601061f88f1e1d7a1753ea3e2972119d@instructure.com> QA-Review: Weston Dransfield <e9203059795dc94e28a8831c65eb7869e818825e@instructure.com> Product-Review: Weston Dransfield <e9203059795dc94e28a8831c65eb7869e818825e@instructure.com> Reviewed-by: Clint Furse <b31c824c483447b2438702c2da6f729b3ebb9b50@instructure.com> Reviewed-by: Cody Cutrer <c4fe2b1d90ef8f2548c8aeabfa633434316f0305@instructure.com>
diff --git a/conker.gemspec b/conker.gemspec index abc1234..def5678 100644 --- a/conker.gemspec +++ b/conker.gemspec @@ -7,7 +7,6 @@ s.description = "Configuration library." s.homepage = "https://github.com/rapportive/conker" s.license = 'MIT' - s.date = Date.today.to_s s.files = `git ls-files`.split("\n") s.require_paths = %w(lib) s.add_dependency 'activesupport'
Remove broken Date.today from gemspec (don't know why it didn't fail before)
diff --git a/test/controllers/code_objects_controller_test.rb b/test/controllers/code_objects_controller_test.rb index abc1234..def5678 100644 --- a/test/controllers/code_objects_controller_test.rb +++ b/test/controllers/code_objects_controller_test.rb @@ -19,6 +19,8 @@ } get :show, params assert_response :success + + refute_match /translation\ missing/, response.body end end end
Add test for code_object_role localization
diff --git a/scratch/read_activity.rb b/scratch/read_activity.rb index abc1234..def5678 100644 --- a/scratch/read_activity.rb +++ b/scratch/read_activity.rb @@ -34,6 +34,8 @@ when 'DownloadEvent' end + exit # safe guard + next unless comment puts comment end
Stop fetching too much data