diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/WOWCheckbox.podspec b/WOWCheckbox.podspec
index abc1234..def5678 100644
--- a/WOWCheckbox.podspec
+++ b/WOWCheckbox.podspec
@@ -13,6 +13,7 @@ s.source = { :git => 'https://github.com/zhouhao27/WOWCheckbox.git', :tag => s.version.to_s }
s.ios.deployment_target = '8.0'
+ s.swift_version = '4.1'
s.source_files = 'WOWCheckbox/Classes/**/*'
end
|
Add s.swift_version = '4.0' in podspec
|
diff --git a/FlexibleImage.podspec b/FlexibleImage.podspec
index abc1234..def5678 100644
--- a/FlexibleImage.podspec
+++ b/FlexibleImage.podspec
@@ -8,7 +8,7 @@ s.authors = { 'Jungwon An' => 'kawoou@kawoou.kr' }
s.social_media_url = 'http://fb.com/kawoou'
s.source = { :git => 'https://github.com/Kawoou/FlexibleImage.git',
- :tag => s.version.to_s }
+ :tag => 'v' + s.version.to_s }
s.requires_arc = true
s.source_files = 'Sources/**/*.{swift,metal}'
|
Fix tag bug on podspec
|
diff --git a/Casks/bowery.rb b/Casks/bowery.rb
index abc1234..def5678 100644
--- a/Casks/bowery.rb
+++ b/Casks/bowery.rb
@@ -1,6 +1,6 @@ class Bowery < Cask
- version '3.2.7'
- sha256 'e473b9d3b056a23b79c5174e979f345ef1cb873bcadfd02360a46f7b015a394f'
+ version '3.2.9'
+ sha256 'fbcc62c54f24b75ade5b43037fea20d388c3a61aaf458d3295fc51975eb27c16'
url "http://desktop.bowery.io/#{version}_darwin_amd64.zip"
homepage 'http://bowery.io/'
|
Update Bowery.app to verision 3.2.9
|
diff --git a/Casks/poedit.rb b/Casks/poedit.rb
index abc1234..def5678 100644
--- a/Casks/poedit.rb
+++ b/Casks/poedit.rb
@@ -10,7 +10,7 @@ sha256 'e08b1a3ffc791b78ca849bf3fdbbd9dd7cbb8944032a5bdec642560ee6118c34'
url "http://poedit.net/dl/Poedit-#{version}.zip"
appcast 'https://poedit.net/updates/osx/appcast',
- :sha256 => '820f8d55035f0c57f2c57d7441abd7fdf96db1c1818697a188daecd53a98796e'
+ :sha256 => '21334ec300dff8fd749f1351f1a96880091bb58bc41d2a9de9179f8d42f5602d'
end
homepage 'http://www.poedit.net'
|
Update appcast's sha256 for Poedit.app
|
diff --git a/lib/pghero/methods/databases.rb b/lib/pghero/methods/databases.rb
index abc1234..def5678 100644
--- a/lib/pghero/methods/databases.rb
+++ b/lib/pghero/methods/databases.rb
@@ -20,7 +20,7 @@ end
def current_database=(database)
- raise "Database not found" unless databases[database]
+ raise "Database not found" unless databases[database.to_s]
Thread.current[:pghero_current_database] = database.to_s
database
end
|
Allow symbol to be used to specify database
|
diff --git a/lib/snapme/imagesnap_command.rb b/lib/snapme/imagesnap_command.rb
index abc1234..def5678 100644
--- a/lib/snapme/imagesnap_command.rb
+++ b/lib/snapme/imagesnap_command.rb
@@ -7,7 +7,7 @@ private
def command_name
- 'bin/imagesnap'
+ 'imagesnap'
end
end
end
|
Remove 'bin/' prefix from imagesnap command name
* It will not require this because it should be in PATH for the
executing user.
|
diff --git a/lib/tasks/link_governments.rake b/lib/tasks/link_governments.rake
index abc1234..def5678 100644
--- a/lib/tasks/link_governments.rake
+++ b/lib/tasks/link_governments.rake
@@ -0,0 +1,24 @@+namespace :governments do
+ task relink: :environment do
+ STDOUT.sync = true
+ Edition.where.not(state: %w[deleted superseded]).find_each do |edition|
+ presenter = PublishingApiPresenters.presenter_for(edition)
+ begin
+ links = presenter.links
+
+ if links[:government].present?
+ print "."
+
+ Services.publishing_api.patch_links(
+ presenter.content_id,
+ links: links.slice(:government),
+ bulk_publishing: true,
+ )
+ end
+ rescue StandardError => e
+ puts "\nFAIL #{e.class} (#{e.message}) for document: #{presenter.content_id}"
+ end
+ end
+ puts
+ end
+end
|
Create rake task to link editions to a government
|
diff --git a/lib/html/pipeline/syntax_highlight_filter.rb b/lib/html/pipeline/syntax_highlight_filter.rb
index abc1234..def5678 100644
--- a/lib/html/pipeline/syntax_highlight_filter.rb
+++ b/lib/html/pipeline/syntax_highlight_filter.rb
@@ -1,7 +1,7 @@ begin
require 'linguist'
rescue LoadError
- raise LoadError, "You need to install linguist before using the SyntaxHighlightFilter. See README.md for details"
+ raise LoadError, "You need to install 'github-linguist' before using the SyntaxHighlightFilter. See README.md for details"
end
module HTML
|
Improve to describe gem 'github-linguist'
The required gem is 'github-linguist' not 'linguist'.
|
diff --git a/lib/versatile_rjs/proxy/element_set_proxy.rb b/lib/versatile_rjs/proxy/element_set_proxy.rb
index abc1234..def5678 100644
--- a/lib/versatile_rjs/proxy/element_set_proxy.rb
+++ b/lib/versatile_rjs/proxy/element_set_proxy.rb
@@ -6,6 +6,8 @@ include Selectable
include FrameworkDependent
+ method_to_implement :each => "call the adequate JS statement equivalent to the block given to apply the process to the items contained."
+
def initialize(page, statement)
super
end
|
Add method implementation requision on :each.
|
diff --git a/spec/unit/listener_spec.rb b/spec/unit/listener_spec.rb
index abc1234..def5678 100644
--- a/spec/unit/listener_spec.rb
+++ b/spec/unit/listener_spec.rb
@@ -0,0 +1,13 @@+# frozen_string_literal: true
+
+require 'spec_helper'
+
+describe Que::Listener do
+ it "should return messages to the locker in bulk by type"
+
+ it "should pre-process new_job messages"
+
+ it "should be resilient to messages that aren't invalid JSON"
+
+ it "when unlistening should not leave any residual messages"
+end
|
Add some pending specs for the Listener class.
|
diff --git a/db/migrate/20130731020144_add_type_to_miniapp.rb b/db/migrate/20130731020144_add_type_to_miniapp.rb
index abc1234..def5678 100644
--- a/db/migrate/20130731020144_add_type_to_miniapp.rb
+++ b/db/migrate/20130731020144_add_type_to_miniapp.rb
@@ -1,7 +1,7 @@ class AddTypeToMiniapp < ActiveRecord::Migration
def change
- MiniApp.where(:name=>app.name).delete_all
+ MiniApp.where(:name=>"study").delete_all
mini_app = MiniappStudy::Question.new(:name=>"study", :order_number=>90)
mini_app.save!
|
Fix app not found error
|
diff --git a/RunKeeper-iOS.podspec b/RunKeeper-iOS.podspec
index abc1234..def5678 100644
--- a/RunKeeper-iOS.podspec
+++ b/RunKeeper-iOS.podspec
@@ -0,0 +1,28 @@+Pod::Spec.new do |s|
+ s.name = "RunKeeper-iOS"
+ s.version = "0.0.1"
+ s.summary = "An iOS RunKeeper API module."
+ s.description = <<-DESC
+ RunKeeper-iOS provides an Objective C wrapper class for accessing the [RunKeeper Health Graph API](http://developer.runkeeper.com/healthgraph) from iOS 4.0 or newer.
+
+ RunKeeper-iOS was developed for use in our iPhone fitness app "Running Intensity". It is meant to be general, but is built primarily for a Running app. The API is NOT fully supported, but more will be added based on our own needs or the requests of others.
+ DESC
+ s.homepage = "https://github.com/brierwood/RunKeeper-iOS"
+
+ s.license = 'BSD'
+
+ s.authors = { "Brierwood Design" => "info@brierwooddesign.com", "Reid van Melle" => "rvanmelle@gmail.com" }
+
+ s.source = { :git => "https://github.com/brierwood/RunKeeper-iOS.git", :commit => "5c124db44a82b54e4487632fcf55148001b9516d" }
+
+ s.platform = :ios, '5.0'
+
+ s.source_files = 'RunKeeper/**/*.{h,m}'
+
+ s.resources = "images/*.png"
+
+ s.requires_arc = true
+
+ s.dependency 'AFNetworking', '~> 1.3.0'
+ s.dependency 'NXOAuth2Client', '~> 1.2.0'
+end
|
Add Podspec with AFNetworking version updated
|
diff --git a/spec/support/dummy_view.rb b/spec/support/dummy_view.rb
index abc1234..def5678 100644
--- a/spec/support/dummy_view.rb
+++ b/spec/support/dummy_view.rb
@@ -3,7 +3,7 @@ class DummyView < ActionView::Base
module FakeRequest
class Request
- attr_accessor :path, :fullpath
+ attr_accessor :path, :fullpath, :protocol, :host_with_port
def get?
true
end
@@ -30,6 +30,10 @@ get "/post/:id" => "foo#post", :as => :post
get "/post/:title" => "foo#title"
get "/post/:id/comments" => "foo#comments"
+
+ namespace :blog do
+ get "/" => "foo#bar"
+ end
end
include routes.url_helpers
@@ -37,5 +41,7 @@ def set_path(path)
request.path = path
request.fullpath = path
+ request.protocol = 'http://'
+ request.host_with_port = 'www.example.com'
end
end
|
Add protocol and host for dummy request
|
diff --git a/app/controllers/spree/api/ams/users_controller.rb b/app/controllers/spree/api/ams/users_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/spree/api/ams/users_controller.rb
+++ b/app/controllers/spree/api/ams/users_controller.rb
@@ -12,9 +12,9 @@ @user.generate_spree_api_key! unless @user.spree_api_key
render json: {
- user_id: @user.id,
- user_email: @user.email,
- user_token: @user.spree_api_key
+ id: @user.id,
+ email: @user.email,
+ token: @user.spree_api_key
}
else
# Wrong Password
@@ -38,4 +38,4 @@ end
end
end
-end+end
|
Update Token Response for Simple Auth
|
diff --git a/TDRedux.swift.podspec b/TDRedux.swift.podspec
index abc1234..def5678 100644
--- a/TDRedux.swift.podspec
+++ b/TDRedux.swift.podspec
@@ -1,6 +1,6 @@ Pod::Spec.new do |s|
s.name = "TDRedux.swift"
- s.version = "1.4.2"
+ s.version = "1.4.3"
s.summary = "Yet another Redux written in Swift"
s.description = <<-DESC
|
v1.4.3: Fix doc for jazzy and CocoaPods
Things in `**` were missing if they are in `parameter` or a `returns`,
e.g.
```
A *Reducer* function
```
will be rendered as:
> A function
|
diff --git a/app/serializers/gobierto_plans/node_serializer.rb b/app/serializers/gobierto_plans/node_serializer.rb
index abc1234..def5678 100644
--- a/app/serializers/gobierto_plans/node_serializer.rb
+++ b/app/serializers/gobierto_plans/node_serializer.rb
@@ -5,7 +5,7 @@ include ::GobiertoCommon::Versionable
include ::GobiertoCommon::HasCustomFieldsAttributes
- attributes :id, :name, :category_id, :progress, :starts_at, :ends_at, :status_id, :published_version, :position, :external_id
+ attributes :id, :name, :category_id, :progress, :starts_at, :ends_at, :status_id, :position, :external_id
def category_id
object.categories.find_by(gplan_categories_nodes: { category_id: instance_options[:plan].categories })&.id
|
Exclude published version from plans project serialized attributes
|
diff --git a/actionpack/test/controller/new_base/content_negotiation_test.rb b/actionpack/test/controller/new_base/content_negotiation_test.rb
index abc1234..def5678 100644
--- a/actionpack/test/controller/new_base/content_negotiation_test.rb
+++ b/actionpack/test/controller/new_base/content_negotiation_test.rb
@@ -25,7 +25,7 @@ assert_body "Hello world text/html!"
end
- test "A js or */* Accept header on xhr will return HTML" do
+ test "A js or */* Accept header on xhr will return JavaScript" do
get "/content_negotiation/basic/hello", headers: { "HTTP_ACCEPT" => "text/javascript, */*" }, xhr: true
assert_body "Hello world text/javascript!"
end
|
Fix a ContentNegotiation test description
|
diff --git a/brew-pip.rb b/brew-pip.rb
index abc1234..def5678 100644
--- a/brew-pip.rb
+++ b/brew-pip.rb
@@ -9,4 +9,11 @@ def install
bin.install 'bin/brew-pip'
end
+
+ def caveats; <<-EOS.undent
+ pip needs to be installed before brew-pip will work:
+
+ #{HOMEBREW_PREFIX+"share/python"}/easy_install pip
+ EOS
+ end
end
|
Add caveats explaining pip needs to be installed
Homebrew has 'depends_on "pip" => :python' but it works more like an
error message and bails. I want this to pop up after brew-pip gets
installed.
|
diff --git a/lib/email/mboxrd/message.rb b/lib/email/mboxrd/message.rb
index abc1234..def5678 100644
--- a/lib/email/mboxrd/message.rb
+++ b/lib/email/mboxrd/message.rb
@@ -42,10 +42,19 @@ def mboxrd_body
@mboxrd_body ||=
begin
- @mboxrd_body = supplied_body.gsub(/\n(>*From)/, "\n>\\1")
+ @mboxrd_body = add_extra_quote(supplied_body)
@mboxrd_body += "\n" if !@mboxrd_body.end_with?("\n")
@mboxrd_body
end
+ end
+
+ def add_extra_quote(body)
+ # The mboxrd format requires that lines starting with 'From'
+ # be prefixed with a '>' so that any remaining lines which start with
+ # 'From ' can be taken as the beginning of messages.
+ # http://www.digitalpreservation.gov/formats/fdd/fdd000385.shtml
+ # Here we add an extra '>' before any "From" or ">From".
+ body.gsub(/\n(>*From)/, "\n>\\1")
end
def asctime
|
Add comment about From quoting
|
diff --git a/lib/geocoder/lookups/ovi.rb b/lib/geocoder/lookups/ovi.rb
index abc1234..def5678 100644
--- a/lib/geocoder/lookups/ovi.rb
+++ b/lib/geocoder/lookups/ovi.rb
@@ -42,7 +42,7 @@ )
else
super.merge(options).merge(
- :searchtext=>query.sanitized_text,
+ :searchtext=>query.sanitized_text
)
end
end
|
Fix Ruby 1.8 syntax error.
|
diff --git a/lib/meeting/carbon_model.rb b/lib/meeting/carbon_model.rb
index abc1234..def5678 100644
--- a/lib/meeting/carbon_model.rb
+++ b/lib/meeting/carbon_model.rb
@@ -9,7 +9,7 @@ base.decide :emission, :with => :characteristics do
committee :emission do # returns kg CO2e
quorum 'from default' do |characteristics|
- 100
+ 100.0
end
quorum 'default' do
|
Use float for emission values
|
diff --git a/lib/realtime-validations.rb b/lib/realtime-validations.rb
index abc1234..def5678 100644
--- a/lib/realtime-validations.rb
+++ b/lib/realtime-validations.rb
@@ -1,6 +1,13 @@ module RealtimeValidations
class RealtimeValidations < Rails::Engine
+
+ initializer 'realtime_validations.init' do |app|
+ ActiveSupport.on_load(:action_controller) do
+ include RealtimeValidations::ValidationsController
+ end
+ end
+
end
end
|
Check if this loads applicationcontroller
|
diff --git a/lib/tasks/gitlab/setup.rake b/lib/tasks/gitlab/setup.rake
index abc1234..def5678 100644
--- a/lib/tasks/gitlab/setup.rake
+++ b/lib/tasks/gitlab/setup.rake
@@ -16,7 +16,7 @@
Rake::Task["db:setup"].invoke
- config = YAML.load(ERB.new(File.read(File.join(Rails.root, "config","database.yml"))).result)
+ config = YAML.load_file(File.join(Rails.root,'config','database.yml'))[Rails.env]
success = case config["adapter"]
when /^mysql/ then
Rake::Task["add_limits_mysql"].invoke
|
Revert "Allow to parse heroku-generated database.yml config file."
This reverts commit 8a56e7db485d3109f3b2f02896c1165c33ffa8fb.
Because it actually breaks db setup for mysql
|
diff --git a/lib/tasks/peoplefinder.rake b/lib/tasks/peoplefinder.rake
index abc1234..def5678 100644
--- a/lib/tasks/peoplefinder.rake
+++ b/lib/tasks/peoplefinder.rake
@@ -29,10 +29,16 @@
if STDIN.gets.chomp == 'Y'
recipients.each do |recipient|
- if ReminderMailer.inadequate_profile(recipient).deliver
+
+ if EmailAddress.new(recipient.email).valid_address?
+ ReminderMailer.inadequate_profile(recipient).deliver
puts "Email sent to: #{ recipient.email }"
+
+ else
+ puts "Email *not* sent to: #{ recipient.email }"
end
end
+
end
end
end
|
Handle invalid email addresses in reminder task
|
diff --git a/gems/capistrano-support/testapp/config/deploy.rb b/gems/capistrano-support/testapp/config/deploy.rb
index abc1234..def5678 100644
--- a/gems/capistrano-support/testapp/config/deploy.rb
+++ b/gems/capistrano-support/testapp/config/deploy.rb
@@ -1,4 +1,5 @@ require 'torquebox-capistrano-support'
+require 'bundler/capistrano'
set :application, "testapp"
set :repository, "."
|
TORQUE-589: Add bundler recipes to test. Works.
|
diff --git a/lucene_query_parser.gemspec b/lucene_query_parser.gemspec
index abc1234..def5678 100644
--- a/lucene_query_parser.gemspec
+++ b/lucene_query_parser.gemspec
@@ -20,5 +20,5 @@
s.add_runtime_dependency "parslet"
s.add_runtime_dependency "rainbow"
- s.add_development_dependency "rspec", "~> 2.5.0"
+ s.add_development_dependency "rspec", "~> 3.2.0"
end
|
Update rspec dependency to match parslet requirement
|
diff --git a/config/initializers/kubernetes_database_config.rb b/config/initializers/kubernetes_database_config.rb
index abc1234..def5678 100644
--- a/config/initializers/kubernetes_database_config.rb
+++ b/config/initializers/kubernetes_database_config.rb
@@ -1,5 +1,5 @@ if Rails.env.production? && Rails.configuration.kubernetes_deployment
- establish_connection(
+ ActiveRecord::Base.establish_connection(
url: ENV['DATABASE_URL'],
database: 'pvb2_production'
)
|
FIX - establish db connection
|
diff --git a/features/step_definitions/hello_world_steps.rb b/features/step_definitions/hello_world_steps.rb
index abc1234..def5678 100644
--- a/features/step_definitions/hello_world_steps.rb
+++ b/features/step_definitions/hello_world_steps.rb
@@ -2,7 +2,12 @@ # Step definitions specific to the feature file 'example.feature' go here.
##
Given(/^I am on the Home screen$/) do
+ @page = launch_to_home_page
end
-Then(/^I should see "(.*?)"$/) do
+Then(/^I should see "(.*?)"$/) do |expected_text|
+ actual_text = @page.hello_world_text
+ unless actual_text == expected_text
+ raise "Saw #{actual_text} instead of #{expected_text}"
+ end
end
|
Add ruby methods to steps
|
diff --git a/app/app_delegate.rb b/app/app_delegate.rb
index abc1234..def5678 100644
--- a/app/app_delegate.rb
+++ b/app/app_delegate.rb
@@ -11,6 +11,9 @@ self.doing_part_2 = false
self.van_hoorden_sounds = NSFileManager.defaultManager.contentsOfDirectoryAtPath(NSBundle.mainBundle.resourcePath, error:nil).select {|file| file =~ /vn/}
self.van_hoorden_sounds.map! {|file| Tone.new(file)}
+ van_hoorden_dupe = self.van_hoorden_sounds.dup
+ self.van_hoorden_sounds = self.van_hoorden_sounds + van_hoorden_dupe
+ NSLog "#{self.van_hoorden_sounds.size}"
self.miller_and_heise_sounds = NSFileManager.defaultManager.contentsOfDirectoryAtPath(NSBundle.mainBundle.resourcePath, error:nil).select {|file| file =~ /mh/}
self.miller_and_heise_sounds.map! {|file| Tone.new(file)}
# NSLog "#{self.van_hoorden_sounds.size} #{self.miller_and_heise_sounds.size}"
|
Duplicate van noorden sounds before test start
|
diff --git a/roles/osx-nsm.rb b/roles/osx-nsm.rb
index abc1234..def5678 100644
--- a/roles/osx-nsm.rb
+++ b/roles/osx-nsm.rb
@@ -17,7 +17,7 @@ "recipe[graz_genesis::mac]",
"recipe[simulation_curriculum_starry_night_pro::mac]",
"recipe[synergy_kaleidagraph::mac]",
- "recipe[wolfram_mathematica::mac]",
+ #{}"recipe[wolfram_mathematica::mac]",
"recipe[perkinelmer_chemdraw_pro::mac]"
# Set SuperCollider attribute for version determination
|
Disable Mathematic until we can fix it
|
diff --git a/Formula/ack.rb b/Formula/ack.rb
index abc1234..def5678 100644
--- a/Formula/ack.rb
+++ b/Formula/ack.rb
@@ -2,7 +2,6 @@
class Ack < Formula
url "https://github.com/petdance/ack/tarball/1.93_02"
- version '1.93_02'
md5 'b468ce41a949fd957dc9b6aee74782e9'
homepage 'http://betterthangrep.com/'
|
Allow underscore in github version numbers.
|
diff --git a/Tabman.podspec b/Tabman.podspec
index abc1234..def5678 100644
--- a/Tabman.podspec
+++ b/Tabman.podspec
@@ -3,6 +3,7 @@ s.name = "Tabman"
s.platform = :ios, "9.0"
s.requires_arc = true
+ s.swift_version = "4.0"
s.version = "1.4.0"
s.summary = "A powerful paging view controller with indicator bar."
|
Add swift version to podspec
|
diff --git a/lib/flipper/middleware/local_cache.rb b/lib/flipper/middleware/local_cache.rb
index abc1234..def5678 100644
--- a/lib/flipper/middleware/local_cache.rb
+++ b/lib/flipper/middleware/local_cache.rb
@@ -1,24 +1,8 @@+require 'rack/body_proxy'
+
module Flipper
module Middleware
class LocalCache
- class Body
- def initialize(target, flipper, original)
- @target = target
- @flipper = flipper
- @original = original
- end
-
- def each(&block)
- @target.each(&block)
- end
-
- def close
- @target.close if @target.respond_to?(:close)
- ensure
- @flipper.adapter.use_local_cache = @original
- end
- end
-
def initialize(app, flipper)
@app = app
@flipper = flipper
@@ -29,7 +13,12 @@ @flipper.adapter.use_local_cache = true
status, headers, body = @app.call(env)
- [status, headers, Body.new(body, @flipper, original)]
+
+ body_proxy = Rack::BodyProxy.new(body) {
+ @flipper.adapter.use_local_cache = original
+ }
+
+ [status, headers, body_proxy]
end
end
end
|
Use rack body proxy instead of custom body proxy.
|
diff --git a/app/jobs/log_job.rb b/app/jobs/log_job.rb
index abc1234..def5678 100644
--- a/app/jobs/log_job.rb
+++ b/app/jobs/log_job.rb
@@ -9,11 +9,10 @@ initial_location = "log/#{log_file}.log"
final_location = "log/old_#{log_file}.log"
- FileUtils.mv(initial_location, final_location) \
- if File.exist? initial_location
+ next unless File.exist? initial_location
- FileUtils.touch initial_location
- FileUtils.chmod 777, initial_location
+ FileUtils.cp(initial_location, final_location)
+ File.truncate(initial_location, 0)
end
end
|
Make it so log job never deletes a file
|
diff --git a/Casks/smlnj.rb b/Casks/smlnj.rb
index abc1234..def5678 100644
--- a/Casks/smlnj.rb
+++ b/Casks/smlnj.rb
@@ -0,0 +1,10 @@+class Smlnj < Cask
+ version '110.77'
+ sha256 '77265ce1bdbca3e9c9b3053195503bf2bffafbba196596679fb64d9ceb4e25ee'
+
+ url "http://smlnj.cs.uchicago.edu/dist/working/#{version}/smlnj-x86-#{version}.pkg"
+ homepage 'http://www.smlnj.org/'
+
+ pkg "smlnj-x86-#{version}.pkg"
+ uninstall :pkgutil => 'org.smlnj.x86.pkg'
+end
|
Add Standard ML New Jersey, version 110.77
|
diff --git a/lib/nasdaq_scraper/cli/application.rb b/lib/nasdaq_scraper/cli/application.rb
index abc1234..def5678 100644
--- a/lib/nasdaq_scraper/cli/application.rb
+++ b/lib/nasdaq_scraper/cli/application.rb
@@ -8,6 +8,10 @@ desc 'scrape [URL]', 'Scrape the [URL] for NASDAQ index'
def scrape(url)
data = NasdaqScraper::scrape_url(url)
+ if(!data)
+ puts "An error occured."
+ return
+ end
puts data.to_str
end
|
Check for valid result in cli wrapper
|
diff --git a/lib/omniauth/strategies/spiceworks.rb b/lib/omniauth/strategies/spiceworks.rb
index abc1234..def5678 100644
--- a/lib/omniauth/strategies/spiceworks.rb
+++ b/lib/omniauth/strategies/spiceworks.rb
@@ -2,18 +2,18 @@ module OmniAuth
module Strategies
class Spiceworks < OmniAuth::Strategies::OAuth2
- DEFAULT_SCOPE = 'default'
+ DEFAULT_SCOPE = 'public'
option :name, 'spiceworks'
option :authorize_options, [:scope]
option :client_options, {
site: 'https://accounts.spiceworks.com'
}
- uid{raw_info['spiceworks_id']}
+ uid { raw_info['spiceworks_id'] }
info do
{
first_name: raw_info['first_name'],
last_name: raw_info['last_name'],
- name: raw_info['first_name'],
+ name: raw_info['first_name'].present? ? raw_info['first_name'] : 'Anonymous',
email: raw_info['email']
}
end
@@ -24,20 +24,16 @@ end
def authorize_params
- puts "***SESSION #{@env}"
- puts "***SESSION #{session}"
- puts "***SUPER #{super}"
super.tap do |params|
- puts "***PARAMS #{params}"
params[:scope] ||= DEFAULT_SCOPE
end
end
private
+
def raw_info
@raw_info ||= access_token.get('http://www.account.spiceworks.com/api/public/v1/users/user').parsed['user'] || {}
end
-
end
end
end
|
Change default scope to be public.
|
diff --git a/lib/racing/sprockets/fast_manifest.rb b/lib/racing/sprockets/fast_manifest.rb
index abc1234..def5678 100644
--- a/lib/racing/sprockets/fast_manifest.rb
+++ b/lib/racing/sprockets/fast_manifest.rb
@@ -12,7 +12,6 @@ end
def compile(*args)
- pool = Thread.pool(10)
unless environment
raise Error, "manifest requires environment for compilation"
end
@@ -20,8 +19,10 @@ paths = environment.each_logical_path(*args).to_a +
args.flatten.select { |fn| Pathname.new(fn).absolute? if fn.is_a?(String)}
+ thread_pool = Thread.pool(10)
+
paths.each do |path|
- pool.process do
+ thread_pool.process do
if asset = find_asset(path)
files[asset.digest_path] = {
'logical_path' => asset.logical_path,
@@ -43,7 +44,8 @@ end
end
end
- pool.shutdown
+ thread_pool.wait_done
+
save
paths
end
|
Use the right method to wait until we're done.
|
diff --git a/app/models/movie.rb b/app/models/movie.rb
index abc1234..def5678 100644
--- a/app/models/movie.rb
+++ b/app/models/movie.rb
@@ -1,3 +1,7 @@ class Movie < ActiveRecord::Base
+ validates :title, { length: 1..50 }
+ validates :format, { presence: true }
+ validates :length, numericality: { only_integer: true, less_than: 500 }
+ validates :release_year, numericality: { only_integer: true, greater_than: 1800, less_than: 2100 }
belongs_to :format
end
|
Add some validations to Movie model (title, format, length, and release_year)
|
diff --git a/Differ.podspec b/Differ.podspec
index abc1234..def5678 100644
--- a/Differ.podspec
+++ b/Differ.podspec
@@ -21,6 +21,8 @@
s.platforms = { :ios => "8.0", :osx => "10.10", :tvos => "9.0", :watchos => "3.0" }
s.pod_target_xcconfig = { 'SWIFT_VERSION' => '4.1' }
- s.osx.exclude_files = "Sources/Differ/Diff+UIKit.swift"
- s.watchos.exclude_files = "Sources/Differ/Diff+UIKit.swift"
+ s.ios.exclude_files = ["Sources/Differ/Diff+AppKit.swift"]
+ s.osx.exclude_files = ["Sources/Differ/Diff+UIKit.swift"]
+ s.tvos.exclude_files = ["Sources/Differ/Diff+AppKit.swift"]
+ s.watchos.exclude_files = ["Sources/Differ/Diff+UIKit.swift", "Sources/Differ/Diff+AppKit.swift"
end
|
Update podspec to exclude new AppKit classes
|
diff --git a/app/controllers/api/v1/performances_controller.rb b/app/controllers/api/v1/performances_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/api/v1/performances_controller.rb
+++ b/app/controllers/api/v1/performances_controller.rb
@@ -16,8 +16,8 @@ .includes(
{ appearances: [:instrument, :participant] },
:pieces,
- contest_category: { contest: :host },
- predecessor: { contest_category: { contest: :host } }
+ { contest_category: { contest: :host } },
+ :predecessor # TODO: Find out why including associations here leads to wrong host data in response
)
end
end
|
Fix strange bug where performances had wrong associated host
For some reason, including the predecessor's associations here would
lead to many performances having the wrong predecessor host name and
country.
|
diff --git a/github_downloads.gemspec b/github_downloads.gemspec
index abc1234..def5678 100644
--- a/github_downloads.gemspec
+++ b/github_downloads.gemspec
@@ -6,8 +6,8 @@ Gem::Specification.new do |s|
s.name = "github_downloads"
s.version = GithubDownloads::VERSION
- s.authors = ["Clemens Müller"]
- s.email = ["cmueller.418@gmail.com"]
+ s.authors = ["Clemens Müller", "Peter Wagenet"]
+ s.email = ["cmueller.418@gmail.com", "peter.wagenet@gmail.com"]
s.homepage = "https://github.com/pangratz/github_downloads"
s.summary = "Upload files to GitHub Downloads"
s.description = "Library to upload files to GitHub Downloads section of a specific repository"
|
Add Peter Wagenet to authors
|
diff --git a/test/controllers/backend/activities_controller_test.rb b/test/controllers/backend/activities_controller_test.rb
index abc1234..def5678 100644
--- a/test/controllers/backend/activities_controller_test.rb
+++ b/test/controllers/backend/activities_controller_test.rb
@@ -2,6 +2,21 @@
module Backend
class ActivitiesControllerTest < ActionController::TestCase
- test_restfully_all_actions family: { mode: :index, name: :mussel_farming, format: :json }
+ test_restfully_all_actions family: { mode: :index, name: :mussel_farming, format: :json }, except: :show
+
+ test 'show action' do
+ get :show, {:id=>"NaID", :redirect=>root_url, :locale=>@locale}
+ assert_redirected_to root_url
+ Activity.limit(5).find_each do |record|
+ get :show, {:id=>record.id, :locale=>@locale}
+ if record.vegetal_crops?
+ assert_redirected_to backend_vegetal_activity_url(record)
+ else
+ assert_response :success
+ assert_not_nil assigns(:activity)
+ end
+ end
+ end
+
end
end
|
Update activities controller test show
|
diff --git a/spec/message_filter_spec.rb b/spec/message_filter_spec.rb
index abc1234..def5678 100644
--- a/spec/message_filter_spec.rb
+++ b/spec/message_filter_spec.rb
@@ -10,4 +10,6 @@ describe MessageFilter, 'with argument "foo","bar"' do
subject { MessageFilter.new('foo', 'bar') }
it { is_expected.to be_detect('hello from bar') }
+ it { is_expected.to be_detect('hello from foo') }
+ it { is_expected.not_to be_detect('hello, world!') }
end
|
Add specs for variable length argument
|
diff --git a/spec/models/profile_spec.rb b/spec/models/profile_spec.rb
index abc1234..def5678 100644
--- a/spec/models/profile_spec.rb
+++ b/spec/models/profile_spec.rb
@@ -0,0 +1,15 @@+require 'spec_helper'
+
+describe Profile do
+ it 'delegate equality notions to user' do
+ user1 = User.new
+ user2 = User.new
+ profile1 = Profile.new user1
+ profile2 = Profile.new user2
+ profile3_user1 = Profile.new user1
+
+ expect(profile1).to eq profile1
+ expect(profile1).to eq profile3_user1
+ expect(profile1).to_not eq profile2
+ end
+end
|
Add profile spec as is from branch `user-merge-tool`
|
diff --git a/app/models/attachment.rb b/app/models/attachment.rb
index abc1234..def5678 100644
--- a/app/models/attachment.rb
+++ b/app/models/attachment.rb
@@ -31,7 +31,6 @@ end
def upload_file
- raise ApiClientNotPresent unless Services.attachment_api
begin
if file_id.nil?
response = Services.attachment_api.create_asset(file: @uploaded_file)
@@ -52,6 +51,4 @@ extname = File.extname(file_url).delete(".")
"application/#{extname}"
end
-
- class ::ApiClientNotPresent < StandardError; end
end
|
Remove unnecessary guard condition and exception
I can't see how `Services.attachment_api` would ever not return
something and so I think this guard condition is unnecessary.
What's more the raising of a `ApiClientNotPresent` exception is not
covered in the tests and this exception is never explicitly handled.
If it turns out that `Services.attachment_api` does return `nil` for
some reason, we won't be any worse off - we'll just see a
`NoMethodError` instead of the custom exception.
|
diff --git a/spec/unit/exposures_spec.rb b/spec/unit/exposures_spec.rb
index abc1234..def5678 100644
--- a/spec/unit/exposures_spec.rb
+++ b/spec/unit/exposures_spec.rb
@@ -0,0 +1,63 @@+RSpec.describe Dry::View::Exposures do
+ subject(:exposures) { described_class.new }
+
+ describe "#exposures" do
+ it "is empty by defalut" do
+ expect(exposures.exposures).to be_empty
+ end
+ end
+
+ describe "#add" do
+ it "creates and adds an exposure" do
+ proc = -> input { "hi" }
+ exposures.add :hello, proc
+
+ expect(exposures.exposures[:hello].name).to eq :hello
+ expect(exposures.exposures[:hello].proc).to eq proc
+ end
+ end
+
+ describe "#bind" do
+ subject(:bound_exposures) { exposures.bind(object) }
+
+ let(:object) do
+ Class.new do
+ def hello(input)
+ "hi"
+ end
+ end.new
+ end
+
+ before do
+ exposures.add(:hello)
+ end
+
+ it "binds each of the exposures" do
+ expect(bound_exposures.exposures[:hello].proc).to eq object.method(:hello)
+ end
+
+ it "returns a new copy of the exposures" do
+ expect(exposures.exposures).not_to eql(bound_exposures.exposures)
+ end
+ end
+
+ describe "#locals" do
+ before do
+ exposures.add(:greeting, -> input { input.fetch(:greeting).upcase })
+ exposures.add(:farewell, -> greeting { "#{greeting} and goodbye" })
+ end
+
+ subject(:locals) { exposures.locals(greeting: "hello") }
+
+ it "returns the values from the exposures' procs" do
+ expect(locals).to eq(greeting: "HELLO", farewell: "HELLO and goodbye")
+ end
+
+ it "does not return any values from private exposures" do
+ exposures.add(:hidden, -> input { "shh" }, to_view: false)
+
+ expect(locals).to include(:greeting, :farewell)
+ expect(locals).not_to include(:hidden)
+ end
+ end
+end
|
Add unit tests for Exposures
|
diff --git a/ast/document.rb b/ast/document.rb
index abc1234..def5678 100644
--- a/ast/document.rb
+++ b/ast/document.rb
@@ -8,6 +8,7 @@ \usepackage{cancel}
\usepackage{enumerate}
\usepackage{hyperref}
+\usepackage{titling}
\DeclareGraphicsExtensions{.pdf,.png,.jpg}
@@ -16,7 +17,8 @@ \let\Im\relax
\DeclareMathOperator{\Im}{\operatorname{Im}}
-\setlength\parindent{0pt}'''
+\setlength\parindent{0pt}
+\setlength{\droptitle}{-7em}'''
def initialize(title, blocks)
@title = title
|
Move title up a bit
|
diff --git a/lesson14/you_look_wonderful_tonight.rb b/lesson14/you_look_wonderful_tonight.rb
index abc1234..def5678 100644
--- a/lesson14/you_look_wonderful_tonight.rb
+++ b/lesson14/you_look_wonderful_tonight.rb
@@ -0,0 +1,10 @@+# Lesson 14 - 'Slash' chords and Bass runs
+# You Look Wonderful Tonight - Eric Clapton
+require "#{Dir.home}/ruby/pianoforall/lesson14/slash_split_chord"
+use_synth :piano
+BEAT = 0.55
+
+slash_split_chord(:G4, reps: 3, beat: BEAT)
+slash_split_chord(:D4, bass_note: :Fs3, reps: 3, beat: BEAT)
+slash_split_chord(:C4, bass_note: :E3, reps: 3, beat: BEAT)
+slash_split_chord(:D4, reps: 3, beat: BEAT)
|
Add 'You Look Wonderful Tonight'
|
diff --git a/lib/github_api/response/raise_error.rb b/lib/github_api/response/raise_error.rb
index abc1234..def5678 100644
--- a/lib/github_api/response/raise_error.rb
+++ b/lib/github_api/response/raise_error.rb
@@ -16,6 +16,9 @@ raise Github::Forbidden.new(response_message(env), env[:response_headers])
when 404
raise Github::ResourceNotFound.new(response_message(env), env[:response_headers])
+
+ when 422
+ raise Github::UnprocessableEntitty.new(response_message(env), env[:response_headers])
when 500
raise Github::InternalServerError.new(response_message(env), env[:response_headers])
when 503
|
Raise custom 422 type error when failed parsing json.
|
diff --git a/lib/miq_automation_engine/service_models/miq_ae_service_service_ansible_tower.rb b/lib/miq_automation_engine/service_models/miq_ae_service_service_ansible_tower.rb
index abc1234..def5678 100644
--- a/lib/miq_automation_engine/service_models/miq_ae_service_service_ansible_tower.rb
+++ b/lib/miq_automation_engine/service_models/miq_ae_service_service_ansible_tower.rb
@@ -5,5 +5,7 @@
expose :launch_job
expose :job
+ expose :job_options
+ expose :job_options=
end
end
|
Enhance AnsibleTower Job to process job options
Extract common code to OrchestrationStackOptionsMixin to be shared by OrchestrationStack and AnsibleTower Job
(transferred from ManageIQ/manageiq@9030ea98a5b23e0c06fb497283336402bb6a4f6e)
|
diff --git a/test/fixtures/cookbooks/selenium_test/recipes/package.rb b/test/fixtures/cookbooks/selenium_test/recipes/package.rb
index abc1234..def5678 100644
--- a/test/fixtures/cookbooks/selenium_test/recipes/package.rb
+++ b/test/fixtures/cookbooks/selenium_test/recipes/package.rb
@@ -6,7 +6,7 @@ action :nothing
end.run_action(:install)
end
-when 'rhel'
+when 'rhel', 'fedora'
%w(gcc libffi-devel make).each do |pkg|
package pkg
end
|
Add dev libs for fedora
|
diff --git a/Casks/phpstorm-eap.rb b/Casks/phpstorm-eap.rb
index abc1234..def5678 100644
--- a/Casks/phpstorm-eap.rb
+++ b/Casks/phpstorm-eap.rb
@@ -1,7 +1,7 @@ class PhpstormEap < Cask
- url 'http://download.jetbrains.com/webide/PhpStorm-EAP-138.940.dmg'
+ url 'http://download.jetbrains.com/webide/PhpStorm-EAP-138.1161.dmg'
homepage 'http://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Early+Access+Program'
- version '138.940'
- sha256 'd12edcd2e732b74853f1832e8f994a47670bccaed804f0aabdcac1f35ffc6cc3'
+ version '138.1161'
+ sha256 '81d8ff642965a00b59b09924363a6a376ca705a7a09f42de6541bcd8739b413c'
link 'PhpStorm EAP.app'
end
|
Update PHPStorm EAP to 138.1161
|
diff --git a/spec/cli_spec.rb b/spec/cli_spec.rb
index abc1234..def5678 100644
--- a/spec/cli_spec.rb
+++ b/spec/cli_spec.rb
@@ -24,7 +24,7 @@
expect do
cli.investigate("#{File.dirname(__FILE__)}/data/cookbook_no_deps")
- end.to exit_with_code(204)
+ end.to exit_with_code(STATUS_TO_RETURN_CODES[:'warning-nodependencies'])
end
it "raises an error for missing configuration" do
@@ -32,7 +32,7 @@
expect do
cli.investigate
- end.to exit_with_code(110)
+ end.to exit_with_code(STATUS_TO_RETURN_CODES[:'error-config'])
end
it "raises an error for missing cookbook" do
@@ -40,7 +40,7 @@
expect do
cli.investigate
- end.to exit_with_code(111)
+ end.to exit_with_code(STATUS_TO_RETURN_CODES[:'error-notacookbook'])
end
end
end
|
Use STATUS_TO_RETURN_CODES for more readable specs
|
diff --git a/app/controllers/proxy_controller.rb b/app/controllers/proxy_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/proxy_controller.rb
+++ b/app/controllers/proxy_controller.rb
@@ -17,12 +17,21 @@
# Whitelist
if !path.start_with?("https://maps.googleapis.com/maps/api")
+ Rails.logger.warn{"Proxy path not white-listed: #{path}"}
return render(
json: { message: "Not found" },
status: 404,
)
end
+ Rails.logger.debug{"Proxying: #{path}"}
+
+ p = params.to_unsafe_hash.dup.except(:controller, :action, :path)
+ if p.size > 0
+ path = "#{path}?#{p.to_query}"
+ Rails.logger.debug{"Updating path: #{path}"}
+ end
+
reverse_proxy path, path: ""
end
end
|
Add query parameters to proxy
|
diff --git a/simple_xlsx_reader.gemspec b/simple_xlsx_reader.gemspec
index abc1234..def5678 100644
--- a/simple_xlsx_reader.gemspec
+++ b/simple_xlsx_reader.gemspec
@@ -7,7 +7,7 @@ gem.name = "simple_xlsx_reader"
gem.version = SimpleXlsxReader::VERSION
gem.authors = ["Woody Peterson"]
- gem.email = ["woody@sigby.com"]
+ gem.email = ["woody.peterson@gmail.com"]
gem.description = %q{Read xlsx data the Ruby way}
gem.summary = %q{Read xlsx data the Ruby way}
gem.homepage = ""
|
Correct author email address in gemspec
|
diff --git a/lib/rubocop/cop/style/case_equality.rb b/lib/rubocop/cop/style/case_equality.rb
index abc1234..def5678 100644
--- a/lib/rubocop/cop/style/case_equality.rb
+++ b/lib/rubocop/cop/style/case_equality.rb
@@ -7,10 +7,10 @@ class CaseEquality < Cop
MSG = 'Avoid the use of the case equality operator `===`.'.freeze
+ def_node_matcher :case_equality?, '(send _ :=== _)'
+
def on_send(node)
- _receiver, method_name, *_args = *node
-
- add_offense(node, :selector) if method_name == :===
+ case_equality?(node) { add_offense(node, :selector) }
end
end
end
|
Modify Style/CaseEquality to use NodePattern
|
diff --git a/Casks/front.rb b/Casks/front.rb
index abc1234..def5678 100644
--- a/Casks/front.rb
+++ b/Casks/front.rb
@@ -2,7 +2,7 @@ version :latest
sha256 :no_check
- url 'http://dl.frontapp.com/front-latest.zip'
+ url 'https://dl.frontapp.com/osx/front.dmg'
name 'Front'
homepage 'https://frontapp.com/'
license :gratis
|
Update Front.app with new download URL.
|
diff --git a/Casks/sonos.rb b/Casks/sonos.rb
index abc1234..def5678 100644
--- a/Casks/sonos.rb
+++ b/Casks/sonos.rb
@@ -1,7 +1,7 @@ class Sonos < Cask
- url 'http://update.sonos.com/software/mac/mdcr/SonosDesktopController42.dmg'
+ url 'http://update.sonos.com/software/mac/mdcr/SonosDesktopController43.dmg'
homepage 'http://www.sonos.com/'
- version '4.2'
- sha256 '91c4d7568e34c74406efdd7ed9678a83cded4e61b61fb657242fe53fc492bc9d'
+ version '4.3'
+ sha256 '4e8027da6efa047fefd39b234f9917503b0bd994093775da6f08ce9cf6faef4a'
link 'Sonos.app'
end
|
Update Sonos Controller from version 4.2 to 4.3
|
diff --git a/boombox.gemspec b/boombox.gemspec
index abc1234..def5678 100644
--- a/boombox.gemspec
+++ b/boombox.gemspec
@@ -1,4 +1,5 @@ # coding: utf-8
+
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "boombox/version"
@@ -7,30 +8,20 @@ spec.name = "boombox"
spec.version = Boombox::VERSION
spec.authors = ["Rob Hesketh"]
- spec.email = ["rhesketh.uk@gmail.com"]
+ spec.email = ["contact@robhesketh.com"]
- spec.summary = %q{TODO: Write a short summary, because Rubygems requires one.}
- spec.description = %q{TODO: Write a longer description or delete this line.}
- spec.homepage = "TODO: Put your gem's website or public repo URL here."
- spec.license = "MIT"
-
- # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
- # to allow pushing to a single host or delete this section to allow pushing to any host.
- if spec.respond_to?(:metadata)
- spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
- else
- raise "RubyGems 2.0 or newer is required to protect against " \
- "public gem pushes."
- end
+ spec.summary = "An incredibly tiny Shoutcast server that can be embedded into Ruby applications."
+ spec.homepage = "http://github.com/RHesketh/boombox"
+ spec.license = "Unlicense"
spec.files = `git ls-files -z`.split("\x0").reject do |f|
- f.match(%r{^(test|spec|features)/})
+ f.match(%r{^(test)/})
end
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]
- spec.add_development_dependency "bundler", "~> 1.15"
spec.add_development_dependency "rake", "~> 10.0"
spec.add_development_dependency "minitest", "~> 5.0"
+ spec.add_development_dependency "minitest-spec", "~> 0.0.2"
end
|
Fix the info in the Gemspec
|
diff --git a/lib/active_shipping/shipping/label_response.rb b/lib/active_shipping/shipping/label_response.rb
index abc1234..def5678 100644
--- a/lib/active_shipping/shipping/label_response.rb
+++ b/lib/active_shipping/shipping/label_response.rb
@@ -6,13 +6,21 @@
class LabelResponse < Response
- attr :labels
attr :params # maybe?
def initialize(success, message, params = {}, options = {})
@params = params
- extract_package_data(params)
super
+ end
+
+ def labels
+ return @labels if @labels
+ packages = params["ShipmentResults"]["PackageResults"]
+ packages = [ packages ] if Hash === packages
+ @labels = packages.map do |package|
+ { :tracking_number => package["TrackingNumber"],
+ :image => package["LabelImage"] }
+ end
end
protected
|
Use custom attr reader for labels data.
Extracting labels at initialize time is not the way to do it: this is not deserialization friendly.
|
diff --git a/lib/sparkle_formation/translation/rackspace.rb b/lib/sparkle_formation/translation/rackspace.rb
index abc1234..def5678 100644
--- a/lib/sparkle_formation/translation/rackspace.rb
+++ b/lib/sparkle_formation/translation/rackspace.rb
@@ -4,6 +4,23 @@
MAP = Heat::MAP
MAP[:resources]['AWS::EC2::Instance'][:name] = 'Rackspace::Cloud::Server'
+
+ def nova_server_finalizer(resource_name, new_resource, old_resource, translated_resources)
+ if(old_resource['Metadata'])
+ new_resource['Metadata'] = old_resource['Metadata']
+ if(new_resource['Metadata'] && new_resource['Metadata']['AWS::CloudFormation::Init'] && config = new_resource['Metadata']['AWS::CloudFormation::Init']['config'])
+ # NOTE: This is a stupid hack since HOT gives the URL to
+ # wget directly and if special characters exist, it fails
+ if(files = config['files'])
+ files.each do |key, args|
+ if(args['source'])
+ args['source'].replace("\"#{args['source']}\"")
+ end
+ end
+ end
+ end
+ end
+ end
def nova_server_user_data(value, args={})
result = super
|
Add metadata formatting to fix HOT bug on remote source endpoints
|
diff --git a/db/migrate/20140908045601_legacy_pass_api_keys.rb b/db/migrate/20140908045601_legacy_pass_api_keys.rb
index abc1234..def5678 100644
--- a/db/migrate/20140908045601_legacy_pass_api_keys.rb
+++ b/db/migrate/20140908045601_legacy_pass_api_keys.rb
@@ -15,7 +15,6 @@
api.save!
end
-
end
def self.down
|
Fix extra empty line making rubocop unhappy.
|
diff --git a/apple_dep_client.gemspec b/apple_dep_client.gemspec
index abc1234..def5678 100644
--- a/apple_dep_client.gemspec
+++ b/apple_dep_client.gemspec
@@ -17,6 +17,8 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]
+ spec.add_dependency "oauth", "~> 0.4.7"
+ spec.add_dependency "typhoeus", "~> 0.7.1"
spec.add_development_dependency "bundler", "~> 1.3"
spec.add_development_dependency "rake"
spec.add_development_dependency "rspec", "~> 3.2"
|
Add oauth and typhoeus gem dependencies
|
diff --git a/db/data_migration/20180103105439_remove_archived_title_prefix_html_attachments.rb b/db/data_migration/20180103105439_remove_archived_title_prefix_html_attachments.rb
index abc1234..def5678 100644
--- a/db/data_migration/20180103105439_remove_archived_title_prefix_html_attachments.rb
+++ b/db/data_migration/20180103105439_remove_archived_title_prefix_html_attachments.rb
@@ -0,0 +1,31 @@+HtmlAttachment.where("title like '[%'").each do |attachment|
+ id = attachment.id
+
+ old_title = attachment.title
+ new_title = old_title.sub(/^\[archived?\]\s*/i, "")
+
+ raise "Title should have changed for id=#{id}" if old_title == new_title
+
+ puts "id=#{id}: #{old_title} -> #{new_title}"
+ next if ENV["DRY_RUN"]
+
+ attachable = attachment.attachable
+ document = attachable.document
+
+ print " Removing from search index..."
+ Whitehall::SearchIndex.delete(attachable)
+ puts "Done."
+
+ print " Updating title..."
+ attachment.title = new_title
+ attachment.save!(validate: false)
+ puts "Done."
+
+ print " Republishing... "
+ PublishingApiDocumentRepublishingWorker.new.perform(document.id)
+ puts "Done."
+
+ print " Re-adding to search index..."
+ Whitehall::SearchIndex.add(attachable.reload)
+ puts "Done."
+end
|
Remove the '[Archived]' title prefix from HTML attachments
https://trello.com/c/qZgjF7EN/472-rename-withdrawn-and-archived-html-publications
Some users have manually added '[Archived]' to the title of HTML
attachments, but the system already handles this. The result is we're
rendering titles like '[Withdrawn] [Archived] Something'.
At time of writing, there are 37 HTML attachments exhibiting this
problem. This is more than those listed in the Trello ticket, but we
decided to fix all of them.
|
diff --git a/Framer.podspec b/Framer.podspec
index abc1234..def5678 100644
--- a/Framer.podspec
+++ b/Framer.podspec
@@ -1,6 +1,6 @@ Pod::Spec.new do |s|
s.name = 'Framer'
- s.version = '1.4.3'
+ s.version = '1.5.0'
s.summary = 'Comfortable syntax for working with frames'
s.description = <<-DESC
Framer is a good framework which wraps working with frames with a nice chaining syntax.
|
Change pod version -> 1.5.0
|
diff --git a/merb-gen/app_generators/merb/merb_generator.rb b/merb-gen/app_generators/merb/merb_generator.rb
index abc1234..def5678 100644
--- a/merb-gen/app_generators/merb/merb_generator.rb
+++ b/merb-gen/app_generators/merb/merb_generator.rb
@@ -2,21 +2,21 @@ require "merb-gen/base"
class MerbGenerator < Merb::GeneratorBase
-
+
def initialize(args, runtime_options = {})
@base = File.dirname(__FILE__)
@name = args.first
super
@destination_root = @name
end
-
+
protected
def banner
<<-EOS.split("\n").map{|x| x.strip}.join("\n")
Creates a Merb application stub.
USAGE: #{spec.name} -g path
-
+
Set environment variable MERB_ORM=[activerecord|datamapper|sequel]
to pre-enabled an ORM.
EOS
@@ -25,7 +25,7 @@ def default_orm?(orm)
ENV['MERB_ORM'] == orm.to_s
end
-
+
def default_test_suite?(suite)
return ENV['MERB_TEST_SUITE'] == suite.to_s if ENV['MERB_TEST_SUITE']
options[suite]
@@ -33,8 +33,9 @@
def display_framework_selections
end
-
+
def create_dirs
m.directory 'log'
+ m.directory 'gems'
end
end
|
Create gems directory in new applications.
|
diff --git a/lib/tasks/unpublish_start_page_ab_test_pages.rake b/lib/tasks/unpublish_start_page_ab_test_pages.rake
index abc1234..def5678 100644
--- a/lib/tasks/unpublish_start_page_ab_test_pages.rake
+++ b/lib/tasks/unpublish_start_page_ab_test_pages.rake
@@ -0,0 +1,18 @@+namespace :start_page_ab_test_pages do
+ desc "Unpublish self assessment signin pages"
+ task unpublish_self_assessment_signin_pages: :environment do
+ content_ids = %w(
+ f34ebcbc-4955-4f57-89bd-4d6aa7e72edf
+ 8897173c-583a-47c7-b23f-c8624434dd1a
+ ec28dd82-8ac6-48e8-a34d-0ff00d0606b5
+ )
+
+ content_ids.each do |content_id|
+ Services.publishing_api.unpublish(
+ content_id,
+ type: "gone",
+ discard_drafts: true
+ )
+ end
+ end
+end
|
Unpublish pages added for Self Assessment A/B test
Add a rake task to unpublish the three pages we added as part of the
Self Assessment A/B test. That test finished on 17/11/2017 and these
particular pages are no longer needed.
|
diff --git a/Result.podspec b/Result.podspec
index abc1234..def5678 100644
--- a/Result.podspec
+++ b/Result.podspec
@@ -0,0 +1,14 @@+Pod::Spec.new do |s|
+ s.name = 'Result'
+ s.version = '0.6.0-beta.2'
+ s.summary = 'Swift type modelling the success/failure of arbitrary operations'
+
+ s.homepage = 'https://github.com/antitypical/Result'
+ s.license = 'MIT'
+ s.author = { 'Rob Rix' => 'rob.rix@github.com' }
+ s.source = { :git => 'https://github.com/antitypical/Result.git', :tag => s.version.to_s }
+ s.source_files = 'Result/*.swift'
+ s.requires_arc = true
+ s.ios.deployment_target = '8.0'
+ s.osx.deployment_target = '10.9'
+end
|
Add simple Podspec to the repo
|
diff --git a/lib/best_gems_client.rb b/lib/best_gems_client.rb
index abc1234..def5678 100644
--- a/lib/best_gems_client.rb
+++ b/lib/best_gems_client.rb
@@ -31,6 +31,7 @@ }.to_h
end
+ break if html.at(".pagination .disabled") # Checks if there is a next page
current_page += 1
end
}.lazy
|
Check if there is a next page
|
diff --git a/source/restacker.gemspec b/source/restacker.gemspec
index abc1234..def5678 100644
--- a/source/restacker.gemspec
+++ b/source/restacker.gemspec
@@ -13,7 +13,7 @@ s.files = `git ls-files -z`.split("\x0")
s.require_paths = ["lib"]
s.add_runtime_dependency 'aws-sdk', '~> 2'
- s.add_runtime_dependency 'rainbow'
+ s.add_runtime_dependency 'rainbow', '~> 2'
s.homepage = 'https://github.com/devsecops/restacker'
s.license = 'Apache License Version 2.0'
end
|
Add runtime dependency for rainbow gem
|
diff --git a/lib/classified-ipsum.rb b/lib/classified-ipsum.rb
index abc1234..def5678 100644
--- a/lib/classified-ipsum.rb
+++ b/lib/classified-ipsum.rb
@@ -11,7 +11,7 @@ end
# Returns the redacted string e.g.
- # "Lee Reilly" becomes "[REDACTED] [REDACTED]""
+ # "Lee Reilly" becomes "[REDACTED] [REDACTED]"
def sanitize
self.downcase.gsub(/[abcdefghijklmnopqrstuvwxyz1234567890]/, DEFAULT_SANITIZATION)
end
|
Remove a stray double quote
|
diff --git a/capi/recipes/cats_gopath_symlink.rb b/capi/recipes/cats_gopath_symlink.rb
index abc1234..def5678 100644
--- a/capi/recipes/cats_gopath_symlink.rb
+++ b/capi/recipes/cats_gopath_symlink.rb
@@ -0,0 +1,4 @@+link '/Users/pivotal/go/src/github.com/cloudfoundry/cf-acceptance-tests' do
+ to '/Users/pivotal/workspace/cf-release/src/github.com/cloudfoundry/cf-acceptance-tests'
+ only_if 'test -d /Users/pivotal/go && test -d /Users/pivotal/workspace/cf-release/src/github.com/cloudfoundry/cf-acceptance-tests'
+end
|
Add symlink from CATS in GOPATH to CATS in cf-release
We normally develop out of the cf-acceptance-tests that
are vendored in with cf-release on CAPI and our aliases
assume we are using that one.
This will hopefully fix an issue where fasd_cd (z command)
takes us into the GOPATH one without realizing.
Eventually when we no longer use cf-release this can be
removed and we should work out of the GOPATH.
|
diff --git a/lib/llt/tokenizer/api.rb b/lib/llt/tokenizer/api.rb
index abc1234..def5678 100644
--- a/lib/llt/tokenizer/api.rb
+++ b/lib/llt/tokenizer/api.rb
@@ -5,6 +5,7 @@
class Api < Sinatra::Base
register Sinatra::RespondWith
+ register LLT::Core::Api::VersionRoutes
helpers LLT::Core::Api::Helpers
get '/tokenize' do
@@ -17,4 +18,6 @@ f.xml { to_xml(tokens, params) }
end
end
+
+ add_version_route_for('/tokenize', dependencies: %i{ Core Tokenizer })
end
|
Add version route for tokenize
|
diff --git a/spec/emptying_ships_spec.rb b/spec/emptying_ships_spec.rb
index abc1234..def5678 100644
--- a/spec/emptying_ships_spec.rb
+++ b/spec/emptying_ships_spec.rb
@@ -0,0 +1,36 @@+require 'spec_helper'
+
+def create_ships(number_of_players)
+ smallest = number_of_players + 1
+ largest = number_of_players + 3
+ (smallest..largest).map {|i| Ship.new(i) }
+end
+
+def empty_full_ships(ships)
+ ships.map do |ship|
+ ship.full? ? Ship.new(ship.spaces) : ship
+ end
+end
+
+describe "emptying ships" do
+ it "returns an array of ships - full ships become empty" do
+ ships = [Ship.new(5),
+ Ship.new(6, 6.barrels_of(:indigo)),
+ Ship.new(7, 3.barrels_of(:indigo))]
+ empty_full_ships(ships).map(&:free_spaces).should == [5,6,4]
+ end
+end
+
+describe "setting up ships" do
+ it "has ships of size 4, 5 & 6 with 3 players" do
+ create_ships(3).map {|s| s.spaces }.should == [4,5,6]
+ end
+
+ it "has ships of size 5, 6 & 7 with 4 players" do
+ create_ships(4).map {|s| s.spaces }.should == [5,6,7]
+ end
+
+ it "has ships of size 6, 7 & 8 with 5 players" do
+ create_ships(5).map {|s| s.spaces }.should == [6,7,8]
+ end
+end
|
Add functions for creating and emptying ships.
|
diff --git a/spec/features/users_spec.rb b/spec/features/users_spec.rb
index abc1234..def5678 100644
--- a/spec/features/users_spec.rb
+++ b/spec/features/users_spec.rb
@@ -6,7 +6,7 @@ subject(:vist_sign_up) do
visit(root_url)
click_link("Sign Up")
- end
+ end
subject(:fill_in_require_fields) do
user_new_password = "Pass3word:"
@@ -33,5 +33,19 @@ expect(page.status_code).to be(200)
end
end
+
+ context "with only require fields" do
+ it "responds with 200" do
+ vist_sign_up
+
+ within "#new_user" do
+ fill_in_require_fields
+ end
+
+ click_on "Sign Up"
+
+ expect(page.status_code).to be(200)
+ end
+ end
end
end
|
Add User Feature Test For Require Fields
|
diff --git a/Mantle-HAL-Remix.podspec b/Mantle-HAL-Remix.podspec
index abc1234..def5678 100644
--- a/Mantle-HAL-Remix.podspec
+++ b/Mantle-HAL-Remix.podspec
@@ -6,7 +6,7 @@ s.license = { :type => "MIT", :file => "LICENSE" }
s.author = { "Lynn Zhou" => "lynn@lynnzhou.com" }
s.social_media_url = 'https://twitter.com/remixnine'
- s.source = { :git => "https://github.com/remixnine/Mantle-HAL-Remix.git", :tag => "1.0.0" }
+ s.source = { :git => "https://github.com/remixnine/Mantle-HAL-Remix.git", :tag => "1.0.1" }
s.ios.deployment_target = '6.0'
s.osx.deployment_target = '10.8'
|
Update Git tag version to 1.0.1
|
diff --git a/lib/floodgate/config.rb b/lib/floodgate/config.rb
index abc1234..def5678 100644
--- a/lib/floodgate/config.rb
+++ b/lib/floodgate/config.rb
@@ -1,6 +1,10 @@ module Floodgate
class Config
- attr_accessor :app_id, :api_token, :filter_traffic, :redirect_url
+ attr_accessor \
+ :api_token,
+ :app_id,
+ :filter_traffic,
+ :redirect_url
def initialize(app_id, api_token)
@app_id = app_id
|
Make attr_accessor one per line
|
diff --git a/spec/subtime/timer_spec.rb b/spec/subtime/timer_spec.rb
index abc1234..def5678 100644
--- a/spec/subtime/timer_spec.rb
+++ b/spec/subtime/timer_spec.rb
@@ -15,6 +15,12 @@
timer.start
end
+
+ it "says 'timer done' when finished" do
+ expect(timer).to receive(:`).with("say timer done")
+
+ timer.start
+ end
end
end
end
|
Add and pass test for timer done message
|
diff --git a/lib/girlscout/thread.rb b/lib/girlscout/thread.rb
index abc1234..def5678 100644
--- a/lib/girlscout/thread.rb
+++ b/lib/girlscout/thread.rb
@@ -8,7 +8,7 @@ return @created_by if @created_by
attr = @attributes["createdBy"]
- creator_type = attr["type"].capitalize.constantize rescue User
+ creator_type = "GirlScout::#{attr["type"].capitalize}".constantize rescue User
@created_by ||= creator_type.new(attr)
end
|
Fix class namespace problem in Thread.
|
diff --git a/spec/support/blueprints.rb b/spec/support/blueprints.rb
index abc1234..def5678 100644
--- a/spec/support/blueprints.rb
+++ b/spec/support/blueprints.rb
@@ -11,7 +11,7 @@ Vote.blueprint do
issues { [Issue.make] }
time { Time.now }
- vote_results { Array.new(1) { VoteResult.make! } }
+ vote_results { [VoteResult.make!] }
end
VoteConnection.blueprint do
@@ -37,6 +37,7 @@ party
source { "PP:10" }
body { "Løftetekst" }
+ categories { [Category.make!] }
end
Category.blueprint do
|
Fix blueprint for new Promise validation.
|
diff --git a/features/step_definitions/additional_cli_steps.rb b/features/step_definitions/additional_cli_steps.rb
index abc1234..def5678 100644
--- a/features/step_definitions/additional_cli_steps.rb
+++ b/features/step_definitions/additional_cli_steps.rb
@@ -7,7 +7,11 @@
Then /^the output should contain all of these:$/ do |table|
table.raw.flatten.each do |string|
- assert_partial_output(string, all_output)
+ if RUBY_VERSION == '1.8.7' && string =~ /\{.+=>.+\}/
+ warn "Skipping checking #{string} on 1.8.7 because hash ordering is not consistent"
+ else
+ assert_partial_output(string, all_output)
+ end
end
end
|
Work around travis build failing on REE.
The `include` cuke has a bunch of assertions that are failing
on REE since 1.8.7 does not guarantee hash ordering, so when
a hash is inspected, it could produce `{ :b => 2, :a => 1 }`
instead of `{ :a => 1, :b => 2 }`.
|
diff --git a/application.rb b/application.rb
index abc1234..def5678 100644
--- a/application.rb
+++ b/application.rb
@@ -2,7 +2,7 @@ require 'rack-flash'
require 'dotenv'
require 'twilio-ruby'
-
+require 'json'
# Configuration
Dotenv.load
APP_ROOT = Pathname.new(File.expand_path('../', __FILE__))
@@ -16,19 +16,24 @@
# Routing
get '/' do
+ @contact_names = JSON.parse(ENV['CONTACTS_ARRAY']).map { |name, number| name }
erb :home
end
+
post '/arrived_safely' do
- @client = Twilio::REST::Client.new(ENV['TWILIO_ACCOUNT_SID'], ENV['TWILIO_AUTH_TOKEN'])
- p ENV['CONTACTS_ARRAY']
- contacts = Hash[ENV['CONTACTS_ARRAY'].map {|key, value| [key, value]}]
- p contacts
- #@client.messages.create(
- # from: '+12406502723',
- # to: "+1#{number}",
- # body: "Hi #{name}, it's Ariel. I'm sending you a text from #{location}. I just wanted to let you know I got in safe and sound :) Hope you're doing well! XOXO"
- #)
- flash[:success] = 'it worked'
-rescue => e
- flash[:error] = e.message
+ client = Twilio::REST::Client.new(ENV['TWILIO_ACCOUNT_SID'], ENV['TWILIO_AUTH_TOKEN'])
+ contacts = Hash[JSON.parse(ENV['CONTACTS_ARRAY']).map {|key, value| [key, value]}]
+ location = params[:location]
+ begin
+ contacts.each do |name, number|
+ client.messages.create(
+ from: '+12406502723',
+ to: "+1#{number}",
+ body: "Hi #{name}, it's Ariel. I'm sending you a text from #{location}. I just wanted to let you know I got in safe and sound :) Hope you're doing well! XOXO"
+ )
+ end
+ flash[:success] = "sent a message from #{location}"
+ rescue => e
+ flash[:error] = e.message
+ end
end
|
Add in logic to shoot off texts to fam
|
diff --git a/lib/using.rb b/lib/using.rb
index abc1234..def5678 100644
--- a/lib/using.rb
+++ b/lib/using.rb
@@ -4,7 +4,7 @@ unless defined?(LOAD_SCHEMES)
LOAD_SCHEMES = [:require, :load, :autoload]
- class << self
+ module DefaultLoadSchemes
def reset_default_load_scheme!
@default_load_scheme = nil
end
@@ -17,6 +17,8 @@ @default_load_scheme ||= LOAD_SCHEMES.first
end
end
+
+ extend DefaultLoadSchemes
def load_scheme
@load_scheme ||= ::Using.default_load_scheme
|
Refactor metaclass into a module
|
diff --git a/app/models/ability.rb b/app/models/ability.rb
index abc1234..def5678 100644
--- a/app/models/ability.rb
+++ b/app/models/ability.rb
@@ -29,6 +29,9 @@ # Everyone can read public activities
can :read, LightweightActivity, :publication_status => 'public'
can :read, InteractivePage, :lightweight_activity => { :publication_status => 'public' }
+ # Private activities can be read, too, but they're not in the lists
+ can :read, LightweightActivity, :publication_status => 'private'
+ can :read, InteractivePage, :lightweight_activity => { :publication_status => 'private' }
end
end
end
|
Make private activities readable with link
|
diff --git a/lib/ruby-dmm/response.rb b/lib/ruby-dmm/response.rb
index abc1234..def5678 100644
--- a/lib/ruby-dmm/response.rb
+++ b/lib/ruby-dmm/response.rb
@@ -22,6 +22,8 @@ :total_count,
]
attr_reader *RESULT_KEYS
+ alias_method :offset, :first_position
+ alias_method :per_result, :result_count
def initialize(result)
RESULT_KEYS.each do |key|
|
Add alias method for `DMM::Result` class
|
diff --git a/lib/specjour/db_scrub.rb b/lib/specjour/db_scrub.rb
index abc1234..def5678 100644
--- a/lib/specjour/db_scrub.rb
+++ b/lib/specjour/db_scrub.rb
@@ -6,6 +6,7 @@ require 'rake'
extend Rake::DSL if defined?(Rake::DSL)
if defined?(Rails) && Rails.version =~ /^3/
+ Rake::Task.define_task(:environment) { }
load 'rails/tasks/misc.rake'
load 'active_record/railties/databases.rake'
else
|
Add an environment task, useful for some reason
Conflicts:
lib/specjour/db_scrub.rb
|
diff --git a/app/presenters/publishing_api/world_location_presenter.rb b/app/presenters/publishing_api/world_location_presenter.rb
index abc1234..def5678 100644
--- a/app/presenters/publishing_api/world_location_presenter.rb
+++ b/app/presenters/publishing_api/world_location_presenter.rb
@@ -24,7 +24,7 @@ rendering_app: Whitehall::RenderingApp::WHITEHALL_FRONTEND,
schema_name: "world_location",
)
- if international_delegation?
+ if item.international_delegation?
content.merge!(PayloadBuilder::PolymorphicPath.for(item))
end
content.merge!(PayloadBuilder::AnalyticsIdentifier.for(item))
@@ -33,11 +33,5 @@ def links
{}
end
-
- private
-
- def international_delegation?
- item.world_location_type_id == WorldLocationType::InternationalDelegation.id
- end
end
end
|
Update usage of WorldLocationType in WorldLocationPresenter
We have changed the world location type to be an enum, so this reflects
those changes.
|
diff --git a/lib/tasks/scheduler.rake b/lib/tasks/scheduler.rake
index abc1234..def5678 100644
--- a/lib/tasks/scheduler.rake
+++ b/lib/tasks/scheduler.rake
@@ -1,4 +1,5 @@+require 'date'
desc "This task is called by the Heroku scheduler add-on"
task :tuesday_newsletter => :environment do
- TuesdayNewslettersJob.perform_now
+ TuesdayNewslettersJob.perform_now if Date.today.tuesday?
end
|
Check if Tuesday before performing task
|
diff --git a/lib/tasks/yossarian.rake b/lib/tasks/yossarian.rake
index abc1234..def5678 100644
--- a/lib/tasks/yossarian.rake
+++ b/lib/tasks/yossarian.rake
@@ -26,5 +26,21 @@ task clean: :environment do
Recording.where(youtube_url: nil).each(&:destroy!)
Artist.where(image: nil).each(&:destroy!)
+
+ Event.find_each do |event|
+ if event.performances.count > 20
+ id = event.performances.order(:id).first(20).last.id
+
+ event.performances.where('id > ?', id).each(&:destroy!)
+ end
+ end
+
+ Artist.find_each do |artist|
+ if artist.recordings.count > 10
+ id = artist.recordings.order(:id).first(10).last.id
+
+ artist.recordings.where('id > ?', id).each(&:destroy!)
+ end
+ end
end
end
|
Add cleanup task for data
|
diff --git a/lib/tasks/soshigal.rake b/lib/tasks/soshigal.rake
index abc1234..def5678 100644
--- a/lib/tasks/soshigal.rake
+++ b/lib/tasks/soshigal.rake
@@ -6,9 +6,9 @@ end
end
- desc 'Recache the number of images per album'
+ desc 'Recache all album thumbnails'
task :recache_thumbnails => :environment do
- Album.skip_callback(:save, :before, :ensure_foo_is_not_bar)
+ Album.skip_callback(:save, :before, :set_thumbnail_url)
Album.all.each do |album|
album.set_thumbnail_url
album.save
|
Fix typo in rake task
|
diff --git a/lib/yaks/primitivize.rb b/lib/yaks/primitivize.rb
index abc1234..def5678 100644
--- a/lib/yaks/primitivize.rb
+++ b/lib/yaks/primitivize.rb
@@ -1,26 +1,43 @@ module Yaks
class Primitivize
include Concord.new(:object)
+
+ # TODO Global config, make this extensible in a per-instance way
+ MAPPINGS = {}
def self.call(object)
new(object).call
end
+ def self.map(*types, &blk)
+ types.each do |type|
+ MAPPINGS[type] = blk
+ end
+ end
+
+ map String, TrueClass, FalseClass, NilClass, Numeric do
+ object
+ end
+
+ map Symbol do
+ object.to_s
+ end
+
+ map Hash, Hamster::Hash do
+ object.to_enum(:each).with_object({}) do |(key, value), output|
+ output[self.class.(key)] = self.class.(value)
+ end
+ end
+
+ map Enumerable, Hamster::Enumerable do
+ object.map(&self.class.method(:call)).to_a
+ end
+
def call
- case object
- when String, TrueClass, FalseClass, NilClass, Numeric
- object
- when Symbol
- object.to_s
- when Hash, Hamster::Hash
- object.to_enum(:each).with_object({}) do |(key, value), output|
- output[self.class.(key)] = self.class.(value)
- end
- when Enumerable, Hamster::Enumerable
- object.map(&self.class.method(:call)).to_a
- else
- raise "don't know how to turn #{object.class} (#{object.inspect}) into a primitive"
+ MAPPINGS.each do |pattern, block|
+ return instance_eval(&block) if pattern === object
end
+ raise "don't know how to turn #{object.class} (#{object.inspect}) into a primitive"
end
end
end
|
Make Primitivize extensible, useful for dates/timestamps. Releasing v0.1.0
|
diff --git a/lib/build_log_parser/matchers/coverage_matcher.rb b/lib/build_log_parser/matchers/coverage_matcher.rb
index abc1234..def5678 100644
--- a/lib/build_log_parser/matchers/coverage_matcher.rb
+++ b/lib/build_log_parser/matchers/coverage_matcher.rb
@@ -27,9 +27,9 @@ def fetch_phpunit_coverage(str)
if body =~ PATTERNS[:phpunit]
{
- coverage_percent: $1.to_f,
lines_covered: $2.to_i,
- lines_total: $3.to_i
+ lines_total: $3.to_i,
+ coverage_percent: $1.to_f
}
end
end
@@ -37,9 +37,9 @@ def fetch_istanbul_coverage(str)
if body =~ PATTERNS[:istanbul]
{
- coverage_percent: $1.to_f,
lines_covered: $2.to_i,
- lines_total: $3.to_i
+ lines_total: $3.to_i,
+ coverage_percent: $1.to_f
}
end
end
|
Revert "Reorder keys in coverage metrics results"
This reverts commit 9b18ccd7c07e0c5bfac670a27fbcc98f137ad8eb.
|
diff --git a/lib/generators/emcee/install/install_generator.rb b/lib/generators/emcee/install/install_generator.rb
index abc1234..def5678 100644
--- a/lib/generators/emcee/install/install_generator.rb
+++ b/lib/generators/emcee/install/install_generator.rb
@@ -16,7 +16,7 @@ end
def add_html_import_to_layout
- insert_into_file "app/views/layouts/application.html.erb", "<%= html_import_tag \"application\", \"data-turbolinks-track\" => true %>\n\t\t", before: "<%= csrf_meta_tags %>"
+ insert_into_file "app/views/layouts/application.html.erb", "<%= html_import_tag \"application\", \"data-turbolinks-track\" => true %>\n ", before: "<%= csrf_meta_tags %>"
end
end
end
|
Indent inserted html import better
|
diff --git a/db/seeds.rb b/db/seeds.rb
index abc1234..def5678 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -39,3 +39,20 @@ password: 'secret',
website: website
)
+
+bob = User.create!(
+ email: 'bob@example.com',
+ name: 'Bob Brown',
+ password: 'letmein',
+ website: website
+)
+
+bob_home = Address.create!(
+ address_line_1: '1 Somerset Road',
+ country: website.countries.first,
+ email_address: 'bob@example.org',
+ full_name: 'Bob Brown',
+ postcode: 'L0N D0N',
+ town_city: 'London',
+ user: bob
+)
|
Add seed customer and address
|
diff --git a/db/seeds.rb b/db/seeds.rb
index abc1234..def5678 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -13,6 +13,7 @@ ActiveRecord::Base.connection.execute("TRUNCATE #{table}") if table != "schema_migrations"
end
+ [Repository, Commit, Request, Build].each{ |klass| klass.reset_column_information }
10.times do
Factory.create(:seed_repository)
end
|
Reset column informations on models
|
diff --git a/manifests/cf-manifest/spec/manifest/oauth_spec.rb b/manifests/cf-manifest/spec/manifest/oauth_spec.rb
index abc1234..def5678 100644
--- a/manifests/cf-manifest/spec/manifest/oauth_spec.rb
+++ b/manifests/cf-manifest/spec/manifest/oauth_spec.rb
@@ -0,0 +1,18 @@+RSpec.describe "Google OAuth" do
+ let(:properties) { manifest.fetch("instance_groups.uaa.jobs.uaa.properties") }
+
+ describe "when user creation is not enabled" do
+ let(:manifest) { manifest_with_defaults }
+ it "enables the Google OAuth provider in UAA" do
+ expect(properties.fetch('login')).to_not have_key 'oauth'
+ end
+ end
+
+ describe "when user creation is enabled" do
+ let(:manifest) { manifest_with_enable_user_creation }
+ it "enables the Google OAuth provider in UAA" do
+ providers = properties.fetch("login").fetch("oauth").fetch("providers")
+ expect(providers).to have_key 'google'
+ end
+ end
+end
|
Add rspec tests for Google OAuth provider in UAA
|
diff --git a/SwiftyAttributes.podspec b/SwiftyAttributes.podspec
index abc1234..def5678 100644
--- a/SwiftyAttributes.podspec
+++ b/SwiftyAttributes.podspec
@@ -14,7 +14,7 @@ s.homepage = "https://github.com/eddiekaiger/SwiftyAttributes"
s.license = { :type => "MIT", :file => "LICENSE" }
s.author = { "Eddie Kaiger" => "eddiekaiger@gmail.com" }
- s.source = { :git => "https://github.com/eddiekaiger/SwiftyAttributes.git", :tag => "v4.2.0" }
+ s.source = { :git => "https://github.com/eddiekaiger/SwiftyAttributes.git", :tag => s.version }
s.source_files = "SwiftyAttributes/Sources/common/*.swift"
s.osx.source_files = "SwiftyAttributes/Sources/macOS/*.swift"
|
Update podspec to use spec.version instead of literal
|
diff --git a/app/models/budget/group.rb b/app/models/budget/group.rb
index abc1234..def5678 100644
--- a/app/models/budget/group.rb
+++ b/app/models/budget/group.rb
@@ -40,5 +40,18 @@ slug.nil? || budget.drafting?
end
+ class Translation < Globalize::ActiveRecord::Translation
+ delegate :budget, to: :globalized_model
+
+ validate :name_uniqueness_by_budget
+
+ def name_uniqueness_by_budget
+ if budget.groups.joins(:translations)
+ .where(name: name)
+ .where.not("budget_group_translations.budget_group_id": budget_group_id).any?
+ errors.add(:name, I18n.t("errors.messages.taken"))
+ end
+ end
+ end
end
end
|
Move Translation class inside Budget::Group
The reason to move Translation class is explained here [1]
[1] https://github.com/consul/consul/pull/3359/commits/106649a8a598fb4b1389e174fdd6e70f51767af2
|
diff --git a/app/models/kennedy/post.rb b/app/models/kennedy/post.rb
index abc1234..def5678 100644
--- a/app/models/kennedy/post.rb
+++ b/app/models/kennedy/post.rb
@@ -4,6 +4,10 @@ has_and_belongs_to_many :categories
scope :recent, order(:published_at)
+
+ class << self
+ alias_method :latest, :recent
+ end
searchable do
text :title, stored: true do
@@ -56,6 +60,7 @@ with(:categories, params[:c]) unless params[:t].blank?
}
end
+
end
end
|
Add latest scope alias recent
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.