Skip to content

Instantly share code, notes, and snippets.

View stefanoverna's full-sized avatar

Stefano Verna stefanoverna

View GitHub Profile
require 'spec_helper'
require "cancan/matchers"
describe Ability do
let(:article) { Factory.build(:article) }
let(:reserved_article) { Factory.build(:article, :reserved => true) }
context "on backend" do
subject { Ability.new(user, :admin) }
+-----------+-------------+---------+----------------------------+----------+-------+-------+
| Wednesday 05/02/12 - 10 hours |
+-----------+-------------+---------+----------------------------+----------+-------+-------+
| Context | Project | Issue # | Description | Duration | From | To |
+-----------+-------------+---------+----------------------------+----------+-------+-------+
| @cantiere | +giunti-web | | Layout homepage e contatti | 2 hours | 08:10 | 10:18 |
| @cantiere | +giunti-web | | Import DB | 8 hours | 10:18 | 18:30 |
+-----------+-------------+---------+----------------------------+----------+-------+-------+
+-----------+-------------+---------+--------------------+----------+-------+-------+
@stefanoverna
stefanoverna / global_settings.rb
Created May 9, 2012 07:35
ActiveAttr on Railsyard
class GlobalSettings
include ActiveAttr::Model
def self.instance
@instance ||= self.new
end
def self.i18n_scope
"activerecord"
end
it:
# Qui ci stanno le traduzioni dei modelli
# E tutti gli attributi particolari per ogni modello
activerecord:
models:
what_we_do_page: "Cosa Facciamo"
contact_us_page: "Contattaci"
homepage_settings: "Homepage"
homepage_slide:
@stefanoverna
stefanoverna / Gemfile
Created June 5, 2012 23:39
Traccia Talk
source :rubygems
gem 'command_line_reporter'
gem 'json'
gem 'googl'
gem 'rest-client', require: 'rest_client'
gem 'launchy'
@stefanoverna
stefanoverna / .document
Created June 5, 2012 23:41
Prima implementazione
-
ChangeLog.md
LICENSE.txt
@stefanoverna
stefanoverna / .document
Created June 5, 2012 23:45
Seconda implementazione
-
ChangeLog.md
LICENSE.txt
nel modello:
class Page < ActiveRecord
has_image :image
has_image :featured_image
has_gallery :gallery
has_gallery :secondary_gallery
end
{
"23551": {
"1": {
"14": {
"2013-01-09": {
"application": "Alfa InfoMobile",
"appstore": "Apple App Store",
"country": "Italy",
"date": "2013-01-09",
"metric": "One-Off Downloads",
#!/usr/bin/env ruby
# vim: ft=ruby:
require "yaml"
class YAMLator
attr_reader :hash
def initialize(data=nil, preamble=nil)