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
| → tar -h | |
| tar(bsdtar): manipulate archive files | |
| First option must be a mode specifier: | |
| -c Create -r Add/Replace -t List -u Update -x Extract | |
| Common Options: | |
| -b # Use # 512-byte records per I/O block | |
| -f <filename> Location of archive | |
| -v Verbose | |
| -w Interactive | |
| Create: tar -c [options] [<file> | <dir> | @<archive> | -C <dir> ] |
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
| λ git develop → paster serve development.ini | |
| Traceback (most recent call last): | |
| File "/usr/bin/paster", line 9, in <module> | |
| load_entry_point('PasteScript==1.7.5', 'console_scripts', 'paster')() | |
| File "/usr/lib/python2.7/site-packages/paste/script/command.py", line 93, in run | |
| commands = get_commands() | |
| File "/usr/lib/python2.7/site-packages/paste/script/command.py", line 135, in get_commands | |
| plugins = pluginlib.resolve_plugins(plugins) | |
| File "/usr/lib/python2.7/site-packages/paste/script/pluginlib.py", line 82, in resolve_plugins | |
| pkg_resources.require(plugin) |
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
| # option 1 | |
| info = CustomInfo.new(:keyname => params[:keyname], :value => params[:value]) | |
| info.informable = @informable | |
| info.save! | |
| # option 2 | |
| CustomInfo.create!(:keyname => params[:keyname], | |
| :value => params[:value], | |
| :informable_type => params[:informable_type], | |
| :informable_id => params[:informable_id] |
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
| hesperus ~ → rpm -qa | grep java | |
| tzdata-java-2012j-1.fc18.noarch | |
| java-1.7.0-openjdk-1.7.0.9-2.3.5.fc18.1.x86_64 | |
| javapackages-tools-0.9.1-1.fc18.noarch | |
| hesperus ~ → rpm -qa | grep tea | |
| icedtea-web-1.3.1-3.fc18.x86_64 |
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
| FactoryGirl.define do | |
| factory :content_view_environment do | |
| sequence(:name) { |n| "Database#{n}" } | |
| sequence(:cp_id) { |n| "#{n}-123"} | |
| content_view | |
| end | |
| end | |
| FactoryGirl.define do | |
| factory :content_view_environment do |
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
| factory :user do | |
| username "partha" | |
| real_name "Partha Aji" | |
| trait :admin do | |
| username "admin" | |
| end | |
| end | |
| FactoryGirl.create(:user) # <User username: partha real_name: Partha Aji> |
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 ContentViewDefinitionBase < ActiveRecord::Base | |
| belongs_to :organization, :inverse_of => :content_view_definitions | |
| has_many :content_view_definition_products, :foreign_key => "content_view_definition_id" | |
| has_many :products, :through => :content_view_definition_products has_many :content_view_definition_repositories, :foreign_key => "content_view_definition_id" | |
| has_many :repositories, :through => :content_view_definition_repositories | |
| validates :organization, :presence => true | |
| 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
| class Distributor | |
| belongs_to :environment | |
| # ... | |
| validate name_uniq_in_org | |
| def name_uniq_in_org | |
| others = self.where(:name => self.name).join(:environment). | |
| where("enivronment.organization_id" => self.environment.organization_id) | |
| others.where("id != ?", self.id) if self.id | |
| errors.add(:base, "name already taken") if others.any? |
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
| parameters = {:units => [ | |
| { | |
| :name => "wat", | |
| :blah => "ok" | |
| }, | |
| { | |
| :name => "foo", | |
| :max_version => 2 | |
| } | |
| ]} |
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
| Easiest to hardest: | |
| 0. Show all content views and show an error if they select an env that doesn't have the view or a view not in the environment | |
| 1. Show an error if they select an environment that doesn't have the content view but limit views by environment | |
| 2. Unselect content view if they select an environment, limit content views by environment |