This file contains 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 Etcd < Formula | |
desc "Key value store for shared configuration and service discovery" | |
homepage "https://github.com/coreos/etcd" | |
url "https://github.com/coreos/etcd/archive/v3.1.7.tar.gz" | |
sha256 "41cbfc6744c76aa1735e11c82e6f6ff03c88dc88810938cf6eb80930dc994b2a" | |
head "https://github.com/coreos/etcd.git" | |
depends_on "go" => :build | |
def install |
This file contains 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
Ember.Route.reopen({ | |
activate: function() { | |
var cssClass = this.toCssClass(); | |
// you probably don't need the application class | |
// to be added to the body | |
if (cssClass !== 'application') { | |
Ember.$('body').addClass(cssClass); | |
} | |
}, | |
deactivate: function() { |
This file contains 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
import ApplicationAdapter from './application'; | |
import UrlTemplates from "ember-data-url-templates"; | |
export default ApplicationAdapter.extend(UrlTemplates, { | |
updateRecordUrlTemplate: '{+host}/posts/{id}{/updateEndpoint}', | |
urlSegments: { | |
updateEndpoint(type, id, snapshot) { | |
return snapshot.get('_updateEndpoint'); | |
} |
This file contains 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
import ApplicationAdapter from './application'; | |
import UrlTemplates from "ember-data-url-templates"; | |
export default ApplicationAdapter.extend(UrlTemplates, { | |
updateRecordUrlTemplate: '{+host}/posts/{id}{/updateEndpoint}', | |
urlSegments: { | |
updateEndpoint(type, id, snapshot) { | |
return snapshot.get('_updateEndpoint'); | |
} |
This file contains 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
import Ember from "ember"; | |
import DS from "ember-data"; | |
export default DS.Model.extend({ | |
// Your ED relationships and properties here... | |
// ... | |
// Custom API | |
upvote() { | |
this.set('_updateEndpoint', 'upvote'); |
This file contains 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
import ApplicationAdapter from './application'; | |
import UrlTemplates from "ember-data-url-templates"; | |
export default ApplicationAdapter.extend(UrlTemplates, { | |
queryUrlTemplate: '{+host}/posts/{endpoint}', | |
urlSegments: { | |
endpoint(type, id, snapshot, query) { | |
// we're extracting the endpoint from the query object... | |
let ep = query.endpoint; |
This file contains 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
import ApplicationAdapter from './application'; | |
import Ember from 'ember'; | |
import UrlTemplates from "ember-data-url-templates"; | |
const get = Ember.get; | |
export default ApplicationAdapter.extend(UrlTemplates, { | |
adapterContext: Ember.service.inject(), | |
queryUrlTemplate: Ember.computed('adapterContext.{company,organization}', function() { |
This file contains 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
// adapters/comment.js | |
import ApplicationAdapter from './application'; | |
import Ember from 'ember'; | |
import UrlTemplates from "ember-data-url-templates"; | |
export default ApplicationAdapter.extend(UrlTemplates, { | |
urlTemplate: "{+host}/posts/{postId}/comments{/id}", | |
adapterContext: Ember.inject.service(), |
This file contains 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
import Ember from 'ember'; | |
export default Ember.Service.extend({ | |
// Properties | |
post: null, | |
aParentObject: null, | |
anotherParentObject: null, | |
// API | |
setContext(obj = {}) { |
This file contains 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
import UrlTemplates from "ember-data-url-templates"; | |
export default DS.RESTAdapter.extend(UrlTemplates, { | |
urlTemplate: '{+host}/posts/{postId}/comments{/id}', | |
findUrlTemplate: '{+host}/comments/{id}', | |
createRecordUrlTemplate: '{+host}/users/{userId}/comments', | |
currentUser: Ember.inject.service(), | |
urlSegments: { |
NewerOlder