diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/test/test_maker_ocf.rb b/test/test_maker_ocf.rb
index abc1234..def5678 100644
--- a/test/test_maker_ocf.rb
+++ b/test/test_maker_ocf.rb
@@ -14,7 +14,7 @@
def test_container
expected = Nokogiri.XML(<<EOC)
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
<container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container">
<rootfiles>
<rootfile full-path="OPS/contents.opf" media-type="application/oebps-package+xml" />
|
Modify a test following implementation
|
diff --git a/models/sanitizer.rb b/models/sanitizer.rb
index abc1234..def5678 100644
--- a/models/sanitizer.rb
+++ b/models/sanitizer.rb
@@ -14,7 +14,12 @@ def clean
strip_spaces_off
return false if has_quit?
+ no_letters_please
send_to_file
+ end
+
+ def no_letters_please
+
end
def has_quit?
|
Make a method that gets rid warns against letters
|
diff --git a/tests/serverspec/spec/spec_init.rb b/tests/serverspec/spec/spec_init.rb
index abc1234..def5678 100644
--- a/tests/serverspec/spec/spec_init.rb
+++ b/tests/serverspec/spec/spec_init.rb
@@ -10,5 +10,4 @@ print " DOCKER_IMAGE: " + ENV['DOCKER_IMAGE'] + "\n"
print " OS_FAMILY: " + ENV['OS_FAMILY'] + "\n"
print " OS_VERSION: " + ENV['OS_VERSION'] + "\n"
-print " OS_VERSION: " + ENV['OS_VERSION'] + "\n"
print "\n"
|
Remove duplicate log message for OS_VERSION
|
diff --git a/app/controllers/api/v1/frontend/questions_controller.rb b/app/controllers/api/v1/frontend/questions_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/api/v1/frontend/questions_controller.rb
+++ b/app/controllers/api/v1/frontend/questions_controller.rb
@@ -7,7 +7,7 @@ def index
instrument = current_project.instruments.find(params[:instrument_id])
if params[:page].blank?
- questions = instrument.questions.collect{|question| [question.id, question.number_in_instrument]}
+ questions = instrument.questions
else
questions = instrument.questions.page(params[:page]).per(Settings.questions_per_page)
end
|
Remove collect due to policy error
|
diff --git a/test/apps/rails3.1/lib/somelib.rb b/test/apps/rails3.1/lib/somelib.rb
index abc1234..def5678 100644
--- a/test/apps/rails3.1/lib/somelib.rb
+++ b/test/apps/rails3.1/lib/somelib.rb
@@ -2,5 +2,6 @@ def test_negative_array_index
#This should not cause an error, but it used to
[][-1]
+ [-1][-1]
end
end
|
Add another test for negative array index
|
diff --git a/core/app/models/concerns/spree/calculated_adjustments.rb b/core/app/models/concerns/spree/calculated_adjustments.rb
index abc1234..def5678 100644
--- a/core/app/models/concerns/spree/calculated_adjustments.rb
+++ b/core/app/models/concerns/spree/calculated_adjustments.rb
@@ -4,7 +4,7 @@
included do
has_one :calculator, class_name: "Spree::Calculator", as: :calculable, inverse_of: :calculable, dependent: :destroy, autosave: true
- accepts_nested_attributes_for :calculator
+ accepts_nested_attributes_for :calculator, update_only: true
validates :calculator, presence: true
end
|
Add update_only on calculator attribute assignment
This allows us to change the type and assign attributes to the
calculator at the same time. Otherwise it would attempt to build a
calculator (with base class Spree::Calculator) when an id wasn't
specified.
|
diff --git a/lib/did_you_mean/word_collection.rb b/lib/did_you_mean/word_collection.rb
index abc1234..def5678 100644
--- a/lib/did_you_mean/word_collection.rb
+++ b/lib/did_you_mean/word_collection.rb
@@ -14,8 +14,10 @@ def similar_to(target_word)
target_word = target_word.to_s
threshold = threshold(target_word)
-
- select {|word| Levenshtein.distance(word.to_s, target_word) <= threshold }
+ map { |word| [Levenshtein.distance(word.to_s, target_word), word] }
+ .select { |distance, _| distance <= threshold }
+ .sort { |a, b| a[0] <=> b[0] }
+ .map { |_, word| word }
end
private
|
Order word suggestions are recommended based on Levenshtein.distance.
|
diff --git a/plugins/custom_forms/lib/custom_forms_plugin/alternative.rb b/plugins/custom_forms/lib/custom_forms_plugin/alternative.rb
index abc1234..def5678 100644
--- a/plugins/custom_forms/lib/custom_forms_plugin/alternative.rb
+++ b/plugins/custom_forms/lib/custom_forms_plugin/alternative.rb
@@ -5,6 +5,6 @@
belongs_to :field, :class_name => 'CustomFormsPlugin::Field'
- attr_accessible :label, :field, :position
+ attr_accessible :label, :field, :position, :selected_by_default
end
|
Add attr_accessible to Alternative's selected_by_default attribute
(ActionItem3262)
|
diff --git a/lib/public_activity/view_helpers.rb b/lib/public_activity/view_helpers.rb
index abc1234..def5678 100644
--- a/lib/public_activity/view_helpers.rb
+++ b/lib/public_activity/view_helpers.rb
@@ -6,6 +6,12 @@ def render_activity activity, options = {}
activity.render self, options
end
+ # Helper for setting content_for in activity partial, needed to
+ # flush remains in between partial renders.
+ def single_content_for(name, content = nil, &block)
+ @view_flow.set(name, ActiveSupport::SafeBuffer.new)
+ content_for(name, content, &block)
+ end
end
ActionView::Base.class_eval { include ViewHelpers }
|
Add single_content_for helper for use in activity partials
|
diff --git a/lib/texas/build/task/publish_pdf.rb b/lib/texas/build/task/publish_pdf.rb
index abc1234..def5678 100644
--- a/lib/texas/build/task/publish_pdf.rb
+++ b/lib/texas/build/task/publish_pdf.rb
@@ -29,7 +29,7 @@ output = `grep "Output written on" #{file}`
numbers = output.scan(/\((\d+?) pages\, (\d+?) bytes\)\./).flatten
@page_count = numbers.first.to_i
- "Written PDF in #{dest_file.gsub(root, '')} (#{@page_count} pages)".green
+ "Written PDF in #{dest_file.gsub(build.root, '')} (#{@page_count} pages)".green
}
end
|
Use build.root instead of root in verbose output of Task::PublishPDF
|
diff --git a/0_code_wars/a_rule_of_divisibility_by_7.rb b/0_code_wars/a_rule_of_divisibility_by_7.rb
index abc1234..def5678 100644
--- a/0_code_wars/a_rule_of_divisibility_by_7.rb
+++ b/0_code_wars/a_rule_of_divisibility_by_7.rb
@@ -0,0 +1,41 @@+# http://www.codewars.com/kata/55e6f5e58f7817808e00002e
+# --- iteration 1 ---
+@count = 0
+
+def seven(m)
+ y, x = [m.to_s[-1], m.to_s[0...-1]].map(&:to_i)
+ new_m = x - 2*y
+ if m.to_s.size <= 2
+ count_temp = @count
+ @count = 0
+ return [m, count_temp]
+ else divisible_by_seven?(m) && m.to_s.size == 2
+ @count += 1
+ seven(new_m)
+ end
+end
+
+def divisible_by_seven?(x)
+ x % 7 == 0
+end
+
+# --- iteration 2 ---
+def seven(m, cnt = 0)
+ x, y = m.divmod(10)
+ if m < 100
+ return [m, cnt]
+ else
+ seven(x - 2*y, cnt + 1)
+ end
+end
+
+# --- iteration 3 ---
+def seven(m, c=0)
+ m < 100 ? [m, c] : seven(m.divmod(10)[0] - 2*m.divmod(10)[1], c+1)
+end
+
+# --- iteration 4 ---
+def seven(m, step = 0)
+ x, y = m.divmod(10)
+ m < 100 ? [m, step] : seven(x - 2*y, step + 1)
+end
|
Add code wars (7) - divisibility by 7
|
diff --git a/slack-post.gemspec b/slack-post.gemspec
index abc1234..def5678 100644
--- a/slack-post.gemspec
+++ b/slack-post.gemspec
@@ -8,8 +8,8 @@ spec.version = Slack::Post::VERSION
spec.authors = ["John Bragg"]
spec.email = ["remotezygote@gmail.com"]
- spec.description = %q{Pretty simple really. It posts to slack fer ya.}
- spec.summary = %q{It's for posting messages to your slack.}
+ spec.description = 'Pretty simple really. It posts to slack fer ya.'
+ spec.summary = "It's for posting messages to your slack."
spec.homepage = ""
spec.license = "MIT"
|
Use standard quotes not %q{}
|
diff --git a/spec/command_publish_spec.rb b/spec/command_publish_spec.rb
index abc1234..def5678 100644
--- a/spec/command_publish_spec.rb
+++ b/spec/command_publish_spec.rb
@@ -6,9 +6,10 @@ pub = double("publisher")
pub.should_receive(:publish) { [] }
Ploy::Publisher.should_receive(:new).with("test.yml") { pub }
-
+ subject = Ploy::Command::Publish.new
+ subject.stub(:is_pull_request_build) { false }
argv = ["test.yml"]
- expect(Ploy::Command::Publish.new.run(argv)).to be_true
+ expect(subject.run(argv)).to be_true
end
end
describe "#help" do
|
Make tests work in Travis during a PR build :/
|
diff --git a/spec/commands/record_spec.rb b/spec/commands/record_spec.rb
index abc1234..def5678 100644
--- a/spec/commands/record_spec.rb
+++ b/spec/commands/record_spec.rb
@@ -8,10 +8,7 @@ it { should respond_to(:args) }
it { should respond_to(:parse) }
- describe "with only known options" do
-
- let(:command) { Record.new(['-m', 'message', '-a']) }
-
+ shared_examples "record with known options" do
describe "parse" do
subject { command.parse }
@@ -20,18 +17,23 @@ end
end
+ describe "with only known options" do
+ let(:command) { Record.new(['-m', 'message', '-a']) }
+ it_should_behave_like "record with known options"
+ end
+
+ describe "with a compound argument" do
+ let(:command) { Record.new(['-am', 'message']) }
+ it_should_behave_like "record with known options"
+ end
+
describe "with some unknown options" do
let(:command) { Record.new(['-m', 'message', '-a', '-z', '--foo']) }
+
+ it_should_behave_like "record with known options"
it "should not raise an error" do
expect { command.parse }.not_to raise_error(OptionParser::InvalidOption)
end
-
- describe "parse" do
- subject { command.parse }
-
- its(:message) { should == 'message' }
- its(:all) { should be_true }
- end
end
end
|
Refactor to use shared examples
|
diff --git a/existing_datatypes_to_dot.rb b/existing_datatypes_to_dot.rb
index abc1234..def5678 100644
--- a/existing_datatypes_to_dot.rb
+++ b/existing_datatypes_to_dot.rb
@@ -0,0 +1,43 @@+#!/usr/bin/env ruby
+
+require 'libxml'
+require 'graphviz'
+
+include LibXML
+
+doc = XML::Parser.file("#{ARGV[0]}").parse
+
+g = GraphViz.new( :G, :type => :digraph )
+
+parent_nodes = {}
+
+subtype_nodes = {}
+
+doc.find("//datatype").each do |datatype|
+
+ type_spec = datatype.attributes['type']
+
+ parent = type_spec.match(/galaxy.datatypes.([^\:]*)/).captures.first
+ subtype = type_spec.match(/galaxy.datatypes.([^\:]*):(.*)/).captures.last
+
+ extension = datatype.attributes['extension']
+
+ if !parent_nodes[parent]
+ parent_nodes[parent] = g.add_nodes(parent)
+ end
+
+ if !subtype_nodes[subtype]
+ subtype_nodes[subtype] = g.add_nodes(subtype)
+ g.add_edge(parent_nodes[parent],subtype_nodes[subtype])
+ end
+
+ # require 'byebug';byebug
+
+ extnode=g.add_nodes(extension)
+ g.add_edge(subtype_nodes[subtype],extnode)
+
+ # parent_nodes[parent].add_nodes(subtype)
+
+end
+
+puts g.to_s
|
Add script to make graph from datatypes_conf.xml
|
diff --git a/utils/hyperloglog/hll-err.rb b/utils/hyperloglog/hll-err.rb
index abc1234..def5678 100644
--- a/utils/hyperloglog/hll-err.rb
+++ b/utils/hyperloglog/hll-err.rb
@@ -18,7 +18,7 @@ elements << ele
i += 1
}
- r.pfadd('hll',*elements)
+ r.pfadd('hll',elements)
}
approx = r.pfcount('hll')
abs_err = (approx-i).abs
|
Fix HyperLogLog test script for new redis-rb API.
|
diff --git a/lib/has_local_cache.rb b/lib/has_local_cache.rb
index abc1234..def5678 100644
--- a/lib/has_local_cache.rb
+++ b/lib/has_local_cache.rb
@@ -25,9 +25,11 @@ end
module ClassMethods
- def get_cache_with_local_cache(key, &block)
+ # XXX: The actual cache_fu signature is (*args) and will special case
+ # multiple keys vs. options. This should probably be fixed.
+ def get_cache_with_local_cache(key, options={}, &block)
HasLocalCache::RequestCache.get_cache(cache_key(key)) do
- get_cache_without_local_cache key, &block
+ get_cache_without_local_cache key, options, &block
end
end
end
|
Allow options on the get_cache class method.
|
diff --git a/lib/irrc/connecting.rb b/lib/irrc/connecting.rb
index abc1234..def5678 100644
--- a/lib/irrc/connecting.rb
+++ b/lib/irrc/connecting.rb
@@ -28,12 +28,5 @@ def established?
@connection && !@connection.sock.closed?
end
-
- def execute(command)
- return if command.nil? || command == ''
-
- logger.debug "Executing: #{command}"
- @connection.cmd(command).tap {|result| logger.debug "Returned: #{result}" }
- end
end
end
|
Remove unused method, even it was confusing
|
diff --git a/app/mailers/producer_mailer.rb b/app/mailers/producer_mailer.rb
index abc1234..def5678 100644
--- a/app/mailers/producer_mailer.rb
+++ b/app/mailers/producer_mailer.rb
@@ -6,13 +6,7 @@ @coordinator = order_cycle.coordinator
@order_cycle = order_cycle
- subject = "[#{Spree::Config[:site_name]}] Order cycle report"
-
- # if @order_cycle.distributors.any?
- # first_producer = @order_cycle.distributors.first
- # @distribution_date = @order_cycle.pickup_time_for first_producer
- # subject += " for #{@distribution_date}" if @distribution_date.present?
- # end
+ subject = "[#{Spree::Config.site_name}] Order cycle report"
@line_items = Spree::LineItem.
joins(:order => :order_cycle, :variant => :product).
|
Remove commented code, use neater syntax for accessing Spree config var
|
diff --git a/app/models/tenon/item_asset.rb b/app/models/tenon/item_asset.rb
index abc1234..def5678 100644
--- a/app/models/tenon/item_asset.rb
+++ b/app/models/tenon/item_asset.rb
@@ -2,7 +2,6 @@ class ItemAsset < ActiveRecord::Base
# Validations
validates_presence_of :asset
- validates_presence_of :item
# Relationships
belongs_to :asset
|
Remove the requirement of an item on ItemAssets to allow them to be saved before the item is saved
|
diff --git a/app/policies/booking_policy.rb b/app/policies/booking_policy.rb
index abc1234..def5678 100644
--- a/app/policies/booking_policy.rb
+++ b/app/policies/booking_policy.rb
@@ -8,7 +8,7 @@ end
def permitted_attributes
- base_attributes = [:name, :phone_number, :number_of_persons, :starts_at, :restaurant_id]
+ base_attributes = [:name, :phone_number, :number_of_persons, :starts_at, :restaurant_id, :email, :message]
if user.nil?
base_attributes
|
Add email and message to permitted parameters
|
diff --git a/app/services/import_stories.rb b/app/services/import_stories.rb
index abc1234..def5678 100644
--- a/app/services/import_stories.rb
+++ b/app/services/import_stories.rb
@@ -23,14 +23,15 @@ url = 'http://www.wri.org/blog/rss2.xml'
rss = open(url)
feed = RSS::Parser.parse(rss, false)
+ link_sanitizer = Rails::Html::LinkSanitizer.new
puts "Channel Title: #{feed.channel.title}"
feed.items.each do |item|
- title = item.title
+ title = link_sanitizer.sanitize(item.title)
published_at = item.pubDate
story = Story.find_or_initialize_by(title: title,
published_at: published_at)
story.description = item.description
- story.link = item.link
+ story.link = item.link.split(/href="|">/)[1]
story.background_image_url = item.enclosure ? item.enclosure.url : ''
story.tags = item.category ? item.category.content : ''
story.save
|
Add title sanitizer and link split.
|
diff --git a/app/controllers/admin/events_controller.rb b/app/controllers/admin/events_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/admin/events_controller.rb
+++ b/app/controllers/admin/events_controller.rb
@@ -41,6 +41,6 @@ def event_params
params.require(:event)
.permit(:title, :desc, :link_name, :enable,
- meta_attributes: [:event_id, :desc, :keywords, :image] )
+ meta_attributes: [:id, :event_id, :desc, :keywords, :image] )
end
end
|
Fix - Fix admin/event meta image display
|
diff --git a/app/helpers/spree/base_helper_decorator.rb b/app/helpers/spree/base_helper_decorator.rb
index abc1234..def5678 100644
--- a/app/helpers/spree/base_helper_decorator.rb
+++ b/app/helpers/spree/base_helper_decorator.rb
@@ -1,6 +1,5 @@ module Spree
module BaseHelper
-
def item_shipping_address(item)
address = tag(:br)
address << content_tag(:b, t(:ship_to, scope: :subscriptions))
@@ -8,5 +7,8 @@ address if item.product_subscription?
end
+ def is_a_gift(gift)
+ 'display: none;' unless gift
+ end
end
end
|
Create helper to hide gift fields if it's not a gift
|
diff --git a/app/models/extensions/gremlin_indexable.rb b/app/models/extensions/gremlin_indexable.rb
index abc1234..def5678 100644
--- a/app/models/extensions/gremlin_indexable.rb
+++ b/app/models/extensions/gremlin_indexable.rb
@@ -9,7 +9,7 @@ after_commit :notify_indexer_update, on: %i[create update]
def notify_indexer_update
- if deleted_at_changed? && deleted_at.present?
+ if deleted_at? && previous_changes.key?('deleted_at')
NotifyGremlinIndexer.delete_one(id)
else
NotifyGremlinIndexer.index_one(id)
|
Fix envelope deletion detection in indexer notification callback
|
diff --git a/app/models/spree/variant_decorator.rb b/app/models/spree/variant_decorator.rb
index abc1234..def5678 100644
--- a/app/models/spree/variant_decorator.rb
+++ b/app/models/spree/variant_decorator.rb
@@ -1,12 +1,14 @@ Spree::Variant.class_eval do
-
+ include Spree::CurrencyHelpers
include ActionView::Helpers::NumberHelper
def to_hash
price = self.prices.find_by(currency: Spree::Config[:presentation_currency]).display_price.to_html
price_usd = self.prices.find_by(currency: "USD").display_price.to_html
- old_price = self.product.old_price_in_won
- old_price_usd = self.product.old_price_in_dollar
+ if self.product.old_price
+ old_price = display_currency(self.product.old_price, to: 'KRW')
+ old_price_usd = display_currency(self.product.old_price, to: 'USD')
+ end
{
:id => self.id,
:in_stock => self.in_stock?,
|
Fix old price not getting formatted proper
|
diff --git a/app/resources/api/v1/post_resource.rb b/app/resources/api/v1/post_resource.rb
index abc1234..def5678 100644
--- a/app/resources/api/v1/post_resource.rb
+++ b/app/resources/api/v1/post_resource.rb
@@ -1,6 +1,6 @@ class Api::V1::PostResource < JSONAPI::Resource
- before_create :set_author_as_current_user
- before_update :set_editor_as_current_user
+ after_replace_fields :set_author_as_current_user
+ after_replace_fields :set_editor_as_current_user
attributes :banner_url,
:content,
@@ -42,7 +42,7 @@ end
def set_author_as_current_user
- @model.author = context[:current_user]
+ @model.author ||= context[:current_user]
end
def set_editor_as_current_user
|
Move attribute changes to after_replace_fields
For some reason, before_create was not keeping the attribute changes.
|
diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/people_controller.rb
+++ b/app/controllers/people_controller.rb
@@ -4,7 +4,8 @@ def index
@page_title = t('people')
@people = Person.paginate(params)
-
+ @reverse = params[:reverse]
+ @sort_attribute = params[:sort]
end
|
Set some class level variables to help with column sorts on people page
|
diff --git a/app/controllers/status_controller.rb b/app/controllers/status_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/status_controller.rb
+++ b/app/controllers/status_controller.rb
@@ -4,7 +4,7 @@ def get_status
# API checks
test_location = Ohanakapa.location("downtown-palo-alto-food-closet")
- test_search = Ohanakapa.search("search", :org_name => "InnVision")
+ test_search = Ohanakapa.search("search", :keyword => "maceo")
if test_location.blank? || test_search.blank?
status = "API did not respond"
|
Update test search to make status check pass
The status controller used to look for an organization called "InnVision", but that organization's name has been updated. I changed the search to look for keyword "maceo", which returns one of our dummy test locations.
|
diff --git a/spec/bable_spec.rb b/spec/bable_spec.rb
index abc1234..def5678 100644
--- a/spec/bable_spec.rb
+++ b/spec/bable_spec.rb
@@ -6,12 +6,12 @@ end
describe ".index" do
- it "instantiate the default index if no args" do
+ it "instantiates the default index if no args" do
index = described_class.index(fake_text)
expect(index).to be_a(Bable::Index::ColemanLiau)
end
- it "instantiate the given index when args" do
+ it "instantiates the given index when args" do
index = described_class.index(fake_text, index: :ari)
expect(index).to be_a(Bable::Index::Ari)
end
|
Fix typo in the tests
|
diff --git a/Casks/command-line-tools-lion.rb b/Casks/command-line-tools-lion.rb
index abc1234..def5678 100644
--- a/Casks/command-line-tools-lion.rb
+++ b/Casks/command-line-tools-lion.rb
@@ -1,7 +1,9 @@ class CommandLineToolsLion < Cask
+ version 'lion_april_2013'
+ sha256 '20a3e1965c685c6c079ffe89b168c3975c9a106c4b33b89aeac93c8ffa4e0523'
+
url 'http://devimages.apple.com/downloads/xcode/command_line_tools_for_xcode_os_x_lion_april_2013.dmg'
homepage 'https://developer.apple.com/xcode/downloads/'
- version 'lion_april_2013'
- sha256 '20a3e1965c685c6c079ffe89b168c3975c9a106c4b33b89aeac93c8ffa4e0523'
+
link 'Command Line Tools (Lion).mpkg'
end
|
Format Command Line Tools Lion
|
diff --git a/Casks/firefoxdeveloperedition.rb b/Casks/firefoxdeveloperedition.rb
index abc1234..def5678 100644
--- a/Casks/firefoxdeveloperedition.rb
+++ b/Casks/firefoxdeveloperedition.rb
@@ -5,6 +5,7 @@ url "https://download.mozilla.org/?product=firefox-aurora-latest-ssl&os=osx&lang=en-US"
homepage 'https://www.mozilla.org/en-US/firefox/developer/'
license :mpl
+ tags :vendor => 'Mozilla'
app 'FirefoxDeveloperEdition.app'
end
|
Add tag stanza to Firefox Developer Edition
|
diff --git a/ahn_hoptoad.gemspec b/ahn_hoptoad.gemspec
index abc1234..def5678 100644
--- a/ahn_hoptoad.gemspec
+++ b/ahn_hoptoad.gemspec
@@ -17,7 +17,6 @@ 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"]
- s.has_rdoc = false
s.add_runtime_dependency("adhearsion", [">= 1.1.0"])
s.add_runtime_dependency("toadhopper", [">= 1.2.0"])
|
Remove deprecated has_rdoc= from gemspec
|
diff --git a/Invoker.rb b/Invoker.rb
index abc1234..def5678 100644
--- a/Invoker.rb
+++ b/Invoker.rb
@@ -1,5 +1,6 @@ require_relative 'Trick'
require_relative 'ruby-util'
+require_relative 'InputManager'
class Invoker
attr_accessor :input_manager, :current_trick, :menu_state
|
Fix invoker needing input manager
|
diff --git a/lib/tobacco/exhaler.rb b/lib/tobacco/exhaler.rb
index abc1234..def5678 100644
--- a/lib/tobacco/exhaler.rb
+++ b/lib/tobacco/exhaler.rb
@@ -17,7 +17,7 @@ end
def write_content_to_file
- File.open(filepath, 'w') do |f|
+ File.open(filepath, 'wb') do |f|
f.write content
end
end
|
Add 'b' options to File.open
|
diff --git a/pkg/brew/git-req.rb b/pkg/brew/git-req.rb
index abc1234..def5678 100644
--- a/pkg/brew/git-req.rb
+++ b/pkg/brew/git-req.rb
@@ -4,7 +4,6 @@ url "https://github.com/arusahni/git-req/archive/v2.1.0.tar.gz"
sha256 "a7bc8f90230762e93d348dcb22dee93b7c47d07678012976a229950a752a72ff"
- depends_on "git" => :optional
depends_on "rust" => :build
def install
|
Remove git dependency from Homebrew Formula
|
diff --git a/tests/test_unit_analyze.rb b/tests/test_unit_analyze.rb
index abc1234..def5678 100644
--- a/tests/test_unit_analyze.rb
+++ b/tests/test_unit_analyze.rb
@@ -17,7 +17,8 @@
it "should detect duplicates in digit uniqueness check" do
output = capture_stdout {
- load "././sudokuru.rb"
+ load "././app/analyze.rb"
+ load "././app/transmute.rb"
box_map = Matrix.identity(3)
puzzle = Matrix.zero(3)
analysis = Analyze.new(puzzle, box_map)
@@ -30,7 +31,8 @@
it "should raise a deep analysis code error" do
output = capture_stdout {
- load "././sudokuru.rb"
+ load "././app/analyze.rb"
+ load "././app/transmute.rb"
box_map = Matrix.identity(3)
puzzle = Matrix.zero(3)
analysis = Analyze.new(puzzle, box_map)
|
Load only necessary files for the analyze unit tests
Please, sir. May I have some more files?
|
diff --git a/test/queue_test.rb b/test/queue_test.rb
index abc1234..def5678 100644
--- a/test/queue_test.rb
+++ b/test/queue_test.rb
@@ -2,7 +2,8 @@
context "Queue" do
- setup do
+ test "playlist name" do
+ assert_equal 'Play', Play.name
end
end
|
Add test to Queue to stay green
|
diff --git a/ruby/command-t/progress_reporter.rb b/ruby/command-t/progress_reporter.rb
index abc1234..def5678 100644
--- a/ruby/command-t/progress_reporter.rb
+++ b/ruby/command-t/progress_reporter.rb
@@ -2,6 +2,12 @@ # Licensed under the terms of the BSD 2-clause license.
module CommandT
+ # Simple class for displaying scan progress to the user.
+ #
+ # The active scanner calls the `#update` method with a `count` to inform it of
+ # progress, the reporter updates the UI and then returns a suggested count at
+ # which to invoke `#update` again in the future (the suggested count is based
+ # on a heuristic that seeks to update the UI about 5 times per second).
class ProgressReporter
SPINNER = %w[^ > v <]
|
Add a doc comment to ProgressReporter
|
diff --git a/spec/features/items_spec.rb b/spec/features/items_spec.rb
index abc1234..def5678 100644
--- a/spec/features/items_spec.rb
+++ b/spec/features/items_spec.rb
@@ -15,5 +15,12 @@ expect(page).to have_field("item_model", :with => @item.model)
end
+ it "a new item form with proper departments filled in" do
+ @department1 = Department.create(name: "Manages items", manage_items: true)
+ Department.create(name: "Doesn't manage items", manage_items: false)
+ visit new_item_path
+ expect(page).to have_select("item_department_id", :options => [@department1.name, ''])
+ end
+
get_basic_editor_views('item',['name', 'description', 'status'])
end
|
Add test that checks that the only two options in the item form department select are the one that has manage_items as true and the empty option present (:options is an exact match)
|
diff --git a/spec/features/login_spec.rb b/spec/features/login_spec.rb
index abc1234..def5678 100644
--- a/spec/features/login_spec.rb
+++ b/spec/features/login_spec.rb
@@ -0,0 +1,11 @@+require 'rails_helper'
+
+feature 'login' do
+ it "should have a login button on the front page" do
+ visit '/'
+ expect(page).to have_button "Login"
+ end
+
+ click_button "Login"
+ screenshot_and_open_image
+end
|
Add test that looks for login button
|
diff --git a/spec/statsd/version_spec.rb b/spec/statsd/version_spec.rb
index abc1234..def5678 100644
--- a/spec/statsd/version_spec.rb
+++ b/spec/statsd/version_spec.rb
@@ -3,7 +3,7 @@ describe Datadog::Statsd do
describe 'VERSION' do
it 'has a version' do
- expect(Datadog::Statsd::VERSION).to eq '5.3.1'
+ expect(Datadog::Statsd::VERSION).to match /\d+\.\d+\.\d+/
end
end
end
|
Update the version test to just check format
It's good to have a test to make sure VERSION is set, but asserting that
it is equal to a specific version just means we have to change the
version in two places. This updates the test to just check that it's a
X.Y.Z version.
|
diff --git a/account.rb b/account.rb
index abc1234..def5678 100644
--- a/account.rb
+++ b/account.rb
@@ -15,8 +15,12 @@
def start
loop do
- @stream.user do |obj|
- extract_obj(obj)
+ begin
+ @stream.user do |obj|
+ extract_obj(obj)
+ end
+ rescue Exception => ex
+ puts "System -> #{ex.message}"
end
end
end
@@ -46,8 +50,6 @@ @followings << user.id
callback(:friends, obj)
end
- rescue Exception => ex
- puts "System -> #{ex.message}"
end
def is_allowed?(user_id)
|
Fix error handling for EOFError
|
diff --git a/app/lib/telemetry_service.rb b/app/lib/telemetry_service.rb
index abc1234..def5678 100644
--- a/app/lib/telemetry_service.rb
+++ b/app/lib/telemetry_service.rb
@@ -4,6 +4,11 @@ class TelemetryService < AbstractServiceRunner
MESSAGE = "TELEMETRY MESSAGE FROM %s"
FAILURE = "FAILED TELEMETRY MESSAGE FROM %s"
+ THROTTLE_POLICY = ThrottlePolicy.new({
+ ThrottlePolicy::TimePeriod.new(1.minute) => 25,
+ ThrottlePolicy::TimePeriod.new(1.hour) => 250,
+ ThrottlePolicy::TimePeriod.new(1.day) => 1500,
+ })
def process(delivery_info, payload)
device_key = delivery_info
@@ -13,7 +18,11 @@ other_stuff = { device: device_key,
is_telemetry: true,
message: MESSAGE % device_key }
- puts json.merge(other_stuff).to_json
+ THROTTLE_POLICY.track(device_key)
+ violation = THROTTLE_POLICY.is_throttled(device_key)
+ unless violation
+ puts json.merge(other_stuff).to_json
+ end
rescue JSON::ParserError
puts ({ device: device_key,
is_telemetry: true,
|
Add throttle policy to Telemetry channel
|
diff --git a/app/models/display_format.rb b/app/models/display_format.rb
index abc1234..def5678 100644
--- a/app/models/display_format.rb
+++ b/app/models/display_format.rb
@@ -1,7 +1,7 @@ class DisplayFormat < ActiveRecord::Base
attr_accessible :name
- has_many :categorical_traits
- has_many :continuous_traits
+ has_many :categorical_traits, :dependent => :nullify
+ has_many :continuous_traits, :dependent => :nullify
def format_value(value)
case name
when 'integer'
|
Add dependent => nullify to display_fomat
|
diff --git a/lib/active_record/olap/category.rb b/lib/active_record/olap/category.rb
index abc1234..def5678 100644
--- a/lib/active_record/olap/category.rb
+++ b/lib/active_record/olap/category.rb
@@ -14,7 +14,7 @@
if definition.kind_of?(Hash) && definition.has_key?(:expression)
@conditions = definition[:expression]
- @info = definition.delete_if { |k,v| k == :expression }
+ @info = definition.reject { |k,v| k == :expression }
else
@conditions = definition
end
|
Fix of hash that does not retain expression value in production mode.
|
diff --git a/spec/api_classes/tag_spec.rb b/spec/api_classes/tag_spec.rb
index abc1234..def5678 100644
--- a/spec/api_classes/tag_spec.rb
+++ b/spec/api_classes/tag_spec.rb
@@ -2,6 +2,6 @@
describe LastFM::Tag do
it "should define unrestricted methods" do
- LastFM::Tag.unrestricted_methods.should == [:get_similar, :get_top_albums, :get_top_artists, :get_top_tags, :get_top_tracks, :get_weekly_artist_chart, :get_weekly_chart_list, :search]
+ LastFM::Tag.should respond_to(:get_similar, :get_top_albums, :get_top_artists, :get_top_tags, :get_top_tracks, :get_weekly_artist_chart, :get_weekly_chart_list, :search)
end
end
|
Check method definitions for Tag
|
diff --git a/spec/joystick_events_spec.rb b/spec/joystick_events_spec.rb
index abc1234..def5678 100644
--- a/spec/joystick_events_spec.rb
+++ b/spec/joystick_events_spec.rb
@@ -9,10 +9,14 @@
describe JoystickAxisMoved do
+
+ before :each do
+ @event = JoystickAxisMoved.new
+ end
it "should have a joystick id" do
- JoystickAxisMoved.new.should respond_to(:joystick_id)
+ @event.should respond_to(:joystick_id)
end
it "should accept positive integers for joystick id"
@@ -21,7 +25,7 @@
it "should have an axis number" do
- JoystickAxisMoved.new.should respond_to(:axis)
+ @event.should respond_to(:axis)
end
it "should accept positive integers for axis number"
@@ -30,7 +34,7 @@
it "should have a value" do
- JoystickAxisMoved.new.should respond_to(:value)
+ @event.should respond_to(:value)
end
it "should only accept numbers for value"
|
Refactor JoystickAxisMoved specs a bit.
|
diff --git a/spec/models/location_spec.rb b/spec/models/location_spec.rb
index abc1234..def5678 100644
--- a/spec/models/location_spec.rb
+++ b/spec/models/location_spec.rb
@@ -2,11 +2,47 @@
RSpec.describe Location do
describe "validations" do
+ subject { FactoryGirl.build(:location) }
+
+ it "is valid for the default factory" do
+ expect(subject).to be_valid
+ end
+
context "#base_path" do
it "should be an absolute path" do
subject.base_path = 'invalid//absolute/path/'
expect(subject).to be_invalid
expect(subject.errors[:base_path].size).to eq(1)
+ end
+ end
+
+ context "when another content item has identical supporting objects" do
+ before do
+ FactoryGirl.create(
+ :content_item,
+ :with_state,
+ :with_translation,
+ :with_location,
+ :with_semantic_version,
+ )
+ end
+
+ let(:content_item) do
+ FactoryGirl.create(
+ :content_item,
+ :with_state,
+ :with_translation,
+ :with_semantic_version,
+ )
+ end
+
+ subject { FactoryGirl.build(:location, content_item: content_item) }
+
+ it "is invalid" do
+ expect(subject).to be_invalid
+
+ error = subject.errors[:content_item].first
+ expect(error).to match(/conflicts with/)
end
end
end
@@ -21,4 +57,32 @@
it_behaves_like RoutesAndRedirectsValidator
end
+
+ describe ".filter" do
+ let!(:vat_item) do
+ FactoryGirl.create(
+ :content_item,
+ :with_location,
+ title: "VAT Title",
+ base_path: "/vat-rates",
+ )
+ end
+
+ let!(:tax_item) do
+ FactoryGirl.create(
+ :content_item,
+ :with_location,
+ title: "Tax Title",
+ base_path: "/tax",
+ )
+ end
+
+ it "filters a content item scope by state name" do
+ vat_items = described_class.filter(ContentItem.all, base_path: "/vat-rates")
+ expect(vat_items.pluck(:title)).to eq(["VAT Title"])
+
+ tax_items = described_class.filter(ContentItem.all, base_path: "/tax")
+ expect(tax_items.pluck(:title)).to eq(["Tax Title"])
+ end
+ end
end
|
Improve test coverage for Location model
|
diff --git a/spec/regression/test_0003.rb b/spec/regression/test_0003.rb
index abc1234..def5678 100644
--- a/spec/regression/test_0003.rb
+++ b/spec/regression/test_0003.rb
@@ -0,0 +1,20 @@+require 'test_helpers'
+describe Alf do
+
+ it 'should meet union/intersect priorities' do
+ db.connect do |conn|
+ rel = conn.query{
+ r1 = union(
+ restrict(suppliers, city: 'Paris'),
+ restrict(suppliers, city: 'London'))
+ r2 = restrict(suppliers, gt(:status, 20))
+ intersect(r1, r2)
+ }
+ exp = conn.query{
+ restrict(suppliers, sid: 'S3')
+ }
+ rel.should eq(exp)
+ end
+ end
+
+end
|
Add regression test about intersect(minus)
|
diff --git a/lib/ews/soap/parsers/ews_parser.rb b/lib/ews/soap/parsers/ews_parser.rb
index abc1234..def5678 100644
--- a/lib/ews/soap/parsers/ews_parser.rb
+++ b/lib/ews/soap/parsers/ews_parser.rb
@@ -28,8 +28,9 @@
def parse(opts = {})
opts[:response_class] ||= EwsSoapResponse
- @soap_resp.gsub!('version="1.0"', 'version="1.1"')
- sax_parser.parse(@soap_resp)
+ # https://github.com/WinRb/Viewpoint/issues/116
+ # sax_parser.parse(@soap_resp)
+ sax_parser.parse(@soap_resp.gsub(/&#x[0-1]?[0-9a-eA-E];/, ' '))
opts[:response_class].new @sax_doc.struct
end
|
Revert "Replace XML version of SOAP response from 1.0 to 1.1"
This reverts commit 506d87c076293fae1ae85d2545fc7c7e84f52a5f.
|
diff --git a/app/services/mute_service.rb b/app/services/mute_service.rb
index abc1234..def5678 100644
--- a/app/services/mute_service.rb
+++ b/app/services/mute_service.rb
@@ -1,9 +1,13 @@ # frozen_string_literal: true
class MuteService < BaseService
- def call(account, target_account)
+ def call(account, target_account, notifications: nil)
return if account.id == target_account.id
FeedManager.instance.clear_from_timeline(account, target_account)
- account.mute!(target_account)
+ # This unwieldy approach avoids duplicating the default value here
+ # and in mute!.
+ opts = {}
+ opts[:notifications] = notifications unless notifications.nil?
+ account.mute!(target_account, **opts)
end
end
|
Add support for muting notifications in MuteService
|
diff --git a/lib/llt/core/api/version_routes.rb b/lib/llt/core/api/version_routes.rb
index abc1234..def5678 100644
--- a/lib/llt/core/api/version_routes.rb
+++ b/lib/llt/core/api/version_routes.rb
@@ -5,7 +5,7 @@
get("#{route}/version") do
dependencies.map do |dep_class|
- versioner = LLT.const_get(dep_class).const_get(:Version).new
+ versioner = LLT.const_get(dep_class).const_get(:VersionInfo).new
versioner.to_xml
end.join
end
|
Fix Dynamic Routes after recent name change
Version class is called VersionInfo now
|
diff --git a/lib/switch_user/provider/devise.rb b/lib/switch_user/provider/devise.rb
index abc1234..def5678 100644
--- a/lib/switch_user/provider/devise.rb
+++ b/lib/switch_user/provider/devise.rb
@@ -7,7 +7,7 @@ end
def login(user, scope = :user)
- @warden.session_serializer.store(user, scope)
+ @warden.set_user(user, :scope => scope)
end
def logout(scope = :user)
|
Revert "Devise provider- don't store sign_in details"
This reverts commit e6147fb8e51e4293a5b00aa6862aec4ca711b7ec.
|
diff --git a/lib/tasks/fix_missing_mr_refs.rake b/lib/tasks/fix_missing_mr_refs.rake
index abc1234..def5678 100644
--- a/lib/tasks/fix_missing_mr_refs.rake
+++ b/lib/tasks/fix_missing_mr_refs.rake
@@ -0,0 +1,48 @@+#--
+# Copyright (C) 2014 Gitorious AS
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#++
+
+desc 'Creates missing refs for given merge request ID'
+task :fix_missing_mr_refs => :environment do
+ require 'fileutils'
+
+ project_slug = ENV['PROJECT_SLUG']
+ repository_name = ENV['REPO_NAME']
+ mr_number = ENV['MR_NUMBER']
+
+ if project_slug.blank? || repository_name.blank? || mr_number.blank?
+ puts "You have to set PROJECT_SLUG, REPO_NAME and MR_NUMBER env variables"
+ exit 1
+ end
+
+ project = Project.find_by_slug(project_slug)
+ repository = project.repositories.find_by_name(repository_name)
+ mr = repository.merge_requests.find_by_sequence_number(mr_number.to_i)
+
+ mr_refs_dir = mr.tracking_repository.full_repository_path + "/refs/merge-requests/#{mr_number}"
+ unless File.exist?(mr_refs_dir)
+ puts "creating missing MR refs directory #{mr_refs_dir}"
+ FileUtils.mkdir_p(mr_refs_dir)
+ end
+
+ mr.versions.each do |version|
+ ref_path = "#{mr_refs_dir}/#{version.version}"
+ unless File.exist?(ref_path)
+ puts "creating missing version ref file #{ref_path} (#{mr.ending_commit})"
+ File.open(ref_path, 'w') { |f| f.puts(mr.ending_commit) }
+ end
+ end
+end
|
Add rake task for creating missing MR refs
Run it like this:
bundle exec rake fix_missing_mr_refs PROJECT_SLUG=foo REPO_NAME=bar MR_NUMBER=123
|
diff --git a/lib/transproc/contrib/hash_keys.rb b/lib/transproc/contrib/hash_keys.rb
index abc1234..def5678 100644
--- a/lib/transproc/contrib/hash_keys.rb
+++ b/lib/transproc/contrib/hash_keys.rb
@@ -0,0 +1,33 @@+module Transproc
+ SEPARATOR = ' '.freeze
+
+ # Join keys together using a default separator token (single space)
+ register(:join_keys) do |hash, mapping|
+ Transproc(:join_keys!, mapping)[Hash[hash]]
+ end
+
+ register(:join_keys!) do |hash, mapping|
+ mapping.each do |to, from|
+ hash[to] = hash.select { |k,v| from.include?(k) }.values.join(SEPARATOR)
+ from.each { |k| hash.delete(k) }
+ end
+
+ hash
+ end
+
+ # Split keys based on a default separator token
+ register(:split_keys) do |hash, mapping|
+ Transproc(:split_keys!, mapping)[Hash[hash]]
+ end
+
+ register(:split_keys!) do |hash, mapping|
+ mapping.each do |to, from|
+ hash[from].split(SEPARATOR).each_with_index do |value, index|
+ hash[to[index]] = value
+ end
+ hash.delete(from)
+ end
+
+ hash
+ end
+end
|
Add hash join and split transforms
|
diff --git a/library/stringscanner/scan_spec.rb b/library/stringscanner/scan_spec.rb
index abc1234..def5678 100644
--- a/library/stringscanner/scan_spec.rb
+++ b/library/stringscanner/scan_spec.rb
@@ -28,6 +28,12 @@ @s.scan(/\w+/).should be_nil
end
+ it "returns an empty string when the pattern matches empty" do
+ @s.scan(/.*/).should == "This is a test"
+ @s.scan(/.*/).should == ""
+ @s.scan(/./).should be_nil
+ end
+
it "raises a TypeError if pattern isn't a Regexp" do
lambda { @s.scan("aoeu") }.should raise_error(TypeError)
lambda { @s.scan(5) }.should raise_error(TypeError)
|
Add spec for matching an empty string
|
diff --git a/NSURL+QueryDictionary.podspec b/NSURL+QueryDictionary.podspec
index abc1234..def5678 100644
--- a/NSURL+QueryDictionary.podspec
+++ b/NSURL+QueryDictionary.podspec
@@ -1,6 +1,6 @@ Pod::Spec.new do |s|
s.name = "NSURL+QueryDictionary"
- s.version = "1.1.0"
+ s.version = "1.2.0"
s.summary = "Make working with NSURL queries more pleasant."
s.description = "NSURL, NSString and NSDictionary categories for working with URL queries"
s.homepage = "https://github.com/itsthejb/NSURL-QueryDictionary"
@@ -10,7 +10,7 @@ s.ios.deployment_target = '6.1'
s.osx.deployment_target = '10.8'
s.watchos.deployment_target = '2.0'
+ s.tvos.deployment_target = '9.0'
s.source_files = s.name + '/*.{h,m}'
s.frameworks = 'Foundation'
- s.requires_arc = true
end
|
Add tvOS to the Podspec
|
diff --git a/spec/helpers/concept_helper_spec.rb b/spec/helpers/concept_helper_spec.rb
index abc1234..def5678 100644
--- a/spec/helpers/concept_helper_spec.rb
+++ b/spec/helpers/concept_helper_spec.rb
@@ -21,22 +21,17 @@ )
end
- it 'displays nothing because weve turned it off since the query is killing response time (need to rewrite query)' do
+ it "displays all concept stats for an activity session" do
html = helper.all_concept_stats(activity_session)
- expect(html).to eq('')
+ expect(html).to include(punctuation_concept.name)
+ expect(html).to include(prepositions_concept.name)
end
- # it "displays all concept stats for an activity session" do
- # html = helper.all_concept_stats(activity_session)
- # expect(html).to include(punctuation_concept.name)
- # expect(html).to include(prepositions_concept.name)
- # end
-
- # it "displays a breakdown of the grammar concepts and correct/incorrect" do
- # html = helper.all_concept_stats(activity_session)
- # expect(html).to include(prepositions_concept.name)
- # expect(html).to include("1")
- # expect(html).to include("0")
- # end
+ it "displays a breakdown of the grammar concepts and correct/incorrect" do
+ html = helper.all_concept_stats(activity_session)
+ expect(html).to include(prepositions_concept.name)
+ expect(html).to include("1")
+ expect(html).to include("0")
+ end
end
end
|
Revert "remove concept results from student profile until we can make a less expensive query"
This reverts commit 36d11739c8e24c9c7f0e3335e3a2bc7ff8ecb132.
|
diff --git a/spec/mailers/contact_mailer_spec.rb b/spec/mailers/contact_mailer_spec.rb
index abc1234..def5678 100644
--- a/spec/mailers/contact_mailer_spec.rb
+++ b/spec/mailers/contact_mailer_spec.rb
@@ -3,6 +3,15 @@ RSpec.describe ContactMailer, type: :mailer do
describe "#send_contact_message" do
let(:email) { ContactMailer.send_contact_message("John Doe", "johndoe@test.com", "This is my message!") }
+
+ before(:all) do
+ @default_email_sender = ENV["DEFAULT_EMAIL_SENDER"]
+ ENV["DEFAULT_EMAIL_SENDER"] = "default@test.com"
+ end
+
+ after(:all) do
+ ENV["DEFAULT_EMAIL_SENDER"] = @default_email_sender
+ end
it "sets the :from header using the specified name and email" do
expect(email.from).to include("johndoe@test.com")
|
Fix spec that depends on environment variable
|
diff --git a/spec/models/broggle/broggle_spec.rb b/spec/models/broggle/broggle_spec.rb
index abc1234..def5678 100644
--- a/spec/models/broggle/broggle_spec.rb
+++ b/spec/models/broggle/broggle_spec.rb
@@ -1,7 +1,7 @@ describe Broggle do
let(:broggle) { build(:broggle) }
- it 'points to master' do
- expect(broggle.repo.head.name).to eq('refs/heads/master')
+ it 'has 5 branches' do
+ expect(broggle.repo.branches.count).to eq(5)
end
end
|
Change basic spec for broggle model
|
diff --git a/spec/tic_tac_toe/ai/minimax_spec.rb b/spec/tic_tac_toe/ai/minimax_spec.rb
index abc1234..def5678 100644
--- a/spec/tic_tac_toe/ai/minimax_spec.rb
+++ b/spec/tic_tac_toe/ai/minimax_spec.rb
@@ -1,9 +1,29 @@ require 'spec_helper'
describe TicTacToe::AI::Minimax do
- it 'wins when it has two in a row' do
- board = TicTacToe::Board.from([" ", " ", " ",
- " ", " ", " ",
- " ", " ", " "])
+ let(:ai) { TicTacToe::AI::Minimax.new }
+
+ describe 'wins when it has two in a row' do
+ it 'on the left' do
+ board = TicTacToe::Board.from([" ", "X", "X",
+ " ", " ", " ",
+ " ", " ", " "])
+ expect(ai.get_move(board)).to eq(0)
+ end
+
+ it 'in the center' do
+ board = TicTacToe::Board.from(["X", " ", "X",
+ " ", " ", " ",
+ " ", " ", " "])
+ expect(ai.get_move(board)).to eq(1)
+ end
+
+ it 'on the right' do
+ board = TicTacToe::Board.from(["X", "X", " ",
+ " ", " ", " ",
+ " ", " ", " "])
+ expect(ai.get_move(board)).to eq(2)
+ end
+
end
end
|
Add some basic move tests
|
diff --git a/config/initializers/state_machine_patch.rb b/config/initializers/state_machine_patch.rb
index abc1234..def5678 100644
--- a/config/initializers/state_machine_patch.rb
+++ b/config/initializers/state_machine_patch.rb
@@ -0,0 +1,9 @@+# This is a patch to address the issue in https://github.com/pluginaweek/state_machine/issues/251
+# where gem 'state_machine' was not working for Rails 4.1
+module StateMachine
+ module Integrations
+ module ActiveModel
+ public :around_validation
+ end
+ end
+end
|
Add a state_machine patch for rails 4.1.
|
diff --git a/vault.gemspec b/vault.gemspec
index abc1234..def5678 100644
--- a/vault.gemspec
+++ b/vault.gemspec
@@ -8,7 +8,7 @@ spec.version = Vault::VERSION
spec.authors = ["Seth Vargo"]
spec.email = ["sethvargo@gmail.com"]
- spec.licenses = ["MPLv2"]
+ spec.licenses = ["MPL-2.0"]
spec.summary = "Vault is a Ruby API client for interacting with a Vault server."
spec.description = spec.summary
|
Use official SPDX ID for license
https://spdx.org/licenses/
|
diff --git a/app/controllers/spree/user_sessions_controller.rb b/app/controllers/spree/user_sessions_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/spree/user_sessions_controller.rb
+++ b/app/controllers/spree/user_sessions_controller.rb
@@ -9,11 +9,6 @@
ssl_required :new, :create, :destroy, :update
ssl_allowed :login_bar
-
- # GET /resource/sign_in
- def new
- super
- end
def create
authenticate_user!
|
Remove useless new action definition inside UserSessionsController
|
diff --git a/lib/concord.rb b/lib/concord.rb
index abc1234..def5678 100644
--- a/lib/concord.rb
+++ b/lib/concord.rb
@@ -11,7 +11,7 @@ end
def self.publish(topic_name, object, options = {})
- Publisher.new(topic_name, object, options).publish
+ Publisher.new(options).publish(topic_name, object)
end
def self.subscribe(queue, options = {}, &block)
|
Fix argument passing on subscribe
|
diff --git a/recipes/sandbox/20-extend-irb.rake b/recipes/sandbox/20-extend-irb.rake
index abc1234..def5678 100644
--- a/recipes/sandbox/20-extend-irb.rake
+++ b/recipes/sandbox/20-extend-irb.rake
@@ -5,6 +5,9 @@ file File.join(sandboxdir, "bin/irb.cmd") => File.join(unpackdirmgw, "bin/irb.cmd") do |t|
puts "generate #{t.name}"
out = File.binread(t.prerequisites.first)
- .gsub('require "irb"', 'require "irbrc_predefiner"; require "irb"')
- File.binwrite(t.name, out)
+ mod = out.gsub('require "irb"', 'require "irbrc_predefiner"; require "irb"')
+ .gsub("load Gem.activate_bin_path('irb', 'irb', version)", "f = Gem.activate_bin_path('irb', 'irb', version); require 'irbrc_predefiner'; load f")
+ raise "irb extension not applicable" if out == mod
+
+ File.binwrite(t.name, mod)
end
|
Fix irb hook for ruby-2.6+
Fixes #158
Also make sure, that future changes on irb.cmd will raise a build failure.
|
diff --git a/lib/esprima.rb b/lib/esprima.rb
index abc1234..def5678 100644
--- a/lib/esprima.rb
+++ b/lib/esprima.rb
@@ -3,10 +3,10 @@ require 'v8'
require 'commonjs'
-require './lib/esprima/parser'
+require 'esprima/parser'
module Esprima
def self.load_path
@load_path ||= File.expand_path(File.join(File.dirname(__FILE__), "../vendor"))
end
-end+end
|
Fix path to parser for gem
|
diff --git a/app/serializers/sprangular/taxonomy_serializer.rb b/app/serializers/sprangular/taxonomy_serializer.rb
index abc1234..def5678 100644
--- a/app/serializers/sprangular/taxonomy_serializer.rb
+++ b/app/serializers/sprangular/taxonomy_serializer.rb
@@ -1,6 +1,6 @@ module Sprangular
class TaxonomySerializer < BaseSerializer
- attributes :id, :name
+ attributes *taxonomy_attributes
has_one :root, embed: :objects,
serializer: Sprangular::TaxonSerializer
|
Allow the taxonomy attributes to be overridden in host app
|
diff --git a/Library/Formula/tokyo-dystopia.rb b/Library/Formula/tokyo-dystopia.rb
index abc1234..def5678 100644
--- a/Library/Formula/tokyo-dystopia.rb
+++ b/Library/Formula/tokyo-dystopia.rb
@@ -1,14 +1,14 @@ require 'formula'
class TokyoDystopia <Formula
- url 'http://1978th.net/tokyodystopia/tokyodystopia-0.9.13.tar.gz'
+ url 'http://1978th.net/tokyodystopia/tokyodystopia-0.9.14.tar.gz'
homepage 'http://1978th.net/tokyodystopia/'
- sha1 '073b2edd6a74e2ae1bbdc7faea42a8a219bdf169'
+ sha1 '51bf7e9320ed8fc5e20a110135ea36b0305aa7a5'
depends_on 'tokyo-cabinet'
def install
- system "./configure", "--prefix=#{prefix}", "--libdir=#{lib}", "--includedir=#{include}"
+ system "./configure", "--prefix=#{prefix}"
system "make"
system "make install"
end
|
Update Tokyo Dystopia to 0.9.14
|
diff --git a/Casks/electrum-ltc.rb b/Casks/electrum-ltc.rb
index abc1234..def5678 100644
--- a/Casks/electrum-ltc.rb
+++ b/Casks/electrum-ltc.rb
@@ -6,7 +6,7 @@ gpg "#{url}.asc",
:key_id => '9914864dfc33499c6ca2beea22453004695506fd'
name 'Electrum-LTC'
- homepage 'http://electrum-ltc.org'
+ homepage 'https://electrum-ltc.org/'
license :gpl
app 'Electrum-LTC.app'
|
Fix homepage to use SSL in Electrum-LTC Cask
The HTTP URL is already getting redirected to HTTPS. Using the HTTPS URL directly
makes it more secure and saves a HTTP round-trip.
|
diff --git a/config/initializers/app-overrides.rb b/config/initializers/app-overrides.rb
index abc1234..def5678 100644
--- a/config/initializers/app-overrides.rb
+++ b/config/initializers/app-overrides.rb
@@ -1,5 +1,6 @@ if Rails.env.development?
- Rails.logger = Logger.new(STDOUT) # Get logs to spit out when using foreman/puma.
+ # Rails.logger = Logger.new(STDOUT)
+ # To get logs to spit out when using foreman/puma, use the rails_12factor gem in development.
Rails.application.config.assets.debug = false
# Enable concurrent requests.
# http://stackoverflow.com/questions/21605318/how-can-i-serve-requests-concurrently-with-rails-4
|
Use rails_12factor in development instead of setting Rails.logger.
|
diff --git a/sandwich.rb b/sandwich.rb
index abc1234..def5678 100644
--- a/sandwich.rb
+++ b/sandwich.rb
@@ -19,10 +19,10 @@ Chef::Log.level = :debug
run_context = Chef::RunContext.new($client.node, {})
# @recipe = Chef::Recipe.new(nil, nil, run_context)
+ Chef::Log.level = :debug
+ add_package_to_run_context('gitg', run_context)
runrun = Chef::Runner.new(run_context).converge
- Chef::Log.level = :debug
runrun
- install_package('gitg', run_context)
end
def install_package(package_name, run_context)
@@ -30,5 +30,10 @@ package.run_action(:install)
end
+def add_package_to_run_context(package_name, run_context)
+ package = Chef::Resource::Package.new(package_name, run_context)
+ run_context.resource_collection.insert(package)
+end
+
puts 'Hello chef run context world'
run_chef
|
Install package via run context resource collection
|
diff --git a/core/spec/models/tax_category_spec.rb b/core/spec/models/tax_category_spec.rb
index abc1234..def5678 100644
--- a/core/spec/models/tax_category_spec.rb
+++ b/core/spec/models/tax_category_spec.rb
@@ -19,7 +19,7 @@ end
it "should undefault the previous default tax category" do
- new_tax_category.update_column(:is_default, true)
+ new_tax_category.update_attributes({:is_default => true})
new_tax_category.is_default.should be_true
tax_category.reload
|
Use update_attributes inside "should undefeault the previous default tax category" spec ,as we *do* care about callbacks in this instance
|
diff --git a/benchmarks/speed.rb b/benchmarks/speed.rb
index abc1234..def5678 100644
--- a/benchmarks/speed.rb
+++ b/benchmarks/speed.rb
@@ -39,8 +39,11 @@ tpl.to_html
end
+content = File.read(ComplexView.template_file)
+
bench '{ w/o caching' do
tpl = ComplexView.new
+ tpl.template = content
tpl[:item] = items
tpl.to_html
end
|
Fix the benchmark of Mustache without caching
|
diff --git a/spec/features/system/admin/course_management_spec.rb b/spec/features/system/admin/course_management_spec.rb
index abc1234..def5678 100644
--- a/spec/features/system/admin/course_management_spec.rb
+++ b/spec/features/system/admin/course_management_spec.rb
@@ -4,11 +4,12 @@ let(:instance) { create(:instance) }
with_tenant(:instance) do
+ let(:last_page) { Course.unscoped.page.total_pages }
let!(:courses) do
courses = create_list(:course, 2)
other_instance = create(:instance)
courses.last.update_column(:instance_id, other_instance)
- Course.unscoped.ordered_by_title.page(1)
+ Course.unscoped.ordered_by_title.page(last_page)
end
context 'As a System Administrator' do
@@ -16,7 +17,7 @@ before { login_as(admin, scope: :user) }
scenario 'I can view all courses in the system' do
- visit admin_courses_path
+ visit admin_courses_path(page: last_page)
courses.each do |course|
expect(page).to have_selector('tr.course th', text: course.title)
@@ -25,7 +26,9 @@ end
end
- let!(:course_to_delete) { create(:course, title: courses.first.title) }
+ let!(:course_to_delete) do
+ create(:course, title: Course.unscoped.ordered_by_title.first.title)
+ end
scenario 'I can delete a course' do
visit admin_courses_path
|
Test courses index in the last page
|
diff --git a/spec/fixtures/test_project/lib/combined_text_test.rb b/spec/fixtures/test_project/lib/combined_text_test.rb
index abc1234..def5678 100644
--- a/spec/fixtures/test_project/lib/combined_text_test.rb
+++ b/spec/fixtures/test_project/lib/combined_text_test.rb
@@ -17,7 +17,7 @@ output :text, :text
reduce do |key, values|
- emit key, values.to_a.join(' ')
+ emit key, values.to_a.sort.join(' ')
end
end
end
|
Order of reducer input values is not deterministic.
|
diff --git a/cookbooks/chef/attributes/default.rb b/cookbooks/chef/attributes/default.rb
index abc1234..def5678 100644
--- a/cookbooks/chef/attributes/default.rb
+++ b/cookbooks/chef/attributes/default.rb
@@ -5,7 +5,7 @@ default[:chef][:server][:version] = "11.1.3-1"
# Set the default client version
-default[:chef][:client][:version] = "11.16.0-1"
+default[:chef][:client][:version] = "11.16.2-1"
# A list of gems needed by chef recipes
default[:chef][:gems] = []
|
Update chef client to 11.16.2-1
|
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,5 +1,5 @@ class PagesController < ApplicationController
- before_action :authenticate_user!, except: [:index, :help]
+ before_action :authenticate_user!, except: [:index, :help, :leaderboard]
def index
@latest_battles = Battle.order("updated_at desc").includes(:arena).limit 5
end
|
Allow non-logged in to view leaderboard
|
diff --git a/lib/bnr/webhooks/notifier.rb b/lib/bnr/webhooks/notifier.rb
index abc1234..def5678 100644
--- a/lib/bnr/webhooks/notifier.rb
+++ b/lib/bnr/webhooks/notifier.rb
@@ -20,11 +20,11 @@ end
def notify
+ response = send_to(subscriber.url)
send_to(debug_endpoint) do |request|
request.headers[Bnr::Webhooks::DESTINATION_HEADER] = subscriber.url
end if debug_endpoint?
-
- send_to(subscriber.url)
+ response
end
private
|
Send to subscriber first in case debug is sluggish.
|
diff --git a/app/helpers/load_profiles_helper.rb b/app/helpers/load_profiles_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/load_profiles_helper.rb
+++ b/app/helpers/load_profiles_helper.rb
@@ -9,11 +9,11 @@ options_for_select(load_profiles, { selected: profile.load_profile_category_id })
end
- def technologies_select_options
+ def technologies_select_options(selected = nil)
bufferables = @technologies.map(&:technologies).flatten
options_for_select((@technologies.visible - bufferables).map do |technology|
[technology.name, technology.key]
- end)
+ end, selected)
end
end
|
Fix "edit load profile" page
technologies_select_options should take an argument specifying the
selected technology, if applicable.
|
diff --git a/lib/em-kannel/test_helper.rb b/lib/em-kannel/test_helper.rb
index abc1234..def5678 100644
--- a/lib/em-kannel/test_helper.rb
+++ b/lib/em-kannel/test_helper.rb
@@ -1,3 +1,5 @@+require "ostruct"
+
module EventMachine
class Kannel
def self.deliveries
@@ -5,8 +7,16 @@ end
Client.class_eval do
- def deliver(block = nil)
+ def fake_response
+ status = OpenStruct.new(status: 202)
+ http = OpenStruct.new(response_header: status)
+
+ Response.new(http, Time.now)
+ end
+
+ def deliver(&block)
EM::Kannel.deliveries << @message
+ yield(fake_response) if block_given?
end
end
end
|
Make test helper work more like a real Client
Client#deliver receives a block that allows the caller
to know the status of the HTTP call after the callback
fires.
By default we return a successful response using an
OpenStruct.
|
diff --git a/lib/middleware/start_trim.rb b/lib/middleware/start_trim.rb
index abc1234..def5678 100644
--- a/lib/middleware/start_trim.rb
+++ b/lib/middleware/start_trim.rb
@@ -1,7 +1,6 @@ # -*- encoding : utf-8 -*-
# This middleware removes all keyframes before frame 0, and skips trackers entirely if they are all before frame 0
class Tracksperanto::Middleware::StartTrim < Tracksperanto::Middleware::Base
- attr_accessor :enabled
def start_export( img_width, img_height)
@exporter = Tracksperanto::Middleware::LengthCutoff.new(@exporter, :min_length => 1) # Ensure at least one keyframe
|
Remove this enable as well
|
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
@@ -3,7 +3,7 @@
def event_notification(event)
@event = event
- mail(to: 'anders.e.howerton@gmail.com', subject: "New Event Submitted")
+ mail(to: 'andrew.mcclellan3@gmail.com', subject: "New Event Submitted")
end
end
|
Change mail address to andrew's address
|
diff --git a/week-6/gps.rb b/week-6/gps.rb
index abc1234..def5678 100644
--- a/week-6/gps.rb
+++ b/week-6/gps.rb
@@ -1,33 +1,24 @@ # Your Names
# 1) Stephanie Major
-# 2)
+# 2)Kenton Lin
-# We spent [#] hours on this challenge.
+# We spent 1 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
+def serving_size_calc(item_to_make, count_of_serving)
+ baked_goods = {"cookie" => 1, "cake" => 5, "pie" => 7}
- library.each do |food|
- if library[food] != library[item_to_make]
- error_counter += -1
- end
- end
+ raise ArgumentError.new("#{item_to_make} is not a valid input") if baked_goods.has_key?(item_make) == false
+
+ serving_size = baked_goods[item_to_make]
- if error_counter > 0
- raise ArgumentError.new("#{item_to_make} is not a valid input")
- end
+ portion_left_over = count_of_serving % serving_size
- 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}"
+ if portion_left_over == 0
+ return "Make #{count_of_serving / 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"
+ return "Make #{count_of_serving / serving_size} of #{item_to_make}, you have #{portion_left_over} leftover ingredients. Suggested baking items: TODO: MAKE THIS FEATURE"
end
end
@@ -37,6 +28,6 @@ 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)
+# p serving_size_calc("THIS IS AN ERROR", 5)
# Reflection
|
Add GPS 2.3 solution to the file
|
diff --git a/test/unit/case_study_test.rb b/test/unit/case_study_test.rb
index abc1234..def5678 100644
--- a/test/unit/case_study_test.rb
+++ b/test/unit/case_study_test.rb
@@ -9,24 +9,4 @@ assert article.can_be_related_to_policies?
end
- # test "#topics includes topics associated with related published policies" do
- # related_policy = create(:published_policy, topics: [create(:topic), create(:topic)])
- # news_article = create(:news_article, related_policies: [related_policy])
- # assert_equal related_policy.topics.sort, news_article.topics.sort
- # end
-
- # test "#topics excludes topics associated with related unpublished policies" do
- # related_policy = create(:draft_policy, topics: [create(:topic), create(:topic)])
- # news_article = create(:case_study, related_policies: [related_policy])
- # assert_equal [], news_article.topics
- # end
-
- # test "#topics includes each related topic only once, even if associated multiple times" do
- # topic = create(:topic)
- # first_related_policy = create(:published_policy, topics: [topic])
- # second_related_policy = create(:published_policy, topics: [topic])
- # news_article = create(:news_article, related_policies: [first_related_policy, second_related_policy])
- # assert_equal [topic], news_article.topics
- # end
-
end
|
Remove useless commented out tests
|
diff --git a/lib/make_flaggable/flagging.rb b/lib/make_flaggable/flagging.rb
index abc1234..def5678 100644
--- a/lib/make_flaggable/flagging.rb
+++ b/lib/make_flaggable/flagging.rb
@@ -1,9 +1,9 @@ module MakeFlaggable
class Flagging < ActiveRecord::Base
- belongs_to :flaggable, :polymorphic => true
- belongs_to :flagger, :polymorphic => true
- scope :with_flag, lambda { |flag| where(:flag => flag.to_s) }
- scope :with_flaggable, lambda { |flaggable| where(:flaggable_type => flaggable.class.name, :flaggable_id => flaggable.id) }
+ belongs_to :flaggable, polymorphic: true, counter_cache: true
+ belongs_to :flagger, polymorphic: true
+ scope :with_flag, lambda { |flag| where(flag: flag.to_s) }
+ scope :with_flaggable, lambda { |flaggable| where(:flaggable_type: flaggable.class.name, flaggable_id: flaggable.id) }
attr_accessible :flaggable, :flagger, :flag
end
|
Add counter cache to flaggable
|
diff --git a/lib/ruby-handlebars/context.rb b/lib/ruby-handlebars/context.rb
index abc1234..def5678 100644
--- a/lib/ruby-handlebars/context.rb
+++ b/lib/ruby-handlebars/context.rb
@@ -29,10 +29,6 @@ end
end
- if item.instance_variables.include?("@#{attribute}")
- return item.instance_variable_get("@#{attribute}")
- end
-
if item.respond_to?(sym_attr)
return item.send(sym_attr)
end
|
Remove ability to dig into instance variables
The data object should provide access via its methods instead.
|
diff --git a/lib/runoff/commands/command.rb b/lib/runoff/commands/command.rb
index abc1234..def5678 100644
--- a/lib/runoff/commands/command.rb
+++ b/lib/runoff/commands/command.rb
@@ -3,9 +3,20 @@ module Commands
# The base class for every runoff command.
class Command
+ # Public: Provides a FileWriter object and the destination path for the command.
+ #
+ # args - an array of command line arguments
+ # options - an object with options passed to the command
+ #
+ # Examples
+ #
+ # file_writer, path = get_file_writer_components [], nil
+ #
+ # Raises an ArgumentError.
+ # Returns a FileWriter object and a string with file path.
def self.get_file_writer_components(args, options)
if args.empty? && !options.from
- raise ArgumentError.new 'Error: You must specify the Skype username or a --from option'
+ fail ArgumentError, 'Error: You must specify the Skype username or a --from option'
end
main_db_path = Runoff::Location.get_database_path args[0], options
|
Use instead of and add a documentation comment
|
diff --git a/lib/sshkit/runners/parallel.rb b/lib/sshkit/runners/parallel.rb
index abc1234..def5678 100644
--- a/lib/sshkit/runners/parallel.rb
+++ b/lib/sshkit/runners/parallel.rb
@@ -9,7 +9,7 @@ threads = []
hosts.each do |host|
threads << Thread.new(host) do |h|
- backend(host, &block).run
+ backend(h, &block).run
end
end
threads.map(&:join)
|
Use the local copy of host on each thread
|
diff --git a/Casks/adium-nightly16.rb b/Casks/adium-nightly16.rb
index abc1234..def5678 100644
--- a/Casks/adium-nightly16.rb
+++ b/Casks/adium-nightly16.rb
@@ -2,9 +2,16 @@ version '1.6hgr5915'
sha256 '70619777433df646a7251a10eb74baecdc5a47be085cd83d35f3750fcfea9e1b'
- url "http://nightly.adium.im/adium-adium-1.6/Adium_#{version}.dmg"
+ url "http://nightly.adium.im/adium-adium-1.6/Adium_#{version}.dmg
+ name 'Adium'
homepage 'http://nightly.adium.im/?repo_branch=adium-adium-1.6'
- license :oss
+ license :gpl
app 'Adium.app'
+
+ zap :delete => [
+ '~/Library/Caches/Adium',
+ '~/Library/Caches/com.adiumX.adiumX',
+ '~/Library/Preferences/com.adiumX.adiumX.plist',
+ ]
end
|
Add missing stanzas to Adium Nightly16
|
diff --git a/lib/vagrant/util/platform.rb b/lib/vagrant/util/platform.rb
index abc1234..def5678 100644
--- a/lib/vagrant/util/platform.rb
+++ b/lib/vagrant/util/platform.rb
@@ -33,7 +33,7 @@ #
# @return [Boolean]
def bit64?
- ["x86_64", "amd64"].include?(::Config::CONFIG["host_cpu"])
+ ["x86_64", "amd64"].include?(RbConfig::CONFIG["host_cpu"])
end
# Returns boolean noting whether this is a 32-bit CPU. This
@@ -50,7 +50,7 @@ end
def platform
- ::Config::CONFIG["host_os"].downcase
+ RbConfig::CONFIG["host_os"].downcase
end
end
end
|
Use RbConfig instead of Config, latter is deprecated
|
diff --git a/Casks/tv-show-tracker.rb b/Casks/tv-show-tracker.rb
index abc1234..def5678 100644
--- a/Casks/tv-show-tracker.rb
+++ b/Casks/tv-show-tracker.rb
@@ -0,0 +1,7 @@+class TvShowTracker < Cask
+ url 'http://www.pixelperfectwidgets.com/tvshowtracker/download/tvshowtracker_1.3.3.zip'
+ homepage 'http://www.pixelperfectwidgets.com/'
+ version '1.3.3'
+ sha1 '81e613d6525c49196625271dd76090866c1b2ddd'
+ widget 'TV Show Tracker.wdgt'
+end
|
Add TV Show Tracker Widget 1.3.3
|
diff --git a/Casks/vagrant-manager.rb b/Casks/vagrant-manager.rb
index abc1234..def5678 100644
--- a/Casks/vagrant-manager.rb
+++ b/Casks/vagrant-manager.rb
@@ -1,11 +1,11 @@ cask 'vagrant-manager' do
- version '2.5.3'
- sha256 'c2780c3560f7f27a0a87fa01983ec329ed13b7cb139515cf70415ae959b99562'
+ version '2.5.4'
+ sha256 '9ad9d9f5d6eca2ef0f4493004f06acc6862701b1b731fe20ddbc7c5970079824'
# github.com/lanayotech/vagrant-manager was verified as official when first introduced to the cask
url "https://github.com/lanayotech/vagrant-manager/releases/download/#{version}/vagrant-manager-#{version}.dmg"
appcast 'https://github.com/lanayotech/vagrant-manager/releases.atom',
- checkpoint: '1a416ac6a40fa013b7876d9d02acbe17c7a0988b780bca0baafd8d6fcba45099'
+ checkpoint: '0d60d80f827a3ed3b2e1eed81dd899deb5a26a25ea8173c8a02dd144abe4f915'
name 'Vagrant Manager'
homepage 'http://vagrantmanager.com/'
license :mit
|
Upgrade Vagrant Manager.app to v2.5.4
|
diff --git a/Casks/zerobranestudio.rb b/Casks/zerobranestudio.rb
index abc1234..def5678 100644
--- a/Casks/zerobranestudio.rb
+++ b/Casks/zerobranestudio.rb
@@ -1,6 +1,6 @@ cask 'zerobranestudio' do
- version '1.20'
- sha256 '1ad9bc8b4c636f4a2c8bf6adb55ba0b4327c134ced0058744496ac6accc8265e'
+ version '1.30'
+ sha256 '167324cdbae91e0d191515d272599936ef3319484e88110a9c3e81f4b82342e7'
url "https://download.zerobrane.com/ZeroBraneStudioEduPack-#{version}-macos.dmg"
name 'ZeroBrane Studio'
|
Update ZeroBrane Studio to 1.30
|
diff --git a/yabfi.gemspec b/yabfi.gemspec
index abc1234..def5678 100644
--- a/yabfi.gemspec
+++ b/yabfi.gemspec
@@ -8,7 +8,7 @@ spec.version = YABFI::VERSION
spec.authors = ['Tom Hulihan']
spec.email = ['hulihan.tom159@gmail.com']
- spec.summary = 'Yet Another BrainFuck Interpreter written in Ruby'
+ spec.summary = 'Yet Another BrainFuck Interpreter'
spec.description = spec.summary
spec.homepage = 'https://github.com/nahiluhmot/yabfi'
spec.license = 'MIT'
|
Fix rubocop error in gemspec
|
diff --git a/my-backend/db/seeds.rb b/my-backend/db/seeds.rb
index abc1234..def5678 100644
--- a/my-backend/db/seeds.rb
+++ b/my-backend/db/seeds.rb
@@ -5,3 +5,10 @@ {email: 'pink@mail.com',
password: '12345678', password_confirmation: '12345678'}
])
+
+Post.create(
+ {title: "A Sample Post",
+ body: "This will be a simple post record."},
+ {title: "Sample Post 2",
+ body: "This is sample post number two."}
+)
|
Add seed data for Posts.
|
diff --git a/models/team.rb b/models/team.rb
index abc1234..def5678 100644
--- a/models/team.rb
+++ b/models/team.rb
@@ -1,10 +1,14 @@ class Team
include Mongoid::Document
include Mongoid::Timestamps
+
+ field :_id, type: Integer
field :name, type: String
field :location, type: String
has_many :participations
has_many :records
+
+ validates :_id, uniqueness: true
end
|
Switch to Team number schema
|
diff --git a/config/software/loom-server.rb b/config/software/loom-server.rb
index abc1234..def5678 100644
--- a/config/software/loom-server.rb
+++ b/config/software/loom-server.rb
@@ -15,5 +15,5 @@ command "chmod +x #{install_dir}/server/bin/*"
command "mkdir -p #{install_dir}/server/lib"
command "cd server && PATH=/usr/local/maven-3.1.1/bin:$PATH mvn clean package assembly:single -DskipTests=true"
- command "cp -fpPR target/loom-*jar-with-dependencies.jar #{install_dir}/server/lib"
+ command "cp -fpPR server/target/loom-*jar-with-dependencies.jar #{install_dir}/server/lib"
end
|
Add server prefix to directory for pulling JAR
|
diff --git a/FDChessboardView.podspec b/FDChessboardView.podspec
index abc1234..def5678 100644
--- a/FDChessboardView.podspec
+++ b/FDChessboardView.podspec
@@ -11,4 +11,5 @@ s.resource_bundles = {
'FDChessboardView' => ['Resources/**/*.{png}']
}
+ s.swift_version = '4.0'
end
|
Use swift version 4.0 for podspec
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.