diff stringlengths 65 26.7k | message stringlengths 7 9.92k |
|---|---|
diff --git a/cookbooks/ondemand_base/recipes/windows.rb b/cookbooks/ondemand_base/recipes/windows.rb
index abc1234..def5678 100644
--- a/cookbooks/ondemand_base/recipes/windows.rb
+++ b/cookbooks/ondemand_base/recipes/windows.rb
@@ -35,4 +35,13 @@ #Turn off IPv6
windows_registry 'HKLM\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters' do
values 'DisabledComponents' => "0xffffffff"
-end+end
+
+#Auto reboot on system crashes, log the crash to the event log, and create a crash dump
+windows_registry 'HKLM\SYSTEM\CurrentControlSet\Control\CrashControl'
+ values 'AutoReboot' => "3"
+ values 'LogEvent' => "3"
+ values 'CrashDumpEnabled' => "3"
+end
+
+
| Add auto rebooting on system crashes with dump creation and event log logging.
Former-commit-id: 9c40ab5f06d152e679ce85ac177096813140ed5c |
diff --git a/warmercooler.rb b/warmercooler.rb
index abc1234..def5678 100644
--- a/warmercooler.rb
+++ b/warmercooler.rb
@@ -1,8 +1,9 @@-answer = 1 + rand(1000)
-puts answer # This statement is temporary while I test the game.
+solution = 1 + rand(1000)
+
+puts solution # This statement is temporary while I test the game.
puts "Guess what number I'm thinking of. It's between 1 and 1000"
guess = gets.to_i
-while guess != answer
+while guess != solution
puts "Wrong! Guess again!"
guess = gets.to_i
end
| Rename 'answer' variable to 'solution'
|
diff --git a/subscriptions.gemspec b/subscriptions.gemspec
index abc1234..def5678 100644
--- a/subscriptions.gemspec
+++ b/subscriptions.gemspec
@@ -9,9 +9,9 @@ s.version = Subscriptions::VERSION
s.authors = ["Ben McFadden"]
s.email = ["ben@forgeapps.com"]
- s.homepage = "TODO"
- s.summary = "TODO: Summary of Subscriptions."
- s.description = "TODO: Description of Subscriptions."
+ s.homepage = "https://github.com/Lightstock/Subscriptions"
+ s.summary = "Subscriptions is a work in progress."
+ s.description = "Subscriptions is a work in progress, but is ultimately designed to become a drop-in subscription management and billing system."
s.license = "MIT"
s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"]
| Update description and summary in gemspec
|
diff --git a/tasks/metrics/ci.rake b/tasks/metrics/ci.rake
index abc1234..def5678 100644
--- a/tasks/metrics/ci.rake
+++ b/tasks/metrics/ci.rake
@@ -1,7 +1,7 @@ desc 'Run metrics with Heckle'
-task :ci => [ 'ci:metrics', :heckle ]
+task :ci => %w[ ci:metrics heckle ]
namespace :ci do
desc 'Run metrics'
- task :metrics => [ :verify_measurements, :flog, :flay, :reek, :roodi, 'metrics:all' ]
+ task :metrics => %w[ verify_measurements flog flay reek roodi metrics:all ]
end
| Change to use a quoted array for the task list
|
diff --git a/tasks/virtualenv.rake b/tasks/virtualenv.rake
index abc1234..def5678 100644
--- a/tasks/virtualenv.rake
+++ b/tasks/virtualenv.rake
@@ -12,11 +12,14 @@ sh("curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | sudo python")
end
+ #task :hub do
+ # notice("Installing hub")
+ # url = "http://hub.github.com/standalone"
+ # sh("curl #{url} -sLo #{HUB}")
+ # sh("chmod +x #{HUB}")
+ #end
task :hub do
- notice("Installing hub")
- url = "http://defunkt.io/hub/standalone"
- sh("curl #{url} -sLo #{HUB}")
- sh("chmod +x #{HUB}")
+ install_gems(["hub"])
end
#desc "Install basic tools"
| Replace hub installation with gem
|
diff --git a/lib/starting_blocks-blinky.rb b/lib/starting_blocks-blinky.rb
index abc1234..def5678 100644
--- a/lib/starting_blocks-blinky.rb
+++ b/lib/starting_blocks-blinky.rb
@@ -1,4 +1,66 @@ require 'starting_blocks'
require 'blinky'
+# fix issue where no light will cause lock-up
+module Blinky
+ class LightFactory
+ class << self
+ alias :original_detect_lights :detect_lights
+ def detect_lights plugins, recipes
+ original_detect_lights plugins, recipes
+ rescue
+ []
+ end
+ end
+ end
+end
+
+module StartingBlocks
+ module Extensions
+ class BlinkyLighting
+
+ def initialize
+ @light = Blinky.new.light
+ end
+
+ def self.turn_off!
+ Blinky.new.light.off!
+ end
+
+ def receive_files_to_run files
+ @spec_count = files.count
+ return if files.count == 0
+ change_color_to :yellow
+ end
+
+ def receive_results results
+ return if @spec_count == 0
+ if (results[:tests] || 0) == 0
+ change_color_to :red
+ elsif (results[:errors] || 0) > 0
+ change_color_to :red
+ elsif (results[:failures] || 0) > 0
+ change_color_to :red
+ elsif (results[:skips] || 0) > 0
+ change_color_to :yellow
+ else
+ change_color_to :green
+ end
+ end
+
+ def change_color_to(color)
+ case color
+ when :green
+ @light.success!
+ when :red
+ @light.failure!
+ when :yellow
+ @light.building!
+ end
+ rescue
+ end
+ end
+ end
+end
+
StartingBlocks::Publisher.subscribers << StartingBlocks::Extensions::BlinkyLighting.new
| Move the blinky code into this gem.
|
diff --git a/modules/network/lib/puppet/parser/functions/get_ipaddress.rb b/modules/network/lib/puppet/parser/functions/get_ipaddress.rb
index abc1234..def5678 100644
--- a/modules/network/lib/puppet/parser/functions/get_ipaddress.rb
+++ b/modules/network/lib/puppet/parser/functions/get_ipaddress.rb
@@ -1,14 +1,19 @@ require 'ipaddress'
module Puppet::Parser::Functions
newfunction(:get_ipaddress, :type => :rvalue) do |args|
+
+ networking_fact = lookupvar('::networking')
+ interfaces = networking_fact['interfaces']
+
+ exclude_interfaces = [/^lo$/, /^vboxnet[\d]{1,2}$/]
+
if args[0] and !args[0].empty?
- interface = args[0].to_s
- lookupvar('::ipaddress_' + interface)
+ interfaces[args[0].to_s]['ip']
else
ipaddr = ''
- lookupvar('::interfaces').split(',').each do |interface|
- next if interface == 'lo'
- ipaddr_fact = lookupvar('::ipaddress_' + interface)
+ interfaces.each do |interface_key, interface_value|
+ next if interface_key =~ Regexp.union(exclude_interfaces)
+ ipaddr_fact = interface_value['ip']
next if not IPAddress.valid_ipv4?(ipaddr_fact)
ipaddr = IPAddress::IPv4.new(ipaddr_fact)
break if ipaddr.private?
| Rewrite ip address gathering out of new facter hash
|
diff --git a/lib/xeroid/objects/payment.rb b/lib/xeroid/objects/payment.rb
index abc1234..def5678 100644
--- a/lib/xeroid/objects/payment.rb
+++ b/lib/xeroid/objects/payment.rb
@@ -1,15 +1,12 @@+require 'xeroid/objects/attributes'
+
module Xeroid
module Objects
class Payment
- attr_reader :invoice, :account, :amount, :date, :currency_rate
+ include Attributes
- def initialize(attributes)
- @invoice = attributes[:invoice]
- @account = attributes[:account]
- @amount = attributes[:amount]
- @date = attributes[:date]
- @currency_rate = attributes[:currency_rate]
- end
+ attribute :invoice, :account, :date
+ big_decimal :amount, :currency_rate
end
end
end
| Bring Payment object up to date
|
diff --git a/test/postgres_test.rb b/test/postgres_test.rb
index abc1234..def5678 100644
--- a/test/postgres_test.rb
+++ b/test/postgres_test.rb
@@ -4,6 +4,13 @@ class PostgresqlTest < Test::Unit::TestCase
include Relationizer::Postgresql
+ # Create relation as
+ #
+ # id | name
+ # ----+------
+ # 1 | hoge
+ # 2 | fuga
+ #
test "postgresql" do
schema = { id: nil, name: nil }
tuples = [[1, 'hoge'], [2, 'fuga']]
| Add comment to postgresql test
|
diff --git a/lib/app_proxy.rb b/lib/app_proxy.rb
index abc1234..def5678 100644
--- a/lib/app_proxy.rb
+++ b/lib/app_proxy.rb
@@ -5,7 +5,6 @@ Rack::Builder.new do
use Rack::ReverseProxy do
reverse_proxy '/', 'https://new.hackclub.com'
- reverse_proxy_options force_ssl: true
end
# Don't return for any request that somehow passes through the reverse
| Fix how the reverse proxy interacts with SSL hosts
|
diff --git a/lib/test/page.rb b/lib/test/page.rb
index abc1234..def5678 100644
--- a/lib/test/page.rb
+++ b/lib/test/page.rb
@@ -2,13 +2,46 @@
module Test
class Page
- attr_reader :container
+ extend Forwardable
- def initialize(container)
- @container = container
+ def_delegators :container, :present?, :p
+
+ class << self
+ attr_accessor :browser
+ attr_reader :setup_block, :container_block
+
+ def container(&block)
+ @container_block = block
+ end
+
+ def setup(&block)
+ @setup_block = block
+ end
end
- def modify element, methodz
+ attr_writer :browser
+ attr_writer :container
+
+ def browser
+ @browser || parent_page_browser
+ end
+
+ def container
+ if @setup_block
+ instance_eval(&@setup_block)
+ @setup_block = nil
+ end
+ @container ||= self.class.container_block && instance_eval(&self.class.container_block)
+ end
+
+ def initialize(container=nil, &block)
+ @container = container
+ @setup_block = self.class.setup_block
+
+ block.call self if block
+ end
+
+ def modify(element, methodz)
methodz.each_pair do |meth, return_value|
element.instance_eval do
singleton = class << self; self end
@@ -23,22 +56,29 @@ element
end
- def redirect_to(page, container)
- page.new container
+ def redirect_to(page, container=nil)
+ page.new container || self.container
end
def method_missing(name, *args)
- if @container.respond_to?(name)
- self.class.class_eval %Q[
- def #{name}(*args)
- @container.send(:#{name}, *args) {yield}
- end
- ]
+ if container.respond_to?(name)
+ self.class.send :define_method, name do |*args|
+ container.send(name, *args) {yield}
+ end
self.send(name, *args) {yield}
else
super
end
end
+
+ private
+
+ def parent_page_browser
+ page_with_browser = self.class.ancestors.find do |klass|
+ klass.respond_to?(:browser) && klass.browser
+ end
+ page_with_browser ? page_with_browser.browser : nil
+ end
end
end
| Add support for specifying container, setup block and browser.
|
diff --git a/db/migrate/20141104095557_import_topic_taggings_from_panopticon.rb b/db/migrate/20141104095557_import_topic_taggings_from_panopticon.rb
index abc1234..def5678 100644
--- a/db/migrate/20141104095557_import_topic_taggings_from_panopticon.rb
+++ b/db/migrate/20141104095557_import_topic_taggings_from_panopticon.rb
@@ -0,0 +1,42 @@+class ImportTopicTaggingsFromPanopticon < Mongoid::Migration
+ def self.up
+ Artefact.where(owning_app: 'publisher').each do |artefact|
+ Edition.where(panopticon_id: artefact.id, :state.ne => "archived").each do |edition|
+ sectors = artefact.specialist_sectors.map(&:tag_id)
+
+ edition.primary_topic = sectors.shift
+ edition.additional_topics = sectors
+
+ edition.browse_pages = artefact.sections.map(&:tag_id)
+
+ puts "Setting tags on edition ##{edition.id} for artefact ##{artefact.id} #{artefact.name}"
+ puts "-- primary topic: #{edition.primary_topic}"
+ puts "-- additional topics: #{edition.additional_topics.inspect}"
+ puts "-- browse pages: #{edition.browse_pages.inspect}"
+
+ save_edition(edition)
+ end
+ end
+ end
+
+ def self.down
+ Artefact.where(owning_app: 'publisher').each do |artefact|
+ Edition.where(panopticon_id: artefact.id, :state.ne => "archived").each do |edition|
+ edition.primary_topic = nil
+ edition.additional_topics = []
+
+ edition.browse_pages = []
+
+ puts "Clearing tags on edition ##{edition.id} for artefact ##{artefact.id} #{artefact.name}"
+
+ save_edition(edition)
+ end
+ end
+ end
+
+ def self.save_edition(edition)
+ Edition.skip_callback(:save, :before, :check_for_archived_artefact) # Allow saving editions to archived artefacts
+ edition.save(validate: false) # Skip protection of editing published editions
+ Edition.set_callback(:save, :before, :check_for_archived_artefact)
+ end
+end
| Add migration to import taggings from panopticon.
Requires bump to govuk_content_models. |
diff --git a/flipper-cache-store.gemspec b/flipper-cache-store.gemspec
index abc1234..def5678 100644
--- a/flipper-cache-store.gemspec
+++ b/flipper-cache-store.gemspec
@@ -0,0 +1,24 @@+# -*- encoding: utf-8 -*-
+require File.expand_path('../lib/flipper/version', __FILE__)
+
+flipper_cache_store_files = lambda do |file|
+ file =~ /cache_store/
+end
+
+Gem::Specification.new do |gem|
+ gem.authors = ['John Nunemaker']
+ gem.email = ['nunemaker@gmail.com']
+ gem.summary = 'ActiveSupport::Cache::Store adapter for Flipper'
+ gem.description = 'ActiveSupport::Cache::Store adapter for Flipper'
+ gem.license = 'MIT'
+ gem.homepage = 'https://github.com/jnunemaker/flipper'
+
+ gem.files = `git ls-files`.split("\n").select(&flipper_cache_store_files) + ['lib/flipper/version.rb']
+ gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n").select(&flipper_cache_store_files)
+ gem.name = 'flipper-cache-store'
+ gem.require_paths = ['lib']
+ gem.version = Flipper::VERSION
+
+ gem.add_dependency 'flipper', "~> #{Flipper::VERSION}"
+ gem.add_dependency 'activesupport', '>= 3.2', '< 6'
+end
| Add Flipper Cache Store .gemspec
* Has an ActiveSupport dependency so publish as own gem
|
diff --git a/tasks/ar_dumper_tasks.rake b/tasks/ar_dumper_tasks.rake
index abc1234..def5678 100644
--- a/tasks/ar_dumper_tasks.rake
+++ b/tasks/ar_dumper_tasks.rake
@@ -0,0 +1,43 @@+VALID_DUMPER_OPTIONS = [:filename, :file_extension, :target_type,
+ :only, :except, :methods, :procs, :find, :records,
+ :header, :text_format, :root]
+
+namespace :dumper do
+ desc "Dumps entire model in FORMAT. rake dumper FORMAT=csv MODEL=User FILEPATH=fixtures FILENAME = users.yml"
+ task :dump => :environment do
+ raise "Please specify MODEL=class" unless ENV['MODEL']
+ raise "Please specify FORMAT=format (csv, yml, xml, fixtures)" unless ENV['FORMAT']
+
+
+ options = (VALID_DUMPER_OPTIONS - [:find]).inject({}) do |map, option|
+ map[option] = ENV[option.to_s.upcase] if ENV[option.to_s.upcase]
+ map
+ end
+
+ #accept with and without hyphen
+ options[:filename] ||= ENV['FILENAME']
+ options[:file_path]||= ENV['FILEPATH']
+
+ options[:find] = eval(ENV['FIND']) if ENV['FIND']
+ options[:find] ||= { :conditions => ENV['FIND_CONDITIONS'] } if ENV['FIND_CONDITIONS']
+
+ #file extension is not always properly added
+ options[:file_extension]||= ENV['FORMAT'] == 'fixture' ? 'yml' : ENV['FORMAT']
+
+ model_klass = ENV['MODEL'].classify.constantize
+ format = ENV['FORMAT']
+
+ puts model_klass.dumper ENV['FORMAT'].to_s.downcase, options
+ end
+
+ [:yml, :fixture, :xml, :csv].each do |method|
+ class_eval <<-END_TASK
+ desc "Dumps entire model to #{method}"
+ task :#{method} do
+ ENV['FORMAT'] = '#{method}'
+ Rake::Task['dumper:dump'].invoke
+ end
+ END_TASK
+ end
+
+end
| Add rake tasks to dump files from command line
|
diff --git a/gcoder.gemspec b/gcoder.gemspec
index abc1234..def5678 100644
--- a/gcoder.gemspec
+++ b/gcoder.gemspec
@@ -1,24 +1,25 @@-# coding: utf-8
-require File.expand_path("../lib/gcoder/version", __FILE__)
+require File.expand_path('../lib/gcoder/version', __FILE__)
Gem::Specification.new do |s|
- s.name = 'gcoder'
- s.version = GCoder::VERSION
- s.platform = Gem::Platform::RUBY
- s.authors = ['Carsten Nielsen', 'Christos Pappas']
- s.email = ['heycarsten@gmail.com']
- s.homepage = 'http://github.com/heycarsten/gcoder'
- s.summary = %q{A nice library for geocoding stuff with Google Maps API V3}
- s.description = %q{Uses Google Maps Geocoding API (V3) to geocode stuff and optionally caches the results somewhere.}
+ s.name = 'gcoder'
+ s.version = GCoder::VERSION
+ s.platform = Gem::Platform::RUBY
+ s.date = Date.today.strftime('%F')
+ s.homepage = 'http://github.com/heycarsten/gcoder'
+ s.authors = ['Carsten Nielsen', 'Christos Pappas']
+ s.email = 'heycarsten@gmail.com'
+ s.summary = 'A nice library for geocoding stuff with Google Maps API V3'
+ s.rubyforge_project = 'gcoder'
+ s.files = `git ls-files`.split(?\n)
+ s.test_files = `git ls-files -- {test,spec}/*`.split(?\n)
+ s.require_paths = ['lib']
- s.required_rubygems_version = '>= 1.8.5'
- s.rubyforge_project = 'gcoder'
+ s.add_dependency 'hashie'
+ s.add_dependency 'yajl-ruby'
+ s.add_dependency 'ruby-hmac'
- s.add_dependency 'hashie'
- s.add_dependency 'yajl-ruby'
- s.add_dependency 'ruby-hmac'
-
- s.files = `git ls-files`.split(?\n)
- s.test_files = `git ls-files -- {test,spec}/*`.split(?\n)
- s.require_paths = ['lib']
+ s.description = <<-END
+Uses Google Maps Geocoding API (V3) to geocode stuff and optionally caches the
+results somewhere.
+ END
end
| Remove constraint on Rubygems version in gemspec (thanks @aishafenton for pointing that out.)
|
diff --git a/db/seeds/development/users.rb b/db/seeds/development/users.rb
index abc1234..def5678 100644
--- a/db/seeds/development/users.rb
+++ b/db/seeds/development/users.rb
@@ -17,3 +17,9 @@ username: "foo",
hashed_password: "$2a$10$9sK8ojTvFTtfyxqgE/GW2.YAvTuxVc5Nuwbp3W4t9uFyRt8ucNz5q",
)
+
+User.create(
+ screen: "Root",
+ username: "root",
+ hashed_password: "$2a$10$9sK8ojTvFTtfyxqgE/GW2.YAvTuxVc5Nuwbp3W4t9uFyRt8ucNz5q",
+)
| Add seed data for "root"
|
diff --git a/lib/dry/web/roda/generate.rb b/lib/dry/web/roda/generate.rb
index abc1234..def5678 100644
--- a/lib/dry/web/roda/generate.rb
+++ b/lib/dry/web/roda/generate.rb
@@ -25,7 +25,7 @@ source = Pathname(source)
aboslute_source_path = source.expand_path(SOURCE_DIR)
target_file = get_target_file(target)
- template_file = template_files.find { |f| f == aboslute_source_path.to_s }
+ template_file = template_files.find { |f| f == aboslute_source_path.to_s } or raise "missing template file +#{source}+"
template_file = Pathname(template_file)
processor.template template_file, target_file, template_scope
| Raise an error to help finding an issue on CI |
diff --git a/lib/facter/root_encrypted.rb b/lib/facter/root_encrypted.rb
index abc1234..def5678 100644
--- a/lib/facter/root_encrypted.rb
+++ b/lib/facter/root_encrypted.rb
@@ -1,5 +1,5 @@ Facter.add("root_encrypted") do
- confine :os_family => 'Darwin'
+ confine :osfamily => 'Darwin'
def root_encrypted?
system("/usr/bin/fdesetup isactive / >/dev/null")
| Fix broken fact for enforcing full disk encryption
The core fact we want to check is called `osfamily`, not `os_family`:
http://docs.puppetlabs.com/facter/1.7/core_facts.html#osfamily
Right now this fact is never being run, so the code from the sample
Boxen project to enforce full disk encryption doesn't work:
https://github.com/boxen/our-boxen/blob/565e3e96a69644f5a6eb4179f559fb327c55cb87/manifests/site.pp#L62-L64
|
diff --git a/lib/ruby-os/memory/errors.rb b/lib/ruby-os/memory/errors.rb
index abc1234..def5678 100644
--- a/lib/ruby-os/memory/errors.rb
+++ b/lib/ruby-os/memory/errors.rb
@@ -17,4 +17,8 @@ # When an assignment is requested past available memory limits
class OutOfBoundsAssignment < Error
end
+
+ # When an assignment is requested over an existing assignment
+ class AssignmentError < Error
+ end
end
| Add error for assigning over previous assignment
|
diff --git a/lib/salesforce_bulk/batch.rb b/lib/salesforce_bulk/batch.rb
index abc1234..def5678 100644
--- a/lib/salesforce_bulk/batch.rb
+++ b/lib/salesforce_bulk/batch.rb
@@ -17,8 +17,8 @@ batch.id = data['id']
batch.job_id = data['jobId']
batch.state = data['state']
- batch.started_at = data['createdDate']
- batch.ended_at = data['systemModstamp']
+ batch.started_at = DateTime.parse(data['createdDate'])
+ batch.ended_at = DateTime.parse(data['systemModstamp'])
batch.processed_records = data['numberRecordsProcessed'].to_i
batch.failed_records = data['numberRecordsFailed'].to_i
batch.total_processing_time = data['totalProcessingTime'].to_i
| Update Batch.new_from_xml to now parse date strings as DateTime instances.
|
diff --git a/files/private-chef-cookbooks/private-chef/libraries/enterprise_plugin.rb b/files/private-chef-cookbooks/private-chef/libraries/enterprise_plugin.rb
index abc1234..def5678 100644
--- a/files/private-chef-cookbooks/private-chef/libraries/enterprise_plugin.rb
+++ b/files/private-chef-cookbooks/private-chef/libraries/enterprise_plugin.rb
@@ -6,7 +6,7 @@ end
def set_or_return(name, value=nil)
- if value
+ if !value.nil?
instance_variable_set("@#{name}", value)
else
instance_variable_get("@#{name}")
| Allow user to set false values
|
diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb
index abc1234..def5678 100644
--- a/config/initializers/assets.rb
+++ b/config/initializers/assets.rb
@@ -1,3 +1,4 @@+# Encoding: utf-8
# Be sure to restart your server when you modify this file.
# Version of your assets, change this if you want to expire all your assets.
@@ -7,5 +8,6 @@ # Rails.application.config.assets.paths << Emoji.images_path
# Precompile additional assets.
-# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
+# application.js, application.css, and all non-JS/CSS in app/assets folder
+# are already added.
# Rails.application.config.assets.precompile += %w( search.js )
| Clean up asset initialization script
|
diff --git a/spec/helper.rb b/spec/helper.rb
index abc1234..def5678 100644
--- a/spec/helper.rb
+++ b/spec/helper.rb
@@ -6,7 +6,7 @@ Coveralls::SimpleCov::Formatter
]
SimpleCov.start do
- add_filter '/.bundle/'
+ add_filter '/vendor/bundle/'
add_filter '/spec/'
minimum_coverage(97.86)
end
| Fix the bundle path, fix the build
|
diff --git a/lib/browse_everything.rb b/lib/browse_everything.rb
index abc1234..def5678 100644
--- a/lib/browse_everything.rb
+++ b/lib/browse_everything.rb
@@ -22,7 +22,7 @@ if value.nil? or value.kind_of?(Hash)
@config = value
elsif value.kind_of?(String)
- @config = YAML.load(File.read(value))
+ @config = YAML.load(ERB.new(File.read(value)).result)
if @config.include? 'drop_box'
warn "[DEPRECATION] `drop_box` is deprecated. Please use `dropbox` instead."
| Allow ERB in YAML config.
|
diff --git a/db/data_migration/20140909102120_migrate_worldwide_office_types.rb b/db/data_migration/20140909102120_migrate_worldwide_office_types.rb
index abc1234..def5678 100644
--- a/db/data_migration/20140909102120_migrate_worldwide_office_types.rb
+++ b/db/data_migration/20140909102120_migrate_worldwide_office_types.rb
@@ -0,0 +1,18 @@+WorldwideOffice.all.each do |office|
+ unless ["Embassy", "Consulate", "High Commission"].include?(office.worldwide_office_type.name)
+ case office.slug
+ when /^british\-embassy/
+ if office.update_attribute(:worldwide_office_type, WorldwideOfficeType::Embassy)
+ puts "Updated #{office.slug} to type WorldwideOfficeType::Embassy"
+ end
+ when /^british\-high\-commission/
+ if office.update_attribute(:worldwide_office_type, WorldwideOfficeType::HighCommission)
+ puts "Updated #{office.slug} to type WorldwideOfficeType::HighCommission"
+ end
+ when /^british\-consulate/
+ if office.update_attribute(:worldwide_office_type, WorldwideOfficeType::Consulate)
+ puts "Updated #{office.slug} to type WorldwideOfficeType::Consulate"
+ end
+ end
+ end
+end
| Fix consular service offices with the wrong office type
|
diff --git a/db/migrate/20130419195746_increase_data_length_on_notifications.rb b/db/migrate/20130419195746_increase_data_length_on_notifications.rb
index abc1234..def5678 100644
--- a/db/migrate/20130419195746_increase_data_length_on_notifications.rb
+++ b/db/migrate/20130419195746_increase_data_length_on_notifications.rb
@@ -0,0 +1,9 @@+class IncreaseDataLengthOnNotifications < ActiveRecord::Migration
+ def up
+ execute "ALTER TABLE notifications ALTER COLUMN data TYPE VARCHAR(1000)"
+ end
+
+ def down
+ # Don't need to revert it to the smaller size
+ end
+end
| Make data column of notifications table big enough for long titles
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,7 +1,6 @@ Rails.application.routes.draw do
-
+ root 'users#profile'
get 'users/profile'
-
get 'teams/index'
#resolve these
| Change landing page to automatically send to user sign in if user is not signed in, or to send to user profile if the user is signed in
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,3 +1,3 @@-Rails.application.routes.draw do |map|
+Rails.application.routes.draw do
match '/js_named_routes' => 'named_routes#generate', :method => :get
end
| Resolve the routing deprecation warnign
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -6,19 +6,23 @@ resources :assignments do
patch 'grade', to: :grade
end
-
+
resources :sections do
resources :seats, only: [:index, :new, :create]
resources :assignments, only: [:new, :create]
+
+ # Testing out nesting this resource so we can attach section ID to student creation.
+ resources :students do
+ end
end
- resources :students do
-
- end
+ # resources :students do
+ #
+ # end
resource :profile, only: [:show, :edit, :update]
get '/dashboard', to: 'dashboards#show'
-
+
root 'dashboards#show'
end
| Add students as nested resource within section to aid section-student creation
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,3 +1,6 @@ Rails.application.routes.draw do
- resources :questions
+ root 'questions#index'
+ resources :questions do
+ resources :answers, only: [:new, :create]
+ end
end
| Add answers as nested resources for questions
|
diff --git a/app/models/competitions/blind_date_at_the_dairy_overall.rb b/app/models/competitions/blind_date_at_the_dairy_overall.rb
index abc1234..def5678 100644
--- a/app/models/competitions/blind_date_at_the_dairy_overall.rb
+++ b/app/models/competitions/blind_date_at_the_dairy_overall.rb
@@ -27,19 +27,17 @@ end
def point_schedule
- [ 0, 15, 12, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 ]
- end
-
- def after_create_competition_results_for(race)
- if race.name["Beginner"]
- race.update_attributes! visible: false
- end
-
- super
+ [ 15, 12, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 ]
end
def after_calculate
super
+
+ race = races.detect { |r| r.name == "Beginner" }
+ if race
+ race.update_attributes! visible: false
+ end
+
BlindDateAtTheDairyMonthlyStandings.calculate!
end
end
| Move Blind Date overall to Calculator
|
diff --git a/cookbooks/PF_CIS_CentOS7_v1.1.0/recipes/3_special_purpose_services_ns.rb b/cookbooks/PF_CIS_CentOS7_v1.1.0/recipes/3_special_purpose_services_ns.rb
index abc1234..def5678 100644
--- a/cookbooks/PF_CIS_CentOS7_v1.1.0/recipes/3_special_purpose_services_ns.rb
+++ b/cookbooks/PF_CIS_CentOS7_v1.1.0/recipes/3_special_purpose_services_ns.rb
@@ -0,0 +1,55 @@+# 3.4 Disable Print Server - CUPS (Not Scored)
+service 'cups' do
+ action [:stop, :disable]
+end
+# 3.7 Remove LDAP (Not Scored)
+package 'openldap-servers' do
+ action :remove
+end
+package 'openldap-clients' do
+ action :remove
+end
+# 3.8 Disable NFS and RPC (Not Scored)
+service 'nfslock' do
+ action [:stop, :disable]
+end
+service 'rpcgssd' do
+ action [:stop, :disable]
+end
+service 'rpcbind' do
+ action [:stop, :disable]
+end
+service 'rpcidmapd' do
+ action [:stop, :disable]
+end
+service 'rpcsvcgssd' do
+ action [:stop, :disable]
+end
+# 3.9 Remove DNS Server (Not Scored)
+package 'bind' do
+ action :remove
+end
+# 3.10 Remove FTP Server (Not Scored)
+package 'vsftpd' do
+ action :remove
+end
+# 3.11 Remove HTTP Server (Not Scored)
+package 'httpd' do
+ action :remove
+end
+# 3.12 Remove Dovecot (IMAP and POP3 services) (Not Scored)
+package 'dovecot' do
+ action :remove
+end
+# 3.13 Remove Samba (Not Scored)
+package 'samba' do
+ action :remove
+end
+# 3.14 Remove HTTP Proxy Server (Not Scored)
+package 'squid' do
+ action :remove
+end
+# 3.15 Remove SNMP Server (Not Scored)
+package 'net-snmp' do
+ action :remove
+end
| Create a special purpose not scored section for CIS CentOS7 v1.1.0.
|
diff --git a/lib/gemstash/cli/info.rb b/lib/gemstash/cli/info.rb
index abc1234..def5678 100644
--- a/lib/gemstash/cli/info.rb
+++ b/lib/gemstash/cli/info.rb
@@ -5,7 +5,7 @@
module Gemstash
class CLI
- # This implements the command line setup task:
+ # This implements the command line info task:
# $ gemstash info
class Info < Gemstash::CLI::Base
include Gemstash::Env::Helper
| Change class Info comment description
|
diff --git a/lib/geokit/inflectors.rb b/lib/geokit/inflectors.rb
index abc1234..def5678 100644
--- a/lib/geokit/inflectors.rb
+++ b/lib/geokit/inflectors.rb
@@ -1,8 +1,8 @@+require "cgi"
+
module Geokit
module Inflector
- require "cgi"
-
- extend self
+ module_function
def titleize(word)
humanize(underscore(word)).gsub(/\b([a-z])/u) { Regexp.last_match(1).capitalize }
| Use module_function instead of extend self
|
diff --git a/test/configuration_test.rb b/test/configuration_test.rb
index abc1234..def5678 100644
--- a/test/configuration_test.rb
+++ b/test/configuration_test.rb
@@ -1,25 +1,29 @@ require "minitest_helper"
-class Thincloud::Authentication::ConfigureTest < ActiveSupport::TestCase
- setup do
- Thincloud::Authentication.configure do |config|
- config.providers[:linkedin] = {
- scopes: "r_emailaddress r_basicprofile",
- fields: ["id", "email-address", "first-name", "last-name", "headline",
- "industry", "picture-url", "location", "public-profile-url"]
+describe Thincloud::Authentication::Configuration do
+
+ describe "provider" do
+ before do
+ Thincloud::Authentication.configure do |config|
+ config.providers[:linkedin] = {
+ scopes: "r_emailaddress r_basicprofile",
+ fields: ["id", "email-address", "first-name", "last-name", "headline",
+ "industry", "picture-url", "location", "public-profile-url"]
+ }
+ end
+
+ @providers_hash = {
+ linkedin: {
+ scopes: "r_emailaddress r_basicprofile",
+ fields: ["id", "email-address", "first-name", "last-name", "headline",
+ "industry", "picture-url", "location", "public-profile-url"]
+ }
}
end
- @providers_hash = {
- linkedin: {
- scopes: "r_emailaddress r_basicprofile",
- fields: ["id", "email-address", "first-name", "last-name", "headline",
- "industry", "picture-url", "location", "public-profile-url"]
- }
- }
+ it "options are assigned" do
+ Thincloud::Authentication.configuration.providers.must_equal @providers_hash
+ end
end
- test "options are assigned" do
- assert_equal @providers_hash, Thincloud::Authentication.configuration.providers
- end
end
| Move provider config test into describe block. |
diff --git a/spec/integration/veritas/self_referential/one_to_one_spec.rb b/spec/integration/veritas/self_referential/one_to_one_spec.rb
index abc1234..def5678 100644
--- a/spec/integration/veritas/self_referential/one_to_one_spec.rb
+++ b/spec/integration/veritas/self_referential/one_to_one_spec.rb
@@ -0,0 +1,28 @@+require 'spec_helper_integration'
+
+describe 'Relationship - Self referential One To One' do
+ include_context 'Models and Mappers'
+
+ before(:all) do
+ setup_db
+
+ insert_person 1, 'John'
+ insert_person 2, 'Jane', 1
+
+ person_mapper.has 1, :child, person_model, :target_key => [:parent_id]
+
+ # FIXME investigate why #one returns zero results when
+ # this is defined *before* the :children relationship
+ person_mapper.belongs_to :parent, person_model
+ end
+
+ let(:jane) { person_model.new(:id => 2, :name => 'Jane', :parent_id => 1) }
+ let(:alice) { person_model.new(:id => 3, :name => 'Alice', :parent_id => 1) }
+
+ it 'loads the associated children' do
+ jane = DM_ENV[person_model].include(:child).one(:id => 1).child
+
+ jane.id.should == 2
+ jane.name.should == 'Jane'
+ end
+end
| Add self referential 1:1 veritas integration specs |
diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/users_controller_spec.rb
+++ b/spec/controllers/users_controller_spec.rb
@@ -8,16 +8,6 @@ # TODO: Shouldn't need a conference to render
before do
FactoryBot.create(:conference)
- end
-
- context 'with views' do
- before do
- controller.view.stubs(:previous_sessions).returns([])
- end
- render_views
- it 'show should work' do
- get :show, id: user.id
- end
end
describe '#index' do
| Remove test. It's not helping
|
diff --git a/test/unit/document_test.rb b/test/unit/document_test.rb
index abc1234..def5678 100644
--- a/test/unit/document_test.rb
+++ b/test/unit/document_test.rb
@@ -3,7 +3,6 @@ class DocumentTest < ActiveSupport::TestCase
assert_should_require(:title)
- assert_should_require_unique(:document_file_name)
test "should create document" do
assert_difference 'Document.count' do
| Document now requires unique file name
|
diff --git a/app/mailers/star_learning_community_registration_mailer.rb b/app/mailers/star_learning_community_registration_mailer.rb
index abc1234..def5678 100644
--- a/app/mailers/star_learning_community_registration_mailer.rb
+++ b/app/mailers/star_learning_community_registration_mailer.rb
@@ -3,7 +3,7 @@ def confirmation(registration)
@registration = registration
@subject = "College STAR Learning Community Request Received"
- @admin_email = "WATSONR16@ECU.EDU"
+ @admin_email = [ "WATSONR16@ECU.EDU", "Williamsj@ecu.edu" ]
mail(
to: @registration.email,
bcc: @admin_email,
| Update Star Learning Communities Registration mailer
Adds Jennifer Williams to the admin list that receives notifications
when someone registers for a STAR Learning Community.
|
diff --git a/lib/axiom/attribute/comparable.rb b/lib/axiom/attribute/comparable.rb
index abc1234..def5678 100644
--- a/lib/axiom/attribute/comparable.rb
+++ b/lib/axiom/attribute/comparable.rb
@@ -3,7 +3,7 @@ module Axiom
class Attribute
- # A mixin for attributes that have comparable values
+ # A mixin for attributes that have comparable objects
module Comparable
include Function::Predicate::GreaterThan::Methods,
Function::Predicate::GreaterThanOrEqualTo::Methods,
| Change module comment to be less specific
|
diff --git a/lib/buildtasks/fpm_cookery/dsl.rb b/lib/buildtasks/fpm_cookery/dsl.rb
index abc1234..def5678 100644
--- a/lib/buildtasks/fpm_cookery/dsl.rb
+++ b/lib/buildtasks/fpm_cookery/dsl.rb
@@ -7,7 +7,7 @@
def initialize(&block)
@recipe = "recipe.rb"
- @fpm_cookery_version = "~> 0.25.0"
+ @fpm_cookery_version = "~> 0.27.0"
@fpm_version = "~> 1.3.3"
instance_eval(&block) if block_given?
| Update fpm-cookery to avoid installing Puppet 4.x
https://github.com/bernd/fpm-cookery/commit/f1a5762e6e93a3933273e3b54c98ac030448f906
|
diff --git a/lib/spaceholder/image.rb b/lib/spaceholder/image.rb
index abc1234..def5678 100644
--- a/lib/spaceholder/image.rb
+++ b/lib/spaceholder/image.rb
@@ -6,14 +6,11 @@ end
def to_blob
- ImageProcessing::Vips.apply(
- resize_to_fill: [@width, @height],
- saver: {
- interlace: true,
- quality: 60,
- strip: true
- }
- ).call(image_paths.sample, save: false).write_to_buffer('.jpg')
+ ImageProcessing::Vips
+ .source(image_paths.sample)
+ .resize_to_fill(@width, @height)
+ .call(save: false)
+ .write_to_buffer('.jpg', output_options)
end
private
@@ -21,5 +18,13 @@ def image_paths
@image_paths ||= Dir.glob(File.join(App.settings.root, 'assets', 'images', 'photos', '*.jpg'))
end
+
+ def output_options
+ @output_options ||= {
+ interlace: true,
+ Q: 60,
+ strip: true
+ }
+ end
end
end
| Update output options to produce progressive JPEGs
|
diff --git a/lib/aruba/api.rb b/lib/aruba/api.rb
index abc1234..def5678 100644
--- a/lib/aruba/api.rb
+++ b/lib/aruba/api.rb
@@ -8,7 +8,7 @@ require 'aruba/api/core'
require 'aruba/api/command'
-if Aruba::VERSION <= '1.0.0'
+if Aruba::VERSION <= '1.1.0'
require 'aruba/api/deprecated'
end
@@ -28,7 +28,9 @@ include Aruba::Api::Environment
include Aruba::Api::Filesystem
include Aruba::Api::Rvm
- include Aruba::Api::Deprecated
+ if Aruba::VERSION <= '1.1.0'
+ include Aruba::Api::Deprecated
+ end
include Aruba::Api::Text
end
end
| Load deprecated methods until version 1.1
|
diff --git a/lib/awsam/ec2.rb b/lib/awsam/ec2.rb
index abc1234..def5678 100644
--- a/lib/awsam/ec2.rb
+++ b/lib/awsam/ec2.rb
@@ -12,12 +12,12 @@
insts = ec2.describe_instances
+ if !insts || insts.length == 0
+ puts "No instances available in account"
+ return nil
+ end
+
if instance_id =~ /^i-[0-9a-f]{7,9}$/
- if !insts || insts.length == 0
- puts "No instances available in account"
- return nil
- end
-
insts.each do |inst|
return inst if inst[:aws_instance_id] == instance_id
end
| Stop processing if no instances are available
|
diff --git a/db/migrate/20160410174144_increase_precomputed_query_doc_size.rb b/db/migrate/20160410174144_increase_precomputed_query_doc_size.rb
index abc1234..def5678 100644
--- a/db/migrate/20160410174144_increase_precomputed_query_doc_size.rb
+++ b/db/migrate/20160410174144_increase_precomputed_query_doc_size.rb
@@ -0,0 +1,6 @@+class IncreasePrecomputedQueryDocSize < ActiveRecord::Migration
+ def change
+ change_column :precomputed_query_docs, :key, :text, :limit => nil
+ change_column :precomputed_query_docs, :json, :text, :limit => nil
+ end
+end
| Add migration to allow longer key and document values for precomputed queries"
|
diff --git a/Casks/kaomoji.rb b/Casks/kaomoji.rb
index abc1234..def5678 100644
--- a/Casks/kaomoji.rb
+++ b/Casks/kaomoji.rb
@@ -2,6 +2,7 @@ version '1.9'
sha256 '04f7e6dc47b469eb90a74d5c569959f2218cc8f3b354edf85117b9f52574b071'
+ # kaomojiformac.github.io was verified as official when first introduced to the cask
url 'https://kaomojiformac.github.io/download/Kaomoji.zip'
appcast 'https://kaomojiformac.github.io/download/kaomojiupdate.xml',
checkpoint: 'c80344948d450636c79b58d95d7397f42cdb337e0130b5b9f85f5038f4505af9'
| Fix `url` stanza comment for Kaomoji.
|
diff --git a/Casks/nodebox.rb b/Casks/nodebox.rb
index abc1234..def5678 100644
--- a/Casks/nodebox.rb
+++ b/Casks/nodebox.rb
@@ -4,7 +4,7 @@
url "https://secure.nodebox.net/downloads/NodeBox-#{version}.zip"
name 'NodeBox'
- homepage 'http://nodebox.net/node/'
+ homepage 'https://www.nodebox.net/node/'
license :unknown # todo: change license and remove this comment; ':unknown' is a machine-generated placeholder
app 'NodeBox.app'
| Fix homepage to use SSL in NodeBox Cask
The HTTP URL is already getting redirected to HTTPS. Using the HTTPS URL directly
makes it more secure and saves a HTTP round-trip.
|
diff --git a/spec/factories/users.rb b/spec/factories/users.rb
index abc1234..def5678 100644
--- a/spec/factories/users.rb
+++ b/spec/factories/users.rb
@@ -5,5 +5,7 @@ password { "testing1" }
password_confirmation { "testing1" }
confirmed_at { Time.now }
+
+ description { Faker::Lorem.sentences(rand(5) + 5).join " " }
end
end
| Update Users Factory for description and icon
Update the Users factory to include the description and icon attributes.
|
diff --git a/Casks/youview.rb b/Casks/youview.rb
index abc1234..def5678 100644
--- a/Casks/youview.rb
+++ b/Casks/youview.rb
@@ -6,7 +6,7 @@ appcast 'http://mrgeckosmedia.com/applications/appcast/YouView'
name 'YouView'
homepage 'https://mrgeckosmedia.com/applications/info/YouView'
- license :unknown # todo: change license and remove this comment; ':unknown' is a machine-generated placeholder
+ license :oss
- app 'YouView/YouView.app'
+ app 'YouView.app'
end
| Update YouView app path and license
|
diff --git a/spec/unit/ratio_spec.rb b/spec/unit/ratio_spec.rb
index abc1234..def5678 100644
--- a/spec/unit/ratio_spec.rb
+++ b/spec/unit/ratio_spec.rb
@@ -1,6 +1,6 @@ # coding: utf-8
-RSpec.describe TTY::ProgressBar, 'ratio=' do
+RSpec.describe TTY::ProgressBar, '.ratio=' do
let(:output) { StringIO.new('', 'w+') }
it "allows to set ratio" do
@@ -25,4 +25,9 @@ expect(progress.current).to eq(3)
expect(progress.complete?).to eq(true)
end
+
+ it "avoids division by zero" do
+ progress = TTY::ProgressBar.new("[:bar]", output: output, total: 0)
+ expect(progress.ratio).to eq(0)
+ end
end
| Add spec for ratio and total division.
|
diff --git a/lib/thinking_sphinx/active_record/collection_proxy_with_scopes.rb b/lib/thinking_sphinx/active_record/collection_proxy_with_scopes.rb
index abc1234..def5678 100644
--- a/lib/thinking_sphinx/active_record/collection_proxy_with_scopes.rb
+++ b/lib/thinking_sphinx/active_record/collection_proxy_with_scopes.rb
@@ -4,23 +4,23 @@ def self.included(base)
base.class_eval do
alias_method_chain :method_missing, :sphinx_scopes
+ alias_method_chain :respond_to?, :sphinx_scopes
end
end
def method_missing_with_sphinx_scopes(method, *args, &block)
- if responds_to_scope(method)
- proxy_association.klass.
- search(:with => default_filter).
- send(method, *args, &block)
+ klass = proxy_association.klass
+ if klass.respond_to?(:sphinx_scopes) && klass.sphinx_scopes.include?(method)
+ klass.search(:with => default_filter).send(method, *args, &block)
else
method_missing_without_sphinx_scopes(method, *args, &block)
end
end
- private
- def responds_to_scope(scope)
+ def respond_to_with_sphinx_scopes?(method)
proxy_association.klass.respond_to?(:sphinx_scopes) &&
- proxy_association.klass.sphinx_scopes.include?(scope)
+ proxy_association.klass.sphinx_scopes.include?(scope) ||
+ respond_to_without_sphinx_scopes?(method)
end
end
end
| Refactor association scope support to eliminate SystemStackError
|
diff --git a/db/migrate/20141110212340_create_districts.rb b/db/migrate/20141110212340_create_districts.rb
index abc1234..def5678 100644
--- a/db/migrate/20141110212340_create_districts.rb
+++ b/db/migrate/20141110212340_create_districts.rb
@@ -1,9 +1,9 @@ class CreateDistricts < ActiveRecord::Migration
def change
create_table :districts do |t|
- t.string :name
+ t.string :jurisdiction_name
+ t.integer :number
t.string :borough
- t.string :superintendent
t.timestamps
end
| Modify district migration fields to be jurisdiction name, number and borough - can add more due to info in API
|
diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/comments_controller.rb
+++ b/app/controllers/comments_controller.rb
@@ -12,7 +12,12 @@ @comment = Comment.new(comment_params)
@comment.commenter = User.find(session[:user_id])
if @comment.save
- redirect_to "/#{@comment.commentable_type.downcase}s/#{@comment.commentable_id}"
+ if @comment.commentable_type== "Film"
+ redirect_to "/#{@comment.commentable_type.downcase}s/#{@comment.commentable_id}"
+ else
+ film_id = Review.find(@comment.commentable_id).reviewable_id
+ redirect_to "/films/#{film_id}/reviews/#{@comment.commentable_id}"
+ end
else
@errors = @comment.errors.full_messages
render 'new'
@@ -24,9 +29,12 @@ type = comment.commentable_type
id = comment.commentable_id
comment.destroy
+ p type
+ p "!!!!!!!!!!!!!!!!!!!!"
if type == "Review"
- film_id = Review.find(id).film_id
- redirect_to "/films/#{film_id}"
+ p "type does indeed equal review"
+ reviewable_id = Review.find(id).reviewable_id
+ redirect_to "/films/#{reviewable_id}"
else
redirect_to "/#{type.downcase}s/#{id}"
end
| Fix route for commenting on reviews
|
diff --git a/app/controllers/statuses_controller.rb b/app/controllers/statuses_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/statuses_controller.rb
+++ b/app/controllers/statuses_controller.rb
@@ -1,4 +1,14 @@ class StatusesController < MyplaceonlineController
+ def footer_items_show
+ [
+ {
+ title: I18n.t("myplaceonline.menu.home"),
+ link: root_path,
+ icon: "home"
+ },
+ ] + super
+ end
+
protected
def insecure
true
| Add home button to status page
|
diff --git a/spec/helpers/groups_helper_spec.rb b/spec/helpers/groups_helper_spec.rb
index abc1234..def5678 100644
--- a/spec/helpers/groups_helper_spec.rb
+++ b/spec/helpers/groups_helper_spec.rb
@@ -0,0 +1,24 @@+# -*- encoding : utf-8 -*-
+require 'spec_helper'
+
+describe GroupsHelper do
+
+ describe "#permission_icon" do
+
+ subject { permission_icon(authorized) }
+
+ context "authorized" do
+
+ let(:authorized) { true }
+
+ it { should == "<i class=\"icon-ok\"></i>" }
+ end
+
+ context "not authorized" do
+
+ let(:authorized) { false }
+
+ it { should == "<i class=\"icon-remove\"></i>" }
+ end
+ end
+end | Add spec for groups helper.
|
diff --git a/spec/lib/passman/condition_spec.rb b/spec/lib/passman/condition_spec.rb
index abc1234..def5678 100644
--- a/spec/lib/passman/condition_spec.rb
+++ b/spec/lib/passman/condition_spec.rb
@@ -7,13 +7,13 @@ describe "And Condition" do
let(:condition) { described_class.and(conditions) }
- context "evaulates to true when all conditions are equal" do
+ context "evaulates to true when all conditions are matching" do
let(:record) { double 'record', a: 'foo', b: 'bar' }
it { should be_true }
end
- context "evaulates to false when all conditions are not equal" do
+ context "evaulates to false when all conditions are not matching" do
let(:record) { double 'record', a: 'foo', b: 'baz' }
it { should be_false }
@@ -23,13 +23,13 @@ describe "Or Condition" do
let(:condition) { described_class.or(conditions) }
- context "evaulates to true when any conditions are equal" do
+ context "evaulates to true when any conditions are matching" do
let(:record) { double 'record', a: 'foo', b: 'baz' }
it { should be_true }
end
- context "evaulates to false when all conditions are not equal" do
+ context "evaulates to false when all conditions are not matching" do
let(:record) { double 'record', a: 'qux', b: 'baz' }
it { should be_false }
| Fix wording in conditon spec
|
diff --git a/les_09/modules/accessors.rb b/les_09/modules/accessors.rb
index abc1234..def5678 100644
--- a/les_09/modules/accessors.rb
+++ b/les_09/modules/accessors.rb
@@ -21,5 +21,16 @@ define_method("#{arg}_history") { @var_history[var_name] }
end
end
+
+ def strong_attr_acessor(name, name_class)
+ var_name = "@#{name}".to_sym
+
+ define_method(name) { instance_variable_get(var_name) }
+
+ define_method("#{name}=".to_sym) do |value|
+ raise 'Несоответствие типов.' unless self.class == name_class
+ instance_variable_set(var_name, value)
+ end
+ end
end
end
| Add to Accessors strong_attr_accessor method
|
diff --git a/core/db/migrate/20130919122432_delete_basefact_remnants.rb b/core/db/migrate/20130919122432_delete_basefact_remnants.rb
index abc1234..def5678 100644
--- a/core/db/migrate/20130919122432_delete_basefact_remnants.rb
+++ b/core/db/migrate/20130919122432_delete_basefact_remnants.rb
@@ -0,0 +1,12 @@+class DeleteBasefactRemnants < Mongoid::Migration
+ def self.up
+ db = Redis.current
+ basefact_keys = db.keys("Basefact:*")
+ deleted_key_count = db.del(*basefact_keys)
+ puts "Deleted #{deleted_key_count} keys."
+ end
+
+ def self.down
+ #do nothing:can't recreated deleted stuff.
+ end
+end
| Delete all redis keys starting with "Basefact:"
|
diff --git a/spec/internal/db/migrate/1273253849_add_twitter_handle_to_users.rb b/spec/internal/db/migrate/1273253849_add_twitter_handle_to_users.rb
index abc1234..def5678 100644
--- a/spec/internal/db/migrate/1273253849_add_twitter_handle_to_users.rb
+++ b/spec/internal/db/migrate/1273253849_add_twitter_handle_to_users.rb
@@ -2,7 +2,7 @@
change do
alter_table :users do
- add_column :twitter_handle, String, text: true
+ add_column :twitter_handle, String, :text => true
end
end
| Fix spec on JRUBY 1.8 mode
|
diff --git a/db/migrate/201603100909_create_conversation_subscriptions.rb b/db/migrate/201603100909_create_conversation_subscriptions.rb
index abc1234..def5678 100644
--- a/db/migrate/201603100909_create_conversation_subscriptions.rb
+++ b/db/migrate/201603100909_create_conversation_subscriptions.rb
@@ -0,0 +1,13 @@+class CreateConversationSubscriptions < ActiveRecord::Migration
+ def change
+ create_table :conversation_subscriptions do |t|
+ t.integer :user_id, null: false
+ t.integer :solution_id, null: false
+ t.boolean :subscribed, default: true
+ t.timestamps null: false
+ end
+ add_index :conversation_subscriptions, :solution_id
+ add_index :conversation_subscriptions, :user_id
+ add_index :conversation_subscriptions, [:user_id, :solution_id], unique: true, name: "index_conversation_subscriptions_on_user_solution"
+ end
+end
| Create db migration for conversation subscriptions
See #2771
|
diff --git a/lib/tasks/bad_link_reporting.rake b/lib/tasks/bad_link_reporting.rake
index abc1234..def5678 100644
--- a/lib/tasks/bad_link_reporting.rake
+++ b/lib/tasks/bad_link_reporting.rake
@@ -14,10 +14,13 @@
# Generate the reports
Whitehall::BadLinkReporter.new(mirror_directory, reports_dir, logger).generate_reports
+ logger.info('Reports generated. Zipping...')
# zip up reports
system "zip #{report_zip_path} #{reports_dir}/*_bad_links.csv --junk-paths"
+ logger.info("Reports zipped. Emailing to #{email_address}")
# email the zipped reports
Notifications.bad_link_reports(report_zip_path, email_address).deliver
+ logger.info("Email sent.")
end
| Increase logging around bad link reporting
|
diff --git a/lib/api-pagination/hooks.rb b/lib/api-pagination/hooks.rb
index abc1234..def5678 100644
--- a/lib/api-pagination/hooks.rb
+++ b/lib/api-pagination/hooks.rb
@@ -20,7 +20,7 @@ end
begin; require 'will_paginate'; rescue LoadError; end
- if defined?(WillPaginate::CollectionMethod)
+ if defined?(WillPaginate::CollectionMethods)
WillPaginate::CollectionMethods.module_eval do
def first_page?() !previous_page end
def last_page?() !next_page end
| Fix typo in will_paginate support
|
diff --git a/nidobata.gemspec b/nidobata.gemspec
index abc1234..def5678 100644
--- a/nidobata.gemspec
+++ b/nidobata.gemspec
@@ -22,7 +22,7 @@
spec.add_dependency 'thor'
spec.add_dependency 'netrc'
- spec.add_dependency 'graphql-client'
+ spec.add_dependency 'graphql-client', '>= 0.11.3'
spec.add_development_dependency "bundler", "~> 1.13"
spec.add_development_dependency "rake", "~> 10.0"
| Make sure that graphql-client is 0.11.3 or later
Fixes #7
|
diff --git a/lib/bundle/brew_services.rb b/lib/bundle/brew_services.rb
index abc1234..def5678 100644
--- a/lib/bundle/brew_services.rb
+++ b/lib/bundle/brew_services.rb
@@ -12,7 +12,8 @@ end
def self.stop(name)
- return true unless started?(name)
+ started = `brew services list`.lines.grep(/^#{Regexp.escape(name)} +started/).any?
+ return true unless started
Bundle.system "brew", "services", "stop", name
end
| Revert change to stop method
|
diff --git a/example/config/application.rb b/example/config/application.rb
index abc1234..def5678 100644
--- a/example/config/application.rb
+++ b/example/config/application.rb
@@ -10,6 +10,11 @@ # Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
+
+ config.generators do |g|
+ g.test_framework :rspec
+ g.factory_girl dir: 'spec/factories'
+ end
end
end
| Add generators configurations to example app
|
diff --git a/lib/generators/fancybox_rails_generator.rb b/lib/generators/fancybox_rails_generator.rb
index abc1234..def5678 100644
--- a/lib/generators/fancybox_rails_generator.rb
+++ b/lib/generators/fancybox_rails_generator.rb
@@ -0,0 +1,13 @@+class FancyboxRailsGenerator < Rails::Generators::Base
+ source_root File.expand_path("../../../vendor/assets", __FILE__)
+
+ desc "Copy FancyBox into lib/ for customization"
+ def copy_assets
+ dir = Pathname.new(self.class.source_root)
+ Dir[self.class.source_root + '/**/*'].each do |entry|
+ next if File.directory?(entry)
+ file = Pathname.new(entry).relative_path_from(dir)
+ copy_file file, "lib/assets/#{file}"
+ end
+ end
+end
| Add generator for copying assets for customization
|
diff --git a/lib/hyperflow-amqp-executor/nfs_storage.rb b/lib/hyperflow-amqp-executor/nfs_storage.rb
index abc1234..def5678 100644
--- a/lib/hyperflow-amqp-executor/nfs_storage.rb
+++ b/lib/hyperflow-amqp-executor/nfs_storage.rb
@@ -5,14 +5,14 @@ def stage_in
@job.inputs.each do |file|
Executor::logger.debug "[#{@id}] Copying #{file.name} to tmpdir"
- FileUtils.copy(@job.options.prefix + file.name, @workdir + "/" + file.name)
+ FileUtils.copy(@job.options.workdir + file.name, @workdir + "/" + file.name)
end
end
def stage_out
@job.outputs.each do |file|
Executor::logger.debug "[#{@id}] Copying #{file.name} from tmpdir"
- FileUtils.copy(@workdir + "/" + file.name, @job.options.prefix + file.name)
+ FileUtils.copy(@workdir + "/" + file.name, @job.options.workdir + file.name)
end
end
| Make workdir option name the same as with local storage
|
diff --git a/lib/learn_web/client/validate_repo/slug.rb b/lib/learn_web/client/validate_repo/slug.rb
index abc1234..def5678 100644
--- a/lib/learn_web/client/validate_repo/slug.rb
+++ b/lib/learn_web/client/validate_repo/slug.rb
@@ -2,7 +2,7 @@ class Client
module ValidateRepo
class Slug
- attr_accessor :data, :repo_slug, :lab, :lesson_id, :later_lesson
+ attr_accessor :data, :repo_slug, :lab, :lesson_id, :later_lesson, :repo_name
attr_reader :response
include AttributePopulatable
| Add repo name to Slug
|
diff --git a/lib/opsicle/credential_converter_helper.rb b/lib/opsicle/credential_converter_helper.rb
index abc1234..def5678 100644
--- a/lib/opsicle/credential_converter_helper.rb
+++ b/lib/opsicle/credential_converter_helper.rb
@@ -3,8 +3,11 @@ module Opsicle
module CredentialConverterHelper
def convert_fog_to_aws
+ directory_path = File.expand_path("~/.aws/")
+ cred_path = File.expand_path("~/.aws/credentials")
+
# open/make new credentials file, read, and gather the groups of aws credentials already in file
- cred_path = File.expand_path("~/.aws/credentials")
+ Dir.mkdir(directory_path) unless File.directory?(directory_path)
cred_file = File.open(cred_path, "a+")
cred_text = cred_file.read
cred_groups = cred_text.scan(/\[([\S]*)\]/).flatten
| Make the directory if it don't exist
|
diff --git a/lib/config/custom-routes.rb b/lib/config/custom-routes.rb
index abc1234..def5678 100644
--- a/lib/config/custom-routes.rb
+++ b/lib/config/custom-routes.rb
@@ -3,9 +3,15 @@
Rails.application.routes.draw do
# Additional help pages
- match '/help/help_out' => 'help#help_out', :as => 'help_help_out'
- match '/help/right_to_know' => 'help#right_to_know', :as => 'help_right_to_know'
+ match '/help/help_out' => 'help#help_out',
+ :as => 'help_help_out',
+ :via => :get
+ match '/help/right_to_know' => 'help#right_to_know',
+ :as => 'help_right_to_know',
+ :via => :get
# redirect the blog page to blog.asktheeu.org
- match '/blog/' => redirect('http://blog.asktheeu.org/')
+ match '/blog/' => redirect('http://blog.asktheeu.org/'),
+ :as => :external_blog,
+ :via => :get
end
| Fix broken routes so application can now boot
|
diff --git a/lib/constellation/runner.rb b/lib/constellation/runner.rb
index abc1234..def5678 100644
--- a/lib/constellation/runner.rb
+++ b/lib/constellation/runner.rb
@@ -21,12 +21,12 @@ def start
raise ConstellationFileNotFoundError unless File.exists?("ConstellationFile")
-# begin
+ begin
@config.instance_eval(File.read("ConstellationFile"))
@config.freeze!
-# rescue Exception => e
-# raise InvalidConstellationFileError
-# end
+ rescue Exception => e
+ raise InvalidConstellationFileError
+ end
end
map %w(-s) => :start
| Raise InvalidConstellationFileError if the setup is wrong
|
diff --git a/app/helpers/block_helper.rb b/app/helpers/block_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/block_helper.rb
+++ b/app/helpers/block_helper.rb
@@ -9,7 +9,8 @@ block_layout = BlockLayout.find_by_slug(block_layout)
end
- collection = record.blocks(block_layout: block_layout).select(&:display?)
+ collection = options.delete(:collection) || record.blocks(block_layout: block_layout)
+ collection.select!(&:display?)
if collection.present?
content_tag :div, class: "blocks block-layout--#{block_layout.slug}" do
| Add ability to pass custom collection of block to render_blocks method
|
diff --git a/app/jobs/application_job.rb b/app/jobs/application_job.rb
index abc1234..def5678 100644
--- a/app/jobs/application_job.rb
+++ b/app/jobs/application_job.rb
@@ -1,2 +1,7 @@ class ApplicationJob < ActiveJob::Base
+ # Automatically retry jobs that encountered a deadlock
+ # retry_on ActiveRecord::Deadlocked
+
+ # Most jobs are safe to ignore if the underlying records are no longer available
+ # discard_on ActiveJob::DeserializationError
end
| Add comments to match dummy Rails 6 app
|
diff --git a/lib/time_warp.rb b/lib/time_warp.rb
index abc1234..def5678 100644
--- a/lib/time_warp.rb
+++ b/lib/time_warp.rb
@@ -1,4 +1,4 @@-require 'core_ext'
+require File.join File.dirname(__FILE__), 'core_ext'
module Test # :nodoc:
module Unit # :nodoc:
| Make sure time-warp also works in Rails projects with a lib/core_ext.rb file
|
diff --git a/lib/cryptoexchange/exchanges/coinmate/services/order_book.rb b/lib/cryptoexchange/exchanges/coinmate/services/order_book.rb
index abc1234..def5678 100644
--- a/lib/cryptoexchange/exchanges/coinmate/services/order_book.rb
+++ b/lib/cryptoexchange/exchanges/coinmate/services/order_book.rb
@@ -1,5 +1,3 @@-require 'pry'
-
module Cryptoexchange::Exchanges
module Coinmate
module Services
| Remove pry from coinmate orderbook
|
diff --git a/pg_ltree.gemspec b/pg_ltree.gemspec
index abc1234..def5678 100644
--- a/pg_ltree.gemspec
+++ b/pg_ltree.gemspec
@@ -21,7 +21,7 @@ s.add_dependency 'activerecord', '>= 4.0.0', '< 5.1'
s.add_dependency 'pg', '>= 0.17.0', '< 0.19'
- s.add_development_dependency 'bundler', '~> 1.11.2'
+ s.add_development_dependency 'bundler', '~> 1.7.6'
s.add_development_dependency 'rake'
s.add_development_dependency 'pry'
s.add_development_dependency 'yard'
| Downgrade bundler version for travis
|
diff --git a/lib/guard/spinoff/runner.rb b/lib/guard/spinoff/runner.rb
index abc1234..def5678 100644
--- a/lib/guard/spinoff/runner.rb
+++ b/lib/guard/spinoff/runner.rb
@@ -31,9 +31,9 @@
def run_all
if rspec?
- run('spec')
+ run(options[:test_paths] || 'spec')
elsif test_unit?
- run('test')
+ run(options[:test_paths] || 'test')
end
end
| Add :test_paths option to set the default path to the tests.
|
diff --git a/lib/gyro/liquidgen/infos.rb b/lib/gyro/liquidgen/infos.rb
index abc1234..def5678 100644
--- a/lib/gyro/liquidgen/infos.rb
+++ b/lib/gyro/liquidgen/infos.rb
@@ -11,7 +11,7 @@
def self.showInfos(template)
if template.include?('/')
- readme = template + 'README.md' unless readme.exist?
+ readme = Pathname.new(template) + 'README.md'
else
readme = Gyro.templates_dir + template + 'README.md'
end
| Fix issue in "-i" with path
|
diff --git a/features/support/expect.rb b/features/support/expect.rb
index abc1234..def5678 100644
--- a/features/support/expect.rb
+++ b/features/support/expect.rb
@@ -13,7 +13,7 @@ raise(ArgumentError, "Hostname is missing!") if host.nil? || host.empty?
Tempfile.open('push-registration.expect') do |f|
@file = f
- f.write("spawn spacewalk-push-register " + host + " " + bootstrap + "\n")
+ f.write("spawn spacewalk-ssh-push-init --client " + host + " --register " + bootstrap + " --tunnel" + "\n")
f.write("while {1} {\n")
f.write(" expect {\n")
f.write(" eof {break}\n")
| Call the new script for ssh push registration via tunnel
|
diff --git a/RQVisual.podspec b/RQVisual.podspec
index abc1234..def5678 100644
--- a/RQVisual.podspec
+++ b/RQVisual.podspec
@@ -8,9 +8,9 @@ style formats similar to those used by NSLayoutConstraint.
DESC
- s.homepage = "https://github.com/rqueue/Visual"
+ s.homepage = "https://github.com/rqueue/RQVisual"
s.license = "MIT"
s.author = { "Ryan Quan" => "ryanhquan@gmail.com" }
- s.source = { :git => "git@github.com:rqueue/Visual.git", :tag => "0.0.1" }
+ s.source = { :git => "git@github.com:rqueue/RQVisual.git", :tag => "0.0.1" }
s.source_files = "RQVisual", "RQVisual/**/*.{h,m}"
end
| Update Podpsec with new repo name
|
diff --git a/lib/identity/log_helpers.rb b/lib/identity/log_helpers.rb
index abc1234..def5678 100644
--- a/lib/identity/log_helpers.rb
+++ b/lib/identity/log_helpers.rb
@@ -2,7 +2,10 @@ module LogHelpers
def log(action, data={}, &block)
data.merge! app: "identity", request_id: request_ids
+
+ # A UUID in a shared cookie allows correlating OAuth logs with other Heroku properties
data.merge! oauth_dance_id: @oauth_dance_id if @oauth_dance_id
+
Slides.log(action, data, &block)
end
| Add comment to document `oauth_dance_id`
|
diff --git a/spec/aliases/string_spec.rb b/spec/aliases/string_spec.rb
index abc1234..def5678 100644
--- a/spec/aliases/string_spec.rb
+++ b/spec/aliases/string_spec.rb
@@ -24,7 +24,7 @@ ].each do |value|
describe value.inspect do
let(:params) {{ value: value }}
- it { is_expected.to compile.and_raise_error(/parameter 'value' expects a String/) }
+ it { is_expected.to compile.and_raise_error(/parameter 'value' expects a (?:value of type Undef or )?String/) }
end
end
end
| Update alias spec error message expectation for PUP-7371
The fix for PUP-7371 adds the missing `Undef` into the error message
being tested in type aliases specs, fixing the following failure against
Puppet's master branch:
test::string rejects other values [] should fail to compile and raise an error matching /parameter 'value' expects a String/
Failure/Error: it { is_expected.to compile.and_raise_error(/parameter 'value' expects a String/) }
error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Class[Test::String]: parameter 'value' expects a value of type Undef or String, got Array at line 2:1 on node example
# ./spec/aliases/string_spec.rb:27:in `block (5 levels) in <top (required)>'
|
diff --git a/spec/factories/key_infos.rb b/spec/factories/key_infos.rb
index abc1234..def5678 100644
--- a/spec/factories/key_infos.rb
+++ b/spec/factories/key_infos.rb
@@ -18,16 +18,23 @@ end
def generate_certificate(subject, issuer)
- key = OpenSSL::PKey::RSA.new 1024
-
cert = OpenSSL::X509::Certificate.new
cert.subject = OpenSSL::X509::Name.parse subject
cert.issuer = OpenSSL::X509::Name.parse issuer
- cert.not_before = Time.now
- cert.not_after = Time.now + 3600
- cert.public_key = key.public_key
- cert.serial = 0x0
- cert.version = 2
+ cert.public_key = generate_key.public_key
+
+ specify_certificate_defaults cert
cert.to_pem
end
+
+def specify_certificate_defaults(cert)
+ cert.not_before = Time.now
+ cert.not_after = Time.now + 3600
+ cert.serial = 0x0
+ cert.version = 2
+end
+
+def generate_key
+ OpenSSL::PKey::RSA.new 1024
+end
| Update to conform to ABC metric cop
|
diff --git a/spec/helpers/connections.rb b/spec/helpers/connections.rb
index abc1234..def5678 100644
--- a/spec/helpers/connections.rb
+++ b/spec/helpers/connections.rb
@@ -17,7 +17,13 @@ end
end
-
+ def compute_connection
+ Fog::Compute.new( :provider => 'AWS',
+ :aws_access_key_id => EC2_COMPUTE_ACCOUNT_USERNAME,
+ :aws_secret_access_key => EC2_COMPUTE_ACCOUNT_PASSWORD,
+ :endpoint => EC2_COMPUTE_AUTH_URL )
+ end
+
end
@@ -25,16 +31,23 @@ module HP::Cloud
class CLI < Thor
- private
-
- # override #connection not to look at account files, just use hardcoded
- # test credentials.
- def connection
- Fog::Storage.new( :provider => 'HP',
- :hp_account_id => OS_STORAGE_ACCOUNT_USERNAME,
- :hp_secret_key => OS_STORAGE_ACCOUNT_PASSWORD,
- :hp_auth_uri => OS_STORAGE_AUTH_URL )
- end
+ private
+
+ # override #connection not to look at account files, just use hardcoded
+ # test credentials.
+ def connection(service = :storage)
+ if service == :storage
+ Fog::Storage.new( :provider => 'HP',
+ :hp_account_id => OS_STORAGE_ACCOUNT_USERNAME,
+ :hp_secret_key => OS_STORAGE_ACCOUNT_PASSWORD,
+ :hp_auth_uri => OS_STORAGE_AUTH_URL )
+ else
+ Fog::Compute.new( :provider => 'AWS',
+ :aws_access_key_id => EC2_COMPUTE_ACCOUNT_USERNAME,
+ :aws_secret_access_key => EC2_COMPUTE_ACCOUNT_PASSWORD,
+ :endpoint => EC2_COMPUTE_AUTH_URL )
+ end
+ end
end
end | Add connection for compute service.
|
diff --git a/spec/mailers/test_mailer.rb b/spec/mailers/test_mailer.rb
index abc1234..def5678 100644
--- a/spec/mailers/test_mailer.rb
+++ b/spec/mailers/test_mailer.rb
@@ -1,8 +1,4 @@ class TestMailer < ActionMailer::Base
- # template root must be set for multipart emails, or ActionMailer will throw an exception.
- if ActionMailer::VERSION::MAJOR == 2
- self.template_root = File.dirname(__FILE__)
- end
def plain_text_message(options)
setup = setup_recipients(options)
| Remove code related to actionmailer version not supported anymore
|
diff --git a/db/migrate/20160901122444_create_incoming_email_projects_for_companies.rb b/db/migrate/20160901122444_create_incoming_email_projects_for_companies.rb
index abc1234..def5678 100644
--- a/db/migrate/20160901122444_create_incoming_email_projects_for_companies.rb
+++ b/db/migrate/20160901122444_create_incoming_email_projects_for_companies.rb
@@ -0,0 +1,11 @@+class CreateIncomingEmailProjectsForCompanies < ActiveRecord::Migration
+
+ def change
+ Company.find_each do |company|
+ unless company.preference('incoming_email_project').present?
+ project = company.projects.create!(name: 'Incoming Project', customer_id: company.customers.first.id) if company.customers.any?
+ company.preferences.create!(key: 'incoming_email_project', value: project.id) if project.present?
+ end
+ end
+ end
+end
| Create incoming projects for companies.
|
diff --git a/lib/nori/parser/nokogiri.rb b/lib/nori/parser/nokogiri.rb
index abc1234..def5678 100644
--- a/lib/nori/parser/nokogiri.rb
+++ b/lib/nori/parser/nokogiri.rb
@@ -19,15 +19,27 @@ stack.push Nori::XMLUtilityNode.new(options, name, Hash[*attrs.flatten])
end
+ # To keep backward behaviour compatibility
+ # delete last child if it is a space-only text node
def end_element(name)
if stack.size > 1
last = stack.pop
+ maybe_string = last.children.last
+ if maybe_string.is_a?(String) and maybe_string.strip.empty?
+ last.children.pop
+ end
stack.last.add_node last
end
end
+ # If this node is a successive character then add it as is.
+ # First child being a space-only text node will not be added
+ # because there is no previous characters.
def characters(string)
- stack.last.add_node(string) unless string.strip.length == 0 || stack.empty?
+ last = stack.last
+ if last and last.children.last.is_a?(String) or string.strip.size > 0
+ last.add_node(string)
+ end
end
alias cdata_block characters
| Fix Nokogiri parser processing xml entity encoded characters
|
diff --git a/lib/rp_capistrano/resque.rb b/lib/rp_capistrano/resque.rb
index abc1234..def5678 100644
--- a/lib/rp_capistrano/resque.rb
+++ b/lib/rp_capistrano/resque.rb
@@ -3,7 +3,7 @@ def self.load_into(configuration)
configuration.load do
after 'deploy:restart', 'rp:resque:load_god_config'
- after 'rp:resque:load_god_config', 'rp:resque:kill_processes'
+ after 'rp:resque:load_god_config', 'rp:resque:restart_god_workers'
namespace :rp do
namespace :resque do
@@ -11,6 +11,14 @@ task :load_god_config, :roles => :god, :on_no_matching_servers => :continue do
puts " ** LOADING RESQUE GOD CONFIG ====================================="
run "sudo /usr/local/rvm/bin/boot_god load #{release_path}/config/god/resque.god"
+ end
+
+ desc "Restart god workers"
+ task :restart_god_workers, :roles => :god, :on_no_matching_servers => :continue do
+ puts " ** LOADING RESQUE GOD CONFIG ====================================="
+ run "sudo /usr/local/rvm/bin/boot_god restart #{app_name}-resque" do |ch, stream, data|
+ puts data
+ end
end
desc "Kill resque workers and reload god config"
| Add a task to gracefully restart workers using god
|
diff --git a/lib/sass/script/variable.rb b/lib/sass/script/variable.rb
index abc1234..def5678 100644
--- a/lib/sass/script/variable.rb
+++ b/lib/sass/script/variable.rb
@@ -1,16 +1,27 @@ module Sass
module Script
- class Variable # :nodoc:
+ # A SassScript node representing a variable.
+ class Variable
+ # The name of the variable.
+ #
+ # @return [String]
attr_reader :name
+ # @param name [String] See \{#name}
def initialize(name)
@name = name
end
+ # @return [String] A string representation of the variable
def inspect
"!#{name}"
end
+ # Evaluates the variable.
+ #
+ # @param environment [Sass::Environment] The environment in which to evaluate the SassScript
+ # @return [Literal] The SassScript object that is the value of the variable
+ # @raise [Sass::SyntaxError] if the variable is undefined
def perform(environment)
(val = environment.var(name)) && (return val)
raise SyntaxError.new("Undefined variable: \"!#{name}\".")
| [Sass] Convert Sass::Script::Variable docs to YARD.
|
diff --git a/lib/selenium/client/base.rb b/lib/selenium/client/base.rb
index abc1234..def5678 100644
--- a/lib/selenium/client/base.rb
+++ b/lib/selenium/client/base.rb
@@ -29,10 +29,15 @@ @browserStartCommand = browserStartCommand
@browserURL = browserURL
@timeout = timeout
+ @extension_js = ""
+ end
+
+ def set_extension_js(extension_js)
+ @extension_js = extension_js
end
def start()
- result = get_string("getNewBrowserSession", [@browserStartCommand, @browserURL])
+ result = get_string("getNewBrowserSession", [@browserStartCommand, @browserURL, @extension_js])
@session_id = result
end
| Add support in perl, python, ruby drivers for per-session extension Javascript.
git-svn-id: 02f00ad323e9b09c2b4a77fafb42ebb04c4508ab@2295 0891141a-5dea-0310-ad27-ebc607f31677
|
diff --git a/gir_ffi-gnome_keyring.gemspec b/gir_ffi-gnome_keyring.gemspec
index abc1234..def5678 100644
--- a/gir_ffi-gnome_keyring.gemspec
+++ b/gir_ffi-gnome_keyring.gemspec
@@ -24,7 +24,7 @@ s.extra_rdoc_files = ['README.md', 'Changelog.md']
s.test_files = `git ls-files -z -- test`.split("\0")
- s.add_runtime_dependency('gir_ffi', ['~> 0.14.0'])
+ s.add_runtime_dependency('gir_ffi', ['~> 0.15.1'])
s.add_development_dependency('minitest', ['~> 5.0'])
s.add_development_dependency('rake', ['~> 13.0'])
| Update gir_ffi to version 0.15.1 |
diff --git a/lib/rbbt/util/pkg_config.rb b/lib/rbbt/util/pkg_config.rb
index abc1234..def5678 100644
--- a/lib/rbbt/util/pkg_config.rb
+++ b/lib/rbbt/util/pkg_config.rb
@@ -13,7 +13,7 @@ end
def load_cfg(pkg_variables)
- pkg_cfg_files = [File.join(ENV["HOME"], '.' + self.to_s)]
+ pkg_cfg_files = [ ENV['RBBT_CONFIG'] || "", File.join(ENV["HOME"], '.' + self.to_s), File.join('/etc/', '.' + self.to_s)]
pkg_variables.each do |variable|
self.class_eval %{
| Add more paths to config file
|
diff --git a/lib/tasks/udongo_tasks.rake b/lib/tasks/udongo_tasks.rake
index abc1234..def5678 100644
--- a/lib/tasks/udongo_tasks.rake
+++ b/lib/tasks/udongo_tasks.rake
@@ -12,4 +12,16 @@ end
end
end
+
+ namespace :content_images do
+ desc 'Regenerate all the image versions.'
+ task regenerate: :environment do
+ ::ContentImage.find_each do |i|
+ if i.file?
+ i.file.recreate_versions!
+ i.save!
+ end
+ end
+ end
+ end
end
| Add rake task to regenerate all the content image versions.
|
diff --git a/lib/test_wrangler/helper.rb b/lib/test_wrangler/helper.rb
index abc1234..def5678 100644
--- a/lib/test_wrangler/helper.rb
+++ b/lib/test_wrangler/helper.rb
@@ -15,7 +15,7 @@
def complete_experiment
selection = test_wrangler_selection
- cookies['test_wrangler'] = {value: nil, expires: Time.now}
+ cookies['test_wrangler'] = {value: nil, expires: Time.now - 24.hours}
selection
end
| Set cookie expiry to 1 day in the past to ensure deletion
|
diff --git a/omf_ec/example/test_exp/test07.rb b/omf_ec/example/test_exp/test07.rb
index abc1234..def5678 100644
--- a/omf_ec/example/test_exp/test07.rb
+++ b/omf_ec/example/test_exp/test07.rb
@@ -0,0 +1,45 @@+#
+# Test 7
+#
+# Testing one node in one group running two instance of the same app, previously defined with defApplication
+#
+
+defProperty('res1', "unconfigured-node-1", "ID of a node")
+
+defApplication('ping','ping') do |app|
+ app.description = 'Simple App Def for Ping'
+ app.binary_path = '/bin/ping'
+
+ # OMF 5.4 SYNTAX
+ #
+ app.defProperty('target', "my target", nil, {:type => :string, :default => 'localhost'})
+ app.defProperty('count', "my count", "-c", {:type => :integer, :default => 2, :order => 1})
+
+ # OMF 6 SYNTAX
+ #
+ # app.define_parameter(
+ # :target => {:type => 'String', :default => 'localhost'},
+ # :count => {:type => 'Numeric', :cmd => '-c', :default => 2, :order => 1}
+ # )
+end
+
+defGroup('Actor', property.res1) do |g|
+ g.addApplication("ping") do |app|
+ app.setProperty('target', 'www.google.com')
+ app.setProperty('count', 1)
+ #app.measure('udp_out', :interval => 3)
+ end
+ g.addApplication("ping") do |app|
+ app.setProperty('target', 'www.nicta.com.au')
+ app.setProperty('count', 2)
+ #app.measure('udp_out', :interval => 3)
+ end
+end
+
+onEvent(:ALL_UP_AND_INSTALLED) do |event|
+ info "TEST - group"
+ group("Actor").startApplications
+ after 20.seconds do
+ Experiment.done
+ end
+end
| Add test example experiment for defApplication and addApplication
|
diff --git a/handy_feature_helpers.gemspec b/handy_feature_helpers.gemspec
index abc1234..def5678 100644
--- a/handy_feature_helpers.gemspec
+++ b/handy_feature_helpers.gemspec
@@ -8,9 +8,9 @@ spec.version = HandyFeatureHelpers::VERSION
spec.authors = ["Vassil Kalkov"]
spec.email = ["vassilkalkov@gmail.com"]
- spec.description = %q{Feature helpers for use with Capybara}
+ spec.description = %q{Feature helpers for use with Capybara and Rspec}
spec.summary = %q{Feature spec helpers}
- spec.homepage = ""
+ spec.homepage = "http://github.com/kalkov/handy_feature_helpers"
spec.license = "MIT"
spec.files = `git ls-files`.split($/)
@@ -18,7 +18,7 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]
- spec.add_dependency 'capybara'
+ spec.add_dependency 'capybara', '~> 2.0.0'
spec.add_dependency 'rspec'
spec.add_development_dependency "bundler", "~> 1.3"
| [gemspec] Add homepage and requirement for capybara
|
diff --git a/core/db/migrate/20150609093816_increase_scale_on_pre_tax_amounts.rb b/core/db/migrate/20150609093816_increase_scale_on_pre_tax_amounts.rb
index abc1234..def5678 100644
--- a/core/db/migrate/20150609093816_increase_scale_on_pre_tax_amounts.rb
+++ b/core/db/migrate/20150609093816_increase_scale_on_pre_tax_amounts.rb
@@ -1,5 +1,15 @@ class IncreaseScaleOnPreTaxAmounts < ActiveRecord::Migration
def change
+ # set pre_tax_amount on shipments to discounted_amount - included_tax_total
+ # so that the null: false option on the shipment pre_tax_amount doesn't generate
+ # errors.
+ #
+ execute(<<-SQL)
+ UPDATE spree_shipments
+ SET pre_tax_amount = (cost + promo_total) - included_tax_total
+ WHERE pre_tax_amount IS NULL;
+ SQL
+
change_column :spree_line_items, :pre_tax_amount, :decimal, precision: 12, scale: 4, default: 0.0, null: false
change_column :spree_shipments, :pre_tax_amount, :decimal, precision: 12, scale: 4, default: 0.0, null: false
end
| Set pre_tax_amount for shipments so that migration works
On existing installations, the migrations `IncreaseScaleOnPreTaxAmounts`
will fail because of existing shipments not having a `pre_tax_amount` set.
Fixes #6525
Fixes #6527
|
diff --git a/lib/brewery_db/collection.rb b/lib/brewery_db/collection.rb
index abc1234..def5678 100644
--- a/lib/brewery_db/collection.rb
+++ b/lib/brewery_db/collection.rb
@@ -3,13 +3,25 @@ include Enumerable
BATCH_SIZE = 50
- attr_reader :count, :page_count
+
+ attr_reader :size, :page_count
+ alias length size
def initialize(collection, response)
- @collection = collection
+ @collection = collection || []
@response = response
- @count = response.count
+ @size = response.count || 0
@page_count = response.page_count
+ end
+
+ def count(*args, &block)
+ # The Ruby documentation is wrong, and Enumerable#count no longer calls
+ # #size, so let's make sure it's used here when no arguments are given.
+ if args.empty? && !block_given?
+ size
+ else
+ super
+ end
end
def each
| Return the count without fetching all pages.
Properly adhere the Enumerable#count interface.
Provide Collection#length alias for #size.
|
diff --git a/db/migrate/20190626175626_add_group_creation_level_to_namespaces.rb b/db/migrate/20190626175626_add_group_creation_level_to_namespaces.rb
index abc1234..def5678 100644
--- a/db/migrate/20190626175626_add_group_creation_level_to_namespaces.rb
+++ b/db/migrate/20190626175626_add_group_creation_level_to_namespaces.rb
@@ -0,0 +1,20 @@+# frozen_string_literal: true
+
+class AddGroupCreationLevelToNamespaces < ActiveRecord::Migration[5.1]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+ disable_ddl_transaction!
+
+ def up
+ unless column_exists?(:namespaces, :subgroup_creation_level)
+ add_column_with_default(:namespaces, :subgroup_creation_level, :integer, default: 0)
+ end
+ end
+
+ def down
+ if column_exists?(:namespaces, :subgroup_creation_level)
+ remove_column(:namespaces, :subgroup_creation_level)
+ end
+ end
+end
| Add a subgroup_creation_level column to the namespaces table
|
diff --git a/lib/catarse_stripe/engine.rb b/lib/catarse_stripe/engine.rb
index abc1234..def5678 100644
--- a/lib/catarse_stripe/engine.rb
+++ b/lib/catarse_stripe/engine.rb
@@ -6,16 +6,14 @@ module ActionDispatch::Routing
class Mapper
def mount_catarse_stripe_at(catarse_stripe)
- namespace CatarseStripe do
- namespace :payment do
- get '/stripe/:id/review' => 'stripe#review', :as => 'review_stripe'
- post '/stripe/notifications' => 'stripe#ipn', :as => 'ipn_stripe'
- match '/stripe/:id/notifications' => 'stripe#notifications', :as => 'notifications_stripe'
- match '/stripe/:id/pay' => 'stripe#pay', :as => 'pay_stripe'
- match '/stripe/:id/success' => 'stripe#success', :as => 'success_stripe'
- match '/stripe/:id/cancel' => 'stripe#cancel', :as => 'cancel_stripe'
- match '/stripe/:id/charge' => 'stripe#charge', :as => 'charge_stripe'
- end
+ namespace :payment do
+ get '/stripe/:id/review' => 'stripe#review', :as => 'review_stripe'
+ post '/stripe/notifications' => 'stripe#ipn', :as => 'ipn_stripe'
+ match '/stripe/:id/notifications' => 'stripe#notifications', :as => 'notifications_stripe'
+ match '/stripe/:id/pay' => 'stripe#pay', :as => 'pay_stripe'
+ match '/stripe/:id/success' => 'stripe#success', :as => 'success_stripe'
+ match '/stripe/:id/cancel' => 'stripe#cancel', :as => 'cancel_stripe'
+ match '/stripe/:id/charge' => 'stripe#charge', :as => 'charge_stripe'
end
end
end
| Change route to share application
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.