diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/app/validators/previously_published_validator.rb b/app/validators/previously_published_validator.rb
index abc1234..def5678 100644
--- a/app/validators/previously_published_validator.rb
+++ b/app/validators/previously_published_validator.rb
@@ -1,14 +1,16 @@ class PreviouslyPublishedValidator < ActiveModel::Validator
def validate(record)
+ record.has_previously_published_error = false
+
if record.previously_published.nil?
record.errors[:base] << "You must specify whether the document has been published before"
record.has_previously_published_error = true
- elsif record.previously_published
- if record.first_published_at.blank?
- record.errors.add(:first_published_at, "can't be blank")
- elsif record.first_published_at > Time.zone.now
- record.errors.add(:first_published_at, "can't be set to a future date")
- end
+ elsif record.previously_published && record.first_published_at.blank?
+ record.errors.add(:first_published_at, "can't be blank")
+ end
+
+ if record.first_published_at && Time.zone.now < record.first_published_at
+ record.errors.add(:first_published_at, "can't be set to a future date")
end
end
end
|
Adjust first published at validator logic
It shouldn't be possible to set first_published_at to
a future date regardless of whether the document has
been previously published. The UI would prevent the user
from setting a future date if previously published was
false but a model level validation is probably more sensible
prevention.
|
diff --git a/govuk_template.gemspec b/govuk_template.gemspec
index abc1234..def5678 100644
--- a/govuk_template.gemspec
+++ b/govuk_template.gemspec
@@ -21,7 +21,7 @@ spec.add_development_dependency 'rake'
spec.add_development_dependency 'sprockets', '2.10.0'
spec.add_development_dependency 'sass', '3.2.9'
- spec.add_development_dependency 'govuk_frontend_toolkit', '0.32.2'
+ spec.add_development_dependency 'govuk_frontend_toolkit', '0.41.0'
spec.add_development_dependency 'gem_publisher', '1.3.0'
spec.add_development_dependency 'rspec', '2.14.1'
end
|
Update toolkit version so it pulls it from our own gem repo
|
diff --git a/coffee-script.gemspec b/coffee-script.gemspec
index abc1234..def5678 100644
--- a/coffee-script.gemspec
+++ b/coffee-script.gemspec
@@ -22,5 +22,5 @@ s.require_paths = ['lib']
s.executables = ['coffee']
- s.files = Dir['bin/*', 'examples/*', 'lib/**/*', 'coffee-script.gemspec', 'LICENSE', 'README']
+ s.files = Dir['bin/*', 'examples/*', 'lib/**/*', 'coffee-script.gemspec', 'LICENSE', 'README', 'package.json']
end
|
Add package.json to gemspec files so Narwhal integrations works when installed as a gem.
|
diff --git a/config/software/ffi-yajl.rb b/config/software/ffi-yajl.rb
index abc1234..def5678 100644
--- a/config/software/ffi-yajl.rb
+++ b/config/software/ffi-yajl.rb
@@ -32,8 +32,11 @@ build do
env = with_embedded_path()
- # Do not install development dependencies
- bundle "install --without development development_extras rbx", env: env
+ # We should not be installing development dependencies either, but
+ # this upstream bug causes issues between libyajl2-gem and ffi-yajl
+ # (specifically, "corrupted Gemfile.lock" failures)
+ # https://github.com/bundler/bundler/issues/4467
+ bundle "install --without development_extras", env: env
bundle "exec rake gem", env: env
delete "pkg/*java*"
|
Revert previous fix due to upstream bundler bug
|
diff --git a/config/software/td-agent.rb b/config/software/td-agent.rb
index abc1234..def5678 100644
--- a/config/software/td-agent.rb
+++ b/config/software/td-agent.rb
@@ -4,7 +4,7 @@ dependency "jemalloc" unless windows?
dependency "ruby"
dependency "nokogiri"
-dependency "postgresql"
+dependency "postgresql" unless windows?
dependency "fluentd"
build do
|
Disable postgresql bundle to avoid unstable build
|
diff --git a/test/helper.rb b/test/helper.rb
index abc1234..def5678 100644
--- a/test/helper.rb
+++ b/test/helper.rb
@@ -1,6 +1,3 @@-$:.unshift File.expand_path('..', __FILE__)
-$:.unshift File.expand_path('../../lib', __FILE__)
-require 'rubygems'
require 'rubygems/commands/webhook_command'
require 'rubygems/commands/yank_command'
require 'test/unit'
|
Remove unnecessary and require 'rubygems'
|
diff --git a/test/helper.rb b/test/helper.rb
index abc1234..def5678 100644
--- a/test/helper.rb
+++ b/test/helper.rb
@@ -35,7 +35,7 @@ end
def lines( s )
- s.to_s.lines.map.with_index{ |l, i| "#{i}:#{l.strip}" }
+ s.to_s.lines.map.with_index{ |l, i| "#{i}:#{l.strip}" } << :EOF
end
def match( a, b )
|
Make sure the number of lines tested match by explicitly testing for EOF.
|
diff --git a/lib/melissa_data/web_smart/client.rb b/lib/melissa_data/web_smart/client.rb
index abc1234..def5678 100644
--- a/lib/melissa_data/web_smart/client.rb
+++ b/lib/melissa_data/web_smart/client.rb
@@ -9,15 +9,23 @@ end
def property_by_apn(fips:, apn:)
- res = process(@client.property_by_apn(fips: fips, apn: apn), 'property')
- add_coordinates(res) unless MelissaData::GeoLookup::Geocoder.coordinates? res
- res
+ @response = process(@client.property_by_apn(fips: fips, apn: apn), 'property')
+ resolve_response
end
def property_by_address_key(address_key:)
- res = process(@client.property_by_address_key(address_key: address_key), 'property')
- add_coordinates(res) unless MelissaData::GeoLookup::Geocoder.coordinates? res
- res
+ @response = process(@client.property_by_address_key(address_key: address_key), 'property')
+ resolve_response
+ end
+
+ def success?
+ !@response.key?(:errors)
+ end
+
+ def resolve_response
+ return @response unless success?
+ add_coordinates(@response) unless MelissaData::GeoLookup::Geocoder.coordinates? @response
+ @response
end
def address(address:, city:, state:, zip:, country: "USA")
@@ -30,10 +38,10 @@ end
def add_coordinates(response)
- addr = response[:property_address][:address]
- city = response[:property_address][:city]
- state = response[:property_address][:state]
- zip = response[:property_address][:zip]
+ addr = response.dig(:property_address, :address)
+ city = response.dig(:property_address, :city)
+ state = response.dig(:property_address, :state)
+ zip = response.dig(:property_address, :zip)
full_address = "#{addr}, #{city}, #{state}, #{zip}"
MelissaData::GeoLookup::Geocoder
.address_to_coordinates(full_address)
|
Update ::WebSmart::Client to handle error responses gracefully
- Update key lookup to use Hash#dig
|
diff --git a/lib/rgearmand/persistence/mongodb.rb b/lib/rgearmand/persistence/mongodb.rb
index abc1234..def5678 100644
--- a/lib/rgearmand/persistence/mongodb.rb
+++ b/lib/rgearmand/persistence/mongodb.rb
@@ -13,7 +13,7 @@ def load!
# LOAD
# Read jobs from the persistent queue
- logger.debug "Loading jobs from redis"
+ logger.debug "Loading jobs from mongo"
count = 0
start_time = Time.now
@collection.find().each do |job|
|
Change log name in the mongo adapter.
|
diff --git a/ffi-rxs.gemspec b/ffi-rxs.gemspec
index abc1234..def5678 100644
--- a/ffi-rxs.gemspec
+++ b/ffi-rxs.gemspec
@@ -12,6 +12,7 @@ s.description = %q{Ruby FFI bindings for Crossroads I/O networking library.}
s.files = `git ls-files`.split("\n")
+ s.files = s.files.reject{ |f| f.include?('ext/libxs.so') }
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
|
Exclude libxs.so from the gem build
|
diff --git a/spec/higher_level_api/integration/channel_open_stress_spec.rb b/spec/higher_level_api/integration/channel_open_stress_spec.rb
index abc1234..def5678 100644
--- a/spec/higher_level_api/integration/channel_open_stress_spec.rb
+++ b/spec/higher_level_api/integration/channel_open_stress_spec.rb
@@ -0,0 +1,22 @@+require "spec_helper"
+
+describe "Rapidly opening and closing lots of channels" do
+ let(:connection) do
+ c = Bunny.new(:user => "bunny_gem", :password => "bunny_password", :vhost => "bunny_testbed")
+ c.start
+ c
+ end
+
+ after :all do
+ connection.close
+ end
+
+ it "works correctly" do
+ xs = Array.new(2000) { connection.create_channel }
+
+ xs.size.should == 2000
+ xs.each do |ch|
+ ch.close
+ end
+ end
+end
|
Rework the way network loop notifies threads waiting on blocking Bunny::Channel methods
Makes full test suite pass on both JRuby and CRuby 1.9.
|
diff --git a/UICountingLabel.podspec b/UICountingLabel.podspec
index abc1234..def5678 100644
--- a/UICountingLabel.podspec
+++ b/UICountingLabel.podspec
@@ -7,6 +7,7 @@ s.author = { "Tim Gostony" => "dataxpress@gmail.com" }
s.source = { :git => "https://github.com/dataxpress/UICountingLabel.git", :tag => s.version.to_s }
s.ios.deployment_target = '5.0'
+ s.tvos.deployment_target = '9.0'
s.source_files = 'UICountingLabel.{h,m}'
s.exclude_files = 'Classes/Exclude'
s.requires_arc = true
|
Add support for TVOS to podspec
http://blog.cocoapods.org/CocoaPods-0.39/
|
diff --git a/lib/metacrunch/ubpb/transformations/mab2snr/helpers/common_helper.rb b/lib/metacrunch/ubpb/transformations/mab2snr/helpers/common_helper.rb
index abc1234..def5678 100644
--- a/lib/metacrunch/ubpb/transformations/mab2snr/helpers/common_helper.rb
+++ b/lib/metacrunch/ubpb/transformations/mab2snr/helpers/common_helper.rb
@@ -5,6 +5,23 @@ module Helpers
module CommonHelper
+ def is_superorder?
+ unless @is_superorder
+ f051 = source.controlfield("051") || []
+ f052 = source.controlfield("052") || []
+
+ @is_superorder = (
+ f051.at(0) == "n" ||
+ f051.at(0) == "t" ||
+ f052.at(0) == "p" ||
+ f052.at(0) == "r" ||
+ f052.at(0) == "z"
+ )
+ end
+
+ @is_superorder
+ end
+
end
end
end
|
Add helper to determine if a record is a superorder.
|
diff --git a/lib/sastrawi/morphology/disambiguator/disambiguator_prefix_rule42.rb b/lib/sastrawi/morphology/disambiguator/disambiguator_prefix_rule42.rb
index abc1234..def5678 100644
--- a/lib/sastrawi/morphology/disambiguator/disambiguator_prefix_rule42.rb
+++ b/lib/sastrawi/morphology/disambiguator/disambiguator_prefix_rule42.rb
@@ -0,0 +1,17 @@+module Sastrawi
+ module Morphology
+ module Disambiguator
+ class DisambiguatorPrefixRule42
+ def disambiguate(word)
+ contains = /^kau(.*)$/.match(word)
+
+ if contains
+ matches = contains.captures
+
+ return matches[0]
+ end
+ end
+ end
+ end
+ end
+end
|
Add implementation of fortieth-second rule of disambiguator prefix
|
diff --git a/lib/jqgrid_rails/jqgrid_rails_helpers.rb b/lib/jqgrid_rails/jqgrid_rails_helpers.rb
index abc1234..def5678 100644
--- a/lib/jqgrid_rails/jqgrid_rails_helpers.rb
+++ b/lib/jqgrid_rails/jqgrid_rails_helpers.rb
@@ -1,32 +1,8 @@ module JqGridRails
module Helpers
- # arg:: Object
- # Does a simple transition on types from Ruby to Javascript.
- def format_type_to_js(arg)
- case arg
- when Array
- "[#{arg.map{|value| format_type_to_js(value)}.join(',')}]"
- when Hash
- "{#{arg.map{ |key, value|
- k = key.is_a?(Symbol) ? key.to_s.camelize.sub(/^./, key.to_s[0,1].downcase) : "'#{key}'"
- "#{k}:#{format_type_to_js(value)}"
- }.join(',')}}"
- when Fixnum
- arg.to_s
- when TrueClass
- arg.to_s
- when FalseClass
- arg.to_s
- else
- arg.to_s =~ %r{^\s*function\s*\(} ? arg.to_s : "'#{escape_javascript(arg.to_s)}'"
- end
- end
+ include RailsJavaScriptHelpers
- # dom_id:: DOM ID
- # Convert DOM ID
- def convert_dom_id(dom_id)
- dom_id.to_s.start_with?('#') ? dom_id : "##{dom_id}"
- end
+ alias_method :convert_dom_id, :format_id
# key:: ondbl_click_row/on_select_row
# Sets up click event functions based on hash values
|
Use standardized helpers. Include alias to support currently library calls
|
diff --git a/lib/filter/boolean_field_builder.rb b/lib/filter/boolean_field_builder.rb
index abc1234..def5678 100644
--- a/lib/filter/boolean_field_builder.rb
+++ b/lib/filter/boolean_field_builder.rb
@@ -7,12 +7,12 @@ name = "#{attr}_eq"
haml_tag :div, class: "form-group" do
- if opts[:attribute_type] == :ransack
- haml_concat label(opts[:namespace], attr, opts[:title] || attr.to_s.humanize)
- haml_concat select(opts[:namespace], attr, [['Yes', 'true'], ['No', 'false']], {include_blank: 'Any', selected: value}, {class: 'form-control'})
- elsif opts[:attribute_override_type] == :ransack
+ if opts.fetch(:tristate, false)
+
+ # TODO make this a radio
haml_concat label(opts[:namespace], name, opts[:title] || attr.to_s.humanize)
haml_concat select(opts[:namespace], name, [['Yes', 'true'], ['No', 'false']], {include_blank: 'Any', selected: value}, {class: 'form-control'})
+
else
haml_tag :div, class: 'checkbox' do
haml_tag :label do
|
Remove leftover, give tri-state boolean option a self-descriptive name
|
diff --git a/config/application.rb b/config/application.rb
index abc1234..def5678 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -14,6 +14,12 @@ # Block referer spam
config.middleware.use Rack::Attack
+ # Compress Rails-generated responses
+ config.middleware.use Rack::Deflater
+
+ # Also use Rack::Deflater for runtime asset compression
+ config.middleware.insert_before ActionDispatch::Static, Rack::Deflater
+
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
|
Compress served pages and assets
|
diff --git a/lib/pack_rat/extensions/active_record.rb b/lib/pack_rat/extensions/active_record.rb
index abc1234..def5678 100644
--- a/lib/pack_rat/extensions/active_record.rb
+++ b/lib/pack_rat/extensions/active_record.rb
@@ -1,23 +1,20 @@ module PackRat
module Extensions
module ActiveRecord
- def included(base)
- base.extend(ClassMethods)
+ def inherited(child_class)
+ child_class.send(:include, PackRat::CacheHelper)
+ super
end
-
- module ClassMethods
- def inherited(child_class)
- child_class.send(:include, PackRat::CacheHelper)
- super
- end
- end
-
end
end
end
-if defined? ActiveRecord::Base
-#ActiveSupport.on_load :active_record do
- ActiveRecord::Base.send(:include, PackRat::Extensions::ActiveRecord)
-# include PackRat::Extensions::ActiveRecord
+# Lazy load AR Extension into AR if ActiveSupport is there
+if defined? ActiveSupport
+ ActiveSupport.on_load :active_record do
+ extend PackRat::Extensions::ActiveRecord
+ end
+else
+ # Load immediately if no ActiveSupport loaded
+ ActiveRecord::Base.send(:extend, PackRat::Extensions::ActiveRecord) if defined? ActiveRecord::Base
end
|
Fix issues properly loading AR extension; Added lazy loading if ActiveSupport is available.
|
diff --git a/config/application.rb b/config/application.rb
index abc1234..def5678 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -19,7 +19,7 @@
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
- # config.time_zone = 'Central Time (US & Canada)'
+ config.time_zone = 'Pacific Time (US & Canada)'
# 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]
|
Change timezones to pacific timezone.
|
diff --git a/lib/puppet/parser/functions/api_fetch.rb b/lib/puppet/parser/functions/api_fetch.rb
index abc1234..def5678 100644
--- a/lib/puppet/parser/functions/api_fetch.rb
+++ b/lib/puppet/parser/functions/api_fetch.rb
@@ -39,7 +39,7 @@ end
if response.kind_of? Net::HTTPSuccess and response.body.length > 0
- puts response.body.split("\n")
+ return response.body.split("\n")
end
rescue Net::OpenTimeout, Net::ReadTimeout
return Array.new
|
Fix bug preventing API from returning data
|
diff --git a/lib/liftoff/configuration_parser.rb b/lib/liftoff/configuration_parser.rb
index abc1234..def5678 100644
--- a/lib/liftoff/configuration_parser.rb
+++ b/lib/liftoff/configuration_parser.rb
@@ -9,22 +9,22 @@
private
+ def evaluated_configuration
+ default_configuration.
+ merge(user_configuration).
+ merge(local_configuration)
+ end
+
def default_configuration
configuration_from_file(File.expand_path('../../../defaults/liftoffrc', __FILE__))
- end
-
- def local_configuration
- configuration_from_file(Dir.pwd + '/.liftoffrc')
end
def user_configuration
configuration_from_file(ENV['HOME'] + '/.liftoffrc')
end
- def evaluated_configuration
- default_configuration.
- merge(user_configuration).
- merge(local_configuration)
+ def local_configuration
+ configuration_from_file(Dir.pwd + '/.liftoffrc')
end
def configuration_from_file(path)
|
Put more-abstract methods above less-abstract ones
|
diff --git a/lib/spree_twitter_testimonials/engine.rb b/lib/spree_twitter_testimonials/engine.rb
index abc1234..def5678 100644
--- a/lib/spree_twitter_testimonials/engine.rb
+++ b/lib/spree_twitter_testimonials/engine.rb
@@ -6,11 +6,7 @@ isolate_namespace Spree
engine_name 'spree_twitter_testimonials'
- initializer 'spree_twitter_testimonials.action_controller' do |app|
- ActiveSupport.on_load :action_controller do
- helper SpreeTwitterTestimonials::TwitterHelper
- end
- end
+ ActionController::Base.send(:helper, SpreeTwitterTestimonials::TwitterHelper)
config.autoload_paths += %W(#{config.root}/lib)
|
Include helper on a different way
|
diff --git a/config/environment.rb b/config/environment.rb
index abc1234..def5678 100644
--- a/config/environment.rb
+++ b/config/environment.rb
@@ -1,5 +1,10 @@ # Load the rails application
require File.expand_path('../application', __FILE__)
+Encoding.default_external = Encoding::UTF_8
+Encoding.default_internal = Encoding::UTF_8
+
+Mysql2::Client::CHARSET_MAP['latin1'] = Encoding::UTF_8
+
# Initialize the rails application
OneBody::Application.initialize!
|
Set default encoding to utf8.
|
diff --git a/lib/proiel/cli/commands/validate.rb b/lib/proiel/cli/commands/validate.rb
index abc1234..def5678 100644
--- a/lib/proiel/cli/commands/validate.rb
+++ b/lib/proiel/cli/commands/validate.rb
@@ -23,12 +23,16 @@
if errors.empty?
puts "#{filename} is valid".green
+
+ exit 0
else
puts "#{filename} is invalid".red
errors.each do |error|
puts "* #{error}"
end
+
+ exit 1
end
end
end
|
Exit validation with useful exit codes.
|
diff --git a/lib/redcarpet/render/gitlab_html.rb b/lib/redcarpet/render/gitlab_html.rb
index abc1234..def5678 100644
--- a/lib/redcarpet/render/gitlab_html.rb
+++ b/lib/redcarpet/render/gitlab_html.rb
@@ -10,10 +10,12 @@ end
def block_code(code, language)
+ options = { options: {encoding: 'utf-8'} }
+
if Pygments::Lexer.find(language)
- Pygments.highlight(code, lexer: language, options: {encoding: 'utf-8'})
+ Pygments.highlight(code, options.merge(lexer: language.downcase))
else
- Pygments.highlight(code, options: {encoding: 'utf-8'})
+ Pygments.highlight(code, options)
end
end
|
Fix 500s because of "missing" lexer
|
diff --git a/test/cookbooks/hipsnip-jetty_test/recipes/custom_start_ini.rb b/test/cookbooks/hipsnip-jetty_test/recipes/custom_start_ini.rb
index abc1234..def5678 100644
--- a/test/cookbooks/hipsnip-jetty_test/recipes/custom_start_ini.rb
+++ b/test/cookbooks/hipsnip-jetty_test/recipes/custom_start_ini.rb
@@ -2,7 +2,7 @@
node.set['jetty']['port'] = 8080
node.set['jetty']['version'] = '8.1.10.v20130312'
-node.set['jetty']['link'] = 'http://eclipse.org/downloads/download.php?file=/jetty/stable-8/dist/jetty-distribution-8.1.10.v20130312.tar.gz&r=1'
+node.set['jetty']['link'] = 'http://eclipse.org/downloads/download.php?file=/jetty/8.1.10.v20130312/dist/jetty-distribution-8.1.10.v20130312.tar.gz&r=1'
node.set['jetty']['checksum'] = 'e966f87823adc323ce67e99485fea126b84fff5affdc28aa7526e40eb2ec1a5b'
# Interesting attributes here, currently tested now
|
Fix download link in test recipe
|
diff --git a/test/test_tunes_parser_a.rb b/test/test_tunes_parser_a.rb
index abc1234..def5678 100644
--- a/test/test_tunes_parser_a.rb
+++ b/test/test_tunes_parser_a.rb
@@ -16,9 +16,6 @@ assert_instance_of(ItunesParser::TunesParserA, @my_itunes_parser)
end
- # should "probably rename this file and start testing for real" do
- # flunk "hey buddy, you should probably rename this file and start testing for real"
- # end
end
end
|
Delete commented out dummy test.
|
diff --git a/metasploit_data_models_live.gemspec b/metasploit_data_models_live.gemspec
index abc1234..def5678 100644
--- a/metasploit_data_models_live.gemspec
+++ b/metasploit_data_models_live.gemspec
@@ -0,0 +1,25 @@+# -*- encoding: utf-8 -*-
+$:.push File.expand_path("../lib", __FILE__)
+require "metasploit_data_models/version"
+
+Gem::Specification.new do |s|
+ s.name = "metasploit_data_models"
+ s.version = "0.0.2.43DEV" # This gemspec is linked to metasploit releases and follows trunk
+ s.authors = ["Trevor Rosen"]
+ s.email = ["trevor_rosen@rapid7.com"]
+ s.homepage = ""
+ s.summary = %q{Database code for MSF and Metasploit Pro}
+ s.description = %q{Implements minimal ActiveRecord models and database helper code used in both the Metasploit Framework (MSF) and Metasploit commercial editions.}
+
+ s.files = `git ls-files`.split("\n")
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
+ s.require_paths = ["lib"]
+
+ # ---- Dependencies ----
+ s.add_development_dependency "rspec"
+ s.add_runtime_dependency "activerecord"
+ s.add_runtime_dependency "activesupport"
+ s.add_runtime_dependency "pg"
+ s.add_runtime_dependency "pry"
+end
|
Add a "live" gemspec for production builds
|
diff --git a/test/integration/gobierto_admin/gobierto_participation/processes/archive_process_test.rb b/test/integration/gobierto_admin/gobierto_participation/processes/archive_process_test.rb
index abc1234..def5678 100644
--- a/test/integration/gobierto_admin/gobierto_participation/processes/archive_process_test.rb
+++ b/test/integration/gobierto_admin/gobierto_participation/processes/archive_process_test.rb
@@ -22,17 +22,26 @@ @process ||= gobierto_participation_processes(:sport_city_process)
end
+ def process_stage_page
+ @process_stage_page ||= gobierto_participation_process_stage_pages(:sport_process_information_stage_page)
+ end
+
def test_archive_restore_process
with_javascript do
with_signed_in_admin(admin) do
with_current_site(site) do
visit @path
+ process_stage_page_id = process_stage_page.id
+ assert ::GobiertoParticipation::ProcessStagePage.where(id: process_stage_page_id).exists?
+
within "#process-item-#{process.id}" do
find("a[data-method='delete']").click
end
assert has_message?("The process has been archived correctly")
+
+ refute ::GobiertoParticipation::ProcessStagePage.where(id: process_stage_page_id).exists?
click_on "Archived elements"
|
Add test to check process_stage_pages are also destroyed
|
diff --git a/app/views/spree/api/legacy_return_authorizations/index.v1.rabl b/app/views/spree/api/legacy_return_authorizations/index.v1.rabl
index abc1234..def5678 100644
--- a/app/views/spree/api/legacy_return_authorizations/index.v1.rabl
+++ b/app/views/spree/api/legacy_return_authorizations/index.v1.rabl
@@ -4,4 +4,4 @@ end
node(:count) { @legacy_return_authorizations.count }
node(:current_page) { params[:page] || 1 }
-node(:pages) { @legacy_return_authorizations.num_pages }
+node(:pages) { @legacy_return_authorizations.total_pages }
|
Use Kaminari's total_pages instead of num_pages
num_pages has been removed in the latest version
|
diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/tags_controller.rb
+++ b/app/controllers/tags_controller.rb
@@ -3,7 +3,7 @@ before_action :set_current_tab, only: [:index, :show]
def index
- @tags = Tag.order(name: :desc)
+ @tags = Tag.order(:name)
end
def show
|
Change to Tag Index descending
|
diff --git a/app/models/amazon_retrieval_job.rb b/app/models/amazon_retrieval_job.rb
index abc1234..def5678 100644
--- a/app/models/amazon_retrieval_job.rb
+++ b/app/models/amazon_retrieval_job.rb
@@ -0,0 +1,13 @@+class AmazonRetrievalJob
+ def self.get_amazon_stuff
+ # Get objects from inside the the-golden-record bucket
+ # Using objects' information, create and save Track objects and clean out old objects
+ s3 = Aws::S3::Client.new(region: "us-east-1")
+ bucket = s3.list_objects(bucket: "the-golden-record")
+
+ bucket.contents.each do |track|
+
+ end
+
+ end
+end
|
Add base for amazon object retrieval
|
diff --git a/app/models/concerns/twitch_user.rb b/app/models/concerns/twitch_user.rb
index abc1234..def5678 100644
--- a/app/models/concerns/twitch_user.rb
+++ b/app/models/concerns/twitch_user.rb
@@ -21,7 +21,7 @@ end
def follows
- User.where(twitch_id: Twitch::Follows.find_by_user(self))
+ User.where(twitch_id: Twitch::Follows.find_by_user(self)).joins(:runs).group('user_id')
end
end
end
|
Fix frontpage showing follows with 0 runs
|
diff --git a/app/models/spree/sale_promotion.rb b/app/models/spree/sale_promotion.rb
index abc1234..def5678 100644
--- a/app/models/spree/sale_promotion.rb
+++ b/app/models/spree/sale_promotion.rb
@@ -7,8 +7,6 @@
accepts_nested_attributes_for :sale_prices
- attr_accessor :taxons_ids
-
after_save :touch_all_prices
def touch_all_prices
|
Remove accessor de SalePromotion nao utilizado
|
diff --git a/gettext_i18n_rails.gemspec b/gettext_i18n_rails.gemspec
index abc1234..def5678 100644
--- a/gettext_i18n_rails.gemspec
+++ b/gettext_i18n_rails.gemspec
@@ -9,14 +9,14 @@ s.files = `git ls-files lib MIT-LICENSE.txt`.split("\n")
s.license = "MIT"
s.add_runtime_dependency "fast_gettext", ">= 0.9.0"
- s.add_runtime_dependency "sexp_processor"
s.add_development_dependency "bump"
s.add_development_dependency "gettext", ">= 3.0.2"
s.add_development_dependency "haml"
s.add_development_dependency "rake"
s.add_development_dependency "rails"
- s.add_development_dependency "ruby_parser", ">= 3"
+ s.add_development_dependency "ruby_parser", ">= 3.7.1"
+ s.add_development_dependency "sexp_processor"
s.add_development_dependency "rspec"
s.add_development_dependency "slim"
s.add_development_dependency "sqlite3"
|
Fix ruby_parser and sexp_processor requirements.
|
diff --git a/apps/main/core/main/application.rb b/apps/main/core/main/application.rb
index abc1234..def5678 100644
--- a/apps/main/core/main/application.rb
+++ b/apps/main/core/main/application.rb
@@ -17,8 +17,6 @@ plugin :flash
route do |r|
- self.class.config.container["page"].flash_messages = flash
-
r.root do
r.resolve "main.views.home" do |home|
home.()
|
Remove old flash message handling for now
|
diff --git a/wicked.gemspec b/wicked.gemspec
index abc1234..def5678 100644
--- a/wicked.gemspec
+++ b/wicked.gemspec
@@ -19,6 +19,7 @@ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.require_paths = ["lib"]
- gem.add_dependency "rails", [">= 3.0.7"]
+ gem.add_dependency "railties", [">= 3.0.7"]
+ gem.add_development_dependency "rails", [">= 3.0.7"]
gem.add_development_dependency "capybara", [">= 0"]
end
|
Change the runtime dependency to `railties`, not `rails`.
`rails` will bring in other gems that wicked doesn't depend on and might not be
in use in the host app, like `activerecord`, `activejob` or `actionmailer`.
|
diff --git a/timetrap/formatters/jira.rb b/timetrap/formatters/jira.rb
index abc1234..def5678 100644
--- a/timetrap/formatters/jira.rb
+++ b/timetrap/formatters/jira.rb
@@ -0,0 +1,35 @@+require File.join('timetrap','formatters','text')
+module Timetrap
+ module Formatters
+
+ class Jira < Text
+ def initialize entries
+ entries.map do |e|
+ hours, minutes = Time.at(e.end_or_now.to_i - e.start.to_i).utc.strftime("%H:%M").split(':').map(&:to_i)
+
+ if hours == 0 and minutes < 15
+ minutes = 15
+ else
+ x = (minutes / 15).floor * 15
+ y = minutes % 15
+
+ if y >= 5
+ x += 15
+ end
+
+ minutes = x
+
+ if minutes > 59
+ minutes = 0
+ hours = hours + 1
+ end
+ end
+
+ e.duration = (hours * 3600) + (minutes * 60)
+ e
+ end
+ super
+ end
+ end
+ end
+end
|
Add a JIRA timetrap formatter
|
diff --git a/app/controllers/api/stops_controller.rb b/app/controllers/api/stops_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/api/stops_controller.rb
+++ b/app/controllers/api/stops_controller.rb
@@ -1,5 +1,6 @@ class Api::StopsController < ApplicationController
def index
+ params[:query] = params[:name] if params[:name].present?
searcher = StopSearcher.new(params)
if searcher.valid?
render json: searcher.results
|
Support legacy name param in stops controller
|
diff --git a/src/vsphere_cpi/lib/cloud/vsphere/sdk_helpers/log_filter.rb b/src/vsphere_cpi/lib/cloud/vsphere/sdk_helpers/log_filter.rb
index abc1234..def5678 100644
--- a/src/vsphere_cpi/lib/cloud/vsphere/sdk_helpers/log_filter.rb
+++ b/src/vsphere_cpi/lib/cloud/vsphere/sdk_helpers/log_filter.rb
@@ -9,11 +9,14 @@ ]
def filter(content)
+ modified = false
+
document = Oga.parse_xml(content)
FILTERS.each do |filter|
matching_node = document.xpath(filter)
matching_node.each do |element|
+ modified = true
text = Oga::XML::Text.new
text.text = 'redacted'
@@ -21,7 +24,11 @@ end
end
- document.to_xml
+ if modified
+ document.to_xml
+ else
+ content
+ end
end
end
|
Use modified xml only if filter is applied
Signed-off-by: Chris Dutra <7eb54fc324f04033595eb420f2ee7c112fb7259e@pivotal.io>
|
diff --git a/test/dummy/config/initializers/secret_token.rb b/test/dummy/config/initializers/secret_token.rb
index abc1234..def5678 100644
--- a/test/dummy/config/initializers/secret_token.rb
+++ b/test/dummy/config/initializers/secret_token.rb
@@ -5,3 +5,4 @@ # Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
Dummy::Application.config.secret_token = '5e507bc08a89b8b07e1ce08c932ec89771be6500e4d2d64c38164d2405d27578c33edc2982dd9ee67d4c49e0dd75992ac2ed6eb120bea0e16516549466906d06'
+Dummy::Application.config.secret_key_base = 'a87ae91f28326ebe41f7ce9b7b799bb9'
|
Set secret_key_base to quiet another warning.
|
diff --git a/db/migrate/20200417153503_add_unconfirmed_email_to_spree_users.rb b/db/migrate/20200417153503_add_unconfirmed_email_to_spree_users.rb
index abc1234..def5678 100644
--- a/db/migrate/20200417153503_add_unconfirmed_email_to_spree_users.rb
+++ b/db/migrate/20200417153503_add_unconfirmed_email_to_spree_users.rb
@@ -1,4 +1,4 @@-class AddUnconfirmedEmailToSpreeUsers < ActiveRecord::Migration[5.2]
+class AddUnconfirmedEmailToSpreeUsers < SolidusSupport::Migration[5.1]
def change
unless column_exists?(:spree_users, :unconfirmed_email)
add_column :spree_users, :unconfirmed_email, :string
|
Update migrations to support Rails 5.1
|
diff --git a/knife-acl.gemspec b/knife-acl.gemspec
index abc1234..def5678 100644
--- a/knife-acl.gemspec
+++ b/knife-acl.gemspec
@@ -6,10 +6,10 @@ s.version = KnifeACL::VERSION
s.platform = Gem::Platform::RUBY
s.extra_rdoc_files = ["README.md", "LICENSE" ]
- s.summary = "ACL Knife Tools for Opscode Hosted Chef"
+ s.summary = "ACL Knife Tools for Opscode hosted Enterprise Chef/Enterprise Chef"
s.description = s.summary
s.author = "Seth Falcon"
- s.email = "seth@opscode.com"
+ s.email = "support@opscode.com"
s.homepage = "http://docs.opscode.com"
s.require_path = 'lib'
s.files = %w(LICENSE README.md) + Dir.glob("lib/**/*")
|
Update summary and email for 0.0.10 release
|
diff --git a/app/api/chemotion/sample_api.rb b/app/api/chemotion/sample_api.rb
index abc1234..def5678 100644
--- a/app/api/chemotion/sample_api.rb
+++ b/app/api/chemotion/sample_api.rb
@@ -11,7 +11,7 @@ end
get do
if(params[:collection_id])
- current_user.collections.find(params[:collection_id]).samples
+ Collection.where("user_id = ? OR shared_by_id = ?", current_user.id, current_user.id).find(params[:collection_id]).samples
else
Sample.all
end
|
Fix sample api did not find a shared collection
|
diff --git a/app/models/supervisor_report.rb b/app/models/supervisor_report.rb
index abc1234..def5678 100644
--- a/app/models/supervisor_report.rb
+++ b/app/models/supervisor_report.rb
@@ -10,6 +10,7 @@
belongs_to :user
validates :user, inclusion: { in: ->(_) { User.supervisors } }
- validates :reason_test_completed, inclusion: { in: REASONS_FOR_TEST }
+ validates :reason_test_completed, inclusion: { in: REASONS_FOR_TEST,
+ allow_blank: true }
has_one :incident
end
|
Allow blank reason for testing
|
diff --git a/app/views/v1/projects/base.rabl b/app/views/v1/projects/base.rabl
index abc1234..def5678 100644
--- a/app/views/v1/projects/base.rabl
+++ b/app/views/v1/projects/base.rabl
@@ -18,5 +18,3 @@ node :category do |u|
u.category.name
end
-
-node :discourse_comments_count do 0 end
|
Remove fake discourse_comments_count from projects
|
diff --git a/app/views/api/v1/images/index.json.rabl b/app/views/api/v1/images/index.json.rabl
index abc1234..def5678 100644
--- a/app/views/api/v1/images/index.json.rabl
+++ b/app/views/api/v1/images/index.json.rabl
@@ -1,5 +1,5 @@ collection @images
-node(:url) { |p| p.file.url }
+node(:url) { |p| p.file.large.url }
node(:thumbnail_url) { |p| p.file.thumbnail.url }
attribute :description
|
Return ‘large’ image version as default url.
|
diff --git a/lib/active_api.rb b/lib/active_api.rb
index abc1234..def5678 100644
--- a/lib/active_api.rb
+++ b/lib/active_api.rb
@@ -1,7 +1,5 @@-require 'rubygems'
-require 'activesupport'
+require 'active_support'
require 'nokogiri'
-
require 'uri'
require 'active_api/builder'
|
Stop requiring rubygems, for those folks who don't use it
|
diff --git a/app/models/scsb_lookup.rb b/app/models/scsb_lookup.rb
index abc1234..def5678 100644
--- a/app/models/scsb_lookup.rb
+++ b/app/models/scsb_lookup.rb
@@ -4,7 +4,7 @@ def find_by_id(id)
response = items_by_id(id)
response.map { |r| [r['itemBarcode'], r] }.to_h
- rescue Faraday::ConnectionFailed => connection_failed
+ rescue Faraday::ConnectionFailed
logger.warn("No barcodes could be retrieved for the item: #{id}")
{}
end
@@ -12,7 +12,7 @@ def find_by_barcodes(barcodes)
response = items_by_barcode(barcodes)
response.map { |r| [r['itemBarcode'], r] }.to_h
- rescue Faraday::ConnectionFailed => connection_failed
+ rescue Faraday::ConnectionFailed
logger.warn("No items could be retrieved for the barcodes: #{barcodes.join(',')}")
{}
end
|
Remove useless assignment for rubocop
|
diff --git a/lib/generators/enumerative/enumeration/templates/enumeration_spec.rb b/lib/generators/enumerative/enumeration/templates/enumeration_spec.rb
index abc1234..def5678 100644
--- a/lib/generators/enumerative/enumeration/templates/enumeration_spec.rb
+++ b/lib/generators/enumerative/enumeration/templates/enumeration_spec.rb
@@ -1,5 +1,5 @@ require 'spec_helper'
-require 'support/enumeration_sharedspec'
+require 'enumerative/enumeration_sharedspec'
describe <%= enumeration_class %> do
|
Use shared spec included with library.
|
diff --git a/lib/foofoberry.rb b/lib/foofoberry.rb
index abc1234..def5678 100644
--- a/lib/foofoberry.rb
+++ b/lib/foofoberry.rb
@@ -2,6 +2,7 @@ require "foofoberry/client"
require "foofoberry/github_notification"
require "foofoberry/project"
+require "foofoberry/project_store"
module Foofoberry
# Your code goes here...
|
Add project_store file to require statements
|
diff --git a/lib/rico/value.rb b/lib/rico/value.rb
index abc1234..def5678 100644
--- a/lib/rico/value.rb
+++ b/lib/rico/value.rb
@@ -6,7 +6,7 @@ #
# Returns the deserialized value
def get
- (data || {})["_value"]
+ data["_value"]
end
# Sets and stores the new value for the object
|
Remove unnecessary data guard from Value
|
diff --git a/lib/rss_loader.rb b/lib/rss_loader.rb
index abc1234..def5678 100644
--- a/lib/rss_loader.rb
+++ b/lib/rss_loader.rb
@@ -2,6 +2,7 @@ require 'open-uri'
class RssLoader
+
def load
purge_existing_data()
load_data_from_rss_feed()
@@ -14,6 +15,7 @@ end
def load_data_from_rss_feed
+ # TODO: pass in as a parameter to RssLoader#load?
url = 'http://www.macleans.ca/multimedia/feed/'
open(url) do |rss_io|
rss_data = RSS::Parser.parse(rss_io)
|
Add a TODO, fix some whitespace
|
diff --git a/lib/snoop/http.rb b/lib/snoop/http.rb
index abc1234..def5678 100644
--- a/lib/snoop/http.rb
+++ b/lib/snoop/http.rb
@@ -5,7 +5,13 @@ class Http
UrlRequiredException = Class.new(StandardError)
- DEFAULT_OPTIONS = {
+ DEFAULT_INIT_OPTIONS = {
+ url: nil,
+ css: nil,
+ http_client: HTTParty
+ }
+
+ DEFAULT_NOTIFY_OPTIONS = {
delay: 0,
count: 1,
while: -> { false },
@@ -15,21 +21,23 @@ attr_reader :url, :css, :http_client
attr_accessor :content
- def initialize(url: nil, css: nil, http_client: HTTParty)
- raise UrlRequiredException if url.nil?
+ def initialize(options = {})
+ options = DEFAULT_INIT_OPTIONS.merge options
- @url = url
- @css = css
- @http_client = http_client
+ raise UrlRequiredException if options.fetch(:url).nil?
+
+ @url = options.fetch :url
+ @css = options.fetch :css
+ @http_client = options.fetch :http_client
end
def notify(options = {})
- options = DEFAULT_OPTIONS.merge(options)
+ options = DEFAULT_NOTIFY_OPTIONS.merge options
while (
- (options[:count] -= 1 ) >= 0 ||
- options[:while].call ||
- !options[:until].call
+ (options[:count] -= 1) >= 0 ||
+ options.fetch(:while).call ||
+ !options.fetch(:until).call
)
yield content if content_changed?
sleep options[:delay]
|
Stop using Ruby 2.0 keyword arguments completely
I'd like to have this parsed by Code Climate and it uses ruby_parser,
which cannot parse the file as it is now.
|
diff --git a/lib/verso/base.rb b/lib/verso/base.rb
index abc1234..def5678 100644
--- a/lib/verso/base.rb
+++ b/lib/verso/base.rb
@@ -4,9 +4,9 @@ #
# @see http://api.cteresource.org/docs Web API documentation
module Verso
- # Classes derived from Verso::Base should define attr_readers or
- # appropriate methods (using Verso::Base#get_attr w/in methods) to access
- # attributes stored in the attrs hash.
+ # @abstract Classes derived from Verso::Base should define attr_readers or
+ # appropriate methods (using Verso::Base#get_attr w/in methods) to access
+ # attributes stored in the attrs hash.
#
# @!attribute [r] attrs
# attribute hash
@@ -24,7 +24,7 @@
# Define methods to retrieve values from attribute hash
#
- # @param attr [Symbol]
+ # @param attrs [Symbol]
def self.attr_reader(*attrs)
attrs.each do |attr|
class_eval do
|
Mark Verso::Base as abstract in doc
|
diff --git a/bootstrap/libraries/bootstrap_helper.rb b/bootstrap/libraries/bootstrap_helper.rb
index abc1234..def5678 100644
--- a/bootstrap/libraries/bootstrap_helper.rb
+++ b/bootstrap/libraries/bootstrap_helper.rb
@@ -21,9 +21,10 @@ end
def optional_patterns
+ result = []
parameters = Consul::ConsulUtil.read_parameters
+ return result if parameters[:cloudconductor].nil? || parameters[:cloudconductor][:patterns].nil?
patterns = parameters[:cloudconductor][:patterns]
- result = []
patterns.each do |pattern_name, pattern|
pattern[:pattern_name] = pattern_name
result << pattern if pattern[:type] == 'optional'
|
Modify to return empty array if consul kv parameters are nil.
|
diff --git a/lib/sastrawi/morphology/disambiguator/disambiguator_prefix_rule19.rb b/lib/sastrawi/morphology/disambiguator/disambiguator_prefix_rule19.rb
index abc1234..def5678 100644
--- a/lib/sastrawi/morphology/disambiguator/disambiguator_prefix_rule19.rb
+++ b/lib/sastrawi/morphology/disambiguator/disambiguator_prefix_rule19.rb
@@ -0,0 +1,17 @@+module Sastrawi
+ module Morphology
+ module Disambiguator
+ class DisambiguatorPrefixRule19
+ def disambiguate(word)
+ contains = /^memp([abcdfghijklmopqrstuvwxyz])(.*)$/.match(word)
+
+ if contains
+ matches = contains.captures
+
+ return 'p' << matches[0] << matches[1]
+ end
+ end
+ end
+ end
+ end
+end
|
Add implementation of nineteenth rule of disambiguator prefix
|
diff --git a/vagrant_base/travis_build_environment/attributes/default.rb b/vagrant_base/travis_build_environment/attributes/default.rb
index abc1234..def5678 100644
--- a/vagrant_base/travis_build_environment/attributes/default.rb
+++ b/vagrant_base/travis_build_environment/attributes/default.rb
@@ -1,3 +1,3 @@ default[:travis_build_environment][:hosts] = Hash.new
default[:travis_build_environment][:builds_volume_size] = "350m"
-default[:travis_build_environment][:use_tmpfs_for_builds] = false+default[:travis_build_environment][:use_tmpfs_for_builds] = true
|
Use tmpfs volume for builds directory. There is no real reason not to and it makes Ruby on Rails test suite FLY BABY FLY
|
diff --git a/lib/confluence_page.rb b/lib/confluence_page.rb
index abc1234..def5678 100644
--- a/lib/confluence_page.rb
+++ b/lib/confluence_page.rb
@@ -13,7 +13,7 @@ def content
content = CGI.unescapeHTML @doc.css('#markupTextarea').text
- content.gsub!(' ', '')
+ content.gsub!(' ', ' ')
# remove the double pipes used for table headers in Confluence
content.gsub!('||', '|')
|
Replace nbsp with spaces instead of removing
|
diff --git a/lib/flor/pcore/logo.rb b/lib/flor/pcore/logo.rb
index abc1234..def5678 100644
--- a/lib/flor/pcore/logo.rb
+++ b/lib/flor/pcore/logo.rb
@@ -1,25 +1,47 @@
class Flor::Pro::Logo < Flor::Procedure
- #
- # "and" has higher precedence than "or"
names %w[ and or ]
- def pre_execute
+ def execute
- @node['rets'] = []
+ payload['ret'] = @node['heat0'] == 'and'
+
+ super
end
- def receive_last
+ def receive_att
- payload['ret'] =
- if @node['heat0'] == 'or'
- !! @node['rets'].index { |r| Flor.true?(r) }
- else
- ! @node['rets'].index { |r| Flor.false?(r) }
- end
+ c = children[@fcid]; return super if c[0] == '_att' && [1].size == 2
- wrap_reply
+ h0 = @node['heat0']
+
+ ret = Flor.true?(payload['ret'])
+
+ return wrap_reply if ((h0 == 'or' && ret) || (h0 == 'and' && ! ret))
+
+ super
end
+
+ alias receive_non_att receive_att
+
+# def pre_execute
+#
+# @node['rets'] = []
+# end
+#
+# def receive_last
+#
+# payload['ret'] =
+# if @node['heat0'] == 'or'
+# !! @node['rets'].index { |r| Flor.true?(r) }
+# else
+# ! @node['rets'].index { |r| Flor.false?(r) }
+# end
+#
+# wrap_reply
+# end
+ #
+ # Keep me around for a "aand" and a "oor"... Maybe...
end
|
Make "and" and "or" short circuit
|
diff --git a/spec/factories/patterns.rb b/spec/factories/patterns.rb
index abc1234..def5678 100644
--- a/spec/factories/patterns.rb
+++ b/spec/factories/patterns.rb
@@ -0,0 +1,28 @@+# -*- coding: utf-8 -*-
+# Copyright 2014 TIS Inc.
+#
+# 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.
+FactoryGirl.define do
+ factory :pattern do
+ sequence(:name) { |n| "pattern_#{n}" }
+ uri 'http://example.com/'
+
+ after(:build) do
+ Pattern.reset_callbacks :save
+ end
+
+ before(:create) do |pattern|
+ pattern.clouds << create(:cloud_aws)
+ end
+ end
+end
|
Add factory file that lucked previous commit
|
diff --git a/lib/alchemy/deprecation.rb b/lib/alchemy/deprecation.rb
index abc1234..def5678 100644
--- a/lib/alchemy/deprecation.rb
+++ b/lib/alchemy/deprecation.rb
@@ -1,4 +1,4 @@ # frozen_string_literal: true
module Alchemy
- Deprecation = ActiveSupport::Deprecation.new("6.0", "Alchemy")
+ Deprecation = ActiveSupport::Deprecation.new("7.0", "Alchemy")
end
|
Raise deprecated major version to 7.0
|
diff --git a/provider/vendor/plugins/oauth2_provider/lib/oauth2/provider/ssl_helper.rb b/provider/vendor/plugins/oauth2_provider/lib/oauth2/provider/ssl_helper.rb
index abc1234..def5678 100644
--- a/provider/vendor/plugins/oauth2_provider/lib/oauth2/provider/ssl_helper.rb
+++ b/provider/vendor/plugins/oauth2_provider/lib/oauth2/provider/ssl_helper.rb
@@ -14,7 +14,6 @@ if !request.ssl?
if !ssl_enabled?
error = 'This page can only be accessed using HTTPS.'
- error += render_help_link('Configure SSL', :class => '') if defined?(render_help_link)
flash.now[:error] = error
render(:text => '', :layout => true, :status => :forbidden)
return false
|
Remove the help link in the error message.
|
diff --git a/lib/microspec/scope.rb b/lib/microspec/scope.rb
index abc1234..def5678 100644
--- a/lib/microspec/scope.rb
+++ b/lib/microspec/scope.rb
@@ -8,14 +8,6 @@
def parent
@_parent
- end
-
- def setups
- @_setups ||= []
- end
-
- def teardowns
- @_setups ||= []
end
def block
@@ -58,6 +50,14 @@
protected
+ def setups
+ @_setups ||= []
+ end
+
+ def teardowns
+ @_setups ||= []
+ end
+
def start(context)
parent.start context if parent
|
Make setups and teardowns accessors protected methods
|
diff --git a/lib/neography/index.rb b/lib/neography/index.rb
index abc1234..def5678 100644
--- a/lib/neography/index.rb
+++ b/lib/neography/index.rb
@@ -25,7 +25,7 @@ def find(*args)
db = args[3] ? args.pop : Neography::Rest.new
- if self.is_a?(Neography::Node)
+ if self <= Neography::Node
nodes = []
results = db.find_node_index(*args)
return nil unless results
|
Check for subclasses of Neography::Node and not just an instance.
|
diff --git a/lib/descendants_tracker.rb b/lib/descendants_tracker.rb
index abc1234..def5678 100644
--- a/lib/descendants_tracker.rb
+++ b/lib/descendants_tracker.rb
@@ -15,16 +15,11 @@
# @private
def self.extended(descendant)
- setup(descendant)
- end
- private_class_method :extended
-
- # @return [Array]
- #
- # @private
- def self.setup(descendant)
descendant.instance_variable_set(:@descendants, [])
end
+
+ singleton_class.class_eval { alias_method :setup, :extended }
+ private_class_method :extended
# Add the descendant to this class and the superclass
#
|
Remove setup method and alias to extended
|
diff --git a/lib/pgquilter/topic.rb b/lib/pgquilter/topic.rb
index abc1234..def5678 100644
--- a/lib/pgquilter/topic.rb
+++ b/lib/pgquilter/topic.rb
@@ -4,7 +4,7 @@ class Topic < Sequel::Model
one_to_many :patchsets
- SUBJECT_WAS_RE = /.*\(\s*was:?\s*([^)]+)\s*\)/
+ SUBJECT_WAS_RE = /.*[\(\[]\s*was:?\s*([^\)]+)\s*[\)\]]/
def self.active
self.where(active: true)
|
Support brackets in '(was ...)' substitution
|
diff --git a/lib/postamt/railtie.rb b/lib/postamt/railtie.rb
index abc1234..def5678 100644
--- a/lib/postamt/railtie.rb
+++ b/lib/postamt/railtie.rb
@@ -12,7 +12,10 @@ # We mustn't hook into AR when db:migrate or db:test:load_schema
# run, but user-defined Rake tasks still need us
task_names = []
- tasks_to_examine = Rake.application.top_level_tasks.map{ |task_name| Rake.application[task_name] }
+ tasks_to_examine = Rake.application.top_level_tasks.map{ |task_string|
+ task_name, task_args = Rake.application.parse_task_string(task_string)
+ Rake.application[task_name]
+ }
until tasks_to_examine.empty?
task = tasks_to_examine.pop
task_names << task.name
|
Fix bug from improper handling of raketask string
|
diff --git a/Casks/poedit.rb b/Casks/poedit.rb
index abc1234..def5678 100644
--- a/Casks/poedit.rb
+++ b/Casks/poedit.rb
@@ -7,7 +7,7 @@ url "http://poedit.net/dl/poedit-#{version}.dmg"
else
version '1.8.4'
- sha256 '5551d354865070fefd6c7bd5582dfcb0879e6ea41484dd7a3320183714b9bb3d'
+ sha256 '80fd1a93b35630572e097b71e2eb156acaed8f7ac6ceeb82c42f79ae29a4bd86'
url "https://download.poedit.net/Poedit-#{version}.zip"
appcast 'https://poedit.net/updates/osx/appcast',
|
Fix sha sum for Poedit
|
diff --git a/features/support/webmock.rb b/features/support/webmock.rb
index abc1234..def5678 100644
--- a/features/support/webmock.rb
+++ b/features/support/webmock.rb
@@ -9,5 +9,5 @@ # Mock out all publisher URLs
stub_request(:get, %r{^#{Regexp.escape Plek.current.find('publisher')}/}).to_return(status: 200)
- stub_request(:get, "#{Plek.current.find('data')}/data_sets/public_bodies.json").to_return(body: [].to_json)
+ stub_request(:get, "#{Plek.current.find('imminence')}/data_sets/public_bodies.json").to_return(body: [].to_json)
end
|
Switch plek 'data' lookup for app name of 'imminence'
|
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -19,6 +19,12 @@ render :text => "error", :status => 422
end
+ # used for active_admin capability
+ def authenticate_admin_user!
+ redirect_to '/' and return if user_signed_in? && !["jekhokie@gmail.com", "keith.griffis@gmail.com"].include?(current_user.email)
+ authenticate_user!
+ end
+
private
def is_editing?
|
Add Admin Check for Email Addresses
Add a method to check 2 specific email addresses of the owners for admin
access.
|
diff --git a/Casks/xamarin-studio.rb b/Casks/xamarin-studio.rb
index abc1234..def5678 100644
--- a/Casks/xamarin-studio.rb
+++ b/Casks/xamarin-studio.rb
@@ -1,13 +1,13 @@ cask :v1 => 'xamarin-studio' do
- version '5.5.0.227-0'
- sha256 '4c05b5174fd1d2eacef44f2f96557fc213f25381ad0ea3c139612217a20e8d46'
+ version '5.7.0.660-0'
+ sha256 'efb4b5817ff1e21d9aaac13c76607ee198d3dc71b57968faf075f01a7069133c'
url "http://download.xamarin.com/studio/Mac/XamarinStudio-#{version}.dmg"
appcast 'http://xamarin.com/installer_assets/v3/Mac/Universal/InstallationManifest.xml',
- :sha256 => '713f272a1e36262f1b2c5a06f4ed1b1eb8987d240018347a51312dfedeeafcf3',
+ :sha256 => '79c309d6dbe6f08f1d022c9376a4678cc94f57be084007df90c5a12839b35cdd',
:format => :unknown
homepage 'http://xamarin.com/studio'
- license :unknown # todo: change license and remove this comment; ':unknown' is a machine-generated placeholder
+ license :gpl
app 'Xamarin Studio.app'
end
|
Update Xamarin Studio to v5.7.0.660-0
|
diff --git a/tools/common/lib/subjects/project.rb b/tools/common/lib/subjects/project.rb
index abc1234..def5678 100644
--- a/tools/common/lib/subjects/project.rb
+++ b/tools/common/lib/subjects/project.rb
@@ -10,11 +10,17 @@ end
def files
- Dir.glob("#{root}/**/*.rb").map { |f| SourceFile.new(f, self) }
+ if root.end_with?(".rb")
+ [SourceFile.new(root, self)]
+ else
+ Dir.glob("#{root}/**/*.rb").map { |f| SourceFile.new(f, self) }
+ end
end
def relative_path_to(absolute_path)
- Pathname.new(absolute_path).relative_path_from(Pathname.new(root)).to_s
+ base = Pathname.new(root)
+ base = base.parent if root.end_with?(".rb")
+ Pathname.new(absolute_path).relative_path_from(base).to_s
end
end
end
|
Make it possible to run tools on a single file.
|
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -1,7 +1,7 @@ class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
- protect_from_forgery with: :exception
+ protect_from_forgery with: :null_session
include GDS::SSO::ControllerMethods
|
Use null_session when protecting from forgery
This is an API after all, so we should follow the advice.
|
diff --git a/lib/lines/active_record.rb b/lib/lines/active_record.rb
index abc1234..def5678 100644
--- a/lib/lines/active_record.rb
+++ b/lib/lines/active_record.rb
@@ -29,8 +29,9 @@ Lines.log(name: event.payload[:name], line: event.payload[:line])
end
- def logger; true; end
+ def logger; Lines.logger; end
end
end
+ActiveRecord::Base.logger = Lines.logger
Lines::ActiveRecordSubscriber.attach_to :active_record
|
Use Lines as the default ActiveRecord::Base logger
|
diff --git a/lib/tasks/sidekiq.rake b/lib/tasks/sidekiq.rake
index abc1234..def5678 100644
--- a/lib/tasks/sidekiq.rake
+++ b/lib/tasks/sidekiq.rake
@@ -14,15 +14,19 @@ Rake::Task['sidekiq:stop'].invoke
puts 'Starting new sidekiq process.'
end
- system "nohup bundle exec sidekiq -q post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default -e #{Rails.env} -P #{pidfile} >> #{Rails.root.join("log", "sidekiq.log")} 2>&1 &"
+ system "nohup bundle exec sidekiq -q post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default -e #{Rails.env} -P #{pidfile} >> #{log_file} 2>&1 &"
end
desc "GITLAB | Start sidekiq with launchd on Mac OS X"
task :launchd do
- system "bundle exec sidekiq -q post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default -e #{Rails.env} -P #{pidfile} >> #{Rails.root.join("log", "sidekiq.log")} 2>&1"
+ system "bundle exec sidekiq -q post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default -e #{Rails.env} -P #{pidfile} >> #{log_file} 2>&1"
end
def pidfile
Rails.root.join("tmp", "pids", "sidekiq.pid")
end
+
+ def log_file
+ Rails.root.join("log", "sidekiq.log")
+ end
end
|
Remove duplicate log path generation
|
diff --git a/lib/userbin/session.rb b/lib/userbin/session.rb
index abc1234..def5678 100644
--- a/lib/userbin/session.rb
+++ b/lib/userbin/session.rb
@@ -12,8 +12,8 @@ end
class Identity < Model;
- def activate!
- Identity.save_existing(id, pending: false)
+ def activate!(local_id = nil)
+ Identity.save_existing(id, pending: false, local_id: local_id)
end
end
|
Send an optional local database id with the activation request
|
diff --git a/wladder/app/controllers/home_controller.rb b/wladder/app/controllers/home_controller.rb
index abc1234..def5678 100644
--- a/wladder/app/controllers/home_controller.rb
+++ b/wladder/app/controllers/home_controller.rb
@@ -8,12 +8,14 @@ end
def result
- start_word = params[:start_word]
- end_word = params[:end_word]
- word1 = params[:word1]
- word2 = params[:word2]
- word3 = params[:word3]
- word4 = params[:word4]
- word5 = params[:word5]
+ @words = Array.new
+ @words[0] = params[:start_word]
+ @words[1] = params[:word1]
+ @words[2] = params[:word2]
+ @words[3] = params[:word3]
+ @words[4] = params[:word4]
+ @words[5] = params[:word5]
+ @words[6] = params[:end_word]
+ @words.delete_if { |word| word == "" }
end
end
|
Put words in an array
|
diff --git a/messaging.gemspec b/messaging.gemspec
index abc1234..def5678 100644
--- a/messaging.gemspec
+++ b/messaging.gemspec
@@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = 'messaging'
- s.version = '0.5.1.0'
+ s.version = '0.6.0.0'
s.summary = 'Messaging primitives for Eventide'
s.description = ' '
|
Package version is increased form 0.5.1.0 to 0.6.0.0
|
diff --git a/lib/physeng/application.rb b/lib/physeng/application.rb
index abc1234..def5678 100644
--- a/lib/physeng/application.rb
+++ b/lib/physeng/application.rb
@@ -4,8 +4,11 @@ class Physeng
class Application
class << self
+ attr_reader :opts
+
def run!(*arguments)
p = Trollop::Parser.new do
+ opt :gravity, "Toggle gravity", :default => true
end
@opts = Trollop::with_standard_exception_handling p do
o = p.parse arguments
|
Add gravity flag to command line params
|
diff --git a/lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-openstack-infra_manager.rb b/lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-openstack-infra_manager.rb
index abc1234..def5678 100644
--- a/lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-openstack-infra_manager.rb
+++ b/lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-openstack-infra_manager.rb
@@ -1,5 +1,5 @@ module MiqAeMethodService
- class MiqAeServiceManageIQ_Providers_Openstack_InfraManager < MiqAeServiceEmsInfra
+ class MiqAeServiceManageIQ_Providers_Openstack_InfraManager < MiqAeServiceManageIQ_Providers_InfraManager
expose :orchestration_stacks, :association => true
expose :direct_orchestration_stacks, :association => true
end
|
Change Openstack_InfraManager service model use real model for subclass
Openstack_InfraManager was using the alias EmsInfra instead of the real subclass ManageIQ::Providers::InfraManager
|
diff --git a/app/models/concerns/spree/callbackable.rb b/app/models/concerns/spree/callbackable.rb
index abc1234..def5678 100644
--- a/app/models/concerns/spree/callbackable.rb
+++ b/app/models/concerns/spree/callbackable.rb
@@ -15,14 +15,14 @@ # Index document into elasticsearch
#
def index_document
- __elasticsearch__.index_document(version_options)
+ __elasticsearch__.index_document
end
##
# Updates elasticsearch document from featured model
#
def update_document
- __elasticsearch__.update_document(version_options)
+ __elasticsearch__.update_document
end
private
|
Fix bug with update and version
|
diff --git a/Expecta.podspec b/Expecta.podspec
index abc1234..def5678 100644
--- a/Expecta.podspec
+++ b/Expecta.podspec
@@ -23,4 +23,6 @@ s.osx.deployment_target = '10.7'
s.frameworks = 'Foundation', 'XCTest'
+ s.osx.xcconfig = { 'FRAMEWORK_SEARCH_PATHS' => '$(inherited) $(DEVELOPER_FRAMEWORKS_DIR) "$(PLATFORM_DIR)/Developer/Library/Frameworks" "$(DEVELOPER_DIR)/Platforms/MacOSX.platform/Developer/Library/Frameworks"' }
+ s.ios.xcconfig = { 'FRAMEWORK_SEARCH_PATHS' => '$(inherited) $(DEVELOPER_FRAMEWORKS_DIR) "$(PLATFORM_DIR)/Developer/Library/Frameworks" "$(DEVELOPER_DIR)/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks"' }
end
|
Add framework search paths to podspec
|
diff --git a/ember-konacha-rails.gemspec b/ember-konacha-rails.gemspec
index abc1234..def5678 100644
--- a/ember-konacha-rails.gemspec
+++ b/ember-konacha-rails.gemspec
@@ -20,6 +20,7 @@
spec.add_dependency "rails", ">= 3.1"
spec.add_dependency "httparty", ">= 0.9"
+ spec.add_dependency "konacha"
spec.add_development_dependency "bundler", "~> 1.3"
spec.add_development_dependency "rake"
|
Add konacha as a dependency
I would expect adding this to my Gemfile to also include konacha as a dependency
|
diff --git a/buildserver/cookbooks/fdroidbuild-general/recipes/default.rb b/buildserver/cookbooks/fdroidbuild-general/recipes/default.rb
index abc1234..def5678 100644
--- a/buildserver/cookbooks/fdroidbuild-general/recipes/default.rb
+++ b/buildserver/cookbooks/fdroidbuild-general/recipes/default.rb
@@ -5,7 +5,7 @@ command "apt-get update"
end
-%w{ant ant-contrib autoconf autoconf2.13 autopoint bison cmake expect flex gperf libarchive-zip-perl libtool libsaxonb-java libssl1.0.0 libssl-dev maven openjdk-7-jdk javacc python python-magic python-setuptools git-core mercurial subversion bzr git-svn make perlmagick pkg-config zip yasm inkscape imagemagick gettext realpath transfig texinfo curl librsvg2-bin xsltproc vorbis-tools swig quilt faketime optipng python-gnupg python3-gnupg nasm unzip scons}.each do |pkg|
+%w{ant ant-contrib autoconf autoconf2.13 autopoint bison bzr cmake curl expect faketime flex gettext git-core git-svn gperf imagemagick inkscape javacc libarchive-zip-perl librsvg2-bin libsaxonb-java libssl-dev libssl1.0.0 libtool make maven mercurial nasm openjdk-7-jdk optipng perlmagick pkg-config python python-gnupg python-magic python-setuptools python3-gnupg quilt realpath scons subversion swig texinfo transfig unzip vorbis-tools xsltproc yasm zip}.each do |pkg|
package pkg do
action :install
end
|
Sort debian packages to be installed
|
diff --git a/db/migrate/20170411153944_add_project_errors_projectid_error_idx.rb b/db/migrate/20170411153944_add_project_errors_projectid_error_idx.rb
index abc1234..def5678 100644
--- a/db/migrate/20170411153944_add_project_errors_projectid_error_idx.rb
+++ b/db/migrate/20170411153944_add_project_errors_projectid_error_idx.rb
@@ -0,0 +1,16 @@+class AddProjectErrorsProjectidErrorIdx < ActiveRecord::Migration
+ def up
+ execute <<-SQL
+ CREATE INDEX project_errors_projectid_error_idx
+ ON public.project_errors
+ USING btree
+ (project_id, error COLLATE pg_catalog."default");
+ SQL
+ end
+
+ def down
+ execute <<-SQL
+ DROP INDEX project_errors_projectid_error_idx;
+ SQL
+ end
+end
|
Add project errors project_id and error index
|
diff --git a/spec/models/auth_userid_password_spec.rb b/spec/models/auth_userid_password_spec.rb
index abc1234..def5678 100644
--- a/spec/models/auth_userid_password_spec.rb
+++ b/spec/models/auth_userid_password_spec.rb
@@ -0,0 +1,8 @@+RSpec.describe AuthUseridPassword do
+ describe ".encrypted_columns" do
+ it "returns the encrypted columns" do
+ expected = %w(password password_encrypted auth_key auth_key_encrypted service_account service_account_encrypted)
+ expect(described_class.encrypted_columns).to match_array(expected)
+ end
+ end
+end
|
Add a test for a subclass of Authentication
|
diff --git a/spec/uploaders/remote_downloader_spec.rb b/spec/uploaders/remote_downloader_spec.rb
index abc1234..def5678 100644
--- a/spec/uploaders/remote_downloader_spec.rb
+++ b/spec/uploaders/remote_downloader_spec.rb
@@ -0,0 +1,12 @@+require 'spec_helper'
+
+describe RemoteDownloader do
+
+ let(:filename) { 'file_name.pdf' }
+
+ subject { described_class.new filename }
+
+ describe '#url' do
+ it { expect(subject.url).to eq 'https://storage.apientreprise.fr/tps_dev/file_name.pdf' }
+ end
+end
|
Add tests for remote downloader
|
diff --git a/lib/tasks/peer_review.rake b/lib/tasks/peer_review.rake
index abc1234..def5678 100644
--- a/lib/tasks/peer_review.rake
+++ b/lib/tasks/peer_review.rake
@@ -6,7 +6,7 @@ task peer_reviews: :environment do
puts 'Creating A1 Peer Review and updating A1 to have the peer review'
a1 = Assignment.find_by(short_identifier: 'A1')
- a1.assignment_properties.update(has_peer_review: true) # Creates 'a1pr' via callback.
+ a1.update(has_peer_review: true) # Creates 'a1pr' via callback.
a1pr = a1.pr_assignment
a1pr.clone_groupings_from(a1.id)
|
seed: Fix peer review creation in seed data
|
diff --git a/lib/category.rb b/lib/category.rb
index abc1234..def5678 100644
--- a/lib/category.rb
+++ b/lib/category.rb
@@ -7,7 +7,7 @@ "Clarity"
end
- def self.compatability
+ def self.compatibility
"Compatibility"
end
|
Fix typo (compatability -> compatibility)
|
diff --git a/core/spec/screenshots/tour_spec.rb b/core/spec/screenshots/tour_spec.rb
index abc1234..def5678 100644
--- a/core/spec/screenshots/tour_spec.rb
+++ b/core/spec/screenshots/tour_spec.rb
@@ -17,6 +17,7 @@ it 'Interests page should be the same' do
user = create :user
Pavlov.command(:'users/add_handpicked_user', user_id: user.id.to_s)
+ create :fact, created_by: user.graph_user
visit interests_path
|
Fix having one discussion on interests page
|
diff --git a/changeset/rom-changeset.gemspec b/changeset/rom-changeset.gemspec
index abc1234..def5678 100644
--- a/changeset/rom-changeset.gemspec
+++ b/changeset/rom-changeset.gemspec
@@ -13,6 +13,7 @@ gem.license = 'MIT'
gem.add_runtime_dependency 'dry-core', '~> 0.3', '>= 0.3.1'
+ gem.add_runtime_dependency 'rom-core', '~> 4.0.0.beta'
gem.add_runtime_dependency 'transproc', '~> 1.0'
gem.add_development_dependency 'rake', '~> 11.2'
|
Add missing dep on rom to changeset
|
diff --git a/tests/rec-hosts-rm.rb b/tests/rec-hosts-rm.rb
index abc1234..def5678 100644
--- a/tests/rec-hosts-rm.rb
+++ b/tests/rec-hosts-rm.rb
@@ -0,0 +1,20 @@+# This will leave /etc/hosts with nothing but comments and whitespace
+commands="
+rm /system/config/hosts
+save
+"
+
+diff["/etc/hosts"] = <<TXT
+--- /tmp/aug/etc/hosts
++++ /tmp/aug/etc/hosts.augnew
+@@ -1,6 +1,6 @@
+ # Do not remove the following line, or various programs
+ # that require network functionality will fail.
+-127.0.0.1\tlocalhost.localdomain\tlocalhost galia.watzmann.net galia
++
+ #172.31.122.254 granny.watzmann.net granny puppet
+ #172.31.122.1 galia.watzmann.net galia
+-172.31.122.14 orange.watzmann.net orange
++
+TXT
+
|
Test deleting everything from /etc/hosts
|
diff --git a/db/migrate/20120906212544_create_contenteditable_contents.rb b/db/migrate/20120906212544_create_contenteditable_contents.rb
index abc1234..def5678 100644
--- a/db/migrate/20120906212544_create_contenteditable_contents.rb
+++ b/db/migrate/20120906212544_create_contenteditable_contents.rb
@@ -1,6 +1,6 @@-class CreateContenteditableContents < ActiveRecord::Migration
+class CreateTranslations < ActiveRecord::Migration
def change
- create_table :contenteditable_contents do |t|
+ create_table :translations do |t|
t.string :key
t.text :value
|
Change table name to translations
|
diff --git a/lib/what_now.rb b/lib/what_now.rb
index abc1234..def5678 100644
--- a/lib/what_now.rb
+++ b/lib/what_now.rb
@@ -18,22 +18,16 @@ end
def search_file(path)
- todos = []
- unless File.binary?(path)
- File.open(path).each_with_index do |line, i|
- result = search_line(line, path, i+1)
- todos << result if result
- end
- end
- todos
+ return [] if File.binary? path
+ File.open(path).each_with_index.map do |line, i|
+ search_line(line, path, i+1)
+ end.delete_if { |l| l.nil? }
end
def search_directory(pattern)
- todos = []
- Dir[pattern].each do |file|
- todos = todos + search_file(file)
+ Dir[pattern].flat_map do |file|
+ search_file(file)
end
- todos
end
end
end
|
Use ruby awesomeness to simplify code in file and directory methods
|
diff --git a/spec/acceptance/10_basic_gnocchi_spec.rb b/spec/acceptance/10_basic_gnocchi_spec.rb
index abc1234..def5678 100644
--- a/spec/acceptance/10_basic_gnocchi_spec.rb
+++ b/spec/acceptance/10_basic_gnocchi_spec.rb
@@ -10,6 +10,8 @@ include openstack_integration::repos
include openstack_integration::apache
include openstack_integration::mysql
+ include openstack_integration::memcached
+ include openstack_integration::redis
include openstack_integration::keystone
class { 'openstack_integration::gnocchi':
integration_enable => false,
|
Enable memcached and redis in acceptance tests
... because these are required as cache/coordination backend.
Change-Id: I16594b5e046fcc6639c134bc8ce566f8ffbc3f43
|
diff --git a/spec/acceptance/postfix_instance_spec.rb b/spec/acceptance/postfix_instance_spec.rb
index abc1234..def5678 100644
--- a/spec/acceptance/postfix_instance_spec.rb
+++ b/spec/acceptance/postfix_instance_spec.rb
@@ -5,14 +5,15 @@ before :all do
# include postfix class for package installation
apply_manifest('include postfix', :catch_failures => true)
+ apply_manifest('include postfix', :catch_changes => true)
end
-
- describe "getting a list of instances via puppet ressource" do
+
+ describe "get existing instances" do
describe command('puppet resource postfix_instance') do
its(:stdout) { should match /postfix_instance { '-':/ }
end
end
-
+
describe 'running puppet code' do
it 'should run with no errors' do
pp = <<-EOS
@@ -22,23 +23,34 @@ apply_manifest(pp, :catch_failures => true)
apply_manifest(pp, :catch_changes => true)
end
+
+ it 'should create instance' do
+ shell('postmulti -l|grep postfix-out', :acceptable_exit_codes => 0)
+ end
end
-
- it 'should create instance' do
- shell('postmulti -l|grep postfix-out', :acceptable_exit_codes => 0)
- end
+
describe file('/etc/postfix-out') do
it { should be_directory }
end
-
+
describe file('/etc/postfix-out/main.cf') do
it { should be_file }
end
-
-
+
+
describe file('/etc/postfix-out/master.cf') do
it { should be_file }
end
+
+ describe 'destroy instance' do
+ it 'should run with no errors' do
+ pp = <<-EOS
+ postfix_instance { 'postfix-out': ensure => absent }
+ EOS
+
+ apply_manifest(pp, :catch_failures => true )
+ end
+ end
end
-
+
|
Add spec tests for postfix_instance
|
diff --git a/app/controllers/announcements_controller.rb b/app/controllers/announcements_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/announcements_controller.rb
+++ b/app/controllers/announcements_controller.rb
@@ -1,24 +1,41 @@ class AnnouncementsController < PublicFacingController
def index
- announced = AnnouncementsFilter.new
+ announced = AnnouncementsFilter.new(valid_types, params_filters)
@results = announced.announcements
end
private
+ def params_filters
+ sanitized_filters(params.slice(:page, :type))
+ end
+
+ def valid_types
+ %w[ news_article speech ]
+ end
+
+ def sanitized_filters(filters)
+ filters.delete(:type) unless filters[:type].nil? || valid_types.include?(filters[:type].to_s)
+ filters
+ end
+
class AnnouncementsFilter
- def initialize(options={})
- @options = options
+ def initialize(valid_types, options={})
+ @valid_types, @options = valid_types, options
+ end
+
+ def valid_types
+ @valid_types
end
def announcements
@announcements ||= (
announcements = Edition
- announcements = announcements.by_type(["NewsArticle", "Speech"])
+ announcements = announcements.by_type(@options[:type] ? @options[:type].classify : valid_types.collect {|c| c.classify })
announcements = announcements.published
announcements = announcements.by_first_published_at
- announcements.includes(:organisations)
+ announcements.includes(:organisations).page(@options[:page] || 1).per(20)
)
end
end
|
Add type and page params to announcements
|
diff --git a/app/controllers/api/v1/causes_controller.rb b/app/controllers/api/v1/causes_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/api/v1/causes_controller.rb
+++ b/app/controllers/api/v1/causes_controller.rb
@@ -9,8 +9,8 @@ end
def show
+ Volunteermatch.call_events(params[:id])
cause = Cause.find_by_id(params[:id])
- vm_cause = Volunteermatch.call(:searchOpportunities, {:location => "new york", :fieldsToDisplay => ["title", "parentOrg", "availability", "plaintextDescription", "location", "skillsNeeded", "minimumAge", "vmUrl"], :numberOfResults => 20, :sortOrder => "asc", :categoryIds => [params[:id].to_i]}.to_json)
render json: cause, include: ['events']
end
|
Call VolunteerMatch method to access json data when cause is selected
|
diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/organizations_controller.rb
+++ b/app/controllers/organizations_controller.rb
@@ -1,5 +1,6 @@ class OrganizationsController < PlugitController
before_filter :require_admin
+ before_filter :update_organizations, only: [ :index ]
def index
@organizations = Organization.all
@@ -13,4 +14,10 @@ flash[:notice] = "Updated organizations."
redirect_to organizations_path
end
+
+ private
+
+ def update_organizations
+ # NOOP
+ end
end
|
Add hook to refresh organizations.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.