diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/db/seeds.rb b/db/seeds.rb
index abc1234..def5678 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -13,8 +13,8 @@ puts 'role: ' << role
end
puts 'DEFAULT USERS'
-user = User.find_or_create_by_email :name => ENV['ADMIN_NAME'].dup, :email => ENV['ADMIN_EMAIL'].dup, :password => ENV['ADMIN_PASSWORD'].dup, :password_confirmation => ENV['ADMIN_PASSWORD'].dup
+user = User.find_or_create_by_email name: ENV['ADMIN_NAME'].dup, email: ENV['ADMIN_EMAIL'].dup, password: ENV['ADMIN_PASSWORD'].dup, password_confirmation: ENV['ADMIN_PASSWORD'].dup, label_name: 'Etc'
puts 'user: ' << user.name
user.add_role :admin
user.skip_confirmation!
-user.save!+user.save!
|
Update Seed. Need a label_name now
|
diff --git a/lib/frecon/base/variables.rb b/lib/frecon/base/variables.rb
index abc1234..def5678 100644
--- a/lib/frecon/base/variables.rb
+++ b/lib/frecon/base/variables.rb
@@ -9,7 +9,7 @@
# Public: The FReCon API module.
module FReCon
- VERSION ||= "0.5.1"
+ VERSION = "0.5.1"
@environment_variable = :development
|
Switch back to old VERSION= syntax.
This makes it documentable, and it helps to enforce best practices.
|
diff --git a/lib/generics/generic_type.rb b/lib/generics/generic_type.rb
index abc1234..def5678 100644
--- a/lib/generics/generic_type.rb
+++ b/lib/generics/generic_type.rb
@@ -0,0 +1,101 @@+module Generics
+ class NotCompatibleError < StandardError
+ end
+
+ class StrictType
+ # Return a subclass of StrictType that can be instantiated with a type
+ # Use it in a generic class and use the instantiated version in the instantiated object
+ # @param [String] name
+ # @return [Class] subclass of Generics::StrictType
+ def self.[](name)
+ Class.new(self).tap do |klass|
+ klass.define_singleton_method(:name) { name }
+ end
+ end
+
+ # @param [Class, Module, Symbol] tpye
+ def initialize(type)
+ @type_checker = TypeChecker[type]
+ @type = type
+ end
+
+ def valid?(value)
+ @type_checker.valid?(value)
+ end
+
+ # Check if value is valid in current state with exception
+ # @param [Object] value
+ # @raise [NotCompatibleError]
+ # @return [True, False]
+ def valid!(value)
+ fail NotCompatibleError unless @type_checker.valid?(value)
+ end
+ end
+
+ class GenericType
+ # @param [Symbol] name
+ # @return [GenericType]
+ def self.[](name)
+ new(name)
+ end
+
+ # @param [Symbol] name
+ def initialize(name)
+ @name = name
+ @values = []
+ @shared_superclass = nil
+ @shared_modules = []
+ end
+
+ # Add value, narrowing (possibly) the shared class or modules
+ # @param [Object] value
+ # @return [Object] same value
+ def <<(value)
+ if @values.empty?
+ @shared_superclass = value.class
+ @shared_modules = value.class.included_modules
+ else
+ common_ancestor = find_common_ancestor(@shared_superclass, value.class)
+ # Ignore Object/BasicObject ancestors
+ common_ancestor = nil if common_ancestor == BasicObject || common_ancestor == Object
+ shared_modules = value.class.included_modules & @shared_modules - [Kernel]
+
+ if !common_ancestor && shared_modules.empty?
+ fail NotCompatibleError
+ end
+
+ @shared_superclass = common_ancestor
+ @shared_modules = shared_modules
+ end
+ @values << value
+ end
+
+ # Check if value is valid in current state. This is not the same as adding it as adding it could change the
+ # strictness to a level that will make the value valid again
+ # @param [Object] value
+ # @return [True, False]
+ def valid?(value)
+ return true if value.is_a?(@shared_superclass)
+ @shared_modules.any? { |m| value.is_a?(m) }
+ end
+
+ # Check if value is valid in current state with exception
+ # @param [Object] value
+ # @raise [NotCompatibleError]
+ # @return [True, False]
+ def valid!(value)
+ fail NotCompatibleError unless valid?(value)
+ end
+
+ private def find_common_ancestor(klassA, klassB)
+ return klassA if klassA == klassB
+ return nil unless klassA && klassB
+ klassAAncestors = klassA.ancestors.grep(Class).to_set
+ klassBAncestors = klassB.ancestors.grep(Class).to_set
+ return klassAAncestors.find do |klass|
+ klassBAncestors.include?(klass)
+ end
+ nil
+ end
+ end
+end
|
Add experimental Generic & Strict Types
StrictType is basically just a wrapper for TypeChecker
GenericType dynamically adjusts it's definition of shared class/modules until it finds a common ancestor that is not one that is common to basically all (e.g. Object, Kernel)
-----------------------------------------------------------
On branch master - Wed 7 Sep 2016 09:26:31 PDT by matrinox <geoff.lee@lendesk.com>
|
diff --git a/lib/hipchat/publisher/api.rb b/lib/hipchat/publisher/api.rb
index abc1234..def5678 100644
--- a/lib/hipchat/publisher/api.rb
+++ b/lib/hipchat/publisher/api.rb
@@ -23,7 +23,7 @@ post.add_parameter 'message', message
post.add_parameter 'color', params[:color] if params[:color]
- post.add_parameter 'notify', params[:notify].to_s if params[:notify]
+ post.add_parameter 'notify', params[:notify] ? '1' : '0'
post.params.content_charset = 'UTF-8'
|
Fix notify parameter to post API
|
diff --git a/lib/syoboemon/parser/base.rb b/lib/syoboemon/parser/base.rb
index abc1234..def5678 100644
--- a/lib/syoboemon/parser/base.rb
+++ b/lib/syoboemon/parser/base.rb
@@ -12,8 +12,6 @@
def configure_target_tag(tag_name)
tag tag_name
- end
-
end
def expand_analysis_target_elements(elements)
|
Remove the keyword "end", fixed grammar
|
diff --git a/lib/vagrant_cloud/account.rb b/lib/vagrant_cloud/account.rb
index abc1234..def5678 100644
--- a/lib/vagrant_cloud/account.rb
+++ b/lib/vagrant_cloud/account.rb
@@ -37,9 +37,14 @@
def request(method, path, params = {})
params[:access_token] = access_token
- arg = {:params => params}
- arg = params if ['post', 'put'].include? method # Weird rest_client api
- result = RestClient.send(method, url_base + path, arg)
+ headers = {:access_token => access_token}
+ result = RestClient::Request.execute(
+ :method => method,
+ :url => url_base + path,
+ :payload => params,
+ :headers => headers,
+ :ssl_version => 'TLSv1'
+ )
result = JSON.parse(result)
errors = result['errors']
raise "Vagrant Cloud returned error: #{errors}" if errors
|
Use TLSv1 instead of default SSLv3 for vagrantcloud API server
|
diff --git a/lib/will_paginate/railtie.rb b/lib/will_paginate/railtie.rb
index abc1234..def5678 100644
--- a/lib/will_paginate/railtie.rb
+++ b/lib/will_paginate/railtie.rb
@@ -4,21 +4,23 @@ module WillPaginate
class Railtie < Rails::Railtie
initializer "will_paginate.active_record" do |app|
- if defined? ::ActiveRecord
+ ActiveSupport.on_load :active_record do
require 'will_paginate/finders/active_record'
WillPaginate::Finders::ActiveRecord.enable!
end
end
initializer "will_paginate.action_dispatch" do |app|
- if defined? ::ActionDispatch::ShowExceptions
+ ActiveSupport.on_load :action_controller do
ActionDispatch::ShowExceptions.rescue_responses['WillPaginate::InvalidPage'] = :not_found
end
end
initializer "will_paginate.action_view" do |app|
- require 'will_paginate/view_helpers/action_view'
- ActionView::Base.send(:include, WillPaginate::ViewHelpers::ActionView)
+ ActiveSupport.on_load :action_view do
+ require 'will_paginate/view_helpers/action_view'
+ include WillPaginate::ViewHelpers::ActionView
+ end
end
end
end
|
Use autoloading in Railtie so that framework loading isn't triggered by will_paginate
|
diff --git a/hookable.rb b/hookable.rb
index abc1234..def5678 100644
--- a/hookable.rb
+++ b/hookable.rb
@@ -10,11 +10,10 @@ end
post "/" do
- puts request.inspect
headers = {
- "X-GitHub-Event" => request.env["X-Github-Event"],
- "X-GitHub-Delivery" => request.env["X-Github-Delivery"],
- "X-Hub-Signature" => request.env["X-Hub-Signature"]
+ "X-GitHub-Event" => env["X-GitHub-Event"],
+ "X-GitHub-Delivery" => env["X-GitHub-Delivery"],
+ "X-Hub-Signature" => env["X-Hub-Signature"]
}.to_json
payload = request.body.read
|
Use env instead of request
|
diff --git a/spec/test_app/config/application.rb b/spec/test_app/config/application.rb
index abc1234..def5678 100644
--- a/spec/test_app/config/application.rb
+++ b/spec/test_app/config/application.rb
@@ -32,6 +32,7 @@ # config.i18n.default_locale = :de
# Do not swallow errors in after_commit/after_rollback callbacks.
- config.active_record.raise_in_transactional_callbacks = true
+ # Only for Rails 4.2
+ #config.active_record.raise_in_transactional_callbacks = true
end
end
|
Comment out Rails 4.2-only line, since we want to support 4.1 too
|
diff --git a/core/class/allocate_spec.rb b/core/class/allocate_spec.rb
index abc1234..def5678 100644
--- a/core/class/allocate_spec.rb
+++ b/core/class/allocate_spec.rb
@@ -10,6 +10,13 @@ klass = Class.allocate
klass.constants.should_not == nil
klass.methods.should_not == nil
+ end
+
+ it "throws an exception when calling a method on a new instance" do
+ klass = Class.allocate
+ lambda do
+ klass.new
+ end.should raise_error(Exception)
end
it "does not call initialize on the new instance" do
|
Add spec for using a class allocated with Class.allocate
|
diff --git a/lib/overcommit/hook/post_checkout/base.rb b/lib/overcommit/hook/post_checkout/base.rb
index abc1234..def5678 100644
--- a/lib/overcommit/hook/post_checkout/base.rb
+++ b/lib/overcommit/hook/post_checkout/base.rb
@@ -6,7 +6,6 @@ extend Forwardable
def_delegators :@context,
- :previous_head, :new_head, :branch_checkout?, :file_checkout?,
- :modified_files
+ :previous_head, :new_head, :branch_checkout?, :file_checkout?
end
end
|
Remove modified_files delegator from PostCheckout::Base
This was done in error in 8ee8707, since `Hook::Base` already defines a
delegator for `modified_files`.
|
diff --git a/dpl.gemspec b/dpl.gemspec
index abc1234..def5678 100644
--- a/dpl.gemspec
+++ b/dpl.gemspec
@@ -22,5 +22,9 @@ s.add_development_dependency 'json'
# prereleases from Travis CI
- s.version = s.version.to_s.succ + ".travis.#{ENV['TRAVIS_JOB_NUMBER']}" if ENV['CI']
+ if ENV['CI']
+ digits.s.version.to_s.split '.'
+ digits[-1] = digits[-1].to_s.succ
+ s.version = digits.join('.') + ".travis.#{ENV['TRAVIS_JOB_NUMBER']}"
+ end
end
|
Fix version numbering when TEENY = 9
|
diff --git a/build_frameworks.rb b/build_frameworks.rb
index abc1234..def5678 100644
--- a/build_frameworks.rb
+++ b/build_frameworks.rb
@@ -0,0 +1,61 @@+#!/usr/bin/env ruby
+
+modules = [
+ "FirebaseAuthUI",
+ "FirebaseAnonymousAuthUI",
+ "FirebaseDatabaseUI",
+ "FirebaseEmailAuthUI",
+ "FirebaseFacebookAuthUI",
+ "FirebaseFirestoreUI",
+ "FirebaseGoogleAuthUI",
+ "FirebaseOAuthUI",
+ "FirebasePhoneAuthUI",
+ "FirebaseStorageUI",
+]
+
+derived_data = %x( pwd ).chomp + "/build/Firebase/"
+
+# system("pod repo update")
+
+# Build all the FirebaseUI frameworks
+for mod in modules do
+ puts("Installing pods for " + mod)
+ xcodebuild = "xcodebuild -workspace #{mod}.xcworkspace -scheme #{mod} -sdk iphonesimulator -derivedDataPath #{derived_data}"
+ command = "cd #{mod} && pod install && #{xcodebuild}"
+ puts("Building: #{command}")
+ value = %x[ #{command} ]
+end
+
+build_dir = derived_data + "Build/Products/Debug-iphonesimulator/"
+
+firebase_dependencies = [
+ "FirebaseAuth", "FirebaseDatabase", "FirebaseFirestore", "FirebaseStorage"
+]
+auth_ui = "FirebaseAuthUI"
+auth_modules = [
+ "FirebaseAnonymousAuthUI",
+ "FirebaseEmailAuthUI",
+ "FirebaseFacebookAuthUI",
+ "FirebaseGoogleAuthUI",
+ "FirebaseOAuthUI",
+ "FirebasePhoneAuthUI",
+]
+
+# Copy built frameworks to root Firebase folder
+for mod in modules do
+ module_path = build_dir + "#{mod}.framework"
+ system("cp -r #{module_path} #{derived_data}")
+ destination_path = "#{derived_data}/#{mod}.framework"
+
+ # Copy FirebaseAuthUI into frameworks that depend on it
+ if auth_modules.include? mod
+ auth_ui_path = build_dir + "#{auth_ui}.framework"
+ system("cp -r #{auth_ui_path} #{destination_path}/#{auth_ui}.framework")
+ end
+
+ # Copy Firebase dependencies into the framework bundle, so they're discoverable by jazzy
+ for dep in firebase_dependencies do
+ dep_path = build_dir + "#{dep}/#{dep}.framework"
+ system("cp -r #{dep_path} #{destination_path}/#{dep}.framework")
+ end
+end
|
Add docs framework build script
|
diff --git a/ruby/billing-time-change.rb b/ruby/billing-time-change.rb
index abc1234..def5678 100644
--- a/ruby/billing-time-change.rb
+++ b/ruby/billing-time-change.rb
@@ -0,0 +1,26 @@+# Billing Time Change (same date) with chargify_api_ares gem
+
+# Sets all billing times to 6:00 AM CDT (UTC -05:00)
+# http://www.timeanddate.com/time/zones/cdt
+# http://ruby-doc.org/core-2.2.1/Time.html
+# https://docs.chargify.com/api-subscriptions
+
+gem 'chargify_api_ares', '=1.3.2'
+require 'chargify_api_ares'
+
+Chargify.configure do |c|
+ c.subdomain = ENV['CHARGIFY_SUBDOMAIN']
+ c.api_key = ENV['CHARGIFY_API_KEY']
+end
+
+subscriptions = Chargify::Subscription.find(:all, params: { per_page: 5, state: "active" } )
+
+puts subscriptions.count
+
+subscriptions.each { |sub|
+ curr_next_billing = sub.next_assessment_at
+ new_next_billing = Time.new curr_next_billing.year, curr_next_billing.month, curr_next_billing.day, 6, 0, 0, "-05:00"
+ sub.next_billing_at = new_next_billing
+ puts "id: #{sub.id} curr: #{curr_next_billing} new: #{new_next_billing}"
+ sub.save
+}
|
Add initial work on billing time change
|
diff --git a/test/models/product_picture_test.rb b/test/models/product_picture_test.rb
index abc1234..def5678 100644
--- a/test/models/product_picture_test.rb
+++ b/test/models/product_picture_test.rb
@@ -1,7 +1,19 @@ require 'test_helper'
class ProductPictureTest < ActiveSupport::TestCase
- # test "the truth" do
- # assert true
- # end
+ setup do
+ @arduino_uno_primary = product_pictures(:arduino_uno_primary_pic)
+ @arduino_uno_pic2 = product_pictures(:arduino_uno_pic2)
+ end
+
+ test "Should match url" do
+ {
+ large: 'https://cdn.sparkfun.com//assets/parts/6/3/4/3/11021-01c.jpg',
+ medium: 'https://cdn.sparkfun.com/r/188-188//assets/parts/6/3/4/3/11021-01c.jpg',
+ small: 'https://cdn.sparkfun.com/r/92-92//assets/parts/6/3/4/3/11021-01c.jpg',
+ thumb: 'https://cdn.sparkfun.com/r/58-58//assets/parts/6/3/4/3/11021-01c.jpg',
+ }.each do |key, val|
+ assert_equal val, @arduino_uno_primary.url(key)
+ end
+ end
end
|
Add tests for ProductPicture model
|
diff --git a/chikka_rails.gemspec b/chikka_rails.gemspec
index abc1234..def5678 100644
--- a/chikka_rails.gemspec
+++ b/chikka_rails.gemspec
@@ -20,4 +20,6 @@
spec.add_development_dependency "bundler", "~> 1.6"
spec.add_development_dependency "rake", "~> 10.0"
+
+ spec.add_dependency "rails"
end
|
Add rails as a dependency
|
diff --git a/config/deploy/production.rb b/config/deploy/production.rb
index abc1234..def5678 100644
--- a/config/deploy/production.rb
+++ b/config/deploy/production.rb
@@ -1,6 +1,7 @@ server ENV['WEB_SERVER'], user: ENV['WEB_USER'], roles: %w{app web}
server ENV['SIDEKIQ_SERVER'], user: ENV['SIDEKIQ_USER'], roles: %w{app}
server ENV['SIDEKIQ_SERVER2'], user: ENV['SIDEKIQ_USER'], roles: %w{app}
+server ENV['SIDEKIQ_SERVER3'], user: ENV['SIDEKIQ_USER'], roles: %w{app}
namespace :deploy do
task :restart do
|
Add a third sidekiq server
|
diff --git a/config/environments/test.rb b/config/environments/test.rb
index abc1234..def5678 100644
--- a/config/environments/test.rb
+++ b/config/environments/test.rb
@@ -34,4 +34,6 @@ config.active_support.deprecation = :stderr
config.active_support.test_order = :random
+
+ config.active_record.raise_in_transactional_callbacks = true
end
|
Enable errors raised in callbacks to be propagated
Clears up another deprecation warning.
|
diff --git a/lib/cactu.rb b/lib/cactu.rb
index abc1234..def5678 100644
--- a/lib/cactu.rb
+++ b/lib/cactu.rb
@@ -2,7 +2,7 @@ dir = File.dirname(__FILE__)
$LOAD_PATH.unshift dir unless $LOAD_PATH.include?(dir)
-load 'cactu/generator.rb'
+require 'cactu/generator'
unless defined?(Sass)
require 'sass'
|
Change the way to require the generator file
|
diff --git a/YumiFacebookSDK/4.26.1/YumiFacebook.podspec b/YumiFacebookSDK/4.26.1/YumiFacebook.podspec
index abc1234..def5678 100644
--- a/YumiFacebookSDK/4.26.1/YumiFacebook.podspec
+++ b/YumiFacebookSDK/4.26.1/YumiFacebook.podspec
@@ -0,0 +1,20 @@+Pod::Spec.new do |s|
+ name = "Facebook"
+ version = "4.26.1"
+
+ s.name = "Yumi#{name}"
+ s.version = version
+ s.summary = "Yumi#{name}."
+ s.description = "Yumi#{name} is the #{name} SDK cocoapods created by Yumimobi"
+ s.homepage = "http://www.yumimobi.com/"
+ s.license = "MIT"
+ s.author = { "Yumimobi sdk team" => "ad-client@zplay.cn" }
+ s.ios.deployment_target = "7.0"
+ s.source = { :http => "http://adsdk.yumimobi.com/iOS/ThirdPartySDK/#{name}/#{name}-#{version}.tar.bz2" }
+ s.frameworks = 'AudioToolbox','StoreKit','CoreGraphics','UIKit','Foundation','Security','CoreImage','AVFoundation','CoreMedia'
+ s.weak_frameworks = 'AdSupport','CoreMotion','SafariServices','WebKit'
+ s.libraries = 'c++','xml2'
+ s.requires_arc = true
+ s.vendored_frameworks = "FBAudienceNetwork.framework"
+ s.preserve_paths = "FBAudienceNetwork.framework"
+end
|
Update facebook sdk is 4.26.1
|
diff --git a/lib/generators/spina_articles/templates/create_spina_articles_table.rb b/lib/generators/spina_articles/templates/create_spina_articles_table.rb
index abc1234..def5678 100644
--- a/lib/generators/spina_articles/templates/create_spina_articles_table.rb
+++ b/lib/generators/spina_articles/templates/create_spina_articles_table.rb
@@ -8,8 +8,8 @@ t.date :publish_date
t.string :author
t.integer :draft, default: true
- t.integer :image_id
t.timestamps
+ t.references :image, foreign_key: { to_table: :spina_images }
end
end
end
|
Update migration for image association
|
diff --git a/spec/sisimai_spec.rb b/spec/sisimai_spec.rb
index abc1234..def5678 100644
--- a/spec/sisimai_spec.rb
+++ b/spec/sisimai_spec.rb
@@ -5,7 +5,15 @@ expect(Sisimai::VERSION).not_to be nil
end
- it 'does something useful' do
- expect(false).to eq(true)
+ it 'does version() method' do
+ expect(Sisimai.version()).to eq(Sisimai::VERSION)
+ end
+
+ it 'does sysname() method' do
+ expect(Sisimai.sysname()).to eq('bouncehammer')
+ end
+
+ it 'does libname() method' do
+ expect(Sisimai.libname()).to eq('Sisimai')
end
end
|
Implement test code for the added methods
|
diff --git a/couch_potato.gemspec b/couch_potato.gemspec
index abc1234..def5678 100644
--- a/couch_potato.gemspec
+++ b/couch_potato.gemspec
@@ -18,6 +18,7 @@
s.add_development_dependency 'rspec', '>=2.0'
s.add_development_dependency 'timecop'
+ s.add_development_dependency 'tzinfo'
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
Add tzinfo gem as development dependency.
This uncovers some failing specs wrt the new time zone support.
|
diff --git a/config/deploy.rb b/config/deploy.rb
index abc1234..def5678 100644
--- a/config/deploy.rb
+++ b/config/deploy.rb
@@ -16,6 +16,7 @@ #server details
default_run_options[:pty] = true
ssh_options[:keys] = [File.join(ENV["HOME"], ".ssh", "app@mhyee.com")]
+ssh_options[:forward_agent] = true
set :deploy_to, "/var/www/wishlist.mhyee.com"
set :deploy_via, :remote_cache
set :user, "app"
@@ -23,7 +24,7 @@
# repo details
set :scm, :git
-set :repository, "git@git.mhyee.com:wishlist.git"
+set :repository, "git@git.mhyee.com:wishlist.git"
set :scm_username, "app"
set :branch, "master"
|
Use app user for git, forward SSH keys
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -4,6 +4,7 @@
match 'api/:action' => 'api'
match 'subscribe/:url' => 'subscribe#confirm'
+ match 'import/finish' => 'import#finish'
match 'import/:url' => 'import#fetch'
match 'about/:url' => 'about#index'
match 'user/:login_name/:action' => 'user'
|
Fix opml import finish routing
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,7 +1,7 @@ Rails.application.routes.draw do
root 'items#index'
-
- get '/users/new', to: 'users#new'
+ get '/users', to: 'users#index'
+ get '/users/new', to: 'users#new', as: 'new_user'
get '/items', to: 'items#index'
get '/items/new', to: 'items#new', as: 'new_item'
|
Create get /users to define path for get /users/new
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -21,6 +21,8 @@ end
end
- mount RailsAdmin::Engine => '/admin', as: 'rails_admin'
+ if (path = ENV['RAILS_ADMIN_PATH']).present?
+ mount RailsAdmin::Engine => path, as: 'rails_admin'
+ end
end
|
Make rails admin optional, enable with config variable.
|
diff --git a/app/controllers/api/timeslots_controller.rb b/app/controllers/api/timeslots_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/api/timeslots_controller.rb
+++ b/app/controllers/api/timeslots_controller.rb
@@ -24,6 +24,16 @@ end
end
+ def destroy
+ @timeslot = Timeslot.find(params[:id])
+ if current_user == @timeslot.tutor && @timeslot.student.nil?
+ @timeslot.destroy
+ render plain: { message: 'success' }
+ else
+ render plain: { messag: 'fail' }
+ end
+ end
+
private
def safe_params
params.permit(:start, :id)
|
Add destroy route to api
|
diff --git a/app/controllers/money_history_controller.rb b/app/controllers/money_history_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/money_history_controller.rb
+++ b/app/controllers/money_history_controller.rb
@@ -1,6 +1,5 @@ class MoneyHistoryController < ApplicationController
expose(:money_histories) { campaign.money_histories }
- expose(:user)
expose(:campaign)
def index
|
Remove user expose from money history controller
|
diff --git a/app/controllers/usermovements_controller.rb b/app/controllers/usermovements_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/usermovements_controller.rb
+++ b/app/controllers/usermovements_controller.rb
@@ -1,39 +1,39 @@ class UsermovementsController < ApplicationController
def index
- @movements = Usermovement.all
+ @usermovements = Usermovement.all
@user = current_user
end
def new
- @movement = Usermovement.new
- @moves = Usermovement.all
+ @usermovement = Usermovement.new
+ @usermoves = Usermovement.all
@user = current_user
end
def create
@user = current_user
- @movement = Usermovement.new(movement_params)
- if @movement.save
- redirect_to movement_path(@movement)
+ @usermovement = Usermovement.new(usermovement_params)
+ if @usermovement.save
+ redirect_to usermovement_path(@usermovement)
else
render :new
end
end
def show
- set_movement
+ set_usermovement
end
def edit
- set_movement
+ set_usermovement
end
def update
- set_movement
- if @movement.update(movement_params)
- redirect_to movement_path(@movement)
+ set_usermovement
+ if @usermovement.update(usermovement_params)
+ redirect_to usermovement_path(@usermovement)
else
render :edit
end
@@ -41,11 +41,11 @@
private
- def set_movement
- @movement = Usermovement.find(params[:id])
+ def set_usermovement
+ @usermovement = Usermovement.find(params[:id])
end
- def movement_params
- params.require(:movement).permit(:name, :date, :result, :pr)
+ def usermovement_params
+ params.require(:usermovement).permit(:name, :date, :result, :pr)
end
end
|
Edit usermovements controller to change @movement to @usermovement
|
diff --git a/emcee.gemspec b/emcee.gemspec
index abc1234..def5678 100644
--- a/emcee.gemspec
+++ b/emcee.gemspec
@@ -19,6 +19,7 @@
s.add_dependency "rails", "~> 4.0"
+ s.add_development_dependency "coffee-rails", "~> 4.0"
s.add_development_dependency "sass", "~> 3.0"
s.add_development_dependency "sqlite3"
end
|
Add development dependency for 'coffee-rails'
For testing coffeescript processing
|
diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/accounts_controller.rb
+++ b/app/controllers/accounts_controller.rb
@@ -12,7 +12,7 @@ def update_information
@account = Account.find @current_user.current_account_id
@account.update(account_params)
- redirect_to user_root
+ redirect_to :user_root
end
def new_information
|
Save the process where description and user_id is set
|
diff --git a/app/decorators/collection_decorator.rb b/app/decorators/collection_decorator.rb
index abc1234..def5678 100644
--- a/app/decorators/collection_decorator.rb
+++ b/app/decorators/collection_decorator.rb
@@ -6,14 +6,19 @@
delegate :exists?, :empty?, to: :collection
- def initialize(collection, decorator: nil)
+ def initialize(collection, decorator: nil, opts: {})
@collection = collection
@decorator = decorator
+ @opts = opts
end
- def each(&block)
+ def each
@collection.each do |item|
- block.call(@decorator.try(:new, item) || item)
+ if @opts.blank?
+ yield(@decorator.try(:new, item) || item)
+ else
+ yield(@decorator.try(:new, item, opts: @opts) || item)
+ end
end
end
end
|
Allow collection decorator to receive arguments to be passed to each decorator
|
diff --git a/app/mailers/woodlock_welcome_mailer.rb b/app/mailers/woodlock_welcome_mailer.rb
index abc1234..def5678 100644
--- a/app/mailers/woodlock_welcome_mailer.rb
+++ b/app/mailers/woodlock_welcome_mailer.rb
@@ -8,6 +8,6 @@
@greeting = "Hi #{user.first_name}! Thanks for your registration."
- mail to: user.email, subject: "#{ Woodlock.site_name } - #{ provider_name } registration success"
+ mail to: user.email, reply_to: Woodlock.site_email, subject: "#{ Woodlock.site_name } - #{ provider_name } registration success"
end
end
|
Add reply_to inside mail class.
|
diff --git a/spec/factories.rb b/spec/factories.rb
index abc1234..def5678 100644
--- a/spec/factories.rb
+++ b/spec/factories.rb
@@ -6,6 +6,10 @@ factory :client do
name 'Example Client'
client_type_id FactoryGirl.create(:client_type).id
+
+ trait :business do
+ client_type FactoryGirl.create(:client_type, name: "Business")
+ end
end
factory :contact_type do
|
Add 'Business' Trait to Client Factory
|
diff --git a/spec/repo_spec.rb b/spec/repo_spec.rb
index abc1234..def5678 100644
--- a/spec/repo_spec.rb
+++ b/spec/repo_spec.rb
@@ -21,7 +21,7 @@ context "should log a message and exit" do
before do
Log.should_receive(:error).once
- repository.stub(:path) { stub }
+ repository.stub(:path) { double.as_null_object }
repository.should_receive(:exit).with(1)
end
let(:dir) { Dir.home } # /Users/username/
|
Fix failing spec in Ruby 1.9.2
|
diff --git a/app/controllers/gobierto_admin/gobierto_dashboards/dashboards_controller.rb b/app/controllers/gobierto_admin/gobierto_dashboards/dashboards_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/gobierto_admin/gobierto_dashboards/dashboards_controller.rb
+++ b/app/controllers/gobierto_admin/gobierto_dashboards/dashboards_controller.rb
@@ -3,6 +3,10 @@ module GobiertoAdmin
module GobiertoDashboards
class DashboardsController < GobiertoAdmin::BaseController
+ before_action { module_enabled!(current_site, "GobiertoDashboards") }
+ before_action { module_allowed!(current_admin, "GobiertoDashboards") }
+ before_action -> { module_allowed_action!(current_admin, current_admin_module, [:manage_dashboards, :view_dashboards]) }
+
layout false
def modal; end
|
Check permissions for dashboards modal action
|
diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb
index abc1234..def5678 100644
--- a/config/initializers/secret_token.rb
+++ b/config/initializers/secret_token.rb
@@ -1,12 +1,17 @@-# Be sure to restart your server when you modify this file.
+# Definitely change this when you deploy to production. Ours is replaced by jenkins.
+# This token is used to secure sessions, we don't mind shipping with one to ease test and debug,
+# however, the stock one should never be used in production, people will be able to crack
+# session cookies.
+#
+# Generate a new secret with "rake secret". Copy the output of that command and paste it
+# in your secret_token.rb as the value of Urgentcy::Application.config.secret_key_base:
+#
+# Urgentcy::Application.config.secret_token = "SET_SECRET_HERE"
-# Your secret key is used for verifying the integrity of signed cookies.
-# If you change this key, all old signed cookies will become invalid!
-
-# Make sure the secret is at least 30 characters and all random,
-# no regular words or you'll be exposed to dictionary attacks.
-# You can use `rake secret` to generate a secure secret key.
-
-# Make sure your secret_key_base is kept private
-# if you're sharing your code publicly.
-Urgentcy::Application.config.secret_key_base = '2e5f48e198e041ea5cfd34040d8cf11591aab44c2e7bc7eb61d5f09dab409fb71d13d10b6c933338e6a0e2f3946fb44f4f040696e97e4673b371c1ca47396158'
+# delete all lines below in production
+if Rails.env.test? || Rails.env.development? || Rails.env == "profile"
+ Urgentcy::Application.config.secret_key_base = '2e5f48e198e041ea5cfd34040d8cf11591aab44c2e7bc7eb61d5f09dab409fb71d13d10b6c933338e6a0e2f3946fb44f4f040696e97e4673b371c1ca47396158'
+else
+ raise "You must set a secret token in ENV['SECRET_TOKEN'] or in config/initializers/secret_token.rb" if ENV['SECRET_TOKEN'].blank?
+ Urgentcy::Application.config.secret_key_base = ENV['SECRET_TOKEN']
+end
|
Use Discourse style secret token management
|
diff --git a/app/views/clients/search.json.jbuilder b/app/views/clients/search.json.jbuilder
index abc1234..def5678 100644
--- a/app/views/clients/search.json.jbuilder
+++ b/app/views/clients/search.json.jbuilder
@@ -1,5 +1,6 @@-json.array!(@clients) do |client|
- json.id client.id
- json.label client.contact.full_name
- json.value client.contact.full_name
-end
+
+ json.array!(@clients) do |client|
+ json.id client.id
+ json.label client.contact.full_name
+ json.value client.contact.full_name
+ end
|
Revert "tidy indent and empty lines"
This reverts commit 1d9b86167d1485dd106a6da7446a81044551e580.
|
diff --git a/examples/journey_planner.rb b/examples/journey_planner.rb
index abc1234..def5678 100644
--- a/examples/journey_planner.rb
+++ b/examples/journey_planner.rb
@@ -7,7 +7,7 @@ summary_rows = planner.plan(
:from => "Peterborough",
:to => "London Kings Cross",
- :time => Time.zone.parse("2010-11-08 03:00")
+ :time => Time.zone.parse(Date.tomorrow.to_s)
)
summary_rows.each do |row|
puts "\nTrain departing at: #{row.departure_time} with #{row.number_of_changes} changes..."
|
Make example more likely to work on any given day.
|
diff --git a/spec/end_view_spec.rb b/spec/end_view_spec.rb
index abc1234..def5678 100644
--- a/spec/end_view_spec.rb
+++ b/spec/end_view_spec.rb
@@ -1,6 +1,12 @@ require 'end_view'
-Dir[File.join(__FILE__, '..', 'examples', '*.rb')].each { |f| require f }
+require_relative 'examples/bar'
+require_relative 'examples/baz'
+require_relative 'examples/fizz'
+require_relative 'examples/foo'
+require_relative 'examples/ham'
+require_relative 'examples/my_layout'
+require_relative 'examples/pop'
describe EndView do
it 'renders a simple template' do
|
Use require_relative to require examples
|
diff --git a/spec/new_time_spec.rb b/spec/new_time_spec.rb
index abc1234..def5678 100644
--- a/spec/new_time_spec.rb
+++ b/spec/new_time_spec.rb
@@ -5,18 +5,32 @@ expect(NewTime::VERSION).not_to be nil
end
- context "For a fixed time and place" do
+ context "For a fixed place" do
let(:latitude) { -33.714955 }
let(:longitude) { 150.311407 }
let(:tz) { "Australia/Sydney" }
- let(:date_time) { DateTime.parse("2015-01-31T14:32:10+11:00") }
describe ".convert" do
- let(:t) { NewTime::NewTime.convert(date_time, latitude, longitude, tz) }
- it { expect(t.hours).to eq 13 }
- it { expect(t.minutes).to eq 10 }
- it { expect(t.seconds).to eq 23 }
- it { expect(t.fractional).to be_within(0.00000001).of(0.999999999992724) }
+ it "00:00:01" do
+ expect(NewTime::NewTime.convert(DateTime.parse("2015-01-31T00:00:01+11:00"), latitude, longitude, tz).to_s).to eq "10:35 pm"
+ end
+
+ it "03:00:00" do
+ expect(NewTime::NewTime.convert(DateTime.parse("2015-01-31T03:00:00+11:00"), latitude, longitude, tz).to_s).to eq "2:06 am"
+ end
+
+ it "14:32:10" do
+ expect(NewTime::NewTime.convert(DateTime.parse("2015-01-31T14:32:10+11:00"), latitude, longitude, tz).to_s).to eq "1:10 pm"
+ end
+
+ it "20:10:00" do
+ expect(NewTime::NewTime.convert(DateTime.parse("2015-01-31T20:10:00+11:00"), latitude, longitude, tz).to_s).to eq "6:07 pm"
+ end
+
+ it "23:59:59" do
+ expect(NewTime::NewTime.convert(DateTime.parse("2015-01-31T23:59:59+11:00"), latitude, longitude, tz).to_s).to eq "10:35 pm"
+ end
+
end
end
end
|
Add more times in tests
|
diff --git a/spec/support/login.rb b/spec/support/login.rb
index abc1234..def5678 100644
--- a/spec/support/login.rb
+++ b/spec/support/login.rb
@@ -6,7 +6,7 @@ end
def current_user
- Person.where(email: 'test.user@digital.moj.gov.uk').first
+ Person.where(email: 'test.user@digital.justice.gov.uk').first
end
def omni_auth_log_in_as(email)
|
Use valid emails in specs
|
diff --git a/workflow/lib/font_awesome.rb b/workflow/lib/font_awesome.rb
index abc1234..def5678 100644
--- a/workflow/lib/font_awesome.rb
+++ b/workflow/lib/font_awesome.rb
@@ -1,7 +1,7 @@ module FontAwesome
def self.icons
- Dir.glob(File.expand_path('./icons/icon-*.png')).map do |path|
- md = /\/icon-(.+)\.png/.match(path)
+ Dir.glob(File.expand_path('./icons/fa-*.png')).map do |path|
+ md = /\/fa-(.+)\.png/.match(path)
(md && md[1]) ? md[1] : nil
end.compact.uniq.sort
end
@@ -17,9 +17,9 @@ {
:uid => '',
:title => icon,
- :subtitle => "Copy to clipboard: icon-#{icon}",
+ :subtitle => "Copy to clipboard: fa-#{icon}",
:arg => icon,
- :icon => { :type => 'default', :name => "./icons/icon-#{icon}.png" },
+ :icon => { :type => 'default', :name => "./icons/fa-#{icon}.png" },
:valid => 'yes',
}
end
|
Change icon's prefix to 'fa-' from 'icon-'
|
diff --git a/Casks/dnscrypt.rb b/Casks/dnscrypt.rb
index abc1234..def5678 100644
--- a/Casks/dnscrypt.rb
+++ b/Casks/dnscrypt.rb
@@ -1,6 +1,6 @@ cask :v1 => 'dnscrypt' do
- version '1.0.8'
- sha256 '47954b33b6133fbc1c8736963797cc342874c25d50a1989990a29bb8c8173d04'
+ version '1.0.9'
+ sha256 '3d264e06ef71a7a57ac313aa99c2d067dd2944cb261726cff843e44953534ca4'
url "https://github.com/alterstep/dnscrypt-osxclient/releases/download/#{version}/dnscrypt-osxclient-#{version}.dmg"
appcast 'https://github.com/alterstep/dnscrypt-osxclient/releases.atom'
|
Upgrade DNSCrypt Proxy to 1.0.9
|
diff --git a/Casks/fontprep.rb b/Casks/fontprep.rb
index abc1234..def5678 100644
--- a/Casks/fontprep.rb
+++ b/Casks/fontprep.rb
@@ -1,10 +1,10 @@ class Fontprep < Cask
- version :latest
- sha256 :no_check
+ version '3.1.1'
+ sha256 '769d64b78d1a8db42dcb02beff6f929670448f77259388c9d01692374be2ec46'
- url 'http://fontprep.com/download'
+ url "https://github.com/briangonzalez/fontprep/releases/download/v3.1.1/FontPrep_#{version}.zip"
homepage 'http://fontprep.com'
- license :unknown
+ license :gpl
app 'FontPrep.app'
end
|
Update Fontprep URL, version, license
URL has changed to Github, requiring to specify version.
|
diff --git a/Casks/akai-lpk25-editor.rb b/Casks/akai-lpk25-editor.rb
index abc1234..def5678 100644
--- a/Casks/akai-lpk25-editor.rb
+++ b/Casks/akai-lpk25-editor.rb
@@ -0,0 +1,7 @@+class AkaiLpk25Editor < Cask
+ url 'http://6be54c364949b623a3c0-4409a68c214f3a9eeca8d0265e9266c0.r0.cf2.rackcdn.com/453/downloads/lpk25_editor_mac_00.zip'
+ homepage 'http://www.akaipro.com/index.php/product/lpk25'
+ version 'latest'
+ no_checksum
+ link 'LPK25_Editor/LPK25 Editor.app'
+end
|
Add Akai LPK25 Keyboard Editor Cask.
|
diff --git a/Casks/omniplan.rb b/Casks/omniplan.rb
index abc1234..def5678 100644
--- a/Casks/omniplan.rb
+++ b/Casks/omniplan.rb
@@ -4,7 +4,7 @@
url 'https://www.omnigroup.com/download/latest/omniplan'
name 'OmniPlan'
- homepage 'http://www.omnigroup.com/products/omniplan/'
+ homepage 'https://www.omnigroup.com/omniplan/'
license :unknown # todo: change license and remove this comment; ':unknown' is a machine-generated placeholder
app 'OmniPlan.app'
|
Fix homepage to use SSL in OmniPlan Cask
The HTTP URL is already getting redirected to HTTPS. Using the HTTPS URL directly
makes it more secure and saves a HTTP round-trip.
|
diff --git a/spec/cloudat/dsl/schedule_spec.rb b/spec/cloudat/dsl/schedule_spec.rb
index abc1234..def5678 100644
--- a/spec/cloudat/dsl/schedule_spec.rb
+++ b/spec/cloudat/dsl/schedule_spec.rb
@@ -1,8 +1,7 @@-require 'rufus-scheduler'
require 'cloudat/dsl/schedule'
describe Cloudat::Dsl::Schedule do
- let(:scheduler) { double(Rufus::Scheduler) }
+ let(:scheduler) { double('TatooineScheduler') }
let(:klass) do
Class.new do
include Cloudat::Dsl::Schedule
|
Remove the external dependency in the spec
|
diff --git a/coinbase-official.podspec b/coinbase-official.podspec
index abc1234..def5678 100644
--- a/coinbase-official.podspec
+++ b/coinbase-official.podspec
@@ -14,7 +14,9 @@ s.platform = :ios, '7.0'
s.requires_arc = true
+ s.source_files = 'Pod/Classes/CoinbaseDefines.[hm]'
s.resources = 'Pod/Assets'
+
s.public_header_files = 'Pod/Classes/**/*.h'
s.frameworks = 'UIKit'
@@ -23,6 +25,6 @@ end
s.subspec 'OAuth' do |ss|
- ss.source_files = 'Pod/Classes/{CoinbaseOAuth,CoinbaseDefines}.[hm]'
+ ss.source_files = 'Pod/Classes/CoinbaseOAuth.[hm]'
end
end
|
Update podspec to remove conflicting files
|
diff --git a/ext/bindex/extconf.rb b/ext/bindex/extconf.rb
index abc1234..def5678 100644
--- a/ext/bindex/extconf.rb
+++ b/ext/bindex/extconf.rb
@@ -1,13 +1,13 @@ require "mkmf"
-case RUBY_VERSION
+case "#{RUBY_VERSION}#{RUBY_PATCHLEVEL}"
when /1\.9\.3/
$CFLAGS << " -D RUBY_193"
$INCFLAGS << " -I./ruby_193/"
when /2\.0\.*/
$CFLAGS << " -D RUBY_20"
$INCFLAGS << " -I./ruby_20/"
-when /2\.1\.*preview\*/
+when "2.1.0-1"
$CFLAGS << " -D RUBY_21preview"
$INCFLAGS << " -I./ruby_21preview/"
when /2\.1\.*/
|
Fix Ruby 2.1.0-preview compile detection
|
diff --git a/mute.gemspec b/mute.gemspec
index abc1234..def5678 100644
--- a/mute.gemspec
+++ b/mute.gemspec
@@ -18,7 +18,9 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]
- spec.add_development_dependency 'bundler', '~> 1.5'
- spec.add_development_dependency 'rake', '~> 10.1.1'
- spec.add_development_dependency 'rspec', '~> 2.14.1'
+ spec.add_development_dependency 'bundler', '~> 1.5'
+ spec.add_development_dependency 'cane', '~> 2.6.1'
+ spec.add_development_dependency 'cane-hashcheck', '~> 1.2.0'
+ spec.add_development_dependency 'rake', '~> 10.1.1'
+ spec.add_development_dependency 'rspec', '~> 2.14.1'
end
|
Add cane and cane-hashcheck to gemspec
|
diff --git a/config/initializers/airbrake.rb b/config/initializers/airbrake.rb
index abc1234..def5678 100644
--- a/config/initializers/airbrake.rb
+++ b/config/initializers/airbrake.rb
@@ -0,0 +1,3 @@+Airbrake.configure do |config|
+ config.api_key = ENV['AIRBRAKE_API_KEY'] || 'b345706d1e61712d474d722c09a04dd2'
+end
|
Add files with secrets that were filtered out.
|
diff --git a/config/initializers/newrelic.rb b/config/initializers/newrelic.rb
index abc1234..def5678 100644
--- a/config/initializers/newrelic.rb
+++ b/config/initializers/newrelic.rb
@@ -0,0 +1,4 @@+# Ensure the agent is started using Unicorn
+# This is needed when using Unicorn and preload_app is not set to true.
+# See http://support.newrelic.com/kb/troubleshooting/unicorn-no-data
+::NewRelic::Agent.after_fork(:force_reconnect => true) if defined? Unicorn
|
Fix NewRelic not getting any data
|
diff --git a/frozen_record.gemspec b/frozen_record.gemspec
index abc1234..def5678 100644
--- a/frozen_record.gemspec
+++ b/frozen_record.gemspec
@@ -22,7 +22,6 @@ spec.add_runtime_dependency 'activemodel'
spec.add_runtime_dependency 'dedup'
- spec.add_development_dependency 'bundler'
spec.add_development_dependency 'rake'
spec.add_development_dependency 'rspec'
spec.add_development_dependency 'pry'
|
Remove bundler as development dependency
|
diff --git a/recipes/default.rb b/recipes/default.rb
index abc1234..def5678 100644
--- a/recipes/default.rb
+++ b/recipes/default.rb
@@ -25,11 +25,10 @@ raise "Unsupported package format: #{pkg_source}"
end
-directory "/etc/gitlab" do
- mode "0700"
-end
+directory "/etc/gitlab"
template "/etc/gitlab/gitlab.rb" do
+ mode "0600"
notifies :run, 'execute[gitlab-ctl reconfigure]'
end
|
Change the permissions of gitlab.rb
|
diff --git a/recipes/opencsw.rb b/recipes/opencsw.rb
index abc1234..def5678 100644
--- a/recipes/opencsw.rb
+++ b/recipes/opencsw.rb
@@ -0,0 +1,26 @@+# Cookbook Name:: pkgutil
+# Recipe:: opencsw
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+pkgutil_repository 'OpenCSW' do
+ mirror 'http://mirror.opencsw.org/opencsw'
+ channel 'stable'
+ verification true
+end
+
+# Update the package catalog
+execute 'pkgutil-update' do
+ command 'pkgutil -U'
+end
|
Create recipe for configuring OpenCSW repo
|
diff --git a/fluent-plugin-kafka.gemspec b/fluent-plugin-kafka.gemspec
index abc1234..def5678 100644
--- a/fluent-plugin-kafka.gemspec
+++ b/fluent-plugin-kafka.gemspec
@@ -13,6 +13,8 @@ gem.name = "fluent-plugin-kafka"
gem.require_paths = ["lib"]
gem.version = '0.3.0'
+ gem.required_ruby_version = ">= 2.1.0"
+
gem.add_dependency "fluentd", [">= 0.10.58", "< 2"]
gem.add_dependency 'ltsv'
gem.add_dependency 'zookeeper'
|
Add ruby version constraint to gemspec
|
diff --git a/lib/detour.rb b/lib/detour.rb
index abc1234..def5678 100644
--- a/lib/detour.rb
+++ b/lib/detour.rb
@@ -15,7 +15,7 @@ end
def valid?
- @start.nil? ? @terminus.nil? : (not @terminus.nil?)
+ @start.nil? ? @terminus.nil? : !!@terminus
end
def invalid?
|
Use !!terminus instead of (not terminus.nil?)
|
diff --git a/cross_validation.gemspec b/cross_validation.gemspec
index abc1234..def5678 100644
--- a/cross_validation.gemspec
+++ b/cross_validation.gemspec
@@ -20,4 +20,5 @@ gem.require_paths = ["lib"]
gem.add_development_dependency('rake', '~> 10.0')
+ gem.add_development_dependency('minitest', '~> 5.4')
end
|
Add minitest as a development dependency
|
diff --git a/lib/Mean.rb b/lib/Mean.rb
index abc1234..def5678 100644
--- a/lib/Mean.rb
+++ b/lib/Mean.rb
@@ -14,8 +14,7 @@ end
def initialize
- @sum = 0
- @sum_of_reciprocals = 0
+ @sum = @sum_of_reciprocals = 0
@product = 1
@count = 0
end
|
Put initialisation on one line
|
diff --git a/lib/feed.rb b/lib/feed.rb
index abc1234..def5678 100644
--- a/lib/feed.rb
+++ b/lib/feed.rb
@@ -2,8 +2,9 @@
class Feed
- DEFAULT_ICON = CONFIG.fetch('default_icon') { 'https://upload.wikimedia.org/wikipedia/en/4/43/Feed-icon.svg' }
- DEFAULT_TITLE = CONFIG.fetch('default_title') { 'RSS' }
+ DEFAULT_ICON = CONFIG.fetch('default_icon') { 'https://upload.wikimedia.org/wikipedia/en/4/43/Feed-icon.svg' }
+ DEFAULT_TITLE = CONFIG.fetch('default_title') { 'RSS' }
+ IGNORE_FIRST_RUN = CONFIG.fetch('ignore_first_run') { true }
attr_reader :icon_url, :last_item, :title, :url
@@ -14,13 +15,14 @@ end
def new_item?
+ first_run = @last_item.nil?
last_fetched_item = fetch.items.first
return false if last_fetched_item.nil? || last_fetched_item.link == @last_item&.link
@last_item = last_fetched_item
- true
+ !(first_run && IGNORE_FIRST_RUN)
end
private
|
Add ability to ignore firt run
|
diff --git a/lib/grid.rb b/lib/grid.rb
index abc1234..def5678 100644
--- a/lib/grid.rb
+++ b/lib/grid.rb
@@ -1,9 +1,19 @@ class Grid
+
+ attr_reader :map, :background
def initialize(window, user, map, tileset, map_key, background)
@window, @user = window, user
@map = Map.new(window, map, tileset, map_key)
@background = Gosu::Image.new(window, background, false)
+ end
+
+ def update
+ @map.update
+ end
+
+ def draw
+ @map.draw
end
def start
|
Move more methods to Grid
|
diff --git a/lib/haml.rb b/lib/haml.rb
index abc1234..def5678 100644
--- a/lib/haml.rb
+++ b/lib/haml.rb
@@ -18,6 +18,13 @@
end
+# check for a compatible Rails version when Haml is loaded
+if defined?(Rails) && (actionpack_spec = Gem.loaded_specs['actionpack'])
+ if actionpack_spec.version.to_s < '3.2'
+ raise Exception.new("\n\n** Haml now requires Rails 3.2 and later. Use Haml version 4.0.4\n\n")
+ end
+end
+
require 'haml/util'
require 'haml/engine'
require 'haml/railtie' if defined?(Rails::Railtie)
|
Add runtime check for compatible Rails version
Since Rails is not a runtime dependency of Haml in the gemspec, Haml
4.1+ is not prevented from being used with Rails <3.2. The best we can
do is raise an error if someone tries to include Haml 4.1+ with Rails
<3.2.
|
diff --git a/lib/msgr.rb b/lib/msgr.rb
index abc1234..def5678 100644
--- a/lib/msgr.rb
+++ b/lib/msgr.rb
@@ -4,6 +4,7 @@ require 'active_support/core_ext/object/blank'
require 'active_support/core_ext/module/delegation'
require 'active_support/core_ext/string/inflections'
+require 'active_support/core_ext/hash/reverse_merge'
require 'msgr/logging'
require 'msgr/binding'
@@ -22,22 +23,20 @@ module Msgr
class << self
+ attr_accessor :client
+ delegate :publish, to: :client
+
def logger
- @logger ||= Logger.new($stdout).tap do |logger|
- logger.level = Logger::Severity::INFO
+ if @logger.nil?
+ @logger = Logger.new $stdout
+ @logger.level = Logger::Severity::INFO
end
+
+ @logger
end
def logger=(logger)
@logger = logger
end
-
- def start
- # stub
- end
-
- def publish
- # stub
- end
end
end
|
Improve logger setting. Set to false to disable logging.
|
diff --git a/lib/tado.rb b/lib/tado.rb
index abc1234..def5678 100644
--- a/lib/tado.rb
+++ b/lib/tado.rb
@@ -14,6 +14,7 @@ @api_client.getCurrentState.each do |k, v|
puts "#{k} : #{v}"
end
+ "\n"
end
|
Return empty line instead of one more hash dump.
|
diff --git a/lib/susy.rb b/lib/susy.rb
index abc1234..def5678 100644
--- a/lib/susy.rb
+++ b/lib/susy.rb
@@ -2,13 +2,3 @@ Compass::Frameworks.register('susy',
:stylesheets_directory => File.join(File.dirname(__FILE__), '..', 'sass'),
:templates_directory => File.join(File.dirname(__FILE__), '..', 'templates'))
-
-module Sass::Script::Functions
-
- # Convert a grid piece from strings to numbers
- def grid_to_numbers(piece)
- items = piece.to_s.split(' ')
- Sass::Script::List.new(items.map{|i| Sass::Script::Number.new(i.to_f)}, :comma)
- end
-
-end
|
Remove unused grid_to_numbers ruby function
|
diff --git a/config/initializers/s3.rb b/config/initializers/s3.rb
index abc1234..def5678 100644
--- a/config/initializers/s3.rb
+++ b/config/initializers/s3.rb
@@ -1,4 +1,5 @@ AWS::S3::Base.establish_connection!(
- :access_key_id => ENV['AMAZON_ACCESS_KEY_ID'],
- :secret_access_key => ENV['AMAZON_SECRET_ACCESS_KEY']
+ :access_key_id => ENV['AMAZON_ACCESS_KEY_ID'],
+ :secret_access_key => ENV['AMAZON_SECRET_ACCESS_KEY'],
+ :persistent => false
)
|
Change S3 connection persistence to false
|
diff --git a/http-protocol.gemspec b/http-protocol.gemspec
index abc1234..def5678 100644
--- a/http-protocol.gemspec
+++ b/http-protocol.gemspec
@@ -1,6 +1,6 @@ Gem::Specification.new do |s|
s.name = "http-protocol"
- s.version = '0.1.2'
+ s.version = '0.1.3'
s.summary = "HTTP protocol library designed to facilitate custom HTTP clients"
s.description = ' '
|
Package version is increased from 0.1.2 to 0.1.3
|
diff --git a/lib/routes.rb b/lib/routes.rb
index abc1234..def5678 100644
--- a/lib/routes.rb
+++ b/lib/routes.rb
@@ -14,9 +14,10 @@
use Pliny::Router do
# mount all endpoints here
+ mount Endpoints::Login
+ mount Endpoints::Grades
end
# root app; but will also handle some defaults like 404
run Endpoints::Root
- run Endpoints::Login
end
|
Use mount instead run. :see_no_evil:
|
diff --git a/lib/mues.rb b/lib/mues.rb
index abc1234..def5678 100644
--- a/lib/mues.rb
+++ b/lib/mues.rb
@@ -16,7 +16,7 @@ #
# == Rcsid
#
-# $Id: mues.rb,v 1.26 2002/09/12 09:59:49 deveiant Exp $
+# $Id: mues.rb,v 1.27 2003/04/21 03:32:42 deveiant Exp $
#
# == Authors
#
@@ -29,6 +29,8 @@ # Please see the file COPYRIGHT for licensing details.
#
+require 'rbconfig'
+
# The base namespace under which all MUES components exist.
module MUES ; end
@@ -36,7 +38,7 @@ fail "MUES requires at least Ruby 1.7.2. This is #{RUBY_VERSION}."
end
-require 'mues.so'
+require "mues.#{Config::CONFIG['DLEXT']}"
require 'mues/Engine'
|
Fix the assumption that dynamic libraries will end in '.so'.
--HG--
extra : convert_revision : svn%3A39a105f4-52d6-0310-bb1b-d6517044f2e4/trunk%401027
|
diff --git a/deploy/before_migrate.rb b/deploy/before_migrate.rb
index abc1234..def5678 100644
--- a/deploy/before_migrate.rb
+++ b/deploy/before_migrate.rb
@@ -1,12 +1,16 @@ Chef::Log.info("Running deploy/before_migrate.rb...")
-
+
+Chef::Log.info("Symlinking #{release_path}/public/assets to #{new_resource.deploy_to}/shared/assets")
+
+link "#{release_path}/public/assets" do
+ to "#{new_resource.deploy_to}/shared/assets"
+end
+
rails_env = new_resource.environment["RAILS_ENV"]
-Chef::Log.info("Precompiling assets for #{rails_env}...")
-
-current_release = release_path
-
+Chef::Log.info("Precompiling assets for RAILS_ENV=#{rails_env}...")
+
execute "rake assets:precompile" do
- cwd current_release
- command "bundle exec rake assets:precompile --trace"
+ cwd release_path
+ command "bundle exec rake assets:precompile"
environment "RAILS_ENV" => rails_env
end
|
Deploy assets to a shared/assets path on Opsworks.
|
diff --git a/lib/troo.rb b/lib/troo.rb
index abc1234..def5678 100644
--- a/lib/troo.rb
+++ b/lib/troo.rb
@@ -11,6 +11,7 @@ @logger ||= Logger.new('logs/troo.log')
end
+ # RestClient.log = 'logs/restclient.log'
# Trello.logger = Logger.new("logs/trello.log")
Trello.configure do |trello|
trello.consumer_key = Troo::Configuration.api_key
|
Add commented out RestClient logger for debugging.
|
diff --git a/Library/Formula/gnu-typist.rb b/Library/Formula/gnu-typist.rb
index abc1234..def5678 100644
--- a/Library/Formula/gnu-typist.rb
+++ b/Library/Formula/gnu-typist.rb
@@ -1,6 +1,6 @@ require 'formula'
-class Gtypist <Formula
+class GnuTypist <Formula
url 'http://ftp.gnu.org/gnu/gtypist/gtypist-2.8.3.tar.bz2'
homepage 'http://www.gnu.org/software/gtypist/'
md5 '43be4b69315a202cccfed0efd011d66c'
|
Fix name of GNU Typist
|
diff --git a/Library/Formula/clojure.rb b/Library/Formula/clojure.rb
index abc1234..def5678 100644
--- a/Library/Formula/clojure.rb
+++ b/Library/Formula/clojure.rb
@@ -13,8 +13,13 @@ def script
<<-EOS
#!/bin/sh
-# Run Clojure.
-exec java -cp "#{prefix}/#{jar}" clojure.main "$@"
+# Runs clojure.
+# With no arguments, runs Clojure's REPL.
+
+# resolve links - $0 may be a softlink
+CLOJURE=$CLASSPATH:$(brew --cellar)/#{name}/#{version}/#{jar}
+
+java -cp $CLOJURE clojure.main "$@"
EOS
end
|
Revert "Simplify `clj` script and fix some quoting."
This reverts commit fc6f2c88fd080025f128f300c98ce4a66ed3365b.
|
diff --git a/spock.gemspec b/spock.gemspec
index abc1234..def5678 100644
--- a/spock.gemspec
+++ b/spock.gemspec
@@ -1,5 +1,10 @@ # -*- encoding: utf-8 -*-
-require File.expand_path('../lib/spock/version', __FILE__)
+if RUBY_VERSION == '1.8.7'
+ $:.unshift File.expand_path("../lib", __FILE__)
+ require "spock/version"
+else
+ require File.expand_path('../lib/spock/version', __FILE__ )
+end
Gem::Specification.new do |gem|
gem.authors = ["Andres Riofrio"]
|
Fix warning for initialized constant VERSION
https://github.com/eventmachine/eventmachine/pull/284
|
diff --git a/spec/web_spec.rb b/spec/web_spec.rb
index abc1234..def5678 100644
--- a/spec/web_spec.rb
+++ b/spec/web_spec.rb
@@ -19,6 +19,12 @@ expect(last_response).to be_ok
expect(last_response.body).to include @test_job_id
end
+
+ it "should show a error mark when a job is unhealthy" do
+ @test_job.update(healthy: false)
+ get '/'
+ expect(last_response.body).to include "Error"
+ end
end
describe "/job/:id" do
@@ -28,5 +34,11 @@ expect(last_response.body).to include @test_job_id
expect(last_response.body).to include @test_job_log
end
+
+ it "should show a message about the unhealthy job" do
+ @test_job.update(healthy: false)
+ get "/job/#{@test_job.id}"
+ expect(last_response.body).to include "An error occurs during the last execution of this job"
+ end
end
end
|
Add specs to test error marks
|
diff --git a/test/test_page.rb b/test/test_page.rb
index abc1234..def5678 100644
--- a/test/test_page.rb
+++ b/test/test_page.rb
@@ -5,6 +5,8 @@ require 'helper'
describe 'Page' do
+ before { test_site.scan_files }
+
subject do
path = File.join(test_site.source_paths[:pages], 'about', 'index.markdown')
Dimples::Page.new(test_site, path)
@@ -16,7 +18,7 @@ end
it 'renders its contents' do
- expected_output = render_template('page')
+ expected_output = read_fixture('pages/about')
subject.render.must_equal(expected_output)
end
|
Switch to calling read_fixture, and have the test site scan its files.
|
diff --git a/lib/CheckfrontAPI/client.rb b/lib/CheckfrontAPI/client.rb
index abc1234..def5678 100644
--- a/lib/CheckfrontAPI/client.rb
+++ b/lib/CheckfrontAPI/client.rb
@@ -1,6 +1,7 @@ require 'dotenv'
require 'net/http'
require 'yaml'
+require 'json'
Dotenv.load
module CheckfrontAPI
@@ -11,7 +12,8 @@ API_SECRET = ENV["API_SECRET"]
def self.test_connection
- uri = URI(API_ENDPOINT)
+ uri = URI(API_ENDPOINT + 'ping')
+ puts uri
res = Net::HTTP.get_response(uri)
res.body
end
@@ -23,5 +25,5 @@ end
if __FILE__ == $PROGRAM_NAME
- puts CheckfrontAPI::Client.test_connection
+ puts JSON.pretty_generate(JSON.parse(CheckfrontAPI::Client.test_connection))
end
|
Use Ping endpoint for test_connection method
- Also improve console output of response.
|
diff --git a/lib/activeadmin-sortable.rb b/lib/activeadmin-sortable.rb
index abc1234..def5678 100644
--- a/lib/activeadmin-sortable.rb
+++ b/lib/activeadmin-sortable.rb
@@ -18,7 +18,7 @@
def sortable_handle_column
column '' do |resource|
- sort_url = url_for([:sort, ActiveAdmin.application.default_namespace, resource])
+ sort_url = "#{resource_path(resource)}/sort"
content_tag :span, HANDLE, :class => 'handle', 'data-sort-url' => sort_url
end
end
|
Use resource_path for sort url to make sorting work with different namespaces and activeadmin resources that belong to another
|
diff --git a/config/application.rb b/config/application.rb
index abc1234..def5678 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -26,7 +26,7 @@
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
- # config.i18n.default_locale = :de
+ config.i18n.default_locale = :ja
# Do not swallow errors in after_commit/after_rollback callbacks.
config.active_record.raise_in_transactional_callbacks = true
|
Set I18n default locale as :ja
|
diff --git a/lib/bx_wiki_macros.rb b/lib/bx_wiki_macros.rb
index abc1234..def5678 100644
--- a/lib/bx_wiki_macros.rb
+++ b/lib/bx_wiki_macros.rb
@@ -1,5 +1,6 @@ # coding: utf-8
Redmine::WikiFormatting::Macros.register do
+ desc "Links to resource page.\n_Example:_\n\n {{bx_resource(3)}}"
macro :bx_resource do |obj, args|
resource_id = args.first
resource = BxResourceNode.where(:id => resource_id).first
@@ -11,6 +12,7 @@ ""
end
end
+ desc "Links to table definition page.\n_Example:_\n\n {{bx_table(3)}}"
macro :bx_table do |obj, args|
table_def_id = args.first
table_def = BxTableDef.where(:id => table_def_id).first
|
Add descriptions to Wiki macros
|
diff --git a/config/deploy/feat.rb b/config/deploy/feat.rb
index abc1234..def5678 100644
--- a/config/deploy/feat.rb
+++ b/config/deploy/feat.rb
@@ -1,14 +1,30 @@-set :stage, :prod
+set :stage, :feat
-set :deploy_to, '/home/unipept/rails'
+set :deploy_to, '/home/bmesuere/rails'
# don't specify db as it's not needed for unipept
-server 'unipeptweb.ugent.be', user: 'unipept', roles: %i[web app], ssh_options: {
- port: 22
+server 'morty.ugent.be', user: 'unipept', roles: %i[web app], ssh_options: {
+ port: 4840
}
-set :branch, 'fix/update_api_url'
+set :branch, 'documentation/unipept-desktop'
set :rails_env, :production
+
+# Perform yarn install before precompiling the assets in order to pass the
+# integrity check.
+namespace :deploy do
+ namespace :assets do
+ before :precompile, :yarn_install do
+ on release_roles(fetch(:assets_roles)) do
+ within release_path do
+ with rails_env: fetch(:rails_env) do
+ execute :yarn, "install"
+ end
+ end
+ end
+ end
+ end
+end
namespace :deploy do
before :publishing, :asset_stuff do
|
Revert changes to Capistrano config
|
diff --git a/lib/ci/api/helpers.rb b/lib/ci/api/helpers.rb
index abc1234..def5678 100644
--- a/lib/ci/api/helpers.rb
+++ b/lib/ci/api/helpers.rb
@@ -4,7 +4,9 @@ UPDATE_RUNNER_EVERY = 60
def check_enable_flag!
- not_found! unless current_application_settings.ci_enabled
+ unless current_application_settings.ci_enabled
+ render_api_error!('400 (Bad request) CI is disabled', 400)
+ end
end
def authenticate_runners!
|
Use 400 to notify that CI API is disabled
|
diff --git a/lib/gazette/client.rb b/lib/gazette/client.rb
index abc1234..def5678 100644
--- a/lib/gazette/client.rb
+++ b/lib/gazette/client.rb
@@ -16,25 +16,25 @@
# Attempts to authenticate
def authenticate
- case request(:authenticate, request_options)
+ parse_response_for request(:authenticate)
+ end
+
+ # Adds a URL to a user's instapaper account
+ def add(url, options = {})
+ parse_response_for request(:authenticate, options.merge(:url => url))
+ end
+
+ private
+
+ # Handles the response from Instapaper
+ def parse_response_for(request)
+ case request
when Net::HTTPOK then return Response::Success.new
when Net::HTTPForbidden then raise Response::InvalidCredentials
when Net::HTTPInternalServerError then raise Response::ServerError
else raise Response::UnknownError
end
end
-
- # Adds a URL to a user's instapaper account
- def add(url, options = {})
- case request(:add, options.merge(:url => url))
- when Net::HTTPOK then return Response::Success.new
- when Net::HTTPForbidden then raise Response::InvalidCredentials
- when Net::HTTPInternalServerError then raise Response::ServerError
- else raise Response::UnknownError
- end
- end
-
- private
# Actually heads out to the internet and performs the request
def request(method, params = {})
@@ -45,13 +45,5 @@ http.start { http.request(request) }
end
- # Build options for the request based on what's passed in
- def request_options
- Hash.new.tap do |hash|
- hash[:username] if @username
- hash[:password] if @password
- end
- end
-
end
end
|
Refactor of request/response handling to DRY things up
|
diff --git a/lib/import/pftrack.rb b/lib/import/pftrack.rb
index abc1234..def5678 100644
--- a/lib/import/pftrack.rb
+++ b/lib/import/pftrack.rb
@@ -37,10 +37,8 @@ num_of_keyframes = first_tracker_line.to_i
t.keyframes = (1..num_of_keyframes).map do | keyframe_idx |
report_progress("Reading keyframe #{keyframe_idx} of #{num_of_keyframes} in #{t.name}")
- Tracksperanto::Keyframe.new do |k|
- f, x, y, residual = io.gets.chomp.split
- k.frame, k.abs_x, k.abs_y, k.residual = f, x, y, residual
- end
+ f, x, y, residual = io.gets.chomp.split
+ Tracksperanto::Keyframe.new(:frame => f, :abs_x => x, :abs_y => y, :residual => residual.to_f * 8)
end
end
end
|
Revert PFTrack residual computation on import
|
diff --git a/lib/kaminari-cells.rb b/lib/kaminari-cells.rb
index abc1234..def5678 100644
--- a/lib/kaminari-cells.rb
+++ b/lib/kaminari-cells.rb
@@ -19,6 +19,5 @@ end
end
end
+ require 'kaminari/cells'
end
-
-require 'kaminari/cells'
|
Move require of kaminari/cells into ActionView load hook
Previously when eager loading a rails application using zeitwerk, the
Kaminari::Helpers::CellsHelper module was included before it was defined
by the load hook.
|
diff --git a/rails/init.rb b/rails/init.rb
index abc1234..def5678 100644
--- a/rails/init.rb
+++ b/rails/init.rb
@@ -1,5 +1,7 @@ # Register helpers for Rails < 3
require File.join(File.dirname(__FILE__), *%w[.. lib i18n_rails_helpers])
+ActionView::Base.send :include, I18nRailsHelpers
require File.join(File.dirname(__FILE__), *%w[.. lib contextual_link_helpers])
-ActionView::Base.send :include, I18nRailsHelpers
ActionView::Base.send :include, ContextualLinkHelpers
+require File.join(File.dirname(__FILE__), *%w[.. lib list_link_helpers.rb])
+ActionView::Base.send :include, ListLinkHelpers
|
Add support for Rails <3 for list_link_helpers.rb
|
diff --git a/lib/pronto/rubocop.rb b/lib/pronto/rubocop.rb
index abc1234..def5678 100644
--- a/lib/pronto/rubocop.rb
+++ b/lib/pronto/rubocop.rb
@@ -10,11 +10,8 @@ def run(diffs)
return [] unless diffs && diffs.any?
- working_dir = diffs.first.repo.working_dir
diffs.map do |diff|
- full_b_path = File.join(working_dir, diff.b_path)
-
- @cli.inspect_file(full_b_path)
+ @cli.inspect_file(diff.full_b_path)
end
end
end
|
Use the newly added full_b_path method on grit diff
|
diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rake
index abc1234..def5678 100644
--- a/lib/tasks/assets.rake
+++ b/lib/tasks/assets.rake
@@ -19,7 +19,7 @@
# Critical to manually copy non js/css assets to public/assets as we don't want to fingerprint them
sh 'cp -rf app/assets/webpack/*.woff* app/assets/webpack/*.svg app/assets/webpack/*.ttf '\
- 'app/assets/webpack/*.eot* public/assets'
+ 'app/assets/webpack/*.eot* app/assets/webpack/*.png public/assets'
# TODO: We should be gzipping these
end
|
Include .png file types in webpack precompilation task
|
diff --git a/test/test_filter.rb b/test/test_filter.rb
index abc1234..def5678 100644
--- a/test/test_filter.rb
+++ b/test/test_filter.rb
@@ -13,16 +13,10 @@ end
# Tests
- def test_empty
- assert_file 'empty.html'
- end
-
- def test_empty_nodes
- assert_file 'empty_nodes.html'
- end
-
- def test_strip
- assert_file 'strip.html'
+ def test_filtered
+ Dir.glob("test/expected/*.html") do |path|
+ assert_file File.basename(path)
+ end
end
end
|
Test all filtered files at once
|
diff --git a/lib/adapters/irc/message.rb b/lib/adapters/irc/message.rb
index abc1234..def5678 100644
--- a/lib/adapters/irc/message.rb
+++ b/lib/adapters/irc/message.rb
@@ -17,7 +17,9 @@ end
def reply(text)
- @origin.send "PRIVMSG #{@channel} :#{text}"
+ text.split("\n").each do |line|
+ @origin.send "PRIVMSG #{@channel} :#{line}"
+ end
end
def args
|
Add newline support for IRC
|
diff --git a/ci_environment/clang/attributes/tarball.rb b/ci_environment/clang/attributes/tarball.rb
index abc1234..def5678 100644
--- a/ci_environment/clang/attributes/tarball.rb
+++ b/ci_environment/clang/attributes/tarball.rb
@@ -1,5 +1,5 @@-default['clang']['version'] = '3.4.2'
+default['clang']['version'] = '3.5.0'
-default['clang']['download_url'] = "http://llvm.org/releases/#{node['clang']['version']}/clang+llvm-#{node['clang']['version']}-x86_64-linux-gnu-ubuntu-14.04.xz"
+default['clang']['download_url'] = "http://llvm.org/releases/#{node['clang']['version']}/clang+llvm-#{node['clang']['version']}-x86_64-linux-gnu-ubuntu-14.04.tar.xz"
default['clang']['extension'] = 'tar.xz'
-default['clang']['checksum'] = 'ef0d8faeb31c731b46ef5859855766ec7eb71f9a32cc6407ac5ddb4ccc35c3dc'
+default['clang']['checksum'] = 'b9b420b93d7681bb2b809c3271ebdf4389c9b7ca35a781c7189d07d483d8f201'
|
Update LLVM to 3.5.0 (Trusty only)
|
diff --git a/app.rb b/app.rb
index abc1234..def5678 100644
--- a/app.rb
+++ b/app.rb
@@ -1,6 +1,36 @@ require 'rubygems'
require 'sinatra'
+require 'open-uri'
+require 'nokogiri'
+
+URL = 'http://dv.njtransit.com/mobile/tid-mobile.aspx?SID=NY&SORT=A'
get '/' do
erb :'index.html'
end
+
+get %r{/(\d{4})$} do |train|
+ "#{train_status(train)}"
+end
+
+def train_status(train_number)
+ doc = Nokogiri::HTML(open(URL, "User-Agent" => "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:23.0) Gecko/20100101 Firefox/23.0"))
+
+ rows = doc.xpath('//tr').drop(2)
+
+ rows.each do |row|
+ data = row.children.map(&:content).map(&:strip)
+ if data[8] == train_number
+ return {
+ time: data[0],
+ destination: data[2],
+ track: data[4],
+ line: data[6],
+ train: data[8],
+ status: data[10]
+ }
+ end
+ end
+
+ { error: 'Unavailable' }
+end
|
Add function to scrape NJTransit site for train info
|
diff --git a/app/models/user_session.rb b/app/models/user_session.rb
index abc1234..def5678 100644
--- a/app/models/user_session.rb
+++ b/app/models/user_session.rb
@@ -1,5 +1,5 @@ class UserSession < Authlogic::Session::Base
- authenticate_with InvisionUser
+ authenticate_with InvisionBridge::InvisionUser
last_request_at_threshold 1.minute
params_key 'api_key'
end
|
Change authenticate_with call to InvisionBridge
|
diff --git a/spec/centos/network_spec.rb b/spec/centos/network_spec.rb
index abc1234..def5678 100644
--- a/spec/centos/network_spec.rb
+++ b/spec/centos/network_spec.rb
@@ -7,3 +7,18 @@ it { should be_reachable }
it { should be_resolvable }
end
+
+
+describe file('/etc/sysconfig/network-scripts/ifcfg-eth0') do
+ it { should be_file }
+ it { should contain 'DEVICE="eth0"' }
+ it { should contain 'ONBOOT="yes"' }
+ it { should contain 'BOOTPROTO="dhcp"' }
+end
+
+describe file('/etc/sysconfig/network-scripts/ifcfg-eth1') do
+ it { should be_file }
+ it { should contain 'DEVICE="eth1"' }
+ it { should contain 'ONBOOT="yes"' }
+ it { should contain 'BOOTPROTO="dhcp"' }
+end
|
MAke sure eth0 and eth1 are properly configured
|
diff --git a/spec/hashicorptools_spec.rb b/spec/hashicorptools_spec.rb
index abc1234..def5678 100644
--- a/spec/hashicorptools_spec.rb
+++ b/spec/hashicorptools_spec.rb
@@ -2,6 +2,7 @@
describe "Hashicorptools" do
it "fails" do
+ pending
fail "hey buddy, you should probably rename this file and start specing for real"
end
end
|
Put dummy spec on pending instead of failing
|
diff --git a/lib/openxml/docx/elements/number.rb b/lib/openxml/docx/elements/number.rb
index abc1234..def5678 100644
--- a/lib/openxml/docx/elements/number.rb
+++ b/lib/openxml/docx/elements/number.rb
@@ -15,7 +15,6 @@ end
value_property :abstract_number_id
- value_property :lvl_override, as: :level_override
def property_xml(xml)
props = properties.keys.map(&method(:send)).compact
|
Remove level_override: it is not a property, it is a child element
|
diff --git a/spec/requests/pages_spec.rb b/spec/requests/pages_spec.rb
index abc1234..def5678 100644
--- a/spec/requests/pages_spec.rb
+++ b/spec/requests/pages_spec.rb
@@ -19,13 +19,13 @@ expect(page).to have_content 'Team'
end
end
- describe "GET /open-data", type: :request do
+ describe "GET /open-data", type: :request, elasticsearch: true do
it "renders successfully when logged out" do
visit data_path
expect(page).to have_content 'Open Data'
end
end
- describe "GET /experiments", type: :request do
+ describe "GET /experiments", type: :request, elasticsearch: true do
it "renders successfully when logged out" do
visit data_path
expect(page).to have_content 'Experiments'
|
Fix a couple of test failures
|
diff --git a/lib/pah/templates/canonical_host.rb b/lib/pah/templates/canonical_host.rb
index abc1234..def5678 100644
--- a/lib/pah/templates/canonical_host.rb
+++ b/lib/pah/templates/canonical_host.rb
@@ -4,9 +4,9 @@ def call
rack_canonical = <<CANONICAL
- #Run heroku config:add CANONICAL_HOST=yourdomain.com
- #For more information, see: https://github.com/tylerhunt/rack-canonical-host#usage
- use Rack::CanonicalHost, ENV['CANONICAL_HOST'] if ENV['CANONICAL_HOST']
+#Run heroku config:add CANONICAL_HOST=yourdomain.com
+#For more information, see: https://github.com/tylerhunt/rack-canonical-host#usage
+use Rack::CanonicalHost, ENV['CANONICAL_HOST'] if ENV['CANONICAL_HOST']
CANONICAL
inject_into_file 'config.ru', rack_canonical, after: "require ::File.expand_path('../config/environment', __FILE__)", verbose: false
|
Fix identation of conanical host
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.