diff stringlengths 65 26.7k | message stringlengths 7 9.92k |
|---|---|
diff --git a/recipes/virtualbox.rb b/recipes/virtualbox.rb
index abc1234..def5678 100644
--- a/recipes/virtualbox.rb
+++ b/recipes/virtualbox.rb
@@ -27,7 +27,8 @@ 'dkms',
'virtualbox-5.0'
] do
- action :install
+ action :install
+ timeout 3600
end
group 'vboxusers' do
| Add timeout for vbox install
|
diff --git a/app/services/ci/retry_pipeline_service.rb b/app/services/ci/retry_pipeline_service.rb
index abc1234..def5678 100644
--- a/app/services/ci/retry_pipeline_service.rb
+++ b/app/services/ci/retry_pipeline_service.rb
@@ -5,7 +5,7 @@ raise Gitlab::Access::AccessDeniedError
end
- each_build(pipeline.builds.failed_or_canceled) do |build|
+ pipeline.builds.failed_or_canceled.find_each do |build|
next unless build.retryable?
Ci::RetryBuildService.new(project, current_user)
@@ -18,13 +18,5 @@
pipeline.process!
end
-
- private
-
- def each_build(relation)
- Gitlab::OptimisticLocking.retry_lock(relation) do |builds|
- builds.find_each { |build| yield build }
- end
- end
end
end
| Remove support for locking in pipeline retry service
|
diff --git a/phrase.gemspec b/phrase.gemspec
index abc1234..def5678 100644
--- a/phrase.gemspec
+++ b/phrase.gemspec
@@ -22,9 +22,9 @@ s.require_paths = ["lib"]
s.add_dependency('colorize')
s.add_dependency('json')
+ s.add_dependency('i18n')
s.add_development_dependency('rake')
s.add_development_dependency('rspec')
- s.add_development_dependency('i18n')
s.add_development_dependency('webmock')
s.add_development_dependency('vcr')
s.add_development_dependency('timecop')
| Make the i18n gem a normal dependency instead of just a development dependency
|
diff --git a/lib/tasks/deploy.rake b/lib/tasks/deploy.rake
index abc1234..def5678 100644
--- a/lib/tasks/deploy.rake
+++ b/lib/tasks/deploy.rake
@@ -8,7 +8,7 @@ task :bundle_gems => :environment do
puts "bundling..."
Dir.chdir(Rails.root)
- system("RAILS_ENV=#{Rails.env} sudo bundle --without=development --without=test")
+ system("RAILS_ENV=#{Rails.env} sudo bundle install --without=development --without=test")
end
task :db_migrate => :environment do
| Change bundle command to install
|
diff --git a/lib/tasks/router.rake b/lib/tasks/router.rake
index abc1234..def5678 100644
--- a/lib/tasks/router.rake
+++ b/lib/tasks/router.rake
@@ -18,6 +18,7 @@
task :register_routes => :router_environment do
@router.create_route "whitehall", "prefix", @application_name
+ @router.create_route "specialist", "prefix", @application_name
VanityRedirector.new(Rails.root.join("app", "data", "vanity-redirects.csv")).each do |r, _|
@router.create_route(r, "full", @application_name)
@router.create_route(r.upcase, "full", @application_name)
| Add registration of 'specialist' prefix
|
diff --git a/bcx.gemspec b/bcx.gemspec
index abc1234..def5678 100644
--- a/bcx.gemspec
+++ b/bcx.gemspec
@@ -16,7 +16,7 @@ gem.version = Bcx::VERSION
gem.license = 'MIT'
- gem.add_runtime_dependency 'rapidash', '~> 0.3.0'
+ gem.add_runtime_dependency 'rapidash', '~> 0.4.0'
gem.add_development_dependency 'rake'
gem.add_development_dependency 'rspec'
| Update Rapidash dependency to 0.4.0
|
diff --git a/hacky_hal.gemspec b/hacky_hal.gemspec
index abc1234..def5678 100644
--- a/hacky_hal.gemspec
+++ b/hacky_hal.gemspec
@@ -2,13 +2,13 @@
Gem::Specification.new do |gem|
gem.name = "hacky_hal"
- gem.version = "0.2.0"
+ gem.version = "0.2.1"
gem.authors = ["Nick Ewing"]
gem.email = ["nick@nickewing.net"]
gem.description = "HackyHAL - Hacky Home Automation Library"
- gem.summary = gem.description
- gem.homepage = ""
+ gem.summary = "A small library to control a limited set of devices."
+ gem.homepage = "https://github.com/nickewing/hacky_hal"
gem.add_dependency("upnp-nickewing", "~> 0.1.0")
gem.add_dependency("serialport", "~> 1.1.0")
| Update gemspec description and homepage.
|
diff --git a/lib/common/ruby_ext.rb b/lib/common/ruby_ext.rb
index abc1234..def5678 100644
--- a/lib/common/ruby_ext.rb
+++ b/lib/common/ruby_ext.rb
@@ -17,3 +17,12 @@ a < b ? a : b
end
end
+
+# log2 apparently exists in ruby 1.9.x, but not ruby 1.8.x
+if !Math.respond_to? :log2
+ module Math
+ def Math.log2 n
+ log(n)/log(2)
+ end
+ end
+end
| Add Math.log2 function for ruby 1.8.x compatibility.
|
diff --git a/spec/features/users_spec.rb b/spec/features/users_spec.rb
index abc1234..def5678 100644
--- a/spec/features/users_spec.rb
+++ b/spec/features/users_spec.rb
@@ -18,18 +18,19 @@ it { current_path.should == project_path(@project) }
end
- describe "the notification tab" do
- before do
- login
- @project = create(:backer, user: current_user).project
- visit user_path(current_user, locale: :pt)
- click_link 'unsubscribes_link'
- end
+ # Disabled for now
+ #describe "the notification tab" do
+ #before do
+ #login
+ #@project = create(:backer, user: current_user).project
+ #visit user_path(current_user, locale: :pt)
+ #click_link 'unsubscribes_link'
+ #end
- it "should show unsubscribe from all updates" do
- updates_unsubscribe = all("#user_unsubscribes_attributes_0_subscribed")
- updates_unsubscribe.should have(1).items
- end
- end
+ #it "should show unsubscribe from all updates" do
+ #updates_unsubscribe = all("#user_unsubscribes_attributes_0_subscribed")
+ #updates_unsubscribe.should have(1).items
+ #end
+ #end
end
| Disable feature spec for notifications tab on user page
|
diff --git a/lib/metrics/updater.rb b/lib/metrics/updater.rb
index abc1234..def5678 100644
--- a/lib/metrics/updater.rb
+++ b/lib/metrics/updater.rb
@@ -14,7 +14,8 @@
# Reconnect the database.
#
- Sequel::Model.db.connect(Sequel::Model.db.opts)
+ opts = Sequel::Model.db.opts
+ Sequel.connect(opts[:uri], opts[:orig_opts])
loop do
pods = find_pods_without_github_metrics.limit(10).all
@@ -35,12 +36,13 @@ #
def self.update(pods)
pods.each do |pod|
- next unless url = pod.github_url
-
- github = Metrics::Github.new(url)
- github.update(pod)
+ if url = pod.github_url
+ github = Metrics::Github.new(url)
+ github.update(pod)
+ end
end
- rescue StandardError
+ rescue StandardError => e
+ METRICS_APP_LOGGER.info e
# TODO: Log.
sleep 10
end
| [Updater] Reconnect to DB correctly after fork.
|
diff --git a/react-native-amplitude-analytics.podspec b/react-native-amplitude-analytics.podspec
index abc1234..def5678 100644
--- a/react-native-amplitude-analytics.podspec
+++ b/react-native-amplitude-analytics.podspec
@@ -14,5 +14,7 @@ s.source_files = "ios/*.{h,m}"
s.platform = :ios, "8.0"
+ s.dependency "React"
+
s.dependency "Amplitude-iOS", "~> 3.14.1"
end
| Update Podspec to fix missing import
#if __has_include(<React/RCTBridgeModule.h>)
#import <React/RCTBridgeModule.h>
#else
#import "RCTBridgeModule.h"
#endif |
diff --git a/lib/opsicle/ssh_key.rb b/lib/opsicle/ssh_key.rb
index abc1234..def5678 100644
--- a/lib/opsicle/ssh_key.rb
+++ b/lib/opsicle/ssh_key.rb
@@ -11,7 +11,7 @@ def execute(options={})
validate!
update
- puts "ssh-key updated successfully"
+ say "ssh-key updated successfully"
end
def validate!
| Switch from puts to say to be consistent
|
diff --git a/rswag-specs/open_api-rswag-specs.gemspec b/rswag-specs/open_api-rswag-specs.gemspec
index abc1234..def5678 100644
--- a/rswag-specs/open_api-rswag-specs.gemspec
+++ b/rswag-specs/open_api-rswag-specs.gemspec
@@ -15,9 +15,9 @@
s.files = Dir['{lib}/**/*'] + %w[MIT-LICENSE Rakefile]
- s.add_dependency 'activesupport', '>= 3.1'
+ s.add_dependency 'activesupport', '>= 3.1', '< 7.0'
s.add_dependency 'json-schema', '~> 2.2'
- s.add_dependency 'railties', '>= 3.1'
+ s.add_dependency 'railties', '>= 3.1', '< 7.0'
s.add_dependency 'hashie'
s.add_development_dependency 'guard-rspec'
end
| Update dependency add versional protection |
diff --git a/app/concerns/controller/query_conditions.rb b/app/concerns/controller/query_conditions.rb
index abc1234..def5678 100644
--- a/app/concerns/controller/query_conditions.rb
+++ b/app/concerns/controller/query_conditions.rb
@@ -2,9 +2,8 @@ private
def add_conditions_from_query(scope)
- request.query_parameters.each do |field, condition|
+ query_params.each do |field, condition|
case field
- when 'sort_by', 'sort_direction', 'utf8', 'commit', 'page'
when 'limit'
scope = scope.limit(condition.to_i)
when 'offset'
@@ -20,4 +19,16 @@ end
scope
end
+
+ def query_params
+ default_query_params
+ end
+
+ def default_query_params
+ request.query_parameters.except(*default_query_params_exceptions)
+ end
+
+ def default_query_params_exceptions
+ %w(sort_by sort_direction utf8 commit page)
+ end
end
| Refactor Controller::QueryConditions to support query params filtering.
|
diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/organizations_controller.rb
+++ b/app/controllers/organizations_controller.rb
@@ -1,5 +1,6 @@ class OrganizationsController < ApplicationController
require_permission :can_create_organization?, only: [:new, :create]
+ require_permission :can_delete_and_restore_organizations?, only: [:delete, :deleted, :restore]
require_permission one_of: [:can_create_organization?, :can_update_organization?], except: [:new, :create]
active_tab "organizations"
@@ -30,4 +31,30 @@ @organization = e.record
render :new
end
+
+ def destroy
+ @organization = Organization.find params[:id]
+
+ if @organization.soft_delete
+ flash[:success] = "Organization '#{@organization.name}' deleted!"
+ else
+ flash[:error] = <<-eos
+ '#{@organization.name}' was unable to be deleted. We found the following open orders:
+ #{@organization.open_orders.map(&:id).to_sentence}
+ eos
+ end
+
+ redirect_to organizations_path
+ end
+
+ def deleted
+ @organizations = Organization.deleted
+ end
+
+ def restore
+ @organization = Organization.find_deleted params[:id]
+ @organization.restore
+
+ redirect_to organizations_path(@organization)
+ end
end
| Add endpoints relating to deletion to org controller
|
diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/registrations_controller.rb
+++ b/app/controllers/registrations_controller.rb
@@ -9,12 +9,6 @@
def create
build_resource
-
- if session[:omniauth] && @user.errors[:email][0] =~ /has already been taken/
- user = User.find_by_email(@user.email)
- # Link Accounts - if via social connect
- return redirect_to link_accounts_url(user.id)
- end
# normal processing
super
| Remove a no longer valid reference
|
diff --git a/app/controllers/travel_advice_controller.rb b/app/controllers/travel_advice_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/travel_advice_controller.rb
+++ b/app/controllers/travel_advice_controller.rb
@@ -1,4 +1,9 @@ class TravelAdviceController < MultipageController
+ def show
+ expires_in(10.seconds, public: true)
+ super
+ end
+
private
def base_path
| Reduce cache time from 15.minutes to 10.seconds
If no cache control headers are set, the in-memory
cache in gds-api adapters defaults to 15 minutes.
This is too long for travel advice. We could have
urgent updates that we need to send out, e.g. if
an act of terrorism has taken place.
github.com/alphagov/gds-api-adapters/blob/master/lib/gds_api/json_client.rb
|
diff --git a/app/models/georgia/concerns/revisionable.rb b/app/models/georgia/concerns/revisionable.rb
index abc1234..def5678 100644
--- a/app/models/georgia/concerns/revisionable.rb
+++ b/app/models/georgia/concerns/revisionable.rb
@@ -22,6 +22,7 @@ end
def publish(revision)
+ current_revision.store if current_revision
self.update_attribute(:revision_id, revision.id)
end
| Store current_revision on publish if any
|
diff --git a/app/models/spree/current_order_decorator.rb b/app/models/spree/current_order_decorator.rb
index abc1234..def5678 100644
--- a/app/models/spree/current_order_decorator.rb
+++ b/app/models/spree/current_order_decorator.rb
@@ -1,9 +1,4 @@ Spree::Core::CurrentOrder.module_eval do
- # Associate the new order with the currently authenticated user before saving
- def before_save_new_order
- @current_order.user ||= spree_current_user
- end
-
def after_save_new_order
# make sure the user has permission to access the order (if they are a guest)
return if spree_current_user
| Remove before_save_new_order method which does the same as associate user
|
diff --git a/lib/rubyfox/sfs/cli.rb b/lib/rubyfox/sfs/cli.rb
index abc1234..def5678 100644
--- a/lib/rubyfox/sfs/cli.rb
+++ b/lib/rubyfox/sfs/cli.rb
@@ -11,13 +11,57 @@ Rubyfox::SFS.data_dir
end
- desc "install DIR", "install SmartFox Server into DIR"
- def install(dir)
- if File.exist?(dir)
- abort "Directory #{dir} already exists!"
+ desc "install TARGET_DIR", "install SmartFox Server into TARGET_DIR"
+ def install(target_dir)
+ if File.exist?(target_dir)
+ abort "Directory #{target_dir} already exists!"
end
- directory self.class.source_root, dir
+ directory self.class.source_root, target_dir
+ end
+
+ desc "configure TARGET_DIR TEMPLATE_DIR", "configures SmartFox Server in TARGET_DIR via TEMPLATE_DIR"
+ def configure(target_dir, template_dir)
+ Dir[template_dir + "**/*"].each do |template_file|
+ if File.file?(template_file)
+ part = template_file.partition(template_dir).last
+ template template_file, target_dir + "/" + part
+ end
+ end
+ end
+
+ no_tasks do
+ def env
+ @env ||= Env.new(ENV)
+ end
+ end
+
+ class Env
+ include Thor::Shell
+
+ def initialize(env)
+ @env = env
+ @local = {}
+ end
+
+ def [](name)
+ name = name.to_s
+ value = @local[name] || @env[name]
+ value || begin
+ msg = "Specify env #{name}:"
+ loop do
+ answer = ask(msg)
+ unless answer.empty?
+ self[name] = answer
+ break answer
+ end
+ end
+ end
+ end
+
+ def []=(name, value)
+ @local[name.to_s] = value
+ end
end
end
end
| Configure server config via template path.
|
diff --git a/ruby-puppetdb.gemspec b/ruby-puppetdb.gemspec
index abc1234..def5678 100644
--- a/ruby-puppetdb.gemspec
+++ b/ruby-puppetdb.gemspec
@@ -13,4 +13,5 @@ s.test_files = `git ls-files -- {test,spec,features,examples}/*`.split("\n")
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
+ s.add_dependency('json')
end
| Add dependency on json gem
|
diff --git a/features/step_definitions/lockfile_steps.rb b/features/step_definitions/lockfile_steps.rb
index abc1234..def5678 100644
--- a/features/step_definitions/lockfile_steps.rb
+++ b/features/step_definitions/lockfile_steps.rb
@@ -11,7 +11,7 @@ delete_path expand('$tmp').to_lockfile_path
end
-Then 'a lockfile is created with:' do |content|
+Then /^(?:a|the) lockfile is (?:created|updated) with:$/ do |content|
# For some reason, Cucumber drops the last newline from every docstring...
steps %Q{
Then the file "#{'.'.to_lockfile_path}" should contain exactly:
| Add more steps to verify a lockfile content
|
diff --git a/lib/um/preprocessor.rb b/lib/um/preprocessor.rb
index abc1234..def5678 100644
--- a/lib/um/preprocessor.rb
+++ b/lib/um/preprocessor.rb
@@ -1,4 +1,5 @@ require 'time'
+require 'date'
# template preprocessor
module Preprocessor
@@ -7,12 +8,16 @@ case match
when '$name'
page_name
+ when '$NAME'
+ page_name.upcase
when '$topic'
topic
when '$time'
Time.now.rfc2822
+ when '$date'
+ Date.today.strftime("%B %d, %Y")
else
- ''
+ match
end
end
end
| Add support for $NAME and $date in templates.
|
diff --git a/lib/devise/multi_email/association_manager.rb b/lib/devise/multi_email/association_manager.rb
index abc1234..def5678 100644
--- a/lib/devise/multi_email/association_manager.rb
+++ b/lib/devise/multi_email/association_manager.rb
@@ -19,15 +19,12 @@ end
def model_class
- unless reflection
- raise "#{@klass}##{name} association not found: It might be because your declaration is after `devise :multi_email_confirmable`."
- end
-
@model_class ||= reflection.class_name.constantize
end
def reflection
- @reflection ||= @klass.reflect_on_association(name)
+ @reflection ||= @klass.reflect_on_association(name) ||
+ raise("#{@klass}##{name} association not found: It might be because your declaration is after `devise :multi_email_confirmable`.")
end
end
end
| Raise exception immediately when association doesn't exist
|
diff --git a/recipes/dnf_yum_compat.rb b/recipes/dnf_yum_compat.rb
index abc1234..def5678 100644
--- a/recipes/dnf_yum_compat.rb
+++ b/recipes/dnf_yum_compat.rb
@@ -16,4 +16,4 @@ # See the License for the specific language governing permissions and
# limitations under the License.
-log "The dnf_yum_compat recipe is no longer necessary as Chef Infra Client includes native DNF support"+log 'The dnf_yum_compat recipe is no longer necessary as Chef Infra Client includes native DNF support'
| Fix cookstyle warnings in the dnf compat recipe
Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
|
diff --git a/lib/capistrano/runit/runit.rake b/lib/capistrano/runit/runit.rake
index abc1234..def5678 100644
--- a/lib/capistrano/runit/runit.rake
+++ b/lib/capistrano/runit/runit.rake
@@ -9,7 +9,7 @@ info "Directory 'runit' already exists"
end
%w(.env available enabled).each do |subdir|
- if test "[ ! -d runit/#{subdir} ]"
+ if test "[ ! -d #{deploy_to}/runit/#{subdir} ]"
execute :mkdir, "-v", "#{deploy_to}/runit/#{subdir}"
else
info "Directory 'runit/#{subdir}' already exists"
| Fix bug: it shouldn't use relative path.
|
diff --git a/db/migrate/20170106122300_populate_documents.rb b/db/migrate/20170106122300_populate_documents.rb
index abc1234..def5678 100644
--- a/db/migrate/20170106122300_populate_documents.rb
+++ b/db/migrate/20170106122300_populate_documents.rb
@@ -2,7 +2,8 @@ def up
execute "INSERT INTO documents (content_id, locale)
SELECT content_id, locale FROM content_items
- WHERE (content_id, locale) NOT IN (SELECT content_id, locale FROM documents)
+ WHERE document_id IS NULL
+ AND (content_id, locale) NOT IN (SELECT content_id, locale FROM documents)
GROUP BY content_id, locale"
end
end
| Improve performance of populate documents migration
|
diff --git a/spec/features/managing_questions_spec.rb b/spec/features/managing_questions_spec.rb
index abc1234..def5678 100644
--- a/spec/features/managing_questions_spec.rb
+++ b/spec/features/managing_questions_spec.rb
@@ -10,7 +10,7 @@ FactoryGirl.create_list(:question, count)
visit admin_path
- click_button "Questions Creator"
+ click_link "Questions"
expect(current_path).to eq questions_path
expect(page).to have_selector(".question-list-item", count: count)
end
| Fix specs after admin menu changes
|
diff --git a/week-6/nested_data_solution.rb b/week-6/nested_data_solution.rb
index abc1234..def5678 100644
--- a/week-6/nested_data_solution.rb
+++ b/week-6/nested_data_solution.rb
@@ -0,0 +1,77 @@+# RELEASE 2: NESTED STRUCTURE GOLF
+# Hole 1
+# Target element: "FORE"
+
+array = [[1,2], ["inner", ["eagle", "par", ["FORE", "hook"]]]]
+
+# attempts:
+# ============================================================
+p array[1][1][2][0]
+
+
+# ============================================================
+
+# Hole 2
+# Target element: "congrats!"
+
+hash = {outer: {inner: {"almost" => {3 => "congrats!"}}}}
+
+# attempts:
+# ============================================================
+p hash[:outer][:inner]["almost"][3]
+
+
+# ============================================================
+
+
+# Hole 3
+# Target element: "finished"
+
+nested_data = {array: ["array", {hash: "finished"}]}
+
+# attempts:
+# ============================================================
+p nested_data[:array][1][:hash]
+
+
+# ============================================================
+
+# RELEASE 3: ITERATE OVER NESTED STRUCTURES
+
+number_array = [5, [10, 15], [20,25,30], 35]
+
+number_array.each_with_index do |element, i|
+ if element.kind_of?(Array)
+ element.each_with_index {|inner, i| element[i] = inner + 5}
+ else
+ number_array[i] = element + 5
+ end
+end
+p number_array
+
+# Bonus:
+
+startup_names = ["bit", ["find", "fast", ["optimize", "scope"]]]
+
+# Reflection
+=begin
+
+- What are some general rules you can apply to nested arrays?
+
+ The number of levels down you want to access need to be mirrord
+ by the number of bracket pairs for the indesing.
+
+- What are some ways you can iterate over nested arrays?
+
+ The most-commonly used method is 'each', with presents each element
+ for inspection and manipulation. 'each_with_index' adds the ability
+ to know and use the index of the array element, for instance to modify
+ the element, or to base something on the index value. You can also
+ use traditional loooping mechanisms like for/while loops.
+
+Did you find any good new methods to implement or did you re-use one you were already familiar with?
+What was it and why did you decide that was a good option?
+
+ We were able to solve using only methods we were familiar with.
+
+=end | Add solution to Challenge 6.5
|
diff --git a/lib/pod/command/dependencies.rb b/lib/pod/command/dependencies.rb
index abc1234..def5678 100644
--- a/lib/pod/command/dependencies.rb
+++ b/lib/pod/command/dependencies.rb
@@ -7,8 +7,18 @@ Shows the project's dependency graph.
DESC
+ def self.options
+ [
+ ['--ignore-lockfile', 'whether the lockfile should be ignored when calculating the dependency graph'],
+ ].concat(super)
+ end
+
+ def initialize(argv)
+ @ignore_lockfile = argv.flag?('ignore-lockfile', false)
+ super
+ end
+
def run
- verify_podfile_exists!
UI.section 'Project Dependencies' do
STDOUT.puts dependencies.to_yaml
end
@@ -16,10 +26,14 @@
def dependencies
@dependencies ||= begin
- podfile = config.podfile
- resolver = Resolver.new(config.sandbox, podfile, config.lockfile.dependencies)
- specs = resolver.resolve.values.flatten(1).uniq
- lockfile = Lockfile.generate(podfile, specs)
+ verify_podfile_exists!
+ analyzer = Installer::Analyzer.new(
+ config.sandbox,
+ config.podfile,
+ @ignore_lockfile ? nil : config.lockfile
+ )
+ specs = analyzer.analyze(false).specs_by_target.values.flatten(1)
+ lockfile = Lockfile.generate(config.podfile, specs)
pods = lockfile.to_hash['PODS']
end
end
| Update for CocoaPods 0.34 and allow user to ignore lockfile
|
diff --git a/lib/rubocop/cop/ignored_node.rb b/lib/rubocop/cop/ignored_node.rb
index abc1234..def5678 100644
--- a/lib/rubocop/cop/ignored_node.rb
+++ b/lib/rubocop/cop/ignored_node.rb
@@ -5,26 +5,26 @@ # Handles adding and checking ignored nodes.
module IgnoredNode
def ignore_node(node)
- @ignored_nodes ||= []
- @ignored_nodes << node
+ ignored_nodes << node
end
def part_of_ignored_node?(node)
- return false unless @ignored_nodes
expression = node.loc.expression
- @ignored_nodes.each do |ignored_node|
- if ignored_node.loc.expression.begin_pos <= expression.begin_pos &&
+ ignored_nodes.any? do |ignored_node|
+ ignored_node.loc.expression.begin_pos <= expression.begin_pos &&
ignored_node.loc.expression.end_pos >= expression.end_pos
- return true
- end
end
-
- false
end
def ignored_node?(node)
# Same object found in array?
- @ignored_nodes && @ignored_nodes.any? { |n| n.eql?(node) }
+ ignored_nodes.any? { |n| n.equal?(node) }
+ end
+
+ private
+
+ def ignored_nodes
+ @ignored_nodes ||= []
end
end
end
| Fix tests in the presence of `ast` 2.0.0
`AST::Node` now implements `#eql?` which allows node equality checking.
Unfortunately this is not what was intended in Rubocop, so now we must
check object identity explicitly.
|
diff --git a/db/migrate/20151029211234_create_groups.rb b/db/migrate/20151029211234_create_groups.rb
index abc1234..def5678 100644
--- a/db/migrate/20151029211234_create_groups.rb
+++ b/db/migrate/20151029211234_create_groups.rb
@@ -1,8 +1,10 @@ class CreateGroups < ActiveRecord::Migration
def change
create_table :groups do |t|
- t.string :name, null: false
- t.string :address, null: false
+ t.integer :number, null: false
+ t.string :street, null: false
+ t.string :city, null: false
+ t.integer :zip_code, null: false
t.timestamps null: false
end
| Change groups migration so that the attributes we expect are saved.
Note that the name is no longer a field on our group table, but it is a
virtual attribute in our model. We no longer have uniqueness validations
at the Model level or constraints at the Database level.
|
diff --git a/spec/acceptance/github/auth/cli_spec.rb b/spec/acceptance/github/auth/cli_spec.rb
index abc1234..def5678 100644
--- a/spec/acceptance/github/auth/cli_spec.rb
+++ b/spec/acceptance/github/auth/cli_spec.rb
@@ -3,10 +3,10 @@ require 'github/auth'
describe Github::Auth::CLI do
- with_mock_github_server do |mock_server_hostname|
+ with_mock_github_server do |mock_server_hostname, mock_keys|
let(:hostname) { mock_server_hostname }
let(:keys_file) { Tempfile.new 'authorized_keys' }
- let(:keys) { Github::Auth::MockGithubServer::KEYS }
+ let(:keys) { mock_keys }
after { keys_file.unlink }
| Use mock_keys that are passed into the block
|
diff --git a/lib/odf-report.rb b/lib/odf-report.rb
index abc1234..def5678 100644
--- a/lib/odf-report.rb
+++ b/lib/odf-report.rb
@@ -1,8 +1,8 @@ require 'rubygems'
require 'zip/zipfilesystem'
require 'fileutils'
-require 'odf-report/file_ops'
-require 'odf-report/hash_gsub'
-require 'odf-report/section'
-require 'odf-report/table'
-require 'odf-report/report'
+require File.expand_path('../odf-report/file_ops',__FILE__)
+require File.expand_path('../odf-report/hash_gsub',__FILE__)
+require File.expand_path('../odf-report/section',__FILE__)
+require File.expand_path('../odf-report/table',__FILE__)
+require File.expand_path('../odf-report/report',__FILE__)
| Fix requires to run without loading the system gem
|
diff --git a/db/data_migration/20121107130203_fix_dates_of_dclg_speeches_round_2.rb b/db/data_migration/20121107130203_fix_dates_of_dclg_speeches_round_2.rb
index abc1234..def5678 100644
--- a/db/data_migration/20121107130203_fix_dates_of_dclg_speeches_round_2.rb
+++ b/db/data_migration/20121107130203_fix_dates_of_dclg_speeches_round_2.rb
@@ -0,0 +1,52 @@+require 'csv'
+
+puts ['Url', 'Latest edition ID', 'Old delivered on', 'New delivered on', 'Old first published at', 'New first published at', 'Error'].to_csv
+CSV.foreach(Rails.root.join('db/data_migration/20121031105330_upload_dclg_speeches.csv'), headers: true) do |row|
+ source_url = row['old_url']
+
+ # I'm explicitly setting delivered_on as a date (to avoid the problem we encountered last time round)
+ # and setting the first_published_at to 13:00 on the same day, to avoid any ambiguity around midnight
+ # in BST (midnight BST is 23:00 the day before in UTC).
+ first_published_at = row['first_published']
+ delivered_on = row['delivered_on']
+
+ # We only had delivered_on or first_published columns
+ if delivered_on.present?
+ delivered_on = Date.parse(delivered_on)
+ first_published_at = Time.zone.parse("#{delivered_on} 13:00:00")
+ else
+ delivered_on = Date.parse(first_published_at)
+ first_published_at = Time.zone.parse("#{first_published_at} 13:00:00")
+ end
+
+ latest_edition_id, error = nil, nil
+ old_delivered_on, new_delivered_on = nil, nil
+ old_first_published_at, new_first_published_at = nil, nil
+
+ if document_series = DocumentSource.find_by_url(source_url)
+ if document_series.document
+ if latest_edition = document_series.document.latest_edition
+ latest_edition_id = latest_edition.id
+
+ old_delivered_on = latest_edition.delivered_on
+ old_first_published_at = latest_edition.first_published_at
+ latest_edition.delivered_on = delivered_on
+ latest_edition.first_published_at = first_published_at
+ new_delivered_on = latest_edition.delivered_on
+ new_first_published_at = latest_edition.first_published_at
+
+ unless latest_edition.save(validate: false)
+ error = "Couldn't update edition"
+ end
+ else
+ error = 'Edition not found'
+ end
+ else
+ error = 'Document not found'
+ end
+ else
+ error = 'Document source not found'
+ end
+
+ puts [source_url, latest_edition_id, old_delivered_on, new_delivered_on, old_first_published_at, new_first_published_at, error].to_csv
+end | Fix delivered_on for round 1 of DCLG Speeches
In the original DCLG speech uploads
(20121031105330_upload_dclg_speeches.rb) we were parsing the date from
the CSV file as a timestamp. Any date during BST would be converted to
a timestamp at midnight (BST) on the same day, which was then converted
to 23:00 the day before (UTC) when stored as a date. The effect was
that speeches were appearing to be delivered the day before the date we
had in the CSV file.
Additionally, I've chosen to update the first_published_at attribute to
13:00 (rather than allowing it to default to midnight) to avoid any
ambiguity between the delivered_on date and first_published_at datetime.
|
diff --git a/config/projects/opscode-push-jobs-server.rb b/config/projects/opscode-push-jobs-server.rb
index abc1234..def5678 100644
--- a/config/projects/opscode-push-jobs-server.rb
+++ b/config/projects/opscode-push-jobs-server.rb
@@ -22,6 +22,7 @@ build_version Omnibus::BuildVersion.full
build_iteration "1"
+runtime_dependencies [ "private-chef" ]
deps = []
# global
| Add private-chef as runtime dependency
|
diff --git a/lita-coin.gemspec b/lita-coin.gemspec
index abc1234..def5678 100644
--- a/lita-coin.gemspec
+++ b/lita-coin.gemspec
@@ -7,6 +7,7 @@ spec.summary = %q{A Lita handler for flipping a coin.}
spec.homepage = "https://github.com/jimmycuadra/lita-coin"
spec.license = "MIT"
+ spec.metadata = { "lita_plugin_type" => "handler" }
spec.files = `git ls-files`.split($/)
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
| Set Lita plugin type in gemspec.
|
diff --git a/config/initializers/action_mailer.rb b/config/initializers/action_mailer.rb
index abc1234..def5678 100644
--- a/config/initializers/action_mailer.rb
+++ b/config/initializers/action_mailer.rb
@@ -1,8 +1,5 @@ # Set SMTP settings if given.
-p "delivery method"
-p Errbit::Config.email_delivery_method
if Errbit::Config.email_delivery_method == :smtp
- p "in here"
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
:address => Errbit::Config.smtp_address,
| Revert "more debug for mailer issue"
This reverts commit c92c759279051dfd21822dcc3ec73dbac9efa6a8.
|
diff --git a/config/initializers/instance_name.rb b/config/initializers/instance_name.rb
index abc1234..def5678 100644
--- a/config/initializers/instance_name.rb
+++ b/config/initializers/instance_name.rb
@@ -1,10 +1,7 @@-# This file is overwritten at deploy-time from alphagov-deployment. At the time
-# of writing, it isn't overwritten in production.
-
# Human-friendly name for this signon instance. This is used when generating
# reminder emails that need to disambiguate between instances.
if Rails.env.development? || Rails.env.test?
Rails.application.config.instance_name = "development"
else
- Rails.application.config.instance_name = nil
+ Rails.application.config.instance_name = ENV.fetch("INSTANCE_NAME", nil)
end
| Configure instance name from ENV
|
diff --git a/curation_concerns-models/app/models/concerns/curation_concerns/with_file_sets.rb b/curation_concerns-models/app/models/concerns/curation_concerns/with_file_sets.rb
index abc1234..def5678 100644
--- a/curation_concerns-models/app/models/concerns/curation_concerns/with_file_sets.rb
+++ b/curation_concerns-models/app/models/concerns/curation_concerns/with_file_sets.rb
@@ -18,8 +18,13 @@ # Destroy the list source first. This prevents each file_set from attemping to
# remove itself individually from the work. If hundreds of files are attached,
# this would take too long.
+
+ # Get list of member file_sets from Solr
+ fs = file_sets
list_source.destroy
- file_sets.each(&:destroy)
+ # Remove Work from Solr after it was removed from Fedora
+ ActiveFedora::SolrService.delete(id)
+ fs.each(&:destroy)
end
def copy_visibility_to_files
| Remove GenericWork from Solr index
before FileSets are destroyed so in_objects lookup
does not explode.
|
diff --git a/Casks/beaker-electron.rb b/Casks/beaker-electron.rb
index abc1234..def5678 100644
--- a/Casks/beaker-electron.rb
+++ b/Casks/beaker-electron.rb
@@ -0,0 +1,12 @@+cask 'beaker-electron' do
+ version '1.4.2-0-ge55c059'
+ sha256 '32d6ecf6a1ebfc32c3e1b2dfc1edb33eaeab6f83d3f9d74dd9b64e08bd24e3e6'
+
+ # cloudfront.net is the official download host per the vendor homepage
+ url "https://d299yghl10frh5.cloudfront.net/beaker-notebook-#{version}-electron-mac.dmg"
+ name 'Beaker Electron'
+ homepage 'http://beakernotebook.com/'
+ license :apache
+
+ app 'Beaker.app'
+end
| Add Beaker Notebook (Electron build) v1.4.2-0-ge55c059
|
diff --git a/messaging.gemspec b/messaging.gemspec
index abc1234..def5678 100644
--- a/messaging.gemspec
+++ b/messaging.gemspec
@@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = 'evt-messaging'
- s.version = '2.5.2.1'
+ s.version = '2.5.3.0'
s.summary = 'Common primitives for platform-specific messaging implementations for Eventide'
s.description = ' '
| Package version is increased from 2.5.2.1 to 2.5.3.0
|
diff --git a/cookbooks/vim/recipes/install_vim.rb b/cookbooks/vim/recipes/install_vim.rb
index abc1234..def5678 100644
--- a/cookbooks/vim/recipes/install_vim.rb
+++ b/cookbooks/vim/recipes/install_vim.rb
@@ -3,6 +3,12 @@ source 'vimrc.erb'
owner node['my_user']
mode '0755'
+end
+
+directory "/home/#{node['my_user']}/.vim" do
+ owner node['my_user']
+ mode '0755'
+ action :create
end
package 'vim-gnome'
| Create .vim directory during installation
|
diff --git a/lib/gitrb/user.rb b/lib/gitrb/user.rb
index abc1234..def5678 100644
--- a/lib/gitrb/user.rb
+++ b/lib/gitrb/user.rb
@@ -7,7 +7,7 @@
def dump
off = date.gmt_offset / 60
- '%s <%s> %d %s%02d%02d' % [name, email, date.to_i, off < 0 ? '-' : '+', off / 60, off % 60]
+ '%s <%s> %d %s%02d%02d' % [name, email, date.to_i, off < 0 ? '' : '+', off / 60, off % 60]
end
def self.parse(user)
| Make negative time zones produce '-700', not '--700'
This fixes failing spec:
'Gitrb::Commit should be readable by git binary' FAILED
expected: "Date: Mon Apr 20 00:00:00 2009 -0700\n",
got: "Date: Mon Apr 20 00:00:00 2009 +0000\n" (using ==)
commit_spec.rb:45:in `block (3 levels) in <top (required)>'
|
diff --git a/lib/mnist_data.rb b/lib/mnist_data.rb
index abc1234..def5678 100644
--- a/lib/mnist_data.rb
+++ b/lib/mnist_data.rb
@@ -1,5 +1,8 @@ module MNISTData
class DataUnpackingError < RuntimeError
+ end
+
+ class IndexOutOfRangeError < RuntimeError
end
class Labels
@@ -15,7 +18,8 @@ end
def label(index)
- @data[index] if index.between?(0, count - 1)
+ raise IndexOutOfRangeError if index.between?(0, count - 1)
+ @data[index]
end
end
@@ -40,11 +44,10 @@ end
def image(index)
- if index.between?(0, count - 1)
- pixels = width*height
- range = (index*pixels...(index + 1)*pixels)
- @data[range]
- end
+ raise IndexOutOfRangeError if index.between?(0, count - 1)
+ pixels = width*height
+ range = (index*pixels...(index + 1)*pixels)
+ @data[range]
end
end
end
| Raise an exception if the index is out of range.
|
diff --git a/polish-number.gemspec b/polish-number.gemspec
index abc1234..def5678 100644
--- a/polish-number.gemspec
+++ b/polish-number.gemspec
@@ -14,5 +14,6 @@ s.rdoc_options << "--title" << "polish-number documentation" <<
"--main" << "README.rdoc" << "-q"
+ s.add_development_dependency 'rake'
s.add_development_dependency 'test-spec'
end
| Add rake as a development dependency
|
diff --git a/lib/rutty/node.rb b/lib/rutty/node.rb
index abc1234..def5678 100644
--- a/lib/rutty/node.rb
+++ b/lib/rutty/node.rb
@@ -15,5 +15,13 @@ def <=> other
self.host <=> other.host
end
+
+ def == other
+ self.host == other.host and
+ self.port == other.port and
+ self.user == other.user and
+ self.keypath == other.keypath and
+ self.tags == other.tags
+ end
end
end | Add equality operator to Rutty::Node
|
diff --git a/spec/acceptance/file_spec.rb b/spec/acceptance/file_spec.rb
index abc1234..def5678 100644
--- a/spec/acceptance/file_spec.rb
+++ b/spec/acceptance/file_spec.rb
@@ -0,0 +1,31 @@+require 'spec_helper_acceptance'
+
+describe 'patch::file' do
+ before(:all) {
+ shell('echo "changeme" > /tmp/file1')
+ }
+
+ describe 'with diff_content' do
+ let(:diff_content) { <<-EOS
+1c1
+< changeme
+---
+> changed
+ EOS
+ }
+
+ let(:manifest) { "patch::file { '/tmp/file1': diff_content => '#{diff_content}' }" }
+
+ specify 'should provision with no errors' do
+ apply_manifest(manifest, :catch_failures => true)
+ end
+
+ specify 'should be idempotent' do
+ apply_manifest(manifest, :catch_changes => true)
+ end
+
+ describe file('/tmp/file1') do
+ its(:content) { should match /changed/ }
+ end
+ end
+end
| Add test case for patch::file
|
diff --git a/download.rb b/download.rb
index abc1234..def5678 100644
--- a/download.rb
+++ b/download.rb
@@ -11,13 +11,13 @@ puts "------ Start downloading ------"
@rss.items.each do |item|
puts "Now download -> #{item.title}"
- system("cd",
- "#{download_directory}")
- system("curl",
- "--location",
- "--output",
- "#{item.title}.mp3",
- "#{item.enclosure.url}")
+ Dir.chdir(download_directory) do
+ system("curl",
+ "--location",
+ "--output",
+ "#{item.title}.mp3",
+ "#{item.enclosure.url}")
+ end
end
puts "****** Finished downloading ******"
end
@@ -28,11 +28,7 @@ end
def create_directory
- begin
- Dir.chdir(download_directory)
- rescue Errno::ENOENT
- Dir.mkdir(download_directory)
- end
+ Dir.mkdir(download_directory) unless Dir.exist?(download_directory)
end
end
| Use Dir.chdir instead of system(cd)
|
diff --git a/spec/stored_chunk_spec.rb b/spec/stored_chunk_spec.rb
index abc1234..def5678 100644
--- a/spec/stored_chunk_spec.rb
+++ b/spec/stored_chunk_spec.rb
@@ -39,4 +39,12 @@ described_class.find(filename, chunk_number)
end
+ it 'gets the total number of chunks' do
+ 5.times do |i|
+ described_class.save("my-file", "foo", i)
+ end
+
+ expect(described_class.total('my-file')).to eq(5)
+ end
+
end
| Add tests for total chunk count
|
diff --git a/spec/suite_to_rdf_spec.rb b/spec/suite_to_rdf_spec.rb
index abc1234..def5678 100644
--- a/spec/suite_to_rdf_spec.rb
+++ b/spec/suite_to_rdf_spec.rb
@@ -10,6 +10,7 @@ specify "#{t.property('@id')}: #{t.name}#{' (negative test)' unless t.positiveTest?}" do
skip "Native value fidelity" if %w(toRdf/0035-in.jsonld).include?(t.property('input'))
pending "Generalized RDF" if %w(toRdf/0118-in.jsonld).include?(t.property('input'))
+ pending "Non-heirarchical IRI joining" if %w(toRdf/0130-in.jsonld).include?(t.property('input'))
t.run self
end
end
| Mark toRdf 0130 pending until RDF.rb addresses odd IRI joining issue.
|
diff --git a/postgresql-connector.gemspec b/postgresql-connector.gemspec
index abc1234..def5678 100644
--- a/postgresql-connector.gemspec
+++ b/postgresql-connector.gemspec
@@ -2,7 +2,7 @@ Gem::Specification.new do |s|
s.name = 'postgresql-connector'
s.summary = 'PostgreSQL Connector for Sequel'
- s.version = '0.1.1.0'
+ s.version = '0.1.1.1'
s.authors = ['']
s.require_paths = ['lib']
s.files = Dir.glob('{lib}/**/*')
| Package version is incremented from 0.1.1.0 to 0.1.1.1
|
diff --git a/ruby/client.rb b/ruby/client.rb
index abc1234..def5678 100644
--- a/ruby/client.rb
+++ b/ruby/client.rb
@@ -37,12 +37,12 @@ while true
msg = socket.recv
- if msg.to_i != -1 && msg.to_s.size > 0
+ if msg
result = pattern.match(msg.to_s)
puts "Service discovered: #{msg.inspect}"
query(context, result[1], result[2]) if result
else
- puts "Error msg: #{msg.inspect}"
+ puts "No message"
end
end
| Fix for empty message on timeout
|
diff --git a/app/models/aggregate_feature.rb b/app/models/aggregate_feature.rb
index abc1234..def5678 100644
--- a/app/models/aggregate_feature.rb
+++ b/app/models/aggregate_feature.rb
@@ -15,7 +15,7 @@
# Remove empty features so ST_COLLECT doesn't choke. This seems to be a difference between PostGIS 2.x and 3.x
self.geog = ActiveRecord::Base.connection.select_value <<~SQL
- SELECT ST_Collect(unnest)::geography
+ SELECT COALESCE(ST_Collect(unnest)::geography, ST_GeogFromText('MULTIPOLYGON EMPTY'))
FROM (SELECT unnest(#{feature_array_sql})) AS features
WHERE NOT ST_IsEmpty(unnest)
SQL
| Fix bug where aggregate feature could not be empty
If the a record’s features were empty the aggregate would be empty and have `nil` `geog`, causing it to fail validation. Instead, we ensure that if all the features are empty, we create an empty multipolygon for the aggregate feature.
|
diff --git a/app/models/device_connection.rb b/app/models/device_connection.rb
index abc1234..def5678 100644
--- a/app/models/device_connection.rb
+++ b/app/models/device_connection.rb
@@ -31,6 +31,8 @@
def delete
@@connections.delete self
+ @authenticated = false
+ @socket.close
@socket = nil
end
| Revoke authentication and close socket on delete.
|
diff --git a/app/overrides/add_admin_tabs.rb b/app/overrides/add_admin_tabs.rb
index abc1234..def5678 100644
--- a/app/overrides/add_admin_tabs.rb
+++ b/app/overrides/add_admin_tabs.rb
@@ -1,6 +1,6 @@-# Deface::Override.new(
-# virtual_path: 'spree/admin/shared/_product_tabs',
-# name: 'product_assembly_admin_product_tabs',
-# insert_bottom: "[data-hook='admin_product_tabs']",
-# partial: 'spree/admin/shared/product_allegro_product_tabs',
-# disabled: false)+Deface::Override.new(
+ virtual_path: 'spree/admin/shared/_product_tabs',
+ name: 'product_assembly_admin_product_tabs_allegro',
+ insert_bottom: "[data-hook='admin_product_tabs']",
+ partial: 'spree/admin/shared/product_allegro_product_tabs',
+ disabled: false) | Fix admin tab deface conflict with parts.
|
diff --git a/spec/models/event_spec.rb b/spec/models/event_spec.rb
index abc1234..def5678 100644
--- a/spec/models/event_spec.rb
+++ b/spec/models/event_spec.rb
@@ -6,14 +6,14 @@ it 'counts words in abstract' do
event = build(:event)
expect(event.abstract_word_count).to eq(233)
- event.update_attributes!(abstract: "abstract.")
+ event.update_attributes!(abstract: 'abstract.')
expect(event.abstract_word_count).to eq(1)
end
it 'counts 0 when abstract is empty' do
event = build(:event, abstract: nil)
expect(event.abstract_word_count).to eq(0)
- event.abstract = ""
+ event.abstract = ''
expect(event.abstract_word_count).to eq(0)
end
end
| Fix styling issue: " -> '
|
diff --git a/app/serializers/restricted/group_serializer.rb b/app/serializers/restricted/group_serializer.rb
index abc1234..def5678 100644
--- a/app/serializers/restricted/group_serializer.rb
+++ b/app/serializers/restricted/group_serializer.rb
@@ -7,6 +7,6 @@ end
def include_logo_url_medium?
- object.logo.present?
+ object.type == "FormalGroup" && object.logo.present?
end
end
| Fix restricted group serializer for guest groups
|
diff --git a/spec/features/labs/map_spec.rb b/spec/features/labs/map_spec.rb
index abc1234..def5678 100644
--- a/spec/features/labs/map_spec.rb
+++ b/spec/features/labs/map_spec.rb
@@ -5,6 +5,9 @@ it "can load mapdata.json without errors" do
# TODO: use Factorybot to create this lab object
+ # It does not catch the error if map_serializer is like it was before 5f409af
+ # lab = Factorybot.create(:lab)
+ # Which resulted in the map to show up empty
Lab.create!(
name: "MyLab",
kind: 'fab_lab',
| Improve comment on mapdata.json error
|
diff --git a/spec/unit/manufacturer_spec.rb b/spec/unit/manufacturer_spec.rb
index abc1234..def5678 100644
--- a/spec/unit/manufacturer_spec.rb
+++ b/spec/unit/manufacturer_spec.rb
@@ -40,6 +40,18 @@
end
+ describe 'built with name and id' do
+
+ before do
+ @manufacturer = BudsGunShop::Manufacturer.new(:name => 'Foo', :id => '123')
+ end
+
+ it "should be valid" do
+ @manufacturer.must_be :valid?
+ end
+
+ end
+
describe 'fetching all manufacturers' do
before do
| Add validity check to manufacturer spec
|
diff --git a/rubicure_fuzzy_match.gemspec b/rubicure_fuzzy_match.gemspec
index abc1234..def5678 100644
--- a/rubicure_fuzzy_match.gemspec
+++ b/rubicure_fuzzy_match.gemspec
@@ -24,5 +24,5 @@
spec.add_development_dependency "bundler", "~> 1.11"
spec.add_development_dependency "rake", "~> 10.0"
- spec.add_development_dependency "test-unit", "~> 3.1.3"
+ spec.add_development_dependency "test-unit", "~> 3.2.1"
end
| Upgrade test-unit version to "~> 3.2.1"
|
diff --git a/lib/bridgy_job.rb b/lib/bridgy_job.rb
index abc1234..def5678 100644
--- a/lib/bridgy_job.rb
+++ b/lib/bridgy_job.rb
@@ -0,0 +1,32 @@+# frozen_string_literal: true
+
+# Async job to posting webmentions to Bridgy.
+# The retry interval uses the agorithm as Sidekiq but we start from 1 with an initial sleep
+# as you'll never get an instant publishing.
+# Assuming `rand()`` always returns 30, the longest we'll be running for is just over 27 mins
+class BridgyJob
+ include SuckerPunch::Job
+
+ def perform(location, destination, options = { bridgy_omit_link: false, bridgy_ignore_formatting: false })
+ logger.info "Syndicating #{location} to #{destination}"
+ count = 1
+ post_ready = false
+ while count < 6
+ slp = ENV['RACK_ENV'] == 'test' ? 0 : (count**4) + 15 + (rand(30) * (count + 1))
+ logger.info "Sleeping for #{slp}s ..."
+ sleep slp
+ post_ready = HTTParty.head(location, follow_redirects: true, maintain_method_across_redirects: true).success?
+ break if post_ready
+
+ count += 1
+ end
+
+ return logger.info "#{location} never appeared. No syndication attempted." unless post_ready
+
+ resp = HTTParty.post('https://brid.gy/publish/webmention',
+ body: { source: location, target: "https://brid.gy/publish/#{destination}" },
+ query: options)
+
+ logger.info resp.created? ? "Successfully syndicated #{location} to #{destination}" : "Bridgy not happy: #{resp.code}"
+ end
+end
| Add bg job for posting to bridgy
|
diff --git a/lib/cheepcreep.rb b/lib/cheepcreep.rb
index abc1234..def5678 100644
--- a/lib/cheepcreep.rb
+++ b/lib/cheepcreep.rb
@@ -12,15 +12,14 @@
def initialize
# ENV["FOO"] is like echo $FOO
- #@auth = {:username => ENV['GITHUB_USER'], :password => ENV['GITHUB_PASS']}
+ @auth = {:username => ENV['GITHUB_USER'], :password => ENV['GITHUB_PASS']}
+ end
+
+ def get_gists(screen_name)
+ options = {:basic_auth => @auth}
+ result = self.class.get("/users/#{screen_name}/gists", options)
+ json = JSON.parse(result.body)
end
end
-
-class CheepcreepApp
-end
-
binding.pry
-
-creeper = CheepcreepApp.new
-creeper.creep
| Add a basic example and auth.
|
diff --git a/lib/fezzik/dsl.rb b/lib/fezzik/dsl.rb
index abc1234..def5678 100644
--- a/lib/fezzik/dsl.rb
+++ b/lib/fezzik/dsl.rb
@@ -8,8 +8,8 @@ Fezzik.env(*args)
end
- def capture_output(*args)
- Fezzik::Util.capture_output(*args)
+ def capture_output(&block)
+ Fezzik::Util.capture_output(&block)
end
end
end
| Fix bug with capture_output DSL block passing
|
diff --git a/lib/jwt/encode.rb b/lib/jwt/encode.rb
index abc1234..def5678 100644
--- a/lib/jwt/encode.rb
+++ b/lib/jwt/encode.rb
@@ -39,7 +39,13 @@ end
def encode_header
- encode(@headers.transform_keys(&:to_s).merge(ALG_KEY => @algorithm))
+ stringified_header = {}
+
+ @headers.each do |key, value|
+ stringified_header[key.to_s] = value
+ end
+
+ encode(stringified_header.merge(ALG_KEY => @algorithm))
end
def encode_payload
| Make sure stringify'ing works on ruby < 2.5
|
diff --git a/config/initializers/hostname.rb b/config/initializers/hostname.rb
index abc1234..def5678 100644
--- a/config/initializers/hostname.rb
+++ b/config/initializers/hostname.rb
@@ -32,7 +32,7 @@ def self.url_authority(scheme: 'http')
port = Ontohub::Application.config.port
port = ":#{port}" if port
- "#{scheme}://#{Ontohub::Application.config.fqdn}#{port}/"
+ "#{scheme}://#{Ontohub::Application.config.fqdn}#{port}"
end
end
| Remove trailing slash from authority.
|
diff --git a/view_source_map.gemspec b/view_source_map.gemspec
index abc1234..def5678 100644
--- a/view_source_map.gemspec
+++ b/view_source_map.gemspec
@@ -15,7 +15,7 @@ "a rendered partial view as HTML comment in development environment"
s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.md"]
- s.add_dependency "rails", "~> 3.2.9"
+ s.add_dependency "rails", ">= 3.2"
s.add_development_dependency "sqlite3"
s.add_development_dependency "rspec-rails"
end
| Support Rails 3.2 or later
|
diff --git a/lib/nba/player.rb b/lib/nba/player.rb
index abc1234..def5678 100644
--- a/lib/nba/player.rb
+++ b/lib/nba/player.rb
@@ -10,9 +10,7 @@
# Returns an array of Player objects given a team roster
def self.all_from_roster(players)
- players.map do |player|
- next if player['to'] != nil
-
+ players.select{ |player| player['to'].nil? }.map do |player|
new(
:name => player['player'],
:number => player['number'],
@@ -20,7 +18,7 @@ :from => player['from'],
:to => "Present"
)
- end.compact
+ end
end
end
end
| Make code read clearer. [ci skip]
|
diff --git a/lib/memory_profiler.rb b/lib/memory_profiler.rb
index abc1234..def5678 100644
--- a/lib/memory_profiler.rb
+++ b/lib/memory_profiler.rb
@@ -10,7 +10,6 @@
module MemoryProfiler
def self.report(opts={},&block)
- opts[:top] ||= 50
Reporter.report(opts,&block)
end
| Remove excessive setting of default of :top option
This is already done in `MemoryProfiler::Reporter`, so doing this here
is unecessary.
|
diff --git a/lib/sshkit/all.rb b/lib/sshkit/all.rb
index abc1234..def5678 100644
--- a/lib/sshkit/all.rb
+++ b/lib/sshkit/all.rb
@@ -1,7 +1,6 @@ require_relative '../core_ext/array'
require_relative '../core_ext/hash'
-require_relative 'dsl'
require_relative 'host'
require_relative 'command'
| Remove sshkit/dsl from the default required files
|
diff --git a/lib/spatula/prepare.rb b/lib/spatula/prepare.rb
index abc1234..def5678 100644
--- a/lib/spatula/prepare.rb
+++ b/lib/spatula/prepare.rb
@@ -13,12 +13,16 @@ end
def ssh command
- sh %Q|ssh -t -p #@port #@server #{command}|
+ sh %Q|ssh -t -p #@port #@server "#{command.gsub('"', '\\"')}"|
end
def run
ssh "sudo apt-get update"
- ssh "sudo aptitude -y install ruby rubygems rubygems1.8 irb ri libopenssl-ruby1.8 libshadow-ruby1.8 ruby1.8-dev gcc g++ rsync"
+ ssh "sudo aptitude -y install ruby irb ri libopenssl-ruby1.8 libshadow-ruby1.8 ruby1.8-dev gcc g++ rsync"
+ ssh "curl -L 'http://rubyforge.org/frs/download.php/69365/rubygems-1.3.6.tgz' | tar xvzf -"
+ ssh "cd rubygems* && sudo ruby setup.rb --no-ri --no-rdoc"
+ ssh "sudo ln -sfv /usr/bin/gem1.8 /usr/bin/gem"
+
ssh "sudo gem install rdoc chef ohai --no-ri --no-rdoc --source http://gems.opscode.com --source http://gems.rubyforge.org"
end
| Install custom rubygems rather than using apt-get cause Ubuntu sucks ass (i.e., doesn't throw gems bin in PATH).
|
diff --git a/librarian.gemspec b/librarian.gemspec
index abc1234..def5678 100644
--- a/librarian.gemspec
+++ b/librarian.gemspec
@@ -12,8 +12,6 @@ gem.summary = %q{Librarian}
gem.description = %q{Librarian}
gem.homepage = ""
-
- gem.rubyforge_project = "librarian"
gem.files = `git ls-files`.split($/)
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
| Remove the rubyforge_project attribute from the gemspec.
There is no rubyforge project for this gem.
|
diff --git a/markdown-style.rb b/markdown-style.rb
index abc1234..def5678 100644
--- a/markdown-style.rb
+++ b/markdown-style.rb
@@ -4,6 +4,7 @@ exclude_rule 'MD014'
exclude_rule 'MD020'
exclude_rule 'MD021'
+exclude_rule 'MD026'
exclude_rule 'MD033'
exclude_rule 'MD036'
exclude_rule 'MD040'
| Remove the "Trailing punctuation in header" Rule |
diff --git a/messaging.gemspec b/messaging.gemspec
index abc1234..def5678 100644
--- a/messaging.gemspec
+++ b/messaging.gemspec
@@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = 'evt-messaging'
- s.version = '1.1.0.0'
+ s.version = '1.1.0.1'
s.summary = 'Common primitives for platform-specific messaging implementations for Eventide'
s.description = ' '
| Package version is increased from 1.1.0.0 to 1.1.0.1
|
diff --git a/db/migrate/20161103110635_add_more_fields_to_trade_uploads.rb b/db/migrate/20161103110635_add_more_fields_to_trade_uploads.rb
index abc1234..def5678 100644
--- a/db/migrate/20161103110635_add_more_fields_to_trade_uploads.rb
+++ b/db/migrate/20161103110635_add_more_fields_to_trade_uploads.rb
@@ -3,12 +3,12 @@ add_column :trade_annual_report_uploads, :is_from_epix, :boolean, default: false
add_column :trade_annual_report_uploads, :is_from_web_service, :boolean, default: false
add_column :trade_annual_report_uploads, :number_of_records_submitted, :integer
- add_column :trade_annual_report_uploads, :auto_reminder_sent_at, :date
- add_column :trade_annual_report_uploads, :sandbox_transferred_at, :date
+ add_column :trade_annual_report_uploads, :auto_reminder_sent_at, :datetime
+ add_column :trade_annual_report_uploads, :sandbox_transferred_at, :datetime
add_column :trade_annual_report_uploads, :sandbox_transferred_by_id, :integer
- add_column :trade_annual_report_uploads, :submitted_at, :date
+ add_column :trade_annual_report_uploads, :submitted_at, :datetime
add_column :trade_annual_report_uploads, :submitted_by_id, :integer
- add_column :trade_annual_report_uploads, :deleted_at, :date
+ add_column :trade_annual_report_uploads, :deleted_at, :datetime
add_column :trade_annual_report_uploads, :deleted_by_id, :integer
end
end
| Change date with datetime type
|
diff --git a/convert.rb b/convert.rb
index abc1234..def5678 100644
--- a/convert.rb
+++ b/convert.rb
@@ -0,0 +1,17 @@+File.open("INSTALLATION.out",'w')do |out|
+ body = File.read('INSTALLATION.md')
+ puts body
+ body.gsub!(/\{\{\{([^\n]+?)\}\}\}/, '`\1`')
+ body.gsub!(/\{\{\{(.+?)\}\}\}/m){|m| m.each_line.map{|x| "\t#{x}".gsub(/[\{\}]{3}/,'')}.join}
+ body.gsub!(/\=\=\=\=\s(.+?)\s\=\=\=\=/, '### \1')
+ body.gsub!(/\=\=\=\s(.+?)\s\=\=\=/, '## \1')
+ body.gsub!(/\=\=\s(.+?)\s\=\=/, '# \1')
+ body.gsub!(/\=\s(.+?)\s\=[\s\n]*/, '')
+ body.gsub!(/\[(http[^\s\[\]]+)\s([^\[\]]+)\]/, '[\2](\1)')
+ body.gsub!(/\!(([A-Z][a-z0-9]+){2,})/, '\1')
+ body.gsub!(/'''(.+)'''/, '*\1*')
+ body.gsub!(/''(.+)''/, '_\1_')
+ body.gsub!(/^\s\*/, '*')
+ body.gsub!(/^\s\d\./, '1.')
+ out.write(body)
+end
| Revert "Revert "adding conversion script""
This reverts commit 9c08610429939b6d98112f87c00ff6bde0c98fa9.
|
diff --git a/Alamofire-SwiftyJSON.podspec b/Alamofire-SwiftyJSON.podspec
index abc1234..def5678 100644
--- a/Alamofire-SwiftyJSON.podspec
+++ b/Alamofire-SwiftyJSON.podspec
@@ -11,4 +11,7 @@ s.ios.deployment_target = "8.0"
s.source = { :git => "https://github.com/SwiftyJSON/Alamofire-SwiftyJSON.git", :tag => "1.1.0"}
s.source_files = "Source/*.swift"
+
+ s.dependency 'Alamofire', '~> 1.1'
+ s.dependency 'SwiftyJSON', '~> 2.1'
end
| Add dependencies to the podspec
|
diff --git a/test/helper.rb b/test/helper.rb
index abc1234..def5678 100644
--- a/test/helper.rb
+++ b/test/helper.rb
@@ -20,3 +20,6 @@ ENV['MT_NO_PLUGINS'] = '1' # Work around stupid autoloading of plugins
require 'minitest/spec'
require 'minitest/autorun'
+
+Minitest::Test.make_my_diffs_pretty!
+
| Make all diffs pretty in tests
|
diff --git a/puppet-lint-no_cron_resources-check.gemspec b/puppet-lint-no_cron_resources-check.gemspec
index abc1234..def5678 100644
--- a/puppet-lint-no_cron_resources-check.gemspec
+++ b/puppet-lint-no_cron_resources-check.gemspec
@@ -21,7 +21,7 @@ spec.add_development_dependency 'rspec', '~> 3.5.0'
spec.add_development_dependency 'rspec-its', '~> 1.0'
spec.add_development_dependency 'rspec-collection_matchers', '~> 1.0'
- spec.add_development_dependency 'rubocop', '~> 0.47.1'
+ spec.add_development_dependency 'rubocop', '~> 0.75.0'
spec.add_development_dependency 'rake', '~> 11.2.0'
spec.add_development_dependency 'rspec-json_expectations', '~> 1.4'
spec.add_development_dependency 'simplecov', '~> 0.17.1'
| Update rubocop requirement from ~> 0.47.1 to ~> 0.75.0
Updates the requirements on [rubocop](https://github.com/rubocop-hq/rubocop) to permit the latest version.
- [Release notes](https://github.com/rubocop-hq/rubocop/releases)
- [Changelog](https://github.com/rubocop-hq/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop-hq/rubocop/compare/v0.47.1...v0.75.0)
Signed-off-by: dependabot-preview[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com> |
diff --git a/app/controllers/api/v1/versions_controller.rb b/app/controllers/api/v1/versions_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/api/v1/versions_controller.rb
+++ b/app/controllers/api/v1/versions_controller.rb
@@ -14,6 +14,12 @@ end
def reverse_dependencies
- respond_with(Version.reverse_dependencies(params[:id]), :yamlish => true)
+ versions = Version.reverse_dependencies(params[:id])
+
+ respond_to do |format|
+ format.json { render :json => versions.map { |v| v.as_json.merge("full_name" => v.full_name) } }
+ format.xml { render :xml => versions.map { |v| v.payload.merge("full_name" => v.full_name) } }
+ format.yaml { render :text => versions.map { |v| v.payload.merge("full_name" => v.full_name) }.to_yaml }
+ end
end
end
| Add full_name field to the reverse_dependencies payload
|
diff --git a/app/controllers/storytime/posts_controller.rb b/app/controllers/storytime/posts_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/storytime/posts_controller.rb
+++ b/app/controllers/storytime/posts_controller.rb
@@ -13,7 +13,7 @@ end
@posts = @posts.tagged_with(params[:tag]) if params[:tag]
- @posts = @posts.published.order(created_at: :desc).page(params[:page]).per(10)
+ @posts = @posts.published.order(created_at: :desc).page(params[:page])
respond_to do |format|
format.atom
| Remove explicit per declaration for @posts
|
diff --git a/lib/daimon_skycrawlers/processor/default.rb b/lib/daimon_skycrawlers/processor/default.rb
index abc1234..def5678 100644
--- a/lib/daimon_skycrawlers/processor/default.rb
+++ b/lib/daimon_skycrawlers/processor/default.rb
@@ -9,12 +9,12 @@ page = storage.find(url)
headers = JSON.parse(page.headers)
headers_string = headers.map {|key, value| " #{key}: #{value}" }.join("\n")
- message = <<~LOG
- URL: #{page.url}
- Body: #{page.body.bytesize} bytes
- Headers:
- #{headers_string}
- LOG
+ message = <<LOG
+URL: #{page.url}
+Body: #{page.body.bytesize} bytes
+Headers:
+#{headers_string}
+LOG
log.info(message)
end
end
| Use plain here document to support Ruby 2.2
|
diff --git a/app/controllers/feeds.rb b/app/controllers/feeds.rb
index abc1234..def5678 100644
--- a/app/controllers/feeds.rb
+++ b/app/controllers/feeds.rb
@@ -26,6 +26,10 @@
if url.empty?
json_error("Feed URL required")
+ end
+
+ if Feed.find_by_url(url)
+ json_error("Feed already exists")
end
feed = FeedImport.new(url).run
| Check feed existance when importing
|
diff --git a/lib/kontena/plugin/console/commands/exit.rb b/lib/kontena/plugin/console/commands/exit.rb
index abc1234..def5678 100644
--- a/lib/kontena/plugin/console/commands/exit.rb
+++ b/lib/kontena/plugin/console/commands/exit.rb
@@ -0,0 +1,18 @@+module Kontena::Plugin
+ module Console
+ class ExitCommand < Command
+ command 'exit'
+ description 'Quit console'
+ help 'Enter "exit" to quit.'
+
+ completions nil
+
+ CleanExit = Class.new(StandardError)
+
+ def execute
+ raise CleanExit
+ end
+ end
+ end
+end
+
| Exit command so you can get out without ctrl-d
|
diff --git a/lib/rubygems/comparator/spec_comparator.rb b/lib/rubygems/comparator/spec_comparator.rb
index abc1234..def5678 100644
--- a/lib/rubygems/comparator/spec_comparator.rb
+++ b/lib/rubygems/comparator/spec_comparator.rb
@@ -19,19 +19,9 @@ if same_values?(values) && options[:log_all]
report[param].section do
set_header "#{same} #{param}"
-=begin
- case values[0].class
- when String, Array, Hash
- puts values[0]
- when Gem::Requirement
- Kernel.puts 'requirement'
- when NilClass
- puts 'nil'
- end
-=end
puts values[0]
end
- else
+ elsif !same_values?(values)
report[param].set_header "#{different} #{param}:"
values.each_with_index do |value, index|
report[param] << \
| Fix SpecComparator to report only different values by default
|
diff --git a/lib/tasks/2018_06_05_resend_attestations.rb b/lib/tasks/2018_06_05_resend_attestations.rb
index abc1234..def5678 100644
--- a/lib/tasks/2018_06_05_resend_attestations.rb
+++ b/lib/tasks/2018_06_05_resend_attestations.rb
@@ -1,4 +1,4 @@-namespace :'2018_06_05_resend_attestation' do
+namespace :'2018_06_05_resend_attestations' do
task set: :environment do
procedure = Procedure.find(4247)
dossiers = procedure.dossiers.includes(:attestation).where(state: 'accepte').select do |d|
| Make the task name match the filename |
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
@@ -2,5 +2,4 @@ # protect_from_forgery with: :exception
include AlexaInterfaceHelper
include AlexaHelpIntentHelper
- include AlexaEastereggHelper
end
| Remove AlexaEasterEggHelper from application controller
|
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
@@ -10,7 +10,7 @@ end
def configure_permitted_parameters
- devise_parameter_sanitizer.for(:sign_up) << [:nom, :prenom]
+ devise_parameter_sanitizer.for(:sign_up) << [:nom, :prenom, :telephone]
end
private
| FIX : ajout du champ telephone dans les strong parameters du model User
|
diff --git a/spec/controllers/api/api_controller_spec.rb b/spec/controllers/api/api_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/api/api_controller_spec.rb
+++ b/spec/controllers/api/api_controller_spec.rb
@@ -13,14 +13,14 @@
it 'Response with correct JSON status structure' do
hash_body = nil
- expect{hash_body = json}.not_to raise_exception
- expect(hash_body).to include(:message => I18n.t('api.core.status_ok'))
+ expect { hash_body = json }.not_to raise_exception
+ expect(hash_body).to include(message: I18n.t('api.core.status_ok'))
expect(hash_body).to include('versions')
- Extends::API_VERSIONS.each_with_index do |ver, index|
+ Extends::API_VERSIONS.each do |ver|
expect(hash_body['versions']).to include(
- { 'version' => ver,
- 'baseUrl' => "/api/#{ver}/" }
+ 'version' => ver,
+ 'baseUrl' => "/api/#{ver}/"
)
end
end
| Update formating according to Hound
|
diff --git a/lib/autoprefixer-rails/sprockets.rb b/lib/autoprefixer-rails/sprockets.rb
index abc1234..def5678 100644
--- a/lib/autoprefixer-rails/sprockets.rb
+++ b/lib/autoprefixer-rails/sprockets.rb
@@ -9,8 +9,7 @@
# Add prefixes for `css`
def process(context, css, opts)
- root = Pathname.new(context.root_path)
- input = context.pathname.relative_path_from(root).to_s
+ input = context.pathname.to_s
output = input.chomp(File.extname(input)) + '.css'
@processor.process(css, opts.merge(from: input, to: output)).css
| Fix a Sporckets context path on Windows.
|
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
@@ -18,6 +18,6 @@ params['lang'] ||
http_accept_language.compatible_language_from(I18n.available_locales)
- I18n.locale = user_locale user_locale if Rails.application.config.welsh_language_enabled
+ I18n.locale = user_locale if Rails.application.config.welsh_language_enabled
end
end
| Fix typo in feature flag use
|
diff --git a/spec/views/plantings/show.html.haml_spec.rb b/spec/views/plantings/show.html.haml_spec.rb
index abc1234..def5678 100644
--- a/spec/views/plantings/show.html.haml_spec.rb
+++ b/spec/views/plantings/show.html.haml_spec.rb
@@ -1,26 +1,49 @@ require 'spec_helper'
describe "plantings/show" do
- before(:each) do
- controller.stub(:current_user) { nil }
- @member = FactoryGirl.create(:member)
+ def create_planting_for(member)
@garden = FactoryGirl.create(:garden, :owner => @member)
@crop = FactoryGirl.create(:tomato)
@planting = assign(:planting,
FactoryGirl.create(:planting, :garden => @garden, :crop => @crop)
)
- render
end
- it "renders the quantity planted" do
- rendered.should match(/3/)
+ context "no location set" do
+ before(:each) do
+ controller.stub(:current_user) { nil }
+ @member = FactoryGirl.create(:member)
+ create_planting_for(@member)
+ render
+ end
+
+ it "renders the quantity planted" do
+ rendered.should match(/3/)
+ end
+
+ it "renders the description" do
+ rendered.should match(/This is a/)
+ end
+
+ it "renders markdown in the description" do
+ assert_select "em", "really"
+ end
+
+ it "doesn't contain a () if no location is set" do
+ rendered.should_not contain "()"
+ end
end
- it "renders the description" do
- rendered.should match(/This is a/)
- end
+ context "location set" do
+ before(:each) do
+ controller.stub(:current_user) { nil }
+ @member = FactoryGirl.create(:geolocated_member)
+ create_planting_for(@member)
+ render
+ end
- it "renders markdown in the description" do
- assert_select "em", "really"
+ it "shows the member's location in parentheses" do
+ rendered.should contain "(#{@member.location})"
+ end
end
end
| Test display of location on plantings/show.
As discussed at
https://github.com/pozorvlak/growstuff/commit/d87a1ee4fdd15153537382ddbfa16e3e3d9672a5.
The version of app/views/plantings/show.html.haml from commit 97ce623
fails the "()" test, as expected.
|
diff --git a/lib/poms.rb b/lib/poms.rb
index abc1234..def5678 100644
--- a/lib/poms.rb
+++ b/lib/poms.rb
@@ -21,8 +21,8 @@ private
def assert_credentials
- raise Poms::Errors::AuthenticationError.new('API key not supplied') unless @key.present?
- raise Poms::Errors::AuthenticationError.new('API secret not supplied') unless @secret.present?
- raise Poms::Errors::AuthenticationError.new('Origin not supplied') unless @origin.present?
+ fail Errors::AuthenticationError, 'API key not supplied' unless @key.present?
+ fail Errors::AuthenticationError, 'API secret not supplied' unless @secret.present?
+ fail Errors::AuthenticationError, 'Origin not supplied' unless @origin.present?
end
end
| Use fail instead of raise (rubocop) + pass message as second arg to fail
|
diff --git a/app/models/observer/tag/ticket_history.rb b/app/models/observer/tag/ticket_history.rb
index abc1234..def5678 100644
--- a/app/models/observer/tag/ticket_history.rb
+++ b/app/models/observer/tag/ticket_history.rb
@@ -15,8 +15,8 @@ :o_id => record.o_id,
:history_type => 'added',
:history_object => 'Ticket',
- :history_attribute => 'Tag',
- :value_from => record.tag_item.name,
+ :history_attribute => 'tag',
+ :value_to => record.tag_item.name,
)
end
def after_destroy(record)
@@ -29,8 +29,8 @@ :o_id => record.o_id,
:history_type => 'removed',
:history_object => 'Ticket',
- :history_attribute => 'Tag',
- :value_from => record.tag_item.name,
+ :history_attribute => 'tag',
+ :value_to => record.tag_item.name,
)
end
end
| Store tags into value_to field.
|
diff --git a/islay_blog.gemspec b/islay_blog.gemspec
index abc1234..def5678 100644
--- a/islay_blog.gemspec
+++ b/islay_blog.gemspec
@@ -16,7 +16,7 @@ s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.md"]
s.test_files = Dir["test/**/*"]
- s.add_dependency 'islay', '~> 1.0.0'
+ s.add_dependency 'islay', '~> 1.0.4'
s.add_dependency 'rdiscount', '~> 1.6.8'
s.add_dependency 'htmlentities', '~> 4.3.1'
s.add_dependency 'friendly_id', '~> 4.0.8'
| Update Islay dependency to 1.0.4
|
diff --git a/app/models/renalware/user.rb b/app/models/renalware/user.rb
index abc1234..def5678 100644
--- a/app/models/renalware/user.rb
+++ b/app/models/renalware/user.rb
@@ -15,7 +15,7 @@ scope :unapproved, -> { where(approved: [nil, false]) }
scope :inactive, -> { where("last_activity_at IS NOT NULL AND last_activity_at < ?", expire_after.ago) }
scope :author, -> { where.not(signature: nil) }
- scope :ordered, -> { order(:given_name, :family_name) }
+ scope :ordered, -> { order(:family_name, :given_name) }
# Non-persistent attribute to signify an update by an admin (bypassing some validations)
attr_accessor :super_admin_update
| Change User default order to family_name, given_name
|
diff --git a/metadata.rb b/metadata.rb
index abc1234..def5678 100644
--- a/metadata.rb
+++ b/metadata.rb
@@ -6,4 +6,9 @@ long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '2.1.1'
+supports 'ubuntu', '>= 12.04'
+supports 'windows'
+supports 'redhat', '~> 6.0'
+supports 'centos', '~> 6.0'
+
depends 'modules', '~> 0.2.0'
| Add list of supported platforms
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,5 +1,4 @@-#WepayRails::Engine.routes.draw do |map|
-Rails.application.routes.draw do |map|
+Rails.application.routes.draw do
namespace :wepay do
resources :ipn
resources :authorize
| Fix for rails 3.1 route definitions
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,4 +1,6 @@ Rails.application.routes.draw do
+ root 'welcome#index', as: 'welcome'
+
get 'home/index'
get 'welcome/index'
| Set welcome/index to be root url
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,11 +1,11 @@ # Plugin's routes
# See: http://guides.rubyonrails.org/routing.html
-match 'meeting_room_calendar/', :to => 'meeting_room_calendar#index'
-match 'meeting_room_calendar/:project_id', :to => 'meeting_room_calendar#index', :project_id => /\d+/
-match 'meeting_room_calendar/index', :to => 'meeting_room_calendar#index'
-match 'meeting_room_calendar/index/:project_id', :to => 'meeting_room_calendar#index', :project_id => /\d+/
-match 'meeting_room_calendar/missing_config', :to => 'meeting_room_calendar#missing_config'
-match 'meeting_room_calendar/create', :to => 'meeting_room_calendar#create'
-match 'meeting_room_calendar/update', :to => 'meeting_room_calendar#update'
-match 'meeting_room_calendar/delete', :to => 'meeting_room_calendar#delete'+get 'meeting_room_calendar/', :to => 'meeting_room_calendar#index'
+get 'meeting_room_calendar/:project_id', :to => 'meeting_room_calendar#index', :project_id => /\d+/
+get 'meeting_room_calendar/index', :to => 'meeting_room_calendar#index'
+get 'meeting_room_calendar/index/:project_id', :to => 'meeting_room_calendar#index', :project_id => /\d+/
+get 'meeting_room_calendar/missing_config', :to => 'meeting_room_calendar#missing_config'
+get 'meeting_room_calendar/create', :to => 'meeting_room_calendar#create'
+get 'meeting_room_calendar/update', :to => 'meeting_room_calendar#update'
+get 'meeting_room_calendar/delete', :to => 'meeting_room_calendar#delete' | Add compatibility with rails >= 4
Rails 4 disallows 'match' in routes.rb without specifying the http method.
Replace all 'match' with 'get'.
Signed-off-by: Tobias Droste <6f0b7afb8e169bccf102c27c4328261728913687@gmx.de>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.