parameters 0.1.9 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +0,0 @@
1
- require 'parameters/yard/handlers'
@@ -1 +0,0 @@
1
- require 'parameters/yard/handlers/ruby'
@@ -1,2 +0,0 @@
1
- require 'parameters/yard/handlers/ruby/parameter_handler'
2
- require 'parameters/yard/handlers/ruby/legacy'
@@ -1 +0,0 @@
1
- require 'parameters/yard/handlers/ruby/legacy/parameter_handler'
@@ -1,34 +0,0 @@
1
- require 'yard'
2
-
3
- module YARD
4
- module Handlers
5
- module Ruby
6
- module Legacy
7
- class ParameterHandler < Base
8
-
9
- handles /\Aparameter\s/
10
-
11
- def process
12
- nobj = namespace
13
- mscope = scope
14
- name = statement.tokens[2,1].to_s[1..-1]
15
-
16
- register MethodObject.new(nobj, name, mscope) do |o|
17
- o.visibility = :public
18
- o.source = statement.source
19
- o.signature = "def #{name}"
20
- end
21
-
22
- register MethodObject.new(nobj, "#{name}=", mscope) do |o|
23
- o.visibility = :public
24
- o.source = statement.source
25
- o.signature = "def #{name}=(value)"
26
- o.parameters = [['value', nil]]
27
- end
28
- end
29
-
30
- end
31
- end
32
- end
33
- end
34
- end
@@ -1,38 +0,0 @@
1
- require 'yard'
2
-
3
- module YARD
4
- module Handlers
5
- module Ruby
6
- class ParameterHandler < Base
7
-
8
- handles method_call(:parameter)
9
-
10
- def process
11
- obj = statement.parameters(false).first
12
- nobj = namespace
13
- mscope = scope
14
- name = case obj.type
15
- when :symbol_literal
16
- obj.jump(:ident, :op, :kw, :const).source
17
- when :string_literal
18
- obj.jump(:string_content).source
19
- end
20
-
21
- register MethodObject.new(nobj, name, mscope) do |o|
22
- o.visibility = :public
23
- o.source = statement.source
24
- o.signature = "def #{name}"
25
- end
26
-
27
- register MethodObject.new(nobj, "#{name}=", mscope) do |o|
28
- o.visibility = :public
29
- o.source = statement.source
30
- o.signature = "def #{name}=(value)"
31
- o.parameters = [['value', nil]]
32
- end
33
- end
34
-
35
- end
36
- end
37
- end
38
- end
@@ -1,47 +0,0 @@
1
- require 'parameters/parser'
2
-
3
- require 'spec_helper'
4
-
5
- describe Parameters::Parser do
6
- it "should parse string values" do
7
- Parameters::Parser.parse_value("'bla \\' \\\" bla'").should == "bla ' \\\" bla"
8
- end
9
-
10
- it "should parse decimal values" do
11
- Parameters::Parser.parse_value("100").should == 100
12
- end
13
-
14
- it "should parse octal values" do
15
- Parameters::Parser.parse_value("012").should == 10
16
- end
17
-
18
- it "should parse hexadecimal values" do
19
- Parameters::Parser.parse_value("0xff").should == 0xff
20
- end
21
-
22
- it "should parse boolean values" do
23
- Parameters::Parser.parse_value('true').should == true
24
- Parameters::Parser.parse_value('false').should == false
25
- end
26
-
27
- it "should parse URI values" do
28
- url = 'http://example.com/'
29
-
30
- Parameters::Parser.parse_value(url).should == URI(url)
31
- end
32
-
33
- it "should parse params of the form 'name'" do
34
- Parameters::Parser.parse_param('var').should == {:var => nil}
35
- end
36
-
37
- it "should parse params of the form 'name=value'" do
38
- Parameters::Parser.parse_param('var1=test').should == {:var1 => 'test'}
39
- end
40
-
41
- it "should parse multiple params" do
42
- Parameters::Parser.parse(['var', 'var1=test']).should == {
43
- :var => nil,
44
- :var1 => 'test'
45
- }
46
- end
47
- end
metadata.gz.sig DELETED
@@ -1 +0,0 @@
1
- ��S)�'q: *vc`L�t縌�J>-�+���<���k�0֍�C|����D(3t�����g�x�r���aF�E�즞��Uj�݌r�/�CbU5�_��c?�R\9�6CT��x� �����Y��s�.\_�)�,~J��1(0�_u:���b2�*r?�vv�ݣճb�V&R��& bݗp�e��y�ԫ�O��͏%��1�$���<�� Fo�_�/��6q¦�6�j��!�񈊊�U���B ��`