diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/xml_spec.gemspec b/xml_spec.gemspec
index abc1234..def5678 100644
--- a/xml_spec.gemspec
+++ b/xml_spec.gemspec
@@ -10,7 +10,7 @@ spec.email = ["jason@lookforwardenterprises.com"]
spec.summary = %q{XML matchers for specs.}
spec.description = %q{XML matchers for specs. See README for more info.}
- spec.homepage = ""
+ spec.homepage = "https://github.com/midas/xml_spec"
spec.license = "MIT"
spec.files = `git ls-files`.split($/)
|
Add project homepage to gemspec.
|
diff --git a/lib/streamy/railties/consumer.rake b/lib/streamy/railties/consumer.rake
index abc1234..def5678 100644
--- a/lib/streamy/railties/consumer.rake
+++ b/lib/streamy/railties/consumer.rake
@@ -6,13 +6,11 @@ raise "Missing `rabbitmq_uri` for '#{Rails.env}' environment, set this value in `config/secrets.yml`"
end
- system(
- {
- "HUTCH_URI" => Rails.application.secrets.rabbitmq_uri,
- "HUTCH_ENABLE_HTTP_API_USE" => "false"
- },
- "bundle exec hutch"
- )
+ Hutch::Config[:uri] = Rails.application.secrets.rabbitmq_uri
+ Hutch::Config[:enable_http_api_use] = false
+
+ cli = Hutch::CLI.new
+ cli.run(ARGV)
end
end
end
|
Call Hutch::CLI instead of spawning a process
|
diff --git a/app/controllers/brexit_landing_page_controller.rb b/app/controllers/brexit_landing_page_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/brexit_landing_page_controller.rb
+++ b/app/controllers/brexit_landing_page_controller.rb
@@ -11,21 +11,19 @@ private
def taxon
- @taxon ||= Taxon.find(request.path)
+ Taxon.find(request.path)
end
def presented_taxon
- @presented_taxon ||= BrexitLandingPagePresenter.new(taxon)
+ BrexitLandingPagePresenter.new(taxon)
end
def presentable_section_items
- @presentable_section_items = @presented_taxon.supergroup_sections.select { |section| section[:show_section] }.map do |section|
+ presented_taxon.supergroup_sections.select { |section| section[:show_section] }.map do |section|
{
href: "##{section[:id]}",
text: t(section[:id], scope: :content_purpose_supergroup, default: section[:title])
}
end
-
- @presentable_section_items
end
end
|
Remove memoizations and instance variables.
These are not used and can therefore be removed
|
diff --git a/emory.gemspec b/emory.gemspec
index abc1234..def5678 100644
--- a/emory.gemspec
+++ b/emory.gemspec
@@ -17,8 +17,8 @@ s.test_files = Dir.glob("{spec,test}/**/*.rb")
s.require_paths = ["lib"]
- s.add_development_dependency 'rspec', '2.14.1'
- s.add_development_dependency 'simplecov', '0.8.2' if RUBY_VERSION =~ /1.9/
+ s.add_development_dependency 'rspec', '~> 2.10'
+ s.add_development_dependency 'simplecov', '~> 0.6.4' if RUBY_VERSION =~ /1.9/
s.add_development_dependency 'rake'
s.add_runtime_dependency 'logging', '1.8.2'
|
Revert "Upgrading to most recent version of gems"
This reverts commit 5bd72ceb67398bbae05d616496d14ee0db14dd83.
|
diff --git a/tasks/metrics/mutant.rake b/tasks/metrics/mutant.rake
index abc1234..def5678 100644
--- a/tasks/metrics/mutant.rake
+++ b/tasks/metrics/mutant.rake
@@ -8,7 +8,7 @@ task :mutant => :coverage do
project = Devtools.project
config = project.mutant
- cmd = %[bundle exec mutant -r ./spec/spec_helper.rb "::#{config.namespace}" --rspec-dm2]
+ cmd = %[mutant -r ./spec/spec_helper.rb "::#{config.namespace}" --rspec-dm2]
Kernel.system(cmd) || raise('Mutant task is not successful')
end
else
|
Remove unnecessary bundle exec from the command
* If the task is being run under bundler, system calls should work
the same as if they were run with bundle exec.
|
diff --git a/Casks/ninjablocks.rb b/Casks/ninjablocks.rb
index abc1234..def5678 100644
--- a/Casks/ninjablocks.rb
+++ b/Casks/ninjablocks.rb
@@ -0,0 +1,7 @@+class Ninjablocks < Cask
+ url 'https://dl.dropboxusercontent.com/u/428557/NinjaBlocks-0.2.dmg'
+ homepage 'http://forums.ninjablocks.com/index.php?p=/discussion/1655/ninja-osx-client/p1'
+ version '0.2'
+ sha1 '79b5040e42aff4bcf2286c0d6142b7d81c9cc5aa'
+ link 'NinjaBlocks.app'
+end
|
Add Cask for Ninja Blocks Client v0.2
|
diff --git a/Casks/pocketcasts.rb b/Casks/pocketcasts.rb
index abc1234..def5678 100644
--- a/Casks/pocketcasts.rb
+++ b/Casks/pocketcasts.rb
@@ -0,0 +1,12 @@+cask :v1 => 'pocketcasts' do
+ version '1.0'
+ sha256 'fe191ceb3a7157bee5a589bed248464587526ddbaeacab122960a4144d1c87da'
+
+ url "https://github.com/mortenjust/PocketCastsOSX/releases/download/#{version}/PocketCastsOSX#{version}.zip"
+ appcast 'https://github.com/mortenjust/PocketCastsOSX/releases.atom'
+ name 'Pocket Casts for Mac'
+ homepage 'https://github.com/mortenjust/PocketCastsOSX'
+ license :unknown # todo: change license and remove this comment; ':unknown' is a machine-generated placeholder
+
+ app 'PocketCasts.app'
+end
|
Add Pocket Casts for Mac v1.0
|
diff --git a/Casks/vagrant-bar.rb b/Casks/vagrant-bar.rb
index abc1234..def5678 100644
--- a/Casks/vagrant-bar.rb
+++ b/Casks/vagrant-bar.rb
@@ -1,6 +1,6 @@ cask :v1 => 'vagrant-bar' do
- version '1.14'
- sha256 '6cf9a2bf9fbe41237a7afa2621d9c1e94ad225e59aa3969b8408b9adbd956334'
+ version '1.15'
+ sha256 'dc4f77ad00e2751e7375eab0172323d9bd9110ced170dc4033036b530ed7fdeb'
url "https://github.com/BipSync/VagrantBar/releases/download/#{version}/Vagrant.Bar.zip"
homepage 'https://github.com/BipSync/VagrantBar'
|
Update Vagrant Bar to 1.15
|
diff --git a/gems.rb b/gems.rb
index abc1234..def5678 100644
--- a/gems.rb
+++ b/gems.rb
@@ -9,8 +9,7 @@ end
group :development do
- gem 'bump', '~> 0.6.0', require: false
- gem 'bundler', '~> 1.8', require: false
+ gem 'bump', '~> 0.6.0', require: false
end
group :ci, :development do
|
Remove Bundler as an explicit dependency
It's implicit in the use of a `gems.rb` file, where this is specified,
that Bundler must be used, so I think this callout is a bit unnecessary
and can only cause annoying issues with Travis.
|
diff --git a/test/test_ingress_info.rb b/test/test_ingress_info.rb
index abc1234..def5678 100644
--- a/test/test_ingress_info.rb
+++ b/test/test_ingress_info.rb
@@ -1,7 +1,7 @@ require 'minitest/autorun'
require 'ingress_info'
-class TestIngressInfo < Minitest::Test
+class TestIngressInfo < Minitest::Unit::TestCase
def test_that_checkpoints_can_include_zero
set = IngressCycles.checkpointsForDate(Time.new(2014, 12, 02, 00, 00, 00), Date.new(2014, 12, 02))
assert_equal "00:00", set[0]
|
Fix class for test case.
|
diff --git a/test/unit/ability_test.rb b/test/unit/ability_test.rb
index abc1234..def5678 100644
--- a/test/unit/ability_test.rb
+++ b/test/unit/ability_test.rb
@@ -26,4 +26,10 @@ # assert ability.cannot?(:update, @unauthorize_election.candidacies.first)
# end
+ test "standard users should not be able to add contributors" do
+ user = FactoryGirl.create(:user)
+ ability = Ability.new(user)
+ assert ability.cannot?(:addcontributor, @election)
+ end
+
end
|
Add a unit test to ensure that an user cannot add contributors
|
diff --git a/knife-wsfusion.gemspec b/knife-wsfusion.gemspec
index abc1234..def5678 100644
--- a/knife-wsfusion.gemspec
+++ b/knife-wsfusion.gemspec
@@ -11,6 +11,7 @@ s.email = "chipx86@chipx86.com"
s.files = Dir["lib/**/*"]
s.rubygems_version = "1.6.2"
+ s.homepage = "https://github.com/chipx86/knife-wsfusion"
- s.add_dependency("chef", [">= 0.10.0"])
+ s.add_dependency("chef", [">= 0.11.0"])
end
|
Add a homepage and safer dependency to the gemspec.
|
diff --git a/app/classes/query/user.rb b/app/classes/query/user.rb
index abc1234..def5678 100644
--- a/app/classes/query/user.rb
+++ b/app/classes/query/user.rb
@@ -10,4 +10,8 @@ initialize_model_do_time(:created_at)
initialize_model_do_time(:updated_at)
end
+
+ def default_order
+ "name"
+ end
end
|
Add model-level default sort order to Query::User.
See query.rb.old line 698.
Also see abstract_query.rb.old#old
|
diff --git a/app/models/spree/slide.rb b/app/models/spree/slide.rb
index abc1234..def5678 100644
--- a/app/models/spree/slide.rb
+++ b/app/models/spree/slide.rb
@@ -8,27 +8,25 @@ :path => ':rails_root/public/spree/showcase/:id/:style/:basename.:extension'
# Add S3 and Heroku support
- if Rails.env.production?
- if ENV['S3_KEY'] && ENV['S3_SECRET'] && ENV['S3_BUCKET']
- S3_OPTIONS = {
- :storage => 's3',
- :s3_credentials => {
- :access_key_id => ENV['S3_KEY'],
- :secret_access_key => ENV['S3_SECRET']
- },
- :bucket => ENV['S3_BUCKET']
- }
- elsif FileTest.exists?(Rails.root.join('config','s3.yml'))
- S3_OPTIONS = {
- :storage => 's3',
- :s3_credentials => Rails.root.join('config', 's3.yml')
- }
- else
- S3_OPTIONS = { :storage => 'filesystem' }
- end
+ s3_options = if ENV['S3_KEY'] && ENV['S3_SECRET'] && ENV['S3_BUCKET']
+ {
+ :storage => 's3',
+ :s3_credentials => {
+ :access_key_id => ENV['S3_KEY'],
+ :secret_access_key => ENV['S3_SECRET']
+ },
+ :bucket => ENV['S3_BUCKET']
+ }
+ elsif (s3_config_file = Rails.root.join('config','s3.yml')).exist?
+ {
+ :storage => 's3',
+ :s3_credentials => s3_config_file
+ }
+ else
+ { :storage => 'filesystem' }
end
- attachment_definitions[:image] = (attachment_definitions[:image] || {}).merge(S3_OPTIONS)
+ attachment_definitions[:image] = (attachment_definitions[:image] || {}).merge(s3_options)
default_scope order(:position) # Slides should always be ordered by position specified by user.
scope :published, where(:published=>true)
|
Fix and improve S3/Heroku integration
- The existing code caused exceptions in all environments but production. This is now fixed.
- No need to use a constant – a regular variable will do just fine.
- Use Pathname's own #exist? method rather than FileTest.
- There should be no behavior that depends on the Rails environment. It is perfectly acceptable to
use Heroku-like behavior if the user decides to set the according environment variables or use the
config file if the user decides that this makes sense.
|
diff --git a/lib/napa/grape_extensions/grape_helpers.rb b/lib/napa/grape_extensions/grape_helpers.rb
index abc1234..def5678 100644
--- a/lib/napa/grape_extensions/grape_helpers.rb
+++ b/lib/napa/grape_extensions/grape_helpers.rb
@@ -3,7 +3,7 @@ def represent(data, with: nil, **args)
raise ArgumentError.new(":with option is required") if with.nil?
- if data.respond_to?(:to_a)
+ if data.respond_to?(:map)
return { data: data.map{ |item| with.new(item).to_hash(args) } }
else
return { data: with.new(data).to_hash(args)}
|
Update test of data to check for the method actually used rather than assume that an object that responds to :to_a can respond to :map.
This resolves https://github.com/bellycard/napa/issues/216
|
diff --git a/ETA-SDK.podspec b/ETA-SDK.podspec
index abc1234..def5678 100644
--- a/ETA-SDK.podspec
+++ b/ETA-SDK.podspec
@@ -1,6 +1,6 @@ Pod::Spec.new do |s|
s.name = "ETA-SDK"
- s.version = "2.1.0"
+ s.version = "2.1.1"
s.summary = "eTilbudsavis iOS SDK."
s.description = <<-DESC
An SDK that makes it easy to talk to the eTilbudsavis API.
@@ -14,7 +14,7 @@ s.platform = :ios, '5.0'
s.requires_arc = true
- s.source = { :git => "https://github.com/eTilbudsavis/native-ios-eta-sdk.git", :tag => "v2.1.0" }
+ s.source = { :git => "https://github.com/eTilbudsavis/native-ios-eta-sdk.git", :tag => "v2.1.1" }
s.source_files = 'ETA-SDK/**/*.{h,m}'
s.frameworks = 'CoreLocation', 'Foundation', 'UIKit'
|
Update the podspec to point to correct tag (2.1.1)
|
diff --git a/lib/current_weather.rb b/lib/current_weather.rb
index abc1234..def5678 100644
--- a/lib/current_weather.rb
+++ b/lib/current_weather.rb
@@ -1,6 +1,8 @@+require_relative 'get_json'
+
class CurrentWeather
- attr_reader :zip
+ attr_reader :zip, :json
def initialize(zip = "#{DEFAULT}")
if zip.downcase == 'work'
@@ -9,36 +11,34 @@ zip = "#{HOME}"
end
@zip = zip
+ @json = GetJSON.new(@zip).call_api
end
- def get_json
- url = "http://api.wunderground.com/api/#{KEY}/conditions/q/#{zip}.json"
- resp = Net::HTTP.get_response(URI.parse(url))
- @parsed_json = JSON.parse(resp.body)
+ def parsed_json
+ JSON.parse(json)
end
def last_updated
- @parsed_json['current_observation']['observation_time']
+ parsed_json['current_observation']['observation_time']
end
def location
- @parsed_json['current_observation']['display_location']['full']
+ parsed_json['current_observation']['display_location']['full']
end
def current_temp
- @parsed_json['current_observation']['temp_f']
+ parsed_json['current_observation']['temp_f']
end
def conditions
- @parsed_json['current_observation']['weather']
+ parsed_json['current_observation']['weather']
end
def wind
- @parsed_json['current_observation']['wind_string']
+ parsed_json['current_observation']['wind_string']
end
def get_current
- get_json
puts
puts last_updated
puts "#{location} #{zip} - #{current_temp}F - #{conditions}"
|
Remove api call from CurrentWeather class
|
diff --git a/lib/delayed/recipes.rb b/lib/delayed/recipes.rb
index abc1234..def5678 100644
--- a/lib/delayed/recipes.rb
+++ b/lib/delayed/recipes.rb
@@ -13,6 +13,10 @@ fetch(:rails_env, false) ? "RAILS_ENV=#{fetch(:rails_env)}" : ''
end
+ def args
+ fetch(:delayed_job_args, "")
+ end
+
desc "Stop the delayed_job process"
task :stop, :roles => :app do
run "cd #{current_path};#{rails_env} script/delayed_job stop"
@@ -20,12 +24,12 @@
desc "Start the delayed_job process"
task :start, :roles => :app do
- run "cd #{current_path};#{rails_env} script/delayed_job start"
+ run "cd #{current_path};#{rails_env} script/delayed_job start #{args}"
end
desc "Restart the delayed_job process"
task :restart, :roles => :app do
- run "cd #{current_path};#{rails_env} script/delayed_job restart"
+ run "cd #{current_path};#{rails_env} script/delayed_job restart #{args}"
end
end
end
|
Add delayed_job_args variable for Capistrano recipe to allow configuration of started workers (e.g. "-n 2 --max-priority 10")
|
diff --git a/lib/prison_schedule.rb b/lib/prison_schedule.rb
index abc1234..def5678 100644
--- a/lib/prison_schedule.rb
+++ b/lib/prison_schedule.rb
@@ -26,7 +26,7 @@
def confirmation_email_range
# Use an arbitary number of days to apply the filter on
- Date.today..last_bookable_day
+ Time.zone.today..last_bookable_day
end
def available_visitation_range
|
Use Time.zone instead of Date.today
Make use of the apps configured `London` timezone when
getting todays date.
Using Date.today will use the time on the server and not
the time zone configured by the application. This can lead
some indetermination when running code outside of a
developers workspace. We spotted this when specs failed on
CircleCI.
For more info about timezones and Rails [this article](http://danilenko.org/2012/7/6/rails_timezones/)
is worth a read.
|
diff --git a/lib/rubygems_plugin.rb b/lib/rubygems_plugin.rb
index abc1234..def5678 100644
--- a/lib/rubygems_plugin.rb
+++ b/lib/rubygems_plugin.rb
@@ -1,32 +1,30 @@ require 'rubygems'
Gem.post_install do |installer|
- if (repo = installer.spec.homepage) && !repo.empty?
- clone_dir = if ENV['GEMSRC_CLONE_ROOT']
- File.expand_path installer.spec.name, ENV['GEMSRC_CLONE_ROOT']
- elsif Gem.configuration[:gemsrc_clone_root]
- File.expand_path installer.spec.name, Gem.configuration[:gemsrc_clone_root]
- else
- gem_dir = installer.respond_to?(:gem_dir) ? installer.gem_dir : File.expand_path(File.join(installer.gem_home, 'gems', installer.spec.full_name))
- File.join gem_dir, 'src'
+ clone_dir = if ENV['GEMSRC_CLONE_ROOT']
+ File.expand_path installer.spec.name, ENV['GEMSRC_CLONE_ROOT']
+ elsif Gem.configuration[:gemsrc_clone_root]
+ File.expand_path installer.spec.name, Gem.configuration[:gemsrc_clone_root]
+ else
+ gem_dir = installer.respond_to?(:gem_dir) ? installer.gem_dir : File.expand_path(File.join(installer.gem_home, 'gems', installer.spec.full_name))
+ File.join gem_dir, 'src'
+ end
+
+ if (repo = installer.spec.homepage) && !repo.empty? && !File.exists?(clone_dir)
+ if repo =~ /\Ahttps?:\/\/([^.]+)\.github.com\/(.+)/
+ repo = if $1 == 'www'
+ "https://github.com/#{$2}"
+ elsif $1 == 'wiki'
+ # https://wiki.github.com/foo/bar => https://github.com/foo/bar
+ "https://github.com/#{$2}"
+ else
+ # https://foo.github.com/bar => https://github.com/foo/bar
+ "https://github.com/#{$1}/#{$2}"
+ end
end
- unless File.exists?(clone_dir)
- if repo =~ /\Ahttps?:\/\/([^.]+)\.github.com\/(.+)/
- repo = if $1 == 'www'
- "https://github.com/#{$2}"
- elsif $1 == 'wiki'
- # https://wiki.github.com/foo/bar => https://github.com/foo/bar
- "https://github.com/#{$2}"
- else
- # https://foo.github.com/bar => https://github.com/foo/bar
- "https://github.com/#{$1}/#{$2}"
- end
- end
-
- if !`git ls-remote #{repo} 2> /dev/null`.empty?
- `git clone #{repo} #{clone_dir}`
- end
+ if !`git ls-remote #{repo} 2> /dev/null`.empty?
+ `git clone #{repo} #{clone_dir}`
end
end
end
|
Revert "no need to compute clone_dir if homepage is empty"
This reverts commit 1a1a43c660c38d5bb2552e120df93e6b8caf6558.
Reason: for future refactorings
|
diff --git a/lib/rubygems_plugin.rb b/lib/rubygems_plugin.rb
index abc1234..def5678 100644
--- a/lib/rubygems_plugin.rb
+++ b/lib/rubygems_plugin.rb
@@ -8,6 +8,7 @@
require 'rbconfig'
require 'fileutils'
+ require 'rubygems/version_option'
unless Kernel.const_defined?(:Compiler)
load File.join(RbConfig::CONFIG['bindir'], 'macrubyc')
|
Make sure the version_option is available
|
diff --git a/plugins/commands/up/start_mixins.rb b/plugins/commands/up/start_mixins.rb
index abc1234..def5678 100644
--- a/plugins/commands/up/start_mixins.rb
+++ b/plugins/commands/up/start_mixins.rb
@@ -19,6 +19,8 @@ parser.on("--provision-with x,y,z", Array,
"Enable only certain provisioners, by type.") do |list|
options[:provision_types] = list.map { |type| type.to_sym }
+ options[:provision_enabled] = true
+ options[:provision_ignore_sentinel] = true
end
end
|
Enable provision with --provision-with flag
|
diff --git a/spec/factories/bugs.rb b/spec/factories/bugs.rb
index abc1234..def5678 100644
--- a/spec/factories/bugs.rb
+++ b/spec/factories/bugs.rb
@@ -3,6 +3,5 @@ title { "#{Faker::Commerce.product_name} can’t #{Faker::Company.bs}" }
reporter
description { "#{Faker::Lorem.paragraph}\n#{Faker::Hacker.say_something_smart}" }
- closed { [true, false].sample }
end
end
|
Remove "closed" from Bug Factory
Not necessary for a valid record.
|
diff --git a/spec/sidekiq_helper.rb b/spec/sidekiq_helper.rb
index abc1234..def5678 100644
--- a/spec/sidekiq_helper.rb
+++ b/spec/sidekiq_helper.rb
@@ -1,3 +1,4 @@+require 'sidekiq'
require 'sidekiq/testing'
require 'mock_redis'
|
Fix undefined method `raw_push` error
Error:
sidekiq-2.17.7/lib/sidekiq/testing.rb:59:in `alias_method':
undefined method `raw_push' for class `Sidekiq::Client' (NameError)
See https://github.com/mperham/sidekiq/issues/1125
|
diff --git a/spec/support/devise.rb b/spec/support/devise.rb
index abc1234..def5678 100644
--- a/spec/support/devise.rb
+++ b/spec/support/devise.rb
@@ -1,3 +1,3 @@ RSpec.configure do |config|
- config.include Devise::TestHelpers, type: :controller
+ config.include Devise::Test::ControllerHelpers, type: :controller
end
|
Fix DEPRECATION WARNING of Devise
```
DEPRECATION WARNING: [Devise] including `Devise::TestHelpers` is deprecated and will be removed from Devise.
For controller tests, please include `Devise::Test::ControllerHelpers` instead.
```
|
diff --git a/Casks/seashore.rb b/Casks/seashore.rb
index abc1234..def5678 100644
--- a/Casks/seashore.rb
+++ b/Casks/seashore.rb
@@ -0,0 +1,6 @@+class Seashore < Cask
+ url 'https://sourceforge.net/projects/seashore/files/seashore%20binaries/Seashore%200.5.1/Seashore.zip/download'
+ homepage 'http://seashore.sourceforge.net/'
+ version '0.5.1'
+ content_length '6957082'
+end
|
Add a Cask for Seashore.
|
diff --git a/Casks/wireover.rb b/Casks/wireover.rb
index abc1234..def5678 100644
--- a/Casks/wireover.rb
+++ b/Casks/wireover.rb
@@ -0,0 +1,7 @@+class Wireover < Cask
+ url 'https://router.wireover.com/app/WireOver.dmg'
+ homepage 'http://www.wireover.com/'
+ version 'latest'
+ no_checksum
+ link 'WireOver.app'
+end
|
Add WireOver.app v100 of the beta
Add support for the installation of WireOver, a desktop application
for sending and receiving files.
Fix version and checksum for WireOver.app Cask
Change version to 'latest' and SHA256 to 'no_checksum'
per pull request review.
Fix 'no_checksum' to pass audit for WireOver.app
|
diff --git a/lib/bouncer/outcome/base.rb b/lib/bouncer/outcome/base.rb
index abc1234..def5678 100644
--- a/lib/bouncer/outcome/base.rb
+++ b/lib/bouncer/outcome/base.rb
@@ -23,7 +23,9 @@ filepath = "../../../config/whitelist.txt"
path = File.expand_path(filepath, File.dirname(__FILE__))
lines = File.open(path).map(&:chomp)
- lines.reject { |line| line.start_with?('#') || line.empty? }
+ usable_lines = lines.reject { |line| line.start_with?('#') || line.empty? }
+ # Set dedupes but also gives better lookup performance
+ Set.new(usable_lines)
end
end
end
|
Use a Set for better performance of whitelist
|
diff --git a/lib/coffee/rails/railtie.rb b/lib/coffee/rails/railtie.rb
index abc1234..def5678 100644
--- a/lib/coffee/rails/railtie.rb
+++ b/lib/coffee/rails/railtie.rb
@@ -1,7 +1,9 @@ require 'rails/railtie'
-module Coffee::Rails
- class Railtie < ::Rails::Railtie
- config.app_generators.javascript_engine :coffee
+module Coffee
+ module Rails
+ class Railtie < ::Rails::Railtie
+ config.app_generators.javascript_engine :coffee
+ end
end
end
|
Fix undefined Coffee module issue
|
diff --git a/lib/config/custom-routes.rb b/lib/config/custom-routes.rb
index abc1234..def5678 100644
--- a/lib/config/custom-routes.rb
+++ b/lib/config/custom-routes.rb
@@ -1,11 +1,11 @@ # Here you can override or add to the pages in the core website
-Alaveteli::Application.routes.draw do
+Rails.application.routes.draw do
# brand new controller example
- # match '/mycontroller' => 'general#mycontroller', :as => :mycontroller
+ # get '/mycontroller' => 'general#mycontroller'
# Additional help page example
- # match '/help/help_out' => 'help#help_out', :as => :help_out
+ # get '/help/help_out' => 'help#help_out'
- match '/people' => 'general#people', :as => :people
+ get '/people' => 'general#people'
end
|
Switch custom routes over to rails 4
|
diff --git a/lib/domgen/jpa/generator.rb b/lib/domgen/jpa/generator.rb
index abc1234..def5678 100644
--- a/lib/domgen/jpa/generator.rb
+++ b/lib/domgen/jpa/generator.rb
@@ -1,15 +1,31 @@ module Domgen
module Generator
- def self.define_jpa_templates
- template_dir = "#{File.dirname(__FILE__)}/templates"
- java_class_prefix = 'java/#{object_type.java.fully_qualified_name.gsub(".","/")}'
- java_package_prefix = 'java/#{schema.java.package.gsub(".","/")}'
+ module Jpa
+ TEMPLATE_DIRECTORY = "#{File.dirname(__FILE__)}/templates"
+ JAVA_CLASS_PREFIX = 'java/#{object_type.java.fully_qualified_name.gsub(".","/")}'
+ JAVA_PACKAGE_PREFIX = 'java/#{schema.java.package.gsub(".","/")}'
+ end
+
+ def self.define_jpa_model_templates
+ [Template.new(:object_type,
+ "#{Jpa::TEMPLATE_DIRECTORY}/model.erb",
+ "#{Jpa::JAVA_CLASS_PREFIX}.java",
+ [Domgen::Jpa::Helper])]
+ end
+
+ def self.define_jpa_ejb_templates
+ [Template.new(:object_type, "#{Jpa::TEMPLATE_DIRECTORY}/ejb.erb", "#{Jpa::JAVA_CLASS_PREFIX}EJB.java"),]
+ end
+
+ def self.define_jpa_dao_templates
[
- Template.new(:object_type, "#{template_dir}/model.erb", "#{java_class_prefix}.java", [Domgen::Jpa::Helper]),
- Template.new(:object_type, "#{template_dir}/dao.erb", "#{java_class_prefix}DAO.java"),
- Template.new(:schema, "#{template_dir}/entity_manager.erb", "#{java_package_prefix}/SchemaEntityManager.java"),
- Template.new(:schema_set, "#{template_dir}/persistence.erb", 'resources/META-INF/persistence.xml'),
+ Template.new(:object_type, "#{Jpa::TEMPLATE_DIRECTORY}/dao.erb", "#{Jpa::JAVA_CLASS_PREFIX}DAO.java"),
+ Template.new(:schema, "#{Jpa::TEMPLATE_DIRECTORY}/entity_manager.erb", "#{Jpa::JAVA_PACKAGE_PREFIX}/SchemaEntityManager.java"),
]
+ end
+
+ def self.define_jpa_jta_persistence_templates
+ [Template.new(:schema_set, "#{Jpa::TEMPLATE_DIRECTORY}/persistence.erb", 'resources/META-INF/persistence.xml')]
end
end
end
|
Refactor so can selectively generate different jpa elements
|
diff --git a/api/spec/spec_helper.rb b/api/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/api/spec/spec_helper.rb
+++ b/api/spec/spec_helper.rb
@@ -11,7 +11,7 @@ require 'spree/core/testing_support/factories'
RSpec.configure do |config|
- config.backtrace_clean_patterns = [/gems/]
+ config.backtrace_clean_patterns = [/gems\/activesupport/, /gems\/actionpack/]
config.before(:suite) do
DatabaseCleaner.strategy = :transaction
DatabaseCleaner.clean_with(:truncation)
|
Remove AS and AP stuff from API backtrace
|
diff --git a/scss_lint.gemspec b/scss_lint.gemspec
index abc1234..def5678 100644
--- a/scss_lint.gemspec
+++ b/scss_lint.gemspec
@@ -25,6 +25,7 @@
s.required_ruby_version = '>= 1.9.3'
+ s.add_dependency 'rake', '~> 10.0'
s.add_dependency 'sass', '~> 3.4.15'
s.add_development_dependency 'rspec', '~> 3.3.0'
|
Add explicit dependency on rake gem
This appears to be required as of Ruby 2.3, otherwise we get a LoadError
when attempting to run `bundle exec rspec` (since our SimpleCov
integration loads rake).
|
diff --git a/lib/registrar/middleware.rb b/lib/registrar/middleware.rb
index abc1234..def5678 100644
--- a/lib/registrar/middleware.rb
+++ b/lib/registrar/middleware.rb
@@ -24,9 +24,20 @@ end
def self.add_omniauth_strategies
- name = config.name
+ strategies = config.strategies
+
+ if strategies.respond_to?(:each)
+ strategies.each do |strategy|
+ add_omniauth_strategy(strategy)
+ end
+ else
+ add_omniauth_strategy(strategies)
+ end
+ end
+
+ def self.add_omniauth_strategy(strategy)
config.middleware.use ::OmniAuth::Builder do
- provider name
+ provider strategy
end
end
@@ -43,8 +54,8 @@ end
class Config
- def name(arg = nil)
- @name ||= arg
+ def strategies(arg = nil)
+ @strategies ||= arg
end
def attributes(arg = nil)
|
Allow to configure multiple omniauth strategies
|
diff --git a/lib/sinatra/test_methods.rb b/lib/sinatra/test_methods.rb
index abc1234..def5678 100644
--- a/lib/sinatra/test_methods.rb
+++ b/lib/sinatra/test_methods.rb
@@ -12,6 +12,25 @@ body
end
end_eval
+ end
+
+ def show!(editor = nil)
+ editor = editor || ENV['EDITOR']
+ IO.popen(editor, 'w') do |f|
+ f.puts "<!--"
+ f.puts result_info
+ f.puts "-->"
+ f.puts
+ f.puts body
+ end
+ end
+ alias :mate :show!
+
+ def result_info
+ info = <<-end_info
+ # Status: #{status}
+ # Headers: #{headers.inspect}
+ end_info
end
def response
|
Use mate or show! in irb to open in EDITOR
|
diff --git a/lib/spidr/extensions/uri.rb b/lib/spidr/extensions/uri.rb
index abc1234..def5678 100644
--- a/lib/spidr/extensions/uri.rb
+++ b/lib/spidr/extensions/uri.rb
@@ -29,15 +29,15 @@ #
def self.expand_path(path)
if path.start_with?('/')
- prefix, path = path[0,1], path[1..-1]
+ leading_slash, path = path[0,1], path[1..-1]
else
- prefix = ''
+ leading_slash = ''
end
if path.end_with?('/')
- suffix, path = path[-1,1], path[0..-2]
+ trailing_slash, path = path[-1,1], path[0..-2]
else
- suffix = ''
+ trailing_slash = ''
end
scanner = StringScanner.new(path)
@@ -55,8 +55,10 @@ end
end
- unless stack.empty? then "#{prefix}#{stack.join('/')}#{suffix}"
- else '/'
+ unless stack.empty?
+ "#{leading_slash}#{stack.join('/')}#{trailing_slash}"
+ else
+ '/'
end
end
end
|
Use more descriptive variable names.
|
diff --git a/test/models/notifiers/base_test.rb b/test/models/notifiers/base_test.rb
index abc1234..def5678 100644
--- a/test/models/notifiers/base_test.rb
+++ b/test/models/notifiers/base_test.rb
@@ -0,0 +1,18 @@+require 'test_helper'
+
+class Notifiers::BaseTest < ActiveSupport::TestCase
+ test '#notify' do
+ base = Notifiers::Base.new
+ base.define_singleton_method(:perform) do
+ true
+ end
+
+ assert base.notify
+ end
+
+ test '#perform' do
+ assert_raise NotImplementedError do
+ Notifiers::Base.new.send(:perform)
+ end
+ end
+end
|
Create test for `Notifiers::Base` class
|
diff --git a/lib/tasks/govuk_assets.rake b/lib/tasks/govuk_assets.rake
index abc1234..def5678 100644
--- a/lib/tasks/govuk_assets.rake
+++ b/lib/tasks/govuk_assets.rake
@@ -16,4 +16,14 @@ status = result.successful? ? 'OK' : 'Error'
puts "#{status}: #{result.written_count} documents updated"
end
+
+ desc 'Create a whitehall asset with the given legacy URL path'
+ task :create_whitehall_asset, %i[file_path legacy_url_path] => :environment do |_, args|
+ file_path = args[:file_path]
+ legacy_url_path = args[:legacy_url_path]
+ WhitehallAsset.create!(
+ file: Pathname.new(file_path).open,
+ legacy_url_path: legacy_url_path,
+ )
+ end
end
|
Add a rake task to create a whitehall asset
|
diff --git a/lib/caesar.rb b/lib/caesar.rb
index abc1234..def5678 100644
--- a/lib/caesar.rb
+++ b/lib/caesar.rb
@@ -17,12 +17,14 @@ text.upcase.chars.map { |c| char_if_present(c) }.compact
end
- def substitute(char, other_alphabet)
- other_alphabet[index(char)]
+ # Given a char and another alphabet, find the char in this alphabet
+ # at the corresponding index in this alphabet
+ def char(char, other_alphabet)
+ self[other_alphabet.index(char)]
end
def to_s
- "<Alphabet '#{@chars.join}'>"
+ "<Alphabet:[#{@chars.join}]>"
end
private
@@ -36,8 +38,6 @@ def initialize(shift)
@text_alphabet = Alphabet.new ("A".."Z")
@cipher_alphabet = Alphabet.new ("A".."Z"), shift: shift
- puts "text: #{@text_alphabet}"
- puts "text: #{@cipher_alphabet}"
end
@@ -52,7 +52,7 @@ private
def substitute(text, source_alphabet, target_alphabet)
source_alphabet.sanitized_chars(text).map do |char|
- source_alphabet.substitute(char, target_alphabet)
+ target_alphabet.char(char, source_alphabet)
end.join
end
end
|
Make substitution a method of *target* alphabet.
|
diff --git a/lib/dataly.rb b/lib/dataly.rb
index abc1234..def5678 100644
--- a/lib/dataly.rb
+++ b/lib/dataly.rb
@@ -9,8 +9,11 @@ end
require 'dataly/importer'
+require 'dataly/file_splitter'
+require 'dataly/batch_importer'
require 'dataly/mapper'
require 'dataly/creator'
require 'dataly/batch_creator'
require 'dataly/reporter'
require 'dataly/report_formatter'
+require 'dataly/json_formatter'
|
Add missing require statements to module
|
diff --git a/lib/helper.rb b/lib/helper.rb
index abc1234..def5678 100644
--- a/lib/helper.rb
+++ b/lib/helper.rb
@@ -17,11 +17,11 @@
def self.trend_class(val)
if val.to_f > 0
- 'icon-angle-up'
+ 'icon-arrow-up'
elsif val.to_f < 0
- 'icon-angle-down'
+ 'icon-arrow-down'
else
- 'icon-angle-right'
+ 'icon-arrow-right'
end
end
|
Reset trend arrows styling, new ones are too thin
|
diff --git a/lib/nickel.rb b/lib/nickel.rb
index abc1234..def5678 100644
--- a/lib/nickel.rb
+++ b/lib/nickel.rb
@@ -6,6 +6,7 @@
require 'nickel/version'
require 'nickel/nlp'
+require 'holidays_wrapper'
module Nickel
class << self
|
Add require for Holidays Wrapper
|
diff --git a/lib/plotrb.rb b/lib/plotrb.rb
index abc1234..def5678 100644
--- a/lib/plotrb.rb
+++ b/lib/plotrb.rb
@@ -3,6 +3,9 @@ require 'uri'
require 'hashie'
require 'active_model'
+
+require_relative 'plotrb/internals'
+require_relative 'plotrb/validators'
require_relative 'plotrb/visualization'
require_relative 'plotrb/errors'
@@ -10,8 +13,7 @@ require_relative 'plotrb/transforms'
require_relative 'plotrb/scales'
require_relative 'plotrb/marks'
-require_relative 'plotrb/validators'
-require_relative 'plotrb/internals'
+require_relative 'plotrb/axes'
module Plotrb
|
Make sure load internals module first.
|
diff --git a/plek.gemspec b/plek.gemspec
index abc1234..def5678 100644
--- a/plek.gemspec
+++ b/plek.gemspec
@@ -8,8 +8,8 @@ s.name = "plek"
s.version = Plek::VERSION
s.platform = Gem::Platform::RUBY
- s.authors = ["Craig R Webster"]
- s.email = ["craig@barkingiguana.com"]
+ s.authors = ["GOV.UK Dev"]
+ s.email = ["govuk-dev@digital.cabinet-office.gov.uk"]
s.summary = "Locations for services"
s.description = "Find the right hostname for each service in an environment-dependent manner"
s.license = 'MIT'
|
Use standard GOV.UK authors and email in the gemspec
|
diff --git a/db/migrate/20161014194032_add_tags_to_articles.rb b/db/migrate/20161014194032_add_tags_to_articles.rb
index abc1234..def5678 100644
--- a/db/migrate/20161014194032_add_tags_to_articles.rb
+++ b/db/migrate/20161014194032_add_tags_to_articles.rb
@@ -1,5 +1,5 @@ class AddTagsToArticles < ActiveRecord::Migration[4.2]
def change
- add_column :articles, :tags, :string, array: true, default: []
+ add_column :articles, :tags, :string, default: [], array: true
end
end
|
Move array: true to the end of the migration
|
diff --git a/spec/controllers/lets_encrypt/verifications_controller_spec.rb b/spec/controllers/lets_encrypt/verifications_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/lets_encrypt/verifications_controller_spec.rb
+++ b/spec/controllers/lets_encrypt/verifications_controller_spec.rb
@@ -14,14 +14,14 @@
describe 'has certificate' do
- let!(:certificate) do
- LetsEncrypt.certificate_model.create(
- domain: 'example.com',
- verification_path: '.well-known/acme-challenge/valid_path',
- verification_string: 'verification'
- )
- end
context 'with default model' do
+ let!(:certificate) do
+ LetsEncrypt.certificate_model.create(
+ domain: 'example.com',
+ verification_path: '.well-known/acme-challenge/valid_path',
+ verification_string: 'verification'
+ )
+ end
it 'returns verification string when found verification path' do
open(:get, :show, verification_path: 'valid_path')
expect(response.status).to eq(200)
@@ -31,6 +31,13 @@
context 'with customize model' do
before { LetsEncrypt.config.certificate_model = 'OtherModel' }
+ let!(:certificate) do
+ LetsEncrypt.certificate_model.create(
+ domain: 'example.com',
+ verification_path: '.well-known/acme-challenge/valid_path',
+ verification_string: 'verification'
+ )
+ end
after { LetsEncrypt.config.certificate_model = 'LetsEncrypt::Certificate' }
it 'returns verification string when found verification path' do
open(:get, :show, verification_path: 'valid_path')
|
Move let!(:certificate) to each context
|
diff --git a/alchemy-pg_search.gemspec b/alchemy-pg_search.gemspec
index abc1234..def5678 100644
--- a/alchemy-pg_search.gemspec
+++ b/alchemy-pg_search.gemspec
@@ -13,8 +13,7 @@ spec.homepage = "http://alchemy-cms.com"
spec.license = "BSD"
- spec.files = `git ls-files`.split($/)
- spec.test_files = spec.files.grep(%r{^spec/})
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^spec/}) }
spec.require_paths = ["lib"]
spec.add_runtime_dependency "alchemy_cms", ["> 3.2", "< 4.0"]
|
Remove test files from build gem
|
diff --git a/Ruby/BuscaBinaria.rb b/Ruby/BuscaBinaria.rb
index abc1234..def5678 100644
--- a/Ruby/BuscaBinaria.rb
+++ b/Ruby/BuscaBinaria.rb
@@ -0,0 +1,24 @@+
+def BuscaBinaria(valor, vetor, esquerda, direita)
+ meio = ((esquerda+direita)/2).floor
+
+ if esquerda <= direita
+
+ if valor > vetor[meio]
+ esquerda = meio + 1
+ return BuscaBinaria(valor, vetor, esquerda, direita)
+ elsif valor < vetor[meio]
+ direita = meio - 1
+ return BuscaBinaria(valor, vetor, esquerda, direita)
+ else
+ return meio
+ end
+
+ else
+ return -1
+ end
+end
+
+
+vetor = [0, 1, 3, 5, 6, 7, 8, 9, 10, 11, 12]
+print BuscaBinaria(12, vetor, 0, vetor.length)
|
Add Busca Binária em Ruby
|
diff --git a/AutoLayoutBuilder.podspec b/AutoLayoutBuilder.podspec
index abc1234..def5678 100644
--- a/AutoLayoutBuilder.podspec
+++ b/AutoLayoutBuilder.podspec
@@ -1,6 +1,6 @@ Pod::Spec.new do |s|
s.name = "AutoLayoutBuilder"
- s.version = "0.0.3"
+ s.version = "1.0.0"
s.license = "MIT"
s.summary = "Create adaptive layouts with an expressive yet concise syntax."
s.homepage = "https://github.com/marcbaldwin/AutoLayoutBuilder"
@@ -10,7 +10,7 @@ It provides shorthand notation for creating readable, flexible layouts.
}
- s.source = { :git => "https://github.com/marcbaldwin/AutoLayoutBuilder.git", :tag => "v0.0.3" }
+ s.source = { :git => "https://github.com/marcbaldwin/AutoLayoutBuilder.git", :tag => "v1.0.0" }
s.source_files = "AutoLayout"
s.platform = :ios, '8.0'
|
Update podspec version to v1.0.0
|
diff --git a/Underscore.m.podspec b/Underscore.m.podspec
index abc1234..def5678 100644
--- a/Underscore.m.podspec
+++ b/Underscore.m.podspec
@@ -1,19 +1,14 @@ Pod::Spec.new do |s|
s.name = 'Underscore.m'
- s.version = '0.2.1'
+ s.version = '0.3.0'
s.license = 'MIT'
s.summary = 'A functional toolbelt for Objective-C.'
s.homepage = 'https://github.com/robb/Underscore.m'
s.author = { 'Robert Böhnke' => 'robb@robb.is' }
-
- s.source = { :git => 'https://github.com/robb/Underscore.m.git', :tag => '0.2.1' }
-
- s.ios.deployment_target = '5.0'
+ s.source = { :git => 'https://github.com/robb/Underscore.m.git', :tag => '0.3.0' }
+ s.ios.deployment_target = '8.0'
s.osx.deployment_target = '10.7'
-
s.description = 'Underscore.m is an Objective-C library inspired by underscore.js.'
-
s.source_files = 'Underscore/**/*.{h,m}'
-
s.requires_arc = true
end
|
Update the pod spec for new release.
|
diff --git a/src/oc-id/lib/zendesk_sso_url.rb b/src/oc-id/lib/zendesk_sso_url.rb
index abc1234..def5678 100644
--- a/src/oc-id/lib/zendesk_sso_url.rb
+++ b/src/oc-id/lib/zendesk_sso_url.rb
@@ -38,7 +38,7 @@ JWT.encode({
iat: iat,
jti: jti,
- name: user.first_name,
+ name: [user.first_name, user.last_name].join(' '),
email: user.email,
}, settings.shared_secret)
end
|
Fix logins to zendesk when user signups with a single name
When a user signs up for an account at https://manage.chef.io/signup and
only enters a single name then only the last name field is populated.
This causes an error when trying to zendesk because the name we send is
blank.
Signed-off-by: Will Fisher <392743f9dc9e2aef3201bd7129e55eb620ce557e@chef.io>
|
diff --git a/guard.gemspec b/guard.gemspec
index abc1234..def5678 100644
--- a/guard.gemspec
+++ b/guard.gemspec
@@ -16,7 +16,7 @@ s.required_ruby_version = '>= 1.9.3'
s.add_runtime_dependency 'thor', '>= 0.18.1'
- s.add_runtime_dependency 'listen', '~> 2.6'
+ s.add_runtime_dependency 'listen', '~> 2.7'
s.add_runtime_dependency 'pry', '>= 0.9.12'
s.add_runtime_dependency 'lumberjack', '~> 1.0'
s.add_runtime_dependency 'formatador', '>= 0.2.4'
|
Make minimum listen version 2.7
Because versions of listen < 2.7 have a bug where the rails console and tests stop responding to SIGINT, and this is affecting all of our projects that use guard
|
diff --git a/Formula/tokyo-dystopia.rb b/Formula/tokyo-dystopia.rb
index abc1234..def5678 100644
--- a/Formula/tokyo-dystopia.rb
+++ b/Formula/tokyo-dystopia.rb
@@ -1,14 +1,14 @@ require 'formula'
class TokyoDystopia <Formula
- url 'http://1978th.net/tokyodystopia/tokyodystopia-0.9.13.tar.gz'
+ url 'http://1978th.net/tokyodystopia/tokyodystopia-0.9.14.tar.gz'
homepage 'http://1978th.net/tokyodystopia/'
- sha1 '073b2edd6a74e2ae1bbdc7faea42a8a219bdf169'
+ sha1 '51bf7e9320ed8fc5e20a110135ea36b0305aa7a5'
depends_on 'tokyo-cabinet'
def install
- system "./configure", "--prefix=#{prefix}", "--libdir=#{lib}", "--includedir=#{include}"
+ system "./configure", "--prefix=#{prefix}"
system "make"
system "make install"
end
|
Update Tokyo Dystopia to 0.9.14
|
diff --git a/spec/chirp/runner_spec.rb b/spec/chirp/runner_spec.rb
index abc1234..def5678 100644
--- a/spec/chirp/runner_spec.rb
+++ b/spec/chirp/runner_spec.rb
@@ -29,8 +29,12 @@ %w(cpu disk memory network).each do |script_name|
it "runs a #{script_name} script" do
subject.run!
- expect($stdout.string).to match(/Spawning.*scripts\/#{script_name}"$/)
- expect($stdout.string).to match(/---> #{script_name} [\d\.]+s \(exit 0\)$/)
+ expect($stdout.string).to match(
+ %r{Spawning.*scripts\/#{script_name}"$}
+ )
+ expect($stdout.string).to match(
+ /---> #{script_name} [\d\.]+s \(exit 0\)$/
+ )
end
end
end
|
Make rubocop happy with latest spec additions
|
diff --git a/spec/models/admin_spec.rb b/spec/models/admin_spec.rb
index abc1234..def5678 100644
--- a/spec/models/admin_spec.rb
+++ b/spec/models/admin_spec.rb
@@ -2,6 +2,6 @@
RSpec.describe Admin, type: :model do
it "is invalid without a user" do
- expect(build(:parent, user_attributes: {})).not_to be_valid
+ expect(build(:admin, user_attributes: {})).not_to be_valid
end
end
|
Fix typo that caused admin model specs to fail
|
diff --git a/HATransparentView.podspec b/HATransparentView.podspec
index abc1234..def5678 100644
--- a/HATransparentView.podspec
+++ b/HATransparentView.podspec
@@ -1,9 +1,9 @@ Pod::Spec.new do |s|
s.name = "HATransparentView"
- s.version = "0.3"
+ s.version = "0.4"
s.summary = "UIView transparent subclass based on Rdio stations menu."
s.homepage = "https://github.com/hebertialmeida/HATransparentView"
- s.screenshots = "https://raw.github.com/hebertialmeida/HATransparentView/master/HATransparentViewDemo/Images.xcassets/1.png"
+ s.screenshots = "https://raw.githubusercontent.com/hebertialmeida/HATransparentView/master/HATransparentViewDemo/Images.xcassets/1.png"
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { "Heberti Almeida" => "hebertialmeida@gmail.com" }
s.source = {
|
Fix podspec and update version
|
diff --git a/ruby/product_status/product_status_common.rb b/ruby/product_status/product_status_common.rb
index abc1234..def5678 100644
--- a/ruby/product_status/product_status_common.rb
+++ b/ruby/product_status/product_status_common.rb
@@ -23,16 +23,17 @@ def print_product_status(status)
puts "Information for product #{status.product_id}:"
puts "- Title: #{status.title}"
- if status.data_quality_issues.nil?
- puts "- No data quality issues."
- return
+ puts "- Destination statuses:"
+ status.destination_statuses.each do |s|
+ puts " - Destination #{s.destination}: #{s.approval_status}"
+ puts " (currently pending)" if s.approval_pending
end
- puts "- There are #{status.data_quality_issues.length} data quality issue(s)."
- status.data_quality_issues.each do |issue|
- if issue.detail.nil?
- puts " - (#{issue.severity}) [#{issue.id}]"
- else
- puts " - (#{issue.severity}) [#{issue.id}]: #{issue.detail}"
- end
+ puts "- There are #{status.item_level_issues.length} issue(s)."
+ status.item_level_issues.each do |issue|
+ puts " - Code: #{issue.code}"
+ puts " Description: #{issue.description}"
+ puts " Detailed description: #{issue.detail}"
+ puts " Resolution: #{issue.resolution}"
+ puts " Servability: #{issue.servability}"
end
end
|
Update ProductStatuses printing for new features.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=197388670
|
diff --git a/db/migrate/20120717142400_create_external_questionnaires.rb b/db/migrate/20120717142400_create_external_questionnaires.rb
index abc1234..def5678 100644
--- a/db/migrate/20120717142400_create_external_questionnaires.rb
+++ b/db/migrate/20120717142400_create_external_questionnaires.rb
@@ -10,6 +10,6 @@ end
def self.down
- drop_table :questionnaires
+ drop_table :external_questionnaires
end
end
|
Drop the correct table when rolling back a migration
|
diff --git a/roles/web.rb b/roles/web.rb
index abc1234..def5678 100644
--- a/roles/web.rb
+++ b/roles/web.rb
@@ -18,8 +18,7 @@ },
:web => {
:status => "online",
- :database_host => "db",
- :readonly_database_host => "katla"
+ :database_host => "db"
}
)
|
Revert "Move readonly database traffic to katla"
This reverts commit e1bad7cf91c5b6ac6b435d2489b55ab86b165d9a.
|
diff --git a/Casks/fragmentarium.rb b/Casks/fragmentarium.rb
index abc1234..def5678 100644
--- a/Casks/fragmentarium.rb
+++ b/Casks/fragmentarium.rb
@@ -4,6 +4,7 @@
url "https://github.com/downloads/Syntopia/Fragmentarium/Fragmentarium%20Mac%20Binary%20v#{version}.zip"
homepage "http://syntopia.github.io/Fragmentarium/"
+ name "Fragmentarium"
license :gpl
app "Fragmentarium.app"
|
Add name to Fragmentarium cask.
|
diff --git a/Casks/lyrics-master.rb b/Casks/lyrics-master.rb
index abc1234..def5678 100644
--- a/Casks/lyrics-master.rb
+++ b/Casks/lyrics-master.rb
@@ -1,8 +1,8 @@ class LyricsMaster < Cask
- version '2.4.1'
- sha256 '773cb3996b5f946b506214a0087afebdb7f7350ac17f477cc3f31bedf2a9be0c'
+ version '2.4.2'
+ sha256 '1cd0f639ea1e557e0abef320ee8ea61877c24bab444cb573bfd41d0887605d7f'
- url 'http://www.kenichimaehashi.com/lyricsmaster/download/LyricsMaster2410.dmg'
+ url 'http://www.kenichimaehashi.com/lyricsmaster/download/LyricsMaster2420.dmg'
homepage 'http://www.kenichimaehashi.com/lyricsmaster/'
link 'Lyrics Master'
|
Upgrade Lyrics Master.app to v2.4.2
|
diff --git a/lib/build_log_parser/matchers/coverage_matcher.rb b/lib/build_log_parser/matchers/coverage_matcher.rb
index abc1234..def5678 100644
--- a/lib/build_log_parser/matchers/coverage_matcher.rb
+++ b/lib/build_log_parser/matchers/coverage_matcher.rb
@@ -27,9 +27,9 @@ def fetch_phpunit_coverage(str)
if body =~ PATTERNS[:phpunit]
{
+ coverage_percent: $1.to_f,
lines_covered: $2.to_i,
- lines_total: $3.to_i,
- coverage_percent: $1.to_f
+ lines_total: $3.to_i
}
end
end
@@ -37,9 +37,9 @@ def fetch_istanbul_coverage(str)
if body =~ PATTERNS[:istanbul]
{
+ coverage_percent: $1.to_f,
lines_covered: $2.to_i,
- lines_total: $3.to_i,
- coverage_percent: $1.to_f
+ lines_total: $3.to_i
}
end
end
|
Reorder keys in coverage metrics results
|
diff --git a/lib/html_helpers.rb b/lib/html_helpers.rb
index abc1234..def5678 100644
--- a/lib/html_helpers.rb
+++ b/lib/html_helpers.rb
@@ -35,12 +35,12 @@ end
def process_p_nodes html
- [:strip_comments!,
- :unnest!,
- :empty_ul_to_p!,
- :wrap_bare_inline_tags!,
- :get_body_nodes_without_whitespace_text,
- :filter_empty_nodes].reduce(html) { |memo, fn| send(fn, memo) }
+ [method(:strip_comments!),
+ method(:unnest!),
+ method(:empty_ul_to_p!),
+ method(:wrap_bare_inline_tags!),
+ method(:get_body_nodes_without_whitespace_text),
+ method(:filter_empty_nodes)].reduce(html) { |memo, fn| fn.call(memo) }
end
end
end
|
Use method syntax to allow lambdas if needed
|
diff --git a/lib/islay/engine.rb b/lib/islay/engine.rb
index abc1234..def5678 100644
--- a/lib/islay/engine.rb
+++ b/lib/islay/engine.rb
@@ -9,6 +9,9 @@ unless File.basename($0) == 'rake'
config.active_record.observers = :searchable_observer
end
+
+ # Remove the stupid div.field_with_errors wrapper Rails pollutes forms with.
+ ActionView::Base.field_error_proc = lambda {|tag, obj| tag}
config.generators do |g|
g.orm :active_record
|
Configure ActionView to omit the stupid .field_with_errors.
|
diff --git a/config.ru b/config.ru
index abc1234..def5678 100644
--- a/config.ru
+++ b/config.ru
@@ -1,3 +1,6 @@+Encoding.default_external = Encoding::UTF_8
+Encoding.default_internal = Encoding::UTF_8
+
require './lib/tammer_saleh'
use Rack::Static, :urls => ["/stylesheets", "/images"],
|
Make it work with pow
|
diff --git a/activesupport/lib/active_support/core_ext/module/deprecation.rb b/activesupport/lib/active_support/core_ext/module/deprecation.rb
index abc1234..def5678 100644
--- a/activesupport/lib/active_support/core_ext/module/deprecation.rb
+++ b/activesupport/lib/active_support/core_ext/module/deprecation.rb
@@ -15,7 +15,7 @@ #
# class MyLib::Deprecator
# def deprecation_warning(deprecated_method_name, message, caller_backtrace)
- # message = "#{method_name} is deprecated and will be removed from MyLibrary | #{message}"
+ # message = "#{deprecated_method_name} is deprecated and will be removed from MyLibrary | #{message}"
# Kernel.warn message
# end
# end
|
Fix documentation to the custom Deprecator
[ci skip]
|
diff --git a/Library/Contributions/examples/brew-bottle.rb b/Library/Contributions/examples/brew-bottle.rb
index abc1234..def5678 100644
--- a/Library/Contributions/examples/brew-bottle.rb
+++ b/Library/Contributions/examples/brew-bottle.rb
@@ -10,7 +10,7 @@ # Get the latest version
version = `brew list --versions #{formula}`.split.last
source = HOMEBREW_CELLAR + formula + version
- filename = formula + '-' + version + '.tar.gz'
+ filename = formula + '-' + version + '-bottle.tar.gz'
ohai "Bottling #{formula} #{version}..."
HOMEBREW_CELLAR.cd do
# Use gzip, faster to compress than bzip2, faster to uncompress than bzip2
|
Add suffix for bottles to avoid cache confusion.
|
diff --git a/app/controllers/concerns/pages_core/preview_pages_controller.rb b/app/controllers/concerns/pages_core/preview_pages_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/concerns/pages_core/preview_pages_controller.rb
+++ b/app/controllers/concerns/pages_core/preview_pages_controller.rb
@@ -11,6 +11,7 @@ def preview
redirect_to(page_url(@locale, @page)) && return unless logged_in?
+ @preview = true
@page.attributes = page_params.merge(
status: 2,
published_at: Time.zone.now,
@@ -18,6 +19,10 @@ redirect_to: nil
)
render_page
+ end
+
+ def preview?
+ @preview || false
end
private
|
Add utility method to check if we are previewing a page
|
diff --git a/Formula/android-ndk.rb b/Formula/android-ndk.rb
index abc1234..def5678 100644
--- a/Formula/android-ndk.rb
+++ b/Formula/android-ndk.rb
@@ -1,10 +1,10 @@ require 'formula'
class AndroidNdk <Formula
- url 'http://dl.google.com/android/ndk/android-ndk-r4-darwin-x86.zip'
+ url 'http://dl.google.com/android/ndk/android-ndk-r5-darwin-x86.tar.bz2'
homepage 'http://developer.android.com/sdk/ndk/index.html#overview'
- md5 'b7d5f149fecf951c05a79b045f00419f'
- version 'r4'
+ md5 '9dee8e4cb529a5619e9b8d1707478c32'
+ version 'r5'
depends_on 'android-sdk'
|
Update Android NDK to the latest r5 revision.
Signed-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com>
|
diff --git a/lib/multi_logger.rb b/lib/multi_logger.rb
index abc1234..def5678 100644
--- a/lib/multi_logger.rb
+++ b/lib/multi_logger.rb
@@ -10,7 +10,7 @@ if !path.include?('/')
path = Rails.root.join('log',path).to_s
end
- if !path[ /\.log$/ ]
+ if !path.end_with?('.log')
path += '.log'
end
|
Use end_with? instead of regular expression
|
diff --git a/config.ru b/config.ru
index abc1234..def5678 100644
--- a/config.ru
+++ b/config.ru
@@ -2,7 +2,7 @@
require 'rack-rewrite'
-DOMAIN = 'aqueousband.net'
+DOMAIN = 'www.aqueousband.net'
# Redirect to the www version of the domain in production
use Rack::Rewrite do
|
Set domain to www for now
|
diff --git a/config.ru b/config.ru
index abc1234..def5678 100644
--- a/config.ru
+++ b/config.ru
@@ -1,10 +1,9 @@ # This file is used by Rack-based servers to start the application.
if defined? Unicorn
use Raindrops::Middleware
- require 'gctools/oobgc'
- if defined?(Unicorn::HttpRequest)
- use GC::OOB::UnicornMiddleware
- end
+ require 'unicorn/oob_gc'
+ GC.disable
+ use Unicorn::OobGC, 5
require 'unicorn/worker_killer'
use Unicorn::WorkerKiller::MaxRequests, 4096, 8192
end
|
Revert "use 2.1 aware oobgc"
This reverts commit 5a7522c3580e682a324a51a87b2cbff154cf5320.
|
diff --git a/config.ru b/config.ru
index abc1234..def5678 100644
--- a/config.ru
+++ b/config.ru
@@ -7,8 +7,8 @@ unless ENV['NO_PROMETHEUS']
require 'prometheus/middleware/collector'
require 'prometheus/middleware/exporter'
- use(Prometheus::Middleware::Collector, { metrics_prefix:'runner'})
- use(Prometheus::Middleware::Exporter)
+ use Prometheus::Middleware::Collector
+ use Prometheus::Middleware::Exporter
end
require_relative 'src/externals'
|
Drop Prometheus metrics_prefix; using label app=runner in PromQL is simpler
|
diff --git a/lib/generators/rspec/templates/policy_spec.rb b/lib/generators/rspec/templates/policy_spec.rb
index abc1234..def5678 100644
--- a/lib/generators/rspec/templates/policy_spec.rb
+++ b/lib/generators/rspec/templates/policy_spec.rb
@@ -1,6 +1,6 @@ require '<%= File.exists?('spec/rails_helper.rb') ? 'rails_helper' : 'spec_helper' %>'
-describe <%= class_name %>Policy do
+RSpec.describe <%= class_name %>Policy do
let(:user) { User.new }
|
Use RSpec.describe in spec template
Fixes #311
|
diff --git a/lib/stripe_event/invoice/payment_succeeded.rb b/lib/stripe_event/invoice/payment_succeeded.rb
index abc1234..def5678 100644
--- a/lib/stripe_event/invoice/payment_succeeded.rb
+++ b/lib/stripe_event/invoice/payment_succeeded.rb
@@ -9,7 +9,12 @@
# If the event is an invoice, or has an invoice attached to it,
# then it is for a user and that user will have a subscription
- return unless invoice?
+ return unless invoice? || charge?
+
+ # if it is a charge object then we have to find the subscription
+ # through the invoice. Alternatively, we *could* override the event's
+ # data object with the corresponding invoice.
+ set_event_subscription if charge?
@user = user_for_event(@event)
@@ -23,9 +28,19 @@
private
+ def charge?
+ Stripe::Charge === @event.data.object
+ end
+
def invoice?
Stripe::Invoice === @event.data.object ||
@event.data.object.invoice.present?
+ end
+
+ def set_event_subscription
+ @event.data.object.subscription = Stripe::Invoice.retrieve(
+ @event.data.object.invoice
+ ).subscription
end
def subscription
|
Handle Stripe::Charge objects in Stripe::Invoice::PaymentSucceeded
|
diff --git a/lib/marky-markov.rb b/lib/marky-markov.rb
index abc1234..def5678 100644
--- a/lib/marky-markov.rb
+++ b/lib/marky-markov.rb
@@ -1,23 +1,66 @@ #!/usr/bin/env ruby -i
-require_relative 'marky-markov/markov-dictionary'
-require_relative 'marky-markov/two-word-dictionary'
+#A Markov Chain generator.
+
+require 'optparse'
require_relative 'marky-markov/persistent-dictionary'
-require_relative 'marky-markov/sentence-generator'
require_relative 'marky-markov/two-word-sentence-generator'
if __FILE__ == $0
- wordcount = ARGV[0] || 200
- source = ARGV[1]
+ options = {}
+ opt_parser = OptionParser.new do |opts|
+ opts.banner = "Usage: marky-markov COMMAND [OPTIONS]"
+ opts.separator ""
+ opts.separator "Commands:"
+ opts.separator " speak: Generate Markov Chain sentence (default wordcount of 200)"
+ opts.separator " read [file]: Add words to dictionary from supplied text file"
+ opts.separator ""
+ opts.separator "Options"
- if source.nil? || source == "dictionary"
- if File.exists?('dictionary')
- dict = PersistentDictionary.new('dictionary')
+ options[:dictionary] = 'dictionary'
+ opts.on('-d', '--dictionary FILE', 'Set dictionary location') do |file|
+ options[:dictionary] = file
+ end
+
+ options[:wordcount] = 200
+ opts.on('-w', '--wordcount NUMBER', 'Set number of words generated') do |number|
+ options[:wordcount] = number.to_i
+ end
+
+ options[:source] = nil
+ opts.on('-s', '--source FILE',
+ 'Generate and use temporary dictionary from source text') do |file|
+ options[:source] = file
+ end
+
+ opts.on('-h', '--help', 'Display this screen') do
+ puts opt_parser
+ exit
+ end
+ end
+
+ opt_parser.parse!
+
+ case ARGV[0]
+ when "speak"
+ if options[:source]
+ dict = TwoWordDictionary.new(options[:source])
else
- puts "No source text or dictionary supplied."
+ unless File.exists?(options[:dictionary])
+ STDERR.puts "Dictionary file #{options[:dictionary]} does not exist. Cannot generate sentence."
+ STDERR.puts "Please build a dictionary with read or use the --source option with speak."
+ exit(false)
+ end
+ dict = PersistentDictionary.new(options[:dictionary])
end
+ sentence = TwoWordSentenceGenerator.new(dict.dictionary)
+ STDOUT.puts sentence.generate(options[:wordcount])
+ when "read"
+ source = ARGV[1] || options[:source]
+ dict = PersistentDictionary.new(options[:dictionary])
+ dict.parse_source(source)
+ dict.save_dictionary!
+ STDOUT.puts "Added #{source} to dictionary."
else
- dict = TwoWordDictionary.new(source)
+ STDOUT.puts opt_parser
end
- sentence = TwoWordSentenceGenerator.new(dict.dictionary)
- puts sentence.generate(wordcount.to_i)
end
|
Use OptionParser to make command-line not horrible
|
diff --git a/lib/obix/builder.rb b/lib/obix/builder.rb
index abc1234..def5678 100644
--- a/lib/obix/builder.rb
+++ b/lib/obix/builder.rb
@@ -19,7 +19,7 @@ end
# Respond to methods matching OBIX tags.
- def method_missing method, attributes, &block
+ def method_missing method, attributes = {}, &block
klass = Objects.find method
object = klass.new &block
|
Allow building objects with no attributes
|
diff --git a/lib/phone_number.rb b/lib/phone_number.rb
index abc1234..def5678 100644
--- a/lib/phone_number.rb
+++ b/lib/phone_number.rb
@@ -1,5 +1,6 @@ class PhoneNumber < ActiveRecord::Base
- belongs_to :vcard
+ belongs_to :vcard, :class_name => 'Vcards::Vcard'
+ belongs_to :object, :polymorphic => true
def to_s
case phone_number_type
|
Fix PhoneNumber.vcard; add PhoneNumber.object association.
|
diff --git a/lib/segments/dg1.rb b/lib/segments/dg1.rb
index abc1234..def5678 100644
--- a/lib/segments/dg1.rb
+++ b/lib/segments/dg1.rb
@@ -27,7 +27,7 @@ private
def self.convert_to_ts(value) #:nodoc:
- if value.is_a?(Time) or value.is_a?(Date)
+ if value.is_a?(Time) || value.is_a?(Date)
value.to_hl7
else
value
|
Convert from "or" to "||" operator
|
diff --git a/app/inputs/array_input.rb b/app/inputs/array_input.rb
index abc1234..def5678 100644
--- a/app/inputs/array_input.rb
+++ b/app/inputs/array_input.rb
@@ -0,0 +1,19 @@+# frozen_string_literal: true
+# https://railsguides.net/simple-form-array-text-input/
+# https://tenforward.consulting/blog/integrating-an-array-column-in-rails-with-simple-form
+class ArrayInput < SimpleForm::Inputs::StringInput
+ def input(wrapper_options)
+ input_html_options[:type] ||= input_type
+ existing_values = Array(object.public_send(attribute_name)).map do |array_el|
+ @builder.text_field(nil, input_html_options.merge(value: array_el, name: "#{object_name}[#{attribute_name}][]"))
+ end
+ if existing_values.empty?
+ existing_values.push @builder.text_field(nil, input_html_options.merge(value: nil, name: "#{object_name}[#{attribute_name}][]"))
+ end
+ existing_values.join.html_safe
+ end
+
+ def input_type
+ :text
+ end
+end
|
Implement ArrayInput input type for SimpleForm
|
diff --git a/spec/integration/navigation_spec.rb b/spec/integration/navigation_spec.rb
index abc1234..def5678 100644
--- a/spec/integration/navigation_spec.rb
+++ b/spec/integration/navigation_spec.rb
@@ -2,6 +2,6 @@
describe "Dummy application" do
it "should be an application" do
- Dummy::Application.should be_a(Rails.application)
+ Rails.application.should be_a(Dummy::Application)
end
end
|
Fix spec to test in the right direction
|
diff --git a/app/models/conferences.rb b/app/models/conferences.rb
index abc1234..def5678 100644
--- a/app/models/conferences.rb
+++ b/app/models/conferences.rb
@@ -1,2 +1,8 @@-class Conferences < ActiveRecord::Base
+class Conferences
+ include Mongoid::Document
+ # room_number and pin are strings so they can accomodate leading zeroes
+ field :room_number, type: String
+ field :name, type: String
+ field :pin, type: String
+ field :account, type: String
end
|
Add field names for Conference rooms
|
diff --git a/spec/support/delayed_job_helpers.rb b/spec/support/delayed_job_helpers.rb
index abc1234..def5678 100644
--- a/spec/support/delayed_job_helpers.rb
+++ b/spec/support/delayed_job_helpers.rb
@@ -0,0 +1,8 @@+RSpec.configure do |config|
+ config.around(immediate_delayed_job_work_off: true) do |example|
+ old_dj = Delayed::Worker.delay_jobs
+ Delayed::Worker.delay_jobs = false
+ example.run
+ Delayed::Worker.delay_jobs = old_dj
+ end
+end
|
Add spec/support file to make DJ work inline
If you specify ``immediate_delayed_job_work_off: true`` in the metadata for your spec then DJ will work inline. Otherwise it will do whatever the app is configured for (which is currently not to inline perform things).
|
diff --git a/lib/vindetta/cli.rb b/lib/vindetta/cli.rb
index abc1234..def5678 100644
--- a/lib/vindetta/cli.rb
+++ b/lib/vindetta/cli.rb
@@ -26,7 +26,9 @@
exit_now!("vin is required", 1) if vin.nil? # TODO: Replace w/ I18n
- puts Vindetta::Validator.run(vin)
+ valid = Vindetta::Validator.run(vin)
+
+ puts valid ? 1 : 0
end
end
|
Validate CLI command now prints 1 or 0
|
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
@@ -6,14 +6,14 @@ before_filter :timeframe
def timeframe
- @today = Date.today.to_time.utc
+ @today = Time.zone.today
@conditions = ["created_at > :start_date and created_at <= :end_date", {
- :start_date => @today,
- :end_date => @today + 1.day
+ :start_date => @today.beginning_of_day.utc,
+ :end_date => @today.end_of_day.utc
}]
@conditions = ["created_at > :start_date and created_at <= :end_date", {
- :start_date => Time.parse(params[:start_date]).to_date.to_time.utc,
- :end_date => Time.parse(params[:end_date]).to_date.to_time.utc + 1.day
+ :start_date => Time.parse(params[:start_date]).to_date.beginning_of_day.utc,
+ :end_date => Time.parse(params[:end_date]).to_date.end_of_day.utc
}] if params[:start_date] && params[:end_date]
end
# Scrub sensitive parameters from your log
|
Use application timezone (not server timezone) for determining default time frame.
Also use beginning_of_day and end_of_day methods for setting time frame limits.
|
diff --git a/app/controllers/invitations_controller.rb b/app/controllers/invitations_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/invitations_controller.rb
+++ b/app/controllers/invitations_controller.rb
@@ -15,6 +15,9 @@ def show
redirect_to_today
@invitation = find_invitation
+ if @invitation.nil?
+ return redirect_to root_path, notice: "Invitation completed please sign in"
+ end
end
def destroy
@@ -34,8 +37,6 @@ end
def find_invitation
- Invitation.find(params[:id])
- rescue ActiveRecord::RecordNotFound
- redirect_to root_path, notice: "The invitation is not valid anymore"
+ Invitation.where(id: params[:id]).first
end
end
|
Secure up invitation finding process
|
diff --git a/lib/jsonapi/active_record_operations_processor.rb b/lib/jsonapi/active_record_operations_processor.rb
index abc1234..def5678 100644
--- a/lib/jsonapi/active_record_operations_processor.rb
+++ b/lib/jsonapi/active_record_operations_processor.rb
@@ -11,5 +11,16 @@ def rollback
raise ActiveRecord::Rollback
end
+
+ def process_operation(operation)
+ operation.apply(@context)
+ rescue ActiveRecord::DeleteRestrictionError => e
+ record_locked_error = JSONAPI::Exceptions::RecordLocked.new(e.message)
+ return JSONAPI::OperationResult.new(record_locked_error.errors[0].code, nil, record_locked_error.errors)
+
+ rescue ActiveRecord::RecordNotFound
+ record_not_found = JSONAPI::Exceptions::RecordNotFound.new(operation.associated_key)
+ return JSONAPI::OperationResult.new(record_not_found.errors[0].code, nil, record_not_found.errors)
+ end
end
end
|
Add process_operation method that catches AR exceptions
|
diff --git a/app/serializers/environment_serializer.rb b/app/serializers/environment_serializer.rb
index abc1234..def5678 100644
--- a/app/serializers/environment_serializer.rb
+++ b/app/serializers/environment_serializer.rb
@@ -1,5 +1,5 @@ class EnvironmentSerializer < BaseSerializer
- Struct.new('Item', :name, :size, :id, :latest)
+ Item = Struct.new(:name, :size, :latest)
entity EnvironmentEntity
@@ -41,11 +41,10 @@ 'COUNT(*) AS environments_count',
'MAX(id) AS last_environment_id')
- environments = resource.where(id: items.map(&:last))
- .order('COALESCE(environment_type, name) ASC')
+ environments = resource.where(id: items.map(&:last)).index_by(&:id)
- items.zip(environments).map do |item|
- Struct::Item.new(*item.flatten)
+ items.map do |name, size, id|
+ Item.new(name, size, environments[id])
end
end
end
|
Simplify implementation of environments serializer
|
diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/sessions_controller.rb
+++ b/app/controllers/sessions_controller.rb
@@ -0,0 +1,25 @@+get '/login' do
+ @user = User.new
+ erb :'/login'
+end
+
+post '/login' do
+ @user = User.find_by(email: params[:user][:email])
+ if @user && @user.password == params[:user][:password]
+ session[:user_id] = @user.id
+ redirect '/'
+ else
+ @user = User.new(params[:user])
+ if @user.save
+ session[:user_id] = @user.id
+ redirect '/'
+ else
+ @errors = @user.errors.full_messages
+ erb :'/login'
+ end
+ end
+end
+
+get '/logout' do
+ redirect '/'
+end
|
Add basic login routes to sessions controller
|
diff --git a/app/controllers/stations_controller.rb b/app/controllers/stations_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/stations_controller.rb
+++ b/app/controllers/stations_controller.rb
@@ -39,8 +39,13 @@ def fillfile
uploaded_file = params[:file]
file_content = uploaded_file.read
- puts file_content
+ # puts file_content
+ t1 = Time.now
process_fill(file_content)
+ t2 = Time.now
+ te = t2 - t1
+ puts "PROCESS FILE TIME"
+ puts te
redirect_to popfile_url
end
|
Add profiling to stations adding
|
diff --git a/lyb_sidebar.gemspec b/lyb_sidebar.gemspec
index abc1234..def5678 100644
--- a/lyb_sidebar.gemspec
+++ b/lyb_sidebar.gemspec
@@ -6,6 +6,6 @@ s.authors = ["Simon Hürlimann (CyT)"]
s.email = ["simon.huerlimann@cyt.ch"]
s.description = "LybSidebar simplifies dries up common sidebar code."
- s.files = Dir["lib/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"]
+ s.files = Dir["{app,lib,config}/**/*"] + ["MIT-LICENSE", "Rakefile", "Gemfile", "README.rdoc"]
s.version = "0.1.0"
end
|
Update gemspec as it would be generated by enginex nowadays.
|
diff --git a/configs.rb b/configs.rb
index abc1234..def5678 100644
--- a/configs.rb
+++ b/configs.rb
@@ -8,7 +8,7 @@ PAAS_VENDOR_FOLDER = "vendor/cloudcontrol"
LIBYAML_VERSION = "0.1.4"
LIBYAML_PATH = "libyaml-#{LIBYAML_VERSION}"
- BUNDLER_VERSION = "1.7.13"
+ BUNDLER_VERSION = "1.9.9"
BUNDLER_GEM_PATH = "bundler-#{BUNDLER_VERSION}"
NODE_VERSION = "0.4.7"
NODE_JS_BINARY_PATH = "node-#{NODE_VERSION}"
|
Update bundler (1.7.13 -> 1.9.9)
|
diff --git a/Casks/prolific-usb-serial-driver.rb b/Casks/prolific-usb-serial-driver.rb
index abc1234..def5678 100644
--- a/Casks/prolific-usb-serial-driver.rb
+++ b/Casks/prolific-usb-serial-driver.rb
@@ -0,0 +1,9 @@+class ProlificUsbSerialDriver < Cask
+ url 'http://pbxbook.com/other/sw/PL2303_MacOSX_v1_5_1.zip'
+ homepage 'http://pbxbook.com/other/mac-tty.html'
+ version '1.5.1'
+ sha1 'e251e2a3da821d8ed8124e78181a78e5f57dc046'
+ install 'PL2303_MacOSX-10_6up_v1_5_1/PL2303_MacOSX_v1.5.1.pkg'
+ uninstall :pkgutil => 'com.prolific.prolificUsbserialCableDriverV151.ProlificUsbSerial.pkg',
+ :kext => 'com.prolific.driver.PL2303'
+end
|
Add Prolific USB Serial Cable Driver 1.5.1 Cask
|
diff --git a/split-api.gemspec b/split-api.gemspec
index abc1234..def5678 100644
--- a/split-api.gemspec
+++ b/split-api.gemspec
@@ -20,7 +20,7 @@ gem.add_dependency 'multi_json'
gem.add_development_dependency 'bundler'
- gem.add_development_dependency 'rspec', '~> 3.8.0'
+ gem.add_development_dependency 'rspec', '~> 3.9.0'
gem.add_development_dependency 'rack-test', '~> 1.1'
gem.add_development_dependency 'rake', '~> 13.0'
end
|
Update rspec requirement from ~> 3.8.0 to ~> 3.9.0
Updates the requirements on [rspec](https://github.com/rspec/rspec) to permit the latest version.
- [Release notes](https://github.com/rspec/rspec/releases)
- [Commits](https://github.com/rspec/rspec/compare/v3.8.0...v3.9.0)
Signed-off-by: dependabot-preview[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com>
|
diff --git a/templates/mongoid/features/step_definitions/mongoid_steps.rb b/templates/mongoid/features/step_definitions/mongoid_steps.rb
index abc1234..def5678 100644
--- a/templates/mongoid/features/step_definitions/mongoid_steps.rb
+++ b/templates/mongoid/features/step_definitions/mongoid_steps.rb
@@ -1,3 +1,3 @@-Given /^an (.+) exists with an? "([^"]*)" of "([^"]*)"$/ do |model, field, value|
+Given /^an (.+) exists with an? (.+) of "([^"]*)"$/ do |model, field, value|
Factory model, field => value
end
|
Change mongoid step_definition to match thoughtbot version
|
diff --git a/app/importers/file_importers/student_section_assignments_importer.rb b/app/importers/file_importers/student_section_assignments_importer.rb
index abc1234..def5678 100644
--- a/app/importers/file_importers/student_section_assignments_importer.rb
+++ b/app/importers/file_importers/student_section_assignments_importer.rb
@@ -39,12 +39,11 @@ end
def delete_rows
- #Delete all stale rows no longer included in the import
- #For the schools imported during this run of the importer
+ # Delete all stale rows no longer included in the import
+ # For the schools imported during this run of the importer
StudentSectionAssignment.joins(:section => {:course => :school})
.where.not(id: @imported_assignments)
.where(:schools => {:local_id => @school_scope}).delete_all
-
end
def import_row(row)
|
Use instance variable for school_scope
|
diff --git a/app/helpers/forem/formatting_helper.rb b/app/helpers/forem/formatting_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/forem/formatting_helper.rb
+++ b/app/helpers/forem/formatting_helper.rb
@@ -2,7 +2,7 @@ module FormattingHelper
# override with desired markup formatter, e.g. textile or markdown
def as_formatted_html(text)
- raw('<pre>')+h(text)+raw('</pre>')
+ h(text)
end
end
end
|
Remove pre from as_formatted_html method
|
diff --git a/slop.gemspec b/slop.gemspec
index abc1234..def5678 100644
--- a/slop.gemspec
+++ b/slop.gemspec
@@ -1,6 +1,6 @@ Gem::Specification.new do |s|
s.name = 'slop'
- s.version = '3.0.0-rc1'
+ s.version = '2.4.2'
s.summary = 'Option gathering made easy'
s.description = 'A simple DSL for gathering options and parsing the command line'
s.author = 'Lee Jarvis'
|
Revert "bump gemspec version to 3.0.0-rc1"
This reverts commit dfaf8150a4ab935a4f77db967f35285b73b35607.
|
diff --git a/test/integration/get_gem_test.rb b/test/integration/get_gem_test.rb
index abc1234..def5678 100644
--- a/test/integration/get_gem_test.rb
+++ b/test/integration/get_gem_test.rb
@@ -9,10 +9,13 @@ assert last_response.ok?
assert_equal 'application/octet-stream', content_type
- source_file = File.expand_path(
+ gem_path = File.expand_path(
'../../fixtures/gems/cache/rack-1.5.0.gem', __FILE__)
- expected = File.read source_file
- assert expected == last_response.body, "response does not match #{source_file} content"
+
+ File.open(gem_path, "rb") do |f|
+ assert last_response.body == f.read,
+ "response does not match #{gem_path} content"
+ end
end
def test_raises_when_no_gem
|
Fix test: open .gem file in binary mode
|
diff --git a/Casks/omnioutliner-beta.rb b/Casks/omnioutliner-beta.rb
index abc1234..def5678 100644
--- a/Casks/omnioutliner-beta.rb
+++ b/Casks/omnioutliner-beta.rb
@@ -1,6 +1,6 @@ cask 'omnioutliner-beta' do
- version '4.4.x-r250030'
- sha256 '2b8c51ef4d5321b7701858264ea5f0da8358281259d8a1c94d1ac0d55792ba7e'
+ version '4.4.x-r251827'
+ sha256 'c2be9c83f1009b6407aea2b6b35da8210b8545a5acfe7aafe0853082b414d056'
url "http://omnistaging.omnigroup.com/omnioutliner-4/releases/OmniOutliner-#{version}-Test.dmg"
name 'OmniOutliner'
|
Update Omnioutliner Beta to build 4.4.x-r251827
This commit updates the version and sha256 tokens.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.