diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/APIClient.podspec b/APIClient.podspec
index abc1234..def5678 100644
--- a/APIClient.podspec
+++ b/APIClient.podspec
@@ -1,6 +1,6 @@ Pod::Spec.new do |s|
s.name = "APIClient"
- s.version = "0.1.0"
+ s.version = "0.2.0-pre"
s.summary = "Convention over configuration REST API client"
s.homepage = "https://github.com/klaaspieter/apiclient"
s.license = 'MIT'
|
Update the version number in the podspec
|
diff --git a/activesupport/lib/active_support/core_ext/module/attr_accessor_with_default.rb b/activesupport/lib/active_support/core_ext/module/attr_accessor_with_default.rb
index abc1234..def5678 100644
--- a/activesupport/lib/active_support/core_ext/module/attr_accessor_with_default.rb
+++ b/activesupport/lib/active_support/core_ext/module/attr_accessor_with_default.rb
@@ -7,11 +7,11 @@ # attr_accessor_with_default :age, 25
# end
#
- # some_person.age
- # => 25
- # some_person.age = 26
- # some_person.age
- # => 26
+ # person = Person.new
+ # person.age # => 25
+ #
+ # person.age = 26
+ # person.age # => 26
#
# To give attribute <tt>:element_name</tt> a dynamic default value, evaluated
# in scope of self:
|
Improve clarity of example. Make it follow guidelines for output display.
|
diff --git a/lib/alephant/renderer/engines/mustache.rb b/lib/alephant/renderer/engines/mustache.rb
index abc1234..def5678 100644
--- a/lib/alephant/renderer/engines/mustache.rb
+++ b/lib/alephant/renderer/engines/mustache.rb
@@ -40,7 +40,7 @@ def load_translations_from(base_path)
if I18n.load_path.empty?
I18n.config.enforce_available_locales = false
- I18n.load_path << i18n_load_path_from(base_path)
+ I18n.load_path = i18n_load_path_from(base_path)
I18n.backend.load_translations
end
end
|
Set load path to the resulting array of locales rather than pushing the array into the load path array
|
diff --git a/spec/helpers/file_helper.rb b/spec/helpers/file_helper.rb
index abc1234..def5678 100644
--- a/spec/helpers/file_helper.rb
+++ b/spec/helpers/file_helper.rb
@@ -7,7 +7,7 @@ end
def destroy_file(filename="ConstellationFile")
- File.delete(filename)
+ File.delete(filename) if File.exists?(filename)
end
end
|
Delete file only if it exists
|
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
@@ -6,40 +6,38 @@
def plain_text_message(options)
setup_recipients(options)
- from 'test@mailsafe.org'
- subject "Plain text Message Test"
- body "Here is the message body."
+ mail(from: 'test@mailsafe.org',
+ subject: "Plain text Message Test") do |format|
+ format.text { render text: "Here is the message body." }
+ end
end
def html_message(options)
setup_recipients(options)
- from 'test@mailsafe.org'
- subject "Html Message Test"
- body "<p>Here is the message body.</p>"
- content_type 'text/html'
-
- body(body.html_safe) if body.respond_to?(:html_safe)
+ body = "<p>Here is the message body.</p>"
+ body = body.html_safe if body.respond_to?(:html_safe)
+ mail(from: 'test@mailsafe.org',
+ subject: "Html Message Test") do |format|
+ format.html { render text: body }
+ end
end
def multipart_message(options)
setup_recipients(options)
- from 'test@mailsafe.org'
- subject "Html Message Test"
-
- content_type 'multipart/alternative'
-
- part :content_type => 'text/plain', :body => "Here is the message body."
-
html_body = "<p>Here is the message body.</p>"
html_body = html_body.html_safe if html_body.respond_to?(:html_safe)
- part :content_type => 'text/html', :body => html_body
+ mail(from: 'test@mailsafe.org',
+ subject: "Html Message Test") do |format|
+ format.text { render text: "Here is the message body." }
+ format.html { render text: html_body }
+ end
end
protected
def setup_recipients(options)
- recipients options[:to]
- cc options[:cc]
- bcc options[:bcc]
+ mail(to: options[:to],
+ cc: options[:cc],
+ bcc: options[:bcc])
end
end
|
Update to work with newer versions of ActionMailer
|
diff --git a/test/integration/default/squid_spec.rb b/test/integration/default/squid_spec.rb
index abc1234..def5678 100644
--- a/test/integration/default/squid_spec.rb
+++ b/test/integration/default/squid_spec.rb
@@ -3,3 +3,13 @@ expect(port(3128)).to be_listening
end
end
+
+squid_syntax_check = 'sudo squid -k parse'
+if os[:family] == 'debian'
+ squid_syntax_check = 'sudo squid3 -k parse'
+end
+
+describe command(squid_syntax_check) do
+ its('exit_status') { should eq 0 }
+ its('stderr') { should_not match /WARNING/ }
+end
|
Test no warnings are printed on startup
Signed-off-by: Giovanni Toraldo <b1c1d8736f20db3fb6c1c66bb1455ed43909f0d8@gionn.net>
|
diff --git a/lib/generators/templates/access_policy.rb b/lib/generators/templates/access_policy.rb
index abc1234..def5678 100644
--- a/lib/generators/templates/access_policy.rb
+++ b/lib/generators/templates/access_policy.rb
@@ -24,7 +24,7 @@ # role :member, proc { |user| user.registered? } do
# can :create, Post
# can :create, Comment
- # can [:update, :destroy], Post do |post|
+ # can [:update, :destroy], Post do |post, user|
# post.author == user
# end
# end
|
Update template to reflect breaking changes in 1.0
|
diff --git a/lib/tasks/gitlab/bulk_add_permission.rake b/lib/tasks/gitlab/bulk_add_permission.rake
index abc1234..def5678 100644
--- a/lib/tasks/gitlab/bulk_add_permission.rake
+++ b/lib/tasks/gitlab/bulk_add_permission.rake
@@ -7,9 +7,9 @@
Project.find_each do |project|
puts "Importing #{user_ids.size} users into #{project.code}"
- UsersProject.bulk_import(project, user_ids, UsersProject::DEVELOPER)
+ UsersProject.add_users_into_projects(project, user_ids, UsersProject::DEVELOPER)
puts "Importing #{admin_ids.size} admins into #{project.code}"
- UsersProject.bulk_import(project, admin_ids, UsersProject::MASTER)
+ UsersProject.add_users_into_projects(project, admin_ids, UsersProject::MASTER)
end
end
@@ -18,7 +18,7 @@ user = User.find_by_email args.email
project_ids = Project.pluck(:id)
- UsersProject.user_bulk_import(user, project_ids, UsersProject::DEVELOPER)
+ UsersProject.add_users_into_projects(user, project_ids, UsersProject::DEVELOPER)
end
end
end
|
Fix rake task - Update method name
|
diff --git a/test/helpers_test.rb b/test/helpers_test.rb
index abc1234..def5678 100644
--- a/test/helpers_test.rb
+++ b/test/helpers_test.rb
@@ -0,0 +1,24 @@+require 'test_helper'
+
+class HelpersContext
+ include Eastwood::Helpers
+end
+
+class Eastwood::HelpersTest < ActiveSupport::TestCase
+
+ setup do
+ @context = HelpersContext.new
+ end
+
+ # application_name
+
+ test "should define application_name" do
+ assert_respond_to @context, :application_name
+ end
+ test "should return the application name" do
+ assert_equal @context.application_name, 'Dummy'
+ end
+
+
+
+end
|
Add some tests for application_name helper
|
diff --git a/test/helpers_test.rb b/test/helpers_test.rb
index abc1234..def5678 100644
--- a/test/helpers_test.rb
+++ b/test/helpers_test.rb
@@ -0,0 +1,26 @@+require 'test_helper'
+
+require 'speedflow/helpers'
+
+class TestSpeedflowHelpers < Minitest::Test
+ include Speedflow::Helpers
+
+ def setup
+ $terminal = HighLine.new(nil, (@output = StringIO.new))
+ end
+
+ def test_notice
+ assert_equal(notice('test'), nil)
+ assert_equal(@output.string, "\e[0;94;49mtest\e[0m\n")
+ end
+
+ def test_success
+ assert_equal(success('test'), nil)
+ assert_equal(@output.string, "\e[0;92;49mtest\e[0m\n")
+ end
+
+ def test_error
+ assert_equal(error('test'), nil)
+ assert_equal(@output.string, "\e[0;91;49mtest\e[0m\n")
+ end
+end
|
Fix coverage to full for helpers module
|
diff --git a/spec/config_spec.rb b/spec/config_spec.rb
index abc1234..def5678 100644
--- a/spec/config_spec.rb
+++ b/spec/config_spec.rb
@@ -9,4 +9,13 @@ config.ignore.should == ["Rakefile", "Gemfile"]
end
+ it "should handle an empty .awestruct_ignore file without barfing" do
+ site_dir = File.join(File.dirname(__FILE__), 'test-data')
+ config_file = File.join(site_dir, ".awestruct_ignore")
+ File.open(config_file, "w")
+ config = Awestruct::Config.new(site_dir)
+ config.ignore.should == []
+ File.open(config_file, "w") { |f| f.write("Rakefile\nGemfile\n") }
+ end
+
end
|
Add spec for handling an empty .awestruct_ignore file
|
diff --git a/spec/config_spec.rb b/spec/config_spec.rb
index abc1234..def5678 100644
--- a/spec/config_spec.rb
+++ b/spec/config_spec.rb
@@ -0,0 +1,30 @@+require 'spec_helper'
+
+describe Config do
+ describe '#read' do
+ context "given a valid YAML configuration file in the config path" do
+ let(:config_path) { File.join(Config.path, "sushi.yml") }
+ let(:config_data) { { "sushi" => %w[maki nigiri sashimi] } }
+
+ before :all do
+ File.open(config_path, 'w') do |f|
+ YAML::dump(config_data, f)
+ end
+ end
+
+ # Clean up after testing
+ after :all do
+ File.delete(config_path)
+ end
+
+ it "returns nil for an invalid configuration key" do
+ Config.read("this_key_will_never_exist").should be_nil
+ end
+
+ it "returns the corresponding value for a valid key" do
+ value = Config.read("sushi")
+ value.should == YAML::parse(config_path)["sushi"]
+ end
+ end
+ end
+end
|
Add failing specs for a Config class
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -14,7 +14,7 @@ when "mongo"
uri = ENV['MONGOHQ_URL'] || ENV['MONGOLAB_URI'] || ENV['BOXEN_MONGODB_URL']
- client = if uri.empty?
+ client = if uri.nil? || uri.empty?
Mongo::MongoClient.new
else
Mongo::MongoClient.from_uri(uri)
@@ -27,7 +27,7 @@ when "redis"
url = ENV['REDISTOGO_URL'] || ENV['BOXEN_REDIS_URL']
- client = if url.empty?
+ client = if uri.nil? || url.empty?
Redis.new
else
Redis.connect(:url => url)
|
Check for nil uri in addition to empty.
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -8,7 +8,6 @@ require 'rspec'
RSpec.configure do |config|
- config.treat_symbols_as_metadata_keys_with_true_values = true
config.run_all_when_everything_filtered = true
config.filter_run :focus
config.mock_with :rspec
|
Remove deprecated RSpec config setting
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,3 +1,10 @@ # Common spec-related code goes here
-STACK_OVERFLOW_DEPTH = 10000
+STACK_OVERFLOW_DEPTH = begin
+ def calculate_stack_overflow_depth(n)
+ calculate_stack_overflow_depth(n + 1)
+ rescue SystemStackError
+ n
+ end
+ calculate_stack_overflow_depth(2)
+end
|
Determine maximum stack depth at runtime.
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,3 +1,4 @@+require 'backports'
require 'dm-core/spec/lib/pending_helpers'
Spec::Runner.configure do |config|
|
Fix specs to run under 1.8.7
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -22,6 +22,14 @@ config.infer_base_class_for_anonymous_controllers = false
config.before(:each) do
+ DatabaseCleaner.strategy = :transaction
+ end
+
+ config.before(:each, :js => true) do
+ DatabaseCleaner.strategy = :truncation
+ end
+
+ config.before(:each) do
DatabaseCleaner.start
end
@@ -31,4 +39,3 @@ end
GirlFriday::Queue.immediate!
-DatabaseCleaner.strategy = :truncation
|
Use truncation cleaning strategy only for js tagged specs
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -5,3 +5,4 @@
require 'pry'
require "robinhood"
+require 'fakeweb'
|
Add fakerweb to the spec
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -6,8 +6,6 @@ $:.unshift(spec_root)
require 'net-http-last_modified_cache'
-Dir[File.join(spec_root, 'support/**/*.rb')].each { |file| require file }
-
RSpec.configure do |config|
config.filter_run :focus => true
config.run_all_when_everything_filtered = true
|
Remove unused rspec support directory loading from spec helper
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -5,6 +5,10 @@ require 'fileutils'
Spec::Runner.configure do |config|
+ config.before :suite do
+ `mkdir tmp/`
+ end
+
# Tear down test case assets folders
config.after :each do
FileUtils.rm_r( Dir[ "tmp/*" ] )
|
Set up tmp directory before specs.
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -7,7 +7,7 @@
# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
-Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
+Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
RSpec.configure do |config|
config.before(:each) do
|
Add space between { and |
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -13,9 +13,9 @@ require 'simplecov-rcov'
SimpleCov.formatter = SimpleCov::Formatter::RcovFormatter
SimpleCov.start do
- add_filter 'vendor'
- add_filter 'spec'
- add_group 'lib', 'lib/'
+ add_filter '/vendor/'
+ add_filter '/spec/'
+ add_group 'lib', 'lib'
end
end
|
Use absolute syntax on filters to avoid matching parent directories:
e.g. /home/spec/ruby_core_extensions/lib accidently matches spec when only intending to match spec within ruby_core_extensions directory
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -19,6 +19,7 @@ VCR.configure do |config|
config.cassette_library_dir = 'spec/vcr_cassettes'
config.hook_into :webmock
+ config.ignore_hosts 'codeclimate.com'
end
module Minitest
|
Fix VCR config to allow results reporting to codeclimate
|
diff --git a/app/controllers/callbacks_controller.rb b/app/controllers/callbacks_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/callbacks_controller.rb
+++ b/app/controllers/callbacks_controller.rb
@@ -3,15 +3,11 @@ def facebook
@user = User.from_omniauth(request.env["omniauth.auth"])
sign_in @user, :event => :authentication
- if !(@user.org_affiliate)
+ if !(@user.organization_id)
redirect_to new_organization_path
else
@organization = Organization.find(current_user.organization_id)
redirect_to @organization
end
end
-
- # def after_sign_up_path_for(resource)
- # new_organization_path
- # end
end
|
Add organization_id instead of org affilate in sign_in method
|
diff --git a/app/controllers/countries_controller.rb b/app/controllers/countries_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/countries_controller.rb
+++ b/app/controllers/countries_controller.rb
@@ -33,9 +33,9 @@ end
def destroy
- if @country.addresses.length
+ if @country.addresses.length > 0
flash[:notice] = 'This country cannot be removed as there are addresses that refer to this country.'
- elsif @country.orders.length
+ elsif @country.orders.length > 0
flash[:notice] = 'This country cannot be removed as there are orders that refer to this country.'
else
@country.destroy
|
Fix check for country associations
|
diff --git a/app/controllers/reminders_controller.rb b/app/controllers/reminders_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/reminders_controller.rb
+++ b/app/controllers/reminders_controller.rb
@@ -1,22 +1,19 @@ class RemindersController < ApplicationController
- before_action :find_repo
- before_action :find_reminder
-
def show
- render json: { active: !!@reminder.try(:active) }
+ render json: { active: !!reminder.try(:active) }
end
def create
- if @reminder
- @reminder.activate
+ if reminder
+ reminder.activate
else
- current_user.reminders.create(repository: @repository)
+ current_user.reminders.create(repository: repository)
end
render nothing: true
end
def update
- if @reminder && @reminder.update_attributes(params[:reminder])
+ if reminder && reminder.update_attributes(params[:reminder])
render status: 200
else
render status: 422
@@ -24,8 +21,8 @@ end
def destroy
- if @reminder
- @reminder.deactivate
+ if reminder
+ reminder.deactivate
else
not_found
end
@@ -33,12 +30,12 @@ end
private
- def find_repo
- @repository = Repository.where(owner: params[:owner], name: params[:repo]).first || not_found
+ def repository
+ @repository ||= Repository.where(owner: params[:owner], name: params[:repo]).first || not_found
end
- def find_reminder
- @reminder = Reminder.find_by_user_and_repository(current_user, @repository)
+ def reminder
+ @reminder ||= Reminder.find_by_user_and_repository(current_user, repository)
end
def reminder_params
|
Drop before_action in favor of lazy loading
accepts 5ff2e3fbb77acd074e66f00c06631eb29a161ced
|
diff --git a/cookbooks/elasticsearch/recipes/sensu_checks.rb b/cookbooks/elasticsearch/recipes/sensu_checks.rb
index abc1234..def5678 100644
--- a/cookbooks/elasticsearch/recipes/sensu_checks.rb
+++ b/cookbooks/elasticsearch/recipes/sensu_checks.rb
@@ -11,6 +11,13 @@ standalone true
end
+# Monitor the shard allocation status
+sensu_check 'check-es-shard-allocation-status' do
+ command "#{node['sensu']['directories']['base']}/plugins/sensu-yieldbot-plugins/elasticsearch/check-es-shard-allocation-status.rb"
+ handlers ['devops-orange']
+ standalone true
+end
+
# TODO: Calculate the warning/critical heap bytes based off of the current number of bytes allocated to the JVM
# # Monitor the cluster JVM heap
|
Add shard allocation status check
|
diff --git a/db/migrate/20130213162738_update_travel_advice_slugs.rb b/db/migrate/20130213162738_update_travel_advice_slugs.rb
index abc1234..def5678 100644
--- a/db/migrate/20130213162738_update_travel_advice_slugs.rb
+++ b/db/migrate/20130213162738_update_travel_advice_slugs.rb
@@ -1,15 +1,16 @@ class UpdateTravelAdviceSlugs < Mongoid::Migration
def self.up
Artefact.where(:slug => %r{\Atravel-advice/}).each do |artefact|
- artefact.slug = "foreign-#{artefact.slug}"
- artefact.save :validate => false # validate => false necessary because these will be live artefacts
+ if ! Rails.env.development? or ENV['UPDATE_SEARCH'].present?
+ Rummageable.delete("/#{artefact.slug}")
+ end
+ artefact.set(:slug, "foreign-#{artefact.slug}")
end
end
def self.down
Artefact.where(:slug => %r{\Aforeign-travel-advice/(.*)\z}).each do |artefact|
- artefact.slug = artefact.slug.sub(/\Aforeign-/, '')
- artefact.save :validate => false # validate => false necessary because these will be live artefacts
+ artefact.set(:slug, artefact.slug.sub(/\Aforeign-/, ''))
end
end
end
|
Fix slug change migration to deal with rummager update
Switch to using set methos to avoid callbacks. Will deal with re-adding
to search by re-registering everything from travel-advice-publisher
|
diff --git a/add_sources.rb b/add_sources.rb
index abc1234..def5678 100644
--- a/add_sources.rb
+++ b/add_sources.rb
@@ -7,7 +7,7 @@ successes = sources.select do |src|
puts "-------------------\nAdding #{src.inspect}\n"
if src['key_url']
- system("curl -sSL #{src['key_url'].untaint.inspect} | sudo -E apt-key add -") && system("sudo -E apt-add-repository -y #{src['sourceline'].untaint.inspect}")
+ system("curl -sSL #{src['key_url'].untaint.inspect} | sudo -E env LANG=en_US.UTF-8 apt-key add -") && system("sudo -E env LANG=en_US.UTF-8 apt-add-repository -y #{src['sourceline'].untaint.inspect}")
else
system("sudo -E apt-add-repository -y #{src['sourceline'].untaint.inspect}")
end
|
Set LANG while handling GPG keys
See http://askubuntu.com/questions/393638/unicodedecodeerror-ascii-codec-cant-decode-byte-0x-in-position-ordinal-n
|
diff --git a/postfix.rb b/postfix.rb
index abc1234..def5678 100644
--- a/postfix.rb
+++ b/postfix.rb
@@ -34,7 +34,7 @@ stack.pop
end
-trap("SIGINT") { exit! }
+trap("SIGINT") { raise Interrupt }
while true do
begin
@@ -42,6 +42,8 @@ puts from_postfix(gets.chomp!)
rescue IndexError
puts "[ERROR] malformed expression"
+ rescue Interrupt
+ break
end
end
|
Use Interrupt rather than exit!
|
diff --git a/VOKMockUrlProtocol.podspec b/VOKMockUrlProtocol.podspec
index abc1234..def5678 100644
--- a/VOKMockUrlProtocol.podspec
+++ b/VOKMockUrlProtocol.podspec
@@ -1,17 +1,18 @@ Pod::Spec.new do |s|
s.name = "VOKMockUrlProtocol"
- s.version = "2.1.1"
+ s.version = "2.2.0"
s.summary = "A url protocol that parses and returns fake responses with mock data."
s.homepage = "https://github.com/vokal/VOKMockUrlProtocol"
s.license = { :type => "MIT", :file => "LICENSE"}
s.author = { "Vokal" => "hello@vokalinteractive.com" }
s.source = { :git => "https://github.com/vokal/VOKMockUrlProtocol.git", :tag => s.version.to_s }
- s.ios.platform = :ios, '6.0'
- s.osx.platform = :osx, '10.9'
+ s.ios.deployment_target = '6.0'
+ s.tvos.deployment_target = '9.0'
+ s.osx.deployment_target = '10.9'
s.requires_arc = true
s.source_files = 'VOKMockUrlProtocol.[hm]'
s.dependency 'ILGHttpConstants', '~> 1.0.0'
- s.dependency 'VOKBenkode', '~> 0.2.1'
+ s.dependency 'VOKBenkode', '~> 0.3'
end
|
Enable tvOS as a platform and bump the version
|
diff --git a/Casks/qt-creator.rb b/Casks/qt-creator.rb
index abc1234..def5678 100644
--- a/Casks/qt-creator.rb
+++ b/Casks/qt-creator.rb
@@ -1,6 +1,6 @@ cask :v1 => 'qt-creator' do
- version '3.3.2'
- sha256 '6b44dd8e01251b485dad7d412db1898b297f129993fea74694be1d7688e845ba'
+ version '3.4.0'
+ sha256 '13a232534adf50f928ebf1ad1fde912a423cd7524d86d0c3d6a8efd321d3f858'
url "http://download.qt-project.org/official_releases/qtcreator/#{version.sub(%r{^(\d+\.\d+).*},'\1')}/#{version}/qt-creator-opensource-mac-x86_64-#{version}.dmg"
name 'Qt Creator'
|
Update QT Creator to 3.4.0
|
diff --git a/Casks/vagrant173.rb b/Casks/vagrant173.rb
index abc1234..def5678 100644
--- a/Casks/vagrant173.rb
+++ b/Casks/vagrant173.rb
@@ -0,0 +1,14 @@+cask :v1 => 'vagrant173' do
+ version '1.7.3'
+ sha256 '3c6078d8ce9a9c01589b089034f0afcbe2f4908a7f77a1471360fc8011a18dc8'
+
+ # bintray.com is the official download host per the vendor homepage
+ url "https://dl.bintray.com/mitchellh/vagrant/vagrant_#{version}.dmg"
+ homepage 'http://www.vagrantup.com'
+ license :mit
+
+ pkg 'Vagrant.pkg'
+
+ uninstall :script => { :executable => 'uninstall.tool', :input => %w[Yes] },
+ :pkgutil => 'com.vagrant.vagrant'
+end
|
Add cask for Vagrant 1.7.3
|
diff --git a/test/test_linebreaks.rb b/test/test_linebreaks.rb
index abc1234..def5678 100644
--- a/test/test_linebreaks.rb
+++ b/test/test_linebreaks.rb
@@ -0,0 +1,13 @@+require 'test_helper'
+
+class TestLinebreaks < Minitest::Test
+ def test_softbreak_no_spaces_as_hard
+ doc = Node.parse_string("foo\nbaz", :hardbreaks)
+ assert_equal "<p>Hi <em>there</em></p>\n", doc.to_html
+ end
+
+ def test_softbreak_with_spaces_as_hard
+ doc = Node.parse_string("foo \n baz", :hardbreaks)
+ assert_equal "<p>Hi <em>there</em></p>\n", doc.to_html
+ end
+end
|
Add testing for line breaks
|
diff --git a/CSNotificationView.podspec b/CSNotificationView.podspec
index abc1234..def5678 100644
--- a/CSNotificationView.podspec
+++ b/CSNotificationView.podspec
@@ -6,7 +6,8 @@ s.license = { :type => 'MIT License', :file => "LICENSE.md" }
s.author = 'Christian Schwarz'
s.source = { :git => 'https://github.com/problame/CSNotificationView.git', :tag => s.version.to_s }
- s.platform = :ios, '6.0'
+ s.platform = :ios
+ s.ios.deployment_target = "6.0"
s.requires_arc = true
s.source_files = 'CSNotificationView/*.*'
s.resources = [ 'CSNotificationView/CSNotificationView.xcassets/CSNotificationView_checkmarkIcon.imageset/CSNotificationView_checkmarkIcon.png', 'CSNotificationView/CSNotificationView.xcassets/CSNotificationView_checkmarkIcon.imageset/CSNotificationView_checkmarkIcon@2x.png', 'CSNotificationView/CSNotificationView.xcassets/CSNotificationView_exclamationMarkIcon.imageset/CSNotificationView_exclamationMarkIcon.png', 'CSNotificationView/CSNotificationView.xcassets/CSNotificationView_exclamationMarkIcon.imageset/CSNotificationView_exclamationMarkIcon@2x.png']
|
Correct usage of deployment target.
|
diff --git a/Casks/dbeaver-community.rb b/Casks/dbeaver-community.rb
index abc1234..def5678 100644
--- a/Casks/dbeaver-community.rb
+++ b/Casks/dbeaver-community.rb
@@ -1,11 +1,11 @@ cask :v1 => 'dbeaver-community' do
- version '3.3.1'
+ version '3.3.2'
if Hardware::CPU.is_32_bit?
- sha256 '0ad6a3a7011415cfb990b6027bf62b93b334a12dff9740ebc03993c9e235f332'
+ sha256 '540a8e571bf759d84bea1e7ed1b032c8b1994fda13b09d2c2a2e62c4acfb8af5'
url "http://dbeaver.jkiss.org/files/dbeaver-#{version}-macosx.cocoa.x86.zip"
else
- sha256 'f4aaf0314ff4fd1f9084f7d634566c82aac37f208161fe4d4f6f670745f3c1f7'
+ sha256 '1978e7c437dca237f6a21237f271b410d65c49d4b584bf87e4423c0d0e140c2e'
url "http://dbeaver.jkiss.org/files/dbeaver-#{version}-macosx.cocoa.x86_64.zip"
end
|
Update DBeaver community to v3.3.2
|
diff --git a/test/gtk_overrides_test.rb b/test/gtk_overrides_test.rb
index abc1234..def5678 100644
--- a/test/gtk_overrides_test.rb
+++ b/test/gtk_overrides_test.rb
@@ -10,6 +10,7 @@
should "not take any arguments" do
assert_raises(ArgumentError) { Gtk.init 1, ["foo"] }
+ assert_raises(ArgumentError) { Gtk.init ["foo"] }
assert_nothing_raised { Gtk.init }
end
|
Check Gtk.init's arity more thoroughly.
|
diff --git a/lib/docs/scrapers/apache.rb b/lib/docs/scrapers/apache.rb
index abc1234..def5678 100644
--- a/lib/docs/scrapers/apache.rb
+++ b/lib/docs/scrapers/apache.rb
@@ -3,7 +3,7 @@ self.name = 'Apache HTTP Server'
self.slug = 'apache_http_server'
self.type = 'apache'
- self.version = '2.4.12'
+ self.version = '2.4.17'
self.base_url = 'http://httpd.apache.org/docs/2.4/en/'
self.links = {
home: 'http://httpd.apache.org/'
|
Update Apache HTTP Server documentation (2.4.17)
|
diff --git a/lib/dotter/configuration.rb b/lib/dotter/configuration.rb
index abc1234..def5678 100644
--- a/lib/dotter/configuration.rb
+++ b/lib/dotter/configuration.rb
@@ -25,5 +25,15 @@ package_conf['tracked'] = true
self.save()
end
+ def publish(package)
+ package_conf = self.package_config(package)
+ package_conf['public'] = true
+ self.save()
+ end
+ def unpublish(package)
+ package_conf = self.package_config(package)
+ package_conf['public'] = false
+ self.save()
+ end
end
end
|
Add Configuration support for publishing and unpublishing packages.
|
diff --git a/schema.gemspec b/schema.gemspec
index abc1234..def5678 100644
--- a/schema.gemspec
+++ b/schema.gemspec
@@ -2,7 +2,7 @@ Gem::Specification.new do |s|
s.name = 'evt-schema'
s.summary = "Primitives for schema and data structure"
- s.version = '2.2.5.0'
+ s.version = '2.2.6.0'
s.description = ' '
s.authors = ['The Eventide Project']
|
Package version is increased from 2.2.5.0 to 2.2.6.0
|
diff --git a/spec/easemob/messages_spec.rb b/spec/easemob/messages_spec.rb
index abc1234..def5678 100644
--- a/spec/easemob/messages_spec.rb
+++ b/spec/easemob/messages_spec.rb
@@ -10,4 +10,14 @@ expect(h1['data']['u1']).to eq 'success'
end
end
+
+ describe '#command_to' do
+ it 'can sent message to user' do
+ res = Easemob.command_to 'g', target_type: :chatgroups, action: 'baye_joined'
+ expect(res.code).to eq 200
+ h1 = JSON.parse res.to_s
+ expect(h1['data']).not_to be nil
+ expect(h1['data']['g']).to eq 'success'
+ end
+ end
end
|
Add comment_to rspec test case.
|
diff --git a/lib/rabl/digestor/rails5.rb b/lib/rabl/digestor/rails5.rb
index abc1234..def5678 100644
--- a/lib/rabl/digestor/rails5.rb
+++ b/lib/rabl/digestor/rails5.rb
@@ -19,7 +19,11 @@
pre_stored = finder.digest_cache.put_if_absent(cache_key, false).nil? # put_if_absent returns nil on insertion
- finder.digest_cache[cache_key] = stored_digest = Digestor.new(name, finder, options).digest
+ finder.digest_cache[cache_key] = stored_digest = ActionView::Digestor.digest(
+ name: name,
+ finder: finder,
+ dependencies: options[:dependencies],
+ )
ensure
# something went wrong or ActionView::Resolver.caching? is false, make sure not to corrupt the @@cache
finder.digest_cache.delete_pair(cache_key, false) if pre_stored && !stored_digest
|
Fix problem of usage rabl 0.13.0 with Rails 5 and active cache
|
diff --git a/lib/rexster-ruby/rexster.rb b/lib/rexster-ruby/rexster.rb
index abc1234..def5678 100644
--- a/lib/rexster-ruby/rexster.rb
+++ b/lib/rexster-ruby/rexster.rb
@@ -35,7 +35,7 @@
def script(gremlin_script)
@script = gremlin_script
- inspect
+ self.inspect
end
def inspect
@@ -48,7 +48,7 @@ end
def to_a
- self.inspect
+ Array.wrap self.inspect
end
private
|
Make to_a behavior appropriate for all use-cases
|
diff --git a/db/seeds.rb b/db/seeds.rb
index abc1234..def5678 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -7,19 +7,19 @@ # Mayor.create(name: 'Emanuel', city: cities.first)
[
- {name: 'Taylor', avatar: 'ignore'},
- {name: 'Ben', avatar: 'ignore'},
- {name: 'Gus', avatar: 'ignore'},
- {name: 'Eddie', avatar: 'ignore'},
+ {id: 1, name: 'Taylor', avatar: 'ignore'},
+ {id: 2, name: 'Ben', avatar: 'ignore'},
+ {id: 3, name: 'Gus', avatar: 'ignore'},
+ {id: 4, name: 'Eddie', avatar: 'ignore'},
].each{|attributes| Player.create(attributes)}
-Match.create(date: Date.current)
+Match.create(id: 1, date: Date.current)
[
- {position: 0, team: 0, goals: 5, match_id: Match.first.id},
- {position: 1, team: 0, goals: 5, match_id: Match.first.id},
- {position: 0, team: 1, goals: 4, match_id: Match.first.id},
- {position: 1, team: 1, goals: 5, match_id: Match.first.id}
+ {id: 1, position: 0, team: 0, goals: 5, match_id: 1},
+ {id: 2 ,position: 1, team: 0, goals: 5, match_id: 1},
+ {id: 3, position: 0, team: 1, goals: 4, match_id: 1},
+ {id: 4, position: 1, team: 1, goals: 5, match_id: 1}
].zip(Player.all).map do |match_player_attributes, player|
match_player_attributes.merge({player_id: player.id})
end.each{|attributes| MatchPlayer.create(attributes)}
|
Fix IDs in seed data to make for easier graphiql queries
|
diff --git a/spec/plugin/multi_run_spec.rb b/spec/plugin/multi_run_spec.rb
index abc1234..def5678 100644
--- a/spec/plugin/multi_run_spec.rb
+++ b/spec/plugin/multi_run_spec.rb
@@ -6,11 +6,6 @@ r.multi_run
"c"
end
-
- body("/a").should == 'c'
- body("/b").should == 'c'
- body("/b/a").should == 'c'
- body.should == 'c'
app.run "a", Class.new(Roda).class_eval{route{"a1"}; app}
|
Work around spec issue in jruby --1.8 mode
|
diff --git a/spec/support/active_record.rb b/spec/support/active_record.rb
index abc1234..def5678 100644
--- a/spec/support/active_record.rb
+++ b/spec/support/active_record.rb
@@ -25,7 +25,7 @@ t.string :token, null: false
t.datetime :expires_at, null: false
t.integer :ttl, null: false
- t.timestamps
+ t.timestamps null: false
end
end
end
|
Add null: false to AR timestamp call
In order to prevent deprecation warning
|
diff --git a/spec/support/worker_macros.rb b/spec/support/worker_macros.rb
index abc1234..def5678 100644
--- a/spec/support/worker_macros.rb
+++ b/spec/support/worker_macros.rb
@@ -1,7 +1,27 @@ module WorkerMacros
- def uses_workers
+ def use_workers
after(:each) do
+ old = Backend.mock
+ Backend.mock = false
Backend.wait_for_all_workers
+ Backend.mock = old
+ end
+ end
+
+ def disable_mocking
+ before :each do
+ Backend.mock = false
+ end
+
+ after :each do
+ Backend.mock = true
+ end
+ end
+
+ def use_clojure_factories
+ before :each do
+ # Blocking workers skip the mock check
+ Backend.blocking_worker "circle.backend.build.test-utils/ensure-test-db"
end
end
end
|
Add new spec support that uses the backend more.
|
diff --git a/salesforce_bulk.gemspec b/salesforce_bulk.gemspec
index abc1234..def5678 100644
--- a/salesforce_bulk.gemspec
+++ b/salesforce_bulk.gemspec
@@ -5,11 +5,12 @@ Gem::Specification.new do |s|
s.name = "salesforce_bulk"
s.version = SalesforceBulk::VERSION
- s.authors = ["Jorge Valdivia"]
- s.email = ["jorge@valdivia.me"]
+ s.platform = Gem::Platform::RUBY
+ s.authors = ["Jorge Valdivia","Javier Julio"]
+ s.email = ["jorge@valdivia.me","jjfutbol@gmail.com"]
s.homepage = "https://github.com/jorgevaldivia/salesforce_bulk"
s.summary = %q{Ruby support for the Salesforce Bulk API}
- s.description = %q{This gem provides a super simple interface for the Salesforce Bulk API. It provides support for insert, update, upsert, delete, and query.}
+ s.description = %q{This gem is a simple interface to the Salesforce Bulk API providing support for insert, update, upsert, delete, and query.}
s.rubyforge_project = "salesforce_bulk"
@@ -18,10 +19,9 @@ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
- # specify any dependencies here; for example:
- # s.add_development_dependency "rspec"
- # s.add_runtime_dependency "rest-client"
-
s.add_dependency "xml-simple"
+ s.add_development_dependency "mocha"
+ s.add_development_dependency "shoulda"
+
end
|
Update gem spec with development dependencies, tweak description and add myself to authors and email lists.
|
diff --git a/app/models/curated_mark.rb b/app/models/curated_mark.rb
index abc1234..def5678 100644
--- a/app/models/curated_mark.rb
+++ b/app/models/curated_mark.rb
@@ -0,0 +1,48 @@+SUGGESTED_MARKS = [
+ {
+ name: 'Development',
+ description: 'You build webapps, develop mobile apps, implement designs, manage infrastructure, or just love doing code reviews.',
+ related_marks: [
+ 'Ruby', 'Rails', 'iOS', 'Android', 'Redis', 'JavaScript', 'Node.js',
+ 'Postgres', 'CSS', 'MongoDB', 'HTML5', 'Python', 'Backend', 'API',
+ 'Flask', 'DevOps', 'RethinkDB', 'ZeroMQ', 'Go', 'Bitcoin', 'Ember',
+ 'Clojure', 'React', 'Security'
+ ],
+ },
+ {
+ name: 'Design',
+ description: 'You spend most of your day in Photoshop. You design logos, put together wireframes and create high fidelity mockups.',
+ related_marks: [
+ 'UI', 'UX', 'Logo', 'IA', 'Homepage', 'Branding', 'Wireframe',
+ 'Photoshop', 'Responsive', 'Interface', 'Mockup', 'Blog', 'Dashboard',
+ 'Layout', 'Typography', 'Form', 'Theme', 'Illustration', 'Sketching',
+ 'Styleguide', 'Mobile', 'Color'
+ ]
+ },
+ {
+ name: 'Strategy',
+ description: 'You like thinking up marketing plans, tailoring customer experience, or giving really good feedback.',
+ related_marks: [
+ 'Copy', 'Email', 'Project Management', 'Marketing', 'Social',
+ 'Onboarding', 'Launch', 'Feedback', 'Billing', 'Ads', 'SEO',
+ 'Monetization', 'Growth', 'Research', 'Pricing', 'Naming', 'Roadmap',
+ 'Blog', 'Metrics', 'Sales', 'Newsletter'
+ ]
+ }
+]
+
+class CuratedMark
+ attr_accessor :name, :description, :related_marks
+
+ def self.all
+ SUGGESTED_MARKS.map do |mark|
+ new(mark[:name], mark[:description], mark[:related_marks])
+ end
+ end
+
+ def initialize(name, description, related_mark_names = [])
+ self.name = name
+ self.description = description
+ self.related_marks = Mark.where(name: related_mark_names)
+ end
+end
|
Put these manual lists of marks somewhere
|
diff --git a/AFNetworking-RACExtensions.podspec b/AFNetworking-RACExtensions.podspec
index abc1234..def5678 100644
--- a/AFNetworking-RACExtensions.podspec
+++ b/AFNetworking-RACExtensions.podspec
@@ -8,8 +8,22 @@ s.source = { :git => "https://github.com/CodaFi/AFNetworking-RACExtensions.git", :tag => "#{s.version}" }
s.ios.deployment_target = '6.0'
s.osx.deployment_target = '10.8'
- s.source_files = 'RACAFNetworking'
s.requires_arc = true
- s.dependency 'AFNetworking', '~> 2.0'
- s.dependency 'ReactiveCocoa', '~> 2.0'
+
+ s.subspec 'Progress' do |ss|
+ ss.dependency 'ReactiveCocoa/Core', '~> 2.0'
+ ss.source_files = 'RACAFNetworking/RACSubscriber+AFProgressCallbacks.{h,m}'
+ end
+
+ s.subspec 'NSURLConnection' do |ss|
+ ss.dependency 'AFNetworking/NSURLConnection', '~> 2.0'
+ ss.dependency 'ReactiveCocoa/Core', '~> 2.0'
+ ss.source_files = 'RACAFNetworking/AFURLConnectionOperation+RACSupport.{h,m}', 'RACAFNetworking/AFHTTPRequestOperationManager+RACSupport.{h,m}'
+ end
+
+ s.subspec 'NSURLSession' do |ss|
+ ss.dependency 'AFNetworking/NSURLSession', '~> 2.0'
+ ss.dependency 'ReactiveCocoa/Core', '~> 2.0'
+ ss.source_files = 'RACAFNetworking/AFHTTPSessionManager+RACSupport.{h,m}'
+ end
end
|
Make use of subspecs to trigger only necessary dependecies
|
diff --git a/lib/instana/frameworks/instrumentation/active_record.rb b/lib/instana/frameworks/instrumentation/active_record.rb
index abc1234..def5678 100644
--- a/lib/instana/frameworks/instrumentation/active_record.rb
+++ b/lib/instana/frameworks/instrumentation/active_record.rb
@@ -23,6 +23,6 @@ ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.send(:include, ::Instana::Instrumentation::PostgreSQLAdapter)
else
- ::Instana.logger.warn "Unsupported ActiveRecord adapter: #{ActiveRecord::Base.connection.adapter_name.downcase}"
+ ::Instana.logger.debug "Unsupported ActiveRecord adapter: #{ActiveRecord::Base.connection.adapter_name.downcase}"
end
end
|
Move ActiveRecord message down to debug.
|
diff --git a/lib/metrics_satellite/collectors/guideline_collector.rb b/lib/metrics_satellite/collectors/guideline_collector.rb
index abc1234..def5678 100644
--- a/lib/metrics_satellite/collectors/guideline_collector.rb
+++ b/lib/metrics_satellite/collectors/guideline_collector.rb
@@ -4,9 +4,9 @@ system(
"guideline",
"--no-unused-method",
- "--abc-complexity", "100",
- "--long-method", "100",
- "--long-line", "160",
+ "--abc-complexity", "15",
+ "--long-method", "30",
+ "--long-line", "128",
:out => file
)
end
|
Change threashold value of guideline
|
diff --git a/config.ru b/config.ru
index abc1234..def5678 100644
--- a/config.ru
+++ b/config.ru
@@ -2,3 +2,12 @@
require ::File.expand_path('../config/environment', __FILE__)
run Rails.application
+
+if defined?(PhusionPassenger)
+ PhusionPassenger.on_event(:starting_worker_process) do |forked|
+ if forked
+ # We're in smart spawning mode.
+ Rails.cache.instance_variable_get(:@data).reset if Rails.cache.class == ActiveSupport::Cache::MemCacheStore
+ end
+ end
+end
|
Reset cache to avoid conflicts between workers for Passenger
|
diff --git a/config.ru b/config.ru
index abc1234..def5678 100644
--- a/config.ru
+++ b/config.ru
@@ -1,3 +1,8 @@ $: << 'lib'
+
+require 'rubygems'
+require 'bundler'
+Bundler.require
+
require 'lib/printel'
run Printel::Server
|
Make it work with pow
http://printel.dev/
|
diff --git a/lib/twentyfour_seven_office/services/api_operation/input_transformer.rb b/lib/twentyfour_seven_office/services/api_operation/input_transformer.rb
index abc1234..def5678 100644
--- a/lib/twentyfour_seven_office/services/api_operation/input_transformer.rb
+++ b/lib/twentyfour_seven_office/services/api_operation/input_transformer.rb
@@ -8,7 +8,8 @@
input_hash.each do |name_sym, value|
if value.is_a?(Array)
- input = value
+ array_type = value.first.class.to_s.downcase
+ input = { array_type => value }
elsif value.is_a?(Hash)
input = to_request(input_data_types[name_sym].new(value))
else
|
Support Array with ‘primitives’ as values
|
diff --git a/test/builder_android_test.rb b/test/builder_android_test.rb
index abc1234..def5678 100644
--- a/test/builder_android_test.rb
+++ b/test/builder_android_test.rb
@@ -6,12 +6,9 @@ @builder.stubs(:config).returns(Potemkin::Configuration.new(:sdk_root => "/some/path", :android_project_dir => "dir", :build_type => "debug"))
end
- # TODO: This test fails every other time
it "should run the build command with the android home set" do
- proc = Proc.new { ENV["ANDROID_HOME"] }
- Potemkin.expects(:run).returns(proc.call)
- home = @builder.build
- assert_equal "/some/path", home
+ @builder.expects(:with_env_vars).with("ANDROID_HOME" => "/some/path").once
+ @builder.build
end
it "should run a build command" do
|
Fix the failing environment test
|
diff --git a/lib/chess/pawn.rb b/lib/chess/pawn.rb
index abc1234..def5678 100644
--- a/lib/chess/pawn.rb
+++ b/lib/chess/pawn.rb
@@ -1,44 +1,44 @@ module Chess
class Piece
- attr_reader :color, :position, :move_from, :move_to
- def initialize(color, move_from, move_to)
+ attr_reader :color, :position
+ def initialize(color, position)
@color = color
@position = position
- @move_from = move_from
- @move_to = move_to
+ end
+ end
+
+ class Pawn < Piece
+ attr_reader :valid_moves, :position
+ def initialize(color, position)
+ super(color, position)
+ @valid_moves = validate_move
end
- class Pawn << Piece
- attr_reader :valid_moves
- def initialize
- @valid_moves = valid_moves
- end
-
- def base_movement
- if color == "black"
- @valid_moves << [1,0]
- elsif color == "white"
- @valid_moves << [-1,0]
- end
- end
-
- def diagonals
-
- end
-
- #creates new array of each possible movement plus the current position
- def available_moves
- possible_moves = possible_movement
- possible_moves.map! { |move| [move,position].transpose.map { |t| t.reduce(:+) } }
- end
-
- def validate_move
- available_moves.select { |move| move.all? { |x| x >= 0 && x <= 7 } }
+ def possible_moves
+ possible_moves = []
+ if color == "black"
+ possible_moves += [[1,0],[1,-1],[1,1]]
+ possible_moves += [[2,0]] if first_move?
+ elsif color == "white"
+ possible_moves += [[-1,0],[-1,1],[-1,-1]]
+ possible_moves += [[-2,0]] if first_move?
end
end
+ def first_move?
+ color == "black" && position[1] == 1 || color == "white" && position[1] == 6
+ end
+
+ #creates new array of each possible movement plus the current position
+ def available_moves
+ possible_moves.map! { |move| [move,position].transpose.map { |t| t.reduce(:+) } }
+ end
+
+ def validate_move
+ available_moves.select { |move| move.all? { |x| x >= 0 && x <= 7 } }
+ end
end
end
-x = Chess::Pawn.new("black",[1,1])
-p x.validate_move+x = Chess::Pawn.new("white",[6,6])
+p x.first_move?
|
Add Piece class and Pawn subclass. Add valid moves for Pawn subclass.
|
diff --git a/test/features/log_in_test.rb b/test/features/log_in_test.rb
index abc1234..def5678 100644
--- a/test/features/log_in_test.rb
+++ b/test/features/log_in_test.rb
@@ -8,6 +8,18 @@ assert_content page, "Brave Payments"
click_link('Log In')
assert_content page, "Log In"
+ end
+
+ test "a user with an existing email can receive a login email" do
+ email = 'alice@verified.org'
+
+ visit new_auth_token_publishers_path
+
+ assert_content page, "Log In"
+ fill_in 'publisher_email', with: email
+ click_button('Log In')
+
+ assert_content page, "Login email sent! Please check your email for the login link."
end
test "after failed login, user can create an account instead" do
|
Add test for successful login
|
diff --git a/vagrant_box_defaults.rb b/vagrant_box_defaults.rb
index abc1234..def5678 100644
--- a/vagrant_box_defaults.rb
+++ b/vagrant_box_defaults.rb
@@ -5,4 +5,4 @@ $SERVER_BOX = "cilium/ubuntu-dev"
$SERVER_VERSION= "157"
$NETNEXT_SERVER_BOX= "cilium/ubuntu-next"
-$NETNEXT_SERVER_VERSION= "30"
+$NETNEXT_SERVER_VERSION= "31"
|
Bump cilium/ubuntu-next version to 31
Includes the fix in the bpf-next tree to prevent the verifier
from pruning the valid code
(https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=a3ce685dd01a786fa5bc388e47d0066a4f842591).
Signed-off-by: Martynas Pumputis <6b0d31c0d563223024da45691584643ac78c96e8@lambda.lt>
|
diff --git a/list.rb b/list.rb
index abc1234..def5678 100644
--- a/list.rb
+++ b/list.rb
@@ -1,5 +1,5 @@ require_relative 'core.rb'
-EmptyList = Cons[True][True]
+EmptyList = Cons[True][Noop]
IsEmpty=Car
Head=->list{Car[Cdr[list]]}
Tail=->list{
|
Switch EmptyList to have Noop, rather than true, to make it symmetric
with Zero
|
diff --git a/lib/exceptions.rb b/lib/exceptions.rb
index abc1234..def5678 100644
--- a/lib/exceptions.rb
+++ b/lib/exceptions.rb
@@ -37,7 +37,7 @@
class UrlLengthError < ValidationError #:nodoc:
def initialize(message = nil)
- super("URL too long (must not exceed #{SmartChart::URL_MAX_LENGTH} characters)")
+ super(message || "URL too long (must not exceed #{SmartChart::URL_MAX_LENGTH} characters)")
end
end
end
|
Print message, if given, to UrlLengthError.
|
diff --git a/Library/Homebrew/tap_migrations.rb b/Library/Homebrew/tap_migrations.rb
index abc1234..def5678 100644
--- a/Library/Homebrew/tap_migrations.rb
+++ b/Library/Homebrew/tap_migrations.rb
@@ -6,6 +6,7 @@ "colormake" => "homebrew/headonly",
"comparepdf" => "homebrew/boneyard",
"denyhosts" => "homebrew/boneyard",
+ "dotwrp" => "homebrew/science",
"drizzle" => "homebrew/boneyard",
"grads" => "homebrew/binary",
"ipopt" => "homebrew/science",
@@ -21,6 +22,8 @@ "octave" => "homebrew/science",
"opencv" => "homebrew/science",
"qfits" => "homebrew/boneyard",
+ "qrupdate" => "homebrew/science",
+ "slicot" => "homebrew/science",
"syslog-ng" => "homebrew/boneyard",
"urweb" => "homebrew/boneyard",
"wkhtmltopdf" => "homebrew/boneyard",
|
Migrate dotwrp, qrupdate, slicot to homebrew-science
Closes Homebrew/homebrew#27743.
|
diff --git a/lib/callback/client.rb b/lib/callback/client.rb
index abc1234..def5678 100644
--- a/lib/callback/client.rb
+++ b/lib/callback/client.rb
@@ -3,16 +3,18 @@ attr_accessor :access_token, :base_path
def initialize(options={})
- @access_token = options.fetch(:access_token) do
- Callback.configuration.access_token
- end
- @base_path = options.fetch(:base_path) do
- Callback.configuration.base_path
- end
+ @access_token = initialize_attribute :access_token, options
+ @base_path = initialize_attribute :base_path, options
end
def jobs
@jobs ||= API::Jobs.new(access_token: access_token, base_path: base_path)
end
+
+ private
+
+ def initialize_attribute(key, options)
+ options.fetch(key) { Callback.configuration.send(key) }
+ end
end
end
|
Refactor to remove duplication by extracting to method
|
diff --git a/lib/github_cli/util.rb b/lib/github_cli/util.rb
index abc1234..def5678 100644
--- a/lib/github_cli/util.rb
+++ b/lib/github_cli/util.rb
@@ -1,3 +1,5 @@+# encoding: utf-8
+
module GithubCLI
module Util
extend self
@@ -33,5 +35,41 @@ else value.to_s
end
end
+
+ # Shortens string
+ # :trailing - trailing character in place of cutout string
+ def truncate(string, width, options={})
+ trailing = options[:trailing] || '…'
+
+ chars = string.to_s.chars.to_a
+ if chars.length < width && chars.length > 3
+ chars.join
+ elsif chars.length > 3
+ (chars[0, width - 1].join) + trailing
+ end
+ end
+
+ # Pads a string
+ # padder - padding character
+ # align - align :left, :right, :center
+ def pad(string, width, options={})
+ padder = options[:padder] || ' '
+ align = options[:align] || :left
+
+ chars = string.chars.to_a
+ if chars.length < width
+ string = case :"#{align}"
+ when :left
+ string + (padder * (width - chars.length))
+ when :right
+ (padder * (width - chars.length)) + string
+ when :center
+ right = ((pad_length = width - chars.length).to_f / 2).ceil
+ left = pad_length - right
+ (padder * left) + string + (padder * right)
+ end
+ end
+ string
+ end
end
end # GithubCLI
|
Add string truncation and padding.
|
diff --git a/lib/ibanomat/client.rb b/lib/ibanomat/client.rb
index abc1234..def5678 100644
--- a/lib/ibanomat/client.rb
+++ b/lib/ibanomat/client.rb
@@ -7,6 +7,7 @@ def self.find(options)
raise ArgumentError.new unless options.is_a?(Hash)
raise ArgumentError.new('Option :bank_code is missing!') if options[:bank_code].empty?
+ raise ArgumentError.new('Option :bank_account_number is missing!') if options[:bank_account_number].empty?
response = RestClient.get URL, {
:params => {
|
Make sure bank_account_number is given
|
diff --git a/lib/log_lady/writer.rb b/lib/log_lady/writer.rb
index abc1234..def5678 100644
--- a/lib/log_lady/writer.rb
+++ b/lib/log_lady/writer.rb
@@ -3,16 +3,17 @@ attr_accessor :record
def before_create(record)
- record.logs.build changeset: build_changeset(record, record.changed_attributes)
+ record.logs.build changeset: build_changeset(record, :changed_attributes)
end
alias :before_update :before_create
def before_destroy(record)
- record.logs.create changeset: build_changeset(record, record.predestroy_attributes)
+ record.logs.create changeset: build_changeset(record, :predestroy_attributes)
end
- def build_changeset(record, changes)
+ def build_changeset(record, changes_message)
+ changes = record.public_send(changes_message)
changes.inject({}) do | result, (attr, old_val) |
result[attr] = [ old_val, record.send(attr) ]; result
end
|
Send changes_message as an argument to build_changeset
|
diff --git a/lib/rmagick/version.rb b/lib/rmagick/version.rb
index abc1234..def5678 100644
--- a/lib/rmagick/version.rb
+++ b/lib/rmagick/version.rb
@@ -1,6 +1,6 @@ module Magick
VERSION = '2.16.0'
- MIN_RUBY_VERSION = '2.0.0'
+ MIN_RUBY_VERSION = '2.2.0'
MIN_IM_VERSION = '6.4.9'
MIN_WAND_VERSION = '6.9.0'
end
|
Drop support of Ruby < 2.2
|
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
@@ -7,7 +7,7 @@ class Railtie < ::Rails::Railtie
rake_tasks do |app|
require 'rake/autoprefixer_tasks'
- Rake::AutoprefixerTasks.new( config(app.root) )
+ Rake::AutoprefixerTasks.new( config(app.root) ) if defined? app.assets
end
if config.respond_to?(:assets)
@@ -16,7 +16,9 @@ end
else
initializer :setup_autoprefixer, group: :all do |app|
- AutoprefixerRails.install(app.assets, config(app.root))
+ if defined? app.assets
+ AutoprefixerRails.install(app.assets, config(app.root))
+ end
end
end
|
Allow to work in Rails without Assets Pipeline
|
diff --git a/lib/the_merger.rb b/lib/the_merger.rb
index abc1234..def5678 100644
--- a/lib/the_merger.rb
+++ b/lib/the_merger.rb
@@ -8,9 +8,7 @@ #
def merge_fields(subject,original_body)
- parse_config
-
- @merge_model.constantize.all.each do |user|
+ merge_model.constantize.all.each do |user|
body = original_body.dup
model_fields.each do |field|
@@ -32,20 +30,17 @@ end
def model_fields
- parse_config
- @merge_model.constantize.attribute_names.reject{|x| %w[created_at updated_at id].include?(x)}
+ merge_model.constantize.attribute_names.reject{|x| %w[created_at updated_at id].include?(x)}
end
private
- def parse_config
- path = "#{Rails.root}/config/the_merger.yml"
-
- if File.exists?(path)
+ def merge_model
+ if File.exists?(path = "#{Rails.root}/config/the_merger.yml")
conf=YAML::load(IO.read(path))
- @merge_model = conf["merge_model"]
+ conf["merge_model"]
else
- @merge_model = "User"
+ "User"
end
end
end
|
Refactor how we get the configured model
|
diff --git a/lib/chef/provider/machine_file.rb b/lib/chef/provider/machine_file.rb
index abc1234..def5678 100644
--- a/lib/chef/provider/machine_file.rb
+++ b/lib/chef/provider/machine_file.rb
@@ -29,9 +29,9 @@ end
attributes = {}
- %w(owner group mode).each do |attribute|
- attributes[attribute.to_sym] = new_resource.send(attribute.to_sym) if new_resource.send(attribute.to_sym)
- end
+ attributes[:group] = new_resource.group if new_resource.group
+ attributes[:owner] = new_resource.owner if new_resource.owner
+ attributes[:mode] = new_resource.mode if new_resource.mode
machine.set_attributes(self, new_resource.path, attributes)
end
|
Stop being so clever, unroll the loop
|
diff --git a/lib/two_chainz.rb b/lib/two_chainz.rb
index abc1234..def5678 100644
--- a/lib/two_chainz.rb
+++ b/lib/two_chainz.rb
@@ -1,2 +1,4 @@+module TwoChainz; end
+
require 'two_chainz/generator'
require 'two_chainz/words_table'
|
Declare TwoChainz module in root file
|
diff --git a/lib/yooleroobee/cli.rb b/lib/yooleroobee/cli.rb
index abc1234..def5678 100644
--- a/lib/yooleroobee/cli.rb
+++ b/lib/yooleroobee/cli.rb
@@ -7,10 +7,10 @@ def new(number)
problem = Yooleroobee::FolderCreator.new.for_problem(number)
say "Created the folder:"
- say "./#{ problem.folder_name }", :red
+ say "./#{ problem.folder_name }", :green
say "And the files:"
- say "#{ problem.ruby_file_name }", :red
- say "#{ problem.test_name }", :red
+ say "#{ problem.ruby_file_name }", :green
+ say "#{ problem.test_name }", :green
say "for Problem #{ problem.number }: #{ problem.name }"
rescue
say "HEY: That folder already exists!", :bold
|
Change messages from red to green
|
diff --git a/lib/ebay/types/name_value_list.rb b/lib/ebay/types/name_value_list.rb
index abc1234..def5678 100644
--- a/lib/ebay/types/name_value_list.rb
+++ b/lib/ebay/types/name_value_list.rb
@@ -11,6 +11,7 @@ root_element_name 'NameValueList'
text_node :name, 'Name', :optional => true
text_node :value, 'Value', :optional => true
+ array_node :values, 'Value', :optional => true, class: String
text_node :source, 'Source', :optional => true
end
end
|
Add workaround for accepting array of values within NameValueList
For example as it is required for VariationSpecificsSet
|
diff --git a/lib/rawline/non_blocking_input.rb b/lib/rawline/non_blocking_input.rb
index abc1234..def5678 100644
--- a/lib/rawline/non_blocking_input.rb
+++ b/lib/rawline/non_blocking_input.rb
@@ -18,8 +18,13 @@ begin
file_descriptor_flags = @input.fcntl(Fcntl::F_GETFL, 0)
loop do
- string = @input.read_nonblock(4096)
- bytes.concat string.bytes
+ begin
+ string = @input.read_nonblock(4096)
+ bytes.concat string.bytes
+ rescue EOFError
+ sleep 0.1
+ retry
+ end
end
rescue IO::WaitReadable
# reset flags so O_NONBLOCK is turned off on the file descriptor
|
Update non-blocking input to retry when EOFError received.
This resolves an issue when interacting with the editor as a child process.
|
diff --git a/spec/unit/vault_spec.rb b/spec/unit/vault_spec.rb
index abc1234..def5678 100644
--- a/spec/unit/vault_spec.rb
+++ b/spec/unit/vault_spec.rb
@@ -0,0 +1,73 @@+require "spec_helper"
+
+describe Vault do
+ it "sets the default values" do
+ Vault::Configurable.keys.each do |key|
+ value = Vault::Defaults.send(key)
+ expect(Vault.instance_variable_get(:"@#{key}")).to eq(value)
+ end
+ end
+
+ describe ".client" do
+ it "creates an Vault::Client" do
+ expect(Vault.client).to be_a(Vault::Client)
+ end
+
+ it "caches the client when the same options are passed" do
+ expect(Vault.client).to eq(Vault.client)
+ end
+
+ it "returns a fresh client when options are not the same" do
+ original_client = Vault.client
+
+ # Change settings
+ Vault.address = "http://new.address"
+ new_client = Vault.client
+
+ # Get it one more tmie
+ current_client = Vault.client
+
+ expect(original_client).to_not eq(new_client)
+ expect(new_client).to eq(current_client)
+ end
+ end
+
+ describe ".configure" do
+ Vault::Configurable.keys.each do |key|
+ it "sets the #{key.to_s.gsub("_", " ")}" do
+ Vault.configure do |config|
+ config.send("#{key}=", key)
+ end
+
+ expect(Vault.instance_variable_get(:"@#{key}")).to eq(key)
+ end
+ end
+ end
+
+ describe ".method_missing" do
+ context "when the client responds to the method" do
+ let(:client) { double(:client) }
+ before { allow(Vault).to receive(:client).and_return(client) }
+
+ it "delegates the method to the client" do
+ allow(client).to receive(:bacon).and_return("awesome")
+ expect { Vault.bacon }.to_not raise_error
+ end
+ end
+
+ context "when the client does not respond to the method" do
+ it "calls super" do
+ expect { Vault.bacon }.to raise_error(NoMethodError)
+ end
+ end
+ end
+
+ describe ".respond_to_missing?" do
+ let(:client) { double(:client) }
+ before { allow(Vault).to receive(:client).and_return(client) }
+
+ it "delegates to the client" do
+ expect { Vault.respond_to_missing?(:foo) }.to_not raise_error
+ end
+ end
+end
|
Add unit tests for vault
|
diff --git a/lita-nerd.gemspec b/lita-nerd.gemspec
index abc1234..def5678 100644
--- a/lita-nerd.gemspec
+++ b/lita-nerd.gemspec
@@ -1,6 +1,6 @@ Gem::Specification.new do |spec|
spec.name = "lita-nerd"
- spec.version = "1.0.0"
+ spec.version = "1.0.1"
spec.authors = ["Henrik Sjökvist"]
spec.email = ["henrik.sjokvist@gmail.com"]
spec.description = %q{A Lita handler that taunts nerds.}
@@ -13,11 +13,11 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]
- spec.add_runtime_dependency "lita", "~> 2.0"
+ spec.add_runtime_dependency "lita", "~> 3.0"
spec.add_development_dependency "bundler", "~> 1.3"
spec.add_development_dependency "rake"
- spec.add_development_dependency "rspec", "~> 2.14"
+ spec.add_development_dependency "rspec", "~> 3.0.0.beta1"
spec.add_development_dependency "simplecov"
spec.add_development_dependency "coveralls"
end
|
Update gem versions to support lita 3.0, bump version number.
|
diff --git a/luchadeer.gemspec b/luchadeer.gemspec
index abc1234..def5678 100644
--- a/luchadeer.gemspec
+++ b/luchadeer.gemspec
@@ -17,7 +17,7 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ['lib']
- spec.add_dependency 'faraday', '~> 0.9.0'
+ spec.add_dependency 'faraday', '~> 0.10'
spec.add_development_dependency 'bundler', '~> 1.5'
spec.add_development_dependency 'rake'
|
Update and loosen faraday dependency
|
diff --git a/spec/client_spec.rb b/spec/client_spec.rb
index abc1234..def5678 100644
--- a/spec/client_spec.rb
+++ b/spec/client_spec.rb
@@ -5,22 +5,24 @@
describe 'Ephemeral::Client' do
- it 'expects 3 arguments' do
- test_client = Ephemeral::Client.new
- expect{
- test_client.build
- }.to raise_error ArgumentError
- end
+ describe 'build' do
+ it 'expects 3 arguments' do
+ test_client = Ephemeral::Client.new
+ expect{
+ test_client.build
+ }.to raise_error ArgumentError
+ end
- it 'returns a hash' do
- test_client = Ephemeral::Client.new
- response = test_client.build("ruby:2.1", "https://github.com/skierkowski/hello-middleman", "middleman")
- expect(response).to be_an_instance_of Hash
- end
+ it 'returns a hash' do
+ test_client = Ephemeral::Client.new
+ response = test_client.build("ruby:2.1", "https://github.com/skierkowski/hello-middleman", "middleman")
+ expect(response).to be_an_instance_of Hash
+ end
- it 'returns a hash which contains an id' do
- test_client = Ephemeral::Client.new
- response = test_client.build("ruby:2.1", "https://github.com/skierkowski/hello-middleman", "middleman")
- expect(response).to have_key('id')
+ it 'returns a hash which contains an id' do
+ test_client = Ephemeral::Client.new
+ response = test_client.build("ruby:2.1", "https://github.com/skierkowski/hello-middleman", "middleman")
+ expect(response).to have_key('id')
+ end
end
end
|
Add build group to tests
|
diff --git a/spec/server_spec.rb b/spec/server_spec.rb
index abc1234..def5678 100644
--- a/spec/server_spec.rb
+++ b/spec/server_spec.rb
@@ -56,5 +56,17 @@ last_response.should be_ok
last_response.body.should match(%r{<title>\s*Madride Demo\s*</title>})
end
+
+
+ it "should set charset=utf8 for html files" do
+ get "/"
+ last_response.header['Content-Type'].should match(%r{charset=utf8$})
+ end
+
+
+ it "should keep Content-Type untouched for anything but html" do
+ get "/app.js"
+ last_response.header['Content-Type'].should_not match(%r{charset=utf8$})
+ end
end
end
|
Add tests for response headers
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -14,10 +14,10 @@
RSpec.configure do |c|
c.before(:each) do
- Mongoid.session(:default).drop
+ Mongoid.purge!
end
c.after(:all) do
- Mongoid.session(:default).drop
+ Mongoid.purge!
end
end
|
Use purge instead of drop.
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -7,4 +7,9 @@ set :environment, :test
Rspec.configure do |config|
+
+ config.before(:each) do
+ [User, Project].each { |model| model.delete_all }
+ end
+
end
|
Remove all Users and Projects before each test
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -18,7 +18,7 @@ c.extend VCR::RSpec::Macros
end
-config = YAML.load(File.new(File.expand_path('~/.dnsimple.local')))
+config = YAML.load(File.new(File.expand_path('~/.dnsimple.test')))
DNSimple::Client.base_uri = config['site'] # Example: https://test.dnsimple.com/
DNSimple::Client.username = config['username'] # Example: testusername
|
Use ~/.dnsimple.test as referenced in the spec/README file.
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -3,8 +3,6 @@
$:.unshift 'lib'
-require 'rack_request_ip_strategies'
-
-RackRequestIPStrategies.patch_rack
+require 'rack_request_ip_strategies/patch_rack'
require 'pry'
|
Use patch require in spec helper
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -20,6 +20,7 @@ RSpec.configure do |config|
config.expect_with :rspec do |expectations|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
+ expectations.max_formatted_output_length = nil
end
config.mock_with :rspec do |mocks|
|
Change to stop limiting string comparison length
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,2 +1,13 @@+require "simplecov"
+SimpleCov.start
+
+# Configure Rails Environment
+ENV["RAILS_ENV"] = "test"
+
+require File.expand_path("../../test/dummy/config/environment.rb", __FILE__)
+ActiveRecord::Migrator.migrations_paths = [File.expand_path("../../test/dummy/db/migrate", __FILE__)]
+ActiveRecord::Migrator.migrations_paths << File.expand_path('../../db/migrate', __FILE__)
+require "rails/test_help"
+
$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
require "model_base"
|
Add config to load spec/dummy
|
diff --git a/messaging.gemspec b/messaging.gemspec
index abc1234..def5678 100644
--- a/messaging.gemspec
+++ b/messaging.gemspec
@@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = 'evt-messaging'
- s.version = '0.10.0.0'
+ s.version = '0.11.0.0'
s.summary = 'Messaging primitives for Eventide'
s.description = ' '
|
Package version is increased from 0.10.0.0 to 0.11.0.0
|
diff --git a/messaging.gemspec b/messaging.gemspec
index abc1234..def5678 100644
--- a/messaging.gemspec
+++ b/messaging.gemspec
@@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = 'evt-messaging'
- s.version = '2.5.3.0'
+ s.version = '2.5.4.0'
s.summary = 'Common primitives for platform-specific messaging implementations for Eventide'
s.description = ' '
|
Package version is increased from 2.5.3.0 to 2.5.4.0
|
diff --git a/spec/classes/relationship__titles_spec.rb b/spec/classes/relationship__titles_spec.rb
index abc1234..def5678 100644
--- a/spec/classes/relationship__titles_spec.rb
+++ b/spec/classes/relationship__titles_spec.rb
@@ -1,6 +1,8 @@ require 'spec_helper'
describe 'relationships::titles' do
+ let(:facts) { {:operatingsystem => 'Debian', :kernel => 'Linux'} }
+
it { should compile }
it { should compile.with_all_deps }
|
Add some facts to the specs
|
diff --git a/app/controllers/statistics_controller.rb b/app/controllers/statistics_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/statistics_controller.rb
+++ b/app/controllers/statistics_controller.rb
@@ -10,8 +10,6 @@ metric_percentage = (count_metric_snapshot.to_f / total_configuration.to_f) * 100
end
- respond_to do |format|
- format.json { render json: {metric_percentage: metric_percentage.round(2)} }
- end
+ respond_with_json metric_percentage: metric_percentage.round(2)
end
end
|
Use respond_with_json on statistics controller
|
diff --git a/geocoder.gemspec b/geocoder.gemspec
index abc1234..def5678 100644
--- a/geocoder.gemspec
+++ b/geocoder.gemspec
@@ -1,5 +1,10 @@ # -*- encoding: utf-8 -*-
+
+lib = File.expand_path('../lib/', __FILE__)
+$:.unshift lib unless $:.include?(lib)
+
require 'geocoder'
+
Gem::Specification.new do |s|
s.name = "geocoder"
s.version = Geocoder.version
|
Fix load path (wasn't working on Ruby 1.8).
|
diff --git a/app/models/spree/user_decorator.rb b/app/models/spree/user_decorator.rb
index abc1234..def5678 100644
--- a/app/models/spree/user_decorator.rb
+++ b/app/models/spree/user_decorator.rb
@@ -1,3 +1,3 @@ Spree.user_class.class_eval do
- has_many :addresses, :conditions => {:deleted_at => nil}, :order => "updated_at DESC", :class_name => 'Spree::Address'
-end
+ has_many :addresses, -> { where(:deleted_at => nil).order("updated_at DESC") }, :class_name => 'Spree::Address'
+end
|
Update has_many args to Rails 4 syntax
|
diff --git a/app/serializers/item_serializer.rb b/app/serializers/item_serializer.rb
index abc1234..def5678 100644
--- a/app/serializers/item_serializer.rb
+++ b/app/serializers/item_serializer.rb
@@ -1,6 +1,5 @@ class ItemSerializer < ActiveModel::Serializer
- attributes :id, :title, :ward, :number
+ attributes :id, :title, :ward, :number, :recommendations, :sections
has_one :item_type
- has_many :user_votes
end
|
Revert "Revert "Update Item Serializer""
|
diff --git a/db/data_migration/20130425114743_fix_historical_account_political_affiliations.rb b/db/data_migration/20130425114743_fix_historical_account_political_affiliations.rb
index abc1234..def5678 100644
--- a/db/data_migration/20130425114743_fix_historical_account_political_affiliations.rb
+++ b/db/data_migration/20130425114743_fix_historical_account_political_affiliations.rb
@@ -0,0 +1,6 @@+puts "Updating political parties for historical accounts."
+HistoricalAccount.all.each do |historical_account|
+ historical_account.political_party_ids = [historical_account.political_party_id]
+ historical_account.save!
+end
+puts "Update complete."
|
Migrate political affiliation to new column
|
diff --git a/stripe.gemspec b/stripe.gemspec
index abc1234..def5678 100644
--- a/stripe.gemspec
+++ b/stripe.gemspec
@@ -13,7 +13,6 @@ s.executables = 'stripe-console'
s.require_paths = %w{lib}
- s.add_dependency('json')
s.add_dependency('rest-client')
s.add_development_dependency('mocha')
|
Remove JSON as an explicit dependency
TODO: bundle pure Ruby JSON implementation for Ruby 1.8
|
diff --git a/modules/tests/tc_lua_predicate.rb b/modules/tests/tc_lua_predicate.rb
index abc1234..def5678 100644
--- a/modules/tests/tc_lua_predicate.rb
+++ b/modules/tests/tc_lua_predicate.rb
@@ -1,5 +1,3 @@-require File.join(File.dirname(__FILE__), '..', 'clipp_test')
-
class TestLuaPredicate < Test::Unit::TestCase
include CLIPPTest
|
modules/tests: Remove incorrect require in ruby tests.
|
diff --git a/lib/arel.rb b/lib/arel.rb
index abc1234..def5678 100644
--- a/lib/arel.rb
+++ b/lib/arel.rb
@@ -21,7 +21,7 @@ require 'arel/nodes'
module Arel
- VERSION = '6.0.0'
+ VERSION = '7.0.0.alpha'
def self.sql raw_sql
Arel::Nodes::SqlLiteral.new raw_sql
|
Change the version to 7.0.0.alpha
|
diff --git a/lib/dude.rb b/lib/dude.rb
index abc1234..def5678 100644
--- a/lib/dude.rb
+++ b/lib/dude.rb
@@ -1,9 +1,11 @@ class Exception
+ attr_reader :initial_message
+
def initialize(message)
- @message = message
+ @initial_message = message
end
def to_s
- "#{@message}, dude."
+ "#{@initial_message}, dude."
end
end
|
Refactor based on skmetz example onPR 4
https://github.com/strand/dude/pull/4
|
diff --git a/test/helper.rb b/test/helper.rb
index abc1234..def5678 100644
--- a/test/helper.rb
+++ b/test/helper.rb
@@ -16,9 +16,6 @@ require "svn_helper"
require "buildable_stub"
-Bob.logger = Logger.new("/dev/null")
-Bob.engine = Bob::BackgroundEngines::Foreground
-Bob.directory = File.expand_path(File.dirname(__FILE__) + "/../tmp")
class Test::Unit::TestCase
include Bob
@@ -28,5 +25,9 @@
def setup
FileUtils.rm_rf(Bob.directory)
+
+ Bob.logger = Logger.new("/dev/null")
+ Bob.engine = Bob::BackgroundEngines::Foreground
+ Bob.directory = File.expand_path(File.dirname(__FILE__) + "/../tmp")
end
end
|
Move Bob configuration for tests in setup
|
diff --git a/foodcritic.gemspec b/foodcritic.gemspec
index abc1234..def5678 100644
--- a/foodcritic.gemspec
+++ b/foodcritic.gemspec
@@ -10,7 +10,6 @@ s.homepage = 'http://acrmp.github.com/foodcritic'
s.license = 'MIT'
s.executables << 'foodcritic'
- s.add_dependency("json", ">= 1.4.4", "<= 1.6.1")
s.add_dependency('gherkin', '~> 2.8.0')
s.add_dependency('gist', '~> 2.0.4')
s.add_dependency('nokogiri', '~> 1.5.0')
|
Remove direct JSON gem dependency.
|
diff --git a/metadata.rb b/metadata.rb
index abc1234..def5678 100644
--- a/metadata.rb
+++ b/metadata.rb
@@ -2,7 +2,7 @@ name 'audit'
maintainer 'Chef Software, Inc.'
maintainer_email 'cookbooks@chef.io'
-license 'Apache 2.0'
+license 'Apache-2.0'
description 'Allows for fetching and executing compliance profiles, and reporting its results'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '3.0.0'
|
Use a SPDX standard license string
Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.