diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/vim-flavor.gemspec b/vim-flavor.gemspec index abc1234..def5678 100644 --- a/vim-flavor.gemspec +++ b/vim-flavor.gemspec @@ -15,6 +15,7 @@ gem.require_paths = ['lib'] gem.version = Vim::Flavor::VERSION + gem.add_dependency('thor', '~> 0.14.6') + gem.add_development_dependency('rspec', '~> 2.8') - gem.add_development_dependency('thor', '~> 0.14.6') end
Fix dependency type for thor Thor is a runtime dependency, not a development dependency.
diff --git a/core/app/models/mno_enterprise/app_question.rb b/core/app/models/mno_enterprise/app_question.rb index abc1234..def5678 100644 --- a/core/app/models/mno_enterprise/app_question.rb +++ b/core/app/models/mno_enterprise/app_question.rb @@ -5,6 +5,6 @@ belongs_to :app scope :approved, -> { where(status: 'approved') } - scope :search, ->(search) { where("description.like": "%#{search}%") } + scope :search, ->(search) { where("description.like" => "%#{search}%") } end end
Fix specs on MRI 2.1
diff --git a/FDStatusBarNotifierView.podspec b/FDStatusBarNotifierView.podspec index abc1234..def5678 100644 --- a/FDStatusBarNotifierView.podspec +++ b/FDStatusBarNotifierView.podspec @@ -4,7 +4,7 @@ s.summary = "FDStatusBarNotifier is a UIView subclass that lets you display notifications using the space in which the status bar resides." s.homepage = "https://github.com/frankdilo/FDStatusBarNotifierView" s.license = { :type => 'MIT', :file => 'LICENSE'} - s.source = { :git => "https://github.com/lukabernardi/FDStatusBarNotifierView.git" } + s.source = { :git => "https://github.com/frankdilo/FDStatusBarNotifierView" } s.platform = :ios, '5.0' s.source_files = 'FDStatusBarNotifierView/*.{h,m}'
Change the podspec source URL
diff --git a/spec/unit/lib/infrataster/contexts/dns_contexts_spec.rb b/spec/unit/lib/infrataster/contexts/dns_contexts_spec.rb index abc1234..def5678 100644 --- a/spec/unit/lib/infrataster/contexts/dns_contexts_spec.rb +++ b/spec/unit/lib/infrataster/contexts/dns_contexts_spec.rb @@ -4,12 +4,13 @@ # Infrataster contexts module Contexts describe DnsContext do - subject { described_class.new(nil, nil).public_methods } + let(:server) { Server.new('ns.example.com', '192.168.33.10', :dns) } + subject { described_class.new(server, nil) } it 'should have `have_entry` method' do - is_expected.to include(:have_entry) - end - it 'should have `have_dns` method from rspec-dns' do - is_expected.to include(:have_dns) + matcher = double('matcher') + allow(matcher).to receive(:config) + allow(subject).to receive(:have_dns).and_return(matcher) + subject.have_entry end end end
Replace tests have_entry with a test with stub
diff --git a/lib/backup/finder.rb b/lib/backup/finder.rb index abc1234..def5678 100644 --- a/lib/backup/finder.rb +++ b/lib/backup/finder.rb @@ -22,7 +22,7 @@ ## # Loads the backup configuration file - instance_eval(File.read(config)) + instance_eval(File.read(config), config, 1) ## # Iterates through all the instantiated backup models and returns
Support require with relative path (from current file) in Backup config files. Without giving the second and third args, the string-based instance_eval doesn't provide valid __FILE__ and __LINE__ references within the backup config file. Useful for building a relative path, among other things.
diff --git a/lib/notifier/base.rb b/lib/notifier/base.rb index abc1234..def5678 100644 --- a/lib/notifier/base.rb +++ b/lib/notifier/base.rb @@ -20,7 +20,7 @@ def notify_once(message, device_tokens, payload = nil) if FwtPushNotificationServer.delivery_method == :test - FwtPushNotificationServer.deliveries[self.class.name] << message + FwtPushNotificationServer.deliveries[FwtPushNotificationServer.notifier_handles[self.class]] << message else send_notify_once(message, device_tokens, payload) end
Update testing code for notifier code
diff --git a/lib/marples/model_action_broadcast.rb b/lib/marples/model_action_broadcast.rb index abc1234..def5678 100644 --- a/lib/marples/model_action_broadcast.rb +++ b/lib/marples/model_action_broadcast.rb @@ -9,7 +9,6 @@ class_attribute :marples_transport # You *will* need to set this yourself in each application. class_attribute :marples_client_name - self.marples_client_name = File.basename(Rails.root) # If you'd like the actions performed by Marples to be logged, set a # logger. By default this uses the NullLogger. class_attribute :marples_logger
Remove automagic implicit default for marples_client_name The application should set this explicitly. The implicit behaviour is brittle since it depends on the application's directory name, which can change between environments (e.g. it's different in Jenkins), and is therefore a potential source of bugs.
diff --git a/gotero.rb b/gotero.rb index abc1234..def5678 100644 --- a/gotero.rb +++ b/gotero.rb @@ -32,7 +32,7 @@ OUT - diag << {:message => method} + diag << {:message => method, :receiver => binding.eval('self')} end end @@ -43,11 +43,13 @@ set_trace_func nil def assert(value, expected = true) - if value == expected + if expected == value || ( expected.respond_to?(:match) && expected.match(value) ) puts '.' else - raise "#{value} != #{expected}" + raise "#{ value.inspect } != #{ expected.inspect }" end end assert diag[0][:message], :ask +assert diag[0][:sender], nil +assert diag[0][:receiver].inspect, /#\<Knowledge:.+>/
Test sender and receiver of first node
diff --git a/lib/tasks/update_mainstream_slug.rake b/lib/tasks/update_mainstream_slug.rake index abc1234..def5678 100644 --- a/lib/tasks/update_mainstream_slug.rake +++ b/lib/tasks/update_mainstream_slug.rake @@ -2,5 +2,5 @@ See original documentation @ https://github.com/alphagov/wiki/wiki/Changing-GOV.UK-URLs#making-the-change" task :update_mainstream_slug, [:old_slug, :new_slug] => :environment do |_task, args| - MainstreamSlugUpdater.new(args[:old_slug], args[:new_slug]).update + MainstreamSlugUpdater.new(args[:old_slug], args[:new_slug], Logger.new(STDOUT)).update end
Add STDOUT logging to slug changes In order to give some feedback add some logging to STDOUT so we know whats happening
diff --git a/app/helpers/devise_helper.rb b/app/helpers/devise_helper.rb index abc1234..def5678 100644 --- a/app/helpers/devise_helper.rb +++ b/app/helpers/devise_helper.rb @@ -1,14 +1,26 @@ # frozen_string_literal: true module DeviseHelper - # Retain this method for backwards compatibility, deprecated in favour of modifying the - # devise/shared/error_messages partial + # Retain this method for backwards compatibility, deprecated in favor of modifying the + # devise/shared/error_messages partial. def devise_error_messages! ActiveSupport::Deprecation.warn <<-DEPRECATION.strip_heredoc - [Devise] `DeviseHelper.devise_error_messages!` - is deprecated and it will be removed in the next major version. - To customize the errors styles please run `rails g devise:views` and modify the - `devise/shared/error_messages` partial. + [Devise] `DeviseHelper#devise_error_messages!` is deprecated and will be + removed in the next major version. + + Devise now uses a partial under "devise/shared/error_messages" to display + error messages by default, and make them easier to customize. Update your + views changing calls from: + + <%= devise_error_messages! %> + + to: + + <%= render "devise/shared/error_messages", resource: resource %> + + To start customizing how errors are displayed, you can copy the partial + from devise to your `app/views` folder. Alternatively, you can run + `rails g devise:views` which will copy all of them again to your app. DEPRECATION return "" if resource.errors.empty?
Improve deprecation message with example of how to remove it The deprecation of `devise_error_messages!` wasn't super clear on what was happening and how to get rid of the message, not it has a more detailed explanation with an example of what to look for and what to replace it with. Closes #5257.
diff --git a/app/helpers/events_helper.rb b/app/helpers/events_helper.rb index abc1234..def5678 100644 --- a/app/helpers/events_helper.rb +++ b/app/helpers/events_helper.rb @@ -28,11 +28,16 @@ end end def already_registered?(event_id) - binding.pry if current_user.registrations.where("id = ?",event_id) true else false end end + + def display_event(event) + binding.pry + event_type = Event::EVENT_TYPE.detect{ |a| a.include?(event.event_type)} + event_type[0] + end end
Add helper method for displaying event type
diff --git a/app/mailers/person_mailer.rb b/app/mailers/person_mailer.rb index abc1234..def5678 100644 --- a/app/mailers/person_mailer.rb +++ b/app/mailers/person_mailer.rb @@ -8,8 +8,6 @@ @screen_name = person.read_attribute(:twitter_id) subject = "New person added from Twitter: #{@screen_name}" - UserRole.staff_members.each do |staff_member| - mail to: staff_member.email, subject: subject - end + mail to: UserRole.staff_members.pluck(:email), subject: subject end end
Fix staff member notification of twitter user Supports #255
diff --git a/app/models/reports/graphs.rb b/app/models/reports/graphs.rb index abc1234..def5678 100644 --- a/app/models/reports/graphs.rb +++ b/app/models/reports/graphs.rb @@ -25,7 +25,7 @@ order_details = OrderDetail.joins(:order).where(orders: { status: 6 }) .group_by { |m| m.created_at.beginning_of_month } - order_details.each { |datetime, od| results[datetime.strftime("%B %Y")] = od.map(&:quantity).sum } + order_details.each { |datetime, od| results[datetime.strftime("%b %y")] = od.map(&:quantity).sum } results end
Update month year for items by month
diff --git a/test/helper/testgem/testgem.gemspec b/test/helper/testgem/testgem.gemspec index abc1234..def5678 100644 --- a/test/helper/testgem/testgem.gemspec +++ b/test/helper/testgem/testgem.gemspec @@ -11,6 +11,6 @@ s.license = 'BSD-3-Clause' s.require_paths << 'lib' s.required_ruby_version = '>= 2.1.0' - s.metadata['msys2_dependencies'] = 'ed' - s.metadata['msys2_mingw_dependencies'] = 'libguess' + s.metadata['msys2_dependencies'] = 'ed>=1.0' + s.metadata['msys2_mingw_dependencies'] = 'libguess>=1.0 gcc>=8.0' end
Add a second dependency and version constraints for "gem install" test ... to make sure they are handled properly
diff --git a/test/integration/navigation_test.rb b/test/integration/navigation_test.rb index abc1234..def5678 100644 --- a/test/integration/navigation_test.rb +++ b/test/integration/navigation_test.rb @@ -5,7 +5,7 @@ test 'can render default landing page' do visit '/' - assert page.has_text? "That was easy, wasn't it?" + assert page.has_text? "Welcome to Ember on Rails!" end test 'can using simple "ember magic"' do
Update integration test for new welcome page copy.
diff --git a/lib/gdata.rb b/lib/gdata.rb index abc1234..def5678 100644 --- a/lib/gdata.rb +++ b/lib/gdata.rb @@ -18,5 +18,5 @@ require 'gdata/client' require 'gdata/auth' # This is for Unicode "support" -require 'jcode' -$KCODE = 'UTF8'+require 'jcode' if RUBY_VERSION < '1.9' +$KCODE = 'UTF8'
Fix for new Ruby version.
diff --git a/db/migrate/20110707234802_likes_on_comments.rb b/db/migrate/20110707234802_likes_on_comments.rb index abc1234..def5678 100644 --- a/db/migrate/20110707234802_likes_on_comments.rb +++ b/db/migrate/20110707234802_likes_on_comments.rb @@ -1,5 +1,5 @@ class LikesOnComments < ActiveRecord::Migration - class Likes < ActiveRecord::Base; end + class Like < ActiveRecord::Base; end def self.up remove_foreign_key :likes, :posts
Fix likes on comments migration
diff --git a/lib/omniauth/multiprovider/models/email_mockups.rb b/lib/omniauth/multiprovider/models/email_mockups.rb index abc1234..def5678 100644 --- a/lib/omniauth/multiprovider/models/email_mockups.rb +++ b/lib/omniauth/multiprovider/models/email_mockups.rb @@ -8,7 +8,7 @@ end def mocked_email? - read_attribute(:email).match(/.*@from\-.*\.example$/) != nil + mocked_email.to_s.match(/.*@from\-.*\.example$/) != nil end def mocked_email @@ -16,7 +16,7 @@ end def email - mocked_email? ? nil : read_attribute(:email) + mocked_email? ? nil : mocked_email end module ClassMethods
Fix for non initialised emails this could happen when the record is not persisted
diff --git a/hodgepodge.gemspec b/hodgepodge.gemspec index abc1234..def5678 100644 --- a/hodgepodge.gemspec +++ b/hodgepodge.gemspec @@ -11,16 +11,8 @@ spec.summary = %q{Brew your mac system packages.} spec.description = %q{Install and manage your system binaries and system app packages.} - spec.homepage = "TODO: Put your gem's website or public repo URL here." + spec.homepage = "http://kunday.com" spec.license = "MIT" - - # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or - # delete this section to allow pushing this gem to any host. - if spec.respond_to?(:metadata) - spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'" - else - raise "RubyGems 2.0 or newer is required to protect against public gem pushes." - end spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } spec.bindir = "exe"
Remove unwanted code from the homepage.
diff --git a/features/support/env.rb b/features/support/env.rb index abc1234..def5678 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -17,7 +17,7 @@ end def cuketagger - "ruby -rubygems #{ROOT}/bin/cuketagger" + "ruby -W0 -rubygems #{ROOT}/bin/cuketagger" end end
Make features pass on 1.9
diff --git a/foodspot_friend_oga.rb b/foodspot_friend_oga.rb index abc1234..def5678 100644 --- a/foodspot_friend_oga.rb +++ b/foodspot_friend_oga.rb @@ -0,0 +1,87 @@+#!/usr/bin/env ruby + +# This script uses Selenium WebDriver, Nokogiri and Safari to scrape the +# friends and followers lists of the currently logged-in Foodspotting user. +# Then it groups the contacts into 3 sets: mutual friends, only followers, and +# only following. + +require 'selenium-webdriver' +require 'oga' +require 'set' + +# Get the user name. +def get_user_name web + puts 'Getting user name...' + url = 'http://foodspotting.com/me' + web.get url + m = web.current_url.match(%r{foodspotting\.com/([^/]+)$}) + fail 'Unable to retrieve user name. Please log in to Foodspotting before running this script.' unless m + m[1] +end + +# Find the highest-numbered page by parsing the pages links. +def get_last_page doc + doc.css('div.pagination a[href*="?page="]').map { |elem| + elem.get('href').match(/\?page=(\d+)/)[1].to_i + }.max +end + +# Parse user IDs and names from the contact list. +def get_names doc + doc.css('div.title a').map { |elem| + id = elem.get('href').sub(%r{^/}, '') + name = elem.inner_text.strip + { id: id, name: name } + } +end + +# Process the contact list, returning a list of users from all the pages in +# the list. +def process_list what, username, web + puts "Fetching #{what} page 1..." + + url = "http://www.foodspotting.com/#{username}/#{what}" + web.get url + + doc = Oga.parse_html(web.page_source) + last_page = get_last_page doc + names = get_names doc + + (2..last_page).each { |page| + puts "Fetching #{what} page #{page}..." + web.get "#{url}?page=#{page}" + + doc = Oga.parse_html(web.page_source) + names += get_names doc + } + + names +end + +def show_list flist + flist.each_with_index { |name, i| + puts "#{i + 1}: #{name[:id]} - #{name[:name]}" + } +end + +web = nil +begin + web = Selenium::WebDriver.for :safari + username = get_user_name web + + followers = Set.new(process_list :followers, username, web) + following = Set.new(process_list :following, username, web) + + puts 'Mutual followers:' + show_list(following & followers) + + puts 'Only followers:' + show_list(followers - following) + + puts 'Only following:' + show_list(following - followers) +ensure + web.close if web +end + +__END__
Add Oga version of foodspot_friend
diff --git a/lib/sastrawi/morphology/disambiguator/disambiguator_prefix_rule11.rb b/lib/sastrawi/morphology/disambiguator/disambiguator_prefix_rule11.rb index abc1234..def5678 100644 --- a/lib/sastrawi/morphology/disambiguator/disambiguator_prefix_rule11.rb +++ b/lib/sastrawi/morphology/disambiguator/disambiguator_prefix_rule11.rb @@ -0,0 +1,17 @@+module Sastrawi + module Morphology + module Disambiguator + class DisambiguatorPrefixRule11 + def disambiguate(word) + contains = /^mem([bfv])(.*)$/.match(word) + + if contains + matches = contains.captures + + return matches[0] << matches[1] + end + end + end + end + end +end
Add implementation of eleventh rule of disambiguator prefix
diff --git a/SwiftLintFramework.podspec b/SwiftLintFramework.podspec index abc1234..def5678 100644 --- a/SwiftLintFramework.podspec +++ b/SwiftLintFramework.podspec @@ -10,5 +10,5 @@ s.source_files = 'Source/SwiftLintFramework/**/*.swift' s.pod_target_xcconfig = { 'APPLICATION_EXTENSION_API_ONLY' => 'YES' } s.dependency 'SourceKittenFramework', '~> 0.21' - s.dependency 'Yams', '~> 0.7' + s.dependency 'Yams', '~> 1.0' end
Update Yams to 1.0 in podspec
diff --git a/app/models/cohort.rb b/app/models/cohort.rb index abc1234..def5678 100644 --- a/app/models/cohort.rb +++ b/app/models/cohort.rb @@ -4,4 +4,11 @@ def organisations groups.where('parent_id IS NULL') end + + def activated_organisations + #organisation_visits_count + subquery = GroupMeasurement.select('DISTINCT group_id') + .where('organisation_member_visits_count > 5') + organisations.where("id in (#{subquery.to_sql})") + end end
Put activated_organisations method back in
diff --git a/pre_commit/resources/empty_template/pre_commit_dummy_package.gemspec b/pre_commit/resources/empty_template/pre_commit_dummy_package.gemspec index abc1234..def5678 100644 --- a/pre_commit/resources/empty_template/pre_commit_dummy_package.gemspec +++ b/pre_commit/resources/empty_template/pre_commit_dummy_package.gemspec @@ -1,5 +1,6 @@ Gem::Specification.new do |s| s.name = 'pre_commit_dummy_package' s.version = '0.0.0' + s.summary = 'dummy gem for pre-commit hooks' s.authors = ['Anthony Sottile'] end
Make the dummy gem valid by giving it a summary
diff --git a/spec/support/features/fill_addresses_fields.rb b/spec/support/features/fill_addresses_fields.rb index abc1234..def5678 100644 --- a/spec/support/features/fill_addresses_fields.rb +++ b/spec/support/features/fill_addresses_fields.rb @@ -8,7 +8,7 @@ zipcode phone ] - fields += if Spree::Config.has_preference?(:use_combined_first_and_last_name_in_address) && Spree::Config.use_combined_first_and_last_name_in_address + fields += if SolidusSupport.combined_first_and_last_name_in_address? %w[name] else %w[firstname lastname]
Check for combined first and last name We need to use the SolidusSupport method for checking for the combined first and last name since Solidus 3 has removed the deprecated methods from the config.
diff --git a/update_commands.rb b/update_commands.rb index abc1234..def5678 100644 --- a/update_commands.rb +++ b/update_commands.rb @@ -0,0 +1,36 @@+#!/usr/bin/env ruby + +# Use this script to update the commands auto-completed in plugin/packer.vim. + +require 'open3' + +command_re = /^\s\s\s\s(\w+)/ +plugin_file = 'plugin/packer.vim' + +# Create the list of commands. +stdout, stderr, _status = Open3.capture3('packer list-commands') +output = if stderr == '' + stdout.split("\n") + else + stderr.split("\n") + end +commands = output.collect do |l| + match = command_re.match(l) + " \\ \"#{match[1]}\"" if match +end.reject(&:nil?).join(",\n") + +# Read in the existing plugin file. +plugin = File.open(plugin_file, 'r').readlines + +# Replace the terraResourceTypeBI lines with our new list. +first = plugin.index { |l| /^ return join\(\[/.match(l) } + 1 +last = plugin.index { |l| /^ \\ \], "\\n"\)/.match(l) } +plugin.slice!(first, last - first) +commands.split("\n").reverse_each do |r| + plugin.insert(first, r) +end + +# Write the plugin file back out. +File.open(plugin_file, 'w') do |f| + f.puts plugin +end
Add script to update auto-completed commands
diff --git a/YouboraLib.podspec b/YouboraLib.podspec index abc1234..def5678 100644 --- a/YouboraLib.podspec +++ b/YouboraLib.podspec @@ -19,7 +19,7 @@ s.author = { "Nice People at Work" => "support@nicepeopleatwork.com" } # Platforms - s.ios.deployment_target = "8.0" + s.ios.deployment_target = "9.0" s.tvos.deployment_target = "9.0" # Source Location
Upgrade podspec to iOS 9.0 to avoid missing methods
diff --git a/features/step_definitions/crudecumber_steps.rb b/features/step_definitions/crudecumber_steps.rb index abc1234..def5678 100644 --- a/features/step_definitions/crudecumber_steps.rb +++ b/features/step_definitions/crudecumber_steps.rb @@ -1,5 +1,9 @@ Then(/^.*$/) do Cucumber.trap_interrupt key = capture_key - fail unless pass?(key) + unless pass?(key) + print "\nDescribe the problem:\n" + puts "Notes: " + STDIN.gets.chomp + fail + end end
Add prompt to capture tester report when failing
diff --git a/jeet-rails.gemspec b/jeet-rails.gemspec index abc1234..def5678 100644 --- a/jeet-rails.gemspec +++ b/jeet-rails.gemspec @@ -6,8 +6,8 @@ Gem::Specification.new do |spec| spec.name = 'jeet-rails' spec.version = Jeet::Rails::VERSION - spec.authors = ['Cory Simmons'] - spec.email = ['csimmonswork@gmail.com'] + spec.authors = ['Cory Simmons', 'Jonah Ruiz'] + spec.email = ['csimmonswork@gmail.com', 'jonah@pixelhipsters.com'] spec.summary = 'A grid system for humans.' spec.description = 'The most advanced and intuitive Sass grid system on the planet.' spec.homepage = 'http://jeet.gs'
Add author, email to gemspec
diff --git a/Casks/adium-beta.rb b/Casks/adium-beta.rb index abc1234..def5678 100644 --- a/Casks/adium-beta.rb +++ b/Casks/adium-beta.rb @@ -3,8 +3,15 @@ sha256 'e7690718f14defa3bc08cd3949a4eab52e942abd47f7ac2ce7157ed7295658c6' url "https://adiumx.cachefly.net/Adium_#{version}.dmg" + name 'Adium' homepage 'https://beta.adium.im/' - license :oss + license :gpl app 'Adium.app' + + zap :delete => [ + '~/Library/Caches/Adium', + '~/Library/Caches/com.adiumX.adiumX', + '~/Library/Preferences/com.adiumX.adiumX.plist', + ] end
Add missing stanzas to Adium Beta
diff --git a/lib/aequitas/rule/confirmation.rb b/lib/aequitas/rule/confirmation.rb index abc1234..def5678 100644 --- a/lib/aequitas/rule/confirmation.rb +++ b/lib/aequitas/rule/confirmation.rb @@ -6,15 +6,15 @@ class Rule class Confirmation < Rule - equalize_on superclass.equalizer.keys + [:confirmation_attribute] + equalize_on superclass.equalizer.keys + [:confirmation_attribute_name] - attr_reader :confirmation_attribute + attr_reader :confirmation_attribute_name def initialize(attribute_name, options = {}) super - @confirm_attribute_name = options.fetch(:confirm) do + @confirmation_attribute_name = options.fetch(:confirm) do :"#{attribute_name}_confirmation" end @@ -29,7 +29,7 @@ end def confirmation_value(resource) - resource.instance_variable_get("@#{@confirm_attribute_name}") + resource.instance_variable_get("@#{@confirmation_attribute_name}") end def violation_type(resource)
Fix inconsistent instance variable name in Rule::Confirmation. Settled on @confirmation_attribute_name.
diff --git a/guard-minitest.gemspec b/guard-minitest.gemspec index abc1234..def5678 100644 --- a/guard-minitest.gemspec +++ b/guard-minitest.gemspec @@ -1,5 +1,6 @@ # encoding: utf-8 -Kernel.load File.expand_path('../lib/guard/minitest/version.rb', __FILE__) +$:.push File.expand_path('../lib', __FILE__) +require 'guard/minitest/version' Gem::Specification.new do |s| s.name = 'guard-minitest'
Fix already defined VERSION error
diff --git a/lib/backports/2.6.0/hash/merge.rb b/lib/backports/2.6.0/hash/merge.rb index abc1234..def5678 100644 --- a/lib/backports/2.6.0/hash/merge.rb +++ b/lib/backports/2.6.0/hash/merge.rb @@ -3,8 +3,8 @@ class Hash unless instance_method(:merge).arity < 0 def merge_with_backports(first = {}, *others, &block) - merge_without_backports(first, &block) - .merge!(*others, &block) + merge_without_backports(first, &block). + merge!(*others, &block) end Backports.alias_method_chain self, :merge, :backports end
Fix backport for Ruby 1.8.7
diff --git a/lib/gracefully/circuit_breaker.rb b/lib/gracefully/circuit_breaker.rb index abc1234..def5678 100644 --- a/lib/gracefully/circuit_breaker.rb +++ b/lib/gracefully/circuit_breaker.rb @@ -10,6 +10,7 @@ end @closed = true + @health = options && options[:health] || Gracefully::ConsecutiveFailuresBasedHealth.new(become_unhealthy_after_consecutive_failures: 0) end def execute(&block) @@ -30,11 +31,15 @@ end def mark_success - close! + @health.mark_success + + update! end def mark_failure - open! + @health.mark_failure + + update! end def open? @@ -51,6 +56,14 @@ def opened_date @opened_date + end + + def update! + if @health.healthy? + close! + else + open! + end end def close!
Make CircuitBreaker rely on ConsecutiveFailuresBasedHealth by default
diff --git a/gir_ffi-tracker.gemspec b/gir_ffi-tracker.gemspec index abc1234..def5678 100644 --- a/gir_ffi-tracker.gemspec +++ b/gir_ffi-tracker.gemspec @@ -5,6 +5,9 @@ s.version = "0.3.0" s.summary = "GirFFI-based binding to Tracker" + s.description = "Bindings for Tracker generated by GirFFI, with overrides." + + s.license = 'LGPL-2.1' s.authors = ["Matijs van Zuijlen"] s.email = ["matijs@matijs.net"]
Add description and license fields to gemspec
diff --git a/lib/spice.rb b/lib/spice.rb index abc1234..def5678 100644 --- a/lib/spice.rb +++ b/lib/spice.rb @@ -1,4 +1,5 @@ require 'open-uri' +require 'yaml' class Spice
Fix test failure do to missing YAML constant
diff --git a/SNSServices.podspec b/SNSServices.podspec index abc1234..def5678 100644 --- a/SNSServices.podspec +++ b/SNSServices.podspec @@ -8,7 +8,7 @@ spec.source = { :git => 'ihttps://github.com/Joohae/SNSServices.git', :tag => '#{s.version}' } - spec.source_files = 'SNSServices/*.{h,m}' + spec.source_files = 'SNSServices/**/*.{h,m}' spec.resources = 'SNSSErvices/*.xib' spec.framework = 'SystemConfiguration'
Change pod spec to include sub-folders
diff --git a/equalizer.gemspec b/equalizer.gemspec index abc1234..def5678 100644 --- a/equalizer.gemspec +++ b/equalizer.gemspec @@ -16,5 +16,5 @@ gem.test_files = `git ls-files -- {spec}/*`.split("\n") gem.extra_rdoc_files = %w[LICENSE README.md TODO] - gem.add_dependency 'ice_nine', '~> 0.4.0' + gem.add_dependency 'ice_nine', '~> 0.5.0' end
Bump ice_nine dep to ~> 0.5.0
diff --git a/lib/ridgepole_rake/ext/bundler.rb b/lib/ridgepole_rake/ext/bundler.rb index abc1234..def5678 100644 --- a/lib/ridgepole_rake/ext/bundler.rb +++ b/lib/ridgepole_rake/ext/bundler.rb @@ -18,7 +18,8 @@ if config.bundler[:use] && config.bundler[:clean_system] ::Bundler.clean_system(command) else - super + # TODO: Raise stack level too deep when call `super` + Kernel.system(command) end end
Fix stack level too deep
diff --git a/config/initializers/pagy.rb b/config/initializers/pagy.rb index abc1234..def5678 100644 --- a/config/initializers/pagy.rb +++ b/config/initializers/pagy.rb @@ -2,14 +2,14 @@ # Pagy Variables # See https://ddnexus.github.io/pagy/api/pagy#variables -Pagy::VARS[:items] = 100 +Pagy::DEFAULT[:items] = 100 # Items extra: Allow the client to request a custom number of items per page with an optional selector UI # See https://ddnexus.github.io/pagy/extras/items require 'pagy/extras/items' -Pagy::VARS[:items_param] = :per_page -Pagy::VARS[:max_items] = 100 +Pagy::DEFAULT[:items_param] = :per_page +Pagy::DEFAULT[:max_items] = 100 # For handling requests for non-existant pages eg: page 35 when there are only 4 pages of results require 'pagy/extras/overflow' -Pagy::VARS[:overflow] = :empty_page +Pagy::DEFAULT[:overflow] = :empty_page
Update Pagy config for version 5 Some variables were renamed.
diff --git a/config/initializers/sass.rb b/config/initializers/sass.rb index abc1234..def5678 100644 --- a/config/initializers/sass.rb +++ b/config/initializers/sass.rb @@ -3,7 +3,7 @@ module Sass::Script::Functions def settings_style(setting) assert_type setting, :String - return_value = ActiveRecord::Base.connection.table_exists?('settings') ? Setting["#{ setting.value }"].to_s : Constant["#{ setting.value }"].to_s + return_value = ActiveRecord::Base.connection.table_exists?('settings') ? Setting["#{ setting.value }"].to_s : Constant["#{ setting.value }"] Sass::Script::Parser.parse(return_value, 0, 0) end declare :settings_style, args: [:setting]
Fix default setting for styles
diff --git a/test/everypolitician/popolo/person_real_methods_test.rb b/test/everypolitician/popolo/person_real_methods_test.rb index abc1234..def5678 100644 --- a/test/everypolitician/popolo/person_real_methods_test.rb +++ b/test/everypolitician/popolo/person_real_methods_test.rb @@ -0,0 +1,59 @@+require 'test_helper' + +class PersonTest < Minitest::Test + def persons + @persons ||= Everypolitician::Popolo.read('test/fixtures/estonia-ep-popolo-v1.0.json').persons + end + + def person_one + persons.first + end + + def person_two + persons.select { |p| p.id == '32f14e80-cf5b-407c-a6a6-95fbd7f2851c' }.first + end + + def test_person_has_contact_details + contact = [{ type: 'email', value: 'Aadu.Must@riigikogu.ee' }, { type: 'phone', value: '6316629' }] + assert_equal person_one.contact_details, contact + end + + def test_person_has_family_name + family_name = 'Nestor' + assert_equal person_two.family_name, family_name + end + + def test_person_has_given_name + given_name = 'Eiki' + assert_equal person_two.given_name, given_name + end + + def test_person_has_identifiers + identifier = { identifier: '3659', scheme: 'pace' } + assert_equal person_two.identifiers.count, 6 + assert_includes person_two.identifiers, identifier + end + + def test_person_has_images + image = { url: 'https://upload.wikimedia.org/wikipedia/commons/1/15/SDE_Eiki_Nestor.jpg' } + assert_equal person_two.images.count, 2 + assert_includes person_two.images, image + end + + def test_person_has_links + link = { note: 'facebook', url: 'https://facebook.com/100000658185044' } + assert_equal person_two.links.count, 9 + assert_includes person_two.links, link + end + + def test_person_has_other_names + other_name = { lang: 'et', name: 'Eiki Nestor', note: 'multilingual' } + assert_equal person_two.other_names.count, 24 + assert_includes person_two.other_names, other_name + end + + def test_person_has_sources + source = [{ url: 'http://www.riigikogu.ee/riigikogu/koosseis/riigikogu-liikmed/saadik/233ac42e-573c-400e-8568-0ac3d4c107f9/Aadu-Must' }] + assert_equal person_one.sources, source + end +end
Test Person class against real data Tests Person against Estonia data
diff --git a/config/initializers/api.rb b/config/initializers/api.rb index abc1234..def5678 100644 --- a/config/initializers/api.rb +++ b/config/initializers/api.rb @@ -1,13 +1,13 @@ # frozen_string_literal: true Rails.application.configure do - config.x.core_api_sign_alg = ENV['CORE_API_SIGN_ALG'] if ENV['CORE_API_SIGN_ALG'] + config.x.core_api_sign_alg = ENV['CORE_API_SIGN_ALG'] || 'HS256' - config.x.core_api_token_ttl = ENV['CORE_API_TOKEN_TTL'].to_i.seconds if ENV['CORE_API_TOKEN_TTL'] + config.x.core_api_token_ttl = ENV['CORE_API_TOKEN_TTL'] ? ENV['CORE_API_TOKEN_TTL'].to_i.seconds : 30.minutes - config.x.core_api_token_iss = ENV['CORE_API_TOKEN_ISS'] if ENV['CORE_API_TOKEN_ISS'] + config.x.core_api_token_iss = ENV['CORE_API_TOKEN_ISS'] || 'SciNote' config.x.core_api_rate_limit = ENV['CORE_API_RATE_LIMIT'] ? ENV['CORE_API_RATE_LIMIT'].to_i : 1000 - config.x.core_api_v1_enabled = true if ENV['CORE_API_V1_ENABLED'] + config.x.core_api_v1_enabled = ENV['CORE_API_V1_ENABLED'] || false end
Add default values to core API configuration [SCI-4098]
diff --git a/spec/integration/auth_spec.rb b/spec/integration/auth_spec.rb index abc1234..def5678 100644 --- a/spec/integration/auth_spec.rb +++ b/spec/integration/auth_spec.rb @@ -11,7 +11,7 @@ fill_in 'Password', :with => pass fill_in 'Password confirmation', :with => pass - click_button 'Sign up' + click_button 'Register' expect(page).to have_content 'You have signed up successfully' end
Test for button being called Register
diff --git a/continuent-tools-monitoring.gemspec b/continuent-tools-monitoring.gemspec index abc1234..def5678 100644 --- a/continuent-tools-monitoring.gemspec +++ b/continuent-tools-monitoring.gemspec @@ -17,7 +17,7 @@ Gem::Specification.new do |s| s.name = 'continuent-tools-monitoring' - s.version = '0.5.0' + s.version = '0.7.0' s.date = Date.today.to_s s.summary = "Continuent Tungsten tools core monitoring tools" s.authors = ["Continuent"] @@ -29,5 +29,5 @@ s.homepage = 'https://github.com/continuent/continuent-tools-monitoring' s.license = 'Apache-2.0' - s.add_runtime_dependency 'continuent-tools-core', '>= 0.5.0' + s.add_runtime_dependency 'continuent-tools-core', '>= 0.7.0' end
Increase the gem dependency and version to 0.7.0
diff --git a/app/models/user.rb b/app/models/user.rb index abc1234..def5678 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -30,7 +30,7 @@ end def github - Octokit::Client.new(:login => username, :oauth_token => github_access_token) + Octokit::Client.new(:login => username, :oauth_token => github_access_token, :auto_traversal => true) end def permissions(repo_name)
Enable auto traversal for full results list
diff --git a/lib/bonz/mat_general_mixin.rb b/lib/bonz/mat_general_mixin.rb index abc1234..def5678 100644 --- a/lib/bonz/mat_general_mixin.rb +++ b/lib/bonz/mat_general_mixin.rb @@ -38,7 +38,9 @@ when 1 then self.GRAY2BGR when 3 then self when 4 then self.BGRA2BGR - else raise ArgumentError # ambiguous what to do here + else + # ambiguous what the caller actually wants here + raise ArgumentError.new("ambiguous conversion of #{ channel } channels to BGR") end end
Clean up gross debug logic
diff --git a/lib/bunny/heartbeat_sender.rb b/lib/bunny/heartbeat_sender.rb index abc1234..def5678 100644 --- a/lib/bunny/heartbeat_sender.rb +++ b/lib/bunny/heartbeat_sender.rb @@ -50,6 +50,7 @@ stop rescue Exception => e puts e.message + stop end end
Stop heartbeat sender on any exception it encounters
diff --git a/lib/tasks/export_content_by_organisations.rake b/lib/tasks/export_content_by_organisations.rake index abc1234..def5678 100644 --- a/lib/tasks/export_content_by_organisations.rake +++ b/lib/tasks/export_content_by_organisations.rake @@ -0,0 +1,53 @@+namespace :govuk do + # bundle exec rake govuk:export_content_by_organisations[uk-border-agency,border-force] + desc "Export content by organisations as CSV" + task export_content_by_organisations: [:environment] do |_, args| + website_root = Plek.new.website_root + + fields = %w[ + link + title + description + content_store_document_type + primary_publishing_organisation + organisations + public_timestamp + ] + + args.extras.each do |organisation_slug| + puts organisation_slug + + content_items_enum = Services.rummager.search_enum( + fields: fields.join(','), + filter_primary_publishing_organisation: organisation_slug + ) + + print "- saving items to CSV" + + filename = "#{organisation_slug}.csv" + CSV.open(filename, "wb", headers: fields, write_headers: true) do |csv| + content_items_enum.each do |content_item| + content_item["link"] = begin + # Add gov.uk to the base path + "#{website_root}#{content_item['link']}" + end + + content_item["primary_publishing_organisation"] = begin + # There should only be one primary publishing organisation + content_item["primary_publishing_organisation"].first + end + + content_item["organisations"] = begin + # Only keep the slug for organisations + content_item["organisations"].map { |org| org['slug'] }.join(',') + end + + csv << content_item.slice(*fields) + print '.' + end + end + + puts "\n- saved to #{File.expand_path(filename)}" + end + end +end
Add rake task to generate CSV(s) for tagathons We've repurposed the rake task that was introduced for the transport tagathon. For a given list of organisations, we extract all of the content that the organisation is the primary publisher and save it to a CSV named after the orgniasation.
diff --git a/lib/spree.rb b/lib/spree.rb index abc1234..def5678 100644 --- a/lib/spree.rb +++ b/lib/spree.rb @@ -8,12 +8,14 @@ module Spree module Version Major = '0' - Minor = '9' - Tiny = '99' + Minor = '10' + Tiny = '0' + Pre = nil # 'beta' class << self def to_s - [Major, Minor, Tiny].join('.') + v = "#{Major}.#{Minor}.#{Tiny}" + Pre ? "#{v}.#{Pre}" : v end alias :to_str :to_s end
Allow for pre-release gem versions.
diff --git a/lib/sugar.rb b/lib/sugar.rb index abc1234..def5678 100644 --- a/lib/sugar.rb +++ b/lib/sugar.rb @@ -20,6 +20,7 @@ def redis_url=(new_url) @redis = nil + @config = nil @redis_url = new_url end
Reset config when Redis URL changes
diff --git a/lib/gaku/config.rb b/lib/gaku/config.rb index abc1234..def5678 100644 --- a/lib/gaku/config.rb +++ b/lib/gaku/config.rb @@ -4,14 +4,6 @@ class Config attr_accessor :deck_root, :initial_distance attr_writer :monochrome, :utf8 - - def monochrome? - !!@monochrome - end - - def utf8? - !!@utf8 - end CONFIG_FILE = File.expand_path("#{Dir.home}/.gaku") @@ -33,6 +25,14 @@ @utf8 = true end + def monochrome? + !!@monochrome + end + + def utf8? + !!@utf8 + end + def gaku @instance ||= self end
Order methods of Gaku::Config better
diff --git a/lib/gogo_driver.rb b/lib/gogo_driver.rb index abc1234..def5678 100644 --- a/lib/gogo_driver.rb +++ b/lib/gogo_driver.rb @@ -3,11 +3,12 @@ class GogoDriver attr_accessor :driver - def initialize - @driver = Selenium::WebDriver.for(:chrome) + def initialize(browser=:chrome) + @driver = Selenium::WebDriver.for(browser) end def go(url) + logging "[VISITE] #{url}..." @driver.navigate.to(url) end @@ -16,6 +17,7 @@ end def find(selector) + logging "[FIND] #{selector}..." @driver.find_element(css: selector) end @@ -36,21 +38,29 @@ end def click(selector) + logging "[CLICK] #{selector}..." has?(selector) ? find(selector).click : false end def submit + logging "[SUBMIT] ..." $focus.submit if $focus end def method_missing(method, *args, &block) @driver.respond_to?(method) ? @driver.send(method, *args, &block) : super end + + private + def logging(text) + puts text + end end class Selenium::WebDriver::Element def fill(text) $focus = self + "[FILL] #{selector}..." send_key(text) end @@ -61,4 +71,9 @@ def finds(selector) find_elements(css: selector) end + + private + def logging(text) + puts text + end end
Add logging and chnageable browser
diff --git a/command_line/rubylib_spec.rb b/command_line/rubylib_spec.rb index abc1234..def5678 100644 --- a/command_line/rubylib_spec.rb +++ b/command_line/rubylib_spec.rb @@ -0,0 +1,68 @@+require_relative '../spec_helper' + +describe "The RUBYLIB environment variable" do + before (:each) do + @rubylib, ENV["RUBYLIB"] = ENV["RUBYLIB"], nil + end + + after (:each) do + ENV["RUBYLIB"] = @rubylib + end + + it "adds a directory to $LOAD_PATH" do + dir = tmp("rubylib/incl") + ENV["RUBYLIB"] = dir + paths = ruby_exe("puts $LOAD_PATH").lines.map(&:chomp) + paths.should include(dir) + end + + it "adds a colon-separated list of directories to $LOAD_PATH" do + dir1, dir2 = tmp("rubylib/incl1"), tmp("rubylib/incl2") + ENV["RUBYLIB"] = "#{dir1}:#{dir2}" + paths = ruby_exe("puts $LOAD_PATH").lines.map(&:chomp) + paths.should include(dir1) + paths.should include(dir2) + paths.index(dir1).should < paths.index(dir2) + end + + it "adds the directory at the front of $LOAD_PATH" do + dir = tmp("rubylib/incl_front") + ENV["RUBYLIB"] = dir + paths = ruby_exe("puts $LOAD_PATH").lines.map(&:chomp) + if PlatformGuard.implementation? :ruby + # In a MRI checkout, $PWD ends up as the first entry in $LOAD_PATH. + # So just assert that it's at the beginning. + idx = paths.index(dir) + idx.should < 2 + idx.should < paths.size-1 + else + paths[0].should == dir + end + end + + it "adds the directory after directories added by -I" do + dash_i_dir = tmp("dash_I_include") + rubylib_dir = tmp("rubylib_include") + ENV["RUBYLIB"] = rubylib_dir + paths = ruby_exe("puts $LOAD_PATH", options: "-I #{dash_i_dir}").lines.map(&:chomp) + paths.should include(dash_i_dir) + paths.should include(rubylib_dir) + paths.index(dash_i_dir).should < paths.index(rubylib_dir) + end + + it "adds the directory after directories added by -I within RUBYOPT" do + rubyopt_dir = tmp("rubyopt_include") + rubylib_dir = tmp("rubylib_include") + ENV["RUBYLIB"] = rubylib_dir + paths = ruby_exe("puts $LOAD_PATH", env: { "RUBYOPT" => "-I#{rubyopt_dir}" }).lines.map(&:chomp) + paths.should include(rubyopt_dir) + paths.should include(rubylib_dir) + paths.index(rubyopt_dir).should < paths.index(rubylib_dir) + end + + it "keeps spaces in the value" do + ENV["RUBYLIB"] = " rubylib/incl " + out = ruby_exe("puts $LOAD_PATH") + out.should include(" rubylib/incl ") + end +end
Add specs for the RUBYLIB environment variable
diff --git a/app/reader.rb b/app/reader.rb index abc1234..def5678 100644 --- a/app/reader.rb +++ b/app/reader.rb @@ -37,7 +37,11 @@ article_widget = Widget::Article.new(article) comments = Widget::Comments.new(ENV["RACK_ENV"]) - render_page :articles_show, :article => article_widget, :comments => comments + render_page :articles_show, { + :article => article_widget, + :comments => comments, + :opts => { :active_category => article.category_id } + } else raise Sinatra::NotFound end
Make category active for article view
diff --git a/config/deploy/new_staging.rb b/config/deploy/new_staging.rb index abc1234..def5678 100644 --- a/config/deploy/new_staging.rb +++ b/config/deploy/new_staging.rb @@ -2,4 +2,5 @@ set :rvm_ruby_version, '2.2.0@ridepilot' set :deploy_to, '/home/deploy/rails/ridepilot' set :rails_env, 'staging' +set :default_env, { "RAILS_RELATIVE_URL_ROOT" => "/ridepilot" } server 'apps2.rideconnection.org', roles: [:app, :web, :db], user: 'deploy'
Make sure Capistrano knows about RAILS_RELATIVE_URL_ROOT when it compiles assets
diff --git a/config/initializers/islay.rb b/config/initializers/islay.rb index abc1234..def5678 100644 --- a/config/initializers/islay.rb +++ b/config/initializers/islay.rb @@ -2,6 +2,6 @@ e.namespace :islay_shop # Navigation - e.nav_entry('Products', :catalogue) - e.nav_entry('Orders', :orders) + e.nav_entry('Products', :catalogue, :class => 'icon-archive') + e.nav_entry('Orders', :orders, :class => 'icon-basket') end
Apply icons to the main nav entries.
diff --git a/spec/gemfile_version_match_spec.rb b/spec/gemfile_version_match_spec.rb index abc1234..def5678 100644 --- a/spec/gemfile_version_match_spec.rb +++ b/spec/gemfile_version_match_spec.rb @@ -1,10 +1,5 @@ # frozen_string_literal: true RSpec.describe "Gemfile Version Match" do - it "rails_4.0.gemfile.lock" do - file = File.join(File.expand_path("../../", __FILE__), "test_rails_4_app/gemfiles/rails_4.0.gemfile.lock") - expect(!File.readlines(file).grep(/active_mocker \(#{Regexp.quote(ActiveMocker::VERSION)}\)/).empty?).to eq true - end - it "rails_4.1.gemfile.lock" do file = File.join(File.expand_path("../../", __FILE__), "test_rails_4_app/gemfiles/rails_4.1.gemfile.lock") expect(!File.readlines(file).grep(/active_mocker \(#{Regexp.quote(ActiveMocker::VERSION)}\)/).empty?).to eq true @@ -14,4 +9,9 @@ file = File.join(File.expand_path("../../", __FILE__), "test_rails_4_app/gemfiles/rails_4.2.gemfile.lock") expect(!File.readlines(file).grep(/active_mocker \(#{Regexp.quote(ActiveMocker::VERSION)}\)/).empty?).to eq true end + + it "rails_5.0.gemfile.lock" do + file = File.join(File.expand_path("../../", __FILE__), "test_rails_4_app/gemfiles/rails_5.0.gemfile.lock") + expect(!File.readlines(file).grep(/active_mocker \(#{Regexp.quote(ActiveMocker::VERSION)}\)/).empty?).to eq true + end end
Update ActiveMocker Gem Version check
diff --git a/app/models/test.rb b/app/models/test.rb index abc1234..def5678 100644 --- a/app/models/test.rb +++ b/app/models/test.rb @@ -16,6 +16,11 @@ where(key: key, baseline: true).first end + def as_json(options) + run = super(options) + run[:url] = self.url + return run + end def pass? pass
Add URL to model's JSON output
diff --git a/app/helpers/sync_helper.rb b/app/helpers/sync_helper.rb index abc1234..def5678 100644 --- a/app/helpers/sync_helper.rb +++ b/app/helpers/sync_helper.rb @@ -2,7 +2,7 @@ def sync_user(user) unless user.is_syncing? if Travis::Features.enabled_for_all?(:sync_via_sidekiq) - Travis::Sidekiq::SynchronizeUser.perform_async(user_id: user.id) + Travis::Sidekiq::SynchronizeUser.perform_async(user.id) else publisher = Travis::Amqp::Publisher.new('sync.user') publisher.publish({ user_id: user.id }, type: 'sync')
Use user_id only when triggering Sidekiq.
diff --git a/app/mailers/post_mailer.rb b/app/mailers/post_mailer.rb index abc1234..def5678 100644 --- a/app/mailers/post_mailer.rb +++ b/app/mailers/post_mailer.rb @@ -1,4 +1,4 @@-class GameMailer < ActionMailer::Base +class PostMailer < ActionMailer::Base default from: "uro@fantasygame.pl" def notify_user(user, post)
Fix post mailer class name [#89850862]
diff --git a/beans.gemspec b/beans.gemspec index abc1234..def5678 100644 --- a/beans.gemspec +++ b/beans.gemspec @@ -19,4 +19,5 @@ spec.add_development_dependency 'bundler', '~> 1.6' spec.add_development_dependency 'rake' spec.add_development_dependency 'rspec' + spec.add_development_dependency 'pry' end
Add pry, because it's awesome
diff --git a/lib/cc/analyzer/filesystem.rb b/lib/cc/analyzer/filesystem.rb index abc1234..def5678 100644 --- a/lib/cc/analyzer/filesystem.rb +++ b/lib/cc/analyzer/filesystem.rb @@ -39,7 +39,9 @@ def file_paths @file_paths ||= Dir.chdir(@root) do - `find . -type f`.strip.split("\n") + `find . -type f -print0`.strip.split("\0").map do |path| + path.sub(/^\.//, "") + end end end
Split on null chars not newline
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index abc1234..def5678 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -17,7 +17,7 @@ end if !url.start_with?('www.') - url.prepend!('www.') + url.prepend('www.') end if url.end_with?('/')
Fix incorrect call to prepend
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index abc1234..def5678 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -20,6 +20,7 @@ end def gallery_referer?(picture) + return false unless request.referer URI(request.referer).path == url_for(picture.gallery) end
Fix exception in gallery_referer? helper, if referer nil.
diff --git a/week-4/variables-methods.rb b/week-4/variables-methods.rb index abc1234..def5678 100644 --- a/week-4/variables-methods.rb +++ b/week-4/variables-methods.rb @@ -13,4 +13,27 @@ puts 'What\'s your favorite number?' favorite_num = gets.chomp.to_i + 1 -puts 'That\'s nice, but don\'t you think #{favorite_num} would be better? It is bigger you know.'+puts 'That\'s nice, but don\'t you think #{favorite_num} would be better? It is bigger you know.' + +# How do you define a local variable? +# You declare the variable name, type an equal sign, and then enter the variable (e.g. local_var = "the variable"). + +# How do you define a method? +# To define a method you type "def," then add a space, and then define the name of the method. If the method has arguements you would include them after the name. The arguements can be inside parentheses, but they don't have to be as long as there is a space after the name (e.g. def method(arguement1, arguement2)). + +# What is the difference between a local variable and a method? +# A local variable stores information for later use by calling the name of the variable. A method is code that performs an action. + +# How do you run a ruby program from the command line? +# To run a ruby program from the command line you simply type "ruby name_of_program.rb" + +# How do you run an RSpec file from the command line? +# To run an RSpec file from the command line type "rspec name_of_file.rb" + +# What was confusing about this material? What made sense? +# While I definitely had to do some refactoring, I think I ultimately grasped the material in the module. + +# Exercise Solution File Links +# https://github.com/milfred/phase-0/blob/master/week-4/define-method/my_solution.rb +# https://github.com/milfred/phase-0/blob/master/week-4/address/my_solution.rb +# https://github.com/milfred/phase-0/blob/master/week-4/math/my_solution.rb
Update variable-methods.rb file to include my refleciton and links to exercise solution files
diff --git a/db/migrate/20180502160657_make_can_play_concurrently_default_false.rb b/db/migrate/20180502160657_make_can_play_concurrently_default_false.rb index abc1234..def5678 100644 --- a/db/migrate/20180502160657_make_can_play_concurrently_default_false.rb +++ b/db/migrate/20180502160657_make_can_play_concurrently_default_false.rb @@ -1,5 +1,6 @@ class MakeCanPlayConcurrentlyDefaultFalse < ActiveRecord::Migration[5.2] def up + Event.where(can_play_concurrently: nil).update_all(can_play_concurrently: false) change_column :events, :can_play_concurrently, :boolean, null: false, default: false end
Fix bad data during migration
diff --git a/lib/sendvia/resources/base.rb b/lib/sendvia/resources/base.rb index abc1234..def5678 100644 --- a/lib/sendvia/resources/base.rb +++ b/lib/sendvia/resources/base.rb @@ -1,6 +1,7 @@ module Sendvia class Base < ActiveResource::Base self.include_format_in_path = false + self.include_root_in_json = false self.primary_key = :Id REST_API_ENDPOINT = 'https://www.sendvia.co.uk/rest/alpha5/' @@ -18,7 +19,6 @@ self.new(attributes).tap do |resource| old_prefix_options = resource.prefix_options.dup resource.prefix_options = resource.prefix_options.merge(params) - puts resource.prefix_options.inspect resource.save resource.prefix_options = old_prefix_options end
Remove debug and set class variable include_root_in_json
diff --git a/lib/spring/watcher/polling.rb b/lib/spring/watcher/polling.rb index abc1234..def5678 100644 --- a/lib/spring/watcher/polling.rb +++ b/lib/spring/watcher/polling.rb @@ -1,3 +1,5 @@+require "spring/watcher/abstract" + module Spring module Watcher class Polling < Abstract
Add 'require "spring/watcher/abstract"' to fix isolated unit test.
diff --git a/lib/swa/cli/item_behaviour.rb b/lib/swa/cli/item_behaviour.rb index abc1234..def5678 100644 --- a/lib/swa/cli/item_behaviour.rb +++ b/lib/swa/cli/item_behaviour.rb @@ -4,8 +4,6 @@ module ItemBehaviour def self.included(target) - - target.default_subcommand = "summary" target.subcommand ["summary", "s"], "One-line summary" do def execute
Remove default command for individual items.
diff --git a/lib/tic_tac_toe/rack_shell.rb b/lib/tic_tac_toe/rack_shell.rb index abc1234..def5678 100644 --- a/lib/tic_tac_toe/rack_shell.rb +++ b/lib/tic_tac_toe/rack_shell.rb @@ -15,7 +15,7 @@ req = Rack::Request.new(env) if req.path =~ %r{^/$} - [200, {}, ["Hello, and welcome to Tic-Tac-Toe!"]] + [200, {}, [TicTacToe::View::Home.new.render]] elsif req.path =~ %r{^/new-game$} game = TicTacToe::Game.new_game(TicTacToe::Board.empty_board) [200, {}, [TicTacToe::View::Game.new(game).render]]
Use the home view on the index route
diff --git a/app/controllers/metal_decorator.rb b/app/controllers/metal_decorator.rb index abc1234..def5678 100644 --- a/app/controllers/metal_decorator.rb +++ b/app/controllers/metal_decorator.rb @@ -1,6 +1,6 @@ # For the API ActionController::Metal.class_eval do def spree_current_user - @spree_current_user ||= env['warden'].user + @spree_current_user ||= request.env['warden'].user end end
Fix `env` deprecated in Rails 5.0 I found it at the very bottom of the `test-consumer-features` CI build job. See: https://github.com/rails/rails/issues/23294.
diff --git a/form_object_model.gemspec b/form_object_model.gemspec index abc1234..def5678 100644 --- a/form_object_model.gemspec +++ b/form_object_model.gemspec @@ -6,7 +6,7 @@ gem.email = ["sean@seangeo.me"] gem.description = %q{An OO form testing helper that makes Capayaba-based form testing easy.} gem.summary = %q{An OO form testing helper that makes Capayaba-based form testing easy.} - gem.homepage = "" + gem.homepage = "https://github.com/reinteractive-open/form-object-model" gem.files = `git ls-files`.split($\) gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
Add link to github page.
diff --git a/lib/amazon-drs/base.rb b/lib/amazon-drs/base.rb index abc1234..def5678 100644 --- a/lib/amazon-drs/base.rb +++ b/lib/amazon-drs/base.rb @@ -34,6 +34,6 @@ def parse_body(body) # abstract end - private parse_body + private :parse_body end end
Fix forgotten ':' for symbol
diff --git a/lib/audited/sweeper.rb b/lib/audited/sweeper.rb index abc1234..def5678 100644 --- a/lib/audited/sweeper.rb +++ b/lib/audited/sweeper.rb @@ -1,15 +1,13 @@ require 'rails-observers' +require 'rails/observers/active_model' module Audited class Sweeper < ActiveModel::Observer observe Audited.audit_class - def before(controller) + def around(controller) self.controller = controller - true - end - - def after(controller) + yield self.controller = nil end
Remove deprecation warning of filter object
diff --git a/lib/capybara/server.rb b/lib/capybara/server.rb index abc1234..def5678 100644 --- a/lib/capybara/server.rb +++ b/lib/capybara/server.rb @@ -1,3 +1,4 @@+require 'uri' require 'net/http' require 'rack' require 'rack/handler/mongrel' @@ -18,6 +19,7 @@ end def url(path) + path = URI.parse(path).request_uri if path =~ /^http/ "http://#{host}:#{port}#{path}" end
Handle absolute URIs (happens with Rails)
diff --git a/lib/chef_zero/rspec.rb b/lib/chef_zero/rspec.rb index abc1234..def5678 100644 --- a/lib/chef_zero/rspec.rb +++ b/lib/chef_zero/rspec.rb @@ -0,0 +1,69 @@+require 'thin' +require 'tempfile' +require 'chef_zero/server' +require 'chef/config' + +module ChefZero + module RSpec + def when_the_chef_server(description, &block) + context "When the Chef server #{description}" do + before :each do + raise "Attempt to create multiple servers in one test" if @server + # Set up configuration so that clients will point to the server + Thin::Logging.silent = true + @chef_zero_server = ChefZero::Server.new(:port => 8889) + Chef::Config.chef_server_url = @chef_zero_server.url + Chef::Config.node_name = 'admin' + @chef_zero_client_key = Tempfile.new(['chef_zero_client_key', '.pem']) + @chef_zero_client_key.write(ChefZero::PRIVATE_KEY) + @chef_zero_client_key.close + Chef::Config.client_key = @chef_zero_client_key + + # Start the server + @chef_zero_server.start_background + end + + def self.client(name, client) + before(:each) { @chef_zero_server.load_data({ 'clients' => { name => client }}) } + end + + def self.cookbook(name, version, cookbook) + before(:each) { @chef_zero_server.load_data({ 'cookbooks' => { "#{name}-#{version}" => cookbook }}) } + end + + def self.data_bag(name, data_bag) + before(:each) { @chef_zero_server.load_data({ 'data' => { name => data_bag }}) } + end + + def self.environment(name, environment) + before(:each) { @chef_zero_server.load_data({ 'environments' => { name => environment }}) } + end + + def self.node(name, node) + before(:each) { @chef_zero_server.load_data({ 'nodes' => { name => node }}) } + end + + def self.role(name, role) + before(:each) { @chef_zero_server.load_data({ 'roles' => { name => role }}) } + end + + def self.user(name, user) + before(:each) { @chef_zero_server.load_data({ 'users' => { name => user }}) } + end + + after :each do + if @chef_zero_server + @chef_zero_server.stop + @chef_zero_server = nil + end + if @chef_zero_client_key + @chef_zero_client_key.unlink + @chef_zero_client_key = nil + end + end + + instance_eval(&block) + end + end + end +end
Add RSpec DSL for working with a ChefZero server
diff --git a/examples/multi/files.rb b/examples/multi/files.rb index abc1234..def5678 100644 --- a/examples/multi/files.rb +++ b/examples/multi/files.rb @@ -0,0 +1,16 @@+# encoding: utf-8 + +require 'tty-spinner' +require 'pastel' + +pastel = Pastel.new +spinners = TTY::Spinner::Multi.new("[:spinner] Downloading files...") + +['file1', 'file2', 'file3'].each do |file| + spinners.register("[:spinner] #{file}") do |sp| + sleep(rand * 5) + sp.success(pastel.green("success")) + end +end + +spinners.auto_spin
Add multi life downloading example
diff --git a/lib/rbac/authorizer.rb b/lib/rbac/authorizer.rb index abc1234..def5678 100644 --- a/lib/rbac/authorizer.rb +++ b/lib/rbac/authorizer.rb @@ -10,8 +10,17 @@ end - def role_allows(user:, feature:, any: nil) - auth = any.present? ? user.role_allows_any?(:identifiers => [feature]) : user.role_allows?(:identifier => feature) + def role_allows(options = {}) + # Known options: + user = options[:user] + feature = options[:feature] + any = options[:any] + + auth = if any.present? + user.role_allows_any?(:identifiers => [feature]) + else + user.role_allows?(:identifier => feature) + end _log.debug("Auth #{auth ? "successful" : "failed"} for user '#{user.userid}', role '#{user.miq_user_role.try(:name)}', feature identifier '#{feature}'") auth
Use legacy options hash signature Time to party like it's 2007! ...until we get this working :sob:
diff --git a/coremidi.rb b/coremidi.rb index abc1234..def5678 100644 --- a/coremidi.rb +++ b/coremidi.rb @@ -11,11 +11,11 @@ end class Packet - attr_accessor :note, :duration, :volume + attr_accessor :type, :note, :volume def initialize(api_packet) - self.note = api_packet.data[0] - self.duration = api_packet.data[1] + self.type = {146 => :on, 130 => :off}[api_packet.data[0]] + self.note = api_packet.data[1] self.volume = api_packet.data[2] end end
Fix up the packet transformation - type is probably still not 100% correct
diff --git a/lib/tmdb-api/person.rb b/lib/tmdb-api/person.rb index abc1234..def5678 100644 --- a/lib/tmdb-api/person.rb +++ b/lib/tmdb-api/person.rb @@ -8,13 +8,29 @@ attr_reader *ATTRIBUTES + # Public: Get the basic person information for a specific person ID. + # + # id - The ID of the person. + # options - The hash options used to filter the search (default: {}): + # More information about the options, check the api documentation + # + # Examples + # + # TMDb::Person.find(138) def self.find(id, options = {}) res = get("/person/#{id}", query: options) res.success? ? Person.new(res) : bad_response(res) end - def self.images(id, options = {}) - res = get("/person/#{id}/images", query: options) + # Public: Get the images for a specific person ID. + # + # id - The person's ID + # + # Examples + # + # TMDb::Person.images(138) + def self.images(id) + res = get("/person/#{id}/images") res.success? ? res : bad_response(res) end end
Add comments on find and images methods on Person.
diff --git a/lib/weather_jp/city.rb b/lib/weather_jp/city.rb index abc1234..def5678 100644 --- a/lib/weather_jp/city.rb +++ b/lib/weather_jp/city.rb @@ -1,5 +1,30 @@ module WeatherJp - class City < Struct.new(:name, :area_code) + class City + attr_reader :name + + def initialize(name, attrs = {}) + @name = name + @attrs = attrs + end + + def full_name + @attrs['weatherlocationname'] + end + + def code + @attrs['weatherlocationcode'] + end + alias_method :area_code, :code + alias_method :location_code, :code + + def lat + @attrs['lat'] + end + + def long + @attrs['long'] + end + alias_method :to_s, :name end end
Update Weatherjp::City for new xml
diff --git a/features/support/env.rb b/features/support/env.rb index abc1234..def5678 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -2,4 +2,5 @@ Before do @dirs = ["features/xml"] + @aruba_timeout_seconds = 30 end
Increase aruba timeout to allow for jRuby startup
diff --git a/Ressources/Private/Sass/functions.rb b/Ressources/Private/Sass/functions.rb index abc1234..def5678 100644 --- a/Ressources/Private/Sass/functions.rb +++ b/Ressources/Private/Sass/functions.rb @@ -1,13 +1,13 @@ # # Ruby functions -# -# @author 'Hopper' <http://stackoverflow.com/users/1026353/hopper> -# @link http://stackoverflow.com/questions/13022461/add-timestamps-to-compiled-sass-scss # # ============================================================================= # Timestamp function +# +# @author 'Hopper' <http://stackoverflow.com/users/1026353/hopper> +# @link http://stackoverflow.com/questions/13022461/add-timestamps-to-compiled-sass-scss # ============================================================================= module Sass::Script::Functions def timestamp()
[MISC] Move the credits for the timestamp function into its section-header comment
diff --git a/box-ios-browse-sdk.podspec b/box-ios-browse-sdk.podspec index abc1234..def5678 100644 --- a/box-ios-browse-sdk.podspec +++ b/box-ios-browse-sdk.podspec @@ -27,6 +27,7 @@ # Build settings s.requires_arc = true s.ios.header_dir = "BoxBrowseSDK" +s.module_name = "BoxBrowseSDK" s.dependency "box-ios-sdk" s.dependency 'MBProgressHUD', '~> 0.9.1'
Fix the framework naming issue preventing pod install in swift to find the source
diff --git a/cookbooks/mas/recipes/mas.rb b/cookbooks/mas/recipes/mas.rb index abc1234..def5678 100644 --- a/cookbooks/mas/recipes/mas.rb +++ b/cookbooks/mas/recipes/mas.rb @@ -1,4 +1,2 @@-mas 'Popclip' { app_id '445189367' } -mas 'Reeder' { app_id '880001334' } mas 'SafariMarkdownLinker' { app_id '1289119450' } mas 'bookmarker for pinboard' { app_id '1451400394' }
Delete apps that does not free
diff --git a/db/seeds.rb b/db/seeds.rb index abc1234..def5678 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -10,4 +10,9 @@ event = Event.create!(name: "White Christmas") snow = Outcome.create!(event: event, name: 'Snow at Christmas') no_snow = Outcome.create!(event: event, name: 'No snow at Christmas') -Holding.create!(user: user, outcome: snow, quantity: 10)+Holding.create!(user: user, outcome: snow, quantity: 10) + +event = Event.create! name: "Sunrise tomorrow" +shine = event.outcomes.create name: "The sun comes up and shines brightly." +cloudy = event.outcomes.create name: "The sun comes up but is obscured by clouds." +doom = event.outcomes.create name: "The sun does not come up."
Add multi-outcome event to seed data.
diff --git a/lib/circle/cli/model.rb b/lib/circle/cli/model.rb index abc1234..def5678 100644 --- a/lib/circle/cli/model.rb +++ b/lib/circle/cli/model.rb @@ -1,3 +1,5 @@+require 'time' + module Circle module CLI class Model
Make sure Time is loaded
diff --git a/lib/dateslices/mysql.rb b/lib/dateslices/mysql.rb index abc1234..def5678 100644 --- a/lib/dateslices/mysql.rb +++ b/lib/dateslices/mysql.rb @@ -24,7 +24,7 @@ when :year "DATE_FORMAT(#{column}, '%Y-01-01 00:00:00 UTC')" when :week # Sigh... - "DATE_FORMAT( date_sub( created_at, interval ((weekday( created_at ) + 1)%7) day ), '%Y-%m-%d 00:00:00 UTC')" + "DATE_FORMAT( date_sub( #{column}, interval ((weekday( #{column} ) + 1)%7) day ), '%Y-%m-%d 00:00:00 UTC')" else throw "Unknown time filter #{field}" end
Fix week for columns other than created_at
diff --git a/app/models/audit_certificate.rb b/app/models/audit_certificate.rb index abc1234..def5678 100644 --- a/app/models/audit_certificate.rb +++ b/app/models/audit_certificate.rb @@ -6,7 +6,7 @@ validates :attachment, presence: true, on: :create, file_size: { - maximum: 10.megabytes.to_i + maximum: 15.megabytes.to_i } validates :form_answer_id, uniqueness: true,
Increase upload file size for audit certificates
diff --git a/core/thread/critical_spec.rb b/core/thread/critical_spec.rb index abc1234..def5678 100644 --- a/core/thread/critical_spec.rb +++ b/core/thread/critical_spec.rb @@ -1,2 +1,22 @@ require File.dirname(__FILE__) + '/../../spec_helper' -require File.dirname(__FILE__) + '/fixtures/classes'+require File.dirname(__FILE__) + '/fixtures/classes' + +ruby_version_is '' ... '1.9' do + describe "Thread#critical" do + it "returns the current critical state" do + Thread.critical.should == false + end + end + + describe "Thread#critical=" do + it "sets the current critical state" do + Thread.critical.should == false + begin + Thread.critical = true + Thread.critical.should == true + ensure + Thread.critical = false + end + end + end +end
Add most basic critical= specs and guard for 1.9.
diff --git a/lib/emergency_banner.rb b/lib/emergency_banner.rb index abc1234..def5678 100644 --- a/lib/emergency_banner.rb +++ b/lib/emergency_banner.rb @@ -4,11 +4,7 @@ end def enabled? - content && has_campaign_class? - end - - def has_campaign_class? - content.has_key?(:campaign_class) && content.fetch(:campaign_class).present? + content && campaign_class end private @@ -17,4 +13,8 @@ @data ||= @redis.hgetall("emergency_banner") @data.symbolize_keys if @data end + + def campaign_class + content[:campaign_class] if content[:campaign_class].present? + end end
Hide the implementation of campaign_class Setting campaign class should be a private affair
diff --git a/app/models/album.rb b/app/models/album.rb index abc1234..def5678 100644 --- a/app/models/album.rb +++ b/app/models/album.rb @@ -4,7 +4,7 @@ before_create :generate_slug - scope :active, -> { where.not(cover_photo_id: nil) } + scope :active, -> { where.not(published_at: nil, cover_photo_id: nil) } scope :unpublished, -> { where(published_at: nil) } default_scope -> { order(created_at: :desc) }
Include published_at in active scope
diff --git a/tasks/spec.rake b/tasks/spec.rake index abc1234..def5678 100644 --- a/tasks/spec.rake +++ b/tasks/spec.rake @@ -17,7 +17,7 @@ t.spec_opts = ['--format', 'html:doc/spec/index.html', '--color'] # t.out = 'doc/spec/index.html' t.rcov = true - t.rcov_opts = ['--html', '--exclude', "#{ENV['HOME']}/.autotest,spec"] + t.rcov_opts = ['--html', '--exclude', "#{ENV['HOME']}/.autotest,spec,/usr/lib/ruby"] t.rcov_dir = 'doc/rcov' t.fail_on_error = true end
Exclude /usr/lib/ruby from RCov C0 code coverage report
diff --git a/qa/qa/vendor/github/page/login.rb b/qa/qa/vendor/github/page/login.rb index abc1234..def5678 100644 --- a/qa/qa/vendor/github/page/login.rb +++ b/qa/qa/vendor/github/page/login.rb @@ -12,9 +12,7 @@ fill_in 'password', with: QA::Runtime::Env.github_password click_on 'Sign in' - unless has_no_text?("Authorize GitLab-OAuth") - click_on 'Authorize gitlab-qa' if has_button?('Authorize gitlab-qa') - end + click_on 'Authorize gitlab-qa' if has_button?('Authorize gitlab-qa') end end end
Fix GitHub OAuth e2e spec
diff --git a/docs/examples/clean_acls.rb b/docs/examples/clean_acls.rb index abc1234..def5678 100644 --- a/docs/examples/clean_acls.rb +++ b/docs/examples/clean_acls.rb @@ -0,0 +1,35 @@+# Remove clients from the admins group +chef_group 'admins' do + remove_groups 'clients' +end + +valid_nodes = search(:node, '*:*').map { |node| node.name } + +search(:client, '*:*').each do |c| + if valid_nodes.include?(c.name) + # Check whether the user exists + begin + api = Cheffish.chef_server_api + api.get("#{api.root_url}/users/#{c.name}").inspect + rescue Net::HTTPServerException => e + if e.response.code == '404' + puts "Response #{e.response.code} for #{c.name}" + # If the user does NOT exist, we can just add the client to the acl + chef_acl "nodes/#{c.name}" do + rights [ :read, :update ], clients: [ c.name ] + end + next + end + end + + # We will only get here if the user DOES exist. We are going to have a + # conflict between the user and client. Create a group for it, add + # the user for that group, and add the group to the acl. Bleagh. + chef_group "client_#{c.name}" do + clients c.name + end + chef_acl "nodes/#{c.name}" do + rights [ :read, :update ], groups: "client_#{c.name}" + end + end +end
Add a recipe that cleans up ACLs for those who did the "add clients to admins group" thing
diff --git a/providers/project.rb b/providers/project.rb index abc1234..def5678 100644 --- a/providers/project.rb +++ b/providers/project.rb @@ -1,26 +1,26 @@+use_inline_resources + action :create do - ruby_block "create / update Rundeck project #{new_resource.name}" do - block do - new_resource.api_client.tap do |client| - # Check if project is already on server - if client.get('projects').select { |p| p['name'] == new_resource.name }.empty? - # Create the project (with no config, config will be set below) - Chef::Log.info { "creating project #{new_resource.name}" } - client.post('projects', name: new_resource.name) - end + new_resource.api_client.tap do |client| + # Check if project is already on server + if client.get('projects').select { |p| p['name'] == new_resource.name }.empty? + # Create the project (with no config, config will be set below) + converge_by "creating project #{new_resource.name}" do + client.post('projects', name: new_resource.name) + end + end - # Update project config - # Creating a project with a POST to /projects creates the project with - # the config provided _and_ additional default config. Updating the - # project config with a PUT to /project/[PROJECT]/config does not leave - # that additional default config. To handle this, always update the - # project config to exactly what is provided to the lwrp. - Chef::Log.info { "updating config for project #{new_resource.name}" } - client.put( - ::File.join('project', new_resource.name, 'config'), - new_resource.config.to_java_properties_hash - ) - end + # Update project config + # Creating a project with a POST to /projects creates the project with + # the config provided _and_ additional default config. Updating the + # project config with a PUT to /project/[PROJECT]/config does not leave + # that additional default config. To handle this, always update the + # project config to exactly what is provided to the lwrp. + converge_by "updating config for project #{new_resource.name}" do + client.put( + ::File.join('project', new_resource.name, 'config'), + new_resource.config.to_java_properties_hash + ) end end end
Convert ruby_block to a true LWRP Signed-off-by: Tim Smith <tsmith@chef.io> Former-commit-id: 2108f4269fdb5f77bb83bc940483a77965617585
diff --git a/bmff.gemspec b/bmff.gemspec index abc1234..def5678 100644 --- a/bmff.gemspec +++ b/bmff.gemspec @@ -8,16 +8,18 @@ spec.version = BMFF::VERSION spec.authors = ["Takayuki Ogiso"] spec.email = ["gomatofu@gmail.com"] - spec.summary = %q{ISO Base Media File Format Parser} + spec.summary = %q{ISO BMFF Parser} spec.description = %q{ISO Base Media File Format file parser.} spec.homepage = "" spec.license = "MIT" - spec.files = `git ls-files -z`.split("\x0") + spec.files = `git ls-files -z`.split("\x0").delete_if{|x| %r|/assets/| =~ x } 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"] + spec.required_ruby_version = '>= 1.9.0' + spec.add_development_dependency "bundler", "~> 1.5" spec.add_development_dependency "rake" end
Exclude an asset file from a gem package. Exclude an asset movie file from a gem package. A movie file is too large to include in a gem package file. Some other properties are changed to more appropriate values.
diff --git a/config/schedule.rb b/config/schedule.rb index abc1234..def5678 100644 --- a/config/schedule.rb +++ b/config/schedule.rb @@ -12,6 +12,6 @@ rake "rummager:index:consultations" end -every :hour, roles: [:backend] do +every 10.minutes, roles: [:backend] do rake "taxonomy:rebuild_cache" end
Increase the number of cache refreshes for taxonomy This will make it easier to observe the behaviour. Once we're confident this works we can dial down the frequency. https://trello.com/c/fsehBQ7s