diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/lib/confoog/version.rb b/lib/confoog/version.rb index abc1234..def5678 100644 --- a/lib/confoog/version.rb +++ b/lib/confoog/version.rb @@ -2,5 +2,5 @@ module Confoog # Version of this Gem, using Semantic Versioning 2.0.0 # http://semver.org/ - VERSION = '0.4.0' + VERSION = '0.4.1' end
Tag for 0.4.1 and release Signed-off-by: Seapagan <4ab1b2fdb7784a8f9b55e81e3261617f44fd0585@gmail.com>
diff --git a/app/controllers/questions_controller.rb b/app/controllers/questions_controller.rb index abc1234..def5678 100644 --- a/app/controllers/questions_controller.rb +++ b/app/controllers/questions_controller.rb @@ -1,9 +1,3 @@-get '/questions' do - @survey = Survey.find_by(id: params[:survey_id]) - @questions = @survey.questions - erb :'/questions/index' -end - get '/questions/new' do @survey = Survey.find_by(id: params[:survey_id]) erb :'questions/new'
Remove questions index route from questions controller
diff --git a/app/controllers/space_api_controller.rb b/app/controllers/space_api_controller.rb index abc1234..def5678 100644 --- a/app/controllers/space_api_controller.rb +++ b/app/controllers/space_api_controller.rb @@ -9,7 +9,6 @@ def set_access_control_headers if request.format.json? response.headers['Access-Control-Allow-Origin'] = '*' - response.headers['Access-Control-Request-Method'] = '*' end end end
Remove useless header from Space API response
diff --git a/app/models/spree/gateway/pin_gateway.rb b/app/models/spree/gateway/pin_gateway.rb index abc1234..def5678 100644 --- a/app/models/spree/gateway/pin_gateway.rb +++ b/app/models/spree/gateway/pin_gateway.rb @@ -6,5 +6,10 @@ def provider_class ActiveMerchant::Billing::PinGateway end + + # Pin does not appear to support authorizing transactions yet + def auto_capture + true + end end end
[Pin] Set auto_capture to always be true so authorize is not attempted Fixes #106
diff --git a/lib/plugin_migrator.rb b/lib/plugin_migrator.rb index abc1234..def5678 100644 --- a/lib/plugin_migrator.rb +++ b/lib/plugin_migrator.rb @@ -1,5 +1,5 @@ require "string-cases" -load "#{File.dirname(__FILE__)}/tasks/plugin_migrator_tasks.rake" +load "#{File.dirname(__FILE__)}/tasks/plugin_migrator_tasks.rake" if ::Kernel.const_defined?(:Rake) module PluginMigrator def self.const_missing(name)
Load only if Rake is defined.
diff --git a/lib/template_picker.rb b/lib/template_picker.rb index abc1234..def5678 100644 --- a/lib/template_picker.rb +++ b/lib/template_picker.rb @@ -11,7 +11,7 @@ } def initialize(post) - self.post = post.is_a?(Reshare) ? post.root : post + self.post = post end def template_name
Revert "delegate ruby template picking on reshares so the posts look better" This reverts commit 5eb22471916b0b2230c80096a28ad80f489b067e.
diff --git a/lib/devise_dacs_authenticatable/strategy.rb b/lib/devise_dacs_authenticatable/strategy.rb index abc1234..def5678 100644 --- a/lib/devise_dacs_authenticatable/strategy.rb +++ b/lib/devise_dacs_authenticatable/strategy.rb @@ -5,10 +5,10 @@ class DacsAuthenticatable < Base # True if the mapping supports authenticate_with_dacs. def valid? - auth_with_dacs = mapping.to.respond_to?(:authenticate_with_dacs) - && (!Devise.dacs_jurisdiction - || request.env.fetch('DACS_JURISDICTION',nil) == Devise.dacs_jurisdiction) - && request.env.fetch('DACS_USERNAME',nil) + auth_with_dacs = mapping.to.respond_to?(:authenticate_with_dacs) && + (!Devise.dacs_jurisdiction || + request.env.fetch('DACS_JURISDICTION',nil) == Devise.dacs_jurisdiction) && + request.env.fetch('DACS_USERNAME',nil) end # Use the DACS_USERNAME to identify the user
Fix syntax error and logout code
diff --git a/sidekiq/recipes/configure.rb b/sidekiq/recipes/configure.rb index abc1234..def5678 100644 --- a/sidekiq/recipes/configure.rb +++ b/sidekiq/recipes/configure.rb @@ -15,7 +15,7 @@ owner deploy['user'] variables(:database => deploy['database'], :environment => deploy['rails_env']) - notifies :run, "execute[restart Sidekiq #{application}", :delayed + notifies :restart, "service[Sidekiq #{application}]", :delayed only_if do File.exists?(deploy_to) && File.exists?("#{deploy_to}/shared/config/")
Use sidekiq service for restart
diff --git a/db/migrate/20161004180821_change_project_total_contribution_types.rb b/db/migrate/20161004180821_change_project_total_contribution_types.rb index abc1234..def5678 100644 --- a/db/migrate/20161004180821_change_project_total_contribution_types.rb +++ b/db/migrate/20161004180821_change_project_total_contribution_types.rb @@ -0,0 +1,17 @@+class ChangeProjectTotalContributionTypes < ActiveRecord::Migration + def change + execute <<-SQL + CREATE OR REPLACE VIEW project_totals AS + SELECT + contributions.project_id, + sum(contributions.project_value) AS pledged, + ((sum(contributions.project_value) / projects.goal) * (100)::numeric) AS progress, + sum(contributions.payment_service_fee) AS total_payment_service_fee, + count(*) AS total_contributions, + sum(contributions.platform_value) AS platform_fee + FROM (contributions JOIN projects ON ((contributions.project_id = projects.id))) + WHERE ((contributions.state)::text = ANY ((ARRAY['confirmed'::character varying, 'requested_refund'::character varying])::text[])) + GROUP BY contributions.project_id, projects.goal; + SQL + end +end
Update ProjectTotal view to search only for contributions with requested_refund and confirmed states
diff --git a/lib/oxford/learners/dictionaries/english.rb b/lib/oxford/learners/dictionaries/english.rb index abc1234..def5678 100644 --- a/lib/oxford/learners/dictionaries/english.rb +++ b/lib/oxford/learners/dictionaries/english.rb @@ -21,12 +21,17 @@ private def parse - if @page.css(".n-g").count > 0 - parse_multiple_definitions - else - parse_unique_definition + parse_type + unless parse_unique_definition + separators = [".sd-d", ".d"] + separators.each do |separator| + if @page.css(separator).count > 1 + parse_multiple_definitions separator + return self + end + end end - parse_type + self end def parse_type @@ -34,12 +39,18 @@ end def parse_unique_definition - @definition[:definition_0] = @page.css(".d").text + puts @page.css(".h-g").css(".n-g").to_s.empty? + @definition[:definition_0] = @page.css(".d").text if @page.css(".h-g").css(".n-g").to_s.empty? + !@definition.empty? end - def parse_multiple_definitions - @page.css(".n-g").each_with_index do |definition, index| - @definition["definition_#{index}".to_sym] = definition.css(".d").text + def parse_multiple_definitions separator + @page.css(separator).each_with_index do |definition, index| + @definition["definition_#{index}".to_sym] = if definition.text.empty? + definition.css(".d").text + else + definition.text + end end end
Refactor parser to understand different tags with unique or multiple definitions
diff --git a/contao.gemspec b/contao.gemspec index abc1234..def5678 100644 --- a/contao.gemspec +++ b/contao.gemspec @@ -16,6 +16,7 @@ gem.version = Contao::VERSION # Runtime dependencies + gem.add_dependency 'rake' gem.add_dependency 'compass' gem.add_dependency 'oily_png' gem.add_dependency 'uglifier'
Add rake to the gemspec file
diff --git a/messaging.gemspec b/messaging.gemspec index abc1234..def5678 100644 --- a/messaging.gemspec +++ b/messaging.gemspec @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = 'evt-messaging' - s.version = '0.8.1.0' + s.version = '0.9.0.0' s.summary = 'Messaging primitives for Eventide' s.description = ' '
Package version is increased from 0.8.1.0 to 0.9.0.0
diff --git a/lib/appium_twine/appium_twine.rb b/lib/appium_twine/appium_twine.rb index abc1234..def5678 100644 --- a/lib/appium_twine/appium_twine.rb +++ b/lib/appium_twine/appium_twine.rb @@ -4,4 +4,4 @@ require_relative 'formatter' require_relative 'version' -Twine::Formatters.formatters += [Twine::Formatters::Csharp]+Twine::Formatters.register_formatter Twine::Formatters::Csharp
Update to new plugin method
diff --git a/app/controllers/votes_controller.rb b/app/controllers/votes_controller.rb index abc1234..def5678 100644 --- a/app/controllers/votes_controller.rb +++ b/app/controllers/votes_controller.rb @@ -1,8 +1,9 @@ class VotesController < ApplicationController def create + @comment = Comment.find(params[:comment_id]) @vote = Vote.new(value: 1, comment_id: params[:comment_id], user_id: current_user.id) - if @vote.save + if !@comment.votes.find_by(user_id: current_user.id) && @vote.save redirect_to trail_path(@vote.comment.trail.id) else redirect_to trail_path(@vote.comment.trail.id)
Include logic to not allow multiple votes by one user on the same comment
diff --git a/app/models/action_text/rich_text.rb b/app/models/action_text/rich_text.rb index abc1234..def5678 100644 --- a/app/models/action_text/rich_text.rb +++ b/app/models/action_text/rich_text.rb @@ -9,11 +9,6 @@ serialize :body, ActionText::Content delegate :to_s, :nil?, to: :body - delegate :blank?, :empty?, :present?, to: :to_plain_text - - def to_plain_text - body&.to_plain_text.to_s - end belongs_to :record, polymorphic: true, touch: true has_many_attached :embeds @@ -21,4 +16,10 @@ before_save do self.embeds = body.attachments.map(&:attachable) if body.present? end + + def to_plain_text + body&.to_plain_text.to_s + end + + delegate :blank?, :empty?, :present?, to: :to_plain_text end
Move method definition below callbacks
diff --git a/app/models/related_content_score.rb b/app/models/related_content_score.rb index abc1234..def5678 100644 --- a/app/models/related_content_score.rb +++ b/app/models/related_content_score.rb @@ -1,6 +1,8 @@ class RelatedContentScore < ActiveRecord::Base belongs_to :related_content, touch: true, counter_cache: :related_content_scores_count + belongs_to :user - validates :user_id, presence: true - validates :related_content_id, presence: true + validates :user, presence: true + validates :related_content, presence: true + validates :related_content_id, uniqueness: { scope: [:user_id] } end
Fix Related Content Score presence validations and unique composed key
diff --git a/lib/typhoeus/responses/legacy.rb b/lib/typhoeus/responses/legacy.rb index abc1234..def5678 100644 --- a/lib/typhoeus/responses/legacy.rb +++ b/lib/typhoeus/responses/legacy.rb @@ -8,7 +8,6 @@ # The legacy mapping. MAPPING = { :body => :response_body, - # :headers => :response_header, :code => :response_code, :curl_return_code => :return_code, :time => :total_time,
Remove headers b/c its already implemented.
diff --git a/test/dummy/app/inputs/date_picker_input.rb b/test/dummy/app/inputs/date_picker_input.rb index abc1234..def5678 100644 --- a/test/dummy/app/inputs/date_picker_input.rb +++ b/test/dummy/app/inputs/date_picker_input.rb @@ -2,6 +2,7 @@ def input(wrapper_options) + # Determine control type if input_type == :date || input_type == :datetime || input_type == :time type = input_type else @@ -9,11 +10,17 @@ type = column.present? ? column.type : nil end + # Set default type type||= :date + # Merge wrapper options opts = wrapper_options.merge(input_options.deep_dup) + # Remove simple form specific attributes + opts.except!(:as, :type, :min_max, :pattern); + # Override type opts[:type] = type + # Render date picker @builder.date_picker(attribute_name, opts) end
Update simple form picker in dummy
diff --git a/test/dummy/test/functional/users_controller_test.rb b/test/dummy/test/functional/users_controller_test.rb index abc1234..def5678 100644 --- a/test/dummy/test/functional/users_controller_test.rb +++ b/test/dummy/test/functional/users_controller_test.rb @@ -8,7 +8,8 @@ test "should get index" do get :index assert_response :success - assert_not_nil assigns(:users) + assert_not_nil assigns(:basic_users) + assert_not_nil assigns(:optimized_users) end test "should get new" do
Update test to match a previous change
diff --git a/iis/recipes/install.rb b/iis/recipes/install.rb index abc1234..def5678 100644 --- a/iis/recipes/install.rb +++ b/iis/recipes/install.rb @@ -1,36 +1,6 @@ powershell_script 'Install IIS' do code <<- EOH - Add-WindowsFeature Web-Server, - Web-WebServer, - Web-Common-Http, - Web-Default-Doc, - Web-Dir-Browsing, - Web-Http-Errors, - Web-Static-Content, - Web-Http-Redirect, - Web-Health, - Web-Http-Logging, - Web-Log-Libraries, - Web-Request-Monitor, - Web-Http-Tracing, - Web-Performance, - Web-Stat-Compression, - Web-Security, - Web-Filtering, - Web-Basic-Auth, - Web-Windows-Auth, - Web-App-Dev, - Web-Net-Ext, - Web-Net-Ext45, - Web-Asp-Net, - Web-Asp-Net45, - Web-ISAPI-Ext, - Web-ISAPI-Filter, - Web-WebSockets, - Web-Mgmt-Tools, - Web-Mgmt-Console, - Web-Mgmt-Compat, - Web-Mgmt-Service + Add-WindowsFeature Web-Server, Web-WebServer, Web-Common-Http, Web-Default-Doc, Web-Dir-Browsing, Web-Http-Errors, Web-Static-Content, Web-Http-Redirect, Web-Health, Web-Http-Logging, Web-Log-Libraries, Web-Request-Monitor, Web-Http-Tracing, Web-Performance, Web-Stat-Compression, Web-Security, Web-Filtering, Web-Basic-Auth, Web-Windows-Auth, Web-App-Dev, Web-Net-Ext, Web-Net-Ext45, Web-Asp-Net, Web-Asp-Net45, Web-ISAPI-Ext, Web-ISAPI-Filter, Web-WebSockets, Web-Mgmt-Tools, Web-Mgmt-Console, Web-Mgmt-Compat, Web-Mgmt-Service EOH action :run not_if "(Get-WindowsFeature -Name Web-Server).Installed"
Change powershell to single line command
diff --git a/app/workers/slack_regular_worker.rb b/app/workers/slack_regular_worker.rb index abc1234..def5678 100644 --- a/app/workers/slack_regular_worker.rb +++ b/app/workers/slack_regular_worker.rb @@ -11,19 +11,21 @@ project: project ).required? + slack_accounts = SlackAccount.where( + user_id: Intouch::Regular::RecipientsList.new( + issue: issue, + state: state, + protocol: 'slack' + ).call.map(&:id) + ).to_a + + return if slack_accounts.empty? + client = RedmineBots::Slack.bot_client channels = client.im_list return unless channels['ok'] - - slack_accounts = SlackAccount.where( - user_id: Intouch::Regular::RecipientsList.new( - issue: issue, - state: state, - protocol: 'slack' - ).call.map(&:id) - ) channels = client.im_list
Fix Slack regular notifications TooManyRequestsError
diff --git a/spec/features/course/announcement_pagination_spec.rb b/spec/features/course/announcement_pagination_spec.rb index abc1234..def5678 100644 --- a/spec/features/course/announcement_pagination_spec.rb +++ b/spec/features/course/announcement_pagination_spec.rb @@ -10,18 +10,18 @@ let!(:user) { create(:administrator) } let!(:course) { create(:course) } let!(:announcements) do - create_list(:course_announcement, 50, course: course) + create_list(:course_announcement, 30, course: course) end before do login_as(user, scope: :user) - visit course_announcements_path(course) end - it { is_expected.to have_selector('nav.pagination') } + it 'lists each announcement' do + visit course_announcements_path(course) - it 'lists each announcement' do - course.announcements.page(1).each do |announcement| + expect(page).to have_selector('nav.pagination') + course.announcements.sorted_by_sticky.sorted_by_date.page(1).each do |announcement| expect(page).to have_selector('div', text: announcement.title) expect(page).to have_selector('div', text: announcement.content) end @@ -31,7 +31,7 @@ before { visit course_announcements_path(course, page: '2') } it 'lists each announcement' do - course.announcements.page(2).each do |announcement| + course.announcements.sorted_by_sticky.sorted_by_date.page(2).each do |announcement| expect(page).to have_selector('div', text: announcement.title) expect(page).to have_selector('div', text: announcement.content) end
Fix course announcement pagination spec
diff --git a/spec/language/abstract_container/aggregation_spec.rb b/spec/language/abstract_container/aggregation_spec.rb index abc1234..def5678 100644 --- a/spec/language/abstract_container/aggregation_spec.rb +++ b/spec/language/abstract_container/aggregation_spec.rb @@ -0,0 +1,13 @@+require_relative '../../spec_helper' + +RSpec.describe Languages::Aggregation do + + context "When not implemented" do + it "Get aggregation" do + aggregationAbstract = Languages::Aggregation.new + expect{aggregationAbstract.get_aggregation("abc.new")}.to raise_error( + NotImplementedError) + end + end + +end
Create test for aggregation base class Signed-off-by: Lucas Moura <143f96f992bf3dc84afaa2cc3d6d759a2b3ef261@gmail.com> Signed-off-by: Johnnys Ribeiro <e28a8c0275ee127bd6f2bdac708244856a0a7106@gmail.com>
diff --git a/spec/ruby/library/socket/ipsocket/getaddress_spec.rb b/spec/ruby/library/socket/ipsocket/getaddress_spec.rb index abc1234..def5678 100644 --- a/spec/ruby/library/socket/ipsocket/getaddress_spec.rb +++ b/spec/ruby/library/socket/ipsocket/getaddress_spec.rb @@ -14,7 +14,9 @@ end it "raises an error on unknown hostnames" do - lambda { IPSocket.getaddress("imfakeidontexistanditrynottobeslow.com") }.should raise_error(SocketError) + lambda { + IPSocket.getaddress("rubyspecdoesntexist.fallingsnow.net") + }.should raise_error(SocketError) end end
Use a controlled name for testing unknown hostnames Some ISP intercept unknown domains under .com/.org/.net, so using somerandomname.com can easily fail. They don't seem to intercept unknown hostnames under normal domains though, so I've change us to use rubyspecdoesntexist.fallingsnow.net because I control fallingsnow.net and I know that there will never be a DNS entry for this host.
diff --git a/spec/lib/human_error_spec.rb b/spec/lib/human_error_spec.rb index abc1234..def5678 100644 --- a/spec/lib/human_error_spec.rb +++ b/spec/lib/human_error_spec.rb @@ -19,4 +19,14 @@ expect(human_error.fetch('RequestError')).to be_a HumanError::Errors::RequestError end + + it 'can lookup errors based on the local configuration' do + human_error = HumanError.new do |config| + config.api_version = 'foo' + end + + fetched_error = human_error.fetch('RequestError') + + expect(fetched_error.api_version).to eql 'foo' + end end
Feature: Allow local configuration to be passed to looked up errors This uses `Configuration#to_h` to generate a set of initialization values that are passed into each error that is looked up via `HumanError#fetch`. This allows each instance of `HumanError` to create errors with different information, even if they are of the same type. Example: error = HumanError.new do |config| config.api_version = 1 end error.fetch('RequestError').api_version # => 1 but if we created a new `HumanError` instance with an `api_version` of `2` then calling `fetch('RequestError').api_version` on that instance would yield `2`. -------------------------------------------------------------------------------- Change-Id: I0c26b3f59af2588dbd52384bdadd8bce0ee5180d Signed-off-by: Jeff Felchner <8a84c204e2d4c387d61d20f7892a2bbbf0bc8ae8@thekompanee.com>
diff --git a/spec/unit/belongs_to_spec.rb b/spec/unit/belongs_to_spec.rb index abc1234..def5678 100644 --- a/spec/unit/belongs_to_spec.rb +++ b/spec/unit/belongs_to_spec.rb @@ -4,7 +4,7 @@ let(:application){ ActiveAdmin::Application.new } - let(:namespace){ Namespace.new(application, :admin) } + let(:namespace){ ActiveAdmin::Namespace.new(application, :admin) } let(:post){ namespace.register(Post) } let(:belongs_to){ ActiveAdmin::Resource::BelongsTo.new(post, :user) }
Fix error `uninitialized constant Namespace`
diff --git a/spec/fixtures/models/post.rb b/spec/fixtures/models/post.rb index abc1234..def5678 100644 --- a/spec/fixtures/models/post.rb +++ b/spec/fixtures/models/post.rb @@ -4,6 +4,9 @@ has_many :votes, :as => :votable has_and_belongs_to_many :tags + + scope :published, -> { where(:published => true) } + scope :with_content, -> { where('content IS NOT NULL') } def title WrappedAttribute.new(self[:title])
Add scopes to the Post model to test handling of AR relations as input
diff --git a/spec/language/unless_spec.rb b/spec/language/unless_spec.rb index abc1234..def5678 100644 --- a/spec/language/unless_spec.rb +++ b/spec/language/unless_spec.rb @@ -1,3 +1,5 @@+require File.expand_path('../../spec_helper', __FILE__) + describe "The unless expression" do it "evaluates the unless body when the expression is false" do unless false @@ -25,7 +27,7 @@ end.should == 'bar' end - it "takes and optional then after the expression" do + it "takes an optional then after the expression" do unless false then 'baz' end.should == 'baz' @@ -38,4 +40,6 @@ it "allows expression and body to be on one line (using 'then')" do unless false then 'foo'; else 'bar'; end.should == 'foo' end -end+end + +# language_version __FILE__, "unless"
Add unless specs to match rubyspec
diff --git a/app/models/irs_group.rb b/app/models/irs_group.rb index abc1234..def5678 100644 --- a/app/models/irs_group.rb +++ b/app/models/irs_group.rb @@ -31,10 +31,6 @@ parent.hbx_enrollment_exemptions.where(:irs_group_id => self.id) end - def is_active?=(status) - self.is_active = status - end - def is_active? self.is_active end
Remove is_active setter with '?'
diff --git a/app/models/post/view.rb b/app/models/post/view.rb index abc1234..def5678 100644 --- a/app/models/post/view.rb +++ b/app/models/post/view.rb @@ -13,7 +13,7 @@ favorited_users = user.favorites.where(favorite: post.joined_authors).exists? return unless favorited_continuity || favorited_users - message = NotifyFollowersOfNewPostJob.notification_about(post, user, unread: true) + message = NotifyFollowersOfNewPostJob.notification_about(post, user, unread_only: true) return unless message message.update!(unread: false, read_at: Time.zone.now)
Use the correct keyword arg
diff --git a/Tabman.podspec b/Tabman.podspec index abc1234..def5678 100644 --- a/Tabman.podspec +++ b/Tabman.podspec @@ -3,7 +3,8 @@ s.name = "Tabman" s.platform = :ios, "9.0" s.requires_arc = true - s.swift_version = "4.0" + + s.swift_versions = ['4.0', '4.1', '4.2', '5.0'] s.version = "2.4.2" s.summary = "A powerful paging view controller with indicator bar."
Support multiple versions of Swift in podspec
diff --git a/name_resolution/name_resolver.rb b/name_resolution/name_resolver.rb index abc1234..def5678 100644 --- a/name_resolution/name_resolver.rb +++ b/name_resolution/name_resolver.rb @@ -0,0 +1,21 @@+require 'resolv' + +class NameResolver < Scout::Plugin + OPTIONS=<<-EOS + nameserver: + default: 8.8.8.8 + resolve_address: + default: google.com + EOS + + def build_report + resolver = Resolv::DNS.new(:nameserver => [option(:nameserver)]) + + begin + result = resolver.getaddress(option(:resolve_address)) + rescue Resolv::ResolvError => err + alert('Failed to resolve', err) + end + end +end +
Create domain name resolver plugin Takes a nameserver and resolve_address as input and raises an alert if resolution fails
diff --git a/app/models/backtrace_line.rb b/app/models/backtrace_line.rb index abc1234..def5678 100644 --- a/app/models/backtrace_line.rb +++ b/app/models/backtrace_line.rb @@ -1,6 +1,6 @@ class BacktraceLine include Mongoid::Document - IN_APP_PATH = %r{^\[PROJECT_ROOT\](?!(\/vendor))/?} + IN_APP_PATH = %r{^\[PROJECT_ROOT\]/?} GEMS_PATH = %r{\[GEM_ROOT\]\/gems\/([^\/]+)} field :number, :type => Integer
Enable backtrace links for vendor/ files
diff --git a/app/models/bz_query_entry.rb b/app/models/bz_query_entry.rb index abc1234..def5678 100644 --- a/app/models/bz_query_entry.rb +++ b/app/models/bz_query_entry.rb @@ -3,4 +3,5 @@ :pm_ack, :devel_ack, :qa_ack, :doc_ack, :version, :version_ack + belongs_to :bz_query_output end
Replace errant removal of belongs_to
diff --git a/app/models/digest_history.rb b/app/models/digest_history.rb index abc1234..def5678 100644 --- a/app/models/digest_history.rb +++ b/app/models/digest_history.rb @@ -7,7 +7,15 @@ history end - def posts - Post.all + def daily_posts + Post.where('created_at >= ?', 1.day.ago) + end + + def weekly_posts + Post.where('created_at >= ?', 1.week.ago) + end + + def monthly_posts + Post.where('created_at >= ?', 1.month.ago) end end
Add new methods for filter posts depend the date
diff --git a/db/data_migrations/20190110132424_resolve_zero_percent_measure_cigarettes_other.rb b/db/data_migrations/20190110132424_resolve_zero_percent_measure_cigarettes_other.rb index abc1234..def5678 100644 --- a/db/data_migrations/20190110132424_resolve_zero_percent_measure_cigarettes_other.rb +++ b/db/data_migrations/20190110132424_resolve_zero_percent_measure_cigarettes_other.rb @@ -0,0 +1,22 @@+TradeTariffBackend::DataMigrator.migration do + name "Remove 0% measure on Cigarettes Other" + + up do + applicable { + Measure::Operation.where(measure_sid: -491537).where(measure_type_id: 'FAA').where(goods_nomenclature_item_id: '2402209000').any? + } + apply { + Measure::Operation.where(measure_sid: -491537).where(measure_type_id: 'FAA').where(goods_nomenclature_item_id: '2402209000').delete + Measure::Operation.where(measure_sid: -490645).update(validity_end_date: nil) + } + end + + down do + applicable { + false + } + apply { + # noop + } + end +end
Add data migration to resolve 0% measure It was reported that the Erga Omnes value for cigarettes other was showing as 0%. Upon investigation we discovered an incorrect measure had been supplied in the CHIEF file on 28/11/2018, to resolve this we've implemented a data migration that removes the incorrect measure and sets the `validity_end_date` on the previous measure to NULL to restore it.
diff --git a/beacon.gemspec b/beacon.gemspec index abc1234..def5678 100644 --- a/beacon.gemspec +++ b/beacon.gemspec @@ -1,7 +1,7 @@ Gem::Specification.new do |s| s.name = "beacon" s.version = "0.1" - s.date = "2009-04-22" + s.date = "2009-04-25" s.description = "Simple and straightforward observers for your code" s.summary = "Simple and straightforward observers for your code" @@ -16,8 +16,7 @@ if s.respond_to?(:add_development_dependency) s.add_development_dependency "sr-mg" - s.add_development_dependency "contest" - s.add_development_dependency "redgreen" + s.add_development_dependency "rspec" end s.files = %w[
Update gemspec to reflect we're testing with rspec
diff --git a/tests/integration/spec/integration/dashboard_spec.rb b/tests/integration/spec/integration/dashboard_spec.rb index abc1234..def5678 100644 --- a/tests/integration/spec/integration/dashboard_spec.rb +++ b/tests/integration/spec/integration/dashboard_spec.rb @@ -5,7 +5,7 @@ it 'allows people to see the connect page' do visit '/' within_frame 'appFrame' do - page.should have_content('Welcome! Connect services to begin.') + page.should have_content("Nobody Selected") end end
Update front-end test to fix jenkins
diff --git a/lib/catissue/domain.rb b/lib/catissue/domain.rb index abc1234..def5678 100644 --- a/lib/catissue/domain.rb +++ b/lib/catissue/domain.rb @@ -16,8 +16,7 @@ # @param [Module] mod the resource mix-in module to extend with metadata capability def self.extend_module(mod) # Enable the resource metadata aspect. - md_proc = Proc.new { |klass| AnnotatableClass.extend_class(klass) } - CaRuby::Domain.extend_module(self, :mixin => mod, :metadata => md_proc, :package => PKG, :directory => SRC_DIR) + CaRuby::Domain.extend_module(self, :mixin => mod, :metadata => AnnotatableClass, :package => PKG, :directory => SRC_DIR) end private
Use new metadata extend mechanism.
diff --git a/lib/jeckle/resource.rb b/lib/jeckle/resource.rb index abc1234..def5678 100644 --- a/lib/jeckle/resource.rb +++ b/lib/jeckle/resource.rb @@ -16,7 +16,7 @@ module ClassMethods def headers { - 'Content-Type' => 'application/json', + 'Content-Type' => 'application/json' } end @@ -25,10 +25,8 @@ end def api - return @api if @api - - @api = Faraday.new(url: 'http://myapi.com').tap do |a| - a.headers = headers + @api ||= Faraday.new(url: 'http://myapi.com').tap do |request| + request.headers = headers end end end
Align code headers definition and rename block variable
diff --git a/lib/perform_feature.rb b/lib/perform_feature.rb index abc1234..def5678 100644 --- a/lib/perform_feature.rb +++ b/lib/perform_feature.rb @@ -8,6 +8,7 @@ base.extend PerformMethods base.helper_method :perform_feature + base.helper_method :authorised_feature? else base.extend PerformMethods end @@ -18,8 +19,6 @@ yield if authorised_feature?(feature) end - private - def authorised_feature?(feature) I18n.has_feature?(feature) rescue I18n::MissingTranslationData => e
[SCR-710] Make private method authorised_feature? public
diff --git a/lib/random-location.rb b/lib/random-location.rb index abc1234..def5678 100644 --- a/lib/random-location.rb +++ b/lib/random-location.rb @@ -3,7 +3,7 @@ METERS_IN_DEGREE = 111_300 - def nearby(lat, lng, r) + def near_by(lat, lng, r) u = rand v = rand
Change method name for a more Ruby one
diff --git a/lib/services/ticket.rb b/lib/services/ticket.rb index abc1234..def5678 100644 --- a/lib/services/ticket.rb +++ b/lib/services/ticket.rb @@ -10,9 +10,7 @@ private - def params - @params - end + attr_reader :params def authorise(request) # TODO
Change trivial reader method to attr_reader
diff --git a/lib/zebra/print_job.rb b/lib/zebra/print_job.rb index abc1234..def5678 100644 --- a/lib/zebra/print_job.rb +++ b/lib/zebra/print_job.rb @@ -29,9 +29,9 @@ def send_to_printer(path) # My ip is 192.168.101.99 if RUBY_PLATFORM =~ /darwin/ - `lpr -P #{@printer} -o raw #{path} -h 192.168.101.99[:631]` + `lpr -h 192.168.101.99 -P #{@printer}` else - `lp -d #{@printer} -o raw #{path} -h 192.168.101.99[:631]` + `lp -h 192.168.101.99 -d #{@printer}` end end end
Remove path declaration from send_to_printer method
diff --git a/app/models/feed.rb b/app/models/feed.rb index abc1234..def5678 100644 --- a/app/models/feed.rb +++ b/app/models/feed.rb @@ -16,11 +16,11 @@ } scope :inactive, lambda { - where('(schedule IS NULL OR id IN (?))', Feed.archived.select(:id)) + where('(schedule IS NULL OR id IN (?))', Feed.unscoped.archived.select(:id)) } scope :active, lambda { - where('(schedule IS NOT NULL AND id NOT IN (?))', Feed.archived.select(:id)) + where('(schedule IS NOT NULL AND id NOT IN (?))', Feed.unscoped.archived.select(:id)) } delegate :canteen, to: :source
Fix Rails 6.1 deprecation on class method scopes Fix the following deprecation warning: Class level methods will no longer inherit scoping from `inactive` in Rails 6.1. To continue using the scoped relation, pass it into the block directly. To instead access the full set of models, as Rails 6.1 will, use `Feed.unscoped`, or `Feed.default_scoped` if a model has default scopes. The archived scope here does not need to inherit any existing scopes or conditions from Feed. It is therefore changed into `Feed.unscoped.archived`.
diff --git a/app/models/good.rb b/app/models/good.rb index abc1234..def5678 100644 --- a/app/models/good.rb +++ b/app/models/good.rb @@ -3,6 +3,11 @@ validates :price, numericality: { greater_than_or_equal_to: 0 } validates :amount, numericality: { only_integer: true, greater_than_or_equal_to: 0 } + # TODO: в базе данных у нас есть поле item_type, которое содержит в себе тип товара (Книга, программа, автомобиль и так далее) + # В данный момент мы нигде не используем это поле. Оно может пригодиться для каталогизации товаров, + # а также добавления специальной логики для того или иного типа товаров (например, цена на автомобиль + # должна быть не меньше 100000 рублей). + def available? amount > 0 end
Add todo for item_type for Goods table
diff --git a/app/models/user.rb b/app/models/user.rb index abc1234..def5678 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -7,7 +7,7 @@ end def avatar_url - if self[:avatar_url].nil? + if self[:avatar_url].blank? "https://github.com/identicons/#{username}.png" else self[:avatar_url]
Use blank rather than nil for avatar url
diff --git a/spec/dynamoid/config_spec.rb b/spec/dynamoid/config_spec.rb index abc1234..def5678 100644 --- a/spec/dynamoid/config_spec.rb +++ b/spec/dynamoid/config_spec.rb @@ -2,9 +2,21 @@ describe Dynamoid::Config do describe 'credentials' do - it 'passes credentials to a client connection', config: { - credentials: Aws::Credentials.new('your_access_key_id', 'your_secret_access_key') - } do + let(:credentials_new) do + Aws::Credentials.new('your_access_key_id', 'your_secret_access_key') + end + + before do + @credentials_old, Dynamoid.config.credentials = Dynamoid.config.credentials, credentials_new + Dynamoid.adapter.connect! # clear cached client + end + + after do + Dynamoid.config.credentials = @credentials_old + Dynamoid.adapter.connect! # clear cached client + end + + it 'passes credentials to a client connection' do credentials = Dynamoid.adapter.client.config.credentials expect(credentials.access_key_id).to eq 'your_access_key_id'
Fix specs: clear cached connection between specs
diff --git a/spec/models/province_spec.rb b/spec/models/province_spec.rb index abc1234..def5678 100644 --- a/spec/models/province_spec.rb +++ b/spec/models/province_spec.rb @@ -7,7 +7,9 @@ end it 'should be able to call the factory many times' do - 25.times { build_stubbed :province } + 13.times { build_stubbed :province } + expect(build_stubbed(:province).code).to eq 29 + expect(build_stubbed(:province).code).to eq 11 end it { is_expected.to validate_presence_of :name }
Improve test for province factory rollover
diff --git a/spec/controllers/answers_controller_spec.rb b/spec/controllers/answers_controller_spec.rb index abc1234..def5678 100644 --- a/spec/controllers/answers_controller_spec.rb +++ b/spec/controllers/answers_controller_spec.rb @@ -0,0 +1,41 @@+require 'rails_helper' + +describe AnswersController do + let(:user) {FactoryGirl.create(:user)} + + let(:answer_attributes) { FactoryGirl.build(:answer).attributes } + # let(:answer) { FactoryGirl.create(:answer) } + # before { @answer = FactoryGirl.create(:answer).attributes } + before { @user = FactoryGirl.create(:user) } + before { @question = FactoryGirl.create(:question) } + before { @answer = Answer.create(question_id: @question.id, content: "blah", answerer_id: @user.id) } + # before { @answer.question_id = @question.id } + + before(:each) do + allow_any_instance_of(ApplicationController).to receive(:current_user).and_return(user) + end + + + describe "#create" do + it "creates a new answer" do + expect do + post :create, :question_id => @question.id, :answer => answer_attributes + end.to change{Answer.count}.by(1) + end + end + + describe "#best" do + it "updates best_answer_id attribute in parent question" do + puts "THESE TWO NUMBERS SHOULD MATCH:" + puts @answer.question_id + puts @question.id + puts "THIS IS THE BEST ANSWER ID BEFOREHAND:" + puts @question.best_answer_id + expect do + post :best, :best_answer_id => @answer.id + end.to change{@question.best_answer_id}.from(nil).to(@answer.id) + end + end + + +end
Create answers controller spec with some tests
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 @@ -16,7 +16,7 @@ context 'test env' do it 'uploads the cover image to the correct bucket' do - expect(cover_image.file.url).to match(/.*\/zinedistro-test.*/) + expect(cover_image.file.url).to match(/.*\/#{ENV['CARRIERWAVE_DIRECTORY']}-test.*/) end end end
Use carrierwave directory name for subdomain
diff --git a/spec/workers/email_alert_api_worker_spec.rb b/spec/workers/email_alert_api_worker_spec.rb index abc1234..def5678 100644 --- a/spec/workers/email_alert_api_worker_spec.rb +++ b/spec/workers/email_alert_api_worker_spec.rb @@ -24,6 +24,8 @@ it "doesn't retry 409s" do stub_any_email_alert_api_call.and_raise(GdsApi::HTTPConflict.new(409)) + expect(Sidekiq.logger).to receive(:info).with(/email-alert-api returned 409 conflict/) + expect { described_class.new.perform(payload: {}) }.not_to raise_error
Add message expectation on log output Setting a message expectation for the log output checks that the exception has been rescued, a message gets logged and reduces test output noise.
diff --git a/apple_push.gemspec b/apple_push.gemspec index abc1234..def5678 100644 --- a/apple_push.gemspec +++ b/apple_push.gemspec @@ -16,7 +16,11 @@ s.add_runtime_dependency 'multi_json', '>= 0' s.add_runtime_dependency 'hashr', '>= 0' s.add_runtime_dependency 'em-apn', '>= 0' - + + s.add_development_dependency 'rake' + s.add_development_dependency 'rspec', '~> 2.9' + s.add_development_dependency 'rack-test', '~> 0.6' + s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") s.executables = `git ls-files -- bin/*`.split("\n").map{|f| File.basename(f)}
Add development dependencies to gemspec
diff --git a/examples/random_number_generator.rb b/examples/random_number_generator.rb index abc1234..def5678 100644 --- a/examples/random_number_generator.rb +++ b/examples/random_number_generator.rb @@ -3,8 +3,8 @@ class RandomNumberGenerator include Webhooks - def webhooks - %w{http://localhost:9000} + def initialize + self.webhooks = %w{http://localhost:9000} end def generate
Set webhooks in initializer for random number generator
diff --git a/core/app/models/spree/product_property.rb b/core/app/models/spree/product_property.rb index abc1234..def5678 100644 --- a/core/app/models/spree/product_property.rb +++ b/core/app/models/spree/product_property.rb @@ -4,7 +4,7 @@ belongs_to :property validates :property, :presence => true - validates_length_of :value, :maximum => 255 + validates :value, :length => { :maximum => 255 } attr_accessible :property_name, :value
Use sexy Rails 3 validation for ProductProperty
diff --git a/Casks/beaker-electron.rb b/Casks/beaker-electron.rb index abc1234..def5678 100644 --- a/Casks/beaker-electron.rb +++ b/Casks/beaker-electron.rb @@ -0,0 +1,12 @@+cask 'beaker-electron' do + version '1.4.2-0-ge55c059' + sha256 '32d6ecf6a1ebfc32c3e1b2dfc1edb33eaeab6f83d3f9d74dd9b64e08bd24e3e6' + + # cloudfront.net is the official download host per the vendor homepage + url "https://d299yghl10frh5.cloudfront.net/beaker-notebook-#{version}-electron-mac.dmg" + name 'Beaker Electron' + homepage 'http://beakernotebook.com/' + license :apache + + app 'Beaker.app' +end
Add Beaker Notebook (Electron build) v1.4.2-0-ge55c059
diff --git a/lib/capybara/drivers/headless_chrome.rb b/lib/capybara/drivers/headless_chrome.rb index abc1234..def5678 100644 --- a/lib/capybara/drivers/headless_chrome.rb +++ b/lib/capybara/drivers/headless_chrome.rb @@ -12,7 +12,7 @@ capabilities = Selenium::WebDriver::Remote::Capabilities.chrome( profile: profile, chromeOptions: { - args: %w[headless disable-gpu], + args: %w[headless disable-gpu no-sandbox], binary: FindChrome.binary, }, )
Add no-sandbox option to headless chrome driver It looks as if heroku needs this option set in order for it to run on their dynos
diff --git a/lib/fb_graph/connections/ad_accounts.rb b/lib/fb_graph/connections/ad_accounts.rb index abc1234..def5678 100644 --- a/lib/fb_graph/connections/ad_accounts.rb +++ b/lib/fb_graph/connections/ad_accounts.rb @@ -9,6 +9,19 @@ ) end end + + def ad_account!(options) + default_options = { + :partner => 'NONE', + :end_advertiser => 'NONE', + :media_agency => 'NONE' + } + + ad_account = post default_options.merge(options.merge(:connection => :adaccount)) + AdAccount.new ad_account[:id], ad_account.merge( + :access_token => options[:access_token] || self.access_token + ) + end end end end
KSP-2439: Add ability to create ad accounts via business manager
diff --git a/app/controllers/page.rb b/app/controllers/page.rb index abc1234..def5678 100644 --- a/app/controllers/page.rb +++ b/app/controllers/page.rb @@ -2,7 +2,7 @@ get :index, :map => "/#{ENV['BASE_CANARY_PATH']}/:page_name" do @page_name = params[:page_name] - deliver(:hit_notifier, :hit_email, "#{@page_name} was Hit", ENV['EMAIL_DESTINATION']) + deliver(:hit_notifier, :hit_email, "#{@page_name} was Hit", ENV['EMAIL_DESTINATION']) unless ENV['STOP_ALL_EMAIL'] render 'index' end
Allow all email to be silenced with STOP_ALL_EMAIL
diff --git a/week-5/gps2_2.rb b/week-5/gps2_2.rb index abc1234..def5678 100644 --- a/week-5/gps2_2.rb +++ b/week-5/gps2_2.rb @@ -0,0 +1,69 @@+#Create a new list: +#Input: a list of grocery items and quantities +#Create a new hash +#Add an item and quantity to the existing list: +#Create a key/value pair and add it to the hash +#Remove an item/quantity by removing a key/value pair +#Update quantities of a list: +#Edit the value in a key/value pair +#Print a formatted list: +#Run a list, format by adding a dash by iterating to add to each key-value pair + +def create_list + grocery_list = Hash.new +end + +def add_item(list, item, quantity) + list[item]= quantity +end + +def remove_item(list, item) + list.delete(item) +end + +def change_quant(list, item, quantity) + list[item]= quantity +end + +def list_printer(list) + list.each { |k,v| puts "~~ #{k}: #{v}" } +end + + + +our_list = create_list +add_item(our_list, "chocolate bar", 3) +p our_list +change_quant(our_list, "chocolate bar", 6) +add_item(our_list, "pretzels", 2) +p our_list +list_printer(our_list) +remove_item(our_list, "chocolate bar") +p our_list + +# What did you learn about pseudocode from working on this challenge? +# It does not have to be complicated. It's also really helpful when pairing +# so that you know you are on the same page and have the same understanding of +# how to approach the problem. + +# What are the tradeoffs of using Arrays and Hashes for this challenge? +# I'm not sure how one would use arrays for this challenge since there are pairs +# of info and not just values that would be indexed. Hashes work well since there are +# two variables of information for the pairs. + +# What does a method return? +# A method returns whatever the last thing called was in the method. + +# What kind of things can you pass into methods as arguments? +# You can pass variables defined outside of the method. You can pass +# a variable that represents a method, such as "our_list" in the challenge +# above that represents the method create_list. + +# How can you pass information between methods? +# To pass information between methods, you can create a variable outside of a +# method to represent a method. Then when you can call that method inside of +# another method by using the variable to reference the argument. + +# What concepts were solidified in this challenge, and what concepts are still confusing? +# I got more practice in syntax in creating a hash, deleting and adding hash pairs, and how +# to represent a variable withoin a string.
Add challenge solution and reflection
diff --git a/dynosaur.gemspec b/dynosaur.gemspec index abc1234..def5678 100644 --- a/dynosaur.gemspec +++ b/dynosaur.gemspec @@ -17,7 +17,7 @@ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ['lib'] - spec.add_runtime_dependency 'platform-api', '>= 2.0', '< 2.3' + spec.add_runtime_dependency 'platform-api', '>= 2.0', '< 3.1' spec.add_runtime_dependency 'sys-proctable', '>= 0.9', '< 2.0' spec.add_development_dependency 'bundler', '~> 2.0'
Update platform-api requirement from >= 2.0, < 2.3 to >= 2.0, < 3.1 Updates the requirements on [platform-api](https://github.com/heroku/platform-api) to permit the latest version. - [Release notes](https://github.com/heroku/platform-api/releases) - [Changelog](https://github.com/heroku/platform-api/blob/master/CHANGELOG.md) - [Commits](https://github.com/heroku/platform-api/compare/v2.0.0...v3.0.0) Signed-off-by: dependabot-preview[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com>
diff --git a/spec/support/features/confirmation.rb b/spec/support/features/confirmation.rb index abc1234..def5678 100644 --- a/spec/support/features/confirmation.rb +++ b/spec/support/features/confirmation.rb @@ -1,5 +1,6 @@ # spec/support/features/confirmation.rb # TODO: Delete this module when `#accept_confirm` supported by capybara w/ chrome +# https://github.com/samvera/hyrax/issues/1445 module Features module Confirmation def accept_confirm
Add issue reference to accept_confirm workaround
diff --git a/sprout-osx-apps/attributes/nitrous.rb b/sprout-osx-apps/attributes/nitrous.rb index abc1234..def5678 100644 --- a/sprout-osx-apps/attributes/nitrous.rb +++ b/sprout-osx-apps/attributes/nitrous.rb @@ -1,3 +1,3 @@ default['sprout']['nitrous']['source'] = 'https://www.nitrous.io/mac/Nitrous-Mac-Latest.zip' -default['sorout']['nitrous']['checksum'] = '8eb4407cd0b327e1e9fbdd1ee165a58a959be861911b1dbfea86f6558a6dd59a' # Corresponds to 0.1.7 +default['sprout']['nitrous']['checksum'] = '8eb4407cd0b327e1e9fbdd1ee165a58a959be861911b1dbfea86f6558a6dd59a' # Corresponds to 0.1.7 default['sprout']['nitrous']['app'] = 'Nitrous.app'
Change 'o' --> 'p' in the word 'sorout' inside attributes/nirous.rb
diff --git a/client/ruby/solr-ruby/test/unit/changes_yaml_test.rb b/client/ruby/solr-ruby/test/unit/changes_yaml_test.rb index abc1234..def5678 100644 --- a/client/ruby/solr-ruby/test/unit/changes_yaml_test.rb +++ b/client/ruby/solr-ruby/test/unit/changes_yaml_test.rb @@ -0,0 +1,21 @@+# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require 'test/unit' + +class ChangesYamlTest < Test::Unit::TestCase + def test_parse + change_log = YAML.load_file(File.expand_path(File.dirname(__FILE__)) + "/../../CHANGES.yml") + assert_equal Date.parse("2007-02-15"), change_log["v0.0.1"]["release_date"] + assert_equal ["initial release"], change_log["v0.0.1"]["changes"] + end +end
Add test to check the proper parsability of CHANGES.yml git-svn-id: 3b1ff1236863b4d63a22e4dae568675c2e247730@573430 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/tasks/create-bosh-release/run.rb b/tasks/create-bosh-release/run.rb index abc1234..def5678 100644 --- a/tasks/create-bosh-release/run.rb +++ b/tasks/create-bosh-release/run.rb @@ -4,7 +4,7 @@ versions = Dir["buildpack-zip*/version"].map do |buildpack_version_file| - File.read(buildpack_version_file).gsub(/[\+#].*$/, '') + File.read(buildpack_version_file).gsub(/[\+#].*$/, '').gsub('Java Buildpack ', '') end.uniq if versions.size != 1
Remove Java Buildpack from version - Pivnet adds this Co-authored-by: Danny Joyce <656eadb1608d5e3ea5db131e513d97abdf96b075@pivotal.io>
diff --git a/test/models/user_request_test.rb b/test/models/user_request_test.rb index abc1234..def5678 100644 --- a/test/models/user_request_test.rb +++ b/test/models/user_request_test.rb @@ -8,7 +8,7 @@ user: users(:user_two) ) assert !user_request.valid? - assert_equal true, user_requests(:request_one).errors.added?(:user, 'already has a pending request for this team.') + assert_equal true, user_request.errors.added?(:user, 'already has a pending request for this team.') end test 'user on a team' do
Fix request test to check correct user_request
diff --git a/app/models/base_model.rb b/app/models/base_model.rb index abc1234..def5678 100644 --- a/app/models/base_model.rb +++ b/app/models/base_model.rb @@ -14,4 +14,8 @@ raw_write_attribute(:filename, name) save! end + + def public_stories(arel=nil) + Story.public_stories(arel || stories) + end end
Add public_stories to the base model to use in series, networks, and accounts
diff --git a/lib/activejob/locking/adapters/redlock.rb b/lib/activejob/locking/adapters/redlock.rb index abc1234..def5678 100644 --- a/lib/activejob/locking/adapters/redlock.rb +++ b/lib/activejob/locking/adapters/redlock.rb @@ -17,7 +17,7 @@ end def unlock - self.lock_manager.unlock(self.lock_token) + self.lock_manager.unlock(self.lock_token.symbolize_keys) self.lock_token = nil end end
Fix unlock for Redlock adapter When lock is deserialized, it is hash containing strings as keys. Though, Redlock expects lock to have Symbols as keys. Hence, the job is completed without releasing a lock. This might be valid for other adapters. (I have not checked it) If so, the problem must be fixed on `desecialize` step. Did not find how to set up test environment, so don't have specs, unfortunately.
diff --git a/tools/edit_all_log_statements.rb b/tools/edit_all_log_statements.rb index abc1234..def5678 100644 --- a/tools/edit_all_log_statements.rb +++ b/tools/edit_all_log_statements.rb @@ -0,0 +1,11 @@+#!/usr/bin/env ruby + +["debug", "info", "warning", "warn", "exception", "error", "critical"].each do |level| + # Try to automatically clean up a bit first + system(%{for F in `find . -name "*py"`; do sed -E 's/(\.#{level}\(".*")[ ]*%/\1,/g' $F; done}) + system(%{for F in `find . -name "*py"`; do sed -E "s/(\.#{level}\('.*')[ ]*%/\1,/g" $F; done}) + # Now examine each line by hand + `git grep -n '\.#{level}(' | cut -d ':' -f1,2 | sed "s/:/ +/g"`.each_line do |line| + system("vim #{line}") + end +end
Add a tool to edit the format of log messages
diff --git a/ISO8601DateFormatterValueTransformer.podspec b/ISO8601DateFormatterValueTransformer.podspec index abc1234..def5678 100644 --- a/ISO8601DateFormatterValueTransformer.podspec +++ b/ISO8601DateFormatterValueTransformer.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'ISO8601DateFormatterValueTransformer' - s.version = '0.5.0' + s.version = '0.7.0' s.license = 'Apache2' s.summary = 'A small library that integrates ISO8601DateFormatter with RKValueTransformers' s.homepage = 'https://github.com/blakewatters/ISO8601DateFormatterValueTransformer' @@ -9,9 +9,8 @@ s.source_files = 'Code' s.requires_arc = true - s.dependency 'RKValueTransformers', '~> 1.0.0' - # TODO: Awaiting integration with upstream version - #s.dependency 'ISO8601DateFormatter', '~> 0.7' + s.dependency 'RKValueTransformers', '~> 1.1.0' + s.dependency 'ISO8601DateFormatter', '~> 0.7' s.ios.deployment_target = '5.0' s.osx.deployment_target = '10.7'
Bump version to 0.7.0 and add dependency on mainline ISO8601DateFormatter
diff --git a/config/initializers/sentry.rb b/config/initializers/sentry.rb index abc1234..def5678 100644 --- a/config/initializers/sentry.rb +++ b/config/initializers/sentry.rb @@ -5,7 +5,7 @@ config.dsn = ENV['SENTRY_DSN'] config.breadcrumbs_logger = [:active_support_logger] - # Send 10% of transactions for performance monitoring - config.traces_sample_rate = 0.1 + # Send 5% of transactions for performance monitoring + config.traces_sample_rate = 0.05 end end
Reduce the Sentry sampling to 5% See https://ministryofjustice.github.io/operations-engineering/documentation/services/sentry.html#sentry-io
diff --git a/db/seeds.rb b/db/seeds.rb index abc1234..def5678 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -3,6 +3,10 @@ User.delete_all Potluck.delete_all Attendance.delete_all + +ActiveRecord::Base.connection.tables.each do |t| + ActiveRecord::Base.connection.reset_pk_sequence!(t) +end 20.times do User.create(email: Faker::Internet.free_email, username: Faker::Name.first_name, password: "password")
Add active record code to reset primary id count in database
diff --git a/devise-2fa.gemspec b/devise-2fa.gemspec index abc1234..def5678 100644 --- a/devise-2fa.gemspec +++ b/devise-2fa.gemspec @@ -9,18 +9,19 @@ gem.authors = ['William A. Todd'] gem.email = ['info@investinwaffles.com'] gem.description = 'Time Based OTP/rfc6238 authentication for Devise' - gem.summary = 'Time Based OTP/rfc6238 authentication for Devise' + gem.summary = 'Includes ActiveRecord and Mongoid ORM support' gem.homepage = 'http://www.github.com/williamatodd/devise-2fa' + gem.license = 'MIT' gem.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR) gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) } gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) gem.require_paths = ['lib'] - gem.add_runtime_dependency 'devise', '>= 3.2.0' - gem.add_runtime_dependency 'rotp', '>= 3.0' + gem.add_runtime_dependency 'devise', '~> 3.2', '>= 3.2.0' + gem.add_runtime_dependency 'rotp', '~> 3.0' gem.add_runtime_dependency 'rqrcode', '~> 0.10.1' - gem.add_runtime_dependency 'symmetric-encryption', '>= 3.8' + gem.add_runtime_dependency 'symmetric-encryption', '~> 3.8' - gem.add_development_dependency 'sqlite3' + gem.add_development_dependency 'sqlite3', '~> 0' end
Update gemspec to match release
diff --git a/app.rb b/app.rb index abc1234..def5678 100644 --- a/app.rb +++ b/app.rb @@ -0,0 +1,72 @@+class Settings < Settingslogic + source "#{Rails.root}/config/application.yml" + namespace Rails.env + load! +end + +require 'sinatra' +require 'sequel' + +post '/auth' do + +end + +get '/tournaments' do + +end + +post '/tournaments' do + +end + +get '/tournaments/:id' do + +end + +put '/tournaments/:id' do + +end + +delete '/tournaments/:id' do + +end + +get '/events' do + +end + +post '/events' do + +end + +get '/events/:id' do + +end + +put '/events/:id' do + +end + +delete '/events/:id' do + +end + +get '/challenges' do + +end + +post '/challenges' do + +end + +get '/challenges/:id' do + +end + +put '/challenges/:id' do + +end + +delete '/challenges/:id' do + +end
Add basic code to begin
diff --git a/env.rb b/env.rb index abc1234..def5678 100644 --- a/env.rb +++ b/env.rb @@ -6,6 +6,9 @@ end [:-, :/].each do |op| env[op] = lambda {|a, b| a.send(op, b)} + end + Math.methods(false).each do |sym| + env[sym] = lambda {|*args| Math.send(sym, *args)} end env[:begin] = lambda {|*args| args[-1]} new(env, nil)
Add math module to built ins
diff --git a/cancan.gemspec b/cancan.gemspec index abc1234..def5678 100644 --- a/cancan.gemspec +++ b/cancan.gemspec @@ -18,8 +18,6 @@ s.add_development_dependency 'mongoid', '~> 2.0.0.beta.19' s.add_development_dependency 'bson_ext', '~> 1.1' - # s.add_development_dependency 'ruby-debug' - s.rubyforge_project = s.name s.required_rubygems_version = ">= 1.3.4" end
Remove commented-out line from gemspec
diff --git a/db/migrate/20141217165501_move_minutes_to_complete_to_need_to_know_field.rb b/db/migrate/20141217165501_move_minutes_to_complete_to_need_to_know_field.rb index abc1234..def5678 100644 --- a/db/migrate/20141217165501_move_minutes_to_complete_to_need_to_know_field.rb +++ b/db/migrate/20141217165501_move_minutes_to_complete_to_need_to_know_field.rb @@ -1,7 +1,13 @@ class MoveMinutesToCompleteToNeedToKnowField < Mongoid::Migration def self.up - Edition.where(:minutes_to_complete.ne => "", :minutes_to_complete.exists => true).each do |edition| - edition.set(:need_to_know, "- Takes around #{edition.minutes_to_complete} minutes\r\n#{edition.need_to_know}") + Edition.where(:minutes_to_complete.nin => ["", nil]).each do |edition| + language = edition.artefact.language + + if language == 'cy' + edition.set(:need_to_know, "- Mae'n cymryd tua #{edition.minutes_to_complete} munud\r\n#{edition.need_to_know}") + else + edition.set(:need_to_know, "- Takes around #{edition.minutes_to_complete} minutes\r\n#{edition.need_to_know}") + end end Edition.all.each { |edition| edition.unset(:minutes_to_complete) }
Use welsh minutes message where appropriate Tweak migration to use welsh when the edition is welsh
diff --git a/colocated-charters-script.rb b/colocated-charters-script.rb index abc1234..def5678 100644 --- a/colocated-charters-script.rb +++ b/colocated-charters-script.rb @@ -10,11 +10,12 @@ colocated_addresses_w_charter end -def create_colocated_charters_csv(schools_hsh) - schools_hsh.each_pair do |k,v| - charter_school = v.find { |x| x[3] == "Charter"} - if charter_school != nil - v.each {|x| charters_colocation << x} - end - end +def create_colocated_charters_csv(schools_hsh, csv) + schools_hsh.each {|x| x.values.each { |y| y.each {|z| csv << z} }} + # schools_hsh.each_pair do |k,v| + # charter_school = v.find { |x| x[3] == "Charter"} + # if charter_school != nil + # v.each {|x| charters_colocation << x} + # end + # end end
Fix method which places colocated schools w charters in csv
diff --git a/formdata.gemspec b/formdata.gemspec index abc1234..def5678 100644 --- a/formdata.gemspec +++ b/formdata.gemspec @@ -18,6 +18,8 @@ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ['lib'] + spec.required_ruby_version = '>= 1.9.1' + spec.add_development_dependency 'bundler', '~> 1.11' spec.add_development_dependency 'rake', '~> 10.0' spec.add_development_dependency 'rspec', '~> 3.0'
Add ruby version requirement to gemspec
diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index abc1234..def5678 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -11,7 +11,8 @@ context 'when passed a valid object' do it 'returns the url if no relative root is set' do good_obj = double(url: '/url') - Rails.application.config.action_controller.relative_url_root = nil + allow(Rails.application.config.action_controller).to \ + receive(:relative_url_root).and_return(nil) expect(paperclip_full_url(good_obj)).to eq(good_obj.url) end @@ -19,7 +20,8 @@ it 'returns the url prepended by the relative root if set' do good_obj = double(url: '/url') rel_root = 'test' - Rails.application.config.action_controller.relative_url_root = rel_root + allow(Rails.application.config.action_controller).to \ + receive(:relative_url_root).and_return(rel_root) expect(paperclip_full_url(good_obj)).to \ eq("#{rel_root}#{good_obj.url}")
Fix intermittent asset failure in specs Resolves #1528 - Mock relative root in application helper specs
diff --git a/ReactiveQueryKit.podspec b/ReactiveQueryKit.podspec index abc1234..def5678 100644 --- a/ReactiveQueryKit.podspec +++ b/ReactiveQueryKit.podspec @@ -9,6 +9,8 @@ spec.source = { :git => 'https://github.com/QueryKit/ReactiveQueryKit.git', :tag => "#{spec.version}" } spec.source_files = 'ReactiveQueryKit/*.{h}', 'ReactiveQueryKit/ObjectiveC/*.{h,m}' spec.requires_arc = true + spec.osx.deployment_target = '10.7' + spec.ios.deployment_target = '5.0' spec.dependency 'ReactiveCocoa', '~> 2.0' spec.dependency 'QueryKit' end
[Podspec] Set minimum platform to match ReactiveCocoa
diff --git a/generate_post.rb b/generate_post.rb index abc1234..def5678 100644 --- a/generate_post.rb +++ b/generate_post.rb @@ -33,9 +33,16 @@ system('git push origin gh-pages') end +def send_mail_warning + # TODO: Implement warning + puts "No more jokes! Need more jokes!" +end + def generate jokes = read_jokes + return send_mail_warning if jokes.count <= 0 + joke = jokes.sample post = template(joke)
Add warning when out of jokes
diff --git a/spec/services/itsi_authoring/editor_spec.rb b/spec/services/itsi_authoring/editor_spec.rb index abc1234..def5678 100644 --- a/spec/services/itsi_authoring/editor_spec.rb +++ b/spec/services/itsi_authoring/editor_spec.rb @@ -0,0 +1,26 @@+require "spec_helper" + +describe ITSIAuthoring::Editor do + let(:author) { FactoryGirl.create(:author) } + let(:activity) { + activity = FactoryGirl.create(:activity) + activity.user = author + activity.save + activity.theme = FactoryGirl.create(:theme) + activity + } + + let(:page) { FactoryGirl.create(:interactive_page, name: "page 1", position: 0) } + let(:interactive) { FactoryGirl.create(:managed_interactive) } + + before(:each) do + page.add_interactive interactive + page.reload + end + + it "generates JSON for ITSI authoring" do + editor = ITSIAuthoring::Editor.new(activity) + itsi_content = editor.to_json + expect(itsi_content).to have_key(:sections) + end +end
Add test coverage for ITSIAuthoring::Editor.
diff --git a/spec/services/rules/first_time_rule_spec.rb b/spec/services/rules/first_time_rule_spec.rb index abc1234..def5678 100644 --- a/spec/services/rules/first_time_rule_spec.rb +++ b/spec/services/rules/first_time_rule_spec.rb @@ -5,7 +5,7 @@ subject { described_class.new.broken?(submission) } context 'when the applicant has attended the event before' do - let(:submission) { FactoryGirl.create(:submission, first_time: false) } + let!(:submission) { FactoryGirl.create(:submission, first_time: false) } it { expect(subject).to equal(true) } end
Refactor SubmissionRejector's rules and their specs
diff --git a/lib/tasks/papertrail_changeset.rake b/lib/tasks/papertrail_changeset.rake index abc1234..def5678 100644 --- a/lib/tasks/papertrail_changeset.rake +++ b/lib/tasks/papertrail_changeset.rake @@ -0,0 +1,23 @@+ +desc "Update Pre-changeset version objects with changeset data" +namespace :paper_trail do + task :rebuild_changesets => :environment do + [Note, Topic, Question, Answer].each do |klass| + puts "\n#{klass}: " + klass.find_each do |obj| + print "id(#{obj.id})-##{obj.versions.size}, " + obj.versions.each do |ver| + begin + obj2 = ver.reify + if obj2 + ver.object_changes = obj2.send(:changes_for_paper_trail) + ver.save! + end + rescue + puts "\nException #{$!}" + end + end + end + end + end +end
Add rake task to update changesets
diff --git a/db/migrate/20140910153559_create_active_questions.rb b/db/migrate/20140910153559_create_active_questions.rb index abc1234..def5678 100644 --- a/db/migrate/20140910153559_create_active_questions.rb +++ b/db/migrate/20140910153559_create_active_questions.rb @@ -0,0 +1,10 @@+class CreateActiveQuestions < ActiveRecord::Migration + def change + create_table :active_questions do |t| + t.references :user, null: true + t.references :question, null: true + + t.timestamps + end + end +end
Add Migration Table to ID Coaches Working on Questions
diff --git a/spec/examples/logger_spec.rb b/spec/examples/logger_spec.rb index abc1234..def5678 100644 --- a/spec/examples/logger_spec.rb +++ b/spec/examples/logger_spec.rb @@ -0,0 +1,114 @@+require 'spec_helper' + +class Logger + alias :m :method + + def initialize(repository) + @repository = repository + end + + def log(item) + validate(item) >> m(:transform) >= m(:save) + end + + private + attr_reader :repository + + def validate(item) + return Failure(["Item cannot be empty"]) if item.blank? + return Failure(["Item must be a Hash"]) unless item.is_a?(Hash) + + validate_required_params(item).match { + none { Success(item) } + some { |errors| Failure(errors) } + } + end + + def transform(params) + ttl = params.delete(:ttl) + params.merge!(_ttl: ttl) unless ttl.nil? + Success(params) + end + + def save(item) + Success(repository.bulk_insert([item])) + end + + def validate_required_params(params) + required_params = %w(date tenant contract user facility short data) + Option.any?(required_params + .select{|key| Option.some?(params[key.to_sym]).none? } + .map{|key| "#{key} is required"} + ) + end + end + +class Ensure + include Deterministic + include Deterministic::Monad + None = Deterministic::Option::None.instance + + attr_accessor :value + + def method_missing(m, *args) + validator_m = "#{m}!".to_sym + super unless respond_to? validator_m + send(validator_m, *args).map { |v| Some([Error.new(m, v)])} + end + + class Error + attr_accessor :name, :value + def initialize(name, value) + @name, @value = name, value + end + + def inspect + "#{@name}(#{@value.inspect})" + end + end + + def not_empty! + value.nil? || value.empty? ? Some(value) : None + end + + def is_a!(type) + value.is_a?(type) ? None : Some({obj: value, actual: value.class, expected: type}) + end + + def has_key!(key) + value.has_key?(key) ? None : Some(key) + end +end + +class Validator < Ensure + + def date_is_one! + value[:date] == 1 ? None : Some({actual: value[:date], expected: 1}) + end + + def required_params! + params = %w(date tenant contract user facility short data) + params.inject(None) { |errors, param| + errors + (value[:param].nil? || value[:param].empty? ? Some([param]) : None) + } + end + + def call + not_empty + is_a(Array) + None + has_key(:tenant) + Some("error").value_to_a + date_is_one + required_params + end + +end + +describe Ensure do + # None = Deterministic::Option::None.instance + + it "Ensure" do + params = {date: 2} + + v = Validator.new(params) + + errors = v.call + expect(errors).to be_a Deterministic::Some + expect(errors.value).not_to be_empty + end +end
Add logger example with validation
diff --git a/app/controllers/boards_controller.rb b/app/controllers/boards_controller.rb index abc1234..def5678 100644 --- a/app/controllers/boards_controller.rb +++ b/app/controllers/boards_controller.rb @@ -33,9 +33,9 @@ redirect_to boards_path and return end - @posts = @board.posts.order('id desc').select do |post| + @posts = @board.posts.order('updated_at desc').select do |post| post.visible_to?(current_user) - end + end.first(25) end private
Sort single board posts properly
diff --git a/app/controllers/events_controller.rb b/app/controllers/events_controller.rb index abc1234..def5678 100644 --- a/app/controllers/events_controller.rb +++ b/app/controllers/events_controller.rb @@ -2,7 +2,7 @@ before_action :set_event, except: [:index, :new, :create] def index - @events = Event.all + @events = Event.order(date: :desc) @current = Event.current end
Order events newest to oldest
diff --git a/spec/models/category_spec.rb b/spec/models/category_spec.rb index abc1234..def5678 100644 --- a/spec/models/category_spec.rb +++ b/spec/models/category_spec.rb @@ -1,13 +1,39 @@ require 'spec_helper' describe Category do - describe "Associations" do - before do - FactoryGirl.create :category + describe 'associations' do + it { should have_many :projects } + end + + describe 'validations' do + it { should validate_presence_of :name_pt } + it { should validate_uniqueness_of :name_pt } + end + + describe '.with_projects' do + let(:category) { create(:category) } + + context 'when category has a project' do + let(:project) { create(:project, category: category) } + + it 'returns categories with projects' do + project + expect(described_class.with_projects).to eq [category] + end end - it{ should have_many :projects } - it{ should validate_presence_of :name_pt } - it{ should validate_uniqueness_of :name_pt } + context 'when category has no project' do + it 'returns an empty array' do + expect(described_class.with_projects).to eq [] + end + end + end + + describe '.array' do + it 'returns an array with categories' do + category = create(:category) + expect(described_class.array).to eq [['Select an option', ''], + [category.name_en, category.id]] + end end end
Create specs for category model
diff --git a/app/controllers/spaces_controller.rb b/app/controllers/spaces_controller.rb index abc1234..def5678 100644 --- a/app/controllers/spaces_controller.rb +++ b/app/controllers/spaces_controller.rb @@ -1,5 +1,5 @@ class SpacesController < ApplicationController - # http_basic_authenticate_with name: ENV['SPACES_BASIC_AUTH_NAME'], password: ENV['SPACES_BASIC_AUTH_PASSWORD'] if Rails.env.production? + http_basic_authenticate_with name: ENV['SPACES_BASIC_AUTH_NAME'], password: ENV['SPACES_BASIC_AUTH_PASSWORD'] if Rails.env.production? def index @dojo_count = Dojo.count
Enable BASIC Auth for CoderDojo Spaces :secret:
diff --git a/app/controllers/adhoq/authorization_methods.rb b/app/controllers/adhoq/authorization_methods.rb index abc1234..def5678 100644 --- a/app/controllers/adhoq/authorization_methods.rb +++ b/app/controllers/adhoq/authorization_methods.rb @@ -6,7 +6,6 @@ controller.before_filter Authorizer.new helper_method :adhoq_current_user - hide_action :adhoq_current_user end class Authorizer
Make it work on rails 5
diff --git a/app/controllers/dashboard/poster_controller.rb b/app/controllers/dashboard/poster_controller.rb index abc1234..def5678 100644 --- a/app/controllers/dashboard/poster_controller.rb +++ b/app/controllers/dashboard/poster_controller.rb @@ -7,6 +7,8 @@ format.pdf do render pdf: 'poster', page_size: 'A4', + dpi: 300, + zoom: 0.32, show_as_html: Rails.env.test? || params.key?('debug'), margin: { top: 0 } end
Add zoom and dpi values to correct the pdf display when environment is not development.
diff --git a/app/services/checkout/post_checkout_actions.rb b/app/services/checkout/post_checkout_actions.rb index abc1234..def5678 100644 --- a/app/services/checkout/post_checkout_actions.rb +++ b/app/services/checkout/post_checkout_actions.rb @@ -29,6 +29,8 @@ end def set_customer_terms_and_conditions_accepted_at(params) + return unless params[:order] + @order.customer.update(terms_and_conditions_accepted_at: Time.zone.now) if params[:order][:terms_and_conditions_accepted] end end
Fix edge case and some specs in post checkout actions
diff --git a/callcredit.gemspec b/callcredit.gemspec index abc1234..def5678 100644 --- a/callcredit.gemspec +++ b/callcredit.gemspec @@ -6,7 +6,7 @@ gem.add_runtime_dependency 'nokogiri', '~> 1.4' gem.add_runtime_dependency 'unicode_utils', '~> 1.4.0' - gem.add_development_dependency 'rspec', '~> 3.8.0' + gem.add_development_dependency 'rspec', '~> 3.9.0' gem.add_development_dependency 'webmock', '~> 3.7.0' gem.add_development_dependency 'rubocop'
Update rspec requirement from ~> 3.8.0 to ~> 3.9.0 Updates the requirements on [rspec](https://github.com/rspec/rspec) to permit the latest version. - [Release notes](https://github.com/rspec/rspec/releases) - [Commits](https://github.com/rspec/rspec/compare/v3.8.0...v3.9.0) Signed-off-by: dependabot-preview[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com>
diff --git a/app/serializers/design_project_serializer.rb b/app/serializers/design_project_serializer.rb index abc1234..def5678 100644 --- a/app/serializers/design_project_serializer.rb +++ b/app/serializers/design_project_serializer.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true class DesignProjectSerializer < ActiveModel::Serializer - attributes :name, :created_at, :owner_email, :description + attributes :id, :name, :created_at, :owner_email, :description has_many :analyses
Fix design project serialization: add id
diff --git a/fezzik.gemspec b/fezzik.gemspec index abc1234..def5678 100644 --- a/fezzik.gemspec +++ b/fezzik.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = "fezzik" - s.version = "0.4.0" + s.version = "0.4.1" s.required_rubygems_version = Gem::Requirement.new(">=0") if s.respond_to? :required_rubygems_version= s.specification_version = 2 if s.respond_to? :specification_version=
Bump build version to 0.4.1
diff --git a/lib/cucumber/broadcaster.rb b/lib/cucumber/broadcaster.rb index abc1234..def5678 100644 --- a/lib/cucumber/broadcaster.rb +++ b/lib/cucumber/broadcaster.rb @@ -11,7 +11,8 @@ def method_missing(method_name, *args) @receivers.each do |receiver| - receiver.__send__(method_name, *args) if receiver.respond_to?(method_name) + r = (receiver == STDOUT) ? Kernel: receiver # Needed to make colors work on Windows + r.__send__(method_name, *args) if receiver.respond_to?(method_name) end end
Fix broken colors on Windows
diff --git a/MLHudAlert.podspec b/MLHudAlert.podspec index abc1234..def5678 100644 --- a/MLHudAlert.podspec +++ b/MLHudAlert.podspec @@ -8,7 +8,7 @@ s.source = { :git => "https://github.com/MacLabs/MLHudAlert.git", :tag => "0.0.1" } s.platform = :osx s.source_files = 'MLHudAlert/**/*.{h,m}' - s.resources = 'MLHudAlert/Resources/*.{png}' + s.resources = ['MLHudAlert/Resources/*.{png}','MLHudAlert/*.xib'] # s.exclude_files = 'Classes/Exclude' s.public_header_files = 'MLHudAlert/**/*.h' s.requires_arc = true
Add xib to pod resource.
diff --git a/lib/arrthorizer/rails/controller_action.rb b/lib/arrthorizer/rails/controller_action.rb index abc1234..def5678 100644 --- a/lib/arrthorizer/rails/controller_action.rb +++ b/lib/arrthorizer/rails/controller_action.rb @@ -5,19 +5,41 @@ ActionNotDefined = Class.new(Arrthorizer::ArrthorizerException) attr_accessor :privilege - attr_reader :controller, :action + attr_reader :controller_name, :action_name + + def self.get_current(controller) + get_by_name(name_for(controller)) + end def initialize(attrs) - self.controller = attrs.fetch(:controller) { raise ControllerNotDefined } - self.action = attrs.fetch(:action) { raise ActionNotDefined } + self.controller_name = attrs.fetch(:controller) { raise ControllerNotDefined } + self.action_name = attrs.fetch(:action) { raise ActionNotDefined } + + self.class.register(self) end def name - [controller, action].join('#') + self.class.name_for(self) end private - attr_writer :controller, :action + attr_writer :controller_name, :action_name + + def self.name_for(controller) + "#{controller.controller_name}##{controller.action_name}" + end + + def self.get_by_name(name) + repository.get(name) + end + + def self.register(controller_action) + repository.add(controller_action) + end + + def self.repository + @repository ||= Repository.new + end end end end
Add a Repository to Arrthorizer::Rails::ContextRole and add a .get_current() method