This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'fileutils' | |
new_path = '/home/valachi/ruby/new_uploads' | |
old_path = '/home/valachi/ruby/uploads' | |
[new_path, old_path].each do |path| | |
Dir.mkdir(path) unless Dir.exists?(path) | |
23.times do |i| | |
Dir.mkdir("#{path}/#{i}") unless File.exists?("#{path}/#{i}") | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'fileutils' | |
new_path = '/home/valachi/ruby/new_uploads' | |
old_path = '/home/valachi/ruby/uploads' | |
[new_path, old_path].each do |path| | |
Dir.mkdir(path) unless Dir.exists?(path) | |
23.times do |i| | |
Dir.mkdir("#{path}/#{i}") unless File.exists?("#{path}/#{i}") | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def save_info! | |
imdb_show ||= Imdb::TvShow.new(show.imdb_id) | |
if imdb_show && imdb_show.title.downcase == show.title.downcase && imdb_show.is_a_tvshow? | |
self.title = imdb_show.season(season).episode(number.to_i).title | |
self.airdate = imdb_show.season(season).episode(number.to_i).airdate | |
self.plot = imdb_show.season(season).episode(number.to_i).plot | |
else | |
self.info_status = 'Error with imdb_show' | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def save_info! | |
imdb_show ||= Imdb::TvShow.new(show.imdb_id) | |
if imdb_show && imdb_show.title.downcase == show.title.downcase && imdb_show.is_a_tvshow? | |
self.title = imdb_show.season(season).episode(number.to_i).title | |
self.airdate = imdb_show.season(season).episode(number.to_i).airdate | |
self.plot = imdb_show.season(season).episode(number.to_i).plot | |
else | |
self.info_status = 'Error with imdb_show' | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def save_info! | |
imdb_show ||= Imdb::TvShow.new(show.imdb_id) | |
if imdb_show && imdb_show.title.downcase == show.title.downcase && imdb_show.is_a_tvshow? | |
self.title = imdb_show.season(season).episode(number.to_i).title | |
self.airdate = imdb_show.season(season).episode(number.to_i).airdate | |
self.plot = imdb_show.season(season).episode(number.to_i).plot | |
else | |
self.info_status = 'Error with imdb_show' | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.navbar-inverse | |
.nav | |
.li | |
.active | |
color: blue | |
a | |
text-decoration: none |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.navbar-inverse | |
.nav | |
li | |
стили для просто ли | |
li.active | |
стили для активного ли | |
a | |
стили для ссылки, которая внутри ли | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.navbar-inverse | |
.nav | |
li | |
стили для просто ли | |
a | |
стили для ссылки, которая внутри ли | |
li.active | |
стили для активного ли |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Stweie | |
ALLOWED_METHODS = [:methods, :method, :why] | |
def hello | |
'Hello' | |
end | |
class_eval do | |
def why |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Stweie | |
ALLOWED_METHODS = [:methods, :method, :why] | |
def hello | |
'Hello' | |
end | |
instance_methods.each do |method| | |
undef_method method unless method_belongs?(method) |