diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/lib/protopuffs/parser/parser.rb b/lib/protopuffs/parser/parser.rb index abc1234..def5678 100644 --- a/lib/protopuffs/parser/parser.rb +++ b/lib/protopuffs/parser/parser.rb @@ -7,7 +7,7 @@ class ProtocolBufferDescriptor def initialize - Treetop.load "lib/protopuffs/parser/protocol_buffer" + Treetop.load File.join(File.dirname(__FILE__), "protocol_buffer") @parser = Protopuffs::ProtocolBufferParser.new end
Fix that loading the message descriptor grammar file only worked from certain working directories
diff --git a/lib/sass/tree/mixin_def_node.rb b/lib/sass/tree/mixin_def_node.rb index abc1234..def5678 100644 --- a/lib/sass/tree/mixin_def_node.rb +++ b/lib/sass/tree/mixin_def_node.rb @@ -1,14 +1,25 @@ module Sass module Tree + # A dynamic node representing a mixin definition. + # + # @see Sass::Tree class MixinDefNode < Node + # @param name [String] The mixin name + # @param args [Array<(String, Script::Node)>] The arguments for the mixin. + # Each element is a tuple containing the name of the argument + # and the parse tree for the default value of the argument def initialize(name, args, options) @name = name @args = args super(options) end - private + protected + # Loads the mixin into the environment. + # + # @param environment [Sass::Environment] The lexical environment containing + # variable and mixin values def _perform(environment) environment.set_mixin(@name, Sass::Mixin.new(@name, @args, environment, children)) []
[Sass] Convert Sass::Tree::MixinDefNode docs to YARD.
diff --git a/DMHeatmap.podspec b/DMHeatmap.podspec index abc1234..def5678 100644 --- a/DMHeatmap.podspec +++ b/DMHeatmap.podspec @@ -8,6 +8,6 @@ s.social_media_url = "http://twitter.com/moltman" s.platform = :ios s.source = { :git => "https://github.com/dataminr/DMHeatmap.git", :tag => '1' } - s.source_files = '*.{h,m}', 'Heatmaps/*' + s.source_files = '*.{h,m}', 'Heatmaps/*', 'Color Providers/*' s.requires_arc = true end
Add color providers to podspec
diff --git a/lib/lftruncator.rb b/lib/lftruncator.rb index abc1234..def5678 100644 --- a/lib/lftruncator.rb +++ b/lib/lftruncator.rb @@ -8,6 +8,7 @@ opts = DEFAULT_OPTIONS.merge(opts) doc = Nokogiri::HTML::DocumentFragment.parse(text) doc.search("img").remove + doc.css(".sommaire,.toc").remove doc.truncate(max, opts).first end
Remove the table of contents from listing pages
diff --git a/spec/unit/recipes/git_spec.rb b/spec/unit/recipes/git_spec.rb index abc1234..def5678 100644 --- a/spec/unit/recipes/git_spec.rb +++ b/spec/unit/recipes/git_spec.rb @@ -10,9 +10,9 @@ expect(windows_chef_run).to install_chocolatey_package('git-credential-manager-for-windows') end - it 'installs poshgit' do - expect(windows_chef_run).to install_chocolatey_package('poshgit') - end + # it 'installs poshgit' do + # expect(windows_chef_run).to install_chocolatey_package('poshgit') + # end end context 'On a Mac' do
Remove poshgit from unit tests
diff --git a/create_project.rb b/create_project.rb index abc1234..def5678 100644 --- a/create_project.rb +++ b/create_project.rb @@ -0,0 +1,21 @@+require 'xcodeproj' +require 'trollop' + +opts = Trollop::options do + opt :name, "The name of the project", type: String +end + +name = opts[:name] + +Trollop::die :name, "name must be specified" if name.nil? + +puts opts + +proj = Xcodeproj::Project.new("#{name}.xcodeproj") + +app_target = proj.new_target(:application, 'App', :ios, '8.0') +header_ref = proj.main_group.new_file('./Class.h') +implm_ref = proj.main_group.new_file('./Class.m') +app_target.add_file_references([implm_ref]) + +proj.save
Create an XCode Project from the commandline.
diff --git a/puppet-parse.gemspec b/puppet-parse.gemspec index abc1234..def5678 100644 --- a/puppet-parse.gemspec +++ b/puppet-parse.gemspec @@ -15,7 +15,7 @@ gem.require_paths = ["lib"] gem.version = PuppetParse::VERSION - gem.add_development_dependency "rspec" + gem.add_development_dependency "rspec", ">=2.12.0", "<3.0" gem.add_development_dependency "rake" gem.add_runtime_dependency "rdoc", ">=3.12", "<4.0" gem.add_runtime_dependency "facter"
Define rspec version - tests don't work with rspec 3+
diff --git a/CascadingTableDelegate.podspec b/CascadingTableDelegate.podspec index abc1234..def5678 100644 --- a/CascadingTableDelegate.podspec +++ b/CascadingTableDelegate.podspec @@ -4,7 +4,7 @@ s.summary = 'A no-nonsense way to write cleaner `UITableViewDelegate` and `UITableViewDataSource`.' s.description = <<-DESC -CascadingTableDelegate allows you to propagate `UITableViewDelegate` and `UITableViewDataSource` method calls to several objects, based by the `NSIndexPath` of the method's parameter. +CascadingTableDelegate allows you to propagate `UITableViewDelegate` and `UITableViewDataSource` method calls to several objects, based by the `IndexPath` of the method's parameter. DESC s.homepage = 'https://github.com/edopelawi/CascadingTableDelegate'
Change NSIndexPath to IndexPath in podspec
diff --git a/Casks/pinegrow-web-designer.rb b/Casks/pinegrow-web-designer.rb index abc1234..def5678 100644 --- a/Casks/pinegrow-web-designer.rb +++ b/Casks/pinegrow-web-designer.rb @@ -1,14 +1,14 @@ cask :v1 => 'pinegrow-web-designer' do - version :latest - sha256 :no_check + version '2.00' + sha256 '9cfaf6538e52d00022f928dd109f1bb064af7f4a42c01cce83c10ba18957a081' # amazonaws.com is the official download host per the vendor homepage - url 'https://pinegrow.s3.amazonaws.com/PinegrowMac.zip' + url "https://pinegrow.s3.amazonaws.com/PinegrowMac.#{version}.dmg" name 'Pinegrow' name 'Pinegrow Web Editor' name 'Pinegrow Web Designer' homepage 'http://pinegrow.com/' - license :unknown # todo: change license and remove this comment; ':unknown' is a machine-generated placeholder + license :commercial app 'Pinegrow Web Designer.app' end
Update Pinegrow Web Designer.app to verion 2.0
diff --git a/spec/class_file_finder_spec.rb b/spec/class_file_finder_spec.rb index abc1234..def5678 100644 --- a/spec/class_file_finder_spec.rb +++ b/spec/class_file_finder_spec.rb @@ -6,7 +6,9 @@ Dir.mkdir 'dummy' ['foo', 'bar'].each do |name| - File.write("dummy/#{ name }.rb", '') + out_file = File.new("dummy/#{ name }.rb", 'w') + out_file.puts("class #{ name.upcase }; end;") + out_file.close end end @@ -25,7 +27,9 @@ context 'Excluded files' do it 'that do not have a .rb extension' do - File.write('dummy/foo_config.txt', '') + out_file = File.new('dummy/foo_config.txt', 'w') + out_file.puts('class FooConfig; end;') + out_file.close finder = ABCing::ClassFileFinder.new(['dummy']) expect(finder.find).to eq(expected_results)
Revert "Clean up file finder spec since it no longer scans for class keyword match" This reverts commit 57d28a47210f561daf6c0fe4184bb012cef92063.
diff --git a/spec/runtime/gem_tasks_spec.rb b/spec/runtime/gem_tasks_spec.rb index abc1234..def5678 100644 --- a/spec/runtime/gem_tasks_spec.rb +++ b/spec/runtime/gem_tasks_spec.rb @@ -0,0 +1,32 @@+require "spec_helper" + +describe "require 'bundler/gem_tasks'" do + before :each do + bundled_app("foo.gemspec").open("w") do |f| + f.write <<-GEMSPEC + Gem::Specification.new do |s| + s.name = "foo" + end + GEMSPEC + end + bundled_app("Rakefile").open("w") do |f| + f.write <<-RAKEFILE + $:.unshift("#{bundler_path}") + require "bundler/gem_tasks" + RAKEFILE + end + end + + it "includes the relevant tasks" do + sys_exec "rake -T" + expect(err).to eq("") + expected_tasks = [ + "rake build", + "rake install", + "rake release", + ] + tasks = out.lines.to_a.map { |s| s.split('#').first.strip } + expect(tasks & expected_tasks).to eq(expected_tasks) + expect(exitstatus).to eq(0) if exitstatus + end +end
[GemTasks] Add a basic spec that the relevant tasks are installed
diff --git a/spec/unit/command/repo_spec.rb b/spec/unit/command/repo_spec.rb index abc1234..def5678 100644 --- a/spec/unit/command/repo_spec.rb +++ b/spec/unit/command/repo_spec.rb @@ -19,11 +19,11 @@ end it "supports a repo with a compatible maximum version" do - versions = { 'max' => '0.7' } + versions = { 'max' => '0.999' } @command.class.send(:is_compatilbe, versions).should == true end - it "doesn't supports a repo with a compatible maximum version" do + it "doesn't support a repo with an incompatible maximum version" do versions = { 'max' => '0.5' } @command.class.send(:is_compatilbe, versions).should == false end
Fix repo max version spec work for the foreseeable future.
diff --git a/lib/impasta/missing_method.rb b/lib/impasta/missing_method.rb index abc1234..def5678 100644 --- a/lib/impasta/missing_method.rb +++ b/lib/impasta/missing_method.rb @@ -28,7 +28,7 @@ end def message - "invalid message `#{method_info}' for #{target_info}" + "invalid message #{method_info} for #{target_info}" end def target_info
Remove excess quotes, they are in the method now
diff --git a/Raccoon.podspec b/Raccoon.podspec index abc1234..def5678 100644 --- a/Raccoon.podspec +++ b/Raccoon.podspec @@ -13,7 +13,7 @@ spec.author = "Manuel García-Estañ" spec.social_media_url = "http://twitter.com/ManueGE" - spec.platform = :ios, "8.0" + spec.platform = :ios, "9.0" spec.source = { :git => "https://github.com/ManueGE/Raccoon.git", :tag => "#{spec.version}" } spec.requires_arc = true
Change minimum version to iOS 9
diff --git a/lib/slg-meta/traced_method.rb b/lib/slg-meta/traced_method.rb index abc1234..def5678 100644 --- a/lib/slg-meta/traced_method.rb +++ b/lib/slg-meta/traced_method.rb @@ -3,24 +3,26 @@ module SLG module Meta class TracedMethod - attr_reader :base, :method, :type, :call_count + attr_reader :base_name, :method, :type, :call_count def self.for(method_id_string) - method_id_string =~ /(.*)([#\.])(.*)/ - base, type, method = $1.strip, $2, $3.strip - base = Kernel.const_lookup(base) - type = type == '#' ? :instance : :singleton - method = method.to_sym - new(base, type, method) + md = /(.*)([#\.])(.*)/.match(method_id_string) + base_name = md.captures[0].gsub(/\s+/, '') + type = md.captures[1] == '#' ? :instance : :singleton + method = md.captures[2].strip.to_sym + new(base_name, type, method) end def initialize(base, type, method) - @base, @type, @method = base, type, method + @base = base unless base.kind_of?(String) # allow setting class directly (facilitates testing) + @base_name = base.to_s + @type = type + @method = method @call_count = 0 end - def base_name - base.to_s + def base + @base ||= Kernel.const_lookup(base_name) end def called! @@ -34,7 +36,7 @@ def to_s separator = type == :instance ? '#' : '.' - [base, separator, method].join + [base_name, separator, method].join end private
Refactor TracedMethod to defer const_lookup somewhat
diff --git a/opal-jquery.gemspec b/opal-jquery.gemspec index abc1234..def5678 100644 --- a/opal-jquery.gemspec +++ b/opal-jquery.gemspec @@ -6,7 +6,7 @@ s.version = Opal::JQuery::VERSION s.authors = ['Adam Beynon', 'Elia Schito'] s.email = 'elia@schito.me' - s.homepage = 'http://opalrb.org' + s.homepage = 'https://github.com/opal/opal-jquery#readme' s.summary = 'Opal access to jQuery' s.description = 'Opal DOM library for jQuery'
Update the homepage url in the gemspec
diff --git a/lib/torckapi/response/base.rb b/lib/torckapi/response/base.rb index abc1234..def5678 100644 --- a/lib/torckapi/response/base.rb +++ b/lib/torckapi/response/base.rb @@ -7,7 +7,7 @@ def self.bdecode_and_check(data, key) begin - bdecoded_data = BEncode.load(data) + bdecoded_data = BEncode.load(data, :ignore_trailing_junk => true) rescue BEncode::DecodeError raise Torckapi::Tracker::MalformedResponseError, "Can't decode '%s'" % data end
Allow proper loading of failed Bencoded data When returned with a failure of a response, originally this will raise a MalformedResponseError well, erroneously. The response is proper, and should carry on to raise the next error later, for proper debugging purposes.
diff --git a/lib/word_search/plane/base.rb b/lib/word_search/plane/base.rb index abc1234..def5678 100644 --- a/lib/word_search/plane/base.rb +++ b/lib/word_search/plane/base.rb @@ -8,9 +8,7 @@ validates :x, :y, numericality: { greater_than_or_equal_to: 2 } def print(file_name = nil) - file = File.open(file_name || 'crossword', 'w') - file.write(to_s) - file + File.open(file_name || 'word_search', 'w') { |f| f.write to_s } end def random_letter
Make writing word search to file actually work
diff --git a/lib/tasks/iso.rake b/lib/tasks/iso.rake index abc1234..def5678 100644 --- a/lib/tasks/iso.rake +++ b/lib/tasks/iso.rake @@ -2,14 +2,7 @@ namespace :maintenance do task :repair_image_permissions => :environment do bucket = $s3_client.buckets.find(ENV['S3_BUCKET']) - to_fix = [] Photograph.find_each do |p| - if p.image_uid =~ /2013\// - to_fix << p - end - end - - to_fix.each do |p| begin obj = bucket.objects.find(p.image_uid) obj.copy(key: p.image_uid, bucket: bucket, acl: :private)
Revert to being more generalised
diff --git a/Casks/cyberduck.rb b/Casks/cyberduck.rb index abc1234..def5678 100644 --- a/Casks/cyberduck.rb +++ b/Casks/cyberduck.rb @@ -1,6 +1,6 @@ class Cyberduck < Cask version '4.5.2' - sha256 '94afaf396b4fddfb1bacbe9a8f648492949dde437579be273c0a752470d577c1' + sha256 'cff337f880b6ebbcc7f2e246b677fa5346fd225ae83289dca71ab35cf4b6eb8f' url "https://update.cyberduck.io/Cyberduck-#{version}.zip" appcast 'https://version.cyberduck.io/changelog.rss'
Fix SHA2 mismatch for Cyberduck 4.5.2. Error: SHA2 mismatch Expected: 94afaf396b4fddfb1bacbe9a8f648492949dde437579be273c0a752470d577c1 Actual: cff337f880b6ebbcc7f2e246b677fa5346fd225ae83289dca71ab35cf4b6eb8f Archive: /Library/Caches/Homebrew/cyberduck-4.5.2.zip
diff --git a/Casks/textadept.rb b/Casks/textadept.rb index abc1234..def5678 100644 --- a/Casks/textadept.rb +++ b/Casks/textadept.rb @@ -1,5 +1,5 @@ class Textadept < Cask - url 'http://foicica.com/textadept/download/textadept_5.4.osx.zip' + url 'http://foicica.com/textadept/download/textadept_6.0_beta_3.osx.zip' homepage 'http://foicica.com/textadept/' - version '5.4' + version '6.0-beta-3' end
Update Cask: Textadept 6.0 beta 3.
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,14 @@ # # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) # Character.create(name: 'Luke', movie: movies.first) + +## Create a default Admin User +admin = User.where(email: 'admin@oneclick.com').first_or_create do |user| + user.password = 'welcome1' + user.password_confirmation = 'welcome1' + user.add_role :admin + puts 'Creating Default Admin User (Change these settings)' + puts 'email: ' + user.email + puts 'password: '+ 'welcome1' +end +
Add a default admin user to db:seed
diff --git a/db/seeds.rb b/db/seeds.rb index abc1234..def5678 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -9,6 +9,7 @@ name = page.css('td.cafename a substring')[item_num].text link = page.css('td.cafename')[item_num].css('a').first['href'] members = page.css('td.member')[item_num].text.gsub(/,/, '').to_f + members = 0 if members < 1 Cafe.create(title: name, score: members, url: link) item_num += 1 end
Update seed for negative members bug
diff --git a/app/helpers/admin_helper.rb b/app/helpers/admin_helper.rb index abc1234..def5678 100644 --- a/app/helpers/admin_helper.rb +++ b/app/helpers/admin_helper.rb @@ -11,13 +11,23 @@ def i18n_reply + # Builds the nested selector for common replies + select = "<label class='control-label' for='post_reply_id'>#{t(:select_common, default: 'Insert Common Reply')}</label>" select += "<select name='post[reply_id]' class='form-control' id='post_reply_id'>" select += "<option value=''></option>" I18n.available_locales.each do |locale| Globalize.with_locale(locale) do - select += "<optgroup label='#{I18n.translate("i18n_languages.#{locale}")}'>" + # TODO THIS IS A HACK because there appears to be no difference in language files for chinese simple and traditional + # This could be changed to display the language names in english fairly easily + # but in another language we are missing the translations + + if "#{locale}" == 'zh-cn' || "#{locale}" == 'zh-tw' + select += "<optgroup label='#{I18n.translate("i18n_languages.zh")}'>" + else + select += "<optgroup label='#{I18n.translate("i18n_languages.#{locale}")}'>" + end Doc.replies.with_translations(locale).all.each do |doc| select += "<option value='#{doc.body}'>#{doc.title}</option>" end
Update select common reply helper with hack to handle missing translations for chinese char sets Signed-off-by: Scott Miller <ee4be419d3f845eb9ce4e4ef3aeee8bd8acd07cf@gmail.com>
diff --git a/engines/order_management/spec/services/order_management/stock/packer_spec.rb b/engines/order_management/spec/services/order_management/stock/packer_spec.rb index abc1234..def5678 100644 --- a/engines/order_management/spec/services/order_management/stock/packer_spec.rb +++ b/engines/order_management/spec/services/order_management/stock/packer_spec.rb @@ -10,7 +10,7 @@ subject { Packer.new(stock_location, order) } - before { order.line_items.first.variant.weight = 1 } + before { order.line_items.first.variant.update(unit_value: 100) } it 'builds a package with all the items' do package = subject.package
Update test setup in Packer spec. This is the correct way to set a variant's weight.
diff --git a/TEQuickPageViewController.podspec b/TEQuickPageViewController.podspec index abc1234..def5678 100644 --- a/TEQuickPageViewController.podspec +++ b/TEQuickPageViewController.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "TEQuickPageViewController" - s.version = "2.0.0" + s.version = "2.1.0" s.summary = "Add pages to a PageViewController directly in Storyboard." s.description = <<-DESC TEQuickPageViewController is an extension of UIPageViewController to allow adding Views to a Page View directly in your Storyboard, without any additional code. @@ -12,7 +12,7 @@ s.license = "MIT" s.author = { "Tom Elliott" => "tom.w.elliott@gmail.com" } s.platform = :ios - s.source = { :git => "https://github.com/theothertomelliott/TEQuickPageViewController.git", :tag => "2.0.0" } + s.source = { :git => "https://github.com/theothertomelliott/TEQuickPageViewController.git", :tag => "2.1.0" } s.source_files = "TEQuickPageViewController/Library", "TEQuickPageViewController/Library/**/*.{h,m}" s.exclude_files = "TEQuickPageViewController/Library/Exclude" s.requires_arc = true
Update podspec for version 2.1.0.
diff --git a/fakefs.gemspec b/fakefs.gemspec index abc1234..def5678 100644 --- a/fakefs.gemspec +++ b/fakefs.gemspec @@ -6,7 +6,7 @@ Gem::Specification.new do |spec| spec.name = "fakefs" spec.version = FakeFS::Version.to_s - spec.authors = ["Chris Wanstrath", "Scott Taylor", "Jeff Hodges", "Pat Nakajima"] + spec.authors = ["Chris Wanstrath", "Scott Taylor", "Jeff Hodges", "Pat Nakajima", "Brian Donovan"] spec.email = ["chris@ozmm.org"] spec.description = %q{A fake filesystem. Use it in your tests.} spec.summary = %q{A fake filesystem. Use it in your tests.}
Add myself as an author.
diff --git a/feeder.gemspec b/feeder.gemspec index abc1234..def5678 100644 --- a/feeder.gemspec +++ b/feeder.gemspec @@ -31,5 +31,5 @@ s.add_development_dependency "capybara" s.add_development_dependency "factory_girl_rails" s.add_development_dependency "timecop" - s.add_development_dependency "cancan" + s.add_development_dependency "cancancan" end
Use cancancan instead of cancan
diff --git a/app/policies/user_policy.rb b/app/policies/user_policy.rb index abc1234..def5678 100644 --- a/app/policies/user_policy.rb +++ b/app/policies/user_policy.rb @@ -33,4 +33,8 @@ def destroy? show? end + + def view_admin? + index? + end end
Add view_admin? method to user policy
diff --git a/spec/scanner_spec.rb b/spec/scanner_spec.rb index abc1234..def5678 100644 --- a/spec/scanner_spec.rb +++ b/spec/scanner_spec.rb @@ -6,7 +6,7 @@ let(:name) { 'nmap' } let(:version) { '6.01' } let(:args) { 'nmap -v -sS -sU -A -O -oX spec/scan.xml scanme.nmap.org' } - let(:start_time) { Time.new('Sat Jul 20 23:55:27 2013') } + let(:start_time) { Time.parse('Sat Jul 20 23:55:27 2013') } subject do described_class.new(
Use Time.parse instead of Time.new for ruby-3.1.0-preview1.
diff --git a/spec/support/jazz.rb b/spec/support/jazz.rb index abc1234..def5678 100644 --- a/spec/support/jazz.rb +++ b/spec/support/jazz.rb @@ -1,29 +1,33 @@ # frozen_string_literal: true + +# Here's the "application" module Jazz + # Here are some classes that the application deals with module Models Ensemble = Struct.new(:name) Instrument = Struct.new(:name) end + # Here's a new-style GraphQL type definition class Ensemble < GraphQL::Object model Models::Ensemble description "A group of musicians playing together" field :name, "String", null: false end + # Lives side-by-side with an old-style definition InstrumentType = GraphQL::ObjectType.define do name "Instrument" field :name, !types.String end + # Another new-style definition, with method overrides class Query < GraphQL::Object field :ensembles, "[Ensemble]" field :instruments, "[Instrument]" def ensembles - [ - Models::Ensemble.new("Bela Fleck and the Flecktones"), - ] + [Models::Ensemble.new("Bela Fleck and the Flecktones")] end def instruments @@ -31,11 +35,13 @@ end end + # New-style Schema definition class Schema < GraphQL::Schema query(Query) namespace(Jazz) end - # Prep the schema + # Prep the schema, now a required step, + # but can be rebooted during Rails development Schema.boot end
Annotate the example a bit
diff --git a/recipes/grml-zsh.rb b/recipes/grml-zsh.rb index abc1234..def5678 100644 --- a/recipes/grml-zsh.rb +++ b/recipes/grml-zsh.rb @@ -1,4 +1,4 @@-include_recipe "chef-apt-repo::grml" +include_recipe "apt-repo::grml" directory "/etc/apt/preferences.d" cookbook_file "grml-pin" do
Use apt-repo as cookbook name instead of chef-apt-repo
diff --git a/ruboty.gemspec b/ruboty.gemspec index abc1234..def5678 100644 --- a/ruboty.gemspec +++ b/ruboty.gemspec @@ -20,7 +20,7 @@ spec.add_dependency "bundler" spec.add_dependency "dotenv" spec.add_dependency "mem" - spec.add_dependency "slop" + spec.add_dependency "slop", ">= 4.0.0" spec.add_development_dependency "codeclimate-test-reporter", ">= 0.3.0" spec.add_development_dependency "rake" spec.add_development_dependency "rspec", "2.14.1"
Use slop v4 or higher because some options couldn't work
diff --git a/Casks/syncthing.rb b/Casks/syncthing.rb index abc1234..def5678 100644 --- a/Casks/syncthing.rb +++ b/Casks/syncthing.rb @@ -2,6 +2,7 @@ version '0.13.7' sha256 '58c0063cecef9d2969b96223e4cacfabb91f2df0f7a7bf43860a50a344b487f7' + # github.com/syncthing/syncthing was verified as official when first introduced to the cask url "https://github.com/syncthing/syncthing/releases/download/v#{version}/syncthing-macosx-amd64-v#{version}.tar.gz" appcast 'https://github.com/syncthing/syncthing/releases.atom', checkpoint: '85ca27e629ca442a77752696fcd65dd4ef789a7465ea83c6938ce398bc386d4c'
Fix `url` stanza comment for Syncthing.
diff --git a/temperature_conversion.gemspec b/temperature_conversion.gemspec index abc1234..def5678 100644 --- a/temperature_conversion.gemspec +++ b/temperature_conversion.gemspec @@ -13,14 +13,6 @@ spec.homepage = "https://github.com/eternal44/temperature_conversion" 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'] = "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" spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
Remove metadata option on gemspec Allows for easier releasing / deployment to any server
diff --git a/acts_as_shopping_cart.gemspec b/acts_as_shopping_cart.gemspec index abc1234..def5678 100644 --- a/acts_as_shopping_cart.gemspec +++ b/acts_as_shopping_cart.gemspec @@ -18,7 +18,7 @@ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } s.require_paths = ["lib"] - s.add_dependency 'activerecord', '~> 4.1.0' + s.add_dependency 'activerecord', '~> 4' s.add_development_dependency "cucumber", '~> 1.3.14' s.add_development_dependency "database_cleaner" s.add_development_dependency "rspec", "~> 2.12.0"
Change the activerecord dependency lock to work both with 4.0 and 4.1
diff --git a/lib/mongo_mapper/plugins/inspect.rb b/lib/mongo_mapper/plugins/inspect.rb index abc1234..def5678 100644 --- a/lib/mongo_mapper/plugins/inspect.rb +++ b/lib/mongo_mapper/plugins/inspect.rb @@ -5,9 +5,9 @@ extend ActiveSupport::Concern module InstanceMethods - def inspect(include_super=false) - key_array = include_super ? key_names : attributes.keys - attributes_as_nice_string = key_array.sort.collect do |name| + def inspect(include_nil = false) + keys = include_nil ? key_names : attributes.keys + attributes_as_nice_string = keys.sort.collect do |name| "#{name}: #{self[name].inspect}" end.join(", ") "#<#{self.class} #{attributes_as_nice_string}>"
Update variable name to reflect intention
diff --git a/app/helpers/access_lint_helper.rb b/app/helpers/access_lint_helper.rb index abc1234..def5678 100644 --- a/app/helpers/access_lint_helper.rb +++ b/app/helpers/access_lint_helper.rb @@ -1,17 +1,5 @@ module AccessLintHelper def include_access_lint - javascript_include_tag("accesslint") + - javascript_tag(<<-JS.strip_heredoc) - (function() { - var load = function() { - window.removeEventListener("load", load, false); - window.AccessLint.audit({ - raiseError: #{!Rails.env.production?}, - }); - }; - - window.addEventListener("load", load); - })(); - JS + javascript_include_tag("accesslint") end end
Simplify javascript loading and execution - accesslint.js now handled the loading and execution.
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 @@ -13,15 +13,23 @@ nil end - def thumbnail_image_tag(model, size = "50x50") + def thumbnail_path(model) if model.is_a?(String) - image_tag(model, size: size) + model elsif model.is_a?(Feed) && model.visualUrl.present? - image_tag(model.visualUrl, size: size) + model.visualUrl elsif model.is_a?(Entry) && model.has_visual? - image_tag(model.visual_url, size: size) + model.visual_url else - image_tag(asset_path('no_image.png'), size: size) + asset_path('no_image.png') end end + + def thumbnail_image_tag(model, size = "50x50") + image_tag(thumbnail_path(model), size: size, alt: "broken image") + end + + def thumbnail_image_link(model, size = "50x50") + link_to thumbnail_image_tag(model, size), thumbnail_path(model) + end end
Improve thumbnail helpers by three methods: thumbnail_path, thumbnail_image_tag, thumbnail_image_link
diff --git a/app/helpers/investments_helper.rb b/app/helpers/investments_helper.rb index abc1234..def5678 100644 --- a/app/helpers/investments_helper.rb +++ b/app/helpers/investments_helper.rb @@ -26,7 +26,7 @@ end def errors_on_image(investment) - @investment.errors[:image].join(', ') if @investment.errors.has_key?(:image) + investment.errors[:image].join(', ') if investment.errors.has_key?(:image) end end
Use helper argument intead of instance variable.
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -4,7 +4,7 @@ license 'MIT' description 'Installs and configures the Frog Media Server' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '1.0.1' +version '1.0.2' depends 'database', '~> 2.2.0' depends 'python', '~> 1.4.6'
Update development version to 1.0.2
diff --git a/test/unit/asset_bundle_test.rb b/test/unit/asset_bundle_test.rb index abc1234..def5678 100644 --- a/test/unit/asset_bundle_test.rb +++ b/test/unit/asset_bundle_test.rb @@ -5,8 +5,8 @@ class AssetBundleTest < TestCase def test_raise_exception_if_bundle_command_fails capture_io do - err = assert_raises(RuntimeError) { make_bundle('false') } - assert_equal 'Bundling js assets failed with exit status 1, command: false', err.to_s + err = assert_raises(RuntimeError) { make_bundle('read ; false') } + assert_equal 'Bundling js assets failed with exit status 1, command: read ; false', err.to_s end end
Fix occasionally failing test: wait for stdin
diff --git a/salestation.gemspec b/salestation.gemspec index abc1234..def5678 100644 --- a/salestation.gemspec +++ b/salestation.gemspec @@ -20,7 +20,7 @@ spec.require_paths = ["lib"] spec.add_development_dependency "bundler", "~> 1.13" - spec.add_development_dependency "rake", "~> 10.0" + spec.add_development_dependency "rake", "~> 13.0" spec.add_development_dependency "rspec", "~> 3.0" spec.add_development_dependency "pry", "~> 0.10.4"
Update rake development dependency to fix CVE
diff --git a/spec/factories/game_factory.rb b/spec/factories/game_factory.rb index abc1234..def5678 100644 --- a/spec/factories/game_factory.rb +++ b/spec/factories/game_factory.rb @@ -1,5 +1,6 @@ Factory.define :game do |g| g.regulation_type :unregulated + g.after_create { |game| attach_region game } end Factory.define :invalid_game, :parent => :game do |g| @@ -13,3 +14,7 @@ Factory.define :started_game, :parent => :game do |g| g.started Time.now end + +def attach_region game + game.regions.create Factory(:region).attributes +end
Attach a region to every new factory'd game
diff --git a/spec/integration/login_spec.rb b/spec/integration/login_spec.rb index abc1234..def5678 100644 --- a/spec/integration/login_spec.rb +++ b/spec/integration/login_spec.rb @@ -4,7 +4,7 @@ describe 'Login' do include_context 'in site' - before { FactoyrGirl.create(:user, name: 'test') } + before { FactoryGirl.create(:user, name: 'test') } after { User.delete_all } shared_examples_for 'login failed' do @@ -13,7 +13,7 @@ end it 'should render login screen again' do - last_response.body.should match('<body class=\'admin_login\'>') + last_response.body.should match('<body class="admin_login">') end it 'should not render dashboard side bar' do
Fix admin login integration spec
diff --git a/app/models/concerns/has_a_feed.rb b/app/models/concerns/has_a_feed.rb index abc1234..def5678 100644 --- a/app/models/concerns/has_a_feed.rb +++ b/app/models/concerns/has_a_feed.rb @@ -0,0 +1,15 @@+module HasAFeed + extend ActiveSupport::Concern + + included do + + has_many :entities_imported_from_feed, as: :entity + has_many :feeds, through: :entities_imported_from_feed + + def imported_from_feed_onestop_id=(value) + feed = Feed.find_by!(onestop_id: value) + self.feeds << feed unless self.feeds.exists?(feed) + end + + end +end
Move feeds association to HasAFeed concern and check if assoc. exists
diff --git a/net-socket.gemspec b/net-socket.gemspec index abc1234..def5678 100644 --- a/net-socket.gemspec +++ b/net-socket.gemspec @@ -11,7 +11,7 @@ spec.summary = %q{A better socket API.} spec.description = spec.summary - spec.homepage = "https://github.com/heresy/net-socket" + spec.homepage = "https://github.com/ruby-heresy/net-socket" spec.license = "MIT" spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
Fix homepage URL in gemspec.
diff --git a/app/models/key/fingerprint.rb b/app/models/key/fingerprint.rb index abc1234..def5678 100644 --- a/app/models/key/fingerprint.rb +++ b/app/models/key/fingerprint.rb @@ -30,7 +30,7 @@ self.fingerprint = match.gsub(":","") end rescue Subprocess::Error => e - errors[:key] << e.output.split("\n").last.split(" ",2).last + errors[:key] << e.output.split("\n").last.split(" ",2).last.strip end end
Delete whitespace to fix test.
diff --git a/Casks/a-better-finder-rename-beta.rb b/Casks/a-better-finder-rename-beta.rb index abc1234..def5678 100644 --- a/Casks/a-better-finder-rename-beta.rb +++ b/Casks/a-better-finder-rename-beta.rb @@ -0,0 +1,15 @@+cask :v1 => 'a-better-finder-rename-beta' do + version '10' + sha256 'df4208eb01c25434b5c93c65ae82c12b2bab893a63d5c286f8c89cf4ae7b7137' + + url "http://www.publicspace.net/download/ABFRX#{version}.dmg" + name 'A Better Finder Rename' + homepage 'http://www.publicspace.net/ABetterFinderRename/version10.html' + license :commercial + + app "A Better Finder Rename #{version.to_i}.app" + zap :delete => [ + "~/Library/Preferences/net.publicspace.abfr#{version}.plist", + "~/Library/Application Support/A Better Finder Rename #{version}", + ] +end
Add A Better Finder Rename 10.app beta
diff --git a/noodall-ui.gemspec b/noodall-ui.gemspec index abc1234..def5678 100644 --- a/noodall-ui.gemspec +++ b/noodall-ui.gemspec @@ -15,7 +15,7 @@ s.required_rubygems_version = ">= 1.3.6" s.add_dependency 'noodall-core', ">= 0.7.2" - s.add_dependency 'thoughtbot-sortable_table', "0.0.6" + s.add_dependency 'thoughtbot-sortable_table', ">= 0.0.6" s.add_dependency 'will_paginate', "~> 3.0" s.add_dependency 'dynamic_form', ">= 0"
Fix up gemspec again grrr
diff --git a/WhiteLabel.podspec b/WhiteLabel.podspec index abc1234..def5678 100644 --- a/WhiteLabel.podspec +++ b/WhiteLabel.podspec @@ -12,8 +12,8 @@ s.source = { :git => 'https://github.com/White-Label/Swift-SDK.git', :tag => s.version.to_s } s.ios.deployment_target = '10.0' - s.osx.deployment_target = '10.11' - s.tvos.deployment_target = '9.0' +# s.osx.deployment_target = '10.11' +# s.tvos.deployment_target = '9.0' s.source_files = 'WhiteLabel/**/*.swift' s.resources = 'WhiteLabel/**/*.xcdatamodeld'
Remove support for macOS and tvOS.
diff --git a/MockInject.podspec b/MockInject.podspec index abc1234..def5678 100644 --- a/MockInject.podspec +++ b/MockInject.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "MockInject" - s.version = "1.0.0" + s.version = "1.0.1" s.summary = "A library that allows developers to globally mock any ObjectiveC class' initialization method when testing with Kiwi." s.homepage = "https://github.com/gantaa/MockInject" s.license = { :type => 'MIT', :file => 'MIT-LICENSE.txt' }
Update Podspec for new minor version
diff --git a/snapme.gemspec b/snapme.gemspec index abc1234..def5678 100644 --- a/snapme.gemspec +++ b/snapme.gemspec @@ -7,8 +7,8 @@ gem.version = Snapme::Version gem.authors = ['Jay Hayes'] gem.email = ['ur@iamvery.com'] - gem.description = %q{} - gem.summary = %q{} + gem.description = %q{Share yourself with your team} + gem.summary = %q{Share yourself with your team} gem.homepage = 'https://github.com/iamvery/snapme' gem.files = `git ls-files`.split($/)
Add description and summary to gemspec
diff --git a/vagrant-bindfs.gemspec b/vagrant-bindfs.gemspec index abc1234..def5678 100644 --- a/vagrant-bindfs.gemspec +++ b/vagrant-bindfs.gemspec @@ -11,7 +11,7 @@ s.summary = "A Vagrant plugin to automate bindfs mount in the VM" s.description = "A Vagrant plugin to automate bindfs mount in the VM. This allow you to change owner, group and permissions on files and, for example, work around NFS share permissions issues." - s.add_dependency "vagrant", ">= 0.6.0" + s.add_dependency "vagrant", ">= 0.9.4" s.files = Dir['lib/**/*.rb'] + Dir['locales/*.yml'] + ['README.md', 'LICENSE.txt']
Update gemspec to require Vagrant 0.9.4+
diff --git a/lib/georgia.rb b/lib/georgia.rb index abc1234..def5678 100644 --- a/lib/georgia.rb +++ b/lib/georgia.rb @@ -27,12 +27,19 @@ mattr_accessor :roles @@roles = %w(admin editor contributor guest) - def self.setup - yield self - end - class << self alias :header :navigation + + def setup + yield self + verify_data_integrity + end + + def verify_data_integrity + Georgia.roles.each do |role_name| + Georgia::Role.where(name: role_name).first_or_create + end + end def header= value ActiveSupport::Deprecation.warn("config.header is deprecated, use config.navigation instead.", caller)
Verify that Georgia roles have been created
diff --git a/conjure.gemspec b/conjure.gemspec index abc1234..def5678 100644 --- a/conjure.gemspec +++ b/conjure.gemspec @@ -17,7 +17,7 @@ s.add_dependency "thor" s.add_dependency "unf" s.add_development_dependency "guard-rspec" - s.add_development_dependency "rspec", ">= 3.0.0.beta2" + s.add_development_dependency "rspec", ">= 3.1.0" s.add_development_dependency "rake" end
Update RSpec version for development
diff --git a/weather_hacker.gemspec b/weather_hacker.gemspec index abc1234..def5678 100644 --- a/weather_hacker.gemspec +++ b/weather_hacker.gemspec @@ -4,9 +4,9 @@ Gem::Specification.new do |gem| gem.authors = ["Ryo NAKAMURA"] gem.email = ["r7kamura@gmail.com"] - gem.description = %q{TODO: Write a gem description} - gem.summary = %q{TODO: Write a gem summary} - gem.homepage = "" + gem.description = %q{Library for Livedoor Weather Web Service} + gem.summary = %q{Library for Livedoor Weather Web Service} + gem.homepage = "https://github.com/r7kamura/weather_hacker" gem.files = `git ls-files`.split($\) gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
Write simple description in gemspec
diff --git a/spec/support/db.rb b/spec/support/db.rb index abc1234..def5678 100644 --- a/spec/support/db.rb +++ b/spec/support/db.rb @@ -1,4 +1,4 @@-require 'lib/generators/social_stream/templates/migration' +require File.join(Rails.root, '../../lib/generators/social_stream/templates/migration') CreateSocialStream.up require File.expand_path("../../dummy/db/seeds", __FILE__)
Fix tests for Ruby 1.9
diff --git a/spec/summary_generation_spec.rb b/spec/summary_generation_spec.rb index abc1234..def5678 100644 --- a/spec/summary_generation_spec.rb +++ b/spec/summary_generation_spec.rb @@ -1,25 +1,30 @@-require 'spec_helper' +require "spec_helper" +require_relative "../lib/active_record_record/summary_generation" -define ActiveRecordRecord::SummaryGeneration do - define "#clear_ar_counts" do +describe ActiveRecordRecord::SummaryGeneration do + describe "#clear_ar_counts" do before do + Thread.current[:request_start_time] = "00:00:00" Thread.current[:ar_counts] = { test: "I love ar_counts" } Thread.current[:times] = { times: "Are changing" } - Thread.current[:request_start_time] = "This is the start time, trust me" Thread.current[:do_counts] = false Thread.current[:objects_key] = :silly_user_key + + class StubClass + include ActiveRecordRecord::SummaryGeneration + end + StubClass.new.clear_ar_counts end it "will reset all thread current variables" do + expect(Thread.current[:request_start_time]).to_not eq("00:00:00") expect(Thread.current[:ar_counts]).to eq({}) expect(Thread.current[:times]).to eq({}) - # We should use time cop - # expect(Thread.current[:request_start_time]).to eq(Time.now) expect(Thread.current[:do_counts]).to eq(true) expect(Thread.current[:objects_key]).to eq(:default) end end - define "#dump_counts" - define "#print_ar_counts" + describe "#dump_counts" + describe "#print_ar_counts" end
Add spec for clearing the ar counts
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -14,6 +14,11 @@ config.expect_with :rspec do |c| c.syntax = :expect end + + unless ENV["CI"] + config.filter_run focus: true + config.run_all_when_everything_filtered = true + end end VCR.configure do |config|
Allow focus for specs when not on CI
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,2 +1,4 @@ require "lita-ascii-art" require "lita/rspec" + +Lita.version_3_compatibility_mode = false
spec: Disable Lita 3 compatibility mode
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -17,6 +17,12 @@ require 'support/stub_fog_interface.rb' require 'support/integration_helper' +RSpec.configure do |config| + config.expect_with :rspec do |c| + c.syntax = :expect + end +end + if ENV['COVERAGE'] SimpleCov.at_exit do SimpleCov.result.format!
Disable `should` syntax in Rspec `should` syntax is deprecated as of Rspec version 3.0 and the previous commit converts all of our tests to use `expect` for consistency. To prevent regressions, this change disables `should` syntax for this gem.
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -3,6 +3,9 @@ require 'failsafe' +class MockFailureBackend < Failsafe::Backends::Base +end + RSpec.configure do |config| config.mock_with :mocha config.after { Failsafe.error_backends.clear }
Add MockFailureBackend for test mode
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,5 +1,5 @@ RSpec.configure do |config| - config.around(:each) { |example| Timeout.timeout(1, &example) } + config.around(:each) { |example| Timeout.timeout(0.5, &example) } end begin
Reduce test timeout to 0.5 seconds Have tests time out after half the time, especially now that rspec-eventually is out of the picture and we don't have polling going on.
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -3,5 +3,13 @@ require 'rubygems' require 'yajl' -require 'active_support/core_ext/kernel/reporting' require 'date' + +module Kernel + def silence_warnings + old_verbose, $VERBOSE = $VERBOSE, nil + yield + ensure + $VERBOSE = old_verbose + end +end
Reimplement the single function used by activesupport. Instead of adding a test dependency over activesupport, rewrite the same function here. The dependency over activesupport would be way exaggerated for just this.
diff --git a/config/initializers/01_env.rb b/config/initializers/01_env.rb index abc1234..def5678 100644 --- a/config/initializers/01_env.rb +++ b/config/initializers/01_env.rb @@ -1,4 +1,4 @@-Confy::Config.env(ENV['CONFY_URL']) if ENV['CONFY_URL'] +# Confy::Config.env(ENV['CONFY_URL']) if ENV['CONFY_URL'] module Helpful extend self
Remove confy until we sync env vars
diff --git a/lib/travis/log_subscriber/active_record_metrics.rb b/lib/travis/log_subscriber/active_record_metrics.rb index abc1234..def5678 100644 --- a/lib/travis/log_subscriber/active_record_metrics.rb +++ b/lib/travis/log_subscriber/active_record_metrics.rb @@ -2,8 +2,8 @@ module LogSubscriber class ActiveRecordMetrics < ActiveSupport::LogSubscriber def sql(event) - return if 'SCHEMA' == event[:name] - name, sql, duration = event[:name], event[:sql], event.duration + return if 'SCHEMA' == event.payload[:name] + name, sql, duration = event.payload[:name], event.payload[:sql], event.duration metric_name = if name.present?
Use the event's payload to get the proper values.
diff --git a/oauth2.gemspec b/oauth2.gemspec index abc1234..def5678 100644 --- a/oauth2.gemspec +++ b/oauth2.gemspec @@ -0,0 +1,40 @@+# coding: utf-8 + +lib = File.expand_path('../lib', __FILE__) +$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) +require 'oauth2/version' + +Gem::Specification.new do |spec| + spec.add_dependency 'faraday', ['>= 0.8', '< 0.15.0'] + spec.add_dependency 'jwt', ['>= 1.0', '< 3.0'] + spec.add_dependency 'multi_json', '~> 1.3' + spec.add_dependency 'multi_xml', '~> 0.5' + spec.add_dependency 'rack', ['>= 1.2', '< 3'] + + spec.authors = ['Peter Boling', 'Michael Bleigh', 'Erik Michaels-Ober'] + spec.description = 'A Ruby wrapper for the OAuth 2.0 protocol built with a similar style to the original OAuth spec.' + spec.email = ['peter.boling@gmail.com'] + spec.homepage = 'https://github.com/oauth-xx/oauth2' + spec.licenses = %w[MIT] + spec.name = 'oauth2' + spec.required_ruby_version = '>= 1.9.0' + spec.required_rubygems_version = '>= 1.3.5' + spec.summary = 'A Ruby wrapper for the OAuth 2.0 protocol.' + spec.version = OAuth2::Version + + spec.require_paths = %w[lib] + spec.bindir = 'exe' + spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } + spec.files = `git ls-files -z`.split("\x0").reject do |f| + f.match(%r{^(bin|test|spec|features)/}) + end + + spec.add_development_dependency 'addressable', '~> 2.3' + spec.add_development_dependency 'backports', '~> 3.11' + spec.add_development_dependency 'bundler', '~> 1.16' + spec.add_development_dependency 'coveralls', '~> 0.8' + spec.add_development_dependency 'rake', '~> 12.3' + spec.add_development_dependency 'rdoc', ['>= 5.0', '< 7'] + spec.add_development_dependency 'rspec', '~> 3.0' + spec.add_development_dependency 'wwtd' +end
Upgrade rake to version 12.3.1
diff --git a/Formula/php54-pspell.rb b/Formula/php54-pspell.rb index abc1234..def5678 100644 --- a/Formula/php54-pspell.rb +++ b/Formula/php54-pspell.rb @@ -10,7 +10,7 @@ depends_on 'aspell' def install - Dir.chdir "ext/pcntl" + Dir.chdir "ext/pspell" # See https://github.com/mxcl/homebrew/pull/5947 ENV.universal_binary
Fix pspell module for PHP 5.4 (wrong build path)
diff --git a/lib/base.rb b/lib/base.rb index abc1234..def5678 100644 --- a/lib/base.rb +++ b/lib/base.rb @@ -13,8 +13,13 @@ raise PageObjectMissingPath, "You need to override this" end + def prefix + '' + end + def visit - source.visit path + source.visit prefix + path + self end end
Allow a prefix for paths
diff --git a/Library/Formula/solr.rb b/Library/Formula/solr.rb index abc1234..def5678 100644 --- a/Library/Formula/solr.rb +++ b/Library/Formula/solr.rb @@ -1,9 +1,9 @@ require 'formula' class Solr < Formula - url 'ftp://ftp.fu-berlin.de/unix/www/apache/lucene/solr/1.4.1/apache-solr-1.4.1.tgz' + url 'ftp://ftp.fu-berlin.de/unix/www/apache/lucene/solr/3.1.0/apache-solr-3.1.0.tgz' homepage 'http://lucene.apache.org/solr/' - md5 '258a020ed8c3f44e13b09e8ae46a1c84' + md5 'd7009df28f28a3e616def8035be06790' def script; <<-EOS.undent #!/bin/sh
Update Solr Formula to 3.1.0 Signed-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com>
diff --git a/app/controllers/sources_controller.rb b/app/controllers/sources_controller.rb index abc1234..def5678 100644 --- a/app/controllers/sources_controller.rb +++ b/app/controllers/sources_controller.rb @@ -32,7 +32,7 @@ client = DropboxClient.new(@user.dropbox_token) make_dropbox_folder("/this-week", client) make_dropbox_folder("/archive", client) - copy_dropbox_file(client,"https://github.com/kenworthyc/weeker/blob/master/public/docs/readme.txt","README.md") + copy_file_to_user_folder(client, 'README.txt', "https://raw.githubusercontent.com/kenworthyc/weeker/master/public/docs/readme.txt") if @user.destinations.empty? redirect "/destinations/new"
Update on user folder creation.
diff --git a/app/graphql/scalar_types/date_time.rb b/app/graphql/scalar_types/date_time.rb index abc1234..def5678 100644 --- a/app/graphql/scalar_types/date_time.rb +++ b/app/graphql/scalar_types/date_time.rb @@ -3,6 +3,6 @@ ScalarTypes::DateTime = GraphQL::ScalarType.define do name "DateTime" - coerce_input ->(value) { Time.zone.parse(value) } - coerce_result ->(value) { value.iso8601 } + coerce_input ->(value, _ctx) { Time.zone.parse(value) } + coerce_result ->(value, _ctx) { value.iso8601 } end
Fix deprecation warning in coerce_input/coerce_result
diff --git a/app/groonga/post_search_result_set.rb b/app/groonga/post_search_result_set.rb index abc1234..def5678 100644 --- a/app/groonga/post_search_result_set.rb +++ b/app/groonga/post_search_result_set.rb @@ -16,7 +16,7 @@ end def posts - @posts ||= @site.posts.includes(credits: [:participant]).published.where(id: searched_post_ids).order_by_recently.page(@page).per(50) + @posts ||= @site.posts.includes(:category, credits: [:participant]).published.where(id: searched_post_ids).order_by_recently.page(@page).per(50) end def snippet(text, html_options = {})
Include category to fix N+1 problem for search result set The following queries are run: Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [ ["id", 2]] Rendered posts/_summary.html.haml (11.7ms) Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [ ["id", 1]] Rendered posts/_summary.html.haml (3.9ms) CACHE (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1 ]] Rendered posts/_summary.html.haml (2.9ms) CACHE (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1 ]] Rendered posts/_summary.html.haml (3.1ms) CACHE (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1 ]] Rendered posts/_summary.html.haml (2.7ms) CACHE (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1 ]] Rendered posts/_summary.html.haml (2.5ms) CACHE (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1 ]] Rendered posts/_summary.html.haml (2.4ms) CACHE (0.0ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1 ]] Rendered posts/_summary.html.haml (2.5ms) ...
diff --git a/app/mailers/spree/gift_card_mailer.rb b/app/mailers/spree/gift_card_mailer.rb index abc1234..def5678 100644 --- a/app/mailers/spree/gift_card_mailer.rb +++ b/app/mailers/spree/gift_card_mailer.rb @@ -2,8 +2,11 @@ def gift_card_email(gift_card) @gift_card = gift_card.respond_to?(:id) ? gift_card : Spree::VirtualGiftCard.find(gift_card) @order = @gift_card.line_item.order + + store = @order.store send_to_address = @gift_card.recipient_email.presence || @order.email - subject = "#{Spree::Store.current.name} #{Spree.t('gift_card_mailer.gift_card_email.subject')}" - mail(to: send_to_address, from: from_address(Spree::Store.current), subject: subject) + subject = "#{store} #{Spree.t('gift_card_mailer.gift_card_email.subject')}" + + mail(to: send_to_address, from: from_address(store), subject: subject) end end
Remove usage of Spree::Store.current from GiftCardMailer
diff --git a/app/serializers/service_serializer.rb b/app/serializers/service_serializer.rb index abc1234..def5678 100644 --- a/app/serializers/service_serializer.rb +++ b/app/serializers/service_serializer.rb @@ -1,5 +1,5 @@ class ServiceSerializer < ActiveModel::Serializer - attributes :name, :command, :cpu, :memory, :load_balancer, :status + attributes :name, :public, :command, :cpu, :memory, :load_balancer, :status, :port_mappings belongs_to :heritage
Add port_mappings to service serializer
diff --git a/app/services/credentials_validator.rb b/app/services/credentials_validator.rb index abc1234..def5678 100644 --- a/app/services/credentials_validator.rb +++ b/app/services/credentials_validator.rb @@ -27,11 +27,21 @@ if user return user else - errors.add(:username_or_password, "INVALID") + errors.add(:username_or_password, :invalid) raise Invalid.new(self) end else raise Invalid.new(self) end end + + private + + def read_attribute_for_validation(attribute) + if attribute == :username_or_password + nil + else + send(attribute) + end + end end
Use translations for error messages, which requires hacking into ActiveModel::Validations a bit. See http://yehudakatz.com/2010/01/10/activemodel-make-any-ruby-object-feel-like-activerecord/ for an explanation of read_attribute_for_validation [#28089551]
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 @@ -1,4 +1,17 @@ class User < ActiveRecord::Base + VALID_INSTITUTION_CODES = Institutions.institutions.keys.map(&:to_s) + devise :omniauthable, omniauth_providers: [:nyulibraries] + # Must have a valid institution code + validates :institution_code, inclusion: {in: VALID_INSTITUTION_CODES}, + allow_blank: true + + # Resolve the institution based on the institution_code + def institution + unless institution_code.blank? + @institution ||= Institutions.institutions[institution_code.to_sym] + end + end + end
Add validation for institution codes and make institution code
diff --git a/app/workers/inbound_mail_processor.rb b/app/workers/inbound_mail_processor.rb index abc1234..def5678 100644 --- a/app/workers/inbound_mail_processor.rb +++ b/app/workers/inbound_mail_processor.rb @@ -6,9 +6,10 @@ def self.perform(mail_id) mail = InboundMail.find(mail_id) to_address = mail.message.to.first - thread_match = to_address.match(/^thread-([^@]+)/) - message_match = to_address.match(/^message-([^@]+)/) - deliver_thread_reply(mail, thread_match.try(:[], 1), message_match.try(:[], 1)) + thread_token = to_address.match(/^thread-([^@]+)/).to_a[1] + message_token = to_address.match(/^message-([^@]+)/).to_a[1] + return unless thread_token || message_token + deliver_thread_reply(mail, thread_token, message_token) end def self.deliver_thread_reply(mail, thread_token, message_token)
Stop logging emails without valid tokens This is filling the resque logs
diff --git a/dill.gemspec b/dill.gemspec index abc1234..def5678 100644 --- a/dill.gemspec +++ b/dill.gemspec @@ -25,4 +25,5 @@ s.add_development_dependency 'sinatra' s.add_development_dependency 'capybara-webkit', '~> 1.0.0' s.add_development_dependency 'poltergeist', '~> 1.3.0' + s.add_development_dependency 'cucumber', '~> 1.3.0' end
Add cucumber as a development dependency.
diff --git a/spec/models/ability/user_group_ability_spec.rb b/spec/models/ability/user_group_ability_spec.rb index abc1234..def5678 100644 --- a/spec/models/ability/user_group_ability_spec.rb +++ b/spec/models/ability/user_group_ability_spec.rb @@ -0,0 +1,26 @@+# frozen_string_literal: true + +# Tests for abilities related to UserGroup object. +require "rails_helper" + +describe "abilities for user_groups" do + context "for coordinator role" do + let(:user) { create(:user, role_name: "coordinator") } + let(:ability) { Ability.new(user: user, mode: "mission", mission: get_mission) } + + it "should be able to create" do + expect(ability).to be_able_to(:create, UserGroup) + expect(ability).to be_able_to(:create, UserGroupAssignment) + end + end + + context "for enumerator role" do + let(:user) { create(:user, role_name: "enumerator") } + let(:ability) { Ability.new(user: user, mode: "mission", mission: get_mission) } + + it "should not be able to create" do + expect(ability).not_to be_able_to(:create, UserGroup) + expect(ability).not_to be_able_to(:create, UserGroupAssignment) + end + end +end
10173: Add basic test for existing UserGroup abilities
diff --git a/spec/unit/puppet/type/zabbix_hostgroup_spec.rb b/spec/unit/puppet/type/zabbix_hostgroup_spec.rb index abc1234..def5678 100644 --- a/spec/unit/puppet/type/zabbix_hostgroup_spec.rb +++ b/spec/unit/puppet/type/zabbix_hostgroup_spec.rb @@ -0,0 +1,11 @@+require 'spec_helper' + +describe Puppet::Type.type(:zabbix_hostgroup) do + describe 'when validating attributes' do + [:name, :zabbix_url, :zabbix_user, :zabbix_pass, :apache_use_ssl, :provider].each do |param| + it "should have a #{param} parameter" do + expect(described_class.attrtype(param)).to eq(:param) + end + end + end +end
Add unit test for zabbix_hostgroup type Really basic test to make sure type has expected parameters.
diff --git a/test/helper.rb b/test/helper.rb index abc1234..def5678 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -19,6 +19,18 @@ require "phone" require "minitest/autorun" +class Minitest::Test + def setup + Phoner::Phone.default_country_code = nil + Phoner::Phone.default_area_code = nil + end + + def teardown + Phoner::Phone.default_country_code = nil + Phoner::Phone.default_area_code = nil + end +end + def parse_test(raw, country_code, area_code, number) pn = Phoner::Phone.parse(raw)
Update Minitest::Test class with setup and teardown Protect our test runs from tests that manipulate the class methods and don't reset them.
diff --git a/test/helper.rb b/test/helper.rb index abc1234..def5678 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -18,5 +18,7 @@ require 'sklik-api' require './test/fake_web' +SklikApi.logger = Logger.new('log/sklik_api_test.log') + class Test::Unit::TestCase end
[FIX] Send test logger output to log/sklik_api_test.log
diff --git a/db/migrate/20161107191141_remove_is_done_from_report_uploads_and_update_submitted_timestamps.rb b/db/migrate/20161107191141_remove_is_done_from_report_uploads_and_update_submitted_timestamps.rb index abc1234..def5678 100644 --- a/db/migrate/20161107191141_remove_is_done_from_report_uploads_and_update_submitted_timestamps.rb +++ b/db/migrate/20161107191141_remove_is_done_from_report_uploads_and_update_submitted_timestamps.rb @@ -0,0 +1,26 @@+class RemoveIsDoneFromReportUploadsAndUpdateSubmittedTimestamps < ActiveRecord::Migration + def up + ActiveRecord::Base.connection.execute( + <<-SQL + UPDATE trade_annual_report_uploads + SET submitted_at = updated_at, submitted_by_id = updated_by_id + WHERE is_done = true + SQL + ) + + remove_column :trade_annual_report_uploads, :is_done + + end + + def down + add_column :trade_annual_report_uploads, :is_done, :boolean, default: false + + ActiveRecord::Base.connection.execute( + <<-SQL + UPDATE trade_annual_report_uploads + SET is_done = true + WHERE submitted_by_id IS NOT NULL + SQL + ) + end +end
Add migration to update submitted timestampss
diff --git a/actionpack/test/ts_isolated.rb b/actionpack/test/ts_isolated.rb index abc1234..def5678 100644 --- a/actionpack/test/ts_isolated.rb +++ b/actionpack/test/ts_isolated.rb @@ -1,3 +1,4 @@+$:.unshift(File.dirname(__FILE__)) $:.unshift(File.dirname(__FILE__) + '/../../activesupport/lib') require 'test/unit'
Add test path to LOAD_PATH to fix load error
diff --git a/app/helpers/ezborrow_helper.rb b/app/helpers/ezborrow_helper.rb index abc1234..def5678 100644 --- a/app/helpers/ezborrow_helper.rb +++ b/app/helpers/ezborrow_helper.rb @@ -5,7 +5,7 @@ def ezborrow_url(holding) @ezborrow_url ||= - "#{HoldingRequestsController::EZBORROW_BASE_URL}/ezborrow?query=#{CGI::escape(holding.title)}" + "#{HoldingRequestsController::EZBORROW_BASE_URL}/ezborrow?query=ti:#{CGI::escape(holding.title)}" end private
Change ezborrow search to known title search
diff --git a/app/lib/adhesion/exceptions.rb b/app/lib/adhesion/exceptions.rb index abc1234..def5678 100644 --- a/app/lib/adhesion/exceptions.rb +++ b/app/lib/adhesion/exceptions.rb @@ -17,5 +17,11 @@ super(msg) end end + + class ConcludeEnrollment < StandardError + def initialize(msg = "Unable to conclude Enrollment") + super(msg) + end + end end end
Add error for being unable to conclude enrollment for Course Completion tool
diff --git a/recipes/cleanup.rb b/recipes/cleanup.rb index abc1234..def5678 100644 --- a/recipes/cleanup.rb +++ b/recipes/cleanup.rb @@ -3,7 +3,7 @@ remove_file "public/index.html" remove_file "public/images/rails.png" remove_file "config/database.yml" -append_file '.gitignore', "config/database.yml\nvendor/ruby" +append_file '.gitignore', "config/database.yml\nvendor/ruby\n" # cleanup gemfile, by removing all commented lines gsub_file "Gemfile", /#.*\n/, "\n"
Add proper newline after gitignore-ing vendored gems
diff --git a/recipes/default.rb b/recipes/default.rb index abc1234..def5678 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -12,6 +12,7 @@ application app_path do javascript "4" environment.update("PORT" => "80") + environment.update(app["environment"]) git app_path do repository app["app_source"]["url"] @@ -23,5 +24,7 @@ end npm_install - npm_start + npm_start do + action [:stop, :enable, :start] + end end
Support OpsWorks app environment variables Pass environment variables from OpsWorks to the upstart job, so the application may pick it up. Restart is necessary to make upstart re-read the config, so changes take effect.
diff --git a/db/migrate/20181026095008_unique_constraints_on_platforms_sections_and_datasets.data_uploader.rb b/db/migrate/20181026095008_unique_constraints_on_platforms_sections_and_datasets.data_uploader.rb index abc1234..def5678 100644 --- a/db/migrate/20181026095008_unique_constraints_on_platforms_sections_and_datasets.data_uploader.rb +++ b/db/migrate/20181026095008_unique_constraints_on_platforms_sections_and_datasets.data_uploader.rb @@ -1,14 +1,19 @@ # This migration comes from data_uploader (originally 20181024100559) class UniqueConstraintsOnPlatformsSectionsAndDatasets < ActiveRecord::Migration[5.2] def up + # preemptive measures to avoid breaking migrations + execute 'ALTER TABLE datasets DROP CONSTRAINT IF EXISTS datasets_section_id_name_key' + execute 'ALTER TABLE sections DROP CONSTRAINT IF EXISTS sections_platform_id_name_key' + execute 'ALTER TABLE platforms DROP CONSTRAINT IF EXISTS platforms_name_key' + execute 'ALTER TABLE datasets ADD CONSTRAINT datasets_section_id_name_key UNIQUE (section_id, name)' execute 'ALTER TABLE sections ADD CONSTRAINT sections_platform_id_name_key UNIQUE (platform_id, name)' execute 'ALTER TABLE platforms ADD CONSTRAINT platforms_name_key UNIQUE (name)' end def down - execute 'ALTER TABLE datasets DROP CONSTRAINT datasets_section_id_name_key' - execute 'ALTER TABLE sections DROP CONSTRAINT sections_platform_id_name_key' - execute 'ALTER TABLE platforms DROP CONSTRAINT platforms_name_key' + execute 'ALTER TABLE datasets DROP CONSTRAINT IF EXISTS datasets_section_id_name_key' + execute 'ALTER TABLE sections DROP CONSTRAINT IF EXISTS sections_platform_id_name_key' + execute 'ALTER TABLE platforms DROP CONSTRAINT IF EXISTS platforms_name_key' end end
Update migrations to avoid crashing if constants already exist
diff --git a/app/admin/optional_module.rb b/app/admin/optional_module.rb index abc1234..def5678 100644 --- a/app/admin/optional_module.rb +++ b/app/admin/optional_module.rb @@ -36,4 +36,17 @@ f.actions end + + # + # == Controller + # + controller do + def update + if params[:optional_module][:name] == 'Adult' + cookies.delete :adult_validated + end + + update! + end + end end
Remove adult_validated cookie when Adult OptionalModule is disabled
diff --git a/app/models/page.rb b/app/models/page.rb index abc1234..def5678 100644 --- a/app/models/page.rb +++ b/app/models/page.rb @@ -23,7 +23,7 @@ end def self.update_visuals - Page.where(visual_url: nil).find_each do |page| + Page.where(visual_url: nil).order('created_at DESC').each do |page| begin page.update_visual_url rescue
Update Page::update_visuals: update in recent order
diff --git a/app/models/post.rb b/app/models/post.rb index abc1234..def5678 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -38,6 +38,7 @@ end def create_tags_from_description + tags.clear @tags_list.each do |tag_title| if not tags.exists?({title: tag_title}) tags.create!({title: tag_title, user_id: self.user_id})
Clear tags before updating them
diff --git a/app/models/site.rb b/app/models/site.rb index abc1234..def5678 100644 --- a/app/models/site.rb +++ b/app/models/site.rb @@ -1,3 +1,5 @@ class Site < ApplicationRecord - has_many :bookmarks + has_many :bookmarks, dependent: :destroy + + after_touch :destroy, if: -> { bookmarks.empty? } end
Destroy Site when has no bookmarks
diff --git a/spec/rover_spec.rb b/spec/rover_spec.rb index abc1234..def5678 100644 --- a/spec/rover_spec.rb +++ b/spec/rover_spec.rb @@ -6,4 +6,9 @@ it "creates a curiosity rover" do expect(rover.name).to eq("curiosity") end + + it "retrieves the photos for a rover when give sol" do + sol = 1000 + expect(rover.get(sol)).not_to be_nil + end end
Add rspec to check the get method for Rover class
diff --git a/horsefield.gemspec b/horsefield.gemspec index abc1234..def5678 100644 --- a/horsefield.gemspec +++ b/horsefield.gemspec @@ -15,7 +15,7 @@ spec.files = `git ls-files -z`.split("\x0") spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } - spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) + spec.test_files = spec.files.grep(%r{^(test|spec|features|lib)/}) spec.require_paths = ["lib"] spec.add_dependency 'nokogiri'
Add lib to list of spec files
diff --git a/OpenWebRTC.podspec b/OpenWebRTC.podspec index abc1234..def5678 100644 --- a/OpenWebRTC.podspec +++ b/OpenWebRTC.podspec @@ -4,8 +4,8 @@ s.summary = "SDK for adding WebRTC to your app through OpenWebRTC" s.homepage = "http://www.openwebrtc.io" s.license = { :type => "BSD-2", :file => "LICENSE" } - s.author = { "Ericsson Research" => "labs@ericsson.com" } - s.platform = :ios, "8.0" + s.author = { "Ericsson AB" => "labs@ericsson.com" } + s.platform = :ios, "7.1" s.source = { :git => "https://github.com/EricssonResearch/openwebrtc-ios-sdk.git", :tag => "0.1"
Change author and platform req
diff --git a/HTAutocompleteTextField.podspec b/HTAutocompleteTextField.podspec index abc1234..def5678 100644 --- a/HTAutocompleteTextField.podspec +++ b/HTAutocompleteTextField.podspec @@ -1,12 +1,13 @@ Pod::Spec.new do |s| s.name = "HTAutocompleteTextField" - s.version = "1.0.0" + s.version = "1.0.1" s.summary = "A subclass of UITextField that displays text completion suggestions while a user types. Perfect for suggestion email address domains." s.homepage = "https://github.com/hoteltonight/HTAutocompleteTextField" s.license = 'MIT' s.author = { "Jonathan Sibley" => "jon@hoteltonight.com" } - s.source = { :git => "https://github.com/hoteltonight/HTAutocompleteTextField.git", :tag => "1.0.0" } + s.source = { :git => "https://github.com/hoteltonight/HTAutocompleteTextField.git", :tag => "1.0.1" } s.platform = :ios + s.ios.deployment_target = '4.3' s.source_files = 'HTAutocompleteTextField.{h,m}' s.requires_arc = true end
Bump podspec version to 1.0.1 Increment version and add iOS deployment target version.
diff --git a/Library/Homebrew/extend/os/linux/formula.rb b/Library/Homebrew/extend/os/linux/formula.rb index abc1234..def5678 100644 --- a/Library/Homebrew/extend/os/linux/formula.rb +++ b/Library/Homebrew/extend/os/linux/formula.rb @@ -15,9 +15,10 @@ # Ex. 1: "libONE.so.1" # Ex. 2: %r{(libONE|libTWO)\.so} self.class.allowed_missing_libraries.any? do |x| - if x.is_a? Regexp + case x + when Regexp x.match? lib - elsif x.is_a? String + when String lib.include? x end end
Fix style (Convert if-elsif to case-when)