diff stringlengths 65 26.7k | message stringlengths 7 9.92k |
|---|---|
diff --git a/mysql-tools.gemspec b/mysql-tools.gemspec
index abc1234..def5678 100644
--- a/mysql-tools.gemspec
+++ b/mysql-tools.gemspec
@@ -13,6 +13,8 @@ s.required_rubygems_version = ">= 1.3.6"
s.add_dependency "gli"
+ s.add_dependency "mysql2"
+ s.add_dependency "my_obfuscate"
s.add_development_dependency "aruba"
s.add_development_dependency "rake"
| Update dependency information in gemspec.
|
diff --git a/catarse_stripe.gemspec b/catarse_stripe.gemspec
index abc1234..def5678 100644
--- a/catarse_stripe.gemspec
+++ b/catarse_stripe.gemspec
@@ -18,7 +18,7 @@
s.add_dependency "rails", "~> 3.2.11"
s.add_dependency "activemerchant", ">= 1.17.0"
- s.add_dependency "stripe", :git => 'https://github.com/stripe/stripe-ruby'
+ s.add_dependency "stripe"
s.add_dependency "omniauth-stripe-connect"
s.add_dependency "stripe_event"
| Fix new dependencies and Migrations
|
diff --git a/lib/ansible/transmit.rb b/lib/ansible/transmit.rb
index abc1234..def5678 100644
--- a/lib/ansible/transmit.rb
+++ b/lib/ansible/transmit.rb
@@ -1,9 +1,7 @@ module Ansible
module Transmit
def self.extended(base)
- base.class_eval do
- include ActionController::Live
- end
+ base.class_eval { include ActionController::Live }
end
def transmit(name)
| Use concise block syntax for one liner
|
diff --git a/lib/bonsai/webserver.rb b/lib/bonsai/webserver.rb
index abc1234..def5678 100644
--- a/lib/bonsai/webserver.rb
+++ b/lib/bonsai/webserver.rb
@@ -14,7 +14,7 @@ begin
Page.find("index").render
rescue Exception => e
- @error = e.message
+ @error = e
erb :error
end
end
@@ -23,7 +23,7 @@ begin
Page.find(params[:splat].join).render
rescue Exception => e
- @error = e.message
+ @error = e
erb :error
end
end
| Send the whole exception instance to the view
|
diff --git a/lib/elbow/capistrano.rb b/lib/elbow/capistrano.rb
index abc1234..def5678 100644
--- a/lib/elbow/capistrano.rb
+++ b/lib/elbow/capistrano.rb
@@ -9,11 +9,14 @@ all_cnames= packet.answer.reject { |p| !p.instance_of? Net::DNS::RR::CNAME }
cname = all_cnames.find { |c| c.name == "#{name}."}.cname[0..-2]
- elb = AWS::ELB.new(:access_key_id => fetch(:aws_access_key_id),
- :secret_access_key => fetch(:aws_secret_access_key))
+ aws_region= fetch(:aws_region, 'us-east-1')
+ AWS.config(:access_key_id => fetch(:aws_access_key_id),
+ :secret_access_key => fetch(:aws_secret_access_key),
+ :ec2_endpoint => "ec2.#{aws_region}.amazonaws.com",
+ :elb_endpoint => "elasticloadbalancing.#{aws_region}.amazonaws.com")
- load_balancer = elb.load_balancers.find { |elb| elb.dns_name == cname }
- raise "EC2 Load Balancer not found for #{name}" if load_balancer.nil?
+ load_balancer = AWS::ELB.new.load_balancers.find { |elb| elb.dns_name.downcase == cname.downcase }
+ raise "EC2 Load Balancer not found for #{name} in region #{aws_region}" if load_balancer.nil?
load_balancer.instances.each do |instance|
hostname = instance.dns_name
| Support for different AWS regions.
Simply set a cap variable called 'aws_region' to the region of your
ELB.
|
diff --git a/lib/oo/haunted_house.rb b/lib/oo/haunted_house.rb
index abc1234..def5678 100644
--- a/lib/oo/haunted_house.rb
+++ b/lib/oo/haunted_house.rb
@@ -16,7 +16,7 @@ [S], [S, E], [E], [], [S, E], [], [E], [S],
[S], [S], [S, E], [E], [U, D], [S, E], [U, D], [S],
[], [S], [S, E], [E], [E], [S], [S], [S],
- [S], [S, E], [S], [S], [S, U, D], [], [], [S],
+ [S], [S, E], [S], [], [S, U, D], [], [], [S],
[E], [], [E], [], [S, E], [E], [], [S],
[S, E], [N, S], [E], [E], [], [S], [S], [W],
[E], [E], [E], [E], [E], [E], [E], []
| Make room hidden swing axe.
|
diff --git a/lib/plezi/activation.rb b/lib/plezi/activation.rb
index abc1234..def5678 100644
--- a/lib/plezi/activation.rb
+++ b/lib/plezi/activation.rb
@@ -16,9 +16,10 @@ self.hash_proc_4symstr # creates the Proc object used for request params
@plezi_autostart = true if @plezi_autostart.nil?
Iodine.patch_rack
- if((ENV['PL_REDIS_URL'.freeze] ||= ENV["REDIS_URL"]))
+ if((ENV['PL_REDIS_URL'.freeze] ||= ENV['REDIS_URL'.freeze]))
uri = URI(ENV['PL_REDIS_URL'.freeze])
- Iodine.default_pubsub = Iodine::PubSub::RedisEngine.new(uri.host, uri.port, 0, uri.password)
+ Iodine.default_pubsub = Iodine::PubSub::RedisEngine.new(uri.host, uri.port, (ENV['PL_REDIS_TIMEOUT'.freeze] || ENV['REDIS_TIMEOUT'.freeze]).to_i, uri.password)
+ Iodine.default_pubsub = Iodine::PubSub::Cluster unless Iodine.default_pubsub
end
at_exit do
next if @plezi_autostart == false
| Add timeout support to the ENV
|
diff --git a/lib/whoopsie/railtie.rb b/lib/whoopsie/railtie.rb
index abc1234..def5678 100644
--- a/lib/whoopsie/railtie.rb
+++ b/lib/whoopsie/railtie.rb
@@ -13,15 +13,17 @@
# Adds a condition to decide when an exception must be ignored or not.
# The ignore_if method can be invoked multiple times to add extra conditions.
- config.ignore_if do |exception, options|
- ! Rails.application.config.whoopsie.enable
+ # config.ignore_if do |exception, options|
+ # ! Rails.application.config.whoopsie.enable
+ # end
+
+ if Rails.application.config.whoopsie.enable
+ config.add_notifier :email, {
+ :email_prefix => "[ERROR] ",
+ :sender_address => Rails.application.config.whoopsie.sender,
+ :exception_recipients => Rails.application.config.whoopsie.recipients,
+ }
end
-
- config.add_notifier :email, {
- :email_prefix => "[ERROR] ",
- :sender_address => Rails.application.config.whoopsie.sender,
- :exception_recipients => Rails.application.config.whoopsie.recipients,
- }
end
end
end
| Disable notifications by not configuring notifier
|
diff --git a/Library/Formula/p0f.rb b/Library/Formula/p0f.rb
index abc1234..def5678 100644
--- a/Library/Formula/p0f.rb
+++ b/Library/Formula/p0f.rb
@@ -19,6 +19,6 @@ 'RAAAAAIAAABFAABAbvpAAEAGAAB/AAABfwAAAcv8Iyjt2/Pg' \
'AAAAALAC///+NAAAAgQ/2AEDAwQBAQgKCyrc9wAAAAAEAgAA'
(testpath / 'test.pcap').write(Base64.decode64(pcap))
- system "#{sbin}/p0f", '-r', "#{testpath}/test.pcap"
+ system "#{sbin}/p0f", '-r', 'test.pcap'
end
end
| Use relative path to test file
Reverted last commits use of the full path to the test file.
The executable is tested from within the `testpath`, so it's unnecessary.
|
diff --git a/Socket.IO-Client-Swift.podspec b/Socket.IO-Client-Swift.podspec
index abc1234..def5678 100644
--- a/Socket.IO-Client-Swift.podspec
+++ b/Socket.IO-Client-Swift.podspec
@@ -12,7 +12,7 @@ s.license = { :type => 'MIT' }
s.author = { "Erik" => "nuclear.ace@gmail.com" }
s.ios.deployment_target = '8.0'
- s.osx.deployment_target = '10.10'
+ s.osx.deployment_target = '10.9'
s.tvos.deployment_target = '9.0'
s.source = { :git => "https://github.com/socketio/socket.io-client-swift.git", :tag => 'v7.0.3' }
s.source_files = "Source/**/*.swift"
| Modify mac version base mac os 10.9
|
diff --git a/ve.gemspec b/ve.gemspec
index abc1234..def5678 100644
--- a/ve.gemspec
+++ b/ve.gemspec
@@ -5,6 +5,7 @@ s.platform = Gem::Platform::RUBY
s.authors = ["Kim Ahlström"]
s.email = ["kim.ahlstrom@gmail.com"]
+ s.license = 'MIT'
s.homepage = "http://github.com/kimtaro/ve"
s.summary = 'Ve is a linguistic framework for programmers'
s.description = 'Ve is a linguistic framework for programmers.'
| Add license metadata to gem specification
|
diff --git a/fake_email_validator.gemspec b/fake_email_validator.gemspec
index abc1234..def5678 100644
--- a/fake_email_validator.gemspec
+++ b/fake_email_validator.gemspec
@@ -7,9 +7,9 @@ spec.version = '0.0.1'
spec.authors = ['Maxim Dobryakov']
spec.email = ['maxim.dobryakov@gmail.com']
- spec.summary = %q{E-Mail validator for Rails to block services like mailinator.com}
+ spec.summary = %q{E-Mail validator for Rails to block fake emails}
spec.description = %q{E-Mail validator for Rails to block services like mailinator.com}
- spec.homepage = ''
+ spec.homepage = 'https://github.com/maxd/fake_email_validator'
spec.license = 'MIT'
spec.files = `git ls-files`.split($/)
@@ -18,9 +18,9 @@ spec.require_paths = ['lib']
spec.add_development_dependency 'bundler', '~> 1.5'
- spec.add_development_dependency 'rake'
- spec.add_development_dependency 'minitest'
+ spec.add_development_dependency 'rake', '~> 10.2', '> 10.2.0'
+ spec.add_development_dependency 'minitest', '~> 5.3', '> 5.3.1'
- spec.add_runtime_dependency 'activemodel'
- spec.add_runtime_dependency 'mail'
+ spec.add_runtime_dependency 'activemodel', '~> 4.0', '> 4.0.0'
+ spec.add_runtime_dependency 'mail', '~> 2.5', '> 2.5.3'
end
| Fix warnings related to *.gemspec
|
diff --git a/app/controllers/bench_controller.rb b/app/controllers/bench_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/bench_controller.rb
+++ b/app/controllers/bench_controller.rb
@@ -3,7 +3,7 @@
private
def find_records
- @records = (1..500).map do |n|
+ @records = 500.times.map do |n|
rand(10)
end
end
| Use time.map instead of making a range
|
diff --git a/app/controllers/items_controller.rb b/app/controllers/items_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/items_controller.rb
+++ b/app/controllers/items_controller.rb
@@ -2,10 +2,13 @@ helper_method :display_user_votes_for, :new_item_for_current_user
def index
+ @items = Item.where(item_type_id: 1).includes(:user_votes)
+
@items = if params[:search] == nil
- Item.where(item_type_id: 1).includes(:user_votes).page params[:page]
+ @items.page params[:page]
else
- Item.where(item_type_id: 1).where("lower(title) LIKE ?", "%#{params[:search].downcase}%").includes(:user_votes).page params[:page]
+ @items.where("lower(title) LIKE ?", "%#{params[:search].downcase}%")
+ .page params[:page]
end
end
| Change Item Index Search To Use Least Code
Change Item index search to use lest code in order allow for updates in
the search for future updates.
|
diff --git a/app/controllers/terms_controller.rb b/app/controllers/terms_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/terms_controller.rb
+++ b/app/controllers/terms_controller.rb
@@ -1,7 +1,7 @@ class TermsController < ApplicationController
before_filter :store_location
-
+ layout 'relaunch'
def index
end
| Use new layout for terms controller.
|
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -6,13 +6,14 @@
def create
@user = User.new(user_params)
- if @user.save
- session[:user_id] = @user.id
- redirect_to user_path(@user)
- else
- render "users/new"
+ respond to |format| do
+ if @user.save
+ session[:user_id] = @user.id
+ format.json {render action: 'show', status: :created, location: @user}
+ else
+ "whoops"
+ end
end
- end
def show
@user = User.find_by(id: params[:id])
| Fix user controller to function with Swift and Heroku
|
diff --git a/app/models/cloud_search_document.rb b/app/models/cloud_search_document.rb
index abc1234..def5678 100644
--- a/app/models/cloud_search_document.rb
+++ b/app/models/cloud_search_document.rb
@@ -0,0 +1,20 @@+class CloudSearchDocument
+ include Mongoid::Document
+
+ field :url, type: String
+ field :present_in_sitemap, type: Boolean
+ field :reindexed_at, type: DateTime, default: DateTime.new(2000, 1, 1)
+
+ index({ url: 1 }, unique: true)
+ index({ reindexed_at: -1 }, background: true)
+
+ validates_uniqueness_of :url
+
+ before_destroy :remove_cloudsearch_index
+
+ private
+
+ def remove_cloudsearch_index
+ Makasi::AsariClient.new.remove_item(url)
+ end
+end
| Add cloud search document model.
|
diff --git a/app/models/concerns/participable.rb b/app/models/concerns/participable.rb
index abc1234..def5678 100644
--- a/app/models/concerns/participable.rb
+++ b/app/models/concerns/participable.rb
@@ -32,12 +32,10 @@ case value
when User
[value]
- when Array
+ when Enumerable, ActiveRecord::Relation
value.flat_map { |v| participants_for(v, current_user) }
when Participable
value.participants(current_user)
- when Mentionable
- value.mentioned_users(current_user)
end
end
end
| Fix behavior for Enumerable-like ActiveRecord relations.
|
diff --git a/knife-windows.gemspec b/knife-windows.gemspec
index abc1234..def5678 100644
--- a/knife-windows.gemspec
+++ b/knife-windows.gemspec
@@ -15,7 +15,7 @@
s.required_ruby_version = ">= 1.9.1"
s.add_dependency "winrm", "~> 1.3"
- s.add_dependency "winrm-s", "~> 0.3.0.dev.0"
+ s.add_dependency "winrm-s", "~> 0.3.0"
s.add_dependency "nokogiri"
s.add_development_dependency 'pry'
| Bump winrm-s dep to 0.3.0 final
|
diff --git a/lib/ba_speak/nodes.rb b/lib/ba_speak/nodes.rb
index abc1234..def5678 100644
--- a/lib/ba_speak/nodes.rb
+++ b/lib/ba_speak/nodes.rb
@@ -18,6 +18,5 @@ class RequirementNode < Node; end
class ExamplesNode < Node; end
class RowNode < Node; end
- class TextNode < Node; end
end
| Remove extraneous BA Speak node
|
diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb
index abc1234..def5678 100644
--- a/lib/bundler/source.rb
+++ b/lib/bundler/source.rb
@@ -14,7 +14,7 @@
def version_message(spec)
message = "#{spec.name} #{spec.version}"
- message += " (#{spec.platform})" if spec.platform != Gem::Platform::RUBY
+ message += " (#{spec.platform})" if spec.platform != Gem::Platform::RUBY && !spec.platform.nil?
if Bundler.locked_gems
locked_spec = Bundler.locked_gems.specs.find {|s| s.name == spec.name }
| [Source] Remove empty parenthesis in installing gem message
|
diff --git a/lib/espn_page_grab.rb b/lib/espn_page_grab.rb
index abc1234..def5678 100644
--- a/lib/espn_page_grab.rb
+++ b/lib/espn_page_grab.rb
@@ -0,0 +1,50 @@+require 'rubygems'
+require 'nokogiri'
+require 'open-uri'
+require 'fileutils'
+
+BASE_URL = 'http://espn.go.com/nfl/statistics/player/_/stat/'
+BASE_DIR = {:passing => 'passing/sort/passingYards/year/2013/seasontype/2/qualified/false/count/',
+ :rushing => 'rushing/sort/rushingYards/year/2013/seasontype/2/qualified/false/count/',
+ :receiving => 'receiving/sort/receivingYards/year/2013/seasontype/2/qualified/false/count/',
+ }
+class Scraper
+ def scrape(position)
+ puts "You asked for the #{position} stats\nHere they come."
+ arr = []
+ counts = (1..900).step(40) { |i| arr.push(i) }
+
+ page = Nokogiri::HTML(open(BASE_URL + BASE_DIR[position.to_sym] + '1'))
+ ## Debugging
+ puts "Found '#{page.title}'"
+ #### Writes the first file ####
+ File.open("espn_html_pages/#{position}1.html", 'w'){|f| f.write(page.to_html)}
+ puts "First #{position} file saved successfully"
+
+ #### Find the number of results(players) for the given stat request ####
+ results_div = page.css('#my-players-table div.totalResults').first.content
+ number_results_arr = results_div.split(' ')
+ number_results = number_results_arr[0].to_i
+
+ #### Finding the correct number of pages to find ####
+ if number_results % 40 == 0
+ num_pages = number_results/40
+ else
+ num_pages = (number_results/40) + 1
+ end
+
+ puts "#{num_pages - 1} more pages need to be collected"
+
+ if num_pages > 1
+ #### Grabs each page of stats for passing ####
+ arr[(1..(num_pages-1))].each do |x|
+ page = Nokogiri::HTML(open(BASE_URL + BASE_DIR[position.to_sym] + "#{x}"))
+ #### Writes page to an HTML file on disk ####
+ File.open("espn_html_pages/#{position}#{x}.html", 'w'){|f| f.write(page.to_html)}
+ puts "File #{position}#{x} saved successfully"
+ end
+ end
+ puts "Reached the end of the 'scrape #{position}' method"
+
+ end
+end
| Move grabbing script to lib directory. Add Scrape class
|
diff --git a/lib/freddy/payload.rb b/lib/freddy/payload.rb
index abc1234..def5678 100644
--- a/lib/freddy/payload.rb
+++ b/lib/freddy/payload.rb
@@ -23,7 +23,7 @@
class OjAdapter
def self.parse(payload)
- Oj.load(payload, symbol_keys: true)
+ Oj.strict_load(payload, symbol_keys: true)
end
def self.dump(payload)
| Configure Oj to use strict mode
This is so that strings will stay strings when loaded instead of strings
starting with ':' (a colon) being automatically converted into symbols.
|
diff --git a/lib/howitzer/utils.rb b/lib/howitzer/utils.rb
index abc1234..def5678 100644
--- a/lib/howitzer/utils.rb
+++ b/lib/howitzer/utils.rb
@@ -1,5 +1,5 @@ require 'repeater'
require 'active_support'
-require 'active_support/core_ext'
+require 'active_support/all'
Dir[File.join(File.dirname(__FILE__), "./utils/**/*.rb")].each {|f| require f}
| Fix ActiveSupport gem deprecation error |
diff --git a/lib/hubspot/config.rb b/lib/hubspot/config.rb
index abc1234..def5678 100644
--- a/lib/hubspot/config.rb
+++ b/lib/hubspot/config.rb
@@ -4,7 +4,7 @@ class Config
CONFIG_KEYS = [:hapikey, :base_url, :portal_id, :logger]
- DEFAULT_LOGGER = Logger.new('/dev/null')
+ DEFAULT_LOGGER = Logger.new(nil)
class << self
attr_accessor *CONFIG_KEYS
| Fix failing initialization on Windows
|
diff --git a/lib/rake/file_task.rb b/lib/rake/file_task.rb
index abc1234..def5678 100644
--- a/lib/rake/file_task.rb
+++ b/lib/rake/file_task.rb
@@ -29,12 +29,12 @@
# Are there any prerequisites with a later time than the given time stamp?
def out_of_date?(stamp)
- @prerequisites.any? { |p|
- ptask = application[p, @scope]
- if ptask.instance_of?(Rake::FileTask)
- ptask.timestamp > stamp || ptask.needed?
+ @prerequisites.any? { |prereq|
+ prereq_task = application[prereq, @scope]
+ if prereq_task.instance_of?(Rake::FileTask)
+ prereq_task.timestamp > stamp || prereq_task.needed?
else
- ptask.timestamp > stamp
+ prereq_task.timestamp > stamp
end
}
end
| Use prereq instead of p for variable name
https://github.com/ruby/rake/pull/183/files/a094e2584295005c7b1ee1419b7bf9136b9f4411#r94092645
|
diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb
index abc1234..def5678 100644
--- a/app/mailers/user_mailer.rb
+++ b/app/mailers/user_mailer.rb
@@ -9,20 +9,20 @@ def password_reset(user)
@user = user
- mail to: user.email, subject: "Password Reset"
+ mail to: user.email, subject: "[DO NO REPLY]Password Reset"
end
def new_registration(user)
@user = user
- mail to: user.email, subject: "New Registration[McGill OSD EZnotes]"
+ mail to: user.email, subject: "[DO NO REPLY]New Registration[McGill OSD EZnotes]"
end
def assign_notetaker(notetaker, course)
@notetaker = notetaker
@course = course
- mail to: notetaker.email, subject: "You Have Been Matched[McGill OSD EZnotes]"
+ mail to: notetaker.email, subject: "[DO NO REPLY]You Have Been Matched[McGill OSD EZnotes]"
end
@@ -30,14 +30,14 @@ @user = user
@course = course
- mail to: user.email, subject: "You Have Been Matched[McGill OSD EZnotes]"
+ mail to: user.email, subject: "[DO NO REPLY]You Have Been Matched[McGill OSD EZnotes]"
end
def unassign_notetaker(notetaker, course)
@notetaker = notetaker
@course = course
- mail to: notetaker.email, subject: "You Have Been Unassigned[McGill OSD EZnotes]"
+ mail to: notetaker.email, subject: "[DO NO REPLY]You Have Been Unassigned[McGill OSD EZnotes]"
end
end
| Update email messages to have do no reply in the subject
|
diff --git a/lib/staytus/config.rb b/lib/staytus/config.rb
index abc1234..def5678 100644
--- a/lib/staytus/config.rb
+++ b/lib/staytus/config.rb
@@ -9,7 +9,7 @@ end
def theme_root
- Rails.root.join('content', 'themes', self.theme_name)
+ ENV['STAYTUS_THEME_ROOT'] ? File.join(ENV['STAYTUS_THEME_ROOT'], self.theme_name) : Rails.root.join('content', 'themes', self.theme_name)
end
def version
| Allow to point the theme root somewhere else.
I am currently integrating Staytus into NixOS. This change will allow me to pass a theme from another package. The problem is that packages in NixOS are read-only, which means I cannot copy a theme into the staytus package once it is already there.
|
diff --git a/lib/thor/task_hash.rb b/lib/thor/task_hash.rb
index abc1234..def5678 100644
--- a/lib/thor/task_hash.rb
+++ b/lib/thor/task_hash.rb
@@ -13,7 +13,7 @@ end
def [](name)
- if task = super(name)
+ if task = super(name) || (@klass == Thor && @klass.superclass.tasks[name])
return task.with_klass(@klass)
end
| Make Thor::TaskHash look up tasks from the superclass.
|
diff --git a/lib/webcmd/options.rb b/lib/webcmd/options.rb
index abc1234..def5678 100644
--- a/lib/webcmd/options.rb
+++ b/lib/webcmd/options.rb
@@ -10,7 +10,7 @@ opts.banner = "Usage: webcmd [options]"
opts.on '-o', '--host HOST', 'listen on HOST (default: 0.0.0.0)' do |host|
- options[:Host] = host
+ @options[:Host] = host
end
opts.on '-p', '--port PORT', 'use PORT (default: 9292)' do |port|
| Fix typo in Options class
|
diff --git a/spec/coverage_helper.rb b/spec/coverage_helper.rb
index abc1234..def5678 100644
--- a/spec/coverage_helper.rb
+++ b/spec/coverage_helper.rb
@@ -11,4 +11,9 @@ add_filter '/lib/generators'
add_filter '/spec/'
add_filter '/vendor/'
+ add_filter '/public'
+ add_filter '/swagger'
+ add_filter '/script'
+ add_filter '/log'
+ add_filter '/db'
end
| Add more directories to filter.
|
diff --git a/teamocil.gemspec b/teamocil.gemspec
index abc1234..def5678 100644
--- a/teamocil.gemspec
+++ b/teamocil.gemspec
@@ -3,6 +3,7 @@ require "teamocil"
spec = Gem::Specification.new do |s|
+ # Metadata
s.name = "teamocil"
s.version = Teamocil::VERSION
s.platform = Gem::Platform::RUBY
@@ -11,13 +12,17 @@ s.homepage = "http://github.com/remiprev/teamocil"
s.summary = "Easy window and split layouts for tmux"
s.description = "Teamocil helps you set up window and splits layouts for tmux using YAML configuration files."
- s.files = Dir["lib/**/*.rb", "README.md", "LICENSE", "bin/*", "spec/**/*.rb"]
- s.require_path = "lib"
- s.executables << "teamocil"
- s.add_development_dependency("rake")
- s.add_development_dependency("rspec")
- s.add_development_dependency("yard")
- s.add_development_dependency("maruku")
+ # Manifest
+ s.files = `git ls-files`.split("\n")
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
+ s.require_paths = ["lib"]
+
+ # Dependencies
+ s.add_development_dependency "rake"
+ s.add_development_dependency "rspec"
+ s.add_development_dependency "yard"
+ s.add_development_dependency "maruku"
end
| Use a more futureproof gemspec file
|
diff --git a/pilfer.gemspec b/pilfer.gemspec
index abc1234..def5678 100644
--- a/pilfer.gemspec
+++ b/pilfer.gemspec
@@ -25,7 +25,4 @@ spec.add_development_dependency 'rake'
spec.add_development_dependency 'rack', '~> 1.5.2'
- dev_null = File.exist?('/dev/null') ? '/dev/null' : 'NUL'
- git_files = `git ls-files -z 2>#{dev_null}`
- spec.files &= git_files.split("\0") if $?.success?
end
| Remove shell out to git from gemspec
There's no need to exclude git ignored files so this addition was premature.
|
diff --git a/spec/lib/logicgraph_parser_spec.rb b/spec/lib/logicgraph_parser_spec.rb
index abc1234..def5678 100644
--- a/spec/lib/logicgraph_parser_spec.rb
+++ b/spec/lib/logicgraph_parser_spec.rb
@@ -2,7 +2,7 @@
describe LogicgraphParser do
def open_fixture(name)
- File.open(fixture_file(name))
+ File.open(fixture_file(File.join('ontologies', 'xml', name)))
end
context "LogicgraphParser" do
| Use correct fixture file path.
|
diff --git a/guard-process.gemspec b/guard-process.gemspec
index abc1234..def5678 100644
--- a/guard-process.gemspec
+++ b/guard-process.gemspec
@@ -4,7 +4,7 @@
Gem::Specification.new do |s|
s.name = "guard-process"
- s.version = "0.0.1"
+ s.version = "1.0"
s.authors = ["Mark Kremer"]
s.email = ["mark@socialreferral.com"]
s.homepage = ""
| Set version number to 1.0
|
diff --git a/nehm.gemspec b/nehm.gemspec
index abc1234..def5678 100644
--- a/nehm.gemspec
+++ b/nehm.gemspec
@@ -14,7 +14,7 @@ spec.homepage = 'http://www.github.com/bogem/nehm'
spec.license = 'MIT'
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(Screenshots|Rakefile)/}) }
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(Pictures|Rakefile)/}) }
spec.bindir = 'bin'
spec.executables = 'nehm'
spec.require_paths = ['lib']
| Add removing 'Pictures' folder from gem
|
diff --git a/week-6/gps2_3.rb b/week-6/gps2_3.rb
index abc1234..def5678 100644
--- a/week-6/gps2_3.rb
+++ b/week-6/gps2_3.rb
@@ -0,0 +1,43 @@+# Your Names
+# 1)
+# 2)
+
+# We spent [#] hours on this challenge.
+
+# Bakery Serving Size portion calculator.
+
+def serving_size_calc(item_to_make, num_of_ingredients)
+ library = {"cookie" => 1, "cake" => 5, "pie" => 7}
+ error_counter = 3
+
+ library.each do |food|
+ if library[food] != library[item_to_make]
+ error_counter += -1
+ end
+ end
+
+ if error_counter > 0
+ raise ArgumentError.new("#{item_to_make} is not a valid input")
+ end
+
+ serving_size = library.values_at(item_to_make)[0]
+ remaining_ingredients = num_of_ingredients % serving_size
+
+ case remaining_ingredients
+ when 0
+ return "Calculations complete: Make #{num_of_ingredients / serving_size} of #{item_to_make}"
+ else
+ return "Calculations complete: Make #{num_of_ingredients / serving_size} of #{item_to_make}, you have #{remaining_ingredients} leftover ingredients. Suggested baking items: TODO: MAKE THIS FEATURE"
+ end
+end
+
+p serving_size_calc("pie", 7)
+p serving_size_calc("pie", 8)
+p serving_size_calc("cake", 5)
+p serving_size_calc("cake", 7)
+p serving_size_calc("cookie", 1)
+p serving_size_calc("cookie", 10)
+p serving_size_calc("THIS IS AN ERROR", 5)
+
+# Reflection
+
| Create document for GPS 2.3
|
diff --git a/spec/routing/games_routing_spec.rb b/spec/routing/games_routing_spec.rb
index abc1234..def5678 100644
--- a/spec/routing/games_routing_spec.rb
+++ b/spec/routing/games_routing_spec.rb
@@ -19,10 +19,6 @@ expect(:get => "/games/1/edit").to route_to("games#edit", :id => "1")
end
- it "routes to #create" do
- expect(:post => "/games").to route_to("games#create")
- end
-
it "routes to #update via PUT" do
expect(:put => "/games/1").to route_to("games#update", :id => "1")
end
| Remove spec for game create method
|
diff --git a/raheui.gemspec b/raheui.gemspec
index abc1234..def5678 100644
--- a/raheui.gemspec
+++ b/raheui.gemspec
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
spec.name = 'raheui'
spec.version = Raheui::Version::STRING
- spec.authors = ['ChaYoung You']
+ spec.authors = ['Chayoung You']
spec.email = ['yousbe@gmail.com']
spec.summary = 'Aheui interpreter in Ruby.'
spec.description = 'Aheui interpreter in Ruby.'
| Update capitalization of the name
|
diff --git a/lib/mappers/nuorder/product_mapper.rb b/lib/mappers/nuorder/product_mapper.rb
index abc1234..def5678 100644
--- a/lib/mappers/nuorder/product_mapper.rb
+++ b/lib/mappers/nuorder/product_mapper.rb
@@ -12,6 +12,7 @@ color: 'color',
season: 'season',
department: 'department',
+ category: 'category',
available_from: @wombat_product['available_on'],
pricing: [pricing(@wombat_product)],
sizes: sizes
| Add category to product mapper
|
diff --git a/lib/pipeline_dealers/model/company.rb b/lib/pipeline_dealers/model/company.rb
index abc1234..def5678 100644
--- a/lib/pipeline_dealers/model/company.rb
+++ b/lib/pipeline_dealers/model/company.rb
@@ -27,7 +27,8 @@ :import_id,
:owner_id,
:milestones,
- :is_customer?
+ :is_customer?,
+ :is_customer
# Read only
attrs :won_deals_total,
| Add missing is_customer attribute to Company model
|
diff --git a/lib/ruxero/base_model/attributable.rb b/lib/ruxero/base_model/attributable.rb
index abc1234..def5678 100644
--- a/lib/ruxero/base_model/attributable.rb
+++ b/lib/ruxero/base_model/attributable.rb
@@ -14,7 +14,6 @@ end
def initialize(attributes = {})
- super
_set_attributes(attributes)
end
| Fix error when initializing models
The BaseModel class doesn't inherit from anything so super was an erroneous call
|
diff --git a/lib/tasks/zammad/ci/refresh_envs.rake b/lib/tasks/zammad/ci/refresh_envs.rake
index abc1234..def5678 100644
--- a/lib/tasks/zammad/ci/refresh_envs.rake
+++ b/lib/tasks/zammad/ci/refresh_envs.rake
@@ -18,7 +18,7 @@ refresh_token: ENV['MICROSOFT365_REFRESH_TOKEN'],
)
- token_env = %(MICROSOFT365_REFRESH_TOKEN="#{result[:refresh_token]}")
+ token_env = %(MICROSOFT365_REFRESH_TOKEN='#{result[:refresh_token]}')
File.write(Rails.root.join('fresh.env'), token_env)
end
| Maintenance: Fix env setting for microsoft 365 refresh token.
|
diff --git a/lib/live_soccer/checker.rb b/lib/live_soccer/checker.rb
index abc1234..def5678 100644
--- a/lib/live_soccer/checker.rb
+++ b/lib/live_soccer/checker.rb
@@ -9,7 +9,7 @@
module LiveSoccer
class Checker
- MATCHES_URL = "http://espn.estadao.com.br/old/temporeal/acoes.listaPartidasAjax.tiles.logic?"
+ MATCHES_URL = "http://www.espn.com.br/old/temporeal/acoes.listaPartidasAjax.tiles.logic?"
def self.fetch_matches
@fetch_matches ||= HTTParty.get(MATCHES_URL).parsed_response
| Modify MATCHES_URL. Becasuse old MATCHES_URL is invalid URL.
|
diff --git a/lib/rake_shared_context.rb b/lib/rake_shared_context.rb
index abc1234..def5678 100644
--- a/lib/rake_shared_context.rb
+++ b/lib/rake_shared_context.rb
@@ -1,7 +1,8 @@ require "rake_shared_context/version"
require "rake"
-if defined? RSpec::SharedContext
+begin
+ require "rspec/core"
shared_context "rake" do
let(:rake) { Rake::Application.new }
let(:task_name) { self.class.top_level_description }
@@ -19,4 +20,5 @@ Rake::Task.define_task(:environment)
end
end
+rescue LoadError
end
| Fix bug that raise error when running guard
|
diff --git a/lib/saasable/middleware.rb b/lib/saasable/middleware.rb
index abc1234..def5678 100644
--- a/lib/saasable/middleware.rb
+++ b/lib/saasable/middleware.rb
@@ -8,13 +8,13 @@ Rails::Mongoid.load_models(Rails.application) if defined?(Rails::Mongoid)
env[:saasable] = {:current_saas => saas_for_host(env["SERVER_NAME"])}
- env[:saasable][:current_saas].activate!
+ env[:saasable][:current_saas].activate! if env[:saasable][:current_saas]
@app.call env
end
private
def saas_for_host hostname
- Saasable::Mongoid::SaasDocument.saas_document.find_by_host!(hostname)
+ Saasable::Mongoid::SaasDocument.saas_document.find_by_host!(hostname) rescue nil
end
end | Allow current_saas to be nil |
diff --git a/lib/tasks/sisyphusarm.rake b/lib/tasks/sisyphusarm.rake
index abc1234..def5678 100644
--- a/lib/tasks/sisyphusarm.rake
+++ b/lib/tasks/sisyphusarm.rake
@@ -1,18 +1,29 @@ # encoding: utf-8
-# namespace :sisyphusarm do
-# desc "Import *.src.rpm from SisyphusARM to database"
-# task :srpms => :environment do
-# require 'open-uri'
-# puts "#{Time.now.to_s}: import *.src.rpm from SisyphusARM to database"
-# Srpm.import_srpms('ALT Linux', 'SisyphusARM', '/ALT/Sisyphus/arm/SRPMS.all/*.src.rpm')
-# puts "#{Time.now.to_s}: end"
-# end
-#
+namespace :sisyphusarm do
+ desc 'Update SisyphusARM stuff'
+ task :update => :environment do
+ puts "#{Time.now.to_s}: Update SisyphusARM stuff"
+ puts "#{Time.now.to_s}: update *.src.rpm from SisyphusARM to database"
+ branch = Branch.where(name: 'SisyphusARM', vendor: 'ALT Linux').first
+ Srpm.import_all(branch, '/ALT/Sisyphus/arm/SRPMS.all/*.src.rpm')
+ Srpm.remove_old(branch, '/ALT/Sisyphus/arm/SRPMS.all/')
+ puts "#{Time.now.to_s}: end"
+ end
+
+ desc 'Import *.src.rpm from SisyphusARM to database'
+ task :srpms => :environment do
+ require 'open-uri'
+ puts "#{Time.now.to_s}: import *.src.rpm from SisyphusARM to database"
+ branch = Branch.where(name: 'SisyphusARM', vendor: 'ALT Linux').first
+ Srpm.import_all(branch, '/ALT/Sisyphus/arm/SRPMS.all/*.src.rpm')
+ puts "#{Time.now.to_s}: end"
+ end
+
# desc "Import binary *.arm.rpm/*.noarch.rpm from SisyphusARM to database"
# task :binary => :environment do
# puts "#{Time.now.to_s}: import binary *.arm.rpm/*.noarch.rpm from SisyphusARM to database"
# Package.import_packages_arm('ALT Linux', 'SisyphusARM', '/ALT/Sisyphus/files/arm/RPMS/*.rpm')
# puts "#{Time.now.to_s}: end"
# end
-# end
+end
| Update rake task for sisyphus arm
|
diff --git a/lib/tasks/user_create.rake b/lib/tasks/user_create.rake
index abc1234..def5678 100644
--- a/lib/tasks/user_create.rake
+++ b/lib/tasks/user_create.rake
@@ -0,0 +1,20 @@+begin
+ namespace :user do
+ task :create => :environment do
+ puts "You will be prompted to enter a login, email address and password for the new ADMIN user"
+ print "Enter a login: "
+ login = STDIN.gets
+ print "Enter an email address: "
+ email = STDIN.gets
+ print "Enter a password: "
+ password = STDIN.gets
+ unless login.strip!.blank? || email.strip!.blank? || password.strip!.blank?
+ if User.create(:login => login, :email => email, :password => password, :password_confirmation => password, :role => Role.get_id(:admin))
+ puts "The user was created successfully."
+ else
+ puts "Sorry, the user was not created!"
+ end
+ end
+ end
+ end
+end
| Add rake task to create ADMIN user
|
diff --git a/lib/togls/rules/boolean.rb b/lib/togls/rules/boolean.rb
index abc1234..def5678 100644
--- a/lib/togls/rules/boolean.rb
+++ b/lib/togls/rules/boolean.rb
@@ -27,7 +27,7 @@
Togls::Rules::Boolean.new(true) # rule that always evaluates to on
-Togls::Rules::Boolean.new(false) # rule that always evaluates to false
+Togls::Rules::Boolean.new(false) # rule that always evaluates to off
}
end
| Fix small typo in Boolean rule type description
Why you made the change:
I did this so it would be more easily consumed.
|
diff --git a/lib/travis/logs/receive.rb b/lib/travis/logs/receive.rb
index abc1234..def5678 100644
--- a/lib/travis/logs/receive.rb
+++ b/lib/travis/logs/receive.rb
@@ -1,14 +1,16 @@ # frozen_string_literal: true
+require 'active_support/core_ext/logger'
+
require 'travis/logs'
+require 'travis/logs/helpers/database'
+require 'travis/logs/receive/queue'
+require 'travis/logs/services/process_log_part'
+require 'travis/logs/sidekiq'
+require 'travis/logs/sidekiq/log_parts'
require 'travis/support'
require 'travis/support/exceptions/reporter'
require 'travis/support/metrics'
-require 'travis/logs/receive/queue'
-require 'travis/logs/services/process_log_part'
-require 'travis/logs/helpers/database'
-require 'travis/logs/sidekiq'
-require 'active_support/core_ext/logger'
module Travis
module Logs
| Add requirement for relevant sidekiq class
|
diff --git a/lib/fulmar/domain/task/environment.rake b/lib/fulmar/domain/task/environment.rake
index abc1234..def5678 100644
--- a/lib/fulmar/domain/task/environment.rake
+++ b/lib/fulmar/domain/task/environment.rake
@@ -4,8 +4,6 @@ namespace :environment do
full_configuration[:environments].each_key do |env|
- next if env == :all
-
# Sets the environment to #{env}
task env do
configuration.environment = env
| [TASK] Remove unnecessary condition, :all is removed in config service
|
diff --git a/app/controllers/artists_controller.rb b/app/controllers/artists_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/artists_controller.rb
+++ b/app/controllers/artists_controller.rb
@@ -3,7 +3,7 @@ # GET /artists.json
def index
if params[:genre]
- @artist_names = Image.sectioned(params[:section]).where(genre: params[:genre]).artists
+ @artist_names = Image.sectioned(params[:section]).where(genre: params[:genre]).artists << nil
@artists = @artist_names.map do |name|
{name: name, images: Image.sectioned(params[:section]).where(artist: name).limit(6)}
end
| Include images without an artist name.
|
diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/courses_controller.rb
+++ b/app/controllers/courses_controller.rb
@@ -1,10 +1,13 @@ class CoursesController < ApplicationController
- before_filter :authenticate_user!, :except => [ :show_all ]
- before_filter :get_club, :only => [ :show_all ]
- before_filter :get_course, :only => [ :edit, :update, :change_logo, :upload_logo ]
+ before_filter :authenticate_user!, :except => [ :show, :show_all ]
+ before_filter :get_club, :only => [ :create, :show_all ]
+ before_filter :get_course, :only => [ :show, :edit, :update, :change_logo, :upload_logo ]
+
+ def show
+ redirect_to club_sales_page_path(@course.club) unless user_signed_in? and can?(:read, @course)
+ end
def create
- @club = Club.find params[:club_id]
@course = @club.courses.new
authorize! :create, @course
| Add show Action to Courses Controller
Update the Courses controller to include the show action.
|
diff --git a/app/decorators/procedure_decorator.rb b/app/decorators/procedure_decorator.rb
index abc1234..def5678 100644
--- a/app/decorators/procedure_decorator.rb
+++ b/app/decorators/procedure_decorator.rb
@@ -11,9 +11,17 @@ end
def logo_img
- return h.image_url(LOGO_NAME) if logo.blank?
- File.join(STORAGE_URL, File.basename(logo.path))
+ if logo.blank?
+ h.image_url(LOGO_NAME)
+ else
+ if Features.remote_storage
+ (RemoteDownloader.new logo.filename).url
+ else
+ (LocalDownloader.new logo.path, 'logo').url
+ end
+ end
end
+
def geographic_information
module_api_carto
end
| Fix logo display in development
|
diff --git a/app/serializers/chapter_serializer.rb b/app/serializers/chapter_serializer.rb
index abc1234..def5678 100644
--- a/app/serializers/chapter_serializer.rb
+++ b/app/serializers/chapter_serializer.rb
@@ -4,10 +4,22 @@ has_many :measurements
def last_weeks_entries
- object.entries.where(day: 2.weeks.ago..1.week.ago)
+ if object.completed_at
+ two_weeks_from_end = object.completed_at - 2.weeks
+ one_week_from_end = object.completed_at - 1.week
+ object.entries.where(day: two_weeks_from_end..one_week_from_end)
+ else
+ object.entries.where(day: 2.weeks.ago..1.week.ago)
+ end
end
def this_weeks_entries
- object.entries.where(day: 1.week.ago..Date.today)
+ if object.completed_at
+ one_week_from_end = object.completed_at - 1.week
+ object.entries.where(day: one_week_from_end..object.completed_at)
+ else
+ object.entries.where(day: 1.week.ago..Date.today)
+ end
end
+
end
| Update ChapterSerializer last_weeks_entries and this_weeks_entries
If chapter is completed then the dates will use the completed as date as the basis for range rather than current date
|
diff --git a/utensils.gemspec b/utensils.gemspec
index abc1234..def5678 100644
--- a/utensils.gemspec
+++ b/utensils.gemspec
@@ -5,11 +5,11 @@ Gem::Specification.new do |s|
s.name = "utensils"
s.version = Utensils::VERSION
- s.authors = ["Matt Kitt"]
+ s.authors = ["Mode Set"]
s.email = ["info@modeset.com"]
s.homepage = "https://github.com/modeset/utensils"
- s.summary = "A UI component library"
- s.description = "A UI component library"
+ s.summary = "Client side component library, tuned to work with the asset pipeline."
+ s.description = "Client side component library, tuned to work with the asset pipeline."
s.files = Dir["{app,config,lib,vendor}/**/*"] + ["MIT-LICENSE", "README.md"]
s.test_files = Dir["spec/**/*"]
| Change up the description for the gemspec |
diff --git a/rulers.gemspec b/rulers.gemspec
index abc1234..def5678 100644
--- a/rulers.gemspec
+++ b/rulers.gemspec
@@ -11,7 +11,7 @@ spec.summary = %q{A Rack-based Web Framework}
spec.description = %q{A Rack-based Web Framework,
but with extra awesome.}
- spec.homepage = ""
+ spec.homepage = "http://ifyouseewendy.com"
spec.license = "MIT"
spec.files = `git ls-files`.split($/)
@@ -20,9 +20,10 @@ spec.require_paths = ["lib"]
spec.add_development_dependency "bundler", "~> 1.5"
- spec.add_development_dependency "rake"
+ spec.add_development_dependency "rake", '~> 0'
- spec.add_runtime_dependency "rack"
- spec.add_development_dependency "rack-test"
- spec.add_development_dependency "test-unit"
+ spec.add_runtime_dependency "rack", '~> 1.5'
+ spec.add_development_dependency "rack-test", '~> 0'
+ spec.add_development_dependency "test-unit", '~> 0'
+
end
| Fix to remove warning when gem buiding
|
diff --git a/_plugins/page.rb b/_plugins/page.rb
index abc1234..def5678 100644
--- a/_plugins/page.rb
+++ b/_plugins/page.rb
@@ -0,0 +1,21 @@+module Jekyll
+ class Page
+ #https://github.com/jekyll/jekyll/blob/master/lib/jekyll/convertible.rb#L44
+ def read_yaml(base, name, opts = {})
+ begin
+ self.content = File.read(Jekyll.sanitized_path(base, name),
+ merged_file_read_opts(opts))
+ if content =~ /\A(---\s*\n.*?\n?)^((---|\.\.\.)\s*$\n?)/m
+ self.content = $POSTMATCH
+ self.data = SafeYAML.load($1.gsub(/{{site\.([^}]+)}}/) {|o| site.config[$1]} )
+ end
+ rescue SyntaxError => e
+ Jekyll.logger.warn "YAML Exception reading #{File.join(base, name)}: #{e.message}"
+ rescue Exception => e
+ Jekyll.logger.warn "Error reading file #{File.join(base, name)}: #{e.message}"
+ end
+
+ self.data ||= {}
+ end
+ end
+end
| Allow text replacements in the front matter.
|
diff --git a/benchmarks/concat_vs_interpolate.rb b/benchmarks/concat_vs_interpolate.rb
index abc1234..def5678 100644
--- a/benchmarks/concat_vs_interpolate.rb
+++ b/benchmarks/concat_vs_interpolate.rb
@@ -5,17 +5,18 @@ value = '100'
Tach.meter(1_000) do
tach('concat') do
- key << ': ' << value << "\r\n"
+ temp = ''
+ temp << key << ': ' << value << "\r\n"
end
tach('interpolate') do
- "#{key}: value\r\n"
+ "#{key}: #{value}\r\n"
end
end
# +-------------+----------+
# | tach | total |
# +-------------+----------+
-# | concat | 0.000902 |
+# | interpolate | 0.000404 |
# +-------------+----------+
-# | interpolate | 0.019667 |
-# +-------------+----------++# | concat | 0.000564 |
+# +-------------+----------+
| Update concat vs interpolation benchmark
There was a subtle bug in the benchmark where key actually grows in
size every iteration, so it became "Content-Leght: : 100\r\n" the first
iteration, then "Content-Leght: : 100\r\nContent-Leght: : 100\r\n" the
second one, and so on. While interpolation is creating new strings every
time.
To make it a bit more fair, temporary variable was created.
Also, in the interpolation part, `value` was not being interpolated.
Benchmark numbers were updated as well.
|
diff --git a/app/helpers/reshares_helper.rb b/app/helpers/reshares_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/reshares_helper.rb
+++ b/app/helpers/reshares_helper.rb
@@ -9,9 +9,18 @@
def reshare_link(post)
if reshare?(post)
- link_to t("reshares.reshare.reshare_original"), reshares_path(:root_guid => post.root.guid), :method => :post, :remote => true, :confirm => t('reshares.reshare.reshare_confirmation', :author => post.root.author.name)
+ link_to t("reshares.reshare.reshare_original"),
+ reshares_path(:root_guid => post.root.guid),
+ :method => :post,
+ :remote => true,
+ :confirm => t('reshares.reshare.reshare_confirmation', :author => post.root.author.name)
else
- link_to t("reshares.reshare.reshare", :count => post.reshares.size), reshares_path(:root_guid => post.guid), :method => :post, :remote => true, :confirm => t('reshares.reshare.reshare_confirmation', :author => post.author.name)
+ link_to t("reshares.reshare.reshare",
+ :count => post.reshares.size),
+ reshares_path(:root_guid => post.guid),
+ :method => :post,
+ :remote => true,
+ :confirm => t('reshares.reshare.reshare_confirmation', :author => post.author.name)
end
end
end
| Make reshares helper a little more readable
|
diff --git a/lib/chatrix/bot/parameter.rb b/lib/chatrix/bot/parameter.rb
index abc1234..def5678 100644
--- a/lib/chatrix/bot/parameter.rb
+++ b/lib/chatrix/bot/parameter.rb
@@ -1,5 +1,8 @@+# frozen_string_literal: true
+
module Chatrix
class Bot
+ # Describes a parameter in a command.
class Parameter
MATCHERS = {
normal: /[^\s]+/,
| Add some docs to Parameter
|
diff --git a/lib/cloudstrap/amazon/elb.rb b/lib/cloudstrap/amazon/elb.rb
index abc1234..def5678 100644
--- a/lib/cloudstrap/amazon/elb.rb
+++ b/lib/cloudstrap/amazon/elb.rb
@@ -8,6 +8,16 @@ include ::Contracts::Core
include ::Contracts::Builtin
+ Contract None => ArrayOf[::Aws::ElasticLoadBalancing::Types::LoadBalancerDescription]
+ def list
+ @list ||= list!
+ end
+
+ Contract None => ArrayOf[::Aws::ElasticLoadBalancing::Types::LoadBalancerDescription]
+ def list!
+ @list = call_api(:describe_load_balancers).load_balancer_descriptions
+ end
+
private
def client
| Add method to find ELBs
|
diff --git a/lib/rails-routes-js-utils.rb b/lib/rails-routes-js-utils.rb
index abc1234..def5678 100644
--- a/lib/rails-routes-js-utils.rb
+++ b/lib/rails-routes-js-utils.rb
@@ -11,7 +11,7 @@ compiled_regex = route.path.to_regexp.to_javascript
reqs = route.defaults.merge(parts: route.parts)
if route.name
- "addRouteToEnv({name: '#{route.name}', path: #{compiled_regex} , reqs: #{reqs}});"
+ "addRouteToEnv({name: '#{route.name}', path: #{compiled_regex} , reqs: #{reqs.to_json}});"
end
end.join("\n");
end
| Use builtin routes implementation instead
|
diff --git a/lib/tasks/clear_sidekiq.rake b/lib/tasks/clear_sidekiq.rake
index abc1234..def5678 100644
--- a/lib/tasks/clear_sidekiq.rake
+++ b/lib/tasks/clear_sidekiq.rake
@@ -1,14 +1,15 @@ desc 'Clear all Sidekiq queues'
task clear_sidekiq: :environment do
- sets = [
- Sidekiq::Queue,
- Sidekiq::ScheduledSet,
- Sidekiq::RetrySet,
- Sidekiq::DeadSet
+ queues = Sidekiq::Queue.all
+
+ named_queues = [
+ Sidekiq::ScheduledSet.new,
+ Sidekiq::RetrySet.new,
+ Sidekiq::DeadSet.new
]
- sets.each do |set|
- puts set
- puts set.new.clear
+ [queues + named_queues].each do |queue|
+ puts queue
+ puts queue.clear
end
end
| Improve task to clear Sidekiq
When I first wrote this we only used the default queue, but now that we
have the export queue, this needed some improving. Now, this will work
no matter how many queues we use.
|
diff --git a/lib/guachiman/rails/authorizable.rb b/lib/guachiman/rails/authorizable.rb
index abc1234..def5678 100644
--- a/lib/guachiman/rails/authorizable.rb
+++ b/lib/guachiman/rails/authorizable.rb
@@ -4,6 +4,7 @@
included do
before_action :authorize
+ helper_method :authorization
private :current_resource, :authorize, :unauthorized
end
| Make authorization available as a view helper
|
diff --git a/lib/omniship/dhlgm/track/package.rb b/lib/omniship/dhlgm/track/package.rb
index abc1234..def5678 100644
--- a/lib/omniship/dhlgm/track/package.rb
+++ b/lib/omniship/dhlgm/track/package.rb
@@ -25,8 +25,8 @@ # 600 : DELIVERED
# 699 : DELIVERY STATUS NOT UPDATED
def has_arrived?
- activity.any? {|activity|
- ['570', '580', '590', '600'].include? activity.code
+ activity.any? {|activity|
+ (activity.code == '699' and has_arrived_at_usps?) or ['570', '580', '590', '600'].include? activity.code
}
end
@@ -35,7 +35,7 @@ # 538 : DEPART USPS SORT FACILITY
# has been accepted by the post office or has been accepted any of these should be good
def has_arrived_at_usps?
- self.activity.any? do |activity|
+ self.activity.any? do |activity|
activity.code == '510' or activity.code == '520' or activity.code == '538'
end
end
| Revert "do not mark arrived if at usps"
This reverts commit 6afbd4355b32a889c4c1c3a8ef52a864eadea258.
|
diff --git a/spec/models/embeddable/multiple_choice_question_spec.rb b/spec/models/embeddable/multiple_choice_question_spec.rb
index abc1234..def5678 100644
--- a/spec/models/embeddable/multiple_choice_question_spec.rb
+++ b/spec/models/embeddable/multiple_choice_question_spec.rb
@@ -0,0 +1,55 @@+require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
+
+
+
+describe Embeddable::MultipleChoice do
+ before(:each) do
+ @page = Factory(:page)
+ @user = Factory(:user)
+ @multichoice = Factory(:multiple_choice)
+ @multichoice.pages << @page
+ @multichoice.user = @user
+ @multichoice.save
+ @multichoice.reload
+ end
+
+ describe "a newly created MutipleChoiceQuestion" do
+ it "should have a non-blank propt" do
+ @multichoice.prompt.should_not be_nil
+ end
+
+ it "should have a user" do
+ @multichoice.user.should_not be_nil
+ @multichoice.user.should == @user
+ end
+
+ it "should belong to a page" do
+ @multichoice.pages.should_not be_nil
+ @multichoice.pages.should include @page
+ end
+
+ it "should have three initial default answers" do
+ @multichoice.choices.should have(3).answers
+ end
+ end
+
+ describe "adding a new choice" do
+ before(:each) do
+ @choice = @multichoice.addChoice("my choice")
+ @multichoice.reload
+ end
+
+ it "should have the new choice" do
+ @multichoice.choices.should include @choice
+ end
+
+ it "should update its choices when saved" do
+ @choice.choice = "fooo"
+ @choice.save
+ @multichoice.reload
+ @multichoice.choices[3].choice.should == "fooo"
+ end
+
+ end
+
+end
| Test for multiple choice questions. |
diff --git a/recipes/sevenscale_deploy/assets.rb b/recipes/sevenscale_deploy/assets.rb
index abc1234..def5678 100644
--- a/recipes/sevenscale_deploy/assets.rb
+++ b/recipes/sevenscale_deploy/assets.rb
@@ -3,7 +3,7 @@ set(:asset_timestamp) { run_locally(source.local.scm(:log, '-1', '--pretty=format:%cd', '--date=raw', real_revision, '--', *Array(asset_timestamp_directories).flatten))[/^(\d+)/, 1] }
desc 'Mark asset timestamp'
- task :mark, :roles => :app, :except => { :no_release => true } do
+ task :mark, :roles => :web, :except => { :no_release => true } do
run "echo #{asset_timestamp} > #{release_path}/ASSET_TIMESTAMP"
end
end | Update the role for marking
|
diff --git a/sprout-osx-apps/attributes/intellij_ultimate_edition.rb b/sprout-osx-apps/attributes/intellij_ultimate_edition.rb
index abc1234..def5678 100644
--- a/sprout-osx-apps/attributes/intellij_ultimate_edition.rb
+++ b/sprout-osx-apps/attributes/intellij_ultimate_edition.rb
@@ -1,3 +1,3 @@-node.default["intellij_community_edition_download_uri"]="http://download.jetbrains.com/idea/ideaIU-12.1.2.dmg"
-node.default["intellij_community_edition_sha"]="75d981489c52e2af8a015186fbd94cb6c72684622c35d4b6ef91f8e929f2ee77"
-node.default["intellij_community_edition_package_name"]="IntelliJ IDEA 12"
+node.default["intellij_ultimate_edition_download_uri"]="http://download.jetbrains.com/idea/ideaIU-12.1.2.dmg"
+node.default["intellij_ultimate_edition_sha"]="75d981489c52e2af8a015186fbd94cb6c72684622c35d4b6ef91f8e929f2ee77"
+node.default["intellij_ultimate_edition_package_name"]="IntelliJ IDEA 12"
| Fix attribute name for Intellij Ultimate
|
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
@@ -8,14 +8,5 @@ @solved_challenges = current_user&.team&.solved_challenges
end
- def index
- @game = Game.instance
- @categories = @game.categories.includes(:challenges).order(:name)
- @challenges = @game.challenges
- @divisions = @game.divisions
- # Only exists for the purpose of providing an active tab for admins.
- @active_division = @divisions.first
- end
-
def summary; end
end
| Remove Index method from games model since it is unused
|
diff --git a/app/controllers/items_controller.rb b/app/controllers/items_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/items_controller.rb
+++ b/app/controllers/items_controller.rb
@@ -3,7 +3,7 @@
# GET /items
def index
- @items = Item.all
+ @items = Item.order(rating: :desc)
end
# GET /items/1
| Sort items descending by rating
|
diff --git a/cookbooks/fateca/recipes/default.rb b/cookbooks/fateca/recipes/default.rb
index abc1234..def5678 100644
--- a/cookbooks/fateca/recipes/default.rb
+++ b/cookbooks/fateca/recipes/default.rb
@@ -24,4 +24,16 @@ mod_php_apache2 do
webapp_template "fateca.conf.erb"
end
+
+ after_restart do
+ # Add env variables
+ magic_shell_environment 'PATH' do
+ value "$PATH:#{new_resource.path}/current/app/Console"
+ end
+
+ # Changes cake console permission
+ file "#{new_resource.path}/current/app/Console/cake" do
+ mode '777'
+ end
+ end
end | Add cake console command to the path
|
diff --git a/core/app/mailers/activity_mailer.rb b/core/app/mailers/activity_mailer.rb
index abc1234..def5678 100644
--- a/core/app/mailers/activity_mailer.rb
+++ b/core/app/mailers/activity_mailer.rb
@@ -1,9 +1,14 @@ class ActivityMailer < ActionMailer::Base
include Resque::Mailer
+
+ layout "email"
default from: "Factlink <support@factlink.com>"
def new_activity(user, activity)
+ @user = user
+ @activity = activity
+
mail to: user.email, subject: 'New notification!'
end
end
| Set the correct layout for the email and set the correct globals
|
diff --git a/app/models/authorization_code.rb b/app/models/authorization_code.rb
index abc1234..def5678 100644
--- a/app/models/authorization_code.rb
+++ b/app/models/authorization_code.rb
@@ -2,9 +2,6 @@
class AuthorizationCode < ActiveRecord::Base
include ExpirableToken
-
- validates :token, :uniqueness => true
-
def access_token
@access_token ||= expired! && user.access_tokens.create(:client => client)
end
| Revert "Added uniquness validation to authorization code's :token column"
This reverts commit 3a61d79b58c031066078a2163d7407cbd586022e.
Conflicts:
app/models/authorization_code.rb
|
diff --git a/app/presenters/user_presenter.rb b/app/presenters/user_presenter.rb
index abc1234..def5678 100644
--- a/app/presenters/user_presenter.rb
+++ b/app/presenters/user_presenter.rb
@@ -3,9 +3,7 @@ class UserPresenter < BasePresenter
presents :user
- def display_name
- user.display_name
- end
+ delegate :display_name, to: :user
def avatar_link(size = 100)
# TODO implement link to user
| Fix style issue using delegate
|
diff --git a/lib/chaindrive/api.rb b/lib/chaindrive/api.rb
index abc1234..def5678 100644
--- a/lib/chaindrive/api.rb
+++ b/lib/chaindrive/api.rb
@@ -2,7 +2,7 @@
module Chaindrive
class API < Grape::API
- default_format :json
+ format :json
# Define any helper methods that we want to make available inside of any endpoint.
helpers do
| Set the format to JSON.
|
diff --git a/cassandra/recipes/ec2snitch.rb b/cassandra/recipes/ec2snitch.rb
index abc1234..def5678 100644
--- a/cassandra/recipes/ec2snitch.rb
+++ b/cassandra/recipes/ec2snitch.rb
@@ -1,13 +1,13 @@ @topo_map = search(:node, "cassandra_cluster_name:#{node[:cassandra][:cluster_name]} AND ec2:placement_availability_zone").map do |n|
az_parts = n[:ec2][:placement_availability_zone].split('-')
@topo_map[n['ipaddress']] = {:port => n[:cassandra][:storage_port],
- :rack => az_parts.last,
- :dc => az_parts[0..1].join('-')}
+ :rack => az_parts.last[1],
+ :dc => az_parts[0..1].join('-') + "-#{az_parts.last[0]}"}
end
node.set_unless[:cassandra][:ec2_snitch_default_az] = "us-east-1a"
default_az_parts = node[:cassandra][:ec2_snitch_default_az].split('-')
-@default_az = {:rack => default_az_parts.last, :dc => default_az_parts[0..1].join('-')}
+@default_az = {:rack => default_az_parts.last[1], :dc => default_az_parts[0..1].join('-') + "-#{default_az_parts.last[0]}"}
template "/etc/cassandra/rack.properties" do
variables(:topo_map => @topo_map, :default_az => @default_az)
| Split datacenter and area field for EC2 snitch
|
diff --git a/app/controllers/items_controller.rb b/app/controllers/items_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/items_controller.rb
+++ b/app/controllers/items_controller.rb
@@ -37,7 +37,7 @@ flash[:notice] = "Item updated."
redirect_to '/homepage_admin/index'
else
- render '/items/_form'
+ render '/items/_edit'
end
end
| Correct path for edit form
|
diff --git a/app/controllers/items_controller.rb b/app/controllers/items_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/items_controller.rb
+++ b/app/controllers/items_controller.rb
@@ -6,6 +6,7 @@ format.html # index.html.erb
format.xml { render xml: @items }
format.json { render json: @items }
+ end
end
def create
| Add missing end in index method
|
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,14 +1,4 @@ class UsersController < ApplicationController
- def new
- end
-
- def create
-
- end
-
- def index
- end
-
def show
@user = User.find(1)
end
| Add users show, eliminate empty routes in users controller
|
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
@@ -15,18 +15,4 @@
end
- private
-
-
- def set_user
- @user = User.find(params[:id])
- end
-
- def user_owner
- if current_user != @user
- flash[:danger] = "You don't have permissions to do that."
- redirect_to user_dashboard_path(current_user)
- end
- end
-
end
| Move the user helper method to the application controller
|
diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb
index abc1234..def5678 100644
--- a/config/initializers/secret_token.rb
+++ b/config/initializers/secret_token.rb
@@ -4,4 +4,4 @@ # If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
-Lounas::Application.config.secret_token = 'ad6f0067fc5d147ef0d10de68857bb0ded50556510cb355f853c144fcf7a716beac0e49fe6b95b098a6607346aa00b35d326d2ab194f2f3cc03e81b0c0e0ce50'
+Lounas::Application.config.secret_token = ENV['SECRET_TOKEN']
| Move the secret token to environment variable.
In preparation for actual features which make use of sessions.
|
diff --git a/dockerfiroonga.gemspec b/dockerfiroonga.gemspec
index abc1234..def5678 100644
--- a/dockerfiroonga.gemspec
+++ b/dockerfiroonga.gemspec
@@ -19,7 +19,7 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]
- spec.add_development_dependency("test-unit")
+ spec.add_development_dependency("test-unit", ">= 3.0.0")
spec.add_development_dependency("test-unit-notify")
spec.add_development_dependency("bundler")
spec.add_development_dependency("rake")
| Use test-unit 3.0.0 or later for power assert
|
diff --git a/Casks/dashlane.rb b/Casks/dashlane.rb
index abc1234..def5678 100644
--- a/Casks/dashlane.rb
+++ b/Casks/dashlane.rb
@@ -1,8 +1,8 @@ cask :v1 => 'dashlane' do
- version '2.4.1.62949'
- sha256 '97bca51c71ba32e5fa13160a77b9a12824e2e44990958d9831263936ed3f1f40'
+ version :latest
+ sha256 :no_check
- url "https://d3mfqat9ni8wb5.cloudfront.net/releases/2.4.1/#{version}/Dashlane.dmg"
+ url 'https://www.dashlane.com/directdownload?platform=mac'
homepage 'https://www.dashlane.com/'
license :unknown
| Update Dashlane.app to latest version.
|
diff --git a/Casks/goodsync.rb b/Casks/goodsync.rb
index abc1234..def5678 100644
--- a/Casks/goodsync.rb
+++ b/Casks/goodsync.rb
@@ -0,0 +1,10 @@+class Goodsync < Cask
+ version :latest
+ sha256 :no_check
+
+ url 'https://www.goodsync.com/download/goodsync-mac.dmg'
+ homepage 'http://www.goodsync.com'
+ license :commercial
+
+ app 'GoodSync.app'
+end
| Add GoodSync.app (4.9.7.0) or Latest
|
diff --git a/tests/requests/dns/change_resource_record_sets_tests.rb b/tests/requests/dns/change_resource_record_sets_tests.rb
index abc1234..def5678 100644
--- a/tests/requests/dns/change_resource_record_sets_tests.rb
+++ b/tests/requests/dns/change_resource_record_sets_tests.rb
@@ -19,9 +19,9 @@ }]
result = Fog::DNS::AWS.change_resource_record_sets_data('zone_id123', change_batch)
- .match(%r{<GeoLocation>.*</GeoLocation>})
+ geo = result.match(%r{<GeoLocation>.*</GeoLocation>})
returns("<GeoLocation><CountryCode>US</CountryCode><SubdivisionCode>AR</SubdivisionCode></GeoLocation>") {
- result ? result[0] : ''
+ geo ? geo[0] : ''
}
result
| Fix syntax for ruby 1.8.7
|
diff --git a/Formula/dinghy.rb b/Formula/dinghy.rb
index abc1234..def5678 100644
--- a/Formula/dinghy.rb
+++ b/Formula/dinghy.rb
@@ -18,7 +18,7 @@ prefix.install "cli"
end
- def caveats; <<-EOS.undent
+ def caveats; <<~EOS
Run `dinghy create` to create the VM, then `dinghy up` to bring up the VM and services.
EOS
end
| Update HEREDOC as per deprecations. |
diff --git a/app/controllers/dotpay_controller.rb b/app/controllers/dotpay_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/dotpay_controller.rb
+++ b/app/controllers/dotpay_controller.rb
@@ -2,7 +2,7 @@ def confirm
@dotpay = DotpayPayment.new(request.raw_post)
if @dotpay.acknowledge
- @order = Order.find_by(description: @dotpay.description)
+ @order = Order.find_by(payment_description: @dotpay.description)
@order.update(status: @dotpay.status)
@order.paid!
else
| Fix wrong search in DotpayController
The controller should look for orders by the column
"payment_description", not "description". The latter does not exist in
Order model.
|
diff --git a/app/controllers/events_controller.rb b/app/controllers/events_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/events_controller.rb
+++ b/app/controllers/events_controller.rb
@@ -13,6 +13,7 @@
if valid_events.include?(event)
request.body.rewind
+ data = request.body.read
if verify_signature(data)
Resque.enqueue(Receiver, event, delivery, event_params)
| Fix bug from merging in upstream
|
diff --git a/app/controllers/random_controller.rb b/app/controllers/random_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/random_controller.rb
+++ b/app/controllers/random_controller.rb
@@ -5,15 +5,17 @@ end
def activity
- if request.method != "GET"
- candidates = Array.new
- candidates = candidates + current_user.primary_identity.activities.to_a
- if candidates.length > 0
- @result = candidates[rand(candidates.length)]
- category_name = @result.class.name.pluralize.underscore
- @category = Myp.categories(User.current_user)[category_name.to_sym]
- @result_link = "/" + category_name + "/" + @result.id.to_s
- end
+ identity = current_user.primary_identity
+ candidates = Array.new
+ candidates = candidates + identity.activities.to_a
+ candidates = candidates + identity.websites.to_a
+ candidates = candidates + identity.movies.to_a
+ candidates = candidates + identity.books.to_a
+ if candidates.length > 0
+ @result = candidates[rand(candidates.length)]
+ category_name = @result.class.name.pluralize.underscore
+ @category = Myp.categories(User.current_user)[category_name.to_sym]
+ @result_link = "/" + category_name + "/" + @result.id.to_s
end
end
end
| Add websites, movies, and books to random activity candidates
|
diff --git a/windows/cookbooks/packer/recipes/enable_remote_desktop.rb b/windows/cookbooks/packer/recipes/enable_remote_desktop.rb
index abc1234..def5678 100644
--- a/windows/cookbooks/packer/recipes/enable_remote_desktop.rb
+++ b/windows/cookbooks/packer/recipes/enable_remote_desktop.rb
@@ -1,5 +1,8 @@-execute 'Enable RDP' do
- command 'reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f'
+registry_key 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server' do
+ values [{
+ name: 'fDenyTSConnections',
+ type: :dword,
+ data: 0, }]
end
execute 'Enable RDP firewall rule' do
| Use the registry resource instead of execute
Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
|
diff --git a/app/presenters/document_presenter.rb b/app/presenters/document_presenter.rb
index abc1234..def5678 100644
--- a/app/presenters/document_presenter.rb
+++ b/app/presenters/document_presenter.rb
@@ -23,7 +23,7 @@ end
def breadcrumbs
- root = OpenStruct.new(link: '/guidance/employment-income-manual', label: 'Main contents')
+ root = OpenStruct.new(link: '/guidance/employment-income-manual', label: 'Contents')
crumbs = document['details']['breadcrumbs'][1..-2].map do | section_id |
OpenStruct.new(link: "/guidance/employment-income-manual/#{section_id}", label: section_id)
end
| Rename 'Main contents' to 'Contents' in breadcrumb
|
diff --git a/app/services/paypal_items_builder.rb b/app/services/paypal_items_builder.rb
index abc1234..def5678 100644
--- a/app/services/paypal_items_builder.rb
+++ b/app/services/paypal_items_builder.rb
@@ -15,11 +15,9 @@ # Because PayPal doesn't accept $0 items at all.
# See https://github.com/spree-contrib/better_spree_paypal_express/issues/10
# "It can be a positive or negative value but not zero."
- items.reject! do |item|
+ items.reject do |item|
item[:Amount][:value].zero?
end
-
- items
end
private
| Simplify filtering items with zero price
|
diff --git a/zendesk2.gemspec b/zendesk2.gemspec
index abc1234..def5678 100644
--- a/zendesk2.gemspec
+++ b/zendesk2.gemspec
@@ -22,6 +22,6 @@ gem.add_dependency 'cistern', '~> 2.3'
gem.add_dependency 'faraday', '~> 0.9'
gem.add_dependency 'faraday_middleware', '~> 0.9'
- gem.add_dependency 'jwt', '~> 1.0'
+ gem.add_dependency 'jwt', '~> 2.0'
gem.add_dependency 'json', '> 1.7', '< 3.0'
end
| Update jwt lib to latest version
|
diff --git a/config/requirements.rb b/config/requirements.rb
index abc1234..def5678 100644
--- a/config/requirements.rb
+++ b/config/requirements.rb
@@ -4,7 +4,7 @@ require 'rubygems'
%w[rake hoe newgem rubigen ZenTest].each do |req_gem|
begin
- require req_gem
+ require req_gem.downcase
rescue LoadError
puts "This Rakefile requires the '#{req_gem}' RubyGem."
puts "Installation: gem install #{req_gem} -y"
| Load correct ZenTest library: ZenTest.rb had been renamed to zentest.rb back in version 3.1.0.
|
diff --git a/api/app/views/spree/api/products/index.v1.rabl b/api/app/views/spree/api/products/index.v1.rabl
index abc1234..def5678 100644
--- a/api/app/views/spree/api/products/index.v1.rabl
+++ b/api/app/views/spree/api/products/index.v1.rabl
@@ -3,6 +3,7 @@ node(:total_count) { @products.total_count }
node(:current_page) { params[:page] ? params[:page].to_i : 1 }
node(:pages) { @products.num_pages }
+node(:per_page) { params[:per_page] || Kaminari.config.default_per_page }
child(@products) do
extends "spree/api/products/show"
end
| [api] Add missing per_page node to products/index
|
diff --git a/db/migrate/20120313214939_link_line_items_to_bookings.rb b/db/migrate/20120313214939_link_line_items_to_bookings.rb
index abc1234..def5678 100644
--- a/db/migrate/20120313214939_link_line_items_to_bookings.rb
+++ b/db/migrate/20120313214939_link_line_items_to_bookings.rb
@@ -1,3 +1,11 @@+# Monkey patch Invoice to adjust for new model
+class Invoice
+ def calculate_amount ; end
+ def update_amount ; end
+ def calculate_due_amount ; end
+ def update_due_amount ; end
+end
+
class LinkLineItemsToBookings < ActiveRecord::Migration
def up
# Cleanup
| Add monkey patch to fix migration link_line_items_to_bookings.
|
diff --git a/app/contexts/events_watch_context.rb b/app/contexts/events_watch_context.rb
index abc1234..def5678 100644
--- a/app/contexts/events_watch_context.rb
+++ b/app/contexts/events_watch_context.rb
@@ -4,16 +4,14 @@ at_execution :fetch_events
def initialize(watch_str)
- self.watch_list = watch_str.split(',') if watch_str
+ self.watch_list = watch_str.split(',')
self.payload = {}
end
private
def fetch_events
- return if watch_list.empty?
result = EventPool.find(*watch_list)
- return if result.empty?
watch_list.zip(result).each do |w, r|
next if r.nil?
data = JSON.parse r
| Remove empty checking for watchlist.
|
diff --git a/spec/graphql/queries/member_spec.rb b/spec/graphql/queries/member_spec.rb
index abc1234..def5678 100644
--- a/spec/graphql/queries/member_spec.rb
+++ b/spec/graphql/queries/member_spec.rb
@@ -30,7 +30,7 @@ let(:variables) { { id: member.id } }
let(:context) { graphql_context }
- let(:member) { create(:member) }
+ let(:member) { create(:member, avatar: create(:avatar)) }
let!(:play) { create(:play, member: member) }
it 'returns Member' do
@@ -41,7 +41,7 @@ name: member.name,
url: member.url,
bio: member.bio,
- avatarUrl: member.avatar ? String : nil,
+ avatarUrl: member.avatar.image_url(64),
playedInstruments: Array,
playedSongs: {
edges: [
| Improve spec for GraphQL query: member
|
diff --git a/app/uploaders/attachment_uploader.rb b/app/uploaders/attachment_uploader.rb
index abc1234..def5678 100644
--- a/app/uploaders/attachment_uploader.rb
+++ b/app/uploaders/attachment_uploader.rb
@@ -7,6 +7,6 @@ # Override the directory where uploaded files will be stored.
# This is a sensible default for uploaders that are meant to be mounted:
def store_dir
- root.join(model.class.to_s.underscore, mounted_as.to_s, model.id.to_s)
+ root.join('tenant', Apartment::Database.current, model.class.to_s.underscore, mounted_as.to_s, model.id.to_s)
end
end
| Use tenant namespace when persisting uploads.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.