diff stringlengths 65 26.7k | message stringlengths 7 9.92k |
|---|---|
diff --git a/lib/rabatt/providers/tradedoubler.rb b/lib/rabatt/providers/tradedoubler.rb
index abc1234..def5678 100644
--- a/lib/rabatt/providers/tradedoubler.rb
+++ b/lib/rabatt/providers/tradedoubler.rb
@@ -9,6 +9,7 @@
ENDPOINT = 'http://api.tradedoubler.com/1.0/vouchers.json?token=%s'
+ # NOTE: http://dev.tradedoubler.com/vouchers/publisher/#Voucher_type_ID
DEFAULT_PARAMS = {
voucherTypeId: '1'
}
| Add link to TD Voucher_type_ID Ref
|
diff --git a/app/models/user.rb b/app/models/user.rb
index abc1234..def5678 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -5,8 +5,6 @@ field :email, type: String
field :password_hash, type: String
has_many :lists
-
- attr_protected :password_hash
index({email: 1}, {unique: true, name: 'email_index'})
| Remove attr_protected because it is not supported in this version of Mongoid
|
diff --git a/app/models/user.rb b/app/models/user.rb
index abc1234..def5678 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -5,4 +5,5 @@ :recoverable, :rememberable, :trackable, :validatable
has_many :pictures, as: :imageable, dependent: :destroy
has_many :votes, dependent: :destroy
+ has_many :rentals, dependent: :destroy
end | Add has_many rentals to User
|
diff --git a/experiments/rbkit_command_test.rb b/experiments/rbkit_command_test.rb
index abc1234..def5678 100644
--- a/experiments/rbkit_command_test.rb
+++ b/experiments/rbkit_command_test.rb
@@ -12,11 +12,17 @@ 'trigger_gc'
]
+output_file = Tempfile.new('rbkit')
+puts "Writing output to file #{output_file.path}"
ctx = ZMQ::Context.new
+
+puts "Enter IPv4 address of Rbkit server. (Blank for localhost) :"
+server_ip = gets.strip
+server_ip = "127.0.0.1" if server_ip.empty?
Thread.new do
request_socket = ctx.socket(:REQ)
- request_socket.connect("tcp://127.0.0.1:5556")
+ request_socket.connect("tcp://#{server_ip}:5556")
loop do
puts "Available commands :"
commands.each_with_index do |c, i|
@@ -34,17 +40,15 @@
socket = ctx.socket(:SUB)
socket.subscribe("")
-socket.connect("tcp://127.0.0.1:5555")
+socket.connect("tcp://#{server_ip}:5555")
-f = Tempfile.new('rbkit')
-puts "Writing output to file #{f.path}"
begin
loop do
message = socket.recv
unpacked_message = MessagePack.unpack(message)
- f.puts unpacked_message
+ output_file.puts unpacked_message
end
ensure
- f.close
- f.unlink
+ output_file.close
+ output_file.unlink
end
| Test ruby client should accept server IP from user
|
diff --git a/lib/mutant/mutator/node/literal/range.rb b/lib/mutant/mutator/node/literal/range.rb
index abc1234..def5678 100644
--- a/lib/mutant/mutator/node/literal/range.rb
+++ b/lib/mutant/mutator/node/literal/range.rb
@@ -7,7 +7,6 @@
# Abstract literal range mutator
class Range < self
- include AbstractType
MAP = {
irange: :erange,
| Remove include of AbstractType in non abstract class
This occurance was a leftover and abstract type gained the ability to
prevent instantiation of non base classes lately.
|
diff --git a/lib/puppet/provider/x509_cert/openssl.rb b/lib/puppet/provider/x509_cert/openssl.rb
index abc1234..def5678 100644
--- a/lib/puppet/provider/x509_cert/openssl.rb
+++ b/lib/puppet/provider/x509_cert/openssl.rb
@@ -4,8 +4,12 @@
commands :openssl => 'openssl'
- def self.dirname (resource)
+ def self.dirname(resource)
resource[:path].dirname
+ end
+
+ def self.template(resource)
+ resource[:template] || "#{resource[:path]}.cnf"
end
def exists?
@@ -16,7 +20,7 @@
def create
openssl(
- 'req', '-config', "#{resource[:path]}.cnf", '-new', '-x509',
+ 'req', '-config', "#{self.class.template(resource)}", '-new', '-x509',
'-nodes', '-days', resource[:days],
'-out', "#{resource[:path]}.crt",
'-keyout', "#{resource[:path]}.key"
| Use a default for template in the provider
|
diff --git a/lib/rubocop/cop/style/space_after_not.rb b/lib/rubocop/cop/style/space_after_not.rb
index abc1234..def5678 100644
--- a/lib/rubocop/cop/style/space_after_not.rb
+++ b/lib/rubocop/cop/style/space_after_not.rb
@@ -16,9 +16,9 @@ MSG = 'Do not leave space between `!` and its argument.'.freeze
def on_send(node)
+ return unless node.keyword_bang?
+
receiver, _method_name, *_args = *node
-
- return unless node.keyword_bang?
return unless receiver.loc.column - node.loc.column > 1
add_offense(node, :expression)
| Reorder some code to make it a bit more efficient
|
diff --git a/lib/exercism/guest.rb b/lib/exercism/guest.rb
index abc1234..def5678 100644
--- a/lib/exercism/guest.rb
+++ b/lib/exercism/guest.rb
@@ -1,5 +1,9 @@ class Guest
def id
+ end
+
+ def fetched?
+ false
end
def onboarded?
| Add method to null object
This will catch a problem in the languages route.
|
diff --git a/lib/firebolt/cache.rb b/lib/firebolt/cache.rb
index abc1234..def5678 100644
--- a/lib/firebolt/cache.rb
+++ b/lib/firebolt/cache.rb
@@ -1,5 +1,3 @@-require 'secure_random'
-
module Firebolt
class Cache
def self.cache_key(key_suffix)
| Remove unnecessary require from Firebolt::Cache.
|
diff --git a/config/initializers/csp.rb b/config/initializers/csp.rb
index abc1234..def5678 100644
--- a/config/initializers/csp.rb
+++ b/config/initializers/csp.rb
@@ -8,7 +8,7 @@ font_src: %w('self' fonts.gstatic.com),
script_src: %w('self' www.google-analytics.com),
connect_src: %w('self'),
- img_src: %w('self'),
+ img_src: %w('self' www.google-analytics.com),
style_src: %w('unsafe-inline' 'self' fonts.googleapis.com,),
report_uri: ['https://payload.report-uri.io/r/default/csp/enforce']
}
| Allow images from google analytics
|
diff --git a/lib/day13.rb b/lib/day13.rb
index abc1234..def5678 100644
--- a/lib/day13.rb
+++ b/lib/day13.rb
@@ -3,21 +3,22 @@ end
def parse_list(happiness_list, include_me)
- graph = {}
- happiness_list.each do |line|
+ graph = happiness_list.reduce({}) do |graph, line|
parts = line.split
name1 = parts[0]
name2 = parts[-1][0..-2]
units = parts[3].to_i
units = -units if parts[2] == "lose"
graph[[name1, name2]] = units
+ graph
end
if include_me
names = graph.keys.flatten
- names.each do |name|
- graph[[name, "David H"]] = 0
- graph[["David H", name]] = 0
+ graph = names.reduce(graph) do |new_graph, name|
+ new_graph[[name, "David H"]] = 0
+ new_graph[["David H", name]] = 0
+ new_graph
end
end
| Improve functionality for day 13.
|
diff --git a/lib/eventful/performer.rb b/lib/eventful/performer.rb
index abc1234..def5678 100644
--- a/lib/eventful/performer.rb
+++ b/lib/eventful/performer.rb
@@ -14,7 +14,7 @@ options.merge!(id: id)
response = get('performers/get', options)
performer = instantiate(response.body['performer'])
- respond_with performer, response, with_errors: true
+ respond_with performer, response
end
end
end
| Remove with_errors option from Performer
|
diff --git a/core/app/models/spree/tracker.rb b/core/app/models/spree/tracker.rb
index abc1234..def5678 100644
--- a/core/app/models/spree/tracker.rb
+++ b/core/app/models/spree/tracker.rb
@@ -1,5 +1,7 @@ module Spree
class Tracker < ActiveRecord::Base
+ attr_accessible :analytics_id, :environment, :active
+
def self.current
first(:conditions => { :active => true, :environment => Rails.env })
end
| Make analytics_id, :environment and :active mass-assignable for Tracker objects
|
diff --git a/lib/wombat_objects.rb b/lib/wombat_objects.rb
index abc1234..def5678 100644
--- a/lib/wombat_objects.rb
+++ b/lib/wombat_objects.rb
@@ -16,8 +16,12 @@ @ultracart_order = ultracart_order
end
+ def wombat_object
+ self.class.name.split('::').last.downcase + 's'
+ end
+
def serialize
- { self.class.name.split('::').last.downcase + 's' => [ send(@ultracart_order.current_stage.downcase) ].compact }
+ { wombat_object => [ send(@ultracart_order.current_stage.downcase) ].compact }
end
def ar; end # Accounts Receivable
| Split wombat object name generation to method
|
diff --git a/lib/zero_mq/errors.rb b/lib/zero_mq/errors.rb
index abc1234..def5678 100644
--- a/lib/zero_mq/errors.rb
+++ b/lib/zero_mq/errors.rb
@@ -1,6 +1,7 @@ module ZeroMQ
module Errors
ERRORS = Errno.constants.map(&Errno.method(:const_get)).
+ select { |obj| obj.is_a?(Class) && obj < SystemCallError }.
inject({}) { |map, error| map[error.const_get(:Errno)] = error; map }
private
| Select only the constants that are actually Errors
On Rubinius, there are a few other constants that end up under the Errno namespace (other than the myriad SystemCallError classes).
Ironically, one of these is Errno::Mapping, which ironically is there to serve the same purpose as the hash you're constructing here.
Anyway, adding this line will prevent the other constants from ending up in the inject block and raising an exception on Rubinius. |
diff --git a/spec/zookeeper_server_spec.rb b/spec/zookeeper_server_spec.rb
index abc1234..def5678 100644
--- a/spec/zookeeper_server_spec.rb
+++ b/spec/zookeeper_server_spec.rb
@@ -0,0 +1,49 @@+require 'spec_helper'
+
+describe 'hadoop::zookeeper_server' do
+ context 'on Centos 6.4 x86_64' do
+ let(:chef_run) do
+ ChefSpec::Runner.new(platform: 'centos', version: 6.4) do |node|
+ node.automatic['domain'] = 'example.com'
+ node.automatic['hostname'] = 'localhost'
+ node.default['zookeeper']['zoocfg']['dataDir'] = '/var/lib/zookeeper'
+ node.default['zookeeper']['zoocfg']['server.1'] = 'localhost:2181'
+ stub_command('update-alternatives --display zookeeper-conf | grep best | awk \'{print $5}\' | grep /etc/zookeeper/conf.chef').and_return(false)
+ end.converge(described_recipe)
+ end
+
+ it 'install zookeeper-server package' do
+ expect(chef_run).to install_package('zookeeper-server')
+ end
+
+ it 'creates ZooKeeper conf_dir' do
+ expect(chef_run).to create_directory('/etc/zookeeper/conf.chef').with(
+ user: 'root',
+ group: 'root'
+ )
+ end
+
+ %w(/var/lib/zookeeper/myid /etc/zookeeper/conf.chef/log4j.properties /etc/zookeeper/conf.chef/zoo.cfg).each do |file|
+ it "creates #{file} template" do
+ expect(chef_run).to create_template(file)
+ end
+ end
+
+ it 'renders file zoo.cfg with dataDir=/var/lib/zookeeper' do
+ expect(chef_run).to render_file('/etc/zookeeper/conf.chef/zoo.cfg').with_content(
+ %r{dataDir=/var/lib/zookeeper}
+ )
+ end
+
+ it 'creates ZooKeeper dataDir' do
+ expect(chef_run).to create_directory('/var/lib/zookeeper').with(
+ user: 'zookeeper',
+ group: 'zookeeper'
+ )
+ end
+
+ it 'runs execute[update zookeeper-conf alternatives]' do
+ expect(chef_run).to run_execute('update zookeeper-conf alternatives')
+ end
+ end
+end
| Test for zookeeper-server package, directories, templates, and execute block
|
diff --git a/deployment/puppet/swift/spec/classes/swift_xfs_spec.rb b/deployment/puppet/swift/spec/classes/swift_xfs_spec.rb
index abc1234..def5678 100644
--- a/deployment/puppet/swift/spec/classes/swift_xfs_spec.rb
+++ b/deployment/puppet/swift/spec/classes/swift_xfs_spec.rb
@@ -0,0 +1,6 @@+require 'spec_helper'
+describe 'swift::xfs' do
+ ['xfsprogs', 'parted'].each do |present_package|
+ it { should contain_package(present_package).with_ensure('present') }
+ end
+end
| Add unit tests for xfs
|
diff --git a/test/job_test.rb b/test/job_test.rb
index abc1234..def5678 100644
--- a/test/job_test.rb
+++ b/test/job_test.rb
@@ -45,4 +45,10 @@ assert_nil job.queued_time
end
end
+
+ def test_queued_time_perform_now
+ ManualJob.perform_now
+ job = Notable::Job.last
+ assert_nil job.queued_time
+ end
end
| Test queued_time for perform now
|
diff --git a/ziggeo.gemspec b/ziggeo.gemspec
index abc1234..def5678 100644
--- a/ziggeo.gemspec
+++ b/ziggeo.gemspec
@@ -11,6 +11,6 @@ s.files = Dir["{app,config,db,lib}/**/*", "README.md"]
s.require_paths = ["lib"]
s.license = 'Apache-2.0'
- s.add_dependency 'httparty', '~> 0.13.5'
+ s.add_dependency 'httparty', '~> 0.13'
s.add_dependency 'httmultiparty'
end
| Allow httparty version to be >= 0.13.0 and < 1.0.0.
Previously the httparty version constraint was >= 0.13.5 and < 0.14.0.
|
diff --git a/cuba-contrib.gemspec b/cuba-contrib.gemspec
index abc1234..def5678 100644
--- a/cuba-contrib.gemspec
+++ b/cuba-contrib.gemspec
@@ -1,5 +1,3 @@-require "./lib/cuba/contrib/version"
-
Gem::Specification.new do |s|
s.name = "cuba-contrib"
s.version = "0.1.0.rc1"
| Fix load error in gemspec.
|
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,5 +3,8 @@ # For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
-
+ def default_url_options
+ return { protocol: 'https' } if Rails.env.staging? || Rails.env.production?
+ {}
+ end
end
| Add default protocol for urls
|
diff --git a/lib/slapp.rb b/lib/slapp.rb
index abc1234..def5678 100644
--- a/lib/slapp.rb
+++ b/lib/slapp.rb
@@ -0,0 +1,61 @@+#!/usr/bin/env arch -i386 ruby
+# coding: utf-8
+
+
+# A WxRuby Shoes-like DSL
+#
+# #!/usr/bin/env arch -i386 ruby
+# require 'rubygems'
+# require 'slapp'
+#
+# Slapp.app {
+# frame :title => "Wow!" do
+# button :start_stop, :caption => "start/stop"
+# end
+# }
+#
+#
+#
+# OSX Snow Leopard users see: http://exceptionisarule.blogspot.com/2009/11/building-wxruby-201-on-snow-leopard.html
+#
+module Slapp
+ require 'wx'
+ module Sugar
+ include Wx
+ def frame options = {}, &block
+ elements[:frame] = Frame.new(nil, -1, options[:title])
+ block.call
+ elements[:frame].show
+ return elements[:frame]
+ end
+
+ def elements
+ @elements ||= {}
+ end
+
+ def button name, options = {}
+ elements[name] ||= Button.new elements[:frame], -1, options[:caption]
+ end
+ end
+
+ def self.app &block
+ Wx::App.app &block
+ Wx::App.run
+ end
+end
+
+class Wx::App
+ include Slapp::Sugar
+ def on_init
+ self.instance_eval &self.class.app
+ end
+ def self.app &block
+ if block_given?
+ then @on_init_proc = block
+ else @on_init_proc
+ end
+ end
+ def run
+ new.main_loop
+ end
+end
| Include SLAPP into the "elia" gem. |
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
@@ -24,7 +24,7 @@ token = Integer(subclass.token)
digits = Integer(shelfmark.match(/(\d+)/)[0])
- digits = digits.to_s.rjust(4, "0") # add prepending 0s
+ digits = digits.to_s.rjust(5, "0") # add prepending 0s
res = Float(token.to_s + '.' + digits)
return res;
| Add floating digit of precision for shelfmarks
|
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,6 +1,8 @@ require "application_responder"
class ApplicationController < ActionController::Base
+ rescue_from ActionController::InvalidAuthenticityToken, with: :invalid_authenticity_request
+
self.responder = ApplicationResponder
respond_to :json
@@ -19,4 +21,11 @@ def configure_permitted_parameters
devise_parameter_sanitizer.for(:sign_up) << :username
end
+
+ #Clean up cookies and session on InvalidAuthenticityRequest
+ def invalid_authenticity_request
+ sign_out(current_user)
+ cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?
+ render error: 'invalid token', status: :unprocessable_entity
+ end
end
| Clean up cookies and session on InvalidAuthenticityRequest
|
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
@@ -2,4 +2,8 @@ # Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
+
+ def render_404
+ render :file => "#{Rails.root}/public/404", :layout => false, :status => :not_found
+ end
end
| Add render 404 method to application controller
|
diff --git a/config/deploy.rb b/config/deploy.rb
index abc1234..def5678 100644
--- a/config/deploy.rb
+++ b/config/deploy.rb
@@ -11,6 +11,4 @@ set :repository, "git@github.com:NYULibraries/umbra.git"
# Rails specific vars
-set :normalize_asset_timestamps, false
-
-set :recipient, "web.services@library.nyu.edu"+set :normalize_asset_timestamps, false | Remove the recipient! no more spam
|
diff --git a/config/deploy.rb b/config/deploy.rb
index abc1234..def5678 100644
--- a/config/deploy.rb
+++ b/config/deploy.rb
@@ -13,6 +13,9 @@ set :user, 'deploy'
set :deploy_to, "/home/deploy"
+default_run_options[:pty] = true
+set :use_sudo, true
+
set :default_environment, {
'PATH' => "/opt/rbenv/shims/:$PATH"
}
| Add pty options to try and fix tty issues |
diff --git a/config/deploy.rb b/config/deploy.rb
index abc1234..def5678 100644
--- a/config/deploy.rb
+++ b/config/deploy.rb
@@ -7,7 +7,11 @@ set :user, "deployer" # The server's user for deploys
set :scm_passphrase, "p@ssw0rd" # The deploy user's password
set :deploy_via, :remote_cache
+set :deploy_to, "/home/deploy"
+set :default_environment, {
+ 'PATH' => "/opt/rbenv/shims/:$PATH"
+}
set :stages, %w(production development)
set :default_stage, "development"
require 'capistrano/ext/multistage'
| Add some more config options to make sure we pick up rbenv inside capistrano runs on the remote machine'
|
diff --git a/app/controllers/zip_exports_controller.rb b/app/controllers/zip_exports_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/zip_exports_controller.rb
+++ b/app/controllers/zip_exports_controller.rb
@@ -8,7 +8,7 @@ else
send_file @zip_export.zip_file.path,
filename: URI.unescape(@zip_export.zip_file_file_name),
- type: @zip_export.file_content_type
+ type: 'application/zip'
end
end
| Fix dowloand of export zip files from local storage [SCI-1128]
|
diff --git a/lib/axiom/types/object.rb b/lib/axiom/types/object.rb
index abc1234..def5678 100644
--- a/lib/axiom/types/object.rb
+++ b/lib/axiom/types/object.rb
@@ -6,7 +6,7 @@ # Represents an object type
class Object < Type
accept_options :primitive, :coercion_method
- primitive RUBY_VERSION >= '1.9' && defined?(::BasicObject) ? ::BasicObject : ::Object
+ primitive ::Object.superclass || ::Object
coercion_method :to_object
def self.finalize
| Refactor setting the Object primitive
* In 1.9 ::Object.superclass will return ::BasicObject, under 1.8 it
will return nil, so this will default to ::Object
|
diff --git a/spec/factories/api_area.rb b/spec/factories/api_area.rb
index abc1234..def5678 100644
--- a/spec/factories/api_area.rb
+++ b/spec/factories/api_area.rb
@@ -3,5 +3,6 @@ area { 'nl' }
area_code { 'nl' }
analysis_year { 2015 }
+ group { 'country' }
end
end
| Add `group` to the Api::Area factory
|
diff --git a/spec/missing_props_spec.rb b/spec/missing_props_spec.rb
index abc1234..def5678 100644
--- a/spec/missing_props_spec.rb
+++ b/spec/missing_props_spec.rb
@@ -0,0 +1,43 @@+require 'spec_helper'
+
+describe 'Browserino' do
+ describe 'http header fallback' do
+ it 'normalizes raw header names' do
+ plain_headers = Browserino.normalize_header_keys({'Accept-Language' => 'en-US,en;q=0.9,nl-NL;q=0.8,nl;q=0.7'})
+
+ expect(plain_headers.key?(:accept_language)).to be_truthy
+ end
+
+ it 'normalizes Rails header names' do
+ rails_headers = Browserino.normalize_header_keys({'HTTP_ACCEPT_LANGUAGE' => 'en-US,en;q=0.9,nl-NL;q=0.8,nl;q=0.7'})
+
+ expect(rails_headers.key?(:accept_language)).to be_truthy
+ end
+
+ it 'sorts HTTP_ACCEPT_LANGUAGE locales by quality' do
+ client = Browserino.parse(
+ 'Mozilla/5.0 (Linux; Android 5.1; ZTE Blade L6 Build/LMY47I) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.91 Mobile Safari/537.36',
+ {'HTTP_ACCEPT_LANGUAGE' => 'en-US,en;q=0.9,nl-NL;q=0.6,nl;q=0.7'}
+ )
+
+ expect(client.locales).to eq %i[en_us en nl nl_nl]
+ end
+
+ it 'can detect language from Accept-Language header when headers given' do
+ client = Browserino.parse(
+ 'Mozilla/5.0 (Linux; Android 5.1; ZTE Blade L6 Build/LMY47I) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.91 Mobile Safari/537.36',
+ {'HTTP_ACCEPT_LANGUAGE' => 'en-US,en;q=0.9,nl-NL;q=0.8,nl;q=0.7'}
+ )
+
+ expect(client.locale).to eq :en_us
+ expect(client.locales).to eq %i[en_us en nl_nl nl]
+ end
+
+ it 'cannot detect language from Accept-Language header when no headers given' do
+ client = Browserino.parse 'Mozilla/5.0 (Linux; Android 5.1; ZTE Blade L6 Build/LMY47I) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.91 Mobile Safari/537.36'
+
+ expect(client.locale).to be_nil
+ expect(client.locales).to eq %i[]
+ end
+ end
+end
| Add some tests for http header data extraction
|
diff --git a/spec/models/object_spec.rb b/spec/models/object_spec.rb
index abc1234..def5678 100644
--- a/spec/models/object_spec.rb
+++ b/spec/models/object_spec.rb
@@ -4,11 +4,11 @@
describe Object do
describe '#this_method_does_not_exist' do
- it 'should return true (\e[33mexpect failure\e[0m)' do
+ it "should return true (\e[33mexpect failure\e[0m)" do
subject.this_method_does_not_exist.should == true
end
- it 'should return true (\e[32mexpect success\e[0m)' do
+ it "should return true (\e[32mexpect success\e[0m)" do
subject.kind_of?(Object).should == true
end
end
| Fix colour coding so obvious when tests fail that should pass |
diff --git a/lib/jsonapi/mime_types.rb b/lib/jsonapi/mime_types.rb
index abc1234..def5678 100644
--- a/lib/jsonapi/mime_types.rb
+++ b/lib/jsonapi/mime_types.rb
@@ -5,5 +5,7 @@ Mime::Type.register JSONAPI::MEDIA_TYPE, :api_json
ActionDispatch::ParamsParser::DEFAULT_PARSERS[Mime::Type.lookup(JSONAPI::MEDIA_TYPE)] = lambda do |body|
- JSON.parse(body)
+ data = JSON.parse(body)
+ data = {:_json => data} unless data.is_a?(Hash)
+ data.with_indifferent_access
end
| Make params parsing behave more like Rails
Specifically, ensure that the parsed params end up as a
HashWithIndifferentAccess instead of a vanilla Hash |
diff --git a/lib/lita/handlers/ruby.rb b/lib/lita/handlers/ruby.rb
index abc1234..def5678 100644
--- a/lib/lita/handlers/ruby.rb
+++ b/lib/lita/handlers/ruby.rb
@@ -42,14 +42,11 @@
private
- def hijack_stdio_with(response)
+ def hijack_stdout_with(response)
original_stdout = $stdout
- original_stderr = $stderr
$stdout = StandardChat.new(response)
- $stderr = StandardChat.new(response)
yield
$stdout = original_stdout
- $stderr = original_stderr
end
end
| Revert "Include stderr in chat response"
This reverts commit d43e54d05807ebfcf0a786b521d99bb05fa96a8c.
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -3,5 +3,5 @@ resources :deployments
resources :releases
- root :to => redirect("/releases", :status => 302)
+ root :to => redirect("/applications", :status => 302)
end
| Change the default route to /applications
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -4,7 +4,11 @@ resources :maps, only: [:index]
get "/drops/followees" => 'drops#followees'
resources :drops, only: [:new, :index, :show, :create]
- resources :users, only: [:show]
+
+ resources :users, only: [:show] do
+ resources :follows, only: [:index]
+ end
+
resources :follows, only: [:create, :destroy]
get "/login", :to => 'sessions#new', :as => 'login'
| Add nested for user follows
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -3,7 +3,6 @@ # http://stackoverflow.com/a/3443678
match "*path.gif", :to => proc {|env| [404, {}, ["Not Found"]] }
- match "/homepage", :to => "root#index"
match "/help/feedback" => redirect("/feedback")
match "/help(/:action)", :to => "help"
match "/feedback", :to => 'feedback#index'
@@ -20,4 +19,7 @@ pub.match ":slug/print", :format => :print
pub.match ":slug(/:part)"
end
+
+ match "/homepage", :to => redirect("/")
+ root :to => 'root#index'
end
| Move the homepage to /
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -4,7 +4,7 @@ Rails.application.routes.draw do
match "/visits/record.gif" => "control_center/visits#record", :as => "record_visit"
match "/visits/js" => "control_center/visits#visit_recorder_js", :as => "visit_recorder_js"
- mount Rack::GridFS::Endpoint.new(:db => Mongoid.database, :lookup => :path), :at => "gridfs", :expires => 315360000
+ mount Rack::GridFS::Endpoint.new(:db => Mongoid.database, :lookup => :path, :expires => 315360000), :at => "gridfs"
scope :constraints => {:subdomain => "controlcenter"}, :module => "control_center", :as => "control_center" do
get "signout" => "sessions#destroy", :as => "signout"
| Fix rack-gridfs expires cache header.
|
diff --git a/lib/postmark/inflector.rb b/lib/postmark/inflector.rb
index abc1234..def5678 100644
--- a/lib/postmark/inflector.rb
+++ b/lib/postmark/inflector.rb
@@ -8,7 +8,7 @@ end
def to_ruby(name)
- name.scan(/[A-Z][a-z]+/).join('_').downcase.to_sym
+ name.scan(/[A-Z][a-z]*/).join('_').downcase.to_sym
end
end
end | Fix a possible problem in Regexp used in Postmark::Inflector.
|
diff --git a/lib/tasks/js_testing.rake b/lib/tasks/js_testing.rake
index abc1234..def5678 100644
--- a/lib/tasks/js_testing.rake
+++ b/lib/tasks/js_testing.rake
@@ -2,7 +2,9 @@
desc "Run all javascript unit tests"
task :javascripts do
- command_line = "java -jar #{File.join(Rails.root, "test", "javascripts", "JsTestDriver.jar")} --config #{File.join(Rails.root, "config","jsTestDriver.conf")} --tests all"
+ jar_file = File.join(Rails.root, "test", "javascripts", "JsTestDriver.jar")
+ config = File.join(Rails.root, "config","jsTestDriver.conf")
+ command_line = "java -jar #{jar_file} --config #{config} --tests all --captureConsole"
puts `#{command_line}`
end
| Make jsTestRunner capture output from console.log() statements
|
diff --git a/spec/project_spec.rb b/spec/project_spec.rb
index abc1234..def5678 100644
--- a/spec/project_spec.rb
+++ b/spec/project_spec.rb
@@ -3,10 +3,10 @@ require 'spec_helper'
describe 'RuboCop Project' do
- describe '.rubocop.yml' do
+ describe 'default configuration file' do
it 'has configuration for all cops' do
cop_names = Rubocop::Cop::Cop.all.map(&:cop_name)
- expect(Rubocop::Config.load_file('.rubocop.yml').keys.sort)
+ expect(Rubocop::Config.load_file('config/default.yml').keys.sort)
.to eq((['AllCops'] + cop_names).sort)
end
end
| Correct default configuration spec to fit current structure
|
diff --git a/models/lesson_plan.rb b/models/lesson_plan.rb
index abc1234..def5678 100644
--- a/models/lesson_plan.rb
+++ b/models/lesson_plan.rb
@@ -1,5 +1,5 @@ module V1
- def_model 'lesson_plan_milestones', 'lesson_plan_resources'
+ def_model 'lesson_plan_milestones'
def_model 'lesson_plan_entries' do
# V1:
| Remove the duplicate definition of lesson plan resources
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,5 +1,5 @@ EhjobAuthentication::Engine.routes.draw do
- devise_for :users, skip: [:registrations, :passwords, :sessions, :omniauth_callbacks]
+ devise_for :users, skip: [:registrations, :passwords, :unlocks, :sessions, :omniauth_callbacks]
as :user do
namespace :api do
resources :users, only: [] do
| Allow overriding for unlocks controller
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,10 +1,13 @@ TariffWeb::Application.routes.draw do
- match "/search" => "search#search", via: :get, as: :perform_search
+ scope :path => "#{APP_SLUG}" do
+ get "/" => "pages#index"
+ match "/search" => "search#search", via: :get, as: :perform_search
- resources :sections, only: [:index, :show]
- resources :chapters, only: [:index, :show]
- resources :headings, only: [:index, :show]
- resources :commodities, only: [:index, :show]
+ resources :sections, only: [:index, :show]
+ resources :chapters, only: [:index, :show]
+ resources :headings, only: [:index, :show]
+ resources :commodities, only: [:index, :show]
+ end
- root to: 'pages#index'
+ root :to => redirect("/#{APP_SLUG}", :status => 302)
end
| Use the APP_SLUG as we're using a prefix route
This is required as the router is horrible to all of us. It
expects apps to handle this scope shift for the slug they're
using.
This just mitigates this deficiency in the router.
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,6 +1,7 @@ Rails.application.routes.draw do
root 'articles#index'
+ resources :articles, only: %w(index show)
get '/atom.xml', controller: 'articles', action: 'index', format: 'atom'
get ':year/:month/:day/:title', to: 'articles#show', year: /\d{4}/, month: /\d{2}/, day: /\d{2}/
end
| Add resources for atom feed
|
diff --git a/redhead.gemspec b/redhead.gemspec
index abc1234..def5678 100644
--- a/redhead.gemspec
+++ b/redhead.gemspec
@@ -1,12 +1,12 @@ Gem::Specification.new do |s|
s.name = "redhead"
- s.version = "0.0.2"
+ s.version = "0.0.3"
s.authors = ["Adam Prescott"]
s.email = ["adam@aprescott.com"]
s.homepage = "https://github.com/aprescott/redhead"
s.summary = "String header metadata."
s.description = "String header metadata."
- s.files = Dir["{lib/**/*,test/**/*}"] + %w[.gemtest LICENSE Gemfile rakefile README.md]
+ s.files = Dir["{lib/**/*,test/**/*}"] + %w[redhead.gemspec .gemtest LICENSE Gemfile rakefile README.md]
s.require_path = "lib"
s.test_files = Dir["test/*"]
s.has_rdoc = false
| Add omitted .gemspec to itself. Bump to 0.0.3.
|
diff --git a/roles/aarnet.rb b/roles/aarnet.rb
index abc1234..def5678 100644
--- a/roles/aarnet.rb
+++ b/roles/aarnet.rb
@@ -2,6 +2,12 @@ description "Role applied to all servers at AARNet"
default_attributes(
+ :accounts => {
+ :users => {
+ :chm => { :status => :administrator },
+ :bclifford => { :status => :administrator }
+ }
+ },
:hosted_by => "AARNet"
)
| Add AARNet remote hands accounts
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -6,7 +6,10 @@
scope :auth do
get 'github/callback', to: 'sessions#create'
- post 'developer/callback', to: 'sessions#create'
+
+ unless Rails.env.production?
+ post 'developer/callback', to: 'sessions#create'
+ end
end
get '/', to: redirect('/admin/events')
| Hide oauth developer strategy route in production
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -3,6 +3,8 @@ get '/sotechsha', to: 'so_tech_sha_overview_page#index'
get '/sotechsha/:quiz', to: 'so_tech_sha#quiz'
+ # Redirects
+ get "/releases/2016/12/12/new-backend", to: redirect('/blogs/2016/12/12/new-backend')
# Default Scrivito routes. Adapt them to change the routing of CMS objects.
# See the documentation of 'scrivito_route' for a detailed description.
scrivito_route '/', using: 'homepage'
| Use /blogs instead of /releases
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -12,7 +12,7 @@
map.raptcha '/raptcha', :controller => 'blogs', :action => 'captcha'
- map.namespace(:admin, :path_prefix => 'refinery') do |admin|
+ map.namespace(:admin, :path_prefix => (defined?(REFINERY_GEM_VERSION) ? "admin" : "refinery") ) do |admin|
admin.resources :blogs, :as => 'blog'
admin.resources :comments, :member => {:toggle_status => :get, :unread => :get}
admin.connect 'blog_settings/toggle_setting/:id', :controller => "blog_settings", :action => "toggle_setting"
| Fix for refinery/admin routing bug, where the admin route is different between the current gem version and edge version on github (REFINERY_GEM_VERSION will no longer be defined in later versions of Refinery)
|
diff --git a/Casks/droplr.rb b/Casks/droplr.rb
index abc1234..def5678 100644
--- a/Casks/droplr.rb
+++ b/Casks/droplr.rb
@@ -0,0 +1,15 @@+cask 'droplr' do
+ version :latest
+ sha256 :no_check
+
+ url 'https://droplr.com/homebrew'
+ name 'Droplr'
+ homepage 'https://droplr.com/'
+ license :gratis
+
+ auto_updates true
+
+ app 'Droplr.app'
+
+ uninstall :login_item => 'Droplr'
+end
| Add versionless Cask for Droplr.app
|
diff --git a/Casks/sketch.rb b/Casks/sketch.rb
index abc1234..def5678 100644
--- a/Casks/sketch.rb
+++ b/Casks/sketch.rb
@@ -5,7 +5,7 @@ url 'http://bohemiancoding.com/static/download/sketch.zip'
appcast 'http://www.bohemiancoding.com/sketch/appcast.xml'
homepage 'http://www.bohemiancoding.com/sketch/'
- license :unknown # todo: change license and remove this comment; ':unknown' is a machine-generated placeholder
+ license :commercial
app 'Sketch.app'
end
| Update Sketch.app to commercial license.
|
diff --git a/slodown.gemspec b/slodown.gemspec
index abc1234..def5678 100644
--- a/slodown.gemspec
+++ b/slodown.gemspec
@@ -17,10 +17,10 @@ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.require_paths = ["lib"]
- gem.add_dependency 'kramdown'
- gem.add_dependency 'coderay'
- gem.add_dependency 'sanitize'
- gem.add_dependency 'rinku'
+ gem.add_dependency 'kramdown', '>= 0.14.0'
+ gem.add_dependency 'coderay', '>= 1.0.0'
+ gem.add_dependency 'sanitize', '>= 2.0.0'
+ gem.add_dependency 'rinku', '>= 1.7.0'
gem.add_dependency 'ruby-oembed', '~> 0.8.8'
gem.add_development_dependency 'rspec', '>= 2.12.0'
| Add some minimum version numbers to gemspec dependencies. |
diff --git a/repository_hosting_backup.gemspec b/repository_hosting_backup.gemspec
index abc1234..def5678 100644
--- a/repository_hosting_backup.gemspec
+++ b/repository_hosting_backup.gemspec
@@ -4,9 +4,9 @@ Gem::Specification.new do |gem|
gem.authors = ["Utkarsh Kukreti"]
gem.email = ["utkarshkukreti@gmail.com"]
- gem.description = %q{TODO: Write a gem description}
- gem.summary = %q{TODO: Write a gem summary}
- gem.homepage = ""
+ gem.description = %q{Backs up all repositories in your RepositoryHosting.com account into the current folder}
+ gem.summary = %q{Backs up all repositories in your RepositoryHosting.com account into the current folder}
+ gem.homepage = "https://github.com/utkarshkukreti/repository_hosting_backup"
gem.files = `git ls-files`.split($\)
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
| Add description, summary, homepage to gemspec.
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -7,13 +7,13 @@
map.resources :users
- map.connect ':page', :controller => 'static', :action => 'show', :conditions => {:method => :get}
-
map.dates "posts/dates/:year/:month", :controller => 'posts', :action => 'dates', :conditions => {:method => :get}, :defaults => {:month => nil, :year => nil}
map.resources :posts, :new => { :new => :post } do |p|
p.resources :comments, :new => { :new => :post }
end
map.resources :comments
+ map.connect ':page', :controller => 'static', :action => 'show', :conditions => {:method => :get}
+
map.root :controller => 'posts'
end
| Fix a stupid routing bug.
|
diff --git a/spec/image_downloader_adapter_base_spec.rb b/spec/image_downloader_adapter_base_spec.rb
index abc1234..def5678 100644
--- a/spec/image_downloader_adapter_base_spec.rb
+++ b/spec/image_downloader_adapter_base_spec.rb
@@ -22,6 +22,11 @@ files.each { |file| expect(target_bank.contains? file).to be(true) }
end
+ it 'should download elements with background-image property in stylesheet' do
+ file = File.join(source_dir, 'background stylesheet.png')
+ expect(target_bank.contains? file).to be(true)
+ end
+
xit 'should download img tags with srcset in scheme http' do
end
@@ -36,7 +41,4 @@
xit 'should download elements with background property in stylesheet' do
end
-
- xit 'should download elements with background-image property in stylesheet' do
- end
end
| Implement background-image property in stylesheet spec
|
diff --git a/spec/mailers/administration_mailer_spec.rb b/spec/mailers/administration_mailer_spec.rb
index abc1234..def5678 100644
--- a/spec/mailers/administration_mailer_spec.rb
+++ b/spec/mailers/administration_mailer_spec.rb
@@ -0,0 +1,36 @@+RSpec.describe AdministrationMailer, type: :mailer do
+ describe '#new_admin_email' do
+ let(:admin) { create(:administrateur) }
+ let(:administration) { create(:administration) }
+
+ subject { described_class.new_admin_email(admin, administration) }
+
+ it { expect(subject.subject).not_to be_empty }
+ end
+
+ describe '#invite_admin' do
+ let(:admin) { create(:administrateur) }
+ let(:token) { "Toc toc toc" }
+ let(:administration_id) { BizDev::BIZ_DEV_IDS.first }
+
+ subject { described_class.invite_admin(admin, token, administration_id) }
+
+ it { expect(subject.subject).not_to be_empty }
+ end
+
+ describe '#refuse_amin' do
+ let(:mail) { "l33t-4dm1n@h4x0r.com" }
+
+ subject { described_class.refuse_admin(mail) }
+
+ it { expect(subject.subject).not_to be_empty }
+ end
+
+ describe '#dubious_procedures' do
+ let(:procedures_and_type_de_champs) { [] }
+
+ subject { described_class.dubious_procedures(procedures_and_type_de_champs) }
+
+ it { expect(subject.subject).not_to be_empty }
+ end
+end
| Add at least minimal test for AdministrationMailer
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,5 +1,5 @@ Ecm::News::Backend::Engine.routes.draw do
- resources :items do
+ backend_resources :items do
member do
post :toggle_published
end
| Use itsf backend backend_resource method.
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -5,6 +5,8 @@ resources :users, only: [:show], shallow: true do
resources :collections do
resources :books
+ get "books/search"
+ post "books/result"
resources :comments
end
end
| Create search and results route for book searching
|
diff --git a/db/migrate/20140923173255_create_users.rb b/db/migrate/20140923173255_create_users.rb
index abc1234..def5678 100644
--- a/db/migrate/20140923173255_create_users.rb
+++ b/db/migrate/20140923173255_create_users.rb
@@ -1,10 +1,10 @@ class CreateUsers < ActiveRecord::Migration
def change
create_table :users do |t|
- t.string :company
- t.string :ip_address
- t.string :operating_system
- t.string :browser
+ t.string :company, default: "N/A"
+ t.string :ip_address, default: "N/A"
+ t.string :operating_system, default: "N/A"
+ t.string :browser, default: "N/A"
t.string :screen_resolution, default: "N/A"
t.string :window_size, default: "N/A"
t.string :download_speed, default: "N/A"
| Add more defaults to migration
|
diff --git a/controls.gemspec b/controls.gemspec
index abc1234..def5678 100644
--- a/controls.gemspec
+++ b/controls.gemspec
@@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = 'controls'
- s.version = '0.1.1'
+ s.version = '0.1.2'
s.summary = 'Test controls'
s.description = ' '
| Package version is increased from 0.1.1 to 0.1.2
|
diff --git a/app/controllers/salary_reports_controller.rb b/app/controllers/salary_reports_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/salary_reports_controller.rb
+++ b/app/controllers/salary_reports_controller.rb
@@ -1,8 +1,6 @@ class SalaryReportsController < ApplicationController
respond_to :html, :pdf
-
- # Actions
- # =======
+
def yearly_ahv_statement
@value_period = Date.parse(params[:by_value_period][:from] || Date.today.beginning_of_year)..Date.parse(params[:by_value_period][:to] || Date.today.end_of_year) if params[:by_value_period]
@value_period ||= Date.today.beginning_of_year..Date.today.end_of_year
| Drop bogus action title header comment.
|
diff --git a/app/controllers/slash_commands_controller.rb b/app/controllers/slash_commands_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/slash_commands_controller.rb
+++ b/app/controllers/slash_commands_controller.rb
@@ -21,12 +21,12 @@ issuer = User.find_by(slack_id: issuer_user_id)
recipient = User.find_by(slack_id: recipient_user_id)
if issuer.present? && recipient.present?
- positive = params[:command] == '/praise' ? true : false
+ positive = params[:command] == '/praise' ? true : false
UserFeedback.create(issuing_user: issuer, issued_user: recipient, positive: positive)
end
end
- return head :no_content
+ render json: { response_type: 'ephemeral', text: 'Thanks for submitting feedback!' }
end
end
| Add ephemeral response to slash commands
|
diff --git a/comprehend.gemspec b/comprehend.gemspec
index abc1234..def5678 100644
--- a/comprehend.gemspec
+++ b/comprehend.gemspec
@@ -1,14 +1,16 @@ Gem::Specification.new do |s|
- s.name = 'comprehend'
- s.version = '0.0.0'
- s.date = '2013-01-29'
- s.summary = "Compact and flatten an array in one iteration"
- s.description = '[1,2,3].comprehend{ |i| i.to_s if i<3 } == ["1","2"]'
- s.authors = ["Aaron Weiner"]
- s.email = 'aweiner@mdsol.com'
- s.files = Dir.glob('lib/**/*.rb') +
- Dir.glob('ext/**/*.{c,h,rb}')
- s.extensions = ['ext/comprehend/extconf.rb']
- s.homepage = 'http://github.com/mdsol/comprehend'
- s.required_ruby_version = '>= 1.9.3'
+ s.name = 'comprehend'
+ s.version = '0.0.0'
+ s.date = '2013-01-29'
+ s.summary = "Transform and compact an array in one iteration"
+ s.description = '[1,2,3].comprehend{ |i| i.to_s if i<3 } == ["1","2"]'
+ s.authors = ["Aaron Weiner"]
+ s.email = 'aweiner@mdsol.com'
+ s.files = Dir.glob('lib/**/*.rb') +
+ Dir.glob('ext/**/*.{c,h,rb}')
+ s.extensions = ['ext/comprehend/extconf.rb']
+ s.homepage = 'http://github.com/mdsol-share/comprehend'
+ s.required_ruby_version = '>= 1.9.3'
+
+ s.add_development_dependency 'rspec'
end
| Correct homepage, summary, development dependencies
|
diff --git a/app/views/renalware/api/ukrdc/patients/treatments/_hd.xml.builder b/app/views/renalware/api/ukrdc/patients/treatments/_hd.xml.builder
index abc1234..def5678 100644
--- a/app/views/renalware/api/ukrdc/patients/treatments/_hd.xml.builder
+++ b/app/views/renalware/api/ukrdc/patients/treatments/_hd.xml.builder
@@ -8,10 +8,12 @@ xml.FromTime treatment.started_on&.iso8601
xml.ToTime(treatment.ended_on&.iso8601) if treatment.ended_on.present?
- if treatment.hospital_unit.present?
- xml.HealthCareFacility do
- xml.CodingStandard "ODS"
+ xml.HealthCareFacility do
+ xml.CodingStandard "ODS"
+ if treatment.hospital_unit.present?
xml.Code treatment.hospital_unit.renal_registry_code
+ else
+ xml.Code Renalware.config.ukrdc_site_code
end
end
| Set missing HD modality HealthCareFacility to site code (eg RJZ) in UKRDC XML
|
diff --git a/recipes/chruby_install.rb b/recipes/chruby_install.rb
index abc1234..def5678 100644
--- a/recipes/chruby_install.rb
+++ b/recipes/chruby_install.rb
@@ -1,2 +1,2 @@-node.default['chruby_install']['users'] = { 'jason' => {} }
+node.default['chruby_install']['users'] = { 'jason' => { auto: true } }
include_recipe 'chruby_install::user'
| Add auto change to chruby recipe
|
diff --git a/spec/higher_level_api/integration/exchange_publish_spec.rb b/spec/higher_level_api/integration/exchange_publish_spec.rb
index abc1234..def5678 100644
--- a/spec/higher_level_api/integration/exchange_publish_spec.rb
+++ b/spec/higher_level_api/integration/exchange_publish_spec.rb
@@ -7,6 +7,7 @@
it 'allows a message timestamp to be included when publishing a message' do
ch = connection.create_channel
+ ch.confirm_select
queue = ch.queue('publish_spec', exclusive: true)
timestamp = Time.new(2016)
@@ -16,6 +17,7 @@ properties: {timestamp: timestamp},
)
+ expect(ch.wait_for_confirms).to be_truthy
expect(queue.get.first.properties.timestamp).to eq timestamp.to_java
end
end
| Use publisher confirms in spec to avoid timing issues
|
diff --git a/spec/views/admin/gestionnaires/index.html.haml_spec.rb b/spec/views/admin/gestionnaires/index.html.haml_spec.rb
index abc1234..def5678 100644
--- a/spec/views/admin/gestionnaires/index.html.haml_spec.rb
+++ b/spec/views/admin/gestionnaires/index.html.haml_spec.rb
@@ -16,10 +16,10 @@ before do
render
end
- it { expect(rendered).to have_content('Aucun gestionnaire') }
+ it { expect(rendered).to have_content('Aucun accompagnateur') }
end
- context 'Ajout d\'un gestionnaire' do
+ context 'Ajout d\'un accompagnateur' do
before do
create(:gestionnaire, administrateur: admin)
admin.reload
| Change wording: 'gestionnaire' to 'accompagnateur'
|
diff --git a/db/data_migration/20121112123217_reset_topic_slugs.rb b/db/data_migration/20121112123217_reset_topic_slugs.rb
index abc1234..def5678 100644
--- a/db/data_migration/20121112123217_reset_topic_slugs.rb
+++ b/db/data_migration/20121112123217_reset_topic_slugs.rb
@@ -0,0 +1,19 @@+Topic.transaction do
+ topic_slugs = Topic.all.map { |t| [t.name.parameterize, t.slug] }
+ discrepancies = topic_slugs.select { |a, b| a != b }
+ puts "Topic discrepancies before: #{discrepancies.count}, #{discrepancies.inspect}"
+
+ Topic.find_each do |topic|
+ topic.remove_from_search_index
+ def topic.should_generate_new_friendly_id?
+ true
+ end
+ topic.save!
+ end
+
+ topic_slugs = Topic.all.map { |t| [t.name.parameterize, t.slug] }
+ discrepancies = topic_slugs.select { |a, b| a != b }
+ puts "Topic discrepancies after: #{discrepancies.count}, #{discrepancies.inspect}"
+
+ raise ActiveRecord::Rollback if discrepancies.any?
+end
| Reset topic slugs to match title.
As outlined in the story, we don't care about redirections. This
data migration will fail and rollback if we haven't managed to
completely remove any discrepancies.
|
diff --git a/test/test_configuration.rb b/test/test_configuration.rb
index abc1234..def5678 100644
--- a/test/test_configuration.rb
+++ b/test/test_configuration.rb
@@ -5,20 +5,24 @@ require 'helper'
describe 'Configuration' do
- it 'uses the passed-in custom settings' do
- custom_settings = {
- 'paths' => {
- 'archives' => 'arc'
- },
+ describe 'with passed-in values' do
+ subject do
+ custom_settings = {
+ 'paths' => {
+ 'archives' => 'arc'
+ },
- 'layouts' => {
- 'category' => 'cat'
+ 'layouts' => {
+ 'category' => 'cat'
+ }
}
- }
- @config = Dimples::Configuration.new(custom_settings)
+ Dimples::Configuration.new(custom_settings)
+ end
- @config['paths']['archives'].must_equal('arc')
- @config['layouts']['category'].must_equal('cat')
+ it 'overrides the defaults' do
+ subject['paths']['archives'].must_equal('arc')
+ subject['layouts']['category'].must_equal('cat')
+ end
end
end
| Tweak the layout of the configuration tests.
|
diff --git a/deployment/puppet/osnailyfacter/modular/memcached/memcached_post.rb b/deployment/puppet/osnailyfacter/modular/memcached/memcached_post.rb
index abc1234..def5678 100644
--- a/deployment/puppet/osnailyfacter/modular/memcached/memcached_post.rb
+++ b/deployment/puppet/osnailyfacter/modular/memcached/memcached_post.rb
@@ -5,13 +5,14 @@ assert TestCommon::Process.running?('memcached'), 'Memcached is not running!'
end
- def test_memcached_on_internal
- ip = TestCommon::Settings.internal_address
+ def get_node
+ metadata = TestCommon::Settings.network_metadata
+ node_name = TestCommon::Settings.node_name
+ return metadata['nodes'][node_name]
+ end
+
+ def test_memcached_listen
+ ip = get_node['network_roles']['mgmt/memcache']
assert TestCommon::Network.connection?(ip, 11211), 'Cannot connect to memcached on the internal address!'
end
-
- def test_memcached_no_public
- ip = TestCommon::Settings.public_address
- assert TestCommon::Network.no_connection?(ip, 11211), 'Memcached should not be accessible from the public network!'
- end
end
| Change the way to reach internal and public addresses from test
There is no internal address in TestCommon, so we need to introduce our
own one.
Change-Id: I104e4a758d97ca622b8ca643d0e2a8638815d5a4
Closes-Bug: #1523585
|
diff --git a/ruboty-moromizato.gemspec b/ruboty-moromizato.gemspec
index abc1234..def5678 100644
--- a/ruboty-moromizato.gemspec
+++ b/ruboty-moromizato.gemspec
@@ -21,5 +21,6 @@ spec.add_runtime_dependency 'ruboty'
spec.add_development_dependency 'bundler', '~> 1.6'
spec.add_development_dependency 'rake', '~> 10.0'
+ spec.add_development_dependency 'rspec'
spec.add_development_dependency 'simplecov'
end
| Fix gemspec. Add rspec dev dependency
|
diff --git a/db/migrate/20130612144255_create_csv_import_templates.rb b/db/migrate/20130612144255_create_csv_import_templates.rb
index abc1234..def5678 100644
--- a/db/migrate/20130612144255_create_csv_import_templates.rb
+++ b/db/migrate/20130612144255_create_csv_import_templates.rb
@@ -1,7 +1,7 @@ class CreateCsvImportTemplates < ActiveRecord::Migration
def up
create_table :csv_import_templates do |t|
- t.attachment :config_file
+ t.attachment :template_file
t.references :project
t.references :user
t.timestamps
| Change csv_import_templates file column back to template_file historically
|
diff --git a/db/migrate/20130927133039_add_content_type_to_replies.rb b/db/migrate/20130927133039_add_content_type_to_replies.rb
index abc1234..def5678 100644
--- a/db/migrate/20130927133039_add_content_type_to_replies.rb
+++ b/db/migrate/20130927133039_add_content_type_to_replies.rb
@@ -1,6 +1,6 @@ class AddContentTypeToReplies < ActiveRecord::Migration
def change
- add_column :replies, :content_type, :text, default: 'markdown'
- add_column :tickets, :content_type, :text, default: 'html'
+ add_column :replies, :content_type, :text
+ add_column :tickets, :content_type, :text
end
end
| Remove default content type for MySQL people |
diff --git a/lib/definitions/collectd/openvpn.rb b/lib/definitions/collectd/openvpn.rb
index abc1234..def5678 100644
--- a/lib/definitions/collectd/openvpn.rb
+++ b/lib/definitions/collectd/openvpn.rb
@@ -4,7 +4,7 @@ metric "openvpn_network_#{type}" do
rrd %r{openvpn-(?<file>[a-zA-Z0-9.\-]+)/if_octets-(?<user>[a-zA-Z0-9.\-]+).rrd}
ds type
- title "iOpenVPN trafic #{type.upcase} for $user"
+ title "OpenVPN trafic #{type.upcase} for $user"
end
end
| Fix typo in OpenVPN definition
|
diff --git a/SPChart.podspec b/SPChart.podspec
index abc1234..def5678 100644
--- a/SPChart.podspec
+++ b/SPChart.podspec
@@ -1,6 +1,6 @@ Pod::Spec.new do |s|
s.name = "SPChart"
- s.version = "0.3.2"
+ s.version = "0.3.1"
s.summary = "A simple, animated and beatiful chart library used in Spreaker for iPhone app."
@@ -17,4 +17,4 @@
s.frameworks = 'CoreGraphics', 'Foundation', 'UIKit', 'QuartzCore'
s.requires_arc = true
-end
+end | Revert "Version bump to 0.3.2"
This reverts commit f180b5bc9c4b60f52f41b843416a34e0f04c3a28.
|
diff --git a/lib/facter/system_python_version.rb b/lib/facter/system_python_version.rb
index abc1234..def5678 100644
--- a/lib/facter/system_python_version.rb
+++ b/lib/facter/system_python_version.rb
@@ -0,0 +1,7 @@+require 'puppet'
+pkg = Puppet::Type.type(:package).new(:name => "python")
+Facter.add("system_python_version") do
+ setcode do
+ /^(\d+\.\d+\.\d+).*$/.match(pkg.retrieve[pkg.property(:ensure)])[1]
+ end
+end
| Add system wide default python version to facter
|
diff --git a/lib/autoprefixer-rails/railtie.rb b/lib/autoprefixer-rails/railtie.rb
index abc1234..def5678 100644
--- a/lib/autoprefixer-rails/railtie.rb
+++ b/lib/autoprefixer-rails/railtie.rb
@@ -16,24 +16,27 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
=end
-require 'sprockets/railtie'
+begin
+ require 'sprockets/railtie'
-module AutoprefixedRails
- class Railtie < ::Rails::Railtie
- rake_tasks do |app|
- require 'rake/autoprefixer_tasks'
- Rake::AutoprefixerTasks.new(browsers(app))
- end
+ module AutoprefixedRails
+ class Railtie < ::Rails::Railtie
+ rake_tasks do |app|
+ require 'rake/autoprefixer_tasks'
+ Rake::AutoprefixerTasks.new(browsers(app))
+ end
- initializer :setup_autoprefixer do |app|
- AutoprefixerRails.install(app.assets, browsers(app))
- end
+ initializer :setup_autoprefixer do |app|
+ AutoprefixerRails.install(app.assets, browsers(app))
+ end
- # Read browsers requirements from application config
- def browsers(app)
- file = app.root.join('config/autoprefixer.yml')
- config = file.exist? ? YAML.load_file(file) : { 'browsers' => nil }
- config['browsers']
+ # Read browsers requirements from application config
+ def browsers(app)
+ file = app.root.join('config/autoprefixer.yml')
+ config = file.exist? ? YAML.load_file(file) : { 'browsers' => nil }
+ config['browsers']
+ end
end
end
+rescue LoadError
end
| Fix Rails initializer without Sprockets
|
diff --git a/lib/yard/code_objects/root_object.rb b/lib/yard/code_objects/root_object.rb
index abc1234..def5678 100644
--- a/lib/yard/code_objects/root_object.rb
+++ b/lib/yard/code_objects/root_object.rb
@@ -2,6 +2,7 @@ module CodeObjects
class RootObject < ModuleObject
def path; "" end
+ def inspect; "#<yardoc root>" end
end
end
end | Add inspect for root object to not show path (since it's empty)
|
diff --git a/lib/controllers/frontend/spree/users_controller.rb b/lib/controllers/frontend/spree/users_controller.rb
index abc1234..def5678 100644
--- a/lib/controllers/frontend/spree/users_controller.rb
+++ b/lib/controllers/frontend/spree/users_controller.rb
@@ -1,5 +1,5 @@ class Spree::UsersController < Spree::StoreController
- skip_before_action :set_current_order, only: :show
+ skip_before_action :set_current_order, only: :show, raise: false
prepend_before_action :load_object, only: [:show, :edit, :update]
prepend_before_action :authorize_actions, only: :new
| Stop raising exception for undefined callback
The specs against Solidus master are failing because `set_current_order`
is not defined as a process_action callback. This used to be the case
but Solidus has removed this and slated it for v2.4.
For compatibility with older versions of Solidus, we should not raise an
ArgumentError if this callback is not defined but still skip it if it
is.
PR removing this callback:
https://github.com/solidusio/solidus/pull/2185
|
diff --git a/Objection.podspec b/Objection.podspec
index abc1234..def5678 100644
--- a/Objection.podspec
+++ b/Objection.podspec
@@ -1,9 +1,9 @@ Pod::Spec.new do |s|
- s.name = 'Objection'
- s.version = '1.3.1'
+ s.name = 'Objection-SethLab'
+ s.version = '1.3.2'
s.summary = 'A lightweight dependency injection framework for Objective-C.'
s.author = { 'Justin DeWind' => 'dewind@atomicobject.com' }
- s.source = { :git => 'https://github.com/atomicobject/objection.git', :tag => "#{s.version}" }
+ s.source = { :git => 'https://github.com/sethew/objection.git', :tag => "#{s.version}" }
s.homepage = 'http://www.objection-framework.org'
s.source_files = 'Source'
s.license = "https://github.com/atomicobject/objection/blob/master/LICENSE"
| Update podspec for temporary use until if/when provider scope capability is merged to trunk
|
diff --git a/lib/idiom/microsoft_translator.rb b/lib/idiom/microsoft_translator.rb
index abc1234..def5678 100644
--- a/lib/idiom/microsoft_translator.rb
+++ b/lib/idiom/microsoft_translator.rb
@@ -7,12 +7,19 @@ # "http://api.microsofttranslator.com/V2/Http.svc/Translate?to=#{code}&text=#{}&appId=2CEF8B6B9CA38C6C8355B154C760C28A66E4339F"
appId = CONFIG["appId"]
- result = Net::HTTP.get(URI.parse("http://api.microsofttranslator.com/V2/Http.svc/Translate?to=#{code}&text=#{value}&appId=#{appId}"))
+ url = "http://api.microsofttranslator.com/V2/Http.svc/Translate?to=#{code}&text=#{value}&appId=#{appId}"
+ result = Net::HTTP.get(URI.parse(url))
if result =~ /<string xmlns=\"http:\/\/schemas.microsoft.com\/2003\/10\/Serialization\/\">(.*)<\/string>/
output = $1
end
+ if result =~ /Message: (.*)/
+ $stdout.puts(result)
+ end
+ if result =~ /AppId is over the quota/
+ raise "AppId is over the quota"
+ end
output.to_s
end
end
-end+end
| Raise error if over the quota
|
diff --git a/app/controllers/admin/system_emails_controller.rb b/app/controllers/admin/system_emails_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/admin/system_emails_controller.rb
+++ b/app/controllers/admin/system_emails_controller.rb
@@ -4,7 +4,7 @@
def index
@system_emails = {
- proposal_notification_digest: %w(view preview_pending)
+ proposal_notification_digest: %w[view preview_pending],
}
end
| Use preferred format for array of strings
|
diff --git a/app/models/manager_refresh/inventory/collector.rb b/app/models/manager_refresh/inventory/collector.rb
index abc1234..def5678 100644
--- a/app/models/manager_refresh/inventory/collector.rb
+++ b/app/models/manager_refresh/inventory/collector.rb
@@ -1,9 +1,14 @@ class ManagerRefresh::Inventory::Collector
- attr_accessor :manager
- attr_accessor :target
+ attr_accessor :manager, :target
+ # @param manager [ManageIQ::Providers::BaseManager] A manager object
+ # @param target [ActiveRecord|Hash] A refresh Target object
def initialize(manager, target)
@manager = manager
@target = target
end
+
+ def options
+ @options ||= Settings.ems_refresh[manager.class.ems_type]
+ end
end
| Modify Collector base class to align with Amazon usecase
Modify Collector base class to align with Amazon usecase
|
diff --git a/app/models/open_conference_ware/authentication.rb b/app/models/open_conference_ware/authentication.rb
index abc1234..def5678 100644
--- a/app/models/open_conference_ware/authentication.rb
+++ b/app/models/open_conference_ware/authentication.rb
@@ -29,6 +29,16 @@ uid: auth_hash.uid
)
+ # Upgrade Google OpenID users
+ if auth.user.nil? && auth.provider == 'google_oauth2' && auth_hash.extra.id_info.present?
+ old_openid_auth = Authentication.find_by(
+ provider: 'open_id',
+ uid: auth_hash.extra.id_info
+ )
+
+ auth.user = old_openid_auth.user
+ end
+
auth.name = auth_hash.info.name
auth.email = auth_hash.info.email
auth.info = auth_hash.info
| Support upgrading Google OpenID users when using the google_oauth2 provider |
diff --git a/spec/features/votes_features_spec.rb b/spec/features/votes_features_spec.rb
index abc1234..def5678 100644
--- a/spec/features/votes_features_spec.rb
+++ b/spec/features/votes_features_spec.rb
@@ -0,0 +1,54 @@+require 'spec_helper'
+
+describe "VoteFeatures" do
+ before(:all) do
+ @idea = create(:idea)
+ @user = create(:user)
+ @user.confirm!
+ visit new_user_session_path
+ fill_in "Email", :with => "#{@user.email}"
+ fill_in "Password", :with => "#{@user.password}"
+ click_button "Sign in"
+ end
+
+ before(:each) do
+ visit idea_path(@idea)
+ end
+
+ describe "Vote on an idea" do
+ it "creates a new vote on an idea" do
+ # puts Vote.find(@idea.id, @user.id).inspect
+
+ click_link "Vote Up"
+ expect(page).to have_content("Your vote was saved")
+ end
+
+ # it "changes a vote's value down" do
+ # puts Vote.find(@idea.id, @user.id).inspect
+
+ # click_link "Vote Down"
+ # expect(page).to have_content("Your vote was saved")
+ # end
+
+ # it "changes a vote's value up" do
+ # puts Vote.find(@idea.id, @user.id).inspect
+
+ # click_link "Vote Up"
+ # expect(page).to have_content("Your vote was saved")
+ # end
+ # end
+
+ # describe "Remove a vote on an idea" do
+
+ # before(:all) do
+ # create(:vote, :user_id => @user.id, :idea_id => @idea.id)
+ # end
+
+ # it "removes a vote" do
+ # puts Vote.find(@idea.id, @user.id).inspect
+
+ # click_link "Delete Vote"
+ # expect(page).to have_content("Your vote was removed")
+ # end
+ end
+end
| Add some (breaking) Vote feature specs
Create some feature specs for testing voting functionality. Currently,
tests break for one reason or another when all four are enabled.
One issue is that these specs expect to be executed in a particular
order, which they shouldn't be so they'll have to be adjusted.
Additionally, the votes controller appears to be behaving a little
strangely. The view rendered after voting doesn't always appear to be
up to date and needs to be refreshed.
TODO:
* Fix Votes controller/Idea vote counting to render correct content
* Fix Vote feature specs to perform the correct actions for testing
|
diff --git a/spec/robots/goal_robot_first_spec.rb b/spec/robots/goal_robot_first_spec.rb
index abc1234..def5678 100644
--- a/spec/robots/goal_robot_first_spec.rb
+++ b/spec/robots/goal_robot_first_spec.rb
@@ -0,0 +1,8 @@+require "spec_helper"
+require_relative "../shared_examples/solver_shared_examples"
+
+module Robots
+ describe Solvers::GoalRobotFirst do
+ it_should_behave_like "a solver"
+ end
+end
| Add a spec for the GoalRobotFirst solver
|
diff --git a/spec/unit/defines/tablespace_spec.rb b/spec/unit/defines/tablespace_spec.rb
index abc1234..def5678 100644
--- a/spec/unit/defines/tablespace_spec.rb
+++ b/spec/unit/defines/tablespace_spec.rb
@@ -10,5 +10,10 @@ let :title do
'test'
end
+ let :params do
+ {
+ :location => '/srv/data/foo',
+ }
+ end
it { should include_class("postgresql::params") }
end
| Include location in postgresql::tablespace test
Signed-off-by: Ken Barber <470bc578162732ac7f9d387d34c4af4ca6e1b6f7@bob.sh>
|
diff --git a/spec/workers/question_worker_spec.rb b/spec/workers/question_worker_spec.rb
index abc1234..def5678 100644
--- a/spec/workers/question_worker_spec.rb
+++ b/spec/workers/question_worker_spec.rb
@@ -40,5 +40,16 @@ .to(4)
)
end
+
+ it "does not send questions to banned users" do
+ user.followers.first.ban
+
+ expect { subject }
+ .to(
+ change { Inbox.where(user_id: user.followers.ids, question_id: question_id, new: true).count }
+ .from(0)
+ .to(4)
+ )
+ end
end
end
| Add test for sending questions to banned users
|
diff --git a/lib/tasks/load_legacy_mappings.rake b/lib/tasks/load_legacy_mappings.rake
index abc1234..def5678 100644
--- a/lib/tasks/load_legacy_mappings.rake
+++ b/lib/tasks/load_legacy_mappings.rake
@@ -1,29 +1,26 @@ desc "Populate legacy_taxons links for each topic taxon according to a CSV"
task :load_legacy_mappings, [:csv_path] => :environment do |_t, args|
- mapping = Hash.new { |h, k| h[k] = [] }
+ mapping = {}
CSV.foreach(args[:csv_path]) do |row|
- mapping[row[1]] << row[0].match(/.+\[(.+)\]/)[1]
+ mapping[row[0]] = row[1].split("|")
end
api = Services.publishing_api
api.client.options[:timeout] = 30
- mapping.each do |topic_taxon, legacy_taxons|
+ mapping.each do |topic_taxon_id, legacy_taxons|
begin
- topic_taxon_id = api.lookup_content_id(base_path: topic_taxon)
- raise "Lookup failed for #{topic_taxon}" unless topic_taxon_id
-
legacy_taxon_ids = api.lookup_content_ids(base_paths: legacy_taxons)
missing_legacy_taxons = legacy_taxons - legacy_taxon_ids.keys
raise "Lookup failed for #{missing_legacy_taxons}" if missing_legacy_taxons.any?
- puts "Adding #{legacy_taxons.count} legacy taxons for #{topic_taxon}"
+ puts "Adding #{legacy_taxons.count} legacy taxons for #{topic_taxon_id}"
api.patch_links(topic_taxon_id,
links: { legacy_taxons: legacy_taxon_ids.values },
bulk_publishing: true)
rescue StandardError => e
- STDERR.puts "Failed to patch #{topic_taxon}: #{e.message}"
+ STDERR.puts "Failed to patch #{topic_taxon_id}: #{e.message}"
end
end
end
| Update the load legacy mappings rake task
Change the format to be a CSV with two columns, the first being the
taxon content_id, and the second being a | separated list of the
base_paths for the legacy taxons.
|
diff --git a/lib/virgin_stats/network_monitor.rb b/lib/virgin_stats/network_monitor.rb
index abc1234..def5678 100644
--- a/lib/virgin_stats/network_monitor.rb
+++ b/lib/virgin_stats/network_monitor.rb
@@ -16,13 +16,19 @@ def start
log("Starting monitoring")
@last_network_status_online = NetworkMonitor::ping_succeeds?
+ @loop_count = 0
log("Initial status: %s" % (@last_network_status_online ? "online" : "OFFline"))
while(1)
+ @loop_count += 1
sleep(@@sleep_duration)
current_net_status_online = NetworkMonitor::ping_succeeds?
if current_net_status_online != @last_network_status_online
log("Network status changed to: %s" % (current_net_status_online ? "online" : "OFFline"))
@last_network_status_online = current_net_status_online
+ else
+ if @loop_count % 100 == 0
+ log("Monitoring in progress (%d pings performed)" % @loop_count)
+ end
end
end
end
@@ -33,7 +39,9 @@
def log(msg)
File.open(@log_file_name, "a") do |f|
- f.puts("[%s] %s" % [formatted_current_time, msg])
+ s = "[%s] %s" % [formatted_current_time, msg]
+ f.puts(s)
+ puts(s)
end
end
end
| Print log messages to console, add message to ensure script is running
|
diff --git a/coopr-provisioner/worker/spec/spec_helper.rb b/coopr-provisioner/worker/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/coopr-provisioner/worker/spec/spec_helper.rb
+++ b/coopr-provisioner/worker/spec/spec_helper.rb
@@ -1,9 +1,7 @@-require 'simplecov'
-SimpleCov.start do
- add_filter '/spec/'
-end
-
-require 'rspec/autorun'
+# require 'simplecov'
+# SimpleCov.start do
+# add_filter '/spec/'
+# end
require_relative '../automator'
require_relative '../pluginmanager'
| Remove deprecated rspec/autorun require and comment out coverage report
|
diff --git a/spec/github_push_resource_spec.rb b/spec/github_push_resource_spec.rb
index abc1234..def5678 100644
--- a/spec/github_push_resource_spec.rb
+++ b/spec/github_push_resource_spec.rb
@@ -4,9 +4,10 @@
let(:app) { Citrus::Web::Application.new.webmachine }
let(:push_data) { File.read(File.expand_path(File.join(File.dirname(__FILE__), 'payload.json'))) }
+ let(:payload) { URI.encode_www_form(payload: push_data) }
it 'should accept POST request with github push data in application/json' do
- post '/github_push', body: push_data
+ post '/github_push', body: payload
expect(response.code).to eq(204)
end
| Fix spec to send form-encoded push data like github.
|
diff --git a/spec/knapsack/task_loader_spec.rb b/spec/knapsack/task_loader_spec.rb
index abc1234..def5678 100644
--- a/spec/knapsack/task_loader_spec.rb
+++ b/spec/knapsack/task_loader_spec.rb
@@ -2,10 +2,12 @@ describe '#load_tasks' do
let(:rspec_rake_task_path) { "#{Knapsack.root}/lib/tasks/knapsack_rspec.rake" }
let(:cucumber_rake_task_path) { "#{Knapsack.root}/lib/tasks/knapsack_cucumber.rake" }
+ let(:minitest_rake_task_path) { "#{Knapsack.root}/lib/tasks/knapsack_minitest.rake" }
it do
expect(subject).to receive(:import).with(rspec_rake_task_path)
expect(subject).to receive(:import).with(cucumber_rake_task_path)
+ expect(subject).to receive(:import).with(minitest_rake_task_path)
subject.load_tasks
end
end
| Fix spec for task loader
|
diff --git a/spec/lib/validates_subset_spec.rb b/spec/lib/validates_subset_spec.rb
index abc1234..def5678 100644
--- a/spec/lib/validates_subset_spec.rb
+++ b/spec/lib/validates_subset_spec.rb
@@ -0,0 +1,31 @@+require_relative '../../lib/validates_subset'
+
+module ActiveModel
+ module Validations
+ describe SubsetValidator do
+ describe '#initialize' do
+ let(:options) { { attributes: [:thing], foo: :bar, subset: [] } }
+ subject { described_class.new(options) }
+
+ it 'sets the options instance variable' do
+ expect(subject.instance_variable_get(:@options)).to_not be_nil
+ end
+
+ it 'removes the attributes from the options' do
+ expect(subject.instance_variable_get(:@options)).to_not have_key(:attributes)
+ end
+
+ it 'adds a message to the options' do
+ expect(subject.instance_variable_get(:@options)).to have_key(:message)
+ expect(subject.instance_variable_get(:@options)[:message]).to_not be_blank
+ end
+ end
+
+ describe '#validate_each' do
+ end
+ end
+
+ describe '.validate_subset' do
+ end
+ end
+end
| Create unit test spec for validation class
Unit testing of methods on validation class: SubsetValidator
initialize method tested
|
diff --git a/spec/slim_command_factory_spec.rb b/spec/slim_command_factory_spec.rb
index abc1234..def5678 100644
--- a/spec/slim_command_factory_spec.rb
+++ b/spec/slim_command_factory_spec.rb
@@ -0,0 +1,13 @@+require "spec_helper"
+
+include Strut
+
+describe SlimCommandFactory do
+ it 'increments command IDs' do
+ sut = SlimCommandFactory.new
+ import_command = sut.make_import_command(nil, "my_namespace")
+ make_command = sut.make_make_command(nil, "instance", "class")
+ expect(import_command.id).to eq("1")
+ expect(make_command.id).to eq("2")
+ end
+end
| Test that command factory increments command IDs.
|
diff --git a/RedditKit.podspec b/RedditKit.podspec
index abc1234..def5678 100644
--- a/RedditKit.podspec
+++ b/RedditKit.podspec
@@ -2,7 +2,8 @@ s.name = "RedditKit"
s.version = "1.0.2"
s.summary = "An Objective-C wrapper for the reddit API."
- s.homepage = "http://redditkit.com/"
+ s.homepage = "https://github.com/samsymons/RedditKit"
+ s.social_media_url = "https://twitter.com/sam_symons"
s.license = 'MIT'
s.author = { "Sam Symons" => "sam@samsymons.com" }
s.source = { :git => "https://github.com/samsymons/RedditKit.git", :tag => s.version.to_s }
| Update the social media URL and homepage for the podspec.
|
diff --git a/attributes/default.rb b/attributes/default.rb
index abc1234..def5678 100644
--- a/attributes/default.rb
+++ b/attributes/default.rb
@@ -11,6 +11,6 @@ 'pkgsrc_release' => 'pkgsrc_2012Q1',
'repos' => {
'pk' => 'git://github.com/textdrive/pk.git',
- 'pkgsrc' => 'git://github.com/joyent/pkgsrc.git'
+ 'pkgsrc' => 'git://github.com/textdrive/pkgsrc.git'
}
}
| Use textdrive's clone of the pkgsrc repo to fix the gitmodules issue once and for all
Signed-off-by: Jacques Marneweck <381be0093c78dc23f52ac7a2357c8db4d86635b1@powertrip.co.za>
|
diff --git a/attributes/default.rb b/attributes/default.rb
index abc1234..def5678 100644
--- a/attributes/default.rb
+++ b/attributes/default.rb
@@ -4,7 +4,11 @@
case node['platform_family']
when "windows"
- default['zabbix']['etc_dir'] = File.join(ENV['ProgramFiles'], "Zabbix Agent")
+ if ENV['ProgramFiles'] == ENV['ProgramFiles(x86)']
+ default['zabbix']['etc_dir'] = File.join(ENV['homedrive'], "Program Files", "Zabbix Agent")
+ else
+ default['zabbix']['etc_dir'] = File.join(ENV['ProgramFiles'], "Zabbix Agent")
+ end
else
default['zabbix']['etc_dir'] = "/etc/zabbix"
end
| Fix path in wow64 env
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.