Skip to content

Commit d1bfb08

Browse files
committed
Add ruby microservice code snippet on homepage
1 parent f3a7ff7 commit d1bfb08

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

app/controllers/main.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
import Controller from '@ember/controller';
22

33
export default class MainController extends Controller {
4+
rubyMirrorSettings = {
5+
lineNumbers: true,
6+
mode: 'ruby'
7+
};
8+
rubyMirrorValue=
9+
`get '/hello/' do
10+
counter = query( "SELECT COUNT (*) as ?counter" +
11+
"WHERE {" +
12+
" ?s ?p ?o." +
13+
"}" ).first[:counter].to_i
14+
status 200
15+
{ value: counter }.to_json
16+
end`;
417
codemirrorSettings={
518
lineNumbers: true,
619
mode: 'javascript'

app/templates/main.hbs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<p class="header">Based on open standards</p>
2828
<p class="body">
2929
Semantic.works envisions an open internet. <br>
30-
It depends on open standards used in modern web application development such as REST, JSONAPI and SPARQL. All tools and components are open source and available to the community. Introducing vendor lock-in is not the ambition at all.
30+
It depends on open standards used in modern web application development such as HTTP, JSONAPI and SPARQL. All tools and components are open source and available to the community. Introducing vendor lock-in is not the ambition at all.
3131
</p>
3232
</div>
3333
</div>
@@ -120,8 +120,8 @@
120120
<div class="pure-g">
121121
<div class="pure-u-1-2">
122122
<div class="sw-info">
123-
<p class='sw-file-path'>something/other.file</p>
124-
<IvyCodemirror @value={{this.codemirrorValue}} @options={{this.codemirrorSettings}}/>
123+
<p class='sw-file-path'>count-service/web.rb</p>
124+
<IvyCodemirror @value={{this.rubyMirrorValue}} @options={{this.rubyMirrorSettings}}/>
125125
</div>
126126
</div>
127127
<div class="pure-u-1-2">

ember-cli-build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const EmberApp = require('ember-cli/lib/broccoli/ember-app');
55
module.exports = function(defaults) {
66
let app = new EmberApp(defaults, {
77
codemirror: {
8-
modes: ['javascript']
8+
modes: ['javascript', 'ruby']
99
}
1010
// Add options here
1111
});

0 commit comments

Comments
 (0)