happy-cli 0.1.0.pre3 → 0.1.0.pre4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  source :rubygems
2
2
 
3
- gem 'happy', '>= 0.1.0.pre16'
3
+ gem 'happy', '>= 0.1.0.pre19'
@@ -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
@@ -2,10 +2,12 @@ require 'rubygems'
2
2
  require 'bundler/setup'
3
3
  Bundler.require
4
4
 
5
- require 'happy/extras/scriptable'
5
+ require 'happy/extras/permissions'
6
+ require 'happy/extras/code_reloader'
6
7
 
7
- Happy.route do
8
- run Happy::Extras::Scriptable, :directory => './app'
8
+ class MyReloader < Happy::Extras::CodeReloader
9
+ set :directory, './app/controllers/*.rb'
10
+ set :controller, '::RootController'
9
11
  end
10
12
 
11
- run Happy
13
+ run MyReloader
@@ -1,3 +1,3 @@
1
1
  module HappyCLI
2
- VERSION = "0.1.0.pre3"
2
+ VERSION = "0.1.0.pre4"
3
3
  end
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.pre3
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-07 00:00:00.000000000 Z
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: &70332669738720 !ruby/object:Gem::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: *70332669738720
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/context.rb
45
- - lib/happy-cli/templates/standard/app/permissions.rb
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: []
@@ -1,8 +0,0 @@
1
- # Methods added here will be available on your request context object
2
- # as well as in your views.
3
- #
4
- # Example:
5
- #
6
- # def current_user
7
- # session[:current_user_id] ? User.find(session[:current_user_id]) : nil
8
- # end
@@ -1,8 +0,0 @@
1
- # Examples:
2
- #
3
- # can.dance!
4
- # can.sing!
5
- #
6
- # if context.current_user.admin?
7
- # can.play!
8
- # end
@@ -1,7 +0,0 @@
1
- # path 'hello' do
2
- # path :name do
3
- # "Hello, #{params['name']}!"
4
- # end
5
- # end
6
-
7
- render 'home.erb'