appmake 0.1.23 → 0.1.25

Sign up to get free protection for your applications and to get access to all the features.
data/lib/appmake.rb CHANGED
@@ -38,10 +38,6 @@ module Appmake
38
38
  empty_directory "js"
39
39
  template "templates/js/App.js.tt", "js/App.js"
40
40
 
41
- if options.coffee
42
- empty_directory "coffee"
43
- end
44
-
45
41
  empty_directory "tpl"
46
42
  template "templates/tpl/welcome.html.tt", "tpl/welcome.html"
47
43
 
@@ -54,8 +50,28 @@ module Appmake
54
50
  shell.say_status :cmd, "npm install", :blue
55
51
  system "npm install &> /dev/null"
56
52
 
53
+ if options.coffee
54
+ empty_directory "coffee"
55
+ Listeners::Coffee.compile
56
+ end
57
+
58
+ if options.jquery
59
+ Installers::Jquery.install
60
+ end
61
+
62
+ if options.underscore
63
+ Installers::Jquery.install
64
+ end
65
+
66
+ if options.backbone
67
+ Installers::Backbone.install
68
+ end
69
+
70
+ if options.bootstrap
71
+ Installers::Bootstrap.install
72
+ end
73
+
57
74
  Listeners::Css.compile
58
- Listeners::Coffee.compile
59
75
  Listeners::Tpl.compile
60
76
  Listeners::Js.compile
61
77
  end
@@ -75,21 +91,11 @@ module Appmake
75
91
  if name == "jquery"
76
92
  Installers::Jquery.install
77
93
  elsif name == "underscore"
78
- shell.say_status :cmd, "curl http://underscorejs.org/underscore-min.js -o public/underscore.min.js", :blue
79
- system("curl -silent http://underscorejs.org/underscore-min.js -o public/underscore.min.js")
94
+ Installers::Underscore.install
80
95
  elsif name == "backbone"
81
- shell.say_status :cmd, "curl http://backbonejs.org/backbonejs-min.js -o public/backbone.min.js", :blue
82
- system("curl -silent http://backbonejs.org/backbone-min.js -o public/backbone.min.js")
96
+ Installers::Backbone.install
83
97
  elsif name == "bootstrap"
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")
98
+ Installers::Bootstrap.install
93
99
  else
94
100
  abort "error: unsupported install: #{name}"
95
101
  end
@@ -0,0 +1,17 @@
1
+ require "thor"
2
+
3
+ module Appmake
4
+ module Installers
5
+ class Backbone
6
+ include Thor::Shell
7
+
8
+ def self.install
9
+ shell = Color.new
10
+
11
+ shell.say_status :install "Backbone", :green
12
+ shell.say_status :cmd, "curl http://backbonejs.org/backbonejs-min.js -o public/backbone.min.js", :blue
13
+ system("curl -silent http://backbonejs.org/backbone-min.js -o public/backbone.min.js")
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,24 @@
1
+ require "thor"
2
+
3
+ module Appmake
4
+ module Installers
5
+ class Bootstrap
6
+ include Thor::Shell
7
+
8
+ def self.install
9
+ shell = Color.new
10
+
11
+ shell.say_status :install "Bootstrap", :green
12
+ shell.say_status :cmd, "curl http://twitter.github.com/bootstrap/assets/bootstrap.zip -o public/bootstrap.zip", :blue
13
+ shell.say_status :cmd, "cd public", :blue
14
+ shell.say_status :cmd, "unzip bootstrap.zip &> /dev/null", :blue
15
+ shell.say_status :cmd, "mv bootstrap/js/bootstrap.min.js js/", :blue
16
+ shell.say_status :cmd, "mv bootstrap/css/bootstrap.min.css css/", :blue
17
+ shell.say_status :cmd, "mv bootstrap/css/bootstrap-responsive.min.css css/", :blue
18
+ shell.say_status :cmd, "mv bootstrap/img/* img/", :blue
19
+ shell.say_status :cmd, "rm -rf bootstrap && rm bootstrap.zip", :blue
20
+ 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")
21
+ end
22
+ end
23
+ end
24
+ end
@@ -8,6 +8,7 @@ module Appmake
8
8
  def self.install
9
9
  shell = Color.new
10
10
 
11
+ shell.say_status :install "jQuery", :green
11
12
  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
13
  system("curl -silent http://code.jquery.com/jquery-1.9.0.min.js -o public/jquery-1.9.0.min.js")
13
14
  end
@@ -0,0 +1,17 @@
1
+ require "thor"
2
+
3
+ module Appmake
4
+ module Installers
5
+ class Underscore
6
+ include Thor::Shell
7
+
8
+ def self.install
9
+ shell = Color.new
10
+
11
+ shell.say_status :install "Underscore", :green
12
+ shell.say_status :cmd, "curl http://underscorejs.org/underscore-min.js -o public/underscore.min.js", :blue
13
+ system("curl -silent http://underscorejs.org/underscore-min.js -o public/underscore.min.js")
14
+ end
15
+ end
16
+ end
17
+ end
@@ -1,3 +1,3 @@
1
1
  module Appmake
2
- VERSION = "0.1.23"
2
+ VERSION = "0.1.25"
3
3
  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.23
4
+ version: 0.1.25
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -93,7 +93,10 @@ files:
93
93
  - appmake.gemspec
94
94
  - bin/appmake
95
95
  - lib/appmake.rb
96
+ - lib/appmake/installers/backbone.rb
97
+ - lib/appmake/installers/bootstrap.rb
96
98
  - lib/appmake/installers/jquery.rb
99
+ - lib/appmake/installers/underscore.rb
97
100
  - lib/appmake/listeners/coffee.rb
98
101
  - lib/appmake/listeners/css.rb
99
102
  - lib/appmake/listeners/js.rb