Archivi categoria: Dynamic Programming Language

RoR 4.1.0 beta 1 released!

ror

E’ Natale e il regalo di quest’anno è l’anteprima di Ruby On Rails 4.1

Spring Application Preloader

Spring velocizza lo sviluppo mantenendo l’applicazione in esecuzione in background,  evitando di riavviarla ogni volta che dovete eseguire un task di rake, una migrazione oppure un test.

config/secrets.yml

Questo files, che di default memorizza il parametro secret_key_base dell’applicazione, può essere utilizzato anche per memorizzare le chiavi di accesso per altre API externe.

Per esempio possiamo mantenere l’access key dei web services amazon

development:
  secret_key_base: 3b7cd727ee24e8444053437c36cc66c3
    aws_access_key: 09876543212345678
ed accedervi quando necessario nell’applicazione
aws_acc_key = Rails.application.secrets.aws_access_key

Action Pack Variants

I request variant  sono una specializzazione dei request format
che consentono di effettuare render differenziati in base al dispositivo da cui avviene la richiesta:

respond_to do |format|
    format.js      { ...... }
    format.desktop    { ....... }
    format.phone  { ....... }
    format.tablet   { ....... }
end

il variant deve essere impostato in una before_action

request.variant = :tablet if request.user_agent =~ /iPad/

Action Mailer Previews

Visitando uno speciale url è possibile visualizzare in anteprima l’aspetto delle email prodotto dall’Action Mailer.

Active Record Enums

Ora è possibile associare dei nomi ai valori numerici di un campo intero di una tabella.
Class Invoice < ActiveRecord::Base
        enum status: [ :suspended, :active, :payed ]
end

if status.payed? ......
………….. prosegue nel prossimo articolo …………..

Dynamic programming language

From Wikipedia, the free encyclopedia

 

Dynamic programming language is a term used broadly in computer science to describe a class of high-level programming languages that, at runtime, execute many common behaviors that other languages might perform during compilation. These behaviors could include extension of the program, by adding new code, by extending objects and definitions, or by modifying the type system, all during program execution. These behaviors can be emulated in nearly any language of sufficient complexity, but dynamic languages provide direct tools to make use of them. Many of these features were first implemented as native features in the Lisp programming language.

Most dynamic languages are also dynamically typed, but not all are. Dynamic languages can be (but not always) frequently referred to as “scripting languages“, though that article narrowly refers to languages specific to a given environment.