diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/Casks/chromatic.rb b/Casks/chromatic.rb
index abc1234..def5678 100644
--- a/Casks/chromatic.rb
+++ b/Casks/chromatic.rb
@@ -0,0 +1,7 @@+class Chromatic < Cask
+ url 'http://download.mrgeckosmedia.com/Chromatic.zip'
+ homepage 'https://mrgeckosmedia.com/applications/info/Chromatic'
+ version '0.2.3'
+ sha1 '5b28e43f89480d339a5f323c2650a2d4a2b5d487'
+ link 'Chromatic.app'
+end
|
Add cask for Chromatic version 0.2.3
|
diff --git a/Casks/connectiq.rb b/Casks/connectiq.rb
index abc1234..def5678 100644
--- a/Casks/connectiq.rb
+++ b/Casks/connectiq.rb
@@ -0,0 +1,15 @@+cask :v1 => 'connectiq' do
+ version '1.1.4'
+ sha256 '9994f96668615ad7a5ce875b1db81475c240ffb9934cb16e822bd01e22c5d8c4'
+
+ url "http://developer.garmin.com/downloads/connect-iq/sdks/connectiq-sdk-mac-#{version}.zip"
+ name "Garmin Connect IQ SDK v#{version}"
+ homepage 'http://developer.garmin.com/connect-iq'
+ license :other
+
+ app 'bin/ConnectIQ.app'
+ binary 'bin/connectiq'
+ binary 'bin/monkeyc'
+ binary 'bin/monkeydo'
+ binary 'bin/shell'
+end
|
Add Garmin Connect IQ SDK v1.1.4
|
diff --git a/xp.gemspec b/xp.gemspec
index abc1234..def5678 100644
--- a/xp.gemspec
+++ b/xp.gemspec
@@ -6,8 +6,8 @@ s.version = "2.0.0"
s.authors = ["Jikku Jose"]
s.email = ['jikkujose@gmail.com']
- s.summary = "Gem that enables String class to help quick & dirty scraping tasks."
- s.description = "Provides a monkey patched String class that can download & filter web pages using CSS/XPATH selectors; also has a very intuitive method to download files directly from their urls."
+ s.summary = "Ruby gem for intuitive web scraping"
+ s.description = "Ruby gem that adds some methods to String class for intuitive HTML/XML scraping"
s.homepage = "http://github.com/JikkuJose/xp"
s.license = "MIT"
s.files = `git ls-files -z`.split("\x0")
|
Update gemspec's summary & description
|
diff --git a/config.rb b/config.rb
index abc1234..def5678 100644
--- a/config.rb
+++ b/config.rb
@@ -1,19 +1,3 @@-###
-# Compass
-###
-
-# Change Compass configuration
-# compass_config do |config|
-# config.output_style = :compact
-# end
-
-###
-# Helpers
-###
-
-# Automatic image dimensions on image_tag helper
-# activate :automatic_image_sizes
-
# Reload the browser automatically whenever files change
configure :development do
activate :livereload
@@ -38,14 +22,8 @@ # Minify Javascript on build
activate :minify_javascript
- # Enable cache buster
- # activate :asset_hash
-
- # Use relative URLs
- # activate :relative_assets
-
- # Or use a different image path
- # set :http_prefix, "/Content/images/"
+ # Enable cache buster asset hashing of files
+ activate :asset_hash
end
# Gzip files
@@ -66,3 +44,6 @@ # Set this to true to deploy to s3
config.after_build = false
end
+
+# add default caching policy to all files
+default_caching_policy max_age:(60 * 60 * 24 * 365)
|
Enable asset hashing of files; set default caching policy on newly created s3 files
|
diff --git a/spec/controllers/best_boy/events_controller_spec.rb b/spec/controllers/best_boy/events_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/best_boy/events_controller_spec.rb
+++ b/spec/controllers/best_boy/events_controller_spec.rb
@@ -1,44 +1,46 @@ require 'spec_helper'
describe BestBoy::EventsController, type: :controller do
+ routes { BestBoy::Engine.routes }
+
describe 'GET index' do
it "renders the template" do
- get :index, { use_route: :best_boy }
+ get :index
expect(response).to render_template :index
end
end
describe 'GET stats' do
it "renders the template" do
- get :stats, { use_route: :best_boy }
+ get :stats
expect(response).to render_template :stats
end
end
describe 'GET lists' do
it "renders the template" do
- get :lists, { use_route: :best_boy }
+ get :lists
expect(response).to render_template :lists
end
end
describe 'GET details' do
it "renders the template" do
- get :details, { use_route: :best_boy }
+ get :details
expect(response).to render_template :details
end
end
describe 'GET monthly_details' do
it "renders the template" do
- get :monthly_details, {year: Time.zone.now.year, month: Time.zone.now.month, use_route: :best_boy }
+ get :monthly_details, {year: Time.zone.now.year, month: Time.zone.now.month }
expect(response).to render_template :monthly_details
end
end
describe 'GET charts' do
it "renders the template" do
- get :charts, { use_route: :best_boy }
+ get :charts
expect(response).to render_template :charts
end
end
|
Use engine routes in functional specs
|
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
@@ -27,7 +27,7 @@ def append_info_to_payload(payload)
super
# More info for Lograge
- payload[:customer_id] = @customer && @customer.id
+ payload[:customer_id] = current_user && current_user.customer && current_user.customer.id
end
protected
|
Fix customer_id in payload for loggin
|
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
@@ -20,6 +20,10 @@ end
def after_sign_in_path_for(resource)
- admin_notas_path
+ if request.path.split("/")[1] == "backend"
+ backend_root_path
+ else
+ admin_notas_path
+ end
end
end
|
Fix redirect after login method.
|
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
@@ -9,11 +9,11 @@
# redirect users after login
def after_sign_in_path_for(_resource)
- dashboard_profile_path
+ dashboard_messages_path
end
# redirect users after logout
def after_sign_out_path_for(_resource)
- home_page_path
+ root_path
end
end
|
Update after sign up and sign in path
|
diff --git a/Casks/wacom-graphire4-tablet.rb b/Casks/wacom-graphire4-tablet.rb
index abc1234..def5678 100644
--- a/Casks/wacom-graphire4-tablet.rb
+++ b/Casks/wacom-graphire4-tablet.rb
@@ -0,0 +1,19 @@+cask :v1 => 'wacom-graphire4-tablet' do
+ version '5.3.0-3'
+ sha256 '0299398282cf86d56bd8f0701ef9c3140e901b8ea72ec6821a00871acdd25e76'
+
+ url "http://cdn.wacom.com/U/Drivers/Mac/Consumer/#{version.sub(%r{-.*},'').gsub('.','')}/PenTablet_#{version}.dmg"
+ name 'Graphire4 (CTE) Legacy Driver'
+ homepage 'http://us.wacom.com/en/support/legacy-drivers/'
+ license :gratis
+
+ pkg 'Install Bamboo.pkg'
+
+ uninstall :launchctl => 'com.wacom.pentablet',
+ :quit => [
+ 'com.wacom.TabletDriver',
+ 'com.wacom.PenTabletDriver',
+ 'com.wacom.ConsumerTouchDriver'
+ ],
+ :pkgutil => 'com.wacom.installpentablet'
+end
|
Add Wacom Graphire4 legacy drivers
|
diff --git a/spec/helpers/weather_symbol.rb b/spec/helpers/weather_symbol.rb
index abc1234..def5678 100644
--- a/spec/helpers/weather_symbol.rb
+++ b/spec/helpers/weather_symbol.rb
@@ -0,0 +1,34 @@+module Helpers
+ module WeatherSymbol
+ def sunny
+ '
+ \ /
+ -- ⚪ --
+ / \
+ '
+ end
+
+ def cloudy
+ "\t .-.
+ ( ).
+ (___(__)
+ ‘ ‘ ‘ ‘
+ ‘ ‘ ‘ ‘"
+ end
+
+ def partial_rainy
+ "\t _`/"".-.
+ ,\_( ).
+ /(___(__)
+ ‘ ‘ ‘ ‘
+ ‘ ‘ ‘ ‘ "
+ end
+
+ def partial_cloudy
+ ' \ /
+ _ /"".-.
+ \_( ).
+ /(___(__)'
+ end
+ end
+end
|
Create a folder to store helper methods for rspec
Created a module weather symbol
added method cloudy, sunny, partial_rainy, partial_cloudy
|
diff --git a/spec/support/custom_helpers.rb b/spec/support/custom_helpers.rb
index abc1234..def5678 100644
--- a/spec/support/custom_helpers.rb
+++ b/spec/support/custom_helpers.rb
@@ -11,4 +11,8 @@ end
connection
end
+
+ def regexp_matcher(regexp)
+ RSpec::Mocks::ArgumentMatchers::RegexpMatcher.new(regexp)
+ end
end
|
Create a helper to match regular expressions.
|
diff --git a/lib/commands/package_command.rb b/lib/commands/package_command.rb
index abc1234..def5678 100644
--- a/lib/commands/package_command.rb
+++ b/lib/commands/package_command.rb
@@ -11,7 +11,7 @@ # do not check for configured
# rubygems in external ruby scripts called during packaging
disable_bundler do
- Cheetah.run "make", "-f", "Makefile.cvs" # TODO will not work for cmake based ones
+ Cheetah.run "make", "-f", "Makefile.cvs"
Cheetah.run "make", "package-local", "CHECK_SYNTAX=false"
end
end
|
Remove TODO at "make -f Makefile.cvs" invocation
There is no CMake-based module among the translated ones, so we won't be
adding CMake support.
|
diff --git a/app/controllers/spree/base_controller_decorator.rb b/app/controllers/spree/base_controller_decorator.rb
index abc1234..def5678 100644
--- a/app/controllers/spree/base_controller_decorator.rb
+++ b/app/controllers/spree/base_controller_decorator.rb
@@ -1,15 +1,14 @@ Spree::BaseController.class_eval do
-
before_filter :get_pages
helper_method :current_page
-
+
def current_page
@page ||= Spree::Page.find_by_path(request.path)
end
-
+
def get_pages
return if request.path =~ /^\/+admin/
@pages ||= Spree::Page.visible.order(:position)
+ @content_snippets ||= Spree::Page.where(title: "Content Snippets").first
end
-
end
|
Add the ability to use a global content snipperts page.
|
diff --git a/spec/integration/mapping_relations_spec.rb b/spec/integration/mapping_relations_spec.rb
index abc1234..def5678 100644
--- a/spec/integration/mapping_relations_spec.rb
+++ b/spec/integration/mapping_relations_spec.rb
@@ -0,0 +1,35 @@+# encoding: utf-8
+
+require 'spec_helper'
+
+describe 'Mapping relations' do
+ let!(:env) { Environment.coerce(:test => 'memory://test') }
+ let!(:model) { mock_model(:id, :name) }
+
+ specify 'I can define a relation and its mapping' do
+ schema = Schema.build do
+ base_relation :users do
+ repository :test
+
+ attribute :id, Integer
+ attribute :user_name, String
+
+ key :id
+ end
+ end
+
+ env.load_schema(schema)
+
+ # TODO: replace that with mapper DSL once ready
+ header = Mapper::Header.coerce(schema[:users].header, map: { user_name: :name })
+ mapper = Mapper.build(header, model)
+
+ users = Relation.build(env.repository(:test).get(:users), mapper)
+
+ jane = model.new(id: 1, name: 'Jane')
+
+ users.insert(jane)
+
+ expect(users.to_a).to eql([jane])
+ end
+end
|
Add integration spec showing relation mapping
|
diff --git a/spec/requests/api/drops_controller_spec.rb b/spec/requests/api/drops_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/requests/api/drops_controller_spec.rb
+++ b/spec/requests/api/drops_controller_spec.rb
@@ -1,5 +1,4 @@ require 'rails_helper'
-require 'net/http'
RSpec.describe Api::DropsController, :vcr, type: :request do
context 'with several drops present' do
@@ -29,10 +28,6 @@ expect(parsed_response[0]["place"].keys).to eq(["id", "name", "latitude", "longitude"])
end
- it "blablabla" do
- Net::HTTP.get_response(URI.parse("http://google.com"))
- end
-
end
end
|
Revert "Add dummy test for power hour"
This reverts commit e1f82e117be009f4208fee0aa209c4db304e95aa.
|
diff --git a/db/migrate/20140502125220_migrate_repo_size.rb b/db/migrate/20140502125220_migrate_repo_size.rb
index abc1234..def5678 100644
--- a/db/migrate/20140502125220_migrate_repo_size.rb
+++ b/db/migrate/20140502125220_migrate_repo_size.rb
@@ -1,19 +1,26 @@ class MigrateRepoSize < ActiveRecord::Migration
def up
- Project.reset_column_information
- Project.find_each(batch_size: 500) do |project|
+ project_data = execute('SELECT projects.id, namespaces.path AS namespace_path, projects.path AS project_path FROM projects LEFT JOIN namespaces ON projects.namespace_id = namespaces.id')
+
+ project_data.each do |project|
+ id = project['id']
+ namespace_path = project['namespace_path'] || ''
+ path = File.join(Gitlab.config.gitlab_shell.repos_path, namespace_path, project['project_path'] + '.git')
+
begin
- if project.empty_repo?
+ repo = Gitlab::Git::Repository.new(path)
+ if repo.empty?
print '-'
else
- project.update_repository_size
+ size = repo.size
print '.'
+ execute("UPDATE projects SET repository_size = #{size} WHERE id = #{id}")
end
- rescue
- print 'F'
+ rescue => e
+ puts "\nFailed to update project #{id}: #{e}"
end
end
- puts 'Done'
+ puts "\nDone"
end
def down
|
Use raw SQL commands for 20140502125220 MigrateRepoSize
Partial fix for #15210
|
diff --git a/lib/tasks/remove_bot_users.rake b/lib/tasks/remove_bot_users.rake
index abc1234..def5678 100644
--- a/lib/tasks/remove_bot_users.rake
+++ b/lib/tasks/remove_bot_users.rake
@@ -7,7 +7,7 @@ .where("initcap(first_name) != first_name and initcap(last_name) != last_name")
puts "Preparing to remove #{suspected_bot_users.count} users:\n"
- suspected_bot_users.pluck(:first_name, :last_name).map(&:join).each do |full_name|
+ suspected_bot_users.pluck(:first_name, :last_name).map { |names| names.join(" ") }.each do |full_name|
puts full_name
end
puts "\nProceed? (y/N)"
|
Fix name listing in rake task
|
diff --git a/lib/acts_as_having_string_id/railtie.rb b/lib/acts_as_having_string_id/railtie.rb
index abc1234..def5678 100644
--- a/lib/acts_as_having_string_id/railtie.rb
+++ b/lib/acts_as_having_string_id/railtie.rb
@@ -1,13 +1,13 @@ module ActsAsHavingStringId
class Railtie < Rails::Railtie
initializer "railtie.include_in_application_record" do
+ ApplicationRecord.include(ActsAsHavingStringId)
+
if defined?(Spring)
Spring.after_fork do
# This needs to happen every time Spring reloads
ApplicationRecord.include(ActsAsHavingStringId)
end
- else
- ApplicationRecord.include(ActsAsHavingStringId)
end
end
end
|
Include module direclty even if spring is present
|
diff --git a/src/app/controllers/sessions_controller.rb b/src/app/controllers/sessions_controller.rb
index abc1234..def5678 100644
--- a/src/app/controllers/sessions_controller.rb
+++ b/src/app/controllers/sessions_controller.rb
@@ -10,7 +10,7 @@ return_to = session.delete(:return_to) || root_url
redirect_to return_to, notice: "Logged into #{current_provider.type}"
else
- flash.now.alert "Invalid cloud credentials"
+ flash.alert = "Invalid cloud credentials"
render "new"
end
end
|
Fix flash message for invalid credentials.
fixes #52
|
diff --git a/lib/multi_json/convertible_hash_keys.rb b/lib/multi_json/convertible_hash_keys.rb
index abc1234..def5678 100644
--- a/lib/multi_json/convertible_hash_keys.rb
+++ b/lib/multi_json/convertible_hash_keys.rb
@@ -2,40 +2,40 @@ module ConvertibleHashKeys
private
- def symbolize_keys(object)
- prepare_object(object) do |key|
+ def symbolize_keys(hash)
+ prepare_hash(hash) do |key|
key.respond_to?(:to_sym) ? key.to_sym : key
end
end
- def stringify_keys(object)
- prepare_object(object) do |key|
+ def stringify_keys(hash)
+ prepare_hash(hash) do |key|
key.respond_to?(:to_s) ? key.to_s : key
end
end
- def prepare_object(object, &key_modifier)
- return object unless block_given?
- case object
+ def prepare_hash(hash, &key_modifier)
+ return hash unless block_given?
+ case hash
when Array
- object.map do |value|
- prepare_object(value, &key_modifier)
+ hash.map do |value|
+ prepare_hash(value, &key_modifier)
end
when Hash
- object.inject({}) do |result, (key, value)|
+ hash.inject({}) do |result, (key, value)|
new_key = key_modifier.call(key)
- new_value = prepare_object(value, &key_modifier)
+ new_value = prepare_hash(value, &key_modifier)
result.merge! new_key => new_value
end
when String, Numeric, true, false, nil
- object
+ hash
else
- if object.respond_to?(:to_json)
- object
- elsif object.respond_to?(:to_s)
- object.to_s
+ if hash.respond_to?(:to_json)
+ hash
+ elsif hash.respond_to?(:to_s)
+ hash.to_s
else
- object
+ hash
end
end
end
|
Use more precise variable and method names
|
diff --git a/spec/unit/ldap/filter_parser_spec.rb b/spec/unit/ldap/filter_parser_spec.rb
index abc1234..def5678 100644
--- a/spec/unit/ldap/filter_parser_spec.rb
+++ b/spec/unit/ldap/filter_parser_spec.rb
@@ -0,0 +1,20 @@+# encoding: utf-8
+require 'spec_helper'
+
+describe Net::LDAP::Filter::FilterParser do
+
+ describe "#parse" do
+ context "Given ASCIIs as filter string" do
+ let(:filter_string) { "(&(objectCategory=person)(objectClass=user))" }
+ specify "should generate filter object" do
+ expect(Net::LDAP::Filter::FilterParser.parse(filter_string)).to be_a Net::LDAP::Filter
+ end
+ end
+ context "Given string including multibyte chars as filter string" do
+ let(:filter_string) { "(cn=名前)" }
+ specify "should generate filter object" do
+ expect(Net::LDAP::Filter::FilterParser.parse(filter_string)).to be_a Net::LDAP::Filter
+ end
+ end
+ end
+end
|
Add spec to reproduce FilterPraser.parse fails with multibyte char
|
diff --git a/FuntastyKit.podspec b/FuntastyKit.podspec
index abc1234..def5678 100644
--- a/FuntastyKit.podspec
+++ b/FuntastyKit.podspec
@@ -15,6 +15,7 @@ s.osx.deployment_target = "10.9"
s.watchos.deployment_target = "2.0"
s.tvos.deployment_target = "9.0"
+ s.swift_version = "4.2"
s.source = { :git => "https://github.com/thefuntasty/FuntastyKit.git", :tag => s.version.to_s }
s.source_files = "Sources/**/*"
s.ios.frameworks = "Foundation", "UIKit"
|
Add Swift version to Podspec
|
diff --git a/lib/substation/processor/transformer.rb b/lib/substation/processor/transformer.rb
index abc1234..def5678 100644
--- a/lib/substation/processor/transformer.rb
+++ b/lib/substation/processor/transformer.rb
@@ -8,8 +8,8 @@
# A transformer used to transform an incoming request
class Incoming
+ include Processor::Incoming
include Transformer
- include Processor::Incoming
def call(request)
request.success(compose(request, invoke(request)))
@@ -18,8 +18,8 @@
# A transformer used to transform an outgoing response
class Outgoing
+ include Processor::Outgoing
include Transformer
- include Processor::Outgoing
def call(response)
respond_with(response, compose(response, invoke(response)))
|
Align {Transformer, Wrapper} for future de-duplication
|
diff --git a/config/initializers/asset_tag_helper_asset_path.rb b/config/initializers/asset_tag_helper_asset_path.rb
index abc1234..def5678 100644
--- a/config/initializers/asset_tag_helper_asset_path.rb
+++ b/config/initializers/asset_tag_helper_asset_path.rb
@@ -0,0 +1,24 @@+# A monkey-patch to AssetTagHelper that prepends a directory with the rails asset it
+# to asset paths as well as using an asset query string. CDNs may ignore the querystring
+# so this is belt-and-braces cache busting. Requires a webserver-level rewrite rule
+# to strip the /rel-[asset-id]/ directory
+
+module ActionView
+ module Helpers #:nodoc:
+ module AssetTagHelper
+
+ private
+
+ if MySociety::Config.getbool("USE_VERSIONED_ASSET_PATHS", false)
+ def rewrite_asset_path(source)
+ asset_id = rails_asset_id(source)
+ if asset_id.blank?
+ source
+ else
+ "/rel-#{asset_id}" + source + "?#{asset_id}"
+ end
+ end
+ end
+ end
+ end
+end
|
Allow for versioned asset paths to get automatic cache busting of assets using a CDN that ignores querystrings
|
diff --git a/spec/lita/handlers/diceman_spec.rb b/spec/lita/handlers/diceman_spec.rb
index abc1234..def5678 100644
--- a/spec/lita/handlers/diceman_spec.rb
+++ b/spec/lita/handlers/diceman_spec.rb
@@ -12,4 +12,11 @@ expect(answers.include?(reply))
end
+ it "gives an random answer when using ?dice" do
+ answers = ["answer one", "answer two", "answer three"]
+ question = "Which is the correct answer"
+ send_message("?dice #{question}? " + answers.join(";"))
+ expect(replies.last.to_s).to match(/^(?:#{answers.map { |i| i.capitalize }.join("|")}) #{question.sub(/^\w+ /, "")}/)
+ end
+
end
|
Add a "real" test for ?dice
|
diff --git a/spec/mailers/member_mailer_spec.rb b/spec/mailers/member_mailer_spec.rb
index abc1234..def5678 100644
--- a/spec/mailers/member_mailer_spec.rb
+++ b/spec/mailers/member_mailer_spec.rb
@@ -1,19 +1,19 @@-require "rails_helper"
-
-RSpec.describe MemberMailer, :type => :mailer do
- describe "notify" do
- let(:member) { FactoryBot.create :member }
- let(:leader) { FactoryBot.create :leader }
- let(:mail) { MemberMailer.new_member member, leader.event_instance, 'What!' }
-
- it "renders the headers" do
- expect(mail.subject).to eq("Meu Evento (..) - A new member has just signed up")
- expect(mail.to).to eq([leader.member.email, "groups@berlin.church"])
- expect(mail.from).to eq(["groups@berlin.church"])
- end
-
- it "renders the body" do
- expect(mail.body.encoded).to include("Our new member Mario Bros has just signed up for Meu Evento (..)")
- end
- end
-end
+# require "rails_helper"
+#
+# RSpec.describe MemberMailer, :type => :mailer do
+# describe "notify" do
+# let(:member) { FactoryBot.create :member }
+# let(:leader) { FactoryBot.create :leader }
+# let(:mail) { MemberMailer.new_member member, leader.event_instance, 'What!' }
+#
+# it "renders the headers" do
+# expect(mail.subject).to eq("Meu Evento (..) - A new member has just signed up")
+# expect(mail.to).to eq([leader.member.email, "groups@berlin.church"])
+# expect(mail.from).to eq(["groups@berlin.church"])
+# end
+#
+# it "renders the body" do
+# expect(mail.body.encoded).to include("Our new member Mario Bros has just signed up for Meu Evento (..)")
+# end
+# end
+# end
|
Disable mailer tests due to ongoing configuration
|
diff --git a/test/unit/active_model/default_serializer_test.rb b/test/unit/active_model/default_serializer_test.rb
index abc1234..def5678 100644
--- a/test/unit/active_model/default_serializer_test.rb
+++ b/test/unit/active_model/default_serializer_test.rb
@@ -7,7 +7,6 @@ assert_equal(nil, DefaultSerializer.new(nil).serializable_object)
assert_equal(1, DefaultSerializer.new(1).serializable_object)
assert_equal('hi', DefaultSerializer.new('hi').serializable_object)
- assert_equal('1..3', DefaultSerializer.new(1..3).serializable_object)
end
end
end
|
Remove useless test that behaves differently in different Rails versions
|
diff --git a/lib/compass/app_integration/rails.rb b/lib/compass/app_integration/rails.rb
index abc1234..def5678 100644
--- a/lib/compass/app_integration/rails.rb
+++ b/lib/compass/app_integration/rails.rb
@@ -0,0 +1,10 @@+module Compass
+ module AppIntegration
+ module Rails
+ extend self
+ def initialize!
+ Compass::Util.compass_warn("WARNING: Please remove the call to Compass::AppIntegration::Rails.initialize! from #{caller[0].sub(/:.*$/,'')};\nWARNING: This is done automatically now. If this is default compass initializer you can just remove the file.")
+ end
+ end
+ end
+end
|
Handle upgraded projects with an old initializer with a nice warning.
|
diff --git a/lib/es6-module-mapper/transformer.rb b/lib/es6-module-mapper/transformer.rb
index abc1234..def5678 100644
--- a/lib/es6-module-mapper/transformer.rb
+++ b/lib/es6-module-mapper/transformer.rb
@@ -4,7 +4,8 @@ module ES6ModuleMapper
class Transformer
VERSION = '1'
- TRANSFORMER_CMD = 'node '+ File.join(File.dirname(__FILE__), 'transformer.js')
+ NODEJS_CMD = %w[node nodejs].map { |cmd| %x{which #{cmd}}.chomp }.find { |cmd| !cmd.empty? }
+ TRANSFORMER_CMD = "#{NODEJS_CMD} #{File.join(File.dirname(__FILE__), 'transformer.js')}"
MODULES_GLOBAL_VAR_NAME = 'window.____modules____'
MODULES_LOCAL_VAR_NAME = '__m__'
|
Handle different names for nodejs executable
Signed-off-by: Jesse Stuart <a5c95b3d7cb4d0ae05a15c79c79ab458dc2c8f9e@jessestuart.ca>
|
diff --git a/lib/hal_api/controller/exceptions.rb b/lib/hal_api/controller/exceptions.rb
index abc1234..def5678 100644
--- a/lib/hal_api/controller/exceptions.rb
+++ b/lib/hal_api/controller/exceptions.rb
@@ -0,0 +1,43 @@+require 'action_dispatch/http/request'
+require 'action_dispatch/middleware/exception_wrapper'
+
+# Since we are taking over exception handling, make sure we log exceptions
+# https://github.com/rails/rails/blob/4-2-stable/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb
+module HalApi::Controller::Exceptions
+ def respond_with_error(exception)
+ wrapper = ::ActionDispatch::ExceptionWrapper.new(env, exception)
+ log_error(env, wrapper)
+
+ error = exception.is_a?(HalApi::Errors::ApiError) ? exception : HalApi::Errors::ApiError.new
+ respond_with(
+ error,
+ status: error.status,
+ represent_with: HalApi::Errors::Representer
+ )
+ end
+
+ def log_error(env, wrapper)
+ logger = env['action_dispatch.logger'] || ActiveSupport::Logger.new($stderr)
+ return unless logger
+
+ exception = wrapper.exception
+
+ trace = wrapper.application_trace
+ trace = wrapper.framework_trace if trace.empty?
+
+ ActiveSupport::Deprecation.silence do
+ message = "\n#{exception.class} (#{exception.message}):\n"
+ message << exception.annoted_source_code.to_s if exception.respond_to?(:annoted_source_code)
+ message << " " << trace.join("\n ")
+ logger.fatal("#{message}\n\n")
+ end
+ end
+
+ module ClassMethods
+ def hal_rescue_standard_errors
+ rescue_from StandardError do |error|
+ respond_with_error(error)
+ end
+ end
+ end
+end
|
Add new exception handling methods
|
diff --git a/yesman.gemspec b/yesman.gemspec
index abc1234..def5678 100644
--- a/yesman.gemspec
+++ b/yesman.gemspec
@@ -12,8 +12,9 @@ gem.summary = %q{Yesman creates project directory structures, downloads and builds GTest for C++ development projects}
gem.homepage = ""
- gem.add_dependency 'mixlib-cli'
- gem.add_dependency 'paint'
+ gem.add_dependency 'mixlib-cli', '~> 1.2.2'
+ gem.add_dependency 'paint', '~> 0.8.5'
+ gem.add_dependency 'versionomy', '~> 0.4.4'
gem.files = `git ls-files`.split($/)
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
Add versionomy and version nums
|
diff --git a/lib/lita/handlers/wotd.rb b/lib/lita/handlers/wotd.rb
index abc1234..def5678 100644
--- a/lib/lita/handlers/wotd.rb
+++ b/lib/lita/handlers/wotd.rb
@@ -5,6 +5,8 @@ module Lita
module Handlers
class Wotd < Handler
+ WOTD_URL = 'https://wordsmith.org/awad/rss1.xml'.freeze
+
route(/wotd/, :wotd, command: true, help: {
'wotd' => 'returns the word of the day from dictionary.com'
})
@@ -14,18 +16,23 @@ end
private
+
def the_word
- "#{extract_the_word} - dictionary.com"
+ "#{extract_the_word} - wordsmith.org"
end
def extract_the_word
- xml_data = api_call.body
- doc = REXML::Document.new(xml_data)
- doc.get_elements('//description').last.get_text
+ title = doc.get_elements('//title').last.get_text
+ description = doc.get_elements('//description').last.get_text
+ "#{title} => #{description}"
+ end
+
+ def doc
+ @doc ||= REXML::Document.new(api_call.body)
end
def uri
- URI.parse 'http://www.dictionary.com/wordoftheday/wotd.rss'
+ URI.parse WOTD_URL
end
def api_call
|
Use wordsmith.org since dictionary.com no longer has RSS feed
|
diff --git a/lib/second_mate/finder.rb b/lib/second_mate/finder.rb
index abc1234..def5678 100644
--- a/lib/second_mate/finder.rb
+++ b/lib/second_mate/finder.rb
@@ -37,11 +37,11 @@ File.join root, relative_path
end
- def log(message)
+ def log(*messages)
if request.env['rack.errors'] && request.env['rack.errors'].respond_to?('write')
- env['rack.errors'].write message
+ env['rack.errors'].write messages.join("\n")
else
- puts message
+ puts *messages
end
end
|
Allow multiple messages in log calls
|
diff --git a/spec/fragmenter/wrapper_spec.rb b/spec/fragmenter/wrapper_spec.rb
index abc1234..def5678 100644
--- a/spec/fragmenter/wrapper_spec.rb
+++ b/spec/fragmenter/wrapper_spec.rb
@@ -5,11 +5,13 @@ let(:engine_class) { double(:engine_class, new: engine) }
let(:engine) { double(:engine) }
- subject(:base) { Fragmenter::Wrapper.new(object, engine_class) }
+ subject(:wrapper) do
+ Fragmenter::Wrapper.new(object, engine_class)
+ end
describe '#key' do
it 'composes a key from the object class and id value' do
- base.key.should match(/[a-z]+-\d+/)
+ expect(wrapper.key).to match(/[a-z]+-\d+/)
end
end
@@ -18,14 +20,14 @@ let(:headers) { {} }
it 'delegates #store to the storage engine' do
- engine.should_receive(:store).with(blob, headers)
+ expect(engine).to receive(:store).with(blob, headers)
- base.store(blob, headers)
+ wrapper.store(blob, headers)
end
it 'delegates #fragments to the storage engine' do
- engine.should_receive(:fragments)
- base.fragments
+ expect(engine).to receive(:fragments)
+ wrapper.fragments
end
end
@@ -34,9 +36,9 @@ engine.stub('meta' => { 'content_type' => 'application/octet-stream' },
'fragments' => ['1', '2'])
- base.as_json.tap do |json|
- json.should have_key('content_type')
- json.should have_key('fragments')
+ wrapper.as_json.tap do |json|
+ expect(json).to have_key('content_type')
+ expect(json).to have_key('fragments')
end
end
end
|
Update expectation syntax for wrapper specs
|
diff --git a/spec/git_tracker/branch_spec.rb b/spec/git_tracker/branch_spec.rb
index abc1234..def5678 100644
--- a/spec/git_tracker/branch_spec.rb
+++ b/spec/git_tracker/branch_spec.rb
@@ -4,6 +4,7 @@ subject { described_class }
def stub_branch(ref, exit_status = 0)
+ allow_message_expectations_on_nil
subject.stub(:`) { ref }
$?.stub(:exitstatus) { exit_status }
end
|
Allow stubs on nil, again. But just here.
|
diff --git a/lib/wkhtmltopdf-heroku.rb b/lib/wkhtmltopdf-heroku.rb
index abc1234..def5678 100644
--- a/lib/wkhtmltopdf-heroku.rb
+++ b/lib/wkhtmltopdf-heroku.rb
@@ -1,4 +1,5 @@ # config/initializers/pdfkit.rb
+require 'pdfkit'
PDFKit.configure do |config|
config.wkhtmltopdf = File.expand_path "../../bin/wkhtmltopdf-linux-amd64", __FILE__
# config.default_options = {
|
Add missing require for pdfkit
|
diff --git a/toadhopper-sinatra.gemspec b/toadhopper-sinatra.gemspec
index abc1234..def5678 100644
--- a/toadhopper-sinatra.gemspec
+++ b/toadhopper-sinatra.gemspec
@@ -10,7 +10,7 @@ s.require_path = "lib"
s.rubyforge_project = "th-sinatra"
s.files = %w(
- Readme.md
+ README.md
Rakefile
LICENSE
lib/sinatra/toadhopper.rb
|
Update the gemspec with the correct readme
|
diff --git a/lib/activerecord-human-id/extension/persistence.rb b/lib/activerecord-human-id/extension/persistence.rb
index abc1234..def5678 100644
--- a/lib/activerecord-human-id/extension/persistence.rb
+++ b/lib/activerecord-human-id/extension/persistence.rb
@@ -7,7 +7,8 @@ if Generation.ready_to_generate?(model)
new_value = model.send("generate_#{human_id}")
if model.send(human_id) != new_value
- model.send("#{human_id}=", new_value)
+ model[human_id] = new_value
+ model.update_column(human_id, new_value)
model.save!
end
end
|
Update attr directly in db
|
diff --git a/lib/rspec-puppet/example/function_example_group.rb b/lib/rspec-puppet/example/function_example_group.rb
index abc1234..def5678 100644
--- a/lib/rspec-puppet/example/function_example_group.rb
+++ b/lib/rspec-puppet/example/function_example_group.rb
@@ -12,6 +12,7 @@ node_name = nodename(:function)
function_scope = scope(compiler, node_name)
+ function_scope.resource = Puppet::Parser::Resource.new('class', 'main' , { :scope => function_scope })
# Return the method instance for the function. This can be used with
# method.call
|
Set main scope for function calls
|
diff --git a/tunefish.gemspec b/tunefish.gemspec
index abc1234..def5678 100644
--- a/tunefish.gemspec
+++ b/tunefish.gemspec
@@ -21,6 +21,8 @@ spec.add_development_dependency "bundler", "~> 1.6"
spec.add_development_dependency "rake"
spec.add_development_dependency "minitest"
+ spec.add_development_dependency "webmock"
+ spec.add_development_dependency "vcr"
spec.add_dependency "faraday"
spec.add_dependency "json"
end
|
Add webmock and vcr to gemspec dev dependencies
|
diff --git a/lib/scss_lint/linter/property_format_linter.rb b/lib/scss_lint/linter/property_format_linter.rb
index abc1234..def5678 100644
--- a/lib/scss_lint/linter/property_format_linter.rb
+++ b/lib/scss_lint/linter/property_format_linter.rb
@@ -17,7 +17,8 @@
def description
'Property declarations should always be on one line of the form ' <<
- '`name: value;` or `name: [value] {`'
+ '`name: value;` or `name: [value] {` ' <<
+ '(are you missing a trailing semi-colon?)'
end
private
|
Improve message for property format linter
Changes the lint error description for the property format linter to
suggest that the user is missing a semi-colon, as that usually is the
reason they are seeing the lint, and the more general language of the
error can be confusing the read at times.
Change-Id: I58dcb2845ba206e42de444381ab77d8bd1503614
Reviewed-on: https://gerrit.causes.com/17772
Tested-by: Shane da Silva <6f6e68d1df92f30cb4b3ce35260ddf94a402f33d@causes.com>
Reviewed-by: Joe Lencioni <1dd72cf724deaab5db236f616560fc7067b734e1@causes.com>
|
diff --git a/modules/daptiv/files/chefdk/knife.rb b/modules/daptiv/files/chefdk/knife.rb
index abc1234..def5678 100644
--- a/modules/daptiv/files/chefdk/knife.rb
+++ b/modules/daptiv/files/chefdk/knife.rb
@@ -2,14 +2,15 @@ home_dir = ENV['HOME'] || ENV['HOMEDRIVE']
org = ENV['CHEF_ORG'] || 'daptiv'
knife_override = "#{home_dir}/.chef/knife_override.rb"
+user_name = ( ENV['USER'] || ENV['USERNAME'] ).downcase
chef_server_url "https://api.opscode.com/organizations/#{org}"
log_level :info
log_location STDOUT
# USERNAME is UPPERCASE in Windows, but lowercase in the Chef server, so `downcase` it.
-node_name ( ENV['USER'] || ENV['USERNAME'] ).downcase
-client_key "#{home_dir}/.chef/#{node_name}.pem"
+node_name user_name
+client_key "#{home_dir}/.chef/#{user_name}.pem"
cache_type 'BasicFile'
cache_options( :path => "#{home_dir}/.chef/checksums" )
validation_client_name "#{org}-validator"
|
Fix Ridley error when reading client_key
|
diff --git a/spec/features/resources_spec.rb b/spec/features/resources_spec.rb
index abc1234..def5678 100644
--- a/spec/features/resources_spec.rb
+++ b/spec/features/resources_spec.rb
@@ -1,7 +1,7 @@ require 'spec_helper'
module DbdDataEngine
- describe 'Resources' do
+ describe ResourcesController do
describe 'GET /data/resources' do
context 'routing' do
it 'resources_path is correct' do
|
Use class in describe for spec
|
diff --git a/spec/requests/customers_spec.rb b/spec/requests/customers_spec.rb
index abc1234..def5678 100644
--- a/spec/requests/customers_spec.rb
+++ b/spec/requests/customers_spec.rb
@@ -0,0 +1,19 @@+require 'rails_helper'
+
+RSpec.describe 'Customers', type: :request do
+ describe 'GET /customers' do
+ it 'successful request' do
+ get '/api/customers'
+ expect(response).to have_http_status(200)
+ end
+ end
+
+ describe 'GET /customers/:id' do
+ it 'successful request' do
+ customer = Customer.create(first_name: 'J', last_name: 'C')
+ get "/api/customers/#{customer.id}"
+ expect(response).to have_http_status(200)
+ expect(JSON.parse(response.body)['first_name']).to eq('J')
+ end
+ end
+end
|
Add spec for customers API endpoint
|
diff --git a/spec/yelp/client/search_spec.rb b/spec/yelp/client/search_spec.rb
index abc1234..def5678 100644
--- a/spec/yelp/client/search_spec.rb
+++ b/spec/yelp/client/search_spec.rb
@@ -23,7 +23,7 @@ end
it 'should search the yelp api and get results' do
- response.businesses.size.should be > 0
+ @client.search(location).businesses.size.should be > 0
end
end
end
|
Fix incorrect variable in search test
|
diff --git a/Casks/acorn3.rb b/Casks/acorn3.rb
index abc1234..def5678 100644
--- a/Casks/acorn3.rb
+++ b/Casks/acorn3.rb
@@ -2,8 +2,8 @@ version '3.5.2'
sha256 'ffc4cd551b9eb2ebadfe8e59c95e84b1f59538d7915eff63dd6c3efdca7858e6'
- url "http://flyingmeat.com/download/Acorn-#{version}.zip"
- homepage 'http://flyingmeat.com/acorn/'
+ url "https://secure.flyingmeat.com/download/Acorn-#{version}.zip"
+ homepage 'https://secure.flyingmeat.com/acorn/'
license :closed
app 'Acorn.app'
|
Update Acorn3 URL and hompage
|
diff --git a/Casks/perian.rb b/Casks/perian.rb
index abc1234..def5678 100644
--- a/Casks/perian.rb
+++ b/Casks/perian.rb
@@ -14,6 +14,6 @@ caveats <<-EOS.undent
Perian development officially stopped as of 2012, and 1.2.3 was the final released version.
- See the Perian homepage for more information.
+ See the Perian homepage for more information (http://www.perian.org/).
EOS
end
|
Add homepage url to Perian caveat to assist users in finding a replacement. (Perian is no longer maintained.)
|
diff --git a/app/controllers/monologue/author_posts_controller.rb b/app/controllers/monologue/author_posts_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/monologue/author_posts_controller.rb
+++ b/app/controllers/monologue/author_posts_controller.rb
@@ -0,0 +1,7 @@+class Monologue::AuthorPostsController < Monologue::ApplicationController
+
+ def index
+ @user = Monologue::User.find(params[:user_id])
+ @posts = @user.posts.page(@page).includes(:user).published
+ end
+end
|
Add controller for blog author page
|
diff --git a/app/services/course/group_manager_preload_service.rb b/app/services/course/group_manager_preload_service.rb
index abc1234..def5678 100644
--- a/app/services/course/group_manager_preload_service.rb
+++ b/app/services/course/group_manager_preload_service.rb
@@ -13,7 +13,7 @@ # Returns all managers of the groups that the given CourseUser are a part of.
# Assumes that GroupUsers and their Groups have been loaded for the given CourseUser.
#
- # @param [CourseUser] course_user The given CoruseUser
+ # @param [CourseUser] course_user The given CourseUser
# @return [Array<CourseUser>]
def group_managers_of(course_user)
course_user.groups.map do |group|
|
Fix typo: CoruseUser -> CourseUser
|
diff --git a/spec/cabinet/cloud_spec.rb b/spec/cabinet/cloud_spec.rb
index abc1234..def5678 100644
--- a/spec/cabinet/cloud_spec.rb
+++ b/spec/cabinet/cloud_spec.rb
@@ -5,4 +5,35 @@ credentials = YAML.load_file(File.expand_path(File.join(File.dirname(__FILE__), '..', 'cloud_credentials.yml')))
@cc = Cabinet::Cloud.new({:container => 'cabinet_test'}.merge(credentials))
end
+
+ it "should create file" do
+ @cc.put(@@file_name, @@file_content).should == true
+ end
+
+ it "should confirm file exists" do
+ @cc.exists?(@@file_name).should == true
+ end
+
+ it "should confirm file does not exist" do
+ @cc.exists?(@@file_content).should == false
+ end
+
+ it "should read file" do
+ @cc.get(@@file_name).should == @@file_content
+ end
+
+ it "should list files"
+
+ it "should not overwrite file"
+
+ it "should overwrite file if :force => true"
+
+ it "should gzip file"
+
+ it "should delete file" do
+ @cc.delete(@@file_name)
+ @cc.exists?(@@file_name).should == false
+ end
+
+ it "should bulk delete files"
end
|
Add basic tests for cloud spec
|
diff --git a/lib/guard/helpers.rb b/lib/guard/helpers.rb
index abc1234..def5678 100644
--- a/lib/guard/helpers.rb
+++ b/lib/guard/helpers.rb
@@ -13,6 +13,7 @@ end
def ui(method, msg, options)
+ UI.clear if options.delete(:clear)
UI.__send__(method, "#{self.class.name} #{msg}", options)
end
|
Fix a change in Guard::UI api
|
diff --git a/lib/identity/main.rb b/lib/identity/main.rb
index abc1234..def5678 100644
--- a/lib/identity/main.rb
+++ b/lib/identity/main.rb
@@ -16,7 +16,7 @@ http_only: true,
path: '/',
expire_after: Config.cookie_expire_after,
- key: 'identity-sso-session'
+ key: 'identity-session'
# CSRF + Flash should come before the unadorned heroku cookies that follow
|
Rename cookie key to `identity-session`
(Identity is not used for SSO.)
|
diff --git a/test/integration/multisite_test.rb b/test/integration/multisite_test.rb
index abc1234..def5678 100644
--- a/test/integration/multisite_test.rb
+++ b/test/integration/multisite_test.rb
@@ -29,7 +29,7 @@ assert_select 'body', /1 person found/
assert_select 'body', /Jim Williams/
assert_select 'body', :html => /Tom Jones/, :count => 0
- get '/people/view/9'
+ get '/people/9'
assert_response :missing
end
end
|
Fix old url in test.
|
diff --git a/test/shared/spec/container_spec.rb b/test/shared/spec/container_spec.rb
index abc1234..def5678 100644
--- a/test/shared/spec/container_spec.rb
+++ b/test/shared/spec/container_spec.rb
@@ -24,6 +24,16 @@ it { should_not be_running }
end
+ describe docker_container('busybox-container', 'sleep 7777') do
+ it { should be_a_container }
+ it { should_not be_running }
+ end
+
+ describe docker_container('busybox-container', 'sleep 8888') do
+ it { should be_a_container }
+ it { should be_running }
+ end
+
describe docker_container('bflad/testcontainerd') do
it { should be_a_container }
it { should be_running }
|
Add Serverspec tests for busybox-container 7777/8888
|
diff --git a/week-6/nested_data_solution.rb b/week-6/nested_data_solution.rb
index abc1234..def5678 100644
--- a/week-6/nested_data_solution.rb
+++ b/week-6/nested_data_solution.rb
@@ -0,0 +1,83 @@+# RELEASE 2: NESTED STRUCTURE GOLF
+# Hole 1
+# Target element: "FORE"
+
+array = [[1,2], ["inner", ["eagle", "par", ["FORE", "hook"]]]]
+
+# attempts:2
+# ============================================================
+p array[1][1][2][0]
+
+
+# ============================================================
+
+# Hole 2
+# Target element: "congrats!"
+
+hash = {outer: {inner: {"almost" => {3 => "congrats!"}}}}
+p hash[:outer][:inner]["almost"][3]
+# attempts:1
+# ============================================================
+
+
+
+# ============================================================
+
+
+# Hole 3
+# Target element: "finished"
+
+nested_data = {array: ["array", {hash: "finished"}]}
+
+# attempts:1
+# ============================================================
+
+p nested_data[:array][1][:hash]
+
+# ============================================================
+
+# RELEASE 3: ITERATE OVER NESTED STRUCTURES
+
+number_array = [5, [10, 15], [20,25,30], 35]
+
+
+number_array.map! do |element|
+ if element.kind_of?(Array)
+ element.map! {|inner| inner+5 }
+ else
+ element + 5
+ end
+end
+p number_array
+# Bonus:
+
+startup_names = ["bit", ["find", "fast", ["optimize", "scope"]]]
+
+startup_names.map! do |element|
+ if element.kind_of?(Array)
+ element.map! do |inner|
+ if inner.kind_of?(Array)
+ inner.map! {|inner| inner << "ly"}
+ else
+ inner << "ly"
+ end
+ end
+ else
+ element << "ly"
+ end
+end
+p startup_names
+
+
+# Reflect
+
+# What are some general rules you can apply to nested arrays?
+# You can have as many nested arrays within an array.
+# In order to access to each element in a nested array, you need to test to see if the element is an array by using ie an if statement and then have another loop in that array to access the nested elements.
+
+
+# What are some ways you can iterate over nested arrays?
+# You can iterate over the nested arrays using an enumerator, such as each, map or collect. To access another array in the array, you can do an if statement for the element that runs another enumerator block if the element is an array. You can repeate this loop for another level of nested array.
+
+# Did you find any good new methods to implement or did you re-use one you were already familiar with? What was it and why did you decide that was a good option?
+# We stuck to the same method of using an enumerator and then an if statement because we wanted to become more familiar using this setup and it got tricky when another of level of array was implemented but we figured it out.
|
Add code for 6.5 exercise
|
diff --git a/lib/plugins/lyric.rb b/lib/plugins/lyric.rb
index abc1234..def5678 100644
--- a/lib/plugins/lyric.rb
+++ b/lib/plugins/lyric.rb
@@ -24,7 +24,7 @@ end
def help(m)
- m.reply 'returns song that includes the specified lyric'
+ m.reply 'returns song that includes the specified lyric (via Genius knowledge base)'
end
end
|
Update help response to include source of results
|
diff --git a/lib/qbfc/qb_types.rb b/lib/qbfc/qb_types.rb
index abc1234..def5678 100644
--- a/lib/qbfc/qb_types.rb
+++ b/lib/qbfc/qb_types.rb
@@ -8,7 +8,7 @@
# Query types support Query requests only and return an itemized list of some sort;
# most of these may be integrated as special finders for their types.
-QBFC_QUERY_TYPES = %w{BillToPay ListDeleted ReceivePaymentToDeposit Template TxnDeleted SalesTaxPaymentCheck}
+QBFC_QUERY_TYPES = %w{BillToPay ListDeleted ReceivePaymentToDeposit Template TxnDeleted}
module QBFC
# Create QBElement classes
|
Delete double generation of SalesTaxPaymentCheck class
|
diff --git a/backend/spree_backend.gemspec b/backend/spree_backend.gemspec
index abc1234..def5678 100644
--- a/backend/spree_backend.gemspec
+++ b/backend/spree_backend.gemspec
@@ -21,6 +21,7 @@ s.add_dependency 'spree_api', version
s.add_dependency 'spree_core', version
+ s.add_dependency 'deface', '>= 0.9.0'
s.add_dependency 'jquery-rails', '~> 3.0.0'
s.add_dependency 'jquery-ui-rails', '~> 4.0.0'
s.add_dependency 'select2-rails', '~> 3.4.7'
|
Remove rails from frontend and backend gemspecs.
|
diff --git a/lib/tasks/dumps.rake b/lib/tasks/dumps.rake
index abc1234..def5678 100644
--- a/lib/tasks/dumps.rake
+++ b/lib/tasks/dumps.rake
@@ -5,12 +5,12 @@ end
desc 'Backups a transaction dump file to a remote provider. '\
- 'Accepts an argument to specify the dump date (defaults to today)'
+ 'Accepts an argument to specify the dump date (defaults to yesterday)'
task :backup, [:date] => [:environment] do |_, args|
require 'envelope_dump'
require 'generate_envelope_dump'
- date = process_date(args[:date])
+ date = parse(args[:date])
provider = InternetArchive.new
dump_generator = GenerateEnvelopeDump.new(date, provider)
@@ -22,20 +22,21 @@ end
desc 'Restores envelopes from a remote provider into the local database. '\
- 'Accepts an argument to specify the starting date (defaults to today)'
+ 'Accepts an argument to specify the starting date (defaults to '\
+ 'yesterday)'
task :restore, [:from_date] => [:environment] do |_, args|
require 'restore_envelope_dumps'
- from_date = process_date(args[:from_date])
+ from_date = parse(args[:from_date])
puts "Restoring transactions from #{format(from_date)} to today"
RestoreEnvelopeDumps.new(from_date).run
end
- def process_date(date)
+ def parse(date)
Date.parse(date.to_s)
rescue ArgumentError
- Date.current
+ Date.current - 1
end
def format(date)
|
Set yesterday as the default backup/restore date
|
diff --git a/libraries/helpers.rb b/libraries/helpers.rb
index abc1234..def5678 100644
--- a/libraries/helpers.rb
+++ b/libraries/helpers.rb
@@ -44,6 +44,8 @@ def home_basedir
if platform_family?('mac_os_x')
'/Users'
+ elsif platform_family?('solaris2')
+ '/export/home'
else
'/home'
end
|
Add home directory base for solaris
Signed-off-by: Jaymala Sinha <a04666c8f252cd920997ac90b34d2eff29d09ccc@chef.io>
|
diff --git a/chef-repo/site-cookbooks/sysbench/recipes/install.rb b/chef-repo/site-cookbooks/sysbench/recipes/install.rb
index abc1234..def5678 100644
--- a/chef-repo/site-cookbooks/sysbench/recipes/install.rb
+++ b/chef-repo/site-cookbooks/sysbench/recipes/install.rb
@@ -1,5 +1,8 @@-# Update package index (Ubuntu or Debian)
-include_recipe "apt"
+case node['platform_family']
+ when "debian"
+ # Update package index
+ include_recipe "apt"
+end
package "sysbench" do
action :install
|
Add platform dependent package update to sysbench cookbook
|
diff --git a/lita-imgflip.gemspec b/lita-imgflip.gemspec
index abc1234..def5678 100644
--- a/lita-imgflip.gemspec
+++ b/lita-imgflip.gemspec
@@ -1,6 +1,6 @@ Gem::Specification.new do |spec|
spec.name = "lita-imgflip"
- spec.version = "1.0.1"
+ spec.version = "1.0.2"
spec.authors = ["Henrik Sjökvist"]
spec.email = ["henrik.sjokvist@gmail.com"]
spec.description = %q{A Lita handler for generating meme images using imgflip.com.}
@@ -13,7 +13,7 @@ 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"
|
Update lita gem version requirement to support version 3, bump version.
|
diff --git a/lib/banzai/filter/external_link_filter.rb b/lib/banzai/filter/external_link_filter.rb
index abc1234..def5678 100644
--- a/lib/banzai/filter/external_link_filter.rb
+++ b/lib/banzai/filter/external_link_filter.rb
@@ -15,7 +15,7 @@ # Skip internal links
next if link.start_with?(internal_url)
- node.set_attribute('rel', 'nofollow')
+ node.set_attribute('rel', 'nofollow noreferrer')
end
doc
|
Add noreferrer value to rel attribute for external links
|
diff --git a/app/decorators/user_decorator.rb b/app/decorators/user_decorator.rb
index abc1234..def5678 100644
--- a/app/decorators/user_decorator.rb
+++ b/app/decorators/user_decorator.rb
@@ -18,7 +18,7 @@ end
def image_link(size = 40)
- link_to image_tag(image, class: 'thumb dib', height: size, width: size), author_path(source)
+ link_to image_tag(image, class: 'thumb dib', height: size, width: size), author_path(object)
end
def link
|
Remove stupid leftover source calls
|
diff --git a/app/uploaders/avatar_uploader.rb b/app/uploaders/avatar_uploader.rb
index abc1234..def5678 100644
--- a/app/uploaders/avatar_uploader.rb
+++ b/app/uploaders/avatar_uploader.rb
@@ -25,7 +25,7 @@ # uploaded avatar for the model.
#
# Returns nothing of interest.
- def purge_from_cdn(file)
+ def purge_from_cdn(file=nil)
if Rails.env.production?
AvatarPurgeWorker.perform_async(model.id.to_s, model.class.to_s)
end
|
Fix avatar uploader error once and for all.
|
diff --git a/bundler-update_stdout.gemspec b/bundler-update_stdout.gemspec
index abc1234..def5678 100644
--- a/bundler-update_stdout.gemspec
+++ b/bundler-update_stdout.gemspec
@@ -18,6 +18,6 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]
- spec.add_development_dependency "bundler", ">= 1.4.0.pre.1"
+ spec.add_development_dependency "bundler", ">= 1.4.0.pre.2"
spec.add_development_dependency "rake"
end
|
Set more strict minimum version
|
diff --git a/app/models/competitions/oregon_junior_mountain_bike_series/overall.rb b/app/models/competitions/oregon_junior_mountain_bike_series/overall.rb
index abc1234..def5678 100644
--- a/app/models/competitions/oregon_junior_mountain_bike_series/overall.rb
+++ b/app/models/competitions/oregon_junior_mountain_bike_series/overall.rb
@@ -0,0 +1,54 @@+# frozen_string_literal: true
+
+module Competitions
+ module OregonJuniorMountainBikeSeries
+ class Overall < Competition
+ def friendly_name
+ "Oregon Junior Mountain Bike Series"
+ end
+
+ def point_schedule
+ [30, 28, 26, 24, 22, 20, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
+ end
+
+ def members_only?
+ false
+ end
+
+ def category_names
+ [
+ "Category 3 Junior Men 10-13",
+ "Category 3 Junior Men 14-18",
+ "Category 3 Junior Women 10-13",
+ "Category 3 Junior Women 14-18",
+ "Junior Expert Men",
+ "Junior Expert Women"
+ ]
+ end
+
+ def categories_clause(race)
+ if race.category.abilities == (0..0)
+ Category.where(ages_begin: 9, ages_end: 18, gender: race.category.gender, ability_begin: 0, ability_end: 0)
+ else
+ Category
+ .where(gender: race.category.gender)
+ .where("(ability_begin = 3 and ability_end = 5) or (ability_begin = 0 and ability_end = 999)")
+ .where("ages_begin >= ?", race.category.ages_begin)
+ .where("ages_end <= ?", race.category.ages_end)
+ end
+ end
+
+ def maximum_events(_)
+ 4
+ end
+
+ def source_events?
+ true
+ end
+
+ def create_slug
+ "ojcs"
+ end
+ end
+ end
+end
|
Add Oregon Junior Mountain Bike Series
|
diff --git a/server.rb b/server.rb
index abc1234..def5678 100644
--- a/server.rb
+++ b/server.rb
@@ -3,7 +3,7 @@ require 'bundler/setup'
Bundler.require(:default)
-REAL_GARAGE = !!(`uname -a` =~ /raspberrypi/)
+REAL_GARAGE = !!(`uname -a` =~ /armv6l/)
require 'logger'
require 'garage'
|
Use GPIO based on architecture
|
diff --git a/wordless.gemspec b/wordless.gemspec
index abc1234..def5678 100644
--- a/wordless.gemspec
+++ b/wordless.gemspec
@@ -2,7 +2,7 @@ require File.expand_path('../lib/wordless/version', __FILE__)
Gem::Specification.new do |gem|
- gem.authors = ["Étienne Després"]
+ gem.authors = ["Étienne Després", "Ju Liu"]
gem.email = ["etienne@molotov.ca"]
gem.description = %q{Command line tool to manage Wordless themes.}
gem.summary = %q{Manage Wordless themes.}
|
Add Ju Liu as an author.
|
diff --git a/workless.gemspec b/workless.gemspec
index abc1234..def5678 100644
--- a/workless.gemspec
+++ b/workless.gemspec
@@ -20,7 +20,7 @@ s.summary = %q{Use delayed job workers only when theyre needed on Heroku}
s.add_runtime_dependency(%q<rails>)
- s.add_runtime_dependency(%q<heroku>)
+ s.add_runtime_dependency(%q<heroku-api>)
s.add_runtime_dependency(%q<rush>)
s.add_runtime_dependency(%q<delayed_job>, [">= 2.0.7"])
|
Upgrade dependency to the heroku-api gem
This gem is better up to date for interacting with
the Heroku API. This gem is better supported.
|
diff --git a/spec/flipper/redis_spec.rb b/spec/flipper/redis_spec.rb
index abc1234..def5678 100644
--- a/spec/flipper/redis_spec.rb
+++ b/spec/flipper/redis_spec.rb
@@ -3,7 +3,15 @@ require 'flipper/spec/shared_adapter_specs'
describe Flipper::Adapters::Redis do
- let(:client) { Redis.new }
+ let(:client) {
+ options = {}
+
+ if ENV['BOXEN_REDIS_URL']
+ options[:url] = ENV['BOXEN_REDIS_URL']
+ end
+
+ Redis.new(options)
+ }
subject { described_class.new(client) }
|
Use boxen redis if available.
|
diff --git a/spec/http/response_spec.rb b/spec/http/response_spec.rb
index abc1234..def5678 100644
--- a/spec/http/response_spec.rb
+++ b/spec/http/response_spec.rb
@@ -0,0 +1,37 @@+require 'spec_helper'
+
+describe Http::Response do
+
+ let(:subject){ Http::Response.new }
+
+ describe "the response headers" do
+
+ it 'are available through Hash-like methods' do
+ subject["content-type"] = "text/plain"
+ subject["content-type"].should eq("text/plain")
+ end
+
+ it 'are available through a `headers` accessor' do
+ subject["content-type"] = "text/plain"
+ subject.headers.should eq("content-type" => "text/plain")
+ end
+
+ end
+
+ describe "parse_body" do
+
+ it 'works on a registered mime-type' do
+ subject["content-type"] = "application/json"
+ subject.body = ::JSON.dump("hello" => "World")
+ subject.parse_body.should eq("hello" => "World")
+ end
+
+ it 'returns the body on an unregistered mime-type' do
+ subject["content-type"] = "text/plain"
+ subject.body = "Hello world"
+ subject.parse_body.should eq("Hello world")
+ end
+
+ end
+
+end
|
Add a spec for Http::Response
|
diff --git a/spec/models/device_spec.rb b/spec/models/device_spec.rb
index abc1234..def5678 100644
--- a/spec/models/device_spec.rb
+++ b/spec/models/device_spec.rb
@@ -1,6 +1,10 @@ require "spec_helper"
describe Device do
+ it { should respond_to(:surveys) }
+ it { should respond_to(:danger_zone?) }
+ it { should respond_to(:last_survey) }
+
it "should be in the danger zone if last survey is too old" do
device = Device.new
survey = Survey.new
|
Add method specs for device spec
|
diff --git a/spec/models/payout_spec.rb b/spec/models/payout_spec.rb
index abc1234..def5678 100644
--- a/spec/models/payout_spec.rb
+++ b/spec/models/payout_spec.rb
@@ -14,4 +14,6 @@ Payout.complete(1, 3)
end
end
+
+ after(:all) { PaymentEngine.destroy_all }
end
|
Destroy payment engines after specs on payout
|
diff --git a/spec/rails_reseed_spec.rb b/spec/rails_reseed_spec.rb
index abc1234..def5678 100644
--- a/spec/rails_reseed_spec.rb
+++ b/spec/rails_reseed_spec.rb
@@ -8,7 +8,7 @@ expect(task_name).to eq(subject.name)
end
- it "executes its dependant rake tasks" do
+ it "executes its prerequisites rake tasks" do
expect(subject.prerequisites).to eq(["db:drop", "db:create", "db:migrate", "db:seed"])
end
end
|
Fix what we're actually testing
|
diff --git a/spec/routing/game_spec.rb b/spec/routing/game_spec.rb
index abc1234..def5678 100644
--- a/spec/routing/game_spec.rb
+++ b/spec/routing/game_spec.rb
@@ -0,0 +1,27 @@+require 'spec_helper'
+
+describe "routing to games" do
+ it "routes /games to game#index" do
+ {:get, "/games"}.should route_to(:action => :index)
+ end
+
+ it "routes /games/new to game#new" do
+ {:get, "/game/new"}.should route_to(:action => :new)
+ end
+
+ it "routes a post to /games to game#create" do
+ {:post, "/games"}.should route_to(:action => :create)
+ end
+
+ it "routes /game/:id to game#show for id" do
+ {:get, "/game/1"}.should route_to(:action => :show, :id => 1)
+ end
+
+ it "routes /game/:id to game#show for id" do
+ {:edit, "/game/1"}.should route_to(:action => :show, :id => 1)
+ end
+
+ it "routes /game/:id to game#update for id" do
+ {:put, "/game/1"}.should route_to(:action => :update, :id => 1)
+ end
+end
|
Add the start of routing specs.
|
diff --git a/spec/api_classes/library_spec.rb b/spec/api_classes/library_spec.rb
index abc1234..def5678 100644
--- a/spec/api_classes/library_spec.rb
+++ b/spec/api_classes/library_spec.rb
@@ -2,10 +2,10 @@
describe LastFM::Library do
it "should define unrestricted methods" do
- LastFM::Library.unrestricted_methods.should == [:get_albums, :get_artists, :get_tracks]
+ LastFM::Library.should respond_to(:get_albums, :get_artists, :get_tracks)
end
it "should define restricted methods" do
- LastFM::Library.restricted_methods.should == [:add_album, :add_artist, :add_track]
+ LastFM::Library.should respond_to(:add_album, :add_artist, :add_track)
end
end
|
Check restricted method definitions for Library
|
diff --git a/spec/features/clubs/view_spec.rb b/spec/features/clubs/view_spec.rb
index abc1234..def5678 100644
--- a/spec/features/clubs/view_spec.rb
+++ b/spec/features/clubs/view_spec.rb
@@ -1,28 +1,23 @@ require 'spec_helper.rb'
-cl1attrs = FactoryGirl::attributes_for(:club)
-cl2attrs = FactoryGirl::attributes_for(:club)
-
feature "Viewing a Club", js: true do
- before do
- club1 = Club.create!(cl1attrs);
-
- club2 = Club.create!(cl2attrs);
- end
+ let(:club1) {FactoryGirl::create(:club)}
+ let(:club2) {FactoryGirl::create(:club)}
scenario "view one Club" do
+ club1
+ club2
visit "#/clubs"
- click_on cl1attrs[:name]
+ click_on club1.name
- expect(page).to have_content(cl1attrs[:name])
- expect(page).to have_content(cl1attrs[:city])
- expect(page).to have_content(cl1attrs[:description])
+ expect(page).to have_content(club1.name)
+ expect(page).to have_content(club1.city)
+ expect(page).to have_content(club1.description)
click_on "index-club"
- expect(page).to have_content(cl2attrs[:name])
- expect(page).to_not have_content(cl2attrs[:city])
- expect(page).to_not have_content(cl2attrs[:description])
+ expect(page).not_to have_content(club1.description)
+ expect(page).not_to have_content(club2.description)
end
end
|
Improve clubs view feature spec
|
diff --git a/db/feature_migrate/20120426073305_create_backlogs.rb b/db/feature_migrate/20120426073305_create_backlogs.rb
index abc1234..def5678 100644
--- a/db/feature_migrate/20120426073305_create_backlogs.rb
+++ b/db/feature_migrate/20120426073305_create_backlogs.rb
@@ -14,7 +14,6 @@ backlog = Backlog.create! name: "backlog", locked: false
sprint_backlog = Backlog.create! name: "sprint_backlog", locked: false
finished_backlog = Backlog.create! name: "finished_backlog", locked: false
- new_issues = Backlog.create! name: "new_issues", locked: false
Issue.all.each do |issue|
if issue.finished
|
Remove new issues list from migration
|
diff --git a/config/initializers/apipie.rb b/config/initializers/apipie.rb
index abc1234..def5678 100644
--- a/config/initializers/apipie.rb
+++ b/config/initializers/apipie.rb
@@ -4,4 +4,5 @@ config.doc_base_url = '/documentation'
# where is your API defined?
config.api_controllers_matcher = "#{Rails.root}/app/controllers/*.rb"
+ config.reload_controllers = true
end
|
Fix APIPIE documentation on Heroku.
Set config.reload_controllers = true in Apiepie initializer because it doesn't automatically load documentation for each controller in test and production.
|
diff --git a/app/models/pet.rb b/app/models/pet.rb
index abc1234..def5678 100644
--- a/app/models/pet.rb
+++ b/app/models/pet.rb
@@ -6,7 +6,7 @@ attr_accessor :form_step
validates :name, :owner_name, presence: true, if: -> { required_for_step?(:identity) }
- validates :identifying_characteristics, presence: true, if: -> { required_for_step?(:characteristics) }
+ validates :identifying_characteristics, :colour, presence: true, if: -> { required_for_step?(:characteristics) }
validates :special_instructions, presence: true, if: -> { required_for_step?(:instructions) }
def required_for_step?(step)
|
Validate presence of colour on characteristics step
|
diff --git a/spec/cukeforker/vnc_server_pool_spec.rb b/spec/cukeforker/vnc_server_pool_spec.rb
index abc1234..def5678 100644
--- a/spec/cukeforker/vnc_server_pool_spec.rb
+++ b/spec/cukeforker/vnc_server_pool_spec.rb
@@ -9,6 +9,14 @@
pool = VncServerPool.new(3, SpecHelper::FakeVnc)
pool.size.should == 3
+ end
+
+ it "launches the displays" do
+ servers = [mock("VncServer"), mock("VncServer"), mock("VncServer")]
+ SpecHelper::FakeVnc.should_receive(:new).exactly(3).times.and_return(*servers)
+
+ servers.each { |s| s.should_receive(:start) }
+ pool.launch
end
it "can fetch a server from the pool" do
|
Add spec for launching the VncServerPool
|
diff --git a/spec/controllers/statistics_controller_spec.rb b/spec/controllers/statistics_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/statistics_controller_spec.rb
+++ b/spec/controllers/statistics_controller_spec.rb
@@ -0,0 +1,95 @@+require 'spec_helper'
+
+describe StatisticsController do
+
+ before(:each) do
+ config = File.join( __dir__, "..", "lib", "test-survey.xls" )
+ QuestionnaireImporter.load(1, config)
+ end
+
+ context "when request summary data" do
+
+ before(:each) do
+ FactoryGirl.create(:user)
+ FactoryGirl.create(:organisation)
+ FactoryGirl.create(:organisation_user, email: "other@example.org")
+ FactoryGirl.create(:assessment)
+ FactoryGirl.create(:unfinished_assessment)
+
+ get "summary", format: "json"
+ expect( response ).to be_success
+ @json = JSON.parse(response.body)
+ end
+
+ context "as json" do
+
+ it "should return questionnaire version" do
+ expect( @json["questionnaire_version"] ).to eql(1)
+ end
+
+ it "should return number of users" do
+ expect( @json["registered_users"] ).to eql(2)
+ end
+
+ it "should return number of orgs" do
+ expect( @json["organisations"]["total"]).to eql(1)
+ end
+
+ it "should return number of orgs with users" do
+ expect( @json["organisations"]["total_with_users"] ).to eql(1)
+ end
+
+ it "should number of dgu orgs" do
+ expect( @json["organisations"]["datagovuk"] ).to eql(1)
+ end
+
+ it "should return number of assessments" do
+ expect( @json["assessments"]["total"] ).to eql(2)
+ end
+ it "should return number of completed assessments" do
+ expect( @json["assessments"]["completed"] ).to eql(1)
+ end
+
+ end
+
+ end
+
+ context "when requesting organisational stats" do
+
+ context "as json" do
+
+ before(:each) do
+ org = FactoryGirl.create(:organisation)
+ user = FactoryGirl.create(:organisation_user, email: "other@example.org", organisation: org)
+ assessment = FactoryGirl.create(:assessment, user: user)
+
+ AssessmentAnswer.create( assessment: assessment, question: Question.first, answer: Answer.find_by_code("Q1.2") )
+ assessment.complete
+
+ FactoryGirl.create(:unfinished_assessment)
+
+ get "all_organisations", format: "json"
+ expect( response ).to be_success
+ @json = JSON.parse(response.body)
+
+ end
+
+ it "should return number of organisations" do
+ expect( @json["organisations"] ).to eql(1)
+ end
+
+ it "should return number of assessments" do
+ expect( @json["completed"] ).to eql(1)
+ end
+
+ it "should return scores" do
+ expect( @json["themes"]["Data management processes"]["Data release process"] ).to eql([1,0,0,0,0])
+ end
+
+ it "should return level names" do
+ expect( @json["level_names"] ).to eql( ["Initial", "Repeatable", "Defined", "Managed", "Optimising"] )
+ end
+
+ end
+ end
+end
|
Add tests for JSON output
|
diff --git a/spec/support/active_record/postgresql_setup.rb b/spec/support/active_record/postgresql_setup.rb
index abc1234..def5678 100644
--- a/spec/support/active_record/postgresql_setup.rb
+++ b/spec/support/active_record/postgresql_setup.rb
@@ -14,6 +14,7 @@ @encoding = default_config['encoding'] || ENV['CHARSET'] || 'utf8'
begin
establish_connection(default_config.merge('database' => 'postgres', 'schema_search_path' => 'public'))
+ ActiveRecord::Base.connection.drop_database(default_config['database']) rescue nil
ActiveRecord::Base.connection.create_database(default_config['database'], default_config.merge('encoding' => @encoding))
rescue Exception => e
$stderr.puts e, *(e.backtrace)
@@ -32,7 +33,6 @@ end
def active_record_pg_migrate
- `dropdb #{default_config['database']}`
create_db
establish_connection
ActiveRecord::Migrator.migrate 'spec/support/active_record/migrations'
|
Drop Postgres database with AR connection
1. Works faster than issuing shell commands.
2. Attempts to drop the database before creating it. This fixes some
ugly test output which warns that given database already exists.
|
diff --git a/spec/perpetuity/data_injectable_spec.rb b/spec/perpetuity/data_injectable_spec.rb
index abc1234..def5678 100644
--- a/spec/perpetuity/data_injectable_spec.rb
+++ b/spec/perpetuity/data_injectable_spec.rb
@@ -1,13 +1,11 @@ require 'perpetuity/data_injectable'
module Perpetuity
- class InjectableClass
- extend DataInjectable
- end
+ describe DataInjectable do
+ let(:klass) { Class.new }
+ let(:object) { klass.new }
- describe DataInjectable do
- let(:klass) { InjectableClass }
- let(:object) { klass.new }
+ before { klass.extend DataInjectable }
it 'injects data into an object' do
klass.inject_data object, { a: 1, b: 2 }
|
Declare DataInjectable test class at runtime
|
diff --git a/qa/qa/page/project/new.rb b/qa/qa/page/project/new.rb
index abc1234..def5678 100644
--- a/qa/qa/page/project/new.rb
+++ b/qa/qa/page/project/new.rb
@@ -4,7 +4,7 @@ class New < Page::Base
view 'app/views/projects/_new_project_fields.html.haml' do
element :project_namespace_select
- element :project_namespace_field, 'select :namespace_id'
+ element :project_namespace_field, /select :namespace_id.*class: 'select2/
element :project_path, 'text_field :path'
element :project_description, 'text_area :description'
element :project_create_button, "submit 'Create project'"
@@ -13,7 +13,7 @@ def choose_test_namespace
click_element :project_namespace_select
- first('li', text: Runtime::Namespace.path).click
+ find('ul.select2-result-sub > li', text: Runtime::Namespace.path).click
end
def choose_name(name)
|
Fix click on incorrect namespace
in certain conditions. And `first` was causing it to succeed even though the criteria were ambiguous.
|
diff --git a/1_codility/0_training/7_1_brackets.rb b/1_codility/0_training/7_1_brackets.rb
index abc1234..def5678 100644
--- a/1_codility/0_training/7_1_brackets.rb
+++ b/1_codility/0_training/7_1_brackets.rb
@@ -0,0 +1,20 @@+# 100/100
+def solution(str)
+ char_mappings = {
+ "}" => "{",
+ "]" => "[",
+ ")" => "("
+ }
+
+ stack = []
+
+ str.each_char do |chr|
+ if char_mappings.values.include?(chr)
+ stack.unshift(chr)
+ else
+ return 0 unless stack.shift == char_mappings[chr]
+ end
+ end
+
+ stack.empty? ? 1 : 0
+end
|
Add codility training - brackets
|
diff --git a/AHKSlider.podspec b/AHKSlider.podspec
index abc1234..def5678 100644
--- a/AHKSlider.podspec
+++ b/AHKSlider.podspec
@@ -1,7 +1,7 @@ Pod::Spec.new do |s|
s.name = "AHKSlider"
s.version = "0.1.0"
- s.summary = "UISlider subclass that improves value precision of the value selection."
+ s.summary = "UISlider subclass that improves the precision of selecting values."
s.homepage = "https://github.com/fastred/AHKSlider"
s.license = 'MIT'
s.author = { "Arkadiusz Holko" => "fastred@fastred.org" }
|
Improve the summary in the .podspec
|
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.2.0-pre"
+ s.version = "0.1.0"
s.summary = "Convention over configuration REST API client"
s.homepage = "https://github.com/klaaspieter/apiclient"
s.license = 'MIT'
|
Revert "Update the version number in the podspec"
This reverts commit 7ce8c93b07f367d8072a37c08ff5a3f725b757cd.
|
diff --git a/Alamofire.podspec b/Alamofire.podspec
index abc1234..def5678 100644
--- a/Alamofire.podspec
+++ b/Alamofire.podspec
@@ -8,6 +8,8 @@ s.authors = { 'Alamofire Software Foundation' => 'info@alamofire.org' }
s.source = { :git => 'https://github.com/Alamofire/Alamofire.git', :tag => s.version }
+ s.dependency 'Result', '~> 0.6'
+
s.ios.deployment_target = '9.0'
s.osx.deployment_target = '10.9'
s.watchos.deployment_target = '2.0'
|
Add dependency on Result to podspec
|
diff --git a/lib/zero_downtime_migrations/validation/find_each.rb b/lib/zero_downtime_migrations/validation/find_each.rb
index abc1234..def5678 100644
--- a/lib/zero_downtime_migrations/validation/find_each.rb
+++ b/lib/zero_downtime_migrations/validation/find_each.rb
@@ -10,7 +10,7 @@
def correction
<<-MESSAGE.strip_heredoc
- Instead, let's use the `find_each` method to fetch records in batches.
+ Let's use the `find_each` method to fetch records in batches instead.
Otherwise we may accidentally load tens or hundreds of thousands of
records into memory all at the same time!
|
Update FindEach validation error message
|
diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb
index abc1234..def5678 100644
--- a/config/initializers/sidekiq.rb
+++ b/config/initializers/sidekiq.rb
@@ -14,10 +14,12 @@ def self.redis_url
config = begin
YAML.load(File.read(Rails.root.join('config/redis.yml')))
- rescue Errno::ENOENT
- { Rails.env => { 'sidekiq' => { } } }
+ config[Rails.env]['sidekiq'].symbolize_keys
+ rescue Errno::ENOENT, NoMethodError
+ { }
end
- config = default_redis.merge(config[Rails.env]['sidekiq'].symbolize_keys)
+
+ config = default_redis.merge(config)
if config.has_key? :password
"redis://:#{ config[:password] }@#{ config[:host] }:#{ config[:port] }/#{ config[:db] }"
|
Return empty hash when no config for environment
|
diff --git a/config/initializers/sneakers.rb b/config/initializers/sneakers.rb
index abc1234..def5678 100644
--- a/config/initializers/sneakers.rb
+++ b/config/initializers/sneakers.rb
@@ -5,7 +5,8 @@ amqp: Pomegranate.config["events"]["server"],
exchange: Pomegranate.config["events"]["exchange"],
exchange_type: :fanout,
- handler: Sneakers::Handlers::Maxretry
+ handler: Sneakers::Handlers::Maxretry,
+ timeout_job_after: 300
)
Sneakers.logger.level = Logger::INFO
@@ -13,8 +14,8 @@ ack: true,
threads: 5,
prefetch: 10,
- timeout_job_after: 60,
+ timeout_job_after: 300,
heartbeat: 5,
amqp_heartbeat: 10,
- retry_timeout: 60 * 1000 # 60 seconds
+ retry_timeout: 300 * 1000 # 5 minutes
}.freeze
|
Increase Sneakers sync job timeout
Reindexing some items after getting a message was taking longer than the
60 second timeout, resulting in the connection getting cut.
|
diff --git a/Library/Homebrew/test/language/java_spec.rb b/Library/Homebrew/test/language/java_spec.rb
index abc1234..def5678 100644
--- a/Library/Homebrew/test/language/java_spec.rb
+++ b/Library/Homebrew/test/language/java_spec.rb
@@ -14,15 +14,15 @@ end
describe "#self.overridable_java_home_env" do
- let(:JAVA_HOME) { "haha" }
+ ENV["JAVA_HOME"] = "java_home"
it "returns java_home path with version if version specified" do
java_home = described_class.overridable_java_home_env("blah")
- expect(java_home[:JAVA_HOME]).to eq("haha")
+ expect(java_home[:JAVA_HOME]).to eq("java_home")
end
it "returns java_home path without version if version is not specified" do
java_home = described_class.overridable_java_home_env
- expect(java_home[:JAVA_HOME]).not_to include("--version")
+ expect(java_home[:JAVA_HOME]).to eq("java_home")
end
end
end
|
Set java environment var to test overriding
|
diff --git a/Library/Formula/oxygen-icons.rb b/Library/Formula/oxygen-icons.rb
index abc1234..def5678 100644
--- a/Library/Formula/oxygen-icons.rb
+++ b/Library/Formula/oxygen-icons.rb
@@ -1,9 +1,9 @@ require 'formula'
class OxygenIcons <Formula
- url 'ftp://ftp.kde.org/pub/kde/stable/4.4.2/src/oxygen-icons-4.4.2.tar.bz2'
+ url 'ftp://ftp.kde.org/pub/kde/stable/4.5.2/src/oxygen-icons-4.5.2.tar.bz2'
homepage 'http://www.oxygen-icons.org/'
- md5 '86e655d909f743cea6a2fc6dd90f0e52'
+ md5 '64cd34251378251d56b9e56a9d4d7bf6'
depends_on 'cmake' => :build
|
Update Oxygen icons to 4.5.2.
|
diff --git a/spec/acceptance/acceptance_helper.rb b/spec/acceptance/acceptance_helper.rb
index abc1234..def5678 100644
--- a/spec/acceptance/acceptance_helper.rb
+++ b/spec/acceptance/acceptance_helper.rb
@@ -1,4 +1,4 @@-require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
+require "spec_helper"
require "steak"
# require 'capybara/envjs'
# Capybara.javascript_driver = :envjs
|
Fix RSpec deprecation and load "spec_helper" library correctly.
|
diff --git a/spec/ec2/snapshot/replicator_spec.rb b/spec/ec2/snapshot/replicator_spec.rb
index abc1234..def5678 100644
--- a/spec/ec2/snapshot/replicator_spec.rb
+++ b/spec/ec2/snapshot/replicator_spec.rb
@@ -1,11 +1,7 @@ require 'spec_helper'
-describe Ec2::Snapshot::Replicator do
+describe EC2::Snapshot::Replicator do
it 'has a version number' do
- expect(Ec2::Snapshot::Replicator::VERSION).not_to be nil
- end
-
- it 'does something useful' do
- expect(false).to eq(true)
+ expect(EC2::Snapshot::Replicator::VERSION).not_to be nil
end
end
|
Delete a spec generated by bundler.
|
diff --git a/Formula/bazaar.rb b/Formula/bazaar.rb
index abc1234..def5678 100644
--- a/Formula/bazaar.rb
+++ b/Formula/bazaar.rb
@@ -9,6 +9,7 @@
def install
ENV.minimal_optimization
+ inreplace 'setup.py', 'man/man1', 'share/man/man1'
system "python", "setup.py", "build"
system "python", "setup.py", "install", "--prefix=#{prefix}"
end
|
Fix installation of man file by replacing the path hardcoded in setup.py.
Signed-off-by: David Höppner <017ae80272b4e52efdec6713a2cb2af11a9c7ddd@gmail.com>
|
diff --git a/Formula/o-make.rb b/Formula/o-make.rb
index abc1234..def5678 100644
--- a/Formula/o-make.rb
+++ b/Formula/o-make.rb
@@ -0,0 +1,34 @@+require 'formula'
+
+class OMake <Formula
+ url 'http://omake.metaprl.org/downloads/omake-0.9.8.5-3.tar.gz'
+ homepage 'http://omake.metaprl.org/'
+ md5 'd114b3c4201808aacd73ec1a98965c47'
+ aka "omake"
+
+ depends_on 'objective-caml'
+
+ def patches
+ # removes reference to missing caml_sync in OS X OCaml
+ DATA
+ end
+
+ def install
+ system "make install PREFIX=#{prefix}"
+ end
+end
+
+__END__
+diff --git a/src/exec/omake_exec.ml b/src/exec/omake_exec.ml
+index 8c034b5..7e40b35 100644
+--- a/src/exec/omake_exec.ml
++++ b/src/exec/omake_exec.ml
+@@ -46,8 +46,6 @@ open Omake_exec_notify
+ open Omake_options
+ open Omake_command_type
+
+-external sync : unit -> unit = "caml_sync"
+-
+ module Exec =
+ struct
+ (*
|
Add OMake (OCaml build system) formula
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
* Renamed to match naming conventions
|
diff --git a/mtask.rb b/mtask.rb
index abc1234..def5678 100644
--- a/mtask.rb
+++ b/mtask.rb
@@ -11,6 +11,7 @@ enable :method_override
configure do
+ FileUtils.mkdir_p("./db")
GrnMini::create_or_open("db/tasks.db")
$tasks = GrnMini::Array.new("Tasks")
|
Make db/ directory when it doesn't exist already before Groonga db creating
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.