diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
---|---|
diff --git a/lib/provisioner/worker/plugins/automators/chef_solo_automator/resources/cookbooks/coopr_hosts/recipes/default.rb b/lib/provisioner/worker/plugins/automators/chef_solo_automator/resources/cookbooks/coopr_hosts/recipes/default.rb
index abc1234..def5678 100644
--- a/lib/provisioner/worker/plugins/automators/chef_solo_automator/resources/cookbooks/coopr_hosts/recipes/default.rb
+++ b/lib/provisioner/worker/plugins/automators/chef_solo_automator/resources/cookbooks/coopr_hosts/recipes/default.rb
@@ -16,6 +16,9 @@ # See the License for the specific language governing permissions and
# limitations under the License.
#
+
+# The hostsfile cookbook has a default level of 60 for IPv4 addresses...
+# see: https://github.com/customink-webops/hostsfile/blob/v2.4.2/libraries/entry.rb#L158
START = 60
node['coopr']['cluster']['nodes'].each do |n, v|
short_host = v.hostname.split('.').first
|
Comment to make it clear why we picked START
|
diff --git a/core/spec/lib/refinery/activity_spec.rb b/core/spec/lib/refinery/activity_spec.rb
index abc1234..def5678 100644
--- a/core/spec/lib/refinery/activity_spec.rb
+++ b/core/spec/lib/refinery/activity_spec.rb
@@ -2,43 +2,44 @@
describe Refinery::Activity do
before do
- module Y
+ module X
module Y
class Z
end
end
end
- @activity = Refinery::Activity.new(:class_name => "Y::Y::Z")
end
+
+ let(:activity) { Refinery::Activity.new(:class_name => "X::Y::Z") }
describe "#base_class_name" do
it "should return the base class name, less module nesting" do
- @activity.base_class_name.should == "Z"
+ activity.base_class_name.should == "Z"
end
end
describe "#klass" do
it "returns class constant" do
- @activity.klass.should == Y::Y::Z
+ activity.klass.should == X::Y::Z
end
end
describe "#url_prefix" do
it "returns edit_ by default" do
- @activity.url_prefix.should == "edit_"
+ activity.url_prefix.should == "edit_"
end
it "returns user specified prefix" do
- @activity.url_prefix = "testy"
- @activity.url_prefix.should == "testy_"
- @activity.url_prefix = "testy_"
- @activity.url_prefix.should == "testy_"
+ activity.url_prefix = "testy"
+ activity.url_prefix.should == "testy_"
+ activity.url_prefix = "testy_"
+ activity.url_prefix.should == "testy_"
end
end
describe "#url" do
it "should return the url" do
- @activity.url.should == "edit_refinery_admin_z_path"
+ activity.url.should == "edit_refinery_admin_z_path"
end
end
end
|
Use let instead of instance variable and rename namespaced dummy class to X::Y::Z.
|
diff --git a/Framezilla.podspec b/Framezilla.podspec
index abc1234..def5678 100644
--- a/Framezilla.podspec
+++ b/Framezilla.podspec
@@ -1,6 +1,6 @@ Pod::Spec.new do |spec|
spec.name = "Framezilla"
- spec.version = "2.7.0"
+ spec.version = "2.8.0"
spec.summary = "Comfortable syntax for working with frames."
spec.homepage = "https://github.com/Otbivnoe/Framezilla"
|
Change the podspec version -> 2.8.0
|
diff --git a/worker/lib/redis_queue.rb b/worker/lib/redis_queue.rb
index abc1234..def5678 100644
--- a/worker/lib/redis_queue.rb
+++ b/worker/lib/redis_queue.rb
@@ -9,22 +9,12 @@
def poll(&block)
loop do
- if queue_size > 0
- message = @redis.rpop("smartchat-queue")
- block.call(RedisMessage.new(message))
- end
-
- sleep 1
+ _, message = @redis.brpop("smartchat-queue")
+ block.call(RedisMessage.new(message))
end
end
def send_message(message_json)
@redis.lpush("smartchat-queue", message_json)
end
-
- private
-
- def queue_size
- @redis.llen("smartchat-queue")
- end
end
|
Use Redis' BRPOP to block when poping
Removes the need to sleep
|
diff --git a/app/models/invoice.rb b/app/models/invoice.rb
index abc1234..def5678 100644
--- a/app/models/invoice.rb
+++ b/app/models/invoice.rb
@@ -22,46 +22,7 @@
# Bookings
# ========
- def direct_account
- nil
- end
-
- def direct_account
- self.class.direct_account
- end
-
- has_many :bookings, :as => :reference, :dependent => :destroy do
- # TODO: duplicated in Booking (without parameter)
- def direct_balance(value_date = nil, direct_account = nil)
- return BigDecimal.new('0') unless proxy_owner.direct_account
-
- direct_account ||= proxy_owner.direct_account
- balance = BigDecimal.new('0')
-
- direct_bookings = scoped
- direct_bookings = direct_bookings.where("value_date <= ?", value_date) if value_date
-
- for booking in direct_bookings.all
- balance += booking.accounted_amount(direct_account)
- end
-
- balance
- end
- end
-
- def build_booking
- booking_template = BookingTemplate.find_by_code(self.class.to_s.underscore + ':invoice')
-
- booking = booking_template.build_booking(:value_date => value_date, :amount => amount)
- bookings << booking
-
- booking
- end
-
- # TODO: called due_amount in CyDoc
- def balance(value_date = nil)
- bookings.direct_balance(value_date)
- end
+ include HasAccounts::Model
# Helpers
def to_s
|
Use HasAccounts::Model concern for Invoice.
|
diff --git a/app/decorators/manageiq/providers/ansible_tower/automation_manager/configuration_script_decorator.rb b/app/decorators/manageiq/providers/ansible_tower/automation_manager/configuration_script_decorator.rb
index abc1234..def5678 100644
--- a/app/decorators/manageiq/providers/ansible_tower/automation_manager/configuration_script_decorator.rb
+++ b/app/decorators/manageiq/providers/ansible_tower/automation_manager/configuration_script_decorator.rb
@@ -3,9 +3,5 @@ def self.fonticon
'pficon pficon-template'
end
-
- def self.fileicon
- '100/configuration_script.png'
- end
end
end
|
Drop fileicon for configuration script decorator
|
diff --git a/lib/awestruct/blueclothable.rb b/lib/awestruct/blueclothable.rb
index abc1234..def5678 100644
--- a/lib/awestruct/blueclothable.rb
+++ b/lib/awestruct/blueclothable.rb
@@ -6,7 +6,7 @@ def render(context)
rendered = ''
begin
- doc = BlueCloth.new( context.interpolate_string( raw_page_content ) )
+ doc = BlueCloth.new( context.interpolate_string( raw_page_content ), :smartypants => true )
rendered = doc.to_html
rescue => e
puts e
|
Use smartypants - enables en, em dashes.
|
diff --git a/activesupport/lib/active_support/fork_tracker.rb b/activesupport/lib/active_support/fork_tracker.rb
index abc1234..def5678 100644
--- a/activesupport/lib/active_support/fork_tracker.rb
+++ b/activesupport/lib/active_support/fork_tracker.rb
@@ -20,11 +20,7 @@
module CoreExtPrivate
include CoreExt
-
- private
- def fork(...)
- super
- end
+ private :fork
end
@pid = Process.pid
|
Revert "Fix ForkTracker on ruby <= 2.5.3"
This reverts commit 332a2909d417fdc0f42ab7672a3cd0aaaf8752d6.
|
diff --git a/spec/debian/hostname_spec.rb b/spec/debian/hostname_spec.rb
index abc1234..def5678 100644
--- a/spec/debian/hostname_spec.rb
+++ b/spec/debian/hostname_spec.rb
@@ -5,3 +5,6 @@ it { should_not return_stdout 'debian-7' }
end
+describe command('hostname') do
+ it { should_not return_stdout 'bad' }
+end
|
Check odd hostname error that happens during image creation
|
diff --git a/spec/browserstack_helper.rb b/spec/browserstack_helper.rb
index abc1234..def5678 100644
--- a/spec/browserstack_helper.rb
+++ b/spec/browserstack_helper.rb
@@ -1,39 +1,40 @@ require 'rails_helper'
-require 'selenium/webdriver'
-ENV['SMTP_SENDER'] = '[email protected]'
-
-if username = ENV['BS_USERNAME']
- password = ENV['BS_PASSWORD']
+if ENV.key?('BS_BROWSER')
+ require 'selenium/webdriver'
+ ENV['SMTP_SENDER'] = '[email protected]'
+ username = ENV.fetch('BS_USERNAME')
+ password = ENV.fetch('BS_PASSWORD')
Capybara.register_driver :browserstack do |app|
- cap = if ENV['BS_BROWSER']
- JSON.parse(ENV['BS_BROWSER'])
- else
- Selenium::WebDriver::Remote::Capabilities.firefox
+ capabilities = JSON.parse(ENV.fetch('BS_BROWSER'))
+
+ ['device', 'browser_version'].each do |key|
+ capabilities.delete(key) unless capabilities[key]
end
- ['device', 'browser_version'].each do |key|
- cap.delete(key) if cap[key].nil? && cap.is_a?(Hash)
- end
+ capabilities['project'] = 'PVBE'
+ capabilities['build'] = `git rev-parse HEAD`
- cap['project'] = 'PVBE'
- cap['build'] = `git rev-parse HEAD`
+ capabilities['browserstack.debug'] = true
+ capabilities['browserstack.tunnel'] = true
+ capabilities['acceptSslCerts'] = true
- cap['browserstack.debug'] = true
- cap['browserstack.tunnel'] = true
- cap['acceptSslCerts'] = true
-
- Capybara::Selenium::Driver.new(app, browser: :remote, url: "https://#{username}:#{password}@hub.browserstack.com/wd/hub", desired_capabilities: cap)
+ Capybara::Selenium::Driver.new(
+ app,
+ browser: :remote,
+ url: "https://#{username}:#{password}@hub.browserstack.com/wd/hub",
+ desired_capabilities: capabilities
+ )
end
-
+
Capybara.default_driver = :browserstack
Capybara.app_host = 'http://localhost:3000'
Capybara.run_server = false
else
- Capybara.register_driver :chrome do |app|
- Capybara::Selenium::Driver.new(app, browser: :chrome)
- end
- Capybara.default_driver = :chrome
+ require 'capybara/rspec'
+ require 'capybara/poltergeist'
+ Capybara.default_driver = :poltergeist
+ Capybara.javascript_driver = :poltergeist
+ Capybara.default_wait_time = 3
end
-
|
Use Poltergeist to run browser specs
Chromedriver is slow, the browser window is annoying, and it doesn't
work properly on CircleCI since upgrading Rails.
If BS_BROWSER is defined, then we're running under Browserstack, and
should use the Selenium driver. Otherwise, we'll use Poltergeist.
|
diff --git a/lib/prompt/console/builtins.rb b/lib/prompt/console/builtins.rb
index abc1234..def5678 100644
--- a/lib/prompt/console/builtins.rb
+++ b/lib/prompt/console/builtins.rb
@@ -16,22 +16,25 @@ print_help true
end
- command "exit" do
+ command "exit", "Exit the console" do
exit
end
private
def self.print_help verbose = false
+ commands = Prompt.application.commands
+ cmd_width = commands.map { |c| c.usage.length }.max
+
Prompt.application.command_groups.each do |cg|
puts
puts cg.name
puts
cg.commands.each do |cmd|
- puts " %-40s %s" % [cmd.usage, cmd.desc]
+ puts " %-#{cmd_width+4}s %s" % [cmd.usage, cmd.desc]
if verbose
cmd.parameters.each do |v|
- puts " "*43 + ("%-10s %s" % ["<#{v.name}>", "#{v.desc}"])
+ puts " "*(cmd_width+7) + ("%-10s %s" % ["<#{v.name}>", "#{v.desc}"])
end
end
end
|
Format help command so that descriptions are always aligned
|
diff --git a/lib/raph/parser/base_parser.rb b/lib/raph/parser/base_parser.rb
index abc1234..def5678 100644
--- a/lib/raph/parser/base_parser.rb
+++ b/lib/raph/parser/base_parser.rb
@@ -30,7 +30,11 @@ # Returns underscored symbol of string
# (snake case format).
def to_underscored_sym(str)
- str.sub(/^-+/, '').gsub(/([A-Z\d]+)([A-Z][a-z])/, '\1_\2').gsub(/([a-z\d])([A-Z])/,'\1_\2').tr('-', '_').downcase.to_sym
+ str.sub(/^-+/, '').
+ gsub(/([A-Z\d]+)([A-Z][a-z])/, '\1_\2').
+ gsub(/([a-z\d])([A-Z])/, '\1_\2').
+ tr('-', '_').
+ downcase.to_sym
end
end
end
|
Split to long line into several lines
|
diff --git a/tasks/ProvisionSuccess.rb b/tasks/ProvisionSuccess.rb
index abc1234..def5678 100644
--- a/tasks/ProvisionSuccess.rb
+++ b/tasks/ProvisionSuccess.rb
@@ -3,7 +3,7 @@ run do
collins.set_status!(facter['asset_tag'], :provisioned, "Moving to provisioned", :running)
log "Shutting down machine..."
- run_cmd '/sbin/shutdown', '-h', 'now'
+ run_cmd '/sbin/shutdown', '-r', 'now'
log "Sleeping waiting for shutdown"
sleep
end
|
Reboot don't shutdown on provisioning
Don't break the chain. Copy paste error from intake shutdown command.
|
diff --git a/app.rb b/app.rb
index abc1234..def5678 100644
--- a/app.rb
+++ b/app.rb
@@ -4,50 +4,78 @@ require "sinatra"
require "octokit"
require "redis"
-
+require "json"
# Init
-redis = Redis.new
-NS = "pullstate"
+$redis = Redis.new
+VERSION = %x{git show-ref --hash=7 --head HEAD}.strip
+NAMESPACE = "pullstatus:#{VERSION}"
TTL = 60 * 5
+
# Routes
-get "/:user/:repo/pull/:number" do
- k = key params
- fn = redis.get k
-
- unless fn
- fn = state params
- redis.setex k, TTL, fn
- end
-
- send_file "images/#{fn}.png"
+get "/:user/:repo/pull/:num" do
+ pull_request = PullRequest.new params
+ send_file "images/#{pull_request.status}.png",
+ :last_modified=>pull_request.updated_at
end
-# Helpers
+# Models
-def key p
- "#{NS}:#{p[:user]}/#{p[:repo]}/#{p[:number]}"
+class PullRequest
+ def initialize params
+ @user = params[:user]
+ @repo = params[:repo]
+ @num = params[:num]
+ end
+
+ def status
+ if pull_request["merged_at"]
+ "merged"
+
+ elsif pull_request["closed_at"]
+ "rejected"
+
+ else
+ "open"
+ end
+ end
+
+ def method_missing meth, *args, &block
+ pull_request[meth.to_s]
+ end
+
+ def pull_request
+ @pr ||= get!
+ end
+
+ private
+
+ def key
+ "#{NAMESPACE}:#{repo}/#{@num}"
+ end
+
+ def repo
+ "#{@user}/#{@repo}"
+ end
+
+ def get!
+ json = $redis.get(key)
+
+ if json.nil?
+ json = fetch!.to_json
+ $redis.setex key, TTL, json
+ end
+
+ JSON.parse(json)
+ end
+
+ def fetch!
+ puts "Fetching: #{key} PUTS"
+ Octokit.pull(repo, @num)
+ end
end
-
-def pull_request! p
- repo = "#{p[:user]}/#{p[:repo]}"
- Octokit.pull repo, p[:number]
-end
-
-def state p
- pull = pull_request! p
- if pull.merged_at
- "merged"
-
- elsif pull.closed_at
- "rejected"
-
- else
- "open"
- end
-end
|
Add last-modified header to response.
This involved a pretty big refactoring of the app. Previously, we were
only storing (in redis) the calculated state of each pull request. Now
we're storing the entire response.
|
diff --git a/app.rb b/app.rb
index abc1234..def5678 100644
--- a/app.rb
+++ b/app.rb
@@ -23,13 +23,10 @@ # Create and send PDF from form data.
post "/crystallize" do
data = params[:crystal]
- if Validator.valid(data)
- html = erb(:pdf, locals: {crystal: data})
- file = Printer.create_pdf(html, "files", data[:company])
- send_file(file)
- else
- redirect "/"
- end
+ return redirect "/" unless Validator.valid(data)
+ html = erb(:pdf, locals: {crystal: data})
+ file = Printer.create_pdf(html, "files", data[:company])
+ send_file(file)
end
# FIXME: This is for development purposes only.
|
Use guard clause instead of if else.
|
diff --git a/app.rb b/app.rb
index abc1234..def5678 100644
--- a/app.rb
+++ b/app.rb
@@ -9,8 +9,9 @@ end
post '/submit' do
- librato_user = params[:librato_user] || ENV['LIBRATO_USER']
- librato_token = params[:librato_token] || ENV['LIBRATO_TOKEN']
+ librato_user = params[:librato_user] || ENV['LIBRATO_USER']
+ librato_token = params[:librato_token] || ENV['LIBRATO_TOKEN']
+ librato_prefix = params[:librato_prefix] || ENV['LIBRATO_PREFIX']
client = Librato::Metrics::Client.new
client.authenticate(librato_user.to_s.strip, librato_token.to_s.strip)
@@ -27,7 +28,13 @@
next unless data[:at] == 'metric'
- queue.add data[:measure] => {
+ if librato_prefix
+ name = "#{librato_prefix}.#{data[:measure]}"
+ else
+ name = data[:measure]
+ end
+
+ queue.add name => {
:source => dyno,
:value => data[:val],
:measure_time => time.to_i,
|
Allow for prefixes for metrics
|
diff --git a/app.rb b/app.rb
index abc1234..def5678 100644
--- a/app.rb
+++ b/app.rb
@@ -26,7 +26,12 @@ scripts.sort_by { |s| s['name'] }
end
+error do
+ 503
+end
+
get '/' do
+ raise 'herp'
@scripts = all_scripts
@last_updated = Time.parse($redis['last_updated'])
erb :index
|
Raise a 503 when the service is unavailable
|
diff --git a/everyday.gemspec b/everyday.gemspec
index abc1234..def5678 100644
--- a/everyday.gemspec
+++ b/everyday.gemspec
@@ -18,6 +18,6 @@ spec.require_paths = ["lib"]
spec.add_development_dependency "bundler", "~> 1.8"
- spec.add_development_dependency "rake", "~> 10.0"
+ spec.add_development_dependency "rake", "~> 10.4"
spec.add_development_dependency "minitest", "~> 5.5"
end
|
Update rake version from 10.0 to 10.4
|
diff --git a/akamai_api.gemspec b/akamai_api.gemspec
index abc1234..def5678 100644
--- a/akamai_api.gemspec
+++ b/akamai_api.gemspec
@@ -20,7 +20,7 @@ gem.add_dependency 'active_support', '>= 2'
gem.add_dependency 'thor', '~> 0.14.0'
gem.add_dependency 'savon', '~> 1.2.0'
- gem.add_dependency 'builder', '~> 3.1.3'
+ gem.add_dependency 'builder', '~> 3.0'
gem.add_development_dependency 'rspec', '~> 2.11'
gem.add_development_dependency 'savon_spec', '~> 1.3'
|
Allow builder greater than 3.0
|
diff --git a/attributes/default.rb b/attributes/default.rb
index abc1234..def5678 100644
--- a/attributes/default.rb
+++ b/attributes/default.rb
@@ -18,6 +18,6 @@ #
default['thrift']['version'] = '0.9.0'
-default['thrift']['mirror'] = 'http://archive.apache.org/dist/'
+default['thrift']['mirror'] = 'http://archive.apache.org/dist'
default['thrift']['checksum'] = '71d129c49a2616069d9e7a93268cdba59518f77b3c41e763e09537cb3f3f0aac'
default['thrift']['configure_options'] = []
|
Remove trailing slash from mirror url
|
diff --git a/benchmarks/get_set.rb b/benchmarks/get_set.rb
index abc1234..def5678 100644
--- a/benchmarks/get_set.rb
+++ b/benchmarks/get_set.rb
@@ -1,7 +1,7 @@ require 'benchmark'
require File.dirname(__FILE__) + '/../harness'
-LARGE_NUMBER = 20_000
+LARGE_NUMBER = 50_000
Benchmark.bmbm do |b|
b.report('get/set remix-stash') do
|
Bump the number of iterations for the get/set benchmark.
|
diff --git a/sparkle_formation.gemspec b/sparkle_formation.gemspec
index abc1234..def5678 100644
--- a/sparkle_formation.gemspec
+++ b/sparkle_formation.gemspec
@@ -13,5 +13,5 @@ s.add_dependency 'attribute_struct', '~> 0.2.2'
s.add_dependency 'multi_json'
s.executables << 'generate_sparkle_docs'
- s.files = Dir['**/*']
+ s.files = Dir['lib/**/*'] + %w(sparkle_formation.gemspec README.md CHANGELOG.md LICENSE)
end
|
Update file list included within gem
|
diff --git a/UAFilterableResultsController.podspec b/UAFilterableResultsController.podspec
index abc1234..def5678 100644
--- a/UAFilterableResultsController.podspec
+++ b/UAFilterableResultsController.podspec
@@ -1,6 +1,6 @@ Pod::Spec.new do |s|
s.name = "UAFilterableResultsController"
- s.version = "1.0.0"
+ s.version = "1.0.1"
s.summary = "A NSFetchedResultsController-style class using NSMutableArray as the backing store instead of Core Data. "
s.description = <<-DESC
UAFilterableResultsController provides the following:
@@ -14,9 +14,9 @@ s.homepage = "https://github.com/unsignedapps/UAFilterableResultsController"
s.license = 'MIT'
s.author = { "Unsigned Apps" => "[email protected]" }
- s.source = { :git => "https://github.com/unsignedapps/UAFilterableResultsController.git", :tag => "1.0.0" }
+ s.source = { :git => "https://github.com/unsignedapps/UAFilterableResultsController.git", :tag => "1.0.1" }
s.platform = :ios, '7.0'
- s.exclude_files = 'Code/UAFilterableResultsController/UAAppDelegate.*', 'Code/UAFilterableResultsController/main.m'
+ s.exclude_files = 'Code/UAFilterableResultsController/UAAppDelegate.*', 'Code/UAFilterableResultsController/main.m', 'Code/UAFilterableResultsController/UAViewController.*'
s.requires_arc = true
s.source_files = 'Code/UAFilterableResultsController/*.{h,m}'
end
|
Exclude Xcode boilerplate from the pod.
|
diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb
index abc1234..def5678 100644
--- a/spec/classes/init_spec.rb
+++ b/spec/classes/init_spec.rb
@@ -15,11 +15,11 @@
it { is_expected.to contain_class('realmd') }
it { is_expected.to contain_class('realmd::params') }
- it { is_expected.to contain_class('realmd::install').that_comes_before('realmd::config') }
+ it { is_expected.to contain_class('realmd::install').that_comes_before('Class[realmd::config]') }
it { is_expected.to contain_class('realmd::config') }
- it { is_expected.to contain_class('realmd::join').that_subscribes_to('realmd::config') }
- it { is_expected.to contain_class('realmd::sssd::config').that_requires('realmd::join') }
- it { is_expected.to contain_class('realmd::sssd::service').that_subscribes_to('realmd::sssd::config') }
+ it { is_expected.to contain_class('realmd::join').that_subscribes_to('Class[realmd::config]') }
+ it { is_expected.to contain_class('realmd::sssd::config').that_requires('Class[realmd::join]') }
+ it { is_expected.to contain_class('realmd::sssd::service').that_subscribes_to('Class[realmd::sssd::config]') }
end
end
end
|
Fix class resource references in spec tests
|
diff --git a/app/services/auto_placement_visibility_service.rb b/app/services/auto_placement_visibility_service.rb
index abc1234..def5678 100644
--- a/app/services/auto_placement_visibility_service.rb
+++ b/app/services/auto_placement_visibility_service.rb
@@ -3,17 +3,17 @@ field_names_to_hide = []
field_names_to_edit = []
- auto_placement_values = [
- :placement_host_name,
- :placement_ds_name,
- :host_filter,
- :ds_filter,
- :cluster_filter,
- :placement_cluster_name,
- :rp_filter,
- :placement_rp_name,
- :placement_dc_name
- ]
+ auto_placement_values = %i(
+ placement_host_name
+ placement_ds_name
+ host_filter
+ ds_filter
+ cluster_filter
+ placement_cluster_name
+ rp_filter
+ placement_rp_name
+ placement_dc_name
+ )
if auto_placement_enabled
field_names_to_hide += auto_placement_values
|
Fix rubocop warning in AutoPlacementVisibilityService
|
diff --git a/app/admin/users.rb b/app/admin/users.rb
index abc1234..def5678 100644
--- a/app/admin/users.rb
+++ b/app/admin/users.rb
@@ -7,6 +7,10 @@ column :infusionsoft_affiliate_link
column :referrer_id
default_actions
+ end
+
+ def max_csv_records
+ 30_000
end
filter :email
|
Update CSV export limit in controller
|
diff --git a/app/models/drop.rb b/app/models/drop.rb
index abc1234..def5678 100644
--- a/app/models/drop.rb
+++ b/app/models/drop.rb
@@ -4,6 +4,17 @@ belongs_to :place
validates :sc_track, presence: true, numericality: { only_integer: true }
+ validates :latitude, :longitude, presence: true
+
+ before_validation :copy_lat_and_long_from_place
+
+ def copy_lat_and_long_from_place
+ if place
+ self.latitude = place.latitude
+ self.longitude = place.longitude
+ end
+ end
+
def image_from_track
if soundcloud_track.artwork_url.nil?
|
Add validation for latitude and longitude and before_validation action that copies lat and long from place if there is one
|
diff --git a/examples/play_midi.rb b/examples/play_midi.rb
index abc1234..def5678 100644
--- a/examples/play_midi.rb
+++ b/examples/play_midi.rb
@@ -7,7 +7,6 @@ mus = graph.node_at(0)
out = graph.node_at(1)
graph.connect_node_input(mus, 0, out, 0)
-graph.update
graph.open
graph.init
graph.show
|
Remove redundant call to update
|
diff --git a/app/models/game.rb b/app/models/game.rb
index abc1234..def5678 100644
--- a/app/models/game.rb
+++ b/app/models/game.rb
@@ -5,7 +5,7 @@ class Game < ActiveRecord::Base
has_many :players
- after_initialize :setup_state
+ before_create :setup_state
def actions
# TODO: optimize
|
Use 'before_create' instead of 'after_initialize`
|
diff --git a/activerecord-safer_migrations.gemspec b/activerecord-safer_migrations.gemspec
index abc1234..def5678 100644
--- a/activerecord-safer_migrations.gemspec
+++ b/activerecord-safer_migrations.gemspec
@@ -19,6 +19,6 @@ gem.add_runtime_dependency "activerecord", ">= 4.0"
gem.add_development_dependency "pg", "~> 0.21.0"
- gem.add_development_dependency "rspec", "~> 3.6.0"
+ gem.add_development_dependency "rspec", "~> 3.7.0"
gem.add_development_dependency "rubocop", "~> 0.50.0"
end
|
Update rspec requirement to ~> 3.7.0
Updates the requirements on [rspec](https://github.com/rspec/rspec) to permit the latest version.
|
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,6 @@ class User < ActiveRecord::Base
+ # Setup accessible (or protected) attributes for your model
+ attr_accessible :email, :password, :password_confirmation, :remember_me
# Include default devise modules. Others available are:
# :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
|
Add attr_accessible back to User model
|
diff --git a/app/actions.rb b/app/actions.rb
index abc1234..def5678 100644
--- a/app/actions.rb
+++ b/app/actions.rb
@@ -2,3 +2,8 @@ get '/' do
erb :index
end
+
+get '/topics' do
+ @topics = Topic.all.order(:topic)
+ erb :'/topics/index.html'
+end
|
Add `/topics` route, and logic
|
diff --git a/LightRoute.podspec b/LightRoute.podspec
index abc1234..def5678 100644
--- a/LightRoute.podspec
+++ b/LightRoute.podspec
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "LightRoute"
- s.version = "2.1.14"
+ s.version = "2.1.15"
s.summary = "LightRoute is easy transition between view controllers and support many popylar arhitectures"
s.description = <<-DESC
LightRoute is easy transition between view controllers and support many popylar arhitectures. This framework very flow for settings your transition and have userfriendly API.
|
Update spec to version 2.1.15
|
diff --git a/app/models/gitosis_public_key.rb b/app/models/gitosis_public_key.rb
index abc1234..def5678 100644
--- a/app/models/gitosis_public_key.rb
+++ b/app/models/gitosis_public_key.rb
@@ -7,8 +7,8 @@ validates_uniqueness_of :identifier, :score => :user_id
validates_presence_of :title, :key, :identifier
- named_scope :active, {:conditions => {:active => GitosisPublicKey::STATUS_ACTIVE != 0}}
- named_scope :inactive, {:conditions => {:active => GitosisPublicKey::STATUS_LOCKED == 0}}
+ named_scope :active, {:conditions => {:active => GitosisPublicKey::STATUS_ACTIVE}}
+ named_scope :inactive, {:conditions => {:active => GitosisPublicKey::STATUS_LOCKED}}
validate :has_not_been_changed
|
Save fail in last commit
|
diff --git a/app/models/instrument_version.rb b/app/models/instrument_version.rb
index abc1234..def5678 100644
--- a/app/models/instrument_version.rb
+++ b/app/models/instrument_version.rb
@@ -15,15 +15,15 @@
def self.build(params = {})
@instrument = Instrument.find(params[:instrument_id])
- if @instrument.current_version_number == params[:version_number].to_i
- @instrument
- else
+ instrument_version = InstrumentVersion.new
+ instrument_version.instrument = @instrument
+
+ unless @instrument.current_version_number == params[:version_number].to_i
@version = @instrument.versions[params[:version_number].to_i]
- instrument_version = InstrumentVersion.new
- instrument_version.instrument = @instrument
instrument_version.version = @version
- instrument_version
end
+
+ instrument_version
end
def questions
@@ -36,6 +36,7 @@ end
def options_for_question(question)
+ return question.options unless @version
options = []
versioned(question).options.each do |option|
options << versioned(option) if versioned(option)
|
Fix no versioned method for instrument bug
|
diff --git a/aws-sdk-core/lib/aws-sdk-core/log/param_filter.rb b/aws-sdk-core/lib/aws-sdk-core/log/param_filter.rb
index abc1234..def5678 100644
--- a/aws-sdk-core/lib/aws-sdk-core/log/param_filter.rb
+++ b/aws-sdk-core/lib/aws-sdk-core/log/param_filter.rb
@@ -1,4 +1,5 @@ require 'pathname'
+require 'set'
module Aws
module Log
|
Add 'set' load to the ParamFilter class
Resolves issue #977
|
diff --git a/app/services/create_list_item.rb b/app/services/create_list_item.rb
index abc1234..def5678 100644
--- a/app/services/create_list_item.rb
+++ b/app/services/create_list_item.rb
@@ -10,7 +10,7 @@ end
def call
- if list_item.item
+ if item_attached?
AttachSearchToListItem.call(list_item)
AttachQueryResultsToSearch.call(list_item.search)
list_item.save!
@@ -22,4 +22,8 @@ private
attr_reader :list_item
+
+ def item_attached?
+ list_item.item
+ end
end
|
Refactor CreateListItem: extract method (item_attached?)
|
diff --git a/spec/requests/assets_js_spec.rb b/spec/requests/assets_js_spec.rb
index abc1234..def5678 100644
--- a/spec/requests/assets_js_spec.rb
+++ b/spec/requests/assets_js_spec.rb
@@ -24,4 +24,5 @@ end
end
+ self.use_transactional_fixtures = true
end
|
Add test code for Travis-CI.
|
diff --git a/app/controllers/answers_controller.rb b/app/controllers/answers_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/answers_controller.rb
+++ b/app/controllers/answers_controller.rb
@@ -20,9 +20,6 @@ # TODO: ADD USER AUTH
# @answer.user_id = session[:user_id]
- #TODO: ASSOCIATE WITH QUESTION
- #@question = Question.find(params[:id])?
-
if @answer.save
redirect_to @answer
else
@@ -40,9 +37,6 @@ # TODO: ADD USER AUTH
# @answer.user_id = session[:user_id]
- #TODO: ASSOCIATE WITH QUESTION
- #@question = Question.find(params[:id])?
-
@answer.update(answer_params)
if @answer.save
redirect_to @answer
@@ -54,7 +48,8 @@ private
def answer_params
- params.require(:answer).permit(:body, :best, :user_id, :question_id)
+ #TODO: USER ID WILL EVENTUALLY BECOME CURRENT_USER
+ params.require(:answer).permit(:body, :best).merge(user_id: 1, question_id: params[:question_id])
end
def destroy
|
Edit answer_params method for user_id and question_id params.
|
diff --git a/app/controllers/clinics_controller.rb b/app/controllers/clinics_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/clinics_controller.rb
+++ b/app/controllers/clinics_controller.rb
@@ -29,11 +29,10 @@ def update
if @clinic.update_attributes clinic_params
flash[:notice] = 'Successfully updated clinic details'
- redirect_to clinics_path
else
- flash[:notice] = 'Error saving clinic details'
- redirect_to clinics_path
+ flash[:alert] = 'Error saving clinic details'
end
+ redirect_to clinics_path
end
def find_clinic
|
Update edit fail to alert
|
diff --git a/app/mailers/submission_mailer.rb b/app/mailers/submission_mailer.rb
index abc1234..def5678 100644
--- a/app/mailers/submission_mailer.rb
+++ b/app/mailers/submission_mailer.rb
@@ -1,20 +1,24 @@ class SubmissionMailer < ApplicationMailer
def queued(submission)
+ return if ENV['DISABLE_ALL_EMAIL']
@submission = submission
mail(to: @submission.user.email, subject: 'Submission Received')
end
def deposited(submission)
+ return if ENV['DISABLE_ALL_EMAIL']
@submission = submission
mail(to: @submission.user.email, subject: 'Submission Complete')
end
def rejected(submission)
+ return if ENV['DISABLE_ALL_EMAIL']
@submission = submission
mail(to: @submission.user.email, subject: 'Submission Problem')
end
def failed(submission, error)
+ return if ENV['DISABLE_ALL_EMAIL']
@submission = submission
@error = error
mail(to: User.where(admin: true).map(&:email),
|
Allow all emails to be disabled
Until sending emails from Heroku is resolved, we need a mechanism to
disable all emails. This might never be merged… we’ll see how long
solving this takes.
|
diff --git a/business.gemspec b/business.gemspec
index abc1234..def5678 100644
--- a/business.gemspec
+++ b/business.gemspec
@@ -20,7 +20,7 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]
- spec.add_development_dependency "gc_ruboconfig", "~> 2.30.0"
+ spec.add_development_dependency "gc_ruboconfig", "~> 2.31.0"
spec.add_development_dependency "rspec", "~> 3.1"
spec.add_development_dependency "rspec_junit_formatter", "~> 0.5.1"
spec.add_development_dependency "rubocop", "~> 1.25.0"
|
Update gc_ruboconfig requirement from ~> 2.30.0 to ~> 2.31.0
Updates the requirements on [gc_ruboconfig](https://github.com/gocardless/ruboconfig) to permit the latest version.
- [Release notes](https://github.com/gocardless/ruboconfig/releases)
- [Changelog](https://github.com/gocardless/gc_ruboconfig/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gocardless/ruboconfig/compare/v2.30.0...v2.31.0)
---
updated-dependencies:
- dependency-name: gc_ruboconfig
dependency-type: direct:development
...
Signed-off-by: dependabot[bot] <[email protected]>
|
diff --git a/dynosaur.gemspec b/dynosaur.gemspec
index abc1234..def5678 100644
--- a/dynosaur.gemspec
+++ b/dynosaur.gemspec
@@ -18,7 +18,7 @@ spec.require_paths = ['lib']
spec.add_runtime_dependency 'platform-api', '~> 2.0.0'
- spec.add_runtime_dependency 'sys-proctable', '~> 0.9'
+ spec.add_runtime_dependency 'sys-proctable', '>= 0.9', '< 2.0'
spec.add_development_dependency 'bundler', '~> 1.8'
spec.add_development_dependency 'codeclimate-test-reporter', '~> 0.4'
|
Update sys-proctable requirement from ~> 0.9 to >= 0.9, < 2.0
Updates the requirements on [sys-proctable](https://github.com/djberg96/sys-proctable) to permit the latest version.
- [Release notes](https://github.com/djberg96/sys-proctable/releases)
- [Changelog](https://github.com/djberg96/sys-proctable/blob/master/CHANGES)
- [Commits](https://github.com/djberg96/sys-proctable/compare/sys-proctable-0.9.0...sys-proctable-1.2.2)
Signed-off-by: dependabot-preview[bot] <[email protected]>
|
diff --git a/activestorage/activestorage.gemspec b/activestorage/activestorage.gemspec
index abc1234..def5678 100644
--- a/activestorage/activestorage.gemspec
+++ b/activestorage/activestorage.gemspec
@@ -1,18 +1,30 @@+# frozen_string_literal: true
+
+version = File.read(File.expand_path("../RAILS_VERSION", __dir__)).strip
+
Gem::Specification.new do |s|
- s.name = "activestorage"
- s.version = "0.1"
- s.authors = "David Heinemeier Hansson"
- s.email = "[email protected]"
- s.summary = "Attach cloud and local files in Rails applications"
- s.homepage = "https://github.com/rails/activestorage"
- s.license = "MIT"
+ s.platform = Gem::Platform::RUBY
+ s.name = "activejob"
+ s.version = version
+ s.summary = "Local and cloud file storage framework."
+ s.description = "Attach cloud and local files in Rails applications."
s.required_ruby_version = ">= 2.2.2"
- s.add_dependency "rails", ">= 5.2.0.alpha"
+ s.license = "MIT"
- s.add_development_dependency "bundler", "~> 1.15"
+ s.author = "David Heinemeier Hansson"
+ s.email = "[email protected]"
+ s.homepage = "http://rubyonrails.org"
- s.files = `git ls-files`.split("\n")
- s.test_files = `git ls-files -- test/*`.split("\n")
-end
+ s.files = Dir["CHANGELOG.md", "MIT-LICENSE", "README.md", "lib/**/*", "app/**/*", "config/**/*"]
+ s.require_path = "lib"
+
+ s.metadata = {
+ "source_code_uri" => "https://github.com/rails/rails/tree/v#{version}/activestorage",
+ "changelog_uri" => "https://github.com/rails/rails/blob/v#{version}/activestorage/CHANGELOG.md"
+ }
+
+ s.add_dependency "actionpack", version
+ s.add_dependency "activerecord", version
+end
|
Use standard Rails layout for gemspec
|
diff --git a/frecon.gemspec b/frecon.gemspec
index abc1234..def5678 100644
--- a/frecon.gemspec
+++ b/frecon.gemspec
@@ -5,7 +5,7 @@
Gem::Specification.new do |s|
s.name = "frecon"
- s.email = "[email protected]"
+ s.email = "[email protected]"
s.version = FReCon::VERSION
s.summary = "A JSON API for scouting FRC competitions."
|
Change the Gem email to the Google Groups mailing list.
|
diff --git a/db/migrate/20110126232040_add_unique_index_on_invitation_service_and_invitation_identifier_to_users.rb b/db/migrate/20110126232040_add_unique_index_on_invitation_service_and_invitation_identifier_to_users.rb
index abc1234..def5678 100644
--- a/db/migrate/20110126232040_add_unique_index_on_invitation_service_and_invitation_identifier_to_users.rb
+++ b/db/migrate/20110126232040_add_unique_index_on_invitation_service_and_invitation_identifier_to_users.rb
@@ -1,5 +1,7 @@ class AddUniqueIndexOnInvitationServiceAndInvitationIdentifierToUsers < ActiveRecord::Migration
def self.up
+ change_column(:users, :invitation_service, :string, :limit => 127)
+ change_column(:users, :invitation_identifier, :string, :limit => 127)
add_index(:users, [:invitation_service, :invitation_identifier], :unique => true)
end
|
db: Create limited varchar to be able to add index.
|
diff --git a/app/services/webhook_notifier.rb b/app/services/webhook_notifier.rb
index abc1234..def5678 100644
--- a/app/services/webhook_notifier.rb
+++ b/app/services/webhook_notifier.rb
@@ -1,6 +1,6 @@ class WebhookNotifier
BOT_NAME = "Beggar"
- ICON_URL = "http://tbot-beggar.herokuapp.com/beggar-slack-icon.svg"
+ ICON_URL = "http://tbot-beggar.herokuapp.com/beggar-slack-icon.png"
def initialize(pull_request)
@pull_request = pull_request
|
Use the PNG icon for Slack notifications
|
diff --git a/spec/models/mingle/twitter/tweet_spec.rb b/spec/models/mingle/twitter/tweet_spec.rb
index abc1234..def5678 100644
--- a/spec/models/mingle/twitter/tweet_spec.rb
+++ b/spec/models/mingle/twitter/tweet_spec.rb
@@ -23,18 +23,18 @@
describe "#created_before?" do
it 'should return true' do
- photo = described_class.new(created_at: 1.day.ago)
- expect(photo.created_before?(Date.current)).to eq(true)
+ tweet = described_class.new(created_at: 1.day.ago)
+ expect(tweet.created_before?(Date.current)).to eq(true)
end
it 'should return false' do
- photo = described_class.new(created_at: 1.day.ago)
- expect(photo.created_before?(2.day.ago)).to eq(false)
+ tweet = described_class.new(created_at: 1.day.ago)
+ expect(tweet.created_before?(2.day.ago)).to eq(false)
end
it 'should return false when date is nil' do
- photo = described_class.new(created_at: 1.day.ago)
- expect(photo.created_before?(nil)).to eq(false)
+ tweet = described_class.new(created_at: 1.day.ago)
+ expect(tweet.created_before?(nil)).to eq(false)
end
end
end
|
Remove typo from tweet spec
|
diff --git a/provisioner/worker/plugins/automators/chef_solo_automator/chef_solo_automator/cookbooks/coopr_service_manager/recipes/default.rb b/provisioner/worker/plugins/automators/chef_solo_automator/chef_solo_automator/cookbooks/coopr_service_manager/recipes/default.rb
index abc1234..def5678 100644
--- a/provisioner/worker/plugins/automators/chef_solo_automator/chef_solo_automator/cookbooks/coopr_service_manager/recipes/default.rb
+++ b/provisioner/worker/plugins/automators/chef_solo_automator/chef_solo_automator/cookbooks/coopr_service_manager/recipes/default.rb
@@ -21,7 +21,7 @@
if node['coopr']['node'].has_key?('services')
node['coopr']['node']['services'].each do |k, v|
- if resources(service: k)
+ # if resources(service: k)
log "service-#{v}-#{k}" do
message "Service: #{k}, action: #{v}"
end
@@ -30,6 +30,6 @@ resources("service[#{k}]").run_action(v.to_sym)
end # block
end # ruby_block
- end # if
+ # end # if
end # each
end # if
|
Comment out resource check, for testing
|
diff --git a/zebra-zpl.gemspec b/zebra-zpl.gemspec
index abc1234..def5678 100644
--- a/zebra-zpl.gemspec
+++ b/zebra-zpl.gemspec
@@ -1,11 +1,11 @@ # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
-# require 'lib/zebra/zpl/version'
+require 'lib/zebra/zpl/version'
Gem::Specification.new do |spec|
spec.name = "zebra-zpl"
- spec.version = '1.0.0'
+ spec.version = Zebra::Zpl::VERSION
spec.authors = ["Barnabas Bulpett"]
spec.email = ["[email protected]"]
spec.description = %q{Print labels using ZPL2 and Ruby}
|
Fix some refs in gemspec
|
diff --git a/app/controllers/index_controller.rb b/app/controllers/index_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/index_controller.rb
+++ b/app/controllers/index_controller.rb
@@ -5,39 +5,20 @@ # All of these endpoints should use https://www.inaturalist.org as the base URL, particularly endpoints that require auth.
get '/' do
- # url = "https://www.inaturalist.org/observations.json?q=#{params['q']}"
response = RestClient.get("https://www.inaturalist.org/observations.json")
parsed_response = JSON.parse(response,:symbolize_names => true)
-
- @taxa = []
- parsed_response.each do |creature_hash|
- if creature_hash[:iconic_taxon] != nil
- p "ICONIC TAXON"
- p creature_hash[:iconic_taxon][:name]
- end
- @taxa << creature_hash[:taxon]
- end
-
- @taxa.each do |t|
- if !t.nil?
- p "*************"
- p t
+ # organism_options = {}
+ parsed_response.each do |organism_hash|
+ if organism_hash[:taxon] != nil
+ p "TAXON"
+ p organism_hash.fetch(:taxon)
+ end
+ if organism_hash[:iconic_taxon] != nil
+ p "ICONIC"
+ p organism_hash.fetch(:iconic_taxon)
end
end
erb :index
end
-
-# post '/results' do
-# url = "https://www.inaturalist.org/observations.json?q=#{params['q']}"
-# response = RestClient.get(url)
-# parsed_response = JSON.parse(response,:symbolize_names => true)
-#
-# @taxa = []
-# parsed_response.each do |creature_hash|
-# @taxa << creature_hash[:taxon]
-# end
-#
-# redirect '/'
-# end
|
Change controller to retrieve API info for creating objects
|
diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/pages_controller.rb
+++ b/app/controllers/pages_controller.rb
@@ -7,6 +7,8 @@ render text: "#{params[:id]}.3agPbEGMW8yyXAdNJmtYhleq07pUgmnN1oCrhN9iRwA"
when "C8WHrIIU7RaJl6ZBKB3iDTI6fiN_PYyEzws6KzJ18B8"
render text: "#{params[:id]}.jOl0WYrEi5GTa1BlXCSMh31NLeYmWZbZA_QaK-ZpnIE"
+ when "lSEsPnO3_PhX7VO5SD-JS6xhXm6HDCoVa7lpsueDfcE"
+ render text: "#{params[:id]}.jOl0WYrEi5GTa1BlXCSMh31NLeYmWZbZA_QaK-ZpnIE"
else
render text: "#{params[:id]}.x2TXuRtPY5PkPL4YMeiKaMl4xBtFrjfOe94AR0Iyg1M"
end
|
Add other SSL challenge response
|
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -44,7 +44,7 @@ end
def destroy
- user = User.find(params[:id])
+ user = User.find(params[:id])
session[:user_id] = nil
user.destroy
flash[:success] = "User record deleted"
|
Remove some comments from users controller
|
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -14,6 +14,11 @@ end
def edit
+ if @user.id == session[:user_id]
+ render :edit
+ else
+ redirect_to :root
+ end
end
def show
|
Create action for user edit
|
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -34,4 +34,13 @@ redirect_to new_user_session_path
end
end
+
+ def specify_paypal
+ if user_signed_in?
+ @user = User.find params[:id]
+ authorize! :update, @user
+ else
+ render :template => "devise/sessions/new"
+ end
+ end
end
|
Add specify_paypal Action to the Users Controller
Update the Users controller to include the specify_paypal action.
|
diff --git a/app/helpers/admin/article_helper.rb b/app/helpers/admin/article_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/admin/article_helper.rb
+++ b/app/helpers/admin/article_helper.rb
@@ -1,5 +1,7 @@ module Admin::ArticleHelper
def possible_related_articles(article)
- Article.published.order('title ASC').where('id != ?', article)
+ articles = Article.published.order('title ASC')
+ articles = articles.where('id != ?', article) if article.id.present?
+ articles
end
end
|
Fix bug in related content form.
|
diff --git a/app/models/spree/order_decorator.rb b/app/models/spree/order_decorator.rb
index abc1234..def5678 100644
--- a/app/models/spree/order_decorator.rb
+++ b/app/models/spree/order_decorator.rb
@@ -3,8 +3,8 @@ has_many :fishbowl_logs
attr_accessible :fishbowl_id, :so_number
- scope :fishbowl_submitted, lambda { where(table[:fishbowl_id].not_eq(nil)) }
- scope :fishbowl_unsubmitted, lambda { where(table[:fishbowl_id].eq(nil)) }
+ scope :fishbowl_submitted, lambda { where(arel_table[:fishbowl_id].not_eq(nil)) }
+ scope :fishbowl_unsubmitted, lambda { where(arel_table[:fishbowl_id].eq(nil)) }
alias_method :original_can_ship?, :can_ship?
|
Use 'arel_table' instead of the (apparently-incorrect) 'table'
|
diff --git a/lib/content_manager/class_resolution.rb b/lib/content_manager/class_resolution.rb
index abc1234..def5678 100644
--- a/lib/content_manager/class_resolution.rb
+++ b/lib/content_manager/class_resolution.rb
@@ -1,6 +1,5 @@ module ContentManager
module ClassResolution
-
def self.content_class(name)
content_class_name(name).constantize
end
@@ -19,7 +18,7 @@ cm_class_name.constantize
return cm_class_name
rescue NameError
- raise "Couldn't find constant definition #{name}, it should be in a file called #{name}.rb"
+ raise "Couldn't find constant definition #{class_name}, it should be in a file called #{class_name}.rb"
end
end
end
|
Update error messages to use correct class name
|
diff --git a/_plugins/static.rb b/_plugins/static.rb
index abc1234..def5678 100644
--- a/_plugins/static.rb
+++ b/_plugins/static.rb
@@ -2,7 +2,7 @@ class Generator < Jekyll::Generator
def generate(site)
# Generate book
- `mdbook build intecture_book`
+ `mdbook build --dest-dir ../book intecture_book`
# Generate Rust docs
`cargo doc --no-deps --quiet --manifest-path intecture_api/Cargo.toml && rm -rf rust && cp -R intecture_api/target/doc rust`
|
Add dest-dir arg when building book
|
diff --git a/CVCalendar.podspec b/CVCalendar.podspec
index abc1234..def5678 100644
--- a/CVCalendar.podspec
+++ b/CVCalendar.podspec
@@ -1,7 +1,7 @@ Pod::Spec.new do |s|
s.name = "CVCalendar"
-s.version = "1.1.4"
+s.version = "1.2.0"
s.summary = "A custom visual calendar for iOS 8 written in Swift."
s.homepage = "https://github.com/Mozharovsky/CVCalendar"
s.screenshot = "https://raw.githubusercontent.com/Mozharovsky/CVCalendar/master/Screenshots/CVCalendar_White.png"
|
Update Podspec for latest tag
|
diff --git a/Casks/airparrot.rb b/Casks/airparrot.rb
index abc1234..def5678 100644
--- a/Casks/airparrot.rb
+++ b/Casks/airparrot.rb
@@ -0,0 +1,7 @@+class Airparrot < Cask
+ url 'http://download.airsquirrels.com/AirParrot/Mac/AirParrot.dmg'
+ homepage 'http://www.airsquirrels.com/airparrot/'
+ version '1.5.3'
+ sha1 '94449aa750077ccd244959d9e092bd4f3c6c65c3'
+ link 'AirParrot.app'
+end
|
Add new cask for AirParrot
|
diff --git a/Casks/launchbar.rb b/Casks/launchbar.rb
index abc1234..def5678 100644
--- a/Casks/launchbar.rb
+++ b/Casks/launchbar.rb
@@ -5,8 +5,8 @@ sha256 '22a1ec0c10de940e5efbcccd18b8b048d95fb7c63213a01c7976a76d6be69a4d'
url "http://www.obdev.at/downloads/launchbar/legacy/LaunchBar-#{version}.dmg"
else
- version '6.2'
- sha256 'c40a30db70b4a14e97faf2a7a74ca26e2e0143223ad25f7ec8ae7df38f436463'
+ version '6.3'
+ sha256 '0ee5bacc02dc5213fc80934fed66124a718fd72d654ce3a4365cc694d76c1578'
url "http://www.obdev.at/downloads/launchbar/LaunchBar-#{version}.dmg"
end
|
Update LaunchBar formula to version 6.3.
The LaunchBar formula is currently failing on post-mountain-lion versions of OS X because LaunchBar 6.3 has been released and the link to 6.2 is no broken. Fixes this updating the URL and SHA.
|
diff --git a/Casks/stepmania.rb b/Casks/stepmania.rb
index abc1234..def5678 100644
--- a/Casks/stepmania.rb
+++ b/Casks/stepmania.rb
@@ -2,6 +2,7 @@ version '5.0.10'
sha256 '7e852089ff4cb13217e4a8debb76b1bffb3d8ff6ca31c903ff768577742b50a0'
+ # github.com/stepmania/stepmania was verified as official when first introduced to the cask
url "https://github.com/stepmania/stepmania/releases/download/v#{version}/StepMania-#{version}-mac.dmg"
name 'StepMania'
homepage 'http://www.stepmania.com/'
|
Fix `url` stanza comment for StepMania.
|
diff --git a/lib/generators/reputation_system/templates/change_reputation_messages_index_to_unique.rb b/lib/generators/reputation_system/templates/change_reputation_messages_index_to_unique.rb
index abc1234..def5678 100644
--- a/lib/generators/reputation_system/templates/change_reputation_messages_index_to_unique.rb
+++ b/lib/generators/reputation_system/templates/change_reputation_messages_index_to_unique.rb
@@ -14,7 +14,7 @@ # limitations under the License.
##
-class ChangeReputationMessagesIndexUnique < ActiveRecord::Migration
+class ChangeReputationMessagesIndexToUnique < ActiveRecord::Migration
def self.up
remove_index :rs_reputation_messages, :name => "index_rs_reputation_messages_on_receiver_id_and_sender"
add_index :rs_reputation_messages, [:receiver_id, :sender_id, :sender_type], :name => "index_rs_reputation_messages_on_receiver_id_and_sender", :unique => true
|
Fix a migration class name
|
diff --git a/AsyncOpKit.podspec b/AsyncOpKit.podspec
index abc1234..def5678 100644
--- a/AsyncOpKit.podspec
+++ b/AsyncOpKit.podspec
@@ -22,5 +22,5 @@ s.source = { :git => "https://github.com/jedlewison/AsyncOpKit.git", :tag => s.version.to_s }
s.platform = :ios, '8.0'
s.requires_arc = true
- s.source_files = '*.swift'
+ s.source_files = 'AsyncOpKit/*.swift'
end
|
Update podspec for file location
|
diff --git a/spec/lib/open_food_network/orders_and_fulfillments_report/customer_totals_report_spec.rb b/spec/lib/open_food_network/orders_and_fulfillments_report/customer_totals_report_spec.rb
index abc1234..def5678 100644
--- a/spec/lib/open_food_network/orders_and_fulfillments_report/customer_totals_report_spec.rb
+++ b/spec/lib/open_food_network/orders_and_fulfillments_report/customer_totals_report_spec.rb
@@ -0,0 +1,39 @@+require "spec_helper"
+
+RSpec.describe OpenFoodNetwork::OrdersAndFulfillmentsReport::CustomerTotalsReport do
+ let!(:distributor) { create(:distributor_enterprise) }
+
+ let!(:customer) { create(:customer, enterprise: distributor) }
+
+ let!(:order) do
+ create(:completed_order_with_totals, line_items_count: 1, user: customer.user,
+ customer: customer, distributor: distributor)
+ end
+
+ let(:current_user) { distributor.owner }
+ let(:permissions) { OpenFoodNetwork::Permissions.new(current_user) }
+
+ let(:report) do
+ report_options = { report_type: described_class::REPORT_TYPE }
+ OpenFoodNetwork::OrdersAndFulfillmentsReport.new(permissions, report_options, true)
+ end
+
+ let(:report_table) do
+ OpenFoodNetwork::OrderGrouper.new(report.rules, report.columns).table(report.table_items)
+ end
+
+ it "generates the report" do
+ expect(report_table.length).to eq(2)
+ end
+
+ it "has a line item row" do
+ distributor_name_field = report_table.first[0]
+ expect(distributor_name_field).to eq distributor.name
+
+ customer_name_field = report_table.first[1]
+ expect(customer_name_field).to eq order.bill_address.full_name
+
+ total_field = report_table.last[5]
+ expect(total_field).to eq I18n.t("admin.reports.total")
+ end
+end
|
Add smoke test for Customer Totals report
|
diff --git a/app/controllers/articles_controller.rb b/app/controllers/articles_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/articles_controller.rb
+++ b/app/controllers/articles_controller.rb
@@ -14,7 +14,7 @@ end
def down_vote
- @article.up_vote!
+ @article.down_vote!
end
private
|
Fix down vote method not actually down
|
diff --git a/app/controllers/concerns/searchable.rb b/app/controllers/concerns/searchable.rb
index abc1234..def5678 100644
--- a/app/controllers/concerns/searchable.rb
+++ b/app/controllers/concerns/searchable.rb
@@ -37,6 +37,7 @@ end
def filters
+ return '' unless params['filters'].present?
JSON.parse(params['filters']).symbolize_keys.slice(*Search::ALLOWED_FILTERS)
end
end
|
Return empty string if filters do not exist
|
diff --git a/app/controllers/products_controller.rb b/app/controllers/products_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/products_controller.rb
+++ b/app/controllers/products_controller.rb
@@ -2,6 +2,7 @@ before_action :authenticate_member!
load_and_authorize_resource
respond_to :html
+ responders :flash
def index
@products = Product.all
|
Add responders on products controller
|
diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/sessions_controller.rb
+++ b/app/controllers/sessions_controller.rb
@@ -11,8 +11,7 @@ if @session.valid? && @session.authenticate!
cookies[:current_assignment] = {
value: Digest::SHA512.hexdigest(@session.student_number),
- secure: true,
- path: buses_path
+ secure: true
}
session[:contact_id] = @session.contact_id
|
Remove path restriction on assignment cookie
Fixes issue with Internet Explorer.
|
diff --git a/app/controllers/websites_controller.rb b/app/controllers/websites_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/websites_controller.rb
+++ b/app/controllers/websites_controller.rb
@@ -15,6 +15,15 @@ @website = Website.new(params[:website])
if @website.save
+ # create home page
+ @home_page = Page.create(
+ :title => @website.name,
+ :name => 'Home',
+ :keywords => 'change me',
+ :description => 'change me',
+ :content => 'Welcome to ' + @website.name
+ ) {|hp| hp.website_id = @website}
+
flash[:notice] = "Successfully added new website."
redirect_to :action => "index"
else
|
Create home page when creating a new website
|
diff --git a/app/models/concerns/planting_search.rb b/app/models/concerns/planting_search.rb
index abc1234..def5678 100644
--- a/app/models/concerns/planting_search.rb
+++ b/app/models/concerns/planting_search.rb
@@ -2,38 +2,45 @@ extend ActiveSupport::Concern
included do
- searchkick
+ searchkick merge_mappings: true,
+ mappings: {
+ properties: {
+ created_at: { type: :integer },
+ harvests_count: { type: :integer },
+ photos_count: { type: :integer }
+ }
+ }
scope :search_import, -> { includes(:owner, :crop) }
def search_data
{
- slug: slug,
- crop_slug: crop.slug,
- crop_name: crop.name,
- crop_id: crop_id,
- owner_id: owner_id,
- owner_name: owner.login_name,
- owner_slug: owner.slug,
- planted_from: planted_from,
- photos_count: photos.size,
- harvests_count: harvests.size,
- has_photos: photos.size.positive?,
- active: active?,
- thumbnail_url: default_photo&.thumbnail_url,
+ slug: slug,
+ crop_slug: crop.slug,
+ crop_name: crop.name,
+ crop_id: crop_id,
+ owner_id: owner_id,
+ owner_name: owner.login_name,
+ owner_slug: owner.slug,
+ planted_from: planted_from,
+ photos_count: photos.size,
+ harvests_count: harvests.size,
+ has_photos: photos.size.positive?,
+ active: active?,
+ thumbnail_url: default_photo&.thumbnail_url,
percentage_grown: percentage_grown.to_i,
- created_at: created_at.to_i
+ created_at: created_at.to_i
}
end
def self.homepage_records(limit)
search('*',
- limit: limit,
- where: {
+ limit: limit,
+ where: {
photos_count: { gt: 0 }
},
boost_by: [:created_at],
- load: false)
+ load: false)
end
end
end
|
Add ES mappings for plantings
|
diff --git a/app/models/concerns/redis_cacheable.rb b/app/models/concerns/redis_cacheable.rb
index abc1234..def5678 100644
--- a/app/models/concerns/redis_cacheable.rb
+++ b/app/models/concerns/redis_cacheable.rb
@@ -7,7 +7,7 @@ class_methods do
def cached_attr_reader(*attributes)
attributes.each do |attribute|
- define_method("#{attribute}") do
+ define_method(attribute) do
cached_attribute(attribute) || read_attribute(attribute)
end
end
@@ -15,7 +15,7 @@
def cached_attr_time_reader(*attributes)
attributes.each do |attribute|
- define_method("#{attribute}") do
+ define_method(attribute) do
cached_value = cached_attribute(attribute)
cached_value ? Time.zone.parse(cached_value) : read_attribute(attribute)
end
|
Use symbol instead of string in RedisCacheable attribute definitions
|
diff --git a/app/models/dojo.rb b/app/models/dojo.rb
index abc1234..def5678 100644
--- a/app/models/dojo.rb
+++ b/app/models/dojo.rb
@@ -3,8 +3,8 @@ NUM_OF_WHOLE_DOJOS = "1,400"
NUM_OF_JAPAN_DOJOS = Dojo.count.to_s
- has_one :dojo_event_service
- has_many :event_histories
+ has_one :dojo_event_service, dependent: :destroy
+ has_many :event_histories, dependent: :destroy
serialize :tags
default_scope -> { order(order: :asc) }
|
Add 'dependent destroy' option to Dojo model:
See the following discussion for details.
https://github.com/coderdojo-japan/coderdojo.jp/pull/163#issuecomment-340276197
|
diff --git a/Casks/sqlectron.rb b/Casks/sqlectron.rb
index abc1234..def5678 100644
--- a/Casks/sqlectron.rb
+++ b/Casks/sqlectron.rb
@@ -1,6 +1,6 @@ cask 'sqlectron' do
- version '1.1.1'
- sha256 '9f604513342e4ce3f4bfedeca58f9d9d7b86f36640a0f2e603ae741b7cd6e1bc'
+ version '1.2.0'
+ sha256 'ba8755941f4a8acf851bf795f44758148e7fe46221a0dde4e8d81774cb07eab7'
url "https://github.com/sqlectron/sqlectron-gui/releases/download/v#{version}/Sqlectron-darwin-x64.zip"
appcast 'https://github.com/sqlectron/sqlectron-gui/releases.atom'
@@ -11,7 +11,7 @@
depends_on :macos => '>= :mountain_lion'
- container :nested => 'osx/Sqlectron.dmg'
+ container :nested => 'Sqlectron.dmg'
app 'Sqlectron.app'
postflight do
|
Update Sqlectron to version 1.2.0
|
diff --git a/app/presenters/hyrax/displays_image.rb b/app/presenters/hyrax/displays_image.rb
index abc1234..def5678 100644
--- a/app/presenters/hyrax/displays_image.rb
+++ b/app/presenters/hyrax/displays_image.rb
@@ -21,8 +21,8 @@ )
# @see https://github.com/samvera-labs/iiif_manifest
IIIFManifest::DisplayImage.new(url,
- width: 640,
- height: 480,
+ width: original_file.width,
+ height: original_file.height,
iiif_endpoint: iiif_endpoint(original_file.id))
end
|
Use the original file's width and height instead of assuming 640x480
|
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,21 +1,21 @@ class User < ActiveRecord::Base
- before_save :count_votes
-
- belongs_to :group
- has_many :made_requests, class_name: 'Request', foreign_key: 'requester_id'
- has_many :fulfilled_requests, class_name: 'Request', foreign_key: 'responder_id'
- has_many :votes, as: :candidate
+ before_save :count_votes
- validates :first_name, :last_name, presence: true
- validates :email, presence: true, uniqueness: true
+ belongs_to :group
+ has_many :made_requests, class_name: 'Request', foreign_key: 'requester_id'
+ has_many :fulfilled_requests, class_name: 'Request', foreign_key: 'responder_id'
+ has_many :votes, foreign_key: 'candidate_id'
- def requests_in_last_24_hours
- conditions = { requester_id: id, created_at: (Time.now - 1.day..Time.now) }
- Request.where(conditions).count
- end
+ validates :first_name, :last_name, presence: true
+ validates :email, presence: true, uniqueness: true
- def count_votes
- total = self.votes.sum(:value)
- self.vote_count = total
- end
- end
+ def requests_in_last_24_hours
+ conditions = { requester_id: id, created_at: (Time.now - 1.day..Time.now) }
+ Request.where(conditions).count
+ end
+
+ def count_votes
+ total = self.votes.sum(:value)
+ self.vote_count = total
+ end
+end
|
Add a foreign_key option to the User model, specifying how to link
itself with the votes.
|
diff --git a/config/application.rb b/config/application.rb
index abc1234..def5678 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -25,6 +25,6 @@ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
- config.action_mailer.default_url_options = { host: 'yesl.info' }
+ config.action_mailer.default_url_options = { host: 'yesl.info', protocol: 'https' }
end
end
|
Use https as default URL protocol
|
diff --git a/Fingertips.podspec b/Fingertips.podspec
index abc1234..def5678 100644
--- a/Fingertips.podspec
+++ b/Fingertips.podspec
@@ -17,16 +17,6 @@
f.requires_arc = true
- f.documentation = {
- :appledoc => [
- '--project-company', 'Mapbox',
- '--docset-copyright', 'Mapbox',
- '--no-keep-undocumented-objects',
- '--no-keep-undocumented-members',
- '--ignore', '.m',
- ]
- }
-
f.framework = 'UIKit'
end
|
Delete the deprecated `documentation` attribute
|
diff --git a/core/test/fields/push_type/wysiwyg_field_test.rb b/core/test/fields/push_type/wysiwyg_field_test.rb
index abc1234..def5678 100644
--- a/core/test/fields/push_type/wysiwyg_field_test.rb
+++ b/core/test/fields/push_type/wysiwyg_field_test.rb
@@ -13,7 +13,7 @@
it { field.form_helper.must_equal :text_area }
it { field.toolbar.must_equal 'text' }
- it { field.html_options[:'froal-toobar'].must_equal 'text' }
+ it { field.html_options[:'froala-toolbar'].must_equal 'text' }
it { field.json_value.must_equal val }
it { field.value.must_equal val }
|
Fix typo in failing test.
|
diff --git a/jsrebuild.gemspec b/jsrebuild.gemspec
index abc1234..def5678 100644
--- a/jsrebuild.gemspec
+++ b/jsrebuild.gemspec
@@ -26,6 +26,5 @@
gem.executables = ['jsrebuild']
gem.require_path = 'lib'
- gem.files = Dir.glob("{bin,lib}/**/*") +
- %w(History.txt LICENSE README.md)
+ gem.files = `git ls-files`.split(/\s+/)
end
|
Use git-ls-files to list files in the gemspec.
|
diff --git a/LightRoute.podspec b/LightRoute.podspec
index abc1234..def5678 100644
--- a/LightRoute.podspec
+++ b/LightRoute.podspec
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "LightRoute"
- s.version = "2.1.8"
+ s.version = "2.1.9"
s.summary = "LightRoute is easy transition between view controllers and support many popylar arhitectures"
s.description = <<-DESC
LightRoute is easy transition between view controllers and support many popylar arhitectures. This framework very flow for settings your transition and have userfriendly API.
|
Update spec to version 2.1.9
|
diff --git a/lib/fog/compute/google/models/forwarding_rules.rb b/lib/fog/compute/google/models/forwarding_rules.rb
index abc1234..def5678 100644
--- a/lib/fog/compute/google/models/forwarding_rules.rb
+++ b/lib/fog/compute/google/models/forwarding_rules.rb
@@ -32,7 +32,7 @@ response = nil
if region
response = service.get_forwarding_rule(identity, region).to_h
- else
+ elsif identity
response = all(
:filter => "name eq #{identity}", :max_results => 1
).first
|
Fix logic to work with nil in get()
Fixes the following error:
Google::Apis::ClientError: invalid: Invalid value for field 'filter': 'name eq '. Invalid list filter expression.
|
diff --git a/bosh_cli/spec/unit/yaml_helper_spec.rb b/bosh_cli/spec/unit/yaml_helper_spec.rb
index abc1234..def5678 100644
--- a/bosh_cli/spec/unit/yaml_helper_spec.rb
+++ b/bosh_cli/spec/unit/yaml_helper_spec.rb
@@ -6,15 +6,11 @@ subject { Bosh::Cli::YamlHelper }
describe "#check_duplicate_keys" do
- context "when yaml contains anchors" do
+ context "when YAML contains aliases and anchors" do
it "does not raise an error" do
- subject.check_duplicate_keys("key1: &key1")
- end
- end
-
- context "when yaml contains aliases" do
- it "does not raise an error" do
- subject.check_duplicate_keys("key1: *key1")
+ expect {
+ subject.check_duplicate_keys("ccdb: &ccdb\n db_scheme: mysql\nccdb_ng: *ccdb")
+ }.not_to raise_error
end
end
end
|
Make duplicate key check test more robust
|
diff --git a/holidays.gemspec b/holidays.gemspec
index abc1234..def5678 100644
--- a/holidays.gemspec
+++ b/holidays.gemspec
@@ -17,8 +17,8 @@ gem.require_paths = ['lib']
gem.licenses = ['MIT']
gem.required_ruby_version = '~> 2.2'
- gem.add_development_dependency 'bundler'
- gem.add_development_dependency 'rake', '~> 12.0'
+ gem.add_development_dependency 'bundler', '~> 1.16'
+ gem.add_development_dependency 'rake', '~> 12'
gem.add_development_dependency 'simplecov', '~> 0.16'
gem.add_development_dependency 'test-unit', '~> 3.2'
gem.add_development_dependency 'mocha', '~> 1.7'
|
Set pessimistic version for bundler dev dependency so we stop getting warnings from rubygems
|
diff --git a/RSBarcodes.podspec b/RSBarcodes.podspec
index abc1234..def5678 100644
--- a/RSBarcodes.podspec
+++ b/RSBarcodes.podspec
@@ -1,6 +1,6 @@ Pod::Spec.new do |s|
s.name = "RSBarcodes"
- s.version = "0.0.6"
+ s.version = "0.0.7"
s.summary = "1D and 2D barcodes scanner and generators for iOS 7 with delightful controls."
s.homepage = "https://github.com/yeahdongcn/RSBarcodes"
s.license = { :type => 'MIT', :file => 'LICENSE.md' }
|
Update pod spec to 0.0.7
|
diff --git a/example_oaipmh.rb b/example_oaipmh.rb
index abc1234..def5678 100644
--- a/example_oaipmh.rb
+++ b/example_oaipmh.rb
@@ -4,14 +4,14 @@ $LOAD_PATH << File.dirname(__FILE__)
require 'lib/stash/harvester'
-list_records_config = Stash::Harvester::OAIPMH::OAIConfig.new(
+oai_config = Stash::Harvester::OAIPMH::OAIConfig.new(
oai_base_url: 'http://oai.datacite.org/oai',
metadata_prefix: 'oai_datacite',
set: 'REFQUALITY'
)
list_records_task = Stash::Harvester::OAIPMH::ListRecordsTask.new(
- config: list_records_config,
+ config: oai_config,
from_time: Time.utc(2013, 6, 1),
until_time: Time.utc(2013, 6, 30)
)
|
Rename variable to match class name
|
diff --git a/lib/jruby-visualizer/compiler_data.rb b/lib/jruby-visualizer/compiler_data.rb
index abc1234..def5678 100644
--- a/lib/jruby-visualizer/compiler_data.rb
+++ b/lib/jruby-visualizer/compiler_data.rb
@@ -0,0 +1,46 @@+require 'jrubyfx'
+
+class CompilerData
+ include JRubyFX
+
+ @@ir_builder = nil
+
+ attr_accessor :ast_root, :ir_scope
+ property_accessor :ruby_code
+
+ def self.parse(code)
+ JRuby.parse(code)
+ end
+
+ def self.create_ir_builder
+ ir_manager = JRuby::runtime.ir_manager
+ ir_manager.dry_run = true
+
+ builder =
+ if JRuby::runtime.is1_9?
+ org.jruby.ir.IRBuilder19
+ else
+ org.jruby.ir.IRBuilder
+ end
+ builder.new(ir_manager)
+ end
+
+ def self.build_ir(root_node)
+ unless @@ir_builder
+ @@ir_builder = create_ir_builder
+ end
+ @@ir_builder.build_root(root_node)
+ end
+
+ def initialize(ruby_code='')
+ @ruby_code = SimpleStringProperty.new(ruby_code)
+ @ast_root = reparse(@ruby_code)
+ @ir_scope = build_ir(@ast_root)
+ # bind change of Ruby code to reparsing an AST and building IR
+ ruby_code_property.add_change_listener do |new_code|
+ @ast_root = reparse(new_code)
+ @ir_scope = build_ir(@ast_root)
+ end
+ end
+
+end
|
Gather all compiler data into one object to enable traceability between
Ruby <-> AST <-> IR (without GUI)
This is the main model
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,6 +1,9 @@ Rails.application.routes.draw do
mount ActionCable.server => '/cable'
- mount Resque::Server.new, :at => "/resque"
+
+ authenticate :user do
+ mount Resque::Server.new, :at => "/resque"
+ end
devise_for :users
|
Add authenticate resque rack app with devise
|
diff --git a/config/boot.rb b/config/boot.rb
index abc1234..def5678 100644
--- a/config/boot.rb
+++ b/config/boot.rb
@@ -1,4 +1,17 @@ require 'rubygems'
+require 'rails/commands/server'
+
+# Set default binding to 0.0.0.0 to allow connections from everyone if
+# under development
+if Rails.env.development?
+ module Rails
+ class Server
+ def default_options
+ super.merge(Host: '0.0.0.0', Port: 3000)
+ end
+ end
+ end
+end
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
CONFIG: Set binding to 0.0.0.0 port 3000 on dev start
To allow connections to all developmental devices, including
mobile devices that want to connect.
|
diff --git a/config/solo.rb b/config/solo.rb
index abc1234..def5678 100644
--- a/config/solo.rb
+++ b/config/solo.rb
@@ -1,6 +1,7 @@ require 'pathname'
+require 'tmpdir'
root_dir = Pathname.new(File.expand_path("../../", __FILE__))
cookbook_path root_dir.join("cookbooks").to_s
-file_cache_path root_dir.join("cache").to_s
+file_cache_path Pathname.new(Dir.tmpdir).join("chef-cache").to_s
log_level :info
|
Use the system temp-dir for the file cache.
Since I'm using Vagrant to build VMs for linux installers and
VirtualBox SF don't support symlinks, I can't depend on the "cache"
dir in the source.
|
diff --git a/test/dummy/config/routes.rb b/test/dummy/config/routes.rb
index abc1234..def5678 100644
--- a/test/dummy/config/routes.rb
+++ b/test/dummy/config/routes.rb
@@ -1,11 +1,11 @@ Dummy::Application.routes.draw do
root to: "dummy#dummy"
- match "about" => "dummy#dummy", as: :about
- match "about/contact" => "dummy#dummy", as: :contact
- match "about/contact/form" => "dummy#dummy", as: :contact_form
+ get "about" => "dummy#dummy", as: :about
+ get "about/contact" => "dummy#dummy", as: :contact
+ get "about/contact/form" => "dummy#dummy", as: :contact_form
resources :projects do
resources :issues
end
-end+end
|
Replace `match` routing methods with `get` in dummy app
|
diff --git a/test/sg_mailer/base_test.rb b/test/sg_mailer/base_test.rb
index abc1234..def5678 100644
--- a/test/sg_mailer/base_test.rb
+++ b/test/sg_mailer/base_test.rb
@@ -5,7 +5,8 @@ class SendGridMailer < SGMailer::Base
template_id 'e0d26988-d1d7-41ad-b1eb-4c4b37125893'
def welcome_mail
- mail from: '[email protected]', to: '[email protected]'
+ mail from: '[email protected]',
+ to: '[email protected]'
end
end
|
Send those testing mails for real
|
diff --git a/lib/numbering.rb b/lib/numbering.rb
index abc1234..def5678 100644
--- a/lib/numbering.rb
+++ b/lib/numbering.rb
@@ -13,11 +13,7 @@
def generate_number
column = self.class.instance_variable_get(:'@numbering_parent_column')
- sql = <<-SQL
- SELECT MAX(number)
- FROM #{self.class.table_name}
- WHERE #{column}=#{send(column).to_i}
- SQL
- self.number = connection.select_value(sql).to_i + 1
+ max = self.class.where(column => send(column).to_i).maximum('number').to_i
+ self.number = max + 1
end
end
|
Use Rails methods for max number retrieval.
|
diff --git a/config/software/cabal-install.rb b/config/software/cabal-install.rb
index abc1234..def5678 100644
--- a/config/software/cabal-install.rb
+++ b/config/software/cabal-install.rb
@@ -0,0 +1,30 @@+name "cabal-install"
+default_version "1.20.0.1"
+
+dependency 'curl'
+
+cabal_install = ["/usr/bin/cabal install",
+ "--prefix=#{install_dir}/embedded",
+ "--extra-include-dirs=#{install_dir}/embedded/include",
+ "--extra-include-dirs=#{install_dir}/embedded/include/openssl",
+ "--extra-include-dirs=#{install_dir}/embedded/include/curl",
+ "--extra-lib-dirs=#{install_dir}/embedded/lib"].join(" ")
+
+cabal_sandbox = ["#{install_dir}/embedded/bin/cabal",
+ "sandbox --sandbox=#{install_dir}/embedded init"].join(" ")
+
+env = {
+ "CFLAGS" => ["-I#{install_dir}/embedded/include",
+ "-I#{install_dir}/embedded/include/openssl",
+ "-I#{install_dir}/embedded/include/curl"].join(" "),
+ "LDFLAGS" => "-L#{install_dir}/embedded/lib",
+ "LANG" => "en_US.UTF-8",
+ "PATH" => "#{install_dir}/embedded/bin:#{ENV["PATH"]}"
+}
+
+build do
+ command "rm -rf ~/.cabal ~/.ghc"
+ command "/usr/bin/cabal update"
+ command "#{cabal_install} cabal cabal-install==#{default_version}", :env => env
+ command "#{cabal_sandbox}", :env => env
+end
|
Install a newer version of cabal into the environment
This ensures that we don't have anything getting put into the system
accidentally. I also ran into odd issues with older versions of cabal.
|
diff --git a/lib/console_io.rb b/lib/console_io.rb
index abc1234..def5678 100644
--- a/lib/console_io.rb
+++ b/lib/console_io.rb
@@ -3,6 +3,14 @@ class ConsoleIO
attr_reader :input
attr_reader :output
+
+ # ANSI control sequences, see http://www.termsys.demon.co.uk/vtansi.htm
+ ANSI_BEGINNING_OF_LINE = "\e[H"
+ ANSI_ERASE_SCREEN = "\e[2J"
+
+ # Unicode control characters (ISO 6429), see https://en.wikipedia.org/wiki/C0_and_C1_control_codes
+ END_OF_TEXT = "\u0003" # CTRL-c
+ END_OF_TRANSMISSION = "\u0004" # CTRL-d
def initialize(input: STDIN, output: STDOUT)
@input = input
@@ -10,16 +18,13 @@ end
def clear_screen
- # ANSI control sequences, see http://www.termsys.demon.co.uk/vtansi.htm
- beginning_of_line = "\e[H"
- erase_screen = "\e[2J"
- print_text beginning_of_line + erase_screen
+ print_text("#{ANSI_BEGINNING_OF_LINE}#{ANSI_ERASE_SCREEN}")
end
def get_char
@input.getch.tap do |character|
- raise Interrupt if character == "\u0003"
- raise EOFError if character == "\u0004"
+ raise Interrupt if character == END_OF_TEXT
+ raise EOFError if character == END_OF_TRANSMISSION
end
end
|
Add some constants for the ANSI and unicode sequences
|
diff --git a/lib/daily_jobs.rb b/lib/daily_jobs.rb
index abc1234..def5678 100644
--- a/lib/daily_jobs.rb
+++ b/lib/daily_jobs.rb
@@ -21,6 +21,7 @@ PrincipalOverride.destroy_all
StudentComment.destroy_all
RailmailDelivery.destroy_all if defined?RailmailDelivery
+ puts "Reset Demo"
end
end
|
Add message to showup in cron email when clearing otu demo data
|
diff --git a/site-cookbooks/meta/recipes/osx_development.rb b/site-cookbooks/meta/recipes/osx_development.rb
index abc1234..def5678 100644
--- a/site-cookbooks/meta/recipes/osx_development.rb
+++ b/site-cookbooks/meta/recipes/osx_development.rb
@@ -15,3 +15,4 @@ include_recipe "wel-osx-apps::tmux"
include_recipe "wel-osx-apps::wemux"
include_recipe "wel-osx-apps::reattach-to-user-namespace"
+include_recipe "wel-osx-apps::nmap"
|
Add nmap to osx development
This commit adds nmap to the osx development recipe.
|
diff --git a/spec/models/concerns/has_ref_spec.rb b/spec/models/concerns/has_ref_spec.rb
index abc1234..def5678 100644
--- a/spec/models/concerns/has_ref_spec.rb
+++ b/spec/models/concerns/has_ref_spec.rb
@@ -4,13 +4,13 @@
describe HasRef do
describe '#branch?' do
- let(:pipeline) { create(:ci_pipeline) }
+ let(:build) { create(:ci_build) }
- subject { pipeline.branch? }
+ subject { build.branch? }
context 'is not a tag' do
before do
- pipeline.tag = false
+ build.tag = false
end
it 'return true when tag is set to false' do
@@ -20,7 +20,7 @@
context 'is not a tag' do
before do
- pipeline.tag = true
+ build.tag = true
end
it 'return false when tag is set to true' do
@@ -30,10 +30,10 @@ end
describe '#git_ref' do
- subject { pipeline.git_ref }
+ subject { build.git_ref }
context 'when tag is true' do
- let(:pipeline) { create(:ci_pipeline, tag: true) }
+ let(:build) { create(:ci_build, tag: true) }
it 'returns a tag ref' do
is_expected.to start_with(Gitlab::Git::TAG_REF_PREFIX)
@@ -41,7 +41,7 @@ end
context 'when tag is false' do
- let(:pipeline) { create(:ci_pipeline, tag: false) }
+ let(:build) { create(:ci_build, tag: false) }
it 'returns a branch ref' do
is_expected.to start_with(Gitlab::Git::BRANCH_REF_PREFIX)
@@ -49,7 +49,7 @@ end
context 'when tag is nil' do
- let(:pipeline) { create(:ci_pipeline, tag: nil) }
+ let(:build) { create(:ci_build, tag: nil) }
it 'returns a branch ref' do
is_expected.to start_with(Gitlab::Git::BRANCH_REF_PREFIX)
|
Use build for testing HasRef
|
diff --git a/lib/rack/alive.rb b/lib/rack/alive.rb
index abc1234..def5678 100644
--- a/lib/rack/alive.rb
+++ b/lib/rack/alive.rb
@@ -2,7 +2,6 @@
module Rack
class Alive
- # Your code goes here...
def initialize(app, conditional_block = nil)
@app, @path, @conditional_block = app, "/alive", conditional_block
|
Remove placeholder comment. =S [ci skip]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.