keynote 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of keynote might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.travis.yml +8 -3
- data/Appraisals +11 -6
- data/CHANGELOG.md +6 -0
- data/gemfiles/rails30.gemfile +1 -1
- data/gemfiles/rails31.gemfile +1 -1
- data/gemfiles/rails32.gemfile +2 -2
- data/gemfiles/{rails4.gemfile → rails40.gemfile} +1 -1
- data/gemfiles/rails41.gemfile +8 -0
- data/keynote.gemspec +12 -3
- data/lib/keynote/inline.rb +1 -1
- data/lib/keynote/railtie.rb +1 -1
- data/lib/keynote/testing/rspec.rb +1 -0
- data/lib/keynote/version.rb +1 -1
- data/spec/generator_spec.rb +33 -30
- data/spec/helper.rb +1 -1
- data/spec/keynote_spec.rb +13 -12
- data/spec/rumble_spec.rb +10 -6
- metadata +16 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe0ac56847bb40c91206e3e3e40854bf60efd579
|
4
|
+
data.tar.gz: b81181cb6d60f7cbf441d9724a809977e7293de2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b11e1e2610c5f467911bb09a90bd2d98cb410a256033fa252e03eebb6797ac706739c4a23332312979bfc29824fe7d132493c890be0f4a5f6aa39fb98547ee0
|
7
|
+
data.tar.gz: 08927b3f127d54403e289798d728d88ba6a8b50085ef71f475308d6f34811f3c74ed1822914980e4b23f6b3e53820056a30ac84ed26a25f6d8f1bb15c6be44b5
|
data/.travis.yml
CHANGED
@@ -3,15 +3,20 @@ rvm:
|
|
3
3
|
- 1.9.2
|
4
4
|
- 1.9.3
|
5
5
|
- 2.0.0
|
6
|
-
-
|
6
|
+
- 2.1.0
|
7
|
+
- rbx
|
8
|
+
- jruby-19mode
|
7
9
|
gemfile:
|
8
10
|
- gemfiles/rails30.gemfile
|
9
11
|
- gemfiles/rails31.gemfile
|
10
12
|
- gemfiles/rails32.gemfile
|
11
|
-
- gemfiles/
|
13
|
+
- gemfiles/rails40.gemfile
|
14
|
+
- gemfiles/rails41.gemfile
|
12
15
|
matrix:
|
13
16
|
exclude:
|
14
17
|
- rvm: 1.9.2
|
15
|
-
gemfile: gemfiles/
|
18
|
+
gemfile: gemfiles/rails40.gemfile
|
19
|
+
- rvm: 1.9.2
|
20
|
+
gemfile: gemfiles/rails41.gemfile
|
16
21
|
notifications:
|
17
22
|
email: false
|
data/Appraisals
CHANGED
@@ -1,19 +1,24 @@
|
|
1
1
|
appraise "rails30" do
|
2
2
|
gem "rails", "3.0.20"
|
3
|
-
gem "
|
3
|
+
gem "minitest", "< 5"
|
4
4
|
end
|
5
5
|
|
6
6
|
appraise "rails31" do
|
7
7
|
gem "rails", "3.1.12"
|
8
|
-
gem "
|
8
|
+
gem "minitest", "< 5"
|
9
9
|
end
|
10
10
|
|
11
11
|
appraise "rails32" do
|
12
|
-
gem "rails", "3.2.
|
13
|
-
gem "
|
12
|
+
gem "rails", "3.2.16"
|
13
|
+
gem "minitest", "< 5"
|
14
14
|
end
|
15
15
|
|
16
|
-
appraise "
|
16
|
+
appraise "rails40" do
|
17
17
|
gem "rails", "4.0.0"
|
18
|
-
gem "
|
18
|
+
gem "minitest", "< 5"
|
19
|
+
end
|
20
|
+
|
21
|
+
appraise "rails41" do
|
22
|
+
gem "rails", "4.1.0.beta1"
|
23
|
+
gem "minitest", "~> 5.0"
|
19
24
|
end
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
## v0.2.1
|
2
|
+
* Update configuration to test across MRI 1.9.2/1.9.3/2.0.0/2.1.0, Rubinius,
|
3
|
+
JRuby, Rails 3.0/3.1/3.2/4.0/4.1.
|
4
|
+
* Fix issue #6, in which the order of dependencies in the Gemfile could keep
|
5
|
+
Keynote's RSpec integration from loading correctly.
|
6
|
+
|
1
7
|
## v0.2.0
|
2
8
|
* Add `Keynote::Inline`, a module that presenters can extend to enable inline
|
3
9
|
templating in any language supported by Rails.
|
data/gemfiles/rails30.gemfile
CHANGED
data/gemfiles/rails31.gemfile
CHANGED
data/gemfiles/rails32.gemfile
CHANGED
data/keynote.gemspec
CHANGED
@@ -22,13 +22,22 @@ Gem::Specification.new do |gem|
|
|
22
22
|
gem.add_dependency 'rails', '>= 3.0.0'
|
23
23
|
|
24
24
|
gem.add_development_dependency 'appraisal'
|
25
|
-
gem.add_development_dependency 'minitest'
|
26
|
-
gem.add_development_dependency 'mocha', '~> 0.
|
25
|
+
gem.add_development_dependency 'minitest'
|
26
|
+
gem.add_development_dependency 'mocha', '~> 1.0.0'
|
27
27
|
gem.add_development_dependency 'pry'
|
28
|
-
gem.add_development_dependency 'redcarpet'
|
29
28
|
gem.add_development_dependency 'simplecov'
|
30
29
|
gem.add_development_dependency 'yard'
|
31
30
|
|
32
31
|
gem.add_development_dependency 'slim'
|
33
32
|
gem.add_development_dependency 'haml'
|
33
|
+
|
34
|
+
unless RbConfig::CONFIG['ruby_install_name'] == 'jruby'
|
35
|
+
gem.add_development_dependency 'redcarpet'
|
36
|
+
end
|
37
|
+
|
38
|
+
if RbConfig::CONFIG['ruby_install_name'] == 'rbx'
|
39
|
+
gem.add_development_dependency 'racc'
|
40
|
+
gem.add_development_dependency 'rubysl'
|
41
|
+
gem.add_development_dependency 'rubysl-test-unit'
|
42
|
+
end
|
34
43
|
end
|
data/lib/keynote/inline.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
|
+
require "action_view"
|
3
4
|
require "thread"
|
4
5
|
|
5
6
|
module Keynote
|
@@ -89,7 +90,6 @@ module Keynote
|
|
89
90
|
# end
|
90
91
|
# end
|
91
92
|
def inline(*formats)
|
92
|
-
require "action_view"
|
93
93
|
require "action_view/context"
|
94
94
|
|
95
95
|
Array(formats).each do |format|
|
data/lib/keynote/railtie.rb
CHANGED
data/lib/keynote/version.rb
CHANGED
data/spec/generator_spec.rb
CHANGED
@@ -66,41 +66,44 @@ describe "generators" do
|
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
69
|
+
# Temporary workaround until MT::R supports MT5 and Rails 4.1
|
70
|
+
unless Rails::VERSION.to_s.start_with? "4.1.0"
|
71
|
+
it "should generate a presenter and MiniTest::Rails spec file" do
|
72
|
+
Rails.application.config.generators do |g|
|
73
|
+
g.test_framework :mini_test, :spec => true
|
74
|
+
end
|
75
|
+
|
76
|
+
invoke_generator 'post' do |files|
|
77
|
+
files.must_equal %w(
|
78
|
+
app/presenters/post_presenter.rb
|
79
|
+
test/presenters/post_presenter_test.rb
|
80
|
+
)
|
81
|
+
|
82
|
+
file_contents('app/presenters/post_presenter.rb').
|
83
|
+
must_match /class PostPresenter < Keynote::Presenter/
|
84
|
+
|
85
|
+
file_contents('test/presenters/post_presenter_test.rb').
|
86
|
+
must_match /describe PostPresenter do/
|
87
|
+
end
|
85
88
|
end
|
86
|
-
end
|
87
89
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
90
|
+
it "should generate a presenter and MiniTest::Rails unit file" do
|
91
|
+
Rails.application.config.generators do |g|
|
92
|
+
g.test_framework :mini_test, :spec => false
|
93
|
+
end
|
92
94
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
95
|
+
invoke_generator 'post' do |files|
|
96
|
+
files.must_equal %w(
|
97
|
+
app/presenters/post_presenter.rb
|
98
|
+
test/presenters/post_presenter_test.rb
|
99
|
+
)
|
98
100
|
|
99
|
-
|
100
|
-
|
101
|
+
file_contents('app/presenters/post_presenter.rb').
|
102
|
+
must_match /class PostPresenter < Keynote::Presenter/
|
101
103
|
|
102
|
-
|
103
|
-
|
104
|
+
file_contents('test/presenters/post_presenter_test.rb').
|
105
|
+
must_match /class PostPresenterTest < Keynote::TestCase/
|
106
|
+
end
|
104
107
|
end
|
105
108
|
end
|
106
109
|
end
|
data/spec/helper.rb
CHANGED
data/spec/keynote_spec.rb
CHANGED
@@ -3,26 +3,28 @@
|
|
3
3
|
require 'helper'
|
4
4
|
|
5
5
|
describe Keynote do
|
6
|
+
let(:view) { Object.new }
|
7
|
+
|
6
8
|
describe "with a normal presenter" do
|
7
9
|
let(:model) { Normal.new }
|
8
10
|
|
9
11
|
it "should find and instantiate implicitly" do
|
10
|
-
p = Keynote.present(
|
12
|
+
p = Keynote.present(view, model)
|
11
13
|
|
12
14
|
p.wont_be_nil
|
13
15
|
p.must_be_instance_of NormalPresenter
|
14
16
|
|
15
|
-
p.view.must_equal
|
17
|
+
p.view.must_equal view
|
16
18
|
p.model.must_equal model
|
17
19
|
end
|
18
20
|
|
19
21
|
it "should find and instantiate explicitly" do
|
20
|
-
p = Keynote.present(
|
22
|
+
p = Keynote.present(view, :normal, 'hello')
|
21
23
|
|
22
24
|
p.wont_be_nil
|
23
25
|
p.must_be_instance_of NormalPresenter
|
24
26
|
|
25
|
-
p.view.must_equal
|
27
|
+
p.view.must_equal view
|
26
28
|
p.model.must_equal 'hello'
|
27
29
|
end
|
28
30
|
|
@@ -30,19 +32,19 @@ describe Keynote do
|
|
30
32
|
m = mock()
|
31
33
|
m.expects(:block_yielded)
|
32
34
|
|
33
|
-
Keynote.present(
|
35
|
+
Keynote.present(view, :normal, 'hello') do |p|
|
34
36
|
m.block_yielded
|
35
37
|
|
36
38
|
p.wont_be_nil
|
37
39
|
p.must_be_instance_of NormalPresenter
|
38
40
|
|
39
|
-
p.view.must_equal
|
41
|
+
p.view.must_equal view
|
40
42
|
p.model.must_equal 'hello'
|
41
43
|
end
|
42
44
|
end
|
43
45
|
|
44
46
|
it "should integrate with Rumble" do
|
45
|
-
p = Keynote.present(
|
47
|
+
p = Keynote.present(view, model)
|
46
48
|
rx = /<div><script>alert\(/
|
47
49
|
|
48
50
|
p.some_bad_html.scan(rx).count.must_equal 3
|
@@ -53,29 +55,28 @@ describe Keynote do
|
|
53
55
|
let(:model) { Keynote::Nested.new }
|
54
56
|
|
55
57
|
it "should find and instantiate implicitly" do
|
56
|
-
p = Keynote.present(
|
58
|
+
p = Keynote.present(view, model)
|
57
59
|
|
58
60
|
p.wont_be_nil
|
59
61
|
p.must_be_instance_of Keynote::NestedPresenter
|
60
62
|
|
61
|
-
p.view.must_equal
|
63
|
+
p.view.must_equal view
|
62
64
|
p.model.must_equal model
|
63
65
|
end
|
64
66
|
|
65
67
|
it "should find and instantiate explicitly" do
|
66
|
-
p = Keynote.present(
|
68
|
+
p = Keynote.present(view, :"keynote/nested", 'hello')
|
67
69
|
|
68
70
|
p.wont_be_nil
|
69
71
|
p.must_be_instance_of Keynote::NestedPresenter
|
70
72
|
|
71
|
-
p.view.must_equal
|
73
|
+
p.view.must_equal view
|
72
74
|
p.model.must_equal 'hello'
|
73
75
|
end
|
74
76
|
end
|
75
77
|
|
76
78
|
describe "caching" do
|
77
79
|
describe "when there is a view context" do
|
78
|
-
let(:view) { Object.new }
|
79
80
|
let(:view_2) { Object.new }
|
80
81
|
|
81
82
|
it "should cache based on the models" do
|
data/spec/rumble_spec.rb
CHANGED
@@ -4,10 +4,14 @@
|
|
4
4
|
|
5
5
|
require 'helper'
|
6
6
|
|
7
|
-
|
7
|
+
if defined?(Minitest::Test)
|
8
|
+
klass = Minitest::Test
|
9
|
+
else
|
10
|
+
klass = MiniTest::Unit::TestCase
|
11
|
+
end
|
8
12
|
|
9
|
-
class TestRumble <
|
10
|
-
include Rumble
|
13
|
+
class TestRumble < klass
|
14
|
+
include Keynote::Rumble
|
11
15
|
|
12
16
|
def assert_rumble(str, &blk)
|
13
17
|
exp = str.gsub(/(\s+(<)|>\s+)/) { $2 || '>' }
|
@@ -167,13 +171,13 @@ class TestRumble < MiniTest::Unit::TestCase
|
|
167
171
|
end
|
168
172
|
|
169
173
|
def test_error_tags_outside_rumble_context
|
170
|
-
assert_raises Rumble::Error do
|
174
|
+
assert_raises Keynote::Rumble::Error do
|
171
175
|
div "content"
|
172
176
|
end
|
173
177
|
end
|
174
178
|
|
175
179
|
def test_error_selfclosing_content
|
176
|
-
assert_raises Rumble::Error do
|
180
|
+
assert_raises Keynote::Rumble::Error do
|
177
181
|
build_html {
|
178
182
|
br "content"
|
179
183
|
}
|
@@ -181,7 +185,7 @@ class TestRumble < MiniTest::Unit::TestCase
|
|
181
185
|
end
|
182
186
|
|
183
187
|
def test_error_css_proxy_continue
|
184
|
-
assert_raises Rumble::Error do
|
188
|
+
assert_raises Keynote::Rumble::Error do
|
185
189
|
build_html {
|
186
190
|
p.one("test").two
|
187
191
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: keynote
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Fitzgerald
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -42,30 +42,30 @@ dependencies:
|
|
42
42
|
name: minitest
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - '>='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: mocha
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.
|
61
|
+
version: 1.0.0
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.
|
68
|
+
version: 1.0.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: pry
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,7 +81,7 @@ dependencies:
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: simplecov
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - '>='
|
@@ -95,7 +95,7 @@ dependencies:
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: yard
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - '>='
|
@@ -109,7 +109,7 @@ dependencies:
|
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
112
|
+
name: slim
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - '>='
|
@@ -123,7 +123,7 @@ dependencies:
|
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
126
|
+
name: haml
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
129
|
- - '>='
|
@@ -137,7 +137,7 @@ dependencies:
|
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
|
-
name:
|
140
|
+
name: redcarpet
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
143
|
- - '>='
|
@@ -172,7 +172,8 @@ files:
|
|
172
172
|
- gemfiles/rails30.gemfile
|
173
173
|
- gemfiles/rails31.gemfile
|
174
174
|
- gemfiles/rails32.gemfile
|
175
|
-
- gemfiles/
|
175
|
+
- gemfiles/rails40.gemfile
|
176
|
+
- gemfiles/rails41.gemfile
|
176
177
|
- keynote.gemspec
|
177
178
|
- lib/generators/presenter_generator.rb
|
178
179
|
- lib/generators/templates/keynote_mini_test_spec.rb
|
@@ -222,7 +223,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
222
223
|
version: '0'
|
223
224
|
requirements: []
|
224
225
|
rubyforge_project:
|
225
|
-
rubygems_version: 2.0.
|
226
|
+
rubygems_version: 2.0.14
|
226
227
|
signing_key:
|
227
228
|
specification_version: 4
|
228
229
|
summary: Flexible presenters for Rails.
|