diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/db/seeds.rb b/db/seeds.rb index abc1234..def5678 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -2,9 +2,9 @@ # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). groups = [ - ["Plus63 Design Co", "#FF5500"], - ["Inksurge", "#B3BD8E"], - ["Acid House", "#919191"], - ["KM", "#5ACCCC"], + ["Plus63 Design Co", "#FF5500", "+63"], + ["Inksurge", "#B3BD8E", "INK"], + ["Acid House", "#919191", "ACID"], + ["KM", "#5ACCCC", "KMD"], ] -groups.each {|n, c| Group.create(name: n, color: c)} +groups.each {|n, c, i| Group.create(name: n, color: c, initials: i)}
Add group initials to seed data.
diff --git a/db/seeds.rb b/db/seeds.rb index abc1234..def5678 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -11,7 +11,6 @@ (0..9).each do |count| url = "http://developer.echonest.com/api/v4/artist/search?api_key=#{Rails.application.secrets.echonest_api_key}&format=json&start=#{count * 100}&results=100&sort=familiarity-desc" - puts "URL -----------------------------> #{url}" uri = URI(url) data = Net::HTTP.get(uri) parsed = JSON.parse(data) @@ -21,5 +20,5 @@ end (0..100).each do |num| - Vote.create!(winner_id: rand(0..1000), loser_id: rand(0..1000)) + Vote.create!(winner_id: rand(1..500), loser_id: rand(501..1000)) end
Fix the stupid test, at least locally. We'll see what travis says
diff --git a/lib/geb.rb b/lib/geb.rb index abc1234..def5678 100644 --- a/lib/geb.rb +++ b/lib/geb.rb @@ -13,7 +13,7 @@ class << self attr_writer :logger - def logger(level = ::Logger::WARN) + def logger(level = ::Logger::INFO) @logger ||= ::Logger.new(STDOUT).tap {|l| l.level = level } end end
Change default status for Logger
diff --git a/app/controllers/questions_controller.rb b/app/controllers/questions_controller.rb index abc1234..def5678 100644 --- a/app/controllers/questions_controller.rb +++ b/app/controllers/questions_controller.rb @@ -27,7 +27,9 @@ get '/questions/:id/edit' do # edit form - if #user is the right user + @question = Question.find(:id) + @user_id = @question.user_id + if #current user's id matches the Question's user_id erb :"/questions/edit" else #error message @@ -36,6 +38,7 @@ put 'questions/:id' do # update question + @question = Question.update(params[:entry]) redirect "/questions/#{params[:id]}" end
Add code to controller for editing the question
diff --git a/lib/jan.rb b/lib/jan.rb index abc1234..def5678 100644 --- a/lib/jan.rb +++ b/lib/jan.rb @@ -1,36 +1,33 @@+require "jan/check_digit_calculator" +require "jan/parser" +require "jan/random" +require "jan/validator" require "jan/version" -require "jan/parser" -require "jan/check_digit_calculator" -require "jan/validator" -require "jan/random" class Jan < ::String InstorePrefixes = %w(02 20 21 22 23 24 25 26 27 28 29) - attr_accessor :code - def initialize(code) - @code = code super(code.to_s) end def valid? - Validator.validate(@code) + Validator.validate(self) end def check_digit - Parser.check_digit(@code) + Parser.check_digit(self) end def even_digits - Parser.even_digits(@code) + Parser.even_digits(self) end def odd_digits - Parser.odd_digits(@code) + Parser.odd_digits(self) end def instore_code? - Parser.instore_code?(@code) + Parser.instore_code?(self) end end
Remove instance variable @code form Jan.
diff --git a/spec/ruby/1.8/core/file/grpowned_spec.rb b/spec/ruby/1.8/core/file/grpowned_spec.rb index abc1234..def5678 100644 --- a/spec/ruby/1.8/core/file/grpowned_spec.rb +++ b/spec/ruby/1.8/core/file/grpowned_spec.rb @@ -4,7 +4,7 @@ describe "File.grpowned?" do it_behaves_like :file_grpowned, :grpowned?, File - it "return false if the does not exist" do + it "returns false if file the does not exist" do File.grpowned?("i_am_a_bogus_file").should == false end end
Fix typo in File.grpowned? spec
diff --git a/bin/remove_duplicates_from_two_files.rb b/bin/remove_duplicates_from_two_files.rb index abc1234..def5678 100644 --- a/bin/remove_duplicates_from_two_files.rb +++ b/bin/remove_duplicates_from_two_files.rb @@ -0,0 +1,43 @@+#!/usr/bin/env ruby-local-exec + + # Author: Matti + # Version: 0.1 + # Usage: ./remove_duplicates_from_two_files.rb path/to/first/file path/to/second/file + +first_file_path = ARGV[0] +second_file_path = ARGV[1] + +first_file = File.open(first_file_path) +second_file = File.open(second_file_path) + +elements_from_first_file = [] +first_file.each_line { |line| elements_from_first_file << line } +first_file.close + +elements_from_second_file = [] +second_file.each_line { |line| elements_from_second_file << line } +second_file.close + +common_elements = (elements_from_first_file & elements_from_second_file) + +if common_elements.empty? + puts 'No common elements found. Nothing to do, yay!' + exit +end + +unique_elements_from_first_file = elements_from_first_file - common_elements +unique_elements_from_second_file = elements_from_second_file - common_elements + +first_file = File.open(first_file_path, 'w') +second_file = File.open(second_file_path, 'w') + +unique_elements_from_first_file.each { |elem| first_file.write(elem) } +first_file.close + +unique_elements_from_second_file.each { |elem| second_file.write(elem) } +second_file.close + +puts "Removed #{common_elements.size} common element(s):" +puts common_elements.map(&:chomp).join(', ') +exit +
[Script] Remove repeated elements from two files
diff --git a/spec/features/stashes_features_spec.rb b/spec/features/stashes_features_spec.rb index abc1234..def5678 100644 --- a/spec/features/stashes_features_spec.rb +++ b/spec/features/stashes_features_spec.rb @@ -0,0 +1,39 @@+require 'spec_helper' + +describe "Stashes" do + before :all do + load "#{Rails.root}/db/seeds.rb" + end + + before :each do + user = FactoryGirl.create(:user) + user.add_role :admin + sign_in_user(user) + visit '/stashes' + end + + it "should show the stashes page" do + page.should have_content "Stashes" + end + + it "should show the correct stash count" do + page.should have_content "Stashes (#{Stash.all.count})" + end + + it "should show stashes and correct data" do + page.should have_content "tester" + page.should have_content "Never" + page.should have_content "43 years ago" + end + + it "should have a delete link" do + page.should have_button "Delete" + end + + pending "should allow deletion of a stash", :js => true do + page.should have_selector("#silence-i-424242-tokens", :text => "Delete") + find("#silence-i-424242-tokens", :text => "Delete").click + page.should_not have_selector("#silence-i-424242-tokens", :text => "Delete") + end + +end
Update stash feature specs to run agains sensu api v0.10.2
diff --git a/spec/support/post_content_generator.rb b/spec/support/post_content_generator.rb index abc1234..def5678 100644 --- a/spec/support/post_content_generator.rb +++ b/spec/support/post_content_generator.rb @@ -12,7 +12,6 @@ :name => "Example App Name", :description => "Example App Description", :url => "http://someapp.example.com", - :icon => "http://someapp.example.com/icon.png", :redirect_uri => "http://someapp.example.com/oauth/callback", :post_types => { :read => %w( https://tent.io/types/status/v0# ),
Update spec: remove icon content member from app json
diff --git a/cookbooks/wt_heatmap/recipes/import.rb b/cookbooks/wt_heatmap/recipes/import.rb index abc1234..def5678 100644 --- a/cookbooks/wt_heatmap/recipes/import.rb +++ b/cookbooks/wt_heatmap/recipes/import.rb @@ -3,7 +3,7 @@ directory "/home/hadoop/log-drop" do owner "hadoop" group "hadoop" - mode "0744" + mode "0755" end # script to import data into hive
Modify the permissions on the data-drop directory from 744 to 755 so Nagios can monitor this dir Former-commit-id: 910ccd58f438cbe44b0810274147c3af6ca14931 [formerly a2686546cf21493051a82822218c4d7fe26098c8] [formerly 88b8bab7c78ce1e88dc6be6d0c2ae558c5868618 [formerly 2199c9d11a22393fd3d74673da247587a412e655 [formerly 5fa721e6c831163613cd04875db63f717f9ad755]]] Former-commit-id: f027e65f3b61269f86e8e8d160a192db0d46729b [formerly 585a737e7e82e5213d8575e80fbf7d907b982fe4] Former-commit-id: 2263d737c34b6dba6a3df3d607fee4ba8749534a Former-commit-id: 6616aa9e3a8a606ced272bbea32f11b5faa560b3
diff --git a/core/app/models/billing_integration.rb b/core/app/models/billing_integration.rb index abc1234..def5678 100644 --- a/core/app/models/billing_integration.rb +++ b/core/app/models/billing_integration.rb @@ -7,7 +7,7 @@ def provider integration_options = options - ActiveMerchant::Billing::Base.integration_mode = integration_options[:server] + ActiveMerchant::Billing::Base.integration_mode = integration_options[:server].to_sym integration_options = options integration_options[:test] = true if integration_options[:test_mode] @provider ||= provider_class.new(integration_options)
Update BillingIntegration to use symbol for integration_mode
diff --git a/lib/environment_light.rb b/lib/environment_light.rb index abc1234..def5678 100644 --- a/lib/environment_light.rb +++ b/lib/environment_light.rb @@ -12,12 +12,7 @@ # Load application settings require Rails.root.join('config/initializers/rails_config.rb') -Settings = RailsConfig.load_files([ - 'settings.yml', - "settings/#{Rails.env}.yml", - "environments/#{Rails.env}.yml", - 'settings.local.yml', - "settings.#{Rails.env}.local.yml", - "environments/#{Rails.env}.local.yml", - 'hets.yml' - ].map { |f| Rails.root.join('config', f) }) +# only load basic files, NOT the auxiliaries like hets.yml +settings_files = RailsConfig.setting_files(Rails.root.join('config'), Rails.env) +abs_settings_files = settings_files.map { |f| Rails.root.join('config', f) } +Settings = RailsConfig.load_files(abs_settings_files)
Read from rails_config which files to load.
diff --git a/lib/font_awesome/sass.rb b/lib/font_awesome/sass.rb index abc1234..def5678 100644 --- a/lib/font_awesome/sass.rb +++ b/lib/font_awesome/sass.rb @@ -12,7 +12,7 @@ end def gem_path - @gem_path ||= File.expand_path('..', File.dirname(__FILE__)) + @gem_path ||= File.expand_path('../..', File.dirname(__FILE__)) end def stylesheets_path
Fix gem_path, now the compass extension actually works.
diff --git a/lib/human_error/error.rb b/lib/human_error/error.rb index abc1234..def5678 100644 --- a/lib/human_error/error.rb +++ b/lib/human_error/error.rb @@ -37,7 +37,7 @@ "#{knowledgebase_url}/#{knowledgebase_article_id}" end - def to_json + def to_json(options = {}) JSON.dump(as_json) end
Add options as an argument to to_json since that's the standard implementation
diff --git a/spec/system/live_system_spec.rb b/spec/system/live_system_spec.rb index abc1234..def5678 100644 --- a/spec/system/live_system_spec.rb +++ b/spec/system/live_system_spec.rb @@ -1,50 +1,30 @@ require 'rails_helper' -RSpec.describe 'Live', type: :system do - describe 'list' do - before do - create_list(:live, 2) - create(:live, :unpublished, name: 'draft live') - end +RSpec.describe 'Live:', type: :system do + specify 'A user can see the live index page and a live detail page, and after logged-in, they can see album', js: true do + # Given + live = create(:live, :with_songs, album_url: 'https://example.com/album') + user = create(:user) - it 'enables users to see the published lives' do - visit lives_path + # When + visit lives_path - expect(page).to have_title('ライブ') - Live.published.each do |live| - expect(page).to have_content(live.name) - end - Live.unpublished.each do |draft_live| - expect(page).not_to have_content(draft_live.name) - end - end - end + # Then + expect(page).to have_title 'ライブ' - describe 'detail' do - let(:live) { create(:live, :with_songs, album_url: 'https://example.com/album') } + # When + find('td', text: live.name).click - it 'enables non-logged-in users to see individual live pages' do - visit live_path(live) + # Then + expect(page).to have_title live.title + expect(page).not_to have_link 'アルバム' - expect(page).to have_title(live.title) - expect(page).to have_content(live.name) - expect(page).to have_content(I18n.l(live.date)) - expect(page).to have_content(live.place) - expect(page).not_to have_link(href: live.album_url) - expect(page).not_to have_css('#admin-tools') - live.songs.each do |song| - expect(page).to have_content(song.name) - end - end + # When + log_in_as user + visit live_path(live) - it 'enables logged-in users to see individual live pages with an album link' do - log_in_as create(:user) - - visit live_path(live) - - expect(page).to have_title(live.title) - expect(page).to have_link(href: live.album_url) - expect(page).not_to have_css('#admin-tools') - end + # Then + expect(page).to have_title live.title + expect(page).to have_link 'アルバム' end end
Improve system spec for live pages
diff --git a/spec/tachikoma/settings_spec.rb b/spec/tachikoma/settings_spec.rb index abc1234..def5678 100644 --- a/spec/tachikoma/settings_spec.rb +++ b/spec/tachikoma/settings_spec.rb @@ -2,8 +2,8 @@ describe Tachikoma do describe '.root_path' do let(:somewhere) { '/path/to/somewhere' } - let(:datapath) { somewhere + '/data'} - let(:repospath) { somewhere + '/repos'} + let(:datapath) { somewhere + '/data' } + let(:repospath) { somewhere + '/repos' } before :each do Dir.stub(:pwd).and_return(somewhere)
Add space before closing brace
diff --git a/examples/purge-empty-vocabularies.rb b/examples/purge-empty-vocabularies.rb index abc1234..def5678 100644 --- a/examples/purge-empty-vocabularies.rb +++ b/examples/purge-empty-vocabularies.rb @@ -0,0 +1,16 @@+$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) +require 'awesome_print' +require 'collectionspace/client' + +# CREATE CLIENT WITH DEFAULT (DEMO) CONFIGURATION -- BE NICE!!! +client = CollectionSpace::Client.new +client.config.throttle = 1 + +client.all('vocabularies') do |item| + uri = item["uri"] + if client.count("#{uri}/items") == 0 + puts "Purging empty vocabulary:\t#{item['displayName']} (#{item['csid']})" + # YOU WOULD UNCOMMENT THIS TO ACTUALLY PERFORM THE PURGE ... + # client.delete uri + end +end
Add purge empty vocabularies example
diff --git a/spec/redis_rpc_spec.rb b/spec/redis_rpc_spec.rb index abc1234..def5678 100644 --- a/spec/redis_rpc_spec.rb +++ b/spec/redis_rpc_spec.rb @@ -6,4 +6,28 @@ RedisRpc.logger.wont_equal nil end + describe RedisRpc::Packed do + + class TestObject + include RedisRpc::Packed + + attr_accessor :first_name + attr_accessor :last_name + end + + it "should pack all instance vars" do + o = TestObject.new + o.first_name = "Ray" + o.last_name = "Krueger" + packed = o.to_msgpack + + packed.must_equal "\202\251last_name\247Krueger\252first_name\243Ray" + + unpacked = MessagePack.unpack(packed) + unpacked["first_name"].must_equal o.first_name + unpacked["last_name"].must_equal o.last_name + end + + end + end
Add a spec for RedisRpc::Packed Should simply pack unpack ivars.
diff --git a/lib/net/ldap/password.rb b/lib/net/ldap/password.rb index abc1234..def5678 100644 --- a/lib/net/ldap/password.rb +++ b/lib/net/ldap/password.rb @@ -27,7 +27,7 @@ when :sha attribute_value = '{SHA}' + Base64.encode64(Digest::SHA1.digest(str)).chomp! when :ssha - srand; salt = (rand * 1000).to_i.to_s + srand; salt = SecureRandom.random_bytes(16) attribute_value = '{SSHA}' + Base64.encode64(Digest::SHA1.digest(str + salt) + salt).chomp! else raise Net::LDAP::HashTypeUnsupportedError, "Unsupported password-hash type (#{type})"
Use SecureRandam to generate salt
diff --git a/commands/help_default.rb b/commands/help_default.rb index abc1234..def5678 100644 --- a/commands/help_default.rb +++ b/commands/help_default.rb @@ -1,34 +1,34 @@-module SlackRubyBot - module Commands - class HelpCommand < Base - help do - title 'help' - desc 'Shows help information.' - end - - command 'help' do |client, data, match| - command = match[:expression] - - text = if command.present? - CommandsHelper.instance.command_full_desc(command) - else - general_text - end - - client.say(channel: data.channel, text: text, gif: 'help') - end - - class << self - private - - def general_text - bot_desc = CommandsHelper.instance.bot_desc_and_commands - other_commands_descs = CommandsHelper.instance.other_commands_descs - <<TEXT -#{bot_desc.join("\n")} -TEXT - end - end - end - end -end +# module SlackRubyBot +# module Commands +# class HelpCommand < Base +# help do +# title 'help' +# desc 'Shows help information.' +# end +# +# command 'help' do |client, data, match| +# command = match[:expression] +# +# text = if command.present? +# CommandsHelper.instance.command_full_desc(command) +# else +# general_text +# end +# +# client.say(channel: data.channel, text: text, gif: 'help') +# end +# +# class << self +# private +# +# def general_text +# bot_desc = CommandsHelper.instance.bot_desc_and_commands +# other_commands_descs = CommandsHelper.instance.other_commands_descs +# <<TEXT +# #{bot_desc.join("\n")} +# TEXT +# end +# end +# end +# end +# end
Remove Monkey Patch for help
diff --git a/db/seeds.rb b/db/seeds.rb index abc1234..def5678 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -5,3 +5,24 @@ # # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) # Mayor.create(name: 'Emanuel', city: cities.first) + +Topology.create(graph: [{ + 'name' => 'HV Network', + 'children' => [ + { + 'name' => 'Medium Voltage #1', + 'children' => [ + { 'name' => 'MV Connection #1' }, + { 'name' => 'Low Voltage #1' }, + { 'name' => 'Low Voltage #2' } + ] + }, { + 'name' => 'Medium Voltage #2', + 'children' => [ + { 'name' => 'Low Voltage #3' }, + { 'name' => 'Low Voltage #4' }, + { 'name' => 'Low Voltage #5' } + ] + } + ] +}])
Create a dummy topology in the seed task
diff --git a/field_types/core/boolean/boolean_field_type.rb b/field_types/core/boolean/boolean_field_type.rb index abc1234..def5678 100644 --- a/field_types/core/boolean/boolean_field_type.rb +++ b/field_types/core/boolean/boolean_field_type.rb @@ -1,23 +1,72 @@ class BooleanFieldType < FieldType + VALIDATION_TYPES = { + presence: :valid_presence_validation? + }.freeze + attr_accessor :data, :value, :field_name + attr_reader :validations, :metadata + + validates :value, presence: true, if: :validate_presence? + validate :value_is_allowed? + + def validations=(validations_hash) + @validations = validations_hash.deep_symbolize_keys + end def data=(data_hash) @value = data_hash.deep_symbolize_keys[:value] end + def metadata=(metadata_hash) + @metadata = metadata_hash.deep_symbolize_keys + end + + def acceptable_validations? + valid_types? && valid_options? + end + def field_item_as_indexed_json_for_field_type(field_item, options = {}) json = {} - json[mapping_field_name] = field_item.data['value'] + json[mapping_field_name] = field_item.data['boolean'] json end def mapping - {name: mapping_field_name, type: :boolean} + {name: mapping_field_name, type: :string, analyzer: :snowball} end private def mapping_field_name - "#{field_name.downcase}_boolean" + "#{field_name.downcase.gsub(' ', '_')}_boolean" + end + + def value_is_allowed? + if [true, false].include?(value) + true + else + errors.add(:value, "must be True or False") + false + end + end + + def valid_types? + validations.all? do |type, options| + VALIDATION_TYPES.include?(type) + end + end + + def valid_options? + validations.all? do |type, options| + self.send(VALIDATION_TYPES[type]) + end + end + + def valid_presence_validation? + @validations.key? :presence + end + + def validate_presence? + @validations.key? :presence end end
Fix boolean to work as the other field types do
diff --git a/config/deploy/staging.rb b/config/deploy/staging.rb index abc1234..def5678 100644 --- a/config/deploy/staging.rb +++ b/config/deploy/staging.rb @@ -3,14 +3,14 @@ # This is used in the Nginx VirtualHost to specify which domains # the app should appear on. If you don't yet have DNS setup, you'll # need to create entries in your local Hosts file for testing. -set :server_name, "staging.mcac.church" +set :server_name, "104.131.162.148" # used in case we're deploying multiple versions of the same # app side by side. Also provides quick sanity checks when looking # at filepaths set :full_app_name, "#{fetch(:application)}_#{fetch(:stage)}" -server 'staging.mcac.church', user: 'deploy', roles: %w{web app db}, primary: true +server '104.131.162.148', user: 'deploy', roles: %w{web app db}, primary: true set :deploy_to, "/home/#{fetch(:deploy_user)}/apps/#{fetch(:full_app_name)}"
Use IP instead of domain name
diff --git a/mustermann/mustermann.gemspec b/mustermann/mustermann.gemspec index abc1234..def5678 100644 --- a/mustermann/mustermann.gemspec +++ b/mustermann/mustermann.gemspec @@ -14,4 +14,6 @@ s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } + + s.add_runtime_dependency('ruby2_keywords', '~> 0.0.1') end
Add runtime dependency to ruby2_keywords
diff --git a/lib/slacken/node_type.rb b/lib/slacken/node_type.rb index abc1234..def5678 100644 --- a/lib/slacken/node_type.rb +++ b/lib/slacken/node_type.rb @@ -43,7 +43,7 @@ end def allowed_in_table? - member_of?(%i(code b strong i em wrapper span).concat(text_types)) + member_of?(%i(code b strong i em wrapper span thead tbody tr th td).concat(text_types)) end def allowed_in_link?
Allow table parts tags in table
diff --git a/adash.gemspec b/adash.gemspec index abc1234..def5678 100644 --- a/adash.gemspec +++ b/adash.gemspec @@ -22,5 +22,5 @@ spec.add_development_dependency "bundler", "~> 1.13" spec.add_development_dependency "rake", "~> 12.0" spec.add_dependency "amazon-drs" - spec.add_dependency "launchy", "~> 2.5" + spec.add_dependency "launchy" end
Remove dependency version spec for launchy
diff --git a/config/application.rb b/config/application.rb index abc1234..def5678 100644 --- a/config/application.rb +++ b/config/application.rb @@ -19,5 +19,9 @@ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] # config.i18n.default_locale = :de + + config.generators do |g| + g.test_framework :rspec, fixture: false + end end end
Define RSpec as our default test framework.
diff --git a/server/test/test_case.rb b/server/test/test_case.rb index abc1234..def5678 100644 --- a/server/test/test_case.rb +++ b/server/test/test_case.rb @@ -12,6 +12,7 @@ def run(*args, &block) result = nil + $cache = Cache.new Sequel::Model.db.transaction(:rollback => :always){ result = super } result end
Create new cache on each test case.
diff --git a/config/deploy.example.rb b/config/deploy.example.rb index abc1234..def5678 100644 --- a/config/deploy.example.rb +++ b/config/deploy.example.rb @@ -16,8 +16,12 @@ %w{public/images public/javascripts public/stylesheets} set :rvm_type, :user set :rvm_ruby_version, 'jruby-9.0.5.0' +set :rollbar_token, proc { Figaro.env.ROLLBAR_POST_SERVER_ITEM_ACCESS_TOKEN } +set :rollbar_env, proc { fetch :stage } +set :rollbar_role, proc { :app } namespace :deploy do + after :starting, 'figaro:load' desc 'Restart application' task :restart do on roles(:app), in: :sequence, wait: 5 do
Add rollbar deploy notice ID:512
diff --git a/config/environment.rb b/config/environment.rb index abc1234..def5678 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -24,18 +24,4 @@ # Load Mongoid's configuration for this specific environment. require "mongoid" - -# FIXME: Disable MongoDB logging for performance. Currently a simple monkey -# patch. -# -# Mongoid.logger = nil currently doesn't work, but should be fixed in next -# release. https://github.com/mongoid/mongoid/issues/734 -# -# Mongoid.logger = nil -module Mongoid - def self.logger - nil - end -end - Mongoid.load!(::File.join(AUTH_PROXY_ROOT, "config", "mongoid.yml"))
Remove mongoid logger monkeypatch, since this can now be configured in database.yml.
diff --git a/spec/factories/course_lesson_plan_items.rb b/spec/factories/course_lesson_plan_items.rb index abc1234..def5678 100644 --- a/spec/factories/course_lesson_plan_items.rb +++ b/spec/factories/course_lesson_plan_items.rb @@ -0,0 +1,12 @@+FactoryGirl.define do + factory :course_lesson_plan_item, class: 'Course::LessonPlanItem' do + creator + updater + base_exp { rand(1..10) * 100 } + time_bonus_exp { rand(1..10) * 100 } + extra_bonus_exp { rand(1..10) * 100 } + start_time 1.days.from_now + bonus_end_time 2.days.from_now + end_time 3.days.from_now + end +end
Add lesson plan item model factory
diff --git a/spec/public/controller/controllers/base.rb b/spec/public/controller/controllers/base.rb index abc1234..def5678 100644 --- a/spec/public/controller/controllers/base.rb +++ b/spec/public/controller/controllers/base.rb @@ -1,15 +1,10 @@- - module Merb::Test::Fixtures - module Controllers - class Testing < Merb::Controller self._template_root = File.dirname(__FILE__) / "views" end module Inclusion - def self.included(base) base.show_action(:baz) end @@ -21,12 +16,11 @@ def bat "bat" end - end class Base < Testing include Inclusion - + def index self.status = :ok "index" @@ -39,4 +33,4 @@ end end -end+end
Clean up empty lines in fixture controller.
diff --git a/spec/functions/split_spec.rb b/spec/functions/split_spec.rb index abc1234..def5678 100644 --- a/spec/functions/split_spec.rb +++ b/spec/functions/split_spec.rb @@ -21,4 +21,6 @@ it { should run.with_params('foo').and_raise_error(expected_error, expected_error_message) } it { should run.with_params('foo').and_raise_error(expected_error_message) } + + it { expect { should run.with_params('foo').and_raise_error(/definitely no match/) }.to raise_error RSpec::Expectations::ExpectationNotMetError } end
Verify and_raise_error behaviour in case of mismatch This closes #240.
diff --git a/spec/limit_detectors_spec.rb b/spec/limit_detectors_spec.rb index abc1234..def5678 100644 --- a/spec/limit_detectors_spec.rb +++ b/spec/limit_detectors_spec.rb @@ -1,28 +1,42 @@ require 'spec_helper' -Array.send :include, LimitDetectors +describe 'With an Array as the enumerable' do -describe '#at_most' do + Array.send :include, LimitDetectors - it 'is true for an empty Array' do - expect([].at_most(5){ true }).to be_true + describe '#at_most' do + + it 'is true for an empty Array' do + expect([].at_most(5){ true }).to be_true + end + + it 'is true if the criterion is met once' do + expect(["it's there"].at_most(1){ |el| el == "it's there"}).to be_true + end + + it 'is true if all elements meet the criterion and the size is the given maximum number' do + expect([1,1,1].at_most(3){|e| e == 1}) + end + + it 'is false if not enough elements meet the criterion' do + expect([1, 2, 4].at_most(1){|e| e.even?}).to be_false + end + + it 'is true if 0 elements are expected to match' do + r = Array.new(10){rand} + expect(r.at_most(0){ |i| i > 2 }).to be_true + end + end +end - it 'is true if the criterion is met once' do - expect(["it's there"].at_most(1){ |el| el == "it's there"}).to be_true +describe 'With a Hash as the Enumerable' do + Hash.send :include, LimitDetectors + + describe '#at_most' do + it 'detects a condition based on key as well as value properties' do + h = { 'foo' => 1, 'bar' => 4, 'baz' => 5, 'bum' => 1, 'fum' => 0} + expect( h.at_most(3){|ky,vl| ky.match(/^b/) || vl > 1 }).to be_true + end end - - it 'is true if all elements meet the criterion and the size is the given maximum number' do - expect([1,1,1].at_most(3){|e| e == 1}) - end - - it 'is false if not enough elements meet the criterion' do - expect([1, 2, 4].at_most(1){|e| e.even?}).to be_false - end - - it 'is true if 0 elements are expected to match' do - r = Array.new(10){rand} - expect(r.at_most(0){ |i| i > 2 }).to be_true - end - -end +end
Add describe blocks for different Enumerable objects, add 1st check for Hash objects
diff --git a/lib/llvm.rb b/lib/llvm.rb index abc1234..def5678 100644 --- a/lib/llvm.rb +++ b/lib/llvm.rb @@ -5,11 +5,7 @@ extend ::FFI::Library # load required libraries - begin - ffi_lib ['LLVM-2.8', 'libLLVM-2.8'] - rescue LoadError - ffi_lib ['LLVM-2.7', 'libLLVM-2.7'] - end + ffi_lib ['LLVM-2.8', 'libLLVM-2.8'] end NATIVE_INT_SIZE = case FFI::Platform::ARCH
Remove support for LLVM 2.7
diff --git a/lib/maps.rb b/lib/maps.rb index abc1234..def5678 100644 --- a/lib/maps.rb +++ b/lib/maps.rb @@ -12,12 +12,14 @@ def info_window(log) station = log.station - content = station.callsign + '<br /><hr>Last received on ' + log.created_at.to_s + '<br />' + content = '' + content += link_to station.callsign, "http://www.rabbitears.info/market.php?request=station_search&callsign=#{station.callsign}#station", { :target => 'station_lookup' } + content += '<br /><hr>Last received on ' + log.created_at.to_s + '<br />' content += 'Channel: ' + station.rf.to_s + '<br />' content += 'Distance: ' + station.distance.round(2).to_s + ' mi<br />' content += 'Most recent scan: <br />' content += 'Signal Strength: ' + log.signal_strength.to_s + '<br />' content += 'Signal to Noize: ' + log.signal_to_noise.to_s + '<br />' content += 'Signal Quality: ' + log.signal_quality.to_s + '<br />' - content += link_to 'Signal Graph', "/chart/#{station.id}/#{log.tuner.id}", { :target => '_blank' } + content += link_to 'Signal Graph', "/chart/#{station.id}/#{log.tuner.id}", { :target => 'signal_graph' } end
Add rabbitears.info lookup to info window
diff --git a/examples.rb b/examples.rb index abc1234..def5678 100644 --- a/examples.rb +++ b/examples.rb @@ -20,6 +20,6 @@ time = Tickle.parse(s)[:next] print s, " --> server date: ", time puts - print s, " --> utc date: ", time - Time.now.utc_offset + print s, " --> utc date: ", time.utc puts }
Add timezone notes to example.rb
diff --git a/test/controllers/main_controller_test.rb b/test/controllers/main_controller_test.rb index abc1234..def5678 100644 --- a/test/controllers/main_controller_test.rb +++ b/test/controllers/main_controller_test.rb @@ -11,7 +11,7 @@ test 'should return the home page' do get :index assert_response :success - assert_select 'title', 'Adopt-a-Drain' + assert_select 'title', 'Adopt-a-Drain San Francisco' assert_select 'p#tagline', 'Help the city avoid flooding by clearing drains of debris.' end
Fix test of site title Changed the title in the previous commit
diff --git a/railties/lib/rails/test_help.rb b/railties/lib/rails/test_help.rb index abc1234..def5678 100644 --- a/railties/lib/rails/test_help.rb +++ b/railties/lib/rails/test_help.rb @@ -32,13 +32,15 @@ end class ActionController::TestCase - setup do + def setup @routes = Rails.application.routes + super end end class ActionDispatch::IntegrationTest - setup do + def setup @routes = Rails.application.routes + super end end
Use `def setup` instead of `setup do` `setup do` creates unnecessary allocations of proc objects in callbacks. This prevents that from happening and results in faster code.
diff --git a/cross_validation.gemspec b/cross_validation.gemspec index abc1234..def5678 100644 --- a/cross_validation.gemspec +++ b/cross_validation.gemspec @@ -9,9 +9,10 @@ gem.version = CrossValidation::VERSION gem.authors = ["Jon-Michael Deldin"] gem.email = ["dev@jmdeldin.com"] - gem.description = %q{TODO: Write a gem description} - gem.summary = %q{TODO: Write a gem summary} - gem.homepage = "" + gem.summary = %q{Performs k-fold cross-validation on machine learning + classifiers.} + gem.description = gem.summary + gem.homepage = 'https://github.com/jmdeldin/cross_validation' gem.files = `git ls-files`.split($/) gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
Add a summary to the gemspec
diff --git a/spec/support/slash_commands_helpers.rb b/spec/support/slash_commands_helpers.rb index abc1234..def5678 100644 --- a/spec/support/slash_commands_helpers.rb +++ b/spec/support/slash_commands_helpers.rb @@ -3,7 +3,7 @@ Sidekiq::Testing.fake! do page.within('.js-main-target-form') do fill_in 'note[note]', with: text - click_button 'Comment' + find('.comment-btn').trigger('click') end end end
Fix comment button test for slash commands
diff --git a/app/controllers/base_media_controller.rb b/app/controllers/base_media_controller.rb index abc1234..def5678 100644 --- a/app/controllers/base_media_controller.rb +++ b/app/controllers/base_media_controller.rb @@ -8,17 +8,7 @@ headers['Last-Modified'] = asset.last_modified.httpdate headers['Content-Disposition'] = AssetManager.content_disposition.header_for(asset) - last_modified_from_request = request.headers['If-Modified-Since'] - etag_from_request = request.headers['If-None-Match'] - - request_is_fresh = false - if last_modified_from_request || etag_from_request - request_is_fresh = true - request_is_fresh &&= (Time.parse(last_modified_from_request) >= Time.parse(headers['Last-Modified'])) if last_modified_from_request - request_is_fresh &&= (etag_from_request == headers['ETag']) if etag_from_request - end - - unless request_is_fresh + unless request.fresh?(response) url = Services.cloud_storage.presigned_url_for(asset, http_method: request.request_method) headers['X-Accel-Redirect'] = "/cloud-storage-proxy/#{url}" end
Use Rails method to check for freshness of request I found it useful to test-drive my own implementation to give me confidence that this was working as I expected. Now that I have that confidence I'm happy to switch to the Rails implementation.
diff --git a/app/controllers/api/v1/api_controller.rb b/app/controllers/api/v1/api_controller.rb index abc1234..def5678 100644 --- a/app/controllers/api/v1/api_controller.rb +++ b/app/controllers/api/v1/api_controller.rb @@ -28,7 +28,7 @@ def restrict_access_by_params return true if @api_key - @api_key = APIKey.find_by(token: params['api_key']) + @api_key = APIKey.find_by(token: params[:api_key]) end end
Undo small change, moving from string to symbol (but it's indifferent access).
diff --git a/app/representers/api/base_representer.rb b/app/representers/api/base_representer.rb index abc1234..def5678 100644 --- a/app/representers/api/base_representer.rb +++ b/app/representers/api/base_representer.rb @@ -1,25 +1,20 @@ # encoding: utf-8 +require 'hal_api/representer' -class Api::BaseRepresenter < Roar::Decorator - - include Roar::Representer::JSON::HAL - - include FormatKeys - include UriMethods - include Curies - include Embeds - include Caches - include LinkSerialize - +class Api::BaseRepresenter < HalApi::Representer curies(:prx) do [{ name: :prx, - href: "http://#{prx_meta_host}/relation/{rel}", + href: "http://#{profile_host}/relation/{rel}", templated: true }] end - self_link + def self.alternate_host + "www.prx.org" + end - profile_link + def self.profile_host + "meta.prx.org" + end end
Use HAR base, remove includes, add in url methods
diff --git a/app/models/spree/adjustment_decorator.rb b/app/models/spree/adjustment_decorator.rb index abc1234..def5678 100644 --- a/app/models/spree/adjustment_decorator.rb +++ b/app/models/spree/adjustment_decorator.rb @@ -7,7 +7,7 @@ in: ['closed'], message: "Tax adjustments must always be closed for Avatax", }, - if: 'source == "Spree::TaxRate"', + if: 'source_type == "Spree::TaxRate"', } )
Update adjustment validation to check source_type, not source
diff --git a/app/workers/gtfs_feed_artifact_worker.rb b/app/workers/gtfs_feed_artifact_worker.rb index abc1234..def5678 100644 --- a/app/workers/gtfs_feed_artifact_worker.rb +++ b/app/workers/gtfs_feed_artifact_worker.rb @@ -0,0 +1,32 @@+class GtfsFeedArtifactWorker < FeedEaterWorker + + MAX_ATTEMPTS = 5 + WAIT_TIME = 10.minutes + + def perform(feed_onestop_id, attempts=1) + logger.info "GtfsFeedArtifactWorker #{feed_onestop_id}: Verifying osm_way_ids" + prefix = "gtfs://#{feed_onestop_id}/" + missing = Stop.with_identifer_starting_with(prefix).select { |x| x.tags['osm_way_id'].nil? } + + if attempts > MAX_ATTEMPTS + logger.info "Missing #{missing.length} osm_way_ids. #{attempts} attempts: aborting" + return + elsif missing.any? + logger.info "Missing #{missing.length} osm_way_ids. #{attempts} attempts: trying again" + GtfsFeedArtifactWorker.perform_in(WAIT_TIME, feed_onestop_id, attempts+1) + return + end + + logger.info "GtfsFeedArtifactWorker #{feed_onestop_id}: Creating GTFS artifacts" + run_python( + './lib/feedeater/artifact.py', + feed_onestop_id + ) + + if Figaro.env.upload_feed_eater_artifacts_to_s3 == 'true' + logger.info "GtfsFeedArtifactWorker #{feed_onestop_id}: Enqueuing a job to upload artifacts to S3" + UploadFeedEaterArtifactsToS3Worker.perform_async(feed_onestop_id) + end + + end +end
Move artifact creation to separate job Try 5 attempts
diff --git a/db/seeders/correspondence_type_seeder.rb b/db/seeders/correspondence_type_seeder.rb index abc1234..def5678 100644 --- a/db/seeders/correspondence_type_seeder.rb +++ b/db/seeders/correspondence_type_seeder.rb @@ -3,7 +3,7 @@ def seed! puts "----Seeding Correspondence Types----" - rec = CorrespondenceType.find_by(name: 'Freedom of information request') + rec = CorrespondenceType.find_by(abbreviation: 'FOI') rec = CorrespondenceType.new if rec.nil? rec.update!(name: 'Freedom of information request', abbreviation: 'FOI', @@ -12,7 +12,7 @@ external_time_limit: 20, deadline_calculator_class: 'BusinessDays') - rec = CorrespondenceType.find_by(name: 'Subject Access Request') + rec = CorrespondenceType.find_by(abbreviation: 'SAR') rec = CorrespondenceType.new if rec.nil? rec.update!(name: 'Subject Access Request', abbreviation: 'SAR',
Change to find record by abbreviation
diff --git a/digm_alpha.gemspec b/digm_alpha.gemspec index abc1234..def5678 100644 --- a/digm_alpha.gemspec +++ b/digm_alpha.gemspec @@ -8,8 +8,8 @@ gem.version = DigmAlpha::VERSION gem.authors = ["Anthony Cook"] gem.email = ["anthonymichaelcook@gmail.com"] - gem.description = %q{TODO: Write a gem description} - gem.summary = %q{TODO: Write a gem summary} + gem.description = %q{(para)digm Alpha is the first language experiment of many leading to a hypothetical ideal.} + gem.summary = %q{(para)digm Alpha: a language experiment} gem.homepage = "" gem.files = `git ls-files`.split($/)
Add gem description and summary.
diff --git a/capybara-angular.gemspec b/capybara-angular.gemspec index abc1234..def5678 100644 --- a/capybara-angular.gemspec +++ b/capybara-angular.gemspec @@ -24,4 +24,5 @@ spec.add_development_dependency "rake" spec.add_development_dependency "rspec" spec.add_development_dependency "poltergeist" + spec.add_development_dependency "puma" end
Add puma as a dev dependency
diff --git a/dm-session.gemspec b/dm-session.gemspec index abc1234..def5678 100644 --- a/dm-session.gemspec +++ b/dm-session.gemspec @@ -19,5 +19,5 @@ s.add_dependency('adamantium', '~> 0.0.7') s.add_dependency('equalizer', '~> 0.0.5') s.add_dependency('abstract_type', '~> 0.0.5') - s.add_dependency('concord', '~> 0.0.2') + s.add_dependency('concord', '~> 0.1.0') end
Update concord to ~> 0.1.0
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -23,7 +23,7 @@ suggests 'pkgutil' # Solaris 2 attribute 'build-essential/compile_time', - :display_name => 'Build Essential Compile Time Execution', - :description => 'Execute resources at compile time.', - :default => false, - :recipes => ['build-essential::default'] + display_name: 'Build Essential Compile Time Execution', + description: 'Execute resources at compile time.', + default: false, + recipes: ['build-essential::default']
Use ruby 1.9 syntax for compile_time attribute.
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -4,6 +4,14 @@ maintainer_email 'rjones@inviqa.com' license 'Apache 2.0' description 'Install and configure tideways daemon and PHP extension' +issues_url 'https://github.com/inviqa/tideways-cookbook/issues' +source_url 'https://github.com/inviqa/tideways-cookbook' + +supports 'centos' +supports 'debian' +supports 'fedora' +supports 'rhel' +supports 'ubuntu' depends 'yum' depends 'apt'
Add issues/source urls and supported platform info
diff --git a/lib/env.rb b/lib/env.rb index abc1234..def5678 100644 --- a/lib/env.rb +++ b/lib/env.rb @@ -3,7 +3,7 @@ require 'alephant/util/string' -config_file = File.join("config", "aws.yml") +config_file = File.join('config', 'aws.yaml') if File.exists? config_file config = YAML.load(File.read(config_file))
Correct file extension so it's consistent with other components we're building
diff --git a/recipes/_common.rb b/recipes/_common.rb index abc1234..def5678 100644 --- a/recipes/_common.rb +++ b/recipes/_common.rb @@ -24,6 +24,11 @@ recursive true end +# Some systems (cough BSD) don't create /etc/profile.d +directory '/etc/profile.d' do + recursive true +end + # Create the omnibus directories [ node['omnibus']['install_dir'],
Create /etc/profile.d if it does not exist
diff --git a/recipes/default.rb b/recipes/default.rb index abc1234..def5678 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -1,3 +1,22 @@+# +# Cookbook Name:: ps2dev +# Recipe:: default +# +# Copyright (C) 2012 Mathias Lafeldt <mathias.lafeldt@gmail.com> +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + tmp_dir = "/tmp/toolchain" # Install required Debian packages.
Add copyright header to recipe
diff --git a/recipes/gnu-tar.rb b/recipes/gnu-tar.rb index abc1234..def5678 100644 --- a/recipes/gnu-tar.rb +++ b/recipes/gnu-tar.rb @@ -6,7 +6,7 @@ action [:install, :upgrade] end - link "/usr/bin/tar" do + link "/usr/local/bin/tar" do to "/usr/local/bin/gtar" end when 'debian'
Fix for rootless in 10.11
diff --git a/spec/support/capybara_driver_resolver.rb b/spec/support/capybara_driver_resolver.rb index abc1234..def5678 100644 --- a/spec/support/capybara_driver_resolver.rb +++ b/spec/support/capybara_driver_resolver.rb @@ -4,13 +4,12 @@ # with descriptive names related to the underlying browser's HTML5 support. module CapybaraDriverResolver - # At time of writing: These drivers wrap phantomjs or chrome and they both support - # native date inputs. - WITH_NATIVE_DATE_INPUT = [:poltergeist_billy, :poltergeist, :selenium_chrome_billy] + FIREFOX_DRIVERS = [:selenium_billy, :selenium] + CHROME_DRIVERS = [:selenium_chrome_billy] + PHANTOMJS_DRIVERS = [:poltergeist_billy, :poltergeist] - # At time of writing: These drivers wrap Firefox browsers that don't support native - # date inputs. - WITHOUT_NATIVE_DATE_INPUT = [:selenium_billy, :selenium] + WITH_NATIVE_DATE_INPUT = PHANTOMJS_DRIVERS + CHROME_DRIVERS + WITHOUT_NATIVE_DATE_INPUT = FIREFOX_DRIVERS def driver_with(options)
Clarify browsers driven by Capybara drivers
diff --git a/config/environments/development.rb b/config/environments/development.rb index abc1234..def5678 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -11,7 +11,6 @@ config.cache_classes = ENV["CACHE_CLASSES"] || false config.consider_all_requests_local = true config.eager_load = false - config.middleware.use Rack::LiveReload config.action_view.raise_on_missing_translations = true config.after_initialize do
Remove Rack::LiveReload from dev env config
diff --git a/test/integration_test.rb b/test/integration_test.rb index abc1234..def5678 100644 --- a/test/integration_test.rb +++ b/test/integration_test.rb @@ -0,0 +1,9 @@+require_relative 'test_helper' +require_relative '../lib/yahtzee_game' + +class IntegrationTest < Minitest::Test + def test_integration_between_yahtzee_game_and_dice_roller + game = YahtzeeGame.new + assert 5, game.roll_dice.size + end +end
Add test for integration between YahtzeeGame and DiceRoller.
diff --git a/test/integration/generated_gst_test.rb b/test/integration/generated_gst_test.rb index abc1234..def5678 100644 --- a/test/integration/generated_gst_test.rb +++ b/test/integration/generated_gst_test.rb @@ -20,6 +20,10 @@ it "correctly fetches the name" do _(instance.name).must_equal "sink" end + + it "allows the can-activate-push property to be read" do + _(instance.get_property("can-activate-push")).must_equal true + end end describe "Gst::AutoAudioSink" do
Add integration test demonstrating reading of unknown properties
diff --git a/week-4/concatenate-arrays/my_solution.rb b/week-4/concatenate-arrays/my_solution.rb index abc1234..def5678 100644 --- a/week-4/concatenate-arrays/my_solution.rb +++ b/week-4/concatenate-arrays/my_solution.rb @@ -1,18 +1,37 @@ # Concatenate Two Arrays =begin -INPUT: Obtain two collections of words +INPUT: Obtain two collections of values If both collections are empty THEN return the empty collection -ELSE +else add collection one + collection two THEN + return the combined collections +END IF OUTPUT: Combine the two collections of words into one =end + # I worked on this challenge [by myself]. # Your Solution Below +=begin def array_concat(array_1, array_2) + if (array_1 == nil ) && (array_2 == nil) + return nil + else + combined_array = array_1 + array_2 + return combined_array + end + +end +=end + +def array_concat(array_1, array_2) + + combined_array = array_1 + array_2 + return combined_array + end
Create method to concatenate arrays
diff --git a/lib/redmine_recurring_tasks/issue_presenter.rb b/lib/redmine_recurring_tasks/issue_presenter.rb index abc1234..def5678 100644 --- a/lib/redmine_recurring_tasks/issue_presenter.rb +++ b/lib/redmine_recurring_tasks/issue_presenter.rb @@ -10,7 +10,7 @@ return "#{recurring_task_root.month_days_parsed.join(', ')} #{recurring_task_root.months.map { |m| I18n.t('date.month_names')[m.to_i] }.join(', ')} — #{recurring_task_root.time.to_s(:time)}" end - days = @issue.recurring_task_root.days.map do |field| + days = recurring_task_root.days.map do |field| <<-HTML <li> #{RecurringTask.human_attribute_name(field)}, #{recurring_task_root.time.to_s(:time)}
Fix error on issue page
diff --git a/spec/controllers/get_controller_spec.rb b/spec/controllers/get_controller_spec.rb index abc1234..def5678 100644 --- a/spec/controllers/get_controller_spec.rb +++ b/spec/controllers/get_controller_spec.rb @@ -0,0 +1,36 @@+require 'spec_helper' + +describe GetController do + + let(:service) { double('document_service') } + + before :each do + DocumentService.stub(:build).and_return service + end + + describe 'GET themes' do + pending + end + + describe 'GET documents' do + it 'delegates to the DocumentService' do + service.should_receive(:get).with({type: 'eldis', id: 'A21959', detail: 'full'}) + get :documents, graph: 'eldis', id: 'A21959', detail: 'full' + end + end + + describe 'GET regions' do + pending + end + + describe 'GET countries' do + pending + end + + pending 'content negotiation' + + after :each do + expect(response.headers['Content-Type']).to eq('application/json') + end + +end
Add some controller specs, including pending tasks to be done.
diff --git a/spec/features/admin/admin_games_spec.rb b/spec/features/admin/admin_games_spec.rb index abc1234..def5678 100644 --- a/spec/features/admin/admin_games_spec.rb +++ b/spec/features/admin/admin_games_spec.rb @@ -0,0 +1,59 @@+# frozen_string_literal: true + +require 'rails_helper' + +RSpec.feature 'Admin::Games', level: :feature do + let(:admin) { create(:admin_user) } + let(:game) { create(:game) } + + before { sign_in admin } + + describe '#index' do + before do + @games = create_list(:game, 5) + end + + it 'can see all game' do + visit admin_games_path + @games.each { |game| expect(page).to have_content(game.name) } + end + end + + describe '#new' do + it 'can add new game' do + visit new_admin_game_path + fill_in 'game_name', with: 'Example' + fill_in 'game_description', with: 'Example Description' + fill_in 'game_team', with: 'Team' + attach_file( + 'game_thumbnail', + Rails.root.join('spec', 'support', 'brands', 'logos', 'TGDF.png') + ) + click_button '新增Game' + expect(page).to have_content('Example') + end + end + + describe '#edit' do + it 'can edit game' do + visit edit_admin_game_path(game) + fill_in 'game_name', with: 'New Game Name' + click_button '更新Game' + expect(page).to have_content('New Game Name') + end + end + + describe '#destroy' do + before { @game = create(:game) } + + it 'can destroy game' do + visit admin_games_path + + within first('td', text: @game.name).first(:xpath, './/..') do + click_on 'Destroy' + end + + expect(page).not_to have_content(@game.name) + end + end +end
Add game admin page test
diff --git a/spec/integration/jobs/print_line_job.rb b/spec/integration/jobs/print_line_job.rb index abc1234..def5678 100644 --- a/spec/integration/jobs/print_line_job.rb +++ b/spec/integration/jobs/print_line_job.rb @@ -2,7 +2,7 @@ extend QueueingRabbit::Job class << self - attr_accessor :io + attr_writer :io end queue :print_line_job, :durable => true @@ -10,4 +10,8 @@ def self.perform(arguments = {}) self.io.puts arguments[:line] end + + def self.io + @io ||= STDOUT + end end
Update test PrintLineJob with the default value for io.
diff --git a/google-ads-common.gemspec b/google-ads-common.gemspec index abc1234..def5678 100644 --- a/google-ads-common.gemspec +++ b/google-ads-common.gemspec @@ -5,7 +5,7 @@ Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY - s.name = GEM_NAME + s.name = 'google-ads-common' s.version = AdsCommon::ApiConfig::ADS_COMMON_VERSION s.summary = 'Common code for Google Ads APIs.' s.description = ("%s provides essential utilities shared by all Ads Ruby " +
Fix the gem name in the gem spec
diff --git a/db/seeds.rb b/db/seeds.rb index abc1234..def5678 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -0,0 +1,30 @@+# -*- coding: utf-8 -*- +# Copyright 2014 TIS Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +cloud_aws = Cloud.new +cloud_aws.name = 'cloud-aws' +cloud_aws.cloud_type = 'aws' +cloud_aws.key = '1234567890abcdef' +cloud_aws.secret = '1234567890abcdef' +cloud_aws.tenant_id = nil +cloud_aws.save! + +cloud_openstack = Cloud.new +cloud_openstack.name = 'cloud-openstack' +cloud_openstack.cloud_type = 'openstack' +cloud_openstack.key = '1234567890abcdef' +cloud_openstack.secret = '1234567890abcdef' +cloud_openstack.tenant_id = '1234567890abcdef' +cloud_openstack.save!
Add seed data to create system record
diff --git a/db/seeds.rb b/db/seeds.rb index abc1234..def5678 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -6,10 +6,10 @@ # Create quotes quotes = [ - { name: "Albert Einstein", source: "", content: "Insanity: doing the same thing over and over again and expecting different results." }, - { name: "ゾロ", source: "ワンピース", content: "三本でもおれとお前の剣の、一本の重みは同じじゃねェよ!!!!!" }, - { name: "张爱玲", source: "十八春", content: "日子过得真快,尤其对于中年以后的人,十年八年都好象是指顾间的事。可是对于年轻人,三年五载就可以是一生一世。" }, + { author: "Albert Einstein", source: "", content: "Insanity: doing the same thing over and over again and expecting different results." }, + { author: "ゾロ", source: "ワンピース", content: "三本でもおれとお前の剣の、一本の重みは同じじゃねェよ!!!!!" }, + { author: "张爱玲", source: "十八春", content: "日子过得真快,尤其对于中年以后的人,十年八年都好象是指顾间的事。可是对于年轻人,三年五载就可以是一生一世。" }, ] quotes.each do |quote| - user.quotes.create!(name: quote[:name], source: quote[:source], content: quote[:content]) + user.quotes.create!(author: quote[:author], source: quote[:source], content: quote[:content]) end
Fix attributes name on db/seed
diff --git a/safe_shell.gemspec b/safe_shell.gemspec index abc1234..def5678 100644 --- a/safe_shell.gemspec +++ b/safe_shell.gemspec @@ -18,7 +18,7 @@ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } s.require_paths = ["lib"] - s.extra_rdoc_files = ["LICENSE", "README.rdoc"] + s.extra_rdoc_files = ["LICENSE", "README.md"] s.required_ruby_version = ">= 2.0.0" end
Fix gemspec to refer to the renamed README
diff --git a/features/step_definitions/admin_steps.rb b/features/step_definitions/admin_steps.rb index abc1234..def5678 100644 --- a/features/step_definitions/admin_steps.rb +++ b/features/step_definitions/admin_steps.rb @@ -13,6 +13,15 @@ expect(page).to_not have_link(link) end -Then(/^there should be (\d+) activities pending approval$/) do |num| +Then(/^there should be (\d+) (?:|activity|activities|day|days|) pending approval$/) do |num| expect(page).to have_content("Reason", :count => num.to_i + 1) # +1 for header end + +When(/^I check an activity|day$/) do + find(:css, "#selected_[value='2']").set(true) +end + +When(/^I hit "(.*?)"$/) do |button| + click_button(button) +end +
Add checking action for pending activity checkboxes; use hit instead of press to get around weird text encoding for buttons
diff --git a/test/unit/page_test.rb b/test/unit/page_test.rb index abc1234..def5678 100644 --- a/test/unit/page_test.rb +++ b/test/unit/page_test.rb @@ -1,38 +1,17 @@ require 'test_helper' class PageTest < ActiveSupport::TestCase - context "Page:" do - setup do - @theme = Theme.create(:name => "theme") - @site = Site.create(:subdomain => "my_site", :theme => @theme) + context "A page" do + should_validate_presence_of :template_name, :body + + should "know its liquid name" do + assert_equal "page", Page.make.liquid_name end - - context "An instance of a Page" do - setup do - @valid_attributes = { - :title => "Test Page Title", - :theme_id => @theme.id, - :site_id => @site.id, - :template_name => 'page.tpl' - } - def create_page(options={}) - Page.create(@valid_attributes.merge(options)) - end - end - - should "save with valid attributes" do - assert_difference 'Page.count' do - page = create_page - assert page.errors.blank? - end - end - - should "require a template name" do - assert_no_difference 'Page.count' do - page = create_page(:template_name => '') - assert page.errors.on(:template_name) - end - end + + should "have a default template name of page.tpl on initialize" do + assert_equal "page.tpl", Page.new.template_name end + + should_eventually "return its template" end end
Rewrite Page tests. * Require body * Require template name * Validate default template name
diff --git a/core/spec/screenshots/admin_page_spec.rb b/core/spec/screenshots/admin_page_spec.rb index abc1234..def5678 100644 --- a/core/spec/screenshots/admin_page_spec.rb +++ b/core/spec/screenshots/admin_page_spec.rb @@ -1,6 +1,6 @@ require 'screenshot_helper' -describe "factlink", type: :request do +describe "factlink", type: :feature do before :each do Timecop.travel Time.local(1989, 11, 6, 11, 22, 33)
Update als the admin test :)_
diff --git a/test/fitbit_client/util_test.rb b/test/fitbit_client/util_test.rb index abc1234..def5678 100644 --- a/test/fitbit_client/util_test.rb +++ b/test/fitbit_client/util_test.rb @@ -0,0 +1,17 @@+require 'test_helper' + +module FitbitClient + class UtilTest < Minitest::Test + def test_iso_date + assert_equal '2017-02-03', client.send(:iso_date, Date.parse('2017-02-03')) + end + + def test_iso_time + assert_equal '14:01', client.send(:iso_time, Time.new(2017, 4, 5, 14, 1, 1, '+02:00')) + end + + def test_iso_time_with_seconds + assert_equal '14:01:59', client.send(:iso_time_with_seconds, Time.new(2017, 4, 5, 14, 1, 59, '+02:00')) + end + end +end
Add tests for Util module
diff --git a/spec/graph_spec.rb b/spec/graph_spec.rb index abc1234..def5678 100644 --- a/spec/graph_spec.rb +++ b/spec/graph_spec.rb @@ -16,4 +16,19 @@ end + describe 'Node' do + + describe 'new' do + + it "should create a new node with the given value and no incoming or outgoing nodes" do + node1 = Graph::Node.new(11) + node1.value.should eq(11) + node1.incoming.empty?.should eq(true) + node1.outgoing.empty?.should eq(true) + end + + end + + end + end
Add a spec for initializing the node class as well.
diff --git a/app/controllers/spree/user_registrations_controller_decorator.rb b/app/controllers/spree/user_registrations_controller_decorator.rb index abc1234..def5678 100644 --- a/app/controllers/spree/user_registrations_controller_decorator.rb +++ b/app/controllers/spree/user_registrations_controller_decorator.rb @@ -7,6 +7,7 @@ def build_resource(*args) super if session[:omniauth] + @spree_user = self.resource @spree_user.apply_omniauth(session[:omniauth]) end @spree_user
Fix for @spree_user being nil
diff --git a/black_list.rb b/black_list.rb index abc1234..def5678 100644 --- a/black_list.rb +++ b/black_list.rb @@ -7,5 +7,6 @@ ["coq-compcert.3.2.0", "Error: Corrupted compiled interface"], # flaky Makefile ["coq-compcert.3.3.0", "Error: Corrupted compiled interface"], # flaky Makefile ["coq-compcert.3.6", "Error: Corrupted compiled interface"], # flaky Makefile + ["coq-metacoq-erasure.1.0~alpha+8.8", "make inconsistent assumptions over interface Quoter"], ["coq-stalmarck.8.5.0", "Error: Could not find the .cmi file for interface stal.mli."] # flaky Makefile ]
Add coq-metacoq-erasure to the black list
diff --git a/blimp.gemspec b/blimp.gemspec index abc1234..def5678 100644 --- a/blimp.gemspec +++ b/blimp.gemspec @@ -4,18 +4,18 @@ require 'blimp/version' Gem::Specification.new do |gem| - gem.name = "blimp" + gem.name = 'jonahoffline-blimp' gem.version = Blimp::VERSION - gem.authors = ["Blake Williams", "Sixteen Eighty"] - gem.email = ["blake@blakewilliams.me"] + gem.authors = ['Blake Williams', 'Jonah Ruiz'] + gem.email = ['jonah@pixelhipsters.com'] gem.description = %q{Ruby gem that implements the Blimp Public API http://dev.getblimp.com/} gem.summary = %q{Ruby bindings to the Blimp API} - gem.homepage = "" + gem.homepage = 'https://github.com/jonahoffline/blimp' + gem.license = 'MIT' gem.files = `git ls-files`.split($/) gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) } gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) - gem.require_paths = ["lib"] - gem.add_dependency('httparty') - gem.add_dependency('active_support') + gem.require_paths = ['lib'] + gem.add_development_dependency 'httparty', '~> 0.11.0' end
Update gemspec authors, email and gem name for this fork
diff --git a/lib/alpha_taxonomy/bulk_import_report.rb b/lib/alpha_taxonomy/bulk_import_report.rb index abc1234..def5678 100644 --- a/lib/alpha_taxonomy/bulk_import_report.rb +++ b/lib/alpha_taxonomy/bulk_import_report.rb @@ -0,0 +1,83 @@+module AlphaTaxonomy + class BulkImportReport + include AlphaTaxonomy::Helpers::ImportFileHelper + + def initialize(logger: Logger.new(STDOUT)) + @log = logger + end + + def view + check_import_file_is_present + @no_alpha_taxon = [] + @no_content_item = [] + @updated = [] + + grouped_mappings.each do |path, _taxon_titles| + determine_update_state_of(path) + end + + log_summary + end + + private + + def grouped_mappings + @grouped_mappings ||= ImportFile.new.grouped_mappings + end + + def determine_update_state_of(path) + content_item = Services.content_store.content_item(path) + + if content_item.blank? + @no_content_item << { path: path } + return + end + + if content_item.links["alpha_taxons"].blank? + @no_alpha_taxon << { path: path, cid: content_item.content_id } + else + @updated << { path: path, cid: content_item.content_id } + end + end + + def log_summary + @log.info "BULK IMPORT SUMMARY" + log_no_alpha_taxons + log_no_content_items + log_updated + log_numbers + end + + def log_numbers + @log.info "Total #{@grouped_mappings.count}" + @log.info "No alpha taxon: #{@no_alpha_taxon.count}" + @log.info "No content item found: #{@no_content_item.count}" + @log.info "Updated: #{@updated.count}" + @log.info "#{@no_alpha_taxon.count + @no_content_item.count + @updated.count} of #{@grouped_mappings.count} accounted for" + end + + def log_no_alpha_taxons + @log.info "************** No alpha taxon **************" + @no_alpha_taxon.each do |bad_update| + @log.info "#{bad_update[:cid]} - #{bad_update[:path]}" + end + @log.info "" + end + + def log_no_content_items + @log.info "************** No content item **************" + @no_content_item.each do |bad_update| + @log.info "#{bad_update[:path]}" + end + @log.info "" + end + + def log_updated + @log.info "************** Updated **************" + @updated.each do |good_update| + @log.info "#{good_update[:cid]} - #{good_update[:path]}" + end + @log.info "" + end + end +end
Add some basic reporting on the state of the alpha taxonomy import This reads the current import file and writes a summary to the logger.
diff --git a/lib/dpla.rb b/lib/dpla.rb index abc1234..def5678 100644 --- a/lib/dpla.rb +++ b/lib/dpla.rb @@ -1,5 +1,7 @@ require 'active_triples' require 'linked_vocabs' + +Dir["rdf/*.rb"].each {|file| require file } module DPLA LinkedVocabs.add_vocabulary(:aat, 'http://vocab.getty.edu/aat/')
Add requires for generated RDF vocabularies
diff --git a/cube-ruby-gem.gemspec b/cube-ruby-gem.gemspec index abc1234..def5678 100644 --- a/cube-ruby-gem.gemspec +++ b/cube-ruby-gem.gemspec @@ -0,0 +1,27 @@+# -*- encoding: utf-8 -*- +require File.expand_path('../lib/cube/version', __FILE__) + +Gem::Specification.new do |gem| + gem.authors = ["Ticean Bennett"] + gem.email = ["ticean@promojam.com"] + gem.description = "Ruby client for Cube." + gem.summary = "Ruby client for Cube." + gem.homepage = "https://github.com/culturejam/cube-ruby-gem" + gem.license = "Apache 2.0" + + gem.files = `git ls-files`.split($\) + gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) } + gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) + gem.name = "cube-ruby-gem" + gem.require_paths = ["lib"] + gem.version = Cube::VERSION + + gem.add_dependency "faraday", "~> 0.8.8" + gem.add_dependency "faraday_middleware", "~> 0.8.0" + gem.add_development_dependency "license_finder" + gem.add_development_dependency "pry" + gem.add_development_dependency "rake" + gem.add_development_dependency "rspec", "~> 2.11.0" + gem.add_development_dependency "rubocop" + gem.add_development_dependency "simplecov" +end
Add rubocop dependency for style checking
diff --git a/lib/effective_resources/effective_gem.rb b/lib/effective_resources/effective_gem.rb index abc1234..def5678 100644 --- a/lib/effective_resources/effective_gem.rb +++ b/lib/effective_resources/effective_gem.rb @@ -8,6 +8,7 @@ config_keys.each do |key| self.singleton_class.define_method(key) { config()[key] } + self.singleton_class.define_method("#{key}=") { |value| config()[key] = value } end end
Add the config setter methods as well
diff --git a/lib/braid/commands/add.rb b/lib/braid/commands/add.rb index abc1234..def5678 100644 --- a/lib/braid/commands/add.rb +++ b/lib/braid/commands/add.rb @@ -9,7 +9,7 @@ branch_message = (mirror.branch == "master") ? "" : " branch '#{mirror.branch}'" revision_message = options["revision"] ? " at #{display_revision(mirror, options["revision"])}" : "" - msg "Adding #{mirror.type} mirror of '#{mirror.url}'#{branch_message}#{revision_message}." + msg "Adding mirror of '#{mirror.url}'#{branch_message}#{revision_message}." # these commands are explained in the subtree merge guide # http://www.kernel.org/pub/software/scm/git/docs/howto/using-merge-subtree.html
Stop emitting the type in notification
diff --git a/lib/milkman/authorizer.rb b/lib/milkman/authorizer.rb index abc1234..def5678 100644 --- a/lib/milkman/authorizer.rb +++ b/lib/milkman/authorizer.rb @@ -15,14 +15,18 @@ def authorize puts I18n.t("milkman.authorization.frob_message", url: frob_message_url) - - signed_options = sign options[:shared_secret], options.merge!(method: "rtm.auth.getToken", frob: frob) - response = Milkman::Request.call request_url(signed_options) - puts I18n.t("milkman.authorization.auth_token_message", username: response["rsp"]["auth"]["user"]["username"], api_key: options[:api_key], shared_secret: options[:shared_secret], auth_token: response["rsp"]["auth"]["token"]) end private + + def response + @response ||= Milkman::Request.call request_url(signed_options) + end + + def signed_options + sign options[:shared_secret], options.merge!(method: "rtm.auth.getToken", frob: frob) + end def frob STDIN.gets.strip
Split up the authorize method into multiple methods.
diff --git a/lib/redimap/redis_conn.rb b/lib/redimap/redis_conn.rb index abc1234..def5678 100644 --- a/lib/redimap/redis_conn.rb +++ b/lib/redimap/redis_conn.rb @@ -5,8 +5,8 @@ module Redimap class RedisConn - QUEUE_QUEUE = 'redimap' - QUEUE_CLASS = 'RedimapJob' + @@RESCUE_QUEUE = 'redimap' + @@RESCUE_CLASS = 'RedimapJob' attr_accessor :redis @@ -16,7 +16,7 @@ @KEYS = { :redimap_mailboxes => "#{Redimap.config.redis_ns_redimap}:mailboxes", :rescue_queues => "#{Redimap.config.redis_ns_queue}:queues", - :rescue_queue_redimap => "#{Redimap.config.redis_ns_queue}:queue:#{QUEUE_QUEUE}", + :rescue_queue_redimap => "#{Redimap.config.redis_ns_queue}:queue:#{@@RESCUE_QUEUE}", }.freeze if block_given? @@ -50,11 +50,11 @@ def queue_mailbox_uid(mailbox, uid) @redis.sadd( @KEYS[:rescue_queues], - QUEUE_QUEUE + @@RESCUE_QUEUE ) payload = { - :class => QUEUE_CLASS, + :class => @@RESCUE_CLASS, :args => [mailbox, uid] }.to_json
Reduce visibility of RedisConn constants, renaming. Nothing outside of RedisConn needs to know the precise implementation of the Redis key names.
diff --git a/lib/tasks/early_bird.rake b/lib/tasks/early_bird.rake index abc1234..def5678 100644 --- a/lib/tasks/early_bird.rake +++ b/lib/tasks/early_bird.rake @@ -3,7 +3,7 @@ task :early_bird, [] => :environment do begin if PqaImportRun.ready_for_early_bird - if (Time.zone.today < Date.new(2019, 9, 10)) || (Time.zone.today > Date.new(2019, 9, 24)) + if (Time.zone.today < Date.new(2019, 11, 6)) || (Time.zone.today > Date.new(2019, 12, 19)) LogStuff.info { 'Early Bird: Preparing to queue early bird mails' } service = EarlyBirdReportService.new service.notify_early_bird
Extend early bird email suppression until 19.12.2019
diff --git a/lib/vagrant-vbguest/installers/oracle.rb b/lib/vagrant-vbguest/installers/oracle.rb index abc1234..def5678 100644 --- a/lib/vagrant-vbguest/installers/oracle.rb +++ b/lib/vagrant-vbguest/installers/oracle.rb @@ -10,7 +10,13 @@ protected def dependencies - ['kernel-uek-devel-`uname -r`', 'gcc', 'make', 'perl', 'bzip2'].join(' ') + [ + 'kernel-`uname -a | grep -q "uek." && echo "uek-"`devel-`uname -r`', + 'gcc', + 'make', + 'perl', + 'bzip2' + ].join(' ') end end end
Support Oracle with non UEK kernel [#357]
diff --git a/lib/cocoapods-downloader/subversion.rb b/lib/cocoapods-downloader/subversion.rb index abc1234..def5678 100644 --- a/lib/cocoapods-downloader/subversion.rb +++ b/lib/cocoapods-downloader/subversion.rb @@ -3,7 +3,7 @@ class Subversion < Base def self.options - [:revision, :tag, :folder] + [:revision, :tag, :folder, :checkout] end def options_specific? @@ -23,7 +23,8 @@ executable :svn def download! - output = svn!(%|#{export_subcommand} "#{reference_url}" "#{target_path}"|) + subcommand = options[:checkout] ? checkout_subcommand : export_subcommand + output = svn!(%|#{subcommand} "#{reference_url}" "#{target_path}"|) store_exported_revision(output) end @@ -39,6 +40,10 @@ def export_subcommand result = 'export --non-interactive --trust-server-cert --force' + end + + def checkout_subcommand + result = 'checkout --non-interactive --trust-server-cert --force' end def reference_url
Add :checkout option to allow checkinable pod when using --no-clean The svn downloader uses export instead of checkout by default since https://github.com/CocoaPods/CocoaPods/pull/473. But having a "checkin-able" pod is still usefull for the Pods developpers even if it has been aggreed to be a minority-use case. (from https://github.com/CocoaPods/CocoaPods/issues/245 discussion).
diff --git a/modules/shell/spec/classes/shell_spec.rb b/modules/shell/spec/classes/shell_spec.rb index abc1234..def5678 100644 --- a/modules/shell/spec/classes/shell_spec.rb +++ b/modules/shell/spec/classes/shell_spec.rb @@ -0,0 +1,10 @@+require_relative '../../../../spec_helper' + +describe 'shell', :type => :class do + + it { is_expected.to compile } + + it { is_expected.to compile.with_all_deps } + + it { is_expected.to contain_class('shell') } +end
Add stub rspec test to shell module
diff --git a/lib/byebug/interfaces/local_interface.rb b/lib/byebug/interfaces/local_interface.rb index abc1234..def5678 100644 --- a/lib/byebug/interfaces/local_interface.rb +++ b/lib/byebug/interfaces/local_interface.rb @@ -21,7 +21,7 @@ # def readline(prompt) with_repl_like_sigint do - Readline.readline(prompt, false) || EOF_ALIAS + Readline.readline(prompt) || EOF_ALIAS end end
Remove method arg that's false implicitly This is more concise and equally readable.
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -8,7 +8,7 @@ version '6.1.2' source_url 'https://github.com/sous-chefs/postgresql' issues_url 'https://github.com/sous-chefs/postgresql/issues' -chef_version '>= 12.16' if respond_to?(:chef_version) +chef_version '>= 13.8' %w(ubuntu debian fedora amazon redhat centos scientific oracle).each do |os| supports os
Update minimum chef to 13.8+
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -1,9 +1,9 @@-maintainer "Peter Donald" -maintainer_email "peter@realityforge.org" -license "Apache 2.0" -description "Installs/Configures logstash in agent mode" +maintainer 'Peter Donald' +maintainer_email 'peter@realityforge.org' +license 'Apache 2.0' +description 'Installs/Configures logstash in agent mode' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version "0.0.1" +version '0.0.1' -depends "java" +depends 'java' depends 'authbind'
Use string literals where possible
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -1,9 +1,12 @@ name 'sbp_cloudmonkey' maintainer 'Sander van Harmelen' maintainer_email 'svanharmelen@schubergphilis.com' +chef_version '>= 12.14' license 'Apache 2.0' description 'Installs/Configures cloudmonkey' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +issues_url 'https://github.com/schubergphilis/sbp_cloudmonkey/issues' +source_url 'https://github.com/schubergphilis/sbp_cloudmonkey' version '0.1.3' %w(debian centos redhat ubuntu).each do |os|
Add chef_version, issues_url & source_url
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -1,7 +1,7 @@ name 'mysql2_chef_gem' maintainer 'Nicolas Blanc' maintainer_email 'sinfomicien@gmail.com' -license 'Apache 2.0' +license 'Apache-2.0' description 'Provides the mysql2_chef_gem resource' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) version '2.0.1'
Use a SPDX compliant license string to resolve Foodcritic warnings Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -12,7 +12,7 @@ supports os end -depends 'compat_resource', '>= 12.14' +depends 'compat_resource', '>= 12.14.6' source_url 'https://github.com/chef-cookbooks/chef-apt-docker' issues_url 'https://github.com/chef-cookbooks/chef-apt-docker/issues'
Make sure we have a working compat_resource Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -16,7 +16,7 @@ depends 'chef-vault' depends 'chocolatey' -depends 'golang', '~> 1.4' +depends 'golang' depends 'firewall', '~> 1.6' depends 'libartifact', '~> 1.3' depends 'poise', '~> 2.2'
Remove opinionated lock on golang Hi @johnbellone, The lock on `golang` is too opinionated, folks should be able to lock themselves (or default to unlocked) in my opinion. Thanks in advance
diff --git a/lib/postgres-fulltext-search-helper.rb b/lib/postgres-fulltext-search-helper.rb index abc1234..def5678 100644 --- a/lib/postgres-fulltext-search-helper.rb +++ b/lib/postgres-fulltext-search-helper.rb @@ -3,7 +3,7 @@ module PostgresFulltextSearchHelper extend self - POSTGRES_TSQUERY_SENSITIVE_CHARACTERS = /[|&!():\* ]/ + POSTGRES_TSQUERY_SENSITIVE_CHARACTERS = /[<>|&!():\* ]/ def format_query_for_fulltext(query) parts = query.split(POSTGRES_TSQUERY_SENSITIVE_CHARACTERS).delete_if{|x| x.strip.empty? }
Make compatible with pg 11.4 FOLLOWED BY operator
diff --git a/lib/puppet/provider/package/docker_el.rb b/lib/puppet/provider/package/docker_el.rb index abc1234..def5678 100644 --- a/lib/puppet/provider/package/docker_el.rb +++ b/lib/puppet/provider/package/docker_el.rb @@ -6,7 +6,7 @@ def dockerfile_line(context) version = @resource[:ensure] - script = "CMD yum install #{@resource[:name]}" + script = "CMD yum install #{@resource[:name]} -y" case version when :latest
Add the -y flag to the yum command
diff --git a/lib/turnip_formatter/ext/turnip/rspec.rb b/lib/turnip_formatter/ext/turnip/rspec.rb index abc1234..def5678 100644 --- a/lib/turnip_formatter/ext/turnip/rspec.rb +++ b/lib/turnip_formatter/ext/turnip/rspec.rb @@ -29,7 +29,15 @@ steps = background_steps + scenario.steps tags = (feature.tag_names + scenario.tag_names).uniq - example.metadata[:turnip_formatter] = { steps: steps, tags: tags } + example.metadata[:turnip_formatter] = { + # Turnip::Scenario (Backward compatibility) + steps: steps, + tags: tags, + + # Turnip::Resource::Scenairo + feature: feature, + scenario: scenario, + } end end end
Add parameters for new scenario resource class.
diff --git a/Library/Homebrew/cask/lib/hbc/auditor.rb b/Library/Homebrew/cask/lib/hbc/auditor.rb index abc1234..def5678 100644 --- a/Library/Homebrew/cask/lib/hbc/auditor.rb +++ b/Library/Homebrew/cask/lib/hbc/auditor.rb @@ -4,10 +4,9 @@ saved_languages = MacOS.instance_variable_get(:@languages) if languages_blocks = cask.instance_variable_get(:@dsl).instance_variable_get(:@language_blocks) - languages_blocks.keys.map(&:first).each do |language| - ohai "Auditing language #{language.to_s}" - language = "en-US" if language == :default - MacOS.instance_variable_set(:@languages, [language]) + languages_blocks.keys.each do |languages| + ohai "Auditing language: #{languages.map { |lang| "'#{lang}'" }.join(", ")}" + MacOS.instance_variable_set(:@languages, languages) audit_cask_instance(Hbc.load(cask.sourcefile_path), audit_download, check_token_conflicts) CLI::Cleanup.run(cask.token) if audit_download end
Refactor audit for changed DSL.
diff --git a/lib/active_record/base_without_table.rb b/lib/active_record/base_without_table.rb index abc1234..def5678 100644 --- a/lib/active_record/base_without_table.rb +++ b/lib/active_record/base_without_table.rb @@ -3,7 +3,7 @@ self.abstract_class = true def create_or_update_without_callbacks - self.new_record? ? create_without_callbacks : update_without_callbacks + self.new_record? ? create : update end def create_without_callbacks @new_record = false if answer = errors.empty?
Fix problem where before/after create/update callbacks not being called properly.