diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/lib/pothoven-attachment_fu.rb b/lib/pothoven-attachment_fu.rb
index abc1234..def5678 100644
--- a/lib/pothoven-attachment_fu.rb
+++ b/lib/pothoven-attachment_fu.rb
@@ -1,12 +1,25 @@-class Engine < Rails::Engine
- # Mimic old vendored plugin behavior, attachment_fu/lib is autoloaded.
- config.autoload_paths << File.expand_path("..", __FILE__)
- initializer "attachment_fu" do
- require 'geometry'
+if defined?(Rails::Engine)
+ # Rails >= 3
+ class Engine < Rails::Engine
+ # Mimic old vendored plugin behavior, attachment_fu/lib is autoloaded.
+ config.autoload_paths << File.expand_path("..", __FILE__)
- ActiveRecord::Base.send(:extend, Technoweenie::AttachmentFu::ActMethods)
- Technoweenie::AttachmentFu.tempfile_path = ATTACHMENT_FU_TEMPFILE_PATH if Object.const_defined?(:ATTACHMENT_FU_TEMPFILE_PATH)
- FileUtils.mkdir_p Technoweenie::AttachmentFu.tempfile_path
+ initializer "attachment_fu" do
+ require 'geometry'
+
+ ActiveRecord::Base.send(:extend, Technoweenie::AttachmentFu::ActMethods)
+ Technoweenie::AttachmentFu.tempfile_path = ATTACHMENT_FU_TEMPFILE_PATH if Object.const_defined?(:ATTACHMENT_FU_TEMPFILE_PATH)
+ FileUtils.mkdir_p Technoweenie::AttachmentFu.tempfile_path
+ end
end
+else
+ # Rails <= 2
+ require 'geometry'
+
+ ActiveRecord::Base.send(:extend, Technoweenie::AttachmentFu::ActMethods)
+ Technoweenie::AttachmentFu.tempfile_path = ATTACHMENT_FU_TEMPFILE_PATH if Object.const_defined?(:ATTACHMENT_FU_TEMPFILE_PATH)
+ FileUtils.mkdir_p Technoweenie::AttachmentFu.tempfile_path
+
+ $:.unshift(File.expand_path("../vendor", __FILE__))
end
|
Allow use as gem on Rails 2
|
diff --git a/lib/relative_time/in_words.rb b/lib/relative_time/in_words.rb
index abc1234..def5678 100644
--- a/lib/relative_time/in_words.rb
+++ b/lib/relative_time/in_words.rb
@@ -33,7 +33,9 @@ end
def verb_agreement(resolution)
- if resolution[0] == 1
+ if resolution[0] == 1 && resolution.last == 'hours'
+ "an hour"
+ elsif resolution[0] == 1
"a #{resolution.last[0...-1]}"
else
resolution.join(' ')
|
Use 'an' rather than 'a' as the article where the time period variance is one hour
|
diff --git a/app/controllers/menu_controller.rb b/app/controllers/menu_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/menu_controller.rb
+++ b/app/controllers/menu_controller.rb
@@ -11,18 +11,18 @@ @data = [
'Authorize',
'Characteristics',
+ 'ObserverQuery',
+ 'SourceQuery',
+ 'SampleQuery',
'AnchoredObjectQuery',
'CorrelationQuery',
- 'ObserverQuery',
- 'SampleQuery',
- 'SourceQuery',
+ 'StatisticsQuery',
'StatisticsCollectionQuery',
- 'StatisticsQuery',
'Observe',
'FindSources',
'FindSamples',
+ 'FindAnchored',
'FindCorrelations',
- 'FindAnchored',
'FindStatistics',
'FindStatisticsCollection'
]
|
Rearrange app controllers so query mirrors finder
|
diff --git a/app/decorators/plugin_decorator.rb b/app/decorators/plugin_decorator.rb
index abc1234..def5678 100644
--- a/app/decorators/plugin_decorator.rb
+++ b/app/decorators/plugin_decorator.rb
@@ -2,10 +2,10 @@ delegate_all
def status
- if installed?
+ if processing?
+ I18n.t("terms.processing")
+ elsif installed?
I18n.t("terms.installed")
- elsif processing?
- I18n.t("terms.processing")
else
I18n.t("terms.not_installed")
end
|
Change the priority of checking status because both installed and not installed plugins could be processing.
|
diff --git a/app/helpers/organisation_helper.rb b/app/helpers/organisation_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/organisation_helper.rb
+++ b/app/helpers/organisation_helper.rb
@@ -17,6 +17,6 @@
def organisation_view_all_tag(organisation, kind)
path = send(:"#{kind}_organisation_path", @organisation)
- content_tag(:span, safe_join(['View all', @organisation.name, link_to(kind, path)], ' '), :class => "view_all")
+ content_tag(:span, safe_join(['View all', @organisation.name, link_to(kind, path)], ' '), class: "view_all")
end
end
|
Use Ruby 1.9 hash syntax.
Whenever it comes to using class as a hash key, I get a bit nervous.
|
diff --git a/app/models/concerns/crop_search.rb b/app/models/concerns/crop_search.rb
index abc1234..def5678 100644
--- a/app/models/concerns/crop_search.rb
+++ b/app/models/concerns/crop_search.rb
@@ -18,7 +18,7 @@ scientific_names: scientific_names.pluck(:name),
# boost the crops that are planted the most
plantings_count: plantings_count,
- harvests_count: harvests.size,
+ harvests_count: harvests_count,
# boost this crop for these members
planters_ids: plantings.pluck(:owner_id),
has_photos: photos.size.positive?,
|
Use the counter for harvests
|
diff --git a/app/policies/application_policy.rb b/app/policies/application_policy.rb
index abc1234..def5678 100644
--- a/app/policies/application_policy.rb
+++ b/app/policies/application_policy.rb
@@ -43,7 +43,7 @@ end
def resolve
- scope.all
+ scope.all if user.is_a?(AdminUser)
end
end
end
|
Add guard for ApplicationPolicy>Scope resolve method
|
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -5,7 +5,7 @@ flash.inject("") do |sum, message|
content_tag :div, :class => "alert alert-#{types[message[0]]}" do
button_tag('×'.html_safe, :type => 'button', :class => 'close', :'data-dismiss' => 'alert', :name => nil) +
- message[1]
+ message[1].html_safe
end
end
end
|
Fix flash notice HTML bug
|
diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb
index abc1234..def5678 100644
--- a/app/mailers/application_mailer.rb
+++ b/app/mailers/application_mailer.rb
@@ -1,5 +1,5 @@ # frozen_string_literal: true
class ApplicationMailer < ActionMailer::Base
- default from: "from@example.com"
+ default from: "no-reply@eightynotes.com"
layout "mailer"
end
|
Update default from in application mailer to eightynotes.com
|
diff --git a/app/models/domain.rb b/app/models/domain.rb
index abc1234..def5678 100644
--- a/app/models/domain.rb
+++ b/app/models/domain.rb
@@ -13,7 +13,8 @@ doc = ""
end
- tag = Nokogiri::HTML(doc).at("html head meta[name='Description']")
+ header = Nokogiri::HTML(doc).at("html head")
+ tag = header.at("meta[name='description']") || header.at("meta[name='Description']")
meta = tag["content"] if tag
domain = create!(name: domain_name, meta: meta)
end
|
Handle lower case and capitalised meta tag
|
diff --git a/lib/bunny.rb b/lib/bunny.rb
index abc1234..def5678 100644
--- a/lib/bunny.rb
+++ b/lib/bunny.rb
@@ -34,4 +34,15 @@ Bunny::Client.new(opts)
end
-end+ def self.open(opts = {}, &block)
+ raise ArgumentError, 'open requires a block' unless block
+
+ client = Bunny::Client.new(opts)
+ client.start
+
+ block.call(client)
+
+ client.stop
+ end
+
+end
|
Add Bunny.open for short lived connections.
|
diff --git a/lib/gaffe.rb b/lib/gaffe.rb
index abc1234..def5678 100644
--- a/lib/gaffe.rb
+++ b/lib/gaffe.rb
@@ -2,23 +2,28 @@ require 'gaffe/errors'
module Gaffe
+ # Yield a block to populate @configuration
def self.configure
yield configuration
end
+ # Return the configuration settings
def self.configuration
@configuration ||= OpenStruct.new
end
+ # Return either the user-defined controller or our default controller
def self.errors_controller
@errors_controller ||= (configuration.errors_controller || builtin_errors_controller)
end
+ # Return our default controller
def self.builtin_errors_controller
require 'gaffe/errors_controller'
Gaffe::ErrorsController
end
+ # Configure Rails to use our code when encountering exceptions
def self.enable!
Rails.application.config.exceptions_app = lambda do |env|
Gaffe.errors_controller.action(:show).call(env)
|
Add documentation to a few methods
|
diff --git a/ohm-contrib.gemspec b/ohm-contrib.gemspec
index abc1234..def5678 100644
--- a/ohm-contrib.gemspec
+++ b/ohm-contrib.gemspec
@@ -13,5 +13,6 @@ s.add_dependency "ohm", "~> 2.0.0.rc1"
s.add_development_dependency "cutest"
+ s.add_development_dependency "iconv"
s.add_development_dependency "override"
end
|
Add iconv as a development dependency.
|
diff --git a/wellspring.gemspec b/wellspring.gemspec
index abc1234..def5678 100644
--- a/wellspring.gemspec
+++ b/wellspring.gemspec
@@ -9,9 +9,9 @@ s.version = Wellspring::VERSION
s.authors = ["Piotr Chmolowski"]
s.email = ["piotr@chmolowski.pl"]
- s.homepage = "TODO"
- s.summary = "TODO: Summary of Wellspring."
- s.description = "TODO: Description of Wellspring."
+ s.homepage = "http://pchm.co"
+ s.summary = "Rails & Postgres CMS Engine"
+ s.description = "Rails & Postgres CMS Engine (from the turorial on my blog)."
s.license = "MIT"
s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"]
|
Add valid gemspec metadata to fix bundle errors
Solves:
https://github.com/pch/wellspring-example-blog/issues/2
|
diff --git a/with_model.gemspec b/with_model.gemspec
index abc1234..def5678 100644
--- a/with_model.gemspec
+++ b/with_model.gemspec
@@ -6,9 +6,9 @@ s.name = "with_model"
s.version = WithModel::VERSION
s.platform = Gem::Platform::RUBY
- s.authors = ["Peter Jaros", "Grant Hutchins"]
- s.email = ["pjaros@pivotallabs.com", "grant@pivotallabs.com"]
- s.homepage = "https://github.com/casebook/with_model"
+ s.authors = ["Case Commons, LLC"]
+ s.email = ["casecommons-dev@googlegroups.com"]
+ s.homepage = "https://github.com/Casecommons/with_model"
s.summary = %q{Dynamically build a model within an Rspec context}
s.description = s.summary
|
Update gemspec to prepare for 0.1 gem release
|
diff --git a/lib/active_merchant/billing/integrations/ipay88.rb b/lib/active_merchant/billing/integrations/ipay88.rb
index abc1234..def5678 100644
--- a/lib/active_merchant/billing/integrations/ipay88.rb
+++ b/lib/active_merchant/billing/integrations/ipay88.rb
@@ -21,14 +21,14 @@ self.merch_key = key
end
- # The requery URL upon returning from iPay88
+ # The URL to POST your payment form to
def self.service_url
- "https://www.mobile88.com/epayment/enquiry.asp"
+ "https://www.mobile88.com/epayment/entry.asp"
end
- # The URL to POST your payment form to
+ # The requery URL upon returning from iPay88
def self.entry_url
- "https://www.mobile88.com/epayment/entry.asp"
+ "https://www.mobile88.com/epayment/enquiry.asp"
end
def self.return(query_string)
|
Swap service_url and entry_url to play nice with ActiveMerchant's payment_service_for view helper
|
diff --git a/lib/ama_validators/postal_code_format_validator.rb b/lib/ama_validators/postal_code_format_validator.rb
index abc1234..def5678 100644
--- a/lib/ama_validators/postal_code_format_validator.rb
+++ b/lib/ama_validators/postal_code_format_validator.rb
@@ -1,7 +1,7 @@ class PostalCodeFormatValidator < ActiveModel::EachValidator
def validate_each(object, attribute, value)
unless value =~ /\A(\d{5}((-|\s)\d{4})?)|([txTX]\d[abceghjklmnprstvwxyzABCEGHJKLMNPRSTVWXYZ])\ {0,1}(\d[abceghjklmnprstvwxyzABCEGHJKLMNPRSTVWXYZ]\d)\z/
- object.errors[attribute] << (options[:message] || "enter a valid AB or NT postal code (e.g. T2T 2T2)")
+ object.errors[attribute] << (options[:message] || "enter a valid AB or NT postal code (e.g. T4C 1A5)")
end
end
end
|
Change postal code in e.g message
* This probably have to change algo in the en.yml file for each project
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,7 +1,8 @@+require "codeclimate-test-reporter"
+CodeClimate::TestReporter.start
+
ENV['RACK_ENV'] = 'test'
require_relative './mock/app'
require 'rspec'
require 'rack/test'
-require "codeclimate-test-reporter"
-CodeClimate::TestReporter.start
|
Move codeclimate code to the top
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,3 +1,41 @@ $TESTING=true
$:.push File.join(File.dirname(__FILE__), '..', 'lib')
require 'iniparse'
+
+# Taken from Merb Core's spec helper.
+# Merb is licenced using the MIT License and is copyright Engine Yard Inc.
+
+module IniParse
+ module SpecHelpers
+ class BeKindOf
+ def initialize(expected) # + args
+ @expected = expected
+ end
+
+ def matches?(target)
+ @target = target
+ @target.kind_of?(@expected)
+ end
+
+ def failure_message
+ "expected #{@expected} but got #{@target.class}"
+ end
+
+ def negative_failure_message
+ "expected #{@expected} to not be #{@target.class}"
+ end
+
+ def description
+ "be_kind_of #{@target}"
+ end
+ end
+
+ def be_kind_of(expected) # + args
+ BeKindOf.new(expected)
+ end
+ end
+end
+
+Spec::Runner.configure do |config|
+ config.include(IniParse::SpecHelpers)
+end
|
Add +be_kind_of+ spec helper from Merb.
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -5,7 +5,7 @@
RSpec.configure do |config|
config.platform = 'centos'
- config.version = '7.2.1511'
+ config.version = '7.5.1804'
end
def mock_web_xml(role_name = 'user', timeout = 30)
|
Fix Chefspecs by bumping centos platform version
Recent versions of fauxhai do not support CentOS 7.2 anymore.
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,9 +1,9 @@+require 'json'
require 'faker'
require 'vimrunner'
require 'vimrunner/testing'
require_relative 'lib/cmakevim'
require_relative 'lib/vimrunner/extras'
-require_relative 'lib/cmakevim/environment'
I18n.enforce_available_locales = false
@@ -12,6 +12,7 @@ config.include Vimrunner::Testing
config.include Vimrunner::Extras
config.include CMakeVim::Environment
+ config.include CMakeVim::RSpec
config.around(:each) do | example |
dir = Dir.mktmpdir
@@ -20,6 +21,7 @@ expect(vim.command('pwd')).to match(dir)
example.run
cleanup_cmake unless cmake.nil?
+ vim.kill
end
end
end
|
Edit basis of test suite.
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -6,6 +6,8 @@ require 'ramesh'
require 'webmock/rspec'
+WebMock.disable_net_connect!(allow: "codeclimate.com")
+
def fixture_path(name)
File.expand_path(File.join("..", "fixtures", name), __FILE__)
end
|
Allow connection to Code Climate
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,4 +1,8 @@ require 'chefspec'
require 'chefspec/berkshelf'
-ChefSpec::Coverage.start!
+RSpec.configure do |config|
+ config.color = true # Use color in STDOUT
+ config.formatter = :documentation # Use the specified formatter
+ config.log_level = :error # Avoid deprecation notice SPAM
+end
|
Remove the chefspec coverage report
Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,6 +1,6 @@ if ENV["CODECLIMATE_REPO_TOKEN"]
- require "codeclimate-test-reporter"
- CodeClimate::TestReporter.start
+ require "simplecov"
+ SimpleCov.start
end
require "interactor/rails"
|
Upgrade to the latest version of the CodeClimate test reporter
|
diff --git a/lib/concurrent/thread_safe/util/array_hash_rbx.rb b/lib/concurrent/thread_safe/util/array_hash_rbx.rb
index abc1234..def5678 100644
--- a/lib/concurrent/thread_safe/util/array_hash_rbx.rb
+++ b/lib/concurrent/thread_safe/util/array_hash_rbx.rb
@@ -10,10 +10,9 @@ @_monitor = Monitor.new unless @_monitor # avoid double initialisation
end
- def self.new
- obj = super
- obj.send(:_mon_initialize)
- obj
+ def initialize(*args)
+ _mon_initialize
+ super
end
end
|
Fix broken initialization arguments on TruffleRuby
The `make_synchronized_on_rbx` method is used to intercept the `.new`
method on Array/Hash/Set but it broke whenever the `.new` was being used
with arguments.
(This was shown by the Array/Hash/Set specs that were added in the
previous commits being broken on TruffleRuby.)
|
diff --git a/test/surface_spec.rb b/test/surface_spec.rb
index abc1234..def5678 100644
--- a/test/surface_spec.rb
+++ b/test/surface_spec.rb
@@ -0,0 +1,86 @@+# This is mostly for regression testing and bugfix confirmation at the moment.
+
+require 'rubygame'
+include Rubygame
+
+context "A Surface being created (with a Screen available)" do
+ setup do
+ @screen = Screen.new([100,100])
+ end
+
+ teardown do
+ Rubygame.quit
+ end
+
+ specify "should raise TypeError when #new size is not an Array" do
+ lambda {
+ Surface.new("not an array")
+ }.should raise_error(TypeError)
+ end
+
+ specify "should raise ArgumentError when #new size is an Array of non-Numerics" do
+ lambda {
+ Surface.new(["not", "numeric", "members"])
+ }.should raise_error(TypeError)
+ end
+
+ specify "should raise ArgumentError when #new size is too short" do
+ lambda {
+ Surface.new([1])
+ }.should raise_error(ArgumentError)
+ end
+end
+
+# Maybe an overly-broad context?
+context "An existing Surface" do
+ setup do
+ @screen = Screen.new([100,100])
+ @surface = Surface.new([100,100])
+ end
+
+ teardown do
+ Rubygame.quit
+ end
+
+ specify "should raise TypeError when #blit target is not a Surface" do
+ lambda {
+ @surface.blit("not a surface", [0,0])
+ }.should raise_error(TypeError)
+ end
+
+ specify "should raise TypeError when #blit dest is not an Array" do
+ lambda {
+ @surface.blit(@screen, "foo")
+ }.should raise_error(TypeError)
+ end
+
+ specify "should raise TypeError when #blit src is not an Array" do
+ lambda {
+ @surface.blit(@screen, [0,0], "foo")
+ }.should raise_error(TypeError)
+ end
+
+ specify "should raise TypeError when #fill color is not an Array" do
+ lambda {
+ @surface.fill("not_an_array")
+ }.should raise_error(TypeError)
+ end
+
+ specify "should raise TypeError when #fill color is an Array of non-Numerics" do
+ lambda {
+ @surface.fill(["non", "numeric", "members"])
+ }.should raise_error(TypeError)
+ end
+
+ specify "should raise ArgumentError when #fill color is too short" do
+ lambda {
+ @surface.fill([0xff, 0xff])
+ }.should raise_error(TypeError)
+ end
+
+ specify "should raise TypeError when #fill color is not an Array" do
+ lambda {
+ @surface.fill([0xff, 0xff, 0xff], "not_an_array")
+ }.should raise_error(TypeError)
+ end
+end
|
Add some tests/specs for recently fixed Surface methods.
|
diff --git a/0_code_wars/decoding_a_message.rb b/0_code_wars/decoding_a_message.rb
index abc1234..def5678 100644
--- a/0_code_wars/decoding_a_message.rb
+++ b/0_code_wars/decoding_a_message.rb
@@ -0,0 +1,11 @@+# http://www.codewars.com/kata/565b9d6f8139573819000056/
+# --- iteration 1 ---
+def decode(message)
+ message.chars.map do |chr|
+ if chr == " "
+ chr
+ else
+ (122 - chr.ord + 97).chr
+ end
+ end.join
+end
|
Add code wars - decoding a message
|
diff --git a/CKCircleMenuView.podspec b/CKCircleMenuView.podspec
index abc1234..def5678 100644
--- a/CKCircleMenuView.podspec
+++ b/CKCircleMenuView.podspec
@@ -2,7 +2,7 @@ Pod::Spec.new do |s|
s.name = "CKCircleMenuView"
- s.version = "0.1.2"
+ s.version = "0.1.3"
s.summary = "An easy-to-integrate popup menu of round buttons placed on a circle."
s.description = <<-DESC
@@ -22,7 +22,7 @@ s.platform = :ios, "7.0"
s.requires_arc = true
- s.source = { :git => "https://github.com/JaNd3r/CKCircleMenuView.git", :tag => "0.1.2" }
+ s.source = { :git => "https://github.com/JaNd3r/CKCircleMenuView.git", :tag => "0.1.3" }
s.source_files = "CKCircleMenuView/*.{h,m}"
|
Prepare .podspec for next release.
|
diff --git a/app.rb b/app.rb
index abc1234..def5678 100644
--- a/app.rb
+++ b/app.rb
@@ -6,8 +6,13 @@
set :database, "sqlite3:pizzashop.db"
+after do
+ ActiveRecord::Base.clear_active_connections!
+end
+
class Product < ActiveRecord::Base
end
+
get '/' do
@products = Product.all
|
Add function after for ActiveRecord connections
|
diff --git a/Casks/xact.rb b/Casks/xact.rb
index abc1234..def5678 100644
--- a/Casks/xact.rb
+++ b/Casks/xact.rb
@@ -1,6 +1,6 @@ class Xact < Cask
- version '2.30'
- sha256 '49f7770ad682bdb36f63bebaf98875c22c1ffc7bb9a14b616213039506a9cf74'
+ version '2.31'
+ sha256 '8e971fb8ae3f24a8188b9f70366993520c31922649058c04de0d084af5c8521e'
url "http://xact.scottcbrown.org/xACT#{version}.zip"
appcast 'http://xactupdate.scottcbrown.org/xACT.xml'
|
Update xACT 2.30 to 2.31
|
diff --git a/run.rb b/run.rb
index abc1234..def5678 100644
--- a/run.rb
+++ b/run.rb
@@ -1,4 +1,11 @@-#run.rb
-#TODO: test on Windows
+#run.rb #TODO: test on Windows
-`g++ #{ARGF.filename}`
+require 'tmpdir'
+
+src = ARGF.filename
+puts "about to compile and run #{src}"
+Dir.mktmpdir do |tmp|
+ exe = "#{tmp}/#{src}.exe"
+ opts = '-W -Wall -Werror -pedantic'
+ system("g++ #{opts} -o #{exe} #{src}") && system(exe)
+end
|
Add more compiler options
Build executable in temporary directory
Run executable if compile is successful
|
diff --git a/lib/sastrawi/stemmer/confix_stripping/precedence_adjustment_specification.rb b/lib/sastrawi/stemmer/confix_stripping/precedence_adjustment_specification.rb
index abc1234..def5678 100644
--- a/lib/sastrawi/stemmer/confix_stripping/precedence_adjustment_specification.rb
+++ b/lib/sastrawi/stemmer/confix_stripping/precedence_adjustment_specification.rb
@@ -4,8 +4,8 @@ class PrecedenceAdjustmentSpecification
def satisfied_by?(value)
regex_rules = [
- '/^be(.*)lah$/', '/^be(.*)an$/', '/^me(.*)i$/',
- '/^di(.*)i$/', '/^pe(.*)i$/', '/^ter(.*)i$/'
+ /^be(.*)lah$/, /^be(.*)an$/, /^me(.*)i$/,
+ /^di(.*)i$/, /^pe(.*)i$/, /^ter(.*)i$/
]
regex_rules.each do |rule|
|
Remove apostrophe in array of regular expressions
|
diff --git a/config/initializers/hoptoad.rb b/config/initializers/hoptoad.rb
index abc1234..def5678 100644
--- a/config/initializers/hoptoad.rb
+++ b/config/initializers/hoptoad.rb
@@ -1,3 +1,11 @@ HoptoadNotifier.configure do |config|
config.api_key = ENV['HOPTOAD_API_KEY']
+
+ config.environment_filters << "GMAIL"
+ config.environment_filters << "RECAPTCHA_PRIVATE_KEY"
+ config.environment_filters << "RECAPTCHA_PUBLIC_KEY"
+ config.environment_filters << "TWITTER_SECRET"
+ config.environment_filters << "TWITTER_TOKEN"
+ config.environment_filters << "TWITTER_ASECRET"
+ config.environment_filters << "TWITTER_ATOKEN"
end
|
Make sure to filter sensitive environment variables for Hoptoad
|
diff --git a/config/initializers/lograge.rb b/config/initializers/lograge.rb
index abc1234..def5678 100644
--- a/config/initializers/lograge.rb
+++ b/config/initializers/lograge.rb
@@ -6,6 +6,7 @@ {
application_id: controller.current_application.try(:id),
application_type: controller.current_application.try(:class),
+ current_admin_user_email: controller.current_admin_user.try(:email)
}
end
end
|
Add current admin user’s email to every log line.
|
diff --git a/Formula/jp.rb b/Formula/jp.rb
index abc1234..def5678 100644
--- a/Formula/jp.rb
+++ b/Formula/jp.rb
@@ -1,13 +1,12 @@ class Jp < Formula
desc "Command-line interface to JMESPath, a query language for JSON"
homepage "http://jmespath.org/"
- url "https://github.com/jmespath/jp/archive/0.1.1.tar.gz"
- sha256 "f19863c1683a4789bdefbc098348743898ed8ec3c8706db3ab940d4a57688bf9"
+ url "https://github.com/jmespath/jp/releases/download/0.1.3/jp-0.1.3.tar.gz"
+ sha256 "69c9f545d552125eff246e9275cb5205109a232ff9b40b94bfab10f226caae65"
- depends_on "go" => :build
+ bottle: unneeded
def install
- system "scripts/build-self-contained.sh"
bin.install "jp"
end
|
Use prebuilt binary instead of requiring go
Faster installs and better reliability that we're
installing the exact same version we've tested and signed.
|
diff --git a/Casks/hush.rb b/Casks/hush.rb
index abc1234..def5678 100644
--- a/Casks/hush.rb
+++ b/Casks/hush.rb
@@ -1,6 +1,6 @@ class Hush < Cask
- version '1.0'
- sha256 'da31f0abd7c531e87c9f171493d318535cb24f1335e7e2b1c0fa68eeed685b2e'
+ version 'latest'
+ sha256 :no_check
url 'https://coffitivity.com/hush/files/Hush.dmg.zip'
homepage 'http://coffitivity.com/hush/'
|
Update Hush.app to use latest with :no_check.
|
diff --git a/Casks/zest.rb b/Casks/zest.rb
index abc1234..def5678 100644
--- a/Casks/zest.rb
+++ b/Casks/zest.rb
@@ -2,6 +2,7 @@ version '0.1.1'
sha256 '9405fecb40731b47bb357e87714711afe6d1f6a9c3a4fa9d01b0109da9c3f947'
+ # github.com/zestdocs/zest was verified as official when first introduced to the cask
url "https://github.com/zestdocs/zest/releases/download/v#{version}/zest-v#{version}.dmg"
appcast 'https://github.com/zestdocs/zest/releases.atom',
checkpoint: '070f49a40e5db4448424a7ab4305fd05ecfee703f14e99b76c776961a760eed5'
|
Fix `url` stanza comment for Zest.
|
diff --git a/app/models/event.rb b/app/models/event.rb
index abc1234..def5678 100644
--- a/app/models/event.rb
+++ b/app/models/event.rb
@@ -3,4 +3,5 @@
validates :shift_length, :address, presence: true
+ accepts_nested_attributes_for :shifts
end
|
Implement nested shift attribute acceptance
|
diff --git a/core/app/controllers/spree/admin/states_controller.rb b/core/app/controllers/spree/admin/states_controller.rb
index abc1234..def5678 100644
--- a/core/app/controllers/spree/admin/states_controller.rb
+++ b/core/app/controllers/spree/admin/states_controller.rb
@@ -1,7 +1,7 @@ module Spree
module Admin
class StatesController < ResourceController
- belongs_to :country
+ belongs_to 'spree/country'
before_filter :load_data
def index
|
Correct reference to Spree::Country in Admin::StatesController
|
diff --git a/ActivityKit.podspec b/ActivityKit.podspec
index abc1234..def5678 100644
--- a/ActivityKit.podspec
+++ b/ActivityKit.podspec
@@ -4,7 +4,7 @@ s.version = '1.0.2'
s.summary = 'Custom application activities for iOS.'
s.homepage = 'https://github.com/ccrazy88/activity-kit'
- s.author = { 'Chrisna Aing' => 'chrisna@udacity.com' }
+ s.author = { 'Chrisna Aing' => 'chrisna@chrisna.org' }
s.source = { :git => 'https://github.com/ccrazy88/activity-kit.git',
:tag => s.version.to_s }
s.license = { :type => 'MIT', :file => 'LICENSE' }
|
Change email address in pod specification.
|
diff --git a/upstreamer.gemspec b/upstreamer.gemspec
index abc1234..def5678 100644
--- a/upstreamer.gemspec
+++ b/upstreamer.gemspec
@@ -22,6 +22,7 @@ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]
+ spec.add_runtime_dependency "octokit"
spec.add_development_dependency "bundler", "~> 1.7"
spec.add_development_dependency "rake", "~> 10.0"
end
|
Add octokit as runtime dependency
|
diff --git a/Casks/parallels9.rb b/Casks/parallels9.rb
index abc1234..def5678 100644
--- a/Casks/parallels9.rb
+++ b/Casks/parallels9.rb
@@ -0,0 +1,20 @@+class Parallels < Cask
+ version '9.0.24237.1028877'
+ sha256 'da71645ff1f0076ab5b2f8fa5eefb63bcd921e5f52161fd4dd85e6fb19ae2c57'
+
+ url "http://download.parallels.com/desktop/v9/update2.hotfix2/ParallelsDesktop-#{version}.dmg"
+ homepage 'http://www.parallels.com/products/desktop/'
+ license :unknown
+
+ pkg 'Install.mpkg'
+
+ uninstall :pkgutil => 'com.parallels.pkg.virtualization.bundle',
+ :kext => [
+ 'com.parallels.kext.usbconnect',
+ 'com.parallels.kext.hypervisor',
+ 'com.parallels.kext.hidhook',
+ 'com.parallels.kext.netbridge',
+ 'com.parallels.kext.vnic',
+ ]
+ zap :delete => '~/.parallels_settings'
+end
|
Move Parallels 9 to Cask versions repo
|
diff --git a/app/factories/shopify/product_image_factory.rb b/app/factories/shopify/product_image_factory.rb
index abc1234..def5678 100644
--- a/app/factories/shopify/product_image_factory.rb
+++ b/app/factories/shopify/product_image_factory.rb
@@ -20,9 +20,9 @@ # else if it's hosted online we must get the `url` of the image.
# I haven't found a better way of doing that yet.
begin
- bytes = File.open(image.attachment.url, "rb").read
+ bytes = open(image.attachment.url, "rb").read
rescue Errno::ENOENT
- bytes = File.open(image.attachment.path, "rb").read
+ bytes = open(image.attachment.path, "rb").read
ensure
encoded = Base64.encode64(bytes)
end
|
Use open instead of File.open
That way we can open the online URLs instead of just local files.
|
diff --git a/lib/nehm.rb b/lib/nehm.rb
index abc1234..def5678 100644
--- a/lib/nehm.rb
+++ b/lib/nehm.rb
@@ -28,15 +28,17 @@ PathManager.set_dl_path
UI.newline
+ UserManager.set_uid
+ UI.newline
+
if OS.mac?
PlaylistManager.set_playlist
UI.newline
end
- UserManager.set_uid
+ UI.success "Now you can use nehm!"
UI.newline
- UI.success "Now you can use nehm!\n"
sleep(UI::SLEEP_PERIOD)
end
|
Change the order of initialization
|
diff --git a/hasugar.gemspec b/hasugar.gemspec
index abc1234..def5678 100644
--- a/hasugar.gemspec
+++ b/hasugar.gemspec
@@ -9,6 +9,7 @@ spec.authors = ["Martin Fernandez"]
spec.email = ["me@bilby91.com"]
spec.summary = %q{ Sugar for ruby hash class. }
+ spec.description = %q{ Sugar for ruby hash class. }
spec.homepage = "https://github.com/bilby91/hasugar"
spec.license = "MIT"
@@ -19,5 +20,5 @@
spec.add_development_dependency "rspec", "~> 3.2"
spec.add_development_dependency "bundler", "~> 1.6"
- spec.add_development_dependency "rake"
+ spec.add_development_dependency "rake", "~> 10"
end
|
Add missing information to gemspec
|
diff --git a/rubygems-yardoc.gemspec b/rubygems-yardoc.gemspec
index abc1234..def5678 100644
--- a/rubygems-yardoc.gemspec
+++ b/rubygems-yardoc.gemspec
@@ -20,5 +20,6 @@ gem.add_runtime_dependency 'yard', '~> 0.8.5'
gem.add_development_dependency 'bundler'
+ gem.add_development_dependency 'rake'
gem.add_development_dependency 'redcarpet'
end
|
Add Rake to dependent gems
|
diff --git a/resources/notify.rb b/resources/notify.rb
index abc1234..def5678 100644
--- a/resources/notify.rb
+++ b/resources/notify.rb
@@ -37,7 +37,7 @@ options['channel'] = channel if new_resource.channels
options['username'] = new_resource.username if new_resource.username
options['icon_emoji'] = new_resource.icon_emoji if new_resource.icon_emoji
- converge_by "notify Slack channel #{channel} with message: #{message}" do
+ converge_by "notify Slack channel #{channel} with message: #{new_resource.message}" do
slack.ping(new_resource.message, options)
end
end
|
Fix Depricated features used! Warning
|
diff --git a/lib/tent-validator/validators/posts_feed_validator.rb b/lib/tent-validator/validators/posts_feed_validator.rb
index abc1234..def5678 100644
--- a/lib/tent-validator/validators/posts_feed_validator.rb
+++ b/lib/tent-validator/validators/posts_feed_validator.rb
@@ -19,18 +19,29 @@ set(:post_types, post_types)
end
- # TODO: validate raw feed (no params)
describe "GET /posts", :before => :create_posts do
- expect_response(:status => 200, :schema => :data) do
- expect_properties(:posts => get(:post_types).map { |type| { :type => type } })
+ context "without params" do
+ expect_response(:status => 200, :schema => :data) do
+ expect_properties(:posts => get(:post_types).map { |type| { :type => type } })
- clients(:app).post.list
+ clients(:app).post.list
+ end
end
+
+ # TODO: validate feed with type param
+ context "with type param" do
+ expect_response(:status => 200, :schema => :data) do
+ types = get(:post_types)
+ types = [types.first, types.last]
+
+ expect_properties(:posts => types.map { |type| { :type => type } })
+
+ clients(:app).post.list(:types => types)
+ end
+ end
+
+ # TODO: validate feed with entity param (no proxy)
end
-
- # TODO: validate feed with type param
-
- # TODO: validate feed with entity param (no proxy)
end
TentValidator.validators << PostsFeedValidator
|
Add basic GET /posts?types=... validation
|
diff --git a/week-4/math/my_solution.rb b/week-4/math/my_solution.rb
index abc1234..def5678 100644
--- a/week-4/math/my_solution.rb
+++ b/week-4/math/my_solution.rb
@@ -7,16 +7,20 @@
def add(num_1, num_2)
#your code here
+ num_1 + num_2
end
def subtract(num_1, num_2)
#your code here
+ num_1 - num_2
end
def multiply(num_1, num_2)
#your code here
+ num_1 * num_2
end
def divide(num_1, num_2)
#your code here
+ num_1 / num_2
end
|
Complete the answer for 4.3.2 Defining Math Methods.
|
diff --git a/test/unit/gen/code_gen_test.rb b/test/unit/gen/code_gen_test.rb
index abc1234..def5678 100644
--- a/test/unit/gen/code_gen_test.rb
+++ b/test/unit/gen/code_gen_test.rb
@@ -1,7 +1,7 @@ require 'test/unit'
require File.expand_path '../../../assert_helper.rb', __FILE__
require File.expand_path '../../../../lib/support/supported_programming_languages.rb', __FILE__
-require File.expand_path '../../../../lib/generator/code_gen.rb', __FILE__
+require File.expand_path '../../../../lib/gen/code_gen.rb', __FILE__
class CodeGenTest < Test::Unit::TestCase
|
Rename from code_generator to code_gen.
|
diff --git a/rails/script/update.rb b/rails/script/update.rb
index abc1234..def5678 100644
--- a/rails/script/update.rb
+++ b/rails/script/update.rb
@@ -4,9 +4,9 @@ puts "Fetching latest Rails locale files to #{rails_locale_dir}"
exec %(
- curl http://github.com/rails/rails/tree/master/actionpack/lib/action_view/locale/en.yml?raw=true > #{rails_locale_dir}/action_view.yml
+ curl -Lo '#{rails_locale_dir}/action_view.yml' http://github.com/rails/rails/tree/master/actionpack/lib/action_view/locale/en.yml?raw=true
- curl http://github.com/rails/rails/tree/master/activerecord/lib/active_record/locale/en.yml?raw=true > #{rails_locale_dir}/active_record.yml
+ curl -Lo '#{rails_locale_dir}/active_record.yml' http://github.com/rails/rails/tree/master/activerecord/lib/active_record/locale/en.yml?raw=true
- curl http://github.com/rails/rails/tree/master/activesupport/lib/active_support/locale/en.yml?raw=true > #{rails_locale_dir}/active_support.yml
+ curl -Lo '#{rails_locale_dir}/active_support.yml' http://github.com/rails/rails/tree/master/activesupport/lib/active_support/locale/en.yml?raw=true
)
|
Update and fix Rails locale fetch script
|
diff --git a/vapor_extension.rb b/vapor_extension.rb
index abc1234..def5678 100644
--- a/vapor_extension.rb
+++ b/vapor_extension.rb
@@ -16,7 +16,7 @@ FlowMeter.initialize_all if ActiveRecord::Base.connection.tables.include?('flow_meters')
SiteController.send :include, Vapor::ControllerExtensions
- if admin.help
+ if admin.respond_to? :help
admin.help.index.add :page_details, 'slug_redirect', :after => 'slug'
end
end
@@ -25,4 +25,4 @@
end
-end+end
|
Fix in case help extension not installed.
|
diff --git a/app/api/entities/payload_formatter.rb b/app/api/entities/payload_formatter.rb
index abc1234..def5678 100644
--- a/app/api/entities/payload_formatter.rb
+++ b/app/api/entities/payload_formatter.rb
@@ -1,13 +1,14 @@ # Adds a method for formatting payload contents.
module PayloadFormatter
- extend self
-
def format_payload(payload)
new_payload = {}
- new_payload['@context'] = payload.delete('@context')
- new_payload['@id'] = payload.delete('@id')
- new_payload['@graph'] = payload.delete('@graph')
+ ['@context', '@id', '@graph'].each do |key|
+ val = payload.delete(key)
+ new_payload[key] = val if val.present?
+ end
payload.each { |k, v| new_payload[k] = v }
new_payload
end
+
+ module_function :format_payload
end
|
Fix bug in JSON k/v ordering
Don't assign null properties
|
diff --git a/spec/requests/products_spec.rb b/spec/requests/products_spec.rb
index abc1234..def5678 100644
--- a/spec/requests/products_spec.rb
+++ b/spec/requests/products_spec.rb
@@ -1,9 +1,9 @@ require 'rails_helper'
RSpec.describe 'Products', type: :request do
- describe 'GET /products' do
+ describe 'shows sales breakdown by month for a date range' do
it 'successful request' do
- get '/api/products'
+ get '/api/products/1?per=month&starting=2016-12-31&ending=2017-06-30'
expect(response).to have_http_status(200)
end
end
|
Add spec for showing monthly sold for a product
|
diff --git a/config/environment.rb b/config/environment.rb
index abc1234..def5678 100644
--- a/config/environment.rb
+++ b/config/environment.rb
@@ -16,7 +16,7 @@ ALLOW_TAGS = %w(a i u b em strong table tr td th tbody font center div pre code blockquote ins del img br p hr ul li ol dl dt dd)
ALLOW_ATTRIBUTES = %w(src width height border alt title href color size align)
-Mime::Type.register 'application/xml', :opml
+Mime::Type.register 'text/x-opml', :opml
Fastladder::Initializer.run do |config|
#config.proxy = {
|
Change a content type of opml
|
diff --git a/examples/read_rdb.rb b/examples/read_rdb.rb
index abc1234..def5678 100644
--- a/examples/read_rdb.rb
+++ b/examples/read_rdb.rb
@@ -2,4 +2,8 @@
require 'rdb'
-RDB::Reader.read_file('test/rdb/multiple_databases.rdb', callbacks: RDB::DebugCallbacks.new)
+options = {
+ callbacks: RDB::DebugCallbacks.new,
+}
+
+RDB::Reader.read_file('test/rdb/database_multiple_logical_dbs.rdb', options)
|
Fix rdb path in example.
|
diff --git a/virtualbox.gemspec b/virtualbox.gemspec
index abc1234..def5678 100644
--- a/virtualbox.gemspec
+++ b/virtualbox.gemspec
@@ -1,5 +1,6 @@ # -*- encoding: utf-8 -*-
-require File.expand_path("../lib/virtualbox/version", __FILE__)
+$:.unshift File.expand_path("../lib", __FILE__)
+require "virtualbox/version"
Gem::Specification.new do |s|
s.name = "virtualbox"
|
Update gemspec so that when used as a source gem, warnings aren't thrown for duplicate VERSION Constant
|
diff --git a/SwiftDDP.podspec b/SwiftDDP.podspec
index abc1234..def5678 100644
--- a/SwiftDDP.podspec
+++ b/SwiftDDP.podspec
@@ -14,9 +14,10 @@
# Attempt to be compatible on all platforms
# s.platform = :ios, '8.0'
+
s.requires_arc = true
- s.source_files = 'SwiftDDP/**/*'
+ s.source_files = 'SwiftDDP/**/*.swift'
s.dependency 'CryptoSwift'
s.dependency 'SwiftWebSocket'
|
Enhance source_files selector to only work with swift files
|
diff --git a/fastlane/actions/test_github_access.rb b/fastlane/actions/test_github_access.rb
index abc1234..def5678 100644
--- a/fastlane/actions/test_github_access.rb
+++ b/fastlane/actions/test_github_access.rb
@@ -0,0 +1,109 @@+module Fastlane
+ module Actions
+ module SharedValues
+ end
+
+ class TestGithubAccessAction < Action
+ def self.run(params)
+ UI.important("Testing access to GitHub")
+
+ # Call endpoint
+ response = test_api(
+ 'https://api.github.com',
+ params[:api_token]
+ )
+
+ # Consume endpoint result
+ case response[:status]
+ when 200
+ UI.success("Successfully accessed API")
+
+ else
+ UI.user_error!("Could not access API. Responded with #{response[:status]}:#{response[:body]}")
+ end
+ end
+
+ def self.call_endpoint(url, method, headers)
+ require 'excon'
+
+ case method
+ when "get"
+ response = Excon.get(url, headers: headers)
+ else
+ UI.user_error!("Unsupported method #{method}")
+ end
+
+ return response
+ end
+
+ def self.test_api(server_url, api_token)
+ # GET /user
+ url = "#{server_url}/user"
+ call_endpoint(url, "get", headers(api_token))
+ end
+
+ def self.headers(api_token)
+ require 'base64'
+ headers = {'Content-Type' => 'application/json'}
+ headers['Authorization'] = "token #{api_token}"
+ headers['User-Agent'] = 'Fastlane'
+ headers
+ end
+
+ #####################################################
+ # @!group Documentation
+ #####################################################
+
+ def self.description
+ 'Tests token has access to GitHub'
+ end
+
+ def self.details
+ [
+ 'Sends a GET request to GitHub with the passed token as the authorization header.',
+ '',
+ 'You must provide your GiHub access token (get one from /settings/tokens).',
+ '',
+ 'Will throw a UI error if the server returns anything other than 200.'
+ ].join("\n")
+ end
+
+ def self.available_options
+ # Define all options your action supports.
+
+ # Below a few examples
+ [
+ FastlaneCore::ConfigItem.new(key: :api_token,
+ env_name: 'FL_TEST_GITHUB_ACCESS_API_TOKEN',
+ description: 'GitHub API Private Token from /settings/tokens',
+ sensitive: true,
+ default_value: ENV['GITHUB_PRIVATE_TOKEN'],
+ optional: false,
+ verify_block: proc do |value|
+ UI.user_error!("No GitHub API Private Token, pass using `api_token: 'token'`") unless (value and not value.empty?)
+ end)
+ ]
+ end
+
+ def self.authors
+ ['JoshuaJamesOng']
+ end
+
+ def self.is_supported?(platform)
+ true
+ end
+
+ def self.example_code
+ [
+ 'test_githhub_access(
+ api_token: ENV["GITHUB_PRIVATE_TOKEN"]
+ )'
+ ]
+ end
+
+ def self.category
+ :misc
+ end
+ end
+ end
+end
|
Add action to check GitHub access via user request
|
diff --git a/metadata.rb b/metadata.rb
index abc1234..def5678 100644
--- a/metadata.rb
+++ b/metadata.rb
@@ -6,5 +6,5 @@ long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "0.3.0"
depends "sys", '>= 1.51.0'
-depends "apache2", '< 6'
+depends "apache2", '< 6.0'
supports "debian", ">= 7.0"
|
Fix "ERROR: Chef::Exceptions::InvalidCookbookVersion: '6' does not match 'x.y.z' or 'x.y'"
|
diff --git a/metadata.rb b/metadata.rb
index abc1234..def5678 100644
--- a/metadata.rb
+++ b/metadata.rb
@@ -22,7 +22,7 @@ depends "redisio", ">= 1.7.0"
# available @ https://supermarket.chef.io/cookbooks/chef-vault
-depends "chef-vault", ">= 1.2.0"
+suggests "chef-vault", ">= 1.2.0"
%w[
ubuntu
|
Change this back to a suggest
Only the wrapper cookbook needs to mark it as a dependency to load the
library.
|
diff --git a/metadata.rb b/metadata.rb
index abc1234..def5678 100644
--- a/metadata.rb
+++ b/metadata.rb
@@ -2,22 +2,19 @@ maintainer 'Franklin Webber'
maintainer_email 'frank@chef.io'
license 'Apache 2.0'
-description 'Installs/Configures ark'
+description 'Provides a custom resource for installing runtime artifacts in a predictable fashion'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '0.9.1'
-source_url 'https://github.com/burtlo/ark' if respond_to(:source_url)
-issues_url 'https://github.com/burtlo/ark/issues' if respond_to?(:issues_url)
+recipe 'ark::default', 'Installs packages needed by the custom resource'
-def supported_operating_systems
- %w( debian ubuntu centos redhat fedora windows )
+%w(ubuntu debian redhat centos suse scientific oracle amazon windows).each do |os|
+ supports os
end
-supported_operating_systems.each { |os| supports os }
+depends 'build-essential'
+depends 'windows' # for windows os
+depends '7-zip' # for windows os
-recipe 'ark::default', 'Installs and configures ark'
-
-depends 'build-essential'
-
-suggests 'windows' # for windows os
-suggests '7-zip' # for windows os
+source_url 'https://github.com/burtlo/ark' if respond_to?(:source_url)
+issues_url 'https://github.com/burtlo/ark/issues' if respond_to?(:issues_url)
|
Fix description, expand platforms, depend on all deps
Suggests does nothing and should not be used. There's a foodcritic rule
to check for this in 6.0
There was a missing question mark in the source_url check that would
fail things
Write an actual description of what this cookbook does
|
diff --git a/app/controllers/index.rb b/app/controllers/index.rb
index abc1234..def5678 100644
--- a/app/controllers/index.rb
+++ b/app/controllers/index.rb
@@ -1,4 +1,5 @@-RESTRICTED_PATHS = [/\/users\/.+/]
+RESTRICTED_PATHS = []
+# /\/users\/.+/
RESTRICTED_PATHS.each do |path|
redirect "/" unless current_user
|
Remove restricted route; need to figure out what format works for regex on that
|
diff --git a/app/controllers/songs.rb b/app/controllers/songs.rb
index abc1234..def5678 100644
--- a/app/controllers/songs.rb
+++ b/app/controllers/songs.rb
@@ -3,16 +3,18 @@ end
get '/songs/new' do
+ 'create a song form'
+end
+
+post '/songs/new' do
'create a song'
end
-
-post '/s'
get '/songs/:id' do
'show single song'
end
-put '/songs/:id' do
+put '/songs/:id/edit' do
'edit single song'
end
|
Create POST route for new song
|
diff --git a/spec/feature/original_assigned_file_is_not_modified_spec.rb b/spec/feature/original_assigned_file_is_not_modified_spec.rb
index abc1234..def5678 100644
--- a/spec/feature/original_assigned_file_is_not_modified_spec.rb
+++ b/spec/feature/original_assigned_file_is_not_modified_spec.rb
@@ -0,0 +1,43 @@+require 'spec_helper'
+
+describe "Original assigned file" do
+ before { allow(Saviour::Config).to receive(:storage).and_return(Saviour::LocalStorage.new(local_prefix: @tmpdir, public_url_prefix: "http://domain.com")) }
+
+ let(:uploader) {
+ Class.new(Saviour::BaseUploader) do
+ store_dir { "/store/dir/#{model.id}" }
+ process_with_file do |file, name|
+ ::File.delete(file.path)
+
+ f = Tempfile.new("test")
+ f.write("Hello")
+ f.flush
+
+ [f, name]
+ end
+ end
+ }
+
+ let(:klass) {
+ klass = Class.new(Test) {
+ include Saviour::Model
+ }
+ klass.attach_file :file, uploader
+ klass
+ }
+
+ it "is preserved even after deleting the incoming file from a processor" do
+ f = Tempfile.new("test")
+ f.write("original")
+ f.flush
+
+ a = klass.create! file: f
+
+ expect(a.file.read).to eq "Hello"
+
+ expect(::File.file?(f.path)).to be_truthy
+ expect(::File.read(f.path)).to eq "original"
+
+ f.close!
+ end
+end
|
Test assigned file is never affected
|
diff --git a/app/controllers/explore_controller.rb b/app/controllers/explore_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/explore_controller.rb
+++ b/app/controllers/explore_controller.rb
@@ -3,6 +3,7 @@ class ExploreController < ApplicationController
layout 'explore'
+ ssl_allowed :index, :search
before_filter :get_viewed_user
def index
|
Allow ssl for explore site endpoints
|
diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/members_controller.rb
+++ b/app/controllers/members_controller.rb
@@ -1,7 +1,7 @@ class MembersController < ApplicationController
def index
- @organizations = Organization.all
+ @organizations = Organization.order(:name)
end
def show
|
Order organizations by name in the main list
|
diff --git a/XPCSwift.podspec b/XPCSwift.podspec
index abc1234..def5678 100644
--- a/XPCSwift.podspec
+++ b/XPCSwift.podspec
@@ -5,7 +5,7 @@ s.summary = "Type safe Swift wrapper for libxpc"
s.description = <<-DESC
- XPCSwift makes it easy to use xpc_object_t in a type safe manner.
+ XPCSwift makes it easy to use xpc\_object\_t in a type safe manner.
DESC
s.homepage = "https://github.com/IngmarStein/XPCSwift"
|
Use markdown syntax in podspec description
|
diff --git a/vim-flavor.gemspec b/vim-flavor.gemspec
index abc1234..def5678 100644
--- a/vim-flavor.gemspec
+++ b/vim-flavor.gemspec
@@ -20,5 +20,6 @@
gem.add_development_dependency('aruba', '~> 0.5')
gem.add_development_dependency('cucumber', '~> 1.2')
+ gem.add_development_dependency('pry')
gem.add_development_dependency('rspec', '~> 2.8')
end
|
Add pry as a development dependency
|
diff --git a/ActiveLabel.podspec b/ActiveLabel.podspec
index abc1234..def5678 100644
--- a/ActiveLabel.podspec
+++ b/ActiveLabel.podspec
@@ -1,6 +1,6 @@ Pod::Spec.new do |s|
s.name = 'ActiveLabel'
- s.version = '1.0.0'
+ s.version = '1.0.1'
s.author = { 'Optonaut' => 'hello@optonaut.co' }
s.homepage = 'https://github.com/optonaut/ActiveLabel.swift'
@@ -12,7 +12,7 @@ UILabel drop-in replacement supporting Hashtags (#), Mentions (@), URLs (http://) and custom regex patterns, written in Swift
Features
- * Up-to-date: Swift 4
+ * Up-to-date: Swift 4.2 and Xcode 10
* Default support for Hashtags, Mentions, Links
* Support for custom types via regex
* Ability to enable highlighting only for the desired types
|
Update podspec for Swift 4.2 and Xcode 10
|
diff --git a/app/mailers/pay/application_mailer.rb b/app/mailers/pay/application_mailer.rb
index abc1234..def5678 100644
--- a/app/mailers/pay/application_mailer.rb
+++ b/app/mailers/pay/application_mailer.rb
@@ -1,6 +1,6 @@ module Pay
class ApplicationMailer < ActionMailer::Base
- default from: 'from@example.com'
+ default from: Pay.support_email
layout 'mailer'
end
end
|
Use support email for pay mailer
|
diff --git a/app/models/refinery/user_decorator.rb b/app/models/refinery/user_decorator.rb
index abc1234..def5678 100644
--- a/app/models/refinery/user_decorator.rb
+++ b/app/models/refinery/user_decorator.rb
@@ -1,11 +1,21 @@+
+
Refinery::User.class_eval do
+ class DestroyWithOrdersError < StandardError; end
+
+ include Spree::UserAddress
+ include Spree::UserPaymentSource
+
before_validation :copy_username_from_email
+ before_destroy :check_completed_orders
- protected
+ private
def copy_username_from_email
- if self.username.blank? && self.email.present?
- self.username = self.email
- end
+ self.username ||= self.email if self.email
+ end
+
+ def check_completed_orders
+ raise DestroyWithOrdersError if orders.complete.present?
end
end
|
Add spree includes to the Refinery::User decorator
|
diff --git a/app/models/species/csv_copy_export.rb b/app/models/species/csv_copy_export.rb
index abc1234..def5678 100644
--- a/app/models/species/csv_copy_export.rb
+++ b/app/models/species/csv_copy_export.rb
@@ -16,7 +16,7 @@ \\COPY (#{query_sql.gsub(/"/,"\\\"")})
TO ?
WITH DELIMITER ','
- ENCODING 'latin1'
+ ENCODING 'utf8'
CSV HEADER;
PSQL
ActiveRecord::Base.send(:sanitize_sql_array, [sql, @file_name])
|
Revert to utf8 as with latin1 things were breaking
|
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -31,4 +31,17 @@
text_formatted
end
+
+ def page_header
+ case controller_name
+ when "notebooks"
+ @notebook.name
+ when "tags"
+ "Your tags"
+ when "calendar"
+ "Calendar view"
+ else
+ controller_name
+ end
+ end
end
|
Add helper for generating page header.
|
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -2,12 +2,20 @@
def display_address address
street = address.try(:_street)
- address_line = [address, street].compact.map(&:name).map(&:downcase).map(&:titlecase).join(' ')
- [
- address_line,
- street.try(:_place).try(:name),
- street.try(:_local_authority).try(:name),
- ].compact.join(', ')
+ address_lines = [address, street].
+ compact.
+ map(&:name).
+ map(&:strip).
+ select(&:present?).
+ map(&:downcase).
+ map(&:titlecase)
+ lines = address_lines + [
+ street.try(:_place).try(:name)
+ ]
+ lines.
+ compact.
+ join('<br />').
+ html_safe
end
def age_range school
|
Put break between address lines, remove local authority
Display address, street and place on separate lines in school view.
|
diff --git a/app/models/biodiversity_report.rb b/app/models/biodiversity_report.rb
index abc1234..def5678 100644
--- a/app/models/biodiversity_report.rb
+++ b/app/models/biodiversity_report.rb
@@ -34,7 +34,7 @@ end
def destroy_plant_samples
- self.plant_samples.each {|sample| sample.destroy }
+ self.plant_samples.each(&:destroy)
end
end
|
Clean up biodiverity's delete_plant_samples method
|
diff --git a/tomafro-deploy.gemspec b/tomafro-deploy.gemspec
index abc1234..def5678 100644
--- a/tomafro-deploy.gemspec
+++ b/tomafro-deploy.gemspec
@@ -7,9 +7,9 @@ s.version = Tomafro::Deploy::VERSION
s.authors = ["Tom Ward"]
s.email = ["tom@popdog.net"]
- s.homepage = ""
- s.summary = %q{TODO: Write a gem summary}
- s.description = %q{TODO: Write a gem description}
+ s.homepage = "https://github.com/tomafro/tomafro-deploy"
+ s.summary = %q{GIT based deployment recipes for Capistrano}
+ s.description = %q{GIT based deployment recipes for Capistrano}
s.rubyforge_project = "tomafro-deploy"
|
Add a description, summary and homepage to the gemspec
|
diff --git a/lib/oxford_learners_dictionaries/definition.rb b/lib/oxford_learners_dictionaries/definition.rb
index abc1234..def5678 100644
--- a/lib/oxford_learners_dictionaries/definition.rb
+++ b/lib/oxford_learners_dictionaries/definition.rb
@@ -18,6 +18,8 @@
def parse_multiple_definitions index
@signification = @page.css('.def')[index].text
+ return self if @page.css('.x-gs')[index].nil?
+
@page.css('.x-gs')[index].css('.x-g').each do |example|
@examples.push(::OxfordLearnersDictionaries::Example.new(example))
end
|
Check for examples before parsing them
|
diff --git a/lib/rspec/formatters/illustration_formatter.rb b/lib/rspec/formatters/illustration_formatter.rb
index abc1234..def5678 100644
--- a/lib/rspec/formatters/illustration_formatter.rb
+++ b/lib/rspec/formatters/illustration_formatter.rb
@@ -8,7 +8,7 @@ # @return [Array<Hash>] The list of illustrations in the example, where each
# illustration is represented by a { Hash } containing its properties.
def illustrations_of(notification)
- notification.example.metadata[:illustrations]
+ notification.example.metadata[:illustrations] || []
end
module_function :illustrations_of
|
Return empty list if key not present.
If the example hash doesn't contain any illustrations-key, it should
return an empty list instead of nil. This happens during --dry-run.
|
diff --git a/app/graphql/types/mailbox_type.rb b/app/graphql/types/mailbox_type.rb
index abc1234..def5678 100644
--- a/app/graphql/types/mailbox_type.rb
+++ b/app/graphql/types/mailbox_type.rb
@@ -8,6 +8,12 @@ field :type, types.String, 'The type of the mailbox' do
resolve ->(obj, _args, _ctx) do
obj.type.capitalize
+ end
+ end
+
+ field :user_type, types.String, 'The type of the mailbox' do
+ resolve ->(_obj, _args, ctx) do
+ ctx[:current_user].class.name.downcase
end
end
|
Add user_type field to mailbox
|
diff --git a/app/helpers/surveys_url_helper.rb b/app/helpers/surveys_url_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/surveys_url_helper.rb
+++ b/app/helpers/surveys_url_helper.rb
@@ -2,6 +2,7 @@
module SurveysUrlHelper
def course_survey_url(notification)
- "#{survey_url(notification.survey)}?course_slug=#{notification.course.slug.gsub('&', '%26')}"
+ slug = notification.course.slug.gsub('&', '%26')
+ "https://#{survey_url(notification.survey)}?course_slug=#{slug}"
end
end
|
Add https to survey link
|
diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb
index abc1234..def5678 100644
--- a/app/mailers/application_mailer.rb
+++ b/app/mailers/application_mailer.rb
@@ -1,4 +1,7 @@ class ApplicationMailer < ActionMailer::Base
- default from: Rails.application.config.action_mailer.smtp_settings[:from]
+ # TODO: Remove hard code domain
+ default(from: Rails.application.config.action_mailer.smtp_settings[:from],
+ "Message-ID" =>"#{Digest::SHA2.hexdigest(Time.now.to_i.to_s)}@noty.im")
+
layout 'mailer'
end
|
Add default message id for spam
http://blog.mailgun.com/tips-tricks-avoiding-gmail-spam-filtering-when-using-ruby-on-rails-action-mailer/
|
diff --git a/lib/hightops.rb b/lib/hightops.rb
index abc1234..def5678 100644
--- a/lib/hightops.rb
+++ b/lib/hightops.rb
@@ -22,7 +22,10 @@
# We ignore env configuration for Sneakers as it is too tied to its
# internals.
- Sneakers.configure env: nil
+ #
+ # Note: Sneakers 0.1.0 has an additional configuration option to ignore
+ # environment variable with Sneakers.not_environmental!
+ Sneakers.configure env: nil, amqp: config.amqp
end
end
end
|
Set up Sneakers amqp from Hightops configuration
|
diff --git a/lib/jukeberx.rb b/lib/jukeberx.rb
index abc1234..def5678 100644
--- a/lib/jukeberx.rb
+++ b/lib/jukeberx.rb
@@ -22,15 +22,30 @@ end
get '/artists' do
- settings.library.list_artists.to_json
+ if params['name']
+ name = params['name']
+ settings.library.match_artists(name).to_json
+ else
+ settings.library.list_artists.to_json
+ end
end
get '/albums' do
- settings.library.list_albums.to_json
+ if params['name']
+ name = params['name']
+ settings.library.match_albums(name).to_json
+ else
+ settings.library.list_albums.to_json
+ end
end
get '/titles' do
- settings.library.list_titles.to_json
+ if params['name']
+ name = params['name']
+ settings.library.match_titles(name).to_json
+ else
+ settings.library.list_titles.to_json
+ end
end
post '/play' do
|
Add parameter checking code to allow search on specific attributes.
|
diff --git a/lib/naginata.rb b/lib/naginata.rb
index abc1234..def5678 100644
--- a/lib/naginata.rb
+++ b/lib/naginata.rb
@@ -1,16 +1,16 @@-require "naginata/command/external_command"
-require "naginata/configuration"
-require "naginata/configuration/filter"
-require "naginata/configuration/nagios_server"
-require "naginata/configuration/service"
-require "naginata/runner"
-require "naginata/status"
-require "naginata/ui"
-require "naginata/version"
-
require "nagios_analyzer/section_decorator"
module Naginata
+
+ require "naginata/command/external_command"
+ require "naginata/configuration"
+ require "naginata/configuration/filter"
+ require "naginata/configuration/nagios_server"
+ require "naginata/configuration/service"
+ require "naginata/runner"
+ require "naginata/status"
+ require "naginata/ui"
+ require "naginata/version"
class NaginatafileNotFound < StandardError; end
|
Fix uninitialized constant Naginata (NameError)
This raises when require external_command before define Naginata
namespace.
|
diff --git a/blogo.gemspec b/blogo.gemspec
index abc1234..def5678 100644
--- a/blogo.gemspec
+++ b/blogo.gemspec
@@ -22,5 +22,5 @@ s.add_dependency "jquery-rails"
s.add_dependency 'coffee-rails'
s.add_dependency "bcrypt-ruby", "~> 3.0"
- s.add_dependency "sass-rails" , "~> 4.0"
+ s.add_dependency "sass-rails" , ">= 4"
end
|
Update rails-sass dependency to be compatible with rails 4.2
|
diff --git a/script/backwards_compatibility.rb b/script/backwards_compatibility.rb
index abc1234..def5678 100644
--- a/script/backwards_compatibility.rb
+++ b/script/backwards_compatibility.rb
@@ -1,19 +1,25 @@+# @!visibility private
if Kernel.const_defined?(:CALABASH_BACKWARDS_COMPATIBILITY_SCRIPT_RUN)
raise 'Calabash backwards compatibility script can only be run once'
end
+# @!visibility private
Kernel.const_set(:CALABASH_BACKWARDS_COMPATIBILITY_SCRIPT_RUN, true)
+# @!visibility private
# Fail if Calabash::Cucumber is already defined. If that is the case, we do not know what
-# side effects we might cause.
+# side effects we might cause.
if Object.const_defined?(:Calabash) && Object.const_get(:Calabash).const_defined?(:Cucumber)
raise 'Calabash::Cucumber is already defined'
end
+# @!visibility private
# Define Calabash and Calabash::IOS if they do not already exist. The existing code will
-# then patch the modules instead of defining them from scratch
+# then patch the modules instead of defining them from scratch
Object.const_set(:Calabash, Module.new) unless Object.const_defined?(:Calabash)
Object.const_get(:Calabash).const_set(:IOS, Module.new) unless Object.const_get(:Calabash).const_defined?(:IOS)
+# @!visibility private
# All references to Calabash::Cucumber will now refer implicitly to Calabash::IOS
-Object.const_get(:Calabash).const_set(:Cucumber, Object.const_get(:Calabash).const_get(:IOS))+Object.const_get(:Calabash).const_set(:Cucumber, Object.const_get(:Calabash).const_get(:IOS))
+
|
Use private flag for yard
|
diff --git a/NSObject+Rx.podspec b/NSObject+Rx.podspec
index abc1234..def5678 100644
--- a/NSObject+Rx.podspec
+++ b/NSObject+Rx.podspec
@@ -19,5 +19,5 @@ s.source = { :git => "https://github.com/RxSwiftCommunity/NSObject-Rx.git", :tag => s.version }
s.source_files = %w(NSObject+Rx.swift HasDisposeBag.swift)
s.frameworks = "Foundation"
- s.dependency 'RxSwift', '~> 6.0.0'
+ s.dependency 'RxSwift', '~> 6.0'
end
|
Fix support for RxSwift 6.x
|
diff --git a/init.rb b/init.rb
index abc1234..def5678 100644
--- a/init.rb
+++ b/init.rb
@@ -29,11 +29,11 @@
Redmine::Plugin.register :redmine_project_filtering do
name 'Redmine Project filtering plugin'
- author 'Enrique García Cota'
- url 'http://development.splendeo.es/projects/redm-project-filter'
+ author 'Enrique García Cota, Francisco de Juan'
+ url 'https://github.com/splendeo/redmine_project_filtering'
author_url 'http://www.splendeo.es'
description 'Adds filtering capabilities to the the project/index page'
- version '0.9.5'
+ version '0.9.6'
settings :default => {'used_fields' => {}}, :partial => 'settings/redmine_project_filtering'
|
Update authors and url. Version bump to 0.9.6
|
diff --git a/test/integration/default/serverspec/tasks_spec.rb b/test/integration/default/serverspec/tasks_spec.rb
index abc1234..def5678 100644
--- a/test/integration/default/serverspec/tasks_spec.rb
+++ b/test/integration/default/serverspec/tasks_spec.rb
@@ -1,7 +1,7 @@ require 'serverspec_helper'
describe 'nexus::tasks' do
- describe command('curl -uadmin:admin123 http://localhost:8081/service/siesta/rest/v1/script/get_task/run -X POST ' \
+ describe command('curl -uadmin:admin123 http://localhost:8081/service/rest/v1/script/get_task/run -X POST ' \
'-H "Content-Type: text/plain" -d foo') do
its(:exit_status) { should eq 0 }
its(:stdout) { should match(/result.*name.*foo/) }
|
Make nexus3_tasks integration tests compatible with 3.8.0
|
diff --git a/examples/exception_handling.rb b/examples/exception_handling.rb
index abc1234..def5678 100644
--- a/examples/exception_handling.rb
+++ b/examples/exception_handling.rb
@@ -42,7 +42,7 @@ puts "Some other Error #{e.inspect}"
end
-Bigcommerce::HttpError::ERRORS.each do |k, v|
+Bigcommerce::HttpErrors::ERRORS.each do |k, v|
bc_handle_exception do
# This will be your request that you want to protect from exceptions
raise v, k
|
Fix exception handling example typo
|
diff --git a/test/controllers/transition_landing_page_controller_test.rb b/test/controllers/transition_landing_page_controller_test.rb
index abc1234..def5678 100644
--- a/test/controllers/transition_landing_page_controller_test.rb
+++ b/test/controllers/transition_landing_page_controller_test.rb
@@ -20,5 +20,34 @@ assert_response :success
end
end
+
+ describe "accounts are enabled" do
+ before do
+ Rails.configuration.stubs(:feature_flag_govuk_accounts).returns(true)
+ end
+
+ %w[LoggedIn LoggedOut].each do |variant|
+ it "Variant #{variant} disables the search field" do
+ with_variant AccountExperiment: variant do
+ get :show
+ assert_equal "true", response.headers["X-Slimmer-Remove-Search"]
+ end
+ end
+ end
+
+ it "Variant LoggedIn requests the signed-in header" do
+ with_variant AccountExperiment: "LoggedIn" do
+ get :show
+ assert_equal "signed-in", response.headers["X-Slimmer-Show-Accounts"]
+ end
+ end
+
+ it "Variant LoggedOut requests the signed-out header" do
+ with_variant AccountExperiment: "LoggedOut" do
+ get :show
+ assert_equal "signed-out", response.headers["X-Slimmer-Show-Accounts"]
+ end
+ end
+ end
end
end
|
Add tests for accounts A/B test
|
diff --git a/spec/repository_spec.rb b/spec/repository_spec.rb
index abc1234..def5678 100644
--- a/spec/repository_spec.rb
+++ b/spec/repository_spec.rb
@@ -14,19 +14,19 @@
it 'correctly identified https URLs' do
r = DataKitten::Dataset.new(access_url: "https://github.com/theodi/github-viewer-test-data.git")
- r.host.should == :github
+ expect(r.host).to eq(:github)
end
it 'correctly identified http URLs' do
r = DataKitten::Dataset.new(access_url: "http://github.com/theodi/github-viewer-test-data.git")
- r.host.should == :github
+ expect(r.host).to eq(:github)
end
it 'correctly identified git URLs' do
r = DataKitten::Dataset.new(access_url: "git://github.com/theodi/github-viewer-test-data.git")
- r.host.should == :github
+ expect(r.host).to eq(:github)
end
end
-end+end
|
Move to new rspec expectation format
|
diff --git a/react-native-lookback.podspec b/react-native-lookback.podspec
index abc1234..def5678 100644
--- a/react-native-lookback.podspec
+++ b/react-native-lookback.podspec
@@ -13,4 +13,5 @@ s.source = { git: package.dig(:repository, :url) }
s.source_files = "ios/*"
s.platform = :ios, "8.0"
+ s.dependency "Lookback", "1.4.1"
end
|
Add Lookback 1.4.1 as a dependency to be installed by cocoapods
|
diff --git a/holiday_list.gemspec b/holiday_list.gemspec
index abc1234..def5678 100644
--- a/holiday_list.gemspec
+++ b/holiday_list.gemspec
@@ -27,4 +27,5 @@ spec.add_development_dependency "vcr"
spec.add_development_dependency "webmock", "~> 1.15.0"
spec.add_development_dependency "timecop"
+ spec.add_development_dependency "rubocop"
end
|
Add rubocop gem in development
|
diff --git a/app/services/update_item/movie.rb b/app/services/update_item/movie.rb
index abc1234..def5678 100644
--- a/app/services/update_item/movie.rb
+++ b/app/services/update_item/movie.rb
@@ -3,9 +3,9 @@
def update_item!
item.assign_attributes(updated_attributes)
- update_association!(tmdb_movie, :tmdb_id, Genre, "movie_genres", "genres") if tmdb_movie.genres.present?
- update_association!(tmdb_movie, :tmdb_id, ::Creator, "movie_actors", "actors") if tmdb_movie.actors.present?
- update_association!(tmdb_movie, :tmdb_id, ::Creator, "movie_directors", "directors") if tmdb_movie.directors.present?
+ update_genres! if tmdb_movie.genres.present?
+ update_actors! if tmdb_movie.actors.present?
+ update_directors! if tmdb_movie.directors.present?
item.save!
end
@@ -17,11 +17,23 @@ Immedialist::RottenTomatoes::Movie.find(imdb_id)
end
+ def imdb_id
+ tmdb_movie.imdb_id
+ end
+
def tmdb_movie
@tmdb_movie ||= Immedialist::TMDB::Movie.find(item.tmdb_id)
end
- def imdb_id
- tmdb_movie.imdb_id
+ def update_genres!
+ update_association!(tmdb_movie, :tmdb_id, Genre, "movie_genres", "genres")
+ end
+
+ def update_actors!
+ update_association!(tmdb_movie, :tmdb_id, ::Creator, "movie_actors", "actors")
+ end
+
+ def update_directors!
+ update_association!(tmdb_movie, :tmdb_id, ::Creator, "movie_directors", "directors")
end
end
|
Refactor UpdateItem::Movie: extract methods for readability
|
diff --git a/IRC/IRCPlugin.rb b/IRC/IRCPlugin.rb
index abc1234..def5678 100644
--- a/IRC/IRCPlugin.rb
+++ b/IRC/IRCPlugin.rb
@@ -5,6 +5,11 @@ # IRCPlugin is the superclass of all plugins
class IRCPlugin < IRCListener
+ # Returns the root dir of the plugin
+ def plugin_root
+ "IRC/plugins/#{name}"
+ end
+
# Returns the name of the plugin
def name
self.class.to_s
|
Add plugin_root method to plugin superclass
|
diff --git a/fastlane-plugin-wait_xcrun.gemspec b/fastlane-plugin-wait_xcrun.gemspec
index abc1234..def5678 100644
--- a/fastlane-plugin-wait_xcrun.gemspec
+++ b/fastlane-plugin-wait_xcrun.gemspec
@@ -7,10 +7,10 @@ spec.name = 'fastlane-plugin-wait_xcrun'
spec.version = Fastlane::WaitXcrun::VERSION
spec.author = %q{Maksym Grebenets}
- spec.email = %q{maksym.grebenets@cba.com.au}
+ spec.email = %q{mgrebenets@gmail.com}
spec.summary = %q{Wait for Xcode toolchain to come back online after switching Xcode versions.}
- # spec.homepage = "https://github.com/<GITHUB_USERNAME>/fastlane-plugin-wait_xcrun"
+ spec.homepage = "https://github.com/mgrebenets/fastlane-plugin-wait_xcrun"
spec.license = "MIT"
spec.files = Dir["lib/**/*"] + %w(README.md LICENSE)
|
Update email and github homepage
|
diff --git a/spec/integration/cookbook_spec.rb b/spec/integration/cookbook_spec.rb
index abc1234..def5678 100644
--- a/spec/integration/cookbook_spec.rb
+++ b/spec/integration/cookbook_spec.rb
@@ -11,15 +11,13 @@
Zlib::GzipReader.open(tarball.path) do |gzip|
Gem::Package::TarReader.new(gzip) do |tar|
- structure = tar.map(&:full_name)
+ structure = tar.map(&:full_name).sort
end
end
expect(structure).to eq(%w(
+ basic/CHANGELOG.md
basic/README.md
- basic/CHANGELOG.md
- basic/metadata.json
- basic/metadata.rb
basic/attributes/default.rb
basic/attributes/system.rb
basic/definitions/web_app.rb
@@ -27,6 +25,8 @@ basic/files/default/example.txt
basic/files/default/patch.txt
basic/libraries/magic.rb
+ basic/metadata.json
+ basic/metadata.rb
basic/providers/thing.rb
basic/recipes/default.rb
basic/recipes/system.rb
|
Sort tarball entries in tests
|
diff --git a/spec/unit/recipes/default_spec.rb b/spec/unit/recipes/default_spec.rb
index abc1234..def5678 100644
--- a/spec/unit/recipes/default_spec.rb
+++ b/spec/unit/recipes/default_spec.rb
@@ -20,6 +20,6 @@ end
it { expect(chef_run).not_to include_recipe('consul::install_binary') }
- it { expect(chef_run).to include_recipe('consul::install_binary') }
+ it { expect(chef_run).to include_recipe('consul::install_source') }
end
end
|
Fix copy and paste blunder on ChefSpec.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.