keynote 0.2.2 → 0.2.3
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 +1 -1
- data/CHANGELOG.md +9 -0
- data/README.md +1 -1
- data/lib/keynote.rb +2 -2
- data/lib/keynote/testing/rspec.rb +9 -3
- data/lib/keynote/version.rb +1 -1
- data/spec/keynote_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db51baa66be9c4cbbce4723f556826bdf5cdf1e6
|
4
|
+
data.tar.gz: 8d90665dc6a5cb0d604fbabef3399169d8b24b8a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b05cbcae3d9faac3fc259ad2457b2cbbeabc148511992a9d2fab8f7d13d6056a8006d39a69afedfcd54df29d756312c9f053a4be1c5b3e6c202b60f896728a4
|
7
|
+
data.tar.gz: 37695c36a41203f443ad7381199429c66811391fb09a8717f85782e72774642a01cac7887e5f15e819b2eac3ef490e9ec25ce360272da541543d3aacf8b3abe4
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
## v0.2.3
|
2
|
+
* Allow user to pass the string version of the presenter name into
|
3
|
+
`Keynote.present` as an alternative to passing a symbol. This makes it less
|
4
|
+
awkward to use namespaced presenters, but it does remove the possibility of
|
5
|
+
defining a `StringPresenter` and using it with code like
|
6
|
+
`k('some string').format_as_markdown`. It seems unlikely that anyone is
|
7
|
+
actually doing that though.
|
8
|
+
* Update RSpec integration to not print deprecation warnings with RSpec 3.
|
9
|
+
|
1
10
|
## v0.2.2
|
2
11
|
* Fix another RSpec integration bug, which happened in cases where the app's
|
3
12
|
Gemfile included rspec-rails but not the rspec gem itself.
|
data/README.md
CHANGED
@@ -48,7 +48,7 @@ a view, helper, controller, or another presenter.
|
|
48
48
|
</div>
|
49
49
|
```
|
50
50
|
|
51
|
-
If you pass anything other than a symbol as the first parameter of
|
51
|
+
If you pass anything other than a symbol or string as the first parameter of
|
52
52
|
`present`/`k`, Keynote will assume you want to instantiate a presenter named
|
53
53
|
after the class of that object -- in this case, the model is a `User`, so
|
54
54
|
Keynote looks for a class called `UserPresenter`.
|
data/lib/keynote.rb
CHANGED
@@ -42,12 +42,12 @@ module Keynote
|
|
42
42
|
# @example
|
43
43
|
# present(view, :foo_bar, MyModel.new) # => #<FooBarPresenter:0x0002>
|
44
44
|
# @param [ActionView::Base] view
|
45
|
-
# @param [Symbol] presenter_name
|
45
|
+
# @param [Symbol, String] presenter_name
|
46
46
|
# @param [Array] objects
|
47
47
|
# @return [Keynote::Presenter]
|
48
48
|
#
|
49
49
|
def present(view, *objects)
|
50
|
-
if objects[0].is_a?(Symbol)
|
50
|
+
if objects[0].is_a?(Symbol) || objects[0].is_a?(String)
|
51
51
|
name = objects.shift
|
52
52
|
else
|
53
53
|
name = presenter_name_from_object(objects[0])
|
@@ -14,7 +14,13 @@ module Keynote
|
|
14
14
|
end
|
15
15
|
|
16
16
|
RSpec.configure do |config|
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
if RSpec::Core::Version::STRING.starts_with?("3")
|
18
|
+
config.include Keynote::ExampleGroup,
|
19
|
+
:type => :presenter,
|
20
|
+
:file_path => %r/spec.presenters/
|
21
|
+
else
|
22
|
+
config.include Keynote::ExampleGroup,
|
23
|
+
:type => :presenter,
|
24
|
+
:example_group => { :file_path => %r/spec.presenters/ }
|
25
|
+
end
|
20
26
|
end
|
data/lib/keynote/version.rb
CHANGED
data/spec/keynote_spec.rb
CHANGED
@@ -65,7 +65,7 @@ describe Keynote do
|
|
65
65
|
end
|
66
66
|
|
67
67
|
it "should find and instantiate explicitly" do
|
68
|
-
p = Keynote.present(view,
|
68
|
+
p = Keynote.present(view, "keynote/nested", 'hello')
|
69
69
|
|
70
70
|
p.wont_be_nil
|
71
71
|
p.must_be_instance_of Keynote::NestedPresenter
|
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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Fitzgerald
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|