groove 0.1.0 → 0.1.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/README.md +18 -1
- data/VERSION +1 -1
- data/bin/groove +27 -26
- data/groove.gemspec +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -15,7 +15,24 @@ groove weekapaug
|
|
15
15
|
|
16
16
|
cd weekapaug
|
17
17
|
|
18
|
-
|
18
|
+
cat config.ru
|
19
|
+
|
20
|
+
require 'groove'
|
21
|
+
Groove.config = { :db => ENV['DATABASE'] || 'weekapaug',
|
22
|
+
:db_url => ENV['DATABASE_URL'] || 'localhost',
|
23
|
+
:db_user => ENV['DATABASE_USER'],
|
24
|
+
:db_password => ENV['DATABASE_PASSWORD'],
|
25
|
+
:hoptoad => ENV['HOPTOAD'] }
|
26
|
+
require 'app'
|
27
|
+
run Sinatra::Application
|
28
|
+
|
29
|
+
cat app.rb
|
30
|
+
|
31
|
+
get '/' do
|
32
|
+
effigy :index
|
33
|
+
end
|
34
|
+
|
35
|
+
cat templates/index.html
|
19
36
|
|
20
37
|
<!DOCTYPE html>
|
21
38
|
<html>
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/bin/groove
CHANGED
@@ -3,22 +3,39 @@
|
|
3
3
|
require 'rubygems'
|
4
4
|
require 'thor'
|
5
5
|
|
6
|
-
|
7
|
-
|
6
|
+
class Groove < Thor::Group
|
7
|
+
include Thor::Actions
|
8
|
+
|
9
|
+
argument :name
|
10
|
+
|
11
|
+
def create_rackup
|
12
|
+
create_file("#{name}/config.ru") do
|
13
|
+
<<-RUBY
|
14
|
+
require 'groove'
|
8
15
|
Groove.config = { :db => ENV['DATABASE'] || '#{name}',
|
9
16
|
:db_url => ENV['DATABASE_URL'] || 'localhost',
|
10
17
|
:db_user => ENV['DATABASE_USER'],
|
11
18
|
:db_password => ENV['DATABASE_PASSWORD'],
|
12
19
|
:hoptoad => ENV['HOPTOAD'] }
|
20
|
+
require 'app'
|
21
|
+
run Sinatra::Application
|
13
22
|
RUBY
|
23
|
+
end
|
24
|
+
end
|
14
25
|
|
15
|
-
|
26
|
+
def create_app
|
27
|
+
create_file("#{name}/app.rb") do
|
28
|
+
<<-RUBY
|
16
29
|
get '/' do
|
17
30
|
effigy :index
|
18
31
|
end
|
19
32
|
RUBY
|
33
|
+
end
|
34
|
+
end
|
20
35
|
|
21
|
-
|
36
|
+
def create_template
|
37
|
+
create_file("#{name}/templates/index.html") do
|
38
|
+
<<-HTML
|
22
39
|
<!DOCTYPE html>
|
23
40
|
<html>
|
24
41
|
<head>
|
@@ -29,34 +46,18 @@ RUBY
|
|
29
46
|
</body>
|
30
47
|
</html>
|
31
48
|
HTML
|
49
|
+
end
|
50
|
+
end
|
32
51
|
|
33
|
-
|
52
|
+
def create_view
|
53
|
+
create_file("#{name}/views/index.rb") do
|
54
|
+
<<-RUBY
|
34
55
|
class IndexView < Effigy::View
|
35
56
|
def transform
|
36
57
|
end
|
37
58
|
end
|
38
59
|
RUBY
|
39
|
-
end
|
40
|
-
|
41
|
-
class Groove < Thor::Group
|
42
|
-
include Thor::Actions
|
43
|
-
|
44
|
-
argument :name
|
45
|
-
|
46
|
-
def create_rackup
|
47
|
-
create_file("#{name}/config.ru") { Grooove::Rackup }
|
48
|
-
end
|
49
|
-
|
50
|
-
def create_app
|
51
|
-
create_file("#{name}/app.rb") { Grooove::App }
|
52
|
-
end
|
53
|
-
|
54
|
-
def create_template
|
55
|
-
create_file("#{name}/templates/index.html") { Grooove::Template }
|
56
|
-
end
|
57
|
-
|
58
|
-
def create_view
|
59
|
-
create_file("#{name}/views/index.rb") { Grooove::View }
|
60
|
+
end
|
60
61
|
end
|
61
62
|
end
|
62
63
|
|
data/groove.gemspec
CHANGED