happy-cli 0.1.0.pre3 → 0.1.0.pre4
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/happy-cli/templates/standard/Gemfile +1 -1
- data/lib/happy-cli/templates/standard/app/controllers/root_controller.rb +33 -0
- data/lib/happy-cli/templates/standard/{views → app/views}/home.erb +0 -0
- data/lib/happy-cli/templates/standard/config.ru +6 -4
- data/lib/happy-cli/version.rb +1 -1
- metadata +6 -8
- data/lib/happy-cli/templates/standard/app/context.rb +0 -8
- data/lib/happy-cli/templates/standard/app/permissions.rb +0 -8
- data/lib/happy-cli/templates/standard/app/route.rb +0 -7
@@ -0,0 +1,33 @@
|
|
1
|
+
class RootController < Happy::Controller
|
2
|
+
set :views, './app/views'
|
3
|
+
|
4
|
+
def route
|
5
|
+
setup_permissions
|
6
|
+
|
7
|
+
# Handle sub-paths here. For example:
|
8
|
+
#
|
9
|
+
# path 'info' do
|
10
|
+
# render 'info.erb'
|
11
|
+
# end
|
12
|
+
#
|
13
|
+
# Paths can be captured as parameters:
|
14
|
+
#
|
15
|
+
# path 'hello-:name' do
|
16
|
+
# "Hallo, #{params['name']}!"
|
17
|
+
# end
|
18
|
+
#
|
19
|
+
# This is the default response:
|
20
|
+
render 'home.erb'
|
21
|
+
end
|
22
|
+
|
23
|
+
def setup_permissions
|
24
|
+
# You can use the "can" variable to declare runtime
|
25
|
+
# permissions. Examples:
|
26
|
+
#
|
27
|
+
# can.login!
|
28
|
+
#
|
29
|
+
# if current_user.admin?
|
30
|
+
# can.edit!
|
31
|
+
# end
|
32
|
+
end
|
33
|
+
end
|
File without changes
|
@@ -2,10 +2,12 @@ require 'rubygems'
|
|
2
2
|
require 'bundler/setup'
|
3
3
|
Bundler.require
|
4
4
|
|
5
|
-
require 'happy/extras/
|
5
|
+
require 'happy/extras/permissions'
|
6
|
+
require 'happy/extras/code_reloader'
|
6
7
|
|
7
|
-
Happy
|
8
|
-
|
8
|
+
class MyReloader < Happy::Extras::CodeReloader
|
9
|
+
set :directory, './app/controllers/*.rb'
|
10
|
+
set :controller, '::RootController'
|
9
11
|
end
|
10
12
|
|
11
|
-
run
|
13
|
+
run MyReloader
|
data/lib/happy-cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: happy-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0.
|
4
|
+
version: 0.1.0.pre4
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-06-
|
12
|
+
date: 2012-06-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
16
|
-
requirement: &
|
16
|
+
requirement: &70169642614280 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: '0.15'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70169642614280
|
25
25
|
description: Command line tool for the Happy web application toolkit.
|
26
26
|
email:
|
27
27
|
- hendrik@mans.de
|
@@ -41,11 +41,9 @@ files:
|
|
41
41
|
- lib/happy-cli/templates/minimal/Gemfile
|
42
42
|
- lib/happy-cli/templates/minimal/config.ru
|
43
43
|
- lib/happy-cli/templates/standard/Gemfile
|
44
|
-
- lib/happy-cli/templates/standard/app/
|
45
|
-
- lib/happy-cli/templates/standard/app/
|
46
|
-
- lib/happy-cli/templates/standard/app/route.rb
|
44
|
+
- lib/happy-cli/templates/standard/app/controllers/root_controller.rb
|
45
|
+
- lib/happy-cli/templates/standard/app/views/home.erb
|
47
46
|
- lib/happy-cli/templates/standard/config.ru
|
48
|
-
- lib/happy-cli/templates/standard/views/home.erb
|
49
47
|
- lib/happy-cli/version.rb
|
50
48
|
homepage: https://github.com/hmans/happy-cli
|
51
49
|
licenses: []
|