diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/lib/contacts/gmail.rb b/lib/contacts/gmail.rb
index abc1234..def5678 100644
--- a/lib/contacts/gmail.rb
+++ b/lib/contacts/gmail.rb
@@ -18,9 +18,18 @@
@contacts = feed.elements.to_a('entry').collect do |entry|
title, email = entry.elements['title'].text, nil
+ primary_email = nil
+
entry.elements.each('gd:email') do |e|
- email = e.attribute('address').value if e.attribute('primary')
+ if e.attribute('primary')
+ primary_email = e.attribute('address').value
+ else
+ email = e.attribute('address').value
+ end
end
+
+ email = primary_email unless primary_email.nil?
+
[title, email] unless email.nil?
end
@contacts.compact!
|
Use other Gmail emails if primary there is no primary
|
diff --git a/browscapper.gemspec b/browscapper.gemspec
index abc1234..def5678 100644
--- a/browscapper.gemspec
+++ b/browscapper.gemspec
@@ -20,10 +20,10 @@ s.homepage = "http://github.com/dark-panda/browscapper"
s.require_paths = ["lib"]
- s.add_dependency("rdoc")
- s.add_dependency("rake", ["~> 0.9"])
- s.add_dependency("minitest")
- s.add_dependency("turn")
+ s.add_development_dependency("rdoc")
+ s.add_development_dependency("rake", ["~> 0.9"])
+ s.add_development_dependency("minitest")
+ s.add_development_dependency("turn")
s.add_dependency("inifile")
end
|
Make these gems into development dependencies.
|
diff --git a/spec/oga/xpath/parser/predicates_spec.rb b/spec/oga/xpath/parser/predicates_spec.rb
index abc1234..def5678 100644
--- a/spec/oga/xpath/parser/predicates_spec.rb
+++ b/spec/oga/xpath/parser/predicates_spec.rb
@@ -10,7 +10,11 @@ s(
:node_test,
s(:name, nil, 'foo'),
- s(:eq, s(:axis, 'attribute', 'class'), s(:string, 'bar'))
+ s(
+ :eq,
+ s(:axis, 'attribute', s(:name, nil, 'class')),
+ s(:string, 'bar')
+ )
)
)
)
@@ -26,8 +30,16 @@ s(:name, nil, 'foo'),
s(
:or,
- s(:eq, s(:axis, 'attribute', 'class'), s(:string, 'bar')),
- s(:eq, s(:axis, 'attribute', 'class'), s(:string, 'baz'))
+ s(
+ :eq,
+ s(:axis, 'attribute', s(:name, nil, 'class')),
+ s(:string, 'bar')
+ ),
+ s(
+ :eq,
+ s(:axis, 'attribute', s(:name, nil, 'class')),
+ s(:string, 'baz')
+ )
)
)
)
|
Use (name) nodes for @foo axes.
|
diff --git a/spec/quickeebooks/online/invoice_spec.rb b/spec/quickeebooks/online/invoice_spec.rb
index abc1234..def5678 100644
--- a/spec/quickeebooks/online/invoice_spec.rb
+++ b/spec/quickeebooks/online/invoice_spec.rb
@@ -10,4 +10,28 @@ invoice.line_items.count.should == 1
invoice.line_items.first.unit_price.should == 225
end
+
+ it "does not set id if it is not present" do
+ xml = <<EOT
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<Invoice xmlns="http://www.intuit.com/sb/cdm/v2" xmlns:qbp="http://www.intuit.com/sb/cdm/qbopayroll/v1" xmlns:qbo="http://www.intuit.com/sb/cdm/qbo">
+ <Header>
+ </Header>
+</Invoice>
+EOT
+ invoice = Quickeebooks::Online::Model::Invoice.from_xml(xml)
+ invoice.id.should eq nil
+ end
+
+ it "does not set header.sales_term_id if it is not present" do
+ xml = <<EOT
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<Invoice xmlns="http://www.intuit.com/sb/cdm/v2" xmlns:qbp="http://www.intuit.com/sb/cdm/qbopayroll/v1" xmlns:qbo="http://www.intuit.com/sb/cdm/qbo">
+ <Header>
+ </Header>
+</Invoice>
+EOT
+ invoice = Quickeebooks::Online::Model::Invoice.from_xml(xml)
+ invoice.header.sales_term_id.should eq nil
+ end
end
|
Online::Invoice: Test that id and sales_term_id are nil if not present
|
diff --git a/lib/github_cli/cli.rb b/lib/github_cli/cli.rb
index abc1234..def5678 100644
--- a/lib/github_cli/cli.rb
+++ b/lib/github_cli/cli.rb
@@ -6,6 +6,19 @@
module GithubCLI
class CLI < ::Thor
+ include Thor::Actions
+
+ def initialize(*args)
+ super
+ say <<-TEXT
+
+Github CLI client
+
+ TEXT
+ the_shell = (options["no-color"] ? Thor::Shell::Basic.new : shell)
+ GithubCLI.ui = UI.new(the_shell)
+ GithubCLi.ui.debug! if options["verbose"]
+ end
map "repo" => :repository,
"is" => :issue,
@@ -15,17 +28,13 @@ :desc => "Configuration file.",
:default => "~/.githubrc"
class_option :oauth, :type => :string, :aliases => '-a',
- :desc => 'Authentication token.'
- class_option :verbose, :type => :boolean
+ :desc => 'Authentication token.',
+ :banner => 'Set authentication token'
+ class_option "no-color", :type => :boolean,
+ :banner => "Disable colorization in output."
+ class_option :verbose, :type => :boolean,
+ :banner => "Enable verbose output mode."
- def initialize(*args)
- super
- say <<-TEXT
-
-Github CLI client
-
- TEXT
- end
desc 'init <config-name>', 'Initialize configuration file'
def init(config_name=nil)
|
Initialize shell and describe options.
|
diff --git a/app/models/site_comment.rb b/app/models/site_comment.rb
index abc1234..def5678 100644
--- a/app/models/site_comment.rb
+++ b/app/models/site_comment.rb
@@ -14,6 +14,8 @@ #
class SiteComment < ActiveRecord::Base
+ attr_accessible :name, :email, :body, :context_url, :context_data
+
belongs_to :user
after_initialize :set_user_details
@@ -26,7 +28,8 @@ end
def viewed!
- update_attributes(viewed_at: Time.now)
+ viewed_at = Time.now
+ save
end
protected
|
Add attr_accessible for site comments, and don't allow viewed_at to be set on new record creation.
|
diff --git a/lib/mocha-on-bacon.rb b/lib/mocha-on-bacon.rb
index abc1234..def5678 100644
--- a/lib/mocha-on-bacon.rb
+++ b/lib/mocha-on-bacon.rb
@@ -13,11 +13,11 @@
alias_method :it_before_mocha, :it
- def it(description)
+ def it(description, &block)
it_before_mocha(description) do
begin
mocha_setup
- yield
+ block.call
mocha_verify(MochaRequirementsCounter)
rescue Mocha::ExpectationError => e
raise Error.new(:failed, e.message)
|
Work around a bug in MacRuby where yield can't be used from a block.
|
diff --git a/lib/pariah/dataset.rb b/lib/pariah/dataset.rb
index abc1234..def5678 100644
--- a/lib/pariah/dataset.rb
+++ b/lib/pariah/dataset.rb
@@ -29,17 +29,20 @@ r = conn.get(path: '_cluster/health')
raise "Bad Elasticsearch connection!" unless r.status == 200
- conn.put \
- path: '_template/template_all',
- body: JSON.dump(
- {
- template: '*',
- order: 0,
- settings: {
- 'index.mapper.dynamic' => false
+ r =
+ conn.put \
+ path: '_template/template_all',
+ body: JSON.dump(
+ {
+ template: '*',
+ order: 0,
+ settings: {
+ 'index.mapper.dynamic' => false
+ }
}
- }
- )
+ )
+
+ raise "Bad Elasticsearch response!: #{r.body}" unless r.status == 200
end
end
|
Check the status of the initial index setup.
|
diff --git a/lib/solidus_affirm.rb b/lib/solidus_affirm.rb
index abc1234..def5678 100644
--- a/lib/solidus_affirm.rb
+++ b/lib/solidus_affirm.rb
@@ -1,5 +1,5 @@ require 'solidus_core'
+require "solidus_support"
require 'solidus_affirm/engine'
require 'solidus_affirm/callback_hook/base'
require 'solidus_affirm/affirm_client'
-require "solidus_support"
|
Move solidus_support require before the engine
This allows to use solidus support stuff into the engine file.
|
diff --git a/sinatra-activerecord.gemspec b/sinatra-activerecord.gemspec
index abc1234..def5678 100644
--- a/sinatra-activerecord.gemspec
+++ b/sinatra-activerecord.gemspec
@@ -8,7 +8,7 @@ gem.summary = gem.description
gem.homepage = "http://github.com/janko-m/sinatra-activerecord"
- gem.author = "Janko Marohnić"
+ gem.authors = ["Blake Mizerany", "Janko Marohnić"]
gem.email = "janko.marohnic@gmail.com"
gem.license = "MIT"
|
Put back Mizerany's as gem's author
|
diff --git a/lib/tasks/legacy.rake b/lib/tasks/legacy.rake
index abc1234..def5678 100644
--- a/lib/tasks/legacy.rake
+++ b/lib/tasks/legacy.rake
@@ -1,6 +1,6 @@ namespace :legacy do
desc 'Load legacy data into database'
- task :load do
+ task :load => :environment do
legacy_file = File.join(Rails.root, 'db', 'legacy.rb')
load(legacy_file) if File.exist?(legacy_file)
end
|
Make rake task load environment
|
diff --git a/lib/tasks/resque.rake b/lib/tasks/resque.rake
index abc1234..def5678 100644
--- a/lib/tasks/resque.rake
+++ b/lib/tasks/resque.rake
@@ -1,4 +1,8 @@ #!/usr/bin/env ruby
# vim: et ts=2 sw=2
-require "resque/tasks"+require "resque/tasks"
+
+task "resque:setup"=>:environment do
+ Grit::Git.git_timeout = 10.minutes
+end
|
Extend the git timeout for background jobs.
|
diff --git a/spec/features/ct101s_spec.rb b/spec/features/ct101s_spec.rb
index abc1234..def5678 100644
--- a/spec/features/ct101s_spec.rb
+++ b/spec/features/ct101s_spec.rb
@@ -6,4 +6,10 @@ page.driver.browser.switch_to.alert.accept
expect(page).to have_content("Clinical Trials 101")
end
+ scenario "renders different answers after clicking a question" do
+ visit "/"
+ page.driver.browser.switch_to.alert.accept
+ click_on("Are clinical trials safe?")
+ expect(page).to have_content("You will be monitored very closely")
+ end
end
|
Add test for rendering CT101 content after toggle
|
diff --git a/spec/unit/choice/eql_spec.rb b/spec/unit/choice/eql_spec.rb
index abc1234..def5678 100644
--- a/spec/unit/choice/eql_spec.rb
+++ b/spec/unit/choice/eql_spec.rb
@@ -16,6 +16,11 @@ not_to eq(described_class.new(:large, 2))
end
+ it "is false with different key attribute" do
+ expect(described_class.new(:large, 1, key: "j")).
+ not_to eq(described_class.new(:large, 2, key: "k"))
+ end
+
it "is false with non-choice object" do
expect(described_class.new(:large, 1)).not_to eq(:other)
end
|
Add test to ensure choice equality considers key attribute
|
diff --git a/lib/calyx/production/concat.rb b/lib/calyx/production/concat.rb
index abc1234..def5678 100644
--- a/lib/calyx/production/concat.rb
+++ b/lib/calyx/production/concat.rb
@@ -6,6 +6,13 @@ END_TOKEN = '}'.freeze
DEREF_TOKEN = '.'.freeze
+ # Parses an interpolated string into fragments combining terminal strings
+ # and non-terminal rules.
+ #
+ # Returns a concat node which is the head of a tree of child nodes.
+ #
+ # @param production [String]
+ # @param registry [Calyx::Registry]
def self.parse(production, registry)
expansion = production.split(EXPRESSION).map do |atom|
if atom.is_a?(String)
@@ -30,10 +37,18 @@ self.new(expansion)
end
+ # Initialize the concat node with an expansion of terminal and
+ # non-terminal fragments.
+ #
+ # @param expansion [Array]
def initialize(expansion)
@expansion = expansion
end
+ # Evaluate all the child nodes of this node and concatenate them together
+ # into a single result.
+ #
+ # @return [Array]
def evaluate
concat = @expansion.reduce([]) do |exp, atom|
exp << atom.evaluate
|
Add method comments to `Production::Concat` source
|
diff --git a/lib/devise_invitable/schema.rb b/lib/devise_invitable/schema.rb
index abc1234..def5678 100644
--- a/lib/devise_invitable/schema.rb
+++ b/lib/devise_invitable/schema.rb
@@ -16,7 +16,6 @@ # change_table :the_resources do |t|
# t.string :invitation_token, :limit => 60
# t.datetime :invitation_sent_at
- # t.datetime :invitation_accepted_at
# t.index :invitation_token # for invitable
# end
#
|
Remove example about non existent feature
|
diff --git a/lib/multi_site/rails/routes.rb b/lib/multi_site/rails/routes.rb
index abc1234..def5678 100644
--- a/lib/multi_site/rails/routes.rb
+++ b/lib/multi_site/rails/routes.rb
@@ -10,6 +10,13 @@
class MultiSiteConstraints
def matches?(request)
- Site.exists?(:id => request.path_parameters[:multi_site])
+ #TODO: This is not a definitive solution. Devise principal class is configurable,
+ #so we can't be sure if the the routes will start with users/...
+ #Devise settings must be read to know the principal's name
+ return true if defined?(Devise) and [ 'devise/sessions',
+ 'users/registrations',
+ 'users/passwords' ].include?(request.path_parameters[:controller])
+
+ Site.exists?(:url => request.path_parameters[:multi_site])
end
end
|
Revert previous change.
Handling Devise special case
|
diff --git a/lib/payroll_hero/api/errors.rb b/lib/payroll_hero/api/errors.rb
index abc1234..def5678 100644
--- a/lib/payroll_hero/api/errors.rb
+++ b/lib/payroll_hero/api/errors.rb
@@ -9,11 +9,11 @@ class ServerReturnedError < GenericError
def initialize(code, message)
@code = code
- @message = message
+ @error_details = message
super("#{code}: #{message}")
end
- attr_reader :code, :message
+ attr_reader :code, :error_details
end
class BadRequest < ServerReturnedError
|
Fix error inheritance so that it's catchable by default.
|
diff --git a/lib/tasks/tkh_menus_tasks.rake b/lib/tasks/tkh_menus_tasks.rake
index abc1234..def5678 100644
--- a/lib/tasks/tkh_menus_tasks.rake
+++ b/lib/tasks/tkh_menus_tasks.rake
@@ -1,4 +1,13 @@-# desc "Explaining what the task does"
-# task :tkh_menus do
-# # Task goes here
-# end
+namespace :tkh_menus do
+ desc "Create migrations, locale, and other files"
+ task :install do
+ system 'rails g tkh_menus:create_or_update_migrations'
+ system 'rails g tkh_menus:create_or_update_locales -f'
+ end
+
+ desc "Update files. Skip existing migrations and blog layout. Force overwrite locales"
+ task :update do
+ system 'rails g tkh_menus:create_or_update_migrations -s'
+ system 'rails g tkh_menus:create_or_update_locales -f'
+ end
+end
|
Set up basic rake tasks.
|
diff --git a/lib/tech_docs_html_renderer.rb b/lib/tech_docs_html_renderer.rb
index abc1234..def5678 100644
--- a/lib/tech_docs_html_renderer.rb
+++ b/lib/tech_docs_html_renderer.rb
@@ -14,4 +14,23 @@ </table>
</div>)
end
+
+ def header(text, header_level)
+ %(<h#{header_level} id="#{githubify_fragment_id(text)}" class="anchored-heading">
+ <a href="##{githubify_fragment_id(text)}" class="anchored-heading__icon" aria-hidden="true"></a>
+ #{text}
+ </h2>)
+ end
+
+ # Redcarpet uses a different algo to create fragment ids than github
+ # which has caused a TOC bug // ref https://trello.com/c/Re6fSBKj/24-change-internal-links-to-work-or-remove-internal-links
+ # this implementation modified for our purposes from version at jch/html-pipeline
+ # https://github.com/jch/html-pipeline/blob/master/lib/html/pipeline/toc_filter.rb
+ def githubify_fragment_id(text)
+ text
+ .downcase # lower case
+ .gsub(/<[^>]*>/, '') # crudely remove html tags
+ .gsub(/[^\w\- ]/, '') # remove any non-word characters
+ .tr(' ', '-') # replace spaces with hyphens
+ end
end
|
Fix issue with in-document links
Documents imported from the publishing-api/docs folder have a
table-of-contents which doesn't work here.
The documents are published on github, and made available here.
Due to a mismatch in Markdown -> HTML rendering between Github and
Middleman/Redcarpet, generated fragment IDs are created using a
different algorithm.
In this PR, I override the default Redcarpet `header` function to
make it use a Github flavoured ID scheme.
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -9,7 +9,6 @@ delete '/vote/:id', to: 'votes#destroy', as: 'vote_delete'
resources :users, only: [:show, :edit, :update, :delete]
- # patch '/users/:id', to: 'users#update', as: 'users_update'
resources :stories
|
Delete patch route for users
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -7,7 +7,7 @@ resources :newsitems, only: [:show], path: '/'
end
- scope '/api/v1', format: true, constraints: { format: 'json' } do
+ scope '/i', format: true, constraints: { format: 'json' } do
resources :feeds, only: [:index, :create, :show, :destroy] do
put 'mark_as_read', on: :member
put 'mark_all_as_read', on: :collection
|
Move API url to `/i'
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -25,6 +25,7 @@ root :to => 'home#index'
get 'map' => 'home#map'
get 'new' => 'home#new'
+ get 'new/*all' => 'home#new'
get 'contact' => 'contact_messages#new'
get 'terms' => 'text_blocks#terms'
get 'about' => 'text_blocks#about'
|
Add wildcard route that sends all /new url to the SPA to enable client-side routing.
|
diff --git a/lib/barcade/scraper.rb b/lib/barcade/scraper.rb
index abc1234..def5678 100644
--- a/lib/barcade/scraper.rb
+++ b/lib/barcade/scraper.rb
@@ -22,6 +22,7 @@ post = agent.get("#{BASE_URI}#{self.date_slug}")
rescue Mechanize::ResponseCodeError => e
puts "Today's tap hasn't been posted yet. Try the --yesterday flag."
+ exit
end
end
end
|
Add exit to stop execution if tap isn't available.
|
diff --git a/lib/calyx/modifiers.rb b/lib/calyx/modifiers.rb
index abc1234..def5678 100644
--- a/lib/calyx/modifiers.rb
+++ b/lib/calyx/modifiers.rb
@@ -1,5 +1,15 @@ module Calyx
class Modifiers
+ # Transforms an output string by delegating to the given output function.
+ #
+ # If a registered modifier method is not found, then delegate to the given
+ # string function.
+ #
+ # If an invalid modifier function is given, returns the raw input string.
+ #
+ # @param name [Symbol]
+ # @param value [String]
+ # @return [String]
def transform(name, value)
if respond_to?(name)
send(name, value)
|
Add method comments to `Modifiers` source
|
diff --git a/lib/dataly/importer.rb b/lib/dataly/importer.rb
index abc1234..def5678 100644
--- a/lib/dataly/importer.rb
+++ b/lib/dataly/importer.rb
@@ -49,7 +49,7 @@ end
def csv
- CSV.read(@filename, headers: true)
+ CSV.read(@filename, { headers: true, encoding: 'utf-8' })
end
end
end
|
Set default encoding for csv file.
|
diff --git a/lib/detect_language.rb b/lib/detect_language.rb
index abc1234..def5678 100644
--- a/lib/detect_language.rb
+++ b/lib/detect_language.rb
@@ -38,7 +38,7 @@ end
def user_status
- client.post('user/status')
+ client.get('user/status')
end
def languages
|
Use GET method to fetch user status
|
diff --git a/lib/middleware/base.rb b/lib/middleware/base.rb
index abc1234..def5678 100644
--- a/lib/middleware/base.rb
+++ b/lib/middleware/base.rb
@@ -1,4 +1,6 @@ # -*- encoding : utf-8 -*-
+require "forwardable"
+
# The base middleware class works just like a Tracksperanto::Export::Base, but it only wraps another exporting object and does not get registered on it's own
# as an export format. Middleware can be used to massage the tracks being exported in various interesting ways - like moving the coordinates, clipping the keyframes,
# scaling the whole export or even reversing the trackers to go backwards
@@ -8,6 +10,9 @@ include Tracksperanto::ConstName
include Tracksperanto::SimpleExport
include Tracksperanto::Parameters
+
+ extend Forwardable
+ def_delegators :@exporter, :start_export, :start_tracker_segment, :end_tracker_segment, :export_point, :end_export
# Used to automatically register your middleware in Tracksperanto.middlewares
# Normally you wouldn't need to override this
@@ -28,10 +33,4 @@ @exporter = exporter_and_args_for_block_init.shift
super
end
-
- %w( start_export start_tracker_segment end_tracker_segment
- export_point end_export).each do | m |
- define_method(m){|*a| @exporter.send(m, *a)}
- end
-
end
|
Use Forwardable to define Middleware methods
|
diff --git a/lib/web_game_engine.rb b/lib/web_game_engine.rb
index abc1234..def5678 100644
--- a/lib/web_game_engine.rb
+++ b/lib/web_game_engine.rb
@@ -8,16 +8,12 @@ end
def versus_user(current_board, player, user_input)
- if current_board.valid_move?(user_input)
- current_board = player.user_move(current_board, user_input)
- end
+ current_board = player.user_move(current_board, user_input)
end
def versus_comp(current_board, rules, player_1, player_1_input, player_2)
- if current_board.valid_move?(player_1_input)
current_board = player_1.user_move(current_board, player_1_input)
current_board = player_2.ai_move(current_board, rules)
- end
end
end
|
Refactor to take out duplicate checking of validmove
|
diff --git a/lib/yogo/schema_app.rb b/lib/yogo/schema_app.rb
index abc1234..def5678 100644
--- a/lib/yogo/schema_app.rb
+++ b/lib/yogo/schema_app.rb
@@ -14,7 +14,7 @@ { :content => env['yogo.schema'] }.to_json
end
- post '/schema' do
+ post '/schema/?' do
opts = Schema.parse_json(request.body.read) rescue nil
halt(401, 'Invalid Format') if opts.nil?
schema = Schema.new(opts)
|
Make the slash in schema/ optional
|
diff --git a/lib/avro2kafka.rb b/lib/avro2kafka.rb
index abc1234..def5678 100644
--- a/lib/avro2kafka.rb
+++ b/lib/avro2kafka.rb
@@ -14,11 +14,14 @@ @options = options
end
+ def reader
+ ARGF.lineno = 0
+ ARGF
+ end
+
def publish
- File.open(input_path, 'r') do |file|
- records = AvroReader.new(file).read
- KafkaPublisher.new(kafka_broker, kafka_topic, kafka_key).publish(records)
- end
+ records = AvroReader.new(reader).read
+ KafkaPublisher.new(kafka_broker, kafka_topic, kafka_key).publish(records)
puts "Avro file published to #{kafka_topic} topic on #{kafka_broker}!"
end
|
Use ARGF to read the avro file
|
diff --git a/test/changelog_test.rb b/test/changelog_test.rb
index abc1234..def5678 100644
--- a/test/changelog_test.rb
+++ b/test/changelog_test.rb
@@ -14,12 +14,12 @@ end
end
- def test_entry_does_not_end_with_a_punctuation
+ def test_entry_does_end_with_a_punctuation
lines = @changelog.each_line
entries = lines.grep(/^\*/)
entries.each do |entry|
- refute_match(/\.$/, entry)
+ assert_match(/(\.|\:)$/, entry)
end
end
end
|
Update test to assert line does end with punctuation
|
diff --git a/lib/active_model/validations/ip_validator.rb b/lib/active_model/validations/ip_validator.rb
index abc1234..def5678 100644
--- a/lib/active_model/validations/ip_validator.rb
+++ b/lib/active_model/validations/ip_validator.rb
@@ -2,18 +2,23 @@ module Validations
class IpValidator < EachValidator
def validate_each(record, attribute, value)
- regex = case options[:format]
- when :v4
- ipv4_regex
- when :v6
- ipv6_regex
- end
-
- raise "Unknown IP validator format #{options[:format].inspect}" unless regex
record.errors.add(attribute) unless regex.match(value)
end
+ def check_validity!
+ raise ArgumentError, "Unknown IP validator format #{options[:format].inspect}" unless [:v4, :v6].include? options[:format]
+ end
+
private
+ def regex
+ case options[:format]
+ when :v4
+ ipv4_regex
+ when :v6
+ ipv6_regex
+ end
+ end
+
def ipv4_regex
# Extracted from ruby 1.9.2
regex256 =
|
Add validity check standard to IPValidator and refactor
|
diff --git a/lib/generators/pay_fu/templates/migration.rb b/lib/generators/pay_fu/templates/migration.rb
index abc1234..def5678 100644
--- a/lib/generators/pay_fu/templates/migration.rb
+++ b/lib/generators/pay_fu/templates/migration.rb
@@ -7,7 +7,7 @@ t.string :payment_status
t.datetime :payment_date
t.integer :gross
- t.string :raw_post
+ t.text :raw_post
t.timestamps
end
|
Use TEXT field to store raw_post data
|
diff --git a/lib/opskit/cli.rb b/lib/opskit/cli.rb
index abc1234..def5678 100644
--- a/lib/opskit/cli.rb
+++ b/lib/opskit/cli.rb
@@ -6,9 +6,9 @@ class OdinSon < Thor
class_option :dry, type: :boolean
- desc "render TEMPLATE [CONF]", "generate apache vhost for TEMPLATE with [CONF] ."
- def render(template, conf = '.opskit.yml')
- conf = YAML.load_file( conf )
+ desc "render TEMPLATE", "generate apache vhost for TEMPLATE."
+ def render(template = nil)
+ conf = YAML.load_file( '.opskit.yml' ) if File.exist? ( '.opskit.yml' )
conf.keys.each do |key|
conf[(key.to_sym rescue key) || key] = conf.delete(key)
end
|
Remove conf parameter for render method
|
diff --git a/lib/tasks/db.rake b/lib/tasks/db.rake
index abc1234..def5678 100644
--- a/lib/tasks/db.rake
+++ b/lib/tasks/db.rake
@@ -27,3 +27,7 @@ Rake::Task["db:create"].enhance do
Rake::Task["db:create_schemas"].invoke if using_postgres?
end
+
+Rake::Task["db:migrate"].enhance do
+ Rake::Task["db:create_schemas"].invoke if using_postgres?
+end
|
Create DB schemas when migrating as well
|
diff --git a/lib/vai/config.rb b/lib/vai/config.rb
index abc1234..def5678 100644
--- a/lib/vai/config.rb
+++ b/lib/vai/config.rb
@@ -2,6 +2,7 @@ module Vai
class Config < Vagrant.plugin("2", :config)
attr_accessor :inventory_dir
+ attr_accessor :inventory_filename
attr_accessor :groups
def initialize
|
Add forgotten attr_accessor to inventory_filename
|
diff --git a/app/controllers/admin/metrics_controller.rb b/app/controllers/admin/metrics_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/admin/metrics_controller.rb
+++ b/app/controllers/admin/metrics_controller.rb
@@ -1,3 +1,5 @@+require 'sidekiq/testing/inline' if ENV['DEBUG']
+
class Admin::MetricsController < ApplicationController
include Concerns::Repository
include Concerns::Metric
|
Move Sidekiq inline requirement for debugging
Since the perform_async call has changed class I had to move the inline
requirement if the DEBUG environment variable is set, too. Now debugging
of Sidekiq worker is possible again.
Signed-off-by: Konrad Reiche <4ff0213f56e2082fcd8c882d04c546881c579ce4@gmail.com>
|
diff --git a/app/controllers/api/v1/search_controller.rb b/app/controllers/api/v1/search_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/api/v1/search_controller.rb
+++ b/app/controllers/api/v1/search_controller.rb
@@ -33,7 +33,9 @@ end
def cache_key(scope)
- "#{scope.to_sql}-#{scope.maximum(:updated_at)}-#{scope.total_count}"
+ Digest::MD5.hexdigest(
+ "#{scope.to_sql}-#{scope.maximum(:updated_at)}-#{scope.total_count}"
+ )
end
def locations_near(location)
|
Use hexdigest for cache key.
To make the cache key small. Problems can arise if the cache key is too long.
|
diff --git a/app/decorators/models/artefact_decorator.rb b/app/decorators/models/artefact_decorator.rb
index abc1234..def5678 100644
--- a/app/decorators/models/artefact_decorator.rb
+++ b/app/decorators/models/artefact_decorator.rb
@@ -3,5 +3,6 @@ "course",
"news",
"person"
- ]
+ ],
+ 'whitehall' => [] # Need to define this empty so that govuk_content_models validators still work. See their slug_validator.rb for reasons.
}
|
Include empty whitehall array in formats list
So that GDS validators can work.
|
diff --git a/core/io/pos_spec.rb b/core/io/pos_spec.rb
index abc1234..def5678 100644
--- a/core/io/pos_spec.rb
+++ b/core/io/pos_spec.rb
@@ -6,27 +6,6 @@ it_behaves_like :io_pos, :pos
end
-describe "IO#pos" do
- before :each do
- @fname = tmp('pos-text.txt')
- File.open @fname, 'w' do |f| f.write "123" end
- end
-
- after :each do
- rm_r @fname
- end
-
- it "allows a negative value when calling #ungetc at beginning of stream" do
- File.open @fname do |f|
- f.pos.should == 0
- f.ungetbyte(97)
- f.pos.should == -1
- f.getbyte
- f.pos.should == 0
- end
- end
-end
-
describe "IO#pos=" do
it_behaves_like :io_set_pos, :pos=
end
|
Remove spec depending on platform-dependent behavior from ungetc/lseek.
|
diff --git a/common_spree_dependencies.rb b/common_spree_dependencies.rb
index abc1234..def5678 100644
--- a/common_spree_dependencies.rb
+++ b/common_spree_dependencies.rb
@@ -23,18 +23,10 @@ gem 'email_spec', '1.4.0'
gem 'factory_girl_rails', '~> 4.4.0'
gem 'launchy'
+ gem 'pry'
gem 'rspec-rails', '~> 2.14.0'
gem 'simplecov'
gem 'webmock', '1.8.11'
gem 'poltergeist', '1.5.0'
gem 'timecop'
end
-
-group :test, :development do
- platforms :ruby_19 do
- gem 'pry-debugger'
- end
- platforms :ruby_20, :ruby_21 do
- gem 'pry-byebug'
- end
-end
|
Revert "Add pry and pry debuggers to common spree dependencies"
This reverts commit 7c367d5ca0e2f293813278a0e37d9f731aa8befb.
CI breaks with these errors: (lack of ruby 2.1 apparently)
[03:52:55][Step 1/1] in directory: /mnt/72aec43634788be0/core
[03:52:55][Step 1/1] `ruby_21` is not a valid platform. The available options are: [:ruby, :ruby_18,
[03:52:55][Step 1/1] :ruby_19, :ruby_20, :mri, :mri_18, :mri_19, :mri_20, :rbx, :jruby, :mswin,
[03:52:55][Step 1/1] :mingw, :mingw_18, :mingw_19, :mingw_20]
[03:52:56][Step 1/1] `ruby_21` is not a valid platform. The available options are: [:ruby, :ruby_18,
[03:52:56][Step 1/1] :ruby_19, :ruby_20, :mri, :mri_18, :mri_19, :mri_20, :rbx, :jruby, :mswin,
[03:52:56][Step 1/1] :mingw, :mingw_18, :mingw_19, :mingw_20]
[03:52:56][Step 1/1] `ruby_21` is not a valid platform. The available options are: [:ruby, :ruby_18,
[03:52:56][Step 1/1] :ruby_19, :ruby_20, :mri, :mri_18, :mri_19, :mri_20, :rbx, :jruby, :mswin,
[03:52:56][Step 1/1] :mingw, :mingw_18, :mingw_19, :mingw_20]
|
diff --git a/db/migrate/20171211111544_change_order_to_integer.rb b/db/migrate/20171211111544_change_order_to_integer.rb
index abc1234..def5678 100644
--- a/db/migrate/20171211111544_change_order_to_integer.rb
+++ b/db/migrate/20171211111544_change_order_to_integer.rb
@@ -1,6 +1,17 @@ class ChangeOrderToInteger < ActiveRecord::Migration[5.1]
- def change
+
+ def up
change_column :dojos, :order, :string, default: '000000'
+ end
+
+ if connection.adapter_name == 'PostgreSQL'
+ def up
+ change_column :dojos, :order, 'integer USING CAST(order AS integer)', default: 1
+ end
+ else
+ def down
+ change_column :dojos, :order, :integer, default: 1
+ end
end
end
|
Add down to change order migration
|
diff --git a/fuji.gemspec b/fuji.gemspec
index abc1234..def5678 100644
--- a/fuji.gemspec
+++ b/fuji.gemspec
@@ -2,7 +2,7 @@ require File.expand_path('../lib/fuji/version', __FILE__)
Gem::Specification.new do |gem|
- gem.authors = ["Zeke Sikelianos", "Max Shoening", "Dominic Dagradi"]
+ gem.authors = ["Zeke Sikelianos", "Max Schoening", "Dominic Dagradi"]
gem.email = ["zeke@heroku.com", "max@heroku.com", "dominic@heroku.com"]
gem.description = %q{Heroku's site header}
gem.summary = %q{Heroku's site header}
|
Fix name in gem authors
|
diff --git a/cassandra_object.gemspec b/cassandra_object.gemspec
index abc1234..def5678 100644
--- a/cassandra_object.gemspec
+++ b/cassandra_object.gemspec
@@ -1,6 +1,6 @@ Gem::Specification.new do |s|
s.name = 'cassandra_object'
- s.version = '0.5.0'
+ s.version = '0.5.0.pre'
s.email = "michael@koziarski.com"
s.author = "Michael Koziarski"
|
Make this a pre-release as it depends on another prerelease
|
diff --git a/core/file/initialize_spec.rb b/core/file/initialize_spec.rb
index abc1234..def5678 100644
--- a/core/file/initialize_spec.rb
+++ b/core/file/initialize_spec.rb
@@ -2,6 +2,14 @@
describe "File#initialize" do
it "needs to be reviewed for spec completeness"
+end
+
+ruby_version_is '1.8' do
+ describe "File#initialize" do
+ it 'ignores encoding options in mode parameter' do
+ lambda { File.new(__FILE__, 'r:UTF-8:iso-8859-1') }.should_not raise_error
+ end
+ end
end
ruby_version_is '1.9' do
|
Add spec for ignoring encoding options in 1.8
|
diff --git a/rubyapi.gemspec b/rubyapi.gemspec
index abc1234..def5678 100644
--- a/rubyapi.gemspec
+++ b/rubyapi.gemspec
@@ -10,7 +10,7 @@ gem.homepage = "https://github.com/Burgestrand/rubyapi"
gem.files = `git ls-files`.split("\n")
- gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
+ gem.test_files = ["rubyapi_spec.rb"]
gem.require_paths = ["."]
gem.extensions = ["extconf.rb"]
gem.version = "1.0.0"
|
Add test files to gemspec explicitly
|
diff --git a/rails/definitions/rails_app.rb b/rails/definitions/rails_app.rb
index abc1234..def5678 100644
--- a/rails/definitions/rails_app.rb
+++ b/rails/definitions/rails_app.rb
@@ -20,7 +20,7 @@ group grp
action params[:action]
migration_command "rake db:migrate"
- environment node[:rails][:environment]
+ environment "RAILS_ENV" => node[:rails][:environment]
params[:deploy_settings].each_pair do |func_name, param_value|
send(func_name, param_value)
end
|
Set the environment the new-style way
|
diff --git a/lib/odata/create_operation.rb b/lib/odata/create_operation.rb
index abc1234..def5678 100644
--- a/lib/odata/create_operation.rb
+++ b/lib/odata/create_operation.rb
@@ -20,7 +20,7 @@ # If a belongs to field, add association the way OData wants it
if @ar.class.belongs_to_field?(field)
belongs_to_field = @ar.class.belongs_to_field(field)
- body["#{belongs_to_field.options[:crm_key]}@odata.bind"] = "/#{belongs_to_field.class_name.downcase}s(#{values[1]})"
+ body["#{belongs_to_field.options[:crm_key]}@odata.bind"] = "/#{belongs_to_field.table_name}s(#{values[1]})"
else
body[field.downcase] = values[1]
end
|
Use table name for binding name
|
diff --git a/lib/percy/client/resources.rb b/lib/percy/client/resources.rb
index abc1234..def5678 100644
--- a/lib/percy/client/resources.rb
+++ b/lib/percy/client/resources.rb
@@ -10,12 +10,17 @@ attr_accessor :resource_url
attr_accessor :is_root
attr_accessor :mimetype
+ attr_accessor :content
def initialize(sha, resource_url, options = {})
@sha = sha
@resource_url = resource_url
@is_root = options[:is_root]
@mimetype = options[:mimetype]
+
+ # For user convenience of temporarily storing content with other data, but the actual data
+ # is never included when serialized.
+ @content = options[:content]
end
def serialize
|
Add ability to hold content in Resource container.
|
diff --git a/recipes/geminstall.rb b/recipes/geminstall.rb
index abc1234..def5678 100644
--- a/recipes/geminstall.rb
+++ b/recipes/geminstall.rb
@@ -1,4 +1,4 @@-node.set['build_essential']['compile_time'] = true
+node.set['build-essential']['compile_time'] = true
include_recipe 'build-essential'
node['augeas']['packages'].each do |package_name|
|
Use build-essential instead of build_essential
WARN: node['build_essential'] has been changed to node['build-essential'] to match the
cookbook name and community standards. I have gracefully converted the attribute
for you, but this warning and conversion will be removed in the next major
release of the build-essential cookbook.
|
diff --git a/scripts/puma.rb b/scripts/puma.rb
index abc1234..def5678 100644
--- a/scripts/puma.rb
+++ b/scripts/puma.rb
@@ -11,5 +11,5 @@ unless ENV['DOCKERIZED']
stdout_redirect root + 'log/puma.log', root + 'log/puma.err.log', true
end
-threads 8, 32
-workers 3
+threads 4, 32
+workers 1
|
Reduce worker load per container instance
|
diff --git a/app/controllers/container_project_controller.rb b/app/controllers/container_project_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/container_project_controller.rb
+++ b/app/controllers/container_project_controller.rb
@@ -8,6 +8,7 @@ after_action :set_session_data
def show_list
+ @showtype = "main"
process_show_list(:named_scope => :active)
end
|
Fix project main page showtype
|
diff --git a/app/helpers/application_helper/toolbar/basic.rb b/app/helpers/application_helper/toolbar/basic.rb
index abc1234..def5678 100644
--- a/app/helpers/application_helper/toolbar/basic.rb
+++ b/app/helpers/application_helper/toolbar/basic.rb
@@ -1,19 +1,14 @@ class ApplicationHelper::Toolbar::Basic
include Singleton
-
+
class << self
extend Forwardable
- delegate [:model, :register, :buttons, :definition, :button_group] => :instance
+ delegate %i(button select twostate separator definition button_group) => :instance
end
attr_reader :definition
private
- def register(name)
- end
-
- def model(_class)
- end
def button_group(name, buttons)
@definition[name] = buttons
@@ -22,4 +17,29 @@ def initialize
@definition = {}
end
+
+ def button(id, icon, title, text, keys = {})
+ generic_button(:button, id, icon, title, text, keys)
+ end
+
+ def select(id, icon, title, text, keys = {})
+ generic_button(:buttonSelect, id, icon, title, text, keys)
+ end
+
+ def twostate(id, icon, title, text, keys = {})
+ generic_button(:buttonTwoState, id, icon, title, text, keys)
+ end
+
+ def generic_button(type, id, icon, title, text, keys)
+ {
+ type => id.to_s,
+ :icon => icon,
+ :title => title,
+ :text => text
+ }.merge(keys)
+ end
+
+ def separator
+ {:separator => true}
+ end
end
|
Implement a simple toolbar definition DSL.
|
diff --git a/app/services/rails_workflow/process_importer.rb b/app/services/rails_workflow/process_importer.rb
index abc1234..def5678 100644
--- a/app/services/rails_workflow/process_importer.rb
+++ b/app/services/rails_workflow/process_importer.rb
@@ -1,6 +1,9 @@ module RailsWorkflow
class ProcessImporter
def initialize json
+ if json['operations']
+ json['process_template']['operations'] = json['operations']
+ end
@json = json['process_template']
end
@@ -54,4 +57,3 @@ end
end
end
-
|
Allow for operations to be embedded alongside (instead of inside) process templates in JSON exports of a Process
|
diff --git a/lib/active_relation_tracer/active_relation_tracer.rb b/lib/active_relation_tracer/active_relation_tracer.rb
index abc1234..def5678 100644
--- a/lib/active_relation_tracer/active_relation_tracer.rb
+++ b/lib/active_relation_tracer/active_relation_tracer.rb
@@ -4,36 +4,20 @@ extend ActiveSupport::Concern
included do
- class_eval do
- name = :where
- original_method = instance_method(name)
+ [:where, :order, :limit].each do |method|
+ ActiveRelationTracer.wrap_method(self, method)
+ end
+ end
+
+ def self.wrap_method(klass, name)
+ klass.class_eval do
+ original_method = instance_method(name) # create unbound method with original
define_method(name) do |*args, &block|
trace = "Calling '#{name}' with '#{args.inspect}'"
STDERR.puts trace
- original_method.bind(self).call *args, &block
+ original_method.bind(self).call *args, &block # bind to self and call original
end
end
-
- class_eval do
- name = :order
- original_method = instance_method(name)
- define_method(name) do |*args, &block|
- trace = "Calling '#{name}' with '#{args.inspect}'"
- STDERR.puts trace
- original_method.bind(self).call *args, &block
- end
- end
-
- class_eval do
- name = :limit
- original_method = instance_method(name)
- define_method(name) do |*args, &block|
- trace = "Calling '#{name}' with '#{args.inspect}'"
- STDERR.puts trace
- original_method.bind(self).call *args, &block
- end
- end
-
end
end
|
Refactor with wrap_method module method
|
diff --git a/lib/generators/headshot/install/install_generator.rb b/lib/generators/headshot/install/install_generator.rb
index abc1234..def5678 100644
--- a/lib/generators/headshot/install/install_generator.rb
+++ b/lib/generators/headshot/install/install_generator.rb
@@ -23,6 +23,11 @@ say_status('copying', 'Copying Flash application files ...')
copy_file('swfs/headshot.swf', 'public/swfs/headshot.swf')
end
+
+ def setup_paperclip
+ say_status('registration', 'Adding paperclip to Gemfile ...')
+ gem "paperclip"
+ end
end
end
end
|
Revert "Removed registration of Paperclip."
This reverts commit 650db1e79ceb81af4db950302686c88ba29ea8d6.
|
diff --git a/lib/rdstation/error_handler/invalid_refresh_token.rb b/lib/rdstation/error_handler/invalid_refresh_token.rb
index abc1234..def5678 100644
--- a/lib/rdstation/error_handler/invalid_refresh_token.rb
+++ b/lib/rdstation/error_handler/invalid_refresh_token.rb
@@ -10,7 +10,8 @@ end
def raise_error
- return if invalid_refresh_token_error.empty?
+ return unless invalid_refresh_token_error
+
raise RDStation::Error::InvalidRefreshToken, invalid_refresh_token_error
end
|
Fix blank? method called for nil
|
diff --git a/test/controllers/rails_invitable/api/v1/user_accepted_referrals_controller_test.rb b/test/controllers/rails_invitable/api/v1/user_accepted_referrals_controller_test.rb
index abc1234..def5678 100644
--- a/test/controllers/rails_invitable/api/v1/user_accepted_referrals_controller_test.rb
+++ b/test/controllers/rails_invitable/api/v1/user_accepted_referrals_controller_test.rb
@@ -5,12 +5,7 @@ include Engine.routes.url_helpers
test "should get index" do
- get api_v1_user_accepted_referrals_index_url
- assert_response :success
- end
-
- test "should get create" do
- get api_v1_user_accepted_referrals_create_url
+ get api_v1_user_accepted_referrals_url
assert_response :success
end
|
Fix the initiatial controller test
|
diff --git a/JROFBridge.podspec b/JROFBridge.podspec
index abc1234..def5678 100644
--- a/JROFBridge.podspec
+++ b/JROFBridge.podspec
@@ -11,7 +11,7 @@ s.source = { :git => "https://github.com/jyruzicka/JROFBridge.git", :tag => s.version.to_s }
s.social_media_url = 'https://twitter.com/akchizar'
- s.osx.deployment_target = '10.9.3'
+ s.osx.deployment_target = '10.9'
s.requires_arc = true
s.source_files = 'Classes'
|
Drop deployment target to 10.9
|
diff --git a/cookbooks/sys_dns/recipes/do_set_private.rb b/cookbooks/sys_dns/recipes/do_set_private.rb
index abc1234..def5678 100644
--- a/cookbooks/sys_dns/recipes/do_set_private.rb
+++ b/cookbooks/sys_dns/recipes/do_set_private.rb
@@ -22,7 +22,7 @@ if ! node.has_key?('cloud')
private_ip = "#{local_ip}"
else
- private_ip = node['cloud']['public_ips'][0]
+ private_ip = node['cloud']['private_ips'][0]
end
log "Detected private IP: #{private_ip}"
|
Fix error on private_ip var ref.
|
diff --git a/spec/lib/i18n/core_ext_spec.rb b/spec/lib/i18n/core_ext_spec.rb
index abc1234..def5678 100644
--- a/spec/lib/i18n/core_ext_spec.rb
+++ b/spec/lib/i18n/core_ext_spec.rb
@@ -11,7 +11,7 @@ I18n.backend.instance_variable_get(:@translations)
end
- before { I18n.backend = Simple.new }
+ before { I18n.backend = I18n::Backend::Simple.new }
context 'when loading data from a yml.erb file' do
let(:filename) { 'en.yml.erb' }
|
Change Simple.new to be fully namespaced for understandability's sake
|
diff --git a/spec/unit/proxy_object_spec.rb b/spec/unit/proxy_object_spec.rb
index abc1234..def5678 100644
--- a/spec/unit/proxy_object_spec.rb
+++ b/spec/unit/proxy_object_spec.rb
@@ -37,4 +37,14 @@ it 'does not respond unknown method names' do
expect(proxy).not_to respond_to(:no_idea_what_you_want)
end
+
+ it 'forwards multiple levels down to the last target' do
+ proxy1 = Class.new { include ProxyObject.new(:arr) }
+ proxy2 = Class.new { include ProxyObject.new(:proxy1) }
+ proxy3 = Class.new { include ProxyObject.new(:proxy2) }
+
+ object = proxy3.new(proxy2.new(proxy1.new([1, 2, 3])))
+
+ expect(object.size).to be(3)
+ end
end
|
Add a test for multi-level proxying
|
diff --git a/ibge.gemspec b/ibge.gemspec
index abc1234..def5678 100644
--- a/ibge.gemspec
+++ b/ibge.gemspec
@@ -21,5 +21,5 @@ spec.add_dependency "spreadsheet", "~> 1.0"
spec.add_development_dependency "rake", "~> 13.0"
- spec.add_development_dependency "rspec", "= 3.9.0"
+ spec.add_development_dependency "rspec", "= 3.10.0"
end
|
Update rspec requirement from = 3.9.0 to = 3.10.0
Updates the requirements on [rspec](https://github.com/rspec/rspec) to permit the latest version.
- [Release notes](https://github.com/rspec/rspec/releases)
- [Commits](https://github.com/rspec/rspec/compare/v3.9.0...v3.10.0)
Signed-off-by: dependabot-preview[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com>
|
diff --git a/WiremockClient.podspec b/WiremockClient.podspec
index abc1234..def5678 100644
--- a/WiremockClient.podspec
+++ b/WiremockClient.podspec
@@ -13,6 +13,7 @@ s.source = { :git => 'https://github.com/mobileforming/WiremockClient.git', :tag => '1.2.1' }
s.ios.deployment_target = '9.0'
s.osx.deployment_target = '10.10'
+ s.swift_version = '3.0'
s.source_files = 'Sources/**/*'
end
|
Add swift version to podspec
|
diff --git a/lib/feedjira/preprocessor.rb b/lib/feedjira/preprocessor.rb
index abc1234..def5678 100644
--- a/lib/feedjira/preprocessor.rb
+++ b/lib/feedjira/preprocessor.rb
@@ -22,7 +22,7 @@ end
def raw_html(node)
- CGI.unescape_html(node.search('./div').first.inner_html) rescue ''
+ CGI.unescape_html node.search('./div').inner_html
end
def doc
|
Allow multiple div tags, should they occur.
|
diff --git a/app/services/notes/create_service.rb b/app/services/notes/create_service.rb
index abc1234..def5678 100644
--- a/app/services/notes/create_service.rb
+++ b/app/services/notes/create_service.rb
@@ -3,6 +3,7 @@ def execute
note = project.notes.new(params[:note])
note.author = current_user
+ note.system = false
note.save
note
end
|
Make sure note.system is false if created by user
Signed-off-by: Dmitriy Zaporozhets <be23d75b156792e5acab51b196a2deb155d35d6a@gmail.com>
|
diff --git a/tasks/application_generator.rb b/tasks/application_generator.rb
index abc1234..def5678 100644
--- a/tasks/application_generator.rb
+++ b/tasks/application_generator.rb
@@ -29,7 +29,7 @@
env = { 'BUNDLE_GEMFILE' => ENV['BUNDLE_GEMFILE'], 'RAILS_ENV' => rails_env }
- Bundler.with_original_env { Kernel.system(env, command) }
+ Bundler.with_original_env { abort unless Kernel.system(env, command) }
end
app_dir
|
Raise if subshell fails in application generator
|
diff --git a/oboe.gemspec b/oboe.gemspec
index abc1234..def5678 100644
--- a/oboe.gemspec
+++ b/oboe.gemspec
@@ -16,14 +16,4 @@ s.test_files = Dir.glob("{spec}/**/*.rb")
s.add_development_dependency 'rake'
s.add_development_dependency 'rspec'
-
- s.post_install_message = "
-
-This oboe gem requires updated AppNeta liboboe (>= 1.1.1) and
-tracelytics-java-agent packages (if using JRuby). Make sure to update all
-of your hosts or this gem will just sit in the corner and weep quietly.
-
-- Your Friendly AppNeta TraceView Team
-
-"
end
|
Remove the gem post install message.
|
diff --git a/app/models/line.rb b/app/models/line.rb
index abc1234..def5678 100644
--- a/app/models/line.rb
+++ b/app/models/line.rb
@@ -4,26 +4,18 @@
validates :person, :body, presence: true
- MESSAGE_PATTERNS = [
- /<\s*([^>]+)\s*>\s*(.*)$/,
- /([^:]+):\s*(.*)$/
- ]
-
- ACTION_PATTERNS = [
- /\*\s+([^\s]+)\s*(.*)$/
+ PATTERNS = [
+ [ /<\s*([^>]+)\s*>\s*(.*)$/, false ],
+ [ /\*\s+([^\s]+)\s*(.*)$/, true ],
+ [ /([^:]+):\s*(.*)$/, false ],
]
def self.from_raw_line(raw_line)
- MESSAGE_PATTERNS.each do |pattern|
- if raw_line =~ pattern
+ PATTERNS.each do |pattern|
+ regex, action = pattern
+ if raw_line =~ regex
person = Person.find_or_create_by_name($1)
- return Line.new(person: person, body: $2)
- end
- end
- ACTION_PATTERNS.each do |pattern|
- if raw_line =~ pattern
- person = Person.find_or_create_by_name($1)
- return Line.new(person: person, body: $2, action: true)
+ return Line.new(person: person, body: $2, action: action)
end
end
end
|
Fix the message pattern matching order.
|
diff --git a/app/models/team.rb b/app/models/team.rb
index abc1234..def5678 100644
--- a/app/models/team.rb
+++ b/app/models/team.rb
@@ -20,11 +20,12 @@ users.include?(user)
end
- # Add a user to the class.
+ # Add a user to the team.
def enroll(user)
self.users << user
end
+ # Remove the user from the team.
def unenroll(user)
self.users.delete(user)
end
|
Add a comment explaining the method
|
diff --git a/app/models/user.rb b/app/models/user.rb
index abc1234..def5678 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -1,4 +1,7 @@ class User < ActiveRecord::Base
+ extend FriendlyId
+ friendly_id :email, :use => [ :slugged, :history ]
+
devise :async, :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable,
:confirmable, :lockable, :validatable, :timeoutable
@@ -33,6 +36,10 @@
private
+ def should_generate_new_friendly_id?
+ true
+ end
+
def create_club
club = self.clubs.new
club.assign_defaults
|
Update User Model for FriendlyId Slug
Update the User model to use the email address as the FriendlyId Slug.
|
diff --git a/app/models/user.rb b/app/models/user.rb
index abc1234..def5678 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -2,10 +2,11 @@ has_secure_password
validates :username, :email, presence: true
validates :email, uniqueness: true
+ validates_format_of :email, :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i, :on => :create
has_many :questions
has_many :answers
has_many :votes
has_many :comments
-
+
end
|
Add validation to put a format constraint on email attribute in User class
|
diff --git a/app/controllers/schools_controller.rb b/app/controllers/schools_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/schools_controller.rb
+++ b/app/controllers/schools_controller.rb
@@ -1,7 +1,5 @@ class SchoolsController < ApplicationController
- # skip_before_action :verify_authenticity_token
def index
- # gon.schools = School.all
@schools = School.all
@geojson = Array.new
@schools.each do |school|
@@ -14,6 +12,16 @@ properties: {
name: school.school_name,
address: school.primary_address_line_1,
+ zip: school.zip,
+ boro: school.boro,
+ type: school.school_type,
+ total_students: school.total_students,
+ program_highlights: school.program_highlights,
+ overview_paragraph: school.overview_paragraph,
+ website: school.website,
+ dbn: school.dbn,
+ grade_span_min: school.grade_span_min,
+ grade_span_max: school.grade_span_max,
:'marker-color' => '#00607d',
:'marker-symbol' => 'circle',
:'marker-size' => 'medium'
|
Add additional properties to school so can be used for map
|
diff --git a/app/helpers/admin/resources_helper.rb b/app/helpers/admin/resources_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/admin/resources_helper.rb
+++ b/app/helpers/admin/resources_helper.rb
@@ -17,9 +17,7 @@
admin_user.application(app_name).each do |resource|
klass = resource.constantize
- if (new_link = sidebar_add_new(klass))
- resources[resource] = [new_link]
- end
+ resources[resource] = [sidebar_add_new(klass)].compact
end
render "helpers/admin/resources/sidebar", :resources => resources
|
Revert "Do not use compact" because sidebar was dissapearing.
This reverts commit c921747c11deb3fbe6c69025a7952e5ecf00961d.
|
diff --git a/app/models/spree/product_decorator.rb b/app/models/spree/product_decorator.rb
index abc1234..def5678 100644
--- a/app/models/spree/product_decorator.rb
+++ b/app/models/spree/product_decorator.rb
@@ -18,5 +18,9 @@ end
end
end
+
+ def sale_off?
+ !(sale_date.nil? || sale_date.future?) && sale_rate.to_f > 0
+ end
end
-end+end
|
Add sale off to product scope
|
diff --git a/test/test_simplecov-console.rb b/test/test_simplecov-console.rb
index abc1234..def5678 100644
--- a/test/test_simplecov-console.rb
+++ b/test/test_simplecov-console.rb
@@ -2,7 +2,17 @@
class TestSimplecovConsole < MiniTest::Test
- Source = Struct.new(:line_number)
+ # mock for SimpleCov::SourceFile::Line
+ Line = Struct.new(:line_number)
+
+ # mock for SimpleCov::SourceFile
+ SourceFile = Struct.new(
+ :filename,
+ :lines_of_code,
+ :covered_lines,
+ :missed_lines,
+ :covered_percent
+ )
def setup
@console = SimpleCov::Formatter::Console.new
@@ -14,9 +24,29 @@ end
def test_missed
- missed_lines = [Source.new(1), Source.new(2),
- Source.new(3), Source.new(5)]
+ missed_lines = [Line.new(1), Line.new(2),
+ Line.new(3), Line.new(5)]
expected_result = ["1-3", "5"]
assert_equal @console.missed(missed_lines), expected_result
end
+
+ def test_table_output
+ SimpleCov::Formatter::Console.output_style = 'table'
+ files = [
+ SourceFile.new('foo.rb',5,[2,3],[Line.new(1), Line.new(4), Line.new(5)],40.0)
+ ]
+ actual = @console.table_output(files,'/')
+ assert actual.is_a? Terminal::Table
+ assert_equal 1, actual.rows.count
+ end
+
+ def test_block_output
+ SimpleCov::Formatter::Console.use_colors = false
+ SimpleCov::Formatter::Console.output_style = 'block'
+ files = [
+ SourceFile.new('foo.rb',5,[2,3],[Line.new(1), Line.new(4), Line.new(5)],40.0)
+ ]
+ expected = "\n file: foo.rb\ncoverage: 40.00% (2/5 lines)\n missed: 1, 4-5"
+ assert_equal expected, @console.block_output(files,'/')
+ end
end
|
Add tests for 'table_output', 'block_output' methods
|
diff --git a/IssueReporter.podspec b/IssueReporter.podspec
index abc1234..def5678 100644
--- a/IssueReporter.podspec
+++ b/IssueReporter.podspec
@@ -18,6 +18,4 @@ s.resource_bundles = {
'IssueReporterResources' => ['Pod/Assets/*.{png,strings,storyboard}']
}
-
- s.public_header_files = 'Pod/Classes/**/*.h'
end
|
Remove public header files specifier as we do not have any header files any more.
|
diff --git a/fpm-cookery.gemspec b/fpm-cookery.gemspec
index abc1234..def5678 100644
--- a/fpm-cookery.gemspec
+++ b/fpm-cookery.gemspec
@@ -20,7 +20,7 @@
s.add_development_dependency "minitest", "~> 5.0"
s.add_development_dependency "rake"
- s.add_runtime_dependency "fpm", "~> 0.4"
+ s.add_runtime_dependency "fpm", "~> 1.0.0"
s.add_runtime_dependency "facter"
s.add_runtime_dependency "puppet"
s.add_runtime_dependency "addressable"
|
Add support for FPM 1.0.x
|
diff --git a/calculators/bsa/bsa.rb b/calculators/bsa/bsa.rb
index abc1234..def5678 100644
--- a/calculators/bsa/bsa.rb
+++ b/calculators/bsa/bsa.rb
@@ -1,11 +1,9 @@ name :bsa
+require_helpers :get_field_as_float
execute do
- raise FieldError.new("weight", "weight must be a number") if !field_weight.is_float?
- raise FieldError.new("height", "height must be a number") if !field_height.is_float?
-
- weight = field_weight.to_f
- height = field_height.to_f
+ weight = get_field_as_float :weight
+ height = get_field_as_float :height
raise FieldError.new("weight", "weight must be greater than zero") if weight <= 0
raise FieldError.new("height", "height must be greater than zero") if height <= 0
|
Use helper methods for converting fields to floats
|
diff --git a/0_code_wars/terminal_game_2.rb b/0_code_wars/terminal_game_2.rb
index abc1234..def5678 100644
--- a/0_code_wars/terminal_game_2.rb
+++ b/0_code_wars/terminal_game_2.rb
@@ -0,0 +1,32 @@+# http://www.codewars.com/kata/55e8beb4e8fc5b7697000036/
+# --- iteration 1 ---
+class Hero
+ def initialize
+ @position = [0, 0]
+ end
+
+ def move(dir)
+ case dir
+ when "up"
+ y_coord == 0 ? fail : @position[0] -= 1
+ when "down"
+ y_coord == 4 ? fail : @position[0] += 1
+ when "left"
+ x_coord == 0 ? fail : @position[1] -= 1
+ when "right"
+ x_coord == 4 ? fail : @position[1] += 1
+ end
+ end
+
+ def position
+ @position.join
+ end
+
+ def y_coord
+ @position[0]
+ end
+
+ def x_coord
+ @position[1]
+ end
+end
|
Add code wars (7) terminal game 2
|
diff --git a/webhook-receiver-SUSE_Cloud.rb b/webhook-receiver-SUSE_Cloud.rb
index abc1234..def5678 100644
--- a/webhook-receiver-SUSE_Cloud.rb
+++ b/webhook-receiver-SUSE_Cloud.rb
@@ -0,0 +1,79 @@+#!/usr/bin/ruby
+#
+# Simple Sinatra (http://www.sinatrarb.com) script that handles Webhooks
+# notification from SUSE Studio (both Online and Onsite versions).
+#
+# Listens for 'build_finished' notifications with the 'kvm' image type, and
+# automatically imports it to your SUSE Cloud or OpenStack instance.
+#
+# See README.md for details.
+#
+# Author: James Tan <jatan@suse.com>
+
+require 'rubygems'
+require 'sinatra'
+require 'json'
+
+configure do
+ enable :logging
+end
+
+before do
+ env['rack.logger'] = Logger.new('webhooks.log')
+end
+
+helpers do
+ def import_image(name, url)
+ task = Thread.new do
+ command = <<-EOS.gsub(/^\s+/, ' ').gsub(/\n/, '')
+ glance image-create
+ --name="#{name}" --is-public=True --disk-format=qcow2
+ --container-format=bare --copy-from "#{url}" 2>&1
+ EOS
+ logger.info "Running command: #{command}"
+ output = `#{command}`
+ logger.info "Output:\n#{output}"
+ if $?.success?
+ logger.info "Import succeeded"
+ else
+ logger.error "Import failed"
+ end
+ end
+ end
+
+ def die(message)
+ logger.error "Bad request (400): #{message}"
+ halt 400, "Error: #{message}\n"
+ end
+
+ def skip(message)
+ logger.info "#{message}"
+ halt "#{message}\n"
+ end
+end
+
+post '/' do
+ logger.info "Processing request #{params.inspect}"
+
+ payload = params[:payload]
+ event = payload[:event]
+ die "Missing '[payload][event]'" if event.nil?
+
+ if event == 'build_finished'
+ image_type = payload[:build][:image_type]
+ die "Missing '[payload][build][image_type]" if image_type.nil?
+
+ if image_type == 'kvm'
+ name = payload[:name]
+ url = payload[:build][:download_url]
+ die "Missing '[payload][name]'" if name.nil?
+ die "Missing '[payload][build][download_url]'" if url.nil?
+
+ import_image(name, url)
+ else
+ skip "Ignored image type '#{image_type}'"
+ end
+ else
+ skip "Ignored event type '#{event}'"
+ end
+end
|
Add first version of the SUSE Cloud / OpenStack webhook receiver
|
diff --git a/config/initializers/ar_native_database_types.rb b/config/initializers/ar_native_database_types.rb
index abc1234..def5678 100644
--- a/config/initializers/ar_native_database_types.rb
+++ b/config/initializers/ar_native_database_types.rb
@@ -0,0 +1,11 @@+require 'active_record/connection_adapters/abstract_mysql_adapter'
+
+module ActiveRecord
+ module ConnectionAdapters
+ class AbstractMysqlAdapter
+ NATIVE_DATABASE_TYPES.merge!(
+ bigserial: { name: 'bigint(20) auto_increment PRIMARY KEY' }
+ )
+ end
+ end
+end
|
Add bigserial as a native database type for MySQL adapter
|
diff --git a/lib/arena/connectable.rb b/lib/arena/connectable.rb
index abc1234..def5678 100644
--- a/lib/arena/connectable.rb
+++ b/lib/arena/connectable.rb
@@ -0,0 +1,57 @@+require 'time'
+
+module Arena
+ module Connectable
+
+ %w(position selected connection_id).each do |method|
+ define_method method do
+ instance_variable_set("@#{method}", @attrs[method]) unless instance_variable_get "@#{method}"
+ instance_variable_get "@#{method}"
+ end
+ end
+
+ %w(image text link media attachment channel).each do |kind|
+ define_method "is_#{kind}?" do
+ _class == kind.to_s.capitalize
+ end
+ end
+
+ # Detect optional portions of the response
+ %w(image attachment embed).each do |kind|
+ define_method "has_#{kind}?" do
+ !@attrs[kind.to_s].nil?
+ end
+ end
+
+ def is_block?
+ _base_class == "Block"
+ end
+
+ def connections
+ @connections ||= @attrs['connections'].try(:collect) { |channel| Arena::Channel.new(channel) }
+ end
+
+ def connected_at
+ @connected_at ||= Time.parse(@attrs['connected_at']) if connected?
+ end
+
+ def connected_by_different_user?
+ user.id != connected_by.id
+ end
+
+ def connected_by
+ @connected_by ||= Arena::User.new({
+ 'id' => @attrs['connected_by_user_id'],
+ 'username' => @attrs['connected_by_username'],
+ 'full_name' => @attrs['connected_by_username']
+ })
+ end
+
+ private
+
+ def connected?
+ !@attrs['connected_at'].nil?
+ end
+
+ end
+end
|
Fix typo for :has_embed? method
|
diff --git a/lib/tinytable.rb b/lib/tinytable.rb
index abc1234..def5678 100644
--- a/lib/tinytable.rb
+++ b/lib/tinytable.rb
@@ -1,7 +1,7 @@-require "tinytable/version"
-require "tinytable/table"
-require "tinytable/text_formatter"
-require "tinytable/layout"
+require 'tinytable/version'
+require 'tinytable/table'
+require 'tinytable/text_formatter'
+require 'tinytable/layout'
module TinyTable
def self.new(*args)
|
Use single instead of double quotes for require paths
|
diff --git a/import/get_object.rb b/import/get_object.rb
index abc1234..def5678 100644
--- a/import/get_object.rb
+++ b/import/get_object.rb
@@ -20,7 +20,13 @@ rescue OpenURI::HTTPError
return nil
end
- return JSON.parse(object.read, :symbolize_names => true)
+
+ begin
+ hash = JSON.parse(object.read, :symbolize_names => true)
+ rescue NoMethodError
+ raise Parallel::Break
+ end
+ return hash
end
# Fix up the raw hash provided by the V&A
|
Break if the site begins returning bad data
|
diff --git a/models/helper.rb b/models/helper.rb
index abc1234..def5678 100644
--- a/models/helper.rb
+++ b/models/helper.rb
@@ -15,7 +15,9 @@ def self.available request=nil, limit=5
request_id = request.present? ? request.id : nil
contacted_helpers = HelperRequest.where(:request_id => request_id).fields(:helper_id).all.collect(&:helper_id)
+ logged_users = Token.where(:expiry_time.gt => Time.now).fields(:user_id).all.collect(&:user_id)
Helper.where(:id.nin => contacted_helpers,
+ :id.in => logged_users,
"$or" => [
{:available_from => nil},
{:available_from.lt => Time.now.utc}
|
Select only users that have a valid login token
|
diff --git a/yahoo.gemspec b/yahoo.gemspec
index abc1234..def5678 100644
--- a/yahoo.gemspec
+++ b/yahoo.gemspec
@@ -0,0 +1,38 @@+# -*- encoding: utf-8 -*-
+
+Gem::Specification.new do |s|
+ s.name = %q{yahoo}
+ s.version = "2.0.0"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.authors = ["Eric Hodel", "David N. Welton"]
+ s.cert_chain = nil
+ s.date = %q{2010-1-12}
+ s.description = %q{This library makes it easy to implement Yahoo's web services APIs.}
+ s.email = %q{davidw@dedasys.com}
+ s.files = ["History.txt", "LICENSE.txt", "Manifest.txt", "README.txt", "Rakefile", "lib/yahoo.rb", "test/test_yahoo.rb"]
+ s.homepage = %q{http://github.com/davidw/yahoo-gem}
+ s.require_paths = ["lib"]
+ s.required_ruby_version = Gem::Requirement.new("> 0.0.0")
+ s.rubyforge_project = %q{rctools}
+ s.rubygems_version = %q{1.3.5}
+ s.summary = %q{Base for Yahoo web services}
+ s.test_files = ["test/test_yahoo.rb"]
+
+ if s.respond_to? :specification_version then
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
+ s.specification_version = 1
+
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
+ s.add_runtime_dependency(%q<hoe>, [">= 1.1.4"])
+ s.add_runtime_dependency(%q<rc-rest>, [">= 3.0.0"])
+ else
+ s.add_dependency(%q<hoe>, [">= 1.1.4"])
+ s.add_dependency(%q<rc-rest>, [">= 3.0.0"])
+ end
+ else
+ s.add_dependency(%q<hoe>, [">= 1.1.4"])
+ s.add_dependency(%q<rc-rest>, [">= 3.0.0"])
+ end
+end
+
|
Put the gemspec under revision control.
|
diff --git a/lib/liner/inspectable.rb b/lib/liner/inspectable.rb
index abc1234..def5678 100644
--- a/lib/liner/inspectable.rb
+++ b/lib/liner/inspectable.rb
@@ -4,9 +4,16 @@ # @return [String]
# @api public
def inspect
- attribute_string = liner.map{|k,v| "#{k}=#{v.inspect}"}.join(', ')
"#<#{self.class} #{attribute_string}>"
end
alias :to_s :inspect
+
+ # List all the liner attributes as a string, used for inspection.
+ # @return [String]
+ # @api private
+ def attribute_string
+ liner.map { |k,v| "#{k}=#{v.inspect}" }.join(', ')
+ end
+ private :attribute_string
end
end
|
Move attribute string into it's own method.
|
diff --git a/config/schedule.rb b/config/schedule.rb
index abc1234..def5678 100644
--- a/config/schedule.rb
+++ b/config/schedule.rb
@@ -19,7 +19,7 @@
# Learn more: http://github.com/javan/whenever
-every :weekday, at: '8:00 am' do
+every :weekday, at: '9:30 am' do
runner 'DailyMenu.gather'
end
|
Gather daily menu data at 9:30
|
diff --git a/SRMModalViewController.podspec b/SRMModalViewController.podspec
index abc1234..def5678 100644
--- a/SRMModalViewController.podspec
+++ b/SRMModalViewController.podspec
@@ -1,12 +1,12 @@ Pod::Spec.new do |s|
s.name = "SRMModalViewController"
- s.version = "0.0.2.1"
+ s.version = "0.0.2.2"
s.summary = "SRMModalViewController support a easy way to display a view with modal style."
s.description = "SRMModalViewController support a easy way to display a view with modal style.You will love it."
s.homepage = "https://github.com/SongRanMark/SRMModalViewController"
s.license = { :type => "MIT", :file => "LICENSE" }
- s.author = "SongRanMark"
+ s.author = "SongRanMark"
s.platform = :ios, "7.0"
s.source = { :git => "https://github.com/SongRanMark/SRMModalViewController.git", :tag => "v#{s.version}" }
s.source_files = "*.{h,m}"
|
Update .podspec file for version 0.0.2.2
|
diff --git a/Casks/fourk-video-downloader.rb b/Casks/fourk-video-downloader.rb
index abc1234..def5678 100644
--- a/Casks/fourk-video-downloader.rb
+++ b/Casks/fourk-video-downloader.rb
@@ -0,0 +1,7 @@+class FourkVideoDownloader < Cask
+ url 'http://4kdownload.googlecode.com/files/4kvideodownloader_2.8.dmg'
+ homepage 'http://www.4kdownload.com/products/product-videodownloader'
+ version '2.8'
+ sha1 'f0e78400574b9291ed8ad271d51d231d2d9f3e11'
+ link '4K Video Downloader.app'
+end
|
Add 4K Video Downloader cask
|
diff --git a/Snaps.podspec b/Snaps.podspec
index abc1234..def5678 100644
--- a/Snaps.podspec
+++ b/Snaps.podspec
@@ -4,7 +4,7 @@ s.description = <<-DESC
Snaps combines [Dials](https://github.com/aleffert/dials) and [SnapKit](https://github.com/SnapKit/SnapKit) to let you make changes to your autolayout constraints at runtime and then send them back to your code with just one button.
DESC
- s.summary = "Snaps combines [Dials](https://github.com/aleffert/dials) and [SnapKit](https://github.com/SnapKit/SnapKit) to let you make changes to your autolayout constraints at runtime and then send them back to your code."
+ s.summary = "Snaps lets you make changes to your autolayout constraints at runtime and then send them back to your code."
s.homepage = "https://github.com/aleffert/snaps"
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { "Akiva Leffert" => "aleffert@gmail.com" }
|
Tweak summary to pass linter
|
diff --git a/app/admin/source_suggestion.rb b/app/admin/source_suggestion.rb
index abc1234..def5678 100644
--- a/app/admin/source_suggestion.rb
+++ b/app/admin/source_suggestion.rb
@@ -0,0 +1,57 @@+ActiveAdmin.register SourceSuggestion do
+ permit_params :source_id, :user_id, :gene_name, :disease_name, :variant_name, :initial_comment, :status
+
+ filter :gene_name
+ filter :disease_name
+ filter :variant_name
+ filter :initial_comment
+ filter :status, as: :select, collection: ['new', 'curated', 'rejected']
+ filter :user
+ filter :source
+
+ controller do
+ def scoped_collection
+ resource_class.includes(:source, :user)
+ end
+ end
+
+ form do |f|
+ f.semantic_errors(*f.object.errors.keys)
+ f.inputs do
+ f.input :source
+ f.input :disease_name
+ f.input :variant_name
+ f.input :gene_name
+ f.input :initial_comment
+ f.input :status, as: :select, collection: ['new', 'curated', 'rejected']
+ f.input :user
+ end
+ f.actions
+ end
+
+ index do
+ selectable_column
+ column :source
+ column :gene_name
+ column :variant_name
+ column :disease_name
+ column :status
+ column :updated_at
+ column :created_at
+ actions
+ end
+
+ show do
+ attributes_table do
+ row :source
+ row :gene_name
+ row :variant_name
+ row :disease_name
+ row :status
+ row :user
+ row :updated_at
+ row :created_at
+ end
+ end
+
+end
|
Add SourceSuggestions tab to admin interface
Closes #266
|
diff --git a/app/helpers/editable_helper.rb b/app/helpers/editable_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/editable_helper.rb
+++ b/app/helpers/editable_helper.rb
@@ -2,7 +2,7 @@ def editable(object, attribute, options = {})
object_name = ActiveModel::Naming.singular(object)
- if options[:value].present?
+ if !options[:value].nil?
value = options[:value]
else
value = object.send(attribute)
|
Allow value to be set to blank
|
diff --git a/app/helpers/tiny_mce_helper.rb b/app/helpers/tiny_mce_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/tiny_mce_helper.rb
+++ b/app/helpers/tiny_mce_helper.rb
@@ -15,7 +15,7 @@ theme_advanced_resizing : true,
theme_advanced_resizing_use_cookie : true,
theme_advanced_toolbar_location : 'top',
- theme_advanced_buttons1 : 'bold,italic,underline,|,sup,sub,|,bullist,numlist,|,link,image,|,pastetext,pasteword,selectall|justifyleft,justifycenter,justifyright',
+ theme_advanced_buttons1 : 'bold,italic,underline,|,sup,sub,|,bullist,numlist,|,link,image,|,pastetext,pasteword,selectall,|,justifyleft,justifycenter,justifyright',
theme_advanced_buttons2 : '',
theme_advanced_buttons3 : '',
paste_auto_cleanup_on_paste : true,
|
Fix justification to justify-left and select all show up.
|
diff --git a/spec/support/login.rb b/spec/support/login.rb
index abc1234..def5678 100644
--- a/spec/support/login.rb
+++ b/spec/support/login.rb
@@ -6,7 +6,7 @@ end
def current_user
- Person.where(email: 'test.user@digital.moj.gov.uk').first
+ Peoplefinder::Person.where(email: 'test.user@digital.moj.gov.uk').first
end
def omni_auth_log_in_as(email)
|
Use Peoplefinder namespace for mock logged in user
|
diff --git a/clamp.gemspec b/clamp.gemspec
index abc1234..def5678 100644
--- a/clamp.gemspec
+++ b/clamp.gemspec
@@ -8,7 +8,7 @@ s.platform = Gem::Platform::RUBY
s.authors = ["Mike Williams"]
s.email = "mdub@dogbiscuit.org"
- s.homepage = "http://github.com/mdub/clamp"
+ s.homepage = "https://github.com/mdub/clamp"
s.license = "MIT"
|
Use HTTPS in the website gemspec
|
diff --git a/ApplePayStubs.podspec b/ApplePayStubs.podspec
index abc1234..def5678 100644
--- a/ApplePayStubs.podspec
+++ b/ApplePayStubs.podspec
@@ -8,7 +8,7 @@ s.homepage = "https://github.com/stripe/ApplePayStubs"
s.license = { :type => "MIT", :file => "LICENSE.txt" }
s.author = { "Stripe" => "support+github@stripe.com" }
- s.platform = :ios, "7.0"
+ s.platform = :ios, "6.0"
s.source = { :git => "https://github.com/stripe/ApplePayStubs.git", :tag => "v#{s.version}" }
s.source_files = "Classes", "Classes/**/*.{h,m}"
s.resources = "Classes/**/*.xib"
|
Make the podspec only require iOS 6.0.
|
diff --git a/MagicalRecord.podspec b/MagicalRecord.podspec
index abc1234..def5678 100644
--- a/MagicalRecord.podspec
+++ b/MagicalRecord.podspec
@@ -1,11 +1,11 @@ Pod::Spec.new do |s|
s.name = 'MagicalRecord'
- s.version = '2.2'
+ s.version = '2.3.0-beta.1'
s.license = 'MIT'
s.summary = 'Super Awesome Easy Fetching for Core Data 1!!!11!!!!1!.'
s.homepage = 'http://github.com/magicalpanda/MagicalRecord'
s.author = { 'Saul Mora' => 'saul@magicalpanda.com' }
- s.source = { :git => 'https://github.com/magicalpanda/MagicalRecord.git',:branch=>'develop', :tag => '2.2' }
+ s.source = { :git => 'https://github.com/magicalpanda/MagicalRecord.git', :tag => "v#{s.version}" }
s.description = 'Handy fetching, threading and data import helpers to make Core Data a little easier to use.'
s.source_files = 'MagicalRecord/**/*.{h,m}'
s.framework = 'CoreData'
|
Update podspec for MR 2.3.0-beta.1
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.