Replace IRB with Pry (in your Gemfile) and Byebug with pry-byebug
.
gem 'pry-rails', group: [:development, :test]
gem 'pry-byebug', group: [:development, :test]
# add the current directories /lib and /spec directories to the path if they exist | |
Pry.config.hooks.add_hook(:before_session, :load_path) do | |
dir = `pwd`.chomp | |
%w(lib spec test).map{ |d| "#{dir}/#{d}" }.each { |p| $: << p unless !File.exist?(p) || $:.include?(p) } | |
end |
.pi@session_cont | |
.pi-select.pi data-on-changed="@host.date.text(@this.selected_record().dates)" | |
... | |
ul.list | |
li.item data-id="#{@id}" data-dates="#{@period}" | |
... | |
.pi.date@date |
= nested_form_for answer, remote: true, ... do |f| | |
... | |
= f.fields_for :attachments do |attachment_form| | |
- if attachment_form.object.file.present? | |
p = attachment_form.object.file.identifier | |
- else | |
= attachment_form.label :file | |
= attachment_form.file_field :file | |
= attachment_form.link_to_remove "Remove this file" | |
= f.link_to_add "Add file", :attachments |
unless File.exist?('Gemfile') | |
File.write('Gemfile', <<-GEMFILE) | |
source 'https://rubygems.org' | |
gem 'rubocop', github: 'bbatsov/rubocop' | |
GEMFILE | |
system 'bundle' | |
end | |
require 'bundler' |
# Auhtorize any record to any policy | |
def authorize_with(klass, record, query = nil) | |
query ||= "#{action_name}?".to_sym | |
@_pundit_policy_authorized = @_policy_authorized = true # two vars for forward compatibility | |
policy = klass.new(pundit_user, record) | |
unless policy.public_send(query) | |
error = Pundit::NotAuthorizedError.new("not allowed to #{query} this #{record}") | |
error.query = query | |
error.record = record | |
error.policy = policy |
begin | |
require 'bundler/inline' | |
rescue LoadError => e | |
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler' | |
raise e | |
end | |
gemfile(true) do | |
source 'https://rubygems.org' | |
gem 'arel', github: 'rails/arel' |
begin | |
require 'bundler/inline' | |
rescue LoadError => e | |
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler' | |
raise e | |
end | |
gemfile(true) do | |
source 'https://rubygems.org' | |
gem 'arel', github: 'rails/arel' |
begin | |
require 'bundler/inline' | |
rescue LoadError => e | |
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler' | |
raise e | |
end | |
gemfile(true) do | |
source 'https://rubygems.org' | |
gem 'rack', github: "rack/rack" |
Pusher = fun(Client, Name, Size) -> F = fun(_, _, _, _, 0) -> io:format('done'); (Fun, C, N, I, Size) -> Segment = "../dash-examples/"++N++integer_to_list(I)++".m4s", io:format("Segment: ~s~n", [Segment]), {ok, B} = file:read_file(Segment), de_client:send(C, {binary, B}), timer:sleep(500), Fun(Fun, C, N, I+1, Size - 1) end, InitName = "../dash-examples/"++Name++"init.mp4", io:format("Init file: ~s~n", [InitName]), {ok, I} = file:read_file(InitName), de_client:send(Client, {binary, I}), timer:sleep(1500), F(F, Client, Name, 1, Size) end. |