diff stringlengths 65 26.7k | message stringlengths 7 9.92k |
|---|---|
diff --git a/spec/libraries/prometheus_spec.rb b/spec/libraries/prometheus_spec.rb
index abc1234..def5678 100644
--- a/spec/libraries/prometheus_spec.rb
+++ b/spec/libraries/prometheus_spec.rb
@@ -2,7 +2,7 @@
describe Prometheus do
it 'should return a list of known services' do
- expect(Prometheus.services).to eq(%w(
+ expect(Prometheus.services).to match_array(%w(
prometheus
node-exporter
redis-exporter
| Fix array order handling in prometheus spec
|
diff --git a/app/controllers/requests_controller.rb b/app/controllers/requests_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/requests_controller.rb
+++ b/app/controllers/requests_controller.rb
@@ -1,6 +1,4 @@ class RequestsController < UserActionsController
- before_action :require_login
-
def index
@requests = Request.all
end
@@ -50,12 +48,4 @@ def request_attributes
params.require(:request).permit(:content)
end
-
- def require_login
- unless logged_in?
- flash[:error] = 'Please log in to be a good neighbor!'
- redirect_to login_path
- end
- end
-
end
| Remove logged_in requirements from the Requests Controller.
These requirements are now handled by the User Actions controller.
|
diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/services_controller.rb
+++ b/app/controllers/services_controller.rb
@@ -1,7 +1,6 @@ # frozen_string_literal: true
class ServicesController < ApplicationController
- skip_before_action :verify_authenticity_token, only: :create
before_action :authenticate_user!
def index
| Remove token validation skip in ServicesController
|
diff --git a/recipes/install_plugins.rb b/recipes/install_plugins.rb
index abc1234..def5678 100644
--- a/recipes/install_plugins.rb
+++ b/recipes/install_plugins.rb
@@ -21,6 +21,7 @@ vagrant_plugin plugin['name'] do
user node['vagrant']['user']
version plugin['version']
+ source plugin['source']
end
else
| Support installing plugin from custom source |
diff --git a/app/models/species/documents_export.rb b/app/models/species/documents_export.rb
index abc1234..def5678 100644
--- a/app/models/species/documents_export.rb
+++ b/app/models/species/documents_export.rb
@@ -31,9 +31,7 @@ :proposal_outcome,
:review_phase,
:taxon_names,
- :taxon_concept_ids,
:geo_entity_names,
- :geo_entity_ids,
"to_char(created_at, 'DD/MM/YYYY')",
:created_by,
"to_char(updated_at, 'DD/MM/YYYY')",
@@ -56,9 +54,7 @@ 'Proposal outcome',
'Review phase',
'Taxon names',
- 'Taxon concept IDs',
'Geo entity names',
- 'Geo entity ids',
'Created at',
'Created by',
'Updated at',
| Remove obsolete taxon_concept and geo_entity ids from export
|
diff --git a/app/queries/user_last_answers_query.rb b/app/queries/user_last_answers_query.rb
index abc1234..def5678 100644
--- a/app/queries/user_last_answers_query.rb
+++ b/app/queries/user_last_answers_query.rb
@@ -8,6 +8,6 @@ def call
Answer.where(user: @user)
.order(created_at: :desc)
- .last(ANSWERS_NUMBER)
+ .limit(ANSWERS_NUMBER)
end
end
| Fix query of user recent answers
|
diff --git a/lib/versions.rb b/lib/versions.rb
index abc1234..def5678 100644
--- a/lib/versions.rb
+++ b/lib/versions.rb
@@ -9,7 +9,9 @@ module Helpers
def current_version
- @current_version = JSON.parse(open('https://raw.githubusercontent.com/emberjs/guides.emberjs.com/master/snapshots/versions.json').read).last
+ versions = JSON.parse(open('https://raw.githubusercontent.com/emberjs/guides.emberjs.com/master/snapshots/versions.json').read)
+ versions.sort_by! { |version| Gem::Version.new(version[1..-1]) }
+ @current_version = versions.last
end
end
end
| Fix linking to incorrect version of quick start guide
|
diff --git a/test/test-remote.rb b/test/test-remote.rb
index abc1234..def5678 100644
--- a/test/test-remote.rb
+++ b/test/test-remote.rb
@@ -0,0 +1,14 @@+#!/usr/bin/env ruby
+require 'test/unit'
+require 'socket'
+
+# Test Debugger.start_remote, Debugger.cmd_port and Debugger.ctrl_port
+class TestRemote < Test::Unit::TestCase
+ def test_remote
+ Debugger.start_remote('127.0.0.1', [0, 0])
+ assert_block { Debugger.ctrl_port > 0 }
+ assert_block { Debugger.cmd_port > 0 }
+ assert_nothing_raised { TCPSocket.new('127.0.0.1', Debugger.ctrl_port).close }
+ assert_nothing_raised { TCPSocket.new('127.0.0.1', Debugger.cmd_port).close }
+ end
+end
| Add unit tests for Debugger.ctrl_port/cmd_port.
|
diff --git a/rspec-power_assert.gemspec b/rspec-power_assert.gemspec
index abc1234..def5678 100644
--- a/rspec-power_assert.gemspec
+++ b/rspec-power_assert.gemspec
@@ -18,7 +18,7 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]
- spec.add_runtime_dependency "power_assert", ">= 0.1.4"
+ spec.add_runtime_dependency "power_assert", "~> 0.1.4"
spec.add_runtime_dependency "rspec", ">= 2.14"
spec.add_development_dependency "bundler", "~> 1.7"
| Add version constraint for power_assert API changes
|
diff --git a/validates_email_format_of.gemspec b/validates_email_format_of.gemspec
index abc1234..def5678 100644
--- a/validates_email_format_of.gemspec
+++ b/validates_email_format_of.gemspec
@@ -1,13 +1,11 @@-require 'rake'
-
spec = Gem::Specification.new do |s|
s.name = 'validates_email_format_of'
s.version = '1.4.5'
s.summary = 'Validate e-mail addresses against RFC 2822 and RFC 3696.'
s.description = s.summary
s.extra_rdoc_files = ['README.rdoc', 'CHANGELOG.rdoc', 'MIT-LICENSE']
- s.test_files = FileList['test/**/*.rb', 'test/**/*.yml'].to_a
- s.files = FileList['MIT-LICENSE', '*.rb', '*.rdoc', 'lib/**/*.rb', 'test/**/*.rb', 'test/**/*.yml'].to_a
+ s.test_files = Dir['test/**/*.rb', 'test/**/*.yml']
+ s.files = Dir['MIT-LICENSE', '*.rb', '*.rdoc', 'lib/**/*.rb', 'test/**/*.rb', 'test/**/*.yml']
s.require_path = 'lib'
s.has_rdoc = true
s.rdoc_options << '--title' << 'validates_email_format_of'
| Fix RVM/Bundler/Capistrano errors by not requiring rake from gemspec.
Use Dir[] instead of Rake FileList[].
Before I made this change, I got errors like
** [out :: example.com] There was a LoadError while evaluating
validates_email_format_of.gemspec:
** [out :: example.com] no such file to load -- rake from
** [out :: example.com]
/srv/www/example.com/shared/bundle/ruby/1.8/bundler/gems/validates_email_format_of-c060fc482552/validates_email_format_of.gemspec:1
trying to deploy a Rails 3 app with RVM, Bundler and Capistrano. See
http://pastie.org/private/0w9hejawalrlgxshopreq for more on that error.
|
diff --git a/spec/unit/veritas/relation/keys/class_methods/new_spec.rb b/spec/unit/veritas/relation/keys/class_methods/new_spec.rb
index abc1234..def5678 100644
--- a/spec/unit/veritas/relation/keys/class_methods/new_spec.rb
+++ b/spec/unit/veritas/relation/keys/class_methods/new_spec.rb
@@ -23,6 +23,11 @@ it { should be_instance_of(object) }
it { should == argument }
+
+ it 'does not freeze the argument' do
+ argument.should_not be_frozen
+ expect { subject }.to_not change(argument, :frozen?)
+ end
end
context 'with an argument that responds to #to_ary and contains reducible keys' do
| Fix Keys.new spec to kill mutation
|
diff --git a/YapImageManager.podspec b/YapImageManager.podspec
index abc1234..def5678 100644
--- a/YapImageManager.podspec
+++ b/YapImageManager.podspec
@@ -8,6 +8,7 @@ s.source = { :git => 'git@github.com:yapstudios/YapImageManager.git' }
s.ios.deployment_target = '9.0'
+ s.tvos.deployment_target = '10.0'
s.source_files = 'Source/**/*.{swift,h,m}'
s.exclude_files = 'Source/YapImageSessionManager.swift'
| Update podspec to include tvOS
|
diff --git a/db/migrate/20161018052944_create_shifts.rb b/db/migrate/20161018052944_create_shifts.rb
index abc1234..def5678 100644
--- a/db/migrate/20161018052944_create_shifts.rb
+++ b/db/migrate/20161018052944_create_shifts.rb
@@ -2,7 +2,7 @@ def change
create_table :shifts do |t|
t.integer :start_mileage
- t.string :end_mileage
+ t.integer :end_mileage
t.datetime :date
t.decimal :earnings
t.references :user
| Change end mileage in shift model to integer
|
diff --git a/lib/miniphonic/response.rb b/lib/miniphonic/response.rb
index abc1234..def5678 100644
--- a/lib/miniphonic/response.rb
+++ b/lib/miniphonic/response.rb
@@ -4,20 +4,14 @@ module Miniphonic
class Response
extend Forwardable
- attr_reader :response
+ attr_reader :response, :body, :data
def initialize(response)
@response = response
+ @body = MultiJson.load(@response.body)
+ @data = @body["data"]
end
- def body
- @body ||= MultiJson.load(@response.body)
- end
-
- def data
- @data ||= @body["data"]
- end
-
- def_delegators @response, :status, :success?
+ def_delegators :@response, :status, :success?
end
end | Refactor Response to actually work
|
diff --git a/lib/browserify_pipeline/transformer/babel.rb b/lib/browserify_pipeline/transformer/babel.rb
index abc1234..def5678 100644
--- a/lib/browserify_pipeline/transformer/babel.rb
+++ b/lib/browserify_pipeline/transformer/babel.rb
@@ -5,7 +5,7 @@ class Babel < Base
def initialize(command_line_options = '--extensions .browserify --extensions .js')
- super('babel', command_line_options)
+ super('babelify', command_line_options)
end
end
| Use correct command for Babel.
|
diff --git a/lib/tasks/application.rake b/lib/tasks/application.rake
index abc1234..def5678 100644
--- a/lib/tasks/application.rake
+++ b/lib/tasks/application.rake
@@ -10,8 +10,3 @@ CampaignFinisherWorker.perform_async(project.id)
end
end
-
-desc 'Move to deleted state all contributions that are in pending for one hour'
-task :move_pending_contributions_to_trash => [:environment] do
- Contribution.where("state in('pending') and created_at + interval '1 hour' < ?", Time.current).update_all({state: 'deleted'})
-end
| Remove unnecessary rake task move_pending_contributions_to_trash
|
diff --git a/lib/withings-api/tokens.rb b/lib/withings-api/tokens.rb
index abc1234..def5678 100644
--- a/lib/withings-api/tokens.rb
+++ b/lib/withings-api/tokens.rb
@@ -18,6 +18,10 @@ end
end
+ def to_a
+ [key, secret]
+ end
+
end
class RequestToken < ConsumerToken
| Update create_request_token to take either [key,secret,url] or [token obj, url]
|
diff --git a/tasks/parallel_tests.rake b/tasks/parallel_tests.rake
index abc1234..def5678 100644
--- a/tasks/parallel_tests.rake
+++ b/tasks/parallel_tests.rake
@@ -2,14 +2,14 @@ require_relative "application_generator"
desc "Run the full suite using parallel_tests to run on multiple cores"
-task parallel_tests: ['parallel:setup_parallel_tests', 'parallel:spec', 'parallel:cucumber', 'cucumber:class_reloading']
+task parallel_tests: [:setup_parallel_tests, 'parallel:spec', 'parallel:cucumber', 'cucumber:class_reloading']
+
+desc "Setup parallel_tests DBs"
+task :setup_parallel_tests do
+ ActiveAdmin::ApplicationGenerator.new(parallel: true).generate
+end
namespace :parallel do
-
- desc "Setup parallel_tests DBs"
- task :setup_parallel_tests do
- ActiveAdmin::ApplicationGenerator.new(parallel: true).generate
- end
desc "Run the specs in parallel"
task :spec do
| Move parallel setup out of the parallel namespace
For consistency with the regular test tasks.
|
diff --git a/spec/ruby/library/drb/stop_service_spec.rb b/spec/ruby/library/drb/stop_service_spec.rb
index abc1234..def5678 100644
--- a/spec/ruby/library/drb/stop_service_spec.rb
+++ b/spec/ruby/library/drb/stop_service_spec.rb
@@ -1,4 +1,6 @@ require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/test_server', __FILE__)
+require 'drb'
describe "DRb.stop_service" do
before :all do
| Add missing includes for DRb.stop_service spec
|
diff --git a/Casks/intellij-idea-bundled-jdk.rb b/Casks/intellij-idea-bundled-jdk.rb
index abc1234..def5678 100644
--- a/Casks/intellij-idea-bundled-jdk.rb
+++ b/Casks/intellij-idea-bundled-jdk.rb
@@ -1,8 +1,8 @@ cask :v1 => 'intellij-idea-bundled-jdk' do
- version '14.0.2'
- sha256 'a53d9cf8e998e2a9e0f3ff023356971d3e56ea80cf4384fce3523c147771af1e'
+ version '14.1'
+ sha256 'd975cd7b648ccd433e8ee0d5fc616cdf1aa48e80b6ef821a299051ab6664ccce'
- url "http://download.jetbrains.com/idea/ideaIU-#{version}-jdk-bundled.dmg"
+ url "https://download.jetbrains.com/idea/ideaIU-#{version}-custom-jdk-bundled.dmg"
name 'IntelliJ IDEA'
homepage 'https://www.jetbrains.com/idea/'
license :commercial
@@ -10,7 +10,10 @@ app 'IntelliJ IDEA 14.app'
zap :delete => [
+ '~/Library/Preferences/com.jetbrains.intellij.plist',
+ '~/Library/Preferences/IntelliJIdea14',
'~/Library/Application Support/IntelliJIdea14',
- '~/Library/Preferences/IntelliJIdea14',
+ '~/Library/Caches/IntelliJIdea14',
+ '~/Library/Logs/IntelliJIdea14',
]
end
| Upgrade IntelliJ Idea with bundled JDK to 14.1
- Unify with other IntelliJ-based formulas (see #879)
|
diff --git a/core/app/models/spree/payment_method.rb b/core/app/models/spree/payment_method.rb
index abc1234..def5678 100644
--- a/core/app/models/spree/payment_method.rb
+++ b/core/app/models/spree/payment_method.rb
@@ -4,6 +4,8 @@ default_scope where(:deleted_at => nil)
scope :production, where(:environment => 'production')
+
+ attr_accessible :name, :description, :environment, :display_on, :active
def self.providers
Rails.application.config.spree.payment_methods
| Make name, description, environment, display_on and active mass-assignable for payment method
|
diff --git a/misc/copy_boost_headers.rb b/misc/copy_boost_headers.rb
index abc1234..def5678 100644
--- a/misc/copy_boost_headers.rb
+++ b/misc/copy_boost_headers.rb
@@ -0,0 +1,48 @@+#!/usr/bin/env ruby
+PROGRAM_SOURCE = %q{
+ #include <boost/shared_ptr.hpp>
+ #include <boost/thread.hpp>
+ #include <boost/function.hpp>
+ #include <boost/bind.hpp>
+}
+
+boost_dir = ARGV[0]
+Dir.chdir(File.dirname(__FILE__) + "/../ext")
+File.open("test.cpp", "w") do |f|
+ f.write(PROGRAM_SOURCE)
+end
+
+def sh(*command)
+ puts command.join(" ")
+ if !system(*command)
+ puts "*** ERROR"
+ exit 1
+ end
+end
+
+done = false
+while !done
+ missing_headers = `g++ test.cpp -c -I. 2>&1`.
+ split("\n").
+ grep(/error: .*: No such file/).
+ map do |line|
+ file = line.sub(/.*error: (.*): .*/, '\1')
+ if file =~ /^boost\//
+ file
+ else
+ line =~ /(.*?):/
+ source = $1
+ File.dirname(source) + "/" + file
+ end
+ end
+ missing_headers.each do |header|
+ command = ["install", "-D", "--mode=u+rw,g+r,o+r", "#{boost_dir}/#{header}", header]
+ sh(*command)
+ end
+ done = missing_headers.empty?
+end
+
+sh "cp -R #{boost_dir}/boost/config/* boost/config/"
+sh "cp -R #{boost_dir}/boost/detail/sp_counted_* boost/detail/"
+sh "cp -R #{boost_dir}/boost/detail/atomic_count* boost/detail/"
+sh "mkdir -p boost/src && cp -R #{boost_dir}/libs/thread/src/* boost/src/"
| Add a script for automatically vendoring required parts of Boost.
|
diff --git a/test/features/gob_digital_user_can_manage_schemas_test.rb b/test/features/gob_digital_user_can_manage_schemas_test.rb
index abc1234..def5678 100644
--- a/test/features/gob_digital_user_can_manage_schemas_test.rb
+++ b/test/features/gob_digital_user_can_manage_schemas_test.rb
@@ -1,9 +1,49 @@ require "test_helper"
+require_relative 'support/ui_test_helper'
class GobDigitalUserCanManageSchemasTest < Capybara::Rails::TestCase
- # test "sanity" do
- # visit root_path
- # assert_content page, "Hello World"
- # refute_content page, "Goodbye All!"
- # end
+ include UITestHelper
+ include Warden::Test::Helpers
+ after { Warden.test_reset! }
+
+ test "Loged User can_create_schema can see Nuevo Esquema button " do
+ visit root_path
+ login_as users(:pedro), scope: :user
+ visit root_path
+ find('#user-menu').click
+ assert_no_link 'menu-new-schema'
+
+ login_as users(:pablito), scope: :user
+ visit root_path
+ find('#user-menu').click
+ assert_link 'menu-new-schema'
+ end
+
+ test "Loged User can_create_schema can see Nueva Version button" do
+ visit root_path
+ click_link 'Esquemas'
+ assert_text 'Directorio de Esquemas'
+ click_schema_category schema_categories(:zonas).name
+ assert_text schemas(:zona1).name
+ click_link schemas(:zona1).name
+
+ within ".container-schema-detail" do
+ assert_selector 'h1', text: schemas(:zona1).name
+ end
+ assert_no_link "Nueva Versión"
+
+ login_as users(:pablito), scope: :user
+ visit root_path
+ click_link 'Esquemas'
+ assert_text 'Directorio de Esquemas'
+ click_schema_category schema_categories(:zonas).name
+ assert_text schemas(:zona1).name
+ click_link schemas(:zona1).name
+
+ within ".container-schema-detail" do
+ assert_selector 'h1', text: schemas(:zona1).name
+ end
+ assert_link "Nueva Versión"
+ end
+
end
| Add functional test for GobDigital User
|
diff --git a/spec/unit/converters/convert_file_spec.rb b/spec/unit/converters/convert_file_spec.rb
index abc1234..def5678 100644
--- a/spec/unit/converters/convert_file_spec.rb
+++ b/spec/unit/converters/convert_file_spec.rb
@@ -1,10 +1,11 @@ # encoding: utf-8
-
-require 'fileutils'
RSpec.describe TTY::Prompt::Question, 'convert file' do
it "converts to file" do
- ::File.write('test.txt', 'foobar')
+ file = ::File.open('test.txt', 'w')
+ file.write('foobar')
+ file.close
+
prompt = TTY::TestPrompt.new
prompt.input << "test.txt"
prompt.input.rewind
@@ -14,6 +15,6 @@ expect(::File.basename(answer)).to eq('test.txt')
expect(::File.read(answer)).to eq('foobar')
- FileUtils.rm(::File.join(Dir.pwd, 'test.txt'))
+ ::File.delete(file)
end
end
| Change to fix windows file deletion
|
diff --git a/app/models/retrieval.rb b/app/models/retrieval.rb
index abc1234..def5678 100644
--- a/app/models/retrieval.rb
+++ b/app/models/retrieval.rb
@@ -2,7 +2,7 @@ belongs_to :user
store :jsondata, coder: JSON
- after_save :update_access_configurations
+ #after_save :update_access_configurations
obfuscate_id spin: 53465485
| EDSC-135: Remove after save hook to observe its impact on CI
|
diff --git a/test/models/image_test.rb b/test/models/image_test.rb
index abc1234..def5678 100644
--- a/test/models/image_test.rb
+++ b/test/models/image_test.rb
@@ -1,6 +1,7 @@ # Encoding: utf-8
require 'test_helper'
+# Test image model
class ImageTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
| Add class header to image model test
|
diff --git a/lib/ember/es6_template/sprockets2/es6module.rb b/lib/ember/es6_template/sprockets2/es6module.rb
index abc1234..def5678 100644
--- a/lib/ember/es6_template/sprockets2/es6module.rb
+++ b/lib/ember/es6_template/sprockets2/es6module.rb
@@ -14,7 +14,7 @@ 'modules' => 'amdStrict',
'moduleIds' => true,
'sourceRoot' => env.root,
- 'moduleRoot' => '',
+ 'moduleRoot' => nil,
'filename' => module_name(scope.logical_path)
)
| Fix sprockets2 and babel 5.8.10
This is the same fix as d23e0d54a.
|
diff --git a/app/controllers/api/v1/webhooks/optix_controller.rb b/app/controllers/api/v1/webhooks/optix_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/api/v1/webhooks/optix_controller.rb
+++ b/app/controllers/api/v1/webhooks/optix_controller.rb
@@ -2,6 +2,7 @@ module V1
module Webhooks
class OptixController < ApplicationController
+ # https://developer.optixapp.com/using-webhooks/webhooks-list/
def create
json = JSON.parse(request.raw_post)
| Add a link to some docs
|
diff --git a/app/models/user/verification/census_verification.rb b/app/models/user/verification/census_verification.rb
index abc1234..def5678 100644
--- a/app/models/user/verification/census_verification.rb
+++ b/app/models/user/verification/census_verification.rb
@@ -1,8 +1,14 @@ class User::Verification::CensusVerification < User::Verification
default_scope -> { where(verification_type: "census") }
+ attr_writer :census_repository_class, :custom_params
+
def verification_type
"census"
+ end
+
+ def census_repository_class
+ @census_repository_class ||= CensusRepository
end
def document_number
@@ -37,13 +43,19 @@ end
end
+ def custom_params
+ @custom_params ||= {}
+ end
+
private
def census_repository
- @census_repository ||= CensusRepository.new(
- site_id: site_id,
- document_number: document_number,
- date_of_birth: date_of_birth
+ @census_repository ||= census_repository_class.new(
+ custom_params.merge(
+ site_id: site_id,
+ document_number: document_number,
+ date_of_birth: date_of_birth
+ )
)
end
end
| Allow User::Verification::CensusVerification instanciate using custom census_repositories wit custom parameters
|
diff --git a/test/unit/cache/source.rb b/test/unit/cache/source.rb
index abc1234..def5678 100644
--- a/test/unit/cache/source.rb
+++ b/test/unit/cache/source.rb
@@ -9,8 +9,10 @@
def setup
PictureTag.stubs(:site).returns(build_site_stub)
+ end
- @tested = Cache::Source.new('img.jpg')
+ def tested(name = 'img.jpg')
+ @tested ||= Cache::Source.new(name)
end
def teardown
@@ -19,36 +21,46 @@
# Initialize empty
def test_initialize_empty
- assert_nil @tested[:width]
+ assert_nil tested[:width]
end
# Store data
def test_data_store
- @tested[:width] = 100
+ tested[:width] = 100
- assert @tested[:width] = 100
+ assert tested[:width] = 100
end
# Reject bad key
def test_reject_bad_key
assert_raises ArgumentError do
- @tested[:asdf] = 100
+ tested[:asdf] = 100
end
end
# Write data
def test_write_data
- @tested[:width] = 100
- @tested.write
+ tested[:width] = 100
+ tested.write
assert File.exist? '/tmp/jpt/cache/img.jpg.json'
end
# Retrieve data
def test_retrieve_data
- @tested[:width] = 100
- @tested.write
+ tested[:width] = 100
+ tested.write
assert_equal Cache::Source.new('img.jpg')[:width], 100
end
+
+ # Handles filenames with directories in them
+ def test_subdirectory_name
+ tested('somedir/img.jpg.json')
+ tested[:width] = 100
+ tested[:height] = 100
+ tested.write
+
+ assert File.exist? '/tmp/jpt/cache/somedir/img.jpg.json'
+ end
end
| Refactor cache tests, add subdirectory test
|
diff --git a/spec/normalization_spec.rb b/spec/normalization_spec.rb
index abc1234..def5678 100644
--- a/spec/normalization_spec.rb
+++ b/spec/normalization_spec.rb
@@ -16,6 +16,10 @@ ICU::Normalization.normalize("Å", :nfc).unpack("U*").should == [197]
end
+ it "should normalize accents" do
+ ICU::Normalization.normalize("âêîôû", :nfc).should == "aeiou"
+ end
+
# TODO: add more normalization tests
| Add failing spec for normalization
|
diff --git a/spec/requests/home_spec.rb b/spec/requests/home_spec.rb
index abc1234..def5678 100644
--- a/spec/requests/home_spec.rb
+++ b/spec/requests/home_spec.rb
@@ -24,10 +24,10 @@
it "should be ordered by most recent activity first" do
visit home_path
- within("ul.threads li:first") do
+ within("ul.thread-list li:first") do
page.should have_content(threads.last.title)
end
- within("ul.threads li:last") do
+ within("ul.thread-list li:last") do
page.should have_content(threads[1].title)
end
end
| Update css selector for new thread list css.
|
diff --git a/audited.gemspec b/audited.gemspec
index abc1234..def5678 100644
--- a/audited.gemspec
+++ b/audited.gemspec
@@ -10,6 +10,7 @@ gem.summary = gem.description
gem.homepage = 'https://github.com/collectiveidea/audited'
+ gem.add_development_dependency 'activerecord', '~> 3.0'
gem.add_development_dependency 'appraisal', '~> 0.4'
gem.add_development_dependency 'bson_ext', '~> 1.6'
gem.add_development_dependency 'mongo_mapper', '~> 0.11'
| Add activerecord as an explicit development dependency
|
diff --git a/test/test_helper.rb b/test/test_helper.rb
index abc1234..def5678 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -4,7 +4,7 @@ require 'plugin_test_helper'
# Run the migrations
-ActiveRecord::Migrator.migrate("#{RAILS_ROOT}/db/migrate")
+ActiveRecord::Migrator.migrate("#{Rails.root}/db/migrate")
# Mixin the factory helper
require File.expand_path("#{File.dirname(__FILE__)}/factory")
| Use Rails.root instead of RAILS_ROOT in preparation for the Rails 2.1 release
|
diff --git a/test/test_helper.rb b/test/test_helper.rb
index abc1234..def5678 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -8,7 +8,7 @@ require 'authlogic/test_case'
require 'pry'
-class User
+class User < ActiveRecord::Base
def nyuidn
user_attributes[:nyuidn]
end
| Update test User class to have the correct superclass
|
diff --git a/padlock.gemspec b/padlock.gemspec
index abc1234..def5678 100644
--- a/padlock.gemspec
+++ b/padlock.gemspec
@@ -21,7 +21,7 @@ spec.add_development_dependency "rspec", ">= 3.0"
spec.add_development_dependency "rspec-its"
spec.add_development_dependency "generator_spec"
- spec.add_development_dependency "sqlite3", ">= 1.3.0"
+ spec.add_development_dependency "sqlite3", ">= 1.3.13"
spec.add_development_dependency "pry"
spec.add_development_dependency "activerecord", ">= 4.0.0"
end
| Update Sqlite gem to 1.3.13
|
diff --git a/haproxy_log_parser.gemspec b/haproxy_log_parser.gemspec
index abc1234..def5678 100644
--- a/haproxy_log_parser.gemspec
+++ b/haproxy_log_parser.gemspec
@@ -7,7 +7,7 @@ s.description = s.summary
s.license = 'MIT'
- s.add_dependency 'treetop'
+ s.add_dependency 'treetop', '~> 1.6'
s.add_development_dependency 'rspec', '~> 3.5.0'
| Use '~> 1.6' for treetop version constraint
|
diff --git a/config/initializers/auth.rb b/config/initializers/auth.rb
index abc1234..def5678 100644
--- a/config/initializers/auth.rb
+++ b/config/initializers/auth.rb
@@ -14,7 +14,7 @@ Rails.application.config.middleware.use OmniAuth::Builder do
Rails.application.config.auth.providers.each do |k, v|
opts = (v.try(:[], 'oauth') || {}).symbolize_keys
- opts.merge!({client_options: {ssl: {ca_file: Rails.root.join('lib/assets/certs/cacert.pem').to_s}}})
+ opts.merge!({client_options: {ssl: {ca_file: Rails.root.join('/usr/lib/ssl/certs/ca-certificates.crt').to_s}}})
provider k, v['key'], v['secret'], opts
end
end
| Correct path to ssl certificate
|
diff --git a/src/_plugins/atom_feeds.rb b/src/_plugins/atom_feeds.rb
index abc1234..def5678 100644
--- a/src/_plugins/atom_feeds.rb
+++ b/src/_plugins/atom_feeds.rb
@@ -4,11 +4,7 @@ module AtomFeedFilters
def strip_html_attrs(html)
doc = Nokogiri::HTML.fragment(html)
-
doc.xpath('@style|.//@style|@data-lang|.//@data-lang|@controls|.//@controls').remove
- # doc.xpath('@data-lang|.//@data-lang').remove
- # doc.xpath('@controls|.//@controls').remove
-
doc.to_s
end
end
| Tidy up a bit of code
|
diff --git a/core/db/migrate/20130802022321_migrate_tax_categories_to_line_items.rb b/core/db/migrate/20130802022321_migrate_tax_categories_to_line_items.rb
index abc1234..def5678 100644
--- a/core/db/migrate/20130802022321_migrate_tax_categories_to_line_items.rb
+++ b/core/db/migrate/20130802022321_migrate_tax_categories_to_line_items.rb
@@ -2,7 +2,7 @@ def change
Spree::LineItem.includes(:variant => { :product => :tax_category }).find_in_batches do |line_items|
line_items.each do |line_item|
- line_item.update_column(:tax_category_id, line_item.product.tax_category.id)
+ line_item.update_column(:tax_category_id, line_item.product.tax_category_id)
end
end
end
| Fix migration to run when no tax category set on product.
|
diff --git a/db/migrate/20150803151928_move_detailed_guides_slugs_under_guidance.rb b/db/migrate/20150803151928_move_detailed_guides_slugs_under_guidance.rb
index abc1234..def5678 100644
--- a/db/migrate/20150803151928_move_detailed_guides_slugs_under_guidance.rb
+++ b/db/migrate/20150803151928_move_detailed_guides_slugs_under_guidance.rb
@@ -0,0 +1,32 @@+class MoveDetailedGuidesSlugsUnderGuidance < Mongoid::Migration
+ def self.up
+ Artefact.where(kind: 'detailed_guide').each do |detailed_guide|
+ unless detailed_guide.slug.start_with?('guidance/')
+ old_slug = detailed_guide.slug
+ new_slug = "guidance/#{old_slug}"
+ begin
+ path = Rails.application.url_arbiter_api.reserve_path("/#{new_slug}", "publishing_app" => "whitehall")
+ detailed_guide.slug = new_slug
+ detailed_guide.save!
+ puts "moved #{old_slug} to #{new_slug}"
+ rescue GOVUK::Client::Errors::Conflict => e
+ puts "couldn't move #{old_slug} to #{new_slug}"
+ message = ""
+ if e.response["errors"]
+ e.response["errors"].each do |field, errors|
+ errors.each do |error|
+ message << "#{field.humanize} #{error}\n"
+ end
+ end
+ else
+ message = e.response.raw_body
+ end
+ puts message
+ end
+ end
+ end
+ end
+
+ def self.down
+ end
+end
| Move detailed guides slugs from root to /guidance
|
diff --git a/app/controllers/spree/admin/orders_controller_decorator.rb b/app/controllers/spree/admin/orders_controller_decorator.rb
index abc1234..def5678 100644
--- a/app/controllers/spree/admin/orders_controller_decorator.rb
+++ b/app/controllers/spree/admin/orders_controller_decorator.rb
@@ -17,4 +17,13 @@ page(params[:page]).
per(params[:per_page] || Spree::Config[:orders_per_page])
} } }
+
+ # Overwrite to use confirm_email_for_customer instead of confirm_email.
+ # This uses a new template. See mailers/spree/order_mailer_decorator.rb.
+ def resend
+ Spree::OrderMailer.confirm_email_for_customer(@order.id, true).deliver
+ flash[:success] = t(:order_email_resent)
+
+ respond_with(@order) { |format| format.html { redirect_to :back } }
+ end
end
| Edit Order: resend button uses new pretty template.
|
diff --git a/test/arelastic/queries/geo_polygon_test.rb b/test/arelastic/queries/geo_polygon_test.rb
index abc1234..def5678 100644
--- a/test/arelastic/queries/geo_polygon_test.rb
+++ b/test/arelastic/queries/geo_polygon_test.rb
@@ -1,6 +1,6 @@ require 'helper'
-class Arelastic::Queries::GeoDistanceTest < Minitest::Test
+class Arelastic::Queries::GeoPolygonTest < Minitest::Test
def test_as_elastic
points = [
{"lat" => 47.15, "lon" => -124.33},
| Correct the test class name
|
diff --git a/test/controllers/recipe_controller_test.rb b/test/controllers/recipe_controller_test.rb
index abc1234..def5678 100644
--- a/test/controllers/recipe_controller_test.rb
+++ b/test/controllers/recipe_controller_test.rb
@@ -7,6 +7,7 @@ get :pickup
assert_response :success
assert_not_nil assigns(:menu)
+ assert_not_nil assigns(:materials)
end
# 買い物リストを取得できる
| Add test for getting material
|
diff --git a/core/kernel/binding_spec.rb b/core/kernel/binding_spec.rb
index abc1234..def5678 100644
--- a/core/kernel/binding_spec.rb
+++ b/core/kernel/binding_spec.rb
@@ -34,4 +34,16 @@
describe "Kernel.binding" do
it "needs to be reviewed for spec completeness"
+
+ ruby_version_is ""..."1.9" do
+ it "uses Kernel for 'self' in the binding" do
+ eval('self', Kernel.binding).should == Kernel
+ end
+ end
+
+ ruby_version_is "1.9" do
+ it "uses the caller's self for 'self' in the binding" do
+ eval('self', Kernel.binding).should == self
+ end
+ end
end
| Add spec for 'self' in Kernel.binding, which differs between 1.8 and 1.9.
|
diff --git a/childprocess.gemspec b/childprocess.gemspec
index abc1234..def5678 100644
--- a/childprocess.gemspec
+++ b/childprocess.gemspec
@@ -6,8 +6,8 @@ s.name = "childprocess"
s.version = ChildProcess::VERSION
s.platform = Gem::Platform::RUBY
- s.authors = ["Jari Bakken", "Eric Kessler"]
- s.email = ["morrow748@gmail.com"]
+ s.authors = ["Jari Bakken", "Eric Kessler", "Shane da Silva"]
+ s.email = ["morrow748@gmail.com", "shane@dasilva.io"]
s.homepage = "http://github.com/enkessler/childprocess"
s.summary = %q{A simple and reliable solution for controlling external programs running in the background on any Ruby / OS combination.}
s.description = %q{This gem aims at being a simple and reliable solution for controlling external programs running in the background on any Ruby / OS combination.}
| Add Shane da Silva as maintainer
|
diff --git a/test/integration_helper.rb b/test/integration_helper.rb
index abc1234..def5678 100644
--- a/test/integration_helper.rb
+++ b/test/integration_helper.rb
@@ -40,10 +40,10 @@ end
def setup
- VCR.insert_cassette(api_name)
+ ENV['LIVE'] ? VCR.turn_off! : VCR.insert_cassette(api_name)
end
def teardown
- VCR.eject_cassette
+ VCR.eject_cassette if VCR.turned_on?
end
end
| Add switch to run integration against live data
|
diff --git a/vagrant-parallels.gemspec b/vagrant-parallels.gemspec
index abc1234..def5678 100644
--- a/vagrant-parallels.gemspec
+++ b/vagrant-parallels.gemspec
@@ -16,7 +16,6 @@ spec.required_rubygems_version = '>= 1.3.6'
spec.rubyforge_project = 'vagrant-parallels'
- spec.add_development_dependency 'bundler', '>= 1.5.2'
spec.add_development_dependency 'rake'
spec.add_development_dependency 'nokogiri'
spec.add_development_dependency 'rspec', '~> 2.14.0'
| gemspec: Remove "bundler" from dev dependencies
|
diff --git a/Casks/istat-menus.rb b/Casks/istat-menus.rb
index abc1234..def5678 100644
--- a/Casks/istat-menus.rb
+++ b/Casks/istat-menus.rb
@@ -1,7 +1,7 @@ class IstatMenus < Cask
- url 'http://s3.amazonaws.com/bjango/files/istatmenus4/istatmenus4.05.zip'
+ url 'http://s3.amazonaws.com/bjango/files/istatmenus4/istatmenus4.06.zip'
homepage 'http://bjango.com/mac/istatmenus/'
- version '4.05'
- sha1 'fd0b07186e64e5843177188fcd985589deed62be'
+ version '4.06'
+ sha1 '292630b92b44e44a589ba6be872b252f10138d99'
link 'iStat Menus.app'
end
| Update iStat Menus to v. 4.06
|
diff --git a/tools/export_functions.rb b/tools/export_functions.rb
index abc1234..def5678 100644
--- a/tools/export_functions.rb
+++ b/tools/export_functions.rb
@@ -0,0 +1,31 @@+#!/bin/ruby
+
+require 'optparse'
+
+options = {}
+OptionParser.new do |option_parser|
+ #option_parser.banner = 'Usage: example.rb [options]'
+ option_parser.default_argv = [
+ '--void',
+ 'void',
+ '--float',
+ 'float',
+ '--string',
+ 'const char*'
+ ]
+
+ option_parser.on('--void NAME', 'void type name') do |void_type_name|
+ options[:void_type_name] = void_type_name
+ end
+ option_parser.on('--float NAME', 'float type name') do |float_type_name|
+ options[:float_type_name] = float_type_name
+ end
+ option_parser.on('--string NAME', 'string type name') do |string_type_name|
+ options[:string_type_name] = string_type_name
+ end
+end.parse!
+
+p options
+
+#code = IO.read('testfile')
+#p code
| Add new export functions tools.
|
diff --git a/lib/generators/templates/promise_pay_initializer.rb b/lib/generators/templates/promise_pay_initializer.rb
index abc1234..def5678 100644
--- a/lib/generators/templates/promise_pay_initializer.rb
+++ b/lib/generators/templates/promise_pay_initializer.rb
@@ -3,3 +3,4 @@ PromisePay.api_user = "<%= email %>"
PromisePay.api_key = "<%= token %>"
PromisePay.env = :<%= env %>
+PromisePay.fee_ids = ""
| Add fee_ids field to config generator
|
diff --git a/lib/vagrant-cachier/action/configure_bucket_root.rb b/lib/vagrant-cachier/action/configure_bucket_root.rb
index abc1234..def5678 100644
--- a/lib/vagrant-cachier/action/configure_bucket_root.rb
+++ b/lib/vagrant-cachier/action/configure_bucket_root.rb
@@ -33,13 +33,17 @@ def cache_root
@cache_root ||= case @env[:machine].config.cache.scope.to_sym
when :box
- @env[:home_path].join('cache', @env[:machine].box.name)
+ @env[:home_path].join('cache', box_name)
when :machine
@env[:machine].data_dir.parent.join('cache')
else
raise "Unknown cache scope: '#{@env[:machine].config.cache.scope}'"
end
end
+
+ def box_name
+ @env[:machine].config.vm.box
+ end
end
end
end
| Make use of the Vagrantfile configured base box name instead of getting it from the Box object (which might be nil)
Closes GH-86
|
diff --git a/lib/mongoid_colored_logger/railtie.rb b/lib/mongoid_colored_logger/railtie.rb
index abc1234..def5678 100644
--- a/lib/mongoid_colored_logger/railtie.rb
+++ b/lib/mongoid_colored_logger/railtie.rb
@@ -4,7 +4,7 @@
class Railtie < Rails::Railtie
initializer 'logger_decorator', :after => :initialize_logger do
- config.mongoid.logger = MongoidColoredLogger::LoggerDecorator.new(Rails.logger)
+ config.mongoid.logger = MongoidColoredLogger::LoggerDecorator.new(Rails.logger) if Rails.env.development?
end
# Make it output to STDERR in console
| Use it only in development
|
diff --git a/Library/Formula/gambit-scheme.rb b/Library/Formula/gambit-scheme.rb
index abc1234..def5678 100644
--- a/Library/Formula/gambit-scheme.rb
+++ b/Library/Formula/gambit-scheme.rb
@@ -0,0 +1,24 @@+require 'formula'
+
+class GambitScheme <Formula
+ url 'http://www.iro.umontreal.ca/~gambit/download/gambit/v4.5/source/gambc-v4_5_2.tgz'
+ homepage 'http://dynamo.iro.umontreal.ca/~gambit/wiki/index.php/Main_Page'
+ md5 '71bd4b5858f807c4a8ce6ce68737db16'
+
+ def install
+ # Gambit Scheme currently fails to build with llvm-gcc
+ # (ld crashes during the build process)
+ ENV.gcc_4_2
+ # Gambit Scheme will not build with heavy optimizations. Disable all
+ # optimizations until safe values can be figured out.
+ ENV.no_optimization
+
+ system "./configure", "--prefix=#{prefix}",
+ "--disable-debug",
+ # Recommended to improve the execution speed and compactness
+ # of the generated executables. Increases compilation times.
+ "--enable-single-host"
+
+ system "make install"
+ end
+end
| Add formulae for Gambit Scheme.
Gambit Scheme doesn't like llvm-gcc, and heavy optimizations. Until
safe settings can be figure out, build it with no optimizations.
|
diff --git a/vestal_versions.gemspec b/vestal_versions.gemspec
index abc1234..def5678 100644
--- a/vestal_versions.gemspec
+++ b/vestal_versions.gemspec
@@ -4,8 +4,8 @@ gem.name = 'vestal_versions'
gem.version = '1.2.3'
- gem.authors = ['Steve Richert', "James O'Kelly"]
- gem.email = ['steve.richert@gmail.com', 'dreamr.okelly@gmail.com']
+ gem.authors = ['Steve Richert', "James O'Kelly", 'C. Jason Harrelson']
+ gem.email = ['steve.richert@gmail.com', 'dreamr.okelly@gmail.com', 'jason@lookforwardenterprises.com']
gem.description = "Keep a DRY history of your ActiveRecord models' changes"
gem.summary = gem.description
gem.homepage = 'http://github.com/laserlemon/vestal_versions'
| Add C. Jason Harrelson as gem author.
|
diff --git a/spec/controllers/projects_controller_spec.rb b/spec/controllers/projects_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/projects_controller_spec.rb
+++ b/spec/controllers/projects_controller_spec.rb
@@ -40,4 +40,20 @@ end
end
end
+
+ describe 'POST create' do
+ let(:user) { create(:user) }
+ let(:project) { build(:project) }
+
+ before { sign_in user }
+
+ it 'creates a project and redirects to list' do
+ expect { post :create, project: project.as_json }.to \
+ change { Project.count }.by 1
+ expect(flash[:notice]).not_to be_nil
+ expect(response).to redirect_to(projects_path)
+ end
+
+ end
+
end
| Write spec for post create
|
diff --git a/lib/ey-core/cli/servers.rb b/lib/ey-core/cli/servers.rb
index abc1234..def5678 100644
--- a/lib/ey-core/cli/servers.rb
+++ b/lib/ey-core/cli/servers.rb
@@ -26,9 +26,15 @@ argument: 'role'
def handle
- puts TablePrint::Printer.
- new(servers, [{id: {width: 10}}, :role, :provisioned_id]).
- table_print
+ puts TablePrint::Printer.new(
+ servers,
+ [
+ { id: { width: 10 } },
+ :role,
+ :provisioned_id,
+ { public_hostname: { width: 50 } }
+ ]
+ ).table_print
end
private
| Include public hostname in table output
For the purpose of ssh and other operations when using the CLI, the public hostname is a pretty common need.
|
diff --git a/lib/imap/backup/version.rb b/lib/imap/backup/version.rb
index abc1234..def5678 100644
--- a/lib/imap/backup/version.rb
+++ b/lib/imap/backup/version.rb
@@ -4,6 +4,6 @@ MAJOR = 2
MINOR = 0
REVISION = 0
- PRE = "rc1"
+ PRE = "rc2"
VERSION = [MAJOR, MINOR, REVISION, PRE].compact.map(&:to_s).join(".")
end
| Update RC for fix release
|
diff --git a/lib/islay/active_record.rb b/lib/islay/active_record.rb
index abc1234..def5678 100644
--- a/lib/islay/active_record.rb
+++ b/lib/islay/active_record.rb
@@ -1,26 +1,39 @@-class ActiveRecord::Base
- private
-
- # Provides access to the user model provided by Devise.
- def current_user
- Thread.current[:current_user]
- end
-
- # A callback handler which updates the user ID columns before save
- def update_user_ids
- if current_user
- self.creator_id = current_user.id if new_record?
- self.updater_id = current_user.id
+module ActiveRecord
+ module ConnectionAdapters
+ class TableDefinition
+ # This is a migration helper for adding columns used when tracking user
+ # edits to records. It works in conjunction with the extensions to AR:Base.
+ def user_tracking(*args)
+ column(:creator_id, :integer, :null => false, :references => :users)
+ column(:updater_id, :integer, :null => false, :references => :users)
+ end
end
end
- # Installs a before_save hook for updating the user IDs against a record.
- # This requires the creator_id and updater_id columns to be in the table.
- #
- # This method also installs to associations; creator, updater
- def self.track_user_edits
- before_save :update_user_ids
- belongs_to :creator, :class_name => 'User'
- belongs_to :updater, :class_name => 'User'
+ class Base
+ private
+
+ # Provides access to the user model provided by Devise.
+ def current_user
+ Thread.current[:current_user]
+ end
+
+ # A callback handler which updates the user ID columns before save
+ def update_user_ids
+ if current_user
+ self.creator_id = current_user.id if new_record?
+ self.updater_id = current_user.id
+ end
+ end
+
+ # Installs a before_save hook for updating the user IDs against a record.
+ # This requires the creator_id and updater_id columns to be in the table.
+ #
+ # This method also installs to associations; creator, updater
+ def self.track_user_edits
+ before_save :update_user_ids
+ belongs_to :creator, :class_name => 'User'
+ belongs_to :updater, :class_name => 'User'
+ end
end
end
| Add migration helper for generating user edit columns.
|
diff --git a/lib/kul/hash_initialize.rb b/lib/kul/hash_initialize.rb
index abc1234..def5678 100644
--- a/lib/kul/hash_initialize.rb
+++ b/lib/kul/hash_initialize.rb
@@ -1,5 +1,5 @@ module HashInitialize
- def initialize(opts)
+ def initialize(opts = {})
opts.each do |k, v|
if respond_to? k.to_s
# this lets us initialize classes with attr_reader
| Initialize default is empty hash
|
diff --git a/lib/awestruct/handlers/css_tilt_handler.rb b/lib/awestruct/handlers/css_tilt_handler.rb
index abc1234..def5678 100644
--- a/lib/awestruct/handlers/css_tilt_handler.rb
+++ b/lib/awestruct/handlers/css_tilt_handler.rb
@@ -29,6 +29,7 @@ ::Compass::Frameworks::ALL.each do |framework|
opts[:load_paths] << framework.stylesheets_directory
end
+ opts[:load_paths] << Compass::SpriteImporter.new
opts[:load_paths] << File.join(site.config.dir.to_s, File.dirname(relative_source_path) ) unless relative_source_path.nil?
# Less use Paths instead of load_paths
| Enable the Compass sprite importer, needed for magic sprites
|
diff --git a/lib/brightbox-cli/detailed_server_group.rb b/lib/brightbox-cli/detailed_server_group.rb
index abc1234..def5678 100644
--- a/lib/brightbox-cli/detailed_server_group.rb
+++ b/lib/brightbox-cli/detailed_server_group.rb
@@ -2,7 +2,7 @@ class DetailedServerGroup < ServerGroup
def to_row
row_attributes = super
- row_attributes[:firewall_policy] = firewall_policy.id
+ row_attributes[:firewall_policy] = firewall_policy && firewall_policy.id
row_attributes
end
| Check for firewall policy before getting its id
|
diff --git a/spec/controllers/cuppings_controller_spec.rb b/spec/controllers/cuppings_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/cuppings_controller_spec.rb
+++ b/spec/controllers/cuppings_controller_spec.rb
@@ -0,0 +1,75 @@+require 'rails_helper'
+
+RSpec.describe CuppingsController, type: :controller do
+
+ let(:user) { create(:user) }
+ let!(:cuppings) { create_list(:cupping, 5) }
+ let(:cupping) { cuppings.first }
+ let(:cupping_id) { cupping.id }
+
+ describe 'GET #index' do
+ it 'collects all cuppings into @cuppings' do
+ get :index, format: :json
+ expect(assigns(:cuppings)).to eq cuppings
+ end
+ end
+
+ describe 'GET #show' do
+ let(:requested_cupping) { create(:cupping) }
+
+ it 'assigns the requested cupping as @cupping' do
+ get :show, params: { id: requested_cupping }
+ expect(assigns(:cupping)).to eq requested_cupping
+ end
+ end
+
+ describe 'POST #create' do
+ context 'with valid attributes' do
+ it 'saves a new cupping in the database' do
+ expect { post :create, params: attributes_for(:cupping) }
+ .to change(Cupping, :count).by(1)
+ end
+ end
+
+ context 'with invalid attributes' do
+ it "doesn't save the new cupping in the database" do
+ expect { post :create, params: { cupping: { name: nil } } }
+ .not_to change(Cupping, :count)
+ end
+ end
+ end
+
+ describe 'PATCH #update' do
+ before :each do
+ @cupping = create(:cupping,
+ host_id: user.id,
+ location: 'San Francisco, CA',
+ cup_date: Time.now,
+ cups_per_sample: 3
+ )
+ end
+
+ context 'with valid attributes' do
+ it 'locates the requested cupping' do
+ patch :update, params: { id: @cupping, cupping: attributes_for(:cupping) }
+ expect(assigns(:cupping)).to eq(@cupping)
+ end
+
+ it "updates cupping's attributes" do
+ patch :update,
+ params: { id: @cupping,
+ location: 'Santa Clara' }
+ @cupping.reload
+ expect(@cupping.location).to eq('Santa Clara')
+ end
+ end
+ end
+
+ describe 'DELETE #destroy' do
+ it 'deletes the cupping record from the database' do
+ cupping = create(:cupping)
+ expect { delete :destroy, params: { id: cupping.id } }
+ .to change(Cupping, :count).by(-1)
+ end
+ end
+end
| Add cuppings controller tests. All but one test passing.
|
diff --git a/lib/cloudstrap/hdp/bootstrap_properties.rb b/lib/cloudstrap/hdp/bootstrap_properties.rb
index abc1234..def5678 100644
--- a/lib/cloudstrap/hdp/bootstrap_properties.rb
+++ b/lib/cloudstrap/hdp/bootstrap_properties.rb
@@ -42,6 +42,11 @@
private
+ Contract None => Bool
+ def exist?
+ File.exist?(file)
+ end
+
Contract None => Hash
def load
JavaProperties.load file
| Add method to check if bootstrap.properties exists
|
diff --git a/lib/etl/transform/calculation_transform.rb b/lib/etl/transform/calculation_transform.rb
index abc1234..def5678 100644
--- a/lib/etl/transform/calculation_transform.rb
+++ b/lib/etl/transform/calculation_transform.rb
@@ -12,13 +12,18 @@
def transform(name, value, row)
return nil if row.nil?
+ return nil if row[@fields[0]].nil?
if (@function.eql? "A + B")
- first = ""
- first = row[@fields[0]] unless row[@fields[0]].nil?
+ first = row[@fields[0]]
second = ""
second = row[@fields[1]] unless row[@fields[1]].nil?
row[name] = first + second
+ end
+
+ if (@function.eql? "date A")
+ first = row[@fields[0]]
+ row[name] = Time.parse(first)
end
row[name]
| Add a new calculation operation to the calculation step
|
diff --git a/Puree.podspec b/Puree.podspec
index abc1234..def5678 100644
--- a/Puree.podspec
+++ b/Puree.podspec
@@ -11,9 +11,6 @@ s.requires_arc = true
s.source_files = 'Pod/Classes'
- s.resource_bundles = {
- 'Puree' => ['Pod/Assets/*.png']
- }
s.dependency 'YapDatabase', '~> 2.9.2'
end
| Remove unnecessary pod spec settings
|
diff --git a/db/data_migration/20121213094644_index_fatality_notices.rb b/db/data_migration/20121213094644_index_fatality_notices.rb
index abc1234..def5678 100644
--- a/db/data_migration/20121213094644_index_fatality_notices.rb
+++ b/db/data_migration/20121213094644_index_fatality_notices.rb
@@ -0,0 +1,4 @@+fatality_notice_data = [FatalityNotice].map(&:search_index).sum([])
+p fatality_notice_data
+Rummageable.index(fatality_notice_data, Whitehall.government_search_index_name)
+Rummageable.commit(Whitehall.government_search_index_name)
| Index all fatality notices in search
|
diff --git a/db/migrate/20200520103945_create_gobierto_people_charge.rb b/db/migrate/20200520103945_create_gobierto_people_charge.rb
index abc1234..def5678 100644
--- a/db/migrate/20200520103945_create_gobierto_people_charge.rb
+++ b/db/migrate/20200520103945_create_gobierto_people_charge.rb
@@ -0,0 +1,15 @@+# frozen_string_literal: true
+
+class CreateGobiertoPeopleCharge < ActiveRecord::Migration[5.2]
+ def change
+ create_table :gp_charges do |t|
+ t.belongs_to :person, null: false
+ t.belongs_to :department, null: false
+ t.jsonb :name_translations
+ t.date :start_date
+ t.date :end_date
+
+ t.timestamps
+ end
+ end
+end
| Add migration to create gp_charges table
|
diff --git a/lib/knapsack_pro/adapters/rspec_adapter.rb b/lib/knapsack_pro/adapters/rspec_adapter.rb
index abc1234..def5678 100644
--- a/lib/knapsack_pro/adapters/rspec_adapter.rb
+++ b/lib/knapsack_pro/adapters/rspec_adapter.rb
@@ -1,6 +1,6 @@ module KnapsackPro
module Adapters
- class RSpecAdapter
+ class RSpecAdapter < BaseAdapter
TEST_DIR_PATTERN = 'spec/**/*_spec.rb'
def self.test_path(example_group)
| Add missing parent class for RSpecAdapter
|
diff --git a/lib/puppet/type/java_ks.rb b/lib/puppet/type/java_ks.rb
index abc1234..def5678 100644
--- a/lib/puppet/type/java_ks.rb
+++ b/lib/puppet/type/java_ks.rb
@@ -71,6 +71,19 @@ desc ''
end
+ autorequire(:file) do
+ auto_requires = []
+ [:private_key, :certificate].each do |param|
+ if @parameters.include?(param)
+ auto_requires << @parameters[param].value
+ end
+ end
+ if @parameters.include(:target)
+ auto_requires << ::File.dirname(@parameters[:target].value)
+ end
+ auto_requires
+ end
+
def self.title_patterns
identity = lambda {|x| x}
[[
| Add autorequires for file resources.
This patch sets up dependancies on file resources for private_key,
certificate, and target's directory. Before this you had to do it
yourself.
|
diff --git a/spec/line_coverage_spec.rb b/spec/line_coverage_spec.rb
index abc1234..def5678 100644
--- a/spec/line_coverage_spec.rb
+++ b/spec/line_coverage_spec.rb
@@ -22,7 +22,7 @@ end
RSpec.describe 'line coverage(not_higher_than_builtin: true)' do
- each_code_examples('./spec/branch_cover/*.rb') do |fn, lines, lineno|
- should not_be_higher_than_builtin_coverage(fn, lines, lineno)
- end
+ #each_code_examples('./spec/branch_cover/*.rb') do |fn, lines, lineno|
+ # should not_be_higher_than_builtin_coverage(fn, lines, lineno)
+ #end
end
| Disable tests comparing builtin to deepcover
|
diff --git a/test/web_console/repl/irb_test.rb b/test/web_console/repl/irb_test.rb
index abc1234..def5678 100644
--- a/test/web_console/repl/irb_test.rb
+++ b/test/web_console/repl/irb_test.rb
@@ -16,11 +16,18 @@ assert_equal sprintf(return_prompt, "50\n"), irb.send_input('foo + 8')
end
- test 'session isolation' do
+ test 'session isolation requires own bindings' do
irb1 = WebConsole::REPL::IRB.new(Object.new.instance_eval { binding })
irb2 = WebConsole::REPL::IRB.new(Object.new.instance_eval { binding })
assert_equal sprintf(return_prompt, "42\n"), irb1.send_input('foo = 42')
- assert_match /undefined local variable or method `foo'/, irb2.send_input('foo')
+ assert_match %r{undefined local variable or method `foo'}, irb2.send_input('foo')
+ end
+
+ test 'session preservation requires same bindings' do
+ irb1 = WebConsole::REPL::IRB.new
+ irb2 = WebConsole::REPL::IRB.new
+ assert_equal sprintf(return_prompt, "42\n"), irb1.send_input('foo = 42')
+ assert_equal sprintf(return_prompt, "42\n"), irb2.send_input('foo')
end
private
| Add test for IRB session preservation
|
diff --git a/lib/rubocop/cop/rspec/example_length.rb b/lib/rubocop/cop/rspec/example_length.rb
index abc1234..def5678 100644
--- a/lib/rubocop/cop/rspec/example_length.rb
+++ b/lib/rubocop/cop/rspec/example_length.rb
@@ -41,7 +41,7 @@ private
def code_length(node)
- lines = node.source.lines.to_a[1..-2] || []
+ lines = node.source.lines.to_a[1..-2]
lines.count { |line| !irrelevant_line(line) }
end
| Remove unnecessary `||` in code_length
If the block is short like `it { should be_valid }` then
the slice evaluates to an empty array so the left side here
is never falsey
|
diff --git a/core/app/controllers/feedback_controller.rb b/core/app/controllers/feedback_controller.rb
index abc1234..def5678 100644
--- a/core/app/controllers/feedback_controller.rb
+++ b/core/app/controllers/feedback_controller.rb
@@ -13,6 +13,7 @@ params = {}
render :json => { msg: "Thank you for your feedback. We have registered your comments under the number #{issue[:number]}".html_safe }
rescue
+ ExceptionNotifier::Notifier.exception_notification(request.env, $!, :data => {:message => "was doing something wrong"}).deliver
render :json => { msg: "We're sorry, something went wrong with saving your feedback, you can still reach us at feedback@factlink.com".html_safe }, :status => 500
end
end
| Test for sending emails on exception
|
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.2"
+ s.version = "0.0.3"
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.2" }
+ s.source = { :git => "https://github.com/marcbaldwin/AutoLayoutBuilder.git", :tag => "v0.0.3" }
s.source_files = "AutoLayout"
s.platform = :ios, '8.0'
| Update podspec version to v0.0.3
|
diff --git a/valid_attribute.gemspec b/valid_attribute.gemspec
index abc1234..def5678 100644
--- a/valid_attribute.gemspec
+++ b/valid_attribute.gemspec
@@ -16,7 +16,7 @@
s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.md"]
- s.add_dependency "rails", "~> 4.2.0"
+ s.add_dependency "rails", ">= 4.2.0"
s.add_development_dependency "rspec-rails"
s.add_development_dependency "sqlite3"
| Make it compatible with Rails 5
|
diff --git a/Casks/flixster-desktop.rb b/Casks/flixster-desktop.rb
index abc1234..def5678 100644
--- a/Casks/flixster-desktop.rb
+++ b/Casks/flixster-desktop.rb
@@ -0,0 +1,16 @@+cask :v1 => 'flixster-desktop' do
+ version :latest
+ sha256 :no_check
+
+ # cloudfront.net is the official download host per the vendor homepage
+ url 'http://d1rtylazwb77ux.cloudfront.net/desktop/mac/FlixsterDesktop.zip'
+ name 'Flixster Desktop for Mac'
+ homepage 'http://www.flixster.com/about/ultraviolet/'
+ license :gratis
+
+ postflight do
+ suppress_move_to_applications :key => 'moveToApplicationsFolderAlertSuppress'
+ end
+
+ app 'Flixster Desktop.app'
+end
| Create new cask for Flixster desktop, an Ultraviolet movie playback app.
|
diff --git a/Casks/mendeley-desktop.rb b/Casks/mendeley-desktop.rb
index abc1234..def5678 100644
--- a/Casks/mendeley-desktop.rb
+++ b/Casks/mendeley-desktop.rb
@@ -1,7 +1,7 @@ class MendeleyDesktop < Cask
- url 'http://download.mendeley.com/Mendeley-Desktop-1.10.3-OSX-Universal.dmg'
+ url 'http://download.mendeley.com/Mendeley-Desktop-1.11-OSX-Universal.dmg'
homepage 'http://www.mendeley.com/'
- version '1.10.3'
- sha256 'ea605465c771e697ee1a700b85596db32725b9bb4a6e90dd38b861691bffde58'
+ version '1.11'
+ sha256 '07d4444485df1916defd4719aa1c5561aa59fe6a66ea3476ab796f8196a147a5'
link 'Mendeley Desktop.app'
end
| Update Mendeley Desktop to 1.11 release.
|
diff --git a/lib/restforce/middleware.rb b/lib/restforce/middleware.rb
index abc1234..def5678 100644
--- a/lib/restforce/middleware.rb
+++ b/lib/restforce/middleware.rb
@@ -16,6 +16,8 @@ autoload :CustomHeaders, 'restforce/middleware/custom_headers'
def initialize(app, client, options)
+ super(app)
+
@app = app
@client = client
@options = options
| Fix Lint/MissingSuper Rubocop offence in `Restforce::Middleware`, inheriting from `Faraday::Middleware`
The `Restforce::Middleware` class inherits from `Faraday::Middleware`,
but never calls `super`. This fixes it.
|
diff --git a/rmodbus.gemspec b/rmodbus.gemspec
index abc1234..def5678 100644
--- a/rmodbus.gemspec
+++ b/rmodbus.gemspec
@@ -5,7 +5,7 @@ s.author = 'A.Timin, J. Sanders'
s.platform = Gem::Platform::RUBY
s.summary = "RModBus - free implementation of protocol ModBus"
- s.files = Dir['lib/**/*.rb']
+ s.files = Dir['lib/**/*.rb','examples/*.rb','spec/*.rb']
s.autorequire = "rmodbus"
s.has_rdoc = true
s.rdoc_options = ["--title", "RModBus", "--inline-source", "--main", "README"]
| Add exmaples and spec directories in gem
|
diff --git a/app/controllers/api/scores_api_controller.rb b/app/controllers/api/scores_api_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/api/scores_api_controller.rb
+++ b/app/controllers/api/scores_api_controller.rb
@@ -7,7 +7,7 @@
def_param_group :mode do
param :weapons, %w(true false), desc: 'Default is true'
- param :factory, %w(turbo classic), desc: 'Default is classic'
+ param :factory, %w(turbo classic), desc: 'Default is turbo'
end
api :GET, '/player/:id', 'Player records'
| Fix apidoc, default is turbo.
|
diff --git a/activerecord-retry.gemspec b/activerecord-retry.gemspec
index abc1234..def5678 100644
--- a/activerecord-retry.gemspec
+++ b/activerecord-retry.gemspec
@@ -18,7 +18,6 @@ gem.add_dependency "activerecord", "~> 3.0"
gem.add_dependency "activesupport", "~> 3.0"
- gem.add_development_dependency "bundler", "~> 1.1.5"
gem.add_development_dependency "mocha", "~> 0.12.1"
gem.add_development_dependency "rake", "~> 0.9.2.2"
end
| Remove bundler as a development dependency
|
diff --git a/actors/spec/spec_helper.rb b/actors/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/actors/spec/spec_helper.rb
+++ b/actors/spec/spec_helper.rb
@@ -22,3 +22,4 @@
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'spec', 'spec_helper'))
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'agents', 'lib', 'instance'))
+require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'chef', 'lib', 'providers'))
| Fix instance_setup_spec that fails when run individually
|
diff --git a/app/helpers/admin/supporting_pages_helper.rb b/app/helpers/admin/supporting_pages_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/admin/supporting_pages_helper.rb
+++ b/app/helpers/admin/supporting_pages_helper.rb
@@ -7,7 +7,7 @@ preview_document_path(supporting_page, policy_id: policy.document)
end
- [url, policy.title]
+ [url, "View with policy: #{policy.title}"]
end
end
end
| Add context to supporting page preview dropdown
Show "View with policy" before links to make it clear what the options
are.
|
diff --git a/app/models/adjusted_net_income_calculator.rb b/app/models/adjusted_net_income_calculator.rb
index abc1234..def5678 100644
--- a/app/models/adjusted_net_income_calculator.rb
+++ b/app/models/adjusted_net_income_calculator.rb
@@ -7,8 +7,8 @@
def initialize(params)
PARAM_KEYS.each do |key|
+ self.class.class_eval { attr_reader :"#{key}" }
instance_variable_set :"@#{key}", integer_value(params[key])
- self.class.send("attr_reader", :"#{key}")
end
end
| Use cleaner syntax for dynamically setting attr_reader
|
diff --git a/neighborly-balanced-bankaccount.gemspec b/neighborly-balanced-bankaccount.gemspec
index abc1234..def5678 100644
--- a/neighborly-balanced-bankaccount.gemspec
+++ b/neighborly-balanced-bankaccount.gemspec
@@ -4,22 +4,22 @@ require 'neighborly/balanced/bankaccount/version'
Gem::Specification.new do |spec|
- spec.name = "neighborly-balanced-bankaccount"
+ spec.name = 'neighborly-balanced-bankaccount'
spec.version = Neighborly::Balanced::Bankaccount::VERSION
spec.authors = ['Josemar Luedke', 'Irio Musskopf']
spec.email = %w(josemarluedke@gmail.com iirineu@gmail.com)
spec.summary = 'Neighbor.ly integration with Bank Account Balanced Payments.'
spec.description = 'Neighbor.ly integration with Bank Account Balanced Payments.'
spec.homepage = 'https://github.com/neighborly/neighborly-balanced-bankaccount'
- spec.license = "MIT"
+ spec.license = 'MIT'
spec.files = `git ls-files -z`.split("\x0")
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
- spec.require_paths = ["lib"]
+ spec.require_paths = ['lib']
spec.add_dependency 'neighborly-balanced', '~> 0'
spec.add_dependency 'rails'
spec.add_development_dependency 'rspec-rails'
- spec.add_development_dependency "sqlite3"
+ spec.add_development_dependency 'sqlite3'
end
| Remove double quotes from gemspec file
|
diff --git a/test/controllers/sessions_controller_test.rb b/test/controllers/sessions_controller_test.rb
index abc1234..def5678 100644
--- a/test/controllers/sessions_controller_test.rb
+++ b/test/controllers/sessions_controller_test.rb
@@ -0,0 +1,30 @@+require 'test_helper'
+
+class SessionsControllerTest < ActionController::TestCase
+ setup do
+ session[:hacker_id] = nil
+ end
+
+ test "should get new" do
+ get :new
+ assert_response :success
+ end
+
+ test "should try to login and fail" do
+ post :create, { email: 'rodri@altoros.com', password: 'fail' }
+ assert_not session[:hacker_id]
+ assert_equal 'Invalid email or password', flash.alert
+ end
+
+ test "should try to login and success" do
+ post :create, { email: 'rodri@altoros.com', password: 'rodrigo' }
+ assert_equal session[:hacker_id], Hacker.first.id
+ assert_equal 'Successfully logged in', flash.notice
+ end
+
+ test "should logout from the session" do
+ delete :destroy
+ assert_not session[:hacker_id]
+ assert_equal 'Logged out', flash.notice
+ end
+end
| Add test for the session controller.
|
diff --git a/app/models/eventful_api.rb b/app/models/eventful_api.rb
index abc1234..def5678 100644
--- a/app/models/eventful_api.rb
+++ b/app/models/eventful_api.rb
@@ -0,0 +1,24 @@+class EventfulApi
+ include HTTParty
+
+
+ def self.getData(params)
+ res = HTTParty.get("http://api.eventful.com/json/events/search?c=" + params[:searchTerm] + "&l=" + params[:searchLocation] + "&within=" + params[:searchRadius] + "&date=" + params[:searchDate] + "&app_key=#{ENV["eventful_api_key"]}")
+ data = JSON.parse(res.body)
+ events = []
+ data["events"]["event"].each do |e|
+ event = {}
+
+ event["title"] = ActionView::Base.full_sanitizer.sanitize(e["title"])
+ event["description"] = ActionView::Base.full_sanitizer.sanitize(e["description"])
+ event["start_time"] = ActionView::Base.full_sanitizer.sanitize(e["start_time"])
+ event["latitude"] = ActionView::Base.full_sanitizer.sanitize(e["latitude"])
+ event["longitude"] = ActionView::Base.full_sanitizer.sanitize(e["longitude"])
+
+ events << event
+ end
+ events
+ end
+
+
+end
| Create class to handle api calls
|
diff --git a/test/controllers/step_nav_controller_test.rb b/test/controllers/step_nav_controller_test.rb
index abc1234..def5678 100644
--- a/test/controllers/step_nav_controller_test.rb
+++ b/test/controllers/step_nav_controller_test.rb
@@ -0,0 +1,12 @@+require "test_helper"
+
+describe StepNavController do
+ it "returns a 404 when the page doesn't exist" do
+ slug = SecureRandom.hex
+ stub_content_store_does_not_have_item("/#{slug}")
+
+ get :show, params: { slug: slug }
+
+ assert_response 404
+ end
+end
| Add controller tests for step_navs
Adds a basic test for 404s
|
diff --git a/lib/raptor/socket/tcp_server.rb b/lib/raptor/socket/tcp_server.rb
index abc1234..def5678 100644
--- a/lib/raptor/socket/tcp_server.rb
+++ b/lib/raptor/socket/tcp_server.rb
@@ -1,28 +1,4 @@ # A listening TCP socket
-class Raptor::Socket::TcpServer < Raptor::Socket
-
- # Factory method for creating a new {TcpServer} through the given
- # {SwitchBoard `:switch_board`}
- #
- # @param (see Raptor::Socket::Comm.create)
- # @option (see Raptor::Socket::Comm.create)
- # @option opts :peer_host [String,IPAddr]
- # @option opts :peer_port [Fixnum]
- # @return [TcpServer]
- def self.create(opts)
- #required_keys = [ :local_host, :local_port ]
- #validate_opts(opts, required_keys)
-
- comm = opts[:switch_board].best_comm(opts[:peer_host])
-
- # copy so we don't modify the caller's stuff
- opts = opts.dup
- opts[:proto] = :tcp
- opts[:server] = true
-
- sock = comm.create(opts)
-
- new(sock)
- end
+class Raptor::Socket::TcpServer < Raptor::Socket::Tcp
end
| Make TcpServer inherit from Tcp
|
diff --git a/lib/respect/rails/routes_set.rb b/lib/respect/rails/routes_set.rb
index abc1234..def5678 100644
--- a/lib/respect/rails/routes_set.rb
+++ b/lib/respect/rails/routes_set.rb
@@ -16,9 +16,7 @@ @engines["application"]
end
- def each(&block)
- routes.each(&block)
- end
+ delegate :each, to: :routes
private
| Use delegate instead of writing each by hand.
|
diff --git a/lib/rspec/announce/formatter.rb b/lib/rspec/announce/formatter.rb
index abc1234..def5678 100644
--- a/lib/rspec/announce/formatter.rb
+++ b/lib/rspec/announce/formatter.rb
@@ -1,17 +1,19 @@ # -*- encoding : utf-8 -*-
-require 'rspec/core/formatters/documentation_formatter'
+RSpec::Support.require_rspec_core 'formatters/documentation_formatter'
# $ echo "--format EopCore::IntegrationTesting::RspecAnnouncementFormatter" > $PROJECT_HOME/.rspec
module Rspec
module Announce
class Formatter < RSpec::Core::Formatters::DocumentationFormatter
+ RSpec::Core::Formatters.register self, :example_group_started, :example_group_finished,
+ :example_passed, :example_pending, :example_failed, :example_started
+
def announce(msg)
@announcements << msg
end
def example_started(example)
- super
@announcements = []
end
@@ -21,6 +23,12 @@ output.puts success_color("#{current_indentation} #{m}")
end
end
+
+ private
+
+ def success_color(s)
+ RSpec::Core::Formatters::ConsoleCodes.wrap(s, :success)
+ end
end
end
end
| Update Formatter for RSpec 3
|
diff --git a/lib/spree_license_key/engine.rb b/lib/spree_license_key/engine.rb
index abc1234..def5678 100644
--- a/lib/spree_license_key/engine.rb
+++ b/lib/spree_license_key/engine.rb
@@ -19,6 +19,7 @@
config.to_prepare &method(:activate).to_proc
- config.active_record.observers = ['spree/shipment_observer', 'spree/payment_observer', 'spree/order_observer']
+ config.active_record.observers ||= []
+ ['spree/shipment_observer', 'spree/payment_observer', 'spree/order_observer'].each { |o| config.active_record.observers << o }
end
end
| Append new observers to array so we don't override other ones
See: http://stackoverflow.com/questions/17803809/observers-in-rails-engines#comment40243756_17823370
|
diff --git a/lib/spring/commands/cucumber.rb b/lib/spring/commands/cucumber.rb
index abc1234..def5678 100644
--- a/lib/spring/commands/cucumber.rb
+++ b/lib/spring/commands/cucumber.rb
@@ -6,16 +6,12 @@ end
self.environment_matchers = {
- :default => "test",
- /^features($|\/)/ => "test" # if a path is passed, make sure the default env is applied
+ :default => "test",
+ /^features($|\/)/ => "test" # if a path is passed, make sure the default env is applied
}
def env(args)
- # This is an adaption of the matching that Rake itself does.
- # See: https://github.com/jimweirich/rake/blob/3754a7639b3f42c2347857a0878beb3523542aee/lib/rake/application.rb#L691-L692
- if env = args.grep(/^(RAILS|RACK)_ENV=(.*)$/m).last
- return env.split("=").last
- end
+ return ENV['RAILS_ENV'] if ENV['RAILS_ENV']
self.class.environment_matchers.each do |matcher, environment|
return environment if matcher === (args.first || :default)
| Replace Rake env variable handling with usual
|
diff --git a/lib/wiki_preferences_manager.rb b/lib/wiki_preferences_manager.rb
index abc1234..def5678 100644
--- a/lib/wiki_preferences_manager.rb
+++ b/lib/wiki_preferences_manager.rb
@@ -10,9 +10,17 @@
def enable_visual_editor
ve_options = [
- 'visualeditor-editor=visualeditor', # enables VE as default editor
- 'visualeditor-hidebetawelcome=1', # skips the 'start editing' dialog on first edit
- 'visualeditor-hideusered=1' # disables the blue dots on cite and link buttons
+ # enables VE as default editor
+ 'visualeditor-editor=visualeditor',
+ # skips the 'start editing' dialog on first edit
+ 'visualeditor-hidebetawelcome=1',
+ # disables the blue dots on cite and link buttons
+ 'visualeditor-hideusered=1',
+ # disables VE source editing for talk pages, which is the default but
+ # breaks the talk page guided tour if enabled.
+ 'visualeditor-newwikitext=0',
+ # single Edit / Edit Source tab, remembering last editor used
+ 'visualeditor-tabs=remember-last'
].join('|')
#################
# Other options #
| Update WikiPreferencesManager to ensure expected settings
Some of the possible options are changing, and we want to make sure students get the settings that match with our training materials, until the Wikipedia defaults change *AND* we are ready with updated help material and guided tours.
|
diff --git a/Casks/appcode-eap.rb b/Casks/appcode-eap.rb
index abc1234..def5678 100644
--- a/Casks/appcode-eap.rb
+++ b/Casks/appcode-eap.rb
@@ -1,10 +1,32 @@ cask :v1 => 'appcode-eap' do
- version '3.2.0'
- sha256 'fa78dc8e2a7430e7173cecec7b6e369f3d2cf442facd7ee0df46592788b00715'
+ version '141.1399.2'
+ sha256 '2dd8a0a9246067ae6e092b9934cbadac6730a74fe400c8929b09792a0c0cda83'
- url 'http://download.jetbrains.com/objc/AppCode-141.1689.23.dmg'
- homepage 'http://confluence.jetbrains.com/display/OBJC/AppCode+EAP'
+ url "https://download.jetbrains.com/objc/AppCode-#{version}.dmg"
+ name 'AppCode'
+ homepage 'https://confluence.jetbrains.com/display/OBJC/AppCode+EAP'
license :commercial
app 'AppCode EAP.app'
+
+ zap :delete => [
+ '~/Library/Preferences/com.jetbrains.AppCode-EAP.plist',
+ '~/Library/Preferences/AppCode32',
+ '~/Library/Application Support/AppCode32',
+ '~/Library/Caches/AppCode32',
+ '~/Library/Logs/AppCode32',
+ ]
+
+ conflicts_with :cask => 'appcode-eap-bundled-jdk'
+
+ caveats <<-EOS.undent
+ #{token} requires Java 6 like any other IntelliJ-based IDE.
+ You can install it with
+
+ brew cask install caskroom/homebrew-versions/java6
+
+ The vendor (JetBrains) doesn't support newer versions of Java (yet)
+ due to several critical issues, see details at
+ https://intellij-support.jetbrains.com/entries/27854363
+ EOS
end
| Improve cask for AppCode EAP
|
diff --git a/Casks/spotifybeta.rb b/Casks/spotifybeta.rb
index abc1234..def5678 100644
--- a/Casks/spotifybeta.rb
+++ b/Casks/spotifybeta.rb
@@ -1,6 +1,6 @@ cask :v1 => 'spotifybeta' do
- version '1.0.0.995.gcdfee982-1486'
- sha256 '1de2c2a4f33ef8fbee384b0d5b04e9dde7a30540f1a627dd1dba378096a1c9ff'
+ version '1.0.0.1093.g2eba9b4b-1679'
+ sha256 'ac5e99bfb448d3f4ee46b1a95bd428c5d8f27e193b44895754ac4150a0f56a60'
url "http://download.spotify.com/beta/spotify-app-#{version}.dmg"
name 'Spotify Beta'
| Update SpotifyBeta.app to version 1.0.0.1093.g2eba9b4b-1679
|
diff --git a/week-6/extra-pairing/nested_data_solution.rb b/week-6/extra-pairing/nested_data_solution.rb
index abc1234..def5678 100644
--- a/week-6/extra-pairing/nested_data_solution.rb
+++ b/week-6/extra-pairing/nested_data_solution.rb
@@ -0,0 +1,47 @@+# RELEASE 2: NESTED STRUCTURE GOLF
+# Hole 1
+# Target element: "FORE"
+
+array = [[1,2], ["inner", ["eagle", "par", ["FORE", "hook"]]]]
+
+# attempts:
+# ============================================================
+
+
+
+# ============================================================
+
+# Hole 2
+# Target element: "congrats!"
+
+hash = {outer: {inner: {"almost" => {3 => "congrats!"}}}}
+
+# attempts:
+# ============================================================
+
+
+
+# ============================================================
+
+
+# Hole 3
+# Target element: "finished"
+
+nested_data = {array: ["array", {hash: "finished"}]}
+
+# attempts:
+# ============================================================
+
+
+
+# ============================================================
+
+# RELEASE 3: ITERATE OVER NESTED STRUCTURES
+
+number_array = [5, [10, 15], [20,25,30], 35]
+
+
+
+# Bonus:
+
+startup_names = ["bit", ["find", "fast", ["optimize", "scope"]]]
| Complete 6.5 Nested Data Structures
|
diff --git a/app/models/motd_formatter_rss.rb b/app/models/motd_formatter_rss.rb
index abc1234..def5678 100644
--- a/app/models/motd_formatter_rss.rb
+++ b/app/models/motd_formatter_rss.rb
@@ -6,11 +6,20 @@
# @param [MotdFile] motd_file an MotdFile object that contains a URI path to a message of the day in OSC format
def initialize(motd_file)
- feed = motd_file.content
- @content = RSS::Parser.parse(feed)
+ motd_file = MotdFile.new unless motd_file
+ @content = parse_rss(motd_file.content)
end
def to_partial_path
"dashboard/motd_rss"
end
+
+ private
+
+ def parse_rss(rss_content)
+ RSS::Parser.parse(rss_content)
+ rescue RSS::NotWellFormedError
+ Rails.logger.warn "MOTD is not parseable RSS"
+ RSS::Parser.parse("")
+ end
end
| Move parsing to private method
|
diff --git a/app/views/api/v1/items/show.rabl b/app/views/api/v1/items/show.rabl
index abc1234..def5678 100644
--- a/app/views/api/v1/items/show.rabl
+++ b/app/views/api/v1/items/show.rabl
@@ -1,12 +1,11 @@+cache @item
object @item => :items
attributes :id, :guid, :title, :description, :content, :link
node(:href) { |i| item_url(i) }
+node(:excerpt) { |i| i.to_s }
+node(:links) { |i| i.links.map(&:url) }
child :assets do
attributes :id, :mime, :url
end
-
-
-
-
| Add caching and a few elements to items
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.