golf 0.3.1 → 0.3.2

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
@@ -24,7 +24,23 @@ module Golf
24
24
  def raw
25
25
  directory("templates/raw", "golfapp")
26
26
  end
27
-
27
+
28
+ desc "generate [TYPE] [NAME]", "Generate stub code of TYPE for your already existing golfapp [component, plugin, script]"
29
+ def generate(type, name)
30
+ case type
31
+ when "component"
32
+ if name.include?('.')
33
+ component_name = name.split('.').last
34
+ package_name = name.gsub('.','/').split('/')[0...-1].join('/')
35
+ else
36
+ component_name = name
37
+ package_name = name
38
+ end
39
+ create_file "components/#{package_name}/#{component_name}.html" do
40
+ File.read("templates/component/Component.html")
41
+ end
42
+ end
43
+ end
28
44
 
29
45
  desc "server", "Run the golf app"
30
46
  def server
data/lib/golf/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Golf
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
@@ -0,0 +1,13 @@
1
+ <div>
2
+ <style type="text/golf">
3
+ div.container {
4
+ border: 1px solid red;
5
+ }
6
+ </style>
7
+ <script type="text/golf">
8
+ function() {
9
+ $(".container").append("<h1>Hello, world!</h1>");
10
+ }
11
+ </script>
12
+ <div class="container"></div>
13
+ </div>
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: golf
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.3.1
5
+ version: 0.3.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Micha Niskin, Alan Dipert, Julio Capote
@@ -73,6 +73,7 @@ files:
73
73
  - resources/jquery.golf.js
74
74
  - resources/jquery.js
75
75
  - resources/welcome2golf.html
76
+ - templates/component/Component.html
76
77
  - templates/new/Gemfile
77
78
  - templates/new/config.ru
78
79
  - templates/new/golfapp/components/HelloWorld/HelloWorld.html