blossom 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/bin/blossom +16 -60
- metadata +1 -1
data/bin/blossom
CHANGED
@@ -25,7 +25,7 @@ def die(message)
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def error(message)
|
28
|
-
warn "
|
28
|
+
warn "$0: #{message}"
|
29
29
|
end
|
30
30
|
|
31
31
|
def run(command)
|
@@ -36,14 +36,8 @@ end
|
|
36
36
|
if ARGV.empty?
|
37
37
|
puts usage
|
38
38
|
elsif ARGV[0].start_with? "-"
|
39
|
-
|
40
|
-
|
41
|
-
puts usage
|
42
|
-
else
|
43
|
-
error "Unrecognized option: #{ARGV[0]}"
|
44
|
-
warn usage
|
45
|
-
exit 1
|
46
|
-
end
|
39
|
+
puts usage
|
40
|
+
exit 1
|
47
41
|
else
|
48
42
|
name = ARGV.first
|
49
43
|
name_symbol = name =~ /\W|^\d/ ? ":'#{name}'" : ":#{name}"
|
@@ -73,9 +67,6 @@ else
|
|
73
67
|
|
74
68
|
## The maximum amount of time browsers may cache the site:
|
75
69
|
# Max-Cache-Time: 1 day
|
76
|
-
|
77
|
-
## Whether or not to remove the "www." part of the domain:
|
78
|
-
# Remove-WWW-From-Domain: yes
|
79
70
|
^D
|
80
71
|
|
81
72
|
make_file ".gitignore", "tmp\n"
|
@@ -101,8 +92,8 @@ gem "blossom"
|
|
101
92
|
%html
|
102
93
|
%head
|
103
94
|
%meta(charset="utf-8")
|
104
|
-
%title
|
105
|
-
%meta(name="description" content="
|
95
|
+
%title
|
96
|
+
%meta(name="description" content="")
|
106
97
|
%link(rel="stylesheet" href="#{name}.css")
|
107
98
|
%script(src="#{name}.js")
|
108
99
|
/[if lt IE 9]
|
@@ -111,30 +102,16 @@ gem "blossom"
|
|
111
102
|
%h1 #{name}.haml
|
112
103
|
^D
|
113
104
|
|
114
|
-
make_file "#{name}.
|
115
|
-
@import compass/reset
|
116
|
-
@import compass/utilities
|
117
|
-
@import compass/css3
|
118
|
-
|
119
|
-
h1
|
120
|
-
font: 48px monospace
|
121
|
-
margin-top: 1em
|
122
|
-
text-align: center
|
123
|
-
^D
|
124
|
-
|
125
|
-
make_file "#{name}.sinatra.rb", <<"^D"
|
126
|
-
# Put any custom Sinatra routes or configuration here.
|
127
|
-
# See <http://www.sinatrarb.com/documentation> for help.
|
128
|
-
|
129
|
-
# This is also where you insert middleware (just remember to add
|
130
|
-
# any new dependencies to your Gemfile and to run \`bundle\'):
|
131
|
-
#
|
132
|
-
# require "some/middleware"
|
133
|
-
# use Some::Middleware
|
105
|
+
make_file "#{name}.scss", <<"^D"
|
106
|
+
@import 'compass/reset';
|
107
|
+
@import 'compass/utilities';
|
108
|
+
@import 'compass/css3';
|
134
109
|
|
135
|
-
|
136
|
-
|
137
|
-
|
110
|
+
h1 {
|
111
|
+
font: 48px monospace;
|
112
|
+
margin-top: 1em;
|
113
|
+
text-align: center;
|
114
|
+
}
|
138
115
|
^D
|
139
116
|
|
140
117
|
make_file "#{name}.js", ''
|
@@ -144,28 +121,7 @@ h1
|
|
144
121
|
run "git add -A"
|
145
122
|
run "git commit -m 'Create project.'"
|
146
123
|
|
147
|
-
puts
|
148
|
-
|
149
|
-
Application created! Now type \`cd #{name}\' and then \`rackup\'.
|
150
|
-
This will run your application at <http://localhost:9292/>.
|
151
|
-
|
152
|
-
Start hacking in \`#{name}.haml\' and \`#{name}.sass\'. If you
|
153
|
-
create \`x.haml\', it will show up at <http://localhost:9292/x>.
|
154
|
-
|
155
|
-
Public files go in the \`public/\' directory, but you can put images
|
156
|
-
and Javascript files directly in the root directory if you want.
|
157
|
-
This (and other things) can be configured in \`#{name}.blossom\'.
|
158
|
-
|
159
|
-
Put any custom middleware or Sinatra code in \`#{name}.sinatra.rb\',
|
160
|
-
but remember to restart your application after changing this file.
|
161
|
-
|
162
|
-
If you restart your application a lot, there is a drop-in replacement
|
163
|
-
for rackup called Shotgun <https://github.com/rtomayko/shotgun>:
|
164
|
-
|
165
|
-
$ sudo gem install shotgun
|
166
|
-
$ shotgun # Like rackup, except with automatic reloading.
|
167
|
-
|
168
|
-
Good luck and have fun! :-)
|
169
|
-
^D
|
124
|
+
puts "Application created! Now type \`cd #{name}\' and \`rackup\'."
|
125
|
+
puts "This will run your application at <http://localhost:9292/>."
|
170
126
|
end
|
171
127
|
end
|