diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/app/controllers/api/search_controller.rb b/app/controllers/api/search_controller.rb index abc1234..def5678 100644 --- a/app/controllers/api/search_controller.rb +++ b/app/controllers/api/search_controller.rb @@ -15,7 +15,7 @@ respond_with( neurons, meta: { - total_items: neurons.count + total_items: neurons.total_count }, each_serializer: Api::NeuronSerializer )
Use total_count instead of count
diff --git a/app/controllers/punchcards_controller.rb b/app/controllers/punchcards_controller.rb index abc1234..def5678 100644 --- a/app/controllers/punchcards_controller.rb +++ b/app/controllers/punchcards_controller.rb @@ -1,2 +1,12 @@ class PunchcardsController < ApplicationController + + before_action :authenticate_user! + before_action :find_punchcard, only: [:show, :edit, :update, :destroy] + + + private + + def find_punchcard + end + end
Add auth to punchcards controller
diff --git a/app/controllers/imports_controller.rb b/app/controllers/imports_controller.rb index abc1234..def5678 100644 --- a/app/controllers/imports_controller.rb +++ b/app/controllers/imports_controller.rb @@ -22,7 +22,7 @@ mixpanel.track "Imported from MyAnimeList", {email: current_user.email} if Rails.env.production? rescue - flash[:error] = "There was a problem importing your anime list. Please send an email to <a href='mailto:josh@hummingbird.me'>josh@hummingbird.me</a> with the file you are trying to import.".html_safe + flash[:error] = "There was a problem importing your anime list. Please send an email to <a href='mailto:vikhyat@hummingbird.me'>vikhyat@hummingbird.me</a> with the file you are trying to import.".html_safe redirect_to "/users/edit" return end
CHange MAL import failure email address.
diff --git a/app/controllers/metrics_controller.rb b/app/controllers/metrics_controller.rb index abc1234..def5678 100644 --- a/app/controllers/metrics_controller.rb +++ b/app/controllers/metrics_controller.rb @@ -1,12 +1,14 @@ class MetricsController < ApplicationController include Layouts::ApplicationLayoutHelper + START = 60*60*3 + STOP = 0 # GET def get - #begin + now = Time.now().to_i - _start = params[:start] - _end = params[:end] + _start = params[:start] || now - START + _end = params[:end] || now - STOP m = params["metric"] options = (graph.view == "cubism" ? {datapoints: 700} : {} ) @@ -19,7 +21,6 @@ end end - # Functions def backend Backend::GenericBackend.new
Include default values for metrics endpoint if none are supplied
diff --git a/normalize-scss.gemspec b/normalize-scss.gemspec index abc1234..def5678 100644 --- a/normalize-scss.gemspec +++ b/normalize-scss.gemspec @@ -21,14 +21,11 @@ s.files = %w[ _normalize.scss - bower.json CHANGELOG.md - component.json CONTRIBUTING.md lib/normalize-scss.rb LICENSE.md normalize-scss.gemspec README.md - test.html ] end
Remove unneeded files from gemspec.
diff --git a/lib/dominion/engine/action/base/feast.rb b/lib/dominion/engine/action/base/feast.rb index abc1234..def5678 100644 --- a/lib/dominion/engine/action/base/feast.rb +++ b/lib/dominion/engine/action/base/feast.rb @@ -6,7 +6,7 @@ def to_s() 'Feast' end def play(turn) - card = turn.select_card turn.game.buyable 5 + card = turn.select_card turn.game.buyable(5) turn.gain(card) if card turn.trash self end
Make Feast card selection clearer.
diff --git a/lib/ghtorrent/migrations/003_add_orgs.rb b/lib/ghtorrent/migrations/003_add_orgs.rb index abc1234..def5678 100644 --- a/lib/ghtorrent/migrations/003_add_orgs.rb +++ b/lib/ghtorrent/migrations/003_add_orgs.rb @@ -10,8 +10,8 @@ end puts("Updating users with default values") - DB.transaction(:rollback => :reraise, :isolation => :committed) do - DB[:users].update(:type => "USR") + transaction(:rollback => :reraise, :isolation => :committed) do + self[:users].update(:type => "USR") end puts("Creating table organization-members")
Fix bug in migration 003 not running from within ghtorrent The DB constant is only defined in the sequel cmd-line tool
diff --git a/lib/metamodel/template/model_relation.rb b/lib/metamodel/template/model_relation.rb index abc1234..def5678 100644 --- a/lib/metamodel/template/model_relation.rb +++ b/lib/metamodel/template/model_relation.rb @@ -0,0 +1,82 @@+public class <%= model.relation_name %>: Relation<<%= model.name %>> { + override init() { + super.init() + self.select = "SELECT \(<%= model.name %>.tableName.unwrapped).* FROM \(<%= model.name %>.tableName.unwrapped)" + } + + func expandColumn(column: <%= model.name %>.Column) -> String { + return "\(<%= model.name %>.tableName.unwrapped).\(column.unwrapped)" + } + + // MARK: Query + + public func find(id: Int) -> Self { + return self.findBy(id: id) + } + + public func findBy(id id: Int) -> Self { + return self.filter([.id: id]).limit(1) + } + + <% model.properties_exclude_id.each do |property| %> + <%= """public func findBy(#{property.name} #{property.name}: #{property.type_without_optional}) -\> Self { + return self.filter([.#{property.name}: #{property.name}]).limit(1) + }""" %> + <% end %> + + public func filter(conditions: [<%= model.name %>.Column: Any]) -> Self { + for (column, value) in conditions { + let columnSQL = "\(expandColumn(column))" + + func filterByEqual(value: Any) { + self.filter.append("\(columnSQL) = \(value)") + } + + func filterByIn(value: [String]) { + self.filter.append("\(columnSQL) IN (\(value.joinWithSeparator(", ")))") + } + + if let value = value as? String { + filterByEqual(value.unwrapped) + } else if let value = value as? Int { + filterByEqual(value) + } else if let value = value as? Double { + filterByEqual(value) + } else if let value = value as? [String] { + filterByIn(value.map { $0.unwrapped }) + } else if let value = value as? [Int] { + filterByIn(value.map { $0.description }) + } else if let value = value as? [Double] { + filterByIn(value.map { $0.description }) + } else { + let valueMirror = Mirror(reflecting: value) + print("!!!: UNSUPPORTED TYPE \(valueMirror.subjectType)") + } + + } + return self + } + + public func groupBy(columns: <%= model.name %>.Column...) -> Self { + return self.groupBy(columns) + } + + public func groupBy(columns: [<%= model.name %>.Column]) -> Self { + func groupBy(column: <%= model.name %>.Column) { + self.group.append("\(expandColumn(column))") + } + _ = columns.flatMap(groupBy) + return self + } + + public func orderBy(column: <%= model.name %>.Column) -> Self { + self.order.append("\(expandColumn(column))") + return self + } + + public func orderBy(column: <%= model.name %>.Column, asc: Bool) -> Self { + self.order.append("\(expandColumn(column)) \(asc ? "ASC".unwrapped : "DESC".unwrapped)") + return self + } + +}
Complete model relation template file
diff --git a/spec/pagseguro/payment_request/response_spec.rb b/spec/pagseguro/payment_request/response_spec.rb index abc1234..def5678 100644 --- a/spec/pagseguro/payment_request/response_spec.rb +++ b/spec/pagseguro/payment_request/response_spec.rb @@ -10,7 +10,7 @@ "[]" => nil ) - Aitch::Response.new(Aitch::Configuration.new, response) + Aitch::Response.new({xml_parser: Aitch::XMLParser}, response) end let(:http_response) { xml_response("payment_request/success.xml") }
Update spec to conform new Aitch API.
diff --git a/lib/graphql/analysis/ast/field_usage.rb b/lib/graphql/analysis/ast/field_usage.rb index abc1234..def5678 100644 --- a/lib/graphql/analysis/ast/field_usage.rb +++ b/lib/graphql/analysis/ast/field_usage.rb @@ -9,7 +9,7 @@ @used_deprecated_fields = Set.new end - def on_leave_field(parent, node, visitor) + def on_leave_field(node, parent, visitor) field_defn = visitor.field_definition field = "#{visitor.parent_type_definition.name}.#{field_defn.name}" @used_fields << field
Fix FieldUsage analyzer method args
diff --git a/lib/tasks/export_mainstream_taxons.rake b/lib/tasks/export_mainstream_taxons.rake index abc1234..def5678 100644 --- a/lib/tasks/export_mainstream_taxons.rake +++ b/lib/tasks/export_mainstream_taxons.rake @@ -6,6 +6,7 @@ answer guide simple_smart_answer + smart_answer transaction completed_transaction travel_advice_index
Add support for exporting smart answers content This adds support for the new `smart_answer` schema when exporting taxons of mainstream content as CSV. Previously smart answers were represented by the transaction schema. This ensures the functionality doesn't break when Smart Answer flows are republished with the new schema.
diff --git a/mill.gemspec b/mill.gemspec index abc1234..def5678 100644 --- a/mill.gemspec +++ b/mill.gemspec @@ -25,7 +25,6 @@ s.add_dependency 'kramdown' s.add_dependency 'nokogiri' s.add_dependency 'path' - s.add_dependency 'rmagick' s.add_dependency 'sinatra' s.add_development_dependency 'bundler'
Remove RMagick, since resizing no longer necessary.
diff --git a/moob.gemspec b/moob.gemspec index abc1234..def5678 100644 --- a/moob.gemspec +++ b/moob.gemspec @@ -9,8 +9,8 @@ s.name = 'moob' s.version = Moob::VERSION.join '.' s.platform = Gem::Platform::RUBY - s.authors = ['Pierre Carrier'] - s.email = ['pierre@spotify.com'] + s.authors = ['Nathan Ferch'] + s.email = ['nf@spotify.com'] s.homepage = "https://github.com/spotify/moob" s.summary = 'Manage Out-Of-Band!' s.description = 'Control systems using Web-based out-of-band managers without a browser'
Update gemspec author since nf took maintainership
diff --git a/chinese_faker.gemspec b/chinese_faker.gemspec index abc1234..def5678 100644 --- a/chinese_faker.gemspec +++ b/chinese_faker.gemspec @@ -20,5 +20,9 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] + spec.add_development_dependency "bundler", "~> 1.15" + spec.add_development_dependency "rake", "~> 10.0" + spec.add_development_dependency "minitest", "~> 5.0" + spec.add_dependency('i18n', '~> 0.9') end
Add development dependency for running rake
diff --git a/omnibus-delivery-cli/config/projects/delivery-cli.rb b/omnibus-delivery-cli/config/projects/delivery-cli.rb index abc1234..def5678 100644 --- a/omnibus-delivery-cli/config/projects/delivery-cli.rb +++ b/omnibus-delivery-cli/config/projects/delivery-cli.rb @@ -5,6 +5,7 @@ # name "delivery-cli" +friendly_name "Delivery CLI" maintainer "Chef Software, Inc." homepage "http://chef.io"
Add friendly name to Omnibus project config
diff --git a/Charts.podspec b/Charts.podspec index abc1234..def5678 100644 --- a/Charts.podspec +++ b/Charts.podspec @@ -2,13 +2,13 @@ s.name = "Charts" s.version = "2.2.3" s.summary = "ios-charts is a powerful & easy to use chart library for iOS, tvOS and OSX" - s.homepage = "https://github.com/danielgindi/ios-charts" + s.homepage = "https://github.com/StephenVinouze/ios-charts" s.license = { :type => "Apache License, Version 2.0", :file => "LICENSE" } s.authors = "Daniel Cohen Gindi", "Philipp Jahoda" s.ios.deployment_target = "8.0" s.tvos.deployment_target = "9.0" s.osx.deployment_target = "10.11" - s.source = { :git => "https://github.com/danielgindi/ios-charts.git", :tag => "v#{s.version}" } + s.source = { :git => "https://github.com/StephenVinouze/ios-charts.git", :tag => "v#{s.version}" } s.default_subspec = "Core" s.prepare_command = "sed -i '' -e 's/import Charts//g' ChartsRealm/Classes/**/*.swift"
Update podspec to point to forked repo
diff --git a/Casks/phoenix-slides.rb b/Casks/phoenix-slides.rb index abc1234..def5678 100644 --- a/Casks/phoenix-slides.rb +++ b/Casks/phoenix-slides.rb @@ -1,8 +1,8 @@ cask :v1 => 'phoenix-slides' do - version '1.3.1' - sha256 '6e5df9e586bb33b79249d9917f99f50395f255b85bf39c5fafca64fe66aef758' + version '1.4.0' + sha256 'ab65a2c2be1b8975f27cfed925c5d820e77e7089c0ab83c15d30bc930f1bf21f' - url "http://blyt.net/phxslides/phoenix-slides-#{version.delete('.')}.zip" + url "http://blyt.net/phxslides/phoenix-slides-#{version.delete('.')}.dmg" name 'Phoenix Slides' homepage 'http://blyt.net/phxslides' license :gpl
Update Phoenix Slides.app to 1.4.0
diff --git a/Casks/thunderbird-ja.rb b/Casks/thunderbird-ja.rb index abc1234..def5678 100644 --- a/Casks/thunderbird-ja.rb +++ b/Casks/thunderbird-ja.rb @@ -1,6 +1,6 @@ cask :v1 => 'thunderbird-ja' do - version '38.2.0' - sha256 '2014b6fac54d398f63c442cc531ddfa77b604ecd616a98e67b2197225135398b' + version '38.3.0' + sha256 '0b023a4173b05f59589124db197bac413c4d81f8d53894cb0e2c57ef2b2d53c4' url "https://download.mozilla.org/?product=thunderbird-#{version}&os=osx&lang=ja-JP-mac" name 'Mozilla Thunderbird'
Upgrade Thunderbird (Japanese) to 38.3.0
diff --git a/updater.rb b/updater.rb index abc1234..def5678 100644 --- a/updater.rb +++ b/updater.rb @@ -9,8 +9,8 @@ DOWNLOAD_URI = 'https://raw.githubusercontent.com/Stawberri/twitter_dbooks/master/v2.rb' START_COMMAND = 'ebooks start' -error_message = '' begin + error_message = '' raise IOError, NO_DOWNLOAD_ERROR_MESSAGE if ENV[NO_DOWNLOAD_ENV] == NO_DOWNLOAD_VALUE File.open DESTINATION_FILE, 'w' do |destination| open DOWNLOAD_URI do |source| @@ -29,4 +29,8 @@ end end end -system({ERROR_ENV => error_message}, START_COMMAND) +begin + system({ERROR_ENV => error_message}, START_COMMAND) +ensure + File.delete DESTINATION_FILE rescue nil +end
Delete downloaded file after running complete This line really has no effect on anything whatsoever, and I'm just adding it because I keep accidentally editing bots.rb instead of v2.rb in my development environment. Also moved a line inside begin statement so everything could be contained inside. Feels cleaner.
diff --git a/DateRangePicker.podspec b/DateRangePicker.podspec index abc1234..def5678 100644 --- a/DateRangePicker.podspec +++ b/DateRangePicker.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'DateRangePicker' - s.version = '2.1' + s.version = '3.0' s.homepage = 'https://github.com/MrMage/DateRangePicker' s.summary = 'The best (?) date range picker control for OS X.' @@ -13,7 +13,7 @@ s.source_files = 'DateRangePicker/*.{h,swift}' s.module_name = 'DateRangePicker' - s.source = { :git => 'https://github.com/MrMage/DateRangePicker.git', :tag => "v2.1" } + s.source = { :git => 'https://github.com/MrMage/DateRangePicker.git', :tag => "v3.0" } s.requires_arc = true s.frameworks = 'AppKit', 'Foundation'
Update the Podspec to v3.0.
diff --git a/POSRx.podspec b/POSRx.podspec index abc1234..def5678 100644 --- a/POSRx.podspec +++ b/POSRx.podspec @@ -1,11 +1,11 @@ Pod::Spec.new do |s| s.name = 'POSRx' - s.version = '0.6.0' + s.version = '0.6.1' s.license = 'MIT' s.summary = 'Utilities around ReactiveCocoa.' s.homepage = 'https://github.com/pavelosipov/POSRx' s.authors = { 'Pavel Osipov' => 'posipov84@gmail.com' } - s.source = { :git => 'https://github.com/pavelosipov/POSRx.git', :tag => '0.6.0' } + s.source = { :git => 'https://github.com/pavelosipov/POSRx.git', :tag => '0.6.1' } s.platform = :ios, '7.0' s.requires_arc = true s.source_files = 'POSRx/**/*.{h,m}'
Update podspec versino: 0.6.0 -> 0.6.1
diff --git a/examples/extract-contents-from-web.rb b/examples/extract-contents-from-web.rb index abc1234..def5678 100644 --- a/examples/extract-contents-from-web.rb +++ b/examples/extract-contents-from-web.rb @@ -0,0 +1,46 @@+require 'pathname' +require 'tmpdir' +require 'epub/parser' +require 'epub/ocf/physical_container/unpacked_uri' + +EPUB_URI = URI.parse(ARGV.shift) +DOWNLOAD_DIR = Pathname.new(ARGV.shift || Dir.mktmpdir('epub-parser')) +$stderr.puts <<EOI +Started downloading EPUB contents... + from: #{EPUB_URI} + to: #{DOWNLOAD_DIR} +EOI + +# Make it possible to use URI as EPUB file path +EPUB::OCF::PhysicalContainer.adapter = :UnpackedURI + +def main + make_mimetype + + container_xml = 'META-INF/container.xml' + download container_xml + + epub = EPUB::Parser.parse(EPUB_URI, container_adapter: :UnpackedURI) + download epub.rootfile_path + + epub.resources.each do |resource| + download resource.entry_name + end + puts DOWNLOAD_DIR +end + +def make_mimetype + $stderr.puts "Making mimetype file..." + DOWNLOAD_DIR.join('mimetype').write 'application/epub+zip' +end + +def download(path) + path = path.to_s + src = EPUB_URI + path + dest = DOWNLOAD_DIR + path + $stderr.puts "Downloading #{path} ..." + dest.dirname.mkpath + dest.write src.read +end + +main
Add example script for UnpackedURI
diff --git a/spec/implementation.rb b/spec/implementation.rb index abc1234..def5678 100644 --- a/spec/implementation.rb +++ b/spec/implementation.rb @@ -1,25 +1,40 @@ require File.expand_path("../spec_helper", __FILE__) WatirSpec.implementation do |imp| - name = :webdriver browser = (ENV['WATIR_WEBDRIVER_BROWSER'] || :firefox).to_sym - imp.name = name + imp.name = :webdriver imp.browser_class = Watir::Browser - if browser == :firefox && ENV['NATIVE_EVENTS'] == "true" + use_native_events = ENV['NATIVE_EVENTS'] == "true" + + if browser == :firefox && use_native_events profile = Selenium::WebDriver::Firefox::Profile.new profile.native_events = true imp.browser_args = [:firefox, {:profile => profile}] - elsif browser == :chrome && ENV['NATIVE_EVENTS'] == "true" + elsif browser == :chrome && use_native_events imp.browser_args = [:chrome, {:native_events => true}] else imp.browser_args = [browser] end + matching_guards = [ + :webdriver, # guard only applies to webdriver + browser, # guard only applies to this browser + [:webdriver, browser] # guard only applies to this browser on webdriver + ] + + if use_native_events || (Selenium::WebDriver::Platform.windows? && [:firefox, :ie].include?(browser)) + # guard only applies to this browser on webdriver with native events enabled + matching_guards << [:webdriver, browser, :native_events] + else + # guard only applies to this browser on webdriver with native events disabled + matching_guards << [:webdriver, browser, :synthesized_events] + end + imp.guard_proc = lambda { |args| - args.any? { |arg| arg == name || arg == browser || arg == [name, browser]} + args.any? { |arg| matching_guards.include?(arg) } } end
Add the ability to differentiate native vs synthesized events when running specs.
diff --git a/spec/kinetosis_spec.rb b/spec/kinetosis_spec.rb index abc1234..def5678 100644 --- a/spec/kinetosis_spec.rb +++ b/spec/kinetosis_spec.rb @@ -6,26 +6,27 @@ describe Kinetosis do before do - @object = Object.new - @object.extend(Kinetosis) + @mbp = Object.new.extend(Kinetosis) end describe "when asked for xyz" do - it "should respond with an array with three values" do - @object.xyz.size.must_equal 3 + it "should respond with an array consisting of three fixnums" do + @mbp.xyz.size.must_equal 3 + @mbp.xyz.map { |v| v.class.must_equal Fixnum } end end - describe "when asked about x" do - it "should respond with an integer" do - @object.x.class + describe "when asked about x and y individually" do + it "should respond with integers" do + (-255..255).must_include @mbp.x + (-255..255).must_include @mbp.y end end describe "when the laptop is standing on a table" do it "should respond with an x = <5 and y = <0" do - (0..5).must_include @object.x - (-5..0).must_include @object.y + (0..5).must_include @mbp.x + (-5..0).must_include @mbp.y end end end
Check that x and y respond with a signed integer between -255 and 255. Renamed @object -> @mbp
diff --git a/spec/skip_test_spec.rb b/spec/skip_test_spec.rb index abc1234..def5678 100644 --- a/spec/skip_test_spec.rb +++ b/spec/skip_test_spec.rb @@ -1,5 +1,5 @@ # xdescribe makes all test cases under this scenario go into skip mode -describe "Skip 101" do +xdescribe "Skip 101" do # appending 'x' on a test case skips its execution xit "Assertions on equality" do
Use xdescribe to avoid confusion on test
diff --git a/Verso.podspec b/Verso.podspec index abc1234..def5678 100644 --- a/Verso.podspec +++ b/Verso.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'Verso' - s.version = '1.0.0' + s.version = '1.0.1' s.summary = 'A multi-paged image viewer for iOS' s.description = <<-DESC
Increase version number to 1.0.1
diff --git a/getinline.gemspec b/getinline.gemspec index abc1234..def5678 100644 --- a/getinline.gemspec +++ b/getinline.gemspec @@ -6,21 +6,13 @@ Gem::Specification.new do |spec| spec.name = 'getinline' spec.version = Getinline::VERSION - spec.authors = ['Jeremy Kahn'] + spec.authors = ['Jeremy Kahn', 'Travis Pennetti'] spec.email = ['jeremy@jellyvision.com'] spec.summary = 'Inlines CSS styles for HTML email development' spec.description = 'Inlines CSS styles for HTML email development and preserves ERB tags' spec.homepage = 'https://github.com/jellyvision/getinline' spec.license = 'MIT' - - # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or - # delete this section to allow pushing this gem to any host. - if spec.respond_to?(:metadata) - spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'" - else - fail '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'
Fix merge conflicts, add author
diff --git a/gititback.gemspec b/gititback.gemspec index abc1234..def5678 100644 --- a/gititback.gemspec +++ b/gititback.gemspec @@ -0,0 +1,53 @@+# Generated by jeweler +# DO NOT EDIT THIS FILE DIRECTLY +# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command +# -*- encoding: utf-8 -*- + +Gem::Specification.new do |s| + s.name = %q{gititback} + s.version = "0.0.1" + + s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= + s.authors = ["theworkinggroup", "tadman"] + s.date = %q{2009-11-06} + s.description = %q{Uses git to store backups of critical system data} + s.email = %q{github@tadman.ca} + s.extra_rdoc_files = [ + "LICENSE", + "README.rdoc" + ] + s.files = [ + ".document", + ".gitignore", + "LICENSE", + "README.rdoc", + "Rakefile", + "VERSION", + "lib/gititback.rb", + "test/helper.rb", + "test/test_gititback.rb" + ] + s.homepage = %q{http://github.com/theworkinggroup/gititback} + s.rdoc_options = ["--charset=UTF-8"] + s.require_paths = ["lib"] + s.rubygems_version = %q{1.3.5} + s.summary = %q{GitItBack Server Backup and Recovery System} + s.test_files = [ + "test/helper.rb", + "test/test_gititback.rb" + ] + + if s.respond_to? :specification_version then + current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION + s.specification_version = 3 + + if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then + s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"]) + else + s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"]) + end + else + s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"]) + end +end +
Set to proper Github location
diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index abc1234..def5678 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -13,14 +13,14 @@ authenticate_user! @game = Game.find(params[:id]) @game.upvote_by(current_user) - redirect_to games_path + redirect_to :back end def unupvote authenticate_user! @game = Game.find(params[:id]) @game.unvote_by(current_user) - redirect_to games_path + redirect_to :back end def upload
Fix voting from game page.
diff --git a/app/controllers/login_controller.rb b/app/controllers/login_controller.rb index abc1234..def5678 100644 --- a/app/controllers/login_controller.rb +++ b/app/controllers/login_controller.rb @@ -1,5 +1,22 @@ class LoginController < ApplicationController get '/' do + redirect to '../' if authenticated? + slim :'login/login' end + + post '/' do + redirect to '../' if authenticated? + + redirect to '../' if authenticate(params[:email], params[:password]) + + redirect to '/' + end + + private + + def authenticate(email, password) + user = User.find_by_email(email) + session[:user] = user.id if user and user.password == password + end end
Add authenticate method and post route
diff --git a/app/models/concerns/http_request.rb b/app/models/concerns/http_request.rb index abc1234..def5678 100644 --- a/app/models/concerns/http_request.rb +++ b/app/models/concerns/http_request.rb @@ -7,16 +7,18 @@ end def self.get_request(key:, uri_string:) - # http://stackoverflow.com/a/4581116/4765379 - url = URI.parse(uri_string) - request = Net::HTTP::Get.new(url.to_s) - response = Net::HTTP.start(url.host, url.port, :use_ssl => url.scheme == 'https') {|http| - http.request(request) - } - if response.code.to_i >= 200 && response.code.to_i < 400 - response.body - else - raise APICache::InvalidResponse + APICache.get(key, :cache => 60) do + # http://stackoverflow.com/a/4581116/4765379 + url = URI.parse(uri_string) + request = Net::HTTP::Get.new(url.to_s) + response = Net::HTTP.start(url.host, url.port, :use_ssl => url.scheme == 'https') {|http| + http.request(request) + } + if response.code.to_i >= 200 && response.code.to_i < 400 + response.body + else + raise APICache::InvalidResponse + end end end
Reimplement APICache but heavily reduce the cache time
diff --git a/app/services/crop_search_service.rb b/app/services/crop_search_service.rb index abc1234..def5678 100644 --- a/app/services/crop_search_service.rb +++ b/app/services/crop_search_service.rb @@ -10,12 +10,13 @@ match: :word_start, boost_by: [:plantings_count], includes: %i(scientific_names alternate_names), - misspellings: { edit_distance: 2 } + misspellings: { edit_distance: 2 }, + load: false } # prioritise crops the member has planted search_params[:boost_where] = { planters_ids: current_member.id } if current_member - Crop.search(query, search_params, load: false) + Crop.search(query, search_params) end def self.random_with_photos(limit)
Load crops from search, without hitting the database
diff --git a/discogs.gemspec b/discogs.gemspec index abc1234..def5678 100644 --- a/discogs.gemspec +++ b/discogs.gemspec @@ -21,7 +21,7 @@ s.add_development_dependency "rspec", "= 2.12.0" s.add_development_dependency "simplecov", "= 0.7.1" - s.add_runtime_dependency "hashie", "~> 2.1" + s.add_runtime_dependency "hashie" s.add_runtime_dependency "oauth", "~> 0.4.7" end
Remove Hashie version in gemspec
diff --git a/SwiftCarousel.podspec b/SwiftCarousel.podspec index abc1234..def5678 100644 --- a/SwiftCarousel.podspec +++ b/SwiftCarousel.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "SwiftCarousel" - s.version = "0.5" + s.version = "0.6" s.summary = "Infinite carousel of options." s.description = "SwiftCarousel is a fully native Swift UIScrollView wrapper, that allows you to infinite circular scroll with UIView objects." s.homepage = "https://github.com/Sunshinejr/SwiftCarousel"
[CocoaPods] Update podspec for 0.6 version
diff --git a/Casks/beyond-compare.rb b/Casks/beyond-compare.rb index abc1234..def5678 100644 --- a/Casks/beyond-compare.rb +++ b/Casks/beyond-compare.rb @@ -1,8 +1,9 @@ cask :v1 => 'beyond-compare' do - version '4.0.4.19477' - sha256 'f37569d5f116ac76607e4c0df6081cf93d8c16ac61c4350e8e9495cc89714ceb' + version '4.0.5.19480' + sha256 'e829feb875374e3212d10d925e5976ae816c917257673861896f624b3ca0381e' url "http://www.scootersoftware.com/BCompareOSX-#{version}.zip" + name 'Beyond Compare' homepage 'http://www.scootersoftware.com/' license :commercial
Update Beyond Compare.app to v4.0.5.19480 & add name
diff --git a/DSAWSOperations.podspec b/DSAWSOperations.podspec index abc1234..def5678 100644 --- a/DSAWSOperations.podspec +++ b/DSAWSOperations.podspec @@ -12,6 +12,6 @@ s.platform = :ios, '6.0' s.source_files = 'DSAWSOperations', 'DSAWSOperations/**/*.{h,m}' s.exclude_files = 'Classes/Exclude' - s.frameworks = 'AWSAutoScaling', 'AWSCloudWatch', 'AWSDynamoDB', 'AWSEC2', 'AWSElasticLoadBalancing', 'AWSRuntime', 'AWSS3', 'AWSSecurityTokenService', 'AWSSES', 'AWSSimpleDB', 'AWSSNS', 'AWSSQS' s.requires_arc = true + s.dependency 'AWSiOSSDK', '~> 1.7.0' end
Update podspec to use a dependency on the iOS SDK instead of the frameworks.
diff --git a/BlocksKit.podspec b/BlocksKit.podspec index abc1234..def5678 100644 --- a/BlocksKit.podspec +++ b/BlocksKit.podspec @@ -1,12 +1,12 @@ Pod::Spec.new do |s| s.name = 'BlocksKit' - s.version = '1.0.0' + s.version = '1.0.1' s.license = 'MIT' s.summary = 'The Objective-C block utilities you always wish you had.' s.homepage = 'https://github.com/zwaldowski/BlocksKit' s.author = { 'Zachary Waldowski' => 'zwaldowski@gmail.com', 'Alexsander Akers' => 'a2@pandamonia.us' } - s.source = { :git => 'https://github.com/zwaldowski/BlocksKit.git', :tag => 'v1.0.0' } + s.source = { :git => 'https://github.com/zwaldowski/BlocksKit.git', :tag => 'v1.0.1' } s.source_files = 'BlocksKit' s.dependency 'A2DynamicDelegate' s.clean_paths = 'GHUnitIOS.framework/', 'Tests/', 'BlocksKit.xcodeproj/', '.gitignore'
Update pod spec for 1.0.1. Signed-off-by: Zachary Waldowski <f6cb034ae1bf314d2c0261a7a22e4684d1f74b57@gmail.com>
diff --git a/db/seeds/expense_types.rb b/db/seeds/expense_types.rb index abc1234..def5678 100644 --- a/db/seeds/expense_types.rb +++ b/db/seeds/expense_types.rb @@ -5,8 +5,6 @@ 'Conference and view - hotel stay', 'Conference and view - train', 'Conference and view - travel time', - 'Costs judge application fee', - 'Costs judge Preparation award', 'Travel and hotel - car', 'Travel and hotel - conference and view', 'Travel and hotel - hotel stay',
Remove Unused expense types from seed data The two Cost Judge expense types in the seed data are not used in real life, and cannot be migrated as part of the expense type refactor. This PR removes them from the seed data so that demo data claims using them is not created.
diff --git a/tradera.rb b/tradera.rb index abc1234..def5678 100644 --- a/tradera.rb +++ b/tradera.rb @@ -1,9 +1,11 @@ require 'open-uri' require 'savon' +# FIXME: Could be cool to use method_missing with the SOAP API class Tradera # Credentials for Campanja test app + # TODO: Move this outside the module! AppId = ENV['APP_ID'] ServiceKey = ENV['SERVICE_KEY'] PublicKey = ENV['PUBLIC_KEY']
Add some comments to Tradera module
diff --git a/Casks/gpgtools.rb b/Casks/gpgtools.rb index abc1234..def5678 100644 --- a/Casks/gpgtools.rb +++ b/Casks/gpgtools.rb @@ -0,0 +1,10 @@+class Gpgtools < Cask + url 'https://s3.amazonaws.com/gpgtools/GPGTools-2013.5.20.dmg' + homepage 'https://gpgtools.org/index.html' + version '2013.05.20' + sha1 '9f9fea935b3ce90d8d04542a754b8778f82a8b1b' + install 'GPGTools.pkg' + uninstall( + :pkgutil => 'org.gpgtools.*' + ) +end
Add GPGTools 2013.05.20 - tweaked for new uninstall syntax Closes #350 Signed-off by: Fernando Paredes <nanoid.xd@gmail.com>
diff --git a/LightRoute.podspec b/LightRoute.podspec index abc1234..def5678 100644 --- a/LightRoute.podspec +++ b/LightRoute.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "LightRoute" - s.version = "2.1.10" + s.version = "2.1.11" s.summary = "LightRoute is easy transition between view controllers and support many popylar arhitectures" s.description = <<-DESC LightRoute is easy transition between view controllers and support many popylar arhitectures. This framework very flow for settings your transition and have userfriendly API.
Update spec to version 2.1.11
diff --git a/inflorm.gemspec b/inflorm.gemspec index abc1234..def5678 100644 --- a/inflorm.gemspec +++ b/inflorm.gemspec @@ -23,6 +23,6 @@ spec.add_development_dependency "rake", "~> 10.0" spec.add_development_dependency "rspec", "~> 3.0" - spec.add_dependency "activemodel", ">= 4.2", "<= 5.0" + spec.add_dependency "activemodel", ">= 4.2", "< 5.2" spec.add_dependency "virtus", "~> 1.0" end
Support activemodel up to 5.1.x Previously we were capped at 5.0.0; support patch versions in the 5.0 line as well as the 5.1 line.
diff --git a/spec/acceptances/manage_spec.rb b/spec/acceptances/manage_spec.rb index abc1234..def5678 100644 --- a/spec/acceptances/manage_spec.rb +++ b/spec/acceptances/manage_spec.rb @@ -1,9 +1,19 @@ require 'rails_helper' -feature "Manage users", type: :feature do - scenario "Show the list of users", js: true do - User.create!(name: "Guirec Corbel", age: 29) +feature 'Manage users', type: :feature do + scenario 'Show the list of users', js: true do + User.create!(name: 'Guirec Corbel', age: 29) visit users_path - expect(page).to have_content("Guirec Corbel") + expect(page).to have_content('Guirec Corbel') + end + + scenario 'Create a new user', js: true do + visit users_path + click_on 'Add a new' + fill_in 'Name', with: 'Guirec Corbel' + fill_in 'Age', with: 29 + click_on 'Save changes' + + expect(page).to have_content('Guirec Corbel') end end
Add the scenario to add a new user
diff --git a/db/migrate/20140815125817_create_notifications.rb b/db/migrate/20140815125817_create_notifications.rb index abc1234..def5678 100644 --- a/db/migrate/20140815125817_create_notifications.rb +++ b/db/migrate/20140815125817_create_notifications.rb @@ -27,11 +27,12 @@ u.password = password u.password_confirmation = password - u.save! print "User created: #{u.email}\n" end - reply.notified_users << u + if u.save + reply.notified_users << u + end end reply.save!
Fix migration of notified users
diff --git a/db/migrate/20170425185231_create_asset_details.rb b/db/migrate/20170425185231_create_asset_details.rb index abc1234..def5678 100644 --- a/db/migrate/20170425185231_create_asset_details.rb +++ b/db/migrate/20170425185231_create_asset_details.rb @@ -10,7 +10,7 @@ t.bigint :resource_id t.string :resource_type t.timestamps - t.index %w(resource_id resource_type), :name => "index_asset_details_on_resource_id_and_resource_type", :using => :btree + t.index %w(resource_id resource_type) end end end
Remove 'name' and 'using' from index Remove 'name' and 'using' from asset details index.
diff --git a/db/migrate/20220105085729_split_customers_name.rb b/db/migrate/20220105085729_split_customers_name.rb index abc1234..def5678 100644 --- a/db/migrate/20220105085729_split_customers_name.rb +++ b/db/migrate/20220105085729_split_customers_name.rb @@ -24,8 +24,8 @@ bill_address = customer.bill_address customer.update( - first_name: bill_address.firstname.strip, - last_name: bill_address.lastname.strip + first_name: bill_address.firstname.to_s.strip, + last_name: bill_address.lastname.to_s.strip ) end
Deal with nil attirubtes on bill_address
diff --git a/spec/factories/ecm_tags_tags.rb b/spec/factories/ecm_tags_tags.rb index abc1234..def5678 100644 --- a/spec/factories/ecm_tags_tags.rb +++ b/spec/factories/ecm_tags_tags.rb @@ -1,6 +1,6 @@ FactoryGirl.define do factory :ecm_tags_tag, class: Ecm::Tags::Tag do - name 'foo' + sequence(:name) { |i| "tag-name-#{i}" } end end
Fix factory for mulitple records.
diff --git a/webhookr.gemspec b/webhookr.gemspec index abc1234..def5678 100644 --- a/webhookr.gemspec +++ b/webhookr.gemspec @@ -5,20 +5,17 @@ # Describe your gem and declare its dependencies: Gem::Specification.new do |s| - gem.name = "webhookr" - gem.version = Webhookr::Services::Mailchimp::VERSION - gem.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= - gem.authors = ["Gerry Power"] - gem.email = ["code@zoocasa.com"] - gem.description = "A Rails Engine to enable webhooks from supported third-party services to your application." - gem.summary = gem.description - gem.homepage = "http://github.com/zoocasa/webhookr" + s.name = "webhookr" + s.version = Webhookr::VERSION + s.authors = ["TODO: Your name"] + s.email = ["TODO: Your email"] + s.homepage = "TODO" + s.summary = "TODO: Summary of Webhookr." + s.description = "TODO: Description of Webhookr." - 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"] - + s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"] + s.test_files = Dir["test/**/*"] + s.add_dependency "rails", ["~> 3.1"] s.add_development_dependency("rake", ["~> 10.0"]) s.add_development_dependency("guard")
Revert "Updated gemspec as per Zoocasa standards" This reverts commit 289303be8582719fcf92700081328a592975950d.
diff --git a/spec/models/proposition_spec.rb b/spec/models/proposition_spec.rb index abc1234..def5678 100644 --- a/spec/models/proposition_spec.rb +++ b/spec/models/proposition_spec.rb @@ -0,0 +1,12 @@+require 'spec_helper' + +describe Proposition do + it "can have a large body" do + body = "a" * 150_000 + + prop = Proposition.new(:body => body) + prop.save! + + prop.body.should == body + end +end
Add spec for proposition body bug.
diff --git a/utf8-cleaner.gemspec b/utf8-cleaner.gemspec index abc1234..def5678 100644 --- a/utf8-cleaner.gemspec +++ b/utf8-cleaner.gemspec @@ -17,6 +17,7 @@ gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) gem.require_paths = ["lib"] + gem.add_development_dependency "rake" gem.add_development_dependency "guard" gem.add_development_dependency "guard-rspec" gem.add_development_dependency "rspec"
Add rake to dev dependencies (for Travis)
diff --git a/Forecastr.podspec b/Forecastr.podspec index abc1234..def5678 100644 --- a/Forecastr.podspec +++ b/Forecastr.podspec @@ -7,7 +7,6 @@ s.author = 'Rob Phillips' s.source = { :git => "https://github.com/iwasrobbed/Forecastr.git", :tag => "v" + s.version.to_s } s.ios.deployment_target = '7.0' - s.osx.deployment_target = '10.8' s.source_files = 'Forecastr' s.resources = "Forecastr/*.plist" s.framework = 'CoreLocation'
Remove OS X support (feel free to fork your own)
diff --git a/spec/support/shared_examples/numerical_submatcher.rb b/spec/support/shared_examples/numerical_submatcher.rb index abc1234..def5678 100644 --- a/spec/support/shared_examples/numerical_submatcher.rb +++ b/spec/support/shared_examples/numerical_submatcher.rb @@ -1,5 +1,3 @@-require 'spec_helper' - shared_examples 'a numerical submatcher' do it 'implements the with_message method' do expect(subject).to respond_to(:with_message).with(1).arguments
Remove "circular require considered harmful" warning
diff --git a/features/support/env.rb b/features/support/env.rb index abc1234..def5678 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -12,12 +12,8 @@ require "aruba/config/jruby" require "rspec/expectations" -Before do |scenario| - command_name = if scenario.respond_to?(:feature) # Cucumber < 4 - "#{scenario.feature.file} #{scenario.name}" - else - "#{scenario.location.file}:#{scenario.location.line} # #{scenario.name}" - end +Before do |test_case| + command_name = "#{test_case.location.file}:#{test_case.location.line} # #{test_case.name}" # Used in simplecov_setup so that each scenario has a different name and # their coverage results are merged instead of overwriting each other as
Remove code supporting cucumber 3 from simplecov set-up
diff --git a/features/support/env.rb b/features/support/env.rb index abc1234..def5678 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -23,5 +23,6 @@ DatabaseCleaner.orm = "active_record" Cucumber::Rails::Database.javascript_strategy = :truncation Capybara.default_driver = :selenium + Capybara.default_wait_time = 500 end
Increase capybara default wait time.
diff --git a/Locksmith.podspec b/Locksmith.podspec index abc1234..def5678 100644 --- a/Locksmith.podspec +++ b/Locksmith.podspec @@ -14,7 +14,6 @@ s.ios.deployment_target = '8.0' s.osx.deployment_target = '10.10' s.watchos.deployment_target = '2.0' - s.tvos.deployment_target = '9.0' s.requires_arc = true
Revert "Add support for tvOS"
diff --git a/db/migrate/20160404152107_add_subscription_to_ext_management_system.rb b/db/migrate/20160404152107_add_subscription_to_ext_management_system.rb index abc1234..def5678 100644 --- a/db/migrate/20160404152107_add_subscription_to_ext_management_system.rb +++ b/db/migrate/20160404152107_add_subscription_to_ext_management_system.rb @@ -0,0 +1,9 @@+class AddSubscriptionToExtManagementSystem < ActiveRecord::Migration[5.0] + def up + add_column :ext_management_systems, :subscription, :string + end + + def down + remove_column :ext_management_systems, :subscription + end +end
Create a new subscription column in the ext_management_systems table. This is part of the solution for BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1318356
diff --git a/db/migrate/20170807055604_add_index_to_searcher_records_for_mroonga.rb b/db/migrate/20170807055604_add_index_to_searcher_records_for_mroonga.rb index abc1234..def5678 100644 --- a/db/migrate/20170807055604_add_index_to_searcher_records_for_mroonga.rb +++ b/db/migrate/20170807055604_add_index_to_searcher_records_for_mroonga.rb @@ -0,0 +1,8 @@+class AddIndexToSearcherRecordsForMroonga < ActiveRecord::Migration + def change + if Redmine::Database.mysql? + add_index(:searcher_records, "original_type", name: "index_searcher_records_on_original_type_perfect_matching") + add_index(:searcher_records, "project_id") + end + end +end
Add missing index for Mroonga * searcher_records.original_type * searcher_records.project_id
diff --git a/lib/dotenv/configuration.rb b/lib/dotenv/configuration.rb index abc1234..def5678 100644 --- a/lib/dotenv/configuration.rb +++ b/lib/dotenv/configuration.rb @@ -1,5 +1,6 @@ require "dotenv" require "dotenv/parser" +require "tempfile" require "dotenv/configuration/version" module Dotenv @@ -15,7 +16,8 @@ raise ArgumentError end - current = Parser.new ::File.read(envfile) + content = ::File.read(envfile) rescue '' + current = Parser.call(content) if settings.keys.any? {|key| !current[key] } t = Tempfile.new("dotenv-configuration") settings.each do |key, default_value|
Handle if file is missing
diff --git a/lib/filewatcher/snapshot.rb b/lib/filewatcher/snapshot.rb index abc1234..def5678 100644 --- a/lib/filewatcher/snapshot.rb +++ b/lib/filewatcher/snapshot.rb @@ -25,8 +25,7 @@ changes[filename] = :deleted unless self[filename] end - changes.reject! { |_filename, event| event.nil? } - changes + changes.tap(&:compact!) end # Class for one file from snapshot
Resolve offenses from new RuboCop
diff --git a/lib/chatroid/adapter.rb b/lib/chatroid/adapter.rb index abc1234..def5678 100644 --- a/lib/chatroid/adapter.rb +++ b/lib/chatroid/adapter.rb @@ -1,8 +1,6 @@ class Chatroid module Adapter - extend self - - def find(service_name) + def self.find(service_name) const_get(service_name) rescue NameError nil
Refactor to be more simple
diff --git a/lib/ditty/db.rb b/lib/ditty/db.rb index abc1234..def5678 100644 --- a/lib/ditty/db.rb +++ b/lib/ditty/db.rb @@ -2,10 +2,12 @@ require 'sequel' require 'ditty/services/logger' +require 'active_support' +require 'active_support/core_ext/object/blank' if defined? DB Ditty::Services::Logger.instance.warn 'Database connection already set up' -elsif ENV['DATABASE_URL'].empty? == false +elsif ENV['DATABASE_URL'].blank? == false # Delete DATABASE_URL from the environment, so it isn't accidently # passed to subprocesses. DATABASE_URL may contain passwords. DB = Sequel.connect(ENV['RACK_ENV'] == 'production' ? ENV.delete('DATABASE_URL') : ENV['DATABASE_URL'])
fix: Use blank instead of empty since nil doesn't have empty?
diff --git a/bin/tomato.rb b/bin/tomato.rb index abc1234..def5678 100644 --- a/bin/tomato.rb +++ b/bin/tomato.rb @@ -0,0 +1,59 @@+#!/usr/bin/env ruby + +require 'growl' +module Tomato + PERIOD = 25 * 60 + + class Log + FILE_PATH = '~/.tomato.log' + + def initialize + @file = File.open(File.expand_path(FILE_PATH), 'a') + end + + def write(message, time) + @file.puts "#{time.to_s} - #{message}" + end + end + + class Timer + def initialize(time_period = PERIOD, log_file = Log.new) + @start_time = nil + @log_file = log_file + @time_period = time_period + end + + def start(message) + @start_time = Time.now + catch_signals + notify('Ready, start, go: ' + message) + @log_file.write(message, @start_time) + sleep @time_period + stop + end + + def stop + notify('End of tomato') + @start_time = nil + @log_file.write('End of tomato', Time.now) + true + end + + def catch_signals + trap("SIGINT") { stop && Process.exit } + end + + def notify(message) + Growl.notify { + self.message = message + self.icon = :jpeg + } + end + end +end + +if __FILE__ == $0 + Process.daemon + tomato = Tomato::Timer.new() + tomato.start(ARGV.to_a.join(' ')) +end
Add pomodoro like script, fun and profit
diff --git a/lib/odd_even.rb b/lib/odd_even.rb index abc1234..def5678 100644 --- a/lib/odd_even.rb +++ b/lib/odd_even.rb @@ -2,11 +2,46 @@ def initialize (user_number) @user_number = user_number -end + end def makearray numbers = 1.upto(@user_number).to_a + i = 0 + + while (i < numbers.length) + if (numbers[i] % 2 == 0) + numbers[i] = "even" + end + + i += 1 + end + numbers +end +end + +=begin + +class FizzBuzz + def initialize(high_limit) + @high_limit = high_limit + end + + def arrayify + numbers = 1.upto(@high_limit).to_a + + i = 0 + + while (i < numbers.length) + if (numbers[i] % 3 == 0) + numbers[i] = "Fizz" + end + + i += 1 + end + + numbers + end end -end+=end
Create Array that replaces even numbers with even
diff --git a/lib/hirefire/backend.rb b/lib/hirefire/backend.rb index abc1234..def5678 100644 --- a/lib/hirefire/backend.rb +++ b/lib/hirefire/backend.rb @@ -18,7 +18,7 @@ # Delayed Job specific backends if defined?(::Delayed) if defined?(::Delayed::Backend::ActiveRecord::Job) - if ActiveRecord::VERSION::STRING >= '3.0.0' + if defined?(::ActiveRecord::Relation) base.send(:include, HireFire::Backend::DelayedJob::ActiveRecord) else base.send(:include, HireFire::Backend::DelayedJob::ActiveRecord2)
Remove string comparison and test based on required feature.
diff --git a/lib/holidays_wrapper.rb b/lib/holidays_wrapper.rb index abc1234..def5678 100644 --- a/lib/holidays_wrapper.rb +++ b/lib/holidays_wrapper.rb @@ -1,3 +1,5 @@+require 'holidays' + class HolidaysWrapper < Holidays # sm - reads every holiday in region, including informal, and returns a date or nil # the date range is for the 12 month period following now
Add require for Holidays Wrapper
diff --git a/lib/quickets.rb b/lib/quickets.rb index abc1234..def5678 100644 --- a/lib/quickets.rb +++ b/lib/quickets.rb @@ -14,10 +14,9 @@ module Quickets class App < Roda - plugin :json - plugin :error_handler do |e| - { error: e.message } - end + plugin :json_parser # request parse + plugin :json # response to_json + plugin :error_handler route do |r| r.root do @@ -41,5 +40,10 @@ end end end + + error do |e| + Quickets.logger.error e + { error: e.message } + end end end
Add json_parser (for request parsing)
diff --git a/lib/services.rb b/lib/services.rb index abc1234..def5678 100644 --- a/lib/services.rb +++ b/lib/services.rb @@ -2,6 +2,9 @@ module Services def self.publishing_api - @publishing_api ||= GdsApi::PublishingApiV2.new(Plek.new.find('publishing-api')) + @publishing_api ||= GdsApi::PublishingApiV2.new( + Plek.new.find('publishing-api'), + bearer_token: ENV['PUBLISHING_API_BEARER_TOKEN'] || 'example' + ) end end
Add bearer_token for publishing API authentication
diff --git a/lib/rambulance.rb b/lib/rambulance.rb index abc1234..def5678 100644 --- a/lib/rambulance.rb +++ b/lib/rambulance.rb @@ -1,3 +1,4 @@+require "action_dispatch" require "rambulance/version" require "rambulance/railtie"
Make sure action_dispatch is required
diff --git a/lib/tasks/js.rake b/lib/tasks/js.rake index abc1234..def5678 100644 --- a/lib/tasks/js.rake +++ b/lib/tasks/js.rake @@ -2,13 +2,13 @@ desc "Minify javascript src for production environment" task :min => :environment do # list of files to minify - libs = ['public/javascripts/prototype.js', - 'public/javascripts/effects.js', - 'public/javascripts/application.js'] + libs = ['public/deezy/javascripts/prototype.js', + 'public/deezy/javascripts/effects.js', + 'public/deezy/javascripts/application.js'] # paths to jsmin script and final minified file jsmin = 'script/javascript/jsmin.rb' - final = 'public/javascripts/all_min.js' + final = 'public/deezy/javascripts/all_min.js' # create single tmp js file tmp = Tempfile.open('all')
Fix JavaScript minification rake task
diff --git a/lib/specjour/printer.rb b/lib/specjour/printer.rb index abc1234..def5678 100644 --- a/lib/specjour/printer.rb +++ b/lib/specjour/printer.rb @@ -46,7 +46,7 @@ $stdout.print message $stdout.flush elsif message.is_a?(Array) - send(message.first, message[1]) + send(message.first, *message[1..-1]) end end
Fix Protocol sends nil arg instead of no arg
diff --git a/lib/xbox_leaders/api.rb b/lib/xbox_leaders/api.rb index abc1234..def5678 100644 --- a/lib/xbox_leaders/api.rb +++ b/lib/xbox_leaders/api.rb @@ -12,7 +12,7 @@ end def fetch_achievements(gamertag, game_id) - get('/achievements', gamertag: gamertag, gameid: game_id) + get('/achievements', gamertag: gamertag, titleid: game_id) end def fetch_friends(gamertag)
Rename parameter for the API Despite all the documentation I can find, using `gameid` consistently results in ArgumentError: The gameid supplied was not valid. `titleid` looks to be the older param name, but it still works.
diff --git a/Dwifft.podspec b/Dwifft.podspec index abc1234..def5678 100644 --- a/Dwifft.podspec +++ b/Dwifft.podspec @@ -9,6 +9,7 @@ s.source = { :git => 'https://github.com/jflinter/Dwifft.git', :tag => s.version } s.ios.deployment_target = '8.0' + s.tvos.deployment_target = '9.0' s.source_files = 'Dwifft/*.swift'
Add tvOS to the Podfile.
diff --git a/lib/airplayer/app.rb b/lib/airplayer/app.rb index abc1234..def5678 100644 --- a/lib/airplayer/app.rb +++ b/lib/airplayer/app.rb @@ -17,7 +17,7 @@ desc 'devices', 'Show AirPlay devices' def devices Device.devices.each_with_index do |device, number| - puts "#{number}: #{device.name} (#{device.address})" + puts "#{number}: #{device.name} (Resolution: #{device.info.resolution}, Version: #{device.info.os_version}, IP: #{device.address})" end end
Add device os version and resolution to display
diff --git a/lib/dolphy/router.rb b/lib/dolphy/router.rb index abc1234..def5678 100644 --- a/lib/dolphy/router.rb +++ b/lib/dolphy/router.rb @@ -8,24 +8,14 @@ @routes = { :get => {}, :post => {}, :put => {}, :delete => {} } end - def get(path, &block) - add_route(:get, path, block) + def not_found + erb :not_found end - def post(path, &block) - add_route(:post, path, block) - end - - def put(path, &block) - add_route(:put, path, block) - end - - def delete(path, &block) - add_route(:delete, path, block) - end - - def not_found - erb :not_found + %w(get post put delete).each do |verb| + define_method(verb) do |path, &block| + add_route(verb.to_sym, path, block) + end end private
Define route methods using define_method instead.
diff --git a/lib/invite_module.rb b/lib/invite_module.rb index abc1234..def5678 100644 --- a/lib/invite_module.rb +++ b/lib/invite_module.rb @@ -8,10 +8,10 @@ if user_not_exist?(user) user_create(invite) - redirect_to "http://villeme.com/users/auth/facebook" and return + redirect_to 'http://villeme.com/users/auth/facebook' and return else user_update(invite, user) - redirect_to "http://villeme.com/users/auth/facebook" and return + redirect_to 'http://villeme.com/users/auth/facebook' and return end end @@ -23,20 +23,20 @@ end def user_create(invite) - user = User.create(name: invite.name, + User.create(name: invite.name, email: invite.email, password: Devise.friendly_token[0, 8], persona_id: invite.persona, - invited: true) + invited: true, + address: invite.address) - invite.copy_attributes_to(user) end def user_update(invite, user) user.update_attributes(persona_id: invite.persona, - invited: true) + invited: true, + address: invite.address) - invite.copy_attributes_to(user) end end
Adjust in geocoder of invite when user click in key from email
diff --git a/lib/msfl_visitors.rb b/lib/msfl_visitors.rb index abc1234..def5678 100644 --- a/lib/msfl_visitors.rb +++ b/lib/msfl_visitors.rb @@ -5,7 +5,7 @@ module MSFLVisitors class << self - def get_chewy_clauses(dataset, msfl) + def get_chewy_clauses(dataset, msfl, visitor = MSFLVisitors::Visitor.new) unless dataset.is_a? MSFL::Datasets::Base raise ArgumentError, "The first argument to MSFLVisitors.get_chewy_clauses must be a descendant of MSFL::Datasets::Base." end @@ -13,7 +13,6 @@ converter = MSFL::Converters::Operator.new nmsfl = converter.run_conversions msfl ast = parser.parse nmsfl - visitor = MSFLVisitors::Visitor.new visitor.visit_tree ast end end
Enable a gem client specific visitor in .get_chewy_clauses
diff --git a/lib/buildr_plus/features/idea_codestyle.rb b/lib/buildr_plus/features/idea_codestyle.rb index abc1234..def5678 100644 --- a/lib/buildr_plus/features/idea_codestyle.rb +++ b/lib/buildr_plus/features/idea_codestyle.rb @@ -15,7 +15,7 @@ BuildrPlus::FeatureManager.feature(:idea_codestyle) do |f| f.enhance(:Config) do def default_codestyle - 'au.com.stocksoftware.idea.codestyle:idea-codestyle:xml:1.11' + 'au.com.stocksoftware.idea.codestyle:idea-codestyle:xml:1.12' end def codestyle
Update idea codestyle rules for react4j
diff --git a/app/admin/provider.rb b/app/admin/provider.rb index abc1234..def5678 100644 --- a/app/admin/provider.rb +++ b/app/admin/provider.rb @@ -6,10 +6,6 @@ action_item(:upload_csv, :only => :index) do link_to "Upload CSV", upload_csv_admin_provided_pois_path - end - - collection_action :upload_csv, title: "Upload CSV" do - render "/admin/provided_pois/upload_csv" end index do
Remove `collection_action` that has been placed here from a separate test in provided_poi
diff --git a/lib/netsuite/records/inventory_transfer.rb b/lib/netsuite/records/inventory_transfer.rb index abc1234..def5678 100644 --- a/lib/netsuite/records/inventory_transfer.rb +++ b/lib/netsuite/records/inventory_transfer.rb @@ -7,7 +7,7 @@ include Support::Actions include Namespaces::TranInvt - actions :get, :add, :delete, :search, :update, :upsert + actions :get, :add, :delete, :search, :update, :upsert, :upsert_list fields :created_date, :last_modified_date, :tran_date, :tran_id, :memo
Add upsertList action to Inventory Transfer
diff --git a/lib/no_brainer/query_runner/write_error.rb b/lib/no_brainer/query_runner/write_error.rb index abc1234..def5678 100644 --- a/lib/no_brainer/query_runner/write_error.rb +++ b/lib/no_brainer/query_runner/write_error.rb @@ -10,8 +10,9 @@ Term::TermType::DELETE, Term::TermType::REPLACE, Term::TermType::INSERT]) - if result['errors'] || result['skipped'] - error_msg = "Non existant document" if result['skipped'] + + if result['errors'].to_i != 0 || result['skipped'].to_i != 0 + error_msg = "Non existant document" if result['skipped'].to_i != 0 error_msg = "#{result['first_error']}" if result['first_error'] error_msg += "\nQuery was: #{q.inspect[0..1000]}" raise NoBrainer::Error::DocumentNotSaved, error_msg
Fix error checking for rethinkdb 1.5 Closes #6
diff --git a/app/models/user_initializer.rb b/app/models/user_initializer.rb index abc1234..def5678 100644 --- a/app/models/user_initializer.rb +++ b/app/models/user_initializer.rb @@ -1,46 +1,65 @@ class UserInitializer - attr_reader :authorization, :omniauth_data, :provider, :email + attr_reader :authorization, :email, :omniauth_data - def initialize(provider, omniauth_data) - @provider, @omniauth_data = provider, omniauth_data + delegate :provider, to: :@omniauth_data - check_required_attributes + def initialize(omniauth_data, user) + @omniauth_data = omniauth_data + @user = user + end + + def authorization_data + omniauth_data[:authorizations_attributes].first + end + + def omniauth_urls_data + omniauth_data.select do |key, _value| + %i(twitter_url + linkedin_url + facebook_url + remote_uploaded_image_url).include? key + end end def setup - update_authorization_attributes - update_user_attributes + return false unless can_setup? + + if user + user.update_attributes(omniauth_urls_data) + user.authorizations. + find_or_initialize_by(oauth_provider_id: authorization_data[:oauth_provider_id]). + update_attributes(authorization_data) + else + if user.try(:uploaded_image).try(:present?) + omniauth_data.delete(:remote_uploaded_image_url) + end + + @user = User.create(omniauth_data) + end + end + + def can_setup? + authorization_exists? || already_signed_in? || (!empty_email? && !data_matches_with_user?) + end + + def authorization_exists? + @authorization ||= Authorization.find_by(authorization_data) + !!@authorization + end + + def already_signed_in? + !!@user + end + + def data_matches_with_user? + User.exists?(email: @omniauth_data[:email]) + end + + def empty_email? + @omniauth_data[:email].blank? end def user - @authorization.try(:user) - end - - def no_account_conflicts? - @has_no_account_conflicts ||= @email && !User.find_by(email: @email) - end - - protected - - def fill_required_attributes - @omniauth_data['info'] = {} - @omniauth_data['info']['email'] = "change-your-email+#{Time.now.to_i}@neighbor.ly" - end - - def update_authorization_attributes - @authorization = Authorization.find_from_hash(omniauth_data) - - if @authorization.blank? - @authorization = Authorization.create_from_hash(omniauth_data) - else - @authorization.update_access_token_from_hash(omniauth_data) - if provider.eql? 'google_oauth2' - @authorization.update_uid_from_hash(omniauth_data) - end - end - end - - def update_user_attributes - user.update_social_info(omniauth_data) + @user || authorization.user end end
Move ability to setup an omniauth sign to a dedicated method
diff --git a/app/payments/dotpay_payment.rb b/app/payments/dotpay_payment.rb index abc1234..def5678 100644 --- a/app/payments/dotpay_payment.rb +++ b/app/payments/dotpay_payment.rb @@ -8,4 +8,26 @@ sum = @secret.to_s + @data.map { |k,v| v[0] unless k == 'signature' }.join('') Digest::SHA256.hexdigest(sum) == @data['signature'][0] end + + def status + @data['operation_status'][0] + end + + def amount + str = @data['operation_amount'][0] + str.present? && str.to_d + end + + def currency + @data['operation_currency'][0] + end + + def description + @data['description'][0] + end + + def time + str = @data['operation_datetime'][0] + str.present? && Time.parse(str) + end end
Add wrappers for payment data to DotpayPayment
diff --git a/config/initializers/show_constants.rb b/config/initializers/show_constants.rb index abc1234..def5678 100644 --- a/config/initializers/show_constants.rb +++ b/config/initializers/show_constants.rb @@ -1,8 +1,8 @@ CURRENT_TOP_ROW_VALUES = [200, 400].freeze PLAY_TYPES = { + "regular" => "regular play", "teachers" => "Teachers Tournament", - "regular" => "regular play", "college" => "College Championship", "teen" => "Teen Tournament", "power" => "Power Players Week",
Move regular play back to the top of the list
diff --git a/config/initializers/engine_locale_fix.rb b/config/initializers/engine_locale_fix.rb index abc1234..def5678 100644 --- a/config/initializers/engine_locale_fix.rb +++ b/config/initializers/engine_locale_fix.rb @@ -8,7 +8,13 @@ problem_engines = Rails::Engine.subclasses.keep_if do |engine| Rails.application.routes.routes.any? do |route| - route.app == engine && route.required_parts.include?(:locale) + app = if route.app.is_a?(ActionDispatch::Routing::Mapper::Constraints) + route.app.app + else + route.app + end + + app == engine && route.required_parts.include?(:locale) end end
Tweak engine locale param fix. Fix wasn’t applying when used in conjunction with a constraint object.
diff --git a/environment_canada.gemspec b/environment_canada.gemspec index abc1234..def5678 100644 --- a/environment_canada.gemspec +++ b/environment_canada.gemspec @@ -10,7 +10,7 @@ spec.email = ["jamesbadger@gmail.com"] spec.description = %q{Environment Canada weather library} spec.summary = %q{Connects to Environment Canada, downloads the weather information for a city, parses it, and returns it as a Ruby object.} - spec.homepage = "" + spec.homepage = "https://github.com/openfirmware/environment_canada" spec.license = "MIT" spec.files = `git ls-files`.split($/)
Add Github site as gem homepage
diff --git a/journeys/vehicle_licensing_journey.rb b/journeys/vehicle_licensing_journey.rb index abc1234..def5678 100644 --- a/journeys/vehicle_licensing_journey.rb +++ b/journeys/vehicle_licensing_journey.rb @@ -10,7 +10,7 @@ moveToEl(@browser.link(:text => 'SORN'), { :click => true }) sleep 8 - scrollToEl(@browser.element(:id => 'sorn-failures')) + scrollToEl(@browser.element(:id => 'recorded-errors')) sleep 7 moveToEl(@browser.link(:id => 'proposition-name'), { :click => true })
Correct SORN journey after recent deployment We switched to Spotlight for SORN, which changed the #id.
diff --git a/js_named_routes.gemspec b/js_named_routes.gemspec index abc1234..def5678 100644 --- a/js_named_routes.gemspec +++ b/js_named_routes.gemspec @@ -0,0 +1,18 @@+# -*- encoding: utf-8 -*- +$:.push File.expand_path("../lib", __FILE__) + +Gem::Specification.new do |s| + s.name = "js_named_routes" + s.version = "1.0" + s.platform = Gem::Platform::RUBY + s.authors = ["Galen O'Hanlon", "Matt Ittigson"] + s.email = ["galen.ohanlon@plastictrophy.com", "matt@futureadapter.com"] + s.homepage = "http://github.com/jellybob/js_named_routes" + s.summary = %q{Rails named routes in javascript} + s.description = File.read(README.markdown) + + 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.require_paths = ["lib"] +end
Add a gemspec so it can be used with Bundler
diff --git a/lib/tasks/populate_published_groups.rake b/lib/tasks/populate_published_groups.rake index abc1234..def5678 100644 --- a/lib/tasks/populate_published_groups.rake +++ b/lib/tasks/populate_published_groups.rake @@ -9,10 +9,4 @@ tag.update!(published_groups: item['details']['groups']) end - - Tag.only_children.where(dirty: false).each do |tag| - actual_groups = GroupsPresenter.new(tag).groups.map(&:stringify_keys) - published_groups = tag.published_groups - raise "Non-dirty tag #{tag.id} is actually dirty." - end end
Remove sanity test for dirty-checking This hasn't shown any problems on preview, but the test itself was messed up in a rebase.
diff --git a/lib/loggability/formatter/timeless.rb b/lib/loggability/formatter/timeless.rb index abc1234..def5678 100644 --- a/lib/loggability/formatter/timeless.rb +++ b/lib/loggability/formatter/timeless.rb @@ -0,0 +1,13 @@+require 'loggability' unless defined?( Loggability ) +require 'loggability/formatter' unless defined?( Loggability::Formatter ) + +class Loggability::Formatter::Timeless < Loggability::Formatter + + # The format to output unless debugging is turned on + FORMAT = "%5$5s {%6$s} -- %7$s\n" + + def initialize( format=FORMAT ) + super + end + +end
Add custom log formatter for CLI
diff --git a/extras/searchable_model.rb b/extras/searchable_model.rb index abc1234..def5678 100644 --- a/extras/searchable_model.rb +++ b/extras/searchable_model.rb @@ -17,7 +17,7 @@ module ClassMethods def fulltext_search(q) # Check if Sphinx is enabled globally and for this model; if not, fallback to db_search - if CMS_CONFIG["FULLTEXT"].present? && respond_to?(:search_for_ids) + if false && CMS_CONFIG["FULLTEXT"].present? && respond_to?(:search_for_ids) ids = search_for_ids(q).to_a where(:id => ids) else
Disable Sphinx search; always use DB search [story:43690457]
diff --git a/cookbooks/mysql/attributes/default.rb b/cookbooks/mysql/attributes/default.rb index abc1234..def5678 100644 --- a/cookbooks/mysql/attributes/default.rb +++ b/cookbooks/mysql/attributes/default.rb @@ -2,7 +2,7 @@ default['mysql']['service_name'] = 'default' # passwords -default['mysql']['server_root_password'] = 'ilikerandompasswords' +default['mysql']['server_root_password'] = 'root' default['mysql']['server_debian_password'] = nil default['mysql']['server_repl_password'] = nil
[UPDATE] Set password to 'root' to simplify creation of further instances
diff --git a/genomer-plugin-simple/lib/genomer-plugin-simple.rb b/genomer-plugin-simple/lib/genomer-plugin-simple.rb index abc1234..def5678 100644 --- a/genomer-plugin-simple/lib/genomer-plugin-simple.rb +++ b/genomer-plugin-simple/lib/genomer-plugin-simple.rb @@ -3,7 +3,7 @@ def run case arguments.shift when nil then 'Plugin "simple" called' - when 'echo' then @arguments.unshift('Echo:').join(' ') + when 'echo' then "Echo: #{arguments.join(' ')}" when 'describe' then "The scaffold contains #{scaffold.length} entries" when 'annotations' then annotations.inject("##gff-version 3\n"){|s, a| s << a.to_s} end
Refactor echo arg for clarity in simple-plugin
diff --git a/app/entities/track.rb b/app/entities/track.rb index abc1234..def5678 100644 --- a/app/entities/track.rb +++ b/app/entities/track.rb @@ -3,6 +3,15 @@ self.attributes = :artist_title, :title def queries - ["#{artist_title} #{title}", title] + ["#{better_artist_title} #{better_title}", better_title] + end + + private + def better_artist_title + artist_title.gsub("ft.", "feat.") + end + + def better_title + title.gsub("ft.", "feat.") end end
Improve search for requests with "ft."
diff --git a/clock.gemspec b/clock.gemspec index abc1234..def5678 100644 --- a/clock.gemspec +++ b/clock.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |s| s.name = 'clock' s.summary = 'Clock interface with support for dependency configuration for real and null object implementations' - s.version = '0.1.2' + s.version = '0.1.3' s.description = ' ' s.authors = ['Obsidian Software, Inc']
Package versin is increased from 0.1.2 to 0.1.3
diff --git a/lib/linked_vocabs/validators/property_validator.rb b/lib/linked_vocabs/validators/property_validator.rb index abc1234..def5678 100644 --- a/lib/linked_vocabs/validators/property_validator.rb +++ b/lib/linked_vocabs/validators/property_validator.rb @@ -7,7 +7,7 @@ unless v.try(:in_vocab?) term = v.try(:rdf_subject) || v vocabularies = record.class.properties[attribute.to_s].class_name.vocabularies.keys - record.errors.add :base, "value `#{term} for `#{attribute}` property is not a term in a controlled vocabulary #{vocabularies.join(', ')}" + record.errors.add :base, "value `#{term}' for `#{attribute}' property is not a term in a controlled vocabulary #{vocabularies.join(', ')}" end end end
Fix unbalanced quotes in error message
diff --git a/spec/support/config.rb b/spec/support/config.rb index abc1234..def5678 100644 --- a/spec/support/config.rb +++ b/spec/support/config.rb @@ -2,9 +2,8 @@ config.custom_methods = { format_percentage: -> (value) { "#{value.round(0)}%" }, add_label_suffix: -> (data) { - data[:entities] = data[:entities].map do |entity| + data[:entities].each do |entity| entity.label = "#{entity.label} Foo" if entity.label - entity end data }
Simplify the tests' add_label_suffix custom method
diff --git a/app/models/company.rb b/app/models/company.rb index abc1234..def5678 100644 --- a/app/models/company.rb +++ b/app/models/company.rb @@ -12,7 +12,10 @@ end def create_default_member_classes - member_classes.find_or_create_by_name('Director') + directors = member_classes.find_or_create_by_name('Director') + directors.set_permission!(:freeform_proposal, true) + directors.set_permission!(:vote, true) + directors.save end def set_default_voting_systems
Make sure Company member classes start with the necessary permissions.
diff --git a/lib/axiom/types/type.rb b/lib/axiom/types/type.rb index abc1234..def5678 100644 --- a/lib/axiom/types/type.rb +++ b/lib/axiom/types/type.rb @@ -26,10 +26,8 @@ self end - def self.includes(*set) - # TODO: benchmark the cross-over point where it is more efficient to use - # a Set than an Array, and then consider conditionally converting? - set.uniq! + def self.includes(*members) + set = IceNine.deep_freeze(members.to_set) constraint { |object| set.include?(object) } end
Change the members to be a frozen set * I benchmarked the difference between Array#include? and Set#include? and the latter was faster even for small sets of objects. The performance was outstanding for larger sets. It makes sense since Array#include? is O(n) and Set#include? is O(1), yet I thought I has read somewhere that Array#include? was faster when "n" was small, but that does not seem to be the case, at least under ruby 1.9.3.
diff --git a/lib/cocoapods/search.rb b/lib/cocoapods/search.rb index abc1234..def5678 100644 --- a/lib/cocoapods/search.rb +++ b/lib/cocoapods/search.rb @@ -1,4 +1,12 @@-require 'cocoapods/search/version' -require 'cocoapods/search/pod' -require 'cocoapods/search/rendering' -require 'cocoapods/search/cli'+require 'rubygems' + +module Cocoapods + module Search + class LibraryNotFound < LoadError; end + + autoload :Cli, 'cocoapods/search/cli' + autoload :Pod, 'cocoapods/search/pod' + autoload :Rendering, 'cocoapods/search/rendering' + autoload :VERSION, 'cocoapods/search/version' + end +end
Use autoload insted of require
diff --git a/app/models/team.rb b/app/models/team.rb index abc1234..def5678 100644 --- a/app/models/team.rb +++ b/app/models/team.rb @@ -1,4 +1,6 @@ class Team < ActiveRecord::Base validates :name, :required_size, :tournament_id, presence: true belongs_to :tournament + has_many :team_memberships + has_many :players, through: :team_memberships end
Define association betwean Team model and Player model