golf 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/golf/cli.rb +7 -1
- data/lib/golf/rack.rb +2 -4
- data/lib/golf/version.rb +1 -1
- data/templates/raw/golfapp/components/HelloWorld/HelloWorld.html +13 -0
- data/templates/raw/golfapp/controller.js +7 -0
- data/templates/raw/golfapp/plugins/mylib.js +0 -0
- data/templates/raw/golfapp/scripts/00-myscript.js +0 -0
- data/templates/raw/golfapp/styles/main.css +0 -0
- data/templates/twitter/golfapp/components/golf/twitter/Tweet/Tweet.html +2 -2
- data/templates/twitter/golfapp/controller.js +1 -1
- metadata +6 -1
data/lib/golf/cli.rb
CHANGED
@@ -11,7 +11,7 @@ module Golf
|
|
11
11
|
File.expand_path("../../../", __FILE__)
|
12
12
|
end
|
13
13
|
|
14
|
-
desc "new [NAME] (optional)[TEMPLATE]", "Creates new golf app, takes NAME and optionally TEMPLATE"
|
14
|
+
desc "new [NAME] (optional)[TEMPLATE]", "Creates new, rack-based golf app, takes NAME and optionally TEMPLATE [twitter, sinatra]"
|
15
15
|
def new(name, template = false)
|
16
16
|
unless template
|
17
17
|
directory("templates/new", name)
|
@@ -20,6 +20,12 @@ module Golf
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
+
desc "raw", "Dumps a raw hello world golfapp into current dir"
|
24
|
+
def raw
|
25
|
+
directory("templates/raw", "golfapp")
|
26
|
+
end
|
27
|
+
|
28
|
+
|
23
29
|
desc "server", "Run the golf app"
|
24
30
|
def server
|
25
31
|
`rackup`
|
data/lib/golf/rack.rb
CHANGED
@@ -12,16 +12,14 @@ module Golf
|
|
12
12
|
def call(env)
|
13
13
|
code = "200"
|
14
14
|
|
15
|
-
|
16
|
-
return [404, { 'Content-Type' => 'text/plain', 'Content-Length' => '9'}, ['not found']]
|
17
|
-
end
|
18
|
-
|
15
|
+
#pass through for overrides
|
19
16
|
if File.exists?("golfapp/#{env["PATH_INFO"].sub('/','')}") and env["PATH_INFO"] != "/"
|
20
17
|
mime = MIME_TYPES[".#{env["PATH_INFO"].split('.').last}"]
|
21
18
|
result = File.read("golfapp/#{env["PATH_INFO"].sub('/','')}")
|
22
19
|
return [code, { 'Content-Type' => mime, 'Content-Length' => result.length.to_s}, [result]]
|
23
20
|
end
|
24
21
|
|
22
|
+
#regular handling from gem resources/dynamic compilation
|
25
23
|
case env["PATH_INFO"]
|
26
24
|
when "/"
|
27
25
|
mime = MIME_TYPES[".html"]
|
data/lib/golf/version.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
@@ -3,7 +3,7 @@ $.golf.defaultRoute = "/golf/";
|
|
3
3
|
$.golf.controller = [
|
4
4
|
{ route: "/(.*)/",
|
5
5
|
action: function(container, params) {
|
6
|
-
container.append(new Component.golf.twitter.Search(
|
6
|
+
container.append(new Component.golf.twitter.Search(params[1]));
|
7
7
|
}
|
8
8
|
}
|
9
9
|
];
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: golf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.2.
|
5
|
+
version: 0.2.5
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Micha Niskin, Alan Dipert, Julio Capote
|
@@ -80,6 +80,11 @@ files:
|
|
80
80
|
- templates/new/golfapp/plugins/mylib.js
|
81
81
|
- templates/new/golfapp/scripts/00-myscript.js
|
82
82
|
- templates/new/golfapp/styles/main.css
|
83
|
+
- templates/raw/golfapp/components/HelloWorld/HelloWorld.html
|
84
|
+
- templates/raw/golfapp/controller.js
|
85
|
+
- templates/raw/golfapp/plugins/mylib.js
|
86
|
+
- templates/raw/golfapp/scripts/00-myscript.js
|
87
|
+
- templates/raw/golfapp/styles/main.css
|
83
88
|
- templates/sinatra/Gemfile
|
84
89
|
- templates/sinatra/config.ru
|
85
90
|
- templates/sinatra/demo.rb
|