golf 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/golf/cli.rb CHANGED
@@ -29,6 +29,12 @@ module Golf
29
29
  def compile(dir)
30
30
  Golf::Compiler.compile!
31
31
  end
32
+
33
+ desc "version", "Output the version number"
34
+ def version
35
+ puts Golf::VERSION
36
+ end
37
+
32
38
 
33
39
  end
34
40
 
data/lib/golf/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Golf
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
data/lib/golf.rb CHANGED
@@ -2,6 +2,6 @@ require "json"
2
2
  require "golf/compiler"
3
3
  require "golf/rack"
4
4
  require "golf/cli"
5
-
5
+ require "golf/version"
6
6
 
7
7
 
@@ -1,6 +1,3 @@
1
1
  source "http://rubygems.org"
2
2
 
3
- gem 'rack'
4
- gem 'rack-contrib'
5
- gem 'rack-rewrite'
6
3
  gem 'golf'
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ gem 'golf'
4
+ gem 'sinatra'
@@ -0,0 +1,16 @@
1
+ <div>
2
+ <style type="text/golf">
3
+ </style>
4
+ <script type="text/golf">
5
+ function() {
6
+ var fetch_number = function(){ $.get('/random-api-method', {}, function(data){ $("#result").text(data); }) };
7
+
8
+ fetch_number();
9
+ $("#generator_btn").click(fetch_number);
10
+
11
+ }
12
+ </script>
13
+ <button id="generator_btn">Ask for a random number</button>
14
+ <div id="result"></div>
15
+
16
+ </div>
@@ -0,0 +1,8 @@
1
+ require 'rubygems'
2
+ require 'golf'
3
+ require 'sinatra'
4
+ require './demo'
5
+
6
+ use DemoBackend
7
+ run Golf::Rack.new
8
+
@@ -0,0 +1,7 @@
1
+ $.golf.controller = [
2
+ { route: ".*",
3
+ action: function(container, params) {
4
+ container.empty().append(new Component.RandomNumber());
5
+ }
6
+ }
7
+ ];
@@ -0,0 +1,7 @@
1
+ class DemoBackend < Sinatra::Application
2
+
3
+ get '/random-api-method' do
4
+ rand(52430234).to_s
5
+ end
6
+
7
+ end
File without changes
File without changes
File without changes
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: golf
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.0
5
+ version: 0.2.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Micha Niskin, Alan Dipert, Julio Capote
@@ -80,6 +80,14 @@ files:
80
80
  - templates/new/plugins/mylib.js
81
81
  - templates/new/scripts/00-myscript.js
82
82
  - templates/new/styles/main.css
83
+ - templates/sinatra/Gemfile
84
+ - templates/sinatra/components/RandomNumber/RandomNumber.html
85
+ - templates/sinatra/config.ru
86
+ - templates/sinatra/controller.js
87
+ - templates/sinatra/demo.rb
88
+ - templates/sinatra/plugins/mylib.js
89
+ - templates/sinatra/scripts/00-myscript.js
90
+ - templates/sinatra/styles/main.css
83
91
  - templates/twitter/404.txt
84
92
  - templates/twitter/Gemfile
85
93
  - templates/twitter/components/golf/twitter/Search/Search.html