diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/lib/sfn.rb b/lib/sfn.rb index abc1234..def5678 100644 --- a/lib/sfn.rb +++ b/lib/sfn.rb @@ -1,6 +1,7 @@ require 'sfn/version' require 'miasma' require 'bogo' +require 'sparkle_formation' module Sfn
Load sparkle_formation at initial load time
diff --git a/layervault_ruby_client.gemspec b/layervault_ruby_client.gemspec index abc1234..def5678 100644 --- a/layervault_ruby_client.gemspec +++ b/layervault_ruby_client.gemspec @@ -4,10 +4,10 @@ require 'layervault/version' Gem::Specification.new do |spec| - spec.name = "layervault_ruby_client" + spec.name = "layervault" spec.version = LayerVault::VERSION - spec.authors = ["John McDowall"] - spec.email = ["john@mcdowall.info"] + spec.authors = ["John McDowall", "Ryan LeFevre", "Kelly Sutton"] + spec.email = ["john@mcdowall.info", "ryan@layervault.com", "kelly@layervault.com"] spec.description = %q{The LayerVault Ruby API client.} spec.summary = %q{Provides Ruby native wrappers for the LayerVault API.} spec.homepage = ""
Change the name on this gem
diff --git a/spec/features/benchmark_executions_spec.rb b/spec/features/benchmark_executions_spec.rb index abc1234..def5678 100644 --- a/spec/features/benchmark_executions_spec.rb +++ b/spec/features/benchmark_executions_spec.rb @@ -5,6 +5,21 @@ feature 'Benchmark execution' do given(:user) { create(:user) } before { sign_in(user) } + + feature 'Listing' do + given(:e1) { create(:benchmark_execution) } + given(:e2) { create(:benchmark_execution) } + background do + e1.save! + e2.save! + visit benchmark_executions_path + end + + scenario 'Should show all benchmark executions' do + # -1 because of the header row + expect(find('.table').all('tr').size - 1).to eq 2 + end + end feature 'Showing a benchmark execution' do given(:benchmark_execution) { create(:benchmark_execution) }
Add listing benchmark executions spec
diff --git a/spec/jobs/create_user_defaults_job_spec.rb b/spec/jobs/create_user_defaults_job_spec.rb index abc1234..def5678 100644 --- a/spec/jobs/create_user_defaults_job_spec.rb +++ b/spec/jobs/create_user_defaults_job_spec.rb @@ -12,11 +12,13 @@ end context 'developers' do - let(:developer_type) { FactoryGirl.create(:type, slug: 'developer') } + let (:user) do + FactoryGirl.create(:user, types: [ + Type.first_or_create(slug: 'developer', name: 'Developer') + ]) + end it 'should create default developer skill categories' do - user = FactoryGirl.create(:user, types: [developer_type]) - CreateUserDefaultsJob.new().perform(user) ActsAsTenant.with_tenant(user) do
Tweak CreateUserDefaultsJobSpec to play kindly with seed data Signed-off-by: Max Fierke <0706025b2bbcec1ed8d64822f4eccd96314938d0@maxfierke.com>
diff --git a/test/unit/workers/asset_manager_attachment_metadata_update_worker_test.rb b/test/unit/workers/asset_manager_attachment_metadata_update_worker_test.rb index abc1234..def5678 100644 --- a/test/unit/workers/asset_manager_attachment_metadata_update_worker_test.rb +++ b/test/unit/workers/asset_manager_attachment_metadata_update_worker_test.rb @@ -4,24 +4,39 @@ extend Minitest::Spec::DSL let(:subject) { AssetManagerAttachmentMetadataUpdateWorker.new } + let(:attachment_data) { FactoryBot.create(:attachment_data) } test 'it uses the asset_migration queue' do assert_equal 'asset_migration', subject.class.queue end - [ - AssetManagerAttachmentAccessLimitedWorker, - AssetManagerAttachmentDeleteWorker, - AssetManagerAttachmentDraftStatusUpdateWorker, - AssetManagerAttachmentLinkHeaderUpdateWorker, - AssetManagerAttachmentRedirectUrlUpdateWorker, - AssetManagerAttachmentReplacementIdUpdateWorker - ].each do |worker| - let(:attachment_data) { FactoryBot.create(:attachment_data) } + test 'queues a job on the AssetManagerAttachmentMetadataUpdateWorker' do + AssetManagerAttachmentAccessLimitedWorker.expects(:perform_async).with(attachment_data.id) + subject.perform(attachment_data.id) + end - test "queues a job on the #{worker}" do - worker.expects(:perform_async).with(attachment_data.id) - subject.perform(attachment_data.id) - end + test 'queues a job on the AssetManagerAttachmentDeleteWorker' do + AssetManagerAttachmentDeleteWorker.expects(:perform_async).with(attachment_data.id) + subject.perform(attachment_data.id) + end + + test 'queues a job on the AssetManagerAttachmentDraftStatusUpdateWorker' do + AssetManagerAttachmentDraftStatusUpdateWorker.expects(:perform_async).with(attachment_data.id) + subject.perform(attachment_data.id) + end + + test 'queues a job on the AssetManagerAttachmentLinkHeaderUpdateWorker' do + AssetManagerAttachmentLinkHeaderUpdateWorker.expects(:perform_async).with(attachment_data.id) + subject.perform(attachment_data.id) + end + + test 'queues a job on the AssetManagerAttachmentRedirectUrlUpdateWorker' do + AssetManagerAttachmentRedirectUrlUpdateWorker.expects(:perform_async).with(attachment_data.id) + subject.perform(attachment_data.id) + end + + test 'queues a job on the AssetManagerAttachmentReplacementIdUpdateWorker' do + AssetManagerAttachmentReplacementIdUpdateWorker.expects(:perform_async).with(attachment_data.id) + subject.perform(attachment_data.id) end end
Split out tests into separate blocks In a subsequent commit I need to set some expectations on instances of the individual workers. This change makes it easier and clearer to do that.
diff --git a/app/controllers/dashboards_controller.rb b/app/controllers/dashboards_controller.rb index abc1234..def5678 100644 --- a/app/controllers/dashboards_controller.rb +++ b/app/controllers/dashboards_controller.rb @@ -8,7 +8,7 @@ @dashboard = {results_delivered: {}, percentage_delivered: {}, visits: {}} breakdowns.each do |symbol, time| - delivered = Result.where("recorded_on > ?", time).where.not(:delivery_id => nil).count + delivered = Result.where("recorded_on > ?", time).includes(:deliveries).where.not(:deliveries_results => {:result_id => nil}).count total = Result.where("recorded_on > ?", time).count @dashboard[:results_delivered][symbol] = delivered @dashboard[:percentage_delivered][symbol] = (100 * delivered.to_f / total).round(0)
Fix dashboard after change to use deliveries_results join table
diff --git a/lib/filepicker/rails/policy.rb b/lib/filepicker/rails/policy.rb index abc1234..def5678 100644 --- a/lib/filepicker/rails/policy.rb +++ b/lib/filepicker/rails/policy.rb @@ -4,10 +4,10 @@ module Filepicker module Rails class Policy - attr_accessor :expiry, :call, :handle, :maxsize, :minsize + attr_accessor :expiry, :call, :handle, :maxsize, :minsize, :path def initialize(options = {}) - [:expiry, :call, :handle, :maxsize, :minsize].each do |input| + [:expiry, :call, :handle, :maxsize, :minsize, :path].each do |input| send("#{input}=", options[input]) unless options[input].nil? end end @@ -26,7 +26,7 @@ @expiry ||= Time.now.to_i + ::Rails.application.config.filepicker_rails.default_expiry - [:expiry, :call, :handle, :maxsize, :minsize].each do |input| + [:expiry, :call, :handle, :maxsize, :minsize, :path].each do |input| hash[input] = send(input) unless send(input).nil? end @@ -34,4 +34,4 @@ end end end -end+end
Add support for new path option
diff --git a/config/initializers/gds_api.rb b/config/initializers/gds_api.rb index abc1234..def5678 100644 --- a/config/initializers/gds_api.rb +++ b/config/initializers/gds_api.rb @@ -1,2 +1,8 @@ require 'gds_api/base' +require 'gds_api/asset_manager' +require 'attachable' +require 'plek' + GdsApi::Base.logger = Logger.new(Rails.root.join("log/#{Rails.env}.api_client.log")) + +Attachable.asset_api_client = GdsApi::AssetManager.new(Plek.current.find('asset-manager'))
Initialize an asset manager api client
diff --git a/config/initializers/plugins.rb b/config/initializers/plugins.rb index abc1234..def5678 100644 --- a/config/initializers/plugins.rb +++ b/config/initializers/plugins.rb @@ -6,9 +6,3 @@ require 'noosfero/plugin/settings' require 'noosfero/plugin/spammable' Noosfero::Plugin.init_system if $NOOSFERO_LOAD_PLUGINS - -if Rails.env == 'development' && $NOOSFERO_LOAD_PLUGINS - ActionController::Base.send(:prepend_before_filter) do |controller| - Noosfero::Plugin.init_system - end -end
Remove plugin reload on development This is a known problem that will be fixed as described on http://noosfero.org/Development/ActionItem2932
diff --git a/lib/puppet/provider/mongodb.rb b/lib/puppet/provider/mongodb.rb index abc1234..def5678 100644 --- a/lib/puppet/provider/mongodb.rb +++ b/lib/puppet/provider/mongodb.rb @@ -1,3 +1,4 @@+require 'yaml' class Puppet::Provider::Mongodb < Puppet::Provider # Without initvars commands won't work. @@ -22,8 +23,9 @@ if mongorc_file cmd = mongorc_file + cmd end - - out = mongo([db, '--quiet', '--eval', cmd]) + config = YAML.load_file('/etc/mongod.conf') + port = config['net.port'] + out = mongo([db, '--quiet', '--port', port, '--eval', cmd]) out.gsub!(/ObjectId\(([^)]*)\)/, '\1') out
Fix the bug mongo js client fail to run under non-default port
diff --git a/core/fiber/resume_spec.rb b/core/fiber/resume_spec.rb index abc1234..def5678 100644 --- a/core/fiber/resume_spec.rb +++ b/core/fiber/resume_spec.rb @@ -5,13 +5,13 @@ describe "Fiber#resume" do it_behaves_like(:resume, :transfer) - + it "returns control to the calling Fiber if called from one" do fiber1 = Fiber.new { :fiber1 } fiber2 = Fiber.new { fiber1.resume; :fiber2 } fiber2.resume.should == :fiber2 end - + it "raises a FiberError if the Fiber has transfered control to another Fiber" do fiber1 = Fiber.new { true } fiber2 = Fiber.new { fiber1.transfer; Fiber.yield } @@ -23,7 +23,8 @@ it "executes the ensure clause" do fib = Fiber.new{ begin - Fiber.yield :begin + exit 0 + rescue SystemExit ensure :ensure end
Tweak execution flow to align the spec with the nature of the redmine issue.
diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index abc1234..def5678 100644 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -4,10 +4,13 @@ @backup_servers = BackupServer.accessible_by(current_ability).find(:all, :order => 'hostname') @running = BackupJob.running(:include => [:servers]).select{|j| can? :read, j} @failed = BackupJob.latest_problems(:include => [:servers]).select do | job | - joblist=job.server.backup_jobs.sort!{|j1,j2|j1.id <=> j2.id} - ( (joblist.last == job && job.status != 'queued') || - (job.status == 'queued' && joblist.last(2)[0] == job) - ) && can?( :read, job) + server=job.server + if server + joblist=job.server.backup_jobs.sort!{|j1,j2|j1.id <=> j2.id} + ( (joblist.last == job && job.status != 'queued') || + (job.status == 'queued' && joblist.last(2)[0] == job) + ) && can?( :read, job) + end end @queued = BackupJob.queued(:include => [:servers]).select{|j| can? :read, j} end
Handle a situation where a server is removed at an inappropriate time, and would cause a nil object dereference otherwise.
diff --git a/wannabe_bool.gemspec b/wannabe_bool.gemspec index abc1234..def5678 100644 --- a/wannabe_bool.gemspec +++ b/wannabe_bool.gemspec @@ -21,5 +21,5 @@ spec.add_development_dependency 'coveralls' spec.add_development_dependency 'rake' - spec.add_development_dependency 'rspec', '~> 3.5' + spec.add_development_dependency 'rspec', '~> 3.6' end
Update RSpec version to 3.6.0.
diff --git a/app/controllers/locations_controller.rb b/app/controllers/locations_controller.rb index abc1234..def5678 100644 --- a/app/controllers/locations_controller.rb +++ b/app/controllers/locations_controller.rb @@ -5,7 +5,7 @@ # @locations = Location.all # iterate through @locations and select the ones that are 500 m away @locations = Location.all - render json: @ + render json: @locations # pg has postgis extension # query for locations that are x miles away
Fix syntax error in index action of location controller
diff --git a/lib/travis/model/remote_log.rb b/lib/travis/model/remote_log.rb index abc1234..def5678 100644 --- a/lib/travis/model/remote_log.rb +++ b/lib/travis/model/remote_log.rb @@ -21,6 +21,7 @@ end def removed_by + return nil unless removed_by_id @removed_by ||= User.find(removed_by_id) end @@ -44,7 +45,7 @@ def to_json { 'log' => attributes.slice( - *%w(id content created_at job_id updated_at) + *%i(id content created_at job_id updated_at) ) }.to_json end
Break early when no user id is present; slice attributes with symbols
diff --git a/lib/valanga/difficulty/base.rb b/lib/valanga/difficulty/base.rb index abc1234..def5678 100644 --- a/lib/valanga/difficulty/base.rb +++ b/lib/valanga/difficulty/base.rb @@ -1,6 +1,14 @@ module Valanga module Difficulty class Base + def name + groovin.name || collete.name + end + + def artist + groovin.artist || collete.artist + end + def rank groovin.rank || collete.rank end
Set music name and music artist to Difficulty::Base
diff --git a/app/models/contenticus/layout_parser.rb b/app/models/contenticus/layout_parser.rb index abc1234..def5678 100644 --- a/app/models/contenticus/layout_parser.rb +++ b/app/models/contenticus/layout_parser.rb @@ -1,7 +1,4 @@ class Contenticus::LayoutParser - - require "parser/current" - require 'unparser' attr_reader :tags @@ -36,4 +33,4 @@ end end -end+end
Remove require for gems that are no longer in gemspec
diff --git a/test/test_cfi.rb b/test/test_cfi.rb index abc1234..def5678 100644 --- a/test/test_cfi.rb +++ b/test/test_cfi.rb @@ -0,0 +1,12 @@+require_relative 'helper' +require 'epub/cfi' + +class TestCFI < Test::Unit::TestCase + def test_escape + assert_equal '^^', EPUB::CFI.escape('^') + end + + def test_unescape + assert_equal '^', EPUB::CFI.unescape('^^') + end +end
Add test cases for CFI
diff --git a/test/test_cli.rb b/test/test_cli.rb index abc1234..def5678 100644 --- a/test/test_cli.rb +++ b/test/test_cli.rb @@ -5,31 +5,38 @@ context "Tracking's CLI" do should "clear list (to prepare for other tests)" do - test_command "-c" + #test_command "-c" + capture_output { Tracking::List.clear } end should "display empty list" do - test_command + #test_command + capture_output { Tracking::CLI.display } end should "add a task" do - test_command "first task" + #test_command "first task" + capture_output { Tracking::List.add "first task" } end should "add another task" do - test_command "second task" + #test_command "second task" + capture_output { Tracking::List.add "second task" } end should "display list with two items" do - test_command + #test_command + capture_output { Tracking::CLI.display } end should "delete the second task" do - test_command "-d" + #test_command "-d" + capture_output { Tracking::List.delete } end should "clear list" do - test_command "-c" + #test_command "-c" + capture_output { Tracking::List.clear } end should "display help information (run from the system's shell)" do
Test tracking commands directly through ruby, not through the shell This is a temporary fix, as running directly through the shell hides exceptions and causes tests to result in false positives.
diff --git a/spec/lib/mock_spec.rb b/spec/lib/mock_spec.rb index abc1234..def5678 100644 --- a/spec/lib/mock_spec.rb +++ b/spec/lib/mock_spec.rb @@ -0,0 +1,62 @@+require 'spec_helper' + +describe "Using mocks" do + + # Note: These specs don't test any application code + # They merely are here to illustrate how mocks, stub methods and partial mocks work. + + it 'with inline stub methods' do + m = mock("A Mock", :foo => 'hello') + m.should respond_to(:foo) + + m.foo.should == "hello" + end + + it 'with explicit method stub' do + m = mock("A mock") + m.stub(:foo).and_return("hello") + + m.should respond_to(:foo) + m.foo("arg").should == "hello" + end + + it 'with expected method invocation count' do + m = mock("A mock") + m.should_receive(:foo) + + m.foo + end + + it 'with argument matching' do + m = mock("A mock") + m.should_receive(:foo).with(hash_including(:name => "joe")) + + m.foo({:name => 'joe', :address => '123 Main'}) + end + + it 'with block argument matcher' do + m = mock("A mock") + m.should_receive(:foo).with{ |arg1, arg2| + arg1 == 'hello' && arg2.blank? + } + + m.foo('hello','') + end + + it 'stubbing methods on existing classes' do + jan1 = DateTime.civil(2010).to_time + + Time.stub!(:now).and_return(jan1) + + Time.now.should == jan1 + end + + it 'with mock_model' do + mm = mock_model(User) + mm.should respond_to(:id) + puts mm.id + mm.should respond_to(:new_record?) + puts mm.new_record? + end + +end
Add mock examples for instructional purposes to illustrate use of mocks in rspec.
diff --git a/conditional_delegate.gemspec b/conditional_delegate.gemspec index abc1234..def5678 100644 --- a/conditional_delegate.gemspec +++ b/conditional_delegate.gemspec @@ -15,5 +15,6 @@ gem.require_paths = ["lib"] gem.version = ConditionalDelegate::VERSION + gem.add_development_dependency "rake" gem.add_development_dependency "rspec" end
Add rake as development dependency.
diff --git a/test/helpers.rb b/test/helpers.rb index abc1234..def5678 100644 --- a/test/helpers.rb +++ b/test/helpers.rb @@ -6,6 +6,7 @@ require "matchy" require "rr" require "mocha" +require "ruby-debug" require File.dirname(__FILE__) / "helpers" / "expectations" require File.dirname(__FILE__) / "helpers" / "fixtures"
Add ruby-debug dependency again, since dropping to debugger is useful while testing
diff --git a/config/boot.rb b/config/boot.rb index abc1234..def5678 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -4,3 +4,14 @@ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE']) + +require 'rails/commands/server' + +module Rails + class Server + alias :default_options_alias :default_options + def default_options + default_options_alias.merge!(:Port => 3333) + end + end +end
Change default port to 3333.
diff --git a/ext/bindex/extconf.rb b/ext/bindex/extconf.rb index abc1234..def5678 100644 --- a/ext/bindex/extconf.rb +++ b/ext/bindex/extconf.rb @@ -17,6 +17,7 @@ $INCFLAGS << " -I./ruby_21/" end + $CFLAGS << " -Wall" $CFLAGS << " -g3 -O0" if ENV["DEBUG"] create_makefile("bindex/cruby")
Enable all warnings during C compilation
diff --git a/features/support/env.rb b/features/support/env.rb index abc1234..def5678 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -1,7 +1,6 @@ $LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../lib') require 'mechanical-cuke' -require 'cucumber/web/tableish' require 'test/unit/assertions'
Move tableish requirement to test that requires it.
diff --git a/app/models/bank.rb b/app/models/bank.rb index abc1234..def5678 100644 --- a/app/models/bank.rb +++ b/app/models/bank.rb @@ -1,7 +1,4 @@ class Bank < Person - # Access restrictions - attr_accessible :swift, :clearing - has_many :bank_accounts def to_s
Drop attr_accessible declarations on Bank as it is not used on parent Person class.
diff --git a/app/models/post.rb b/app/models/post.rb index abc1234..def5678 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -1,4 +1,6 @@ class Post < ActiveRecord::Base + + acts_as_votable validates :title, presence: true validates :content, presence: true
Add relation to Post class to make it votable
diff --git a/vpn.gemspec b/vpn.gemspec index abc1234..def5678 100644 --- a/vpn.gemspec +++ b/vpn.gemspec @@ -15,7 +15,7 @@ spec.bindir = "bin" spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } - spec.add_development_dependency "bundler", "~> 1.10" + spec.add_development_dependency "bundler", "~> 1.6" spec.add_development_dependency "rake", "~> 10.0" spec.add_development_dependency "rspec", "~> 3.3" spec.add_development_dependency "simplecov", "~> 0.10"
Downgrade bundler version requirement for Travis-CI
diff --git a/features/support/env.rb b/features/support/env.rb index abc1234..def5678 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -2,4 +2,3 @@ PROJECT_ROOT = File.dirname(File.expand_path('../../', __FILE__)) ENV['PATH'] = File.join(PROJECT_ROOT, '/exe') + File::PATH_SEPARATOR + ENV['PATH'] -puts ENV['PATH']
Remove debug statements from cucumber.
diff --git a/core/db/default/spree/zones.rb b/core/db/default/spree/zones.rb index abc1234..def5678 100644 --- a/core/db/default/spree/zones.rb +++ b/core/db/default/spree/zones.rb @@ -5,7 +5,7 @@ "Slovakia", "Hungary", "Slovenia", "Ireland", "Austria", "Spain", "Italy", "Belgium", "Sweden", "Latvia", "Bulgaria", "United Kingdom", "Lithuania", "Cyprus", "Luxembourg", "Malta", "Denmark", "Netherlands", - "Estonia"]. + "Estonia", "Croatia", "Czech Republic", "Greece"]. each do |name| eu_vat.zone_members.create!(zoneable: Spree::Country.find_by!(name: name)) end
Add Croatia, Czech Republic and Greece to EU_VAT
diff --git a/geode-book/redirects.rb b/geode-book/redirects.rb index abc1234..def5678 100644 --- a/geode-book/redirects.rb +++ b/geode-book/redirects.rb @@ -14,5 +14,5 @@ #permissions and limitations under the License. r301 %r{/releases/latest/javadoc/(.*)}, 'http://geode.apache.org/releases/latest/javadoc/$1' -rewrite '/', '/docs/guide/18/about_geode.html' -rewrite '/index.html', '/docs/guide/18/about_geode.html' +rewrite '/', '/docs/guide/19/about_geode.html' +rewrite '/index.html', '/docs/guide/19/about_geode.html'
Update current version to 1.9.0
diff --git a/zoo-app/spec/service_providers/pact_helper.rb b/zoo-app/spec/service_providers/pact_helper.rb index abc1234..def5678 100644 --- a/zoo-app/spec/service_providers/pact_helper.rb +++ b/zoo-app/spec/service_providers/pact_helper.rb @@ -0,0 +1,11 @@+ +require 'pact/consumer/rspec' +# or require 'pact/consumer/minitest' if you are using Minitest + +Pact.service_consumer "Zoo App" do + has_pact_with "Animal Service" do + mock_service :animal_service do + port 1234 + end + end +end
Configure the mock Animal Service
diff --git a/recipes/zookeeper_status.rb b/recipes/zookeeper_status.rb index abc1234..def5678 100644 --- a/recipes/zookeeper_status.rb +++ b/recipes/zookeeper_status.rb @@ -0,0 +1,10 @@+# coding: UTF-8 +# Cookbook Name:: cerner_kafka +# Recipe:: zookeeper_status + + +execute 'check zookeeper' do + action :run + command " nc -z #{node["kafka"]["zookeepers"].first} 2181 " + returns [0] +end
Add recipe to check zookeeper status
diff --git a/chef/roles/app.rb b/chef/roles/app.rb index abc1234..def5678 100644 --- a/chef/roles/app.rb +++ b/chef/roles/app.rb @@ -8,5 +8,5 @@ ) default_attributes({"redis" => { - "maxmemory" => "8g", + "maxmemory" => "8gb", "dir" => "/var/lib/redis_data"}})
Fix typo in redis config.
diff --git a/lib/nylas/when.rb b/lib/nylas/when.rb index abc1234..def5678 100644 --- a/lib/nylas/when.rb +++ b/lib/nylas/when.rb @@ -1,3 +1,5 @@+# frozen_string_literal: true + module Nylas # Structure to represent all the Nylas time types. # @see https://docs.nylas.com/reference#section-time @@ -25,22 +27,19 @@ def_delegators :range, :cover? def as_timespan - if object == 'timespan' - Timespan.new(object: object, - start_time: start_time, - end_time: end_time) - end + return unless object == "timespan" + Timespan.new(object: object, start_time: start_time, end_time: end_time) end def range case object - when 'timespan' + when "timespan" Range.new(start_time, end_time) - when 'datespan' + when "datespan" Range.new(start_date, end_date) - when 'date' + when "date" Range.new(date, date) - when 'time' + when "time" Range.new(time, time) end end
Fix rubocop issues in Nylas::When
diff --git a/lesson_5/garbage_collection.rb b/lesson_5/garbage_collection.rb index abc1234..def5678 100644 --- a/lesson_5/garbage_collection.rb +++ b/lesson_5/garbage_collection.rb @@ -0,0 +1,18 @@+# test garbage collection + +class Matrix + attr_accessor :matrix + + def initialize + @matrix = [] + 1000000.times { @matrix << rand} + end +end + +m = nil +100.times do |i| + m = Matrix.new + p i + 1 +end + +puts "end of program"
Test garbage collection in ruby
diff --git a/db/migrate/20180907140444_drop_gobierto_plans_categories.rb b/db/migrate/20180907140444_drop_gobierto_plans_categories.rb index abc1234..def5678 100644 --- a/db/migrate/20180907140444_drop_gobierto_plans_categories.rb +++ b/db/migrate/20180907140444_drop_gobierto_plans_categories.rb @@ -0,0 +1,20 @@+# frozen_string_literal: true + +class DropGobiertoPlansCategories < ActiveRecord::Migration[5.2] + def up + drop_table :gplan_categories + end + + def down + create_table :gplan_categories do |t| + t.jsonb :name_translations + t.integer :level, default: 0, null: false + t.integer :parent_id + t.references :plan + t.string :slug, null: false, default: "" + t.float "progress" + t.string "uid" + t.timestamps + end + end +end
Add migration to drop gplan_categories table
diff --git a/github_snapshot.gemspec b/github_snapshot.gemspec index abc1234..def5678 100644 --- a/github_snapshot.gemspec +++ b/github_snapshot.gemspec @@ -8,9 +8,9 @@ spec.version = GithubSnapshot::VERSION spec.authors = ["Artur Rodrigues" , "Joao Sa"] spec.email = ["arturhoo@gmail.com"] - spec.description = %q{Snapshoting organization's repositories, including wikis} - spec.summary = %q{Snapshoting organization's repositories} - spec.homepage = "" + spec.description = %q{Snapshots multiple organizations GitHub repositories, including wikis, and syncs them to Amazon's S3} + spec.summary = %q{Snapshots Github repositories} + spec.homepage = "https://github.com/innvent/github_snapshot" spec.license = "MIT" spec.files = `git ls-files`.split($/) @@ -19,10 +19,8 @@ spec.require_paths = ["lib"] spec.add_development_dependency "bundler", "~> 1.3" - spec.add_development_dependency "rake" spec.add_development_dependency "pry" spec.add_development_dependency "awesome_print" spec.add_dependency "github_api", "~> 0.10.2" - spec.add_dependency "rake" end
Remove rake as a dependency
diff --git a/lib/color_pound_spec_reporter/version.rb b/lib/color_pound_spec_reporter/version.rb index abc1234..def5678 100644 --- a/lib/color_pound_spec_reporter/version.rb +++ b/lib/color_pound_spec_reporter/version.rb @@ -1,4 +1,4 @@ require 'minitest/reporters' class ColorPoundSpecReporter < Minitest::Reporters::SpecReporter - VERSION = "0.0.6" + VERSION = "0.0.7" end
Add ANSI because Highline removed it
diff --git a/lib/pact_broker/domain/order_versions.rb b/lib/pact_broker/domain/order_versions.rb index abc1234..def5678 100644 --- a/lib/pact_broker/domain/order_versions.rb +++ b/lib/pact_broker/domain/order_versions.rb @@ -4,17 +4,17 @@ module Domain class OrderVersions + include PactBroker::Logging # TODO select for update def self.call pacticipant_id - PactBroker::Domain::Version.db.transaction do - orderable_versions = PactBroker::Domain::Version.for_update.where(:pacticipant_id => pacticipant_id).order(:created_at, :id).collect{| version | OrderableVersion.new(version) } - ordered_versions = if PactBroker.configuration.order_versions_by_date - orderable_versions # already ordered in SQL - else - orderable_versions.sort - end - ordered_versions.each_with_index{ | version, i | version.update_model(i) } + + orderable_versions = PactBroker::Domain::Version.for_update.where(:pacticipant_id => pacticipant_id).order(:created_at, :id).collect{| version | OrderableVersion.new(version) } + ordered_versions = if PactBroker.configuration.order_versions_by_date + orderable_versions # already ordered in SQL + else + orderable_versions.sort end + ordered_versions.each_with_index{ | version, i | version.update_model(i) } end class OrderableVersion
Remove transaction around version ordering.
diff --git a/lib/turnip_formatter/ext/turnip/rspec.rb b/lib/turnip_formatter/ext/turnip/rspec.rb index abc1234..def5678 100644 --- a/lib/turnip_formatter/ext/turnip/rspec.rb +++ b/lib/turnip_formatter/ext/turnip/rspec.rb @@ -21,20 +21,11 @@ # @param [RSpec::Core::ExampleGroup] example_group # def update_metadata(feature, example_group) - background_steps = feature.backgrounds.map(&:steps).flatten examples = example_group.children feature.scenarios.zip(examples).each do |scenario, parent_example| example = parent_example.examples.first - steps = background_steps + scenario.steps - tags = (feature.tag_names + scenario.tag_names).uniq - example.metadata[:turnip_formatter] = { - # Turnip::Scenario (Backward compatibility) - steps: steps, - tags: tags, - - # Turnip::Resource::Scenairo feature: feature, scenario: scenario, }
Stop generate metadata for old Scenario Printer
diff --git a/lib/backlog_kit/client/star.rb b/lib/backlog_kit/client/star.rb index abc1234..def5678 100644 --- a/lib/backlog_kit/client/star.rb +++ b/lib/backlog_kit/client/star.rb @@ -1,14 +1,29 @@ module BacklogKit class Client + + # Methods for the Star API module Star + + # Add a star to an issue + # + # @param issue_id [Integer, String] Issue id + # @return [BacklogKit::Response] No content response def add_issue_star(issue_id) post('stars', issue_id: issue_id) end + # Add a star to an issue comment + # + # @param comment_id [Integer, String] Comment id + # @return [BacklogKit::Response] No content response def add_issue_comment_star(comment_id) post('stars', comment_id: comment_id) end + # Add a star to a wiki page + # + # @param wiki_id [Integer, String] Wiki page id + # @return [BacklogKit::Response] No content response def add_wiki_star(wiki_id) post('stars', wiki_id: wiki_id) end
Add documentation for the Star API
diff --git a/lib/caprese/record/aliasing.rb b/lib/caprese/record/aliasing.rb index abc1234..def5678 100644 --- a/lib/caprese/record/aliasing.rb +++ b/lib/caprese/record/aliasing.rb @@ -10,6 +10,14 @@ # have an error source pointer like `/data/attributes/[name]` instead of `/data/relationships/[name]` def caprese_is_attribute?(attribute_name) false + end + + # Checks that any field provided is either an attribute on the record, or an aliased field, or none + # + # @param [String,Symbol] field the field to check for on this record + # @return [Boolean] whether or not the field is on the record + def caprese_is_field?(field) + respond_to?(field = field.to_sym) || caprese_is_attribute?(field) || caprese_field_aliases[field] end module ClassMethods
Add caprese_is_field helper to record
diff --git a/lib/chef/knife/group_create.rb b/lib/chef/knife/group_create.rb index abc1234..def5678 100644 --- a/lib/chef/knife/group_create.rb +++ b/lib/chef/knife/group_create.rb @@ -0,0 +1,40 @@+# +# Author:: Seth Falcon (<seth@opscode.com>) +# Copyright:: Copyright 2011 Opscode, Inc. +# License:: Apache License, Version 2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +module OpscodeAcl + class GroupCreate < Chef::Knife + category "OPSCODE HOSTED CHEF ACCESS CONTROL" + banner "knife group create GROUP" + + deps do + require 'yaml' + end + + def run + group_name = name_args[0] + if !group_name || group_name.empty? + ui.error "must specify a group name" + exit 1 + end + chef_rest = Chef::REST.new(Chef::Config[:chef_server_url]) + group = chef_rest.post_rest("groups", {:groupname => group_name}) + ui.output group + end + end +end +
Add knife group create GROUP
diff --git a/lib/language_pack/octopress.rb b/lib/language_pack/octopress.rb index abc1234..def5678 100644 --- a/lib/language_pack/octopress.rb +++ b/lib/language_pack/octopress.rb @@ -1,30 +1,21 @@ require "language_pack" -require "language_pack/rack" +require "language_pack/jekyll" # Octopress Language Pack. -class LanguagePack::Octopress < LanguagePack::Rack +class LanguagePack::Octopress < LanguagePack::Jekyll - # detects if this is a valid Octopress site by seeing if "_config.yml" exists - # and the Rakefile - # @return [Boolean] true if it's a Rack app def self.use? - super && File.exist?("_config.yml") && - File.read("Rakefile") =~ /task :generate/ + super && has_generate_task? + end + + def self.has_generate_task? + File.read("Rakefile") =~ /task :generate/ rescue Errno::ENOENT end def name "Octopress" end - - def compile - super - allow_git do - generate_jekyll_site - end - end - - private - + def generate_jekyll_site topic("Building Jekyll site") if File.read(".slugignore") =~ /plugins|sass|source/ @@ -32,4 +23,4 @@ end pipe("env PATH=$PATH bundle exec rake generate 2>&1") end -end+end
Make Octopress detector cool with plain jekyll
diff --git a/lib/metasploit/cache/logged.rb b/lib/metasploit/cache/logged.rb index abc1234..def5678 100644 --- a/lib/metasploit/cache/logged.rb +++ b/lib/metasploit/cache/logged.rb @@ -24,12 +24,13 @@ # # @param logged [#logger, #logger=] # @param logger [ActiveSupport::TaggedLogger, #tagged] + # @param tags [Array<String>] tags to tag logger with # @yield [logger] # @yieldparam logger [ActiveSupport::TaggedLogger] `logger` with `tag` applied # @yieldreturn [void] # @return [void] - def self.with_tagged_logger(logged, logger, tag, &block) - logger.tagged(tag) do + def self.with_tagged_logger(logged, logger, *tags, &block) + logger.tagged(tags) do with_logger(logged, logger, &block) end end
Allow multiple tags for with_tagged_logger MSP-13082 `ActiveSupport::TaggingLogging` supports multiple tags, so the wrapper should too.
diff --git a/lib/neighborly/admin/engine.rb b/lib/neighborly/admin/engine.rb index abc1234..def5678 100644 --- a/lib/neighborly/admin/engine.rb +++ b/lib/neighborly/admin/engine.rb @@ -5,6 +5,7 @@ config.to_prepare do ::Project.send(:include, Neighborly::Admin::ProjectConcern) + ::User.send(:include, Neighborly::Admin::UserConcern) end end end
Include the user scopes to user model
diff --git a/honeybadger-api.gemspec b/honeybadger-api.gemspec index abc1234..def5678 100644 --- a/honeybadger-api.gemspec +++ b/honeybadger-api.gemspec @@ -19,7 +19,7 @@ spec.add_runtime_dependency 'json' - spec.add_development_dependency 'rspec', '2.14.1' + spec.add_development_dependency 'rspec', '3.4.0' spec.add_development_dependency 'webmock' spec.add_development_dependency 'mocha' spec.add_development_dependency 'factory_girl'
Fix failing specs by upgrading rspec to newest version
diff --git a/lib/tasks/cleanup_updates.rake b/lib/tasks/cleanup_updates.rake index abc1234..def5678 100644 --- a/lib/tasks/cleanup_updates.rake +++ b/lib/tasks/cleanup_updates.rake @@ -0,0 +1,9 @@+desc "Cleanup upgrade tasks older than 10 days" +namespace :cleanup do + task :updates => :environment do + #don't run if there's no new upgrade (maybe import/cleanup tasks are broken) + if Upgrade.where(:updated_at.gt => Date.today - 1.day).count > 0 + Upgrade.where(:updated_at.lt => Date.today - 10.days).destroy_all + end + end +end
Add task to cleanup old upgrade tasks
diff --git a/lib/virtus/class_inclusions.rb b/lib/virtus/class_inclusions.rb index abc1234..def5678 100644 --- a/lib/virtus/class_inclusions.rb +++ b/lib/virtus/class_inclusions.rb @@ -6,6 +6,8 @@ descendant.extend(ClassMethods) descendant.send(:include, InstanceMethods) end + + private def _attributes self.class.attributes
Change methods to be private
diff --git a/lib/cyclid/sinatra/api_helpers.rb b/lib/cyclid/sinatra/api_helpers.rb index abc1234..def5678 100644 --- a/lib/cyclid/sinatra/api_helpers.rb +++ b/lib/cyclid/sinatra/api_helpers.rb @@ -14,15 +14,15 @@ json = Oj.load request.body.read rescue Oj::ParseError => ex Cyclid.logger.debug ex.message - halt_with_json_response(400, INVALID_JSON, ex.message) + halt_with_json_response(400, Errors::HTTPErrors::INVALID_JSON, ex.message) end # Sanity check the JSON halt_with_json_response(400, \ - INVALID_JSON, \ + Errors::HTTPErrors::INVALID_JSON, \ 'request body can not be empty') if json.nil? halt_with_json_response(400, \ - INVALID_JSON, \ + Errors::HTTPErrors::INVALID_JSON, \ 'request body is invalid') unless json.is_a?(Hash) return json
Fix namespace of HTTP errors
diff --git a/lib/nifty/rack/i18n/middleware.rb b/lib/nifty/rack/i18n/middleware.rb index abc1234..def5678 100644 --- a/lib/nifty/rack/i18n/middleware.rb +++ b/lib/nifty/rack/i18n/middleware.rb @@ -24,7 +24,7 @@ def extract_locales(env) request = ::Rack::Request.new(env) - [request.params['locale'], env['HTTP_X_LOCALE'], env['X_LOCALE']] + [request.params['locale'], env['HTTP_X_LOCALE'], env['HTTP_HTTP_X_LOCALE']] end def set_locale(*locales)
Support the HTTP header 'HTTP_X_LOCALE'
diff --git a/lib/pretty_validation/renderer.rb b/lib/pretty_validation/renderer.rb index abc1234..def5678 100644 --- a/lib/pretty_validation/renderer.rb +++ b/lib/pretty_validation/renderer.rb @@ -8,7 +8,10 @@ def self.generate FileUtils.mkdir_p validations_path unless File.directory? validations_path - Schema.table_names.each { |t| new(t).write! } + Schema.table_names.each do |t| + r = new t + r.write! unless r.validations.empty? + end end def initialize(table_name) @@ -44,11 +47,11 @@ File.write(file_path, render) end - private - def validations sexy_validations + uniq_validations end + + private def sexy_validations Validation.sexy_validations(table_name)
:anchor: Stop to generate an empty validations
diff --git a/lib/revision_analytics_service.rb b/lib/revision_analytics_service.rb index abc1234..def5678 100644 --- a/lib/revision_analytics_service.rb +++ b/lib/revision_analytics_service.rb @@ -1,12 +1,14 @@ class RevisionAnalyticsService def self.dyk_eligible + current_course_ids = Course.current.pluck(:id) + current_student_ids = CoursesUsers + .where(course_id: current_course_ids, role: 0) + .pluck(:user_id) Article .eager_load(:revisions) - .eager_load(:courses) - .references(:all) - .where{ revisions.wp10 > 5 } - .where{(namespace == 118) | ((namespace == 2) & (title !~ '%/%'))} + .where { revisions.wp10 > 30 } + .where(revisions: { user_id: current_student_ids }) + .where { (namespace == 118) | ((namespace == 2) & ('title like %/%')) } end - end
Update query for DYK feed ArticlesCourses generally only get created for mainspace pages, so we can't use them as an indicator that a page is connected to a current course.
diff --git a/lib/tasks/rglossa_old_glossa.thor b/lib/tasks/rglossa_old_glossa.thor index abc1234..def5678 100644 --- a/lib/tasks/rglossa_old_glossa.thor +++ b/lib/tasks/rglossa_old_glossa.thor @@ -1,12 +1,15 @@ module Rglossa module Metadata class OldGlossa < Thor + + include Thor::Actions desc "dump", "Dump data from metadata tables in old Glossa" method_options database: "glossa", user: "root" method_option :corpus, required: true def dump + # Pull in the Rails app require File.expand_path('../../../config/environment', __FILE__) database = options[:database] @@ -14,9 +17,11 @@ user = options[:user] table = "#{database}.#{corpus}text" + outfile = "#{Rails.root}/tmp/#{table}.tsv" + remove_file(outfile) command = %Q{mysql -u #{user} -p #{database} } + - %Q{-e "SELECT * FROM #{corpus}text INTO OUTFILE '#{Rails.root}/tmp/#{table}.tsv'"} + %Q{-e "SELECT * FROM #{corpus}text INTO OUTFILE '#{outfile}'"} puts "Dumping metadata from #{table}:" puts command
Remove old dumpfile before new database dump
diff --git a/lib/buffet/remote_runner.rb b/lib/buffet/remote_runner.rb index abc1234..def5678 100644 --- a/lib/buffet/remote_runner.rb +++ b/lib/buffet/remote_runner.rb @@ -1,8 +1,13 @@+$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + "/..")) + module Buffet class RemoteRunner + def initialize + @lock = Mutex.new + end + def run - #TODO: Should probably use a mutex here. - if not @someone_running + @lock.synchronize do @someone_running = true buffet = Buffet.new(Settings.get["repository"], {:verbose => @verbose}) @@ -10,7 +15,7 @@ return true end - #return false + return false end end end
Use mutex with RemoteRunner to ensure exclusivity.
diff --git a/lib/ganger/docker_server.rb b/lib/ganger/docker_server.rb index abc1234..def5678 100644 --- a/lib/ganger/docker_server.rb +++ b/lib/ganger/docker_server.rb @@ -40,7 +40,7 @@ end def pull_image - Docker::Image.create({'fromImage' => Ganger.configuration.docker_image}, @connection) + Docker::Image.create({'fromImage' => Ganger.configuration.docker_image}, nil, @connection) @image_pulled = true end
Fix subtle bug with sending connection image creation
diff --git a/lib/ixtlan/guard/railtie.rb b/lib/ixtlan/guard/railtie.rb index abc1234..def5678 100644 --- a/lib/ixtlan/guard/railtie.rb +++ b/lib/ixtlan/guard/railtie.rb @@ -20,6 +20,16 @@ logger.warn e.message end end + + config.generators do + require 'rails/generators' + require 'rails/generators/rails/controller/controller_generator' + require 'rails/generators/erb/scaffold/scaffold_generator' + Rails::Generators::ControllerGenerator.hook_for :ixtlan, :type => :boolean, :default => true do |controller| + invoke controller, [ class_name, actions ] + end + Erb::Generators::ScaffoldGenerator.source_paths.insert(0, File.expand_path('../../generators/ixtlan/templates', __FILE__)) + end end end end
Revert "removed obsolete and confusing source_path" This reverts commit cc8fc46d43fe3c3158fae3dc76f5218099f4a1c5.
diff --git a/lib/media_wiki/exception.rb b/lib/media_wiki/exception.rb index abc1234..def5678 100644 --- a/lib/media_wiki/exception.rb +++ b/lib/media_wiki/exception.rb @@ -14,6 +14,10 @@ @info = info @message = "API error: code '#{code}', info '#{info}'" end + + def to_s + "#{self.class.to_s}: #{@message}" + end end # User is not authorized to perform this operation. Also thrown if MediaWiki::Gateway#login fails.
Print sensible error message for APIError.to_s
diff --git a/lib/sinatra/error_logger.rb b/lib/sinatra/error_logger.rb index abc1234..def5678 100644 --- a/lib/sinatra/error_logger.rb +++ b/lib/sinatra/error_logger.rb @@ -1,14 +1,9 @@ module Sinatra - class ErrorLogger + class ErrorLogger < Struct.new(:app, :logger) VERSION = "0.0.1" - def initialize(app, logger) - @app = app - @logger = logger - end - def call(env) - status, headers, body = @app.call(env) + status, headers, body = app.call(env) log_error(env) [status, headers, body] end @@ -17,7 +12,7 @@ exception = env['sinatra.error'] return unless exception - @logger.error(format_message(exception, env)) + logger.error(format_message(exception, env)) end def format_message(exception, env)
Use struct to simplify code
diff --git a/lib/template/runner/base.rb b/lib/template/runner/base.rb index abc1234..def5678 100644 --- a/lib/template/runner/base.rb +++ b/lib/template/runner/base.rb @@ -33,9 +33,13 @@ @locals end + def append_to_output(str) + @erbout << str + end + def __render__(locals = {}) @locals = OpenStruct.new(locals) - ERB.new(@content).result(binding) + ERB.new(@content, nil, nil, "@erbout").result(binding) end def __run__(locals = {})
Add output buffer to erb runner
diff --git a/Casks/nylas-n1.rb b/Casks/nylas-n1.rb index abc1234..def5678 100644 --- a/Casks/nylas-n1.rb +++ b/Casks/nylas-n1.rb @@ -1,6 +1,6 @@ cask :v1 => 'nylas-n1' do - version '0.3.26-c1ce330' - sha256 '0e29a5e52f96432b6bacd1573c85c6fd552c8942e1fae281cba034d095f1aedf' + version '0.3.27-1c2a936' + sha256 '7b07783c61682cdff80b2cb9c395660f8944d77e24f80cc395ecf71cd4b6d2e2' # amazonaws.com is the official download host per the vendor homepage url "https://edgehill.s3-us-west-2.amazonaws.com/#{version}/darwin/x64/N1.dmg"
Update Nylas N1 to Version 0.3.27-1c2a936
diff --git a/Casks/telegram.rb b/Casks/telegram.rb index abc1234..def5678 100644 --- a/Casks/telegram.rb +++ b/Casks/telegram.rb @@ -2,7 +2,6 @@ version '2.16-47508' sha256 '5ffbd2f76054fc47aafa6f2596ef9c6a85a69412a3a1f227f789b1832e7518d5' - # telegram.org was verified as official when first introduced to the cask url "https://osx.telegram.org/updates/Telegram-#{version}.app.zip" appcast 'http://osx.telegram.org/updates/versions.xml', checkpoint: '07caec5ebbe1b7081cb2e873cb5321d6f736b6ecbe7421968ba2f69745ac1a6e'
Fix `url` stanza comment for Telegram for macOS.
diff --git a/spec/lib/gitlab/database_importers/common_metrics/prometheus_metric_spec.rb b/spec/lib/gitlab/database_importers/common_metrics/prometheus_metric_spec.rb index abc1234..def5678 100644 --- a/spec/lib/gitlab/database_importers/common_metrics/prometheus_metric_spec.rb +++ b/spec/lib/gitlab/database_importers/common_metrics/prometheus_metric_spec.rb @@ -3,17 +3,14 @@ require 'rails_helper' describe Gitlab::DatabaseImporters::CommonMetrics::PrometheusMetric do - let(:existing_group_titles) do - ::PrometheusMetricEnums.group_details.each_with_object({}) do |(key, value), memo| - memo[key] = value[:group_title] - end - end - it 'group enum equals ::PrometheusMetric' do expect(described_class.groups).to eq(::PrometheusMetric.groups) end it '.group_titles equals ::PrometheusMetric' do + existing_group_titles = ::PrometheusMetricEnums.group_details.each_with_object({}) do |(key, value), memo| + memo[key] = value[:group_title] + end expect(Gitlab::DatabaseImporters::CommonMetrics::PrometheusMetricEnums.group_titles).to eq(existing_group_titles) end end
Remove unnecessary let in spec
diff --git a/Formula/python.rb b/Formula/python.rb index abc1234..def5678 100644 --- a/Formula/python.rb +++ b/Formula/python.rb @@ -11,7 +11,8 @@ end def skip_clean? path - return path == bin+'python' or path == bin+'python2.6' + path == bin+'python' or path == bin+'python2.6' or # if you strip these, it can't load modules + path == lib+'python2.6' # save a lot of time end def install
Allow skip_clean? to skip entire directories Speeds up Python formula plenty in clean phase
diff --git a/SWXMLHash.podspec b/SWXMLHash.podspec index abc1234..def5678 100644 --- a/SWXMLHash.podspec +++ b/SWXMLHash.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'SWXMLHash' - s.version = '2.0.1' + s.version = '2.0.2' s.summary = 'Simple XML parsing in Swift' s.homepage = 'https://github.com/drmohundro/SWXMLHash' s.license = { :type => 'MIT' } @@ -13,6 +13,6 @@ s.watchos.deployment_target = '2.0' s.tvos.deployment_target = '9.0' - s.source = { :git => 'https://github.com/drmohundro/SWXMLHash.git', :tag => '2.0.1' } + s.source = { :git => 'https://github.com/drmohundro/SWXMLHash.git', :tag => '2.0.2' } s.source_files = 'Source/*.swift' end
Bump cocoapods version for tvos
diff --git a/SwiftCron.podspec b/SwiftCron.podspec index abc1234..def5678 100644 --- a/SwiftCron.podspec +++ b/SwiftCron.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "SwiftCron" - s.version = "0.4.8" + s.version = "0.5.0" s.summary = "Cron expression parser."
Change pod version to 0.5.0
diff --git a/dev_environment/roles/app.rb b/dev_environment/roles/app.rb index abc1234..def5678 100644 --- a/dev_environment/roles/app.rb +++ b/dev_environment/roles/app.rb @@ -15,4 +15,6 @@ {"name" => "foreman"} ] } +}, 'ruby_build' => { + 'upgrade' => 'sync' }
[DEPLOY] Update ruby_build to get new Ruby defs
diff --git a/spec/routing/interstate_line_route_spec.rb b/spec/routing/interstate_line_route_spec.rb index abc1234..def5678 100644 --- a/spec/routing/interstate_line_route_spec.rb +++ b/spec/routing/interstate_line_route_spec.rb @@ -0,0 +1,27 @@+require 'spec_helper' + +describe "routing to interstate_lines" do + it { {:get, "/game/1/interstate_lines"}.should route_to(:action => :index, + :game => 1, :controller => "interstate_lines") } + + it { {:get, "/game/1/region/2/interstate_lines"}.should route_to( + :action => :index, :game => 1, :region => 2, + :controller => "interstate_lines") } + + it { {:get, "/game/1/interstate_lines/new"}.should route_to(:action => :new, + :game => 1, :controller => "interstate_lines") } + + it { {:post, "/game/1/interstate_lines"}.should route_to(:action => :create, + :game => 1, :controller => "interstate_lines") } + + it { {:put, "/game/1/interstate_line/2"}.should route_to( + :action => :respond, :game => 1, :interstate_line => 2, + :controller => "interstate_lines") } + + it { {:get, "/game/1/interstate_line/2"}.should route_to(:action => :show, + :game => 1, :interstate_line => 2, :controller => "interstate_lines") } + + it "does not allow interstate_line deleting" do + {:delete => "/game/1/interstate_lines/1"}.should_not be_routable + end +end
Add interstate line route spec.
diff --git a/rakelib/gh-pages.rake b/rakelib/gh-pages.rake index abc1234..def5678 100644 --- a/rakelib/gh-pages.rake +++ b/rakelib/gh-pages.rake @@ -21,6 +21,11 @@ exit end + unless `git status --porcelain`.chomp.empty? + puts "The master branch is not clean. Unable to update gh-pages." + exit + end + commit_hash = `git rev-parse --short HEAD`.chomp puts `git checkout gh-pages`
Check for clean status on updating docs
diff --git a/spec/script/extras/sauce_connect_spec.rb b/spec/script/extras/sauce_connect_spec.rb index abc1234..def5678 100644 --- a/spec/script/extras/sauce_connect_spec.rb +++ b/spec/script/extras/sauce_connect_spec.rb @@ -0,0 +1,45 @@+require 'spec_helper' + +describe Travis::Build::Script::Extras::SauceConnect do + let(:script) { stub_everything('script') } + + subject { described_class.new(script, config).run } + + context 'without credentials' do + let(:config) { true } + + it 'runs the command' do + script.expects(:cmd).with('curl https://gist.github.com/santiycr/5139565/raw/sauce_connect_setup.sh | bash', assert: false) + subject + end + + it 'exports TRAVIS_SAUCE_CONNECT' do + script.expects(:set).with('TRAVIS_SAUCE_CONNECT', 'true', echo: false, assert: false) + subject + end + end + + context 'with username and access key' do + let(:config) { { :username => 'johndoe', :access_key => '0123456789abcfdef' } } + + it 'exports the username' do + script.expects(:set).with('SAUCE_USERNAME', 'johndoe', echo: false, assert: false) + subject + end + + it 'exports the access key' do + script.expects(:set).with('SAUCE_ACCESS_KEY', '0123456789abcfdef', echo: false, assert: false) + subject + end + + it 'runs the command' do + script.expects(:cmd).with('curl https://gist.github.com/santiycr/5139565/raw/sauce_connect_setup.sh | bash', assert: false) + subject + end + + it 'exports TRAVIS_SAUCE_CONNECT' do + script.expects(:set).with('TRAVIS_SAUCE_CONNECT', 'true', echo: false, assert: false) + subject + end + end +end
Add specs for Sauce Connect service
diff --git a/spree-refinerycms-authentication.gemspec b/spree-refinerycms-authentication.gemspec index abc1234..def5678 100644 --- a/spree-refinerycms-authentication.gemspec +++ b/spree-refinerycms-authentication.gemspec @@ -1,19 +1,18 @@ # -*- encoding: utf-8 -*- -Gem::Specification.new do |gem| - gem.name = "spree-refinerycms-authentication" - gem.version = "3.0.0" - gem.authors = ["Adrian Macneil", "Philip Arndt", "Brice Sanchez"] - gem.email = ["adrian@crescendo.net.nz"] - gem.description = "Configure Refinery to use Spree for authentication" - gem.summary = "Spree has a pluggable authentication system. This gem will tell Refinery to use Spree user model and authentication." - gem.homepage = "https://github.com/bricesanchez/spree-refinery-authentication" +Gem::Specification.new do |s| + s.name = "spree-refinerycms-authentication" + s.version = "3.0.0" + s.authors = ["Philip Arndt", "Brice Sanchez", "Adrian Macneil"] + s.description = "Configure Refinery to use Spree for authentication" + s.summary = "Spree has a pluggable authentication system. This s will tell Refinery to use Spree user model and authentication." + s.homepage = "https://github.com/bricesanchez/spree-refinery-authentication" - gem.files = `git ls-files`.split($/) - gem.test_files = gem.files.grep(%r{^spec/}) - gem.require_paths = ["lib"] + s.files = `git ls-files`.split($/) + s.test_files = s.files.grep(%r{^spec/}) + s.require_paths = ["lib"] - gem.add_runtime_dependency 'spree' - gem.add_runtime_dependency 'refinerycms' - gem.add_runtime_dependency 'zilch-authorisation' + s.add_runtime_dependency 'spree_core', '>= 3.0.0' + s.add_runtime_dependency 'refinerycms', '>= 3.0.0' + s.add_runtime_dependency 'zilch-authorisation', '>= 0.0.1' end
Update gemspec with correct dependencies
diff --git a/app/serializers/restricted/group_serializer.rb b/app/serializers/restricted/group_serializer.rb index abc1234..def5678 100644 --- a/app/serializers/restricted/group_serializer.rb +++ b/app/serializers/restricted/group_serializer.rb @@ -1,6 +1,6 @@ class Restricted::GroupSerializer < ActiveModel::Serializer embed :ids, include: true - attributes :id, :name, :logo_url_medium + attributes :id, :type, :name, :logo_url_medium def logo_url_medium object.logo.url(:medium)
Include type with restricted group
diff --git a/app/controllers/slack_command_controller.rb b/app/controllers/slack_command_controller.rb index abc1234..def5678 100644 --- a/app/controllers/slack_command_controller.rb +++ b/app/controllers/slack_command_controller.rb @@ -1,7 +1,7 @@ # Receive Slack commands and validate correct tokens. class SlackCommandController < ApplicationController def create - render text: handler.response.to_s + render plain: handler.response end private
Update to correct rendering style for Rails API
diff --git a/brewery_db.gemspec b/brewery_db.gemspec index abc1234..def5678 100644 --- a/brewery_db.gemspec +++ b/brewery_db.gemspec @@ -13,7 +13,7 @@ gem.add_dependency 'faraday_middleware', '~> 0.8' gem.add_dependency 'hashie', '~> 1.1' gem.add_development_dependency 'pry' - gem.add_development_dependency 'rspec', '~> 2.0' + gem.add_development_dependency 'rspec', '~> 2.11' gem.add_development_dependency 'vcr', '~> 2.0' gem.files = `git ls-files`.split($\)
Upgrade to latest rspec for expect syntax
diff --git a/app/models/concerns/srdc_run.rb b/app/models/concerns/srdc_run.rb index abc1234..def5678 100644 --- a/app/models/concerns/srdc_run.rb +++ b/app/models/concerns/srdc_run.rb @@ -24,7 +24,7 @@ return if srdc_runner.blank? update(user: User.find_by(name: srdc_runner.twitch_login)) - rescue SpeedrunDotCom::RunNotFound, SpeedrunDotCom::UserNotFound + rescue SpeedrunDotCom::NotFound end end end
Remove a reference to SpeedrunDotcom::RunNotFound
diff --git a/dm-aggregates.gemspec b/dm-aggregates.gemspec index abc1234..def5678 100644 --- a/dm-aggregates.gemspec +++ b/dm-aggregates.gemspec @@ -12,7 +12,7 @@ gem.test_files = `git ls-files -- {spec}/*`.split("\n") gem.extra_rdoc_files = %w[LICENSE README.rdoc] - gem.name = "dm-aggregatess" + gem.name = "dm-aggregates" gem.require_paths = [ "lib" ] gem.version = DataMapper::Aggregates::VERSION
Fix typo in gemspec gem name.
diff --git a/lib/dpl/provider/npm.rb b/lib/dpl/provider/npm.rb index abc1234..def5678 100644 --- a/lib/dpl/provider/npm.rb +++ b/lib/dpl/provider/npm.rb @@ -13,8 +13,8 @@ def setup_auth File.open(File.expand_path(NPMRC_FILE), 'w') do |f| - f.puts("_auth = #{options[:api_key]}") - f.puts("email = #{options[:email]}") + f.puts("_auth = #{option(:api_key)}") + f.puts("email = #{option(:email)}") end end
Use option instead of options
diff --git a/create-webpage.rb b/create-webpage.rb index abc1234..def5678 100644 --- a/create-webpage.rb +++ b/create-webpage.rb @@ -0,0 +1,48 @@+#! /usr/bin/ruby + +$LOAD_PATH << File.dirname(__FILE__) + +require 'ice-oasis-leagues' + +timeslots = IceOasisLeagues.get_timeslots() +rinks = IceOasisLeagues.get_rinks() +leagues = IceOasisLeagues.get_ice_oasis_leagues() + +puts "<html>" +puts "<body>" +puts "<h1 align=\"center\">Ice Oasis schedule creator, v2</h1>" +puts "Schedule start date: #{leagues[:start_date]}" +puts "<br>Schedule end date: #{leagues[:end_date]}" +leagues[:leagues].sort {|x,y| x[:day_of_week] <=> y[:day_of_week]}.each do |l| + puts "<h2>#{l[:name]} league</h2>" + teamcount = l[:team_names].size() + rinkcount = l[:rink_ids].sort.uniq.size() + rinknames = l[:rink_ids].map {|rid| rinks[rid][:long_name]}.sort.uniq + times = Array.new + if rinkcount > 1 + l[:timeslot_ids].each_index do |i| + tid=l[:timeslot_ids][i] + rid=l[:rink_ids][i] + r=rinks[rid][:short_name] + t=timeslots[tid][:description] + times.push("#{r} #{t}") + end + else + times = l[:timeslot_ids].map {|tid| timeslots[tid][:description]} + end + puts "<form action=\"/cgi-bin/hockey-sched/create.cgi\" method=\"get\">" + puts "<blockquote>" + puts "# of teams: #{teamcount} - #{l[:team_names].join(', ')}" + puts "<br># of rinks: #{rinkcount} - #{rinknames.join(', ')}" + puts "<br>Timeslots: #{times.join(', ')}" + puts "<input type=\"hidden\" league=\"#{l[:name]}\">" + puts "<br><input type=\"submit\" value=\"Get schedule\">" + puts "</blockquote>" + puts "</form>" + +end + +puts "<hr>" +puts "This page last updated #{DateTime.now.to_s}" +puts "</body>" +puts "</html>"
Create a web page to run a cgi-bin script that creates the schedules.
diff --git a/lib/henson/installer.rb b/lib/henson/installer.rb index abc1234..def5678 100644 --- a/lib/henson/installer.rb +++ b/lib/henson/installer.rb @@ -7,8 +7,15 @@ FileUtils.mkdir_p File.expand_path(Henson.settings[:path]) parse_puppetfile!.modules.each do |mod| - mod.fetch! - mod.install! + mod.fetch! if mod.needs_fetching? + + if mod.needs_installing? + mod.install! + else + install_path = "#{Henson.settings[:path]}/#{mod.name}" + Henson.ui.debug "Using #{mod.name} (#{mod.version}) from #{install_path}" + Henson.ui.info "Using #{mod.name} (#{mod.version})" + end end end
Add basic log output for installing
diff --git a/test/integration/answer_rendering_test.rb b/test/integration/answer_rendering_test.rb index abc1234..def5678 100644 --- a/test/integration/answer_rendering_test.rb +++ b/test/integration/answer_rendering_test.rb @@ -2,36 +2,34 @@ class AnswerRenderingTest < ActionDispatch::IntegrationTest - context "rendering a quick answer" do - should "quick_answer request" do - setup_api_responses('vat-rates') - visit "/vat-rates" + should "rendering a quick answer correctly" do + setup_api_responses('vat-rates') + visit "/vat-rates" - assert_equal 200, page.status_code + assert_equal 200, page.status_code - within 'head' do - assert page.has_selector?("title", :text => "VAT rates - GOV.UK") - assert page.has_selector?("link[rel=alternate][type='application/json'][href='/api/vat-rates.json']") + within 'head' do + assert page.has_selector?("title", :text => "VAT rates - GOV.UK") + assert page.has_selector?("link[rel=alternate][type='application/json'][href='/api/vat-rates.json']") + end + + within '#content' do + within 'header' do + assert page.has_content?("VAT rates") + assert page.has_content?("Quick answer") end - within '#content' do - within 'header' do - assert page.has_content?("VAT rates") - assert page.has_content?("Quick answer") + within '.article-container' do + within 'article' do + assert page.has_selector?(".highlight-answer p em", :text => "20%") end - within '.article-container' do - within 'article' do - assert page.has_selector?(".highlight-answer p em", :text => "20%") - end + assert page.has_selector?(".modified-date", :text => "Last updated: 22 October 2012") - assert page.has_selector?(".modified-date", :text => "Last updated: 22 October 2012") + assert page.has_selector?("#test-report_a_problem") + end + end # within #content - assert page.has_selector?("#test-report_a_problem") - end - end # within #content - - assert page.has_selector?("#test-related") - end + assert page.has_selector?("#test-related") end end
Tidy up quick-answer integration test.
diff --git a/spec/debian/interfaces_spec.rb b/spec/debian/interfaces_spec.rb index abc1234..def5678 100644 --- a/spec/debian/interfaces_spec.rb +++ b/spec/debian/interfaces_spec.rb @@ -0,0 +1,24 @@+require 'spec_helper' + +# This test requires a VM to be provision with two IPs, preferably one public +# and one private. + +# Test to ensure the VM has two interfaces, eth0 and eth1 + +# eth0 +describe interface('eth0') do + it { should exist } +end + +describe interface('eth0') do + it { should be_up } +end + +# eth1 +describe interface('eth1') do + it { should exist } +end + +describe interface('eth1') do + it { should be_up } +end
Test to ensure the VM has two interfaces, eth0 and eth1 This test requires a VM to be provision with two IPs, preferably one public and one private.
diff --git a/spec/features/comments_spec.rb b/spec/features/comments_spec.rb index abc1234..def5678 100644 --- a/spec/features/comments_spec.rb +++ b/spec/features/comments_spec.rb @@ -7,7 +7,7 @@ #question = create(:question) visit topic_path(topic) - find('.collapsible-header', :text => question.content).click + find('.popout .collapsible-header', :text => question.content).click expect(page).to have_selector("textarea[name='comment[content]']") expect(page).to have_selector("input[name='comment[author]']") end
Change comments spec to be more specific
diff --git a/spec/unit/command/repo_spec.rb b/spec/unit/command/repo_spec.rb index abc1234..def5678 100644 --- a/spec/unit/command/repo_spec.rb +++ b/spec/unit/command/repo_spec.rb @@ -19,11 +19,11 @@ end it "supports a repo with a compatible maximum version" do - versions = { 'max' => '0.7' } + versions = { 'max' => '0.999' } @command.class.send(:is_compatilbe, versions).should == true end - it "doesn't supports a repo with a compatible maximum version" do + it "doesn't support a repo with an incompatible maximum version" do versions = { 'max' => '0.5' } @command.class.send(:is_compatilbe, versions).should == false end
Fix repo max version spec work for the foreseeable future.
diff --git a/spec/wordpress/request_spec.rb b/spec/wordpress/request_spec.rb index abc1234..def5678 100644 --- a/spec/wordpress/request_spec.rb +++ b/spec/wordpress/request_spec.rb @@ -2,4 +2,14 @@ require 'wordpress/request' describe Wordpress::Request do + let :request do + Wordpress::Request.new(:get, 'url') + end + + it "should deep clone" do + new_request = request.dup + new_request.should_not equal request + new_request.params.should_not equal request.params + new_request.body.should_not equal request.body + end end
Add spec test for request.
diff --git a/lib/spree_versioning.rb b/lib/spree_versioning.rb index abc1234..def5678 100644 --- a/lib/spree_versioning.rb +++ b/lib/spree_versioning.rb @@ -15,6 +15,7 @@ end def track_models + return if ( File.basename($0) == "rake" && ARGV.include?("db:migrate") ) configuration.models_to_track.each do |model| unless model < ActiveRecord::Base raise "#{model} does not inherit from ActiveRecord::Base"
Allow for data migrations prior to the creation of the versions table to be run
diff --git a/lib/tasks/data_fix.rake b/lib/tasks/data_fix.rake index abc1234..def5678 100644 --- a/lib/tasks/data_fix.rake +++ b/lib/tasks/data_fix.rake @@ -0,0 +1,34 @@+namespace :data_fix do + desc 'Fix for the 17th December incident' + task december_17: :environment do + sql_condition = [ + 'DATE(created_at) = ? AND outcome IS NOT NULL AND reference IS NULL', + '2015-12-17' + ] + + count = Application.where(*sql_condition).count + puts "Affected applications: #{count}" + + Application.where(*sql_condition).each do |application| + puts "- fixing #{application.id}" + + application.completed_at = Time.zone.parse('2015-12-17 20:00:00') + application.completed_by_id = application.user_id + + generator_output = ReferenceGenerator.new(application).attributes + + application.reference = generator_output[:reference] + application.business_entity = generator_output[:business_entity] + + if application.part_payment.present? + application.state = :waiting_for_part_payment + elsif application.evidence_check.present? + application.state = :waiting_for_evidence + else + application.state = :processed + end + + application.save! + end + end +end
Create rake task for fixing 17th December issue
diff --git a/lib/tasks/rummager.rake b/lib/tasks/rummager.rake index abc1234..def5678 100644 --- a/lib/tasks/rummager.rake +++ b/lib/tasks/rummager.rake @@ -1,40 +1,10 @@ namespace :rummager do desc "index all published documents in rummager" task index: :environment do - require 'plek' - require 'rummageable' + Guide.all.each do |guide| + puts "Indexing #{guide.title}..." - root_document = { - format: "manual", - title: "Government Service Design Manual", - description: "All new digital services from the government must meet the Digital by Default Service Standard", - link: "/service-manual", - organisations: "government-digital-service", - } - index_document root_document - - Guide.all.each do |guide| - edition = guide.latest_edition - if edition.published? - puts "Indexing #{edition.title}..." - index_document({ - "format": "service_manual_guide", - "_type": "service_manual_guide", - "description": edition.description, - "indexable_content": edition.body, - "title": edition.title, - "link": guide.slug, - "manual": "/service-manual", - "organisations": [ "government-digital-service" ], - }) - end + SearchIndexer.new(guide).index end end - - def index_document document - @rummageable_index ||= Rummageable::Index.new( - Plek.current.find('rummager'), '/mainstream' - ) - @rummageable_index.add_batch([document]) - end end
Stop indexing root and use SearchIndexer in the rake task We haven't migrated the root yet so we don't want it to appear in both indexes and therefore twice.
diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index abc1234..def5678 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -0,0 +1,35 @@+class PostsController < ApplicationController + before_filter :authenticate_user! + before_filter :get_topic, :only => [ :new, :create ] + + def new + authorize! :update, @topic + + @post = @topic.posts.new :user_id => current_user.id + end + + def create + authorize! :update, @topic + + @post = @topic.posts.new params[:post] + @post.user_id = current_user.id + + if @post.save + flash[:notice] = "Post created successfully" + + @posts = @topic.posts + + render + else + render :new, :locals => { :topic => @topic, :post => @post } + end + + flash.discard + end + + private + + def get_topic + @topic = Topic.find params[:topic_id] + end +end
Add Posts Controller With new and create Actions Add a Posts controller, to include new and create actions.
diff --git a/test/controllers/accounts_controller_test.rb b/test/controllers/accounts_controller_test.rb index abc1234..def5678 100644 --- a/test/controllers/accounts_controller_test.rb +++ b/test/controllers/accounts_controller_test.rb @@ -13,6 +13,7 @@ assert_difference('Account.count') do post :create, account: accounts(:user1).serializable_hash() end + assert_not_nil assigns(:account) assert_redirected_to account_path(assigns(:account)) end end
Enforce test case for create account request.
diff --git a/test/functional/artefacts_controller_test.rb b/test/functional/artefacts_controller_test.rb index abc1234..def5678 100644 --- a/test/functional/artefacts_controller_test.rb +++ b/test/functional/artefacts_controller_test.rb @@ -6,6 +6,6 @@ get '/artefacts/' + artefact.to_param assert_equal 302, last_response.status - assert_equal Plek.current.publisher + "/admin/publications/#{artefact.to_param}", last_response.header['Location'] + assert_equal Plek.current.find('publisher') + "/admin/publications/#{artefact.to_param}", last_response.header['Location'] end end
Update test to new Plek API
diff --git a/test/functional/petitions_controller_test.rb b/test/functional/petitions_controller_test.rb index abc1234..def5678 100644 --- a/test/functional/petitions_controller_test.rb +++ b/test/functional/petitions_controller_test.rb @@ -33,7 +33,7 @@ assert_not_nil assigns(:signatures) end def test_clear_collections_cache - key = 'all_petitions:1234' + key = "#{Petition::COLLECTION_CACHE_PREFIX}:1234" REDIS.set(key, 'foo') CacheHelper.clear_collections_cache assert !REDIS.exists(key)
Fix the namespace in a unit test for cache clearing logic.
diff --git a/spec/changelog_spec.lint.rb b/spec/changelog_spec.lint.rb index abc1234..def5678 100644 --- a/spec/changelog_spec.lint.rb +++ b/spec/changelog_spec.lint.rb @@ -1,4 +1,4 @@-SimpleCov.command_name "lint" if ENV["COVERAGE"] == true +SimpleCov.command_name "lint" if ENV["COVERAGE"] == "true" RSpec.describe "Changelog" do subject(:changelog) do
Fix env variable value type
diff --git a/spec/classes/mod/jk_spec.rb b/spec/classes/mod/jk_spec.rb index abc1234..def5678 100644 --- a/spec/classes/mod/jk_spec.rb +++ b/spec/classes/mod/jk_spec.rb @@ -12,7 +12,7 @@ it { is_expected.to contain_file('jk.conf').that_notifies('Class[apache::service]') } end - context "with only required facts and no parameters" do + context "RHEL 6 with only required facts and no parameters" do let (:facts) do { @@ -37,4 +37,29 @@ end + context "Debian 8 with only required facts and no parameters" do + + let (:facts) do + { + :osfamily => 'Debian', + :operatingsystem => 'Debian', + :operatingsystemrelease => '8', + } + end + + let (:pre_condition) do + 'include apache' + end + + let (:params) do + { :logroot => '/var/log/apache2' } + end + + it_behaves_like 'minimal resources' + it { + verify_contents(catalogue, 'jk.conf', ['<IfModule jk_module>', '</IfModule>']) + } + + end + end
Include Debian 8 context in mod/jk spec test
diff --git a/tasks/acceptance.rake b/tasks/acceptance.rake index abc1234..def5678 100644 --- a/tasks/acceptance.rake +++ b/tasks/acceptance.rake @@ -1,7 +1,7 @@ namespace :acceptance do desc "shows components that can be tested separately" task :components do - exec("bundle exec vagrant-spec components") + exec("vagrant-spec components") end desc "runs acceptance tests using vagrant-spec" @@ -18,7 +18,7 @@ package ).map{ |s| "provider/parallels/#{s}" } - command = "bundle exec vagrant-spec test --components=#{components.join(" ")}" + command = "vagrant-spec test --components=#{components.join(" ")}" puts command puts exec(command)
Remove "bundle exec" from the rake task commands It is enough to run "bundle exec rake <...>" to get the same result.
diff --git a/spec/reset_password_spec.rb b/spec/reset_password_spec.rb index abc1234..def5678 100644 --- a/spec/reset_password_spec.rb +++ b/spec/reset_password_spec.rb @@ -20,6 +20,7 @@ it 'destroys any existing tokens' it 'emails a new reset token to the user and notifies them' do + pending "Haven't set up email testing environment yet." @uid = 'aa729' submit_reset_password_form @uid Token.count.should be 1
Mark mail-related test as pending
diff --git a/app/models/irs_group.rb b/app/models/irs_group.rb index abc1234..def5678 100644 --- a/app/models/irs_group.rb +++ b/app/models/irs_group.rb @@ -31,10 +31,6 @@ parent.hbx_enrollment_exemptions.where(:irs_group_id => self.id) end - def is_active?=(status) - self.is_active = status - end - def is_active? self.is_active end
Remove is_active setter with '?'
diff --git a/ext/extconf.rb b/ext/extconf.rb index abc1234..def5678 100644 --- a/ext/extconf.rb +++ b/ext/extconf.rb @@ -19,6 +19,7 @@ open(File.join(File.dirname(__FILE__), "ruby-config.h"), "wb") do |f| f.write <<-EOF +// These data types may be already defined if building on Windows (using MinGW) #ifndef DWORD #define DWORD #{DWORD} #endif
Add comment for MinGW build
diff --git a/app/controllers/gitlab_import_controller.rb b/app/controllers/gitlab_import_controller.rb index abc1234..def5678 100644 --- a/app/controllers/gitlab_import_controller.rb +++ b/app/controllers/gitlab_import_controller.rb @@ -8,7 +8,7 @@ private def owned_repos_list - current_user.owned_repositories.map(&:url_path).join(',') + current_user.owned_repositories.map(&:url_path).sort.join(',') end end
Sort repositories for GitLab import
diff --git a/lib/appium_console.rb b/lib/appium_console.rb index abc1234..def5678 100644 --- a/lib/appium_console.rb +++ b/lib/appium_console.rb @@ -5,12 +5,13 @@ module Appium; end unless defined? Appium -def define_reload paths +def define_reload Pry.send(:define_singleton_method, :reload) do - paths.each do |p| + files = load_appium_txt file: Dir.pwd + '/appium.txt' + files.each do |file| # If a page obj is deleted then load will error. begin - load p + load file rescue # LoadError: cannot load such file end end @@ -27,7 +28,7 @@ cmd = ['-r', start] if to_require && !to_require.empty? - define_reload to_require + define_reload load_files = to_require.map { |f| %(require "#{f}";) }.join "\n" cmd += [ '-e', load_files ] end
Update reload to support new files