appmake 0.1.21 → 0.1.22
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/appmake/installers/jquery.rb +16 -0
- data/lib/appmake/version.rb +1 -1
- data/lib/appmake.rb +25 -6
- metadata +2 -1
@@ -0,0 +1,16 @@
|
|
1
|
+
require "thor"
|
2
|
+
|
3
|
+
module Appmake
|
4
|
+
module Installers
|
5
|
+
class Jquery
|
6
|
+
include Thor::Actions
|
7
|
+
|
8
|
+
def self.install
|
9
|
+
shell = Color.new
|
10
|
+
|
11
|
+
shell.say_status :cmd, "curl http://code.jquery.com/jquery-1.9.0.min.js -o public/jquery-1.9.0.min.js", :blue
|
12
|
+
system("curl -silent http://code.jquery.com/jquery-1.9.0.min.js -o public/jquery-1.9.0.min.js")
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/appmake/version.rb
CHANGED
data/lib/appmake.rb
CHANGED
@@ -4,6 +4,7 @@ require "appmake/listeners/css"
|
|
4
4
|
require "appmake/listeners/coffee"
|
5
5
|
require "appmake/listeners/js"
|
6
6
|
require "appmake/listeners/tpl"
|
7
|
+
require "appmake/installers/jquery"
|
7
8
|
|
8
9
|
module Appmake
|
9
10
|
class Appmake < Thor
|
@@ -14,6 +15,16 @@ module Appmake
|
|
14
15
|
end
|
15
16
|
|
16
17
|
desc "init", "initialize new application"
|
18
|
+
{
|
19
|
+
:coffee => false,
|
20
|
+
:jquery => true,
|
21
|
+
:underscore => false,
|
22
|
+
:backbone => false,
|
23
|
+
:bootstrap => false
|
24
|
+
}.each do |op, default|
|
25
|
+
method_option op, :type => :boolean, :default => default, :aliases => op.to_s
|
26
|
+
end
|
27
|
+
|
17
28
|
def init
|
18
29
|
shell = Color.new
|
19
30
|
|
@@ -27,7 +38,9 @@ module Appmake
|
|
27
38
|
empty_directory "js"
|
28
39
|
template "templates/js/App.js.tt", "js/App.js"
|
29
40
|
|
30
|
-
|
41
|
+
if options.coffee
|
42
|
+
empty_directory "coffee"
|
43
|
+
end
|
31
44
|
|
32
45
|
empty_directory "tpl"
|
33
46
|
template "templates/tpl/welcome.html.tt", "tpl/welcome.html"
|
@@ -60,17 +73,23 @@ module Appmake
|
|
60
73
|
shell = Color.new
|
61
74
|
|
62
75
|
if name == "jquery"
|
63
|
-
|
64
|
-
system("curl -silent http://code.jquery.com/jquery-1.9.0.min.js -o public/jquery-1.9.0.min.js")
|
76
|
+
Installers::Jquery.install
|
65
77
|
elsif name == "underscore"
|
66
78
|
shell.say_status :cmd, "curl http://underscorejs.org/underscore-min.js -o public/underscore.min.js", :blue
|
67
79
|
system("curl -silent http://underscorejs.org/underscore-min.js -o public/underscore.min.js")
|
68
80
|
elsif name == "backbone"
|
69
81
|
shell.say_status :cmd, "curl http://backbonejs.org/backbonejs-min.js -o public/backbone.min.js", :blue
|
70
|
-
system("curl -silent http://backbonejs.org/
|
82
|
+
system("curl -silent http://backbonejs.org/backbone-min.js -o public/backbone.min.js")
|
71
83
|
elsif name == "bootstrap"
|
72
|
-
shell.say_status :cmd, "curl http://twitter.github.com/bootstrap/assets/bootstrap.zip -o public/bootstrap.zip
|
73
|
-
|
84
|
+
shell.say_status :cmd, "curl http://twitter.github.com/bootstrap/assets/bootstrap.zip -o public/bootstrap.zip", :blue
|
85
|
+
shell.say_status :cmd, "cd public", :blue
|
86
|
+
shell.say_status :cmd, "unzip bootstrap.zip &> /dev/null", :blue
|
87
|
+
shell.say_status :cmd, "mv bootstrap/js/bootstrap.min.js js/", :blue
|
88
|
+
shell.say_status :cmd, "mv bootstrap/css/bootstrap.min.css css/", :blue
|
89
|
+
shell.say_status :cmd, "mv bootstrap/css/bootstrap-responsive.min.css css/", :blue
|
90
|
+
shell.say_status :cmd, "mv bootstrap/img/* img/", :blue
|
91
|
+
shell.say_status :cmd, "rm -rf bootstrap && rm bootstrap.zip", :blue
|
92
|
+
system("curl -silent http://twitter.github.com/bootstrap/assets/bootstrap.zip -o public/bootstrap.zip && cd public && unzip bootstrap.zip &> /dev/null && mv bootstrap/js/bootstrap.min.js js/ && mv bootstrap/css/bootstrap.min.css css/ && mv bootstrap/css/bootstrap-responsive.min.css css/ && mv bootstrap/img/* img/ && rm -rf bootstrap && rm bootstrap.zip")
|
74
93
|
else
|
75
94
|
abort "error: unsupported install: #{name}"
|
76
95
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appmake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.22
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -93,6 +93,7 @@ files:
|
|
93
93
|
- appmake.gemspec
|
94
94
|
- bin/appmake
|
95
95
|
- lib/appmake.rb
|
96
|
+
- lib/appmake/installers/jquery.rb
|
96
97
|
- lib/appmake/listeners/coffee.rb
|
97
98
|
- lib/appmake/listeners/css.rb
|
98
99
|
- lib/appmake/listeners/js.rb
|