annotation 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  = CHANGES
2
2
 
3
- == Release 0.1.0 (2010-10-10)
3
+ == Release 0.1.2 (2010-10-10)
4
4
 
5
5
  * first release.
6
6
 
data/README.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  = README
2
2
 
3
- release:: 0.1.1
3
+ release:: 0.1.2
4
4
  copyright:: $Copyright: copyright(c) 2010 kuwata-lab.com all rights reserved $
5
5
  license:: $License: MIT-License $
6
6
 
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/ruby
2
2
 
3
3
  ###
4
- ### $Release: 0.1.1 $
4
+ ### $Release: 0.1.2 $
5
5
  ### $Copyright: copyright(c) 2010 kuwata-lab.com all rights reserved $
6
6
  ### $License: MIT-License $
7
7
  ###
@@ -15,7 +15,7 @@ spec = Gem::Specification.new do |s|
15
15
  s.author = "makoto kuwata"
16
16
  s.email = "kwa(at)kuwata-lab.com"
17
17
  s.rubyforge_project = 'annotation'
18
- s.version = "0.1.1"
18
+ s.version = "0.1.2"
19
19
  s.platform = Gem::Platform::RUBY
20
20
  s.homepage = "http://github.com/kwatch/annotation"
21
21
  s.summary = "annotation library similar to Java or Python"
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
3
  ###
4
- ### $Release: 0.1.1 $
4
+ ### $Release: 0.1.2 $
5
5
  ### $Copyright: copyright(c) 2010 kuwata-lab.com all rights reserved $
6
6
  ### $License: MIT-License $
7
7
  ###
@@ -14,32 +14,33 @@
14
14
  ### require 'annotation'
15
15
  ###
16
16
  ###
17
- ### class Controller
17
+ ### module ControllerAnnotations
18
18
  ### extend Annotation
19
19
  ###
20
- ### def self.GET(imethod, path)
21
- ### (@__routes ||= []) << [path, :GET, imethod]
20
+ ### def GET(method_name, path)
21
+ ### (@__routes ||= []) << [path, :GET, method_name]
22
22
  ### end
23
23
  ###
24
- ### def self.POST(imethod, path)
25
- ### (@__routes ||= []) << [path, :POST, imethod]
24
+ ### def POST(method_name, path)
25
+ ### (@__routes ||= []) << [path, :POST, method_name]
26
26
  ### end
27
27
  ###
28
- ### def self.login_required(imethod)
29
- ### alias_method "__orig_#{imethod}", imethod
30
- ### s = "def #{imethod}(*args)
28
+ ### def login_required(method_name)
29
+ ### alias_method "__orig_#{method_name}", method_name
30
+ ### s = "def #{method_name}(*args)
31
31
  ### raise '302 Found' unless @current_user
32
- ### __orig_#{imethod}(*args)
32
+ ### __orig_#{method_name}(*args)
33
33
  ### end"
34
34
  ### self.class_eval s # not 'eval(s)'
35
35
  ### end
36
36
  ###
37
- ### annotation :GET, :POST, :login_required
37
+ ### annotation :GET, :POST, :login_required # !!!!!!
38
38
  ###
39
39
  ### end
40
40
  ###
41
41
  ###
42
- ### class MyController < Controller
42
+ ### class Controller
43
+ ### extend ControllerAnnotations
43
44
  ###
44
45
  ### GET('/')
45
46
  ### def index
@@ -63,11 +64,14 @@
63
64
  ### end
64
65
  ###
65
66
  ###
66
- ### p MyController.new.update(123) #=> 302 Found (RuntimeError)
67
+ ### p Controller.new.update(123) #=> 302 Found (RuntimeError)
68
+ ###
69
+ ###
70
+ ### See README.txt for more examples.
67
71
  ###
68
72
  module Annotation
69
73
 
70
- VERSION = "$Release: 0.1.1 $".split(' ')[1]
74
+ VERSION = "$Release: 0.1.2 $".split(' ')[1]
71
75
 
72
76
  def annotation(*names)
73
77
  self.class_eval do
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
3
  ###
4
- ### $Release: 0.1.1 $
4
+ ### $Release: 0.1.2 $
5
5
  ### $Copyright: copyright(c) 2010 kuwata-lab.com all rights reserved $
6
6
  ### $License: MIT-License $
7
7
  ###
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
3
  ###
4
- ### $Release: 0.1.1 $
4
+ ### $Release: 0.1.2 $
5
5
  ### $Copyright: copyright(c) 2010 kuwata-lab.com all rights reserved $
6
6
  ### $License: MIT-License $
7
7
  ###
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: annotation
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - makoto kuwata