diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/app/helpers/helpers.rb b/app/helpers/helpers.rb index abc1234..def5678 100644 --- a/app/helpers/helpers.rb +++ b/app/helpers/helpers.rb @@ -2,7 +2,6 @@ uri = URI(url) @document = Nokogiri.parse(Net::HTTP.get(uri)) end - def fetch_title(document) @title = document.css('h1').first.inner_text
Add change to helper method
diff --git a/app/models/category.rb b/app/models/category.rb index abc1234..def5678 100644 --- a/app/models/category.rb +++ b/app/models/category.rb @@ -16,6 +16,6 @@ end def short_name - self.name.split.first.downcase + self.name_en.split.first.downcase end end
Add the en back to the name to make the colors work
diff --git a/app/models/deletion.rb b/app/models/deletion.rb index abc1234..def5678 100644 --- a/app/models/deletion.rb +++ b/app/models/deletion.rb @@ -34,5 +34,6 @@ def remove_from_storage RubygemFs.instance.remove("gems/#{@version.full_name}.gem") + RubygemFs.instance.remove("quick/Marshal.4.8/#{@version.full_name}.gemspec.rz") end end
Remove gemspec file when delete gem
diff --git a/app/models/revision.rb b/app/models/revision.rb index abc1234..def5678 100644 --- a/app/models/revision.rb +++ b/app/models/revision.rb @@ -11,11 +11,13 @@ def url # https://en.wikipedia.org/w/index.php?title=Eva_Hesse&diff=prev&oldid=655980945 - escaped_title = article.title.gsub(' ', '_') - language = Figaro.env.wiki_language - # rubocop:disable Metrics/LineLength - "https://#{language}.wikipedia.org/w/index.php?title=#{escaped_title}&diff=prev&oldid=#{id}" - # rubocop:enable Metrics/LineLength + if !article.nil? + escaped_title = article.title.gsub(' ', '_') + language = Figaro.env.wiki_language + # rubocop:disable Metrics/LineLength + "https://#{language}.wikipedia.org/w/index.php?title=#{escaped_title}&diff=prev&oldid=#{id}" + # rubocop:enable Metrics/LineLength + end end def update(data={}, save=true)
Fix for 500 error on deleted articles
diff --git a/spec/models/category_spec.rb b/spec/models/category_spec.rb index abc1234..def5678 100644 --- a/spec/models/category_spec.rb +++ b/spec/models/category_spec.rb @@ -7,7 +7,10 @@ describe 'validations' do it { should validate_presence_of :name_pt } - it { should validate_uniqueness_of :name_pt } + it do + create(:category) + should validate_uniqueness_of :name_pt + end end describe '.with_projects' do
Create category object to test the uniqueness of name It was failling because `shoulda-mathers` was generating the value as integer and what we need it a string.
diff --git a/spec/models/response_spec.rb b/spec/models/response_spec.rb index abc1234..def5678 100644 --- a/spec/models/response_spec.rb +++ b/spec/models/response_spec.rb @@ -0,0 +1,39 @@+# == Schema Information +# +# Table name: responses +# +# id :integer not null, primary key +# body :text +# post_id :integer +# user_id :integer +# created_at :datetime not null +# updated_at :datetime not null +# likes_count :integer default("0") +# + +require 'rails_helper' + +RSpec.describe Response, type: :model do + describe "validations" do + let(:response) { Response.new(user_id: 1, post_id: 2, body: "Great post!") } + + it "is valid with both user_id and post_id and body" do + expect(response).to be_valid + end + + it "is invalid without body" do + response.body = " " + expect(response).to be_invalid + end + + it "is invalid without user_id" do + response.user_id = nil + expect(response).to be_invalid + end + + it "is invalid without post_id" do + response.post_id = nil + expect(response).to be_invalid + end + end +end
Add spec for Response model
diff --git a/lib/rails/generators/crud_star_config/templates/initializer.rb b/lib/rails/generators/crud_star_config/templates/initializer.rb index abc1234..def5678 100644 --- a/lib/rails/generators/crud_star_config/templates/initializer.rb +++ b/lib/rails/generators/crud_star_config/templates/initializer.rb @@ -3,7 +3,7 @@ config.application_name = 'CrudStar' config.url_path = 'admin' - config.theme = 'green' + config.theme = 'red' # Define the navigation layers of the control panel. #
Use red.css instead of green.css
diff --git a/blackbaud-client.gemspec b/blackbaud-client.gemspec index abc1234..def5678 100644 --- a/blackbaud-client.gemspec +++ b/blackbaud-client.gemspec @@ -10,7 +10,7 @@ gem.authors = "Alex Dugger" gem.email = "alexd@haikulearning.com" gem.description = "A client for the Blackbaud API." - gem.homepage = "https://github.com/haikulearning/blackbaud-api-client" + gem.homepage = "https://github.com/haikulearning/blackbaud-client" gem.summary = "A client for the Blackbaud API." gem.files = `git ls-files`.split($/) gem.require_path = 'lib'
Update gemspec with the correct repo URL Discovered this old URL by accident by clicking the "Homepage" link on https://rubygems.org/gems/blackbaud-client
diff --git a/api/app/views/mno_enterprise/jpi/v1/app_instances/_resource.json.jbuilder b/api/app/views/mno_enterprise/jpi/v1/app_instances/_resource.json.jbuilder index abc1234..def5678 100644 --- a/api/app/views/mno_enterprise/jpi/v1/app_instances/_resource.json.jbuilder +++ b/api/app/views/mno_enterprise/jpi/v1/app_instances/_resource.json.jbuilder @@ -8,7 +8,7 @@ #json.microsoft_trial_url app_instance.microsoft_trial_url json.created_at app_instance.created_at -if app_instance.connector_stack? && app_instance.oauth_keys_valid && app_instance.oauth_company +if app_instance.oauth_company json.oauth_company_name app_instance.oauth_company end #
Add oauth_company to app instance
diff --git a/attributes/dnsimple.rb b/attributes/dnsimple.rb index abc1234..def5678 100644 --- a/attributes/dnsimple.rb +++ b/attributes/dnsimple.rb @@ -17,7 +17,7 @@ # limitations under the License. # -default[:dnsimple][:username] = nil # DNSimple username -default[:dnsimple][:password] = nil # DNSimple password -default[:dnsimple][:domain] = nil # Default domain to use -default[:dnsimple][:fog_version] = nil # Default version of fog to install +default['dnsimple']['username'] = nil # DNSimple username +default['dnsimple']['password'] = nil # DNSimple password +default['dnsimple']['domain'] = nil # Default domain to use +default['dnsimple']['fog_version'] = nil # Default version of fog to install
Resolve foodcritic violations FC001 and FC019
diff --git a/app/controllers/admin/governments_controller.rb b/app/controllers/admin/governments_controller.rb index abc1234..def5678 100644 --- a/app/controllers/admin/governments_controller.rb +++ b/app/controllers/admin/governments_controller.rb @@ -42,7 +42,7 @@ appointment.update_attribute(:ended_at, Time.zone.now) end - redirect_to edit_admin_government_path(government) + redirect_to edit_admin_government_path(government), notice: "Government closed" end private
Add a flash notice when closing governments. This returns you to an edit page, so we should avoid confusion as to whether you need to subsequently save the record to confirm the closure.
diff --git a/app/controllers/concerns/ownership_checkable.rb b/app/controllers/concerns/ownership_checkable.rb index abc1234..def5678 100644 --- a/app/controllers/concerns/ownership_checkable.rb +++ b/app/controllers/concerns/ownership_checkable.rb @@ -6,11 +6,19 @@ end def is_owner?(entity, user) - user.admin || user.id == entity.owner_id + if user.nil? + false + else + user.admin || user.id == entity.owner_id + end end def is_contributor?(entity, user) - user.admin || is_owner?(entity, user) || entity.contributors.map{ |c| c.screen_name.downcase }.include?(user.screen_name.downcase) + if user.nil? + false + else + user.admin || is_owner?(entity, user) || entity.contributors.map{ |c| c.screen_name.downcase }.include?(user.screen_name.downcase) + end end def check_ownership_of(entity, user)
Fix ownership check; Fail when user is nil
diff --git a/app/controllers/projects/starrers_controller.rb b/app/controllers/projects/starrers_controller.rb index abc1234..def5678 100644 --- a/app/controllers/projects/starrers_controller.rb +++ b/app/controllers/projects/starrers_controller.rb @@ -2,9 +2,6 @@ class Projects::StarrersController < Projects::ApplicationController include SortingHelper - - # Authorize - before_action :require_non_empty_project def index @sort = params[:sort].presence || sort_value_name
Allow viewing starrers of empty projects
diff --git a/AFOAuth2Client.podspec b/AFOAuth2Client.podspec index abc1234..def5678 100644 --- a/AFOAuth2Client.podspec +++ b/AFOAuth2Client.podspec @@ -10,7 +10,8 @@ s.source_files = 'AFOAuth2Client' s.requires_arc = true - s.dependency 'AFNetworking', '~>1.0' + s.dependency 'AFNetworking', '~>2.0' + s.ios.deployment_target = '6.0' s.ios.frameworks = 'Security'
Change the podspec to support AFNetworking 2.0.
diff --git a/lib/erbal/rails.rb b/lib/erbal/rails.rb index abc1234..def5678 100644 --- a/lib/erbal/rails.rb +++ b/lib/erbal/rails.rb @@ -1,8 +1,21 @@ require 'erbal' -class ErbalTemplateHandler < ActionView::TemplateHandler - include ActionView::TemplateHandlers::Compilable - def compile(template) - ::Erbal.new("<% __in_erb_template=true %>#{template.source}", {:buffer => '@output_buffer'}).parse +if ActiveSupport.const_defined?('SafeBuffer') + + class ErbalTemplateHandler < ActionView::TemplateHandler + include ActionView::TemplateHandlers::Compilable + def compile(template) + ::Erbal.new("<% __in_erb_template=true %>#{template.source}", {:buffer => '@output_buffer', :buffer_initial_value => 'ActiveSupport::SafeBuffer.new'}).parse + end end + +else + + class ErbalTemplateHandler < ActionView::TemplateHandler + include ActionView::TemplateHandlers::Compilable + def compile(template) + ::Erbal.new("<% __in_erb_template=true %>#{template.source}", {:buffer => '@output_buffer'}).parse + end + end + end
Set the buffer initial value to a SafeBuffer instance for versions of Rails that use it
diff --git a/lib/lyndon/ruby.rb b/lib/lyndon/ruby.rb index abc1234..def5678 100644 --- a/lib/lyndon/ruby.rb +++ b/lib/lyndon/ruby.rb @@ -24,5 +24,12 @@ end end end + + ## + # Ruby('$LOAD_PATH') => array... + # Ruby('1 + 1') => 2 + def invokeDefaultMethodWithArguments(args) + eval(args[0]) + end end end
Add default method shorthand, things like Ruby('$LOAD_PATH')
diff --git a/lib/tori/define.rb b/lib/tori/define.rb index abc1234..def5678 100644 --- a/lib/tori/define.rb +++ b/lib/tori/define.rb @@ -1,16 +1,16 @@ module Tori module Define def tori(name) - name_file_ivar = "@#{name}_file".to_sym + name_ivar = "@#{name}".to_sym define_method(name) do - ivar = instance_variable_get name_file_ivar - instance_variable_set name_file_ivar, ivar || File.new(self) + ivar = instance_variable_get name_ivar + instance_variable_set name_ivar, ivar || File.new(self) end define_method("#{name}=") do |uploader| file = File.new(self, uploader) - instance_variable_set name_file_ivar, file + instance_variable_set name_ivar, file end end end
Rename ivar to simple name.
diff --git a/lib/data_loader/debates.rb b/lib/data_loader/debates.rb index abc1234..def5678 100644 --- a/lib/data_loader/debates.rb +++ b/lib/data_loader/debates.rb @@ -10,8 +10,8 @@ [Date.parse(options[:from_date])] end - dates.each do |date| - House.australian.each do |house| + House.australian.each do |house| + dates.each do |date| # TODO: Check for the file first rather than catching the exception begin xml_data = File.read("#{Settings.xml_data_directory}/scrapedxml/#{house}_debates/#{date}.xml")
Change load order to match PHP app
diff --git a/lib/hidden_hippo/reader.rb b/lib/hidden_hippo/reader.rb index abc1234..def5678 100644 --- a/lib/hidden_hippo/reader.rb +++ b/lib/hidden_hippo/reader.rb @@ -9,7 +9,6 @@ require 'hidden_hippo/extractors/dhcp_hostname_extractor' require 'hidden_hippo/extractors/http_request_url_extractor' require 'hidden_hippo/extractors/dns_llmnr_extractor' -require 'hidden_hippo/extractors/wps_extractor' require 'thread' module HiddenHippo @@ -26,8 +25,6 @@ Extractors::DhcpHostnameExtractor.new(updator_queue)) @scanners << Scanner.new(file, Packets::Http, Extractors::HttpRequestUrlExtractor.new(updator_queue)) - @scanners << Scanner.new(file, Packets::Wps, - Extractors::WpsExtractor.new(updator_queue)) end def call
Revert "Added a scanner for WPS" This reverts commit 5af0aa6039311aa816c1a6eccaadde0c7871bfe7.
diff --git a/lib/river_notifications.rb b/lib/river_notifications.rb index abc1234..def5678 100644 --- a/lib/river_notifications.rb +++ b/lib/river_notifications.rb @@ -47,7 +47,6 @@ params[:changed_attributes] = post.changes if event == :update params[:soft_deleted] = true if options[:soft_deleted] publish!(params) - LOGGER.info("published #{params[:uid]}") end end
Remove some unnecessary log output.
diff --git a/spec/hallon_openal_spec.rb b/spec/hallon_openal_spec.rb index abc1234..def5678 100644 --- a/spec/hallon_openal_spec.rb +++ b/spec/hallon_openal_spec.rb @@ -4,17 +4,11 @@ describe Hallon::OpenAL do let(:klass) { described_class } let(:format) { Hash.new } - subject { klass.new(format) } + subject { klass.new } - describe "#initialize" do - it "should raise an error if not given a format" do - expect { klass.new {} }.to raise_error(ArgumentError) - end - end - - describe "#start" do + describe "#play" do it "should not raise an error" do - expect { subject.start }.to_not raise_error + expect { subject.play }.to_not raise_error end end @@ -38,9 +32,7 @@ describe "#format" do it "should be settable and gettable" do - format = { channels: 1, rate: 44100 } - - subject.format.should == {} + subject.format.should be_nil subject.format = format subject.format.should eq format end
Fix the specs; the actual specs have changed See http://rubydoc.info/github/Burgestrand/Hallon/Hallon/ExampleAudioDriver
diff --git a/yard-serverspec-plugin.gemspec b/yard-serverspec-plugin.gemspec index abc1234..def5678 100644 --- a/yard-serverspec-plugin.gemspec +++ b/yard-serverspec-plugin.gemspec @@ -20,5 +20,5 @@ spec.add_dependency "yard", "~> 0.7" spec.add_development_dependency "rspec", "~> 2.6" spec.add_development_dependency "bundler", "~> 1.7" - spec.add_development_dependency "rake", "~> 10.0" + spec.add_development_dependency "rake", "~> 12.3" end
Update rake requirement from ~> 10.0 to ~> 12.3 Updates the requirements on [rake](https://github.com/ruby/rake) to permit the latest version. - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/rake-10.0.0...v12.3.2) Signed-off-by: dependabot-preview[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com>
diff --git a/app/controllers/api/search_controller.rb b/app/controllers/api/search_controller.rb index abc1234..def5678 100644 --- a/app/controllers/api/search_controller.rb +++ b/app/controllers/api/search_controller.rb @@ -1,6 +1,10 @@ class Api::SearchController < ApplicationController def show - @searches = Line.search(params[:term]).joins(:quote).includes(:character, :quote).map(&:quote).uniq! - render json: @searches, root: :searches + lines = Line.search(params[:term]).includes(:quote).select {|l| l.quote.present? } + if lines.any? + render json: lines.first.quote + else + render json: Quote.random + end end end
Revert breaking changes to search API
diff --git a/app/helpers/spree/admin/orders_helper.rb b/app/helpers/spree/admin/orders_helper.rb index abc1234..def5678 100644 --- a/app/helpers/spree/admin/orders_helper.rb +++ b/app/helpers/spree/admin/orders_helper.rb @@ -0,0 +1,23 @@+module Spree + module Admin + module OrdersHelper + # Renders all the extension partials that may have been specified in the extensions + def event_links + links = [] + @order_events.sort.each do |event| + if @order.send("can_#{event}?") + links << button_link_to(Spree.t(event), fire_admin_order_url(@order, :e => event), + :method => :put, + :icon => "icon-#{event}", + :data => { :confirm => Spree.t(:order_sure_want_to, :event => Spree.t(event)) }) + end + end + links.join('&nbsp;').html_safe + end + + def line_item_shipment_price(line_item, quantity) + Spree::Money.new(line_item.price * quantity, { currency: line_item.currency }) + end + end + end +end
Bring orders helper from spree_backend
diff --git a/mixlib-cli.gemspec b/mixlib-cli.gemspec index abc1234..def5678 100644 --- a/mixlib-cli.gemspec +++ b/mixlib-cli.gemspec @@ -16,7 +16,7 @@ # Uncomment this to add a dependency #s.add_dependency "mixlib-log" - s.add_development_dependency "rake", "< 11.0" + s.add_development_dependency "rake", "~> 11.0" s.add_development_dependency "rspec", "~> 3.0" s.add_development_dependency "rdoc" s.add_development_dependency "chefstyle", "~> 0.3"
Use Rake 11 not Rake 10 Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
diff --git a/Casks/launchcontrol.rb b/Casks/launchcontrol.rb index abc1234..def5678 100644 --- a/Casks/launchcontrol.rb +++ b/Casks/launchcontrol.rb @@ -1,8 +1,8 @@ class Launchcontrol < Cask - version '1.14.2' - sha256 '9351c57b3956e63f5d995dfe4b9f45fa78a39476dbc3a4b7aa8797b600c4d8ad' + version '1.15.3' + sha256 'fecdd0dd58e937d3d3e9894ba046f52f61f001826bb2ab1beacedc23e8da3fd7' - url 'http://www.soma-zone.com/download/files/LaunchControl_1.14.2.tar.bz2' + url "http://www.soma-zone.com/download/files/LaunchControl_#{version}.tar.bz2" appcast 'http://www.soma-zone.com/LaunchControl/a/appcast.xml' homepage 'http://www.soma-zone.com/LaunchControl/'
Bump version for LaunchControl app.
diff --git a/resources/files/operating_system.rb b/resources/files/operating_system.rb index abc1234..def5678 100644 --- a/resources/files/operating_system.rb +++ b/resources/files/operating_system.rb @@ -5,7 +5,7 @@ Gem.pre_install do |gem_installer| RubyInstaller::Runtime.enable_msys_apps(for_gem_install: true) unless gem_installer.spec.extensions.empty? - unless gem_installer.options && gem_installer.options[:ignore_dependencies] + if !gem_installer.options || !gem_installer.options[:ignore_dependencies] || gem_installer.options[:bundler_expected_checksum] [['msys2_dependencies' , :install_packages ], ['msys2_mingw_dependencies', :install_mingw_packages]].each do |metakey, func|
Fix compatibility of MSYS2 dependency installer with bundler Bundler calls the `Gem.pre_install hook`, but always sets `:ignore_dependencies=>true` in the options. That's why `bundle install` didn't respect `msys2_mingw_dependencies` in gemspec metadata. There is no option in bundler to ignore dependencies, so that pacman installation is now forced in the bundler case.
diff --git a/scripts/npm_bundles.rb b/scripts/npm_bundles.rb index abc1234..def5678 100644 --- a/scripts/npm_bundles.rb +++ b/scripts/npm_bundles.rb @@ -15,7 +15,9 @@ "express" => "", "nodemon" => "", "mocha" => "", - "sails" => "" + "sails" => "", + "phantomjs" => "", + "casperjs" => "" } npms.each do |mod, command| @@ -27,4 +29,4 @@ end # always run the very latest npm, not just the one that was bundled into Node -`npm install npm -g --silent` +# `npm install npm -g --silent`
Fix npm modules being installed
diff --git a/Casks/remote-desktop-connection.rb b/Casks/remote-desktop-connection.rb index abc1234..def5678 100644 --- a/Casks/remote-desktop-connection.rb +++ b/Casks/remote-desktop-connection.rb @@ -0,0 +1,8 @@+class RemoteDesktopConnection < Cask + url 'http://download.microsoft.com/download/C/F/0/CF0AE39A-3307-4D39-9D50-58E699C91B2F/RDC_2.1.1_ALL.dmg' + homepage 'http://www.microsoft.com/en-us/download/details.aspx?id=18140' + version '2.1.1' + sha256 '4ebe551c9ee0e2da6b8f746be13c2df342c6f14cd3fbedbf2ab490f09b44616f' + install 'RDC Installer.mpkg' + uninstall :pkgutil => 'com.microsoft.rdc.all.*' +end
Add Microsoft Remote Desktop Connection Client
diff --git a/UICollectionViewLeftAlignedLayout.podspec b/UICollectionViewLeftAlignedLayout.podspec index abc1234..def5678 100644 --- a/UICollectionViewLeftAlignedLayout.podspec +++ b/UICollectionViewLeftAlignedLayout.podspec @@ -1,4 +1,4 @@-version = "0.0.2" +version = "0.0.3" Pod::Spec.new do |s| s.name = "UICollectionViewLeftAlignedLayout"
Update spec version to 0.0.3
diff --git a/seed_migration.gemspec b/seed_migration.gemspec index abc1234..def5678 100644 --- a/seed_migration.gemspec +++ b/seed_migration.gemspec @@ -22,5 +22,6 @@ s.add_development_dependency "pry" s.add_development_dependency "rspec-rails", '2.14.2' s.add_development_dependency "rspec-mocks" + s.add_development_dependency "test-unit", "~> 3.0" end
Add test-unit as a dependency for 2.2
diff --git a/set_attributes.gemspec b/set_attributes.gemspec index abc1234..def5678 100644 --- a/set_attributes.gemspec +++ b/set_attributes.gemspec @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = 'set_attributes' - s.version = '0.1.1' + s.version = '0.1.2' s.summary = "Set an object's attributes" s.description = ' '
Package version path number is incremented from 0.1.1 to 0.1.2
diff --git a/spec/acceptance/profile_spec.rb b/spec/acceptance/profile_spec.rb index abc1234..def5678 100644 --- a/spec/acceptance/profile_spec.rb +++ b/spec/acceptance/profile_spec.rb @@ -0,0 +1,36 @@+require 'spec_helper_acceptance' + +describe 'with profile and file' do + let(:manifest) { <<-EOS + class { 'duplicity': + backup_target_url => 'file:///tmp/duplicity/', + backup_target_username => 'john', + backup_target_password => 'doe', + } + + duplicity::profile { 'system': + gpg_encryption => false, + } + + duplicity::file { '/etc/duply': + ensure => backup, + } + EOS + } + + specify 'should provision with no errors' do + apply_manifest(manifest, :catch_failures => true) + end + + specify 'should be idempotent' do + apply_manifest(manifest, :catch_changes => true) + end + + describe command('duply system status') do + its(:exit_status) { should eq 0 } + end + + describe command('duply system backup') do + its(:exit_status) { should eq 0 } + end +end
Add acceptance tests to ensure encryption-less backup is working
diff --git a/spec/models/transaction_spec.rb b/spec/models/transaction_spec.rb index abc1234..def5678 100644 --- a/spec/models/transaction_spec.rb +++ b/spec/models/transaction_spec.rb @@ -3,7 +3,7 @@ RSpec.describe Transaction, type: :model do describe 'validations' do it { is_expected.to validate_presence_of(:amount) } - it { is_expected.to validate_numericality_of(:amount), greater_than: 0 } + it { is_expected.to validate_numericality_of(:amount).is_greater_than(0) } end describe 'associations' do
Correct spec with correct syntax for validate numericality of amount
diff --git a/domgen/domgen/iris_model_ext.rb b/domgen/domgen/iris_model_ext.rb index abc1234..def5678 100644 --- a/domgen/domgen/iris_model_ext.rb +++ b/domgen/domgen/iris_model_ext.rb @@ -22,7 +22,21 @@ class IrisClass < IrisElement attr_accessor :display_name - + + attr_writer :preload + + def preload? + @preload = false if @preload.nil? + @preload + end + + attr_writer :managed + + def managed? + @managed = false if @managed.nil? + @managed + end + attr_writer :metadata_that_can_change def metadata_that_can_change?
Add some more iris specific configs
diff --git a/lib/code/generator/code_generator.rb b/lib/code/generator/code_generator.rb index abc1234..def5678 100644 --- a/lib/code/generator/code_generator.rb +++ b/lib/code/generator/code_generator.rb @@ -19,6 +19,18 @@ raise "Method not implemented." end + def write_source_file(sub_dir, entity_name, content) + dir = File.join @output_dir, sub_dir + unless File.exist? dir + @logger.debug "Creating directory path #{dir}" + FileUtils.mkdir_p dir + end + + file_path = File.join @output_dir, sub_dir, "#{entity_name}.#{@language.name.downcase}" + @logger.debug "Creating model file #{file_path}" + File.open(file_path, 'w') { |file| file.write content } + end + end end
Add method to write source file.
diff --git a/lib/elocal_capistrano/delayed_job.rb b/lib/elocal_capistrano/delayed_job.rb index abc1234..def5678 100644 --- a/lib/elocal_capistrano/delayed_job.rb +++ b/lib/elocal_capistrano/delayed_job.rb @@ -0,0 +1,13 @@+Capistrano::Configuration.instance.load do + set(:delayed_job_application_name) { "#{application}_delayed_job" } + namespace :delayed_job do + namespace :upstart do + %w(restart start stop status).each do |t| + desc "Perform #{t} of the delayed_job service" + task t, roles: :app, except: { no_release: true } do + sudo "#{t} #{delayed_job_application_name}" + end + end + end + end +end
Add tasks for delayed job
diff --git a/spec/support/masamune/masamune_example_group.rb b/spec/support/masamune/masamune_example_group.rb index abc1234..def5678 100644 --- a/spec/support/masamune/masamune_example_group.rb +++ b/spec/support/masamune/masamune_example_group.rb @@ -1,4 +1,10 @@+require 'masamune/has_context' + +# Separate context for test harness itself module MasamuneExampleGroup + include Masamune::HasContext + extend self + def self.included(base) base.before do Thor.send(:include, Masamune::ThorMute)
Add context for test harness
diff --git a/lib/kruskal/minimum_spanning_tree.rb b/lib/kruskal/minimum_spanning_tree.rb index abc1234..def5678 100644 --- a/lib/kruskal/minimum_spanning_tree.rb +++ b/lib/kruskal/minimum_spanning_tree.rb @@ -9,6 +9,7 @@ end def add(value = 0, source, target) + # Here is the full algorithm forest_source = find_forest_for(source) forest_target = find_forest_for(target) if forest_source.nil? && forest_target.nil?
Add minor comment to find where's the algorithm
diff --git a/lib/letsencrypt_webfaction/errors.rb b/lib/letsencrypt_webfaction/errors.rb index abc1234..def5678 100644 --- a/lib/letsencrypt_webfaction/errors.rb +++ b/lib/letsencrypt_webfaction/errors.rb @@ -1,4 +1,5 @@ module LetsencryptWebfaction class Error < StandardError; end class InvalidConfigValueError < Error; end + class AppExitError < Error; end end
Add error for exiting the application
diff --git a/test/lock_test.rb b/test/lock_test.rb index abc1234..def5678 100644 --- a/test/lock_test.rb +++ b/test/lock_test.rb @@ -15,6 +15,10 @@ end class LockTest < Test::Unit::TestCase + def test_lint + assert Resque::Plugin.lint(Resque::Plugins::Lock) + end + def test_version assert_equal '1.7.0', Resque::Version end
Add lint test to ensure we're being a good Resque plugin
diff --git a/yaks/lib/yaks/resource/form.rb b/yaks/lib/yaks/resource/form.rb index abc1234..def5678 100644 --- a/yaks/lib/yaks/resource/form.rb +++ b/yaks/lib/yaks/resource/form.rb @@ -3,8 +3,28 @@ class Form include Yaks::Mapper::Form.attributes + def [](name) + fields.find {|field| field.name == name}.value + end + + def values + fields.each_with_object({}) do |field, values| + values[field.name] = field.value + end + end + class Field - include Yaks::Mapper::Form::Field.attributes + include Yaks::Mapper::Form::Field.attributes.add(:error => nil) + + def value(arg = Undefined) + return @value if arg.eql?(Undefined) + if type == :select + selected = options.find { |option| option.selected } + selected.value if selected + else + update(value: arg) + end + end end end end
Add some convenience methods to Yaks::Resource::Form and ::Field Access form values with [] or get the value hash with #values. Resolve the value of a select list correctly.
diff --git a/bot.rb b/bot.rb index abc1234..def5678 100644 --- a/bot.rb +++ b/bot.rb @@ -18,7 +18,8 @@ ROOM_ID = ENV['ROOM_ID'] BOT_ID = ENV['BOT_ID'] REDIS = Redis.new(url: (ENV['REDIS_URL'] || 'redis://localhost:6379')) -LOGGER = Logger.new(ENV['LOG_FILE'] || STDERR) +LOGGER = Logger.new(ENV['LOG_FILE'] || STDOUT) +STDOUT.sync = true http = EM::HttpRequest.new(stream_url(ROOM_ID), keepalive: true,
Change Logger default to STDOUT
diff --git a/config/initializers/spree.rb b/config/initializers/spree.rb index abc1234..def5678 100644 --- a/config/initializers/spree.rb +++ b/config/initializers/spree.rb @@ -17,8 +17,8 @@ config.searcher_class = OpenFoodNetwork::Searcher # 109 should be Australia. Hardcoded for CI (Jenkins), where countries are not pre-loaded. - config.default_country_id = Spree::Country.table_exists? && Spree::Country.find_by_name('Australia').andand.id - config.default_country_id ||= 109 + config.default_country_id = Spree::Country.table_exists? && Spree::Country.find_by_name('Australia').andand.id + config.default_country_id = 109 unless config.default_country_id.present? && config.default_country_id > 0 # -- spree_paypal_express # Auto-capture payments. Without this option, payments must be manually captured in the paypal interface.
Fix country init for Jenkins
diff --git a/spec/payload/message_parser_spec.rb b/spec/payload/message_parser_spec.rb index abc1234..def5678 100644 --- a/spec/payload/message_parser_spec.rb +++ b/spec/payload/message_parser_spec.rb @@ -10,38 +10,38 @@ describe "#skip_message?" do it "returns true when message contains 'ci-skip'" do subject.stub(:message).and_return("Commit message [ci-skip]") - subject.skip_message?.should eq true + expect(subject.skip_message?).to be_true end it "returns true when message contains 'ci skip'" do subject.stub(:message).and_return("Commit message [ci skip]") - subject.skip_message?.should eq true + expect(subject.skip_message?).to be_true end it "returns true when message contains 'skip ci'" do subject.stub(:message).and_return("Commit message [skip ci]") - subject.skip_message?.should eq true + expect(subject.skip_message?).to be_true end it "returns true when message contains 'skip-ci'" do subject.stub(:message).and_return("Commit message [skip-ci]") - subject.skip_message?.should eq true + expect(subject.skip_message?).to be_true end it "returns false if no skip points found" do subject.stub(:message).and_return("Commit message") - subject.skip_message?.should eq false + expect(subject.skip_message?).to be_false end context "with multi-line message" do it "returns true" do subject.stub(:message).and_return("Commit message [skip-ci]\nCommit comments") - subject.skip_message?.should eq true + expect(subject.skip_message?).to be_true end it "returns false" do subject.stub(:message).and_return("Commit message\nLets skip [ci-skip]") - subject.skip_message?.should eq false + expect(subject.skip_message?).to be_false end end end
Change rspec syntax with new expectations
diff --git a/test/test_open.rb b/test/test_open.rb index abc1234..def5678 100644 --- a/test/test_open.rb +++ b/test/test_open.rb @@ -4,6 +4,32 @@ class MachOOpenTest < Minitest::Test include Helpers + + def test_nonexistent_file + assert_raises ArgumentError do + MachO.open("/this/is/a/file/that/cannot/possibly/exist") + end + end + + # MachO.open has slightly looser qualifications for truncation than + # either MachOFile.new or FatFile.new - it just makes sure that there are + # enough magic bytes to read, and lets the actual parser raise a + # TruncationError later on if required. + def test_truncated_file + tempfile_with_data("truncated_file", "\x00\x00") do |truncated_file| + assert_raises MachO::TruncatedFileError do + MachO.open(truncated_file.path) + end + end + end + + def test_bad_magic + tempfile_with_data("junk_file", "\xFF\xFF\xFF\xFF") do |junk_file| + assert_raises MachO::MagicError do + MachO.open(junk_file.path) + end + end + end def test_open file = MachO.open("test/bin/libhello.dylib")
Testing: Add tests for new MachO.open Ensure that MachO.open raises all expected exceptions.
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index abc1234..def5678 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,7 +1,7 @@ class ApplicationController < ActionController::Base # Prevent CSRF attacks by raising an exception. # For APIs, you may want to use :null_session instead. - protect_from_forgery with: :exception + protect_from_forgery with: :null_session def store_location session[:return_to] = request.fullpath if request.get? && controller_name != "user" && controller_name != "session" end
Change 'protect_from_forgery' so that api can be used without oauth
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index abc1234..def5678 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,4 +1,5 @@ class ApplicationController < ActionController::API + before_filter :add_cross_origin_headers include CanCan::ControllerAdditions include ActionController::Serialization attr_reader :current_user @@ -12,6 +13,12 @@ end end + def add_cross_origin_headers + response.headers["Access-Control-Allow-Origin"] = + request.headers["Origin"] || "*" + response.headers["Access-Control-Allow-Credentials"] = "true" + end + rescue_from CanCan::AccessDenied do render json: { "message": "Unauthorized to access resource" }, status: :unauthorized
Add headers to allow accss from any domain
diff --git a/app/controllers/letsencrypt_controller.rb b/app/controllers/letsencrypt_controller.rb index abc1234..def5678 100644 --- a/app/controllers/letsencrypt_controller.rb +++ b/app/controllers/letsencrypt_controller.rb @@ -1,6 +1,6 @@ class LetsencryptController < ApplicationController def letsencrypt # use your code here, not mine - render text: "MQ5dUiAaSFm8z6_4o3igHp_P-5VcU-jSRU5O-gz6ufM.xQk3L_ZooytfqxYnB78MxA3nMkWHp7bd6j8jAExcZMs" + render text: "GHsKETOLaQ3HUHjD4rJMzhjRnzM8K1Z_y6gXJcszipQ.xQk3L_ZooytfqxYnB78MxA3nMkWHp7bd6j8jAExcZMs" end end
Change url cert is for
diff --git a/spec/calculate_spec.rb b/spec/calculate_spec.rb index abc1234..def5678 100644 --- a/spec/calculate_spec.rb +++ b/spec/calculate_spec.rb @@ -5,13 +5,9 @@ dataset.enabled && dataset.enabled[:etengine] end - before(:all) do - @graph = Atlas::GraphBuilder.build - end - datasets.each do |dataset| it "calculates the #{ dataset.key } dataset" do - Atlas::Runner.new(dataset, @graph).calculate + Atlas::Runner.new(dataset).calculate end end end # Calculating the ETSource dataset
Remove unused graph param from calculation specs Adjustment for new Atlas version
diff --git a/spec/converter_spec.rb b/spec/converter_spec.rb index abc1234..def5678 100644 --- a/spec/converter_spec.rb +++ b/spec/converter_spec.rb @@ -1,13 +1,16 @@ require 'spec_helper' +require 'json' describe JSONCSVConverter::Converter do - + let(:converter) do - JSONCSVConverter::Converter.new("spec/fixtures/tests.json","spec/fixtures/test.csv","spec/fixtures/test_mapping.yml") + JSONCSVConverter::Converter.new("spec/fixtures/tests.json", + "spec/fixtures/test.csv", + "spec/fixtures/test_mapping.yml") end - + subject {converter} - + it {should_not be_nil} it {should respond_to(:csv_table)} it {should respond_to(:json)} @@ -15,7 +18,7 @@ it {should respond_to(:csv_to_json)} describe "migrate data from json to csv" do - + it "#csv_table should return the old csv table with the json data appended" do expected = <<-EOF fohoo,bahaar @@ -24,14 +27,15 @@ EOF converter.csv_table.to_csv.should == expected end - + end describe "migrate data from csv to json" do it "#json should return the old json object with the csv data appended" do - expected = %q({"tests":[{"foo":3,"bar":"string"},{"foo":"tidy up","bar":41}]}) - converter.csv_to_json.to_json.should == expected + expected = JSON(%q({"tests":[{"foo":3,"bar":"string"},{"foo":"tidy up","bar":41}]})) + result_string = converter.csv_to_json.to_json + JSON(result_string).should == expected end end
Change testing for JSON to JSON objects
diff --git a/lib/servizio/service/inherited_handler.rb b/lib/servizio/service/inherited_handler.rb index abc1234..def5678 100644 --- a/lib/servizio/service/inherited_handler.rb +++ b/lib/servizio/service/inherited_handler.rb @@ -8,7 +8,7 @@ end def self.new(*args, &block) - (obj = original_new(*args, &block)).singleton_class.prepend(Servizio::Service::Call) + (obj = original_new(*args, &block)).singleton_class.send(:prepend, Servizio::Service::Call) return obj end end
Make this ruby 2.0 compatible
diff --git a/app/workers/asyncapi/server/job_worker.rb b/app/workers/asyncapi/server/job_worker.rb index abc1234..def5678 100644 --- a/app/workers/asyncapi/server/job_worker.rb +++ b/app/workers/asyncapi/server/job_worker.rb @@ -3,8 +3,9 @@ include Sidekiq::Worker sidekiq_options retry: false + MAX_RETRIES = 2 - def perform(job_id) + def perform(job_id, retries=0) job = Job.find(job_id) runner_class = job.class_name.constantize @@ -15,8 +16,14 @@ job_message = [e.message, e.backtrace].flatten.join("\n") raise e ensure - job.update_attributes(status: job_status) - report_job_status(job, job_message) + if job + job.update_attributes(status: job_status) + report_job_status(job, job_message) + else + if retries < MAX_RETRIES + JobWorker.perform_async(job_id, retries+1) + end + end end private
Put the retry in the ensure block [#127624879]
diff --git a/DCOAboutWindow.podspec b/DCOAboutWindow.podspec index abc1234..def5678 100644 --- a/DCOAboutWindow.podspec +++ b/DCOAboutWindow.podspec @@ -10,7 +10,7 @@ s.license = 'BSD' s.author = { "Boy van Amstel" => "boy@dangercove.com" } s.platform = :osx, "10.8" - s.source = { :git => "https://github.com/DangerCove/DCOAboutWindow.git", :tag => "0.3.1" } + s.source = { :git => "https://github.com/DangerCove/DCOAboutWindow.git", :tag => "0.4.0" } s.source_files = 'DCOAboutWindow/*.{h,m}' s.resources = "DCOAboutWindow/*.{xib}" s.framework = 'QuartzCore'
Fix podspec to actually use 0.4.0 instead of 0.3.1.
diff --git a/TBStateMachine.podspec b/TBStateMachine.podspec index abc1234..def5678 100644 --- a/TBStateMachine.podspec +++ b/TBStateMachine.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "TBStateMachine" - s.version = "6.7.3" + s.version = "6.8.0" s.summary = "A lightweight hierarchical state machine framework in Objective-C." s.description = <<-DESC Supports all common features of a UML state machine like:
Raise pod version to 6.8.0.
diff --git a/lib/i18n_alchemy.rb b/lib/i18n_alchemy.rb index abc1234..def5678 100644 --- a/lib/i18n_alchemy.rb +++ b/lib/i18n_alchemy.rb @@ -25,7 +25,8 @@ end module ClassMethods - def localize(*methods, options) + def localize(*methods) + options = methods.extract_options! parser = options[:using] methods = methods.each_with_object(localized_methods) do |method_name, hash| hash[method_name] = parser
Fix argument splatting on Ruby 1.8
diff --git a/lib/juicy/server.rb b/lib/juicy/server.rb index abc1234..def5678 100644 --- a/lib/juicy/server.rb +++ b/lib/juicy/server.rb @@ -2,14 +2,18 @@ module Juicy class Server < Sinatra::Base + + @@juicy = nil + + def juicy + @@juicy + end helpers do Dir[File.dirname(__FILE__) + "/helpers/**/*.rb"].each do |file| load file end end - - attr_reader :juicy dir = File.dirname(File.expand_path(__FILE__)) @@ -18,12 +22,8 @@ set :static, true set :lock, true - def initialize(*args) - @juicy = Juicy::App.new - super(*args) - end - def self.start(host, port) + @@juicy = App.new Juicy::Server.run! :host => host, :port => port end
Create Juicy::App as a class variable, only once
diff --git a/spec/controllers/regions_controller_spec.rb b/spec/controllers/regions_controller_spec.rb index abc1234..def5678 100644 --- a/spec/controllers/regions_controller_spec.rb +++ b/spec/controllers/regions_controller_spec.rb @@ -0,0 +1,36 @@+require 'rails_helper' + +describe RegionsController do + + describe "GET #index" do + + before(:each) do + get :index, :format => :kml + end + + it "renders the regions index page" do + expect(response).to render_template(:index) + end + + it "returns a 200 (OK) ) http status code" do + expect(response).to have_http_status(200) + end + end + + describe "GET #show" do + let(:region) { FactoryGirl::create(:region)} + + before(:each) do + get :show, id: region.id, format: :kml + end + + it "renders the regions detail page" do + expect(response).to render_template(:show) + end + + it "returns a 200 (OK) ) http status code" do + expect(response).to have_http_status(200) + end + end + +end
Add regions-spec-controller to specs folder
diff --git a/lib/rails/routes.rb b/lib/rails/routes.rb index abc1234..def5678 100644 --- a/lib/rails/routes.rb +++ b/lib/rails/routes.rb @@ -3,8 +3,7 @@ def comments_on(*resources) options = resources.extract_options! - controller = 'loudmouth/comments' - + unless resources.count == 1 raise "too many arguments passed to comments_on. Format is comments_on :articles, :by => :users" end @@ -13,17 +12,20 @@ raise "comments_on must include an :by option. Format is comments_on :articles, :by => :users" end - controller = options[:controller] if options.has_key?(:controller) + unless options.has_key?(:controller) + options[:controller] = 'loudmouth/comments' + end topic_model = resources.first.to_s user_model = options[:by].to_s + options.delete(:by) constraint = lambda { |req| req.env["loudmouth_map"] = { :topic_model => topic_model, :user_model => user_model }; true } Rails.application.routes.draw do resources topic_model do constraints(constraint) do - resources "comments", :controller => controller + resources "comments", options end end end
Change options handling so it acts as just a pass through. We extract/delete loudmouth specific options prior to passing it on.
diff --git a/lib/sms_gear_api.rb b/lib/sms_gear_api.rb index abc1234..def5678 100644 --- a/lib/sms_gear_api.rb +++ b/lib/sms_gear_api.rb @@ -16,9 +16,13 @@ private - def pass_hash + def md5_pass_hash return @pass_hash if @pass_hash - @pass_hash = Digest::MD5.hexdigest @pass + @pass_hash = Digest::MD5.hexdigest @passw if @passw + end + + def target_to_str(target) + target.respond_to?(:join) ? target.join(', ') : target end end end
Rename pass_hash to md5_pass_hash, modify md5_pass_hash, add target_to_str method.
diff --git a/lib/super_search.rb b/lib/super_search.rb index abc1234..def5678 100644 --- a/lib/super_search.rb +++ b/lib/super_search.rb @@ -2,7 +2,7 @@ class SuperSearch def self.url - "http://search.alaska.dev/" + "http://search.alaska.test/" end def self.query_param_for(item_name) # item_name.gsub(/\s+/, '+') @@ -14,4 +14,4 @@ def self.url_for_engine(engine_key, item_name) SuperSearch.url + engine_key + '/' + SuperSearch.query_param_for(item_name) end -end+end
Update local domain for chrome
diff --git a/actionview/lib/action_view/log_subscriber.rb b/actionview/lib/action_view/log_subscriber.rb index abc1234..def5678 100644 --- a/actionview/lib/action_view/log_subscriber.rb +++ b/actionview/lib/action_view/log_subscriber.rb @@ -30,7 +30,9 @@ EMPTY = '' def from_rails_root(string) - string.sub(rails_root, EMPTY).sub(VIEWS_PATTERN, EMPTY) + string = string.sub(rails_root, EMPTY) + string.sub!(VIEWS_PATTERN, EMPTY) + string end def rails_root
Drop one more string allocation
diff --git a/app/controllers/embedded_tools_controller.rb b/app/controllers/embedded_tools_controller.rb index abc1234..def5678 100644 --- a/app/controllers/embedded_tools_controller.rb +++ b/app/controllers/embedded_tools_controller.rb @@ -1,9 +1,4 @@ class EmbeddedToolsController < ApplicationController - - # Prevent repeating of locale param in query string - Rails::Engine.subclasses.collect(&:instance).each do |engine| - engine.routes.routes.each { |r| r.required_parts << :locale } - end def parent_template 'layouts/engine'
Remove existing attempted engine locale param fix.
diff --git a/locationary.gemspec b/locationary.gemspec index abc1234..def5678 100644 --- a/locationary.gemspec +++ b/locationary.gemspec @@ -18,11 +18,12 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] - spec.add_runtime_dependency "bundler" - spec.add_runtime_dependency "rake" spec.add_runtime_dependency "msgpack" - spec.add_runtime_dependency "minitest" spec.add_runtime_dependency "zipruby", "0.3.6" spec.add_runtime_dependency "snappy" - spec.add_runtime_dependency "pry" + + spec.add_development_dependency "bundler" + spec.add_development_dependency "rake" + spec.add_development_dependency 'minitest' + spec.add_development_dependency "pry" end
Make some dependancies dev dependancies.
diff --git a/_plugins/include_root.rb b/_plugins/include_root.rb index abc1234..def5678 100644 --- a/_plugins/include_root.rb +++ b/_plugins/include_root.rb @@ -1,8 +1,8 @@ module Jekyll module Tags class IncludeRootTag < IncludeTag - def resolved_includes_dir(context) - '.'.freeze + def tag_includes_dirs(context) + ['.'].freeze end end end
Update IncludeRootTag for Jekyll 3.3 They love to change the API
diff --git a/app/models/project_services/slack_service.rb b/app/models/project_services/slack_service.rb index abc1234..def5678 100644 --- a/app/models/project_services/slack_service.rb +++ b/app/models/project_services/slack_service.rb @@ -40,7 +40,8 @@ project_name: project_name )) - credentials = webhook.match(/(\w*).slack.com.*services\/(.*)/) + credentials = webhook.match(/([\w-]*).slack.com.*services\/(.*)/) + if credentials.present? subdomain = credentials[1] token = credentials[2].split("token=").last
Use allowed slack team name.
diff --git a/spec/extensions/looser_typecasting_spec.rb b/spec/extensions/looser_typecasting_spec.rb index abc1234..def5678 100644 --- a/spec/extensions/looser_typecasting_spec.rb +++ b/spec/extensions/looser_typecasting_spec.rb @@ -4,11 +4,11 @@ before do @db = Sequel::Database.new({}) def @db.schema(*args) - [[:id, {}], [:y, {:type=>:float}], [:b, {:type=>:integer}]] + [[:id, {}], [:z, {:type=>:float}], [:b, {:type=>:integer}]] end @c = Class.new(Sequel::Model(@db[:items])) @c.instance_eval do - @columns = [:id, :b, :y] + @columns = [:id, :b, :z] def columns; @columns; end end end @@ -26,14 +26,14 @@ end specify "Should use to_f instead of Float() for typecasting floats" do - proc{@c.new(:y=>'a')}.should raise_error(Sequel::InvalidValue) + proc{@c.new(:z=>'a')}.should raise_error(Sequel::InvalidValue) @db.extend(Sequel::LooserTypecasting) - @c.new(:y=>'a').y.should == 0.0 + @c.new(:z=>'a').z.should == 0.0 o = Object.new def o.to_f 1.0 end - @c.new(:y=>o).y.should == 1.0 + @c.new(:z=>o).z.should == 1.0 end end
Rename y to z in looser typecasting spec to work around bundler/1.9.2 issues
diff --git a/spec/integration/rails/test/test_helper.rb b/spec/integration/rails/test/test_helper.rb index abc1234..def5678 100644 --- a/spec/integration/rails/test/test_helper.rb +++ b/spec/integration/rails/test/test_helper.rb @@ -2,10 +2,10 @@ require File.expand_path(File.dirname(__FILE__) + "/../config/environment") require 'test_help' -begin - require "redgreen" -rescue MissingSourceFile -end +# begin +# require "redgreen" +# rescue MissingSourceFile +# end require File.dirname(__FILE__) + "/../../../../lib/webrat"
Remove redgreen from rails integration tests too
diff --git a/spec/naver/searchad/api/ad/service_spec.rb b/spec/naver/searchad/api/ad/service_spec.rb index abc1234..def5678 100644 --- a/spec/naver/searchad/api/ad/service_spec.rb +++ b/spec/naver/searchad/api/ad/service_spec.rb @@ -0,0 +1,10 @@+require 'spec_helper' + +include Naver::Searchad::Api + +describe Ad::Service do + subject(:this) { described_class.new } + before(:each) do + this.authorization = Auth.get_application_default + end +end
Add empty spec for ad api
diff --git a/meta_morpha.gemspec b/meta_morpha.gemspec index abc1234..def5678 100644 --- a/meta_morpha.gemspec +++ b/meta_morpha.gemspec @@ -4,7 +4,7 @@ require 'meta_morpha/version' Gem::Specification.new do |spec| - spec.name = "MetaMorpha" + spec.name = "meta_morpha" spec.version = MetaMorpha::VERSION spec.authors = ["Kewan Shunn"] spec.email = ["kewan@kewanshunn.com"]
Add correct name in gemspec
diff --git a/generators/delayed_job/delayed_job_generator.rb b/generators/delayed_job/delayed_job_generator.rb index abc1234..def5678 100644 --- a/generators/delayed_job/delayed_job_generator.rb +++ b/generators/delayed_job/delayed_job_generator.rb @@ -1,11 +1,22 @@ class DelayedJobGenerator < Rails::Generator::Base + default_options :skip_migration => false def manifest record do |m| m.template 'script', 'script/delayed_job', :chmod => 0755 - m.migration_template "migration.rb", 'db/migrate', - :migration_file_name => "create_delayed_jobs" + unless options[:skip_migration] + m.migration_template "migration.rb", 'db/migrate', + :migration_file_name => "create_delayed_jobs" + end end end +protected + + def add_options!(opt) + opt.separator '' + opt.separator 'Options:' + opt.on("--skip-migration", "Don't generate a migration") { |v| options[:skip_migration] = v } + end + end
Add option to skip migration in generator
diff --git a/ever2boost.gemspec b/ever2boost.gemspec index abc1234..def5678 100644 --- a/ever2boost.gemspec +++ b/ever2boost.gemspec @@ -10,7 +10,7 @@ spec.email = ['suenagaryoutaabc@gmail.com'] spec.summary = 'Convert Evernote to Boostnote' - spec.description = 'ever2boost converts the all of your notes in evernote into Boostnote' + spec.description = 'ever2boost converts the all of your notes in Evernote into Boostnote' spec.homepage = 'https://github.com/BoostIO/ever2boost' spec.license = 'MIT'
Fix evernote to Evernote in gem description
diff --git a/Formula/zile.rb b/Formula/zile.rb index abc1234..def5678 100644 --- a/Formula/zile.rb +++ b/Formula/zile.rb @@ -1,9 +1,9 @@ require 'formula' class Zile < Formula - url 'http://ftp.gnu.org/gnu/zile/zile-2.3.17.tar.gz' + url 'http://ftp.gnu.org/gnu/zile/zile-2.3.23.tar.gz' homepage 'http://www.gnu.org/software/zile/' - md5 'd4a4409fd457e0cb51c76dd8dc09d18b' + md5 '4a2fa0015403cdf0eb32a5e648169cae' def install system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}", "--mandir=#{man}"
Update Zile from 2.3.17 to 2.3.23. Signed-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com>
diff --git a/rb-fsevent.gemspec b/rb-fsevent.gemspec index abc1234..def5678 100644 --- a/rb-fsevent.gemspec +++ b/rb-fsevent.gemspec @@ -13,8 +13,7 @@ s.description = 'FSEvents API with Signals catching (without RubyCocoa)' s.license = 'MIT' - s.files = `git ls-files`.split($/) - s.test_files = s.files.grep(%r{^spec/}) + s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^spec/}) } s.require_path = 'lib' s.add_development_dependency 'bundler', '~> 1.0'
Remove spec files from gemspec Close #58
diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index abc1234..def5678 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -16,7 +16,7 @@ current_user.is_only_researcher? ? load_academic_dashboard_resources : load_member_dashboard_resources else - render 'external/landing' + render 'external/landing', layout: 'full_page_no_header' end end
Use correct layout for landing page
diff --git a/recipes/default.rb b/recipes/default.rb index abc1234..def5678 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -17,13 +17,6 @@ # limitations under the License. # -# # Apply any platform-specific tweaks -# begin -# include_recipe "omnibus::#{node['platform_family']}" -# rescue Chef::Exceptions::RecipeNotFound -# Chef::Log.warn "An Omnibus platform recipe does not exist for the platform_family: #{node['platform_family']}" -# end - include_recipe 'omnibus::_bash' include_recipe 'omnibus::_ccache' include_recipe 'omnibus::_common'
Remove include_recipe for platform bits
diff --git a/recipes/mongodb.rb b/recipes/mongodb.rb index abc1234..def5678 100644 --- a/recipes/mongodb.rb +++ b/recipes/mongodb.rb @@ -18,3 +18,9 @@ # include_recipe "mongodb" +include_recipe "mongodb::user_management" + +# Restart mongodb sevice +service "mongodb" do + action :restart +end
Manage MongoDB users and restart service after
diff --git a/lib/generators/serializr/templates/serializr.rb b/lib/generators/serializr/templates/serializr.rb index abc1234..def5678 100644 --- a/lib/generators/serializr/templates/serializr.rb +++ b/lib/generators/serializr/templates/serializr.rb @@ -1,6 +1,6 @@ <% module_namespacing do -%> class <%= class_name %>Serializer < <%= parent_class_name %> - <% if attributes.present? -%> + <% if attributes.present? %> attributes <%= attributes.map { |a| a.name.to_sym.inspect }.join(', ') %> <% end %> end
Fix the whitespace during attributes generation
diff --git a/lib/github/ldap/user_search/active_directory.rb b/lib/github/ldap/user_search/active_directory.rb index abc1234..def5678 100644 --- a/lib/github/ldap/user_search/active_directory.rb +++ b/lib/github/ldap/user_search/active_directory.rb @@ -2,12 +2,6 @@ class Ldap module UserSearch class ActiveDirectory < Default - - # Public - Overridden from base class to set the base to "", and use the - # Global Catalog to perform the user search. - def search(search_options) - Array(global_catalog_connection.search(search_options.merge(options))) - end # Returns a connection to the Active Directory Global Catalog # @@ -15,6 +9,14 @@ # def global_catalog_connection GlobalCatalog.connection(ldap) + end + + private + + # Private - Overridden from base class to set the base to "", and use the + # Global Catalog to perform the user search. + def search(search_options) + Array(global_catalog_connection.search(search_options.merge(options))) end # When doing a global search for a user's DN, set the search base to blank
Make search & options private on ActiveDirectory user search
diff --git a/Casks/netbeans-cpp-nightly.rb b/Casks/netbeans-cpp-nightly.rb index abc1234..def5678 100644 --- a/Casks/netbeans-cpp-nightly.rb +++ b/Casks/netbeans-cpp-nightly.rb @@ -1,10 +1,11 @@ cask :v1 => 'netbeans-cpp-nightly' do - homepage 'https://netbeans.org/' - license :unknown version '201503300001' sha256 'a32cf8af6bebd159daa13664eb993d86558323bf6036627cccbaaaaf8aacbded' url "http://bits.netbeans.org/download/trunk/nightly/latest/bundles/netbeans-trunk-nightly-#{version}-cpp-macosx.dmg" + homepage 'https://netbeans.org/' + license :unknown + pkg "NetBeans Dev #{version}.mpkg" uninstall :delete => '/Applications/NetBeans'
Reorder Netbeans CPP Nightly Cask
diff --git a/core/lib/spree/testing_support/factories/credit_card_factory.rb b/core/lib/spree/testing_support/factories/credit_card_factory.rb index abc1234..def5678 100644 --- a/core/lib/spree/testing_support/factories/credit_card_factory.rb +++ b/core/lib/spree/testing_support/factories/credit_card_factory.rb @@ -7,7 +7,7 @@ factory :credit_card, class: TestCard do verification_value 123 month 12 - year { Date.year } + year { Time.now.year } number '4111111111111111' end end
Use Time.now.year as Date.year is invalid.
diff --git a/app/models/product_food/lozenge.rb b/app/models/product_food/lozenge.rb index abc1234..def5678 100644 --- a/app/models/product_food/lozenge.rb +++ b/app/models/product_food/lozenge.rb @@ -1,6 +1,6 @@ module ProductFood class Lozenge < ActiveRecord::Base - TYPES = ['Calories', 'Sugars', 'Fat', 'Saturates', 'Salts'] + TYPES = ['Energy', 'Sugars', 'Fat', 'Saturates', 'Salts'] belongs_to :item
Replace Calories with Energy for the Product Lozenges
diff --git a/app/models/spree/user.rb b/app/models/spree/user.rb index abc1234..def5678 100644 --- a/app/models/spree/user.rb +++ b/app/models/spree/user.rb @@ -1,5 +1,7 @@ module Spree class User < ActiveRecord::Base + include UserAddress + self.table_name = 'spree_people' authenticates_with_sorcery!
Include UserAddress concern in User model
diff --git a/app/models/technology.rb b/app/models/technology.rb index abc1234..def5678 100644 --- a/app/models/technology.rb +++ b/app/models/technology.rb @@ -6,6 +6,7 @@ attribute :load, Float attribute :profile, String attribute :capacity, Float + attribute :demand, Float # Public: Returns if the technology has been defined in the data/technologies # directory.
Add (optional) demand attribute to Technology
diff --git a/app/helpers/batch_select_helper.rb b/app/helpers/batch_select_helper.rb index abc1234..def5678 100644 --- a/app/helpers/batch_select_helper.rb +++ b/app/helpers/batch_select_helper.rb @@ -1,23 +1,8 @@ # View Helpers for Hydra Batch Edit functionality module BatchSelectHelper - # determines if the given document id is in the batch - # def item_in_batch?(doc_id) - # session[:batch_document_ids] && session[:batch_document_ids].include?(doc_id) ? true : false - # end - - # Displays the batch edit tools. Put this in your search result page template. We recommend putting it in catalog/_sort_and_per_page.html.erb - def batch_select_tools - render partial: '/batch_select/tools' - end - # Displays the button to select/deselect items for your batch. Call this in the index partial that's rendered for each search result. # @param [Hash] document the Hash (aka Solr hit) for one Solr document def button_for_add_to_batch(document) render partial: '/batch_select/add_button', locals: { document: document } end - - # Displays the check all button to select/deselect items for your batch. Put this in your search result page template. We put it in catalog/index.html - def batch_check_all(label = 'Use all results') - render partial: '/batch_select/check_all', locals: { label: label } - end end
Remove unused and untested methods
diff --git a/rollout_ui.gemspec b/rollout_ui.gemspec index abc1234..def5678 100644 --- a/rollout_ui.gemspec +++ b/rollout_ui.gemspec @@ -15,7 +15,7 @@ gem.test_files = Dir["spec/**/*"] gem.require_paths = ["lib"] - gem.add_runtime_dependency('rollout', '~> 1.0.0') + gem.add_runtime_dependency('rollout', '~> 1.1.0') gem.add_development_dependency('rake') gem.add_development_dependency('rails')
Support the latest rollout version
diff --git a/lib/active_storage/migration.rb b/lib/active_storage/migration.rb index abc1234..def5678 100644 --- a/lib/active_storage/migration.rb +++ b/lib/active_storage/migration.rb @@ -1,13 +1,13 @@ class ActiveStorageCreateTables < ActiveRecord::Migration[5.1] def change create_table :active_storage_blobs do |t| - t.string :key - t.string :filename - t.string :content_type - t.text :metadata - t.integer :byte_size - t.string :checksum - t.time :created_at + t.string :key + t.string :filename + t.string :content_type + t.text :metadata + t.integer :byte_size + t.string :checksum + t.datetime :created_at t.index [ :key ], unique: true end @@ -17,7 +17,7 @@ t.string :record_gid t.integer :blob_id - t.time :created_at + t.datetime :created_at t.index :record_gid t.index :blob_id
Change type of created_at columns from time to datetime We intend to store a date and time, not merely a time.
diff --git a/lib/backlog_kit/client/space.rb b/lib/backlog_kit/client/space.rb index abc1234..def5678 100644 --- a/lib/backlog_kit/client/space.rb +++ b/lib/backlog_kit/client/space.rb @@ -11,7 +11,7 @@ get('space') end - # Get list of groups + # Get list of space activities # # @param params [Hash] Request parameters # @return [BacklogKit::Response] List of recent updates in your space
Fix wrong documentation in the Space API
diff --git a/lib/modesty/frameworks/rails.rb b/lib/modesty/frameworks/rails.rb index abc1234..def5678 100644 --- a/lib/modesty/frameworks/rails.rb +++ b/lib/modesty/frameworks/rails.rb @@ -1,4 +1,5 @@ Modesty.root = File.join(Rails.root, 'modesty') +Modesty.config_path = File.join(Rails.root, 'config/modesty.yml') Rails.configuration.after_initialize do Modesty.load! end
Set standard config path when we're in Rails
diff --git a/app/models/qernel/plugins/disable_sectors.rb b/app/models/qernel/plugins/disable_sectors.rb index abc1234..def5678 100644 --- a/app/models/qernel/plugins/disable_sectors.rb +++ b/app/models/qernel/plugins/disable_sectors.rb @@ -14,22 +14,18 @@ disabled = @graph.area.disabled_sectors @graph.converters.each do |converter| - if disabled.include?(converter.sector_key) - if converter.sector_key == :energy - if converter.dataset_get(:number_of_units) - converter.dataset_set(:number_of_units, 0.0) - end + next unless disabled.include?(converter.sector_key) - if converter.preset_demand - converter.preset_demand = 0.0 - end - else - converter.demand = converter.preset_demand = 0.0 - end + if converter.dataset_get(:number_of_units) + converter.dataset_set(:number_of_units, 0.0) + end - converter.input_links.each do |link| - link.share = 0.0 if link.link_type == :constant - end + if converter.sector_key != :energy || converter.preset_demand + converter.demand = converter.preset_demand = 0.0 + end + + converter.input_links.each do |link| + link.share = 0.0 if link.link_type == :constant end end end
Set NoU=0 on disabled agriculture and industry producers Sets number of units to zero on electricity producers in the agriculture and industry sectors. This ensures that these producers are not used in the Merit order. Ref quintel/etmodel#2314
diff --git a/SVPulsingAnnotationView.podspec b/SVPulsingAnnotationView.podspec index abc1234..def5678 100644 --- a/SVPulsingAnnotationView.podspec +++ b/SVPulsingAnnotationView.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = 'SVPulsingAnnotationView' - s.version = '0.1' - s.license = 'ISC' + s.version = '0.2' + s.license = 'MIT' s.platform = :ios s.summary = 'A customizable MKUserLocationView replica for your iOS app.' s.homepage = 'https://github.com/samvermette/SVPulsingAnnotationView' @@ -9,6 +9,5 @@ s.source = { :git => 'https://github.com/samvermette/SVPulsingAnnotationView.git', :tag => s.version.to_s } s.source_files = 'SVPulsingAnnotationView/*.{h,m}' s.frameworks = 'QuartzCore', 'MapKit' - s.preserve_paths = 'Demo' s.requires_arc = true end
Update podspec to 0.2, change license to MIT, remove Demo from preserve_paths.
diff --git a/cookbooks/ondemand_base/recipes/centos.rb b/cookbooks/ondemand_base/recipes/centos.rb index abc1234..def5678 100644 --- a/cookbooks/ondemand_base/recipes/centos.rb +++ b/cookbooks/ondemand_base/recipes/centos.rb @@ -25,9 +25,9 @@ auth_config = data_bag_item('authorization', "ondemand") # set root password from authorization databag -#user "root" do -# password auth_config['root_password'] -#end +user "root" do + password auth_config['root_password'] +end # add non-root user from authorization databag if auth_config['alternate_user']
Add changing the root password to the CentOS recipe Former-commit-id: bce838971e09cb74e4b47a08ab1397104cd4b925
diff --git a/examples/cloud/import.rb b/examples/cloud/import.rb index abc1234..def5678 100644 --- a/examples/cloud/import.rb +++ b/examples/cloud/import.rb @@ -17,4 +17,4 @@ cloud = Flipper::Cloud.new # makes cloud identical to memory flipper -cloud.import(Flipper.instance) +cloud.import(Flipper)
Use `Flipper` instead of `Flipper.instance`
diff --git a/roda/app.rb b/roda/app.rb index abc1234..def5678 100644 --- a/roda/app.rb +++ b/roda/app.rb @@ -1,19 +1,21 @@ require "roda" +require "oj" require "./contact_query" module Main class App < Roda use Rack::Session::Cookie, secret: "v3rYstr0n9S3cr3t;)" + Oj.default_options = {:mode => :compat } plugin :indifferent_params plugin :default_headers, - 'Content-Type' => 'application/json; charset=utf-8' + "Content-Type" => "application/json; charset=utf-8" route do |r| # /contacts r.get "contacts" do - ContactQuery.new(params).all().to_json + Oj.dump ContactQuery.new(params).all() end end end
[roda][App] Speed up encoding to json
diff --git a/app/helpers/dashboard_helper.rb b/app/helpers/dashboard_helper.rb index abc1234..def5678 100644 --- a/app/helpers/dashboard_helper.rb +++ b/app/helpers/dashboard_helper.rb @@ -2,6 +2,7 @@ def filter_path(entity, options={}) exist_opts = { status: params[:status], + scope: params[:scope], project_id: params[:project_id], } @@ -12,7 +13,7 @@ path end - def entities_per_project project, entity + def entities_per_project(project, entity) items = project.items_for(entity) items = case params[:status]
Include scope in dashboard filters Signed-off-by: Dmitriy Zaporozhets <be23d75b156792e5acab51b196a2deb155d35d6a@gmail.com>
diff --git a/abstract_class.gemspec b/abstract_class.gemspec index abc1234..def5678 100644 --- a/abstract_class.gemspec +++ b/abstract_class.gemspec @@ -1,12 +1,10 @@ # -*- encoding: utf-8 -*- require_relative 'lib/abstract_class/version' -require 'date' Gem::Specification.new do |s| s.name = 'abstract_class' s.version = AbstractClass::Version - s.date = Date.today s.platform = Gem::Platform::RUBY s.summary = 'Abstract classes in ruby'
Remove date related functionality from gemspec I believe the date is set to "today" by default
diff --git a/app/models/received_email.rb b/app/models/received_email.rb index abc1234..def5678 100644 --- a/app/models/received_email.rb +++ b/app/models/received_email.rb @@ -1,6 +1,7 @@ class ReceivedEmail include ActiveModel::Model - EMAIL_REGEX = /[^\s:,;‘"`<>]+?@[^\s:,;'"`<>]+\.[^\s:,;‘“`<>]+/ + BANNED_CHARS = %(\\s:,;'"`<>) + EMAIL_REGEX = /[^#{BANNED_CHARS}]+?@[^#{BANNED_CHARS}]+\.[^#{BANNED_CHARS}]+/ attr_accessor :sender_email attr_accessor :headers
Add banned chars to ReceivedEmail regex
diff --git a/app/jobs/scheduled/poll_feed.rb b/app/jobs/scheduled/poll_feed.rb index abc1234..def5678 100644 --- a/app/jobs/scheduled/poll_feed.rb +++ b/app/jobs/scheduled/poll_feed.rb @@ -32,8 +32,10 @@ url = i.link url = i.id if url.blank? || url !~ /^https?\:\/\// - content = CGI.unescapeHTML(i.content.scrub) - TopicEmbed.import(user, url, i.title, content) + content = i.content || i.description + if content + TopicEmbed.import(user, url, i.title, CGI.unescapeHTML(content.scrub)) + end end end
FIX: Support feeds with `description` as well as `content`
diff --git a/lib/active_attr/strict_mass_assignment.rb b/lib/active_attr/strict_mass_assignment.rb index abc1234..def5678 100644 --- a/lib/active_attr/strict_mass_assignment.rb +++ b/lib/active_attr/strict_mass_assignment.rb @@ -32,7 +32,7 @@ def assign_attributes(new_attributes, options={}) unknown_attribute_names = (new_attributes || {}).reject do |name, value| respond_to? "#{name}=" - end.map { |name, value| name }.sort + end.map { |name, value| name.to_s }.sort if unknown_attribute_names.any? raise UnknownAttributesError, "unknown attribute(s): #{unknown_attribute_names.join(", ")}"
Fix StrictMassAssignment specs on 1.8 where symbols cannot be sorted.
diff --git a/db/migrate/20151029211323_create_users.rb b/db/migrate/20151029211323_create_users.rb index abc1234..def5678 100644 --- a/db/migrate/20151029211323_create_users.rb +++ b/db/migrate/20151029211323_create_users.rb @@ -1,7 +1,6 @@ class CreateUsers < ActiveRecord::Migration def change create_table :users do |t| - t.string :user_id, null: false t.string :first_name, null: false t.string :last_name, null: false t.string :email, null: false
Remove the user_id from the migration for Users. We don't need to supply this. Let ActiveRecord manage it.