diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/test/respond_to_missing_test.rb b/test/respond_to_missing_test.rb
index abc1234..def5678 100644
--- a/test/respond_to_missing_test.rb
+++ b/test/respond_to_missing_test.rb
@@ -14,7 +14,7 @@ end
def test_should_respond_to_respond_to_missing
- assert respond_to?(:respond_to_missing?)
+ assert Object.new.respond_to?(:respond_to_missing?)
end
def test_should_pass_failing_respond_to_calls_to_respond_to_missing
|
Test that Object responds to respond_to_missing? instead of Test::Unit::TestCase
|
diff --git a/lib/em-imap/response_parser.rb b/lib/em-imap/response_parser.rb
index abc1234..def5678 100644
--- a/lib/em-imap/response_parser.rb
+++ b/lib/em-imap/response_parser.rb
@@ -11,7 +11,7 @@
# This is a translation of Net::IMAP#get_response
def receive_data(data)
- @buffer += data
+ @buffer << data
until @buffer.empty?
|
Improve string memory management when receiving data.
|
diff --git a/config/application.rb b/config/application.rb
index abc1234..def5678 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -6,6 +6,7 @@ require "action_mailer/railtie"
require "sprockets/railtie"
# require "rails/test_unit/railtie"
+require "action_cable/engine"
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
|
Add missing require for action cable
|
diff --git a/lib/game_icons/tasks/update.rb b/lib/game_icons/tasks/update.rb
index abc1234..def5678 100644
--- a/lib/game_icons/tasks/update.rb
+++ b/lib/game_icons/tasks/update.rb
@@ -1,11 +1,11 @@+require 'fileutils'
require 'game_icons'
require 'open-uri'
require 'zip'
-require 'fileutils'
module GameIcons
class Update
- @@URL = 'http://game-icons.net/archives/svg/zip/ffffff/000000/game-icons.net.svg.zip'
+ @@URL = 'https://game-icons.net/archives/svg/zip/ffffff/000000/game-icons.net.svg.zip'
@@TMP_ZIP = 'game-icons.net.svg.zip'
def self.run
@@ -27,7 +27,7 @@
def self.download
File.open("resources/#{@@TMP_ZIP}", 'wb+') do |save_file|
- open(@@URL, 'rb') { |read_file| save_file.write(read_file.read) }
+ URI.open(@@URL, 'rb') { |read_file| save_file.write(read_file.read) }
end
end
|
Update deprecated calls for Ruby 3.0
|
diff --git a/spec/models/vote_spec.rb b/spec/models/vote_spec.rb
index abc1234..def5678 100644
--- a/spec/models/vote_spec.rb
+++ b/spec/models/vote_spec.rb
@@ -0,0 +1,17 @@+require 'spec_helper'
+
+describe Vote do
+ describe "New Votes" do
+ it "should create new valid votes" do
+ user = create(:user)
+ idea = create(:idea)
+ vote = create(:vote, idea_id: idea.id, user_id: user.id)
+
+ puts user.inspect
+ puts idea.inspect
+ puts vote.inspect
+
+ expect(vote).to be_valid
+ end
+ end
+end
|
Create a failing test for Vote model
Votes go against the pattern and don't use the 'id' field as the
primary key by default. Votes require a composite primary key, but
without the 'composite_primary_key' gem and the attributes specified
in the Vote model, testing produced
'undefined method `to_sym' for nil:NilClass'
errors when trying to validate the test vote records. With the gem
added, test now run into
TypeError:
Cannot visit Idea
when executing
'vote = create(:vote, idea_id: idea.id, user_id: user.id)'
|
diff --git a/api/app/views/spree/api/images/show.v1.rabl b/api/app/views/spree/api/images/show.v1.rabl
index abc1234..def5678 100644
--- a/api/app/views/spree/api/images/show.v1.rabl
+++ b/api/app/views/spree/api/images/show.v1.rabl
@@ -1,3 +1,4 @@ object @image
attributes *image_attributes
attributes :viewable_type, :viewable_id
+node(:attachment_url) { |i| i.attachment.to_s }
|
[api] Return relative attachment url for product images
|
diff --git a/app/models/process_log.rb b/app/models/process_log.rb
index abc1234..def5678 100644
--- a/app/models/process_log.rb
+++ b/app/models/process_log.rb
@@ -7,7 +7,6 @@ #
#------------------------------------------------------------------------------
class ProcessLog
- include Rails.application.routes.url_helpers # Known violation of MVC. Do not change willy-nilly
attr_reader :process_log
|
Revert "Give Process Log access to the url_helpers so it can create direct links. Known and intended violation of MVC"
The url_helpers need to live in the caller, not the process log.
This reverts commit 963aa4d10e52f3606495c1a1044d9864971121a0.
|
diff --git a/lib/kosmos/packages/toolbar.rb b/lib/kosmos/packages/toolbar.rb
index abc1234..def5678 100644
--- a/lib/kosmos/packages/toolbar.rb
+++ b/lib/kosmos/packages/toolbar.rb
@@ -0,0 +1,9 @@+class Toolbar < Kosmos::Package
+ title 'Toolbar Plugin'
+ aliases 'toolbar'
+ url 'http://blizzy.de/toolbar/Toolbar-1.7.1.zip'
+
+ def install
+ merge_directory 'Toolbar-1.7.1/GameData'
+ end
+end
|
Add a package for the Toolbar API Plugin.
|
diff --git a/spree_html_email.gemspec b/spree_html_email.gemspec
index abc1234..def5678 100644
--- a/spree_html_email.gemspec
+++ b/spree_html_email.gemspec
@@ -17,7 +17,7 @@ s.requirements << 'none'
s.add_dependency 'spree_core', '~> 2'
- s.add_dependency 'premailer-rails3', '~> 1'
+ s.add_dependency 'premailer-rails', '~> 1'
s.add_development_dependency 'rspec-rails'
end
|
Use a not deprecated github repo for premailer-rails
|
diff --git a/app/controllers/substitutions_controller.rb b/app/controllers/substitutions_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/substitutions_controller.rb
+++ b/app/controllers/substitutions_controller.rb
@@ -3,11 +3,6 @@ include CrudActions
def index
- @substitutions = Substitution.active
- end
-
- def index
-
params[:substitution] ||= {}
params[:substitution][:inactive] = '0' if params[:substitution][:inactive].nil?
@@ -16,18 +11,16 @@ # provide a prototype for the filter form
@substitution = Substitution.new(substitution_params)
respond_with @substitutions
-
end
-
def new
@substitution = Substitution.new()
- if params[:mentor_id]
- @substitution.mentor = Mentor.find(params[:mentor_id])
+ if params[:mentor_id]
+ @substitution.mentor = Mentor.find(params[:mentor_id])
@substitution.kid = @substitution.mentor.kids.first
end
- end
+ end
def inactivate
@substitution.inactive = true
|
Remove overwritten definition of index
Also clean up indentation
|
diff --git a/app/models/visualization/external_source.rb b/app/models/visualization/external_source.rb
index abc1234..def5678 100644
--- a/app/models/visualization/external_source.rb
+++ b/app/models/visualization/external_source.rb
@@ -5,7 +5,6 @@ module Visualization
class ExternalSource < Sequel::Model
- many_to_one :visualization
def validate
validates_presence :visualization_id
|
Remove fake Sequel model association
The visualization is retrieved through a class method defined below,
and trying to use the association in the sequel model can yield
errors:
/var/lib/gems/2.5.0/gems/activesupport-4.2.11.3/lib/active_support/inflector/methods.rb:263:in `const_get': uninitialized constant CartoDB::Visualization::Visualization (this happened when attempting to $
ind the associated class for #<Sequel::Model::Associations::ManyToOneAssociationReflection CartoDB::Visualization::ExternalSource.many_to_one :visualization>) (NameError)
|
diff --git a/testing/lib/refinery/testing.rb b/testing/lib/refinery/testing.rb
index abc1234..def5678 100644
--- a/testing/lib/refinery/testing.rb
+++ b/testing/lib/refinery/testing.rb
@@ -1,6 +1,6 @@ require 'refinerycms-core'
require 'rspec-rails'
-require 'factory_girl_rails'
+require 'factory_girl'
module Refinery
autoload :TestingGenerator, 'generators/refinery/testing/testing_generator'
|
Remove source of factory duplication
Factory_girl_rails was loading factories, and further down in this file
so was refinery.
|
diff --git a/config/initializers/RailsPatch22584.rb b/config/initializers/RailsPatch22584.rb
index abc1234..def5678 100644
--- a/config/initializers/RailsPatch22584.rb
+++ b/config/initializers/RailsPatch22584.rb
@@ -0,0 +1,9 @@+module RailsPatch22584
+ def insert_fixture(fixture, table_name)
+ # A regression with rails 4.2.5 breaks fixtures with symbol keys, specifically this one method.
+ # So, stringify keys in the fixture hash being sent to this method.
+ super(fixture.stringify_keys, table_name)
+ end
+end
+
+ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.include(RailsPatch22584)
|
Add rails patch for ActiveRecord::Fixture::FixtureError: table has no column named error.
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -35,4 +35,6 @@ resources :discussion_boards, :only => [ :edit, :update ] do
resources :topics, :only => [ :new, :create ]
end
+
+ resources :topics, :only => [ :show ]
end
|
Add Route for Topic show
Update the routes file to include a route for the Topic show action.
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,43 +1,26 @@ Ilp2::Application.routes.draw do
- resources :views
- resources :settings
- resources :timetables
+ resources :views, :settings
resources :events do
- collection do
- get :more
- end
- member do
- get :open_extended
- end
+ get "more", :on => :collection
+ get "open_extended", :on => :member
end
resources :people do
- resources :events
- resources :timetables
+ resources :events, :timetables
resources :views do
- member do
- get :header
- end
+ get "header", :on => :member
end
- resources :review_lines
- collection do
- get :search
- end
+ get :search, :on => :collection
member do
- get :next_lesson_block
- get :my_courses_block
- get :targets_block
- get :moodle_block
- get :attendance_block
+ get :next_lesson_block, :my_courses_block, :targets_block
+ get :moodle_block, :attendance_block
end
end
resources :courses do
resources :views
resources :timetables
member do
- get :next_lesson_block
- get :moodle_block
- get :reviews_block
+ get :next_lesson_block, :moodle_block, :reviews_block
post :add
end
end
|
Simplify out the routing a little
|
diff --git a/db/migrate/20110926021317_add_special_forms130.rb b/db/migrate/20110926021317_add_special_forms130.rb
index abc1234..def5678 100644
--- a/db/migrate/20110926021317_add_special_forms130.rb
+++ b/db/migrate/20110926021317_add_special_forms130.rb
@@ -0,0 +1,109 @@+class AddSpecialForms130 < ActiveRecord::Migration
+
+ def self.add_special_form(lib, ns, name, doc)
+
+ return if not lib or not ns
+
+ f = Function.new
+ f.name = name
+ f.doc = doc
+ f.shortdoc = doc
+ f.version = lib.version
+ f.arglists_comp = ""
+ f.namespace_id = ns.id
+ f.url_friendly_name = name
+ if name == "."
+ f.url_friendly_name = "_dot"
+ end
+
+ f.save
+ end
+
+ def self.add_special_forms_for_version(version)
+
+ lib = Library.find_by_name_and_version('Clojure Core', version)
+ ns = Namespace.find_by_name_and_version('clojure.core', version)
+
+ add_special_form(lib,
+ ns,
+ 'def',
+ 'Please see http://clojure.org/special_forms#def')
+
+ add_special_form(lib,
+ ns,
+ 'if',
+ 'Please see http://clojure.org/special_forms#if')
+
+ add_special_form(lib,
+ ns,
+ 'do',
+ 'Please see http://clojure.org/special_forms#do')
+
+ add_special_form(lib,
+ ns,
+ 'quote',
+ 'Please see http://clojure.org/special_forms#quote')
+
+ add_special_form(lib,
+ ns,
+ 'var',
+ 'Please see http://clojure.org/special_forms#var')
+
+ add_special_form(lib,
+ ns,
+ 'recur',
+ 'Please see http://clojure.org/special_forms#recur')
+
+ add_special_form(lib,
+ ns,
+ 'throw',
+ 'Please see http://clojure.org/special_forms#throw')
+
+ add_special_form(lib,
+ ns,
+ 'try',
+ 'Please see http://clojure.org/special_forms#try')
+
+ add_special_form(lib,
+ ns,
+ 'monitor-exit',
+ 'Please see http://clojure.org/special_forms#monitor-exit')
+
+ add_special_form(lib,
+ ns,
+ 'monitor-enter',
+ 'Please see http://clojure.org/special_forms#monitor-enter')
+
+ add_special_form(lib,
+ ns,
+ '.',
+ 'Please see http://clojure.org/java_interop#dot')
+
+ add_special_form(lib,
+ ns,
+ 'new',
+ 'Please see http://clojure.org/java_interop#new')
+
+ add_special_form(lib,
+ ns,
+ 'set!',
+ 'Please see http://clojure.org/special_forms#set')
+
+ add_special_form(lib,
+ ns,
+ 'catch',
+ 'Please see http://clojure.org/special_forms#try')
+
+ add_special_form(lib,
+ ns,
+ 'finally',
+ 'Please see http://clojure.org/special_forms#finally')
+ end
+
+ def self.up
+ add_special_forms_for_version "1.3.0"
+ end
+
+ def self.down
+ end
+end
|
Add special forms for Clojure 1.3.0.
|
diff --git a/BHCDatabase/test/integration/user_change_password_test.rb b/BHCDatabase/test/integration/user_change_password_test.rb
index abc1234..def5678 100644
--- a/BHCDatabase/test/integration/user_change_password_test.rb
+++ b/BHCDatabase/test/integration/user_change_password_test.rb
@@ -0,0 +1,32 @@+require 'test_helper'
+
+class UserChangePasswordTest < ActionDispatch::IntegrationTest
+ def setup
+ @admin = users(:david)
+ @service_user = users(:service_user)
+ log_in_as(@admin)
+ end
+
+ test "unsuccessful password change" do
+ get user_path(@service_user)
+ assert_template 'users/show'
+ oldpassword = @service_user.password_digest
+ newpassword = 'abc'
+ patch update_password_user_path(@service_user), params: { user: { password: newpassword, password_confirmation: newpassword} }
+ assert_redirected_to @service_user
+ @service_user.reload
+ assert_equal oldpassword, @service_user.password_digest
+ end
+
+ test "successful password change" do
+ get user_path(@service_user)
+ assert_template 'users/show'
+ oldpassword = @service_user.password_digest
+ newpassword = 'abc123'
+ patch update_password_user_path(@service_user), params: { user: { password: newpassword, password_confirmation: newpassword} }
+ assert_redirected_to @service_user
+ @service_user.reload
+ assert_not_equal oldpassword, @service_user.password_digest
+ end
+
+end
|
Add tests for new functionality
|
diff --git a/Casks/font-comic-neue.rb b/Casks/font-comic-neue.rb
index abc1234..def5678 100644
--- a/Casks/font-comic-neue.rb
+++ b/Casks/font-comic-neue.rb
@@ -0,0 +1,18 @@+class FontComicNeue < Cask
+ url 'http://comicneue.com/comic-neue-1.1.zip'
+ homepage 'http://comicneue.com/'
+ version '1.1'
+ sha256 'e4c2bd402348d73d86f87d930670748e2963b6c29be2ebf6df407de1425ff6b6'
+ font 'comic-neue-1.1/ComicNeue-Angular-Bold-Oblique.ttf'
+ font 'comic-neue-1.1/ComicNeue-Angular-Bold.ttf'
+ font 'comic-neue-1.1/ComicNeue-Angular-Light-Oblique.ttf'
+ font 'comic-neue-1.1/ComicNeue-Angular-Light.ttf'
+ font 'comic-neue-1.1/ComicNeue-Angular-Regular-Oblique.ttf'
+ font 'comic-neue-1.1/ComicNeue-Angular-Regular.ttf'
+ font 'comic-neue-1.1/ComicNeue-Bold-Oblique.ttf'
+ font 'comic-neue-1.1/ComicNeue-Bold.ttf'
+ font 'comic-neue-1.1/ComicNeue-Light-Oblique.ttf'
+ font 'comic-neue-1.1/ComicNeue-Light.ttf'
+ font 'comic-neue-1.1/ComicNeue-Regular-Oblique.ttf'
+ font 'comic-neue-1.1/ComicNeue-Regular.ttf'
+end
|
Add the Comic Neue font
Public domain, available at http://comicneue.com/
|
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::EmailUtil.send(params[:recipient],"Test email","This test message was sent from the isn image sharing server.")
+ output = Java::OrgRsnaIsnUtil::EmailUtil.send(params[:email],"Test email","This test message was sent from the isn image sharing server.")
render :text => "<pre class=\"well\">#{output}</pre>"
end
|
Fix for blank email address in try_email
|
diff --git a/config/unicorn.rb b/config/unicorn.rb
index abc1234..def5678 100644
--- a/config/unicorn.rb
+++ b/config/unicorn.rb
@@ -4,5 +4,5 @@ stdout_path "/var/www/deployments/gluedb/shared/log/unicorn.log"
listen "/tmp/unicorn.ap.sock"
-worker_processes 2
+worker_processes 10
timeout 180
|
Use more than 2 workers.
|
diff --git a/lib/rover.rb b/lib/rover.rb
index abc1234..def5678 100644
--- a/lib/rover.rb
+++ b/lib/rover.rb
@@ -0,0 +1,13 @@+module MarsPhotos
+ class Rover
+ attr_accessor :name
+
+ def initialize(name)
+ self.name = name
+ end
+
+ def get(sol)
+ HTTParty.get("https://api.nasa.gov/mars-photos/api/v1/rovers/#{self.name}/photos?sol=#{sol}&api_key=DEMO_KEY")
+ end
+ end
+end
|
Add Rover class with initialize and get photos methods
|
diff --git a/lib/discovery_method/standard.rb b/lib/discovery_method/standard.rb
index abc1234..def5678 100644
--- a/lib/discovery_method/standard.rb
+++ b/lib/discovery_method/standard.rb
@@ -28,7 +28,7 @@
def discover_thumbnail
tag = (@doc/"link[@rel=image_src]").first
- thumbnail = tag.get_attribute('image_src') if tag
+ thumbnail = tag.get_attribute('href') if tag
@discovered_thumbnail = (thumbnail && @discoverer.valid_uri_scheme?(thumbnail) ? thumbnail : nil)
end
end
|
Use correct attribute to look up site thumbnail
|
diff --git a/lib/earth/industry/mecs_ratio.rb b/lib/earth/industry/mecs_ratio.rb
index abc1234..def5678 100644
--- a/lib/earth/industry/mecs_ratio.rb
+++ b/lib/earth/industry/mecs_ratio.rb
@@ -1,4 +1,5 @@ require 'earth/locality'
+require 'earth/industry/industry'
class MecsRatio < ActiveRecord::Base
set_primary_key :name
|
Include Industry from MecsRatio to allow iso tests
|
diff --git a/lib/generator/template_values.rb b/lib/generator/template_values.rb
index abc1234..def5678 100644
--- a/lib/generator/template_values.rb
+++ b/lib/generator/template_values.rb
@@ -15,8 +15,6 @@ end
module TemplateValuesFactory
- include CaseValues
-
def template_values
require cases_require_name
@@ -37,7 +35,7 @@ end
def extractor
- Files::GeneratorCases.proc?(exercise_name) ? ProcExtractor : AutoExtractor
+ Files::GeneratorCases.proc?(exercise_name) ? CaseValues::ProcExtractor : CaseValues::AutoExtractor
end
def cases_require_name
|
Remove unnecessary inclusion of CaseValues
|
diff --git a/lib/subjoin/derivableresource.rb b/lib/subjoin/derivableresource.rb
index abc1234..def5678 100644
--- a/lib/subjoin/derivableresource.rb
+++ b/lib/subjoin/derivableresource.rb
@@ -3,6 +3,12 @@ ROOT_URI = nil
TYPE_PATH = nil
+
+ def self.type_id
+ return self.to_s.downcase.gsub(/^.*::/, '') if self::TYPE_PATH.nil?
+ return self::TYPE_PATH
+ end
+
def self.type_url
if self.class == Resource
raise Subjoin::SubclassError.new "Class must be a subclass of Resource to use this method"
@@ -12,13 +18,8 @@ raise Subjoin::SubclassError.new "#{self.class} or a parent of #{self.class} derived from Subjoin::Resource must override ROOT_URI to use this method"
end
- if self::TYPE_PATH.nil?
- type_segment = self.to_s.downcase.gsub(/^.*::/, '')
- else
- type_segment = self::TYPE_PATH
- end
- return [self::ROOT_URI, type_segment].join('/')
+ return [self::ROOT_URI, self::type_id].join('/')
end
end
end
|
Resolve type id in a function
Separate out the code that calculates the type_id of the class into its
own function that we can use to build a map of tpes to classes.
|
diff --git a/config/unicorn.rb b/config/unicorn.rb
index abc1234..def5678 100644
--- a/config/unicorn.rb
+++ b/config/unicorn.rb
@@ -10,7 +10,7 @@
before_fork do |server, worker|
Signal.trap 'TERM' do
- puts 'Unicorn master intercepting TERM and sending myself QUIT instead'
+ logger.info 'Unicorn master intercepting TERM and sending myself QUIT instead'
Process.kill 'QUIT', Process.pid
end
@@ -20,7 +20,7 @@
after_fork do |server, worker|
Signal.trap 'TERM' do
- puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to send QUIT'
+ logger.info 'Unicorn worker intercepting TERM and doing nothing. Wait for master to send QUIT'
end
defined?(ActiveRecord::Base) and
|
Send info messages about Unicorn status to logger
|
diff --git a/Casks/airparrot1.rb b/Casks/airparrot1.rb
index abc1234..def5678 100644
--- a/Casks/airparrot1.rb
+++ b/Casks/airparrot1.rb
@@ -3,9 +3,10 @@ sha256 :no_check
url 'http://download.airsquirrels.com/AirParrot/Mac/AirParrot.dmg'
+ name 'AirParrot'
appcast 'http://airparrot.com/updates/AirParrot.xml'
homepage 'http://www.airsquirrels.com/airparrot/'
- license :unknown
+ license :commercial
app 'AirParrot.app'
end
|
AirParrot1: Add name and update license stanza
|
diff --git a/multipost.rb b/multipost.rb
index abc1234..def5678 100644
--- a/multipost.rb
+++ b/multipost.rb
@@ -52,4 +52,4 @@ site.posts.delete_if { |post| post.data["layout"].is_a? Array }
end
end
-end+end
|
Add newline to end of file
|
diff --git a/my_cookbook/recipes/default.rb b/my_cookbook/recipes/default.rb
index abc1234..def5678 100644
--- a/my_cookbook/recipes/default.rb
+++ b/my_cookbook/recipes/default.rb
@@ -10,10 +10,7 @@ app_root = "#{deploy[:deploy_to]}/current/cache"
execute "chmod -R g+rw #{app_root}" do
end
-end
-
-
-node[:deploy].each do |application, deploy|
+#
app_root = "#{deploy[:deploy_to]}/current/uploads"
execute "chmod -R g+rw #{app_root}" do
end
|
Change wp-content/cache and uploads group permission to write-v1
|
diff --git a/db/migrate/20141117182436_add_secret_token_for_every_join_request.rb b/db/migrate/20141117182436_add_secret_token_for_every_join_request.rb
index abc1234..def5678 100644
--- a/db/migrate/20141117182436_add_secret_token_for_every_join_request.rb
+++ b/db/migrate/20141117182436_add_secret_token_for_every_join_request.rb
@@ -1,6 +1,12 @@ class AddSecretTokenForEveryJoinRequest < ActiveRecord::Migration
def up
- JoinRequest.all.map(&:save)
+ connection = ActiveRecord::Base.connection()
+ ids = connection.execute("SELECT id from `join_requests`;").to_a
+
+ ids.each do |id|
+ tok = SecureRandom.urlsafe_base64(10)
+ connection.execute("UPDATE join_requests SET secret_token = '#{tok}' WHERE id = '#{id.first}'")
+ end
end
def down
|
Use sql syntax for join_request migration
|
diff --git a/db/seeds.rb b/db/seeds.rb
index abc1234..def5678 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -2,7 +2,6 @@ until i == 20
page = Page.create(text: Faker::Lorem.paragraph, next_page_id: i+1)
if page.id % 3 == 0
- page.has_challenge = true
Challenge.create(page_id: page.id, success_page_id: rand(20), fail_page_id: rand(20))
page.next_page = nil
page.save
|
Update seed file to reflect removal of has_challenge boolean form User migration.
|
diff --git a/test/note_test.rb b/test/note_test.rb
index abc1234..def5678 100644
--- a/test/note_test.rb
+++ b/test/note_test.rb
@@ -17,4 +17,10 @@ assert_equal @test_samples.length, @note_220.samples.length
assert_equal @test_samples.length, @distorted_note.samples.length
end
+
+ def test_number_of_frames_matches_number_of_samples
+ assert_equal @basic_note.total_frames, @basic_note.samples.length
+ assert_equal @note_220.total_frames, @note_220.samples.length
+ assert_equal @distorted_note.total_frames, @distorted_note.samples.length
+ end
end
|
Add test to compare total_frames to samples.length
|
diff --git a/db/seeds.rb b/db/seeds.rb
index abc1234..def5678 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -22,7 +22,7 @@ hour = rand(24)
half_hour = rand(2) == 1 ? 0 : 30
datetime = Time.local(date.year, date.month, date.day, hour, half_hour)
- tutor_id = user_ids.sample
- student_id = rand(2) == 1 ? (user_ids - [tutor_id]).sample : nil
+ tutor_id, student_id = user_ids.sample(2)
+ student_id = nil if rand(2) == 1
Timeslot.create(start: datetime, tutor_id: tutor_id, student_id: student_id)
end
|
Revise seed file user email
Revise seed file to use mentor.me.dev@gmail.com for all users.
|
diff --git a/test/novelinfo.rb b/test/novelinfo.rb
index abc1234..def5678 100644
--- a/test/novelinfo.rb
+++ b/test/novelinfo.rb
@@ -9,33 +9,27 @@ end
sub_test_case "cache_path" do
- test "valid" do
- ncode = "x12345"
+ expected = "/tmp/info/12/x12345.html.xz"
+ data(
+ 'valid' => ["x12345", expected],
+ 'unified to downcase?' => ["X12345", expected]
+ )
+ def test_cache_path?(data)
+ ncode, expected = data
info = Yomou::NovelInfo::PageParser.new(ncode)
- expected = "/tmp/info/12/x12345.html.xz"
- assert_equal(expected, info.cache_path.to_s)
- end
-
- test "downcase ncode" do
- ncode = "X12345"
- info = Yomou::NovelInfo::PageParser.new(ncode)
- expected = "/tmp/info/12/x12345.html.xz"
assert_equal(expected, info.cache_path.to_s)
end
end
sub_test_case "url" do
- test "valid" do
- ncode = "x12345"
+ expected = "http://ncode.syosetu.com/novelview/infotop/ncode/x12345/"
+ data(
+ 'valid' => ["x12345", expected],
+ 'unified to downcase?' => ["X12345", expected]
+ )
+ def test_url?(data)
+ ncode, expected = data
info = Yomou::NovelInfo::PageParser.new(ncode)
- expected = "http://ncode.syosetu.com/novelview/infotop/ncode/x12345/"
- assert_equal(expected, info.url)
- end
-
- test "downcase ncode" do
- ncode = "X12345"
- info = Yomou::NovelInfo::PageParser.new(ncode)
- expected = "http://ncode.syosetu.com/novelview/infotop/ncode/x12345/"
assert_equal(expected, info.url)
end
end
|
Use data driven test case
|
diff --git a/lib/a2ws.rb b/lib/a2ws.rb
index abc1234..def5678 100644
--- a/lib/a2ws.rb
+++ b/lib/a2ws.rb
@@ -12,24 +12,46 @@ end
class ItemSearch < Base
+ attr_accessor :items
+
default_params :Operation => 'ItemSearch'
- def initialize(api_key, search_index)
+ def initialize(api_key, search_index = :All)
self.class.default_params :SearchIndex => search_index, :AWSAccessKeyId => api_key
end
- def find(options = {})
- result = self.class.get('/onca/xml', options)
+ def find(keywords, options = {})
+ options.merge!({:Keywords => keywords})
+ puts options.inspect
+ result = self.class.get('/onca/xml', :query => options)
- items = result["ItemSearchResponse"]["Items"]
- if items['Request']['IsValid'] == 'True'
- items['Item'].collect do |i|
- i['ItemAttributes'].inject({}) {|h, j| h[j.first.titlecase.downcase.gsub(' ', '_')] = j.last ; h}.to_mash
+ @items = result["ItemSearchResponse"]["Items"]
+ if @items['Request']['IsValid'] == 'True'
+ @items['Item'].collect do |i|
+ Mash.new downcase_keys(i)
end
else
- raise items['Request']['Errors']['Error']['Message']
+ raise @items['Request']['Errors']['Error']['Message']
end
end
+
+ protected
+
+ def downcase_keys(hash)
+ new_hash = {}
+ hash.keys.each do |key|
+ value = hash.delete(key)
+ new_hash[downcase_key(key)] = value
+ new_hash[downcase_key(key)] = downcase_keys(value) if value.is_a?(Hash)
+ new_hash[downcase_key(key)] = value.each{|p| downcase_keys(p) if p.is_a?(Hash)} if value.is_a?(Array)
+ end
+ new_hash
+ end
+
+ def downcase_key(key)
+ key.titlecase.downcase.gsub(' ', '_')
+ end
+
end
end
|
Make sure we preserve the entire item.
|
diff --git a/recipes/defaults.rb b/recipes/defaults.rb
index abc1234..def5678 100644
--- a/recipes/defaults.rb
+++ b/recipes/defaults.rb
@@ -19,7 +19,10 @@ end
end
+# A bunch of features provided by this plugin that I want to enable for most
+# of our applications.
set :backup_database_before_migrations, true
+set :disable_web_during_migrations, true
# SSH options
ssh_options[:forward_agent] = true
|
Make capistrano disable the web app by default when a deployment with migrations happens.
|
diff --git a/lib/twat.rb b/lib/twat.rb
index abc1234..def5678 100644
--- a/lib/twat.rb
+++ b/lib/twat.rb
@@ -6,8 +6,8 @@ require 'optparse'
require 'oauth'
-Dir.glob("twat/*").each do |filename|
- require filename
+%w[config exceptions argparse actions].each do |filename|
+ require "twat/#{filename}"
end
module Twat
|
Revert "Require everything, instead of specific names"
Yarr Cap'n, f583bd7 has broken globbin', but ye' didn' notice.
HANG 'IM FROM THE MAINS'L!
This reverts commit f583bd7f2d9f59b44ee845d854a360013f952ba9.
|
diff --git a/index_create_statements.rb b/index_create_statements.rb
index abc1234..def5678 100644
--- a/index_create_statements.rb
+++ b/index_create_statements.rb
@@ -32,4 +32,4 @@ puts "CREATE INDEX CONCURRENTLY #{index_name} ON #{table_name} USING #{index_using} (#{index_columns.join(', ')});"
end
-load ARGF.read
+eval ARGF.read
|
Use `eval` because `load` expects a path
|
diff --git a/api-versions.gemspec b/api-versions.gemspec
index abc1234..def5678 100644
--- a/api-versions.gemspec
+++ b/api-versions.gemspec
@@ -18,5 +18,6 @@ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
- s.add_development_dependency "rspec-rails"
+ s.add_development_dependency "rspec-rails", "~> 2.0"
+ s.add_development_dependency 'ammeter', '0.2.5'
end
|
Update gemspec for generator related stuff.
|
diff --git a/tests/test_web.rb b/tests/test_web.rb
index abc1234..def5678 100644
--- a/tests/test_web.rb
+++ b/tests/test_web.rb
@@ -37,4 +37,10 @@ doc = Nokogiri::XML(last_response.body)
doc.xpath("//Response/Sms").first.content.should == sms_body
end
+
+ it "should ask for dial out" do
+ post "/process-private-menu", {:Digits => 2}
+ doc = Nokogiri::XML(last_response.body)
+ doc.xpath("//Response/Gather").first["action"].should == "/dial-out"
+ end
end
|
Add test for dialing out
|
diff --git a/SHEmailValidator.podspec b/SHEmailValidator.podspec
index abc1234..def5678 100644
--- a/SHEmailValidator.podspec
+++ b/SHEmailValidator.podspec
@@ -17,7 +17,7 @@ s.platform = :ios, '5.0'
s.requires_arc = true
- s.source = { :git => "https://github.com/spothero/SHEmailValidator.git", :tag => "v1.0.3" }
+ s.source = { :git => "https://github.com/spothero/SHEmailValidator.git", :tag => s.version.to_s }
s.source_files = 'SHEmailValidator', 'SHEmailValidator/*.{h,m}'
s.resources = 'SHEmailValidator/DomainData.plist'
|
Make git tag tied to version
|
diff --git a/db/migrate/20160902132101_make_tag_mapping_polymorphic.rb b/db/migrate/20160902132101_make_tag_mapping_polymorphic.rb
index abc1234..def5678 100644
--- a/db/migrate/20160902132101_make_tag_mapping_polymorphic.rb
+++ b/db/migrate/20160902132101_make_tag_mapping_polymorphic.rb
@@ -3,10 +3,6 @@ rename_column :tag_mappings, :tagging_spreadsheet_id, :tagging_source_id
add_column :tag_mappings, :tagging_source_type, :string
- TagMapping.transaction do
- TagMapping.all.each do |tag_mapping|
- tag_mapping.update!(taggable_type: 'TaggingSpreadsheet')
- end
- end
+ execute "UPDATE tag_mappings SET tagging_source_type = 'TaggingSpreadsheet'"
end
end
|
Fix migration for polymorphic tag mappings
The `taggable_type` attribute got renamed from `taggable_type`.
Because locally there weren't any records in the tag_mappings table,
this didn't surface. On staging there are records, so this migration
fails because `taggable_type` doesn't exist.
Also makes it use a SQL query, which is faster and more robust.
|
diff --git a/lib/carto/connector/providers/postgresql.rb b/lib/carto/connector/providers/postgresql.rb
index abc1234..def5678 100644
--- a/lib/carto/connector/providers/postgresql.rb
+++ b/lib/carto/connector/providers/postgresql.rb
@@ -23,7 +23,7 @@ Driver: 'PostgreSQL Unicode',
ByteaAsLongVarBinary: 1,
MaxVarcharSize: 256,
- BoolAsChar: 0
+ BoolsAsChar: 0
}
end
|
Fix postgres Connector ODBC parameter name
|
diff --git a/app/controllers/docs_controller.rb b/app/controllers/docs_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/docs_controller.rb
+++ b/app/controllers/docs_controller.rb
@@ -1,5 +1,5 @@ class DocsController < ApplicationController
-before_action :find_doc, only: [:show, :edit, :update, :destory]
+before_action :find_doc, only: [:show, :edit, :update, :destroy]
def index
@@ -7,6 +7,7 @@ end
def show
+ @doc = Doc.find(params[:id])
end
def new
@@ -24,14 +25,14 @@ end
def edit
- if @doc.update(doc_params)
+ end
+
+ def update
+ if @doc.update(doc_params)
redirect_to @doc
else
render 'edit'
end
- end
-
- def update
end
def destroy
|
Fix edit and update controller. Remove error for missing doc values
|
diff --git a/app/controllers/jobs_controller.rb b/app/controllers/jobs_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/jobs_controller.rb
+++ b/app/controllers/jobs_controller.rb
@@ -1,6 +1,6 @@ class JobsController < ApplicationController
def index
- @jobs = Job.all
+ @jobs = Job.find(:all, :order => "id DESC")
end
def show
|
Fix for order of job listing.
|
diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/user_controller.rb
+++ b/app/controllers/user_controller.rb
@@ -12,4 +12,41 @@ end
render :json => {locations: users_locations, transactions: users_transactions}
end
+
+ def get_earning_transactions_and_locations_on_date
+ date = params[:date]
+ transactions = get_transactions_on_date(date, "earning")
+ locations = get_locations_on_date(date)
+ render :json => {transactions: transactions, locations: locations}
+ end
+
+ private
+
+ def get_transactions_on_date(date, type)
+ transactions = {}
+ date = parse_date(date)
+
+ all_users.each do |user|
+ transactions[user.name] =
+ user.transactions
+ .where("created_at = ? AND transaction_type = ?",
+ date, type)
+ end
+ transactions
+ end
+
+ def get_locations_on_date(date)
+ locations = {}
+ date = parse_date(date)
+
+ all_users.each do |user|
+ locations[user.name] = user.locations.where("created_at = ?", date)
+ end
+ locations
+ end
+
+ def parse_date(date)
+ Time.parse(date).utc.beginning_of_day
+ end
+
end
|
Add controller to get transactions and locations for times of earning; Also add private helper methods directly into the controller instead of helpers file for ease of review
|
diff --git a/app/decorators/author_decorator.rb b/app/decorators/author_decorator.rb
index abc1234..def5678 100644
--- a/app/decorators/author_decorator.rb
+++ b/app/decorators/author_decorator.rb
@@ -2,13 +2,13 @@ decorates :user
def email
- if source.email && !source.private_email
+ if object.email && !object.private_email
mail_to source.email
end
end
def toggle_email_privacy
- alternate_email_status = source.private_email == true ? "Public" : "Private"
- link_to "Make Email #{alternate_email_status}", author_toggle_email_privacy_path(source), method: :put
+ alternate_email_status = object.private_email == true ? "Public" : "Private"
+ link_to "Make Email #{alternate_email_status}", author_toggle_email_privacy_path(object), method: :put
end
end
|
Replace source with object in Draper
|
diff --git a/app/models/project_content_item.rb b/app/models/project_content_item.rb
index abc1234..def5678 100644
--- a/app/models/project_content_item.rb
+++ b/app/models/project_content_item.rb
@@ -19,4 +19,6 @@ end
scope :uncompleted, -> { where(done: false) }
+
+ scope :matching_search, -> (query) { where("title LIKE ?", "%#{query}%") }
end
|
Add a basic search scope to ProjectContentItem
|
diff --git a/app/models/person.rb b/app/models/person.rb
index abc1234..def5678 100644
--- a/app/models/person.rb
+++ b/app/models/person.rb
@@ -1,8 +1,6 @@ module Person
- extend ActiveSupport::Concern
+ include Virtus.module
- included do
- attribute :name, Array[PersonName]
- attribute :date_of_birth, Date
- end
+ attribute :name, Array[PersonName]
+ attribute :date_of_birth, Date
end
|
Use Virtus's simpler sharing solution
|
diff --git a/custom_counter_cache.gemspec b/custom_counter_cache.gemspec
index abc1234..def5678 100644
--- a/custom_counter_cache.gemspec
+++ b/custom_counter_cache.gemspec
@@ -15,7 +15,7 @@ s.require_paths = ['lib']
s.files = Dir['lib/**/*.rb']
s.required_rubygems_version = '>= 1.3.6'
- s.add_dependency('rails', RUBY_VERSION < '1.9.3' ? '~> 3.1' : '>= 3.1')
+ s.add_dependency('rails')
s.add_development_dependency('sqlite3')
s.test_files = Dir['test/**/*.rb']
s.rubyforge_project = 'custom_counter_cache'
|
Remove ruby version requirement from gemspec, as it's been moved to Travis.
|
diff --git a/lib/rack/tracker/google_tag_manager/google_tag_manager.rb b/lib/rack/tracker/google_tag_manager/google_tag_manager.rb
index abc1234..def5678 100644
--- a/lib/rack/tracker/google_tag_manager/google_tag_manager.rb
+++ b/lib/rack/tracker/google_tag_manager/google_tag_manager.rb
@@ -3,7 +3,7 @@ class Push < OpenStruct
def write
- "'#{event[:name]}': '#{event[:value]}'"
+ "'#{event[:name]}': #{event[:value].to_json}"
end
def event
|
Support JSON values for Google Tag Manager
|
diff --git a/assignments/ruby/grains/example.rb b/assignments/ruby/grains/example.rb
index abc1234..def5678 100644
--- a/assignments/ruby/grains/example.rb
+++ b/assignments/ruby/grains/example.rb
@@ -5,7 +5,7 @@ end
def total
- (1..64).inject(0) do |sum, number|
+ @total ||= (1..64).inject(0) do |sum, number|
sum + square(number)
end
end
|
Add lazy initialization to ruby:grains
|
diff --git a/lib/iblt.rb b/lib/iblt.rb
index abc1234..def5678 100644
--- a/lib/iblt.rb
+++ b/lib/iblt.rb
@@ -1,13 +1,14 @@ class IBLT
+ require 'ciblt'
def initialize(opts = {})
@opts = {
:size => 100,
:hashes => 4,
- :seed => Time.now.to_i,
+ :seed => Time.now.to_i
}.merge(opts)
- @iblt = CIBLT.new(@opts[:size], @opts[:hashes], @opts[:seed]))
+ @iblt = CIBLT.new(@opts[:size], @opts[:hashes], @opts[:seed])
end
# This method inserts a key-value pair into the IBLT. This operation always
@@ -29,10 +30,11 @@ @iblt.[](key)
end
- # This methods returns all key-value pairs as a string
- def inspect()
- @iblt.inspect()
+ # This methods returns all key-value pairs as a string and destroys the data
+ # in the process
+ def inspect!()
+ @iblt.inspect!()
end
- alias :to_s :inspect
+ alias :to_s! :inspect!
end
|
Add bang to inspect method to indicate danger
|
diff --git a/lib/atlas/fever_details.rb b/lib/atlas/fever_details.rb
index abc1234..def5678 100644
--- a/lib/atlas/fever_details.rb
+++ b/lib/atlas/fever_details.rb
@@ -16,6 +16,12 @@ attribute :efficiency_based_on, Symbol
attribute :efficiency_balanced_with, Symbol
+ # The base coefficient of performance, and the COP change per degree of
+ # ambient temperature.
+ attribute :base_cop, Float
+ attribute :cop_per_degree, Float
+ attribute :cop_cutoff, Float
+
# Use a producer defined on another node.
attribute :alias_of, Symbol
|
Add COP constant attributes to FeverDetails
|
diff --git a/lib/dm-types/epoch_time.rb b/lib/dm-types/epoch_time.rb
index abc1234..def5678 100644
--- a/lib/dm-types/epoch_time.rb
+++ b/lib/dm-types/epoch_time.rb
@@ -1,4 +1,11 @@ require 'dm-core'
+
+begin
+ # provide Time#utc_time for DateTime#to_time in AS
+ require 'active_support/core_ext/time/calculations'
+rescue LoadError
+ # do nothing, extlib is being used and does not require this method
+end
module DataMapper
class Property
|
Fix failing specs for EpochTime type
* The DateTime#to_time method in AS3 requires Time#utc_time to be
available, but it does not require it, and this causes problems when
cherry picking the #to_time methods.
|
diff --git a/arm-none-eabi-gcc.rb b/arm-none-eabi-gcc.rb
index abc1234..def5678 100644
--- a/arm-none-eabi-gcc.rb
+++ b/arm-none-eabi-gcc.rb
@@ -3,10 +3,10 @@ class ArmNoneEabiGcc < Formula
homepage 'https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads'
- version '7-2017-q4-major'
+ version '7-2018-q2-update'
- url 'https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2017q4/gcc-arm-none-eabi-7-2017-q4-major-mac.tar.bz2'
- sha256 '89b776c7cf0591c810b5b60067e4dc113b5b71bc50084a536e71b894a97fdccb'
+ url 'https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-mac.tar.bz2'
+ sha256 'c1c4af5226d52bd1b688cf1bd78f60eeea53b19fb337ef1df4380d752ba88759'
def install
(prefix/"gcc").install Dir["./*"]
|
Update ARM gcc to `7-2018-q2-update`
|
diff --git a/lib/prtg.rb b/lib/prtg.rb
index abc1234..def5678 100644
--- a/lib/prtg.rb
+++ b/lib/prtg.rb
@@ -7,6 +7,16 @@ require "prtg/sensor"
require "prtg/utils"
+# = Description
+# This library is used to communicate with a prtg monitoring instance
+#
+# Simple Example:
+# http = Net::HTTP.new("subdomain.domain.tld", 443)
+# http.use_ssl = true
+# http.verify_mode = OpenSSL::SSL::VERIFY_NONE
+#
+# client = Prtg::Client.new(:host => http, :username => "foo", :password => "bar")
+# puts client.live_data.content(:sensors)
module Prtg
VERSION = "0.0.1"
end
|
Add a quick example to doc
|
diff --git a/puppet-lint-no_cron_resources-check.gemspec b/puppet-lint-no_cron_resources-check.gemspec
index abc1234..def5678 100644
--- a/puppet-lint-no_cron_resources-check.gemspec
+++ b/puppet-lint-no_cron_resources-check.gemspec
@@ -21,7 +21,7 @@ spec.add_development_dependency 'rspec', '~> 3.9.0'
spec.add_development_dependency 'rspec-its', '~> 1.0'
spec.add_development_dependency 'rspec-collection_matchers', '~> 1.0'
- spec.add_development_dependency 'rubocop', '~> 0.83.0'
+ spec.add_development_dependency 'rubocop', '~> 0.84.0'
spec.add_development_dependency 'rake', '~> 13.0.0'
spec.add_development_dependency 'rspec-json_expectations', '~> 2.2'
spec.add_development_dependency 'simplecov', '~> 0.18.0'
|
Update rubocop requirement from ~> 0.83.0 to ~> 0.84.0
Updates the requirements on [rubocop](https://github.com/rubocop-hq/rubocop) to permit the latest version.
- [Release notes](https://github.com/rubocop-hq/rubocop/releases)
- [Changelog](https://github.com/rubocop-hq/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop-hq/rubocop/compare/v0.83.0...v0.84.0)
Signed-off-by: dependabot-preview[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com>
|
diff --git a/cutcut.gemspec b/cutcut.gemspec
index abc1234..def5678 100644
--- a/cutcut.gemspec
+++ b/cutcut.gemspec
@@ -18,7 +18,7 @@ s.add_dependency 'ruby-progressbar', '~> 1.7'
s.add_development_dependency 'guard', '~> 2.13'
- s.add_development_dependency 'guard-rspec', '~> 4.6'
+ s.add_development_dependency 'guard-rspec', '~> 4.7'
s.add_development_dependency 'rubocop', '~> 0.4'
s.add_development_dependency 'guard-rubocop', '~> 1.2'
s.add_development_dependency 'rspec', '~> 3.5'
|
Update guard-rspec to ~> 4.7
|
diff --git a/lib/fat_table/db_handle.rb b/lib/fat_table/db_handle.rb
index abc1234..def5678 100644
--- a/lib/fat_table/db_handle.rb
+++ b/lib/fat_table/db_handle.rb
@@ -3,14 +3,12 @@
def self.set_db(driver: 'Pg',
database:,
- user:,
- password:,
+ user: nil,
+ password: nil,
host: 'localhost',
port: '5432',
socket: '/tmp/.s.PGSQL.5432')
raise ArgumentError, 'must supply database name to set_db' unless database
- raise ArgumentError, 'must supply user to set_db' unless user
- raise ArgumentError, 'must supply password to set_db' unless password
valid_drivers = ['Pg', 'Mysql', 'SQLite3']
unless valid_drivers.include?(driver)
|
Allow db dsn to have empty user and password.
|
diff --git a/lib/graphql-docs/client.rb b/lib/graphql-docs/client.rb
index abc1234..def5678 100644
--- a/lib/graphql-docs/client.rb
+++ b/lib/graphql-docs/client.rb
@@ -30,10 +30,11 @@ end
def fetch
- @faraday.post do |req|
+ res = @faraday.post do |req|
req.headers['Content-Type'] = 'application/json'
req.body = "{ \"query\": \"#{GraphQL::Introspection::INTROSPECTION_QUERY.gsub("\n", '')}\" }"
end
+ res.body
end
def inspect
|
Add `.body` to faraday response
|
diff --git a/lib/janus_gateway/error.rb b/lib/janus_gateway/error.rb
index abc1234..def5678 100644
--- a/lib/janus_gateway/error.rb
+++ b/lib/janus_gateway/error.rb
@@ -6,6 +6,8 @@ # @param [String] error_info
def initialize(error_code, error_info)
@code, @info = error_code, error_info
+
+ super(error_info)
end
# @return [String]
|
Call super() for JanusGateway::Error constructor
|
diff --git a/lib/grid.rb b/lib/grid.rb
index abc1234..def5678 100644
--- a/lib/grid.rb
+++ b/lib/grid.rb
@@ -4,8 +4,8 @@ params = {programfile: nil}.merge(params)
Params.check_params(params, [:window, :user, :map_file, :tileset])
- @window, @user = window, user
@map = Map.new(window, mapfile, tileset)
+ @window, @user = params[:window], params[:user]
create_programs(program_file)
end
|
Use params for instance variable assignment
|
diff --git a/lib/modules/simple_find.rb b/lib/modules/simple_find.rb
index abc1234..def5678 100644
--- a/lib/modules/simple_find.rb
+++ b/lib/modules/simple_find.rb
@@ -3,6 +3,19 @@ def find_by_name(name)
self.find(:all, :params =>{:q => name})
end
+
+ def find(*arguments)
+ scope = arguments.slice!(0)
+ options = arguments.slice!(0) || {}
+
+ case scope
+ when :all then find_every(options)
+ when :first then find(find_every(options).first.nr)
+ when :one then find_one(options)
+ else find_single(scope, options)
+ end
+ end
+
end
def self.included(receiver)
|
Patch to make find(:first) work with the OIO interface
|
diff --git a/lib/tasks/investments.rake b/lib/tasks/investments.rake
index abc1234..def5678 100644
--- a/lib/tasks/investments.rake
+++ b/lib/tasks/investments.rake
@@ -0,0 +1,12 @@+namespace :investments do
+ namespace :internal_comments do
+ desc "Migrate internal_comments textarea to a first comment on internal thread"
+ task migrate_to_thread: :environment do
+ comments_author_id = Administrator.first.user.id
+ Budget::Investment.where.not(internal_comments: [nil, '']).find_each do |investment|
+ Comment.create(commentable: investment, user_id: comments_author_id,
+ body: investment.internal_comments, valuation: true)
+ end
+ end
+ end
+end
|
Add rake task to migrate investment's internal comments to thread
|
diff --git a/lib/templates/installer.rb b/lib/templates/installer.rb
index abc1234..def5678 100644
--- a/lib/templates/installer.rb
+++ b/lib/templates/installer.rb
@@ -3,6 +3,10 @@
say "Copying fixtures to test/fixtures/action_text/rich_texts.yml"
copy_file "#{__dir__}/fixtures.yml", "test/fixtures/action_text/rich_texts.yml"
+
+say "Copying blob rendering partial to app/views/active_storage/blobs/_blob.html.erb"
+copy_file "#{__dir__}/../../app/views/active_storage/blobs/_blob.html.erb",
+ "app/views/active_storage/blobs/_blob.html.erb"
# FIXME: Replace with release version on release
say "Installing JavaScript dependency"
|
Copy over the blobs/_blob partial so it can be specialized
|
diff --git a/lib/tado.rb b/lib/tado.rb
index abc1234..def5678 100644
--- a/lib/tado.rb
+++ b/lib/tado.rb
@@ -3,12 +3,13 @@
class Tado
include HTTParty
- base_uri 'https://my.tado.com/mobile/1.4'
- def initialize(username, password)
+ def initialize(username, password, api_version)
@username = username
@password = password
@default_options = { query: { username: @username, password: @password } }
+
+ self.class.base_uri "https://my.tado.com/mobile/#{api_version}"
end
def getCurrentState
|
Add version to be set in initialize.
|
diff --git a/lib/wifi.rb b/lib/wifi.rb
index abc1234..def5678 100644
--- a/lib/wifi.rb
+++ b/lib/wifi.rb
@@ -3,23 +3,41 @@ class WiFiConnectionStatus
def initialize
@online = true
- @growler = Growl.new 'localhost', 'wifi', ['offline']
+ @growler = Growl.new 'localhost', 'wifi', ['offline', 'online']
+ @count = 0
+
+ File.open "snarks.txt" do |file|
+ @snarks = file.readlines
+ end
end
-
+
def reconnect
%x[osascript #{File.dirname(__FILE__)}/wifi/airport_off.scpt]
sleep(3)
%x[osascript #{File.dirname(__FILE__)}/wifi/airport_on.scpt]
end
+ def snark
+ @online ? @snarks.shuffle.first.strip + "\n" : ''
+ end
+
+ def disconnection_count
+ @online ? "\nDisconnection count: #{@count}" : ''
+ end
+
+ def growl( arguments )
+ @growler.notify arguments[:name] , arguments[:title] || '' , snark + (arguments[:body] || '') + disconnection_count
+ end
+
def check_connection
result = %x(ping -W2 -c3 google.com 2>&1)
if result["100.0% packet loss"] || result["Unknown"]
- @growler.notify 'offline', 'The internet is gone again', 'The Wifi has left the building' if @online
+ @count += 1 if @online
+ growl( :name => 'offline', :title => 'The internet is gone again', :body => "You've lost your Wifi connection again." ) if @online
reconnect
@online = false
else
- @growler.notify 'offline', 'The internet is back', 'Enjoy it while it lasts' unless @online
+ growl( :name => 'online', :title => 'The internet is back', :body => 'Enjoy it while it lasts' ) unless @online
@online = true
end
end
|
Add disconnect count and snarks
|
diff --git a/libmpc08.rb b/libmpc08.rb
index abc1234..def5678 100644
--- a/libmpc08.rb
+++ b/libmpc08.rb
@@ -0,0 +1,26 @@+require 'formula'
+
+class Libmpc08 < Formula
+ homepage 'http://multiprecision.org'
+ url 'ftp://gcc.gnu.org/pub/gcc/infrastructure/mpc-0.8.1.tar.gz'
+ sha1 '5ef03ca7aee134fe7dfecb6c9d048799f0810278'
+
+ keg_only 'Conflicts with libmpc in main repository.'
+
+ depends_on 'gmp4'
+ depends_on 'mpfr2'
+
+ def install
+ args = [
+ "--prefix=#{prefix}",
+ "--disable-dependency-tracking",
+ "--with-gmp=#{Formula.factory('gmp4').opt_prefix}",
+ "--with-mpfr=#{Formula.factory('mpfr2').opt_prefix}"
+ ]
+
+ system "./configure", *args
+ system "make"
+ system "make check"
+ system "make install"
+ end
+end
|
Add legacy version of libmpc
* Track libmpc 0.8.1 on GCC infrastructure.
|
diff --git a/app/models/apps_query.rb b/app/models/apps_query.rb
index abc1234..def5678 100644
--- a/app/models/apps_query.rb
+++ b/app/models/apps_query.rb
@@ -43,7 +43,7 @@ when ORDER_NEW
Product.order(created_at: :desc)
else
- when_clauses = SevenDayMVP::PRODUCTS.each_with_index.map { |slug, i| "WHEN slug='#{slug}' THEN #{i}" }.join(' ')
+ when_clauses = SevenDayMVP::PRODUCTS.each_with_index.map { |slug, i| "WHEN products.slug='#{slug}' THEN #{i}" }.join(' ')
case_statement = "(CASE #{when_clauses} ELSE #{SevenDayMVP::PRODUCTS.size} END) ASC"
Product.order(case_statement).
|
Make the table explicit in the case statement
|
diff --git a/app/models/definition.rb b/app/models/definition.rb
index abc1234..def5678 100644
--- a/app/models/definition.rb
+++ b/app/models/definition.rb
@@ -19,17 +19,18 @@ # check string for every definition in the DB
select(:id, :key).find_each do |definition|
# go through the set of keys for this definition
+ a = []
definition.keys.each do |key|
- regex = /\b(#{key})\b/i
- next unless string.match regex
+ a << [string.index(key), key] if string.index(key)
+ end
- # insert the definition markup around a found definition key.
+ # find the key that occurs first in the description
+ first_key = a.sort[0][1]
+ if first_key
+ regex = /\b(#{first_key})\b/i
string.sub! regex,
- "<dfn class='JS-tooltip' data-id='#{definition.id}'>"\
- '\1</dfn>'
-
- # a string may only provide definitions for one key in the set
- break
+ "<dfn class='JS-tooltip' data-id='#{definition.id}'>"\
+ '\1</dfn>'
end
end
string
|
Make sure only the first occurrence of a key gets a tooltip
|
diff --git a/app/models/gpdb_table.rb b/app/models/gpdb_table.rb
index abc1234..def5678 100644
--- a/app/models/gpdb_table.rb
+++ b/app/models/gpdb_table.rb
@@ -1,11 +1,4 @@ class GpdbTable < GpdbDatabaseObject
-
- def analyzed_date(table_stats)
- analyzed_date = table_stats.fetch("last_analyzed", '')
- if analyzed_date.present?
- Time.parse(analyzed_date).utc
- end
- end
def analyze(account)
table_name = '"' + schema.name + '"."' + name + '"';
|
Remove unused method in Gpdbtable
|
diff --git a/app/models/group_time.rb b/app/models/group_time.rb
index abc1234..def5678 100644
--- a/app/models/group_time.rb
+++ b/app/models/group_time.rb
@@ -7,7 +7,7 @@ scope_by_site_id
def section=(s)
- self[:section] = nil unless s.present?
+ self[:section] = s.presence
end
before_create :update_ordering
|
Fix bug setting check in destination section name.
|
diff --git a/app/models/import_job.rb b/app/models/import_job.rb
index abc1234..def5678 100644
--- a/app/models/import_job.rb
+++ b/app/models/import_job.rb
@@ -3,6 +3,10 @@ class ImportJob < ApplicationRecord
belongs_to :user
broadcasts_to :user
+
+ has_one_attached :file
+
+ attribute :row_count, :default => 0
enum :status => {
:waiting => 0,
|
Set up file attachment for Import Job
|
diff --git a/spec/features/properties_management_spec.rb b/spec/features/properties_management_spec.rb
index abc1234..def5678 100644
--- a/spec/features/properties_management_spec.rb
+++ b/spec/features/properties_management_spec.rb
@@ -2,7 +2,9 @@
describe "the properties management", :type => :feature, :js => true do
- scenario 'Shows the properties menu for the leaseholder' do
+ scenario 'Shows the index properties for the leaseholder' do
+ #TODO create an alternative scenario and
+ #expectation to check that property attrs are rendered.
page.driver.allow_url("secure.gravatar.com")
user = create(:lease_holder)
visit root_path
@@ -16,4 +18,19 @@ click_link('Mis Propiedades')
expect(page).to have_content('Propiedades Registradas')
end
+
+ scenario 'Shows the properties menu for the leaseholder' do
+ page.driver.allow_url("secure.gravatar.com")
+ user = create(:lease_holder)
+ visit root_path
+ click_link('iniciar sesión')
+ fill_in 'Email', with: user.email
+ fill_in 'Password', with: 'password'
+ click_button 'Login'
+ expect(page).to have_selector('a.dropdown-toggle')
+ page.find('a.dropdown-toggle').click
+ page.find('li#propiedades.dropdown-submenu').hover
+ click_link('Registrar Propiedad')
+ expect(page).to have_content('Registrar Propiedad')
+ end
end
|
Add Integration spec for property new action.
|
diff --git a/.compass/config.rb b/.compass/config.rb
index abc1234..def5678 100644
--- a/.compass/config.rb
+++ b/.compass/config.rb
@@ -1,28 +1,22 @@-require 'compass-normalize'
-require 'susy'
+require "compass-normalize"
+require "susy"
# Set this to the root of your project when deployed:
http_path = "/"
-http_fonts_path = "http://revyver.s3.amazonaws.com/fonts/"
css_dir = "static/stylesheets"
-fonts_dir = "fonts"
+fonts_dir = "static/fonts"
images_dir = "static/images"
javascripts_dir = "static/javascripts"
sass_dir = "base/assets/sass"
# output_style = :compressed
-output_style = :expanded
-# output_style = (environment == :production) ? :compressed : :expanded
-
-# To enable relative paths to assets via compass helper functions. Uncomment:
-# relative_assets = true
-asset_host = #<Proc:0x007f9d13b899f0@/Users/Bryan/Code/Revyver/hello-ranking/config.rb:20>
+# output_style = :compact
+output_style = (environment == :production) ? :compressed : :compact
# To disable debugging comments that display the original location of your selectors. Uncomment:
line_comments = false
# line_comments = (environment == :production) ? false : true
-
# If you prefer the indented syntax, you might want to regenerate this
# project again passing --syntax sass, or you can uncomment this:
|
Remove the hardcoded font bit and other things.
|
diff --git a/sample/spec/spec_helper.rb b/sample/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/sample/spec/spec_helper.rb
+++ b/sample/spec/spec_helper.rb
@@ -4,6 +4,7 @@ require File.expand_path("../dummy/config/environment", __FILE__)
require 'rspec/rails'
require 'ffaker'
+require 'spree_sample'
RSpec.configure do |config|
config.color = true
|
Add require spree_sample to spec helper to prevent failure when running build.sh.
|
diff --git a/event_store-entity_store.gemspec b/event_store-entity_store.gemspec
index abc1234..def5678 100644
--- a/event_store-entity_store.gemspec
+++ b/event_store-entity_store.gemspec
@@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = 'event_store-entity_store'
- s.version = '0.1.4'
+ s.version = '0.2.0'
s.summary = 'Store of entities that are projected from EventStore streams'
s.description = ' '
|
Package version is increased from 0.1.4 to 0.2.0
|
diff --git a/lib/formalist/elements/standard/rich_text_area.rb b/lib/formalist/elements/standard/rich_text_area.rb
index abc1234..def5678 100644
--- a/lib/formalist/elements/standard/rich_text_area.rb
+++ b/lib/formalist/elements/standard/rich_text_area.rb
@@ -16,7 +16,7 @@
# Replace the form objects with their AST
attrs.merge(
- embeddable_forms: attrs[:embeddable_forms].map { |key, attrs|
+ embeddable_forms: Hash(attrs[:embeddable_forms]).map { |key, attrs|
original_attrs = attrs
adjusted_attrs = original_attrs.merge(form: original_attrs[:form].build.to_ast)
|
Support rich text areas without any embeddable forms
|
diff --git a/config/environments/development.rb b/config/environments/development.rb
index abc1234..def5678 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -33,5 +33,8 @@ config.assets.raise_runtime_errors = true
# Raises error for missing translations
- # config.action_view.raise_on_missing_translations = true
+ # config.action_view.raise_on_missing_translations = true # Set the default generator asset engines
+ config.generators.stylesheet_engine = :scss
+ config.generators.javascript_engine = :coffee
+
end
|
Update the default generator asset engines
|
diff --git a/config/environments/development.rb b/config/environments/development.rb
index abc1234..def5678 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -36,4 +36,5 @@ config.action_controller.action_on_unpermitted_parameters = :raise
config.action_mailer.default_url_options = { host: "hours.dev" }
+ config.action_dispatch.tld_length = 0
end
|
Add the tld_length action_dispatch config
Who uses linux and don't have an alternative like pow.
In the development environment the best option is to pass this value to the config.action_dispatch.tld_length.
Reference Link: https://github.com/rails/rails/issues/12438#issuecomment-25875656
|
diff --git a/config/environments/production.rb b/config/environments/production.rb
index abc1234..def5678 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -30,4 +30,9 @@ config.mx_checker = MxChecker.new
config.active_job.queue_adapter = :sidekiq
+
+ service_url = URI.parse(ENV.fetch('STAFF_SERVICE_URL'))
+
+ config.action_controller.default_url_options = { host: service_url.hostname }
+ config.action_controller.asset_host = service_url.hostname
end
|
Fix host header poison attack
Update config production to prevent against users being able to
input data that could redirect people away from the official site.
|
diff --git a/log.gemspec b/log.gemspec
index abc1234..def5678 100644
--- a/log.gemspec
+++ b/log.gemspec
@@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = 'log'
- s.version = '0.2.0.0'
+ s.version = '0.3.0.0'
s.summary = 'Logging to STD IO with levels, tagging, and coloring'
s.description = ' '
|
Package version is increased from 0.2.0.0 to 0.3.0.0
|
diff --git a/lib/syoboemon/program_infomation_accessor/program_detail_search.rb b/lib/syoboemon/program_infomation_accessor/program_detail_search.rb
index abc1234..def5678 100644
--- a/lib/syoboemon/program_infomation_accessor/program_detail_search.rb
+++ b/lib/syoboemon/program_infomation_accessor/program_detail_search.rb
@@ -1,7 +1,29 @@+#
+# Syoboemon::ProgramInfomationAccessor::ProgramDetailSearch
+#
+
+# json.phpとdb.phpを使って検索した番組に関する情報を参照するためのクラス
+
module Syoboemon
module ProgramInfomationAccessor
- class ProgramDetailSearch
+ class ProgramDetailSearch < Struct.new(:title, :title_id, :staffs, :casts, :opening_themes, :ending_themes)
+ def initialize(parsed_happymapper_object)
+ @results_of_program = parsed_happymapper_object
+ set_up_parameter_of_structure_members
+ end
+ private
+ def set_up_parameter_of_structure_members
+ self.title = @results_of_program.Title
+ self.title_id = @results_of_program.TID
+ self.staffs =
+ end
+
+ def split_element_of_comment
+ split_pattern = /"*スタッフ"|"*キャスト"|("オープニング"|"エンディング")*/
+ comment = @results_of_program.Comment
+ staff_and_casts = comment.split("¥n").map {|elem| elem.match()}
+ end
end
end
end
|
Add attributes of structure member
|
diff --git a/CTFeedback.podspec b/CTFeedback.podspec
index abc1234..def5678 100644
--- a/CTFeedback.podspec
+++ b/CTFeedback.podspec
@@ -5,7 +5,7 @@ s.homepage = "https://github.com/rizumita/CTFeedback"
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { "Ryoichi Izumita" => "r.izumita@caph.jp" }
- s.platform = :ios, '6.0'
+ s.platform = :ios, '8.0'
s.source = { :git => "https://github.com/rizumita/CTFeedback.git", :tag => "1.0.20" }
s.source_files = 'Classes', 'Classes/**/*.{h,m,plist}'
s.resource_bundles = { 'CTFeedback' => ['Resources/*.lproj', 'Resources/PlatformNames.plist'] }
|
Update minimum iOS version to 8.0
|
diff --git a/app/models/deployer_mailer.rb b/app/models/deployer_mailer.rb
index abc1234..def5678 100644
--- a/app/models/deployer_mailer.rb
+++ b/app/models/deployer_mailer.rb
@@ -8,20 +8,20 @@ def send_start(deploy, project)
@deploy = deploy
mail_subject = "[deploys] {#{project.abbreviation}} Notificación de despliegue #{deploy.deploy_name}"
- mail to: project.customers_deploys_notifications_emails, cc: project.deploys_notifications_emails, subject: mail_subject
+ mail to: project.customers_deploys_notifications_emails, bcc: project.deploys_notifications_emails, subject: mail_subject
end
def send_successful_end(deploy, project)
@deploy = deploy
mail_subject = "[deploys] {#{project.abbreviation}} Notificación de despliegue #{deploy.deploy_name}"
- mail to: project.customers_deploys_notifications_emails, cc: project.deploys_notifications_emails, subject: mail_subject
+ mail to: project.customers_deploys_notifications_emails, bcc: project.deploys_notifications_emails, subject: mail_subject
end
def send_rollback(deploy, project)
@deploy = deploy
mail_subject = "[deploys] {#{project.abbreviation}} Notificación de despliegue #{deploy.deploy_name}"
- mail to: project.customers_deploys_notifications_emails, cc: project.deploys_notifications_emails, subject: mail_subject
+ mail to: project.customers_deploys_notifications_emails, bcc: project.deploys_notifications_emails, subject: mail_subject
end
end
|
Send mails to company as bcc
|
diff --git a/app/models/landable/author.rb b/app/models/landable/author.rb
index abc1234..def5678 100644
--- a/app/models/landable/author.rb
+++ b/app/models/landable/author.rb
@@ -11,15 +11,15 @@ end
def can_read
- access_tokens.fresh.first.can_read? if access_tokens.fresh
+ access_tokens.fresh.first.can_read?
end
def can_edit
- access_tokens.fresh.first.can_edit? if access_tokens.fresh
+ access_tokens.fresh.first.can_edit?
end
def can_publish
- access_tokens.fresh.first.can_publish? if access_tokens.fresh
+ access_tokens.fresh.first.can_publish?
end
end
end
|
Remove conditional on can_read?, can_edit? and can_publisH? methods
|
diff --git a/app/controllers/confirmations_controller.rb b/app/controllers/confirmations_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/confirmations_controller.rb
+++ b/app/controllers/confirmations_controller.rb
@@ -1,17 +1,18 @@ class ConfirmationsController < Devise::ConfirmationsController
def show
confirmation_token = Devise.token_generator.
- digest(self, :confirmation_token, token)
- self.resource = resource_class.find_by(confirmation_token: confirmation_token)
+ digest(self, :confirmation_token, token_param)
+ self.resource = resource_class.
+ find_by(confirmation_token: confirmation_token)
- super if resource.nil? or resource.confirmed?
+ super unless resource
end
def confirm
- self.resource = resource_class.find_by(confirmation_token: token)
+ self.resource = resource_class.find_by(confirmation_token: token_param)
resource.assign_attributes(permitted_params)
- if resource.valid? && resource.password_match?
+ if resource.valid?
resource.confirm!
set_flash_message :notice, :confirmed
sign_in_and_redirect resource_name, resource
@@ -26,7 +27,7 @@ params.require(resource_name).permit(:confirmation_token, :password, :password_confirmation)
end
- def token
+ def token_param
params[:confirmation_token] ||
params[resource_name].try(:[], :confirmation_token)
end
|
Refactor confirmations controller to remove duplication
|
diff --git a/metadata.rb b/metadata.rb
index abc1234..def5678 100644
--- a/metadata.rb
+++ b/metadata.rb
@@ -1,8 +1,8 @@ name 'atom'
-maintainer 'Mohit Sethi'
-maintainer_email 'mohit@sethis.in'
-license 'Apache v2.0'
-description 'Installs/Configures the Atom text editor'
+maintainer 'Sous Chefs'
+maintainer_email 'help@sous-chefs.org'
+license 'Apache-2.0'
+description 'Installs/Configures the Atom text editor - a hackable editor based on Electron, maintained by GitHub'
long_description 'Installs/Configures the Atom text editor - a hackable editor based on Electron, maintained by GitHub'
version '0.2.0'
|
Update maintainer and use standard SPDX license string
Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
|
diff --git a/metadata.rb b/metadata.rb
index abc1234..def5678 100644
--- a/metadata.rb
+++ b/metadata.rb
@@ -4,4 +4,4 @@ license "Apache 2.0"
description "System Software configuration and maintenance"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
-version "0.41.3"
+version "0.42.0"
|
Split account databag handling into a separate recipe
|
diff --git a/metadata.rb b/metadata.rb
index abc1234..def5678 100644
--- a/metadata.rb
+++ b/metadata.rb
@@ -4,7 +4,7 @@ license 'Apache 2.0'
description 'Installs and configures MySQL client and server'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
-version '1.0.8'
+version '1.0.9'
dependencies = %w(
apt
|
Add revoke option in access_grants
|
diff --git a/Casks/overdrive-media-console.rb b/Casks/overdrive-media-console.rb
index abc1234..def5678 100644
--- a/Casks/overdrive-media-console.rb
+++ b/Casks/overdrive-media-console.rb
@@ -0,0 +1,18 @@+cask :v1 => 'overdrive-media-console' do
+ version '1.2'
+ sha256 '6e04ac61337647aa86c67d04d62552a0c0a31a3104bf4856aa726e8317272be9'
+
+ url 'http://app.overdrive.com/downloads/ODMediaConsoleSetup.dmg'
+ name 'OverDrive Media Console'
+ homepage 'https://www.overdrive.com/'
+ license :commercial
+
+ pkg "OverDrive-Mac-Installer-Version-#{version}.pkg", :allow_untrusted => true
+
+ uninstall :pkgutil => 'com.overdrive.overdriveMediaConsole.*'
+
+ zap :delete => [
+ '~/Library/Preferences/com.overdrive.overdrivemediaconsole.plist',
+ '~/Library/Caches/com.overdrive.overdrivemediaconsole',
+ ]
+end
|
Add Overdrive Media Console v1.2
|
diff --git a/config/deploy.rb b/config/deploy.rb
index abc1234..def5678 100644
--- a/config/deploy.rb
+++ b/config/deploy.rb
@@ -20,6 +20,8 @@ role :web, domain
role :db, domain, :primary => true
+after 'deploy:update_code', 'deploy:symlink_settings'
+
namespace :deploy do
task :start, :roles => :app do
run "touch #{current_release}/tmp/restart.txt"
@@ -33,4 +35,9 @@ task :restart, :roles => :app do
run "touch #{current_release}/tmp/restart.txt"
end
+
+ desc 'Symlink the settings file'
+ task :symlink_settings, :roles => :app do
+ run "ln -s #{shared_path}/settings.yml #{current_release}/config/settings.yml"
+ end
end
|
Add the deply:symlink_settings capistrano task
|
diff --git a/config/deploy.rb b/config/deploy.rb
index abc1234..def5678 100644
--- a/config/deploy.rb
+++ b/config/deploy.rb
@@ -14,7 +14,7 @@ set :runner, 'deploy'
set :deploy_to, "/home/#{application}"
set :app_server, :passenger
-set :domain, '67.23.79.60'
+set :domain, '67.23.79.117'
role :app, domain
role :web, domain
|
Move to the new server
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,7 +1,7 @@ Rails.application.routes.draw do
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
resources :users
- resources :games, except: :edit
+ resources :games, except: [:edit, :index, :show, :update]
root to: "home#index"
end
|
Add exceptions to games route
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,6 +1,6 @@ ActionController::Routing::Routes.draw do |map|
map.congress_person 'congress_people/:id', :controller => 'congress_people', :action => 'show'
- map.zip 'zip/:q', :controller => 'localities', :action => 'show'
+ map.zip ':q', :controller => 'localities', :action => 'show'
map.root :controller => 'localities', :action => 'index'
end
|
Remove zip/ from zip_path to match page titles
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,3 +1,7 @@ Rails.application.routes.draw do
+ get 'static_pages/home'
+
+ get 'static_pages/help'
+
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
end
|
Add a Static Pages controller
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -2,9 +2,8 @@
Diffux::Application.routes.draw do
mount Sidekiq::Web => '/sidekiq'
- resources :refresh, only: :create
- scope '/:locale' do
+ scope '(:locale)' do
get 'static_pages/about'
resources :projects do
@@ -27,8 +26,8 @@ end
end
+ resources :refresh, only: :create
+
root to: 'projects#index'
end
-
- get '/', to: redirect('/en')
end
|
Allow locale in URL to be optional
When I first added URL-based locale specification, I made it required
and had `/` redirect to `/en`. However, I realized that it would be
better to just make it optional. This will allow routes like refresh and
sweep triggering to work as they did without any change, but to also
optionally specify a locale.
Change-Id: Ib75ffe8bb4c2396dd41f9e89d788ed368255682c
|
diff --git a/spec/defines/repo_spec.rb b/spec/defines/repo_spec.rb
index abc1234..def5678 100644
--- a/spec/defines/repo_spec.rb
+++ b/spec/defines/repo_spec.rb
@@ -13,9 +13,7 @@ :command => /aptly repo create example$/,
:unless => /aptly repo show example >\/dev\/null$/,
:user => 'root',
- :require => [
- 'Class[Aptly]'
- ],
+ :require => 'Class[Aptly]',
})
}
end
@@ -30,9 +28,7 @@ :command => /aptly repo create -component="third-party" example$/,
:unless => /aptly repo show example >\/dev\/null$/,
:user => 'root',
- :require => [
- 'Class[Aptly]'
- ],
+ :require => 'Class[Aptly]',
})
}
@@ -53,9 +49,7 @@ :command => /aptly repo create -component="third-party" example$/,
:unless => /aptly repo show example >\/dev\/null$/,
:user => 'custom_user',
- :require => [
- 'Class[Aptly]'
- ],
+ :require => 'Class[Aptly]',
})
}
end
|
Fix syntax around class require in tests
This test is failing on the version of Rspec that Travis runs tests
with, so update the syntax.
|
diff --git a/spec/requests/api_spec.rb b/spec/requests/api_spec.rb
index abc1234..def5678 100644
--- a/spec/requests/api_spec.rb
+++ b/spec/requests/api_spec.rb
@@ -18,7 +18,7 @@ stub_request(:get, "https://account.radiusnetworks.com/auth/radius/user.json?oauth_token=123")
.to_return(status: 200, body: json)
- get api_index_path, nil, headers_with_token("123")
+ get api_index_path, params: {}, headers: headers_with_token("123")
expect(response.status).to be 200
end
|
Fix Rails 5 deprecation warning for `get` request spec
DEPRECATION WARNING:
`ActionDispatch::IntegrationTest` HTTP request methods will accept only
the following keyword arguments in future Rails versions:
params, headers, env, xhr, as
Examples:
get '/profile',
params: { id: 1 },
headers: { 'X-Extra-Header' => '123' },
env: { 'action_dispatch.custom' => 'custom' },
xhr: true,
as: :json
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.