diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/app/models/concerns/pages_core/page_model/dated_page.rb b/app/models/concerns/pages_core/page_model/dated_page.rb index abc1234..def5678 100644 --- a/app/models/concerns/pages_core/page_model/dated_page.rb +++ b/app/models/concerns/pages_core/page_model/dated_page.rb @@ -16,19 +16,12 @@ # Finds the page's next sibling by date. Returns nil if there isn't one. def next_sibling_by_date - siblings = siblings_by_date - return unless siblings.any? - - siblings[(siblings.to_a.index(self) + 1)...siblings.length] - .try(&:first) + siblings_by_date.where("starts_at >= ?", starts_at)&.first end # Finds the page's previous sibling by date. Returns nil if there isn't one. def previous_sibling_by_date - siblings = siblings_by_date - return unless siblings.any? - - siblings[0...siblings.to_a.index(self)].try(&:last) + siblings_by_date.where("starts_at < ?", starts_at)&.last end def upcoming? @@ -53,6 +46,8 @@ def siblings_by_date siblings.reorder("starts_at ASC, pages.id DESC") + .where + .not(id: id) end end end
Fix siblings by date when page isn't saved
diff --git a/app/controllers/api/guides_controller.rb b/app/controllers/api/guides_controller.rb index abc1234..def5678 100644 --- a/app/controllers/api/guides_controller.rb +++ b/app/controllers/api/guides_controller.rb @@ -1,6 +1,7 @@ class Api::GuidesController < Api::BaseController def index @guides = Guide.all - render json: {guides: @guides.as_json(only: [:id, :name, :language_id, :path_id, :github_repository, :position])} + render json: {guides: @guides.as_json(only: [:id, :name, :language_id, :path_id, :github_repository, :position], + include: {exercises: {only: [:id, :name, :position]}})} end end
Add embedded exercises to guides api
diff --git a/spec/system/events/performance/edit_competition_spec.rb b/spec/system/events/performance/edit_competition_spec.rb index abc1234..def5678 100644 --- a/spec/system/events/performance/edit_competition_spec.rb +++ b/spec/system/events/performance/edit_competition_spec.rb @@ -6,6 +6,8 @@ sign_in event.responsible visit "/events/performance/#{event.id}/edit" + + expect(page).to have_css('h2', text: 'OLD NAME') fill_in 'name', with: new_event_name click_button I18n.t('general.save')
Fix flaky edit performance competition spec
diff --git a/cookbooks/bcpc_kafka/recipes/zookeeper_server.rb b/cookbooks/bcpc_kafka/recipes/zookeeper_server.rb index abc1234..def5678 100644 --- a/cookbooks/bcpc_kafka/recipes/zookeeper_server.rb +++ b/cookbooks/bcpc_kafka/recipes/zookeeper_server.rb @@ -8,6 +8,7 @@ # For the time being, this will have to be force_override. node.force_override[:bcpc][:hadoop][:kerberos][:enable] = false +include_recipe 'bcpc-hadoop::zookeeper_config' include_recipe 'bcpc-hadoop::zookeeper_server' include_recipe 'bcpc::diamond'
Move zookeeper config recipe from role to recipe
diff --git a/config/locales/plurals.rb b/config/locales/plurals.rb index abc1234..def5678 100644 --- a/config/locales/plurals.rb +++ b/config/locales/plurals.rb @@ -0,0 +1,34 @@+{ + # Dari - this isn't an iso code. Probably should be 'prs' as per ISO 639-3. + dr: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } }, + # Latin America and Caribbean Spanish + "es-419": { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } }, + # Scottish Gaelic + gd: { i18n: { plural: { keys: %i[one two few other], + rule: + lambda do |n| + if [1, 11].include?(n) + :one + elsif [2, 12].include?(n) + :two + elsif [3, 4, 5, 6, 7, 8, 9, 10, 13, 14, 15, 16, 17, 18, 19].include?(n) + :few + else + :other + end + end } } }, + # Armenian + hy: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } }, + # Kazakh + kk: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } }, + # Punjabi Shahmukhi + "pa-pk": { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } }, + # Sinhalese + si: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } }, + # Uzbek + uz: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } }, + # Chinese Hong Kong + "zh-hk" => { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } }, + # Chinese Taiwan + "zh-tw" => { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } }, +}
Add plural rules missing in i18n
diff --git a/spec/models/image_spec.rb b/spec/models/image_spec.rb index abc1234..def5678 100644 --- a/spec/models/image_spec.rb +++ b/spec/models/image_spec.rb @@ -1,8 +1,13 @@ require 'spec_helper' describe Image do + let(:valid_attributes) do + extend ActionDispatch::TestProcess + { :user_id => 1, :file => fixture_file_upload('chicken_rice.jpg') } + end + it 'will have a key' do - invite = Invite.create() - invite.key should exist + image = Image.create! valid_attributes + image.key should exist end end
Fix typo, add file and user ID
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index abc1234..def5678 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -0,0 +1,44 @@+# == Schema Information +# +# Table name: users +# +# id :integer not null, primary key +# name :string(255) +# email :string(255) +# uid :string(255) +# avatar_url :string(255) +# created_at :datetime +# updated_at :datetime +# nickname :string(255) +# active_room_id :integer +# +# Indexes +# +# index_users_on_active_room_id (active_room_id) +# + +require 'rails_helper' + +describe User do + # Structure + it { is_expected.to respond_to :name } + it { is_expected.to respond_to :email } + it { is_expected.to respond_to :uid } + it { is_expected.to respond_to :avatar_url } + it { is_expected.to respond_to :created_at } + it { is_expected.to respond_to :updated_at } + it { is_expected.to respond_to :nickname } + + # Associations + it { is_expected.to have_many(:memberships).dependent(:destroy) } + it { is_expected.to have_many(:rooms).through(:memberships) } + it { is_expected.to have_many(:acquired_rooms).with_foreign_key(:owner_id).class_name('Room') } + it { is_expected.to belong_to(:active_room).class_name('Room') } + + # Validations + it { is_expected.to validate_presence_of(:uid) } + it { is_expected.to validate_uniqueness_of(:uid) } + + it '#active_balance' + it '.find_or_create_with_omniauth' +end
Add specs for User model
diff --git a/spec/root_spec_helper.rb b/spec/root_spec_helper.rb index abc1234..def5678 100644 --- a/spec/root_spec_helper.rb +++ b/spec/root_spec_helper.rb @@ -1,8 +1,5 @@-require 'codeclimate-test-reporter' -## Start CodeClimate TestReporter -CodeClimate::TestReporter.start +require 'simplecov' -require 'simplecov' ## Start Simplecov SimpleCov.start 'rails' do add_group 'Redmine Jenkins', 'plugins/redmine_jenkins'
Remove CodeClimate (does not work)
diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb index abc1234..def5678 100644 --- a/spec/support/capybara.rb +++ b/spec/support/capybara.rb @@ -2,4 +2,9 @@ require 'capybara/rspec' require 'capybara/poltergeist' + +Capybara.register_driver :poltergeist do |app| + Capybara::Poltergeist::Driver.new(app, { phantomjs_options: ['--ssl-protocol=TLSv1'] }) +end + Capybara.javascript_driver = :poltergeist
Fix broken JS tests by updating PhantomJS SSL options phantomjs defaults to using SSLv3, which has now been disabled everywhere. The protocol used can be changed with an option: > --ssl-protocol=<val> Sets the SSL protocol > (supported protocols: 'SSLv3' (default), 'SSLv2', 'TLSv1', 'any') This PR makes poltergeist and the task set this option when invoking phantomjs.
diff --git a/app/models/assessment.rb b/app/models/assessment.rb index abc1234..def5678 100644 --- a/app/models/assessment.rb +++ b/app/models/assessment.rb @@ -3,7 +3,7 @@ has_many :students, through: :student_assessments validate :has_valid_subject - VALID_MCAS_SUBJECTS = [ 'ELA', 'Mathematics', 'Science', 'Arts', 'Technology' ].freeze + VALID_MCAS_SUBJECTS = [ 'ELA', 'Mathematics' ].freeze VALID_STAR_SUBJECTS = [ 'Mathematics', 'Reading' ].freeze def has_valid_subject
Remove unused MCAS subjects from validation whitelist
diff --git a/app/models/poll/shift.rb b/app/models/poll/shift.rb index abc1234..def5678 100644 --- a/app/models/poll/shift.rb +++ b/app/models/poll/shift.rb @@ -12,6 +12,7 @@ before_create :persist_data after_create :create_officer_assignments + before_destroy :destroy_officer_assignments def persist_data self.officer_name = officer.name @@ -29,5 +30,12 @@ Poll::OfficerAssignment.create!(attrs) end end + + def destroy_officer_assignments + Poll::OfficerAssignment.where(booth_assignment: booth.booth_assignments, + officer: officer, + date: date, + final: recount_scrutiny?).destroy_all + end end end
Destroy all related OfficerAssignments when destroying a Shift
diff --git a/Formula/drush.rb b/Formula/drush.rb index abc1234..def5678 100644 --- a/Formula/drush.rb +++ b/Formula/drush.rb @@ -1,13 +1,11 @@-require "formula" - class Drush < Formula + desc "Drush is a command-line shell and scripting interface for Drupal" homepage "https://github.com/drush-ops/drush" - url "https://github.com/drush-ops/drush/archive/6.5.0.tar.gz" - sha1 "7509f6f3a2cd8733067a3a230d4b0130d902cbe2" + url "https://github.com/drush-ops/drush/archive/7.0.0.tar.gz" + sha256 "05b7c95902614812978559280a6af86fc7ad3946c11217fe4a14f9df7500d1dc" head do url "https://github.com/drush-ops/drush.git" - depends_on "Homebrew/php/composer" => :build end @@ -27,4 +25,8 @@ EOS bash_completion.install libexec/"drush.complete.sh" => "drush" end + + test do + system "drush", "version" + end end
Upgrade Drush to version 7.0.0 (@brummbar) Fixes and additions to pass `brew audit --strict` (@alanthing) Closes #1800. Signed-off-by: Alan Ivey <ee249fd9166eccef852f50ca0cbb6ff8665afe99@gmail.com>
diff --git a/spec/events/turn_ended_spec.rb b/spec/events/turn_ended_spec.rb index abc1234..def5678 100644 --- a/spec/events/turn_ended_spec.rb +++ b/spec/events/turn_ended_spec.rb @@ -1,6 +1,59 @@ require 'rails_helper' RSpec.describe TurnEnded, type: :event do - pending "Test expecting dice roll and not" - pending "Test our turn or not" + let(:game_state) do + instance_double("GameState").tap do |game_state| + + end + end + + subject(:event) { TurnEnded.new } + + let(:amount) { nil } + + describe "checking validity" do + before do + expect(game_state).to receive(:expecting_rolls).and_return(expecting_rolls) + end + + context "when we are required to roll the dice" do + let(:expecting_rolls) { 2 } + + describe "#can_apply?" do + subject { event.can_apply?(game_state) } + + it { is_expected.to be_falsey } + end + + describe "#errors" do + subject { event.errors(game_state) } + + it { is_expected.to be_present } + end + end + + context "when we are not required to roll the dice" do + let(:expecting_rolls) { 0 } + + describe "#can_apply?" do + subject { event.can_apply?(game_state) } + + it { is_expected.to be_truthy } + end + + describe "#errors" do + subject { event.errors(game_state) } + + it { is_expected.not_to be_present } + end + end + end + + describe "applying the event" do + before do + expect(game_state).to receive(:current_player).and_return(0) + expect(game_state).to receive(:players).and_return([player]) + end + + end end
Add spec for validity of turn ended event
diff --git a/spec/features/sign_out_spec.rb b/spec/features/sign_out_spec.rb index abc1234..def5678 100644 --- a/spec/features/sign_out_spec.rb +++ b/spec/features/sign_out_spec.rb @@ -0,0 +1,20 @@+require 'rails_helper' + +feature 'User sign out', %q{ + In order to destroy my session + As an authenticated user + I want to be able sign out +} do + + given(:user) { create(:user) } + + scenario 'User tries to sign out' do + sign_in(user) + click_link('Log out') + + expect(current_path).to eq root_path + expect(page).to have_selector('#toastr-messages', + visible: false, + text: 'Signed out successfully.') + end +end
Add 'User can sign out' feature spec
diff --git a/db/migrate/20170220010113_add_leader_to_memberships.rb b/db/migrate/20170220010113_add_leader_to_memberships.rb index abc1234..def5678 100644 --- a/db/migrate/20170220010113_add_leader_to_memberships.rb +++ b/db/migrate/20170220010113_add_leader_to_memberships.rb @@ -6,7 +6,8 @@ Site.each do Group.find_each do |group| - next unless (leader = group.leader) + next unless (leader_id = group.leader_id) + next unless (leader = Person.find_by(id: leader_id)) membership = group.memberships.where(person_id: leader.id).first_or_initialize membership.leader = true membership.save(validate: false) @@ -25,7 +26,7 @@ Group.find_each do |group| leader = group.memberships.leaders.first.try(:person) next unless leader - group.leader = leader + group.leader_id = leader.id group.save(validate: false) end end
Fix migration since leader relationship was removed
diff --git a/nokogiri/google_finance/spec/stock_trend_spec.rb b/nokogiri/google_finance/spec/stock_trend_spec.rb index abc1234..def5678 100644 --- a/nokogiri/google_finance/spec/stock_trend_spec.rb +++ b/nokogiri/google_finance/spec/stock_trend_spec.rb @@ -44,4 +44,9 @@ expect(arr.empty?).to be false end end + + pending '#format_text' do + it '' do + end + end end
Format data by deleteing and manipulating array using format_text method
diff --git a/lib/git_crecord/hunks/hunk_line.rb b/lib/git_crecord/hunks/hunk_line.rb index abc1234..def5678 100644 --- a/lib/git_crecord/hunks/hunk_line.rb +++ b/lib/git_crecord/hunks/hunk_line.rb @@ -30,6 +30,12 @@ def expanded false end + + def generate_diff + return " #{@line[1..-1]}" if !selected && del? + return @line if selected + nil + end end end end
Implement generate_diff method for HunkLine
diff --git a/lib/invision_bridge/spec_helper.rb b/lib/invision_bridge/spec_helper.rb index abc1234..def5678 100644 --- a/lib/invision_bridge/spec_helper.rb +++ b/lib/invision_bridge/spec_helper.rb @@ -0,0 +1,16 @@+require 'machinist/active_record' +require 'sham' +require 'faker' + +module InvisionBridge + InvisionUser.blueprint do + name + member_group_id { 1 } + email { Faker::Internet.email } + member { nil } + persistence_token { 'b18f1a5dc276001e6fe20139d5522755e414cdee' } + end + InvisionUser.blueprint(:admin) do + member_group_id { 4 } + end +end
Move InvisionUser blueprints into InvisionBridge.
diff --git a/lib/metric_fu/metrics/reek/init.rb b/lib/metric_fu/metrics/reek/init.rb index abc1234..def5678 100644 --- a/lib/metric_fu/metrics/reek/init.rb +++ b/lib/metric_fu/metrics/reek/init.rb @@ -7,7 +7,7 @@ def default_run_options { :dirs_to_reek => MetricFu::Io::FileSystem.directory('code_dirs'), - :config_file_pattern => nil} + :config_file_pattern => 'config/*.reek'} end def has_graph?
[Fix] Set default Reek config to config/*.reek, per Reek docs Setting to nil would make it use .reek in the project root
diff --git a/lib/motel/property/multi_tenant.rb b/lib/motel/property/multi_tenant.rb index abc1234..def5678 100644 --- a/lib/motel/property/multi_tenant.rb +++ b/lib/motel/property/multi_tenant.rb @@ -22,7 +22,7 @@ spec = resolver.spec unless respond_to?(spec.adapter_method) - raise AciveRecord::AdapterNotFound, "database configuration specifies nonexistent #{spec.config[:adapter]} adapter" + raise ActiveRecord::AdapterNotFound, "database configuration specifies nonexistent #{spec.config[:adapter]} adapter" end connection_handler.establish_connection tenant_name, spec
Fix error on establish_connection method in the Base class.
diff --git a/lib/active_scaffold/extensions/unsaved_record.rb b/lib/active_scaffold/extensions/unsaved_record.rb index abc1234..def5678 100644 --- a/lib/active_scaffold/extensions/unsaved_record.rb +++ b/lib/active_scaffold/extensions/unsaved_record.rb @@ -18,8 +18,14 @@ def keeping_errors old_errors = errors.dup if errors.present? result = yield - old_errors&.each do |attr| - old_errors[attr].each { |msg| errors.add(attr, msg) unless errors.added?(attr, msg) } + old_errors&.each do |e| + if e.is_a?(String) || e.is_a?(Symbol) + # Rails <6.1 errors API. + old_errors[e].each { |msg| errors.add(e, msg) unless errors.added?(e, msg) } + else + # Rails >=6.1 errors API (https://code.lulalala.com/2020/0531-1013.html). + errors.add(e.attribute, e.message) unless errors.added?(e.attribute, e.message) + end end result && old_errors.blank? end
Adjust keeping_errors to work with rails >6.1 new error objects.
diff --git a/app/controllers/gobierto_people/people_controller.rb b/app/controllers/gobierto_people/people_controller.rb index abc1234..def5678 100644 --- a/app/controllers/gobierto_people/people_controller.rb +++ b/app/controllers/gobierto_people/people_controller.rb @@ -11,7 +11,7 @@ @person = PersonDecorator.new(find_person) @upcoming_events = @person.events.upcoming.sorted.first(3) - @latest_activity = ActivityCollectionDecorator.new(Activity.for_recipient(@person).limit(30)) + @latest_activity = ActivityCollectionDecorator.new(Activity.for_recipient(@person).limit(30).sorted) end private
Sort person activities in descending order
diff --git a/lib/gds_api/test_helpers/content_item_helpers.rb b/lib/gds_api/test_helpers/content_item_helpers.rb index abc1234..def5678 100644 --- a/lib/gds_api/test_helpers/content_item_helpers.rb +++ b/lib/gds_api/test_helpers/content_item_helpers.rb @@ -8,7 +8,6 @@ "description" => "Description for #{base_path}", "schema_name" => "guide", "document_type" => "guide", - "need_ids" => ["100001"], "public_updated_at" => "2014-05-06T12:01:00+00:00", # base_path is added in as necessary (ie for content-store GET responses) # "base_path" => base_path,
Remove code related to need_ids This field has now been replaced with the `meets_user_needs` link type.
diff --git a/Casks/visit.rb b/Casks/visit.rb index abc1234..def5678 100644 --- a/Casks/visit.rb +++ b/Casks/visit.rb @@ -1,6 +1,6 @@ cask 'visit' do - version '2.10.0' - sha256 'afc83987a37ab1e330b81f21e123de1f98809057717f25c305331440a940e985' + version '2.10.1' + sha256 '29304fabd934da5f6445962c3ee32de725d2c0e6ef693525c4d97cdfa2d9c4a7' # nersc.gov is the official download host per the vendor homepage url "https://portal.nersc.gov/project/visit/releases/#{version}/VisIt-#{version}.dmg"
Upgrade VisIt to version 2.10.1
diff --git a/Casks/xmind.rb b/Casks/xmind.rb index abc1234..def5678 100644 --- a/Casks/xmind.rb +++ b/Casks/xmind.rb @@ -3,8 +3,15 @@ sha256 '9b57dcfd1a2c0a80ff9faf296560594cd25e65e50916c0dbb96b165ecc690801' url "http://dl3.xmind.net/xmind-macosx-#{version}.201411201906.dmg" + name 'XMind' homepage 'http://www.xmind.net' - license :unknown # todo: change license and remove this comment; ':unknown' is a machine-generated placeholder + license :freemium + tags :vendor => 'XMind' + + zap :delete => [ + '~/Library/XMind', + '~/Library/Saved Application State/org.xmind.cathy.application.savedState' + ] app 'XMind.app' end
Add name, license, vendor and zap for XMind.app
diff --git a/app/representers/api/parliament_issue_representer.rb b/app/representers/api/parliament_issue_representer.rb index abc1234..def5678 100644 --- a/app/representers/api/parliament_issue_representer.rb +++ b/app/representers/api/parliament_issue_representer.rb @@ -9,5 +9,14 @@ api_parliament_issue_url represented end + links :votes do + represented.votes.map do |p| + { + title: p.subject, + href: api_vote_url(p) + } + end + end + end end
Add vote links to /api/parliament-issues/:id
diff --git a/spec/default/java_spec.rb b/spec/default/java_spec.rb index abc1234..def5678 100644 --- a/spec/default/java_spec.rb +++ b/spec/default/java_spec.rb @@ -6,6 +6,6 @@ end describe command('java -version') do - its(:stderr) { should include('1.8.0_25') } + its(:stderr) { should include('1.8.0_45') } end end
Update Java version in spec
diff --git a/xpath.gemspec b/xpath.gemspec index abc1234..def5678 100644 --- a/xpath.gemspec +++ b/xpath.gemspec @@ -12,6 +12,7 @@ s.authors = ["Jonas Nicklas"] s.email = ["jonas.nicklas@gmail.com"] s.description = "XPath is a Ruby DSL for generating XPath expressions" + s.license = "MIT" s.files = Dir.glob("{lib,spec}/**/*") + %w(README.md) s.extra_rdoc_files = ["README.md"]
Document project license in gemspec
diff --git a/Formula/alb2psql.rb b/Formula/alb2psql.rb index abc1234..def5678 100644 --- a/Formula/alb2psql.rb +++ b/Formula/alb2psql.rb @@ -1,8 +1,8 @@ class Alb2psql < Formula desc "Tool to fetch ALB request logs, and load into a local PostgreSQL instance" homepage "https://github.com/nrmitchi/alb2psql" - url "https://github.com/nrmitchi/alb2psql/archive/v0.0.1.tar.gz" - sha256 "2c7da89577182db466e60f8c3d6b2f35e48d2e876435f395c10e2e49facbef7f" + url "https://github.com/nrmitchi/alb2psql/archive/v0.0.2.tar.gz" + sha256 "728eea38bbed522a12013e9c9228223fcc296867e7107ace745f5bb4362cb111" head "https://github.com/nrmitchi/alb2psql.git", :branch => "master" bottle :unneeded
Update Formula for new version
diff --git a/spec/symbol_count_graph_spec.rb b/spec/symbol_count_graph_spec.rb index abc1234..def5678 100644 --- a/spec/symbol_count_graph_spec.rb +++ b/spec/symbol_count_graph_spec.rb @@ -8,10 +8,10 @@ graph = SymbolCountGraph.new x: 1 expect(graph.render).to eq 'x' end - it 'outputs xx when x: 2' do - graph = SymbolCountGraph.new x: 2 - expect(graph.render).to eq 'xx' - end + # it 'outputs xx when x: 2' do + # graph = SymbolCountGraph.new x: 2 + # expect(graph.render).to eq 'xx' + # end end end
Comment failing test to see how travis works
diff --git a/babel-transpiler.gemspec b/babel-transpiler.gemspec index abc1234..def5678 100644 --- a/babel-transpiler.gemspec +++ b/babel-transpiler.gemspec @@ -18,7 +18,7 @@ 'LICENSE' ] - s.add_dependency 'babel-source', '>= 4.0', '< 5' + s.add_dependency 'babel-source', '>= 4.0', '< 6' s.add_dependency 'execjs', '~> 2.0' s.add_development_dependency 'minitest', '~> 5.5'
Update dependent babel-source version to allow 5.x
diff --git a/lib/bundle_outdated_formatter/formatter/terminal_formatter.rb b/lib/bundle_outdated_formatter/formatter/terminal_formatter.rb index abc1234..def5678 100644 --- a/lib/bundle_outdated_formatter/formatter/terminal_formatter.rb +++ b/lib/bundle_outdated_formatter/formatter/terminal_formatter.rb @@ -5,12 +5,19 @@ # Formatter for Terminal class TerminalFormatter < Formatter def convert - table = TTY::Table.new(header: @columns) do |t| + table.render(@style.to_sym, padding: [0, 1]).chomp + end + + private + + def table + return TTY::Table.new([@columns]) if @outdated_gems.empty? + + TTY::Table.new(header: @columns) do |t| @outdated_gems.each do |gem| t << gem.values end end - table.render(@style.to_sym, padding: [0, 1]).chomp end end end
Fix error of terminal format with empty outdated gems `convert': undefined method `chomp' for nil:NilClass (NoMethodError)
diff --git a/db/migrate/20170404144212_create_material_tags.rb b/db/migrate/20170404144212_create_material_tags.rb index abc1234..def5678 100644 --- a/db/migrate/20170404144212_create_material_tags.rb +++ b/db/migrate/20170404144212_create_material_tags.rb @@ -4,7 +4,6 @@ t.string :name, null: false t.string :display_name, null: false t.json :body, null: false - t.timestamps end end end
Remove timestamps from material_tags migration
diff --git a/crownroyal.rb b/crownroyal.rb index abc1234..def5678 100644 --- a/crownroyal.rb +++ b/crownroyal.rb @@ -28,8 +28,8 @@ total = result.total tally = result.sections[0].tally - webhook_url = "https://hooks.slack.com/services/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" - + webhook_url = ENV["SLACK_WEBHOOK_URL"] + uri = URI(webhook_url) https = Net::HTTP.new(uri.host, uri.port) https.use_ssl = true
Use env variable for webhook.
diff --git a/spec/presenters/step_by_step_page_presenter_spec.rb b/spec/presenters/step_by_step_page_presenter_spec.rb index abc1234..def5678 100644 --- a/spec/presenters/step_by_step_page_presenter_spec.rb +++ b/spec/presenters/step_by_step_page_presenter_spec.rb @@ -9,12 +9,13 @@ end describe "#summary_list" do + let(:time_now) { Time.zone.now } let(:step_nav) { create(:step_by_step_page_with_steps) } let(:default_summary) { { "Status" => "Draft", - "Last saved" => format_full_date_and_time(Time.zone.now), - "Created" => format_full_date_and_time(Time.zone.now) + "Last saved" => format_full_date_and_time(time_now), + "Created" => format_full_date_and_time(time_now) } } @@ -27,13 +28,13 @@ it "shows who made the most recent change" do step_nav.assigned_to = "Firstname Lastname" - expect(subject["Last saved"]).to eq("#{format_full_date_and_time(Time.zone.now)} by #{step_nav.assigned_to}") + expect(subject["Last saved"]).to eq("#{format_full_date_and_time(time_now)} by #{step_nav.assigned_to}") end it "has additional metadata showing when links were checked" do create(:link_report, step: step_nav.steps.first) summary_with_links_checked = default_summary.merge( - "Links checked" => format_full_date_and_time(Time.zone.now) + "Links checked" => format_full_date_and_time(time_now) ) expect(subject).to eq(summary_with_links_checked)
Fix a timestamp error in the tests This fixes an intermittent error in the tests where Time.zone.now can return a different time if the test is run near the end of a minute: ``` 1) StepByStepPagePresenter#summary_list shows who made the most recent change Failure/Error: expect(subject["Last saved"]).to eq("#{format_full_date_and_time(Time.zone.now)} by #{step_nav.assigned_to}") expected: "11:30am on 3 September 2019 by Firstname Lastname" got: "11:29am on 3 September 2019 by Firstname Lastname" (compared using ==) # ./spec/presenters/step_by_step_page_presenter_spec.rb:30:in `block (3 levels) in <top (required)>' ```
diff --git a/dynflow.gemspec b/dynflow.gemspec index abc1234..def5678 100644 --- a/dynflow.gemspec +++ b/dynflow.gemspec @@ -7,10 +7,11 @@ s.version = Dynflow::VERSION s.authors = ["Ivan Necas"] s.email = ["inecas@redhat.com"] - s.homepage = "http://github.com/iNecas/dynflow" + s.homepage = "http://github.com/Dynflow/dynflow" s.summary = "DYNamic workFLOW engine" s.description = "Generate and executed workflows dynamically based "+ "on input data and leave it open for others to jump into it as well" + s.license = "MIT" s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
Fix homepage URL, add licence to gemspec
diff --git a/lib/has_navigation/has_navigation/has_navigation.rb b/lib/has_navigation/has_navigation/has_navigation.rb index abc1234..def5678 100644 --- a/lib/has_navigation/has_navigation/has_navigation.rb +++ b/lib/has_navigation/has_navigation/has_navigation.rb @@ -19,7 +19,7 @@ resource_nav_item = self.resource_nav_item.blank? ? ResourceNavItem.new : self.resource_nav_item resource_nav_item.attributes = options.merge(title: (self.try(:title) || "#{self.class} - #{self.id}"), url: polymorphic_path(self), - admin_url: "/admin#{edit_polymorphic_path(self)}", + admin_url: edit_polymorphic_path([:admin, self]), setting_prefix: respond_to?(:settings_prefix) ? settings_prefix : nil) resource_nav_item end
Fix for shonky front-end link resolution in /admin.
diff --git a/app/controllers/chat/rooms/messages_controller.rb b/app/controllers/chat/rooms/messages_controller.rb index abc1234..def5678 100644 --- a/app/controllers/chat/rooms/messages_controller.rb +++ b/app/controllers/chat/rooms/messages_controller.rb @@ -9,7 +9,7 @@ end def index - @messages = @room.messages.order_by([:timestamp,:asc]).limit(50) + @messages = @room.messages.order_by([:timestamp,:desc]).limit(50).reverse respond_to do |format| format.json { render json: @messages.to_json(:methods => :formatted_timestamp) } end
Revert "Use mongo to sort messages instead of ruby" This reverts commit b47c0e4469c124258b8a3f3fb5bd9850f6e23950.
diff --git a/macosx/scripts/iTunes/it-rename.rb b/macosx/scripts/iTunes/it-rename.rb index abc1234..def5678 100644 --- a/macosx/scripts/iTunes/it-rename.rb +++ b/macosx/scripts/iTunes/it-rename.rb @@ -0,0 +1,62 @@+#!/usr/bin/env ruby + +################################################################################ +require('rubygems') +require('appscript') +require('ostruct') +require('optparse') + +################################################################################ +class Rename + + ############################################################################## + RULES = [ + [/\s*\[Explicit\]\s*/i, ''], + ] + + ############################################################################## + attr_reader(:options) + + ############################################################################## + def initialize + @options = OpenStruct.new + @itunes = Appscript.app('iTunes.app') + @tracks = @itunes.selection.get + + OptionParser.new do |p| + p.on('-h', '--help', 'This message') {$stdout.puts(p); exit} + end.permute!(ARGV) + + raise("nothing selected in itunes") if @tracks.size.zero? + end + + ############################################################################## + def run + @tracks.each {|t| update_track(t)} + end + + ############################################################################## + private + + ############################################################################## + def update_track (track) + name = track.name.get + album = track.album.get + + RULES.each do |rule| + name.gsub!(*rule) + album.gsub!(*rule) + end + + track.name.set(name) + track.album.set(album) + end +end + +################################################################################ +begin + Rename.new.run +rescue RuntimeError => e + $stderr.puts(File.basename($0) + ": ERROR: #{e}") + exit(1) +end
Add script to help clean up stupid track names in iTunes
diff --git a/features/page_objects/fee_scheme_selector_page.rb b/features/page_objects/fee_scheme_selector_page.rb index abc1234..def5678 100644 --- a/features/page_objects/fee_scheme_selector_page.rb +++ b/features/page_objects/fee_scheme_selector_page.rb @@ -1,5 +1,5 @@ class FeeSchemeSelectorPage < BasePage - set_url "/external_users/claims/types" + set_url '/external_users/claim_types/new' element :advocate_final_fee, "label[for='claim-type-id-agfs-field']" element :advocate_hardship_fee, "label[for='claim-type-id-agfs-hardship-field']"
Correct url path for page object The path must be correct for the page_object to accurately respond to `displayed?` in tests. e.g. ``` expect(@page_object).to be_displayed ```
diff --git a/BBBAPI.podspec b/BBBAPI.podspec index abc1234..def5678 100644 --- a/BBBAPI.podspec +++ b/BBBAPI.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "BBBAPI" - s.version = "0.0.5" + s.version = "0.0.6" s.summary = "iOS / OSX Objective-C library for communicating with the Blinkbox Books API" s.description = <<-DESC @@ -28,5 +28,6 @@ s.requires_arc = true s.dependency "CocoaLumberjack" , '~> 1.9.2' + s.dependency "FastEasyMapping", '~>0.5.1' end
Add FastEasyMapping as sub-pod, new tag 0.0.6
diff --git a/lib/did_you_mean/spell_checkers/method_name_checker.rb b/lib/did_you_mean/spell_checkers/method_name_checker.rb index abc1234..def5678 100644 --- a/lib/did_you_mean/spell_checkers/method_name_checker.rb +++ b/lib/did_you_mean/spell_checkers/method_name_checker.rb @@ -16,7 +16,6 @@ def method_names method_names = receiver.methods + receiver.singleton_methods method_names += receiver.private_methods if @has_args - method_names.delete(method_name) method_names.uniq! method_names end
Remove code that is no longer necessary 1c52c88 takes cares of this so we don't have to do this any more.
diff --git a/dry-configurable.gemspec b/dry-configurable.gemspec index abc1234..def5678 100644 --- a/dry-configurable.gemspec +++ b/dry-configurable.gemspec @@ -1,4 +1,3 @@-# coding: utf-8 require File.expand_path('../lib/dry/configurable/version', __FILE__) Gem::Specification.new do |spec| @@ -15,6 +14,7 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ['lib'] + spec.required_ruby_version = ">= 2.3.0" spec.add_runtime_dependency 'concurrent-ruby', '~> 1.0' spec.add_development_dependency 'bundler'
Set minimal ruby version to 2.3
diff --git a/lib/suspenders/generators/error_reporting_generator.rb b/lib/suspenders/generators/error_reporting_generator.rb index abc1234..def5678 100644 --- a/lib/suspenders/generators/error_reporting_generator.rb +++ b/lib/suspenders/generators/error_reporting_generator.rb @@ -2,6 +2,8 @@ module Suspenders class ErrorReportingGenerator < Rails::Generators::Base + include Suspenders::Actions + source_root File.expand_path( File.join("..", "..", "..", "templates"), File.dirname(__FILE__),
Fix bug: forgot to include module with env var json helper
diff --git a/lib/metacrunch/ubpb/transformations/mab2snr/toc_link.rb b/lib/metacrunch/ubpb/transformations/mab2snr/toc_link.rb index abc1234..def5678 100644 --- a/lib/metacrunch/ubpb/transformations/mab2snr/toc_link.rb +++ b/lib/metacrunch/ubpb/transformations/mab2snr/toc_link.rb @@ -14,11 +14,12 @@ links = [] source.datafields("655").each do |datafield| - url = datafield.subfields("u").first_value + url = datafield.subfields("u").first_value # URL + label = datafield.subfields("y").first_value # Link Text # Pick only links that point to known tocs if url && helper.is_toc?(datafield) - links << url + links << { url: url, label: label } end end
Return label for toc links.
diff --git a/core/enumerable/shared/collect_concat.rb b/core/enumerable/shared/collect_concat.rb index abc1234..def5678 100644 --- a/core/enumerable/shared/collect_concat.rb +++ b/core/enumerable/shared/collect_concat.rb @@ -19,6 +19,15 @@ numerous.send(@method){ |i| i }.should == [:foo, obj2] end + it "only returns the first value when multiple values are yielded" do + obj = Object.new + def obj.each + yield(1, 2) + end + obj.extend(Enumerable) + obj.send(@method){ |i| i }.should == [1] + end + it "returns an enumerator when no block given" do enum = EnumerableSpecs::Numerous.new(1, 2).send(@method) enum.should be_an_instance_of(enumerator_class)
Add flat_map spec for enumerables that yield multiple values
diff --git a/activesupport/lib/active_support/core_ext/load_error.rb b/activesupport/lib/active_support/core_ext/load_error.rb index abc1234..def5678 100644 --- a/activesupport/lib/active_support/core_ext/load_error.rb +++ b/activesupport/lib/active_support/core_ext/load_error.rb @@ -24,15 +24,12 @@ ] unless defined?(REGEXPS) end -module ActiveSupport #:nodoc: - module CoreExtensions #:nodoc: - module LoadErrorExtensions #:nodoc: - module LoadErrorClassMethods #:nodoc: - def new(*args) - (self == LoadError && MissingSourceFile.from_message(args.first)) || super - end - end - ::LoadError.extend(LoadErrorClassMethods) +class LoadError + def self.new(*args) + if self == LoadError + MissingSourceFile.from_message(args.first) + else + super end end end
Convert LoadError extension modules to class reopens
diff --git a/features/support/hooks.rb b/features/support/hooks.rb index abc1234..def5678 100644 --- a/features/support/hooks.rb +++ b/features/support/hooks.rb @@ -1,7 +1,9 @@ require 'fileutils' Before do - @aruba_timeout_seconds = 10 + @aruba_timeout_seconds = 5 + @aruba_io_wait_seconds = 0.2 + @real_home = ENV['HOME'] fake_home = File.join('/tmp', 'fakehome') FileUtils.rm_rf fake_home if File.exists? fake_home
Extend timeout for testing command output.
diff --git a/lib/Storm/Storage/cluster.rb b/lib/Storm/Storage/cluster.rb index abc1234..def5678 100644 --- a/lib/Storm/Storage/cluster.rb +++ b/lib/Storm/Storage/cluster.rb @@ -0,0 +1,54 @@+require "Storm/Base/model" +require "Storm/Base/sodserver" + +module Storm + module Storage + class Zone < Storm::Base::Model + attr_accessor :name + + def from_hash(h) + super + @name = h[:name] + end + end + + class Cluster < Storm::Base::Model + attr_accessor :description + attr_accessor :zone + + def from_hash(h) + super + @description = h[:description] + @zone = Zone.new + @zone.from_hash h[:zone] + end + + # Get a paginated list of block storage clusters, including the zone that + # the cluster is in. + # + # @param page_num [Int] page number + # @param page_size [Int] page size + # @return [Hash] a hash with keys: :item_count, :item_total, :page_num, + # :page_size, :page_total and :items (an array of + # Cluster objects) + def self.list(page_num, page_size) + data = Storm::Base::SODServer.remote_call \ + '/Storage/Block/Cluster/list', + :page_num => page_num, + :page_size => page_size + res = {} + res[:item_count] = data[:item_count] + res[:item_total] = data[:item_total] + res[:page_num] = data[:page_num] + res[:page_size] = data[:page_size] + res[:page_total] = data[:page_total] + res[:items] = data[:items].map do |i| + cluster = Cluster.new + cluster.from_hash i + cluster + end + res + end + end + end +end
Add Cluster class and APIs
diff --git a/app/models/manager_refresh/graph/topological_sort.rb b/app/models/manager_refresh/graph/topological_sort.rb index abc1234..def5678 100644 --- a/app/models/manager_refresh/graph/topological_sort.rb +++ b/app/models/manager_refresh/graph/topological_sort.rb @@ -0,0 +1,66 @@+module ManagerRefresh + class Graph + class TopologicalSort + attr_reader :graph + + def initialize(graph) + @graph = graph + end + + def topological_sort + make_topological_sort(graph.nodes, graph.edges) + end + + private + + def make_topological_sort(original_nodes, edges) + ################################################################################################################ + # Topological sort of the graph of the DTO collections to find the right order of saving DTO collections and + # identify what DTO collections can be saved in parallel. + ################################################################################################################ + # The expected input here is the directed acyclic Graph G (dto_collections), consisting of Vertices(Nodes) V and + # Edges E: + # G = (V, E) + # + # The directed edge is defined as (u, v), where u is the dependency of v, i.e. arrow comes from u to v: + # (u, v) ∈ E and u,v ∈ V + # + # S0 is a layer that has no dependencies: + # S0 = { v ∈ V ∣ ∀u ∈ V.(u,v) ∉ E} + # + # Si+1 is a layer whose dependencies are in the sum of the previous layers from i to 0, cannot write + # mathematical sum using U in text editor, so there is an alternative format using _(sum) + # Si+1 = { v ∈ V ∣ ∀u ∈ V.(u,v) ∈ E → u ∈ _(sum(S0..Si))_ } + # + # Then each Si can have their Vertices(DTO collections) processed in parallel. This algorithm cannot + # identify independent sub-graphs inside of the layers Si, so we can make the processing even more effective. + ################################################################################################################ + + nodes = original_nodes.dup + sets = [] + i = 0 + sets[0], nodes = nodes.partition { |v| !edges.detect { |e| e.second == v } } + + max_depth = 1000 + while nodes.present? + i += 1 + max_depth -= 1 + if max_depth <= 0 + raise "Max depth reached while doing topological sort of nodes #{original_nodes} and edges #{edges}, your "\ + "graph probably contains a cycle" + end + + set, nodes = nodes.partition { |v| edges.select { |e| e.second == v }.all? { |e| sets.flatten.include?(e.first) } } + if set.blank? + raise "Blank dependency set while doing topological sort of nodes #{original_nodes} and edges #{edges}, "\ + "your graph probably contains a cycle" + end + + sets[i] = set + end + + sets + end + end + end +end
Add alghoritm for Graph Topological Sort Add alghoritm for Graph Topological Sort
diff --git a/app/models/social_networking/concerns/participant.rb b/app/models/social_networking/concerns/participant.rb index abc1234..def5678 100644 --- a/app/models/social_networking/concerns/participant.rb +++ b/app/models/social_networking/concerns/participant.rb @@ -0,0 +1,33 @@+module SocialNetworking + module Concerns + # adds associations to Participant class + module Participant + extend ActiveSupport::Concern + included do + has_many :social_networking_comments, + class_name: "SocialNetworking::Comment", + dependent: :destroy + has_many :social_networking_goals, + class_name: "SocialNetworking::Goal", + dependent: :destroy + has_many :social_networking_likes, + class_name: "SocialNetworking::Like", + dependent: :destroy + has_many :initiator_nudges, + foreign_key: :initiator_id, + class_name: "SocialNetworking::Nudge", + dependent: :destroy + has_many :recipient_nudges, + foreign_key: :recipient_id, + class_name: "SocialNetworking::Nudge", + dependent: :destroy + has_many :social_networking_on_the_mind_statements, + class_name: "SocialNetworking::OnTheMindStatement", + dependent: :destroy + has_one :social_networking_profile, + class_name: "SocialNetworking::Profile", + dependent: :destroy + end + end + end +end
Create Concern with Participant Associations * Create a concern that has the social specific associations for the Participant class.. [Finishes: #90191388]
diff --git a/lib/hearthstone_api/cards.rb b/lib/hearthstone_api/cards.rb index abc1234..def5678 100644 --- a/lib/hearthstone_api/cards.rb +++ b/lib/hearthstone_api/cards.rb @@ -32,8 +32,8 @@ get "/cards/factions/#{faction.capitalize_all}", options end - def self.search(search_term) - get "/cards/search/#{search_term}" + def self.search(search_term, options = {}) + get "/cards/search/#{search_term}", options end end end
Add options parameter to Card.search
diff --git a/lib/i18n_viz/view_helpers.rb b/lib/i18n_viz/view_helpers.rb index abc1234..def5678 100644 --- a/lib/i18n_viz/view_helpers.rb +++ b/lib/i18n_viz/view_helpers.rb @@ -23,7 +23,14 @@ end def display_i18n_viz? - params && params[:i18n_viz] rescue false # rescue workaround, because params is weirdly defined in e.g. ActionMailer + check_params rescue false # rescue workaround, because params is weirdly defined in e.g. ActionMailer + end + + private + + def check_params + return true if params && params[:i18n_viz] + return true if cookies && cookies[:i18n_viz] end end
Check cookie value as well as query
diff --git a/lib/tasks/icinga_checks.rake b/lib/tasks/icinga_checks.rake index abc1234..def5678 100644 --- a/lib/tasks/icinga_checks.rake +++ b/lib/tasks/icinga_checks.rake @@ -12,4 +12,10 @@ $stderr.puts bad_lines fail 'ERROR: icinga::passive_check resource titles should be unique per machine. Normally you can achieve this by adding ${::hostname} eg "check_widgets_${::hostname}".' end + $stderr.puts '---> Checking icinga::checks do not include hostnames for monitoring class' + bad_lines = %x{grep -rnF --include '*.pp' 'icinga::check \{' . | grep -E '^./modules/(monitoring/manifests/checks)' | grep -F hostname} + if !bad_lines.empty? then + $stderr.puts bad_lines + fail 'ERROR: icinga::check resource titles should not contain the hostname for checks running on the monitoring machine class.' + end end
Add test for incorrectly added hostname in Icinga check title Adds a check for the presence of the hostname in Incinga checks that run on the `monitoring` machine class. These cannot be included as otherwise Puppet will attempt to install multiple versions of the check on each `monitoring` machine, which fails due to the other machine instance(s) not being accessible to the newly provisoned machine.
diff --git a/lib/puppet-lint/plugins/no_symbolic_file_modes.rb b/lib/puppet-lint/plugins/no_symbolic_file_modes.rb index abc1234..def5678 100644 --- a/lib/puppet-lint/plugins/no_symbolic_file_modes.rb +++ b/lib/puppet-lint/plugins/no_symbolic_file_modes.rb @@ -1,7 +1,7 @@+NO_SYMBOLIC_FILE_MODES_IGNORE_TYPES = Set[:VARIABLE, :UNDEF].freeze +WARNING = 'mode should be a 4 digit octal value, not a symbolic mode'.freeze + PuppetLint.new_check(:no_symbolic_file_modes) do - NO_SYMBOLIC_FILE_MODES_IGNORE_TYPES = Set[:VARIABLE, :UNDEF].freeze - WARNING = 'mode should be a 4 digit octal value, not a symbolic mode'.freeze - def check resource_indexes.each do |resource| next unless resource[:type].value == 'file'
Move the constants outside the block to fix rubocop violations
diff --git a/app/importers/data_transformers/star_csv_transformer.rb b/app/importers/data_transformers/star_csv_transformer.rb index abc1234..def5678 100644 --- a/app/importers/data_transformers/star_csv_transformer.rb +++ b/app/importers/data_transformers/star_csv_transformer.rb @@ -1,8 +1,12 @@ module StarCsvTransformer require 'csv' + attr_accessor :pre_cleanup_csv_size + def transform(file) - CSV.parse(file, headers: true, header_converters: lambda { |h| convert_headers(h) }) + csv = CSV.parse(file, headers: true, header_converters: lambda { |h| convert_headers(h) }) + @pre_cleanup_csv_size = csv.size + csv end def convert_headers(header)
Implement for STAR data transformer as well
diff --git a/config/routes.rb b/config/routes.rb index abc1234..def5678 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -20,7 +20,7 @@ resources :sessions, :only => [:new, :create, :destroy] resource :relationships, :only => [:create, :destroy] - resources :supervisions, :only => [:new, :create, :show] do + resources :supervisions, :only => [:new, :create, :show, :index] do resources :topics, :only => [:new, :index, :create] resources :topic_votes resources :topic_questions
Add missing route for supervisions list page
diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index abc1234..def5678 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -9,8 +9,9 @@ end def create - @game = Game.new - @game.players.new([{ :name => 'Player 1' }, { :name => 'Player 2' }]) + @game = Game.new do |game| + game.players.new([{ :name => 'Player 1' }, { :name => 'Player 2' }]) + end @game.save! redirect_to @game end
Clean up creating a game
diff --git a/config/routes.rb b/config/routes.rb index abc1234..def5678 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -9,7 +9,7 @@ resources :sound_treks, only: [:show] -get 'auth/spotify/callback', to: "sessions#create" +get 'soundtreks.herokuapp.com/callback', to: "sessions#create" delete 'sign_out', to: "sessions#destroy", as: 'sign_out' resources :users
Edit callback for Spotify login
diff --git a/config/routes.rb b/config/routes.rb index abc1234..def5678 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,6 +1,6 @@ ActionController::Routing::Routes.draw do |map| + map.preview_pages 'pages/preview.:format', :controller => 'pages', :action => 'preview' map.page_permalink 'pages/:id.:format', :controller => 'pages', :action => 'show' - map.preview_pages 'pages/preview.:format', :controller => 'pages', :action => 'preview' map.namespace(:admin) do |admin| admin.resources :pages, :has_many => :pages, :collection => {:preview => :post}, :member => {:preview => :put, :move_up => :get, :move_down => :get} end
Make preview route more important than permalink
diff --git a/config/routes.rb b/config/routes.rb index abc1234..def5678 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -27,4 +27,6 @@ resources :votes, only: [:create] end + match "/404" => "errors#error404", via: [:get, :post, :patch, :delete] + end
Add a route via which to reach the custom 404 page.
diff --git a/lib/maglev-database-explorer/engine_symlinks.rb b/lib/maglev-database-explorer/engine_symlinks.rb index abc1234..def5678 100644 --- a/lib/maglev-database-explorer/engine_symlinks.rb +++ b/lib/maglev-database-explorer/engine_symlinks.rb @@ -1,3 +1,6 @@+mkdir_public = "mkdir -p \"#{Dir.getwd}/public\"" +system(mkdir_public) + create_public_link = "ln -sfT \"#{MaglevDatabaseExplorer.full_gem_path}/public\" \"#{Dir.getwd}/public/maglev-database-explorer\"" puts "Creating symlink: #{create_public_link}" @@ -7,8 +10,8 @@ exit end -# Workaround for symlinks not working correctly on MagLev -create_views_link ="ln -sfT \"#{MaglevDatabaseExplorer.full_gem_path}/app/views/maglev_database_explorer\" \"#{Dir.getwd}/app/views/maglev_database_explorer\"" +# Workaround for engine paths not working correctly on MagLev +create_views_link = "ln -sfT \"#{MaglevDatabaseExplorer.full_gem_path}/app/views/maglev_database_explorer\" \"#{Dir.getwd}/app/views/maglev_database_explorer\"" puts "Creating symlink: #{create_views_link}"
Create public directory if necessary.
diff --git a/spec/controllers/installation_controller_spec.rb b/spec/controllers/installation_controller_spec.rb index abc1234..def5678 100644 --- a/spec/controllers/installation_controller_spec.rb +++ b/spec/controllers/installation_controller_spec.rb @@ -15,12 +15,18 @@ before do @current_feature_settings = seeds_feature_settings.pluck(:key, :value).to_h seeds_feature_settings.destroy_all - test_feature_settings.each { |feature_name, feature_value| Setting["feature.#{feature_name}"] = feature_value } + test_feature_settings.each do |feature_name, feature_value| + Setting["feature.#{feature_name}"] = feature_value + end end after do - test_feature_settings.keys.each { |feature_name| Setting.find_by(key: "feature.#{feature_name}").destroy } - @current_feature_settings.each { |feature_name, feature_value| Setting[feature_name] = feature_value } + test_feature_settings.each_key do |feature_name| + Setting.find_by(key: "feature.#{feature_name}").destroy + end + @current_feature_settings.each do |feature_name, feature_value| + Setting[feature_name] = feature_value + end end specify "with query string inside query params" do
Improve performance swapping keys.each for each_key, plus line lenght comply
diff --git a/db/migrate/20120205215836_ident_to_identification.rb b/db/migrate/20120205215836_ident_to_identification.rb index abc1234..def5678 100644 --- a/db/migrate/20120205215836_ident_to_identification.rb +++ b/db/migrate/20120205215836_ident_to_identification.rb @@ -0,0 +1,9 @@+class IdentToIdentification < ActiveRecord::Migration + def self.up + rename_column :lab_groups, :ident, :identification + end + + def self.down + rename_column :lab_groups, :identification, :ident + end +end
Use full name on columns. ident => identification
diff --git a/db/migrate/20190808150052_add_api_token_to_admins.rb b/db/migrate/20190808150052_add_api_token_to_admins.rb index abc1234..def5678 100644 --- a/db/migrate/20190808150052_add_api_token_to_admins.rb +++ b/db/migrate/20190808150052_add_api_token_to_admins.rb @@ -0,0 +1,7 @@+# frozen_string_literal: true + +class AddApiTokenToAdmins < ActiveRecord::Migration[5.2] + def change + add_column :admin_admins, :api_token, :string, null: true + end +end
Add migration to add api_token column to admins table
diff --git a/avr-gdb.rb b/avr-gdb.rb index abc1234..def5678 100644 --- a/avr-gdb.rb +++ b/avr-gdb.rb @@ -10,12 +10,22 @@ depends_on 'avr-binutils' def install - multios = `gcc --print-multi-os-directory`.chomp + args = ["--prefix=#{prefix}", + "--infodir=#{info}", + "--mandir=#{man}", + "--disable-werror", + "--disable-nls", + "--target=avr", + "--disable-install-libbfd", + "--disable-install-libiberty"] - system "./configure", "--prefix=#{prefix}", - "--target=avr", - "--program-prefix=avr-" + system "./configure", *args + system "make" system "make install" + + File.unlink "#{prefix}/share/info/bfd.info", + "#{prefix}/share/info/configure.info", + "#{prefix}/share/info/standards.info" end end
Remove files conflicting with binutils
diff --git a/db/migrate/20130821142246_update_french_postal_codes.rb b/db/migrate/20130821142246_update_french_postal_codes.rb index abc1234..def5678 100644 --- a/db/migrate/20130821142246_update_french_postal_codes.rb +++ b/db/migrate/20130821142246_update_french_postal_codes.rb @@ -0,0 +1,21 @@+class UpdateFrenchPostalCodes < ActiveRecord::Migration + def change + locations_count = Location.where(:name => "France") + .first + .children + .where("locations.postal_code_prefix ~ '^.{4}$' ").count + + puts "Updating #{locations_count} locations." + @bar = RakeProgressbar.new(locations_count) + (1..9).each do |num| + Location.where(:name => "France") + .first + .children + .where("locations.postal_code_prefix ~ '^#{num}.{3}$' ").each do |departement| + departement.update_attribute :postal_code_prefix, "0" + departement.postal_code_prefix + @bar.inc + end + end + @bar.finished + end +end
Update French postal codes for department from 1 to 9 without a leading 0.
diff --git a/db/migrate/20190212174815_change_extra_keys_to_bigint.rb b/db/migrate/20190212174815_change_extra_keys_to_bigint.rb index abc1234..def5678 100644 --- a/db/migrate/20190212174815_change_extra_keys_to_bigint.rb +++ b/db/migrate/20190212174815_change_extra_keys_to_bigint.rb @@ -0,0 +1,15 @@+class ChangeExtraKeysToBigint < ActiveRecord::Migration[6.0] + def up + change_column :organization_users, :creator_id, :bigint + change_column :pg_search_documents, :searchable_id, :bigint + change_column :topic_users, :current_reply_read_id, :bigint + change_column :topic_users, :last_reply_read_id, :bigint + end + + def down + change_column :organization_users, :creator_id, :integer + change_column :pg_search_documents, :searchable_id, :integer + change_column :topic_users, :current_reply_read_id, :integer + change_column :topic_users, :last_reply_read_id, :integer + end +end
Update foreign keys to bigint
diff --git a/db/migrate/20190221195724_change_project_id_to_bigint.rb b/db/migrate/20190221195724_change_project_id_to_bigint.rb index abc1234..def5678 100644 --- a/db/migrate/20190221195724_change_project_id_to_bigint.rb +++ b/db/migrate/20190221195724_change_project_id_to_bigint.rb @@ -0,0 +1,13 @@+class ChangeProjectIdToBigint < ActiveRecord::Migration[6.0] + def up + change_column :projects, :id, :bigint + + change_column :subjects, :project_id, :bigint + end + + def down + change_column :projects, :id, :integer + + change_column :subjects, :project_id, :integer + end +end
Update project_id primary and foreign keys to bigint
diff --git a/csvision.gemspec b/csvision.gemspec index abc1234..def5678 100644 --- a/csvision.gemspec +++ b/csvision.gemspec @@ -20,5 +20,6 @@ gem.add_development_dependency 'activesupport' gem.add_development_dependency 'sqlite3' gem.add_development_dependency 'mocha' + gem.add_development_dependency 'rake' gem.add_development_dependency 'turn', '0.8.2' end
Add rake as development dependency
diff --git a/lib/designernews/story.rb b/lib/designernews/story.rb index abc1234..def5678 100644 --- a/lib/designernews/story.rb +++ b/lib/designernews/story.rb @@ -5,7 +5,7 @@ attr_reader :title, :badge def initialize(hash) - ['title', 'url', 'badge', 'created_at'].each do |key| + %w(title url badge created_at).each do |key| instance_variable_set(key.prepend('@'), hash[key]) end end
Make use of Ruby's quote-word syntax
diff --git a/lib/fake_email_service.rb b/lib/fake_email_service.rb index abc1234..def5678 100644 --- a/lib/fake_email_service.rb +++ b/lib/fake_email_service.rb @@ -13,7 +13,9 @@ domain = email_address.domain.strip.downcase second_level_domain = domain.split('.')[-2..-1].join('.') - @fake_domains.include?(domain) || @fake_domains.include?(second_level_domain) + domains = [domain, second_level_domain] + + @fake_domains.any? {|fake_domain| domains.include?(fake_domain) } end end
Optimize search in fake domains list
diff --git a/lib/frecon/models/team.rb b/lib/frecon/models/team.rb index abc1234..def5678 100644 --- a/lib/frecon/models/team.rb +++ b/lib/frecon/models/team.rb @@ -16,9 +16,6 @@ field :location, type: String field :logo_path, type: String field :name, type: String - - has_many :participations, dependent: :destroy - has_many :records, dependent: :destroy validates :number, presence: true, uniqueness: true, numericality: { greater_than: 0 }
Team: Remove old associations with participations and records.
diff --git a/lib/garelic/middleware.rb b/lib/garelic/middleware.rb index abc1234..def5678 100644 --- a/lib/garelic/middleware.rb +++ b/lib/garelic/middleware.rb @@ -8,7 +8,8 @@ status, headers, response = @app.call(env) if headers["Content-Type"] =~ /text\/html|application\/xhtml\+xml/ \ - and response.respond_to?(:body) + and response.respond_to?(:body) \ + and response.body.respond_to?(:gsub) body = response.body.gsub(Garelic::Timing, Garelic.report_user_timing_from_metrics(Garelic::Metrics)) response = [body] end
Fix method missing on omniauth redirects.
diff --git a/lib/hubrelease/commits.rb b/lib/hubrelease/commits.rb index abc1234..def5678 100644 --- a/lib/hubrelease/commits.rb +++ b/lib/hubrelease/commits.rb @@ -17,8 +17,6 @@ changed = @compare.commits.map do |c| commit = HubRelease.client.commit(HubRelease.repo, c.sha) - require 'pp' - pp commit files = commit.files.select { |f| watched.include? f.filename } files = files.map do |f|
Remove the left in debugging
diff --git a/hephaestus/lib/resque/document_process_bootstrap_task.rb b/hephaestus/lib/resque/document_process_bootstrap_task.rb index abc1234..def5678 100644 --- a/hephaestus/lib/resque/document_process_bootstrap_task.rb +++ b/hephaestus/lib/resque/document_process_bootstrap_task.rb @@ -1,7 +1,7 @@ require 'active_support/all' class DocumentProcessBootstrapTask - @queue = :document_process_bootstrap + @queue = :document_process_bootstrap_task def self.perform(document_id) document = Document.find(document_id)
[hephaestus] Fix typo on task name
diff --git a/frontend/app/controllers/comable/products_controller.rb b/frontend/app/controllers/comable/products_controller.rb index abc1234..def5678 100644 --- a/frontend/app/controllers/comable/products_controller.rb +++ b/frontend/app/controllers/comable/products_controller.rb @@ -1,6 +1,18 @@ module Comable class ProductsController < Comable::ApplicationController + before_filter :load_category_and_products, only: :index + def index + @products = @products.page(params[:page]).per(Comable::Config.products_per_page) + end + + def show + @product = Comable::Product.find(params[:id]) + end + + private + + def load_category_and_products @category = Comable::Category.where(id: params[:category_id]).first if @category subtree_of_category = Comable::Category.subtree_of(@category) @@ -8,11 +20,6 @@ else @products = Comable::Product.search(params[:q]) end - @products = @products.page(params[:page]).per(Comable::Config.products_per_page) - end - - def show - @product = Comable::Product.find(params[:id]) end end end
rubocop: Refactor to split the method
diff --git a/config/unicorn/staging.rb b/config/unicorn/staging.rb index abc1234..def5678 100644 --- a/config/unicorn/staging.rb +++ b/config/unicorn/staging.rb @@ -9,7 +9,7 @@ ENV['BUNDLE_GEMFILE'] = "#{app_path}/Gemfile" end -worker_processes Integer(ENV["WEB_CONCURRENCY"] || 3) +worker_processes Integer(ENV["WEB_CONCURRENCY"] || 1) timeout (ENV["UNICORN_TIMEOUT"] || 15).to_i preload_app true
Change number of unicorn worder
diff --git a/ext/journalist/extconf.rb b/ext/journalist/extconf.rb index abc1234..def5678 100644 --- a/ext/journalist/extconf.rb +++ b/ext/journalist/extconf.rb @@ -1,4 +1,9 @@ require "mkmf" + +ruby = RUBY_VERSION.split('.').map{ |s| s.to_i } +if ruby[0] < 2 || (ruby[0] == 2 && ruby[1] < 1) + abort "----\nJournalist requires MRI >= 2.1\n----" +end yajl_inc, yajl_lib = pkg_config('yajl') abort "----\nCannot find YAJL\n----" unless yajl_inc && yajl_lib
Check ruby version before compilation
diff --git a/ext/rake/mustache_task.rb b/ext/rake/mustache_task.rb index abc1234..def5678 100644 --- a/ext/rake/mustache_task.rb +++ b/ext/rake/mustache_task.rb @@ -3,8 +3,8 @@ require 'mustache' module Rake - # Rake task to generate files from Mustache templates using - # dynamically generated data (as opposed to static YAML data). + # Rake task to generate files from Mustache templates using a CLI-like approach + # (but without actually using the broken mess the CLI is as of 0.99.5). class MustacheTask < SmartFileTask attr_accessor :data attr_writer :template
Build system: clarify MustacheTask rationale
diff --git a/lib/resume/cli/resume_data_fetcher.rb b/lib/resume/cli/resume_data_fetcher.rb index abc1234..def5678 100644 --- a/lib/resume/cli/resume_data_fetcher.rb +++ b/lib/resume/cli/resume_data_fetcher.rb @@ -17,9 +17,15 @@ def fetch Output.plain(:gathering_resume_information) JSON.parse( - FileFetcher.fetch(Resume.filename).read, + FileFetcher.fetch(resume_data_file).read, symbolize_names: true ) + end + + private + + def resume_data_file + "#{DATA_LOCATION}resume.#{I18n.locale}.json" end end end
Move knowledge of the name of the resume data JSON file name to the only place it's needed: the resume data fetcher
diff --git a/lib/stack_master/template_compiler.rb b/lib/stack_master/template_compiler.rb index abc1234..def5678 100644 --- a/lib/stack_master/template_compiler.rb +++ b/lib/stack_master/template_compiler.rb @@ -31,7 +31,7 @@ compiler_name = config.template_compilers.fetch(:rb) @compilers.fetch(compiler_name) end - private_class_method :template_compiler_for_file + private_class_method :sparkle_template_compiler def self.file_ext(template_file_path) File.extname(template_file_path).gsub('.', '').to_sym
Make the right method private
diff --git a/lib/schnitzelpress/app.rb b/lib/schnitzelpress/app.rb index abc1234..def5678 100644 --- a/lib/schnitzelpress/app.rb +++ b/lib/schnitzelpress/app.rb @@ -6,7 +6,9 @@ # use SchnitzelPress::Static use Rack::ShowExceptions use Rack::Cache - use Rack::StaticCache, :urls => ["/moo.txt"], :root => 'public' + use Rack::StaticCache, + :urls => ["/favicon.ico", "/img", "/js"], + :root => File.expand_path('../../public/', __FILE__) use Rack::MethodOverride use Rack::Session::Cookie
Use Rack::StaticCache for our static files.
diff --git a/lib/airbrush/client.rb b/lib/airbrush/client.rb index abc1234..def5678 100644 --- a/lib/airbrush/client.rb +++ b/lib/airbrush/client.rb @@ -7,7 +7,7 @@ class Client DEFAULT_INCOMING_QUEUE = 'airbrush_incoming_queue' DEFAULT_RESPONSE_TIMEOUT = 2.minutes - DEFAULT_QUEUE_VALIDITY = 10.minutes + DEFAULT_QUEUE_VALIDITY = 0 # 10.minutes for the moment attr_reader :host, :incoming_queue, :response_timeout, :queue_validity
Reset queue key validitity for the moment until we sort out expiry with starlings server components git-svn-id: 6d9b9a8f21f96071dc3ac7ff320f08f2a342ec80@86 daa9635f-4444-0410-9b3d-b8c75a019348
diff --git a/lib/shrinker/extractor.rb b/lib/shrinker/extractor.rb index abc1234..def5678 100644 --- a/lib/shrinker/extractor.rb +++ b/lib/shrinker/extractor.rb @@ -1,6 +1,6 @@ module Shrinker class Extractor < Struct.new(:token, :config) - UrlNotFound = ArgumentError.new + class UrlNotFound < ArgumentError; end; def self.unshrink(token, config = nil) self.new(token, config).unshrink @@ -8,9 +8,8 @@ def unshrink stored_content = backend.fetch(token) - if stored_content == {} - raise UrlNotFound - end + raise UrlNotFound.new("Cannot find the url with token: #{token}") if stored_content == {} + EasyUrl.new(stored_content['url'], stored_content['attributes'] || {}) end
Make UrlNotFound error more descriptive.
diff --git a/coursemology2/db/transforms/lib/content_parser.rb b/coursemology2/db/transforms/lib/content_parser.rb index abc1234..def5678 100644 --- a/coursemology2/db/transforms/lib/content_parser.rb +++ b/coursemology2/db/transforms/lib/content_parser.rb @@ -5,8 +5,8 @@ content.gsub!('[mc]', '<pre lang="python"><code>') content.gsub!('[/mc]', '</code></pre>') - content.gsub!('[c]', '<pre lang="python"><code>') - content.gsub!('[/c]', '</code></pre>') + content.gsub!('[c]', '<span lang="python"><code>') + content.gsub!('[/c]', '</code></span>') content end
Change [c] tag to use <span>
diff --git a/Library/Formula/akonadi.rb b/Library/Formula/akonadi.rb index abc1234..def5678 100644 --- a/Library/Formula/akonadi.rb +++ b/Library/Formula/akonadi.rb @@ -1,9 +1,9 @@ require 'formula' class Akonadi <Formula - url 'http://download.akonadi-project.org/akonadi-1.2.1.tar.bz2' + url 'http://download.akonadi-project.org/akonadi-1.3.0.tar.bz2' homepage 'http://pim.kde.org/akonadi/' - md5 'f9c1d000844f31c67360078ddf60bec2' + md5 '45fe59bd301268149cb0313d54a98520' depends_on 'cmake' depends_on 'shared-mime-info'
Update Akonadi formula to 1.3.0.
diff --git a/lib/bundler/cli/add.rb b/lib/bundler/cli/add.rb index abc1234..def5678 100644 --- a/lib/bundler/cli/add.rb +++ b/lib/bundler/cli/add.rb @@ -10,9 +10,8 @@ end def run - dependency = Bundler::Dependency.new(@gem_name, nil, @options) - dependency.instance_variable_set(:@requirement, Gem::Requirement.new(@options[:version].split(",").map(&:strip))) unless @options[:version].nil? - + version = @options[:version].nil? ? nil : @options[:version].split(",").map(&:strip) + dependency = Bundler::Dependency.new(@gem_name, version, @options) Injector.inject([dependency], :conservative_versioning => @options[:version].nil?) # Perform conservative versioning only when version is not specified Installer.install(Bundler.root, Bundler.definition) end
Add command: Use initializer instead of instance_variable_set
diff --git a/lib/event_store/client/http/controls/event_data/read.rb b/lib/event_store/client/http/controls/event_data/read.rb index abc1234..def5678 100644 --- a/lib/event_store/client/http/controls/event_data/read.rb +++ b/lib/event_store/client/http/controls/event_data/read.rb @@ -5,7 +5,7 @@ module EventData module Read module JSON - def self.data(number=nil, time: time, stream_name: nil, metadata: nil) + def self.data(number=nil, time: nil, stream_name: nil, metadata: nil) reference_time = ::Controls::Time.reference number ||= 0 @@ -18,7 +18,7 @@ 'content' => { 'eventType' => 'SomeEvent', 'eventNumber' => number, - 'eventStreamId' => 'someStream', + 'eventStreamId' => stream_name, 'data' => { 'someAttribute' => 'some value', 'someTime' => time @@ -27,7 +27,7 @@ }, 'links' => [ { - 'uri' => "http://localhost:2113/streams/someStream/#{number}", + 'uri' => "http://localhost:2113/streams/#{stream_name}/#{number}", 'relation' => 'edit' } ]
Read event data control consistency is improved
diff --git a/spec/fake_app/models/active_record.rb b/spec/fake_app/models/active_record.rb index abc1234..def5678 100644 --- a/spec/fake_app/models/active_record.rb +++ b/spec/fake_app/models/active_record.rb @@ -1,11 +1,13 @@+# MODELS class Product < ActiveRecord::Base end -#migrations +# MIGRATIONS class CreateAllTables < ActiveRecord::Migration def self.up - create_table(:products) { |t| t.string :name } + create_table(:products) { |t| t.string :name; t.text :description } end end + ActiveRecord::Migration.verbose = false CreateAllTables.up
Add field description for model Product
diff --git a/lib/usaidwat/cmd/where.rb b/lib/usaidwat/cmd/where.rb index abc1234..def5678 100644 --- a/lib/usaidwat/cmd/where.rb +++ b/lib/usaidwat/cmd/where.rb @@ -5,7 +5,7 @@ def where damn where_usage unless ARGV.length == 1 - reddit_user = USaidWat::RedditUser.new $*.shift + reddit_user = USaidWat::RedditUser.new ARGV.shift comments = reddit_user.retrieve_comments exit 2 unless comments max_key = 1
Use ARGV instead of $*
diff --git a/spec/features/delivery_update_spec.rb b/spec/features/delivery_update_spec.rb index abc1234..def5678 100644 --- a/spec/features/delivery_update_spec.rb +++ b/spec/features/delivery_update_spec.rb @@ -0,0 +1,37 @@+# encoding: utf-8 +require "rails_helper" +require "support/helpers/features/user_accounts" + +RSpec.describe "Adding delivery updates" do + let!(:user) { FactoryGirl.create(:normal_user) } + let!(:study) { FactoryGirl.create(:study, principal_investigator: user) } + let!(:progressing_fine) { FactoryGirl.create(:progressing_fine) } + let!(:major_problems) { FactoryGirl.create(:major_problems) } + let!(:invite) do + FactoryGirl.create(:delivery_update_invite, study: study, + invited_user: user) + end + + it "lets a logged in user add an update" do + sign_in_account(user.email) + visit study_path(study) + find(:xpath, "//a[@href='#{new_study_delivery_update_path(study)}']").click + select progressing_fine.name, from: "Data collection" + select progressing_fine.name, from: "Data analysis" + select major_problems.name, from: "Interpretation and write up" + click_button "Add delivery update" + + expect(page).to have_text "Delivery update created successfully" + end + + it "lets invited users add an update without signing in" do + path = new_study_delivery_update_path(study) + visit "#{path}?token=#{user.delivery_update_token}" + select progressing_fine.name, from: "Data collection" + select progressing_fine.name, from: "Data analysis" + select major_problems.name, from: "Interpretation and write up" + click_button "Add delivery update" + + expect(page).to have_text "Delivery update created successfully" + end +end
Add a feature spec for DeliveryUpdates
diff --git a/spec/instructions/goto_if_nil_spec.rb b/spec/instructions/goto_if_nil_spec.rb index abc1234..def5678 100644 --- a/spec/instructions/goto_if_nil_spec.rb +++ b/spec/instructions/goto_if_nil_spec.rb @@ -0,0 +1,23 @@+require File.expand_path("../spec_helper", __FILE__) + +describe "Instruction goto_if_nil" do + before do + @spec = InstructionSpec.new :goto_if_nil do |g| + done = g.new_label + + g.push_literal :a + g.push_nil + g.goto_if_nil done + + g.pop + g.push_literal :b + + done.set! + g.ret + end + end + + it "branches to the location if the object at stack bottom is nil" do + @spec.run.should == :a + end +end
Add example branch instruction spec.
diff --git a/spec/session/selenium_session_spec.rb b/spec/session/selenium_session_spec.rb index abc1234..def5678 100644 --- a/spec/session/selenium_session_spec.rb +++ b/spec/session/selenium_session_spec.rb @@ -18,8 +18,8 @@ end end - # it_should_behave_like "session" + it_should_behave_like "session" it_should_behave_like "session with javascript support" - # it_should_behave_like "session without headers support" + it_should_behave_like "session without headers support" end end
Put the accidently commented out specs back in. Thanks alovak!
diff --git a/app/models/priority_type.rb b/app/models/priority_type.rb index abc1234..def5678 100644 --- a/app/models/priority_type.rb +++ b/app/models/priority_type.rb @@ -6,7 +6,7 @@ default_scope { where(:active => true) } def self.default - where(:default => true).first + where(:is_default => true).first end end
Fix sql issue with reserved column name 'default'
diff --git a/db/migrate/20220105085729_split_customers_name.rb b/db/migrate/20220105085729_split_customers_name.rb index abc1234..def5678 100644 --- a/db/migrate/20220105085729_split_customers_name.rb +++ b/db/migrate/20220105085729_split_customers_name.rb @@ -12,10 +12,18 @@ end def migrate_customer_name_data - Customer.where("backup_name LIKE '% %'").find_each do |customer| - first_name, last_name = customer.backup_name.split(' ', 2) - customer.first_name = first_name - customer.last_name = last_name + Customer.includes(:bill_address).find_each do |customer| + bill_address = customer.bill_address + + if bill_address.present? && bill_address.firstname.present? && bill_address.lastname? + customer.first_name = bill_address.firstname.strip + customer.last_name = bill_address.lastname.strip + else + first_name, last_name = customer.backup_name.strip.split(' ', 2) + customer.first_name = first_name + customer.last_name = last_name + end + customer.save end end
Improve first_name and last_name setup
diff --git a/app/reports/notas_report.rb b/app/reports/notas_report.rb index abc1234..def5678 100644 --- a/app/reports/notas_report.rb +++ b/app/reports/notas_report.rb @@ -0,0 +1,41 @@+class NotasReport + + attr_accessor :notas + + def initialize notas + self.notas = notas + end + + def listado_notas + +# numero, area, tipo de iniciador, iniciador, tags, weekly session, +# ingreso, fojas, descripcion + + report = ODFReport::Report.new(Rails.root.join("app/reports/notas.odt")) do |r| + r.add_section "NOTAS", notas do |n| + n.add_field(:numero) { |item| item.numero.to_s } + # area es el nombre del primer pase? deberia ademas ir el de el ultimo? + n.add_field(:area) { |item| item.area.to_s } + n.add_field(:organizacion) { |item| item.organization.to_s } + n.add_field(:autor) { |item| item.initiator.to_s } + # s.add_section("DICTAMEN", :dictamenes) do + n.add_section("PASES", :pases) do |s| + s.add_field(:fojas) { |pase| pase.fojas.to_s } + s.add_field(:ingreso) { |pase| pase.ingreso.to_s } + s.add_field(:area) { |pase| pase.area_name.to_s } + s.add_field(:descripcion) { |pase| pase.descripcion.to_s } + end + #tags? + #Fojas esta en nota.ultimo_pase.fojas + # n.add_field(:fojas) { |item| item.fojas.to_s } + # aca deberia ir la descripcion del primer pase? + # n.add_field(:descripcion) { |item| item.descrip.to_s } + + end + end + + report.generate + + end + +end
Add listado method to notas report, with pases history
diff --git a/lib/generators/datetimepicker_rails/install_generator.rb b/lib/generators/datetimepicker_rails/install_generator.rb index abc1234..def5678 100644 --- a/lib/generators/datetimepicker_rails/install_generator.rb +++ b/lib/generators/datetimepicker_rails/install_generator.rb @@ -1,6 +1,6 @@ require 'securerandom' -module Datetimepicker_rails +module DatetimepickerRails module Generators class InstallGenerator < Rails::Generators::Base source_root File.expand_path("../../templates/inputs", __FILE__)
Correct the generator name bug
diff --git a/lib/noteworthy/jira.rb b/lib/noteworthy/jira.rb index abc1234..def5678 100644 --- a/lib/noteworthy/jira.rb +++ b/lib/noteworthy/jira.rb @@ -20,7 +20,12 @@ def get_issue(key=nil) return false if key.nil? return false unless self.configured? - return Jiralicious::Issue.find(key) + begin + return Jiralicious::Issue.find(key) + rescue + return false + end + return false end def configured?
Deal with the case where something like TT-32 returns a 404.
diff --git a/lib/opstwerk/config.rb b/lib/opstwerk/config.rb index abc1234..def5678 100644 --- a/lib/opstwerk/config.rb +++ b/lib/opstwerk/config.rb @@ -9,11 +9,13 @@ end def aws_config - load_config('~/.fog') + return @aws_config if @aws_config + fog_confg = load_config(File.expand_path('~/.fog')) + @aws_config = { access_key_id: fog_confg[:aws_access_key_id], secret_access_key: fog_confg[:aws_secret_access_key] } end def opsworks_config - load_config('.opstwerk') + @opsworks_config ||= load_config('./.opstwerk') end def configure_aws!
Fix Fog file loading and yaml keys