diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/spec/features/namespace_tracking_spec.rb b/spec/features/namespace_tracking_spec.rb index abc1234..def5678 100644 --- a/spec/features/namespace_tracking_spec.rb +++ b/spec/features/namespace_tracking_spec.rb @@ -0,0 +1,50 @@+# frozen_string_literal: true + +require 'rails_helper' + +describe 'Namespace tracking', type: :feature, js: true do + let(:course) { create(:basic_course) } + let(:user) { create(:user) } + + before do + JoinCourse.new(course:, user:, role: CoursesUsers::Roles::INSTRUCTOR_ROLE) + login_as user + stub_token_request + stub_oauth_edit + end + + it 'lets you add or remove namespaces' do + # mainspace is tracked by default + expect(course.tracked_namespaces.count).to eq(1) + + visit "/courses/#{course.slug}" + click_button 'Edit Details' + expect(page).to have_content 'Tracked Namespaces' + + find('#namespace_select').click + send_keys('userspace', :enter) + send_keys('help', :enter) + + click_button 'Save' + expect(page).not_to have_content 'Tracked Namespaces' + + # adding explicit namespaces means default mainspace isn't tracked + expect(course.reload.tracked_namespaces.count).to eq(2) + + click_button 'Edit Details' + expect(page).to have_content 'Tracked Namespaces' + + # Now we remove them again + within('#namespace_select') do + first('svg').click + first('svg').click + end + + click_button 'Save' + expect(page).not_to have_content 'Tracked Namespaces' + + # back to default of just mainspace + expect(course.reload.tracked_namespaces.count).to eq(1) + expect(course.tracked_namespaces.first[:namespace]).to eq(Article::Namespaces::MAINSPACE) + end +end
Add spec for adding/removing tracked namespaces
diff --git a/spec/support/cli_args_messages_helper.rb b/spec/support/cli_args_messages_helper.rb index abc1234..def5678 100644 --- a/spec/support/cli_args_messages_helper.rb +++ b/spec/support/cli_args_messages_helper.rb @@ -13,16 +13,24 @@ end class ErrorMessanger - attr_reader :argument_missing, :option_invalid, :identifier_invalid + attr_reader :option_invalid, + :invalid_identifier_count, + :invalid_identifier, + :argument_missing def initialize - @option_invalid = "Only one option is supported: '-e (explanation)'." - @identifier_invalid = "Globs accepts only one argument: e.g. '$!'." - @argument_missing = "You have to pass at least one argument and it has to be an identifier." + @option_invalid = "Only one option is supported: '-e (explanation)'." + @invalid_identifier_count = "Globs accepts only one argument: e.g. '$!'." + @invalid_identifier = "Invalid Ruby identifier. It has to be valid global variable (\"$0\") or a valid constant token. (\"RUBY_VERSION\")" + @argument_missing = "You have to pass at least one argument and it has to be an identifier." end - def all_args_invalid - "#{option_invalid}\n\n#{identifier_invalid}" + def invalid_option_and_identifier_count + "#{option_invalid}\n\n#{invalid_identifier_count}" + end + + def invalid_option_and_malformed_identifier + "#{option_invalid}\n\n#{invalid_identifier}" end end end
Modify messages withing CLIArgMessanger helper Changes within CLIArgValidator made it obligatory to modify changes in the testing message helper as well.
diff --git a/config/software/opscode-pushy-server.rb b/config/software/opscode-pushy-server.rb index abc1234..def5678 100644 --- a/config/software/opscode-pushy-server.rb +++ b/config/software/opscode-pushy-server.rb @@ -17,7 +17,7 @@ name "opscode-pushy-server" default_version "1.1.0" -source git: "git://opscode/opscode-pushy-server" +source git: "git://github.com/opscode/opscode-pushy-server" dependency "erlang" dependency "rebar"
Use public github url format.
diff --git a/Kiwi.podspec b/Kiwi.podspec index abc1234..def5678 100644 --- a/Kiwi.podspec +++ b/Kiwi.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'Kiwi' - s.version = '1.0.1' + s.version = '1.0.0' s.summary = 'A Behavior Driven Development library for iPhone and iPad development.' s.homepage = 'http://kiwi-lib.info' s.authors = { 'Allen Ding' => 'allen@allending.com', 'Luke Redpath' => 'luke@lukeredpath.co.uk' }
Revert podspec version to 1.0.0
diff --git a/app/models/adverse_event_file.rb b/app/models/adverse_event_file.rb index abc1234..def5678 100644 --- a/app/models/adverse_event_file.rb +++ b/app/models/adverse_event_file.rb @@ -6,7 +6,7 @@ mount_uploader :attachment, GenericUploader # Validations - validates :project_id, :user_id, :adverse_event_id, :attachment, presence: true + validates :attachment, presence: true # Relationships belongs_to :project
Remove duplicate validations that already handled by belongs_to
diff --git a/rom.gemspec b/rom.gemspec index abc1234..def5678 100644 --- a/rom.gemspec +++ b/rom.gemspec @@ -16,11 +16,11 @@ gem.license = 'MIT' gem.add_runtime_dependency 'addressable', '~> 2.3' - gem.add_runtime_dependency 'concord', '~> 0.1.4' - gem.add_runtime_dependency 'charlatan', '~> 0.1' - gem.add_runtime_dependency 'inflecto', '~> 0.0.2' + gem.add_runtime_dependency 'concord', '~> 0.1', '>= 0.1.4' + gem.add_runtime_dependency 'charlatan', '~> 0.1', '>= 0.1' + gem.add_runtime_dependency 'inflecto', '~> 0.0', '>= 0.0.2' - gem.add_development_dependency 'rake' + gem.add_development_dependency 'rake', '~> 0.10' gem.add_development_dependency 'rspec-core', '~> 3.1' gem.add_development_dependency 'rspec-expectations', '~> 3.1' end
Make version deps in gemspec less strict
diff --git a/lib/rize.rb b/lib/rize.rb index abc1234..def5678 100644 --- a/lib/rize.rb +++ b/lib/rize.rb @@ -2,7 +2,4 @@ require "rize/iteration" module Rize - def self.included(base) - base.extend self - end end
Remove included hook for now
diff --git a/run_test.rb b/run_test.rb index abc1234..def5678 100644 --- a/run_test.rb +++ b/run_test.rb @@ -8,19 +8,23 @@ end end -run("docker run --name=rubygems -d rubygems") -run("docker run --name=api.rubygems -d api.rubygems") -run("docker run --name=obs -d obs") +servers = { + "rubygems" => "rubygems.org", + "api.rubygems" => "api.rubygems.org", + "obs" => "api.opensuse.org" +} + +servers.keys.each do |name| + run("docker run --name=#{name} -d #{name}") +end sleep 3 -run("docker run --link rubygems:rubygems.org --link api.rubygems:api.rubygems.org --link obs:api.opensuse.org client") +links = servers.map { |name, server| "--link #{name}:#{server}" }.join(" ") +run("docker run #{links} client") -run("docker kill rubygems") -run("docker kill api.rubygems") -run("docker kill obs") - -run("docker rm rubygems") -run("docker rm api.rubygems") -run("docker rm obs") +servers.keys.each do |name| + run("docker kill #{name}") + run("docker rm #{name}") +end puts "Success."
Clean up test runner script
diff --git a/app/tasks/destroy_server_task.rb b/app/tasks/destroy_server_task.rb index abc1234..def5678 100644 --- a/app/tasks/destroy_server_task.rb +++ b/app/tasks/destroy_server_task.rb @@ -12,7 +12,7 @@ begin tasker.perform(:destroy, @user.id, @server.id) - @server.create_credit_note_for_remaining_time + @server.create_credit_note_for_time_remaining @server.destroy_with_ip(@ip) rescue Faraday::Error::ClientError => e ErrorLogging.new.track_exception(e, extra: { current_user: @user, source: 'DestroyServerTask', faraday: e.response })
Change name of create_credit_note_for_time_remaining() to @server.create_credit_note_for_remaining_time()
diff --git a/recipes/default.rb b/recipes/default.rb index abc1234..def5678 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -27,12 +27,21 @@ action :install end -# Remove the RPM packaged config if necessary +# Remove the packaged config if necessary %w{ conf.d/mod_evasive.conf mods-available/evasive.conf mods-available/evasive.load }.each do |f| file "#{node['apache']['dir']}/#{f}" do + action :delete + end +end + +# Remove symlinks created by apt-get +%w{ mods-enabled/evasive.conf + mods-enabled/evasive.load }.each do |l| + + link "#{node['apache']['dir']}/#{l}" do action :delete end end
Remove symlinks created by apt-get
diff --git a/recipes/default.rb b/recipes/default.rb index abc1234..def5678 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -22,6 +22,15 @@ package nfspkg end +# Configure NFS client components +node['nfs']['config']['client_templates'].each do |client_template| + template client_template do + mode 0644 + notifies :restart, "service[portmap]" + notifies :restart, "service[nfslock]" + end +end + # Start NFS client components service "portmap" do service_name node['nfs']['service']['portmap'] @@ -34,12 +43,3 @@ action [ :start, :enable ] supports :status => true end - -# Configure NFS client components -node['nfs']['config']['client_templates'].each do |client_template| - template client_template do - mode 0644 - notifies :restart, "service[portmap]" - notifies :restart, "service[nfslock]" - end -end
Put templates in place before service resource calls Put templates in place before service resource calls so that the services do not start until our configs are in place.
diff --git a/log.gemspec b/log.gemspec index abc1234..def5678 100644 --- a/log.gemspec +++ b/log.gemspec @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = 'evt-log' - s.version = '0.5.0.0' + s.version = '0.5.1.0' s.summary = 'Logging to STD IO with levels, tagging, and coloring' s.description = ' '
Package version is increased from 0.5.0.0 to 0.5.1.0
diff --git a/cookbooks/geoserver/attributes/default.rb b/cookbooks/geoserver/attributes/default.rb index abc1234..def5678 100644 --- a/cookbooks/geoserver/attributes/default.rb +++ b/cookbooks/geoserver/attributes/default.rb @@ -16,8 +16,8 @@ default['geoserver']['group'] = nil #Hmmm ... 2.2.4 does not seem to work in glassfish? -#version = '2.1.4' -version = '2.3.1' +version = '2.1.4' +#version = '2.3.1' default['geoserver']['version'] = version default['geoserver']['package_url'] = "http://downloads.sourceforge.net/geoserver/geoserver-#{version}-war.zip"
Rollback to a version known to work
diff --git a/app/controllers/ajax/relationship_controller.rb b/app/controllers/ajax/relationship_controller.rb index abc1234..def5678 100644 --- a/app/controllers/ajax/relationship_controller.rb +++ b/app/controllers/ajax/relationship_controller.rb @@ -17,8 +17,8 @@ ) @response[:success] = true @response[:message] = t("messages.friend.create.okay") - rescue Errors::Base - @response[:message] = t("messages.answer.create.fail") + rescue Errors::Base => e + @response[:message] = t(e.locale_tag) ensure return_response end @@ -31,8 +31,8 @@ ) @response[:success] = true @response[:message] = t("messages.friend.destroy.okay") - rescue Errors::Base - @response[:message] = t("messages.friend.destroy.fail") + rescue Errors::Base => e + @response[:message] = t(e.locale_tag) ensure return_response end
Use generic handling of our own exceptions Noticed that we shouldn't be trying to catch specific exceptions as `Dry::Types` will throw its own exceptions for validation errors.
diff --git a/app/controllers/api_engine/schema_controller.rb b/app/controllers/api_engine/schema_controller.rb index abc1234..def5678 100644 --- a/app/controllers/api_engine/schema_controller.rb +++ b/app/controllers/api_engine/schema_controller.rb @@ -13,7 +13,7 @@ model_key = model.to_s.downcase.pluralize.to_sym model_schema = {} model_schema[model_key] = model.active_model_serializer.schema - resp[:resources][model_key] = model_schema + resp[:resources].merge!(model_schema) end resp end
Fix bug in schema json response
diff --git a/lib/generators/forem/views_generator.rb b/lib/generators/forem/views_generator.rb index abc1234..def5678 100644 --- a/lib/generators/forem/views_generator.rb +++ b/lib/generators/forem/views_generator.rb @@ -9,6 +9,7 @@ def copy_views view_directory :admin + view_directory :categories view_directory :forums view_directory :posts view_directory :topics
Copy categories views in views generator
diff --git a/lib/honeybadger-read-api/team_member.rb b/lib/honeybadger-read-api/team_member.rb index abc1234..def5678 100644 --- a/lib/honeybadger-read-api/team_member.rb +++ b/lib/honeybadger-read-api/team_member.rb @@ -2,18 +2,25 @@ module Read class TeamMember - attr_reader :id, :name, :email, :admin, :created_at + attr_reader :id, :admin, :created_at def initialize(opts) @id = opts[:id] - @name = opts[:name] - @email = opts[:email] + @user = User.new(opts[:name], opts[:email]) @admin = opts[:admin] @created_at = opts[:created_at] end def admin? @admin + end + + def name + @user.name + end + + def email + @user.email end def self.all(team_id)
Rewrite internal representation of the user for a team member.
diff --git a/app/presenters/tree_builder_storage_adapters.rb b/app/presenters/tree_builder_storage_adapters.rb index abc1234..def5678 100644 --- a/app/presenters/tree_builder_storage_adapters.rb +++ b/app/presenters/tree_builder_storage_adapters.rb @@ -3,8 +3,7 @@ has_kids_for MiqScsiTarget, [:x_get_tree_target_kids] def initialize(name, sandbox, build = true, **params) - sandbox[:sa_root] = params[:root] if params[:root] - @root = sandbox[:sa_root] + @root = params[:root] super(name, sandbox, build) end
Drop the unnecessary sandbox variable in storage adapters 🌳✂️✂️
diff --git a/serverspec.gemspec b/serverspec.gemspec index abc1234..def5678 100644 --- a/serverspec.gemspec +++ b/serverspec.gemspec @@ -23,6 +23,4 @@ spec.add_runtime_dependency "highline" spec.add_development_dependency "bundler", "~> 1.3" spec.add_development_dependency "rake" - spec.add_development_dependency "guard-rspec" - spec.add_development_dependency "growl" end
Remove dependency of guard-rspec and growl guard-rspec needs celluloids and it depends on Ruby 1.9 and later.
diff --git a/ethon.gemspec b/ethon.gemspec index abc1234..def5678 100644 --- a/ethon.gemspec +++ b/ethon.gemspec @@ -18,7 +18,7 @@ s.license = 'MIT' s.add_dependency('ffi', ['>= 1.3.0']) - s.add_dependency('mime-types', ['< 3', '>= 1.18']) + s.add_dependency('mime-types', ['~> 1.18']) s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- spec/*`.split("\n")
Revert "Support newer versions of mime-types" This reverts commit 1a54d0a6a040515154819aa5a410e646ba570c20.
diff --git a/lib/generators/components/tests/rspec.rb b/lib/generators/components/tests/rspec.rb index abc1234..def5678 100644 --- a/lib/generators/components/tests/rspec.rb +++ b/lib/generators/components/tests/rspec.rb @@ -4,7 +4,7 @@ describe "!NAME!Decorator" do it 'can construct a new instance' do object = "Sample" - @!DNAME! = !NAME!Decorator.new(object, self) + @!DNAME! = !NAME!Decorator.new(object, context: self) expect(@!DNAME!).to eql object end end
Add context to spec example
diff --git a/test_site/config/boot.rb b/test_site/config/boot.rb index abc1234..def5678 100644 --- a/test_site/config/boot.rb +++ b/test_site/config/boot.rb @@ -1,5 +1,5 @@ require 'rubygems' -gem 'rails', '3.1.3' +gem 'rails', '3.2.0' # Set up gems listed in the Gemfile. ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
Update rails test site to 3.2.0
diff --git a/0_code_wars/who_has_the_most_money.rb b/0_code_wars/who_has_the_most_money.rb index abc1234..def5678 100644 --- a/0_code_wars/who_has_the_most_money.rb +++ b/0_code_wars/who_has_the_most_money.rb @@ -0,0 +1,13 @@+# http://www.codewars.com/kata/528d36d7cc451cd7e4000339/ +# --- iteration 1 --- +def most_money(students) + return students.first.name if students.size == 1 + return "all" if students.map{ |st| st.total_money }.uniq.count == 1 + students.sort_by{ |st| st.total_money }.last.name +end + +class Student + def total_money + 5 * fives + 10 * tens + 20 * twenties + end +end
Add code wars (6) - who has the most money
diff --git a/test/serializers/attributes_test.rb b/test/serializers/attributes_test.rb index abc1234..def5678 100644 --- a/test/serializers/attributes_test.rb +++ b/test/serializers/attributes_test.rb @@ -23,8 +23,14 @@ @profile_serializer.attributes(fields: [:name, :description], required_fields: [:name])) end + + def test_include_nil_false + assert_equal({name: 'Name 1', description: 'Description 1'}, + @profile_serializer.attributes(include_nil: false)) - def test_include_nil + end + + def test_include_nil_true assert_equal({name: 'Name 1', description: 'Description 1', nothing: nil}, @profile_serializer.attributes(include_nil: true))
Add test which passes false explicitly
diff --git a/APIService/APIService-TalkingData.podspec b/APIService/APIService-TalkingData.podspec index abc1234..def5678 100644 --- a/APIService/APIService-TalkingData.podspec +++ b/APIService/APIService-TalkingData.podspec @@ -0,0 +1,23 @@+Pod::Spec.new do |s| + s.name = "APIService-TalkingData" + s.version = "2.2.36" + s.summary = "TalkingData Analytics SDK. https://www.talkingdata.com" + s.homepage = "https://github.com/ElfSundae/AppComponents" + s.documentation_url = "http://doc.talkingdata.com/posts/20" + s.authors = { + "TalkingData" => "https://www.talkingdata.com" + } + s.license = { + :type => "Copyright", + :text => "Copyright https://www.talkingdata.com" + } + s.source = { + :http => "http://www.tenddata.com:8080/download/TalkingData_Analytics_iOS_SDK.zip" + } + s.platform = :ios, "6.0" + s.frameworks = "Security", "SystemConfiguration", "CoreTelephony", "CoreMotion", "AdSupport" + s.libraries = "z" + + s.source_files = "**/TalkingData.h", "**/TalkingDataSMS.h" + s.vendored_libraries = "**/libTalkingData.a" +end
Revert "Revert "Revert "Remove TalkingData, app can use TalkingData-AppAnalytics instead""" This reverts commit 4dad652cdcc6729ddefc03e0019166da7efa272b.
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -1,6 +1,6 @@ name "go" description "Installs/Configures Go servers and agents" -version "0.0.4" +version "0.0.5" supports "ubuntu" "12.04"
Use TW apt repo for package installation
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -8,4 +8,4 @@ depends 'build-essential' depends 'java' depends 'runit' -depends 'zookeeper', '>= 2.0.0' +depends 'zookeeper', '~> 2.0'
Switch to pessimistic version constraint for zookeeper Future-proofing against future potentially breaking releases of the Zookeeper cookbook.
diff --git a/error_data.gemspec b/error_data.gemspec index abc1234..def5678 100644 --- a/error_data.gemspec +++ b/error_data.gemspec @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = 'error_data' - s.version = '0.0.1.10' + s.version = '0.1.0.0' s.summary = 'Representation of an error as a data structure' s.description = ' '
Package version increased from 0.0.1.10 0.1.0.0
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -1,10 +1,10 @@ name 'owncloud' -maintainer 'YOUR_NAME' -maintainer_email 'YOUR_EMAIL' -license 'All rights reserved' +maintainer 'David Pando' +maintainer_email 'david.pando@gmail.com' +license 'MIT' description 'Installs/Configures owncloud' long_description 'Installs/Configures owncloud' -version '0.1.0' +version '0.9.0' depends 'nginx' depends 'mysql'
Bump cookbook version to 0.9.0
diff --git a/spec/models/spree/order/checkout_spec.rb b/spec/models/spree/order/checkout_spec.rb index abc1234..def5678 100644 --- a/spec/models/spree/order/checkout_spec.rb +++ b/spec/models/spree/order/checkout_spec.rb @@ -0,0 +1,29 @@+require 'spec_helper' + +describe Spree::Order do + describe 'event :restart_checkout' do + context 'when the order is not complete' do + let(:order) { create(:order) } + + before { allow(order).to receive(:completed?) { false } } + + it 'does transition to cart state' do + expect(order.state).to eq('cart') + end + end + + context 'when the order is complete' do + let(:order) { create(:order) } + + before { allow(order).to receive(:completed?) { true } } + + it 'raises' do + expect { order.restart_checkout! } + .to raise_error( + StateMachine::InvalidTransition, + /Cannot transition state via :restart_checkout/ + ) + end + end + end +end
Test :restart_checkout state machine event
diff --git a/recipes/postgresql.rb b/recipes/postgresql.rb index abc1234..def5678 100644 --- a/recipes/postgresql.rb +++ b/recipes/postgresql.rb @@ -12,14 +12,16 @@ # Include postgresql_database include_recipe "database::postgresql" -# Create production database +# Create databases for Rails app postgresql_connection_info = { :host => "127.0.0.1", :port => node["postgresql"]["config"]["port"], :username => "postgres", :password => node["postgresql"]["password"]["postgres"] } -postgresql_database "practicing-ruby-production" do - connection postgresql_connection_info - action :create +%w(devel test production).each do |db| + postgresql_database "practicing-ruby-#{db}" do + connection postgresql_connection_info + action :create + end end
Create devel and test databases too
diff --git a/tod.gemspec b/tod.gemspec index abc1234..def5678 100644 --- a/tod.gemspec +++ b/tod.gemspec @@ -12,8 +12,6 @@ s.summary = %q{Supplies TimeOfDay class} s.description = %q{Supplies TimeOfDay class that includes parsing, strftime, comparison, and arithmetic.} - s.rubyforge_project = "tod" - s.add_development_dependency "test-unit" s.add_development_dependency "shoulda" s.add_development_dependency "mocha"
Remove RubyForge project from gemspec.
diff --git a/LunchOverflow/spec/features/users_spec.rb b/LunchOverflow/spec/features/users_spec.rb index abc1234..def5678 100644 --- a/LunchOverflow/spec/features/users_spec.rb +++ b/LunchOverflow/spec/features/users_spec.rb @@ -0,0 +1,16 @@+require 'rails_helper' + +feature 'User managment' do + + scenario "add new user" do + expect{ + visit new_user_path + fill_in 'user_user_name', with: attributes_for(:user)[:user_name] + fill_in 'user_email', with: attributes_for(:user)[:email] + fill_in 'user_password', with: attributes_for(:user)[:password] + + click_button 'create_user' + }.to change(User, :count).by(1) + + end +end
Add features test for form create a new user
diff --git a/github_cli.gemspec b/github_cli.gemspec index abc1234..def5678 100644 --- a/github_cli.gemspec +++ b/github_cli.gemspec @@ -9,7 +9,7 @@ gem.homepage = "http://github.com/peter-murach/github_cli" gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } - gem.files = `git ls-files`.split("\n") + gem.files = `git ls-files`.split("\n") + Dir.glob("lib/github_cli/man/**/*") gem.test_files = `git ls-files -- {spec,features}/*`.split("\n") gem.name = "github_cli" gem.require_paths = ["lib"]
Add manpages to load path.
diff --git a/runner.gemspec b/runner.gemspec index abc1234..def5678 100644 --- a/runner.gemspec +++ b/runner.gemspec @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = 'runner' - s.version = '0.1.1' + s.version = '0.1.2' s.summary = 'Run files that match a file specification, excluding those that match a regex' s.description = ' '
Package version patch number is increased from 0.1.1 to 0.1.2
diff --git a/schema.gemspec b/schema.gemspec index abc1234..def5678 100644 --- a/schema.gemspec +++ b/schema.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |s| s.name = 'evt-schema' s.summary = "Primitives for schema and data structure" - s.version = '2.2.4.2' + s.version = '2.2.4.3' s.description = ' ' s.authors = ['The Eventide Project']
Package version is increased from 2.2.4.2 to 2.2.4.3
diff --git a/Formula/instantclient-sqlplus.rb b/Formula/instantclient-sqlplus.rb index abc1234..def5678 100644 --- a/Formula/instantclient-sqlplus.rb +++ b/Formula/instantclient-sqlplus.rb @@ -17,7 +17,7 @@ end lib.install Dir["*.dylib"] bin.install ["sqlplus"] - if MacOS.version == :catalina + if MacOS.version >= :catalina bin.env_script_all_files(libexec, "DYLD_LIBRARY_PATH" => HOMEBREW_PREFIX/"lib") end end
Use all files script for MacOS versions catalina or later On macOS Big Sur 11.1 when running `sqlplus` I get the following error: ``` $ sqlplus Error 6 initializing SQL*Plus SP2-0667: Message file sp1<lang>.msb not found SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory ``` The instantclient-sqlplus formula has a special case for MacOS Catalina. Setting the special case for Catalina or later versions fixes the error and `sqlplus` can run.
diff --git a/config/initializers/delayed_job_config.rb b/config/initializers/delayed_job_config.rb index abc1234..def5678 100644 --- a/config/initializers/delayed_job_config.rb +++ b/config/initializers/delayed_job_config.rb @@ -3,4 +3,4 @@ Delayed::Worker.sleep_delay = 60 Delayed::Worker.max_attempts = 25 Delayed::Worker.max_run_time = 5.minutes -Delayed::Worker.logger = Rails.logger+Delayed::Worker.logger = Logger.new("#{Rails.root}/log/delayed_jobs.log")
Use separate logger for job worker.
diff --git a/shibui.gemspec b/shibui.gemspec index abc1234..def5678 100644 --- a/shibui.gemspec +++ b/shibui.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| - s.version = "0.0.1" + s.version = "0.0.1.alpha" s.date = "2012-03-08" s.name = "shibui" @@ -8,7 +8,7 @@ s.summary = %q{The Heroku styleguide harnessing the power of Compass.} s.description = %q{The Heroku styleguide harnessing the power of Compass.} s.email = "max@heroku.com" - s.homepage = "http://heroku.github.com/shibui" + s.homepage = "https://github.com/heroku/shibui" s.files = %w(Readme.md) s.files += Dir.glob("lib/**/*.*")
Update gemspec for initial alpha release
diff --git a/app/inputs/array_input.rb b/app/inputs/array_input.rb index abc1234..def5678 100644 --- a/app/inputs/array_input.rb +++ b/app/inputs/array_input.rb @@ -1,6 +1,7 @@ class ArrayInput < SimpleForm::Inputs::StringInput include ActionView::Helpers::TagHelper include ActionView::Context + include ActiveSupport::Inflector TEXT_FIELD_CLASSES = "text optional array-element" @@ -37,7 +38,7 @@ def add_field_html <<-HTML.html_safe - <a href="#" onclick="add_field()" class="add">Add URL</a> + <a href="#" onclick="add_field()" class="add">#{add_text}</a> <script> function add_field(e) { @@ -53,4 +54,12 @@ </script> HTML end + + def add_text + singularize( + humanize( + "Add #{attribute_name}" + ) + ) + end end
Improve array input "add" button text
diff --git a/app/jobs/retract_tweet.rb b/app/jobs/retract_tweet.rb index abc1234..def5678 100644 --- a/app/jobs/retract_tweet.rb +++ b/app/jobs/retract_tweet.rb @@ -9,6 +9,12 @@ @queue = :retract_tweets def self.perform(tweet_id) + # you never liked this tweet + Favorite.by_tweet_id.key(tweet_id).each do |favorite| + favorite.destroy + end + + # you never saw this tweet on your timeline TimelineEntry.by_tweet_id.key(tweet_id).each do |entry| entry.destroy end
Delete favorites for a deleted tweet.
diff --git a/worker_host/sudo/recipes/default.rb b/worker_host/sudo/recipes/default.rb index abc1234..def5678 100644 --- a/worker_host/sudo/recipes/default.rb +++ b/worker_host/sudo/recipes/default.rb @@ -31,7 +31,7 @@ end node['sudo']['users'].each do |user| - file "/etc/sudoers.d/90-user-#{user}" do + file "/etc/sudoers.d/90-user-#{user['name']}" do content <<-EOF.gsub(/^\s+> /, '') # # Managed by Chef on #{node.name}, thanks! <3 <3 <3 > # User #{user} may gain root priveleges, woop!
Correct sudoers filename to use sudo username
diff --git a/template.rb b/template.rb index abc1234..def5678 100644 --- a/template.rb +++ b/template.rb @@ -3,7 +3,8 @@ gem 'logstash-event', '~> 1.2.02' environment 'config.logger = Logger.new(STDOUT)' -environment 'config.lograge.enabled = true' -environment 'config.lograge.formatter = Lograge::Formatters::Logstash.new' + +environment 'config.lograge.enabled = true', env: :production +environment 'config.lograge.formatter = Lograge::Formatters::Logstash.new', env: :production environment 'config.web_console.whitelisted_ips = "172.0.0.0/8" if defined?(WebConsole)', env: :development
Disable lograge in non production environments
diff --git a/Library/Homebrew/formula_test.rb b/Library/Homebrew/formula_test.rb index abc1234..def5678 100644 --- a/Library/Homebrew/formula_test.rb +++ b/Library/Homebrew/formula_test.rb @@ -41,3 +41,12 @@ end end end + +class CommentedTemplateCode <Test::Unit::TestCase + def test_for_commented_out_cmake + Dir["#{HOMEBREW_PREFIX}/Library/Formula/*.rb"].each do |f| + result = `grep "# depends_on 'cmake'" "#{f}"`.strip + assert_equal('', result, "Commented template code still in #{f}") + end + end +end
Add formula test that looks for commented-out template code.
diff --git a/Library/Homebrew/test/formula_test.rb b/Library/Homebrew/test/formula_test.rb index abc1234..def5678 100644 --- a/Library/Homebrew/test/formula_test.rb +++ b/Library/Homebrew/test/formula_test.rb @@ -39,4 +39,12 @@ assert_equal('', result, "--prefix is incorrectly single-quoted in #{f}") end end + + def test_for_crufy_sourceforge_url + # Don't specify mirror for SourceForge downloads + Formulary.paths.each do |f| + result = `grep "\?use_mirror=" "#{f}"`.strip + assert_equal('', result, "Remove 'use_mirror' from url for #{f}") + end + end end
Add formula check for crufy SourceForge URLs.
diff --git a/app/services/payment_income.rb b/app/services/payment_income.rb index abc1234..def5678 100644 --- a/app/services/payment_income.rb +++ b/app/services/payment_income.rb @@ -8,7 +8,6 @@ res = income.save res = create_ledger && res res = create_interest && res - res = ledger.save && res unless res # TODO set_errors
Save only the interest when set
diff --git a/db/ar_persistence_config.rb b/db/ar_persistence_config.rb index abc1234..def5678 100644 --- a/db/ar_persistence_config.rb +++ b/db/ar_persistence_config.rb @@ -18,6 +18,8 @@ def create_manager ActiveRecord::Base.establish_connection(connection_info) + ActiveRecord::Migration.verbose = false + ActiveRecord::Migrator.up 'db/migrate' ARPersistenceManager.new end
Make PersistenceManager run ActiveRecord migrations
diff --git a/spec/controllers/members_controller_spec.rb b/spec/controllers/members_controller_spec.rb index abc1234..def5678 100644 --- a/spec/controllers/members_controller_spec.rb +++ b/spec/controllers/members_controller_spec.rb @@ -10,11 +10,20 @@ end describe "GET 'show'" do - it "returns http success" do - @member = FactoryGirl.create :member - get 'show', :id => @member.membership_number + + it "returns http success if member is active" do + member = FactoryGirl.create :member, :cached_active => true + get 'show', :id => member.membership_number response.should be_success end + + it "returns 404 if member is not active" do + member = FactoryGirl.create :member, :cached_active => false + expect { + get 'show', :id => member.membership_number + }.to raise_error(ActiveRecord::RecordNotFound) + end + end end
Update tests for active flags
diff --git a/spec/lob/resources/us_verifications_spec.rb b/spec/lob/resources/us_verifications_spec.rb index abc1234..def5678 100644 --- a/spec/lob/resources/us_verifications_spec.rb +++ b/spec/lob/resources/us_verifications_spec.rb @@ -20,7 +20,7 @@ result["recipient"].must_equal(@sample_params[:recipient]) result["primary_line"].must_equal(@sample_params[:primary_line]) - result["last_line"].must_equal("SAN FRANCISCO CA 94107-1728") + result["last_line"].must_equal("SAN FRANCISCO CA 94107-1234") end end
fix(test): Fix test to pass build
diff --git a/lib/tasks/deployment/20191114084623_archivee_to_close.rake b/lib/tasks/deployment/20191114084623_archivee_to_close.rake index abc1234..def5678 100644 --- a/lib/tasks/deployment/20191114084623_archivee_to_close.rake +++ b/lib/tasks/deployment/20191114084623_archivee_to_close.rake @@ -0,0 +1,15 @@+namespace :after_party do + desc 'Deployment task: archivee_to_close' + task archivee_to_close: :environment do + puts "Running deploy task 'archivee_to_close'" + + Procedure.where(aasm_state: :archivee).update_all(aasm_state: :close) + Procedure.where(aasm_state: :close, closed_at: nil).find_each do |procedure| + procedure.update_column(:closed_at, procedure.archived_at) + end + + # Update task as completed. If you remove the line below, the task will + # run with every deploy (or every time you call after_party:run). + AfterParty::TaskRecord.create version: '20191114084623' + end +end
Migrate procedures archivee to close
diff --git a/merb-gen/app_generators/merb/templates/spec/spec_helper.rb b/merb-gen/app_generators/merb/templates/spec/spec_helper.rb index abc1234..def5678 100644 --- a/merb-gen/app_generators/merb/templates/spec/spec_helper.rb +++ b/merb-gen/app_generators/merb/templates/spec/spec_helper.rb @@ -2,6 +2,8 @@ require 'merb-core' require 'spec' # Satisfies Autotest and anyone else not using the Rake tasks +# this loads all plugins required in your init file so don't add them +# here again, Merb will do it for you Merb.start_environment(:testing => true, :adapter => 'runner', :environment => ENV['MERB_ENV'] || 'test') Spec::Runner.configure do |config|
Add a note on plugins loading to generated spec helper.
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index abc1234..def5678 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -29,6 +29,6 @@ # Not found handler def not_found - render(:status => 404) + redirect_to('/404') end end
Handle 404 rails way (static).
diff --git a/app/controllers/newsletters_controller.rb b/app/controllers/newsletters_controller.rb index abc1234..def5678 100644 --- a/app/controllers/newsletters_controller.rb +++ b/app/controllers/newsletters_controller.rb @@ -14,7 +14,7 @@ end def raw - token = params[:token].split("+").first + token = EmailNewsletter.token(full_token) if AuthenticationToken.newsletters.active.where(token: token).exists? NewsletterReceiver.perform_async(params[:token], decoded(request.body.read)) end
Switch to shared token parser.
diff --git a/app/models/fluentd/setting/out_forward.rb b/app/models/fluentd/setting/out_forward.rb index abc1234..def5678 100644 --- a/app/models/fluentd/setting/out_forward.rb +++ b/app/models/fluentd/setting/out_forward.rb @@ -4,6 +4,10 @@ include Fluentd::Setting::Plugin register_plugin("output", "forward") + + config_section :secondary do + config_param :path, :string + end def self.initial_params {
Use out_file as secondary output Signed-off-by: Kenji Okimoto <7a4b90a0a1e6fc688adec907898b6822ce215e6c@clear-code.com>
diff --git a/app/models/spree/credit_card_decorator.rb b/app/models/spree/credit_card_decorator.rb index abc1234..def5678 100644 --- a/app/models/spree/credit_card_decorator.rb +++ b/app/models/spree/credit_card_decorator.rb @@ -1,3 +1,6 @@ Spree::CreditCard.class_eval do attr_accessor :name + unless Rails::VERSION::MAJOR == 4 + attr_accessible :name + end end
Add attr_accessible to credit card name
diff --git a/test/omniauth/strategies/backlog_test.rb b/test/omniauth/strategies/backlog_test.rb index abc1234..def5678 100644 --- a/test/omniauth/strategies/backlog_test.rb +++ b/test/omniauth/strategies/backlog_test.rb @@ -2,11 +2,14 @@ class TestOmniAuthBacklogWithSiteId < StrategyTestCase - - def test_site_is_based_from_space_id + def setup + super @options = { :site_id => 'yourspaceid' } + end + + def test_site_is_based_from_space_id assert_equal 'https://yourspaceid.backlog.jp', strategy.client.site end @@ -14,31 +17,24 @@ class TestOmniAuthBacklogWithSite < StrategyTestCase - - def test_it_has_the_correct_site_from_options + def setup + super @options = { :client_options => { :site => 'https://yourspaceid.backlog.jp' } } + end + + def test_it_has_the_correct_site_from_options assert_equal 'https://yourspaceid.backlog.jp', strategy.client.site end def test_it_has_the_correct_authorize_url_with_site_from_options - @options = { - :client_options => { - :site => 'https://yourspaceid.backlog.jp' - } - } assert_equal 'https://yourspaceid.backlog.jp/OAuth2AccessRequest.action', strategy.client.authorize_url end def test_it_has_the_correct_token_url_with_site_from_options - @options = { - :client_options => { - :site => 'https://yourspaceid.backlog.jp' - } - } assert_equal 'https://yourspaceid.backlog.jp/api/v2/oauth2/token', strategy.client.token_url end
Refactor (set testing options in setup).
diff --git a/core/exception/interrupt_spec.rb b/core/exception/interrupt_spec.rb index abc1234..def5678 100644 --- a/core/exception/interrupt_spec.rb +++ b/core/exception/interrupt_spec.rb @@ -29,7 +29,7 @@ sleep rescue Interrupt => e e.signo.should == Signal.list["INT"] - e.signm.should == "" + ["", "Interrupt"].should.include?(e.message) end end end
Allow a message for the Interrupt exception from SIGINT
diff --git a/app/controllers/api/v1/search_controller.rb b/app/controllers/api/v1/search_controller.rb index abc1234..def5678 100644 --- a/app/controllers/api/v1/search_controller.rb +++ b/app/controllers/api/v1/search_controller.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true class Api::V1::SearchController < Api::BaseController - RESULTS_LIMIT = 5 + RESULTS_LIMIT = 10 before_action -> { doorkeeper_authorize! :read } before_action :require_user!
Raise search results count to 10 for test reference: https://mastodon.xyz/users/lx/updates/278054
diff --git a/app/controllers/cms/resources_controller.rb b/app/controllers/cms/resources_controller.rb index abc1234..def5678 100644 --- a/app/controllers/cms/resources_controller.rb +++ b/app/controllers/cms/resources_controller.rb @@ -1,6 +1,15 @@ module Cms class ResourcesController < ApplicationController + before_filter :set_resource + def index + @entries = @resource.all end + + private + + def set_resource + @resource = params[:controller].classify.safe_constantize + end end end
Add index action for resources
diff --git a/app/controllers/pages/uptimes_controller.rb b/app/controllers/pages/uptimes_controller.rb index abc1234..def5678 100644 --- a/app/controllers/pages/uptimes_controller.rb +++ b/app/controllers/pages/uptimes_controller.rb @@ -10,11 +10,11 @@ @end_date = Date.parse(params[:end]).end_of_day if @type == 'point' - result = UptimeMetrics.select("mean(value) * 100 as value").by_page(params[:page_id]).where(time: @start_date..@end_date) + result = UptimeMetrics.select("mean(value) as value").by_page(params[:page_id]).where(time: @start_date..@end_date) else nbDays = (@end_date - @start_date).to_i / 86400 interval = nbDays <= 1 ? '1h' : '1d' - result = UptimeMetrics.select("mean(value) * 100 as value").by_page(params[:page_id]).where(time: @start_date..@end_date).time(interval).fill(:none) + result = UptimeMetrics.select("mean(value) as value").by_page(params[:page_id]).where(time: @start_date..@end_date).time(interval).fill(:none) end render json: result end
Remove uptime multiplied by 100
diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index abc1234..def5678 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -1,4 +1,13 @@ class RegistrationsController < Devise::RegistrationsController + + def update_resource(resource, params) + if current_user.provider == "facebook" + params.delete("current_password") + resource.update_without_password(params) + else + resource.update_with_password(params) + end + end protected @@ -13,4 +22,5 @@ dashboard_path end + end
Implement code to allow user who sign in with Facebook to not need a password to update their profile
diff --git a/app/controllers/spree/wished_products_controller.rb b/app/controllers/spree/wished_products_controller.rb index abc1234..def5678 100644 --- a/app/controllers/spree/wished_products_controller.rb +++ b/app/controllers/spree/wished_products_controller.rb @@ -19,7 +19,7 @@ def update @wished_product = Spree::WishedProduct.find(params[:id]) - @wished_product.update_attributes(params[:wished_product]) + @wished_product.update_attributes(wished_product_attibutes) respond_with(@wished_product) do |format| format.html { redirect_to wishlist_url(@wished_product.wishlist) } @@ -38,7 +38,7 @@ private def wished_product_attributes - params.require(:wished_product).permit(:variant_id) + params.require(:wished_product).permit(:variant_id, :wishlist_id) end end
Fix strong parameter in update action
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index abc1234..def5678 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,6 +1,17 @@ class ApplicationController < ActionController::Base protect_from_forgery + + layout :layout_by_resource + rescue_from CanCan::AccessDenied do |exception| redirect_to root_path, :alert => exception.message end + + protected + + def layout_by_resource + if devise_controller? + 'admin/application' + end + end end
Use admin layout for login form
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index abc1234..def5678 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -10,8 +10,7 @@ end def require_login - return true if logged_in? - redirect_to("/login") + raise QA::NotLoggedIn unless current_user.present? end def login(user)
Rewrite require_login to use QA::NotLoggedIn
diff --git a/core/random/bytes_spec.rb b/core/random/bytes_spec.rb index abc1234..def5678 100644 --- a/core/random/bytes_spec.rb +++ b/core/random/bytes_spec.rb @@ -1,4 +1,4 @@-# -*- encoding: us-ascii -*- +# -*- encoding: binary -*- require File.expand_path('../../../spec_helper', __FILE__) describe "Random#bytes" do
Fix magic encoding to avoid utf-8 conflicts
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index abc1234..def5678 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -3,23 +3,23 @@ # For APIs, you may want to use :null_session instead. protect_from_forgery with: :exception - # Add this before filter to force CAS Authentication on all controllers + actions - before_filter CASClient::Frameworks::Rails::Filter, unless: :skip_login? + # Add this before action to force CAS Authentication on all controllers + actions + before_action CASClient::Frameworks::Rails::Filter, unless: :skip_login? - # Add this before filter to set a local variable for the current user from CAS session - before_filter :getMe + # Add this before action to set a local variable for the current user from CAS session + before_action :getMe protected def getMe - @me = User.find_or_create_by(netid: session[:cas_user] ) - if !@me + current_user = User.find_or_create_by(netid: session[:cas_user] ) + if !current_user redirect_to :root return false end end - # hack for skip_before_filter with CAS + # hack for skip_before_action with CAS # overwrite this method (with 'true') in any controller to skip CAS auth def skip_login? false
Rename local variable, before_action instead
diff --git a/app/controllers/letsencrypt_controller.rb b/app/controllers/letsencrypt_controller.rb index abc1234..def5678 100644 --- a/app/controllers/letsencrypt_controller.rb +++ b/app/controllers/letsencrypt_controller.rb @@ -1,5 +1,7 @@ class LetsencryptController < ApplicationController def verify - render text: '-Pk_eaIGfnFWuM5fv8n3t9kFCbM-EfjA-IqPO_PfVfE.HGKAemL2fUjIRadTuQf-sqPIqvo2JUZKqjZzg1u2D0U' + if params[:id] == '-Pk_eaIGfnFWuM5fv8n3t9kFCbM-EfjA-IqPO_PfVfE' + render text: '-Pk_eaIGfnFWuM5fv8n3t9kFCbM-EfjA-IqPO_PfVfE.HGKAemL2fUjIRadTuQf-sqPIqvo2JUZKqjZzg1u2D0U' + end end end
Use a new letsencrypt key.
diff --git a/app/helpers/app_frame/bootstrap_helper.rb b/app/helpers/app_frame/bootstrap_helper.rb index abc1234..def5678 100644 --- a/app/helpers/app_frame/bootstrap_helper.rb +++ b/app/helpers/app_frame/bootstrap_helper.rb @@ -18,6 +18,12 @@ map[type.to_sym] || type end + def icon(key, options = {}) + css_class = "icon-#{key}" + css_class += " icon-white" if options[:invert] + content_tag(:i, '', :class => css_class).html_safe + end + def page_header(title, &block) content = "".html_safe content += content_tag(:div, capture(&block), :class => 'page-actions') if block_given?
Add a bootstrap helper for icons
diff --git a/lib/haml/sass_rails_filter.rb b/lib/haml/sass_rails_filter.rb index abc1234..def5678 100644 --- a/lib/haml/sass_rails_filter.rb +++ b/lib/haml/sass_rails_filter.rb @@ -4,7 +4,11 @@ # Rails's asset helpers to be used inside Haml Sass filter. class SassRailsTemplate < ::Sass::Rails::SassTemplate def render(scope=Object.new, locals={}, &block) - scope = ::Rails.application.assets.context_class.new(::Rails.application.assets, "/", "/") + scope = ::Rails.application.assets.context_class.new( + environment: ::Rails.application.assets, + filename: "/", + metadata: {} + ) super end @@ -30,4 +34,4 @@ register_tilt_filter "Sass", :extend => "Css", :template_class => SassRailsTemplate register_tilt_filter "Scss", :extend => "Css", :template_class => ScssRailsTemplate end -end+end
Make inline sass work with sprockets 3.x - Fixes #844 - Sprockets 3 changed Sprockets::Context#initialize to take a hash argument - This makes haml incompatible with inline sass for sprockets 2.x but since the last sprockets 2.x release was in 2014 this is probably acceptable
diff --git a/lib/peoplesoft_models/base.rb b/lib/peoplesoft_models/base.rb index abc1234..def5678 100644 --- a/lib/peoplesoft_models/base.rb +++ b/lib/peoplesoft_models/base.rb @@ -2,6 +2,8 @@ # that a developer is using to connect to PeopleSoft tables. All generated # models inherit from this class instead of ActiveRecord::Base. # -class PeoplesoftModels::Base < ActiveRecord::Base - self.abstract_class = true +module PeoplesoftModels + class Base < ActiveRecord::Base + self.abstract_class = true + end end
Make PeoplesoftModels::Base nesting consistent with other classes
diff --git a/lib/podio/models/extension.rb b/lib/podio/models/extension.rb index abc1234..def5678 100644 --- a/lib/podio/models/extension.rb +++ b/lib/podio/models/extension.rb @@ -1,6 +1,9 @@ class Podio::Extension < ActivePodio::Base property :name, :string property :installation_url, :string + property :status, :string + + has_one :user, :class => 'User' class << self def create(attributes, options={})
Add user relation and status property
diff --git a/lib/soapbox_comment_linker.rb b/lib/soapbox_comment_linker.rb index abc1234..def5678 100644 --- a/lib/soapbox_comment_linker.rb +++ b/lib/soapbox_comment_linker.rb @@ -48,7 +48,8 @@ } ) - return response['id'] if response.code == 201 + fail "Uh oh. Response was #{response.code}" unless response.code == 201 + response['id'] end def config
Comment linker dies on failure, rather than carrying on like a trooper.
diff --git a/lib/tasks/setup_exchange.rake b/lib/tasks/setup_exchange.rake index abc1234..def5678 100644 --- a/lib/tasks/setup_exchange.rake +++ b/lib/tasks/setup_exchange.rake @@ -1,6 +1,6 @@ desc "Create RabbitMQ exchanges" task setup_exchange: :environment do - config = YAML.load_file(Rails.root.join("config/rabbitmq.yml"))[Rails.env].symbolize_keys + config = Rails.application.config_for(:rabbitmq) bunny = Bunny.new(ENV["RABBITMQ_URL"]) channel = bunny.start.create_channel
Use Rails method to get RabbitMQ config The previous implementation isn't compatible with Ruby 3.1 due to the upgrade of Psych (YAML library) to 4.0 [1] in stdlib and the change in `load_file`. A simpler way to replace this is to use the Rails built in method to load a config file. [1]: https://github.com/ruby/psych/pull/488
diff --git a/lib/district_cn.rb b/lib/district_cn.rb index abc1234..def5678 100644 --- a/lib/district_cn.rb +++ b/lib/district_cn.rb @@ -24,6 +24,8 @@ def search(text,limit=10) results = [] + return results if text.empty? + list.each do |id,name| break if results.size.eql?(limit)
Fix return all cities when searching empty text
diff --git a/lib/buildr_plus/features/repositories.rb b/lib/buildr_plus/features/repositories.rb index abc1234..def5678 100644 --- a/lib/buildr_plus/features/repositories.rb +++ b/lib/buildr_plus/features/repositories.rb @@ -22,7 +22,6 @@ if BuildrPlus::FeatureManager.activated?(:geolatte) Buildr.repositories.remote.unshift('http://download.osgeo.org/webdav/geotools') end - Buildr.repositories.remote.unshift('http://repo.ffm.vic.gov.au/repository/ffm') end end end
Remove reference to decomissioned repository
diff --git a/lib/sepa/banks/danske/danske_response.rb b/lib/sepa/banks/danske/danske_response.rb index abc1234..def5678 100644 --- a/lib/sepa/banks/danske/danske_response.rb +++ b/lib/sepa/banks/danske/danske_response.rb @@ -25,5 +25,13 @@ @ca_certificate ||= extract_cert(doc, 'CACert', DANSKE_PKI) end + private + + def find_node_by_uri(uri) + node = doc.at("[xml|id='#{uri}']") + node.at('xmlns|Signature', xmlns: DSIG).remove + node + end + end end
Add find_node_by_uri to DanskeResponse since they use a slightly different method from identifying xml nodes
diff --git a/stripe.gemspec b/stripe.gemspec index abc1234..def5678 100644 --- a/stripe.gemspec +++ b/stripe.gemspec @@ -1,6 +1,6 @@ $:.unshift(File.join(File.dirname(__FILE__), 'lib')) -require File.expand_path('../lib/stripe/version', __FILE__) +require 'stripe/version' spec = Gem::Specification.new do |s| s.name = 'stripe' @@ -21,10 +21,8 @@ s.add_development_dependency('test-unit') s.add_development_dependency('rake') - s.files = %w{ - bin/stripe-console - lib/stripe.rb - lib/stripe/version.rb - lib/data/ca-certificates.crt - } + s.files = `git ls-files`.split("\n") + s.test_files = `git ls-files -- test/*`.split("\n") + s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } + s.require_paths = ['lib'] end
Update gemspec to dynamically select files
diff --git a/rubygems-compile.gemspec b/rubygems-compile.gemspec index abc1234..def5678 100644 --- a/rubygems-compile.gemspec +++ b/rubygems-compile.gemspec @@ -1,6 +1,6 @@ GEM_SPEC = Gem::Specification.new do |s| s.name = 'rubygems-compile' - s.version = '1.0.0' + s.version = '1.0.0beta' s.summary = 'A set of rubygems commands that interface with the MacRuby compiler' s.description = <<-EOS
Change version to beta for early release
diff --git a/bootstrap/recipes/configure.rb b/bootstrap/recipes/configure.rb index abc1234..def5678 100644 --- a/bootstrap/recipes/configure.rb +++ b/bootstrap/recipes/configure.rb @@ -18,3 +18,8 @@ end if File.file?(service_file) end end + +# reload consul +service 'consul' do + action :reload +end
Add consul reloading logic to reload service files of optional patterns.
diff --git a/script/lib/installers.rb b/script/lib/installers.rb index abc1234..def5678 100644 --- a/script/lib/installers.rb +++ b/script/lib/installers.rb @@ -5,7 +5,7 @@ safe_exec("pip", "install proselint", "-V") do puts "\t * Command 'pip' is not available" puts "\t * Installing 'pip' using 'easy_install' ..." - pretty_print(`sudo easy_install pip`, "easy_install: ") + pretty_print(`easy_install pip`, "easy_install: ") end end
Remove sudo when calling easy_install
diff --git a/spec/models/embeddable/multiple_choice_question_spec.rb b/spec/models/embeddable/multiple_choice_question_spec.rb index abc1234..def5678 100644 --- a/spec/models/embeddable/multiple_choice_question_spec.rb +++ b/spec/models/embeddable/multiple_choice_question_spec.rb @@ -10,6 +10,7 @@ @multichoice.pages << @page @multichoice.user = @user @multichoice.save + @multichoice.create_default_choices @multichoice.reload end
Update multiple choice test to reflect that we're no longer auto-creating default choices.
diff --git a/app/services/upload_sanitizer.rb b/app/services/upload_sanitizer.rb index abc1234..def5678 100644 --- a/app/services/upload_sanitizer.rb +++ b/app/services/upload_sanitizer.rb @@ -1,4 +1,4 @@-# frozen_string_literal: true +# frozen_string_literal: false # Formats uploaded files to UTF-8 encoding and strips unexpected BOM characters. # Takes an open File object as input
Revert to false so strings can be mutated in this class
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 @@ -0,0 +1,10 @@+require 'rails_helper' + +describe ApplicationHelper, type: :helper do + it 'should return a different favicon in the dev environment' do + allow(Rails).to receive(:env).and_return('development') + expected_path = "/assets/images/#{Figaro.env.favicon_dev_file}" + expected_tag = favicon_link_tag expected_path + expect(logo_favicon_tag).to eq(expected_tag) + end +end
Add spec to test the development favicon in ApplicationHelper
diff --git a/spec/requests/admin/admin_ideas_spec.rb b/spec/requests/admin/admin_ideas_spec.rb index abc1234..def5678 100644 --- a/spec/requests/admin/admin_ideas_spec.rb +++ b/spec/requests/admin/admin_ideas_spec.rb @@ -14,9 +14,10 @@ end it "works! (now write some real specs)" do - # Run the generator again with the --webrat flag if you want to use webrat methods/matchers get admin_ideas_path response.status.should be(200) end end + + pending "expand Admin Idea request specs #{__FILE__}" end
Update Admin Idea request specs * Remove 'webrat' generation comment * Add pending message for further tests
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 @@ -28,6 +28,8 @@ @new_user['user']['user_id'] = 'landregistry' @new_user['user']['password'] = 'integration' insert_user(@new_user) - puts 'Creating title DN1000 with postcode PL9 8TB' - insert_title_with_owners + puts 'Creating 51 titles with postcode PL9 8TB' + 51.times do |i| + insert_title_with_number("DN100#{i}") + end end
Create additional test data at the end of integration run This will enable further diagnosis for elasticsearch matching issues without having to do formal releases to preview
diff --git a/config/initializers/timeout.rb b/config/initializers/timeout.rb index abc1234..def5678 100644 --- a/config/initializers/timeout.rb +++ b/config/initializers/timeout.rb @@ -1,2 +1,3 @@ # https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#timeout Rack::Timeout.timeout = 20 # seconds +Rack::Timeout::Logger.level = Logger::ERROR
Reduce the logs produced by Rack::Timeout
diff --git a/app/controllers/categories_controller.rb b/app/controllers/categories_controller.rb index abc1234..def5678 100644 --- a/app/controllers/categories_controller.rb +++ b/app/controllers/categories_controller.rb @@ -1,10 +1,10 @@ class CategoriesController < ApplicationController def index - + @categories = Category.all end def new - + @category = Category.new end end
Create instance variables within the categories controller
diff --git a/app/controllers/news_items_controller.rb b/app/controllers/news_items_controller.rb index abc1234..def5678 100644 --- a/app/controllers/news_items_controller.rb +++ b/app/controllers/news_items_controller.rb @@ -1,9 +1,10 @@ class NewsItemsController < ApplicationController include NewsItemsHelper + before_filter :load_networks, :only => [:index, :search] + def index get_news_items - @networks = Network.all end def sort_options @@ -26,4 +27,8 @@ model = model_name.classify.constantize @news_items = model.with_sort(params[:sort_by]).by_network(current_network).paginate(:page => params[:page]) end + + def load_networks + @networks = Network.all + end end
Load networks for browsing and searching news items
diff --git a/config/initializers/cookies_serializer.rb b/config/initializers/cookies_serializer.rb index abc1234..def5678 100644 --- a/config/initializers/cookies_serializer.rb +++ b/config/initializers/cookies_serializer.rb @@ -2,4 +2,4 @@ # Specify a serializer for the signed and encrypted cookie jars. # Valid options are :json, :marshal, and :hybrid. -Rails.application.config.action_dispatch.cookies_serializer = :marshal +Rails.application.config.action_dispatch.cookies_serializer = :json
Switch the cookie serializer to json To avoid any remote code execution issues with the marshal serializer. Not that they'll affect the content store, and internal application that to my knowledge doesn't use cookies... ¯\_(ツ)_/¯
diff --git a/foundation-center.gemspec b/foundation-center.gemspec index abc1234..def5678 100644 --- a/foundation-center.gemspec +++ b/foundation-center.gemspec @@ -8,9 +8,9 @@ spec.version = Foundation::Center::VERSION spec.authors = ["Dan Porter"] spec.email = ["wolfpakz@gmail.com"] - spec.description = %q{TODO: Write a gem description} - spec.summary = %q{TODO: Write a gem summary} - spec.homepage = "" + spec.description = %q{A Ruby interface to the Foundation Center grant recipients API} + spec.summary = %q{Provides a simple interface for fetching information about grant recipients and the grants they've received.} + spec.homepage = "http://github.com/wolfpakz/foundation-center" spec.license = "MIT" spec.files = `git ls-files`.split($/)
Add description and summary to gemspec
diff --git a/app/models/renalware/accesses/patient.rb b/app/models/renalware/accesses/patient.rb index abc1234..def5678 100644 --- a/app/models/renalware/accesses/patient.rb +++ b/app/models/renalware/accesses/patient.rb @@ -30,7 +30,7 @@ scope :with_profile, lambda { joins(<<-SQL) left outer join access_profiles on (access_profiles.patient_id = patients.id - and access_profiles.terminated_on is not null + and access_profiles.terminated_on is null and access_profiles.started_on <= current_date) left outer join access_types on access_types.id = access_profiles.type_id SQL
Fix sorting by access in HD MDM Correct an incorrect where clause - it was effectively sorting on the name of the last terminated access rather then the current one
diff --git a/0_code_wars/double_cola.rb b/0_code_wars/double_cola.rb index abc1234..def5678 100644 --- a/0_code_wars/double_cola.rb +++ b/0_code_wars/double_cola.rb @@ -0,0 +1,38 @@+# http://www.codewars.com/kata/551dd1f424b7a4cdae0001f0 +# --- iteration 1 --- +def whoIsNext(names, n) + cutoff = prev_cutoff(n, names.length) + names[(n-1-(cutoff*names.length)).fdiv(cutoff + 1).floor] +end + +def prev_cutoff(n, length) + i = 0 + current_cutoff = 0 + old_cutoff = 0 + while current_cutoff*length <= n do + old_cutoff = current_cutoff + current_cutoff = ((2 ** (i+1)) - 1) + i += 1 + end + old_cutoff +end + +# --- iteration 2 --- +def whoIsNext(names, r) + r, len = r-1, names.length + until r < len + r -= len + r /= 2 + end + names[r] +end + +# --- iteration 3 --- +def whoIsNext(names, r) + r, len = r-1, names.length + until r < len + r = (r - len) / 2 + end + names[r] +end +
Add code wars (5) - double cola
diff --git a/Casks/keyboard-maestro.rb b/Casks/keyboard-maestro.rb index abc1234..def5678 100644 --- a/Casks/keyboard-maestro.rb +++ b/Casks/keyboard-maestro.rb @@ -3,4 +3,5 @@ homepage 'http://www.keyboardmaestro.com/' version 'latest' no_checksum + link 'Keyboard Maestro.app' end
Add link to Keyboard Maestro
diff --git a/vp_to_ki.rb b/vp_to_ki.rb index abc1234..def5678 100644 --- a/vp_to_ki.rb +++ b/vp_to_ki.rb @@ -22,7 +22,7 @@ File.open(ARGV[0]) do |file| $doc = Nokogiri::XML(file) $project_name = $doc.>('Project').first['name'] - root_state = State.new($doc.>('Project > Models'), nil, 0) # recursively builds state tree + root_state = State.new($doc.>('Project > Models').first, nil, 0) # recursively builds state tree Transition.find_transitions Printer.print_statechart(root_state) end
Use Node instead of NodeSet for root state
diff --git a/lib/backlog_kit/response/file_parser.rb b/lib/backlog_kit/response/file_parser.rb index abc1234..def5678 100644 --- a/lib/backlog_kit/response/file_parser.rb +++ b/lib/backlog_kit/response/file_parser.rb @@ -20,7 +20,7 @@ encode = match_data[1] filename = match_data[2] return filename if encode.empty? - URI.decode_www_form(filename, encode).flatten.first + URI.decode_www_form_component(filename, encode) end def content_disposition
Fix unexpected ArgumentError when decode URL-encoded filename on Ruby 2.0.0
diff --git a/lib/brakeman/processors/lib/processor_helper.rb b/lib/brakeman/processors/lib/processor_helper.rb index abc1234..def5678 100644 --- a/lib/brakeman/processors/lib/processor_helper.rb +++ b/lib/brakeman/processors/lib/processor_helper.rb @@ -10,7 +10,7 @@ def process_all! exp exp.each_with_index do |e, i| if sexp? e - exp[i] = e + exp[i] = process e end end
Fix horrible negligence in process_all!
diff --git a/week-6/gps.rb b/week-6/gps.rb index abc1234..def5678 100644 --- a/week-6/gps.rb +++ b/week-6/gps.rb @@ -0,0 +1,42 @@+# Your Names +# 1) +# 2) + +# We spent [#] hours on this challenge. + +# Bakery Serving Size portion calculator. + +def serving_size_calc(item_to_make, num_of_ingredients) + library = {"cookie" => 1, "cake" => 5, "pie" => 7} + error_counter = 3 + + library.each do |food| + if library[food] != library[item_to_make] + error_counter += -1 + end + end + + if error_counter > 0 + raise ArgumentError.new("#{item_to_make} is not a valid input") + end + + serving_size = library.values_at(item_to_make)[0] + remaining_ingredients = num_of_ingredients % serving_size + + case remaining_ingredients + when 0 + return "Calculations complete: Make #{num_of_ingredients / serving_size} of #{item_to_make}" + else + return "Calculations complete: Make #{num_of_ingredients / serving_size} of #{item_to_make}, you have #{remaining_ingredients} leftover ingredients. Suggested baking items: TODO: MAKE THIS FEATURE" + end +end + +p serving_size_calc("pie", 7) +p serving_size_calc("pie", 8) +p serving_size_calc("cake", 5) +p serving_size_calc("cake", 7) +p serving_size_calc("cookie", 1) +p serving_size_calc("cookie", 10) +p serving_size_calc("THIS IS AN ERROR", 5) + +# Reflection
Add content to GPS file
diff --git a/test/helper.rb b/test/helper.rb index abc1234..def5678 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -1,15 +1,21 @@ $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + "/../lib")) + +require 'coveralls' +Coveralls.wear! + +SimpleCov.start do + project_name "Ork" + command_name "Protest" + + add_filter "/test/" +end require "rubygems" require "protest" require "ork" - -# require 'coveralls' -# Coveralls.wear! +require 'riak/test_server' Riak.disable_list_keys_warnings = true - -require 'riak/test_server' def test_server $test_server ||= begin
Add coveralls gem and setup SimpleCov
diff --git a/spec/factories/kalibro_configurations.rb b/spec/factories/kalibro_configurations.rb index abc1234..def5678 100644 --- a/spec/factories/kalibro_configurations.rb +++ b/spec/factories/kalibro_configurations.rb @@ -15,10 +15,5 @@ name "Perl" description "Code metrics for Perl." end - - factory :public_kalibro_configuration do - name "Public Kalibro Configuration" - description "Public Configuration." - end end end
Remove unused factory for KalibroConfiguration
diff --git a/lib/file_data/formats/exif/exif_data.rb b/lib/file_data/formats/exif/exif_data.rb index abc1234..def5678 100644 --- a/lib/file_data/formats/exif/exif_data.rb +++ b/lib/file_data/formats/exif/exif_data.rb @@ -6,6 +6,18 @@ def initialize @hash = SECTIONS.each_with_object({}) { |pair, hash| hash[pair[0]] = {} } + + #Add some convenience methods to the image data + image_hash = @hash[0] + class << image_hash + def width + self[:Image_Structure_Width] + end + + def height + self[:Image_Structure_Length] + end + end end def add_tag(index, ifd_id, tag_id, tag_value)
Add some convenience methods to the image hash