diff stringlengths 65 26.7k | message stringlengths 7 9.92k |
|---|---|
diff --git a/010-summation-of-primes/solution.rb b/010-summation-of-primes/solution.rb
index abc1234..def5678 100644
--- a/010-summation-of-primes/solution.rb
+++ b/010-summation-of-primes/solution.rb
@@ -2,10 +2,11 @@
# Find the sum of all the primes below two million.
+start_time = Time.now
+
require 'prime'
-solution = Prime.each(2_000_000).reduce(:+)
-
-p solution
+p Prime.each(2_000_000).reduce(:+)
+p "calculated in #{(Time.now - start_time) * 1000} ms"
# => 142913828922
| Add timer and refactor for simplicity
|
diff --git a/lib/aql/node/operator/binary.rb b/lib/aql/node/operator/binary.rb
index abc1234..def5678 100644
--- a/lib/aql/node/operator/binary.rb
+++ b/lib/aql/node/operator/binary.rb
@@ -15,6 +15,11 @@ #
def emit(buffer)
buffer.binary(left, operator, right)
+ end
+
+ # Binary assignment operator
+ class Assignment < self
+ SYMBOL = :'='
end
# Binary equality operator
| Add support for assignment operator
|
diff --git a/lib/backlog_kit/client/group.rb b/lib/backlog_kit/client/group.rb
index abc1234..def5678 100644
--- a/lib/backlog_kit/client/group.rb
+++ b/lib/backlog_kit/client/group.rb
@@ -1,23 +1,48 @@ module BacklogKit
class Client
+
+ # Methods for the Group API
module Group
+
+ # Get list of groups
+ #
+ # @param params [Hash] Request parameters
+ # @return [BacklogKit::Response] List of groups
def get_groups(params = {})
get('groups', params)
end
+ # Get a group
+ #
+ # @param group_id [Integer, String] Group id
+ # @return [BacklogKit::Response] The group information
def get_group(group_id)
get("groups/#{group_id}")
end
+ # Create a new group
+ #
+ # @param name [String] Group name
+ # @param params [Hash] Request parameters
+ # @return [BacklogKit::Response] The group information
def create_group(name, params = {})
params.merge!(name: name)
post('groups', params)
end
+ # Update a group
+ #
+ # @param group_id [Integer, String] Group id
+ # @param params [Hash] Request parameters
+ # @return [BacklogKit::Response] The group information
def update_group(group_id, params = {})
patch("groups/#{group_id}", params)
end
+ # Delete a group
+ #
+ # @param group_id [Integer, String] Group id
+ # @return [BacklogKit::Response] The group information
def delete_group(group_id)
delete("groups/#{group_id}")
end
| Add documentation for the Group API
|
diff --git a/PKYStepper.podspec b/PKYStepper.podspec
index abc1234..def5678 100644
--- a/PKYStepper.podspec
+++ b/PKYStepper.podspec
@@ -1,9 +1,9 @@ Pod::Spec.new do |s|
s.name = "PKYStepper"
s.version = "0.0.1"
- s.summary = "Customizable Stepper Control"
+ s.summary = "UIControl with label & stepper combined"
s.description = <<-DESC
- A customizabel stepper control with stepper & label combined.
+ A customizable UIControl with label & stepper combined.
DESC
s.license = { :type => "MIT", :file => "LICENSE" }
s.author = { "yohei okada" => "okada.yohei@gmail.com" }
| Change explanation of library in pod spec |
diff --git a/lib/helpers/number_formatter.rb b/lib/helpers/number_formatter.rb
index abc1234..def5678 100644
--- a/lib/helpers/number_formatter.rb
+++ b/lib/helpers/number_formatter.rb
@@ -10,7 +10,7 @@ end
def with_commas
- self.to_s.reverse.gsub(/...(?=.)/,'\&,').reverse
+ self.to_s.reverse.gsub(/...(?!-)(?=.)/,'\&,').reverse
end
end
| Refactor with_commas method to work with negative numbers
|
diff --git a/lib/siebel_donations/contact.rb b/lib/siebel_donations/contact.rb
index abc1234..def5678 100644
--- a/lib/siebel_donations/contact.rb
+++ b/lib/siebel_donations/contact.rb
@@ -2,7 +2,7 @@ class Contact < Base
attr_reader :id, :primary, :first_name, :preferred_name, :middle_name, :last_name,
- :title, :sufix, :sex, :phone_numbers, :email_addresses
+ :title, :suffix, :sex, :phone_numbers, :email_addresses
def initialize(json = {})
super
| Fix typo in attribute name
|
diff --git a/app/controllers/problems_controller.rb b/app/controllers/problems_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/problems_controller.rb
+++ b/app/controllers/problems_controller.rb
@@ -29,8 +29,13 @@ private
def post_to_twitter(problem)
- message = "I just offered a solution to #{problem.issue.name}" +
+ if problem.issue.present?
+ message = "I just offered a solution to #{problem.issue.name}" +
" - #{problem_url(problem)}"
+ else
+ message = "I just offered a solution. Check it out:" +
+ " - #{problem_url(problem)}"
+ end
current_user.post_to_twitter(message)
end
end | Add conditional to check for issue
|
diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/sessions_controller.rb
+++ b/app/controllers/sessions_controller.rb
@@ -5,14 +5,14 @@ end
def create
- login(params)
+ login
binding.pry
redirect_to root_path
end
def destroy
- session.delete :name
+ session.delete :user_id
redirect_to root_path
end
@@ -22,13 +22,25 @@ params.require(:user).permit(:email, :password)
end
- def login(params)
- if params[:user]
- @user = User.find_by(email: params[:user][:email])
- if @user.authenticate(params[:user][:password])
- session[:user_id] = @user.id
- end
+ def login
+ request.env['omniauth.auth'] ? omniauth_authenticate : bcrypt_authenticate
end
-end
+
+ def omniauth_authenticate
+ user = User.find_or_create_by(uid: auth['uid'])
+ end
+
+ def auth
+ request.env['omniauth.auth']
+ end
+
+ def bcrypt_authenticate
+ user = User.find_by(email: params[:user][:email])
+ if user && user.authenticate(params[:user][:password])
+ session[:user_id] = user.id
+ else
+ flash.alert = "Login failed. Please try again or create an account."
+ end
+ end
end
| Build .login and .bcrypt_authenticate methods
|
diff --git a/spec/locate_images_spec.rb b/spec/locate_images_spec.rb
index abc1234..def5678 100644
--- a/spec/locate_images_spec.rb
+++ b/spec/locate_images_spec.rb
@@ -4,8 +4,4 @@ it "has a version number" do
expect(LocateImages::VERSION).not_to be nil
end
-
- it "does something useful" do
- expect(false).to eq(true)
- end
end
| Remove failing spec... no specs for now. :)
|
diff --git a/spec/models/person_spec.rb b/spec/models/person_spec.rb
index abc1234..def5678 100644
--- a/spec/models/person_spec.rb
+++ b/spec/models/person_spec.rb
@@ -0,0 +1,12 @@+require 'spec_helper'
+require 'models/person'
+
+describe Person do
+ subject(:person) { Fabricate(:person) }
+
+ describe '#access_token' do
+ it 'has an autogenerated UUID token' do
+ expect(person.access_token.length).to eq 36
+ end
+ end
+end
| Add smoketest for tokens autogeneration
|
diff --git a/db/migrate/20160825141026_add_links_to_travel_advice.rb b/db/migrate/20160825141026_add_links_to_travel_advice.rb
index abc1234..def5678 100644
--- a/db/migrate/20160825141026_add_links_to_travel_advice.rb
+++ b/db/migrate/20160825141026_add_links_to_travel_advice.rb
@@ -0,0 +1,7 @@+class AddLinksToTravelAdvice < ActiveRecord::Migration
+ def change
+ Link.find_each("passthrough_hash IS NOT NULL") do |link|
+ link.update_attributes!(target_content_id: link.passthrough_hash[:content_id])
+ end
+ end
+end
| Move passthrough hash content id to the target link
This copies the content id in the passthrough hash so when we drop this
column we don't lose any behaviour. Dependency resolution acts in the
same way, and produces the same structure.
|
diff --git a/lib/core/repository/news/public_website.rb b/lib/core/repository/news/public_website.rb
index abc1234..def5678 100644
--- a/lib/core/repository/news/public_website.rb
+++ b/lib/core/repository/news/public_website.rb
@@ -26,8 +26,8 @@ raise RequestError, 'Unable to fetch News JSON from Public Website'
end
- def all
- response = connection.get('/%{locale}/news.json' % {locale: I18n.locale})
+ def all(page=1)
+ response = connection.get('/%{locale}/news.json?page_number=%{page}' % {locale: I18n.locale, page: page})
response.body
rescue
raise RequestError, 'Unable to fetch News JSON from Public Website'
| Add pagination to the public website request
|
diff --git a/realtime.gemspec b/realtime.gemspec
index abc1234..def5678 100644
--- a/realtime.gemspec
+++ b/realtime.gemspec
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
s.name = "realtime"
s.version = Realtime::VERSION
- s.authors = ["Mike Atlas"]
+ s.authors = ["Mike Atlas", "Ahmad Abdel-Yaman (@ayaman)"]
s.email = ["mike.atlas@gmail.com"]
s.homepage = "http://mikeatlas.github.io/realtime-rails/"
s.summary = "Realtime support for Rails applications."
| Update gemspec to include credit for @ayaman |
diff --git a/lib/stripe_mock/request_handlers/events.rb b/lib/stripe_mock/request_handlers/events.rb
index abc1234..def5678 100644
--- a/lib/stripe_mock/request_handlers/events.rb
+++ b/lib/stripe_mock/request_handlers/events.rb
@@ -26,19 +26,19 @@
if params[:created].is_a?(Hash)
if params[:created][:gt]
- event_list.select! { |event| event[:created] > params[:created][:gt].to_i }
+ event_list = event_list.select { |event| event[:created] > params[:created][:gt].to_i }
end
if params[:created][:gte]
- event_list.select! { |event| event[:created] >= params[:created][:gte].to_i }
+ event_list = event_list.select { |event| event[:created] >= params[:created][:gte].to_i }
end
if params[:created][:lt]
- event_list.select! { |event| event[:created] < params[:created][:lt].to_i }
+ event_list = event_list.select { |event| event[:created] < params[:created][:lt].to_i }
end
if params[:created][:lte]
- event_list.select! { |event| event[:created] <= params[:created][:lte].to_i }
+ event_list = event_list.select { |event| event[:created] <= params[:created][:lte].to_i }
end
else
- event_list.select! { |event| event[:created] == params[:created].to_i }
+ event_list = event_list.select { |event| event[:created] == params[:created].to_i }
end
event_list
end
| Use select instead of select!
|
diff --git a/SwiftCheck.podspec b/SwiftCheck.podspec
index abc1234..def5678 100644
--- a/SwiftCheck.podspec
+++ b/SwiftCheck.podspec
@@ -0,0 +1,40 @@+Pod::Spec.new do |s|
+ s.name = "SwiftCheck"
+ s.version = "0.3.0"
+ s.summary = "QuickCheck for Swift."
+ s.homepage = "https://github.com/typelift/SwiftCheck"
+ s.license = { :type => "MIT", :text => <<-LICENSE
+ The MIT License (MIT)
+
+ Copyright (c) 2015 TypeLift
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+
+ LICENSE
+ }
+ s.authors = { "CodaFi" => "devteam.codafi@gmail.com", "pthariensflame" => "alexanderaltman@me.com" }
+
+ s.requires_arc = true
+ s.osx.deployment_target = "10.9"
+ s.ios.deployment_target = "8.0"
+ s.framework = "XCTest"
+ s.source = { :git => "https://github.com/typelift/SwiftCheck.git", :tag => "v#{s.version}", :submodules => true }
+ s.source_files = "SwiftCheck/*.swift", "**/Operadics/*.swift"
+end
+
| Add a pod spec for 2.0
|
diff --git a/db/seeds/refinery_settings.rb b/db/seeds/refinery_settings.rb
index abc1234..def5678 100644
--- a/db/seeds/refinery_settings.rb
+++ b/db/seeds/refinery_settings.rb
@@ -20,7 +20,8 @@ :nl => 'Nederlands',
:'pt-BR' => 'Português',
:da => 'Dansk',
- :nb => 'Norsk Bokmål'
+ :nb => 'Norsk Bokmål',
+ :sl => 'Slovenian'
}
}
].each do |setting|
| Add Slovenian language to refinery_i18n_locale
|
diff --git a/0_code_wars/substring_fun.rb b/0_code_wars/substring_fun.rb
index abc1234..def5678 100644
--- a/0_code_wars/substring_fun.rb
+++ b/0_code_wars/substring_fun.rb
@@ -0,0 +1,5 @@+# http://www.codewars.com/kata/565b112d09c1adfdd500019c/
+# --- iteration 1 ---
+def nth_char(words)
+ (0...words.count).map{ |i| words[i][i] }.join
+end
| Add code wars (7) substring fun
|
diff --git a/db/migrate/20140813160314_send_message_about_groups.rb b/db/migrate/20140813160314_send_message_about_groups.rb
index abc1234..def5678 100644
--- a/db/migrate/20140813160314_send_message_about_groups.rb
+++ b/db/migrate/20140813160314_send_message_about_groups.rb
@@ -0,0 +1,27 @@+# -*- encoding : utf-8 -*-
+class SendMessageAboutGroups < ActiveRecord::Migration
+
+ MESSAGE_TITLE = 'Gestion des droits et des groupes'
+
+ def up
+ Station.find_each(:batch_size => 50) do |s|
+ s.owner.messages.create(:title => MESSAGE_TITLE,
+ :body => <<EOF
+<p>Bonjour,</p>
+<p>Dès aujourd'hui vous avez la possibilité de gérer les droits des utilisateurs
+de votre compte SP-Gestion. Pour celà vous devez créer des groupes
+(menu "Administration > Groupes") et spécifier les droits de ce groupe ainsi
+que les utilisateurs membres de ce groupe.</p>
+<p>Un utilisateur ne peut être membre que d'un seul groupe et les utilisateurs
+qui n'appartiennent pas à un groupe ont les mêmes droits qu'aujourd'hui.</p>
+<p>L'équipe SP-Gestion (<a href="mailto:contact@sp-gestion.fr">contact@sp-gestion.fr</a>)</p>
+<p>PS : il est possible de consulter ce message à tout moment via le menu "Accueil > Messages".</p>
+EOF
+ )
+ end
+ end
+
+ def down
+ Message.where(:title => MESSAGE_TITLE).delete_all
+ end
+end
| Send message about new group/user rights feature.
|
diff --git a/BulletinBoard.podspec b/BulletinBoard.podspec
index abc1234..def5678 100644
--- a/BulletinBoard.podspec
+++ b/BulletinBoard.podspec
@@ -16,4 +16,5 @@ s.source_files = "Sources/**/*"
s.frameworks = "UIKit"
s.documentation_url = "https://alexaubry.github.io/BulletinBoard"
+ s.module_name = "BLTNBoard"
end
| Set module name to "BLTNBoard" in pod spec
|
diff --git a/lib/intercode/import/intercode1/tables/store_order_entries.rb b/lib/intercode/import/intercode1/tables/store_order_entries.rb
index abc1234..def5678 100644
--- a/lib/intercode/import/intercode1/tables/store_order_entries.rb
+++ b/lib/intercode/import/intercode1/tables/store_order_entries.rb
@@ -1,4 +1,6 @@-class Intercode::Import::Intercode1::Tables::StoreOrderEntries < Intercode::Import::Intercode1::Table
+class Intercode::Import::Intercode1::Tables::StoreOrderEntries <
+ Intercode::Import::Intercode1::Table
+
attr_reader :con, :order_id_map, :product_id_map
def initialize(connection, order_id_map, product_id_map)
| Break up a long line
|
diff --git a/jekyll-agency.gemspec b/jekyll-agency.gemspec
index abc1234..def5678 100644
--- a/jekyll-agency.gemspec
+++ b/jekyll-agency.gemspec
@@ -12,7 +12,7 @@ end
spec.required_ruby_version = '>= 2.5.0'
- spec.add_runtime_dependency "jekyll", "~> 4.0.0"
+ spec.add_runtime_dependency "jekyll", ">= 4.0", "< 4.2"
spec.add_development_dependency "bundler", "~> 2.0"
spec.add_development_dependency "rake", "~> 13.0"
end
| Update jekyll requirement from ~> 4.0.0 to >= 4.0, < 4.2
Updates the requirements on [jekyll](https://github.com/jekyll/jekyll) to permit the latest version.
- [Release notes](https://github.com/jekyll/jekyll/releases)
- [Changelog](https://github.com/jekyll/jekyll/blob/master/History.markdown)
- [Commits](https://github.com/jekyll/jekyll/compare/v4.0.0...v4.1.0)
Signed-off-by: dependabot[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@github.com> |
diff --git a/app/controllers/api/v1/customers.rb b/app/controllers/api/v1/customers.rb
index abc1234..def5678 100644
--- a/app/controllers/api/v1/customers.rb
+++ b/app/controllers/api/v1/customers.rb
@@ -35,8 +35,8 @@
desc "Get all customer's discount cards with barcodes"
post 'full_info' do
- current_customer.as_json(include:
- { discount_cards: { include: :barcode } }).to_json
+ current_customer.to_json(include:
+ { discount_cards: { include: :barcode } })
end
desc "Update current customer's info"
| Make /full_info api return discount cards with barcodes
|
diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/games_controller.rb
+++ b/app/controllers/games_controller.rb
@@ -1,6 +1,6 @@ class GamesController < ApplicationController
def index
- @games = Game.page(params[:page]).decorate
+ @games = Game.includes(:pictures).page(params[:page]).decorate
end
def show
| Optimize a db query on the game index page
|
diff --git a/app/controllers/index_controller.rb b/app/controllers/index_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/index_controller.rb
+++ b/app/controllers/index_controller.rb
@@ -13,6 +13,8 @@ case params[:id]
when 'gTrmpuvlhFtL3v0N2Rkhk9GBxkzXsnkfwyf_-XWRsj0'
render text: 'gTrmpuvlhFtL3v0N2Rkhk9GBxkzXsnkfwyf_-XWRsj0.3agPbEGMW8yyXAdNJmtYhleq07pUgmnN1oCrhN9iRwA'
+ when "GmEiT2D0UoKH2AHimAjBr45hrmMyMhYhw7hNipFxa-0"
+ render text: "GmEiT2D0UoKH2AHimAjBr45hrmMyMhYhw7hNipFxa-0.jOl0WYrEi5GTa1BlXCSMh31NLeYmWZbZA_QaK-ZpnIE"
else
render text: "#{params[:id]}.x2TXuRtPY5PkPL4YMeiKaMl4xBtFrjfOe94AR0Iyg1M"
end
| Update SSL challenge response for March 2017
|
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,16 +1,12 @@ class PagesController < ApplicationController
def letsencrypt
case params[:id]
- when 'JAb6nuC9AlgQQN0LKe42K1zaNM12DyfaKyRAA4TyCaQ'
- render text: 'JAb6nuC9AlgQQN0LKe42K1zaNM12DyfaKyRAA4TyCaQ.x2TXuRtPY5PkPL4YMeiKaMl4xBtFrjfOe94AR0Iyg1M'
when "gTrmpuvlhFtL3v0N2Rkhk9GBxkzXsnkfwyf_-XWRsj0"
- render text: 'gTrmpuvlhFtL3v0N2Rkhk9GBxkzXsnkfwyf_-XWRsj0.3agPbEGMW8yyXAdNJmtYhleq07pUgmnN1oCrhN9iRwA'
- when 'ErjilUseIpcU9EqaUP2Pz-z48Bqe1DsdU-MbS_zX4eI'
- render text: 'ErjilUseIpcU9EqaUP2Pz-z48Bqe1DsdU-MbS_zX4eI.x2TXuRtPY5PkPL4YMeiKaMl4xBtFrjfOe94AR0Iyg1M'
+ render text: "#{params[:id]}.3agPbEGMW8yyXAdNJmtYhleq07pUgmnN1oCrhN9iRwA"
when "OLj4hja-R9m7nOL2UWmj8jG-WlnX7Y2XJqGPEJ_WGXc"
- render text: 'OLj4hja-R9m7nOL2UWmj8jG-WlnX7Y2XJqGPEJ_WGXc.3agPbEGMW8yyXAdNJmtYhleq07pUgmnN1oCrhN9iRwA'
+ render text: "#{params[:id]}.3agPbEGMW8yyXAdNJmtYhleq07pUgmnN1oCrhN9iRwA"
else
- head :not_found
+ render text: "#{params[:id]}.x2TXuRtPY5PkPL4YMeiKaMl4xBtFrjfOe94AR0Iyg1M"
end
end
end
| Simplify domain validation code for re-tries |
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
@@ -4,11 +4,11 @@ before_action :set_pages, only: :index
before_action :set_activity_log, only: [:new, :edit]
+ protected
+
def save_page
PageRegister.new(@page, params: params, current_user: current_user).save
end
-
- protected
def set_activity_log
@activity_logs = ActivityLogPresenter.collect(ActivityLog.fetch(from: @page))
| Make save page a protected method like comfy code
|
diff --git a/app/controllers/picks_controller.rb b/app/controllers/picks_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/picks_controller.rb
+++ b/app/controllers/picks_controller.rb
@@ -17,9 +17,11 @@ if params[:commit]=="signup"
redirect_to edit_user_path(@user.id), locals: {email: params[:email]}
else
- redirect_to root_path
+ flash[:error] = 'email sent'
+ redirect_to root_path
end
else
+ flash[:error] = 'failed to create entry.. try again'
redirect_to root_path
end
end
| Add message to pick controller
|
diff --git a/app/controllers/plans_controller.rb b/app/controllers/plans_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/plans_controller.rb
+++ b/app/controllers/plans_controller.rb
@@ -1,21 +1,20 @@ class PlansController < ApplicationController
+ before_action :set_plan, only: [:show, :edit, :update]
+
def index
@plans = @user.current_twelve_months_of_plans
@past_plans = @user.past_plans
end
def show
- @plan = Plan.find(params[:id])
@purchases_pending = @plan.purchases_pending
@purchases_paid = @plan.purchases_paid_for
end
def edit
- @plan = Plan.find(params[:id])
end
def update
- @plan = Plan.find(params[:id])
if @plan.update(plan_params)
flash[:success] = "Your income was successfully updated!"
redirect_to @plan
@@ -26,6 +25,10 @@
private
+ def set_plan
+ @plan = Plan.find(params[:id])
+ end
+
def plan_params
params.require(:plan).permit(:income)
end
| Add callback to set plan for controller actions
|
diff --git a/app/controllers/stats_controller.rb b/app/controllers/stats_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/stats_controller.rb
+++ b/app/controllers/stats_controller.rb
@@ -9,9 +9,9 @@ def create
if authorized?
StatsD.increment(params[:key])
- head(:ok, content_length: 0)
+ render(nothing: true)
else
- head(:forbidden, content_length: 0)
+ render(nothing: true, status: :forbidden)
end
end
| Revert "Set content length header to 0 on stats post responses."
This reverts commit b7b3b2e0c36605ef4addefce71f3470ac0d76282.
|
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
@@ -4,40 +4,29 @@ end
def show
- user = User.find_by_id(params['id'])
- if user
- render json: user.to_json(include: :favorite_parks)
- else
- send_status(:not_found)
- end
+ user = User.find(params['id'])
+ render json: user.to_json(
+ include: :favorite_parks)
end
def create
- user = new_user
+ user = User.new(user_params)
if user.save
render json: user
else
- send_status(:bad_request)
+ send_status(:unprocessable_entity)
end
end
def destroy
- if User.find_and_destroy(params['id'])
- send_status(:no_content)
- else
- send_status(:bad_request)
- end
+ User.destroy(params['id'])
+ send_status(:no_content)
end
private
def user_params
- JSON.parse(params['user'])
- end
-
- def new_user
- User.new(
- name: user_params['name'],
- email: user_params['email'])
+ { name: JSON.parse(params['user'])['name'],
+ email: JSON.parse(params['user'])['email'] }
end
end
| Refactor user controller.. now its lookin reaaaalll nice
|
diff --git a/lib/generators/rafters/component/component_generator.rb b/lib/generators/rafters/component/component_generator.rb
index abc1234..def5678 100644
--- a/lib/generators/rafters/component/component_generator.rb
+++ b/lib/generators/rafters/component/component_generator.rb
@@ -1,5 +1,7 @@ class Rafters::ComponentGenerator < Rails::Generators::NamedBase
source_root File.expand_path("../templates", __FILE__)
+ class_option :stylesheet, type: :boolean, default: true, description: "Include stylesheet file"
+ class_option :javascript, type: :boolean, default: true, description: "Include Javascript file"
def create_directories
empty_directory "#{base_directory}"
@@ -17,8 +19,8 @@
def create_files
template "component.rb.erb", "#{base_directory}/#{file_name}_component.rb"
- template "assets/javascripts/component.js.erb", "#{base_directory}/assets/javascripts/#{file_name}_component.js"
- template "assets/stylesheets/component.scss.erb", "#{base_directory}/assets/stylesheets/#{file_name}_component.scss"
+ template "assets/javascripts/component.js.erb", "#{base_directory}/assets/javascripts/#{file_name}_component.js" if options.javascript?
+ template "assets/stylesheets/component.scss.erb", "#{base_directory}/assets/stylesheets/#{file_name}_component.scss" if options.stylesheet?
template "views/component.html.erb", "#{base_directory}/views/#{file_name}_component.html.erb"
end
| Make stylesheet and javascript optional in the generator
|
diff --git a/lib/oxford_learners_dictionaries/english.rb b/lib/oxford_learners_dictionaries/english.rb
index abc1234..def5678 100644
--- a/lib/oxford_learners_dictionaries/english.rb
+++ b/lib/oxford_learners_dictionaries/english.rb
@@ -1,6 +1,5 @@ require 'nokogiri'
require 'open-uri'
-require 'pry-meta'
module OxfordLearnersDictionaries
class English
@@ -14,6 +13,7 @@ @urls = [ main_url, main_url.gsub('?q=', '1?q=') ]
@word = formatted_word
@definition = Array.new
+ self
end
def look_up
@@ -28,6 +28,7 @@ return nil if @page.nil?
parse
+ self
end
private
| Return self in English class after looking up for a word
|
diff --git a/lib/manageiq/providers/ovirt/legacy/event_monitor.rb b/lib/manageiq/providers/ovirt/legacy/event_monitor.rb
index abc1234..def5678 100644
--- a/lib/manageiq/providers/ovirt/legacy/event_monitor.rb
+++ b/lib/manageiq/providers/ovirt/legacy/event_monitor.rb
@@ -12,7 +12,6 @@ end
def start
- trap(:TERM) { $rhevm_log.info "EventMonitor#start: ignoring SIGTERM" }
@since = nil
@event_fetcher = nil
@monitor_events = true
| Remove seemingly unnecessary ignoring of SIGTERM
It was added originally back in 2011 in manageiq:
946657b11a0a65abbcdca9975206d71f7c2b7afc
This was actually copied from the vmware vim monitoring events
code from 2009: 22a911716b40428b6d822f0f1e95aabd022e59c9
```
def monitorEvents
raise "monitorEvents: no block given" if !block_given?
trap(:TERM) { $log.info "monitorEvents: ignoring SIGTERM" }
...
```
First of all, trap with logging doesn't work since ruby 2.0+:
```
irb(main):001:0> require 'logger'
=> true
irb(main):002:0> trap(:TERM) { Logger.new("stdout").info
"EventMonitor#start: ignoring SIGTERM" }
=> "DEFAULT"
irb(main):003:0> `kill #{Process.pid}`
log writing failed. can't be called from trap context
=> ""
```
See https://github.com/ManageIQ/manageiq/pull/2386
Second, we need to TERM processes in container land.
|
diff --git a/rencoder.gemspec b/rencoder.gemspec
index abc1234..def5678 100644
--- a/rencoder.gemspec
+++ b/rencoder.gemspec
@@ -20,7 +20,6 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ['lib']
- spec.add_development_dependency 'bundler', '>= 1.17'
spec.add_development_dependency 'rspec', '~> 3.1.0'
spec.add_development_dependency 'rubocop', '~> 0.90'
spec.add_development_dependency 'rubocop-rspec', '~> 1.43'
| Remove bundler from development dependencies
|
diff --git a/app/controllers/spree/admin/return_authorizations_controller.rb b/app/controllers/spree/admin/return_authorizations_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/spree/admin/return_authorizations_controller.rb
+++ b/app/controllers/spree/admin/return_authorizations_controller.rb
@@ -3,8 +3,7 @@ class ReturnAuthorizationsController < ::Admin::ResourceController
belongs_to 'spree/order', find_by: :number
- update.after :associate_inventory_units
- create.after :associate_inventory_units
+ after_action :associate_inventory_units, only: [:create, :update]
def fire
@return_authorization.public_send("#{params[:e]}!")
| Update return authorizations controller callbacks
|
diff --git a/lib/gestpay/iframe.rb b/lib/gestpay/iframe.rb
index abc1234..def5678 100644
--- a/lib/gestpay/iframe.rb
+++ b/lib/gestpay/iframe.rb
@@ -3,13 +3,22 @@
FALLBACK_URL = {
:test => 'https://testecomm.sella.it/pagam/pagam.aspx',
- :production => 'https://ecomm.sella.it/pagam/pagam.aspx'
+ :production => 'https://ecomm.sella.it/pagam/pagam.aspx'
+ }
+
+ PAYMENT_3D_URL = {
+ :test => 'https://testecomm.sella.it/pagam/pagam3d.aspx',
+ :production => 'https://ecomm.sella.it/pagam/pagam3d.aspx'
}
def self.fallback_url
FALLBACK_URL[Gestpay.config.environment]
end
+ def self.payment_3d_url
+ PAYMENT_3D_URL[Gestpay.config.environment]
+ end
+
end
end
| Add URL to manage Verified by VISA payments
|
diff --git a/lib/paperclip/glue.rb b/lib/paperclip/glue.rb
index abc1234..def5678 100644
--- a/lib/paperclip/glue.rb
+++ b/lib/paperclip/glue.rb
@@ -8,7 +8,7 @@ base.extend ClassMethods
base.send :include, Callbacks
base.send :include, Validators
- base.send :include, Schema if defined? ActiveRecord
+ base.send :include, Schema if defined? ActiveRecord::Base
locale_path = Dir.glob(File.dirname(__FILE__) + "/locales/*.{rb,yml}")
I18n.load_path += locale_path unless I18n.load_path.include?(locale_path)
| Fix condition to include Schema, using 'ActiveRecord::Base' instead of 'ActiveRecord' solo
|
diff --git a/lib/vanilli/server.rb b/lib/vanilli/server.rb
index abc1234..def5678 100644
--- a/lib/vanilli/server.rb
+++ b/lib/vanilli/server.rb
@@ -13,13 +13,13 @@ end
# Shells out to start vanilli
- def start
+ def start(cwd: ".")
@pid = spawn("vanilli --port #{@port} \
--logLevel=#{@log_level} \
--staticRoot=#{@static_root} \
--staticDefault=#{@static_default} \
--staticInclude=#{@static_include} \
- --staticExclude=#{@static_exclude}")
+ --staticExclude=#{@static_exclude}", chdir: cwd)
Timeout.timeout(3) do
begin
| Allow specifying cwd so as to support vanilli installations in ./node_modules/.bin
|
diff --git a/lib/yomou/novelapi.rb b/lib/yomou/novelapi.rb
index abc1234..def5678 100644
--- a/lib/yomou/novelapi.rb
+++ b/lib/yomou/novelapi.rb
@@ -6,6 +6,10 @@ module Novelapi
class Novel < Thor
+
+ BASE_URL = "http://api.syosetu.com/novelapi/api/"
+
+ include Yomou::Helper
desc "novel [SUBCOMMAND]", "Get novel data"
option :ncode
@@ -22,6 +26,54 @@ end
end
end
+
+ desc "genre", "Get metadata about genre code"
+ def genre(arg)
+ @conf = Yomou::Config.new
+ url = BASE_URL + [
+ "gzip=#{@conf.gzip}",
+ "out=#{@conf.out}"
+ ].join("&")
+ genre_codes.each do |code|
+ [
+ "favnovelcnt",
+ "reviewcnt",
+ "hyoka",
+ "impressioncnt",
+ "hyokacnt"
+ ].each do |order|
+ first = true
+ offset = 1
+ limit = 500
+ allcount = 10
+ p code
+
+ while offset < 2000
+
+ of = "of=n"
+ url = sprintf("%s?genre=%d&gzip=%d&out=%s&lim=%d&st=%d&%s&order=%s",
+ BASE_URL, code, @conf.gzip, @conf.out, limit, offset, of, order)
+ path = Pathname.new(File.join(@conf.directory,
+ "novelapi",
+ "genre_#{code}_#{order}_#{offset}-.yaml"))
+ p url
+ p path
+ save_as(url, path)
+ yaml = YAML.load_file(path.to_s)
+ if first
+ allcount = yaml.first["allcount"]
+ end
+ p allcount
+ #pp yaml
+ ncodes = yaml[1..-1].collect do |entry|
+ entry["ncode"]
+ end
+ Yomou::Narou::Downloader.new.download(ncodes)
+ offset += 500
+ end
+ end
+ end
+ end
end
end
| Support to download novels which belong to specific genre
|
diff --git a/app.rb b/app.rb
index abc1234..def5678 100644
--- a/app.rb
+++ b/app.rb
@@ -38,5 +38,7 @@ @error = 'Type your text'
return erb :new
end
+
+ @db.execute 'insert into "Posts" (content, created_date) values (?,datetime())', [content]
erb "You typed #{content}"
end
| Save content to the database
|
diff --git a/app.rb b/app.rb
index abc1234..def5678 100644
--- a/app.rb
+++ b/app.rb
@@ -1,10 +1,6 @@ require "json"
require "mobilyws"
require "cuba"
-
-sms = Mobilyws::API.new ENV["USERNAME"], ENV["PASSWORD"], ENV["SENDER_NAME"]
-
-# TODO user can send new message.
auth_token = ENV["AUTH_TOKEN"]
@@ -20,6 +16,7 @@ on "send" do
on root do
on param("mobile") do |mobile|
+ sms = Mobilyws::API.new ENV["USERNAME"], ENV["PASSWORD"], ENV["SENDER_NAME"]
name = req.params.fetch('name', '')
message = ENV["MESSAGE"] % [name]
response = sms.send(message: message, numbers: [mobile])
| Move mobilyws initlizing inside sending scope.
|
diff --git a/app/models/order.rb b/app/models/order.rb
index abc1234..def5678 100644
--- a/app/models/order.rb
+++ b/app/models/order.rb
@@ -19,7 +19,7 @@ values.merge!({
"amount" => 10,
"item_name" => 'Kontakt',
- "item_number" => 1
+ "item_number" => 1,
"quantity" => 1
})
"https://www.paypal.com/cgi-bin/webscr?" + values.to_query
| Change adjust redirect back from Paypal and change cmd from _xclick to _s-xclick
|
diff --git a/app/models/round.rb b/app/models/round.rb
index abc1234..def5678 100644
--- a/app/models/round.rb
+++ b/app/models/round.rb
@@ -2,7 +2,7 @@ include YearlyModel
belongs_to :tournament
- has_many :game_appointments, dependent: :destroy
+ has_many :game_appointments, -> { order(:table) }, dependent: :destroy
validates :number, presence: true
validates :number, uniqueness: { scope: :tournament_id, message: "A round with that number already exists for the tournament."}
validates :start_time, presence: true
| Add default scope for game appointments to order by table
|
diff --git a/ruby-jet.gemspec b/ruby-jet.gemspec
index abc1234..def5678 100644
--- a/ruby-jet.gemspec
+++ b/ruby-jet.gemspec
@@ -1,7 +1,7 @@ Gem::Specification.new do |gem|
gem.name = 'ruby-jet'
- gem.version = '0.7.0'
- gem.date = '2016-05-23'
+ gem.version = '0.8.0'
+ gem.date = '2016-08-02'
gem.summary = 'Jet API for Ruby'
gem.description = 'Jet API service calls implemented in Ruby'
gem.authors = ['Jason Wells']
@@ -10,6 +10,6 @@ gem.homepage = 'https://github.com/jasonwells/ruby-jet'
gem.license = 'MIT'
- gem.add_runtime_dependency 'rest-client', '~> 1.8'
+ gem.add_runtime_dependency 'rest-client', '~> 2.0'
gem.add_runtime_dependency 'oj', '~> 2.15'
end
| Update to newest version of RestClient
|
diff --git a/pakyow-core/lib/core/helpers.rb b/pakyow-core/lib/core/helpers.rb
index abc1234..def5678 100644
--- a/pakyow-core/lib/core/helpers.rb
+++ b/pakyow-core/lib/core/helpers.rb
@@ -8,7 +8,7 @@ end
def logger
- request.logger
+ request.logger || Pakyow.logger
end
def router
| Use Pakyow.logger if req.logger isn't available
The logger won’t be available on the request if the logging middleware
isn’t enabled.
|
diff --git a/app/services/api/v1/data/ndc_content/zipped_download.rb b/app/services/api/v1/data/ndc_content/zipped_download.rb
index abc1234..def5678 100644
--- a/app/services/api/v1/data/ndc_content/zipped_download.rb
+++ b/app/services/api/v1/data/ndc_content/zipped_download.rb
@@ -8,7 +8,7 @@ def initialize(filter)
@filter = filter
@metadata_filter = Api::V1::Data::Metadata::Filter.new(
- source_names: %w(ndc_cait ndc_wb)
+ source_names: %w(ndc_cait ndc_wb ndc_die)
)
@filename = 'ndc_content'
@metadata_filename = 'sources.csv'
| Include DIE in downloadable sources metadata file
|
diff --git a/test/server/run_timed_out_test.rb b/test/server/run_timed_out_test.rb
index abc1234..def5678 100644
--- a/test/server/run_timed_out_test.rb
+++ b/test/server/run_timed_out_test.rb
@@ -9,7 +9,7 @@
# - - - - - - - - - - - - - - - - - - - - -
- c_assert_test 'g55', %w( timeout ) do
+ test 'g55', %w( timeout ) do
stdout_tgz = TGZ.of({'stderr' => 'any'})
set_context(
logger:StdoutLoggerSpy.new,
| Use simpler server-side timed-out test.
|
diff --git a/lib/utf8_enforcer_workaround/action_view/helpers/form_tag_helper.rb b/lib/utf8_enforcer_workaround/action_view/helpers/form_tag_helper.rb
index abc1234..def5678 100644
--- a/lib/utf8_enforcer_workaround/action_view/helpers/form_tag_helper.rb
+++ b/lib/utf8_enforcer_workaround/action_view/helpers/form_tag_helper.rb
@@ -18,5 +18,6 @@
ActionView::Helpers::FormTagHelper.class_eval do
include Utf8EnforcerWorkaround::ActionView::Helpers::FormTagHelper
- alias_method_chain :utf8_enforcer_tag, :tag_removed
+ alias_method :utf8_enforcer_tag_without_tag_removed, :utf8_enforcer_tag
+ alias_method :utf8_enforcer_tag, :utf8_enforcer_tag_with_tag_removed
end
| Fix deprecation notice for alias_method_chain
|
diff --git a/Library/Contributions/examples/brew-bottle.rb b/Library/Contributions/examples/brew-bottle.rb
index abc1234..def5678 100644
--- a/Library/Contributions/examples/brew-bottle.rb
+++ b/Library/Contributions/examples/brew-bottle.rb
@@ -10,7 +10,7 @@ # Get the latest version
version = `brew list --versions #{formula}`.split.last
source = HOMEBREW_CELLAR + formula + version
- filename = formula + '-' + version + '.tar.gz'
+ filename = formula + '-' + version + '-bottle.tar.gz'
ohai "Bottling #{formula} #{version}..."
HOMEBREW_CELLAR.cd do
# Use gzip, faster to compress than bzip2, faster to uncompress than bzip2
| Add suffix for bottles to avoid cache confusion.
|
diff --git a/admin_auth.gemspec b/admin_auth.gemspec
index abc1234..def5678 100644
--- a/admin_auth.gemspec
+++ b/admin_auth.gemspec
@@ -19,10 +19,11 @@ spec.require_paths = ["lib"]
spec.required_ruby_version = ">= 1.9"
+ spec.add_dependency "bcrypt", "~> 3"
+ spec.add_dependency "rails", "~> 4"
+
spec.add_development_dependency "bundler", "~> 1.7"
spec.add_development_dependency "rake", "~> 10.0"
spec.add_development_dependency "pry", "~> 0"
spec.add_development_dependency "rspec", "~> 3"
-
- spec.add_dependency "bcrypt", "~> 3.0"
end
| Add rails as a dependency
|
diff --git a/skeletor.gemspec b/skeletor.gemspec
index abc1234..def5678 100644
--- a/skeletor.gemspec
+++ b/skeletor.gemspec
@@ -19,6 +19,6 @@
s.add_dependency "thor", "~> 0.14.6"
s.add_dependency "hike", "~> 1.2.1"
- s.add_dependency "grayskull", "~> 0.1.7"
+ s.add_dependency "grayskull", "~> 0.1.9"
end
| Update to latest version of Grayskull
|
diff --git a/spec/benchmark_spec.rb b/spec/benchmark_spec.rb
index abc1234..def5678 100644
--- a/spec/benchmark_spec.rb
+++ b/spec/benchmark_spec.rb
@@ -1,4 +1,5 @@ require "minitest/benchmark"
+require 'posix/spawn'
describe "Process information retrieval" do
bench_performance_constant "System.uname" do
@@ -23,7 +24,6 @@
bench_performance_constant "POSIX::Spawn.popen4" do
begin
- require 'posix/spawn'
pid, stdin, stdout, stderr = POSIX::Spawn.popen4('ps', "-o rss= -p #{Process.pid}")
stdin.close
rss = stdout.read.to_i
| Move require outside of benchmark method for fairness
|
diff --git a/app/widgets/one_page_checkout/shipping_method_widget.rb b/app/widgets/one_page_checkout/shipping_method_widget.rb
index abc1234..def5678 100644
--- a/app/widgets/one_page_checkout/shipping_method_widget.rb
+++ b/app/widgets/one_page_checkout/shipping_method_widget.rb
@@ -34,6 +34,11 @@ attr_reader :order
helper_method :shipping_method_options
+ def current_shipping_method
+ # FIXME Exposes internal structure of Order
+ order.shipping_method_id
+ end
+
def shipping_methods
# FIXME Exposes internal structure of Order
@_shipping_methods ||= order.rate_hash
@@ -41,6 +46,6 @@
def shipping_method_options
@_shipping_method_options ||=
- options_from_collection_for_select(shipping_methods, :id, :name)
+ options_from_collection_for_select(shipping_methods, :id, :name, current_shipping_method)
end
end
| Select current shipping-method when possible
|
diff --git a/Casks/opera-developer.rb b/Casks/opera-developer.rb
index abc1234..def5678 100644
--- a/Casks/opera-developer.rb
+++ b/Casks/opera-developer.rb
@@ -1,6 +1,6 @@ cask :v1 => 'opera-developer' do
- version '29.0.1781.0'
- sha256 'b3b24c1456722318eea3549169af43f268ccc0f015d3a8ad739bbe2c57a42d26'
+ version '29.0.1794.0'
+ sha256 'c6d875407a276a4b48a5d6b271ba5e40b7292c3734510635d74a56ccd7a1b6e8'
url "http://get.geo.opera.com/pub/opera-developer/#{version}/mac/Opera_Developer_#{version}_Setup.dmg"
homepage 'http://www.opera.com/developer'
| Upgrade Opera Developer.app to 29.0.1794.0
|
diff --git a/Casks/opera-developer.rb b/Casks/opera-developer.rb
index abc1234..def5678 100644
--- a/Casks/opera-developer.rb
+++ b/Casks/opera-developer.rb
@@ -1,6 +1,6 @@ cask :v1 => 'opera-developer' do
- version '29.0.1794.0'
- sha256 'c6d875407a276a4b48a5d6b271ba5e40b7292c3734510635d74a56ccd7a1b6e8'
+ version '29.0.1795.0'
+ sha256 '33b33c56d079c524e43e41ff588f3cfa6bc3481f87f4c4705623220464462023'
url "http://get.geo.opera.com/pub/opera-developer/#{version}/mac/Opera_Developer_#{version}_Setup.dmg"
homepage 'http://www.opera.com/developer'
| Upgrade Opera Developer.app to 29.0.1795.0
|
diff --git a/spree_correios.gemspec b/spree_correios.gemspec
index abc1234..def5678 100644
--- a/spree_correios.gemspec
+++ b/spree_correios.gemspec
@@ -24,4 +24,5 @@ s.add_development_dependency 'rspec-rails', '~> 2.7'
s.add_development_dependency 'shoulda-matchers', '1.1.0'
s.add_development_dependency 'sqlite3'
+ s.add_development_dependency 'fakeweb'
end
| Add fakeweb as development dependecy on gemspec
|
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
@@ -9,6 +9,19 @@ validates_inclusion_of :email_notify, in: [true, false], message: "can't be blank"
validates_inclusion_of :text_notify, in: [true, false], message: "can't be blank"
validates_presence_of :cellphone, message: "must be present for text notifications", if: 'text_notify'
+
+ def self.leaderboard # Returns an array of Users, *not* an ActiveRecord::Relation
+ self.where(id: Timeslot.recent.booked.group(:tutor_id).pluck(:tutor_id))
+ .sort_by(&:recent_count)[-10..-1].reverse
+ end
+
+ def completed_count
+ self.timeslots.booked.count
+ end
+
+ def recent_count
+ self.timeslots.recent.booked.count
+ end
def cellphone=(cellphone_number)
write_attribute(:cellphone, cellphone_number.gsub(/\D/, '')) unless cellphone_number.nil?
| Add calculated fields to User model
Add User#completed_count to provide number of completed sessions for
a tutor.
Add User#recent_count to provide number of completed sessions for a
tutor in last 45 days.
Add User.leaderboard to provide array of top ten tutors over past 45
days based on number of completed sessions.
|
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,4 +1,6 @@ class User < ActiveRecord::Base
+ has_one :account, foreign_key: :frankiz_id, primary_key: :frankiz_id
+
STATUSES = {
'Polytechniciens' => 0,
'Doctorants de l\'X' => 4,
@@ -25,7 +27,7 @@ casert: casert || '',
status: status,
promo: promo,
- mail: email,
+ mail: email || '',
)
end
| Fix sync when mail is null
|
diff --git a/CoreData-Views-Collection-ios.podspec b/CoreData-Views-Collection-ios.podspec
index abc1234..def5678 100644
--- a/CoreData-Views-Collection-ios.podspec
+++ b/CoreData-Views-Collection-ios.podspec
@@ -1,6 +1,6 @@ Pod::Spec.new do |s|
s.name = "CoreData-Views-Collection-ios"
- s.version = "0.0.13"
+ s.version = "0.0.14"
s.summary = "Collection of Core Data based Cocoa Touch views base classes"
s.description = <<-DESC
Cocoa Touch view controller classes based/inspired by Stanford CS193p examples
| Change podspec version to 0.0.14
|
diff --git a/script/check_contributors_md.rb b/script/check_contributors_md.rb
index abc1234..def5678 100644
--- a/script/check_contributors_md.rb
+++ b/script/check_contributors_md.rb
@@ -1,4 +1,5 @@ #!/usr/bin/env ruby
+require "English"
puts "Checking to see if you're in CONTRIBUTORS.md..."
@@ -19,7 +20,7 @@ end
else
author = `git config github.user`.chomp
- if $?.exitstatus.positive?
+ if $CHILD_STATUS.exitstatus.positive?
abort %(
Couldn't determine your GitHub username, and not in a Travis PR build
Please set it using
@@ -28,10 +29,7 @@ end
end
-author.sub! '[', '\\['
-author.sub! ']', '\\]'
-
-unless system('grep', '-i', author, 'CONTRIBUTORS.md')
+unless File.read('CONTRIBUTORS.md').include? author
abort %(
Thanks for your contribution, #{author}!
Please add your name and GitHub handle to the file CONTRIBUTORS.md,
| Read the file contents in ruby
|
diff --git a/lib/typhoeus/hydra/throttleable.rb b/lib/typhoeus/hydra/throttleable.rb
index abc1234..def5678 100644
--- a/lib/typhoeus/hydra/throttleable.rb
+++ b/lib/typhoeus/hydra/throttleable.rb
@@ -8,11 +8,16 @@ def available_throttled_capacity
now = Time.now
- @throttle_buffer.capacity.times do
- if (oldest_timestamp = @throttle_buffer.front) && oldest_timestamp < (now - 1)
- @throttle_buffer.pop
- else
- break
+ if (newest_timestamp = @throttle_buffer.back) && newest_timestamp < (now - 1)
+ # Optimize for the case that enough time has passed to reset the buffer
+ @throttle_buffer.clear
+ else
+ @throttle_buffer.capacity.times do
+ if (oldest_timestamp = @throttle_buffer.front) && oldest_timestamp < (now - 1)
+ @throttle_buffer.pop
+ else
+ break
+ end
end
end
| Optimize for the case that the whole throttle_buffer can be cleared all at once
|
diff --git a/features/support/ui/page.rb b/features/support/ui/page.rb
index abc1234..def5678 100644
--- a/features/support/ui/page.rb
+++ b/features/support/ui/page.rb
@@ -18,7 +18,7 @@ section :footer_site_links, UI::Sections::FooterSiteLinks, '.footer-site-links'
section :footer_social_links, UI::Sections::FooterSocialLinks, '.footer-social-links'
section :opt_out_bar, UI::Sections::OptOutBar, '.opt-out'
- section :header, UI::Sections::Header, '.header'
+ section :header, UI::Sections::Header, '.l-header'
section :search_box, UI::Sections::SearchBox, '.search-box'
end
end
| Fix failing test by targeting header layout
|
diff --git a/Formula/mcrypt-php.rb b/Formula/mcrypt-php.rb
index abc1234..def5678 100644
--- a/Formula/mcrypt-php.rb
+++ b/Formula/mcrypt-php.rb
@@ -6,6 +6,7 @@ md5 '816259e5ca7d0a7e943e56a3bb32b17f'
version '5.3.10'
+ depends_on 'autoconf'
depends_on 'mcrypt'
def install
| Fix missing autoconf dependency when phpizeing mcrypt
|
diff --git a/example/config.ru b/example/config.ru
index abc1234..def5678 100644
--- a/example/config.ru
+++ b/example/config.ru
@@ -7,8 +7,6 @@ require 'rjack-logback'
RJack::Logback.config_console( :stderr => true, :thread => true )
-# FIXME: Currently Need Content-Length set to avoid double chunked
-# transfer-encoding with rack 1.3 (not a problem in rack 1.2)!
use Rack::ContentLength
run lambda { |env| [200, { "Content-Type" => "text/plain" }, ["Hello"]] }
| Remove FIXME, double transfer-encoding was fixed in a later rack release.
|
diff --git a/census_api.gemspec b/census_api.gemspec
index abc1234..def5678 100644
--- a/census_api.gemspec
+++ b/census_api.gemspec
@@ -6,13 +6,13 @@ Gem::Specification.new do |gem|
gem.name = 'census_api'
gem.version = CensusApi::VERSION
- gem.authors = ['Ty Rauber']
+ gem.authors = ['Ty Rauber, Michael Weigle']
gem.license = 'MIT'
- gem.email = ['tyrauber@mac.com']
+ gem.email = ['tyrauber@mac.com', 'michael.weigle@gmail.com']
gem.description = 'A Ruby Gem for querying the US Census Bureau API'
gem.summary = 'A Ruby Wrapper for the US Census Bureau API,
- providing the ability to query both the 2010 Census
- and 2006-2010 ACS5 datasets.'
+ providing the ability to query both the SF1 and ACS5
+ datasets.'
gem.homepage = 'https://github.com/tyrauber/census_api.git'
gem.files = `git ls-files`.split("\n")
| Add name and contact info
|
diff --git a/specs/string_spec.rb b/specs/string_spec.rb
index abc1234..def5678 100644
--- a/specs/string_spec.rb
+++ b/specs/string_spec.rb
@@ -30,5 +30,5 @@ LibTest.string_equals(str, str).should == false
rescue SecurityError => e
end
- end
+ end if false
end
| Disable tainted String parameter specs
|
diff --git a/scripts/data/analyze_student_attendance.rb b/scripts/data/analyze_student_attendance.rb
index abc1234..def5678 100644
--- a/scripts/data/analyze_student_attendance.rb
+++ b/scripts/data/analyze_student_attendance.rb
@@ -6,6 +6,17 @@ :att_dismissed_ind, :att_dismissed_ind_02,
:att_excused_ind, :att_excused_ind_02,
:att_absent_ind, :att_absent_ind_02 ]
+
+ # From the Aspen / X2 data dictionary:
+
+ # ATT_ABSENT_IND => Absent?
+ # ATT_ABSENT_IND_02 => Absent PM?
+ # ATT_DISMISSED_IND => Dismissed?
+ # ATT_DISMISSED_IND_02 => Dismissed PM?
+ # ATT_EXCUSED_IND => Excused?
+ # ATT_EXCUSED_IND_02 => Excused PM?
+ # ATT_TARDY_IND => Tardy?
+ # ATT_TARDY_IND_02 => Tardy PM?
puts 'COUNTS FOR INDICATOR == "1" (TRUE)'; puts
indicators.map do |indicator|
@@ -20,13 +31,3 @@ end
-# From the Aspen / X2 data dictionary:
-
-# ATT_ABSENT_IND => Absent?
-# ATT_ABSENT_IND_02 => Absent PM?
-# ATT_DISMISSED_IND => Dismissed?
-# ATT_DISMISSED_IND_02 => Dismissed PM?
-# ATT_EXCUSED_IND => Excused?
-# ATT_EXCUSED_IND_02 => Excused PM?
-# ATT_TARDY_IND => Tardy?
-# ATT_TARDY_IND_02 => Tardy PM?
| Move data dictionary nearer to the column names
|
diff --git a/db/migrate/20190212154937_change_organization_id_to_bigint.rb b/db/migrate/20190212154937_change_organization_id_to_bigint.rb
index abc1234..def5678 100644
--- a/db/migrate/20190212154937_change_organization_id_to_bigint.rb
+++ b/db/migrate/20190212154937_change_organization_id_to_bigint.rb
@@ -0,0 +1,21 @@+class ChangeOrganizationIdToBigint < ActiveRecord::Migration[6.0]
+ def up
+ change_column :datasets, :organization_id, :bigint
+ change_column :exports, :organization_id, :bigint
+ change_column :final_legal_documents, :organization_id, :bigint
+ change_column :legal_document_datasets, :organization_id, :bigint
+ change_column :legal_documents, :organization_id, :bigint
+ change_column :notifications, :organization_id, :bigint
+ change_column :organization_users, :organization_id, :bigint
+ end
+
+ def down
+ change_column :datasets, :organization_id, :integer
+ change_column :exports, :organization_id, :integer
+ change_column :final_legal_documents, :organization_id, :integer
+ change_column :legal_document_datasets, :organization_id, :integer
+ change_column :legal_documents, :organization_id, :integer
+ change_column :notifications, :organization_id, :integer
+ change_column :organization_users, :organization_id, :integer
+ end
+end
| Update organization_id foreign key to bigint
|
diff --git a/server/app/controllers/files_controller.rb b/server/app/controllers/files_controller.rb
index abc1234..def5678 100644
--- a/server/app/controllers/files_controller.rb
+++ b/server/app/controllers/files_controller.rb
@@ -13,8 +13,15 @@ # The client runs the filename through CGI.escape in case it contains
# special characters. Older versions of Rails automatically decoded the
# filename, but as of Rails 2.3 we need to do it ourself.
- files = params[:files].inject({}) { |h, (file, value)| h[CGI.unescape(file)] = value; h }
- response = etchserver.generate(files)
+ files = {}
+ if params[:files]
+ files = params[:files].inject({}) { |h, (file, value)| h[CGI.unescape(file)] = value; h }
+ end
+ commands = {}
+ if params[:commands]
+ commands = params[:commands].inject({}) { |h, (command, value)| h[CGI.unescape(command)] = value; h }
+ end
+ response = etchserver.generate(files, commands)
render :text => response
rescue Exception => e
logger.error e.message
| Add support for requesting specific commands.
|
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
@@ -4,6 +4,10 @@ @last_sermon = Sermon.last
@last_newsletter = Newsletter.last
@upcoming_events = Event.upcoming
+
+ flash[:warning] = "To protect the health of our members and the public during the pandemic, " +
+ "we are cancelling normal services. However, you can continue to worship " +
+ "with us: on Sunday morning at 11AM each week, we will stream service on Facebook Live."
end
def beliefs
| Add Covid-19 announcement in flash message to home
Need to go ahead and put this announcement in place for now. Later, this should be made into generic functionality: add a section to admin page to create/update announcements.
|
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,6 +1,6 @@ class PagesController < ApplicationController
def home
- @tools = Tool.all
+ @tools = Tool.order('id DESC').all
@tool = Tool.new
end
end
| Order tools by descending ID, newest one at the top
|
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
@@ -1,8 +1,7 @@ class UsersController < ApplicationController
before_action :authenticate_user!, only: [:edit, :update]
- before_action :check_for_correct_user, only: [:edit, :update]
+ before_action :authorize_user, only: [:edit, :update]
before_action :set_user, only: [:show, :edit, :update]
- before_action :check_for_relationship, only: [:show]
def show
@latest_posts = @user.posts.latest(3).published
@@ -30,16 +29,9 @@ params.require(:user).permit(:description, :avatar, :location)
end
- def check_for_correct_user
+ def authorize_user
unless current_user.slug == params[:id]
redirect_to root_url
end
end
-
- # Sets @relationship for Unfollow button
- def check_for_relationship
- if user_signed_in? && current_user.following?(@user)
- @relationship = current_user.active_relationships.find_by(followed_id: @user.id)
- end
- end
end
| Rename private method in UsersController and remove unnecessary code
|
diff --git a/app/models/constitution_proposal.rb b/app/models/constitution_proposal.rb
index abc1234..def5678 100644
--- a/app/models/constitution_proposal.rb
+++ b/app/models/constitution_proposal.rb
@@ -1,9 +1,9 @@ class ConstitutionProposal < Proposal
def voting_system
- organisation.constitution.voting_system(:membership)
+ organisation.constitution.voting_system(:constitution)
end
def decision_notification_message
- "If you have previously printed/saved a PDF copy of the member list, this prior copy is now out of date. Please consider reprinting/saving a copy of the latest member list for your records."
+ "If you have previously printed/saved a PDF copy of the constitution, this prior copy is now out of date. Please consider reprinting/saving a copy of the latest constitution for your records."
end
end
| Fix poor copy-and-paste skills in setting up new ConstitutionProposal class.
|
diff --git a/test/stub/rails_apps/foobar/config/environments/production.rb b/test/stub/rails_apps/foobar/config/environments/production.rb
index abc1234..def5678 100644
--- a/test/stub/rails_apps/foobar/config/environments/production.rb
+++ b/test/stub/rails_apps/foobar/config/environments/production.rb
@@ -10,7 +10,6 @@ # Full error reports are disabled and caching is turned on
config.action_controller.consider_all_requests_local = false
config.action_controller.perform_caching = true
-config.action_view.cache_template_loading = true
# Enable serving of images, stylesheets, and javascripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"
| Fix the stub application that doesn't specify a Rails version.
cache_template_loading is removed from Rails 2.2.
|
diff --git a/lib/aggro/concurrent_actor.rb b/lib/aggro/concurrent_actor.rb
index abc1234..def5678 100644
--- a/lib/aggro/concurrent_actor.rb
+++ b/lib/aggro/concurrent_actor.rb
@@ -1,6 +1,6 @@ module Aggro
# Private: Wraps a given target in an concurrent actor.
- class ConcurrentActor < Concurrent::Actor::Context
+ class ConcurrentActor < Concurrent::Actor::RestartingContext
def initialize(target)
@target = target
end
| Make actors restart on failure.
|
diff --git a/spec/factories/avalara_shipment_factory.rb b/spec/factories/avalara_shipment_factory.rb
index abc1234..def5678 100644
--- a/spec/factories/avalara_shipment_factory.rb
+++ b/spec/factories/avalara_shipment_factory.rb
@@ -21,6 +21,7 @@ shipment.order.line_items.each do |line_item|
line_item.quantity.times do
shipment.inventory_units.create!(
+ order_id: shipment.order_id,
variant_id: line_item.variant_id,
line_item_id: line_item.id
)
| Fix factory by passing order id
|
diff --git a/lib/awestruct/markdownable.rb b/lib/awestruct/markdownable.rb
index abc1234..def5678 100644
--- a/lib/awestruct/markdownable.rb
+++ b/lib/awestruct/markdownable.rb
@@ -1,4 +1,4 @@-require 'bluecloth'
+require 'rdiscount'
module Awestruct
@@ -6,13 +6,7 @@ def render(context)
rendered = ''
begin
- bluecloth_options = { :smartypants => true }
-
- unless self.options.nil?
- bluecloth_options.merge!({ :smartypants => false }) if self.options[:html_entities] == false
- end
-
- doc = BlueCloth.new( context.interpolate_string( raw_page_content ), bluecloth_options )
+ doc = RDiscount.new( context.interpolate_string( raw_page_content ) )
rendered = doc.to_html
rescue => e
puts e
| Switch to RDiscount for markdown.
|
diff --git a/webapp/db/migrate/20111214182014_unique_live_form_template.rb b/webapp/db/migrate/20111214182014_unique_live_form_template.rb
index abc1234..def5678 100644
--- a/webapp/db/migrate/20111214182014_unique_live_form_template.rb
+++ b/webapp/db/migrate/20111214182014_unique_live_form_template.rb
@@ -1,5 +1,31 @@ class UniqueLiveFormTemplate < ActiveRecord::Migration
def self.up
+ execute %{
+ UPDATE forms
+ SET status = 'Inactive'
+ FROM (
+ SELECT DISTINCT ON (template_id) template_id, id
+ FROM forms
+ WHERE
+ status = 'Live' AND
+ template_id IN (
+ SELECT template_id
+ FROM (
+ SELECT template_id, count(*)
+ FROM forms
+ WHERE status = 'Live'
+ GROUP BY template_id
+ HAVING count(*) > 1
+ ) foo
+ )
+ ORDER BY template_id, version DESC
+ ) bar
+ WHERE
+ bar.template_id = forms.template_id AND
+ bar.id != forms.id AND
+ forms.status = 'Live'
+ RETURNING forms.id;
+ }
execute "CREATE UNIQUE INDEX unique_live_form_template ON forms (template_id) WHERE status = 'Live'"
end
| Add code to fix already-broken databases that would otherwise fail this
migration
If you've already migrated to this point, it's ok to continue without these
code changes; you didn't need them anyway.
|
diff --git a/spec/unit/ice_nine/core_ext/object/deep_freeze_spec.rb b/spec/unit/ice_nine/core_ext/object/deep_freeze_spec.rb
index abc1234..def5678 100644
--- a/spec/unit/ice_nine/core_ext/object/deep_freeze_spec.rb
+++ b/spec/unit/ice_nine/core_ext/object/deep_freeze_spec.rb
@@ -0,0 +1,19 @@+# encoding: utf-8
+
+require 'spec_helper'
+require 'ice_nine'
+require 'ice_nine/core_ext/object'
+
+describe IceNine::CoreExt::Object, '#deep_freeze' do
+ subject { object.deep_freeze }
+
+ let(:object) { Object.new.extend(IceNine::CoreExt::Object) }
+
+ it 'returns the object' do
+ should be(object)
+ end
+
+ it 'freezes the object' do
+ expect { subject }.to change(object, :frozen?).from(false).to(true)
+ end
+end
| Add spec for IceNine::CoreExt::Object to cover mutation
|
diff --git a/backend/app/models/statistic/medium.rb b/backend/app/models/statistic/medium.rb
index abc1234..def5678 100644
--- a/backend/app/models/statistic/medium.rb
+++ b/backend/app/models/statistic/medium.rb
@@ -5,7 +5,7 @@ attribute :name
self.primary_key = :id
- belongs_to :station, class_name: '::Station', foreign_key: :id
+ belongs_to :medium, class_name: '::Medium', foreign_key: :id
# this isn't strictly necessary, but it will prevent
# rails from calling save, which would fail anyway.
def readonly?
| Fix copy/paste bug: association of statistic model
|
diff --git a/app/controllers/brokers_controller.rb b/app/controllers/brokers_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/brokers_controller.rb
+++ b/app/controllers/brokers_controller.rb
@@ -19,7 +19,7 @@
def show
@broker = Broker.find(params[:id])
- @employers = @broker.employers.by_name
+ @employers = [@broker.employers.by_name, @broker.plan_years.map{|py| py.employer}].flatten.uniq!
respond_to do |format|
format.html # index.html.erb
| Update employers displayed on broker show page
|
diff --git a/app/controllers/brokers_controller.rb b/app/controllers/brokers_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/brokers_controller.rb
+++ b/app/controllers/brokers_controller.rb
@@ -19,7 +19,7 @@
def show
@broker = Broker.find(params[:id])
- @employers = @broker.employers.by_name
+ @employers = [@broker.employers.by_name, @broker.plan_years.map{|py| py.employer}].flatten.uniq!
respond_to do |format|
format.html # index.html.erb
| Update employers displayed on broker show page
|
diff --git a/app/controllers/brokers_controller.rb b/app/controllers/brokers_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/brokers_controller.rb
+++ b/app/controllers/brokers_controller.rb
@@ -19,7 +19,7 @@
def show
@broker = Broker.find(params[:id])
- @employers = @broker.employers.by_name
+ @employers = [@broker.employers.by_name, @broker.plan_years.map{|py| py.employer}].flatten.uniq!
respond_to do |format|
format.html # index.html.erb
| Update employers displayed on broker show page
|
diff --git a/app/controllers/finders_controller.rb b/app/controllers/finders_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/finders_controller.rb
+++ b/app/controllers/finders_controller.rb
@@ -40,7 +40,8 @@
def finders_excluded_from_robots
[
- 'aaib-reports'
+ 'aaib-reports',
+ 'international-development-funding',
]
end
end
| Add DFID to robots exclusions
|
diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/welcome_controller.rb
+++ b/app/controllers/welcome_controller.rb
@@ -8,7 +8,7 @@
# Show the latests posts...
@posts = (can? :manage, Post) ? Post.all : Post.published
- @posts = @posts.where(featured: false).includes(:photo).order("updated_at DESC").limit(6)
+ @posts = @posts.where(featured: false).includes(:photo).order("updated_at DESC").limit(4)
# ...and photos
@photos = (can? :manage, Photo) ? Photo.all : Photo.published
| Reduce posts in front page from 6 to 4
|
diff --git a/app/helpers/tracks_helper.rb b/app/helpers/tracks_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/tracks_helper.rb
+++ b/app/helpers/tracks_helper.rb
@@ -10,8 +10,8 @@
def display_start_time(track)
if track.start_time
- @content = content_tag(:span, "Track start: ", class: 'strong')
- @content << content_tag(:span, "#{track.start_time.strftime("%l:%M%P, %e %b ’%y")}")
+ @content = content_tag(:span, "Start: ", class: 'strong')
+ @content << content_tag(:span, "#{track.start_time.strftime("%a %l:%M %P (%e %b ’%y)")}")
else
content_tag(:span, "Start time not set", class: 'unpublished-text')
end
@@ -19,8 +19,8 @@
def display_end_time(track)
if track.end_time
- @content = content_tag(:span, "Track end: ", class: 'strong')
- @content << content_tag(:span, "#{track.end_time.strftime("%l:%M%P, %e %b ’%y")}")
+ @content = content_tag(:span, "End: ", class: 'strong')
+ @content << content_tag(:span, "#{track.end_time.strftime("%a %l:%M %P (%e %b ’%y)")}")
else
content_tag(:span, "End time not set", class: 'unpublished-text')
end
| Add day of the week to a track
|
diff --git a/app/models/plugins/action.rb b/app/models/plugins/action.rb
index abc1234..def5678 100644
--- a/app/models/plugins/action.rb
+++ b/app/models/plugins/action.rb
@@ -14,9 +14,6 @@ form ? form.form_elements.map(&:attributes) : []
end
-
- # FIXME - this was rushed. There's a nicer way to do this, I'm sure.
- #
def name
self.class.name.demodulize
end
| Clean up FIXME comment from Plugins::Action model
|
diff --git a/app/volt/tasks/user_tasks.rb b/app/volt/tasks/user_tasks.rb
index abc1234..def5678 100644
--- a/app/volt/tasks/user_tasks.rb
+++ b/app/volt/tasks/user_tasks.rb
@@ -1,9 +1,9 @@ class UserTasks < Volt::TaskHandler
- # Login a user, takes a login and password. Login can be either a username or an e-mail
- # based on Volt.config.public.auth.use_username
+ # Login a user, takes a login and password. Login can be either a username
+ # or an e-mail based on Volt.config.public.auth.use_username
def login(login, password)
- query = {User.login_field => login}
+ query = { User.login_field => login }
return store._users.find(query).then do |users|
user = users.first
@@ -11,20 +11,22 @@ if user
match_pass = BCrypt::Password.new(user._hashed_password)
if match_pass == password
- raise "app_secret is not configured" unless Volt.config.app_secret
+ fail 'app_secret is not configured' unless Volt.config.app_secret
# TODO: returning here should be possible, but causes some issues
- # Salt the user id with the app_secret so the end user can't tamper with the cookie
- signature = BCrypt::Password.create("#{Volt.config.app_secret}::#{user._id}")
+ # Salt the user id with the app_secret so the end user can't
+ # tamper with the cookie
+ salty_password = "#{Volt.config.app_secret}::#{user._id}"
+ signature = BCrypt::Password.create(salty_password)
# Return user_id:hash on user id
next "#{user._id}:#{signature}"
else
- raise "Password did not match"
+ fail 'Password did not match'
end
else
- raise "User could not be found"
+ fail 'User could not be found'
end
end
end
| Use `fail` instead of `raise` & shorten a few long lines
|
diff --git a/spec/uploaders/hero_image_uploader_spec.rb b/spec/uploaders/hero_image_uploader_spec.rb
index abc1234..def5678 100644
--- a/spec/uploaders/hero_image_uploader_spec.rb
+++ b/spec/uploaders/hero_image_uploader_spec.rb
@@ -0,0 +1,25 @@+require 'spec_helper'
+
+describe HeroImageUploader do
+ include CarrierWave::Test::Matchers
+ let(:user){ FactoryGirl.create(:user) }
+
+ before do
+ HeroImageUploader.enable_processing = true
+ @uploader = HeroImageUploader.new(user, :hero_image)
+ @uploader.store!(File.open("#{Rails.root}/spec/fixtures/image.png"))
+ end
+
+ after do
+ HeroImageUploader.enable_processing = false
+ @uploader.remove!
+ end
+
+ describe '#blur' do
+ subject{ @uploader.blur }
+ it{ should have_dimensions(170, 200) }
+ end
+
+end
+
+
| Create spec for hero image uploader
|
diff --git a/lib/duckrails/synchronizer.rb b/lib/duckrails/synchronizer.rb
index abc1234..def5678 100644
--- a/lib/duckrails/synchronizer.rb
+++ b/lib/duckrails/synchronizer.rb
@@ -2,11 +2,11 @@ class Synchronizer
cattr_accessor :mock_synchronization_token
- def initialize app
+ def initialize(app)
@app = app
end
- def call env
+ def call(env)
application_state = ApplicationState.instance
if Synchronizer.mock_synchronization_token != application_state.mock_synchronization_token
| [MINOR] Add parenthesis to the method signature.
|
diff --git a/lib/foodcritic/rules/fc033.rb b/lib/foodcritic/rules/fc033.rb
index abc1234..def5678 100644
--- a/lib/foodcritic/rules/fc033.rb
+++ b/lib/foodcritic/rules/fc033.rb
@@ -1,14 +1,19 @@ rule "FC033", "Missing template" do
tags %w{correctness templates}
recipe do |ast, filename|
+ # find all template resources that don't fetch a template
+ # from either another cookbook or a local path
find_resources(ast, type: :template).reject do |resource|
resource_attributes(resource)["local"] ||
resource_attributes(resource)["cookbook"]
end.map do |resource|
+ # fetch the specified file to the template
file = template_file(resource_attributes(resource,
return_expressions: true))
{ resource: resource, file: file }
end.reject do |resource|
+ # skip the check if the file path is derived since
+ # we can't determine if that's here or not without converging the node
resource[:file].respond_to?(:xpath)
end.select do |resource|
template_paths(filename).none? do |path|
| Add some comments to FC033 code
It's chained which makes it hard to follow
Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
|
diff --git a/lib/greek_string/container.rb b/lib/greek_string/container.rb
index abc1234..def5678 100644
--- a/lib/greek_string/container.rb
+++ b/lib/greek_string/container.rb
@@ -5,17 +5,18 @@
def_delegators :@container, :[], :<<, :each, :map, :flat_map
- def initialize
- @container = []
+ def initialize(letters=nil)
+ @container = letters || []
end
def to_a
@container
end
- def to_s(type)
- @container.flat_map(&type)
+ def method_missing(meth, *args)
+ @container.map! { |l| l if l.send(meth) }.flatten!
+ @container.delete_if { |el| !el == true }
+ self.class.new(@container)
end
-
end
end
| Rebuild initialize in Container class
|
diff --git a/lib/modules/wdpa/attribute.rb b/lib/modules/wdpa/attribute.rb
index abc1234..def5678 100644
--- a/lib/modules/wdpa/attribute.rb
+++ b/lib/modules/wdpa/attribute.rb
@@ -1,7 +1,8 @@ class Wdpa::Attribute
TYPE_CONVERSIONS = {
geometry: -> (value) { RGeo::WKRep::WKBParser.new.parse(value).to_s },
- boolean: -> (value) { value.match(/^(true|t|1)$/i) != nil },
+ # Need to match the number 2 as well as this is used as marine type
+ boolean: -> (value) { value.match(/^(true|t|1|2)$/i) != nil },
integer: -> (value) { value.to_i },
string: -> (value) { value.to_s },
float: -> (value) { value.to_f },
| Fix import to include MPAs of type 2
|
diff --git a/cookbooks/ondemand_base/metadata.rb b/cookbooks/ondemand_base/metadata.rb
index abc1234..def5678 100644
--- a/cookbooks/ondemand_base/metadata.rb
+++ b/cookbooks/ondemand_base/metadata.rb
@@ -14,5 +14,5 @@ depends "selinux"
depends "yum"
depends "ad-auth"
-depends "nagios"
+#depends "nagios"
depends "chef-client" | Disable the nagios prereq as well
|
diff --git a/RunKeeper-iOS.podspec b/RunKeeper-iOS.podspec
index abc1234..def5678 100644
--- a/RunKeeper-iOS.podspec
+++ b/RunKeeper-iOS.podspec
@@ -0,0 +1,28 @@+Pod::Spec.new do |s|
+ s.name = "RunKeeper-iOS"
+ s.version = "0.0.1"
+ s.summary = "An iOS RunKeeper API module."
+ s.description = <<-DESC
+ RunKeeper-iOS provides an Objective C wrapper class for accessing the [RunKeeper Health Graph API](http://developer.runkeeper.com/healthgraph) from iOS 4.0 or newer.
+
+ RunKeeper-iOS was developed for use in our iPhone fitness app "Running Intensity". It is meant to be general, but is built primarily for a Running app. The API is NOT fully supported, but more will be added based on our own needs or the requests of others.
+ DESC
+ s.homepage = "https://github.com/brierwood/RunKeeper-iOS"
+
+ s.license = 'BSD'
+
+ s.authors = { "Brierwood Design" => "info@brierwooddesign.com", "Reid van Melle" => "rvanmelle@gmail.com" }
+
+ s.source = { :git => "https://github.com/brierwood/RunKeeper-iOS.git", :commit => "5c124db44a82b54e4487632fcf55148001b9516d" }
+
+ s.platform = :ios, '5.0'
+
+ s.source_files = 'RunKeeper/**/*.{h,m}'
+
+ s.resources = "images/*.png"
+
+ s.requires_arc = true
+
+ s.dependency 'AFNetworking', '~> 1.2.0'
+ s.dependency 'NXOAuth2Client', '~> 1.2.0'
+end
| Add Podspec with AFNetworking version updated
|
diff --git a/core/proc/element_reference_spec.rb b/core/proc/element_reference_spec.rb
index abc1234..def5678 100644
--- a/core/proc/element_reference_spec.rb
+++ b/core/proc/element_reference_spec.rb
@@ -17,7 +17,7 @@ it_behaves_like :proc_call_on_proc_or_lambda, :call
end
-ruby_version_is "2.6" do
+ruby_bug "#15118", ""..."2.6" do
describe "Proc#[] with frozen_string_literals" do
it "doesn't duplicate frozen strings" do
ProcArefSpecs.aref.frozen?.should be_false
| Use ruby_bug since other implementations should behave correctly for all versions |
diff --git a/UIFontComplete.podspec b/UIFontComplete.podspec
index abc1234..def5678 100644
--- a/UIFontComplete.podspec
+++ b/UIFontComplete.podspec
@@ -1,6 +1,6 @@ Pod::Spec.new do |s|
s.name = 'UIFontComplete'
- s.version = '0.1.1'
+ s.version = '0.2.0'
s.summary = 'Make working with UIFont faster and less error-prone'
s.description = <<-DESC
| Update Podspec to point to version 0.2.0
|
diff --git a/db/migrate/082_add_users_options.rb b/db/migrate/082_add_users_options.rb
index abc1234..def5678 100644
--- a/db/migrate/082_add_users_options.rb
+++ b/db/migrate/082_add_users_options.rb
@@ -31,6 +31,7 @@ remove_column :users, :msn
remove_column :users, :aim
remove_column :users, :jabber
+ remove_column :users, :twitter
remove_column :users, :yahoo
remove_column :users, :description
add_column :users, :notify_via_jabber, :tinyint
| Make down for migration 082 complete.
|
diff --git a/lib/ohm/contrib/timestamping.rb b/lib/ohm/contrib/timestamping.rb
index abc1234..def5678 100644
--- a/lib/ohm/contrib/timestamping.rb
+++ b/lib/ohm/contrib/timestamping.rb
@@ -22,14 +22,14 @@ end
def create
- self.created_at ||= Time.now.utc
+ self.created_at ||= Time.now.utc.to_s
super
end
protected
def write
- self.updated_at = Time.now.utc
+ self.updated_at = Time.now.utc.to_s
super
end
| Use Time.now.utc.to_s for both created_at and updated_at to make the set time consistent before and after writing.
|
diff --git a/lib/simple_scheduler/railtie.rb b/lib/simple_scheduler/railtie.rb
index abc1234..def5678 100644
--- a/lib/simple_scheduler/railtie.rb
+++ b/lib/simple_scheduler/railtie.rb
@@ -2,7 +2,7 @@ # Load the rake task into the Rails app
class Railtie < Rails::Railtie
rake_tasks do
- load File.join(File.dirname(__FILE__), "tasks/simple_scheduler_tasks.rake")
+ load File.join(File.dirname(__FILE__), "../tasks/simple_scheduler_tasks.rake")
end
end
end
| Fix path for loading rake task
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.