render_with_view 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: dd04d6b67b1beecdd49900563e12f702af15b8fa
4
- data.tar.gz: 94e175806972868258a5a8fc8dcd3a08d2177b3c
2
+ SHA256:
3
+ metadata.gz: 4ce39e99f14378e09ecf2d05a778d02b1184260e19dd9b03faa6495cd19852f9
4
+ data.tar.gz: 357ae6071ce03ac319d32e7ee380f8582539c0d2734c382d6a8f81ba102b6d72
5
5
  SHA512:
6
- metadata.gz: 406d125e96f6caf8b639d00a4747a2d05e24ba89e008d37ed10e238051d320da22ff62cd36983beaee1ed968b6b64dec0d911a0becea67381f320072f8bedce8
7
- data.tar.gz: ed81fe1fd2d8431bf4013fdb782acc3c69cf35e05686b2e78bd66cd51226f302e43605a4aa2a5a5439f4a649223bfb7e0f837f5cce9ab6684dfc04a48b397bf3
6
+ metadata.gz: 9768fc7965cfa1fd6fbcca1f71b6cfd9241af8bacd5b67a15f0a122311d1a1339fbd7ce61efdefe3df9ac1774172074d175f285affba840303e6657efecc84ee
7
+ data.tar.gz: 43d43d3d3c2b751b0d82dd2ef6c198a332a1ddad97c04ed85560611ff497a11e7d049f828c9727e268fde9d8c5e66a9e9bc15581e3095700c7fc4bb4a5201231
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
1
  pkg/*
2
2
  *.gem
3
3
  .bundle
4
+ Gemfile.lock
@@ -2,25 +2,22 @@ require 'render_with_view/version'
2
2
  require 'render_with_view/half_open_struct'
3
3
 
4
4
  module RenderWithView
5
- class View < HalfOpenStruct; end
5
+ class View < HalfOpenStruct
6
+ end
6
7
 
7
- def self.included kls
8
- kls.class_eval do
9
- def render_with_view *args
10
- if !args.first.is_a?(Hash)
11
- tmpl = args.shift
12
- else
13
- tmpl = action_name
14
- end
15
- locals = args.shift
16
- opts = args.shift || {}
8
+ def render_with_view *args
9
+ if !args.first.is_a?(Hash)
10
+ tmpl = args.shift
11
+ else
12
+ tmpl = action_name
13
+ end
14
+ locals = args.shift
15
+ opts = args.shift || {}
17
16
 
18
- # save to ivar for testing purposes
19
- @__view__ = View.new(locals)
17
+ # save to ivar for testing purposes
18
+ @__view__ = View.new(locals)
20
19
 
21
- render tmpl, opts.merge(locals: { view: @__view__ })
22
- end
23
- end
20
+ render tmpl, opts.merge(locals: { view: @__view__ })
24
21
  end
25
22
  end
26
23
 
@@ -1,3 +1,3 @@
1
1
  module RenderWithView
2
- VERSION = '0.1.2'
2
+ VERSION = '0.1.3'
3
3
  end
@@ -11,6 +11,9 @@ Gem::Specification.new do |s|
11
11
  s.homepage = 'https://github.com/mikker/render_with_view'
12
12
  s.license = 'MIT'
13
13
 
14
+ s.add_dependency 'rails'
15
+ s.add_development_dependency 'rspec'
16
+
14
17
  s.files = `git ls-files`.split("\n")
15
18
  s.require_path = "lib"
16
19
  end
@@ -37,13 +37,13 @@ RSpec.describe RenderWithView do
37
37
 
38
38
  it "includes options" do
39
39
  user = { id: 1 }
40
- opts = { flash: {notice: "YAS!"} }
40
+ opts = { status: 401 }
41
41
  ctrl = FakeController.new
42
42
 
43
43
  ctrl.render_with_view(:edit, {user: user}, opts)
44
44
  tmpl, opts = ctrl.calls.last
45
45
  expect(tmpl).to eq :edit
46
- expect(opts[:flash]).to eq({notice: "YAS!"})
46
+ expect(opts[:status]).to eq(401)
47
47
  end
48
48
  end
49
49
 
metadata CHANGED
@@ -1,15 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: render_with_view
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikkel Malmberg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-15 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2019-10-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
13
41
  description:
14
42
  email:
15
43
  - mikkel@brnbw.com
@@ -50,8 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
50
78
  - !ruby/object:Gem::Version
51
79
  version: '0'
52
80
  requirements: []
53
- rubyforge_project:
54
- rubygems_version: 2.5.1
81
+ rubygems_version: 3.0.3
55
82
  signing_key:
56
83
  specification_version: 4
57
84
  summary: Be explicit about what you send to your Rails views