diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/Casks/rubymine-bundled-jdk.rb b/Casks/rubymine-bundled-jdk.rb
index abc1234..def5678 100644
--- a/Casks/rubymine-bundled-jdk.rb
+++ b/Casks/rubymine-bundled-jdk.rb
@@ -0,0 +1,20 @@+cask :v1 => 'rubymine-bundled-jdk' do
+ version '7.1'
+ sha256 '2e9fced43c8e14ffbc82a72a8f6cde1cbab50861db079162ca5ff34c668ba57c'
+
+ url "https://download.jetbrains.com/ruby/RubyMine-#{version}-custom-jdk-bundled.dmg"
+ name 'RubyMine'
+ homepage 'https://www.jetbrains.com/ruby/'
+ license :commercial
+
+ app 'RubyMine.app'
+
+ zap :delete => [
+ '~/Library/Preferences/com.jetbrains.rubymine.plist',
+ '~/Library/Preferences/RubyMine70',
+ '~/Library/Application Support/RubyMine70',
+ '~/Library/Caches/RubyMine70',
+ '~/Library/Logs/RubyMine70',
+ '/usr/local/bin/mine',
+ ]
+end
|
Add cask for RubyMine with bundled JDK
|
diff --git a/db/migrate/20160415102439_create_local_authorities.rb b/db/migrate/20160415102439_create_local_authorities.rb
index abc1234..def5678 100644
--- a/db/migrate/20160415102439_create_local_authorities.rb
+++ b/db/migrate/20160415102439_create_local_authorities.rb
@@ -11,7 +11,7 @@ t.timestamps null: false
end
- add_index :local_authorities, :gss, :unique => true
- add_index :local_authorities, :snac, :unique => true
+ add_index :local_authorities, :gss, unique: true
+ add_index :local_authorities, :snac, unique: true
end
end
|
Fix syntax in local authority migration
Changed the create_local_authorities migration to use the new hash syntax
|
diff --git a/db/migrate/20190212154035_change_form_id_to_bigint.rb b/db/migrate/20190212154035_change_form_id_to_bigint.rb
index abc1234..def5678 100644
--- a/db/migrate/20190212154035_change_form_id_to_bigint.rb
+++ b/db/migrate/20190212154035_change_form_id_to_bigint.rb
@@ -0,0 +1,13 @@+class ChangeFormIdToBigint < ActiveRecord::Migration[6.0]
+ def up
+ change_column :forms, :id, :bigint
+
+ change_column :variable_forms, :form_id, :bigint
+ end
+
+ def down
+ change_column :forms, :id, :integer
+
+ change_column :variable_forms, :form_id, :integer
+ end
+end
|
Update form_id primary and foreign keys to bigint
|
diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb
index abc1234..def5678 100644
--- a/config/initializers/omniauth.rb
+++ b/config/initializers/omniauth.rb
@@ -2,3 +2,8 @@
cas_server = Rails.env == 'production' ? 'https://authentification-cerbere.application.i2/cas/' : 'http://localhost:9292'
Rails.application.config.middleware.use OmniAuth::Strategies::CAS, :cas_server => cas_server
+
+OmniAuth.config.full_host = Proc.new do |env|
+ url = env["rack.session"]["omniauth.origin"] || env["omniauth.origin"]
+ url.gsub(%r{/$})
+end
|
Configure OmniAuth.config.full_host so that the application can work behind a reverse proxy (we're redirected to request.url otherwise, which is an internal domain on a private port)
|
diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb
index abc1234..def5678 100644
--- a/config/initializers/omniauth.rb
+++ b/config/initializers/omniauth.rb
@@ -1,3 +1,6 @@+# Set OmniAuth to use Rails logger instead of STDOUT
+OmniAuth.config.logger = Rails.logger
+
Rails.application.config.middleware.use OmniAuth::Builder do
provider :spotify, ENV["SPOTIFY_CLIENT_ID"], ENV["SPOTIFY_CLIENT_SECRET"], scope: 'playlist-read-private playlist-modify-public playlist-modify-private user-library-read user-library-modify user-read-private user-read-email'
end
|
Set OmniAuth to use Rails logger
|
diff --git a/spec/factories/georgia/pages.rb b/spec/factories/georgia/pages.rb
index abc1234..def5678 100644
--- a/spec/factories/georgia/pages.rb
+++ b/spec/factories/georgia/pages.rb
@@ -2,6 +2,5 @@ factory :georgia_page, class: Georgia::Page do
template 'one-column'
sequence(:slug) {|n| "page#{n}"}
- association :status, factory: :georgia_status
end
end
|
Remove status on page factory
|
diff --git a/spec/factories/notifications.rb b/spec/factories/notifications.rb
index abc1234..def5678 100644
--- a/spec/factories/notifications.rb
+++ b/spec/factories/notifications.rb
@@ -9,8 +9,8 @@ end
factory :admin_notification do
- title { |n| "Admin Notification title #{n}" }
- body { |n| "Admin Notification body #{n}" }
+ sequence(:title) { |n| "Admin Notification title #{n}" }
+ sequence(:body) { |n| "Admin Notification body #{n}" }
link { nil }
segment_recipient { UserSegments::SEGMENTS.sample }
recipients_count { nil }
|
Fix missing sequences in notification factory
If we don't define a sequence, `n` becomes an object instead of a
number.
|
diff --git a/spec/factories/organizations.rb b/spec/factories/organizations.rb
index abc1234..def5678 100644
--- a/spec/factories/organizations.rb
+++ b/spec/factories/organizations.rb
@@ -1,6 +1,6 @@ FactoryGirl.define do
factory :organization do
- name { Faker::Company.name }
+ sequence(:name) { |n| "#{Faker::Company.name} #{n}" }
description { Faker::Lorem.paragraph }
# after(:create) do |organization|
|
Make test organization names more unique
The addition of a uniqueness validation on Organization#name is causing
a lot of random failures; the Organization factory uses a Faker value,
but appears to be producing repetitive results, so I've added a
FactoryGirl sequence to ensure uniqueness.
|
diff --git a/spec/yelp/client/search_spec.rb b/spec/yelp/client/search_spec.rb
index abc1234..def5678 100644
--- a/spec/yelp/client/search_spec.rb
+++ b/spec/yelp/client/search_spec.rb
@@ -1,10 +1,10 @@ require 'yelp'
describe Yelp::Client::Search do
- let(:keys) { Hash[consumer_key: 'abc',
- consumer_secret: 'def',
- token: 'ghi',
- token_secret: 'jkl'] }
+ let(:keys) { Hash[consumer_key: ENV['YELP_CONSUMER_KEY'],
+ consumer_secret: ENV['YELP_CONSUMER_SECRET'],
+ token: ENV['YELP_TOKEN'],
+ token_secret: ENV['YELP_TOKEN_SECRET']] }
let(:location) { 'San Francisco' }
let(:params) { Hash[term: 'restaurants',
category_filter: 'discgolf'] }
|
Use ENV for api keys in testing
|
diff --git a/slugworth.gemspec b/slugworth.gemspec
index abc1234..def5678 100644
--- a/slugworth.gemspec
+++ b/slugworth.gemspec
@@ -1,7 +1,7 @@ # coding: utf-8
-lib = File.expand_path('../lib', __FILE__)
+lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
-require 'slugworth/version'
+require "slugworth/version"
Gem::Specification.new do |spec|
spec.name = "slugworth"
@@ -17,13 +17,13 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]
- spec.required_ruby_version = '>= 1.9.2'
+ spec.required_ruby_version = ">= 1.9.2"
spec.add_development_dependency "bundler", "~> 1.3"
spec.add_development_dependency "rake"
spec.add_development_dependency "rspec", "~> 2.13"
- spec.add_development_dependency 'activerecord', '~> 4.0.0'
+ spec.add_development_dependency "activerecord", "~> 4.0.0"
spec.add_development_dependency "pry"
- spec.add_development_dependency "database_cleaner", '~> 1.0.1'
+ spec.add_development_dependency "database_cleaner", "~> 1.0.1"
spec.add_development_dependency "sqlite3"
end
|
Use double quotes consistently in gemspec
|
diff --git a/dummy/spec/helpers/application_helper_spec.rb b/dummy/spec/helpers/application_helper_spec.rb
index abc1234..def5678 100644
--- a/dummy/spec/helpers/application_helper_spec.rb
+++ b/dummy/spec/helpers/application_helper_spec.rb
@@ -9,15 +9,15 @@ describe ApplicationHelper do
describe '#general_attribute?' do
it 'principally works' do
- general_attribute?(:state).should == true
- general_attribute?(:limit).should == false
+ helper.general_attribute?(:state).should == true
+ helper.general_attribute?(:limit).should == false
end
end
describe '#attribute_translation' do
it 'principally works' do
- attribute_translation(:state).should == 'State'
- attribute_translation(:limit).should == 'Limit'
+ helper.attribute_translation(:state).should == 'State'
+ helper.attribute_translation(:limit).should == 'Limit'
end
end
end
|
Call helper methods on helper instance.
|
diff --git a/error_data.gemspec b/error_data.gemspec
index abc1234..def5678 100644
--- a/error_data.gemspec
+++ b/error_data.gemspec
@@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = 'error_data'
- s.version = '0.1.0.1'
+ s.version = '0.2.0.0'
s.summary = 'Representation of an error as a data structure'
s.description = ' '
|
Package version is increased from 0.1.0.1 to 0.2.0.0
|
diff --git a/spec/models/board_spec.rb b/spec/models/board_spec.rb
index abc1234..def5678 100644
--- a/spec/models/board_spec.rb
+++ b/spec/models/board_spec.rb
@@ -8,28 +8,4 @@ expect(board.ships.size).to eq 5
end
- context 'belonging to player' do
- let(:player_board) { create :board, opponent?: false }
-
- it 'holds visible ships once placed' do
- expect(player_board.patrol_boat.visible?).to eq true
- expect(player_board.destroyer.visible?).to eq true
- expect(player_board.submarine.visible?).to eq true
- expect(player_board.battleship.visible?).to eq true
- expect(player_board.aircraft_carrier.visible?).to eq true
- end
- end
-
- context 'belonging to opponent' do
- let(:opponent_board) { create :board, opponent?: true }
-
- it 'holds invisible ships' do
- expect(opponent_board.patrol_boat.visible?).to eq false
- expect(opponent_board.destroyer.visible?).to eq false
- expect(opponent_board.submarine.visible?).to eq false
- expect(opponent_board.battleship.visible?).to eq false
- expect(opponent_board.aircraft_carrier.visible?).to eq false
- end
- end
-
end
|
Delete unused visible? method tests
|
diff --git a/spec/system/basic_spec.rb b/spec/system/basic_spec.rb
index abc1234..def5678 100644
--- a/spec/system/basic_spec.rb
+++ b/spec/system/basic_spec.rb
@@ -7,7 +7,7 @@ EOS
puppet_apply(pp) do |r|
- r.exit_code.should == 2
+ r.exit_code.should == 0
end
end
end
|
Adjust exit code for basic spec:system test
This class shouldn't make any changes when applied to a fresh system because
the default manifest behaviour matches the stock install.
|
diff --git a/examples/logger.rb b/examples/logger.rb
index abc1234..def5678 100644
--- a/examples/logger.rb
+++ b/examples/logger.rb
@@ -4,6 +4,8 @@ require_relative '../lib/tty-command'
logger = Logger.new('dev.log')
+logger.level = Logger::WARN
+logger.warn("Logger captured:")
cmd = TTY::Command.new(output: logger, color: false)
|
Change example to demonstrate log level has no impact on logging behaviour
|
diff --git a/spec/factories.rb b/spec/factories.rb
index abc1234..def5678 100644
--- a/spec/factories.rb
+++ b/spec/factories.rb
@@ -1,7 +1,7 @@ FactoryGirl.define do
factory :user do
sequence(:username) { |n| "user#{n}"}
- # sequence(:email) {|n| "email#{n}@gmail.com" }
+ sequence(:email) {|n| "email#{n}@gmail.com" }
password "password"
end
@@ -21,6 +21,8 @@
factory :comment do
sequence(:content) {|n| "Here is comment no. #{n}."}
+ commentable_id 1
+ commentable_type "Query"
end
end
|
Add info to comment factory
|
diff --git a/pact_broker/config.ru b/pact_broker/config.ru
index abc1234..def5678 100644
--- a/pact_broker/config.ru
+++ b/pact_broker/config.ru
@@ -27,13 +27,10 @@ }
app = PactBroker::App.new do | config |
- # change these from their default values if desired
- # config.log_dir = "./log"
- # config.auto_migrate_db = true
- # config.use_hal_browser = true
config.logger = ::Logger.new($stdout)
config.logger.level = Logger::WARN
config.database_connection = Sequel.connect(DATABASE_CREDENTIALS.merge(logger: DatabaseLogger.new(config.logger), encoding: 'utf8'))
+ config.database_connection.timezone = :utc
end
run app
|
Set database connection timezone to UTC
This is required for consistent timezone behaviour.
|
diff --git a/lib/altria/git/repository.rb b/lib/altria/git/repository.rb
index abc1234..def5678 100644
--- a/lib/altria/git/repository.rb
+++ b/lib/altria/git/repository.rb
@@ -62,7 +62,7 @@ end
def update_revision
- job.current_build.update_properties(revision: revision)
+ job.current_build.try(:update_properties, revision: revision)
end
end
end
|
Fix the nil error case with no current build
|
diff --git a/lib/instana/frameworks/rails.rb b/lib/instana/frameworks/rails.rb
index abc1234..def5678 100644
--- a/lib/instana/frameworks/rails.rb
+++ b/lib/instana/frameworks/rails.rb
@@ -20,6 +20,7 @@ config.after_initialize do
require "instana/frameworks/instrumentation/active_record"
require "instana/frameworks/instrumentation/action_controller"
+ require "instana/frameworks/instrumentation/action_view"
end
end
end
|
Load ActionView instrumentation after Rails initialization
|
diff --git a/lib/brightbox-cli/logging.rb b/lib/brightbox-cli/logging.rb
index abc1234..def5678 100644
--- a/lib/brightbox-cli/logging.rb
+++ b/lib/brightbox-cli/logging.rb
@@ -13,9 +13,9 @@ end
def info(s='')
- STDERR.write s
- STDERR.write "\n"
- STDERR.flush
+ $stderr.write s
+ $stderr.write "\n"
+ $stderr.flush
end
def warn(s='')
@@ -29,9 +29,9 @@
def debug(s)
if ENV['DEBUG']
- STDERR.write "DEBUG: "
- STDERR.write s
- STDERR.write "\n"
+ $stderr.write "DEBUG: "
+ $stderr.write s
+ $stderr.write "\n"
end
end
end
|
Use globals rather than constants for IO
Normally STDOUT == $stdout so they can be used interchangably. Trying to
test the captured output and it is inconsistent because we are logging
to either STDOUT or $stdout (or the err version).
This makes it impossible to capture ALL output and check since the IO is
a mixture.
We can't cleanly reset the constants so using the globals.
|
diff --git a/lib/rrj/janus/response_error.rb b/lib/rrj/janus/response_error.rb
index abc1234..def5678 100644
--- a/lib/rrj/janus/response_error.rb
+++ b/lib/rrj/janus/response_error.rb
@@ -0,0 +1,29 @@+# frozen_string_literal: true
+
+require 'bunny'
+
+module RubyRabbitmqJanus
+ # @author VAILLANT Jeremy <jeremy.vaillant@dazzl.tv>
+ # Class for test if response return an janus error
+ class ResponseError
+ # Return an Hash to request
+ def initialize(request)
+ @request = Has.new(request)
+ end
+
+ # Test if response is an error
+ def test_request_return
+ @request['janus'] == 'error' ? true : false
+ end
+
+ # Return a reaon to error returning by janus
+ def reason
+ @request['error']['reason']
+ end
+
+ # Return a code to error returning by janus
+ def code
+ @request['error']['code']
+ end
+ end
+end
|
Add class for test response janus is an error
|
diff --git a/test/unit/recipes/default_spec.rb b/test/unit/recipes/default_spec.rb
index abc1234..def5678 100644
--- a/test/unit/recipes/default_spec.rb
+++ b/test/unit/recipes/default_spec.rb
@@ -1,8 +1,14 @@ require 'spec_helper'
describe 'g5-postgresql::default' do
+ before do
+ # Stub command that cookbook uses to determine if postgresql is
+ # already installed
+ stub_command('ls /var/lib/postgresql/9.3/main/recovery.conf').and_return('')
+ end
+
let(:chef_run) do
- ChefSpec::Runner.new do |node|
+ ChefSpec::SoloRunner.new do |node|
node.set['postgresql']['password']['postgres'] = postgres_password
end.converge(described_recipe)
end
|
Update unit tests for latest version of chefspec
|
diff --git a/lib/stacker/stack/parameters.rb b/lib/stacker/stack/parameters.rb
index abc1234..def5678 100644
--- a/lib/stacker/stack/parameters.rb
+++ b/lib/stacker/stack/parameters.rb
@@ -9,35 +9,54 @@
extend Memoist
- def available
- @available ||= stack.region.defaults.fetch('Parameters', {}).merge(
- stack.options.fetch('Parameters', {})
- )
+ # everything required by the template
+ def template_definitions
+ stack.template.local.fetch 'Parameters', {}
end
- def required
- @required ||= stack.template.local.fetch 'Parameters', {}
+ def region_defaults
+ stack.region.defaults.fetch 'parameters', {}
end
+ # template defaults merged with region and stack-specific overrides
def local
- @local ||= available.slice *required.keys
+ region_defaults = stack.region.defaults.fetch 'parameters', {}
+
+ template_defaults = Hash[
+ template_definitions.select { |_, opts|
+ opts.key?('Default')
+ }.map { |name, opts|
+ [name, opts['Default']]
+ }
+ ]
+
+ available = region_defaults.merge(
+ template_defaults.merge(
+ stack.options.fetch 'parameters', {}
+ )
+ )
+
+ available.slice *template_definitions.keys
end
def missing
- @missing ||= required.keys - local.keys
+ template_definitions.keys - local.keys
end
def remote
- @remote ||= client.parameters
+ client.parameters
end
+ memoize :remote
def resolved
- @resolved ||= resolver.resolved
+ resolver.resolved
end
+ memoize :resolved
def resolver
- @resolver ||= Resolver.new stack.region, local
+ Resolver.new stack.region, local
end
+ memoize :resolver
def diff *args
Differ.yaml_diff Hash[resolved.sort], Hash[remote.sort], *args
|
Use template default values, when available
AWS will set the defaults if we don't. Might as well. The diff will
now also accurately reflect what's being changed.
Signed-off-by: Evan Owen <a31932a4150a6c43f7c4879727da9a731c3d5877@gmail.com>
|
diff --git a/lib/toy_robot_simulator/view.rb b/lib/toy_robot_simulator/view.rb
index abc1234..def5678 100644
--- a/lib/toy_robot_simulator/view.rb
+++ b/lib/toy_robot_simulator/view.rb
@@ -0,0 +1,20 @@+View = Struct.new(:args) do
+ def report
+ report = robot.report
+ output.puts report_string(report) if report
+ end
+
+ private
+
+ def report_string(report)
+ "(#{report[:x]},#{report[:y]}) #{report[:orientation].upcase}"
+ end
+
+ def robot
+ args[:robot]
+ end
+
+ def output
+ args[:output] || $stdout
+ end
+end
|
Implement View according to ViewTest
|
diff --git a/spec/lib/coins_spec.rb b/spec/lib/coins_spec.rb
index abc1234..def5678 100644
--- a/spec/lib/coins_spec.rb
+++ b/spec/lib/coins_spec.rb
@@ -11,6 +11,11 @@ coins = { '2_pence' => 2, '1_pence' => 0 }
expect(@coins.return_minimum_coins(pennies)).to eql(coins)
+
+ pennies = "9"
+ coins = { '2_pence' => 4, '1_pence' => 1 }
+
+ expect(@coins.return_minimum_coins(pennies)).to eql(coins)
end
end
end
|
Add additional test for single digit (9 pence)
|
diff --git a/spec/models/section.rb b/spec/models/section.rb
index abc1234..def5678 100644
--- a/spec/models/section.rb
+++ b/spec/models/section.rb
@@ -1,3 +1,5 @@+require File.expand_path('../content_item', __FILE__)
+
class Section < ActiveRecord::Base
include Ublisherp::PublishableWithInstanceShortcuts
|
Build on Travis doesn't find ContentItem for some reason
|
diff --git a/lib/peribot/error_helpers.rb b/lib/peribot/error_helpers.rb
index abc1234..def5678 100644
--- a/lib/peribot/error_helpers.rb
+++ b/lib/peribot/error_helpers.rb
@@ -1,9 +1,10 @@ module Peribot
- # A module to provide standard functionality for printing error messages
- # within Peribot components. It assumes the presence of a #bot accessor
- # method that returns a Peribot instance with a #log method.
+ # ErrorHelpers provides standard functionality for printing relatively useful
+ # error messages from processors. This is part of Peribot's general
+ # log-and-ignore exception handling strategy.
#
- # This module is designed primarily for internal use.
+ # This module is designed and intended for internal use within Peribot. It is
+ # not considered public, and the API is not guaranteed to be stable.
module ErrorHelpers
private
|
Clean up docs for ErrorHelpers
Just some minor documentation changes to ensure things are up to date.
|
diff --git a/rest/rest_server.rb b/rest/rest_server.rb
index abc1234..def5678 100644
--- a/rest/rest_server.rb
+++ b/rest/rest_server.rb
@@ -1,4 +1,5 @@ require 'sinatra/base'
+require 'json'
require 'rest/helpers'
@@ -20,7 +21,7 @@
$session = Session.new
$session.users = data['users'].map { |e| User.new(e) } if data['users']
- '{}'
+ {}.to_json
end
post '/api/auth/login' do
@@ -33,13 +34,17 @@
token = session.create_token(user)
- %({"token": "#{token}"})
+ {
+ token: token
+ }.to_json
end
get '/api/gateway' do
session!
- 'wss://127.0.0.1:6602'
+ {
+ url: 'ws://127.0.0.1:6601/'
+ }.to_json
end
end
end
|
Use to_json to generate the REST responses
|
diff --git a/lib/simctl/command/create.rb b/lib/simctl/command/create.rb
index abc1234..def5678 100644
--- a/lib/simctl/command/create.rb
+++ b/lib/simctl/command/create.rb
@@ -24,9 +24,10 @@ # @yield [exception] an exception that might happen during shutdown/delete of the old device
def reset_device(name, device_type, runtime)
begin
- device = device(name: name, os: runtime.name)
- device.shutdown! if device.state != 'Shutdown'
- device.delete!
+ SimCtl.list_devices.where(name: name, os: runtime.name).each do |device|
+ device.shutdown! if device.state != 'Shutdown'
+ device.delete!
+ end
rescue Exception => exception
yield exception if block_given?
end
|
Delete all matching devices in reset_device
|
diff --git a/Aperitif.podspec b/Aperitif.podspec
index abc1234..def5678 100644
--- a/Aperitif.podspec
+++ b/Aperitif.podspec
@@ -5,7 +5,7 @@ s.homepage = 'http://github.com/crushlovely/Aperitif'
s.license = 'MIT'
s.authors = { 'Crush & Lovely' => 'engineering@crushlovely.com', 'Tim Clem' => 'tim@crushlovely.com' }
- s.source = { :git => 'https://github.com/crushlovely/Aperitif.git', :branch => 'master' }
+ s.source = { :git => 'https://github.com/crushlovely/Aperitif.git', :tag => "v#{s.version}" }
s.platform = :ios, '7.0'
s.ios.deployment_target = '7.0'
|
Update podspec for going live
|
diff --git a/lib/tasks/delete_assets.rake b/lib/tasks/delete_assets.rake
index abc1234..def5678 100644
--- a/lib/tasks/delete_assets.rake
+++ b/lib/tasks/delete_assets.rake
@@ -5,7 +5,10 @@ task :delete_assets do
Resume::Output.raw_warning("Deleting assets in the tmpdir...")
+ # Remove all resume prefixed files and the font files used
+ # in the Japanese language resume.
File.delete(*Dir.glob(File.join(Dir.tmpdir, "resume_*")))
+ File.delete(*Dir.glob(File.join(Dir.tmpdir, "ipa?p.ttf")))
Resume::Output.raw_success("Successfully deleted assets")
end
|
Delete the Japanese font files from the tmp directory when doing a delete assets sweep
|
diff --git a/Casks/macdown.rb b/Casks/macdown.rb
index abc1234..def5678 100644
--- a/Casks/macdown.rb
+++ b/Casks/macdown.rb
@@ -9,4 +9,7 @@ license :mit
app 'MacDown.app'
+
+ zap :delete => ['~/Library/Preferences/com.uranusjr.macdown.plist',
+ '~/Library/Application Support/MacDown']
end
|
Add zap procedures for MacDown
|
diff --git a/Formula/xdebug.rb b/Formula/xdebug.rb
index abc1234..def5678 100644
--- a/Formula/xdebug.rb
+++ b/Formula/xdebug.rb
@@ -7,6 +7,9 @@
def install
Dir.chdir 'xdebug-2.0.5' do
+ # See http://github.com/mxcl/homebrew/issues/#issue/69
+ ENV.universal_binary unless Hardware.is_64_bit?
+
system "phpize"
system "./configure", "--prefix=#{prefix}", "--disable-debug", "--disable-dependency-tracking",
"--enable-xdebug"
@@ -17,14 +20,14 @@
def caveats
<<-END_CAVEATS
- Add the following line to php.ini:
- zend_extension="#{prefix}/xdebug.so"
+Add the following line to php.ini:
- Restart your webserver.
+ zend_extension="#{prefix}/xdebug.so"
- Write a PHP page that calls "phpinfo();" Load it in a browser and
- look for the info on the xdebug module. If you see it, you have been
- successful!
+Restart your webserver.
+
+Write a PHP page that calls "phpinfo();" Load it in a browser and look for the
+info on the xdebug module. If you see it, you have been successful!
END_CAVEATS
end
end
|
Build a universal binary on Leopard
Fixes #69
|
diff --git a/IDPDesign.podspec b/IDPDesign.podspec
index abc1234..def5678 100644
--- a/IDPDesign.podspec
+++ b/IDPDesign.podspec
@@ -13,9 +13,9 @@
# Platform setup
s.requires_arc = true
- s.ios.deployment_target = '8.0'
+ s.ios.deployment_target = '10.0'
s.osx.deployment_target = '10.9'
- s.tvos.deployment_target = '9.0'
+ s.tvos.deployment_target = '10.0'
# Preserve the layout of headers in the Module directory
s.header_mappings_dir = 'IDPDesign'
|
Update min iOS version to 10.0
|
diff --git a/TodUni/app/models/project.rb b/TodUni/app/models/project.rb
index abc1234..def5678 100644
--- a/TodUni/app/models/project.rb
+++ b/TodUni/app/models/project.rb
@@ -1,6 +1,6 @@ class Project < ActiveRecord::Base
acts_as_taggable_on :tags
- enum status: [:en_progreso, :terminado, :cancelado]
+ enum status: [:preproyecto, :en_progreso, :terminado, :cancelado]
has_and_belongs_to_many :users
has_many :stages
|
Add 'preproyecto' status to Proyecto's status enum
|
diff --git a/roles/hostedinnz.rb b/roles/hostedinnz.rb
index abc1234..def5678 100644
--- a/roles/hostedinnz.rb
+++ b/roles/hostedinnz.rb
@@ -2,6 +2,11 @@ description "Role applied to all servers at HostedIn.NZ"
default_attributes(
+ :accounts => {
+ :users => {
+ :asmith => { :status => :administrator }
+ }
+ },
:hosted_by => "HostedIn.NZ",
:location => "Wellington, New Zealand",
:networking => {
|
Add asmith as admin on HostedIn.NZ machines
|
diff --git a/app/controllers/audits_controller.rb b/app/controllers/audits_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/audits_controller.rb
+++ b/app/controllers/audits_controller.rb
@@ -5,7 +5,7 @@ if params[:start_date] and params[:end_date]
@start_date = parse_date params[:start_date]
@end_date = parse_date params[:end_date]
- @audits = Audit.where("created_at >= :start_date AND created_at <= :end_date", start_date: @start_date, end_date: @end_date)
+ @audits = Audit.where(created_at: (@start_date..@end_date))
else
@audits = Audit.all
end
|
Simplify the audits controller a bit more.
|
diff --git a/UIView-I7ShakeAnimation.podspec b/UIView-I7ShakeAnimation.podspec
index abc1234..def5678 100644
--- a/UIView-I7ShakeAnimation.podspec
+++ b/UIView-I7ShakeAnimation.podspec
@@ -1,12 +1,12 @@ Pod::Spec.new do |s|
s.name = "UIView-I7ShakeAnimation"
- s.version = "0.0.1"
+ s.version = "0.1"
s.summary = "very easy way to shake a UIView."
- s.homepage = "www.include7.ch"
+ s.homepage = "https://github.com/jonasschnelli/UIView-I7ShakeAnimation"
s.license = { :type => 'MIT', :file => 'LICENSE' }
- s.author = { "Jonas Schnelli" => "email@address.com" }
+ s.author = { "Jonas Schnelli" => "jonas.schnelli@include7.ch" }
s.platform = :ios, '5.0'
- s.source = { :git => "https://github.com/jonasschnelli/UIView-I7ShakeAnimation.git", :commit => "d203fc594ab438779d241b6e8f23c23367bbd366" }
+ s.source = { :git => "https://github.com/jonasschnelli/UIView-I7ShakeAnimation.git", :tag => "0.1" }
s.source_files = 'UIView+I7ShakeAnimation.{h,m}'
s.requires_arc = true
end
|
Podspec: Change email, homepage and version number
|
diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/home_controller.rb
+++ b/app/controllers/home_controller.rb
@@ -7,8 +7,8 @@ def index
@situation = Situation.find(params[:id] ? params[:id] : 1)
@last_situation = @situation.id
- @choice_1 = @situation.choice_1 ? @situation.choice_1 : "new?oid=#{@situation.id}"
- @choice_2 = @situation.choice_2 ? @situation.choice_2 : "new?oid=#{@situation.id}"
+ @choice_1 = (@situation.choice_1 && @situation.choice_1 != 0) ? @situation.choice_1 : "situations/new?oid=#{@situation.id}&obutton=1"
+ @choice_2 = (@situation.choice_2 && @situation.choice_2 != 0) ? @situation.choice_2 : "situations/new?oid=#{@situation.id}&obutton=2"
@choice_1_label = @situation.choice_1 ? @situation.choice_1_label : "Create '#{@situation.choice_1_label}'"
@choice_2_label = @situation.choice_2 ? @situation.choice_2_label : "Create '#{@situation.choice_2_label}'"
end
|
Fix link to create new from home view.
|
diff --git a/spec/app/models/log_spec.rb b/spec/app/models/log_spec.rb
index abc1234..def5678 100644
--- a/spec/app/models/log_spec.rb
+++ b/spec/app/models/log_spec.rb
@@ -5,7 +5,7 @@ it 'works when the collection exists' do
expect do
described_class.create_collection
- end.to change { Honeypot::Log.all.size }.by(0)
+ end.to change { described_class.all.size }.by(0)
end
it 'works when the collection exists but is not capped' do
@@ -16,4 +16,16 @@ end.to raise_error(Moped::Errors::OperationFailure)
end
end
+
+ let(:last_log) do
+ described_class.desc('_id').limit(1).first
+ end
+
+ it 'works with an array' do
+ data = { status: [1, 2, 3] }
+ expect do
+ described_class.create(data)
+ end.to change { described_class.all.size }.by(1)
+ expect(last_log.status).to eq(data[:status])
+ end
end
|
Add spec with an array
|
diff --git a/spec/player/options_spec.rb b/spec/player/options_spec.rb
index abc1234..def5678 100644
--- a/spec/player/options_spec.rb
+++ b/spec/player/options_spec.rb
@@ -24,4 +24,31 @@
it { assert_equal ['lorem', 'ipsum'], subject.words }
end
+
+ describe "information outputs" do
+ describe "help message" do
+ let(:opts) { ['-h'] }
+
+ it "should show help message" do
+ begin
+ out, err = capture_io { subject }
+
+ assert_match (/Guessing strategy for Hangman game/i), out
+ rescue SystemExit
+ end
+ end
+
+ describe "version" do
+ let(:opts) { ['-v'] }
+
+ it "should show gem version" do
+ begin
+ out, err = capture_io { subject }
+ assert_equal Hangman::VERSION, out
+ rescue SystemExit
+ end
+ end
+ end
+ end
+ end
end
|
Add more specs for option parser.
|
diff --git a/app/helpers/blog_posts_helper.rb b/app/helpers/blog_posts_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/blog_posts_helper.rb
+++ b/app/helpers/blog_posts_helper.rb
@@ -1,2 +1,23 @@ module BlogPostsHelper
+
+ require 'redcarpet'
+
+ def parse_markdown(file_path)
+ @renderer ||= Redcarpet::Render::HTML.new(render_options)
+ @markdown ||= Redcarpet::Markdown.new(@renderer, markdown_options)
+ file = File.open(file_path, 'r') # Open the md file to read
+ file_content = file.read # Read all lines
+ file.close # And we are done
+ @markdown.render(file_content).html_safe
+ end
+
+ private
+
+ def render_options
+ {} # TODO: get these from config
+ end
+
+ def markdown_options
+ {} # TODO: get these from config
+ end
end
|
Add helper method to parse markdown files
Adds a helper method `parse_markdown` to BlogPosts that reads markdown
files and creates html rederable output (that will not be escaped by
rails automatically)
Includes stub methods for getting render options, and getting markdown
options.
|
diff --git a/spec/stamp_changelog_action_spec.rb b/spec/stamp_changelog_action_spec.rb
index abc1234..def5678 100644
--- a/spec/stamp_changelog_action_spec.rb
+++ b/spec/stamp_changelog_action_spec.rb
@@ -0,0 +1,52 @@+describe Fastlane::Actions::StampChangelogAction do
+ describe 'Stamp CHANGELOG.md action' do
+
+ let (:changelog_mock_path) {'./fastlane-plugin-changelog/spec/fixtures/CHANGELOG_MOCK.md'}
+ let (:changelog_mock_path_hook) {'./spec/fixtures/CHANGELOG_MOCK.md'}
+ let (:updated_section_identifier) {'12.34.56'}
+
+ before(:each) do
+ @original_content = File.read(changelog_mock_path_hook)
+ end
+
+ after(:each) do
+ File.open(changelog_mock_path_hook, 'w') {|f| f.write(@original_content) }
+ end
+
+ it 'stamps [Unreleased] section with given identifier' do
+ # Read what's in [Unreleased]
+ read_result = Fastlane::FastFile.new.parse("lane :test do
+ read_changelog(changelog_path: '#{changelog_mock_path}')
+ end").runner.execute(:test)
+
+ # Stamp [Unreleased] with given section identifier
+ Fastlane::FastFile.new.parse("lane :test do
+ stamp_changelog(changelog_path: '#{changelog_mock_path}',
+ section_identifier: '#{updated_section_identifier}')
+ end").runner.execute(:test)
+
+ # Read updated section
+ post_stamp_read_result = Fastlane::FastFile.new.parse("lane :test do
+ read_changelog(changelog_path: '#{changelog_mock_path}',
+ section_identifier: '[#{updated_section_identifier}]')
+ end").runner.execute(:test)
+
+ expect(read_result).to eq(post_stamp_read_result)
+ end
+
+ it 'creates an empty [Unreleased] section', :now => true do
+ # Stamp [Unreleased] with given section identifier
+ Fastlane::FastFile.new.parse("lane :test do
+ stamp_changelog(changelog_path: '#{changelog_mock_path}',
+ section_identifier: '#{updated_section_identifier}')
+ end").runner.execute(:test)
+
+ # Read what's in [Unreleased]
+ read_result = Fastlane::FastFile.new.parse("lane :test do
+ read_changelog(changelog_path: '#{changelog_mock_path}')
+ end").runner.execute(:test)
+
+ expect(read_result).to eq("\n")
+ end
+ end
+end
|
Add unit tests for stamp_changelog action
|
diff --git a/app/models/concerns/repo_tags.rb b/app/models/concerns/repo_tags.rb
index abc1234..def5678 100644
--- a/app/models/concerns/repo_tags.rb
+++ b/app/models/concerns/repo_tags.rb
@@ -2,7 +2,7 @@ def download_tags(token = nil)
existing_tag_names = github_tags.pluck(:name)
github_client(token).refs(full_name, 'tags').each do |tag|
- next unless tag['ref']
+ next unless tag && tag['ref']
download_tag(token, tag, existing_tag_names)
end
rescue *GithubRepository::IGNORABLE_GITHUB_EXCEPTIONS
|
Fix checking for misisng attribute on git tags
|
diff --git a/app/helpers/cms/users_helper.rb b/app/helpers/cms/users_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/cms/users_helper.rb
+++ b/app/helpers/cms/users_helper.rb
@@ -11,7 +11,7 @@ link_to(
'Mark Complete',
complete_sales_stage_cms_user_path(sales_stage_id: stage.id),
- method: :post
+ { method: :post, data: { confirm: 'Mark stage as completed?' } }
)
end
|
Add confirmation alert when marking stage complete
|
diff --git a/base/db/migrate/20120621135650_add_comment_count_to_activity_object.rb b/base/db/migrate/20120621135650_add_comment_count_to_activity_object.rb
index abc1234..def5678 100644
--- a/base/db/migrate/20120621135650_add_comment_count_to_activity_object.rb
+++ b/base/db/migrate/20120621135650_add_comment_count_to_activity_object.rb
@@ -11,9 +11,7 @@ # Actors have not parent activities
next if parent_activity.blank?
- ao.comment_count = Activity.includes(:activity_objects).where('activity_objects.object_type' => "Comment").where(:ancestry => [parent_activity.id]).size
-
- ao.save! if ao.comment_count > 0
+ ao.update_attribute(:comment_count, Activity.includes(:activity_objects).where('activity_objects.object_type' => "Comment").where(:ancestry => [parent_activity.id]).size)
end
ActivityObject.record_timestamps = true
|
Make migration resistant to validations
|
diff --git a/core/app/models/spree/gateway.rb b/core/app/models/spree/gateway.rb
index abc1234..def5678 100644
--- a/core/app/models/spree/gateway.rb
+++ b/core/app/models/spree/gateway.rb
@@ -1,6 +1,6 @@ module Spree
class Gateway < PaymentMethod
- delegate_belongs_to :provider, :authorize, :purchase, :capture, :void, :credit
+ delegate :authorize, :purchase, :capture, :void, :credit, to: :provider
validates :name, :type, presence: true
|
Use pure delegate in Spree::Gateway, compared with delegate_belongs_to
The provider method here is not a belongs_to association, so there's no good reason why we should be using delegate_belongs_to at all. Further more, delegate_belongs_to defines setters for these methods, but that is not necessary at all since these methods do not have setters!
|
diff --git a/spec/mobility/plugins/fallthrough_accessors_spec.rb b/spec/mobility/plugins/fallthrough_accessors_spec.rb
index abc1234..def5678 100644
--- a/spec/mobility/plugins/fallthrough_accessors_spec.rb
+++ b/spec/mobility/plugins/fallthrough_accessors_spec.rb
@@ -10,6 +10,22 @@ it_behaves_like "locale accessor", :title, :de
it_behaves_like "locale accessor", :title, :'pt-BR'
it_behaves_like "locale accessor", :title, :'ru'
+
+ it 'passes arguments and options to super when method does not match' do
+ mod = Module.new do
+ def method_missing(method_name, *_args, **options, &block)
+ (method_name == :foo) ? options : super
+ end
+ end
+
+ model_class.include mod
+ model_class.include attributes
+
+ instance = model_class.new
+
+ options = { some: 'params' }
+ expect(instance.foo(**options)).to eq(options)
+ end
end
context "option value is false" do
|
Add regression spec for passing options to super
|
diff --git a/proxyprotocol.gemspec b/proxyprotocol.gemspec
index abc1234..def5678 100644
--- a/proxyprotocol.gemspec
+++ b/proxyprotocol.gemspec
@@ -8,9 +8,8 @@ spec.version = Proxyprotocol::VERSION
spec.authors = ["Ómar Kjartan Yasin"]
spec.email = ["omarkj@gmail.com"]
- spec.summary = %q{TODO: Write a short summary. Required.}
- spec.description = %q{TODO: Write a longer description. Optional.}
- spec.homepage = ""
+ spec.summary = "A wrapper around TCPSocket that support the Proxy Protocol"
+ spec.homepage = "https://github.com/heroku/proxyprotocol"
spec.license = "MIT"
spec.files = `git ls-files -z`.split("\x0")
@@ -21,4 +20,4 @@ spec.add_development_dependency "bundler", "~> 1.5"
spec.add_development_dependency "rake"
spec.add_development_dependency "rspec"
-end
+end
|
Add a description and homepage to the gemspec.
|
diff --git a/lib/buildr_plus/roles/replicant_qa_support.rb b/lib/buildr_plus/roles/replicant_qa_support.rb
index abc1234..def5678 100644
--- a/lib/buildr_plus/roles/replicant_qa_support.rb
+++ b/lib/buildr_plus/roles/replicant_qa_support.rb
@@ -18,7 +18,7 @@
if BuildrPlus::FeatureManager.activated?(:domgen)
generators = []
- generators += [:imit_client_test_qa_external, :imit_client_main_qa_external] if BuildrPlus::FeatureManager.activated?(:replicant)
+ generators += [:imit_client_main_qa_external] if BuildrPlus::FeatureManager.activated?(:replicant)
generators += project.additional_domgen_generators
Domgen::Build.define_generate_task(generators, :buildr_project => project) do |t|
t.filter = project.domgen_filter
|
Stop duplicate generation of code
|
diff --git a/actionpack-page_caching.gemspec b/actionpack-page_caching.gemspec
index abc1234..def5678 100644
--- a/actionpack-page_caching.gemspec
+++ b/actionpack-page_caching.gemspec
@@ -8,6 +8,7 @@ gem.description = 'Static page caching for Action Pack (removed from core in Rails 4.0)'
gem.summary = 'Static page caching for Action Pack (removed from core in Rails 4.0)'
gem.homepage = 'https://github.com/rails/actionpack-page_caching'
+ gem.license = 'MIT'
gem.files = `git ls-files`.split($/)
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
Add license information to gemspec.
Fixes #9.
|
diff --git a/lib/capistrano/tasks/db.rake b/lib/capistrano/tasks/db.rake
index abc1234..def5678 100644
--- a/lib/capistrano/tasks/db.rake
+++ b/lib/capistrano/tasks/db.rake
@@ -5,9 +5,9 @@ desc 'copy local data files to remote server'
task :copy_data_to_remote do
on roles(:all) do
- upload!('data/data.sql', "#{shared_path}/data/data.sql")
+ upload!('data/data.sql', "#{shared_path}/public/data/data.sql")
%w(interactions categories genes drugs).each do |type|
- upload!("data/#{type}.tsv", "#{shared_path}/data/#{type}.tsv")
+ upload!("data/#{type}.tsv", "#{shared_path}/public/data/#{type}.tsv")
end
end
end
|
Copy data tsv and sql files to the public folder
|
diff --git a/lib/cucumber-puppet/steps.rb b/lib/cucumber-puppet/steps.rb
index abc1234..def5678 100644
--- a/lib/cucumber-puppet/steps.rb
+++ b/lib/cucumber-puppet/steps.rb
@@ -2,7 +2,7 @@ # file: yaml node file
fail("Cannot find node facts #{file}.") unless File.exist?(file)
@node = YAML.load_file(file)
- file("Invalid node file #{file}, this should come from " +
+ fail("Invalid node file #{file}, this should come from " +
"/var/lib/puppet/yaml/node.") unless @node.is_a?(Puppet::Node)
end
|
Fix an undefined method error.
s/file/fail/
|
diff --git a/master_slave_adapter.gemspec b/master_slave_adapter.gemspec
index abc1234..def5678 100644
--- a/master_slave_adapter.gemspec
+++ b/master_slave_adapter.gemspec
@@ -4,17 +4,22 @@ Gem::Specification.new do |s|
s.name = 'master_slave_adapter_soundcloud'
s.version = File.read('VERSION').to_s
+ s.date = '2011-06-21'
s.platform = Gem::Platform::RUBY
s.authors = [ 'Mauricio Linhares', 'Torsten Curdt', 'Kim Altintop', 'Omid Aladini', 'SoundCloud' ]
s.email = %q{kim@soundcloud.com tcurdt@soundcloud.com omid@soundcloud.com}
s.homepage = 'http://github.com/soundcloud/master_slave_adapter'
- s.summary = %q{Replication Aware Master/Slave Database Adapter for Rails}
- s.description = %q{Totally Awesome}
+ s.summary = %q{Replication Aware Master/Slave Database Adapter for Rails/ActiveRecord}
+ s.description = %q{(MySQL) Replication Aware Master/Slave Database Adapter for Rails/ActiveRecord}
- s.files = `git ls-files`.split("\n")
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
- s.require_paths = [ "lib" ]
+ s.files = `git ls-files`.split("\n")
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
+ s.require_path = 'lib'
- s.add_dependency('activerecord', [ "= 2.3.9" ])
+ s.required_ruby_version = '>= 1.9.2'
+ s.required_rubygems_version = '1.3.7'
+ s.add_development_dependency 'rspec'
+
+ s.add_dependency 'activerecord', '= 2.3.9'
end
|
Tweak gemspec a little, trying to work around 'DefaultKey' issue, but to no avail
|
diff --git a/lib/inch/cli/trace_helper.rb b/lib/inch/cli/trace_helper.rb
index abc1234..def5678 100644
--- a/lib/inch/cli/trace_helper.rb
+++ b/lib/inch/cli/trace_helper.rb
@@ -26,7 +26,7 @@ end
def header(text, color)
- " ".method("on_#{color}").call +
+ "#".color(color).method("on_#{color}").call +
" #{text}".ljust(CLI::COLUMNS-1)
.black.dark.bold
.method("on_intense_#{color}").call
|
Update TraceHelper to make headers no-color compatible
|
diff --git a/test/prey_fetcher_test.rb b/test/prey_fetcher_test.rb
index abc1234..def5678 100644
--- a/test/prey_fetcher_test.rb
+++ b/test/prey_fetcher_test.rb
@@ -1,6 +1,6 @@ ENV['RACK_ENV'] = 'test'
-require File.join(File.dirname(__FILE__), '../', "prey_fetcher.rb")
+require File.join(File.dirname(__FILE__), '../', "web.rb")
require 'test/unit'
require 'rack/test'
@@ -28,19 +28,6 @@ assert !last_response.ok?
end
- def test_logout_works
- flunk 'Test is incomplete (requires sessions).'
-
- put '/login', {}, {:oauth_token => 'l9Ep677tgatsLlSc7PcJbMyXR41bVRwSTI1zLSrc', :oauth_verifier => '7T2JZoWeQCDAqiRnPCDuxki2LmsQAiUZ57bTSHaNbY'}
-
- assert session[:logged_in]
-
- get '/logout'
- follow_redirect!
- assert last_response.ok?
- assert !session[:logged_in]
- end
-
def test_logout_fails_as_anonymous
get '/logout'
assert !last_response.ok?
|
Remove cruddy tests; this needs some love
|
diff --git a/pullable.rb b/pullable.rb
index abc1234..def5678 100644
--- a/pullable.rb
+++ b/pullable.rb
@@ -13,17 +13,17 @@
if File.directory?('.git')
puts "Pulling: #{directory}"
- `git pull`
- `git remote prune origin`
+ `git fetch -p`
+ `git merge --ff-only origin/master`
end
-
- FileUtils.cd(root)
unless $?.success?
failed << directory
else
pulled << directory
end
+
+ FileUtils.cd(root)
else
skipped << directory
end
|
Use fetch, and ff-only merge
|
diff --git a/lib/siebel_donations/base.rb b/lib/siebel_donations/base.rb
index abc1234..def5678 100644
--- a/lib/siebel_donations/base.rb
+++ b/lib/siebel_donations/base.rb
@@ -20,6 +20,8 @@ case response.code
when 200
Oj.load(response)
+ when 400
+ raise RestClient::ExceptionWithResponse, response.to_s
else
puts response.inspect
puts request.inspect
|
Raise a useful exception when a 400 error occurs
|
diff --git a/lib/thumbor_rails/helpers.rb b/lib/thumbor_rails/helpers.rb
index abc1234..def5678 100644
--- a/lib/thumbor_rails/helpers.rb
+++ b/lib/thumbor_rails/helpers.rb
@@ -21,7 +21,7 @@ if host =~ /%d/
host = host % (Zlib.crc32(path) % 4)
end
- host + path
+ ENV.has_key?("DISABLE_THUMBOR") ? image_url : (host + path)
end
def thumbor_image_tag(image_url, options = {}, tag_attrs = {})
|
Add ability to disable Thumbor using an ENV variable
|
diff --git a/que.gemspec b/que.gemspec
index abc1234..def5678 100644
--- a/que.gemspec
+++ b/que.gemspec
@@ -13,7 +13,21 @@ spec.homepage = 'https://github.com/chanks/que'
spec.license = 'MIT'
- spec.files = `git ls-files`.split($/)
+ files_to_exclude = [
+ /\Adocs/,
+ /\A\.circleci/,
+ /\ACHANGELOG/,
+ /\AREADME/,
+ /\AGemfile/,
+ /\Aspec/,
+ /\Atasks/,
+ /spec\.rb\z/,
+ ]
+
+ spec.files = `git ls-files`.split($/).reject do |file|
+ files_to_exclude.any?{|r| r.match?(file)}
+ end
+
spec.executables = ['que']
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ['lib']
|
Drop a bunch of unnecessary files from built gems.
|
diff --git a/app/helpers/events_helper.rb b/app/helpers/events_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/events_helper.rb
+++ b/app/helpers/events_helper.rb
@@ -22,7 +22,7 @@ end
# Only show link if flyer approved
- def pubic_link_to_flyer(event)
+ def public_link_to_flyer(event)
if event && event.flyer_approved?
link_to_flyer event
end
|
Rename pubic_link_to_flyer to public_link_to_flyer. Haha.
|
diff --git a/app/helpers/events_helper.rb b/app/helpers/events_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/events_helper.rb
+++ b/app/helpers/events_helper.rb
@@ -10,7 +10,7 @@
def timeslots
slots = Array.new
- @conference.max_timeslots.times do |i|
+ (@conference.max_timeslots+1).times do |i|
slots << [format_time_slots(i), i]
end
slots
|
Fix off-by-one in max timeslot selection
|
diff --git a/lib/tty/table/border/null.rb b/lib/tty/table/border/null.rb
index abc1234..def5678 100644
--- a/lib/tty/table/border/null.rb
+++ b/lib/tty/table/border/null.rb
@@ -6,12 +6,6 @@
# A class that represents no border.
class Null < Border
-
- # @api private
- def initialize(row)
- @row = row
- @widths = row.map { |cell| cell.chars.to_a.size }
- end
# A stub top line
#
|
Remove initialization, no longer needed.
|
diff --git a/app/lib/markdown_renderer.rb b/app/lib/markdown_renderer.rb
index abc1234..def5678 100644
--- a/app/lib/markdown_renderer.rb
+++ b/app/lib/markdown_renderer.rb
@@ -10,7 +10,7 @@ if title =~ /\A[a-f0-9-]{36}\z/i
image = Medium.where(id: title).first
if image
- image_tag(image.file.url(:large), alt: image.default_alt, class: alt_text)
+ image_tag(image.file.url(:post), alt: image.default_alt, class: alt_text)
else
""
end
|
Use post size medium by default
|
diff --git a/app/models/editor_request.rb b/app/models/editor_request.rb
index abc1234..def5678 100644
--- a/app/models/editor_request.rb
+++ b/app/models/editor_request.rb
@@ -11,6 +11,8 @@ validates_presence_of :token
before_save :destroy_duplicates
+
+ named_scope :expired, lambda { { :conditions => [ "expires_at <= ?", ASSOCIATION.now ] } }
# Set to expire in 1 week. Auto-set token.
def before_validation
|
Add expired scope to EditroRequests
|
diff --git a/app/models/mention_mailer.rb b/app/models/mention_mailer.rb
index abc1234..def5678 100644
--- a/app/models/mention_mailer.rb
+++ b/app/models/mention_mailer.rb
@@ -9,6 +9,6 @@ def notify_mentioning(issue, journal, user)
@issue = issue
@journal = journal
- mail(to: user.mail, subject: "You were mentioned in a note")
+ mail(to: user.mail, subject: "You were mentioned in a note on issue #{@issue.id}")
end
-end+end
|
Add issue number to email subject.
|
diff --git a/lib/volt/volt/environment.rb b/lib/volt/volt/environment.rb
index abc1234..def5678 100644
--- a/lib/volt/volt/environment.rb
+++ b/lib/volt/volt/environment.rb
@@ -1,7 +1,8 @@ module Volt
class Environment
def initialize
- @env = ENV['VOLT_ENV']
+ # Use VOLT_ENV or RACK_ENV to set the environment
+ @env = ENV['VOLT_ENV'] || ENV['RACK_ENV']
# If we're in opal, we can set the env from JS before opal loads
if RUBY_PLATFORM == 'opal'
|
Allow Volt.env to be set by RACK_ENV also. This makes heroku work out of the box for example.
|
diff --git a/lib/rescue_from_duplicate/active_record.rb b/lib/rescue_from_duplicate/active_record.rb
index abc1234..def5678 100644
--- a/lib/rescue_from_duplicate/active_record.rb
+++ b/lib/rescue_from_duplicate/active_record.rb
@@ -7,8 +7,9 @@ end
def self.missing_unique_indexes
- klasses = ::ActiveRecord::Base.subclasses.select do |klass|
- klass.validators.any? {|v| v.is_a?(::ActiveRecord::Validations::UniquenessValidator) || klass._rescue_from_duplicates.any? }
+ ar_subclasses = ObjectSpace.each_object(Class).select{ |klass| klass < ::ActiveRecord::Base }
+ klasses = ar_subclasses.select do |klass|
+ klass.validators.any? { |v| v.is_a?(::ActiveRecord::Validations::UniquenessValidator) || klass._rescue_from_duplicates.any? }
end
missing_unique_indexes = []
|
Use all subclasses of AR::Base, not just direct descendants
|
diff --git a/lib/solidus_subscriptions/order_creator.rb b/lib/solidus_subscriptions/order_creator.rb
index abc1234..def5678 100644
--- a/lib/solidus_subscriptions/order_creator.rb
+++ b/lib/solidus_subscriptions/order_creator.rb
@@ -18,7 +18,7 @@ )
end
- protected
+ private
def extra_attributes
{}
|
Change accessiblity of SolidusSubscriptions::OrderCreator from protected to private
|
diff --git a/app/helpers/dashboard_helper.rb b/app/helpers/dashboard_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/dashboard_helper.rb
+++ b/app/helpers/dashboard_helper.rb
@@ -22,6 +22,7 @@ end
def format_info_refresh_policy(refresh_policy)
+ return "manually only" if refresh_policy.blank?
refresh_policy_str = distance_of_time_in_words(refresh_policy[:every]).gsub('about', '')
str = "every <b>#{refresh_policy_str}</b>"
str += " at <b>#{format_at(refresh_policy[:at])}</b>" if !refresh_policy[:at].blank?
|
Fix refresh plan display when no plan is defined for chart
|
diff --git a/app/helpers/relations_helper.rb b/app/helpers/relations_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/relations_helper.rb
+++ b/app/helpers/relations_helper.rb
@@ -1,2 +1,10 @@ module RelationsHelper
+
+ def format_date_for(relation)
+ if relation.to.nil?
+ return "#{relation.from}"
+ else
+ return "#{relation.from} - #{relation.to}"
+ end
+ end
end
|
Create format_date_for helper to get formatted date in relations
|
diff --git a/rails-flog.gemspec b/rails-flog.gemspec
index abc1234..def5678 100644
--- a/rails-flog.gemspec
+++ b/rails-flog.gemspec
@@ -19,7 +19,7 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ['lib']
- spec.add_development_dependency 'bundler', '~> 2.0'
+ spec.add_development_dependency 'bundler'
spec.add_development_dependency 'coveralls'
spec.add_development_dependency 'minitest'
spec.add_development_dependency 'rake'
|
Remove gem version specifiers of bundler
|
diff --git a/rails-i18n.gemspec b/rails-i18n.gemspec
index abc1234..def5678 100644
--- a/rails-i18n.gemspec
+++ b/rails-i18n.gemspec
@@ -2,12 +2,12 @@
Gem::Specification.new do |s|
s.name = "rails-i18n"
- s.version = '0.6'
+ s.version = '0.1.0'
s.authors = ["Rails I18n Group"]
s.email = "rails-i18n@googlegroups.com"
s.homepage = "http://github.com/svenfuchs/rails-i18n"
- s.summary = "New wave Internationalization support for Ruby on Rails"
- s.description = "New wave Internationalization support for Ruby on Rails."
+ s.summary = "Common locale data and translations for Rails i18n."
+ s.description = "A set of common locale data and translations to internationalize and/or localize your Rails applications."
s.files = Dir.glob("rails/locale/*") + %w(README.md MIT-LICENSE.txt lib/rails-i18n.rb)
s.platform = Gem::Platform::RUBY
|
Update the summary and description of gemspec
|
diff --git a/ruby-anything.gemspec b/ruby-anything.gemspec
index abc1234..def5678 100644
--- a/ruby-anything.gemspec
+++ b/ruby-anything.gemspec
@@ -17,5 +17,9 @@ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.require_paths = ["lib"]
+ if RUBY_VERSION >= '2.1'
+ gem.add_dependency "curses", "~> 1.0"
+ end
+
gem.add_development_dependency "rspec"
end
|
Support Ruby2.1. Add curses to dependencies.
|
diff --git a/recipes/service.rb b/recipes/service.rb
index abc1234..def5678 100644
--- a/recipes/service.rb
+++ b/recipes/service.rb
@@ -3,6 +3,15 @@ start_command = "#{node['marathon']['path']}/bin/start"
node['marathon']['options'].each do |opt, value|
start_command << " --#{opt} #{value}"
+end
+
+chefstart = "#{node['marathon']['path']}/bin/chef-start"
+file chefstart do
+ content start_command
+ mode '0755'
+ owner 'root'
+ group 'root'
+ notifies :restart, 'service[marathon]', :delayed
end
case node['marathon']['init']
@@ -11,19 +20,15 @@ after 'network.target'
wants 'network.target'
description 'Marathon framework'
- exec_start start_command
+ exec_start chefstart
restart 'always'
restart_sec node['marathon']['restart_sec']
action [:create, :enable, :start]
end
+ service 'marathon' do
+ action [:nothing]
+ end
when 'upstart'
- chefstart = "#{node['marathon']['path']}/bin/chef-start"
- file chefstart do
- content start_command
- mode '0755'
- owner 'root'
- group 'root'
- end
template '/etc/init/marathon.conf' do
source 'upstart.erb'
variables(command: chefstart)
|
Use chefstart file for systemd as well
|
diff --git a/app/models/deleted_dossier.rb b/app/models/deleted_dossier.rb
index abc1234..def5678 100644
--- a/app/models/deleted_dossier.rb
+++ b/app/models/deleted_dossier.rb
@@ -1,5 +1,7 @@ class DeletedDossier < ApplicationRecord
belongs_to :procedure
+
+ validates :dossier_id, uniqueness: true
enum reason: {
user_request: 'user_request',
|
Validate deleted dossiers dossier_id uniqueness
|
diff --git a/app/models/organization_user.rb b/app/models/organization_user.rb
index abc1234..def5678 100644
--- a/app/models/organization_user.rb
+++ b/app/models/organization_user.rb
@@ -1,6 +1,8 @@ class OrganizationUser < ActiveRecord::Base
belongs_to :organization
belongs_to :user
+ validates :organization_id, uniqueness: { scope: :user_id,
+ message: "already has a user with this email" }
def invite_mailer(invited_by)
OrganizationUserMailer.invite(self, invited_by)
|
Add validation to Organization User for org and user ID
|
diff --git a/app/models/day.rb b/app/models/day.rb
index abc1234..def5678 100644
--- a/app/models/day.rb
+++ b/app/models/day.rb
@@ -5,5 +5,7 @@ def create_bookings
BookingTemplate.create_booking('day:cash', :amount => cash, :value_date => date)
BookingTemplate.create_booking('day:card turnover', :amount => card_turnover, :value_date => date)
+ BookingTemplate.create_booking('day:expenses', :amount => expenses, :value_date => date)
+ BookingTemplate.create_booking('day:credit_turnover', :amount => credit_turnover, :value_date => date)
end
end
|
Create bookings for credit turnover and expenses in cash up.
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -15,7 +15,7 @@ begin
Site.current ||= Site.find(1)
rescue ActiveRecord::RecordNotFound
- Site.connection.execute("DELETE FROM SITES; ALTER TABLE sites AUTO_INCREMENT = 1;")
+ Site.connection.execute("DELETE FROM sites; ALTER TABLE sites AUTO_INCREMENT = 1;")
Site.current = Site.create!(name: 'Default', host: 'example.com')
end
end
|
Fix table name in spec helper.
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -5,7 +5,9 @@
require 'sequel'
-DB = Sequel.sqlite
+DB = Sequel.connect("postgres:///sequel-slugging-test")
+
+DB.drop_table? :widgets
DB.create_table :widgets do
primary_key :id
|
Use Postgres for testing, because of course.
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -36,7 +36,6 @@ RSpec.configure do |config|
config.treat_symbols_as_metadata_keys_with_true_values = true
config.run_all_when_everything_filtered = true
- config.filter_run :focus
config.include SpecHelpers
|
Remove more spec run noise
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -26,6 +26,7 @@ add_group 'Source', 'lib'
add_group 'Unit tests', 'spec/tara'
add_group 'Acceptance tests', 'spec/acceptance'
+ add_group 'Integration tests', 'spec/integration'
end
end
|
Add `integration` group to Simplecov
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -7,8 +7,8 @@ c.expect_with(:rspec) { |c| c.syntax = [:should, :expect] }
c.mock_with(:rspec) { |c| c.syntax = [:should, :expect] }
- # Only run tests marked with iso:true.
- c.filter_run_including iso:true
+ # Only run tests marked with focus: true.
+ c.filter_run_including focus: true
c.run_all_when_everything_filtered = true
# Abort after first failure.
|
Change spec filter :iso to :focus for compatibility with `fit` method.
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,3 +1,17 @@ require 'minitest'
require 'minitest/autorun'
-require 'ffi-vix_disk_lib'
+
+begin
+ require 'ffi-vix_disk_lib'
+rescue LoadError
+ STDERR.puts <<-EOMSG
+
+The VMware VDDK must be installed in order to run specs.
+
+The VMware VDDK is not redistributable, and not available on MacOSX.
+See https://www.vmware.com/support/developer/vddk/ for more information.
+
+EOMSG
+
+ exit 1
+end
|
Exit the specs with a clear message when the VDDK is not present at all.
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,3 +1,6 @@+RSpec.configure do |config|
+ config.mock_with :rspec
+end
require 'puppetlabs_spec_helper/module_spec_helper'
RSpec.configure do |config|
|
Remove deprecation warning when running spec tests
See https://tickets.puppetlabs.com/browse/PDK-916
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -24,7 +24,7 @@ add_group 'Relationship', 'lib/data_mapper/relationship'
add_group 'Attribute', 'lib/data_mapper/attribute'
- minimum_coverage 98.21
+ minimum_coverage 98.11 # 0.10 lower under JRuby
end
end
|
Update spec coverage threshold to work for JRuby
* The threshold is about 0.10% lower under JRuby, so adjust it
downward to compensate.
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -18,22 +18,28 @@ RSpec.configure do |config|
config.mock_with :mocha
- # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
- # config.fixture_path = "#{::Rails.root}/spec/fixtures"
+ config.after(:all) do
+ clean_upload_directory!
+ end
- # If you're not using ActiveRecord, or you'd prefer not to run each of your
- # examples within a transaction, remove the following line or assign false
- # instead of true.
- # config.use_transactional_fixtures = true
-
- # If true, the base class of anonymous controllers will be inferred
- # automatically. This will be the default behavior in future versions of
- # rspec-rails.
config.infer_base_class_for_anonymous_controllers = false
- # Run specs in random order to surface order dependencies. If you find an
- # order dependency and want to debug it, you can fix the order by providing
- # the seed, which is printed after each run.
- # --seed 1234
config.order = "random"
end
+
+CarrierWave::Uploader::Base.descendants.each do |klass|
+ next if klass.anonymous?
+ klass.class_eval do
+ def cache_dir
+ "#{Rails.root}/spec/support/uploads/tmp"
+ end
+
+ def store_dir
+ "#{Rails.root}/spec/support/uploads/#{model.class.to_s.underscore}/#{model.id}"
+ end
+ end
+end
+
+def clean_upload_directory!
+ FileUtils.rm_rf(Dir["#{Rails.root}/spec/support/uploads/[^.]*"])
+end
|
Set up test helper for Carrierwave
Use separate upload directory
Clean the directory after each test
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -24,7 +24,7 @@ add_group 'Relationship', 'lib/data_mapper/relationship'
add_group 'Attribute', 'lib/data_mapper/attribute'
- minimum_coverage 98.21
+ minimum_coverage 98.11 # 0.10 lower under JRuby
end
end
|
Update spec coverage threshold to work for JRuby
* The threshold is about 0.10% lower under JRuby, so adjust it
downward to compensate.
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -7,9 +7,10 @@
require 'database_cleaner'
+
def login_as_stub_user
@user = User.create!(:name => 'Stub User')
- request.env['warden'] = stub(:authenticate! => true, :authenticated? => true, :user => @user)
+ @request.env['warden'] = stub(:authenticate! => true, :authenticated? => true, :user => @user)
end
RSpec.configure do |config|
|
Call request as an instance var
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -8,6 +8,11 @@
namespace :dummy do
load 'spec/dummyapp/Rakefile'
+end
+
+if ENV['TRAVIS_JDK_VERSION'] == 'oraclejdk7'
+ require 'rollbar/configuration'
+ Rollbar::Configuration::DEFAULT_ENDPOINT = 'https://api-alt.rollbar.com/api/1/item/'
end
Rake::Task['dummy:db:setup'].invoke
@@ -50,3 +55,4 @@ def local?
ENV['LOCAL'] == '1'
end
+
|
Use api-alt.rollbar.com for oraclejdk7 tests.
|
diff --git a/spec/vector_spec.rb b/spec/vector_spec.rb
index abc1234..def5678 100644
--- a/spec/vector_spec.rb
+++ b/spec/vector_spec.rb
@@ -7,23 +7,27 @@ @v = Vector[-0.1, -0.9, -10]
end
- it "has an x-coordinate" do
- expect(@v.x).to eq(-0.1)
- end
+ context "accessing vector components" do
+
+ it "has an x-coordinate" do
+ expect(@v.x).to eq(-0.1)
+ end
- it "has an y-coordinate" do
- expect(@v.y).to eq(-0.9)
- end
+ it "has an y-coordinate" do
+ expect(@v.y).to eq(-0.9)
+ end
- it "has an z-coordinate" do
- expect(@v.z).to eq(-10)
- end
+ it "has an z-coordinate" do
+ expect(@v.z).to eq(-10)
+ end
+
+ end
context "squaring the vector" do
it "squares the x-component" do
- expect(@v.square.x > 0.009).to be true
- expect(@v.square.x < 0.011).to be true
+ expect(@v.square.x > 0.009999).to be true
+ expect(@v.square.x < 0.010001).to be true
end
it "squares the y-component" do
|
Update tests to new rspec standards
|
diff --git a/lib/tasks/easy_reference_data.rake b/lib/tasks/easy_reference_data.rake
index abc1234..def5678 100644
--- a/lib/tasks/easy_reference_data.rake
+++ b/lib/tasks/easy_reference_data.rake
@@ -1,14 +1,30 @@+def load_files
+ files = Dir[File.join(Rails.root, 'db', 'reference', '*.rb')].sort
+ files += Dir[File.join(Rails.root, 'db', 'reference', Rails.env, '*.rb')].sort
+
+ files.each do |file|
+ puts "Populating reference #{file}"
+ load file
+ end
+end
+
namespace :easy do
namespace :reference_data do
desc "Refreshes reference data values for the current environment."
task :refresh => :environment do
- files = Dir[File.join(Rails.root, 'db', 'reference', '*.rb')].sort
- files += Dir[File.join(Rails.root, 'db', 'reference', Rails.env, '*.rb')].sort
+ load_files
+ end
+ end
+end
- files.each do |file|
- puts "Populating reference #{file}"
- load file
+namespace :easy do
+ namespace :reference_data do
+ desc "Refreshes reference data values for the current environment in an ActiveRecord transaction. This is useful if you want an all or nothing data refresh."
+ task :refresh_in_transaction => :environment do
+
+ ActiveRecord::Base.transaction do
+ load_files
end
end
end
-end+end
|
Add rake task to run refresh in a transaction.
|
diff --git a/lib/email_address/active_record_validator.rb b/lib/email_address/active_record_validator.rb
index abc1234..def5678 100644
--- a/lib/email_address/active_record_validator.rb
+++ b/lib/email_address/active_record_validator.rb
@@ -38,7 +38,7 @@ e = Address.new(r[f])
unless e.valid?
error_message = @opt[:message] ||
- Config.error_messages[:invalid_address] ||
+ Config.error_message(:invalid_address, I18n.locale.to_s) ||
"Invalid Email Address"
r.errors.add(f, error_message)
end
|
Use I18n strings if available
Like #67 but I18n is used on Rails' side
|
diff --git a/attributes/tez.rb b/attributes/tez.rb
index abc1234..def5678 100644
--- a/attributes/tez.rb
+++ b/attributes/tez.rb
@@ -2,4 +2,8 @@ default['tez']['tez_env']['tez_conf_dir'] = "/etc/tez/#{node['tez']['conf_dir']}"
default['tez']['tez_env']['tez_jars'] = '/usr/lib/tez/*:/usr/lib/tez/lib/*'
-default['hadoop']['hadoop_env']['hadoop_classpath'] = "/etc/tez/#{node['tez']['conf_dir']}:/usr/lib/tez/*:/usr/lib/tez/lib/*:$HADOOP_CLASSPATH"
+if node['hadoop'].key?('hadoop_env') && node['hadoop']['hadoop_env'].key?('hadoop_classpath')
+ default['hadoop']['hadoop_env']['hadoop_classpath'] = "/etc/tez/#{node['tez']['conf_dir']}:/usr/lib/tez/*:/usr/lib/tez/lib/*:$HADOOP_CLASSPATH:#{default['hadoop']['hadoop_env']['hadoop_classpath']}"
+else
+ default['hadoop']['hadoop_env']['hadoop_classpath'] = "/etc/tez/#{node['tez']['conf_dir']}:/usr/lib/tez/*:/usr/lib/tez/lib/*:$HADOOP_CLASSPATH"
+end
|
Prepend new classpath entries if already defined
|
diff --git a/abstract_type.gemspec b/abstract_type.gemspec
index abc1234..def5678 100644
--- a/abstract_type.gemspec
+++ b/abstract_type.gemspec
@@ -10,6 +10,7 @@ gem.description = 'Module to declare abstract classes and methods'
gem.summary = gem.description
gem.homepage = 'https://github.com/dkubb/abstract_type'
+ gem.license = 'MIT'
gem.files = `git ls-files`.split($/)
gem.test_files = `git ls-files -- spec/unit`.split($/)
|
Add MIT license to gemspec
|
diff --git a/app/services/authenticator.rb b/app/services/authenticator.rb
index abc1234..def5678 100644
--- a/app/services/authenticator.rb
+++ b/app/services/authenticator.rb
@@ -11,7 +11,7 @@
def find_or_create_from_oauth
ActiveRecord::Base.transaction do
- @connection = Connection.where(connection_attrs).first_or_create
+ @connection = Connection.where(connection_attrs).first_or_initialize
@connection.developer = create_from_oauth if @connection.developer_id.nil?
@connection.access_token = auth.credentials.token
@connection.developer if @connection.save!
@@ -23,7 +23,7 @@ # rubocop:disable Metrics/MethodLength
# rubocop:disable Metrics/AbcSize
def create_from_oauth
- Developer.new(
+ Developer.create(
email: auth.info.email,
bio: auth.extra.raw_info.bio,
password: Devise.friendly_token[0, 20],
|
Make sure developer exists before creating connection
|
diff --git a/src/modules/module_newstitle.rb b/src/modules/module_newstitle.rb
index abc1234..def5678 100644
--- a/src/modules/module_newstitle.rb
+++ b/src/modules/module_newstitle.rb
@@ -1,29 +1,33 @@ Kernel.load("fetch_uri.rb")
-def parseNewsTitle(url)
- hosts = {
- /.*iltalehti\.fi/ => /(.*) \| Iltalehti\.fi$/,
- /.*iltasanomat\.fi/ => /(.*) - Ilta-Sanomat$/
- }
-
- hosts.each { |host, title_expr|
- if URI.parse(url).host =~ host
- reply = fetch_uri(url)
- return "HTML error ##{reply.code}, sry :(" if (reply.code != "200")
- return $1 if reply.body =~ /<title>(.*)<\/title>/ && $1 =~ title_expr
- end
- }
- ""
-end
-
-class Bot
- def newstitle_privmsg(bot, from, reply_to, msg)
+class Module_Newstitle
+ def init_module(bot) end
+
+ def privmsg(bot, from, reply_to, msg)
msg.split(" ").each { |word|
if word =~ /^http:\/\//
news_title = parseNewsTitle(word)
- bot.privmsg(reply_to, news_title) if news_title != ""
+ bot.send_privmsg(reply_to, news_title) if news_title != ""
end
}
end
+
+ private
+
+ def parseNewsTitle(url)
+ hosts = {
+ /.*iltalehti\.fi/ => /(.*) \| Iltalehti\.fi$/,
+ /.*iltasanomat\.fi/ => /(.*) - Ilta-Sanomat$/
+ }
+
+ hosts.each { |host, title_expr|
+ if URI.parse(url).host =~ host
+ reply = fetch_uri(url)
+ return "HTML error ##{reply.code}, sry :(" if (reply.code != "200")
+ return $1 if reply.body =~ /<title>(.*)<\/title>/ && $1 =~ title_expr
+ end
+ }
+ ""
+ end
end
|
Update Newstitle to new module format
Signed-off-by: Aki Saarinen <278bc57fbbff6b7b38435aea0f9d37e3d879167e@akisaarinen.fi>
|
diff --git a/lib/padrino-pipeline/pipelines/asset_pack.rb b/lib/padrino-pipeline/pipelines/asset_pack.rb
index abc1234..def5678 100644
--- a/lib/padrino-pipeline/pipelines/asset_pack.rb
+++ b/lib/padrino-pipeline/pipelines/asset_pack.rb
@@ -44,7 +44,7 @@ packages.each { |package| send(package.shift, *package) }
js_compression :uglify
- css_compression :simple
+ css_compression :sass
}
end
end
|
Make compression the same for both pipelines
|
diff --git a/spec/factories/ci/job_artifacts.rb b/spec/factories/ci/job_artifacts.rb
index abc1234..def5678 100644
--- a/spec/factories/ci/job_artifacts.rb
+++ b/spec/factories/ci/job_artifacts.rb
@@ -32,7 +32,7 @@
after(:build) do |artifact, evaluator|
artifact.file = fixture_file_upload(
- expand_fixture_path('trace/sample_trace'), 'text/plain')
+ Rails.root.join('spec/fixtures/trace/sample_trace'), 'text/plain')
end
end
end
|
Revert using expand_fixture_path in factory
|
diff --git a/rspec-wait.gemspec b/rspec-wait.gemspec
index abc1234..def5678 100644
--- a/rspec-wait.gemspec
+++ b/rspec-wait.gemspec
@@ -17,5 +17,5 @@ spec.add_dependency "rspec", ">= 2.11", "< 3.2"
spec.add_development_dependency "bundler", "~> 1.7"
- spec.add_development_dependency "rake", "~> 10.3"
+ spec.add_development_dependency "rake", "~> 10.4"
end
|
Update the development rake gem dependency version requirement
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.