diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
---|---|
diff --git a/lib/backlog_kit/client/resolution.rb b/lib/backlog_kit/client/resolution.rb
index abc1234..def5678 100644
--- a/lib/backlog_kit/client/resolution.rb
+++ b/lib/backlog_kit/client/resolution.rb
@@ -1,6 +1,12 @@ module BacklogKit
class Client
+
+ # Methods for the Resolution API
module Resolution
+
+ # Get list of resolutions
+ #
+ # @return [BacklogKit::Response] List of resolutions
def get_resolutions
get('resolutions')
end
|
Add documentation for the Resolution API
|
diff --git a/lib/changit/lexer/key_value_token.rb b/lib/changit/lexer/key_value_token.rb
index abc1234..def5678 100644
--- a/lib/changit/lexer/key_value_token.rb
+++ b/lib/changit/lexer/key_value_token.rb
@@ -5,7 +5,7 @@ attr_accessor :rhs # right-hand side
def initialize(key_value)
- @lhs, @rhs = key_value.split('=').map(&:strip)
+ @lhs, @rhs = key_value.split('=', 2).map(&:strip)
end
def to_s
|
Fix for lines with multiple =s
|
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -1,5 +1,7 @@ class ApplicationController < ActionController::Base
has_mobile_fu
+
+ before_filter :authenticate
def use_mobile_view
session[:mobile_view] = true
@@ -10,4 +12,18 @@ session[:mobile_view] = false
redirect_to root_path
end
+
+ private
+
+ def authenticate
+ username = Settings.username
+ password = Settings.password
+
+ if !username.blank? && !password.blank?
+ authenticate_or_request_with_http_basic("Addressbook") do |http_username, http_password|
+ http_username == username && http_password == password
+ end
+ end
+ end
+
end
|
Add http basic auth to the application controller
|
diff --git a/app/models/payment_method/mercado_pago.rb b/app/models/payment_method/mercado_pago.rb
index abc1234..def5678 100644
--- a/app/models/payment_method/mercado_pago.rb
+++ b/app/models/payment_method/mercado_pago.rb
@@ -1,7 +1,5 @@ # -*- encoding : utf-8 -*-
class PaymentMethod::MercadoPago < Spree::PaymentMethod
- attr_accessible :preferred_client_id, :preferred_client_secret
-
preference :client_id, :integer
preference :client_secret, :string
|
Remove deprecated attr_accessible from payment method
|
diff --git a/app/serializers/export/user_serializer.rb b/app/serializers/export/user_serializer.rb
index abc1234..def5678 100644
--- a/app/serializers/export/user_serializer.rb
+++ b/app/serializers/export/user_serializer.rb
@@ -4,6 +4,7 @@ :email,
:language,
:username,
+ :serialized_private_key,
:disable_mail,
:show_community_spotlight_in_stream,
:auto_follow_back,
|
Include a private key to the user data export archive
In order to allow a user to notify his contacts of his migration
with a trustworthy signature the old private key must be available
to the new pod where we import data.
|
diff --git a/test/helpers/start_simplecov.rb b/test/helpers/start_simplecov.rb
index abc1234..def5678 100644
--- a/test/helpers/start_simplecov.rb
+++ b/test/helpers/start_simplecov.rb
@@ -10,7 +10,7 @@ SimpleCov.start do
add_filter "/test/"
- minimum_coverage 100 if running_all_tests?
+ minimum_coverage 100 if this_process_responsible_for_coverage_reporting?
command_name SIMPLECOV_COMMAND_NAME if child_test_process?
formatter simplecov_formatter_class
end
@@ -18,15 +18,20 @@
def simplecov_formatter_class
include SimpleCov::Formatter
- if html_report_requested?
- MultiFormatter[HTMLFormatter, Console]
- else
- Console
+ formatters = []
+ if this_process_responsible_for_coverage_reporting?
+ formatters << Console
+ formatters << HTMLFormatter if html_report_requested?
end
+ MultiFormatter[*formatters]
+ end
+
+ def this_process_responsible_for_coverage_reporting?
+ running_all_tests? && !child_test_process?
end
def running_all_tests?
- ENV['TEST'].nil?
+ ARGV == Dir["test/test_*.rb"] - ["test/test_helper.rb"]
end
def child_test_process?
|
Fix that tests run in forked processes were printing coverage reports
For a few tests, we shell out to `ruby -e "require 'fakeweb'; ..."` to get a
clean environment in order to check what warnings appear when you combine
FakeWeb with other libs. Recently these processes starting printing coverage
reports, which messes with our assertions about the warnings output.
This sets the SimpleCov formatter to `MultiFormatter[]` for those processes,
which keeps them collecting/logging coverage data while suppressing any output.
p.s. this also sneaks in a more robust technique for checking whether the full
suite is being run (in #running_all_tests?).
|
diff --git a/lib/simple2ch/simple2ch_exception.rb b/lib/simple2ch/simple2ch_exception.rb
index abc1234..def5678 100644
--- a/lib/simple2ch/simple2ch_exception.rb
+++ b/lib/simple2ch/simple2ch_exception.rb
@@ -1,5 +1,5 @@ module Simple2ch
- class Simple2chException < Exception; end
+ class Simple2chException < StandardError; end
class NotA2chUrlException < Simple2chException; end
class KakoLogException < Simple2chException; end
class DatParseException < Simple2chException; end
|
Fix Bug: Any Simple2ch exceptions could not rescued by StandardError
|
diff --git a/lib/smartdown/api/directory_input.rb b/lib/smartdown/api/directory_input.rb
index abc1234..def5678 100644
--- a/lib/smartdown/api/directory_input.rb
+++ b/lib/smartdown/api/directory_input.rb
@@ -0,0 +1,11 @@+require 'smartdown/parser/directory_input'
+
+module Smartdown
+ module Api
+ class DirectoryInput < Smartdown::Parser::DirectoryInput
+ def initialize(coversheet_path)
+ super(coversheet_path)
+ end
+ end
+ end
+end
|
Make DirectoryInput part of the pubic API
As clients of the gem will need to call it, to then call Api::Flow, they shouldn't
have to call something in the Parser directory.
Moving the DirectoryInput module itself was a bit of a faff, so for now i've effectively
aliased it, so it's officially part of the public API, and the smartdown internals can
be rearranged later
|
diff --git a/recipes/default.rb b/recipes/default.rb
index abc1234..def5678 100644
--- a/recipes/default.rb
+++ b/recipes/default.rb
@@ -6,6 +6,6 @@ #
# All rights reserved - Do Not Redistribute
-require_recipe "sportngin-mongodb::mongodb_repo"
-require_recipe "mongodb"
+include_recipe "sportngin-mongodb::mongodb_repo"
+include_recipe "mongodb"
|
Switch from depricated require_recipe to include_recipe
|
diff --git a/recipes/default.rb b/recipes/default.rb
index abc1234..def5678 100644
--- a/recipes/default.rb
+++ b/recipes/default.rb
@@ -13,10 +13,10 @@ # Install packages required for ruby-build to build MRI 2.2.0
# according to:
# https://github.com/sstephenson/ruby-build/wiki#suggested-build-environment
-case node['platform']
-when 'redhat', 'centos', 'amazon', 'oracle'
+case node['platform_family']
+when 'rhel'
package 'libffi-devel'
-when 'ubuntu', 'debian'
+when 'debian'
package 'libffi-dev'
package 'libgdbm-dev'
end
|
Use platform_family instead of platform
|
diff --git a/flipper-sequel.gemspec b/flipper-sequel.gemspec
index abc1234..def5678 100644
--- a/flipper-sequel.gemspec
+++ b/flipper-sequel.gemspec
@@ -23,5 +23,5 @@ gem.metadata = Flipper::METADATA
gem.add_dependency 'flipper', "~> #{Flipper::VERSION}"
- gem.add_dependency 'sequel', '>= 4.0.0'
+ gem.add_dependency 'sequel', '>= 4.0.0', '< 6'
end
|
Add a little more restrictive sequel version
>= 4 is too liberal. Since people are saying that 5 works, let's do < 6.
|
diff --git a/pure-rails.gemspec b/pure-rails.gemspec
index abc1234..def5678 100644
--- a/pure-rails.gemspec
+++ b/pure-rails.gemspec
@@ -16,6 +16,6 @@
s.require_paths = ['lib']
- s.add_development_dependency 'httparty'
- s.add_development_dependency 'rake'
+ s.add_development_dependency 'httparty', '~> 0.13'
+ s.add_development_dependency 'rake', '~> 10.3'
end
|
Add warning about unversioned development dependencies.
|
diff --git a/lib/csvconverter/commands/android2csv_command.rb b/lib/csvconverter/commands/android2csv_command.rb
index abc1234..def5678 100644
--- a/lib/csvconverter/commands/android2csv_command.rb
+++ b/lib/csvconverter/commands/android2csv_command.rb
@@ -6,7 +6,6 @@ # required options but handled in method because of options read from yaml file
method_option :filenames, :type => :array, :aliases => "-i", :desc => "location of android strings xml files (FILENAMES)"
# optional options
- method_option :fetch, :type => :boolean, :desc => "Download file from Google Drive"
method_option :csv_filename, :type => :string, :aliases => "-o", :desc => "location of output file"
method_option :headers, :type => :array, :aliases => "-h", :desc => "override headers of columns, default is name of input files and 'Variables' for reference"
method_option :dryrun, :type => :boolean, :aliases => "-n", :desc => "prints out content of hash without writing file"
@@ -16,13 +15,6 @@ help("android2csv")
exit
end
- if options['fetch']
- say "Downloading file from Google Drive"
- filename = invoke :csv_download, nil, {"gd_filename" => filename}
- exit unless filename
- end
-
-
converter = Android2CSV.new(options)
debug_values = converter.convert(!options[:dryrun])
say debug_values.inspect if options[:dryrun]
|
Revert "add googledoc support for android command"
This reverts commit f65af7feb9b0b4e25e61e2478fbe8e73ef8ce537.
|
diff --git a/plugin.rb b/plugin.rb
index abc1234..def5678 100644
--- a/plugin.rb
+++ b/plugin.rb
@@ -9,9 +9,9 @@
after_initialize do
add_to_serializer(:user, :twitter_screen_name) do
- object.twitter_user_info.screen_name
+ object.user_associated_accounts.find_by(provider_name: "twitter")&.info["nickname"]
end
add_to_serializer(:user, :include_twitter_screen_name?) do
- object.twitter_user_info.present?
+ object.user_associated_accounts.exists?(provider_name: "twitter")
end
end
|
FIX: Update for changes to core
|
diff --git a/lib/sendwithus_ruby_action_mailer/mail_params.rb b/lib/sendwithus_ruby_action_mailer/mail_params.rb
index abc1234..def5678 100644
--- a/lib/sendwithus_ruby_action_mailer/mail_params.rb
+++ b/lib/sendwithus_ruby_action_mailer/mail_params.rb
@@ -8,6 +8,8 @@ @email_data = {}
@to = {}
@from = {}
+ @cc = []
+ @bcc = []
end
def assign(key, value) #:nodoc:
@@ -29,6 +31,10 @@ @from.merge!(address: value)
when :reply_to
@from.merge!(reply_to: value)
+ when :cc
+ @cc.concat(value)
+ when :bcc
+ @bcc.concat(value)
end
end
end
@@ -40,7 +46,7 @@ # In particular, the +api_key+ must be set (following the guidelines in the
# +send_with_us+ documentation).
def deliver
- SendWithUs::Api.new.send_with(@email_id, @to, @email_data, @from)
+ SendWithUs::Api.new.send_with(@email_id, @to, @email_data, @from, @cc, @bcc)
end
end
end
|
Add basic support for CC and BCC
|
diff --git a/pummel.rb b/pummel.rb
index abc1234..def5678 100644
--- a/pummel.rb
+++ b/pummel.rb
@@ -6,13 +6,12 @@ $: << File.join(File.dirname(__FILE__), 'vendor', 'ruby-oembed', 'lib')
require 'oembed'
+@@rss_url = "http://feeds.pinboard.in/rss/u:evaryont/"
+@@ic = Iconv.new('UTF-8//IGNORE', 'UTF-8')
def refresh_rss
- valid_string = @ic.iconv(open(@@rss_url).read << ' ')[0..-2]
+ valid_string = @@ic.iconv(open(@@rss_url).read << ' ')[0..-2]
@@rss = RSS::Parser.parse valid_string, false
end
-
-@@rss_url = "http://feeds.pinboard.in/rss/u:evaryont/"
-@ic = Iconv.new('UTF-8//IGNORE', 'UTF-8')
refresh_rss()
set :public, File.dirname(__FILE__) + '/public'
|
Make ic a class variable, rather than an instance variable.
|
diff --git a/lib/banzai/pipeline/description_pipeline.rb b/lib/banzai/pipeline/description_pipeline.rb
index abc1234..def5678 100644
--- a/lib/banzai/pipeline/description_pipeline.rb
+++ b/lib/banzai/pipeline/description_pipeline.rb
@@ -1,22 +1,15 @@ module Banzai
module Pipeline
class DescriptionPipeline < FullPipeline
+ WHITELIST = Banzai::Filter::SanitizationFilter::LIMITED.deep_dup.merge(
+ elements: Banzai::Filter::SanitizationFilter::LIMITED[:elements] - %w(pre code img ol ul li)
+ )
+
def self.transform_context(context)
super(context).merge(
# SanitizationFilter
- whitelist: whitelist
+ whitelist: WHITELIST
)
- end
-
- private
-
- def self.whitelist
- # Descriptions are more heavily sanitized, allowing only a few elements.
- # See http://git.io/vkuAN
- whitelist = Banzai::Filter::SanitizationFilter::LIMITED
- whitelist[:elements] -= %w(pre code img ol ul li)
-
- whitelist
end
end
end
|
Fix description and GFM pipelines conflicting
Consider this command:
bundle exec rails r "include GitlabMarkdownHelper
puts markdown('<span>this is a span</span>', pipeline: :description)
puts markdown('<span>this is a span</span>')"
And the same in the opposite order:
bundle exec rails r "include GitlabMarkdownHelper
puts markdown('<span>this is a span</span>')
puts markdown('<span>this is a span</span>', pipeline: :description)"
Before this change, they would both output:
<p><span>this is a span</span></p>
<p>this is a span</p>
That's because `span` is added to the list of whitelisted elements in
the `SanitizationFilter`, but this method tries not to make the same
changes multiple times. Unfortunately,
`HTML::Pipeline::SanitizationFilter::LIMITED`, which is used by the
`DescriptionPipeline`, uses the same Ruby objects for all of its hash
values _except_ `:elements`.
That means that whichever of `DescriptionPipeline` and `GfmPipeline` is
called first would have `span` in its whitelisted elements, and the
second wouldn't.
Fix this by creating an entirely separate hash, before either pipeline
is invoked.
|
diff --git a/state_machine-audit_trail.gemspec b/state_machine-audit_trail.gemspec
index abc1234..def5678 100644
--- a/state_machine-audit_trail.gemspec
+++ b/state_machine-audit_trail.gemspec
@@ -13,6 +13,7 @@ s.homepage = "https://github.com/wvanbergen/state_machine-audit_trail"
s.summary = %q{Log transitions on a state machine to support auditing and business process analytics.}
s.description = %q{Log transitions on a state machine to support auditing and business process analytics.}
+ s.license = "MIT"
s.rubyforge_project = "state_machine"
|
Add license to Gemspec file
|
diff --git a/cli/lib/rbld_status.rb b/cli/lib/rbld_status.rb
index abc1234..def5678 100644
--- a/cli/lib/rbld_status.rb
+++ b/cli/lib/rbld_status.rb
@@ -4,7 +4,11 @@
module Rebuild
class RbldStatusCommand < Command
- legacy_usage_implementation :status
+ def initialize
+ @usage = "status [OPTIONS]"
+ @description = "List modified environments"
+ end
+
legacy_run_implementation :status
end
end
|
cli: Convert rbld status usage to Ruby
Signed-off-by: Dmitry Fleytman <[email protected]>
|
diff --git a/lib/radiodan/adapter/mpd/playlist_parser.rb b/lib/radiodan/adapter/mpd/playlist_parser.rb
index abc1234..def5678 100644
--- a/lib/radiodan/adapter/mpd/playlist_parser.rb
+++ b/lib/radiodan/adapter/mpd/playlist_parser.rb
@@ -27,7 +27,11 @@ end
def self.parse_tracks(tracks)
- tracks.collect{ |t| Track.new(t) }
+ if tracks.respond_to?(:collect)
+ tracks.collect{ |t| Track.new(t) }
+ else
+ []
+ end
end
def self.parse_mode(attributes)
|
Return empty array if no tracks are found
|
diff --git a/db/migrate/20191010143350_add_conditioning_unit_to_products.rb b/db/migrate/20191010143350_add_conditioning_unit_to_products.rb
index abc1234..def5678 100644
--- a/db/migrate/20191010143350_add_conditioning_unit_to_products.rb
+++ b/db/migrate/20191010143350_add_conditioning_unit_to_products.rb
@@ -27,7 +27,7 @@ AND p.conditioning_unit_id IS NULL
SQL
- change_column_null :products, :conditioning_unit_id, false
+ # change_column_null :products, :conditioning_unit_id, false
end
def down
|
Fix bug during deployment on not null column conditionning_unit in products.
|
diff --git a/Support/spec/spec_helper.rb b/Support/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/Support/spec/spec_helper.rb
+++ b/Support/spec/spec_helper.rb
@@ -21,5 +21,9 @@ # 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'
+
+ # Makes runner specs go forever with certain seeds (e.g. --seed 6871),
+ # disabled until the runner will run specs in a subshell. Ref:
+ # https://github.com/elia/rspec.tmbundle/commit/92bd792d813f79ffec8484469aa9ce3c7872382b#commitcomment-7325726
+ # config.order = 'random'
end
|
Disable random sorting of specs
Makes runner specs go forever with certain seeds (e.g. --seed 6871),
disabled until the runner will run specs in a subshell. Ref:
https://github.com/elia/rspec.tmbundle/commit/92bd792d813f79ffec8484469aa9ce3c7872382b#commitcomment-7325726
|
diff --git a/redimap.gemspec b/redimap.gemspec
index abc1234..def5678 100644
--- a/redimap.gemspec
+++ b/redimap.gemspec
@@ -8,8 +8,11 @@ spec.version = Redimap::VERSION
spec.authors = ["tiredpixel"]
spec.email = ["[email protected]"]
- spec.description = %q{TODO: Write a gem description}
- spec.summary = %q{TODO: Write a gem summary}
+ spec.description = %q{Redimap provides a simple executable for polling mailboxes
+ within an IMAP account. It keeps track of what it's seen using Redis. For new
+ messages, the mailbox and uid are queued in Redis. The format used should be
+ compatible with Resque.}
+ spec.summary = %q{Redimap polls IMAP account mailboxes and queues in Redis.}
spec.homepage = ""
spec.license = "MIT"
|
Document Gemspec summary and description.
|
diff --git a/db/migrate/20150429183941_create_member_profiles.rb b/db/migrate/20150429183941_create_member_profiles.rb
index abc1234..def5678 100644
--- a/db/migrate/20150429183941_create_member_profiles.rb
+++ b/db/migrate/20150429183941_create_member_profiles.rb
@@ -20,9 +20,10 @@ t.string :appointment_lengths, array: true, default: []
t.string :group_training, array: true, default: []
t.boolean :consent_waiver
- t.references :user
+ t.references :user, index: true
t.timestamps null: false
end
+ add_foreign_key :member_profiles, :users
end
end
|
Add foreign key to member profile table
|
diff --git a/core/lib/tasks/users.rake b/core/lib/tasks/users.rake
index abc1234..def5678 100644
--- a/core/lib/tasks/users.rake
+++ b/core/lib/tasks/users.rake
@@ -1,14 +1,15 @@ namespace :user do
task :add, [:user, :email, :password] => :environment do |t, args|
u = User.new({ username: args.user,
- email: args.email,
+
password: args.password,
confirmed_at: DateTime.now
})
+ u.email = args.email
u.save
if(u.errors.size > 0)
msg = "Failed to import "
- u.errors.each { |e| msg += e.to_s }
+ u.errors.each { |e, v| msg += "#{e.to_s} #{v}" }
fail(msg)
end
end
|
Fix rake user:add task, email can't be mass assigned
|
diff --git a/recipes/default.rb b/recipes/default.rb
index abc1234..def5678 100644
--- a/recipes/default.rb
+++ b/recipes/default.rb
@@ -31,7 +31,7 @@
git node['sickbeard']['install_dir'] do
repository node['sickbeard']['git']['url']
- revision node['sickbeard']['git']['tag']
+ reference node['sickbeard']['git']['tag']
action :sync
user node['sickbeard']['user']
group node['sickbeard']['group']
|
Use reference instead of revision attribute to checkout git repo with tag
|
diff --git a/recipes/default.rb b/recipes/default.rb
index abc1234..def5678 100644
--- a/recipes/default.rb
+++ b/recipes/default.rb
@@ -19,7 +19,6 @@ recursive true
end
- Chef::Log.info("DEPLOY ATTRIBUTES: #{deploy.inspect}")
opsworks_deploy do
deploy_data deploy
app application
|
Remove logging of sensitive things.
|
diff --git a/recipes/default.rb b/recipes/default.rb
index abc1234..def5678 100644
--- a/recipes/default.rb
+++ b/recipes/default.rb
@@ -39,3 +39,7 @@ if node['postfix']['use_virtual_aliases']
include_recipe 'postfix::virtual_aliases'
end
+
+if node['postfix']['use_virtual_aliases_domains']
+ include_recipe 'postfix::virtual_aliases_domains'
+end
|
Fix logic around include_recipe 'postfix::virtual_aliases_domains'
Signed-off-by: Sean OMeara <[email protected]>
|
diff --git a/recipes/default.rb b/recipes/default.rb
index abc1234..def5678 100644
--- a/recipes/default.rb
+++ b/recipes/default.rb
@@ -21,8 +21,6 @@
# Install dynect gem for usage within Chef runs
chef_gem 'dynect_rest' do
- # as per https://www.chef.io/blog/2015/02/17/chef-12-1-0-chef_gem-resource-warnings/
- compile_time false if Chef::Resource::ChefGem.method_defined?(:compile_time)
action :install
compile_time false
end
|
Remove duplicate compile_time on the gem
Signed-off-by: Tim Smith <[email protected]>
|
diff --git a/recipes/default.rb b/recipes/default.rb
index abc1234..def5678 100644
--- a/recipes/default.rb
+++ b/recipes/default.rb
@@ -12,6 +12,24 @@
package "logstash"
+execute "remove-server-conf" do
+ command %{
+ if [ -e /etc/logstash/conf.d/server.conf ]; then
+ rm /etc/logstash/conf.d/server.conf
+ fi
+ }
+ not_if { node[:logstash][:server][:enabled] }
+end
+
+execute "remove-agent-conf" do
+ command %{
+ if [ -e /etc/logstash/conf.d/agent.conf ]; then
+ rm /etc/logstash/conf.d/agent.conf
+ fi
+ }
+ not_if { node[:logstash][:agent][:enabled] }
+end
+
include_recipe "logstash::server" if node[:logstash][:server][:enabled]
include_recipe "logstash::agent" if node[:logstash][:agent][:enabled]
|
Clean up server and agent configs if we do not need them (anymore).
|
diff --git a/sfc-custom.gemspec b/sfc-custom.gemspec
index abc1234..def5678 100644
--- a/sfc-custom.gemspec
+++ b/sfc-custom.gemspec
@@ -0,0 +1,33 @@+Gem::Specification.new do |s|
+ s.name = %q{sfc-custom}
+ s.version = "0.6"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
+ s.authors = ["SFC Limited, Inc."]
+ s.date = %q{2008-11-17}
+ s.description = %q{Library for accessing SFCcustom, a web service for generating dynamic content for print}
+ s.email = %q{}
+ s.extra_rdoc_files = ["CHANGELOG", "lib/sfc-custom.rb", "LICENSE", "README"]
+ s.files = ["CHANGELOG", "lib/sfc-custom.rb", "LICENSE", "Manifest", "Rakefile", "README", "test/fixtures/expected_output_for_test_personalized_vps_order_with_logo.xml", "test/fixtures/expected_output_for_test_personalized_vps_order_with_text.xml", "test/fixtures/expected_output_for_test_standard_vps_order.xml", "test/test_sfc-custom.rb", "sfc-custom.gemspec"]
+ s.has_rdoc = true
+ s.homepage = %q{}
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Sfc-custom", "--main", "README"]
+ s.require_paths = ["lib"]
+ s.rubyforge_project = %q{sfc}
+ s.rubygems_version = %q{1.2.0}
+ s.summary = %q{Library for accessing SFCcustom, a web service for generating dynamic content for print}
+ s.test_files = ["test/test_sfc-custom.rb"]
+
+ if s.respond_to? :specification_version then
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
+ s.specification_version = 2
+
+ if current_version >= 3 then
+ s.add_runtime_dependency(%q<xml-simple>, [">= 0"])
+ else
+ s.add_dependency(%q<xml-simple>, [">= 0"])
+ end
+ else
+ s.add_dependency(%q<xml-simple>, [">= 0"])
+ end
+end
|
Add gemspec from current gem
|
diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb
index abc1234..def5678 100644
--- a/app/mailers/user_mailer.rb
+++ b/app/mailers/user_mailer.rb
@@ -3,6 +3,6 @@
def password_reset(user)
@user = user
- mail :to => user.email, :subject => "Password Reset"
+ mail :to => user.email, :from => "[email protected]", :subject => "Password Reset"
end
end
|
Add explicit from hoping it takes.
|
diff --git a/app/models/kaui/ability.rb b/app/models/kaui/ability.rb
index abc1234..def5678 100644
--- a/app/models/kaui/ability.rb
+++ b/app/models/kaui/ability.rb
@@ -7,7 +7,7 @@ user.permissions.each do |permission|
# permission is something like invoice:item_adjust or payment:refund
# We rely on a naming convention where the left part refers to a Kaui model
- model, action = permission.split(':')
+ model, action = permission_to_model_action(permission)
if model == '*' and action == '*'
# All permissions!
can :manage, :all
@@ -22,5 +22,21 @@ end
rescue KillBillClient::API::Unauthorized => e
end
+
+ def permission_to_model_action(permission)
+ #
+ # Permissions are defined in Kill Kill apis (https://github.com/killbill/killbill-api/blob/master/src/main/java/org/killbill/billing/security/Permission.java)
+ # and they look something like 'invoice:item_adjust' or 'payment:refund', where the first part is the Kill Bill module and the second the action.
+ #
+ # For most of those the Kill Bill module maps to the Kaui model, but for a few, the naming convention breaks, so in order to keep the API clean, we do the fix up
+ # in KAUI itself:
+ #
+ to_be_model, action = permission.split(':')
+ # Currently the only actions implemented for overdue and catalog (upload_config) are those implemented at the tenant level:
+ if to_be_model == 'tenant' || 'overdue' || 'catalog'
+ to_be_model = 'admin_tenant'
+ end
+ [to_be_model, action]
+ end
end
end
|
Fix Permission.java (killbill-api) to have clean model and fix'up CanCan to make the correct translation to KAUI models
|
diff --git a/rb-fsevent.gemspec b/rb-fsevent.gemspec
index abc1234..def5678 100644
--- a/rb-fsevent.gemspec
+++ b/rb-fsevent.gemspec
@@ -14,7 +14,7 @@
s.rubyforge_project = "rb-fsevent"
- s.add_development_dependency 'bundler', '~> 1.0.10'
+ s.add_development_dependency 'bundler', '~> 1.0'
s.add_development_dependency 'rspec', '~> 2.5.0'
s.add_development_dependency 'guard-rspec', '~> 0.1.9'
|
Allow using new versions of bundler
|
diff --git a/recipes/default.rb b/recipes/default.rb
index abc1234..def5678 100644
--- a/recipes/default.rb
+++ b/recipes/default.rb
@@ -10,6 +10,9 @@ # Install Homebrew Cask tap
include_recipe "homebrew::cask"
+# Install Homebrew Cask Versions tap
+homebrew_tap 'caskroom/versions'
+
#Install formulae/packages (list is defined in attributes)
include_recipe "homebrew::install_formulas"
|
Add Homebrew Cask Versions tap
The Versions tap has casks for some newer software (e.g. Sublime Text 3).
Install this so we have access to these versions.
|
diff --git a/recipes/default.rb b/recipes/default.rb
index abc1234..def5678 100644
--- a/recipes/default.rb
+++ b/recipes/default.rb
@@ -15,8 +15,7 @@ # Hadoop ######################################################################
node.override['single_node_hadoop_claster']['java']['java_home'] = "/usr/lib/jvm/jdk1.6.0_45"
-node.override['single_node_hadoop_claster']['user'] = 'vagrant'
-node.override['single_node_hadoop_claster']['group'] = 'hadoop'
+node.override['single_node_hadoop_claster']["user"]["name"] = 'vagrant'
include_recipe "single_node_hadoop_claster"
|
Update attributes according to single_node_hadoop_claster requirements.
|
diff --git a/src/spec/models/provider_spec.rb b/src/spec/models/provider_spec.rb
index abc1234..def5678 100644
--- a/src/spec/models/provider_spec.rb
+++ b/src/spec/models/provider_spec.rb
@@ -2,12 +2,72 @@
describe Provider do
before(:each) do
- @valid_attributes = {
- }
+ @provider = Factory.create(:mock_provider)
+ @client = mock('DeltaCloud', :null_object => true)
+ @provider.stub!(:connect).and_return(@client)
end
- it "should create a new instance given valid attributes" do
- # pending
- # Provider.create!(@valid_attributes)
+ it "should return a client object" do
+ @provider.send(:valid_framework?).should be_true
end
+
+ it "should validate mock provider" do
+ @provider.should be_valid
+ end
+
+ it "should require a valid name" do
+ [nil, ""].each do |invalid_value|
+ @provider.name = invalid_value
+ @provider.should_not be_valid
+ end
+ end
+
+ it "should require a valid cloud_type" do
+ [nil, ""].each do |invalid_value|
+ @provider.cloud_type = invalid_value
+ @provider.should_not be_valid
+ end
+ end
+
+ it "should require a valid url" do
+ [nil, ""].each do |invalid_value|
+ @provider.url = invalid_value
+ @provider.should_not be_valid
+ end
+ end
+
+ it "should require unique name" do
+ provider1 = Factory.create :mock_provider
+ provider2 = Factory.create :mock_provider
+ provider1.should be_valid
+ provider2.should be_valid
+
+ provider2.name = provider1.name
+ provider2.should_not be_valid
+ end
+
+ it "should be able to connect to the specified framework" do
+ @provider.should be_valid
+ @provider.connect.should_not be_nil
+
+ @provider.url = "http://invalid.provider/url"
+ @provider.stub(:connect).and_return(nil)
+ deltacloud = @provider.connect
+ @provider.should have(1).error_on(:url)
+ @provider.errors.on(:url).should eql("must be a valid provider url")
+ @provider.should_not be_valid
+ deltacloud.should be_nil
+ end
+
+ it "should log errors when connecting to invalid url" do
+ @logger = mock('Logger', :null_object => true)
+ @provider = Factory.create(:mock_provider)
+ @provider.stub!(:logger).and_return(@logger)
+
+ @provider.should be_valid
+ @provider.logger.should_receive(:error).twice
+ @provider.url = "http://invalid.provider/url"
+ @provider.connect.should be_nil
+ end
+
end
|
Add spec for the Provider model.
|
diff --git a/app/models/cupped_coffee.rb b/app/models/cupped_coffee.rb
index abc1234..def5678 100644
--- a/app/models/cupped_coffee.rb
+++ b/app/models/cupped_coffee.rb
@@ -2,6 +2,6 @@ belongs_to :coffee
belongs_to :roaster
belongs_to :cupping
-
+ has_many :scores
validates_presence_of :roast_date
end
|
Add cupped coffee association to scores, pass pending test.
|
diff --git a/app/models/seven_day_mvp.rb b/app/models/seven_day_mvp.rb
index abc1234..def5678 100644
--- a/app/models/seven_day_mvp.rb
+++ b/app/models/seven_day_mvp.rb
@@ -1,9 +1,9 @@ class SevenDayMVP
def self.current
- Product.find_by(slug: 'gamamia')
+ Product.find_by(slug: 'landline')
end
def self.recent
- ['giraff', 'signupsumo'].map { |s| Product.find_by(slug: s) }
+ ['gamamia', 'giraff'].map { |s| Product.find_by(slug: s) }
end
end
|
Update the seven day mvps
|
diff --git a/spec/models/ex_cite/resource_key_spec.rb b/spec/models/ex_cite/resource_key_spec.rb
index abc1234..def5678 100644
--- a/spec/models/ex_cite/resource_key_spec.rb
+++ b/spec/models/ex_cite/resource_key_spec.rb
@@ -0,0 +1,20 @@+require 'rails_helper'
+
+describe ExCite::ResourceKey do
+ let(:included_resource_class){ Class.new{ include ExCite::ResourceKey } }
+ let(:included_resource){ included_resource_class.new }
+
+ describe "resource_key" do
+ subject{ included_resource.resource_key }
+ context "without setting" do
+ before { allow(Digest::SHA1).to receive(:hexdigest).and_return digest }
+ let(:digest){ "yf408f" }
+ pending
+ end
+ context "with setting" do
+ let(:digest){ "my_digest" }
+ before { included_resource.resource_key = digest }
+ it { is_expected.to eq digest }
+ end
+ end
+end
|
Add pending resource key spec
|
diff --git a/test/unit/recipes/kernel_spec.rb b/test/unit/recipes/kernel_spec.rb
index abc1234..def5678 100644
--- a/test/unit/recipes/kernel_spec.rb
+++ b/test/unit/recipes/kernel_spec.rb
@@ -0,0 +1,36 @@+describe 'sys::kernel' do
+ cached(:chef_run) { ChefSpec::SoloRunner.new.converge(described_recipe) }
+
+ context 'attributes are empty' do
+ it 'does nothing' do
+ expect(chef_run.run_context.resource_collection).to be_empty
+ end
+ end
+
+ context 'on Intel' do
+ cached(:chef_run) do
+ ChefSpec::SoloRunner.new do |node|
+ node.default['sys']['kernel']['install_microcode'] = true
+ node.automatic['cpu'][0]['vendor_id'] = 'GenuineIntel'
+ end.converge(described_recipe)
+ end
+
+ it 'installs microcode package' do
+ expect(chef_run).to install_package('intel-microcode')
+ end
+ end
+
+ context 'on AMD' do
+ cached(:chef_run) do
+ ChefSpec::SoloRunner.new do |node|
+ node.default['sys']['kernel']['install_microcode'] = true
+ node.automatic['cpu'][0]['vendor_id'] = 'AuthenticAMD'
+ end.converge(described_recipe)
+ end
+
+ it 'installs microcode package' do
+ expect(chef_run).to install_package('amd64-microcode')
+ end
+ end
+
+end
|
Add test for kernel recipe (microcode updates)
|
diff --git a/spec/github/api/callbacks_spec.rb b/spec/github/api/callbacks_spec.rb
index abc1234..def5678 100644
--- a/spec/github/api/callbacks_spec.rb
+++ b/spec/github/api/callbacks_spec.rb
@@ -28,14 +28,14 @@
describe Github::API, '#callbacks' do
it "retrieves only public api methods" do
- expect(ApiTest.request_methods.to_a).to eq([
+ expect(ApiTest.request_methods.to_a - [
'list',
'list_with_callback_apitest',
'list_without_callback_apitest',
'get',
'get_with_callback_apitest',
'get_without_callback_apitest'
- ])
+ ]).to be_empty
end
it "execute before callback" do
|
Fix spec result dependency for jruby.
|
diff --git a/spec/lib/raml/parser/root_spec.rb b/spec/lib/raml/parser/root_spec.rb
index abc1234..def5678 100644
--- a/spec/lib/raml/parser/root_spec.rb
+++ b/spec/lib/raml/parser/root_spec.rb
@@ -8,10 +8,13 @@ subject { Raml::Parser::Root.new.parse(raml) }
it { should be_kind_of Raml::Root }
- its('resources.count') { should == 2 }
- its('documentation.count') { should == 0 }
its(:uri) { should == 'http://example.api.com/v1' }
its(:version) { should == 'v1' }
+ its('resources.count') { should == 2 }
+ its('resources.first.methods.count') { should == 2 }
+ its('resources.first.methods.first.responses.count') { should == 1 }
+ its('resources.first.methods.first.query_parameters.count') { should == 1 }
+ its('documentation.count') { should == 0 }
context 'trait-inherited attributes' do
subject { Raml::Parser::Root.new.parse(raml).resources.fetch(1).methods.first.query_parameters.first }
|
Clean up root parser specs
|
diff --git a/spec/classes/dependencies_spec.rb b/spec/classes/dependencies_spec.rb
index abc1234..def5678 100644
--- a/spec/classes/dependencies_spec.rb
+++ b/spec/classes/dependencies_spec.rb
@@ -0,0 +1,16 @@+require 'spec_helper'
+
+describe 'rbenv::dependencies' do
+ let(:title) { 'rbenv::dependencies' }
+
+ context 'Ubuntu' do
+ let(:facts) { { :operatingsystem => 'Ubuntu' } }
+ it { should include_class('rbenv::dependencies::ubuntu') }
+ end
+
+ context 'Debian' do
+ let(:facts) { { :operatingsystem => 'Debian' } }
+ it { should include_class('rbenv::dependencies::ubuntu') }
+ end
+
+end
|
Add spec for dependencies class
|
diff --git a/db/migrate/20150709213435_create_votes.rb b/db/migrate/20150709213435_create_votes.rb
index abc1234..def5678 100644
--- a/db/migrate/20150709213435_create_votes.rb
+++ b/db/migrate/20150709213435_create_votes.rb
@@ -1,7 +1,7 @@ class CreateVotes < ActiveRecord::Migration
def change
create_table :votes do |t|
- t.integer :count, null: false, default: 0
+ t.boolean :upvote, null: false
t.references :user
t.references :voteable, polymorphic: true, index: true
t.timestamps null: false
|
Change votes table to have boolean instead of count
|
diff --git a/spree_product_expiry_date.gemspec b/spree_product_expiry_date.gemspec
index abc1234..def5678 100644
--- a/spree_product_expiry_date.gemspec
+++ b/spree_product_expiry_date.gemspec
@@ -16,7 +16,7 @@ s.require_path = 'lib'
s.requirements << 'none'
- s.add_dependency 'spree_core', '~> 1.3.2'
+ s.add_dependency 'spree_core', '~> 1.3'
s.add_dependency 'haml-rails'
s.add_development_dependency 'capybara', '~> 1.1.2'
|
Change dependency level to spree_core
|
diff --git a/scratch/test_01.rb b/scratch/test_01.rb
index abc1234..def5678 100644
--- a/scratch/test_01.rb
+++ b/scratch/test_01.rb
@@ -0,0 +1,24 @@+# Test the ability authenticate
+
+require 'httparty'
+
+TOKEN = '93e1e6aa56d9a1e839a40e0e2021fcef'
+
+response = HTTParty.get('https://www.pivotaltracker.com/services/v5/me',
+ :headers => {"X-TrackerToken" => TOKEN })
+
+puts
+puts "API endpoint '/me'"
+puts "-----------------"
+puts "Username is #{response["username"]}"
+puts "ID is #{response["id"]}"
+puts "Name is #{response["name"]}"
+puts "Email is #{response["email"]}"
+puts "API Token is #{response["api_token"]}"
+puts
+
+
+
+
+
+
|
Test API authentication with simple request
* Executes endpoint /me
* Prints out selected elements of response
|
diff --git a/schreihals.gemspec b/schreihals.gemspec
index abc1234..def5678 100644
--- a/schreihals.gemspec
+++ b/schreihals.gemspec
@@ -25,11 +25,7 @@ gem.add_dependency 'redcarpet'
gem.add_dependency 'rack-cache'
gem.add_dependency 'rack-codehighlighter'
-
- # no schnitzelstyle release so far, so please add this to your
- # blog project's Gemfile instead.
- #
- # gem.add_dependency 'schnitzelstyle'
+ gem.add_dependency 'schnitzelstyle', '>= 0.0.1'
gem.add_development_dependency 'rspec', '>= 2.0.0'
end
|
Include schnitzelstyle in gemspec dependencies.
|
diff --git a/bus-o-matic.gemspec b/bus-o-matic.gemspec
index abc1234..def5678 100644
--- a/bus-o-matic.gemspec
+++ b/bus-o-matic.gemspec
@@ -1,12 +1,12 @@ Gem::Specification.new do |s|
s.name = "bus-o-matic"
- s.version = "0.0.5"
+ s.version = "0.0.6"
s.authors = ["Matt Cone"]
s.email = ["[email protected]"]
s.summary = %q{A wrapper for the Pittsburgh Port Authority TrueTime Bus API}
s.description = %q{A wrapper for the Pittsburgh Port Authority TrueTime Bus API}
- s.homepage = "https://github.com/mattcone/bus-o-matic"
+ s.homepage = "https://www.busomatic.com/"
s.license = "MIT"
s.platform = Gem::Platform::RUBY
|
Update homepage URL and bump version number
|
diff --git a/test/integration/routing_test.rb b/test/integration/routing_test.rb
index abc1234..def5678 100644
--- a/test/integration/routing_test.rb
+++ b/test/integration/routing_test.rb
@@ -14,11 +14,11 @@ end
it 'should not display navigation partial on sign in' do
- refute has_text? 'DARIA - development - DC Abortion Fund'
+ refute has_text? 'DARIA - ' + Rails.env + ' - DC Abortion Fund'
visit root_path
@user = create :user
log_in_as @user
visit authenticated_root_path
- assert has_text? 'DARIA - development - DC Abortion Fund'
+ assert has_text? 'DARIA - ' + Rails.env + ' - DC Abortion Fund'
end
end
|
Make test resilent to env change
|
diff --git a/lib/omniauth/strategies/github.rb b/lib/omniauth/strategies/github.rb
index abc1234..def5678 100644
--- a/lib/omniauth/strategies/github.rb
+++ b/lib/omniauth/strategies/github.rb
@@ -27,6 +27,10 @@ }
end
+ extra do
+ {:user_hash => raw_info}
+ end
+
def raw_info
access_token.options[:mode] = :query
@raw_info ||= access_token.get('/user').parsed
|
Include the raw user response from GitHub in OmniAuth's extra information, just like the old days
|
diff --git a/lib/websocket_adapter/standard.rb b/lib/websocket_adapter/standard.rb
index abc1234..def5678 100644
--- a/lib/websocket_adapter/standard.rb
+++ b/lib/websocket_adapter/standard.rb
@@ -8,7 +8,6 @@
secure = Rack::Request.new(env).ssl?
scheme = secure ? 'wss:' : 'ws:'
- # FIXME: this should be generated by URI::Generic.build
@url = scheme + '//' + env['HTTP_HOST'] + env['REQUEST_URI']
@driver = WebSocket::Driver.rack(self, :protocols => [protocol])
|
Remove the FIXME related to URL building in websocket adapter
|
diff --git a/translate/spec/quickstart_spec.rb b/translate/spec/quickstart_spec.rb
index abc1234..def5678 100644
--- a/translate/spec/quickstart_spec.rb
+++ b/translate/spec/quickstart_spec.rb
@@ -13,7 +13,7 @@ # limitations under the License.
require "rspec"
-require "google/cloud"
+require "google/cloud/translate"
describe "Translate Quickstart" do
|
Fix dependency in Translate Quickstart spec
|
diff --git a/connection.gemspec b/connection.gemspec
index abc1234..def5678 100644
--- a/connection.gemspec
+++ b/connection.gemspec
@@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = 'connection'
- s.version = '0.0.3.1'
+ s.version = '0.0.4.0'
s.summary = 'TCP client/server connection library offering both blocking and non/blocking operation'
s.description = ' '
|
Package version is increased from 0.0.3.1 to 0.0.4.0
|
diff --git a/builder/gemfile_mergator.rb b/builder/gemfile_mergator.rb
index abc1234..def5678 100644
--- a/builder/gemfile_mergator.rb
+++ b/builder/gemfile_mergator.rb
@@ -20,7 +20,7 @@ master << line
end
- if line[0, 7] == 'source '
+ if line[0, 7] == 'source ' || line[0, 3] == 'end'
master << line
end
end
@@ -42,7 +42,7 @@ def get_gem_name(txt)
#p "is_gem_line? of #{txt}"
- return nil unless txt[0,4] == 'gem '
+ return nil unless /^\s*gem/.match(txt)
sp = txt.split('\'')
p sp
@@ -51,4 +51,4 @@
#p "gives #{sp[1]}"
sp[1]
-end+end
|
Allow source blocks in agent gemfiles
* make sure to keep any end lines
* allow whitespace in front of gem definitions
|
diff --git a/lib/sandthorn_driver_sequel/wrappers/event_wrapper.rb b/lib/sandthorn_driver_sequel/wrappers/event_wrapper.rb
index abc1234..def5678 100644
--- a/lib/sandthorn_driver_sequel/wrappers/event_wrapper.rb
+++ b/lib/sandthorn_driver_sequel/wrappers/event_wrapper.rb
@@ -2,7 +2,7 @@ module SandthornDriverSequel
class EventWrapper < SimpleDelegator
- [:aggregate_version, :event_name, :event_data].each do |attribute|
+ [:aggregate_version, :event_name, :event_data, :timestamp, :aggregate_table_id].each do |attribute|
define_method(attribute) do
fetch(attribute)
end
|
Add some accessors to event wrapper
|
diff --git a/spec/route_spec.rb b/spec/route_spec.rb
index abc1234..def5678 100644
--- a/spec/route_spec.rb
+++ b/spec/route_spec.rb
@@ -10,4 +10,10 @@ it "fetches routes by tag" do
Muni::Route.find(21).tag.should == "21"
end
+
+ it "should have the correct lon and lat" do
+ r21 = Muni::Route.find(21)
+ r21.inbound.stops.first.lon.should == "-122.46384"
+ r21.inbound.stops.first.lat.should == "37.7735299"
+ end
end
|
Add test to cover lat and lon accuracy
|
diff --git a/spec/hamlit/engine/doctype_spec.rb b/spec/hamlit/engine/doctype_spec.rb
index abc1234..def5678 100644
--- a/spec/hamlit/engine/doctype_spec.rb
+++ b/spec/hamlit/engine/doctype_spec.rb
@@ -7,5 +7,13 @@ <!DOCTYPE html>
HTML
end
+
+ it 'renders xml doctype' do
+ assert_render(<<-HAML, <<-HTML)
+ !!! XML
+ HAML
+ <?xml version='1.0' encoding='utf-8' ?>
+ HTML
+ end
end
end
|
Add spec for xml doctype
|
diff --git a/eventstore/recipes/install.rb b/eventstore/recipes/install.rb
index abc1234..def5678 100644
--- a/eventstore/recipes/install.rb
+++ b/eventstore/recipes/install.rb
@@ -7,7 +7,8 @@ [io.compression.zipfile]::ExtractToDirectory("$env:TEMP\\eventstore.zip", "#{node[:eventstore][:destination_path]}")
$choco = [Environment]::GetEnvironmentVariable("ChocolateyInstall", "Machine") + "\\choco.exe"
& $choco install nssm --acceptlicense --yes --force
- nssm install EventStore "#{node[:eventstore][:destination_path]}\\EventStore.ClusterNode.exe" --db ./db --log ./logs
+ $nssm = $choco + "\\bin\\nssm.exe"
+ & $nssm install EventStore "#{node[:eventstore][:destination_path]}\\EventStore.ClusterNode.exe" --db ./db --log ./logs
EOH
action :run
not_if do ::Win32::Service.exists?('EventStore') end
|
Update path or nssm call
|
diff --git a/ael_tracker.gemspec b/ael_tracker.gemspec
index abc1234..def5678 100644
--- a/ael_tracker.gemspec
+++ b/ael_tracker.gemspec
@@ -18,7 +18,7 @@ spec.add_development_dependency "webmock"
spec.add_development_dependency 'json'
- spec.files = `git ls-files`.split("\n")
+ spec.files = Dir["{lib}/**/*.rb", "LICENSE", "*.md"]
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"]
|
Change gemspec for push to rubygems
|
diff --git a/app/adapters/beeminder_adapter.rb b/app/adapters/beeminder_adapter.rb
index abc1234..def5678 100644
--- a/app/adapters/beeminder_adapter.rb
+++ b/app/adapters/beeminder_adapter.rb
@@ -35,7 +35,7 @@ dp.timestamp > RECENT_INTERVAL
end
rescue
- Rails.logger.error("Failed to fetch datapoints for slug #{slug} of goal #{goal.id}")
+ Rails.logger.error("Failed to fetch datapoints for slug #{slug} of goal #{goal.inspect}")
raise
end
end
|
Fix error message when datapoint fetch fails
|
diff --git a/app/services/builders/registry.rb b/app/services/builders/registry.rb
index abc1234..def5678 100644
--- a/app/services/builders/registry.rb
+++ b/app/services/builders/registry.rb
@@ -9,7 +9,7 @@
def registered_builders
if @registered_builders.blank?
- Builders::Registry.register(Builders::TestRail) unless Chamber.env.test_rail.nil?
+ Builders::Registry.register(Builders::TestRail) if Chamber.env.test_rail?
Builders::Registry.register(Builders::ManualBuilder)
end
@registered_builders.values unless @registered_builders.blank?
|
Change to use Chamber method
|
diff --git a/test/cases/inheritance_test_sqlserver.rb b/test/cases/inheritance_test_sqlserver.rb
index abc1234..def5678 100644
--- a/test/cases/inheritance_test_sqlserver.rb
+++ b/test/cases/inheritance_test_sqlserver.rb
@@ -11,7 +11,6 @@ include SqlserverCoercedTest
def test_coerced_test_eager_load_belongs_to_primary_key_quoting
- con = Account.connection
assert_sql(/\(\[companies\].\[id\] = 1\)/) do
Account.find(1, :include => :firm)
end
|
Remove unused con local var.
|
diff --git a/test/controllers/home_controller_test.rb b/test/controllers/home_controller_test.rb
index abc1234..def5678 100644
--- a/test/controllers/home_controller_test.rb
+++ b/test/controllers/home_controller_test.rb
@@ -5,4 +5,11 @@ get root_url
assert_response :success
end
+
+ test "should create user and return sentence" do
+ post '/markov/fetch_twitter_chain.json', params: {:twitter_username => 'colinfike'}, xhr: true
+ assert_equal JSON.parse(@response.body)['sentence'], 'Hey funny stuff.'
+ assert_nil JSON.parse(@response.body)['error']
+ assert_equal @response.content_type, 'application/json'
+ end
end
|
Add functional test for markov controller
|
diff --git a/fabrication.gemspec b/fabrication.gemspec
index abc1234..def5678 100644
--- a/fabrication.gemspec
+++ b/fabrication.gemspec
@@ -10,13 +10,13 @@ s.license = "MIT"
s.authors = ["Paul Elliott"]
- s.email = ["[email protected]"]
+ s.email = ["[email protected]"]
s.description = "Fabrication is an object generation framework for ActiveRecord, Mongoid, DataMapper, Sequel, or any other Ruby object."
s.homepage = "http://fabricationgem.org"
s.require_paths = ["lib"]
s.rubygems_version = "1.3.7"
- s.summary = "Fabrication provides a simple solution for test object generation."
+ s.summary = "Implementing the factory pattern in Ruby so you don't have to."
s.required_ruby_version = '>= 1.9.3'
|
Update summary and email in gemspec
|
diff --git a/config/initializers/haml.rb b/config/initializers/haml.rb
index abc1234..def5678 100644
--- a/config/initializers/haml.rb
+++ b/config/initializers/haml.rb
@@ -1,5 +1,2 @@ Haml::Template.options[:format] = :html5
Haml::Template.options[:ugly] = RAILS_ENV == 'production'
-
-#Compass.sass_engine_options[:load_paths].unshift "#{Rails.root}/public/stylesheets/sass"
-#raise Compass.sass_engine_options.inspect
|
Remove commented stuff that didn't work.
|
diff --git a/app/models/award.rb b/app/models/award.rb
index abc1234..def5678 100644
--- a/app/models/award.rb
+++ b/app/models/award.rb
@@ -4,7 +4,9 @@
def self.load_from_hash(properties)
# Load the data only if it's a public works award
- return unless properties['[QCLO] Es Obra Pública']=='S'
+ # FIXME: Let's load the whole thing temporarily and use the database to check
+ # whether we're doing it correctly.
+ # return unless properties['[QCLO] Es Obra Pública']=='S'
public_body = PublicBody.where(name: properties['Entidad adjudicadora - Organismo']).first_or_create
bidder = Bidder.where(name: properties['Formalización del contrato - Contratista']).first_or_create
|
Load all contracts -public works or not- temporarily, to inspect the data
|
diff --git a/app/models/phone.rb b/app/models/phone.rb
index abc1234..def5678 100644
--- a/app/models/phone.rb
+++ b/app/models/phone.rb
@@ -2,7 +2,7 @@
belongs_to :user
- enum kind: {home: 0, work: 1, cell: 2}
+ enum kind: {daytime: 0, evening: 1, cell: 2}
validates :kind, :number, presence: true
|
Rename home to evening and work to daytime and make daytime default.
|
diff --git a/app/models/share.rb b/app/models/share.rb
index abc1234..def5678 100644
--- a/app/models/share.rb
+++ b/app/models/share.rb
@@ -7,7 +7,7 @@ validates_url_format_of :content_url, :message => 'is not a valid url'
validates_url_format_of :header_url, :message => 'is not a valid url'
- COLOR_REGEX = /\A\s*#([0-9a-f]{3}){1,2}\s*\Z/
+ COLOR_REGEX = /\A\s*#([0-9a-fA-F]{3}){1,2}\s*\Z/
validates_format_of :header_background_color, with: COLOR_REGEX
validates_format_of :header_text_color, with: COLOR_REGEX
end
|
Validate color with uppercase notation
|
diff --git a/lib/ext_scaffold_core_extensions/array.rb b/lib/ext_scaffold_core_extensions/array.rb
index abc1234..def5678 100644
--- a/lib/ext_scaffold_core_extensions/array.rb
+++ b/lib/ext_scaffold_core_extensions/array.rb
@@ -17,7 +17,14 @@ end
element_count = options.delete(:count) || self.length
- { :results => element_count, element_class.to_s.underscore.pluralize => self }.to_json(options)
+ # Only apply the ActiveRecord JSON options
+ if (options[:ar_options])
+ r2 = self.map { | i | i.to_json(options[:ar_options]) }
+ r = "{ \"results\" : #{element_count}, \"#{element_class.to_s.underscore.pluralize}\" : [#{r2.join(", ")}] }"
+ else
+ r = { :results => element_count, element_class.to_s.underscore.pluralize => self }.to_json(options)
+ end
+ return r
end
end
|
Allow ActiveRecord to_json options to be specified, like :only or :methods (reduces JSON payload)
|
diff --git a/lib/file_data/formats/mpeg4/box_stream.rb b/lib/file_data/formats/mpeg4/box_stream.rb
index abc1234..def5678 100644
--- a/lib/file_data/formats/mpeg4/box_stream.rb
+++ b/lib/file_data/formats/mpeg4/box_stream.rb
@@ -28,7 +28,11 @@ end
def self.for_box(stream, box)
- BoxesReader.new(stream, box.content_pos, lambda { |s| s.pos >= box.content_pos + box.content_size })
+ for_position(stream, box.content_pos, box.content_size)
+ end
+
+ def self.for_position(stream, pos, size)
+ BoxesReader.new(stream, pos, lambda { |s| s.pos >= pos + size})
end
end
end
|
Add BoxesReader method to read at a specific stream position
|
diff --git a/lib/gitlab/ci/config/node/configurable.rb b/lib/gitlab/ci/config/node/configurable.rb
index abc1234..def5678 100644
--- a/lib/gitlab/ci/config/node/configurable.rb
+++ b/lib/gitlab/ci/config/node/configurable.rb
@@ -51,12 +51,12 @@ def helpers(*nodes)
nodes.each do |symbol|
define_method("#{symbol}_defined?") do
- @entries[symbol].specified?
+ @entries[symbol].specified? if @entries[symbol]
end
define_method("#{symbol}_value") do
raise Entry::InvalidError unless valid?
- @entries[symbol].try(:value)
+ @entries[symbol].value if @entries[symbol]
end
alias_method symbol.to_sym, "#{symbol}_value".to_sym
|
Fix using `try` on delegators in CI config entries
See:
https://github.com/rails/rails/commit/af53280a4b5b3323ac87dc60deb2b1b781197b2b
|
diff --git a/lib/keyline/resources/master_signature.rb b/lib/keyline/resources/master_signature.rb
index abc1234..def5678 100644
--- a/lib/keyline/resources/master_signature.rb
+++ b/lib/keyline/resources/master_signature.rb
@@ -2,9 +2,9 @@ class MasterSignature
include Resource
include Writeable::Resource
-
- attributes :name, :mode, :folding_pattern, :layout, :first_page, :last_page
- writeable_attributes :name, :mode, :first_page, :last_page, :layout
+
+ attributes :name, :mode, :kind, :folding_pattern, :layout, :first_page, :last_page
+ writeable_attributes :name, :mode, :kind, :folding_pattern, :layout, :first_page, :last_page
associations :signatures
def box
|
Allow master signature kind and layout to be set
|
diff --git a/spec/functional/command/init_spec.rb b/spec/functional/command/init_spec.rb
index abc1234..def5678 100644
--- a/spec/functional/command/init_spec.rb
+++ b/spec/functional/command/init_spec.rb
@@ -1,29 +1,53 @@ require File.expand_path('../../../spec_helper', __FILE__)
+require 'xcodeproj'
+
module Pod
+
describe Command::Init do
- it "runs with no parameters" do
- lambda { run_command('init') }.should.not.raise CLAide::Help
+ it "complains if project does not exist" do
+ lambda { run_command('init') }.should.raise CLAide::Help
+ lambda { run_command('init', 'foo.xcodeproj') }.should.raise CLAide::Help
end
- it "complains when given parameters" do
- lambda { run_command('init', 'create') }.should.raise CLAide::Help
- lambda { run_command('init', '--create') }.should.raise CLAide::Help
- lambda { run_command('init', 'NAME') }.should.raise CLAide::Help
- lambda { run_command('init', 'createa') }.should.raise CLAide::Help
- lambda { run_command('init', 'agument1', '2') }.should.raise CLAide::Help
- lambda { run_command('init', 'which') }.should.raise CLAide::Help
- lambda { run_command('init', 'cat') }.should.raise CLAide::Help
- lambda { run_command('init', 'edit') }.should.raise CLAide::Help
+ it "complains if wrong parameters" do
+ lambda { run_command('too', 'many') }.should.raise CLAide::Help
end
- extend SpecHelper::TemporaryRepos
+ it "complains if more than one project exists and none is specified" do
+ pwd = Dir.pwd
+ Dir.chdir(temporary_directory)
- it "creates a Podfile" do
+ Xcodeproj::Project.new.save_as(temporary_directory + 'test1.xcodeproj')
+ Xcodeproj::Project.new.save_as(temporary_directory + 'test2.xcodeproj')
+ lambda { run_command('init') }.should.raise CLAide::Help
+
+ Dir.chdir(pwd)
+ end
+
+ it "creates a Podfile for a project in current directory" do
+ pwd = Dir.pwd
+ Dir.chdir(temporary_directory)
+
+ Xcodeproj::Project.new.save_as(temporary_directory + 'test1.xcodeproj')
run_command('init')
- path = temporary_directory + 'Podfile'
- File.exists?(path).should == true
+ Pathname.new(temporary_directory + 'Podfile').exist?.should == true
+
+ Dir.chdir(pwd)
end
+
+ it "creates a Podfile for a specified project" do
+ pwd = Dir.pwd
+ Dir.chdir(temporary_directory)
+
+ Xcodeproj::Project.new.save_as(temporary_directory + 'test1.xcodeproj')
+ Xcodeproj::Project.new.save_as(temporary_directory + 'test2.xcodeproj')
+ run_command('init', 'test2.xcodeproj')
+ Pathname.new(temporary_directory + 'Podfile').exist?.should == true
+
+ Dir.chdir(pwd)
+ end
+
end
end
|
Add a more thorough spec for init command.
|
diff --git a/spec/support/activerecord_backend.rb b/spec/support/activerecord_backend.rb
index abc1234..def5678 100644
--- a/spec/support/activerecord_backend.rb
+++ b/spec/support/activerecord_backend.rb
@@ -2,7 +2,7 @@
ActiveRecord::Base.establish_connection(
:adapter => "sqlite3",
- :database => "test.db"
+ :database => ":memory:"
)
require "schema.rb"
|
Use an in-memory SQLite database to test activerecord backend
|
diff --git a/tasks/release.rake b/tasks/release.rake
index abc1234..def5678 100644
--- a/tasks/release.rake
+++ b/tasks/release.rake
@@ -18,7 +18,7 @@ end
# Login to RubyGems if needed
- system "gem push 2>/dev/null"
+ system "gem signin 2>/dev/null"
# Release the gem
Rake::Task[:release].invoke(args[:remote])
|
Update RubyGems login command in rake task.
|
diff --git a/test/test_scope.rb b/test/test_scope.rb
index abc1234..def5678 100644
--- a/test/test_scope.rb
+++ b/test/test_scope.rb
@@ -3,18 +3,18 @@ class TestRakeScope < Rake::TestCase
include Rake
- def test_empty_scope
+ def test_path_against_empty_scope
scope = Scope.make
assert_equal scope, Scope::EMPTY
assert_equal scope.path, ""
end
- def test_with_one_element
+ def test_path_against_one_element
scope = Scope.make(:one)
assert_equal "one", scope.path
end
- def test_with_two_elements
+ def test_path_against_two_elements
scope = Scope.make(:inner, :outer)
assert_equal "outer:inner", scope.path
end
@@ -24,12 +24,12 @@ assert_equal "outer:inner:task", scope.path_with_task_name("task")
end
- def test_path_with_task_name_on_empty_scope
+ def test_path_with_task_name_against_empty_scope
scope = Scope.make
assert_equal "task", scope.path_with_task_name("task")
end
- def test_scope_conj
+ def test_conj_against_two_elements
scope = Scope.make.conj("B").conj("A")
assert_equal Scope.make("A", "B"), scope
end
|
Clean up some test names
|
diff --git a/green-button-data.gemspec b/green-button-data.gemspec
index abc1234..def5678 100644
--- a/green-button-data.gemspec
+++ b/green-button-data.gemspec
@@ -21,5 +21,5 @@ s.add_dependency 'sax-machine', '~> 1.3'
s.add_development_dependency 'rspec', '~> 3.0'
- s.add_development_dependency 'guard'
+ s.add_development_dependency 'guard', '~2.13'
end
|
Use pessimistic versioning for guard
|
diff --git a/battle_ship.gemspec b/battle_ship.gemspec
index abc1234..def5678 100644
--- a/battle_ship.gemspec
+++ b/battle_ship.gemspec
@@ -10,7 +10,7 @@ spec.email = ["[email protected]"]
spec.description = %q{Adds counters to cache when successful read operation completes in order to track Rails.cache hits & misses}
spec.summary = %q{Wrapper for Rails.cache methods}
- spec.homepage = "http://www.dmragone.com"
+ spec.homepage = "https://github.com/DavidRagone/BattleShip"
spec.license = "MIT"
spec.files = `git ls-files`.split($/)
|
Change gemspec website to github website
|
diff --git a/include_any.gemspec b/include_any.gemspec
index abc1234..def5678 100644
--- a/include_any.gemspec
+++ b/include_any.gemspec
@@ -11,6 +11,7 @@ gem.description = %q{Allows including any object}
gem.summary = %q{Allows including any object}
gem.homepage = "http://johnandrewmarshall.com/projects/include_any"
+ gem.license = 'MIT'
gem.files = `git ls-files`.split($/)
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
Include license name in gemspec
|
diff --git a/test/integration/helpers/serverspec/service_common.rb b/test/integration/helpers/serverspec/service_common.rb
index abc1234..def5678 100644
--- a/test/integration/helpers/serverspec/service_common.rb
+++ b/test/integration/helpers/serverspec/service_common.rb
@@ -19,9 +19,9 @@ end
shared_examples_for 'a kafka start command' do
- describe '/var/log/kafka/kafka.log' do
+ describe '/var/log/kafka/kafka-server.log' do
let :log_file do
- file '/var/log/kafka/kafka.log'
+ file '/var/log/kafka/kafka-server.log'
end
it 'exists' do
@@ -46,10 +46,10 @@
shared_examples_for 'a kafka stop command' do
let :log_file do
- file '/var/log/kafka/kafka.log'
+ file '/var/log/kafka/kafka-server.log'
end
- describe '/var/log/kafka/kafka.log' do
+ describe '/var/log/kafka/kafka-server.log' do
it 'exists' do
expect(log_file).to be_a_file
end
|
Update path to Kafka log file in integration tests, properly
Never mind the idiot who apparently does not know how to use Git at all.
At least I didn’t force push master, yay me.
|
diff --git a/lib/grouped_time_zones/view_helpers.rb b/lib/grouped_time_zones/view_helpers.rb
index abc1234..def5678 100644
--- a/lib/grouped_time_zones/view_helpers.rb
+++ b/lib/grouped_time_zones/view_helpers.rb
@@ -7,7 +7,7 @@
def grouped_time_zones
us_zones = ActiveSupport::TimeZone.us_zones
- other_zones = ActiveSupport::TimeZone.all.sort - us_zones
+ other_zones = ActiveSupport::TimeZone.all.reject{|tz| tz.name =~ %r{/} }.sort - us_zones
zone_options = lambda do |zones|
zones.map { |tz| [tz.to_s, tz.tzinfo.identifier] }
end
|
Exclude TZInfo time zones which get cached in TimeZone.all
|
diff --git a/cdistance.gemspec b/cdistance.gemspec
index abc1234..def5678 100644
--- a/cdistance.gemspec
+++ b/cdistance.gemspec
@@ -8,15 +8,13 @@ spec.version = Cdistance::VERSION
spec.authors = ["Cainã Costa"]
spec.email = ["[email protected]"]
- spec.summary = %q{TODO: Write a short summary. Required.}
- spec.description = %q{TODO: Write a longer description. Optional.}
+ spec.summary = %q{Distance between two geographic points in pure C.}
spec.homepage = ""
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.extensions = ["ext/cdistance/extconf.rb"]
spec.add_development_dependency "bundler", "~> 1.7"
spec.add_development_dependency "rake", "~> 10.0"
|
Add extconf.rb to extensions path
|
diff --git a/lib/codeclimate_ci/get_gpa.rb b/lib/codeclimate_ci/get_gpa.rb
index abc1234..def5678 100644
--- a/lib/codeclimate_ci/get_gpa.rb
+++ b/lib/codeclimate_ci/get_gpa.rb
@@ -2,30 +2,40 @@
module CodeclimateCi
class GetGpa
- RETRY_TIMEOUT = ENV['RETRY_TIMEOUT'] || 10
- NO_BRANCH_INFO_ERROR = Class.new(Exception)
+ RETRY_COUNT = ENV['RETRY_COUNT'] || 3
+ SLEEP_TIME = ENV['SLEEP_TIME'] || 5
def initialize(codeclimate_api, branch)
@codeclimate_api, @branch = codeclimate_api, branch
end
def gpa
- branch_info['last_snapshot']['gpa'].to_f
+ retrieve_branch_info
end
private
- def branch_info
- @branch_info ||= timeout(RETRY_TIMEOUT) { retrieve_branch_info }
+ def retrieve_branch_info
+ RETRY_COUNT.times do
+ if analyzed?
+ return last_snapshot_gpa
+ else
+ Messages.result_not_ready
+ sleep(SLEEP_TIME)
+ end
+ end
end
- def retrieve_branch_info
- info = @codeclimate_api.branch_info(@branch)
- fail(NO_BRANCH_INFO_ERROR) unless info.include?('last_snapshot')
+ def last_snapshot_gpa
+ branch_info['last_snapshot']['gpa'].to_f
+ end
- info
- rescue NO_BRANCH_INFO_ERROR
- sleep(2) && retry
+ def analyzed?
+ branch_info.include?('last_snapshot')
+ end
+
+ def branch_info
+ @branch_info ||= @codeclimate_api.branch_info(@branch)
end
end
end
|
Change branch checking logic from timeout to checking in cycle
|
diff --git a/sfn.gemspec b/sfn.gemspec
index abc1234..def5678 100644
--- a/sfn.gemspec
+++ b/sfn.gemspec
@@ -14,5 +14,6 @@ s.add_dependency 'miasma'
s.add_dependency 'net-ssh'
s.add_dependency 'sparkle_formation', '>= 0.2.8'
+ s.executables << 'sfn'
s.files = Dir['{lib,bin}/**/*'] + %w(sfn.gemspec README.md CHANGELOG.md LICENSE)
end
|
Include executable delivered with gem
|
diff --git a/lib/liquid_markdown/render.rb b/lib/liquid_markdown/render.rb
index abc1234..def5678 100644
--- a/lib/liquid_markdown/render.rb
+++ b/lib/liquid_markdown/render.rb
@@ -28,7 +28,7 @@ end
def liquidize
- t = Liquid::Template.parse(@template)
+ t = Liquid::Template.parse(@template, global_filters: ['strip_html'])
var = strip_html(liquid_hash)
t.render(var, LIQUID_OPTIONS)
end
|
Add strip_html as global filter
|
diff --git a/lib/owlsync/strategies/ec2.rb b/lib/owlsync/strategies/ec2.rb
index abc1234..def5678 100644
--- a/lib/owlsync/strategies/ec2.rb
+++ b/lib/owlsync/strategies/ec2.rb
@@ -19,7 +19,7 @@ end
def target?(instance)
- instance.tags['aws:autoscaling:groupName'] == tag
+ instance.tags[tag[:key]] == tag[:value]
end
end
end
|
Change EC2 instance tag to Hash(key and value).
|
diff --git a/lib/pansophy_authenticator.rb b/lib/pansophy_authenticator.rb
index abc1234..def5678 100644
--- a/lib/pansophy_authenticator.rb
+++ b/lib/pansophy_authenticator.rb
@@ -27,7 +27,7 @@ define_singleton_method(method) { |*args| ApplicationKeys.send(method, *args) }
end
- class Error < StandardError; end
+ Error = Class.new(StandardError)
end
require 'pansophy_authenticator/configuration'
|
Use alternative definition for Error
|
diff --git a/lib/tasks/update_posters.rake b/lib/tasks/update_posters.rake
index abc1234..def5678 100644
--- a/lib/tasks/update_posters.rake
+++ b/lib/tasks/update_posters.rake
@@ -3,8 +3,6 @@ puts "Updating posters..."
Movie.connection
Movie.all.each do |movie|
- movie.update_poster
- p movie.poster
+ movie.fetch_poster
end
- puts "done."
end
|
Fix poster fetch rake task bug
|
diff --git a/lib/web_bouncer/middleware.rb b/lib/web_bouncer/middleware.rb
index abc1234..def5678 100644
--- a/lib/web_bouncer/middleware.rb
+++ b/lib/web_bouncer/middleware.rb
@@ -2,9 +2,18 @@
module WebBouncer
class Middleware < Roda
- plugin :middleware
+ plugin :middleware do |middleware, config, &block|
+ config[:model] ||= :account
+ config[:login_redirect] ||= '/'
+ config[:logout_redirect] ||= '/'
+
+ middleware.opts[:config] = config
+ block.call(middleware) if block
+ end
route do |r|
+ config = opts[:config]
+
r.is 'auth/failure' do
Matcher.call(OauthContainer['oauth.failure'].call) do |m|
m.success do |v|
@@ -20,14 +29,14 @@ r.is 'auth/logout' do
Matcher.call(OauthContainer['oauth.logout'].call) do |m|
m.success do |value|
- session[:account] = value
+ session[config[:model]] = value
end
m.failure do |v|
end
end
- r.redirect "/"
+ r.redirect config[:logout_redirect]
end
r.on 'auth/:provider/callback' do |provider|
@@ -35,14 +44,14 @@
Matcher.call(action.call) do |m|
m.success do |value|
- session[:account] = value
+ session[config[:model]] = value
end
m.failure do |v|
end
end
- r.redirect "/"
+ r.redirect config[:login_redirect]
end
end
end
|
Create simple config without global state
|
diff --git a/lib/dotenv/rails.rb b/lib/dotenv/rails.rb
index abc1234..def5678 100644
--- a/lib/dotenv/rails.rb
+++ b/lib/dotenv/rails.rb
@@ -17,8 +17,6 @@ # Dotenv Railtie for using Dotenv to load environment from a file into
# Rails applications
class Railtie < Rails::Railtie
- config.before_configuration { load }
-
# Public: Load dotenv
#
# This will get called during the `before_configuration` callback, but you
@@ -43,5 +41,7 @@ def self.load
instance.load
end
+
+ config.before_configuration { load }
end
end
|
Reorder to make the load method available
We are getting the following error when trying to use `require "dotenv/rails-now"`
> /Users/mikaelhenriksson/.rvm/gems/ruby-2.1.8/gems/activesupport-3.2.22.6/lib/active_support/dependencies.rb:243:in `load': wrong number of arguments (0 for 1..2) (ArgumentError)
> from /Users/mikaelhenriksson/.rvm/gems/ruby-2.1.8/gems/dotenv-rails-2.0.1/lib/dotenv/rails.rb:20:in `block in <class:Railtie>'
Reordering the file so that the methods are defined before using them fixes this problem. Our codebase is from 2005 so I am sure it could be fixed in other ways but this is verified to fix our problem.
|
diff --git a/common_courses.rb b/common_courses.rb
index abc1234..def5678 100644
--- a/common_courses.rb
+++ b/common_courses.rb
@@ -3,7 +3,7 @@ # that are contained in both arrays, sorted in ascending order, one per line
def get_common_courses(courses1, courses2)
- puts courses1 & courses2
+ puts (courses1 & courses2).sort
end
c1 = [1, 2, 8, 4, 5, 8, 3]
|
Complete solution for common courses.
|
diff --git a/lib/konnect/game.rb b/lib/konnect/game.rb
index abc1234..def5678 100644
--- a/lib/konnect/game.rb
+++ b/lib/konnect/game.rb
@@ -1,4 +1,5 @@ class Konnect::Game
+ attr :board
attr :pairs
def initialize board_size, pairs
|
Use shoes to construct GUI
|
diff --git a/config/unicorn.rb b/config/unicorn.rb
index abc1234..def5678 100644
--- a/config/unicorn.rb
+++ b/config/unicorn.rb
@@ -1,4 +1,6 @@-listen 'unicorn.sock', :backlog => 1024
+@dir = File.expand_path(File.dirname(__FILE__))
+listen File.join(@dir, "../unicorn.sock"), :backlog => 1024
+
worker_processes ENV.fetch('WORKER_PROCESSES', 3).to_i
timeout 180
|
Correct issue with listen socket format
|
diff --git a/lib/bootstrap-sass/compass_functions.rb b/lib/bootstrap-sass/compass_functions.rb
index abc1234..def5678 100644
--- a/lib/bootstrap-sass/compass_functions.rb
+++ b/lib/bootstrap-sass/compass_functions.rb
@@ -14,6 +14,11 @@
protected
def sprockets_context # :nodoc:
- options[:sprockets][:context]
+ if options.key?(:sprockets)
+ options[:sprockets][:context]
+ else
+ # Compatibility with sprockets pre 2.10.0
+ options[:importer].context
+ end
end
end
|
Use correct reference to context through the importer
Fixes #366 in the correct way, hopefully.
I can't cite my sources well, since Sprockets is very difficult to follow... but suffice to say the global options hash sent to the Tilt SASS template engine always has a reference to the Sprockets importer, and the importer always has a reference to the context. Tested with Sprockets 2.2.2 with and without Rails.
|
diff --git a/lib/capistrano/tasks/server_deploy.rake b/lib/capistrano/tasks/server_deploy.rake
index abc1234..def5678 100644
--- a/lib/capistrano/tasks/server_deploy.rake
+++ b/lib/capistrano/tasks/server_deploy.rake
@@ -0,0 +1,31 @@+task :server_deploy do
+ on "[email protected]" do
+ execute "~/server_deploy"
+ end
+end
+
+
+# The server-side script exists to do all the work on the server rather than ssh from the client for each command.
+# When we ssh for each command, the MFA confirmation pops up for each command. By running this script, we avoid having
+# to do an MFA confirm a dozen times throughout the deploy.
+#
+# Below is the content of /home/tibbs001/server_deploy on ctti-web-dev-01
+
+#release_dir=`date +%Y%m%d%H%M%S`
+#mkdir -p /tmp
+#chmod 700 /tmp/git-ssh-aact-development-tibbs001.sh
+#git ls-remote [email protected]:ctti-clinicaltrials/aact.git HEAD >> REVISION
+#mkdir -p /srv/ctti/www/aact/shared /srv/ctti/www/aact/releases
+#mkdir -p /srv/ctti/www/aact/shared/public/assets
+#mkdir -p /srv/ctti/www/aact/releases/${release_dir}
+#rm -rf aact
+#git clone [email protected]:ctti-clinicaltrials/aact.git; cd ~/aact; git checkout development
+#cd ~/aact; git remote set-url origin [email protected]:ctti-clinicaltrials/aact.git; git remote update --prune
+#cd ~/aact; git archive development | /usr/bin/env tar -x -f - -C /srv/ctti/www/aact/releases/${release_dir}
+#mkdir -p /srv/ctti/www/aact/releases/${release_dir}/public
+#ln -s /srv/ctti/www/aact/shared/public/assets /srv/ctti/www/aact/releases/${release_dir}/public/assets
+#cd /srv/ctti/www/aact/releases/${release_dir}; gem install bundler
+#cd /srv/ctti/www/aact/releases/${release_dir}; bundle install --path /srv/ctti/www/aact/shared/bundle #--quiet
+#ln -s /srv/ctti/www/aact/current /srv/ctti/www/aact/releases/${release_dir}
+
+
|
aact-457: Add rake file to run all deployment commands from the development server. Do this to avoid having to verify MFA for each ssh command. (Need to adapt this when we get production up and running.
|
diff --git a/lib/gitlab/ci/pipeline/chain/command.rb b/lib/gitlab/ci/pipeline/chain/command.rb
index abc1234..def5678 100644
--- a/lib/gitlab/ci/pipeline/chain/command.rb
+++ b/lib/gitlab/ci/pipeline/chain/command.rb
@@ -46,7 +46,7 @@ end
def before_sha
- checkout_sha || before_sha || Gitlab::Git::BLANK_SHA
+ before_sha || checkout_sha || Gitlab::Git::BLANK_SHA
end
def protected_ref?
@@ -54,10 +54,6 @@ project.protected_for?(ref)
end
end
-
- def error(message)
- pipeline.errors.add(:base, message)
- end
end
end
end
|
Fix a bug of before_sha being inproperly evaluated to `checkout_sha`
|
diff --git a/lib/vocker/cap/debian/docker_install.rb b/lib/vocker/cap/debian/docker_install.rb
index abc1234..def5678 100644
--- a/lib/vocker/cap/debian/docker_install.rb
+++ b/lib/vocker/cap/debian/docker_install.rb
@@ -4,15 +4,15 @@ module Debian
module DockerInstall
def self.docker_install(machine)
- # Inspired on https://github.com/progrium/dokku/blob/master/Makefile#L33-L40
machine.communicate.tap do |comm|
- # TODO: Try to not depend on installing software-properties-common
- comm.sudo("apt-get install -y -q software-properties-common")
- comm.sudo("apt-add-repository -y ppa:dotcloud/lxc-docker")
+ # TODO: Perform check on the host machine if aufs is installed and using LXC
+ if machine.provider_name != :lxc
+ comm.sudo("lsmod | grep aufs || modprobe aufs || apt-get install -y linux-image-extra-`uname -r`")
+ end
+ comm.sudo("curl http://get.docker.io/gpg | apt-key add -")
+ comm.sudo("echo deb http://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list")
comm.sudo("apt-get update")
comm.sudo("apt-get install -y -q xz-utils lxc-docker -o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confold'")
- # TODO: Error out if provider is lxc
- # comm.sudo("lsmod | grep aufs || modprobe aufs || apt-get install -y linux-image-extra-`uname -r`")
end
end
end
|
Update installer for docker 0.6.0 (closes GH-1)
|
diff --git a/spec/image_figures_spec.rb b/spec/image_figures_spec.rb
index abc1234..def5678 100644
--- a/spec/image_figures_spec.rb
+++ b/spec/image_figures_spec.rb
@@ -5,9 +5,6 @@ end
describe 'basic formatting syntax' do
- # Just a silly little spec to get things started. I don't intend
- # to test the whole of kramdown here. :)~
- #
it "converts a block-level image to a <figure> structure" do
expect(render %[check it out:\n\n])
.to eq %[<p>check it out:</p>\n\n<figure><img src="image.jpg" alt="image" title="Cute Kitten!"><figcaption>Cute Kitten!</figcaption></figure>\n]
|
Remove obsolete comment from spec
|
diff --git a/lib/how_is/pulse.rb b/lib/how_is/pulse.rb
index abc1234..def5678 100644
--- a/lib/how_is/pulse.rb
+++ b/lib/how_is/pulse.rb
@@ -23,7 +23,7 @@
private
def fetch_pulse!(repository, period='monthly')
- Tessellator::Fetcher.new.fetch('get', "https://github.com/#{repository}/pulse/#{period}")
+ Tessellator::Fetcher.new.call('get', "https://github.com/#{repository}/pulse/#{period}")
end
end
end
|
Update code based on new Tessellator::Fetcher API.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.