diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
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,11 +1,5 @@-# -*- encoding: utf-8 -*- +# coding: utf-8 -require 'rubygems' - -$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) -$LOAD_PATH.unshift(File.dirname(__FILE__)) - -require 'rspec' require 'rack/test' require 'rack/policy'
Remove craft from spec helper.
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,7 @@ Dir[File.join(File.dirname(__FILE__), "../lib/**/*.rb")].each { |f| require f } require 'webmock/rspec' +WebMock.disable_net_connect!(:allow => "codeclimate.com") RSpec.configure do |config| config.expect_with :rspec do |expectations|
Add Webmock configure for Code Climate
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 @@ -20,7 +20,7 @@ # do not change the coverage percentage, instead add more unit tests to fix coverage failures. if SimpleCov.result.covered_percent < 60 print "ERROR::BAD_COVERAGE\n" - print "Coverage is less than acceptable limit(71%). Please add more tests to improve the coverage" + print "Coverage is less than acceptable limit(71%). Please add more tests to improve the coverage\n" exit(1) end end
Add missing newline from coverage message
diff --git a/lib/rblogger/platforms/blogger.rb b/lib/rblogger/platforms/blogger.rb index abc1234..def5678 100644 --- a/lib/rblogger/platforms/blogger.rb +++ b/lib/rblogger/platforms/blogger.rb @@ -22,13 +22,9 @@ attr_reader :client, :configuration - def api - Document.new(client, configuration).fetch - end - def fetch_blog(blog_id) authorize! - Blog.new(client, api, blog_id) + build_blog(blog_id) end private @@ -37,5 +33,13 @@ authorizer = Authorizer.new(configuration) client.authorization = authorizer.authorize! end + + def build_blog(blog_id) + Blog.new(client, api, blog_id) + end + + def api + Document.new(client, configuration).fetch + end end end
Refactor internals of Blogger for readability
diff --git a/lib/ethereum/deployment.rb b/lib/ethereum/deployment.rb index abc1234..def5678 100644 --- a/lib/ethereum/deployment.rb +++ b/lib/ethereum/deployment.rb @@ -39,9 +39,9 @@ start_time = Time.now loop do raise "Transaction #{@id} timed out." if ((Time.now - start_time) > timeout) - sleep step yield if block_given? return true if deployed? + sleep step end end
Return first if mined, then sleep in Deployment.
diff --git a/example_server.rb b/example_server.rb index abc1234..def5678 100644 --- a/example_server.rb +++ b/example_server.rb @@ -4,14 +4,23 @@ class TrafficLightPiServer < Sinatra::Base configure do @@line_map = { - 0 => { + :devant => { + :red => 12, + :orange => 13, + :green => 14, + }, + :gauche => { :red => 4, :green => 5, }, - 1 => { - :red => 12, - :orange => 13, - :green => 14, + :fond => { + :red => 6, + :orange => 10, + :green => 11, + }, + :droite => { + :red => 0, + :green => 3, }, } init_lights
Put all line for my pi
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 @@ -44,6 +44,15 @@ RSpec.configure do |config| # some (optional) config here + config.mock_with :rspec do |mocks| + + # This option should be set when all dependencies are being loaded + # before a spec run, as is the case in a typical spec helper. It will + # cause any verifying double instantiation for a class that does not + # exist to raise, protecting against incorrectly spelt names. + mocks.verify_doubled_constant_names = true + + end config.disable_monkey_patching! config.mock_framework = :rspec end
Verify doubles when we get to that point [skip 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,10 +1,5 @@-require 'rubygems' unless Object.const_defined?(:Gem) -gem 'rake', "~> #{ENV['rake']}.0" if ENV['rake'] - require 'van_helsing' require 'rake' - -puts "Testing with Rake #{Gem.loaded_specs['rake'].version}" class RakeScope include Rake::DSL if Rake.const_defined?(:DSL)
Undo the Rake magic heh.
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 @@ -12,10 +12,14 @@ if ENV['COVERAGE'] require 'simplecov' + require 'simplecov-rcov' require 'coveralls' Coveralls.wear! - SimpleCov.formatter = Coveralls::SimpleCov::Formatter + SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ + SimpleCov::Formatter::RcovFormatter, + Coveralls::SimpleCov::Formatter + ] SimpleCov.start do add_filter '/vendor/' add_filter '/spec/'
Add simplecov-rcov formatter for development coverage
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 @@ -24,7 +24,7 @@ add_group 'Relationship', 'lib/data_mapper/relationship' add_group 'Attribute', 'lib/data_mapper/attribute' - minimum_coverage 98.21 + minimum_coverage 98.11 # 0.10 lower under JRuby end end
Update spec coverage threshold to work for JRuby * The threshold is about 0.10% lower under JRuby, so adjust it downward to compensate.
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,7 +1,9 @@+require 'rubygems' +require 'bundler/setup' + spec_root = File.dirname(__FILE__) $:.unshift(File.join(spec_root, '..', 'lib')) $:.unshift(spec_root) - require 'net-http-last_modified_cache' Dir[File.join(spec_root, 'support/**/*.rb')].each { |file| require file }
Use bundler to setup gems in specs
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 @@ -7,10 +7,7 @@ require "webmock/rspec" require "pry" require "timecop" -begin - require "pry-byebug" -rescue LoadError -end +require "pry-byebug" require "activerecord-turntable"
Enable byebug always because supported ruby versions are >= 2.2.2
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 @@ -31,7 +31,8 @@ end config.after(connectivity: true) do - Thread.kill @consumer_thread if @consumer_thread.present? + @consumer_thread.kill if @consumer_thread.present? + @consumer_thread.join if @consumer_thread.present? end RabbitFeed::TestingSupport.include_support config
Fix flakey test due to consumer thread not joining before next test starts
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 @@ -22,11 +22,6 @@ require 'equalizer' -# TODO: FIXME! -# Cache correct freezer in ice_nine before -# rspec2 infects the world... -Equalizer.new - RSpec.configure do |config| config.expect_with :rspec do |expect_with| expect_with.syntax = :expect
Remove work-around that is no longer needed with the rspec expect syntax
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 @@ -20,6 +20,7 @@ fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures')) RSpec.configure do |config| + config.tty = true config.mock_with :mocha config.module_path = File.join(fixture_path, 'modules') config.manifest_dir = File.join(fixture_path, 'manifests')
Fix rspec colour in jenkins Signed-off-by: Ken Barber <[email protected]>
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 @@ -9,6 +9,8 @@ config.run_all_when_everything_filtered = true config.treat_symbols_as_metadata_keys_with_true_values = true + config.order = :random + # Output config.color_enabled = true config.tty = true
Configure tests to run in random order
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 @@ -30,4 +30,7 @@ # == Mock Framework config.mock_with :rspec + + # Fixtures + config.use_transactional_fixtures = true end
Use transactional fixtures for tests.
diff --git a/spec/stubs/rails.rb b/spec/stubs/rails.rb index abc1234..def5678 100644 --- a/spec/stubs/rails.rb +++ b/spec/stubs/rails.rb @@ -1,4 +1,10 @@ require 'stubs/dummy' + +module Logger + extend self + + def try(*args); end +end module Rails extend self @@ -30,7 +36,13 @@ module Application extend self - def assets; end + module Assets + extend self + end + + def assets + Assets + end end def env @@ -41,6 +53,10 @@ Configuration end + def logger + Logger + end + def root 'RAILS_ROOT' end
Add some more stubs to make specs pass Change-Id: I0b69ad23b1980e9854d0cfcc32038703974276c1 Reviewed-on: https://gerrit.causes.com/6792 Tested-by: Steve Dee <[email protected]> Reviewed-by: Greg Hurrell <[email protected]>
diff --git a/lib/ffi-rxs/libc.rb b/lib/ffi-rxs/libc.rb index abc1234..def5678 100644 --- a/lib/ffi-rxs/libc.rb +++ b/lib/ffi-rxs/libc.rb @@ -1,6 +1,6 @@ # encoding: utf-8 -class LibC +module LibC extend FFI::Library # figures out the correct libc for each platform including Windows library = ffi_lib(FFI::Library::LIBC).first
Revert "Further Travis CI investigation" This reverts commit 4d66fe38224d5cc8ce8742fc23b6522d524ea252.
diff --git a/lib/mementus/node_proxy.rb b/lib/mementus/node_proxy.rb index abc1234..def5678 100644 --- a/lib/mementus/node_proxy.rb +++ b/lib/mementus/node_proxy.rb @@ -21,10 +21,6 @@ @node.props end - def out_e - Pipeline::Step.new(adjacent_edges, Pipeline::Pipe.new(@graph), @graph) - end - def each_adjacent(&block) @graph.each_adjacent(@node.id, &block) end
Remove outgoing node pipeline from NodeProxy
diff --git a/lib/phpcop/configloader.rb b/lib/phpcop/configloader.rb index abc1234..def5678 100644 --- a/lib/phpcop/configloader.rb +++ b/lib/phpcop/configloader.rb @@ -6,8 +6,10 @@ class ConfigLoader attr_reader :options + # Path to gem + DEFAULT_PATH = File.realpath(File.join(File.dirname(__FILE__), '..', '..')) # Config file in gem - DEFAULT_CONF = 'config/default.yml'.freeze + DEFAULT_CONF = File.join(DEFAULT_PATH, 'config', 'default.yml').freeze # Config file in project PHP CUSTOMIZE_CONF = '.phpcop.yml'.freeze
Fix path default config yaml
diff --git a/lib/god/compat19.rb b/lib/god/compat19.rb index abc1234..def5678 100644 --- a/lib/god/compat19.rb +++ b/lib/god/compat19.rb @@ -1,13 +1,10 @@ require 'monitor' + +# Taken from http://redmine.ruby-lang.org/repositories/entry/ruby-19/lib/monitor.rb + module MonitorMixin - # - # FIXME: This isn't documented in Nutshell. - # - # Since MonitorMixin.new_cond returns a ConditionVariable, and the example - # above calls while_wait and signal, this class should be documented. - # class ConditionVariable def wait(timeout = nil) @monitor.__send__(:mon_check_owner) @@ -20,4 +17,20 @@ end end end +end + + +# Taken from http://redmine.ruby-lang.org/repositories/entry/ruby-19/lib/thread.rb + +class ConditionVariable + def wait(mutex, timeout=nil) + begin + # TODO: mutex should not be used + @waiters_mutex.synchronize do + @waiters.push(Thread.current) + end + mutex.sleep timeout + end + self + end end
Add another method definition to move forward in 1.9 support.
diff --git a/lib/tasks/import/hits.rake b/lib/tasks/import/hits.rake index abc1234..def5678 100644 --- a/lib/tasks/import/hits.rake +++ b/lib/tasks/import/hits.rake @@ -13,7 +13,8 @@ end desc 'Copy filenames and etags for all old stats files from s3' - task update_legacy_from_s3: :environment do + task :update_legacy_from_s3, [:bucket] => :environment do |_, args| + bucket = args[:bucket] ['transition-stats', 'pre-transition-stats'].each do |prefix| Services.s3.list_objects(bucket: bucket, prefix: prefix).each do |resp| resp.contents.each do |object|
Add missing arg to import:update_legacy_from_s3 task
diff --git a/lib/spawn.rb b/lib/spawn.rb index abc1234..def5678 100644 --- a/lib/spawn.rb +++ b/lib/spawn.rb @@ -2,7 +2,7 @@ module Spawn - Invalid = Class.new(ArgumentError) + class Invalid < ArgumentError; end def spawner &default @@spawn ||= Hash.new
Change error class declaration (thanks to oboxodo) The declaring Invalid = Class.new(ArgumentError) has worse performance than class Invalid < ArgumentError; end. As in testing every nanosecond counts, this change was necessary.
diff --git a/lib/access_lint/cli.rb b/lib/access_lint/cli.rb index abc1234..def5678 100644 --- a/lib/access_lint/cli.rb +++ b/lib/access_lint/cli.rb @@ -1,9 +1,10 @@ require 'thor' module AccessLint - class CLI < Thor - desc 'audit TARGET', "Run an accessibility audit on a target file or url." - def audit(target) + class CLI < Thor::Group + desc 'Run an accessibility audit on a target file or url.' + argument :target + def audit puts Audit.new(target).run end end
Use the first argument as the audit target
diff --git a/lib/angularjs-rails.rb b/lib/angularjs-rails.rb index abc1234..def5678 100644 --- a/lib/angularjs-rails.rb +++ b/lib/angularjs-rails.rb @@ -2,10 +2,10 @@ module AngularJS module Rails - if defined? Rails::Engine + if defined? ::Rails::Engine require "angularjs-rails/engine" elsif defined? Sprockets require "angularjs-rails/sprockets" end end -end+end
Fix detection of Rails::Engine for Rails 4 There was code saying if defined?(Rails::Engine), but that didn't work on our Rails 4 project. It seems to work better as defined(::Rails::Engine).
diff --git a/lib/beaglebone/GPIO.rb b/lib/beaglebone/GPIO.rb index abc1234..def5678 100644 --- a/lib/beaglebone/GPIO.rb +++ b/lib/beaglebone/GPIO.rb @@ -2,7 +2,7 @@ module Beaglebone module GPIO def self.list - `ls /sys/class/gpio/` + `ls /sys/class/gpio/`.split('\n') end end end
Convert list string to array
diff --git a/lib/core_ext/object.rb b/lib/core_ext/object.rb index abc1234..def5678 100644 --- a/lib/core_ext/object.rb +++ b/lib/core_ext/object.rb @@ -23,7 +23,11 @@ def to_equal(expected) if (self.actual != expected) ^ self.inverted - raise RuntimeError.new("expected #{self.actual} to equal #{expected}") + if self.inverted + raise RuntimeError.new("expected #{self.actual} not to equal #{expected}") + else + raise RuntimeError.new("expected #{self.actual} to equal #{expected}") + end end end end
Add an inversion error message
diff --git a/sequelizer.gemspec b/sequelizer.gemspec index abc1234..def5678 100644 --- a/sequelizer.gemspec +++ b/sequelizer.gemspec @@ -11,7 +11,7 @@ spec.summary = %q{Sequel database connections via config/database.yml or .env} spec.description = %q{Easily establish a connection to a database via Sequel gem using options specified in config/database.yml or .env files} spec.homepage = '' - spec.license = 'MIT' + spec.license = 'Apache License, Version 2.0' spec.files = `git ls-files -z`.split("\x0") spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
gemspec: Update license to Apache 2.0
diff --git a/lib/markdown_api.rb b/lib/markdown_api.rb index abc1234..def5678 100644 --- a/lib/markdown_api.rb +++ b/lib/markdown_api.rb @@ -6,7 +6,12 @@ return @host if @host config_file = Rails.root.join 'config/markdown.yml' config = YAML.load(config_file.read)[Rails.env] if config_file.exist? - @host = ENV['MARKDOWN_HOST'] || config.try(:[], 'host') + + @host = if ENV['MARKDOWN_PORT_2998_TCP_ADDR'] + "http://#{ ENV['MARKDOWN_PORT_2998_TCP_ADDR'] }:2998" + else + ENV['MARKDOWN_HOST'] || config.try(:[], 'host') + end end def self.connection
Allow docker ENV to override markdown host
diff --git a/lib/implicit_schema.rb b/lib/implicit_schema.rb index abc1234..def5678 100644 --- a/lib/implicit_schema.rb +++ b/lib/implicit_schema.rb @@ -1,3 +1,5 @@+# Wraps a Hash object, and raises ImplicitSchema::ValidationError when #[] is +# called with a missing key class ImplicitSchema < BasicObject ValidationError = ::Class.new(::RuntimeError)
Add missing documentation to ImplicitSchema
diff --git a/lib/object_momma.rb b/lib/object_momma.rb index abc1234..def5678 100644 --- a/lib/object_momma.rb +++ b/lib/object_momma.rb @@ -1,4 +1,4 @@-require 'ostruct' +require 'yaml' require 'object_momma/class_attributes'
Remove (now) unneeded require 'ostruct' call
diff --git a/config/environments/development.rb b/config/environments/development.rb index abc1234..def5678 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -27,6 +27,9 @@ # Raise an error on page load if there are pending migrations config.active_record.migration_error = :page_load + # Just allow all docker-compose requests + config.web_console.whitelisted_ips = '0.0.0.0/0' + # Better logging for docker-compose config.logger = Logger.new(STDOUT)
Allow web-consoles from anywhere, for docker containers
diff --git a/lib/redfish/core.rb b/lib/redfish/core.rb index abc1234..def5678 100644 --- a/lib/redfish/core.rb +++ b/lib/redfish/core.rb @@ -14,7 +14,7 @@ module Redfish Logger = ::Logger.new(STDOUT) - Logger.level = ::Logger::WARN + Logger.level = ::Logger::INFO Logger.formatter = proc { |severity, datetime, progname, msg| "#{msg}\n"} def self.debug(message)
Enable info logging by default
diff --git a/serverspec.gemspec b/serverspec.gemspec index abc1234..def5678 100644 --- a/serverspec.gemspec +++ b/serverspec.gemspec @@ -20,6 +20,7 @@ spec.add_dependency "net-ssh" spec.add_dependency "rspec" + spec.add_dependency "highline" spec.add_development_dependency "bundler", "~> 1.3" spec.add_development_dependency "rake" end
Add highline gem to dependencies
diff --git a/lib/orbacle/indexer.rb b/lib/orbacle/indexer.rb index abc1234..def5678 100644 --- a/lib/orbacle/indexer.rb +++ b/lib/orbacle/indexer.rb @@ -1,7 +1,48 @@ require 'pathname' +require 'thread' module Orbacle class Indexer + QueueElement = Struct.new(:ast, :file_path) + + class ParsingProcess + def initialize(logger, queue, files) + @logger = logger + @queue = queue + @files = files + end + + def call + @files.each do |file_path| + begin + file_content = File.read(file_path) + ast = Parser::CurrentRuby.parse(file_content) + @queue.push(QueueElement.new(ast, file_path)) + rescue Parser::SyntaxError + logger.warn "Warning: Skipped #{file_path} because of syntax error" + end + end + @queue.close + end + + private + attr_reader :logger + end + + class BuildingProcess + def initialize(queue, builder) + @queue = queue + @builder = builder + end + + def call + while [email protected]? || [email protected]? + element = @queue.shift + @builder.process_file(element.ast, element.file_path) + end + end + end + def initialize(logger) @logger = logger end @@ -16,16 +57,15 @@ DefineBuiltins.new(graph, tree).() @parser = Builder.new(graph, worklist, tree) - files.each do |file_path| - begin - file_content = File.read(file_path) - ast = Parser::CurrentRuby.parse(file_content) - logger.info "Processing #{file_path}" - @parser.process_file(ast, file_path) - rescue Parser::SyntaxError - logger.warn "Warning: Skipped #{file_path} because of syntax error" - end - end + queue = Queue.new + + logger.info "Parsing..." + parsing_process = ParsingProcess.new(logger, queue, files) + parsing_process.call() + + logger.info "Building graph..." + building_process = BuildingProcess.new(queue, @parser) + building_process.call() logger.info "Typing..." typing_result = TypingService.new(logger).(graph, worklist, tree)
Split parsing and building into two parts
diff --git a/event_store-client-http.gemspec b/event_store-client-http.gemspec index abc1234..def5678 100644 --- a/event_store-client-http.gemspec +++ b/event_store-client-http.gemspec @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = 'event_store-client-http' - s.version = '0.3.1' + s.version = '0.3.2' s.summary = 'HTTP Client for EventStore' s.description = ' '
Package version is increased from 0.3.1 to 0.3.2
diff --git a/simple_aws.gemspec b/simple_aws.gemspec index abc1234..def5678 100644 --- a/simple_aws.gemspec +++ b/simple_aws.gemspec @@ -10,7 +10,7 @@ s.summary = "The simplest and easiest to use AWS communication library" s.description = "SimpleAWS is a clean, simple, and forward compatible library for talking to the Amazon Web Service APIs." - s.add_dependency "nokogiri", [">= 1.5.0", "< 2.0"] + s.add_dependency "nokogiri", "~> 1.5" s.add_dependency "httparty", "~> 0.11.0" s.add_dependency "jruby-openssl" if RUBY_PLATFORM == 'java'
Change nokogiri dependency to hopefully work on 1.8.7 on Travis
diff --git a/lib/tango/logger.rb b/lib/tango/logger.rb index abc1234..def5678 100644 --- a/lib/tango/logger.rb +++ b/lib/tango/logger.rb @@ -1,7 +1,20 @@ # coding: utf-8 module Tango + module TermANSIColorStubs + [:red, :green, :yellow].each do |color| + define_method(color) { |str| str } + end + end + class Logger + begin + require 'term/ansicolor' + include Term::ANSIColor + rescue LoadError + include TermANSIColorStubs + end + def self.instance @logger ||= Logger.new end @@ -12,18 +25,18 @@ end def begin_step(step_name) - log "#{step_name} {" + log "#{yellow(step_name)} {" @depth += 1 end def step_met(step_name) @depth -= 1 - log "} √ #{step_name}" + log "} #{green("√ #{step_name}")}" end def step_not_met(step_name) @depth -= 1 - log "} ✕ #{step_name}\n\n" + log "} #{red("✕ #{step_name}")}\n\n" end def log(message)
Add a little colour to the dance.
diff --git a/lib/tasks/seed.rake b/lib/tasks/seed.rake index abc1234..def5678 100644 --- a/lib/tasks/seed.rake +++ b/lib/tasks/seed.rake @@ -12,7 +12,8 @@ first_name: name.split[0], last_name: name.split[1], phone_number: Faker::PhoneNumber.cell_phone, - email: Faker::Internet.email + email: Faker::Internet.email, + country: Faker::Address.country_code ) start_number = StartNumber.create!(value: index, race: race) RaceResult.create!(race: race, racer: racer, category: (index % 2).zero? ? c_one : c_two, start_number: start_number)
Add country to racer faker
diff --git a/lib/rails-observers.rb b/lib/rails-observers.rb index abc1234..def5678 100644 --- a/lib/rails-observers.rb +++ b/lib/rails-observers.rb @@ -14,7 +14,7 @@ end end - initializer "action_controller.caching.sweppers" do + initializer "action_controller.caching.sweepers" do ActiveSupport.on_load(:action_controller) do require "rails/observers/action_controller/caching" end
Use correct name for initializer key
diff --git a/lib/slatan/buttocks.rb b/lib/slatan/buttocks.rb index abc1234..def5678 100644 --- a/lib/slatan/buttocks.rb +++ b/lib/slatan/buttocks.rb @@ -2,7 +2,7 @@ require 'logger' module Slatan - # Wrapper class of Logger + ## Wrapper class of Logger class Buttocks @@use_log = Spirit.use_log class << self
Add comment to Buttocks class
diff --git a/lib/solidus_gateway.rb b/lib/solidus_gateway.rb index abc1234..def5678 100644 --- a/lib/solidus_gateway.rb +++ b/lib/solidus_gateway.rb @@ -3,5 +3,3 @@ require "active_merchant" require "spree_gateway/engine" require "solidus_gateway/version" -require "sass/rails" -require "coffee_script"
Remove sass/rails and coffeescript requires They are useless and sass/rails break the build on master after solidusio/solidus#2883
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index abc1234..def5678 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -14,12 +14,17 @@ def new @user = User.new end - + def create @user = User.new(params[:user]) if @user.save - flash[:success] = 'User created' - redirect_to root_path + respond_to do |format| + format.json { respond_with @user } + format.html do + flash[:success] = 'User created' + redirect_to root_path + end + end else render :new end
Add API endpoint for User create
diff --git a/HSGoogleDrivePicker.podspec b/HSGoogleDrivePicker.podspec index abc1234..def5678 100644 --- a/HSGoogleDrivePicker.podspec +++ b/HSGoogleDrivePicker.podspec @@ -2,7 +2,7 @@ Pod::Spec.new do |s| s.name = "HSGoogleDrivePicker" - s.version = "1.0.1" + s.version = "2.0.0" s.summary = "A sane and simple file picker for Google Drive." s.homepage = "https://github.com/ConfusedVorlon/HSGoogleDrivePicker" @@ -14,7 +14,7 @@ s.platform = :ios, "7.0" - s.source = { :git => "https://github.com/ConfusedVorlon/HSGoogleDrivePicker.git", :tag => "1.0.1" } + s.source = { :git => "https://github.com/ConfusedVorlon/HSGoogleDrivePicker.git", :tag => "2.0.0" } s.source_files = "HSGoogleDrivePicker/HSGoogleDrivePicker" s.requires_arc = true
Update podspec to version 2.0
diff --git a/cookbooks/wt_netacuity/metadata.rb b/cookbooks/wt_netacuity/metadata.rb index abc1234..def5678 100644 --- a/cookbooks/wt_netacuity/metadata.rb +++ b/cookbooks/wt_netacuity/metadata.rb @@ -3,5 +3,4 @@ license "All rights reserved" description "Installs/Configures NetAcuity with a Webtrends license" long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version "1.0.9" -depends "java"+version "1.0.9"
Remove java dependency for netacuity
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 @@ -10,7 +10,6 @@ end def full_title(page_title) - base_title = 'Issuet' - page_title.empty? ? base_title : "#{base_title} · #{page_title}" + page_title.empty? ? 'Issuet' : page_title end end
Remove base title from page titles
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 @@ -10,11 +10,11 @@ end def full_url(page_url) - base_url = "https://coderdojo.jp" + default_url = "https://coderdojo.jp/" if page_url.empty? - base_url + default_url else - base_url + page_url + page_url end end
Fix wrong url set in full_url helper
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 @@ -1,7 +1,7 @@ module ApplicationHelper def nav_item(text, image, url, options = {}) content_tag(:li, class: (current_page?(url) ? 'active' : '' )) do - icon = image ? "<img src='#{image}' type='image/svg+xml'>" : '' + icon = image ? "<img src='#{image}' type='image/svg+xml' width='24' height='24'>" : '' link_to raw("#{icon}<h4>#{text}</h4>"), url, options end end
Declare dimensions for header images This way, the text doesn't jump around since the text loads before the svg as the space is reserved for the image.
diff --git a/crawlers/lib/facebook_extractor.rb b/crawlers/lib/facebook_extractor.rb index abc1234..def5678 100644 --- a/crawlers/lib/facebook_extractor.rb +++ b/crawlers/lib/facebook_extractor.rb @@ -11,12 +11,9 @@ end def blocks(page) - if page.class == String - puts "PAGE SHIT #{page}" - end JSON.parse(page.body)['data'].select do |block| block['type'] == 'status' - end.tap { |x| puts "BLOCKS SIZE #{x.map(&:inspect).join("\n")}" } + end end def news(block)
Clean facebook extractor from debug prints
diff --git a/monetizable.gemspec b/monetizable.gemspec index abc1234..def5678 100644 --- a/monetizable.gemspec +++ b/monetizable.gemspec @@ -22,5 +22,5 @@ spec.add_development_dependency "pry" spec.add_development_dependency "rake" - spec.add_dependency "money", "~> 5.1.1" + spec.add_dependency "money", "~> 6.13.2" end
Upgrade Money gem to 6.13.2
diff --git a/spec/rbNFA_spec.rb b/spec/rbNFA_spec.rb index abc1234..def5678 100644 --- a/spec/rbNFA_spec.rb +++ b/spec/rbNFA_spec.rb @@ -46,7 +46,11 @@ end - it "on question mark generate zero or one token" + it "on question mark generate zero or one token" do + result = lexer.lex("?") + result.should have(1).token + result.first.should be ZeroOrOneToken + end it "on left parenthesie generate begin group token"
Add test for zero or one token
diff --git a/carceropolis/carceropolis/config.rb b/carceropolis/carceropolis/config.rb index abc1234..def5678 100644 --- a/carceropolis/carceropolis/config.rb +++ b/carceropolis/carceropolis/config.rb @@ -1,10 +1,10 @@-http_path = "../" -css_dir = "static/css" -sass_dir = "scss" -images_dir = "static/images" -fonts_dir = "static/fonts/" -javascripts_dir = "js" -relative_assets = true - -output_style = :compressed -environment = :production +http_path = "../" +css_dir = "static/css" +sass_dir = "scss" +images_dir = "static/images" +fonts_dir = "static/fonts/" +javascripts_dir = "js" +relative_assets = true + +output_style = :compressed +environment = :production
Change file mode form dos to unix
diff --git a/game.rb b/game.rb index abc1234..def5678 100644 --- a/game.rb +++ b/game.rb @@ -40,7 +40,7 @@ end def night_mode - @villagers.sample.kill! + @villagers.select(&:alive?).sample.kill! end def day_mode
Kill only alive villagers in the night mode
diff --git a/init.rb b/init.rb index abc1234..def5678 100644 --- a/init.rb +++ b/init.rb @@ -1,14 +1,4 @@ require 'redmine' - -# Patches! -require 'dispatcher' - -Dispatcher.to_prepare :overview_view_page_forward do - gem 'lockfile' - - require_dependency 'projects_helper' - ProjectsHelper.send(:include, OverviewProjectsHelperPatch) -end Redmine::Plugin.register :overview_view_page_forward do name 'Overview->View page forward'
Revert "Patch the change in, instead." This reverts commit e86f2e484e7e01eb95cbc82c87b61269b6bd9e0f.
diff --git a/app/observers/project_observer.rb b/app/observers/project_observer.rb index abc1234..def5678 100644 --- a/app/observers/project_observer.rb +++ b/app/observers/project_observer.rb @@ -1,5 +1,7 @@ class ProjectObserver < BaseObserver def after_create(project) + project.update_column(:last_activity_at, project.created_at) + return true if project.forked? if project.import?
Update project last_activity_at on creation
diff --git a/app/services/manual_migrations.rb b/app/services/manual_migrations.rb index abc1234..def5678 100644 --- a/app/services/manual_migrations.rb +++ b/app/services/manual_migrations.rb @@ -0,0 +1,31 @@+class ManualMigrations + def self.move_snapshot_images! + Snapshot.all.each do |snapshot| + if snapshot.image? + puts "(Re)processing snapshot #{snapshot.id}" + snapshot.image.reprocess! :thumb + else + puts "Processing snapshot #{snapshot.id}" + begin + snapshot.image = URI.parse(snapshot.sample_image_url) + snapshot.save! + rescue + puts "Failed to save snapshot #{snapshot.id}" + puts "Errors: #{snapshot.errors.full_messages.join(', ')}" + end + end + + if !snapshot.diff_image? && snapshot.diff_external_image_id? + puts "Processing diff for snapshot #{snapshot.id}" + begin + snapshot.diff_image = URI.parse( + Cloudinary::Utils.cloudinary_url(snapshot.diff_image_name)) + snapshot.save! + rescue NameError + puts "Failed to save diff for snapshot #{snapshot.id}" + puts "Errors: #{snapshot.errors.full_messages.join(', ')}" + end + end + end + end +end
Add manual-migration tool for images This tool should be run from a Rails console: ManualMigrations.move_snapshot_images! You might see errors along the way (we haven't been good at cleaning out bad snapshots) but the script should always continue. It is safe to run the script multiple times.
diff --git a/app.rb b/app.rb index abc1234..def5678 100644 --- a/app.rb +++ b/app.rb @@ -10,6 +10,6 @@ if params[:name].nil? then File.readlines(params[:name]) else - "File not found" + status 400 end end
Return 404 if the request file is not there
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index abc1234..def5678 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,8 +1,8 @@ class ApplicationController < ActionController::Base protect_from_forgery with: :exception + before_filter :set_user_language before_filter :authenticate_user! - before_filter :set_user_language before_filter :set_active_tab protected
Set language before authenticating the user
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index abc1234..def5678 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,7 +1,7 @@ class ApplicationController < ActionController::Base protect_from_forgery with: :exception - before_filter :authenticate + before_action :authenticate protected
Use before_action instead of before_filter
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index abc1234..def5678 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -3,7 +3,7 @@ before_filter :authenticate before_filter :adjust_format_for_iphone - before_filter :adjust_time_zone, :if => :signed_in? + around_filter :adjust_time_zone, :if => :signed_in? protect_from_forgery @@ -19,5 +19,8 @@ def adjust_time_zone Time.zone = current_user.time_zone + yield + ensure + Time.zone = "UTC" end end
Use an around_filter for adjusting the time zone.
diff --git a/cli.rb b/cli.rb index abc1234..def5678 100644 --- a/cli.rb +++ b/cli.rb @@ -17,7 +17,7 @@ exit if input.nil? begin null = modules.get('null') - steps = input.split('.').map { |step| Step.new(step, modules) } + steps = input.split('>').map { |step| Step.new(step, modules) } final = steps.inject(null) do |previous, step| step.run(previous) end
Change command separator to > This is to allow the use of `.ext` when specifying a filename
diff --git a/build/dist/bin/generate_build_metadata.rb b/build/dist/bin/generate_build_metadata.rb index abc1234..def5678 100644 --- a/build/dist/bin/generate_build_metadata.rb +++ b/build/dist/bin/generate_build_metadata.rb @@ -2,10 +2,13 @@ require 'java' require 'rubygems' require 'json' -require File.join( File.dirname( __FILE__ ), '../../../modules/core/target/immutant-core-module.jar' ) -require File.join( File.dirname( __FILE__ ), '../../../modules/core/target/immutant-core-module-module/polyglot-core.jar' ) +require File.join( File.dirname( __FILE__ ), + "../../assembly/target/stage/immutant/jboss/modules/org/immutant/core/main/immutant-core-module.jar" ) +require File.join( File.dirname( __FILE__ ), + "../../assembly/target/stage/immutant/jboss/modules/org/projectodd/polyglot/core/main/polyglot-core.jar" ) -props = org.projectodd.polyglot.core.util.BuildInfo.new( "org/immutant/immutant.properties" ) +props = org.projectodd.polyglot.core.util.BuildInfo.new( java.lang.Thread.currentThread.getContextClassLoader, + "org/immutant/immutant.properties" ) immutant = props.getComponentInfo( 'Immutant' ) metadata = {}
Adjust dist for polyglot module reshuffle.
diff --git a/db/migrate/20170328121315_remove_land_registry.rb b/db/migrate/20170328121315_remove_land_registry.rb index abc1234..def5678 100644 --- a/db/migrate/20170328121315_remove_land_registry.rb +++ b/db/migrate/20170328121315_remove_land_registry.rb @@ -0,0 +1,10 @@+class RemoveLandRegistry < Mongoid::Migration + def self.up + content_items = ContentItem.where(content_id: "5fe3c59c-7631-11e4-a3cb-005056011aef") + content_items.destroy_all + end + + def self.down + raise "non-reversible migration" + end +end
Remove Land Registry Corporate Information Page Adds a migration to remove Land Registry Corporate Information Page. When Whitehall republishes the document, it should push everything through correctly.
diff --git a/jquerydotdotdot-rails.gemspec b/jquerydotdotdot-rails.gemspec index abc1234..def5678 100644 --- a/jquerydotdotdot-rails.gemspec +++ b/jquerydotdotdot-rails.gemspec @@ -10,7 +10,7 @@ spec.email = ["[email protected]"] spec.description = %q{TODO: Write a gem description} spec.summary = %q{TODO: Write a gem summary} - spec.homepage = "" + spec.homepage = "https://github.com/durhamka/jQuerydotdotdot-rails" spec.license = "MIT" spec.files = `git ls-files`.split($/)
Set homepage to Github repo
diff --git a/app/forms/db/program_detail_rows_form.rb b/app/forms/db/program_detail_rows_form.rb index abc1234..def5678 100644 --- a/app/forms/db/program_detail_rows_form.rb +++ b/app/forms/db/program_detail_rows_form.rb @@ -30,6 +30,8 @@ fetched_rows.each do |row_data| started_at = row_data[:started_at][:value] + return true if started_at.blank? + begin Time.parse(started_at) rescue
Allow blank to started_at on program_details
diff --git a/lib/arcanus/command/unlock.rb b/lib/arcanus/command/unlock.rb index abc1234..def5678 100644 --- a/lib/arcanus/command/unlock.rb +++ b/lib/arcanus/command/unlock.rb @@ -34,6 +34,7 @@ loop do ui.print 'Enter password: ', newline: false password = ui.secret_user_input + ui.newline begin key = Arcanus::Key.from_protected_file(repo.locked_key_path, password)
Print blank line after entering password This prevents the message from appearing after the "Enter password:" prompt.
diff --git a/lib/gene/macro/interpreter.rb b/lib/gene/macro/interpreter.rb index abc1234..def5678 100644 --- a/lib/gene/macro/interpreter.rb +++ b/lib/gene/macro/interpreter.rb @@ -31,8 +31,18 @@ end def parse_and_process input - result = Gene::CoreInterpreter.parse_and_process input do |output| - process output + process Gene::Parser.parse(input) + end + + def process data + result = nil + + if data.is_a? Gene::Types::Stream + data.each do |item| + result = @handlers.call self, item + end + else + result = @handlers.call self, data end if result == Gene::Macro::IGNORE @@ -41,8 +51,4 @@ result end end - - def process data - @handlers.call self, data - end end
Remove unnecessary steps of calling CoreInterpreter in Macro Interpreter
diff --git a/lib/active_admin/globalize3/engine.rb b/lib/active_admin/globalize3/engine.rb index abc1234..def5678 100644 --- a/lib/active_admin/globalize3/engine.rb +++ b/lib/active_admin/globalize3/engine.rb @@ -1,7 +1,7 @@ module ActiveAdmin module Globalize3 class Engine < ::Rails::Engine - initializer "Railsyard precompile hook", group: :assets do |app| + initializer "Railsyard precompile hook", group: :all do |app| app.config.assets.precompile += [ "active_admin/active_admin_globalize3.css", "active_admin/active_admin_globalize3.js"
Fix assets precompile with config.assets.initialize_on_precompile = true
diff --git a/lib/octopolo/commands/pull_request.rb b/lib/octopolo/commands/pull_request.rb index abc1234..def5678 100644 --- a/lib/octopolo/commands/pull_request.rb +++ b/lib/octopolo/commands/pull_request.rb @@ -8,6 +8,6 @@ c.action do |global_options, options, args| require_relative '../scripts/pull_request' options = global_options.merge(options) - Octopolo::Scripts::PullRequest.execute options[:destination_branch] + Octopolo::Scripts::PullRequest.execute options[:destination] end end
Use the correct key when passing destination flag
diff --git a/lib/tinplate/request_authenticator.rb b/lib/tinplate/request_authenticator.rb index abc1234..def5678 100644 --- a/lib/tinplate/request_authenticator.rb +++ b/lib/tinplate/request_authenticator.rb @@ -1,4 +1,7 @@ # https://services.tineye.com/developers/tineyeapi/authentication.html + +require "securerandom" +require "uri" module Tinplate class RequestAuthenticator
Add missing require statements to RequestAuthenticator.
diff --git a/lib/travis/build/script/shared/jdk.rb b/lib/travis/build/script/shared/jdk.rb index abc1234..def5678 100644 --- a/lib/travis/build/script/shared/jdk.rb +++ b/lib/travis/build/script/shared/jdk.rb @@ -17,6 +17,9 @@ sh.if '-f build.gradle || -f build.gradle.kts' do sh.export 'TERM', 'dumb' end + + sh.echo "Disabling Gradle daemon", ansi: :yellow + sh.cmd 'mkdir -p ~/.gradle && echo "org.gradle.daemon=false" >> ~/.gradle/gradle.properties', echo: true end def announce
Disable Gradle daemon for user In CI environment, Gradle daemons are discouraged. See https://docs.gradle.org/current/userguide/gradle_daemon.html#sec:ways_to_disable_gradle_daemon This resolves https://github.com/travis-ci/travis-ci/issues/8205
diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb index abc1234..def5678 100644 --- a/config/initializers/secret_token.rb +++ b/config/initializers/secret_token.rb @@ -9,4 +9,4 @@ # Make sure your secret_key_base is kept private # if you're sharing your code publicly. -PaperSearchApi::Application.config.secret_key_base = ENV['SECRET_KEY_BASE'] +PaperSearchApi::Application.config.secret_key_base = Rails.env == "test" ? "12345" : ENV['SECRET_KEY_BASE']
Define Application.config.secret_key_base for the test environment
diff --git a/test/dummy/config/environments/test.rb b/test/dummy/config/environments/test.rb index abc1234..def5678 100644 --- a/test/dummy/config/environments/test.rb +++ b/test/dummy/config/environments/test.rb @@ -8,7 +8,7 @@ config.cache_classes = true # Configure static asset server for tests with Cache-Control for performance - config.serve_static_assets = true + config.serve_static_files = true config.static_cache_control = "public, max-age=3600" # Log error messages when you accidentally call methods on nil
Rename deprecated config.serve_static_assets to config.serve_static_files
diff --git a/app/uploaders/attach_uploader.rb b/app/uploaders/attach_uploader.rb index abc1234..def5678 100644 --- a/app/uploaders/attach_uploader.rb +++ b/app/uploaders/attach_uploader.rb @@ -1,51 +1,13 @@-# encoding: utf-8 +class AttachUploader < CarrierWave::Uploader::Base + storage :file -class AttachUploader < CarrierWave::Uploader::Base - - # Include RMagick or MiniMagick support: - # include CarrierWave::RMagick - # include CarrierWave::MiniMagick - - # Choose what kind of storage to use for this uploader: - storage :file - # storage :fog - - # Override the directory where uploaded files will be stored. - # This is a sensible default for uploaders that are meant to be mounted: def store_dir "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" end - # Provide a default URL as a default if there hasn't been a file uploaded: - # def default_url - # # For Rails 3.1+ asset pipeline compatibility: - # # ActionController::Base.helpers.asset_path("fallback/" + [version_name, "default.png"].compact.join('_')) - # - # "/images/fallback/" + [version_name, "default.png"].compact.join('_') - # end - - # Process files as they are uploaded: - # process :scale => [200, 300] - # - # def scale(width, height) - # # do something - # end - - # Create different versions of your uploaded files: - # version :thumb do - # process :resize_to_fit => [50, 50] - # end - - # Add a white list of extensions which are allowed to be uploaded. - # For images you might use something like this: def extension_white_list - %w(jpg jpeg gif png doc docx pdf xls xlsx djvu html sql) + %w(jpg jpeg gif png doc docx pdf xls xlsx djvu rp mp3 html sql) end - # Override the filename of the uploaded files: - # Avoid using model.id or version_name here, see uploader/store.rb for details. - # def filename - # "something.jpg" if original_filename - # end - + CarrierWave::SanitizedFile.sanitize_regexp = /[^[:word:]\.\-\+]/ end
Fix cyrilic names for attach
diff --git a/lib/link_thumbnailer/scrapers/default/images.rb b/lib/link_thumbnailer/scrapers/default/images.rb index abc1234..def5678 100644 --- a/lib/link_thumbnailer/scrapers/default/images.rb +++ b/lib/link_thumbnailer/scrapers/default/images.rb @@ -57,7 +57,10 @@ def base_href base = document.at('//head/base') - base['href'] if base + href = base['href'] + href if base && ::URI.parse(href).host + rescue ::URI::InvalidURIError + nil end def model_class
Fix image URL's when base tag is an invalid URL Fixes #108.
diff --git a/lib/tasks/sample_data/payment_method_factory.rb b/lib/tasks/sample_data/payment_method_factory.rb index abc1234..def5678 100644 --- a/lib/tasks/sample_data/payment_method_factory.rb +++ b/lib/tasks/sample_data/payment_method_factory.rb @@ -24,7 +24,7 @@ def create_cash_method(enterprise) create_payment_method( - "Spree::PaymentMethod::Check", + Spree::PaymentMethod::Check, enterprise, "Cash on collection", "Pay on collection!", @@ -34,7 +34,7 @@ def create_card_method(enterprise) create_payment_method( - "Spree::Gateway::Bogus", + Spree::Gateway::Bogus, enterprise, "Credit card (fake)", "We charge 1%, but won't ask for your details. ;-)", @@ -43,7 +43,7 @@ end def create_payment_method(provider_class, enterprise, name, description, calculator) - payment_method = provider_class.constantize.new( + payment_method = provider_class.new( name: name, description: description, environment: Rails.env,
Improve payment method factory in sample data by removing constantize
diff --git a/jamespath.gemspec b/jamespath.gemspec index abc1234..def5678 100644 --- a/jamespath.gemspec +++ b/jamespath.gemspec @@ -11,6 +11,7 @@ spec.license = 'MIT' spec.files = `git ls-files`.split($/) spec.test_files = spec.files.grep(%r{^test/}) + spec.add_development_dependency('rake', '~> 10.0') spec.add_development_dependency('yard', '~> 0.0') spec.add_development_dependency('rdiscount', '>= 2.1.7', '< 3.0') end
Add rake to development dependencies
diff --git a/cookbooks/ondemand_base/recipes/ubuntu.rb b/cookbooks/ondemand_base/recipes/ubuntu.rb index abc1234..def5678 100644 --- a/cookbooks/ondemand_base/recipes/ubuntu.rb +++ b/cookbooks/ondemand_base/recipes/ubuntu.rb @@ -1,4 +1,16 @@ #Make sure that this recipe only runs on ubuntu systems if platform?("ubuntu") +include_recipe "ubuntu" +include_recipe "apt" + +# Ubuntu ships with vim-tiny, which lacks many of the basic features found in the vim package +package "vim" + +# Install useful tools +%w{ manpages man-db lsof mtr strace }.each do |pkg| + package pkg end + + +end
Install VIM and some useful tools. This was pulled from Optimize. It's awesome Former-commit-id: f1eb9a00f5a1717a28640003b2db582d029038c9
diff --git a/_plugins/utf8.rb b/_plugins/utf8.rb index abc1234..def5678 100644 --- a/_plugins/utf8.rb +++ b/_plugins/utf8.rb @@ -0,0 +1,18 @@+module Jekyll + module Commands + class Serve + + class << self + alias :_original_webrick_options :webrick_options + end + + def self.webrick_options(config) + options = _original_webrick_options(config) + options[:MimeTypes].merge!({'html' => 'text/html; charset=utf-8'}) + options[:MimeTypes].merge!({'xml' => 'text/xml; charset=utf-8'}) + options + end + + end + end +end
Set RSS to serve UTF8 information
diff --git a/app/controllers/concerns/authenticate.rb b/app/controllers/concerns/authenticate.rb index abc1234..def5678 100644 --- a/app/controllers/concerns/authenticate.rb +++ b/app/controllers/concerns/authenticate.rb @@ -16,7 +16,11 @@ def authenticate_token authenticate_or_request_with_http_token do |token, options| - ApiKey.exists?(access_token: token) + if ApiKey.exists?(access_token: token) + return true + else + return false + end end end
Revert part of authentication for explicit returns
diff --git a/app/controllers/executions_controller.rb b/app/controllers/executions_controller.rb index abc1234..def5678 100644 --- a/app/controllers/executions_controller.rb +++ b/app/controllers/executions_controller.rb @@ -9,8 +9,8 @@ return end - nb = Notebook.find_by!(uuid: params[:uuid]) - cell = nb.code_cells.find_by!(md5: params[:md5]) + @notebook = Notebook.find_by!(uuid: params[:uuid]) + cell = @notebook.code_cells.find_by!(md5: params[:md5]) success = params[:success].to_bool @execution = Execution.new( user: @user, @@ -20,7 +20,9 @@ ) @execution.save! # Not perfect, but try to log a click for each execution of the whole notebook - clickstream('executed notebook') if success && cell.cell_number.zero? + origin = ENV['HTTP_ORIGIN'] || request.headers['HTTP_ORIGIN'] + origin.sub!(%r{https?://}, '') + clickstream('executed notebook', tracking: origin) if success && cell.cell_number.zero? render json: { message: 'execution log accepted' }, status: :ok end end
Fix up execution click log
diff --git a/app/models/setup/xslt_template_common.rb b/app/models/setup/xslt_template_common.rb index abc1234..def5678 100644 --- a/app/models/setup/xslt_template_common.rb +++ b/app/models/setup/xslt_template_common.rb @@ -9,6 +9,8 @@ else 'xml' #TODO Infers html method from structure end + rescue + 'text' end def render(xslt, xml)
Fix | Prevent malformed XSLT documents
diff --git a/test/representers/api/musical_work_representer_test.rb b/test/representers/api/musical_work_representer_test.rb index abc1234..def5678 100644 --- a/test/representers/api/musical_work_representer_test.rb +++ b/test/representers/api/musical_work_representer_test.rb @@ -1,7 +1,6 @@ # encoding: utf-8 require 'test_helper' - require 'musical_work' if !defined?(AudioFile) describe Api::MusicalWorkRepresenter do @@ -18,8 +17,15 @@ json['id'].must_equal musical_work.id end + it 'will have a nested self link' do self_href = "/api/v1/stories/#{musical_work.story.id}/musical_works/#{musical_work.id}" json['_links']['self']['href'].must_equal self_href end + + it 'serializes the length of the story as duration' do + musical_work.stub(:excerpt_length, 123) do + json['duration'].must_equal 123 + end + end end
Add testing for musical work duration
diff --git a/lib/commands/convert_command.rb b/lib/commands/convert_command.rb index abc1234..def5678 100644 --- a/lib/commands/convert_command.rb +++ b/lib/commands/convert_command.rb @@ -7,9 +7,6 @@ if File.exists?(mod.work_dir) ResetCommand.new(@config).apply(mod) - Dir.chdir mod.work_dir do - Cheetah.run "git", "pull" - end else CloneCommand.new(@config).apply(mod) end
Remove "git pull" called during "convert" I don't think we should call "git pull" during "convert" if the work directory exists, only do a reset. The reason is that "pull" can change the source code you are working with under your hands, which is really bad during debugging. If needed, we can add "yk pull" command to invoke "git pull" manually.
diff --git a/lib/cucumber/a11y/a11y_steps.rb b/lib/cucumber/a11y/a11y_steps.rb index abc1234..def5678 100644 --- a/lib/cucumber/a11y/a11y_steps.rb +++ b/lib/cucumber/a11y/a11y_steps.rb @@ -8,26 +8,26 @@ expect(page).to_not be_accessible end -Then(/^"(.*?)" should be accessible$/) do |scope| - expect(page).to be_accessible_within(scope) +Then(/^the page should be accessible within "(.*?)"$/) do |scope| + expect(page).to be_accessible.within(scope) end -Then(/^"(.*?)" should not be accessible$/) do |scope| - expect(page).to_not be_accessible_within(scope) +Then(/^the page should not be accessible within "(.*?)"$/) do |scope| + expect(page).to_not be_accessible.within(scope) end -Then(/^the page should be accessible for tag "(.*?)"$/) do |tag| - expect(page).to be_accessible_for_tag(tag) -end - -Then(/^the page should not be accessible for tag "(.*?)"$/) do |tag| - expect(page).to_not be_accessible_for_tag(tag) -end - -Then(/^the page should be accessible for rule "(.*?)"$/) do |rule| - expect(page).to be_accessible_for_rule(rule) -end - -Then(/^the page should not be accessible for tag "(.*?)"$/) do |rule| - expect(page).to_not be_accessible_for_rule(rule) -end +# Then(/^the page should be accessible for tag "(.*?)"$/) do |tag| +# expect(page).to be_accessible_for_tag(tag) +# end +# +# Then(/^the page should not be accessible for tag "(.*?)"$/) do |tag| +# expect(page).to_not be_accessible_for_tag(tag) +# end +# +# Then(/^the page should be accessible for rule "(.*?)"$/) do |rule| +# expect(page).to be_accessible_for_rule(rule) +# end +# +# Then(/^the page should not be accessible for tag "(.*?)"$/) do |rule| +# expect(page).to_not be_accessible_for_rule(rule) +# end
Update Cucumber steps for within scope
diff --git a/lib/factory_girl/null_object.rb b/lib/factory_girl/null_object.rb index abc1234..def5678 100644 --- a/lib/factory_girl/null_object.rb +++ b/lib/factory_girl/null_object.rb @@ -16,5 +16,9 @@ def respond_to?(method, include_private=false) @methods_to_respond_to.include? method.to_s end + + def respond_to_missing?(*args) + false + end end end
Add respond_to_missing? on NullObject for 1.9 compatability
diff --git a/lib/tasks/ci.rake b/lib/tasks/ci.rake index abc1234..def5678 100644 --- a/lib/tasks/ci.rake +++ b/lib/tasks/ci.rake @@ -3,9 +3,13 @@ task :build => %w( sunspot:stop sunspot:start spec jasmine:ci cucumber:all ) task :default => :build - + task :reload_nginx_conf do + require 'pathname' nginx = ENV['NGINX_EXECUTABLE'] || '/opt/nginx/sbin/nginx' + log_dir = Pathname.new(__FILE__).dirname.join('../../log') + mkdir_p log_dir + %w(insecure_access.log secure_access.log).each {|log_file| touch log_dir.join(log_file) } sh "sudo #{nginx} -t" # to make sure it's valid before messing things up. sh "sudo #{nginx} -s reload" end
Make sure nginx log files are in place before trying to restart it
diff --git a/lib/ninetails/key_conversion.rb b/lib/ninetails/key_conversion.rb index abc1234..def5678 100644 --- a/lib/ninetails/key_conversion.rb +++ b/lib/ninetails/key_conversion.rb @@ -15,8 +15,14 @@ end end + def should_modify_keys? + @headers["Content-Type"].present? && + @headers["Content-Type"].include?("application/json") && + Ninetails::Config.key_style == :camelcase + end + def modify_keys(body) - if @headers["Content-Type"].include?("application/json") && Ninetails::Config.key_style == :camelcase + if should_modify_keys? body = JSON.parse(body).convert_keys -> (key) { key.camelcase :lower } body.to_json else
Check if Content-Type is present before running key conversion
diff --git a/test/l2/ts_misc.rb b/test/l2/ts_misc.rb index abc1234..def5678 100644 --- a/test/l2/ts_misc.rb +++ b/test/l2/ts_misc.rb @@ -7,9 +7,10 @@ class TestL2Misc < Test::Unit::TestCase def test_convert - (0..512).each { - len = rand(512) + (0..rand(1024)).each { + len = rand(512)+1 mac = Racket::L2::Misc.randommac(len) + assert_equal(mac.length, (len*2) + (len-1)) long = Racket::L2::Misc.mac2long(mac) assert_equal(mac, Racket::L2::Misc.long2mac(long, len)) assert_equal(long, Racket::L2::Misc.mac2long(mac))
Test that proper number of : exist git-svn-id: b3d365f95d627ddffb8722c756fee9dc0a59d335@114 64fbf49a-8b99-41c6-b593-eb2128c2192d
diff --git a/lib/tasks/import_cic_codes.rake b/lib/tasks/import_cic_codes.rake index abc1234..def5678 100644 --- a/lib/tasks/import_cic_codes.rake +++ b/lib/tasks/import_cic_codes.rake @@ -6,9 +6,7 @@ CSV.foreach("#{Rails.root}/app/assets/csv/cic_codes.csv", :headers => false) do |row| unless row[0].blank? counter += 1 - unless counter == 1 - CicCode.create(:code => row[0], :industry => row[1], :subindustry => row[2]) - end + CicCode.create(:code => row[0], :industry => row[1], :subindustry => row[2]) end end puts "#{counter} CIC Codes imported"
Update CicCode importer rake task
diff --git a/lib/capistrano_deploy_webhook/notifier.rb b/lib/capistrano_deploy_webhook/notifier.rb index abc1234..def5678 100644 --- a/lib/capistrano_deploy_webhook/notifier.rb +++ b/lib/capistrano_deploy_webhook/notifier.rb @@ -11,12 +11,14 @@ namespace :notify do task :post_request do application_name = `pwd`.chomp.split('/').last + git_user_email = `git config --get user.email` + puts "*** Notification POST to #{self[:notify_url]} for #{application_name}" url = URI.parse("#{self[:notify_url]}") req = Net::HTTP::Post.new(url.path) req.set_form_data( {'app' => application_name, - 'user' => self[:user], + 'user' => git_user_email, 'sha' => self[:current_revision], 'prev_sha' => self[:previous_revision], 'url' => self[:url]},
Deploy hook can now get git user email
diff --git a/Tabman.podspec b/Tabman.podspec index abc1234..def5678 100644 --- a/Tabman.podspec +++ b/Tabman.podspec @@ -3,7 +3,8 @@ s.name = "Tabman" s.platform = :ios, "9.0" s.requires_arc = true - s.swift_version = "4.0" + + s.swift_versions = ['4.0', '4.1', '4.2', '5.0'] s.version = "2.4.2" s.summary = "A powerful paging view controller with indicator bar."
Support multiple versions of Swift in podspec
diff --git a/lib/heroku/deploy/tasks/compile_assets.rb b/lib/heroku/deploy/tasks/compile_assets.rb index abc1234..def5678 100644 --- a/lib/heroku/deploy/tasks/compile_assets.rb +++ b/lib/heroku/deploy/tasks/compile_assets.rb @@ -13,5 +13,9 @@ task "Precompiling assets" shell "bundle exec rake assets:precompile", :env => env_vars, :exec => true end + + def rollback_before_push + git "clean -fd" + end end end
Clean up assets on rollback
diff --git a/lib/rails-i18n-js/rack/i18n/javascript.rb b/lib/rails-i18n-js/rack/i18n/javascript.rb index abc1234..def5678 100644 --- a/lib/rails-i18n-js/rack/i18n/javascript.rb +++ b/lib/rails-i18n-js/rack/i18n/javascript.rb @@ -1,6 +1,9 @@ module Rack module I18n class Javascript + class_attribute :namespace + self.namespace = '' + def initialize(app) @app = app end @@ -13,9 +16,8 @@ end end - def serve_translations(locale) - # FIXME patch I18n::Backend::Base, adding #translations_for - if translations = ::I18n.backend.send(:translations)[locale.to_sym] + def serve_translations(locale, namespace = self.class.namespace) + if translations = ::I18n.t(namespace, :locale => locale) [ 200, {"Content-Type" => "text/javascript"}, javascript_for(locale, translations) ] else [ 404, {"Content-Type" => "text/javascript"}, "Not Found" ] @@ -27,4 +29,4 @@ end end end -end+end
Use Namespace for fetch a subset of translations
diff --git a/rakefiles/quality.rake b/rakefiles/quality.rake index abc1234..def5678 100644 --- a/rakefiles/quality.rake +++ b/rakefiles/quality.rake @@ -4,13 +4,13 @@ directory report_dir desc "Run pep8 on all #{system} code" - task "pep8_#{system}" => report_dir do + task "pep8_#{system}" => [report_dir, :install_python_prereqs] do sh("pep8 #{system} | tee #{report_dir}/pep8.report") end task :pep8 => "pep8_#{system}" desc "Run pylint on all #{system} code" - task "pylint_#{system}" => report_dir do + task "pylint_#{system}" => [report_dir, :install_python_prereqs] do apps = Dir["#{system}/*.py", "#{system}/djangoapps/*", "#{system}/lib/*"].map do |app| File.basename(app) end.select do |app|
Install prereqs before running pep8 or pylint
diff --git a/padrino-rpm.gemspec b/padrino-rpm.gemspec index abc1234..def5678 100644 --- a/padrino-rpm.gemspec +++ b/padrino-rpm.gemspec @@ -16,6 +16,6 @@ s.summary = %q{Padrino Instrumentation for New Relic RPM} s.files = `git ls-files`.split("\n") - s.add_dependency(%q<newrelic_rpm>, "~> 3.5.3.25") + s.add_dependency(%q<newrelic_rpm>, "~> 3.3.3") end
Revert "Bump NewRelic dependency to 3.5.3.25 for security" This reverts commit 80b6b55905067047d1a8b9c5b454a32deebb26d6.
diff --git a/app/jobs/log_job.rb b/app/jobs/log_job.rb index abc1234..def5678 100644 --- a/app/jobs/log_job.rb +++ b/app/jobs/log_job.rb @@ -8,7 +8,10 @@ log_files.each do |log_file| initial_location = "log/#{log_file}.log" final_location = "log/old_#{log_file}.log" + FileUtils.mv initial_location, final_location + FileUtils.touch initial_location + FileUtils.chmod 755, initial_location end end
Fix bug where new log files were not writable
diff --git a/flippant.gemspec b/flippant.gemspec index abc1234..def5678 100644 --- a/flippant.gemspec +++ b/flippant.gemspec @@ -1,19 +1,17 @@-# coding: utf-8 - lib = File.expand_path("../lib", __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require "flippant/version" Gem::Specification.new do |spec| - spec.name = "flippant" - spec.version = Flippant::VERSION - spec.authors = ["Parker Selbert"] - spec.email = ["[email protected]"] + spec.name = "flippant" + spec.version = Flippant::VERSION + spec.authors = ["Parker Selbert"] + spec.email = ["[email protected]"] - spec.summary = "Fast feature toggling for applications" + spec.summary = "Fast feature toggling for applications" spec.description = "Fast feature toggling for applications" - spec.homepage = "https://github.com/sorentwo/flippant-rb" - spec.license = "MIT" + spec.homepage = "https://github.com/sorentwo/flippant-rb" + spec.license = "MIT" spec.files = `git ls-files -z`.split("\x0").reject do |f| f.match(%r{^spec/})
Remove unnecessary utf-8 coding comment
diff --git a/lib/dm-types/csv.rb b/lib/dm-types/csv.rb index abc1234..def5678 100644 --- a/lib/dm-types/csv.rb +++ b/lib/dm-types/csv.rb @@ -10,27 +10,26 @@ module DataMapper class Property class Csv < Text + def primitive?(value) super || value.kind_of?(::Array) end def load(value) case value - when ::String then CSV.parse(value) - when ::Array then value - else - nil + when ::String then CSV.parse(value) + when ::Array then value end end def dump(value) case value - when ::Array then CSV.generate { |csv| value.each { |row| csv << row } } + when ::Array + CSV.generate { |csv| value.each { |row| csv << row } } when ::String then value - else - nil end end + end # class Csv end # class Property end # module DataMapper
Remove unnecessary nils, and keep code within 80 columns.