diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/script/setup_database.rb b/script/setup_database.rb index abc1234..def5678 100644 --- a/script/setup_database.rb +++ b/script/setup_database.rb @@ -8,7 +8,7 @@ admin_command = ['curl', '-X PUT', - %Q{--data-binary \"#{admin_password}\"}, + %Q{--data-binary '"#{admin_password}"'}, "#{instance_uri}/_config/admins/#{admin_username}" ].join(' ')
Tweak body of PUT /_config/admins request.
diff --git a/week-5/gps2_2.rb b/week-5/gps2_2.rb index abc1234..def5678 100644 --- a/week-5/gps2_2.rb +++ b/week-5/gps2_2.rb @@ -0,0 +1,27 @@+# Method to create a list +# input: string of items separated by spaces (example: "carrots apples cereal pizza") +# steps: + # [fill in any steps here] + # set default quantity + # print the list to the console [can you use one of your other methods here?] +# output: [what data type goes here, array or hash?] + +# Method to add an item to a list +# input: item name and optional quantity +# steps: +# output: + +# Method to remove an item from the list +# input: +# steps: +# output: + +# Method to update the quantity of an item +# input: +# steps: +# output: + +# Method to print a list and make it look pretty +# input: +# steps: +# output:
Add week 5 directory and gps file
diff --git a/week-5/gps2_2.rb b/week-5/gps2_2.rb index abc1234..def5678 100644 --- a/week-5/gps2_2.rb +++ b/week-5/gps2_2.rb @@ -0,0 +1,67 @@+# Create a new list: make a new hash for the list +# Define a method that takes information in and creates a g-list +# The keys with be the product and the values is the quanaties + +# Add and item to the list: we will add a new key and value to the hash from the prev method +# Remove and item for the list: we will take an item out of the list. +# Update quanties: We will update the values to a new amount +# Print the list: we will print the list of all the item in the hash. + + +# INTITIAL + +def g_list + Hash.new() +end + +#ADD ITEM +def add(product, quant, list) + list[product] = quant +end + +def remove(product, list) + list.delete(product) +end + +def update(product, quant, list) + list[product] += quant +end + +def print_list(list) + list.each{ |key, value| puts "#{key} : #{value}" } +end + +# TESTS +p newlist = g_list +add("lemonade", 2, newlist) +add("tomato", 3, newlist) +add("onion", 1, newlist) +add("ice cream", 4, newlist) +p newlist +remove("lemonade", newlist) +p newlist +update("ice cream", -3, newlist ) +p newlist +print_list(newlist) + +# REFACTORED +def g_list + Hash.new() +end + +#ADD ITEM +def add(product, quant, list) + list[product] = quant +end + +def remove(product, list) + list.delete(product) +end + +def update(product, quant, list) + list[product] += quant +end + +def print_list(list) + list.each{ |product, quant| puts "#{product} : #{quant}" } +end
Add the solutions for gps
diff --git a/lib/rails-default-database.rb b/lib/rails-default-database.rb index abc1234..def5678 100644 --- a/lib/rails-default-database.rb +++ b/lib/rails-default-database.rb @@ -4,7 +4,7 @@ config_file = begin database_configuration_without_default - rescue Errno::ENOENT + rescue Errno::ENOENT, RuntimeError end || {} default_database_configuration.merge(config_file)
Fix rescue on Rails 4.2
diff --git a/spec/services/sell_item_spec.rb b/spec/services/sell_item_spec.rb index abc1234..def5678 100644 --- a/spec/services/sell_item_spec.rb +++ b/spec/services/sell_item_spec.rb @@ -0,0 +1,25 @@+require 'rails_helper' + +RSpec.describe SellItem, type: :class do + let(:campaign) { create(:campaign, money: 0) } + let(:hero) { create(:hero, id: 2) } + let(:item) { create(:item, campaign_id: campaign, price: 100, hero_id: hero) } + + before { described_class.new(item, campaign).call } + + it 'sells at price equal 50% of its worth' do + expect(item.sold_price).to eq 50 + end + + it 'adds sold item price to campaign money' do + expect(campaign.money).to eq 50 + end + + it 'removes hero from item' do + expect(item.hero_id).to eq nil + end + + it 'marks item as sold' do + expect(item.sold).to eq true + end +end
Add specs for sell_item service
diff --git a/app/controllers/billing_periods_controller.rb b/app/controllers/billing_periods_controller.rb index abc1234..def5678 100644 --- a/app/controllers/billing_periods_controller.rb +++ b/app/controllers/billing_periods_controller.rb @@ -2,13 +2,7 @@ before_filter :fetch_billing_periods def index - - end - - def new - end - - def edit + @new_bp = BillingPeriod.new end def create
Remove new and edit actions
diff --git a/rails/init.rb b/rails/init.rb index abc1234..def5678 100644 --- a/rails/init.rb +++ b/rails/init.rb @@ -1,3 +1,5 @@ # Register helpers for Rails < 3 require File.join(File.dirname(__FILE__), *%w[.. lib i18n_rails_helpers]) +require File.join(File.dirname(__FILE__), *%w[.. lib contextual_link_helpers]) ActionView::Base.send :include, I18nRailsHelpers +ActionView::Base.send :include, ContextualLinkHelpers
Make contexual link helpers available in rails < 3.
diff --git a/tire-suggest_plugin.gemspec b/tire-suggest_plugin.gemspec index abc1234..def5678 100644 --- a/tire-suggest_plugin.gemspec +++ b/tire-suggest_plugin.gemspec @@ -1,7 +1,7 @@ # coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -require 'tire/suggest/plugin/version' +require 'tire/suggest_plugin/version' Gem::Specification.new do |spec| spec.name = "tire-suggest_plugin"
Fix path to verion file in gemspec
diff --git a/rb/spec/integration/selenium/webdriver/browser_connection_spec.rb b/rb/spec/integration/selenium/webdriver/browser_connection_spec.rb index abc1234..def5678 100644 --- a/rb/spec/integration/selenium/webdriver/browser_connection_spec.rb +++ b/rb/spec/integration/selenium/webdriver/browser_connection_spec.rb @@ -3,16 +3,16 @@ describe "Driver" do context "browser connection" do - compliant_on :browser => nil do - it "can set the browser offline and online" do + compliant_on :browser => :android do + it "can set the browser offline and online" do driver.navigate.to url_for("html5Page.html") driver.should be_online driver.online = false - driver.should_not be_online + wait.until { not driver.online? } driver.online = true - driver.should be_online + wait.until { driver.online? } end end
JariBakken: Enable browser connection spec on Android. r15725
diff --git a/lib/scanny/checks/xss/xss_logger_check.rb b/lib/scanny/checks/xss/xss_logger_check.rb index abc1234..def5678 100644 --- a/lib/scanny/checks/xss/xss_logger_check.rb +++ b/lib/scanny/checks/xss/xss_logger_check.rb @@ -45,9 +45,9 @@ array = [ DynamicString< array = [ - ToString< - value = Send<name = any> - > + any*, + ToString, + any* ] > ]
Add implementation for multiple interpolation in XssLoggerCheck
diff --git a/test/govuk_component/government_navigation_test.rb b/test/govuk_component/government_navigation_test.rb index abc1234..def5678 100644 --- a/test/govuk_component/government_navigation_test.rb +++ b/test/govuk_component/government_navigation_test.rb @@ -0,0 +1,29 @@+require 'govuk_component_test_helper' + +class GovernmentNavigationTestCase < ComponentTestCase + def component_name + "government_navigation" + end + + test "renders a list of government links" do + render_component({}) + assert_select "\#proposition-links li a", text: "Departments" + assert_link_with_text("/government/organisations", "Departments") + assert_link_with_text("/government/announcements", "Announcements") + # etc. + end + + test "no links are active by default" do + render_component({}) + assert_select "a.active", false + end + + test "can mark a link as active" do + render_component({active: 'departments'}) + assert_select "a.active", text: "Departments" + end + + def assert_link_with_text(link, text) + assert_select "a[href=\"#{link}\"]", text: text + end +end
Add government navigation component test Test that government links are displayed and that they can be marked as active
diff --git a/lib/junoser/cli.rb b/lib/junoser/cli.rb index abc1234..def5678 100644 --- a/lib/junoser/cli.rb +++ b/lib/junoser/cli.rb @@ -18,11 +18,23 @@ end def display_set(io_or_string) - Junoser::Display::Set.new(io_or_string).transform + config = Junoser::Input.new(io_or_string).read + + if Junoser::Display.display_set?(config) + config + else + Junoser::Display::Set.new(config).transform + end end def struct(io_or_string) - Junoser::Display::Structure.new(io_or_string).transform + config = Junoser::Input.new(io_or_string).read + + if Junoser::Display.display_set?(config) + Junoser::Display::Structure.new(config).transform + else + config + end end
Return input intact when no transform is required instead of an error raised. * "-s" for structured input * "-d" for display-set input
diff --git a/config/application.rb b/config/application.rb index abc1234..def5678 100644 --- a/config/application.rb +++ b/config/application.rb @@ -21,5 +21,6 @@ # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. + config.active_job.queue_adapter = :sidekiq end end
Set Sidekiq as ActiveJob adapter Without this, the jobs were being run in-process. Oops!
diff --git a/lib/rapa/client.rb b/lib/rapa/client.rb index abc1234..def5678 100644 --- a/lib/rapa/client.rb +++ b/lib/rapa/client.rb @@ -19,5 +19,25 @@ connection.response :xml end end + + private + + # @private + # @return [String] + def access_key_id + @access_key_id + end + + # @private + # @return [String] + def associate_tag + @associate_tag + end + + # @private + # @return [String] + def secret_access_key + @secret_access_key + end end end
Add private getter as utility
diff --git a/lib/simple_blog.rb b/lib/simple_blog.rb index abc1234..def5678 100644 --- a/lib/simple_blog.rb +++ b/lib/simple_blog.rb @@ -1,4 +1,11 @@ require "simple_blog/engine" module SimpleBlog + class Engine < ::Rails::Engine + config.to_prepare do + Dir.glob(Rails.root + "app/decorators/**/*_decorator*.rb").each do |c| + require_dependency(c) + end + end + end end
Load any decorators from the main app if present
diff --git a/lib/cassanity/prepared_statement.rb b/lib/cassanity/prepared_statement.rb index abc1234..def5678 100644 --- a/lib/cassanity/prepared_statement.rb +++ b/lib/cassanity/prepared_statement.rb @@ -2,14 +2,16 @@ module Cassanity class PreparedStatement - # Internal: Initializes a PreparedStatement from a Cql::Client::PreparedStatement - # args - The Cql::Client::PreparedStatement received from the prepare request. + # Internal: Initializes a PreparedStatement from a Cql::Client::PreparedStatement. + # + # result - The Cql::Client::PreparedStatement received from the prepare request. def initialize(result) @driver_stmt = result end - # Public: Executes the prepared statement for a given values - # args - The Hash with values to use to execute. + # Public: Executes the prepared statement for a given values. + # + # variables - The Hash of variables to use to execute. def execute(variables) @driver_stmt.execute *fields.map { |field| variables.fetch field } end @@ -23,6 +25,5 @@ def extract_fields @driver_stmt.metadata.collect { |field| field.column_name.to_sym } end - end end
Correct documention for prepared statement
diff --git a/lib/controller_action_hud/widget.rb b/lib/controller_action_hud/widget.rb index abc1234..def5678 100644 --- a/lib/controller_action_hud/widget.rb +++ b/lib/controller_action_hud/widget.rb @@ -6,7 +6,7 @@ <<-EOF <style type="text/css"> div#controller_action_hud { - position: absolute; + position: fixed; bottom: 0; right: 0; background-color: black;
Use fixed positioning, not absolute
diff --git a/lib/delayed_job_dashboard/engine.rb b/lib/delayed_job_dashboard/engine.rb index abc1234..def5678 100644 --- a/lib/delayed_job_dashboard/engine.rb +++ b/lib/delayed_job_dashboard/engine.rb @@ -2,10 +2,12 @@ require 'delayed_job_dashboard' require 'rails' require 'haml' - class Engine < Rails::Engine + class Engine < Rails::Engine engine_name :delayed_job_dashboard - paths["app"] # => ["app/helpers"] - #paths["app/helpers"] # => ["app/helpers"] - # end - end -end+ paths["app"] + + initializer :assets do |config| + Rails.application.config.assets.precompile += %w( delayed_job_dashboard.css ) + end + end +end
Add CSS file to the list of assets to precompile.
diff --git a/lib/everything/blog/output/media.rb b/lib/everything/blog/output/media.rb index abc1234..def5678 100644 --- a/lib/everything/blog/output/media.rb +++ b/lib/everything/blog/output/media.rb @@ -5,7 +5,7 @@ module Output class Media < FileBase def output_content - File.binread(source_file.content) + source_file.content end def output_file_name
Fix usage of source file content
diff --git a/activesupport/test/core_ext/kernel/concern_test.rb b/activesupport/test/core_ext/kernel/concern_test.rb index abc1234..def5678 100644 --- a/activesupport/test/core_ext/kernel/concern_test.rb +++ b/activesupport/test/core_ext/kernel/concern_test.rb @@ -6,7 +6,8 @@ mod = ::TOPLEVEL_BINDING.eval 'concern(:ToplevelConcern) { }' assert_equal mod, ::ToplevelConcern assert_kind_of ActiveSupport::Concern, ::ToplevelConcern - assert !Object.ancestors.include?(::ToplevelConcern), mod.ancestors.inspect + assert_not Object.ancestors.include?(::ToplevelConcern), mod.ancestors.inspect + ensure Object.send :remove_const, :ToplevelConcern end end
Move test teardown into `ensure` block.
diff --git a/app/helpers/spree/admin/general_settings_helper.rb b/app/helpers/spree/admin/general_settings_helper.rb index abc1234..def5678 100644 --- a/app/helpers/spree/admin/general_settings_helper.rb +++ b/app/helpers/spree/admin/general_settings_helper.rb @@ -2,7 +2,7 @@ module Admin module GeneralSettingsHelper def currency_options - currencies = ::Money::Currency.table.map do |code, details| + currencies = ::Money::Currency.table.map do |_code, details| iso = details[:iso_code] [iso, "#{details[:name]} (#{iso})"] end
Fix simple rubocop issues in helpers
diff --git a/TableViewDescriptor.podspec b/TableViewDescriptor.podspec index abc1234..def5678 100644 --- a/TableViewDescriptor.podspec +++ b/TableViewDescriptor.podspec @@ -1,20 +1,11 @@-# -# Be sure to run `pod lib lint TableViewDescriptor.podspec' to ensure this is a -# valid spec and remove all comments before submitting the spec. -# -# Any lines starting with a # are optional, but encouraged -# -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html -# - Pod::Spec.new do |s| s.name = "TableViewDescriptor" - s.version = "1.0" - s.summary = "Simplify Table view delegation via blocks." - s.homepage = "http://gitlab.socrate.vsct.fr/dwm-mobile/TableDescriptorIOS" + s.version = "1.0.1" + s.summary = "Structure UItableview implementation in a data-oriented way instead of index-oriented." + s.homepage = "https://github.com/voyages-sncf-technologies/VSTableViewDescriptor" s.license = 'MIT' - s.author = { "GWENN GUIHAL" => "gguihal@voyages-sncf.com" } - s.source = { :git => "git@gitlab.socrate.vsct.fr:dwm-mobile/TableDescriptorIOS.git", :tag => "1.0" } + s.author = { "GWENN GUIHAL" => "gwenn.guihal@gmail.com" } + s.source = { :git => "https://github.com/voyages-sncf-technologies/VSTableViewDescriptor.git", :tag => "1.0.1" } s.platform = :ios, '6.0'
Update PodSpecs (now in github)
diff --git a/WebASDKImageManager.podspec b/WebASDKImageManager.podspec index abc1234..def5678 100644 --- a/WebASDKImageManager.podspec +++ b/WebASDKImageManager.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "WebASDKImageManager" - s.version = "1.0.1" + s.version = "1.1.0" s.summary = "Image downloader and cache for AsyncDisplayKit that uses SDWebImage" s.description = <<-DESC An image downloader and cache for AsyncDisplayKit that uses SDWebImage. The image manager conforms to ASImageDownloaderProtocol and ASImageCacheProtocol.
[1.1.0] Fix a Swift error w.r.t. missing init method
diff --git a/Casks/python26.rb b/Casks/python26.rb index abc1234..def5678 100644 --- a/Casks/python26.rb +++ b/Casks/python26.rb @@ -3,7 +3,7 @@ sha256 'f3683e71af5cd96dfd838c76ef7011ca0521562fb2f0d8c30a43dffe62d57c49' url "https://www.python.org/ftp/python/#{version}/python-#{version}-macosx10.3.dmg" - homepage 'http://www.python.org/' + homepage 'https://www.python.org/' license :oss pkg 'Python.mpkg'
Update Python26 homepage URL to https
diff --git a/app/controllers/api/v1/performances_controller.rb b/app/controllers/api/v1/performances_controller.rb index abc1234..def5678 100644 --- a/app/controllers/api/v1/performances_controller.rb +++ b/app/controllers/api/v1/performances_controller.rb @@ -6,7 +6,7 @@ # Parse given date assuming competition's local time zone local_tz = competition.host.time_zone - @date = local_tz.parse(params[:local_date]) + @date = local_tz.parse(params[:date]) @performances = competition.staged_performances(@venue, @date) .includes(
Change name of date parameter for /performances to be in line with web timetable path
diff --git a/app/controllers/application_controller/feature.rb b/app/controllers/application_controller/feature.rb index abc1234..def5678 100644 --- a/app/controllers/application_controller/feature.rb +++ b/app/controllers/application_controller/feature.rb @@ -1,19 +1,19 @@ class ApplicationController - Feature = Struct.new(:role, :role_any, :name, :accord_name, :title) do + Feature = Struct.new(:role, :role_any, :name, :title) do def self.new_with_hash(hash) - feature = new(*members.collect { |m| hash[m] }) - feature.autocomplete - feature - end - - def autocomplete - self.accord_name = name.to_s unless accord_name + new(*members.collect { |m| hash[m] }) end def accord_hash - {:name => accord_name, - :title => title, - :container => "#{accord_name}_accord"} + { + :name => name.to_s, + :title => title, + :container => "#{name}_accord" + } + end + + def accord_name + name.to_s end def tree_name
Drop the :accord_name from ApplicationController::Feature struct
diff --git a/Formula/o-make.rb b/Formula/o-make.rb index abc1234..def5678 100644 --- a/Formula/o-make.rb +++ b/Formula/o-make.rb @@ -31,3 +31,16 @@ module Exec = struct (* +diff --git a/OMakefile b/OMakefile +index 9b77a25..1d61d70 100644 +--- a/OMakefile ++++ b/OMakefile +@@ -57,7 +57,7 @@ if $(not $(defined CAMLLIB)) + # + # OCaml options + # +-OCAMLFLAGS[] += -w Ae$(if $(OCAML_ACCEPTS_Z_WARNING), z) ++OCAMLFLAGS[] += -w Ae$(if $(OCAML_ACCEPTS_Z_WARNING), z)-9-27..29 + if $(THREADS_ENABLED) + OCAMLFLAGS += -thread + export
Patch OMake to build under OCaml 3.12 Signed-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com>
diff --git a/gas.gemspec b/gas.gemspec index abc1234..def5678 100644 --- a/gas.gemspec +++ b/gas.gemspec @@ -22,7 +22,7 @@ s.add_development_dependency 'rspec' s.add_development_dependency 'rr' - s.files = Dir.glob("{bin,lib,spec,config}/**/*") + ['LICENSE', 'README.textile'] + s.files = Dir.glob("{bin,lib,spec,config}/**/*") + ['LICENSE', 'README.md'] s.executables = Dir.glob("bin/*").map { |file| file.split('/').last } s.require_path = ['lib'] end
Use new README in gemspec
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 @@ -18,7 +18,7 @@ it { is_expected.to contain_class('apache') } it { is_expected.to contain_apache__mod('jk') } it { is_expected.to contain_file('jk.conf').that_notifies('Class[apache::service]').with( - :ensure => file, + :ensure => 'file', :content => /<IfModule jk_module>/, :content => /<\/IfModule>/, )}
Add correctly quoted parameters for jk.conf file in mod::jk spec test
diff --git a/plugins/mclist.rb b/plugins/mclist.rb index abc1234..def5678 100644 --- a/plugins/mclist.rb +++ b/plugins/mclist.rb @@ -15,7 +15,7 @@ old_stdout.close end - text = if data.players.empty? + text = if data.players.nil? "No players online" else "#{data.players.size} player#{"s" if data.players.size != 1} online: #{data.players.join ', '}"
Fix crash on empty player list
diff --git a/examples/async_sum.rb b/examples/async_sum.rb index abc1234..def5678 100644 --- a/examples/async_sum.rb +++ b/examples/async_sum.rb @@ -0,0 +1,57 @@+# +# bundle exec ruby examples/async_sum.rb client +# bundle exec ruby examples/async_sum.rb server +# + +require "tennis" +require "tennis/backend/redis" + +logger = Logger.new(STDOUT) +logger.level = Logger::DEBUG +redis_url = "redis://localhost:6379" + +Tennis.configure do |config| + config.backend = Tennis::Backend::Redis.new(logger: logger, url: redis_url) + config.logger = logger +end + +class Job + include Tennis::Job + + def sum(*numbers) + sleep 0.4 + total = numbers.inject(&:+) + puts "Sum #{numbers} => #{total}" + end + + def job_dump + nil + end + + def self.job_load(_) + new + end +end + + +if ARGV[0] == "server" + require "tennis/launcher" + + # Start Tennis. + launcher = Tennis::Launcher.new(concurrency: 2, job_classes: [Job]) + launcher.async.start + + begin + sleep 5 while true + rescue Interrupt + puts "Stopping the server..." + ensure + launcher.async.stop + end +else + # Instanciate a job and add the sum to the job to do. + numbers = (1..9).to_a + 10.times do + Job.new.async.sum(*numbers.sample(3)) + end +end
Add the async sum example
diff --git a/app/controllers/api/v1/assignments_controller.rb b/app/controllers/api/v1/assignments_controller.rb index abc1234..def5678 100644 --- a/app/controllers/api/v1/assignments_controller.rb +++ b/app/controllers/api/v1/assignments_controller.rb @@ -13,6 +13,7 @@ def create #TODO project = Project.create(project_params) @assignment = project.assign_to(current_resource_owner) + @assignment.update_attributes(assignment_params) if @assignment.errors.empty? render :json => @assignment
Set assignment params in controller
diff --git a/app/models/calculations/v3/models/participant.rb b/app/models/calculations/v3/models/participant.rb index abc1234..def5678 100644 --- a/app/models/calculations/v3/models/participant.rb +++ b/app/models/calculations/v3/models/participant.rb @@ -18,7 +18,7 @@ def member?(year) return false unless membership - membership.include? Date.new(year, 12, 31) + membership.cover? Date.new(year, 12, 31) end def validate!
Replace deprecated include with cover
diff --git a/db/migrate/20150417123245_create_users_table.rb b/db/migrate/20150417123245_create_users_table.rb index abc1234..def5678 100644 --- a/db/migrate/20150417123245_create_users_table.rb +++ b/db/migrate/20150417123245_create_users_table.rb @@ -1,7 +1,7 @@ class CreateUsersTable < ActiveRecord::Migration def change create_table :users do |t| - t.string :name, null: false + t.string :name, null: false, unique: true t.string :password_digest t.timestamps end
Add unique constraint to users.name
diff --git a/db/migrate/20190501225540_create_atomic_docs.rb b/db/migrate/20190501225540_create_atomic_docs.rb index abc1234..def5678 100644 --- a/db/migrate/20190501225540_create_atomic_docs.rb +++ b/db/migrate/20190501225540_create_atomic_docs.rb @@ -3,6 +3,7 @@ create_table :atomic_docs do |t| t.string :url t.string :status + t.string :file_path t.timestamps end
Add file_path to atomic_docs model
diff --git a/db/migrate/20190221195137_change_broadcast_id_to_bigint.rb b/db/migrate/20190221195137_change_broadcast_id_to_bigint.rb index abc1234..def5678 100644 --- a/db/migrate/20190221195137_change_broadcast_id_to_bigint.rb +++ b/db/migrate/20190221195137_change_broadcast_id_to_bigint.rb @@ -0,0 +1,19 @@+class ChangeBroadcastIdToBigint < ActiveRecord::Migration[6.0] + def up + change_column :broadcasts, :id, :bigint + + change_column :article_votes, :article_id, :bigint + change_column :notifications, :broadcast_id, :bigint + change_column :replies, :broadcast_id, :bigint + change_column :reply_users, :broadcast_id, :bigint + end + + def down + change_column :broadcasts, :id, :integer + + change_column :article_votes, :article_id, :integer + change_column :notifications, :broadcast_id, :integer + change_column :replies, :broadcast_id, :integer + change_column :reply_users, :broadcast_id, :integer + end +end
Update broadcast_id primary and foreign keys to bigint
diff --git a/spree_advanced_cart.gemspec b/spree_advanced_cart.gemspec index abc1234..def5678 100644 --- a/spree_advanced_cart.gemspec +++ b/spree_advanced_cart.gemspec @@ -18,7 +18,7 @@ s.add_dependency 'spree_core', '~> 1.0' s.add_dependency('spree_promo', '~> 1.0') - s.add_dependency('zip-code-info', '>= 0.1.0') + s.add_dependency('zip-code-info', '~> 0.1.1') s.add_development_dependency('rspec-rails', '~> 2.7') s.add_development_dependency('sqlite3')
Bump version of zip-code-info gem
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 = 'log' - s.version = '0.4.2.2' + s.version = '0.4.3.0' s.summary = 'Logging to STD IO with levels, tagging, and coloring' s.description = ' '
Package version is increased from 0.4.2.2 to 0.4.3.0
diff --git a/spec/factories/input.rb b/spec/factories/input.rb index abc1234..def5678 100644 --- a/spec/factories/input.rb +++ b/spec/factories/input.rb @@ -2,7 +2,6 @@ factory :input do sequence(:lookup_id) key { "input-#{ lookup_id }" } - factor 1 min_value 0 max_value 100 start_value 10
Remove "factor" from the Input spec factory
diff --git a/spec/factories/users.rb b/spec/factories/users.rb index abc1234..def5678 100644 --- a/spec/factories/users.rb +++ b/spec/factories/users.rb @@ -24,7 +24,7 @@ end after(:create) do |user| - user.confirm! + user.confirm end end end
Replace deprecated confirm! with confirm.
diff --git a/spec/support/proxies.rb b/spec/support/proxies.rb index abc1234..def5678 100644 --- a/spec/support/proxies.rb +++ b/spec/support/proxies.rb @@ -1,6 +1,7 @@ module ProxiesHelper def create_proxy_using_partial(*users) users.each do |user| + sleep(1) first('a.select2-choice').click find(".select2-input").set(user.user_key) expect(page).to have_css("div.select2-result-label")
Add a pause so the test works
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -15,5 +15,4 @@ source_url 'https://github.com/chef-cookbooks/resolver' issues_url 'https://github.com/chef-cookbooks/resolver/issues' - -chef_version '>= 12.1' +chef_version '>= 12.1' if respond_to?(:chef_version)
Fix compatibility with old chef 12 clients Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -8,7 +8,7 @@ issues_url 'https://github.com/criteo-cookbooks/chef-nexus3/issues' if respond_to?(:issues_url) version '2.1.0' -chef_version '>= 12.10.27' +chef_version '>= 12.14.34' supports 'centos' supports 'debian'
Update Chef version requirement to use sensitive properties
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,6 +6,8 @@ description 'Provides httpd_service, httpd_config, and httpd_module resources' source_url 'https://github.com/chef-cookbooks/httpd' if respond_to?(:source_url) issues_url 'https://github.com/chef-cookbooks/httpd/issues' if respond_to?(:issues_url) + +depends 'compat_resource' supports 'amazon' supports 'redhat'
Bring in the compat_resource cookbook
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -7,7 +7,7 @@ version '2.4.0' recipe 'bluepill::default', 'Installs bluepill rubygem and sets up management directories' -depends 'rsyslog' +depends 'rsyslog', '~> 2.0' source_url 'https://github.com/chef-cookbooks/bluepill' if respond_to?(:source_url) issues_url 'https://github.com/chef-cookbooks/bluepill/issues' if respond_to?(:issues_url)
Use rsyslog 2.0 for Chef 11 compat
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -12,3 +12,7 @@ %w{ centos debian redhat scientific ubuntu }.each do |os| supports os end + +%w{ hadoop_cluster hadoop_cluster_rpm hadoop_for_hbase hbase hbase_cluster hive pig zookeeper zookeeper_cluster }.each do |cb| + conflicts cb +end
Add conflicts section for cookbooks we obsolete
diff --git a/app.rb b/app.rb index abc1234..def5678 100644 --- a/app.rb +++ b/app.rb @@ -8,6 +8,9 @@ get '/' do Net::HTTP.post_form(URI.parse( 'https://api.justyo.co/yoall/'), - {'api_token' => ENV['YO_KEY']} + { + 'api_token' => ENV['YO_KEY'], + 'link' => 'http://yotext.co/show/?text=COFFEE TIME?' + } ) end
Include yotext "COFFEE TIME" link
diff --git a/em-berp-protocol.gemspec b/em-berp-protocol.gemspec index abc1234..def5678 100644 --- a/em-berp-protocol.gemspec +++ b/em-berp-protocol.gemspec @@ -19,4 +19,5 @@ gem.add_dependency 'bert' gem.add_dependency 'eventmachine' + gem.add_development_dependency 'rake' end
Add rake as a dev dependency
diff --git a/gusteau.gemspec b/gusteau.gemspec index abc1234..def5678 100644 --- a/gusteau.gemspec +++ b/gusteau.gemspec @@ -23,4 +23,5 @@ gem.add_dependency 'archive-tar-minitar', '~> 0.5.2' gem.add_development_dependency 'minitest' + gem.add_development_dependency 'mocha' end
Add missing mocha gem dependency
diff --git a/features/step_definitions/member_signup_processor_steps.rb b/features/step_definitions/member_signup_processor_steps.rb index abc1234..def5678 100644 --- a/features/step_definitions/member_signup_processor_steps.rb +++ b/features/step_definitions/member_signup_processor_steps.rb @@ -6,11 +6,11 @@ Given /^I requested (\d+) membership at the level called "(.*?)"$/ do |quantity, membership_level| @quantity = quantity @membership_level = membership_level + @payment_method = 'invoice' @line_items = [{ 'quantity' => quantity, 'base_price' => nil, - 'description' => nil, - 'payment_method' => 'invoice' + 'description' => nil }] end
Set payment method to invoice It should've been here, not the line items
diff --git a/smart_properties.gemspec b/smart_properties.gemspec index abc1234..def5678 100644 --- a/smart_properties.gemspec +++ b/smart_properties.gemspec @@ -12,6 +12,10 @@ gem.summary = %q{SmartProperties – Ruby accessors on steroids} gem.homepage = "" + gem.metadata = { + "source_code_uri" => "https://github.com/t6d/smart_properties" + } + gem.files = `git ls-files`.split($\) gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) } gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
Add metadata for the source code By doing this, automated tools like dependabot can now find the repository based on the gem.
diff --git a/ios-sdk.podspec b/ios-sdk.podspec index abc1234..def5678 100644 --- a/ios-sdk.podspec +++ b/ios-sdk.podspec @@ -23,5 +23,6 @@ cs.dependency "OnTheRoad" cs.dependency "Tangram-es" cs.source_files = "src/*.swift" + cs.resources = 'images/*.png' end end
Add images import to podfile
diff --git a/dry-container.gemspec b/dry-container.gemspec index abc1234..def5678 100644 --- a/dry-container.gemspec +++ b/dry-container.gemspec @@ -19,7 +19,7 @@ spec.add_runtime_dependency 'concurrent-ruby', '~> 1.0' spec.add_runtime_dependency 'dry-configurable', '~> 0.1', '>= 0.1.3' - spec.add_development_dependency 'bundler' + spec.add_development_dependency 'bundler', '~> 2.1' spec.add_development_dependency 'rake' spec.add_development_dependency 'rspec' end
Set bundler version in the gemspec
diff --git a/common/src/rb/lib/selenium/webdriver/zip_helper.rb b/common/src/rb/lib/selenium/webdriver/zip_helper.rb index abc1234..def5678 100644 --- a/common/src/rb/lib/selenium/webdriver/zip_helper.rb +++ b/common/src/rb/lib/selenium/webdriver/zip_helper.rb @@ -13,7 +13,10 @@ Zip::ZipFile.open(path) do |zip| zip.each do |entry| - zip.extract(entry, File.join(destination, entry.name)) + to = File.join(destination, entry.name) + FileUtils.mkdir_p File.dirname(to) + + zip.extract(entry, to) end end
JariBakken: Fix scoping issue on Ruby 1.8 and make sure dirs exist when unzipping. git-svn-id: 4179480af2c2519a5eb5e1e9b541cbdf5cf27696@9225 07704840-8298-11de-bf8c-fd130f914ac9
diff --git a/htwax.gemspec b/htwax.gemspec index abc1234..def5678 100644 --- a/htwax.gemspec +++ b/htwax.gemspec @@ -9,7 +9,7 @@ spec.authors = ['Mark H. Wilkinson'] spec.email = ['mhw@dangerous-techniques.com'] spec.summary = %q{An experimental HTTP client for APIs.} - spec.description = %q{TODO: Write a longer description. Optional.} + spec.description = %q{An experimental HTTP client for APIs.} spec.homepage = '' spec.license = 'MIT'
Set gem description to silence bundler warning.
diff --git a/execjs-xtrn.gemspec b/execjs-xtrn.gemspec index abc1234..def5678 100644 --- a/execjs-xtrn.gemspec +++ b/execjs-xtrn.gemspec @@ -13,7 +13,8 @@ spec.homepage = "https://github.com/ukoloff/execjs-xtrn" spec.license = "MIT" - spec.files = `git ls-files`.split($/) + spec.files = `git ls-files`.split($/)+ + Dir.glob('**/node_modules/*/*.js') spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"]
Add NPM modules to gem
diff --git a/guard-jasmine.gemspec b/guard-jasmine.gemspec index abc1234..def5678 100644 --- a/guard-jasmine.gemspec +++ b/guard-jasmine.gemspec @@ -21,7 +21,8 @@ s.add_development_dependency 'bundler', '~> 1.0' s.add_development_dependency 'guard-rspec', '~> 0.4' s.add_development_dependency 'rspec', '~> 2.6' + s.add_development_dependency 'yard', '~> 0.7.2' - s.files = Dir.glob('{lib}/**/*') + %w[LICENSE README.md] + s.files = Dir.glob('{lib}/**/*') + %w[LICENSE.MIT LICENSE.BSD README.md] s.require_path = 'lib' end
Add yardoc to the dependencies.
diff --git a/spec/factories/musics.rb b/spec/factories/musics.rb index abc1234..def5678 100644 --- a/spec/factories/musics.rb +++ b/spec/factories/musics.rb @@ -8,6 +8,12 @@ clear_level 1 play_count 0 miss_count 2 + + Settings.difficulty.each do |d| + trait "difficulty_#{d}".to_sym do + difficulty d + end + end end end
Improve with trait * Add each difficulty factories
diff --git a/spec/tic_tac_toe_spec.rb b/spec/tic_tac_toe_spec.rb index abc1234..def5678 100644 --- a/spec/tic_tac_toe_spec.rb +++ b/spec/tic_tac_toe_spec.rb @@ -3,11 +3,6 @@ describe TicTacToe do it 'has a version number' do expect(TicTacToe::VERSION).not_to be nil - end - - it 'has a board' do - game = TicTacToe::Board.new - expect(game).to be_an_instance_of TicTacToe::Board end describe TicTacToe::Board do
Remove not very useful test
diff --git a/app/controllers/course/assessment/submission/answer/programming/annotations_controller.rb b/app/controllers/course/assessment/submission/answer/programming/annotations_controller.rb index abc1234..def5678 100644 --- a/app/controllers/course/assessment/submission/answer/programming/annotations_controller.rb +++ b/app/controllers/course/assessment/submission/answer/programming/annotations_controller.rb @@ -10,7 +10,7 @@ if super && @annotation.save send_created_notification(@post) else - render status: :bad_request + head :bad_request end end end
Modify controller action to only return status 400 - Using render results in rails trying to render the 'create' partial after the action has completed execution. - This causes the app to try to render the entire programming annotation with an invalid post, causing errors as the created_at is nil.
diff --git a/db/migrate/20120302165728_change_host_defaults.rb b/db/migrate/20120302165728_change_host_defaults.rb index abc1234..def5678 100644 --- a/db/migrate/20120302165728_change_host_defaults.rb +++ b/db/migrate/20120302165728_change_host_defaults.rb @@ -0,0 +1,10 @@+class ChangeHostDefaults < ActiveRecord::Migration + def up + change_column :roles, :max_visitors_per_meeting, :integer, :default => 1 + change_column :roles, :max_visitors, :integer, :default => 10 + end + + def down + raise ActiveRecord::IrreversibleMigration + end +end
Update hosts' default meeting caps
diff --git a/app/models/renalware/ukrdc/pathology_observation_requests_query.rb b/app/models/renalware/ukrdc/pathology_observation_requests_query.rb index abc1234..def5678 100644 --- a/app/models/renalware/ukrdc/pathology_observation_requests_query.rb +++ b/app/models/renalware/ukrdc/pathology_observation_requests_query.rb @@ -18,7 +18,7 @@ Pathology::ObservationRequest .where(id: Pathology::ObservationRequest.distinct_for_patient_id(patient_id)) .where("requested_at >= ?", changes_since) - .where("loinc_code is not null") + .where("coalesce(loinc_code, '') != ''") # excludes NULL and '' .eager_load( :description, observations: { description: :measurement_unit }
Fix UKRDC path query to only return results having a loinc_code We will not send any observations where the observation_description.loinc_code is NULL or ‘’
diff --git a/app/services/weather_man.rb b/app/services/weather_man.rb index abc1234..def5678 100644 --- a/app/services/weather_man.rb +++ b/app/services/weather_man.rb @@ -21,7 +21,7 @@ raise ArgumentError if !zip_code throttle ||= 9 - Rails.cache.fetch(key_for(zip_code, datetime), :expires_in => 1.hour) do + Rails.cache.fetch(key_for(zip_code, datetime), :expires_in => 1.day) do sleep throttle observationHash = @w_api.history_for(datetime, zip_code)
Increase TTL for rails cache to 1 day
diff --git a/example/example1.rb b/example/example1.rb index abc1234..def5678 100644 --- a/example/example1.rb +++ b/example/example1.rb @@ -23,3 +23,15 @@ printer = BacktraceCounter::CsvPrinter.new printer.print BacktraceCounter.backtraces +__END__ +> ruby example/example1.rb +Foo#foo,100,"example/example1.rb:6:in `foo' +example/example1.rb:20:in `block (2 levels) in <main>' +example/example1.rb:20:in `times' +example/example1.rb:20:in `block in <main>' +example/example1.rb:18:in `<main>'" +Bar#bar,200,"example/example1.rb:12:in `bar' +example/example1.rb:21:in `block (2 levels) in <main>' +example/example1.rb:21:in `times' +example/example1.rb:21:in `block in <main>' +example/example1.rb:18:in `<main>'"
Write the output of the example
diff --git a/app/views/layouts/bobcat.rb b/app/views/layouts/bobcat.rb index abc1234..def5678 100644 --- a/app/views/layouts/bobcat.rb +++ b/app/views/layouts/bobcat.rb @@ -21,6 +21,18 @@ end end end + + # Login link and icon + def login(params={}) + (current_user) ? link_to_logout(params) : link_to_login(params) + end + + # Link to logout + def link_to_logout(params={}) + icon_tag(:logout) + + link_to("Log-out #{current_user.firstname}", + logout_url(params), class: "logout") + end end end end
Update the :link_to_logout method to display firstname for now
diff --git a/extra_extra.gemspec b/extra_extra.gemspec index abc1234..def5678 100644 --- a/extra_extra.gemspec +++ b/extra_extra.gemspec @@ -9,7 +9,7 @@ s.version = ExtraExtra::VERSION s.authors = ["Stitch Fix Engineering"] s.email = ["opensource@stitchfix.com"] - s.homepage = "http://tech.stitchfix.com" + s.homepage = "https://github.com/stitchfix/extra_extra" s.summary = "Let your users read all about how awesome your app is!" s.description = "Provides a simple way to include and manage release notes for internal applications by writing a markdown file" s.license = "MIT"
Make homepage GitHub repo, so gem information is easily accessible
diff --git a/lib/base62.rb b/lib/base62.rb index abc1234..def5678 100644 --- a/lib/base62.rb +++ b/lib/base62.rb @@ -8,7 +8,7 @@ class << self def decode(str) out = 0 - str.split(//).reverse.each_with_index do |char, index| + str.chars.reverse.each_with_index do |char, index| place = PRIMITIVES.size ** index out += PRIMITIVES.index(char) * place end
Use `chars` instead of `split`
diff --git a/asdf/recipes/code_deploy.rb b/asdf/recipes/code_deploy.rb index abc1234..def5678 100644 --- a/asdf/recipes/code_deploy.rb +++ b/asdf/recipes/code_deploy.rb @@ -23,3 +23,10 @@ group "ubuntu" recursive true end + +directory "/mnt/data/backups" do + action :create + owner "ubuntu" + group "ubuntu" + recursive true +end
Add backup dir to asdf
diff --git a/roles/web.rb b/roles/web.rb index abc1234..def5678 100644 --- a/roles/web.rb +++ b/roles/web.rb @@ -19,7 +19,7 @@ :web => { :status => "online", :database_host => "db", - :readonly_database_host => "db-slave" + :readonly_database_host => "db" } )
Move readonly database traffic to katla
diff --git a/lib/cucumber_tree/handler/database.rb b/lib/cucumber_tree/handler/database.rb index abc1234..def5678 100644 --- a/lib/cucumber_tree/handler/database.rb +++ b/lib/cucumber_tree/handler/database.rb @@ -10,9 +10,17 @@ end def save(snapshot) - dump_dir = "#{Rails.root}/tmp/cucumber_tree/#{Time.now.to_f}" + dump_dir = get_dump_dir SerializationHelper::Base.new(YamlDb::Helper).dump_to_dir(dump_dir) snapshot[:dump_dir] = dump_dir + end + + private + + def get_dump_dir + root_path = Rails.root.join('tmp','cucumber_tree') + root_path.mkpath unless root_path.exist? + root_path.join(Time.now.to_f.to_s).to_path end end end
Create tmp dir if does not exist
diff --git a/myaso.gemspec b/myaso.gemspec index abc1234..def5678 100644 --- a/myaso.gemspec +++ b/myaso.gemspec @@ -12,7 +12,7 @@ spec.description = 'Myaso is a morphological analysis library in Ruby.' spec.summary = 'Myaso is a morphological analysis and synthesis ' \ 'library in Ruby.' - spec.homepage = 'https://github.com/ustalov/myaso' + spec.homepage = 'https://github.com/dmchk/myaso' spec.license = 'MIT' spec.files = `git ls-files`.split($/)
Change the GitHub URI [ci skip]
diff --git a/lib/rails_bootstrap_navbar/railtie.rb b/lib/rails_bootstrap_navbar/railtie.rb index abc1234..def5678 100644 --- a/lib/rails_bootstrap_navbar/railtie.rb +++ b/lib/rails_bootstrap_navbar/railtie.rb @@ -15,12 +15,6 @@ else '[request.protocol, request.host_with_port, request.fullpath].join' end - - if Gem.loaded_specs.keys.include?('bootstrap-sass') - bootstrap_sass_version = Gem.loaded_specs['bootstrap-sass'].version - bootstrap_version = bootstrap_sass_version.to_s[0..4] - config.bootstrap_version = bootstrap_version - end end ActionView::Base.send :include, BootstrapNavbar::Helpers
Remove bootstrap-sass version sniffing, its implemented in bootstrap-navbar gem now
diff --git a/lib/gitchart.rb b/lib/gitchart.rb index abc1234..def5678 100644 --- a/lib/gitchart.rb +++ b/lib/gitchart.rb @@ -7,7 +7,7 @@ include Grit class GitChart - def initialize(size = '1000x300', threed = true, repo = '.') + def initialize(size = '1000x300', threed = true, repo = '.', branch = 'master') begin @repo = Repo.new(repo) rescue @@ -15,15 +15,17 @@ end @size = size @threed = threed + @branch = branch end def run + @commits = @repo.commits @branch, 100 chart_authors end def chart_authors authors = {} - @repo.commits.each do |c| + @commits.each do |c| if authors[c.author.to_s] authors[c.author.to_s] += 1 else
Allow up to 100 commits, instead of 10
diff --git a/lib/ice_nine.rb b/lib/ice_nine.rb index abc1234..def5678 100644 --- a/lib/ice_nine.rb +++ b/lib/ice_nine.rb @@ -5,13 +5,14 @@ require 'ice_nine/support/recursion_guard' require 'ice_nine/freezer' -require 'ice_nine/freezer/no_freeze' require 'ice_nine/freezer/object' require 'ice_nine/freezer/array' require 'ice_nine/freezer/hash' require 'ice_nine/freezer/range' require 'ice_nine/freezer/struct' + +require 'ice_nine/freezer/no_freeze' require 'ice_nine/version'
Move require statement below other libs that create dependent constants
diff --git a/fezzik.gemspec b/fezzik.gemspec index abc1234..def5678 100644 --- a/fezzik.gemspec +++ b/fezzik.gemspec @@ -9,7 +9,7 @@ s.required_rubygems_version = Gem::Requirement.new(">=0") if s.respond_to? :required_rubygems_version= s.specification_version = 2 if s.respond_to? :specification_version= - s.author = "Daniel MacDougall" + s.authors = ["Daniel MacDougall", "Caleb Spare"] s.email = "dmacdougall@gmail.com" s.description = "A light deployment system that gets out of your way"
Add Caleb Spare as an author
diff --git a/lib/frontend.rb b/lib/frontend.rb index abc1234..def5678 100644 --- a/lib/frontend.rb +++ b/lib/frontend.rb @@ -11,6 +11,7 @@ "schools-colleges", "childrens-services", "pharmaceutical-industry", + "environmental-management", ] end end
Add browse page for environmental management Part of https://www.pivotaltracker.com/s/projects/1010882/stories/68145052
diff --git a/lib/wash_out.rb b/lib/wash_out.rb index abc1234..def5678 100644 --- a/lib/wash_out.rb +++ b/lib/wash_out.rb @@ -14,8 +14,8 @@ options.reverse_merge!(@scope) if @scope controller_class_name = [options[:module], controller_name].compact.join("/") - match "#{controller_name}/wsdl" => "#{controller_name}#_generate_wsdl", :via => :get - match "#{controller_name}/action" => WashOut::Router.new(controller_class_name), :defaults => { :action => '_action' } + match "#{controller_name}/wsdl" => "#{controller_name}#_generate_wsdl", :via => :get, :format => false + match "#{controller_name}/action" => WashOut::Router.new(controller_class_name), :defaults => { :action => '_action' }, :format => false end end end
Remove format matcher from routes. As there is no need to have the routes defined for multiple format types, this changes makes the setup lighter and less complex
diff --git a/lib/spatial_features/importers/kml.rb b/lib/spatial_features/importers/kml.rb index abc1234..def5678 100644 --- a/lib/spatial_features/importers/kml.rb +++ b/lib/spatial_features/importers/kml.rb @@ -30,7 +30,7 @@ end def geom_from_kml(kml) - ActiveRecord::Base.connection.select_value("SELECT ST_GeomFromKML(#{ActiveRecord::Base.connection.quote(kml)})") + ActiveRecord::Base.connection.select_value("SELECT ST_GeomFromKML(#{ActiveRecord::Base.connection.quote(kml.to_s)})") end end end
Fix bug where Nokogiri nodes were not stringified We were passing nokogiri nodes directly into `connection.quote` which in turn converts them to a YAML representation instead of outputting the original KML.
diff --git a/lib/spec_support/check_all_columns.rb b/lib/spec_support/check_all_columns.rb index abc1234..def5678 100644 --- a/lib/spec_support/check_all_columns.rb +++ b/lib/spec_support/check_all_columns.rb @@ -1,3 +1,4 @@+# FIXME scope this to an RSpec sub module def check_all_columns(instance) instance.class.columns.each do |column| instance.send(:"#{column.name}").should_not be_nil
Add a FIXME to scope the functionality to an RSpec sub module
diff --git a/scgi.gemspec b/scgi.gemspec index abc1234..def5678 100644 --- a/scgi.gemspec +++ b/scgi.gemspec @@ -6,9 +6,8 @@ s.platform = Gem::Platform::RUBY s.summary = "Simple support for using SCGI in ruby apps, such as Rails" s.files = %w'LICENSE README lib/scgi.rb' - s.extra_rdoc_files = ['README'] s.require_paths = ["lib"] s.has_rdoc = true - s.rdoc_options = %w'--inline-source --line-numbers' + s.rdoc_options = %w'--inline-source --line-numbers README lib' s.rubyforge_project = 'scgi' end
Make README the default RDoc page
diff --git a/plugins/system/conntrack-metrics.rb b/plugins/system/conntrack-metrics.rb index abc1234..def5678 100644 --- a/plugins/system/conntrack-metrics.rb +++ b/plugins/system/conntrack-metrics.rb @@ -0,0 +1,27 @@+#!/usr/bin/env ruby +require 'rubygems' if RUBY_VERSION < '1.9.0' +require 'sensu-plugin/metric/cli' +require 'socket' + +class Conntrack < Sensu::Plugin::Metric::CLI::Graphite + + option :scheme, + :description => "Metric naming scheme, text to prepend to .$parent.$child", + :long => "--scheme SCHEME", + :default => "#{Socket.gethostname}.conntrack.connections" + + option :table, + :description => "Table to count", + :long => "--table TABLE", + :default => "conntrack" + + def run + value = `conntrack -C #{config[:table]}`.strip + timestamp = Time.now.to_i + + output config[:scheme], value, timestamp + + ok + end + +end
Add plugin for NAT (conntrack) metrics
diff --git a/app/models/caffeine/page.rb b/app/models/caffeine/page.rb index abc1234..def5678 100644 --- a/app/models/caffeine/page.rb +++ b/app/models/caffeine/page.rb @@ -1,6 +1,6 @@ module Caffeine class Page < Node - PERMITTED_ATTRIBUTES = Caffeine::Node::PERMITTED_ATTRIBUTES + %i(main content summary) + PERMITTED_ATTRIBUTES = Caffeine::Node::PERMITTED_ATTRIBUTES + %i(main content summary tag_list) class_attribute :permitted_attributes self.permitted_attributes = self::PERMITTED_ATTRIBUTES <<
Fix Page not being taggable because of notpermitted `tag_list` attribute
diff --git a/spec/libraries/modular_spec.rb b/spec/libraries/modular_spec.rb index abc1234..def5678 100644 --- a/spec/libraries/modular_spec.rb +++ b/spec/libraries/modular_spec.rb @@ -37,6 +37,11 @@ Modular1.eager_load_modules(Dir.new("#{__dir__}/../fixtures/libraries/modular")) expect(Modular1.modules).to include(TestModule) end + + it 'eager loads all modules in a directory path' do + Modular1.eager_load_modules("#{__dir__}/../fixtures/libraries/modular") + expect(Modular1.modules).to include(TestModule) + end end context 'When there are multiple hosts' do
Test loading a directory by path.
diff --git a/spec/predicate_methods_spec.rb b/spec/predicate_methods_spec.rb index abc1234..def5678 100644 --- a/spec/predicate_methods_spec.rb +++ b/spec/predicate_methods_spec.rb @@ -32,7 +32,8 @@ if operator && (!RUBY_19_METHODS.include?(operator) || ruby_19?) it "is aliased as `#{operator}`" do - @attribute.method(operator).should == @attribute.method(method) + SexyScopes::Arel::PredicateMethods.instance_method(operator).should == + SexyScopes::Arel::PredicateMethods.instance_method(method) end end end
Fix aliased operators specs on Ruby 1.8.7
diff --git a/lib/phrender.rb b/lib/phrender.rb index abc1234..def5678 100644 --- a/lib/phrender.rb +++ b/lib/phrender.rb @@ -2,7 +2,6 @@ require "phrender/logger" require "phrender/phantom_js_engine" require "phrender/phantom_js_session" -require "phrender/rack_base" require "phrender/rack_middleware" require "phrender/rack_static"
Remove reference to deleted file.
diff --git a/lib/generators/ecm/tags/install/templates/initializer.rb b/lib/generators/ecm/tags/install/templates/initializer.rb index abc1234..def5678 100644 --- a/lib/generators/ecm/tags/install/templates/initializer.rb +++ b/lib/generators/ecm/tags/install/templates/initializer.rb @@ -22,10 +22,4 @@ # Default: config.taggable_class_names = %w() # config.taggable_class_names = %w() - - # Specify the models the can tag things. - # - # Default: config.tagger_class_names = %w() - # - config.tagger_class_names = %w() end
Remove non-existen configuration option from initalizer template.
diff --git a/spec/tty/terminal/home_spec.rb b/spec/tty/terminal/home_spec.rb index abc1234..def5678 100644 --- a/spec/tty/terminal/home_spec.rb +++ b/spec/tty/terminal/home_spec.rb @@ -6,15 +6,18 @@ before { ENV.stub!(:[]) } - subject { described_class.new.home } + subject(:terminal) { described_class.new.home } - after { subject.instance_variable_set(:@home, nil) } + after { terminal.instance_variable_set(:@home, nil) } - it { should eq(File.expand_path("~")) } + it 'expands user home path if HOME environemnt not set' do + File.should_receive(:expand_path).and_return('/home/user') + expect(terminal).to eql('/home/user') + end it 'defaults to user HOME environment' do ENV.stub!(:[]).with('HOME').and_return('/home/user') - expect(subject).to eq('/home/user') + expect(terminal).to eq('/home/user') end context 'when failed to expand' do @@ -22,12 +25,12 @@ it 'returns C:/ on windows' do TTY::System.stub(:windows?).and_return true - expect(subject).to eql("C:/") + expect(terminal).to eql("C:/") end it 'returns root on unix' do TTY::System.stub(:windows?).and_return false - expect(subject).to eql("/") + expect(terminal).to eql("/") end end
Change user home tests to pass on rubinius, made them more expressive.
diff --git a/db/migrate/20141128075604_fix_erroneously_synced_users_with_empty_permissions.rb b/db/migrate/20141128075604_fix_erroneously_synced_users_with_empty_permissions.rb index abc1234..def5678 100644 --- a/db/migrate/20141128075604_fix_erroneously_synced_users_with_empty_permissions.rb +++ b/db/migrate/20141128075604_fix_erroneously_synced_users_with_empty_permissions.rb @@ -1,6 +1,6 @@ class FixErroneouslySyncedUsersWithEmptyPermissions < Mongoid::Migration def self.up - User.delete_all(:permissions => [], :created_at.gte => Time.zone.parse("27-Nov-2014 10:50")) + User.where(:permissions => [], :created_at.gte => Time.zone.parse("27-Nov-2014 10:50")).delete_all end def self.down
Fix migration written to fix synced users The earlier version was incompatible with mongoid, because it expects keys to be symbols or strings.
diff --git a/core/app/interactors/interactors/facts/create.rb b/core/app/interactors/interactors/facts/create.rb index abc1234..def5678 100644 --- a/core/app/interactors/interactors/facts/create.rb +++ b/core/app/interactors/interactors/facts/create.rb @@ -12,7 +12,9 @@ site = command :'sites/create', @url end - command :'facts/create', @displaystring, @title, @options[:current_user], site + fact = command :'facts/create', @displaystring, @title, @options[:current_user], site + command :"facts/add_to_recently_viewed", fact.id.to_i, @options[:current_user].id.to_s + fact end def authorized?
Add a coll to the recently viewed factlink list.
diff --git a/slicehost.gemspec b/slicehost.gemspec index abc1234..def5678 100644 --- a/slicehost.gemspec +++ b/slicehost.gemspec @@ -8,27 +8,6 @@ s.description = "Slicehost Capistrano recipes for configuring and managing your slice." s.has_rdoc = false s.authors = ["Joshua Peek"] - s.files = ["README", - "MIT-LICENSE", - "slicehost.gemspec", - "lib/capistrano/ext/slicehost", - "lib/capistrano/ext/slicehost/apache.rb", - "lib/capistrano/ext/slicehost/aptitude.rb", - "lib/capistrano/ext/slicehost/disk.rb", - "lib/capistrano/ext/slicehost/gems.rb", - "lib/capistrano/ext/slicehost/git.rb", - "lib/capistrano/ext/slicehost/iptables.rb", - "lib/capistrano/ext/slicehost/mysql.rb", - "lib/capistrano/ext/slicehost/render.rb", - "lib/capistrano/ext/slicehost/ruby.rb", - "lib/capistrano/ext/slicehost/slice.rb", - "lib/capistrano/ext/slicehost/ssh.rb", - "lib/capistrano/ext/slicehost/templates", - "lib/capistrano/ext/slicehost/templates/iptables.erb", - "lib/capistrano/ext/slicehost/templates/passenger.config.erb", - "lib/capistrano/ext/slicehost/templates/passenger.load.erb", - "lib/capistrano/ext/slicehost/templates/sshd_config.erb", - "lib/capistrano/ext/slicehost/templates/vhost.erb", - "lib/capistrano/ext/slicehost.rb"] + s.files = Dir["README", "MIT-LICENSE", "lib/capistrano/ext/**/*"] s.add_dependency("capistrano", ["> 2.5.0"]) end
Revert "Update gem manifest in attempt to fix GitHub gem builds" This reverts commit 45bcfa6cc68afaf9d73cd193dd640ca375c25712.
diff --git a/spec/features/admin/configuration/general_settings_spec.rb b/spec/features/admin/configuration/general_settings_spec.rb index abc1234..def5678 100644 --- a/spec/features/admin/configuration/general_settings_spec.rb +++ b/spec/features/admin/configuration/general_settings_spec.rb @@ -5,7 +5,7 @@ describe "General Settings" do include AuthenticationHelper - before(:each) do + before do login_as_admin_and_visit spree.admin_dashboard_path click_link "Configuration" click_link "General Settings" @@ -24,16 +24,10 @@ fill_in "site_name", with: "OFN Demo Site99" click_button "Update" - assert_successful_update_message(:general_settings) - + within("[class='flash success']") do + expect(page).to have_content(Spree.t(:successfully_updated, resource: Spree.t(:general_settings))) + end expect(find("#site_name").value).to eq("OFN Demo Site99") - end - - def assert_successful_update_message(resource) - flash = Spree.t(:successfully_updated, resource: Spree.t(resource)) - within("[class='flash success']") do - expect(page).to have_content(flash) - end end end end
Remove unnecessary indirection in test
diff --git a/db/migrate/20120201233421_index_question_options_on_question_id.rb b/db/migrate/20120201233421_index_question_options_on_question_id.rb index abc1234..def5678 100644 --- a/db/migrate/20120201233421_index_question_options_on_question_id.rb +++ b/db/migrate/20120201233421_index_question_options_on_question_id.rb @@ -0,0 +1,9 @@+class IndexQuestionOptionsOnQuestionId < ActiveRecord::Migration + def self.up + add_index :question_options, :question_id + end + + def self.down + remove_index :question_options, :question_id + end +end
Add missing index for question ID
diff --git a/spec/amee_spec.rb b/spec/amee_spec.rb index abc1234..def5678 100644 --- a/spec/amee_spec.rb +++ b/spec/amee_spec.rb @@ -0,0 +1,25 @@+require File.dirname(__FILE__) + '/spec_helper.rb' + +describe "AMEE module" do + + it "should cope if json gem isn't available" do + # Monkeypatch Kernel#require to make sure that require 'json' + # raises a LoadError + module Kernel + def require_with_mock(string) + raise LoadError.new if string == 'json' + require_without_mock(string) + end + alias_method :require_without_mock, :require + alias_method :require, :require_with_mock + end + # Remove amee.rb from required file list so we can load it again + $".delete_if{|x| x.include? 'amee.rb'} + # Require file - require 'json' should throw a LoadError, + # but we should cope with it OK. + lambda { + require 'amee' + }.should_not raise_error + end + +end
Add test for failed JSON loading
diff --git a/spec/koji_spec.rb b/spec/koji_spec.rb index abc1234..def5678 100644 --- a/spec/koji_spec.rb +++ b/spec/koji_spec.rb @@ -0,0 +1,71 @@+# Polisher Koji Spec +# +# Licensed under the MIT license +# Copyright (C) 2013 Red Hat, Inc. + +require 'polisher/koji' + +module Polisher + describe Koji do + describe "::has_build?" do + context "retrieved versions includes the specified version" do + it "returns true" do + described_class.should_receive(:versions_for).and_return(['1.0.0']) + described_class.has_build?('foobar', '1.0.0').should be_true + end + end + + context "retrieved versions does not include the specified version" do + it "returns false" do + described_class.should_receive(:versions_for).and_return(['1.0.1']) + described_class.has_build?('foobar', '1.0.1').should be_true + end + end + end + + describe "#has_build_satisfying?" do + context "retrieved versions satisfy the specified dependency" do + it "returns true" do + described_class.should_receive(:versions_for).and_return(['1.0.0']) + described_class.has_build_satisfying?('foobar', '> 0.9.0').should be_true + end + end + + context "retrieved versions does not satisfy the specified dependency" do + it "returns false" do + described_class.should_receive(:versions_for).and_return(['1.0.0']) + described_class.has_build_satisfying?('foobar', '< 0.9.0').should be_false + end + end + end + + describe "#versions_for" do + before(:each) do + @client = double(XMLRPC::Client) + described_class.should_receive(:client).and_return(@client) + end + + it "uses xmlrpc client to retreive versions" do + expected = ['listTagged', described_class.koji_tag, nil, false, + nil, false, "rubygem-rails"] + @client.should_receive(:call).with(*expected).and_return([]) + described_class.versions_for 'rails' + end + + it "returns versions" do + versions = [{'version' => '1.0.0'}] + @client.should_receive(:call).and_return(versions) + described_class.versions_for('rails').should == ['1.0.0'] + end + + it "invokes block with versions" do + versions = [{'version' => '1.0.0'}] + @client.should_receive(:call).and_return(versions) + + cb = proc {} + cb.should_receive(:call).with(:koji, 'rails', ['1.0.0']) + described_class.versions_for('rails', &cb) + end + end + end # describe Koji +end # module Polisher
Add specs for koji module
diff --git a/gh-pub_keys.gemspec b/gh-pub_keys.gemspec index abc1234..def5678 100644 --- a/gh-pub_keys.gemspec +++ b/gh-pub_keys.gemspec @@ -1,7 +1,7 @@ # coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -require 'gh/pub_keys/version' +require 'gh-pub_keys/version' Gem::Specification.new do |spec| spec.name = "gh-pub_keys"
Fix required version.rb path in gemspec
diff --git a/overcommit.gemspec b/overcommit.gemspec index abc1234..def5678 100644 --- a/overcommit.gemspec +++ b/overcommit.gemspec @@ -30,4 +30,5 @@ s.add_development_dependency 'image_optim', '~> 0.18.0' s.add_development_dependency 'rspec', '~> 3.0' + s.add_development_dependency 'travis-lint', '~> 2.0' end
Add travis-lint to list of development dependencies This ensures the gem is installed when we run our tests via Travis CI. Change-Id: I2eef2593b89f94828a3cdf81854e305b8d13121a Reviewed-on: http://gerrit.causes.com/45340 Tested-by: jenkins <d95b56ce41a2e1ac4cecdd398defd7414407cc08@brigade.com> Reviewed-by: Shane da Silva <67fb7bfe39f841b16a1f86d3928acc568d12c716@brigade.com>
diff --git a/emotee.gemspec b/emotee.gemspec index abc1234..def5678 100644 --- a/emotee.gemspec +++ b/emotee.gemspec @@ -10,8 +10,8 @@ spec.authors = ['caedes'] spec.email = ['laurentromain@gmail.com'] - spec.summary = 'Create emotee' - spec.description = 'Create emotee' + spec.summary = 'Create emotee!' + spec.description = 'Create emotee from the command line.' spec.homepage = 'https://github.com/caedes/emotee' spec.license = 'MIT'
Fix summary and description into gemspec
diff --git a/test/server/binary_file_test.rb b/test/server/binary_file_test.rb index abc1234..def5678 100644 --- a/test/server/binary_file_test.rb +++ b/test/server/binary_file_test.rb @@ -1,39 +1,39 @@-require_relative '../test_base' - -class BinaryFileTest < TestBase - - def self.id58_prefix - 'd93' - end - - # - - - - - - - - - - - - - - - - - - - test '52A', %w( - when an incoming file has rogue characters - it is seen as a binary file - and is not harvested from the container - ) do - stdout,stderr = captured_stdout_stderr { - set_context - filename = 'target.not.txt' - unclean_str = (100..1000).to_a.pack('c*').force_encoding('utf-8') - files = starting_files - files[filename] = unclean_str - command = "file --mime-encoding #{filename}" - files['cyber-dojo.sh'] = command - - puller.add(image_name) - manifest['max_seconds'] = 3 - - run_result = runner.run_cyber_dojo_sh( - id:id, - files:files, - manifest:manifest - ) - assert_equal "#{filename}: binary\n", run_result['stdout']['content'] - } - assert_equal "Read red-amber-green lambda for cyberdojofoundation/gcc_assert:027990d\n", stdout - assert_equal "", stderr - end - -end +# require_relative '../test_base' +# +# class BinaryFileTest < TestBase +# +# def self.id58_prefix +# 'd93' +# end +# +# # - - - - - - - - - - - - - - - - - +# +# test '52A', %w( +# when an incoming file has rogue characters +# it is seen as a binary file +# and is not harvested from the container +# ) do +# stdout,stderr = captured_stdout_stderr { +# set_context +# filename = 'target.not.txt' +# unclean_str = (100..1000).to_a.pack('c*').force_encoding('utf-8') +# files = starting_files +# files[filename] = unclean_str +# command = "file --mime-encoding #{filename}" +# files['cyber-dojo.sh'] = command +# +# puller.add(image_name) +# manifest['max_seconds'] = 3 +# +# run_result = runner.run_cyber_dojo_sh( +# id:id, +# files:files, +# manifest:manifest +# ) +# assert_equal "#{filename}: binary\n", run_result['stdout']['content'] +# } +# assert_equal "Read red-amber-green lambda for cyberdojofoundation/gcc_assert:027990d\n", stdout +# assert_equal "", stderr +# end +# +# end
Comment out server-side test to detect generated text/binary files
diff --git a/gir_ffi.watchr b/gir_ffi.watchr index abc1234..def5678 100644 --- a/gir_ffi.watchr +++ b/gir_ffi.watchr @@ -14,7 +14,7 @@ end def test_and_notify - if system "rake test" + if system "rake TESTOPTS='-v' test" notify SUCCESS_STOCK_ICON, "Green", "All tests passed, good job!" else notify ERROR_STOCK_ICON, "Red", "Some tests failed"
Make tests run in verbose mode to pinpoint segfault locations. Since the switch to minitest, the tests sometimes segfault, probably through a combination of ordering and environment issues. The regular run won't give any information about which test caused the segfault. In verbose mode, however, at least the segfaulting test is known.
diff --git a/gemdiff.gemspec b/gemdiff.gemspec index abc1234..def5678 100644 --- a/gemdiff.gemspec +++ b/gemdiff.gemspec @@ -1,7 +1,4 @@-# coding: utf-8 -lib = File.expand_path("../lib", __FILE__) -$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -require "gemdiff/version" +require "./lib/gemdiff/version" Gem::Specification.new do |spec| spec.name = "gemdiff"
Remove load path gibberish, remove coding