personify 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -12,6 +12,7 @@ begin
12
12
  gem.authors = ["Flurin Egger"]
13
13
  gem.add_dependency "treetop", "~> 1.4.0"
14
14
  gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
15
+ gem.add_development_dependency "rdoc", ">= 0"
15
16
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
16
17
  end
17
18
  Jeweler::GemcutterTasks.new
@@ -21,8 +22,8 @@ end
21
22
 
22
23
  require 'rake/testtask'
23
24
  Rake::TestTask.new(:test) do |test|
24
- test.libs << 'lib' << 'test'
25
- test.pattern = 'test/**/test_*.rb'
25
+ test.libs + ['lib', 'test']
26
+ test.pattern = 'test/*_test.rb'
26
27
  test.verbose = true
27
28
  end
28
29
 
@@ -43,8 +44,8 @@ task :test => :check_dependencies
43
44
 
44
45
  task :default => :test
45
46
 
46
- require 'rake/rdoctask'
47
- Rake::RDocTask.new do |rdoc|
47
+ require 'rdoc/task'
48
+ RDoc::Task.new() do |rdoc|
48
49
  version = File.exist?('VERSION') ? File.read('VERSION') : ""
49
50
 
50
51
  rdoc.rdoc_dir = 'rdoc'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.1
1
+ 1.1.2
@@ -8,11 +8,11 @@ module Personify
8
8
  end
9
9
 
10
10
  def context_method(method_name)
11
- self.allowed_context_methods << method_name.to_s if self.instance_methods.include?(method_name.to_s)
11
+ self.allowed_context_methods << method_name.to_sym if self.instance_methods.include?(method_name.to_s) || self.instance_methods.include?(method_name.to_sym)
12
12
  end
13
-
13
+
14
14
  def allow_method?(method_name)
15
- self.allowed_context_methods.include?(method_name.to_s)
15
+ self.allowed_context_methods.include?(method_name.to_sym)
16
16
  end
17
17
  end
18
18
 
data/test/context_test.rb CHANGED
@@ -30,6 +30,20 @@ class ContextTest < Test::Unit::TestCase
30
30
  end
31
31
  end
32
32
 
33
+ should "have the context methods in the #allowed_methods" do
34
+ assert @c.allowed_context_methods.include?(:true)
35
+ assert @c.allowed_context_methods.include?(:block)
36
+ assert !@c.allowed_context_methods.include?(:do_not_call)
37
+ end
38
+
39
+ should "respond true to #allow_method? of context method" do
40
+ assert @c.allow_method?(:true)
41
+ assert @c.allow_method?("true")
42
+ assert @c.allow_method?(:block)
43
+ assert @c.allow_method?("block")
44
+ assert !@c.allow_method?(:do_not_call)
45
+ assert !@c.allow_method?("do_not_call")
46
+ end
33
47
 
34
48
  should "allow setting of local_assigns" do
35
49
  @i = @c.new
@@ -85,10 +99,10 @@ class ContextTest < Test::Unit::TestCase
85
99
  assert_equal "[IF(\"out\")]", parse("[IF(\"out\")]").eval(@context)
86
100
  end
87
101
 
88
- should "return nil with more than 2 arguments" do
89
- assert_equal "[IF(\"out\", \"2\", \"3\")]", parse("[IF(\"out\", \"2\", \"3\")]").eval(@context)
90
- assert_equal "test", parse("[IF(\"out\", \"2\", \"3\") | \"test\"]").eval(@context)
91
- assert_equal "[IF(\"out\",\"2\") DO]3[END]", parse("[IF(\"out\",\"2\") DO]3[END]").eval(@context)
102
+ should "discard any argument after the 2nd" do
103
+ assert_equal "2", parse("[IF(\"out\", \"2\", \"3\")]").eval(@context)
104
+ assert_equal "2", parse("[IF(\"out\", \"2\", \"3\") | \"test\"]").eval(@context)
105
+ assert_equal "2", parse("[IF(\"out\",\"2\") DO]3[END]").eval(@context)
92
106
  end
93
107
 
94
108
  should "return second argument if first argument is not empty" do
data/test/parser_test.rb CHANGED
@@ -207,7 +207,7 @@ class ParserTest < Test::Unit::TestCase
207
207
  assert_equal "alt", parse("[TEST_PARAM(FALSE) DO]value[END | \"alt\"]").eval(@context)
208
208
  end
209
209
 
