diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/app/models/concerns/searchable.rb b/app/models/concerns/searchable.rb
index abc1234..def5678 100644
--- a/app/models/concerns/searchable.rb
+++ b/app/models/concerns/searchable.rb
@@ -3,14 +3,18 @@ Mongoid::Elasticsearch.autocreate_indexes = false
Mongoid::Elasticsearch.prefix = ENV["MONGOID_ENVIRONMENT"] || ""
+if ENV["ELASTICSEARCH_URL"]
+ Mongoid::Elasticsearch.client_options = { url: ENV["ELASTICSEARCH_URL"] }
+end
+
module Searchable
-
+
extend ActiveSupport::Concern
-
+
included do
-
+
include Mongoid::Elasticsearch
-
+
elasticsearch!({
index_options: {
settings:{
@@ -38,11 +42,11 @@ }
}
})
-
+
# Do something like #name_prefix_search('FOR') to get everything starting with FOR
def self.name_prefix_search(str)
es.search(index: es.index.name, body: {query: {match_phrase_prefix: {name: str}}})
- end
-
- end
-end+ end
+
+ end
+end
|
Add elasticsearch config to gem
|
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -6,9 +6,11 @@ when 'plos'
'logo.plos-alm.png'
when 'default'
- 'logo.alm.png'
+ (image_tag 'logo.alm.svg',
+ alt: 'Public Library of Science', height: '48px') +
+ (content_tag(:strong, 'ALM')+ " Reports")
end
- image_tag src, :alt => 'Public Library of Science'
+
end
def footer_logo
@@ -38,7 +40,7 @@ })();
SCRIPT
when 'default'
- stylesheet_link_tag 'http://fonts.googleapis.com/css?family=Fira+Sans:300,400,700'
+ stylesheet_link_tag 'http://fonts.googleapis.com/css?family=Fira+Sans:300,500,300italic,500italic'
end
end
end
|
Add a lighter variant of Fira Sans, change logo to use SVG.
|
diff --git a/app/models/build/notifications.rb b/app/models/build/notifications.rb
index abc1234..def5678 100644
--- a/app/models/build/notifications.rb
+++ b/app/models/build/notifications.rb
@@ -22,11 +22,12 @@ protected
def emails_enabled?
- notifications.blank? ? true : !emails_disabled?
+ return notifications[:email] if notifications.has_key?(:email)
+ # TODO deprecate disabled and disable
+ [:disabled, :disable].each {|key| return !notifications[key] if notifications.has_key?(key) }
+ true
end
- def emails_disabled?
- notifications[:email] == false || notifications[:disabled] || notifications[:disable] # TODO deprecate disabled and disable
end
def verbose?
|
Use 'Hash.has_key?' method to see if default values should be set. emails_disabled? method was a workaround and is not used anywhere else.
|
diff --git a/app/models/unpublishing_reason.rb b/app/models/unpublishing_reason.rb
index abc1234..def5678 100644
--- a/app/models/unpublishing_reason.rb
+++ b/app/models/unpublishing_reason.rb
@@ -3,6 +3,10 @@
attr_accessor :id, :name, :as_sentence
+ PUBLISHED_IN_ERROR_ID = 1
+ CONSOLIDATED_ID = 4
+ WITHDRAWN_ID = 5
+
PublishedInError = create(id: 1, name: 'Published in error', as_sentence: 'it was published in error')
Consolidated = create(id: 4, name: 'Consolidated into another GOV.UK page', as_sentence: 'it has been consolidated into another GOV.UK page')
Withdrawn = create(id: 5, name: 'No longer current government policy/activity', as_sentence: 'it is no longer current government policy/activity')
|
Add constants for `UnpublishingReason` ids
Convenience to avoid non-idiomatic `UnpublishingReason::Withdrawn.id`
|
diff --git a/lib/rails3_datamapper/railtie.rb b/lib/rails3_datamapper/railtie.rb
index abc1234..def5678 100644
--- a/lib/rails3_datamapper/railtie.rb
+++ b/lib/rails3_datamapper/railtie.rb
@@ -19,6 +19,9 @@ class Railtie < Rails::Railtie
plugin_name :data_mapper
+
+ config.generators.orm = :datamapper
+
rake_tasks do
load 'rails3_datamapper/railties/database.rake'
|
Set the default ORM generator to :datamapper
|
diff --git a/lib/protobuf/active_record/railtie.rb b/lib/protobuf/active_record/railtie.rb
index abc1234..def5678 100644
--- a/lib/protobuf/active_record/railtie.rb
+++ b/lib/protobuf/active_record/railtie.rb
@@ -4,10 +4,8 @@ config.protobuf_active_record = Protobuf::ActiveRecord.config
ActiveSupport.on_load(:active_record) do
- if Protobuf::ActiveRecord.config.autoload
- on_inherit do
- include Protobuf::ActiveRecord::Model
- end
+ on_inherit do
+ include Protobuf::ActiveRecord::Model if Protobuf::ActiveRecord.config.autoload
end
end
end
|
Check autoloading inside the on_inherit hook
|
diff --git a/lib/sprockets/cache/memcache_store.rb b/lib/sprockets/cache/memcache_store.rb
index abc1234..def5678 100644
--- a/lib/sprockets/cache/memcache_store.rb
+++ b/lib/sprockets/cache/memcache_store.rb
@@ -1,7 +1,7 @@ require 'dalli'
module Sprockets
- module Cache
+ class Cache
# A simple Memcache cache store.
#
# environment.cache = Sprockets::Cache::MemcacheStore.new
|
Revert "cache is now a module"
This reverts commit 9fda7b76c24bbcb1ce26b38a2480f0ba3564c514.
|
diff --git a/lib/vagrant-aws/action/connect_aws.rb b/lib/vagrant-aws/action/connect_aws.rb
index abc1234..def5678 100644
--- a/lib/vagrant-aws/action/connect_aws.rb
+++ b/lib/vagrant-aws/action/connect_aws.rb
@@ -30,6 +30,7 @@ else
fog_config[:aws_access_key_id] = region_config.access_key_id
fog_config[:aws_secret_access_key] = region_config.secret_access_key
+ fog_config[:aws_session_token] = region_config.aws_session_token
end
fog_config[:endpoint] = region_config.endpoint if region_config.endpoint
|
Use the session token if it's available
|
diff --git a/db/data_migration/20161208112001_patch_empty_document_collections_links_for_publication.rb b/db/data_migration/20161208112001_patch_empty_document_collections_links_for_publication.rb
index abc1234..def5678 100644
--- a/db/data_migration/20161208112001_patch_empty_document_collections_links_for_publication.rb
+++ b/db/data_migration/20161208112001_patch_empty_document_collections_links_for_publication.rb
@@ -0,0 +1,14 @@+pub = Publication.find(124751)
+
+links = PublishingApiPresenters.presenter_for(pub).links
+
+if links
+ # Explicitly set the document_collections links to an empty set
+ # these links are resolved by the Publishing API
+ links[:document_collections] = []
+ Whitehall.publishing_api_v2_client.patch_links(
+ pub.document.content_id,
+ links: links,
+ bulk_publishing: true
+ )
+end
|
Clear document_collections links for publication
The Publishing API will resolve these links for us so clear
any document_collections links data previously added prior
to dependency resolution.
|
diff --git a/app/app.rb b/app/app.rb
index abc1234..def5678 100644
--- a/app/app.rb
+++ b/app/app.rb
@@ -23,7 +23,7 @@ mustache :index
end
- get '/:gem' do
+ get '/gems/:gem' do
@gem = params[:gem]
mustache :gem_info
end
|
Move gem_info route to /gems/:gem
This mirrors the rubygems.org routes, and is less limiting with possible
routes in the future.
|
diff --git a/spec/support/pages/overlay.rb b/spec/support/pages/overlay.rb
index abc1234..def5678 100644
--- a/spec/support/pages/overlay.rb
+++ b/spec/support/pages/overlay.rb
@@ -22,11 +22,11 @@ end
def mark_as_complete
- find('footer input[type="checkbox"]').click
+ check "Completed"
end
def completed?
- find('footer input[type="checkbox"]').checked?
+ find(checkbox_selector).checked?
end
def view_paper
@@ -37,4 +37,9 @@ wait_for_turbolinks
PaperPage.new
end
+
+ private
+ def checkbox_selector
+ 'footer input[type=checkbox]'
+ end
end
|
Make checking completed box work.
|
diff --git a/Framezilla.podspec b/Framezilla.podspec
index abc1234..def5678 100644
--- a/Framezilla.podspec
+++ b/Framezilla.podspec
@@ -1,6 +1,6 @@ Pod::Spec.new do |spec|
spec.name = "Framezilla"
- spec.version = "1.2.1"
+ spec.version = "2.0.0"
spec.summary = "Comfortable syntax for working with frames."
spec.homepage = "https://github.com/Otbivnoe/Framezilla"
|
Update pod version -> 2.0.0
|
diff --git a/Framezilla.podspec b/Framezilla.podspec
index abc1234..def5678 100644
--- a/Framezilla.podspec
+++ b/Framezilla.podspec
@@ -1,6 +1,6 @@ Pod::Spec.new do |spec|
spec.name = "Framezilla"
- spec.version = "2.1.2"
+ spec.version = "2.2.0"
spec.summary = "Comfortable syntax for working with frames."
spec.homepage = "https://github.com/Otbivnoe/Framezilla"
|
Change podspec version -> 2.2.0
|
diff --git a/msfl_visitors.gemspec b/msfl_visitors.gemspec
index abc1234..def5678 100644
--- a/msfl_visitors.gemspec
+++ b/msfl_visitors.gemspec
@@ -1,6 +1,6 @@ Gem::Specification.new do |s|
s.name = 'msfl_visitors'
- s.version = '1.2.1'
+ s.version = '1.2.2'
s.date = '2015-07-06'
s.summary = "Convert MSFL to other forms"
s.description = "Visitor pattern approach to converting MSFL to other forms."
|
Update gemspec due to some aesthetic changes in implementation
|
diff --git a/bench/bench_LLLrV.rb b/bench/bench_LLLrV.rb
index abc1234..def5678 100644
--- a/bench/bench_LLLrV.rb
+++ b/bench/bench_LLLrV.rb
@@ -0,0 +1,26 @@+require File.expand_path(File.join(File.dirname(__FILE__), "bench_helper"))
+
+module LibTest
+ extend FFI::Library
+ ffi_lib LIBTEST_PATH
+ attach_function :bench_s64s64s64_v, [ :long_long, :long_long, :long_long ], :void
+end
+
+
+puts "Benchmark [ :long_long, :long_long, :long_long ], :void performance, #{ITER}x calls"
+
+10.times {
+ puts Benchmark.measure {
+ ITER.times { LibTest.bench_s64s64s64_v(0, 1, 2) }
+ }
+}
+unless RUBY_PLATFORM =~ /java/
+puts "Benchmark Invoker.call [ :long_long, :long_long, :long_long ], :void performance, #{ITER}x calls"
+
+invoker = FFI.create_invoker(LIBTEST_PATH, 'bench_s64s64s64_v', [ :long_long, :long_long, :long_long ], :void)
+10.times {
+ puts Benchmark.measure {
+ ITER.times { invoker.call3(0, 1, 2) }
+ }
+}
+end
|
Add a bench for 64bit integer parameters
|
diff --git a/app/models/user.rb b/app/models/user.rb
index abc1234..def5678 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -23,14 +23,14 @@ end
def guider?
- permissions.include?(GUIDER_PERMISSION)
+ has_permission?(GUIDER_PERMISSION)
end
def resource_manager?
- permissions.include?(RESOURCE_MANAGER_PERMISSION)
+ has_permission?(RESOURCE_MANAGER_PERMISSION)
end
def agent?
- permissions.include?(AGENT_PERMISSION)
+ has_permission?(AGENT_PERMISSION)
end
end
|
Use GDS-SSO supplied permissions check
GDS-SSO provides a predicate for us to check for the presence of
permissions.
|
diff --git a/app/models/user.rb b/app/models/user.rb
index abc1234..def5678 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -1,7 +1,8 @@ class User < ApplicationRecord
has_secure_password
- has_many :plans
+ has_many :plans, dependent: :destroy
validates :name, presence: true, length: { minimum: 5 }
+ validates :email, presence: true, length: { minimum: 4 }
end
|
Add preliminary validations and dependent destroy to User model
|
diff --git a/lib/bundler_help.rb b/lib/bundler_help.rb
index abc1234..def5678 100644
--- a/lib/bundler_help.rb
+++ b/lib/bundler_help.rb
@@ -1,13 +1,15 @@ module BundlerHelp
def self.find_path(dir_name)
- path = File.expand_path('.')
- path_arr = path.split(File::SEPARATOR).map {|x| x=="" ? File::SEPARATOR : x}
- while (path_arr.length > 0) do
- test = File.join(path_arr, dir_name)
- return test if Dir.exists?(test)
- path_arr.pop
+ paths = [File.expand_path('.'), File.expand_path('..')]
+ paths.each do |path|
+ path_arr = path.split(File::SEPARATOR).map {|x| x=='' ? File::SEPARATOR : x}
+ while path_arr.length > 0 do
+ test = File.join(path_arr, dir_name)
+ return test if Dir.exists?(test)
+ path_arr.pop
+ end
end
false
end
-end+end
|
Allow other engines to be checked out parallel to stash_engine as well as in subdirectories
|
diff --git a/lib/awesome_hstore_translate/active_record/act_as_translatable.rb b/lib/awesome_hstore_translate/active_record/act_as_translatable.rb
index abc1234..def5678 100644
--- a/lib/awesome_hstore_translate/active_record/act_as_translatable.rb
+++ b/lib/awesome_hstore_translate/active_record/act_as_translatable.rb
@@ -29,7 +29,8 @@ end
def apply_options(options)
- options[:fallbacks] = true unless options.include?(:fallbacks)
+ fallbacks = I18n.respond_to?(:fallbacks) ? I18n.fallbacks : true
+ options[:fallbacks] = fallbacks unless options.include?(:fallbacks)
options[:accessors] = false unless options.include?(:accessors)
class_attribute :translation_options
|
Enable fallbacks from i18n module
|
diff --git a/lib/generators/renaming_migration/renaming_migration_generator.rb b/lib/generators/renaming_migration/renaming_migration_generator.rb
index abc1234..def5678 100644
--- a/lib/generators/renaming_migration/renaming_migration_generator.rb
+++ b/lib/generators/renaming_migration/renaming_migration_generator.rb
@@ -5,8 +5,9 @@ argument :procedure_name
def generate_renaming_migration
- return puts 'Procedure does not exists, stopping...' unless File.file? procedure_path
- template 'migration.rb', "db/migrate/#{timestamp}_rename_#{old_name}_to_#{new_name}_in_#{procedure_name}_procedure.rb"
+ return say "Sorry but this generator's execution isn't reversible yet.", :yellow if behavior == :revoke
+ return say 'Procedure does not exists, stopping...', :yellow unless File.file? procedure_path
+ template 'migration.rb', File.join('db', 'migrate', "#{timestamp}_rename_#{old_name}_to_#{new_name}_in_#{procedure_name}_procedure.rb")
gsub_procedure
end
|
Put error warning on destroy/rollback of the migration.
|
diff --git a/lib/solr_wrapper.rb b/lib/solr_wrapper.rb
index abc1234..def5678 100644
--- a/lib/solr_wrapper.rb
+++ b/lib/solr_wrapper.rb
@@ -3,7 +3,7 @@
module SolrWrapper
def self.default_solr_version
- '5.4.0'
+ '5.4.1'
end
def self.default_instance_options
|
Use Solr 5.4.1 by default
|
diff --git a/db/migrate/20101202205446_remove_published_articles.rb b/db/migrate/20101202205446_remove_published_articles.rb
index abc1234..def5678 100644
--- a/db/migrate/20101202205446_remove_published_articles.rb
+++ b/db/migrate/20101202205446_remove_published_articles.rb
@@ -3,7 +3,7 @@ select_all("SELECT * from articles WHERE type = 'PublishedArticle'").each do |published|
reference = Article.exists?(published['reference_article_id']) ? Article.find(published['reference_article_id']) : nil
if reference
- execute(ActiveRecord::Base.sanitize_sql(["UPDATE articles SET type = ?, abstract = ?, body = ? WHERE articles.id = ?", reference.type, reference.abstract, reference.body, published['id']]))
+ execute(ActiveRecord::Base.sanitize_sql(["UPDATE articles SET type = ?, abstract = ?, body = ? WHERE articles.id = ?", reference[:type], reference.abstract, reference.body, published['id']]))
else
execute("DELETE from articles where articles.id = #{published['id']}")
end
|
Use [:type] instead of .type
ActionItem1733()
|
diff --git a/FazeKit.podspec b/FazeKit.podspec
index abc1234..def5678 100644
--- a/FazeKit.podspec
+++ b/FazeKit.podspec
@@ -1,7 +1,7 @@ Pod::Spec.new do |s|
s.name = 'FazeKit'
- s.version = '0.1.3'
- s.summary = 'A collection of helper functions and extensions for Swift iOS apps'
+ s.version = '1.0.0'
+ s.summary = 'A collection of helper functions and extensions for Swift 3 iOS apps'
s.description = 'A collection of extensions and convenience functions on Foundation, UIKit and other Cocoa Frameworks, built in Swift for iOS development'
s.homepage = 'https://github.com/NextFaze/FazeKit'
s.license = { :type => 'APACHE', :file => 'LICENSE' }
|
Update podspec to 1.0.0 for Swift 3 branch
|
diff --git a/install_gem_update.rb b/install_gem_update.rb
index abc1234..def5678 100644
--- a/install_gem_update.rb
+++ b/install_gem_update.rb
@@ -31,8 +31,9 @@ Gem::GemRunner.new.run(%w[install did_you_mean:1.0.3] + suffix)
end
Gem::GemRunner.new.run %w[cleanup]
- Gem::GemRunner.new.run(%w[install bundler] + suffix)
+# Gem::GemRunner.new.run(%w[install bundler] + suffix)
end
+ Gem::GemRunner.new.run(%w[install bundler] + suffix)
end
end
|
Add bundler install to trunk, not included with trunk for a while
|
diff --git a/app/controllers/admin/application_controller.rb b/app/controllers/admin/application_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/admin/application_controller.rb
+++ b/app/controllers/admin/application_controller.rb
@@ -1,8 +1,7 @@ class Admin::ApplicationController < ActionController::Base
+ layout 'admin/layouts/application'
+
protect_from_forgery
- http_basic_authenticate_with :name => CONFIG[:admin_username], :password => CONFIG[:admin_password]
-
- layout 'admin/layouts/application'
-
+ http_basic_authenticate_with(:name => CONFIG[:admin_username], :password => CONFIG[:admin_password]) if ['staging', 'sales'].include?(Rails.env)
end
|
Add basic HTTP auth only for selected environments
|
diff --git a/config/initializers/3_grit_ext.rb b/config/initializers/3_grit_ext.rb
index abc1234..def5678 100644
--- a/config/initializers/3_grit_ext.rb
+++ b/config/initializers/3_grit_ext.rb
@@ -1,6 +1,7 @@ require 'grit'
require 'pygments'
+Grit::Git.git_binary = Gitlab.config.git.bin_path
Grit::Git.git_timeout = Gitlab.config.git.timeout
Grit::Git.git_max_size = Gitlab.config.git.max_size
|
Fix not using git.bin_path in config.
Closing #3614" and "Closing #3574.
|
diff --git a/lib/plugins/string_extensions/lib/string_extensions.rb b/lib/plugins/string_extensions/lib/string_extensions.rb
index abc1234..def5678 100644
--- a/lib/plugins/string_extensions/lib/string_extensions.rb
+++ b/lib/plugins/string_extensions/lib/string_extensions.rb
@@ -11,7 +11,7 @@ self.underscore.gsub('/', ' ').humanize.titlecase.gsub(/\s*#{last_part}$/, '')
end
- alias_method :to_slug, :parameterize
- alias_method :slugify, :parameterize
- alias_method :slugerize, :parameterize
+ alias :to_slug :parameterize
+ alias :slugify :parameterize
+ alias :slugerize :parameterize
end
|
Use alias instead of alias_method.
|
diff --git a/coopr-provisioner/worker/plugins/automators/chef_solo_automator/resources/cookbooks/coopr_base/recipes/default.rb b/coopr-provisioner/worker/plugins/automators/chef_solo_automator/resources/cookbooks/coopr_base/recipes/default.rb
index abc1234..def5678 100644
--- a/coopr-provisioner/worker/plugins/automators/chef_solo_automator/resources/cookbooks/coopr_base/recipes/default.rb
+++ b/coopr-provisioner/worker/plugins/automators/chef_solo_automator/resources/cookbooks/coopr_base/recipes/default.rb
@@ -27,7 +27,7 @@
# We always run our dns, firewall, and hosts cookbooks
%w(dns firewall hosts).each do |cb|
- include_recipe "coopr_#{cb}::default"
+ include_recipe "coopr_#{cb}::default" unless node['base'].key?("no_#{cb}") && node['base']["no_#{cb}"].to_s == 'true'
end
# ensure user ulimits are enabled
|
Allow a way to disable the base cookbooks
|
diff --git a/Casks/opera-beta.rb b/Casks/opera-beta.rb
index abc1234..def5678 100644
--- a/Casks/opera-beta.rb
+++ b/Casks/opera-beta.rb
@@ -1,6 +1,6 @@ cask :v1 => 'opera-beta' do
- version '30.0.1835.47'
- sha256 '97817b3a4bbf6eb7e92493f241665012f42592b3b404e888ad3cb05f61c8b39c'
+ version '30.0.1835.49'
+ sha256 '561fa244e03e91056655248f627b28294ae4e3bb5102c5db41737c3bd0db13d3'
url "http://get.geo.opera.com/pub/opera-beta/#{version}/mac/Opera_beta_#{version}_Setup.dmg"
homepage 'http://www.opera.com/computer/beta'
|
Upgrade Opera Beta.app to v30.0.1835.49
|
diff --git a/player_spec.rb b/player_spec.rb
index abc1234..def5678 100644
--- a/player_spec.rb
+++ b/player_spec.rb
@@ -0,0 +1,39 @@+require_relative "player"
+
+describe Player do
+
+ before do
+ $stdout = StringIO.new # makes sure that puts results are not printed to the console
+ @initial_health = 150
+ @player = Player.new("larry", @initial_health)
+ end
+
+ it "has a capitalized name" do
+ @player.name.should == "Larry"
+ end
+
+ it "has an initial health" do
+ @player.health.should == 150
+ end
+
+ it "has a string representation" do
+ @player.to_s.should == "I'm Larry with a health of 150 and a score of 155."
+ end
+
+ it "computes a score as the sum of its health and length of the name" do
+ @player.score.should == 155
+ end
+
+ it "increases health by 15 when w00ted" do
+ @player.w00t
+
+ @player.health.should == @initial_health + 15
+ end
+
+ it "decreases health by 10 when blammed" do
+ @player.blam
+
+ @player.health.should == @initial_health - 10
+ end
+
+end
|
Add spec file for Player class tests
|
diff --git a/lib/convection/model/template/resource_group.rb b/lib/convection/model/template/resource_group.rb
index abc1234..def5678 100644
--- a/lib/convection/model/template/resource_group.rb
+++ b/lib/convection/model/template/resource_group.rb
@@ -9,7 +9,6 @@ include DSL::IntrinsicFunctions
include DSL::Template::Resource
- attribute :type
attr_reader :name
attr_reader :parent
attr_reader :template
|
Remove the unused :type attribute from ResourceGroup
|
diff --git a/lib/generators/cerberus_core/exist_generator.rb b/lib/generators/cerberus_core/exist_generator.rb
index abc1234..def5678 100644
--- a/lib/generators/cerberus_core/exist_generator.rb
+++ b/lib/generators/cerberus_core/exist_generator.rb
@@ -11,22 +11,29 @@ rails generate cerberus_core:exist
This will create:
- jetty/webapps/exist-2.2.rev.war
+ jetty/webapps/exist-2.2-rev.war
jetty/contexts/exist.xml
- config/exist_db.yml
+ config/exist.yml
eos
def insert_war_file
- #TODO
+ say "Creating exist .war file", :green
+ pth = "#{Rails.root}/jetty/webapps"
+ if File.exists?("#{pth}/exist-2.2-rev.war")
+ say "#{pth}/exist-2.2-rev.war already exists - skipping", :yellow
+ else
+ url = "librarystaff.neu.edu/DRSzip/exist-2.2-rev.war"
+ run "wget #{url} -O #{pth}/exist-2.2-rev.war"
+ end
end
def insert_context_file
- puts "copying over exist db context file"
+ say "copying over exist db context file", :green
copy_file "exist.xml", "#{Rails.root}/jetty/contexts/exist.xml"
end
def insert_config_file
- puts "copying over exist db connector configuration"
+ say "copying over exist db connector configuration", :green
copy_file "exist.yml", "#{Rails.root}/config/exist.yml"
end
end
|
Add exist generator to the project.
|
diff --git a/lib/rubocop/cop/mixin/configurable_numbering.rb b/lib/rubocop/cop/mixin/configurable_numbering.rb
index abc1234..def5678 100644
--- a/lib/rubocop/cop/mixin/configurable_numbering.rb
+++ b/lib/rubocop/cop/mixin/configurable_numbering.rb
@@ -7,9 +7,9 @@ module ConfigurableNumbering
include ConfigurableEnforcedStyle
- SNAKE_CASE = /(^_|[a-z]|_\d+)$/
- NORMAL_CASE = /(^_|[A-Za-z]\d*)$/
- NON_INTEGER = /(^_|[A-Za-z])$/
+ SNAKE_CASE = /(?:^_|[a-z]|_\d+)$/
+ NORMAL_CASE = /(?:^_|[A-Za-z]\d*)$/
+ NON_INTEGER = /(?:^_|[A-Za-z])$/
def check_name(node, name, name_range)
return if operator?(name)
|
Change regexes to not capture
|
diff --git a/spec/moneta/proxies/transformer/transformer_bson_spec.rb b/spec/moneta/proxies/transformer/transformer_bson_spec.rb
index abc1234..def5678 100644
--- a/spec/moneta/proxies/transformer/transformer_bson_spec.rb
+++ b/spec/moneta/proxies/transformer/transformer_bson_spec.rb
@@ -1,4 +1,6 @@-describe 'transformer_bson', proxy: :Transformer do
+# Currently broken in JRuby 9.3 - see https://github.com/jruby/jruby/issues/6941
+
+describe 'transformer_bson', proxy: :Transformer, broken: defined?(JRUBY_VERSION) && ::Gem::Version.new(JRUBY_VERSION) >= ::Gem::Version.new('9.3.0.0') do
moneta_build do
Moneta.build do
use :Transformer, key: :bson, value: :bson
|
Specs: Mark BSON as broken in JRuby 9.3
|
diff --git a/app/controllers/debit_invoices_controller.rb b/app/controllers/debit_invoices_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/debit_invoices_controller.rb
+++ b/app/controllers/debit_invoices_controller.rb
@@ -28,7 +28,9 @@
def create
@debit_invoice = DebitInvoice.new(params[:debit_invoice])
- @debit_invoice.build_booking if @debit_invoice.valid?
+ if @debit_invoice.save
+ @debit_invoice.build_booking.save
+ end
create!
end
|
Fix debit invoice booking building.
|
diff --git a/deviantart.gemspec b/deviantart.gemspec
index abc1234..def5678 100644
--- a/deviantart.gemspec
+++ b/deviantart.gemspec
@@ -4,24 +4,24 @@ require 'deviantart/version'
Gem::Specification.new do |spec|
- spec.name = "deviantart"
+ spec.name = 'deviantart'
spec.version = DeviantArt::VERSION
- spec.authors = ["Code Ass"]
- spec.email = ["aycabta@gmail.com"]
+ spec.authors = ['Code Ass']
+ spec.email = ['aycabta@gmail.com']
spec.summary = %q{deviantART API library}
spec.description = %Q{deviantART API library\n}
- spec.homepage = "https://github.com/aycabta/deviantart"
- spec.license = "MIT"
+ spec.homepage = 'https://github.com/aycabta/deviantart'
+ spec.license = 'MIT'
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|features)/}) }
- spec.bindir = "exe"
+ spec.bindir = 'exe'
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
+ spec.require_paths = ['lib']
spec.required_ruby_version = Gem::Requirement.new('>= 2.2.6')
- spec.add_development_dependency "bundler"
- spec.add_development_dependency "rake"
- spec.add_development_dependency "minitest", "~> 5.10"
+ spec.add_development_dependency 'bundler'
+ spec.add_development_dependency 'rake'
+ spec.add_development_dependency 'minitest', '~> 5.10'
end
|
Use single quote in .gemspec
|
diff --git a/spec/consonant_spec.rb b/spec/consonant_spec.rb
index abc1234..def5678 100644
--- a/spec/consonant_spec.rb
+++ b/spec/consonant_spec.rb
@@ -7,4 +7,21 @@ expect(consonant.input).to eq 'c'
end
end
+
+ describe '#patterns' do
+ it 'should return an Array' do
+ expect(consonant.patterns).to be_a Array
+ end
+ context 'when consonant "c" and vowel "a" given' do
+ before do
+ consonant.addVowel(Vowel.new('a','a'))
+ end
+ it 'should return a Pattern' do
+ expect(consonant.patterns.first).to be_a Pattern
+ end
+ it 'should contain "か"' do
+ expect(consonant.patterns.first.output_jp).to eq 'か'
+ end
+ end
+ end
end
|
Add patterns test for consonant
|
diff --git a/spec/solid/tag_spec.rb b/spec/solid/tag_spec.rb
index abc1234..def5678 100644
--- a/spec/solid/tag_spec.rb
+++ b/spec/solid/tag_spec.rb
@@ -1,7 +1,24 @@ require 'spec_helper'
+
+class DummyTag < Solid::Tag
+
+ def display(*args)
+ args.map(&:to_s).join
+ end
+
+end
describe Solid::Tag do
-
+ subject{ DummyTag.new('dummy', '1, "foo", myvar, myopts: false', 'token') }
+
+ it 'should works' do
+ subject.render('myvar' => 'bar').should be == '1foobar{:myopts=>false}'
+ end
+
+ it 'should send all parsed arguments do #display' do
+ subject.should_receive(:display).with(1, 'foo', 'bar', myopts: false).and_return('result')
+ subject.render('myvar' => 'bar').should be == 'result'
+ end
end
|
Add some dumy specs for Solid::Tag
|
diff --git a/common/test/rb/spec/error_spec.rb b/common/test/rb/spec/error_spec.rb
index abc1234..def5678 100644
--- a/common/test/rb/spec/error_spec.rb
+++ b/common/test/rb/spec/error_spec.rb
@@ -11,6 +11,16 @@ end
it "should show stack trace information" do
- pending
+ driver.navigate.to url_for("xhtmlTest.html")
+ rescued = false
+ ex = nil
+
+ begin
+ driver.find_element(:id, "nonexistant")
+ rescue => ex
+ rescued = true
+ end
+
+ ex.backtrace.first.should include("[remote server]")
end
end
|
JariBakken: Implement pending spec for server backtrace.
git-svn-id: 4179480af2c2519a5eb5e1e9b541cbdf5cf27696@9511 07704840-8298-11de-bf8c-fd130f914ac9
|
diff --git a/lib/chrono/trigger.rb b/lib/chrono/trigger.rb
index abc1234..def5678 100644
--- a/lib/chrono/trigger.rb
+++ b/lib/chrono/trigger.rb
@@ -31,7 +31,7 @@ end
def period
- iterator.next - Time.now
+ iterator.next - Time.now + 1.second
end
end
end
|
Add extra sleep time to adjust to exact minute
|
diff --git a/lib/queri/stats/unanswered_calls/calls_fully_within_the_given_time_interval.rb b/lib/queri/stats/unanswered_calls/calls_fully_within_the_given_time_interval.rb
index abc1234..def5678 100644
--- a/lib/queri/stats/unanswered_calls/calls_fully_within_the_given_time_interval.rb
+++ b/lib/queri/stats/unanswered_calls/calls_fully_within_the_given_time_interval.rb
@@ -11,7 +11,6 @@
def key_translations
ActiveSupport::OrderedHash[
- :calls_fully_within_the_given_time_interval, "Calls fully within the given time interval:",
:calls_unanswered, "N.of unanswered calls:",
:average_call_waiting_time, "Average wait time before disconnection:",
:minimum_call_waiting_time, "Min wait time before disconnection:",
|
Remove erroneous key from UnansweredCalls report
CallsFullyWithinTheGivenTimeInterval keys were off, due to a bad key given to
the ordered hash. This is now resolved.
|
diff --git a/lib/pure360/client.rb b/lib/pure360/client.rb
index abc1234..def5678 100644
--- a/lib/pure360/client.rb
+++ b/lib/pure360/client.rb
@@ -9,13 +9,13 @@ end
def subscribe(subscriber_params)
- ensure_email(subscriber_params.fetch(:email))
+ ensure_email!(subscriber_params.fetch(:email))
post(subscriber_params)
end
private
- def ensure_email(email)
+ def ensure_email!(email)
raise "Invalid Email" unless valid_email?(email)
end
|
Add bang to ensure_email because it raises an error
|
diff --git a/lib/remote/printer.rb b/lib/remote/printer.rb
index abc1234..def5678 100644
--- a/lib/remote/printer.rb
+++ b/lib/remote/printer.rb
@@ -6,7 +6,7 @@
def status(where, what)
c1 = "\033[0;30m"
- c2 = "\033[0;33m"
+ c2 = "\033[0;32m"
c0 = "\033[0m"
log "#{c1}[#{where} >>#{c2} #{what}#{c1}]#{c0}"
end
|
Change the status print color.
|
diff --git a/lib/tasks/resque.rake b/lib/tasks/resque.rake
index abc1234..def5678 100644
--- a/lib/tasks/resque.rake
+++ b/lib/tasks/resque.rake
@@ -9,7 +9,8 @@ Resque.workers.each do |w|
worker_start_time = w.processing.fetch("run_at", Time.current).to_time
time_running = Time.current - worker_start_time
- max_time_running = 10.minutes
+ max_time_running =
+ ENV.fetch("RESQUE_WORKER_TIMEOUT_MINUTES", 10).to_i.minutes
if time_running > max_time_running
w.unregister_worker
|
Add ENV variable for worker timeout
|
diff --git a/lib/tasks/search.rake b/lib/tasks/search.rake
index abc1234..def5678 100644
--- a/lib/tasks/search.rake
+++ b/lib/tasks/search.rake
@@ -1,4 +1,9 @@ namespace :search do
+ task :drop do
+ ENV['INDEX'] = "issues,parties,representatives,promises,propositions,parliament_issues,topics"
+ Rake::Task['tire:index:drop'].invoke
+ end
+
task :reindex => :environment do
[ Issue,
ParliamentIssue,
|
Add task to drop the index.
|
diff --git a/lib/tasks/travis.rake b/lib/tasks/travis.rake
index abc1234..def5678 100644
--- a/lib/tasks/travis.rake
+++ b/lib/tasks/travis.rake
@@ -11,9 +11,9 @@ raise "cucumber failed!" unless $?.exitstatus == 0
end
- task :protractor do
+ task :protractor => :environment do
puts "Creating test assets for v#{Loomio::Version.current}..."
- system("cp -r public/client/development public/client/#{Loomio::Version.current}")
+ system("cp -r #{Rails.root}/public/client/development #{Rails.root}/public/client/#{Loomio::Version.current}")
raise "Asset creation failed!" unless $?.exitstatus == 0
puts "Starting to run protractor..."
|
Load environment for Protractor test
|
diff --git a/MIBlurPopup.podspec b/MIBlurPopup.podspec
index abc1234..def5678 100644
--- a/MIBlurPopup.podspec
+++ b/MIBlurPopup.podspec
@@ -6,9 +6,7 @@ s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'Mario Iannotta' => 'info@marioiannotta.com' }
s.source = { :git => 'https://github.com/MarioIannotta/MIBlurPopup.git', :tag => s.version.to_s }
-
s.ios.deployment_target = '8.0'
+ s.swift_version = '5.0'
s.source_files = 'MIBlurPopup/*.swift'
- s.pod_target_xcconfig = { "SWIFT_VERSION" => "5.0" }
-
end
|
Add swift version to podspec
|
diff --git a/models/cup_group.rb b/models/cup_group.rb
index abc1234..def5678 100644
--- a/models/cup_group.rb
+++ b/models/cup_group.rb
@@ -9,7 +9,7 @@ end
def positions_table
- GroupPosition.select.select_append{ Sequel.as(goals - received_goals, :diff)}.where(group_id: id).order(Sequel.desc(:points), Sequel.desc(:diff)).all
+ GroupPosition.select.select_append{ Sequel.as(goals - received_goals, :diff)}.where(group_id: id).order(Sequel.desc(:points), Sequel.desc(:diff), Sequel.desc(:goals)).all
end
def matches_table
|
Add third order factor to positions table
|
diff --git a/Casks/azure-cli.rb b/Casks/azure-cli.rb
index abc1234..def5678 100644
--- a/Casks/azure-cli.rb
+++ b/Casks/azure-cli.rb
@@ -0,0 +1,15 @@+cask :v1 => 'azure-cli' do
+ version :latest
+ sha256 :no_check
+
+ url 'http://go.microsoft.com/fwlink/?linkid=252249&clcid=0x409'
+ name 'Microsoft Azure SDK'
+ homepage 'http://azure.microsoft.com/en-us/documentation/articles/command-line-tools/'
+ license :gratis
+ tags :vendor => 'Microsoft'
+
+ pkg 'Install Command Line Interface.pkg'
+
+ uninstall :script => '/usr/local/bin/azure-uninstall',
+ :pkgutil => 'com.microsoft.azure.*'
+end
|
Add cask for Microsoft Azure CLI
Closes #8238.
|
diff --git a/RMStore.podspec b/RMStore.podspec
index abc1234..def5678 100644
--- a/RMStore.podspec
+++ b/RMStore.podspec
@@ -1,13 +1,13 @@ Pod::Spec.new do |s|
s.name = "RMStore"
- s.version = "0.1"
+ s.version = "0.2"
s.license = "Apache 2.0"
s.summary = "A lightweight iOS framework for In-App Purchases."
s.homepage = "https://github.com/robotmedia/RMStore"
s.author = 'Hermes Pique'
- s.source = { :git => "https://github.com/robotmedia/RMStore.git", :tag => "0.2" }
+ s.source = { :git => "https://github.com/robotmedia/RMStore.git", :tag => "{spec.version}" }
s.platform = :ios, '5.0'
s.source_files = 'RMStore'
s.frameworks = 'StoreKit'
s.requires_arc = true
-end+end
|
Use the version of the Pod to identify the Git tag
|
diff --git a/app.rb b/app.rb
index abc1234..def5678 100644
--- a/app.rb
+++ b/app.rb
@@ -12,9 +12,15 @@ end
get "/" do
- erb :index, locals: { posts: BlogPost.all }
+ erb :index, locals: { posts: Content::BlogPost.all }
end
get "/:id" do
- erb :show, locals: { post: BlogPost.from_slug(params[:id]) }
+ post = Content::BlogPost.from_slug(params[:id])
+
+ if post
+ erb :show, locals: { post: post }
+ else
+ status 404
+ end
end
|
Use new namespace and render 404 if blog post is not available
|
diff --git a/app.rb b/app.rb
index abc1234..def5678 100644
--- a/app.rb
+++ b/app.rb
@@ -13,6 +13,7 @@ get '/' do
@vip_clients = VipClients.all
send_invitations
+ halt 200
end
def send_invitations
|
Add halt 200 to finish
|
diff --git a/app.rb b/app.rb
index abc1234..def5678 100644
--- a/app.rb
+++ b/app.rb
@@ -9,7 +9,7 @@ erb :'index.html'
end
-get %r{/(\d{4})$} do |train|
+get %r{/(.+)$} do |train|
@train = train
@status = train_status(train)
|
Remove four-number-only limit for train number (just in case we want to check Amtrak, for example)
|
diff --git a/SwiftQueue.podspec b/SwiftQueue.podspec
index abc1234..def5678 100644
--- a/SwiftQueue.podspec
+++ b/SwiftQueue.podspec
@@ -8,7 +8,10 @@ s.author = { "Lucas Nelaupe" => "lucas.nelaupe@gmail.com" }
s.source = { :git => "https://github.com/lucas34/SwiftQueue.git", :tag => s.version.to_s }
- s.platform = :ios, '8.0'
+ s.ios.deployment_target = "8.0"
+ s.tvos.deployment_target= "9.0"
+ s.osx.deployment_target= "10.10"
+
s.requires_arc = true
s.source_files = 'Sources/**.swift'
|
Add OSx and TVos as supported platform
|
diff --git a/spec/views/hyrax/base/_attribute_rows.html.erb_spec.rb b/spec/views/hyrax/base/_attribute_rows.html.erb_spec.rb
index abc1234..def5678 100644
--- a/spec/views/hyrax/base/_attribute_rows.html.erb_spec.rb
+++ b/spec/views/hyrax/base/_attribute_rows.html.erb_spec.rb
@@ -2,8 +2,13 @@
RSpec.describe 'hyrax/base/_attribute_rows.html.erb', type: :view do
let(:url) { "http://example.com" }
+ let(:rights_statement_uri) { 'http://rightsstatements.org/vocab/InC/1.0/' }
let(:ability) { double }
- let(:work) { stub_model(GenericWork, related_url: [url]) }
+ let(:work) do
+ stub_model(GenericWork,
+ related_url: [url],
+ rights_statement: [rights_statement_uri])
+ end
let(:solr_document) { SolrDocument.new(work.to_solr) }
let(:presenter) { Hyrax::WorkShowPresenter.new(solr_document, ability) }
@@ -16,4 +21,8 @@ expect(page).to have_selector '.glyphicon-new-window'
expect(page).to have_link(url)
end
+
+ it 'shows rights statement with link to statement URL' do
+ expect(page).to have_link(rights_statement_uri)
+ end
end
|
Add view spec for rights statement
|
diff --git a/spec/controllers/context/pages_controller_spec.rb b/spec/controllers/context/pages_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/context/pages_controller_spec.rb
+++ b/spec/controllers/context/pages_controller_spec.rb
@@ -1,12 +1,6 @@ require 'spec_helper'
describe Context::PagesController do
-
- def mock_page(stubs={})
- (@mock_page ||= mock_model(Context::Page).as_null_object).tap do |page|
- page.stub(stubs) unless stubs.empty?
- end
- end
describe "GET show" do
it "assigns the page when it is found by path" do
|
Remove the mock_page method which isn't called within the PagesController spec
|
diff --git a/down.gemspec b/down.gemspec
index abc1234..def5678 100644
--- a/down.gemspec
+++ b/down.gemspec
@@ -12,7 +12,7 @@ spec.email = ["janko.marohnic@gmail.com"]
spec.license = "MIT"
- spec.files = Dir["README.md", "LICENSE.txt", "*.gemspec", "lib/**/*.rb"]
+ spec.files = Dir["README.md", "LICENSE.txt", "CHANGELOG.md" "*.gemspec", "lib/**/*.rb"]
spec.require_path = "lib"
spec.add_development_dependency "minitest", "~> 5.8"
|
Include CHANGELOG.md in the packaged gem
|
diff --git a/spec/base-common/interfaces_spec.rb b/spec/base-common/interfaces_spec.rb
index abc1234..def5678 100644
--- a/spec/base-common/interfaces_spec.rb
+++ b/spec/base-common/interfaces_spec.rb
@@ -0,0 +1,24 @@+require 'spec_helper'
+
+# This test requires a VM to be provision with two IPs, preferably one public
+# and one private.
+
+# Test to ensure the VM has two interfaces, eth0 and eth1
+
+# eth0
+describe interface('eth0') do
+ it { should exist }
+end
+
+describe interface('eth0') do
+ it { should be_up }
+end
+
+# eth1
+describe interface('eth1') do
+ it { should exist }
+end
+
+describe interface('eth1') do
+ it { should be_up }
+end
|
Test interfaces eth0 and eth1
A Test VM must be provision with two IPs
|
diff --git a/app/controllers/mixins/actions/vm_actions/remove_security_group.rb b/app/controllers/mixins/actions/vm_actions/remove_security_group.rb
index abc1234..def5678 100644
--- a/app/controllers/mixins/actions/vm_actions/remove_security_group.rb
+++ b/app/controllers/mixins/actions/vm_actions/remove_security_group.rb
@@ -11,7 +11,7 @@ remove_security_group
@refresh_partial = "vm_common/remove_security_group"
else
- javascript_redirect :controller => 'vm', :action => 'remove_security_group', :rec_id => @record.id, :escape => false
+ javascript_redirect(:controller => 'vm', :action => 'remove_security_group', :rec_id => @record.id, :escape => false)
end
else
add_flash(_("Unable to remove Security Group from Instance \"%{name}\": %{details}") % {
|
Fix rubocop warning in VmActions::RemoveSecurityGroup
|
diff --git a/spec/support/log_redirect_helper.rb b/spec/support/log_redirect_helper.rb
index abc1234..def5678 100644
--- a/spec/support/log_redirect_helper.rb
+++ b/spec/support/log_redirect_helper.rb
@@ -13,6 +13,10 @@
def output
@msgs.join("\n")
+ end
+
+ def flush
+ nil
end
def clear!
|
Add noop flush for fake log
|
diff --git a/lita-reviewme.gemspec b/lita-reviewme.gemspec
index abc1234..def5678 100644
--- a/lita-reviewme.gemspec
+++ b/lita-reviewme.gemspec
@@ -15,7 +15,7 @@ spec.require_paths = ["lib"]
spec.add_runtime_dependency "lita", ">= 3.1"
- spec.add_runtime_dependency "octokit", "~> 3.7"
+ spec.add_runtime_dependency "octokit", [">= 3.0", "<5.0"]
spec.add_development_dependency "bundler", "~> 1.3"
spec.add_development_dependency "fakeredis"
|
Upgrade dependency requirement for octokit
Why:
* Version four has been out for over six months
* Another [Github related Lita extension](https://rubygems.org/gems/lita-github-web-hooks-core) is requiring version 4
|
diff --git a/app/db/migrate/20160207203318_create_resources.rb b/app/db/migrate/20160207203318_create_resources.rb
index abc1234..def5678 100644
--- a/app/db/migrate/20160207203318_create_resources.rb
+++ b/app/db/migrate/20160207203318_create_resources.rb
@@ -0,0 +1,11 @@+class CreateResources < ActiveRecord::Migration
+ def change
+ create_table :resources do |t|
+ t.string :name, null: false, default: ''
+
+ t.timestamps null: false
+ end
+
+ add_index :resources, :name, unique: true
+ end
+end
|
Add migration for default content
The only class the application knows is a generic 'Resource' that has
a name as its only attribute. A migration has been added to create the
table.
|
diff --git a/Casks/handbrakecli-nightly.rb b/Casks/handbrakecli-nightly.rb
index abc1234..def5678 100644
--- a/Casks/handbrakecli-nightly.rb
+++ b/Casks/handbrakecli-nightly.rb
@@ -1,6 +1,6 @@ cask :v1 => 'handbrakecli-nightly' do
- version '7010svn'
- sha256 '1ab548fe2c78fa8115736e0c26091283e2ab990825385012bf652ce3803322ac'
+ version '7031svn'
+ sha256 '29584bd078000dc79c95c56aa9483e7bc5d6cce048349414e4016bcea68ef76d'
url "http://download.handbrake.fr/nightly/HandBrake-#{version}-MacOSX.6_CLI_x86_64.dmg"
homepage 'http://handbrake.fr'
|
Update HandbrakeCLI Nightly to v7031svn
HandBrakeCLI Nightly v7031svn built 2015-03-31.
|
diff --git a/app/helpers/blacklight_cornell_requests/request_helper.rb b/app/helpers/blacklight_cornell_requests/request_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/blacklight_cornell_requests/request_helper.rb
+++ b/app/helpers/blacklight_cornell_requests/request_helper.rb
@@ -5,7 +5,7 @@ # instead of integers. This function converts the range into a string for display
def delivery_estimate_display time_estimate
- if time_estimate[0] = time_estimate[1]
+ if time_estimate[0] == time_estimate[1]
pluralize(time_estimate[0], 'working day')
else
"#{time_estimate[0]} to #{time_estimate[1]} working days"
|
Fix bug in delivery time estimates display (DISCOVERYACCESS-950)
|
diff --git a/ettu.gemspec b/ettu.gemspec
index abc1234..def5678 100644
--- a/ettu.gemspec
+++ b/ettu.gemspec
@@ -17,7 +17,9 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ['lib']
- spec.add_dependency 'rails', '>= 4.0'
+ spec.required_ruby_version = '>= 1.9'
+
+ spec.add_dependency 'rails', '>= 3.2'
spec.add_development_dependency 'bundler', '~> 1.3'
spec.add_development_dependency 'rake'
spec.add_development_dependency 'rspec'
|
Allow Rails v3.* as long as Ruby >= 1.9
|
diff --git a/app/models/photo.rb b/app/models/photo.rb
index abc1234..def5678 100644
--- a/app/models/photo.rb
+++ b/app/models/photo.rb
@@ -7,6 +7,7 @@ key :description, String
key :dimensions, Dimensions
key :etag, String
+ key :key, Key
key :last_modified, Time
key :orientation, Orientation
key :photographed_at, Time
@@ -39,6 +40,10 @@ end
alias :== :eql?
+ def key
+ Key.from_mongo super # mongo_mapper key type is misbehaving
+ end
+
def original
Original.find key
end
|
Store Photo Key as key
|
diff --git a/test/integration/default/minitest/test_default.rb b/test/integration/default/minitest/test_default.rb
index abc1234..def5678 100644
--- a/test/integration/default/minitest/test_default.rb
+++ b/test/integration/default/minitest/test_default.rb
@@ -7,6 +7,6 @@ it "check R version" do
system('echo "q()" > /tmp/showversion.R')
system('/usr/local/R-devel/bin/R CMD BATCH /tmp/showversion.R')
- assert system('grep "R version 3.4.0 Patched" showversion.Rout'), 'R version is not expected version. patched version is updated'
+ assert system('grep "R version 3.4.1 Patched" showversion.Rout'), 'R version is not expected version. patched version is updated'
end
end
|
Update R version for default
|
diff --git a/config.rb b/config.rb
index abc1234..def5678 100644
--- a/config.rb
+++ b/config.rb
@@ -17,3 +17,4 @@ # To disable debugging comments that display the original location of your selectors. Uncomment:
line_comments = true
environment = :development
+sass_options = {:cache_location => "/d1/sass-cache"}
|
Move sass-cache out of project
|
diff --git a/config.rb b/config.rb
index abc1234..def5678 100644
--- a/config.rb
+++ b/config.rb
@@ -27,6 +27,7 @@ }
configure :development do
+ set :protection, false
use Slimmer::App, prefix: settings.router[:path_prefix], asset_host: settings.slimmer_asset_host
end
|
Disable rack protection in development.
This prevents the spurious 403 errors on /preload-autocomplete, although
I'm not sure if this is the correct solution. It would probably be better
to get rack-protection working properly.
|
diff --git a/config.rb b/config.rb
index abc1234..def5678 100644
--- a/config.rb
+++ b/config.rb
@@ -1,19 +1,3 @@-###
-# Compass
-###
-
-# Change Compass configuration
-# compass_config do |config|
-# config.output_style = :compact
-# end
-
-###
-# Helpers
-###
-
-# Automatic image dimensions on image_tag helper
-# activate :automatic_image_sizes
-
# Reload the browser automatically whenever files change
configure :development do
activate :livereload
@@ -38,14 +22,8 @@ # Minify Javascript on build
activate :minify_javascript
- # Enable cache buster
- # activate :asset_hash
-
- # Use relative URLs
- # activate :relative_assets
-
- # Or use a different image path
- # set :http_prefix, "/Content/images/"
+ # Enable cache buster asset hashing of files
+ activate :asset_hash
end
# Gzip files
@@ -66,3 +44,6 @@ # Set this to true to deploy to s3
config.after_build = false
end
+
+# add default caching policy to all files
+default_caching_policy max_age:(60 * 60 * 24 * 365)
|
Enable asset hashing of files; set default caching policy on newly created s3 files
|
diff --git a/config.ru b/config.ru
index abc1234..def5678 100644
--- a/config.ru
+++ b/config.ru
@@ -12,7 +12,7 @@ map '/' do
app = Cyclid::API::App
app.set :bind, '0.0.0.0'
- app.set :port, 80
+ app.set :port, 8361
app.run!
end
end
@@ -21,7 +21,7 @@ map '/' do
app = Cyclid::API::App
app.set :bind, '127.0.0.1'
- app.set :port, 8092
+ app.set :port, 8361
app.run!
end
|
Use the new standard API port
|
diff --git a/stately-jekyll.gemspec b/stately-jekyll.gemspec
index abc1234..def5678 100644
--- a/stately-jekyll.gemspec
+++ b/stately-jekyll.gemspec
@@ -19,6 +19,9 @@ spec.add_development_dependency "rake", "~> 10.0"
spec.add_development_dependency "jemoji", "~> 0"
+ spec.add_runtime_dependency "jekyll", "~> 3.3"
+ spec.add_runtime_dependency "jemoji", "~> 0"
+
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
Add jemoji as a dep
|
diff --git a/criticL/spec/models/movie_spec.rb b/criticL/spec/models/movie_spec.rb
index abc1234..def5678 100644
--- a/criticL/spec/models/movie_spec.rb
+++ b/criticL/spec/models/movie_spec.rb
@@ -22,4 +22,19 @@ expect(movie2.avg_rating).to eq 7.5
end
end
+
+ describe "#search_by_title" do
+ it "searches for a movie by title and returns a collection of movies" do
+ movie3 = Movie.new(title:"The Dark Knight", release_date: "2002-2-2", summary: "I'm Batman!")
+ movie3.save
+ @movies = Movie.search_by_title("knight")
+ expect(@movies.length).to eq 1
+ end
+ it "returns the movie searched for" do
+ movie4 = Movie.new(title:"Iron Man", release_date: "2002-2-2", summary: "I am Iron Man")
+ movie4.save
+ @movies = Movie.search_by_title("iron")
+ expect(@movies[0].title).to eq "Iron Man"
+ end
+ end
end
|
Add tests for search function
|
diff --git a/adapter_extensions.gemspec b/adapter_extensions.gemspec
index abc1234..def5678 100644
--- a/adapter_extensions.gemspec
+++ b/adapter_extensions.gemspec
@@ -20,6 +20,8 @@ s.add_runtime_dependency('rake', '>= 0.8.3')
s.add_runtime_dependency('activesupport', '>= 2.1.0')
s.add_runtime_dependency('activerecord', '>= 2.1.0')
+ s.add_development_dependency('flexmock')
+ s.add_development_dependency('mysql2', '< 0.3')
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test}/*`.split("\n")
|
Add missing development dependencies (first pass)
|
diff --git a/ruby/hamsters.rb b/ruby/hamsters.rb
index abc1234..def5678 100644
--- a/ruby/hamsters.rb
+++ b/ruby/hamsters.rb
@@ -0,0 +1,18 @@+print "What is the hamsters name: "
+name = gets.chomp
+
+print "What is the volume (1-10) "
+volume = gets.chomp
+
+print "What is the fur color? "
+fur_color = gets.chomp
+
+print "Good candidate for adoption (Good Bad): "
+good_bad_candidate = gets.chomp
+
+print "Estimated age: "
+age = gets.chomp
+
+if age == ""
+ age = nil
+end
|
Create hamster file & update with questions
|
diff --git a/recipes/mesosphere.rb b/recipes/mesosphere.rb
index abc1234..def5678 100644
--- a/recipes/mesosphere.rb
+++ b/recipes/mesosphere.rb
@@ -23,7 +23,7 @@ install_mesos
deploy_service_scripts
else
- Chef::Log.info("Mesos is already installed!! Instllation will be skipped.")
+ Chef::Log.info("Mesos is already installed!! Installation will be skipped.")
end
service "mesos-master" do
|
Fix small typo in the log message
|
diff --git a/farmbot.rb b/farmbot.rb
index abc1234..def5678 100644
--- a/farmbot.rb
+++ b/farmbot.rb
@@ -1,6 +1,5 @@ # FarmBot Controller
require 'pry'
-
require_relative 'settings.rb'
system('clear')
@@ -13,6 +12,7 @@ puts ' \/ '
puts '========='
+require_relative 'lib/status'
$status = Status.new
$shutdown = 0
|
Add status require statemnt back
|
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
@@ -0,0 +1,20 @@+Given /^a spec file named "([^"]*)" with:$/ do |file_name, string|
+ steps %Q{
+ Given a file named "#{file_name}" with:
+ """ruby
+ require 'rock_candy'
+
+ #{string}
+ """
+ }
+end
+
+When /^I set environment variable "(.*?)" to "(.*?)"$/ do |variable, value|
+ set_env(variable, value)
+end
+
+Then /^the examples?(?: all)? pass(?:es)?$/ do
+ step %q{the output should contain "0 failures"}
+ step %q{the output should not contain "0 examples"}
+ step %q{the exit status should be 0}
+end
|
Add custom step definitions for integration tests.
The Aruba cucumber library adds `lib` to the load path. However, it does
not auto load any files. Add a helper step to include this library so it
does not need to be required in each scenario.
Add a declarative step for checking the RSpec output from features.
|
diff --git a/test/tilt_fallback_test.rb b/test/tilt_fallback_test.rb
index abc1234..def5678 100644
--- a/test/tilt_fallback_test.rb
+++ b/test/tilt_fallback_test.rb
@@ -0,0 +1,113 @@+require 'contest'
+require 'tilt'
+
+class TiltFallbackTest < Test::Unit::TestCase
+ class FailTemplate < Tilt::Template
+ def self.engine_initialized?; false end
+ def prepare; end
+
+ def initialize_engine
+ raise LoadError, "can't load #{self.class}"
+ end
+ end
+
+ class WinTemplate < Tilt::Template
+ def self.engine_initialized?; true end
+ def prepare; end
+ end
+
+ FailTemplate2 = FailTemplate.dup
+ WinTemplate2 = WinTemplate.dup
+
+ def set_ivar(obj, name, value)
+ obj.instance_variable_set("@#{name}", value)
+ end
+
+ def clear_ivar(obj, name)
+ ivar = "@#{name}"
+ value = obj.instance_variable_get(ivar)
+ ensure
+ obj.instance_variable_set(ivar, value.dup.clear)
+ end
+
+ setup do
+ # Make sure every test have no mappings.
+ @p = clear_ivar(Tilt, :preferred_mappings)
+ @t = clear_ivar(Tilt, :template_mappings)
+ end
+
+ teardown do
+ set_ivar(Tilt, :preferred_mappings, @p)
+ set_ivar(Tilt, :template_mappings, @t)
+ end
+
+ test "returns nil on unregistered extensions" do
+ template = Tilt["md"]
+ assert_equal nil, template
+ end
+
+ test "returns the last registered template" do
+ Tilt.register("md", WinTemplate)
+ Tilt.register("md", WinTemplate2)
+
+ template = Tilt["md"]
+ assert_equal WinTemplate2, template
+ end
+
+ test "returns the last registered working template" do
+ Tilt.register("md", WinTemplate)
+ Tilt.register("md", FailTemplate)
+
+ template = Tilt["md"]
+ assert_equal WinTemplate, template
+ end
+
+ test "if every template fails, raise the exception from the first template" do
+ Tilt.register("md", FailTemplate)
+ Tilt.register("md", FailTemplate2)
+
+ exc = assert_raise(LoadError) { Tilt["md"] }
+ assert_match /FailTemplate2/, exc.message
+ end
+
+ test ".prefer should also register the template" do
+ Tilt.prefer(WinTemplate, "md")
+ assert Tilt.registered?("md")
+ end
+
+ test ".prefer always win" do
+ Tilt.register("md", FailTemplate)
+ Tilt.register("md", WinTemplate)
+ Tilt.prefer(FailTemplate, "md")
+
+ template = Tilt["md"]
+ assert_equal FailTemplate, template
+ end
+
+ test ".prefer accepts multiple extensions" do
+ extensions = %w[md mkd markdown]
+ Tilt.prefer(FailTemplate, *extensions)
+
+ extensions.each do |ext|
+ template = Tilt[ext]
+ assert_equal FailTemplate, template
+ end
+ end
+
+ test ".prefer with no extension should use already registered extensions" do
+ extensions = %w[md mkd markdown]
+
+ extensions.each do |ext|
+ Tilt.register(ext, FailTemplate)
+ Tilt.register(ext, WinTemplate)
+ end
+
+ Tilt.prefer(FailTemplate)
+
+ extensions.each do |ext|
+ template = Tilt[ext]
+ assert_equal FailTemplate, template
+ end
+ end
+end
+
|
Add tests for fallback mode
|
diff --git a/vignesh/10_sep/sinatra/hello.rb b/vignesh/10_sep/sinatra/hello.rb
index abc1234..def5678 100644
--- a/vignesh/10_sep/sinatra/hello.rb
+++ b/vignesh/10_sep/sinatra/hello.rb
@@ -23,7 +23,7 @@
get'/studb' do
-result= ' Result = '
+result= 'The Result is ' + "<br>"
{
"Name "=>"VIGNESH ",
@@ -32,9 +32,9 @@ }.each do |key,value|
-result = result+key.to_s
+result = result+key.to_s
-result = result+value.to_s
+result = result+value.to_s + "<br>"
end
|
Make Alignment for the Output
|
diff --git a/examples/deploy.rb b/examples/deploy.rb
index abc1234..def5678 100644
--- a/examples/deploy.rb
+++ b/examples/deploy.rb
@@ -1,4 +1,4 @@-set :application, "asb"
+set :application, "application"
# create a pseudo terminal for every command, otherwise SSH/SVN breaks
#default_run_options[:pty] = true
|
Update to generic application name
|
diff --git a/attr_vault.gemspec b/attr_vault.gemspec
index abc1234..def5678 100644
--- a/attr_vault.gemspec
+++ b/attr_vault.gemspec
@@ -18,6 +18,6 @@ gem.add_runtime_dependency 'fernet', '~> 2.1'
gem.add_development_dependency "rspec", '~> 3.0'
- gem.add_development_dependency "pg"
- gem.add_development_dependency "sequel", '~> 4.13.0'
+ gem.add_development_dependency "pg", '~> 0'
+ gem.add_development_dependency "sequel", '~> 4.13'
end
|
Adjust gem dependencies according to warnings
|
diff --git a/SpinKit.podspec b/SpinKit.podspec
index abc1234..def5678 100644
--- a/SpinKit.podspec
+++ b/SpinKit.podspec
@@ -7,7 +7,7 @@ s.source = {:git => 'https://github.com/raymondjavaxx/SpinKit-ObjC.git', :tag => '1.2.0'}
s.license = {:type => 'MIT', :file => 'LICENSE'}
s.platform = :ios, '6.0'
- s.public_header_files = 'SpinKit/RTSpinKitView.h'
+ s.public_header_files = 'SpinKit/RTSpinKitView.h', 'SpinKit/RTSpinKitAnimating.h'
s.source_files = 'SpinKit/**/*.{m,h}'
s.requires_arc = true
end
|
Add animator to public headers
|
diff --git a/app/services/organisational_section_service_registry.rb b/app/services/organisational_section_service_registry.rb
index abc1234..def5678 100644
--- a/app/services/organisational_section_service_registry.rb
+++ b/app/services/organisational_section_service_registry.rb
@@ -1,5 +1,2 @@ class OrganisationalSectionServiceRegistry < AbstractSectionServiceRegistry
- def initialize(organisation_slug:)
- @organisation_slug = organisation_slug
- end
end
|
Remove unused service registry constructor
|
diff --git a/script/import_i18n.rb b/script/import_i18n.rb
index abc1234..def5678 100644
--- a/script/import_i18n.rb
+++ b/script/import_i18n.rb
@@ -0,0 +1,19 @@+#!/usr/bin/env ruby
+
+SOURCE = "#{ENV['HOME']}/Downloads/OneBody.zip"
+
+if File.exist?(SOURCE)
+ puts `unzip #{SOURCE} -d /tmp/i18n`
+ Dir['/tmp/i18n/*'].each do |dir|
+ next unless File.directory?(dir)
+ dest = File.split(dir).last
+ Dir[File.join(dir, '*')].each do |file|
+ locale = File.split(file).last.split('.').first
+ puts `mv #{file} config/locales/#{locale}/#{dest}`
+ end
+ end
+ puts `rm -rf /tmp/i18n`
+else
+ puts "#{SOURCE} not found."
+ exit(1)
+end
|
Add really dumb script for importing i18n from OneSky.
|
diff --git a/lib/generators/forest/scaffold/templates/model.rb b/lib/generators/forest/scaffold/templates/model.rb
index abc1234..def5678 100644
--- a/lib/generators/forest/scaffold/templates/model.rb
+++ b/lib/generators/forest/scaffold/templates/model.rb
@@ -3,5 +3,9 @@ include Blockable
include Sluggable
include Statusable
+
+ # def self.resource_description
+ # "Briefly describe this resource."
+ # end
end
<% end -%>
|
Add resource_description placeholder method in scaffold generator
|
diff --git a/web/app/mailers/admin_mailer.rb b/web/app/mailers/admin_mailer.rb
index abc1234..def5678 100644
--- a/web/app/mailers/admin_mailer.rb
+++ b/web/app/mailers/admin_mailer.rb
@@ -4,7 +4,7 @@ def invite_csv_file_email(respond_to, file)
mail_to = "no-reply@asicshub.com.br"
subject = "Invite File to Parse"
- content = "File attached. Respond to: " + respond_to;
+ content = "File attached. Respond to: " + respond_to + " and upload at: http://www.asicshub.com.br/admin/invitation/csv";
attachments[file.original_filename] = File.read(file.path)
|
Add instructions to CSV email
|
diff --git a/spec/adhearsion/xmpp_spec.rb b/spec/adhearsion/xmpp_spec.rb
index abc1234..def5678 100644
--- a/spec/adhearsion/xmpp_spec.rb
+++ b/spec/adhearsion/xmpp_spec.rb
@@ -4,8 +4,35 @@
subject { Adhearsion::XMPP }
- it "should be a module" do
- subject.should be_kind_of Module
+ before :each do
+ Adhearsion::XMPP.plugin = nil
+ end
+
+ it 'should delegate methods to the plugin connection' do
+ Adhearsion::XMPP.plugin = mock :plugin
+ connection = mock :connection
+ Adhearsion::XMPP.plugin.should_receive(:connection).and_return connection
+ connection.should_receive(:foo)
+
+ Adhearsion::XMPP.foo
+ end
+
+ it 'should hold on to handlers until the plugin is initialized' do
+ mock_handlers = lambda { :does_not_matter }
+ Adhearsion::PunchblockPlugin.should_not_receive(:connection)
+
+ Adhearsion::XMPP.register_handlers &mock_handlers
+ Adhearsion::XMPP.handlers.should == mock_handlers
+ end
+
+ it 'should immediately register the handlers if the plugin is initialized' do
+ mock_handlers = lambda { :does_not_matter }
+ Adhearsion::XMPP.plugin = mock :plugin
+ connection = mock :connection
+ Adhearsion::XMPP.plugin.should_receive(:connection).and_return connection
+ connection.should_receive(:register_handlers).once.with(&mock_handlers)
+
+ Adhearsion::XMPP.register_handlers &mock_handlers
end
end
|
Add specs for XMPP class
|
diff --git a/app/controllers/api/docs/bugs.rb b/app/controllers/api/docs/bugs.rb
index abc1234..def5678 100644
--- a/app/controllers/api/docs/bugs.rb
+++ b/app/controllers/api/docs/bugs.rb
@@ -3,6 +3,59 @@ class Bugs
# :nocov:
include Swagger::Blocks
+
+ swagger_schema :Bug do
+ key :required, [:bug_id, :bug_status, :resolution, :bug_severity,
+ :product, :component, :assigned_to, :reporter,
+ :short_desc, :created_at, :updated_at]
+ property :bug_id do
+ key :type, :integer
+ key :format, :int64
+ key :description, 'Bug ID from bugzilla.altlinux.org'
+ end
+ property :bug_status do
+ key :type, :string
+ key :description, 'Bug status'
+ end
+ property :resolution do
+ key :type, :string
+ key :description, 'Bug resolution'
+ end
+ property :bug_severity do
+ key :type, :string
+ key :description, 'Bug severity'
+ end
+ property :product do
+ key :type, :string
+ key :description, 'Bug product'
+ end
+ property :component do
+ key :type, :string
+ key :description, 'Bug component'
+ end
+ property :assigned_to do
+ key :type, :string
+ key :description, 'Bug assigned to'
+ end
+ property :reporter do
+ key :type, :string
+ key :description, 'Bug reporter'
+ end
+ property :short_desc do
+ key :type, :string
+ key :description, 'Bug short description'
+ end
+ property :created_at do
+ key :type, :string
+ key :format, :'date-time'
+ key :description, 'Created at in ISO8601 format'
+ end
+ property :updated_at do
+ key :type, :string
+ key :format, :'date-time'
+ key :description, 'Updated at in ISO8601 format'
+ end
+ end
swagger_path '/bugs/{bug_id}' do
operation :get do
|
Add swagger schema for Bug
|
diff --git a/spec/dolphy/response_spec.rb b/spec/dolphy/response_spec.rb
index abc1234..def5678 100644
--- a/spec/dolphy/response_spec.rb
+++ b/spec/dolphy/response_spec.rb
@@ -10,6 +10,10 @@ expect(response.headers).to eq({"Content-type" => "text/html"})
expect(response.body).to eq []
end
+
+ it "is an instance of Dolphy::Response" do
+ expect(response).to be_a(Dolphy::Response)
+ end
end
describe "#finish" do
|
Add test for instance of Dolphy::Response.
|
diff --git a/spec/swagger/v2/path_spec.rb b/spec/swagger/v2/path_spec.rb
index abc1234..def5678 100644
--- a/spec/swagger/v2/path_spec.rb
+++ b/spec/swagger/v2/path_spec.rb
@@ -0,0 +1,15 @@+require 'spec_helper'
+
+module Swagger
+ module V2
+ describe Path do
+ subject(:path) { Path.new({}) }
+ describe 'initial fields' do
+ describe '#parameters' do
+ subject { path.parameters }
+ it { is_expected.to eq(nil) }
+ end
+ end
+ end
+ end
+end
|
Add spec to make sure parameters is nil by default.
|
diff --git a/app/controllers/manager/instructeurs_controller.rb b/app/controllers/manager/instructeurs_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/manager/instructeurs_controller.rb
+++ b/app/controllers/manager/instructeurs_controller.rb
@@ -2,7 +2,7 @@ class InstructeursController < Manager::ApplicationController
def reinvite
instructeur = Instructeur.find(params[:id])
- instructeur.invite!
+ instructeur.user.invite!
flash[:notice] = "Instructeur réinvité."
redirect_to manager_instructeur_path(instructeur)
end
|
Fix invite instructeur from manager
|
diff --git a/app.rb b/app.rb
index abc1234..def5678 100644
--- a/app.rb
+++ b/app.rb
@@ -9,6 +9,10 @@
CLIENT = Mosca::Client.new
+def set_log_message msg
+ @message << Time.now.strftime("%D %H:%M:%S") + " #{msg}"
+end
+
Cuba.define do
on get do
on root do
@@ -18,22 +22,20 @@
on post do
on "publish/:topic/:payload" do |topic, payload|
- response = []
+ @message = []
begin
unless CLIENT.connected?
CLIENT.refresh_connection
- response << "Established connection to broker '#{CLIENT.broker}' and port '#{CLIENT.port}'"
+ set_log_message "Established connection to broker '#{CLIENT.broker}' and port '#{CLIENT.port}'"
end
CLIENT.publish! payload, topic_out: topic
- response << "Published the value '#{payload}' in channel '#{topic}'"
- res.write response
+ set_log_message "Published the value '#{payload}' in channel '#{topic}'"
rescue Timeout::Error
- response << "Connection timed out. Couldn't publish on broker"
- res.write response
+ set_log_message "Connection timed out. Couldn't publish on broker"
rescue Exception => e
- response << "ERROR: #{e.message}"
- res.write response
+ set_log_message "ERROR: #{e.message}"
end
+ res.write @message
end
end
end
|
Set time stamp in logs.
|
diff --git a/app/models/edition/user_needs.rb b/app/models/edition/user_needs.rb
index abc1234..def5678 100644
--- a/app/models/edition/user_needs.rb
+++ b/app/models/edition/user_needs.rb
@@ -13,7 +13,9 @@ has_many :edition_user_needs, foreign_key: :edition_id, dependent: :destroy, autosave: true
has_many :user_needs, through: :edition_user_needs
- accepts_nested_attributes_for :user_needs, reject_if: lambda { |attrs| attrs.values.any?(&:blank?) }
+ accepts_nested_attributes_for :user_needs, reject_if: lambda { |attrs|
+ attrs.reject { |k, _| k == "organisation_id" }.values.all?(&:blank?)
+ }
validates_presence_of :user_needs, unless: lambda {|edition| edition.deleted? || edition.imported? }
|
Validate new user needs for detailed guides
Rather than skipping the new user need fields if any of them are
blank, skip only if all the fields are blank and show validation
errors when anything has been filled in.
|
diff --git a/db/schema.rb b/db/schema.rb
index abc1234..def5678 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -13,10 +13,6 @@
ActiveRecord::Schema.define(version: 20130726103519) do
- # These are extensions that must be enabled in order to support this database
- enable_extension "plpgsql"
- enable_extension "postgis"
-
create_table "locations", force: true do |t|
t.string "bezirk"
t.string "ortsteil"
|
Prepare location to merge with master
|
diff --git a/app/graphql/hcxp_schema.rb b/app/graphql/hcxp_schema.rb
index abc1234..def5678 100644
--- a/app/graphql/hcxp_schema.rb
+++ b/app/graphql/hcxp_schema.rb
@@ -1,5 +1,7 @@ HcxpSchema = GraphQL::Schema.define do
query(Types::QueryType)
+
+ default_max_page_size 25
rescue_from ActiveRecord::RecordNotFound, &:message
|
Set global max_page_size for graphql
|
diff --git a/0_code_wars/who_likes_it.rb b/0_code_wars/who_likes_it.rb
index abc1234..def5678 100644
--- a/0_code_wars/who_likes_it.rb
+++ b/0_code_wars/who_likes_it.rb
@@ -0,0 +1,11 @@+# http://www.codewars.com/kata/5266876b8f4bf2da9b000362/
+# --- iteration 1 ---
+def likes(names)
+ case names.size
+ when 0 then "no one likes this"
+ when 1 then "#{names.first} likes this"
+ when 2 then "#{names.first} and #{names[1]} like this"
+ when 3 then "#{names.first}, #{names[1]} and #{names[2]} like this"
+ else "#{names.first}, #{names[1]} and #{names.size-2} others like this"
+ end
+end
|
Add code wars (6) - who likes it
|
diff --git a/test/test_01_add_worksheet.rb b/test/test_01_add_worksheet.rb
index abc1234..def5678 100644
--- a/test/test_01_add_worksheet.rb
+++ b/test/test_01_add_worksheet.rb
@@ -3,8 +3,41 @@
class TC_add_worksheet < Test::Unit::TestCase
- def test_true
- assert(true)
+ def setup
+ @workbook = WriteExcel.new(StringIO.new)
+ end
+
+ def test_ascii_worksheet_name
+
+ name = "Test"
+
+ assert_nothing_raised {
+ sheet = @workbook.add_worksheet(name)
+ assert_equal name, sheet.name
+ }
+
+ end
+
+ def test_utf_8_worksheet_name
+
+ name = "Décembre"
+
+ assert_nothing_raised {
+ sheet = @workbook.add_worksheet(name)
+ assert_equal utf8_to_16be(name), sheet.name
+ }
+
+ end
+
+ def test_utf_16be_worksheet_name
+
+ name = utf8_to_16be("Décembre")
+
+ assert_nothing_raised {
+ sheet = @workbook.add_worksheet(name, true)
+ assert_equal name, sheet.name
+ }
+
end
end
|
Test various encodings in worksheet names (failing)
|
diff --git a/anypresence_generator.gemspec b/anypresence_generator.gemspec
index abc1234..def5678 100644
--- a/anypresence_generator.gemspec
+++ b/anypresence_generator.gemspec
@@ -20,9 +20,9 @@ spec.add_development_dependency "rake"
spec.add_development_dependency "test-unit"
- spec.add_runtime_dependency "oj", "~> 2.12.1"
- spec.add_runtime_dependency "rest-client", "~> 1.6.7"
+ spec.add_runtime_dependency "oj", "~> 2.14.5"
+ spec.add_runtime_dependency "rest-client", "~> 1.8.0"
spec.add_runtime_dependency "recursive-open-struct", "1.0.1"
- spec.add_runtime_dependency "fast_blank", "~> 0.0.2"
+ spec.add_runtime_dependency "fast_blank", "~> 1.0.0"
spec.add_runtime_dependency "bundler", "~> 1.5"
end
|
Upgrade oj, rest-client, and fast_blank.
|
diff --git a/spec/test_examples.rb b/spec/test_examples.rb
index abc1234..def5678 100644
--- a/spec/test_examples.rb
+++ b/spec/test_examples.rb
@@ -0,0 +1,55 @@+#!/usr/bin/env ruby -wKU
+
+# Ensure that all of the examples start properly and respond to a request
+# successfully
+#
+# This set of tests relies on certain Unix commands that will not be available
+# on Windows.
+
+require 'fileutils'
+require 'net/http'
+require 'tmpdir'
+
+def wait_for_port(port, timeout_secs)
+ timeout_secs.times do
+ success = system("lsof -i:#{port} >/dev/null")
+ return if success
+ sleep 1
+ end
+ abort("Port #{port} was not in use after waiting for #{timeout_secs} seconds")
+end
+
+def with_server(rackup_config)
+ pid_file = "#{Dir.tmpdir}/example.pid"
+ port = 9292
+ print "Starting server using #{rackup_config}..."
+ success = system("rackup --daemonize --pid #{pid_file} #{rackup_config}")
+ abort("Unable to start server using #{example}") unless success
+ wait_for_port(port, 10)
+ puts "OK"
+
+ yield URI.parse("http://localhost:#{port}") if block_given?
+ensure
+ pid = File.read(pid_file)
+ puts "Stopping pid #{pid}"
+ system("kill -9 #{pid}")
+end
+
+def main
+ examples = Dir["./examples/*.ru"]
+ examples.each do |example|
+ with_server(example) do |uri|
+ http = Net::HTTP.new(uri.host, uri.port)
+ http.request_get("/") do |rsp|
+ puts ""
+ puts "GET #{uri}/ => HTTP #{rsp.code}"
+ rsp.each_header {|header| puts "#{header}: #{rsp[header]}" }
+ puts rsp.body
+ puts ""
+ abort("Received non-HTTP 200 response from #{uri}") unless rsp.code == "200"
+ end
+ end
+ end
+end
+
+main
|
Add script to confirm that examples are working
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.