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
[shingara@hello ] % rake -T | |
(in /home/shingara/programmation/ruby/datamapper/do/data_objects) | |
no GEM_SPEC is found or defined. 'release' task cannot work without it. | |
rake aborted! | |
no such file to load -- rubygems/package_task | |
(See full trace by running task with --trace) | |
!1! [shingara@hello ] % git log -2 | |
commit acf60265831890b61205db130ad2af7ffbd96c1c |
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
next > GEM_HOME=~/prog/ruby/gem_datamapper rake spec | |
(in /Users/Cyril/prog/ruby/dm-core) | |
Could not connect to the database using "sqlite3::memory:" because: #<Gem::LoadError: RubyGem version error: do_sqlite3(0.9.11 not ~> 0.9.12) | |
> | |
Could not connect to the database using "mysql://root@localhost/dm_core_test" because: #<Gem::LoadError: Could not find RubyGem do_mysql (~> 0.9.12) | |
> | |
Finished in 0.02609 seconds |
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
describe 'handle 2 DNS NOTIFY message' do | |
before(:each) do | |
Multilog::SlaveZones.any_instance.expects(:authorized?).returns(true).twice | |
stdout_file = File.open(File.join(@test_root, 'stdout.log'), 'w+') | |
IO.expects(:popen).with('multilog t ./main', 'w').returns(stdout_file) | |
STDIN.expects(:gets).times(4).returns(*TINYDNS_LOG_SAMPLE[3..5]).then.returns(false) | |
Multilog::App.any_instance.expects(:system).times(4) |
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
Personne = {masculin, "Pierre", 32}. | |
%{masculin,"Pierre",32} | |
Personne2 = {feminin, "Lucie", 22}. | |
%{feminin,"Lucie",22} | |
%{masculin, Prenom, Age} = Personne. | |
%{feminin, Prenom, Age} = Personne2. | |
%{masculin,"Pierre",32} | |
%Prenom. | |
%"Pierre" |
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
-module(sexe). | |
-export([sexe/1]). | |
sexe(Personn) -> | |
case Personn of | |
{masculin, Prenom, Age} -> | |
Prenom ++ " est un homme de " ++ integer_to_list(Age) ++ " ans"; | |
{feminin, Prenom, Age} -> | |
Prenom ++ " est une femme de " ++ integer_to_list(Age) ++ " ans" |
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 'rubygems' | |
gem 'addressable', '2.0.1' | |
gem 'data_objects', '0.10.0' | |
gem 'do_sqlite3', '0.10.0' | |
gem 'dm-core', '0.10.0' | |
require 'dm-core' | |
class Post | |
include DataMapper::Resource |
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 'rubygems' | |
gem 'addressable', '2.0.1' | |
gem 'data_objects', '0.10.0' | |
gem 'do_sqlite3', '0.10.0' | |
gem 'dm-core', '0.10.0' | |
require 'dm-core' | |
class Post | |
include DataMapper::Resource |
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
Postgresql | |
Schema : | |
typo_tests=# \d contents | |
Table « public.contents » | |
Colonne | Type | Modificateurs | |
----------------+-----------------------------+------------------------------------------------------- | |
id | integer | not null default nextval('contents_id_seq'::regclass) | |
type | character varying(255) | |
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
#!/usr/bin/env ruby | |
%w[rubygems sinatra jsmin cssmin].each{|l| require l} | |
configure :development do | |
set :js_proc, proc {|f| "\n/* '#{f}' */\n" + File.read(f)} | |
set :css_proc, proc {|f| "\n/* '#{f}' */\n" +File.read(f)} | |
end | |
configure :production do | |
set :js_proc, | |
proc{|f|"/* '#{File.basename(f)}' */\n" + JSMin.minify(File.read(f))} |
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 Comment | |
include MongoMapper::Document | |
def self.from_configuration(configuration_id) | |
@@variable_keys ||= [] | |
conf = Configuration.find(configuration_id) | |
connect_to_database(conf) |