diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/lib/auto_html/filters/instagram.rb b/lib/auto_html/filters/instagram.rb index abc1234..def5678 100644 --- a/lib/auto_html/filters/instagram.rb +++ b/lib/auto_html/filters/instagram.rb @@ -1,12 +1,10 @@ require 'uri' require 'net/http' -AutoHtml.add_filter(:instagram).with(:width => 616, :height => 714) do |text, options| +AutoHtml.add_filter(:instagram) do |text| text << '/' unless text.end_with?('/') - width = options[:width] - height = options[:height] regex = %r{https?:\/\/(www.)?instagr(am\.com|\.am)/p/.+} text.gsub(regex) do - %{<iframe src="#{text}embed" height="#{height}" width="#{width}" frameborder="0" scrolling="no"></iframe>} + %{<iframe src="#{text}embed" height="714" width="616" frameborder="0" scrolling="no"></iframe>} end end
Remove height/width options as they don't make sense for this embed
diff --git a/config/initializers/engine_locale_fix.rb b/config/initializers/engine_locale_fix.rb index abc1234..def5678 100644 --- a/config/initializers/engine_locale_fix.rb +++ b/config/initializers/engine_locale_fix.rb @@ -0,0 +1,27 @@+module Rails + class Application + class RoutesReloader + + def reload_with_engine_locale_fix! + reload_without_engine_locale_fix! + ensure + + problem_engines = Rails::Engine.subclasses.keep_if do |engine| + Rails.application.routes.routes.any? do |route| + route.app == engine && route.required_parts.include?(:locale) + end + end + + problem_engines.map(&:instance).each do |engine| + engine.routes.routes.each do |route| + route.required_parts << :locale + end + end + + end + + alias_method_chain :reload!, :engine_locale_fix + + end + end +end
Add :locale param to routes of scoped engines This prevents an invalid "?locale=xx" from being added to the querystring on engine routes for engines mounted with a scope that has its own :locale parameter
diff --git a/lib/infinity_test/core/notifier.rb b/lib/infinity_test/core/notifier.rb index abc1234..def5678 100644 --- a/lib/infinity_test/core/notifier.rb +++ b/lib/infinity_test/core/notifier.rb @@ -15,7 +15,7 @@ end def notify - send(library).message(test_message).image(image).notify + send(library).title(RUBY_VERSION).message(test_message).image(image).notify end def image
Add the Ruby version as the title of the notification
diff --git a/devise_browserid_authenticatable.gemspec b/devise_browserid_authenticatable.gemspec index abc1234..def5678 100644 --- a/devise_browserid_authenticatable.gemspec +++ b/devise_browserid_authenticatable.gemspec @@ -10,7 +10,7 @@ s.files = `git ls-files`.split("\n") s.require_paths = ["lib"] - s.version = "1.1.0" + s.version = "1.1.1" s.add_dependency "devise", "~> 2.1" end
Increase the version to make the documentation go live.
diff --git a/proc_to_ast.gemspec b/proc_to_ast.gemspec index abc1234..def5678 100644 --- a/proc_to_ast.gemspec +++ b/proc_to_ast.gemspec @@ -22,7 +22,7 @@ spec.add_runtime_dependency "unparser" spec.add_runtime_dependency "coderay" - spec.add_development_dependency "bundler", "~> 1.6" + spec.add_development_dependency "bundler", ">= 1.5" spec.add_development_dependency "rake" spec.add_development_dependency "rspec" end
Fix bundler dependency for Ruby 2.0.0
diff --git a/lib/tasks/fix_system_comments.rake b/lib/tasks/fix_system_comments.rake index abc1234..def5678 100644 --- a/lib/tasks/fix_system_comments.rake +++ b/lib/tasks/fix_system_comments.rake @@ -0,0 +1,25 @@+# encoding: utf-8 +#-- +# Copyright (C) 2013 Gitorious AS +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +#++ + +desc "Disables edition of system comments in merge requests" +task :fix_system_comments => :environment do + comments = Comment.where(:target_type => MergeRequestVersion.name) + new_versions = comments.where('body like "Pushed new version %"') + puts "Disabling edition of #{new_versions.count}/#{comments.count} merge request version comments" + new_versions.update_all(:editable => false) +end
Add task for disabling system comments
diff --git a/lib/utopia_dungeon_notifier/cli.rb b/lib/utopia_dungeon_notifier/cli.rb index abc1234..def5678 100644 --- a/lib/utopia_dungeon_notifier/cli.rb +++ b/lib/utopia_dungeon_notifier/cli.rb @@ -22,10 +22,12 @@ @secret_key = secret_key event = SummonsBoard::Event.new(uid: uid) text = "今日のユートピアダンジョンは " - event.schedule[:times].each do |active_time| + schedule = event.schedule + schedule[:times].each do |active_time| text << "#{active_time.first.strftime("%H")}時 " end - im_kyac.post(text) + text << "\nイベントダンジョンは #{schedule[:weekly]}" + im_kyac.handler('http://sb.gungho.jp/member/info/articleinfo001_3iam.html').post(text) end private
Add weekly event and url.
diff --git a/activerecord/lib/active_record/fixture_set/render_context.rb b/activerecord/lib/active_record/fixture_set/render_context.rb index abc1234..def5678 100644 --- a/activerecord/lib/active_record/fixture_set/render_context.rb +++ b/activerecord/lib/active_record/fixture_set/render_context.rb @@ -10,7 +10,7 @@ end def binary(path) - %(!!binary "#{Base64.strict_encode64(File.read(path))}") + %(!!binary "#{Base64.strict_encode64(File.read(path, mode: 'rb'))}") end end end
Fix for reading binary file on Windows
diff --git a/spec/controllers/members_controller_spec.rb b/spec/controllers/members_controller_spec.rb index abc1234..def5678 100644 --- a/spec/controllers/members_controller_spec.rb +++ b/spec/controllers/members_controller_spec.rb @@ -11,7 +11,8 @@ describe "GET 'show'" do it "returns http success" do - get 'show', :id => 1 + @member = FactoryGirl.create :member + get 'show', :id => @member.membership_number response.should be_success end end
Use factory to create test member
diff --git a/spec/controllers/workers_controller_spec.rb b/spec/controllers/workers_controller_spec.rb index abc1234..def5678 100644 --- a/spec/controllers/workers_controller_spec.rb +++ b/spec/controllers/workers_controller_spec.rb @@ -2,4 +2,18 @@ RSpec.describe Kuroko2::WorkersController, :type => :controller do routes { Kuroko2::Engine.routes } + + before { sign_in } + + let(:worker) { create(:worker) } + + describe '#update' do + subject! { patch :update, params: { id: worker.id, suspended: true } } + + it do + expect(response).to redirect_to(workers_path) + + expect(assigns(:worker).suspended).to be_truthy + end + end end
Add spec for workers controller
diff --git a/lib/endpoint_base/sinatra/base.rb b/lib/endpoint_base/sinatra/base.rb index abc1234..def5678 100644 --- a/lib/endpoint_base/sinatra/base.rb +++ b/lib/endpoint_base/sinatra/base.rb @@ -8,7 +8,7 @@ include EndpointBase::Concerns::ExceptionHandler get '/' do - "#{self.class.name} ok" + "#{self.class.name} ok\n" end end end
Add newline at end of status check
diff --git a/spec/controllers/secrets_controller_spec.rb b/spec/controllers/secrets_controller_spec.rb index abc1234..def5678 100644 --- a/spec/controllers/secrets_controller_spec.rb +++ b/spec/controllers/secrets_controller_spec.rb @@ -14,7 +14,7 @@ end it "does not raise errors" do - SecretRetrieval.expects(:perform).raises(RetrievalError) + SecretRetrieval.expects(:perform).raises(VaultError) get :show, { params: { id: 'test-token' } } expect(response).to have_http_status(:success)
Fix exception name in unit test
diff --git a/spec/features/user_answers_question_spec.rb b/spec/features/user_answers_question_spec.rb index abc1234..def5678 100644 --- a/spec/features/user_answers_question_spec.rb +++ b/spec/features/user_answers_question_spec.rb @@ -3,39 +3,51 @@ describe "User answers question" do fixtures :users, :questions let(:user) { users(:tester) } + let(:question) { questions(:test) } describe "answering question" do before(:each) do - current_user = users(:tester) + sign_in_as user + visit question_path(question) end - - it "should display the answer text_area" context "valid inputs" do before do - within 'form#answer' do - fill_in 'content', :with => 'Test answer' - click 'Save' + within 'form#new_answer' do + fill_in 'answer[content]', :with => 'Test answer' + click_button 'Submit Answer' end end - it "should show the new answer on the page" do - page.should have_content 'Test answer' + it "should be on the question page" do + current_path.should eq question_path(question) end - it "should return a success" do - page.should have_content 'Saved your answer' + it "should show the new answer on the page" do + within "#answers" do + page.should have_content 'Test answer' + end end end context "invalid inputs" do - it "should return an error" do - within 'form#answer' do - click 'Save' + before do + within "form#new_answer" do + click_button "Submit Answer" end + end - page.should have_content 'Errored out n00b' + it "should highlight incorrect fields" do + within "form#new_answer" do + page.should have_selector '.control-group.error' + end + end + + it "should show an error message" do + within "form#new_answer" do + page.should have_content "can't be blank" + end end end end
Fix user answers questions spec
diff --git a/db/migrate/20110902203823_add_allowed_children_cache_to_pages.rb b/db/migrate/20110902203823_add_allowed_children_cache_to_pages.rb index abc1234..def5678 100644 --- a/db/migrate/20110902203823_add_allowed_children_cache_to_pages.rb +++ b/db/migrate/20110902203823_add_allowed_children_cache_to_pages.rb @@ -1,6 +1,6 @@ class AddAllowedChildrenCacheToPages < ActiveRecord::Migration def self.up - add_column :pages, :allowed_children_cache, :text, default: '' + add_column :pages, :allowed_children_cache, :text Page.reset_column_information Page.find_each do |page| page.save # update the allowed_children_cache
Remove default because MYSQL blows up
diff --git a/spec/uploaders/cover_image_uploader_spec.rb b/spec/uploaders/cover_image_uploader_spec.rb index abc1234..def5678 100644 --- a/spec/uploaders/cover_image_uploader_spec.rb +++ b/spec/uploaders/cover_image_uploader_spec.rb @@ -9,13 +9,14 @@ let(:cover_image) { described_class.new } before do - cover_image.stub_chain(:model, :id) { ::SecureRandom.hex } + allow(cover_image).to receive_message_chain(:model, :id) + .and_return(::SecureRandom.hex) cover_image.store! fixture_image end context 'test env' do it 'uploads the cover image to the correct bucket' do - cover_image.file.url.should match(/.*\/zinedistro-test.*/) + expect(cover_image.file.url).to match(/.*\/zinedistro-test.*/) end end end
Update cover_image_uploader spec to use rspec 3
diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index abc1234..def5678 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -1,7 +1,7 @@ class SessionsController < ApplicationController def new - render :login + render :new end def create
Change render from login to new
diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index abc1234..def5678 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -1,10 +1,18 @@ class SessionsController < ApplicationController - def new - end def create + user = User.find_by_username(params[:username]) + if user && user.authenticate(params[:password]) + session[:user_id] = user.id + redirect_to root_url, notice: "Logged in" + else + flash.now.alert = "Username or password is invalid" + render "new" + end end def destroy + session[:user_id] = nil + redirect_to root_url, notice: "Logged out" end end
Add logic to session controller
diff --git a/app/controllers/upgrades_controller.rb b/app/controllers/upgrades_controller.rb index abc1234..def5678 100644 --- a/app/controllers/upgrades_controller.rb +++ b/app/controllers/upgrades_controller.rb @@ -9,4 +9,8 @@ "upgrades." end helper_method :sort_column, :sort_direction, :sort_column_prefix + + def collection + @upgrades ||= end_of_association_chain.includes(:server).order("servers.name asc") + end end
Sort upgrades by server name in upgrades/index
diff --git a/app/mailers/islay_shop/order_mailer.rb b/app/mailers/islay_shop/order_mailer.rb index abc1234..def5678 100644 --- a/app/mailers/islay_shop/order_mailer.rb +++ b/app/mailers/islay_shop/order_mailer.rb @@ -30,8 +30,8 @@ end def cancelled(order) - return if Settings.for(:islay_shop, :disable_order_cancelled_mail) - + return if Settings.for(:shop, :disable_order_cancelled_mail) + @order = order mail( :to => order.email,
Correct the lookup for the switch on order cancelled mail
diff --git a/app/representers/answer_representer.rb b/app/representers/answer_representer.rb index abc1234..def5678 100644 --- a/app/representers/answer_representer.rb +++ b/app/representers/answer_representer.rb @@ -11,4 +11,5 @@ property :respondent property :user_id property :answer_text + property :details_text end
Add details_text field for answers
diff --git a/app/models/etsource.rb b/app/models/etsource.rb index abc1234..def5678 100644 --- a/app/models/etsource.rb +++ b/app/models/etsource.rb @@ -9,7 +9,7 @@ # Used to check if an interface element is still required. def self.dataset_inputs @dataset_inputs ||= Atlas::SparseGraphQuery.all.flat_map do |query| - query.query.scan(/DATASET_INPUT\(['"]?([a-z_]+)['"]?\)/).flatten + query.query.scan(/DATASET_INPUT\(['"]?(\S+)['"]?\)/).flatten end end end
Check for any character which is not whitespace
diff --git a/tasks/native.rake b/tasks/native.rake index abc1234..def5678 100644 --- a/tasks/native.rake +++ b/tasks/native.rake @@ -27,7 +27,6 @@ else ext.cross_compile = true ext.cross_platform = ['i386-mswin32-60', 'i386-mingw32', 'x64-mingw32'] - ext.cross_config_options << "--enable-local" end end
Stop messing with LDFLAGS when cross-compiling LDFLAGS cannot be used to link to specific versions, instead we should use extconf '--with-opt-dir'.
diff --git a/lib/sinatra_more/warden_plugin.rb b/lib/sinatra_more/warden_plugin.rb index abc1234..def5678 100644 --- a/lib/sinatra_more/warden_plugin.rb +++ b/lib/sinatra_more/warden_plugin.rb @@ -15,12 +15,20 @@ Warden::Strategies.add(:password) do def valid? - params['username'] || params['password'] + username || password end def authenticate! - u = User.authenticate(params['username'], params['password']) + u = User.authenticate(username, password) u.nil? ? fail!("Could not log in") : success!(u) + end + + def username + params['username'] || params['nickname'] || params['login'] || params['email'] + end + + def password + params['password'] || params['pass'] end end end
Improve robustness of warden password strategy
diff --git a/config/environments/development.rb b/config/environments/development.rb index abc1234..def5678 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -11,7 +11,7 @@ # Show full error reports and disable caching config.consider_all_requests_local = true - config.action_controller.perform_caching = true + config.action_controller.perform_caching = false # Don't care if the mailer can't send config.action_mailer.raise_delivery_errors = false
Set local caching to false.
diff --git a/lib/tasks/purge_fastly_cache.rake b/lib/tasks/purge_fastly_cache.rake index abc1234..def5678 100644 --- a/lib/tasks/purge_fastly_cache.rake +++ b/lib/tasks/purge_fastly_cache.rake @@ -0,0 +1,15 @@+# Implement full purge of Fastly CDN cache. Invoke using: +# heroku run rake fastly:purge --app NAME_OF_APPLICATION +# Run this if code changes will cause a change in badge level, since otherwise +# the old badge levels will keep being displayed until the cache times out. +# See: https://robots.thoughtbot.com/ +# a-guide-to-caching-your-rails-application-with-fastly +namespace :fastly do + desc 'Purge Fastly cache (takes about 5s)' + task :purge do + puts 'Starting full purge of Fastly cache (typically takes about 5s)' + require Rails.root.join('config/initializers/fastly') + FastlyRails.client.get_service(ENV.fetch('FASTLY_SERVICE_ID')).purge_all + puts 'Cache purged' + end +end
Add new "rake fastly:purge" command for purging Fastly cache This is useful when making changes to the code that cause sudden changes in the displayed badge level. This isn't tested yet, so there may be further changes to come. Signed-off-by: David A. Wheeler <9ae72d22d8b894b865a7a496af4fab6320e6abb2@dwheeler.com>
diff --git a/lib/whos_dated_who/bing_client.rb b/lib/whos_dated_who/bing_client.rb index abc1234..def5678 100644 --- a/lib/whos_dated_who/bing_client.rb +++ b/lib/whos_dated_who/bing_client.rb @@ -1,7 +1,8 @@ require 'yaml' module WhosDatedWho class BingClient - API_KEY = YAML.load_file( File.expand_path('~/.whos_dated_who.yml'))[:bing_api_key] + API_KEY = ENV['BING_API_KEY'] || + YAML.load_file( File.expand_path('~/.whos_dated_who.yml'))[:bing_api_key] def initialize(api_key=API_KEY) @api_key = api_key
Read bing api key from ENV to be Heroku friendly
diff --git a/lib/chef/handler/etcd_report.rb b/lib/chef/handler/etcd_report.rb index abc1234..def5678 100644 --- a/lib/chef/handler/etcd_report.rb +++ b/lib/chef/handler/etcd_report.rb @@ -15,7 +15,7 @@ def report if success? data = {total: all_resources.size, updated: updated_resources.size, time: elapsed_time} - @etcd.set('/nodes/'+Chef::Config[:node_name]+'/chef/report',JSON.dump(data) + @etcd.set('/nodes/'+Chef::Config[:node_name]+'/chef/report',JSON.dump(data)) end end end
Fix a syntax error in etcd report handler.
diff --git a/spec/finders/email_alert_configuration_spec.rb b/spec/finders/email_alert_configuration_spec.rb index abc1234..def5678 100644 --- a/spec/finders/email_alert_configuration_spec.rb +++ b/spec/finders/email_alert_configuration_spec.rb @@ -0,0 +1,27 @@+require 'spec_helper' + +RSpec.describe "Email alert configuration" do + all_finders = Dir["lib/documents/schemas/*.json"].map do |filename| + JSON.parse(File.read(filename)) + end + + all_finders.each do |finder| + describe "Finder configuration for #{finder['name']}" do + next unless finder["email_filter_by"] + + it "only allows people to sign up to alerts that exist" do + facet_used_to_email_things = finder["facets"].find do |facet| + facet["key"] == finder["email_filter_by"] + end + + actually_possible_keys_for_which_emails_will_be_sent = facet_used_to_email_things["allowed_values"].map do |allowed_value| + allowed_value["value"] + end + + finder["email_signup_choice"].each do |choice| + expect(choice["key"]).to be_in(actually_possible_keys_for_which_emails_will_be_sent) + end + end + end + end +end
Test that email alerts are configured correctly We currently don't test that the "keys" to which a user can subscribe are actually valid. If one of the keys is mistyped or the original value removed, this would result in people being subscribed to subjects for which an email will never be sent.
diff --git a/lib/lanes/api/handlers/asset.rb b/lib/lanes/api/handlers/asset.rb index abc1234..def5678 100644 --- a/lib/lanes/api/handlers/asset.rb +++ b/lib/lanes/api/handlers/asset.rb @@ -27,8 +27,10 @@ end def self.getter - Lanes::API::RequestWrapper.with_authenticated_user do |user, req| - req.send_file CarrierWave::Uploader::Base.root.call + '/' + req.params['splat'].first + lambda do + # files are stored using a random string, therefore we assume that anyone who + # knows the filename has access and don't empose any further restrictions + send_file CarrierWave::Uploader::Base.root.call + '/' + params['splat'].first end end end
Allow anonymous access to files
diff --git a/lib/pragma/operation/destroy.rb b/lib/pragma/operation/destroy.rb index abc1234..def5678 100644 --- a/lib/pragma/operation/destroy.rb +++ b/lib/pragma/operation/destroy.rb @@ -7,20 +7,21 @@ # @author Alessandro Desantis class Destroy < Pragma::Operation::Base step Macro::Classes() - step Macro::Model(:find_by), fail_fast: true - step Macro::Policy(), fail_fast: true + step Macro::Model(:find_by) + step Macro::Policy() step :destroy! - failure :handle_invalid_model! step :respond! def destroy!(_options, model:, **) - model.destroy - end + unless model.destroy + options['result.response'] = Response::UnprocessableEntity.new( + errors: model.errors + ).decorate_with(Decorator::Error) - def handle_invalid_model!(options, model:, **) - options['result.response'] = Response::UnprocessableEntity.new( - errors: model.errors - ).decorate_with(Decorator::Error) + return false + end + + true end def respond!(options)
Refactor Destroy operation to remove fail_fast directives
diff --git a/lib/s3_multipart_upload/file.rb b/lib/s3_multipart_upload/file.rb index abc1234..def5678 100644 --- a/lib/s3_multipart_upload/file.rb +++ b/lib/s3_multipart_upload/file.rb @@ -6,7 +6,7 @@ end def split_into_parts(part_size) - boundaries = Range.new(0, file_size).step(part_size).tap do |_| + boundaries = Range.new(0, file_size).step(part_size).to_a.tap do |_| _.push(file_size) unless _.last == file_size end
Fix to work in Rails 4.x
diff --git a/lib/optical/filters/null_filter.rb b/lib/optical/filters/null_filter.rb index abc1234..def5678 100644 --- a/lib/optical/filters/null_filter.rb +++ b/lib/optical/filters/null_filter.rb @@ -15,7 +15,7 @@ end def filter_through_awk_script(script,output_bam,min_score=0) - File.delete(output_bam) + File.delete(output_bam) if File.exists?(output_bam) cmd = @conf.cluster_cmd_prefix(free:1, max:12, sync:true, name:"filt_#{@name}") + %W(/bin/bash -o pipefail -o errexit -c)
Fix delete when something is not yet there
diff --git a/lib/tasks/cleanup_attachments.rake b/lib/tasks/cleanup_attachments.rake index abc1234..def5678 100644 --- a/lib/tasks/cleanup_attachments.rake +++ b/lib/tasks/cleanup_attachments.rake @@ -3,9 +3,10 @@ desc "Clean attachments older than 2 years" task :cleanup => :environment do - Invoice.where("pdf_updated_at < ?", 2.years.ago).each do |i| - i.pdf.clear - i.save - end + delay = 2.years.ago + Invoice.where("pdf_updated_at < ?", delay).each { |i| i.pdf.clear; i.save } + Subscription.where("pdf_updated_at < ?", delay).each { |i| i.pdf.clear; i.save } + CachedDocument.where("document_updated_at < ?", delay).each { |i| i.pdf.clear; i.save } + Salaries::Salary.where("pdf_updated_at < ?", delay).each { |i| i.pdf.clear; i.save } end end
Extend attachment cleanup to all objects
diff --git a/lib/daimon_skycrawlers/cli.rb b/lib/daimon_skycrawlers/cli.rb index abc1234..def5678 100644 --- a/lib/daimon_skycrawlers/cli.rb +++ b/lib/daimon_skycrawlers/cli.rb @@ -4,7 +4,7 @@ module DaimonSkycrawlers class CLI < Thor - register(Generator::New, "generate", "generate NAME", "Generate new project") + register(Generator::New, "new", "new NAME", "Create new project") desc "version", "Show version" def version
Change sub command name `generate` to `new` Because Rails uses `new` to create new project. I want to use `generate` to generate other files such as concrete crawlers and processors.
diff --git a/lib/e4commerce/bank_billet.rb b/lib/e4commerce/bank_billet.rb index abc1234..def5678 100644 --- a/lib/e4commerce/bank_billet.rb +++ b/lib/e4commerce/bank_billet.rb @@ -0,0 +1,20 @@+module E4commerce + + class BankBillet < E4CPayment + attr_accessor :product_list + attr_accessor :total + + def calculate_total(products) + + end + + def create_payment + + end + + def add_product(product) + + end + end + +end
Create Bank Billet class inheriting from Payment class
diff --git a/lib/fooda-bot/time_helpers.rb b/lib/fooda-bot/time_helpers.rb index abc1234..def5678 100644 --- a/lib/fooda-bot/time_helpers.rb +++ b/lib/fooda-bot/time_helpers.rb @@ -8,8 +8,8 @@ def self.tomorrow?(time) now = Time.new - today_start = Time.new(now.year, now.month, now.day + 1) - today_end = today_start + 86399 - (today_start..today_end).cover?(time) + tomorrow_start = Time.new(now.year, now.month, now.day) + 86400 + tomorrow_end = tomorrow_start + 86399 + (tomorrow_start..tomorrow_end).cover?(time) end end
Fix tomorrow? to account for last day of month
diff --git a/lib/gooder_data/session_id.rb b/lib/gooder_data/session_id.rb index abc1234..def5678 100644 --- a/lib/gooder_data/session_id.rb +++ b/lib/gooder_data/session_id.rb @@ -37,7 +37,7 @@ armor: true } options[:signer] = @options[:sso_signer_email] if @options[:sso_signer_email] - options[:passphrase] = @options[:sso_signer_password] if @options[:sso_signer_password] + options[:password] = @options[:sso_signer_password] if @options[:sso_signer_password] options end
Change variable passphrase to password. The variable passphrase does no longer exists in GPGME.
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index abc1234..def5678 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -0,0 +1,14 @@+class AdminController < ApplicationController + before_filter :authenticate_user! + before_filter :get_club + + def show + authorize! :update, @club + end + + private + + def get_club + @club = Club.find params[:id] + end +end
Add Admin Controller show Action Add an Admin controller with a show action.
diff --git a/app/controllers/clubs_controller.rb b/app/controllers/clubs_controller.rb index abc1234..def5678 100644 --- a/app/controllers/clubs_controller.rb +++ b/app/controllers/clubs_controller.rb @@ -6,7 +6,7 @@ def create @club = Club.new(params.require(:club).permit(:name, :city, :description)) @club.save - render 'index', status: 201 + render 'show', status: 201 end def new
Make new club action render show instead of index That seems to be a bit more natural
diff --git a/lib/modules/parse_pg_array.rb b/lib/modules/parse_pg_array.rb index abc1234..def5678 100644 --- a/lib/modules/parse_pg_array.rb +++ b/lib/modules/parse_pg_array.rb @@ -1,8 +1,9 @@ module ParsePgArray def parse_array(attribute) - # byebug attr = read_attribute(attribute) + # --- []\n is the default value for tag_list in NomenclatureChange::Output return [] unless attr.present? + return [] if attr.is_a?(String) && attr.match(/--- \[\]\n/).present? attr.map(&:to_s) end end
Manage case for nomenclature change output default value
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index abc1234..def5678 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -5,7 +5,6 @@ def show @user = User.find(params[:id]) - @question = Question.find(params[:id]) end
Remove unused instance variable in user controller.
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index abc1234..def5678 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,8 +1,16 @@ class UsersController < ApplicationController + def show + @user = User.find params[:id] + + redirect_to new_user_session_path unless user_signed_in? and can?(:read, @user) + end + def edit if user_signed_in? - @user = current_user + @user = User.find params[:id] authorize! :update, @user + + render :text => '', :layout => "mercury" else redirect_to new_user_session_path end @@ -10,38 +18,17 @@ def update if user_signed_in? - @user = current_user + @user = User.find params[:id] authorize! :update, @user - @user.update_attributes params[:user] + user_hash = params[:content] + @user.description = user_hash[:user_description][:value] + @user.icon = user_hash[:user_icon][:attributes][:src] - respond_with_bip @user - else - redirect_to new_user_session_path - end - end - - def change_icon - if user_signed_in? - @user = current_user - authorize! :update, @user - else - redirect_to new_user_session_path - end - end - - def upload_icon - if user_signed_in? - @user = current_user - authorize! :update, @user - - # if no user icon was specified - if params[:user].blank? - render :change_icon, :formats => [ :js ] - elsif @user.update_attributes params[:user] - render + if @user.save + render :text => "" else - render :change_icon, :formats => [ :js ] + respond_error_to_mercury [ @user ] end else redirect_to new_user_session_path
Update Users Controller for Mercury Actions Update the Users controller to handle the parameters passed by the Mercury editor.
diff --git a/app/models/devices/dimmer_device.rb b/app/models/devices/dimmer_device.rb index abc1234..def5678 100644 --- a/app/models/devices/dimmer_device.rb +++ b/app/models/devices/dimmer_device.rb @@ -24,7 +24,7 @@ '32/mixer.png' end - def update_attributes_from_registration params + def update_attributes_from_registration _params end def value @@ -36,17 +36,17 @@ end def set_value value - send_message CaretakerMessages::PWM_WRITE, 0, CaretakerMessages::WRITE_ABSOLUTE, value + send_message CaretakerMessages::PWM_WRITE, CaretakerMessages::WRITE_ABSOLUTE, value end def update - send_message CaretakerMessages::PWM_READ, 0 + send_message CaretakerMessages::PWM_READ end def message_received message, params super if message == CaretakerMessages::PWM_STATE - @value = params[1] + @value = params[0] notify_change_listeners end end
feat: Remove pwm number from dimmer device
diff --git a/lib/generators/active_record/devise_userbin_generator.rb b/lib/generators/active_record/devise_userbin_generator.rb index abc1234..def5678 100644 --- a/lib/generators/active_record/devise_userbin_generator.rb +++ b/lib/generators/active_record/devise_userbin_generator.rb @@ -6,7 +6,7 @@ source_root File.expand_path("../templates", __FILE__) def copy_devise_userbin_migration - migration_template "migration.rb", "db/migrate/add_userbin_to_#{table_name}" + migration_template "migration.rb", "db/migrate/add_userbin_to_#{table_name}.rb" end end
Make sure that migration file ends with .rb
diff --git a/manifests/cf-manifest/spec/manifest/certificates_spec.rb b/manifests/cf-manifest/spec/manifest/certificates_spec.rb index abc1234..def5678 100644 --- a/manifests/cf-manifest/spec/manifest/certificates_spec.rb +++ b/manifests/cf-manifest/spec/manifest/certificates_spec.rb @@ -0,0 +1,30 @@+RSpec.describe "certificates" do + def get_all_cas_usages(o) + return o.flat_map { |v| get_all_cas_usages(v) } if o.is_a? Array + + if o.is_a? Hash + return o.values.flat_map { |v| get_all_cas_usages(v) } unless o.key? 'ca' + # Match checks if it is a usage ("name.value") or a variable ("name") + return [o['ca']] if o['ca'].match?(/[.]/) + end + + [] + end + + context "ca certificates" do + let(:manifest) { manifest_with_defaults } + + let(:ca_usages) do + get_all_cas_usages(manifest.fetch('.')).map do |usage| + usage.gsub(/[()]/, '') # delete surrounding parens + end + end + + it "should use .ca for every usage of a ca certificate" do + ca_usages.each do |ca_usage| + expect(ca_usage).to match(/[.]ca$/), + "Usage of CA #{ca_usage} should be cert_name.ca not ca_name.certificate, otherwise credhub rotation will fail" + end + end + end +end
Add a test for ca usages so ca_cert rotation works If you use ((ca.certificate)) when refering to a certificate's CA cert, then you will only get the latest CA certificate interpolated in the manifest You must instead use ((certficate.ca)) When you use ((certificate.ca)) and the latest CA has the "transitional" flag, then BOSH will put the latest ca cert (transitional) and the latest non-transitional ca cert This commit adds a test so that any usage of a CA should not refer to the CA certificate directly Signed-off-by: Toby Lorne <527052641d65eef236eeef9545b2acac74c35d57@digital.cabinet-office.gov.uk>
diff --git a/test/examples/api_client.rb b/test/examples/api_client.rb index abc1234..def5678 100644 --- a/test/examples/api_client.rb +++ b/test/examples/api_client.rb @@ -1,13 +1,13 @@ Oven.bake :ApiClient, destination: "tmp/" do format :json - get :users, "/api/v2/users" - get :user, "/api/v2/users/:id" - post :user, "/api/v2/users" - patch :user, "/api/v2/users/:id" - put :user, "/api/v2/users/:id", as: :put_user - delete :user, "/api/v2/users/:id" - head :users, "/api/v2/users" + get :users, "/api/v2/users" + get :user, "/api/v2/users/:id" + head :users, "/api/v2/users" + post :user, "/api/v2/users" + patch :user, "/api/v2/users/:id" + put :user, "/api/v2/users/:id", as: :put_user + delete :user, "/api/v2/users/:id" options :users, "/api/v2/users" get :authentication, "/authentication", as: :authentication
Refactor a client used in test
diff --git a/minimal_state_machine.gemspec b/minimal_state_machine.gemspec index abc1234..def5678 100644 --- a/minimal_state_machine.gemspec +++ b/minimal_state_machine.gemspec @@ -8,8 +8,8 @@ gem.version = MinimalStateMachine::VERSION gem.authors = ["Matteo Depalo"] gem.email = ["matteodepalo@gmail.com"] - gem.description = %q{TODO: Write a gem description} - gem.summary = %q{TODO: Write a gem summary} + gem.description = %q{A state machine for activerecord implemented with the state pattern} + gem.summary = %q{A state machine implemented with the state pattern} gem.homepage = "" gem.files = `git ls-files`.split($/)
Update Gemfile description and summary
diff --git a/test/features/step_definitions/search_steps.rb b/test/features/step_definitions/search_steps.rb index abc1234..def5678 100644 --- a/test/features/step_definitions/search_steps.rb +++ b/test/features/step_definitions/search_steps.rb @@ -7,13 +7,13 @@ end Then(/^vil jeg finne verket i trefflista$/) do - resultList = @site.SearchPatronClient.get_search_result_list - if !resultList.present? + result_list = @site.SearchPatronClient.get_search_result_list + if !result_list.present? sleep 2 # to give elasticsearch more time to index step "jeg søker på verket i lånergrensesnittet" - resultList = @site.SearchPatronClient.get_search_result_list + result_list = @site.SearchPatronClient.get_search_result_list end - resultList.text.include?(@context[:title]).should == true + result_list.text.include?(@context[:title]).should == true end When(/^jeg søker på verkets ID i lånergrensesnittet$/) do @@ -23,6 +23,6 @@ end Then(/^skal ikke verket finnes i trefflisten$/) do - results = @site.SearchPatronClient.get_search_result_list - results.exists?.should == false + result_list = @site.SearchPatronClient.get_search_result_list + result_list.exists?.should == false end
Change variable names in test
diff --git a/test/end_to_end/basic_run_test.rb b/test/end_to_end/basic_run_test.rb index abc1234..def5678 100644 --- a/test/end_to_end/basic_run_test.rb +++ b/test/end_to_end/basic_run_test.rb @@ -14,6 +14,13 @@ status = @driver.cleanup status.exitstatus.must_equal 0 + end + + it 'can be interacted with' do + frame = @driver.frame.find_role :frame + frame.wont_be_nil + + @driver.press_ctrl_q end after do
Add simple test for finding items by role
diff --git a/test/integration/my_stuff_test.rb b/test/integration/my_stuff_test.rb index abc1234..def5678 100644 --- a/test/integration/my_stuff_test.rb +++ b/test/integration/my_stuff_test.rb @@ -0,0 +1,26 @@+require_relative '../integration_test_helper' + +class MyStuffTest < ActionDispatch::IntegrationTest + + def setup + alice = FactoryGirl.create(:user, name: "Alice", uid: "alice") + GDS::SSO.test_user = alice + @user = alice + end + + def teardown + GDS::SSO.test_user = nil + end + + test "filtering by assigned user" do + # stub_request(:get, %r{^http://panopticon\.test\.gov\.uk/artefacts/.*\.js$}). + # to_return(status: 200, body: "{}", headers: {}) + + @guide = FactoryGirl.create(:guide_edition) + @user.record_note @guide, "I like this guide" + + visit "/admin/my_stuff" + + assert page.has_content? @guide.title + end +end
Add an integration test for the 'my stuff' index.
diff --git a/match_api/lib/corenlp_client.rb b/match_api/lib/corenlp_client.rb index abc1234..def5678 100644 --- a/match_api/lib/corenlp_client.rb +++ b/match_api/lib/corenlp_client.rb @@ -1,7 +1,7 @@ class CoreNlpClient def initialize(host) #params = URI.encode('properties={"annotators": "lemma,parse,depparse", "parse.flags": " -makeCopulaHead"}') - params = URI.encode('properties={"annotators": "lemma,parse,depparse"}') + params = URI.encode('properties={"annotators": "lemma,tokenize,ssplit,depparse"}') @uri = URI(host + "/?" + params) @http_client = Net::HTTP.new(@uri.host, @uri.port)
Use the same annotator set as the corenlp.run UI Motivation: -makes the results comparable -otherwise, for some reason, the results differ making the tool harder to work with Change Explanation: -pass additional annotators, don't pass parse
diff --git a/core/time/inspect_spec.rb b/core/time/inspect_spec.rb index abc1234..def5678 100644 --- a/core/time/inspect_spec.rb +++ b/core/time/inspect_spec.rb @@ -10,6 +10,11 @@ t.inspect.should == "2007-11-01 15:25:00.123456 UTC" end + it "omits trailing zeros from microseconds" do + t = Time.utc(2007, 11, 1, 15, 25, 0, 100000) + t.inspect.should == "2007-11-01 15:25:00.1 UTC" + end + it "preserves nanoseconds" do t = Time.utc(2007, 11, 1, 15, 25, 0, 123456.789r) t.inspect.should == "2007-11-01 15:25:00.123456789 UTC"
Test for removal of trailing zeros when inspecting a microsecond-precision time
diff --git a/toolsmith.gemspec b/toolsmith.gemspec index abc1234..def5678 100644 --- a/toolsmith.gemspec +++ b/toolsmith.gemspec @@ -23,4 +23,5 @@ s.add_development_dependency "guard-rspec", "~> 2.3.3" s.add_development_dependency "rb-fsevent", "~> 0.9.1" s.add_development_dependency "nokogiri", "~> 1.5.6" + s.add_development_dependency "awesome_print" end
Add awesome print to gemspec.
diff --git a/middleman-core/lib/middleman-core/extensions/external_pipeline.rb b/middleman-core/lib/middleman-core/extensions/external_pipeline.rb index abc1234..def5678 100644 --- a/middleman-core/lib/middleman-core/extensions/external_pipeline.rb +++ b/middleman-core/lib/middleman-core/extensions/external_pipeline.rb @@ -11,17 +11,18 @@ require 'thread' - app.files.watch :source, - path: File.expand_path(options[:source], app.root), - latency: options[:latency] + @watcher = app.files.watch :source, + path: File.expand_path(options[:source], app.root), + latency: options[:latency] end def ready - if app.build? - logger.info "== Executing: `#{options[:command]}`" - watch_command! - else - logger.debug "== Executing: `#{options[:command]}`" + logger.info "== Executing: `#{options[:command]}`" + + watch_command! + @watcher.poll_once! + + if !app.build? ::Thread.new { watch_command! } end end
Fix first-run issue with pipeline
diff --git a/db/migrate/008_create_playlists.rb b/db/migrate/008_create_playlists.rb index abc1234..def5678 100644 --- a/db/migrate/008_create_playlists.rb +++ b/db/migrate/008_create_playlists.rb @@ -3,6 +3,8 @@ create_table :playlists, id: :uuid, default: "uuid_generate_v4()", force: true do |t| t.string :provider , null: false t.string :identifier , null: false + t.string :owner_id + t.string :owner_name t.string :url , null: false t.string :title , null: false t.text :description
Add owner_id and owner_name to playlists table
diff --git a/scheduled_tasks/management_information_v2_generation_task.rb b/scheduled_tasks/management_information_v2_generation_task.rb index abc1234..def5678 100644 --- a/scheduled_tasks/management_information_v2_generation_task.rb +++ b/scheduled_tasks/management_information_v2_generation_task.rb @@ -5,10 +5,10 @@ every '1d', first_at: Chronic.parse('next 2:50 am') def run - LogStuff.info { 'AGFS Management Information Generation V2 started' } + LogStuff.info { 'Management Information Generation V2 started' } Stats::StatsReportGenerator.call('management_information_v2') - LogStuff.info { 'AGFS Management Information Generation V2 finished' } + LogStuff.info { 'Management Information Generation V2 finished' } rescue StandardError => e - LogStuff.error { 'AGFS Management Information Generation V2 error: ' + e.message } + LogStuff.error { 'Management Information Generation V2 error: ' + e.message } end end
Correct log output for scheduler Copy/paste mistake from previous work.
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,8 +1,11 @@ require 'rspec-puppet' +require 'puppetlabs_spec_helper/module_spec_helper' fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures')) RSpec.configure do |c| c.module_path = File.join(fixture_path, 'modules') c.manifest_dir = File.join(fixture_path, 'manifests') + + c.include PuppetlabsSpec::Files end
Add files to spec helper
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,13 +1,7 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) -require 'tempfile' require 'rspec' -require 'fakefs/spec_helpers' -require 'mocha' -require 'bio' require 'genomer' -require 'scaffolder/test/helpers' -require 'heredoc_unindent' # Requires supporting files with custom matchers and macros, etc, # in ./support/ and its subdirectories.
Remove requires from spec helper
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -3,8 +3,10 @@ require 'codeclimate-test-reporter' require 'stringio' -CodeClimate::TestReporter.start do - add_filter '/spec/' +if ENV['CODECLIMATE_REPO_TOKEN'] + CodeClimate::TestReporter.start do + add_filter '/spec/' + end end $LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib'
Use CodeClimate only if ENVs defined
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -5,3 +5,8 @@ add_filter '/vendor/' coverage_dir 'log/coverage/spec' end + +def production_code + spec = caller[0][/spec.+\.rb/] + './' + spec.gsub('_spec','').gsub(/spec/, 'lib') +end
Add production_code helper method to spec helper
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,6 +1,38 @@+require "codeclimate-test-reporter" +CodeClimate::TestReporter.start + +require 'capybara/rspec' + require "lita-hackers-news" require "lita/rspec" # A compatibility mode is provided for older plugins upgrading from Lita 3. Since this plugin # was generated with Lita 4, the compatibility mode should be left disabled. Lita.version_3_compatibility_mode = false + +RSpec.configure do |config| + config.include Capybara::DSL + + config.filter_run :focus + config.run_all_when_everything_filtered = true + + if config.files_to_run.one? + config.default_formatter = 'doc' + end + + config.profile_examples = 5 + + config.order = :random + + Kernel.srand config.seed + + config.expect_with :rspec do |expectations| + expectations.syntax = :expect + end + + config.mock_with :rspec do |mocks| + mocks.syntax = :expect + + mocks.verify_partial_doubles = true + end +end
Add RSpec config and apply CodeClimate coverage
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,12 +1,23 @@ require 'pathname' SPEC_ROOT = root = Pathname(__FILE__).dirname + +if RUBY_ENGINE == 'ruby' && ENV['COVERAGE'] == 'true' + require 'yaml' + rubies = YAML.load(File.read(SPEC_ROOT.join('../.travis.yml')))['rvm'] + latest_mri = rubies.select { |v| v =~ /\A\d+\.\d+.\d+\z/ }.max + + if RUBY_VERSION == latest_mri + require 'simplecov' + end +end require 'rom/core' Dir[root.join('support/*.rb').to_s].each do |f| require f end + Dir[root.join('shared/*.rb').to_s].each do |f| require f end
Enable simplecov for rom gem specs
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -43,9 +43,12 @@ Sidekiq.logger = nil end - config.before :example do - Sidekiq::Merger::Redis.redis do |conn| - conn.flushall + config.around :example do |example| + Sidekiq::Merger::Redis.redis { |conn| conn.flushall } + begin + example.run + ensure + Sidekiq::Merger::Redis.redis { |conn| conn.flushall } end end
Clean up redis after examples
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -5,5 +5,3 @@ config.color = true # Use color in STDOUT config.formatter = :documentation # Use the specified formatter end - -at_exit { ChefSpec::Coverage.report! }
Remove the converge report in chefspec These lead to poorly designed specs Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,5 +1,13 @@+# SimpleCov must run _first_ according to its README if ENV['COVERAGE'] require 'simplecov' + + # monkey-patch to prevent SimpleCov from reporting coverage percentage + class SimpleCov::Formatter::HTMLFormatter + def output_message(_message) + nil + end + end SimpleCov.profiles.define 'gem' do add_filter '/spec/' @@ -8,6 +16,8 @@ add_group 'Libraries', '/lib/' end + SimpleCov.minimum_coverage(80) + SimpleCov.maximum_coverage_drop(20) SimpleCov.start 'gem' end @@ -32,16 +42,3 @@ c.syntax = :expect end end - -if ENV['COVERAGE'] - ACCEPTED_COVERAGE = 97 - SimpleCov.at_exit do - SimpleCov.result.format! - # do not change the coverage percentage, instead add more unit tests to fix coverage failures. - if SimpleCov.result.covered_percent < ACCEPTED_COVERAGE - print "ERROR::BAD_CODE_COVERAGE\n" - print "Coverage is less than acceptable limit(#{ACCEPTED_COVERAGE}%). Please add more tests to improve the coverage" - exit(1) - end - end -end
Change SimpleCov behaviour to stop reporting Change the SimpleCov behaviour so that it no longer reports coverage when `rake` completes and acts only as a 'red light' if coverage drops significantly (by 20%) or drops below a percentage (80%). Note that to silence the 'Coverage report generated for' message that reports the coverage percentage when SimpleCov completes, we monkey-patch the SimpleCov::Formatter::HTMLFormatter class. Also, `SimpleCov#result.format!` is called by default when SimpleCov exits[1], so there's no need for us to explicitly call it. The SimpleCov::Formatter::HTMLFormatter#output_message _only_ prints the 'Coverage report generated for' message, so by monkey-patching it we don't lose the other warnings that we want to keep (mentioned above).
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -25,6 +25,9 @@ config.filter_run_when_matching :focus config.before(:each) { Grape::Util::InheritableSetting.reset_global! } + + # Enable flags like --only-failures and --next-failure + config.example_status_persistence_file_path = ".rspec_status" end require 'coveralls'
Enable support for `rspec --next-failure`.
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -7,7 +7,7 @@ module Serverspec module Backend - class Ssh + class Exec def do_check(cmd) if cmd =~ /invalid/ { @@ -30,6 +30,7 @@ end RSpec.configure do |c| + c.include(Serverspec::Helper::Exec) c.add_setting :stdout, :default => '' c.add_setting :stderr, :default => '' end
Use Helper::Exec instead of Helper::Ssh
diff --git a/app/models/physical_server.rb b/app/models/physical_server.rb index abc1234..def5678 100644 --- a/app/models/physical_server.rb +++ b/app/models/physical_server.rb @@ -5,7 +5,6 @@ belongs_to :ext_management_system, :foreign_key => :ems_id, :class_name => "ManageIQ::Providers::PhysicalInfraManager" - default_value_for :enabled, true belongs_to :host def name_with_details
Remove referenced to undefined :enabled attribute
diff --git a/app/overrides/orders_index.rb b/app/overrides/orders_index.rb index abc1234..def5678 100644 --- a/app/overrides/orders_index.rb +++ b/app/overrides/orders_index.rb @@ -5,13 +5,4 @@ <li> <%= button_link_to Spree.t(:view_on_shippo), admin_shippo_orders_path, :icon => '' %> </li> - ") - -Deface::Override.new(:virtual_path => 'spree/admin/orders/index', - :name => 'add_shippo_connect_button_to_orders_page', - :insert_after => "erb[silent]:contains('content_for :page_actions')", - :text => " - <li> - <%= button_link_to Spree.t(:connect_shippo), admin_shippo_settings_path, :icon => '' %> - </li> ")
Remove order list connect button
diff --git a/app/services/stats_service.rb b/app/services/stats_service.rb index abc1234..def5678 100644 --- a/app/services/stats_service.rb +++ b/app/services/stats_service.rb @@ -1,5 +1,5 @@ class StatsService - GRAPH_SAMPLES = 4 + GRAPH_SAMPLES = 5 attr_accessor :check_ins, :leader
Increase graph samples 4 -> 5 in check ins
diff --git a/config/initializers/actionmailer.rb b/config/initializers/actionmailer.rb index abc1234..def5678 100644 --- a/config/initializers/actionmailer.rb +++ b/config/initializers/actionmailer.rb @@ -1,6 +1,15 @@ if File.exists?("#{RAILS_ROOT}/config/mailer.yml") require "action_mailer" c = YAML::load(File.open("#{RAILS_ROOT}/config/mailer.yml")) - ActionMailer::Base.delivery_method = c[:delivery_method] - ActionMailer::Base.smtp_settings = c[:smtp] + c.each do |key,val| + if key == :smtp || key == 'smtp' + key = :smtp_settings + end + begin + ActionMailer::Base.send("#{key}=".to_sym, val) + rescue Exception => e + $stderr.puts "Problem processing key '#{key}' in config/mailer.yml" + $stderr.puts "#{e}" + end + end end
Change the way config/mailer.yml is read so that it supports configurations other than smtp.
diff --git a/test/models/account_test.rb b/test/models/account_test.rb index abc1234..def5678 100644 --- a/test/models/account_test.rb +++ b/test/models/account_test.rb @@ -2,6 +2,7 @@ describe Account do before do + ENV['INCOMING_EMAIL_DOMAIN'] = 'example.com' @account = FactoryGirl.build(:account) end
Set required ENV var in test
diff --git a/cf_spec/spec_helper.rb b/cf_spec/spec_helper.rb index abc1234..def5678 100644 --- a/cf_spec/spec_helper.rb +++ b/cf_spec/spec_helper.rb @@ -6,6 +6,9 @@ Machete.logger = Machete::Logger.new("log/integration.log") RSpec.configure do |config| + config.color = true + config.tty = true + config.filter_run_excluding :cached => ENV['BUILDPACK_MODE'] == 'uncached' config.filter_run_excluding :uncached => ENV['BUILDPACK_MODE'] == 'cached' end
Make RSpec emit colored output no matter what We thought concourse-filter was swallowing color codes. It was not. Instead, they were not emitted on CI. [#133046105]
diff --git a/lib/skr/concerns/code_identifier.rb b/lib/skr/concerns/code_identifier.rb index abc1234..def5678 100644 --- a/lib/skr/concerns/code_identifier.rb +++ b/lib/skr/concerns/code_identifier.rb @@ -24,7 +24,10 @@ if from before_validation(:on=>:create) do - self.code ||= Skr::Core::Strings.code_identifier( self[ from ], length:max_length ) + source = self[from] + unless source.blank? + self.code ||= Skr::Core::Strings.code_identifier( source, length:max_length ) + end end end
Deal with possibly nil source strings
diff --git a/app/overrides/products/index/add_welcome_text_to_home_page.rb b/app/overrides/products/index/add_welcome_text_to_home_page.rb index abc1234..def5678 100644 --- a/app/overrides/products/index/add_welcome_text_to_home_page.rb +++ b/app/overrides/products/index/add_welcome_text_to_home_page.rb @@ -1,7 +1,7 @@ # encoding: UTF-8 -Deface::Override.new(:virtual_path => 'spree/home/index', +Deface::Override.new(:virtual_path => 'spree/products/index', :name => 'add_welcome_text_to_home_page', :insert_before => '[data-hook="homepage_products"]', - :text => '<h2>Alle Leckereien aus Schwein</h2><p>Oben links auf das aktuellste Schwein klicken, um seine Wurst zu bestellen (Schwarzweißschweine wurden bereits geschlachtet). Weiter unten ist auch sofort lieferbare Wurst vom sogenannten Schwein x zu haben. Alles ausverkauft? Gerne nehme ich Nachfragen oder Vorbestellung per Mail entgegen.</p>') + :text => '<h2>Hier gibt´s lecker Wurst mit Gesicht.</h2><p> Falls die Sorte Deiner Wahl ausverkauft ist: Mit dem <a href="http://eepurl.com/h6YTQ" target="_blank">Schweine-Newsletter</a> informieren wir über Wurst- und andere Neuigkeiten.</p>')
Add text with newsletter link.
diff --git a/app/controllers/backend/assets_controller.rb b/app/controllers/backend/assets_controller.rb index abc1234..def5678 100644 --- a/app/controllers/backend/assets_controller.rb +++ b/app/controllers/backend/assets_controller.rb @@ -1,5 +1,5 @@ class Backend::AssetsController < Backend::BaseController - before_action :find_model, only: [:edit, :update, :destroy] + before_action :find_model, only: [:show, :edit, :update, :destroy] before_action -> { breadcrumb.add t('b.files'), backend_assets_path } def index
Make sure assets can be deleted.
diff --git a/Library/Contributions/cmd/brew-tap-readme.rb b/Library/Contributions/cmd/brew-tap-readme.rb index abc1234..def5678 100644 --- a/Library/Contributions/cmd/brew-tap-readme.rb +++ b/Library/Contributions/cmd/brew-tap-readme.rb @@ -0,0 +1,32 @@+name = ARGV.first + +raise "A name is required" if name.nil? + +template = <<-EOS +Homebrew-#{name} +=========#{'=' * name.size} + +How do I install these formulae? +-------------------------------- +Just `brew tap homebrew/#{name}` and then `brew install <formula>`. + +If the formula conflicts with one from mxcl/master or another tap, you can `brew install homebrew/#{name}/<formula>`. + +You can also install via URL: + +``` +brew install https://raw.github.com/Homebrew/homebrew-#{name}/master/<formula>.rb +``` + +Docs +---- +`brew help`, `man brew`, or the Homebrew [wiki][]. + +[wiki]:http://wiki.github.com/mxcl/homebrew +EOS + +# puts ERB.new(template, nil, '>').result(binding) +puts template if ARGV.verbose? +path = Pathname.new('./README.md') +raise "#{path} already exists" if path.exist? +path.write template
Add `brew tap-readme <name>` external command. Closes Homebrew/homebrew#17935.
diff --git a/app/controllers/event_partners_controller.rb b/app/controllers/event_partners_controller.rb index abc1234..def5678 100644 --- a/app/controllers/event_partners_controller.rb +++ b/app/controllers/event_partners_controller.rb @@ -31,5 +31,6 @@ def load_parent @event = Event.find_by_slug!(params[:event_id]) + authorize! :edit, @event end end
Add authorization for Event Partner
diff --git a/core/spec/requests/admin/configuration/image_settings_spec.rb b/core/spec/requests/admin/configuration/image_settings_spec.rb index abc1234..def5678 100644 --- a/core/spec/requests/admin/configuration/image_settings_spec.rb +++ b/core/spec/requests/admin/configuration/image_settings_spec.rb @@ -2,6 +2,10 @@ describe "image settings" do stub_authorization! + + after do + reset_spree_preferences + end before do visit spree.admin_path @@ -13,12 +17,12 @@ it "can update attachment_url" do fill_in "Attachments URL", :with => "foobar" fill_in "Attachments Default URL", :with => "barfoo" - fill_in "Attachments Path", :with => "bfaoro" + fill_in "Attachments Path", :with => "spec/dummy/tmp/bfaoro" click_button "Update" Spree::Config[:attachment_url].should == "foobar" Spree::Config[:attachment_default_url].should == "barfoo" - Spree::Config[:attachment_path].should == "bfaoro" + Spree::Config[:attachment_path].should == "spec/dummy/tmp/bfaoro" end end
Reset preferences after spec to properly teardown test and avoid files being saved where they are not gitignored. Fixes #2467
diff --git a/lib/rubocop/cop/metrics/method_length.rb b/lib/rubocop/cop/metrics/method_length.rb index abc1234..def5678 100644 --- a/lib/rubocop/cop/metrics/method_length.rb +++ b/lib/rubocop/cop/metrics/method_length.rb @@ -23,9 +23,7 @@ def code_length(node) lines = node.loc.expression.source.lines.to_a[1..-2] || [] - lines.reject! { |line| irrelevant_line(line) } - - lines.size + lines.count { |line| !irrelevant_line(line) } end end end
Use count instead of reject!..size
diff --git a/lib/watch_tower/editor/base_appscript.rb b/lib/watch_tower/editor/base_appscript.rb index abc1234..def5678 100644 --- a/lib/watch_tower/editor/base_appscript.rb +++ b/lib/watch_tower/editor/base_appscript.rb @@ -13,6 +13,9 @@ # Include AppScript include ::Appscript + # Is the editor running ? + # + # @return [Boolean] def is_running? editor.is_running? if editor end @@ -31,10 +34,18 @@ editor.try(:version).try(:get) end + # Return the path of the document being edited + # Child classes can override this method if the behaviour is different + # + # @return [String] path to the document currently being edited def current_path current_paths.try(:first) end + # Return the pathes of the documents being edited + # Child classes can override this method if the behaviour is different + # + # @return [Array] pathes to the documents currently being edited def current_paths if is_running? editor.document.get.collect(&:path).collect(&:get)
BaseAppscript: Add Documentation for the methods defined.
diff --git a/demo/models/photo.rb b/demo/models/photo.rb index abc1234..def5678 100644 --- a/demo/models/photo.rb +++ b/demo/models/photo.rb @@ -2,5 +2,5 @@ require "./uploaders/image_uploader" class Photo < Sequel::Model - include ImageUploader[:image] + include ImageUploader::Attachment.new(:image) end
Use ImageUploader::Attachment.new(:image) instead of ImageUploader[:image]
diff --git a/app/controllers/api/v1/replies_controller.rb b/app/controllers/api/v1/replies_controller.rb index abc1234..def5678 100644 --- a/app/controllers/api/v1/replies_controller.rb +++ b/app/controllers/api/v1/replies_controller.rb @@ -18,10 +18,11 @@ access_denied and return unless post.visible_to?(current_user) replies = post.replies - .select('replies.*, characters.name, characters.screenname, icons.keyword, icons.url, users.username') + .select('replies.*, characters.name, characters.screenname, icons.keyword, icons.url, users.username, character_aliases.name as alias') .joins(:user) .joins("LEFT OUTER JOIN characters ON characters.id = replies.character_id") .joins("LEFT OUTER JOIN icons ON icons.id = replies.icon_id") + .joins("LEFT OUTER JOIN character_aliases ON character_aliases.id = replies.character_alias_id") .order('id asc') paginate json: replies, per_page: per_page end
Add alias join to API replies controller
diff --git a/Casks/hostbuddy.rb b/Casks/hostbuddy.rb index abc1234..def5678 100644 --- a/Casks/hostbuddy.rb +++ b/Casks/hostbuddy.rb @@ -5,7 +5,7 @@ url 'https://clickontyler.com/hostbuddy/download/' appcast 'http://shine.clickontyler.com/appcast.php?id=22' name 'Hostbuddy' - homepage 'http://clickontyler.com/hostbuddy/' + homepage 'https://clickontyler.com/hostbuddy/' license :commercial app 'Hostbuddy.app'
Fix homepage to use SSL in Hostbuddy Cask The HTTP URL is already getting redirected to HTTPS. Using the HTTPS URL directly makes it more secure and saves a HTTP round-trip.
diff --git a/spec/end_to_end/end_to_end_spec.rb b/spec/end_to_end/end_to_end_spec.rb index abc1234..def5678 100644 --- a/spec/end_to_end/end_to_end_spec.rb +++ b/spec/end_to_end/end_to_end_spec.rb @@ -5,7 +5,8 @@ def expect_runs(source_file, expected_output) executable = File.expand_path('../../../target/debug/hummingbird', __FILE__) - output = `#{executable} #{source_file}` + command = "#{executable} #{source_file}" + output = `#{command}` if $?.exitstatus != 0 $stderr.puts "Command failed: #{command}" $stderr.puts output
Fix typo in end-to-end harness
diff --git a/spec/models/portal/country_spec.rb b/spec/models/portal/country_spec.rb index abc1234..def5678 100644 --- a/spec/models/portal/country_spec.rb +++ b/spec/models/portal/country_spec.rb @@ -42,10 +42,9 @@ end end - # TODO: auto-generated describe '.from_hash' do it 'from_hash' do - in_hash = {} + in_hash = {:name => "Utopia"} result = described_class.from_hash(in_hash) expect(result).not_to be_nil
Update spec test for Portal::Country class
diff --git a/rspec_junit_formatter.gemspec b/rspec_junit_formatter.gemspec index abc1234..def5678 100644 --- a/rspec_junit_formatter.gemspec +++ b/rspec_junit_formatter.gemspec @@ -13,6 +13,8 @@ s.required_rubygems_version = ">= 1.3.6" s.add_dependency "rspec", "~> 2.0" + # https://github.com/rspec/rspec-core/commit/f06254c00770387e3a8a2efbdbc973035c217f6a + s.add_dependency "rspec-core", "!= 2.12.0" s.add_dependency "builder" s.files = Dir["lib/**/*"] + %w[README.md LICENSE]
Make sure we don't get loaded with bad rspec-core
diff --git a/foodr-backend/db/migrate/20170729002122_create_ingredients.rb b/foodr-backend/db/migrate/20170729002122_create_ingredients.rb index abc1234..def5678 100644 --- a/foodr-backend/db/migrate/20170729002122_create_ingredients.rb +++ b/foodr-backend/db/migrate/20170729002122_create_ingredients.rb @@ -3,7 +3,7 @@ create_table :ingredients do |t| t.string :name t.text :description - t.string :type + t.boolean :is_natural t.string :img_url t.timestamps
Change ingredient field from type to is_natural
diff --git a/lib/font_awesome/sass/rails/helpers.rb b/lib/font_awesome/sass/rails/helpers.rb index abc1234..def5678 100644 --- a/lib/font_awesome/sass/rails/helpers.rb +++ b/lib/font_awesome/sass/rails/helpers.rb @@ -11,7 +11,7 @@ html_options[:class] = content_class html = content_tag(:i, nil, html_options) - html << ' ' << text unless text.blank? + html << ' ' << text.to_s unless text.blank? html end end
Fix appending non-strings to icon Example: `icon(:copyright, Time.now.year)` Before: © ߟ After: © 2015
diff --git a/lib/mumuki/laboratory/events/events.rb b/lib/mumuki/laboratory/events/events.rb index abc1234..def5678 100644 --- a/lib/mumuki/laboratory/events/events.rb +++ b/lib/mumuki/laboratory/events/events.rb @@ -20,6 +20,10 @@ Exam.import_from_resource_h! body end + event 'UpsertExamStudents' do |body| + Exam.upsert_students! body + end + # Emitted by assigment manual evaluation in classroom event 'AssignmentManuallyEvaluated' do |payload| Assignment.evaluate_manually! payload.deep_symbolize_keys[:assignment]
Add exam students upsert event
diff --git a/db/migrate/20121002130659_update_mainstream_categories.rb b/db/migrate/20121002130659_update_mainstream_categories.rb index abc1234..def5678 100644 --- a/db/migrate/20121002130659_update_mainstream_categories.rb +++ b/db/migrate/20121002130659_update_mainstream_categories.rb @@ -0,0 +1,51 @@+class MainstreamCategory < ActiveRecord::Base; end +class EditionMainstreamCategory < ActiveRecord::Base; end +class Edition < ActiveRecord::Base; end +class DetailedGuide < Edition + belongs_to :primary_mainstream_category, class_name: "MainstreamCategory" +end + +class UpdateMainstreamCategories < ActiveRecord::Migration + def up + MainstreamCategory.delete_all + EditionMainstreamCategory.delete_all + new_categories.each do |parent_tag, title, parent_title| + slug = title.parameterize + puts "Create: #{parent_tag}/#{slug}: #{title}" + MainstreamCategory.create!( + title: title, + slug: slug, + parent_tag: parent_tag, + parent_title: parent_title) + end + execute("update editions set primary_mainstream_category_id=#{MainstreamCategory.first.id} where type='DetailedGuide'") + end + + def down + end + + def new_categories + [ + ["business/maritime", "Maritime and freshwater businesses", "Maritime vessels and work at sea"], + ["business/licences", "Chemical licensing", "Licences and licence applications"], + ["business/waste-environment", "Environmental regulations", "Waste and environmental impact"], + ["business/farming", "Crops and horticulture", "Farming"], + ["business/farming", "Farm management and finance", "Farming"], + ["business/farming", "Farming and the environment", "Farming"], + ["business/farming", "Grants and payments for farmers", "Farming"], + ["business/farming", "Organic farming", "Farming"], + ["business/farming", "Livestock", "Farming"], + ["business/manufacturing", "Manufacturing regulations", "Manufacturing"], + ["business/manufacturing", "Import and export of manufactured goods", "Manufacturing"], + ["business/imports-exports", "Excise duty", "Imports and exports"], + ["business/imports-exports", "Import and export controls", "Imports and exports"], + ["business/imports-exports", "Import and export procedures", "Imports and exports"], + ["business/imports-exports", "Embargoes and sanctions", "Imports and exports"], + ["business/imports-exports", "Classification of goods", "Imports and exports"], + ["business/imports-exports", "Transporting goods", "Imports and exports"], + ["business/corporation-tax-capital-allowance", "Tax and legislation for corporations", "Corporation tax and capital allowances"], + ["employing-people/payroll", "Tax guidance for employers", "Payroll"], + ["tax/self-assessment", "Guidance for tax advisers and agents", "Self-assessment"] + ] + end +end
Add new detailed guidance categories
diff --git a/Casks/photo-supreme-single-user.rb b/Casks/photo-supreme-single-user.rb index abc1234..def5678 100644 --- a/Casks/photo-supreme-single-user.rb +++ b/Casks/photo-supreme-single-user.rb @@ -0,0 +1,13 @@+cask :v1 => 'photo-supreme-single-user' do + version '3' + sha256 'b2a60379e61ac6a44ac14b05e462a145ad65d5606e78c0cb4d46bd1fae1cc37c' + + url 'http://www.idimager.com/Trial/PhotoSupreme_V3.pkg' + name 'Photo Supreme Single User' + homepage 'http://www.idimager.com/WP/?page_id=20' + license :commercial + + pkg 'PhotoSupreme_V3.pkg' + + uninstall :pkgutil => 'com.idimager.idimagersu' +end
Add Photo Supreme v3 single user Install the single-user version of IDImager's DAM package, Photo Supreme v3
diff --git a/config/initializers/gollum.rb b/config/initializers/gollum.rb index abc1234..def5678 100644 --- a/config/initializers/gollum.rb +++ b/config/initializers/gollum.rb @@ -21,8 +21,10 @@ commit = @access.commit(sha) tree_map_for(sha).inject([]) do |list, entry| next list unless @page_class.valid_page_name?(entry.name) + list << entry.page(self, commit) break list if limit && list.size >= limit + list end else
Fix offense to the LineBreakAfterGuardClauses cop Signed-off-by: Rémy Coutable <4ea0184b9df19e0786dd00b28e6daa4d26baeb3e@rymai.me>
diff --git a/features/step_definitions/filtering_steps.rb b/features/step_definitions/filtering_steps.rb index abc1234..def5678 100644 --- a/features/step_definitions/filtering_steps.rb +++ b/features/step_definitions/filtering_steps.rb @@ -5,6 +5,7 @@ Then(/^I can get a list of all merger inquiries$/) do visit finder_path('cma-cases') page.should have_content('2 cases') + page.should have_css('.results .document', count: 2) within '.results .document:nth-child(1)' do page.should have_link('HealthCorp / DrugInc merger inquiry') @@ -12,21 +13,8 @@ page.should have_content('Merger inquiry') end - within '.results .document:nth-child(2)' do - page.should have_link('Private healthcare market investigation') - page.should have_content('14 August 2007') - page.should have_content('Market investigation') - end - select_filters('Case type' => 'Merger inquiries') page.should have_content('1 case') - - within '.results .document:nth-child(1)' do - page.should have_link('HealthCorp / DrugInc merger inquiry') - page.should have_content('30 December 2003') - page.should have_content('Merger inquiry') - end - - page.should have_no_content('Private healthcare market investigation') + page.should have_css('.results .document', count: 1) end
Refactor filtering step to look at items Check contents of one item but just asset counts for the rest.
diff --git a/spec/acceptance/class_spec.rb b/spec/acceptance/class_spec.rb index abc1234..def5678 100644 --- a/spec/acceptance/class_spec.rb +++ b/spec/acceptance/class_spec.rb @@ -6,7 +6,7 @@ pp =<<-EOS class { 'mock': } EOS - + apply_manifest(pp, :catch_failures => true) expect(apply_manifest(pp, :catch_failures => true).exit_code).to be_zero end @@ -20,4 +20,23 @@ it { should be_installed } end end + + context 'ensure => absent:' do + it 'should run successfully' do + pp =<<-EOS + class { 'mock': ensure => absent } + EOS + + apply_manifest(pp, :catch_failures => true) + expect(apply_manifest(pp, :catch_failures => true).exit_code).to be_zero + end + + describe group('mock') do + it { should_not exist } + end + + describe package('mock') do + it { should_not be_installed } + end + end end
Add extra system tests for when ensure => absent
diff --git a/spec/core/kernel/eval_spec.rb b/spec/core/kernel/eval_spec.rb index abc1234..def5678 100644 --- a/spec/core/kernel/eval_spec.rb +++ b/spec/core/kernel/eval_spec.rb @@ -15,4 +15,9 @@ it "creates a CompiledMethod that can be cached and re-run" do KernelSpecs.run_cache(@cache).should == "Object:Object" end + + it "should not use the cache if the line-number differs" do + eval("__LINE__", binding, "(file)", 1).should == 1 + eval("__LINE__", binding, "(file)", 2).should == 2 + end end
Add a spec for __LINE__ in eval
diff --git a/publify_core/spec/dummy/config/routes.rb b/publify_core/spec/dummy/config/routes.rb index abc1234..def5678 100644 --- a/publify_core/spec/dummy/config/routes.rb +++ b/publify_core/spec/dummy/config/routes.rb @@ -1,56 +1,4 @@ Rails.application.routes.draw do - # The priority is based upon order of creation: first created -> highest priority. - # See how all your routes lay out with "rake routes". - - # You can have the root of your site routed with "root" - # root 'welcome#index' - - # Example of regular route: - # get 'products/:id' => 'catalog#view' - - # Example of named route that can be invoked with purchase_url(id: product.id) - # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase - - # Example resource route (maps HTTP verbs to controller actions automatically): - # resources :products - - # Example resource route with options: - # resources :products do - # member do - # get 'short' - # post 'toggle' - # end - # - # collection do - # get 'sold' - # end - # end - - # Example resource route with sub-resources: - # resources :products do - # resources :comments, :sales - # resource :seller - # end - - # Example resource route with more complex sub-resources: - # resources :products do - # resources :comments - # resources :sales do - # get 'recent', on: :collection - # end - # end - - # Example resource route with concerns: - # concern :toggleable do - # post 'toggle' - # end - # resources :posts, concerns: :toggleable - # resources :photos, concerns: :toggleable - - # Example resource route within a namespace: - # namespace :admin do - # # Directs /admin/products/* to Admin::ProductsController - # # (app/controllers/admin/products_controller.rb) - # resources :products - # end + # The host application will automatically inherit the engine routes, so there + # is no need to put anything here. end
Remove route explanation from dummy app
diff --git a/lib/octostar/repositories/project_repository.rb b/lib/octostar/repositories/project_repository.rb index abc1234..def5678 100644 --- a/lib/octostar/repositories/project_repository.rb +++ b/lib/octostar/repositories/project_repository.rb @@ -1,4 +1,5 @@ class ProjectRepository < Hanami::Repository + # TODO: tests def find_by_account(account_id, search = {}, limit = 100) query = projects.where(account_id: account_id) query = text_search(query, search[:text])
Add todo comment for testing
diff --git a/lib/miq_automation_engine/service_models/miq_ae_service_storage.rb b/lib/miq_automation_engine/service_models/miq_ae_service_storage.rb index abc1234..def5678 100644 --- a/lib/miq_automation_engine/service_models/miq_ae_service_storage.rb +++ b/lib/miq_automation_engine/service_models/miq_ae_service_storage.rb @@ -6,6 +6,7 @@ expose :unregistered_vms, :association => true expose :storage_files, :association => true expose :files, :association => true + expose :storage_clusters, :association => true expose :to_s expose :scan, :override_return => true end
Add association Storage Clusters to Automate Storage Service Model. https://bugzilla.redhat.com/show_bug.cgi?id=1335658 (transferred from ManageIQ/manageiq@57a73d0ca0d96e5c26532709d4755b83de923ff4)
diff --git a/migrate/20190603154049_add_wdpa_id_and_name_to_pame_evaluations.rb b/migrate/20190603154049_add_wdpa_id_and_name_to_pame_evaluations.rb index abc1234..def5678 100644 --- a/migrate/20190603154049_add_wdpa_id_and_name_to_pame_evaluations.rb +++ b/migrate/20190603154049_add_wdpa_id_and_name_to_pame_evaluations.rb @@ -0,0 +1,8 @@+class AddWdpaIdAndNameToPameEvaluations < ActiveRecord::Migration[5.0] + def change + add_column :pame_evaluations, :wdpa_id, :integer, default: 0, null: false + add_column :pame_evaluations, :name, :string, default: "", null: false + add_index :pame_evaluations, :wdpa_id + add_index :pame_evaluations, :name + end +end
Add migration for adding wdpa id and name to pame evaluations