diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/examples/heavy_provider_light_resource/libraries/resource_service.rb b/examples/heavy_provider_light_resource/libraries/resource_service.rb
index abc1234..def5678 100644
--- a/examples/heavy_provider_light_resource/libraries/resource_service.rb
+++ b/examples/heavy_provider_light_resource/libraries/resource_service.rb
@@ -3,6 +3,8 @@ class ::Chef
class Resource
class HeavyProviderLightResourceService < ::Chef::Resource::Service
+ provides :heavy_provider_light_resource_service
+
attr_accessor :root
def initialize(service_name, run_context = nil)
super
|
Add provides line to crazy spec
This is actually a heavy-resource spec and it needs a provides
line.
Signed-off-by: Lamont Granquist <0ab8dc438f73addc98d9ad5925ec8f2b97991703@scriptkiddie.org>
|
diff --git a/holidays.gemspec b/holidays.gemspec
index abc1234..def5678 100644
--- a/holidays.gemspec
+++ b/holidays.gemspec
@@ -16,7 +16,7 @@ gem.test_files = gem.files.grep(/^test/)
gem.require_paths = ['lib']
gem.licenses = ['MIT']
- gem.required_ruby_version = '~> 2.4'
+ gem.required_ruby_version = '>= 2.4'
gem.add_development_dependency 'bundler', '~> 2'
gem.add_development_dependency 'rake', '~> 12'
gem.add_development_dependency 'simplecov', '~> 0.16'
|
Update ruby_version requirement to allow ruby 3.0
|
diff --git a/app/controllers/concerns/setting_history_concern.rb b/app/controllers/concerns/setting_history_concern.rb
index abc1234..def5678 100644
--- a/app/controllers/concerns/setting_history_concern.rb
+++ b/app/controllers/concerns/setting_history_concern.rb
@@ -28,7 +28,7 @@ else
flash = { danger: @fluentd.agent.log.tail(1).first }
end
- redirect_to :back, flash: flash
+ redirect_back fallback_location: root_url, flash: flash
end
end
|
Use redirect_back to suppress deprecation warning
> DEPRECATION WARNING: `redirect_to :back` is deprecated and will be
> removed from Rails 5.1. Please use `redirect_back(fallback_location:
> fallback_location)` where `fallback_location` represents the location
> to use if the request has no HTTP referer information.
Signed-off-by: Kenji Okimoto <7a4b90a0a1e6fc688adec907898b6822ce215e6c@clear-code.com>
|
diff --git a/app/models/etsource/reloader.rb b/app/models/etsource/reloader.rb
index abc1234..def5678 100644
--- a/app/models/etsource/reloader.rb
+++ b/app/models/etsource/reloader.rb
@@ -29,6 +29,8 @@ NastyCache.instance.expire!
NastyCache.instance.expire_local!
+ Atlas::ActiveDocument::Manager.clear_all!
+
Rails.logger.info 'ETsource live reload: Caches cleared.'
end
end # class << self
|
Fix "live" reloading of inputs and gqueries
Resolves quintel/etmodel#1500
|
diff --git a/app/models/railitics/request.rb b/app/models/railitics/request.rb
index abc1234..def5678 100644
--- a/app/models/railitics/request.rb
+++ b/app/models/railitics/request.rb
@@ -4,6 +4,17 @@ class Request
include Mongoid::Document
field :uuid, type: String
- field :user_id
+ field :user_id, type: Integer
+ field :params, type: Hash
+ field :method, type: String
+
+ def controller
+ params["controller"]
+ end
+
+ def action
+ params["action"]
+ end
+
end
end
|
Define methods for action and controller
|
diff --git a/acceptance/tests/inventory/basic_fact_retrieval.rb b/acceptance/tests/inventory/basic_fact_retrieval.rb
index abc1234..def5678 100644
--- a/acceptance/tests/inventory/basic_fact_retrieval.rb
+++ b/acceptance/tests/inventory/basic_fact_retrieval.rb
@@ -0,0 +1,24 @@+require 'json'
+
+test_name "facts should be available through facts terminus" do
+
+ with_master_running_on master, "--autosign true", :preserve_ssl => true do
+
+ step "Run agent once to populate database" do
+ run_agent_on hosts, "--test --server #{master}", :acceptable_exit_codes => [0,2]
+ end
+
+ # Wait until all the commands have been processed
+ sleep_until_queue_empty database
+
+ step "Run facts face to find facts for each node" do
+
+ hosts.each do |host|
+ result = on master, "puppet facts find #{host.node_name} --terminus puppetdb"
+ facts = JSON.parse(result.stdout.strip)
+ assert_equal(host.node_name, facts['name'], "Failed to retrieve facts for '#{host.node_name}' via inventory service!")
+
+ end
+ end
+ end
+end
|
Add acceptance test for fact retrieval / inventory service
|
diff --git a/spec/lib/escobar/heroku/client_spec.rb b/spec/lib/escobar/heroku/client_spec.rb
index abc1234..def5678 100644
--- a/spec/lib/escobar/heroku/client_spec.rb
+++ b/spec/lib/escobar/heroku/client_spec.rb
@@ -0,0 +1,27 @@+require "spec_helper"
+
+RSpec.describe Escobar::Heroku::Client do
+ let(:client) { Escobar::Heroku::Client.new("123") }
+ it "should rescue timeout errors" do
+ expect(client.client).to receive(:get).and_raise(Net::OpenTimeout)
+ expect do
+ client.get("/account")
+ end.to raise_error(Escobar::Client::TimeoutError)
+ end
+
+ it "should correctly handle response from a Faraday ClientError" do
+ faraday_error = Faraday::Error::ClientError.new("message", {
+ body: "body",
+ headers: { something: true },
+ status: 502
+ })
+ expect(client.client).to receive(:get).and_raise(faraday_error)
+ expect do
+ client.get("/account")
+ end.to raise_error(Escobar::Client::HTTPError) do |e|
+ expect(e.body).to eql("body")
+ expect(e.headers).to eql({something: true})
+ expect(e.status).to eql(502)
+ end
+ end
+end
|
Add specs for error raising
|
diff --git a/app/controllers/api/v1/organizations_controller.rb b/app/controllers/api/v1/organizations_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/api/v1/organizations_controller.rb
+++ b/app/controllers/api/v1/organizations_controller.rb
@@ -3,9 +3,11 @@
class OrganizationsController < ApplicationController
SERIALIZATION_INCLUDES = [:mailing_address, :practice_location_address, :other_provider_identifiers,
- {taxonomy_licenses: {include: :taxonomy_code}}, :taxonomy_groups, :providers ]
+ {taxonomy_licenses: {include: :taxonomy_code}}, :taxonomy_groups,
+ {providers: {include: {taxonomy_licenses: {include: :taxonomy_code}}}} ]
LOAD_INCLUDES = [:mailing_address, :practice_location_address, :other_provider_identifiers,
- {taxonomy_licenses: :taxonomy_code}, :taxonomy_groups, :providers ]
+ {taxonomy_licenses: :taxonomy_code}, :taxonomy_groups,
+ {providers: {taxonomy_licenses: :taxonomy_codes}} ]
def index
organizations = if params[:q]
|
Include provider taxonomy information when loading organizations
|
diff --git a/app/controllers/email_configurations_controller.rb b/app/controllers/email_configurations_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/email_configurations_controller.rb
+++ b/app/controllers/email_configurations_controller.rb
@@ -25,7 +25,7 @@ end
def try_email
- output = Java::OrgRsnaIsnUtil::Email.send(params[:recipient],"Test email","This test message was sent from the isn image sharing server.")
+ output = Java::OrgRsnaIsnUtil::EmailUtil.send(params[:recipient],"Test email","This test message was sent from the isn image sharing server.")
render :text => "<pre class=\"well\">#{output}</pre>"
end
|
Fix email sending class name
|
diff --git a/cli/lib/rbld_status.rb b/cli/lib/rbld_status.rb
index abc1234..def5678 100644
--- a/cli/lib/rbld_status.rb
+++ b/cli/lib/rbld_status.rb
@@ -9,6 +9,6 @@ @description = "List modified environments"
end
- legacy_run_implementation :status
+ run_prints :modified, "modified: "
end
end
|
cli: Convert rbld status implementation to Ruby
Signed-off-by: Dmitry Fleytman <a8cf97adadec4e1b734a39bc5aea71b5741cfca1@daynix.com>
|
diff --git a/Casks/tex-live-utility.rb b/Casks/tex-live-utility.rb
index abc1234..def5678 100644
--- a/Casks/tex-live-utility.rb
+++ b/Casks/tex-live-utility.rb
@@ -0,0 +1,7 @@+class TexLiveUtility < Cask
+ url 'https://mactlmgr.googlecode.com/files/TeX%20Live%20Utility.app-1.17.tar.gz'
+ homepage 'https://code.google.com/p/mactlmgr/'
+ version '1.17'
+ sha256 '9a913cbf0e158258c513fc0905f65632b36d372d1b4b9afe6b6f08dd005ff232'
+ link 'TeX Live Utility.app'
+end
|
Add 'Tex Live Utility.app' v1.17
|
diff --git a/Casks/tunnelblick-beta.rb b/Casks/tunnelblick-beta.rb
index abc1234..def5678 100644
--- a/Casks/tunnelblick-beta.rb
+++ b/Casks/tunnelblick-beta.rb
@@ -1,7 +1,7 @@ class TunnelblickBeta < Cask
- url 'http://downloads.sourceforge.net/project/tunnelblick/All%20files/Tunnelblick_3.4beta22.dmg'
+ url 'http://downloads.sourceforge.net/project/tunnelblick/All%20files/Tunnelblick_3.4beta24.dmg'
homepage 'https://code.google.com/p/tunnelblick/'
- version '3.4beta22'
- sha256 'd69f338f9d503643750aa0ee7c9c4fdb3a86bb9a72e2f5c096e38a18353c9603'
+ version '3.4beta24'
+ sha256 '3102e7bc881f9bbcb0703bfacfd96a7506d77f56f8d9705199a83ac1128f45a7'
link 'Tunnelblick.app'
end
|
Update Tunnelblick to latest beta 24
|
diff --git a/app/models/book.rb b/app/models/book.rb
index abc1234..def5678 100644
--- a/app/models/book.rb
+++ b/app/models/book.rb
@@ -10,7 +10,7 @@ genres_attributes.each do |genre_attribute|
unless genre_attribute["name"].blank?
genre_attribute.values.each do |attribute|
- genre = Genre.find_or_create_by(name: attribute)
+ genre = Genre.find_or_create_by(name: genre_attribute.values.first)
self.book_genres.build(genre_id: genre.id)
end
end
|
Fix error where genre attribute can't define value
|
diff --git a/lib/requirejs_optimizer/railtie.rb b/lib/requirejs_optimizer/railtie.rb
index abc1234..def5678 100644
--- a/lib/requirejs_optimizer/railtie.rb
+++ b/lib/requirejs_optimizer/railtie.rb
@@ -9,7 +9,8 @@
class RequirejsOptimizerRailtie < Rails::Railtie
- config.after_initialize do
+ config.before_initialize do
+ Rails.application.config.assets.compress = false
javascripts_root_path = Rails.root.join(*%w(app/assets/javascripts/))
modules_path = javascripts_root_path.join("modules", '**', '*.{coffee,js}')
@@ -22,10 +23,6 @@ Rails.application.config.assets.precompile += modules
end
- config.before_initialize do
- Rails.application.config.assets.compress = false
- end
-
rake_tasks do
raketask = RequirejsOptimizer::Rake::Task.new
raketask.define_tasks
|
Add modules to precompile path in before_init
|
diff --git a/sensu-plugins/check_keystone-api.rb b/sensu-plugins/check_keystone-api.rb
index abc1234..def5678 100644
--- a/sensu-plugins/check_keystone-api.rb
+++ b/sensu-plugins/check_keystone-api.rb
@@ -0,0 +1,86 @@+#!/usr/bin/env ruby
+#
+# Keystone API monitoring script for Sensu
+#
+# Copyright © 2014 Christopher Eckhardt
+#
+# Author: Christopher Eckhardt <djbkd@dreamsofelectricsheep.net>
+#
+# Released under the same terms as Sensu (the MIT license); see LICENSE
+# for details.
+#
+require 'rubygems' if RUBY_VERSION < '1.9.0'
+require 'sensu-plugin/check/cli'
+require 'net/http'
+require 'net/https'
+require 'json'
+
+class CheckKeystoneAPI < Sensu::Plugin::Check::CLI
+
+ option :url, :short => '-u URL'
+ option :tenant, :short => '-T TENANT'
+ option :user, :short => '-U USERNAME'
+ option :pass, :short => '-P PASSWORD'
+ option :timeout, :short => '-t SECONDS', :proc => proc {|a| a.to_i}, :default => 10
+
+
+ def run
+ if config[:url]
+ uri = URI.parse(config[:url])
+ config[:host] = uri.host
+ config[:port] = uri.port
+ config[:path] = uri.path + '/tokens'
+ config[:ssl] = uri.scheme == 'https'
+ else
+ unless config[:host] and config[:path]
+ unknown 'No URL specified'
+ end
+ config[:port] ||= 5000
+ end
+
+ begin
+ timeout(config[:timeout]) do
+ request_token
+ end
+ rescue Timeout::Error
+ critical "Keystone API timed out"
+ rescue => e
+ critical "Keystone API Connection error: #{e.message}"
+ end
+ end
+
+
+ def request_token
+
+ conn = Net::HTTP.new(config[:host], config[:port])
+
+ if config[:ssl]
+ conn.use_ssl = true
+ conn.verify_mode = OpenSSL::SSL::VERIFY_NONE
+ end
+
+ api_request = {
+ 'auth' => {
+ 'passwordCredentials' => {
+ 'username' => config[:user],
+ 'password' => config[:pass]
+ },
+ 'tenantName' => config[:tenant]
+ }
+ }.to_json
+
+ req = Net::HTTP::Post.new(config[:path])
+ req.body = api_request
+ req['Content-Type'] = 'application/json'
+ res = conn.start{|http| http.request(req)}
+
+ case res.code
+ when /^2/
+ ok res.code + res.body
+ when /^[45]/
+ critical res.code + res.body
+ else
+ warning res.code + res.body
+ end
+ end
+end
|
Add Keystone API check to sensu-plugins.
|
diff --git a/app/models/note.rb b/app/models/note.rb
index abc1234..def5678 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -5,8 +5,6 @@ accepts_nested_attributes_for :comments
delegate :chapter, to: :element
-
- after_save :expire_chapter_cache
belongs_to :user
@@ -32,8 +30,4 @@ def completed?
["accepted", "rejected"].include?(state)
end
-
- def expire_chapter_cache
- chapter.expire_cache
- end
end
|
Remove chapter expiry from Note
i_have_no_idea_what_im_doing.jpg
|
diff --git a/lib/the_tv_db/series/collection.rb b/lib/the_tv_db/series/collection.rb
index abc1234..def5678 100644
--- a/lib/the_tv_db/series/collection.rb
+++ b/lib/the_tv_db/series/collection.rb
@@ -5,11 +5,12 @@ ATTRS_MAP = {
:id => "seriesid",
:api_id => "id",
+ :alias => "AliasNames",
:banner => "banner",
:first_aired => "FirstAired",
:imdb_id => "IMDB_ID",
:name => "SeriesName",
- :alias => "AliasNames",
+ :network => "Network",
:language => "language",
:overview => "Overview",
:zap2it_id => "zap2it_id"
|
Add AliasNames and Network on search results
|
diff --git a/app/models/user.rb b/app/models/user.rb
index abc1234..def5678 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -8,7 +8,7 @@ :suspendable, # in signonotron2/lib/devise/models/suspendable.rb
:strengthened # in signonotron2/lib/devise/models/strengthened.rb
- attr_accessible :uid, :name, :email, :password, :password_confirmation, :twitter, :github, :beard
+ attr_accessible :uid, :name, :email, :password, :password_confirmation
attr_readonly :uid
has_many :authorisations, :class_name => 'Doorkeeper::AccessToken', :foreign_key => :resource_owner_id
|
Remove old attributes from attr_accessible
The old twitter, github and beard attributes aren't part of this app so let's not reference them in the code
|
diff --git a/appbundler.gemspec b/appbundler.gemspec
index abc1234..def5678 100644
--- a/appbundler.gemspec
+++ b/appbundler.gemspec
@@ -6,8 +6,8 @@ Gem::Specification.new do |spec|
spec.name = "appbundler"
spec.version = Appbundler::VERSION
- spec.authors = ["Dan DeLeo"]
- spec.email = ["dan@chef.io"]
+ spec.authors = ["Chef Software, Inc."]
+ spec.email = ["info@chef.io"]
spec.description = %q{Extracts a dependency solution from bundler's Gemfile.lock to speed gem activation}
spec.summary = spec.description
spec.homepage = "https://github.com/chef/appbundler"
|
Use the standard gem author for chef
Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
|
diff --git a/lib/gmail/tags.rb b/lib/gmail/tags.rb
index abc1234..def5678 100644
--- a/lib/gmail/tags.rb
+++ b/lib/gmail/tags.rb
@@ -2,7 +2,9 @@ #
# @author Ollivier Robert <roberto@keltia.net>
#
-# $Id: tags.rb,v 7f48d095873f 2012/12/06 10:04:19 roberto $
+# $Id: tags.rb,v 6869d2bfca55 2012/12/06 13:14:14 roberto $
+
+require "gmail/tag"
module GMail
# Represent a bag of tags backed by a TC db
|
Include "gmail/tag" here for completeness.
|
diff --git a/lib/mogli/page.rb b/lib/mogli/page.rb
index abc1234..def5678 100644
--- a/lib/mogli/page.rb
+++ b/lib/mogli/page.rb
@@ -12,6 +12,9 @@
# Musicians
define_properties :record_label, :hometown, :band_members, :genre
+
+ # Restaurants
+ define_properties :parking, :public_transit, :hours, :payment_options, :restaurant_services, :restaurant_specialties
# As a like
define_properties :created_time
|
Define some missing "Restaurants" properties on Page
|
diff --git a/lib/nehm/track.rb b/lib/nehm/track.rb
index abc1234..def5678 100644
--- a/lib/nehm/track.rb
+++ b/lib/nehm/track.rb
@@ -7,9 +7,8 @@ end
def artist
- if @hash['title'].include?('-')
- title = @hash['title'].split('-')
- title[0].rstrip
+ if @hash['title'].index(' - ')
+ @hash['title'].split(' - ')[0]
else
@hash['user']['username']
end
@@ -41,9 +40,8 @@ end
def title
- if @hash['title'].include?('-')
- title = @hash['title'].split('-')
- title[1].lstrip
+ if @hash['title'].index(' - ')
+ @hash['title'].split(' - ')[1]
else
@hash['title']
end
|
Fix detection of artist in title name of song
|
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
@@ -23,11 +23,14 @@ end
def field_selection
+ body = select_tag :field, options_for_select(model_fields)
+ body += button_tag "Insert", class: "insert_field"
+ content_tag(:div, body, class: "merge_field")
+ end
+
+ def model_fields
parse_config
- fields=@merge_model.constantize.attribute_names.reject{|x| %w[created_at updated_at id].include?(x)}
- body = select_tag :field, options_for_select(fields)
- body += button_tag "Insert"
- content_tag(:div, body, class: "merge_field")
+ @merge_model.constantize.attribute_names.reject{|x| %w[created_at updated_at id].include?(x)}
end
private
|
Split getting the model fields into a separate method so we can call that externally if we want to.
|
diff --git a/ruby/ql/test/library-tests/dataflow/barrier-guards/barrier-guards.rb b/ruby/ql/test/library-tests/dataflow/barrier-guards/barrier-guards.rb
index abc1234..def5678 100644
--- a/ruby/ql/test/library-tests/dataflow/barrier-guards/barrier-guards.rb
+++ b/ruby/ql/test/library-tests/dataflow/barrier-guards/barrier-guards.rb
@@ -38,4 +38,27 @@ foo
else
foo
-end+end
+
+if foo == "foo"
+ capture {
+ foo # guarded
+ }
+end
+
+if foo == "foo"
+ capture {
+ foo = "bar"
+ foo # not guarded
+ }
+end
+
+if foo == "foo"
+ my_lambda = -> () {
+ foo # not guarded
+ }
+
+ foo = "bar"
+
+ my_lambda()
+end
|
Ruby: Add barrier guards test involving captured variables
|
diff --git a/base/lib/rails/social_stream.rb b/base/lib/rails/social_stream.rb
index abc1234..def5678 100644
--- a/base/lib/rails/social_stream.rb
+++ b/base/lib/rails/social_stream.rb
@@ -5,7 +5,7 @@ def initialize_with_magic(*args, &block)
initialize_without_magic(*args, &block)
- if (unix_file = `which file`.chomp).present? && File.exists?(unix_file)
+ if (unix_file = `which file`.try(:chomp)).present? && File.exists?(unix_file)
`#{ unix_file } -v 2>&1` =~ /^file-(.*)$/
version = $1
|
Patch `which file` command in windows
It returns nil. Should provide a better solution
|
diff --git a/spec/colour_alphabet_result_spec.rb b/spec/colour_alphabet_result_spec.rb
index abc1234..def5678 100644
--- a/spec/colour_alphabet_result_spec.rb
+++ b/spec/colour_alphabet_result_spec.rb
@@ -20,4 +20,16 @@ result = ABCing::ColourAlphabetResult.new(params).calculate
expect(result).to include(A: :green, B: :red)
end
+
+ it 'does not find an application class or test class from the letter of the alphabet' do
+ params = {
+ test_letters: [],
+ app_letters: []
+ }
+
+ result = ABCing::ColourAlphabetResult.new(params).calculate
+ expect(result).to include(A: :yellow, B: :yellow)
+ end
+
+
end
|
Test for not finding class or test results and marking them yellow
|
diff --git a/spec/dummy/config/application.rb b/spec/dummy/config/application.rb
index abc1234..def5678 100644
--- a/spec/dummy/config/application.rb
+++ b/spec/dummy/config/application.rb
@@ -23,7 +23,7 @@
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
- # config.i18n.default_locale = :de
+ config.i18n.default_locale = :nl
# Do not swallow errors in after_commit/after_rollback callbacks.
config.active_record.raise_in_transactional_callbacks = true
|
Use NL as default locale.
|
diff --git a/spec/support/database_cleaner.rb b/spec/support/database_cleaner.rb
index abc1234..def5678 100644
--- a/spec/support/database_cleaner.rb
+++ b/spec/support/database_cleaner.rb
@@ -2,7 +2,8 @@
config.before(:suite) do
#DatabaseCleaner.strategy = :transaction
- DatabaseCleaner.strategy = :truncation
+ #DatabaseCleaner.strategy = :truncation
+ DatabaseCleaner.strategy = :deletion
DatabaseCleaner.clean_with(:truncation)
end
|
Switch DatabaseCleaner strategy to :deletion.
This greatly improves the speed of the test suite.
`DatabaseCleaner.strategy = :transaction`:
docker-compose exec web bin/rspec 0,56s user 0,21s system 0% cpu 24:25,34 total
`DatabaseCleaner.strategy = :deletion`:
docker-compose exec web bin/rspec 0,38s user 0,14s system 0% cpu 4:01,60 total
|
diff --git a/lib/kafka/snappy_codec.rb b/lib/kafka/snappy_codec.rb
index abc1234..def5678 100644
--- a/lib/kafka/snappy_codec.rb
+++ b/lib/kafka/snappy_codec.rb
@@ -2,6 +2,9 @@ class SnappyCodec
def initialize
require "snappy"
+ rescue LoadError
+ raise LoadError,
+ "Using snappy compression requires adding a dependency on the `snappy` gem to your Gemfile."
end
def codec_id
|
Improve error message when `snappy` is not available
|
diff --git a/source/_plugins/fix_rss.rb b/source/_plugins/fix_rss.rb
index abc1234..def5678 100644
--- a/source/_plugins/fix_rss.rb
+++ b/source/_plugins/fix_rss.rb
@@ -7,6 +7,7 @@ input.gsub(/(?<href>href=('|"))\//, '\k<href>' + @context.registers[:site].config["url"] + '/')
.gsub(/(?<src>src=('|"))\//, '\k<src>' + @context.registers[:site].config["url"] + '/')
.gsub(/\sclass=['"][^'"]*['"]/, '')
+ .gsub(/\sdata[-a-zA-Z]*=['"][^'"]*['"]/, '')
end
end
|
Remove any `data-` attributes too.
|
diff --git a/lib/mailman/middleware.rb b/lib/mailman/middleware.rb
index abc1234..def5678 100644
--- a/lib/mailman/middleware.rb
+++ b/lib/mailman/middleware.rb
@@ -27,7 +27,7 @@
def run(*args, &final_action)
final_return = nil
- stack = @entries.map {|m| m.new()}
+ stack = @entries.map {|m| m.new}
traverse_stack = lambda do
if stack.empty?
final_return = final_action.call
|
Remove brackets for consistent style
|
diff --git a/db/data_migration/20121213100857_fix_mod_news_versions.rb b/db/data_migration/20121213100857_fix_mod_news_versions.rb
index abc1234..def5678 100644
--- a/db/data_migration/20121213100857_fix_mod_news_versions.rb
+++ b/db/data_migration/20121213100857_fix_mod_news_versions.rb
@@ -1,6 +1,10 @@+mod = Organisation.find_by_slug('ministry-of-defence')
+
+return unless mod
+
count = 0
# for each document that is a news article in MOD
-Document.find_by_sql("SELECT d.* FROM documents d left join editions e on d.id = e.document_id left join edition_organisations eo ON eo.edition_id = e.id WHERE eo.organisation_id = 17 and document_type in ('NewsArticle','FatalityNotice')").each do |document|
+Document.find_by_sql("SELECT d.* FROM documents d left join editions e on d.id = e.document_id left join edition_organisations eo ON eo.edition_id = e.id WHERE eo.organisation_id = #{mod.id} and document_type in ('NewsArticle','FatalityNotice')").each do |document|
# get all the editions sorted by creation ASC
editions = Edition.unscoped.where('document_id = ?', document.id).order('id ASC')
# for each edition in the document
|
Stop using a magic number for MOD's ID
|
diff --git a/core/lib/refinery/helpers/site_bar_helper.rb b/core/lib/refinery/helpers/site_bar_helper.rb
index abc1234..def5678 100644
--- a/core/lib/refinery/helpers/site_bar_helper.rb
+++ b/core/lib/refinery/helpers/site_bar_helper.rb
@@ -13,10 +13,8 @@ link_to t('.switch_to_your_website_editor'),
(if session.keys.include?(:refinery_return_to) and session[:refinery_return_to].present?
session[:refinery_return_to]
- elsif defined?(@page) and @page.present? and !@page.home?
- edit_admin_page_path(@page)
else
- (request.fullpath.to_s == '/') ? admin_root_path : "/refinery#{request.fullpath}/edit"
+ admin_root_path
end rescue admin_root_path)
end
end
|
Make the function dumber so that it doesn't try to guess.
|
diff --git a/spec/likeable/like_spec.rb b/spec/likeable/like_spec.rb
index abc1234..def5678 100644
--- a/spec/likeable/like_spec.rb
+++ b/spec/likeable/like_spec.rb
@@ -9,12 +9,12 @@ like.user.should eq(@user)
like.target.should eq(@target)
# Times often fail equality checks due to microsec precision
- like.created_at.should be_close(@time, 1)
+ like.created_at.should be_within(1).of(@time)
end
it 'converts float time to propper Time object' do
like = Likeable::Like.new(:time => @time.to_f)
- like.created_at.should be_close(@time, 1)
+ like.created_at.should be_within(1).of(@time)
end
end
end
|
Fix matcher deprecation warning on time specs.
|
diff --git a/lib/saxinator/optional.rb b/lib/saxinator/optional.rb
index abc1234..def5678 100644
--- a/lib/saxinator/optional.rb
+++ b/lib/saxinator/optional.rb
@@ -12,14 +12,6 @@ push(state_machine, @child, true) # attempt to parse child
end
- def start_element(state_machine, name, attrs = [])
- @child.start_element(state_machine, name, attrs)
- end
-
- def end_element(state_machine, name)
- @child.end_element(state_machine, name)
- end
-
def continue(state_machine, result)
# child parse succeeded; we succeed as well
finish(state_machine, result)
|
Remove extraneous code from Optional combinator
|
diff --git a/lib/divide/extractor.rb b/lib/divide/extractor.rb
index abc1234..def5678 100644
--- a/lib/divide/extractor.rb
+++ b/lib/divide/extractor.rb
@@ -13,6 +13,8 @@ splitted_procfile = @procfile_content.split(/\s/)
@options.each do |option|
+ next if option.length < 2
+
key = option[0]
value = option[1]
|
Fix bug when a flag/option doesn’t have a value
|
diff --git a/lib/weighable/active_record/migration_extensions/table.rb b/lib/weighable/active_record/migration_extensions/table.rb
index abc1234..def5678 100644
--- a/lib/weighable/active_record/migration_extensions/table.rb
+++ b/lib/weighable/active_record/migration_extensions/table.rb
@@ -9,9 +9,9 @@ end
def remove_weighable(column)
- remove_column "#{column}_value"
- remove_column "#{column}_unit"
- remove_column "#{column}_display_unit"
+ remove "#{column}_value"
+ remove "#{column}_unit"
+ remove "#{column}_display_unit"
end
end
end
|
Fix issue with using wrong method in migration command
|
diff --git a/app/controllers/spree/admin/variants_controller_decorator.rb b/app/controllers/spree/admin/variants_controller_decorator.rb
index abc1234..def5678 100644
--- a/app/controllers/spree/admin/variants_controller_decorator.rb
+++ b/app/controllers/spree/admin/variants_controller_decorator.rb
@@ -1,6 +1,4 @@ Spree::Admin::VariantsController.class_eval do
- update.before :before_update
-
respond_override :update => {:html => {
:success => lambda { redirect_to(@variant.is_master ? volume_prices_admin_product_variant_url(@variant.product, @variant) : collection_url) },
:failure => lambda { redirect_to(@variant.is_master ? volume_prices_admin_product_variant_url(@variant.product, @variant) : collection_url) } } }
|
Remove call to non-existant before_update hook in Admin::VariantsController decorator
|
diff --git a/test/integration/installation_package/inspec/assert_functioning_spec.rb b/test/integration/installation_package/inspec/assert_functioning_spec.rb
index abc1234..def5678 100644
--- a/test/integration/installation_package/inspec/assert_functioning_spec.rb
+++ b/test/integration/installation_package/inspec/assert_functioning_spec.rb
@@ -1,5 +1,10 @@-
-describe command('/usr/bin/docker --version') do
- its(:exit_status) { should eq 0 }
- its(:stdout) { should match(/18.03.0/) }
+if os[:name] == 'amazon'
+ describe command('/usr/bin/docker --version') do
+ its(:exit_status) { should eq 0 }
+ end
+else
+ describe command('/usr/bin/docker --version') do
+ its(:exit_status) { should eq 0 }
+ its(:stdout) { should match(/18.03.0/) }
+ end
end
|
Update package specs to pass on Amazon Linux
The version is updated all the time here so we can't rely on anything in the tests
Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
|
diff --git a/lib/dnsimple/error.rb b/lib/dnsimple/error.rb
index abc1234..def5678 100644
--- a/lib/dnsimple/error.rb
+++ b/lib/dnsimple/error.rb
@@ -15,7 +15,7 @@ private
def message_from(http_response)
- if http_response.headers["Content-Type"] =~ %r{^application/json}
+ if http_response.headers["Content-Type"].start_with?("application/json")
http_response.parsed_response["message"]
else
net_http_response = http_response.response
|
Use start_with? instead of regexp match
|
diff --git a/lib/fog/cloudstack.rb b/lib/fog/cloudstack.rb
index abc1234..def5678 100644
--- a/lib/fog/cloudstack.rb
+++ b/lib/fog/cloudstack.rb
@@ -8,7 +8,7 @@
service(:compute, 'cloudstack/compute','Compute')
- @@digest = OpenSSL::Digest::Digest.new('sha1')
+ @@digest = OpenSSL::Digest.new('sha1')
def self.escape(string)
string = CGI::escape(string)
|
Use OpenSSL::Digest instead of deprecated OpenSSL::Digest::Digest
|
diff --git a/db/migrate/20090404033151_add_single_access_token_to_invision_user.rb b/db/migrate/20090404033151_add_single_access_token_to_invision_user.rb
index abc1234..def5678 100644
--- a/db/migrate/20090404033151_add_single_access_token_to_invision_user.rb
+++ b/db/migrate/20090404033151_add_single_access_token_to_invision_user.rb
@@ -1,6 +1,6 @@ class AddSingleAccessTokenToInvisionUser < ActiveRecord::Migration
def self.up
- add_column :ibf_members, :single_access_token, :string, :null => false
+ add_column :ibf_members, :single_access_token, :string, :null => true
InvisionUser.find_each do |user|
user.update_attributes(:single_access_token => nil)
|
Change :single_access_token :null to true
This prevents blank api_key values from being valid.
|
diff --git a/minitest-fastfail.gemspec b/minitest-fastfail.gemspec
index abc1234..def5678 100644
--- a/minitest-fastfail.gemspec
+++ b/minitest-fastfail.gemspec
@@ -14,7 +14,7 @@ gem.summary = %q{Show a dot for each passing test. Show full description for each tests that fail or have errors.}
gem.files = Dir.glob("lib/**/*") + %w(LICENSE README.md CHANGELOG.md)
- gem.test_files = Dir.glob("spec/**/*")
+ gem.test_files = Dir.glob("test/**/*")
gem.require_paths = ["lib"]
gem.add_dependency 'minitest', '>= 4.2.0'
|
Fix gemspec to point to correct test files
|
diff --git a/app/models/transaction.rb b/app/models/transaction.rb
index abc1234..def5678 100644
--- a/app/models/transaction.rb
+++ b/app/models/transaction.rb
@@ -14,4 +14,8 @@ def self.sort_by_active
Transaction.joins(:request).where('transaction_type LIKE :type AND transactions.created_at BETWEEN :then AND :now', type: 'request', then: 1.hour.ago, now: Time.now).where(requests: {is_fulfilled: false})
end
+
+ def pretty_date
+ time_ago_in_words(created_at)
+ end
end
|
Add method for displaying date in words
|
diff --git a/lib/mips/assembler.rb b/lib/mips/assembler.rb
index abc1234..def5678 100644
--- a/lib/mips/assembler.rb
+++ b/lib/mips/assembler.rb
@@ -1,5 +1,5 @@ module MIPS
- SYNTAX = /^\s*((?<tag>[a-zA-Z]\w*)\s*:\s*)?((?<cmd>[a-z]+)\s*((?<arg1>\$?\w+)\s*(,\s*((?<arg2>\$?\w+)|((?<offset>\d+)\(\s*(?<arg2>\$\w+)\s*\)))\s*(,\s*(?<arg3>\$?\w+)\s*)?)?)?)?(#.*)?$/
+ SYNTAX =
# Represent a MIPS syntax error
class MIPSSyntaxError < StandardError
@@ -16,7 +16,7 @@
def assembly(src)
src.each_line do |line|
- fail MIPSSyntaxError, "#{line}: Syntax error." unless SYNTAX =~ line
+ fail MIPSSyntaxError, "#{line}: Syntax error." unless /^\s*((?<tag>[a-zA-Z]\w*)\s*:\s*)?((?<cmd>[a-z]+)\s*((?<arg1>\$?\w+)\s*(,\s*((?<arg2>\$?\w+)|((?<offset>\d+)\(\s*(?<arg2>\$\w+)\s*\)))\s*(,\s*(?<arg3>\$?\w+)\s*)?)?)?)?(#.*)?$/ =~ line
read_tag tag
end
end
|
Fix an misuse of regex
|
diff --git a/test/unit/document_test.rb b/test/unit/document_test.rb
index abc1234..def5678 100644
--- a/test/unit/document_test.rb
+++ b/test/unit/document_test.rb
@@ -21,8 +21,20 @@ require 'test_helper'
describe "a Riagent::Document" do
- it "should pass" do
- doc = User.new
- assert true
+ # See test/examples/models/user.rb
+ # User class includes the Riagent::Document mixin
+ let(:user_document) { User.new }
+
+ it "has a key" do
+ user_document.key.must_be_nil # first initialized
+ test_key = 'george'
+ user_document.key = test_key
+ user_document.key.must_equal test_key
+ # Test for the .id alias
+ user_document.id.must_equal test_key
+ end
+
+ it "has model attributes" do
+ user_document.attributes.count.must_equal 3 # :username, :email, :language
end
end
|
Test for document key & attributes
|
diff --git a/spec/scss_lint/linter/compass/property_with_mixin_spec.rb b/spec/scss_lint/linter/compass/property_with_mixin_spec.rb
index abc1234..def5678 100644
--- a/spec/scss_lint/linter/compass/property_with_mixin_spec.rb
+++ b/spec/scss_lint/linter/compass/property_with_mixin_spec.rb
@@ -40,4 +40,16 @@
it { should report_lint line: 2 }
end
+
+ context 'when properties are ignored' do
+ let(:linter_config) { { 'ignore' => %w[inline-block] } }
+
+ let(:css) { <<-CSS }
+ p {
+ display: inline-block;
+ }
+ CSS
+
+ it { should_not report_lint }
+ end
end
|
Add spec for new PropertyWithMixin ignore option
Change-Id: Ifc7d552844e8bdc9c117c2719b53ef9f76d6bb40
Reviewed-on: http://gerrit.causes.com/40956
Tested-by: jenkins <d95b56ce41a2e1ac4cecdd398defd7414407cc08@causes.com>
Reviewed-by: Shane da Silva <67fb7bfe39f841b16a1f86d3928acc568d12c716@brigade.com>
|
diff --git a/lib/messenger.rb b/lib/messenger.rb
index abc1234..def5678 100644
--- a/lib/messenger.rb
+++ b/lib/messenger.rb
@@ -34,13 +34,13 @@ listener.listen
end
- def self.work(type = nil)
- self.new.work type
+ def self.work(message, type = nil)
+ self.new.work message, type
end
- def work(type = nil)
+ def work(message, type = nil)
worker = type.nil? ? @worker : worker_for(type)
- worker.work
+ worker.work message
end
private
|
Fix work to pass the message
|
diff --git a/lib/nehm/configure.rb b/lib/nehm/configure.rb
index abc1234..def5678 100644
--- a/lib/nehm/configure.rb
+++ b/lib/nehm/configure.rb
@@ -2,20 +2,59 @@ module Configure
def self.menu
loop do
- puts 'Download path: ' + Paint[PathControl.dl_path, :magenta] if PathControl.dl_path
- puts 'iTunes path: ' + Paint[PathControl.itunes_path_name, :magenta] if PathControl.itunes_path
- puts 'Permalink: ' + Paint[Config[:permalink], :cyan] if Config[:permalink]
- puts "\n"
+ output = ''
+
+ # Download path
+ output << 'Download path: '
+ output <<
+ if Config[:dl_path]
+ Paint[Config[:dl_path], :magenta]
+ else
+ Paint["doesn't set up", :gold]
+ end
+ output << "\n"
+
+ # iTunes path
+ output << 'iTunes path: '
+ output <<
+ if PathControl.itunes_path
+ Paint[PathControl.itunes_path_name, :magenta]
+ else
+ Paint["doesn't set up", :gold]
+ end
+ output << "\n"
+
+ # Permalink
+ output << 'Permalink: '
+ output <<
+ if Config[:permalink]
+ Paint[Config[:permalink], :cyan]
+ else
+ Paint["doesn't set up", :gold]
+ end
+ output << "\n"
+
+ # Playlist
+ output << 'Playlist: '
+ output <<
+ if PlaylistControl.playlist
+ Paint[PlaylistControl.playlist, :cyan]
+ else
+ Paint["doesn't set up", :gold]
+ end
+ output << "\n"
+
+ puts output
HighLine.new.choose do |menu|
menu.prompt = Paint['Choose setting', :yellow]
menu.choice('Edit download path'.freeze) { PathControl.set_dl_path }
- menu.choice('Edit itunes path'.freeze) { PathControl.set_itunes_path } unless OS.linux?
+ menu.choice('Edit iTunes path'.freeze) { PathControl.set_itunes_path } unless OS.linux?
menu.choice('Edit permalink'.freeze) { UserControl.log_in }
+ menu.choice('Edit iTunes playlist'.freeze) { PlaylistControl.set_playlist } unless OS.linux?
menu.choice('Exit'.freeze) { exit }
end
- sleep(1)
puts "\n"
end
end
|
Add check for unset up options
|
diff --git a/lib/postmark-rails.rb b/lib/postmark-rails.rb
index abc1234..def5678 100644
--- a/lib/postmark-rails.rb
+++ b/lib/postmark-rails.rb
@@ -1,9 +1,11 @@ require 'action_mailer'
require 'postmark'
-require 'postmark-rails/delivery_method'
module PostmarkRails
+ extend ActiveSupport::Autoload
extend self
+
+ autoload :DeliveryMethod, 'postmark-rails/delivery_method'
def auto_detect_and_install
if ActionMailer::Base.respond_to?(:add_delivery_method)
|
Use ActiveSupport::Autoload so that we don't even load the PostmarkRails::DeliveryMethod module in newer versions.
|
diff --git a/lib/rqrcode-rails3.rb b/lib/rqrcode-rails3.rb
index abc1234..def5678 100644
--- a/lib/rqrcode-rails3.rb
+++ b/lib/rqrcode-rails3.rb
@@ -11,15 +11,14 @@
extend SizeCalculator
- ActionController::Renderers.add :qrcode do |string, options|
- format = self.request.format.symbol
+
+ def render_qrcode(string, format, options)
size = options[:size] || RQRCode.minimum_qr_size_from_string(string)
level = options[:level] || :h
qrcode = RQRCode::QRCode.new(string, :size => size, :level => level)
svg = RQRCode::Renderers::SVG::render(qrcode, options)
- data = \
if format && format == :svg
svg
else
@@ -27,7 +26,13 @@ image.format format
image.to_blob
end
+ end
+ module_function :render_qrcode
+
+ ActionController::Renderers.add :qrcode do |string, options|
+ format = self.request.format.symbol
+ data = RQRCode.render_qrcode(string, format, options)
self.response_body = render_to_string(:text => data, :template => nil)
end
end
|
Refactor render code into callable module function
|
diff --git a/lib/snapme/snapper.rb b/lib/snapme/snapper.rb
index abc1234..def5678 100644
--- a/lib/snapme/snapper.rb
+++ b/lib/snapme/snapper.rb
@@ -21,6 +21,10 @@
def endpoint_url
"#{host}/snapshot"
+ end
+
+ def field_name
+ 'snapshot'
end
def filename
@@ -48,7 +52,7 @@ end
def file
- Curl::PostField.file('snapshot', filename)
+ Curl::PostField.file(field_name, filename)
end
end
end
|
Revert "Get rid of method for field name constant"
* This reverts commit d3e4d699f1838a5945fcdc455dea4b80786fc93f.
* I was wrong, this method is used in specs and that is probably a good
thing...
|
diff --git a/lib/tasks/deploy.rake b/lib/tasks/deploy.rake
index abc1234..def5678 100644
--- a/lib/tasks/deploy.rake
+++ b/lib/tasks/deploy.rake
@@ -5,13 +5,13 @@ system("mkdir -p log tmp")
end
- task :bundle_gems do
+ task :bundle_gems => [:environment] do
puts "bundling..."
Dir.chdir(Rails.root)
system("bundle")
end
- task :db_migrate do
+ task :db_migrate => [:environment] do
Rake::Task['db:migrate']
end
|
Add environment scope to the rake tasks
|
diff --git a/lib/tasks/deploy.rake b/lib/tasks/deploy.rake
index abc1234..def5678 100644
--- a/lib/tasks/deploy.rake
+++ b/lib/tasks/deploy.rake
@@ -21,3 +21,5 @@ PackageBuilder.deploy!(:production)
end
end
+
+task deploy: 'deploy:staging'
|
Deploy to staging by default
|
diff --git a/lib/tasks/travis.rake b/lib/tasks/travis.rake
index abc1234..def5678 100644
--- a/lib/tasks/travis.rake
+++ b/lib/tasks/travis.rake
@@ -1,8 +1,8 @@ namespace :travis do
- desc "Runs rspec specs on travis"
+ desc "Runs rspec specs and jasmine specs on travis"
task :run_specs do
- ["rspec spec"].each do |cmd|
+ ["rspec spec", "rake --trace jasmine:ci"].each do |cmd|
puts "Starting to run #{cmd}..."
system("export DISPLAY=:99.0 && bundle exec #{cmd}")
raise "#{cmd} failed!" unless $?.exitstatus == 0
@@ -11,4 +11,4 @@
end
-task :travis => 'travis:run_specs'
+task :travis => 'travis:run_specs'
|
Revert "Removes jasmine tests from running on Travis for now."
This reverts commit af68f7b4c258f5908f57b14e4047c2240c8b2a0b.
|
diff --git a/lib/analytics/course_wikidata_csv_builder.rb b/lib/analytics/course_wikidata_csv_builder.rb
index abc1234..def5678 100644
--- a/lib/analytics/course_wikidata_csv_builder.rb
+++ b/lib/analytics/course_wikidata_csv_builder.rb
@@ -18,7 +18,7 @@ hash_stats = @course
.course_stat.stats_hash['www.wikidata.org']
.merge({ 'course name' => @course.title })
- CSV_HEADERS.map { |elmnt| hash_stats.fetch elmnt, '' }
+ CSV_HEADERS.map { |elmnt| hash_stats.fetch elmnt, 0 }
end
CSV_HEADERS = [
|
Fix deprecation warning for Enumerable.sum
CampaignCsvBuilder#sum_wiki_columns was throwing warnings whenever it would sum a column that included non-numeric values, since Rails has deprecated the Rails implementation of Enumerable.sum in favor of the native Ruby version.
Using 0 rather than an empty string as the default fallback value of a stat_row in CourseWikidataCsvBuilder fixes this problem.
In production, there are no CourseStat records with an empty string as a value, so this should be a safe change even after the behavior of .sum changes in Rails 7.1.
|
diff --git a/lib/tenanted/model.rb b/lib/tenanted/model.rb
index abc1234..def5678 100644
--- a/lib/tenanted/model.rb
+++ b/lib/tenanted/model.rb
@@ -10,6 +10,12 @@
def current_tenant= value
@@tenant = value
+
+ if postgresql?
+ ActiveRecord::Base.connection.schema_search_path = "tenant_#{@@tenant.id},public"
+ else
+ # TODO implement multi-tenancy for MySQL and SQLite3
+ end
end
def current_tenant
|
Switch schema when switching tenant
|
diff --git a/test/linear_test.rb b/test/linear_test.rb
index abc1234..def5678 100644
--- a/test/linear_test.rb
+++ b/test/linear_test.rb
@@ -20,6 +20,10 @@ constraint2.set_coefficient(x, 1)
constraint2.set_coefficient(y, -1)
+ # solver.add(x + y * 2 <= 14)
+ # solver.add(x*3 + y >= 0)
+ # solver.add(x - y <= 2)
+
objective = solver.objective
objective.set_coefficient(x, 3)
objective.set_coefficient(y, 4)
|
Test better expression building for solver [skip ci]
|
diff --git a/grabbers/grab-thehowardtheatre.rb b/grabbers/grab-thehowardtheatre.rb
index abc1234..def5678 100644
--- a/grabbers/grab-thehowardtheatre.rb
+++ b/grabbers/grab-thehowardtheatre.rb
@@ -0,0 +1,49 @@+require_relative 'grabber'
+
+class GrabTheHowardTheatre < Grabber
+ # get the array of urls to grab from
+ def grab_urls
+ # The url that list all the shows
+ [
+ "http://thehowardtheatre.com/calendar/"
+ ]
+ end
+ # Go through each url to get the shows
+ def shows
+ # The layout is crazy !? (uses fullcalendar)
+ self.grab_pages(self.grab_urls).map do |page|
+ # Looks like it is consistent in the classes it uses
+ # so grab what we need
+ page.search("a.fc-event").map do |elem|
+ # TODO: Grab the date from the column?
+ # Grab date from the href it looks like the format of "{url}/show/YYYY/MM/DD/{rest of url}"
+ href = elem["href"]
+ # no link, then no date
+ next if href.nil?
+ href.strip!
+ # if no "show" then it is a private event
+ next unless href.include?("show")
+ # make sure there is a date
+ match = href.match(/[[:digit:]]+\/[[:digit:]]+\/[[:digit:]]+/)[0]
+ next if match.nil?
+ # convert the date so we can see the year
+ date = convert_date(match)
+
+ # grab the rest of the information
+ headlinerNode = elem.at(".headliner")
+ # grab the siblings after the headliner element
+ supportNode = elem.at(".headliner ~ small")
+
+ # create the show object
+ {
+ :venue => "The Howard Theatre",
+ :date => date,
+ :headliner => headlinerNode == nil ? "": headlinerNode.text,
+ :support => supportNode == nil ? [] : supportNode.text.split(",")
+ }
+ end
+ end
+ end
+end
+
+p(GrabTheHowardTheatre.new.shows)
|
Add a scraper for the the howard theatre website
|
diff --git a/lib/timetrack.rb b/lib/timetrack.rb
index abc1234..def5678 100644
--- a/lib/timetrack.rb
+++ b/lib/timetrack.rb
@@ -3,5 +3,7 @@ require 'timetrack/parser'
# Entrypoint for gem
+#
+# @api private
module Timetrack
end
|
Add @api private to toplevel namespace
|
diff --git a/spec/adapters/faraday_adapter.rb b/spec/adapters/faraday_adapter.rb
index abc1234..def5678 100644
--- a/spec/adapters/faraday_adapter.rb
+++ b/spec/adapters/faraday_adapter.rb
@@ -1,17 +1,25 @@ require 'faraday'
class FaradayAdapter < HTTPBaseAdapter
def send_get_request
- conn = Faraday.new(:url => "#{@protocol}://#{@host}:#{@port}") do |faraday|
- faraday.adapter Faraday.default_adapter # make requests with Net::HTTP
- end
-
- conn.get do |req|
+ connection.get do |req|
+ req.url parse_uri.to_s
req.headers = @headers
- req.url parse_uri.to_s
end
end
def send_post_request
- HTTParty.post(parse_uri.to_s, body: @data, headers: @headers)
+ connection.post do |req|
+ req.url parse_uri.to_s
+ req.headers = @headers
+ req.body = @data
+ end
+ end
+
+ private
+
+ def connection
+ Faraday.new(url: "#{@protocol}://#{@host}:#{@port}") do |faraday|
+ faraday.adapter Faraday.default_adapter # make requests with Net::HTTP
+ end
end
end
|
Fix Faraday test adapter to actually use Faraday for POSTing
|
diff --git a/spec/controllers/clients_spec.rb b/spec/controllers/clients_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/clients_spec.rb
+++ b/spec/controllers/clients_spec.rb
@@ -24,4 +24,10 @@ delete :destroy, { id: @client.id }
expect(response).to redirect_to clients_path
end
+
+ it "requires authentication" do
+ logout if logged_in?
+ get :index
+ expect(response).to have_http_status 302
+ end
end
|
Add Spec to Check for Login (Clients)
|
diff --git a/spec/core/float/multiply_spec.rb b/spec/core/float/multiply_spec.rb
index abc1234..def5678 100644
--- a/spec/core/float/multiply_spec.rb
+++ b/spec/core/float/multiply_spec.rb
@@ -4,6 +4,6 @@ it "returns self multiplied by other" do
(4923.98221 * 2).should be_close(9847.96442, TOLERANCE)
(6712.5 * 0.25).should be_close(1678.125, TOLERANCE)
- (256.4096 * 0xffffffff).to_s.should == 1101270846124.03.to_s
+ (256.4096 * 0xffffffff).should be_close(1101270846124.03, TOLERANCE * 0xffffffff)
end
end
|
Modify Float multiply spec to be_close with a TOLERANCE multiplied by a similar scale as the value under test.
|
diff --git a/test/test_helper.rb b/test/test_helper.rb
index abc1234..def5678 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -12,7 +12,7 @@ # Different DB settings and load our schema.
connection = case ENV["DB"]
when /mysql/
- { :adapter => "mysql", :username => "root", :database => "typus_test" }
+ { :adapter => "mysql", :database => "typus_test" }
when /postgresql/
{ :adapter => "postgresql", :encoding => "unicode", :database => "typus_test" }
else
|
Use .my.cnf to connect to the database
|
diff --git a/test/test_helper.rb b/test/test_helper.rb
index abc1234..def5678 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -4,7 +4,7 @@ require 'plugin_test_helper'
# Run the migrations
-ActiveRecord::Migrator.migrate("#{RAILS_ROOT}/db/migrate")
+ActiveRecord::Migrator.migrate("#{Rails.root}/db/migrate")
# Mixin the factory helper
require File.expand_path("#{File.dirname(__FILE__)}/factory")
|
Use Rails.root instead of RAILS_ROOT in preparation for the Rails 2.1 release
|
diff --git a/spec/models/organisation_spec.rb b/spec/models/organisation_spec.rb
index abc1234..def5678 100644
--- a/spec/models/organisation_spec.rb
+++ b/spec/models/organisation_spec.rb
@@ -1,25 +1,49 @@ require "spec_helper"
describe Organisation do
- let!(:hmrc) { create :organisation }
+ subject(:organisation) { create :organisation, abbreviation: abbreviation, title: title }
+ let(:title) { "HM Revenue & Customs" }
+ let(:abbreviation) { "HMRC" }
- describe "#all" do
- it "should have only hmrc loaded" do
- Organisation.all.should eq([hmrc])
+ describe "#title_with_abbreviation" do
+
+ context "when abbreviation is present" do
+
+ it "should append abbreviation to the title" do
+ organisation.title_with_abbreviation.should eq("HM Revenue & Customs [HMRC]")
+ end
+ end
+
+ context "when abbreviation is blank" do
+ let(:abbreviation) { nil }
+
+ it "should not append abbreviation to title" do
+ organisation.title_with_abbreviation.should eq("HM Revenue & Customs")
+ end
end
end
- describe "#load_organisations, #initialize" do
- it "should correctly create hmrc" do
- hmrc.title.should eq("HM Revenue & Customs")
- hmrc.format.should eq("Non-ministerial department")
- hmrc.slug.should eq("hm-revenue-customs")
- hmrc.abbreviation.should eq("HMRC")
+
+ describe "#abbreviation_or_title" do
+ context "when abbreviation is present" do
+
+ it "should show abbreviation" do
+ organisation.abbreviation_or_title.should eq(abbreviation)
+ end
+ end
+
+ context "when abbreviation is blank" do
+ let(:abbreviation) { nil }
+
+ it "should show title" do
+ organisation.abbreviation_or_title.should eq(title)
+ end
end
end
- describe "#find HMRC" do
- it "should find hmrc by slug" do
- Organisation.find_by_slug("hm-revenue-customs").should eq(hmrc)
+
+ describe "#path" do
+ it "should return correct path" do
+ organisation.path.should eq("/government/organisations/hm-revenue-customs")
end
end
-
+
end
|
Refactor Organisation spec to test methods
As per:
https://github.com/alphagov/hmrc-contacts/pull/113#commitcomment-5908997
I've refactored this test to test the actual methods in Organisation.rb
|
diff --git a/spec/toy_robot/toy_robot_spec.rb b/spec/toy_robot/toy_robot_spec.rb
index abc1234..def5678 100644
--- a/spec/toy_robot/toy_robot_spec.rb
+++ b/spec/toy_robot/toy_robot_spec.rb
@@ -10,24 +10,24 @@ end
end
- describe 'example a' do
+ context 'when example a' do
let(:commands) { ['PLACE 0,0,NORTH', 'MOVE', 'REPORT'] }
it { expect(subject).to eq '0,1,NORTH' }
end
- describe 'example b' do
+ context 'when example b' do
let(:commands) { ['PLACE 0,0,NORTH', 'LEFT', 'REPORT'] }
it { expect(subject).to eq '0,0,WEST' }
end
- describe 'example c' do
+ context 'when example c' do
let(:commands) do
['PLACE 1,2,EAST', 'MOVE', 'MOVE', 'LEFT', 'MOVE', 'REPORT']
end
it { expect(subject).to eq '3,3,NORTH' }
end
- describe 'example d' do
+ context 'when example d' do
let(:commands) { ['PLACE 1,1,SOUTH', 'MOVE', 'REPORT'] }
it { expect(subject).to eq '1,0,SOUTH' }
end
|
Change bin spec describes to contexts
|
diff --git a/middleman-core/lib/middleman-core/dns_resolver/basic_network_resolver.rb b/middleman-core/lib/middleman-core/dns_resolver/basic_network_resolver.rb
index abc1234..def5678 100644
--- a/middleman-core/lib/middleman-core/dns_resolver/basic_network_resolver.rb
+++ b/middleman-core/lib/middleman-core/dns_resolver/basic_network_resolver.rb
@@ -21,7 +21,7 @@ # Array of Names
def getnames(ip)
resolver.getnames(ip.to_s).map(&:to_s)
- rescue Resolv::ResolvError, Errno::EADDRNOTAVAIL
+ rescue Resolv::ResolvError, Errno::EADDRNOTAVAIL, Errno::ENETUNREACH
[]
end
@@ -34,7 +34,7 @@ # Array of ipaddresses
def getaddresses(name)
resolver.getaddresses(name.to_s).map(&:to_s)
- rescue Resolv::ResolvError, Errno::EADDRNOTAVAIL
+ rescue Resolv::ResolvError, Errno::EADDRNOTAVAIL, Errno::ENETUNREACH
[]
end
|
Add Errno::ENETUNREACH to exception list in BasicNetworkResolver
Fixes #1621
|
diff --git a/spec/models/customer_spec.rb b/spec/models/customer_spec.rb
index abc1234..def5678 100644
--- a/spec/models/customer_spec.rb
+++ b/spec/models/customer_spec.rb
@@ -1,5 +1,7 @@ require 'spec_helper'
describe Customer do
- pending "add some examples to (or delete) #{__FILE__}"
+ it "should create a new instance given valid attributes" do
+ Customer.create!(name: 'John', active: false) # will throw error on failure
+ end
end
|
Replace Pending with a valid example
|
diff --git a/spec/models/routines_spec.rb b/spec/models/routines_spec.rb
index abc1234..def5678 100644
--- a/spec/models/routines_spec.rb
+++ b/spec/models/routines_spec.rb
@@ -0,0 +1,23 @@+require 'spec_helper'
+
+# TODO https://github.com/NetSweet/netsuite_rails/issues/16
+# there are still some unresolved issues with NS datetime/date conversions
+# the tests + implementation may still not be correct.
+
+describe NetSuiteRails::Routines do
+ describe '#company_contact_match' do
+ it "matches on first and last name first" do
+
+ end
+
+ it "matches on email if no name match is found" do
+
+ end
+
+ it "returns nil if no match is found" do
+
+ end
+
+ # TODO also handle updating contact information
+ end
+end
|
Test boilerplate for company contact match routine
|
diff --git a/spec/usaidwat/client_spec.rb b/spec/usaidwat/client_spec.rb
index abc1234..def5678 100644
--- a/spec/usaidwat/client_spec.rb
+++ b/spec/usaidwat/client_spec.rb
@@ -3,14 +3,6 @@ module USaidWat
module Client
describe Client do
- before(:each) do
- WebMock.disable_net_connect!
- WebMock.reset!
- root = File.expand_path("../../../test/responses", __FILE__)
- stub_request(:get, "http://www.reddit.com/user/mipadi/comments.json?after=&limit=100").
- to_return(:body => IO.read(File.join(root, "comments.json")))
- end
-
let(:redditor) { Client::Redditor.new("mipadi") }
describe "#username" do
@@ -19,9 +11,34 @@ end
end
- describe "#comments" do
- it "gets 100 comments" do
- redditor.comments.count.should == 100
+ context "when Reddit is up" do
+ before(:each) do
+ WebMock.disable_net_connect!
+ WebMock.reset!
+ root = File.expand_path("../../../test/responses", __FILE__)
+ stub_request(:get, "http://www.reddit.com/user/mipadi/comments.json?after=&limit=100").
+ to_return(:body => IO.read(File.join(root, "comments.json")))
+ end
+
+ describe "#comments" do
+ it "gets 100 comments" do
+ redditor.comments.count.should == 100
+ end
+ end
+ end
+
+ context "when Reddit is down" do
+ before(:each) do
+ WebMock.disable_net_connect!
+ WebMock.reset!
+ stub_request(:get, "http://www.reddit.com/user/mipadi/comments.json?after=&limit=100").
+ to_return(:status => 500)
+ end
+
+ describe "#comments" do
+ it "gets 100 comments" do
+ expect { redditor.comments }.to raise_error(RuntimeError)
+ end
end
end
end
|
Test for network errors when retrieving comments
|
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.4.0'
+ s.version = '2.5.5.0'
s.summary = 'Common primitives for platform-specific messaging implementations for Eventide'
s.description = ' '
|
Package version is increased from 2.5.4.0 to 2.5.5.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 = '0.13.0.0'
+ s.version = '0.14.0.0'
s.summary = 'Messaging primitives for Eventide'
s.description = ' '
|
Package version is increased from 0.13.0.0 to 0.14.0.0
|
diff --git a/tests/dns/helper.rb b/tests/dns/helper.rb
index abc1234..def5678 100644
--- a/tests/dns/helper.rb
+++ b/tests/dns/helper.rb
@@ -30,6 +30,12 @@ :zerigo => {
:mocked => false
},
+ :rackspace => {
+ :mocked => false,
+ :zone_attributes => {
+ :email => 'fog@example.com'
+ }
+ },
:rage4 => {
:mocked => false
}
|
Revert "Moving Rackspace logic to fog-rackspace"
This reverts commit d6ecb19d24503d432d84042753afa1304648d055.
Conflicts:
fog.gemspec
|
diff --git a/lib/axe/configuration.rb b/lib/axe/configuration.rb
index abc1234..def5678 100644
--- a/lib/axe/configuration.rb
+++ b/lib/axe/configuration.rb
@@ -48,3 +48,5 @@ end
end
end
+
+Axe::Configuration.from_yaml
|
Load from yaml file on require
|
diff --git a/lib/dotenv/deployment.rb b/lib/dotenv/deployment.rb
index abc1234..def5678 100644
--- a/lib/dotenv/deployment.rb
+++ b/lib/dotenv/deployment.rb
@@ -1,7 +1,7 @@ require "dotenv"
require "dotenv/deployment/version"
-rails_root = File.absolute_path("./")
+rails_root = Rails.root || Dir.pwd
# Load defaults from .env or *.env in config
Dotenv.load('.env')
|
Use Dir.pwd instead of File.absolute_path
|
diff --git a/lib/ffi/msgpack/types.rb b/lib/ffi/msgpack/types.rb
index abc1234..def5678 100644
--- a/lib/ffi/msgpack/types.rb
+++ b/lib/ffi/msgpack/types.rb
@@ -16,14 +16,14 @@ callback :msgpack_packer_write, [:pointer, :pointer, :uint], :int
enum :msgpack_object_type, [
- :nil, 0x01,
- :boolean, 0x02,
- :positive_integer, 0x03,
- :negative_integer, 0x04,
- :double, 0x05,
- :raw, 0x06,
- :array, 0x07,
- :map, 0x08
+ :nil, 0x00,
+ :boolean, 0x01,
+ :positive_integer, 0x02,
+ :negative_integer, 0x03,
+ :double, 0x04,
+ :raw, 0x05,
+ :array, 0x06,
+ :map, 0x07
]
end
|
Change the msgpack_object_type values for msgpack-0.5.0.
|
diff --git a/lib/github_cli/errors.rb b/lib/github_cli/errors.rb
index abc1234..def5678 100644
--- a/lib/github_cli/errors.rb
+++ b/lib/github_cli/errors.rb
@@ -26,4 +26,12 @@ status_code 12
end
+ class UnknownFormatError < GithubCLIError
+ status_code 13
+
+ def initialize(format)
+ super %{Unrecognized formatting options: #{format} }
+ end
+ end
+
end # GithubCLI
|
Add wrong formatter custom error.
|
diff --git a/db/seeds.rb b/db/seeds.rb
index abc1234..def5678 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -1,7 +1,14 @@-# This file should contain all the record creation needed to seed the database with its default values.
-# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
-#
-# Examples:
-#
-# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
-# Mayor.create(name: 'Emanuel', city: cities.first)
+Customer.create([
+ {name: "3", transaction_count: 100_000_000},
+ {name: "O2", transaction_count: 100_000_000},
+ {name: "Orange", transaction_count: 100_000_000},
+ {name: "Talkmobile", transaction_count: 100_000_000},
+ {name: "T-Mobile", transaction_count: 100_000_000},
+ {name: "Virgin Mobile", transaction_count: 100_000_000},
+ {name: "Vodafone", transaction_count: 100_000_000},
+ {name: "Asda Mobile", transaction_count: 100_000_000},
+ {name: "Family Mobile", transaction_count: 100_000_000},
+ {name: "GiffGaff", transaction_count: 100_000_000},
+ {name: "Lebara Mobile", transaction_count: 100_000_000},
+ {name: "Tesco Mobile", transaction_count: 100_000_000}
+])
|
Add some seed data for the demo
|
diff --git a/lib/max_value.rb b/lib/max_value.rb
index abc1234..def5678 100644
--- a/lib/max_value.rb
+++ b/lib/max_value.rb
@@ -18,7 +18,7 @@ sorter = block ? block : sym
sorted = sort_by(&sorter)
if is_a?(Enumerator::Lazy)
- sorted.lazy.map(&:sym)
+ sorted.lazy.map(&sym)
else
sorted.map(&sym)
end
|
Fix typo, &:sym -> &sym
|
diff --git a/lib/active_cucumber/cucumparer.rb b/lib/active_cucumber/cucumparer.rb
index abc1234..def5678 100644
--- a/lib/active_cucumber/cucumparer.rb
+++ b/lib/active_cucumber/cucumparer.rb
@@ -10,7 +10,7 @@ # Returns all entries in the database as a horizontal Mortadella table
def to_horizontal_table
mortadella = Mortadella::Horizontal.new headers: @cucumber_table.headers
- @clazz.order('created_at ASC').each do |record|
+ @clazz.order('id ASC').each do |record|
cucumberator = cucumberator_for record
mortadella << @cucumber_table.headers.map do |header|
cucumberator.value_for header
|
Sort table entries by id
|
diff --git a/lib/oneroster/apibase.rb b/lib/oneroster/apibase.rb
index abc1234..def5678 100644
--- a/lib/oneroster/apibase.rb
+++ b/lib/oneroster/apibase.rb
@@ -11,7 +11,8 @@ self.consumer_secret = secret
end
- base_url 'https://oneroster.infinitecampus.org/campus/oneroster/entropyMaster/ims/oneroster/v1p1/'
+ BASE_URL = 'https://oneroster.infinitecampus.org/campus/oneroster/entropyMaster/ims/oneroster/v1p1/'
+ base_url BASE_URL
def self.inherited(klass)
super(klass)
klass.verbose!
|
Put base_url into a constant
|
diff --git a/lib/roger_style_guide.rb b/lib/roger_style_guide.rb
index abc1234..def5678 100644
--- a/lib/roger_style_guide.rb
+++ b/lib/roger_style_guide.rb
@@ -4,7 +4,7 @@ module RogerStyleGuide
# The path within project.html_path where the components reside
def self.components_paths=(path)
- @components_paths = [Pathname.new(path)]
+ @components_paths = [path].flatten.map{|p| Pathname.new(p)}
end
def self.components_paths
|
Allow setting components_paths as an array
|
diff --git a/lib/rom/mapper/loader.rb b/lib/rom/mapper/loader.rb
index abc1234..def5678 100644
--- a/lib/rom/mapper/loader.rb
+++ b/lib/rom/mapper/loader.rb
@@ -6,7 +6,7 @@
def call(tuple)
header.each_with_object(model.allocate) { |attribute, object|
- object.send("#{attribute.name}=", tuple[attribute.tuple_key])
+ object.instance_variable_set("@#{attribute.name}", tuple[attribute.tuple_key])
}
end
|
Set ivars instead of calling attr writers
refs #2
|
diff --git a/lib/trice/spec_helper.rb b/lib/trice/spec_helper.rb
index abc1234..def5678 100644
--- a/lib/trice/spec_helper.rb
+++ b/lib/trice/spec_helper.rb
@@ -26,7 +26,7 @@ when :controller
request.headers['X-Requested-At'] = time.iso8601
when :feature
- set_header 'X-Requested-At', time.iso8601
+ page.driver.header 'X-Requested-At', time.iso8601
else
raise Trice::TestStubbingNotSupported, "Test stubbing for type: #{ex.metadata[:type]} is not supported"
end
|
Update capybara header customize method
|
diff --git a/app/controllers/logs_controller.rb b/app/controllers/logs_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/logs_controller.rb
+++ b/app/controllers/logs_controller.rb
@@ -15,11 +15,11 @@ end
def edit
- @log = Log.find(params[:id])
+ @log = Log.find(params[:id])
end
def create
- @log = Log.new(params[:log])
+ @log = Log.new(params[:log])
if @log.save
flash[:notice] = 'Log was successfully created'
@@ -31,7 +31,7 @@ end
def update
- @log = Log.find(params[:id])
+ @log = Log.find(params[:id])
if @log.update_attributes(params[:log])
flash[:notice] = 'Log was successfully updated'
|
Fix indentation in logs controller
|
diff --git a/app/controllers/oils_controller.rb b/app/controllers/oils_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/oils_controller.rb
+++ b/app/controllers/oils_controller.rb
@@ -1,2 +1,49 @@ class OilsController < ApplicationController
+ before_action :set_oil, only: [:show, :edit, :update, :destroy]
+
+ def new
+ @oil = Oil.new
+ end
+
+ def create
+ @oil = Oil.new(oil_params)
+
+ if @oil.save
+ redirect_to oil_path(@oil)
+ else
+ redirect_to new_oil_path
+ end
+ end
+
+ def show
+ end
+
+ def edit
+ end
+
+ def update
+ if @oil.update(oil_params)
+ redirect_to oil_path(@oil)
+ else
+ redirect_to edit_oil_path(@oil)
+ end
+ end
+
+ def index
+ @oils = Oil.all
+ end
+
+ def destroy
+ end
+
+ private
+
+ def oil_params
+ params.require(:oils).permit(:name, :description)
+ end
+
+ def set_oil
+ @oil = Oil.find(param[:id])
+ end
+
end
|
Set up Oil controller actions
|
diff --git a/app/jobs/slack_jobs/inviter_job.rb b/app/jobs/slack_jobs/inviter_job.rb
index abc1234..def5678 100644
--- a/app/jobs/slack_jobs/inviter_job.rb
+++ b/app/jobs/slack_jobs/inviter_job.rb
@@ -1,6 +1,7 @@ class SlackJobs
class InviterJob < SlackJobs
include Sidekiq::Worker
+ sidekiq_options retry: 5
def perform(email)
Raven.user_context email: email
|
Set retries option for SlackJobs
|
diff --git a/db/seeds.rb b/db/seeds.rb
index abc1234..def5678 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -1,7 +1,19 @@-# This file should contain all the record creation needed to seed the database with its default values.
-# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
-#
-# Examples:
-#
-# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
-# Mayor.create(name: 'Emanuel', city: cities.first)
+#Destroy everything
+resources = ["Employment", "Mentorship", "Relationship", "Partner", "User", "Professional", "Student"]
+
+resources.each do |resource|
+ Object.const_get(resource).destroy_all
+end
+
+#Create an admin user
+admin = User.create(email: "admin@codefellows.com", password: "password")
+admin.confirm!
+admin.update_attribute(:admin, true)
+
+#Create some partners
+
+
+#Create Some Students
+
+
+
|
Update seed file to create admin user
|
diff --git a/dbt.gemspec b/dbt.gemspec
index abc1234..def5678 100644
--- a/dbt.gemspec
+++ b/dbt.gemspec
@@ -0,0 +1,27 @@+# -*- encoding: utf-8 -*-
+$:.push File.expand_path("../lib", __FILE__)
+require 'dbt/version'
+
+Gem::Specification.new do |s|
+ s.name = %q{dbt}
+ s.version = Dbt::VERSION
+ s.platform = Gem::Platform::RUBY
+
+ s.authors = ["Peter Donald"]
+ s.email = %q{peter@realityforge.org}
+
+ s.homepage = %q{https://github.com/realityforge/dbt}
+ s.summary = %q{A simple tool designed to simplify the creation, migration and deletion of databases.}
+ s.description = %q{A simple tool designed to simplify the creation, migration and deletion of databases.}
+
+ s.rubyforge_project = %q{dbt}
+
+ s.files = `git ls-files`.split("\n")
+ s.test_files = `git ls-files -- {spec}/*`.split("\n")
+ s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
+ s.default_executable = []
+ s.require_paths = ["lib"]
+
+ s.has_rdoc = false
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "dbt"]
+end
|
Add a minimal gemspec file
|
diff --git a/spec/features/registration_spec.rb b/spec/features/registration_spec.rb
index abc1234..def5678 100644
--- a/spec/features/registration_spec.rb
+++ b/spec/features/registration_spec.rb
@@ -23,6 +23,11 @@
visit '/registration'
fill_in('email', with: email)
+
+ expect(Pony).to receive(:mail).with{|params|
+ expect(params[:to]).to eq email
+ }
+
click_on 'Register'
click_on 'secret'
|
Check registration email in feature test
|
diff --git a/metadata.rb b/metadata.rb
index abc1234..def5678 100644
--- a/metadata.rb
+++ b/metadata.rb
@@ -14,6 +14,5 @@
depends 'apt', '~> 2.4'
depends 'build-essential'
-depends 'disable_ipv6'
depends 'yum', '~> 3.0'
depends 'yum-epel'
|
Remove dependency to test recipe
|
diff --git a/db/migrate/20100406105223_migrate_to_task_users.rb b/db/migrate/20100406105223_migrate_to_task_users.rb
index abc1234..def5678 100644
--- a/db/migrate/20100406105223_migrate_to_task_users.rb
+++ b/db/migrate/20100406105223_migrate_to_task_users.rb
@@ -0,0 +1,21 @@+class MigrateToTaskUsers < ActiveRecord::Migration
+ def self.up
+ say_with_time "Copying task watchers and owners to task_user" do
+ Task.all.each do |task|
+ task.notifications.each do |n|
+ TaskUser.new(:user_id=>n.user_id, :task_id=>n.task_id,:unread=>n.unread, :notified_last_change=>n.notified_last_change).save!
+ end
+ task.task_owners.each do |o|
+ tu=TaskUser.find_or_create_by_task_id_and_user_id(o.task_id, o.user_id)
+ tu.owner=true
+ tu.unread=o.unread
+ tu.notified_last_change=o.notified_last_change
+ tu.save!
+ end
+ end
+ end
+ end
+
+ def self.down
+ end
+end
|
Add migration to merge task_owners and notifications tables into task_users.
|
diff --git a/metadata.rb b/metadata.rb
index abc1234..def5678 100644
--- a/metadata.rb
+++ b/metadata.rb
@@ -16,8 +16,8 @@ supports os
end
-depends 'apt', '>= 2.3.8', '< 3.0.0'
-depends 'database', '>= 4.0.2', '< 5.0.0'
-depends 'mysql', '>= 6.0.13', '< 7.0.0'
-depends 'yum', '>= 3.5.2', '< 4.0.0'
-depends 'yum-epel', '>= 0.6.0', '< 1.0.0'
+depends 'apt', '~> 2.6.1'
+depends 'database', '~> 4.0.2'
+depends 'mysql', '~> 6.0.13'
+depends 'yum', '~> 3.5.2'
+depends 'yum-epel', '~> 0.6.0'
|
Switch back to pessimistic version constraint
Change-Id: Ie7038d8d971cedc0bc487c9b9373b444b66ed66d
Partial-Bug: #1425192
|
diff --git a/spec/lib/data_tiering/sync_spec.rb b/spec/lib/data_tiering/sync_spec.rb
index abc1234..def5678 100644
--- a/spec/lib/data_tiering/sync_spec.rb
+++ b/spec/lib/data_tiering/sync_spec.rb
@@ -5,7 +5,6 @@ subject { described_class }
before do
- Rails = double(:env => double(:test? => true))
subject::SyncLog.delete_all
end
|
Remove last piece of mock Rails
|
diff --git a/spec/lib/hidemyass/request_spec.rb b/spec/lib/hidemyass/request_spec.rb
index abc1234..def5678 100644
--- a/spec/lib/hidemyass/request_spec.rb
+++ b/spec/lib/hidemyass/request_spec.rb
@@ -9,14 +9,14 @@ let(:proxy) { "http://#{proxies[0][:host]}:#{proxies[0][:port]}" }
before do
- HideMyAss.stub(:hydra).and_return(hydra)
- HideMyAss.stub(:proxies).and_return(proxies)
+ allow(HideMyAss).to receive(:hydra).and_return(hydra)
+ allow(HideMyAss).to receive(:proxies).and_return(proxies)
end
[:get, :post, :put, :delete].each do |http_method|
describe ".#{http_method}" do
it "passes :#{http_method} message to typhoeus" do
- Typhoeus::Request.should_receive(:new).
+ expect(Typhoeus::Request).to receive(:new).
with(url, { :method => http_method }.merge(proxy: proxy)).
and_return(res)
|
Convert specs to RSpec 3.0.0 syntax with Transpec
This conversion is done by Transpec 2.2.4 with the following command:
transpec
* 2 conversions
from: obj.stub(:message)
to: allow(obj).to receive(:message)
* 1 conversion
from: obj.should_receive(:message)
to: expect(obj).to receive(:message)
For more details: https://github.com/yujinakayama/transpec#supported-conversions
|
diff --git a/metadata.rb b/metadata.rb
index abc1234..def5678 100644
--- a/metadata.rb
+++ b/metadata.rb
@@ -1,4 +1,4 @@-name 'kibana'
+name 'opsworks_kibana'
maintainer 'Andrew Jo'
maintainer_email 'andrew@verdigris.co'
license 'Simplified BSD'
@@ -6,4 +6,4 @@ long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '0.1.0'
-depends 'chef-kibana', '>=1.3.0'
+depends 'kibana', '>=1.3.0'
|
Update wrapper cookbook name to opsworks_kibana
|
diff --git a/metadata.rb b/metadata.rb
index abc1234..def5678 100644
--- a/metadata.rb
+++ b/metadata.rb
@@ -8,8 +8,8 @@ %w[ debian ubuntu centos redhat fedora scientific suse amazon].each do |os|
supports os
end
-source_url 'https://github.com/brianbianco/redisio'
-issues_url 'https://github.com/brianbianco/redisio/issues'
+source_url 'https://github.com/brianbianco/redisio' if respond_to?(:source_url)
+issues_url 'https://github.com/brianbianco/redisio/issues' if respond_to?(:issues_url)
recipe "redisio::default", "This recipe is used to install the prequisites for building and installing redis, as well as provides the LWRPs"
recipe "redisio::install", "This recipe is used to install redis"
|
Fix to run under Chef <12
|
diff --git a/metadata.rb b/metadata.rb
index abc1234..def5678 100644
--- a/metadata.rb
+++ b/metadata.rb
@@ -15,5 +15,5 @@ depends 'build-essential', '~> 2.2'
depends 'java', '~> 1.39'
depends 'runit', '~> 1.7'
-depends 'apt', '~> 3.0'
+depends 'apt'
depends 'magic', '~> 1.1'
|
Drop apt version pin to avoid conflicts
apt is often pinned in many places, and is generally safe to leave
unpinned. To avoid transistive depsolving pain, this will be unpinned
for now
|
diff --git a/metadata.rb b/metadata.rb
index abc1234..def5678 100644
--- a/metadata.rb
+++ b/metadata.rb
@@ -1,10 +1,9 @@ name "tideways"
-version "0.2.0"
+version "0.2.1"
maintainer "Rupert Jones"
maintainer_email "rjones@inviqa.com"
license "Apache 2.0"
description "Install and configure tideways daemon and PHP extension"
-depends "apt"
depends "yum"
depends "php-fpm"
-depends "httpd"
+depends "apache2"
|
Update depency for apache2 rather than httpd
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.