diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/week-6/die-2/my_solution.rb b/week-6/die-2/my_solution.rb
index abc1234..def5678 100644
--- a/week-6/die-2/my_solution.rb
+++ b/week-6/die-2/my_solution.rb
@@ -6,33 +6,90 @@
# Pseudocode
-# Input:
-# Output:
-# Steps:
+# Input: array of strings representing sides of die
+
+# Output: sides should return the number of sides on the die roll should
+# return the value of a random side.
+
+# Steps: initialize Die with input array
+# check that input array is not empty
+# if array is empty, raise error
+# define instance variable @sides
+# define instance variable @results
+# set @sides = length of input array
+# set @results = input array
+# define METHOD sides to return @sides
+# define METHOD roll to return random value
+ # select random number less than or equal to number of sides
+ # return (random number)th cell of @results
# Initial Solution
-class Die
- def initialize(labels)
- end
+# class Die
+# def initialize(labels)
+# raise(ArgumentError, "Empty Array: There must be at least one side to your die") if labels.empty?
+# @sides = labels.length
+# @results = labels
+# end
- def sides
- end
+# def sides
+# @sides
+# end
- def roll
- end
-end
+# def roll
+# @results[Random.new.rand(@sides)]
+# end
+# end
# Refactored Solution
+class Die
+ def initialize(labels)
+ raise(ArgumentError, "Empty Array: There must be at least one side to your die") if labels.empty?
+ @sides = labels.length
+ @results = labels
+ end
+
+ attr_reader :sides
+
+ def roll
+ @results[Random.new.rand(@sides)]
+ end
+end
+
+# Reflection
+
+=begin
+
+What were the main differences between this die class and the last one you created in terms of
+implementation? Did you need to change much logic to get this to work?
+
+The major difference between this die and the last one was that the random
+number generated needed to be used to select a cell of an array instead of
+just being returned. This meant that there needed to be another instance
+variable pointing to the input array, as well.
+
+What does this exercise teach you about making code that is easily changeable
+or modifiable?
+
+This exercise makes it clear that writing code that is clear and simple in the
+first place makes it much simpler to add new features or modify old ones when
+requirements change.
+What new methods did you learn when working on this challenge, if any?
+Learned the array.empty? method in order to perform the test to see if the
+class needed to raise an ArgumentError. To raise the error, if the input array
+was empty, you'd use the syntax "raise(ArgumentError, "Error message")".
+What concepts about classes were you able to solidify in this challenge?
-
-
-# Reflection+This challenge helped solidify the use of instance variables and accessors -
+specifically, the attr_reader, which allows you to read the value of an
+instance variable without having to write a full method just for that purpose.
+
+=end
|
Add refactored solution and reflection
|
diff --git a/spec/client_spec.rb b/spec/client_spec.rb
index abc1234..def5678 100644
--- a/spec/client_spec.rb
+++ b/spec/client_spec.rb
@@ -22,12 +22,22 @@ faraday.use MiddlewareMiddle
end
- expect(connection.builder.handlers).to eq [
- MiddlewareStart,
- MiddlewareMiddle,
- MiddlewareEnd,
- Faraday::Adapter::NetHttpPersistent
- ]
+ # Workaround the API changes Faraday introduced in 1.0 :(
+ if Faraday::VERSION.start_with? "0."
+ expect(connection.builder.handlers).to eq [
+ MiddlewareStart,
+ MiddlewareMiddle,
+ MiddlewareEnd,
+ Faraday::Adapter::NetHttpPersistent
+ ]
+ else
+ expected = Faraday::RackBuilder.new(
+ [MiddlewareStart, MiddlewareMiddle, MiddlewareEnd],
+ Faraday::Adapter::NetHttpPersistent
+ )
+
+ expect(connection.builder).to eq(expected)
+ end
end
end
end
|
Fix tests so they pass on Faraday 1.0
|
diff --git a/app/controllers/admin/stats_controller.rb b/app/controllers/admin/stats_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/admin/stats_controller.rb
+++ b/app/controllers/admin/stats_controller.rb
@@ -18,7 +18,7 @@ end
def stats_for(klass)
- period = 3.days.ago.beginning_of_day
+ period = 2.days.ago.beginning_of_day
klass.where('created_at > ?', period).group("date(created_at)").count.sort_by{|k,v| k }.reverse
end
end
|
Load less data on the stats page plz
|
diff --git a/test/ts_bud.rb b/test/ts_bud.rb
index abc1234..def5678 100644
--- a/test/ts_bud.rb
+++ b/test/ts_bud.rb
@@ -1,4 +1,9 @@ require 'test_common'
+
+# In "quick mode", don't bother running some of the more expensive tests
+if ARGV.first and ARGV.first.downcase == "quick"
+ $quick_mode = true
+end
require 'tc_aggs'
require 'tc_attr_rewrite'
@@ -9,9 +14,9 @@ require 'tc_dbm'
require 'tc_delta'
require 'tc_errors'
-require 'tc_execmodes'
+require 'tc_execmodes' unless $quick_mode
require 'tc_exists'
-require 'tc_forkdeploy'
+require 'tc_forkdeploy' unless $quick_mode
require 'tc_halt'
require 'tc_inheritance'
require 'tc_interface'
@@ -26,7 +31,7 @@ require 'tc_semistructured'
require 'tc_temp'
require 'tc_terminal'
-require 'tc_threaddeploy'
+require 'tc_threaddeploy' unless $quick_mode
require 'tc_timer'
require 'tc_wc'
require 'tc_with'
|
Add a "quick" mode to test suite.
In quick mode, don't bother running some of the more expensive tests. On my
machine, this reduces the test runtime from ~90 seconds to ~60 seconds. Still
way too slow, but marginally better.
|
diff --git a/app/controllers/api/v1/base_controller.rb b/app/controllers/api/v1/base_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/api/v1/base_controller.rb
+++ b/app/controllers/api/v1/base_controller.rb
@@ -35,7 +35,7 @@ end
def return_error(exception)
- render json: { message: "We are sorry but something went wrong while processing your request" }
+ render json: { message: "We are sorry but something went wrong while processing your request" }, status: 500
end
end
|
Return status 500 when error happens
|
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
@@ -28,7 +28,12 @@
def exhibition_is_set
set_exhibition #First try to set the exhibition
- return !((defined?(@exhibition)).nil?) #returns true if set otherwise false
+
+ if @exhibition.blank?
+ return false
+ else
+ return true
+ end
end
end
|
Change exhibition is set calculation
|
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -2,4 +2,10 @@ # Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
+ before_action :recirect_new_domain, if: -> { request.host == "gitcuss.com" }
+
+ def recirect_new_domain
+ redirect_to "http://gitcussion.com"
+ end
+
end
|
Add redirection from gitcuss.com to gitcussion.com
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -2,8 +2,6 @@ require 'bundler/setup'
require 'rspec'
require_relative '../lib/doc_builder_testing.rb'
-
-RSpec.configure { |c| c.fail_fast = true }
def builder
@builder ||= if ENV['BUILDER_PLATFORM'] == 'WEB'
|
Remove fail fast since problems
It's not very usefull, it's better to get all
failed test while executing parallel_rspec
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,18 +1,10 @@ require 'puppetlabs_spec_helper/module_spec_helper'
require 'shared_examples'
-
-require 'puppet-openstack_spec_helper/defaults'
-require 'rspec-puppet-facts'
-include RspecPuppetFacts
+require 'puppet-openstack_spec_helper/facts'
RSpec.configure do |c|
c.alias_it_should_behave_like_to :it_configures, 'configures'
c.alias_it_should_behave_like_to :it_raises, 'raises'
- # TODO(aschultz): remove this after all tests converted to use OSDefaults
- # instead of referencing @default_facts
- c.before :each do
- @default_facts = OSDefaults.get_facts
- end
end
at_exit { RSpec::Puppet::Coverage.report! }
|
Move rspec-puppet-facts to spec helper
This change updates the module to use the rspec-puppet-facts as defined
in the puppet-openstack_spec_helper.
Change-Id: I6df0fb713772b68249eb38051f3a275e9d75336f
|
diff --git a/test_script.rb b/test_script.rb
index abc1234..def5678 100644
--- a/test_script.rb
+++ b/test_script.rb
@@ -13,7 +13,7 @@ items = klass.find_all(query: 'rest-client', status: :complete)
puts "Searching #{klass.to_s} on query => 'rest-client' returns #{items}"
- media_id = YAML.load(File.open(FILENAME))[guid_key]
+ media_id = Helix::Base::CREDENTIALS[guid_key]
item = klass.find(media_id)
puts "Read #{klass} from guid #{media_id}: #{item.inspect}"
|
Read media_id from Helix::Base::CREDENTIALS, rather than re-parsing YAML
|
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
@@ -14,8 +14,10 @@
def current_user=(user)
if user
+ @current_user = user
session[:user_id] = user.id
else
+ @current_user = nil
session[:user_id] = nil
end
end
|
Make sure that @current_user is also set and cleared
|
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -2,11 +2,16 @@ # Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
+
+ class Forbidden < ActionController::ActionControllerError; end
+ class IpAddressRejected < ActionController::ActionControllerError; end
+
rescue_from Exception, with: :rescue500
+ rescue_from Forbidden, with: :rescue403
+ rescue_from IpAddressRejected, with: :rescue403
rescue_from ActionController::RoutingError, with: :rescue404
rescue_from ActiveRecord::RecordNotFound, with: :rescue404
-
layout :set_layout
|
Add Class IpAddressRejected and Forbidden
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -13,6 +13,9 @@ include BackendHelpers
include ResponseHelpers
include FileHelpers
+
+ conf.filter_run focus: true
+ conf.run_all_when_everything_filtered = true
end
RSpec::Matchers.define :be_a_404 do |expected|
|
Enable focussing of tests in rspec
[#126851165]
Signed-off-by: Steffen Uhlig <f82265073a33b8214db2ab356bc472f35869736c@de.ibm.com>
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,7 +1,13 @@+require "capybara"
+require "capybara/rspec" # Required here instead of in rspec_spec to avoid RSpec deprecation warning
+require "capybara/spec/test_app"
+require "capybara/spec/spec_helper"
require 'capybara-harness'
RSpec.configure do |config|
config.treat_symbols_as_metadata_keys_with_true_values = true
config.run_all_when_everything_filtered = true
config.filter_run :focus
-end
+ config.before { Capybara::SpecHelper.reset! }
+ config.after { Capybara::SpecHelper.reset! }
+end
|
Set up to use capybara spec support in tests.
|
diff --git a/app/controllers/transferred_controller.rb b/app/controllers/transferred_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/transferred_controller.rb
+++ b/app/controllers/transferred_controller.rb
@@ -9,7 +9,7 @@ @pq = PQ.new(pq_params)
@pq.transferred = true
@pq.raising_member_id = '0'
- @pq.progress_id = Progress.UNALLOCATED
+ @pq.progress_id = Progress.unallocated.id
if @pq.save
|
Fix Progress id bug on New Transfers
|
diff --git a/spec/support/vcr.rb b/spec/support/vcr.rb
index abc1234..def5678 100644
--- a/spec/support/vcr.rb
+++ b/spec/support/vcr.rb
@@ -1,4 +1,11 @@ require 'vcr'
+require 'webmock/rspec'
+
+WebMock.disable_net_connect!(allow: [
+ 'api.knapsackpro.com',
+ 'api-staging.knapsackpro.com',
+ 'api.knapsackpro.dev',
+]) if defined?(WebMock)
VCR.configure do |config|
config.cassette_library_dir = "spec/fixtures/vcr_cassettes"
@@ -14,9 +21,3 @@ )
end
-require 'webmock/rspec'
-WebMock.disable_net_connect!(allow: [
- 'api.knapsackpro.com',
- 'api-staging.knapsackpro.com',
- 'api.knapsackpro.dev',
-]) if defined?(WebMock)
|
Move web mock above VCR config
|
diff --git a/app/serializers/application_serializer.rb b/app/serializers/application_serializer.rb
index abc1234..def5678 100644
--- a/app/serializers/application_serializer.rb
+++ b/app/serializers/application_serializer.rb
@@ -2,5 +2,6 @@ attributes :name, :shortname, :archived, :deploy_freeze
attribute :status_notes, key: :notes
attribute :repo_url, key: :repository_url
+ attribute :default_branch, key: :repository_default_branch
attribute :on_aws, key: :hosted_on_aws
end
|
Include default branch in the application JSON serialisation
|
diff --git a/app/services/admin_reservation_expirer.rb b/app/services/admin_reservation_expirer.rb
index abc1234..def5678 100644
--- a/app/services/admin_reservation_expirer.rb
+++ b/app/services/admin_reservation_expirer.rb
@@ -10,7 +10,7 @@
def expired_reservations
if NUCore::Database.oracle?
- AdminReservation.where("reserve_start_at - expires_mins_before / (60*24) < ?", Time.current)
+ AdminReservation.where("reserve_start_at - expires_mins_before / (60*24) < TO_TIMESTAMP(?)", Time.current)
else
AdminReservation.where("SUBTIME(reserve_start_at, MAKETIME(expires_mins_before DIV 60, expires_mins_before MOD 60, 0)) < ?", Time.current)
end
|
Use TO_TIMESTAMP in Oracle comparison with Time.current
|
diff --git a/virtus.gemspec b/virtus.gemspec
index abc1234..def5678 100644
--- a/virtus.gemspec
+++ b/virtus.gemspec
@@ -19,5 +19,5 @@
gem.add_development_dependency('rake', '~> 0.9.2')
gem.add_development_dependency('backports', '~> 2.3.0')
- gem.add_development_dependency('rspec', '~> 2.8.0')
+ gem.add_development_dependency('rspec', '~> 2.7.0')
end
|
Downgrade rspec to 2.7.0 (specs fail on jruby 1.9)
|
diff --git a/lib/ab_admin/concerns/validations.rb b/lib/ab_admin/concerns/validations.rb
index abc1234..def5678 100644
--- a/lib/ab_admin/concerns/validations.rb
+++ b/lib/ab_admin/concerns/validations.rb
@@ -3,7 +3,7 @@ module Validations
class UniqTranslationValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
- ::I18n.available_locales.each do |l|
+ (options[:locales] || ::I18n.available_locales).each do |l|
next if record.read_attribute(attribute, locale: l).blank?
records_scope = record.class.const_get(:Translation).where("#{record.class.model_name.singular}_id != #{record.id || 0}")
same = records_scope.where(name: record.read_attribute(attribute, locale: l), locale: l.to_s).exists?
|
Add locales option to UniqTranslationValidator
|
diff --git a/lib/haml_user_tags/rails/reloader.rb b/lib/haml_user_tags/rails/reloader.rb
index abc1234..def5678 100644
--- a/lib/haml_user_tags/rails/reloader.rb
+++ b/lib/haml_user_tags/rails/reloader.rb
@@ -14,7 +14,7 @@ # Rails 5.0 says:
# DEPRECATION WARNING: to_prepare is deprecated and will be removed from Rails 5.1
# (use ActiveSupport::Reloader.to_prepare instead)
- if ActiveSupport.version.release >= Gem::Version.new('5')
+ if ActiveSupport::VERSION::MAJOR >= 5
ActiveSupport::Reloader
else
ActionDispatch::Reloader
|
Resolve to_prepare deprecation warning in Rails 5.0
use ActiveSupport::VERSION::MAJOR instead of ActiveSupport.version.release in order to maintain compatibility with Rails 3, which unfortunately doesn't provide ActiveSupport.version but instead ActiveSupport::VERSION
|
diff --git a/worker_host/rvm/recipes/default.rb b/worker_host/rvm/recipes/default.rb
index abc1234..def5678 100644
--- a/worker_host/rvm/recipes/default.rb
+++ b/worker_host/rvm/recipes/default.rb
@@ -18,7 +18,7 @@ end
bash "installing system-wide RVM stable" do
- code "sudo bash -s < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)"
+ code "curl -L get.rvm.io | sudo bash -s stable; echo"
not_if "which rvm"
end
|
Use new rvm installation procedure.
Also add a simple command so that a successful installation doesn't fail the Chef run.
|
diff --git a/lib/services/notification_service.rb b/lib/services/notification_service.rb
index abc1234..def5678 100644
--- a/lib/services/notification_service.rb
+++ b/lib/services/notification_service.rb
@@ -1,5 +1,5 @@ #
-# Copyright (C) 2014 Instructure, Inc.
+# Copyright (C) 2014-2016 Instructure, Inc.
#
# This file is part of Canvas.
#
@@ -20,25 +20,34 @@
module Services
class NotificationService
- DEFAULT_CONFIG = {
- notification_service_queue_name: 'notification-service'
- }.freeze
+ def self.process(global_id, body, type, to)
+ return unless notification_queue.present?
- def self.process(global_id, body, type, to)
- self.notification_queue.send_message({
- 'global_id' => global_id,
- 'type' => type,
- 'message' => body,
- 'target' => to,
- 'request_id' => RequestContextGenerator.request_id
+ notification_queue.send_message({
+ global_id: global_id,
+ type: type,
+ message: body,
+ target: to,
+ request_id: RequestContextGenerator.request_id
}.to_json)
end
- def self.notification_queue
- return @notification_queue if defined?(@notification_queue)
- @config ||= DEFAULT_CONFIG.merge(ConfigFile.load('notification_service').try(:symbolize_keys))
- sqs = AWS::SQS.new(@config)
- @notification_queue = sqs.queues.named(@config[:notification_service_queue_name])
+ class << self
+ private
+
+ def notification_queue
+ return nil if config.blank?
+
+ @notification_queue ||= begin
+ queue_name = config['notification_service_queue_name']
+ sqs = AWS::SQS.new(config)
+ sqs.queues.named(queue_name)
+ end
+ end
+
+ def config
+ ConfigFile.load('notification_service') || {}
+ end
end
end
end
|
Fix nil value loading notification service config
Closes CNVS-27564
Avoids causing a crash when configuration for the notification service
is absent but feature flags are enabled.
Also removes the default config options, meaning that
notification_service_queue_name is now required in the config.
Test plan:
- Remove config/notification_service.yml
- Enable the notification service
- Message delivery should fail silently
- Put in invalid credentials
- It should explode
- Put in correct credentials
- It should work
Change-Id: I68559c17c08f8efdbd9e2bf478ce0b6795f471bf
Reviewed-on: https://gerrit.instructure.com/74621
Tested-by: Jenkins
Reviewed-by: Steven Burnett <a0b450117c5d20a22d5c4d52bb8ae13adee003d8@instructure.com>
Reviewed-by: Christina Wuest <54afda8c1ceb6b42b1ea3027c45a7930c54ff01c@instructure.com>
QA-Review: Gentry Beckmann <f487939f789774cca922ca5b886632de73477ea0@instructure.com>
Product-Review: Gentry Beckmann <f487939f789774cca922ca5b886632de73477ea0@instructure.com>
|
diff --git a/lib/slack-notifier/link_formatter.rb b/lib/slack-notifier/link_formatter.rb
index abc1234..def5678 100644
--- a/lib/slack-notifier/link_formatter.rb
+++ b/lib/slack-notifier/link_formatter.rb
@@ -29,11 +29,10 @@ private
def fix_encoding string
- transcoding_options = {
+ string.encode 'UTF-8',
:invalid => :replace,
- :undef => :replace,
- :replace => '?'}
- string.encode 'UTF-8', transcoding_options
+ :undef => :replace,
+ :replace => "\uFFFD"
end
def slack_link link, text=nil
|
Use unicode replacement character for invalid data
http://en.wikipedia.org/wiki/Specials_(Unicode_block)#Replacement_character
|
diff --git a/app/controllers/blogs_controller.rb b/app/controllers/blogs_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/blogs_controller.rb
+++ b/app/controllers/blogs_controller.rb
@@ -1,7 +1,11 @@ class BlogsController < ApplicationController
before_filter :authenticate_user!
before_filter :get_club, :only => [ :create, :show_all ]
- before_filter :get_blog, :only => [ :edit, :update, :change_image, :upload_image ]
+ before_filter :get_blog, :only => [ :show, :edit, :update, :change_image, :upload_image ]
+
+ def show
+ redirect_to club_sales_page_path(@blog.club) unless user_signed_in? and can?(:read, @blog)
+ end
def create
@blog = @club.blogs.new
|
Add show Action to Blogs Controller
Update the Blogs controller to include the show action.
|
diff --git a/DRYNavigationManager.podspec b/DRYNavigationManager.podspec
index abc1234..def5678 100644
--- a/DRYNavigationManager.podspec
+++ b/DRYNavigationManager.podspec
@@ -8,7 +8,7 @@ s.homepage = "https://github.com/appfoundry/DRYNavigationManager"
s.license = 'MIT'
s.author = { "Michael Seghers" => "michael.seghers@ida-mediafoundry.be", "Bart Vandeweerdt" => "bart.vandeweerdt@ida-mediafoundry.be" }
- s.source = { :git => "git@github.com:appfoundry/DRYNavigationManager.git", :tag => s.version.to_s }
+ s.source = { :git => "https://github.com/appfoundry/DRYNavigationManager.git", :tag => s.version.to_s }
s.social_media_url = 'https://twitter.com/appfoundrybe'
s.platform = :ios, '5.0'
|
Set repo in podspec to https
|
diff --git a/app/presenters/courses_presenter.rb b/app/presenters/courses_presenter.rb
index abc1234..def5678 100644
--- a/app/presenters/courses_presenter.rb
+++ b/app/presenters/courses_presenter.rb
@@ -30,7 +30,8 @@ end
def courses_by_recent_edits
- courses.sort_by(&:recent_edit_count).reverse
+ # Sort first by recent edit count, and then by course title
+ courses.sort_by { |course| [-course.recent_edit_count, course.title] }
end
def word_count
|
Sort courses secondarily by title
|
diff --git a/app/presenters/feature_presenter.rb b/app/presenters/feature_presenter.rb
index abc1234..def5678 100644
--- a/app/presenters/feature_presenter.rb
+++ b/app/presenters/feature_presenter.rb
@@ -2,8 +2,6 @@ include ActiveModel::Conversion
include Rails.application.routes.url_helpers
include PublicDocumentRoutesHelper
- include ActionView::Helpers
- include ActionView::Helpers::AssetTagHelper
def self.model_name
Feature.model_name
|
Remove these as we no longer call image_tag in the presenter
|
diff --git a/nfl_live_update.gemspec b/nfl_live_update.gemspec
index abc1234..def5678 100644
--- a/nfl_live_update.gemspec
+++ b/nfl_live_update.gemspec
@@ -9,9 +9,9 @@ s.version = NFLLiveUpdate::VERSION
s.authors = ["Dave Nguyen"]
s.email = ["Dave.Nguyen@inthenight.net"]
- s.homepage = "TODO"
- s.summary = "TODO: Summary of NFLLiveUpdate."
- s.description = "TODO: Description of NFLLiveUpdate."
+ s.homepage = "https://github.com/davenguyen/nfl_live_update"
+ s.summary = "Get NFL schedules and live scores through official feeds."
+ s.description = "Get NFL schedules and live scores through official feeds."
s.license = "MIT"
s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.md"]
|
Update homepage, summary, and description
|
diff --git a/kicker.gemspec b/kicker.gemspec
index abc1234..def5678 100644
--- a/kicker.gemspec
+++ b/kicker.gemspec
@@ -8,6 +8,7 @@ s.name = "kicker"
s.version = Kicker::VERSION
s.date = Time.new
+ s.license = 'MIT'
s.summary = "A lean, agnostic, flexible file-change watcher."
s.description = "Allows you to fire specific command on file-system change."
|
[gemspec] Add that this is available under the MIT license.
Closes #46.
|
diff --git a/db/migrate/007_non_nullable_timestamps.rb b/db/migrate/007_non_nullable_timestamps.rb
index abc1234..def5678 100644
--- a/db/migrate/007_non_nullable_timestamps.rb
+++ b/db/migrate/007_non_nullable_timestamps.rb
@@ -0,0 +1,8 @@+class NonNullableTimestamps < ActiveRecord::Migration[4.2]
+ def change
+ change_column(:entries, :created_at, :timestamp, null: false, default: -> { 'NOW()' })
+ change_column(:entries, :updated_at, :timestamp, null: false, default: -> { 'NOW()' })
+ change_column(:tracks, :created_at, :timestamp, null: false, default: -> { 'NOW()' })
+ change_column(:tracks, :updated_at, :timestamp, null: false, default: -> { 'NOW()' })
+ end
+end
|
Add migration: Timestamp properties are non-nullable
|
diff --git a/db/migrate/20081217001941_create_items.rb b/db/migrate/20081217001941_create_items.rb
index abc1234..def5678 100644
--- a/db/migrate/20081217001941_create_items.rb
+++ b/db/migrate/20081217001941_create_items.rb
@@ -5,18 +5,13 @@ t.float :price, :default => 0.00
t.boolean :situational, :default => 0
t.boolean :best_in_slot, :default => 0
- t.integer :member_id
- t.integer :raid_id
+ t.references :member
+ t.references :raid
t.timestamps
end
-
- add_index :items, :raid_id
- add_index :items, :member_id
end
def self.down
- remove_index :items, :member_id
- remove_index :items, :raid_id
drop_table :items
end
end
|
Use t.references to associate raids and members to items
|
diff --git a/omniauth-oauth2.gemspec b/omniauth-oauth2.gemspec
index abc1234..def5678 100644
--- a/omniauth-oauth2.gemspec
+++ b/omniauth-oauth2.gemspec
@@ -5,7 +5,7 @@ Gem::Specification.new do |gem|
gem.add_dependency 'faraday', ['>= 0.8', '< 0.10']
gem.add_dependency 'multi_json', '~> 1.3'
- gem.add_dependency 'oauth2', '~> 0.9.0'
+ gem.add_dependency 'oauth2', '~> 0.9.3'
gem.add_dependency 'omniauth', '~> 1.2'
gem.add_development_dependency 'bundler', '~> 1.0'
|
Update oauth2 dependency to ~> 0.9.3
|
diff --git a/lib/domainr.rb b/lib/domainr.rb
index abc1234..def5678 100644
--- a/lib/domainr.rb
+++ b/lib/domainr.rb
@@ -6,7 +6,7 @@
include HTTParty
format :json
- base_uri 'domainr.com'
+ base_uri 'api.domainr.com'
def self.client_id=(id)
@client_id = id
@@ -18,12 +18,12 @@
def search(term)
options = { :q => term, :client_id => client_id }
- Hashie::Mash.new(get('/api/json/search', { :query => options }))
+ Hashie::Mash.new(get('/v1/search', { :query => options }))
end
def info(domain)
options = { :q => domain, :client_id => client_id }
- Hashie::Mash.new(get('/api/json/info', { :query => options }))
+ Hashie::Mash.new(get('/v1/info', { :query => options }))
end
end
|
Update to new v1 API endpoint
|
diff --git a/db/migrations/003_create_orders.rb b/db/migrations/003_create_orders.rb
index abc1234..def5678 100644
--- a/db/migrations/003_create_orders.rb
+++ b/db/migrations/003_create_orders.rb
@@ -0,0 +1,9 @@+# encoding: UTF-8
+
+migration "Create orders" do
+ database.create_table :orders do
+ text :date, :primary_key => true, :uniq => true, :null => false
+ text :restaurant, :null => false, :default => ''
+ text :payer
+ end
+end
|
Create orders table migration added
|
diff --git a/Casks/adobe-air.rb b/Casks/adobe-air.rb
index abc1234..def5678 100644
--- a/Casks/adobe-air.rb
+++ b/Casks/adobe-air.rb
@@ -1,5 +1,5 @@ cask :v1 => 'adobe-air' do
- version '19.0'
+ version '20.0'
sha256 :no_check # required as upstream package is updated in-place
url "http://airdownload.adobe.com/air/mac/download/#{version}/AdobeAIR.dmg"
|
Upgrade Adobe AIR to v20.0
|
diff --git a/lib/blimpy/engine.rb b/lib/blimpy/engine.rb
index abc1234..def5678 100644
--- a/lib/blimpy/engine.rb
+++ b/lib/blimpy/engine.rb
@@ -17,9 +17,13 @@
begin
@fleet = eval(file_content)
+ if @fleet and !(@fleet.instance_of? Blimpy::Fleet)
+ raise Exception, 'File does not create a Fleet'
+ end
rescue Exception => e
raise InvalidBlimpFileError, e.to_s
end
+ @fleet
end
end
end
|
Make sure that our Blimpfile actually creates a Blimpy::Fleet
|
diff --git a/lib/garage/tracer.rb b/lib/garage/tracer.rb
index abc1234..def5678 100644
--- a/lib/garage/tracer.rb
+++ b/lib/garage/tracer.rb
@@ -16,7 +16,7 @@ # Any tracers must have `.start` to start tracing context and:
# - `#inject_trace_context` to add tracing context to the given request header.
# - `#record_http_request` to record http request in tracer.
- # - `#record_http_response` to recrod http response in tracer.
+ # - `#record_http_response` to record http response in tracer.
class NullTracer
def self.start(&block)
yield new
|
docs: Modify typo of Garage::Tracer::NullTracer's docs
|
diff --git a/lib/pluck_to_hash.rb b/lib/pluck_to_hash.rb
index abc1234..def5678 100644
--- a/lib/pluck_to_hash.rb
+++ b/lib/pluck_to_hash.rb
@@ -5,7 +5,7 @@
module ClassMethods
def pluck_to_hash(keys)
- pluck(*keys).map{|row| Hash[*[Array(keys), Array(row)].transpose.flatten]}
+ pluck(*keys).map{|row| Hash[Array(keys).zip(Array(row))]}
end
alias_method :pluck_h, :pluck_to_hash
|
Fix bug when we ask for a single column and nil is one of the returned values
|
diff --git a/test/admin_ui/test_page_title.rb b/test/admin_ui/test_page_title.rb
index abc1234..def5678 100644
--- a/test/admin_ui/test_page_title.rb
+++ b/test/admin_ui/test_page_title.rb
@@ -11,6 +11,7 @@ end
def test_rails_login_page_title
+ FactoryGirl.create(:admin)
visit "/admin/"
assert_text("Admin Sign In")
assert_equal("API Umbrella Admin", page.title)
|
Fix another test ordering issue with admin login changes.
|
diff --git a/lib/mellon.rb b/lib/mellon.rb
index abc1234..def5678 100644
--- a/lib/mellon.rb
+++ b/lib/mellon.rb
@@ -4,6 +4,9 @@
module Mellon
KEYCHAIN_REGEXP = /"(.+)"/
+
+ class Error < StandardError; end
+ class CommandError < Error; end
class << self
def security(*command, &block)
@@ -24,7 +27,7 @@ stderr = "<no output>" if stderr.empty?
error_string << " " << stderr.chomp
- abort "[ERROR] #{error_string}"
+ raise CommandError, "[ERROR] #{error_string}"
end
if block_given?
|
Raise CommandError on command failures instead of aborting
|
diff --git a/app/models/spree/gateway/paymill.rb b/app/models/spree/gateway/paymill.rb
index abc1234..def5678 100644
--- a/app/models/spree/gateway/paymill.rb
+++ b/app/models/spree/gateway/paymill.rb
@@ -5,9 +5,6 @@ preference :private_key, :string
preference :currency, :string, :default => 'GBP'
- attr_accessible :preferred_public_key, :preferred_private_key, :preferred_currency
-
-
def provider_class
ActiveMerchant::Billing::PaymillGateway
end
|
Remove attr_accessible call from Paymill gateway
|
diff --git a/app/proposal_states/tabled_state.rb b/app/proposal_states/tabled_state.rb
index abc1234..def5678 100644
--- a/app/proposal_states/tabled_state.rb
+++ b/app/proposal_states/tabled_state.rb
@@ -1,6 +1,6 @@ class TabledState < BaseState
def is_open_for_comments?
- false
+ true
end
def status_summary
|
Allow comments on tabled proposals
|
diff --git a/lib/boom/color.rb b/lib/boom/color.rb
index abc1234..def5678 100644
--- a/lib/boom/color.rb
+++ b/lib/boom/color.rb
@@ -3,6 +3,8 @@ module Boom
# Color collects some methods for colorizing terminal output.
module Color
+ extend self
+
CODES = {
:reset => "\e[0m",
:magenta => "\e[35m",
|
Extend itself to ease test
|
diff --git a/pivotal-slacker.gemspec b/pivotal-slacker.gemspec
index abc1234..def5678 100644
--- a/pivotal-slacker.gemspec
+++ b/pivotal-slacker.gemspec
@@ -11,6 +11,7 @@ s.add_dependency "actionpack", "3.2.13"
s.add_dependency "launchy"
s.add_dependency "commander"
+ s.add_dependency "active_resource"
s.files = ["lib/formatter.rb", "lib/app_config.rb"]
s.executables << "pivotal-slacker"
s.homepage =
|
Add active_resource as a dependency
Was missing
|
diff --git a/lib/fit-commit.rb b/lib/fit-commit.rb
index abc1234..def5678 100644
--- a/lib/fit-commit.rb
+++ b/lib/fit-commit.rb
@@ -16,6 +16,6 @@ end
def self.branch_name
- `git branch | grep '^\*' | cut -b3-`.strip
+ `git name-rev --name-only HEAD`.strip
end
end
|
Simplify git command to get branch name
|
diff --git a/lib/html_press.rb b/lib/html_press.rb
index abc1234..def5678 100644
--- a/lib/html_press.rb
+++ b/lib/html_press.rb
@@ -9,11 +9,11 @@ options.each_pair do |key, val|
key = key.to_sym
case key
- when :secret_string: HTMLPress::IdentityParser.secret_string = val
- when :benchmark: HTMLPress::Rack.benchmark = val
- when :store: HTMLPress::Runner.store = val
- when :cache_dir: HTMLPress::Store.path = val
- when :compression: HTMLPress::HTMLPress.options = val
+ when :secret_string: ::HTMLPress::IdentityParser.secret_string = val
+ when :benchmark: ::HTMLPress::Rack.benchmark = val
+ when :store: ::HTMLPress::Runner.store = val
+ when :cache_dir: ::HTMLPress::Store.path = val
+ when :compression: ::HTMLPress::HTMLPress.options = val
end
end
end
|
Fix options declaration for plugin usage.
|
diff --git a/serverspec/spec/all/all_configure_spec.rb b/serverspec/spec/all/all_configure_spec.rb
index abc1234..def5678 100644
--- a/serverspec/spec/all/all_configure_spec.rb
+++ b/serverspec/spec/all/all_configure_spec.rb
@@ -1,11 +1,13 @@ require_relative '../spec_helper.rb'
-describe 'connect to each instance through a virtual network' do
- property[:networks].each do |servername, ports|
- next if servername == 'base'
- ports.each do |_port, settings|
- describe host(settings[:virtual_address]) do
- it { should be_reachable }
+if !ENV['role'].include?('vna') && !ENV['role'].include?('vnmgr')
+ describe 'connect to each instance through a virtual network' do
+ property[:networks].each do |servername, ports|
+ next if servername == 'base'
+ ports.each do |_port, settings|
+ describe host(settings[:virtual_address]) do
+ it { should be_reachable }
+ end
end
end
end
|
Modify the not perform vertual network connection test in vna or vnmgr
|
diff --git a/lib/tasks/db.rake b/lib/tasks/db.rake
index abc1234..def5678 100644
--- a/lib/tasks/db.rake
+++ b/lib/tasks/db.rake
@@ -8,7 +8,8 @@ 'sdgs:import',
'ndc_sdg_targets:import',
'historical_emissions:import',
- 'cait_indc:import'
+ 'cait_indc:import',
+ 'adaptation:import'
]
desc 'Imports all data in correct order, replaces all data'
|
Add adaptations import to global import task
|
diff --git a/libPusher.podspec b/libPusher.podspec
index abc1234..def5678 100644
--- a/libPusher.podspec
+++ b/libPusher.podspec
@@ -1,14 +1,22 @@ Pod::Spec.new do |s|
s.name = 'libPusher'
- s.version = '1.4'
+ s.version = '1.5'
s.license = 'MIT'
s.summary = 'An Objective-C client for the Pusher.com service'
s.homepage = 'https://github.com/lukeredpath/libPusher'
s.author = 'Luke Redpath'
- s.source = { :git => 'git://github.com/lukeredpath/libPusher.git', :tag => 'v1.4' }
+ s.source = { :git => 'https://github.com/lukeredpath/libPusher.git', :tag => 'v1.4' }
s.source_files = 'Library/*'
+ s.private_header_files = %w(
+ PTJSON.h
+ PTJSONParser.h
+ NSString+Hashing.h
+ NSDictionary+QueryString.h
+ PTPusherChannel_Private.h
+ )
s.requires_arc = true
s.dependency 'SocketRocket', "0.2"
s.compiler_flags = '-Wno-arc-performSelector-leaks', '-Wno-format'
s.xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => 'kPTPusherClientLibraryVersion=@\"1.5\"' }
+ s.header_dir = 'Pusher'
end
|
Set the header dir and exclude private headers. Bump version.
|
diff --git a/stateoscope.gemspec b/stateoscope.gemspec
index abc1234..def5678 100644
--- a/stateoscope.gemspec
+++ b/stateoscope.gemspec
@@ -9,8 +9,8 @@ spec.authors = ['Patrick Oscity']
spec.email = ['patrick.oscity@gmail.com']
- spec.summary = %q{State Machine Visualizer}
- spec.description = %q{Visualize State Machines using GraphViz}
+ spec.summary = 'State Machine Visualizer'
+ spec.description = 'Visualize State Machines using GraphViz'
spec.homepage = 'https://github.com/padde/stateoscope'
spec.license = 'MIT'
|
Use %q only for strings that contain both single quotes and double quotes
|
diff --git a/app/workers/stash_webhook_pinger.rb b/app/workers/stash_webhook_pinger.rb
index abc1234..def5678 100644
--- a/app/workers/stash_webhook_pinger.rb
+++ b/app/workers/stash_webhook_pinger.rb
@@ -20,7 +20,7 @@ include Sidekiq::Worker
include Rails.application.routes.url_helpers
- sidekiq_options queue: :low
+ sidekiq_options queue: :high, retry: 5
# Executes this worker.
#
|
Move StashWebhookPinger to high queue
Add automatic retries as well. It is critical that this job be run
quickly and reliably otherwise developers are blocked from merging their
PRs.
|
diff --git a/db/migrate/20190724131538_create_trade_plus_static.rb b/db/migrate/20190724131538_create_trade_plus_static.rb
index abc1234..def5678 100644
--- a/db/migrate/20190724131538_create_trade_plus_static.rb
+++ b/db/migrate/20190724131538_create_trade_plus_static.rb
@@ -1,7 +1,6 @@ class CreateTradePlusStatic < ActiveRecord::Migration
def change
create_table :trade_plus_static do |t|
- t.integer :id
t.integer :year
t.string :appendix
t.string :taxon_name
|
Remove extra id column from trade_plus_static migration
|
diff --git a/spec/lib/vimwiki_markdown/options_spec.rb b/spec/lib/vimwiki_markdown/options_spec.rb
index abc1234..def5678 100644
--- a/spec/lib/vimwiki_markdown/options_spec.rb
+++ b/spec/lib/vimwiki_markdown/options_spec.rb
@@ -14,6 +14,25 @@ its(:syntax) { should eq('markdown') }
its(:output_fullpath) { should eq("#{subject.output_dir}#{subject.title.parameterize}.html") }
its(:template_filename) { should eq('~/vimwiki/templates/default.tpl') }
+
+ describe "extension" do
+ it "deals with a different wiki extension correctly" do
+ allow(Options).to receive(:arguments).and_return(
+ ["1", #force - 1/0
+ "markdown",
+ "wiki",
+ "~/vimwiki/site_html/",
+ "~/vimwiki/index.wiki",
+ "~/vimwiki/site_html/style.css",
+ "~/vimwiki/templates/",
+ "default",
+ ".tpl",
+ "-"]
+ )
+
+ expect(Options.new.title).to eq("Index")
+ end
+ end
end
end
end
|
Add basic covering spec for extension
|
diff --git a/spec/services/application_service_spec.rb b/spec/services/application_service_spec.rb
index abc1234..def5678 100644
--- a/spec/services/application_service_spec.rb
+++ b/spec/services/application_service_spec.rb
@@ -11,7 +11,7 @@ end
it "returns the Rails application name if no dmproadmap.rb initializer entry" do
Rails.configuration.x.application.delete(:name)
- expected = Rails.application.class.name.split("::").first.downcase
+ expected = Rails.application.class.name.split("::").first
expect(described_class.application_name).to eql(expected)
end
end
|
Fix Spec related to the previous commit
|
diff --git a/AlamofireImage.podspec b/AlamofireImage.podspec
index abc1234..def5678 100644
--- a/AlamofireImage.podspec
+++ b/AlamofireImage.podspec
@@ -17,5 +17,5 @@ s.osx.deployment_target = '10.9'
s.watchos.deployment_target = '2.0'
- s.dependency 'Alamofire', '2.0.0'
+ s.dependency 'Alamofire', '2.0.1'
end
|
Update podspec to Alamofire 2.0.1
|
diff --git a/app/controllers/admin/sessions_controller.rb b/app/controllers/admin/sessions_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/admin/sessions_controller.rb
+++ b/app/controllers/admin/sessions_controller.rb
@@ -12,7 +12,7 @@ def create
admin = admins_repository.find(email: create_params[:email])
- if admin && admin.correct_password?(admin.id, create_params[:password])
+ if admin && admin.correct_password?(create_params[:password])
create_admin_session(admin)
redirect_to after_login_path(locale)
else
|
Fix correct_password? check in sessions controller
|
diff --git a/app/controllers/api/v1/changes_controller.rb b/app/controllers/api/v1/changes_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/api/v1/changes_controller.rb
+++ b/app/controllers/api/v1/changes_controller.rb
@@ -1,6 +1,10 @@+require 'xa/util/documents'
+
module Api
module V1
class ChangesController < ActionController::Base
+ include XA::Util::Documents
+
# TODO: do this properly
skip_before_filter :verify_authenticity_token
@@ -12,8 +16,10 @@ latest = @invoice.revisions[-1]
previous = @invoice.revisions[-2]
content = {}.tap do |o|
- o[:latest] = latest.document.change.content if latest && latest.document && latest.document.change
- o[:previous] = previous.document.change.content if previous && previous.document && previous.document.change
+ if latest && latest.document && latest.document.change
+ o[:latest] = latest.document.change.content
+ o[:previous] = extract_corresponding(previous.document.content, latest.document.change.content) if previous && previous.document && previous.document.content
+ end
end
end
|
Use extract_corresponding to build previous
|
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.29.0.11'
+ s.version = '0.29.0.12'
s.summary = 'Common primitives for platform-specific messaging implementations for Eventide'
s.description = ' '
|
Package version is increased from 0.29.0.11 to 0.29.0.12
|
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.16.0.0'
+ s.version = '0.16.0.1'
s.summary = 'Common primitives for platform-specific messaging implementations for Eventide'
s.description = ' '
|
Package version is increased from 0.16.0.0 to 0.16.0.1
|
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.7.2.0'
+ s.version = '0.7.2.1'
s.summary = 'Messaging primitives for Eventide'
s.description = ' '
|
Package version is increased from 0.7.2.0 to 0.7.2.1
|
diff --git a/app/workers/schedulers/stale_issue_marker.rb b/app/workers/schedulers/stale_issue_marker.rb
index abc1234..def5678 100644
--- a/app/workers/schedulers/stale_issue_marker.rb
+++ b/app/workers/schedulers/stale_issue_marker.rb
@@ -4,7 +4,7 @@ sidekiq_options :queue => :miq_bot_glacial, :retry => false
include Sidetiq::Schedulable
- recurrence { weekly.day(:saturday) }
+ recurrence { weekly.day(:monday) }
include SidekiqWorkerMixin
|
Change stale issue marker to Mondays
This will activate at midnight (ET) on Sunday night, really.
|
diff --git a/test/lib/typus/i18n_test.rb b/test/lib/typus/i18n_test.rb
index abc1234..def5678 100644
--- a/test/lib/typus/i18n_test.rb
+++ b/test/lib/typus/i18n_test.rb
@@ -5,6 +5,7 @@ test "t" do
assert_equal "Hello", Typus::I18n.t("Hello")
assert_equal "Hello", Typus::I18n.t(".hello", :default => "Hello")
+ assert_equal "Hello @fesplugas", Typus::I18n.t("Hello %{human}!", :human => "@fesplugas")
end
test "default_locale" do
|
Test to verify Typus::I18n.t interpolation.
|
diff --git a/test/models/synonym_test.rb b/test/models/synonym_test.rb
index abc1234..def5678 100644
--- a/test/models/synonym_test.rb
+++ b/test/models/synonym_test.rb
@@ -10,9 +10,7 @@
# Make sure there is at least one missing synonym.
missing_id = names(:macrolepiota_rachodes).synonym_id
- Name.connection.execute(%(
- DELETE FROM synonyms WHERE id = #{missing_id}
- ))
+ Synonym.where(id: missing_id).delete_all
assert_nil(Synonym.safe_find(missing_id))
# Run cronjob to fix these sorts of things and make sure it fixes them.
|
Rewrite single SQL statement in SynonymTest to AR
|
diff --git a/activesupport/lib/active_support/descendants_tracker.rb b/activesupport/lib/active_support/descendants_tracker.rb
index abc1234..def5678 100644
--- a/activesupport/lib/active_support/descendants_tracker.rb
+++ b/activesupport/lib/active_support/descendants_tracker.rb
@@ -1,3 +1,5 @@+require 'active_support/dependencies'
+
module ActiveSupport
# This module provides an internal implementation to track descendants
# which is faster than iterating through ObjectSpace.
@@ -16,16 +18,12 @@ end
def self.clear
- if defined? ActiveSupport::Dependencies
- @@direct_descendants.each do |klass, descendants|
- if ActiveSupport::Dependencies.autoloaded?(klass)
- @@direct_descendants.delete(klass)
- else
- descendants.reject! { |v| ActiveSupport::Dependencies.autoloaded?(v) }
- end
+ @@direct_descendants.each do |klass, descendants|
+ if ActiveSupport::Dependencies.autoloaded?(klass)
+ @@direct_descendants.delete(klass)
+ else
+ descendants.reject! { |v| ActiveSupport::Dependencies.autoloaded?(v) }
end
- else
- @@direct_descendants.clear
end
end
|
Revert "It should be possible to use ActiveSupport::DescendantTracker without getting ActiveSupport::Dependencies for free."
This reverts commit 46f6a2e3889bae420589f429b09722a37dbdf18d.
Caused failures on CI. rake test:isolated on activesupport directory show them.
|
diff --git a/features/support/api_extensions.rb b/features/support/api_extensions.rb
index abc1234..def5678 100644
--- a/features/support/api_extensions.rb
+++ b/features/support/api_extensions.rb
@@ -1,8 +1,8 @@ require 'gds_api/json_client'
-class GdsApi::CoreApi < GdsApi::Base
+class GdsApi::PanopticonApi < GdsApi::Base
def register(details)
- post_json(base_url + ".json", resource: details)
+ put_json(base_url + ".json", artefact: details)
end
private
@@ -11,7 +11,7 @@ end
def base_url
- "#{endpoint}/registrations"
+ "#{endpoint}/artefacts"
end
end
@@ -22,7 +22,7 @@ # flow = flow_registry.flows.first
# presenter = TextPresenter.new(flow)
-# interface = GdsApi::CoreApi.new
+# interface = GdsApi::PanopticonApi.new
# interface.register({
# need_id: flow.need_id,
# slug: flow.name,
|
Update example rake task / API extension
|
diff --git a/NPLumen.podspec b/NPLumen.podspec
index abc1234..def5678 100644
--- a/NPLumen.podspec
+++ b/NPLumen.podspec
@@ -1,38 +1,23 @@-#
-# Be sure to run `pod lib lint NPLumen.podspec' to ensure this is a
-# valid spec and remove all comments before submitting the spec.
-#
-# Any lines starting with a # are optional, but encouraged
-#
-# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
-#
-
Pod::Spec.new do |s|
s.name = "NPLumen"
s.version = "0.1.0"
- s.summary = "A short description of NPLumen."
+ s.summary = "Light source management"
s.description = <<-DESC
- An optional longer description of NPLumen
-
- * Markdown format.
- * Don't worry about the indent, we strip it!
+ NPLumen is an iOS library that allows you to treat
+ UIViews as either light sources or objects which respond
+ to the sources. For example you can have one view cast a
+ relative shadow on other views.
DESC
- s.homepage = "https://github.com/<GITHUB_USERNAME>/NPLumen"
- # s.screenshots = "www.example.com/screenshots_1", "www.example.com/screenshots_2"
+ s.homepage = "https://github.com/nebspetrovic/NPLumen"
s.license = 'MIT'
s.author = { "Nebojsa Petrovic" => "nebspetrovic@gmail.com" }
- s.source = { :git => "https://github.com/<GITHUB_USERNAME>/NPLumen.git", :tag => s.version.to_s }
- # s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'
-
- s.platform = :ios, '7.0'
+ s.source = { :git => "https://github.com/nebspetrovic/NPLumen.git", :tag => s.version.to_s }
+ s.social_media_url = 'https://twitter.com/nebsp'
+ s.platform = :ios, '8.0'
s.requires_arc = true
-
- s.source_files = 'Pod/Classes/**/*'
+ s.source_files = 'Pod/Classes/**/*.{h,m}'
s.resource_bundles = {
- 'NPLumen' => ['Pod/Assets/*.png']
+ 'NPCricket' => ['Pod/Classes/**/*.xib']
}
-
- # s.public_header_files = 'Pod/Classes/**/*.h'
- # s.frameworks = 'UIKit', 'MapKit'
- # s.dependency 'AFNetworking', '~> 2.3'
+ s.public_header_files = 'Pod/Classes/**/*.h'
end
|
Update podspec with real data
|
diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/pages_controller.rb
+++ b/app/controllers/pages_controller.rb
@@ -1,2 +1,53 @@ class PagesController < ApplicationController
+ include IndexHelper
+ def index
+ your_values = current_user ? UserValue.values_of_user(current_user.id) : nil
+ render 'show', locals: {your_values: your_values}
+ end
+
+ def login
+ user = User.find_by(email: params[:user][:email])
+ if user && user.authenticate(params[:user][:password])
+ session[:user_id] = user.id
+ your_values = UserValue.values_of_user(current_user.id)
+ redirect_to '/', locals: {your_values: your_values}
+ else
+ session[:error] = "Invalid Login Information"
+ render 'show'
+ end
+ end
+
+ def profile
+ current_user.update(bio: params[:newbio])
+ render nothing: true
+ end
+
+
+ def register
+ render partial: 'register'
+ end
+
+ def login_box
+ render partial: 'logedout'
+ end
+
+ def logout
+ session[:user_id] = nil
+ redirect_to '/'
+ end
+
+ def new_register
+ user = User.create(user_params)
+ user.update(bio: "Edit bio...")
+ session[:user_id] = user.id
+ redirect_to '/'
+ end
+
+
+private
+ def user_params
+ params.require(:user).permit(:first_name, :last_name, :email, :password, :salt, :encrypted_password)
+ end
+
+
end
|
Add current user logic to pages controller.
|
diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/posts_controller.rb
+++ b/app/controllers/posts_controller.rb
@@ -1,5 +1,5 @@ class PostsController < ApplicationController
- before_action :set_post, only: [:show, :edit, :update, :destroy]
+ before_action :set_post, only: [:show]
# GET /posts
# GET /posts.json
@@ -12,63 +12,13 @@ def show
end
- # GET /posts/new
- def new
- @post = Post.new
- end
-
- # GET /posts/1/edit
- def edit
- end
-
- # POST /posts
- # POST /posts.json
- def create
- @post = Post.new(post_params)
-
- respond_to do |format|
- if @post.save
- format.html { redirect_to @post, notice: 'Post was successfully created.' }
- format.json { render action: 'show', status: :created, location: @post }
- else
- format.html { render action: 'new' }
- format.json { render json: @post.errors, status: :unprocessable_entity }
- end
- end
- end
-
- # PATCH/PUT /posts/1
- # PATCH/PUT /posts/1.json
- def update
- respond_to do |format|
- if @post.update(post_params)
- format.html { redirect_to @post, notice: 'Post was successfully updated.' }
- format.json { head :no_content }
- else
- format.html { render action: 'edit' }
- format.json { render json: @post.errors, status: :unprocessable_entity }
- end
- end
- end
-
- # DELETE /posts/1
- # DELETE /posts/1.json
- def destroy
- @post.destroy
- respond_to do |format|
- format.html { redirect_to posts_url }
- format.json { head :no_content }
- end
- end
-
private
# Use callbacks to share common setup or constraints between actions.
def set_post
- @post = Post.find(params[:id])
- end
-
- # Never trust parameters from the scary internet, only allow the white list through.
- def post_params
- params.require(:post).permit(:title, :body)
+ begin
+ @post = Post.friendly.find(params[:id])
+ rescue
+ @post = Post.find(params[:id])
+ end
end
end
|
Fix to use slug to find posts. Remove unused routes.
|
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -6,4 +6,24 @@ @questions_asked = @user.questions.page(params[:page]).per(3)
@questions_answered = Question.includes({:answers => :user}).where(:answers => {:user_id => @user.id}).page(params[:page]).per(3)
end
-end+
+ def edit
+ @user = current_user
+ end
+
+ def update
+ @user = current_user
+
+ if @user.update_with_password(user_params)
+ redirect_to @user
+ else
+ render :action => "edit"
+ end
+ end
+
+ private
+
+ def user_params
+ params.require(:user).permit(:username, :current_password, :password, :password_confirmation, :email)
+ end
+end
|
Add edit and update actions
|
diff --git a/app/presenters/request_presenter.rb b/app/presenters/request_presenter.rb
index abc1234..def5678 100644
--- a/app/presenters/request_presenter.rb
+++ b/app/presenters/request_presenter.rb
@@ -1,6 +1,6 @@ class RequestPresenter < SimpleDelegator
def can_vote?(u)
- self.user.id != u.id && !self.user.voted_on?(self)
+ self.user.id != u.id && !self.user.voted_on?(__getobj__)
end
def liked_by user
|
Use delegated object instead of self when checking vote permissions
|
diff --git a/Formula/bartycrouch.rb b/Formula/bartycrouch.rb
index abc1234..def5678 100644
--- a/Formula/bartycrouch.rb
+++ b/Formula/bartycrouch.rb
@@ -1,7 +1,7 @@ class Bartycrouch < Formula
desc "Incrementally update/translate your Strings files"
homepage "https://github.com/Flinesoft/BartyCrouch"
- url "https://github.com/Flinesoft/BartyCrouch.git", :tag => "4.0.1", :revision => "b7e940a6383c9d1f013288081dcc2a395c68448b"
+ url "https://github.com/Flinesoft/BartyCrouch.git", :tag => "4.0.2", :revision => "7d4cfec9530c7364727a4461712b54909f8d4a90"
head "https://github.com/Flinesoft/BartyCrouch.git"
depends_on :xcode => ["10.2", :build]
|
Update Homebrew formula to version 4.0.2
|
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,6 +12,12 @@ class ActiveSupport::TestCase
self.test_order = :random
+ DATABASE_CONFIG_PATH = ::File.dirname(__FILE__) << '/database.yml'
+
+ class SpatialModel < ::ActiveRecord::Base
+ establish_connection ::YAML.load_file(DATABASE_CONFIG_PATH)
+ end
+
def factory
::RGeo::Cartesian.preferred_factory(srid: 3785)
end
|
Add a test SpatialModel class
* With default database config
|
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
@@ -23,3 +23,7 @@
MiniTest::Reporters.use!(MiniTest::Reporters::SpecReporter.new)
+puts "Webhookr #{Webhookr::VERSION}"
+puts "Rails #{Rails::VERSION::STRING}"
+puts "Ruby #{RUBY_VERSION}-p#{RUBY_PATCHLEVEL} - #{RbConfig::CONFIG['RUBY_INSTALL_NAME']}"
+
|
Add version information to test output.
|
diff --git a/app/admin/delivery_update.rb b/app/admin/delivery_update.rb
index abc1234..def5678 100644
--- a/app/admin/delivery_update.rb
+++ b/app/admin/delivery_update.rb
@@ -6,6 +6,14 @@ menu parent: "Delivery updates"
filter :study
+ filter(
+ :study_study_stage,
+ as: :select,
+ collection: Study::STUDY_STAGE_OPTIONS.dup.except("Archived"),
+ label: "Study Stage")
+ filter :data_collection_status
+ filter :data_analysis_status
+ filter :interpretation_and_write_up_status
filter :user
filter :created
|
Add filters to delivery updates for study stage and update statuses
|
diff --git a/test/test_reader.rb b/test/test_reader.rb
index abc1234..def5678 100644
--- a/test/test_reader.rb
+++ b/test/test_reader.rb
@@ -0,0 +1,48 @@+require 'minitest/autorun'
+require 'minitest/pride'
+require_relative '../reader.rb'
+
+describe Feed do
+ let(:feed) { Feed.new('bbc_rss_feed.xml') }
+
+ it 'should load all info sections' do
+ feed.info.keys.count.must_equal(10) # All INFO_PARTS + humantime
+ end
+
+ it 'should load info text items correctly' do
+ feed.info[:title].must_equal 'BBC News - Home'
+ feed.info[:link].must_equal 'http://www.bbc.co.uk/news/#sa-ns_mchannel=rss&ns_source=PublicRSS20-sa'
+ feed.info[:copyright].must_equal 'Copyright: (C) British Broadcasting Corporation, see http://news.bbc.co.uk/2/hi/help/rss/4498287.stm for terms and conditions of reuse.'
+ feed.info[:description].must_equal 'The latest stories from the Home section of the BBC News web site.'
+ feed.info[:timestamp].must_equal 'Thu, 26 Nov 2015 18:44:21 GMT'
+ end
+
+ it 'should load image-related info items correctly' do
+ feed.info[:image_url].must_equal 'http://news.bbcimg.co.uk/nol/shared/img/bbc_news_120x60.gif'
+ feed.info[:image_caption].must_equal 'BBC News - Home'
+ feed.info[:image_width].must_equal '120'
+ feed.info[:image_height].must_equal '60'
+ end
+
+ it 'should load 56 items' do
+ feed.items.count.must_equal 56
+ end
+
+ it 'should load a full set of parts from a comnplete item' do
+ feed.items[0].keys.count.must_equal(6) # All ITEM_PARTS + humantime
+ end
+
+ it 'should be able to skip parts from an incomnplete item' do
+ feed.items[1].keys.count.must_equal(5) # No Image
+ end
+
+ it 'should load all the sections in each item' do
+ full_item = feed.items[0]
+
+ full_item[:title].must_equal "Corbyn 'cannot support air strikes'"
+ full_item[:description].must_equal 'Labour leader Jeremy Corbyn writes to his MPs saying he cannot back UK air strikes in Syria - prompting a warning of shadow cabinet resignations.'
+ full_item[:link].must_equal 'http://www.bbc.co.uk/news/uk-politics-34939109#sa-ns_mchannel=rss&ns_source=PublicRSS20-sa'
+ full_item[:timestamp].must_equal 'Thu, 26 Nov 2015 18:41:16 GMT'
+ full_item[:image_url].must_equal 'http://c.files.bbci.co.uk/BA53/production/_86899674_breaking_image_large-3.png'
+ end
+end
|
Add test for Feed reader
Add tests for Feed reader to ensure that the re-factoring doesn't break it.
|
diff --git a/adamantium.gemspec b/adamantium.gemspec
index abc1234..def5678 100644
--- a/adamantium.gemspec
+++ b/adamantium.gemspec
@@ -13,7 +13,7 @@
gem.require_paths = %w[lib]
gem.files = `git ls-files`.split($/)
- gem.test_files = `git ls-files -- {spec}/*`.split($/)
+ gem.test_files = `git ls-files spec/{unit,integration}`.split($/)
gem.extra_rdoc_files = %w[LICENSE README.md TODO]
gem.add_runtime_dependency('backports', '~> 2.6.1')
|
Fix test files in gemspec
|
diff --git a/SwiftyZeroMQ.podspec b/SwiftyZeroMQ.podspec
index abc1234..def5678 100644
--- a/SwiftyZeroMQ.podspec
+++ b/SwiftyZeroMQ.podspec
@@ -19,8 +19,9 @@ :tag => "#{s.version}"
}
s.ios.deployment_target = "9.0"
+ s.macos.deployment_target = "10.11"
+ s.tvos.deployment_target = "9.0"
s.watchos.deployment_target = "2.0"
- s.tvos.deployment_target = "9.0"
s.libraries = "stdc++"
s.source_files = "Sources/*.{h,swift}"
s.vendored_libraries = "Sources/libzmq.a"
|
Add MacOS target to cocoapod
|
diff --git a/test/common_test.rb b/test/common_test.rb
index abc1234..def5678 100644
--- a/test/common_test.rb
+++ b/test/common_test.rb
@@ -0,0 +1,33 @@+require 'minitest/autorun'
+require 'shoulda'
+require 'pp'
+
+require 'flappi'
+
+class ::Flappi::ResponseBuilderTest < MiniTest::Test
+
+ context 'extract_definition_args' do
+ setup do
+ @common_test = Object.new
+ @common_test.extend(Flappi::Common)
+ end
+
+ should 'extract a single name from an array' do
+ assert_equal({'name' => :a}, @common_test.extract_definition_args([:a]))
+ end
+
+ should 'extract a single name from a scalar' do
+ assert_equal({'name' => :a}, @common_test.extract_definition_args(:a))
+ end
+
+ should 'extract a name and value' do
+ assert_equal({'name' => :a, 'value' => 101}, @common_test.extract_definition_args([:a, 101]))
+ end
+
+ should 'pass through a hash' do
+ assert_equal({'name' => :a, 'value' => 101}, @common_test.extract_definition_args({name: :a, value: 101}))
+ end
+
+ end
+
+end
|
Add a test of common
|
diff --git a/spec/matcher_spec.rb b/spec/matcher_spec.rb
index abc1234..def5678 100644
--- a/spec/matcher_spec.rb
+++ b/spec/matcher_spec.rb
@@ -0,0 +1,35 @@+require 'spec_helper'
+
+describe Winnow::Matcher do
+ describe '#find_matches' do
+ fprint1 = [
+ Winnow::Fingerprint.new(0, Winnow::Location.new(0, 0)),
+ Winnow::Fingerprint.new(1, Winnow::Location.new(1, 1)),
+ Winnow::Fingerprint.new(1, Winnow::Location.new(2, 2))
+ ]
+
+ fprint2 = [
+ Winnow::Fingerprint.new(0, Winnow::Location.new(3, 3)),
+ Winnow::Fingerprint.new(1, Winnow::Location.new(4, 4)),
+ Winnow::Fingerprint.new(3, Winnow::Location.new(5, 5))
+ ]
+
+ matches = Winnow::Matcher.find_matches(fprint1, fprint2)
+
+ it 'returns an array of match data' do
+ expect(matches.first).to be_a(Winnow::MatchDatum)
+ end
+
+ it 'reports a match when values are equal' do
+ match = matches.find do |match|
+ match.matches_from_a.first.value == 0
+ end
+
+ matchloc_a = match.matches_from_a.first.location
+ matchloc_b = match.matches_from_b.first.location
+
+ expect(matchloc_a.line).to eq 0
+ expect(matchloc_b.line).to eq 3
+ end
+ end
+end
|
Add some tests for the two-file matcher.
|
diff --git a/Casks/intellij-idea-ce-eap.rb b/Casks/intellij-idea-ce-eap.rb
index abc1234..def5678 100644
--- a/Casks/intellij-idea-ce-eap.rb
+++ b/Casks/intellij-idea-ce-eap.rb
@@ -1,6 +1,6 @@ cask 'intellij-idea-ce-eap' do
- version '144.2925.2'
- sha256 '2dacc14f5c1854ba830205624c56c32f53ba6dc200b02e0dddf04133fed1af2c'
+ version '144.3143.6'
+ sha256 '34f7051dbfbf4373b741ea9909022d8e9a8c8dc2bf43ec749c6ae97618fe5e6b'
url "https://download.jetbrains.com/idea/ideaIC-#{version}.dmg"
name 'IntelliJ IDEA EAP :: CE'
|
Upgrade IntelliJ IDEA CE EAP to v144.3143.6
|
diff --git a/Casks/mplayer-osx-extended.rb b/Casks/mplayer-osx-extended.rb
index abc1234..def5678 100644
--- a/Casks/mplayer-osx-extended.rb
+++ b/Casks/mplayer-osx-extended.rb
@@ -1,8 +1,8 @@ class MplayerOsxExtended < Cask
- version 'rev15-test3'
- sha256 '1543feec27fcc911e35b20a51a00957145f35b1b970b0cb35004c86727e4a8fe'
+ version 'rev15'
+ sha256 '7979f2369730d389ceb4ec3082c65ffa3ec70f812f0699a2ef8acbae958a5c93'
- url 'https://mplayerosxext.googlecode.com/files/MPlayer-OSX-Extended_rev15-test3.zip'
+ url "https://github.com/sttz/MPlayer-OSX-Extended/releases/download/#{version}/MPlayer-OSX-Extended_#{version}.zip"
appcast 'http://mplayerosx.ch/updates.xml'
homepage 'http://www.mplayerosx.ch/'
|
Update MPlayer OSX Extended to rev15
|
diff --git a/periscope.gemspec b/periscope.gemspec
index abc1234..def5678 100644
--- a/periscope.gemspec
+++ b/periscope.gemspec
@@ -22,4 +22,5 @@ s.add_dependency 'activesupport', '~> 3.0.0'
s.add_development_dependency 'rspec'
+ s.add_development_dependency 'activerecord', '>= 3.0.0'
end
|
Add the activerecord 3 development dependency.
|
diff --git a/api_sketch.gemspec b/api_sketch.gemspec
index abc1234..def5678 100644
--- a/api_sketch.gemspec
+++ b/api_sketch.gemspec
@@ -1,8 +1,5 @@ # coding: utf-8
-# lib = File.expand_path('../lib', __FILE__)
-# $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require File.expand_path('../lib/api_sketch/version', __FILE__)
-#require 'api_sketch/version'
Gem::Specification.new do |spec|
spec.name = "api_sketch"
@@ -12,7 +9,7 @@ spec.summary = %q{API Prototyping and API Documentation Tool}
spec.description = %q{Gem provides DSL for API documentation generation and API request examples server}
- spec.homepage = "" # TODO. Add github homepage link. Deploy to github
+ spec.homepage = "https://github.com/suhovius/api_sketch"
spec.license = "MIT"
spec.post_install_message = "Thanks for installing!"
|
Add github homepage link at gemspec
|
diff --git a/db/migrate/20120920213816_remove_products.rb b/db/migrate/20120920213816_remove_products.rb
index abc1234..def5678 100644
--- a/db/migrate/20120920213816_remove_products.rb
+++ b/db/migrate/20120920213816_remove_products.rb
@@ -5,5 +5,27 @@ end
def down
+ create_table "ordered_products", :force => true do |t|
+ t.integer "attendee_id"
+ t.integer "product_type_id"
+ t.integer "amount"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ create_table "product_types", :force => true do |t|
+ t.string "type"
+ t.integer "attendee_registration_id"
+ t.string "name"
+ t.decimal "price", :precision => 7, :scale => 2
+ t.decimal "vat", :precision => 4, :scale => 2
+ t.integer "includes_vat"
+ t.date "available_until"
+ t.integer "amount_available"
+ t.integer "needs_invoice_address"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.string "currency"
+ end
end
end
|
Migrate remove_products: no down defined
|
diff --git a/mogli.gemspec b/mogli.gemspec
index abc1234..def5678 100644
--- a/mogli.gemspec
+++ b/mogli.gemspec
@@ -1,15 +1,15 @@ spec = Gem::Specification.new do |s|
s.name = 'mogli'
s.version = '0.0.28'
- s.summary = "Open Graph Library for Ruby"
- s.description = %{Simple library for accessing the facebook Open Graph API}
+ s.summary = 'Open Graph Library for Ruby'
+ s.description = 'Simple library for accessing the Facebook Open Graph API'
s.files = Dir['lib/**/*.rb']
s.require_path = 'lib'
s.has_rdoc = false
- s.author = "Mike Mangino"
- s.email = "mmangino@elevatedrails.com"
- s.homepage = "http://developers.facebook.com/docs/api"
- s.add_dependency('httparty', ">=0.4.3")
- s.add_dependency('hashie', "~> 1.1.0")
- s.add_development_dependency "rspec"
+ s.author = 'Mike Mangino'
+ s.email = 'mmangino@elevatedrails.com'
+ s.homepage = 'http://developers.facebook.com/docs/api'
+ s.add_dependency 'httparty', '>= 0.4.3'
+ s.add_dependency 'hashie', '~> 1.1.0'
+ s.add_development_dependency 'rspec'
end
|
Make quotes, parentheses, and spacing more consistent
|
diff --git a/app/models/post.rb b/app/models/post.rb
index abc1234..def5678 100644
--- a/app/models/post.rb
+++ b/app/models/post.rb
@@ -1,4 +1,6 @@ class Post < ActiveRecord::Base
+
+ validates :title, :body, :user_id, presence: true
belongs_to :user
|
Add validations to Post model
|
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
@@ -1,6 +1,6 @@ class User < ActiveRecord::Base
validates :email, presence: true, uniqueness: true, format: /@/
- has_many :actions
- has_many :activities
+ has_many :actions, dependent: :destroy
+ has_many :activities, dependent: :destroy
end
|
Destroy dependent items upon deletion.
|
diff --git a/lib/dough/helpers/inset_block.rb b/lib/dough/helpers/inset_block.rb
index abc1234..def5678 100644
--- a/lib/dough/helpers/inset_block.rb
+++ b/lib/dough/helpers/inset_block.rb
@@ -13,6 +13,8 @@ renderer.render lookup_context, partial: 'inset_block', locals: { text: text }
end
+ private
+
def renderer
ActionView::Renderer.new(lookup_context)
end
|
Revert "Revert "make methods private""
This reverts commit 0932d09b42e8b04ea9accaf1323b21ba7aa0385a.
|
diff --git a/app/store_image.rb b/app/store_image.rb
index abc1234..def5678 100644
--- a/app/store_image.rb
+++ b/app/store_image.rb
@@ -10,7 +10,7 @@ end
def store!
- s3_object.put(body: image_binary_data)
+ s3_object.put(body: image_binary_data, content_type: 'image/jpeg'.freeze)
s3_object.public_url
end
|
Set file's content-type to image/jpeg
Files on s3 are missing a content type. We have to set it on upload.
|
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
@@ -1,5 +1,22 @@ require 'shoulda'
+require 'ffi'
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
+
+# Since the tests will call Gtk+ functions, Gtk+ must be initialized.
+module DummyGtk
+ module Lib
+ extend FFI::Library
+
+ ffi_lib "gtk-x11-2.0"
+ attach_function :gtk_init, [:pointer, :pointer], :void
+ end
+
+ def self.init
+ Lib.gtk_init nil, nil
+ end
+end
+
+DummyGtk.init
# Need a dummy module for some tests.
module Lib
|
Initialize Gtk at test start.
|
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
@@ -1,11 +1,5 @@-# Trying is knowing
-if ENV["CODECLIMATE_REPO_TOKEN"]
- require "codeclimate-test-reporter"
- CodeClimate::TestReporter.start
-else
- require "simplecov"
- SimpleCov.start
-end
+require "simplecov"
+SimpleCov.start
require "test/unit"
require "mocha/test_unit"
|
Fix SimpleCov runner for Travis
|
diff --git a/lib/react/jsx/jsx_transformer.rb b/lib/react/jsx/jsx_transformer.rb
index abc1234..def5678 100644
--- a/lib/react/jsx/jsx_transformer.rb
+++ b/lib/react/jsx/jsx_transformer.rb
@@ -24,7 +24,7 @@ end
# search for transformer file using sprockets - allows user to override
- # this file in his own application
+ # this file in their own application
def jsx_transform_code
::Rails.application.assets[@asset_path].to_s
end
|
:memo: Remove male pronoun in comment
[ci skip]
|
diff --git a/lib/gimei.rb b/lib/gimei.rb
index abc1234..def5678 100644
--- a/lib/gimei.rb
+++ b/lib/gimei.rb
@@ -31,6 +31,18 @@ def address
Address.new
end
+
+ def config
+ @_config ||= Config.new
+ end
+ end
+
+ class Config
+ attr_accessor :rng
+
+ def initialize
+ @rng = Random.new
+ end
end
def initialize(gender = nil)
|
Add Gimei::Config for fixed RNG
|
diff --git a/lib/pload.rb b/lib/pload.rb
index abc1234..def5678 100644
--- a/lib/pload.rb
+++ b/lib/pload.rb
@@ -57,15 +57,13 @@
module Association
def reader(pload: true)
- if pload && owner.pload? && !loaded?
+ return super() unless pload && owner.pload?
+
+ unless loaded?
raise Pload::AssociationNotLoadedError.new(owner, reflection)
end
- if pload && owner.pload?
- super().pload
- else
- super()
- end
+ super().pload
end
end
end
|
Make it a little less ugly
|
diff --git a/lib/worms.rb b/lib/worms.rb
index abc1234..def5678 100644
--- a/lib/worms.rb
+++ b/lib/worms.rb
@@ -3,7 +3,7 @@ require 'rmagick'
require 'execjs'
-WIDTH, HEIGHT = 600, 600
+WIDTH, HEIGHT = 768, 600
NULL_PIXEL = Magick::Pixel.from_color('none')
|
Update the WIDTH size of window
|
diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb
index abc1234..def5678 100644
--- a/config/initializers/secret_token.rb
+++ b/config/initializers/secret_token.rb
@@ -9,4 +9,5 @@
# Make sure your secret_key_base is kept private
# if you're sharing your code publicly.
-Shreds::Application.config.secret_key_base = 'fc18f5027cd52f8c25bc1843b21cb49099be7214d0fdaf305f36e159ce0f329ba360611a5cc25bc839eec8f1cf7003d5afdb54b73f2d14fe530d6a97ca4a87f9'
+fail 'No Secret key Defined.' unless ENV['SECRET']
+Shreds::Application.config.secret_key_base = ENV['SECRET']
|
Set back secret from env
|
diff --git a/statsd-ruby.gemspec b/statsd-ruby.gemspec
index abc1234..def5678 100644
--- a/statsd-ruby.gemspec
+++ b/statsd-ruby.gemspec
@@ -17,9 +17,9 @@ s.test_files = s.files.grep(%r{^(test|spec|features)/})
end
- s.add_development_dependency "minitest"
+ s.add_development_dependency "minitest", ">= 3.2.0"
s.add_development_dependency "yard"
- s.add_development_dependency "simplecov"
+ s.add_development_dependency "simplecov", ">= 0.6.4"
s.add_development_dependency "rake"
end
|
Add specific versions for minitest and simplecov
* Should fix false failures on CI
|
diff --git a/app/controllers/activities_controller.rb b/app/controllers/activities_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/activities_controller.rb
+++ b/app/controllers/activities_controller.rb
@@ -15,6 +15,7 @@ end
# Educated guessing of person
+ @activity.person ||= Person.find(params[:person_id]) if params[:person_id]
@activity.person ||= current_user.person if current_user
# Educated guessing of project
|
Use person from parent resource if available in new activity action.
|
diff --git a/tinyembedly.gemspec b/tinyembedly.gemspec
index abc1234..def5678 100644
--- a/tinyembedly.gemspec
+++ b/tinyembedly.gemspec
@@ -7,7 +7,7 @@ s.version = Tinyembedly::VERSION
s.authors = ["Andrew Donaldson"]
s.email = ["andrew@desto.net"]
- s.homepage = "https://github.com/dies-el/tinyembedly"
+ s.homepage = "https://github.com/adonaldson/tinyembedly"
s.summary = %q{Fetch Embedly oEmbed data}
s.description = %q{A super tiny Embedly oEmbed library, using HTTParty}
|
Fix broken url in gemspec
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.