Author: Michel Felipe
-
Download and install latest mono runtime. Follow the instructions here: Install mono on Debian, Ubuntu, and derivatives
-
Clone the latest version from MonoDevelop github repo.
git clone git@github.com:mono/monodevelop.git| /** | |
| * Creates a dynamic instance of a specific class/prototype. | |
| * Minor changes from initial solution shared by **Steve Fenton** | |
| * | |
| * WARNING: This solution don't works on Angular applications, | |
| * using JIT (because the webpack don't compiles classes into window object) | |
| * or AOT (js minification for production build) compilation. | |
| * | |
| * @see https://www.stevefenton.co.uk/2014/07/creating-typescript-classes-dynamically/ | |
| */ |
| /** | |
| * Custom task to copy all dependencies declared in you .gradle file | |
| * to "libs" folder. If their dependencies contains .jar files, this will be released | |
| * on aar or .jar final file of your project. | |
| */ | |
| task copyLibs(type: Copy) { | |
| from configurations.compile | |
| into 'libs' | |
| } |
| /** | |
| * Typescript dynamic class method example | |
| * | |
| * REFERENCES: | |
| * @see https://www.typescriptlang.org/docs/handbook/declaration-merging.html | |
| * @see https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Mixins.md | |
| * @see http://blog.brillskills.com/2013/09/exploring-javascript-prototypes-via-typescripts-class-pattern | |
| * @see https://github.com/Microsoft/TypeScript/wiki/%27this%27-in-TypeScript | |
| * | |
| * For this example, using IONIC 2/3 Toast component to override a method |
| import { DebugElement, Type } from "@angular/core"; | |
| import { Predicate } from "@angular/core/src/facade/collection"; | |
| import { TestBed, ComponentFixture } from '@angular/core/testing'; | |
| import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing'; | |
| import { App, MenuController, NavController, Platform, Config, Keyboard, GestureController, Form, IonicModule } from 'ionic-angular'; | |
| import { mockNavController, mockPlatform } from 'ionic-angular/util/mock-providers'; | |
| import { ConfigMock, MenuControllerMock, KeyboardMock, GestureControllerMock, FormMock } from './mocks'; | |
| /** | |
| * @ngdoc object |
| describe('npm validation logic (inquirer `when` function)', function () { | |
| beforeEach(function () { | |
| askName2 = proxyquire('../lib', { | |
| 'npm-name': function(name){ | |
| return Promise.resolve(name == 'yo'); | |
| } | |
| }); | |
| it('ask question if npm name is taken', function (done) { | |
| this.inquirer.prompt.returns(Promise.resolve({name:'yo'})); |
Author: Michel Felipe
Download and install latest mono runtime. Follow the instructions here: Install mono on Debian, Ubuntu, and derivatives
Clone the latest version from MonoDevelop github repo.
git clone git@github.com:mono/monodevelop.git| source 'https://rubygems.org' | |
| gem 'rspec', require: false, group: :test | |
| gem 'simplecov', require: false, group: :test |
Here you will find examples of modules in ruby code. The structure is strong, very important and commonly used by ruby developers! Modules can be used like namespaces or mixins (adds new methods to a class).
In ruby code it's common see something like this:
MyModule::MyClassThe character :: is a namespace separator. A dot '.' can be used to, but it's not recommended.
| class MyModel < ActiveRecord::Base | |
| attr_acessible :name, :value, :role_id | |
| # Another strategy: multiple conditions with | |
| # multiple ActiveRecord::Relation#where() method calls | |
| def recipients(offset=0, limit=100, data = {}) | |
| result = self.order(:id).offset(offset).limit(limit).where('value IS ?', nil) |