210
- should "eval substitution within block parameter" do
210
+ should_eventually "eval substitution within block parameter" do
211
211
  assert_equal "value", parse("[TEST() DO][KEY][END]").eval(@context)
212
212
  assert_equal "bla value bla", parse("[TEST() DO]bla [KEY] bla[END]").eval(@context)
213
213
  end
metadata CHANGED
@@ -1,64 +1,58 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: personify
3
- version: !ruby/object:Gem::Version
4
- hash: 17
5
- prerelease: false
6
- segments:
7
- - 1
8
- - 1
9
- - 1
10
- version: 1.1.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.1.2
5
+ prerelease:
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Flurin Egger
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-08-22 00:00:00 +02:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
12
+ date: 2011-10-14 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
22
15
  name: treetop
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &70184090092600 !ruby/object:Gem::Requirement
25
17
  none: false
26
- requirements:
18
+ requirements:
27
19
  - - ~>
28
- - !ruby/object:Gem::Version
29
- hash: 7
30
- segments:
31
- - 1
32
- - 4
33
- - 0
20
+ - !ruby/object:Gem::Version
34
21
  version: 1.4.0
35
22
  type: :runtime
36
- version_requirements: *id001
37
- - !ruby/object:Gem::Dependency
23
+ prerelease: false
24
+ version_requirements: *70184090092600
25
+ - !ruby/object:Gem::Dependency
38
26
  name: thoughtbot-shoulda
27
+ requirement: &70184090085340 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :development
39
34
  prerelease: false
40
- requirement: &id002 !ruby/object:Gem::Requirement
35
+ version_requirements: *70184090085340
36
+ - !ruby/object:Gem::Dependency
37
+ name: rdoc
38
+ requirement: &70184090082680 !ruby/object:Gem::Requirement
41
39
  none: false
42
- requirements:
43
- - - ">="
44
- - !ruby/object:Gem::Version
45
- hash: 3
46
- segments:
47
- - 0
48
- version: "0"
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
49
44
  type: :development
50
- version_requirements: *id002
51
- description: Personfify is meant for use in environments where templates just need to be personalized.
45
+ prerelease: false
46
+ version_requirements: *70184090082680
47
+ description: Personfify is meant for use in environments where templates just need
48
+ to be personalized.
52
49
  email: flurin@digitpaint.nl
53
50
  executables: []
54
-
55
51
  extensions: []
56
-
57
- extra_rdoc_files:
52
+ extra_rdoc_files:
58
53
  - LICENSE
59
54
  - README.md
60
- files:
61
- - .gitignore
55
+ files:
62
56
  - .rvmrc
63
57
  - LICENSE
64
58
  - README.md
@@ -76,42 +70,28 @@ files:
76
70
  - test/parse_runner.rb
77
71
  - test/parser_test.rb
78
72
  - test/test_helper.rb
79
- has_rdoc: true
80
73
  homepage: http://github.com/digitpaint/personify
81
74
  licenses: []
82
-
83
75
  post_install_message:
84
- rdoc_options:
85
- - --charset=UTF-8
86
- require_paths:
76
+ rdoc_options: []
77
+ require_paths:
87
78
  - lib
88
- required_ruby_version: !ruby/object:Gem::Requirement
79
+ required_ruby_version: !ruby/object:Gem::Requirement
89
80
  none: false
90
- requirements:
91
- - - ">="
92
- - !ruby/object:Gem::Version
93
- hash: 3
94
- segments:
95
- - 0
96
- version: "0"
97
- required_rubygems_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ! '>='
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ required_rubygems_version: !ruby/object:Gem::Requirement
98
86
  none: false
99
- requirements:
100
- - - ">="
101
- - !ruby/object:Gem::Version
102
- hash: 3
103
- segments:
104
- - 0
105
- version: "0"
87
+ requirements:
88
+ - - ! '>='
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
106
91
  requirements: []
107
-
108
92
  rubyforge_project:
109
- rubygems_version: 1.3.7
93
+ rubygems_version: 1.8.6
110
94
  signing_key:
111
95
  specification_version: 3
112
96
  summary: A personalisation template language
113
- test_files:
114
- - test/context_test.rb
115
- - test/parse_runner.rb
116
- - test/parser_test.rb
117
- - test/test_helper.rb
97
+ test_files: []
data/.gitignore DELETED
@@ -1,2 +0,0 @@
1
- .DS_Store
2
- personify.gemspec